footprintjs 0.2.2 → 0.3.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 (68) hide show
  1. package/README.md +137 -41
  2. package/dist/esm/index.js +7 -1
  3. package/dist/esm/lib/builder/FlowChartBuilder.js +72 -91
  4. package/dist/esm/lib/builder/types.js +1 -1
  5. package/dist/esm/lib/contract/defineContract.js +32 -0
  6. package/dist/esm/lib/contract/index.js +18 -0
  7. package/dist/esm/lib/contract/openapi.js +120 -0
  8. package/dist/esm/lib/contract/schema.js +199 -0
  9. package/dist/esm/lib/contract/types.js +9 -0
  10. package/dist/esm/lib/engine/graph/StageNode.js +1 -1
  11. package/dist/esm/lib/engine/handlers/ChildrenExecutor.js +5 -5
  12. package/dist/esm/lib/engine/handlers/ContinuationResolver.js +6 -6
  13. package/dist/esm/lib/engine/handlers/DeciderHandler.js +4 -4
  14. package/dist/esm/lib/engine/handlers/NodeResolver.js +1 -2
  15. package/dist/esm/lib/engine/handlers/RuntimeStructureManager.js +1 -2
  16. package/dist/esm/lib/engine/handlers/SelectorHandler.js +6 -6
  17. package/dist/esm/lib/engine/narrative/ControlFlowNarrativeGenerator.js +13 -18
  18. package/dist/esm/lib/engine/narrative/types.js +1 -1
  19. package/dist/esm/lib/engine/traversal/FlowchartTraverser.js +10 -11
  20. package/dist/esm/lib/engine/types.js +1 -1
  21. package/dist/esm/lib/runner/ExecutionRuntime.js +1 -1
  22. package/dist/esm/types/index.d.ts +4 -0
  23. package/dist/esm/types/lib/builder/FlowChartBuilder.d.ts +17 -10
  24. package/dist/esm/types/lib/builder/types.d.ts +6 -6
  25. package/dist/esm/types/lib/contract/defineContract.d.ts +18 -0
  26. package/dist/esm/types/lib/contract/index.d.ts +14 -0
  27. package/dist/esm/types/lib/contract/openapi.d.ts +12 -0
  28. package/dist/esm/types/lib/contract/schema.d.ts +14 -0
  29. package/dist/esm/types/lib/contract/types.d.ts +94 -0
  30. package/dist/esm/types/lib/engine/graph/StageNode.d.ts +0 -2
  31. package/dist/esm/types/lib/engine/narrative/ControlFlowNarrativeGenerator.d.ts +6 -6
  32. package/dist/esm/types/lib/engine/narrative/types.d.ts +6 -6
  33. package/dist/esm/types/lib/engine/types.d.ts +0 -1
  34. package/dist/esm/types/lib/runner/ExecutionRuntime.d.ts +0 -1
  35. package/dist/index.js +12 -2
  36. package/dist/lib/builder/FlowChartBuilder.js +72 -91
  37. package/dist/lib/builder/types.js +1 -1
  38. package/dist/lib/contract/defineContract.js +36 -0
  39. package/dist/lib/contract/index.js +26 -0
  40. package/dist/lib/contract/openapi.js +124 -0
  41. package/dist/lib/contract/schema.js +205 -0
  42. package/dist/lib/contract/types.js +10 -0
  43. package/dist/lib/engine/graph/StageNode.js +1 -1
  44. package/dist/lib/engine/handlers/ChildrenExecutor.js +5 -5
  45. package/dist/lib/engine/handlers/ContinuationResolver.js +6 -6
  46. package/dist/lib/engine/handlers/DeciderHandler.js +4 -4
  47. package/dist/lib/engine/handlers/NodeResolver.js +1 -2
  48. package/dist/lib/engine/handlers/RuntimeStructureManager.js +1 -2
  49. package/dist/lib/engine/handlers/SelectorHandler.js +6 -6
  50. package/dist/lib/engine/narrative/ControlFlowNarrativeGenerator.js +13 -18
  51. package/dist/lib/engine/narrative/types.js +1 -1
  52. package/dist/lib/engine/traversal/FlowchartTraverser.js +10 -11
  53. package/dist/lib/engine/types.js +1 -1
  54. package/dist/lib/runner/ExecutionRuntime.js +1 -1
  55. package/dist/types/index.d.ts +4 -0
  56. package/dist/types/lib/builder/FlowChartBuilder.d.ts +17 -10
  57. package/dist/types/lib/builder/types.d.ts +6 -6
  58. package/dist/types/lib/contract/defineContract.d.ts +18 -0
  59. package/dist/types/lib/contract/index.d.ts +14 -0
  60. package/dist/types/lib/contract/openapi.d.ts +12 -0
  61. package/dist/types/lib/contract/schema.d.ts +14 -0
  62. package/dist/types/lib/contract/types.d.ts +94 -0
  63. package/dist/types/lib/engine/graph/StageNode.d.ts +0 -2
  64. package/dist/types/lib/engine/narrative/ControlFlowNarrativeGenerator.d.ts +6 -6
  65. package/dist/types/lib/engine/narrative/types.d.ts +6 -6
  66. package/dist/types/lib/engine/types.d.ts +0 -1
  67. package/dist/types/lib/runner/ExecutionRuntime.d.ts +0 -1
  68. package/package.json +1 -1
