@khorsheed/dsh-room 0.1.1 → 0.2.0
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/CHANGELOG.md +9 -0
- package/README.en.md +9 -8
- package/README.i18n.yaml +2 -2
- package/README.md +9 -8
- package/lib/client.js +1007 -340
- package/lib/index.js +88 -12
- package/lib/{journal-CuRnWk66.js → journal-BWL3-i0s.js} +27 -0
- package/lib/tool.js +63 -11
- package/lib/typert.host.js +161 -26
- package/lib/typert.remote-client.d.ts +2 -0
- package/lib/typert.remote-client.js +142 -22
- package/lib/types/client/RoomActivityDock.d.ts +19 -0
- package/lib/types/client/RoomActivityDock.js +105 -0
- package/lib/types/client/RoomComposer.d.ts +1 -1
- package/lib/types/client/RoomComposer.js +3 -3
- package/lib/types/client/RoomPlanTab.d.ts +15 -0
- package/lib/types/client/RoomPlanTab.js +13 -0
- package/lib/types/client/RoomPlanView.d.ts +3 -2
- package/lib/types/client/RoomPlanView.js +5 -6
- package/lib/types/client/executions.d.ts +50 -0
- package/lib/types/client/executions.js +70 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.js +33 -1
- package/lib/types/client/locales.d.ts +50 -0
- package/lib/types/client/locales.js +50 -0
- package/lib/types/client/preset-visibility.d.ts +3 -3
- package/lib/types/client/preset-visibility.js +2 -2
- package/lib/types/client/slots.d.ts +6 -1
- package/lib/types/dispatch.js +30 -6
- package/lib/types/index.d.ts +5 -0
- package/lib/types/index.js +42 -7
- package/lib/types/journal.d.ts +1 -1
- package/lib/types/journal.js +27 -1
- package/lib/types/tool-definition.d.ts +56 -0
- package/lib/types/tool-definition.js +393 -0
- package/lib/types/tool.d.ts +37 -49
- package/lib/types/tool.js +47 -381
- package/lib/types/types.d.ts +28 -0
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.2.0(2026-09-28)
|
|
4
|
+
|
|
5
|
+
- **BREAKING(包结构)**:伴生包 `@khorsheed/dsh-room-tool` 回并进本包——模型工具行改由本包的 `./tool` 子路径导出承载(preset 引 `name: '@khorsheed/dsh-room/tool'`,行 id 仍为 `room-tool`,preset 组合状态不受影响;worktrees 0.3.0 同款回并,canvas `./agent` 先例)。迁移:preset 的 `agent.cordis.yml` 里把 `name: '@khorsheed/dsh-room-tool'` 改为 `name: '@khorsheed/dsh-room/tool'`,并卸载旧伴生包(旧 npm 名将在发布波 deprecate)。`./tool` 的导出内容从工具定义工厂变为可直接挂载的组合行(`name` / `inject = ['room']` / `apply`);工厂退到内部模块 `./tool-definition.ts`(不进 exports 面)。
|
|
6
|
+
- 会话 chrome 的 preset 组合判据常量同步指向 `@khorsheed/dsh-room/tool`。
|
|
7
|
+
- 工具 origin 归因 owner 归一到本包名 `@khorsheed/dsh-room`。
|
|
8
|
+
- 后台 Agent 与当前计划改用可折叠胶囊;运行中显示绿点,展开可查看执行任务、用量、会话并中止具体轮次。
|
|
9
|
+
- 记录 Room 单次执行历史,归集宿主登记的下级会话;原生子会话用量明确标为会话累计。
|
|
10
|
+
- 计划详情接入可选宿主侧栏,缺少侧栏时在面板内展开;运行限制默认折叠。
|
|
11
|
+
|
|
3
12
|
## 0.1.1(2026-09-27)
|
|
4
13
|
|
|
5
14
|
适配宿主 0.1.7-rc.2 线(verifiedHost 前移至 0.1.7-rc.2——3080 生产实证线随宿主基线切到 rc.2;rc.1→rc.2 无触及本包的宿主变更,全量构建+测试双绿)。
|
package/README.en.md
CHANGED
|
@@ -6,10 +6,11 @@ One session, a whole team of agents — invite DSH, Kimi, Codex or Claude Code m
|
|
|
6
6
|
|
|
7
7
|
Getting several agents onto one piece of work today means copy-pasting between windows, or one-shot subagent calls that forget everything on return. Room makes the session itself the shared place: inviting the first member promotes the current session into a Room and seats the native DSH agent as the initial coordinator, and every member keeps its own native conversation across turns and restarts.
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-1.png" width="640" alt="an active Room: member receipts and run rows in the chat flow, with the @-member menu open above the composer">
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
+
- **Collapsible execution and plan capsules** — Background agents sits above the input, showing only its label and a green dot while work runs. Expand for execution state, duration, reported round tokens, targeted Stop and real conversation links; native descendant totals are explicitly labeled as session totals. Plans start with a compact progress list; full review and limits open in the optional host sidebar, with inline fallback.
|
|
13
14
|
- **Inviting promotes the session** — no separate "create room" step: invite the first member into any session and it becomes a Room; the native DSH agent joins as the initial coordinator (named `dsh` in new rooms; existing rooms keep their recorded addressing names).
|
|
14
15
|
- **@-addressing with fan-out** — leading `@name` tokens address existing members, and several names fan out at once; a mention picked from the completion menu addresses explicitly even mid-sentence, while a hand-typed mention inside prose does not (the menu never creates members). Same-member turns share one queue, different members run concurrently, and durable request identities keep retries from duplicating accepted work.
|
|
15
16
|
- **Coordinator handoff** — any prepared member (DSH, Codex, Claude Code, Kimi) can take over via **Set as coordinator** in the Members tab; the handoff record carries the goal, the plan state, open tasks and recent context. A running coordinator cannot be replaced until its current turn settles.
|
|
@@ -18,11 +19,11 @@ Getting several agents onto one piece of work today means copy-pasting between w
|
|
|
18
19
|
- **Members keep their native sessions** — the Members tab holds names, providers, roles, working-directory overrides (blank inherits the Room's directory), effective configurations and session links; breadcrumbs and task links open the member's own conversation with its tools, duration and token usage. Room statistics for the native session are not a sum of member spend.
|
|
19
20
|
- **Shared model/effort controls** — coordinator and member composers share the core model/effort control; choosing a new configuration mid-run queues it for the next complete turn (tool continuations keep the current one), and frozen evaluation members reject changes. The original native DSH session keeps the host model selector and its semantics — it is not a local-agent member controller.
|
|
20
21
|
- **Live output, targeted stop** — members stream native text and reasoning into both their own conversation and the Room; final messages and tool records stay authoritative. Stopping a member interrupts only that member and preserves non-empty partial output with an explicit stopped/failed label, duration and session link; long replies expand from a compact preview.
|
|
21
|
-
- **Preset-gated chrome, fail-open** — the **Invite agent** header chip and the **Members** tab appear exactly when the session's preset composition grants the `@khorsheed/dsh-room
|
|
22
|
+
- **Preset-gated chrome, fail-open** — the **Invite agent** header chip and the **Members** tab appear exactly when the session's preset composition grants the `@khorsheed/dsh-room/tool` row, fail open when the composition cannot be read, and always stay visible inside an existing Room.
|
|
22
23
|
|
|
23
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
24
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-invite.png" width="640" alt="the Members tab: the empty state that turns the session into a multi-agent collaboration room, and the session header's Invite agent entry">
|
|
24
25
|
|
|
25
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
26
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-2.png" width="640" alt="the Members tab: member cards with name, provider, role and model, plus the Set-as-coordinator action">
|
|
26
27
|
|
|
27
28
|
## Install
|
|
28
29
|
|
|
@@ -30,7 +31,7 @@ Getting several agents onto one piece of work today means copy-pasting between w
|
|
|
30
31
|
dsh plugin --profile web add @khorsheed/dsh-room
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
The package mounts its own loader row and browser contribution; restart the web instance to activate. For external CLI members, install the local-agent core and the providers you want alongside it — without them the Room still works with the native DSH coordinator. The model-facing tools (`room_invite` / `room_task` / `room_message`)
|
|
34
|
+
The package mounts its own loader row and browser contribution; restart the web instance to activate. For external CLI members, install the local-agent core and the providers you want alongside it — without them the Room still works with the native DSH coordinator. The model-facing tools (`room_invite` / `room_task` / `room_message`) ship with this package since 0.2.0: the tool row is the package's `./tool` composition entry, granted per session by an agent preset (referenced as `@khorsheed/dsh-room/tool`, row id `room-tool`; the standalone 0.1.x companion `@khorsheed/dsh-room-tool` is retired).
|
|
34
35
|
|
|
35
36
|
```sh
|
|
36
37
|
dsh plugin --profile web remove @khorsheed/dsh-room
|
|
@@ -64,13 +65,13 @@ Uninstalling removes the plugin's surfaces; persisted Room journals stay in thei
|
|
|
64
65
|
|
|
65
66
|
**Client.** The browser half mounts the generated Remote via `ctx.remote.$mount`, registers the zh/en dictionaries, and feeds a client-side `RoomStore`. Slot entries: the **Invite agent** session-header action (`conversation.session.header.actions`, order 30), the **Members** `conversation.view` tab (order 20; hiding happens at registration level — a hidden tab is unregistered, not an empty body), the `conversation.composer` takeover (priority -10: claims exactly cached-room sessions, yields to pending approval interactions, and renders the dock capsules and stats row itself because their official seats hide with the fallback), and five `conversation.chat.node` renderers (`room-speech` / `room-run` / `room-event` / `room-relay` / `room-task-line`).
|
|
66
67
|
|
|
67
|
-
**Tool
|
|
68
|
+
**Tool row (the M4' split, folded back at 0.2.0).** The core registers no model-facing tools at the profile root: the `room_invite` / `room_task` / `room_message` factories live in the internal `./tool-definition.ts` module (not on the exports map) and ship untagged; the mountable row is this package's `./tool` composition entry (`name` / `inject = ['room']` / `apply`, zero `ctx.provide` — the preset-mount isolate-realm rule forbids only service rows, so a tool row composes bare in a preset), referenced by name from an agent preset's `agent.cordis.yml` (`name: '@khorsheed/dsh-room/tool'`, row id `room-tool`), granted per session and tagged with this package as its tool origin. The row was the standalone companion `@khorsheed/dsh-room-tool` on the 0.1.x line and folded back at 0.2.0 (the canvas `./agent` precedent); the old npm name is retired. `room_invite` and `room_message` promote the calling session into a room; `room_task` writes the shared board through the same host functions the capsule UI uses. External members reach `room_read` / `room_invite` / `room_message` / `room_plan` through the authenticated family bridge (`receiveMemberCommand`), where room and actor identity are host-owned, never tool arguments.
|
|
68
69
|
|
|
69
70
|
**Family coupling.** The only coupling to the local-agent family is a probed facade — `ctx.get('localAgent')` plus method-existence duck-typing, with types as type-only imports drift-checked at compile time. An absent facade degrades CLI members (structured `local-agent-unavailable` at invite, journaled `failed` runs at dispatch) and never fails the boot. The notification gate's `receiveMemberMessage` is duck-type-called by the family bridge and runtime-validated across the untyped package boundary.
|
|
70
71
|
|
|
71
|
-
**Model experience.** The current goal rides the top of the roster section in every member prompt; there is deliberately no blackboard fold — member prompts never consume the room's running log (speech/dispatch events are journaled for UI projection and replay only). Model-facing tools arrive with the session's preset grant, tagged by the
|
|
72
|
+
**Model experience.** The current goal rides the top of the roster section in every member prompt; there is deliberately no blackboard fold — member prompts never consume the room's running log (speech/dispatch events are journaled for UI projection and replay only). Model-facing tools arrive with the session's preset grant, tagged by the package's own `./tool` row.
|
|
72
73
|
|
|
73
|
-
**Identity triangle.** cordis row id `room` (`cordis.patch.yml`) = `clientBundle('@khorsheed/dsh-room')` (`tsdown.config.ts`) = `src/invariant.ts` `PACKAGE_NAME`. Exports: `.` host service, `/client` (plugin `apply`/`inject` plus the `RoomRemote` type), `/tool`
|
|
74
|
+
**Identity triangle.** cordis row id `room` (`cordis.patch.yml`) = `clientBundle('@khorsheed/dsh-room')` (`tsdown.config.ts`) = `src/invariant.ts` `PACKAGE_NAME`. Exports: `.` host service, `/client` (plugin `apply`/`inject` plus the `RoomRemote` type), `/tool` the session-granted model tool row, `/types`, `/typert`, `/remote`, `/invariant`.
|
|
74
75
|
|
|
75
76
|
</details>
|
|
76
77
|
|
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
3
|
# editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/room/README.en.md
|
|
5
|
-
packages/room/README.en.md:
|
|
6
|
-
packages/room/README.md:
|
|
5
|
+
packages/room/README.en.md: e618b146703f23e87a1f4ad5c02b041aa9b42609
|
|
6
|
+
packages/room/README.md: 50cce309cba3611d7117ddb791fabcd14b0a9ca1
|
package/README.md
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
让多个 agent 干同一件事,过去只能在几个窗口之间复制粘贴,或者靠一次性的子代理调用——返回即遗忘。Room 把会话本身变成共享的协作场所:邀请第一位成员,当前会话就升级为 Room,原生 DSH agent 入座初始协调者;每位成员跨轮次、跨重启都保留自己的原生会话。
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-1.png" width="640" alt="一个进行中的 Room:聊天流里的成员回执与运行行,输入框上方展开的 @ 成员菜单">
|
|
10
10
|
|
|
11
11
|
## 特性
|
|
12
12
|
|
|
13
|
+
- **折叠执行与计划胶囊**——输入框上沿的「后台 Agent」默认只显示名称,有执行时图标变为绿点。展开后按执行查看状态、耗时、已报告的单轮 token、中止与真实会话入口;原生后代会话累计值单独标注。正式计划先展示简短进度,完整验收与运行限制按需进入侧栏;缺少侧栏时原位展开。
|
|
13
14
|
- **邀请即升级**——没有单独的「创建房间」步骤:在任意会话里邀请第一位成员,它就变成 Room;原生 DSH agent 入座初始协调者(新 Room 命名为 `dsh`,已有 Room 保留日志里记录的寻址名)。
|
|
14
15
|
- **@ 寻址与并行派发**——开头的 `@name` 指向已有成员,多个名字并行派发;从补全菜单选中的提及即使位于句中也明确寻址,手写在正文里的提及则不算(菜单永不创建成员)。同一成员的轮次共用一条队列,不同成员并发执行;请求带持久化身份,重试不会重复已接受的工作。
|
|
15
16
|
- **协调者交接**——任何准备好的成员(DSH、Codex、Claude Code、Kimi)都可以在成员页「设为协调者」;交接记录携带目标、计划状态、未结任务和最近上下文。协调者运行中时,必须等当前轮次落定才能替换。
|
|
@@ -18,11 +19,11 @@
|
|
|
18
19
|
- **成员保留原生会话**——成员页记录名称、provider、角色、工作目录覆盖(留空继承 Room 目录)、有效配置与会话入口;面包屑与任务入口能进入成员自己的会话,查看工具、耗时与 token 用量。Room 原生会话的统计不是所有成员消耗的总和。
|
|
19
20
|
- **共享模型/强度控制**——协调者与成员输入栏共用同一套 core 模型/effort 控制;运行中选择新配置会排到下一完整轮次(工具续跑沿用本轮配置),冻结的评测成员拒绝变更。原生 DSH 主会话仍使用宿主模型选择器及其语义——它不是 local-agent 成员控制器。
|
|
20
21
|
- **实时输出与定向停止**——成员把原生正文与推理增量同时呈现在自己的会话和 Room 中;最终消息与工具记录仍是权威内容。定向停止只中断该成员,非空部分输出带明确的停止/失败标记、耗时与会话入口保留;长回答可从紧凑预览展开。
|
|
21
|
-
- **入口随 preset 授权显隐、失败放行**——「邀请 agent」chip 与「成员」tab 只在当前会话的 preset 组合授予 `@khorsheed/dsh-room
|
|
22
|
+
- **入口随 preset 授权显隐、失败放行**——「邀请 agent」chip 与「成员」tab 只在当前会话的 preset 组合授予 `@khorsheed/dsh-room/tool` 行时出现;读不到组合时保持可见(fail-open);已是 Room 的会话始终保留界面。
|
|
22
23
|
|
|
23
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
24
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-invite.png" width="640" alt="成员标签页:空态的「把会话变成多 agent 协作间」与会话头部的「邀请 agent」入口">
|
|
24
25
|
|
|
25
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
26
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/room-2.png" width="640" alt="成员页:成员卡片(名称、provider、角色、模型)与「设为协调者」操作">
|
|
26
27
|
|
|
27
28
|
## 安装
|
|
28
29
|
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
dsh plugin --profile web add @khorsheed/dsh-room
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
本包自行挂载 loader 行与浏览器贡献;重启 web 实例后生效。需要外部 CLI 成员时,同时安装 local-agent core 和所需 provider——没有它们,Room 仍可与原生 DSH 协调者正常协作。面向模型的工具(`room_invite` / `room_task` / `room_message
|
|
34
|
+
本包自行挂载 loader 行与浏览器贡献;重启 web 实例后生效。需要外部 CLI 成员时,同时安装 local-agent core 和所需 provider——没有它们,Room 仍可与原生 DSH 协调者正常协作。面向模型的工具(`room_invite` / `room_task` / `room_message`)0.2.0 起随本包自带:工具行是包内 `./tool` 组合入口,由 agent preset 按会话授予(preset 组合里引 `@khorsheed/dsh-room/tool`,行 id `room-tool`;0.1.x 的独立伴生包 `@khorsheed/dsh-room-tool` 已退役)。
|
|
34
35
|
|
|
35
36
|
```sh
|
|
36
37
|
dsh plugin --profile web remove @khorsheed/dsh-room
|
|
@@ -64,13 +65,13 @@ dsh plugin --profile web remove @khorsheed/dsh-room
|
|
|
64
65
|
|
|
65
66
|
**客户端。** 浏览器半经 `ctx.remote.$mount` 挂载生成的 Remote,注册 zh/en 词典,并驱动客户端 `RoomStore`。槽位条目:会话头部「邀请 agent」动作(`conversation.session.header.actions`,order 30)、「成员」`conversation.view` tab(order 20;隐藏发生在注册层——隐藏的 tab 是注销而非空体)、`conversation.composer` 接管(priority -10:只认领缓存判定为 Room 的会话,对挂起的审批交互让位;dock 胶囊与统计行由它自行渲染,因为它们的官方座位随被藏起的回退树一起消失),以及五个 `conversation.chat.node` 渲染器(`room-speech` / `room-run` / `room-event` / `room-relay` / `room-task-line`)。
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
**工具行(M4' 拆分,0.2.0 回并)。** core 不在 profile 根注册任何面向模型的工具:`room_invite` / `room_task` / `room_message` 的工厂留在内部模块 `./tool-definition.ts`(不进 exports 面)且不带 origin 标签;可挂载行是本包的 `./tool` 组合入口(`name` / `inject = ['room']` / `apply`,零 `ctx.provide`——preset 挂载面的 isolate-realm 规则只拒服务行,工具行可裸放 preset),由各 agent preset 的 `agent.cordis.yml` 按名引用(`name: '@khorsheed/dsh-room/tool'`,行 id `room-tool`),按会话授予并打上归本包的 origin 标签。0.1.x 时该行是独立伴生包 `@khorsheed/dsh-room-tool`,0.2.0 起回并(canvas `./agent` 先例),旧 npm 名退役。`room_invite` 与 `room_message` 会把调用所在会话升级为 Room;`room_task` 与胶囊 UI 走同一组宿主函数写共享任务板。外部成员经认证家族桥(`receiveMemberCommand`)使用 `room_read` / `room_invite` / `room_message` / `room_plan`——房间与调用者身份由宿主持有,绝不出现在工具参数里。
|
|
68
69
|
|
|
69
70
|
**家族耦合。** 与 local-agent 家族唯一的耦合是探测式门面——`ctx.get('localAgent')` 加方法存在性鸭子类型判断,类型仅作 type-only 导入、编译期漂移检查。门面缺席时 CLI 成员降级(邀请返回结构化 `local-agent-unavailable`,派发落 `failed` 运行记录),绝不影响 boot。通知闸门的 `receiveMemberMessage` 由家族桥鸭子调用,跨无类型包边界做运行时校验。
|
|
70
71
|
|
|
71
|
-
**模型体验。** 当前目标随每个成员提示词的名册段顶部下发;刻意不做黑板折叠——成员提示词从不消费房间的运行日志(speech/dispatch 事件只为 UI 投影与回放落日志)。面向模型的工具随会话 preset
|
|
72
|
+
**模型体验。** 当前目标随每个成员提示词的名册段顶部下发;刻意不做黑板折叠——成员提示词从不消费房间的运行日志(speech/dispatch 事件只为 UI 投影与回放落日志)。面向模型的工具随会话 preset 授予到达,由本包的 `./tool` 行打标。
|
|
72
73
|
|
|
73
|
-
**身份三角。** cordis 行 id `room`(`cordis.patch.yml`)= `clientBundle('@khorsheed/dsh-room')`(`tsdown.config.ts`)= `src/invariant.ts` 的 `PACKAGE_NAME`。导出:`.` 宿主服务、`/client`(插件 `apply`/`inject` 与 `RoomRemote` 类型)、`/tool`
|
|
74
|
+
**身份三角。** cordis 行 id `room`(`cordis.patch.yml`)= `clientBundle('@khorsheed/dsh-room')`(`tsdown.config.ts`)= `src/invariant.ts` 的 `PACKAGE_NAME`。导出:`.` 宿主服务、`/client`(插件 `apply`/`inject` 与 `RoomRemote` 类型)、`/tool` 按会话授予的模型工具行、`/types`、`/typert`、`/remote`、`/invariant`。
|
|
74
75
|
|
|
75
76
|
</details>
|
|
76
77
|
|