dsh-plugin-subagent-bridge 0.17.0 → 0.18.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/README.md CHANGED
@@ -150,17 +150,15 @@ A worker that calls `ask_user_question` waits for a human. When the caller is an
150
150
  hand the decision back to the user and do not call ask_user_question.)
151
151
  ```
152
152
 
153
- Set your own wording with `assumptionPolicy`:
153
+ On by default (`assumeDefaults: false` disables it). It is skipped when the prompt already mentions `ask_user_question`.
154
+
155
+ Replace the wording with `assumptionPolicy` — Chinese, for instance:
154
156
 
155
157
  ```yaml
156
158
  config:
157
- assumptionPolicy: "If information is missing, pick the most reasonable default, finish the task, and state the assumption in one line. Do not ask the user and do not call ask_user_question."
159
+ assumptionPolicy: "如果缺少必要信息,直接采用最合理的默认做法做完,并在结果里用一行说明你的假设。"
158
160
  ```
159
161
 
160
- On by default (`assumeDefaults: false` disables it). It is skipped when the prompt already mentions `ask_user_question`.
161
-
162
- > The built-in default text is Chinese (`如果缺少必要信息……`), which every model in this host reads; the block above is that instruction in English. Set `assumptionPolicy` to send English verbatim.
163
-
164
162
  ### Questions (`pendingQuestion`)
165
163
 
166
164
  If a worker does ask, `dsh_wait` reports it:
@@ -224,7 +222,7 @@ Returns `{ ok, text, sessionId, durationMs }`. Runs `claude -p --output-format j
224
222
  | `maxResultChars` | `20000` | Cap on a single result payload (the head is kept) |
225
223
  | `taskTimeoutSeconds` | `300` | `dsh_task` wait cap (client may override, max 240) |
226
224
  | `assumeDefaults` | `true` | Append the decide-and-continue instruction |
227
- | `assumptionPolicy` | *(empty)* | Replacement text for the instruction; empty uses the built-in Chinese default |
225
+ | `assumptionPolicy` | *(empty)* | Replacement text for the instruction; empty uses the built-in English default |
228
226
  | `workersFile` | `~/.dsh/bridge/workers.json` | Worker registry (`0600`) |
229
227
  | `maxHops` | `1` | Delegation depth limit |
230
228
  | `dispatchPerMinute` | `10` | Dispatches allowed per window |
package/README.zh-CN.md CHANGED
@@ -145,20 +145,22 @@ dsh_followup({ worker: "w1", message: "接下来只改 src 下的文件", mode:
145
145
  调用 `ask_user_question` 的 worker 会等人回答。调用方是另一个 agent 时,没有人在这。因此桥给每个派发的任务追加一条常驻指令:
146
146
 
147
147
  ```
148
- (如果缺少必要信息或需要在多个方案里选择,直接采用最合理的默认做法继续做完,
149
- 不要把选择权抛回给用户、不要调用 ask_user_question 等回答;
150
- 在结果里用一行说明你假设了什么。)
148
+ (If information is missing, or a choice between options is required, pick the most
149
+ reasonable default, finish the task, and state the assumption in one line. Do not
150
+ hand the decision back to the user and do not call ask_user_question.)
151
151
  ```
152
152
 
153
153
  默认开启(`assumeDefaults: false` 可关闭)。prompt 里本来就提到 `ask_user_question` 时不追加。
154
154
 
155
- 想换成自己的措辞——比如英文——用 `assumptionPolicy`:
155
+ 想换成中文——或者任何自己的措辞——用 `assumptionPolicy`:
156
156
 
157
157
  ```yaml
158
158
  config:
159
- assumptionPolicy: "If information is missing, pick the most reasonable default, finish the task, and state the assumption in one line. Do not ask the user or call ask_user_question."
159
+ assumptionPolicy: "如果缺少必要信息,直接采用最合理的默认做法做完,并在结果里用一行说明你的假设。"
160
160
  ```
161
161
 
162
+ > 指令正文是中文时,桥用全角括号包裹;英文等其他语言用半角括号。
163
+
162
164
  ### 问题上报
163
165
 
164
166
  worker 真的提问时,`dsh_wait` 会把问题带出来:
@@ -222,7 +224,7 @@ worker 真的提问时,`dsh_wait` 会把问题带出来:
222
224
  | `maxResultChars` | `20000` | 单次结果载荷上限(保留开头) |
223
225
  | `taskTimeoutSeconds` | `300` | `dsh_task` 等待上限(客户端可覆盖,最大 240) |
224
226
  | `assumeDefaults` | `true` | 追加「自行决策」指令 |
225
- | `assumptionPolicy` | 空 | 替换指令正文;空表示用内置中文默认 |
227
+ | `assumptionPolicy` | 空 | 替换指令正文;空表示用内置英文默认 |
226
228
  | `workersFile` | `~/.dsh/bridge/workers.json` | worker 注册表(`0600`) |
227
229
  | `maxHops` | `1` | 委派深度上限 |
228
230
  | `dispatchPerMinute` | `10` | 每个窗口允许的派发次数 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-subagent-bridge",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "Subagent bridge: lets Codex delegate a task to DeepSeek Harness the way it would spawn a subagent (one call, waits for the answer), plus a codex_dispatch tool for the reverse direction.",
6
6
  "keywords": [
package/src/constants.js CHANGED
@@ -51,7 +51,7 @@ export const CODEX_CANDIDATES = [
51
51
  ]
52
52
 
53
53
  export const ASSUMPTION_POLICY =
54
- '如果缺少必要信息或需要在多个方案里选择,直接采用最合理的默认做法继续做完,不要把选择权抛回给用户、不要调用 ask_user_question 等回答;在结果里用一行说明你假设了什么。'
54
+ 'If information is missing or a choice between options is required, pick the most reasonable default, finish the task, and state the assumption in one line. Do not hand the decision back to the user and do not call ask_user_question.'
55
55
 
56
56
  /**
57
57
  * Attach the standing instruction when the deployment wants it.
package/src/policy.js CHANGED
@@ -5,7 +5,9 @@ export function withAssumptionPolicy(settings, message) {
5
5
  if (message.includes('ask_user_question')) return message
6
6
  const custom = typeof settings.assumptionPolicy === 'string' ? settings.assumptionPolicy.trim() : ''
7
7
  const policy = custom === '' ? ASSUMPTION_POLICY : custom
8
- return `${message}\n\n(${policy})`
8
+ /* Full-width brackets only when the text itself is Chinese. */
9
+ const brackets = /[\u3400-\u9fff]/.test(policy) ? ['(', ')'] : ['(', ')']
10
+ return `${message}\n\n${brackets[0]}${policy}${brackets[1]}`
9
11
  }
10
12
 
11
13
  /**