@khorsheed/dsh-room 0.1.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +48 -0
  4. package/README.zh.md +48 -0
  5. package/cordis.patch.yml +6 -0
  6. package/lib/client.js +11481 -0
  7. package/lib/index.js +3231 -0
  8. package/lib/invariant.js +26 -0
  9. package/lib/journal-CuRnWk66.js +435 -0
  10. package/lib/tool.js +350 -0
  11. package/lib/typert.host.d.ts +3 -0
  12. package/lib/typert.host.js +2615 -0
  13. package/lib/typert.remote-client.d.ts +55 -0
  14. package/lib/typert.remote-client.js +1711 -0
  15. package/lib/types/adapter.d.ts +42 -0
  16. package/lib/types/adapter.js +41 -0
  17. package/lib/types/agent-setup.d.ts +141 -0
  18. package/lib/types/agent-setup.js +145 -0
  19. package/lib/types/client/InviteAgentAction.d.ts +13 -0
  20. package/lib/types/client/InviteAgentAction.js +45 -0
  21. package/lib/types/client/InviteDialog.d.ts +90 -0
  22. package/lib/types/client/InviteDialog.js +216 -0
  23. package/lib/types/client/MemberCard.d.ts +33 -0
  24. package/lib/types/client/MemberCard.js +32 -0
  25. package/lib/types/client/MembersView.d.ts +5 -0
  26. package/lib/types/client/MembersView.js +168 -0
  27. package/lib/types/client/RoomComposer.d.ts +21 -0
  28. package/lib/types/client/RoomComposer.js +211 -0
  29. package/lib/types/client/RoomDockCapsules.d.ts +64 -0
  30. package/lib/types/client/RoomDockCapsules.js +277 -0
  31. package/lib/types/client/RoomEventView.d.ts +11 -0
  32. package/lib/types/client/RoomEventView.js +17 -0
  33. package/lib/types/client/RoomModelPicker.d.ts +18 -0
  34. package/lib/types/client/RoomModelPicker.js +134 -0
  35. package/lib/types/client/RoomPlanView.d.ts +17 -0
  36. package/lib/types/client/RoomPlanView.js +88 -0
  37. package/lib/types/client/RoomQueueStrip.d.ts +26 -0
  38. package/lib/types/client/RoomQueueStrip.js +28 -0
  39. package/lib/types/client/RoomRecoveryView.d.ts +11 -0
  40. package/lib/types/client/RoomRecoveryView.js +38 -0
  41. package/lib/types/client/RoomRelayView.d.ts +12 -0
  42. package/lib/types/client/RoomRelayView.js +20 -0
  43. package/lib/types/client/RoomRunView.d.ts +15 -0
  44. package/lib/types/client/RoomRunView.js +50 -0
  45. package/lib/types/client/RoomSpeechView.d.ts +18 -0
  46. package/lib/types/client/RoomSpeechView.js +62 -0
  47. package/lib/types/client/RoomStatsLine.d.ts +61 -0
  48. package/lib/types/client/RoomStatsLine.js +138 -0
  49. package/lib/types/client/RoomTaskLineView.d.ts +13 -0
  50. package/lib/types/client/RoomTaskLineView.js +21 -0
  51. package/lib/types/client/RoomTodoStrip.d.ts +24 -0
  52. package/lib/types/client/RoomTodoStrip.js +64 -0
  53. package/lib/types/client/format.d.ts +31 -0
  54. package/lib/types/client/format.js +48 -0
  55. package/lib/types/client/icons.d.ts +27 -0
  56. package/lib/types/client/icons.js +11 -0
  57. package/lib/types/client/index.d.ts +39 -0
  58. package/lib/types/client/index.js +471 -0
  59. package/lib/types/client/locales.d.ts +422 -0
  60. package/lib/types/client/locales.js +413 -0
  61. package/lib/types/client/member-color.d.ts +13 -0
  62. package/lib/types/client/member-color.js +22 -0
  63. package/lib/types/client/name-pool.d.ts +17 -0
  64. package/lib/types/client/name-pool.js +25 -0
  65. package/lib/types/client/nodes.d.ts +136 -0
  66. package/lib/types/client/nodes.js +212 -0
  67. package/lib/types/client/preset-visibility.d.ts +91 -0
  68. package/lib/types/client/preset-visibility.js +113 -0
  69. package/lib/types/client/request-ids.d.ts +7 -0
  70. package/lib/types/client/request-ids.js +21 -0
  71. package/lib/types/client/room-store.d.ts +137 -0
  72. package/lib/types/client/room-store.js +244 -0
  73. package/lib/types/client/slots.d.ts +319 -0
  74. package/lib/types/client/slots.js +1 -0
  75. package/lib/types/deliveries.d.ts +5 -0
  76. package/lib/types/deliveries.js +20 -0
  77. package/lib/types/dispatch.d.ts +105 -0
  78. package/lib/types/dispatch.js +467 -0
  79. package/lib/types/index.d.ts +301 -0
  80. package/lib/types/index.js +1200 -0
  81. package/lib/types/invariant.d.ts +16 -0
  82. package/lib/types/invariant.js +24 -0
  83. package/lib/types/journal.d.ts +117 -0
  84. package/lib/types/journal.js +434 -0
  85. package/lib/types/plan-service.d.ts +34 -0
  86. package/lib/types/plan-service.js +266 -0
  87. package/lib/types/plan.d.ts +168 -0
  88. package/lib/types/plan.js +494 -0
  89. package/lib/types/tool.d.ts +56 -0
  90. package/lib/types/tool.js +389 -0
  91. package/lib/types/types.d.ts +813 -0
  92. package/lib/types/types.js +1 -0
  93. package/locale/en.json +6 -0
  94. package/locale/zh.json +6 -0
  95. package/package.json +131 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # 变更记录
