@deepseek-ai/dsh-cordis-client-runner 0.1.5-rc.2 → 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-client-runner/README.md
5
- README.md: 260d4703bda2560a4254962d7b868221d0328ec8
6
- README.zh.md: a74128508c5b6a81d0600452b6ec5301bf7c8dcb
5
+ README.md: aa87e2919be899539bea8aff00d072553f339c38
6
+ README.zh.md: f4925e4bd52098884c6a25f2d9504ce9a9d667f0
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- `dsh-cordis-client-runner` lets a page run the browser half of a dynamic Cordis package: it answers the host's run requests, loads the browser-half source into the page as a live plugin, and removes it when the host retracts the run. A person approves or declines a run — or starts one directly — and the result this package reports back becomes the `cordis_run` tool result the model reads. Nothing loads at activation and nothing is restored after a refresh; a page runs a dynamic package only when someone answers a run request or asks for it here.
12
+ `dsh-cordis-client-runner` runs the browser half of process-local dynamic packages for programmatic callers and existing browser controls. It loads a definition after an approved request or explicit user gesture, and removes it when the Host retracts the run. Page refresh does not restore definitions. Creator UI plugins use installed Client modules through Plugin Manager.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -51,7 +51,7 @@ This section explains the design behind the browser half; the observable behavio
51
51
 
52
52
  ### Design philosophy
53
53
 
54
- The browser half is built on one principle: a dynamic package must ride the same activation gating, fiber-effect cleanup, and status projection as a static one. The evaluated plugin is seated in the module table and mounted through `loader.create`; unload is entry removal plus factory invalidation plus style removal. The guard is a whitelist — lifecycle verbs plus declared services — that mirrors the host-side sandbox facade, so a package author meets one contract on both halves. One observer feeds two outlets: the slot registry's entry-error seam is watched only here, and a crash belonging to a package this runner seated goes upstream to the host for the model and onto this package's own `renderFailures` for the panel.
54
+ The browser half is built on one principle: a dynamic package must ride the same activation gating, fiber-effect cleanup, and status projection as a static one. The evaluated plugin is seated in the module table and mounted through `loader.create`; unload removes the entry, waits for its fiber's cleanup, then invalidates its factory and removes its styles. The guard is a whitelist — lifecycle verbs plus declared services — that mirrors the host-side sandbox facade, so a package author meets one contract on both halves. One observer feeds two outlets: the slot registry's entry-error seam is watched only here, and a crash belonging to a package this runner seated goes upstream to the host for the model and onto this package's own `renderFailures` for the panel.
55
55
 
56
56
  ### Source map
57
57
 
@@ -80,7 +80,7 @@ A `cordis/request-run` event asks this page whether to run a definition. Whoever
80
80
  Read these pages when the package-level contract is not enough. They move from the browser half to the host that asks it, the tools whose runs it answers, and the surface that renders it.
81
81
 
82
82
  - [Host runner](../cordis-host-runner/README.md) — the registry and run round trip this package answers.
83
- - [Tool package](../tool-cordis/README.md) — the model-facing tools whose run requests reach this page.
83
+ - [Tool package](../tool-cordis/README.md) — read-only runtime API discovery.
84
84
  - [UI package](../ui-cordis/README.md) — the panel and cards that operate this face.
85
85
  - [Extensions subsystem](../../../docs/subsystems/extensions.md) — the generated `ctx.dynamicCordisRunner` API and `cordis/*` events.
86
86
  - [Client shells and dynamic packages Agent Note](../../../.agents/notes/implemented/architecture/2026-08-15-client-shells-and-dynamic-packages.md) — package placement and build faces for the client halves.
@@ -90,25 +90,25 @@ Read these pages when the package-level contract is not enough. They move from t
90
90
  <a id="model-experience"></a>
91
91
  ## Model Experience
92
92
 
93
- ### Run resolution, when a model asked for the run
93
+ ### Run resolution relayed by the Host
94
94
 
95
95
  #### What the model sees
96
96
 
97
- This package contributes no tool, prompt, or context of its own; the first thing it authors that reaches a model is the resolution it sends back for a `cordis/request-run` round trip, which the host turns into the blocked `cordis_run` result. A success carries the loaded revision and, for a browser half parked on services this page does not have, their names. A failure carries one reason — `rejected` when the user refused, `host-half-failed`, or `client-half-failed` — and, for the browser half, this package's own text: the failing stage (`evaluate`, `module-import`, or `activate`) followed by the closure's, guard's, or fiber's message. The guard's teaching errors (an undeclared service, a shadowed browser global, a plugin that returned no `apply`) reach the model through exactly that field. A crash that happens later, while React renders the loaded half, travels the separate post-settle path below.
97
+ This package contributes no tool or prompt. It resolves `cordis/request-run` with activation success, missing services, rejection, or Host/Client failures. The Host runner owns any message relayed to the session.
98
98
 
