@atom-workflow-agent/contracts 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/LICENSE +201 -0
- package/README.md +31 -0
- package/README.zh-CN.md +31 -0
- package/dist/atoms/agent.d.ts +29 -0
- package/dist/atoms/agent.d.ts.map +1 -0
- package/dist/atoms/agent.js +22 -0
- package/dist/atoms/agent.js.map +1 -0
- package/dist/atoms/descriptors.d.ts +88 -0
- package/dist/atoms/descriptors.d.ts.map +1 -0
- package/dist/atoms/descriptors.js +56 -0
- package/dist/atoms/descriptors.js.map +1 -0
- package/dist/atoms/host.d.ts +200 -0
- package/dist/atoms/host.d.ts.map +1 -0
- package/dist/atoms/host.js +109 -0
- package/dist/atoms/host.js.map +1 -0
- package/dist/atoms/lifecycle.d.ts +257 -0
- package/dist/atoms/lifecycle.d.ts.map +1 -0
- package/dist/atoms/lifecycle.js +201 -0
- package/dist/atoms/lifecycle.js.map +1 -0
- package/dist/atoms/manifest.d.ts +68 -0
- package/dist/atoms/manifest.d.ts.map +1 -0
- package/dist/atoms/manifest.js +144 -0
- package/dist/atoms/manifest.js.map +1 -0
- package/dist/atoms/package.d.ts +11 -0
- package/dist/atoms/package.d.ts.map +1 -0
- package/dist/atoms/package.js +11 -0
- package/dist/atoms/package.js.map +1 -0
- package/dist/errors/atom-workflow-error.d.ts +7 -0
- package/dist/errors/atom-workflow-error.d.ts.map +1 -0
- package/dist/errors/atom-workflow-error.js +21 -0
- package/dist/errors/atom-workflow-error.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/json-schema/validate-instance.d.ts +7 -0
- package/dist/json-schema/validate-instance.d.ts.map +1 -0
- package/dist/json-schema/validate-instance.js +186 -0
- package/dist/json-schema/validate-instance.js.map +1 -0
- package/dist/planner/plan-record.d.ts +194 -0
- package/dist/planner/plan-record.d.ts.map +1 -0
- package/dist/planner/plan-record.js +57 -0
- package/dist/planner/plan-record.js.map +1 -0
- package/dist/planner/planner-draft.d.ts +194 -0
- package/dist/planner/planner-draft.d.ts.map +1 -0
- package/dist/planner/planner-draft.js +102 -0
- package/dist/planner/planner-draft.js.map +1 -0
- package/dist/planner/planner-validation.d.ts +830 -0
- package/dist/planner/planner-validation.d.ts.map +1 -0
- package/dist/planner/planner-validation.js +52 -0
- package/dist/planner/planner-validation.js.map +1 -0
- package/dist/planner/planner.d.ts +456 -0
- package/dist/planner/planner.d.ts.map +1 -0
- package/dist/planner/planner.js +85 -0
- package/dist/planner/planner.js.map +1 -0
- package/dist/planner/planning-capability.d.ts +576 -0
- package/dist/planner/planning-capability.d.ts.map +1 -0
- package/dist/planner/planning-capability.js +105 -0
- package/dist/planner/planning-capability.js.map +1 -0
- package/dist/planner/planning-workspace.d.ts +1791 -0
- package/dist/planner/planning-workspace.d.ts.map +1 -0
- package/dist/planner/planning-workspace.js +279 -0
- package/dist/planner/planning-workspace.js.map +1 -0
- package/dist/runtime/diagnostics.d.ts +35 -0
- package/dist/runtime/diagnostics.d.ts.map +1 -0
- package/dist/runtime/diagnostics.js +22 -0
- package/dist/runtime/diagnostics.js.map +1 -0
- package/dist/runtime/machine.d.ts +52 -0
- package/dist/runtime/machine.d.ts.map +1 -0
- package/dist/runtime/machine.js +41 -0
- package/dist/runtime/machine.js.map +1 -0
- package/dist/runtime/records.d.ts +306 -0
- package/dist/runtime/records.d.ts.map +1 -0
- package/dist/runtime/records.js +213 -0
- package/dist/runtime/records.js.map +1 -0
- package/dist/runtime/resume.d.ts +32 -0
- package/dist/runtime/resume.d.ts.map +1 -0
- package/dist/runtime/resume.js +19 -0
- package/dist/runtime/resume.js.map +1 -0
- package/dist/workflows/ir.d.ts +117 -0
- package/dist/workflows/ir.d.ts.map +1 -0
- package/dist/workflows/ir.js +2 -0
- package/dist/workflows/ir.js.map +1 -0
- package/dist/workflows/policy.d.ts +22 -0
- package/dist/workflows/policy.d.ts.map +1 -0
- package/dist/workflows/policy.js +22 -0
- package/dist/workflows/policy.js.map +1 -0
- package/dist/workflows/revision.d.ts +187 -0
- package/dist/workflows/revision.d.ts.map +1 -0
- package/dist/workflows/revision.js +61 -0
- package/dist/workflows/revision.js.map +1 -0
- package/dist/workflows/spec.d.ts +427 -0
- package/dist/workflows/spec.d.ts.map +1 -0
- package/dist/workflows/spec.js +86 -0
- package/dist/workflows/spec.js.map +1 -0
- package/dist/workflows/topology.d.ts +58 -0
- package/dist/workflows/topology.d.ts.map +1 -0
- package/dist/workflows/topology.js +37 -0
- package/dist/workflows/topology.js.map +1 -0
- package/dist/workflows/validation.d.ts +247 -0
- package/dist/workflows/validation.d.ts.map +1 -0
- package/dist/workflows/validation.js +130 -0
- package/dist/workflows/validation.js.map +1 -0
- package/dist/workflows/visualization.d.ts +526 -0
- package/dist/workflows/visualization.d.ts.map +1 -0
- package/dist/workflows/visualization.js +132 -0
- package/dist/workflows/visualization.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A semantic role mapped to one exact top-level Atom field. Schema remains Runtime-owned. */
|
|
3
|
+
export declare const CapabilityPortReferenceSchema: z.ZodObject<{
|
|
4
|
+
role: z.ZodString;
|
|
5
|
+
field: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export type CapabilityPortReference = z.infer<typeof CapabilityPortReferenceSchema>;
|
|
8
|
+
export declare const CapabilityAtomUseSchema: z.ZodObject<{
|
|
9
|
+
atom: z.ZodString;
|
|
10
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
11
|
+
role: z.ZodString;
|
|
12
|
+
field: z.ZodString;
|
|
13
|
+
}, z.core.$strict>>>;
|
|
14
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
15
|
+
role: z.ZodString;
|
|
16
|
+
field: z.ZodString;
|
|
17
|
+
}, z.core.$strict>>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type CapabilityAtomUse = z.infer<typeof CapabilityAtomUseSchema>;
|
|
20
|
+
/** Coarse business shape used only to report a genuinely missing Atom contract. */
|
|
21
|
+
export declare const CapabilityDesiredPortSchema: z.ZodObject<{
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
description: z.ZodString;
|
|
24
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
26
|
+
string: "string";
|
|
27
|
+
number: "number";
|
|
28
|
+
boolean: "boolean";
|
|
29
|
+
object: "object";
|
|
30
|
+
null: "null";
|
|
31
|
+
array: "array";
|
|
32
|
+
integer: "integer";
|
|
33
|
+
}>>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type CapabilityDesiredPort = z.infer<typeof CapabilityDesiredPortSchema>;
|
|
36
|
+
export declare const CapabilityResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"covered">;
|
|
38
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
39
|
+
atom: z.ZodString;
|
|
40
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
41
|
+
role: z.ZodString;
|
|
42
|
+
field: z.ZodString;
|
|
43
|
+
}, z.core.$strict>>>;
|
|
44
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
45
|
+
role: z.ZodString;
|
|
46
|
+
field: z.ZodString;
|
|
47
|
+
}, z.core.$strict>>>;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"missing">;
|
|
51
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
description: z.ZodString;
|
|
54
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
56
|
+
string: "string";
|
|
57
|
+
number: "number";
|
|
58
|
+
boolean: "boolean";
|
|
59
|
+
object: "object";
|
|
60
|
+
null: "null";
|
|
61
|
+
array: "array";
|
|
62
|
+
integer: "integer";
|
|
63
|
+
}>>;
|
|
64
|
+
}, z.core.$strict>>>;
|
|
65
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
description: z.ZodString;
|
|
68
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
70
|
+
string: "string";
|
|
71
|
+
number: "number";
|
|
72
|
+
boolean: "boolean";
|
|
73
|
+
object: "object";
|
|
74
|
+
null: "null";
|
|
75
|
+
array: "array";
|
|
76
|
+
integer: "integer";
|
|
77
|
+
}>>;
|
|
78
|
+
}, z.core.$strict>>>;
|
|
79
|
+
}, z.core.$strict>], "kind">;
|
|
80
|
+
export type CapabilityResolution = z.infer<typeof CapabilityResolutionSchema>;
|
|
81
|
+
export declare const CapabilityRequirementSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
description: z.ZodString;
|
|
84
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"covered">;
|
|
87
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
88
|
+
atom: z.ZodString;
|
|
89
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
90
|
+
role: z.ZodString;
|
|
91
|
+
field: z.ZodString;
|
|
92
|
+
}, z.core.$strict>>>;
|
|
93
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
94
|
+
role: z.ZodString;
|
|
95
|
+
field: z.ZodString;
|
|
96
|
+
}, z.core.$strict>>>;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
kind: z.ZodLiteral<"missing">;
|
|
100
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
description: z.ZodString;
|
|
103
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
105
|
+
string: "string";
|
|
106
|
+
number: "number";
|
|
107
|
+
boolean: "boolean";
|
|
108
|
+
object: "object";
|
|
109
|
+
null: "null";
|
|
110
|
+
array: "array";
|
|
111
|
+
integer: "integer";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strict>>>;
|
|
114
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
description: z.ZodString;
|
|
117
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
119
|
+
string: "string";
|
|
120
|
+
number: "number";
|
|
121
|
+
boolean: "boolean";
|
|
122
|
+
object: "object";
|
|
123
|
+
null: "null";
|
|
124
|
+
array: "array";
|
|
125
|
+
integer: "integer";
|
|
126
|
+
}>>;
|
|
127
|
+
}, z.core.$strict>>>;
|
|
128
|
+
}, z.core.$strict>], "kind">;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
export type CapabilityRequirement = z.infer<typeof CapabilityRequirementSchema>;
|
|
131
|
+
export declare const PlannerCapabilityPlanSchema: z.ZodObject<{
|
|
132
|
+
schemaVersion: z.ZodLiteral<"1.1">;
|
|
133
|
+
kind: z.ZodLiteral<"capability-plan">;
|
|
134
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
description: z.ZodString;
|
|
137
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
138
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
139
|
+
kind: z.ZodLiteral<"covered">;
|
|
140
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
141
|
+
atom: z.ZodString;
|
|
142
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
143
|
+
role: z.ZodString;
|
|
144
|
+
field: z.ZodString;
|
|
145
|
+
}, z.core.$strict>>>;
|
|
146
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
147
|
+
role: z.ZodString;
|
|
148
|
+
field: z.ZodString;
|
|
149
|
+
}, z.core.$strict>>>;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"missing">;
|
|
153
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
description: z.ZodString;
|
|
156
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
157
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
158
|
+
string: "string";
|
|
159
|
+
number: "number";
|
|
160
|
+
boolean: "boolean";
|
|
161
|
+
object: "object";
|
|
162
|
+
null: "null";
|
|
163
|
+
array: "array";
|
|
164
|
+
integer: "integer";
|
|
165
|
+
}>>;
|
|
166
|
+
}, z.core.$strict>>>;
|
|
167
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
168
|
+
name: z.ZodString;
|
|
169
|
+
description: z.ZodString;
|
|
170
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
172
|
+
string: "string";
|
|
173
|
+
number: "number";
|
|
174
|
+
boolean: "boolean";
|
|
175
|
+
object: "object";
|
|
176
|
+
null: "null";
|
|
177
|
+
array: "array";
|
|
178
|
+
integer: "integer";
|
|
179
|
+
}>>;
|
|
180
|
+
}, z.core.$strict>>>;
|
|
181
|
+
}, z.core.$strict>], "kind">;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
export type PlannerCapabilityPlan = z.infer<typeof PlannerCapabilityPlanSchema>;
|
|
185
|
+
export declare const CapabilityNearMatchSchema: z.ZodObject<{
|
|
186
|
+
atomKey: z.ZodString;
|
|
187
|
+
title: z.ZodString;
|
|
188
|
+
purpose: z.ZodString;
|
|
189
|
+
score: z.ZodNumber;
|
|
190
|
+
rejectedBecause: z.ZodString;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
export declare const SuggestedAtomContractSchema: z.ZodObject<{
|
|
193
|
+
suggestedId: z.ZodString;
|
|
194
|
+
description: z.ZodString;
|
|
195
|
+
inputFields: z.ZodArray<z.ZodObject<{
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
description: z.ZodString;
|
|
198
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
200
|
+
string: "string";
|
|
201
|
+
number: "number";
|
|
202
|
+
boolean: "boolean";
|
|
203
|
+
object: "object";
|
|
204
|
+
null: "null";
|
|
205
|
+
array: "array";
|
|
206
|
+
integer: "integer";
|
|
207
|
+
}>>;
|
|
208
|
+
}, z.core.$strict>>;
|
|
209
|
+
outputFields: z.ZodArray<z.ZodObject<{
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
description: z.ZodString;
|
|
212
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
213
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
214
|
+
string: "string";
|
|
215
|
+
number: "number";
|
|
216
|
+
boolean: "boolean";
|
|
217
|
+
object: "object";
|
|
218
|
+
null: "null";
|
|
219
|
+
array: "array";
|
|
220
|
+
integer: "integer";
|
|
221
|
+
}>>;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export type SuggestedAtomContract = z.infer<typeof SuggestedAtomContractSchema>;
|
|
225
|
+
export declare const CapabilityFieldIssueSchema: z.ZodObject<{
|
|
226
|
+
atomKey: z.ZodString;
|
|
227
|
+
direction: z.ZodEnum<{
|
|
228
|
+
input: "input";
|
|
229
|
+
output: "output";
|
|
230
|
+
}>;
|
|
231
|
+
field: z.ZodString;
|
|
232
|
+
reason: z.ZodEnum<{
|
|
233
|
+
"field-not-found": "field-not-found";
|
|
234
|
+
"required-input-not-declared": "required-input-not-declared";
|
|
235
|
+
}>;
|
|
236
|
+
availableFields: z.ZodArray<z.ZodString>;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
export type CapabilityFieldIssue = z.infer<typeof CapabilityFieldIssueSchema>;
|
|
239
|
+
export declare const CapabilityGapSchema: z.ZodObject<{
|
|
240
|
+
requirement: z.ZodObject<{
|
|
241
|
+
id: z.ZodString;
|
|
242
|
+
description: z.ZodString;
|
|
243
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
244
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
245
|
+
kind: z.ZodLiteral<"covered">;
|
|
246
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
247
|
+
atom: z.ZodString;
|
|
248
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
249
|
+
role: z.ZodString;
|
|
250
|
+
field: z.ZodString;
|
|
251
|
+
}, z.core.$strict>>>;
|
|
252
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
253
|
+
role: z.ZodString;
|
|
254
|
+
field: z.ZodString;
|
|
255
|
+
}, z.core.$strict>>>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
257
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
258
|
+
kind: z.ZodLiteral<"missing">;
|
|
259
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
description: z.ZodString;
|
|
262
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
263
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
264
|
+
string: "string";
|
|
265
|
+
number: "number";
|
|
266
|
+
boolean: "boolean";
|
|
267
|
+
object: "object";
|
|
268
|
+
null: "null";
|
|
269
|
+
array: "array";
|
|
270
|
+
integer: "integer";
|
|
271
|
+
}>>;
|
|
272
|
+
}, z.core.$strict>>>;
|
|
273
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
274
|
+
name: z.ZodString;
|
|
275
|
+
description: z.ZodString;
|
|
276
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
277
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
278
|
+
string: "string";
|
|
279
|
+
number: "number";
|
|
280
|
+
boolean: "boolean";
|
|
281
|
+
object: "object";
|
|
282
|
+
null: "null";
|
|
283
|
+
array: "array";
|
|
284
|
+
integer: "integer";
|
|
285
|
+
}>>;
|
|
286
|
+
}, z.core.$strict>>>;
|
|
287
|
+
}, z.core.$strict>], "kind">;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
code: z.ZodEnum<{
|
|
290
|
+
PLANNING_CAPABILITY_UNAVAILABLE: "PLANNING_CAPABILITY_UNAVAILABLE";
|
|
291
|
+
PLANNING_CAPABILITY_ATOM_UNKNOWN: "PLANNING_CAPABILITY_ATOM_UNKNOWN";
|
|
292
|
+
PLANNING_CAPABILITY_SCHEMA_MISMATCH: "PLANNING_CAPABILITY_SCHEMA_MISMATCH";
|
|
293
|
+
}>;
|
|
294
|
+
message: z.ZodString;
|
|
295
|
+
nearMatches: z.ZodArray<z.ZodObject<{
|
|
296
|
+
atomKey: z.ZodString;
|
|
297
|
+
title: z.ZodString;
|
|
298
|
+
purpose: z.ZodString;
|
|
299
|
+
score: z.ZodNumber;
|
|
300
|
+
rejectedBecause: z.ZodString;
|
|
301
|
+
}, z.core.$strict>>;
|
|
302
|
+
suggestedAtomContract: z.ZodObject<{
|
|
303
|
+
suggestedId: z.ZodString;
|
|
304
|
+
description: z.ZodString;
|
|
305
|
+
inputFields: z.ZodArray<z.ZodObject<{
|
|
306
|
+
name: z.ZodString;
|
|
307
|
+
description: z.ZodString;
|
|
308
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
309
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
310
|
+
string: "string";
|
|
311
|
+
number: "number";
|
|
312
|
+
boolean: "boolean";
|
|
313
|
+
object: "object";
|
|
314
|
+
null: "null";
|
|
315
|
+
array: "array";
|
|
316
|
+
integer: "integer";
|
|
317
|
+
}>>;
|
|
318
|
+
}, z.core.$strict>>;
|
|
319
|
+
outputFields: z.ZodArray<z.ZodObject<{
|
|
320
|
+
name: z.ZodString;
|
|
321
|
+
description: z.ZodString;
|
|
322
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
323
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
324
|
+
string: "string";
|
|
325
|
+
number: "number";
|
|
326
|
+
boolean: "boolean";
|
|
327
|
+
object: "object";
|
|
328
|
+
null: "null";
|
|
329
|
+
array: "array";
|
|
330
|
+
integer: "integer";
|
|
331
|
+
}>>;
|
|
332
|
+
}, z.core.$strict>>;
|
|
333
|
+
}, z.core.$strict>;
|
|
334
|
+
fieldIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
335
|
+
atomKey: z.ZodString;
|
|
336
|
+
direction: z.ZodEnum<{
|
|
337
|
+
input: "input";
|
|
338
|
+
output: "output";
|
|
339
|
+
}>;
|
|
340
|
+
field: z.ZodString;
|
|
341
|
+
reason: z.ZodEnum<{
|
|
342
|
+
"field-not-found": "field-not-found";
|
|
343
|
+
"required-input-not-declared": "required-input-not-declared";
|
|
344
|
+
}>;
|
|
345
|
+
availableFields: z.ZodArray<z.ZodString>;
|
|
346
|
+
}, z.core.$strict>>>;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
export type CapabilityGap = z.infer<typeof CapabilityGapSchema>;
|
|
349
|
+
export declare const CapabilityCoverageResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
350
|
+
schemaVersion: z.ZodLiteral<"1.1">;
|
|
351
|
+
status: z.ZodLiteral<"covered">;
|
|
352
|
+
catalogHash: z.ZodString;
|
|
353
|
+
plan: z.ZodObject<{
|
|
354
|
+
schemaVersion: z.ZodLiteral<"1.1">;
|
|
355
|
+
kind: z.ZodLiteral<"capability-plan">;
|
|
356
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
357
|
+
id: z.ZodString;
|
|
358
|
+
description: z.ZodString;
|
|
359
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
360
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
361
|
+
kind: z.ZodLiteral<"covered">;
|
|
362
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
363
|
+
atom: z.ZodString;
|
|
364
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
365
|
+
role: z.ZodString;
|
|
366
|
+
field: z.ZodString;
|
|
367
|
+
}, z.core.$strict>>>;
|
|
368
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
369
|
+
role: z.ZodString;
|
|
370
|
+
field: z.ZodString;
|
|
371
|
+
}, z.core.$strict>>>;
|
|
372
|
+
}, z.core.$strict>>;
|
|
373
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
374
|
+
kind: z.ZodLiteral<"missing">;
|
|
375
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
376
|
+
name: z.ZodString;
|
|
377
|
+
description: z.ZodString;
|
|
378
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
379
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
380
|
+
string: "string";
|
|
381
|
+
number: "number";
|
|
382
|
+
boolean: "boolean";
|
|
383
|
+
object: "object";
|
|
384
|
+
null: "null";
|
|
385
|
+
array: "array";
|
|
386
|
+
integer: "integer";
|
|
387
|
+
}>>;
|
|
388
|
+
}, z.core.$strict>>>;
|
|
389
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
390
|
+
name: z.ZodString;
|
|
391
|
+
description: z.ZodString;
|
|
392
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
393
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
394
|
+
string: "string";
|
|
395
|
+
number: "number";
|
|
396
|
+
boolean: "boolean";
|
|
397
|
+
object: "object";
|
|
398
|
+
null: "null";
|
|
399
|
+
array: "array";
|
|
400
|
+
integer: "integer";
|
|
401
|
+
}>>;
|
|
402
|
+
}, z.core.$strict>>>;
|
|
403
|
+
}, z.core.$strict>], "kind">;
|
|
404
|
+
}, z.core.$strict>>;
|
|
405
|
+
}, z.core.$strict>;
|
|
406
|
+
selectedAtomKeys: z.ZodArray<z.ZodString>;
|
|
407
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
408
|
+
schemaVersion: z.ZodLiteral<"1.1">;
|
|
409
|
+
status: z.ZodLiteral<"blocked_missing_atom">;
|
|
410
|
+
catalogHash: z.ZodString;
|
|
411
|
+
plan: z.ZodObject<{
|
|
412
|
+
schemaVersion: z.ZodLiteral<"1.1">;
|
|
413
|
+
kind: z.ZodLiteral<"capability-plan">;
|
|
414
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
415
|
+
id: z.ZodString;
|
|
416
|
+
description: z.ZodString;
|
|
417
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
418
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
419
|
+
kind: z.ZodLiteral<"covered">;
|
|
420
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
421
|
+
atom: z.ZodString;
|
|
422
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
423
|
+
role: z.ZodString;
|
|
424
|
+
field: z.ZodString;
|
|
425
|
+
}, z.core.$strict>>>;
|
|
426
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
427
|
+
role: z.ZodString;
|
|
428
|
+
field: z.ZodString;
|
|
429
|
+
}, z.core.$strict>>>;
|
|
430
|
+
}, z.core.$strict>>;
|
|
431
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
432
|
+
kind: z.ZodLiteral<"missing">;
|
|
433
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
434
|
+
name: z.ZodString;
|
|
435
|
+
description: z.ZodString;
|
|
436
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
437
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
438
|
+
string: "string";
|
|
439
|
+
number: "number";
|
|
440
|
+
boolean: "boolean";
|
|
441
|
+
object: "object";
|
|
442
|
+
null: "null";
|
|
443
|
+
array: "array";
|
|
444
|
+
integer: "integer";
|
|
445
|
+
}>>;
|
|
446
|
+
}, z.core.$strict>>>;
|
|
447
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
448
|
+
name: z.ZodString;
|
|
449
|
+
description: z.ZodString;
|
|
450
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
451
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
452
|
+
string: "string";
|
|
453
|
+
number: "number";
|
|
454
|
+
boolean: "boolean";
|
|
455
|
+
object: "object";
|
|
456
|
+
null: "null";
|
|
457
|
+
array: "array";
|
|
458
|
+
integer: "integer";
|
|
459
|
+
}>>;
|
|
460
|
+
}, z.core.$strict>>>;
|
|
461
|
+
}, z.core.$strict>], "kind">;
|
|
462
|
+
}, z.core.$strict>>;
|
|
463
|
+
}, z.core.$strict>;
|
|
464
|
+
searchedAtomCount: z.ZodNumber;
|
|
465
|
+
gaps: z.ZodArray<z.ZodObject<{
|
|
466
|
+
requirement: z.ZodObject<{
|
|
467
|
+
id: z.ZodString;
|
|
468
|
+
description: z.ZodString;
|
|
469
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
470
|
+
resolution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
471
|
+
kind: z.ZodLiteral<"covered">;
|
|
472
|
+
uses: z.ZodArray<z.ZodObject<{
|
|
473
|
+
atom: z.ZodString;
|
|
474
|
+
inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
475
|
+
role: z.ZodString;
|
|
476
|
+
field: z.ZodString;
|
|
477
|
+
}, z.core.$strict>>>;
|
|
478
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
479
|
+
role: z.ZodString;
|
|
480
|
+
field: z.ZodString;
|
|
481
|
+
}, z.core.$strict>>>;
|
|
482
|
+
}, z.core.$strict>>;
|
|
483
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
484
|
+
kind: z.ZodLiteral<"missing">;
|
|
485
|
+
desiredInputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
486
|
+
name: z.ZodString;
|
|
487
|
+
description: z.ZodString;
|
|
488
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
489
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
490
|
+
string: "string";
|
|
491
|
+
number: "number";
|
|
492
|
+
boolean: "boolean";
|
|
493
|
+
object: "object";
|
|
494
|
+
null: "null";
|
|
495
|
+
array: "array";
|
|
496
|
+
integer: "integer";
|
|
497
|
+
}>>;
|
|
498
|
+
}, z.core.$strict>>>;
|
|
499
|
+
desiredOutputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
500
|
+
name: z.ZodString;
|
|
501
|
+
description: z.ZodString;
|
|
502
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
503
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
504
|
+
string: "string";
|
|
505
|
+
number: "number";
|
|
506
|
+
boolean: "boolean";
|
|
507
|
+
object: "object";
|
|
508
|
+
null: "null";
|
|
509
|
+
array: "array";
|
|
510
|
+
integer: "integer";
|
|
511
|
+
}>>;
|
|
512
|
+
}, z.core.$strict>>>;
|
|
513
|
+
}, z.core.$strict>], "kind">;
|
|
514
|
+
}, z.core.$strict>;
|
|
515
|
+
code: z.ZodEnum<{
|
|
516
|
+
PLANNING_CAPABILITY_UNAVAILABLE: "PLANNING_CAPABILITY_UNAVAILABLE";
|
|
517
|
+
PLANNING_CAPABILITY_ATOM_UNKNOWN: "PLANNING_CAPABILITY_ATOM_UNKNOWN";
|
|
518
|
+
PLANNING_CAPABILITY_SCHEMA_MISMATCH: "PLANNING_CAPABILITY_SCHEMA_MISMATCH";
|
|
519
|
+
}>;
|
|
520
|
+
message: z.ZodString;
|
|
521
|
+
nearMatches: z.ZodArray<z.ZodObject<{
|
|
522
|
+
atomKey: z.ZodString;
|
|
523
|
+
title: z.ZodString;
|
|
524
|
+
purpose: z.ZodString;
|
|
525
|
+
score: z.ZodNumber;
|
|
526
|
+
rejectedBecause: z.ZodString;
|
|
527
|
+
}, z.core.$strict>>;
|
|
528
|
+
suggestedAtomContract: z.ZodObject<{
|
|
529
|
+
suggestedId: z.ZodString;
|
|
530
|
+
description: z.ZodString;
|
|
531
|
+
inputFields: z.ZodArray<z.ZodObject<{
|
|
532
|
+
name: z.ZodString;
|
|
533
|
+
description: z.ZodString;
|
|
534
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
535
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
536
|
+
string: "string";
|
|
537
|
+
number: "number";
|
|
538
|
+
boolean: "boolean";
|
|
539
|
+
object: "object";
|
|
540
|
+
null: "null";
|
|
541
|
+
array: "array";
|
|
542
|
+
integer: "integer";
|
|
543
|
+
}>>;
|
|
544
|
+
}, z.core.$strict>>;
|
|
545
|
+
outputFields: z.ZodArray<z.ZodObject<{
|
|
546
|
+
name: z.ZodString;
|
|
547
|
+
description: z.ZodString;
|
|
548
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
549
|
+
acceptedTypes: z.ZodArray<z.ZodEnum<{
|
|
550
|
+
string: "string";
|
|
551
|
+
number: "number";
|
|
552
|
+
boolean: "boolean";
|
|
553
|
+
object: "object";
|
|
554
|
+
null: "null";
|
|
555
|
+
array: "array";
|
|
556
|
+
integer: "integer";
|
|
557
|
+
}>>;
|
|
558
|
+
}, z.core.$strict>>;
|
|
559
|
+
}, z.core.$strict>;
|
|
560
|
+
fieldIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
561
|
+
atomKey: z.ZodString;
|
|
562
|
+
direction: z.ZodEnum<{
|
|
563
|
+
input: "input";
|
|
564
|
+
output: "output";
|
|
565
|
+
}>;
|
|
566
|
+
field: z.ZodString;
|
|
567
|
+
reason: z.ZodEnum<{
|
|
568
|
+
"field-not-found": "field-not-found";
|
|
569
|
+
"required-input-not-declared": "required-input-not-declared";
|
|
570
|
+
}>;
|
|
571
|
+
availableFields: z.ZodArray<z.ZodString>;
|
|
572
|
+
}, z.core.$strict>>>;
|
|
573
|
+
}, z.core.$strict>>;
|
|
574
|
+
}, z.core.$strict>], "status">;
|
|
575
|
+
export type CapabilityCoverageResult = z.infer<typeof CapabilityCoverageResultSchema>;
|
|
576
|
+
//# sourceMappingURL=planning-capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planning-capability.d.ts","sourceRoot":"","sources":["../../src/planner/planning-capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,8FAA8F;AAC9F,eAAO,MAAM,6BAA6B;;;kBAG/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAWlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,mFAAmF;AACnF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;kBAStC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAUrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAStC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,yBAAyB;;;;;;kBAM3B,CAAC;AAEZ,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;kBAM5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAgBzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PlannerCatalogFieldTypeSchema } from "../atoms/descriptors.js";
|
|
3
|
+
import { WorkflowAtomReferenceSchema } from "../workflows/spec.js";
|
|
4
|
+
const HashSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
5
|
+
/** A semantic role mapped to one exact top-level Atom field. Schema remains Runtime-owned. */
|
|
6
|
+
export const CapabilityPortReferenceSchema = z.object({
|
|
7
|
+
role: z.string().trim().min(1),
|
|
8
|
+
field: z.string().trim().min(1),
|
|
9
|
+
}).strict();
|
|
10
|
+
export const CapabilityAtomUseSchema = z.object({
|
|
11
|
+
atom: WorkflowAtomReferenceSchema,
|
|
12
|
+
inputs: z.array(CapabilityPortReferenceSchema).default([]),
|
|
13
|
+
outputs: z.array(CapabilityPortReferenceSchema).default([]),
|
|
14
|
+
}).strict().superRefine((use, context) => {
|
|
15
|
+
for (const [direction, ports] of [["inputs", use.inputs], ["outputs", use.outputs]]) {
|
|
16
|
+
const fields = ports.map(({ field }) => field);
|
|
17
|
+
if (new Set(fields).size !== fields.length) {
|
|
18
|
+
context.addIssue({ code: "custom", path: [direction], message: `Capability ${direction} must reference unique Atom fields` });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
/** Coarse business shape used only to report a genuinely missing Atom contract. */
|
|
23
|
+
export const CapabilityDesiredPortSchema = z.object({
|
|
24
|
+
name: z.string().trim().min(1),
|
|
25
|
+
description: z.string().trim().min(1),
|
|
26
|
+
required: z.boolean().default(true),
|
|
27
|
+
acceptedTypes: z.array(PlannerCatalogFieldTypeSchema).min(1).max(7),
|
|
28
|
+
}).strict().superRefine((port, context) => {
|
|
29
|
+
if (new Set(port.acceptedTypes).size !== port.acceptedTypes.length) {
|
|
30
|
+
context.addIssue({ code: "custom", path: ["acceptedTypes"], message: "Desired port types must be unique" });
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export const CapabilityResolutionSchema = z.discriminatedUnion("kind", [
|
|
34
|
+
z.object({
|
|
35
|
+
kind: z.literal("covered"),
|
|
36
|
+
uses: z.array(CapabilityAtomUseSchema).min(1).max(128),
|
|
37
|
+
}).strict(),
|
|
38
|
+
z.object({
|
|
39
|
+
kind: z.literal("missing"),
|
|
40
|
+
desiredInputs: z.array(CapabilityDesiredPortSchema).default([]),
|
|
41
|
+
desiredOutputs: z.array(CapabilityDesiredPortSchema).default([]),
|
|
42
|
+
}).strict(),
|
|
43
|
+
]);
|
|
44
|
+
export const CapabilityRequirementSchema = z.object({
|
|
45
|
+
id: z.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/),
|
|
46
|
+
description: z.string().trim().min(1),
|
|
47
|
+
required: z.boolean().default(true),
|
|
48
|
+
resolution: CapabilityResolutionSchema,
|
|
49
|
+
}).strict();
|
|
50
|
+
export const PlannerCapabilityPlanSchema = z.object({
|
|
51
|
+
schemaVersion: z.literal("1.1"),
|
|
52
|
+
kind: z.literal("capability-plan"),
|
|
53
|
+
requirements: z.array(CapabilityRequirementSchema).min(1).max(128),
|
|
54
|
+
}).strict().superRefine((plan, context) => {
|
|
55
|
+
const ids = plan.requirements.map(({ id }) => id);
|
|
56
|
+
if (new Set(ids).size !== ids.length) {
|
|
57
|
+
context.addIssue({ code: "custom", path: ["requirements"], message: "Capability requirement ids must be unique" });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export const CapabilityNearMatchSchema = z.object({
|
|
61
|
+
atomKey: WorkflowAtomReferenceSchema,
|
|
62
|
+
title: z.string().trim().min(1),
|
|
63
|
+
purpose: z.string().trim().min(1),
|
|
64
|
+
score: z.number().min(0).max(1),
|
|
65
|
+
rejectedBecause: z.string().trim().min(1),
|
|
66
|
+
}).strict();
|
|
67
|
+
export const SuggestedAtomContractSchema = z.object({
|
|
68
|
+
suggestedId: z.string().regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),
|
|
69
|
+
description: z.string().trim().min(1),
|
|
70
|
+
inputFields: z.array(CapabilityDesiredPortSchema),
|
|
71
|
+
outputFields: z.array(CapabilityDesiredPortSchema),
|
|
72
|
+
}).strict();
|
|
73
|
+
export const CapabilityFieldIssueSchema = z.object({
|
|
74
|
+
atomKey: WorkflowAtomReferenceSchema,
|
|
75
|
+
direction: z.enum(["input", "output"]),
|
|
76
|
+
field: z.string().trim().min(1),
|
|
77
|
+
reason: z.enum(["field-not-found", "required-input-not-declared"]),
|
|
78
|
+
availableFields: z.array(z.string().trim().min(1)),
|
|
79
|
+
}).strict();
|
|
80
|
+
export const CapabilityGapSchema = z.object({
|
|
81
|
+
requirement: CapabilityRequirementSchema,
|
|
82
|
+
code: z.enum(["PLANNING_CAPABILITY_UNAVAILABLE", "PLANNING_CAPABILITY_ATOM_UNKNOWN", "PLANNING_CAPABILITY_SCHEMA_MISMATCH"]),
|
|
83
|
+
message: z.string().trim().min(1),
|
|
84
|
+
nearMatches: z.array(CapabilityNearMatchSchema).max(5),
|
|
85
|
+
suggestedAtomContract: SuggestedAtomContractSchema,
|
|
86
|
+
fieldIssues: z.array(CapabilityFieldIssueSchema).optional(),
|
|
87
|
+
}).strict();
|
|
88
|
+
export const CapabilityCoverageResultSchema = z.discriminatedUnion("status", [
|
|
89
|
+
z.object({
|
|
90
|
+
schemaVersion: z.literal("1.1"),
|
|
91
|
+
status: z.literal("covered"),
|
|
92
|
+
catalogHash: HashSchema,
|
|
93
|
+
plan: PlannerCapabilityPlanSchema,
|
|
94
|
+
selectedAtomKeys: z.array(WorkflowAtomReferenceSchema).min(1).max(128),
|
|
95
|
+
}).strict(),
|
|
96
|
+
z.object({
|
|
97
|
+
schemaVersion: z.literal("1.1"),
|
|
98
|
+
status: z.literal("blocked_missing_atom"),
|
|
99
|
+
catalogHash: HashSchema,
|
|
100
|
+
plan: PlannerCapabilityPlanSchema,
|
|
101
|
+
searchedAtomCount: z.number().int().nonnegative(),
|
|
102
|
+
gaps: z.array(CapabilityGapSchema).min(1),
|
|
103
|
+
}).strict(),
|
|
104
|
+
]);
|
|
105
|
+
//# sourceMappingURL=planning-capability.js.map
|