@xmoon76/dsh-pi-tui 0.4.6 → 0.4.7-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
@@ -55,10 +55,10 @@ next compatibility range, and fallback paths.
55
55
  | TUI package line | Official DSH tags for the pairing | Notes |
56
56
  |---|---|---|
57
57
  | `0.4.6` (published `@latest`) | `dsh-v0.1.5-rc.1`, `dsh-v0.1.5-rc.2` | Current stable line; rc.1 minimum, rc.2 compatible |
58
- | Current `next` npm line (this checkout; version `0.4.5`) | `dsh-v0.1.5-rc.1`, `dsh-v0.1.5-rc.2` | Current next line |
58
+ | Current `next` npm line (this checkout; version `0.4.7-alpha.2`) | `dsh-v0.1.6-alpha.2` | Current next line |
59
59
 
60
60
  Do not mix the stable and `next` lines. The current `next` checkout declares
61
- the published `0.1.5-rc.1` npm floor; older runtimes fail at the normal
61
+ the published `0.1.6-alpha.2` npm floor; older runtimes fail at the normal
62
62
  incompatible-runtime boundary. The startup notice is best-effort rather than a
63
63
  Loader startup-order guarantee. See the [full historical compatibility matrix](docs/dsh-compatibility.md)
64
64
  for official-tag pairings and fallback commands, and see the [latest `next`
@@ -114,9 +114,10 @@ dsh --profile pi-tui --session <session-id>
114
114
  * Todo / Goal status
115
115
  * Human-readable terminal window titles
116
116
  * Bounded long-session windows with stable paging and live-follow position
117
+ * Long user prompts collapse to head + marker + tail; `Ctrl+O` expands and collapses them in regular mode and in fullscreen outside Focus
117
118
  * No duplicate ghost Tool Cards after compaction / pruning
118
119
 
119
- `Ctrl+O` controls Tool and System details — and in fullscreen Focus it bulk-expands the recent Thought roots or collapses them all. `Alt+T` controls Thinking separately.
120
+ `Ctrl+O` controls Tool and System details and expands/collapses long user prompts in regular mode and in fullscreen outside Focus — in fullscreen Focus it bulk-expands the recent Thought roots or collapses them all, while long user prompts are expanded by clicking the marker (or by a search hit) and collapsed with `Ctrl+O`. `Alt+T` controls Thinking separately.
120
121
 
121
122
  ### Focus Mode
122
123
 
@@ -187,11 +188,16 @@ The browser distinguishes:
187
188
  * nested descendants
188
189
  * background Jobs
189
190
 
190
- The two views share the same runtime state: `A` toggles Active / All scope,
191
- `Tab` changes type filters, `/` enters search, `S` stops the selected task after
192
- confirmation, and `N` / `Shift+N` moves between running tasks. In Quick Tasks,
193
- `T` or the bottom “View all” row opens the full Task Center, and `Esc` returns
194
- one layer at a time.
191
+ The Footer's `↓` opens Quick Tasks as a lightweight browsing view: it only
192
+ supports arrow navigation, left/right expand/collapse, `Tab` type cycling,
193
+ `Enter` open, and `Esc` close. The bottom “Open Task Center” row opens the full
194
+ Task Center.
195
+
196
+ The full Task Center additionally offers `A` to toggle Active / All, `/` search,
197
+ `Tab` / `Shift+Tab` to cycle types in both directions, `S` to stop the selected
198
+ task after confirmation, and `R` to refresh/retry. Quick Tasks consumes only the
199
+ whitelist above; every other keystroke is a no-op that never enters search, stop
200
+ confirmation, or management state, so `Esc` always closes it in one layer.
195
201
 
196
202
  Completed one-shot Subagents remain available for persisted Transcript inspection.
197
203
 
@@ -305,8 +311,8 @@ For the full `/footer` workflow, Custom Text / Command items, YAML reference, se
305
311
  | `Ctrl+T` | Toggle the todo panel |
306
312
  | `Ctrl+R` | Search input history |
307
313
  | `Ctrl+F` | Search Transcript |
308
- | `Ctrl+End` | Jump to the latest Transcript output in fullscreen |
309
- | `Ctrl+O` | Expand / collapse Tool and System details; in fullscreen Focus, bulk-toggle the Thought roots |
314
+ | `Ctrl+End` | Jump to the latest Transcript output in fullscreen; a clickable `↓ Latest` appears after leaving the live tail |
315
+ | `Ctrl+O` | Expand / collapse Tool and System details and long user prompts in regular/fullscreen-non-Focus; in fullscreen Focus, bulk-toggle the Thought roots (expand long user prompts by clicking the marker) |
310
316
  | `Alt+T` | Expand / collapse Thinking |
311
317
  | `Ctrl+G` | Edit current input in `$VISUAL`/`$EDITOR` |
312
318
  | `Ctrl+V` | Paste image |
@@ -557,7 +563,7 @@ This section contains DSH compatibility and CI validation details only; ordinary
557
563
  ### npm mode (current `next`)
558
564
 
559
565
  The current `next` line is npm mode: it targets the published
560
- `dsh-v0.1.5-rc.1` family declared by this checkout's `package.json` and
566
+ `dsh-v0.1.6-alpha.2` family declared by this checkout's `package.json` and
561
567
  resolved by its frozen lockfile. The isolated npm driver installs that exact
562
568
  family from the public registry and exercises the TUI build/test/package path:
563
569
 
package/README.md CHANGED
@@ -53,10 +53,10 @@ pnpm compat:dsh:npm
53
53
  | TUI 包版本 | 对应的官方 DSH tags | 说明 |
54
54
  |---|---|---|
55
55
  | `0.4.6`(已发布 `@latest`) | `dsh-v0.1.5-rc.1`、`dsh-v0.1.5-rc.2` | 当前稳定版;最低 rc.1,兼容 rc.2 |
56
- | 当前 `next` npm 线(本 checkout;版本 `0.4.5`) | `dsh-v0.1.5-rc.1`、`dsh-v0.1.5-rc.2` | 当前 next 线 |
56
+ | 当前 `next` npm 线(本 checkout;版本 `0.4.7-alpha.2`) | `dsh-v0.1.6-alpha.2` | 当前 next 线 |
57
57
 
58
58
  不要把稳定线与 `next` 线混装。当前 `next` checkout 的 peer floor 是
59
- `>=0.1.5-rc.1`,旧 runtime 会在正常的不兼容边界以非零状态失败。完整的
59
+ `>=0.1.6-alpha.2`,旧 runtime 会在正常的不兼容边界以非零状态失败。完整的
60
60
  历史兼容矩阵和 fallback 命令见 [兼容性文档](docs/dsh-compatibility.md);
61
61
  要查看 next 的最新集成状态,请看 [next 分支 README](https://github.com/XMoon/dsh-pi-tui/blob/next/README.md)。
62
62
 
@@ -108,9 +108,10 @@ dsh --profile pi-tui --session <session-id>
108
108
  * Todo / Goal 状态展示
109
109
  * 可读的终端窗口标题
110
110
  * 长会话按有界窗口浏览,并保留翻页与实时跟随位置
111
+ * 超长用户 Prompt 默认折叠为 head + marker + tail;普通与全屏非 Focus 下 `Ctrl+O` 展开、收回
111
112
  * Compaction / prune 后不会出现重复的幽灵 Tool Card
112
113
 
113
- `Ctrl+O` 控制工具和系统详情;在全屏 Focus 下它整体展开最近几个 Thought root,或全部收起。`Alt+T` 单独控制 Thinking。
114
+ `Ctrl+O` 控制工具和系统详情,并在普通模式与全屏非 Focus 下展开/收起超长用户 Prompt;全屏 Focus 下它整体展开最近几个 Thought root 或全部收起,超长用户 Prompt 改用点击提示行(或搜索命中)展开、`Ctrl+O` 收回。`Alt+T` 单独控制 Thinking。
114
115
 
115
116
  ### Focus Mode
116
117
 
@@ -180,7 +181,9 @@ main
180
181
  * nested descendant
181
182
  * 后台 Job
182
183
 
183
- 两个视图共享同一份运行时状态:`A` 切换 Active / All scope,`Tab` 切换类型过滤,`/` 进入搜索,`S`(确认后)停止所选任务,`N` / `Shift+N` 在运行中的任务间跳转,Quick 内 `T` 或底部 "View all" 行进入完整 Task Center,`Esc` 逐层返回。
184
+ Footer `↓` 打开的 Quick Tasks 是轻量浏览视图,只提供方向键导航、左右展开/折叠、`Tab` 类型过滤、`Enter` 打开和 `Esc` 关闭。底部 “Open Task Center” 行可进入完整 Task Center。
185
+
186
+ 完整 Task Center 额外提供 `A` 切换 Active / All、`/` 搜索、`Tab` / `Shift+Tab` 双向切换类型、`S`(确认后)停止所选任务以及 `R` 刷新 / 重试。Quick Tasks 只消费上述白名单按键,其余输入一律 no-op,不会进入搜索、停止确认或任务管理状态,因此 `Esc` 始终一层关闭。
184
187
 
185
188
  已经结束的 one-shot Subagent 仍可以打开并查看持久化 Transcript。
186
189
 
@@ -291,8 +294,8 @@ TUI 使用 DSH 提供的模型和设置服务。
291
294
  | `Ctrl+T` | 切换 Todo 面板 |
292
295
  | `Ctrl+R` | 搜索输入历史 |
293
296
  | `Ctrl+F` | 搜索 Transcript |
294
- | `Ctrl+End` | 全屏时跳到最新 Transcript 输出 |
295
- | `Ctrl+O` | 展开 / 折叠工具和系统详情;全屏 Focus 下整体切换 Thought root |
297
+ | `Ctrl+End` | 全屏时跳到最新 Transcript 输出;离开 live tail 时底部显示可点击的 `↓ Latest` |
298
+ | `Ctrl+O` | 展开 / 折叠工具和系统详情;普通与全屏非 Focus 下展开/收起超长用户 Prompt;全屏 Focus 下整体切换 Thought root(超长用户 Prompt 用点击/搜索展开) |
296
299
  | `Alt+T` | 展开 / 折叠 Thinking |
297
300
  | `Ctrl+G` | 使用 `$VISUAL`/`$EDITOR` 编辑输入 |
298
301
  | `Ctrl+V` | 粘贴图片 |
@@ -533,7 +536,7 @@ dsh --profile pi-tui-dev
533
536
  ### npm 模式(当前 `next`)
534
537
 
535
538
  当前 `next` 线是 npm 模式:以本 checkout 的 `package.json` 声明、冻结
536
- lockfile 解析的已发布 `dsh-v0.1.5-rc.1` family 为兼容目标。隔离的 npm
539
+ lockfile 解析的已发布 `dsh-v0.1.6-alpha.2` family 为兼容目标。隔离的 npm
537
540
  驱动从公共 registry 安装该精确 family,并跑完整 build/test/package 路径:
538
541
 
539
542
  ```sh
package/cordis.patch.yml CHANGED
@@ -26,10 +26,29 @@
26
26
 
27
27
  - id: tui-app
28
28
  name: '@xmoon76/dsh-pi-tui'
29
- inject: [tuiStartup, piTuiExtensions, authorization]
29
+ # `workspaceRegistry` is injected, not merely looked up: D2.4 Direct fork
30
+ # must observe the official workspace membership, and Cordis must have
31
+ # finished the registry's one-time history bootstrap before the surface
32
+ # can fork. The row below is this bundle's own, so the dependency is
33
+ # self-contained and a profile that disables it fails loud instead of
34
+ # silently forking without workspace inheritance.
35
+ inject: [tuiStartup, piTuiExtensions, authorization, workspaceRegistry]
30
36
  config:
31
37
  sessionId: ''
32
38
 
39
+ # Host-owned workspace membership (`ctx.workspaceRegistry`): D2.4 Direct
40
+ # fork mirrors the official Host rule (use the source's directly owning
41
+ # workspace, else the nearest ancestor workspace of a subagent source) and
42
+ # attaches the child after publication. That association only exists while
43
+ # this service is mounted, so the TUI inserts the same official row the web
44
+ # bundle does (the DSH installation already ships the package). Activating
45
+ # it also performs the official one-time history bootstrap that groups
46
+ # stored Session headers by canonical cwd into durable workspace records —
47
+ # an upstream migration, not a TUI invention, and the reason the row is
48
+ # documented in docs/client-server-coupling.md.
49
+ - id: workspace
50
+ name: '@deepseek-ai/dsh-workspace'
51
+
33
52
  # The authorization seam (`ctx.authorization`): plugin-owned credential-
34
53
  # obtaining flows, one attempt per key, transport-neutral notices and
35
54
  # prompts. The dsh host does NOT mount it anywhere (the base layer ships
@@ -63,12 +82,6 @@
63
82
  - id: subagent-model-selection-settings
64
83
  name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'
65
84
 
66
- # Host-plane TypeScript runtime: the `ptc` preset's `tool-presentation`
67
- # row waits for `codeRuntime` and fails the preset at mount without it
68
- # (same host row the web bundle inserts).
69
- - id: code-runtime
70
- name: '@deepseek-ai/dsh-code-runtime-worker-thread'
71
-
72
85
  # Host-plane cordis runner: the `cordis` preset's `tool-cordis` row waits
73
86
  # for `dynamicCordisRunner`/`cordisInspect` and fails the preset at mount
74
87
  # without them (same host row the web bundle inserts).
@@ -93,7 +106,10 @@
93
106
  # goal/jobs/compaction services and
94
107
  # their host infrastructure, `permission`, `approval`, `sandbox*`,
95
108
  # `fs-observation-policy`, `spill*`, `timeout-policy`, `repeat-tool-reminder`,
96
- # `session-*`, `token-meter`. `command-goal` is disabled below and reintroduced
109
+ # `session-*`, `token-meter`. The base's official `ptc-runtime` row also stays:
110
+ # it provides `ptcRuntime`, which the `ptc` preset's `tool-presentation` row
111
+ # waits for, and this overlay owns no second PTC runtime.
112
+ # `command-goal` is disabled below and reintroduced
97
113
  # only by presets that own that command in their scoped composition.
98
114
 
99
115
  - id: tool-bash
@@ -147,7 +163,7 @@
147
163
  - id: tool-subagent-fork
148
164
  disabled: true
149
165
 
150
- - id: workflow-worker-thread
166
+ - id: workflow-ptc
151
167
  disabled: true
152
168
 
153
169
  - id: tool-workflow
package/dist/builtins.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { W as PI_TUI_EXTENSIONS_SERVICE, z as dshVersion } from "./src-DNscMTdx.mjs";
2
- import { TUI_STARTUP_SERVICE } from "./startup.mjs";
1
+ import { B as PI_TUI_EXTENSIONS_SERVICE, I as dshVersion } from "./src-5aY9svZj.mjs";
2
+ import { n as TUI_STARTUP_SERVICE } from "./startup-CGeJ1k1B.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  //#region src/builtins.ts
@@ -1,3 +1,2 @@
1
- import { G as API_VERSION, H as inject, K as describeKey, U as name, V as apply, W as PI_TUI_EXTENSIONS_SERVICE } from "./src-DNscMTdx.mjs";
2
- import "./startup.mjs";
1
+ import { B as PI_TUI_EXTENSIONS_SERVICE, H as describeKey, L as apply, R as inject, V as API_VERSION, z as name } from "./src-5aY9svZj.mjs";
3
2
  export { API_VERSION, PI_TUI_EXTENSIONS_SERVICE, apply, describeKey, inject, name };
package/dist/index.d.mts CHANGED
@@ -2,10 +2,8 @@ import { H as TuiAction } from "./public-types-YbB5Rhku.mjs";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { Agent, ModelSelectionRef } from "@deepseek-ai/dsh-agent";
4
4
  import { ContentBlock } from "@deepseek-ai/dsh-llm";
5
- import { SessionEvent, SessionId } from "@deepseek-ai/dsh-session";
6
- import { CommandDescriptor } from "@deepseek-ai/dsh-commands";
5
+ import { SessionId } from "@deepseek-ai/dsh-session";
7
6
  import { Context } from "@deepseek-ai/cordis";
8
- import { SessionEvent as SessionEvent$1 } from "@deepseek-ai/dsh-session/types";
9
7
  //#region src/image/admission.d.ts
10
8
  /** Structural subset of `ImageAttachmentRef`. */
11
9
  interface ImageAttachmentRefLike {
@@ -114,6 +112,8 @@ interface HumanSkillSummary {
114
112
  readonly name: string;
115
113
  readonly description: string;
116
114
  readonly whenToUse?: string;
115
+ /** Official model-invocation capability; Host-local paths are omitted. */
116
+ readonly modelInvocable?: boolean;
117
117
  }
118
118
  /** The detached human skill catalog one observation produced. */
119
119
  interface HumanSkillCatalog {
@@ -147,23 +147,47 @@ type CompactionPhase = 'idle' | 'summarizing' | 'applying';
147
147
  * accelerated chord to its OPPOSITE — so the chord is never a fixed mode.
148
148
  */
149
149
  type ComposerSubmitGesture = 'enter' | 'accelerated';
150
- /** One queued inbox row for the queue pane (mirrors the agent Inbox's lists). */
150
+ /** One semantic queued pending-input row for the queue pane. */
151
151
  interface QueueItem {
152
- /** The pending message id (agent inbox identity). */
152
+ /** The pending message id (agent inbox identity), or a local request id. */
153
153
  id: string;
154
154
  /** The message text, single-line display form. */
155
155
  text: string;
156
156
  /** next-turn followup vs next-step steer. */
157
157
  mode: 'followup' | 'steer';
158
- /** Plugin notice (e.g. a background-job completion): NOT steerable — it
159
- * renders with its own marker and the hint drops the steer verbs. */
160
- notice?: boolean;
158
+ /** The correlation identity (authoritative rpc id or local request id). */
159
+ rpcId?: string;
160
+ /** A client-local echo not yet backed by an authoritative occurrence. */
161
+ local?: boolean;
161
162
  }
162
163
  //#endregion
163
164
  //#region src/surface-catalog.d.ts
165
+ /** Minimal live-agent face consumed by the effective catalog readers. */
166
+ interface SurfaceCatalogAgent {
167
+ readonly ctx: object;
168
+ readonly session: {
169
+ readonly header: {
170
+ readonly cwd?: string;
171
+ };
172
+ };
173
+ }
174
+ /** Local structural command face, compatible with both npm and Source Mode DSH.
175
+ * The optional identity is part of the official 0.1.6 descriptor; an older
176
+ * runtime's descriptor may omit it. */
177
+ interface SurfaceCommandDescriptor {
178
+ readonly definitionId?: string;
179
+ readonly name: string;
180
+ readonly description: string;
181
+ readonly input?: {
182
+ readonly hint: string;
183
+ readonly attachments?: boolean;
184
+ };
185
+ }
164
186
  /** One effective command's discovery metadata (the official descriptor's
165
- * display fields; never a handler or a definition). */
187
+ * display fields and optional stable identity; never a handler or definition). */
166
188
  interface SurfaceCommandSummary {
189
+ /** Stable plugin-owned identity from the official command descriptor. */
190
+ readonly definitionId?: string;
167
191
  readonly name: string;
168
192
  readonly description: string;
169
193
  readonly input?: {
@@ -196,7 +220,7 @@ interface SurfaceCatalogSnapshot {
196
220
  }
197
221
  /** The commands-service surface the collector reads. */
198
222
  interface SurfaceCommandsService {
199
- list(agent: Agent): readonly CommandDescriptor[];
223
+ list(agent: SurfaceCatalogAgent): readonly SurfaceCommandDescriptor[];
200
224
  }
201
225
  /** The narrow context surface {@link readSurfaceCatalog} consumes. The
202
226
  * SKILL services are NOT reached here: every dsh skill/agent-presets
@@ -207,12 +231,6 @@ interface SurfaceCatalogContext {
207
231
  }
208
232
  //#endregion
209
233
  //#region src/commands.d.ts
210
- /** A balanced completed-turn prefix for forking: the log up to (and including)
211
- * the last `turn/end`. Undefined when no turn has completed yet.
212
- * @param events - the session log.
213
- * @returns the fork seed events, or undefined.
214
- */
215
- declare function forkSeed(events: readonly SessionEvent[]): readonly SessionEvent[] | undefined;
216
234
  /**
217
235
  * The effective mode ONE submission resolved at the submit boundary: whether
218
236
  * an agent-facing delivery steers into the running turn or queues behind it
@@ -427,6 +445,31 @@ declare function normalizeSkillInvocation(text: string): string | undefined;
427
445
  declare function shouldConsumeAdvertisedMiss(execution: {
428
446
  readonly result: unknown;
429
447
  } | undefined, wasAdvertised: boolean): boolean;
448
+ /** Public settlement shape for the interrupt helper. Kept local so the
449
+ * entry-point declaration does not expose the internal runtime port module. */
450
+ type InterruptWriteOutcome = {
451
+ readonly kind: 'committed';
452
+ readonly value: undefined;
453
+ } | {
454
+ readonly kind: 'rejected';
455
+ readonly error: {
456
+ readonly code: string;
457
+ readonly message: string;
458
+ readonly details?: Readonly<Record<string, unknown>>;
459
+ };
460
+ } | {
461
+ readonly kind: 'cancelled';
462
+ } | {
463
+ readonly kind: 'indeterminate';
464
+ readonly error: {
465
+ readonly code: string;
466
+ readonly message: string;
467
+ readonly details?: Readonly<Record<string, unknown>>;
468
+ };
469
+ } | {
470
+ readonly kind: 'unsupported';
471
+ readonly reason: string;
472
+ };
430
473
  /** The live-agent surface {@link interruptAgent} needs (structural — the
431
474
  * TUI never imports the agent runtime for this call). */
432
475
  interface InterruptAgentLike {
@@ -444,11 +487,7 @@ interface InterruptAgentLike {
444
487
  * type so the public declaration never inlines internal runtime modules;
445
488
  * the runner's SessionWriter satisfies it). */
446
489
  interface InterruptWriterLike {
447
- cancel(sessionId: string, reason: {
448
- kind: 'user';
449
- }, options: {
450
- keepInbox: boolean;
451
- }): void;
490
+ cancel(sessionId: string): Promise<InterruptWriteOutcome>;
452
491
  }
453
492
  /**
454
493
  * Interrupt the live agent (web Stop parity): abort the current
@@ -469,7 +508,7 @@ interface InterruptWriterLike {
469
508
  * log, which the design explicitly rejects — the parked queue is the
470
509
  * agreed web-parity behavior until upstream lands the capability.
471
510
  */
472
- declare function interruptAgent(agent: InterruptAgentLike | undefined, writer: InterruptWriterLike): void;
511
+ declare function interruptAgent(agent: InterruptAgentLike | undefined, writer: InterruptWriterLike): Promise<InterruptWriteOutcome>;
473
512
  /** One unsettled subagent delegation, in tool/call order. */
474
513
  interface PendingSubagentCall {
475
514
  readonly callId: string;
@@ -594,30 +633,18 @@ interface ResolveInitialCatalogOptions {
594
633
  }
595
634
  declare function resolveInitialCatalog(options: ResolveInitialCatalogOptions): Promise<InitialCatalogResolution>;
596
635
  declare function subagentJobTranscriptId(snapshot: unknown): string | undefined;
597
- /** Viewer body for a subagent job with no uniquely matched child. */
598
- declare function subagentJobViewHint(status: string, detail: string | undefined): string;
599
- /** The message-source projection the queue filter reads (a structural subset
600
- * of dsh's message sources, so the helpers are testable without dsh types). */
601
- interface QueueNoticeSource {
602
- readonly form?: string;
603
- readonly kind?: string;
604
- readonly summary?: string;
605
- /** The reporting child's session id (subagent-report relays). */
606
- readonly senderSessionId?: string;
607
- }
608
636
  /**
609
- * Whether an inbox message is USER-ORIGIN input — the queue pane's steerable
610
- * `❯` rows. Everything else is injected context, not the user's own queued
611
- * input, and must never read as one: plugin notices (background-job
612
- * completions), `subagent-report` relays (a child's active report, e.g.
613
- * "Background subagent X reported:"), injected skill/agent instructions,
614
- * goal messages. The web makes the same cut (`placement: source.kind ===
615
- * 'user' ? 'steering' : 'context'`), and this deployment's queue pane has
616
- * the same rule: only user-origin rows are steerable. A sourceless row
617
- * (undefined) is treated as user input — plain rows never carry a source.
618
- * @param source - the message source projection, or undefined for a plain row.
637
+ * The Task Center row-selection disposition (plan §4.3/§4.4). A subagent
638
+ * transcript opens a session/viewer surface that REPLACES the browser; a
639
+ * Job row's detail keeps it mounted (the caller passes {@link openJobView}'s
640
+ * disposition). An UNKNOWN row — a stale panel selection after a live
641
+ * re-projection — also keeps the parent usable instead of dismissing it.
619
642
  */
620
- declare function isUserQueueInput(source: QueueNoticeSource | undefined): boolean;
643
+ declare function taskRowSelectionDisposition(row: {
644
+ readonly kind: 'job' | 'subagent';
645
+ } | undefined, jobDetail: 'close' | 'keep-open'): 'close' | 'keep-open';
646
+ /** Viewer body for a subagent job with no uniquely matched child. */
647
+ declare function subagentJobViewHint(status: string, detail: string | undefined): string;
621
648
  /**
622
649
  * Whether a plain submitted draft is the quit word: exactly `exit` (trimmed,
623
650
  * lowercase). The runner intercepts this BEFORE any session creation or
@@ -626,47 +653,18 @@ declare function isUserQueueInput(source: QueueNoticeSource | undefined): boolea
626
653
  * @param text - the submitted draft.
627
654
  */
628
655
  declare function isPlainExitPrompt(text: string): boolean;
629
- /**
630
- * Whether an inbox message is a BACKGROUND-SUBAGENT settlement notice — the
631
- * runtime's account of a child ending, not steerable user input. Two dsh
632
- * producers push these into the parent's inbox:
633
- * - continuable children: `source.kind === 'subagent-settled'` (the
634
- * continuation manager's settlement notice);
635
- * - one-shot background subagent jobs: tool-jobs completion notices whose
636
- * summary starts with the job kind (`subagent <label> [status: …]`).
637
- * The queue pane mirrors the inbox, but these belong to the task browser
638
- * (terminal job rows / inactive child rows), so the mirror drops them and
639
- * only failures surface as a transient error notify.
640
- * @param source - the message source projection, or undefined for a plain row.
641
- */
642
- declare function isSubagentSettlementNotice(source: QueueNoticeSource | undefined): boolean;
643
- /**
644
- * Whether a subagent settlement notice reports FAILURE, classified on the
645
- * producers' own deterministic wording:
646
- * - `subagent-settled` summaries: "finished and will do no further work"
647
- * is the only success wording; aborted / max-tokens / refusal / error /
648
- * unknown endings all fail;
649
- * - tool-jobs subagent summaries carry the terminal status line, whose
650
- * failure statuses are `failed` and `killed` (dsh JobStatus).
651
- * A notice that cannot be classified is treated as success (silent).
652
- * @param source - the message source projection.
653
- */
654
- declare function subagentNoticeIsFailure(source: QueueNoticeSource | undefined): boolean;
655
- /** One inbox message as the queue mirror sees it (a structural projection). */
656
+ /** One semantic pending-input item as the queue mirror sees it. */
656
657
  interface QueueInboxMessage {
657
658
  readonly id: string;
658
659
  readonly content: readonly ContentBlock[];
659
- readonly source?: QueueNoticeSource;
660
660
  }
661
- /** The mirror result for one inbox batch: the rows to show plus the failed
662
- * settlement summaries the caller should notify (each once). */
661
+ /** The queue-pane rows for one semantic pending-input batch. */
663
662
  interface QueueFoldResult {
664
- /** Queue rows (background-subagent settlement notices excluded). */
665
663
  readonly rows: QueueItem[];
666
- /** Failed settlement summaries not yet notified (the caller notifies). */
667
- readonly failures: readonly string[];
668
664
  }
669
- declare function foldQueueRows(messages: readonly QueueInboxMessage[], mode: 'followup' | 'steer', notified: Set<string>): QueueFoldResult;
665
+ /** Build queue-pane rows from semantic pending-input occurrences, preserving
666
+ * their order and content without inspecting backend-specific metadata. */
667
+ declare function foldQueueRows(messages: readonly QueueInboxMessage[], mode: 'followup' | 'steer'): QueueFoldResult;
670
668
  /**
671
669
  * Whether a shell command matches a destructive pattern. `rm` is treated
672
670
  * specially: any spelling of recursive + force flags (`rm -rf`, `rm -r -f`,
@@ -826,45 +824,13 @@ declare function composeAgent(ctx: Context, installSelection: (agentCtx: Context
826
824
  enabled: boolean;
827
825
  }, diag?: Diag): Promise<AgentComposition>;
828
826
  /**
829
- * The preset a persisted session actually runs, read from DSH 0.1.5-rc.1's
830
- * V3 session projection (header initialization plus the latest selection event).
827
+ * The preset a persisted session actually runs, read from the DSH 0.1.6 V3
828
+ * session projection (header initialization plus the latest selection event).
831
829
  * @param ctx - the runner context.
832
830
  * @param sessionId - the persisted session id.
833
831
  * @returns the recorded preset id, or undefined to compose the default.
834
832
  */
835
833
  declare function recordedPreset(ctx: Context, sessionId: string): Promise<string | undefined>;
836
- /** The session surface {@link recomposeBlank} needs: its log and the append seam. */
837
- interface RecomposableSession {
838
- readonly id: string;
839
- snapshotEvents(): readonly SessionEvent$1[];
840
- append(type: 'agent-preset/selected', data: {
841
- agentPreset: string;
842
- }): unknown;
843
- }
844
- /** Outcome of {@link recomposeBlank}: the swap committed, or the session is locked. */
845
- type RecomposeOutcome = {
846
- kind: 'switched';
847
- preset: string;
848
- } | {
849
- kind: 'locked';
850
- };
851
- /**
852
- * Re-compose one agent onto another preset while its session is still blank.
853
- *
854
- * A started conversation's history was produced under its preset's tools, so
855
- * only a session with no `turn/start` event may swap — the same rule as the
856
- * official `agentPreset.select` RPC. The selection is appended to the log only
857
- * after the swap committed (a rejected mount leaves the old composition).
858
- * @param ctx - the runner context.
859
- * @param agent - the live agent whose composition to swap.
860
- * @param id - the target preset id.
861
- * @returns `switched` with the committed preset id, or `locked` when a turn has run.
862
- * @throws when the roster supplies no such preset or its composition is unusable.
863
- */
864
- declare function recomposeBlank(ctx: Context, agent: {
865
- ctx: Context;
866
- session: RecomposableSession;
867
- }, id: string): Promise<RecomposeOutcome>;
868
834
  /**
869
835
  * Mount the TUI: resolve the model selection, create or resume the agent,
870
836
  * wire the surface to the agent, and subscribe to the session firehose.
@@ -873,4 +839,4 @@ declare function recomposeBlank(ctx: Context, agent: {
873
839
  */
874
840
  declare function apply(ctx: Context, config: Config): void;
875
841
  //#endregion
876
- export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, ViewerOpenToken, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };
842
+ export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriteOutcome, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, ViewerOpenToken, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };
package/dist/index.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { A as resumeCommand, B as forkSeed, C as matchPendingSubagentCall, D as recordedPreset, E as recomposeBlank, F as subagentJobViewHint, I as subagentNoticeIsFailure, L as teardownViewerForSessionSwap, M as settleCompactionSurface, N as shouldConsumeAdvertisedMiss, O as resolveInitialCatalog, P as subagentJobTranscriptId, R as viewerActionCapability, S as isUserQueueInput, T as normalizeSkillInvocation, _ as interruptAgent, a as apply, b as isPlainExitPrompt, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as runningProfile, k as resolveSubmitDelivery, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as busyAfterTurnBoundary, p as dangerCommand, r as LOCAL_COMMANDS, s as commandIsLocalForAttachments, t as Config, u as composeAgent, v as isBareCommandLine, w as name, x as isSubagentSettlementNotice, y as isLocalCommandLine } from "./src-DNscMTdx.mjs";
2
- import "./startup.mjs";
3
- export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };
1
+ import { A as shouldConsumeAdvertisedMiss, C as normalizeSkillInvocation, D as resumeCommand, E as resolveSubmitDelivery, F as viewerActionCapability, M as subagentJobViewHint, N as taskRowSelectionDisposition, O as runningProfile, P as teardownViewerForSessionSwap, S as name, T as resolveInitialCatalog, _ as interruptAgent, a as apply, b as isPlainExitPrompt, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as subagentJobTranscriptId, k as settleCompactionSurface, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as busyAfterTurnBoundary, p as dangerCommand, r as LOCAL_COMMANDS, s as commandIsLocalForAttachments, t as Config, u as composeAgent, v as isBareCommandLine, w as recordedPreset, x as matchPendingSubagentCall, y as isLocalCommandLine } from "./src-5aY9svZj.mjs";
2
+ export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };