@deepseek-ai/dsh-cordis-host-runner 0.1.6-alpha.1 → 0.1.6-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/extensions/cordis-host-runner/README.md
5
- README.md: c9f573557607163103adc0ab7277f3ab569d7ab8
6
- README.zh.md: 10c38095ef30025a8b513e7587b1df381d6316a5
5
+ README.md: 67df264fe2b4a76df6587a726e72e6300c507912
6
+ README.zh.md: 0c8659078e3a78d3ce7284ac4d2e988902f89143
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- `dsh-cordis-host-runner` makes dynamic packages runnable in this process: definitions the model records with `cordis_define` stay here, host halves run in a `node:vm` sandbox, a package with a browser half waits for a person to approve or decline it on a page, and the model can inspect the live runtime and its definitions here. The model-facing tools live in `@deepseek-ai/dsh-tool-cordis`, and the browser half loads through `@deepseek-ai/dsh-cordis-client-runner`. Definitions live only in process memory, so a DSH restart clears them and nothing is written to disk. One config field, `vmTimeoutMs`, bounds synchronous sandbox evaluation.
12
+ `dsh-cordis-host-runner` exposes runtime inspection and keeps process-local dynamic definitions available to programmatic callers and browser controls. Host halves run in a `node:vm` realm; browser halves use the Client runner and approval UI. Definitions disappear on restart. Agents discover APIs through `tool-cordis` and install persistent bundles through Plugin Manager; no model tool creates dynamic definitions.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -25,7 +25,7 @@ English | [中文](README.zh.md)
25
25
  <a id="use-this-package"></a>
26
26
  ## Use this package
27
27
 
28
- Mount this plugin in any composition that should support dynamic packages — it powers the model's `cordis_*` tools, and packages with a browser half additionally need the client runner plus the UI package composed on the client side. The common path is explicit: load this package, optionally set `vmTimeoutMs`, and let the tools and the browser do the rest.
28
+ Mount this plugin for the inspection registry or programmatic dynamic-package lifecycle. Browser lifecycle consumers also require the Client runner and UI package. The shipped Creator workflow uses installed bundles instead of this definition registry.
29
29
 
30
30
  ### Minimal configuration
31
31
 
@@ -43,11 +43,11 @@ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-a
43
43
 
44
44
  ### What a run does
45
45
 
46
- A definition is recorded by `cordis_define` and activated by `cordis_run`. A package with only a host half activates directly in this process: its code runs in the sandbox. A package with a browser half becomes a request: it waits until a person allows or declines it on a page, or the asking turn is cancelled; the answering page then loads the host half first and the browser half second. `mode: "run"` starts the current package or restarts it, `mode: "update"` switches to a different package version. `cordis_stop` ends the live run — removing the package's handlers and any loaded browser UI — while keeping the definition runnable; `cordis_undefine` stops and forgets it.
46
+ Programmatic callers use `define`, `run`, `stop`, and `undefine`; the browser panel operates existing definitions. Host-only packages activate in this process. A package with a browser half waits for approval or cancellation, then loads Host before Client. `mode: "run"` starts the current version; `mode: "update"` replaces it. Stop disposes the live effects and retains the definition; undefine also forgets it.
47
47
 
48
48
  ### What happens to definitions
49
49
 
50
- Definitions are session-scoped and process-local: a package is visible only to the session that defined it, other sessions read it as absent, and everything disappears on DSH restart. The session log keeps the define call's arguments — including the code it submitted — and the receipt; only the in-memory registry holds the parsed definition. A browser half reaches a page only through a run, so a reloaded page holds nothing until someone runs the package again.
50
+ Definitions are session-scoped and process-local: other sessions read them as absent, and restart clears them. Historical logs retain tool arguments and receipts but do not restore the registry. Reloading a browser page requires another explicit run to load its Client half.
51
51
 
52
52
  ### Trust stance
53
53
 
@@ -92,7 +92,7 @@ The runner is built on two separations. **Registry and sandbox are one service.*
92
92
 
93
93
  Read these pages when the package-level contract is not enough. They move from the runner to the tools that call it, the browser half that answers it, and the generated surface.
94
94
 
95
- - [Tool package](../tool-cordis/README.md) — the model-facing tools that call this service.
95
+ - [Tool package](../tool-cordis/README.md) — the read-only tools that use its inspection registry.
96
96
  - [Client runner](../cordis-client-runner/README.md) — the browser half that answers run requests and loads browser-half code.
97
97
  - [UI package](../ui-cordis/README.md) — the panel users approve and operate runs with.
98
98
  - [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-cordis-host-runner) — every accepted config field.
