@songtonyli/dsh-cli 0.1.50 → 0.1.52
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 +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +207 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +28 -10
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +33 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +33 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +706 -74
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ workspace and no build step. Native packages that ship one build per platform
|
|
|
26
26
|
ripgrep, the PTY backend's addons, sharp, koffi, and the Landlock launcher — are
|
|
27
27
|
ordinary optional dependencies, so npm resolves the right one for your machine.
|
|
28
28
|
|
|
29
|
-
Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.
|
|
29
|
+
Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.52; `dsh --version`
|
|
30
30
|
also reports the harness build the package was assembled from.
|
|
31
31
|
|
|
32
32
|
## License
|
package/bin/dsh.mjs
CHANGED
|
@@ -18,7 +18,7 @@ const argv = process.argv.slice(2)
|
|
|
18
18
|
// version this package publishes. Reporting only one of the two would make an
|
|
19
19
|
// ordinary `npm install @songtonyli/dsh-cli@x` look like it installed something else.
|
|
20
20
|
if (argv.length === 1 && (argv[0] === '--version' || argv[0] === '-V')) {
|
|
21
|
-
console.log('@songtonyli/dsh-cli 0.1.
|
|
21
|
+
console.log('@songtonyli/dsh-cli 0.1.52 (deepseek-harness 0.1.7-rc.2)')
|
|
22
22
|
process.exit(0)
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"micromark-extension-gfm": "^3.0.0",
|
|
48
48
|
"micromark-util-sanitize-uri": "^2.0.1",
|
|
49
49
|
"simple-icons": "16.31.0",
|
|
50
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2",
|
|
51
50
|
"@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2",
|
|
52
52
|
"@deepseek-ai/dsh-util-code-language": "0.1.7-rc.2",
|
|
53
53
|
"@deepseek-ai/cordis": "~4.0.4"
|
|
54
54
|
},
|
|
@@ -167,7 +167,7 @@ window.__ModuleLoader__.load({
|
|
|
167
167
|
const SCROLLBAR_LINGER_MS = 2e3;
|
|
168
168
|
/** Format complete-build metadata for the local brand badge. */
|
|
169
169
|
function localBuildVersion() {
|
|
170
|
-
return `0.1.7-rc.2-
|
|
170
|
+
return `0.1.7-rc.2-95cfb10` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
|
|
171
171
|
}
|
|
172
172
|
/** Each panel row subscribes only to its own selection state. */
|
|
173
173
|
function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/react": "~18.3.1",
|
|
27
|
-
"@deepseek-ai/
|
|
28
|
-
"@deepseek-ai/
|
|
27
|
+
"@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
|
|
28
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"lib/index.js",
|
|
@@ -96,6 +96,8 @@ A provider pi-ai ships a login for can be signed into through the harness author
|
|
|
96
96
|
|
|
97
97
|
### Resolve the model catalog
|
|
98
98
|
|
|
99
|
+
Until an installed pi-ai release ships a model id, `src/catalog-supplement-data.ts` merges that entry into catalog discovery and default routes; upstream entries with the same id take precedence after upgrade.
|
|
100
|
+
|
|
99
101
|
A profile's `models` list replaces the route's installed catalog rather than extending it; each entry defaults its unset fields from the installed model of the same id, so narrowing a route to two models, correcting one capacity, or adding a model newer than the installed catalog are one-line edits. `modelOverrides` reshapes individual installed-catalog models without that cost — correct one model, keep the other thirty-seven — and is refused when set beside a `models` list, on a hand-declared route, or naming a model the catalog does not describe, because a silently unchanged model would be a typo someone hunts for later.
|
|
100
102
|
|
|
101
103
|
### Run with reasoning and wire compatibility
|
|
@@ -96,6 +96,8 @@ pi-ai 提供登录的提供方可以通过 harness 授权 seam 登录:流程
|
|
|
96
96
|
|
|
97
97
|
### 解析模型目录
|
|
98
98
|
|
|
99
|
+
在已安装的 pi-ai 发布包含某个模型 id 之前,`src/catalog-supplement-data.ts` 会把该条目合并进 catalog 发现与默认路由;升级后上游同名条目优先。
|
|
100
|
+
|
|
99
101
|
profile 的 `models` 列表会替换而非扩展路由的已安装目录;每个条目从同 id 已安装模型取未设置字段的默认值,因此把路由收窄到两个模型、修正一个容量或添加比已安装目录更新的模型都是一行编辑。`modelOverrides` 无需该代价即可重塑个别已安装目录模型——修正一个模型,保留其余三十七个——当它与 `models` 列表并存、位于手工声明路由上、或点名目录未描述的模型时会被拒绝,因为静默不变的模型会成为别人日后寻找的拼写错误。
|
|
100
102
|
|
|
101
103
|
### 带推理(reasoning)与协议兼容运行
|
|
@@ -251,6 +251,210 @@ function toPiAssistant(message, onDegrade) {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
+
//#region lib/types/catalog-supplement.js
|
|
255
|
+
/**
|
|
256
|
+
* Models the installed pi-ai catalog has not shipped yet.
|
|
257
|
+
*
|
|
258
|
+
* Entries merge into {@link catalogModels} only when the upstream catalog
|
|
259
|
+
* lacks the same id, so a pi-ai upgrade that adds the model drops the
|
|
260
|
+
* supplement automatically.
|
|
261
|
+
*
|
|
262
|
+
* @module dsh-llm-pi-ai/catalog-supplement
|
|
263
|
+
*/
|
|
264
|
+
/** One provider route's supplemental models, keyed by model id. */
|
|
265
|
+
const SUPPLEMENT = {
|
|
266
|
+
"openai-codex": {
|
|
267
|
+
"gpt-6-luna": {
|
|
268
|
+
"id": "gpt-6-luna",
|
|
269
|
+
"name": "GPT-6 Luna",
|
|
270
|
+
"api": "openai-codex-responses",
|
|
271
|
+
"provider": "openai-codex",
|
|
272
|
+
"baseUrl": "https://chatgpt.com/backend-api",
|
|
273
|
+
"reasoning": true,
|
|
274
|
+
"input": ["text", "image"],
|
|
275
|
+
"cost": {
|
|
276
|
+
"input": .1,
|
|
277
|
+
"output": .5,
|
|
278
|
+
"cacheRead": .01,
|
|
279
|
+
"cacheWrite": .125,
|
|
280
|
+
"tiers": [{
|
|
281
|
+
"inputTokensAbove": 272e3,
|
|
282
|
+
"input": .2,
|
|
283
|
+
"output": .75,
|
|
284
|
+
"cacheRead": .02,
|
|
285
|
+
"cacheWrite": .25
|
|
286
|
+
}]
|
|
287
|
+
},
|
|
288
|
+
"contextWindow": 105e4,
|
|
289
|
+
"maxTokens": 128e3,
|
|
290
|
+
"thinkingLevelMap": {
|
|
291
|
+
"xhigh": "xhigh",
|
|
292
|
+
"max": "max",
|
|
293
|
+
"minimal": "low"
|
|
294
|
+
},
|
|
295
|
+
"compat": {
|
|
296
|
+
"supportsOpenAIGrammarTools": true,
|
|
297
|
+
"supportsAdditionalTools": true,
|
|
298
|
+
"supportsToolSearch": true
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"gpt-6-sol": {
|
|
302
|
+
"id": "gpt-6-sol",
|
|
303
|
+
"name": "GPT-6 Sol",
|
|
304
|
+
"api": "openai-codex-responses",
|
|
305
|
+
"provider": "openai-codex",
|
|
306
|
+
"baseUrl": "https://chatgpt.com/backend-api",
|
|
307
|
+
"reasoning": true,
|
|
308
|
+
"input": ["text", "image"],
|
|
309
|
+
"cost": {
|
|
310
|
+
"input": 2,
|
|
311
|
+
"output": 10,
|
|
312
|
+
"cacheRead": .2,
|
|
313
|
+
"cacheWrite": 2.5,
|
|
314
|
+
"tiers": [{
|
|
315
|
+
"inputTokensAbove": 272e3,
|
|
316
|
+
"input": 4,
|
|
317
|
+
"output": 15,
|
|
318
|
+
"cacheRead": .4,
|
|
319
|
+
"cacheWrite": 5
|
|
320
|
+
}]
|
|
321
|
+
},
|
|
322
|
+
"contextWindow": 105e4,
|
|
323
|
+
"maxTokens": 128e3,
|
|
324
|
+
"thinkingLevelMap": {
|
|
325
|
+
"xhigh": "xhigh",
|
|
326
|
+
"max": "max",
|
|
327
|
+
"minimal": "low"
|
|
328
|
+
},
|
|
329
|
+
"compat": {
|
|
330
|
+
"supportsOpenAIGrammarTools": true,
|
|
331
|
+
"supportsAdditionalTools": true,
|
|
332
|
+
"supportsToolSearch": true
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"openai": {
|
|
337
|
+
"gpt-6-luna": {
|
|
338
|
+
"id": "gpt-6-luna",
|
|
339
|
+
"name": "GPT-6 Luna",
|
|
340
|
+
"api": "openai-responses",
|
|
341
|
+
"provider": "openai",
|
|
342
|
+
"baseUrl": "https://api.openai.com/v1",
|
|
343
|
+
"reasoning": true,
|
|
344
|
+
"input": ["text", "image"],
|
|
345
|
+
"cost": {
|
|
346
|
+
"input": .1,
|
|
347
|
+
"output": .5,
|
|
348
|
+
"cacheRead": .01,
|
|
349
|
+
"cacheWrite": .125,
|
|
350
|
+
"tiers": [{
|
|
351
|
+
"inputTokensAbove": 272e3,
|
|
352
|
+
"input": .2,
|
|
353
|
+
"output": .75,
|
|
354
|
+
"cacheRead": .02,
|
|
355
|
+
"cacheWrite": .25
|
|
356
|
+
}]
|
|
357
|
+
},
|
|
358
|
+
"contextWindow": 105e4,
|
|
359
|
+
"maxTokens": 128e3,
|
|
360
|
+
"thinkingLevelMap": {
|
|
361
|
+
"off": null,
|
|
362
|
+
"minimal": null,
|
|
363
|
+
"low": "low",
|
|
364
|
+
"medium": "medium",
|
|
365
|
+
"high": "high",
|
|
366
|
+
"xhigh": "xhigh",
|
|
367
|
+
"max": "max"
|
|
368
|
+
},
|
|
369
|
+
"compat": {
|
|
370
|
+
"supportsStrictMode": true,
|
|
371
|
+
"supportsOpenAIGrammarTools": true,
|
|
372
|
+
"supportsAdditionalTools": true,
|
|
373
|
+
"supportsToolSearch": true,
|
|
374
|
+
"supportsExplicitPromptCacheMode": true
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"gpt-6-sol": {
|
|
378
|
+
"id": "gpt-6-sol",
|
|
379
|
+
"name": "GPT-6 Sol",
|
|
380
|
+
"api": "openai-responses",
|
|
381
|
+
"provider": "openai",
|
|
382
|
+
"baseUrl": "https://api.openai.com/v1",
|
|
383
|
+
"reasoning": true,
|
|
384
|
+
"input": ["text", "image"],
|
|
385
|
+
"cost": {
|
|
386
|
+
"input": 2,
|
|
387
|
+
"output": 10,
|
|
388
|
+
"cacheRead": .2,
|
|
389
|
+
"cacheWrite": 2.5,
|
|
390
|
+
"tiers": [{
|
|
391
|
+
"inputTokensAbove": 272e3,
|
|
392
|
+
"input": 4,
|
|
393
|
+
"output": 15,
|
|
394
|
+
"cacheRead": .4,
|
|
395
|
+
"cacheWrite": 5
|
|
396
|
+
}]
|
|
397
|
+
},
|
|
398
|
+
"contextWindow": 105e4,
|
|
399
|
+
"maxTokens": 128e3,
|
|
400
|
+
"thinkingLevelMap": {
|
|
401
|
+
"off": null,
|
|
402
|
+
"minimal": null,
|
|
403
|
+
"low": "low",
|
|
404
|
+
"medium": "medium",
|
|
405
|
+
"high": "high",
|
|
406
|
+
"xhigh": "xhigh",
|
|
407
|
+
"max": "max"
|
|
408
|
+
},
|
|
409
|
+
"compat": {
|
|
410
|
+
"supportsStrictMode": true,
|
|
411
|
+
"supportsOpenAIGrammarTools": true,
|
|
412
|
+
"supportsAdditionalTools": true,
|
|
413
|
+
"supportsToolSearch": true,
|
|
414
|
+
"supportsExplicitPromptCacheMode": true
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"anthropic": { "claude-opus-5-5": {
|
|
419
|
+
"id": "claude-opus-5-5",
|
|
420
|
+
"name": "Claude Opus 5.5",
|
|
421
|
+
"api": "anthropic-messages",
|
|
422
|
+
"provider": "anthropic",
|
|
423
|
+
"baseUrl": "https://api.anthropic.com",
|
|
424
|
+
"reasoning": true,
|
|
425
|
+
"input": ["text", "image"],
|
|
426
|
+
"cost": {
|
|
427
|
+
"input": 4,
|
|
428
|
+
"output": 20,
|
|
429
|
+
"cacheRead": .2,
|
|
430
|
+
"cacheWrite": 5
|
|
431
|
+
},
|
|
432
|
+
"contextWindow": 1e6,
|
|
433
|
+
"maxTokens": 128e3,
|
|
434
|
+
"compat": {
|
|
435
|
+
"supportsMidConvoEffort": true,
|
|
436
|
+
"forceAdaptiveThinking": true,
|
|
437
|
+
"supportsTemperature": false,
|
|
438
|
+
"supportsStrictTools": true
|
|
439
|
+
},
|
|
440
|
+
"thinkingLevelMap": {
|
|
441
|
+
"off": null,
|
|
442
|
+
"xhigh": "xhigh",
|
|
443
|
+
"max": "max"
|
|
444
|
+
}
|
|
445
|
+
} }
|
|
446
|
+
};
|
|
447
|
+
/**
|
|
448
|
+
* Supplemental catalog models for one pi-ai provider route.
|
|
449
|
+
* @param provider - provider route key.
|
|
450
|
+
* @returns models to merge when the installed catalog omits them.
|
|
451
|
+
*/
|
|
452
|
+
function supplementalCatalogModels(provider) {
|
|
453
|
+
const route = SUPPLEMENT[provider];
|
|
454
|
+
if (route === void 0) return [];
|
|
455
|
+
return Object.values(route);
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
254
458
|
//#region lib/types/catalog.js
|
|
255
459
|
/**
|
|
256
460
|
* Materialization of one provider route's model catalog. The installed pi-ai
|
|
@@ -370,7 +574,9 @@ function catalogProviderIds() {
|
|
|
370
574
|
function catalogModels(provider) {
|
|
371
575
|
if (!catalogProviders().has(provider)) return /* @__PURE__ */ new Map();
|
|
372
576
|
const models = getBuiltinModels(provider);
|
|
373
|
-
|
|
577
|
+
const map = new Map(models.map((model) => [model.id, model]));
|
|
578
|
+
for (const model of supplementalCatalogModels(provider)) if (!map.has(model.id)) map.set(model.id, model);
|
|
579
|
+
return map;
|
|
374
580
|
}
|
|
375
581
|
/**
|
|
376
582
|
* Disposition of every `OpenAICompletionsCompat` field. The `Record` key type
|
|
@@ -21,11 +21,14 @@
|
|
|
21
21
|
en: be0e9f07314547a5
|
|
22
22
|
zh: e55e8e668b3f703f
|
|
23
23
|
/deepseek-ai-dsh-tui-app/use-this-package/the-screen:
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
24
|
+
en: 16087917fa08726c
|
|
25
|
+
zh: e45dec9a0fa09642
|
|
26
26
|
/deepseek-ai-dsh-tui-app/use-this-package/keys-and-commands:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
27
|
+
en: 2e7932b9fb296b74
|
|
28
|
+
zh: df3a5d5ab3e21f04
|
|
29
|
+
/deepseek-ai-dsh-tui-app/use-this-package/background-tool-calls:
|
|
30
|
+
en: 322ae3c6d76383ec
|
|
31
|
+
zh: 8c38eee4b57ed8dd
|
|
29
32
|
/deepseek-ai-dsh-tui-app/use-this-package/subscription-sign-in:
|
|
30
33
|
en: 7c1b0e685a3a9415
|
|
31
34
|
zh: 49f3bdc3e99d6259
|
|
@@ -36,8 +39,8 @@
|
|
|
36
39
|
en: 23ba736da2686f52
|
|
37
40
|
zh: d30ce253dd934750
|
|
38
41
|
/deepseek-ai-dsh-tui-app/use-this-package/configuration:
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
42
|
+
en: 6f3968bd43059ee2
|
|
43
|
+
zh: 522aebc38fe8fc18
|
|
41
44
|
/deepseek-ai-dsh-tui-app/understand-the-implementation:
|
|
42
45
|
en: f124d406565fef39
|
|
43
46
|
zh: 90344b5eec319cad
|
|
@@ -51,8 +54,8 @@
|
|
|
51
54
|
en: 142f04bf29e981dd
|
|
52
55
|
zh: a1689297b06c9ca6
|
|
53
56
|
/deepseek-ai-dsh-tui-app/understand-the-implementation/source-map:
|
|
54
|
-
en:
|
|
55
|
-
zh:
|
|
57
|
+
en: d4b312aec290d553
|
|
58
|
+
zh: 99e69009c981cc7d
|
|
56
59
|
/deepseek-ai-dsh-tui-app/understand-the-implementation/invariant-ownership:
|
|
57
60
|
en: 0ddf6de8928026d5
|
|
58
61
|
zh: 24feedcbb9e9d676
|
|
@@ -77,6 +80,21 @@
|
|
|
77
80
|
/deepseek-ai-dsh-tui-app/model-experience/user-typed-shell-command/kv-cache-effect:
|
|
78
81
|
en: 5b83189b640899dd
|
|
79
82
|
zh: 232c1ef2f192bd4c
|
|
83
|
+
/deepseek-ai-dsh-tui-app/model-experience/background-tool-call:
|
|
84
|
+
en: 325019794223c5fa
|
|
85
|
+
zh: 7ea0055b28d10846
|
|
86
|
+
/deepseek-ai-dsh-tui-app/model-experience/background-tool-call/what-the-model-sees:
|
|
87
|
+
en: 014cef57bd1e994e
|
|
88
|
+
zh: 1b5df1ceaa4830ed
|
|
89
|
+
/deepseek-ai-dsh-tui-app/model-experience/background-tool-call/what-the-model-sees/moved-call-result:
|
|
90
|
+
en: 434507f4855ece52
|
|
91
|
+
zh: 3df40dcea19a8b52
|
|
92
|
+
/deepseek-ai-dsh-tui-app/model-experience/background-tool-call/token-effect:
|
|
93
|
+
en: fdec4eeeee7c6335
|
|
94
|
+
zh: a900f1ef88e85179
|
|
95
|
+
/deepseek-ai-dsh-tui-app/model-experience/background-tool-call/kv-cache-effect:
|
|
96
|
+
en: 8a5bab15e1637c6a
|
|
97
|
+
zh: e1075bfdb6952fdc
|
|
80
98
|
/deepseek-ai-dsh-tui-app/model-experience/side-agent:
|
|
81
99
|
en: 1c67a481715ccab3
|
|
82
100
|
zh: cb1ee722aa3b9201
|
|
@@ -90,8 +108,8 @@
|
|
|
90
108
|
en: 1dadc4a2f1560eaa
|
|
91
109
|
zh: dc4697c269bc16b9
|
|
92
110
|
/deepseek-ai-dsh-tui-app/known-limitations-and-deferred-work:
|
|
93
|
-
en:
|
|
94
|
-
zh:
|
|
111
|
+
en: 768f55ebb0a75616
|
|
112
|
+
zh: c512d13f4b3763e8
|
|
95
113
|
/deepseek-ai-dsh-tui-app/known-limitations-and-deferred-work/dev-note:
|
|
96
114
|
en: 5629c6159cec997f
|
|
97
115
|
zh: 17f2d7e1f96da7f1
|
|
@@ -60,7 +60,7 @@ The subagent panel is drawn while a subagent session under the bound one is resi
|
|
|
60
60
|
|
|
61
61
|
### Keys and commands
|
|
62
62
|
|
|
63
|
-
The conversation, input, subagent panel, and status bar form the vertical arrow-key walk: `Down` at the newest section, `Up` on the subagent panel's first row, and `Up` on the status bar with no subagent panel drawn all land at the caret. The follow-ups list sits above the input; `Shift+Up` enters it while it is drawn, and it joins the `Tab` walk. The activity board sits between follow-ups and the input and is not a focus region. While a region other than the editor has the keyboard, `Tab` and `Shift+Tab` walk the regions that are drawn, wrapping at both ends; in the editor, `Tab` takes the offered completion and `Shift+Tab` opens the reasoning-effort picker. A printable key pressed in any of them returns to the input and types there, so a sentence started while reading lands where it was aimed; `Space` in the conversation is the one exception, and folds the marked tool card or context block. `Ctrl+G`, `Ctrl+O`, `Ctrl+T`, `Ctrl+P`, and `Ctrl+L` mean the same thing in every one of those regions, and `Ctrl+C` and `Ctrl+D` return the keyboard to the input before they act. A prompt and the reader own their whole key stream instead, and answer `Ctrl+C` by giving the keyboard back.
|
|
63
|
+
The conversation, input, subagent panel, and status bar form the vertical arrow-key walk: `Down` at the newest section, `Up` on the subagent panel's first row, and `Up` on the status bar with no subagent panel drawn all land at the caret. The follow-ups list sits above the input; `Shift+Up` enters it while it is drawn, and it joins the `Tab` walk. The activity board sits between follow-ups and the input and is not a focus region. While a region other than the editor has the keyboard, `Tab` and `Shift+Tab` walk the regions that are drawn, wrapping at both ends; in the editor, `Tab` takes the offered completion and `Shift+Tab` opens the reasoning-effort picker. A printable key pressed in any of them returns to the input and types there, so a sentence started while reading lands where it was aimed; `Space` in the conversation is the one exception, and folds the marked tool card or context block. `Ctrl+G`, `Ctrl+O`, `Ctrl+B`, `Ctrl+T`, `Ctrl+P`, and `Ctrl+L` mean the same thing in every one of those regions, and `Ctrl+C` and `Ctrl+D` return the keyboard to the input before they act. A prompt and the reader own their whole key stream instead, and answer `Ctrl+C` by giving the keyboard back.
|
|
64
64
|
|
|
65
65
|
While the input has the keyboard:
|
|
66
66
|
|
|
@@ -79,6 +79,7 @@ While the input has the keyboard:
|
|
|
79
79
|
| `Ctrl+G` | Read the conversation full screen, on its newest section |
|
|
80
80
|
| `Ctrl+O` | Expand or collapse every tool card and context row |
|
|
81
81
|
| `Ctrl+T` | Browse the agent's todo list, the same list `/todos` opens |
|
|
82
|
+
| `Ctrl+B` | While a turn runs, move its running tool calls to background jobs so the agent keeps working; outside a turn the editor moves the caret left |
|
|
82
83
|
| `Ctrl+P` | Return from a subagent view to the session it was entered from, or end a `/btw` side agent, like `/parent` |
|
|
83
84
|
| `Ctrl+L` | Redraw the whole screen from scratch |
|
|
84
85
|
| `?` | On an empty input, list the commands and keys, like `/help`; inside a draft it is typed |
|
|
@@ -191,6 +192,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
191
192
|
| `/changes [turn]` | Browse the files the latest turn changed, or turn `turn`, with their line counts; `Enter` opens one file's turn-start to turn-end comparison |
|
|
192
193
|
| `/subagents` | Browse the subagent sessions under this session; `Enter` opens a readable one as a subagent view and an unreadable one's details |
|
|
193
194
|
| `/parent` | Return from a subagent view to the session it was entered from, or end a `/btw` side agent, like `Ctrl+P` |
|
|
195
|
+
| `/jobs` | Browse this session's background jobs, the calls moved with `Ctrl+B` and the jobs the agent started, with status and elapsed time; `Enter` shows one job's status and output tail, and `Ctrl+K` stops the highlighted job |
|
|
194
196
|
| `/settings [ns [path value]]` | List namespaces, show one, or set one field; `/settings reset <ns>` restores defaults |
|
|
195
197
|
| `/plugins` | The composed plugins with enablement and lifecycle phase; `/plugins bundles` lists the profile's bundles, `/plugins enable <id>` and `/plugins disable <id>` switch a plugin entry or a bundle, `/plugins add <spec>` installs a bundle, `/plugins remove <name>` removes one |
|
|
196
198
|
| `/tools` | Expand or collapse every tool card and context row, like `Ctrl+O` |
|
|
@@ -204,6 +206,10 @@ Every picker the terminal opens — `/model`'s model and reasoning-effort lists,
|
|
|
204
206
|
|
|
205
207
|
`/todos`, the `todo` status-bar segment, and the unreadable rows of `/subagents` share one list-then-details interaction: the picker lists the entries, `Enter` opens the highlighted entry as a read-only page, `Up` / `Down` and `PageUp` / `PageDown` scroll that page, and `Enter`, `Esc`, or `Left` returns to the list on the entry just read, so walking several entries costs no retyped command; `Esc` at the list returns to the editor. An entry whose details cannot be read says so on its page instead of closing the list.
|
|
206
208
|
|
|
209
|
+
### Background tool calls
|
|
210
|
+
|
|
211
|
+
While the running turn waits on a tool call, the working spinner ends in `· Ctrl+B background`. `Ctrl+B` hands every such call of the bound Agent to the job registry as a `tool-<n>` job and answers the call at once with a result that names the job, so the turn goes on while the call keeps running. The card settles on an accent `◇` row, `◇ moved to the background as tool-1 · /jobs lists it`, which a resumed session draws the same way. While any job of the session runs, one dim line above the input lists them, as in `◇ 2 in background · tool-1 bash npm test 1m04s · bash-3 sleep 20 12s · /jobs`, and the live refresh advances their elapsed times. A shell call's own process job belongs to that call and is listed only once it outlives the call. When a job settles, a transient line names it, such as `◇ tool-1 completed · bash npm test · agent notified`, and `dsh-tool-jobs` delivers the completion notice: a busy agent reads it at its next step, and an idle one wakes. `/jobs` browses every job of the session: `Enter` shows its status, label, start, and the tail of its output, including a moved shell call's live process output, and `Ctrl+K` stops the highlighted job, which the agent is told about. Stopping the turn with `Esc` also stops the calls moved out of that turn, because the tool runtime ties every call to its turn; the stop notice counts them, and their jobs settle `killed` without waking the agent.
|
|
212
|
+
|
|
207
213
|
### Subscription sign-in
|
|
208
214
|
|
|
209
215
|
`/login` stores a subscription credential but does not activate a dormant model route. Configure the catalog route first, then use its full credential key; for example, run `/settings llm-pi-ai providers.openai-codex {}` and then `/login llm-pi-ai/openai-codex`. Cursor is already registered: `/login llm-cursor/cursor`. A marked authorization page opens in the local default browser while its URL remains in the transcript as a fallback. SSH launches, hosts without a desktop, `--no-open`, and opener failures leave the manual URL and device-code paths available instead.
|
|
@@ -304,6 +310,8 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
304
310
|
| [`src/footer.ts`](src/footer.ts) | The status bar: the ordered segments, each segment's detail rows, the unfocused line built from both ends, and the focused sliding window |
|
|
305
311
|
| [`src/subagent-panel.ts`](src/subagent-panel.ts) | The live subagent panel: one descendant listing plus sampled live facts become its rows, the unfocused summary line, and the focused listing |
|
|
306
312
|
| [`src/queue-panel.ts`](src/queue-panel.ts) | The follow-ups list: pending-row glyphs, hanging wrap, and the enter-steer legend |
|
|
313
|
+
| [`src/background.ts`](src/background.ts) | `Ctrl+B`: the `tools/execute` wrapper that tracks root calls, moves them to `tool` jobs, recognizes a shell call's own process job, and holds the jobs of a stopped turn |
|
|
314
|
+
| [`src/jobs-panel.ts`](src/jobs-panel.ts) | The background-jobs line above the editor, the `/jobs` rows and detail page, and the settlement line |
|
|
307
315
|
| [`src/activity-board.ts`](src/activity-board.ts) | The activity board: todo glyphs, the completed scratch-out, the row cap, and the one-line descendant summary |
|
|
308
316
|
| [`src/catalog.ts`](src/catalog.ts) | Rows for `/settings`, `/plugins`, `/subagents`, `/deliverables`, `/changes`, and `/outline`, and the `/plugins` management verbs |
|
|
309
317
|
| [`src/view-banner.ts`](src/view-banner.ts) | The line above the input that names an open subagent view or `/btw` side agent and the key back |
|
|
@@ -311,6 +319,9 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
311
319
|
| [`cordis.patch.yml`](cordis.patch.yml) | The terminal patch over `dsh-base` |
|
|
312
320
|
| — | No runtime invariant companion is published; the app registers listeners on one Agent and holds no mutable relation another observer could contradict. |
|
|
313
321
|
| [`tests/app.spec.ts`](tests/app.spec.ts) | Rendering, keys, commands, the stop arm, the follow-ups rows above the editor, the activity board, and both seams over a fake terminal |
|
|
322
|
+
| [`tests/background.spec.ts`](tests/background.spec.ts) | `Ctrl+B` over the real tool runtime, job registry, and job tools: the spinner hint, the moved result and card, the jobs line, `/jobs` output and `Ctrl+K`, completion notices, refusal, failure, and the turn stop |
|
|
323
|
+
| [`tests/background-tracking.spec.ts`](tests/background-tracking.spec.ts) | Which calls the wrapper tracks, which jobs count as a call's own, and the moved-result text |
|
|
324
|
+
| [`tests/jobs-panel.spec.ts`](tests/jobs-panel.spec.ts) | The jobs line, `/jobs` rows, detail page, and settlement line as text |
|
|
314
325
|
| [`tests/activity-board.spec.ts`](tests/activity-board.spec.ts) | Activity-board glyphs, the completed scratch-out, the row cap, and the descendant line |
|
|
315
326
|
| [`tests/keys.spec.ts`](tests/keys.spec.ts) | What each region claims for a key, the legend steps, and the text one press types |
|
|
316
327
|
| [`tests/editor.spec.ts`](tests/editor.spec.ts) | The terminal caret, `Shift+Left` / `Shift+Right` word navigation, and `!` / `!!` draft colour against pi-tui's editor behavior |
|
|
@@ -386,6 +397,26 @@ Conditional and retained: each `!` notice stays in conversation history for late
|
|
|
386
397
|
|
|
387
398
|
Append-only conversation growth after the reusable request prefix. The notice does not change the system prompt or tool catalog. A `/model` switch starts a new request series exactly as it does from the browser.
|
|
388
399
|
|
|
400
|
+
### Background tool call
|
|
401
|
+
|
|
402
|
+
#### What the model sees
|
|
403
|
+
|
|
404
|
+
A call the user moves with `Ctrl+B` gets an error result right away with this fixed text, `<id>` being the job's `tool-<n>` id. The error flag is required because the tool runtime validates every successful result against the tool's own output schema. When the job settles, `dsh-tool-jobs` sends its ordinary completion notice unless the model already collected the job, and `job_output` returns the call's text result. A job stopped because its turn was stopped sends no notice.
|
|
405
|
+
|
|
406
|
+
##### Moved call result
|
|
407
|
+
|
|
408
|
+
```markdown
|
|
409
|
+
The user moved this call to the background. It keeps running as job <id>. You are notified when it finishes; read its result with job_output, or stop it with job_kill. Continue with steps that do not depend on it.
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### Token effect
|
|
413
|
+
|
|
414
|
+
Conditional and retained: the fixed result replaces the call's own result in history, and the completion notice and the `job_output` read that carries the call's result are added later.
|
|
415
|
+
|
|
416
|
+
#### KV Cache effect
|
|
417
|
+
|
|
418
|
+
Append-only conversation growth after the reusable request prefix. Moving a call does not change the system prompt or tool catalog.
|
|
419
|
+
|
|
389
420
|
### Side agent
|
|
390
421
|
|
|
391
422
|
#### What the model sees
|
|
@@ -424,6 +455,7 @@ These limits describe the terminal surface as shipped; they are not a general CL
|
|
|
424
455
|
- **The terminal's own caret can flicker** — the editor draws no caret of its own and the app turns the terminal cursor on, which pi-tui then moves across the lines it repaints; a terminal that does not honor the synchronized-output sequences pi-tui wraps a frame in can show that movement.
|
|
425
456
|
- **Runs through the `dsh` launcher** — starting the profile another way fails at startup, because only the launcher can request the process exit.
|
|
426
457
|
- **A `/btw` side agent is read-only by tool name and sandbox** — `btwTools` must name only tools that read, because the side agent shares the workspace with the working agent; a command tool can read anything the `read-only` sandbox mode allows, and without a confining command executor command tools are hidden. It inherits only what the working session has logged: reply text still streaming is absent. Its log is stored like a subagent session's and hidden from `/resume` and `/sessions`, and Web has no `/btw`.
|
|
458
|
+
- **A moved call stays tied to its turn and returns text** — the tool runtime fuses the turn's signal into every call, so `Esc` on the turn that dispatched a call stops it even after `Ctrl+B`; a job result is a string, so other content blocks of the call's result are named as `[image omitted]` and the like; and moving needs `ctx.jobs` with `dsh-tool-jobs`, which the base profile composes.
|
|
427
459
|
- **`!` is one-shot and not a TTY** — each line is a fresh `ctx.shell.run`; there is no persistent shell or interactive program. The Web composer does not intercept `!`. An optional first prompt on the command line is always a user message.
|
|
428
460
|
|
|
429
461
|
<a id="dev-note"></a>
|
|
@@ -60,7 +60,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
60
60
|
|
|
61
61
|
### 按键与命令
|
|
62
62
|
|
|
63
|
-
对话记录、编辑器、子 agent 面板与状态栏构成垂直方向键走查:在最新小节上按 `Down`、在子 agent 面板第一行上按 `Up`、在没有绘制子 agent 面板时于状态栏上按 `Up`,都会落到光标处。follow-ups 列表位于输入框上方;绘制该列表时,`Shift+Up` 会进入它,它也加入 `Tab` 走查。activity board 位于 follow-ups 与输入之间,不是焦点区域。编辑器以外的区域持有键盘时,`Tab` 与 `Shift+Tab` 走遍已绘制的各区域,并在两端环绕;在编辑器中,`Tab` 采用给出的补全,`Shift+Tab` 打开推理强度选择器。在其中任何一个区域按下可打印键都会回到编辑器并在那里输入,因此在阅读时开始写的句子会落在它所指向的地方;对话记录中的 `Space` 是唯一的例外,它折叠被标记的工具卡片或上下文块。`Ctrl+G`、`Ctrl+O`、`Ctrl+T`、`Ctrl+P` 与 `Ctrl+L` 在这些区域中含义完全相同,而 `Ctrl+C` 与 `Ctrl+D` 会先把键盘交还编辑器再行动。提示与阅读器则各自持有整条按键流,并以交还键盘的方式应答 `Ctrl+C`。
|
|
63
|
+
对话记录、编辑器、子 agent 面板与状态栏构成垂直方向键走查:在最新小节上按 `Down`、在子 agent 面板第一行上按 `Up`、在没有绘制子 agent 面板时于状态栏上按 `Up`,都会落到光标处。follow-ups 列表位于输入框上方;绘制该列表时,`Shift+Up` 会进入它,它也加入 `Tab` 走查。activity board 位于 follow-ups 与输入之间,不是焦点区域。编辑器以外的区域持有键盘时,`Tab` 与 `Shift+Tab` 走遍已绘制的各区域,并在两端环绕;在编辑器中,`Tab` 采用给出的补全,`Shift+Tab` 打开推理强度选择器。在其中任何一个区域按下可打印键都会回到编辑器并在那里输入,因此在阅读时开始写的句子会落在它所指向的地方;对话记录中的 `Space` 是唯一的例外,它折叠被标记的工具卡片或上下文块。`Ctrl+G`、`Ctrl+O`、`Ctrl+B`、`Ctrl+T`、`Ctrl+P` 与 `Ctrl+L` 在这些区域中含义完全相同,而 `Ctrl+C` 与 `Ctrl+D` 会先把键盘交还编辑器再行动。提示与阅读器则各自持有整条按键流,并以交还键盘的方式应答 `Ctrl+C`。
|
|
64
64
|
|
|
65
65
|
编辑器持有键盘时:
|
|
66
66
|
|
|
@@ -79,6 +79,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
79
79
|
| `Ctrl+G` | 整屏读出对话记录,停在其最新小节 |
|
|
80
80
|
| `Ctrl+O` | 展开或折叠所有工具卡片与上下文行 |
|
|
81
81
|
| `Ctrl+T` | 浏览 agent 的 todo 列表,与 `/todos` 打开的是同一个列表 |
|
|
82
|
+
| `Ctrl+B` | 轮次运行期间,把它正在运行的工具调用移为后台作业,让 agent 继续工作;轮次之外由编辑器把光标左移 |
|
|
82
83
|
| `Ctrl+P` | 从子 agent 视图返回进入它之前的会话,或结束 `/btw` 旁路 agent,与 `/parent` 相同 |
|
|
83
84
|
| `Ctrl+L` | 从头重绘整个屏幕 |
|
|
84
85
|
| `?` | 输入为空时列出命令与按键,与 `/help` 相同;在草稿中则作为文字输入 |
|
|
@@ -191,6 +192,7 @@ follow-ups 面板持有键盘时:
|
|
|
191
192
|
| `/changes [turn]` | 浏览最近一轮(或第 `turn` 轮)改动的文件及其行数;`Enter` 打开某个文件从轮次开始到结束的对比 |
|
|
192
193
|
| `/subagents` | 浏览本会话之下的子 agent 会话;`Enter` 把可读的会话作为子 agent 视图打开,对无法读取的会话则打开其详情 |
|
|
193
194
|
| `/parent` | 从子 agent 视图返回进入它之前的会话,或结束 `/btw` 旁路 agent,与 `Ctrl+P` 相同 |
|
|
195
|
+
| `/jobs` | 浏览本会话的后台作业,即用 `Ctrl+B` 移走的调用与 agent 启动的作业,附带状态与耗时;`Enter` 显示一个作业的状态与输出末尾,`Ctrl+K` 停止高亮的作业 |
|
|
194
196
|
| `/settings [ns [path value]]` | 列出命名空间、显示某一个或设置某个字段;`/settings reset <ns>` 恢复默认 |
|
|
195
197
|
| `/plugins` | 已组合的插件及其启用状态与生命周期阶段;`/plugins bundles` 列出 profile 的组合包,`/plugins enable <id>` 与 `/plugins disable <id>` 切换某个插件条目或组合包,`/plugins add <spec>` 安装组合包,`/plugins remove <name>` 移除组合包 |
|
|
196
198
|
| `/tools` | 像 `Ctrl+O` 一样展开或折叠所有工具卡片与上下文行 |
|
|
@@ -204,6 +206,10 @@ follow-ups 面板持有键盘时:
|
|
|
204
206
|
|
|
205
207
|
`/todos`、状态栏的 `todo` 分段与 `/subagents` 中无法读取的行共用同一套先列表、后详情的交互:选择器列出各条目,`Enter` 把高亮条目作为只读页面打开,`Up` / `Down` 与 `PageUp` / `PageDown` 滚动该页面,`Enter`、`Esc` 或 `Left` 返回列表并停在刚读过的条目上,因此连续查看多个条目无需重新输入命令;在列表上按 `Esc` 返回编辑器。详情无法读取的条目会在其页面上说明原因,而不会关闭列表。
|
|
206
208
|
|
|
209
|
+
### 后台工具调用
|
|
210
|
+
|
|
211
|
+
运行中的轮次等待某个工具调用时,工作旋转指示以 `· Ctrl+B background` 结尾。`Ctrl+B` 把绑定 Agent 的每个此类调用作为 `tool-<n>` 作业交给作业注册表,并立即以一个写明该作业的结果应答该调用,因此轮次继续推进,而调用仍在运行。卡片停在一行强调色的 `◇` 上,即 `◇ moved to the background as tool-1 · /jobs lists it`,恢复的会话也以同样方式绘制它。只要会话有作业在运行,输入框上方就有一行暗色文字列出它们,例如 `◇ 2 in background · tool-1 bash npm test 1m04s · bash-3 sleep 20 12s · /jobs`,实时刷新会推进各自的耗时。shell 调用自己的进程作业属于该调用,只有在它比调用活得更久之后才会被列出。作业结束时,一行临时提示会写明它,例如 `◇ tool-1 completed · bash npm test · agent notified`,`dsh-tool-jobs` 则投递完成通知:忙碌的 agent 在下一步读到它,空闲的 agent 被唤醒。`/jobs` 浏览本会话的所有作业:`Enter` 显示其状态、标签、开始时间与输出末尾,包括被移走的 shell 调用的实时进程输出;`Ctrl+K` 停止高亮的作业,agent 会得知这一点。用 `Esc` 停止轮次也会停止从该轮次移出的调用,因为工具运行时把每个调用绑定到它的轮次;停止通知会计出它们的数量,它们的作业以 `killed` 结束且不会唤醒 agent。
|
|
212
|
+
|
|
207
213
|
### 订阅登录
|
|
208
214
|
|
|
209
215
|
`/login` 只存储订阅凭据,不会激活休眠的模型路由。先配置 catalog 路由,再使用完整的凭据键;例如先运行 `/settings llm-pi-ai providers.openai-codex {}`,再运行 `/login llm-pi-ai/openai-codex`。Cursor 已经注册:`/login llm-cursor/cursor`。被标记的授权页面会在本地默认浏览器中打开,其 URL 同时保留在对话记录中作为后备。SSH 启动、无桌面的宿主、`--no-open` 以及打开器失败时,手动 URL 与设备码路径仍然可用。
|
|
@@ -304,6 +310,8 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
304
310
|
| [`src/footer.ts`](src/footer.ts) | 状态栏:有序的各分段、每个分段的详情行、未聚焦时由两端向内构建的一行,以及聚焦时的滑动窗口 |
|
|
305
311
|
| [`src/subagent-panel.ts`](src/subagent-panel.ts) | 实时子 agent 面板:一次后代列表加上采样到的实时事实构成其各行、未聚焦时的摘要行,以及聚焦时的列表 |
|
|
306
312
|
| [`src/queue-panel.ts`](src/queue-panel.ts) | follow-ups 列表:待处理行符号、悬挂换行与 enter-steer 图例 |
|
|
313
|
+
| [`src/background.ts`](src/background.ts) | `Ctrl+B`:跟踪根调用的 `tools/execute` 包装器,把调用移为 `tool` 作业、识别 shell 调用自己的进程作业,并保持被停止轮次的作业 |
|
|
314
|
+
| [`src/jobs-panel.ts`](src/jobs-panel.ts) | 编辑器上方的后台作业行、`/jobs` 的行与详情页,以及作业结束提示行 |
|
|
307
315
|
| [`src/activity-board.ts`](src/activity-board.ts) | activity board:todo 状态符号、已完成内容划掉、行数上限,以及一行后代摘要 |
|
|
308
316
|
| [`src/catalog.ts`](src/catalog.ts) | `/settings`、`/plugins`、`/subagents`、`/deliverables`、`/changes` 与 `/outline` 的行,以及 `/plugins` 的管理动作 |
|
|
309
317
|
| [`src/view-banner.ts`](src/view-banner.ts) | 输入框上方标明已打开的子 agent 视图或 `/btw` 旁路 agent 及返回按键的一行 |
|
|
@@ -311,6 +319,9 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
311
319
|
| [`cordis.patch.yml`](cordis.patch.yml) | 基于 `dsh-base` 的终端 patch |
|
|
312
320
|
| — | 不发布运行时不变量伴随模块;应用只在一个 Agent 上注册监听器,不持有其他观察者可能与之矛盾的可变关系。 |
|
|
313
321
|
| [`tests/app.spec.ts`](tests/app.spec.ts) | 基于伪终端的渲染、按键、命令、停止装填、编辑器上方的 follow-ups 行、activity board 与两个接缝 |
|
|
322
|
+
| [`tests/background.spec.ts`](tests/background.spec.ts) | 基于真实工具运行时、作业注册表与作业工具的 `Ctrl+B`:旋转指示提示、被移走的结果与卡片、作业行、`/jobs` 输出与 `Ctrl+K`、完成通知、拒绝、失败与轮次停止 |
|
|
323
|
+
| [`tests/background-tracking.spec.ts`](tests/background-tracking.spec.ts) | 包装器跟踪哪些调用、哪些作业算作调用自己的作业,以及被移走结果的文本 |
|
|
324
|
+
| [`tests/jobs-panel.spec.ts`](tests/jobs-panel.spec.ts) | 作业行、`/jobs` 的行、详情页与作业结束提示行的文本 |
|
|
314
325
|
| [`tests/activity-board.spec.ts`](tests/activity-board.spec.ts) | activity board 的状态符号、已完成划掉、行数上限与后代行 |
|
|
315
326
|
| [`tests/keys.spec.ts`](tests/keys.spec.ts) | 每个区域为一个按键认领什么、按键提示的各级,以及一次按键输入的文字 |
|
|
316
327
|
| [`tests/editor.spec.ts`](tests/editor.spec.ts) | 对照 pi-tui 编辑器行为验证终端光标、`Shift+Left` / `Shift+Right` 词导航,以及 `!` / `!!` 草稿着色 |
|
|
@@ -386,6 +397,26 @@ The user ran `<command>` in the terminal.
|
|
|
386
397
|
|
|
387
398
|
在可复用的请求前缀之后只做追加式增长。该通知不改变系统提示或工具目录。`/model` 切换像在浏览器中一样开始新的请求序列。
|
|
388
399
|
|
|
400
|
+
### 后台工具调用
|
|
401
|
+
|
|
402
|
+
#### 模型看到什么
|
|
403
|
+
|
|
404
|
+
用户用 `Ctrl+B` 移走的调用会立即得到一个带以下固定文本的错误结果,其中 `<id>` 是该作业的 `tool-<n>` id。之所以需要错误标记,是因为工具运行时会按工具自身的输出 schema 校验每个成功结果。作业结束时,除非模型已经收取了该作业,`dsh-tool-jobs` 会发送它的普通完成通知,`job_output` 则返回该调用的文本结果。因其轮次被停止而停止的作业不发送通知。
|
|
405
|
+
|
|
406
|
+
##### 被移走调用的结果
|
|
407
|
+
|
|
408
|
+
```markdown
|
|
409
|
+
The user moved this call to the background. It keeps running as job <id>. You are notified when it finishes; read its result with job_output, or stop it with job_kill. Continue with steps that do not depend on it.
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### Token 影响
|
|
413
|
+
|
|
414
|
+
有条件且会保留:固定结果在历史中取代该调用自己的结果,之后再加入完成通知,以及携带该调用结果的 `job_output` 读取。
|
|
415
|
+
|
|
416
|
+
#### KV Cache 影响
|
|
417
|
+
|
|
418
|
+
在可复用的请求前缀之后只追加对话内容。移走调用不会改变系统提示或工具目录。
|
|
419
|
+
|
|
389
420
|
### 旁路 agent
|
|
390
421
|
|
|
391
422
|
#### 模型看到什么
|
|
@@ -424,6 +455,7 @@ The user ran `<command>` in the terminal.
|
|
|
424
455
|
- **终端自身的光标可能闪烁**——编辑器不绘制自己的光标,应用打开终端光标,而 pi-tui 会在其重绘的各行之间移动它;不支持 pi-tui 为一帧包裹的同步输出序列的终端可能显示出这种移动。
|
|
425
456
|
- **通过 `dsh` 启动器运行**——以其他方式启动该 profile 会在启动时失败,因为只有启动器能请求进程退出。
|
|
426
457
|
- **`/btw` 旁路 agent 靠工具名称与沙箱保持只读**——`btwTools` 只能列出读取类工具,因为旁路 agent 与工作 agent 共享工作区;命令工具可以读取 `read-only` 沙箱模式允许的任何内容,而没有会约束命令的执行器时命令工具会被隐藏。它只继承工作会话已记录的内容:仍在流式输出的回复文本不在其中。它的日志像子 agent 会话一样被存储,并在 `/resume` 与 `/sessions` 中隐藏,Web 没有 `/btw`。
|
|
458
|
+
- **被移走的调用仍绑定其轮次并返回文本**——工具运行时把轮次的信号融合进每个调用,因此即便按过 `Ctrl+B`,在派发该调用的轮次上按 `Esc` 仍会停止它;作业结果是字符串,因此调用结果中的其他内容块会被写成 `[image omitted]` 之类;移走调用需要 `ctx.jobs` 与 `dsh-tool-jobs`,base profile 已组合二者。
|
|
427
459
|
- **`!` 是一次性的,也不是 TTY**——每一行都是一次新的 `ctx.shell.run`;没有持久 shell,也不能跑交互式程序。Web 编辑器不拦截 `!`。命令行上的可选首条提示始终是用户消息。
|
|
428
460
|
|
|
429
461
|
<a id="dev-note"></a>
|