99
99
  #### Token effect
100
100
 
101
- Conditional and bounded: at most one resolution per run request, spent inside the `cordis_run` tool result the host already emits. The text is data-dependent (a definition's own error message) and this package retains nothing across requests — a page's later load failures are page-local diagnostics with no model-visible carrier.
101
+ Conditional and bounded: at most one resolution per run request, spent inside the runner result the host already emits. The text is data-dependent (a definition's own error message) and this package retains nothing across requests — a page's later load failures are page-local diagnostics with no model-visible carrier.
102
102
 
103
103
  #### KV Cache effect
104
104
 
105
- Append-only. A resolution reaches the model only as the tool result for the request that was already in flight, extending the history tail; nothing this package authors rewrites or reorders earlier request tokens, so an otherwise reusable prefix stays reusable. Repeated runs of the same definition each produce their own result rather than replacing an earlier one.
105
+ Host steering appends to the session history; this package does not rewrite earlier messages.
106
106
 
107
107
  ### Render failure, after the run settled
108
108
 
109
109
  #### What the model sees
110
110
 
111
- A browser half that loads cleanly can still crash when React renders it, and that crash lands after the run was answered — so the model would otherwise be told "ok" and never learn. Every entry-boundary crash of a package this page seated is sent to the host (`reportRenderFailure`) naming the slot, whether the crash retired the entry from its cell (`abdicated`: the package's UI is gone, not merely broken), and a message written for the author. The host keeps the last one per package, steers the owning session with it, and exposes it through `cordis_inspect_self`; nothing here reaches a run resolution.
111
+ React can fail after a successful load. The Client reports each owned entry failure with its slot, message, and whether the entry was removed. The Host retains the latest failure and steers the owning session; the page also displays its local failure.
112
112
 
113
113
  #### Token effect
114
114
 
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-cordis-client-runner` 让页面运行动态 Cordis 包的浏览器半:它应答 host 的运行请求、把浏览器半源码装载进页面成为活插件,并在 host 撤回该次运行时把它移除。人可以批准或拒绝一次运行——也可以直接启动一次——而本包回报的结果变成模型读到的 `cordis_run` 工具结果。激活时什么都不装载,刷新后也不恢复;一页只在有人应答运行请求或在此主动要求时,才运行动态包。
12
+ `dsh-cordis-client-runner` 为程序调用方和现有浏览器控件运行进程内动态包的浏览器部分。它在请求获批或用户显式操作后加载定义,并在 Host 撤销运行时移除定义。页面刷新不会恢复定义。Creator UI 插件通过 Plugin Manager 使用已安装的 Client 模块。
13
13
 
14
14
  ## 目录
15
15
 
@@ -51,7 +51,7 @@ kind: "package-reference"
51
51
 
52
52
  ### 设计理念
53
53
 
54
- 浏览器半建立在一个原则之上:动态包必须与静态包共享同一套激活门控、fiber effect 清理与状态投影。求值后的插件被塞进模块表,并经 `loader.create` 挂载;卸载 = 移除 entry + 失效 factory + 撤下样式。guard 是一份白名单——生命周期动词加已声明服务——与 host 侧沙箱门面对称,因此包作者在两侧面对同一个约定。一个观察者供两个出口:只有这里监视槽位注册表的 entry 错误接缝,凡属于本 runner 落座过的包的崩溃,一路上行给 host(给模型),一路发布到本包自己的 `renderFailures`(给面板)。
54
+ 浏览器半建立在一个原则之上:动态包必须与静态包共享同一套激活门控、fiber effect 清理与状态投影。求值后的插件被塞进模块表,并经 `loader.create` 挂载;卸载先移除 entry,等待其 fiber 清理完成,再使 factory 失效并撤下样式。guard 是一份白名单——生命周期动词加已声明服务——与 host 侧沙箱门面对称,因此包作者在两侧面对同一个约定。一个观察者供两个出口:只有这里监视槽位注册表的 entry-error seam,凡属于本 runner 落座过的包的崩溃,一路上行给 host(给模型),一路发布到本包自己的 `renderFailures`(给面板)。
55
55
 
56
56
  ### 源码地图
57
57
 
@@ -80,7 +80,7 @@ kind: "package-reference"
80
80
  当包级约定不够用时阅读以下页面。它们从浏览器半逐步进入发问的 host、其运行被应答的工具,以及渲染它的界面。
81
81
 
82
82
  - [Host runner](../cordis-host-runner/README.zh.md)——本包应答的注册表与运行往返。
83
- - [工具包](../tool-cordis/README.zh.md)——运行请求到达本页的模型侧工具。
83
+ - [工具包](../tool-cordis/README.zh.md)——只读运行时 API 发现。
84
84
  - [UI 包](../ui-cordis/README.zh.md)——操作这个面的面板与卡片。
85
85
  - [extensions 子系统](../../../docs/subsystems/extensions.zh.md)——生成的 `ctx.dynamicCordisRunner` API 与 `cordis/*` 事件。
86
86
  - [客户端外壳与动态包 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-15-client-shells-and-dynamic-packages.zh.md)——浏览器半的包归属与构建面。
@@ -90,25 +90,25 @@ kind: "package-reference"
90
90
  <a id="model-experience"></a>
91
91
  ## 模型体验
92
92
 
93
- ### 由模型发起那次 run 的最终回答
93
+ ### Host 转发的运行结果
94
94
 
95
95
  #### 模型看到的内容
96
96
 
97
- 本包自己不贡献任何工具、提示词或上下文;它撰写并到达模型的第一样内容,是为一次 `cordis/request-run` 往返发回的回答——host 把它变成那个被阻塞的 `cordis_run` 的结果。成功时带上已装载的 revision,以及(当浏览器半挂在这一页没有的服务上时)那些服务的名字。失败时带一个 reason:用户拒绝的 `rejected`、`host-half-failed` 或 `client-half-failed`;后者还带上本包自己的文本——出错阶段(`evaluate`、`module-import` 或 `activate`)加上闭包、guard 或 fiber 的消息。guard 的教学错误(未声明的服务、被遮蔽的浏览器全局、返回值里没有 `apply`)正是经这个字段到达模型的。而装载之后、React 渲染时才发生的崩溃,走下面那条独立的事后通道。
97
+ 本包不提供工具或提示。它以激活成功、缺失服务、拒绝或 Host/Client 失败响应 `cordis/request-run`。发送给会话的任何消息由 Host runner 负责。
98
98
 
99
99
  #### Token 影响
100
100
 
101
- 有条件且有界:每次 run 请求最多一个回答,花在 host 本来就会发出的那个 `cordis_run` 结果里。文本随数据而定(某个定义自己的错误消息),本包跨请求不留存任何东西——一页后续的装载失败是页面本地诊断,在模型侧没有任何承载物。
101
+ 有条件且有界:每次 run 请求最多一个回答,花在 host 本来就会发出的那个 `run` 结果里。文本随数据而定(某个定义自己的错误消息),本包跨请求不留存任何东西——一页后续的装载失败是页面本地诊断,在模型侧没有任何承载物。
102
102
 
103
103
  #### KV Cache 影响
104
104
 
105
- 只追加。回答只作为「本来就在途的那次请求」的工具结果到达模型、延长历史尾部;本包撰写的内容不会重写或重排更早的请求 token,因此原本可复用的前缀仍然可复用。同一定义的多次运行各自产出各自的结果,而不是替换更早那一个。
105
+ Host steering 追加到会话历史;本包不改写更早的消息。
106
106
 
107
107
  ### run 落定之后的渲染期失败
108
108
 
109
109
  #### 模型看到的内容
110
110
 
111
- 一个装载得干干净净的浏览器半,仍可能在 React 渲染时崩溃,而那次崩溃发生在 run 已经被回答之后——否则模型只会被告知「ok」,永远学不到。凡是本页落座过的包,其 entry 边界的每一次崩溃都会发回 host(`reportRenderFailure`):点名槽位、说明这次崩溃是否已把 entry 从格位上摘掉(`abdicated`:包的 UI 是没了、而不只是坏了),以及一条写给作者的 message。host 每包只留最后一条,用它 steer 所属会话,并经由 `cordis_inspect_self` 暴露;这条通道上的任何东西都不会进入 run 的最终回答。
111
+ React 可能在加载成功后失败。Client 报告其拥有的每个 entry 失败,包括 slot、消息及 entry 是否已移除。Host 保留最新失败并向所属会话发送 steering;页面也显示本地失败。
112
112
 
113
113
  #### Token 影响
114
114
 
@@ -140,4 +140,4 @@ kind: "package-reference"
140
140
 
141
141
  </details>
142
142
 
143
- **运行时不变式:** 不发布伴生入口。live Plugin 与 Plugin Run ID 的关系只存在于浏览器侧 service,Host 不变式无法观察;包内 load/teardown 测试直接覆盖该关系。
143
+ **运行时不变式:** 不发布伴生入口。所属关系(一个 live Plugin 的 loader entry 仅在一个 Plugin Run ID 存活期间存在)是只能通过 Client 半服务访问的浏览器侧状态,Node 平面的伴生入口无法观察。该关系改由本包自己的装载与拆除测试直接断言。