@isaacwasserman/remora 0.1.0 → 0.2.1

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 (37) hide show
  1. package/dist/compiler/index.d.ts +19 -2
  2. package/dist/compiler/index.d.ts.map +1 -1
  3. package/dist/compiler/passes/validate-control-flow.d.ts +2 -2
  4. package/dist/compiler/passes/validate-control-flow.d.ts.map +1 -1
  5. package/dist/compiler/passes/validate-foreach-target.d.ts +2 -4
  6. package/dist/compiler/passes/validate-foreach-target.d.ts.map +1 -1
  7. package/dist/compiler/passes/validate-limits.d.ts +9 -0
  8. package/dist/compiler/passes/validate-limits.d.ts.map +1 -0
  9. package/dist/compiler/passes/validate-references.d.ts.map +1 -1
  10. package/dist/compiler/types.d.ts +52 -1
  11. package/dist/compiler/types.d.ts.map +1 -1
  12. package/dist/compiler/utils/graph.d.ts.map +1 -1
  13. package/dist/compiler/utils/schema.d.ts +33 -0
  14. package/dist/compiler/utils/schema.d.ts.map +1 -0
  15. package/dist/executor/context.d.ts +42 -0
  16. package/dist/executor/context.d.ts.map +1 -0
  17. package/dist/executor/errors.d.ts +21 -1
  18. package/dist/executor/errors.d.ts.map +1 -1
  19. package/dist/executor/index.d.ts +45 -0
  20. package/dist/executor/index.d.ts.map +1 -1
  21. package/dist/generator/index.d.ts +31 -0
  22. package/dist/generator/index.d.ts.map +1 -1
  23. package/dist/generator/prompt.d.ts.map +1 -1
  24. package/dist/lib.d.ts +4 -2
  25. package/dist/lib.d.ts.map +1 -1
  26. package/dist/lib.js +614 -110
  27. package/dist/lib.js.map +18 -15
  28. package/dist/types.d.ts +136 -4
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/viewer/graph-layout.d.ts.map +1 -1
  31. package/dist/viewer/index.js +7 -30
  32. package/dist/viewer/index.js.map +6 -6
  33. package/dist/viewer/nodes/start-step-node.d.ts.map +1 -1
  34. package/dist/viewer/panels/step-detail-panel.d.ts.map +1 -1
  35. package/dist/viewer/workflow-viewer.d.ts +21 -0
  36. package/dist/viewer/workflow-viewer.d.ts.map +1 -1
  37. package/package.json +21 -4
@@ -1,8 +1,25 @@
1
1
  import type { ToolSet } from "ai";
2
2
  import type { WorkflowDefinition } from "../types";
3
- import type { CompilerResult } from "./types";
3
+ import type { CompilerLimits, CompilerResult } from "./types";
4
+ /**
5
+ * Compiles a workflow definition through a multi-pass validation pipeline,
6
+ * producing an execution graph and structured diagnostics.
7
+ *
8
+ * Passes: graph construction, reference validation, control flow validation,
9
+ * JMESPath validation, tool validation, for-each target validation, and
10
+ * best-practice transformations.
11
+ *
12
+ * @param workflow - The workflow definition to compile.
13
+ * @param options - Optional configuration.
14
+ * @param options.tools - Tool definitions to validate tool-call steps against.
15
+ * When provided, enables tool input validation and constrained schema generation.
16
+ * @returns A {@link CompilerResult} containing diagnostics, the execution graph
17
+ * (if structurally valid), an optimized workflow (if error-free), and
18
+ * constrained tool schemas (if tools were provided).
19
+ */
4
20
  export declare function compileWorkflow(workflow: WorkflowDefinition, options?: {
5
21
  tools?: ToolSet;
22
+ limits?: CompilerLimits;
6
23
  }): Promise<CompilerResult>;
