agent-contracts 0.12.4 → 0.14.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/dist/index.d.ts CHANGED
@@ -158,6 +158,29 @@ declare const ReportingSchema: z.ZodObject<{
158
158
  timeout_ms: z.ZodDefault<z.ZodNumber>;
159
159
  }, z.core.$loose>;
160
160
  type Reporting = z.infer<typeof ReportingSchema>;
161
+ declare const BindingRenderTargetSchema: z.ZodObject<{
162
+ template: z.ZodOptional<z.ZodString>;
163
+ inline_template: z.ZodOptional<z.ZodString>;
164
+ context: z.ZodEnum<{
165
+ agent: "agent";
166
+ task: "task";
167
+ artifact: "artifact";
168
+ tool: "tool";
169
+ validation: "validation";
170
+ handoff_type: "handoff_type";
171
+ workflow: "workflow";
172
+ policy: "policy";
173
+ guardrail: "guardrail";
174
+ guardrail_policy: "guardrail_policy";
175
+ system: "system";
176
+ }>;
177
+ output: z.ZodString;
178
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ skip_empty: z.ZodOptional<z.ZodBoolean>;
181
+ executable: z.ZodOptional<z.ZodBoolean>;
182
+ }, z.core.$loose>;
183
+ type BindingRenderTarget = z.infer<typeof BindingRenderTargetSchema>;
161
184
  declare const SoftwareBindingSchema: z.ZodObject<{
162
185
  software: z.ZodString;
163
186
  version: z.ZodLiteral<1>;
@@ -204,6 +227,28 @@ declare const SoftwareBindingSchema: z.ZodObject<{
204
227
  executable: z.ZodOptional<z.ZodBoolean>;
205
228
  skip_empty: z.ZodOptional<z.ZodBoolean>;
206
229
  }, z.core.$loose>>>;
230
+ renders: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ template: z.ZodOptional<z.ZodString>;
232
+ inline_template: z.ZodOptional<z.ZodString>;
233
+ context: z.ZodEnum<{
234
+ agent: "agent";
235
+ task: "task";
236
+ artifact: "artifact";
237
+ tool: "tool";
238
+ validation: "validation";
239
+ handoff_type: "handoff_type";
240
+ workflow: "workflow";
241
+ policy: "policy";
242
+ guardrail: "guardrail";
243
+ guardrail_policy: "guardrail_policy";
244
+ system: "system";
245
+ }>;
246
+ output: z.ZodString;
247
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
248
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
+ skip_empty: z.ZodOptional<z.ZodBoolean>;
250
+ executable: z.ZodOptional<z.ZodBoolean>;
251
+ }, z.core.$loose>>>;
207
252
  reporting: z.ZodOptional<z.ZodObject<{
208
253
  commands: z.ZodRecord<z.ZodString, z.ZodString>;
209
254
  fail_open: z.ZodDefault<z.ZodBoolean>;
@@ -212,6 +257,23 @@ declare const SoftwareBindingSchema: z.ZodObject<{
212
257
  }, z.core.$loose>;
213
258
  type SoftwareBinding = z.infer<typeof SoftwareBindingSchema>;
214
259
 
260
+ declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "guardrail", "guardrail_policy", "system"];
261
+ declare const ContextTypeSchema: z.ZodEnum<{
262
+ agent: "agent";
263
+ task: "task";
264
+ artifact: "artifact";
265
+ tool: "tool";
266
+ validation: "validation";
267
+ handoff_type: "handoff_type";
268
+ workflow: "workflow";
269
+ policy: "policy";
270
+ guardrail: "guardrail";
271
+ guardrail_policy: "guardrail_policy";
272
+ system: "system";
273
+ }>;
274
+ type ContextType = z.infer<typeof ContextTypeSchema>;
275
+ declare const ITERABLE_CONTEXT_TYPES: ("agent" | "task" | "artifact" | "tool" | "validation" | "handoff_type" | "workflow" | "policy" | "guardrail" | "guardrail_policy")[];
276
+
215
277
  /**
216
278
  * Reusable schema components, following the OpenAPI `components` pattern.
217
279
  *
@@ -222,6 +284,28 @@ declare const ComponentsSchema: z.ZodObject<{
222
284
  schemas: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
223
285
  }, z.core.$loose>;
224
286
  type Components = z.infer<typeof ComponentsSchema>;
287
+ 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"];
288
+ type ScopeNodeType = (typeof SCOPE_NODE_TYPES)[number];
289
+ declare const ScopeNodeTypeSchema: z.ZodEnum<{
290
+ agent: "agent";
291
+ task: "task";
292
+ artifact: "artifact";
293
+ tool: "tool";
294
+ validation: "validation";
295
+ handoff_type: "handoff_type";
296
+ workflow: "workflow";
297
+ policy: "policy";
298
+ guardrail: "guardrail";
299
+ guardrail_policy: "guardrail_policy";
300
+ system: "system";
301
+ root: "root";
302
+ execution_step: "execution_step";
303
+ tool_command: "tool_command";
304
+ workflow_step: "workflow_step";
305
+ rule: "rule";
306
+ escalation_criterion: "escalation_criterion";
307
+ prerequisite: "prerequisite";
308
+ }>;
225
309
  /**
226
310
  * Declaration of project-specific `x-*` extension fields.
227
311
  * Each key must start with `x-` and describes the expected type/shape
@@ -231,6 +315,28 @@ declare const XExtensionDeclSchema: z.ZodObject<{
231
315
  type: z.ZodString;
232
316
  items: z.ZodOptional<z.ZodString>;
233
317
  description: z.ZodOptional<z.ZodString>;
318
+ scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
319
+ agent: "agent";
320
+ task: "task";
321
+ artifact: "artifact";
322
+ tool: "tool";
323
+ validation: "validation";
324
+ handoff_type: "handoff_type";
325
+ workflow: "workflow";
326
+ policy: "policy";
327
+ guardrail: "guardrail";
328
+ guardrail_policy: "guardrail_policy";
329
+ system: "system";
330
+ root: "root";
331
+ execution_step: "execution_step";
332
+ tool_command: "tool_command";
333
+ workflow_step: "workflow_step";
334
+ rule: "rule";
335
+ escalation_criterion: "escalation_criterion";
336
+ prerequisite: "prerequisite";
337
+ }>>>;
338
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
339
+ required: z.ZodDefault<z.ZodBoolean>;
234
340
  }, z.core.$strip>;
235
341
  type XExtensionDecl = z.infer<typeof XExtensionDeclSchema>;
236
342
  declare const DslSchema: z.ZodObject<{
@@ -379,8 +485,8 @@ declare const DslSchema: z.ZodObject<{
379
485
  fidelity: "fidelity";
380
486
  }>;
381
487
  executor_type: z.ZodEnum<{
382
- tool: "tool";
383
488
  agent: "agent";
489
+ tool: "tool";
384
490
  }>;
385
491
  executor: z.ZodString;
386
492
  blocking: z.ZodBoolean;
@@ -495,11 +601,34 @@ declare const DslSchema: z.ZodObject<{
495
601
  components: z.ZodDefault<z.ZodObject<{
496
602
  schemas: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
497
603
  }, z.core.$loose>>;
498
- "x-extensions": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
604
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
499
605
  type: z.ZodString;
500
606
  items: z.ZodOptional<z.ZodString>;
501
607
  description: z.ZodOptional<z.ZodString>;
608
+ scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
609
+ agent: "agent";
610
+ task: "task";
611
+ artifact: "artifact";
612
+ tool: "tool";
613
+ validation: "validation";
614
+ handoff_type: "handoff_type";
615
+ workflow: "workflow";
616
+ policy: "policy";
617
+ guardrail: "guardrail";
618
+ guardrail_policy: "guardrail_policy";
619
+ system: "system";
620
+ root: "root";
621
+ execution_step: "execution_step";
622
+ tool_command: "tool_command";
623
+ workflow_step: "workflow_step";
624
+ rule: "rule";
625
+ escalation_criterion: "escalation_criterion";
626
+ prerequisite: "prerequisite";
627
+ }>>>;
628
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
629
+ required: z.ZodDefault<z.ZodBoolean>;
502
630
  }, z.core.$strip>>>;
631
+ extensions_strict: z.ZodDefault<z.ZodBoolean>;
503
632
  }, z.core.$loose>;
504
633
  type Dsl = z.infer<typeof DslSchema>;
505
634
 
@@ -769,8 +898,8 @@ declare const ValidationSchema: z.ZodObject<{
769
898
  fidelity: "fidelity";
770
899
  }>;
771
900
  executor_type: z.ZodEnum<{
772
- tool: "tool";
773
901
  agent: "agent";
902
+ tool: "tool";
774
903
  }>;
775
904
  executor: z.ZodString;
776
905
  blocking: z.ZodBoolean;
@@ -934,6 +1063,7 @@ interface DiagnosticMessage {
934
1063
  path: string;
935
1064
  message: string;
936
1065
  code: string;
1066
+ severity?: "error" | "warning";
937
1067
  }
938
1068
  interface SchemaValidationResult {
939
1069
  success: boolean;
@@ -982,35 +1112,20 @@ declare function spectralLint(dslObject: Record<string, unknown>): Promise<LintD
982
1112
 
983
1113
  declare const yamlReservedKeySafetyRule: LintRule;
984
1114
 
985
- declare const CONTEXT_TYPES: readonly ["agent", "task", "artifact", "tool", "validation", "handoff_type", "workflow", "policy", "guardrail", "guardrail_policy", "system"];
986
- declare const ContextTypeSchema: z.ZodEnum<{
987
- guardrail: "guardrail";
988
- workflow: "workflow";
989
- tool: "tool";
990
- agent: "agent";
991
- task: "task";
992
- validation: "validation";
993
- system: "system";
994
- policy: "policy";
995
- artifact: "artifact";
996
- handoff_type: "handoff_type";
997
- guardrail_policy: "guardrail_policy";
998
- }>;
999
- type ContextType = z.infer<typeof ContextTypeSchema>;
1000
1115
  declare const RenderTargetSchema: z.ZodObject<{
1001
1116
  template: z.ZodString;
1002
1117
  context: z.ZodEnum<{
1003
- guardrail: "guardrail";
1004
- workflow: "workflow";
1005
- tool: "tool";
1006
1118
  agent: "agent";
1007
1119
  task: "task";
1008
- validation: "validation";
1009
- system: "system";
1010
- policy: "policy";
1011
1120
  artifact: "artifact";
1121
+ tool: "tool";
1122
+ validation: "validation";
1012
1123
  handoff_type: "handoff_type";
1124
+ workflow: "workflow";
1125
+ policy: "policy";
1126
+ guardrail: "guardrail";
1013
1127
  guardrail_policy: "guardrail_policy";
1128
+ system: "system";
1014
1129
  }>;
1015
1130
  output: z.ZodString;
1016
1131
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1021,26 +1136,26 @@ type RenderTarget = z.infer<typeof RenderTargetSchema>;
1021
1136
  declare const AgentContractsConfigSchema: z.ZodObject<{
1022
1137
  dsl: z.ZodString;
1023
1138
  vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1024
- renders: z.ZodArray<z.ZodObject<{
1139
+ renders: z.ZodDefault<z.ZodArray<z.ZodObject<{
1025
1140
  template: z.ZodString;
1026
1141
  context: z.ZodEnum<{
1027
- guardrail: "guardrail";
1028
- workflow: "workflow";
1029
- tool: "tool";
1030
1142
  agent: "agent";
1031
1143
  task: "task";
1032
- validation: "validation";
1033
- system: "system";
1034
- policy: "policy";
1035
1144
  artifact: "artifact";
1145
+ tool: "tool";
1146
+ validation: "validation";
1036
1147
  handoff_type: "handoff_type";
1148
+ workflow: "workflow";
1149
+ policy: "policy";
1150
+ guardrail: "guardrail";
1037
1151
  guardrail_policy: "guardrail_policy";
1152
+ system: "system";
1038
1153
  }>;
1039
1154
  output: z.ZodString;
1040
1155
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
1041
1156
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
1042
1157
  skip_empty: z.ZodOptional<z.ZodBoolean>;
1043
- }, z.core.$strip>>;
1158
+ }, z.core.$strip>>>;
1044
1159
  bindings: z.ZodDefault<z.ZodArray<z.ZodString>>;
1045
1160
  active_guardrail_policy: z.ZodOptional<z.ZodString>;
1046
1161
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1320,7 +1435,7 @@ interface ResolvedCheck {
1320
1435
  policy_rule: GuardrailPolicyRule;
1321
1436
  check: Check;
1322
1437
  }
1323
- interface GuardrailGenerationContext {
1438
+ interface BindingGenerationContext {
1324
1439
  system: {
1325
1440
  id: string;
1326
1441
  name: string;
@@ -1337,7 +1452,14 @@ interface GuardrailGenerationContext {
1337
1452
  timeout_ms: number;
1338
1453
  } | null;
1339
1454
  resolved_checks: ResolvedCheck[];
1455
+ tasks: Record<string, Task>;
1456
+ artifacts: Record<string, Artifact>;
1457
+ agents: Record<string, Agent>;
1458
+ handoff_types: Record<string, HandoffType>;
1459
+ workflow: Record<string, Workflow>;
1340
1460
  }
1461
+ /** @deprecated Use BindingGenerationContext */
1462
+ type GuardrailGenerationContext = BindingGenerationContext;
1341
1463
  interface GenerateResult {
1342
1464
  outputFiles: string[];
1343
1465
  diagnostics: GenerateDiagnostic[];
@@ -1369,4 +1491,4 @@ interface PathResolveResult {
1369
1491
  }
1370
1492
  declare function resolveBindingTargetPath(target: string, paths: Record<string, string>, bindingSoftware: string): PathResolveResult;
1371
1493
 
1372
- 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, type SchemaValidationResult, 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 };
1494
+ 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 };