@xmoon76/dsh-pi-tui 0.4.0-alpha.1 → 0.4.0-alpha.2

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.en.md CHANGED
@@ -18,7 +18,7 @@ dsh --profile pi-tui
18
18
 
19
19
  ## DSH compatibility and source validation
20
20
 
21
- The published package declares the lower-bound-only DSH peer contract `>=0.1.2-alpha.2`. Source validation does not change that contract or vendor DSH into this repository.
21
+ The published package declares the lower-bound-only DSH peer contract `>=0.1.2-alpha.4`. Source validation does not change that contract or vendor DSH into this repository.
22
22
 
23
23
  When the target DSH version is not yet available from npm, validate against the official checkout pinned by commit SHA:
24
24
 
@@ -115,10 +115,17 @@ The browser distinguishes:
115
115
 
116
116
  Completed one-shot Subagents remain available for persisted Transcript inspection.
117
117
 
118
- A direct `continuable` Child can be opened in an interactive viewer and sent follow-up messages directly. The Child has its own Transcript, Draft, and runtime state, without modifying the main Session input.
118
+ A direct `continuable` Child can be opened in an interactive viewer and sent follow-up messages directly (through DSH's official `subagents.prompt()` human channel — queued in order as the Child's own next turn, with user provenance). The Child has its own Transcript, Draft, and runtime state, without modifying the main Session input.
119
119
 
120
120
  Deeper nested Subagents are read-only by default.
121
121
 
122
+ The official subagent model selection (the DSH `subagent-model-selection`
123
+ setting) can be toggled and its allowlist maintained in `/settings`: once
124
+ enabled, a NEW session's official `subagent` tool may pick the child
125
+ provider/model per call (bounded by the allowlist). The setting is sampled at
126
+ session composition and never rewrites the tools of an already-running
127
+ session.
128
+
122
129
  ### Shell
123
130
 
124
131
  The editor supports two Shell modes:
@@ -312,18 +319,21 @@ dsh-pi-tui:
312
319
 
313
320
  | TUI package line | Matching DSH line | Notes |
314
321
  |---|---|---|
315
- | `0.4.0-alpha.1` (`@next`) | `>=0.1.2-alpha.2` | Current prerelease; each release validates its concrete DSH family |
322
+ | `0.4.x-alpha` (`@next`) | `>=0.1.2-alpha.4` | Current prerelease; each release validates its concrete DSH family |
323
+ | `0.4.0-alpha.2` (published) | `>=0.1.2-alpha.4` | Previous 0.4 prerelease; its releases validated the alpha.4/alpha.5 family |
324
+ | `0.4.0-alpha.1` (published) | `>=0.1.2-alpha.2` | Earlier 0.4 prerelease; accepts the alpha.2/alpha.3 runtime |
316
325
  | `0.3.x` (`@0.3`) | `0.1.1-rc.2` | Legacy runtime line |
317
326
 
318
- Do not mix the two lines: DSH 0.1.1 is outside the 0.4 peer window and the
327
+ Do not mix the lines: DSH 0.1.1 is outside the 0.4 peer window and the
319
328
  normal incompatible-runtime boundary will fail. The startup row prints upgrade
320
329
  and rollback guidance when concurrent Loader ordering allows it, but that
321
330
  friendly notice is best-effort rather than a startup-order guarantee. If you
322
- keep DSH 0.1.1, use the 0.3 TUI line. For the current `0.4.0-alpha.1`, install
323
- DSH first and then add the TUI to a profile:
331
+ keep DSH 0.1.1, use the 0.3 TUI line; if you keep the alpha.2/alpha.3
332
+ baseline, use `@xmoon76/dsh-pi-tui@0.4.0-alpha.1`. For the current 0.4
333
+ prerelease, install DSH first and then add the TUI to a profile:
324
334
 
325
335
  ```sh
326
- npm install -g @deepseek-ai/dsh@0.1.2-alpha.3
336
+ npm install -g @deepseek-ai/dsh@0.1.2-alpha.5
327
337
  dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@next
328
338
  dsh --profile pi-tui
329
339
  ```
@@ -336,7 +346,7 @@ dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.3
336
346
  dsh --profile pi-tui
