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,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task capability — delegate a self-contained piece of work to a sub-agent.
|
|
3
|
-
*
|
|
4
|
-
* App-novel wiring. The `task` tool lets the primary agent hand off a bounded
|
|
5
|
-
* objective (e.g. "find every call site of `foo` and summarize them") to a fresh
|
|
6
|
-
* sub-agent that runs its own tool loop and reports back a single result, keeping
|
|
7
|
-
* the parent's context window clean.
|
|
8
|
-
*
|
|
9
|
-
* The actual sub-agent runner is NOT owned by this card — it is a framework /
|
|
10
|
-
* swarm concern injected through {@link DeckContext.framework} under the
|
|
11
|
-
* {@link DELEGATE_HANDLE_KEY} key. When that handle is present the capability
|
|
12
|
-
* delegates to it; when it is absent (tests, headless tooling, a host that has
|
|
13
|
-
* not wired the swarm) the capability degrades gracefully to a clearly-typed
|
|
14
|
-
* stub that reports delegation is unavailable rather than throwing. Either way
|
|
15
|
-
* the card builds a valid {@link Capability} and the deck typechecks and runs.
|
|
16
|
-
*
|
|
17
|
-
* The card produces a framework `AgentTool`; parameters are a TypeBox schema and
|
|
18
|
-
* the prose is original to this deck.
|
|
19
|
-
*/
|
|
20
|
-
import { type Static } from "@sinclair/typebox";
|
|
21
|
-
import type { Capability, CapabilityCard, DeckContext } from "../contract";
|
|
22
|
-
/** Key under which a host wires a live delegate runner into the deck context. */
|
|
23
|
-
export declare const DELEGATE_HANDLE_KEY: "delegate";
|
|
24
|
-
/** A single delegated objective handed to the sub-agent runner. */
|
|
25
|
-
export interface DelegateRequest {
|
|
26
|
-
/** Optional named agent profile to run as (e.g. "explorer", "reviewer"). */
|
|
27
|
-
readonly agent?: string;
|
|
28
|
-
/** The self-contained objective the sub-agent should accomplish. */
|
|
29
|
-
readonly objective: string;
|
|
30
|
-
/** Optional extra context the parent wants the sub-agent to start with. */
|
|
31
|
-
readonly context?: string;
|
|
32
|
-
}
|
|
33
|
-
/** The single result a sub-agent reports back to the parent. */
|
|
34
|
-
export interface DelegateResult {
|
|
35
|
-
/** Whether the sub-agent considers the objective met. */
|
|
36
|
-
readonly ok: boolean;
|
|
37
|
-
/** The sub-agent's final report, surfaced to the parent agent verbatim. */
|
|
38
|
-
readonly report: string;
|
|
39
|
-
}
|
|
40
|
-
/** One line of a sub-agent's live activity stream (for the drill-in view). */
|
|
41
|
-
export interface ActivityLine {
|
|
42
|
-
/** What kind of step this is, used to colour it. */
|
|
43
|
-
readonly tone: "reason" | "tool" | "result";
|
|
44
|
-
/** The display text (already shortened to a single line). */
|
|
45
|
-
readonly text: string;
|
|
46
|
-
}
|
|
47
|
-
/** Live progress a running sub-agent streams back while it works. */
|
|
48
|
-
export interface DelegateProgress {
|
|
49
|
-
/** Cumulative tokens the sub-agent has spent so far (input + output). */
|
|
50
|
-
readonly tokens: number;
|
|
51
|
-
/** The sub-agent's recent activity (reasoning + tool steps), newest last. */
|
|
52
|
-
readonly activity: readonly ActivityLine[];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The contract a host's sub-agent runner must satisfy to be wired in.
|
|
56
|
-
*
|
|
57
|
-
* Intentionally minimal: the deck only needs a way to run one objective under
|
|
58
|
-
* cancellation and get one report back. How the runner spawns the sub-agent
|
|
59
|
-
* (in-process loop, worktree, separate process) is entirely the host's concern.
|
|
60
|
-
*/
|
|
61
|
-
export interface DelegateRunner {
|
|
62
|
-
/** Optional roster of named agent profiles, surfaced in the tool description. */
|
|
63
|
-
listAgents?(): readonly string[];
|
|
64
|
-
/**
|
|
65
|
-
* Run one delegated objective and resolve with the sub-agent's report.
|
|
66
|
-
*
|
|
67
|
-
* When an `onProgress` callback is supplied the runner streams live metrics
|
|
68
|
-
* (token spend) as the sub-agent works, so the host can surface them (the
|
|
69
|
-
* background-agents panel). Optional — a runner may ignore it.
|
|
70
|
-
*/
|
|
71
|
-
run(request: DelegateRequest, signal?: AbortSignal, onProgress?: (progress: DelegateProgress) => void): Promise<DelegateResult>;
|
|
72
|
-
}
|
|
73
|
-
declare const TaskParams: import("@sinclair/typebox").TObject<{
|
|
74
|
-
objective: import("@sinclair/typebox").TString;
|
|
75
|
-
agent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
76
|
-
context: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
77
|
-
}>;
|
|
78
|
-
/** Statically-inferred parameter type the capability's `execute` receives. */
|
|
79
|
-
export type TaskParamsType = Static<typeof TaskParams>;
|
|
80
|
-
/** Structured detail returned alongside the model-facing content. */
|
|
81
|
-
export interface TaskDetails {
|
|
82
|
-
/** True when a delegate runner handled the objective. */
|
|
83
|
-
readonly delegated: boolean;
|
|
84
|
-
/** True when the sub-agent (or stub) considers the objective met. */
|
|
85
|
-
readonly ok: boolean;
|
|
86
|
-
/** The agent profile that ran, if one was named. */
|
|
87
|
-
readonly agent?: string;
|
|
88
|
-
/** Cumulative tokens the sub-agent spent — streamed live on progress updates. */
|
|
89
|
-
readonly tokens?: number;
|
|
90
|
-
/** The sub-agent's recent activity — streamed live for the drill-in view. */
|
|
91
|
-
readonly activity?: readonly ActivityLine[];
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Build the task/delegate capability.
|
|
95
|
-
*
|
|
96
|
-
* If a {@link DelegateRunner} is present on the context it is bound and the tool
|
|
97
|
-
* truly delegates; otherwise the tool builds anyway and returns a typed,
|
|
98
|
-
* non-throwing stub result so the deck stays assemblable in every environment.
|
|
99
|
-
*
|
|
100
|
-
* @param ctx the deck context; an optional delegate runner is read from
|
|
101
|
-
* `ctx.framework[DELEGATE_HANDLE_KEY]`.
|
|
102
|
-
*/
|
|
103
|
-
export declare function buildTaskCapability(ctx: DeckContext): Capability<typeof TaskParams, TaskDetails>;
|
|
104
|
-
/** Catalog row for the task/delegate capability. */
|
|
105
|
-
export declare const taskCard: CapabilityCard;
|
|
106
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Todo capability — an in-memory checklist the agent set/reads during a run.
|
|
3
|
-
*
|
|
4
|
-
* App-novel and framework-agnostic: the store is a plain in-process array of
|
|
5
|
-
* items, owned by the card and closed over by the built capability. No file
|
|
6
|
-
* persistence, no session-branch reconstruction, no framework store — just a
|
|
7
|
-
* mutable list the agent rewrites wholesale (the model is expected to send the
|
|
8
|
-
* complete desired list on every `set`, the same convention coding agents use so
|
|
9
|
-
* the plan stays a single coherent snapshot rather than a diff stream).
|
|
10
|
-
*
|
|
11
|
-
* Two operations are folded into one tool keyed by an `action` discriminant:
|
|
12
|
-
* - `read` — return the current checklist as model-facing prose.
|
|
13
|
-
* - `set` — replace the checklist with the supplied items (the authoritative
|
|
14
|
-
* new plan), then echo it back.
|
|
15
|
-
*
|
|
16
|
-
* The card produces a {@link Capability} (the framework `AgentTool` shape) so the
|
|
17
|
-
* conductor consumes it verbatim as one of `options.tools`. Parameters are a
|
|
18
|
-
* TypeBox schema; the prose below is original to this deck.
|
|
19
|
-
*/
|
|
20
|
-
import { type Static } from "@sinclair/typebox";
|
|
21
|
-
import type { Capability, CapabilityCard, DeckContext } from "../contract";
|
|
22
|
-
/** Lifecycle state of one checklist item. */
|
|
23
|
-
export type TodoState = "pending" | "active" | "done" | "dropped";
|
|
24
|
-
/** Relative importance of one checklist item. */
|
|
25
|
-
export type TodoWeight = "low" | "normal" | "high";
|
|
26
|
-
/** One row of the in-memory checklist. */
|
|
27
|
-
export interface TodoItem {
|
|
28
|
-
/** The work to be done, phrased as a short imperative. */
|
|
29
|
-
readonly task: string;
|
|
30
|
-
/** Where the item stands right now. */
|
|
31
|
-
readonly state: TodoState;
|
|
32
|
-
/** How much it matters relative to the rest of the list. */
|
|
33
|
-
readonly weight: TodoWeight;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A minimal in-process checklist store.
|
|
37
|
-
*
|
|
38
|
-
* Deliberately tiny and synchronous: the whole list lives in one field, `set`
|
|
39
|
-
* swaps it atomically, and `read` hands back a frozen copy so a caller cannot
|
|
40
|
-
* mutate the store's backing array. One store is created per built capability,
|
|
41
|
-
* so two sessions never share a checklist.
|
|
42
|
-
*/
|
|
43
|
-
export declare class TodoLedger {
|
|
44
|
-
private items;
|
|
45
|
-
/** Replace the entire checklist with `next`; returns the stored snapshot. */
|
|
46
|
-
set(next: readonly TodoItem[]): readonly TodoItem[];
|
|
47
|
-
/** Return the current checklist as a frozen, read-only snapshot. */
|
|
48
|
-
read(): readonly TodoItem[];
|
|
49
|
-
}
|
|
50
|
-
declare const TodoParams: import("@sinclair/typebox").TObject<{
|
|
51
|
-
action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"read">, import("@sinclair/typebox").TLiteral<"set">]>;
|
|
52
|
-
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
53
|
-
task: import("@sinclair/typebox").TString;
|
|
54
|
-
state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"pending">, import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"done">, import("@sinclair/typebox").TLiteral<"dropped">]>;
|
|
55
|
-
weight: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"low">, import("@sinclair/typebox").TLiteral<"normal">, import("@sinclair/typebox").TLiteral<"high">]>;
|
|
56
|
-
}>>>;
|
|
57
|
-
}>;
|
|
58
|
-
/** Statically-inferred parameter type the capability's `execute` receives. */
|
|
59
|
-
export type TodoParamsType = Static<typeof TodoParams>;
|
|
60
|
-
/** Structured detail returned alongside the model-facing content. */
|
|
61
|
-
export interface TodoDetails {
|
|
62
|
-
/** The action that was performed. */
|
|
63
|
-
readonly action: "read" | "set";
|
|
64
|
-
/** The checklist as it stands after the call. */
|
|
65
|
-
readonly items: readonly TodoItem[];
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Build the todo capability, binding it to a freshly created in-memory ledger.
|
|
69
|
-
*
|
|
70
|
-
* The ledger is closed over by `execute`, so the checklist persists for the life
|
|
71
|
-
* of this capability instance (i.e. the session) without any external store.
|
|
72
|
-
*
|
|
73
|
-
* @param _ctx the deck context (unused — the todo card needs no cwd/backends)
|
|
74
|
-
*/
|
|
75
|
-
export declare function buildTodoCapability(_ctx: DeckContext): Capability<typeof TodoParams, TodoDetails>;
|
|
76
|
-
/** Catalog row for the todo capability — registered in `CAPABILITY_CARDS`. */
|
|
77
|
-
export declare const todoCard: CapabilityCard;
|
|
78
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow capability — orchestrate a deterministic fan-out of subagents.
|
|
3
|
-
*
|
|
4
|
-
* App-novel wiring, sibling to (and UNRELATED to) the {@link "./task-card"}
|
|
5
|
-
* delegate card. The `workflow` tool runs a deterministic JavaScript workflow
|
|
6
|
-
* script that calls `agent()`, `parallel()`, and `pipeline()` to fan work out
|
|
7
|
-
* across many fresh subagents and fan their results back in, all under a live
|
|
8
|
-
* `◆ Workflow:` progress tree streamed into the tool result.
|
|
9
|
-
*
|
|
10
|
-
* The actual subagent runner is NOT owned by this card — it is a framework /
|
|
11
|
-
* boot concern injected through {@link DeckContext.framework} under the
|
|
12
|
-
* {@link WORKFLOW_HANDLE_KEY} key. When that handle is present the capability
|
|
13
|
-
* really runs the workflow (via the pure {@link runWorkflow} engine); when it is
|
|
14
|
-
* absent (tests, headless tooling, a host that has not wired the runner) the
|
|
15
|
-
* capability degrades gracefully to a clearly-typed {@link STUB_NOTE} result
|
|
16
|
-
* rather than throwing, exactly like the task card's `readDelegateRunner` path.
|
|
17
|
-
*
|
|
18
|
-
* Recursion guard: this card is registered all-profile-only in
|
|
19
|
-
* {@link "../cards/index"} (`APP_NOVEL_CARDS`), so the `'authoring'` deck a
|
|
20
|
-
* workflow subagent runs against EXCLUDES it — a subagent cannot call `workflow`.
|
|
21
|
-
*
|
|
22
|
-
* Live UI: each engine lifecycle callback mutates a {@link WorkflowSnapshot} and
|
|
23
|
-
* calls the framework `onUpdate` with the snapshot rendered through
|
|
24
|
-
* {@link renderWorkflowText} (the v1 string renderer). Updates are coalesced to
|
|
25
|
-
* status transitions (phase / agent start / agent end), not every log line, to
|
|
26
|
-
* avoid render thrash. The conductor re-projects the framework
|
|
27
|
-
* `tool_execution_update` event to a `tool_update` product signal (stage 3).
|
|
28
|
-
*/
|
|
29
|
-
import { type Static } from "@sinclair/typebox";
|
|
30
|
-
import type { Capability, CapabilityCard, DeckContext } from "../contract";
|
|
31
|
-
import { type WorkflowSnapshot } from "../../workflow-engine";
|
|
32
|
-
/** Key under which a host wires a live workflow agent runner into the context. */
|
|
33
|
-
export declare const WORKFLOW_HANDLE_KEY: "workflow";
|
|
34
|
-
declare const WorkflowParams: import("@sinclair/typebox").TObject<{
|
|
35
|
-
script: import("@sinclair/typebox").TString;
|
|
36
|
-
args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
|
37
|
-
}>;
|
|
38
|
-
/** Statically-inferred parameter type the capability's `execute` receives. */
|
|
39
|
-
export type WorkflowParamsType = Static<typeof WorkflowParams>;
|
|
40
|
-
/** Structured detail returned alongside the model-facing content (the snapshot). */
|
|
41
|
-
export type WorkflowDetails = WorkflowSnapshot;
|
|
42
|
-
/**
|
|
43
|
-
* Build the workflow capability.
|
|
44
|
-
*
|
|
45
|
-
* If a {@link WorkflowAgentRunner} is present on the context it is bound and the
|
|
46
|
-
* tool truly orchestrates; otherwise the tool builds anyway and returns a typed,
|
|
47
|
-
* non-throwing stub so the deck stays assemblable in every environment.
|
|
48
|
-
*
|
|
49
|
-
* @param ctx the deck context; an optional runner is read from
|
|
50
|
-
* `ctx.framework[WORKFLOW_HANDLE_KEY]`.
|
|
51
|
-
*/
|
|
52
|
-
export declare function buildWorkflowCapability(ctx: DeckContext): Capability<typeof WorkflowParams, WorkflowDetails>;
|
|
53
|
-
/** Catalog row for the workflow capability. */
|
|
54
|
-
export declare const workflowCard: CapabilityCard;
|
|
55
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow card — focused unit tests.
|
|
3
|
-
*
|
|
4
|
-
* The card is a pure capability builder over the pure {@link runWorkflow} engine
|
|
5
|
-
* (an injected {@link WorkflowAgentRunner} does the spawning). These tests cover:
|
|
6
|
-
* - the STUB_NOTE degrade when no runner handle is wired (no throw),
|
|
7
|
-
* - a real run with an in-memory fake runner: lifecycle → snapshot,
|
|
8
|
-
* - abort flips running agents to skipped,
|
|
9
|
-
* - and the deck-assembly guarantee: workflow appears in the `all` profile but
|
|
10
|
-
* NOT in the `authoring` subagent profile (the recursion guard).
|
|
11
|
-
*/
|
|
12
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File checkpoint / code rewind — PRODUCT integration test (rewind, #24).
|
|
3
|
-
*
|
|
4
|
-
* This proves the checkpoint records through the ACTUAL wired path the product
|
|
5
|
-
* uses, NOT a hand-rolled harness:
|
|
6
|
-
*
|
|
7
|
-
* 1. We provision a real deck via {@link provisionDeck} with a `framework` bag
|
|
8
|
-
* carrying a real per-session {@link CheckpointStore} under the SAME
|
|
9
|
-
* `checkpoint` handle key `session.ts` injects (`CHECKPOINT_HANDLE_KEY`).
|
|
10
|
-
* 2. We pull the WIRED `edit` capability out of that deck — the same `AgentTool`
|
|
11
|
-
* object the conductor would run — and edit a file through it.
|
|
12
|
-
*
|
|
13
|
-
* The framework's edit tool calls `ctx.framework['checkpoint'].record(absPath,
|
|
14
|
-
* previous)` immediately before the write lands, with the file's OLD on-disk
|
|
15
|
-
* content. If the bridge failed to thread the store into `createEditTool`, the
|
|
16
|
-
* handle would be `undefined` and nothing would be recorded — so the assertions
|
|
17
|
-
* below only pass when the store reaches the tool through the real wiring.
|
|
18
|
-
*
|
|
19
|
-
* We then call `store.restore(nodeId)` and assert the on-disk content reverts to
|
|
20
|
-
* the pre-edit bytes, closing the loop end-to-end.
|
|
21
|
-
*
|
|
22
|
-
* Note: no `readState` handle is wired here, so the read-before-edit gate is OFF
|
|
23
|
-
* and the edit proceeds without a prior read — isolating the checkpoint behavior.
|
|
24
|
-
*/
|
|
25
|
-
export {};
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capability-deck contract — the FROZEN type surface of the tooling layer.
|
|
3
|
-
*
|
|
4
|
-
* This module is the single typed seam between the coding-agent *product* and
|
|
5
|
-
* the set of callable capabilities the agent runtime executes — file ops, the
|
|
6
|
-
* shell, search, the web, the delegate/subagent action, the checklist, the
|
|
7
|
-
* background-process proxy, SaaS connector actions, and dynamically-grafted MCP
|
|
8
|
-
* server tools. It declares *only* shapes plus a handful of tiny inert helpers
|
|
9
|
-
* (an id brand, a key minter, a fault factory, and a pure ledger reducer) — no
|
|
10
|
-
* I/O, no provisioning, no orchestration. Every later deck module (the manifest
|
|
11
|
-
* catalog, the builtin bridge, the per-concern provisioners, the bridge network,
|
|
12
|
-
* and the assembled `ToolDeck`) is written against the names declared here, so
|
|
13
|
-
* the file is intentionally small, append-mostly, and stable.
|
|
14
|
-
*
|
|
15
|
-
* Design stance:
|
|
16
|
-
* - A {@link Capability} is exactly the framework `AgentTool` shape. The deck
|
|
17
|
-
* does not invent a parallel descriptor type; it *manages* AgentTools so the
|
|
18
|
-
* conductor can consume the deck's output directly as `options.tools`.
|
|
19
|
-
* - The catalog is a single source of truth: {@link CapabilityCard} rows live
|
|
20
|
-
* in one `CAPABILITY_CARDS` array (built by the manifest module), and every
|
|
21
|
-
* index/lookup is derived *from* that array rather than hand-maintained in a
|
|
22
|
-
* second parallel map.
|
|
23
|
-
* - Profiles replace a trio of near-identical build functions: one
|
|
24
|
-
* data-driven provisioner walks a {@link DeckProfile} ("authoring" |
|
|
25
|
-
* "survey" | "all") to assemble the right capability set for a session.
|
|
26
|
-
* - MCP enrollment is **event-sourced**: a {@link BridgeLedger} is the fold of
|
|
27
|
-
* an append-only stream of {@link BridgeEntry} events (`enroll` / `retire`),
|
|
28
|
-
* keyed by a content-hash / ULID {@link BridgeKey} rather than a path digest.
|
|
29
|
-
* The current view is a {@link LedgerSnapshot} reduced from that stream.
|
|
30
|
-
*
|
|
31
|
-
* Framework anchors (all from the `indusagi` package — the sibling rebuilt
|
|
32
|
-
* framework this app targets):
|
|
33
|
-
* - `AgentTool`, `AgentToolResult` ← `indusagi/agent`
|
|
34
|
-
* - `ToolBox` ← `indusagi/runtime`
|
|
35
|
-
* - `TSchema`, `Static` ← `@sinclair/typebox`
|
|
36
|
-
*
|
|
37
|
-
* The deck never re-declares these; it composes them.
|
|
38
|
-
*/
|
|
39
|
-
import type { AgentTool, AgentToolResult } from "indusagi/agent";
|
|
40
|
-
import type { ToolBox } from "indusagi/runtime";
|
|
41
|
-
import type { Static, TSchema } from "@sinclair/typebox";
|
|
42
|
-
/** Re-exported framework vocabulary that deck consumers routinely need. */
|
|
43
|
-
export type { AgentTool, AgentToolResult, ToolBox, TSchema, Static };
|
|
44
|
-
/**
|
|
45
|
-
* A single callable tool the deck manages.
|
|
46
|
-
*
|
|
47
|
-
* Deliberately an alias of the framework `AgentTool` rather than a fresh shape:
|
|
48
|
-
* the conductor and the framework agent loop both expect `AgentTool` objects, so
|
|
49
|
-
* the deck's whole job is to *assemble* them, not to wrap them in a parallel
|
|
50
|
-
* descriptor. A `Capability` therefore carries the framework contract verbatim —
|
|
51
|
-
* `name`, `label`, `description`, a TypeBox `parameters` schema, and an
|
|
52
|
-
* async `execute` — while the deck owns only the catalog, profiles, and
|
|
53
|
-
* dynamic-bridge layers around it.
|
|
54
|
-
*
|
|
55
|
-
* `TParameters` is left open (`TSchema`) so heterogeneous capabilities with
|
|
56
|
-
* different parameter schemas coexist in one `Capability[]`.
|
|
57
|
-
*/
|
|
58
|
-
export type Capability<TParameters extends TSchema = TSchema, TDetails = unknown> = AgentTool<TParameters, TDetails>;
|
|
59
|
-
/**
|
|
60
|
-
* A capability whose parameter/detail types are erased — the element type of a
|
|
61
|
-
* heterogeneous deck.
|
|
62
|
-
*
|
|
63
|
-
* A `Capability[]` array of mixed schemas widens to `AnyCapability[]`; this is
|
|
64
|
-
* the shape the conductor consumes as `options.tools` and the type the deck's
|
|
65
|
-
* {@link ToolDeck.tools} / {@link ToolDeck.box} surface in.
|
|
66
|
-
*/
|
|
67
|
-
export type AnyCapability = Capability<TSchema, unknown>;
|
|
68
|
-
/**
|
|
69
|
-
* String-branded stable identifier for a capability.
|
|
70
|
-
*
|
|
71
|
-
* The wire-facing tool `name` the model sees (e.g. `"read"`, `"bash"`,
|
|
72
|
-
* `"composio_execute"`, a qualified `"<server>__<tool>"`); branded so an
|
|
73
|
-
* arbitrary string cannot be passed where a vetted capability id is required.
|
|
74
|
-
* Mint one with {@link capabilityId}.
|
|
75
|
-
*/
|
|
76
|
-
export type CapabilityId = string & {
|
|
77
|
-
readonly __capability: unique symbol;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Brand a raw string as a {@link CapabilityId}. The single sanctioned way to
|
|
81
|
-
* produce one, so id provenance stays uniform across the catalog and bridge.
|
|
82
|
-
*
|
|
83
|
-
* @param raw the wire-facing tool name to brand
|
|
84
|
-
*/
|
|
85
|
-
export declare function capabilityId(raw: string): CapabilityId;
|
|
86
|
-
/**
|
|
87
|
-
* One row of the static capability catalog — the deck's single source of truth.
|
|
88
|
-
*
|
|
89
|
-
* A card is *metadata plus a builder*: it advertises the capability's identity
|
|
90
|
-
* (`id`, `title`, `summary`) for help/introspection and slash-command listings,
|
|
91
|
-
* and carries a {@link CapabilityCard.build} factory that mints the live
|
|
92
|
-
* {@link Capability} for a given {@link DeckContext}. The catalog array
|
|
93
|
-
* (`CAPABILITY_CARDS`, owned by the manifest module) is the only hand-maintained
|
|
94
|
-
* list; every index, profile membership, and lookup is derived from it.
|
|
95
|
-
*/
|
|
96
|
-
export interface CapabilityCard {
|
|
97
|
-
/** Stable, wire-facing identifier of the capability this card builds. */
|
|
98
|
-
readonly id: CapabilityId;
|
|
99
|
-
/** Short human-facing title for catalogs and help text. */
|
|
100
|
-
readonly title: string;
|
|
101
|
-
/** One-line description of what the capability does, in the deck's own voice. */
|
|
102
|
-
readonly summary: string;
|
|
103
|
-
/**
|
|
104
|
-
* Build the live capability for a working context.
|
|
105
|
-
*
|
|
106
|
-
* Pure with respect to the deck: it reads the injected backends from `ctx`
|
|
107
|
-
* and returns a configured {@link Capability}; it performs no enrollment and
|
|
108
|
-
* mutates no shared state.
|
|
109
|
-
*
|
|
110
|
-
* @param ctx the working context (cwd + injectable backends) to bind to
|
|
111
|
-
*/
|
|
112
|
-
build(ctx: DeckContext): Capability;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* The set of capabilities a card is eligible for, by profile.
|
|
116
|
-
*
|
|
117
|
-
* A card declares which {@link DeckProfile}s it participates in; the
|
|
118
|
-
* data-driven provisioner intersects this with the requested profile instead of
|
|
119
|
-
* branching through separate per-profile build functions. `"all"` is implied for
|
|
120
|
-
* every card and need not be listed.
|
|
121
|
-
*/
|
|
122
|
-
export type CardProfiles = readonly DeckProfile[];
|
|
123
|
-
/**
|
|
124
|
-
* The named capability sets a session can be provisioned with — the profile
|
|
125
|
-
* table that replaces a trio of near-identical build functions.
|
|
126
|
-
*
|
|
127
|
-
* - `authoring` — the READ-ONLY built-in subset: read/ls/search/web/
|
|
128
|
-
* checklist-read. No filesystem mutation, no shell, no app-novel cards —
|
|
129
|
-
* the deck sub-agents (task/workflow) are provisioned with (see
|
|
130
|
-
* {@link "./provision"}'s PROFILE_TABLE, the authoritative mapping).
|
|
131
|
-
* - `survey` — every built-in (mutating ones included), no app-novel cards.
|
|
132
|
-
* - `all` — every registered capability, nothing withheld. What an
|
|
133
|
-
* interactive coding session runs with.
|
|
134
|
-
*/
|
|
135
|
-
export type DeckProfile = "authoring" | "survey" | "all";
|
|
136
|
-
/**
|
|
137
|
-
* The working context handed to {@link CapabilityCard.build}.
|
|
138
|
-
*
|
|
139
|
-
* Bundles the workspace root with the injectable backends a capability binds to,
|
|
140
|
-
* so capabilities stay framework-agnostic and testable: a test passes fake
|
|
141
|
-
* `fs` / `shell` ports, production passes the Node-backed ones. Every field
|
|
142
|
-
* beyond `cwd` is optional — the manifest supplies framework defaults when a
|
|
143
|
-
* backend is not injected.
|
|
144
|
-
*/
|
|
145
|
-
export interface DeckContext {
|
|
146
|
-
/** Absolute working directory the session's capabilities are scoped to. */
|
|
147
|
-
readonly cwd: string;
|
|
148
|
-
/** Injectable filesystem port; framework Node backend is the default. */
|
|
149
|
-
readonly fs?: DeckFsBackend;
|
|
150
|
-
/** Injectable shell port; framework Node backend is the default. */
|
|
151
|
-
readonly shell?: DeckShellBackend;
|
|
152
|
-
/** Opaque framework handles a capability may need (model registry, stores). */
|
|
153
|
-
readonly framework?: DeckFrameworkHandles;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Filesystem backend port a capability may bind to.
|
|
157
|
-
*
|
|
158
|
-
* Intentionally opaque at the contract layer: the concrete port shape is owned
|
|
159
|
-
* by the framework capabilities kernel. The deck only needs to *thread* it from
|
|
160
|
-
* a host into a card's builder, so the contract treats it as a branded handle —
|
|
161
|
-
* threaded, not interpreted, here.
|
|
162
|
-
*/
|
|
163
|
-
export type DeckFsBackend = {
|
|
164
|
-
readonly __deckFsBackend: unique symbol;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Shell backend port a capability may bind to. Opaque for the same reason as
|
|
168
|
-
* {@link DeckFsBackend}: a branded handle the contract threads but never reads.
|
|
169
|
-
*/
|
|
170
|
-
export type DeckShellBackend = {
|
|
171
|
-
readonly __deckShellBackend: unique symbol;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* A bag of opaque framework handles the novel capabilities wire to — the
|
|
175
|
-
* subagent/delegate manager, the checklist ledger, the background-process
|
|
176
|
-
* controller, the SaaS gateway. Each is optional and keyed by name; a card that
|
|
177
|
-
* needs one reads it from here, and the manifest fills in defaults.
|
|
178
|
-
*/
|
|
179
|
-
export interface DeckFrameworkHandles {
|
|
180
|
-
readonly [name: string]: unknown;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* The stable key of an enrolled bridge capability.
|
|
184
|
-
*
|
|
185
|
-
* Minted from the capability's identity rather than from a working-directory
|
|
186
|
-
* digest, so the same external tool grafted from two sessions collapses to one
|
|
187
|
-
* key and re-enrolling is idempotent. In practice a content hash of the
|
|
188
|
-
* qualified `<server>__<tool>` name (and its schema) or a fresh ULID; branded so
|
|
189
|
-
* a raw string cannot stand in for a vetted key.
|
|
190
|
-
*/
|
|
191
|
-
export type BridgeKey = string & {
|
|
192
|
-
readonly __bridgeKey: unique symbol;
|
|
193
|
-
};
|
|
194
|
-
/** Brand a raw string as a {@link BridgeKey}. */
|
|
195
|
-
export declare function bridgeKey(raw: string): BridgeKey;
|
|
196
|
-
/**
|
|
197
|
-
* The operations the MCP enrollment stream records.
|
|
198
|
-
*
|
|
199
|
-
* - `enroll` — a bridge capability became available and was grafted in (an
|
|
200
|
-
* upsert: re-enrolling the same {@link BridgeKey} replaces its entry).
|
|
201
|
-
* - `retire` — a bridge capability (or a whole server's set) was withdrawn (a
|
|
202
|
-
* splice: the keyed entry is removed from the reduced view).
|
|
203
|
-
*/
|
|
204
|
-
export type BridgeOp = "enroll" | "retire";
|
|
205
|
-
/**
|
|
206
|
-
* A single append-only event in the MCP enrollment stream.
|
|
207
|
-
*
|
|
208
|
-
* The ledger is never mutated in place; every change is one of these entries
|
|
209
|
-
* appended to an ordered log, and the live view is the fold of that log. An
|
|
210
|
-
* `enroll` entry carries the grafted {@link Capability} and the owning server;
|
|
211
|
-
* a `retire` entry need only name the {@link BridgeKey} (and server) to remove.
|
|
212
|
-
* Field names are the deck's own, not the framework's registry schema.
|
|
213
|
-
*/
|
|
214
|
-
export interface BridgeEntry {
|
|
215
|
-
/** The operation this event records. */
|
|
216
|
-
readonly op: BridgeOp;
|
|
217
|
-
/** Stable key of the bridge capability the event concerns. */
|
|
218
|
-
readonly key: BridgeKey;
|
|
219
|
-
/** Id of the external MCP server that owns the capability. */
|
|
220
|
-
readonly server: string;
|
|
221
|
-
/** The grafted capability — present on `enroll`, omitted on `retire`. */
|
|
222
|
-
readonly capability?: AnyCapability;
|
|
223
|
-
/** Monotonic sequence number; the append order, used to break upsert ties. */
|
|
224
|
-
readonly seq: number;
|
|
225
|
-
/** ISO-8601 timestamp the event was appended. */
|
|
226
|
-
readonly at: string;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* The reduced, current view of the MCP enrollment ledger.
|
|
230
|
-
*
|
|
231
|
-
* A pure projection of the {@link BridgeEntry} stream: the set of bridge
|
|
232
|
-
* capabilities live *right now*, keyed by {@link BridgeKey}, alongside the
|
|
233
|
-
* highest sequence number folded and a per-server tool count for status
|
|
234
|
-
* rendering. Produced by {@link reduceLedger}; consumers read it, never mutate.
|
|
235
|
-
*/
|
|
236
|
-
export interface LedgerSnapshot {
|
|
237
|
-
/** Currently-enrolled bridge capabilities, keyed by their stable key. */
|
|
238
|
-
readonly live: ReadonlyMap<BridgeKey, AnyCapability>;
|
|
239
|
-
/** Number of live capabilities grafted from each server, keyed by server id. */
|
|
240
|
-
readonly byServer: ReadonlyMap<string, number>;
|
|
241
|
-
/** The highest {@link BridgeEntry.seq} folded into this snapshot. */
|
|
242
|
-
readonly highWater: number;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Fold an append-only {@link BridgeEntry} stream into its current
|
|
246
|
-
* {@link LedgerSnapshot}.
|
|
247
|
-
*
|
|
248
|
-
* Pure and total: `enroll` upserts the keyed capability (later `seq` wins on a
|
|
249
|
-
* repeated key), `retire` removes it, and entries are applied in `seq` order so
|
|
250
|
-
* the result is independent of array order. This is the single sanctioned
|
|
251
|
-
* reducer, so the event-sourced view stays consistent across every producer.
|
|
252
|
-
*
|
|
253
|
-
* @param entries the enrollment events to fold, in any order
|
|
254
|
-
*/
|
|
255
|
-
export declare function reduceLedger(entries: readonly BridgeEntry[]): LedgerSnapshot;
|
|
256
|
-
/**
|
|
257
|
-
* The assembled capability deck a session runs against.
|
|
258
|
-
*
|
|
259
|
-
* The product of provisioning a {@link DeckProfile} against a
|
|
260
|
-
* {@link DeckContext}, optionally with bridge capabilities grafted on. It
|
|
261
|
-
* exposes exactly two reads: the flat capability list (for inspection, naming,
|
|
262
|
-
* and `--tools` style selection) and the consumable box the conductor wires in.
|
|
263
|
-
*
|
|
264
|
-
* `box()` returns an `AnyCapability[]` — the same `AgentTool[]` the conductor's
|
|
265
|
-
* session options accept directly — so a deck drops straight into
|
|
266
|
-
* `SessionConductorOptions.tools`. The {@link DeckBox} alias also admits the
|
|
267
|
-
* framework `ToolBox` for hosts that drive the lower-level runtime contract
|
|
268
|
-
* instead of the conductor.
|
|
269
|
-
*/
|
|
270
|
-
export interface ToolDeck {
|
|
271
|
-
/** The flat list of live capabilities, for inspection and selection. */
|
|
272
|
-
tools(): AnyCapability[];
|
|
273
|
-
/** The consumable surface the conductor (or runtime) wires in as its tools. */
|
|
274
|
-
box(): DeckBox;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* What {@link ToolDeck.box} hands to a consumer.
|
|
278
|
-
*
|
|
279
|
-
* Primarily an `AnyCapability[]` (= `AgentTool[]`), which the conductor accepts
|
|
280
|
-
* verbatim as `options.tools`. Also admits the framework {@link ToolBox} so a
|
|
281
|
-
* host wiring the raw runtime contract — or grafting MCP tools through the
|
|
282
|
-
* protocol bridge, which yields a `ToolBox` — can consume the deck the same way.
|
|
283
|
-
*/
|
|
284
|
-
export type DeckBox = AnyCapability[] | ToolBox;
|
|
285
|
-
/**
|
|
286
|
-
* The closed set of failure categories the deck can surface during
|
|
287
|
-
* provisioning or bridge enrollment.
|
|
288
|
-
*
|
|
289
|
-
* - `unknown_capability` — a requested id is not in the catalog.
|
|
290
|
-
* - `build_failed` — a card's `build` threw while minting a capability.
|
|
291
|
-
* - `bridge` — connecting/listing/grafting an MCP server failed.
|
|
292
|
-
* - `backend` — a required injected backend was missing or invalid.
|
|
293
|
-
*/
|
|
294
|
-
export type DeckFaultKind = "unknown_capability" | "build_failed" | "bridge" | "backend";
|
|
295
|
-
/**
|
|
296
|
-
* A typed, discriminated failure raised by the deck.
|
|
297
|
-
*
|
|
298
|
-
* `kind` selects the category; `message` is a human-readable summary; the
|
|
299
|
-
* optional `cause` carries the underlying error for logging without forcing
|
|
300
|
-
* consumers to parse the message. Construct one with {@link deckFault}.
|
|
301
|
-
*/
|
|
302
|
-
export interface DeckFault {
|
|
303
|
-
/** Failure category — the discriminant consumers switch on. */
|
|
304
|
-
readonly kind: DeckFaultKind;
|
|
305
|
-
/** Human-readable, single-line summary of what went wrong. */
|
|
306
|
-
readonly message: string;
|
|
307
|
-
/** Underlying error or structured detail, if any. */
|
|
308
|
-
readonly cause?: unknown;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Construct a {@link DeckFault}. The single sanctioned way to mint one, so the
|
|
312
|
-
* shape stays uniform across every producer.
|
|
313
|
-
*
|
|
314
|
-
* @param kind the failure category
|
|
315
|
-
* @param message a human-readable, single-line summary
|
|
316
|
-
* @param cause optional underlying error or structured detail
|
|
317
|
-
*/
|
|
318
|
-
export declare function deckFault(kind: DeckFaultKind, message: string, cause?: unknown): DeckFault;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capability-deck subsystem — public barrel.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports the FROZEN tooling-layer contract: the {@link Capability} alias
|
|
5
|
-
* over the framework `AgentTool`, the branded {@link CapabilityId}, the
|
|
6
|
-
* catalog row ({@link CapabilityCard}) that is the deck's single source of
|
|
7
|
-
* truth, the {@link DeckProfile} table and {@link DeckContext} injection bag,
|
|
8
|
-
* the event-sourced MCP enrollment model ({@link BridgeEntry}, {@link BridgeOp},
|
|
9
|
-
* {@link LedgerSnapshot} + the pure {@link reduceLedger} fold), the assembled
|
|
10
|
-
* {@link ToolDeck} the conductor consumes, and the typed {@link DeckFault}.
|
|
11
|
-
*
|
|
12
|
-
* Behavior modules (the manifest catalog, the builtin bridge, the per-concern
|
|
13
|
-
* provisioners, the bridge network, and the deck assembler) are added to this
|
|
14
|
-
* barrel as they land; consumers import the deck surface from
|
|
15
|
-
* `src/capability-deck` rather than reaching into individual modules.
|
|
16
|
-
*/
|
|
17
|
-
export type { Capability, AnyCapability, CapabilityId, CapabilityCard, CardProfiles, DeckProfile, DeckContext, DeckFsBackend, DeckShellBackend, DeckFrameworkHandles, BridgeKey, BridgeOp, BridgeEntry, LedgerSnapshot, ToolDeck, DeckBox, DeckFaultKind, DeckFault, AgentTool, AgentToolResult, ToolBox, TSchema, Static, } from "./contract";
|
|
18
|
-
export { capabilityId, bridgeKey, reduceLedger, deckFault, } from "./contract";
|
|
19
|
-
/**
|
|
20
|
-
* Built-in bridge — the single seam re-exposing the framework's native tools
|
|
21
|
-
* (read/write/edit/ls/grep/find/bash/process/checklist/web) as capabilities.
|
|
22
|
-
*/
|
|
23
|
-
export { BUILTIN_BRIDGE, BUILTIN_IDS, BUILTIN_PROFILES, builtinDescriptors, buildBuiltin, buildBuiltinsForProfile, type BridgeBuilder, type BuiltinDescriptor, } from "./builtin-bridge";
|
|
24
|
-
/**
|
|
25
|
-
* Capability catalog — the single `CAPABILITY_CARDS` source of truth plus the
|
|
26
|
-
* lookups/profile filters derived from it.
|
|
27
|
-
*/
|
|
28
|
-
export { CAPABILITY_CARDS, CAPABILITY_INDEX, CARD_PROFILES, capabilityIds, hasCapability, findCard, cardsForProfile, } from "./manifest";
|
|
29
|
-
/**
|
|
30
|
-
* App-novel capability cards — the in-house tools the deck builds itself
|
|
31
|
-
* (checklist, background-process proxy, delegate/sub-agent, SaaS connector,
|
|
32
|
-
* working memory) plus their builders, stores, and injection-handle types.
|
|
33
|
-
*/
|
|
34
|
-
export { APP_NOVEL_CARDS, todoCard, buildTodoCapability, TodoLedger, type TodoItem, type TodoState, type TodoWeight, type TodoParamsType, type TodoDetails, daemonCard, buildDaemonCapability, DaemonTable, type DaemonState, type DaemonParamsType, type DaemonDetails, taskCard, buildTaskCapability, DELEGATE_HANDLE_KEY, type DelegateRunner, type DelegateRequest, type DelegateResult, type TaskParamsType, type TaskDetails, workflowCard, buildWorkflowCapability, WORKFLOW_HANDLE_KEY, type WorkflowParamsType, type WorkflowDetails, saasCard, buildSaasCapability, SAAS_GATEWAY_KEY, type SaasGatewayPort, type RemoteToolSummary, type RemoteExecution, type SaasParamsType, type SaasDetails, memoryCard, buildMemoryCapability, InMemoryStore, MEMORY_HANDLE_KEY, type MemoryStore, type MemoryParamsType, type MemoryDetails, enterPlanModeCard, exitPlanModeCard, buildEnterPlanModeCapability, buildExitPlanModeCapability, PLAN_HANDLE_KEY, planSlug, planFilePath, writePlan, readPlan, PLANS_DIRNAME, type PlanController, type EnterPlanParamsType, type EnterPlanDetails, type ExitPlanParamsType, type ExitPlanDetails, } from "./cards/index";
|
|
35
|
-
/**
|
|
36
|
-
* Bridge ledger — event-sourced enrollment of dynamically grafted MCP tools:
|
|
37
|
-
* content-hash / ULID key minting, the immutable {@link BridgeLedger} value with
|
|
38
|
-
* its pure enroll/retire/withdraw transitions and live projections, and the
|
|
39
|
-
* side-effecting mount/adapt/detach network operations.
|
|
40
|
-
*/
|
|
41
|
-
export { qualifyBridgeName, bridgeContentKey, bridgeUlidKey, emptyBridgeLedger, bridgeLedgerFromLog, enrollBridgeCard, retire, withdrawServer, liveCapabilities, liveCapabilitiesForServer, type BridgeLedger, type EnrollRequest, attachBridgeCapabilities, detachBridge, bridgeBoxToCapabilities, bridgeCapabilityCard, bridgeConfig, type AttachResult, } from "./bridge-ledger/index";
|
|
42
|
-
/**
|
|
43
|
-
* Deck provisioning — the single data-driven {@link provisionDeck} assembler over
|
|
44
|
-
* the profile table, plus the profile-to-cards selection it walks.
|
|
45
|
-
*/
|
|
46
|
-
export { provisionDeck, cardsForDeckProfile, } from "./provision";
|