@ankhorage/contracts 26.6.0 → 26.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/contracts
2
2
 
3
+ ## 26.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 63ff295: Add portable Flow graph, execution, approval, data-reference, secret-reference, and provider-capability contracts through the `@ankhorage/contracts/flow` public subpath.
8
+
3
9
  ## 26.6.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/contracts
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v26.6.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v26.7.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Serializable app, capability, binding, theme, auth, and secret-store contracts for Ankhorage.
9
9
 
package/dist/flow.d.ts ADDED
@@ -0,0 +1,239 @@
1
+ import type { DataSchemaSlot } from './data/schemas.js';
2
+ import type { DataContractValue } from './data/values.js';
3
+ import type { SecretRef } from './secrets.js';
4
+ export type FlowId = string;
5
+ export type FlowNodeId = string;
6
+ export type FlowPortId = string;
7
+ export type FlowEdgeId = string;
8
+ export type FlowRunId = string;
9
+ export type FlowStepId = string;
10
+ export type FlowArtifactId = string;
11
+ export type FlowProviderCapabilityId = string;
12
+ /** A serializable reference to a provider-owned flow capability. */
13
+ export interface FlowProviderCapabilityRef {
14
+ readonly providerId: string;
15
+ readonly capabilityId: FlowProviderCapabilityId;
16
+ }
17
+ /** A persisted artifact reference for data too large or unsuitable for inline graph data. */
18
+ export interface FlowArtifactRef {
19
+ readonly kind: 'artifact';
20
+ readonly artifactId: FlowArtifactId;
21
+ readonly mediaType?: string;
22
+ readonly byteLength?: number;
23
+ readonly checksum?: string;
24
+ }
25
+ /*** A schema-agnostic inline data reference.
26
+ *
27
+ * Inline values are ordinary non-secret data. Consumers must reject a value at a credential
28
+ * configuration position and require a `FlowSecretRef` there; TypeScript cannot prove that
29
+ * invariant after JSON has crossed a trust boundary.
30
+ */
31
+ export interface FlowInlineDataRef {
32
+ readonly kind: 'inline';
33
+ readonly value: DataContractValue;
34
+ }
35
+ /** A schema-agnostic data reference exchanged by node ports, runs, and traces. */
36
+ export type FlowDataRef = FlowArtifactRef | FlowInlineDataRef;
37
+ /*** A secret-store reference that deliberately excludes secret material.
38
+ *
39
+ * @security flow.test.ts#accepts secret references but excludes inline secret material from their contract
40
+ *
41
+ * Credential configuration must use this reference. Flow consumers must validate provider
42
+ * configuration at their boundary, reject inline credentials, and redact secrets from errors and
43
+ * traces. This portable DTO cannot determine which arbitrary provider fields are credentials, so
44
+ * it provides no runtime validation and makes no static guarantee for untyped JSON.
45
+ */
46
+ export interface FlowSecretRef {
47
+ readonly kind: 'secret';
48
+ readonly ref: SecretRef;
49
+ }
50
+ /*** JSON-safe node configuration references.
51
+ *
52
+ * A configuration value is always explicitly either non-secret data or a secret-store reference;
53
+ * raw JSON values are intentionally not accepted. Provider consumers own validation of the
54
+ * declared configuration shape and credential positions before execution.
55
+ */
56
+ export type FlowNodeConfigValue = FlowDataRef | FlowSecretRef;
57
+ export type FlowNodeConfig = Readonly<Record<string, FlowNodeConfigValue>>;
58
+ /** A typed node port. Direction determines whether a node consumes or produces the port value. */
59
+ export interface FlowPortDescriptor {
60
+ readonly id: FlowPortId;
61
+ readonly direction: 'input' | 'output';
62
+ readonly label?: string;
63
+ readonly description?: string;
64
+ readonly required?: boolean;
65
+ readonly data?: DataSchemaSlot;
66
+ }
67
+ /** One provider-backed executable step within a portable flow graph. */
68
+ export interface FlowNode {
69
+ readonly id: FlowNodeId;
70
+ readonly capability: FlowProviderCapabilityRef;
71
+ readonly label?: string;
72
+ readonly config?: FlowNodeConfig;
73
+ readonly ports: readonly FlowPortDescriptor[];
74
+ }
75
+ /*** A condition declared on an edge without embedding executable expressions.
76
+ *
77
+ * A `value` condition evaluates `path` as an RFC 6901 JSON Pointer against the source port's
78
+ * JSON value; the empty string denotes the complete value. Missing-pointer evaluation does not
79
+ * match. `equals` uses JSON structural equality: values have the same type and recursive array
80
+ * order and object member/value pairs, independent of object member order. Engines must not use
81
+ * coercion, locale comparison, or executable expressions.
82
+ */
83
+ export type FlowEdgeCondition = {
84
+ readonly kind: 'always';
85
+ } | {
86
+ readonly kind: 'outcome';
87
+ readonly outcome: 'failure' | 'success';
88
+ } | {
89
+ readonly kind: 'value';
90
+ readonly path: string;
91
+ readonly equals: DataContractValue;
92
+ };
93
+ /** A directed connection from one output port to one input port. */
94
+ export interface FlowEdge {
95
+ readonly id: FlowEdgeId;
96
+ readonly source: {
97
+ readonly nodeId: FlowNodeId;
98
+ readonly portId: FlowPortId;
99
+ };
100
+ readonly target: {
101
+ readonly nodeId: FlowNodeId;
102
+ readonly portId: FlowPortId;
103
+ };
104
+ readonly condition?: FlowEdgeCondition;
105
+ }
106
+ /*** A portable trigger declaration; runtime scheduling and delivery remain provider-owned.
107
+ *
108
+ * A schedule uses a five-field POSIX cron expression: minute, hour, day of month, month, and day
109
+ * of week. Seconds, years, macros, and implementation-specific extensions are invalid. `timezone`
110
+ * is an IANA time-zone name and defaults to `Etc/UTC`. Match it against local wall-clock time; a
111
+ * spring-forward nonexistent local time is skipped and each occurrence of a repeated local time
112
+ * during a fall-back transition fires separately. When both day-of-month and day-of-week are
113
+ * restricted, either match is sufficient, following POSIX cron semantics.
114
+ */
115
+ export type FlowTrigger = {
116
+ readonly id: string;
117
+ readonly kind: 'manual';
118
+ } | {
119
+ readonly id: string;
120
+ readonly kind: 'schedule';
121
+ readonly cron: string;
122
+ readonly timezone?: string;
123
+ } | {
124
+ readonly id: string;
125
+ readonly kind: 'event';
126
+ readonly capability: FlowProviderCapabilityRef;
127
+ readonly event: string;
128
+ } | {
129
+ readonly id: string;
130
+ readonly kind: 'webhook';
131
+ readonly path: string;
132
+ };
133
+ /** An immutable revision of a portable workflow graph. */
134
+ export interface FlowDefinition {
135
+ readonly id: FlowId;
136
+ readonly version: number;
137
+ readonly title: string;
138
+ readonly description?: string;
139
+ readonly nodes: readonly FlowNode[];
140
+ readonly edges: readonly FlowEdge[];
141
+ readonly triggers: readonly FlowTrigger[];
142
+ }
143
+ /** An immutable workflow revision reference. */
144
+ export interface FlowDefinitionRef {
145
+ readonly id: FlowId;
146
+ readonly version: number;
147
+ }
148
+ export type FlowExecutionStatus = 'cancelled' | 'failed' | 'pending' | 'running' | 'succeeded' | 'timed_out' | 'waiting_for_approval';
149
+ /** A portable error observation that never carries a host Error object. */
150
+ export interface FlowError {
151
+ readonly code: string;
152
+ readonly message: string;
153
+ readonly retryable: boolean;
154
+ readonly details?: FlowDataRef;
155
+ }
156
+ /** A redaction-safe trace observation emitted by a run or step. */
157
+ export interface FlowTraceEvent {
158
+ readonly timestamp: string;
159
+ readonly level: 'debug' | 'error' | 'info' | 'warn';
160
+ readonly message: string;
161
+ readonly attributes?: Readonly<Record<string, DataContractValue>>;
162
+ }
163
+ /*** A durable snapshot of one execution attempt for a graph node.
164
+ *
165
+ * `attempt` is a one-based, monotonically increasing number for this run and node. A retry has a
166
+ * new step snapshot and attempt number; consumers must not overwrite a completed attempt.
167
+ */
168
+ export interface FlowStepSnapshot {
169
+ readonly id: FlowStepId;
170
+ readonly nodeId: FlowNodeId;
171
+ readonly status: FlowExecutionStatus;
172
+ readonly attempt: number;
173
+ readonly startedAt?: string;
174
+ readonly completedAt?: string;
175
+ readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;
176
+ readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;
177
+ readonly error?: FlowError;
178
+ readonly trace?: readonly FlowTraceEvent[];
179
+ }
180
+ /** A stable reference to one immutable step attempt in a run. */
181
+ export interface FlowStepRef {
182
+ readonly runId: FlowRunId;
183
+ readonly id: FlowStepId;
184
+ readonly nodeId: FlowNodeId;
185
+ readonly attempt: number;
186
+ }
187
+ /** A reference to the triggering event or request that started a run. */
188
+ export interface FlowRunTrigger {
189
+ readonly triggerId: string;
190
+ readonly kind: FlowTrigger['kind'];
191
+ readonly data?: FlowDataRef;
192
+ }
193
+ /*** A durable snapshot of an execution against one immutable flow revision.
194
+ *
195
+ * A run begins `pending`, may move to `running` or `cancelled`, and is terminal once
196
+ * `cancelled`, `failed`, `succeeded`, or `timed_out`. `waiting_for_approval` pauses an otherwise
197
+ * running run; resolving its pending approval resumes it or ends it as cancelled or failed.
198
+ * Consumers must validate these transitions and must retain the referenced definition revision.
199
+ */
200
+ export interface FlowRunSnapshot {
201
+ readonly id: FlowRunId;
202
+ readonly flow: FlowDefinitionRef;
203
+ readonly status: FlowExecutionStatus;
204
+ readonly trigger: FlowRunTrigger;
205
+ readonly createdAt: string;
206
+ readonly startedAt?: string;
207
+ readonly completedAt?: string;
208
+ readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;
209
+ readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;
210
+ readonly steps: readonly FlowStepSnapshot[];
211
+ readonly error?: FlowError;
212
+ readonly trace?: readonly FlowTraceEvent[];
213
+ }
214
+ /** A stable reference to a run against one immutable workflow revision. */
215
+ export interface FlowRunRef {
216
+ readonly id: FlowRunId;
217
+ readonly flow: FlowDefinitionRef;
218
+ }
219
+ export type FlowApprovalStatus = 'approved' | 'cancelled' | 'expired' | 'pending' | 'rejected';
220
+ /*** A serializable human-approval request associated with one durable run.
221
+ *
222
+ * An approval starts `pending` and transitions exactly once to `approved`, `rejected`, `expired`,
223
+ * or `cancelled`; those states are terminal. A step approval identifies its exact attempt so a
224
+ * later retry cannot resolve an earlier request. Consumers validate timestamps and transitions.
225
+ */
226
+ export interface FlowApprovalRequest {
227
+ readonly id: string;
228
+ readonly runId: FlowRunId;
229
+ readonly step?: FlowStepRef;
230
+ readonly status: FlowApprovalStatus;
231
+ readonly requestedAt: string;
232
+ readonly expiresAt?: string;
233
+ readonly resolvedAt?: string;
234
+ readonly requestedBy?: string;
235
+ readonly resolvedBy?: string;
236
+ readonly message?: string;
237
+ readonly context?: FlowDataRef;
238
+ }
239
+ //# sourceMappingURL=flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C,oEAAoE;AACpE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,wBAAwB,CAAC;CACjD;AAED,6FAA6F;AAC7F,MA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AAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC"}
package/dist/flow.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.js","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"","sourcesContent":["import type { DataSchemaSlot } from './data/schemas.js';\nimport type { DataContractValue } from './data/values.js';\nimport type { SecretRef } from './secrets.js';\n\nexport type FlowId = string;\nexport type FlowNodeId = string;\nexport type FlowPortId = string;\nexport type FlowEdgeId = string;\nexport type FlowRunId = string;\nexport type FlowStepId = string;\nexport type FlowArtifactId = string;\nexport type FlowProviderCapabilityId = string;\n\n/** A serializable reference to a provider-owned flow capability. */\nexport interface FlowProviderCapabilityRef {\n readonly providerId: string;\n readonly capabilityId: FlowProviderCapabilityId;\n}\n\n/** A persisted artifact reference for data too large or unsuitable for inline graph data. */\nexport interface FlowArtifactRef {\n readonly kind: 'artifact';\n readonly artifactId: FlowArtifactId;\n readonly mediaType?: string;\n readonly byteLength?: number;\n readonly checksum?: string;\n}\n\n/*** A schema-agnostic inline data reference.\n *\n * Inline values are ordinary non-secret data. Consumers must reject a value at a credential\n * configuration position and require a `FlowSecretRef` there; TypeScript cannot prove that\n * invariant after JSON has crossed a trust boundary.\n */\nexport interface FlowInlineDataRef {\n readonly kind: 'inline';\n readonly value: DataContractValue;\n}\n\n/** A schema-agnostic data reference exchanged by node ports, runs, and traces. */\nexport type FlowDataRef = FlowArtifactRef | FlowInlineDataRef;\n\n/*** A secret-store reference that deliberately excludes secret material.\n *\n * @security flow.test.ts#accepts secret references but excludes inline secret material from their contract\n *\n * Credential configuration must use this reference. Flow consumers must validate provider\n * configuration at their boundary, reject inline credentials, and redact secrets from errors and\n * traces. This portable DTO cannot determine which arbitrary provider fields are credentials, so\n * it provides no runtime validation and makes no static guarantee for untyped JSON.\n */\nexport interface FlowSecretRef {\n readonly kind: 'secret';\n readonly ref: SecretRef;\n}\n\n/*** JSON-safe node configuration references.\n *\n * A configuration value is always explicitly either non-secret data or a secret-store reference;\n * raw JSON values are intentionally not accepted. Provider consumers own validation of the\n * declared configuration shape and credential positions before execution.\n */\nexport type FlowNodeConfigValue = FlowDataRef | FlowSecretRef;\nexport type FlowNodeConfig = Readonly<Record<string, FlowNodeConfigValue>>;\n\n/** A typed node port. Direction determines whether a node consumes or produces the port value. */\nexport interface FlowPortDescriptor {\n readonly id: FlowPortId;\n readonly direction: 'input' | 'output';\n readonly label?: string;\n readonly description?: string;\n readonly required?: boolean;\n readonly data?: DataSchemaSlot;\n}\n\n/** One provider-backed executable step within a portable flow graph. */\nexport interface FlowNode {\n readonly id: FlowNodeId;\n readonly capability: FlowProviderCapabilityRef;\n readonly label?: string;\n readonly config?: FlowNodeConfig;\n readonly ports: readonly FlowPortDescriptor[];\n}\n\n/*** A condition declared on an edge without embedding executable expressions.\n *\n * A `value` condition evaluates `path` as an RFC 6901 JSON Pointer against the source port's\n * JSON value; the empty string denotes the complete value. Missing-pointer evaluation does not\n * match. `equals` uses JSON structural equality: values have the same type and recursive array\n * order and object member/value pairs, independent of object member order. Engines must not use\n * coercion, locale comparison, or executable expressions.\n */\nexport type FlowEdgeCondition =\n | { readonly kind: 'always' }\n | { readonly kind: 'outcome'; readonly outcome: 'failure' | 'success' }\n | { readonly kind: 'value'; readonly path: string; readonly equals: DataContractValue };\n\n/** A directed connection from one output port to one input port. */\nexport interface FlowEdge {\n readonly id: FlowEdgeId;\n readonly source: { readonly nodeId: FlowNodeId; readonly portId: FlowPortId };\n readonly target: { readonly nodeId: FlowNodeId; readonly portId: FlowPortId };\n readonly condition?: FlowEdgeCondition;\n}\n\n/*** A portable trigger declaration; runtime scheduling and delivery remain provider-owned.\n *\n * A schedule uses a five-field POSIX cron expression: minute, hour, day of month, month, and day\n * of week. Seconds, years, macros, and implementation-specific extensions are invalid. `timezone`\n * is an IANA time-zone name and defaults to `Etc/UTC`. Match it against local wall-clock time; a\n * spring-forward nonexistent local time is skipped and each occurrence of a repeated local time\n * during a fall-back transition fires separately. When both day-of-month and day-of-week are\n * restricted, either match is sufficient, following POSIX cron semantics.\n */\nexport type FlowTrigger =\n | { readonly id: string; readonly kind: 'manual' }\n | {\n readonly id: string;\n readonly kind: 'schedule';\n readonly cron: string;\n readonly timezone?: string;\n }\n | {\n readonly id: string;\n readonly kind: 'event';\n readonly capability: FlowProviderCapabilityRef;\n readonly event: string;\n }\n | { readonly id: string; readonly kind: 'webhook'; readonly path: string };\n\n/** An immutable revision of a portable workflow graph. */\nexport interface FlowDefinition {\n readonly id: FlowId;\n readonly version: number;\n readonly title: string;\n readonly description?: string;\n readonly nodes: readonly FlowNode[];\n readonly edges: readonly FlowEdge[];\n readonly triggers: readonly FlowTrigger[];\n}\n\n/** An immutable workflow revision reference. */\nexport interface FlowDefinitionRef {\n readonly id: FlowId;\n readonly version: number;\n}\n\nexport type FlowExecutionStatus =\n | 'cancelled'\n | 'failed'\n | 'pending'\n | 'running'\n | 'succeeded'\n | 'timed_out'\n | 'waiting_for_approval';\n\n/** A portable error observation that never carries a host Error object. */\nexport interface FlowError {\n readonly code: string;\n readonly message: string;\n readonly retryable: boolean;\n readonly details?: FlowDataRef;\n}\n\n/** A redaction-safe trace observation emitted by a run or step. */\nexport interface FlowTraceEvent {\n readonly timestamp: string;\n readonly level: 'debug' | 'error' | 'info' | 'warn';\n readonly message: string;\n readonly attributes?: Readonly<Record<string, DataContractValue>>;\n}\n\n/*** A durable snapshot of one execution attempt for a graph node.\n *\n * `attempt` is a one-based, monotonically increasing number for this run and node. A retry has a\n * new step snapshot and attempt number; consumers must not overwrite a completed attempt.\n */\nexport interface FlowStepSnapshot {\n readonly id: FlowStepId;\n readonly nodeId: FlowNodeId;\n readonly status: FlowExecutionStatus;\n readonly attempt: number;\n readonly startedAt?: string;\n readonly completedAt?: string;\n readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;\n readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;\n readonly error?: FlowError;\n readonly trace?: readonly FlowTraceEvent[];\n}\n\n/** A stable reference to one immutable step attempt in a run. */\nexport interface FlowStepRef {\n readonly runId: FlowRunId;\n readonly id: FlowStepId;\n readonly nodeId: FlowNodeId;\n readonly attempt: number;\n}\n\n/** A reference to the triggering event or request that started a run. */\nexport interface FlowRunTrigger {\n readonly triggerId: string;\n readonly kind: FlowTrigger['kind'];\n readonly data?: FlowDataRef;\n}\n\n/*** A durable snapshot of an execution against one immutable flow revision.\n *\n * A run begins `pending`, may move to `running` or `cancelled`, and is terminal once\n * `cancelled`, `failed`, `succeeded`, or `timed_out`. `waiting_for_approval` pauses an otherwise\n * running run; resolving its pending approval resumes it or ends it as cancelled or failed.\n * Consumers must validate these transitions and must retain the referenced definition revision.\n */\nexport interface FlowRunSnapshot {\n readonly id: FlowRunId;\n readonly flow: FlowDefinitionRef;\n readonly status: FlowExecutionStatus;\n readonly trigger: FlowRunTrigger;\n readonly createdAt: string;\n readonly startedAt?: string;\n readonly completedAt?: string;\n readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;\n readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;\n readonly steps: readonly FlowStepSnapshot[];\n readonly error?: FlowError;\n readonly trace?: readonly FlowTraceEvent[];\n}\n\n/** A stable reference to a run against one immutable workflow revision. */\nexport interface FlowRunRef {\n readonly id: FlowRunId;\n readonly flow: FlowDefinitionRef;\n}\n\nexport type FlowApprovalStatus = 'approved' | 'cancelled' | 'expired' | 'pending' | 'rejected';\n\n/*** A serializable human-approval request associated with one durable run.\n *\n * An approval starts `pending` and transitions exactly once to `approved`, `rejected`, `expired`,\n * or `cancelled`; those states are terminal. A step approval identifies its exact attempt so a\n * later retry cannot resolve an earlier request. Consumers validate timestamps and transitions.\n */\nexport interface FlowApprovalRequest {\n readonly id: string;\n readonly runId: FlowRunId;\n readonly step?: FlowStepRef;\n readonly status: FlowApprovalStatus;\n readonly requestedAt: string;\n readonly expiresAt?: string;\n readonly resolvedAt?: string;\n readonly requestedBy?: string;\n readonly resolvedBy?: string;\n readonly message?: string;\n readonly context?: FlowDataRef;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './db.js';
9
9
  export * from './deploy.js';
10
10
  export * from './deployProvider.js';
11
11
  export * from './environments.js';
12
+ export * from './flow.js';
12
13
  export * from './infra.js';
13
14
  export * from './media.js';
14
15
  export * from './navigator.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './db.js';
9
9
  export * from './deploy.js';
10
10
  export * from './deployProvider.js';
11
11
  export * from './environments.js';
12
+ export * from './flow.js';
12
13
  export * from './infra.js';
13
14
  export * from './media.js';
14
15
  export * from './navigator.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC","sourcesContent":["export * from './ads.js';\nexport * from './appManifest.js';\nexport * from './auth.js';\nexport * from './bindings.js';\nexport * from './cli/index.js';\nexport * from './collections.js';\nexport * from './data/index.js';\nexport * from './db.js';\nexport * from './deploy.js';\nexport * from './deployProvider.js';\nexport * from './environments.js';\nexport * from './infra.js';\nexport * from './media.js';\nexport * from './navigator.js';\nexport * from './repository.js';\nexport * from './requirements.js';\nexport * from './rules.js';\nexport * from './runtimeCallbacks.js';\nexport * from './secrets.js';\nexport * from './serializable.js';\nexport * from './state.js';\nexport * from './storage.js';\nexport * from './structure/index.js';\nexport * from './theme.js';\nexport * from './types.js';\nexport * from './ui.js';\nexport * from './website.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC","sourcesContent":["export * from './ads.js';\nexport * from './appManifest.js';\nexport * from './auth.js';\nexport * from './bindings.js';\nexport * from './cli/index.js';\nexport * from './collections.js';\nexport * from './data/index.js';\nexport * from './db.js';\nexport * from './deploy.js';\nexport * from './deployProvider.js';\nexport * from './environments.js';\nexport * from './flow.js';\nexport * from './infra.js';\nexport * from './media.js';\nexport * from './navigator.js';\nexport * from './repository.js';\nexport * from './requirements.js';\nexport * from './rules.js';\nexport * from './runtimeCallbacks.js';\nexport * from './secrets.js';\nexport * from './serializable.js';\nexport * from './state.js';\nexport * from './storage.js';\nexport * from './structure/index.js';\nexport * from './theme.js';\nexport * from './types.js';\nexport * from './ui.js';\nexport * from './website.js';\n"]}
@@ -1,9 +1,9 @@
1
1
  export declare const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = "6.0.3";
2
- export declare const STRUCTURE_DESCRIPTOR_FINGERPRINT = "sha256:dd8057c752c877b62bdc5c8db41135bd76c55dedf9bf4e1a13d7bf977f9cca56";
2
+ export declare const STRUCTURE_DESCRIPTOR_FINGERPRINT = "sha256:67f55755ba8bc7a6ba9239317adbad41d62c006976654188a9f817e3c807509a";
3
3
  export declare const STRUCTURE_DESCRIPTOR: {
4
4
  readonly protocolVersion: 1;
5
5
  readonly packageName: "@ankhorage/contracts";
6
- readonly packageVersion: "26.6.0";
6
+ readonly packageVersion: "26.7.0";
7
7
  readonly roots: {
8
8
  readonly "auth-flow": "AuthFlowConfig";
9
9
  readonly "auth-profile": "AuthProfileSpec";
@@ -1,9 +1,9 @@
1
1
  export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
2
- export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:dd8057c752c877b62bdc5c8db41135bd76c55dedf9bf4e1a13d7bf977f9cca56';
2
+ export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:67f55755ba8bc7a6ba9239317adbad41d62c006976654188a9f817e3c807509a';
3
3
  export const STRUCTURE_DESCRIPTOR = {
4
4
  "protocolVersion": 1,
5
5
  "packageName": "@ankhorage/contracts",
6
- "packageVersion": "26.6.0",
6
+ "packageVersion": "26.7.0",
7
7
  "roots": {
8
8
  "auth-flow": "AuthFlowConfig",
9
9
  "auth-profile": "AuthProfileSpec",
@@ -1 +1 @@
1
- {"version":3,"file":"generated.js","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;AAC7D,MAAM,CAAC,MAAM,gCAAgC,GAAG,yEAAyE,CAAC;AAE1H,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,sBAAsB;IACrC,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE;QACP,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AO,EAAE;gCACP,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,QAAQ;6BACjB;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF;CAC6C,CAAC","sourcesContent":["/* This file is generated by @ankhorage/devtools. Do not edit manually. */\nimport type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';\n\nexport const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';\nexport const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:dd8057c752c877b62bdc5c8db41135bd76c55dedf9bf4e1a13d7bf977f9cca56';\n\nexport const STRUCTURE_DESCRIPTOR = {\n \"protocolVersion\": 1,\n \"packageName\": \"@ankhorage/contracts\",\n \"packageVersion\": \"26.6.0\",\n \"roots\": {\n \"auth-flow\": \"AuthFlowConfig\",\n \"auth-profile\": \"AuthProfileSpec\",\n \"auth-sign-in\": \"AuthSignInSpec\",\n \"auth-sign-up\": \"AuthSignUpSpec\",\n \"screen-metadata\": \"ScreenMetadataSpec\",\n \"screen-requirements\": \"ScreenRequirements\",\n \"theme-config\": \"ThemeConfig\"\n },\n \"descriptors\": {\n \"AuthFlowConfig\": {\n \"id\": \"AuthFlowConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"forgotPasswordRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"otpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"postSignInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signOutRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"signUpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"unauthorizedRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"AuthProfileField\": {\n \"id\": \"AuthProfileField\",\n \"descriptor\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"AuthProfileSpec\": {\n \"id\": \"AuthProfileSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"createStrategy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"api\",\n \"app\",\n \"trigger\"\n ]\n },\n \"optional\": true\n },\n \"fields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthProfileField\"\n }\n }\n },\n \"primaryKey\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"authUserId\"\n ]\n },\n \"optional\": true\n },\n \"table\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"updateStrategy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"api\",\n \"app\"\n ]\n },\n \"optional\": true\n }\n }\n }\n },\n \"AuthSignInSpec\": {\n \"id\": \"AuthSignInSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"identifiers\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"enum\",\n \"values\": [\n \"email\",\n \"phone\",\n \"username\"\n ]\n }\n }\n }\n }\n }\n },\n \"AuthSignUpField\": {\n \"id\": \"AuthSignUpField\",\n \"descriptor\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"AuthSignUpSpec\": {\n \"id\": \"AuthSignUpSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"optionalFields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthSignUpField\"\n }\n },\n \"optional\": true\n },\n \"requiredFields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthSignUpField\"\n }\n }\n },\n \"signUpPolicy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"autoSignIn\",\n \"requireVerification\"\n ]\n },\n \"optional\": true\n }\n }\n }\n },\n \"ScreenMetadataSpec\": {\n \"id\": \"ScreenMetadataSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"description\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"title\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ScreenRequirements\": {\n \"id\": \"ScreenRequirements\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"capabilities\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"barcodeScanner\",\n \"cameraPreview\",\n \"clipboard\",\n \"ebookReader\",\n \"filePicker\",\n \"location\",\n \"mediaPicker\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n },\n \"permissions\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"camera\",\n \"clipboard\",\n \"locationBackground\",\n \"locationForeground\",\n \"mediaLibrary\",\n \"mediaLibraryWrite\",\n \"microphone\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeConfig\": {\n \"id\": \"ThemeConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"dark\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeModeConfig\"\n }\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"light\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeModeConfig\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"recipes\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeRecipeOverrides\"\n },\n \"optional\": true\n },\n \"tokens\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeGlobalTokenOverrides\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeGlobalTokenOverrides\": {\n \"id\": \"ThemeGlobalTokenOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"radii\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"shadows\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"spacing\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"typography\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeTypographyTokenOverrides\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeModeConfig\": {\n \"id\": \"ThemeModeConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"harmony\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"analogous\",\n \"complementary\",\n \"monochromatic\",\n \"splitComplementary\",\n \"square\",\n \"tetradic\",\n \"triadic\"\n ]\n }\n },\n \"primaryColor\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"ThemeRecipeOverrides\": {\n \"id\": \"ThemeRecipeOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"components\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"packageName\": \"typescript\",\n \"id\": \"Readonly\"\n }\n },\n \"optional\": true\n },\n \"patterns\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"packageName\": \"typescript\",\n \"id\": \"Readonly\"\n }\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeTypographyHeadingOverrides\": {\n \"id\": \"ThemeTypographyHeadingOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"lineHeight\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n },\n \"optional\": true\n },\n \"size\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n },\n \"optional\": true\n },\n \"weight\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeTypographyTokenOverrides\": {\n \"id\": \"ThemeTypographyTokenOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"headings\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeTypographyHeadingOverrides\"\n }\n },\n \"optional\": true\n },\n \"sizes\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"weights\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"optional\": true\n }\n }\n }\n }\n }\n} as const satisfies StructureDescriptorDocument;\n"]}
1
+ {"version":3,"file":"generated.js","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;AAC7D,MAAM,CAAC,MAAM,gCAAgC,GAAG,yEAAyE,CAAC;AAE1H,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,sBAAsB;IACrC,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE;QACP,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,iBAAiB;QACjC,cAAc,EAAE,gBAAgB;QAChC,cAAc,EAAE,gBAAgB;QAChC,iBAAiB,EAAE,oBAAoB;QACvC,qBAAqB,EAAE,oBAAoB;QAC3C,cAAc,EAAE,aAAa;KAC9B;IACD,aAAa,EAAE;QACb,gBAAgB,EAAE;YAChB,IAAI,EAAE,gBAAgB;YACtB,YAAY,EAAE;gBACZ,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE;oBACR,qBAAqB,EAAE;wBACrB,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,UAAU,EAAE;wBACV,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,iBAAiB,EAAE;wBACjB,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;qBACF;oBACD,aAAa,EAAE;wBACb,OAA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AQ;6BACjB;4BACD,OAAO,EAAE;gCACP,MAAM,EAAE,KAAK;gCACb,IAAI,EAAE,iCAAiC;6BACxC;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,MAAM,EAAE,WAAW;4BACnB,KAAK,EAAE;gCACL,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,QAAQ;6BACjB;4BACD,OAAO,EAAE;gCACP,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,QAAQ;6BACjB;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,SAAS,EAAE;wBACT,OAAO,EAAE;4BACP,MAAM,EAAE,WAAW;4BACnB,KAAK,EAAE;gCACL,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,QAAQ;6BACjB;4BACD,OAAO,EAAE;gCACP,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,QAAQ;6BACjB;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF;CAC6C,CAAC","sourcesContent":["/* This file is generated by @ankhorage/devtools. Do not edit manually. */\nimport type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';\n\nexport const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';\nexport const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:67f55755ba8bc7a6ba9239317adbad41d62c006976654188a9f817e3c807509a';\n\nexport const STRUCTURE_DESCRIPTOR = {\n \"protocolVersion\": 1,\n \"packageName\": \"@ankhorage/contracts\",\n \"packageVersion\": \"26.7.0\",\n \"roots\": {\n \"auth-flow\": \"AuthFlowConfig\",\n \"auth-profile\": \"AuthProfileSpec\",\n \"auth-sign-in\": \"AuthSignInSpec\",\n \"auth-sign-up\": \"AuthSignUpSpec\",\n \"screen-metadata\": \"ScreenMetadataSpec\",\n \"screen-requirements\": \"ScreenRequirements\",\n \"theme-config\": \"ThemeConfig\"\n },\n \"descriptors\": {\n \"AuthFlowConfig\": {\n \"id\": \"AuthFlowConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"forgotPasswordRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"otpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"postSignInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signOutRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"signUpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"unauthorizedRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"AuthProfileField\": {\n \"id\": \"AuthProfileField\",\n \"descriptor\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"AuthProfileSpec\": {\n \"id\": \"AuthProfileSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"createStrategy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"api\",\n \"app\",\n \"trigger\"\n ]\n },\n \"optional\": true\n },\n \"fields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthProfileField\"\n }\n }\n },\n \"primaryKey\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"authUserId\"\n ]\n },\n \"optional\": true\n },\n \"table\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"updateStrategy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"api\",\n \"app\"\n ]\n },\n \"optional\": true\n }\n }\n }\n },\n \"AuthSignInSpec\": {\n \"id\": \"AuthSignInSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"identifiers\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"enum\",\n \"values\": [\n \"email\",\n \"phone\",\n \"username\"\n ]\n }\n }\n }\n }\n }\n },\n \"AuthSignUpField\": {\n \"id\": \"AuthSignUpField\",\n \"descriptor\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"AuthSignUpSpec\": {\n \"id\": \"AuthSignUpSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"optionalFields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthSignUpField\"\n }\n },\n \"optional\": true\n },\n \"requiredFields\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"ref\",\n \"id\": \"AuthSignUpField\"\n }\n }\n },\n \"signUpPolicy\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"autoSignIn\",\n \"requireVerification\"\n ]\n },\n \"optional\": true\n }\n }\n }\n },\n \"ScreenMetadataSpec\": {\n \"id\": \"ScreenMetadataSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"description\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"title\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ScreenRequirements\": {\n \"id\": \"ScreenRequirements\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"capabilities\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"barcodeScanner\",\n \"cameraPreview\",\n \"clipboard\",\n \"ebookReader\",\n \"filePicker\",\n \"location\",\n \"mediaPicker\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n },\n \"permissions\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"camera\",\n \"clipboard\",\n \"locationBackground\",\n \"locationForeground\",\n \"mediaLibrary\",\n \"mediaLibraryWrite\",\n \"microphone\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeConfig\": {\n \"id\": \"ThemeConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"dark\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeModeConfig\"\n }\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"light\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeModeConfig\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"recipes\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeRecipeOverrides\"\n },\n \"optional\": true\n },\n \"tokens\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeGlobalTokenOverrides\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeGlobalTokenOverrides\": {\n \"id\": \"ThemeGlobalTokenOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"radii\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"shadows\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"spacing\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"typography\": {\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeTypographyTokenOverrides\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeModeConfig\": {\n \"id\": \"ThemeModeConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"harmony\": {\n \"value\": {\n \"kind\": \"enum\",\n \"values\": [\n \"analogous\",\n \"complementary\",\n \"monochromatic\",\n \"splitComplementary\",\n \"square\",\n \"tetradic\",\n \"triadic\"\n ]\n }\n },\n \"primaryColor\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"ThemeRecipeOverrides\": {\n \"id\": \"ThemeRecipeOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"components\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"packageName\": \"typescript\",\n \"id\": \"Readonly\"\n }\n },\n \"optional\": true\n },\n \"patterns\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"packageName\": \"typescript\",\n \"id\": \"Readonly\"\n }\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeTypographyHeadingOverrides\": {\n \"id\": \"ThemeTypographyHeadingOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"lineHeight\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n },\n \"optional\": true\n },\n \"size\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n },\n \"optional\": true\n },\n \"weight\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ThemeTypographyTokenOverrides\": {\n \"id\": \"ThemeTypographyTokenOverrides\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"headings\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"ref\",\n \"id\": \"ThemeTypographyHeadingOverrides\"\n }\n },\n \"optional\": true\n },\n \"sizes\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"number\"\n }\n },\n \"optional\": true\n },\n \"weights\": {\n \"value\": {\n \"kind\": \"value-map\",\n \"key\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"optional\": true\n }\n }\n }\n }\n }\n} as const satisfies StructureDescriptorDocument;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "26.6.0",
3
+ "version": "26.7.0",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -44,7 +44,7 @@
44
44
  "@ankhorage/utility": "^1.10.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@ankhorage/devtools": "^2.4.1",
47
+ "@ankhorage/devtools": "^2.4.3",
48
48
  "@ankhorage/paradox": "^0.3.6",
49
49
  "@types/bun": "^1.4.2",
50
50
  "@types/node": "^26.6.6",
@@ -142,6 +142,10 @@
142
142
  "./capability": {
143
143
  "types": "./dist/capability.d.ts",
144
144
  "default": "./dist/capability.js"
145
+ },
146
+ "./flow": {
147
+ "types": "./dist/flow.d.ts",
148
+ "default": "./dist/flow.js"
145
149
  }
146
150
  },
147
151
  "description": "Serializable app, capability, binding, theme, auth, and secret-store contracts for Ankhorage.",
@@ -0,0 +1,218 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+
4
+ import { describe, expect, it } from 'bun:test';
5
+
6
+ import type {
7
+ FlowApprovalRequest,
8
+ FlowDefinition,
9
+ FlowNodeConfig,
10
+ FlowRunSnapshot,
11
+ FlowSecretRef,
12
+ } from './flow.js';
13
+
14
+ type JsonRecord = Readonly<Record<string, unknown>>;
15
+
16
+ const isRecord = (value: unknown): value is JsonRecord =>
17
+ typeof value === 'object' && value !== null && !Array.isArray(value);
18
+
19
+ const isString = (value: unknown): value is string => typeof value === 'string';
20
+
21
+ const isFlowFixture = (value: unknown): value is FlowDefinition => {
22
+ if (
23
+ !isRecord(value) ||
24
+ !isString(value.id) ||
25
+ !Number.isInteger(value.version) ||
26
+ !isString(value.title)
27
+ ) {
28
+ return false;
29
+ }
30
+
31
+ return (
32
+ Array.isArray(value.nodes) &&
33
+ value.nodes.every(
34
+ (node) =>
35
+ isRecord(node) &&
36
+ isString(node.id) &&
37
+ isRecord(node.capability) &&
38
+ isString(node.capability.providerId) &&
39
+ isString(node.capability.capabilityId) &&
40
+ Array.isArray(node.ports) &&
41
+ node.ports.every(
42
+ (port) =>
43
+ isRecord(port) &&
44
+ isString(port.id) &&
45
+ (port.direction === 'input' || port.direction === 'output'),
46
+ ),
47
+ ) &&
48
+ Array.isArray(value.edges) &&
49
+ value.edges.every(
50
+ (edge) =>
51
+ isRecord(edge) &&
52
+ isString(edge.id) &&
53
+ isRecord(edge.source) &&
54
+ isString(edge.source.nodeId) &&
55
+ isString(edge.source.portId) &&
56
+ isRecord(edge.target) &&
57
+ isString(edge.target.nodeId) &&
58
+ isString(edge.target.portId),
59
+ ) &&
60
+ Array.isArray(value.triggers) &&
61
+ value.triggers.every(
62
+ (trigger) => isRecord(trigger) && isString(trigger.id) && isString(trigger.kind),
63
+ )
64
+ );
65
+ };
66
+
67
+ const definition = {
68
+ id: 'social-publish',
69
+ version: 3,
70
+ title: 'Publish approved social media',
71
+ nodes: [
72
+ {
73
+ id: 'compose',
74
+ capability: { providerId: '@ankhorage/flow/social', capabilityId: 'post.compose' },
75
+ config: {
76
+ audience: { kind: 'inline', value: { segment: 'subscribers' } },
77
+ credential: { kind: 'secret', ref: 'flow/social/publisher' },
78
+ },
79
+ ports: [
80
+ { id: 'draft', direction: 'input', required: true, data: { schema: { type: 'object' } } },
81
+ { id: 'post', direction: 'output', data: { schema: { type: 'object' } } },
82
+ ],
83
+ },
84
+ {
85
+ id: 'notify',
86
+ capability: { providerId: '@ankhorage/flow/social', capabilityId: 'notification.send' },
87
+ ports: [{ id: 'post', direction: 'input', required: true }],
88
+ },
89
+ ],
90
+ edges: [
91
+ {
92
+ id: 'notify-success',
93
+ source: { nodeId: 'compose', portId: 'post' },
94
+ target: { nodeId: 'notify', portId: 'post' },
95
+ condition: { kind: 'outcome', outcome: 'success' },
96
+ },
97
+ ],
98
+ triggers: [{ id: 'manual', kind: 'manual' }],
99
+ } as const satisfies FlowDefinition;
100
+
101
+ const run = {
102
+ id: 'run-42',
103
+ flow: { id: definition.id, version: definition.version },
104
+ status: 'waiting_for_approval',
105
+ trigger: { triggerId: 'manual', kind: 'manual' },
106
+ createdAt: '2026-11-12T09:00:00.000Z',
107
+ steps: [
108
+ {
109
+ id: 'step-compose',
110
+ nodeId: 'compose',
111
+ status: 'succeeded',
112
+ attempt: 1,
113
+ output: {
114
+ post: { kind: 'artifact', artifactId: 'artifact-post', mediaType: 'application/json' },
115
+ },
116
+ },
117
+ ],
118
+ } as const satisfies FlowRunSnapshot;
119
+
120
+ const approval = {
121
+ id: 'approval-7',
122
+ runId: run.id,
123
+ step: { id: 'step-compose', nodeId: 'compose', attempt: 1, runId: run.id },
124
+ status: 'pending',
125
+ requestedAt: '2026-11-12T09:01:00.000Z',
126
+ context: { kind: 'artifact', artifactId: 'artifact-post' },
127
+ } as const satisfies FlowApprovalRequest;
128
+
129
+ describe('Flow contract serialization', () => {
130
+ it('round-trips a standalone versioned workflow fixture', () => {
131
+ const fixturePath = join(process.cwd(), 'test/flow/fixtures/versioned-workflow.json');
132
+ const fixture = JSON.parse(readFileSync(fixturePath, 'utf8')) as unknown;
133
+
134
+ expect(isFlowFixture(fixture)).toBe(true);
135
+ expect(JSON.parse(JSON.stringify(fixture))).toEqual(fixture);
136
+ });
137
+
138
+ it('rejects malformed fixture structure independently of JSON serialization', () => {
139
+ const malformedFixture = {
140
+ id: 'missing-port-direction',
141
+ version: 1,
142
+ title: 'Malformed fixture',
143
+ nodes: [
144
+ {
145
+ id: 'compose',
146
+ capability: { providerId: '@ankhorage/flow/social', capabilityId: 'post.compose' },
147
+ ports: [{ id: 'post', direction: 'sideways' }],
148
+ },
149
+ ],
150
+ edges: [],
151
+ triggers: [],
152
+ };
153
+
154
+ expect(isFlowFixture(malformedFixture)).toBe(false);
155
+ expect(JSON.parse(JSON.stringify(malformedFixture))).toEqual(malformedFixture);
156
+ });
157
+
158
+ it('round-trips a versioned graph, run snapshot, and approval without runtime values', () => {
159
+ expect(JSON.parse(JSON.stringify({ definition, run, approval }))).toEqual({
160
+ definition,
161
+ run,
162
+ approval,
163
+ });
164
+ });
165
+ });
166
+
167
+ describe('Flow contract boundaries', () => {
168
+ it('accepts secret references but excludes inline secret material from their contract', () => {
169
+ const secret = {
170
+ kind: 'secret',
171
+ ref: 'flow/social/publisher',
172
+ } as const satisfies FlowSecretRef;
173
+
174
+ expect(JSON.parse(JSON.stringify(secret))).toEqual(secret);
175
+ // @ts-expect-error Flow secret references must not carry secret material.
176
+ const inlineSecret: FlowSecretRef = {
177
+ kind: 'secret',
178
+ ref: 'flow/social/publisher',
179
+ value: 'secret',
180
+ };
181
+ expect(inlineSecret).toBeDefined();
182
+
183
+ // @ts-expect-error Node configuration requires an explicit data or secret reference.
184
+ const plaintextCredential: FlowNodeConfig = { credential: 'api-key' };
185
+ expect(plaintextCredential).toBeDefined();
186
+ });
187
+
188
+ it('requires a JSON Pointer whenever a condition compares a port value', () => {
189
+ // @ts-expect-error Value conditions must name an RFC 6901 JSON Pointer, including '' for root.
190
+ const implicitRootComparison: FlowDefinition = {
191
+ ...definition,
192
+ edges: [
193
+ {
194
+ id: 'implicit-root',
195
+ source: { nodeId: 'compose', portId: 'post' },
196
+ target: { nodeId: 'notify', portId: 'post' },
197
+ condition: { kind: 'value', equals: 'published' },
198
+ },
199
+ ],
200
+ };
201
+ expect(implicitRootComparison).toBeDefined();
202
+ });
203
+
204
+ it('keeps node ports directional and edge endpoints precise', () => {
205
+ // @ts-expect-error Edges may only originate at a named port.
206
+ const incompleteEdge: FlowDefinition = {
207
+ ...definition,
208
+ edges: [
209
+ {
210
+ id: 'missing-port',
211
+ source: { nodeId: 'compose' },
212
+ target: { nodeId: 'notify', portId: 'post' },
213
+ },
214
+ ],
215
+ };
216
+ expect(incompleteEdge).toBeDefined();
217
+ });
218
+ });
package/src/flow.ts ADDED
@@ -0,0 +1,254 @@
1
+ import type { DataSchemaSlot } from './data/schemas.js';
2
+ import type { DataContractValue } from './data/values.js';
3
+ import type { SecretRef } from './secrets.js';
4
+
5
+ export type FlowId = string;
6
+ export type FlowNodeId = string;
7
+ export type FlowPortId = string;
8
+ export type FlowEdgeId = string;
9
+ export type FlowRunId = string;
10
+ export type FlowStepId = string;
11
+ export type FlowArtifactId = string;
12
+ export type FlowProviderCapabilityId = string;
13
+
14
+ /** A serializable reference to a provider-owned flow capability. */
15
+ export interface FlowProviderCapabilityRef {
16
+ readonly providerId: string;
17
+ readonly capabilityId: FlowProviderCapabilityId;
18
+ }
19
+
20
+ /** A persisted artifact reference for data too large or unsuitable for inline graph data. */
21
+ export interface FlowArtifactRef {
22
+ readonly kind: 'artifact';
23
+ readonly artifactId: FlowArtifactId;
24
+ readonly mediaType?: string;
25
+ readonly byteLength?: number;
26
+ readonly checksum?: string;
27
+ }
28
+
29
+ /*** A schema-agnostic inline data reference.
30
+ *
31
+ * Inline values are ordinary non-secret data. Consumers must reject a value at a credential
32
+ * configuration position and require a `FlowSecretRef` there; TypeScript cannot prove that
33
+ * invariant after JSON has crossed a trust boundary.
34
+ */
35
+ export interface FlowInlineDataRef {
36
+ readonly kind: 'inline';
37
+ readonly value: DataContractValue;
38
+ }
39
+
40
+ /** A schema-agnostic data reference exchanged by node ports, runs, and traces. */
41
+ export type FlowDataRef = FlowArtifactRef | FlowInlineDataRef;
42
+
43
+ /*** A secret-store reference that deliberately excludes secret material.
44
+ *
45
+ * @security flow.test.ts#accepts secret references but excludes inline secret material from their contract
46
+ *
47
+ * Credential configuration must use this reference. Flow consumers must validate provider
48
+ * configuration at their boundary, reject inline credentials, and redact secrets from errors and
49
+ * traces. This portable DTO cannot determine which arbitrary provider fields are credentials, so
50
+ * it provides no runtime validation and makes no static guarantee for untyped JSON.
51
+ */
52
+ export interface FlowSecretRef {
53
+ readonly kind: 'secret';
54
+ readonly ref: SecretRef;
55
+ }
56
+
57
+ /*** JSON-safe node configuration references.
58
+ *
59
+ * A configuration value is always explicitly either non-secret data or a secret-store reference;
60
+ * raw JSON values are intentionally not accepted. Provider consumers own validation of the
61
+ * declared configuration shape and credential positions before execution.
62
+ */
63
+ export type FlowNodeConfigValue = FlowDataRef | FlowSecretRef;
64
+ export type FlowNodeConfig = Readonly<Record<string, FlowNodeConfigValue>>;
65
+
66
+ /** A typed node port. Direction determines whether a node consumes or produces the port value. */
67
+ export interface FlowPortDescriptor {
68
+ readonly id: FlowPortId;
69
+ readonly direction: 'input' | 'output';
70
+ readonly label?: string;
71
+ readonly description?: string;
72
+ readonly required?: boolean;
73
+ readonly data?: DataSchemaSlot;
74
+ }
75
+
76
+ /** One provider-backed executable step within a portable flow graph. */
77
+ export interface FlowNode {
78
+ readonly id: FlowNodeId;
79
+ readonly capability: FlowProviderCapabilityRef;
80
+ readonly label?: string;
81
+ readonly config?: FlowNodeConfig;
82
+ readonly ports: readonly FlowPortDescriptor[];
83
+ }
84
+
85
+ /*** A condition declared on an edge without embedding executable expressions.
86
+ *
87
+ * A `value` condition evaluates `path` as an RFC 6901 JSON Pointer against the source port's
88
+ * JSON value; the empty string denotes the complete value. Missing-pointer evaluation does not
89
+ * match. `equals` uses JSON structural equality: values have the same type and recursive array
90
+ * order and object member/value pairs, independent of object member order. Engines must not use
91
+ * coercion, locale comparison, or executable expressions.
92
+ */
93
+ export type FlowEdgeCondition =
94
+ | { readonly kind: 'always' }
95
+ | { readonly kind: 'outcome'; readonly outcome: 'failure' | 'success' }
96
+ | { readonly kind: 'value'; readonly path: string; readonly equals: DataContractValue };
97
+
98
+ /** A directed connection from one output port to one input port. */
99
+ export interface FlowEdge {
100
+ readonly id: FlowEdgeId;
101
+ readonly source: { readonly nodeId: FlowNodeId; readonly portId: FlowPortId };
102
+ readonly target: { readonly nodeId: FlowNodeId; readonly portId: FlowPortId };
103
+ readonly condition?: FlowEdgeCondition;
104
+ }
105
+
106
+ /*** A portable trigger declaration; runtime scheduling and delivery remain provider-owned.
107
+ *
108
+ * A schedule uses a five-field POSIX cron expression: minute, hour, day of month, month, and day
109
+ * of week. Seconds, years, macros, and implementation-specific extensions are invalid. `timezone`
110
+ * is an IANA time-zone name and defaults to `Etc/UTC`. Match it against local wall-clock time; a
111
+ * spring-forward nonexistent local time is skipped and each occurrence of a repeated local time
112
+ * during a fall-back transition fires separately. When both day-of-month and day-of-week are
113
+ * restricted, either match is sufficient, following POSIX cron semantics.
114
+ */
115
+ export type FlowTrigger =
116
+ | { readonly id: string; readonly kind: 'manual' }
117
+ | {
118
+ readonly id: string;
119
+ readonly kind: 'schedule';
120
+ readonly cron: string;
121
+ readonly timezone?: string;
122
+ }
123
+ | {
124
+ readonly id: string;
125
+ readonly kind: 'event';
126
+ readonly capability: FlowProviderCapabilityRef;
127
+ readonly event: string;
128
+ }
129
+ | { readonly id: string; readonly kind: 'webhook'; readonly path: string };
130
+
131
+ /** An immutable revision of a portable workflow graph. */
132
+ export interface FlowDefinition {
133
+ readonly id: FlowId;
134
+ readonly version: number;
135
+ readonly title: string;
136
+ readonly description?: string;
137
+ readonly nodes: readonly FlowNode[];
138
+ readonly edges: readonly FlowEdge[];
139
+ readonly triggers: readonly FlowTrigger[];
140
+ }
141
+
142
+ /** An immutable workflow revision reference. */
143
+ export interface FlowDefinitionRef {
144
+ readonly id: FlowId;
145
+ readonly version: number;
146
+ }
147
+
148
+ export type FlowExecutionStatus =
149
+ | 'cancelled'
150
+ | 'failed'
151
+ | 'pending'
152
+ | 'running'
153
+ | 'succeeded'
154
+ | 'timed_out'
155
+ | 'waiting_for_approval';
156
+
157
+ /** A portable error observation that never carries a host Error object. */
158
+ export interface FlowError {
159
+ readonly code: string;
160
+ readonly message: string;
161
+ readonly retryable: boolean;
162
+ readonly details?: FlowDataRef;
163
+ }
164
+
165
+ /** A redaction-safe trace observation emitted by a run or step. */
166
+ export interface FlowTraceEvent {
167
+ readonly timestamp: string;
168
+ readonly level: 'debug' | 'error' | 'info' | 'warn';
169
+ readonly message: string;
170
+ readonly attributes?: Readonly<Record<string, DataContractValue>>;
171
+ }
172
+
173
+ /*** A durable snapshot of one execution attempt for a graph node.
174
+ *
175
+ * `attempt` is a one-based, monotonically increasing number for this run and node. A retry has a
176
+ * new step snapshot and attempt number; consumers must not overwrite a completed attempt.
177
+ */
178
+ export interface FlowStepSnapshot {
179
+ readonly id: FlowStepId;
180
+ readonly nodeId: FlowNodeId;
181
+ readonly status: FlowExecutionStatus;
182
+ readonly attempt: number;
183
+ readonly startedAt?: string;
184
+ readonly completedAt?: string;
185
+ readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;
186
+ readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;
187
+ readonly error?: FlowError;
188
+ readonly trace?: readonly FlowTraceEvent[];
189
+ }
190
+
191
+ /** A stable reference to one immutable step attempt in a run. */
192
+ export interface FlowStepRef {
193
+ readonly runId: FlowRunId;
194
+ readonly id: FlowStepId;
195
+ readonly nodeId: FlowNodeId;
196
+ readonly attempt: number;
197
+ }
198
+
199
+ /** A reference to the triggering event or request that started a run. */
200
+ export interface FlowRunTrigger {
201
+ readonly triggerId: string;
202
+ readonly kind: FlowTrigger['kind'];
203
+ readonly data?: FlowDataRef;
204
+ }
205
+
206
+ /*** A durable snapshot of an execution against one immutable flow revision.
207
+ *
208
+ * A run begins `pending`, may move to `running` or `cancelled`, and is terminal once
209
+ * `cancelled`, `failed`, `succeeded`, or `timed_out`. `waiting_for_approval` pauses an otherwise
210
+ * running run; resolving its pending approval resumes it or ends it as cancelled or failed.
211
+ * Consumers must validate these transitions and must retain the referenced definition revision.
212
+ */
213
+ export interface FlowRunSnapshot {
214
+ readonly id: FlowRunId;
215
+ readonly flow: FlowDefinitionRef;
216
+ readonly status: FlowExecutionStatus;
217
+ readonly trigger: FlowRunTrigger;
218
+ readonly createdAt: string;
219
+ readonly startedAt?: string;
220
+ readonly completedAt?: string;
221
+ readonly input?: Readonly<Record<FlowPortId, FlowDataRef>>;
222
+ readonly output?: Readonly<Record<FlowPortId, FlowDataRef>>;
223
+ readonly steps: readonly FlowStepSnapshot[];
224
+ readonly error?: FlowError;
225
+ readonly trace?: readonly FlowTraceEvent[];
226
+ }
227
+
228
+ /** A stable reference to a run against one immutable workflow revision. */
229
+ export interface FlowRunRef {
230
+ readonly id: FlowRunId;
231
+ readonly flow: FlowDefinitionRef;
232
+ }
233
+
234
+ export type FlowApprovalStatus = 'approved' | 'cancelled' | 'expired' | 'pending' | 'rejected';
235
+
236
+ /*** A serializable human-approval request associated with one durable run.
237
+ *
238
+ * An approval starts `pending` and transitions exactly once to `approved`, `rejected`, `expired`,
239
+ * or `cancelled`; those states are terminal. A step approval identifies its exact attempt so a
240
+ * later retry cannot resolve an earlier request. Consumers validate timestamps and transitions.
241
+ */
242
+ export interface FlowApprovalRequest {
243
+ readonly id: string;
244
+ readonly runId: FlowRunId;
245
+ readonly step?: FlowStepRef;
246
+ readonly status: FlowApprovalStatus;
247
+ readonly requestedAt: string;
248
+ readonly expiresAt?: string;
249
+ readonly resolvedAt?: string;
250
+ readonly requestedBy?: string;
251
+ readonly resolvedBy?: string;
252
+ readonly message?: string;
253
+ readonly context?: FlowDataRef;
254
+ }
@@ -0,0 +1,98 @@
1
+ import { mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+
5
+ import { describe, expect, it } from 'bun:test';
6
+
7
+ const packageRoot = process.cwd();
8
+ const temporaryCacheDirectory = join(tmpdir(), 'contracts-flow-consumer-cache');
9
+
10
+ const runCommand = (command: string[], cwd: string): string => {
11
+ const result = Bun.spawnSync(command, {
12
+ cwd,
13
+ env: {
14
+ ...process.env,
15
+ BUN_INSTALL_CACHE_DIR: temporaryCacheDirectory,
16
+ npm_config_cache: temporaryCacheDirectory,
17
+ },
18
+ });
19
+ const output = `${result.stdout.toString()}${result.stderr.toString()}`;
20
+
21
+ expect(result.exitCode, output).toBe(0);
22
+ return output;
23
+ };
24
+
25
+ const writeConsumerFiles = (consumerDirectory: string): void => {
26
+ writeFileSync(
27
+ join(consumerDirectory, 'consumer.mjs'),
28
+ [
29
+ "import {} from '@ankhorage/contracts/flow';",
30
+ "console.log('published flow contract is available');",
31
+ ].join('\n'),
32
+ );
33
+ writeFileSync(
34
+ join(consumerDirectory, 'consumer.ts'),
35
+ [
36
+ "import type { FlowDefinition } from '@ankhorage/contracts/flow';",
37
+ "const flow: FlowDefinition = { id: 'consumer-flow', version: 1, title: 'Consumer flow', nodes: [], edges: [], triggers: [{ id: 'manual', kind: 'manual' }] };",
38
+ 'void flow;',
39
+ ].join('\n'),
40
+ );
41
+ };
42
+
43
+ const packAndInstall = (consumerDirectory: string, packedDirectory: string): void => {
44
+ runCommand(['bun', 'run', 'build'], packageRoot);
45
+ runCommand(
46
+ ['npm', 'pack', '--ignore-scripts', '--pack-destination', packedDirectory],
47
+ packageRoot,
48
+ );
49
+
50
+ const archiveName = readdirSync(packedDirectory).find((entry) => entry.endsWith('.tgz'));
51
+ expect(archiveName).toBeDefined();
52
+ runCommand(
53
+ ['bun', 'add', '--ignore-scripts', join(packedDirectory, archiveName ?? 'missing.tgz')],
54
+ consumerDirectory,
55
+ );
56
+ };
57
+
58
+ const verifyConsumer = (consumerDirectory: string): void => {
59
+ runCommand(['node', 'consumer.mjs'], consumerDirectory);
60
+ runCommand(['bun', 'consumer.mjs'], consumerDirectory);
61
+ runCommand(
62
+ [
63
+ join(packageRoot, 'node_modules/.bin/tsc'),
64
+ '--noEmit',
65
+ '--module',
66
+ 'NodeNext',
67
+ '--moduleResolution',
68
+ 'NodeNext',
69
+ '--target',
70
+ 'ES2022',
71
+ '--skipLibCheck',
72
+ 'consumer.ts',
73
+ ],
74
+ consumerDirectory,
75
+ );
76
+ };
77
+
78
+ describe('packed Flow consumer', () => {
79
+ it('supports native Node ESM, Bun, and public declarations', () => {
80
+ const temporaryDirectory = mkdtempSync(join(tmpdir(), 'contracts-flow-consumer-'));
81
+ const consumerDirectory = join(temporaryDirectory, 'package');
82
+ const packedDirectory = join(temporaryDirectory, 'packed');
83
+
84
+ try {
85
+ mkdirSync(consumerDirectory);
86
+ mkdirSync(packedDirectory);
87
+ writeFileSync(
88
+ join(consumerDirectory, 'package.json'),
89
+ JSON.stringify({ name: 'contracts-flow-consumer', private: true, type: 'module' }),
90
+ );
91
+ writeConsumerFiles(consumerDirectory);
92
+ packAndInstall(consumerDirectory, packedDirectory);
93
+ verifyConsumer(consumerDirectory);
94
+ } finally {
95
+ rmSync(temporaryDirectory, { force: true, recursive: true });
96
+ }
97
+ });
98
+ });
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ export * from './db.js';
9
9
  export * from './deploy.js';
10
10
  export * from './deployProvider.js';
11
11
  export * from './environments.js';
12
+ export * from './flow.js';
12
13
  export * from './infra.js';
13
14
  export * from './media.js';
14
15
  export * from './navigator.js';
@@ -2,12 +2,12 @@
2
2
  import type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';
3
3
 
4
4
  export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
5
- export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:dd8057c752c877b62bdc5c8db41135bd76c55dedf9bf4e1a13d7bf977f9cca56';
5
+ export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:67f55755ba8bc7a6ba9239317adbad41d62c006976654188a9f817e3c807509a';
6
6
 
7
7
  export const STRUCTURE_DESCRIPTOR = {
8
8
  "protocolVersion": 1,
9
9
  "packageName": "@ankhorage/contracts",
10
- "packageVersion": "26.6.0",
10
+ "packageVersion": "26.7.0",
11
11
  "roots": {
12
12
  "auth-flow": "AuthFlowConfig",
13
13
  "auth-profile": "AuthProfileSpec",