@ethisyscore/extension-runtime

中文文档
1.167.0发布于 2026/10/25SEE LICENSE IN LICENSETypeScriptESM + CJS近 30 天下载 9050

Host + plugin runtime for EthisysCore Contract A (host-rendered) and Contract B (worker remote-runtime) extensions.

此软件包已被标记为弃用

This package has moved to the Ethisys Core package feed. In Ethisys Core, open the Developers page and follow the setup steps (cc login connects npm to the feed).

原始使用文档
文档目录4 节
  1. Subpath exports
  2. Local development
  3. Scripts
  4. Targets

@ethisyscore/extension-runtime

Host + plugin runtime for EthisysCore extension contracts:

  • Contract A — host-rendered SDUI extensions. Plugins return a closed-vocabulary SduiNode tree from a ResourceHandler; the host's declarative interpreter mounts it directly.
  • Contract B — worker remote-runtime extensions. Plugin code runs in a sandboxed Web Worker; UI mutations flow via Remote DOM into the host's semantic primitive registry. The capability token never crosses the worker boundary.

Built on top of @ethisyscore/protocol (canonical bridge / manifest / SDUI / capability / theme types).

Subpath exports

EntryUseSurface
@ethisyscore/extension-runtimeRoot re-exportsStable consumer-facing types and helpers.
@ethisyscore/extension-runtime/hostHost integrationWorkerRemoteDomTransport, declarative interpreter, semantic component registry, offscreen-canvas helpers.
@ethisyscore/extension-runtime/pluginPlugin sideExtensionRuntimeProvider, useMcpResource, useMcpTool, transport abstraction, uploadFileToPluginStorage (browser file → the app's own plugin storage via the uploadToStorage request kind).
@ethisyscore/extension-runtime/mock-hostLocal devDeclarativeMockHost, InMemoryMcpTransport (its uploadToStorage writes to an in-memory MockPluginStorage) and the mock-host CLI entry.

The mock-host bin (npx mock-host <dir>) is shipped — boots a Vite dev page that mounts the declarative interpreter against a directory of SDUI JSON resources. Run --render-mode remote-runtime <bundle> for the Contract B variant.

Local development

This package consumes @ethisyscore/protocol via npm link. The protocol package is registered globally in E1.S8:

cd <repo>/sdk/extension-runtime
npm install
npm link @ethisyscore/protocol

Scripts

ScriptPurpose
npm run buildBuild ESM + CJS + .d.ts via tsup
npm testRun unit tests (Vitest, jsdom)
npm run lintType-check only (tsc --noEmit)

Targets

  • Node.js >= 20
  • React >= 18 (peer dep, required by ./host and ./plugin subpaths in later tasks)

版本与发布记录

@ethisyscore/extension-runtime 共发布 248 个版本,首次发布于 2026/05/20;过去 12 个月发布了 248 个版本。

版本发布日期距今
1.167.0latest2026/10/2520 天前
1.166.02026/10/2420 天前
1.165.02026/10/2420 天前
1.164.02026/10/2321 天前
1.163.32026/10/2321 天前
1.163.22026/10/2321 天前

关于 @ethisyscore/extension-runtime 的常见问题

@ethisyscore/extension-runtime 是什么?

Host + plugin runtime for EthisysCore Contract A (host-rendered) and Contract B (worker remote-runtime) extensions.注意:该包已被作者标记为弃用——This package has moved to the Ethisys Core package feed. In Ethisys Core, open the Developers page and follow the setup steps (cc login connects npm to the feed).

如何安装 @ethisyscore/extension-runtime?

在项目目录运行 npm install @ethisyscore/extension-runtime,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 mock-host,可以用 npx mock-host 直接运行。

@ethisyscore/extension-runtime 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ethisyscore/extension-runtime 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ethisyscore/extension-runtime 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ethisyscore/extension-runtime 可以商用吗?

@ethisyscore/extension-runtime 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@ethisyscore/extension-runtime 的下载量有多少?

根据 npm 官方下载统计,@ethisyscore/extension-runtime 在 2026/10/14 – 2026/11/12 这 30 天内被下载 9,050 次,日均约 302 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ethisyscore/extension-runtime 还在维护吗?

最新版本 1.167.0 发布于 2026/10/25(20 天前);至今共发布 248 个版本,其中过去 12 个月发布了 248 个;首次发布于 2026/05/20。作者已将其标记为弃用,新项目建议寻找替代方案。