337
347
  ```
338
348
 
339
- The declared 0.4 support range is `>=0.1.2-alpha.2`; each release validates
349
+ The current 0.4 line declares `>=0.1.2-alpha.4`; each release validates
340
350
  its concrete DSH family. Running only `npm install -g @xmoon76/dsh-pi-tui` does
341
351
  not install the plugin into a DSH profile; the `dsh plugin` command is still
342
352
  required.
package/README.md CHANGED
@@ -18,7 +18,7 @@ dsh --profile pi-tui
18
18
 
19
19
  ## DSH 兼容性与源码验证
20
20
 
21
- 发布包通过 `package.json` peer contract 使用 DSH `>=0.1.2-alpha.2`;源码验证不会修改这个发布契约,也不会把 DSH vendor 进本仓库。
21
+ 发布包通过 `package.json` peer contract 使用 DSH `>=0.1.2-alpha.4`;源码验证不会修改这个发布契约,也不会把 DSH vendor 进本仓库。
22
22
 
23
23
  当目标 DSH 版本尚未发布到 npm 时,可以用固定 commit 的官方源码包做本地验证:
24
24
 
@@ -94,7 +94,7 @@ Rewind 会从选中的历史 User Turn 创建新的 Child Session,并把对应
94
94
 
95
95
  ### Subagent 与后台任务
96
96
 
97
- `/tasks` 提供当前 Session 的任务浏览器。
97
+ `/tasks` 打开完整 Task Center(当前 Session 的所有后台工作);Footer 的 `↓` 直接打开轻量 Quick Tasks(只看正在运行的工作)。
98
98
 
99
99
  Subagent 按完整 lineage 显示,包括嵌套创建的 descendant:
100
100
 
@@ -113,12 +113,19 @@ main
113
113
  * nested descendant
114
114
  * 后台 Job
115
115
 
116
+ 两个视图共享同一份运行时状态:`A` 切换 Active / All scope,`Tab` 切换类型过滤,`/` 进入搜索,`S`(确认后)停止所选任务,`N` / `Shift+N` 在运行中的任务间跳转,Quick 内 `T` 或底部 "View all" 行进入完整 Task Center,`Esc` 逐层返回。
117
+
116
118
  已经结束的 one-shot Subagent 仍可以打开并查看持久化 Transcript。
117
119
 
118
- 对于当前 Session 的直接 `continuable` Child,可以进入交互式 Viewer,并直接向该 Subagent 发送后续消息。Child 使用自己的 Transcript、Draft 和运行状态,不会修改主 Session 的输入。
120
+ 对于当前 Session 的直接 `continuable` Child,可以进入交互式 Viewer,并直接向该 Subagent 发送后续消息(走 DSH 官方 `subagents.prompt()` 人类输入通道——按顺序排队为 Child 自己的下一个 turn,并保留 user 来源)。Child 使用自己的 Transcript、Draft 和运行状态,不会修改主 Session 的输入。
119
121
 
120
122
  更深层的 nested Subagent 默认以只读方式查看。
121
123
 
124
+ 官方 Subagent 模型选择(DSH `subagent-model-selection` 设置)可在 `/settings`
125
+ 中开关并维护 allowlist:开启后**新建** Session 的官方 `subagent` 工具可以按调用
126
+ 选择子 Agent 的 provider/model(受 allowlist 限制)。设置在 Session 组合时采样,
127
+ 不会改写已在运行的 Session 的工具。
128
+
122
129
  ### Shell
123
130
 
124
131
  编辑器支持两种 Shell 模式:
@@ -301,17 +308,20 @@ dsh-pi-tui:
301
308
 
302
309
  | TUI 包版本 | 对应 DSH 版本 | 说明 |
303
310
  |---|---|---|
304
- | `0.4.0-alpha.1`(`@next`) | `>=0.1.2-alpha.2` | 当前预发布线;按每个发布版本的具体 DSH family 验证 |
311
+ | `0.4.x-alpha`(`@next`) | `>=0.1.2-alpha.4` | 当前预发布线;按每个发布版本的具体 DSH family 验证 |
312
+ | `0.4.0-alpha.2`(已发布) | `>=0.1.2-alpha.4` | 上一条 0.4 预发布线;其发布版本按 alpha.4/alpha.5 family 验证 |
313
+ | `0.4.0-alpha.1`(已发布) | `>=0.1.2-alpha.2` | 更早的 0.4 预发布线;接受 alpha.2/alpha.3 运行时 |
305
314
  | `0.3.x`(`@0.3`) | `0.1.1-rc.2` | 旧运行时兼容线 |
306
315
 
307
316
  不要把两条线混装:DSH 0.1.1 不在 0.4 的 peer 支持范围内,运行时会在
308
317
  正常的不兼容边界以非零状态失败。启动行会在 Loader 并发挂载顺序允许时打印
309
318
  升级和回退提示,但该友好提示是 best-effort,不是启动顺序保证;保留 DSH
310
- 0.1.1 时请使用 0.3。`0.4.0-alpha.1` 的推荐安装顺序如下(先装 DSH,再把
311
- TUI 装入 profile):
319
+ 0.1.1 时请使用 0.3,保留 alpha.2/alpha.3 时请使用
320
+ `@xmoon76/dsh-pi-tui@0.4.0-alpha.1`。当前 0.4 预发布线的推荐安装顺序如下
321
+ (先装 DSH,再把 TUI 装入 profile):
312
322
 
313
323
  ```sh
