@michengai/dsh-btw 0.1.7 → 0.1.8

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.8] - 2026-09-16
4
+
5
+ - Support DSH `0.1.6-alpha.1` while retaining compatibility with the five previously supported host versions.
6
+
3
7
  ## [0.1.7] - 2026-09-13
4
8
 
5
9
  - Add a compact conversation text-selection toolbar to quote text in the composer or ask an independent BTW question, alongside sidebar file-selection actions.
@@ -1,5 +1,9 @@
1
1
  # 更新日志
2
2
 
3
+ ## [0.1.8] - 2026-09-16
4
+
5
+ - 支持 DSH `0.1.6-alpha.1`,同时保留此前五个宿主版本的兼容支持。
6
+
3
7
  ## [0.1.7] - 2026-09-13
4
8
 
5
9
  - 新增正文划词旁问:通过紧凑横条添加引用到对话或发起独立旁问,与侧边栏文件划词选项共存。
package/README.md CHANGED
@@ -49,23 +49,26 @@ Each answer has its own copy, collapse or expand, and close controls in the uppe
49
49
 
50
50
  ## DSH product ecosystem
51
51
 
52
- For a ready-to-use workbench, download [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases). If you already use [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), install any of these eight plugins individually. The desktop app includes all eight.
52
+ For a desktop workbench, download [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases). Existing [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) installations can add plugins as needed by following each project's README. Below are 11 first-party plugins; consult the corresponding desktop release notes and bundled catalog for what that version includes.
53
53
 
54
54
  | Plugin | What you can do |
55
55
  | --- | --- |
56
56
  | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | Organize projects and conversations, search tasks, and navigate chat turns |
