indusagi-coding-agent 0.2.3 → 0.2.5

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 (260) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +661 -0
  3. package/README.md +95 -1
  4. package/dist/entry.js +3205 -1585
  5. package/dist/guardrails.js +47 -515
  6. package/dist/index.js +3232 -1671
  7. package/package.json +8 -7
  8. package/dist/types/addons/addons.test.d.ts +0 -21
  9. package/dist/types/addons/contract.d.ts +0 -640
  10. package/dist/types/addons/dispatch/event-dispatcher.d.ts +0 -140
  11. package/dist/types/addons/dispatch/index.d.ts +0 -23
  12. package/dist/types/addons/dispatch/tool-interceptor.d.ts +0 -128
  13. package/dist/types/addons/host.d.ts +0 -246
  14. package/dist/types/addons/index.d.ts +0 -51
  15. package/dist/types/addons/manifest.d.ts +0 -56
  16. package/dist/types/addons/sandbox.d.ts +0 -103
  17. package/dist/types/addons/surface.d.ts +0 -42
  18. package/dist/types/boot/auth-vault.d.ts +0 -29
  19. package/dist/types/boot/boot.d.ts +0 -26
  20. package/dist/types/boot/boot.test.d.ts +0 -15
  21. package/dist/types/boot/contract.d.ts +0 -236
  22. package/dist/types/boot/index.d.ts +0 -20
  23. package/dist/types/boot/invocation.d.ts +0 -40
  24. package/dist/types/boot/invocation.test.d.ts +0 -8
  25. package/dist/types/boot/runners/addon-wiring.d.ts +0 -103
  26. package/dist/types/boot/runners/addon-wiring.test.d.ts +0 -19
  27. package/dist/types/boot/runners/checkpoint.d.ts +0 -133
  28. package/dist/types/boot/runners/checkpoint.test.d.ts +0 -12
  29. package/dist/types/boot/runners/delegate-runner.d.ts +0 -89
  30. package/dist/types/boot/runners/delegate-runner.test.d.ts +0 -13
  31. package/dist/types/boot/runners/index.d.ts +0 -13
  32. package/dist/types/boot/runners/link-runner.d.ts +0 -20
  33. package/dist/types/boot/runners/memdir.d.ts +0 -103
  34. package/dist/types/boot/runners/memdir.test.d.ts +0 -12
  35. package/dist/types/boot/runners/oneshot-runner.d.ts +0 -19
  36. package/dist/types/boot/runners/read-state.d.ts +0 -82
  37. package/dist/types/boot/runners/read-state.test.d.ts +0 -10
  38. package/dist/types/boot/runners/registry.d.ts +0 -30
  39. package/dist/types/boot/runners/repl-runner.d.ts +0 -19
  40. package/dist/types/boot/runners/session-persist.test.d.ts +0 -10
  41. package/dist/types/boot/runners/session.d.ts +0 -65
  42. package/dist/types/boot/runners/session.test.d.ts +0 -10
  43. package/dist/types/boot/stages.d.ts +0 -92
  44. package/dist/types/boot/upgrade/apply.d.ts +0 -45
  45. package/dist/types/boot/upgrade/index.d.ts +0 -13
  46. package/dist/types/boot/upgrade/upgrades.d.ts +0 -126
  47. package/dist/types/briefing/briefing.test.d.ts +0 -15
  48. package/dist/types/briefing/compose.d.ts +0 -37
  49. package/dist/types/briefing/context-docs.d.ts +0 -38
  50. package/dist/types/briefing/context-docs.test.d.ts +0 -18
  51. package/dist/types/briefing/contract.d.ts +0 -686
  52. package/dist/types/briefing/index.d.ts +0 -29
  53. package/dist/types/briefing/macros.d.ts +0 -206
  54. package/dist/types/briefing/skills.d.ts +0 -67
  55. package/dist/types/capability-deck/bridge-ledger/index.d.ts +0 -25
  56. package/dist/types/capability-deck/bridge-ledger/key.d.ts +0 -65
  57. package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +0 -129
  58. package/dist/types/capability-deck/bridge-ledger/network.d.ts +0 -115
  59. package/dist/types/capability-deck/builtin-bridge.d.ts +0 -114
  60. package/dist/types/capability-deck/capability-deck.test.d.ts +0 -18
  61. package/dist/types/capability-deck/cards/bg-process-card.d.ts +0 -99
  62. package/dist/types/capability-deck/cards/index.d.ts +0 -37
  63. package/dist/types/capability-deck/cards/memory-card.d.ts +0 -68
  64. package/dist/types/capability-deck/cards/plan-file.d.ts +0 -56
  65. package/dist/types/capability-deck/cards/plan-tools.d.ts +0 -97
  66. package/dist/types/capability-deck/cards/plan-tools.test.d.ts +0 -9
  67. package/dist/types/capability-deck/cards/saas-card.d.ts +0 -78
  68. package/dist/types/capability-deck/cards/task-card.d.ts +0 -106
  69. package/dist/types/capability-deck/cards/todo-card.d.ts +0 -78
  70. package/dist/types/capability-deck/cards/workflow-card.d.ts +0 -55
  71. package/dist/types/capability-deck/cards/workflow-card.test.d.ts +0 -12
  72. package/dist/types/capability-deck/checkpoint.int.test.d.ts +0 -25
  73. package/dist/types/capability-deck/contract.d.ts +0 -317
  74. package/dist/types/capability-deck/index.d.ts +0 -46
  75. package/dist/types/capability-deck/manifest.d.ts +0 -60
  76. package/dist/types/capability-deck/provision.d.ts +0 -76
  77. package/dist/types/capability-deck/read-edit-gate.int.test.d.ts +0 -21
  78. package/dist/types/channels/channels.test.d.ts +0 -15
  79. package/dist/types/channels/contract.d.ts +0 -489
  80. package/dist/types/channels/framer.d.ts +0 -49
  81. package/dist/types/channels/index.d.ts +0 -24
  82. package/dist/types/channels/link/dialog.d.ts +0 -138
  83. package/dist/types/channels/link/driver.d.ts +0 -81
  84. package/dist/types/channels/link/index.d.ts +0 -13
  85. package/dist/types/channels/link/server.d.ts +0 -70
  86. package/dist/types/channels/oneshot.d.ts +0 -37
  87. package/dist/types/channels/ops.d.ts +0 -89
  88. package/dist/types/channels/session-ops.d.ts +0 -80
  89. package/dist/types/conductor/bash-guard.d.ts +0 -106
  90. package/dist/types/conductor/bash-guard.test.d.ts +0 -17
  91. package/dist/types/conductor/catalog/catalog.d.ts +0 -87
  92. package/dist/types/conductor/catalog/index.d.ts +0 -14
  93. package/dist/types/conductor/catalog/matcher.d.ts +0 -47
  94. package/dist/types/conductor/conductor.d.ts +0 -189
  95. package/dist/types/conductor/conductor.test.d.ts +0 -10
  96. package/dist/types/conductor/contract.d.ts +0 -774
  97. package/dist/types/conductor/diagnostics.d.ts +0 -183
  98. package/dist/types/conductor/diagnostics.test.d.ts +0 -10
  99. package/dist/types/conductor/index.d.ts +0 -26
  100. package/dist/types/conductor/permission-gate.integration.test.d.ts +0 -22
  101. package/dist/types/conductor/permission-wiring.test.d.ts +0 -14
  102. package/dist/types/conductor/permissions.d.ts +0 -217
  103. package/dist/types/conductor/permissions.test.d.ts +0 -12
  104. package/dist/types/conductor/plan-mode.integration.test.d.ts +0 -23
  105. package/dist/types/conductor/post-edit-diagnostics.test.d.ts +0 -13
  106. package/dist/types/conductor/signal-hub/hub.d.ts +0 -83
  107. package/dist/types/conductor/signal-hub/index.d.ts +0 -19
  108. package/dist/types/conductor/signal-hub/translate.d.ts +0 -77
  109. package/dist/types/conductor/skill-parse/index.d.ts +0 -10
  110. package/dist/types/conductor/skill-parse/parse.d.ts +0 -67
  111. package/dist/types/conductor/submit.test.d.ts +0 -28
  112. package/dist/types/conductor/transcript-store/index.d.ts +0 -16
  113. package/dist/types/conductor/transcript-store/serialize.d.ts +0 -106
  114. package/dist/types/conductor/transcript-store/serialize.test.d.ts +0 -10
  115. package/dist/types/conductor/transcript-store/store.d.ts +0 -188
  116. package/dist/types/console/components/AgentsView.d.ts +0 -41
  117. package/dist/types/console/components/BackgroundAgents.d.ts +0 -63
  118. package/dist/types/console/components/BackgroundAgents.test.d.ts +0 -8
  119. package/dist/types/console/components/Banner.d.ts +0 -110
  120. package/dist/types/console/components/Composer.d.ts +0 -37
  121. package/dist/types/console/components/StatusBar.d.ts +0 -42
  122. package/dist/types/console/components/TerminalConsole.d.ts +0 -32
  123. package/dist/types/console/components/WorkingIndicator.d.ts +0 -44
  124. package/dist/types/console/components/WorkingIndicator.test.d.ts +0 -9
  125. package/dist/types/console/components/banner-sweep.d.ts +0 -55
  126. package/dist/types/console/components/banner.test.d.ts +0 -9
  127. package/dist/types/console/components/welcome.d.ts +0 -115
  128. package/dist/types/console/components/welcome.test.d.ts +0 -9
  129. package/dist/types/console/console.test.d.ts +0 -19
  130. package/dist/types/console/contract.d.ts +0 -598
  131. package/dist/types/console/index.d.ts +0 -34
  132. package/dist/types/console/input/complete.d.ts +0 -120
  133. package/dist/types/console/input/dir-reader.d.ts +0 -28
  134. package/dist/types/console/input/index.d.ts +0 -24
  135. package/dist/types/console/input/input.test.d.ts +0 -14
  136. package/dist/types/console/input/keymap.d.ts +0 -193
  137. package/dist/types/console/input/paste.d.ts +0 -131
  138. package/dist/types/console/mount.d.ts +0 -53
  139. package/dist/types/console/overlays/approval-queue.d.ts +0 -71
  140. package/dist/types/console/overlays/approval.d.ts +0 -104
  141. package/dist/types/console/overlays/approval.test.d.ts +0 -17
  142. package/dist/types/console/overlays/auth.d.ts +0 -31
  143. package/dist/types/console/overlays/boards.d.ts +0 -55
  144. package/dist/types/console/overlays/host.d.ts +0 -45
  145. package/dist/types/console/overlays/index.d.ts +0 -15
  146. package/dist/types/console/overlays/pickers.d.ts +0 -37
  147. package/dist/types/console/overlays/sessions.d.ts +0 -29
  148. package/dist/types/console/reducer.d.ts +0 -51
  149. package/dist/types/console/slash/builtins.d.ts +0 -33
  150. package/dist/types/console/slash/commands/dynamic.d.ts +0 -57
  151. package/dist/types/console/slash/commands/dynamic.test.d.ts +0 -9
  152. package/dist/types/console/slash/commands/integrations.d.ts +0 -28
  153. package/dist/types/console/slash/commands/integrations.test.d.ts +0 -18
  154. package/dist/types/console/slash/commands/shared.d.ts +0 -72
  155. package/dist/types/console/slash/commands/transcript.d.ts +0 -24
  156. package/dist/types/console/slash/commands/transcript.test.d.ts +0 -10
  157. package/dist/types/console/slash/commands/workbench.d.ts +0 -21
  158. package/dist/types/console/slash/commands/workbench.test.d.ts +0 -10
  159. package/dist/types/console/slash/index.d.ts +0 -34
  160. package/dist/types/console/slash/registry.d.ts +0 -90
  161. package/dist/types/console/slash/resolve.d.ts +0 -109
  162. package/dist/types/console/slash/slash.test.d.ts +0 -18
  163. package/dist/types/console/startup.d.ts +0 -119
  164. package/dist/types/console/theme/adapter.d.ts +0 -79
  165. package/dist/types/console/theme/index.d.ts +0 -18
  166. package/dist/types/console/theme/palette.d.ts +0 -77
  167. package/dist/types/console/theme/resolve.d.ts +0 -45
  168. package/dist/types/console/theme/theme.test.d.ts +0 -16
  169. package/dist/types/console/theme/tokens.d.ts +0 -62
  170. package/dist/types/entry.d.ts +0 -17
  171. package/dist/types/guardrails.d.ts +0 -33
  172. package/dist/types/index.d.ts +0 -24
  173. package/dist/types/insight/channel.d.ts +0 -45
  174. package/dist/types/insight/contract.d.ts +0 -411
  175. package/dist/types/insight/index.d.ts +0 -26
  176. package/dist/types/insight/insight.test.d.ts +0 -17
  177. package/dist/types/insight/recorder.d.ts +0 -63
  178. package/dist/types/insight/redaction.d.ts +0 -44
  179. package/dist/types/insight/replay.d.ts +0 -77
  180. package/dist/types/insight/sampling.d.ts +0 -84
  181. package/dist/types/insight/serialize.d.ts +0 -54
  182. package/dist/types/insight/sinks/console.d.ts +0 -36
  183. package/dist/types/insight/sinks/file.d.ts +0 -37
  184. package/dist/types/insight/sinks/index.d.ts +0 -16
  185. package/dist/types/insight/sinks/stream.d.ts +0 -53
  186. package/dist/types/kit/clipboard-image.d.ts +0 -40
  187. package/dist/types/kit/external-editor.d.ts +0 -35
  188. package/dist/types/kit/image.d.ts +0 -102
  189. package/dist/types/kit/index.d.ts +0 -29
  190. package/dist/types/kit/kit.test.d.ts +0 -13
  191. package/dist/types/kit/shell.d.ts +0 -50
  192. package/dist/types/kit/tool-fetch.d.ts +0 -165
  193. package/dist/types/launch/catalog.d.ts +0 -51
  194. package/dist/types/launch/contract.d.ts +0 -387
  195. package/dist/types/launch/credentials.d.ts +0 -112
  196. package/dist/types/launch/index.d.ts +0 -28
  197. package/dist/types/launch/invocation/attachments.d.ts +0 -72
  198. package/dist/types/launch/invocation/flags.d.ts +0 -59
  199. package/dist/types/launch/invocation/index.d.ts +0 -23
  200. package/dist/types/launch/invocation/read.d.ts +0 -52
  201. package/dist/types/launch/invocation/usage.d.ts +0 -25
  202. package/dist/types/launch/launch.test.d.ts +0 -20
  203. package/dist/types/launch/oauth.d.ts +0 -101
  204. package/dist/types/launch/packages.d.ts +0 -75
  205. package/dist/types/launch/packages.test.d.ts +0 -15
  206. package/dist/types/launch/pickers.d.ts +0 -97
  207. package/dist/types/runtime-bridge/bridges/_drive.d.ts +0 -74
  208. package/dist/types/runtime-bridge/bridges/builtins.d.ts +0 -77
  209. package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +0 -37
  210. package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +0 -27
  211. package/dist/types/runtime-bridge/bridges/index.d.ts +0 -15
  212. package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +0 -36
  213. package/dist/types/runtime-bridge/broker.d.ts +0 -182
  214. package/dist/types/runtime-bridge/contract.d.ts +0 -436
  215. package/dist/types/runtime-bridge/index.d.ts +0 -21
  216. package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +0 -17
  217. package/dist/types/runtime-bridge/sink.d.ts +0 -59
  218. package/dist/types/sessions/contract.d.ts +0 -79
  219. package/dist/types/sessions/index.d.ts +0 -11
  220. package/dist/types/sessions/library.d.ts +0 -95
  221. package/dist/types/sessions/sessions.test.d.ts +0 -11
  222. package/dist/types/settings/contract.d.ts +0 -175
  223. package/dist/types/settings/index.d.ts +0 -13
  224. package/dist/types/settings/manager.d.ts +0 -109
  225. package/dist/types/settings/settings.test.d.ts +0 -16
  226. package/dist/types/transcript-export/index.d.ts +0 -20
  227. package/dist/types/transcript-export/publish.d.ts +0 -81
  228. package/dist/types/transcript-export/sgr.d.ts +0 -90
  229. package/dist/types/transcript-export/template.d.ts +0 -64
  230. package/dist/types/transcript-export/theme-bridge.d.ts +0 -99
  231. package/dist/types/transcript-export/transcript-export.test.d.ts +0 -16
  232. package/dist/types/window-budget/budget/estimate.d.ts +0 -47
  233. package/dist/types/window-budget/budget/gate.d.ts +0 -37
  234. package/dist/types/window-budget/budget/index.d.ts +0 -14
  235. package/dist/types/window-budget/budget/slice.d.ts +0 -38
  236. package/dist/types/window-budget/condenser.d.ts +0 -73
  237. package/dist/types/window-budget/contract.d.ts +0 -182
  238. package/dist/types/window-budget/index.d.ts +0 -17
  239. package/dist/types/window-budget/microcompact.d.ts +0 -68
  240. package/dist/types/window-budget/microcompact.test.d.ts +0 -16
  241. package/dist/types/window-budget/rehydrate.d.ts +0 -56
  242. package/dist/types/window-budget/summarize/condense.d.ts +0 -70
  243. package/dist/types/window-budget/summarize/index.d.ts +0 -12
  244. package/dist/types/window-budget/summarize/prompt.d.ts +0 -56
  245. package/dist/types/window-budget/window-budget.test.d.ts +0 -18
  246. package/dist/types/workflow-engine/agent-runner.d.ts +0 -105
  247. package/dist/types/workflow-engine/agent-runner.test.d.ts +0 -8
  248. package/dist/types/workflow-engine/display.d.ts +0 -148
  249. package/dist/types/workflow-engine/display.test.d.ts +0 -1
  250. package/dist/types/workflow-engine/engine.d.ts +0 -183
  251. package/dist/types/workflow-engine/engine.test.d.ts +0 -1
  252. package/dist/types/workflow-engine/index.d.ts +0 -21
  253. package/dist/types/workflow-engine/parse.d.ts +0 -64
  254. package/dist/types/workflow-engine/parse.test.d.ts +0 -1
  255. package/dist/types/workflow-engine/structured-output.d.ts +0 -51
  256. package/dist/types/workflow-engine/structured-output.test.d.ts +0 -1
  257. package/dist/types/workspace/brand.d.ts +0 -26
  258. package/dist/types/workspace/index.d.ts +0 -11
  259. package/dist/types/workspace/locator.d.ts +0 -50
  260. package/dist/types/workspace/runtime-detect.d.ts +0 -56