@@ -108,7 +108,7 @@ Read these pages when the package-level contract is not enough. They move from t
108
108
 
109
109
  #### What the model sees
110
110
 
111
- Nothing directly: this package registers no tool and injects no prompt. It steers the owning session when a run settles — a success names the current package and says to continue, a user rejection says not to request the same activation again, and a technical failure names the reason, the version pointers, and the inspect-then-correct-and-update path. It also steers post-settle render failures (slot, whether the entry was removed), host guard rejections, and host handler failures. Panel stop and remove gestures inject a user-role message naming what the user did. Refusals from `run` or `stop` also reach the model through the calling tool's result.
111
+ This package registers no tool or prompt. Programmatic `run` calls and browser controls can steer the owning session with outcomes and diagnostics; stop and remove gestures inject a user message. Shipped model tools cannot create or update dynamic definitions.
112
112
 
113
113
  #### Token effect
114
114
 
@@ -125,7 +125,7 @@ None of its own. A host half that registers tools changes the next request's too
125
125
 
126
126
  These limits define when the runner needs special care. They are current package constraints, not a task backlog.
127
127
 
128
- - **A successful run does not mean the UI rendered** — `run` returns once the answering page has loaded the browser half; React renders afterwards, so a component that throws cannot appear in the run receipt. The failure surfaces through steering and `cordis_inspect_self` diagnostics.
128
+ - **A successful run does not mean the UI rendered** — React renders after the load receipt; failures reach the owning session through steering and appear in the browser panel.
129
129
  - **A browser-half package suspends where no page is connected** — headless and ACP deployments hold the run until the asking turn is cancelled; host-only packages are unaffected.
130
130
  - **A suspended run request has no timeout** — it waits for a person until the asking turn is cancelled, so unattended automation cannot use packages with a browser half.
131
131
  - **`vmTimeoutMs` bounds only synchronous evaluation** — an async host-half body escapes it, matching the toolset's cooperative trust stance.
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-cordis-host-runner` 让动态包在本进程中可运行:模型用 `cordis_define` 记录的定义留在这里,host 半在 `node:vm` 沙箱中运行,带浏览器半的包会等待人在页面上批准或拒绝,模型也可以在这里检查实时运行时及其定义。面向模型的工具在 `@deepseek-ai/dsh-tool-cordis` 中,浏览器半经 `@deepseek-ai/dsh-cordis-client-runner` 装载。定义只存在于进程内存中,因此 DSH 重启即清空,也不会向磁盘写任何东西。唯一的配置字段 `vmTimeoutMs` 限制同步沙箱求值的时长。
12
+ `dsh-cordis-host-runner` 提供运行时检查,并为程序调用方和浏览器控件保留进程内动态定义。Host 部分在 `node:vm` 中运行;浏览器部分使用 Client runner 和审批 UI。定义在重启后消失。Agent 通过 `tool-cordis` 发现 API,通过 Plugin Manager 安装持久化 bundle;没有模型工具创建动态定义。
13
13
 
14
14
  ## 目录
15
15
 
@@ -25,7 +25,7 @@ kind: "package-reference"
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
- 在任何一个应当支持动态包的组合中挂载本插件——它支撑模型的 `cordis_*` 工具,而带浏览器半的包还需要在客户端组合中额外挂载 client runner 与 UI 包。常用路径是显式的:加载本包,按需设置 `vmTimeoutMs`,其余交给工具与浏览器。
28
+ 需要检查注册表或程序侧动态包生命周期时挂载此插件。浏览器生命周期消费者还需要 Client runner 和 UI 包。内置 Creator 流程使用已安装 bundle,不使用此定义注册表。
29
29
 
30
30
  ### 最小配置
31
31
 
@@ -43,11 +43,11 @@ kind: "package-reference"
43
43
 
44
44
  ### run 会做什么
45
45
 
46
- 定义由 `cordis_define` 记录、由 `cordis_run` 激活。只有 host 半的包直接在本进程中激活:它的代码在沙箱中运行。带浏览器半的包变成一次请求:它一直等到有人在一个页面上允许或拒绝,或提问的轮次被取消;作答页面随后先装载 host 半、再装载浏览器半。`mode: "run"` 启动当前包或重启它,`mode: "update"` 切换到另一个包版本。`cordis_stop` 结束一次存活运行——移除该包的 handler 与任何已装载的浏览器 UI——同时保留可再次运行的定义;`cordis_undefine` 停止并忘掉它。
46
+ 程序调用方使用 `define`、`run`、`stop` 和 `undefine`;浏览器面板操作已有定义。仅含 Host 的包在本进程激活。带浏览器部分的包等待审批或取消,批准后先加载 Host 再加载 Client。`mode: "run"` 启动当前版本,`mode: "update"` 替换版本。Stop 释放运行中的 effect 并保留定义;undefine 还会移除定义。
47
47
 
48
48
  ### 定义的去向
49
49
 
50
- 定义以会话为界、以进程为本:包只对定义它的会话可见,其他会话读取时视其为不存在,DSH 重启后一切都消失。会话日志保留一次 define 调用的参数——包括它提交的代码——以及回执;解析出的定义只存于内存注册表。浏览器半只能经一次运行到达页面,因此刷新后的页面手上什么都没有,直到有人再次运行该包。
50
+ 定义按会话隔离且仅在进程内存在:其他会话无法读取,重启会清空。历史日志保留工具参数和回执,但不会恢复注册表。浏览器页面重载后,需要再次显式运行才能加载 Client 部分。
51
51
 
52
52
  ### 信任立场
53
53
 
@@ -92,7 +92,7 @@ runner 基于两项职责划分。**注册表与沙箱是同一个服务。** `D
92
92
 
