dispach 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +596 -0
- package/dist/App-dxqm39zx.js +11 -0
- package/dist/App-dxqm39zx.js.map +25 -0
- package/dist/ConfigEditor-7v5nebvy.js +6 -0
- package/dist/ConfigEditor-7v5nebvy.js.map +11 -0
- package/dist/KeyProbe-vjhmdpx6.js +5 -0
- package/dist/KeyProbe-vjhmdpx6.js.map +11 -0
- package/dist/Picker-jxaesaxy.js +5 -0
- package/dist/Picker-jxaesaxy.js.map +10 -0
- package/dist/SessionPicker-z2t0p4b5.js +5 -0
- package/dist/SessionPicker-z2t0p4b5.js.map +11 -0
- package/dist/SkillBrowser-yyf2gy0q.js +5 -0
- package/dist/SkillBrowser-yyf2gy0q.js.map +11 -0
- package/dist/WizardApp-12ndxgqv.js +5 -0
- package/dist/WizardApp-12ndxgqv.js.map +13 -0
- package/dist/agents.d.ts +9 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/browse.d.ts +63 -0
- package/dist/browse.d.ts.map +1 -0
- package/dist/client.d.ts +25 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +34 -0
- package/dist/client.js.map +11 -0
- package/dist/components/App.d.ts +28 -0
- package/dist/components/App.d.ts.map +1 -0
- package/dist/components/Banner.d.ts +16 -0
- package/dist/components/Banner.d.ts.map +1 -0
- package/dist/components/Brandmark.d.ts +31 -0
- package/dist/components/Brandmark.d.ts.map +1 -0
- package/dist/components/CheckList.d.ts +38 -0
- package/dist/components/CheckList.d.ts.map +1 -0
- package/dist/components/CommandOutput.d.ts +29 -0
- package/dist/components/CommandOutput.d.ts.map +1 -0
- package/dist/components/ConfigEditor.d.ts +64 -0
- package/dist/components/ConfigEditor.d.ts.map +1 -0
- package/dist/components/HistorySearch.d.ts +23 -0
- package/dist/components/HistorySearch.d.ts.map +1 -0
- package/dist/components/KeyProbe.d.ts +36 -0
- package/dist/components/KeyProbe.d.ts.map +1 -0
- package/dist/components/LineCursor.d.ts +55 -0
- package/dist/components/LineCursor.d.ts.map +1 -0
- package/dist/components/Live.d.ts +17 -0
- package/dist/components/Live.d.ts.map +1 -0
- package/dist/components/Palette.d.ts +21 -0
- package/dist/components/Palette.d.ts.map +1 -0
- package/dist/components/Picker.d.ts +23 -0
- package/dist/components/Picker.d.ts.map +1 -0
- package/dist/components/Prompt.d.ts +20 -0
- package/dist/components/Prompt.d.ts.map +1 -0
- package/dist/components/Screen.d.ts +39 -0
- package/dist/components/Screen.d.ts.map +1 -0
- package/dist/components/SelectList.d.ts +34 -0
- package/dist/components/SelectList.d.ts.map +1 -0
- package/dist/components/SessionPicker.d.ts +26 -0
- package/dist/components/SessionPicker.d.ts.map +1 -0
- package/dist/components/SkillBrowser.d.ts +39 -0
- package/dist/components/SkillBrowser.d.ts.map +1 -0
- package/dist/components/Spinner.d.ts +13 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/StatusBar.d.ts +11 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/SummaryCard.d.ts +11 -0
- package/dist/components/SummaryCard.d.ts.map +1 -0
- package/dist/components/TextField.d.ts +39 -0
- package/dist/components/TextField.d.ts.map +1 -0
- package/dist/components/Transcript.d.ts +23 -0
- package/dist/components/Transcript.d.ts.map +1 -0
- package/dist/components/WizardApp.d.ts +18 -0
- package/dist/components/WizardApp.d.ts.map +1 -0
- package/dist/components/WizardFrame.d.ts +19 -0
- package/dist/components/WizardFrame.d.ts.map +1 -0
- package/dist/config-yz0nz51b.js +24 -0
- package/dist/config-yz0nz51b.js.map +10 -0
- package/dist/config.d.ts +71 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/credential-wgt4gvcz.js +19 -0
- package/dist/credential-wgt4gvcz.js.map +10 -0
- package/dist/credential.d.ts +68 -0
- package/dist/credential.d.ts.map +1 -0
- package/dist/daemon.d.ts +47 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/editor.d.ts +81 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/hooks/useElapsed.d.ts +10 -0
- package/dist/hooks/useElapsed.d.ts.map +1 -0
- package/dist/hooks/useTerminalSize.d.ts +14 -0
- package/dist/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/hooks/useTurn.d.ts +41 -0
- package/dist/hooks/useTurn.d.ts.map +1 -0
- package/dist/index-2cvtz0fy.js +903 -0
- package/dist/index-2cvtz0fy.js.map +194 -0
- package/dist/index-3nwfz9jq.js +12 -0
- package/dist/index-3nwfz9jq.js.map +11 -0
- package/dist/index-6b7qvh1x.js +6 -0
- package/dist/index-6b7qvh1x.js.map +10 -0
- package/dist/index-6z0yr17z.js +12 -0
- package/dist/index-6z0yr17z.js.map +11 -0
- package/dist/index-7da4fqcr.js +7 -0
- package/dist/index-7da4fqcr.js.map +11 -0
- package/dist/index-8bmhd2hj.js +6 -0
- package/dist/index-8bmhd2hj.js.map +10 -0
- package/dist/index-9d011p3q.js +6 -0
- package/dist/index-9d011p3q.js.map +10 -0
- package/dist/index-9f9pp2ef.js +6 -0
- package/dist/index-9f9pp2ef.js.map +10 -0
- package/dist/index-9nsfs0vy.js +6 -0
- package/dist/index-9nsfs0vy.js.map +10 -0
- package/dist/index-9pj1ws0p.js +77 -0
- package/dist/index-9pj1ws0p.js.map +12 -0
- package/dist/index-b5wwtxzk.js +66 -0
- package/dist/index-b5wwtxzk.js.map +12 -0
- package/dist/index-b8zwg8a3.js +6 -0
- package/dist/index-b8zwg8a3.js.map +10 -0
- package/dist/index-bry9bzt3.js +427 -0
- package/dist/index-bry9bzt3.js.map +11 -0
- package/dist/index-bwckzbf8.js +6 -0
- package/dist/index-bwckzbf8.js.map +10 -0
- package/dist/index-cx3vz7sf.js +6 -0
- package/dist/index-cx3vz7sf.js.map +11 -0
- package/dist/index-e8n70sgj.js +6 -0
- package/dist/index-e8n70sgj.js.map +11 -0
- package/dist/index-fvhg0xyd.js +167 -0
- package/dist/index-fvhg0xyd.js.map +19 -0
- package/dist/index-gbnc99j8.js +14 -0
- package/dist/index-gbnc99j8.js.map +13 -0
- package/dist/index-h2yds678.js +7 -0
- package/dist/index-h2yds678.js.map +11 -0
- package/dist/index-j97vttdt.js +10 -0
- package/dist/index-j97vttdt.js.map +10 -0
- package/dist/index-jk0def33.js +6 -0
- package/dist/index-jk0def33.js.map +12 -0
- package/dist/index-jym27m75.js +6 -0
- package/dist/index-jym27m75.js.map +10 -0
- package/dist/index-mgdgx22q.js +10 -0
- package/dist/index-mgdgx22q.js.map +10 -0
- package/dist/index-mrtb5y08.js +6 -0
- package/dist/index-mrtb5y08.js.map +11 -0
- package/dist/index-my5cjx00.js +6 -0
- package/dist/index-my5cjx00.js.map +10 -0
- package/dist/index-qc2vrq9z.js +7 -0
- package/dist/index-qc2vrq9z.js.map +11 -0
- package/dist/index-rqbtm761.js +6 -0
- package/dist/index-rqbtm761.js.map +10 -0
- package/dist/index-rqzg861g.js +6 -0
- package/dist/index-rqzg861g.js.map +10 -0
- package/dist/index-t1xvacym.js +6 -0
- package/dist/index-t1xvacym.js.map +11 -0
- package/dist/index-xgqzk5cq.js +9 -0
- package/dist/index-xgqzk5cq.js.map +12 -0
- package/dist/index-xqyms08r.js +6 -0
- package/dist/index-xqyms08r.js.map +10 -0
- package/dist/index-yr25dnf5.js +6 -0
- package/dist/index-yr25dnf5.js.map +10 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +527 -0
- package/dist/index.js.map +48 -0
- package/dist/init.d.ts +34 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/keymap.d.ts +126 -0
- package/dist/keymap.d.ts.map +1 -0
- package/dist/keys.d.ts +17 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/lib/ambient.d.ts +69 -0
- package/dist/lib/ambient.d.ts.map +1 -0
- package/dist/lib/args.d.ts +33 -0
- package/dist/lib/args.d.ts.map +1 -0
- package/dist/lib/bootstrap.d.ts +84 -0
- package/dist/lib/bootstrap.d.ts.map +1 -0
- package/dist/lib/browse.d.ts +89 -0
- package/dist/lib/browse.d.ts.map +1 -0
- package/dist/lib/browser.d.ts +55 -0
- package/dist/lib/browser.d.ts.map +1 -0
- package/dist/lib/chat-frame.d.ts +156 -0
- package/dist/lib/chat-frame.d.ts.map +1 -0
- package/dist/lib/clipboard.d.ts +32 -0
- package/dist/lib/clipboard.d.ts.map +1 -0
- package/dist/lib/commands.d.ts +26 -0
- package/dist/lib/commands.d.ts.map +1 -0
- package/dist/lib/composer.d.ts +85 -0
- package/dist/lib/composer.d.ts.map +1 -0
- package/dist/lib/config-apply.d.ts +51 -0
- package/dist/lib/config-apply.d.ts.map +1 -0
- package/dist/lib/config-editor.d.ts +113 -0
- package/dist/lib/config-editor.d.ts.map +1 -0
- package/dist/lib/config-env.d.ts +110 -0
- package/dist/lib/config-env.d.ts.map +1 -0
- package/dist/lib/config-rows.d.ts +37 -0
- package/dist/lib/config-rows.d.ts.map +1 -0
- package/dist/lib/config-view.d.ts +133 -0
- package/dist/lib/config-view.d.ts.map +1 -0
- package/dist/lib/confirm.d.ts +86 -0
- package/dist/lib/confirm.d.ts.map +1 -0
- package/dist/lib/const.d.ts +213 -0
- package/dist/lib/const.d.ts.map +1 -0
- package/dist/lib/csi.d.ts +70 -0
- package/dist/lib/csi.d.ts.map +1 -0
- package/dist/lib/curated.d.ts +44 -0
- package/dist/lib/curated.d.ts.map +1 -0
- package/dist/lib/daemon-plan.d.ts +151 -0
- package/dist/lib/daemon-plan.d.ts.map +1 -0
- package/dist/lib/dotenv-edit.d.ts +30 -0
- package/dist/lib/dotenv-edit.d.ts.map +1 -0
- package/dist/lib/env.d.ts +10 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/exit.d.ts +170 -0
- package/dist/lib/exit.d.ts.map +1 -0
- package/dist/lib/help.d.ts +10 -0
- package/dist/lib/help.d.ts.map +1 -0
- package/dist/lib/init-flow.d.ts +539 -0
- package/dist/lib/init-flow.d.ts.map +1 -0
- package/dist/lib/init-skills.d.ts +46 -0
- package/dist/lib/init-skills.d.ts.map +1 -0
- package/dist/lib/keyboard.d.ts +76 -0
- package/dist/lib/keyboard.d.ts.map +1 -0
- package/dist/lib/keys-view.d.ts +57 -0
- package/dist/lib/keys-view.d.ts.map +1 -0
- package/dist/lib/launchd.d.ts +151 -0
- package/dist/lib/launchd.d.ts.map +1 -0
- package/dist/lib/lifecycle.d.ts +126 -0
- package/dist/lib/lifecycle.d.ts.map +1 -0
- package/dist/lib/log-follow.d.ts +71 -0
- package/dist/lib/log-follow.d.ts.map +1 -0
- package/dist/lib/mouse.d.ts +84 -0
- package/dist/lib/mouse.d.ts.map +1 -0
- package/dist/lib/multiselect.d.ts +37 -0
- package/dist/lib/multiselect.d.ts.map +1 -0
- package/dist/lib/origins.d.ts +40 -0
- package/dist/lib/origins.d.ts.map +1 -0
- package/dist/lib/output.d.ts +29 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/palette.d.ts +69 -0
- package/dist/lib/palette.d.ts.map +1 -0
- package/dist/lib/probe.d.ts +158 -0
- package/dist/lib/probe.d.ts.map +1 -0
- package/dist/lib/providers.d.ts +63 -0
- package/dist/lib/providers.d.ts.map +1 -0
- package/dist/lib/provision.d.ts +163 -0
- package/dist/lib/provision.d.ts.map +1 -0
- package/dist/lib/remove-plan.d.ts +120 -0
- package/dist/lib/remove-plan.d.ts.map +1 -0
- package/dist/lib/render.d.ts +78 -0
- package/dist/lib/render.d.ts.map +1 -0
- package/dist/lib/resume.d.ts +69 -0
- package/dist/lib/resume.d.ts.map +1 -0
- package/dist/lib/rows.d.ts +69 -0
- package/dist/lib/rows.d.ts.map +1 -0
- package/dist/lib/sandbox.d.ts +101 -0
- package/dist/lib/sandbox.d.ts.map +1 -0
- package/dist/lib/schema.d.ts +491 -0
- package/dist/lib/schema.d.ts.map +1 -0
- package/dist/lib/screen.d.ts +102 -0
- package/dist/lib/screen.d.ts.map +1 -0
- package/dist/lib/scroll.d.ts +64 -0
- package/dist/lib/scroll.d.ts.map +1 -0
- package/dist/lib/select.d.ts +23 -0
- package/dist/lib/select.d.ts.map +1 -0
- package/dist/lib/service-env.d.ts +38 -0
- package/dist/lib/service-env.d.ts.map +1 -0
- package/dist/lib/service.d.ts +102 -0
- package/dist/lib/service.d.ts.map +1 -0
- package/dist/lib/session-commands.d.ts +229 -0
- package/dist/lib/session-commands.d.ts.map +1 -0
- package/dist/lib/session-key.d.ts +55 -0
- package/dist/lib/session-key.d.ts.map +1 -0
- package/dist/lib/sessions-view.d.ts +31 -0
- package/dist/lib/sessions-view.d.ts.map +1 -0
- package/dist/lib/source-cache.d.ts +105 -0
- package/dist/lib/source-cache.d.ts.map +1 -0
- package/dist/lib/source.d.ts +281 -0
- package/dist/lib/source.d.ts.map +1 -0
- package/dist/lib/sources.d.ts +107 -0
- package/dist/lib/sources.d.ts.map +1 -0
- package/dist/lib/spawn.d.ts +56 -0
- package/dist/lib/spawn.d.ts.map +1 -0
- package/dist/lib/stdin-tap.d.ts +41 -0
- package/dist/lib/stdin-tap.d.ts.map +1 -0
- package/dist/lib/subcommand.d.ts +57 -0
- package/dist/lib/subcommand.d.ts.map +1 -0
- package/dist/lib/systemd.d.ts +60 -0
- package/dist/lib/systemd.d.ts.map +1 -0
- package/dist/lib/templates.d.ts +35 -0
- package/dist/lib/templates.d.ts.map +1 -0
- package/dist/lib/terminal.d.ts +98 -0
- package/dist/lib/terminal.d.ts.map +1 -0
- package/dist/lib/text-selection.d.ts +75 -0
- package/dist/lib/text-selection.d.ts.map +1 -0
- package/dist/lib/theme.d.ts +90 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/types.d.ts +467 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/warnings.d.ts +79 -0
- package/dist/lib/warnings.d.ts.map +1 -0
- package/dist/lib/width.d.ts +39 -0
- package/dist/lib/width.d.ts.map +1 -0
- package/dist/lib/wizard.d.ts +95 -0
- package/dist/lib/wizard.d.ts.map +1 -0
- package/dist/lib/wordmark.d.ts +60 -0
- package/dist/lib/wordmark.d.ts.map +1 -0
- package/dist/lib/wrap.d.ts +74 -0
- package/dist/lib/wrap.d.ts.map +1 -0
- package/dist/memory.d.ts +25 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/model.d.ts +47 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/plugins.d.ts +15 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/remove.d.ts +52 -0
- package/dist/remove.d.ts.map +1 -0
- package/dist/run.d.ts +42 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/schedules.d.ts +41 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/serve.d.ts +41 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/sessions.d.ts +13 -0
- package/dist/sessions.d.ts.map +1 -0
- package/dist/skills.d.ts +80 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/soul.d.ts +19 -0
- package/dist/soul.d.ts.map +1 -0
- package/dist/sources.d.ts +32 -0
- package/dist/sources.d.ts.map +1 -0
- package/dist/start.d.ts +26 -0
- package/dist/start.d.ts.map +1 -0
- package/dist/stop.d.ts +58 -0
- package/dist/stop.d.ts.map +1 -0
- package/dist/terminal-setup.d.ts +31 -0
- package/dist/terminal-setup.d.ts.map +1 -0
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/transcript.d.ts +124 -0
- package/dist/transcript.d.ts.map +1 -0
- package/dist/validate.d.ts +36 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/web-w7r68df1.js +14 -0
- package/dist/web-w7r68df1.js.map +11 -0
- package/dist/web.d.ts +36 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/wire.d.ts +10 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +33 -0
- package/dist/wire.js.map +10 -0
- package/dist/workspace.d.ts +19 -0
- package/dist/workspace.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contracts between modules — what the parser produces, what a command takes, what a component
|
|
3
|
+
* receives. Domain shapes live in `types.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import type { BrowseRow, InstallReport } from "#lib/browse";
|
|
6
|
+
import type { Slice } from "#lib/scroll";
|
|
7
|
+
import type { SessionRowSource } from "#lib/sessions-view";
|
|
8
|
+
import type { AgentSource } from "#lib/source";
|
|
9
|
+
import type { CatalogueEntry } from "#lib/source-cache";
|
|
10
|
+
import type { TextSelection } from "#lib/text-selection";
|
|
11
|
+
import type { EditorState, EnvFacts, KeyState, LiveTurn, RenderMode, TranscriptRow, TranscriptState, TurnStats, TurnStatus } from "#lib/types";
|
|
12
|
+
export type FlagKind = "boolean" | "string" | "number";
|
|
13
|
+
export interface FlagSpec {
|
|
14
|
+
/** Long form, written without the leading dashes. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly short?: string;
|
|
17
|
+
readonly kind: FlagKind;
|
|
18
|
+
readonly help: string;
|
|
19
|
+
/** Shown in help as `--session <key>`. Value-taking flags should set it. */
|
|
20
|
+
readonly placeholder?: string;
|
|
21
|
+
/** Appended to the help line in parentheses. */
|
|
22
|
+
readonly defaultHelp?: string;
|
|
23
|
+
/** Numbers only. Both are enforced by the parser, not by the call site. */
|
|
24
|
+
readonly min?: number;
|
|
25
|
+
readonly integer?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The value to use when the flag is written with nothing after it.
|
|
28
|
+
*
|
|
29
|
+
* A value-taking flag normally consumes the next token *unconditionally*, dash or not, because
|
|
30
|
+
* whether a token is a value is the spec's decision and not the token's — `--input -5` means the
|
|
31
|
+
* text "-5". Declaring `bare` inverts that for one flag: a missing next token, or one starting with
|
|
32
|
+
* a dash, means the flag was written on its own and this value stands in.
|
|
33
|
+
*
|
|
34
|
+
* Per-spec rather than global, because the safety of the inversion is a fact about the *field*.
|
|
35
|
+
* A session key never starts with a dash, so `--session --plain` can only mean a bare `--session`;
|
|
36
|
+
* an `--input` beginning with a dash is ordinary text, and giving that flag a bare form would make
|
|
37
|
+
* a real message unsendable.
|
|
38
|
+
*/
|
|
39
|
+
readonly bare?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ArgSpec {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly required: boolean;
|
|
44
|
+
readonly variadic?: boolean;
|
|
45
|
+
readonly help: string;
|
|
46
|
+
/**
|
|
47
|
+
* The fixed set this argument accepts, when it is a verb rather than a value.
|
|
48
|
+
*
|
|
49
|
+
* Structured rather than prose in `help`, because prose is invisible to every check. `soul`'s
|
|
50
|
+
* single action lived inside its help string for three phases, so nothing could tell whether
|
|
51
|
+
* the command still accepted what the help claimed — and a second action-taking command made
|
|
52
|
+
* that a class of drift rather than one oddity. `help.ts` renders these as an `actions:` block
|
|
53
|
+
* and a test asserts every action the command body accepts appears here, which is the same
|
|
54
|
+
* guarantee the flag table already gives flags.
|
|
55
|
+
*/
|
|
56
|
+
readonly choices?: readonly {
|
|
57
|
+
readonly value: string;
|
|
58
|
+
readonly help: string;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface CommandSpec {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
readonly summary: string;
|
|
64
|
+
readonly args: readonly ArgSpec[];
|
|
65
|
+
readonly flags: readonly FlagSpec[];
|
|
66
|
+
/**
|
|
67
|
+
* How this command appears inside a running session, as a slash command.
|
|
68
|
+
*
|
|
69
|
+
* - `view` — a bespoke interactive screen exists for it.
|
|
70
|
+
* - `output` — run it and show the text it prints, in a scrollable pane.
|
|
71
|
+
* - `hidden` — not offered in a session at all.
|
|
72
|
+
*
|
|
73
|
+
* Required, and that is the point. The palette is generated from this table so a new flag reaches
|
|
74
|
+
* the TUI with nothing to remember, and hiding a command that does not belong in a session — `stop`
|
|
75
|
+
* would end the session it was typed into — has to be *declared* rather than achieved by leaving it
|
|
76
|
+
* out of a second hand-written list. A second list is the drift `session-commands.ts` was written to
|
|
77
|
+
* end; making the field mandatory means a new command cannot be silently absent instead.
|
|
78
|
+
*/
|
|
79
|
+
readonly inSession: "view" | "output" | "hidden";
|
|
80
|
+
/**
|
|
81
|
+
* What to say when this command is handed a positional it does not take.
|
|
82
|
+
*
|
|
83
|
+
* The generic refusal reports a *count* — "takes 0 argument(s), got 1. Unexpected: milo. Quote a
|
|
84
|
+
* value containing spaces." — which is the right sentence for a stray token and the wrong one when
|
|
85
|
+
* the token is something a reasonable person expected the command to accept. `init milo` is exactly
|
|
86
|
+
* that: it read as "name the agent milo" and meant "write it to ./milo", so the argument was dropped
|
|
87
|
+
* and the two readings have to be named at the point of the mistake, where the person still
|
|
88
|
+
* remembers what they meant.
|
|
89
|
+
*
|
|
90
|
+
* On the spec rather than in the dispatch, because the parser refuses before any `case` block runs —
|
|
91
|
+
* a check written in `index.ts` would be unreachable. Optional: a command with no such confusion
|
|
92
|
+
* keeps the generic sentence, which is the correct one for a typo.
|
|
93
|
+
*/
|
|
94
|
+
readonly unexpectedArgHint?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Whether this command wants a **running host** behind it.
|
|
97
|
+
*
|
|
98
|
+
* Read by the first-run bootstrap: `true` means that if no server is up, one is installed and
|
|
99
|
+
* started before the command runs, announced in one line. `false` means the command is answered
|
|
100
|
+
* from files and the store alone, and must not cause a service to be installed as a side effect
|
|
101
|
+
* of being asked a question — `validate`, `workspace`, `soul`, `keys` and `terminal-setup` are
|
|
102
|
+
* all in that group.
|
|
103
|
+
*
|
|
104
|
+
* **Required, for the reason `inSession` is.** The bootstrap is the most invasive thing this
|
|
105
|
+
* product does, so which commands trigger it cannot be a hand-kept list in `index.ts` that a
|
|
106
|
+
* new command is silently absent from — or silently included in. `boundaries.test.ts` fails when
|
|
107
|
+
* a spec omits it, which makes the decision one somebody has to take on purpose.
|
|
108
|
+
*
|
|
109
|
+
* Note what this is *not* about: whether the command constructs a `Runtime`. `run` builds one
|
|
110
|
+
* in-process today and still declares `true`, because the agent it talks to should be reachable
|
|
111
|
+
* from a browser and a channel at the same time. The question is "should a server exist", not
|
|
112
|
+
* "does this code path need one".
|
|
113
|
+
*/
|
|
114
|
+
readonly needsServer: boolean;
|
|
115
|
+
}
|
|
116
|
+
export type FlagValue = string | number | boolean;
|
|
117
|
+
export interface FlagValues {
|
|
118
|
+
/** Throws if the spec declares this flag as something other than a string. */
|
|
119
|
+
str(name: string): string | undefined;
|
|
120
|
+
num(name: string): number | undefined;
|
|
121
|
+
/** Absent switches are `false`, never `undefined` — there is no third state. */
|
|
122
|
+
bool(name: string): boolean;
|
|
123
|
+
has(name: string): boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface Parsed {
|
|
126
|
+
readonly command: CommandSpec;
|
|
127
|
+
readonly positionals: readonly string[];
|
|
128
|
+
readonly flags: FlagValues;
|
|
129
|
+
}
|
|
130
|
+
export type ParseResult = {
|
|
131
|
+
readonly kind: "command";
|
|
132
|
+
readonly parsed: Parsed;
|
|
133
|
+
} | {
|
|
134
|
+
readonly kind: "help";
|
|
135
|
+
readonly command: CommandSpec | undefined;
|
|
136
|
+
} | {
|
|
137
|
+
readonly kind: "version";
|
|
138
|
+
}
|
|
139
|
+
/** Invoked with nothing to do. Print help, exit non-zero — being lost is not success. */
|
|
140
|
+
| {
|
|
141
|
+
readonly kind: "usage";
|
|
142
|
+
};
|
|
143
|
+
export interface ModeInputs {
|
|
144
|
+
readonly json: boolean;
|
|
145
|
+
readonly plain: boolean;
|
|
146
|
+
/** `--input <text>`: one turn, print, exit. */
|
|
147
|
+
readonly oneShot: boolean;
|
|
148
|
+
readonly stdinIsTTY: boolean;
|
|
149
|
+
readonly stdoutIsTTY: boolean;
|
|
150
|
+
readonly env: EnvFacts;
|
|
151
|
+
}
|
|
152
|
+
export interface ModeDecision {
|
|
153
|
+
readonly mode: RenderMode;
|
|
154
|
+
/** Printable, and what makes this resolution debuggable rather than mysterious. */
|
|
155
|
+
readonly because: string;
|
|
156
|
+
}
|
|
157
|
+
export interface TerminalHandles {
|
|
158
|
+
readonly out: {
|
|
159
|
+
write(chunk: string): boolean;
|
|
160
|
+
readonly isTTY?: boolean | undefined;
|
|
161
|
+
};
|
|
162
|
+
readonly in: {
|
|
163
|
+
readonly isTTY?: boolean | undefined;
|
|
164
|
+
setRawMode?: ((mode: boolean) => void) | undefined;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Every command takes a plain options object and returns an exit code. It never calls
|
|
169
|
+
* `process.exit` itself: that would discard buffered stdout on a pipe, and it makes a command
|
|
170
|
+
* impossible to call from a test.
|
|
171
|
+
*/
|
|
172
|
+
/** `web run | open | url` — point a browser at a running host, or print where it is. */
|
|
173
|
+
export interface WebOptions {
|
|
174
|
+
readonly action?: "run" | "open" | "url" | undefined;
|
|
175
|
+
/** The agent to open. Absent opens the page and lets it list what the host has. */
|
|
176
|
+
readonly manifestPath?: string;
|
|
177
|
+
readonly noOpen?: boolean;
|
|
178
|
+
readonly store?: string;
|
|
179
|
+
readonly json?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface RunOptions {
|
|
182
|
+
/** Absent = bare `run`: the sandbox decides (picker, auto-run, or the wizard). */
|
|
183
|
+
readonly manifestPath?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Which conversation to open.
|
|
186
|
+
*
|
|
187
|
+
* Three states, not two. A key names one; **`""`** is a bare `--session`, meaning "show me the list";
|
|
188
|
+
* absent means a new conversation. The empty string carries real intent here, which is why it is not
|
|
189
|
+
* normalised away on the boundary — `lib/args.ts` produces it from `FlagSpec.bare`.
|
|
190
|
+
*/
|
|
191
|
+
readonly sessionKey?: string;
|
|
192
|
+
/** `--continue`: the most recent conversation with this agent, without asking. */
|
|
193
|
+
readonly continueSession?: boolean;
|
|
194
|
+
/** Run a single turn with this input and exit. Non-interactive, and always plain. */
|
|
195
|
+
readonly once?: string;
|
|
196
|
+
readonly store?: string;
|
|
197
|
+
readonly ephemeral?: boolean;
|
|
198
|
+
readonly quiet?: boolean;
|
|
199
|
+
readonly showReasoning?: boolean;
|
|
200
|
+
/** Turns off the reasoning stream that a thinking model shows by default. */
|
|
201
|
+
readonly noReasoning?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Do not negotiate the kitty keyboard protocol for this session.
|
|
204
|
+
*
|
|
205
|
+
* `undefined` means "no opinion", which `negotiateKeyboard` resolves from `<ENVPREFIX>NO_CSI_U` —
|
|
206
|
+
* so this is threaded as-is rather than coerced to a boolean, or a flag nobody passed would
|
|
207
|
+
* silently override an environment somebody set.
|
|
208
|
+
*/
|
|
209
|
+
readonly noEnhancedKeys?: boolean;
|
|
210
|
+
readonly plain?: boolean;
|
|
211
|
+
}
|
|
212
|
+
export interface MemoryOptions {
|
|
213
|
+
readonly action: string;
|
|
214
|
+
readonly manifestPath: string;
|
|
215
|
+
/** The words to rank against. Required for `search`, unused by `rebuild`. */
|
|
216
|
+
readonly query?: string;
|
|
217
|
+
readonly store?: string;
|
|
218
|
+
readonly limit?: number;
|
|
219
|
+
/** Show passages below the manifest's threshold too, marked. */
|
|
220
|
+
readonly all?: boolean;
|
|
221
|
+
readonly json?: boolean;
|
|
222
|
+
}
|
|
223
|
+
export interface SchedulesOptions {
|
|
224
|
+
readonly manifestPath: string;
|
|
225
|
+
/** Show one schedule in full instead of the list. */
|
|
226
|
+
readonly id?: string;
|
|
227
|
+
/** Switch a schedule on. It fires at its next occurrence, never immediately. */
|
|
228
|
+
readonly enable?: string;
|
|
229
|
+
/** Switch a schedule off. It stays listed — decision 9.4. */
|
|
230
|
+
readonly disable?: string;
|
|
231
|
+
/** List deliverable addresses instead of schedules — what `deliver.to` takes. */
|
|
232
|
+
readonly recipients?: boolean;
|
|
233
|
+
readonly store?: string;
|
|
234
|
+
readonly json?: boolean;
|
|
235
|
+
}
|
|
236
|
+
export interface SessionsOptions {
|
|
237
|
+
readonly manifestPath: string;
|
|
238
|
+
/** Inspect this session instead of listing them. */
|
|
239
|
+
readonly sessionKey?: string;
|
|
240
|
+
readonly store?: string;
|
|
241
|
+
readonly json?: boolean;
|
|
242
|
+
readonly limit?: number;
|
|
243
|
+
/** Delete the named session's history. Requires `sessionKey`. */
|
|
244
|
+
readonly clear?: boolean;
|
|
245
|
+
/** Show turn records rather than messages. Requires `sessionKey`. */
|
|
246
|
+
readonly turns?: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface ValidateOptions {
|
|
249
|
+
readonly manifestPath: string;
|
|
250
|
+
readonly json?: boolean;
|
|
251
|
+
}
|
|
252
|
+
export interface InitOptions {
|
|
253
|
+
readonly dir?: string;
|
|
254
|
+
readonly user?: string;
|
|
255
|
+
readonly name?: string;
|
|
256
|
+
readonly purpose?: string;
|
|
257
|
+
readonly preset?: string;
|
|
258
|
+
readonly model?: string;
|
|
259
|
+
readonly baseUrl?: string;
|
|
260
|
+
readonly apiKeyEnv?: string;
|
|
261
|
+
/** `none`, `read`, or `full` — how much of this machine the agent may touch. */
|
|
262
|
+
readonly system?: string;
|
|
263
|
+
readonly web?: string;
|
|
264
|
+
readonly webBackend?: string;
|
|
265
|
+
/** `none` or `connected` — whether the agent reaches other apps through Composio. */
|
|
266
|
+
readonly composio?: string;
|
|
267
|
+
/** `none` or `connected` — whether people can message it on Telegram. */
|
|
268
|
+
readonly telegram?: string;
|
|
269
|
+
/** One Telegram handle, or empty for an allowlist that permits nobody. */
|
|
270
|
+
readonly telegramAllow?: string;
|
|
271
|
+
/** `none` or `local` — whether to serve the HTTP API on loopback. */
|
|
272
|
+
readonly server?: string;
|
|
273
|
+
/** `none`, `daily` or `hourly` — what the agent runs on a schedule. */
|
|
274
|
+
readonly schedules?: string;
|
|
275
|
+
/** `none` or `starter` — whether to scaffold a skills directory, and whether to seed it. */
|
|
276
|
+
readonly skills?: string;
|
|
277
|
+
readonly daemon?: string;
|
|
278
|
+
/** Take every default; never ask, even at a terminal. */
|
|
279
|
+
readonly yes?: boolean;
|
|
280
|
+
readonly plain?: boolean;
|
|
281
|
+
}
|
|
282
|
+
export interface AgentsOptions {
|
|
283
|
+
readonly manifestPaths: readonly string[];
|
|
284
|
+
readonly json?: boolean;
|
|
285
|
+
}
|
|
286
|
+
export interface PluginsOptions {
|
|
287
|
+
readonly manifestPath: string;
|
|
288
|
+
readonly json?: boolean;
|
|
289
|
+
}
|
|
290
|
+
export interface AppProps {
|
|
291
|
+
/**
|
|
292
|
+
* Where the agent is, not which object it is.
|
|
293
|
+
*
|
|
294
|
+
* This was an `Agent` and an `EventBus`, which is what made the screen a second *owner* of a
|
|
295
|
+
* runtime rather than a view of one — and with an always-on server that meant two writers on
|
|
296
|
+
* one store. `lib/source.ts` has the two implementations; nothing in this component knows
|
|
297
|
+
* which it has, except `/status`, whose whole job is to say.
|
|
298
|
+
*/
|
|
299
|
+
readonly source: AgentSource;
|
|
300
|
+
readonly sessionKey: string;
|
|
301
|
+
readonly model: string;
|
|
302
|
+
/** Notes printed once above the conversation: version, session, store, any reaped turn. */
|
|
303
|
+
readonly initial: TranscriptState;
|
|
304
|
+
/**
|
|
305
|
+
* The key Ink reported, with its modifiers read off the raw bytes.
|
|
306
|
+
*
|
|
307
|
+
* Injected because the tap it reads from has to be registered *before* `render`, which a component
|
|
308
|
+
* cannot do for itself. Optional, and the default is identity: a frame test mounts this component with
|
|
309
|
+
* no stdin to tap, and a missing correction has to mean "trust Ink" rather than "crash".
|
|
310
|
+
*/
|
|
311
|
+
readonly correctKeys?: (key: KeyState, input: string) => KeyState;
|
|
312
|
+
readonly showReasoning: boolean;
|
|
313
|
+
readonly quiet: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Asked for `/restart`. The component unmounts; whoever mounted it rebuilds the agent.
|
|
316
|
+
*
|
|
317
|
+
* A callback rather than a return value because Ink owns the exit: the screen has to come down
|
|
318
|
+
* before a new runtime prints its banner, and only `useApp().exit` can bring it down.
|
|
319
|
+
*/
|
|
320
|
+
readonly onRestart?: (draft: string) => void;
|
|
321
|
+
/**
|
|
322
|
+
* A message that was being written when the last agent was torn down.
|
|
323
|
+
*
|
|
324
|
+
* The only state that has to survive a `/restart`, and the only one that cannot survive it on its
|
|
325
|
+
* own: everything else is either persisted in the store or rebuilt from the manifest, while an
|
|
326
|
+
* unsent draft lives in a component that the restart unmounts. History is not carried across —
|
|
327
|
+
* it is the store's, and a restart re-reads it.
|
|
328
|
+
*/
|
|
329
|
+
readonly initialDraft?: string;
|
|
330
|
+
/**
|
|
331
|
+
* The agent's manifest, for a slash command that runs as a child process.
|
|
332
|
+
*
|
|
333
|
+
* A pane runs `<binary> validate <manifest> --plain` rather than calling the function, because Ink
|
|
334
|
+
* owns stdout while a session is mounted — see `lib/subcommand.ts`. Without the path the child would
|
|
335
|
+
* resolve whichever agent the *cwd* suggests, which is a different agent than the one being talked to
|
|
336
|
+
* and would not look wrong in the output.
|
|
337
|
+
*/
|
|
338
|
+
readonly manifestPath?: string;
|
|
339
|
+
/**
|
|
340
|
+
* The catalogue wiring for a hosted `/skills` pane.
|
|
341
|
+
*
|
|
342
|
+
* Injected rather than imported, which is the view contract's rule applied one level up: the host
|
|
343
|
+
* owns the filesystem and the network, the screen owns neither. It is also what keeps `browse.ts` out
|
|
344
|
+
* of this component's import graph — importing it dynamically here while the wizard imported it
|
|
345
|
+
* statically made bun's splitting emit its exports twice, and a `Duplicate export` crashes the built
|
|
346
|
+
* binary while every test, which imports source, passes.
|
|
347
|
+
*
|
|
348
|
+
* Absent means `/skills` falls back to running the command in an output pane, which still works.
|
|
349
|
+
*/
|
|
350
|
+
readonly catalogue?: {
|
|
351
|
+
readonly load: (onStatus: (line: string) => void) => Promise<readonly BrowseRow[]>;
|
|
352
|
+
readonly install: (skills: readonly CatalogueEntry[], manifestPath: string) => Promise<InstallReport>;
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* `/status` — what this agent is and what is actually running.
|
|
356
|
+
*
|
|
357
|
+
* Injected for the same reason `catalogue` is: the host owns the runtime, the screen owns neither it
|
|
358
|
+
* nor the filesystem. Specifically it needs `runtime.channels.started`, which is the difference
|
|
359
|
+
* between a channel that is *configured* and one that is *connected* — and the whole reason this
|
|
360
|
+
* screen exists is that reading the manifest instead produced an agent reporting a live Telegram
|
|
361
|
+
* binding from inside a `run` where nothing was listening.
|
|
362
|
+
*
|
|
363
|
+
* Absent means `/status` is not offered, which is honest; it must never mean the word is accepted
|
|
364
|
+
* and silently billed to the model as prose, which is what it did before this prop existed.
|
|
365
|
+
*/
|
|
366
|
+
readonly status?: () => Promise<string>;
|
|
367
|
+
/**
|
|
368
|
+
* `/context` — the prompt's per-slot cost and the budget it is measured against.
|
|
369
|
+
*
|
|
370
|
+
* Injected like `status`, and session-local for a reason worth stating: `subcommandArgv` passes
|
|
371
|
+
* only a manifest path and `--plain`, so a command pane's child boots its *own* runtime with its
|
|
372
|
+
* own empty session and would confidently report a different conversation's context.
|
|
373
|
+
*/
|
|
374
|
+
readonly contextView?: () => Promise<string>;
|
|
375
|
+
/** The agent's id, for the one-line header. Distinct from `model`, which is the endpoint's. */
|
|
376
|
+
readonly agentName: string;
|
|
377
|
+
/**
|
|
378
|
+
* This conversation has no history, so the splash stands in for the transcript until something is said.
|
|
379
|
+
*
|
|
380
|
+
* Passed rather than derived, and that is the point: the chat does not render stored history — a
|
|
381
|
+
* resumed session's messages live in the store and reach the *model*, not the screen — so "the
|
|
382
|
+
* transcript is empty" is true of a resumed conversation as well, and deriving from it would put a
|
|
383
|
+
* welcome screen in front of a conversation somebody is trying to continue. Only `run` knows whether
|
|
384
|
+
* the key it resolved was freshly generated.
|
|
385
|
+
*/
|
|
386
|
+
readonly freshSession?: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Move to another stored conversation.
|
|
389
|
+
*
|
|
390
|
+
* The component unmounts and the host reopens with the key given — the same route `onRestart` takes,
|
|
391
|
+
* because `useReducer`'s initial state seeds only on mount and a transcript therefore cannot be
|
|
392
|
+
* re-keyed in place. The draft rides across for the same reason it rides across a restart: throwing
|
|
393
|
+
* away a half-written message is a second consequence of asking for the first.
|
|
394
|
+
*/
|
|
395
|
+
readonly onSwitch?: (sessionKey: string, draft: string) => void;
|
|
396
|
+
/**
|
|
397
|
+
* Open a conversation that does not exist yet.
|
|
398
|
+
*
|
|
399
|
+
* The same unmount-and-reopen route as `onSwitch`, and deliberately *not* a call to it with a key the
|
|
400
|
+
* component minted: the key is generated from `randomBytes`, which the host owns and injects, so a
|
|
401
|
+
* component that produced its own would be one no test could pin to a known key. It takes no key for
|
|
402
|
+
* the same reason — there is nothing for the screen to decide.
|
|
403
|
+
*/
|
|
404
|
+
readonly onNew?: (draft: string) => void;
|
|
405
|
+
/**
|
|
406
|
+
* The stored conversations, for the `/sessions` switcher.
|
|
407
|
+
*
|
|
408
|
+
* A function rather than an array, because the list is only wanted when the pane opens and it is a
|
|
409
|
+
* store read — and injected rather than imported, which is the view contract applied one level up: the
|
|
410
|
+
* host owns the filesystem, the screen owns neither it nor the network.
|
|
411
|
+
*/
|
|
412
|
+
readonly sessions?: () => Promise<readonly SessionRowSource[]>;
|
|
413
|
+
/**
|
|
414
|
+
* Load warnings, as a count in the header.
|
|
415
|
+
*
|
|
416
|
+
* The messages themselves are already in the banner. What the header needs is the *number*, because
|
|
417
|
+
* on the alternate screen the banner scrolls out of the window and a session-wide fact that has
|
|
418
|
+
* scrolled away is a fact nobody has. Passed in rather than read off the agent here, so the component
|
|
419
|
+
* stays testable with a plain array — and so the CLI's own demoted-variable notes are counted
|
|
420
|
+
* alongside the runtime's, which only the host knows about.
|
|
421
|
+
*/
|
|
422
|
+
readonly warnings?: readonly string[];
|
|
423
|
+
}
|
|
424
|
+
export interface TranscriptProps {
|
|
425
|
+
/**
|
|
426
|
+
* The live mouse selection, in buffer coordinates, or `undefined`.
|
|
427
|
+
*
|
|
428
|
+
* Buffer coordinates rather than screen ones, so scrolling leaves it alone: the window moves and the
|
|
429
|
+
* selection does not. `undefined` renders exactly what this component rendered before it existed.
|
|
430
|
+
*/
|
|
431
|
+
readonly selection?: TextSelection;
|
|
432
|
+
/** Already flattened and wrapped by `transcriptRows`, so a row here is a row on screen. */
|
|
433
|
+
readonly rows: readonly TranscriptRow[];
|
|
434
|
+
/** Which of them to draw, and how many are out of sight. Decided by `lib/scroll.ts`. */
|
|
435
|
+
readonly slice: Slice;
|
|
436
|
+
}
|
|
437
|
+
export interface LiveProps {
|
|
438
|
+
readonly live: LiveTurn;
|
|
439
|
+
readonly showReasoning: boolean;
|
|
440
|
+
readonly columns: number;
|
|
441
|
+
}
|
|
442
|
+
export interface StatusBarProps {
|
|
443
|
+
readonly status: TurnStatus;
|
|
444
|
+
readonly model: string;
|
|
445
|
+
readonly sessionKey: string;
|
|
446
|
+
readonly elapsedMs: number;
|
|
447
|
+
readonly last: TurnStats | undefined;
|
|
448
|
+
readonly quiet: boolean;
|
|
449
|
+
/**
|
|
450
|
+
* A ^C has been pressed at an idle prompt and the next one leaves.
|
|
451
|
+
*
|
|
452
|
+
* On the status line rather than in a popup because this is where the ^C hint already lives, and the
|
|
453
|
+
* two have to be the same sentence: a footer that reads "^C exits" while a first press has already
|
|
454
|
+
* been absorbed is a footer that lied about the keystroke somebody just made.
|
|
455
|
+
*/
|
|
456
|
+
readonly armed?: boolean;
|
|
457
|
+
/** Prompt fullness as a fraction of the budget, when a step has reported one. */
|
|
458
|
+
readonly pressure?: number;
|
|
459
|
+
/** The phase, once one has been entered. Absent on an agent that declares none. */
|
|
460
|
+
readonly phase?: string;
|
|
461
|
+
}
|
|
462
|
+
export interface PromptProps {
|
|
463
|
+
readonly editor: EditorState;
|
|
464
|
+
readonly busy: boolean;
|
|
465
|
+
/**
|
|
466
|
+
* The screen's width. The box takes it explicitly and the text is wrapped to what is left inside it.
|
|
467
|
+
*
|
|
468
|
+
* Not optional, and that is the point: a composer with no width lets Ink measure the box from its
|
|
469
|
+
* content, which makes a long message wider than the terminal and hands the wrapping to whichever
|
|
470
|
+
* terminal is running it — cut in one, ragged over the border in another.
|
|
471
|
+
*/
|
|
472
|
+
readonly columns: number;
|
|
473
|
+
/**
|
|
474
|
+
* Shown dim, with the cursor on its first character, while the buffer is empty.
|
|
475
|
+
*
|
|
476
|
+
* Only the splash passes one. In the transcript the prompt sits under a conversation that already
|
|
477
|
+
* says what this is, and a permanent "Ask anything…" there would be a label on something obvious.
|
|
478
|
+
*/
|
|
479
|
+
readonly placeholder?: string;
|
|
480
|
+
}
|
|
481
|
+
export interface BrandmarkProps {
|
|
482
|
+
/**
|
|
483
|
+
* The wordmark's rows, already rendered by `lib/wordmark.ts` from `BRAND.name`.
|
|
484
|
+
*
|
|
485
|
+
* Passed in rather than computed here, because the caller has to know the mark's real height to charge
|
|
486
|
+
* the conversation for it — and computing it in both places would be two derivations that can disagree
|
|
487
|
+
* about how many rows are on screen, which on a fixed-height frame is how the layout comes apart.
|
|
488
|
+
*/
|
|
489
|
+
readonly lines: readonly string[];
|
|
490
|
+
}
|
|
491
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,EACT,UAAU,EACb,MAAM,YAAY,CAAA;AAInB,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEtD,MAAM,WAAW,QAAQ;IACrB,qD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AAM,EAAE,CAAA;CACpC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every screen has in common, as data: the header block and the footer's key hints.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this is a module and not a component
|
|
5
|
+
*
|
|
6
|
+
* Three surfaces had a banner before this existed — chat, the wizard, the agent picker — and each
|
|
7
|
+
* decided its own title, its own context lines and its own key hints, in JSX. So the *content* of a
|
|
8
|
+
* header was only observable by mounting a renderer, and the one thing worth asserting about it is
|
|
9
|
+
* exactly that content: whether the agent in scope is named, whether a session-wide warning is still
|
|
10
|
+
* visible after the screen scrolls, whether the footer fits.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is text in, text out. `Screen.tsx` is one consumer; a test asserting a header names
|
|
13
|
+
* the right agent is another, and neither can drift from the other because there is one derivation.
|
|
14
|
+
*
|
|
15
|
+
* ## The rule the header exists to enforce
|
|
16
|
+
*
|
|
17
|
+
* CLAUDE.md: anything true for the whole session belongs where a person still sees it after
|
|
18
|
+
* scrolling. On an inline surface that could be a line printed at the top; on the alternate screen
|
|
19
|
+
* there *is* no scrolling past, so it has to be the header or nowhere. `warnings` is therefore part
|
|
20
|
+
* of the header's shape rather than something each screen remembers to render.
|
|
21
|
+
*
|
|
22
|
+
* Colour is not decided here, for `render.ts`'s reason: this module has no idea whether it is being
|
|
23
|
+
* read from a terminal or a log file, and that is `resolveMode`'s question.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* A live fact about the runtime, shown as a word rather than a sentence.
|
|
27
|
+
*
|
|
28
|
+
* `tone` is a role, never a colour — the component maps it. A literal colour name here would put
|
|
29
|
+
* appearance in a pure module and break the one-home rule `theme.ts` exists for.
|
|
30
|
+
*/
|
|
31
|
+
export interface StateChip {
|
|
32
|
+
readonly label: string;
|
|
33
|
+
readonly tone: "ok" | "warn" | "off";
|
|
34
|
+
}
|
|
35
|
+
export interface ScreenHeader {
|
|
36
|
+
/** Product identity — `BRAND.name` and the version. The one line that is the same everywhere. */
|
|
37
|
+
readonly title: string;
|
|
38
|
+
/** What this screen is, and the counts that make it worth looking at. */
|
|
39
|
+
readonly summary: string;
|
|
40
|
+
/**
|
|
41
|
+
* The agent this screen acts on, when it acts on one.
|
|
42
|
+
*
|
|
43
|
+
* Present so it is impossible to install a skill into, or stop, an agent you did not mean.
|
|
44
|
+
* Absent — not blank — on the machine-level screens: `sources` is a registry shared by every
|
|
45
|
+
* agent on the machine, and naming one there would be a lie about the scope of what you are
|
|
46
|
+
* changing.
|
|
47
|
+
*/
|
|
48
|
+
readonly agent?: {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly model: string;
|
|
51
|
+
};
|
|
52
|
+
readonly state?: readonly StateChip[];
|
|
53
|
+
/** True for the whole session, so it stays in the frame rather than scrolling away. */
|
|
54
|
+
readonly warnings?: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
export interface KeyHint {
|
|
57
|
+
/** As a reader sees it: `↑↓`, `enter`, `^C`, `⌥⏎`. */
|
|
58
|
+
readonly key: string;
|
|
59
|
+
readonly does: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One rendered line, tagged with what it is.
|
|
63
|
+
*
|
|
64
|
+
* Tagged rather than returned as plain strings because the component styles each kind differently and
|
|
65
|
+
* the alternative is worse in both directions: a flat list of strings forces the renderer to guess by
|
|
66
|
+
* index (which broke the first time a header had no state row), and having the renderer rebuild the
|
|
67
|
+
* summary from `header.agent` itself would be a second derivation of the one thing this module exists
|
|
68
|
+
* to derive once. The kind travels with the text; appearance stays in `theme.ts`.
|
|
69
|
+
*/
|
|
70
|
+
export interface HeaderLine {
|
|
71
|
+
readonly kind: "title" | "summary" | "state" | "warning";
|
|
72
|
+
readonly text: string;
|
|
73
|
+
}
|
|
74
|
+
/** The header, as tagged lines, each already clipped to the width. */
|
|
75
|
+
export declare function headerLines(header: ScreenHeader, width: number): readonly HeaderLine[];
|
|
76
|
+
/**
|
|
77
|
+
* The footer: what the keys do, on one line, clipped.
|
|
78
|
+
*
|
|
79
|
+
* One line and never two. A footer that wraps moves the body every time the hints change, and the
|
|
80
|
+
* hints change per screen state — so a two-line footer means the list jumps as you use it. Hints are
|
|
81
|
+
* dropped from the end when they do not fit, which is why the caller orders them by how likely
|
|
82
|
+
* somebody is to need reminding: movement first, the destructive one last.
|
|
83
|
+
*/
|
|
84
|
+
export declare function hintLine(hints: readonly KeyHint[], width: number): string;
|
|
85
|
+
/**
|
|
86
|
+
* The whole header on one line, for a surface that cannot spare three.
|
|
87
|
+
*
|
|
88
|
+
* The chat is that surface. Its opening banner already says the version, the store, the session and every
|
|
89
|
+
* load warning — and on the alternate screen that banner scrolls out of the window, taking the
|
|
90
|
+
* session-wide facts with it. `headerLines`' three-to-six rows would fix that and cost a fifth of a short
|
|
91
|
+
* terminal permanently, so this is the compromise the rule actually asks for: identity and scope always
|
|
92
|
+
* visible, warnings reduced to a count that says where the detail is.
|
|
93
|
+
*
|
|
94
|
+
* A count rather than the text, deliberately. One warning wrapped over two lines is a header that changes
|
|
95
|
+
* height, which is the one thing a fixed-height frame cannot have.
|
|
96
|
+
*/
|
|
97
|
+
export declare function titleLine(header: ScreenHeader, width: number): string;
|
|
98
|
+
/** The hint every alternate-screen surface carries, so no screen invents its own word for leaving. */
|
|
99
|
+
export declare const QUIT_HINT: KeyHint;
|
|
100
|
+
export declare function screenColumns(columns: number | undefined, fallback: number): number;
|
|
101
|
+
export declare function screenRows(rows: number | undefined, fallback: number): number;
|
|
102
|
+
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/lib/screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAWH;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,G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