indusagi-coding-agent 0.2.4 → 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.
- package/LICENSE +661 -0
- package/README.md +95 -1
- package/dist/entry.js +1559 -1100
- package/dist/guardrails.js +26 -509
- package/dist/index.js +1581 -1155
- package/package.json +8 -7
- package/dist/types/addons/addons.test.d.ts +0 -21
- package/dist/types/addons/contract.d.ts +0 -640
- package/dist/types/addons/dispatch/event-dispatcher.d.ts +0 -140
- package/dist/types/addons/dispatch/index.d.ts +0 -23
- package/dist/types/addons/dispatch/tool-interceptor.d.ts +0 -128
- package/dist/types/addons/host.d.ts +0 -246
- package/dist/types/addons/index.d.ts +0 -51
- package/dist/types/addons/manifest.d.ts +0 -56
- package/dist/types/addons/sandbox.d.ts +0 -103
- package/dist/types/addons/surface.d.ts +0 -42
- package/dist/types/boot/auth-vault.d.ts +0 -29
- package/dist/types/boot/boot.d.ts +0 -26
- package/dist/types/boot/boot.test.d.ts +0 -15
- package/dist/types/boot/contract.d.ts +0 -236
- package/dist/types/boot/heap.d.ts +0 -31
- package/dist/types/boot/index.d.ts +0 -20
- package/dist/types/boot/invocation.d.ts +0 -40
- package/dist/types/boot/invocation.test.d.ts +0 -8
- package/dist/types/boot/runners/addon-wiring.d.ts +0 -103
- package/dist/types/boot/runners/addon-wiring.test.d.ts +0 -19
- package/dist/types/boot/runners/checkpoint.d.ts +0 -133
- package/dist/types/boot/runners/checkpoint.test.d.ts +0 -12
- package/dist/types/boot/runners/delegate-runner.d.ts +0 -109
- package/dist/types/boot/runners/delegate-runner.test.d.ts +0 -13
- package/dist/types/boot/runners/index.d.ts +0 -13
- package/dist/types/boot/runners/link-runner.d.ts +0 -20
- package/dist/types/boot/runners/memdir.d.ts +0 -103
- package/dist/types/boot/runners/memdir.test.d.ts +0 -12
- package/dist/types/boot/runners/oneshot-runner.d.ts +0 -19
- package/dist/types/boot/runners/read-state.d.ts +0 -82
- package/dist/types/boot/runners/read-state.test.d.ts +0 -10
- package/dist/types/boot/runners/registry.d.ts +0 -30
- package/dist/types/boot/runners/repl-runner.d.ts +0 -19
- package/dist/types/boot/runners/server-mode.d.ts +0 -71
- package/dist/types/boot/runners/session-persist.test.d.ts +0 -10
- package/dist/types/boot/runners/session.d.ts +0 -88
- package/dist/types/boot/runners/session.test.d.ts +0 -15
- package/dist/types/boot/server-token.d.ts +0 -97
- package/dist/types/boot/stages.d.ts +0 -92
- package/dist/types/boot/upgrade/apply.d.ts +0 -45
- package/dist/types/boot/upgrade/index.d.ts +0 -13
- package/dist/types/boot/upgrade/upgrades.d.ts +0 -126
- package/dist/types/briefing/briefing.test.d.ts +0 -15
- package/dist/types/briefing/compose.d.ts +0 -37
- package/dist/types/briefing/context-docs.d.ts +0 -38
- package/dist/types/briefing/context-docs.test.d.ts +0 -18
- package/dist/types/briefing/contract.d.ts +0 -686
- package/dist/types/briefing/index.d.ts +0 -29
- package/dist/types/briefing/macros.d.ts +0 -206
- package/dist/types/briefing/skills.d.ts +0 -67
- package/dist/types/capability-deck/bridge-ledger/index.d.ts +0 -25
- package/dist/types/capability-deck/bridge-ledger/key.d.ts +0 -65
- package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +0 -129
- package/dist/types/capability-deck/bridge-ledger/network.d.ts +0 -115
- package/dist/types/capability-deck/builtin-bridge.d.ts +0 -114
- package/dist/types/capability-deck/capability-deck.test.d.ts +0 -18
- package/dist/types/capability-deck/cards/bg-process-card.d.ts +0 -99
- package/dist/types/capability-deck/cards/index.d.ts +0 -37
- package/dist/types/capability-deck/cards/memory-card.d.ts +0 -68
- package/dist/types/capability-deck/cards/plan-file.d.ts +0 -56
- package/dist/types/capability-deck/cards/plan-tools.d.ts +0 -97
- package/dist/types/capability-deck/cards/plan-tools.test.d.ts +0 -9
- package/dist/types/capability-deck/cards/saas-card.d.ts +0 -78
- package/dist/types/capability-deck/cards/task-card.d.ts +0 -106
- package/dist/types/capability-deck/cards/todo-card.d.ts +0 -78
- package/dist/types/capability-deck/cards/workflow-card.d.ts +0 -55
- package/dist/types/capability-deck/cards/workflow-card.test.d.ts +0 -12
- package/dist/types/capability-deck/checkpoint.int.test.d.ts +0 -25
- package/dist/types/capability-deck/contract.d.ts +0 -318
- package/dist/types/capability-deck/index.d.ts +0 -46
- package/dist/types/capability-deck/manifest.d.ts +0 -60
- package/dist/types/capability-deck/provision.d.ts +0 -76
- package/dist/types/capability-deck/read-edit-gate.int.test.d.ts +0 -21
- package/dist/types/channels/channels.test.d.ts +0 -15
- package/dist/types/channels/contract.d.ts +0 -489
- package/dist/types/channels/framer.d.ts +0 -49
- package/dist/types/channels/index.d.ts +0 -24
- package/dist/types/channels/link/dialog.d.ts +0 -138
- package/dist/types/channels/link/driver.d.ts +0 -81
- package/dist/types/channels/link/index.d.ts +0 -13
- package/dist/types/channels/link/server.d.ts +0 -70
- package/dist/types/channels/oneshot.d.ts +0 -37
- package/dist/types/channels/ops.d.ts +0 -89
- package/dist/types/channels/session-ops.d.ts +0 -80
- package/dist/types/conductor/bash-guard.d.ts +0 -106
- package/dist/types/conductor/bash-guard.test.d.ts +0 -17
- package/dist/types/conductor/catalog/catalog.d.ts +0 -87
- package/dist/types/conductor/catalog/index.d.ts +0 -14
- package/dist/types/conductor/catalog/matcher.d.ts +0 -47
- package/dist/types/conductor/conductor.d.ts +0 -213
- package/dist/types/conductor/conductor.test.d.ts +0 -10
- package/dist/types/conductor/contract.d.ts +0 -838
- package/dist/types/conductor/diagnostics.d.ts +0 -183
- package/dist/types/conductor/diagnostics.test.d.ts +0 -10
- package/dist/types/conductor/index.d.ts +0 -26
- package/dist/types/conductor/permission-gate.integration.test.d.ts +0 -22
- package/dist/types/conductor/permission-wiring.test.d.ts +0 -14
- package/dist/types/conductor/permissions.d.ts +0 -287
- package/dist/types/conductor/permissions.test.d.ts +0 -12
- package/dist/types/conductor/plan-mode.integration.test.d.ts +0 -23
- package/dist/types/conductor/post-edit-diagnostics.test.d.ts +0 -18
- package/dist/types/conductor/quota-error.d.ts +0 -35
- package/dist/types/conductor/signal-hub/hub.d.ts +0 -83
- package/dist/types/conductor/signal-hub/index.d.ts +0 -19
- package/dist/types/conductor/signal-hub/translate.d.ts +0 -77
- package/dist/types/conductor/skill-parse/index.d.ts +0 -10
- package/dist/types/conductor/skill-parse/parse.d.ts +0 -67
- package/dist/types/conductor/submit.test.d.ts +0 -28
- package/dist/types/conductor/transcript-store/index.d.ts +0 -16
- package/dist/types/conductor/transcript-store/serialize.d.ts +0 -106
- package/dist/types/conductor/transcript-store/serialize.test.d.ts +0 -10
- package/dist/types/conductor/transcript-store/store.d.ts +0 -188
- package/dist/types/console/auth-status.d.ts +0 -28
- package/dist/types/console/components/AgentsView.d.ts +0 -41
- package/dist/types/console/components/BackgroundAgents.d.ts +0 -63
- package/dist/types/console/components/BackgroundAgents.test.d.ts +0 -8
- package/dist/types/console/components/Banner.d.ts +0 -110
- package/dist/types/console/components/Composer.d.ts +0 -37
- package/dist/types/console/components/StatusBar.d.ts +0 -42
- package/dist/types/console/components/TerminalConsole.d.ts +0 -27
- package/dist/types/console/components/WorkingIndicator.d.ts +0 -44
- package/dist/types/console/components/WorkingIndicator.test.d.ts +0 -9
- package/dist/types/console/components/banner-sweep.d.ts +0 -55
- package/dist/types/console/components/banner.test.d.ts +0 -9
- package/dist/types/console/components/welcome.d.ts +0 -115
- package/dist/types/console/components/welcome.test.d.ts +0 -9
- package/dist/types/console/console.test.d.ts +0 -19
- package/dist/types/console/contract.d.ts +0 -611
- package/dist/types/console/index.d.ts +0 -34
- package/dist/types/console/input/complete.d.ts +0 -120
- package/dist/types/console/input/dir-reader.d.ts +0 -28
- package/dist/types/console/input/index.d.ts +0 -24
- package/dist/types/console/input/input.test.d.ts +0 -14
- package/dist/types/console/input/keymap.d.ts +0 -193
- package/dist/types/console/input/paste.d.ts +0 -183
- package/dist/types/console/mount.d.ts +0 -53
- package/dist/types/console/overlays/approval-queue.d.ts +0 -88
- package/dist/types/console/overlays/approval.d.ts +0 -104
- package/dist/types/console/overlays/approval.test.d.ts +0 -17
- package/dist/types/console/overlays/auth.d.ts +0 -31
- package/dist/types/console/overlays/boards.d.ts +0 -55
- package/dist/types/console/overlays/host.d.ts +0 -45
- package/dist/types/console/overlays/index.d.ts +0 -15
- package/dist/types/console/overlays/pickers.d.ts +0 -37
- package/dist/types/console/overlays/sessions.d.ts +0 -29
- package/dist/types/console/reducer.d.ts +0 -51
- package/dist/types/console/slash/builtins.d.ts +0 -33
- package/dist/types/console/slash/commands/dynamic.d.ts +0 -57
- package/dist/types/console/slash/commands/dynamic.test.d.ts +0 -9
- package/dist/types/console/slash/commands/integrations.d.ts +0 -28
- package/dist/types/console/slash/commands/integrations.test.d.ts +0 -18
- package/dist/types/console/slash/commands/shared.d.ts +0 -72
- package/dist/types/console/slash/commands/transcript.d.ts +0 -24
- package/dist/types/console/slash/commands/transcript.test.d.ts +0 -10
- package/dist/types/console/slash/commands/workbench.d.ts +0 -21
- package/dist/types/console/slash/commands/workbench.test.d.ts +0 -10
- package/dist/types/console/slash/index.d.ts +0 -34
- package/dist/types/console/slash/registry.d.ts +0 -90
- package/dist/types/console/slash/resolve.d.ts +0 -109
- package/dist/types/console/slash/slash.test.d.ts +0 -18
- package/dist/types/console/startup.d.ts +0 -119
- package/dist/types/console/theme/adapter.d.ts +0 -79
- package/dist/types/console/theme/index.d.ts +0 -18
- package/dist/types/console/theme/palette.d.ts +0 -77
- package/dist/types/console/theme/resolve.d.ts +0 -45
- package/dist/types/console/theme/theme.test.d.ts +0 -16
- package/dist/types/console/theme/tokens.d.ts +0 -62
- package/dist/types/entry.d.ts +0 -17
- package/dist/types/guardrails.d.ts +0 -33
- package/dist/types/index.d.ts +0 -24
- package/dist/types/insight/channel.d.ts +0 -45
- package/dist/types/insight/contract.d.ts +0 -411
- package/dist/types/insight/index.d.ts +0 -26
- package/dist/types/insight/insight.test.d.ts +0 -17
- package/dist/types/insight/recorder.d.ts +0 -63
- package/dist/types/insight/redaction.d.ts +0 -44
- package/dist/types/insight/replay.d.ts +0 -77
- package/dist/types/insight/sampling.d.ts +0 -84
- package/dist/types/insight/serialize.d.ts +0 -54
- package/dist/types/insight/sinks/console.d.ts +0 -36
- package/dist/types/insight/sinks/file.d.ts +0 -37
- package/dist/types/insight/sinks/index.d.ts +0 -16
- package/dist/types/insight/sinks/stream.d.ts +0 -53
- package/dist/types/kit/clipboard-image.d.ts +0 -40
- package/dist/types/kit/external-editor.d.ts +0 -35
- package/dist/types/kit/image.d.ts +0 -102
- package/dist/types/kit/index.d.ts +0 -29
- package/dist/types/kit/kit.test.d.ts +0 -13
- package/dist/types/kit/shell.d.ts +0 -50
- package/dist/types/kit/tool-fetch.d.ts +0 -165
- package/dist/types/launch/catalog.d.ts +0 -51
- package/dist/types/launch/contract.d.ts +0 -387
- package/dist/types/launch/credentials.d.ts +0 -112
- package/dist/types/launch/index.d.ts +0 -28
- package/dist/types/launch/invocation/attachments.d.ts +0 -72
- package/dist/types/launch/invocation/flags.d.ts +0 -59
- package/dist/types/launch/invocation/index.d.ts +0 -23
- package/dist/types/launch/invocation/read.d.ts +0 -52
- package/dist/types/launch/invocation/usage.d.ts +0 -25
- package/dist/types/launch/launch.test.d.ts +0 -20
- package/dist/types/launch/login.d.ts +0 -68
- package/dist/types/launch/oauth.d.ts +0 -101
- package/dist/types/launch/oauth.test.d.ts +0 -20
- package/dist/types/launch/packages.d.ts +0 -75
- package/dist/types/launch/packages.test.d.ts +0 -15
- package/dist/types/launch/pickers.d.ts +0 -97
- package/dist/types/runtime-bridge/bridges/_drive.d.ts +0 -74
- package/dist/types/runtime-bridge/bridges/builtins.d.ts +0 -77
- package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +0 -37
- package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +0 -27
- package/dist/types/runtime-bridge/bridges/index.d.ts +0 -15
- package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +0 -36
- package/dist/types/runtime-bridge/broker.d.ts +0 -182
- package/dist/types/runtime-bridge/contract.d.ts +0 -436
- package/dist/types/runtime-bridge/index.d.ts +0 -21
- package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +0 -17
- package/dist/types/runtime-bridge/sink.d.ts +0 -59
- package/dist/types/sessions/contract.d.ts +0 -79
- package/dist/types/sessions/index.d.ts +0 -11
- package/dist/types/sessions/library.d.ts +0 -95
- package/dist/types/sessions/sessions.test.d.ts +0 -11
- package/dist/types/settings/contract.d.ts +0 -175
- package/dist/types/settings/index.d.ts +0 -13
- package/dist/types/settings/manager.d.ts +0 -109
- package/dist/types/settings/settings.test.d.ts +0 -16
- package/dist/types/transcript-export/index.d.ts +0 -20
- package/dist/types/transcript-export/publish.d.ts +0 -81
- package/dist/types/transcript-export/sgr.d.ts +0 -90
- package/dist/types/transcript-export/template.d.ts +0 -64
- package/dist/types/transcript-export/theme-bridge.d.ts +0 -99
- package/dist/types/transcript-export/transcript-export.test.d.ts +0 -16
- package/dist/types/window-budget/budget/estimate.d.ts +0 -47
- package/dist/types/window-budget/budget/gate.d.ts +0 -37
- package/dist/types/window-budget/budget/index.d.ts +0 -14
- package/dist/types/window-budget/budget/slice.d.ts +0 -38
- package/dist/types/window-budget/condenser.d.ts +0 -73
- package/dist/types/window-budget/contract.d.ts +0 -182
- package/dist/types/window-budget/index.d.ts +0 -17
- package/dist/types/window-budget/microcompact.d.ts +0 -68
- package/dist/types/window-budget/microcompact.test.d.ts +0 -16
- package/dist/types/window-budget/rehydrate.d.ts +0 -56
- package/dist/types/window-budget/summarize/condense.d.ts +0 -76
- package/dist/types/window-budget/summarize/index.d.ts +0 -12
- package/dist/types/window-budget/summarize/prompt.d.ts +0 -56
- package/dist/types/window-budget/window-budget.test.d.ts +0 -18
- package/dist/types/workflow-engine/agent-runner.d.ts +0 -124
- package/dist/types/workflow-engine/agent-runner.test.d.ts +0 -8
- package/dist/types/workflow-engine/display.d.ts +0 -148
- package/dist/types/workflow-engine/display.test.d.ts +0 -1
- package/dist/types/workflow-engine/engine.d.ts +0 -183
- package/dist/types/workflow-engine/engine.test.d.ts +0 -1
- package/dist/types/workflow-engine/index.d.ts +0 -21
- package/dist/types/workflow-engine/parse.d.ts +0 -64
- package/dist/types/workflow-engine/parse.test.d.ts +0 -1
- package/dist/types/workflow-engine/structured-output.d.ts +0 -51
- package/dist/types/workflow-engine/structured-output.test.d.ts +0 -1
- package/dist/types/workspace/brand.d.ts +0 -26
- package/dist/types/workspace/index.d.ts +0 -11
- package/dist/types/workspace/locator.d.ts +0 -50
- package/dist/types/workspace/runtime-detect.d.ts +0 -56
|
@@ -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 {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workbench slash commands — the pickers, display blocks, and help surfaces.
|
|
3
|
-
*
|
|
4
|
-
* This group covers the overlays a user reaches for to inspect or retune the
|
|
5
|
-
* session: the model pickers, the per-scope routing editor, the colour-scheme
|
|
6
|
-
* switch, the settings list, the command palette (`/help`), the keyboard map
|
|
7
|
-
* (`/keys`), the project changelog (`/whats-new`), and a diagnostics dump
|
|
8
|
-
* (`/debug`). The picker handlers stay thin — they raise an overlay through
|
|
9
|
-
* {@link SlashContext.openModal} or flip a reducer flag — while the help,
|
|
10
|
-
* keys, whats-new, and debug handlers do real work: they read the live slash
|
|
11
|
-
* catalog, the grounded keymap, a `CHANGELOG.md` on disk, and the conductor's
|
|
12
|
-
* session statistics, then surface the result as a display block or a written
|
|
13
|
-
* file rather than a dead placeholder.
|
|
14
|
-
*/
|
|
15
|
-
import type { SlashCommand } from "../../contract";
|
|
16
|
-
/**
|
|
17
|
-
* The workbench command rows, in listing order. Pickers and help surfaces open
|
|
18
|
-
* an overlay; the changelog drops a display block; debug flips a toggle and
|
|
19
|
-
* reports it.
|
|
20
|
-
*/
|
|
21
|
-
export declare const workbenchCommands: SlashCommand[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workbench command group — focused handler tests.
|
|
3
|
-
*
|
|
4
|
-
* Each command is driven against a scripted {@link SlashContext} fake that
|
|
5
|
-
* records every injected action, so a handler's effect is asserted by
|
|
6
|
-
* inspecting the recorded overlays / dispatches / statuses / blocks rather than
|
|
7
|
-
* a rendered surface. The group stays thin: every handler resolves to a settled
|
|
8
|
-
* outcome and raises exactly the effects its row promises.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash subsystem — public barrel.
|
|
3
|
-
*
|
|
4
|
-
* The console's data-driven slash layer, in three pure pieces:
|
|
5
|
-
*
|
|
6
|
-
* - **The catalog** — {@link SLASH_COMMANDS}, the single ordered list of
|
|
7
|
-
* {@link SlashCommand} rows (core commands plus the `composio` / `memory` /
|
|
8
|
-
* `scoped-models` / `theme` families). There is no command `if`-ladder; a new
|
|
9
|
-
* command is a new row.
|
|
10
|
-
* - **The registry** — {@link buildRegistry} folds the catalog into the frozen
|
|
11
|
-
* {@link SlashRegistry} shape (commands + a name/alias index), and the derived
|
|
12
|
-
* lookups ({@link matchPrefix}, {@link findCommand}, {@link commandsInFamily},
|
|
13
|
-
* {@link listFamilies}) power resolution, completion, and grouped listing.
|
|
14
|
-
* - **Resolution** — {@link resolveSlash} parses a typed composer line and
|
|
15
|
-
* resolves it against a registry to a discriminated {@link SlashResolution}.
|
|
16
|
-
*
|
|
17
|
-
* {@link DEFAULT_SLASH_REGISTRY} is the catalog pre-folded into a registry, the
|
|
18
|
-
* value the console mounts with. The effectful dispatcher (which calls a matched
|
|
19
|
-
* command's `run`) lives outside this barrel; everything exported here is pure.
|
|
20
|
-
*/
|
|
21
|
-
export { SLASH_COMMANDS, FAMILY } from "./builtins";
|
|
22
|
-
export { buildRegistry, tokensOf, findCommand, matchPrefix, listFamilies, commandsInFamily, } from "./registry";
|
|
23
|
-
export { SLASH_PREFIX, looksLikeSlash, parseSlash, resolveSlash, type SlashLine, type SlashResolution, } from "./resolve";
|
|
24
|
-
import type { SlashRegistry } from "../contract";
|
|
25
|
-
/**
|
|
26
|
-
* The built-in catalog pre-folded into a resolved {@link SlashRegistry}.
|
|
27
|
-
*
|
|
28
|
-
* The default the console mounts with: the catalog indexed by every canonical
|
|
29
|
-
* name and alias, ready for {@link resolveSlash} and the completion matcher. A
|
|
30
|
-
* caller that needs to splice in prompt templates, plugin commands, or
|
|
31
|
-
* `/skill:*` entries builds its own registry from a concatenated list via
|
|
32
|
-
* {@link buildRegistry} rather than mutating this one.
|
|
33
|
-
*/
|
|
34
|
-
export declare const DEFAULT_SLASH_REGISTRY: SlashRegistry;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash registry assembly — fold a command list into the resolved registry.
|
|
3
|
-
*
|
|
4
|
-
* The slash subsystem keeps exactly one hand-maintained list of commands (the
|
|
5
|
-
* {@link SLASH_COMMANDS} array in `builtins.ts`); everything a consumer needs to
|
|
6
|
-
* resolve, complete, or list a command is *derived* from that array here. This
|
|
7
|
-
* module is the bridge between the flat data and the {@link SlashRegistry} shape
|
|
8
|
-
* the contract froze:
|
|
9
|
-
*
|
|
10
|
-
* - {@link buildRegistry} indexes the list by canonical name *and* by every
|
|
11
|
-
* alias, so {@link import("./resolve").resolveSlash} is an O(1) map lookup
|
|
12
|
-
* rather than a scan. It also guards the one invariant a flat array cannot:
|
|
13
|
-
* two rows must not claim the same token (a duplicate name or alias is a
|
|
14
|
-
* programming error, surfaced loudly at assembly time, not silently shadowed).
|
|
15
|
-
* - {@link matchPrefix} powers the completion window: given the partial token
|
|
16
|
-
* the user has typed, it returns the rows whose name or alias starts with it,
|
|
17
|
-
* in registry order.
|
|
18
|
-
* - {@link commandsInFamily} / {@link listFamilies} project the `family` field
|
|
19
|
-
* for grouped listing (the `/help` overlay, the completion grouping).
|
|
20
|
-
*
|
|
21
|
-
* No effects, no React, no conductor — the registry is a value, and these are
|
|
22
|
-
* pure derivations over it. The dispatcher consumes the registry; it is not
|
|
23
|
-
* built here.
|
|
24
|
-
*/
|
|
25
|
-
import type { SlashCommand, SlashRegistry } from "../contract";
|
|
26
|
-
/**
|
|
27
|
-
* Every token a command answers to: its canonical name plus any aliases.
|
|
28
|
-
*
|
|
29
|
-
* The single place name/alias enumeration happens, so the index builder and the
|
|
30
|
-
* prefix matcher agree on what counts as "a token for this command".
|
|
31
|
-
*
|
|
32
|
-
* @param command the command to enumerate tokens for
|
|
33
|
-
*/
|
|
34
|
-
export declare function tokensOf(command: SlashCommand): string[];
|
|
35
|
-
/**
|
|
36
|
-
* Fold an ordered command list into a resolved {@link SlashRegistry}.
|
|
37
|
-
*
|
|
38
|
-
* Preserves the input order in {@link SlashRegistry.commands} (it is the listing
|
|
39
|
-
* order the completion window and `/help` render in) and derives the
|
|
40
|
-
* {@link SlashRegistry.index} by mapping every token — canonical and alias — to
|
|
41
|
-
* its owning command. Tokens are lower-cased on the way in so resolution can be
|
|
42
|
-
* case-insensitive without the resolver re-normalising.
|
|
43
|
-
*
|
|
44
|
-
* Throws when two rows claim the same token: a flat array cannot express
|
|
45
|
-
* "these names are disjoint", so the invariant is enforced here, at the one
|
|
46
|
-
* point the table is assembled, instead of letting a later row silently shadow
|
|
47
|
-
* an earlier one.
|
|
48
|
-
*
|
|
49
|
-
* @param commands the ordered command list (the single source of truth)
|
|
50
|
-
*/
|
|
51
|
-
export declare function buildRegistry(commands: readonly SlashCommand[]): SlashRegistry;
|
|
52
|
-
/**
|
|
53
|
-
* Resolve a single token (canonical or alias) to its command, or `undefined`.
|
|
54
|
-
*
|
|
55
|
-
* A thin, case-insensitive read of {@link SlashRegistry.index} so call sites do
|
|
56
|
-
* not re-implement the lower-casing the registry index expects.
|
|
57
|
-
*
|
|
58
|
-
* @param registry the registry to read
|
|
59
|
-
* @param token a canonical name or alias, with or without a leading slash
|
|
60
|
-
*/
|
|
61
|
-
export declare function findCommand(registry: SlashRegistry, token: string): SlashCommand | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* The commands whose name or alias begins with a partial token, in registry
|
|
64
|
-
* order — the candidate set the completion window renders.
|
|
65
|
-
*
|
|
66
|
-
* Matching is case-insensitive and prefix-based against *every* token a command
|
|
67
|
-
* answers to, but each command appears at most once even when several of its
|
|
68
|
-
* tokens match. An empty partial returns the whole list (the bare-`/` case where
|
|
69
|
-
* the user has opened the completion window but typed nothing yet).
|
|
70
|
-
*
|
|
71
|
-
* @param registry the registry to search
|
|
72
|
-
* @param partial the partial command token (without a leading slash)
|
|
73
|
-
*/
|
|
74
|
-
export declare function matchPrefix(registry: SlashRegistry, partial: string): SlashCommand[];
|
|
75
|
-
/**
|
|
76
|
-
* The distinct family labels present in the registry, in first-seen order.
|
|
77
|
-
*
|
|
78
|
-
* Commands without a `family` are omitted; the result drives the grouped
|
|
79
|
-
* headings in `/help` and the completion window.
|
|
80
|
-
*
|
|
81
|
-
* @param registry the registry to scan
|
|
82
|
-
*/
|
|
83
|
-
export declare function listFamilies(registry: SlashRegistry): string[];
|
|
84
|
-
/**
|
|
85
|
-
* The commands belonging to a family, in registry order.
|
|
86
|
-
*
|
|
87
|
-
* @param registry the registry to filter
|
|
88
|
-
* @param family the family label to select
|
|
89
|
-
*/
|
|
90
|
-
export declare function commandsInFamily(registry: SlashRegistry, family: string): SlashCommand[];
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash line resolution — parse a typed line, then match it against the registry.
|
|
3
|
-
*
|
|
4
|
-
* This module is the pure front half of the slash subsystem: it takes the raw
|
|
5
|
-
* string a user typed into the composer and decides three things, in order:
|
|
6
|
-
*
|
|
7
|
-
* 1. **Is this a slash line at all?** A line is a slash invocation only when its
|
|
8
|
-
* first non-blank character is `/` and what follows is a command-shaped
|
|
9
|
-
* token (so a bare `/` or a `/path/to/file` literal is *not* hijacked as a
|
|
10
|
-
* command). {@link parseSlash} reports this without consulting the registry.
|
|
11
|
-
* 2. **Which command does the token resolve to?** {@link resolveSlash} folds a
|
|
12
|
-
* {@link SlashRegistry} in: it splits the line into a name and a trailing
|
|
13
|
-
* argument string, then resolves the name (and its aliases) through the
|
|
14
|
-
* registry's index. Resolution is case-insensitive on the command token.
|
|
15
|
-
* 3. **What should the dispatcher do?** The result is a discriminated
|
|
16
|
-
* {@link SlashResolution}: `not-slash` (treat as a normal prompt / bash
|
|
17
|
-
* escape), `match` (run this command with these args), or `miss` (it looked
|
|
18
|
-
* like a command but no row owns the token — fall through to templates,
|
|
19
|
-
* plugin commands, or a literal prompt).
|
|
20
|
-
*
|
|
21
|
-
* Nothing here touches React, the conductor, or I/O — the whole module is a pair
|
|
22
|
-
* of pure functions over a string and a registry, which is exactly why the slash
|
|
23
|
-
* parsing/matching logic lives here rather than inside a `useInput` handler. The
|
|
24
|
-
* effectful half (actually calling a command's `run`) is the dispatcher's job.
|
|
25
|
-
*/
|
|
26
|
-
import type { SlashCommand, SlashRegistry } from "../contract";
|
|
27
|
-
/**
|
|
28
|
-
* The leading character that marks a line as a slash invocation.
|
|
29
|
-
*
|
|
30
|
-
* A single constant so the prefix is defined in exactly one place and the tests
|
|
31
|
-
* assert against the same literal the parser reads.
|
|
32
|
-
*/
|
|
33
|
-
export declare const SLASH_PREFIX: "/";
|
|
34
|
-
/**
|
|
35
|
-
* The lexical split of a slash line into its command token and argument tail.
|
|
36
|
-
*
|
|
37
|
-
* Produced by {@link parseSlash} before the registry is consulted, so the two
|
|
38
|
-
* concerns — "did the user type a command-shaped line" and "does a command own
|
|
39
|
-
* that token" — stay separable. `name` is the bare token with no leading slash
|
|
40
|
-
* and folded to lower case for case-insensitive matching; `args` is everything
|
|
41
|
-
* after the first run of whitespace, with the single separating space removed
|
|
42
|
-
* but interior spacing preserved.
|
|
43
|
-
*/
|
|
44
|
-
export interface SlashLine {
|
|
45
|
-
/** The command token, lower-cased, without the leading slash. */
|
|
46
|
-
readonly name: string;
|
|
47
|
-
/** The trailing argument string (may be empty), interior spacing preserved. */
|
|
48
|
-
readonly args: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Whether a typed line is shaped like a slash command at all.
|
|
52
|
-
*
|
|
53
|
-
* A line qualifies only when, after trimming leading blanks, it begins with the
|
|
54
|
-
* {@link SLASH_PREFIX} *and* what follows up to the first whitespace is a clean
|
|
55
|
-
* {@link COMMAND_TOKEN}. This deliberately rejects a lone `/`, a `//comment`, and
|
|
56
|
-
* a `/usr/local/bin` style path (whose embedded slash breaks the token shape) so
|
|
57
|
-
* those reach the prompt untouched.
|
|
58
|
-
*
|
|
59
|
-
* @param input the raw composer line
|
|
60
|
-
*/
|
|
61
|
-
export declare function looksLikeSlash(input: string): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Split a slash line into its {@link SlashLine} token/argument pair, or
|
|
64
|
-
* `undefined` when the line is not shaped like a command.
|
|
65
|
-
*
|
|
66
|
-
* The token runs from just after the slash up to the first whitespace (or
|
|
67
|
-
* end-of-line); the argument tail is whatever follows that whitespace, trimmed
|
|
68
|
-
* only at its outer edges. The token is lower-cased so resolution can be
|
|
69
|
-
* case-insensitive without the caller pre-normalising.
|
|
70
|
-
*
|
|
71
|
-
* @param input the raw composer line
|
|
72
|
-
*/
|
|
73
|
-
export declare function parseSlash(input: string): SlashLine | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* The outcome of resolving a typed line against a {@link SlashRegistry}.
|
|
76
|
-
*
|
|
77
|
-
* - `not-slash` — the line is not a command invocation; the dispatcher should
|
|
78
|
-
* hand it on as a normal prompt (or a `!`/`!!` bash escape).
|
|
79
|
-
* - `match` — the token resolved to `command`; run it with `args` (the raw
|
|
80
|
-
* trailing string) via a {@link import("../contract").SlashContext}.
|
|
81
|
-
* - `miss` — the line *was* command-shaped but no row owns the token; the
|
|
82
|
-
* dispatcher falls through to templates / plugin commands / a literal prompt.
|
|
83
|
-
* The offending `name` is reported so a caller can surface "unknown command".
|
|
84
|
-
*/
|
|
85
|
-
export type SlashResolution = {
|
|
86
|
-
readonly kind: "not-slash";
|
|
87
|
-
} | {
|
|
88
|
-
readonly kind: "match";
|
|
89
|
-
readonly command: SlashCommand;
|
|
90
|
-
readonly args: string;
|
|
91
|
-
} | {
|
|
92
|
-
readonly kind: "miss";
|
|
93
|
-
readonly name: string;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Resolve a raw composer line against the registry to a {@link SlashResolution}.
|
|
97
|
-
*
|
|
98
|
-
* Parses the line ({@link parseSlash}); a non-command line resolves to
|
|
99
|
-
* `not-slash`. A command-shaped line's token is looked up in the registry index
|
|
100
|
-
* (which already carries both canonical names and aliases), yielding `match`
|
|
101
|
-
* with the owning command and the raw argument string, or `miss` when no row
|
|
102
|
-
* claims the token.
|
|
103
|
-
*
|
|
104
|
-
* This is the single entry point a dispatcher calls; it performs no effects.
|
|
105
|
-
*
|
|
106
|
-
* @param input the raw composer line
|
|
107
|
-
* @param registry the registry to resolve against
|
|
108
|
-
*/
|
|
109
|
-
export declare function resolveSlash(input: string, registry: SlashRegistry): SlashResolution;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash subsystem — pure-module tests.
|
|
3
|
-
*
|
|
4
|
-
* Exercises the three pure pieces end-to-end without React, a real conductor, or
|
|
5
|
-
* I/O: a scripted {@link SlashContext} fake records every injected action a
|
|
6
|
-
* handler calls, so a command's effect is asserted by inspecting the recorded
|
|
7
|
-
* calls rather than a rendered surface.
|
|
8
|
-
*
|
|
9
|
-
* 1. Line parsing — `parseSlash` / `looksLikeSlash` distinguish commands from
|
|
10
|
-
* bare slashes, paths, and plain prompts, and split off the argument tail.
|
|
11
|
-
* 2. Registry assembly — `buildRegistry` indexes names + aliases, rejects
|
|
12
|
-
* duplicate tokens, and the derived lookups (`matchPrefix`, family grouping)
|
|
13
|
-
* project the catalog correctly.
|
|
14
|
-
* 3. Resolution — `resolveSlash` reports `not-slash` / `match` / `miss`.
|
|
15
|
-
* 4. Handlers — representative core and family commands drive the right
|
|
16
|
-
* injected actions (overlay, status, dispatch, conductor) and stay thin.
|
|
17
|
-
*/
|
|
18
|
-
export {};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Startup gathering — the pure resource/notices/changelog reader the banner draws.
|
|
3
|
-
*
|
|
4
|
-
* The interactive console opens with a one-shot survey of what the session has to
|
|
5
|
-
* work with: which context documents the agent will read, which capability cards
|
|
6
|
-
* (skills) and prompt templates (commands) were discovered on disk, and a count
|
|
7
|
-
* of each. This module *gathers* that survey and nothing else — it returns a
|
|
8
|
-
* small, render-agnostic {@link StartupMap} the banner turns into a bordered
|
|
9
|
-
* panel. It performs only read-only filesystem probes (existence checks plus the
|
|
10
|
-
* briefing loaders) and holds no state; given the same disk it returns the same
|
|
11
|
-
* value, so a test can drive it against a temp tree.
|
|
12
|
-
*
|
|
13
|
-
* It also reads (when present) a `CHANGELOG.md` at the app root and folds it into
|
|
14
|
-
* a {@link StartupChangelog} the banner shows on a version bump — full on the
|
|
15
|
-
* first sight of a new version, a one-line "updated to" note otherwise. The
|
|
16
|
-
* decision of *which* of those to show is the gatherer's: it is handed the
|
|
17
|
-
* running version and the last-seen version and reports a `mode`, so the banner
|
|
18
|
-
* stays a dumb renderer.
|
|
19
|
-
*
|
|
20
|
-
* Nothing here imports React or Ink. The banner imports the *shapes* below and
|
|
21
|
-
* the surface calls {@link gatherStartup} once at mount; the two never share
|
|
22
|
-
* mutable state.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* One labelled group inside the startup map.
|
|
26
|
-
*
|
|
27
|
-
* A section is a title, the per-entry display lines (already shortened for the
|
|
28
|
-
* terminal), and the *full* count the lines were derived from — which may exceed
|
|
29
|
-
* the number of lines when the renderer elides a long list. A section with no
|
|
30
|
-
* entries is omitted by {@link gatherStartup} rather than emitted empty.
|
|
31
|
-
*/
|
|
32
|
-
export interface StartupSection {
|
|
33
|
-
/** The group heading (e.g. `"Context"`, `"Skills"`). */
|
|
34
|
-
readonly title: string;
|
|
35
|
-
/** The display lines, one per surfaced entry, already path-shortened. */
|
|
36
|
-
readonly lines: readonly string[];
|
|
37
|
-
/** How many entries the section spans (>= `lines.length`). */
|
|
38
|
-
readonly count: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The gathered survey the banner renders as the "Startup Map" panel.
|
|
42
|
-
*
|
|
43
|
-
* A flat ordered list of {@link StartupSection}s. Empty when nothing was found,
|
|
44
|
-
* in which case the banner renders no panel at all.
|
|
45
|
-
*/
|
|
46
|
-
export interface StartupMap {
|
|
47
|
-
/** The discovered sections, in display order. */
|
|
48
|
-
readonly sections: readonly StartupSection[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* The changelog survey the banner may render as a "What is new" block.
|
|
52
|
-
*
|
|
53
|
-
* - `mode: "none"` — no changelog to show (no file, or no version change).
|
|
54
|
-
* - `mode: "full"` — the running version is newer than last-seen *and* the
|
|
55
|
-
* full body is worth showing; `markdown` carries it.
|
|
56
|
-
* - `mode: "condensed"`— a version change with no body to expand (or the body
|
|
57
|
-
* suppressed); only the one-line note is shown.
|
|
58
|
-
*/
|
|
59
|
-
export type StartupChangelogMode = "none" | "full" | "condensed";
|
|
60
|
-
/** The gathered changelog survey, with the running version it was keyed to. */
|
|
61
|
-
export interface StartupChangelog {
|
|
62
|
-
/** Which of the three presentations the banner should render. */
|
|
63
|
-
readonly mode: StartupChangelogMode;
|
|
64
|
-
/** The running product version this survey was computed against. */
|
|
65
|
-
readonly version: string;
|
|
66
|
-
/** The condensed changelog body (present for `full`), markdown source. */
|
|
67
|
-
readonly markdown?: string;
|
|
68
|
-
}
|
|
69
|
-
/** The per-line tone a startup notice carries. */
|
|
70
|
-
export type StartupNoticeKind = "error" | "warning" | "info";
|
|
71
|
-
/** One out-of-band notice the banner renders above the wordmark region. */
|
|
72
|
-
export interface StartupNotice {
|
|
73
|
-
/** The tone the line is themed with. */
|
|
74
|
-
readonly kind: StartupNoticeKind;
|
|
75
|
-
/** The notice text. */
|
|
76
|
-
readonly text: string;
|
|
77
|
-
}
|
|
78
|
-
/** What {@link gatherStartup} is handed to compute the survey. */
|
|
79
|
-
export interface StartupInputs {
|
|
80
|
-
/** The working directory the session is scoped to. */
|
|
81
|
-
readonly cwd: string;
|
|
82
|
-
/** The user's home directory (where global resources live). */
|
|
83
|
-
readonly home: string;
|
|
84
|
-
/** The running product version (for the changelog survey). */
|
|
85
|
-
readonly version: string;
|
|
86
|
-
/** The last version the user has already seen a changelog for, if any. */
|
|
87
|
-
readonly lastSeenVersion?: string;
|
|
88
|
-
/** Absolute path of the app-root `CHANGELOG.md`, if the app knows one. */
|
|
89
|
-
readonly changelogPath?: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Gather the startup map: the context documents, skills, and prompt templates
|
|
93
|
-
* the session opens with, each as a {@link StartupSection}. Empty sections are
|
|
94
|
-
* dropped, so a brand-new checkout with nothing on disk yields `{ sections: [] }`
|
|
95
|
-
* and the banner renders no panel.
|
|
96
|
-
*
|
|
97
|
-
* Pure with respect to its {@link StartupInputs}: only read-only filesystem
|
|
98
|
-
* probes, no writes, no caching.
|
|
99
|
-
*
|
|
100
|
-
* @param inputs the roots and version context to survey against
|
|
101
|
-
*/
|
|
102
|
-
export declare function gatherStartup(inputs: StartupInputs): StartupMap;
|
|
103
|
-
/**
|
|
104
|
-
* Gather the changelog survey for the banner.
|
|
105
|
-
*
|
|
106
|
-
* The presentation depends on the version delta:
|
|
107
|
-
* - no `CHANGELOG.md`, or the running version equals the last-seen version →
|
|
108
|
-
* `mode: "none"` (nothing shown);
|
|
109
|
-
* - a version change with a non-empty condensed body → `mode: "full"` and the
|
|
110
|
-
* body in `markdown`;
|
|
111
|
-
* - a version change whose condensed body is empty → `mode: "condensed"` (only
|
|
112
|
-
* the one-line "updated to" note).
|
|
113
|
-
*
|
|
114
|
-
* When the app does not track a last-seen version (`lastSeenVersion` absent), a
|
|
115
|
-
* present `CHANGELOG.md` is always surfaced condensed so the note still appears.
|
|
116
|
-
*
|
|
117
|
-
* @param inputs the version context and optional changelog path
|
|
118
|
-
*/
|
|
119
|
-
export declare function gatherChangelog(inputs: StartupInputs): StartupChangelog;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme adapter binding — the single boundary where the console's semantic
|
|
3
|
-
* tokens become concrete terminal colours.
|
|
4
|
-
*
|
|
5
|
-
* The framework renders colour through an {@link InkThemeAdapter}: a `colors`
|
|
6
|
-
* Record plus chalk-backed `color(key, text)` / `background(key, …)` / `dim` /
|
|
7
|
-
* `muted` helpers, all produced by `createThemeAdapter(name, colors)`. The
|
|
8
|
-
* framework components look colours up by *their* key vocabulary (`accent`,
|
|
9
|
-
* `error`, `success`, `warning`, `borderMuted`, `bashBorder`, `userMessage`,
|
|
10
|
-
* `customMessage`, `text`, `dim`, `muted`). This module is the one place those
|
|
11
|
-
* framework keys are populated — each from a console {@link ThemeTokens} role —
|
|
12
|
-
* so the rest of the console never speaks the framework's key names and the
|
|
13
|
-
* framework never sees a console role name.
|
|
14
|
-
*
|
|
15
|
-
* Keeping this mapping behind a single function means the config-load step calls
|
|
16
|
-
* it exactly once per scheme; the resulting adapter is then threaded as the
|
|
17
|
-
* `theme` prop through every framework component the surface mounts.
|
|
18
|
-
*/
|
|
19
|
-
import type { InkThemeAdapter, ThemeTokens } from "../contract";
|
|
20
|
-
/**
|
|
21
|
-
* Project the console's semantic tokens onto the framework's colour-key Record.
|
|
22
|
-
*
|
|
23
|
-
* The keys here are the framework's own (the names its react-ink components pass
|
|
24
|
-
* to `theme.color(...)` / `theme.background(...)`), each filled from a console
|
|
25
|
-
* role. The framework's `createThemeAdapter` falls back gracefully for any key
|
|
26
|
-
* it asks for that is absent, but we populate every key the shipped components
|
|
27
|
-
* are known to request so nothing degrades to a default grey.
|
|
28
|
-
*
|
|
29
|
-
* framework key ← console role
|
|
30
|
-
* -------------- ------------------------------------------------
|
|
31
|
-
* text ← bodyText (default foreground / adapter fallback)
|
|
32
|
-
* dim ← mutedText (the adapter's `dim()` source)
|
|
33
|
-
* muted ← mutedText (the adapter's `muted()` source)
|
|
34
|
-
* accent ← signal (primary accent the components highlight in)
|
|
35
|
-
* borderMuted ← quietFrame (de-emphasised borders/separators)
|
|
36
|
-
* bashBorder ← frame (the bash-block border tone)
|
|
37
|
-
* userMessage ← "" (no background, plain text)
|
|
38
|
-
* customMessage ← cardAccent (custom/plugin message background tint)
|
|
39
|
-
* success ← affirm
|
|
40
|
-
* warning ← caution
|
|
41
|
-
* error ← alarm
|
|
42
|
-
* info ← notice (informational status tone)
|
|
43
|
-
* highlight ← inkText (high-contrast on-accent text)
|
|
44
|
-
*
|
|
45
|
-
* Plus the markdown / diff / syntax-highlight role keys the framework's rich
|
|
46
|
-
* render path (`theme.role(...)` / `theme.roleBackground(...)`) resolves. These
|
|
47
|
-
* key names match the framework adapter's default role → key map exactly, so the
|
|
48
|
-
* styled transcript, colored diffs, and fenced-code highlighting resolve their
|
|
49
|
-
* colours straight from the console's derived tokens:
|
|
50
|
-
*
|
|
51
|
-
* codeInline ← codeInline (inline `code` foreground)
|
|
52
|
-
* heading ← heading (markdown heading foreground)
|
|
53
|
-
* blockquoteBar ← blockquoteBar (dim quote bar)
|
|
54
|
-
* diffAddedBg ← diffAddedBg (added-line background tint)
|
|
55
|
-
* diffRemovedBg ← diffRemovedBg (removed-line background tint)
|
|
56
|
-
* diffAddedText ← diffAddedText (added foreground / `+`)
|
|
57
|
-
* diffRemovedText ← diffRemovedText (removed foreground / `-`)
|
|
58
|
-
* synKeyword ← synKeyword (syntax: keywords)
|
|
59
|
-
* synString ← synString (syntax: strings)
|
|
60
|
-
* synNumber ← synNumber (syntax: numbers)
|
|
61
|
-
* synComment ← synComment (syntax: comments)
|
|
62
|
-
* synType ← synType (syntax: types / classes)
|
|
63
|
-
*
|
|
64
|
-
* @param tokens the derived semantic token map for a scheme
|
|
65
|
-
* @returns a flat colour Record keyed by the framework's vocabulary
|
|
66
|
-
*/
|
|
67
|
-
export declare function frameworkColors(tokens: ThemeTokens): Record<string, string>;
|
|
68
|
-
/**
|
|
69
|
-
* Build the framework {@link InkThemeAdapter} for a scheme from its tokens.
|
|
70
|
-
*
|
|
71
|
-
* The boundary call: derive the framework colour Record from the console's
|
|
72
|
-
* semantic tokens, then hand it to `createThemeAdapter` under the scheme's name.
|
|
73
|
-
* This is the *only* place `createThemeAdapter` is invoked for a console theme.
|
|
74
|
-
*
|
|
75
|
-
* @param schemeName the scheme identity, used as the adapter's `name`
|
|
76
|
-
* @param tokens the derived semantic token map for that scheme
|
|
77
|
-
* @returns the chalk/ink-backed framework adapter
|
|
78
|
-
*/
|
|
79
|
-
export declare function themeAdapter(schemeName: string, tokens: ThemeTokens): InkThemeAdapter;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Console theme engine — public barrel.
|
|
3
|
-
*
|
|
4
|
-
* The theme engine turns the console's own re-derived accent ramps into the
|
|
5
|
-
* framework {@link InkThemeAdapter} every component renders against. The
|
|
6
|
-
* pipeline is: a raw {@link ThemePalette} (this module's own hex ramp) →
|
|
7
|
-
* semantic {@link ThemeTokens} via {@link deriveTokens} → a framework adapter
|
|
8
|
-
* via {@link themeAdapter} → a fully resolved {@link ConsoleTheme}. The two
|
|
9
|
-
* built-in schemes are assembled once into {@link THEMES} and obtained through
|
|
10
|
-
* {@link resolveTheme}.
|
|
11
|
-
*
|
|
12
|
-
* Consumers import from `src/console/theme` and never reach into the individual
|
|
13
|
-
* palette/tokens/adapter/resolve modules.
|
|
14
|
-
*/
|
|
15
|
-
export { SAFFRON_PALETTE, MIDNIGHT_PALETTE, DAYLIGHT_PALETTE, MIDNIGHT_CB_PALETTE, DAYLIGHT_CB_PALETTE, PALETTES, } from "./palette";
|
|
16
|
-
export { deriveTokens } from "./tokens";
|
|
17
|
-
export { themeAdapter, frameworkColors } from "./adapter";
|
|
18
|
-
export { THEMES, THEME_SCHEMES, resolveTheme } from "./resolve";
|