2
+
3
+ ## Unreleased
4
+
5
+ 按单实例多模式提案(2026-08-26)拆出模型工具行(M4'②,worktrees 之后的第二对 core/companion)。
6
+
7
+ - **BREAKING**:模型可见的 `room_invite` / `room_task` / `room_message` 工具不再由 core 在 profile 根注册——拆为伴生包 `@khorsheed/dsh-room-tool`(不 `ctx.provide`、不声明 `dsh.bundle` 的不自挂载行),由各 agent preset 的 `agent.cordis.yml` 按名引用、按会话授予。迁移:安装伴生包并在目标 preset 加 `- id: room-tool / name: '@khorsheed/dsh-room-tool'`(web-dev 的 dev preset 已带此行);工具定义工厂(`roomInviteTool` / `roomTaskTool` / `roomMessageTool`)经 core 的 `./tool` 导出供伴生包复用,业务实现零复制,origin tag 归伴生包
8
+ - room 服务、成员 UI(成员 tab / 邀请对话框 / 任务板 / 通知闸门)与全部 Remote 行为不变
9
+ - **会话 chrome 按 preset 自隐(M3'②)**:「邀请 agent」chip 与「成员」tab 只在当前会话的 preset 组合含 `@khorsheed/dsh-room-tool` 行时呈现(官方 `pluginInventory` 判据,worktrees 徽标同路径、包内内联);读不到 fail-open 显示;已是 room 的会话始终保留界面(E1)。成员 tab 隐藏走注册层(tab 按钮来自槽位注册表,注销而非空体)
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record: the git blob hash of each side as of the
2
+ # last confirmed-consistent state. Both languages carry equal authority; after
3
+ # editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/room/README.md
5
+ packages/room/README.md: c5c155c2d286175f7f8b90ee08a83693189fd0b2
6
+ packages/room/README.zh.md: fdb772756fc226837b508835736749341946ece7
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @khorsheed/dsh-room
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ Room turns a normal DSH session into a shared conversation with a coordinator and invited members. It uses public plugin services and slots; no host source changes are required. Inviting the first member promotes the current session into a Room and seats its native DSH agent as the initial coordinator. New rooms name it `dsh`; existing rooms retain their recorded addressing names.
6
+
7
+ ## Conversation and coordination
8
+
9
+ Bare messages go directly to the selected coordinator. Initially this is the native DSH agent. After inviting and preparing a DSH, Codex, Claude Code or Kimi member, the human can select **Set as coordinator** in the members tab. Handoff records include the goal, member roster and recent context. A running coordinator cannot be replaced until its current turn settles.
10
+
11
+ Leading `@name` tokens address existing members; several names fan out. The completion menu never creates members. A menu-picked mention explicitly addresses that member even inside a sentence; a hand-typed mention inside prose does not. Same-member turns share core's whole-turn queue, while different members can run concurrently. Requests have durable identities so retries do not duplicate accepted work.
12
+
13
+ Ordinary chat needs no formal plan. The coordinator can use `room_message` for a small background task, continue the conversation, and receive a correlated completion report automatically at a turn boundary. `room_read`, `room_invite`, `room_message` and `room_plan` are exposed to external members through the authenticated family bridge. General peer notifications through `member_message` or a trailing `@name` reply retain the separate human confirm/dismiss gate; this gate does not block coordinator task reports.
14
+
15
+ ## Goals and review
16
+
17
+ For larger work, the coordinator or human can create a formal goal. The goal panel shows stages, hierarchical tasks, dependencies, execution attempts, submitted evidence and explicit acceptance or rework. A completed generation is not automatically accepted. Dependent tasks become eligible only after their prerequisites are accepted. Rework records a reason and starts another attempt within budget.
18
+
19
+ Budgets bound goal-wide concurrency, total executions, executions per task and active goal time (paused time excluded). Initial runs, retries and rework all count; ordinary chat is outside these limits. The human can pause/resume, adjust budgets, review evidence, cancel, or complete an accepted plan. After restart, unresolved execution is marked uncertain and the plan pauses; reconciliation requires evidence rather than blindly repeating work. Simple chat tasks remain visible separately from formal goal progress.
20
+
21
+ ## Members, models and output
22
+
23
+ The members tab keeps names, providers, roles, working directories, effective configurations and session links. A working-directory override is passed to the family facade; blank inherits the Room directory. Each member retains its native conversation across turns and restarts. Breadcrumbs, task links and the members page still open that conversation with its tools, duration and token usage. Room statistics for the native session are not a sum of every member's spend.
24
+
25
+ The coordinator composer and member composer use the same core model/effort control. Model directories retain native identifiers, aliases, display names and supported reasoning choices; candidate provenance and completeness remain in the directory contract. The shared picker shows model/effort choices, loading and actionable failures without catalog maintenance controls. Choosing a configuration while busy queues it for the next complete turn, including tool continuations; core owns current/pending state, revisions, cancellation and retry. Frozen evaluation members reject configuration changes. The original native DSH session still uses the host model selector and its semantics; it is not a local-agent member controller.
26
+
27
+ Live members stream native text and reasoning into both their own conversation and Room. Final messages and tool records remain authoritative. A targeted Stop interrupts only that member, preserving nonempty partial output with an explicit stopped/failed label, duration and child-session link. Long Room replies can expand from a compact preview. No P95 latency guarantee follows from the transport interval alone; measured acceptance is tracked separately.
28
+
29
+ ## Install
30
+
31
+ ```sh
32
+ dsh plugin add @khorsheed/dsh-room
33
+ ```
34
+
35
+ The package mounts its own loader row and browser contribution. Install the local-agent core and desired providers alongside it for external members. Native DSH model-facing tools belong to the `@khorsheed/dsh-room-tool` companion, granted through the session's preset composition. The invite header and members tab follow that grant, fail open when inventory cannot be read, and remain available for an existing Room. Uninstalling removes the plugin's surfaces.
36
+
37
+ ## Compatibility
38
+
39
+ - npm host line (`@deepseek-ai/dsh@0.1.5-rc.1`): supported — 0.1.5-rc.1 full-line boot-verified (42 packages including capture, 2026-09-25) — degraded until this local-agent family is published and installed. The currently unpublished family is required for external coordinator preparation, shared controls and authenticated member tools; without it those operations return an unavailable result. Native DSH Room functionality remains available.
40
+ - Source host line (deepseek-harness `183f08e9c6`, `0.1.5-rc.1`): the worktree composition builds and passes isolated preflight. DSH/Kimi real coordinator, delegation, two-stage review and interruption recovery have been exercised. Fresh installation and upgrade of the candidate tarballs also pass against the npm host above, retaining the old Room state. Codex/Claude authenticated runtime acceptance and the full latency gate remain outstanding; see the [acceptance record](../../docs/acceptance/room-coordinator-2026-09-19.md).
41
+ - Source host line (deepseek-harness master, `0.1.7-rc.1`): ✅ build+test green (`verifiedHost: 0.1.7-rc.1`) — Session V4 adaptation: the main-agent followup's source moved to the producer-owned kind `room` (V4 native admission refuses the retired `kind: 'plugin'` wrapper at the durable write; a 0.1.5 host's `user/message` admission accepts any non-empty kind, so both lines write durably), and the read side accepts `room`, `plugin:@khorsheed/dsh-room` (the V3→V4 migrated form), and the released V3 wrapper. The `conversation.chat.node` rc.1 contract re-verified (the 5 room renderers touch neither hookContext nor the disclosure factory).
42
+ - Dual-line evidence: the 0.1.5 boot passes end-to-end through three compat layers — the [preset-registry dual-name probe](../../.agents/notes/implemented/bug-fix/2026-09-25-preset-registry-dual-name-probe.md), [dual-shape typert codecs](../../.agents/notes/implemented/bug-fix/2026-09-25-typert-codec-dual-shape.md), and [typert faces carrying zod@4](../../.agents/notes/implemented/bug-fix/2026-09-25-typert-faces-carry-zod-v4.md).
43
+
44
+ Room registers its `room/*` vocabulary in the active loader's session-event catalog so durable journals can be read after restart. Core similarly registers member stream checkpoints. A persisted Room requires Room to remain mounted. This is a temporary compatibility seam pending an official event registration API.
45
+
46
+ ## Limits
47
+
48
+ General peer notification relays still require human confirmation. A native DSH session's model selector has host-defined turn semantics. Remote-host paint measurements require clock alignment; the local diagnostic assumes a shared clock. Member identity/action styling replicates host chrome and needs maintenance when upstream visuals change. Storage failures are surfaced diagnostically and cannot be ruled out by a successful model response.
package/README.zh.md ADDED
@@ -0,0 +1,48 @@
1
+ # @khorsheed/dsh-room
2
+
3
+ [English](README.md) | 中文
4
+
5
+ Room 将普通 DSH 会话变成有协调者和受邀成员的共享对话,使用公开插件服务和插槽,无需修改宿主源码。邀请第一位成员时,当前会话升级为 Room,原生 DSH agent 担任初始协调者。新 Room 将其命名为 `dsh`,已有 Room 保留日志中的寻址名称。
6
+
7
+ ## 对话与协调
8
+
9
+ 普通消息直接发送给当前协调者,初始为原生 DSH agent。邀请并准备好 DSH、Codex、Claude Code 或 Kimi 成员后,用户可以在成员页将其**设为协调者**。交接记录包含目标、成员名册和最近上下文。协调者正在运行时,必须等当前轮次结束才能替换。
10
+
11
+ 开头的 `@name` 指向已有成员,多个名字并行派发。补全菜单不会创建成员;从菜单选择的名字即使位于句中也明确寻址,手写在普通正文中的提及则不寻址。同一成员的轮次共用 core 的整轮队列,不同成员可以并发。请求具有持久化身份,重试不会重复已接收的工作。
12
+
13
+ 普通聊天不必建立正式计划。协调者可以用 `room_message` 派发小型后台任务,继续对话,并在轮次边界自动收到带关联标识的成果回报。外部成员通过家族认证桥使用 `room_read`、`room_invite`、`room_message` 和 `room_plan`。通过 `member_message` 或回答末尾 `@name` 发出的普通成员通知仍保留单独的人工确认/忽略入口;该入口不会阻塞协调者任务的成果回报。
14
+
15
+ ## 目标与验收
16
+
17
+ 较大工作由协调者或用户建立正式目标。目标面板展示阶段、层级任务、依赖、执行尝试、成果证据,以及明确的验收或返工。生成结束不等于验收通过;前置任务验收通过后,后续任务才有资格执行。返工记录原因,并在预算内开启新尝试。
18
+
19
+ 预算限制整个目标的并发数、总执行次数、每项任务执行次数和目标推进时长(不含暂停时间)。首次执行、重试和返工均计入,普通聊天不消耗这些次数。用户可以暂停/继续、调整预算、检查证据、取消或结束已验收计划。重启后未确定的执行标记为待核对,计划暂停;必须提供证据核对,不能盲目重复执行。普通聊天任务与正式目标进度分别展示。
20
+
21
+ ## 成员、模型与输出
22
+
23
+ 成员页保留名称、provider、角色、工作目录、有效配置和会话入口。工作目录覆盖会传给家族委派接口,留空继承 Room 目录。成员跨轮次、跨重启保留原生会话。面包屑、任务入口和成员页仍能进入会话,查看工具、耗时和 token 用量。Room 原生会话统计不是所有成员消耗的总和。
24
+
25
+ 协调者输入栏和成员输入栏使用同一套 core 模型/effort 控制。模型目录保留原生 ID、别名、显示名称及支持的推理选项;候选来源和完整性保留在目录合同中。共享选择器展示模型/强度、加载状态和影响操作的失败,不再提供目录维护控件。运行中选择新配置会排到下一完整轮次,工具续跑仍沿用本轮配置;core 统一持有当前/待生效状态、版本、撤销和重试。冻结评测成员拒绝配置变更。原生 DSH 主会话仍使用宿主模型选择器及其语义,不属于 local-agent 成员控制器。
26
+
27
+ Live 成员把原生正文和推理增量同时呈现在成员会话和 Room 中,最终消息与工具记录仍为权威内容。定向停止只中断该成员,非空部分输出带明确的停止/失败标记、耗时和成员会话入口保留。Room 长回答可从紧凑预览展开。通道间隔本身不证明 P95 延迟达标,实测验收单独记录。
28
+
29
+ ## 安装
30
+
31
+ ```sh
32
+ dsh plugin add @khorsheed/dsh-room
33
+ ```
34
+
35
+ 本包自行挂载 loader 行和浏览器贡献。使用外部成员时,同时安装 local-agent core 和所需 provider。原生 DSH 面向模型的工具由 `@khorsheed/dsh-room-tool` companion 提供,通过会话 preset composition 授权。邀请入口和成员标签页跟随该授权,无法读取 inventory 时保持可见,已有 Room 始终保留入口。卸载移除本插件的界面。
36
+
37
+ ## Compatibility
38
+
39
+ - npm 宿主线(`@deepseek-ai/dsh@0.1.5-rc.1`):支持——0.1.5-rc.1 全量 boot 实证通过(42 包含 capture,2026-09-25)——在本次 local-agent 家族发布并安装前降级。目前尚未发布的家族实现是外部协调者准备、共享控制和认证成员工具的前提;缺失时这些操作返回不可用,原生 DSH Room 功能仍可用。
40
+ - 源码宿主线(deepseek-harness `183f08e9c6`,`0.1.5-rc.1`):worktree 组合构建及隔离 preflight 通过,已实测 DSH/Kimi 协调者、委派、两阶段验收和中断恢复。候选 tarball 在上述 npm 宿主上的全新安装与升级也已通过,旧 Room 状态得到保留。Codex/Claude 认证运行与完整延迟门槛仍待验收,见[验收记录](../../docs/acceptance/room-coordinator-2026-09-19.md)。
41
+ - 源码宿主线(deepseek-harness master,`0.1.7-rc.1`):✅ 构建测试全绿(`verifiedHost: 0.1.7-rc.1`)——Session V4 适配:主代理 followup 的 source 改为生产者归属 kind `room`(V4 原生准入在落盘写入时拒收退役的 `kind: 'plugin'` 包装;0.1.5 宿主的 `user/message` 准入只查 kind 非空,两条线都能落盘),读侧兼认 `room`、`plugin:@khorsheed/dsh-room`(V3→V4 迁移形态)与 V3 包装存量。`conversation.chat.node` rc.1 契约复验通过(5 个 room 渲染器均不触 hookContext 与 disclosure 工厂)。
42
+ - 双线证据:0.1.5 的 boot 经三层兼容修复端到端通过——[preset-registry 双名探测](../../.agents/notes/implemented/bug-fix/2026-09-25-preset-registry-dual-name-probe.md)、[typert codec 双形状](../../.agents/notes/implemented/bug-fix/2026-09-25-typert-codec-dual-shape.md)、[face 自带 zod@4](../../.agents/notes/implemented/bug-fix/2026-09-25-typert-faces-carry-zod-v4.md)。
43
+
44
+ Room 通过当前 loader 的会话事件目录注册 `room/*`,保证重启后能够读取持久化日志;core 同样注册成员流式检查点。已持久化的 Room 需要继续挂载 Room 插件。这是等待官方事件注册 API 的临时兼容接口。
45
+
46
+ ## 限制
47
+
48
+ 普通成员通知仍需人工确认。原生 DSH 会话的换模轮次语义由宿主决定。远程宿主绘制测量需要对齐时钟,本地诊断假设同钟。成员标识和操作按钮复用了宿主样式,需要跟进上游视觉变化。存储失败提供诊断,模型回答成功不能排除存储故障。
@@ -0,0 +1,6 @@
1
+ # room bundle patch: inserts the plugin row into the composing profile.
2
+ # The client half is discovered through the package.json dsh.client block; this
3
+ # row activates the host half (the room Remote service).
4
+ - insert:
5
+ - id: room
6
+ name: '@khorsheed/dsh-room'