@itookit/dsht 0.3.8 → 0.5.1

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.
Files changed (130) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +30 -11
  3. package/README.zh.md +30 -11
  4. package/dist/cli/dsht.js +203 -18
  5. package/dist/cli/startup.d.ts +40 -0
  6. package/dist/cli/startup.js +295 -0
  7. package/dist/cli/trace-summary.d.ts +78 -0
  8. package/dist/cli/trace-summary.js +241 -0
  9. package/dist/cli/verifier.d.ts +60 -0
  10. package/dist/cli/verifier.js +242 -0
  11. package/dist/contracts.d.ts +344 -0
  12. package/dist/contracts.js +1 -0
  13. package/dist/controller/commands.d.ts +47 -0
  14. package/dist/controller/commands.js +322 -0
  15. package/dist/controller/connection.d.ts +11 -29
  16. package/dist/controller/connection.js +26 -60
  17. package/dist/controller/controller.d.ts +616 -166
  18. package/dist/controller/controller.js +1395 -146
  19. package/dist/controller/index.d.ts +8 -1
  20. package/dist/controller/index.js +5 -0
  21. package/dist/controller/loop-contract.d.ts +136 -0
  22. package/dist/controller/loop-contract.js +308 -0
  23. package/dist/controller/loop-prompts-schema.d.ts +56 -0
  24. package/dist/controller/loop-prompts-schema.js +144 -0
  25. package/dist/controller/loop-prompts.d.ts +55 -0
  26. package/dist/controller/loop-prompts.generated.d.ts +104 -0
  27. package/dist/controller/loop-prompts.generated.js +185 -0
  28. package/dist/controller/loop-prompts.js +104 -0
  29. package/dist/controller/loop-protocols.d.ts +39 -0
  30. package/dist/controller/loop-protocols.js +115 -0
  31. package/dist/controller/loop.d.ts +275 -0
  32. package/dist/controller/loop.js +378 -0
  33. package/dist/controller/prompts.d.ts +54 -0
  34. package/dist/controller/prompts.js +162 -0
  35. package/dist/controller/trace-log.d.ts +45 -0
  36. package/dist/controller/trace-log.js +144 -0
  37. package/dist/controller/verifier.d.ts +126 -0
  38. package/dist/controller/verifier.js +75 -0
  39. package/dist/cost/index.d.ts +1 -1
  40. package/dist/cost/index.js +1 -1
  41. package/dist/cost/ledger.d.ts +0 -1
  42. package/dist/cost/ledger.js +0 -1
  43. package/dist/json.d.ts +18 -0
  44. package/dist/json.js +19 -0
  45. package/dist/references.d.ts +25 -0
  46. package/dist/references.js +26 -0
  47. package/dist/session/connection-view.d.ts +2 -11
  48. package/dist/session/controller.d.ts +73 -72
  49. package/dist/session/controller.js +185 -209
  50. package/dist/session/history.d.ts +6 -18
  51. package/dist/session/history.js +1 -24
  52. package/dist/session/index.d.ts +9 -4
  53. package/dist/session/index.js +7 -3
  54. package/dist/session/info.d.ts +25 -52
  55. package/dist/session/info.js +39 -25
  56. package/dist/session/markdown.js +1 -1
  57. package/dist/session/math.js +1 -1
  58. package/dist/session/mutation-gate.d.ts +51 -0
  59. package/dist/session/mutation-gate.js +73 -0
  60. package/dist/session/navigation.d.ts +2 -89
  61. package/dist/session/navigation.js +2 -129
  62. package/dist/session/peek.d.ts +38 -0
  63. package/dist/session/peek.js +103 -0
  64. package/dist/session/references.d.ts +2 -20
  65. package/dist/session/references.js +1 -26
  66. package/dist/session/runtime.d.ts +26 -0
  67. package/dist/session/runtime.js +28 -0
  68. package/dist/session/telemetry.d.ts +12 -13
  69. package/dist/session/telemetry.js +27 -58
  70. package/dist/session/transcript.d.ts +0 -6
  71. package/dist/session/transcript.js +2 -15
  72. package/dist/session/types.d.ts +25 -0
  73. package/dist/session/types.js +0 -1
  74. package/dist/session-title.d.ts +9 -0
  75. package/dist/session-title.js +21 -0
  76. package/dist/shell/controller.d.ts +31 -1
  77. package/dist/shell/controller.js +34 -2
  78. package/dist/shell/index.d.ts +3 -3
  79. package/dist/shell/index.js +2 -2
  80. package/dist/shell/runner.d.ts +10 -0
  81. package/dist/shell/runner.js +48 -9
  82. package/dist/slash/index.d.ts +10 -0
  83. package/dist/slash/index.js +7 -0
  84. package/dist/slash/parse.d.ts +166 -0
  85. package/dist/slash/parse.js +259 -0
  86. package/dist/slash/pipeline.d.ts +140 -0
  87. package/dist/slash/pipeline.js +115 -0
  88. package/dist/slash/registry.d.ts +88 -0
  89. package/dist/slash/registry.js +177 -0
  90. package/dist/state.d.ts +14 -4
  91. package/dist/state.js +3 -2
  92. package/dist/text.d.ts +28 -0
  93. package/dist/text.js +55 -0
  94. package/dist/transport/events.d.ts +104 -0
  95. package/dist/transport/events.js +149 -0
  96. package/dist/transport/wire.d.ts +9 -17
  97. package/dist/transport/wire.js +2 -27
  98. package/dist/ui/app.js +856 -441
  99. package/dist/ui/chat/header.js +1 -1
  100. package/dist/ui/chat/history-view.d.ts +1 -1
  101. package/dist/ui/chat/loop-status.d.ts +11 -0
  102. package/dist/ui/chat/loop-status.js +28 -0
  103. package/dist/ui/chat/navigation-model.d.ts +86 -0
  104. package/dist/ui/chat/navigation-model.js +107 -0
  105. package/dist/ui/chat/shell-view.d.ts +15 -2
  106. package/dist/ui/chat/shell-view.js +37 -3
  107. package/dist/ui/chat/status.d.ts +47 -3
  108. package/dist/ui/chat/status.js +65 -50
  109. package/dist/ui/chat/viewport.d.ts +1 -1
  110. package/dist/ui/dialogs/cost.d.ts +21 -4
  111. package/dist/ui/dialogs/cost.js +7 -12
  112. package/dist/ui/dialogs/index.d.ts +22 -5
  113. package/dist/ui/dialogs/index.js +19 -3
  114. package/dist/ui/dialogs/loop.d.ts +43 -0
  115. package/dist/ui/dialogs/loop.js +224 -0
  116. package/dist/ui/dialogs/peek.d.ts +25 -0
  117. package/dist/ui/dialogs/peek.js +35 -0
  118. package/dist/ui/dialogs/picker.d.ts +2 -0
  119. package/dist/ui/dialogs/picker.js +4 -2
  120. package/dist/ui/input/mouse.d.ts +12 -2
  121. package/dist/ui/input/mouse.js +20 -7
  122. package/dist/ui/input/references.d.ts +1 -1
  123. package/dist/ui/status/model.d.ts +7 -0
  124. package/dist/ui/status/model.js +5 -0
  125. package/dist/ui/theme/index.d.ts +1 -1
  126. package/package.json +6 -4
  127. package/dist/ui/commands/parse.d.ts +0 -104
  128. package/dist/ui/commands/parse.js +0 -135
  129. package/dist/ui/commands/registry.d.ts +0 -33
  130. package/dist/ui/commands/registry.js +0 -73
