@bastani/atomic 0.8.24-alpha.1 → 0.8.24-alpha.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.24-alpha.2] - 2026-06-03
6
+
7
+ ### Added
8
+
9
+ - Shipped externally-resolvable TypeScript types for the `@bastani/workflows` SDK through `@bastani/atomic`. New `./workflows`, `./workflows/builtin`, `./workflows/builtin/*`, and `./workflows/ambient` package exports resolve to declarations emitted from the lean authoring surface during the build, and a generated ambient bridge maps the documented bare `@bastani/workflows` specifier (and its `builtin/*` submodules) onto those exports. Installed packages now type-check `import { defineWorkflow, Type } from "@bastani/workflows"` and `@bastani/workflows/builtin/*` composition imports under `tsc` (`moduleResolution: NodeNext`) with no hand-authored `.d.ts`, no `declare module` shim, and no `paths` alias: packages that import `@bastani/atomic` pick the types up automatically, while pure workflow-only packages add one `compilerOptions.types: ["@bastani/atomic/workflows/ambient"]` (or `/// <reference types="@bastani/atomic/workflows/ambient" />`) opt-in. The runtime workflow loader, jiti virtual modules, and `atomic.workflows` discovery are unchanged ([#1208](https://github.com/bastani-inc/atomic/issues/1208)).
10
+ - Added a `verify:workflow-types` script that packs `@bastani/atomic` and type-checks throwaway external consumer fixtures (workflow-only opt-in, reference directive, auto-include, and a negative control) so the issue #1208 acceptance test is repeatable ([#1208](https://github.com/bastani-inc/atomic/issues/1208)).
11
+
12
+ ### Changed
13
+
14
+ - Documented the workflow SDK typing model in `docs/packages.md` and `docs/workflows.md`: the single ambient opt-in for pure workflow-only packages, automatic pickup for packages that import `@bastani/atomic`, and the requirement to list `@bastani/atomic` and `typebox` as peer dependencies ([#1208](https://github.com/bastani-inc/atomic/issues/1208)).
15
+
5
16
  ## [0.8.24-alpha.1] - 2026-06-02
6
17
 
7
18
  ### Breaking Changes
@@ -4,6 +4,12 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.24-alpha.2] - 2026-06-03
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.24-alpha.2 prerelease.
12
+
7
13
  ## [0.8.24-alpha.1] - 2026-06-02
8
14
 
9
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.24-alpha.1",
3
+ "version": "0.8.24-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.24-alpha.2] - 2026-06-03
11
+
12
+ ### Changed
13
+
14
+ - Bumped package version for the Atomic 0.8.24-alpha.2 prerelease.
15
+
10
16
  ## [0.8.24-alpha.1] - 2026-06-02
11
17
 
12
18
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.24-alpha.1",
3
+ "version": "0.8.24-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.24-alpha.2] - 2026-06-03
6
+
7
+ ### Changed
8
+
9
+ - Bumped package version for the Atomic 0.8.24-alpha.2 prerelease.
10
+
5
11
  ## [0.8.24-alpha.1] - 2026-06-02
6
12
 
7
13
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.24-alpha.1",
3
+ "version": "0.8.24-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.24-alpha.2] - 2026-06-03
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.24-alpha.2 prerelease.
12
+
7
13
  ## [0.8.24-alpha.1] - 2026-06-02
8
14
 
9
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.24-alpha.1",
3
+ "version": "0.8.24-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.24-alpha.2] - 2026-06-03
10
+
11
+ ### Added
12
+
13
+ - The `@bastani/workflows` authoring SDK types are now externally resolvable in installed packages through `@bastani/atomic`'s new `./workflows` exports and ambient bridge, so workflow files type-check `import { defineWorkflow, Type } from "@bastani/workflows"` (and `@bastani/workflows/builtin/*`) under `tsc` (NodeNext) without a hand-authored `.d.ts`, `declare module` shim, or `paths` alias. Workflow packages declare `@bastani/atomic` and `typebox` as peer dependencies; the package continues to distribute raw TypeScript with no build step, and the runtime virtual-module loader is unchanged ([#1208](https://github.com/bastani-inc/atomic/issues/1208)).
14
+
15
+ ### Fixed
16
+
17
+ - Fixed builtin (and any) workflows falling back to the user's currently selected model instead of the stage's defined model. A fully-qualified `provider/model` id that the live model catalog did not list was treated as a hard "not available" failure; because candidate validation throws on any failure and the catalog resolver catches that throw and collapses the whole ordered candidate list down to the user's `currentModel`, a single absent cross-provider fallback discarded the defined primary plus every fallback. Provider-qualified ids are now trusted (passed through with the reasoning suffix split off the last colon), mirroring the subagent resolver, so the defined primary is used and only genuinely failing candidates fall through at runtime. Regressed when bundled workflow model lists were refreshed onto newer multi-provider ids alongside suffix-first reasoning levels ([#1199](https://github.com/bastani-inc/atomic/issues/1199)).
18
+
9
19
  ## [0.8.24-alpha.1] - 2026-06-02
10
20
 
11
21
  ### Breaking Changes
@@ -0,0 +1,36 @@
1
+ // AUTO-GENERATED by scripts/copy-builtin-packages.ts (issue #1208). Do not edit by hand.
2
+ //
3
+ // Ambient bridge so the documented bare specifier `@bastani/workflows` (and its
4
+ // `builtin/*` submodules) type-check in installed packages that depend only on
5
+ // @bastani/atomic. Runtime resolution is unchanged: Atomic's jiti virtual-module
6
+ // loader still supplies the real SDK when workflow files load; these declarations
7
+ // only affect `tsc`. Each module is declared in exactly one file to avoid
8
+ // TS2666 / duplicate-identifier errors.
9
+
10
+ declare module "@bastani/workflows" {
11
+ export * from "@bastani/atomic/workflows";
12
+ }
13
+
14
+ declare module "@bastani/workflows/builtin" {
15
+ export * from "@bastani/atomic/workflows/builtin";
16
+ }
17
+
18
+ declare module "@bastani/workflows/builtin/deep-research-codebase" {
19
+ export * from "@bastani/atomic/workflows/builtin/deep-research-codebase";
20
+ export { default } from "@bastani/atomic/workflows/builtin/deep-research-codebase";
21
+ }
22
+
23
+ declare module "@bastani/workflows/builtin/goal" {
24
+ export * from "@bastani/atomic/workflows/builtin/goal";
25
+ export { default } from "@bastani/atomic/workflows/builtin/goal";
26
+ }
27
+
28
+ declare module "@bastani/workflows/builtin/open-claude-design" {
29
+ export * from "@bastani/atomic/workflows/builtin/open-claude-design";
30
+ export { default } from "@bastani/atomic/workflows/builtin/open-claude-design";
31
+ }
32
+
33
+ declare module "@bastani/workflows/builtin/ralph" {
34
+ export * from "@bastani/atomic/workflows/builtin/ralph";
35
+ export { default } from "@bastani/atomic/workflows/builtin/ralph";
36
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.8.24-alpha.1",
3
+ "version": "0.8.24-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -0,0 +1,197 @@
1
+ import type { TAny, TArray, TArrayOptions, TBigInt, TBoolean, TEnum, TEnumValue, TInteger, TIntersect, TIntersectOptions, TLiteral, TLiteralValue, TNever, TNull, TNumber, TNumberOptions, TOmit, TObject, TObjectOptions, TPartial, TPick, TRecordAction, TRequired, TSchema, TSchemaOptions, TString, TStringOptions, TTuple, TTupleOptions, TUndefined, TUnion, TUnknown, TVoid, Type as TypeboxType, TKeysToIndexer } from "typebox";
2
+ type PreserveOptions<T extends TSchema, O extends TSchemaOptions> = T & O;
3
+ type TypeScriptEnumLike = Record<string, string | number>;
4
+ type TypeScriptEnumValues<T extends TypeScriptEnumLike> = Extract<T[keyof T], TEnumValue>[];
5
+ export declare const Type: Omit<typeof TypeboxType, "Any" | "Array" | "BigInt" | "Boolean" | "Enum" | "Integer" | "Intersect" | "Literal" | "Never" | "Null" | "Number" | "Omit" | "Partial" | "Pick" | "Object" | "Record" | "Required" | "String" | "Tuple" | "Undefined" | "Union" | "Unknown" | "Void"> & {
6
+ Any<const O extends TSchemaOptions>(options: O): PreserveOptions<TAny, O>;
7
+ Any(): TAny;
8
+ Array<Type extends TSchema, const O extends TArrayOptions>(items: Type, options: O): PreserveOptions<TArray<Type>, O>;
9
+ Array<Type extends TSchema>(items: Type): TArray<Type>;
10
+ BigInt<const O extends TSchemaOptions>(options: O): PreserveOptions<TBigInt, O>;
11
+ BigInt(): TBigInt;
12
+ Boolean<const O extends TSchemaOptions>(options: O): PreserveOptions<TBoolean, O>;
13
+ Boolean(): TBoolean;
14
+ Enum<Values extends TEnumValue[], const O extends TSchemaOptions>(values: readonly [...Values], options: O): PreserveOptions<TEnum<Values>, O>;
15
+ Enum<Values extends TEnumValue[]>(values: readonly [...Values]): TEnum<Values>;
16
+ Enum<Enum extends TypeScriptEnumLike, const O extends TSchemaOptions>(value: Enum, options: O): PreserveOptions<TEnum<TypeScriptEnumValues<Enum>>, O>;
17
+ Enum<Enum extends TypeScriptEnumLike>(value: Enum): TEnum<TypeScriptEnumValues<Enum>>;
18
+ Integer<const O extends TNumberOptions>(options: O): PreserveOptions<TInteger, O>;
19
+ Integer(): TInteger;
20
+ Intersect<Types extends TSchema[], const O extends TIntersectOptions>(types: [...Types], options: O): PreserveOptions<TIntersect<Types>, O>;
21
+ Intersect<Types extends TSchema[]>(types: [...Types]): TIntersect<Types>;
22
+ Literal<const Value extends TLiteralValue, const O extends TSchemaOptions>(value: Value, options: O): PreserveOptions<TLiteral<Value>, O>;
23
+ Literal<const Value extends TLiteralValue>(value: Value): TLiteral<Value>;
24
+ Never<const O extends TSchemaOptions>(options: O): PreserveOptions<TNever, O>;
25
+ Never(): TNever;
26
+ Null<const O extends TSchemaOptions>(options: O): PreserveOptions<TNull, O>;
27
+ Null(): TNull;
28
+ Number<const O extends TNumberOptions>(options: O): PreserveOptions<TNumber, O>;
29
+ Number(): TNumber;
30
+ Omit<Type extends TSchema, Indexer extends PropertyKey[], const O extends TSchemaOptions>(type: Type, indexer: readonly [...Indexer], options: O): PreserveOptions<TOmit<Type, TKeysToIndexer<Indexer>>, O>;
31
+ Omit<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer]): TOmit<Type, TKeysToIndexer<Indexer>>;
32
+ Omit<Type extends TSchema, Indexer extends TSchema, const O extends TSchemaOptions>(type: Type, indexer: Indexer, options: O): PreserveOptions<TOmit<Type, Indexer>, O>;
33
+ Omit<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer): TOmit<Type, Indexer>;
34
+ Partial<Type extends TSchema, const O extends TSchemaOptions>(type: Type, options: O): PreserveOptions<TPartial<Type>, O>;
35
+ Partial<Type extends TSchema>(type: Type): TPartial<Type>;
36
+ Pick<Type extends TSchema, Indexer extends PropertyKey[], const O extends TSchemaOptions>(type: Type, indexer: readonly [...Indexer], options: O): PreserveOptions<TPick<Type, TKeysToIndexer<Indexer>>, O>;
37
+ Pick<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer]): TPick<Type, TKeysToIndexer<Indexer>>;
38
+ Pick<Type extends TSchema, Indexer extends TSchema, const O extends TSchemaOptions>(type: Type, indexer: Indexer, options: O): PreserveOptions<TPick<Type, Indexer>, O>;
39
+ Pick<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer): TPick<Type, Indexer>;
40
+ Object<Properties extends Record<PropertyKey, TSchema>, const O extends TObjectOptions>(properties: Properties, options: O): PreserveOptions<TObject<Properties>, O>;
41
+ Object<Properties extends Record<PropertyKey, TSchema>>(properties: Properties): TObject<Properties>;
42
+ Record<Key extends TSchema, Value extends TSchema, const O extends TObjectOptions>(key: Key, value: Value, options: O): PreserveOptions<TRecordAction<Key, Value>, O>;
43
+ Record<Key extends TSchema, Value extends TSchema>(key: Key, value: Value): TRecordAction<Key, Value>;
44
+ Required<Type extends TSchema, const O extends TSchemaOptions>(type: Type, options: O): PreserveOptions<TRequired<Type>, O>;
45
+ Required<Type extends TSchema>(type: Type): TRequired<Type>;
46
+ String<const O extends TStringOptions>(options: O): PreserveOptions<TString, O>;
47
+ String(): TString;
48
+ Tuple<Types extends TSchema[], const O extends TTupleOptions>(types: [...Types], options: O): PreserveOptions<TTuple<Types>, O>;
49
+ Tuple<Types extends TSchema[]>(types: [...Types]): TTuple<Types>;
50
+ Undefined<const O extends TSchemaOptions>(options: O): PreserveOptions<TUndefined, O>;
51
+ Undefined(): TUndefined;
52
+ Union<Types extends TSchema[], const O extends TSchemaOptions>(anyOf: [...Types], options: O): PreserveOptions<TUnion<Types>, O>;
53
+ Union<Types extends TSchema[]>(anyOf: [...Types]): TUnion<Types>;
54
+ Unknown<const O extends TSchemaOptions>(options: O): PreserveOptions<TUnknown, O>;
55
+ Unknown(): TUnknown;
56
+ Void<const O extends TSchemaOptions>(options: O): PreserveOptions<TVoid, O>;
57
+ Void(): TVoid;
58
+ };
59
+ export type { Static, TSchema } from "typebox";
60
+ export type { AgentSessionAdapter, CompleteAdapter, CompleteStageOpts, GitWorktreeSetupOptions, GitWorktreeSetupResult, PromptAdapter, PromptOptions, ResolvedInputs, RunResult, RunStatus, StageAdapters, StageStatus, StageOptions, StageContext, StageSnapshot, StageExecutionMeta, StageMcpOptions, StageOutputOptions, StagePromptOptions, StageSessionCreateOptions, StageSessionCreateResult, StageSessionRuntime, WorkflowAction, WorkflowArtifact, WorkflowChainOptions, WorkflowChainStep, WorkflowChildResult, WorkflowContextMode, WorkflowControlEvent, WorkflowCustomToolDefinition, WorkflowDetails, WorkflowDetailsMode, WorkflowDetailsStatus, WorkflowDirectOptions, WorkflowDirectTaskItem, WorkflowExecutionMode, WorkflowExecutionPolicy, WorkflowInputBindings, WorkflowInputSchema, WorkflowInputSchemaMap, WorkflowInputValues, WorkflowIntercomSummary, WorkflowMaxOutput, WorkflowMcpPort, WorkflowModelAttempt, WorkflowModelCatalogPort, WorkflowModelFallbackFields, WorkflowModelInfo, WorkflowModelUsage, WorkflowModelValue, WorkflowOutputMode, WorkflowOutputSchema, WorkflowOutputSchemaMap, WorkflowOutputValues, WorkflowParallelChainStep, WorkflowParallelOptions, WorkflowPersistencePort, WorkflowProgressSummary, WorkflowRunChildOptions, WorkflowRunOutput, WorkflowRuntimeConfig, WorkflowSerializableObject, WorkflowSerializablePrimitive, WorkflowSerializableValue, WorkflowSharedTaskDefaults, WorkflowTaskContext, WorkflowTaskContextInput, WorkflowTaskOptions, WorkflowTaskResult, WorkflowTaskSessionFields, WorkflowTaskSessionOptions, WorkflowTaskStep, WorkflowThinkingLevel, WorkflowUIAdapter, WorkflowUIContext, WorkflowWorktreeInputBinding, } from "./shared/authoring-contract.js";
61
+ import type * as AuthoringContract from "./shared/authoring-contract.js";
62
+ import type { GitWorktreeSetupOptions, GitWorktreeSetupResult, ResolvedInputs, RunResult, RunStatus, StageSnapshot, WorkflowDefinition as WorkflowContractDefinition, WorkflowDetails, WorkflowDirectOptions, WorkflowDirectTaskItem, WorkflowExecutionPolicy, WorkflowInputValues, WorkflowOutputValues, WorkflowSerializableObject, WorkflowChainStep } from "./shared/authoring-contract.js";
63
+ declare const workflowDefinitionBrand: unique symbol;
64
+ type WorkflowDefinitionBrand = {
65
+ readonly [workflowDefinitionBrand]: true;
66
+ };
67
+ export interface WorkflowDefinition<TInputs extends WorkflowInputValues = WorkflowInputValues, TOutputs extends WorkflowOutputValues = WorkflowOutputValues, TRunInputs extends WorkflowInputValues = TInputs, TDefinitionBrand extends object = WorkflowDefinitionBrand> extends WorkflowContractDefinition<TInputs, TOutputs, TRunInputs, TDefinitionBrand>, WorkflowDefinitionBrand {
68
+ }
69
+ export type WorkflowRunContext<TInputs extends WorkflowInputValues = WorkflowInputValues> = AuthoringContract.WorkflowRunContext<TInputs, WorkflowDefinitionBrand>;
70
+ export type WorkflowRunFn<TInputs extends WorkflowInputValues = WorkflowInputValues, TOutputs extends WorkflowOutputValues = WorkflowOutputValues> = AuthoringContract.WorkflowRunFn<TInputs, TOutputs, WorkflowDefinitionBrand>;
71
+ export type AnyWorkflowDefinition = WorkflowDefinition<WorkflowInputValues, WorkflowOutputValues, WorkflowInputValues>;
72
+ export type WorkflowBuilder<TInputs extends WorkflowInputValues = {}, TOutputs extends WorkflowOutputValues = {}, TRunInputs extends WorkflowInputValues = TInputs> = AuthoringContract.WorkflowBuilder<TInputs, TOutputs, TRunInputs, WorkflowDefinitionBrand, WorkflowDefinition<TInputs, TOutputs, TRunInputs>>;
73
+ export type CompletedWorkflowBuilder<TInputs extends WorkflowInputValues = {}, TOutputs extends WorkflowOutputValues = {}, TRunInputs extends WorkflowInputValues = TInputs> = AuthoringContract.CompletedWorkflowBuilder<TInputs, TOutputs, TRunInputs, WorkflowDefinitionBrand, WorkflowDefinition<TInputs, TOutputs, TRunInputs>>;
74
+ export type RunContinuationOpts = AuthoringContract.RunContinuationOpts;
75
+ export type WorkflowParentRunLink = AuthoringContract.WorkflowParentRunLink;
76
+ export type RunOpts = Omit<AuthoringContract.RunOpts, "registry"> & {
77
+ readonly registry?: WorkflowRegistry;
78
+ };
79
+ export declare const INTERACTIVE_WORKFLOW_POLICY: WorkflowExecutionPolicy;
80
+ export declare const NON_INTERACTIVE_WORKFLOW_POLICY: WorkflowExecutionPolicy;
81
+ export declare function run<TInputs extends WorkflowInputValues, TOutputs extends WorkflowOutputValues, TRunInputs extends WorkflowInputValues = TInputs>(definition: WorkflowDefinition<TInputs, TOutputs, TRunInputs>, inputs: Readonly<NoInfer<TRunInputs>>, opts?: RunOpts): Promise<RunResult<TOutputs>>;
82
+ export declare function runTask(task: WorkflowDirectTaskItem, runOptions?: RunOpts): Promise<WorkflowDetails>;
83
+ export declare function runTask(task: WorkflowDirectTaskItem, options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
84
+ export declare function runParallel(tasks: readonly WorkflowDirectTaskItem[], options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
85
+ export declare function runChain(steps: readonly WorkflowChainStep[], options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
86
+ export declare function resolveInputs<TInputs extends WorkflowInputValues>(schema: Readonly<Record<keyof TInputs & string, TSchema>>, provided: Partial<TInputs>): ResolvedInputs<TInputs>;
87
+ export declare function setupGitWorktree(options: GitWorktreeSetupOptions): GitWorktreeSetupResult;
88
+ export interface WorkflowRegistry {
89
+ register<TInputs extends WorkflowInputValues, TOutputs extends WorkflowOutputValues>(definition: WorkflowDefinition<TInputs, TOutputs>): WorkflowRegistry;
90
+ merge(other: WorkflowRegistry): WorkflowRegistry;
91
+ get(name: string): AnyWorkflowDefinition | undefined;
92
+ has(name: string): boolean;
93
+ remove(name: string): WorkflowRegistry;
94
+ names(): string[];
95
+ all(): AnyWorkflowDefinition[];
96
+ }
97
+ /**
98
+ * @deprecated Removed imperative workflow API. This runtime value only throws
99
+ * a migration error; author workflows with defineWorkflow(...).compile().
100
+ */
101
+ export declare const runWorkflow: never;
102
+ export declare function defineWorkflow(name: string): WorkflowBuilder;
103
+ export declare function createRegistry<TDefinitions extends readonly AnyWorkflowDefinition[] = readonly AnyWorkflowDefinition[]>(initial?: TDefinitions): WorkflowRegistry;
104
+ export declare function normalizeWorkflowName(name: string): string;
105
+ export declare function workflowNamesEqual(a: string, b: string): boolean;
106
+ export declare class GraphFrontierTracker {
107
+ onSpawn(stageId: string, stageName: string): string[];
108
+ currentParents(): string[];
109
+ replaceParents(stageId: string, parentIds: readonly string[]): void;
110
+ onSettle(stageId: string): void;
111
+ getNodes(): StageNode[];
112
+ getParents(stageId: string): string[];
113
+ reset(): void;
114
+ }
115
+ export interface StageNode extends WorkflowSerializableObject {
116
+ readonly id: string;
117
+ readonly name: string;
118
+ readonly parentIds: readonly string[];
119
+ }
120
+ export type NoticeLevel = "info" | "warning" | "error";
121
+ export type PromptKind = "input" | "confirm" | "select" | "editor";
122
+ export interface PendingPrompt extends WorkflowSerializableObject {
123
+ readonly id: string;
124
+ readonly kind: PromptKind;
125
+ readonly message: string;
126
+ readonly choices?: readonly string[];
127
+ readonly initial?: string;
128
+ readonly createdAt: number;
129
+ }
130
+ export interface ToolEvent {
131
+ readonly name: string;
132
+ readonly input?: Record<string, unknown>;
133
+ readonly output?: string;
134
+ readonly startedAt?: number;
135
+ readonly endedAt?: number;
136
+ }
137
+ export interface WorkflowNotice extends WorkflowSerializableObject {
138
+ readonly id: string;
139
+ readonly runId?: string;
140
+ readonly stageId?: string;
141
+ readonly level: NoticeLevel;
142
+ readonly message: string;
143
+ readonly createdAt: number;
144
+ readonly requiresAck?: boolean;
145
+ readonly ackedAt?: number;
146
+ }
147
+ export interface WorkflowOverlayAdapter {
148
+ show(notice: WorkflowNotice): void;
149
+ hide(): void;
150
+ }
151
+ export interface RunSnapshot {
152
+ readonly id: string;
153
+ readonly name: string;
154
+ readonly status: RunStatus;
155
+ readonly stages: readonly StageSnapshot[];
156
+ readonly startedAt: number;
157
+ readonly endedAt?: number;
158
+ readonly durationMs?: number;
159
+ readonly result?: WorkflowOutputValues;
160
+ readonly error?: string;
161
+ readonly pendingPrompt?: PendingPrompt;
162
+ }
163
+ export interface StoreSnapshot {
164
+ readonly runs: readonly RunSnapshot[];
165
+ readonly notices: readonly WorkflowNotice[];
166
+ readonly version: number;
167
+ }
168
+ export interface Store {
169
+ runs(): readonly RunSnapshot[];
170
+ notices(): readonly WorkflowNotice[];
171
+ activeRunId(): string | null;
172
+ recordRunStart(run: RunSnapshot): void;
173
+ recordStageStart(runId: string, stage: StageSnapshot): void;
174
+ recordToolStart(runId: string, stageId: string, evt: ToolEvent): void;
175
+ recordToolEnd(runId: string, stageId: string, evt: ToolEvent): void;
176
+ recordStageEnd(runId: string, stage: StageSnapshot): void;
177
+ recordRunEnd(runId: string, status: RunStatus, result?: WorkflowOutputValues, error?: string): boolean;
178
+ removeRun(runId: string): boolean;
179
+ recordNotice(notice: WorkflowNotice): void;
180
+ ackNotice(id: string): boolean;
181
+ }
182
+ export declare function createStore(): Store;
183
+ export declare const store: Store;
184
+ export interface ActiveRunEntry {
185
+ readonly controller: AbortController;
186
+ readonly children: readonly AbortController[];
187
+ }
188
+ export interface CancellationRegistry {
189
+ register(runId: string, controller: AbortController): void;
190
+ registerChild(runId: string, controller: AbortController): void;
191
+ abort(runId: string, reason?: unknown): boolean;
192
+ abortAll(reason?: unknown): number;
193
+ unregister(runId: string): void;
194
+ isAborted(runId: string): boolean;
195
+ }
196
+ export declare function createCancellationRegistry(): CancellationRegistry;
197
+ export declare const cancellationRegistry: CancellationRegistry;
@@ -112,7 +112,17 @@ function resolveStringModel(
112
112
  }
113
113
 
114
114
  if (baseModel.includes("/")) {
115
- return { input, reason: "not available" };
115
+ // Trust an explicit provider/model id even when the live catalog does not
116
+ // list it, mirroring the subagent resolver (resolveModelCandidate's
117
+ // `if (model.includes("/")) return model;`). The workflow catalog
118
+ // (ctx.modelRegistry.getAvailable()) can legitimately be a partial view
119
+ // (auth/provider gating, freshly added models), so treating an absent
120
+ // fully-qualified id as a hard failure made buildModelCandidates throw and
121
+ // collapse the whole ordered candidate list down to just the user's
122
+ // currentModel — discarding the workflow's defined primary and fallbacks.
123
+ // Pass it through with the reasoning suffix split off; the runtime fallback
124
+ // loop skips it only if the SDK genuinely cannot create a session for it.
125
+ return makeCandidate(baseModel, baseModel, level);
116
126
  }
117
127
 
118
128
  const byBareId = models.filter((model) => model.id === baseModel);