@@ -28,13 +28,12 @@ export declare class DeciderList<TOut = any, TScope = any> {
28
28
  private readonly deciderDescription?;
29
29
  private readonly branchDescInfo;
30
30
  constructor(builder: FlowChartBuilder<TOut, TScope>, curNode: StageNode<TOut, TScope>, curSpec: SerializedPipelineStructure, parentDescriptionParts?: string[], parentStageDescriptions?: Map<string, string>, reservedStepNumber?: number, deciderDescription?: string);
31
- addFunctionBranch(id: string, name: string, fn?: PipelineStageFunction<TOut, TScope>, displayName?: string, description?: string): DeciderList<TOut, TScope>;
31
+ addFunctionBranch(id: string, name: string, fn?: PipelineStageFunction<TOut, TScope>, description?: string): DeciderList<TOut, TScope>;
32
32
  addSubFlowChartBranch(id: string, subflow: FlowChart<TOut, TScope>, mountName?: string, options?: SubflowMountOptions): DeciderList<TOut, TScope>;
33
33
  addBranchList(branches: Array<{
34
34
  id: string;
35
35
  name: string;
36
36
  fn?: PipelineStageFunction<TOut, TScope>;
37
- displayName?: string;
38
37
  }>): DeciderList<TOut, TScope>;
39
38
  setDefault(id: string): DeciderList<TOut, TScope>;
40
39
  end(): FlowChartBuilder<TOut, TScope>;
@@ -50,13 +49,12 @@ export declare class SelectorFnList<TOut = any, TScope = any> {
50
49
  private readonly selectorDescription?;
51
50
  private readonly branchDescInfo;
52
51
  constructor(builder: FlowChartBuilder<TOut, TScope>, curNode: StageNode<TOut, TScope>, curSpec: SerializedPipelineStructure, parentDescriptionParts?: string[], parentStageDescriptions?: Map<string, string>, reservedStepNumber?: number, selectorDescription?: string);
53
- addFunctionBranch(id: string, name: string, fn?: PipelineStageFunction<TOut, TScope>, displayName?: string, description?: string): SelectorFnList<TOut, TScope>;
52
+ addFunctionBranch(id: string, name: string, fn?: PipelineStageFunction<TOut, TScope>, description?: string): SelectorFnList<TOut, TScope>;
54
53
  addSubFlowChartBranch(id: string, subflow: FlowChart<TOut, TScope>, mountName?: string, options?: SubflowMountOptions): SelectorFnList<TOut, TScope>;
55
54
  addBranchList(branches: Array<{
56
55
  id: string;
57
56
  name: string;
58
57
  fn?: PipelineStageFunction<TOut, TScope>;
59
- displayName?: string;
60
58
  }>): SelectorFnList<TOut, TScope>;
61
59
  end(): FlowChartBuilder<TOut, TScope>;
62
60
  }
@@ -79,16 +77,25 @@ export declare class FlowChartBuilder<TOut = any, TScope = any> {
79
77
  private _stepCounter;
80
78
  private _stageDescriptions;
81
79
  private _stageStepMap;
80
+ private _inputSchema?;
81
+ private _outputSchema?;
82
+ private _outputMapper?;
82
83
  constructor(buildTimeExtractor?: BuildTimeExtractor<any>);
83
84
  private _appendDescriptionLine;
84
85
  private _appendSubflowDescription;
85
86
  setEnableNarrative(): this;
86
87
  setLogger(logger: ILogger): this;
87
- start(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, description?: string): this;
88
- addFunction(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, description?: string): this;
89
- addStreamingFunction(name: string, streamId?: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, description?: string): this;
90
- addDeciderFunction(name: string, fn: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, description?: string): DeciderList<TOut, TScope>;
91
- addSelectorFunction(name: string, fn: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, description?: string): SelectorFnList<TOut, TScope>;
88
+ /** Declare the input schema (readOnlyContext shape). Accepts Zod schema or JSON Schema. */
89
+ setInputSchema(schema: unknown): this;
90
+ /** Declare the output schema (response shape). Accepts Zod schema or JSON Schema. */
91
+ setOutputSchema(schema: unknown): this;
92
+ /** Set the output mapper that extracts the response from final scope. */
93
+ setOutputMapper(mapper: (finalScope: Record<string, unknown>) => unknown): this;
94
+ start(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, description?: string): this;
95
+ addFunction(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, description?: string): this;
96
+ addStreamingFunction(name: string, streamId?: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, description?: string): this;
97
+ addDeciderFunction(name: string, fn: PipelineStageFunction<TOut, TScope>, id?: string, description?: string): DeciderList<TOut, TScope>;
98
+ addSelectorFunction(name: string, fn: PipelineStageFunction<TOut, TScope>, id?: string, description?: string): SelectorFnList<TOut, TScope>;
92
99
  addListOfFunction(children: SimplifiedParallelSpec<TOut, TScope>[], options?: {
93
100
  failFast?: boolean;
94
101
  }): this;
@@ -117,5 +124,5 @@ export declare class FlowChartBuilder<TOut = any, TScope = any> {
117
124
  root: StageNode<TOut, TScope>;
118
125
  }> | undefined, prefix: string): void;
119
126
  }
