agent-contracts 0.5.2 → 0.6.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/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ declare const RuleSchema: z.ZodObject<{
12
12
  detection_method: z.ZodOptional<z.ZodString>;
13
13
  escalation: z.ZodOptional<z.ZodString>;
14
14
  ref: z.ZodOptional<z.ZodString>;
15
- }, z.core.$strict>;
15
+ }, z.core.$loose>;
16
16
  type Rule = z.infer<typeof RuleSchema>;
17
17
  declare const EscalationCriterionSchema: z.ZodObject<{
18
18
  condition: z.ZodString;
@@ -21,7 +21,7 @@ declare const EscalationCriterionSchema: z.ZodObject<{
21
21
  report_to_architect: "report_to_architect";
22
22
  wait_for_approval: "wait_for_approval";
23
23
  }>;
24
- }, z.core.$strict>;
24
+ }, z.core.$loose>;
25
25
  type EscalationCriterion = z.infer<typeof EscalationCriterionSchema>;
26
26
  declare const PrerequisiteSchema: z.ZodObject<{
27
27
  action: z.ZodEnum<{
@@ -30,7 +30,7 @@ declare const PrerequisiteSchema: z.ZodObject<{
30
30
  }>;
31
31
  target: z.ZodString;
32
32
  required: z.ZodBoolean;
33
- }, z.core.$strict>;
33
+ }, z.core.$loose>;
34
34
  type Prerequisite = z.infer<typeof PrerequisiteSchema>;
35
35
  declare const AgentSchema: z.ZodObject<{
36
36
  role_name: z.ZodString;
@@ -60,7 +60,7 @@ declare const AgentSchema: z.ZodObject<{
60
60
  detection_method: z.ZodOptional<z.ZodString>;
61
61
  escalation: z.ZodOptional<z.ZodString>;
62
62
  ref: z.ZodOptional<z.ZodString>;
63
- }, z.core.$strict>>>;
63
+ }, z.core.$loose>>>;
64
64
  anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
65
  escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
66
  condition: z.ZodString;
@@ -69,7 +69,7 @@ declare const AgentSchema: z.ZodObject<{
69
69
  report_to_architect: "report_to_architect";
70
70
  wait_for_approval: "wait_for_approval";
71
71
  }>;
72
- }, z.core.$strict>>>;
72
+ }, z.core.$loose>>>;
73
73
  prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
74
  action: z.ZodEnum<{
75
75
  read: "read";
@@ -77,7 +77,7 @@ declare const AgentSchema: z.ZodObject<{
77
77
  }>;
78
78
  target: z.ZodString;
79
79
  required: z.ZodBoolean;
80
- }, z.core.$strict>>>;
80
+ }, z.core.$loose>>>;
81
81
  }, z.core.$loose>;
82
82
  type Agent = z.infer<typeof AgentSchema>;
83
83
 
@@ -100,7 +100,7 @@ declare const DslSchema: z.ZodObject<{
100
100
  system: z.ZodObject<{
101
101
  id: z.ZodString;
102
102
  name: z.ZodString;
103
- default_phase_order: z.ZodArray<z.ZodString>;
103
+ default_workflow_order: z.ZodArray<z.ZodString>;
104
104
  }, z.core.$loose>;
105
105
  agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
106
106
  role_name: z.ZodString;
@@ -130,7 +130,7 @@ declare const DslSchema: z.ZodObject<{
130
130
  detection_method: z.ZodOptional<z.ZodString>;
131
131
  escalation: z.ZodOptional<z.ZodString>;
132
132
  ref: z.ZodOptional<z.ZodString>;
133
- }, z.core.$strict>>>;
133
+ }, z.core.$loose>>>;
134
134
  anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
135
  escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
136
  condition: z.ZodString;
@@ -139,7 +139,7 @@ declare const DslSchema: z.ZodObject<{
139
139
  report_to_architect: "report_to_architect";
140
140
  wait_for_approval: "wait_for_approval";
141
141
  }>;
142
- }, z.core.$strict>>>;
142
+ }, z.core.$loose>>>;
143
143
  prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
144
  action: z.ZodEnum<{
145
145
  read: "read";
@@ -147,13 +147,13 @@ declare const DslSchema: z.ZodObject<{
147
147
  }>;
148
148
  target: z.ZodString;
149
149
  required: z.ZodBoolean;
150
- }, z.core.$strict>>>;
150
+ }, z.core.$loose>>>;
151
151
  }, z.core.$loose>>>;
152
152
  tasks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
153
153
  description: z.ZodString;
154
154
  target_agent: z.ZodString;
155
155
  allowed_from_agents: z.ZodArray<z.ZodString>;
156
- phase: z.ZodString;
156
+ workflow: z.ZodString;
157
157
  input_artifacts: z.ZodArray<z.ZodString>;