57
- | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | Send tasks and receive replies through your usual messenger |
58
- | [Automation](https://github.com/MichengAI/dsh-automation) | Schedule tasks and review each run |
57
+ | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | Choose and summon specialists for your task |
59
58
  | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | Find, enable, create, and import local skills |
60
59
  | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | Search, restore, or clean up archived conversations |
61
- | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | Choose and summon specialists for your task |
60
+ | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | Send tasks and receive replies through messaging platforms |
61
+ | [Automation](https://github.com/MichengAI/dsh-automation) | Schedule tasks and review each run |
62
62
  | [BTW](https://github.com/MichengAI/dsh-btw) | Ask side questions without interrupting the main task |
63
- | [Simplify](https://github.com/MichengAI/dsh-simplify) | Use /simplify to improve code within your Git changes |
63
+ | [Simplify](https://github.com/MichengAI/dsh-simplify) | Use `/simplify` to improve code within your Git changes |
64
+ | [PUA](https://github.com/MichengAI/dsh-pua) | Guide the Agent to try new approaches after failures, investigate causes, and verify results before completion |
65
+ | [Code Review](https://github.com/MichengAI/dsh-code-review) | Use `/review` to request an independent Agent code review and receive the report in the current conversation |
66
+ | [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | View conversation notifications and respond to tool approvals and questions through a desktop pet |
64
67
 
65
68
  ## Prerequisites
66
69
 
67
70
  - An installed copy of DeepSeek Harness.
68
- - Host peers accept exactly `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2`.
71
+ - Host peers accept exactly `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1`.
69
72
  - Node.js 22+ and `dsh` available in your terminal.
70
73
 
71
74
  ## Installation
@@ -157,7 +160,7 @@ npm run check
157
160
 
158
161
  `npm run check` runs type checking, tests, and a build.
159
162
 
160
- Development and builds target `0.1.5-rc.2`. `npm run test:compat` builds with that baseline and runs the test suite on each of the five isolated host versions, using a test model adapter. DOM component tests do not replace live-browser acceptance.
163
+ Development and builds target `0.1.6-alpha.1`. `npm run test:compat` builds with that baseline and runs the test suite on each of the six isolated host versions, using a test model adapter. DOM component tests do not replace live-browser acceptance.
161
164
 
162
165
  Previous manual end-to-end acceptance with Edge and a live DeepSeek model passed on `0.1.5-rc.1`: side questions, attachment rejection, copying, collapse/expand, cancellation, and continued parent-session operation. This is not part of `npm run test:compat`. The selection toolbar, draft insertion, sidebar coexistence, and real-model side answers were subsequently checked on `0.1.5-rc.2`; the full end-to-end suite remains pending on that version and the older three versions.
163
166
 
package/README.zh-CN.md CHANGED
@@ -49,23 +49,26 @@
49
49
 
50
50
  ## DSH 产品生态
51
51
 
52
- 想直接使用完整工作台,可下载 [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases);已有 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 环境,可按需独立安装以下 8 个自研插件。桌面端已随附这些插件。
52
+ 想使用桌面工作台,可下载 [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases);已有 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 环境,可按各项目 README 按需安装。以下列出 11 个自研插件;桌面端实际随附范围以对应版本的发行说明和内置清单为准。
53
53
 
54
54
  | 插件 | 你可以用它做什么 |
55
55
  | --- | --- |
56
56
  | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | 整理项目与会话、搜索任务、跳转对话轮次 |
57
- | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | 从微信、飞书、钉钉等消息平台下任务、收回复 |
58
- | [Automation](https://github.com/MichengAI/dsh-automation) | 按计划执行任务,查看每次运行的结果 |
57
+ | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | 按任务选择并召唤专业角色 |
59
58
  | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | 统一查找、启停、创建和导入本机技能 |
60
59
  | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | 搜索、恢复或清理已归档会话 |
61
- | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | 按任务选择并召唤专业角色 |
60
+ | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | 从消息平台下任务、收回复 |
61
+ | [Automation](https://github.com/MichengAI/dsh-automation) | 按计划执行任务,查看每次运行的结果 |
62
62
  | [BTW](https://github.com/MichengAI/dsh-btw) | 在当前上下文中临时旁问,不打断主任务 |
63
- | [Simplify](https://github.com/MichengAI/dsh-simplify) | 用 /simplify 整理 Git 改动范围内的代码 |
63
+ | [Simplify](https://github.com/MichengAI/dsh-simplify) | 用 `/simplify` 整理 Git 改动范围内的代码 |
64
+ | [PUA](https://github.com/MichengAI/dsh-pua) | 引导 Agent 在失败时换方法、查原因,并在完成前验证结果 |
65
+ | [Code Review](https://github.com/MichengAI/dsh-code-review) | 用 `/review` 发起独立 Agent 代码审查,在当前会话接收报告 |
66
+ | [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | 通过桌面宠物查看会话提醒、处理工具审批和问题回答 |
64
67
 
65
68
  ## 前置条件
66
69
 
67
70
  - 已安装 DeepSeek Harness。
68
- - 宿主 peer 依赖精确声明为 `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2`。
71
+ - 宿主 peer 依赖精确声明为 `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1`。
69
72
  - Node.js 22+,可在终端执行 `dsh`。
70
73
 
71
74
  ## 安装
@@ -156,7 +159,7 @@ npm run check
156
159
 
157
160
  `npm run check` 执行类型检查、测试和构建。
158
161
 
159
- 开发与构建基线为 `0.1.5-rc.2`。`npm run test:compat` 用该基线编译,再在五个隔离宿主版本中分别运行测试集,模型使用测试适配器。DOM 组件测试不替代真实浏览器验收。
162
+ 开发与构建基线为 `0.1.6-alpha.1`。`npm run test:compat` 用该基线编译,再在六个隔离宿主版本中分别运行测试集,模型使用测试适配器。DOM 组件测试不替代真实浏览器验收。
160
163
 
161
164
  此前在 `0.1.5-rc.1` 上完成真实 Edge 与 DeepSeek 模型的手工端到端验收,旁问、附件拒绝、复制、折叠/展开、取消和父会话继续均通过。这不属于 `npm run test:compat`;随后在 `0.1.5-rc.2` 验证了划词横条、添加引用、侧边栏共存及真实模型旁问回答;该版本与旧三版的完整端到端用例仍未全部验收。
162
165
 
package/lib/client.js CHANGED
@@ -13677,6 +13677,7 @@ function apply(ctx) {
13677
13677
  close: (session, id) => execute(session, `/${CLOSE_COMMAND} ${id}`)
13678
13678
  }, t);
13679
13679
  const claim = (sessionId) => ({ claim: {
13680
+ name: "btw",
13680
13681
  token: "/btw",
13681
13682
  get hint() {
13682
13683
  return t("command.hint");
package/lib/index.js CHANGED
@@ -331,18 +331,39 @@ ${text}` : "" }));
331
331
  };
332
332
 
333
333
  // src/server/tool-guard.ts
334
+ var DENY = "BTW \u4EC5\u5141\u8BB8\u6587\u5B57\u56DE\u7B54\uFF0C\u7981\u6B62\u6267\u884C\u4EFB\u4F55\u5DE5\u5177\u3002";
335
+ function descriptorLabel(data) {
336
+ if (typeof data !== "object" || data === null || !("label" in data) || typeof data.label !== "string") return void 0;
337
+ return data.label;
338
+ }
339
+ function lastDescriptorLabel(session) {
340
+ if (typeof session?.snapshotEvents !== "function") return void 0;
341
+ const event = session.snapshotEvents().findLast((item) => item.type === "subagent/descriptor");
342
+ return descriptorLabel(event?.data);
343
+ }
334
344
  function createAnswerOnlyGuard(labels) {
335
345
  const owned = /* @__PURE__ */ new WeakSet();
336
- return ({ agent }) => {
346
+ const claim = (value) => {
347
+ if (value) owned.add(value);
348
+ };
349
+ const guard = ({ agent }) => {
337
350
  if (!agent) return void 0;
338
- if (!owned.has(agent)) {
339
- const event = agent.session.snapshotEvents().findLast((item) => item.type === "subagent/descriptor");
340
- const data = event?.data;
341
- if (typeof data !== "object" || data === null || !("label" in data) || typeof data.label !== "string" || !labels.has(data.label)) return void 0;
342
- owned.add(agent);
343
- }
344
- return "BTW \u4EC5\u5141\u8BB8\u6587\u5B57\u56DE\u7B54\uFF0C\u7981\u6B62\u6267\u884C\u4EFB\u4F55\u5DE5\u5177\u3002";
351
+ if (owned.has(agent) || agent.session !== void 0 && owned.has(agent.session)) return DENY;
352
+ const label = lastDescriptorLabel(agent.session);
353
+ if (!label || !labels.has(label)) return void 0;
354
+ claim(agent);
355
+ claim(agent.session);
356
+ return DENY;
357
+ };
358
+ guard.own = (agent) => {
359
+ claim(agent);
360
+ };
361
+ guard.recognize = (session, event) => {
362
+ if (event.type !== "subagent/descriptor") return;
363
+ const label = descriptorLabel(event.data);
364
+ if (label && labels.has(label)) claim(session);
345
365
  };
366
+ return guard;
346
367
  }
347
368
 
348
369
  // src/server/command-visibility.ts
@@ -373,7 +394,10 @@ var PERSONA = `\u4F60\u662F\u5F53\u524D\u4E3B\u4EFB\u52A1\u4E4B\u5916\u7684\u4E0
373
394
  function apply(ctx) {
374
395
  ctx.effect(() => hideInternalCommands(ctx.commands));
375
396
  const labels = /* @__PURE__ */ new Set();
376
- const releaseGuard = ctx.extend({ fiber: ctx.root.fiber }).tools.guard(createAnswerOnlyGuard(labels));
397
+ const protection = createAnswerOnlyGuard(labels);
398
+ const host = ctx.extend({ fiber: ctx.root.fiber });
399
+ const releaseGuard = host.tools.guard(protection);
400
+ const stopWatch = host.on("session/event", (session, event) => protection.recognize(session, event));
377
401
  const jobs = new SideJobs(async (request) => {
378
402
  const provider = ctx.subagents.getProvider("fork");
379
403
  if (!provider?.inheritsParentContext || !provider.capabilities.toolFilter || !provider.capabilities.persona) {
@@ -392,6 +416,7 @@ function apply(ctx) {
392
416
 
393
417
  ${request.question}` }]
394
418
  });
419
+ if (run.localAgent) protection.own(run.localAgent);
395
420
  return {
396
421
  result: run.result,
397
422
  dispose: async () => {
@@ -406,6 +431,7 @@ ${request.question}` }]
406
431
  }, 9e4, {
407
432
  onError: (error) => ctx.logger.warn(error),
408
433
  onIdle: async () => {
434
+ stopWatch();
409
435
  await releaseGuard();
410
436
  }
411
437
  });
@@ -1,13 +1,19 @@
1
- interface AgentIdentity {
2
- session: {
3
- snapshotEvents(): readonly {
4
- type: string;
5
- data: unknown;
6
- }[];
7
- };
1
+ export interface SessionEventLike {
2
+ readonly type: string;
3
+ readonly data?: unknown;
4
+ }
5
+ export interface SessionIdentityHint {
6
+ snapshotEvents?(): readonly SessionEventLike[];
7
+ }
8
+ export interface AgentIdentity {
9
+ session?: SessionIdentityHint;
10
+ }
11
+ export interface AnswerOnlyGuard {
12
+ (execution: {
13
+ agent?: AgentIdentity;
14
+ }): string | undefined;
15
+ own(agent: object): void;
16
+ recognize(session: object, event: SessionEventLike): void;
8
17
  }
9
18
  /** 空白名单过滤继承工具;本保护额外拒绝 PTC 及子作用域自注册工具。 */
10
- export declare function createAnswerOnlyGuard(labels: ReadonlySet<string>): (execution: {
11
- agent?: AgentIdentity;
12
- }) => string | undefined;
13
- export {};
19
+ export declare function createAnswerOnlyGuard(labels: ReadonlySet<string>): AnswerOnlyGuard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-btw",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "DSH 一次性只读旁问气泡",
5
5
  "repository": {
6
6
  "type": "git",
@@ -63,39 +63,44 @@
63
63
  "license": "Apache-2.0",
64
64
  "peerDependencies": {
65
65
  "@deepseek-ai/cordis": "^4.0.2",
66
- "@deepseek-ai/dsh-commands": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2",
67
- "@deepseek-ai/dsh-subagent": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2",
68
- "@deepseek-ai/dsh-tools": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2",
66
+ "@deepseek-ai/dsh-commands": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
67
+ "@deepseek-ai/dsh-subagent": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
68
+ "@deepseek-ai/dsh-tools": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
69
69
  "react": "^18.3.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@deepseek-ai/cordis": "4.0.2",
73
- "@deepseek-ai/dsh-agent": "0.1.5-rc.2",
74
- "@deepseek-ai/dsh-agent-loop": "0.1.5-rc.2",
75
- "@deepseek-ai/dsh-api-gateway": "0.1.5-rc.2",
76
- "@deepseek-ai/dsh-api-session-controller": "0.1.5-rc.2",
77
- "@deepseek-ai/dsh-attachment": "0.1.5-rc.2",
78
- "@deepseek-ai/dsh-client-locale": "0.1.5-rc.2",
79
- "@deepseek-ai/dsh-client-ui-chat": "0.1.5-rc.2",
80
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.5-rc.2",
81
- "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.5-rc.2",
82
- "@deepseek-ai/dsh-client-ui-renderer": "0.1.5-rc.2",
83
- "@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.2",
84
- "@deepseek-ai/dsh-client-ui-theme": "0.1.5-rc.2",
85
- "@deepseek-ai/dsh-commands": "0.1.5-rc.2",
86
- "@deepseek-ai/dsh-llm": "0.1.5-rc.2",
87
- "@deepseek-ai/dsh-scope": "0.1.5-rc.2",
88
- "@deepseek-ai/dsh-session": "0.1.5-rc.2",
89
- "@deepseek-ai/dsh-session-persistence": "0.1.5-rc.2",
90
- "@deepseek-ai/dsh-session-projection": "0.1.5-rc.2",
91
- "@deepseek-ai/dsh-subagent": "0.1.5-rc.2",
92
- "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.5-rc.2",
93
- "@deepseek-ai/dsh-subagent-in-process-driver": "0.1.5-rc.2",
94
- "@deepseek-ai/dsh-system-prompt": "0.1.5-rc.2",
95
- "@deepseek-ai/dsh-tools": "0.1.5-rc.2",
96
- "@deepseek-ai/dsh-typert-protocol": "0.1.5-rc.2",
97
- "@deepseek-ai/dsh-typert-registry": "0.1.5-rc.2",
98
- "@deepseek-ai/dsh-util-time": "0.1.5-rc.2",
73
+ "@deepseek-ai/dsh-agent": "0.1.6-alpha.1",
74
+ "@deepseek-ai/dsh-agent-loop": "0.1.6-alpha.1",
75
+ "@deepseek-ai/dsh-api-gateway": "0.1.6-alpha.1",
76
+ "@deepseek-ai/dsh-api-session-controller": "0.1.6-alpha.1",
77
+ "@deepseek-ai/dsh-attachment": "0.1.6-alpha.1",
78
+ "@deepseek-ai/dsh-client-locale": "0.1.6-alpha.1",
79
+ "@deepseek-ai/dsh-client-ui-chat": "0.1.6-alpha.1",
80
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.6-alpha.1",
81
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.6-alpha.1",
82
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.6-alpha.1",
83
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.6-alpha.1",
84
+ "@deepseek-ai/dsh-client-ui-theme": "0.1.6-alpha.1",
85
+ "@deepseek-ai/dsh-commands": "0.1.6-alpha.1",
86
+ "@deepseek-ai/dsh-invariants": "0.1.6-alpha.1",
87
+ "@deepseek-ai/dsh-llm": "0.1.6-alpha.1",
88
+ "@deepseek-ai/dsh-ptc-runtime": "0.1.6-alpha.1",
89
+ "@deepseek-ai/dsh-sandbox": "0.1.6-alpha.1",
90
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.6-alpha.1",
91
+ "@deepseek-ai/dsh-scope": "0.1.6-alpha.1",
92
+ "@deepseek-ai/dsh-session": "0.1.6-alpha.1",
93
+ "@deepseek-ai/dsh-session-persistence": "0.1.6-alpha.1",
94
+ "@deepseek-ai/dsh-session-projection": "0.1.6-alpha.1",
95
+ "@deepseek-ai/dsh-subagent": "0.1.6-alpha.1",
96
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.6-alpha.1",
97
+ "@deepseek-ai/dsh-subagent-in-process-driver": "0.1.6-alpha.1",
98
+ "@deepseek-ai/dsh-system-prompt": "0.1.6-alpha.1",
99
+ "@deepseek-ai/dsh-tools": "0.1.6-alpha.1",
100
+ "@deepseek-ai/dsh-user-approval": "0.1.6-alpha.1",
101
+ "@deepseek-ai/dsh-typert-protocol": "0.1.6-alpha.1",
102
+ "@deepseek-ai/dsh-typert-registry": "0.1.6-alpha.1",
103
+ "@deepseek-ai/dsh-util-time": "0.1.6-alpha.1",
99
104
  "@types/node": "^22.0.0",
100
105
  "@types/react": "^18.3.1",
101
106
  "@types/react-dom": "^18.3.7",