@smithers-orchestrator/cli 0.16.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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +55 -0
  3. package/src/AgentAvailability.ts +13 -0
  4. package/src/AgentAvailabilityStatus.ts +5 -0
  5. package/src/AggregateNodeDetailParams.ts +5 -0
  6. package/src/AskOptions.ts +12 -0
  7. package/src/ChatAttemptMeta.ts +7 -0
  8. package/src/ChatAttemptRow.ts +12 -0
  9. package/src/ChatOutputEvent.ts +6 -0
  10. package/src/DiffBundleLike.ts +6 -0
  11. package/src/DiscoveredWorkflow.ts +9 -0
  12. package/src/EnrichedNodeDetail.ts +60 -0
  13. package/src/EventCategory.ts +18 -0
  14. package/src/FindDbWaitOptions.ts +4 -0
  15. package/src/FormatEventLineOptions.ts +4 -0
  16. package/src/HijackCandidate.ts +11 -0
  17. package/src/HijackLaunchSpec.ts +6 -0
  18. package/src/InitWorkflowPackOptions.ts +4 -0
  19. package/src/InitWorkflowPackResult.ts +6 -0
  20. package/src/NativeHijackEngine.ts +8 -0
  21. package/src/NodeDetailAttempt.ts +22 -0
  22. package/src/NodeDetailTokenUsage.ts +11 -0
  23. package/src/NodeDetailToolCall.ts +12 -0
  24. package/src/ParsedNodeOutputEvent.ts +9 -0
  25. package/src/RenderNodeDetailOptions.ts +4 -0
  26. package/src/RunAutoResumeSkipReason.ts +4 -0
  27. package/src/RunDiffCommandInput.ts +13 -0
  28. package/src/RunDiffCommandResult.ts +3 -0
  29. package/src/RunOutputCommandInput.ts +12 -0
  30. package/src/RunOutputCommandResult.ts +3 -0
  31. package/src/RunRewindCommandInput.ts +14 -0
  32. package/src/RunRewindCommandResult.ts +3 -0
  33. package/src/RunTreeCommandInput.ts +14 -0
  34. package/src/RunTreeCommandResult.ts +3 -0
  35. package/src/SmithersEventType.ts +3 -0
  36. package/src/SupervisorOptions.ts +33 -0
  37. package/src/SupervisorPollSummary.ts +6 -0
  38. package/src/TreeRenderOptions.ts +5 -0
  39. package/src/WatchLoopOptions.ts +9 -0
  40. package/src/WatchLoopResult.ts +8 -0
  41. package/src/WatchRenderContext.ts +4 -0
  42. package/src/WhyBlocker.ts +17 -0
  43. package/src/WhyBlockerKind.ts +9 -0
  44. package/src/WhyDiagnosis.ts +10 -0
  45. package/src/WorkflowCta.ts +4 -0
  46. package/src/WorkflowSourceType.ts +1 -0
  47. package/src/agent-detection.js +257 -0
  48. package/src/ask.js +491 -0
  49. package/src/chat.js +226 -0
  50. package/src/diff.js +221 -0
  51. package/src/event-categories.js +141 -0
  52. package/src/find-db.js +93 -0
  53. package/src/format.js +272 -0
  54. package/src/hijack-session.js +207 -0
  55. package/src/hijack.js +226 -0
  56. package/src/index.d.ts +1 -0
  57. package/src/index.js +4868 -0
  58. package/src/mcp/SemanticMcpServerOptions.ts +4 -0
  59. package/src/mcp/SemanticToolCallResult.ts +14 -0
  60. package/src/mcp/SemanticToolContext.ts +6 -0
  61. package/src/mcp/SemanticToolDefinition.ts +13 -0
  62. package/src/mcp/SemanticToolError.ts +6 -0
  63. package/src/mcp/semantic-server.js +41 -0
  64. package/src/mcp/semantic-tools.js +1242 -0
  65. package/src/node-detail.js +682 -0
  66. package/src/output.js +111 -0
  67. package/src/resume-detached.js +37 -0
  68. package/src/rewind.js +88 -0
  69. package/src/scheduler.js +112 -0
  70. package/src/smithersRuntime.js +63 -0
  71. package/src/supervisor.js +418 -0
  72. package/src/tree.js +307 -0
  73. package/src/tui/app.jsx +139 -0
  74. package/src/tui/app.tsx +5 -0
  75. package/src/tui/components/AskModal.jsx +109 -0
  76. package/src/tui/components/AskModal.tsx +3 -0
  77. package/src/tui/components/AttentionPane.jsx +112 -0
  78. package/src/tui/components/AttentionPane.tsx +6 -0
  79. package/src/tui/components/ChatPane.jsx +57 -0
  80. package/src/tui/components/ChatPane.tsx +7 -0
  81. package/src/tui/components/CronList.jsx +87 -0
  82. package/src/tui/components/CronList.tsx +5 -0
  83. package/src/tui/components/DetailsPane.jsx +96 -0
  84. package/src/tui/components/DetailsPane.tsx +7 -0
  85. package/src/tui/components/FramesPane.jsx +147 -0
  86. package/src/tui/components/FramesPane.tsx +8 -0
  87. package/src/tui/components/LogsPane.jsx +46 -0
  88. package/src/tui/components/LogsPane.tsx +6 -0
  89. package/src/tui/components/MetricsPane.jsx +108 -0
  90. package/src/tui/components/MetricsPane.tsx +5 -0
  91. package/src/tui/components/NodeDetailView.jsx +284 -0
  92. package/src/tui/components/NodeDetailView.tsx +7 -0
  93. package/src/tui/components/NodeInspector.jsx +51 -0
  94. package/src/tui/components/NodeInspector.tsx +7 -0
  95. package/src/tui/components/RunDetailView.jsx +190 -0
  96. package/src/tui/components/RunDetailView.tsx +7 -0
  97. package/src/tui/components/RunsList.jsx +184 -0
  98. package/src/tui/components/RunsList.tsx +7 -0
  99. package/src/tui/components/SqliteBrowser.jsx +131 -0
  100. package/src/tui/components/SqliteBrowser.tsx +5 -0
  101. package/src/tui/components/WorkflowLauncher.jsx +63 -0
  102. package/src/tui/components/WorkflowLauncher.tsx +3 -0
  103. package/src/util/CliErrorMapping.ts +7 -0
  104. package/src/util/CliExitCode.ts +10 -0
  105. package/src/util/errorMessage.js +212 -0
  106. package/src/util/exitCodes.js +18 -0
  107. package/src/watch.js +128 -0
  108. package/src/why-diagnosis.js +1000 -0
  109. package/src/workflow-pack.js +2151 -0
  110. package/src/workflows.js +122 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 William Cory
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@smithers-orchestrator/cli",
3
+ "version": "0.16.0",
4
+ "description": "Smithers command-line interface, TUI, MCP server, and local workflow tools",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "exports": {
8
+ ".": {
9
+ "types": "./src/index.d.ts",
10
+ "import": "./src/index.js",
11
+ "default": "./src/index.js"
12
+ },
13
+ "./*": {
14
+ "types": "./src/index.d.ts",
15
+ "import": "./src/*.js",
16
+ "default": "./src/*.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "src/"
21
+ ],
22
+ "bin": {
23
+ "smithers": "./src/index.js"
24
+ },
25
+ "dependencies": {
26
+ "@effect/workflow": "^0.18.0",
27
+ "@modelcontextprotocol/sdk": "^1.27.0",
28
+ "@opentui/core": "^0.1.92",
29
+ "@opentui/react": "^0.1.92",
30
+ "effect": "^3.21.0",
31
+ "incur": "^0.3.3",
32
+ "picocolors": "^1.1.1",
33
+ "react": "^18.3.0 || ^19.0.0",
34
+ "zod": "^4.3.6",
35
+ "@smithers-orchestrator/agents": "0.16.0",
36
+ "@smithers-orchestrator/components": "0.16.0",
37
+ "@smithers-orchestrator/db": "0.16.0",
38
+ "@smithers-orchestrator/driver": "0.16.0",
39
+ "@smithers-orchestrator/errors": "0.16.0",
40
+ "@smithers-orchestrator/observability": "0.16.0",
41
+ "@smithers-orchestrator/scheduler": "0.16.0",
42
+ "@smithers-orchestrator/time-travel": "0.16.0",
43
+ "@smithers-orchestrator/server": "0.16.0",
44
+ "smithers-orchestrator": "0.16.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/bun": "latest",
48
+ "typescript": "~5.9.3"
49
+ },
50
+ "scripts": {
51
+ "test": "bun test tests",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit",
53
+ "build": "tsup --dts-only"
54
+ }
55
+ }
@@ -0,0 +1,13 @@
1
+ import type { AgentAvailabilityStatus } from "./AgentAvailabilityStatus.ts";
2
+
3
+ export type AgentAvailability = {
4
+ id: "claude" | "codex" | "gemini" | "pi" | "kimi" | "amp";
5
+ binary: string;
6
+ hasBinary: boolean;
7
+ hasAuthSignal: boolean;
8
+ hasApiKeySignal: boolean;
9
+ status: AgentAvailabilityStatus;
10
+ score: number;
11
+ usable: boolean;
12
+ checks: string[];
13
+ };
@@ -0,0 +1,5 @@
1
+ export type AgentAvailabilityStatus =
2
+ | "likely-subscription"
3
+ | "api-key"
4
+ | "binary-only"
5
+ | "unavailable";
@@ -0,0 +1,5 @@
1
+ export type AggregateNodeDetailParams = {
2
+ runId: string;
3
+ nodeId: string;
4
+ iteration?: number;
5
+ };
@@ -0,0 +1,12 @@
1
+ import type { SmithersToolSurface } from "@smithers-orchestrator/agents/agent-contract";
2
+
3
+ export type AskAgentId = "claude" | "codex" | "kimi" | "gemini" | "pi";
4
+
5
+ export type AskOptions = {
6
+ agent?: AskAgentId;
7
+ listAgents?: boolean;
8
+ dumpPrompt?: boolean;
9
+ toolSurface?: SmithersToolSurface;
10
+ noMcp?: boolean;
11
+ printBootstrap?: boolean;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ChatAttemptMeta = {
2
+ kind?: string | null;
3
+ prompt?: string | null;
4
+ label?: string | null;
5
+ agentId?: string | null;
6
+ agentModel?: string | null;
7
+ };
@@ -0,0 +1,12 @@
1
+ export type ChatAttemptRow = {
2
+ runId: string;
3
+ nodeId: string;
4
+ iteration: number;
5
+ attempt: number;
6
+ state: string;
7
+ startedAtMs: number;
8
+ finishedAtMs?: number | null;
9
+ cached?: boolean | null;
10
+ metaJson?: string | null;
11
+ responseText?: string | null;
12
+ };
@@ -0,0 +1,6 @@
1
+ export type ChatOutputEvent = {
2
+ seq: number;
3
+ timestampMs: number;
4
+ type: string;
5
+ payloadJson: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ export type DiffBundleLike = {
2
+ patches: Array<{
3
+ path?: string;
4
+ diff?: string;
5
+ }>;
6
+ };
@@ -0,0 +1,9 @@
1
+ import type { WorkflowSourceType } from "./WorkflowSourceType.ts";
2
+
3
+ export type DiscoveredWorkflow = {
4
+ id: string;
5
+ displayName: string;
6
+ sourceType: WorkflowSourceType;
7
+ entryFile: string;
8
+ path: string;
9
+ };
@@ -0,0 +1,60 @@
1
+ import type { NodeDetailAttempt } from "./NodeDetailAttempt.ts";
2
+ import type { NodeDetailToolCall } from "./NodeDetailToolCall.ts";
3
+ import type { NodeDetailTokenUsage } from "./NodeDetailTokenUsage.ts";
4
+
5
+ type AttemptSummary = {
6
+ total: number;
7
+ failed: number;
8
+ cancelled: number;
9
+ succeeded: number;
10
+ waiting: number;
11
+ };
12
+
13
+ export type EnrichedNodeDetail = {
14
+ node: {
15
+ runId: string;
16
+ nodeId: string;
17
+ iteration: number;
18
+ state: string;
19
+ lastAttempt: number | null;
20
+ updatedAtMs: number | null;
21
+ outputTable: string | null;
22
+ label: string | null;
23
+ };
24
+ status: string;
25
+ durationMs: number | null;
26
+ attemptsSummary: AttemptSummary;
27
+ attempts: NodeDetailAttempt[];
28
+ toolCalls: NodeDetailToolCall[];
29
+ tokenUsage: NodeDetailTokenUsage & {
30
+ byAttempt: Array<{
31
+ attempt: number;
32
+ usage: NodeDetailTokenUsage;
33
+ }>;
34
+ };
35
+ scorers: Array<{
36
+ id: string;
37
+ attempt: number;
38
+ scorerId: string;
39
+ scorerName: string;
40
+ source: string;
41
+ score: number;
42
+ reason: string | null;
43
+ latencyMs: number | null;
44
+ durationMs: number | null;
45
+ scoredAtMs: number;
46
+ meta: unknown | null;
47
+ input: unknown | null;
48
+ output: unknown | null;
49
+ }>;
50
+ output: {
51
+ validated: unknown | null;
52
+ raw: unknown | null;
53
+ source: "cache" | "output-table" | "none";
54
+ cacheKey: string | null;
55
+ };
56
+ limits: {
57
+ toolPayloadBytesHuman: number;
58
+ validatedOutputBytesHuman: number;
59
+ };
60
+ };
@@ -0,0 +1,18 @@
1
+ export type EventCategory =
2
+ | "agent"
3
+ | "approval"
4
+ | "frame"
5
+ | "memory"
6
+ | "node"
7
+ | "openapi"
8
+ | "output"
9
+ | "revert"
10
+ | "run"
11
+ | "sandbox"
12
+ | "scorer"
13
+ | "snapshot"
14
+ | "supervisor"
15
+ | "timer"
16
+ | "token"
17
+ | "tool-call"
18
+ | "workflow";
@@ -0,0 +1,4 @@
1
+ export type FindDbWaitOptions = {
2
+ timeoutMs?: number;
3
+ intervalMs?: number;
4
+ };
@@ -0,0 +1,4 @@
1
+ export type FormatEventLineOptions = {
2
+ includeTimestamp?: boolean;
3
+ truncatePayloadAt?: number;
4
+ };
@@ -0,0 +1,11 @@
1
+ export type HijackCandidate = {
2
+ runId: string;
3
+ nodeId: string;
4
+ iteration: number;
5
+ attempt: number;
6
+ engine: string;
7
+ mode: "native-cli" | "conversation";
8
+ resume?: string;
9
+ messages?: unknown[];
10
+ cwd: string;
11
+ };
@@ -0,0 +1,6 @@
1
+ export type HijackLaunchSpec = {
2
+ command: string;
3
+ args: string[];
4
+ cwd: string;
5
+ env: Record<string, string>;
6
+ };
@@ -0,0 +1,4 @@
1
+ export type InitWorkflowPackOptions = {
2
+ force?: boolean;
3
+ rootDir?: string;
4
+ };
@@ -0,0 +1,6 @@
1
+ export type InitWorkflowPackResult = {
2
+ rootDir: string;
3
+ writtenFiles: string[];
4
+ skippedFiles: string[];
5
+ preservedPaths: string[];
6
+ };
@@ -0,0 +1,8 @@
1
+ export type NativeHijackEngine =
2
+ | "claude-code"
3
+ | "codex"
4
+ | "gemini"
5
+ | "pi"
6
+ | "kimi"
7
+ | "forge"
8
+ | "amp";
@@ -0,0 +1,22 @@
1
+ import type { NodeDetailToolCall } from "./NodeDetailToolCall.ts";
2
+ import type { NodeDetailTokenUsage } from "./NodeDetailTokenUsage.ts";
3
+
4
+ export type NodeDetailAttempt = {
5
+ runId: string;
6
+ nodeId: string;
7
+ iteration: number;
8
+ attempt: number;
9
+ state: string;
10
+ startedAtMs: number;
11
+ finishedAtMs: number | null;
12
+ durationMs: number | null;
13
+ error: string | null;
14
+ errorDetail: unknown | null;
15
+ tokenUsage: NodeDetailTokenUsage;
16
+ toolCalls: NodeDetailToolCall[];
17
+ meta: unknown | null;
18
+ responseText: string | null;
19
+ cached: boolean;
20
+ jjPointer: string | null;
21
+ jjCwd: string | null;
22
+ };
@@ -0,0 +1,11 @@
1
+ export type NodeDetailTokenUsage = {
2
+ inputTokens: number;
3
+ outputTokens: number;
4
+ cacheReadTokens: number;
5
+ cacheWriteTokens: number;
6
+ reasoningTokens: number;
7
+ costUsd: number | null;
8
+ eventCount: number;
9
+ models: string[];
10
+ agents: string[];
11
+ };
@@ -0,0 +1,12 @@
1
+ export type NodeDetailToolCall = {
2
+ attempt: number;
3
+ seq: number;
4
+ name: string;
5
+ status: string;
6
+ startedAtMs: number;
7
+ finishedAtMs: number | null;
8
+ durationMs: number | null;
9
+ input: unknown | null;
10
+ output: unknown | null;
11
+ error: string | null;
12
+ };
@@ -0,0 +1,9 @@
1
+ export type ParsedNodeOutputEvent = {
2
+ seq: number;
3
+ timestampMs: number;
4
+ nodeId: string;
5
+ iteration: number;
6
+ attempt: number;
7
+ stream: "stdout" | "stderr";
8
+ text: string;
9
+ };
@@ -0,0 +1,4 @@
1
+ export type RenderNodeDetailOptions = {
2
+ expandAttempts: boolean;
3
+ expandTools: boolean;
4
+ };
@@ -0,0 +1,4 @@
1
+ export type RunAutoResumeSkipReason =
2
+ | "pid-alive"
3
+ | "missing-workflow"
4
+ | "rate-limited";
@@ -0,0 +1,13 @@
1
+ import type { SmithersDb } from "@smithers-orchestrator/db/adapter";
2
+
3
+ export type RunDiffCommandInput = {
4
+ adapter: SmithersDb;
5
+ runId: string;
6
+ nodeId: string;
7
+ iteration?: number;
8
+ stat?: boolean;
9
+ json?: boolean;
10
+ color?: boolean;
11
+ stdout: NodeJS.WritableStream;
12
+ stderr: NodeJS.WritableStream;
13
+ };
@@ -0,0 +1,3 @@
1
+ export type RunDiffCommandResult = {
2
+ exitCode: number;
3
+ };
@@ -0,0 +1,12 @@
1
+ import type { SmithersDb } from "@smithers-orchestrator/db/adapter";
2
+
3
+ export type RunOutputCommandInput = {
4
+ adapter: SmithersDb;
5
+ runId: string;
6
+ nodeId: string;
7
+ iteration?: number;
8
+ pretty?: boolean;
9
+ workflow?: unknown;
10
+ stdout: NodeJS.WritableStream;
11
+ stderr: NodeJS.WritableStream;
12
+ };
@@ -0,0 +1,3 @@
1
+ export type RunOutputCommandResult = {
2
+ exitCode: number;
3
+ };
@@ -0,0 +1,14 @@
1
+ import type { SmithersDb } from "@smithers-orchestrator/db/adapter";
2
+
3
+ export type RunRewindCommandInput = {
4
+ adapter: SmithersDb;
5
+ runId: string;
6
+ frameNo: number;
7
+ yes?: boolean;
8
+ json?: boolean;
9
+ confirm?: () => Promise<boolean>;
10
+ onResult?: (result: unknown) => void;
11
+ stdin: NodeJS.ReadStream;
12
+ stdout: NodeJS.WritableStream;
13
+ stderr: NodeJS.WritableStream;
14
+ };
@@ -0,0 +1,3 @@
1
+ export type RunRewindCommandResult = {
2
+ exitCode: number;
3
+ };
@@ -0,0 +1,14 @@
1
+ import type { SmithersDb } from "@smithers-orchestrator/db/adapter";
2
+
3
+ export type RunTreeCommandInput = {
4
+ adapter: SmithersDb;
5
+ runId: string;
6
+ frameNo?: number;
7
+ depth?: number;
8
+ node?: string;
9
+ color?: boolean;
10
+ json?: boolean;
11
+ abortSignal?: AbortSignal;
12
+ stdout: NodeJS.WritableStream;
13
+ stderr: NodeJS.WritableStream;
14
+ };
@@ -0,0 +1,3 @@
1
+ export type RunTreeCommandResult = {
2
+ exitCode: number;
3
+ };
@@ -0,0 +1,3 @@
1
+ import type { SmithersEvent } from "@smithers-orchestrator/observability/SmithersEvent";
2
+
3
+ export type SmithersEventType = SmithersEvent["type"];
@@ -0,0 +1,33 @@
1
+ import type { SmithersDb } from "@smithers-orchestrator/db/adapter";
2
+
3
+ export type SupervisorSpawnClaim = {
4
+ claimOwnerId: string;
5
+ claimHeartbeatAtMs: number;
6
+ restoreRuntimeOwnerId?: string | null;
7
+ restoreHeartbeatAtMs?: number | null;
8
+ };
9
+
10
+ export type SupervisorDeps = {
11
+ now: () => number;
12
+ workflowExists: (workflowPath: string) => boolean;
13
+ parseRuntimeOwnerPid: (
14
+ runtimeOwnerId: string | null | undefined,
15
+ ) => number | null;
16
+ isPidAlive: (pid: number) => boolean;
17
+ spawnResumeDetached: (
18
+ workflowPath: string,
19
+ runId: string,
20
+ claim?: SupervisorSpawnClaim,
21
+ ) => number | null;
22
+ };
23
+
24
+ export type SupervisorOptions = {
25
+ adapter: SmithersDb;
26
+ pollIntervalMs?: number;
27
+ staleThresholdMs?: number;
28
+ maxConcurrent?: number;
29
+ dryRun?: boolean;
30
+ supervisorId?: string;
31
+ supervisorRunId?: string;
32
+ deps?: Partial<SupervisorDeps>;
33
+ };
@@ -0,0 +1,6 @@
1
+ export type SupervisorPollSummary = {
2
+ staleCount: number;
3
+ resumedCount: number;
4
+ skippedCount: number;
5
+ durationMs: number;
6
+ };
@@ -0,0 +1,5 @@
1
+ export type TreeRenderOptions = {
2
+ depth?: number;
3
+ nodeId?: string;
4
+ color?: boolean;
5
+ };
@@ -0,0 +1,9 @@
1
+ import type { WatchRenderContext } from "./WatchRenderContext.ts";
2
+
3
+ export type WatchLoopOptions<T> = {
4
+ intervalSeconds: number;
5
+ clearScreen?: boolean;
6
+ fetch: () => Promise<T>;
7
+ render: (snapshot: T, context: WatchRenderContext) => Promise<void> | void;
8
+ isTerminal?: (snapshot: T) => boolean;
9
+ };
@@ -0,0 +1,8 @@
1
+ export type WatchLoopResult<T> = {
2
+ intervalMs: number;
3
+ tickCount: number;
4
+ stoppedBySignal: boolean;
5
+ reachedTerminal: boolean;
6
+ signal?: NodeJS.Signals;
7
+ lastData: T;
8
+ };
@@ -0,0 +1,4 @@
1
+ export type WatchRenderContext = {
2
+ tickCount: number;
3
+ initial: boolean;
4
+ };
@@ -0,0 +1,17 @@
1
+ import type { WhyBlockerKind } from "./WhyBlockerKind.ts";
2
+
3
+ export type WhyBlocker = {
4
+ kind: WhyBlockerKind;
5
+ nodeId: string;
6
+ iteration: number | null;
7
+ reason: string;
8
+ waitingSince: number;
9
+ unblocker: string;
10
+ context?: string;
11
+ signalName?: string | null;
12
+ dependencyNodeId?: string | null;
13
+ firesAtMs?: number | null;
14
+ remainingMs?: number | null;
15
+ attempt?: number | null;
16
+ maxAttempts?: number | null;
17
+ };
@@ -0,0 +1,9 @@
1
+ export type WhyBlockerKind =
2
+ | "waiting-approval"
3
+ | "waiting-event"
4
+ | "waiting-timer"
5
+ | "stale-task-heartbeat"
6
+ | "retry-backoff"
7
+ | "retries-exhausted"
8
+ | "stale-heartbeat"
9
+ | "dependency-failed";
@@ -0,0 +1,10 @@
1
+ import type { WhyBlocker } from "./WhyBlocker.ts";
2
+
3
+ export type WhyDiagnosis = {
4
+ runId: string;
5
+ status: string;
6
+ summary: string;
7
+ generatedAtMs: number;
8
+ blockers: WhyBlocker[];
9
+ currentNodeId: string | null;
10
+ };
@@ -0,0 +1,4 @@
1
+ export type WorkflowCta = {
2
+ command: string;
3
+ description: string;
4
+ };
@@ -0,0 +1 @@
1
+ export type WorkflowSourceType = "user" | "seeded" | "generated" | (string & {});