@@ -1,104 +0,0 @@
1
- /**
2
- * Approval overlay — the interactive tool-permission prompt.
3
- *
4
- * This group owns the single modal kind raised when the permission gate reaches an
5
- * `ask` decision for a tool call: it shows the pending request (tool name, a short
6
- * rendering of the arguments, and any suggested allow-rule) and lets the user pick
7
- * one of three outcomes — allow this one call, allow it for the rest of the session
8
- * (which the gate turns into a session allow-rule), or deny it. It is mounted
9
- * unconditionally by {@link import("./host").OverlayHost}, which routes by
10
- * {@link ModalState.kind}; this component renders a dialog body only for its own
11
- * `approval` kind and is otherwise inert.
12
- *
13
- * The wiring is a parked promise: when the React layer builds the conductor's
14
- * approval resolver it returns a promise and stashes the request (plus the
15
- * promise's `resolve`) under {@link ModalState.payload}. This overlay reads that
16
- * payload, renders the choices, and on a pick calls `payload.resolve(choice)` then
17
- * closes the modal — handing control back to the gate, which proceeds or denies. An
18
- * Esc (the dialog's own close) resolves `"deny"` so a dismissed prompt never hangs
19
- * the in-flight turn. The actual select UI reuses the framework `ThemeDialog`
20
- * (a labelled, navigable pick-from-list with descriptions), so the overlay needs no
21
- * bespoke key handling.
22
- *
23
- * React/Ink are obtained the same way the other overlays do (default React export
24
- * from `indusagi/react-host`, `Box`/`Text` from `indusagi/react-host/ink`).
25
- */
26
- import { type ThemeDialogItem } from "indusagi/react-ink";
27
- import type { ApprovalChoice } from "../../conductor";
28
- import type { OverlayGroupProps } from "./pickers";
29
- /**
30
- * The pending tool-permission request a prompt is raised for. Mirrors the
31
- * arguments the conductor's approval resolver is handed for an `ask` decision.
32
- */
33
- export interface ApprovalRequest {
34
- /** The tool the model asked to run (e.g. `"Bash"`, `"Edit"`). */
35
- readonly toolName: string;
36
- /** The validated arguments the tool would run with. */
37
- readonly input: unknown;
38
- /**
39
- * Optional human-readable allow-rule suggestions the prompt surfaces (e.g.
40
- * `"Bash(npm run test:*)"`), so the user knows what an "allow always" remembers.
41
- */
42
- readonly suggestions?: readonly string[];
43
- }
44
- /**
45
- * The opaque {@link ModalState.payload} the `approval` overlay narrows: the pending
46
- * request plus the resolver of the parked approval promise. The overlay calls
47
- * `resolve(choice)` exactly once, then closes the modal.
48
- */
49
- export interface ApprovalPayload {
50
- /** The pending request to render. */
51
- readonly request: ApprovalRequest;
52
- /** Fulfil the parked approval promise with the user's choice. */
53
- readonly resolve: (choice: ApprovalChoice) => void;
54
- }
55
- /**
56
- * The three offerable outcomes, in listing order. The `id` is the
57
- * {@link ApprovalChoice} the gate consumes; `label`/`description` are what the
58
- * prompt shows. Kept as data (not an `if`-ladder) so the choice→resolution mapping
59
- * is a pure table the headless test asserts against.
60
- */
61
- export declare const APPROVAL_CHOICES: readonly (ThemeDialogItem & {
62
- id: ApprovalChoice;
63
- })[];
64
- /** The {@link ApprovalChoice} a dismissed (Esc) prompt resolves to. */
65
- export declare const DISMISS_CHOICE: ApprovalChoice;
66
- /**
67
- * Map a selected dialog `id` back to the {@link ApprovalChoice} the gate consumes.
68
- *
69
- * Pure and total: a recognised id maps to itself; anything unrecognised falls back
70
- * to {@link DISMISS_CHOICE} (`"deny"`) so a stray selection can never silently
71
- * allow a tool. This is the unit the headless test pins.
72
- *
73
- * @param id the `id` the {@link ThemeDialog} reported on select
74
- */
75
- export declare function choiceFromId(id: string): ApprovalChoice;
76
- /**
77
- * Narrow the opaque modal payload into a typed {@link ApprovalPayload}, or
78
- * `undefined` when it is not a well-formed approval request (a defensive guard —
79
- * the overlay renders nothing rather than crash on a malformed payload).
80
- *
81
- * @param payload the opaque {@link ModalState.payload}
82
- */
83
- export declare function readApprovalPayload(payload: unknown): ApprovalPayload | undefined;
84
- /**
85
- * Render a tool call's arguments as a single short, human-readable line for the
86
- * prompt body. A shell `command` (or any `command` field) shows verbatim;
87
- * otherwise a compact JSON encoding is used. Long values are elided so the prompt
88
- * never floods the terminal.
89
- *
90
- * @param input the validated tool arguments
91
- */
92
- export declare function summarizeInput(input: unknown): string;
93
- /**
94
- * The approval overlay group: the single `approval` modal kind.
95
- *
96
- * Renders the prompt body when the active modal is `approval` and its payload is a
97
- * well-formed {@link ApprovalPayload}; every other kind (and a malformed payload)
98
- * yields nothing. Unlike the session/auth groups this does NOT require the runtime
99
- * services bundle — the payload carries everything the prompt needs — so it works
100
- * on any mount path that wired a resolver.
101
- *
102
- * @param props the forwarded overlay props (modal, services, theme, dispatch, closer)
103
- */
104
- export declare function ApprovalOverlays(props: OverlayGroupProps): JSX.Element | null;
@@ -1,17 +0,0 @@
1
- /**
2
- * Approval overlay — headless unit tests for the pure logic behind the prompt.
3
- *
4
- * Rendering an Ink dialog headlessly is brittle, so these tests pin the two pure
5
- * pieces the interactive overlay is built from — exactly the bar the task sets:
6
- *
7
- * 1. The choice→resolution mapping ({@link choiceFromId}) + the payload narrowing
8
- * ({@link readApprovalPayload}) + the argument summary ({@link summarizeInput}):
9
- * a selected dialog row maps to the {@link ApprovalChoice} the gate consumes, a
10
- * malformed payload is rejected, and a stray id falls back to `deny`.
11
- * 2. The queue reducer ({@link approvalQueueReducer}) + head selector
12
- * ({@link activeApproval}): requests serialise oldest-first, a settle drops the
13
- * matching entry (and a double-settle is inert), and a clear empties the queue.
14
- *
15
- * No React, no Ink, no conductor — just the exported functions.
16
- */
17
- export {};
@@ -1,31 +0,0 @@
1
- /**
2
- * Auth overlays — the sign-in / sign-out and plugin dialogs.
3
- *
4
- * This group owns the four modal kinds tied to credentials and host-supplied
5
- * overlays: the provider sign-in launcher (`signIn`), the sign-out confirmation
6
- * (`signOut`), the in-flight OAuth device/redirect flow (`oauth`), and a
7
- * plugin-supplied select/confirm/input/custom overlay (`plugin`). It is mounted
8
- * unconditionally by {@link import("./host").OverlayHost}, which routes by
9
- * {@link ModalState.kind}; this component renders a dialog body only for one of
10
- * its own kinds and is otherwise inert.
11
- *
12
- * Each kind drives an {@link OverlayServices} handle then returns to the
13
- * composer: `signIn` enumerates the merged provider directory and hands a
14
- * browser provider off to the `oauth` kind (api-key providers post a status and
15
- * close); `signOut` lists the saved accounts across providers and removes the
16
- * chosen one through the vault; `oauth` runs the framework login flow, threading
17
- * its url/prompt/progress callbacks into a local overlay state the dialog reads;
18
- * `plugin` presents the host-supplied surface name and closes. React/Ink are
19
- * obtained the same way the surface component is (default React export from
20
- * `indusagi/react-host`, `Box`/`Text` from `indusagi/react-host/ink`).
21
- */
22
- import type { OverlayGroupProps } from "./pickers";
23
- /**
24
- * The auth overlay group: sign-in, sign-out, OAuth, and plugin overlays.
25
- *
26
- * Renders a dialog body only when the active modal kind is one of this group's
27
- * own; every other kind (and an absent {@link OverlayServices}) yields nothing.
28
- *
29
- * @param props the forwarded overlay props
30
- */
31
- export declare function AuthOverlays(props: OverlayGroupProps): JSX.Element | null;
@@ -1,55 +0,0 @@
1
- /**
2
- * Saffron picker boards — the themed `/settings` and `/model` overlays styled to
3
- * the "IndusCode Saffron · Settings · Config" design.
4
- *
5
- * The framework ships plain (un-themed) `SettingsDialog` / `ModelDialog`. These
6
- * boards are the console's own theme-aware replacements for those two pickers: a
7
- * saffron tab-pill header, a teal-bordered search box with a magnifier and a
8
- * block caret, a two-column list whose values are tinted by kind (on/true →
9
- * green, off/false → dim, everything else → teal), a windowed "↓ N more" hint,
10
- * and a top-ruled footer of key hints. They reuse the framework's pure
11
- * {@link matchesSearchQuery} / {@link wrapSelectionIndex} helpers (and the
12
- * {@link SettingsDialogItem} shape) so only the *presentation* is re-authored,
13
- * not the filter/navigation logic.
14
- *
15
- * All colour comes through the framework {@link InkThemeAdapter} the overlay
16
- * group already holds, so the boards recolour with the active scheme; the one
17
- * raw-hex touch is the chalk tab-pill (dark text on the accent fill), which has
18
- * no theme role to resolve against.
19
- */
20
- import { type InkThemeAdapter, type SettingsDialogItem } from "indusagi/react-ink";
21
- import type { Model } from "indusagi/ai";
22
- /** What the {@link SettingsBoard} renders. */
23
- export interface SettingsBoardProps {
24
- /** The framework adapter that turns token roles into terminal colours. */
25
- readonly theme: InkThemeAdapter;
26
- /** The settings rows to present and cycle. */
27
- readonly items: readonly SettingsDialogItem[];
28
- /** Invoked when the board is dismissed. */
29
- readonly onClose: () => void;
30
- }
31
- /**
32
- * The saffron `/settings` board: a filterable, value-cycling settings list in the
33
- * design's look. Up/Down move (wrapping), Left/Right or Enter cycle the value,
34
- * typing filters, Ctrl+U clears, Esc closes.
35
- */
36
- export declare function SettingsBoard({ theme, items, onClose }: SettingsBoardProps): JSX.Element;
37
- /** What the {@link ModelBoard} renders. */
38
- export interface ModelBoardProps {
39
- /** The framework adapter that turns token roles into terminal colours. */
40
- readonly theme: InkThemeAdapter;
41
- /** The selectable models. */
42
- readonly models: readonly Model<any>[];
43
- /** Optional initial search query. */
44
- readonly search?: string;
45
- /** Invoked with the chosen model. */
46
- readonly onSelect: (model: Model<any>) => void | Promise<void>;
47
- /** Invoked when the board is dismissed. */
48
- readonly onClose: () => void;
49
- }
50
- /**
51
- * The saffron `/model` board: a filterable model list in the design's look.
52
- * Up/Down move (wrapping), Enter selects, typing filters, Ctrl+U clears, Esc
53
- * closes.
54
- */
55
- export declare function ModelBoard({ theme, models, onClose, onSelect, search }: ModelBoardProps): JSX.Element;
@@ -1,45 +0,0 @@
1
- /**
2
- * OverlayHost — the single mount point for every modal overlay.
3
- *
4
- * The console surface raises overlays by writing a {@link ModalState} into the
5
- * reducer; this component is the one place that turns that state into a rendered
6
- * dialog. Rather than a hand-written `switch` over {@link ModalKind}, it mounts
7
- * three group components unconditionally and forwards each the same props — the
8
- * active {@link ModalState}, the {@link OverlayServices} runtime, the theme
9
- * adapter, the {@link ConsoleDispatch}, and a `closeModal` callback. Each group
10
- * owns a disjoint slice of the kind space and renders a body only for its own
11
- * kinds:
12
- *
13
- * - {@link PickerOverlays} — `models`, `scopedModels`, `theme`, `settings`.
14
- * - {@link SessionOverlays} — `sessions`, `tree`, `userTurns`.
15
- * - {@link AuthOverlays} — `signIn`, `signOut`, `oauth`, `plugin`.
16
- * - {@link ApprovalOverlays} — `approval` (the tool-permission prompt).
17
- *
18
- * When no overlay is raised (`kind === "none"`) the host renders nothing, so the
19
- * composer keeps focus and the groups are never mounted needlessly.
20
- */
21
- import type { ConsoleDispatch, InkThemeAdapter, ModalState, OverlayServices } from "../contract";
22
- /**
23
- * The props the console surface threads into {@link OverlayHost}.
24
- *
25
- * The same five fields are forwarded verbatim to each overlay group; the host
26
- * adds no routing logic of its own beyond the `none` short-circuit.
27
- */
28
- export interface OverlayHostProps {
29
- /** The active modal overlay (kind + opaque payload). */
30
- readonly modal: ModalState;
31
- /** The runtime handles overlays drive; absent on headless mount paths. */
32
- readonly services?: OverlayServices;
33
- /** The framework adapter that turns token roles into terminal colours. */
34
- readonly theme: InkThemeAdapter;
35
- /** Dispatch a reducer event to mutate console state. */
36
- readonly dispatch: ConsoleDispatch;
37
- /** Drop the active overlay back to the composer. */
38
- readonly closeModal: () => void;
39
- }
40
- /**
41
- * Render the active modal overlay, or nothing when none is raised.
42
- *
43
- * @param props the modal state, runtime services, theme, dispatch, and closer
44
- */
45
- export declare function OverlayHost(props: OverlayHostProps): JSX.Element | null;
@@ -1,15 +0,0 @@
1
- /**
2
- * Overlays subsystem — public barrel.
3
- *
4
- * Re-exports the single overlay mount point ({@link OverlayHost}) plus the three
5
- * group components it forwards to ({@link PickerOverlays}, {@link SessionOverlays},
6
- * {@link AuthOverlays}) and the shared prop shapes. The console surface imports
7
- * the overlay host from `src/console/overlays` rather than reaching into the
8
- * individual modules; the dialog bodies are filled by a later pass.
9
- */
10
- export { OverlayHost, type OverlayHostProps } from "./host";
11
- export { PickerOverlays, type OverlayGroupProps } from "./pickers";
12
- export { SessionOverlays } from "./sessions";
13
- export { AuthOverlays } from "./auth";
14
- export { ApprovalOverlays, choiceFromId, readApprovalPayload, summarizeInput, APPROVAL_CHOICES, DISMISS_CHOICE, type ApprovalRequest, type ApprovalPayload, } from "./approval";
15
- export { approvalQueueReducer, activeApproval, EMPTY_APPROVAL_QUEUE, type ApprovalEntry, type ApprovalQueueState, type ApprovalQueueEvent, } from "./approval-queue";
@@ -1,37 +0,0 @@
1
- /**
2
- * Picker overlays — the selection dialogs raised over the transcript.
3
- *
4
- * This group owns the four modal kinds that present a list to pick from: the
5
- * single-model picker (`models`), the per-scope model picker (`scopedModels`),
6
- * the colour-scheme picker (`theme`), and the settings list (`settings`). It is
7
- * mounted unconditionally by {@link import("./host").OverlayHost}; the host
8
- * routes by {@link ModalState.kind}, so this component only renders a dialog
9
- * body for one of its own kinds and is otherwise inert.
10
- */
11
- import type { ConsoleDispatch, InkThemeAdapter, ModalState, OverlayServices } from "../contract";
12
- /**
13
- * The props every overlay group receives, forwarded verbatim from
14
- * {@link import("./host").OverlayHost}.
15
- */
16
- export interface OverlayGroupProps {
17
- /** The active modal overlay (kind + opaque payload). */
18
- readonly modal: ModalState;
19
- /** The runtime handles overlays drive; absent on headless mount paths. */
20
- readonly services?: OverlayServices;
21
- /** The framework adapter that turns token roles into terminal colours. */
22
- readonly theme: InkThemeAdapter;
23
- /** Dispatch a reducer event to mutate console state. */
24
- readonly dispatch: ConsoleDispatch;
25
- /** Drop the active overlay back to the composer. */
26
- readonly closeModal: () => void;
27
- }
28
- /**
29
- * The picker overlay group: models, scoped models, theme, and settings.
30
- *
31
- * Renders the framework dialog matching the active modal kind, and nothing for
32
- * any kind owned by another group. With no runtime services attached (headless
33
- * and test mounts) every kind renders nothing.
34
- *
35
- * @param props the forwarded overlay props
36
- */
37
- export declare function PickerOverlays(props: OverlayGroupProps): JSX.Element | null;
@@ -1,29 +0,0 @@
1
- /**
2
- * Session overlays — the transcript navigation dialogs.
3
- *
4
- * This group owns the three modal kinds that browse persisted or in-flight
5
- * transcript state: the session resume/list picker (`sessions`), the
6
- * transcript-tree navigator (`tree`), and the prior-user-turn picker
7
- * (`userTurns`) used when branching or forking. It is mounted unconditionally
8
- * by {@link import("./host").OverlayHost}, which routes by
9
- * {@link ModalState.kind}; this component renders a dialog body only for one of
10
- * its own kinds and is otherwise inert.
11
- *
12
- * Each body maps the app's session vocabulary onto the framework dialog prop
13
- * shapes: a {@link import("../../sessions").SavedSession} becomes a
14
- * `SessionInfo`, a {@link import("../../sessions").BranchNode} becomes a
15
- * `SessionTreeOption`, and a {@link import("../../sessions").PriorTurn} becomes
16
- * a `UserMessageOption`. Async catalog/tree/turn loads run in `useEffect`; every
17
- * confirm drives the matching service then closes the modal. When the runtime
18
- * {@link OverlayServices} bundle is absent, the group renders nothing.
19
- */
20
- import type { OverlayGroupProps } from "./pickers";
21
- /**
22
- * The session overlay group: sessions, tree, and prior-turn pickers.
23
- *
24
- * Renders the dialog body matching the active modal kind, or nothing for a kind
25
- * this group does not own (or when no runtime services are wired in).
26
- *
27
- * @param props the forwarded overlay props (modal, services, theme, dispatch, closer)
28
- */
29
- export declare function SessionOverlays(props: OverlayGroupProps): JSX.Element | null;
@@ -1,51 +0,0 @@
1
- /**
2
- * Console reducer — the single pure fold over {@link ConsoleState}.
3
- *
4
- * The whole terminal surface is reduced from one immutable {@link ConsoleState}
5
- * value, mutated only by dispatching a {@link ConsoleEvent} into
6
- * {@link consoleReducer}. This module is the one place those transitions live:
7
- * it is a pure function (no React, no I/O, no timers) that, given a prior state
8
- * and an event, returns a *fresh* state — it never mutates its input. That makes
9
- * every transition unit-testable in isolation and keeps the surface component a
10
- * thin shell that only wires events in and renders the result out.
11
- *
12
- * The transitions fall into a few families, mirroring the {@link ConsoleEvent}
13
- * grouping:
14
- *
15
- * - **Composer edits** (`buffer:*`, `caret:*`) splice and navigate the live
16
- * input buffer, keeping the caret clamped into `[0, buffer.length]`.
17
- * - **History recall** (`history:*`) walks the submitted-input ring, stashing
18
- * the live buffer on the way in and restoring it on the way out.
19
- * - **Transcript view** (`rows:*`, `block:append`) appends and patches the
20
- * rendered rows projected from the conductor's {@link SessionSignal} stream
21
- * (the surface translates each signal into a row event).
22
- * - **Overlays / status / theme / toggles / busy** flip the small UI-local
23
- * flags the surface reads to decide what chrome to render.
24
- *
25
- * Live session data (messages, usage, model) is *not* stored here — it is read
26
- * straight from the conductor snapshot — so this state stays purely UI-local and
27
- * the reducer never needs to know about the agent loop.
28
- */
29
- import { type ConsoleEvent, type ConsoleState } from "./contract";
30
- /**
31
- * Fold a {@link ConsoleEvent} into a {@link ConsoleState}, returning a fresh
32
- * state.
33
- *
34
- * Pure and total: every event has a defined transition, and the input state is
35
- * never mutated. The `switch` is exhaustive over the event union, so adding an
36
- * event without handling it is a compile error.
37
- *
38
- * @param state the prior console state
39
- * @param event the action to apply
40
- */
41
- export declare function consoleReducer(state: ConsoleState, event: ConsoleEvent): ConsoleState;
42
- /**
43
- * Build the initial {@link ConsoleState} a console mounts with.
44
- *
45
- * Starts from the frozen {@link EMPTY_CONSOLE_STATE} seed and overlays any
46
- * caller-supplied UI preferences (scheme, the display toggles). Pure and
47
- * deterministic — no runtime is consulted — so the first render is stable.
48
- *
49
- * @param overrides optional UI-local preferences to seed
50
- */
51
- export declare function initConsoleState(overrides?: Partial<ConsoleState>): ConsoleState;
@@ -1,33 +0,0 @@
1
- /**
2
- * The built-in slash catalog — the single ordered source of truth.
3
- *
4
- * The catalog is assembled from three static topic groups, each its own module
5
- * under `./commands/`: transcript/session control, the workbench pickers
6
- * (model/models-for/theme/settings/help/keys/whats-new/debug), and the
7
- * integration bridges (login/logout/mcp/memory/composio/copy/export/share). On
8
- * top of those it splices in the *dynamic* rows — one `/skill:<name>` per
9
- * discovered Agent-Skills capability card and one `/<template-name>` per
10
- * discovered prompt-template macro — produced by {@link buildDynamicCommands}.
11
- *
12
- * There is no command `if`-ladder anywhere: adding a static command is appending
13
- * a row to one of the groups, and the dynamic rows are discovered at module load
14
- * from the standard skill/macro roots (returning nothing, never an error, when
15
- * those roots are absent). The registry index, the completion matcher, and the
16
- * family grouping are all *derived* from {@link SLASH_COMMANDS} (see
17
- * `registry.ts`).
18
- *
19
- * Listing order is intentional: transcript controls first (the verbs a new user
20
- * meets), then the workbench pickers, then the integration bridges, and finally
21
- * the discovered skills and templates.
22
- */
23
- import type { SlashCommand } from "../contract";
24
- /** The family labels the catalog groups commands under (for `/help`). */
25
- export { FAMILY } from "./commands/shared";
26
- /**
27
- * The built-in catalog — every command row in listing order.
28
- *
29
- * Consumers fold this into a {@link SlashRegistry} via `buildRegistry`; the index
30
- * by name/alias, the family grouping, and the completion matcher are all derived
31
- * from this one array.
32
- */
33
- export declare const SLASH_COMMANDS: readonly SlashCommand[];
@@ -1,57 +0,0 @@
1
- /**
2
- * Dynamic slash commands — capability cards and prompt templates as registry rows.
3
- *
4
- * The static catalog (`./builtins`) is hand-maintained, but two command families
5
- * are *discovered* at startup rather than written by hand: the Agent-Skills
6
- * capability cards ({@link SkillCard}s loaded from `SKILL.md` files) and the
7
- * user/project prompt templates ({@link Macro}s loaded from `*.md` macro files).
8
- * This module turns whatever was discovered into ordinary {@link SlashCommand}
9
- * rows so they sit in the same registry as the built-ins, complete the same way,
10
- * and resolve through the same dispatcher.
11
- *
12
- * Two row shapes are produced:
13
- *
14
- * - `/skill:<name>` — invoking it submits an Agent-Skills *invocation block*
15
- * (`<skill name="…" location="…">body</skill>`) as a normal turn, which is
16
- * exactly what the agent loop recognises to load and run that skill. The
17
- * trailing argument string becomes the skill body, so `/skill:commit tidy the
18
- * diff` runs the `commit` card against "tidy the diff".
19
- * - `/<template-name>` — invoking it expands the macro body against the
20
- * trailing arguments (the single-pass `$arg` model from the briefing layer)
21
- * and submits the result as a normal turn.
22
- *
23
- * Both return a `{ kind: "prompt" }` outcome so the dispatcher hands the produced
24
- * text to the conductor as a turn; neither reaches into a backend the console
25
- * does not own. When nothing was discovered, {@link buildDynamicCommands} returns
26
- * an empty array, so splicing it into the catalog is always safe.
27
- */
28
- import type { Macro, SkillCard } from "../../../briefing";
29
- import type { SlashCommand } from "../../contract";
30
- /**
31
- * The discovered material a dynamic catalog is built from.
32
- *
33
- * Both fields are optional and default to empty: a caller that only loaded
34
- * skills passes `{ skills }`, one that only loaded templates passes `{ templates }`,
35
- * and a caller with neither passes `{}` (or nothing) and gets back `[]`.
36
- */
37
- export interface DynamicCommandSources {
38
- /** Capability cards discovered from `SKILL.md` files. */
39
- readonly skills?: readonly SkillCard[];
40
- /** Prompt templates discovered from `*.md` macro files. */
41
- readonly templates?: readonly Macro[];
42
- }
43
- /**
44
- * Project discovered skills and templates into {@link SlashCommand} rows.
45
- *
46
- * Skill rows are listed first (namespaced under `skill:`), then the template
47
- * rows. A name claimed by an earlier row — including any of the static built-ins
48
- * a caller will concatenate these ahead of — is the registry's problem to reject
49
- * at assembly time; this function only suppresses *self*-collisions so a template
50
- * whose name duplicates a skill's `skill:`-prefixed token (impossible) or another
51
- * template (first wins) cannot crash the build. When no sources are supplied the
52
- * result is an empty array, never an error.
53
- *
54
- * @param sources the discovered skills and templates
55
- * @returns the dynamic command rows, skills first then templates
56
- */
57
- export declare function buildDynamicCommands(sources?: DynamicCommandSources): SlashCommand[];
@@ -1,9 +0,0 @@
1
- /**
2
- * Dynamic command group — focused tests.
3
- *
4
- * The builder turns discovered capability cards and prompt-template macros into
5
- * {@link SlashCommand} rows. Each row's `run` is driven against a scripted
6
- * {@link SlashContext} so its produced outcome (a `prompt` carrying the skill
7
- * invocation block or the expanded template) is asserted directly.
8
- */
9
- export {};
@@ -1,28 +0,0 @@
1
- /**
2
- * Integration slash commands — auth launchers, the external bridges, and the
3
- * clipboard / export / share I/O verbs.
4
- *
5
- * This group is the console's seam onto everything that lives *outside* a single
6
- * turn: signing in and out of a provider, wiring the MCP and memory surfaces,
7
- * connecting an external SaaS bridge, and moving the transcript out of the
8
- * terminal (clipboard, HTML export, a share link). The handlers do real work
9
- * where a backing capability exists — they render the live transcript to HTML
10
- * through the {@link publishTranscript} publisher, drive an {@link MCPClientPool}
11
- * over the workspace MCP config, reflect the working-memory card from the
12
- * capability deck, and reach the Composio catalog through the SaaS gateway — and
13
- * fall back to an *informative* status (never a dead placeholder) when a backend
14
- * is unreachable in the current environment.
15
- *
16
- * The two family commands (`/memory`, `/composio`) are built from
17
- * {@link SubCommand} tables via {@link familyRunner}, so their verb dispatch is a
18
- * lookup, not an `if`-ladder. Overlay surfaces (`mcp`, `memory`, `composio`)
19
- * carry the *gathered* text into the plugin modal payload, so the dialog renders
20
- * the real state the command collected rather than a fixed line.
21
- */
22
- import type { SlashCommand } from "../../contract";
23
- /**
24
- * The integration command group: auth launchers, the MCP/memory/composio
25
- * bridges, and the clipboard / export / share I/O verbs. Appended to the slash
26
- * registry by the integrator alongside the other groups.
27
- */
28
- export declare const integrationCommands: SlashCommand[];
@@ -1,18 +0,0 @@
1
- /**
2
- * Integration slash commands — focused behavioral tests.
3
- *
4
- * Each handler is exercised through a scripted fake {@link SlashContext} that
5
- * records the overlay requests (`openModal`) and status toasts (`setStatus`) the
6
- * handlers raise. The coverage walks every command and family verb:
7
- * 1. The auth/bridge launchers (`/login`, `/logout`, `/mcp`) open the right
8
- * modal kind, and a named `/login` threads the provider into the payload.
9
- * 2. `/memory` reflects the real working-memory card (status / tools / on /
10
- * off) and carries the gathered text into the plugin overlay.
11
- * 3. `/composio` reports the missing-key state specifically when no
12
- * `COMPOSIO_API_KEY` is configured, and warns on a missing connect target.
13
- * 4. `/copy` extracts the newest assistant prose and writes it through the
14
- * injected clipboard, warning when there is nothing to copy.
15
- * 5. `/export` renders the live transcript to an HTML file (and warns on an
16
- * empty transcript); `/share` reuses that path and degrades informatively.
17
- */
18
- export {};
@@ -1,72 +0,0 @@
1
- /**
2
- * Shared slash-command helpers — the small, pure toolkit every command group is
3
- * written against.
4
- *
5
- * The console's slash catalog is split into topic groups (transcript control,
6
- * the workbench pickers, the integration bridges). Each group is its own module
7
- * exporting a `SlashCommand[]`; this file holds the handful of helpers they all
8
- * lean on so the groups stay free of duplicated wiring and the family
9
- * sub-command dispatch lives in exactly one place.
10
- *
11
- * Two stances every group keeps:
12
- * 1. **Handlers are thin.** A `run(ctx)` never reaches into React, the
13
- * filesystem, or a provider SDK; every effect goes through the injected
14
- * {@link SlashContext}. The handler decides *which* effect to raise.
15
- * 2. **Families are tables, not ladders.** A command with sub-verbs (e.g.
16
- * `/memory note|show|forget`) is built from a {@link SubCommand} table via
17
- * {@link familyRunner}, never a hand-written `if`-chain.
18
- */
19
- import type { SlashContext, SlashOutcome, StatusMessage } from "../../contract";
20
- /**
21
- * The family labels the catalog groups commands under for `/help` and
22
- * completion. Named constants (not bare strings scattered across rows) so the
23
- * grouping a command declares and the grouping the help view renders cannot
24
- * drift apart.
25
- */
26
- export declare const FAMILY: {
27
- readonly composio: "composio";
28
- readonly memory: "memory";
29
- readonly scopedModels: "models-for";
30
- readonly theme: "theme";
31
- };
32
- /** The settled "command ran, nothing more to do" outcome. */
33
- export declare const HANDLED: SlashOutcome;
34
- /** Mint an info-tone status toast. */
35
- export declare function info(text: string): StatusMessage;
36
- /** Mint a warning-tone status toast (used for usage hints on bad args). */
37
- export declare function warn(text: string): StatusMessage;
38
- /**
39
- * Split a family command's argument string into a leading sub-command verb and
40
- * the remainder, both trimmed. An empty argument string yields an empty verb so
41
- * a family command can show its own usage when invoked bare.
42
- *
43
- * @param args the raw trailing argument string from {@link SlashContext.args}
44
- */
45
- export declare function splitVerb(args: string): {
46
- verb: string;
47
- rest: string;
48
- };
49
- /**
50
- * One sub-command of a command family — its verb, a one-line description for the
51
- * usage list, and the thin action it runs through the {@link SlashContext}.
52
- */
53
- export interface SubCommand {
54
- /** The sub-command verb, lower-cased (e.g. `add`, `list`, `clear`). */
55
- readonly verb: string;
56
- /** One-line description rendered in the family's usage toast. */
57
- readonly describe: string;
58
- /** Run the sub-command; `rest` is the argument tail after the verb. */
59
- run(ctx: SlashContext, rest: string): SlashOutcome;
60
- }
61
- /**
62
- * Build a family command's `run` from a sub-command table.
63
- *
64
- * The family handler is a single thin function whose branch structure is
65
- * *generated* from the table: it splits the verb, looks it up, and runs the
66
- * matching action — falling back to a usage toast (assembled from the table's
67
- * descriptions) when the verb is missing or unknown.
68
- *
69
- * @param family the family label, used in the usage header
70
- * @param subs the sub-command table for this family
71
- */
72
- export declare function familyRunner(family: string, subs: readonly SubCommand[]): (ctx: SlashContext) => SlashOutcome;
@@ -1,24 +0,0 @@
1
- /**
2
- * Transcript & session-control slash commands.
3
- *
4
- * The first topic group of the console's slash catalog: the verbs that reset,
5
- * rename, branch, inspect, or leave the live session view. Every row is a thin
6
- * {@link SlashCommand} whose `run` drives the injected {@link SlashContext} — a
7
- * reducer event, a conductor call, a modal, or an exit request — and settles to
8
- * {@link HANDLED}. Nothing here reaches into React, the filesystem, or a
9
- * provider SDK directly; backend work flows through the {@link SessionConductor}.
10
- *
11
- * The rename, stats, condense, and reload verbs are backed by real conductor
12
- * surface ({@link SessionConductor.setSessionName}, {@link SessionConductor.stats},
13
- * {@link SessionConductor.condense}). Where the conductor cannot accept a richer
14
- * input (the condense path is parameterless on this build), the closest real
15
- * action is taken and the status line explains precisely what was applied.
16
- */
17
- import type { SlashCommand } from "../../contract";
18
- /**
19
- * The transcript / session-control group, in listing order.
20
- *
21
- * Appended into the slash registry by the catalog integrator; this module owns
22
- * only the rows, never the wiring.
23
- */
24
- export declare const transcriptCommands: SlashCommand[];
@@ -1,10 +0,0 @@
1
- /**
2
- * Focused tests for the transcript / session-control slash group.
3
- *
4
- * Each command is exercised against a scripted {@link SlashContext} fake that
5
- * records every effect it raises (reducer events, status toasts, modal opens,
6
- * conductor calls, exit requests). The assertions check that each verb raises
7
- * exactly the effect its contract promises and settles to `handled` without
8
- * throwing.
9
- */
10
- export {};