agent-contracts 0.14.1 → 0.16.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.js CHANGED
@@ -6292,7 +6292,7 @@ var init_index_es = __esm({
6292
6292
  return { drive: t4.toLowerCase() + ":" };
6293
6293
  }, k2 = function() {
6294
6294
  return { drive: null };
6295
- }, z18 = function() {
6295
+ }, z20 = function() {
6296
6296
  return { drive: null };
6297
6297
  }, B2 = function(t4) {
6298
6298
  return { protocol: null, origin: null, absolute: false, drive: null, ...t4 };
@@ -6333,7 +6333,7 @@ var init_index_es = __esm({
6333
6333
  var t4, n4, r4, e4, o4;
6334
6334
  return t4 = K2, (n4 = rt()) !== c2 && (r4 = et()) !== c2 && (e4 = ut()) !== c2 && (o4 = it()) !== c2 ? (n4 = s2(n4, r4, e4, o4), t4 = n4) : (K2 = t4, t4 = c2), t4 === c2 && (t4 = K2, (n4 = rt()) !== c2 && (r4 = et()) !== c2 && (e4 = (function() {
6335
6335
  var t5;
6336
- return (t5 = x3) !== c2 && (t5 = z18()), t5;
6336
+ return (t5 = x3) !== c2 && (t5 = z20()), t5;
6337
6337
  })()) !== c2 ? (n4 = f2(n4, r4, e4), t4 = n4) : (K2 = t4, t4 = c2)), t4;
6338
6338
  })()) === c2 && (n3 = (function() {
6339
6339
  var n4, r4, e4, o4;
@@ -8022,7 +8022,7 @@ __export(index_es_exports2, {
8022
8022
  resolveExternalRef: () => ye,
8023
8023
  resolveExternalRefWithLocation: () => ge,
8024
8024
  resolveInlineRef: () => B,
8025
- resolveInlineRefWithLocation: () => z16,
8025
+ resolveInlineRefWithLocation: () => z18,
8026
8026
  safeParse: () => de,
8027
8027
  safeStringify: () => ve,
8028
8028
  startsWith: () => be,
@@ -8066,9 +8066,9 @@ function* L(e3, t3, r3) {
8066
8066
  for (const [n3, o3] of t3.entries()) O(e3.value, o3, r3), e3.value = e3.value[o3], A(e3.value) && (j(e3.value), yield [n3, e3.value]);
8067
8067
  }
8068
8068
  function B(e3, t3) {
8069
- return z16(e3, t3).value;
8069
+ return z18(e3, t3).value;
8070
8070
  }
8071
- function z16(e3, t3) {
8071
+ function z18(e3, t3) {
8072
8072
  return (function e4(t4, r3, n3, o3) {
8073
8073
  if (null !== V(r3)) throw new ReferenceError("Cannot resolve external references");
8074
8074
  const i3 = K(r3);
@@ -16898,7 +16898,7 @@ var require_immer_cjs_production_min = __commonJS({
16898
16898
  var t4 = n4[H2];
16899
16899
  return (t4 ? s2(t4) : n4)[r4];
16900
16900
  }
16901
- function z18(n4, r4) {
16901
+ function z20(n4, r4) {
16902
16902
  if (r4 in n4) for (var t4 = Object.getPrototypeOf(n4); t4; ) {
16903
16903
  var e4 = Object.getOwnPropertyDescriptor(t4, r4);
16904
16904
  if (e4) return e4;
@@ -17291,7 +17291,7 @@ var require_immer_cjs_production_min = __commonJS({
17291
17291
  if (r4 === H2) return n4;
17292
17292
  var e4 = s2(n4);
17293
17293
  if (!u2(e4, r4)) return (function(n5, r5, t4) {
17294
- var e5, i5 = z18(r5, t4);
17294
+ var e5, i5 = z20(r5, t4);
17295
17295
  return i5 ? "value" in i5 ? i5.value : null === (e5 = i5.get) || void 0 === e5 ? void 0 : e5.call(n5.k) : void 0;
17296
17296
  })(n4, e4, r4);
17297
17297
  var i4 = e4[r4];
@@ -17301,7 +17301,7 @@ var require_immer_cjs_production_min = __commonJS({
17301
17301
  }, ownKeys: function(n4) {
17302
17302
  return Reflect.ownKeys(s2(n4));
17303
17303
  }, set: function(n4, r4, t4) {
17304
- var e4 = z18(s2(n4), r4);
17304
+ var e4 = z20(s2(n4), r4);
17305
17305
  if (null == e4 ? void 0 : e4.set) return e4.set.call(n4.k, t4), true;
17306
17306
  if (!n4.g) {
17307
17307
  var i4 = A2(s2(n4), r4), o4 = null == i4 ? void 0 : i4[H2];
@@ -35640,11 +35640,11 @@ var require_brace_expansion = __commonJS({
35640
35640
  if (pad) {
35641
35641
  var need = width - c2.length;
35642
35642
  if (need > 0) {
35643
- var z18 = new Array(need + 1).join("0");
35643
+ var z20 = new Array(need + 1).join("0");
35644
35644
  if (i3 < 0)
35645
- c2 = "-" + z18 + c2.slice(1);
35645
+ c2 = "-" + z20 + c2.slice(1);
35646
35646
  else
35647
- c2 = z18 + c2;
35647
+ c2 = z20 + c2;
35648
35648
  }
35649
35649
  }
35650
35650
  }
@@ -49168,7 +49168,7 @@ var require_dist10 = __commonJS({
49168
49168
  var getSiblings = (parent) => (node) => getChildren(parent).filter(not(eq(node)));
49169
49169
  var concatAll = (
49170
49170
  /*::<T>*/
49171
- (xs) => (ys) => ys.reduce((zs, z18) => zs.concat(z18), xs)
49171
+ (xs) => (ys) => ys.reduce((zs, z20) => zs.concat(z20), xs)
49172
49172
  );
49173
49173
  function getLastSegment(instancePath) {
49174
49174
  const index4 = instancePath.lastIndexOf("/");
@@ -50602,7 +50602,7 @@ var SoftwareBindingSchema = z4.object({
50602
50602
  }).passthrough();
50603
50603
 
50604
50604
  // src/schema/dsl.ts
50605
- import { z as z13 } from "zod";
50605
+ import { z as z15 } from "zod";
50606
50606
 
50607
50607
  // src/schema/handoff-type.ts
50608
50608
  import { z as z5 } from "zod";
@@ -50703,106 +50703,143 @@ var TaskSchema = z9.object({
50703
50703
  guardrails: z9.array(z9.string()).optional()
50704
50704
  }).passthrough();
50705
50705
 
50706
- // src/schema/tool.ts
50706
+ // src/schema/team-import.ts
50707
50707
  import { z as z10 } from "zod";
50708
- var CommandSchema = z10.object({
50709
- command: z10.string(),
50710
- category: z10.string(),
50711
- reads: z10.array(z10.string()).default([]),
50712
- writes: z10.array(z10.string()).default([]),
50713
- purpose: z10.string().optional()
50714
- });
50715
- var ToolSchema = z10.object({
50716
- kind: z10.string(),
50717
- description: z10.string().optional(),
50718
- input_artifacts: z10.array(z10.string()).default([]),
50719
- output_artifacts: z10.array(z10.string()).default([]),
50720
- invokable_by: z10.array(z10.string()),
50721
- side_effects: z10.array(z10.string()).default([]),
50722
- commands: z10.array(CommandSchema).default([]),
50723
- guardrails: z10.array(z10.string()).optional()
50708
+ var TeamImportSchema = z10.object({
50709
+ interface: z10.string(),
50710
+ version: z10.string().optional()
50724
50711
  }).passthrough();
50725
50712
 
50726
- // src/schema/validation.ts
50713
+ // src/schema/team-interface.ts
50727
50714
  import { z as z11 } from "zod";
50728
- var ValidationSchema = z11.object({
50729
- target_artifact: z11.string(),
50730
- kind: z11.enum(["schema", "mechanical", "semantic", "approval", "provenance", "traceability", "fidelity"]),
50731
- executor_type: z11.enum(["tool", "agent"]),
50732
- executor: z11.string(),
50733
- blocking: z11.boolean(),
50734
- produces_evidence: z11.string().optional()
50715
+ var TeamInterfaceAcceptWorkflowSchema = z11.object({
50716
+ internal_workflow: z11.string().optional(),
50717
+ input_handoff: z11.string(),
50718
+ output_handoff: z11.string(),
50719
+ description: z11.string().optional()
50720
+ }).passthrough();
50721
+ var TeamInterfaceSchema = z11.object({
50722
+ version: z11.number(),
50723
+ description: z11.string().optional(),
50724
+ accepts: z11.object({
50725
+ workflows: z11.record(z11.string(), TeamInterfaceAcceptWorkflowSchema)
50726
+ }).passthrough().optional(),
50727
+ exposes: z11.object({
50728
+ artifacts: z11.array(z11.string())
50729
+ }).passthrough().optional(),
50730
+ constraints: z11.array(z11.string()).optional()
50735
50731
  }).passthrough();
50736
50732
 
50737
- // src/schema/workflow.ts
50733
+ // src/schema/tool.ts
50738
50734
  import { z as z12 } from "zod";
50739
- var RetrySchema = z12.object({
50740
- condition: z12.string(),
50741
- fix_task: z12.string(),
50742
- revalidate_task: z12.string().optional()
50743
- });
50744
- var ExternalParticipantSchema = z12.object({
50745
- id: z12.string(),
50746
- kind: z12.enum(["actor", "participant"]),
50747
- label: z12.string(),
50748
- description: z12.string().optional()
50749
- });
50750
- var WorkflowDelegateStepSchema = z12.object({
50751
- type: z12.literal("delegate"),
50735
+ var CommandSchema = z12.object({
50736
+ command: z12.string(),
50737
+ category: z12.string(),
50738
+ reads: z12.array(z12.string()).default([]),
50739
+ writes: z12.array(z12.string()).default([]),
50740
+ purpose: z12.string().optional()
50741
+ });
50742
+ var ToolSchema = z12.object({
50743
+ kind: z12.string(),
50752
50744
  description: z12.string().optional(),
50753
- task: z12.string(),
50754
- from_agent: z12.string(),
50755
- group: z12.string().optional(),
50745
+ input_artifacts: z12.array(z12.string()).default([]),
50746
+ output_artifacts: z12.array(z12.string()).default([]),
50747
+ invokable_by: z12.array(z12.string()),
50748
+ side_effects: z12.array(z12.string()).default([]),
50749
+ commands: z12.array(CommandSchema).default([]),
50750
+ guardrails: z12.array(z12.string()).optional()
50751
+ }).passthrough();
50752
+
50753
+ // src/schema/validation.ts
50754
+ import { z as z13 } from "zod";
50755
+ var ValidationSchema = z13.object({
50756
+ target_artifact: z13.string(),
50757
+ kind: z13.enum(["schema", "mechanical", "semantic", "approval", "provenance", "traceability", "fidelity"]),
50758
+ executor_type: z13.enum(["tool", "agent"]),
50759
+ executor: z13.string(),
50760
+ blocking: z13.boolean(),
50761
+ produces_evidence: z13.string().optional()
50762
+ }).passthrough();
50763
+
50764
+ // src/schema/workflow.ts
50765
+ import { z as z14 } from "zod";
50766
+ var RetrySchema = z14.object({
50767
+ condition: z14.string(),
50768
+ fix_task: z14.string(),
50769
+ revalidate_task: z14.string().optional()
50770
+ });
50771
+ var ExternalParticipantSchema = z14.object({
50772
+ id: z14.string(),
50773
+ kind: z14.enum(["actor", "participant"]),
50774
+ label: z14.string(),
50775
+ description: z14.string().optional()
50776
+ });
50777
+ var WorkflowDelegateStepSchema = z14.object({
50778
+ type: z14.literal("delegate"),
50779
+ description: z14.string().optional(),
50780
+ task: z14.string(),
50781
+ from_agent: z14.string(),
50782
+ group: z14.string().optional(),
50756
50783
  retry: RetrySchema.optional()
50757
50784
  }).passthrough();
50758
- var WorkflowGateStepSchema = z12.object({
50759
- type: z12.literal("gate"),
50760
- description: z12.string().optional(),
50761
- gate_kind: z12.string(),
50762
- group: z12.string().optional()
50785
+ var WorkflowGateStepSchema = z14.object({
50786
+ type: z14.literal("gate"),
50787
+ description: z14.string().optional(),
50788
+ gate_kind: z14.string(),
50789
+ group: z14.string().optional()
50763
50790
  }).passthrough();
50764
- var WorkflowHandoffStepSchema = z12.object({
50765
- type: z12.literal("handoff"),
50766
- description: z12.string().optional(),
50767
- handoff_kind: z12.string(),
50768
- task: z12.string().optional(),
50769
- from_agent: z12.string().optional(),
50770
- group: z12.string().optional(),
50791
+ var WorkflowHandoffStepSchema = z14.object({
50792
+ type: z14.literal("handoff"),
50793
+ description: z14.string().optional(),
50794
+ handoff_kind: z14.string(),
50795
+ task: z14.string().optional(),
50796
+ from_agent: z14.string().optional(),
50797
+ group: z14.string().optional(),
50771
50798
  retry: RetrySchema.optional()
50772
50799
  }).passthrough();
50773
- var WorkflowValidationStepSchema = z12.object({
50774
- type: z12.literal("validation"),
50775
- description: z12.string().optional(),
50776
- validation: z12.string(),
50777
- group: z12.string().optional()
50800
+ var WorkflowValidationStepSchema = z14.object({
50801
+ type: z14.literal("validation"),
50802
+ description: z14.string().optional(),
50803
+ validation: z14.string(),
50804
+ group: z14.string().optional()
50778
50805
  }).passthrough();
50779
- var WorkflowDecisionStepSchema = z12.object({
50780
- type: z12.literal("decision"),
50781
- description: z12.string().optional(),
50806
+ var WorkflowDecisionStepSchema = z14.object({
50807
+ type: z14.literal("decision"),
50808
+ description: z14.string().optional(),
50782
50809
  /** @deprecated Use `routing_key` instead. `on` is kept for backward compatibility. */
50783
- on: z12.string().optional(),
50784
- routing_key: z12.string().optional(),
50785
- branches: z12.record(z12.string(), z12.array(z12.string())),
50786
- group: z12.string().optional()
50810
+ on: z14.string().optional(),
50811
+ routing_key: z14.string().optional(),
50812
+ branches: z14.record(z14.string(), z14.array(z14.string())),
50813
+ group: z14.string().optional()
50787
50814
  }).passthrough();
50788
- var WorkflowStepSchema = z12.discriminatedUnion("type", [
50815
+ var WorkflowTeamTaskStepSchema = z14.object({
50816
+ type: z14.literal("team_task"),
50817
+ description: z14.string().optional(),
50818
+ to_team: z14.string(),
50819
+ workflow: z14.string(),
50820
+ handoff: z14.string(),
50821
+ expects: z14.string(),
50822
+ group: z14.string().optional()
50823
+ }).passthrough();
50824
+ var WorkflowStepSchema = z14.discriminatedUnion("type", [
50789
50825
  WorkflowDelegateStepSchema,
50790
50826
  WorkflowGateStepSchema,
50791
50827
  WorkflowHandoffStepSchema,
50792
50828
  WorkflowValidationStepSchema,
50793
- WorkflowDecisionStepSchema
50829
+ WorkflowDecisionStepSchema,
50830
+ WorkflowTeamTaskStepSchema
50794
50831
  ]);
50795
- var WorkflowSchema = z12.object({
50796
- description: z12.string().optional(),
50797
- entry_conditions: z12.array(z12.string()).default([]),
50798
- trigger: z12.string().optional(),
50799
- steps: z12.array(WorkflowStepSchema),
50800
- external_participants: z12.array(ExternalParticipantSchema).default([])
50832
+ var WorkflowSchema = z14.object({
50833
+ description: z14.string().optional(),
50834
+ entry_conditions: z14.array(z14.string()).default([]),
50835
+ trigger: z14.string().optional(),
50836
+ steps: z14.array(WorkflowStepSchema),
50837
+ external_participants: z14.array(ExternalParticipantSchema).default([])
50801
50838
  }).passthrough();
50802
50839
 
50803
50840
  // src/schema/dsl.ts
50804
- var ComponentsSchema = z13.object({
50805
- schemas: z13.record(z13.string(), z13.record(z13.string(), z13.any())).default({})
50841
+ var ComponentsSchema = z15.object({
50842
+ schemas: z15.record(z15.string(), z15.record(z15.string(), z15.any())).default({})
50806
50843
  }).passthrough();
50807
50844
  var SCOPE_NODE_TYPES = [
50808
50845
  "root",
@@ -50824,32 +50861,34 @@ var SCOPE_NODE_TYPES = [
50824
50861
  "escalation_criterion",
50825
50862
  "prerequisite"
50826
50863
  ];
50827
- var ScopeNodeTypeSchema = z13.enum(SCOPE_NODE_TYPES);
50828
- var XExtensionDeclSchema = z13.object({
50829
- type: z13.string(),
50830
- items: z13.string().optional(),
50831
- description: z13.string().optional(),
50832
- scope: z13.array(ScopeNodeTypeSchema).optional(),
50833
- schema: z13.record(z13.string(), z13.any()).optional(),
50834
- required: z13.boolean().default(false)
50835
- });
50836
- var DslSchema = z13.object({
50837
- version: z13.literal(1),
50838
- extends: z13.string().optional(),
50864
+ var ScopeNodeTypeSchema = z15.enum(SCOPE_NODE_TYPES);
50865
+ var XExtensionDeclSchema = z15.object({
50866
+ type: z15.string(),
50867
+ items: z15.string().optional(),
50868
+ description: z15.string().optional(),
50869
+ scope: z15.array(ScopeNodeTypeSchema).optional(),
50870
+ schema: z15.record(z15.string(), z15.any()).optional(),
50871
+ required: z15.boolean().default(false)
50872
+ });
50873
+ var DslSchema = z15.object({
50874
+ version: z15.literal(1),
50875
+ extends: z15.string().optional(),
50839
50876
  system: SystemSchema,
50840
- agents: z13.record(z13.string(), AgentSchema).default({}),
50841
- tasks: z13.record(z13.string(), TaskSchema).default({}),
50842
- artifacts: z13.record(z13.string(), ArtifactSchema).default({}),
50843
- tools: z13.record(z13.string(), ToolSchema).default({}),
50844
- validations: z13.record(z13.string(), ValidationSchema).default({}),
50845
- handoff_types: z13.record(z13.string(), HandoffTypeSchema).default({}),
50846
- workflow: z13.record(z13.string(), WorkflowSchema).default({}),
50847
- policies: z13.record(z13.string(), PolicySchema).default({}),
50848
- guardrails: z13.record(z13.string(), GuardrailSchema).default({}),
50849
- guardrail_policies: z13.record(z13.string(), GuardrailPolicySchema).default({}),
50877
+ agents: z15.record(z15.string(), AgentSchema).default({}),
50878
+ tasks: z15.record(z15.string(), TaskSchema).default({}),
50879
+ artifacts: z15.record(z15.string(), ArtifactSchema).default({}),
50880
+ tools: z15.record(z15.string(), ToolSchema).default({}),
50881
+ validations: z15.record(z15.string(), ValidationSchema).default({}),
50882
+ handoff_types: z15.record(z15.string(), HandoffTypeSchema).default({}),
50883
+ team_interface: TeamInterfaceSchema.optional(),
50884
+ imports: z15.record(z15.string(), TeamImportSchema).optional(),
50885
+ workflow: z15.record(z15.string(), WorkflowSchema).default({}),
50886
+ policies: z15.record(z15.string(), PolicySchema).default({}),
50887
+ guardrails: z15.record(z15.string(), GuardrailSchema).default({}),
50888
+ guardrail_policies: z15.record(z15.string(), GuardrailPolicySchema).default({}),
50850
50889
  components: ComponentsSchema.default({ schemas: {} }),
50851
- extensions: z13.record(z13.string(), XExtensionDeclSchema).default({}),
50852
- extensions_strict: z13.boolean().default(false)
50890
+ extensions: z15.record(z15.string(), XExtensionDeclSchema).default({}),
50891
+ extensions_strict: z15.boolean().default(false)
50853
50892
  }).passthrough();
50854
50893
 
50855
50894
  // src/schema/json-schema-utils.ts
@@ -50901,22 +50940,22 @@ function resolveAllOf(schema) {
50901
50940
  }
50902
50941
 
50903
50942
  // src/schema/merge-operators.ts
50904
- import { z as z14 } from "zod";
50905
- var AppendOperatorSchema = z14.object({
50906
- $append: z14.record(z14.string(), z14.any())
50943
+ import { z as z16 } from "zod";
50944
+ var AppendOperatorSchema = z16.object({
50945
+ $append: z16.record(z16.string(), z16.any())
50907
50946
  });
50908
- var PrependOperatorSchema = z14.object({
50909
- $prepend: z14.record(z14.string(), z14.any())
50947
+ var PrependOperatorSchema = z16.object({
50948
+ $prepend: z16.record(z16.string(), z16.any())
50910
50949
  });
50911
- var InsertAfterOperatorSchema = z14.object({
50912
- $insert_after: z14.object({
50913
- after: z14.string(),
50914
- entries: z14.record(z14.string(), z14.any())
50950
+ var InsertAfterOperatorSchema = z16.object({
50951
+ $insert_after: z16.object({
50952
+ after: z16.string(),
50953
+ entries: z16.record(z16.string(), z16.any())
50915
50954
  })
50916
50955
  });
50917
- var ReplaceOperatorSchema = z14.object({ $replace: z14.any() });
50918
- var RemoveOperatorSchema = z14.object({
50919
- $remove: z14.array(z14.string())
50956
+ var ReplaceOperatorSchema = z16.object({ $replace: z16.any() });
50957
+ var RemoveOperatorSchema = z16.object({
50958
+ $remove: z16.array(z16.string())
50920
50959
  });
50921
50960
 
50922
50961
  // src/loader/loader.ts
@@ -51464,6 +51503,7 @@ var MERGE_SECTIONS = [
51464
51503
  "tools",
51465
51504
  "validations",
51466
51505
  "handoff_types",
51506
+ "imports",
51467
51507
  "workflow",
51468
51508
  "policies",
51469
51509
  "guardrails",
@@ -51532,16 +51572,16 @@ function expandDefaults(data) {
51532
51572
 
51533
51573
  // src/validator/schema-validator.ts
51534
51574
  import Ajv from "ajv";
51535
- import { z as z15 } from "zod";
51575
+ import { z as z17 } from "zod";
51536
51576
  function unwrap(schema) {
51537
- if (schema instanceof z15.ZodOptional) return unwrap(schema.unwrap());
51538
- if (schema instanceof z15.ZodDefault) return unwrap(schema.removeDefault());
51539
- if (schema instanceof z15.ZodNullable) return unwrap(schema.unwrap());
51577
+ if (schema instanceof z17.ZodOptional) return unwrap(schema.unwrap());
51578
+ if (schema instanceof z17.ZodDefault) return unwrap(schema.removeDefault());
51579
+ if (schema instanceof z17.ZodNullable) return unwrap(schema.unwrap());
51540
51580
  return schema;
51541
51581
  }
51542
51582
  function checkCustomPropsRecursive(data, schema, path) {
51543
51583
  const inner = unwrap(schema);
51544
- if (inner instanceof z15.ZodObject) {
51584
+ if (inner instanceof z17.ZodObject) {
51545
51585
  if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
51546
51586
  const obj = data;
51547
51587
  const shape = inner.shape;
@@ -51562,7 +51602,7 @@ function checkCustomPropsRecursive(data, schema, path) {
51562
51602
  }
51563
51603
  return diagnostics;
51564
51604
  }
51565
- if (inner instanceof z15.ZodRecord) {
51605
+ if (inner instanceof z17.ZodRecord) {
51566
51606
  if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
51567
51607
  const valueSchema = inner._def.valueType;
51568
51608
  const diagnostics = [];
@@ -51571,7 +51611,7 @@ function checkCustomPropsRecursive(data, schema, path) {
51571
51611
  }
51572
51612
  return diagnostics;
51573
51613
  }
51574
- if (inner instanceof z15.ZodArray) {
51614
+ if (inner instanceof z17.ZodArray) {
51575
51615
  if (!Array.isArray(data)) return [];
51576
51616
  const diagnostics = [];
51577
51617
  for (let i3 = 0; i3 < data.length; i3++) {
@@ -51579,14 +51619,14 @@ function checkCustomPropsRecursive(data, schema, path) {
51579
51619
  }
51580
51620
  return diagnostics;
51581
51621
  }
51582
- if (inner instanceof z15.ZodDiscriminatedUnion) {
51622
+ if (inner instanceof z17.ZodDiscriminatedUnion) {
51583
51623
  if (typeof data !== "object" || data === null) return [];
51584
51624
  const obj = data;
51585
51625
  const disc = inner._def.discriminator;
51586
51626
  const discValue = obj[disc];
51587
51627
  const match = inner.options.find((opt) => {
51588
51628
  const shape = opt.shape;
51589
- return shape[disc] instanceof z15.ZodLiteral && shape[disc].value === discValue;
51629
+ return shape[disc] instanceof z17.ZodLiteral && shape[disc].value === discValue;
51590
51630
  });
51591
51631
  if (match) return checkCustomPropsRecursive(data, match, path);
51592
51632
  return [];
@@ -52388,6 +52428,25 @@ function checkReferences(dsl) {
52388
52428
  }
52389
52429
  } else if (step.type === "validation") {
52390
52430
  checkExists(step.validation, validationIds, "validations", `workflow.${wfId}.steps[${j2}].validation`);
52431
+ } else if (step.type === "team_task") {
52432
+ const importKeys = dsl.imports !== void 0 ? new Set(Object.keys(dsl.imports)) : null;
52433
+ if (importKeys) {
52434
+ checkExists(
52435
+ step.to_team,
52436
+ importKeys,
52437
+ "imports",
52438
+ `workflow.${wfId}.steps[${j2}].to_team`,
52439
+ "team-import-not-found"
52440
+ );
52441
+ } else {
52442
+ diagnostics.push({
52443
+ path: `workflow.${wfId}.steps[${j2}].to_team`,
52444
+ message: `team_task step references team "${step.to_team}" but dsl.imports is not defined`,
52445
+ code: "team-task-missing-imports"
52446
+ });
52447
+ }
52448
+ checkExists(step.handoff, handoffKinds, "handoff_types", `workflow.${wfId}.steps[${j2}].handoff`);
52449
+ checkExists(step.expects, handoffKinds, "handoff_types", `workflow.${wfId}.steps[${j2}].expects`);
52391
52450
  }
52392
52451
  }
52393
52452
  }
@@ -52565,6 +52624,48 @@ function checkReferences(dsl) {
52565
52624
  );
52566
52625
  }
52567
52626
  }
52627
+ const workflowDefinitionIds = new Set(Object.keys(dsl.workflow));
52628
+ if (dsl.team_interface) {
52629
+ const ti = dsl.team_interface;
52630
+ if (ti.accepts?.workflows) {
52631
+ for (const [wfKey, spec] of Object.entries(ti.accepts.workflows)) {
52632
+ const internalWf = spec.internal_workflow ?? wfKey;
52633
+ checkExists(
52634
+ internalWf,
52635
+ workflowDefinitionIds,
52636
+ "workflow",
52637
+ `team_interface.accepts.workflows.${wfKey}.internal_workflow`,
52638
+ "team-interface-workflow-not-found"
52639
+ );
52640
+ checkExists(
52641
+ spec.input_handoff,
52642
+ handoffKinds,
52643
+ "handoff_types",
52644
+ `team_interface.accepts.workflows.${wfKey}.input_handoff`,
52645
+ "team-interface-handoff-not-found"
52646
+ );
52647
+ checkExists(
52648
+ spec.output_handoff,
52649
+ handoffKinds,
52650
+ "handoff_types",
52651
+ `team_interface.accepts.workflows.${wfKey}.output_handoff`,
52652
+ "team-interface-handoff-not-found"
52653
+ );
52654
+ }
52655
+ }
52656
+ if (ti.exposes?.artifacts) {
52657
+ for (let i3 = 0; i3 < ti.exposes.artifacts.length; i3++) {
52658
+ const artKey = ti.exposes.artifacts[i3];
52659
+ checkExists(
52660
+ artKey,
52661
+ artifactIds,
52662
+ "artifacts",
52663
+ `team_interface.exposes.artifacts[${i3}]`,
52664
+ "team-interface-artifact-not-found"
52665
+ );
52666
+ }
52667
+ }
52668
+ }
52568
52669
  return diagnostics;
52569
52670
  }
52570
52671
 
@@ -55395,14 +55496,14 @@ import { resolve as resolve4, dirname as dirname4 } from "path";
55395
55496
  import { parse as parseYaml2 } from "yaml";
55396
55497
 
55397
55498
  // src/config/types.ts
55398
- import { z as z17 } from "zod";
55399
- var RenderTargetSchema = z17.object({
55400
- template: z17.string(),
55499
+ import { z as z19 } from "zod";
55500
+ var RenderTargetSchema = z19.object({
55501
+ template: z19.string(),
55401
55502
  context: ContextTypeSchema,
55402
- output: z17.string(),
55403
- include: z17.array(z17.string()).optional(),
55404
- exclude: z17.array(z17.string()).optional(),
55405
- skip_empty: z17.boolean().optional()
55503
+ output: z19.string(),
55504
+ include: z19.array(z19.string()).optional(),
55505
+ exclude: z19.array(z19.string()).optional(),
55506
+ skip_empty: z19.boolean().optional()
55406
55507
  }).refine(
55407
55508
  (data) => !(data.include && data.exclude),
55408
55509
  { message: "include and exclude are mutually exclusive" }
@@ -55415,13 +55516,51 @@ var RenderTargetSchema = z17.object({
55415
55516
  },
55416
55517
  { message: "include/exclude cannot be used with context: system" }
55417
55518
  );
55418
- var AgentContractsConfigSchema = z17.object({
55419
- dsl: z17.string(),
55420
- vars: z17.record(z17.string(), z17.string()).optional(),
55421
- renders: z17.array(RenderTargetSchema).default([]),
55422
- bindings: z17.array(z17.string()).default([]),
55423
- active_guardrail_policy: z17.string().optional(),
55424
- paths: z17.record(z17.string(), z17.string()).optional()
55519
+ var TeamConfigSchema = z19.object({
55520
+ dsl: z19.string().optional(),
55521
+ bindings: z19.array(z19.string()).default([]),
55522
+ vars: z19.record(z19.string(), z19.string()).optional(),
55523
+ paths: z19.record(z19.string(), z19.string()).optional(),
55524
+ active_guardrail_policy: z19.string().optional(),
55525
+ interface_output: z19.string().optional()
55526
+ });
55527
+ var AgentContractsConfigSchema = z19.object({
55528
+ dsl: z19.string().optional(),
55529
+ vars: z19.record(z19.string(), z19.string()).optional(),
55530
+ renders: z19.array(RenderTargetSchema).default([]),
55531
+ bindings: z19.array(z19.string()).default([]),
55532
+ active_guardrail_policy: z19.string().optional(),
55533
+ paths: z19.record(z19.string(), z19.string()).optional(),
55534
+ teams: z19.record(z19.string(), TeamConfigSchema).optional()
55535
+ }).superRefine((data, ctx) => {
55536
+ if (data.dsl !== void 0 && data.teams !== void 0) {
55537
+ ctx.addIssue({
55538
+ code: z19.ZodIssueCode.custom,
55539
+ message: "dsl and teams are mutually exclusive",
55540
+ path: ["teams"]
55541
+ });
55542
+ return;
55543
+ }
55544
+ if (data.dsl === void 0 && data.teams === void 0) {
55545
+ ctx.addIssue({
55546
+ code: z19.ZodIssueCode.custom,
55547
+ message: "Either dsl or teams must be specified",
55548
+ path: []
55549
+ });
55550
+ return;
55551
+ }
55552
+ if (data.teams) {
55553
+ for (const [key, team] of Object.entries(data.teams)) {
55554
+ if (key === "_defaults") continue;
55555
+ if (team.dsl === void 0) {
55556
+ ctx.addIssue({
55557
+ code: z19.ZodIssueCode.custom,
55558
+ message: `Team "${key}" must specify dsl`,
55559
+ path: ["teams", key, "dsl"]
55560
+ });
55561
+ }
55562
+ }
55563
+ }
55425
55564
  });
55426
55565
 
55427
55566
  // src/config/loader.ts
@@ -55442,6 +55581,27 @@ async function fileExists2(filePath) {
55442
55581
  return false;
55443
55582
  }
55444
55583
  }
55584
+ function resolveTeamConfigs(teams, configDir) {
55585
+ const defaults = teams._defaults;
55586
+ const result = {};
55587
+ for (const [key, team] of Object.entries(teams)) {
55588
+ if (key === "_defaults") continue;
55589
+ const mergedBindings = [...defaults?.bindings ?? [], ...team.bindings].map(
55590
+ (b3) => resolve4(configDir, b3)
55591
+ );
55592
+ const mergedVars = defaults?.vars || team.vars ? { ...defaults?.vars ?? {}, ...team.vars ?? {} } : void 0;
55593
+ const mergedPaths = defaults?.paths || team.paths ? { ...defaults?.paths ?? {}, ...team.paths ?? {} } : void 0;
55594
+ result[key] = {
55595
+ dsl: resolve4(configDir, team.dsl),
55596
+ bindings: mergedBindings,
55597
+ vars: mergedVars,
55598
+ activeGuardrailPolicy: team.active_guardrail_policy ?? defaults?.active_guardrail_policy,
55599
+ paths: mergedPaths,
55600
+ interfaceOutput: team.interface_output ? resolve4(configDir, team.interface_output) : void 0
55601
+ };
55602
+ }
55603
+ return result;
55604
+ }
55445
55605
  async function loadConfig(configPath) {
55446
55606
  const isExplicit = configPath !== void 0;
55447
55607
  const targetPath = resolve4(configPath ?? DEFAULT_CONFIG_NAME);
@@ -55484,14 +55644,27 @@ ${issues}`,
55484
55644
  }
55485
55645
  const configDir = dirname4(targetPath);
55486
55646
  const config = result.data;
55647
+ const renders = config.renders.map((r3) => ({
55648
+ ...r3,
55649
+ template: resolve4(configDir, r3.template),
55650
+ output: resolve4(configDir, r3.output)
55651
+ }));
55652
+ if (config.teams) {
55653
+ return {
55654
+ dsl: "",
55655
+ vars: void 0,
55656
+ renders,
55657
+ configDir,
55658
+ bindings: [],
55659
+ activeGuardrailPolicy: void 0,
55660
+ paths: void 0,
55661
+ teams: resolveTeamConfigs(config.teams, configDir)
55662
+ };
55663
+ }
55487
55664
  return {
55488
55665
  dsl: resolve4(configDir, config.dsl),
55489
55666
  vars: config.vars,
55490
- renders: config.renders.map((r3) => ({
55491
- ...r3,
55492
- template: resolve4(configDir, r3.template),
55493
- output: resolve4(configDir, r3.output)
55494
- })),
55667
+ renders,
55495
55668
  configDir,
55496
55669
  bindings: (config.bindings ?? []).map((b3) => resolve4(configDir, b3)),
55497
55670
  activeGuardrailPolicy: config.active_guardrail_policy,
@@ -56445,6 +56618,9 @@ export {
56445
56618
  SoftwareBindingSchema,
56446
56619
  SystemSchema,
56447
56620
  TaskSchema,
56621
+ TeamImportSchema,
56622
+ TeamInterfaceAcceptWorkflowSchema,
56623
+ TeamInterfaceSchema,
56448
56624
  ToolSchema,
56449
56625
  ValidationSchema,
56450
56626
  VersionLiteralSchema,