314
- npm install -g @deepseek-ai/dsh@0.1.2-alpha.3
324
+ npm install -g @deepseek-ai/dsh@0.1.2-alpha.5
315
325
  dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@next
316
326
  dsh --profile pi-tui
317
327
  ```
@@ -324,8 +334,8 @@ dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.3
324
334
  dsh --profile pi-tui
325
335
  ```
326
336
 
327
- `0.4` 的声明支持范围是 `>=0.1.2-alpha.2`;每个发布版本都会验证具体的
328
- DSH family。仅执行 `npm install -g @xmoon76/dsh-pi-tui` 不会把插件安装进
337
+ `0.4` 当前线的声明支持范围是 `>=0.1.2-alpha.4`;每个发布版本都会验证
338
+ 具体的 DSH family。仅执行 `npm install -g @xmoon76/dsh-pi-tui` 不会把插件安装进
329
339
  DSH profile,实际使用仍应执行上面的 `dsh plugin` 命令。
330
340
 
331
341
  新的 Agent preset 使用当前 roster 中选定的 id。DSH 允许合法的自定义
package/cordis.patch.yml CHANGED
@@ -52,9 +52,13 @@
52
52
  config:
53
53
  default: standard
54
54
 
55
- # The official standard preset enables per-session subagent model
56
- # selection. Its tool-subagent row requires this Host service when it
57
- # mounts; without the row the default standard composition throws.
55
+ # The official standard preset composes its `subagent` tool with
56
+ # `modelSelectionSettings: true`, which injects this Host-owned setting
57
+ # service — the row is required for the standard composition to mount.
58
+ # Mounting the service ALONE enables nothing: it only owns the
59
+ # `subagent-model-selection` settings section (default enabled=false,
60
+ # empty allowlist). Each NEW session samples that section at
61
+ # composition; the TUI exposes the toggle + allowlist in /settings.
58
62
  - id: subagent-model-selection-settings
59
63
  name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'
60
64
 
@@ -84,8 +88,8 @@
84
88
  #
85
89
  # Rows that STAY on the host plane (not listed): `tools` (registry), `shell-env`
86
90
  # (publishes the DSH env the model's shell sees), `subagent` + its spawn/fork
87
- # backends (process singletons), `tool-subagent-report` (host singleton),
88
- # `subagent-model-selection-settings`, the goal/jobs/compaction services and
91
+ # backends (process singletons), `subagent-model-selection-settings`, the
92
+ # goal/jobs/compaction services and
89
93
  # their host infrastructure, `permission`, `approval`, `sandbox*`,
90
94
  # `fs-observation-policy`, `spill*`, `timeout-policy`, `repeat-tool-reminder`,
91
95
  # `session-*`, `token-meter`. `command-goal` is disabled below and reintroduced
package/dist/builtins.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { H as PI_TUI_EXTENSIONS_SERVICE, L as dshVersion } from "./src-syk6h8J9.mjs";
1
+ import { H as PI_TUI_EXTENSIONS_SERVICE, L as dshVersion } from "./src-zkySYmLZ.mjs";
2
2
  import { TUI_STARTUP_SERVICE } from "./startup.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -4,15 +4,35 @@ import { D as PiTuiApiInfo, _ as ExtensionTier, ot as TuiOverlayOptions } from "
4
4
  /** API level of the unstable tier. Bumped only on unstable breaking changes. */
5
5
  declare const UNSTABLE_API_LEVEL: 1;
