agent-contracts 0.13.0 → 0.14.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
@@ -70,6 +70,10 @@ declare const AgentSchema: z.ZodObject<{
70
70
  wait_for_approval: "wait_for_approval";
71
71
  }>;
72
72
  }, z.core.$loose>>>;
73
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
+ title: z.ZodString;
75
+ content: z.ZodString;
76
+ }, z.core.$strip>>>;
73
77
  prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
78
  action: z.ZodEnum<{
75
79
  read: "read";
@@ -158,6 +162,29 @@ declare const ReportingSchema: z.ZodObject<{
158
162
  timeout_ms: z.ZodDefault<z.ZodNumber>;
159
163
  }, z.core.$loose>;
160
164
  type Reporting = z.infer<typeof ReportingSchema>;
165
+ declare const BindingRenderTargetSchema: z.ZodObject<{
166
+ template: z.ZodOptional<z.ZodString>;
167
+ inline_template: z.ZodOptional<z.ZodString>;
168
+ context: z.ZodEnum<{
169
+ agent: "agent";
170
+ task: "task";
171
+ artifact: "artifact";
172
+ tool: "tool";
173
+ validation: "validation";
174
+ handoff_type: "handoff_type";
175
+ workflow: "workflow";
176
+ policy: "policy";
177
+ guardrail: "guardrail";
178
+ guardrail_policy: "guardrail_policy";
179
+ system: "system";
180
+ }>;
181
+ output: z.ZodString;
182
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
184
+ skip_empty: z.ZodOptional<z.ZodBoolean>;
185
+ executable: z.ZodOptional<z.ZodBoolean>;
186
+ }, z.core.$loose>;
187
+ type BindingRenderTarget = z.infer<typeof BindingRenderTargetSchema>;
161
188
  declare const SoftwareBindingSchema: z.ZodObject<{
162
189
  software: z.ZodString;
163
190
  version: z.ZodLiteral<1>;
@@ -204,6 +231,28 @@ declare const SoftwareBindingSchema: z.ZodObject<{
204
231
  executable: z.ZodOptional<z.ZodBoolean>;
205
232
  skip_empty: z.ZodOptional<z.ZodBoolean>;
206
233
  }, z.core.$loose>>>;
234
+ renders: z.ZodOptional<z.ZodArray<z.ZodObject<{
235
+ template: z.ZodOptional<z.ZodString>;
236
+ inline_template: z.ZodOptional<z.ZodString>;
237
+ context: z.ZodEnum<{
238
+ agent: "agent";
239
+ task: "task";
240
+ artifact: "artifact";
241
+ tool: "tool";
242
+ validation: "validation";
243
+ handoff_type: "handoff_type";
244
+ workflow: "workflow";
245
+ policy: "policy";
246
+ guardrail: "guardrail";
247
+ guardrail_policy: "guardrail_policy";
248
+ system: "system";
249
+ }>;
250
+ output: z.ZodString;
251
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
253
+ skip_empty: z.ZodOptional<z.ZodBoolean>;
254
+ executable: z.ZodOptional<z.ZodBoolean>;
255
+ }, z.core.$loose>>>;
207
256
  reporting: z.ZodOptional<z.ZodObject<{
208
257
  commands: z.ZodRecord<z.ZodString, z.ZodString>;
209
258
  fail_open: z.ZodDefault<z.ZodBoolean>;
@@ -212,6 +261,23 @@ declare const SoftwareBindingSchema: z.ZodObject<{
212
261
  }, z.core.$loose>;
213
262
  type SoftwareBinding = z.infer<typeof SoftwareBindingSchema>;
214
263
 
264
+ declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "guardrail", "guardrail_policy", "system"];
265
+ declare const ContextTypeSchema: z.ZodEnum<{
266
+ agent: "agent";
267
+ task: "task";
268
+ artifact: "artifact";
269
+ tool: "tool";
270
+ validation: "validation";
271
+ handoff_type: "handoff_type";
272
+ workflow: "workflow";
273
+ policy: "policy";
274
+ guardrail: "guardrail";
275
+ guardrail_policy: "guardrail_policy";
276
+ system: "system";
277
+ }>;
278
+ type ContextType = z.infer<typeof ContextTypeSchema>;
279
+ declare const ITERABLE_CONTEXT_TYPES: ("agent" | "task" | "artifact" | "tool" | "validation" | "handoff_type" | "workflow" | "policy" | "guardrail" | "guardrail_policy")[];
280
+
215
281
  /**
216
282
  * Reusable schema components, following the OpenAPI `components` pattern.
217
283
  *
@@ -225,21 +291,21 @@ type Components = z.infer<typeof ComponentsSchema>;
225
291
  declare const SCOPE_NODE_TYPES: readonly ["root", "system", "agent", "task", "execution_step", "artifact", "tool", "tool_command", "validation", "handoff_type", "workflow", "workflow_step", "policy", "guardrail", "guardrail_policy", "rule", "escalation_criterion", "prerequisite"];
226
292
  type ScopeNodeType = (typeof SCOPE_NODE_TYPES)[number];
227
293
  declare const ScopeNodeTypeSchema: z.ZodEnum<{
228
- guardrail: "guardrail";
229
- workflow: "workflow";
230
- tool: "tool";
231
294
  agent: "agent";
232
295
  task: "task";
296
+ artifact: "artifact";
297
+ tool: "tool";
233
298
  validation: "validation";
234
- root: "root";
299
+ handoff_type: "handoff_type";
300
+ workflow: "workflow";
301
+ policy: "policy";
302
+ guardrail: "guardrail";
303
+ guardrail_policy: "guardrail_policy";
235
304
  system: "system";
305
+ root: "root";
236
306
  execution_step: "execution_step";
237
- artifact: "artifact";
238
307
  tool_command: "tool_command";
239
- handoff_type: "handoff_type";
240
308
  workflow_step: "workflow_step";
241
- policy: "policy";
242
- guardrail_policy: "guardrail_policy";
243
309
  rule: "rule";
244
310
  escalation_criterion: "escalation_criterion";
245
311
  prerequisite: "prerequisite";
@@ -254,21 +320,21 @@ declare const XExtensionDeclSchema: z.ZodObject<{
254
320
  items: z.ZodOptional<z.ZodString>;
255
321
  description: z.ZodOptional<z.ZodString>;
256
322
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
257
- guardrail: "guardrail";
258
- workflow: "workflow";
259
- tool: "tool";
260
323
  agent: "agent";
261
324
  task: "task";
325
+ artifact: "artifact";
326
+ tool: "tool";
262
327
  validation: "validation";
263
- root: "root";
328
+ handoff_type: "handoff_type";
329
+ workflow: "workflow";
330
+ policy: "policy";
331
+ guardrail: "guardrail";
332
+ guardrail_policy: "guardrail_policy";
264
333
  system: "system";
334
+ root: "root";
265
335
  execution_step: "execution_step";
266
- artifact: "artifact";
267
336
  tool_command: "tool_command";
268
- handoff_type: "handoff_type";
269
337
  workflow_step: "workflow_step";
270
- policy: "policy";
271
- guardrail_policy: "guardrail_policy";
272
338
  rule: "rule";
273
339
  escalation_criterion: "escalation_criterion";
274
340
  prerequisite: "prerequisite";
@@ -323,6 +389,10 @@ declare const DslSchema: z.ZodObject<{
323
389
  wait_for_approval: "wait_for_approval";
324
390
  }>;
325
391
  }, z.core.$loose>>>;
392
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
393
+ title: z.ZodString;
394
+ content: z.ZodString;
395
+ }, z.core.$strip>>>;
326
396
  prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
327
397
  action: z.ZodEnum<{
328
398
  read: "read";
@@ -423,8 +493,8 @@ declare const DslSchema: z.ZodObject<{
423
493
  fidelity: "fidelity";
424
494
  }>;
425
495
  executor_type: z.ZodEnum<{
426
- tool: "tool";
427
496
  agent: "agent";
497
+ tool: "tool";
428
498
  }>;
429
499
  executor: z.ZodString;
430
500
  blocking: z.ZodBoolean;
@@ -544,21 +614,21 @@ declare const DslSchema: z.ZodObject<{
544
614
  items: z.ZodOptional<z.ZodString>;
545
615
  description: z.ZodOptional<z.ZodString>;
546
616
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
547
- guardrail: "guardrail";
548
- workflow: "workflow";
549
- tool: "tool";
550
617
  agent: "agent";
551
618
  task: "task";
619
+ artifact: "artifact";
620
+ tool: "tool";
552
621
  validation: "validation";
553
- root: "root";
622
+ handoff_type: "handoff_type";
623
+ workflow: "workflow";
624
+ policy: "policy";
625
+ guardrail: "guardrail";
626
+ guardrail_policy: "guardrail_policy";
554
627
  system: "system";
628
+ root: "root";
555
629
  execution_step: "execution_step";
556
- artifact: "artifact";
557
630
  tool_command: "tool_command";
558
- handoff_type: "handoff_type";
559
631
  workflow_step: "workflow_step";
560
- policy: "policy";
561
- guardrail_policy: "guardrail_policy";
562
632
  rule: "rule";
563
633
  escalation_criterion: "escalation_criterion";
564
634
  prerequisite: "prerequisite";
@@ -836,8 +906,8 @@ declare const ValidationSchema: z.ZodObject<{
836
906
  fidelity: "fidelity";
837
907
  }>;
838
908
  executor_type: z.ZodEnum<{
839
- tool: "tool";
840
909
  agent: "agent";
910
+ tool: "tool";
841
911
  }>;
842
912
  executor: z.ZodString;
843
913
  blocking: z.ZodBoolean;
@@ -1050,35 +1120,20 @@ declare function spectralLint(dslObject: Record<string, unknown>): Promise<LintD
1050
1120
 
1051
1121
  declare const yamlReservedKeySafetyRule: LintRule;
1052
1122
 
1053
- declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "guardrail", "guardrail_policy", "system"];
1054
- declare const ContextTypeSchema: z.ZodEnum<{
1055
- guardrail: "guardrail";
1056
- workflow: "workflow";
1057
- tool: "tool";
1058
- agent: "agent";
1059
- task: "task";
1060
- validation: "validation";
1061
- system: "system";
1062
- artifact: "artifact";
1063
- handoff_type: "handoff_type";
1064
- policy: "policy";
1065
- guardrail_policy: "guardrail_policy";
1066
- }>;
1067
- type ContextType = z.infer<typeof ContextTypeSchema>;
1068
1123
  declare const RenderTargetSchema: z.ZodObject<{
1069
1124
  template: z.ZodString;
1070
1125
  context: z.ZodEnum<{
1071
- guardrail: "guardrail";
1072
- workflow: "workflow";
1073
- tool: "tool";
1074
1126
  agent: "agent";
1075
1127
  task: "task";
1076
- validation: "validation";
1077
- system: "system";
1078
1128
  artifact: "artifact";
1129
+ tool: "tool";
1130
+ validation: "validation";
1079
1131
  handoff_type: "handoff_type";
1132
+ workflow: "workflow";
1080
1133
  policy: "policy";
1134
+ guardrail: "guardrail";
1081
1135
  guardrail_policy: "guardrail_policy";
1136
+ system: "system";
1082
1137
  }>;
1083
1138
  output: z.ZodString;
1084
1139
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1089,26 +1144,26 @@ type RenderTarget = z.infer<typeof RenderTargetSchema>;
1089
1144
  declare const AgentContractsConfigSchema: z.ZodObject<{
1090
1145
  dsl: z.ZodString;
1091
1146
  vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1092
- renders: z.ZodArray<z.ZodObject<{
1147
+ renders: z.ZodDefault<z.ZodArray<z.ZodObject<{
1093
1148
  template: z.ZodString;
1094
1149
  context: z.ZodEnum<{
1095
- guardrail: "guardrail";
1096
- workflow: "workflow";
1097
- tool: "tool";
1098
1150
  agent: "agent";
1099
1151
  task: "task";
1100
- validation: "validation";
1101
- system: "system";
1102
1152
  artifact: "artifact";
1153
+ tool: "tool";
1154
+ validation: "validation";
1103
1155
  handoff_type: "handoff_type";
1156
+ workflow: "workflow";
1104
1157
  policy: "policy";
1158
+ guardrail: "guardrail";
1105
1159
  guardrail_policy: "guardrail_policy";
1160
+ system: "system";
1106
1161
  }>;
1107
1162
  output: z.ZodString;
1108
1163
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
1109
1164
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
1110
1165
  skip_empty: z.ZodOptional<z.ZodBoolean>;
1111
- }, z.core.$strip>>;
1166
+ }, z.core.$strip>>>;
1112
1167
  bindings: z.ZodDefault<z.ZodArray<z.ZodString>>;
1113
1168
  active_guardrail_policy: z.ZodOptional<z.ZodString>;
1114
1169
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1388,7 +1443,7 @@ interface ResolvedCheck {
1388
1443
  policy_rule: GuardrailPolicyRule;
1389
1444
  check: Check;
1390
1445
  }
1391
- interface GuardrailGenerationContext {
1446
+ interface BindingGenerationContext {
1392
1447
  system: {
1393
1448
  id: string;
1394
1449
  name: string;
@@ -1405,7 +1460,14 @@ interface GuardrailGenerationContext {
1405
1460
  timeout_ms: number;
1406
1461
  } | null;
1407
1462
  resolved_checks: ResolvedCheck[];
1463
+ tasks: Record<string, Task>;
1464
+ artifacts: Record<string, Artifact>;
1465
+ agents: Record<string, Agent>;
1466
+ handoff_types: Record<string, HandoffType>;
1467
+ workflow: Record<string, Workflow>;
1408
1468
  }
1469
+ /** @deprecated Use BindingGenerationContext */
1470
+ type GuardrailGenerationContext = BindingGenerationContext;
1409
1471
  interface GenerateResult {
1410
1472
  outputFiles: string[];
1411
1473
  diagnostics: GenerateDiagnostic[];
@@ -1437,4 +1499,4 @@ interface PathResolveResult {
1437
1499
  }
1438
1500
  declare function resolveBindingTargetPath(target: string, paths: Record<string, string>, bindingSoftware: string): PathResolveResult;
1439
1501
 
1440
- export { type Agent, type AgentContractsConfig, AgentContractsConfigSchema, AgentSchema, type AppendOperator, AppendOperatorSchema, type Artifact, ArtifactSchema, BaseResolveError, type BindingOutput, BindingOutputSchema, CONTEXT_TYPES, type Check, CheckSchema, type Command, CommandSchema, type Components, ComponentsSchema, ConfigLoadError, type ContextType, ContextTypeSchema, type DelegatableTaskView, type DiagnosticMessage, type DimensionResult, type Dsl, DslLoadError, DslSchema, type EntityGuardrailEntry, type EntityValidationEntry, type EscalationCriterion, EscalationCriterionSchema, type ExecutionStep, ExecutionStepSchema, type Extends, ExtendsSchema, type ExternalParticipant, type GenerateDiagnostic, type GenerateGuardrailsOptions, type GenerateResult, type GlobalContext, type Guardrail, type GuardrailGenerationContext, type GuardrailPolicy, type GuardrailPolicyRule, type GuardrailPolicyRuleEscalation, GuardrailPolicyRuleEscalationSchema, GuardrailPolicyRuleSchema, GuardrailPolicySchema, GuardrailSchema, type GuardrailScope, GuardrailScopeSchema, type HandoffType, HandoffTypeSchema, type InsertAfterOperator, InsertAfterOperatorSchema, type LintDiagnostic, type LintRule, type LoadResult, type LoadedBinding, type Matcher, MatcherSchema, MergeError, type MergeableRecord, type MergedBehavioralSpec, type PathResolveResult, type PerAgentContext, type PerArtifactContext, type PerGuardrailContext, type PerGuardrailPolicyContext, 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 Reporting, ReportingSchema, type ResolveChecksResult, type ResolveResult, type ResolvedCheck, type ResolvedConfig, type ResolvedRenderTarget, type Retry, type Rule, RuleSchema, SCOPE_NODE_TYPES, type SchemaValidationResult, type ScopeNodeType, ScopeNodeTypeSchema, type ScoreResult, type Severity, type SoftwareBinding, SoftwareBindingSchema, type System, type SystemContext, SystemSchema, type Task, TaskSchema, type Tool, ToolSchema, type Validation, ValidationSchema, type VersionLiteral, VersionLiteralSchema, type Workflow, WorkflowSchema, type WorkflowStep, WorkflowStepSchema, type XExtensionDecl, XExtensionDeclSchema, buildArtifactContext, buildGlobalContext, buildGuardrailContext, buildGuardrailPolicyContext, buildHandoffTypeContext, buildPerAgentContext, buildPolicyContext, buildSystemContext, buildTaskContext, buildToolContext, buildValidationContext, buildWorkflowContext, builtinRules, checkDriftFromConfig, checkReferences, expandDefaults, generateGuardrails, lint, loadBindings, loadConfig, loadDsl, mergeDsl, renderFromConfig, resolve, resolveAllOf, resolveBase, resolveBindingTargetPath, resolveChecks, resolveDslPath, resolveEffectiveGuardrails, resolveEntityValidations, score, spectralLint, validateHandoffSchemas, validateSchema, yamlReservedKeySafetyRule };
1502
+ export { type Agent, type AgentContractsConfig, AgentContractsConfigSchema, AgentSchema, type AppendOperator, AppendOperatorSchema, type Artifact, ArtifactSchema, BaseResolveError, type BindingGenerationContext, type BindingOutput, BindingOutputSchema, type BindingRenderTarget, BindingRenderTargetSchema, CONTEXT_TYPES, type Check, CheckSchema, type Command, CommandSchema, type Components, ComponentsSchema, ConfigLoadError, type ContextType, ContextTypeSchema, type DelegatableTaskView, type DiagnosticMessage, type DimensionResult, type Dsl, DslLoadError, DslSchema, type EntityGuardrailEntry, type EntityValidationEntry, type EscalationCriterion, EscalationCriterionSchema, type ExecutionStep, ExecutionStepSchema, type Extends, ExtendsSchema, type ExternalParticipant, type GenerateDiagnostic, type GenerateGuardrailsOptions, type GenerateResult, type GlobalContext, type Guardrail, type GuardrailGenerationContext, type GuardrailPolicy, type GuardrailPolicyRule, type GuardrailPolicyRuleEscalation, GuardrailPolicyRuleEscalationSchema, GuardrailPolicyRuleSchema, GuardrailPolicySchema, GuardrailSchema, type GuardrailScope, GuardrailScopeSchema, type HandoffType, HandoffTypeSchema, ITERABLE_CONTEXT_TYPES, type InsertAfterOperator, InsertAfterOperatorSchema, type LintDiagnostic, type LintRule, type LoadResult, type LoadedBinding, type Matcher, MatcherSchema, MergeError, type MergeableRecord, type MergedBehavioralSpec, type PathResolveResult, type PerAgentContext, type PerArtifactContext, type PerGuardrailContext, type PerGuardrailPolicyContext, 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 Reporting, ReportingSchema, type ResolveChecksResult, type ResolveResult, type ResolvedCheck, type ResolvedConfig, type ResolvedRenderTarget, type Retry, type Rule, RuleSchema, SCOPE_NODE_TYPES, type SchemaValidationResult, type ScopeNodeType, ScopeNodeTypeSchema, type ScoreResult, type Severity, type SoftwareBinding, SoftwareBindingSchema, type System, type SystemContext, SystemSchema, type Task, TaskSchema, type Tool, ToolSchema, type Validation, ValidationSchema, type VersionLiteral, VersionLiteralSchema, type Workflow, WorkflowSchema, type WorkflowStep, WorkflowStepSchema, type XExtensionDecl, XExtensionDeclSchema, buildArtifactContext, buildGlobalContext, buildGuardrailContext, buildGuardrailPolicyContext, buildHandoffTypeContext, buildPerAgentContext, buildPolicyContext, buildSystemContext, buildTaskContext, buildToolContext, buildValidationContext, buildWorkflowContext, builtinRules, checkDriftFromConfig, checkReferences, expandDefaults, generateGuardrails, lint, loadBindings, loadConfig, loadDsl, mergeDsl, renderFromConfig, resolve, resolveAllOf, resolveBase, resolveBindingTargetPath, resolveChecks, resolveDslPath, resolveEffectiveGuardrails, resolveEntityValidations, score, spectralLint, validateHandoffSchemas, validateSchema, yamlReservedKeySafetyRule };