158
158
  invocation_handoff: z.ZodString;
159
159
  result_handoff: z.ZodString;
@@ -163,6 +163,7 @@ declare const DslSchema: z.ZodObject<{
163
163
  execution_steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
164
164
  id: z.ZodString;
165
165
  action: z.ZodString;
166
+ description: z.ZodOptional<z.ZodString>;
166
167
  required: z.ZodOptional<z.ZodBoolean>;
167
168
  abort_on_failure: z.ZodOptional<z.ZodBoolean>;
168
169
  uses_tool: z.ZodOptional<z.ZodString>;
@@ -170,7 +171,7 @@ declare const DslSchema: z.ZodObject<{
170
171
  depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
172
  skip_condition: z.ZodOptional<z.ZodString>;
172
173
  wait_for_approval: z.ZodOptional<z.ZodBoolean>;
173
- }, z.core.$strict>>>;
174
+ }, z.core.$loose>>>;
174
175
  completion_criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
175
176
  rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
176
177
  id: z.ZodString;
@@ -184,7 +185,7 @@ declare const DslSchema: z.ZodObject<{
184
185
  detection_method: z.ZodOptional<z.ZodString>;
185
186
  escalation: z.ZodOptional<z.ZodString>;
186
187
  ref: z.ZodOptional<z.ZodString>;
187
- }, z.core.$strict>>>;
188
+ }, z.core.$loose>>>;
188
189
  anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
189
190
  escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
190
191
  condition: z.ZodString;
@@ -193,7 +194,7 @@ declare const DslSchema: z.ZodObject<{
193
194
  report_to_architect: "report_to_architect";
194
195
  wait_for_approval: "wait_for_approval";
195
196
  }>;
196
- }, z.core.$strict>>>;
197
+ }, z.core.$loose>>>;
197
198
  }, z.core.$loose>>>;
198
199
  artifacts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
199
200
  type: z.ZodString;
@@ -234,27 +235,32 @@ declare const DslSchema: z.ZodObject<{
234
235
  version: z.ZodNumber;
235
236
  description: z.ZodOptional<z.ZodString>;
236
237
  payload: z.ZodRecord<z.ZodString, z.ZodAny>;
238
+ example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
237
239
  }, z.core.$loose>>>;
238
240
  workflow: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
239
241
  entry_conditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
242
+ trigger: z.ZodOptional<z.ZodString>;
240
243
  steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
241
244
  type: z.ZodLiteral<"handoff">;
245
+ description: z.ZodOptional<z.ZodString>;
242
246
  handoff_kind: z.ZodString;
243
247
  task: z.ZodOptional<z.ZodString>;
244
248
  from_agent: z.ZodOptional<z.ZodString>;
245
- }, z.core.$strict>, z.ZodObject<{
249
+ }, z.core.$loose>, z.ZodObject<{
246
250
  type: z.ZodLiteral<"validation">;
251
+ description: z.ZodOptional<z.ZodString>;
247
252
  validation: z.ZodString;
248
- }, z.core.$strict>, z.ZodObject<{
253
+ }, z.core.$loose>, z.ZodObject<{
249
254
  type: z.ZodLiteral<"decision">;
255
+ description: z.ZodOptional<z.ZodString>;
250
256
  on: z.ZodString;
251
257
  branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
252
- }, z.core.$strict>], "type">>;
258
+ }, z.core.$loose>], "type">>;
253
259
  }, z.core.$loose>>>;
254
260
  policies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
255
261
  when: z.ZodObject<{
256
262
  artifact_type: z.ZodOptional<z.ZodString>;
257
- phase: z.ZodOptional<z.ZodString>;
263
+ workflow: z.ZodOptional<z.ZodString>;
258
264
  }, z.core.$loose>;
259
265
  requires_validations: z.ZodOptional<z.ZodArray<z.ZodString>>;
260
266
  requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -266,6 +272,7 @@ declare const HandoffTypeSchema: z.ZodObject<{
266
272
  version: z.ZodNumber;
267
273
  description: z.ZodOptional<z.ZodString>;
268
274
  payload: z.ZodRecord<z.ZodString, z.ZodAny>;
275
+ example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
269
276
  }, z.core.$loose>;
270
277
  type HandoffType = z.infer<typeof HandoffTypeSchema>;
271
278
 
