agent-contracts 0.0.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +353 -313
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +60986 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +726 -2
- package/dist/index.js +60775 -1
- package/dist/index.js.map +1 -1
- package/package.json +34 -8
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,726 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const RuleSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
severity: z.ZodEnum<{
|
|
8
|
+
mandatory: "mandatory";
|
|
9
|
+
recommended: "recommended";
|
|
10
|
+
optional: "optional";
|
|
11
|
+
}>;
|
|
12
|
+
detection_method: z.ZodOptional<z.ZodString>;
|
|
13
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
14
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
type Rule = z.infer<typeof RuleSchema>;
|
|
17
|
+
declare const EscalationCriterionSchema: z.ZodObject<{
|
|
18
|
+
condition: z.ZodString;
|
|
19
|
+
action: z.ZodEnum<{
|
|
20
|
+
stop_and_report: "stop_and_report";
|
|
21
|
+
report_to_architect: "report_to_architect";
|
|
22
|
+
wait_for_approval: "wait_for_approval";
|
|
23
|
+
}>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
type EscalationCriterion = z.infer<typeof EscalationCriterionSchema>;
|
|
26
|
+
declare const PrerequisiteSchema: z.ZodObject<{
|
|
27
|
+
action: z.ZodEnum<{
|
|
28
|
+
read: "read";
|
|
29
|
+
execute: "execute";
|
|
30
|
+
}>;
|
|
31
|
+
target: z.ZodString;
|
|
32
|
+
required: z.ZodBoolean;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
type Prerequisite = z.infer<typeof PrerequisiteSchema>;
|
|
35
|
+
declare const AgentSchema: z.ZodObject<{
|
|
36
|
+
role_name: z.ZodString;
|
|
37
|
+
purpose: z.ZodString;
|
|
38
|
+
can_read_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
39
|
+
can_write_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
40
|
+
can_execute_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
can_perform_validations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
|
+
can_invoke_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
43
|
+
can_return_handoffs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
dispatch_only: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
"read-only": "read-only";
|
|
47
|
+
"read-write": "read-write";
|
|
48
|
+
}>>;
|
|
49
|
+
responsibilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
name: z.ZodOptional<z.ZodString>;
|
|
54
|
+
description: z.ZodString;
|
|
55
|
+
severity: z.ZodEnum<{
|
|
56
|
+
mandatory: "mandatory";
|
|
57
|
+
recommended: "recommended";
|
|
58
|
+
optional: "optional";
|
|
59
|
+
}>;
|
|
60
|
+
detection_method: z.ZodOptional<z.ZodString>;
|
|
61
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
62
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
64
|
+
anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
condition: z.ZodString;
|
|
67
|
+
action: z.ZodEnum<{
|
|
68
|
+
stop_and_report: "stop_and_report";
|
|
69
|
+
report_to_architect: "report_to_architect";
|
|
70
|
+
wait_for_approval: "wait_for_approval";
|
|
71
|
+
}>;
|
|
72
|
+
}, z.core.$strict>>>;
|
|
73
|
+
prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
action: z.ZodEnum<{
|
|
75
|
+
read: "read";
|
|
76
|
+
execute: "execute";
|
|
77
|
+
}>;
|
|
78
|
+
target: z.ZodString;
|
|
79
|
+
required: z.ZodBoolean;
|
|
80
|
+
}, z.core.$strict>>>;
|
|
81
|
+
}, z.core.$loose>;
|
|
82
|
+
type Agent = z.infer<typeof AgentSchema>;
|
|
83
|
+
|
|
84
|
+
declare const ArtifactSchema: z.ZodObject<{
|
|
85
|
+
type: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
owner: z.ZodString;
|
|
88
|
+
producers: z.ZodArray<z.ZodString>;
|
|
89
|
+
editors: z.ZodArray<z.ZodString>;
|
|
90
|
+
consumers: z.ZodArray<z.ZodString>;
|
|
91
|
+
states: z.ZodArray<z.ZodString>;
|
|
92
|
+
required_validations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
93
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$loose>;
|
|
95
|
+
type Artifact = z.infer<typeof ArtifactSchema>;
|
|
96
|
+
|
|
97
|
+
declare const DslSchema: z.ZodObject<{
|
|
98
|
+
version: z.ZodLiteral<1>;
|
|
99
|
+
extends: z.ZodOptional<z.ZodString>;
|
|
100
|
+
system: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
default_phase_order: z.ZodArray<z.ZodString>;
|
|
104
|
+
}, z.core.$loose>;
|
|
105
|
+
agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
106
|
+
role_name: z.ZodString;
|
|
107
|
+
purpose: z.ZodString;
|
|
108
|
+
can_read_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
109
|
+
can_write_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
110
|
+
can_execute_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
111
|
+
can_perform_validations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
112
|
+
can_invoke_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
113
|
+
can_return_handoffs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
114
|
+
dispatch_only: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
"read-only": "read-only";
|
|
117
|
+
"read-write": "read-write";
|
|
118
|
+
}>>;
|
|
119
|
+
responsibilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
121
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
description: z.ZodString;
|
|
125
|
+
severity: z.ZodEnum<{
|
|
126
|
+
mandatory: "mandatory";
|
|
127
|
+
recommended: "recommended";
|
|
128
|
+
optional: "optional";
|
|
129
|
+
}>;
|
|
130
|
+
detection_method: z.ZodOptional<z.ZodString>;
|
|
131
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
132
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, z.core.$strict>>>;
|
|
134
|
+
anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
|
+
escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
|
+
condition: z.ZodString;
|
|
137
|
+
action: z.ZodEnum<{
|
|
138
|
+
stop_and_report: "stop_and_report";
|
|
139
|
+
report_to_architect: "report_to_architect";
|
|
140
|
+
wait_for_approval: "wait_for_approval";
|
|
141
|
+
}>;
|
|
142
|
+
}, z.core.$strict>>>;
|
|
143
|
+
prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
144
|
+
action: z.ZodEnum<{
|
|
145
|
+
read: "read";
|
|
146
|
+
execute: "execute";
|
|
147
|
+
}>;
|
|
148
|
+
target: z.ZodString;
|
|
149
|
+
required: z.ZodBoolean;
|
|
150
|
+
}, z.core.$strict>>>;
|
|
151
|
+
}, z.core.$loose>>>;
|
|
152
|
+
tasks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
153
|
+
description: z.ZodString;
|
|
154
|
+
target_agent: z.ZodString;
|
|
155
|
+
allowed_from_agents: z.ZodArray<z.ZodString>;
|
|
156
|
+
phase: z.ZodString;
|
|
157
|
+
input_artifacts: z.ZodArray<z.ZodString>;
|
|
158
|
+
invocation_handoff: z.ZodString;
|
|
159
|
+
result_handoff: z.ZodString;
|
|
160
|
+
default_priority: z.ZodOptional<z.ZodString>;
|
|
161
|
+
responsibilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
execution_steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
164
|
+
id: z.ZodString;
|
|
165
|
+
action: z.ZodString;
|
|
166
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
abort_on_failure: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
uses_tool: z.ZodOptional<z.ZodString>;
|
|
169
|
+
produces_artifact: z.ZodOptional<z.ZodString>;
|
|
170
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
skip_condition: z.ZodOptional<z.ZodString>;
|
|
172
|
+
wait_for_approval: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
}, z.core.$strict>>>;
|
|
174
|
+
completion_criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
175
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
name: z.ZodOptional<z.ZodString>;
|
|
178
|
+
description: z.ZodString;
|
|
179
|
+
severity: z.ZodEnum<{
|
|
180
|
+
mandatory: "mandatory";
|
|
181
|
+
recommended: "recommended";
|
|
182
|
+
optional: "optional";
|
|
183
|
+
}>;
|
|
184
|
+
detection_method: z.ZodOptional<z.ZodString>;
|
|
185
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
186
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$strict>>>;
|
|
188
|
+
anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
189
|
+
escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
190
|
+
condition: z.ZodString;
|
|
191
|
+
action: z.ZodEnum<{
|
|
192
|
+
stop_and_report: "stop_and_report";
|
|
193
|
+
report_to_architect: "report_to_architect";
|
|
194
|
+
wait_for_approval: "wait_for_approval";
|
|
195
|
+
}>;
|
|
196
|
+
}, z.core.$strict>>>;
|
|
197
|
+
}, z.core.$loose>>>;
|
|
198
|
+
artifacts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
199
|
+
type: z.ZodString;
|
|
200
|
+
description: z.ZodOptional<z.ZodString>;
|
|
201
|
+
owner: z.ZodString;
|
|
202
|
+
producers: z.ZodArray<z.ZodString>;
|
|
203
|
+
editors: z.ZodArray<z.ZodString>;
|
|
204
|
+
consumers: z.ZodArray<z.ZodString>;
|
|
205
|
+
states: z.ZodArray<z.ZodString>;
|
|
206
|
+
required_validations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
207
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$loose>>>;
|
|
209
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
210
|
+
kind: z.ZodString;
|
|
211
|
+
description: z.ZodOptional<z.ZodString>;
|
|
212
|
+
input_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
213
|
+
output_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
214
|
+
invokable_by: z.ZodArray<z.ZodString>;
|
|
215
|
+
side_effects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
216
|
+
}, z.core.$loose>>>;
|
|
217
|
+
validations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
218
|
+
target_artifact: z.ZodString;
|
|
219
|
+
kind: z.ZodEnum<{
|
|
220
|
+
schema: "schema";
|
|
221
|
+
mechanical: "mechanical";
|
|
222
|
+
semantic: "semantic";
|
|
223
|
+
approval: "approval";
|
|
224
|
+
}>;
|
|
225
|
+
executor_type: z.ZodEnum<{
|
|
226
|
+
tool: "tool";
|
|
227
|
+
agent: "agent";
|
|
228
|
+
}>;
|
|
229
|
+
executor: z.ZodString;
|
|
230
|
+
blocking: z.ZodBoolean;
|
|
231
|
+
produces_evidence: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, z.core.$loose>>>;
|
|
233
|
+
handoff_types: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
234
|
+
version: z.ZodNumber;
|
|
235
|
+
description: z.ZodOptional<z.ZodString>;
|
|
236
|
+
payload: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
237
|
+
}, z.core.$loose>>>;
|
|
238
|
+
workflow: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
239
|
+
entry_conditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
240
|
+
steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
241
|
+
type: z.ZodLiteral<"handoff">;
|
|
242
|
+
handoff_kind: z.ZodString;
|
|
243
|
+
task: z.ZodOptional<z.ZodString>;
|
|
244
|
+
from_agent: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
246
|
+
type: z.ZodLiteral<"validation">;
|
|
247
|
+
validation: z.ZodString;
|
|
248
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
249
|
+
type: z.ZodLiteral<"decision">;
|
|
250
|
+
on: z.ZodString;
|
|
251
|
+
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
252
|
+
}, z.core.$strict>], "type">>;
|
|
253
|
+
}, z.core.$loose>>>;
|
|
254
|
+
policies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
255
|
+
when: z.ZodObject<{
|
|
256
|
+
artifact_type: z.ZodOptional<z.ZodString>;
|
|
257
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$loose>;
|
|
259
|
+
requires_validations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
261
|
+
}, z.core.$loose>>>;
|
|
262
|
+
}, z.core.$loose>;
|
|
263
|
+
type Dsl = z.infer<typeof DslSchema>;
|
|
264
|
+
|
|
265
|
+
declare const HandoffTypeSchema: z.ZodObject<{
|
|
266
|
+
version: z.ZodNumber;
|
|
267
|
+
description: z.ZodOptional<z.ZodString>;
|
|
268
|
+
payload: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
269
|
+
}, z.core.$loose>;
|
|
270
|
+
type HandoffType = z.infer<typeof HandoffTypeSchema>;
|
|
271
|
+
|
|
272
|
+
declare const AppendOperatorSchema: z.ZodObject<{
|
|
273
|
+
$append: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
type AppendOperator = z.infer<typeof AppendOperatorSchema>;
|
|
276
|
+
declare const PrependOperatorSchema: z.ZodObject<{
|
|
277
|
+
$prepend: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
278
|
+
}, z.core.$strip>;
|
|
279
|
+
type PrependOperator = z.infer<typeof PrependOperatorSchema>;
|
|
280
|
+
declare const InsertAfterOperatorSchema: z.ZodObject<{
|
|
281
|
+
$insert_after: z.ZodObject<{
|
|
282
|
+
after: z.ZodString;
|
|
283
|
+
entries: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
type InsertAfterOperator = z.infer<typeof InsertAfterOperatorSchema>;
|
|
287
|
+
declare const ReplaceOperatorSchema: z.ZodObject<{
|
|
288
|
+
$replace: z.ZodAny;
|
|
289
|
+
}, z.core.$strip>;
|
|
290
|
+
type ReplaceOperator = z.infer<typeof ReplaceOperatorSchema>;
|
|
291
|
+
declare const RemoveOperatorSchema: z.ZodObject<{
|
|
292
|
+
$remove: z.ZodArray<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
type RemoveOperator = z.infer<typeof RemoveOperatorSchema>;
|
|
295
|
+
type MergeableRecord<T> = Record<string, T> | {
|
|
296
|
+
$append: Record<string, unknown>;
|
|
297
|
+
} | {
|
|
298
|
+
$prepend: Record<string, unknown>;
|
|
299
|
+
} | {
|
|
300
|
+
$insert_after: {
|
|
301
|
+
after: string;
|
|
302
|
+
entries: Record<string, unknown>;
|
|
303
|
+
};
|
|
304
|
+
} | {
|
|
305
|
+
$replace: unknown;
|
|
306
|
+
} | {
|
|
307
|
+
$remove: string[];
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
declare const PolicyWhenSchema: z.ZodObject<{
|
|
311
|
+
artifact_type: z.ZodOptional<z.ZodString>;
|
|
312
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
313
|
+
}, z.core.$loose>;
|
|
314
|
+
type PolicyWhen = z.infer<typeof PolicyWhenSchema>;
|
|
315
|
+
declare const PolicySchema: z.ZodObject<{
|
|
316
|
+
when: z.ZodObject<{
|
|
317
|
+
artifact_type: z.ZodOptional<z.ZodString>;
|
|
318
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
319
|
+
}, z.core.$loose>;
|
|
320
|
+
requires_validations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
321
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
322
|
+
}, z.core.$loose>;
|
|
323
|
+
type Policy = z.infer<typeof PolicySchema>;
|
|
324
|
+
|
|
325
|
+
declare const VersionLiteralSchema: z.ZodLiteral<1>;
|
|
326
|
+
type VersionLiteral = z.infer<typeof VersionLiteralSchema>;
|
|
327
|
+
declare const ExtendsSchema: z.ZodOptional<z.ZodString>;
|
|
328
|
+
type Extends = z.infer<typeof ExtendsSchema>;
|
|
329
|
+
declare const SystemSchema: z.ZodObject<{
|
|
330
|
+
id: z.ZodString;
|
|
331
|
+
name: z.ZodString;
|
|
332
|
+
default_phase_order: z.ZodArray<z.ZodString>;
|
|
333
|
+
}, z.core.$loose>;
|
|
334
|
+
type System = z.infer<typeof SystemSchema>;
|
|
335
|
+
|
|
336
|
+
declare const ExecutionStepSchema: z.ZodObject<{
|
|
337
|
+
id: z.ZodString;
|
|
338
|
+
action: z.ZodString;
|
|
339
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
abort_on_failure: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
uses_tool: z.ZodOptional<z.ZodString>;
|
|
342
|
+
produces_artifact: z.ZodOptional<z.ZodString>;
|
|
343
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
344
|
+
skip_condition: z.ZodOptional<z.ZodString>;
|
|
345
|
+
wait_for_approval: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
}, z.core.$strict>;
|
|
347
|
+
type ExecutionStep = z.infer<typeof ExecutionStepSchema>;
|
|
348
|
+
declare const TaskSchema: z.ZodObject<{
|
|
349
|
+
description: z.ZodString;
|
|
350
|
+
target_agent: z.ZodString;
|
|
351
|
+
allowed_from_agents: z.ZodArray<z.ZodString>;
|
|
352
|
+
phase: z.ZodString;
|
|
353
|
+
input_artifacts: z.ZodArray<z.ZodString>;
|
|
354
|
+
invocation_handoff: z.ZodString;
|
|
355
|
+
result_handoff: z.ZodString;
|
|
356
|
+
default_priority: z.ZodOptional<z.ZodString>;
|
|
357
|
+
responsibilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
358
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
359
|
+
execution_steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
action: z.ZodString;
|
|
362
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
363
|
+
abort_on_failure: z.ZodOptional<z.ZodBoolean>;
|
|
364
|
+
uses_tool: z.ZodOptional<z.ZodString>;
|
|
365
|
+
produces_artifact: z.ZodOptional<z.ZodString>;
|
|
366
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
367
|
+
skip_condition: z.ZodOptional<z.ZodString>;
|
|
368
|
+
wait_for_approval: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
+
}, z.core.$strict>>>;
|
|
370
|
+
completion_criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
371
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
372
|
+
id: z.ZodString;
|
|
373
|
+
name: z.ZodOptional<z.ZodString>;
|
|
374
|
+
description: z.ZodString;
|
|
375
|
+
severity: z.ZodEnum<{
|
|
376
|
+
mandatory: "mandatory";
|
|
377
|
+
recommended: "recommended";
|
|
378
|
+
optional: "optional";
|
|
379
|
+
}>;
|
|
380
|
+
detection_method: z.ZodOptional<z.ZodString>;
|
|
381
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
382
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
383
|
+
}, z.core.$strict>>>;
|
|
384
|
+
anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
385
|
+
escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
386
|
+
condition: z.ZodString;
|
|
387
|
+
action: z.ZodEnum<{
|
|
388
|
+
stop_and_report: "stop_and_report";
|
|
389
|
+
report_to_architect: "report_to_architect";
|
|
390
|
+
wait_for_approval: "wait_for_approval";
|
|
391
|
+
}>;
|
|
392
|
+
}, z.core.$strict>>>;
|
|
393
|
+
}, z.core.$loose>;
|
|
394
|
+
type Task = z.infer<typeof TaskSchema>;
|
|
395
|
+
|
|
396
|
+
declare const ToolSchema: z.ZodObject<{
|
|
397
|
+
kind: z.ZodString;
|
|
398
|
+
description: z.ZodOptional<z.ZodString>;
|
|
399
|
+
input_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
400
|
+
output_artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
401
|
+
invokable_by: z.ZodArray<z.ZodString>;
|
|
402
|
+
side_effects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
403
|
+
}, z.core.$loose>;
|
|
404
|
+
type Tool = z.infer<typeof ToolSchema>;
|
|
405
|
+
|
|
406
|
+
declare const ValidationSchema: z.ZodObject<{
|
|
407
|
+
target_artifact: z.ZodString;
|
|
408
|
+
kind: z.ZodEnum<{
|
|
409
|
+
schema: "schema";
|
|
410
|
+
mechanical: "mechanical";
|
|
411
|
+
semantic: "semantic";
|
|
412
|
+
approval: "approval";
|
|
413
|
+
}>;
|
|
414
|
+
executor_type: z.ZodEnum<{
|
|
415
|
+
tool: "tool";
|
|
416
|
+
agent: "agent";
|
|
417
|
+
}>;
|
|
418
|
+
executor: z.ZodString;
|
|
419
|
+
blocking: z.ZodBoolean;
|
|
420
|
+
produces_evidence: z.ZodOptional<z.ZodString>;
|
|
421
|
+
}, z.core.$loose>;
|
|
422
|
+
type Validation = z.infer<typeof ValidationSchema>;
|
|
423
|
+
|
|
424
|
+
declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
425
|
+
type: z.ZodLiteral<"handoff">;
|
|
426
|
+
handoff_kind: z.ZodString;
|
|
427
|
+
task: z.ZodOptional<z.ZodString>;
|
|
428
|
+
from_agent: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
430
|
+
type: z.ZodLiteral<"validation">;
|
|
431
|
+
validation: z.ZodString;
|
|
432
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
433
|
+
type: z.ZodLiteral<"decision">;
|
|
434
|
+
on: z.ZodString;
|
|
435
|
+
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
436
|
+
}, z.core.$strict>], "type">;
|
|
437
|
+
type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
|
|
438
|
+
declare const WorkflowSchema: z.ZodObject<{
|
|
439
|
+
entry_conditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
440
|
+
steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
441
|
+
type: z.ZodLiteral<"handoff">;
|
|
442
|
+
handoff_kind: z.ZodString;
|
|
443
|
+
task: z.ZodOptional<z.ZodString>;
|
|
444
|
+
from_agent: z.ZodOptional<z.ZodString>;
|
|
445
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
446
|
+
type: z.ZodLiteral<"validation">;
|
|
447
|
+
validation: z.ZodString;
|
|
448
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
449
|
+
type: z.ZodLiteral<"decision">;
|
|
450
|
+
on: z.ZodString;
|
|
451
|
+
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
452
|
+
}, z.core.$strict>], "type">>;
|
|
453
|
+
}, z.core.$loose>;
|
|
454
|
+
type Workflow = z.infer<typeof WorkflowSchema>;
|
|
455
|
+
|
|
456
|
+
interface LoadResult {
|
|
457
|
+
data: Record<string, unknown>;
|
|
458
|
+
filePath: string;
|
|
459
|
+
}
|
|
460
|
+
declare class DslLoadError extends Error {
|
|
461
|
+
readonly filePath?: string | undefined;
|
|
462
|
+
constructor(message: string, filePath?: string | undefined);
|
|
463
|
+
}
|
|
464
|
+
declare function loadDsl(entryPath: string): Promise<LoadResult>;
|
|
465
|
+
|
|
466
|
+
declare class BaseResolveError extends Error {
|
|
467
|
+
constructor(message: string);
|
|
468
|
+
}
|
|
469
|
+
declare function resolveBase(extendsValue: string, projectDir: string): Promise<LoadResult>;
|
|
470
|
+
|
|
471
|
+
declare class MergeError extends Error {
|
|
472
|
+
constructor(message: string);
|
|
473
|
+
}
|
|
474
|
+
type AnyRecord = Record<string, unknown>;
|
|
475
|
+
declare function mergeDsl(base: AnyRecord, project: AnyRecord): AnyRecord;
|
|
476
|
+
|
|
477
|
+
interface ResolveResult {
|
|
478
|
+
data: Record<string, unknown>;
|
|
479
|
+
projectPath: string;
|
|
480
|
+
basePath?: string;
|
|
481
|
+
}
|
|
482
|
+
declare function resolve(projectDirOrFile: string): Promise<ResolveResult>;
|
|
483
|
+
|
|
484
|
+
interface DiagnosticMessage {
|
|
485
|
+
path: string;
|
|
486
|
+
message: string;
|
|
487
|
+
code: string;
|
|
488
|
+
}
|
|
489
|
+
interface SchemaValidationResult {
|
|
490
|
+
success: boolean;
|
|
491
|
+
data?: Dsl;
|
|
492
|
+
diagnostics: DiagnosticMessage[];
|
|
493
|
+
}
|
|
494
|
+
declare function validateSchema(data: Record<string, unknown>): SchemaValidationResult;
|
|
495
|
+
|
|
496
|
+
interface ReferenceDiagnostic {
|
|
497
|
+
path: string;
|
|
498
|
+
message: string;
|
|
499
|
+
code: string;
|
|
500
|
+
}
|
|
501
|
+
declare function checkReferences(dsl: Dsl): ReferenceDiagnostic[];
|
|
502
|
+
|
|
503
|
+
type Severity = "error" | "warning" | "info";
|
|
504
|
+
interface LintDiagnostic {
|
|
505
|
+
ruleId: string;
|
|
506
|
+
severity: Severity;
|
|
507
|
+
path: string;
|
|
508
|
+
message: string;
|
|
509
|
+
}
|
|
510
|
+
interface LintRule {
|
|
511
|
+
id: string;
|
|
512
|
+
description: string;
|
|
513
|
+
run(dsl: Dsl): LintDiagnostic[];
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
declare const builtinRules: LintRule[];
|
|
517
|
+
declare function lint(dsl: Dsl, rules?: LintRule[]): LintDiagnostic[];
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Run Spectral rules on a resolved DSL object.
|
|
521
|
+
* Returns diagnostics in the same format as the TypeScript linter.
|
|
522
|
+
*/
|
|
523
|
+
declare function spectralLint(dslObject: Record<string, unknown>): Promise<LintDiagnostic[]>;
|
|
524
|
+
|
|
525
|
+
declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "system"];
|
|
526
|
+
declare const ContextTypeSchema: z.ZodEnum<{
|
|
527
|
+
tool: "tool";
|
|
528
|
+
agent: "agent";
|
|
529
|
+
task: "task";
|
|
530
|
+
validation: "validation";
|
|
531
|
+
system: "system";
|
|
532
|
+
workflow: "workflow";
|
|
533
|
+
artifact: "artifact";
|
|
534
|
+
handoff_type: "handoff_type";
|
|
535
|
+
policy: "policy";
|
|
536
|
+
}>;
|
|
537
|
+
type ContextType = z.infer<typeof ContextTypeSchema>;
|
|
538
|
+
declare const RenderTargetSchema: z.ZodObject<{
|
|
539
|
+
template: z.ZodString;
|
|
540
|
+
context: z.ZodEnum<{
|
|
541
|
+
tool: "tool";
|
|
542
|
+
agent: "agent";
|
|
543
|
+
task: "task";
|
|
544
|
+
validation: "validation";
|
|
545
|
+
system: "system";
|
|
546
|
+
workflow: "workflow";
|
|
547
|
+
artifact: "artifact";
|
|
548
|
+
handoff_type: "handoff_type";
|
|
549
|
+
policy: "policy";
|
|
550
|
+
}>;
|
|
551
|
+
output: z.ZodString;
|
|
552
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
553
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
554
|
+
}, z.core.$strip>;
|
|
555
|
+
type RenderTarget = z.infer<typeof RenderTargetSchema>;
|
|
556
|
+
declare const AgentContractsConfigSchema: z.ZodObject<{
|
|
557
|
+
dsl: z.ZodString;
|
|
558
|
+
renders: z.ZodArray<z.ZodObject<{
|
|
559
|
+
template: z.ZodString;
|
|
560
|
+
context: z.ZodEnum<{
|
|
561
|
+
tool: "tool";
|
|
562
|
+
agent: "agent";
|
|
563
|
+
task: "task";
|
|
564
|
+
validation: "validation";
|
|
565
|
+
system: "system";
|
|
566
|
+
workflow: "workflow";
|
|
567
|
+
artifact: "artifact";
|
|
568
|
+
handoff_type: "handoff_type";
|
|
569
|
+
policy: "policy";
|
|
570
|
+
}>;
|
|
571
|
+
output: z.ZodString;
|
|
572
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
573
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
574
|
+
}, z.core.$strip>>;
|
|
575
|
+
}, z.core.$strip>;
|
|
576
|
+
type AgentContractsConfig = z.infer<typeof AgentContractsConfigSchema>;
|
|
577
|
+
interface ResolvedRenderTarget {
|
|
578
|
+
template: string;
|
|
579
|
+
context: ContextType;
|
|
580
|
+
output: string;
|
|
581
|
+
include?: string[];
|
|
582
|
+
exclude?: string[];
|
|
583
|
+
}
|
|
584
|
+
interface ResolvedConfig {
|
|
585
|
+
dsl: string;
|
|
586
|
+
renders: ResolvedRenderTarget[];
|
|
587
|
+
configDir: string;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
declare function renderFromConfig(dsl: Dsl, renderTargets: ResolvedRenderTarget[]): Promise<string[]>;
|
|
591
|
+
declare function checkDriftFromConfig(dsl: Dsl, renderTargets: ResolvedRenderTarget[]): Promise<{
|
|
592
|
+
hasDrift: boolean;
|
|
593
|
+
diffs: string[];
|
|
594
|
+
}>;
|
|
595
|
+
|
|
596
|
+
interface GlobalContext {
|
|
597
|
+
system: Dsl["system"];
|
|
598
|
+
agents: Dsl["agents"];
|
|
599
|
+
tasks: Dsl["tasks"];
|
|
600
|
+
artifacts: Dsl["artifacts"];
|
|
601
|
+
tools: Dsl["tools"];
|
|
602
|
+
validations: Dsl["validations"];
|
|
603
|
+
handoff_types: Dsl["handoff_types"];
|
|
604
|
+
workflow: Dsl["workflow"];
|
|
605
|
+
policies: Dsl["policies"];
|
|
606
|
+
[key: string]: unknown;
|
|
607
|
+
}
|
|
608
|
+
interface SystemContext {
|
|
609
|
+
system: System;
|
|
610
|
+
dsl: Dsl;
|
|
611
|
+
[key: string]: unknown;
|
|
612
|
+
}
|
|
613
|
+
interface PerTaskContext {
|
|
614
|
+
task: Task & {
|
|
615
|
+
id: string;
|
|
616
|
+
};
|
|
617
|
+
targetAgent: (Agent & {
|
|
618
|
+
id: string;
|
|
619
|
+
}) | null;
|
|
620
|
+
dsl: Dsl;
|
|
621
|
+
[key: string]: unknown;
|
|
622
|
+
}
|
|
623
|
+
interface PerArtifactContext {
|
|
624
|
+
artifact: Artifact & {
|
|
625
|
+
id: string;
|
|
626
|
+
};
|
|
627
|
+
dsl: Dsl;
|
|
628
|
+
[key: string]: unknown;
|
|
629
|
+
}
|
|
630
|
+
interface PerToolContext {
|
|
631
|
+
tool: Tool & {
|
|
632
|
+
id: string;
|
|
633
|
+
};
|
|
634
|
+
dsl: Dsl;
|
|
635
|
+
[key: string]: unknown;
|
|
636
|
+
}
|
|
637
|
+
interface PerValidationContext {
|
|
638
|
+
validation: Validation & {
|
|
639
|
+
id: string;
|
|
640
|
+
};
|
|
641
|
+
dsl: Dsl;
|
|
642
|
+
[key: string]: unknown;
|
|
643
|
+
}
|
|
644
|
+
interface PerHandoffTypeContext {
|
|
645
|
+
handoff_type: HandoffType & {
|
|
646
|
+
id: string;
|
|
647
|
+
};
|
|
648
|
+
relatedTasks: Array<Task & {
|
|
649
|
+
id: string;
|
|
650
|
+
}>;
|
|
651
|
+
dsl: Dsl;
|
|
652
|
+
[key: string]: unknown;
|
|
653
|
+
}
|
|
654
|
+
interface PerWorkflowContext {
|
|
655
|
+
workflow: Workflow & {
|
|
656
|
+
id: string;
|
|
657
|
+
};
|
|
658
|
+
dsl: Dsl;
|
|
659
|
+
[key: string]: unknown;
|
|
660
|
+
}
|
|
661
|
+
interface PerPolicyContext {
|
|
662
|
+
policy: Policy & {
|
|
663
|
+
id: string;
|
|
664
|
+
};
|
|
665
|
+
dsl: Dsl;
|
|
666
|
+
[key: string]: unknown;
|
|
667
|
+
}
|
|
668
|
+
interface MergedBehavioralSpec {
|
|
669
|
+
responsibilities: string[];
|
|
670
|
+
constraints: string[];
|
|
671
|
+
rules: Array<Record<string, unknown>>;
|
|
672
|
+
anti_patterns: string[];
|
|
673
|
+
escalation_criteria: Array<Record<string, unknown>>;
|
|
674
|
+
execution_steps: Array<Record<string, unknown>>;
|
|
675
|
+
completion_criteria: string[];
|
|
676
|
+
}
|
|
677
|
+
interface DelegatableTaskView {
|
|
678
|
+
id: string;
|
|
679
|
+
description: string;
|
|
680
|
+
target_agent: string;
|
|
681
|
+
phase: string;
|
|
682
|
+
input_artifacts: string[];
|
|
683
|
+
invocation_handoff: string;
|
|
684
|
+
invocation_payload_keys: string[];
|
|
685
|
+
result_handoff: string;
|
|
686
|
+
result_payload_keys: string[];
|
|
687
|
+
}
|
|
688
|
+
interface PerAgentContext {
|
|
689
|
+
agent: (Agent & Record<string, unknown>) & {
|
|
690
|
+
id: string;
|
|
691
|
+
};
|
|
692
|
+
tasks: Array<(Task & Record<string, unknown>) & {
|
|
693
|
+
id: string;
|
|
694
|
+
}>;
|
|
695
|
+
receivableTasks: Array<(Task & Record<string, unknown>) & {
|
|
696
|
+
id: string;
|
|
697
|
+
}>;
|
|
698
|
+
delegatableTasks: DelegatableTaskView[];
|
|
699
|
+
relatedArtifacts: Dsl["artifacts"];
|
|
700
|
+
relatedTools: Dsl["tools"];
|
|
701
|
+
relatedHandoffTypes: Dsl["handoff_types"];
|
|
702
|
+
mergedBehavior: MergedBehavioralSpec;
|
|
703
|
+
dsl: Dsl;
|
|
704
|
+
[key: string]: unknown;
|
|
705
|
+
}
|
|
706
|
+
declare function buildGlobalContext(dsl: Dsl): GlobalContext;
|
|
707
|
+
declare function buildSystemContext(dsl: Dsl): SystemContext;
|
|
708
|
+
declare function buildTaskContext(dsl: Dsl, taskId: string): PerTaskContext;
|
|
709
|
+
declare function buildArtifactContext(dsl: Dsl, artifactId: string): PerArtifactContext;
|
|
710
|
+
declare function buildToolContext(dsl: Dsl, toolId: string): PerToolContext;
|
|
711
|
+
declare function buildValidationContext(dsl: Dsl, validationId: string): PerValidationContext;
|
|
712
|
+
declare function buildHandoffTypeContext(dsl: Dsl, handoffTypeId: string): PerHandoffTypeContext;
|
|
713
|
+
declare function buildWorkflowContext(dsl: Dsl, phaseId: string): PerWorkflowContext;
|
|
714
|
+
declare function buildPolicyContext(dsl: Dsl, policyId: string): PerPolicyContext;
|
|
715
|
+
declare function buildPerAgentContext(dsl: Dsl, agent: Agent & {
|
|
716
|
+
id: string;
|
|
717
|
+
}): PerAgentContext;
|
|
718
|
+
|
|
719
|
+
declare class ConfigLoadError extends Error {
|
|
720
|
+
readonly filePath?: string | undefined;
|
|
721
|
+
constructor(message: string, filePath?: string | undefined);
|
|
722
|
+
}
|
|
723
|
+
declare function loadConfig(configPath?: string): Promise<ResolvedConfig | null>;
|
|
724
|
+
declare function resolveDslPath(dirArg: string | undefined, dirArgDefault: string, config: ResolvedConfig | null): string;
|
|
725
|
+
|
|
726
|
+
export { type Agent, type AgentContractsConfig, AgentContractsConfigSchema, AgentSchema, type AppendOperator, AppendOperatorSchema, type Artifact, ArtifactSchema, BaseResolveError, CONTEXT_TYPES, ConfigLoadError, type ContextType, ContextTypeSchema, type DelegatableTaskView, type DiagnosticMessage, type Dsl, DslLoadError, DslSchema, type EscalationCriterion, EscalationCriterionSchema, type ExecutionStep, ExecutionStepSchema, type Extends, ExtendsSchema, type GlobalContext, type HandoffType, HandoffTypeSchema, type InsertAfterOperator, InsertAfterOperatorSchema, type LintDiagnostic, type LintRule, type LoadResult, MergeError, type MergeableRecord, type MergedBehavioralSpec, type PerAgentContext, type PerArtifactContext, type PerHandoffTypeContext, type PerPolicyContext, type PerTaskContext, type PerToolContext, type PerValidationContext, type PerWorkflowContext, type Policy, PolicySchema, type PolicyWhen, PolicyWhenSchema, type PrependOperator, PrependOperatorSchema, type Prerequisite, PrerequisiteSchema, type ReferenceDiagnostic, type RemoveOperator, RemoveOperatorSchema, type RenderTarget, RenderTargetSchema, type ReplaceOperator, ReplaceOperatorSchema, type ResolveResult, type ResolvedConfig, type ResolvedRenderTarget, type Rule, RuleSchema, type SchemaValidationResult, type Severity, type System, type SystemContext, SystemSchema, type Task, TaskSchema, type Tool, ToolSchema, type Validation, ValidationSchema, type VersionLiteral, VersionLiteralSchema, type Workflow, WorkflowSchema, type WorkflowStep, WorkflowStepSchema, buildArtifactContext, buildGlobalContext, buildHandoffTypeContext, buildPerAgentContext, buildPolicyContext, buildSystemContext, buildTaskContext, buildToolContext, buildValidationContext, buildWorkflowContext, builtinRules, checkDriftFromConfig, checkReferences, lint, loadConfig, loadDsl, mergeDsl, renderFromConfig, resolve, resolveBase, resolveDslPath, spectralLint, validateSchema };
|