@michengai/dsh-btw 0.1.21 → 0.1.22

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.22] - 2026-10-15
6
+
7
+ - Support DSH `0.2.1-alpha.3` while retaining all existing supported versions; pin development `@deepseek-ai/dsh*` dependencies to host `0.2.1-alpha.3` and Cordis to `4.0.5-alpha.2`.
8
+ - Drop removed host package `@deepseek-ai/dsh-invariants` from development dependencies (gone since alpha.1).
9
+ - Adapt the subagent breaking change: `ctx.subagents.start` and start-time `persona` / `toolFilter` are gone; use `startActivation` with `delivery: 'caller'`, and restore the side-ask persona plus empty tool allow-list on the child's `agent/created` via a scoped persona section and `tools.restrict`.
10
+ - Fix the host regression that still called `tools.presentAs('both')` after alpha.2 removed that mode; the guard test covers `native` (scoped tools) and `ptc` (`run_code`) separately.
11
+
5
12
  ## [0.1.21] - 2026-10-14
6
13
 
7
14
  - Use the raised layer token (`--dsw-alias-bg-layer-2`) for the selection question dialog and answer bubbles, fixing see-through text under wallpaper and transparent-canvas themes.
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## 未发布
4
4
 
5
+ ## [0.1.22] - 2026-10-15
6
+
7
+ - 支持 DSH `0.2.1-alpha.3`,继续兼容既有已支持版本;开发依赖中的 `@deepseek-ai/dsh*` 对齐宿主 `0.2.1-alpha.3`,Cordis 对齐 `4.0.5-alpha.2`。
8
+ - 移除宿主已删除的开发依赖 `@deepseek-ai/dsh-invariants`(自 alpha.1 起不再提供)。
9
+ - 适配子 Agent 破坏性变更:`ctx.subagents.start` / 启动期 `persona` / `toolFilter` 已移除,改为 `startActivation`(`delivery: 'caller'`);旁问角色与空白名单在子 Agent `agent/created` 时以 scoped persona 与 `tools.restrict` 恢复。
10
+ - 修复回归测试仍调用 `tools.presentAs('both')` 的问题(该模式已在 alpha.2 移除);防护测试分别覆盖 `native`(子作用域工具)与 `ptc`(`run_code`)。
11
+
5
12
  ## [0.1.21] - 2026-10-14
6
13
 
7
14
  - 旁问浮层与回答气泡背景改用抬升层令牌(`--dsw-alias-bg-layer-2`),修复在壁纸类或画布透明主题下文字透明无法阅读的问题。