120
- export declare function flowChart<TOut = any, TScope = any>(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, displayName?: string, buildTimeExtractor?: BuildTimeExtractor<any>, description?: string): FlowChartBuilder<TOut, TScope>;
127
+ export declare function flowChart<TOut = any, TScope = any>(name: string, fn?: PipelineStageFunction<TOut, TScope>, id?: string, buildTimeExtractor?: BuildTimeExtractor<any>, description?: string): FlowChartBuilder<TOut, TScope>;
121
128
  export declare function specToStageNode(spec: FlowChartSpec): StageNode<any, any>;
@@ -40,8 +40,6 @@ export type StageNode<TOut = any, TScope = any> = {
40
40
  name: string;
41
41
  /** Optional stable id (required by decider/fork aggregation). */
42
42
  id?: string;
43
- /** Human-readable display name for UI. */
44
- displayName?: string;
45
43
  /** Human-readable description of what this stage does. */
46
44
  description?: string;
47
45
  /** Linear continuation. */
@@ -77,7 +75,6 @@ export interface SerializedPipelineStructure {
77
75
  name: string;
78
76
  id?: string;
79
77
  type: 'stage' | 'decider' | 'fork' | 'streaming';
80
- displayName?: string;
81
78
  description?: string;
82
79
  children?: SerializedPipelineStructure[];
83
80
  next?: SerializedPipelineStructure;
@@ -98,7 +95,6 @@ export interface SerializedPipelineStructure {
98
95
  export interface FlowChartSpec {
99
96
  name: string;
100
97
  id?: string;
101
- displayName?: string;
102
98
  description?: string;
103
99
  children?: FlowChartSpec[];
104
100
  next?: FlowChartSpec;
@@ -130,11 +126,16 @@ export type FlowChart<TOut = any, TScope = any> = {
130
126
  logger?: ILogger;
131
127
  description: string;
132
128
  stageDescriptions: Map<string, string>;
129
+ /** Input schema (Zod or JSON Schema) — declared via setInputSchema(). */
130
+ inputSchema?: unknown;
131
+ /** Output schema (Zod or JSON Schema) — declared via setOutputSchema(). */
132
+ outputSchema?: unknown;
133
+ /** Output mapper — extracts response from final scope. */
134
+ outputMapper?: (finalScope: Record<string, unknown>) => unknown;
133
135
  };
134
136
  export type SimplifiedParallelSpec<TOut = any, TScope = any> = {
135
137
  id: string;
136
138
  name: string;
137
- displayName?: string;
138
139
  fn?: PipelineStageFunction<TOut, TScope>;
139
140
  };
140
141
  export type ExecOptions = {
@@ -148,5 +149,4 @@ export type ExecOptions = {
148
149
  export interface SubflowRef {
149
150
  $ref: string;
150
151
  mountId: string;
151
- displayName?: string;
152
152
  }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * contract/defineContract.ts — Factory for creating a FlowChartContract.
3
+ *
4
+ * Wraps a compiled FlowChart with I/O schemas and an output mapper,
5
+ * using the same pattern as SubflowMountOptions (inputMapper/outputMapper).
6
+ *
7
+ * Usage:
8
+ * const contract = defineContract(chart, {
9
+ * inputSchema: z.object({ name: z.string() }),
10
+ * outputSchema: z.object({ greeting: z.string() }),
11
+ * outputMapper: (scope) => ({ greeting: scope.message as string }),
12
+ * });
13
+ *
14
+ * const openapi = contract.toOpenAPI();
15
+ */
16
+ import type { FlowChart } from '../builder/types';
17
+ import type { FlowChartContract, FlowChartContractOptions } from './types';
18
+ export declare function defineContract<TInput = unknown, TOutput = unknown>(chart: FlowChart, options: FlowChartContractOptions<TInput, TOutput>): FlowChartContract<TInput, TOutput>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * contract/ — FlowChart I/O contract and OpenAPI generation layer.
3
+ *
4
+ * Standalone library: wraps a compiled FlowChart with input/output schemas
5
+ * and generates OpenAPI 3.1 specs. Uses the same inputMapper/outputMapper
6
+ * pattern as subflow mounting.
7
+ *
8
+ * Zero runtime deps on Zod — Zod schemas detected via duck-typing and
9
+ * converted to JSON Schema at contract creation time.
10
+ */
11
+ export { defineContract } from './defineContract';
12
+ export { isZodSchema, normalizeSchema, zodToJsonSchema } from './schema';
13
+ export { generateOpenAPI } from './openapi';
14
+ export type { FlowChartContract, FlowChartContractOptions, JsonSchema, OpenAPIOptions, OpenAPISpec, SchemaInput, } from './types';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * contract/openapi.ts — OpenAPI 3.1 spec generator.
3
+ *
4
+ * Generates an OpenAPI spec from a FlowChartContract by combining:
5
+ * - chart.description → operation description
6
+ * - chart.stageDescriptions → step-by-step detail
7
+ * - inputSchema → requestBody
8
+ * - outputSchema → response
9
+ * - chart.buildTimeStructure → operation metadata (branches, forks, etc.)
10
+ */
11
+ import type { FlowChartContract, OpenAPIOptions, OpenAPISpec } from './types';
12
+ export declare function generateOpenAPI(contract: FlowChartContract, options?: OpenAPIOptions): OpenAPISpec;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * contract/schema.ts — Schema normalization utilities.
3
+ *
4
+ * Converts Zod schemas or raw JSON Schema objects into a normalized
5
+ * JsonSchema format. Zod detection uses duck-typing (checks for `_def`).
6
+ *
7
+ * Standalone: no dependency on Zod at import time.
8
+ * Compatible with Zod v4 internals.
9
+ */
10
+ import type { JsonSchema, SchemaInput } from './types';
11
+ export declare function isZodSchema(input: unknown): boolean;
12
+ /** Convert a Zod schema object to JSON Schema. */
13
+ export declare function zodToJsonSchema(zodSchema: Record<string, unknown>): JsonSchema;
14
+ export declare function normalizeSchema(input: SchemaInput): JsonSchema;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * contract/types.ts — Types for the FlowChart contract layer.
3
+ *
4
+ * Defines the I/O boundary for a flowchart: input schema, output schema,
5
+ * and output mapper. Uses the same pattern as SubflowMountOptions
6
+ * (inputMapper/outputMapper) but at the top-level flowchart boundary.
7
+ */
8
+ import type { FlowChart } from '../builder/types';
9
+ export type JsonSchema = {
10
+ type?: string | string[];
11
+ properties?: Record<string, JsonSchema>;
12
+ required?: string[];
13
+ items?: JsonSchema;
14
+ enum?: unknown[];
15
+ description?: string;
16
+ default?: unknown;
17
+ format?: string;
18
+ additionalProperties?: boolean | JsonSchema;
19
+ oneOf?: JsonSchema[];
20
+ anyOf?: JsonSchema[];
21
+ allOf?: JsonSchema[];
22
+ $ref?: string;
23
+ [key: string]: unknown;
24
+ };
25
+ /** Anything with a `def` (Zod v4) or `_def` (Zod v3) property is treated as a Zod schema. */
26
+ export type SchemaInput = JsonSchema | {
27
+ def: unknown;
28
+ [key: string]: unknown;
29
+ };
30
+ export interface FlowChartContractOptions<TInput = unknown, TOutput = unknown> {
31
+ /** Schema describing the input (readOnlyContext) shape. Zod or JSON Schema. */
32
+ inputSchema?: SchemaInput;
33
+ /** Schema describing the output shape. Zod or JSON Schema. */
34
+ outputSchema?: SchemaInput;
35
+ /** Maps the final scope state into the response shape. */
36
+ outputMapper?: (finalScope: Record<string, unknown>) => TOutput;
37
+ }
38
+ export interface FlowChartContract<TInput = unknown, TOutput = unknown> {
39
+ /** The compiled flowchart. */
40
+ chart: FlowChart;
41
+ /** JSON Schema for the input (normalized from Zod or raw). */
42
+ inputSchema?: JsonSchema;
43
+ /** JSON Schema for the output (normalized from Zod or raw). */
44
+ outputSchema?: JsonSchema;
45
+ /** Maps the final scope state into the response shape. */
46
+ outputMapper?: (finalScope: Record<string, unknown>) => TOutput;
47
+ /** Auto-generated OpenAPI spec. */
48
+ toOpenAPI(options?: OpenAPIOptions): OpenAPISpec;
49
+ }
50
+ export interface OpenAPIOptions {
51
+ /** API version string (default: "1.0.0"). */
52
+ version?: string;
53
+ /** Base path prefix (default: "/"). */
54
+ basePath?: string;
55
+ /** HTTP method for the execute endpoint (default: "post"). */
56
+ method?: string;
57
+ }
58
+ export interface OpenAPISpec {
59
+ openapi: '3.1.0';
60
+ info: {
61
+ title: string;
62
+ description: string;
63
+ version: string;
64
+ };
65
+ paths: Record<string, Record<string, OpenAPIOperation>>;
66
+ components?: {
67
+ schemas?: Record<string, JsonSchema>;
68
+ };
69
+ }
70
+ export interface OpenAPIOperation {
71
+ operationId: string;
72
+ summary: string;
73
+ description: string;
74
+ requestBody?: {
75
+ required: boolean;
76
+ content: {
77
+ 'application/json': {
78
+ schema: JsonSchema | {
79
+ $ref: string;
80
+ };
81
+ };
82
+ };
83
+ };
84
+ responses: Record<string, {
85
+ description: string;
86
+ content?: {
87
+ 'application/json': {
88
+ schema: JsonSchema | {
89
+ $ref: string;
90
+ };
91
+ };
92
+ };
93
+ }>;
94
+ }
@@ -23,8 +23,6 @@ export type StageNode<TOut = any, TScope = any> = {
23
23
  name: string;
24
24
  /** Optional stable id (required by decider/fork aggregation) */
25
25
  id?: string;
26
- /** Human-readable display name for UI */
27
- displayName?: string;
28
26
  /** Description of what this stage does. Used for narrative and tool descriptions. */
29
27
  description?: string;
30
28
  /** Linear continuation (linked list next pointer) */
@@ -14,16 +14,16 @@ import type { IControlFlowNarrative } from './types';
14
14
  export declare class ControlFlowNarrativeGenerator implements IControlFlowNarrative {
15
15
  private sentences;
16
16
  private isFirstStage;
17
- onStageExecuted(stageName: string, displayName?: string, description?: string): void;
18
- onNext(fromStage: string, toStage: string, toDisplayName?: string, description?: string): void;
19
- onDecision(deciderName: string, chosenBranch: string, chosenDisplayName?: string, rationale?: string, deciderDescription?: string): void;
17
+ onStageExecuted(stageName: string, description?: string): void;
18
+ onNext(fromStage: string, toStage: string, description?: string): void;
19
+ onDecision(deciderName: string, chosenBranch: string, rationale?: string, deciderDescription?: string): void;
20
20
  onFork(parentStage: string, childNames: string[]): void;
21
21
  onSelected(parentStage: string, selectedNames: string[], totalCount: number): void;
22
22
  onSubflowEntry(subflowName: string): void;
23
23
  onSubflowExit(subflowName: string): void;
24
- onLoop(targetStage: string, targetDisplayName: string | undefined, iteration: number, description?: string): void;
25
- onBreak(stageName: string, displayName?: string): void;
26
- onError(stageName: string, errorMessage: string, displayName?: string): void;
24
+ onLoop(targetStage: string, iteration: number, description?: string): void;
25
+ onBreak(stageName: string): void;
26
+ onError(stageName: string, errorMessage: string): void;
27
27
  /** Returns a defensive copy of accumulated sentences. */
28
28
  getSentences(): string[];
29
29
  }
@@ -9,11 +9,11 @@
9
9
  */
10
10
  export interface IControlFlowNarrative {
11
11
  /** Called when a stage executes. First stage uses distinct opening pattern. */
12
- onStageExecuted(stageName: string, displayName?: string, description?: string): void;
12
+ onStageExecuted(stageName: string, description?: string): void;
13
13
  /** Called on linear continuation from one stage to the next. */
14
- onNext(fromStage: string, toStage: string, toDisplayName?: string, description?: string): void;
14
+ onNext(fromStage: string, toStage: string, description?: string): void;
15
15
  /** Called when a decider selects a branch. Most valuable for LLM context. */
16
- onDecision(deciderName: string, chosenBranch: string, chosenDisplayName?: string, rationale?: string, deciderDescription?: string): void;
16
+ onDecision(deciderName: string, chosenBranch: string, rationale?: string, deciderDescription?: string): void;
17
17
  /** Called when a fork executes all children in parallel. */
18
18
  onFork(parentStage: string, childNames: string[]): void;
19
19
  /** Called when a selector picks a subset of children. */
@@ -23,11 +23,11 @@ export interface IControlFlowNarrative {
23
23
  /** Called when exiting a subflow. */
24
24
  onSubflowExit(subflowName: string): void;
25
25
  /** Called on loop iteration (back-edge traversal). */
26
- onLoop(targetStage: string, targetDisplayName: string | undefined, iteration: number, description?: string): void;
26
+ onLoop(targetStage: string, iteration: number, description?: string): void;
27
27
  /** Called when a stage triggers break (early termination). */
28
- onBreak(stageName: string, displayName?: string): void;
28
+ onBreak(stageName: string): void;
29
29
  /** Called when a stage throws an error. */
30
- onError(stageName: string, errorMessage: string, displayName?: string): void;
30
+ onError(stageName: string, errorMessage: string): void;
31
31
  /** Returns accumulated narrative sentences in execution order. */
32
32
  getSentences(): string[];
33
33
  }
@@ -169,7 +169,6 @@ export interface SerializedPipelineNode {
169
169
  name: string;
170
170
  id?: string;
171
171
  type?: 'stage' | 'decider' | 'fork' | 'streaming' | 'loop' | 'user' | 'tool' | 'function' | 'sequence';
172
- displayName?: string;
173
172
  description?: string;
174
173
  children?: SerializedPipelineNode[];
175
174
  next?: SerializedPipelineNode;
@@ -16,7 +16,6 @@ import type { CommitBundle, FlowMessage, StageSnapshot } from '../memory/types';
16
16
  export interface NarrativeEntry {
17
17
  stageId: string;
18
18
  stageName: string;
19
- displayName?: string;
20
19
  stageMessages: string[];
21
20
  flowMessage?: FlowMessage;
22
21
  timeIndex: number;
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * import from 'footprint/advanced'.
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.CombinedNarrativeBuilder = exports.defineScopeFromZod = exports.NarrativeRecorder = exports.DebugRecorder = exports.MetricRecorder = exports.ScopeFacade = exports.FlowChartExecutor = exports.FlowChartBuilder = exports.flowChart = void 0;
13
+ exports.generateOpenAPI = exports.zodToJsonSchema = exports.normalizeSchema = exports.defineContract = exports.CombinedNarrativeBuilder = exports.defineScopeFromZod = exports.NarrativeRecorder = exports.DebugRecorder = exports.MetricRecorder = exports.ScopeFacade = exports.FlowChartExecutor = exports.FlowChartBuilder = exports.flowChart = void 0;
14
14
  var builder_1 = require("./lib/builder");
15
15
  Object.defineProperty(exports, "flowChart", { enumerable: true, get: function () { return builder_1.flowChart; } });
16
16
  Object.defineProperty(exports, "FlowChartBuilder", { enumerable: true, get: function () { return builder_1.FlowChartBuilder; } });
@@ -36,4 +36,14 @@ var scope_5 = require("./lib/scope");
36
36
  Object.defineProperty(exports, "defineScopeFromZod", { enumerable: true, get: function () { return scope_5.defineScopeFromZod; } });
37
37
  var engine_1 = require("./lib/engine");
38
38
  Object.defineProperty(exports, "CombinedNarrativeBuilder", { enumerable: true, get: function () { return engine_1.CombinedNarrativeBuilder; } });
39
- //# s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RhYmxlIHRyYWNlLlxuICpcbiAqIEZvciBhZHZhbmNlZC9pbnRlcm5hbCBBUElzIChtZW1vcnkgcHJpbWl0aXZlcywgZW5naW5lIGhhbmRsZXJzLCBwcm92aWRlcnMpLFxuICogaW1wb3J0IGZyb20gJ2Zvb3RwcmludC9hZHZhbmNlZCcuXG4gKi9cblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gQnVpbGRlciDigJQgRmxvd2NoYXJ0IGNvbnN0cnVjdGlvblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgdHlwZSB7IEZsb3dDaGFydCwgUGlwZWxpbmVTdGFnZUZ1bmN0aW9uIGFzIFN0YWdlSGFuZGxlciwgU3RyZWFtSGFuZGxlcnMgfSBmcm9tICcuL2xpYi9idWlsZGVyJztcbmV4cG9ydCB7IGZsb3dDaGFydCwgRmxvd0NoYXJ0QnVpbGRlciB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBSdW5uZXIg4oCUIEV4ZWN1dGlvbiBjb252ZW5pZW5jZSBsYXllclxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgeyBGbG93Q2hhcnRFeGVjdXRvciB9IGZyb20gJy4vbGliL3J1bm5lcic7XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIFNjb3BlIOKAlCBQZXItc3RhZ2UgZmFjYWRlcyBhbmQgcmVjb3JkZXJzXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCB7IFNjb3BlRmFjYWRlIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuXG4vLyBSZWNvcmRlcnNcbmV4cG9ydCB7IE1ldHJpY1JlY29yZGVyIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuZXhwb3J0IHsgRGVidWdSZWNvcmRlciB9IGZyb20gJy4vbGliL3Njb3BlJztcbmV4cG9ydCB7IE5hcnJhdGl2ZVJlY29yZGVyIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuXG4vLyBSZWNvcmRlciBpbnRlcmZhY2UgYW5kIGNvcmUgZXZlbnQgdHlwZXMgKG5lZWRlZCB0byBpbXBsZW1lbnQgY3VzdG9tIFJlY29yZGVyKVxuZXhwb3J0IHR5cGUgeyBDb21taXRFdmVudCwgRXJyb3JFdmVudCwgUmVhZEV2ZW50LCBSZWNvcmRlciwgV3JpdGVFdmVudCB9IGZyb20gJy4vbGliL3Njb3BlJztcblxuLy8gWm9kLWJhc2VkIHNjb3BlIGRlZmluaXRpb25zXG5leHBvcnQgeyBkZWZpbmVTY29wZUZyb21ab2QgfSBmcm9tICcuL2xpYi9zY29wZSc7XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIEVuZ2luZSDigJQgTmFycmF0aXZlIChjb21tb25seSB1c2VkKVxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgdHlwZSB7IENvbWJpbmVkTmFycmF0aXZlRW50cnkgfSBmcm9tICcuL2xpYi9lbmdpbmUnO1xuZXhwb3J0IHsgQ29tYmluZWROYXJyYXRpdmVCdWlsZGVyIH0gZnJvbSAnLi9saWIvZW5naW5lJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gTWVtb3J5IOKAlCBTY29wZUZhY3RvcnkgdHlwZSAobmVlZGVkIGZvciBGbG93Q2hhcnRFeGVjdXRvciBjb25zdHJ1Y3Rvcilcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IHR5cGUgeyBSdW5PcHRpb25zIH0gZnJvbSAnLi9saWIvZW5naW5lJztcbmV4cG9ydCB0eXBlIHsgU2NvcGVGYWN0b3J5IH0gZnJvbSAnLi9saWIvbWVtb3J5JztcbiJdfQ==
39
+ // ============================================================================
40
+ // Contract — I/O boundary, schemas, and OpenAPI generation
41
+ // ============================================================================
42
+ var contract_1 = require("./lib/contract");
43
+ Object.defineProperty(exports, "defineContract", { enumerable: true, get: function () { return contract_1.defineContract; } });
44
+ var contract_2 = require("./lib/contract");
45
+ Object.defineProperty(exports, "normalizeSchema", { enumerable: true, get: function () { return contract_2.normalizeSchema; } });
46
+ Object.defineProperty(exports, "zodToJsonSchema", { enumerable: true, get: function () { return contract_2.zodToJsonSchema; } });
47
+ var contract_3 = require("./lib/contract");
48
+ Object.defineProperty(exports, "generateOpenAPI", { enumerable: true, get: function () { return contract_3.generateOpenAPI; } });
49
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7R0FTRzs7O0FBT0gseUNBQTREO0FBQW5ELG9HQUFBLFNBQVMsT0FBQTtBQUFFLDJHQUFBLGdCQUF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ICpcbiAqIEZvciBhZHZhbmNlZC9pbnRlcm5hbCBBUElzIChtZW1vcnkgcHJpbWl0aXZlcywgZW5naW5lIGhhbmRsZXJzLCBwcm92aWRlcnMpLFxuICogaW1wb3J0IGZyb20gJ2Zvb3RwcmludC9hZHZhbmNlZCcuXG4gKi9cblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gQnVpbGRlciDigJQgRmxvd2NoYXJ0IGNvbnN0cnVjdGlvblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgdHlwZSB7IEZsb3dDaGFydCwgUGlwZWxpbmVTdGFnZUZ1bmN0aW9uIGFzIFN0YWdlSGFuZGxlciwgU3RyZWFtSGFuZGxlcnMgfSBmcm9tICcuL2xpYi9idWlsZGVyJztcbmV4cG9ydCB7IGZsb3dDaGFydCwgRmxvd0NoYXJ0QnVpbGRlciB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBSdW5uZXIg4oCUIEV4ZWN1dGlvbiBjb252ZW5pZW5jZSBsYXllclxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgeyBGbG93Q2hhcnRFeGVjdXRvciB9IGZyb20gJy4vbGliL3J1bm5lcic7XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIFNjb3BlIOKAlCBQZXItc3RhZ2UgZmFjYWRlcyBhbmQgcmVjb3JkZXJzXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCB7IFNjb3BlRmFjYWRlIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuXG4vLyBSZWNvcmRlcnNcbmV4cG9ydCB7IE1ldHJpY1JlY29yZGVyIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuZXhwb3J0IHsgRGVidWdSZWNvcmRlciB9IGZyb20gJy4vbGliL3Njb3BlJztcbmV4cG9ydCB7IE5hcnJhdGl2ZVJlY29yZGVyIH0gZnJvbSAnLi9saWIvc2NvcGUnO1xuXG4vLyBSZWNvcmRlciBpbnRlcmZhY2UgYW5kIGNvcmUgZXZlbnQgdHlwZXMgKG5lZWRlZCB0byBpbXBsZW1lbnQgY3VzdG9tIFJlY29yZGVyKVxuZXhwb3J0IHR5cGUgeyBDb21taXRFdmVudCwgRXJyb3JFdmVudCwgUmVhZEV2ZW50LCBSZWNvcmRlciwgV3JpdGVFdmVudCB9IGZyb20gJy4vbGliL3Njb3BlJztcblxuLy8gWm9kLWJhc2VkIHNjb3BlIGRlZmluaXRpb25zXG5leHBvcnQgeyBkZWZpbmVTY29wZUZyb21ab2QgfSBmcm9tICcuL2xpYi9zY29wZSc7XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIEVuZ2luZSDigJQgTmFycmF0aXZlIChjb21tb25seSB1c2VkKVxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgdHlwZSB7IENvbWJpbmVkTmFycmF0aXZlRW50cnkgfSBmcm9tICcuL2xpYi9lbmdpbmUnO1xuZXhwb3J0IHsgQ29tYmluZWROYXJyYXRpdmVCdWlsZGVyIH0gZnJvbSAnLi9saWIvZW5naW5lJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gTWVtb3J5IOKAlCBTY29wZUZhY3RvcnkgdHlwZSAobmVlZGVkIGZvciBGbG93Q2hhcnRFeGVjdXRvciBjb25zdHJ1Y3Rvcilcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IHR5cGUgeyBSdW5PcHRpb25zIH0gZnJvbSAnLi9saWIvZW5naW5lJztcbmV4cG9ydCB0eXBlIHsgU2NvcGVGYWN0b3J5IH0gZnJvbSAnLi9saWIvbWVtb3J5JztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gQ29udHJhY3Qg4oCUIEkvTyBib3VuZGFyeSwgc2NoZW1hcywgYW5kIE9wZW5BUEkgZ2VuZXJhdGlvblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgeyBkZWZpbmVDb250cmFjdCB9IGZyb20gJy4vbGliL2NvbnRyYWN0JztcbmV4cG9ydCB7IG5vcm1hbGl6ZVNjaGVtYSwgem9kVG9Kc29uU2NoZW1hIH0gZnJvbSAnLi9saWIvY29udHJhY3QnO1xuZXhwb3J0IHsgZ2VuZXJhdGVPcGVuQVBJIH0gZnJvbSAnLi9saWIvY29udHJhY3QnO1xuZXhwb3J0IHR5cGUge1xuICBGbG93Q2hhcnRDb250cmFjdCxcbiAgRmxvd0NoYXJ0Q29udHJhY3RPcHRpb25zLFxuICBKc29uU2NoZW1hLFxuICBPcGVuQVBJT3B0aW9ucyxcbiAgT3BlbkFQSVNwZWMsXG59IGZyb20gJy4vbGliL2NvbnRyYWN0JztcbiJdfQ==