@bastani/atomic 0.5.12 → 0.5.13-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/path-root-guard.d.ts +4 -0
- package/dist/lib/path-root-guard.d.ts.map +1 -0
- package/dist/sdk/components/color-utils.d.ts +4 -0
- package/dist/sdk/components/color-utils.d.ts.map +1 -0
- package/dist/sdk/components/compact-switcher.d.ts +10 -0
- package/dist/sdk/components/compact-switcher.d.ts.map +1 -0
- package/dist/sdk/components/connectors.d.ts +15 -0
- package/dist/sdk/components/connectors.d.ts.map +1 -0
- package/dist/sdk/components/edge.d.ts +4 -0
- package/dist/sdk/components/edge.d.ts.map +1 -0
- package/dist/sdk/components/error-boundary.d.ts +23 -0
- package/dist/sdk/components/error-boundary.d.ts.map +1 -0
- package/dist/sdk/components/graph-theme.d.ts +17 -0
- package/dist/sdk/components/graph-theme.d.ts.map +1 -0
- package/dist/sdk/components/header.d.ts +3 -0
- package/dist/sdk/components/header.d.ts.map +1 -0
- package/dist/sdk/components/hooks.d.ts +15 -0
- package/dist/sdk/components/hooks.d.ts.map +1 -0
- package/dist/sdk/components/layout.d.ts +27 -0
- package/dist/sdk/components/layout.d.ts.map +1 -0
- package/dist/sdk/components/node-card.d.ts +10 -0
- package/dist/sdk/components/node-card.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts +16 -0
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-store.d.ts +50 -0
- package/dist/sdk/components/orchestrator-panel-store.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-types.d.ts +18 -0
- package/dist/sdk/components/orchestrator-panel-types.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel.d.ts +56 -0
- package/dist/sdk/components/orchestrator-panel.d.ts.map +1 -0
- package/dist/sdk/components/session-graph-panel.d.ts +7 -0
- package/dist/sdk/components/session-graph-panel.d.ts.map +1 -0
- package/dist/sdk/components/status-helpers.d.ts +6 -0
- package/dist/sdk/components/status-helpers.d.ts.map +1 -0
- package/dist/sdk/components/statusline.d.ts +7 -0
- package/dist/sdk/components/statusline.d.ts.map +1 -0
- package/dist/sdk/components/workflow-picker-panel.d.ts +128 -0
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +1 -0
- package/dist/sdk/define-workflow.d.ts +91 -0
- package/dist/sdk/define-workflow.d.ts.map +1 -0
- package/dist/sdk/errors.d.ts +24 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +13 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/providers/claude.d.ts +187 -0
- package/dist/sdk/providers/claude.d.ts.map +1 -0
- package/dist/sdk/providers/copilot.d.ts +11 -0
- package/dist/sdk/providers/copilot.d.ts.map +1 -0
- package/dist/sdk/providers/opencode.d.ts +11 -0
- package/dist/sdk/providers/opencode.d.ts.map +1 -0
- package/dist/sdk/runtime/discovery.d.ts +86 -0
- package/dist/sdk/runtime/discovery.d.ts.map +1 -0
- package/dist/sdk/runtime/executor-entry.d.ts +11 -0
- package/dist/sdk/runtime/executor-entry.d.ts.map +1 -0
- package/dist/sdk/runtime/executor.d.ts +72 -0
- package/dist/sdk/runtime/executor.d.ts.map +1 -0
- package/dist/sdk/runtime/graph-inference.d.ts +35 -0
- package/dist/sdk/runtime/graph-inference.d.ts.map +1 -0
- package/dist/sdk/runtime/loader.d.ts +70 -0
- package/dist/sdk/runtime/loader.d.ts.map +1 -0
- package/dist/sdk/runtime/panel.d.ts +9 -0
- package/dist/sdk/runtime/panel.d.ts.map +1 -0
- package/dist/sdk/runtime/theme.d.ts +28 -0
- package/dist/sdk/runtime/theme.d.ts.map +1 -0
- package/dist/sdk/runtime/tmux.d.ts +297 -0
- package/dist/sdk/runtime/tmux.d.ts.map +1 -0
- package/dist/sdk/types.d.ts +309 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +62 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +46 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +26 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +92 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +57 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +49 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +18 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +19 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +69 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +240 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +20 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +18 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -0
- package/dist/sdk/workflows/index.d.ts +24 -0
- package/dist/sdk/workflows/index.d.ts.map +1 -0
- package/dist/services/config/definitions.d.ts +85 -0
- package/dist/services/config/definitions.d.ts.map +1 -0
- package/dist/services/system/copy.d.ts +77 -0
- package/dist/services/system/copy.d.ts.map +1 -0
- package/dist/services/system/detect.d.ts +75 -0
- package/dist/services/system/detect.d.ts.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error classes for the SDK.
|
|
3
|
+
*
|
|
4
|
+
* The SDK throws these instead of calling process.exit() or console.error().
|
|
5
|
+
* The CLI layer catches them and maps to user-visible output.
|
|
6
|
+
*/
|
|
7
|
+
/** Thrown when a required system dependency is not found on PATH. */
|
|
8
|
+
export declare class MissingDependencyError extends Error {
|
|
9
|
+
readonly dependency: "tmux" | "psmux" | "bun";
|
|
10
|
+
constructor(dependency: "tmux" | "psmux" | "bun");
|
|
11
|
+
}
|
|
12
|
+
/** Thrown when a workflow file is defined but missing .compile(). */
|
|
13
|
+
export declare class WorkflowNotCompiledError extends Error {
|
|
14
|
+
readonly path: string;
|
|
15
|
+
constructor(path: string);
|
|
16
|
+
}
|
|
17
|
+
/** Thrown when a workflow file does not export a valid WorkflowDefinition. */
|
|
18
|
+
export declare class InvalidWorkflowError extends Error {
|
|
19
|
+
readonly path: string;
|
|
20
|
+
constructor(path: string);
|
|
21
|
+
}
|
|
22
|
+
/** Extract a human-readable message from an unknown thrown value. */
|
|
23
|
+
export declare function errorMessage(error: unknown): string;
|
|
24
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qEAAqE;AACrE,qBAAa,sBAAuB,SAAQ,KAAK;aACnB,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;gBAApC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;CAIjE;AAED,qEAAqE;AACrE,qBAAa,wBAAyB,SAAQ,KAAK;aACrB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAUzC;AAED,8EAA8E;AAC9E,qBAAa,oBAAqB,SAAQ,KAAK;aACjB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAOzC;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* atomic SDK
|
|
3
|
+
*
|
|
4
|
+
* Public API barrel — re-exports the SDK surface.
|
|
5
|
+
* CLI-only concerns (colors, prompts, process management) are not exported here.
|
|
6
|
+
*/
|
|
7
|
+
export { MissingDependencyError, WorkflowNotCompiledError, InvalidWorkflowError, } from "./errors.ts";
|
|
8
|
+
export type { AgentType, Transcript, SavedMessage, SaveTranscript, SessionContext, SessionRef, SessionHandle, SessionRunOptions, WorkflowContext, WorkflowOptions, WorkflowDefinition, StageClientOptions, StageSessionOptions, ProviderClient, ProviderSession, } from "./types.ts";
|
|
9
|
+
export { defineWorkflow } from "./define-workflow.ts";
|
|
10
|
+
export { discoverWorkflows, findWorkflow, } from "./runtime/discovery.ts";
|
|
11
|
+
export { WorkflowLoader } from "./runtime/loader.ts";
|
|
12
|
+
export { executeWorkflow } from "./runtime/executor.ts";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code query abstraction.
|
|
3
|
+
*
|
|
4
|
+
* Sends a prompt to an interactive Claude Code session running in a tmux pane
|
|
5
|
+
* using `tmux send-keys -l --` (literal text) + `C-m` (raw carriage return).
|
|
6
|
+
* Verifies delivery by polling `capture-pane` and retries if needed.
|
|
7
|
+
*
|
|
8
|
+
* This is NOT headless — Claude runs as a full interactive TUI in the pane.
|
|
9
|
+
* We're automating keyboard input and reading pane output.
|
|
10
|
+
*
|
|
11
|
+
* Reliability hardened from oh-my-codex's sendToWorker implementation:
|
|
12
|
+
* - Pre-send readiness wait with exponential backoff
|
|
13
|
+
* - CLI-specific submit plan (Claude: 1 C-m per round)
|
|
14
|
+
* - Per-round capture verification (6 rounds)
|
|
15
|
+
* - Adaptive retry with C-u clear + retype
|
|
16
|
+
* - Post-submit active-task detection
|
|
17
|
+
* - File-based idle detection via session JSONL watching
|
|
18
|
+
*/
|
|
19
|
+
import { type SessionMessage, type SDKUserMessage, type Options as SDKOptions } from "@anthropic-ai/claude-agent-sdk";
|
|
20
|
+
/**
|
|
21
|
+
* Remove a pane from the initialized map, freeing memory.
|
|
22
|
+
* Call when a Claude session is killed or no longer needed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function clearClaudeSession(paneId: string): void;
|
|
25
|
+
export interface ClaudeSessionOptions {
|
|
26
|
+
/** tmux pane ID where Claude should be started */
|
|
27
|
+
paneId: string;
|
|
28
|
+
/** CLI flags to pass to the `claude` command (default: ["--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"]) */
|
|
29
|
+
chatFlags?: string[];
|
|
30
|
+
/** Timeout in ms waiting for Claude TUI to be ready (default: 30s) */
|
|
31
|
+
readyTimeoutMs?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Start Claude Code in a tmux pane with configurable CLI flags.
|
|
35
|
+
*
|
|
36
|
+
* Must be called before any `claudeQuery()` calls targeting the same pane.
|
|
37
|
+
* The pane should be a bare shell — `createClaudeSession` sends the `claude`
|
|
38
|
+
* command with the given flags and waits for the TUI to become ready.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* import { createClaudeSession, claudeQuery } from "@bastani/atomic/workflows";
|
|
43
|
+
*
|
|
44
|
+
* await createClaudeSession({ paneId: ctx.paneId });
|
|
45
|
+
* await claudeQuery({ paneId: ctx.paneId, prompt: "Describe this project" });
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // With custom flags
|
|
51
|
+
* await createClaudeSession({
|
|
52
|
+
* paneId: ctx.paneId,
|
|
53
|
+
* chatFlags: ["--model", "opus", "--dangerously-skip-permissions"],
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function createClaudeSession(options: ClaudeSessionOptions): Promise<void>;
|
|
58
|
+
export interface ClaudeQueryOptions {
|
|
59
|
+
/** tmux pane ID where Claude is running */
|
|
60
|
+
paneId: string;
|
|
61
|
+
/** The prompt to send */
|
|
62
|
+
prompt: string;
|
|
63
|
+
/** Polling interval in ms (default: 2000) */
|
|
64
|
+
pollIntervalMs?: number;
|
|
65
|
+
/** Number of C-m presses per submit round (default: 1 for Claude) */
|
|
66
|
+
submitPresses?: number;
|
|
67
|
+
/** Max submit rounds if text isn't consumed (default: 6) */
|
|
68
|
+
maxSubmitRounds?: number;
|
|
69
|
+
/** Timeout in ms waiting for pane to be ready before sending (default: 30s) */
|
|
70
|
+
readyTimeoutMs?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Extract text content from assistant messages in a transcript slice.
|
|
74
|
+
*
|
|
75
|
+
* Walks messages from `afterIndex` forward, pulls `TextBlock.text` from each
|
|
76
|
+
* assistant message's content array, and joins them. The `message` payload is
|
|
77
|
+
* `unknown` in the SDK type so we do runtime narrowing.
|
|
78
|
+
*
|
|
79
|
+
* Exported so workflow authors can extract text from `SessionMessage[]`
|
|
80
|
+
* returned by `s.session.query()`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function extractAssistantText(msgs: ReadonlyArray<{
|
|
83
|
+
type: string;
|
|
84
|
+
message: unknown;
|
|
85
|
+
}>, afterIndex: number): string;
|
|
86
|
+
/**
|
|
87
|
+
* Send a prompt to a Claude Code interactive session running in a tmux pane.
|
|
88
|
+
*
|
|
89
|
+
* Flow (hardened from OMX's sendToWorker):
|
|
90
|
+
* 1. Wait for pane readiness with exponential backoff
|
|
91
|
+
* 2. Capture pane content before sending
|
|
92
|
+
* 3. Send literal text via `send-keys -l --`
|
|
93
|
+
* 4. Submit with C-m rounds and per-round capture verification
|
|
94
|
+
* 5. Adaptive retry: clear line (C-u), re-type, re-submit
|
|
95
|
+
* 6. Post-submit verification via active-task detection
|
|
96
|
+
* 7. Wait for response by polling for output stabilization + prompt return
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import { claudeQuery } from "@bastani/atomic/workflows";
|
|
101
|
+
*
|
|
102
|
+
* const result = await claudeQuery({
|
|
103
|
+
* paneId: ctx.paneId,
|
|
104
|
+
* prompt: "Describe this project",
|
|
105
|
+
* });
|
|
106
|
+
* ctx.log(result.output);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare function claudeQuery(options: ClaudeQueryOptions): Promise<SessionMessage[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Default query options the user can set per-stage via the `sessionOpts` arg.
|
|
112
|
+
* These become defaults for every `s.session.query()` call within that stage.
|
|
113
|
+
*/
|
|
114
|
+
export interface ClaudeQueryDefaults {
|
|
115
|
+
/** Polling interval in ms (default: 2000) */
|
|
116
|
+
pollIntervalMs?: number;
|
|
117
|
+
/** Number of C-m presses per submit round (default: 1) */
|
|
118
|
+
submitPresses?: number;
|
|
119
|
+
/** Max submit rounds if text isn't consumed (default: 6) */
|
|
120
|
+
maxSubmitRounds?: number;
|
|
121
|
+
/** Timeout in ms waiting for pane to be ready before sending (default: 30s) */
|
|
122
|
+
readyTimeoutMs?: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Synthetic client wrapper for Claude stages.
|
|
126
|
+
* Auto-starts the Claude CLI in the tmux pane during `start()`.
|
|
127
|
+
*/
|
|
128
|
+
export declare class ClaudeClientWrapper {
|
|
129
|
+
readonly paneId: string;
|
|
130
|
+
private readonly opts;
|
|
131
|
+
constructor(paneId: string, opts?: {
|
|
132
|
+
chatFlags?: string[];
|
|
133
|
+
readyTimeoutMs?: number;
|
|
134
|
+
});
|
|
135
|
+
/** Start the Claude CLI in the tmux pane. Called by the runtime during init. */
|
|
136
|
+
start(): Promise<void>;
|
|
137
|
+
/** Noop — cleanup is handled by the runtime via `clearClaudeSession`. */
|
|
138
|
+
stop(): Promise<void>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Synthetic session wrapper for Claude stages.
|
|
142
|
+
* Wraps `claudeQuery()` so users call `s.session.query(prompt)`.
|
|
143
|
+
*/
|
|
144
|
+
export declare class ClaudeSessionWrapper {
|
|
145
|
+
readonly paneId: string;
|
|
146
|
+
readonly sessionId: string;
|
|
147
|
+
private readonly defaults;
|
|
148
|
+
constructor(paneId: string, sessionId: string, defaults?: ClaudeQueryDefaults);
|
|
149
|
+
/** Send a prompt to Claude and wait for the response. */
|
|
150
|
+
query(prompt: string, opts?: Partial<ClaudeQueryDefaults & SDKOptions>): Promise<SessionMessage[]>;
|
|
151
|
+
/** Noop — for API symmetry with CopilotSession.disconnect(). */
|
|
152
|
+
disconnect(): Promise<void>;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Headless client wrapper for Claude stages. No tmux pane — noop start/stop.
|
|
156
|
+
* Used when `options.headless` is true in `ctx.stage()`.
|
|
157
|
+
*/
|
|
158
|
+
export declare class HeadlessClaudeClientWrapper {
|
|
159
|
+
start(): Promise<void>;
|
|
160
|
+
stop(): Promise<void>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Headless session wrapper for Claude stages. Uses the Agent SDK's `query()`
|
|
164
|
+
* directly instead of tmux pane operations. Implements the same `query()`
|
|
165
|
+
* interface as {@link ClaudeSessionWrapper} so workflow callbacks work
|
|
166
|
+
* identically for headless and interactive stages.
|
|
167
|
+
*
|
|
168
|
+
* The `query()` method accepts the full Agent SDK parameter types —
|
|
169
|
+
* `prompt` can be a plain string or an `AsyncIterable<SDKUserMessage>`
|
|
170
|
+
* for multi-turn streaming, and `options` passes through SDK-level
|
|
171
|
+
* configuration (abort controllers, allowed tools, agents, etc.).
|
|
172
|
+
*/
|
|
173
|
+
export declare class HeadlessClaudeSessionWrapper {
|
|
174
|
+
readonly paneId = "";
|
|
175
|
+
readonly sessionId: string;
|
|
176
|
+
constructor(sessionId: string);
|
|
177
|
+
query(prompt: string | AsyncIterable<SDKUserMessage>, options?: Partial<ClaudeQueryDefaults & SDKOptions>): Promise<SessionMessage[]>;
|
|
178
|
+
disconnect(): Promise<void>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Validate a Claude workflow source file for common mistakes.
|
|
182
|
+
*
|
|
183
|
+
* Warns on direct usage of createClaudeSession/claudeQuery — the runtime
|
|
184
|
+
* now handles init/cleanup automatically via s.client and s.session.
|
|
185
|
+
*/
|
|
186
|
+
export declare const validateClaudeWorkflow: (source: string) => import("../types.ts").ValidationWarning[];
|
|
187
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/claude.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot workflow source validation.
|
|
3
|
+
*
|
|
4
|
+
* Checks that Copilot workflow source files use the runtime-managed
|
|
5
|
+
* `s.client` and `s.session` instead of manual SDK client creation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validate a Copilot workflow source file for common mistakes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const validateCopilotWorkflow: (source: string) => import("../types.ts").ValidationWarning[];
|
|
11
|
+
//# sourceMappingURL=copilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/copilot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,eAAO,MAAM,uBAAuB,+DAelC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode workflow source validation.
|
|
3
|
+
*
|
|
4
|
+
* Checks that OpenCode workflow source files use the runtime-managed
|
|
5
|
+
* `s.client` and `s.session` instead of manual SDK client creation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validate an OpenCode workflow source file for common mistakes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const validateOpenCodeWorkflow: (source: string) => import("../types.ts").ValidationWarning[];
|
|
11
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/opencode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,eAAO,MAAM,wBAAwB,+DAenC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow discovery — finds workflow definitions from disk.
|
|
3
|
+
*
|
|
4
|
+
* Workflows are discovered from:
|
|
5
|
+
* 1. .atomic/workflows/<name>/<agent>/index.ts (project-local)
|
|
6
|
+
* 2. ~/.atomic/workflows/<name>/<agent>/index.ts (global)
|
|
7
|
+
*
|
|
8
|
+
* Project-local workflows take precedence over global ones with the same name.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentType, WorkflowInput } from "../types.ts";
|
|
11
|
+
export interface DiscoveredWorkflow {
|
|
12
|
+
name: string;
|
|
13
|
+
agent: AgentType;
|
|
14
|
+
path: string;
|
|
15
|
+
source: "local" | "global" | "builtin";
|
|
16
|
+
}
|
|
17
|
+
export declare const AGENTS: AgentType[];
|
|
18
|
+
/**
|
|
19
|
+
* Default `.gitignore` content for a workflows directory.
|
|
20
|
+
* Auto-generated during install; regenerated by discovery if missing.
|
|
21
|
+
*/
|
|
22
|
+
export declare const WORKFLOWS_GITIGNORE: string;
|
|
23
|
+
/**
|
|
24
|
+
* Discover all available workflows from built-in, global, and local sources.
|
|
25
|
+
* Optionally filter by agent.
|
|
26
|
+
*
|
|
27
|
+
* **Merge precedence:** `builtin > local > global`.
|
|
28
|
+
*
|
|
29
|
+
* Builtin names are **strictly reserved** — a user-defined local or
|
|
30
|
+
* global workflow whose name matches any built-in workflow is dropped
|
|
31
|
+
* entirely from discovery. It will not be registered, returned from
|
|
32
|
+
* `findWorkflow`, appear in the interactive picker, or show up in
|
|
33
|
+
* `atomic workflow -l`. This protects SDK-shipped workflows (e.g.
|
|
34
|
+
* `ralph`) from being silently overridden or even visibly "competing
|
|
35
|
+
* with" a user's own definition, which would otherwise be confusing
|
|
36
|
+
* when someone tries to run the canonical version.
|
|
37
|
+
*
|
|
38
|
+
* Reservation is by **name only**, across all agents: if a builtin
|
|
39
|
+
* defines `ralph` for any agent, a local `ralph` for any other agent is
|
|
40
|
+
* also dropped. Local still overrides global for every non-builtin
|
|
41
|
+
* name, so project-scoped customisation of user-scoped workflows
|
|
42
|
+
* continues to work.
|
|
43
|
+
*
|
|
44
|
+
* By default, the result is **merged by precedence** — if a workflow is
|
|
45
|
+
* defined in both local and global sources, only the higher-precedence
|
|
46
|
+
* entry is returned. This is the right shape for `findWorkflow`, which
|
|
47
|
+
* needs the single resolved entry per (name, agent) pair.
|
|
48
|
+
*
|
|
49
|
+
* Pass `{ merge: false }` to get the **unmerged** result — local and
|
|
50
|
+
* global contribute their entries independently, so `--list` can show
|
|
51
|
+
* both a local and a global copy of the same workflow when they coexist
|
|
52
|
+
* on disk. (Builtin reservation still applies in both modes.)
|
|
53
|
+
*/
|
|
54
|
+
export declare function discoverWorkflows(projectRoot?: string, agentFilter?: AgentType, options?: {
|
|
55
|
+
merge?: boolean;
|
|
56
|
+
}): Promise<DiscoveredWorkflow[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Find a specific workflow by name and agent.
|
|
59
|
+
*/
|
|
60
|
+
export declare function findWorkflow(name: string, agent: AgentType, projectRoot?: string): Promise<DiscoveredWorkflow | null>;
|
|
61
|
+
/**
|
|
62
|
+
* A discovered workflow enriched with the metadata the picker needs to
|
|
63
|
+
* render it: the human description and the declared input schema.
|
|
64
|
+
*
|
|
65
|
+
* Populated by {@link loadWorkflowsMetadata}, which runs each discovered
|
|
66
|
+
* workflow through {@link WorkflowLoader.loadWorkflow} and extracts just
|
|
67
|
+
* the display-relevant fields — the full compiled definition is
|
|
68
|
+
* discarded after extraction so re-imports during execution are cheap.
|
|
69
|
+
*/
|
|
70
|
+
export interface WorkflowWithMetadata extends DiscoveredWorkflow {
|
|
71
|
+
/** Workflow description, empty string when none was declared. */
|
|
72
|
+
description: string;
|
|
73
|
+
/** Picker-ready input schema; free-form workflows materialize a prompt field. */
|
|
74
|
+
inputs: readonly WorkflowInput[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Load metadata (description + picker-ready inputs) for a batch of discovered workflows.
|
|
78
|
+
*
|
|
79
|
+
* Workflows that fail to import are **skipped silently** so one broken
|
|
80
|
+
* entry can never prevent the picker from rendering. Callers that need
|
|
81
|
+
* to surface load errors (e.g. `atomic workflow -n broken`) should use
|
|
82
|
+
* {@link WorkflowLoader.loadWorkflow} directly — that path produces
|
|
83
|
+
* structured error reports.
|
|
84
|
+
*/
|
|
85
|
+
export declare function loadWorkflowsMetadata(discovered: DiscoveredWorkflow[]): Promise<WorkflowWithMetadata[]>;
|
|
86
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;CACxC;AAUD,eAAO,MAAM,MAAM,EAAE,SAAS,EAAsC,CAAC;AAGrE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QASpB,CAAC;AAiIb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,GAAE,MAAsB,EACnC,WAAW,CAAC,EAAE,SAAS,EACvB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAChC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoD/B;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,EAChB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAGpC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,kBAAkB,EAAE,GAC/B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAejC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator entry point — invoked inside a tmux pane by the launcher script.
|
|
3
|
+
*
|
|
4
|
+
* Separated from executor.ts to avoid the dual-module-identity problem:
|
|
5
|
+
* Bun evaluates a file twice when it is both the entry point (`bun run`)
|
|
6
|
+
* and reached through package.json `exports` self-referencing. Keeping
|
|
7
|
+
* the side-effectful `--run` guard here ensures executor.ts stays a pure
|
|
8
|
+
* library module that can be safely re-exported from the SDK barrel.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=executor-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-entry.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow runtime executor.
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* 1. `executeWorkflow()` is called by the CLI command
|
|
6
|
+
* 2. It creates a tmux session with an orchestrator pane that runs
|
|
7
|
+
* `bun run executor-entry.ts` (a thin wrapper that calls `runOrchestrator()`)
|
|
8
|
+
* 3. The CLI then attaches to the tmux session (user sees it live)
|
|
9
|
+
* 4. The orchestrator pane calls `definition.run(workflowCtx)` — the
|
|
10
|
+
* user's callback uses `ctx.stage()` to spawn agent sessions
|
|
11
|
+
*
|
|
12
|
+
* The entry point is in executor-entry.ts (not this file) to avoid Bun's
|
|
13
|
+
* dual-module-identity issue: Bun evaluates a file twice when it is both
|
|
14
|
+
* the entry point and reached through package.json `exports` self-referencing.
|
|
15
|
+
*/
|
|
16
|
+
import type { WorkflowDefinition, AgentType, SavedMessage } from "../types.ts";
|
|
17
|
+
export { errorMessage } from "../errors.ts";
|
|
18
|
+
export interface WorkflowRunOptions {
|
|
19
|
+
/** The compiled workflow definition */
|
|
20
|
+
definition: WorkflowDefinition;
|
|
21
|
+
/** Agent type */
|
|
22
|
+
agent: AgentType;
|
|
23
|
+
/**
|
|
24
|
+
* Structured inputs for this run. Free-form workflows model their
|
|
25
|
+
* single positional prompt as `{ prompt: "..." }` so workflow
|
|
26
|
+
* authors can read `ctx.inputs.prompt` uniformly regardless of
|
|
27
|
+
* whether the workflow declares a schema. Empty record is valid.
|
|
28
|
+
*/
|
|
29
|
+
inputs?: Record<string, string>;
|
|
30
|
+
/** Absolute path to the workflow's index.ts file (from discovery) */
|
|
31
|
+
workflowFile: string;
|
|
32
|
+
/** Project root (defaults to cwd) */
|
|
33
|
+
projectRoot?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Escape a string for safe interpolation inside a bash double-quoted string.
|
|
37
|
+
*
|
|
38
|
+
* In bash `"..."` strings only `$`, `` ` ``, `\`, `"`, and `!` are special.
|
|
39
|
+
* Single quotes are literal inside double quotes and need no escaping.
|
|
40
|
+
* Null bytes are stripped because bash strings cannot contain them.
|
|
41
|
+
*/
|
|
42
|
+
export declare function escBash(s: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Escape a string for safe interpolation inside a PowerShell double-quoted string.
|
|
45
|
+
*
|
|
46
|
+
* In PowerShell `"..."` strings, backtick is the escape character and `$` triggers
|
|
47
|
+
* variable expansion. Null bytes are stripped for safety.
|
|
48
|
+
*/
|
|
49
|
+
export declare function escPwsh(s: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Decode the ATOMIC_WF_INPUTS env var (base64-encoded JSON) into a
|
|
52
|
+
* `Record<string, string>`. Returns an empty record when the variable
|
|
53
|
+
* is missing, malformed, or does not decode to a string-map object —
|
|
54
|
+
* structured inputs are optional, so a corrupt payload must never
|
|
55
|
+
* prevent free-form workflows from running.
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseInputsEnv(raw: string | undefined): Record<string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Called by `atomic workflow -n <name> -a <agent> <prompt>`.
|
|
60
|
+
*
|
|
61
|
+
* Always creates a tmux session in the atomic socket with the
|
|
62
|
+
* orchestrator as the initial pane, then attaches so the user sees
|
|
63
|
+
* everything live — even when invoked from inside another tmux session.
|
|
64
|
+
*/
|
|
65
|
+
export declare function executeWorkflow(options: WorkflowRunOptions): Promise<void>;
|
|
66
|
+
/** Type guard for objects with a string `content` property (Copilot assistant.message data). */
|
|
67
|
+
export declare function hasContent(value: unknown): value is {
|
|
68
|
+
content: string;
|
|
69
|
+
};
|
|
70
|
+
export declare function renderMessagesToText(messages: SavedMessage[]): string;
|
|
71
|
+
export declare function runOrchestrator(): Promise<void>;
|
|
72
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EACV,kBAAkB,EAMlB,SAAS,EAET,YAAY,EAMb,MAAM,aAAa,CAAC;AAuErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAS5C,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,iBAAiB;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA0HD;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKzC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB9E;AAMD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyEf;AAcD,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAOvE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAkDrE;AAykBD,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA0JrD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontier-based graph inference for workflow stage topology.
|
|
3
|
+
*
|
|
4
|
+
* Automatically infers parent-child edges from JavaScript's execution order:
|
|
5
|
+
* - **Sequential** (`await`): completed stages are in the frontier when the
|
|
6
|
+
* next stage spawns → parent-child edge.
|
|
7
|
+
* - **Parallel** (`Promise.all`): both calls fire in the same synchronous
|
|
8
|
+
* frame → frontier is empty for the second call → sibling edges.
|
|
9
|
+
* - **Fan-in**: after `Promise.all` resolves, all parallel stages are in the
|
|
10
|
+
* frontier → the next stage depends on all of them.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GraphFrontierTracker {
|
|
13
|
+
/**
|
|
14
|
+
* Stages that completed since the last stage was spawned in this scope.
|
|
15
|
+
* When non-empty at spawn time, the new stage is sequential (depends on frontier).
|
|
16
|
+
*/
|
|
17
|
+
private frontier;
|
|
18
|
+
/**
|
|
19
|
+
* The parent set for the current parallel batch — a snapshot of the frontier
|
|
20
|
+
* at the point the first sibling consumed it.
|
|
21
|
+
*/
|
|
22
|
+
private parallelAncestors;
|
|
23
|
+
constructor(parentName: string);
|
|
24
|
+
/**
|
|
25
|
+
* Called synchronously when a new stage is spawned.
|
|
26
|
+
* Returns the inferred graph parents for this stage.
|
|
27
|
+
*/
|
|
28
|
+
onSpawn(): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Called when a stage settles (completes or fails).
|
|
31
|
+
* Adds the stage to the frontier so the next spawn can chain from it.
|
|
32
|
+
*/
|
|
33
|
+
onSettle(name: string): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=graph-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-inference.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/graph-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,oBAAoB;IAC/B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAAW;gBAExB,UAAU,EAAE,MAAM;IAI9B;;;OAGG;IACH,OAAO,IAAI,MAAM,EAAE;IAUnB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG7B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Loader — multi-stage pipeline for resolving and loading workflows.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline: Discover → Resolve → Validate → Load
|
|
5
|
+
*
|
|
6
|
+
* Each stage returns a typed discriminated result so callers get structured
|
|
7
|
+
* error information without try/catch guesswork.
|
|
8
|
+
*
|
|
9
|
+
* Discovery (finding workflow files on disk) remains in `discovery.ts`.
|
|
10
|
+
* This module handles everything after a workflow is discovered.
|
|
11
|
+
*/
|
|
12
|
+
import type { WorkflowDefinition } from "../types.ts";
|
|
13
|
+
import type { DiscoveredWorkflow } from "./discovery.ts";
|
|
14
|
+
export declare namespace WorkflowLoader {
|
|
15
|
+
/** Successful pipeline result. */
|
|
16
|
+
type Ok<T> = {
|
|
17
|
+
ok: true;
|
|
18
|
+
value: T;
|
|
19
|
+
};
|
|
20
|
+
/** Failed pipeline result with stage and error context. */
|
|
21
|
+
type StageError<S extends string> = {
|
|
22
|
+
ok: false;
|
|
23
|
+
stage: S;
|
|
24
|
+
error: unknown;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
type StageResult<T, S extends string> = Ok<T> | StageError<S>;
|
|
28
|
+
/** Input to the pipeline — a discovered workflow from disk. */
|
|
29
|
+
type Plan = DiscoveredWorkflow;
|
|
30
|
+
/** Output of the resolve stage. */
|
|
31
|
+
type Resolved = Plan;
|
|
32
|
+
/** Source validation warning — alias of the canonical type from types.ts. */
|
|
33
|
+
type ValidationWarning = import("../types.ts").ValidationWarning;
|
|
34
|
+
/** Output of the validate stage. */
|
|
35
|
+
type Validated = Resolved & {
|
|
36
|
+
warnings: ValidationWarning[];
|
|
37
|
+
};
|
|
38
|
+
/** Output of the load stage — the final result. */
|
|
39
|
+
type Loaded = Validated & {
|
|
40
|
+
definition: WorkflowDefinition;
|
|
41
|
+
};
|
|
42
|
+
interface Report {
|
|
43
|
+
/** Called when a stage begins. */
|
|
44
|
+
start?: (stage: "resolve" | "validate" | "load") => void;
|
|
45
|
+
/** Called when source validation produces warnings. */
|
|
46
|
+
warn?: (warnings: ValidationWarning[]) => void;
|
|
47
|
+
/** Called when a stage fails. */
|
|
48
|
+
error?: (stage: "resolve" | "validate" | "load", error: unknown, message: string) => void;
|
|
49
|
+
}
|
|
50
|
+
/** Verify the workflow file exists. */
|
|
51
|
+
function resolve(plan: Plan): Promise<StageResult<Resolved, "resolve">>;
|
|
52
|
+
/**
|
|
53
|
+
* Read the workflow source and run agent-specific validation checks.
|
|
54
|
+
* Validation warnings are non-fatal — the pipeline continues.
|
|
55
|
+
*/
|
|
56
|
+
function validate(resolved: Resolved): Promise<StageResult<Validated, "validate">>;
|
|
57
|
+
/**
|
|
58
|
+
* Import the workflow module and extract the WorkflowDefinition.
|
|
59
|
+
* Checks for common authoring mistakes (missing `.compile()`, wrong export).
|
|
60
|
+
*/
|
|
61
|
+
function load(validated: Validated): Promise<StageResult<Loaded, "load">>;
|
|
62
|
+
/**
|
|
63
|
+
* Run the full pipeline: resolve → validate → load.
|
|
64
|
+
*
|
|
65
|
+
* Returns a structured result with the loaded WorkflowDefinition on success,
|
|
66
|
+
* or a stage-specific error on failure.
|
|
67
|
+
*/
|
|
68
|
+
function loadWorkflow(plan: Plan, report?: Report): Promise<StageResult<Loaded, "resolve" | "validate" | "load">>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAa,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,yBAAiB,cAAc,CAAC;IAK9B,kCAAkC;IAClC,KAAY,EAAE,CAAC,CAAC,IAAI;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,CAAC;IAE3C,2DAA2D;IAC3D,KAAY,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI;QACzC,EAAE,EAAE,KAAK,CAAC;QACV,KAAK,EAAE,CAAC,CAAC;QACT,KAAK,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,KAAY,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAMrE,+DAA+D;IAC/D,KAAY,IAAI,GAAG,kBAAkB,CAAC;IAEtC,mCAAmC;IACnC,KAAY,QAAQ,GAAG,IAAI,CAAC;IAE5B,6EAA6E;IAC7E,KAAY,iBAAiB,GAAG,OAAO,aAAa,EAAE,iBAAiB,CAAC;IAExE,oCAAoC;IACpC,KAAY,SAAS,GAAG,QAAQ,GAAG;QACjC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;KAC/B,CAAC;IAEF,mDAAmD;IACnD,KAAY,MAAM,GAAG,SAAS,GAAG;QAC/B,UAAU,EAAE,kBAAkB,CAAC;KAChC,CAAC;IAMF,UAAiB,MAAM;QACrB,kCAAkC;QAClC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;QACzD,uDAAuD;QACvD,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;QAC/C,iCAAiC;QACjC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KAC3F;IAMD,uCAAuC;IACvC,SAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAoB3C;IAsBD;;;OAGG;IACH,SAAsB,QAAQ,CAC5B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAiB7C;IAMD;;;OAGG;IACH,SAAsB,IAAI,CACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqCtC;IAMD;;;;;OAKG;IACH,SAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,EACV,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC,CA6B/D;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenTUI React-based orchestrator panel with session graph view.
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports the public API from the components/ directory.
|
|
5
|
+
* Internal implementation is modularized under ../components/.
|
|
6
|
+
*/
|
|
7
|
+
export { OrchestratorPanel } from "../components/orchestrator-panel.tsx";
|
|
8
|
+
export type { PanelSession, PanelOptions } from "../components/orchestrator-panel-types.ts";
|
|
9
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/panel.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal color theme using Catppuccin palettes.
|
|
3
|
+
*
|
|
4
|
+
* Uses OpenTUI's built-in dark/light mode detection (via the renderer's
|
|
5
|
+
* themeMode property) to select the appropriate palette:
|
|
6
|
+
* - Mocha for dark terminals (and as fallback)
|
|
7
|
+
* - Latte for light terminals
|
|
8
|
+
*/
|
|
9
|
+
import type { ThemeMode } from "@opentui/core";
|
|
10
|
+
export interface TerminalTheme {
|
|
11
|
+
bg: string;
|
|
12
|
+
surface: string;
|
|
13
|
+
selection: string;
|
|
14
|
+
border: string;
|
|
15
|
+
borderDim: string;
|
|
16
|
+
accent: string;
|
|
17
|
+
text: string;
|
|
18
|
+
dim: string;
|
|
19
|
+
success: string;
|
|
20
|
+
error: string;
|
|
21
|
+
warning: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the terminal theme from the renderer's detected theme mode.
|
|
25
|
+
* Returns Catppuccin Latte for light terminals, Mocha for dark or unknown.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveTheme(mode: ThemeMode | null): TerminalTheme;
|
|
28
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM/C,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AA0CD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,aAAa,CAElE"}
|