ai-data-workflow-contract 0.1.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/package.json +22 -0
- package/src/index.ts +163 -0
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-data-workflow-contract",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "AI Data Workflow RunGraph contracts backed by EagerDataFlow authoring plans",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"ai-workflow-contract": "0.1.0",
|
|
13
|
+
"eager-data-flow-contract": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.com"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AIDataWorkflowDefinitionBinding,
|
|
3
|
+
AIWorkflowDefinitionRef,
|
|
4
|
+
AIWorkflowEffectiveReusePolicy,
|
|
5
|
+
AIWorkflowNodeResult,
|
|
6
|
+
AIWorkflowNodeType,
|
|
7
|
+
AIWorkflowReusePolicy,
|
|
8
|
+
AIWorkflowRunRef,
|
|
9
|
+
AIWorkflowRunStatus,
|
|
10
|
+
AIWorkflowSemanticFingerprint,
|
|
11
|
+
} from 'ai-workflow-contract';
|
|
12
|
+
import type {
|
|
13
|
+
EagerDataFlowAuthoringPlan,
|
|
14
|
+
EagerDataFlowNodePlan,
|
|
15
|
+
EagerDataFlowValue,
|
|
16
|
+
FlowPortReference,
|
|
17
|
+
} from 'eager-data-flow-contract';
|
|
18
|
+
|
|
19
|
+
export type AIDataWorkflowRunNodeStatus =
|
|
20
|
+
| 'Pending'
|
|
21
|
+
| 'Ready'
|
|
22
|
+
| 'Running'
|
|
23
|
+
| 'Succeeded'
|
|
24
|
+
| 'Failed'
|
|
25
|
+
| 'Invalidated'
|
|
26
|
+
| 'Reused'
|
|
27
|
+
| 'Removed';
|
|
28
|
+
|
|
29
|
+
export type AIDataWorkflowNodeTag = EagerDataFlowNodePlan['tag'] | (string & {});
|
|
30
|
+
|
|
31
|
+
export type AIDataWorkflowNodeInputBinding = FlowPortReference | EagerDataFlowValue;
|
|
32
|
+
|
|
33
|
+
export type AIDataWorkflowNodeInputs = Readonly<Record<string, AIDataWorkflowNodeInputBinding>>;
|
|
34
|
+
|
|
35
|
+
export type AIDataWorkflowNodeConfig = Readonly<Record<string, EagerDataFlowValue>>;
|
|
36
|
+
|
|
37
|
+
export interface AIDataWorkflowInvalidation {
|
|
38
|
+
readonly nodeId: string;
|
|
39
|
+
readonly generation: number;
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
readonly sourceNodeId: string;
|
|
42
|
+
readonly atMs?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface AIDataWorkflowRunNode {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly tag: AIDataWorkflowNodeTag;
|
|
48
|
+
readonly nodeType: AIWorkflowNodeType;
|
|
49
|
+
readonly generation: number;
|
|
50
|
+
readonly status: AIDataWorkflowRunNodeStatus;
|
|
51
|
+
readonly declarationIndex: number;
|
|
52
|
+
readonly inputs: AIDataWorkflowNodeInputs;
|
|
53
|
+
readonly outputs: readonly string[];
|
|
54
|
+
readonly config: AIDataWorkflowNodeConfig;
|
|
55
|
+
readonly dependsOn: readonly string[];
|
|
56
|
+
readonly dependents: readonly string[];
|
|
57
|
+
readonly reusePolicy: AIWorkflowEffectiveReusePolicy;
|
|
58
|
+
readonly semanticFingerprint?: AIWorkflowSemanticFingerprint;
|
|
59
|
+
readonly result?: AIWorkflowNodeResult;
|
|
60
|
+
readonly invalidatedBy?: readonly AIDataWorkflowInvalidation[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface AIDataWorkflowGraphPatchNodeSpec {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly tag?: AIDataWorkflowNodeTag;
|
|
66
|
+
readonly nodeType?: AIWorkflowNodeType;
|
|
67
|
+
readonly declarationIndex?: number;
|
|
68
|
+
readonly inputs?: AIDataWorkflowNodeInputs;
|
|
69
|
+
readonly outputs?: readonly string[];
|
|
70
|
+
readonly config?: AIDataWorkflowNodeConfig;
|
|
71
|
+
readonly dependsOn?: readonly string[];
|
|
72
|
+
readonly reusePolicy?: AIWorkflowEffectiveReusePolicy;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AIDataWorkflowGraphPatchNodeChanges {
|
|
76
|
+
readonly tag?: AIDataWorkflowNodeTag;
|
|
77
|
+
readonly nodeType?: AIWorkflowNodeType;
|
|
78
|
+
readonly inputs?: AIDataWorkflowNodeInputs;
|
|
79
|
+
readonly outputs?: readonly string[];
|
|
80
|
+
readonly config?: AIDataWorkflowNodeConfig;
|
|
81
|
+
readonly dependsOn?: readonly string[];
|
|
82
|
+
readonly reusePolicy?: AIWorkflowEffectiveReusePolicy;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface AIDataWorkflowGraphPatchAddNodeOperation {
|
|
86
|
+
readonly op: 'add-node';
|
|
87
|
+
readonly node: AIDataWorkflowGraphPatchNodeSpec;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AIDataWorkflowGraphPatchUpdateNodeOperation {
|
|
91
|
+
readonly op: 'update-node';
|
|
92
|
+
readonly nodeId: string;
|
|
93
|
+
readonly changes: AIDataWorkflowGraphPatchNodeChanges;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface AIDataWorkflowGraphPatchRemoveNodeOperation {
|
|
97
|
+
readonly op: 'remove-node';
|
|
98
|
+
readonly nodeId: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type AIDataWorkflowGraphPatchOperation =
|
|
102
|
+
| AIDataWorkflowGraphPatchAddNodeOperation
|
|
103
|
+
| AIDataWorkflowGraphPatchUpdateNodeOperation
|
|
104
|
+
| AIDataWorkflowGraphPatchRemoveNodeOperation;
|
|
105
|
+
|
|
106
|
+
export interface AIDataWorkflowGraphPatch {
|
|
107
|
+
readonly patchId: string;
|
|
108
|
+
readonly reason?: string;
|
|
109
|
+
readonly operations: readonly AIDataWorkflowGraphPatchOperation[];
|
|
110
|
+
readonly atMs?: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface AIDataWorkflowPatchRecord {
|
|
114
|
+
readonly patchId: string;
|
|
115
|
+
readonly generation: number;
|
|
116
|
+
readonly reason?: string;
|
|
117
|
+
readonly operations: readonly AIDataWorkflowGraphPatchOperation[];
|
|
118
|
+
readonly atMs?: number;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface AIDataWorkflowRunGraph {
|
|
122
|
+
readonly runId: string;
|
|
123
|
+
readonly binding: AIDataWorkflowDefinitionBinding;
|
|
124
|
+
readonly currentGeneration: number;
|
|
125
|
+
readonly nodes: Readonly<Record<string, AIDataWorkflowRunNode>>;
|
|
126
|
+
readonly declarationOrder: readonly string[];
|
|
127
|
+
readonly patchHistory: readonly AIDataWorkflowPatchRecord[];
|
|
128
|
+
readonly invalidations: readonly AIDataWorkflowInvalidation[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface AIDataWorkflowSemanticInput {
|
|
132
|
+
readonly nodeId: string;
|
|
133
|
+
readonly nodeTag: AIDataWorkflowNodeTag;
|
|
134
|
+
readonly effectiveInput: unknown;
|
|
135
|
+
readonly config?: AIDataWorkflowNodeConfig;
|
|
136
|
+
readonly materialRevisions?: Readonly<Record<string, string>>;
|
|
137
|
+
readonly effectPolicy?: unknown;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface AIDataWorkflowReuseCandidate {
|
|
141
|
+
readonly runId: string;
|
|
142
|
+
readonly nodeId: string;
|
|
143
|
+
readonly generation: number;
|
|
144
|
+
readonly result: AIWorkflowNodeResult;
|
|
145
|
+
readonly semanticFingerprint: AIWorkflowSemanticFingerprint;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface AIDataWorkflowRunRecord {
|
|
149
|
+
readonly ref: AIWorkflowRunRef;
|
|
150
|
+
readonly status: AIWorkflowRunStatus;
|
|
151
|
+
readonly workflow: AIWorkflowDefinitionRef;
|
|
152
|
+
readonly graph: AIDataWorkflowRunGraph;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface AIDataWorkflowDefinition {
|
|
156
|
+
readonly binding: AIDataWorkflowDefinitionBinding;
|
|
157
|
+
readonly resourceRef?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface AIDataWorkflowPlanProjection {
|
|
161
|
+
readonly binding: AIDataWorkflowDefinitionBinding;
|
|
162
|
+
readonly plan: EagerDataFlowAuthoringPlan;
|
|
163
|
+
}
|