93
93
  当包级约定不够用时阅读以下页面。它们从 runner 逐步进入调用它的工具、应答它的浏览器半与生成的表面。
94
94
 
95
- - [工具包](../tool-cordis/README.zh.md)——调用本服务的模型侧工具。
95
+ - [工具包](../tool-cordis/README.zh.md)——使用其检查注册表的只读工具。
96
96
  - [Client runner](../cordis-client-runner/README.zh.md)——应答运行请求并装载浏览器半代码的浏览器半。
97
97
  - [UI 包](../ui-cordis/README.zh.md)——用户批准并操作运行的面板。
98
98
  - [生成的配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-cordis-host-runner)——每个受支持配置字段。
@@ -108,7 +108,7 @@ runner 基于两项职责划分。**注册表与沙箱是同一个服务。** `D
108
108
 
109
109
  #### 模型看到的内容
110
110
 
111
- 没有直接可见的内容:本包不注册任何工具,也不注入提示词。当一次 run 结算时,它会向所属会话发送 steering——成功时点名当前包并指示继续,用户拒绝时指示不要再次请求同一激活,技术性失败则给出原因、版本指针与「检查—修正—更新」路径。它还会通过 steering 转达结算后的渲染失败(slot、条目是否已被移除)、host guard 拒绝与 host handler 失败。面板上的停止与移除手势会注入一条 user 角色消息,说明用户做了什么。`run` 或 `stop` 的拒绝还会经调用它的工具结果到达模型。
111
+ 本包不注册工具或提示。程序侧 `run` 调用和浏览器控件可向所属会话发送结果与诊断;停止和移除操作注入用户消息。内置模型工具无法创建或更新动态定义。
112
112
 
113
113
  #### Token 影响
114
114
 
@@ -125,7 +125,7 @@ runner 基于两项职责划分。**注册表与沙箱是同一个服务。** `D
125
125
 
126
126
  这些限制说明 runner 何时需要特别小心。它们是当前包约束,不是任务积压。
127
127
 
128
- - **run 成功不等于 UI 渲染成功**——只要作答页面已装载浏览器半,`run` 就会返回;React 是随后才渲染的,因此抛异常的组件不可能出现在 run 回执里。该失败经 steering 与 `cordis_inspect_self` 诊断浮现。
128
+ - **运行成功不代表 UI 已渲染**——React 在加载回执之后渲染;失败通过 steering 发送到所属会话,并显示在浏览器面板中。
129
129
  - **带浏览器半的包在没有页面连接的地方挂起**——headless 与 ACP(Agent Client Protocol)部署会把 run 一直挂到提问的轮次被取消;纯 host 包不受影响。
130
130
  - **挂起的 run 请求没有超时**——它一直等人,直到提问的轮次被取消,因此无人值守的自动化用不了带浏览器半的包。
131
131
  - **`vmTimeoutMs` 只约束同步求值**——async 的 host 半函数体会逃出该上限,这与工具集基于协作的信任立场一致。
package/lib/index.js CHANGED
@@ -922,7 +922,7 @@ async function startHostHalf(group, plugin, reportGuardFailure) {
922
922
  } catch (error) {
923
923
  await fiber.dispose();
924
924
  const message = error instanceof Error ? error.message : String(error);
925
- if (message.includes("already registered")) throw new Error(`${message} — to REPLACE something an earlier dynamic package registered, first cordis_stop that package's id (find it with cordis_runtime_inspect what:"temporary"), then run the new version.`);
925
+ if (message.includes("already registered")) throw new Error(`${message} — to REPLACE something an earlier dynamic package registered, first stop that package through its runner or the Cordis panel before running the new version.`);
926
926
  throw error instanceof Error ? error : new Error(message);
927
927
  }