6
6
  /**
7
- * One raw terminal input chunk (plan §5). The plugin receives the RAW
8
- * bytes exactly as the terminal delivered them — no decoding, no
9
- * sanitization. `surfaceId` identifies the surface generation the chunk
10
- * arrived on.
7
+ * One normalized terminal input sequence (plan §5). The plugin receives
8
+ * the input AFTER the terminal pipeline has reassembled and normalized it
9
+ * — NOT the raw OS byte stream. The Host's input path is:
10
+ *
11
+ * ```text
12
+ * OS stdin
13
+ * → ProcessTerminal / StdinBuffer (batched chunks split into individual
14
+ * sequences; bracketed-paste content re-wrapped in its markers)
15
+ * → keyboard-protocol negotiation (Kitty flags / DA replies filtered)
16
+ * → native modifier normalization (Windows / Apple Terminal Return →
17
+ * CSI-u Shift+Enter)
18
+ * → TUI-owned query replies filtered (OSC11 background, color-scheme
19
+ * reports, cell-size responses)
20
+ * → TUI input listeners
21
+ * → THIS capture (BEFORE Host semantic routing)
22
+ * ```
23
+ *
24
+ * So the sequence is a `preHostInput` event: it can see, consume or
25
+ * rewrite anything the Host router would otherwise decode — Enter, Esc,
26
+ * Ctrl+C, bracketed paste (markers preserved), CSI-u sequences — but it
27
+ * CANNOT see the terminal-negotiation replies the TUI itself consumes
28
+ * (Kitty/DA, OSC11, color-scheme, cell-size), and it never sees raw
29
+ * multi-byte chunks mid-sequence. `surfaceId` identifies the surface
30
+ * generation the sequence arrived on.
11
31
  */
12
32
  interface UnstableRawInputEvent {
13
- /** The raw terminal data (a chunk, not necessarily one key). */
33
+ /** The normalized terminal input sequence (a sequence, not a raw chunk). */
14
34
  readonly data: string;
15
- /** The surface generation the chunk arrived on. */
35
+ /** The surface generation the sequence arrived on. */
16
36
  readonly surfaceId: string;
17
37
  }
18
38
  /** The outcome of one raw interception (plan §5). */
@@ -33,12 +53,17 @@ type UnstableRawInputResult = /** Pass the chunk through unchanged (the Host con
33
53
  type UnstableRawCaptureMode = 'observe' | 'capture' | 'exclusive';
34
54
  /**
35
55
  * One raw input capture registration (plan §5/§8). The capture is
36
- * consulted by the Host BEFORE terminal protocol decoding — it can see,
37
- * consume or rewrite ANY raw chunk, including Enter, Esc, Ctrl+C, paste,
38
- * CSI-u sequences and terminal-specific protocols. This is the Unstable
39
- * contract: a broken capture can make Host shortcuts stop working. The
40
- * ONLY Host-owned recovery is the emergency fail-safe (triple-Esc), which
41
- * the Unstable API cannot rewrite.
56
+ * consulted by the Host BEFORE semantic routing — after the terminal
57
+ * pipeline has reassembled and normalized the input (see
58
+ * {@link UnstableRawInputEvent}): it can see, consume or rewrite any
59
+ * sequence that would otherwise reach the Host router, including Enter,
60
+ * Esc, Ctrl+C, paste and CSI-u sequences. It is NOT consulted before
61
+ * terminal protocol decoding: the TUI's own negotiation replies (Kitty
62
+ * flags, DA, OSC11, color-scheme, cell-size) never reach a capture, and
63
+ * a capture cannot break the terminal negotiation. This is the Unstable
64
+ * contract: a broken capture can still make Host shortcuts stop working.
65
+ * The ONLY Host-owned recovery is the emergency fail-safe (triple-Esc),
66
+ * which the Unstable API cannot rewrite.
42
67
  *
43
68
  * Modes:
44
69
  * - `observe` — never consumes or rewrites; a pure observer.
@@ -48,8 +73,8 @@ type UnstableRawCaptureMode = 'observe' | 'capture' | 'exclusive';
48
73
  * registration is an explicit error, never a load-order winner.
49
74
  *
50
75
  * Ordering is deterministic: `priority` ASC, then `id` ASC. A throwing
51
- * handler is isolated (health ledger) and FAILS OPEN — the chunk passes
52
- * through, so a broken capture can never stall the TUI.
76
+ * handler is isolated (health ledger) and FAILS OPEN — the sequence
77
+ * passes through, so a broken capture can never stall the TUI.
53
78
  */