7
- export type { CompilerResult, ConstrainedToolSchema, ConstrainedToolSchemaMap, Diagnostic, DiagnosticCode, DiagnosticLocation, DiagnosticSeverity, ExecutionGraph, } from "./types";
24
+ export type { CompilerLimits, CompilerResult, ConstrainedToolSchema, ConstrainedToolSchemaMap, Diagnostic, DiagnosticCode, DiagnosticLocation, DiagnosticSeverity, ExecutionGraph, } from "./types";
8
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AASnD,OAAO,KAAK,EACX,cAAc,EAId,MAAM,SAAS,CAAC;AAEjB,wBAAsB,eAAe,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,GACC,OAAO,CAAC,cAAc,CAAC,CA4DzB;AAiBD,YAAY,EACX,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,GACd,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAUnD,OAAO,KAAK,EACX,cAAc,EACd,cAAc,EAId,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;CACxB,GACC,OAAO,CAAC,cAAc,CAAC,CAkEzB;AAiBD,YAAY,EACX,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,GACd,MAAM,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { WorkflowDefinition } from "../../types";
2
- import type { Diagnostic, ExecutionGraph } from "../types";
3
- export declare function validateControlFlow(workflow: WorkflowDefinition, graph: ExecutionGraph): Diagnostic[];
2
+ import type { Diagnostic, ExecutionGraph, ToolDefinitionMap } from "../types";
3
+ export declare function validateControlFlow(workflow: WorkflowDefinition, graph: ExecutionGraph, tools?: ToolDefinitionMap | null): Diagnostic[];
4
4
  //# sourceMappingURL=validate-control-flow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-control-flow.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-control-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,cAAc,GACnB,UAAU,EAAE,CA4Fd"}
1
+ {"version":3,"file":"validate-control-flow.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-control-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG9E,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAC9B,UAAU,EAAE,CA8Jd"}
@@ -1,6 +1,4 @@
1
- import type { WorkflowStep } from "../../types";
1
+ import type { WorkflowDefinition } from "../../types";
2
2
  import type { Diagnostic, ExecutionGraph, ToolDefinitionMap } from "../types";
3
- export declare function validateForeachTarget(workflow: {
4
- steps: WorkflowStep[];
5
- }, graph: ExecutionGraph, tools: ToolDefinitionMap): Diagnostic[];
3
+ export declare function validateForeachTarget(workflow: WorkflowDefinition, graph: ExecutionGraph, tools: ToolDefinitionMap): Diagnostic[];
6
4
  //# sourceMappingURL=validate-foreach-target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-foreach-target.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-foreach-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE9E,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE;IAAE,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,EACnC,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,iBAAiB,GACtB,UAAU,EAAE,CAoDd"}