@@ -309,13 +316,13 @@ type MergeableRecord<T> = Record<string, T> | {
309
316
 
310
317
  declare const PolicyWhenSchema: z.ZodObject<{
311
318
  artifact_type: z.ZodOptional<z.ZodString>;
312
- phase: z.ZodOptional<z.ZodString>;
319
+ workflow: z.ZodOptional<z.ZodString>;
313
320
  }, z.core.$loose>;
314
321
  type PolicyWhen = z.infer<typeof PolicyWhenSchema>;
315
322
  declare const PolicySchema: z.ZodObject<{
316
323
  when: z.ZodObject<{
317
324
  artifact_type: z.ZodOptional<z.ZodString>;
318
- phase: z.ZodOptional<z.ZodString>;
325
+ workflow: z.ZodOptional<z.ZodString>;
319
326
  }, z.core.$loose>;
320
327
  requires_validations: z.ZodOptional<z.ZodArray<z.ZodString>>;
321
328
  requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -329,13 +336,14 @@ type Extends = z.infer<typeof ExtendsSchema>;
329
336
  declare const SystemSchema: z.ZodObject<{
330
337
  id: z.ZodString;
331
338
  name: z.ZodString;
332
- default_phase_order: z.ZodArray<z.ZodString>;
339
+ default_workflow_order: z.ZodArray<z.ZodString>;
333
340
  }, z.core.$loose>;
334
341
  type System = z.infer<typeof SystemSchema>;
335
342
 
336
343
  declare const ExecutionStepSchema: z.ZodObject<{
337
344
  id: z.ZodString;
338
345
  action: z.ZodString;
346
+ description: z.ZodOptional<z.ZodString>;
339
347
  required: z.ZodOptional<z.ZodBoolean>;
340
348
  abort_on_failure: z.ZodOptional<z.ZodBoolean>;
341
349
  uses_tool: z.ZodOptional<z.ZodString>;
@@ -343,13 +351,13 @@ declare const ExecutionStepSchema: z.ZodObject<{
343
351
  depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
352
  skip_condition: z.ZodOptional<z.ZodString>;
345
353
  wait_for_approval: z.ZodOptional<z.ZodBoolean>;
346
- }, z.core.$strict>;
354
+ }, z.core.$loose>;
347
355
  type ExecutionStep = z.infer<typeof ExecutionStepSchema>;
348
356
  declare const TaskSchema: z.ZodObject<{
349
357
  description: z.ZodString;
350
358
  target_agent: z.ZodString;
351
359
  allowed_from_agents: z.ZodArray<z.ZodString>;
352
- phase: z.ZodString;
360
+ workflow: z.ZodString;
353
361
  input_artifacts: z.ZodArray<z.ZodString>;
354
362
  invocation_handoff: z.ZodString;
355
363
  result_handoff: z.ZodString;
@@ -359,6 +367,7 @@ declare const TaskSchema: z.ZodObject<{
359
367
  execution_steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
360
368
  id: z.ZodString;
361
369
  action: z.ZodString;
370
+ description: z.ZodOptional<z.ZodString>;
362
371
  required: z.ZodOptional<z.ZodBoolean>;
363
372
  abort_on_failure: z.ZodOptional<z.ZodBoolean>;
364
373
  uses_tool: z.ZodOptional<z.ZodString>;
@@ -366,7 +375,7 @@ declare const TaskSchema: z.ZodObject<{
366
375
  depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
367
376
  skip_condition: z.ZodOptional<z.ZodString>;
368
377
  wait_for_approval: z.ZodOptional<z.ZodBoolean>;
369
- }, z.core.$strict>>>;
378
+ }, z.core.$loose>>>;
370
379
  completion_criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
371
380
  rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
372
381
  id: z.ZodString;
@@ -380,7 +389,7 @@ declare const TaskSchema: z.ZodObject<{
380
389
  detection_method: z.ZodOptional<z.ZodString>;
381
390
  escalation: z.ZodOptional<z.ZodString>;
382
391
  ref: z.ZodOptional<z.ZodString>;
383
- }, z.core.$strict>>>;
392
+ }, z.core.$loose>>>;
384
393
  anti_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
385
394
  escalation_criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
386
395
  condition: z.ZodString;
@@ -389,7 +398,7 @@ declare const TaskSchema: z.ZodObject<{
389
398
  report_to_architect: "report_to_architect";
390
399
  wait_for_approval: "wait_for_approval";
391
400
  }>;
392
- }, z.core.$strict>>>;
401
+ }, z.core.$loose>>>;
393
402
  }, z.core.$loose>;
394
403
  type Task = z.infer<typeof TaskSchema>;
395
404
 
@@ -423,33 +432,40 @@ type Validation = z.infer<typeof ValidationSchema>;
423
432
 
424
433
  declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
425
434
  type: z.ZodLiteral<"handoff">;
435
+ description: z.ZodOptional<z.ZodString>;
426
436
  handoff_kind: z.ZodString;
427
437
  task: z.ZodOptional<z.ZodString>;
428
438
  from_agent: z.ZodOptional<z.ZodString>;