54
79
  interface UnstableRawInputSpec {
55
80
  /** Stable diagnostic identity, unique per owner. */
@@ -83,7 +108,9 @@ interface UnstableRawInputHandle {
83
108
  interface UnstableMountedComponent {
84
109
  /** Render the current state as raw terminal lines at the given width. */
85
110
  render(width: number): string[];
86
- /** Receive one raw input chunk while this component owns focus. */
111
+ /** Receive one normalized terminal input sequence while this component
112
+ * owns focus (the same preHostInput contract as
113
+ * {@link UnstableRawInputEvent} — never raw OS bytes). */
87
114
  handleInput?(raw: string): void;
88
115
  /** The component was disposed (mount closed / surface died). */
89
116
  dispose?(): void;
@@ -133,9 +160,10 @@ interface UnstableSurfaceHandle {
133
160
  requestRender(): void;
134
161
  /**
135
162
  * Mount a low-level component (plan §9 option A) as a capturing overlay.
136
- * The plugin renders RAW lines and receives RAW input; the Host owns
137
- * the physical mount, focus, stacking, fullscreen migration and
138
- * teardown. Caller-fiber-owned lease.
163
+ * The plugin renders RAW lines and receives the normalized input
164
+ * sequence (the preHostInput contract — see UnstableRawInputEvent;
165
+ * never raw OS bytes); the Host owns the physical mount, focus,
166
+ * stacking, fullscreen migration and teardown. Caller-fiber-owned lease.
139
167
  */
140
168
  mountComponent(component: UnstableMountedComponent, options?: TuiOverlayOptions): UnstableMountLease;
141
169
  }
@@ -1,3 +1,3 @@
1
- import { B as inject, H as PI_TUI_EXTENSIONS_SERVICE, U as API_VERSION, V as name, W as describeKey, z as apply } from "./src-syk6h8J9.mjs";
1
+ import { B as inject, H as PI_TUI_EXTENSIONS_SERVICE, U as API_VERSION, V as name, W as describeKey, z as apply } from "./src-zkySYmLZ.mjs";
2
2
  import "./startup.mjs";
3
3
  export { API_VERSION, PI_TUI_EXTENSIONS_SERVICE, apply, describeKey, inject, name };
package/dist/index.d.mts CHANGED
@@ -725,7 +725,7 @@ declare function recordedPreset(ctx: Context, sessionId: string): Promise<string
725
725
  /** The session surface {@link recomposeBlank} needs: its log and the append seam. */
726
726
  interface RecomposableSession {
727
727
  readonly id: string;
728
- readonly events: readonly SessionEvent$1[];
728
+ snapshotEvents(): readonly SessionEvent$1[];
729
729
  append(type: 'agent-preset/selected', data: {
730
730
  agentPreset: string;
731
731
  }): unknown;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as shouldConsumeAdvertisedMiss, C as normalizeSkillInvocation, D as resumeCommand, E as resolveInitialCatalog, F as teardownViewerForSessionSwap, I as viewerActionCapability, M as subagentJobTranscriptId, N as subagentJobViewHint, O as runningProfile, P as subagentNoticeIsFailure, R as forkSeed, S as name, T as recordedPreset, _ as interruptAgent, a as SessionLockRefusedError, b as isUserQueueInput, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as shouldSteerOnEnter, k as settleCompactionSurface, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as apply, p as dangerCommand, r as LOCAL_COMMANDS, s as busyAfterTurnBoundary, t as Config, u as composeAgent, v as isPlainExitPrompt, w as recomposeBlank, x as matchPendingSubagentCall, y as isSubagentSettlementNotice } from "./src-syk6h8J9.mjs";
1
+ import { A as shouldConsumeAdvertisedMiss, C as normalizeSkillInvocation, D as resumeCommand, E as resolveInitialCatalog, F as teardownViewerForSessionSwap, I as viewerActionCapability, M as subagentJobTranscriptId, N as subagentJobViewHint, O as runningProfile, P as subagentNoticeIsFailure, R as forkSeed, S as name, T as recordedPreset, _ as interruptAgent, a as SessionLockRefusedError, b as isUserQueueInput, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as shouldSteerOnEnter, k as settleCompactionSurface, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as apply, p as dangerCommand, r as LOCAL_COMMANDS, s as busyAfterTurnBoundary, t as Config, u as composeAgent, v as isPlainExitPrompt, w as recomposeBlank, x as matchPendingSubagentCall, y as isSubagentSettlementNotice } from "./src-zkySYmLZ.mjs";
2
2
  import "./startup.mjs";
3
3
  export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };