@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,4 @@
|
|
|
1
|
+
export declare function isPathWithinRoot(rootPath: string, candidatePath: string): boolean;
|
|
2
|
+
export declare function assertPathWithinRoot(rootPath: string, candidatePath: string, label: string): void;
|
|
3
|
+
export declare function assertRealPathWithinRoot(rootPath: string, candidatePath: string, label: string): Promise<string>;
|
|
4
|
+
//# sourceMappingURL=path-root-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-root-guard.d.ts","sourceRoot":"","sources":["../../src/lib/path-root-guard.ts"],"names":[],"mappings":"AAQA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAEjF;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,IAAI,CAIN;AAED,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-utils.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/color-utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAG9D;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* CompactSwitcher — a lightweight popup that lists all agents for quick
|
|
4
|
+
* direct-jump navigation. Opened with "/" from any view mode.
|
|
5
|
+
*/
|
|
6
|
+
export interface CompactSwitcherProps {
|
|
7
|
+
selectedIndex: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function CompactSwitcher({ selectedIndex }: CompactSwitcherProps): import("react").ReactNode;
|
|
10
|
+
//# sourceMappingURL=compact-switcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-switcher.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/compact-switcher.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;GAGG;AAMH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,EAAE,oBAAoB,6BA0DtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GraphTheme } from "./graph-theme.ts";
|
|
2
|
+
import { type LayoutNode } from "./layout.ts";
|
|
3
|
+
export interface ConnectorResult {
|
|
4
|
+
text: string;
|
|
5
|
+
col: number;
|
|
6
|
+
row: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
color: string;
|
|
10
|
+
}
|
|
11
|
+
/** Fan-out connector: one parent branching down to one or more tree children. */
|
|
12
|
+
export declare function buildConnector(parent: LayoutNode, rowH: Record<number, number>, theme: GraphTheme): ConnectorResult | null;
|
|
13
|
+
/** Fan-in connector: multiple parents converging down to a single merge child. */
|
|
14
|
+
export declare function buildMergeConnector(child: LayoutNode, rowH: Record<number, number>, allNodes: Record<string, LayoutNode>, theme: GraphTheme): ConnectorResult | null;
|
|
15
|
+
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/connectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,KAAK,EAAE,UAAU,GAChB,eAAe,GAAG,IAAI,CAqExB;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACpC,KAAK,EAAE,UAAU,GAChB,eAAe,GAAG,IAAI,CA2DxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/edge.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,6BAMxF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* React Error Boundary for the orchestrator panel.
|
|
4
|
+
*
|
|
5
|
+
* Catches render-time errors in the component tree and displays a
|
|
6
|
+
* static fallback so the rest of the TUI doesn't crash.
|
|
7
|
+
*/
|
|
8
|
+
import { Component, type ReactNode, type ErrorInfo } from "react";
|
|
9
|
+
interface ErrorBoundaryProps {
|
|
10
|
+
fallback: (error: Error) => ReactNode;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface ErrorBoundaryState {
|
|
14
|
+
error: Error | null;
|
|
15
|
+
}
|
|
16
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
17
|
+
state: ErrorBoundaryState;
|
|
18
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
19
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
20
|
+
render(): ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=error-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/error-boundary.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACzE,KAAK,EAAE,kBAAkB,CAAmB;IAErD,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIxD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAKtD,MAAM,IAAI,SAAS;CAM7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TerminalTheme } from "../runtime/theme.ts";
|
|
2
|
+
export interface GraphTheme {
|
|
3
|
+
background: string;
|
|
4
|
+
backgroundElement: string;
|
|
5
|
+
text: string;
|
|
6
|
+
textMuted: string;
|
|
7
|
+
textDim: string;
|
|
8
|
+
primary: string;
|
|
9
|
+
success: string;
|
|
10
|
+
error: string;
|
|
11
|
+
warning: string;
|
|
12
|
+
info: string;
|
|
13
|
+
border: string;
|
|
14
|
+
borderActive: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function deriveGraphTheme(t: TerminalTheme): GraphTheme;
|
|
17
|
+
//# sourceMappingURL=graph-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-theme.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/graph-theme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,UAAU,CAe7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/header.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AAetC,wBAAgB,MAAM,8BA0CrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared React hooks for OpenTUI components.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Return a ref whose `.current` always holds the latest value.
|
|
6
|
+
*
|
|
7
|
+
* Useful for reading state inside event callbacks (e.g. `useKeyboard`)
|
|
8
|
+
* that capture the initial closure and would otherwise go stale.
|
|
9
|
+
*
|
|
10
|
+
* This is safe because OpenTUI's React reconciler is synchronous —
|
|
11
|
+
* the ref is assigned during render, which is guaranteed to complete
|
|
12
|
+
* before any event handler fires.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useLatest<T>(value: T): React.RefObject<T>;
|
|
15
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAIzD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SessionData, SessionStatus } from "./orchestrator-panel-types.ts";
|
|
2
|
+
export declare const NODE_W = 36;
|
|
3
|
+
export declare const NODE_H = 4;
|
|
4
|
+
export declare const H_GAP = 6;
|
|
5
|
+
export declare const V_GAP = 3;
|
|
6
|
+
export declare const PAD = 3;
|
|
7
|
+
export interface LayoutNode {
|
|
8
|
+
name: string;
|
|
9
|
+
status: SessionStatus;
|
|
10
|
+
parents: string[];
|
|
11
|
+
error?: string;
|
|
12
|
+
startedAt: number | null;
|
|
13
|
+
endedAt: number | null;
|
|
14
|
+
children: LayoutNode[];
|
|
15
|
+
depth: number;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LayoutResult {
|
|
20
|
+
roots: LayoutNode[];
|
|
21
|
+
map: Record<string, LayoutNode>;
|
|
22
|
+
rowH: Record<number, number>;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function computeLayout(sessions: SessionData[]): LayoutResult;
|
|
27
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIhF,eAAO,MAAM,MAAM,KAAK,CAAC;AACzB,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,GAAG,IAAI,CAAC;AAIrB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAmED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,YAAY,CAyHnE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { type LayoutNode } from "./layout.ts";
|
|
4
|
+
export declare const NodeCard: React.MemoExoticComponent<({ node, focused, pulsePhase, displayH, }: {
|
|
5
|
+
node: LayoutNode;
|
|
6
|
+
focused: boolean;
|
|
7
|
+
pulsePhase: number;
|
|
8
|
+
displayH: number;
|
|
9
|
+
}) => React.ReactNode>;
|
|
10
|
+
//# sourceMappingURL=node-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-card.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/node-card.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,QAAQ,uEAKlB;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,qBAkDC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PanelStore } from "./orchestrator-panel-store.ts";
|
|
2
|
+
import type { GraphTheme } from "./graph-theme.ts";
|
|
3
|
+
export declare const StoreContext: import("react").Context<PanelStore | null>;
|
|
4
|
+
export declare const ThemeContext: import("react").Context<GraphTheme | null>;
|
|
5
|
+
export declare const TmuxSessionContext: import("react").Context<string>;
|
|
6
|
+
export declare function useStore(): PanelStore;
|
|
7
|
+
export declare function useGraphTheme(): GraphTheme;
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to the store and return its current version.
|
|
10
|
+
*
|
|
11
|
+
* Uses `useSyncExternalStore` so the subscription is active from the
|
|
12
|
+
* very first render — no `useEffect` timing gap that could cause a
|
|
13
|
+
* missed `addSession` update.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useStoreVersion(store: PanelStore): number;
|
|
16
|
+
//# sourceMappingURL=orchestrator-panel-contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-panel-contexts.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/orchestrator-panel-contexts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,eAAO,MAAM,YAAY,4CAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,4CAAyC,CAAC;AACnE,eAAO,MAAM,kBAAkB,iCAAoB,CAAC;AAEpD,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED,wBAAgB,aAAa,IAAI,UAAU,CAI1C;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKzD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SessionData, PanelSession, ViewMode } from "./orchestrator-panel-types.ts";
|
|
2
|
+
type Listener = () => void;
|
|
3
|
+
export declare class PanelStore {
|
|
4
|
+
version: number;
|
|
5
|
+
workflowName: string;
|
|
6
|
+
agent: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
sessions: SessionData[];
|
|
9
|
+
completionInfo: {
|
|
10
|
+
workflowName: string;
|
|
11
|
+
transcriptsPath: string;
|
|
12
|
+
} | null;
|
|
13
|
+
fatalError: string | null;
|
|
14
|
+
completionReached: boolean;
|
|
15
|
+
exitResolve: (() => void) | null;
|
|
16
|
+
abortResolve: (() => void) | null;
|
|
17
|
+
/** Number of background tasks/headless stages currently running. */
|
|
18
|
+
backgroundTaskCount: number;
|
|
19
|
+
/** Current view mode — graph overview or attached to a specific agent. */
|
|
20
|
+
viewMode: ViewMode;
|
|
21
|
+
/** ID of the agent currently attached to (only meaningful when viewMode === "attached"). */
|
|
22
|
+
activeAgentId: string;
|
|
23
|
+
private listeners;
|
|
24
|
+
subscribe: (fn: Listener) => (() => void);
|
|
25
|
+
private emit;
|
|
26
|
+
setWorkflowInfo(name: string, agent: string, sessions: PanelSession[], prompt: string): void;
|
|
27
|
+
startSession(name: string): void;
|
|
28
|
+
completeSession(name: string): void;
|
|
29
|
+
failSession(name: string, error: string): void;
|
|
30
|
+
addSession(session: SessionData): void;
|
|
31
|
+
setCompletion(workflowName: string, transcriptsPath: string): void;
|
|
32
|
+
setFatalError(message: string): void;
|
|
33
|
+
incrementBackgroundTasks(): void;
|
|
34
|
+
decrementBackgroundTasks(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Switch between graph and attached view modes.
|
|
37
|
+
* When switching to "attached", provide the agent ID to attach to.
|
|
38
|
+
* Switching to "graph" clears the active agent.
|
|
39
|
+
*/
|
|
40
|
+
setViewMode(mode: ViewMode, agentId?: string): void;
|
|
41
|
+
/** Safely invoke exitResolve at most once, guarding against rapid repeated calls. */
|
|
42
|
+
resolveExit(): void;
|
|
43
|
+
/** Safely invoke abortResolve at most once to signal mid-execution quit. */
|
|
44
|
+
resolveAbort(): void;
|
|
45
|
+
/** Quit the workflow — routes to the correct handler based on current phase. */
|
|
46
|
+
requestQuit(): void;
|
|
47
|
+
markCompletionReached(): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=orchestrator-panel-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-panel-store.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/orchestrator-panel-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAiB,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAExG,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,qBAAa,UAAU;IACrB,OAAO,SAAK;IACZ,YAAY,SAAM;IAClB,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,QAAQ,EAAE,WAAW,EAAE,CAAM;IAC7B,cAAc,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAQ;IAChF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjC,iBAAiB,UAAS;IAC1B,WAAW,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;IACxC,YAAY,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;IAEzC,oEAAoE;IACpE,mBAAmB,SAAK;IAExB,0EAA0E;IAC1E,QAAQ,EAAE,QAAQ,CAAW;IAC7B,4FAA4F;IAC5F,aAAa,SAAM;IAEnB,OAAO,CAAC,SAAS,CAAuB;IAExC,SAAS,GAAI,IAAI,QAAQ,KAAG,CAAC,MAAM,IAAI,CAAC,CAGtC;IAEF,OAAO,CAAC,IAAI;IAKZ,eAAe,CACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EAAE,EACxB,MAAM,EAAE,MAAM,GACb,IAAI;IAuBP,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQhC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAS9C,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAKtC,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAUlE,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWpC,wBAAwB,IAAI,IAAI;IAKhC,wBAAwB,IAAI,IAAI;IAKhC;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAMnD,qFAAqF;IACrF,WAAW,IAAI,IAAI;IAQnB,4EAA4E;IAC5E,YAAY,IAAI,IAAI;IAQpB,gFAAgF;IAChF,WAAW,IAAI,IAAI;IAQnB,qBAAqB,IAAI,IAAI;CAI9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SessionStatus = "pending" | "running" | "complete" | "error";
|
|
2
|
+
export type ViewMode = "graph" | "attached";
|
|
3
|
+
export interface PanelSession {
|
|
4
|
+
name: string;
|
|
5
|
+
parents: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface PanelOptions {
|
|
8
|
+
tmuxSession: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SessionData {
|
|
11
|
+
name: string;
|
|
12
|
+
status: SessionStatus;
|
|
13
|
+
parents: string[];
|
|
14
|
+
error?: string;
|
|
15
|
+
startedAt: number | null;
|
|
16
|
+
endedAt: number | null;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=orchestrator-panel-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-panel-types.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/orchestrator-panel-types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAEzE,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* OrchestratorPanel — public API class that bridges the imperative
|
|
4
|
+
* executor interface with the React-based session graph TUI.
|
|
5
|
+
*/
|
|
6
|
+
import { type CliRenderer } from "@opentui/core";
|
|
7
|
+
import type { PanelSession, PanelOptions } from "./orchestrator-panel-types.ts";
|
|
8
|
+
export declare class OrchestratorPanel {
|
|
9
|
+
private store;
|
|
10
|
+
private renderer;
|
|
11
|
+
private destroyed;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Create a new OrchestratorPanel with the default CLI renderer.
|
|
15
|
+
*
|
|
16
|
+
* This is the primary entry point — it initialises the terminal renderer
|
|
17
|
+
* and mounts the React-based session graph TUI.
|
|
18
|
+
*/
|
|
19
|
+
static create(options: PanelOptions): Promise<OrchestratorPanel>;
|
|
20
|
+
/** Create with an externally-provided renderer (e.g. a test renderer). */
|
|
21
|
+
static createWithRenderer(renderer: CliRenderer, options: PanelOptions): OrchestratorPanel;
|
|
22
|
+
/**
|
|
23
|
+
* Display the workflow overview in the TUI — name, agent, session graph,
|
|
24
|
+
* and the user prompt. Call once after construction before sessions start.
|
|
25
|
+
*/
|
|
26
|
+
showWorkflowInfo(name: string, agent: string, sessions: PanelSession[], prompt: string): void;
|
|
27
|
+
/** Mark a session as running in the graph UI. */
|
|
28
|
+
sessionStart(name: string): void;
|
|
29
|
+
/** Mark a session as successfully completed in the graph UI. */
|
|
30
|
+
sessionSuccess(name: string): void;
|
|
31
|
+
/** Mark a session as failed in the graph UI and display the error message. */
|
|
32
|
+
sessionError(name: string, message: string): void;
|
|
33
|
+
/** Dynamically add a new session node to the graph UI. */
|
|
34
|
+
addSession(name: string, parents: string[]): void;
|
|
35
|
+
/** Increment the background task counter (shown in the statusline footer). */
|
|
36
|
+
backgroundTaskStarted(): void;
|
|
37
|
+
/** Decrement the background task counter (shown in the statusline footer). */
|
|
38
|
+
backgroundTaskFinished(): void;
|
|
39
|
+
/** Show the workflow-complete banner with a link to saved transcripts. */
|
|
40
|
+
showCompletion(workflowName: string, transcriptsPath: string): void;
|
|
41
|
+
/** Display a fatal error banner in the TUI. */
|
|
42
|
+
showFatalError(message: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Block until the user presses `q` or `Ctrl+C` in the TUI.
|
|
45
|
+
* Call after {@link showCompletion} or {@link showFatalError}.
|
|
46
|
+
*/
|
|
47
|
+
waitForExit(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a promise that resolves when the user requests a mid-execution quit
|
|
50
|
+
* (via `q` or `Ctrl+C`). Race this against the workflow run.
|
|
51
|
+
*/
|
|
52
|
+
waitForAbort(): Promise<void>;
|
|
53
|
+
/** Tear down the terminal renderer and release resources. Idempotent. */
|
|
54
|
+
destroy(): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=orchestrator-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/orchestrator-panel.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;GAGG;AAEH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAOpE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIhF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO;IAsCP;;;;;OAKG;WACU,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQtE,0EAA0E;IAC1E,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,YAAY,GACpB,iBAAiB;IAOpB;;;OAGG;IACH,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EAAE,EACxB,MAAM,EAAE,MAAM,GACb,IAAI;IAIP,iDAAiD;IACjD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhC,gEAAgE;IAChE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIlC,8EAA8E;IAC9E,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjD,0DAA0D;IAC1D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAUjD,8EAA8E;IAC9E,qBAAqB,IAAI,IAAI;IAI7B,8EAA8E;IAC9E,sBAAsB,IAAI,IAAI;IAI9B,0EAA0E;IAC1E,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAInE,+CAA+C;IAC/C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIrC;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAM7B,yEAAyE;IACzE,OAAO,IAAI,IAAI;CAOhB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Main graph component — renders the navigable session tree with
|
|
4
|
+
* keyboard navigation, scroll management, and live animations.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SessionGraphPanel(): import("react").ReactNode;
|
|
7
|
+
//# sourceMappingURL=session-graph-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-graph-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/session-graph-panel.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;GAGG;AAoDH,wBAAgB,iBAAiB,8BAgchC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GraphTheme } from "./graph-theme.ts";
|
|
2
|
+
export declare function statusColor(status: string, theme: GraphTheme): string;
|
|
3
|
+
export declare function statusLabel(status: string): string;
|
|
4
|
+
export declare function statusIcon(status: string): string;
|
|
5
|
+
export declare function fmtDuration(ms: number): string;
|
|
6
|
+
//# sourceMappingURL=status-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-helpers.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/status-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CASrE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjD;AAID,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG9C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
import type { LayoutNode } from "./layout.ts";
|
|
3
|
+
export declare function Statusline({ focusedNode, attachMsg, }: {
|
|
4
|
+
focusedNode: LayoutNode | undefined;
|
|
5
|
+
attachMsg: string;
|
|
6
|
+
}): import("react").ReactNode;
|
|
7
|
+
//# sourceMappingURL=statusline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusline.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/statusline.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AAItC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB,6BAiEA"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* WorkflowPickerPanel — interactive TUI for `atomic workflow -a <agent>`.
|
|
4
|
+
*
|
|
5
|
+
* Telescope-style fuzzy picker with a two-phase flow:
|
|
6
|
+
*
|
|
7
|
+
* 1. PICK — filter workflows scoped to the current agent, navigate with
|
|
8
|
+
* ↑/↓ or ⌃j/⌃k, press ↵ to lock in a selection.
|
|
9
|
+
* 2. PROMPT — fill the workflow's declared input schema (one field per
|
|
10
|
+
* declared `WorkflowInput`). Free-form workflows fall back to
|
|
11
|
+
* a single `prompt` text field.
|
|
12
|
+
*
|
|
13
|
+
* Pressing ⌃d in the prompt phase validates required fields and opens a
|
|
14
|
+
* CONFIRM modal that shows the fully-composed shell command before
|
|
15
|
+
* submission. y/↵ confirms, n/esc cancels back to the form.
|
|
16
|
+
*
|
|
17
|
+
* Lifecycle:
|
|
18
|
+
*
|
|
19
|
+
* const panel = await WorkflowPickerPanel.create({ agent, workflows });
|
|
20
|
+
* const result = await panel.waitForSelection();
|
|
21
|
+
* panel.destroy();
|
|
22
|
+
* if (result) await executeWorkflow({ ... });
|
|
23
|
+
*
|
|
24
|
+
* `waitForSelection()` resolves with `null` if the user exits without
|
|
25
|
+
* committing (esc in PICK phase, or ⌃c anywhere) and with a
|
|
26
|
+
* `{ workflow, inputs }` record if they confirm the run.
|
|
27
|
+
*/
|
|
28
|
+
import { type CliRenderer } from "@opentui/core";
|
|
29
|
+
import { type TerminalTheme } from "../runtime/theme.ts";
|
|
30
|
+
import type { AgentType, WorkflowInput } from "../types.ts";
|
|
31
|
+
import type { WorkflowWithMetadata } from "../runtime/discovery.ts";
|
|
32
|
+
export interface PickerTheme {
|
|
33
|
+
background: string;
|
|
34
|
+
backgroundPanel: string;
|
|
35
|
+
backgroundElement: string;
|
|
36
|
+
surface: string;
|
|
37
|
+
text: string;
|
|
38
|
+
textMuted: string;
|
|
39
|
+
textDim: string;
|
|
40
|
+
primary: string;
|
|
41
|
+
success: string;
|
|
42
|
+
error: string;
|
|
43
|
+
warning: string;
|
|
44
|
+
info: string;
|
|
45
|
+
mauve: string;
|
|
46
|
+
border: string;
|
|
47
|
+
borderActive: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function buildPickerTheme(base: TerminalTheme, isDark: boolean): PickerTheme;
|
|
50
|
+
type Source = "local" | "global" | "builtin";
|
|
51
|
+
/** The payload the picker resolves with on successful submission. */
|
|
52
|
+
export interface WorkflowPickerResult {
|
|
53
|
+
/** The workflow the user committed to running. */
|
|
54
|
+
workflow: WorkflowWithMetadata;
|
|
55
|
+
/** Populated form values, one per declared input (or { prompt } for free-form). */
|
|
56
|
+
inputs: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Subsequence fuzzy match — Telescope-style. Returns a score (lower =
|
|
60
|
+
* better) or null for no match. Adjacent matches are rewarded; jumps over
|
|
61
|
+
* non-matching characters are penalized proportionally to the gap.
|
|
62
|
+
*/
|
|
63
|
+
export declare function fuzzyMatch(query: string, target: string): number | null;
|
|
64
|
+
interface ListEntry {
|
|
65
|
+
workflow: WorkflowWithMetadata;
|
|
66
|
+
section: Source;
|
|
67
|
+
}
|
|
68
|
+
type ListRow = {
|
|
69
|
+
kind: "section";
|
|
70
|
+
source: Source;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "entry";
|
|
73
|
+
entry: ListEntry;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Deduplicate workflows by name using builtin > local > global precedence.
|
|
77
|
+
* When two workflows share a name, only the higher-precedence entry is kept.
|
|
78
|
+
*/
|
|
79
|
+
export declare function deduplicateByName(workflows: WorkflowWithMetadata[]): WorkflowWithMetadata[];
|
|
80
|
+
export declare function buildEntries(query: string, workflows: WorkflowWithMetadata[]): ListEntry[];
|
|
81
|
+
export declare function buildRows(entries: ListEntry[], query: string): ListRow[];
|
|
82
|
+
export declare function isFieldValid(field: WorkflowInput, value: string): boolean;
|
|
83
|
+
interface PickerAppProps {
|
|
84
|
+
theme: PickerTheme;
|
|
85
|
+
agent: AgentType;
|
|
86
|
+
workflows: WorkflowWithMetadata[];
|
|
87
|
+
onSubmit: (result: WorkflowPickerResult) => void;
|
|
88
|
+
onCancel: () => void;
|
|
89
|
+
}
|
|
90
|
+
export declare function WorkflowPicker({ theme, agent, workflows, onSubmit, onCancel, }: PickerAppProps): import("react").ReactNode;
|
|
91
|
+
export interface WorkflowPickerPanelOptions {
|
|
92
|
+
agent: AgentType;
|
|
93
|
+
/** Pre-loaded workflows to show. Must already be filtered to `agent`. */
|
|
94
|
+
workflows: WorkflowWithMetadata[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Imperative shell around the React picker tree — mirrors the
|
|
98
|
+
* {@link OrchestratorPanel} lifecycle so both panels can be used
|
|
99
|
+
* interchangeably by the CLI command layer.
|
|
100
|
+
*/
|
|
101
|
+
export declare class WorkflowPickerPanel {
|
|
102
|
+
private renderer;
|
|
103
|
+
private root;
|
|
104
|
+
private destroyed;
|
|
105
|
+
private resolveSelection;
|
|
106
|
+
private selectionPromise;
|
|
107
|
+
private constructor();
|
|
108
|
+
/**
|
|
109
|
+
* Create a new WorkflowPickerPanel. Initialises a CLI renderer and
|
|
110
|
+
* mounts the interactive tree. The caller should `await
|
|
111
|
+
* waitForSelection()` and then call `destroy()` regardless of outcome.
|
|
112
|
+
*/
|
|
113
|
+
static create(options: WorkflowPickerPanelOptions): Promise<WorkflowPickerPanel>;
|
|
114
|
+
/** Create with an externally-provided renderer (e.g. a test renderer). */
|
|
115
|
+
static createWithRenderer(renderer: CliRenderer, options: WorkflowPickerPanelOptions): WorkflowPickerPanel;
|
|
116
|
+
/**
|
|
117
|
+
* Resolve with the user's selection once they confirm, or `null` if
|
|
118
|
+
* they exit the picker without committing. Idempotent — subsequent
|
|
119
|
+
* calls return the same promise.
|
|
120
|
+
*/
|
|
121
|
+
waitForSelection(): Promise<WorkflowPickerResult | null>;
|
|
122
|
+
/** Tear down the CLI renderer. Idempotent. */
|
|
123
|
+
destroy(): void;
|
|
124
|
+
private handleSubmit;
|
|
125
|
+
private handleCancel;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=workflow-picker-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-picker-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/workflow-picker-panel.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Builder — defines a workflow with a single `.run()` entry point.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* defineWorkflow({ name: "my-workflow", inputs: [...] })
|
|
6
|
+
* .for<"copilot">()
|
|
7
|
+
* .run(async (ctx) => {
|
|
8
|
+
* await ctx.stage({ name: "research" }, {}, {}, async (s) => { ... });
|
|
9
|
+
* await ctx.stage({ name: "plan" }, {}, {}, async (s) => { ... });
|
|
10
|
+
* })
|
|
11
|
+
* .compile()
|
|
12
|
+
*/
|
|
13
|
+
import type { AgentType, WorkflowOptions, WorkflowContext, WorkflowDefinition, WorkflowInput } from "./types.ts";
|
|
14
|
+
/**
|
|
15
|
+
* Chainable workflow builder. Records the run callback,
|
|
16
|
+
* then .compile() seals it into a WorkflowDefinition.
|
|
17
|
+
*/
|
|
18
|
+
export declare class WorkflowBuilder<A extends AgentType = AgentType, N extends string = string> {
|
|
19
|
+
/** @internal Brand for detection across package boundaries */
|
|
20
|
+
readonly __brand: "WorkflowBuilder";
|
|
21
|
+
private readonly options;
|
|
22
|
+
private runFn;
|
|
23
|
+
constructor(options: WorkflowOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Narrow the agent type for this workflow while preserving typed inputs.
|
|
26
|
+
*
|
|
27
|
+
* Use `.for<"copilot">()` **before** `.run()` instead of passing the
|
|
28
|
+
* agent as a type parameter to `defineWorkflow`. This allows TypeScript
|
|
29
|
+
* to infer input names from the `inputs` array AND narrow the agent
|
|
30
|
+
* type for `stage()` callbacks.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* defineWorkflow({
|
|
35
|
+
* name: "my-workflow",
|
|
36
|
+
* inputs: [{ name: "greeting", type: "string" }],
|
|
37
|
+
* })
|
|
38
|
+
* .for<"copilot">()
|
|
39
|
+
* .run(async (ctx) => {
|
|
40
|
+
* ctx.inputs.greeting; // ✓ typed
|
|
41
|
+
* ctx.inputs.prompt; // ✗ compile error
|
|
42
|
+
* })
|
|
43
|
+
* .compile();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
for<B extends AgentType>(): WorkflowBuilder<B, N>;
|
|
47
|
+
/**
|
|
48
|
+
* Set the workflow's entry point.
|
|
49
|
+
*
|
|
50
|
+
* The callback receives a {@link WorkflowContext} with `stage()` for
|
|
51
|
+
* spawning agent sessions, and `transcript()` / `getMessages()` for
|
|
52
|
+
* reading completed session outputs. Use native TypeScript control flow
|
|
53
|
+
* (loops, conditionals, `Promise.all()`) for orchestration.
|
|
54
|
+
*/
|
|
55
|
+
run(fn: (ctx: WorkflowContext<A, N>) => Promise<void>): this;
|
|
56
|
+
/**
|
|
57
|
+
* Compile the workflow into a sealed WorkflowDefinition.
|
|
58
|
+
*
|
|
59
|
+
* After calling compile(), the returned object is consumed by the
|
|
60
|
+
* Atomic CLI runtime.
|
|
61
|
+
*/
|
|
62
|
+
compile(): WorkflowDefinition<A, N>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Entry point for defining a workflow.
|
|
66
|
+
*
|
|
67
|
+
* Write the `inputs` array inline so TypeScript infers literal field
|
|
68
|
+
* names and enforces them on `ctx.inputs`. Use `.for<Agent>()` to
|
|
69
|
+
* narrow the agent type while keeping typed inputs:
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* import { defineWorkflow } from "@bastani/atomic/workflows";
|
|
74
|
+
*
|
|
75
|
+
* export default defineWorkflow({
|
|
76
|
+
* name: "hello",
|
|
77
|
+
* description: "Two-session demo",
|
|
78
|
+
* inputs: [
|
|
79
|
+
* { name: "greeting", type: "string", required: true },
|
|
80
|
+
* ],
|
|
81
|
+
* })
|
|
82
|
+
* .for<"copilot">()
|
|
83
|
+
* .run(async (ctx) => {
|
|
84
|
+
* ctx.inputs.greeting; // ✓ string | undefined
|
|
85
|
+
* ctx.inputs.prompt; // ✗ compile error — not declared
|
|
86
|
+
* })
|
|
87
|
+
* .compile();
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function defineWorkflow<const I extends readonly WorkflowInput[] = readonly WorkflowInput[]>(options: WorkflowOptions<I>): WorkflowBuilder<AgentType, I[number]["name"]>;
|
|
91
|
+
//# sourceMappingURL=define-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-workflow.d.ts","sourceRoot":"","sources":["../../src/sdk/define-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACd,MAAM,YAAY,CAAC;AAsCpB;;;GAGG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACrF,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAG,iBAAiB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,KAAK,CAAgE;gBAEjE,OAAO,EAAE,eAAe;IAIpC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CAAC,CAAC,SAAS,SAAS,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;IAIjD;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAW5D;;;;;OAKG;IACH,OAAO,IAAI,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC;CAmCpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,aAAa,EAAE,EAEnE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAK/C"}
|