429
- }, z.core.$strict>, z.ZodObject<{
439
+ }, z.core.$loose>, z.ZodObject<{
430
440
  type: z.ZodLiteral<"validation">;
441
+ description: z.ZodOptional<z.ZodString>;
431
442
  validation: z.ZodString;
432
- }, z.core.$strict>, z.ZodObject<{
443
+ }, z.core.$loose>, z.ZodObject<{
433
444
  type: z.ZodLiteral<"decision">;
445
+ description: z.ZodOptional<z.ZodString>;
434
446
  on: z.ZodString;
435
447
  branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
436
- }, z.core.$strict>], "type">;
448
+ }, z.core.$loose>], "type">;
437
449
  type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
438
450
  declare const WorkflowSchema: z.ZodObject<{
439
451
  entry_conditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
452
+ trigger: z.ZodOptional<z.ZodString>;
440
453
  steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
441
454
  type: z.ZodLiteral<"handoff">;
455
+ description: z.ZodOptional<z.ZodString>;
442
456
  handoff_kind: z.ZodString;
443
457
  task: z.ZodOptional<z.ZodString>;
444
458
  from_agent: z.ZodOptional<z.ZodString>;
445
- }, z.core.$strict>, z.ZodObject<{
459
+ }, z.core.$loose>, z.ZodObject<{
446
460
  type: z.ZodLiteral<"validation">;
461
+ description: z.ZodOptional<z.ZodString>;
447
462
  validation: z.ZodString;
448
- }, z.core.$strict>, z.ZodObject<{
463
+ }, z.core.$loose>, z.ZodObject<{
449
464
  type: z.ZodLiteral<"decision">;
465
+ description: z.ZodOptional<z.ZodString>;
450
466
  on: z.ZodString;
451
467
  branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
452
- }, z.core.$strict>], "type">>;
468
+ }, z.core.$loose>], "type">>;
453
469
  }, z.core.$loose>;
454
470
  type Workflow = z.infer<typeof WorkflowSchema>;
455
471
 
@@ -524,12 +540,12 @@ declare function spectralLint(dslObject: Record<string, unknown>): Promise<LintD
524
540
 
525
541
  declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "system"];
526
542
  declare const ContextTypeSchema: z.ZodEnum<{
543
+ workflow: "workflow";
527
544
  tool: "tool";
528
545
  agent: "agent";
529
546
  task: "task";
530
547
  validation: "validation";
531
548
  system: "system";
532
- workflow: "workflow";
533
549
  artifact: "artifact";
534
550
  handoff_type: "handoff_type";
535
551
  policy: "policy";
@@ -538,12 +554,12 @@ type ContextType = z.infer<typeof ContextTypeSchema>;
538
554
  declare const RenderTargetSchema: z.ZodObject<{
539
555
  template: z.ZodString;
540
556
  context: z.ZodEnum<{
557
+ workflow: "workflow";
541
558
  tool: "tool";
542
559
  agent: "agent";
543
560
  task: "task";
544
561
  validation: "validation";
545
562
  system: "system";
546
- workflow: "workflow";
547
563
  artifact: "artifact";
548
564
  handoff_type: "handoff_type";
549
565
  policy: "policy";
@@ -558,12 +574,12 @@ declare const AgentContractsConfigSchema: z.ZodObject<{
558
574
  renders: z.ZodArray<z.ZodObject<{
559
575
  template: z.ZodString;
560
576
  context: z.ZodEnum<{
577
+ workflow: "workflow";
561
578
  tool: "tool";
562
579
  agent: "agent";
563
580
  task: "task";
564
581
  validation: "validation";
565
582
  system: "system";
566
- workflow: "workflow";
567
583
  artifact: "artifact";
568
584
  handoff_type: "handoff_type";
569
585
  policy: "policy";
@@ -678,7 +694,7 @@ interface DelegatableTaskView {
678
694
  id: string;
679
695
  description: string;
680
696
  target_agent: string;
681
- phase: string;
697
+ workflow: string;
682
698
  input_artifacts: string[];
683
699
  invocation_handoff: string;
684
700
  invocation_payload_keys: string[];
@@ -710,7 +726,7 @@ declare function buildArtifactContext(dsl: Dsl, artifactId: string): PerArtifact
710
726
  declare function buildToolContext(dsl: Dsl, toolId: string): PerToolContext;
711
727
  declare function buildValidationContext(dsl: Dsl, validationId: string): PerValidationContext;
712
728
  declare function buildHandoffTypeContext(dsl: Dsl, handoffTypeId: string): PerHandoffTypeContext;
713
- declare function buildWorkflowContext(dsl: Dsl, phaseId: string): PerWorkflowContext;
729
+ declare function buildWorkflowContext(dsl: Dsl, workflowId: string): PerWorkflowContext;
714
730
  declare function buildPolicyContext(dsl: Dsl, policyId: string): PerPolicyContext;
715
731
  declare function buildPerAgentContext(dsl: Dsl, agent: Agent & {
716
732
  id: string;