package/README.md CHANGED
@@ -68,7 +68,7 @@ For a desktop workbench, download [DSH Codex Desktop](https://github.com/Micheng
68
68
  ## Prerequisites
69
69
 
70
70
  - An installed copy of DeepSeek Harness.
71
- - Host peers accept exactly `0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2`.
71
+ - Host peers accept exactly `0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3`.
72
72
  - Node.js 22+ and `dsh` available in your terminal.
73
73
 
74
74
  ## Installation
package/README.zh-CN.md CHANGED
@@ -68,7 +68,7 @@
68
68
  ## 前置条件
69
69
 
70
70
  - 已安装 DeepSeek Harness。
71
- - 宿主 peer 依赖精确声明为 `0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2`。
71
+ - 宿主 peer 依赖精确声明为 `0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3`。
72
72
  - Node.js 22+,可在终端执行 `dsh`。
73
73
 
74
74
  ## 安装
package/lib/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ // src/index.ts
2
+ import { SessionId } from "@deepseek-ai/dsh-session";
3
+ import { PERSONA_PREFIX_SECTION } from "@deepseek-ai/dsh-system-prompt";
4
+
1
5
  // src/limits.ts
2
6
  var MAX_QUESTION_LENGTH = 8e3;
3
7
  var MAX_REFERENCE_LENGTH = 8e3;
@@ -440,30 +444,54 @@ function apply(ctx) {
440
444
  const stopWatch = ctx.on("session/event", (session, event) => protection.recognize(session, event));
441
445
  const jobs = new SideJobs(async (request) => {
442
446
  const provider = ctx.subagents.getProvider("fork");
443
- if (!provider?.inheritsParentContext || !provider.capabilities.toolFilter || !provider.capabilities.persona) {
447
+ if (!provider?.inheritsParentContext) {
444
448
  throw new Error(translate(request.locale)("error.provider"));
445
449
  }
446
450
  const label = `michengai-btw:${globalThis.crypto.randomUUID()}`;
451
+ const childId = SessionId(globalThis.crypto.randomUUID());
447
452
  labels.add(label);
453
+ let childAgent;
448
454
  try {
449
- const run = await ctx.subagents.start("fork", {
450
- parent: request.context,
451
- label,
452
- signal: request.signal,
453
- toolFilter: request.toolFilter,
454
- persona: PERSONA,
455
- prompt: [{ type: "text", text: `\u4EE5\u4E0B\u662F\u552F\u4E00\u9700\u8981\u56DE\u7B54\u7684\u65B0\u95EE\u9898\uFF1B\u5148\u524D\u5185\u5BB9\u4EC5\u4F9B\u53C2\u8003\u3002
455
+ const stopCreated = ctx.on("agent/created", ({ agent }) => {
456
+ if (agent.id !== childId) return void 0;
457
+ childAgent = agent;
458
+ arm(agent);
459
+ const scoped = agent;
460
+ if (scoped.ctx?.systemPrompt) {
461
+ scoped.ctx.systemPrompt.section({
462
+ name: PERSONA_PREFIX_SECTION,
463
+ order: scoped.ctx.systemPrompt.getSectionOrder("DEPLOYMENT_PERSONA_PREFIX"),
464
+ text: PERSONA
465
+ });
466
+ }
467
+ if (scoped.ctx?.tools) scoped.ctx.tools.restrict(request.toolFilter);
468
+ return void 0;
469
+ });
470
+ let activation;
471
+ try {
472
+ activation = await ctx.subagents.startActivation({
473
+ provider: "fork",
474
+ label,
475
+ childId,
476
+ request: {
477
+ parent: request.context,
478
+ prompt: [{ type: "text", text: `\u4EE5\u4E0B\u662F\u552F\u4E00\u9700\u8981\u56DE\u7B54\u7684\u65B0\u95EE\u9898\uFF1B\u5148\u524D\u5185\u5BB9\u4EC5\u4F9B\u53C2\u8003\u3002
456
479
 
457
480
  ${request.question}` }]
458
- });
459
- if (run.localAgent) arm(run.localAgent);
481
+ },
482
+ signal: request.signal,
483
+ delivery: "caller"
484
+ });
485
+ } finally {
486
+ stopCreated();
487
+ }
460
488
  return {
461
- result: run.result,
489
+ result: activation.result,
462
490
  dispose: async () => {
463
491
  try {
464
- await run.dispose();
492
+ await activation.dispose();
465
493
  } finally {
466
- await releaseChild(run.localAgent);
494
+ await releaseChild(childAgent);
467
495
  labels.delete(label);
468
496
  }
469
497
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-btw",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "DSH 一次性只读旁问插件:基于当前上下文回答,独立气泡,不执行工具 · One-shot read-only side-ask plugin: answers from current context in an independent bubble, no tool execution",
5
5
  "repository": {
6
6
  "type": "git",
@@ -64,45 +64,45 @@
64
64
  "license": "Apache-2.0",
65
65
  "peerDependencies": {
66
66
  "@deepseek-ai/cordis": "^4.0.2",
67
- "@deepseek-ai/dsh-commands": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2",
68
- "@deepseek-ai/dsh-subagent": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2",
69
- "@deepseek-ai/dsh-tools": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2",
70
- "react": "^18.3.1"
67
+ "@deepseek-ai/dsh-commands": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3",
68
+ "@deepseek-ai/dsh-subagent": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3",
69
+ "@deepseek-ai/dsh-tools": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3",
70
+ "react": "^18.3.1",
71
+ "@deepseek-ai/dsh-session": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3",
72
+ "@deepseek-ai/dsh-system-prompt": "0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-alpha.3"
71
73
  },
72
74
  "devDependencies": {
73
- "@deepseek-ai/cordis": "4.0.4",
74
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
75
- "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
76
- "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
77
- "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
78
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
79
- "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
80
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
81
- "@deepseek-ai/dsh-client-ui-chat": "0.2.0-rc.2",
82
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.2",
83
- "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.0-rc.2",
84
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
85
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
86
- "@deepseek-ai/dsh-client-ui-theme": "0.2.0-rc.2",
87
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
88
- "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
89
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
90
- "@deepseek-ai/dsh-ptc-runtime": "0.2.0-rc.2",
91
- "@deepseek-ai/dsh-sandbox": "0.2.0-rc.2",
92
- "@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.2",
93
- "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
94
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
95
- "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
96
- "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
97
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
98
- "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.0-rc.2",
99
- "@deepseek-ai/dsh-subagent-in-process-driver": "0.2.0-rc.2",
100
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
101
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
102
- "@deepseek-ai/dsh-user-approval": "0.2.0-rc.2",
103
- "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
104
- "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
105
- "@deepseek-ai/dsh-util-time": "0.2.0-rc.2",
75
+ "@deepseek-ai/cordis": "4.0.5-alpha.2",
76
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
77
+ "@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.3",
78
+ "@deepseek-ai/dsh-api-gateway": "0.2.1-alpha.3",
79
+ "@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.3",
80
+ "@deepseek-ai/dsh-attachment": "0.2.1-alpha.3",
81
+ "@deepseek-ai/dsh-client-connection": "0.2.1-alpha.3",
82
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.3",
83
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.3",
84
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.3",
85
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.1-alpha.3",
86
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.3",
87
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.3",
88
+ "@deepseek-ai/dsh-client-ui-theme": "0.2.1-alpha.3",
89
+ "@deepseek-ai/dsh-commands": "0.2.1-alpha.3",
90
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
91
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.1-alpha.3",
92
+ "@deepseek-ai/dsh-sandbox": "0.2.1-alpha.3",
93
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.3",
94
+ "@deepseek-ai/dsh-scope": "0.2.1-alpha.3",
95
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
96
+ "@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.3",
97
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.3",
98
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
99
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.1-alpha.3",
100
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.3",
101
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
102
+ "@deepseek-ai/dsh-user-approval": "0.2.1-alpha.3",
103
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.3",
104
+ "@deepseek-ai/dsh-typert-registry": "0.2.1-alpha.3",
105
+ "@deepseek-ai/dsh-util-time": "0.2.1-alpha.3",
106
106
  "@types/node": "^22.0.0",
107
107
  "@types/react": "^18.3.1",
108
108
  "@types/react-dom": "^18.3.7",