@@ -0,0 +1,344 @@
1
+ /** The plain contract the UI reads: types and nothing else.
2
+ *
3
+ * Leaf components import their props from here instead of reaching into a feature, so the boundary
4
+ * between presentation and the domain stays a type-only dependency. Anything this file needs at
5
+ * runtime belongs in a view model next to the component that renders it.
6
+ */
7
+ import type { Transcript } from './session/transcript.ts';
8
+ export type { Json, ObjectValue } from './json.ts';
9
+ export type { HistoryRow, Reasoning, RowKind, SessionRender } from './session/history.ts';
10
+ export type { Transcript } from './session/transcript.ts';
11
+ export type { LivePhase, Message } from './session/transcript.ts';
12
+ export type { FileReference } from './references.ts';
13
+ export type { HistorySearch, RemovalTarget } from './session/types.ts';
14
+ export type { QueuedInput } from './session/telemetry.ts';
15
+ export type { ModelState, PanelState } from './session/info.ts';
16
+ export type { CostTotal, Coverage } from './cost/index.ts';
17
+ export type { ShellBlock } from './shell/index.ts';
18
+ import type { ModelState, PanelState } from './session/info.ts';
19
+ import type { RemovalTarget } from './session/types.ts';
20
+ /** One user-saved shortcut prompt; the client owns the list, no session or host does. */
21
+ export interface SavedPrompt {
22
+ id: string;
23
+ text: string;
24
+ }
25
+ /** One panel-like surface the reader can see; the application names it, the UI renders it. */
26
+ export type PanelName = 'help' | 'cost' | 'status' | 'queue' | 'prompts' | 'thoughts' | 'history' | 'search' | 'model' | 'removal' | 'loop';
27
+ /** One `loop.yaml` record as the record list offers it.
28
+ *
29
+ * The name is what `/loop` runs; the rest is what a chooser shows about it, plus the defaults a run
30
+ * started from this record would use. The application reads them from the same records the runner
31
+ * does, so the list can never advertise a default the run would not apply.
32
+ */
33
+ export interface LoopRecord {
34
+ /** Record key in `loop.yaml`, the name `/loop` takes. */
35
+ name: string;
36
+ /** Rendered label of the record, e.g. `Design review` or `Designdoc review · tui-design.md`. */
37
+ title: string;
38
+ /** Rounds the record defines, which a full run ends on. */
39
+ steps: number;
40
+ /** Workspace file the rounds maintain, when the record declares one. */
41
+ artifact?: string;
42
+ /** Passing score used when nothing overrides it. */
43
+ defaultScore: number;
44
+ /** Attempts per round used when nothing overrides it. */
45
+ defaultTries: number;
46
+ /** Fixed inputs the record's templates use, with the values a run starts from.
47
+ *
48
+ * The form offers one editable row per name, so a record whose inputs are part of the task (the
49
+ * document under review, a target, a threshold) is retargeted without editing `loop.yaml`.
50
+ */
51
+ vars: Readonly<Record<string, string>>;
52
+ }
53
+ /** The four numbers one loop run uses.
54
+ *
55
+ * The parameter form edits them and `resolveLoop` settles them from the record's defaults, so both
56
+ * sides of `/loop` speak one shape. Declared here because a UI leaf may read the contract but not the
57
+ * application that runs the loop.
58
+ */
59
+ export interface LoopLimits {
60
+ from: number;
61
+ to: number;
62
+ score: number;
63
+ tries: number;
64
+ }
65
+ /** Which kind of thing a read-only view can show. */
66
+ export type OutputSourceKind = 'session' | 'local';
67
+ /** One readable output source: a session this client can follow, or a local run it already holds.
68
+ *
69
+ * The lineage is the point: a source says who created it (`createdBy`) and which session owns it
70
+ * (`parentSessionId`), so a viewer never has to guess why a session exists. Host-created children are
71
+ * found in the session list (`origin`/`parentSessionId`); children this client created are registered
72
+ * by the application, because the host has no way to record a client-made link.
73
+ */
74
+ export interface OutputSource {
75
+ /** Stable identity the front end clicks and the application opens. */
76
+ readonly id: string;
77
+ readonly kind: OutputSourceKind;
78
+ /** What a list and the view header call it, e.g. the record's title or `! command`. */
79
+ readonly label: string;
80
+ readonly state: 'running' | 'ended';
81
+ /** When it began, when known; a host list row carries only `updatedAt`, so this can be absent. */
82
+ readonly startedAt?: number;
83
+ readonly endedAt?: number;
84
+ /** Who created it, when this client knows. */
85
+ readonly createdBy: 'verifier' | 'shell' | 'agent' | 'unknown';
86
+ /** Session that owns it: the reviewed session for a verifier, the typed session for `!`. */
87
+ readonly parentSessionId?: string;
88
+ /** One extra line for the header, such as which verifier produced the session. */
89
+ readonly detail?: string;
90
+ }
91
+ /** What the read-only view renders: one source, and its content in whatever form it has. */
92
+ export interface PeekSnapshot {
93
+ readonly source: OutputSource;
94
+ /** Followed session content, when the source is a session and the host has answered. */
95
+ readonly transcript?: Transcript;
96
+ /** Plain lines a local source already holds, oldest first. */
97
+ readonly lines?: readonly string[];
98
+ /** Set when the source could not be read at all. */
99
+ readonly error?: string;
100
+ }
101
+ /** What one operator-driven foreground operation is doing.
102
+ *
103
+ * The kind is diagnostic and presentational: the front end shows the label, and the trace records what
104
+ * the client was busy with. It never decides policy — that is the command's own declared policy (§3.4).
105
+ */
106
+ export type ForegroundKind = 'navigation' | 'picker' | 'removal' | 'prompt' | 'interaction' | 'history' | 'search' | 'command' | 'export' | 'model' | 'cost' | 'loop' | 'verifier' | 'handoff' | 'local';
107
+ /** The one operation that owns the client right now, as a view renders it.
108
+ *
109
+ * There is at most one: the slot serializes what the operator is doing, which is a different question
110
+ * from the session write order (§6.3) — a read takes this slot too. The controller owns the slot, its
111
+ * abort controller and its identity, so "what is running, and how do I cancel it" has one answer.
112
+ */
113
+ export interface ForegroundSnapshot {
114
+ /** Monotonic identity, so a view can tell two operations apart. */
115
+ readonly id: number;
116
+ readonly kind: ForegroundKind;
117
+ /** Label the front end shows while it runs. */
118
+ readonly label: string;
119
+ /** Epoch the operation started, for a clock and for the trace. */
120
+ readonly startedAt: number;
121
+ }
122
+ /** What one still-running loop is waiting on.
123
+ *
124
+ * The controller decides this; a view only renders it. `turn` and `verify` are the two ways a round
125
+ * is judged (the reviewed session's own turn, or a forked verifier), and `settle` is the gap between
126
+ * a finished turn and the attempt being consumed, when the result block may still be arriving.
127
+ */
128
+ export type LoopActivity = 'turn' | 'verify' | 'settle';
129
+ /** What the client is working on right now.
130
+ *
131
+ * The controller merges the host turn and any running loop into this one answer, so a status bar
132
+ * never has to decide what "busy" means or where its clock starts.
133
+ */
134
+ export type ClientActivity = {
135
+ kind: 'turn';
136
+ since?: number;
137
+ } | {
138
+ kind: 'loop';
139
+ activity: LoopActivity;
140
+ title: string;
141
+ step: number;
142
+ total: number;
143
+ startedAt: number;
144
+ }
145
+ /** A run that stopped to ask the operator something: nothing is working, so there is no clock. */
146
+ | {
147
+ kind: 'paused';
148
+ title: string;
149
+ step: number;
150
+ total: number;
151
+ };
152
+ /** Why one loop run reached a terminal phase.
153
+ *
154
+ * Recorded once, when the run stops; it answers "who or what ended it" without overloading `phase`
155
+ * (which already says what the outcome was). A cancelled run and a verifier that needs a person are
156
+ * different facts and must not share a field.
157
+ */
158
+ export type LoopTerminalReason = 'user-cancelled' | 'turn-cancelled' | 'send-rejected' | 'verifier-needs-human' | 'verifier-unavailable' | 'deadline' | 'pass' | 'exhausted' | 'stalled' | 'blocked' | 'replaced';
159
+ /** Progress of a client-driven agent loop, as the UI reads it.
160
+ *
161
+ * One snapshot serves every protocol (`/loop <name>` and its records): the application
162
+ * owns the loop, the UI only renders this line.
163
+ */
164
+ export interface LoopProgress {
165
+ /** Identity of this run; stable across reconnect, session and generation changes. */
166
+ runId: string;
167
+ /** Protocol label, such as `Design review`. */
168
+ title: string;
169
+ /** Epoch when this run started, so the status bar can clock it like a turn while it works. */
170
+ startedAt: number;
171
+ /** First and last step of the run. */
172
+ from: number;
173
+ to: number;
174
+ /** Steps the protocol defines, so `from`/`to` can be told apart from the whole record. */
175
+ total: number;
176
+ /** Which rounds this run covers, e.g. `rounds 1–10/10` or `rounds 1–3/10 · selected range`. */
177
+ scope: string;
178
+ /** Passing score per step and the attempt budget per step. */
179
+ score: number;
180
+ tries: number;
181
+ /** Step and attempt in flight, both 1-based. */
182
+ step: number;
183
+ attempt: number;
184
+ /** What this step is about, when the protocol names its steps. */
185
+ stepLabel?: string;
186
+ /** Best score seen in the current step. */
187
+ best: number;
188
+ /** One line about how the last attempt was decided, when there is something to say. */
189
+ note?: string;
190
+ /** What the run is waiting on while it is still running; absent once it has stopped.
191
+ *
192
+ * `phase` says whether the run lives and how it ended; this says what the live run is doing, which
193
+ * is the part a status bar needs and the part a view cannot infer from a free-text note.
194
+ */
195
+ activity?: LoopActivity;
196
+ /** Whether the run is still going.
197
+ *
198
+ * This is the **only** predicate concurrency and authorization may read: a snapshot can outlive the
199
+ * run (the terminal progress line stays visible), so "the snapshot exists" never means "it runs".
200
+ */
201
+ active: boolean;
202
+ /** Why the run stopped, once it has; absent while it is still running. */
203
+ terminalReason?: LoopTerminalReason;
204
+ /** `running` while the loop runs; `blocked` means the verifier proved the task impossible, and
205
+ * `stalled` that another attempt would only repeat the previous verdict. */
206
+ /** `unavailable` means the verifier could not judge, so no attempt was spent on a score. */
207
+ /** `needs-human` means the verifier stopped on a host approval or question it cannot answer. */
208
+ phase: 'running' | 'passed' | 'exhausted' | 'stalled' | 'blocked' | 'unavailable' | 'cancelled' | 'needs-human' | 'deadline';
209
+ /** What the host is waiting for, when the loop stopped on `needs-human`. */
210
+ interaction?: {
211
+ kind: string;
212
+ text: string;
213
+ needs?: string;
214
+ };
215
+ /** Why the verifier proved the task impossible, when the loop ended as `blocked`. */
216
+ exit?: {
217
+ reason: string;
218
+ };
219
+ }
220
+ /** One presentational verb the application asks a front end to carry out.
221
+ *
222
+ * The application decides which effects a command produces; the UI only interprets these verbs, so it
223
+ * never learns which command ran or what it means. Adding a command therefore needs no UI change
224
+ * unless it needs a genuinely new verb here. A discriminated union rather than optional fields: the
225
+ * payload-carrying verbs (`history`, `search`, `model`, `removal`, `loop`) keep their own shape, and
226
+ * an illegal combination cannot be written down.
227
+ *
228
+ * The front end applies them **in array order** — that order is the contract, not a suggestion, and
229
+ * `applyEffects` never re-sorts. The application emits them as:
230
+ *
231
+ * `closePanels → close → open/toggle → live/pinLive/resetFolds/toggle* → scroll/scrollBy → notice/error`
232
+ */
233
+ export type ViewEffect =
234
+ /** Transient line shown above the composer. */
235
+ {
236
+ kind: 'notice';
237
+ text: string;
238
+ }
239
+ /** Failure line the operator can read; applied last so it survives the other effects. */
240
+ | {
241
+ kind: 'error';
242
+ text: string;
243
+ }
244
+ /** Close every panel except the one opened or toggled in this same result. */
245
+ | {
246
+ kind: 'closePanels';
247
+ }
248
+ /** Open one panel with no payload; its rows come from the record or queries. */
249
+ | {
250
+ kind: 'open';
251
+ panel: PanelName;
252
+ }
253
+ /** Toggle one of the read-only panels (`help`, `cost`, `status`). */
254
+ | {
255
+ kind: 'toggle';
256
+ panel: PanelName;
257
+ }
258
+ /** Close one panel. */
259
+ | {
260
+ kind: 'close';
261
+ panel: PanelName;
262
+ }
263
+ /** Payload that opens its own panel. */
264
+ | {
265
+ kind: 'history';
266
+ history: PanelState['history'];
267
+ } | {
268
+ kind: 'search';
269
+ search: PanelState['search'];
270
+ } | {
271
+ kind: 'model';
272
+ model: ModelState;
273
+ } | {
274
+ kind: 'removal';
275
+ removal: RemovalTarget;
276
+ }
277
+ /** Open the loop parameter form for one record, so its defaults are confirmed before the run. */
278
+ | {
279
+ kind: 'loop';
280
+ loop: {
281
+ name: string;
282
+ };
283
+ }
284
+ /** Release a detached history window and return to the live end. */
285
+ | {
286
+ kind: 'live';
287
+ }
288
+ /** Drop the reading protection that keeps history pinned. */
289
+ | {
290
+ kind: 'pinLive';
291
+ }
292
+ /** Drop every reasoning fold. */
293
+ | {
294
+ kind: 'resetFolds';
295
+ }
296
+ /** Toggle one folded reasoning block, jumping to it when it opens. */
297
+ | {
298
+ kind: 'toggleFold';
299
+ seq: number;
300
+ }
301
+ /** Toggle the live reasoning fold between one row and full. */
302
+ | {
303
+ kind: 'toggleLiveReasoning';
304
+ }
305
+ /** Absolute scroll position. */
306
+ | {
307
+ kind: 'scroll';
308
+ position: number;
309
+ }
310
+ /** Scroll relative to the current position. */
311
+ | {
312
+ kind: 'scrollBy';
313
+ delta: number;
314
+ }
315
+ /** Enter copy mode. */
316
+ | {
317
+ kind: 'copy';
318
+ }
319
+ /** Exit the client. */
320
+ | {
321
+ kind: 'quit';
322
+ };
323
+ /** Whether one submitted line was used up or left in the composer. */
324
+ export type CommandDisposition = 'consume' | 'retain';
325
+ /** How one submitted line ended.
326
+ *
327
+ * Orthogonal to `disposition`, which is why they are two fields and not one boolean: a syntax error is
328
+ * `retain + rejected`, a success is `consume + ok`, a form that failed its own validation is
329
+ * `retain + rejected`, and an export the operator aborted with Esc is `retain + cancelled`.
330
+ */
331
+ export type CommandOutcome = 'ok' | 'rejected' | 'cancelled' | 'failed';
332
+ /** What one submitted line did, and what the front end must show.
333
+ *
334
+ * `undefined` instead of a result means the application did not accept the line at all — offline, a
335
+ * line already in flight, or an action that declined to start — and the draft stays put.
336
+ */
337
+ export interface CommandResult {
338
+ /** Whether the composer should clear the line that produced this result. */
339
+ disposition: CommandDisposition;
340
+ /** The one fact about how it ended, shared by the notice the reader sees and the trace. */
341
+ outcome: CommandOutcome;
342
+ /** Presentational verbs, in the order the front end must apply them. */
343
+ effects: ViewEffect[];
344
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ /** Application-side command policy: what one submitted line does, and the view it leaves behind.
2
+ *
3
+ * The syntax lives in `slash/`, the effects and their notices live here, and `ui/app.tsx` only applies
4
+ * the returned `ViewEffect[]`. The UI therefore never learns which command ran, and a new command
5
+ * needs no UI change unless it introduces a genuinely new presentational verb.
6
+ */
7
+ import type { CommandResult, ViewEffect } from '../contracts.ts';
8
+ import { type LineCommand } from '../slash/index.ts';
9
+ import type { Controller } from './controller.ts';
10
+ /** A line the application can execute: a parsed command, a free-text answer, or a host path.
11
+ *
12
+ * The shape is slash's (`LineCommand`), because "what a line means" is settled before the application
13
+ * is involved; this layer owns only the effect.
14
+ */
15
+ export type RunnableCommand = LineCommand;
16
+ /** What the command policy borrows from the UI while it runs. */
17
+ export interface CommandPort {
18
+ /** Run one cancellable operation under the UI's loading label, abortable with Esc. */
19
+ run<T>(label: string, operation: (signal: AbortSignal) => Promise<T>): Promise<T | undefined>;
20
+ /** Whether the caller can show a surface and wait for the operator.
21
+ *
22
+ * A command that would otherwise need a decision may borrow a panel only here; a scripted or
23
+ * headless caller leaves this unset and gets the command's direct effect instead of a form nobody
24
+ * could answer. Optional on purpose: the safe default is "nobody is watching".
25
+ */
26
+ readonly interactive?: boolean;
27
+ }
28
+ /** Resolve a removal into either a finished removal or the confirmation the UI must show.
29
+ *
30
+ * Shared by the `/ws --delete`/`/resume --delete` commands and the pickers' `d` key, so the
31
+ * empty-session rule has one implementation.
32
+ * @param controller - Application facade the removal acts on.
33
+ * @param kind - Workspace registration or session archival.
34
+ * @param query - Exact name, ID, or unambiguous ID prefix.
35
+ * @returns The effects to apply, or undefined when the target could not be resolved.
36
+ */
37
+ export declare function removalIntent(controller: Controller, kind: 'workspace' | 'session', query: string): Promise<ViewEffect[] | undefined>;
38
+ /** Run one submitted line and describe what it did and what the front end must show.
39
+ *
40
+ * This is the single entry point every front end uses — the composer and the scripted startup runner
41
+ * alike — so one line has one effect and one trace span wherever it came from.
42
+ * @param controller - Application facade the command acts on.
43
+ * @param command - Executable line; the front-end modes (`ignore`, `reference`) never reach here.
44
+ * @param port - Cancellable-operation port supplied by the caller.
45
+ * @returns The result, or undefined when the application did not accept the line.
46
+ */
47
+ export declare function runCommand(controller: Controller, command: RunnableCommand, port: CommandPort): Promise<CommandResult | undefined>;