928
928
  return fiber;
@@ -2392,7 +2392,7 @@ let DynamicCordisRunnerService = (() => {
2392
2392
  else if (settled.reason === "rejected") text = `The user rejected Cordis ${pending.mode} ${identity}. Do not request the same activation again unless the user asks.`;
2393
2393
  else {
2394
2394
  const returnedStatus = pending.requiresApproval ? "awaiting-approval" : "starting";
2395
- text = `Cordis ${pending.mode} ${identity} failed after cordis_run returned ${returnedStatus}: ${settled.reason}\n${formatErrorDetails(settled)}\ncurrentPackageId: ${plugin?.currentPackageId ?? "none"}\nnextPackageId: ${plugin?.nextPackageId ?? pending.packageId}\nInspect the failed Package, correct it on the same Plugin when needed, and retry the activation autonomously.`;
2395
+ text = `Cordis ${pending.mode} ${identity} failed after the runner returned ${returnedStatus}: ${settled.reason}\n${formatErrorDetails(settled)}\ncurrentPackageId: ${plugin?.currentPackageId ?? "none"}\nnextPackageId: ${plugin?.nextPackageId ?? pending.packageId}\nReport the failure to the user; the definition can be managed through the Cordis panel.`;
2396
2396
  }
2397
2397
  agent.steer(createUserMessage({
2398
2398
  content: [{
@@ -2409,7 +2409,7 @@ let DynamicCordisRunnerService = (() => {
2409
2409
  agent.steer(createUserMessage({
2410
2410
  content: [{
2411
2411
  type: "text",
2412
- text: `Cordis Client UI ${plugin.pluginId}/${definition.packageId} (${pluginRunId}) failed while rendering Slot "${failure.slot}" after activation.\n${formatErrorDetails(failure)}\nentryAbdicated: ${failure.abdicated}\nInspect the failed Package, fix the Client code by defining a new Package on the same Plugin, and activate that Package autonomously with cordis_run mode:"update".`
2412
+ text: `Cordis Client UI ${plugin.pluginId}/${definition.packageId} (${pluginRunId}) failed while rendering Slot "${failure.slot}" after activation.\n${formatErrorDetails(failure)}\nentryAbdicated: ${failure.abdicated}\nReport the Client render failure to the user; the definition can be stopped through the Cordis panel.`
2413
2413
  }],
2414
2414
  source: {
2415
2415
  kind: "plugin",
@@ -2425,7 +2425,7 @@ let DynamicCordisRunnerService = (() => {
2425
2425
  agent.steer(createUserMessage({
2426
2426
  content: [{
2427
2427
  type: "text",
2428
- text: `Cordis Host handler ${plugin.pluginId}/${run.packageId} (${run.pluginRunId}) failed when the Client called host.call(${JSON.stringify(method)}).\n${formatErrorDetails(failure)}\nThe Plugin remains running. Inspect this Package, correct the Host code on the same Plugin, and activate the new Package autonomously with cordis_run mode:"update". If the handler needs a Service, either declare that Service in the returned Plugin inject list or read it with ctx.get(name) and handle undefined.`
2428
+ text: `Cordis Host handler ${plugin.pluginId}/${run.packageId} (${run.pluginRunId}) failed when the Client called host.call(${JSON.stringify(method)}).\n${formatErrorDetails(failure)}\nThe Plugin remains running. Report the Host handler failure to the user. If the handler needs a Service, either declare that Service in the returned Plugin inject list or read it with ctx.get(name) and handle undefined.`
2429
2429
  }],
2430
2430
  source: {
2431
2431
  kind: "plugin",
@@ -2441,7 +2441,7 @@ let DynamicCordisRunnerService = (() => {
2441
2441
  agent.steer(createUserMessage({
2442
2442
  content: [{
2443
2443
  type: "text",
2444
- text: `Cordis ${platform} guard rejected runtime code in ${plugin.pluginId}/${run.packageId} (${run.pluginRunId}) after activation.\n${formatErrorDetails(failure)}\nThe Plugin remains running. Inspect this Package, define a corrected Package on the same Plugin, and activate it autonomously with cordis_run mode:"update".`
2444
+ text: `Cordis ${platform} guard rejected runtime code in ${plugin.pluginId}/${run.packageId} (${run.pluginRunId}) after activation.\n${formatErrorDetails(failure)}\nThe Plugin remains running. Report the guard rejection to the user; it can be stopped through the Cordis panel.`
2445
2445
  }],
2446
2446
  source: {
2447
2447
  kind: "plugin",