1
+ {"version":3,"file":"validate-foreach-target.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-foreach-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS9E,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,iBAAiB,GACtB,UAAU,EAAE,CA6Dd"}
@@ -0,0 +1,9 @@
1
+ import type { WorkflowDefinition } from "../../types";
2
+ import type { CompilerLimits, Diagnostic } from "../types";
3
+ /**
4
+ * Validates literal values in sleep/wait-for-condition steps against
5
+ * configured upper/lower bounds. Only checks expressions with
6
+ * type === 'literal' — JMESPath expressions are unknown at compile time.
7
+ */
8
+ export declare function validateLimits(workflow: WorkflowDefinition, limits?: CompilerLimits): Diagnostic[];
9
+ //# sourceMappingURL=validate-limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-limits.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAU3D;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,cAAc,GACrB,UAAU,EAAE,CAqFd"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate-references.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,UAAU,EAAE,CA2D7E"}
1
+ {"version":3,"file":"validate-references.d.ts","sourceRoot":"","sources":["../../../src/compiler/passes/validate-references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,UAAU,EAAE,CA0E7E"}
@@ -1,16 +1,30 @@
1
1
  import type { WorkflowDefinition, WorkflowStep } from "../types";
2
+ /** Severity level of a compiler diagnostic. */
2
3
  export type DiagnosticSeverity = "error" | "warning";
4
+ /** Identifies the source location of a diagnostic within the workflow. */
3
5
  export interface DiagnosticLocation {
6
+ /** The step that triggered the diagnostic, or `null` for workflow-level issues. */
4
7
  stepId: string | null;
8
+ /** The field path within the step (e.g. `"params.toolInput.email"`). */
5
9
  field: string;
6
10
  }
7
- export type DiagnosticCode = "INVALID_STEP_ID" | "INVALID_ITEM_NAME" | "ITEM_NAME_SHADOWS_STEP_ID" | "DUPLICATE_STEP_ID" | "MISSING_INITIAL_STEP" | "MISSING_NEXT_STEP" | "MISSING_BRANCH_BODY_STEP" | "MISSING_LOOP_BODY_STEP" | "UNREACHABLE_STEP" | "CYCLE_DETECTED" | "UNCLOSED_TEMPLATE_EXPRESSION" | "JMESPATH_SYNTAX_ERROR" | "JMESPATH_INVALID_ROOT_REFERENCE" | "JMESPATH_FORWARD_REFERENCE" | "END_STEP_HAS_NEXT" | "BRANCH_BODY_ESCAPES" | "LOOP_BODY_ESCAPES" | "MULTIPLE_DEFAULT_CASES" | "UNKNOWN_TOOL" | "MISSING_TOOL_INPUT_KEY" | "EXTRA_TOOL_INPUT_KEY" | "MISSING_START_STEP" | "END_STEP_MISSING_OUTPUT" | "END_STEP_UNEXPECTED_OUTPUT" | "FOREACH_TARGET_NOT_ARRAY";
11
+ /**
12
+ * Machine-readable code identifying the specific diagnostic.
13
+ * Useful for programmatic handling of compiler feedback.
14
+ */
15
+ export type DiagnosticCode = "INVALID_STEP_ID" | "INVALID_ITEM_NAME" | "ITEM_NAME_SHADOWS_STEP_ID" | "DUPLICATE_STEP_ID" | "MISSING_INITIAL_STEP" | "MISSING_NEXT_STEP" | "MISSING_BRANCH_BODY_STEP" | "MISSING_LOOP_BODY_STEP" | "UNREACHABLE_STEP" | "CYCLE_DETECTED" | "UNCLOSED_TEMPLATE_EXPRESSION" | "JMESPATH_SYNTAX_ERROR" | "JMESPATH_INVALID_ROOT_REFERENCE" | "JMESPATH_FORWARD_REFERENCE" | "END_STEP_HAS_NEXT" | "BRANCH_BODY_ESCAPES" | "LOOP_BODY_ESCAPES" | "MULTIPLE_DEFAULT_CASES" | "UNKNOWN_TOOL" | "MISSING_TOOL_INPUT_KEY" | "EXTRA_TOOL_INPUT_KEY" | "MISSING_START_STEP" | "END_STEP_MISSING_OUTPUT" | "END_STEP_UNEXPECTED_OUTPUT" | "PATH_MISSING_END_STEP" | "LITERAL_OUTPUT_SHAPE_MISMATCH" | "FOREACH_TARGET_NOT_ARRAY" | "MISSING_CONDITION_BODY_STEP" | "CONDITION_BODY_ESCAPES" | "SLEEP_DURATION_EXCEEDS_LIMIT" | "WAIT_ATTEMPTS_EXCEEDS_LIMIT" | "WAIT_INTERVAL_EXCEEDS_LIMIT" | "BACKOFF_MULTIPLIER_OUT_OF_RANGE" | "WAIT_TIMEOUT_EXCEEDS_LIMIT";
16
+ /**
17
+ * A structured compiler diagnostic with a severity, location, human-readable message,
18
+ * and machine-readable code. Emitted during compilation to report errors and warnings.
19
+ */
8
20
  export interface Diagnostic {
9
21
  severity: DiagnosticSeverity;
10
22
  location: DiagnosticLocation;
23
+ /** A human-readable description of the issue. */
11
24
  message: string;
12
25
  code: DiagnosticCode;
13
26
  }
27
+ /** JSON Schema representation of a tool's input and output. */
14
28
  export interface ToolSchemaDefinition {
15
29
  inputSchema: {
16
30
  required?: string[];
@@ -18,17 +32,36 @@ export interface ToolSchemaDefinition {
18
32
  };
19
33
  outputSchema?: Record<string, unknown>;
20
34
  }
35
+ /** Maps tool names to their schema definitions. */
21
36
  export type ToolDefinitionMap = Record<string, ToolSchemaDefinition>;
37
+ /**
38
+ * DAG representation of a compiled workflow. Produced by the compiler's graph
39
+ * construction pass when the workflow is structurally valid.
40
+ */
22
41
  export interface ExecutionGraph {
42
+ /** Lookup from step ID to step definition. */
23
43
  stepIndex: Map<string, WorkflowStep>;
44
+ /** Maps each step ID to the set of step IDs it transitions to. */
24
45
  successors: Map<string, Set<string>>;
46
+ /** Maps each step ID to the set of step IDs that transition to it. */
25
47
  predecessors: Map<string, Set<string>>;
48
+ /** Step IDs in topological order (respects data dependencies). */
26
49
  topologicalOrder: string[];
50
+ /** Set of step IDs reachable from `initialStepId`. */
27
51
  reachableSteps: Set<string>;
52
+ /** Maps each step ID to the set of loop variable names in scope at that step. */
28
53
  loopVariablesInScope: Map<string, Set<string>>;
54
+ /** Maps body step IDs to the ID of the for-each or switch-case that owns them. */
29
55
  bodyOwnership: Map<string, string>;
30
56
  }
57
+ /**
58
+ * A narrowed tool schema produced by the compiler showing which inputs are
59
+ * static (known at compile time) vs. dynamic (resolved at runtime). This
60
+ * enables safety reviews: a human can approve a limited set of behaviors
61
+ * before execution begins.
62
+ */
31
63
  export interface ConstrainedToolSchema {
64
+ /** The narrowed input schema, intersecting constraints from all call sites. */
32
65
  inputSchema: {
33
66
  required: string[];
34
67
  properties: Record<string, unknown>;
@@ -39,11 +72,29 @@ export interface ConstrainedToolSchema {
39
72
  /** Step IDs that call this tool. */
40
73
  callSites: string[];
41
74
  }
75
+ /** Maps tool names to their constrained schemas. */
42
76
  export type ConstrainedToolSchemaMap = Record<string, ConstrainedToolSchema>;
77
+ export interface CompilerLimits {
78
+ /** Upper bound for wait-for-condition maxAttempts. Default: Infinity (unbounded). */
79
+ maxAttempts?: number;
80
+ /** Upper bound for sleep durationMs and wait intervalMs in ms. Default: 300_000 (5 min). */
81
+ maxSleepMs?: number;
82
+ /** Upper bound for backoffMultiplier. Default: 2. */
83
+ maxBackoffMultiplier?: number;
84
+ /** Lower bound for backoffMultiplier. Default: 1. */
85
+ minBackoffMultiplier?: number;
86
+ /** Upper bound for wait-for-condition timeoutMs in ms. Default: 600_000 (10 min). */
87
+ maxTimeoutMs?: number;
88
+ }
89
+ /** The result of compiling a workflow definition. */
43
90
  export interface CompilerResult {
91
+ /** Errors and warnings produced during compilation. */
44
92
  diagnostics: Diagnostic[];
93
+ /** The execution graph, or `null` if the workflow has structural errors. */
45
94
  graph: ExecutionGraph | null;
95
+ /** The optimized workflow with best-practice transformations applied, or `null` if there are errors. */
46
96
  workflow: WorkflowDefinition | null;
97
+ /** Constrained tool schemas, or `null` if no tools were provided. */
47
98
  constrainedToolSchemas: ConstrainedToolSchemaMap | null;
48
99
  }
49
100
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compiler/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,cAAc,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,2BAA2B,GAC3B,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,0BAA0B,GAC1B,wBAAwB,GACxB,kBAAkB,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AAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GAClC,MAAM,EAAE,GAAG,IAAI,CA4CjB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC5C,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAClC;IACF,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAqDA"}
@@ -0,0 +1,33 @@
1
+ import type { WorkflowDefinition, WorkflowStep } from "../../types";
2
+ import type { ExecutionGraph, ToolDefinitionMap } from "../types";
3
+ /**
4
+ * Parse a simple dotted JMESPath expression (e.g. "step_id.field.nested")
5
+ * into path segments. Returns null for complex expressions (filters,
6
+ * projections, functions, etc.).
7
+ */
8
+ export declare function parseSimplePath(expression: string): string[] | null;
9
+ /**
10
+ * Walk a JSON Schema along a dotted path, resolving through `properties`
11
+ * at each segment. Returns null if the path can't be resolved.
12
+ */
13
+ export declare function resolvePath(schema: Record<string, unknown>, path: string[]): Record<string, unknown> | null;
14
+ /**
15
+ * Extract the `type` string from a JSON Schema object.
16
+ */
17
+ export declare function getSchemaType(schema: Record<string, unknown>): string | null;
18
+ /**
19
+ * Find property names in a schema that are arrays.
20
+ */
21
+ export declare function findArrayProperties(schema: Record<string, unknown>): string[];
22
+ /**
23
+ * Resolve the output schema of a workflow step. Returns null if the
24
+ * output schema is unknown or can't be determined statically.
25
+ */
26
+ export declare function getStepOutputSchema(step: WorkflowStep, tools: ToolDefinitionMap | null, workflow: WorkflowDefinition, graph: ExecutionGraph): Record<string, unknown> | null;
27
+ /**
28
+ * Resolve a JMESPath output expression to a JSON Schema by tracing
29
+ * through step output schemas. Only handles simple dotted paths.
30
+ * Returns null for complex expressions or when schemas are unavailable.
31
+ */
32
+ export declare function resolveExpressionSchema(expression: string, _endStepId: string, tools: ToolDefinitionMap | null, workflow: WorkflowDefinition, graph: ExecutionGraph): Record<string, unknown> | null;
33
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/compiler/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAKnE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,EAAE,GACZ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAUhC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAG5E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAQ7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,cAAc,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAgChC;AAgCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,cAAc,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAoBhC"}
@@ -0,0 +1,42 @@
1
+ export interface WaitForConditionOptions {
2
+ maxAttempts: number;
3
+ intervalMs: number;
4
+ backoffMultiplier: number;
5
+ timeoutMs?: number;
6
+ }
7
+ /**
8
+ * Injectable execution context for durable execution environments.
9
+ *
10
+ * In a durable environment (AWS Step Functions, Temporal, Inngest, etc.),
11
+ * each `step()` runs in its own execution environment. The workflow code
12
+ * **outside** of `step()` closures re-executes on every resume, so it
13
+ * must be idempotent (pure reads, expression evaluation, scope construction).
14
+ * Code **inside** a `step()` closure runs exactly once — the environment
15
+ * records its result and replays the cached value on subsequent resumes
16
+ * instead of re-executing the function.
17
+ */
18
+ export interface DurableContext {
19
+ /**
20
+ * Wrap a step that should execute exactly once. In durable environments,
21
+ * `fn` runs on the first invocation and its result is persisted; on
22
+ * subsequent resumes the cached result is returned without calling `fn`
23
+ * again. All code outside `step()` must be idempotent because it
24
+ * re-runs on every resume.
25
+ * Default: executes the function directly (passthrough).
26
+ */
27
+ step: (name: string, fn: () => Promise<unknown>) => Promise<unknown>;
28
+ /**
29
+ * Sleep for the given duration. In durable environments,
30
+ * this uses a durable timer that survives process restarts.
31
+ * Default: setTimeout-based promise.
32
+ */
33
+ sleep: (name: string, durationMs: number) => Promise<void>;
34
+ /**
35
+ * Wait for a condition by polling. In durable environments,
36
+ * this might use waitForCallback or durable polling.
37
+ * Default: loop with setTimeout + backoff.
38
+ */
39
+ waitForCondition: (name: string, checkFn: () => Promise<unknown>, options: WaitForConditionOptions) => Promise<unknown>;
40
+ }
41
+ export declare function createDefaultDurableContext(): DurableContext;
42
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/executor/context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;OAOG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAErE;;;;OAIG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;;OAIG;IACH,gBAAgB,EAAE,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC/B,OAAO,EAAE,uBAAuB,KAC5B,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB;AAID,wBAAgB,2BAA2B,IAAI,cAAc,CAuC5D"}
@@ -1,6 +1,21 @@
1
+ /** Strategy for recovering from a step execution error. */
1
2
  export type RecoveryStrategy = "none" | "retry" | "llm-transform" | "llm-reprompt";
3
+ /**
4
+ * High-level category of a step execution error.
5
+ * - `configuration` — the workflow is misconfigured (missing tools, no agent)
6
+ * - `validation` — input or output data doesn't match the expected schema
7
+ * - `external-service` — a tool or LLM call failed
8
+ * - `expression` — a JMESPath or template expression failed to evaluate
9
+ * - `output-quality` — the LLM produced output that couldn't be parsed
10
+ */
2
11
  export type ErrorCategory = "configuration" | "validation" | "external-service" | "expression" | "output-quality";
3
- export type ErrorCode = "TOOL_NOT_FOUND" | "TOOL_MISSING_EXECUTE" | "AGENT_NOT_PROVIDED" | "TOOL_INPUT_VALIDATION_FAILED" | "FOREACH_TARGET_NOT_ARRAY" | "WORKFLOW_OUTPUT_VALIDATION_FAILED" | "TOOL_EXECUTION_FAILED" | "LLM_API_ERROR" | "LLM_RATE_LIMITED" | "LLM_NETWORK_ERROR" | "LLM_NO_CONTENT" | "JMESPATH_EVALUATION_ERROR" | "TEMPLATE_INTERPOLATION_ERROR" | "LLM_OUTPUT_PARSE_ERROR";
12
+ /** Machine-readable error code identifying the specific failure. */
13
+ export type ErrorCode = "TOOL_NOT_FOUND" | "TOOL_MISSING_EXECUTE" | "AGENT_NOT_PROVIDED" | "TOOL_INPUT_VALIDATION_FAILED" | "FOREACH_TARGET_NOT_ARRAY" | "WORKFLOW_OUTPUT_VALIDATION_FAILED" | "TOOL_EXECUTION_FAILED" | "LLM_API_ERROR" | "LLM_RATE_LIMITED" | "LLM_NETWORK_ERROR" | "LLM_NO_CONTENT" | "JMESPATH_EVALUATION_ERROR" | "TEMPLATE_INTERPOLATION_ERROR" | "LLM_OUTPUT_PARSE_ERROR" | "SLEEP_INVALID_DURATION" | "WAIT_CONDITION_TIMEOUT" | "WAIT_CONDITION_MAX_ATTEMPTS" | "EXECUTION_TOTAL_TIMEOUT" | "EXECUTION_ACTIVE_TIMEOUT";
14
+ /**
15
+ * Base error class for all step execution failures. Contains the step ID,
16
+ * error code, error category, and optional cause. All executor error classes
17
+ * extend this.
18
+ */
4
19
  export declare class StepExecutionError extends Error {
5
20
  readonly stepId: string;
6
21
  readonly code: ErrorCode;
@@ -9,22 +24,27 @@ export declare class StepExecutionError extends Error {
9
24
  readonly name = "StepExecutionError";
10
25
  constructor(stepId: string, code: ErrorCode, category: ErrorCategory, message: string, cause?: unknown | undefined);
11
26
  }
27
+ /** Thrown when the workflow is misconfigured (missing tools, missing agent, missing execute function). Not retryable. */
12
28
  export declare class ConfigurationError extends StepExecutionError {
13
29
  constructor(stepId: string, code: ErrorCode, message: string);
14
30
  }
31
+ /** Thrown when input or output data doesn't match the expected schema. Not retryable. */
15
32
  export declare class ValidationError extends StepExecutionError {
16
33
  readonly input: unknown;
17
34
  constructor(stepId: string, code: ErrorCode, message: string, input: unknown, cause?: unknown);
18
35
  }
36
+ /** Thrown when a tool execution or LLM API call fails. May be retryable (check {@link isRetryable}). */
19
37
  export declare class ExternalServiceError extends StepExecutionError {
20
38
  readonly statusCode?: number | undefined;
21
39
  readonly isRetryable: boolean;
22
40
  constructor(stepId: string, code: ErrorCode, message: string, cause?: unknown, statusCode?: number | undefined, isRetryable?: boolean);
23
41
  }
42
+ /** Thrown when a JMESPath expression or template interpolation fails to evaluate. Not retryable. */
24
43
  export declare class ExpressionError extends StepExecutionError {
25
44
  readonly expression: string;
26
45
  constructor(stepId: string, code: ErrorCode, message: string, expression: string, cause?: unknown);
27
46
  }
47
+ /** Thrown when an LLM produces output that can't be parsed as valid JSON. Retryable via automatic retry. */
28
48
  export declare class OutputQualityError extends StepExecutionError {
29
49
  readonly rawOutput: unknown;
30
50
  constructor(stepId: string, code: ErrorCode, message: string, rawOutput: unknown, cause?: unknown);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/executor/errors.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GACzB,MAAM,GACN,OAAO,GACP,eAAe,GACf,cAAc,CAAC;AAElB,MAAM,MAAM,aAAa,GACtB,eAAe,GACf,YAAY,GACZ,kBAAkB,GAClB,YAAY,GACZ,gBAAgB,CAAC;AAEpB,MAAM,MAAM,SAAS,GAElB,gBAAgB,GAChB,sBAAsB,GACtB,oBAAoB,GAEpB,8BAA8B,GAC9B,0BAA0B,GAC1B,mCAAmC,GAEnC,uBAAuB,GACvB,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAEhB,2BAA2B,GAC3B,8BAA8B,GAE9B,wBAAwB,CAAC;AAI5B,qBAAa,kBAAmB,SAAQ,KAAK;aAI3B,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,SAAS;aACf,QAAQ,EAAE,aAAa;aAEd,KAAK,CAAC,EAAE,OAAO;IAPzC,SAAkB,IAAI,wBAAwB;gBAG7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,aAAa,EACvC,OAAO,EAAE,MAA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E,OAAO,EACC,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,WAAW,GAAE,OAAc;CAI5C;AAED,oGAAoG;AACpG,qBAAa,eAAgB,SAAQ,kBAAkB;aAKrC,UAAU,EAAE,MAAM;gBAHlC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,OAAO;CAIhB;AAED,4GAA4G;AAC5G,qBAAa,kBAAmB,SAAQ,kBAAkB;aAKxC,SAAS,EAAE,OAAO;gBAHlC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,MAAM,EACC,SAAS,EAAE,OAAO,EAClC,KAAK,CAAC,EAAE,OAAO;CAIhB"}
@@ -1,20 +1,65 @@
1
1
  import type { Agent, LanguageModel, ToolSet } from "ai";
2
2
  import type { WorkflowDefinition, WorkflowStep } from "../types";
3
+ import { type DurableContext } from "./context";
3
4
  import { StepExecutionError } from "./errors";
5
+ /** The result of executing a workflow. */
4
6
  export interface ExecutionResult {
7
+ /** Whether the workflow completed without errors. */
5
8
  success: boolean;
9
+ /** Map of step ID to that step's output value. */
6
10
  stepOutputs: Record<string, unknown>;
11
+ /** The workflow's final output (from the `end` step's output expression), if any. */
7
12
  output?: unknown;
13
+ /** The error that caused execution to fail, if `success` is `false`. */
8
14
  error?: StepExecutionError;
9
15
  }
16
+ export interface ExecutorLimits {
17
+ /** Max wall-clock time from start to finish, including sleeps/waits. Default: 600_000 (10 min). */
18
+ maxTotalMs?: number;
19
+ /** Max active execution time (inside step() + checkFn, excluding sleeps/waits). Default: 300_000 (5 min). */
20
+ maxActiveMs?: number;
21
+ /** Soft cap on sleep durationMs and wait intervalMs. Clamped silently. Default: 300_000 (5 min). */
22
+ maxSleepMs?: number;
23
+ /** Soft cap on wait-for-condition maxAttempts. Clamped silently. Default: Infinity (unbounded). */
24
+ maxAttempts?: number;
25
+ /** Soft cap on backoffMultiplier upper bound. Clamped silently. Default: 2. */
26
+ maxBackoffMultiplier?: number;
27
+ /** Soft cap on backoffMultiplier lower bound. Clamped silently. Default: 1. */
28
+ minBackoffMultiplier?: number;
29
+ /** Soft cap on wait-for-condition timeoutMs. Clamped silently. Default: 600_000 (10 min). */
30
+ maxTimeoutMs?: number;
31
+ }
32
+ /** Options for {@link executeWorkflow}. */
10
33
  export interface ExecuteWorkflowOptions {
34
+ /** Tool definitions. Every tool referenced by a `tool-call` step must be present with an `execute` function. */
11
35
  tools: ToolSet;
36
+ /** An AI SDK `Agent` or `LanguageModel` for `llm-prompt` and `extract-data` steps. Required if the workflow contains LLM steps. */
12
37
  agent?: Agent | LanguageModel;
38
+ /** Input values passed to the workflow's `start` step. Validated against the start step's `inputSchema`. */
13
39
  inputs?: Record<string, unknown>;
40
+ /** Maximum number of retries for recoverable errors (rate limits, network errors, parse failures). Defaults to 3. */
14
41
  maxRetries?: number;
42
+ /** Base delay in milliseconds for exponential backoff between retries. Defaults to 1000. */
15
43
  retryDelayMs?: number;
44
+ /** Called when a step begins execution. */
16
45
  onStepStart?: (stepId: string, step: WorkflowStep) => void;
46
+ /** Called when a step completes successfully. */
17
47
  onStepComplete?: (stepId: string, output: unknown) => void;
48
+ /** Injectable durable execution context. Default: simple in-process implementation. */
49
+ context?: DurableContext;
50
+ /** Execution limits for sleep/wait/timeout bounds. */
51
+ limits?: ExecutorLimits;
18
52
  }
53
+ /**
54
+ * Executes a compiled workflow by walking its step graph from `initialStepId`.
55
+ *
56
+ * Handles all step types (tool calls, LLM prompts, data extraction, branching,
57
+ * loops) and supports automatic retry with exponential backoff for recoverable
58
+ * errors (rate limits, network failures, LLM parse errors).
59
+ *
60
+ * @param workflow - The workflow definition to execute (should be compiled first via {@link compileWorkflow}).
61
+ * @param options - Execution options including tools, agent, inputs, and callbacks.
62
+ * @returns An {@link ExecutionResult} with success status, all step outputs, and the final workflow output.
63
+ */
19
64
  export declare function executeWorkflow(workflow: WorkflowDefinition, options: ExecuteWorkflowOptions): Promise<ExecutionResult>;
20
65
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAWxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjE,OAAO,EAKN,kBAAkB,EAElB,MAAM,UAAU,CAAC;AAWlB,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAkvBD,wBAAsB,eAAe,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA8D1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,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C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3D,iDAAiD;IACjD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,uFAAuF;IACvF,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,sDAAsD;IACtD,MAAM,CAAC,EAAE,cAAc,CAAC;CACxB;AAk9BD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA0E1B"}
@@ -1,23 +1,54 @@
1
1
  import type { LanguageModel, ToolSet } from "ai";
2
2
  import type { Diagnostic } from "../compiler/types";
3
3
  import type { WorkflowDefinition } from "../types";
4
+ /** Options for {@link generateWorkflow}. */
4
5
  export interface GenerateWorkflowOptions {
6
+ /** The language model to use for generating the workflow. */
5
7
  model: LanguageModel;
8
+ /** Available tools the generated workflow can reference. All tools must have an `outputSchema`. */
6
9
  tools: ToolSet;
10
+ /** Natural language description of the task the workflow should accomplish. */
7
11
  task: string;
12
+ /** Maximum number of generation attempts if the LLM produces invalid workflows. Defaults to 3. */
8
13
  maxRetries?: number;
9
14
  }
15
+ /** The result of generating a workflow via LLM. */
10
16
  export interface GenerateWorkflowResult {
17
+ /** The generated workflow, or `null` if all attempts produced invalid workflows. */
11
18
  workflow: WorkflowDefinition | null;
19
+ /** Diagnostics from the last compilation attempt. */
12
20
  diagnostics: Diagnostic[];
21
+ /** Total number of generation attempts made. */
13
22
  attempts: number;
14
23
  }
24
+ /** Options for {@link createWorkflowGeneratorTool}. */
15
25
  export interface WorkflowGeneratorToolOptions {
26
+ /** The language model to use for generation. */
16
27
  model: LanguageModel;
28
+ /** Available tools the generated workflow can reference. */
17
29
  tools?: ToolSet;
30
+ /** Maximum number of generation attempts. Defaults to 3. */
18
31
  maxRetries?: number;
19
32
  }
33
+ /**
34
+ * Uses an LLM to generate a validated workflow definition from a natural language
35
+ * task description. The LLM produces a workflow via tool call, which is then compiled
36
+ * and validated. If compilation fails, diagnostics are fed back to the LLM for
37
+ * correction, up to `maxRetries` attempts.
38
+ *
39
+ * @param options - Generation options including model, tools, and task description.
40
+ * @returns A {@link GenerateWorkflowResult} with the generated workflow (or null), diagnostics, and attempt count.
41
+ * @throws If any tool in `options.tools` is missing an `outputSchema`.
42
+ */
20
43
  export declare function generateWorkflow(options: GenerateWorkflowOptions): Promise<GenerateWorkflowResult>;
44
+ /**
45
+ * Creates an AI SDK tool that generates validated workflow definitions from
46
+ * natural language task descriptions. Useful for giving an agent the ability
47
+ * to create workflows on the fly.
48
+ *
49
+ * @param options - Configuration including the model and available tools.
50
+ * @returns An AI SDK `tool` that accepts a `{ task: string }` input and returns a {@link GenerateWorkflowResult}.
51
+ */
21
52
  export declare function createWorkflowGeneratorTool(options: WorkflowGeneratorToolOptions): import("ai").Tool<{
22
53
  task: string;
23
54
  }, GenerateWorkflowResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAIjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAUnD,MAAM,WAAW,uBAAuB;IACvC,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BA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AC,sBAAsB,CAAC,CAsDjC;AAID;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,4BAA4B;;2BAiBrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/generator/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAa7E;AAED,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CA8K7E;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAWnE"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/generator/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAa7E;AAED,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAiN7E;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAWnE"}
package/dist/lib.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- export type { CompilerResult, ConstrainedToolSchema, ConstrainedToolSchemaMap, Diagnostic, DiagnosticCode, DiagnosticLocation, DiagnosticSeverity, ExecutionGraph, } from "./compiler";
1
+ export type { CompilerLimits, CompilerResult, ConstrainedToolSchema, ConstrainedToolSchemaMap, Diagnostic, DiagnosticCode, DiagnosticLocation, DiagnosticSeverity, ExecutionGraph, } from "./compiler";
2
2
  export { compileWorkflow } from "./compiler";
3
- export type { ExecuteWorkflowOptions, ExecutionResult } from "./executor";
3
+ export type { ExecuteWorkflowOptions, ExecutionResult, ExecutorLimits, } from "./executor";
4
4
  export { executeWorkflow } from "./executor";
5
+ export type { DurableContext, WaitForConditionOptions, } from "./executor/context";
6
+ export { createDefaultDurableContext } from "./executor/context";
5
7
  export type { ErrorCategory, ErrorCode, RecoveryStrategy, } from "./executor/errors";
6
8
  export { ConfigurationError, ExpressionError, ExternalServiceError, OutputQualityError, StepExecutionError, ValidationError, } from "./executor/errors";
7
9
  export type { GenerateWorkflowOptions, GenerateWorkflowResult, WorkflowGeneratorToolOptions, } from "./generator";
package/dist/lib.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EACX,aAAa,EACb,SAAS,EACT,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACN,6BAA6B,EAC7B,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OA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