@deepseek-ai/dsh-client-ui-cordis 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 +2 -2
- package/README.md +9 -13
- package/README.zh.md +9 -13
- package/lib/client.js +3 -35
- package/lib/types/client/index.d.ts +2 -2
- package/package.json +13 -15
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/ui-cordis/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 17fea955dae2ecc4b4549775d8f9176ee5eba1f5
|
|
6
|
+
README.zh.md: 35726f2451a70586c0600789d1c27b15f2d779ea
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Cordis
|
|
2
|
+
description: "Historical Cordis cards and controls for process-local runner definitions."
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-client-ui-cordis`
|
|
12
|
+
`dsh-client-ui-cordis` renders historical generated-plugin cards and a control panel for process-local definitions. Users can operate definitions supplied by programmatic consumers; persisted cards remain readable after restart without recreating those definitions. New Creator plugins use Plugin Manager.
|
|
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
|
-
Compose this package
|
|
28
|
+
Compose this package with the Host and Client runners to render historical tool cards and operate programmatically registered definitions in the panel. New agent-authored plugins use Plugin Manager; this package exposes no model mutation tools.
|
|
29
29
|
|
|
30
30
|
### What the panel shows
|
|
31
31
|
|
|
@@ -35,10 +35,6 @@ A `sidebar.footer.action` seat shows a badge counting what runs plus what waits;
|
|
|
35
35
|
|
|
36
36
|
The `cordis_define` card is a record: the name and purpose the model wrote, the source it wrote, and whether the definition is running — no switch, no approval, and a pointer to the panel. The `cordis_run` card shows the mode, the plugin, package, and run ids, the outcome, and offers the package's own business view through the `tool.view.cordis` slot when the package registered one. `cordis_stop` and `cordis_undefine` render compact action rows. All cards render from the recorded call and result, so replay shows the same card.
|
|
37
37
|
|
|
38
|
-
### The @pluginId input source
|
|
39
|
-
|
|
40
|
-
Typing `@` in the input offers the current session's defined plugins; picking one emits `@pluginId`, which the tool package turns into a pinned reference context for the model.
|
|
41
|
-
|
|
42
38
|
### Boundaries to plan around
|
|
43
39
|
|
|
44
40
|
Definitions are process-local: a reloaded page holds nothing until someone runs a package again, and the panel re-reads the inventory on every announcement. Approvals are frame-wide by design, so a person in one tab can approve a run the model asked for while another tab shows the defining session; the first answer wins and the rest converge.
|
|
@@ -61,7 +57,7 @@ The surfaces are built on one rule: neither keeps run state in component state,
|
|
|
61
57
|
|
|
62
58
|
| File | Role |
|
|
63
59
|
|---|---|
|
|
64
|
-
| [`src/client/index.ts`](src/client/index.ts) | Plugin entry: slot registrations
|
|
60
|
+
| [`src/client/index.ts`](src/client/index.ts) | Plugin entry: slot registrations and inventory wiring |
|
|
65
61
|
| [`src/client/CordisPanel.tsx`](src/client/CordisPanel.tsx) | The frame-wide panel and its run controls |
|
|
66
62
|
| [`src/client/CordisDefineRow.tsx`](src/client/CordisDefineRow.tsx) | The read-only `cordis_define` card |
|
|
67
63
|
| [`src/client/CordisRunRow.tsx`](src/client/CordisRunRow.tsx) | The `cordis_run` card and its business-view seat |
|
|
@@ -87,7 +83,7 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
87
83
|
|
|
88
84
|
- [Client runner](../cordis-client-runner/README.md) — the browser face the panel reads and calls.
|
|
89
85
|
- [Host runner](../cordis-host-runner/README.md) — the inventory and lifecycle verbs behind the panel.
|
|
90
|
-
- [Tool package](../tool-cordis/README.md) —
|
|
86
|
+
- [Tool package](../tool-cordis/README.md) — read-only runtime API discovery.
|
|
91
87
|
- [Extensions subsystem](../../../docs/subsystems/extensions.md) — the generated `ctx.dynamicCordisRunner` API and forwarded `cordis/*` events.
|
|
92
88
|
- [Slots subsystem](../../../docs/subsystems/slots.md) — how slot-registered browser UI is owned by its package.
|
|
93
89
|
|
|
@@ -96,11 +92,11 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
96
92
|
<a id="model-experience"></a>
|
|
97
93
|
## Model Experience
|
|
98
94
|
|
|
99
|
-
Indirectly, through the
|
|
95
|
+
Indirectly, through the runner lifecycle actions that own session steering and permission outcomes; this package renders historical calls and results and adds no tools or prompt sections.
|
|
100
96
|
|
|
101
97
|
#### KV Cache effect
|
|
102
98
|
|
|
103
|
-
None:
|
|
99
|
+
None directly: this package owns rendering; runner-originated steering changes the session history.
|
|
104
100
|
|
|
105
101
|
## Known Limitations and Deferred Work
|
|
106
102
|
|
|
@@ -109,10 +105,10 @@ None: no prompt input originates here, and answering a run request neither exten
|
|
|
109
105
|
|
|
110
106
|
These limits define where the surfaces need special care. They are current package constraints, not a task backlog.
|
|
111
107
|
|
|
112
|
-
- **An open panel does not see registry changes that announce nothing** — `
|
|
108
|
+
- **An open panel does not see registry changes that announce nothing** — programmatic `define` and inactive `undefine` can leave the current rows unchanged until the next inventory read. A run request triggers a read.
|
|
113
109
|
- **A request-only row is answerable but not operable** — it offers approve and decline only, because the run and stop controls need the registry row the read has yet to deliver.
|
|
114
110
|
- **A row can disappear for the width of one read** — the activity's orchestrating arm carries the session but deliberately no label, so an approved request whose registry read has not landed leaves no row until it does; in practice the read is triggered when the request arrives.
|
|
115
|
-
- **
|
|
111
|
+
- **Render failures are page-local and follow the load receipt** — the panel displays this page’s crash; the Host runner steers the owning session separately.
|
|
116
112
|
- **A second page's load failure is invisible to the others** — the host settles a dispatch on the first load report, so a page whose browser half failed after another page acknowledged keeps reading as running on the other pages.
|
|
117
113
|
- **Any page may answer any request** — approvals are frame-wide by design, so a person in one tab can approve a run the model asked for while another tab is in front of the defining session; narrowing who may answer is deferred.
|
|
118
114
|
- **A card whose call head left the event window loses its labels** — the define card derives name and purpose from the call arguments, so a session long enough to truncate them leaves the card naming its call id; the panel is unaffected because the host inventory carries the labels.
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Cordis
|
|
2
|
+
description: "历史 Cordis 卡片及进程内 runner 定义的控件。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-client-ui-cordis`
|
|
12
|
+
`dsh-client-ui-cordis` 渲染历史生成插件卡片,并为进程内定义提供控制面板。用户可以操作程序消费者提供的定义;重启后持久化卡片仍可读取,但不会重建定义。新建 Creator 插件使用 Plugin Manager。
|
|
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
|
-
|
|
28
|
+
将本包与 Host 和 Client runner 组合,可渲染历史工具卡片,并在面板中操作程序注册的定义。新建 agent 插件使用 Plugin Manager;本包不提供模型变更工具。
|
|
29
29
|
|
|
30
30
|
### 面板显示什么
|
|
31
31
|
|
|
@@ -35,10 +35,6 @@ kind: "package-reference"
|
|
|
35
35
|
|
|
36
36
|
`cordis_define` 卡片是一份记录:模型写下的 name 与 purpose、它写的源码,以及该定义是否在跑——没有开关、没有审批,只有一句指向面板的指引。`cordis_run` 卡片显示模式、插件标识、包标识与运行标识、结果,并在包注册了业务视图时经 `tool.view.cordis` slot 提供它。`cordis_stop` 与 `cordis_undefine` 渲染紧凑的动作行。所有卡片都渲染会话记录下的 call 与 result,因此回放显示同一张卡。
|
|
37
37
|
|
|
38
|
-
### @pluginId 输入源
|
|
39
|
-
|
|
40
|
-
在输入框里键入 `@` 会给出当前会话已定义的插件;选中一个会输出 `@pluginId`,工具包把它变成一条钉住的引用上下文给模型。
|
|
41
|
-
|
|
42
38
|
### 需要规划的边界
|
|
43
39
|
|
|
44
40
|
定义仅存在于进程内:刷新后的页面手上什么都没有,直到有人再次运行某个包;面板在每次公告时重读清单。审批按设计是框架级的,所以某个标签页里的人可以批准模型为另一个标签页正在看的会话所发起的 run;首个应答生效,其余收敛。
|
|
@@ -61,7 +57,7 @@ kind: "package-reference"
|
|
|
61
57
|
|
|
62
58
|
| 文件 | 职责 |
|
|
63
59
|
|---|---|
|
|
64
|
-
| [`src/client/index.ts`](src/client/index.ts) | 插件入口:slot
|
|
60
|
+
| [`src/client/index.ts`](src/client/index.ts) | 插件入口:slot 注册和 inventory 连接 |
|
|
65
61
|
| [`src/client/CordisPanel.tsx`](src/client/CordisPanel.tsx) | 全局面板及其运行控件 |
|
|
66
62
|
| [`src/client/CordisDefineRow.tsx`](src/client/CordisDefineRow.tsx) | 只读的 `cordis_define` 卡片 |
|
|
67
63
|
| [`src/client/CordisRunRow.tsx`](src/client/CordisRunRow.tsx) | `cordis_run` 卡片及其业务视图席位 |
|
|
@@ -87,7 +83,7 @@ kind: "package-reference"
|
|
|
87
83
|
|
|
88
84
|
- [Client runner](../cordis-client-runner/README.zh.md)——面板读取并调用的浏览器面。
|
|
89
85
|
- [Host runner](../cordis-host-runner/README.zh.md)——面板背后的清单与生命周期动词。
|
|
90
|
-
- [工具包](../tool-cordis/README.zh.md)
|
|
86
|
+
- [工具包](../tool-cordis/README.zh.md)——只读运行时 API 发现。
|
|
91
87
|
- [extensions 子系统](../../../docs/subsystems/extensions.zh.md)——生成的 `ctx.dynamicCordisRunner` API 与转发的 `cordis/*` 事件。
|
|
92
88
|
- [slots 子系统](../../../docs/subsystems/slots.zh.md)——slot 注册的浏览器 UI 如何归其包所有。
|
|
93
89
|
|
|
@@ -96,11 +92,11 @@ kind: "package-reference"
|
|
|
96
92
|
<a id="model-experience"></a>
|
|
97
93
|
## 模型体验
|
|
98
94
|
|
|
99
|
-
|
|
95
|
+
间接地,通过负责会话 steering 和权限结果的 runner 生命周期操作;本包渲染历史调用与结果,不添加工具或提示段落。
|
|
100
96
|
|
|
101
97
|
#### KV Cache 影响
|
|
102
98
|
|
|
103
|
-
|
|
99
|
+
没有直接影响:本包负责渲染;runner 发出的 steering 会改变会话历史。
|
|
104
100
|
|
|
105
101
|
## 已知限制与延期工作
|
|
106
102
|
|
|
@@ -109,10 +105,10 @@ kind: "package-reference"
|
|
|
109
105
|
|
|
110
106
|
这些限制说明这些界面何时需要特别小心。它们是当前包约束,不是任务积压。
|
|
111
107
|
|
|
112
|
-
-
|
|
108
|
+
- **面板无法看到没有广播的注册表变更**——程序侧 `define` 和未运行定义的 `undefine` 可使当前行保持不变,直到下一次 inventory 读取。运行请求会触发读取。
|
|
113
109
|
- **只有请求、没有清单的行可应答但不可操作**——它只提供批准与拒绝,因为 run/stop 控件需要那次读取尚未送达的注册表行。
|
|
114
110
|
- **行可能消失一次读取的时长**——活动的 orchestrating 臂带会话但刻意不带标签,因此一个已批准、但注册表读取尚未落地的请求,在读取落地前没有行;实践中读取在请求到达时即已触发。
|
|
115
|
-
-
|
|
111
|
+
- **渲染失败属于当前页面,且发生在加载回执之后**——面板显示本页的崩溃;Host runner 单独向所属会话发送 steering。
|
|
116
112
|
- **某一页的装载失败对其他页不可见**——host 以首个装载回报结算一次 dispatch,因此在另一页确认之后浏览器半才失败的页面,在其他页上仍会读作运行中。
|
|
117
113
|
- **任何页面都可以应答任何请求**——审批按设计是框架级的,所以某个标签页里的人可以批准模型为另一个标签页正在看的会话所发起的 run;收窄「谁有权应答」延后。
|
|
118
114
|
- **call head 掉出事件窗的卡片会丢掉标签**——define 卡片的 name 与 purpose 取自调用参数,因此会话长到把它们截断时,卡片只能以自己的 call id 自称;面板不受影响,因为 host 清单携带标签。
|
package/lib/client.js
CHANGED
|
@@ -667,7 +667,7 @@ window.__ModuleLoader__.load({
|
|
|
667
667
|
const errors = useRunErrors((snapshot) => snapshot);
|
|
668
668
|
const loaded = useLoaded((snapshot) => snapshot);
|
|
669
669
|
const renderFailures = useRenderFailures((snapshot) => snapshot);
|
|
670
|
-
const current = useSessions((state) => state.
|
|
670
|
+
const current = useSessions((state) => Object.values(state.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id);
|
|
671
671
|
const [open, setOpen] = (0, react.useState)(false);
|
|
672
672
|
const [selected, setSelected] = (0, react.useState)({});
|
|
673
673
|
const [pending, setPending] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
@@ -1261,12 +1261,11 @@ window.__ModuleLoader__.load({
|
|
|
1261
1261
|
};
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region lib/types/client/index.js
|
|
1264
|
-
/** Cordis dynamic-plugin cards, inventory panel, business-view host
|
|
1265
|
-
/** Required services for
|
|
1264
|
+
/** Cordis dynamic-plugin cards, inventory panel, business-view host. */
|
|
1265
|
+
/** Required services for historical cards, the panel, and Remote lifecycle actions. */
|
|
1266
1266
|
const inject = [
|
|
1267
1267
|
"slots",
|
|
1268
1268
|
"locale",
|
|
1269
|
-
"inputTriggers",
|
|
1270
1269
|
"remote",
|
|
1271
1270
|
"remote.dynamicCordisRunner",
|
|
1272
1271
|
"dynamicCordisRunner"
|
|
@@ -1412,37 +1411,6 @@ window.__ModuleLoader__.load({
|
|
|
1412
1411
|
locale: NS
|
|
1413
1412
|
}, CordisActionRow);
|
|
1414
1413
|
});
|
|
1415
|
-
const rowsOf = (sessionId, query) => inventory.getSnapshot().rows.filter((row) => row.agentId === sessionId && String(row.pluginId).includes(query));
|
|
1416
|
-
const source = {
|
|
1417
|
-
trigger: "@",
|
|
1418
|
-
name: "cordis",
|
|
1419
|
-
order: 1,
|
|
1420
|
-
candidates(session, { query }) {
|
|
1421
|
-
const rows = rowsOf(session.sessionId, query);
|
|
1422
|
-
return Promise.resolve(rows.map((row) => {
|
|
1423
|
-
const packageId = row.nextPackageId ?? row.currentPackageId ?? row.packages.at(-1)?.packageId;
|
|
1424
|
-
const pkg = packageId === void 0 ? void 0 : row.packages.find((candidate) => candidate.packageId === packageId);
|
|
1425
|
-
return {
|
|
1426
|
-
name: String(row.pluginId),
|
|
1427
|
-
...pkg === void 0 ? {} : { description: pkg.purpose }
|
|
1428
|
-
};
|
|
1429
|
-
}));
|
|
1430
|
-
},
|
|
1431
|
-
warm() {
|
|
1432
|
-
inventory.refresh();
|
|
1433
|
-
},
|
|
1434
|
-
lexicon(session) {
|
|
1435
|
-
return rowsOf(session.sessionId, "").map((row) => String(row.pluginId));
|
|
1436
|
-
},
|
|
1437
|
-
subscribeLexicon(_session, listener) {
|
|
1438
|
-
return inventory.subscribe(listener);
|
|
1439
|
-
},
|
|
1440
|
-
onPick({ candidate }) {
|
|
1441
|
-
return { text: `@${candidate.name} ` };
|
|
1442
|
-
}
|
|
1443
|
-
};
|
|
1444
|
-
const slash = ctx.get("inputTriggers");
|
|
1445
|
-
ctx.effect(() => slash.registerSource(source), "ui-cordis: @pluginId source");
|
|
1446
1414
|
inventory.refresh();
|
|
1447
1415
|
}
|
|
1448
1416
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Cordis dynamic-plugin cards, inventory panel, business-view host
|
|
1
|
+
/** Cordis dynamic-plugin cards, inventory panel, business-view host. */
|
|
2
2
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
3
3
|
export type { CordisCardFace, CordisPanelFace, CordisRunCardFace, CordisToolViewOwnerProps } from './slots.ts';
|
|
4
4
|
export type { CordisActionResult, CordisDynamicPort, CordisInventoryRow } from './dynamic-port.ts';
|
|
@@ -8,7 +8,7 @@ export type { CordisRunRowProps } from './CordisRunRow.tsx';
|
|
|
8
8
|
export type { CordisRunCardPointer, CordisRunCardStore, CordisToolViewKey, } from './run-card-index.ts';
|
|
9
9
|
export type { ApprovalRequestId, CordisDynamicPackageId, CordisDynamicPluginId, CordisDynamicPluginRunId, DynamicCordisInventoryRow, DynamicCordisPackage, DynamicCordisRetracted, } from './events.ts';
|
|
10
10
|
export type { CordisKey } from './locales.ts';
|
|
11
|
-
/** Required services for
|
|
11
|
+
/** Required services for historical cards, the panel, and Remote lifecycle actions. */
|
|
12
12
|
export declare const inject: string[];
|
|
13
13
|
/** Mount every Cordis browser surface over the shared Host inventory. */
|
|
14
14
|
export declare function apply(ctx: ClientContext): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-cordis",
|
|
3
3
|
"description": "Cordis dynamic-plugin definition card: the keyed cordis_define tool row with its run/stop switch",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"@deepseek-ai/dsh-cordis-client-runner",
|
|
33
33
|
"@deepseek-ai/dsh-api-remotes",
|
|
34
34
|
"@deepseek-ai/dsh-client-locale",
|
|
35
|
-
"@deepseek-ai/dsh-client-ui-input-trigger",
|
|
36
35
|
"@deepseek-ai/dsh-client-ui-renderer",
|
|
37
36
|
"@deepseek-ai/dsh-client-ui-session",
|
|
38
37
|
"@deepseek-ai/dsh-client-ui-tool",
|
|
@@ -48,19 +47,18 @@
|
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@types/react": "~18.3.1",
|
|
50
49
|
"react": "^18.2.0",
|
|
51
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-client-
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-
|
|
61
|
-
"@deepseek-ai/
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-
|
|
63
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
50
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-cordis-client-runner": "^0.1.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.6-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2"
|
|
64
62
|
},
|
|
65
63
|
"files": [
|
|
66
64
|
"lib/index.js",
|