agent-contracts 0.13.0 → 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
  *
@@ -225,21 +287,21 @@ type Components = z.infer<typeof ComponentsSchema>;
225
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"];
226
288
  type ScopeNodeType = (typeof SCOPE_NODE_TYPES)[number];
227
289
  declare const ScopeNodeTypeSchema: z.ZodEnum<{
228
- guardrail: "guardrail";
229
- workflow: "workflow";
230
- tool: "tool";
231
290
  agent: "agent";
232
291
  task: "task";
292
+ artifact: "artifact";
293
+ tool: "tool";
233
294
  validation: "validation";
234
- root: "root";
295
+ handoff_type: "handoff_type";
296
+ workflow: "workflow";
297
+ policy: "policy";
298
+ guardrail: "guardrail";
299
+ guardrail_policy: "guardrail_policy";
235
300
  system: "system";
301
+ root: "root";
236
302
  execution_step: "execution_step";
237
- artifact: "artifact";
238
303
  tool_command: "tool_command";
239
- handoff_type: "handoff_type";
240
304
  workflow_step: "workflow_step";
241
- policy: "policy";
242
- guardrail_policy: "guardrail_policy";
243
305
  rule: "rule";
244
306
  escalation_criterion: "escalation_criterion";
245
307
  prerequisite: "prerequisite";
@@ -254,21 +316,21 @@ declare const XExtensionDeclSchema: z.ZodObject<{
254
316
  items: z.ZodOptional<z.ZodString>;
255
317
  description: z.ZodOptional<z.ZodString>;
256
318
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
257
- guardrail: "guardrail";
258
- workflow: "workflow";
259
- tool: "tool";
260
319
  agent: "agent";
261
320
  task: "task";
321
+ artifact: "artifact";
322
+ tool: "tool";
262
323
  validation: "validation";
263
- root: "root";
324
+ handoff_type: "handoff_type";
325
+ workflow: "workflow";
326
+ policy: "policy";
327
+ guardrail: "guardrail";
328
+ guardrail_policy: "guardrail_policy";
264
329
  system: "system";
330
+ root: "root";
265
331
  execution_step: "execution_step";
266
- artifact: "artifact";
267
332
  tool_command: "tool_command";
268
- handoff_type: "handoff_type";
269
333
  workflow_step: "workflow_step";
270
- policy: "policy";
271
- guardrail_policy: "guardrail_policy";
272
334
  rule: "rule";
273
335
  escalation_criterion: "escalation_criterion";
274
336
  prerequisite: "prerequisite";
@@ -423,8 +485,8 @@ declare const DslSchema: z.ZodObject<{
423
485
  fidelity: "fidelity";
424
486
  }>;
425
487
  executor_type: z.ZodEnum<{
426
- tool: "tool";
427
488
  agent: "agent";
489
+ tool: "tool";
428
490
  }>;
429
491
  executor: z.ZodString;
430
492
  blocking: z.ZodBoolean;
@@ -544,21 +606,21 @@ declare const DslSchema: z.ZodObject<{
544
606
  items: z.ZodOptional<z.ZodString>;
545
607
  description: z.ZodOptional<z.ZodString>;
546
608
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
547
- guardrail: "guardrail";
548
- workflow: "workflow";
549
- tool: "tool";
550
609
  agent: "agent";
551
610
  task: "task";
611
+ artifact: "artifact";
612
+ tool: "tool";
552
613
  validation: "validation";
553
- root: "root";
614
+ handoff_type: "handoff_type";
615
+ workflow: "workflow";
616
+ policy: "policy";
617
+ guardrail: "guardrail";
618
+ guardrail_policy: "guardrail_policy";
554
619
  system: "system";
620
+ root: "root";
555
621
  execution_step: "execution_step";
556
- artifact: "artifact";
557
622
  tool_command: "tool_command";
558
- handoff_type: "handoff_type";
559
623
  workflow_step: "workflow_step";
560
- policy: "policy";
561
- guardrail_policy: "guardrail_policy";
562
624
  rule: "rule";
563
625
  escalation_criterion: "escalation_criterion";
564
626
  prerequisite: "prerequisite";
@@ -836,8 +898,8 @@ declare const ValidationSchema: z.ZodObject<{
836
898
  fidelity: "fidelity";
837
899
  }>;
838
900
  executor_type: z.ZodEnum<{
839
- tool: "tool";
840
901
  agent: "agent";
902
+ tool: "tool";
841
903
  }>;
842
904
  executor: z.ZodString;
843
905
  blocking: z.ZodBoolean;
@@ -1050,35 +1112,20 @@ declare function spectralLint(dslObject: Record<string, unknown>): Promise<LintD
1050
1112
 
1051
1113
  declare const yamlReservedKeySafetyRule: LintRule;
1052
1114
 
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
1115
  declare const RenderTargetSchema: z.ZodObject<{
1069
1116
  template: z.ZodString;
1070
1117
  context: z.ZodEnum<{
1071
- guardrail: "guardrail";
1072
- workflow: "workflow";
1073
- tool: "tool";
1074
1118
  agent: "agent";
1075
1119
  task: "task";
1076
- validation: "validation";
1077
- system: "system";
1078
1120
  artifact: "artifact";
1121
+ tool: "tool";
1122
+ validation: "validation";
1079
1123
  handoff_type: "handoff_type";
1124
+ workflow: "workflow";
1080
1125
  policy: "policy";
1126
+ guardrail: "guardrail";
1081
1127
  guardrail_policy: "guardrail_policy";
1128
+ system: "system";
1082
1129
  }>;
1083
1130
  output: z.ZodString;
1084
1131
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1089,26 +1136,26 @@ type RenderTarget = z.infer<typeof RenderTargetSchema>;
1089
1136
  declare const AgentContractsConfigSchema: z.ZodObject<{
1090
1137
  dsl: z.ZodString;
1091
1138
  vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1092
- renders: z.ZodArray<z.ZodObject<{
1139
+ renders: z.ZodDefault<z.ZodArray<z.ZodObject<{
1093
1140
  template: z.ZodString;
1094
1141
  context: z.ZodEnum<{
1095
- guardrail: "guardrail";
1096
- workflow: "workflow";
1097
- tool: "tool";
1098
1142
  agent: "agent";
1099
1143
  task: "task";
1100
- validation: "validation";
1101
- system: "system";
1102
1144
  artifact: "artifact";
1145
+ tool: "tool";
1146
+ validation: "validation";
1103
1147
  handoff_type: "handoff_type";
1148
+ workflow: "workflow";
1104
1149
  policy: "policy";
1150
+ guardrail: "guardrail";
1105
1151
  guardrail_policy: "guardrail_policy";
1152
+ system: "system";
1106
1153
  }>;
1107
1154
  output: z.ZodString;
1108
1155
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
1109
1156
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
1110
1157
  skip_empty: z.ZodOptional<z.ZodBoolean>;
1111
- }, z.core.$strip>>;
1158
+ }, z.core.$strip>>>;
1112
1159
  bindings: z.ZodDefault<z.ZodArray<z.ZodString>>;
1113
1160
  active_guardrail_policy: z.ZodOptional<z.ZodString>;
1114
1161
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1388,7 +1435,7 @@ interface ResolvedCheck {
1388
1435
  policy_rule: GuardrailPolicyRule;
1389
1436
  check: Check;
1390
1437
  }
1391
- interface GuardrailGenerationContext {
1438
+ interface BindingGenerationContext {
1392
1439
  system: {
1393
1440
  id: string;
1394
1441
  name: string;
@@ -1405,7 +1452,14 @@ interface GuardrailGenerationContext {
1405
1452
  timeout_ms: number;
1406
1453
  } | null;
1407
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>;
1408
1460
  }
1461
+ /** @deprecated Use BindingGenerationContext */
1462
+ type GuardrailGenerationContext = BindingGenerationContext;
1409
1463
  interface GenerateResult {
1410
1464
  outputFiles: string[];
1411
1465
  diagnostics: GenerateDiagnostic[];
@@ -1437,4 +1491,4 @@ interface PathResolveResult {
1437
1491
  }
1438
1492
  declare function resolveBindingTargetPath(target: string, paths: Record<string, string>, bindingSoftware: string): PathResolveResult;
1439
1493
 
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 };
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 };