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/README.md +71 -1
- package/dist/cli.js +423 -287
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +109 -55
- package/dist/index.js +425 -287
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
},
|
|
6295
|
+
}, z18 = 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 =
|
|
6336
|
+
return (t5 = x3) !== c2 && (t5 = z18()), 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: () =>
|
|
8025
|
+
resolveInlineRefWithLocation: () => z16,
|
|
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
|
|
8069
|
+
return z16(e3, t3).value;
|
|
8070
8070
|
}
|
|
8071
|
-
function
|
|
8071
|
+
function z16(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
|
|
16901
|
+
function z18(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 =
|
|
17294
|
+
var e5, i5 = z18(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 =
|
|
17304
|
+
var e4 = z18(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
|
|
35643
|
+
var z18 = new Array(need + 1).join("0");
|
|
35644
35644
|
if (i3 < 0)
|
|
35645
|
-
c2 = "-" +
|
|
35645
|
+
c2 = "-" + z18 + c2.slice(1);
|
|
35646
35646
|
else
|
|
35647
|
-
c2 =
|
|
35647
|
+
c2 = z18 + 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,
|
|
49171
|
+
(xs) => (ys) => ys.reduce((zs, z18) => zs.concat(z18), xs)
|
|
49172
49172
|
);
|
|
49173
49173
|
function getLastSegment(instancePath) {
|
|
49174
49174
|
const index4 = instancePath.lastIndexOf("/");
|
|
@@ -50483,44 +50483,66 @@ var ArtifactSchema = z2.object({
|
|
|
50483
50483
|
}).passthrough();
|
|
50484
50484
|
|
|
50485
50485
|
// src/schema/binding.ts
|
|
50486
|
+
import { z as z4 } from "zod";
|
|
50487
|
+
|
|
50488
|
+
// src/schema/context-type.ts
|
|
50486
50489
|
import { z as z3 } from "zod";
|
|
50487
|
-
var
|
|
50488
|
-
|
|
50489
|
-
|
|
50490
|
+
var CONTEXT_TYPES = [
|
|
50491
|
+
"agent",
|
|
50492
|
+
"task",
|
|
50493
|
+
"artifact",
|
|
50494
|
+
"tool",
|
|
50495
|
+
"validation",
|
|
50496
|
+
"handoff_type",
|
|
50497
|
+
"workflow",
|
|
50498
|
+
"policy",
|
|
50499
|
+
"guardrail",
|
|
50500
|
+
"guardrail_policy",
|
|
50501
|
+
"system"
|
|
50502
|
+
];
|
|
50503
|
+
var ContextTypeSchema = z3.enum(CONTEXT_TYPES);
|
|
50504
|
+
var ITERABLE_CONTEXT_TYPES = CONTEXT_TYPES.filter(
|
|
50505
|
+
(t3) => t3 !== "system"
|
|
50506
|
+
);
|
|
50507
|
+
|
|
50508
|
+
// src/schema/binding.ts
|
|
50509
|
+
var CommandRegexMatcherSchema = z4.object({
|
|
50510
|
+
type: z4.literal("command_regex"),
|
|
50511
|
+
pattern: z4.string()
|
|
50490
50512
|
}).passthrough();
|
|
50491
|
-
var ContentRegexMatcherSchema =
|
|
50492
|
-
type:
|
|
50493
|
-
pattern:
|
|
50494
|
-
file_glob:
|
|
50495
|
-
exclude_glob:
|
|
50513
|
+
var ContentRegexMatcherSchema = z4.object({
|
|
50514
|
+
type: z4.literal("content_regex"),
|
|
50515
|
+
pattern: z4.string(),
|
|
50516
|
+
file_glob: z4.string().optional(),
|
|
50517
|
+
exclude_glob: z4.string().optional()
|
|
50496
50518
|
}).passthrough();
|
|
50497
|
-
var FileGlobMatcherSchema =
|
|
50498
|
-
type:
|
|
50499
|
-
pattern:
|
|
50500
|
-
exclude_glob:
|
|
50519
|
+
var FileGlobMatcherSchema = z4.object({
|
|
50520
|
+
type: z4.literal("file_glob"),
|
|
50521
|
+
pattern: z4.string(),
|
|
50522
|
+
exclude_glob: z4.string().optional()
|
|
50501
50523
|
}).passthrough();
|
|
50502
|
-
var MatcherSchema =
|
|
50524
|
+
var MatcherSchema = z4.discriminatedUnion("type", [
|
|
50503
50525
|
CommandRegexMatcherSchema,
|
|
50504
50526
|
ContentRegexMatcherSchema,
|
|
50505
50527
|
FileGlobMatcherSchema
|
|
50506
50528
|
]);
|
|
50507
|
-
var CheckSchema =
|
|
50529
|
+
var CheckSchema = z4.object({
|
|
50508
50530
|
matcher: MatcherSchema.optional(),
|
|
50509
|
-
script:
|
|
50510
|
-
message:
|
|
50531
|
+
script: z4.string().optional(),
|
|
50532
|
+
message: z4.string().optional()
|
|
50511
50533
|
}).passthrough();
|
|
50512
|
-
var BindingOutputSchema =
|
|
50513
|
-
target:
|
|
50514
|
-
template:
|
|
50515
|
-
inline_template:
|
|
50516
|
-
source:
|
|
50517
|
-
mode:
|
|
50518
|
-
format:
|
|
50519
|
-
patch_strategy:
|
|
50520
|
-
array_merge_key:
|
|
50521
|
-
group_by:
|
|
50522
|
-
executable:
|
|
50523
|
-
skip_empty:
|
|
50534
|
+
var BindingOutputSchema = z4.object({
|
|
50535
|
+
target: z4.string(),
|
|
50536
|
+
template: z4.string().optional(),
|
|
50537
|
+
inline_template: z4.string().optional(),
|
|
50538
|
+
source: z4.string().optional(),
|
|
50539
|
+
mode: z4.enum(["write", "patch"]).default("write"),
|
|
50540
|
+
format: z4.enum(["json", "yaml", "text"]).optional(),
|
|
50541
|
+
patch_strategy: z4.enum(["deep_merge", "append"]).optional(),
|
|
50542
|
+
array_merge_key: z4.string().optional(),
|
|
50543
|
+
group_by: z4.string().optional(),
|
|
50544
|
+
executable: z4.boolean().optional(),
|
|
50545
|
+
skip_empty: z4.boolean().optional()
|
|
50524
50546
|
}).passthrough().refine(
|
|
50525
50547
|
(data) => {
|
|
50526
50548
|
const count = [data.template, data.inline_template, data.source].filter(Boolean).length;
|
|
@@ -50528,225 +50550,253 @@ var BindingOutputSchema = z3.object({
|
|
|
50528
50550
|
},
|
|
50529
50551
|
{ message: "Only one of template, inline_template, or source may be specified" }
|
|
50530
50552
|
);
|
|
50531
|
-
var ReportingSchema =
|
|
50532
|
-
commands:
|
|
50533
|
-
fail_open:
|
|
50534
|
-
timeout_ms:
|
|
50553
|
+
var ReportingSchema = z4.object({
|
|
50554
|
+
commands: z4.record(z4.string(), z4.string()),
|
|
50555
|
+
fail_open: z4.boolean().default(true),
|
|
50556
|
+
timeout_ms: z4.number().default(5e3)
|
|
50535
50557
|
}).passthrough();
|
|
50536
|
-
var GuardrailImplSchema =
|
|
50537
|
-
checks:
|
|
50538
|
-
});
|
|
50539
|
-
var
|
|
50540
|
-
|
|
50541
|
-
|
|
50542
|
-
|
|
50543
|
-
|
|
50544
|
-
|
|
50558
|
+
var GuardrailImplSchema = z4.object({
|
|
50559
|
+
checks: z4.array(CheckSchema)
|
|
50560
|
+
});
|
|
50561
|
+
var BindingRenderTargetSchema = z4.object({
|
|
50562
|
+
template: z4.string().optional(),
|
|
50563
|
+
inline_template: z4.string().optional(),
|
|
50564
|
+
context: ContextTypeSchema,
|
|
50565
|
+
output: z4.string(),
|
|
50566
|
+
include: z4.array(z4.string()).optional(),
|
|
50567
|
+
exclude: z4.array(z4.string()).optional(),
|
|
50568
|
+
skip_empty: z4.boolean().optional(),
|
|
50569
|
+
executable: z4.boolean().optional()
|
|
50570
|
+
}).passthrough().refine(
|
|
50571
|
+
(data) => {
|
|
50572
|
+
const count = [data.template, data.inline_template].filter(Boolean).length;
|
|
50573
|
+
return count === 1;
|
|
50574
|
+
},
|
|
50575
|
+
{ message: "Exactly one of template or inline_template must be specified" }
|
|
50576
|
+
).refine(
|
|
50577
|
+
(data) => !(data.include && data.exclude),
|
|
50578
|
+
{ message: "include and exclude are mutually exclusive" }
|
|
50579
|
+
).refine(
|
|
50580
|
+
(data) => {
|
|
50581
|
+
if (data.context === "system" && (data.include || data.exclude)) {
|
|
50582
|
+
return false;
|
|
50583
|
+
}
|
|
50584
|
+
return true;
|
|
50585
|
+
},
|
|
50586
|
+
{ message: "include/exclude cannot be used with context: system" }
|
|
50587
|
+
);
|
|
50588
|
+
var SoftwareBindingSchema = z4.object({
|
|
50589
|
+
software: z4.string(),
|
|
50590
|
+
version: z4.literal(1),
|
|
50591
|
+
extends: z4.string().optional(),
|
|
50592
|
+
guardrail_impl: z4.record(z4.string(), GuardrailImplSchema).optional(),
|
|
50593
|
+
outputs: z4.record(z4.string(), BindingOutputSchema).optional(),
|
|
50594
|
+
renders: z4.array(BindingRenderTargetSchema).optional(),
|
|
50545
50595
|
reporting: ReportingSchema.optional()
|
|
50546
50596
|
}).passthrough();
|
|
50547
50597
|
|
|
50548
50598
|
// src/schema/dsl.ts
|
|
50549
|
-
import { z as
|
|
50599
|
+
import { z as z13 } from "zod";
|
|
50550
50600
|
|
|
50551
50601
|
// src/schema/handoff-type.ts
|
|
50552
|
-
import { z as
|
|
50553
|
-
var HandoffTypeSchema =
|
|
50554
|
-
version:
|
|
50555
|
-
description:
|
|
50556
|
-
schema:
|
|
50557
|
-
example:
|
|
50602
|
+
import { z as z5 } from "zod";
|
|
50603
|
+
var HandoffTypeSchema = z5.object({
|
|
50604
|
+
version: z5.number(),
|
|
50605
|
+
description: z5.string().optional(),
|
|
50606
|
+
schema: z5.record(z5.string(), z5.any()),
|
|
50607
|
+
example: z5.record(z5.string(), z5.any()).optional()
|
|
50558
50608
|
}).passthrough();
|
|
50559
50609
|
|
|
50560
50610
|
// src/schema/guardrail.ts
|
|
50561
|
-
import { z as
|
|
50562
|
-
var GuardrailScopeSchema =
|
|
50563
|
-
agents:
|
|
50564
|
-
tasks:
|
|
50565
|
-
tools:
|
|
50566
|
-
artifacts:
|
|
50567
|
-
workflows:
|
|
50611
|
+
import { z as z6 } from "zod";
|
|
50612
|
+
var GuardrailScopeSchema = z6.object({
|
|
50613
|
+
agents: z6.array(z6.string()).optional(),
|
|
50614
|
+
tasks: z6.array(z6.string()).optional(),
|
|
50615
|
+
tools: z6.array(z6.string()).optional(),
|
|
50616
|
+
artifacts: z6.array(z6.string()).optional(),
|
|
50617
|
+
workflows: z6.array(z6.string()).optional()
|
|
50568
50618
|
}).passthrough();
|
|
50569
|
-
var GuardrailSchema =
|
|
50570
|
-
description:
|
|
50619
|
+
var GuardrailSchema = z6.object({
|
|
50620
|
+
description: z6.string(),
|
|
50571
50621
|
scope: GuardrailScopeSchema,
|
|
50572
|
-
rationale:
|
|
50573
|
-
tags:
|
|
50574
|
-
exemptions:
|
|
50622
|
+
rationale: z6.string().optional(),
|
|
50623
|
+
tags: z6.array(z6.string()).default([]),
|
|
50624
|
+
exemptions: z6.array(z6.string()).optional()
|
|
50575
50625
|
}).passthrough();
|
|
50576
|
-
var GuardrailPolicyRuleEscalationSchema =
|
|
50577
|
-
target:
|
|
50578
|
-
condition:
|
|
50626
|
+
var GuardrailPolicyRuleEscalationSchema = z6.object({
|
|
50627
|
+
target: z6.string(),
|
|
50628
|
+
condition: z6.string().optional()
|
|
50579
50629
|
}).passthrough();
|
|
50580
|
-
var GuardrailPolicyRuleSchema =
|
|
50581
|
-
guardrail:
|
|
50582
|
-
severity:
|
|
50583
|
-
action:
|
|
50584
|
-
allow_override:
|
|
50585
|
-
override_requires:
|
|
50630
|
+
var GuardrailPolicyRuleSchema = z6.object({
|
|
50631
|
+
guardrail: z6.string(),
|
|
50632
|
+
severity: z6.enum(["critical", "mandatory", "warning", "info"]),
|
|
50633
|
+
action: z6.enum(["block", "warn", "shadow", "info"]),
|
|
50634
|
+
allow_override: z6.boolean().default(false),
|
|
50635
|
+
override_requires: z6.array(z6.string()).optional(),
|
|
50586
50636
|
escalation: GuardrailPolicyRuleEscalationSchema.optional()
|
|
50587
50637
|
}).passthrough();
|
|
50588
|
-
var GuardrailPolicySchema =
|
|
50589
|
-
description:
|
|
50590
|
-
rules:
|
|
50638
|
+
var GuardrailPolicySchema = z6.object({
|
|
50639
|
+
description: z6.string().optional(),
|
|
50640
|
+
rules: z6.array(GuardrailPolicyRuleSchema)
|
|
50591
50641
|
}).passthrough();
|
|
50592
50642
|
|
|
50593
50643
|
// src/schema/policy.ts
|
|
50594
|
-
import { z as
|
|
50595
|
-
var PolicyWhenSchema =
|
|
50596
|
-
artifact_type:
|
|
50597
|
-
workflow:
|
|
50644
|
+
import { z as z7 } from "zod";
|
|
50645
|
+
var PolicyWhenSchema = z7.object({
|
|
50646
|
+
artifact_type: z7.string().optional(),
|
|
50647
|
+
workflow: z7.string().optional()
|
|
50598
50648
|
}).passthrough();
|
|
50599
|
-
var PolicySchema =
|
|
50649
|
+
var PolicySchema = z7.object({
|
|
50600
50650
|
when: PolicyWhenSchema,
|
|
50601
|
-
requires_validations:
|
|
50602
|
-
requires:
|
|
50651
|
+
requires_validations: z7.array(z7.string()).optional(),
|
|
50652
|
+
requires: z7.array(z7.string()).optional()
|
|
50603
50653
|
}).passthrough();
|
|
50604
50654
|
|
|
50605
50655
|
// src/schema/system.ts
|
|
50606
|
-
import { z as z7 } from "zod";
|
|
50607
|
-
var VersionLiteralSchema = z7.literal(1);
|
|
50608
|
-
var ExtendsSchema = z7.string().optional();
|
|
50609
|
-
var SystemSchema = z7.object({
|
|
50610
|
-
id: z7.string(),
|
|
50611
|
-
name: z7.string(),
|
|
50612
|
-
default_workflow_order: z7.array(z7.string())
|
|
50613
|
-
}).passthrough();
|
|
50614
|
-
|
|
50615
|
-
// src/schema/task.ts
|
|
50616
50656
|
import { z as z8 } from "zod";
|
|
50617
|
-
var
|
|
50657
|
+
var VersionLiteralSchema = z8.literal(1);
|
|
50658
|
+
var ExtendsSchema = z8.string().optional();
|
|
50659
|
+
var SystemSchema = z8.object({
|
|
50618
50660
|
id: z8.string(),
|
|
50619
|
-
|
|
50620
|
-
|
|
50621
|
-
required: z8.boolean().optional(),
|
|
50622
|
-
abort_on_failure: z8.boolean().optional(),
|
|
50623
|
-
uses_tool: z8.string().optional(),
|
|
50624
|
-
produces_artifact: z8.string().optional(),
|
|
50625
|
-
reads_artifact: z8.string().optional(),
|
|
50626
|
-
depends_on: z8.array(z8.string()).optional(),
|
|
50627
|
-
skip_condition: z8.string().optional(),
|
|
50628
|
-
wait_for_approval: z8.boolean().optional()
|
|
50629
|
-
}).passthrough();
|
|
50630
|
-
var TaskSchema = z8.object({
|
|
50631
|
-
description: z8.string(),
|
|
50632
|
-
target_agent: z8.string(),
|
|
50633
|
-
allowed_from_agents: z8.array(z8.string()),
|
|
50634
|
-
workflow: z8.string(),
|
|
50635
|
-
input_artifacts: z8.array(z8.string()),
|
|
50636
|
-
invocation_handoff: z8.string(),
|
|
50637
|
-
result_handoff: z8.string(),
|
|
50638
|
-
default_priority: z8.string().optional(),
|
|
50639
|
-
responsibilities: z8.array(z8.string()).optional(),
|
|
50640
|
-
constraints: z8.array(z8.string()).optional(),
|
|
50641
|
-
execution_steps: z8.array(ExecutionStepSchema).optional(),
|
|
50642
|
-
completion_criteria: z8.array(z8.string()).optional(),
|
|
50643
|
-
rules: z8.array(RuleSchema).optional(),
|
|
50644
|
-
anti_patterns: z8.array(z8.string()).optional(),
|
|
50645
|
-
escalation_criteria: z8.array(EscalationCriterionSchema).optional(),
|
|
50646
|
-
validations: z8.array(z8.string()).default([]),
|
|
50647
|
-
guardrails: z8.array(z8.string()).optional()
|
|
50661
|
+
name: z8.string(),
|
|
50662
|
+
default_workflow_order: z8.array(z8.string())
|
|
50648
50663
|
}).passthrough();
|
|
50649
50664
|
|
|
50650
|
-
// src/schema/
|
|
50665
|
+
// src/schema/task.ts
|
|
50651
50666
|
import { z as z9 } from "zod";
|
|
50652
|
-
var
|
|
50653
|
-
|
|
50654
|
-
|
|
50655
|
-
reads: z9.array(z9.string()).default([]),
|
|
50656
|
-
writes: z9.array(z9.string()).default([]),
|
|
50657
|
-
purpose: z9.string().optional()
|
|
50658
|
-
});
|
|
50659
|
-
var ToolSchema = z9.object({
|
|
50660
|
-
kind: z9.string(),
|
|
50667
|
+
var ExecutionStepSchema = z9.object({
|
|
50668
|
+
id: z9.string(),
|
|
50669
|
+
action: z9.string(),
|
|
50661
50670
|
description: z9.string().optional(),
|
|
50662
|
-
|
|
50663
|
-
|
|
50664
|
-
|
|
50665
|
-
|
|
50666
|
-
|
|
50671
|
+
required: z9.boolean().optional(),
|
|
50672
|
+
abort_on_failure: z9.boolean().optional(),
|
|
50673
|
+
uses_tool: z9.string().optional(),
|
|
50674
|
+
produces_artifact: z9.string().optional(),
|
|
50675
|
+
reads_artifact: z9.string().optional(),
|
|
50676
|
+
depends_on: z9.array(z9.string()).optional(),
|
|
50677
|
+
skip_condition: z9.string().optional(),
|
|
50678
|
+
wait_for_approval: z9.boolean().optional()
|
|
50679
|
+
}).passthrough();
|
|
50680
|
+
var TaskSchema = z9.object({
|
|
50681
|
+
description: z9.string(),
|
|
50682
|
+
target_agent: z9.string(),
|
|
50683
|
+
allowed_from_agents: z9.array(z9.string()),
|
|
50684
|
+
workflow: z9.string(),
|
|
50685
|
+
input_artifacts: z9.array(z9.string()),
|
|
50686
|
+
invocation_handoff: z9.string(),
|
|
50687
|
+
result_handoff: z9.string(),
|
|
50688
|
+
default_priority: z9.string().optional(),
|
|
50689
|
+
responsibilities: z9.array(z9.string()).optional(),
|
|
50690
|
+
constraints: z9.array(z9.string()).optional(),
|
|
50691
|
+
execution_steps: z9.array(ExecutionStepSchema).optional(),
|
|
50692
|
+
completion_criteria: z9.array(z9.string()).optional(),
|
|
50693
|
+
rules: z9.array(RuleSchema).optional(),
|
|
50694
|
+
anti_patterns: z9.array(z9.string()).optional(),
|
|
50695
|
+
escalation_criteria: z9.array(EscalationCriterionSchema).optional(),
|
|
50696
|
+
validations: z9.array(z9.string()).default([]),
|
|
50667
50697
|
guardrails: z9.array(z9.string()).optional()
|
|
50668
50698
|
}).passthrough();
|
|
50669
50699
|
|
|
50670
|
-
// src/schema/
|
|
50700
|
+
// src/schema/tool.ts
|
|
50671
50701
|
import { z as z10 } from "zod";
|
|
50672
|
-
var
|
|
50673
|
-
|
|
50674
|
-
|
|
50675
|
-
|
|
50676
|
-
|
|
50677
|
-
|
|
50678
|
-
|
|
50702
|
+
var CommandSchema = z10.object({
|
|
50703
|
+
command: z10.string(),
|
|
50704
|
+
category: z10.string(),
|
|
50705
|
+
reads: z10.array(z10.string()).default([]),
|
|
50706
|
+
writes: z10.array(z10.string()).default([]),
|
|
50707
|
+
purpose: z10.string().optional()
|
|
50708
|
+
});
|
|
50709
|
+
var ToolSchema = z10.object({
|
|
50710
|
+
kind: z10.string(),
|
|
50711
|
+
description: z10.string().optional(),
|
|
50712
|
+
input_artifacts: z10.array(z10.string()).default([]),
|
|
50713
|
+
output_artifacts: z10.array(z10.string()).default([]),
|
|
50714
|
+
invokable_by: z10.array(z10.string()),
|
|
50715
|
+
side_effects: z10.array(z10.string()).default([]),
|
|
50716
|
+
commands: z10.array(CommandSchema).default([]),
|
|
50717
|
+
guardrails: z10.array(z10.string()).optional()
|
|
50679
50718
|
}).passthrough();
|
|
50680
50719
|
|
|
50681
|
-
// src/schema/
|
|
50720
|
+
// src/schema/validation.ts
|
|
50682
50721
|
import { z as z11 } from "zod";
|
|
50683
|
-
var
|
|
50684
|
-
|
|
50685
|
-
|
|
50686
|
-
|
|
50687
|
-
|
|
50688
|
-
|
|
50689
|
-
|
|
50690
|
-
|
|
50691
|
-
|
|
50692
|
-
|
|
50693
|
-
}
|
|
50694
|
-
var
|
|
50695
|
-
|
|
50696
|
-
|
|
50697
|
-
|
|
50698
|
-
|
|
50699
|
-
|
|
50722
|
+
var ValidationSchema = z11.object({
|
|
50723
|
+
target_artifact: z11.string(),
|
|
50724
|
+
kind: z11.enum(["schema", "mechanical", "semantic", "approval", "provenance", "traceability", "fidelity"]),
|
|
50725
|
+
executor_type: z11.enum(["tool", "agent"]),
|
|
50726
|
+
executor: z11.string(),
|
|
50727
|
+
blocking: z11.boolean(),
|
|
50728
|
+
produces_evidence: z11.string().optional()
|
|
50729
|
+
}).passthrough();
|
|
50730
|
+
|
|
50731
|
+
// src/schema/workflow.ts
|
|
50732
|
+
import { z as z12 } from "zod";
|
|
50733
|
+
var RetrySchema = z12.object({
|
|
50734
|
+
condition: z12.string(),
|
|
50735
|
+
fix_task: z12.string(),
|
|
50736
|
+
revalidate_task: z12.string().optional()
|
|
50737
|
+
});
|
|
50738
|
+
var ExternalParticipantSchema = z12.object({
|
|
50739
|
+
id: z12.string(),
|
|
50740
|
+
kind: z12.enum(["actor", "participant"]),
|
|
50741
|
+
label: z12.string(),
|
|
50742
|
+
description: z12.string().optional()
|
|
50743
|
+
});
|
|
50744
|
+
var WorkflowDelegateStepSchema = z12.object({
|
|
50745
|
+
type: z12.literal("delegate"),
|
|
50746
|
+
description: z12.string().optional(),
|
|
50747
|
+
task: z12.string(),
|
|
50748
|
+
from_agent: z12.string(),
|
|
50749
|
+
group: z12.string().optional(),
|
|
50700
50750
|
retry: RetrySchema.optional()
|
|
50701
50751
|
}).passthrough();
|
|
50702
|
-
var WorkflowGateStepSchema =
|
|
50703
|
-
type:
|
|
50704
|
-
description:
|
|
50705
|
-
gate_kind:
|
|
50706
|
-
group:
|
|
50752
|
+
var WorkflowGateStepSchema = z12.object({
|
|
50753
|
+
type: z12.literal("gate"),
|
|
50754
|
+
description: z12.string().optional(),
|
|
50755
|
+
gate_kind: z12.string(),
|
|
50756
|
+
group: z12.string().optional()
|
|
50707
50757
|
}).passthrough();
|
|
50708
|
-
var WorkflowHandoffStepSchema =
|
|
50709
|
-
type:
|
|
50710
|
-
description:
|
|
50711
|
-
handoff_kind:
|
|
50712
|
-
task:
|
|
50713
|
-
from_agent:
|
|
50714
|
-
group:
|
|
50758
|
+
var WorkflowHandoffStepSchema = z12.object({
|
|
50759
|
+
type: z12.literal("handoff"),
|
|
50760
|
+
description: z12.string().optional(),
|
|
50761
|
+
handoff_kind: z12.string(),
|
|
50762
|
+
task: z12.string().optional(),
|
|
50763
|
+
from_agent: z12.string().optional(),
|
|
50764
|
+
group: z12.string().optional(),
|
|
50715
50765
|
retry: RetrySchema.optional()
|
|
50716
50766
|
}).passthrough();
|
|
50717
|
-
var WorkflowValidationStepSchema =
|
|
50718
|
-
type:
|
|
50719
|
-
description:
|
|
50720
|
-
validation:
|
|
50721
|
-
group:
|
|
50767
|
+
var WorkflowValidationStepSchema = z12.object({
|
|
50768
|
+
type: z12.literal("validation"),
|
|
50769
|
+
description: z12.string().optional(),
|
|
50770
|
+
validation: z12.string(),
|
|
50771
|
+
group: z12.string().optional()
|
|
50722
50772
|
}).passthrough();
|
|
50723
|
-
var WorkflowDecisionStepSchema =
|
|
50724
|
-
type:
|
|
50725
|
-
description:
|
|
50773
|
+
var WorkflowDecisionStepSchema = z12.object({
|
|
50774
|
+
type: z12.literal("decision"),
|
|
50775
|
+
description: z12.string().optional(),
|
|
50726
50776
|
/** @deprecated Use `routing_key` instead. `on` is kept for backward compatibility. */
|
|
50727
|
-
on:
|
|
50728
|
-
routing_key:
|
|
50729
|
-
branches:
|
|
50730
|
-
group:
|
|
50777
|
+
on: z12.string().optional(),
|
|
50778
|
+
routing_key: z12.string().optional(),
|
|
50779
|
+
branches: z12.record(z12.string(), z12.array(z12.string())),
|
|
50780
|
+
group: z12.string().optional()
|
|
50731
50781
|
}).passthrough();
|
|
50732
|
-
var WorkflowStepSchema =
|
|
50782
|
+
var WorkflowStepSchema = z12.discriminatedUnion("type", [
|
|
50733
50783
|
WorkflowDelegateStepSchema,
|
|
50734
50784
|
WorkflowGateStepSchema,
|
|
50735
50785
|
WorkflowHandoffStepSchema,
|
|
50736
50786
|
WorkflowValidationStepSchema,
|
|
50737
50787
|
WorkflowDecisionStepSchema
|
|
50738
50788
|
]);
|
|
50739
|
-
var WorkflowSchema =
|
|
50740
|
-
description:
|
|
50741
|
-
entry_conditions:
|
|
50742
|
-
trigger:
|
|
50743
|
-
steps:
|
|
50744
|
-
external_participants:
|
|
50789
|
+
var WorkflowSchema = z12.object({
|
|
50790
|
+
description: z12.string().optional(),
|
|
50791
|
+
entry_conditions: z12.array(z12.string()).default([]),
|
|
50792
|
+
trigger: z12.string().optional(),
|
|
50793
|
+
steps: z12.array(WorkflowStepSchema),
|
|
50794
|
+
external_participants: z12.array(ExternalParticipantSchema).default([])
|
|
50745
50795
|
}).passthrough();
|
|
50746
50796
|
|
|
50747
50797
|
// src/schema/dsl.ts
|
|
50748
|
-
var ComponentsSchema =
|
|
50749
|
-
schemas:
|
|
50798
|
+
var ComponentsSchema = z13.object({
|
|
50799
|
+
schemas: z13.record(z13.string(), z13.record(z13.string(), z13.any())).default({})
|
|
50750
50800
|
}).passthrough();
|
|
50751
50801
|
var SCOPE_NODE_TYPES = [
|
|
50752
50802
|
"root",
|
|
@@ -50768,32 +50818,32 @@ var SCOPE_NODE_TYPES = [
|
|
|
50768
50818
|
"escalation_criterion",
|
|
50769
50819
|
"prerequisite"
|
|
50770
50820
|
];
|
|
50771
|
-
var ScopeNodeTypeSchema =
|
|
50772
|
-
var XExtensionDeclSchema =
|
|
50773
|
-
type:
|
|
50774
|
-
items:
|
|
50775
|
-
description:
|
|
50776
|
-
scope:
|
|
50777
|
-
schema:
|
|
50778
|
-
required:
|
|
50779
|
-
});
|
|
50780
|
-
var DslSchema =
|
|
50781
|
-
version:
|
|
50782
|
-
extends:
|
|
50821
|
+
var ScopeNodeTypeSchema = z13.enum(SCOPE_NODE_TYPES);
|
|
50822
|
+
var XExtensionDeclSchema = z13.object({
|
|
50823
|
+
type: z13.string(),
|
|
50824
|
+
items: z13.string().optional(),
|
|
50825
|
+
description: z13.string().optional(),
|
|
50826
|
+
scope: z13.array(ScopeNodeTypeSchema).optional(),
|
|
50827
|
+
schema: z13.record(z13.string(), z13.any()).optional(),
|
|
50828
|
+
required: z13.boolean().default(false)
|
|
50829
|
+
});
|
|
50830
|
+
var DslSchema = z13.object({
|
|
50831
|
+
version: z13.literal(1),
|
|
50832
|
+
extends: z13.string().optional(),
|
|
50783
50833
|
system: SystemSchema,
|
|
50784
|
-
agents:
|
|
50785
|
-
tasks:
|
|
50786
|
-
artifacts:
|
|
50787
|
-
tools:
|
|
50788
|
-
validations:
|
|
50789
|
-
handoff_types:
|
|
50790
|
-
workflow:
|
|
50791
|
-
policies:
|
|
50792
|
-
guardrails:
|
|
50793
|
-
guardrail_policies:
|
|
50834
|
+
agents: z13.record(z13.string(), AgentSchema).default({}),
|
|
50835
|
+
tasks: z13.record(z13.string(), TaskSchema).default({}),
|
|
50836
|
+
artifacts: z13.record(z13.string(), ArtifactSchema).default({}),
|
|
50837
|
+
tools: z13.record(z13.string(), ToolSchema).default({}),
|
|
50838
|
+
validations: z13.record(z13.string(), ValidationSchema).default({}),
|
|
50839
|
+
handoff_types: z13.record(z13.string(), HandoffTypeSchema).default({}),
|
|
50840
|
+
workflow: z13.record(z13.string(), WorkflowSchema).default({}),
|
|
50841
|
+
policies: z13.record(z13.string(), PolicySchema).default({}),
|
|
50842
|
+
guardrails: z13.record(z13.string(), GuardrailSchema).default({}),
|
|
50843
|
+
guardrail_policies: z13.record(z13.string(), GuardrailPolicySchema).default({}),
|
|
50794
50844
|
components: ComponentsSchema.default({ schemas: {} }),
|
|
50795
|
-
extensions:
|
|
50796
|
-
extensions_strict:
|
|
50845
|
+
extensions: z13.record(z13.string(), XExtensionDeclSchema).default({}),
|
|
50846
|
+
extensions_strict: z13.boolean().default(false)
|
|
50797
50847
|
}).passthrough();
|
|
50798
50848
|
|
|
50799
50849
|
// src/schema/json-schema-utils.ts
|
|
@@ -50845,22 +50895,22 @@ function resolveAllOf(schema) {
|
|
|
50845
50895
|
}
|
|
50846
50896
|
|
|
50847
50897
|
// src/schema/merge-operators.ts
|
|
50848
|
-
import { z as
|
|
50849
|
-
var AppendOperatorSchema =
|
|
50850
|
-
$append:
|
|
50898
|
+
import { z as z14 } from "zod";
|
|
50899
|
+
var AppendOperatorSchema = z14.object({
|
|
50900
|
+
$append: z14.record(z14.string(), z14.any())
|
|
50851
50901
|
});
|
|
50852
|
-
var PrependOperatorSchema =
|
|
50853
|
-
$prepend:
|
|
50902
|
+
var PrependOperatorSchema = z14.object({
|
|
50903
|
+
$prepend: z14.record(z14.string(), z14.any())
|
|
50854
50904
|
});
|
|
50855
|
-
var InsertAfterOperatorSchema =
|
|
50856
|
-
$insert_after:
|
|
50857
|
-
after:
|
|
50858
|
-
entries:
|
|
50905
|
+
var InsertAfterOperatorSchema = z14.object({
|
|
50906
|
+
$insert_after: z14.object({
|
|
50907
|
+
after: z14.string(),
|
|
50908
|
+
entries: z14.record(z14.string(), z14.any())
|
|
50859
50909
|
})
|
|
50860
50910
|
});
|
|
50861
|
-
var ReplaceOperatorSchema =
|
|
50862
|
-
var RemoveOperatorSchema =
|
|
50863
|
-
$remove:
|
|
50911
|
+
var ReplaceOperatorSchema = z14.object({ $replace: z14.any() });
|
|
50912
|
+
var RemoveOperatorSchema = z14.object({
|
|
50913
|
+
$remove: z14.array(z14.string())
|
|
50864
50914
|
});
|
|
50865
50915
|
|
|
50866
50916
|
// src/loader/loader.ts
|
|
@@ -51476,16 +51526,16 @@ function expandDefaults(data) {
|
|
|
51476
51526
|
|
|
51477
51527
|
// src/validator/schema-validator.ts
|
|
51478
51528
|
import Ajv from "ajv";
|
|
51479
|
-
import { z as
|
|
51529
|
+
import { z as z15 } from "zod";
|
|
51480
51530
|
function unwrap(schema) {
|
|
51481
|
-
if (schema instanceof
|
|
51482
|
-
if (schema instanceof
|
|
51483
|
-
if (schema instanceof
|
|
51531
|
+
if (schema instanceof z15.ZodOptional) return unwrap(schema.unwrap());
|
|
51532
|
+
if (schema instanceof z15.ZodDefault) return unwrap(schema.removeDefault());
|
|
51533
|
+
if (schema instanceof z15.ZodNullable) return unwrap(schema.unwrap());
|
|
51484
51534
|
return schema;
|
|
51485
51535
|
}
|
|
51486
51536
|
function checkCustomPropsRecursive(data, schema, path) {
|
|
51487
51537
|
const inner = unwrap(schema);
|
|
51488
|
-
if (inner instanceof
|
|
51538
|
+
if (inner instanceof z15.ZodObject) {
|
|
51489
51539
|
if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
|
|
51490
51540
|
const obj = data;
|
|
51491
51541
|
const shape = inner.shape;
|
|
@@ -51506,7 +51556,7 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
51506
51556
|
}
|
|
51507
51557
|
return diagnostics;
|
|
51508
51558
|
}
|
|
51509
|
-
if (inner instanceof
|
|
51559
|
+
if (inner instanceof z15.ZodRecord) {
|
|
51510
51560
|
if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
|
|
51511
51561
|
const valueSchema = inner._def.valueType;
|
|
51512
51562
|
const diagnostics = [];
|
|
@@ -51515,7 +51565,7 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
51515
51565
|
}
|
|
51516
51566
|
return diagnostics;
|
|
51517
51567
|
}
|
|
51518
|
-
if (inner instanceof
|
|
51568
|
+
if (inner instanceof z15.ZodArray) {
|
|
51519
51569
|
if (!Array.isArray(data)) return [];
|
|
51520
51570
|
const diagnostics = [];
|
|
51521
51571
|
for (let i3 = 0; i3 < data.length; i3++) {
|
|
@@ -51523,14 +51573,14 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
51523
51573
|
}
|
|
51524
51574
|
return diagnostics;
|
|
51525
51575
|
}
|
|
51526
|
-
if (inner instanceof
|
|
51576
|
+
if (inner instanceof z15.ZodDiscriminatedUnion) {
|
|
51527
51577
|
if (typeof data !== "object" || data === null) return [];
|
|
51528
51578
|
const obj = data;
|
|
51529
51579
|
const disc = inner._def.discriminator;
|
|
51530
51580
|
const discValue = obj[disc];
|
|
51531
51581
|
const match = inner.options.find((opt) => {
|
|
51532
51582
|
const shape = opt.shape;
|
|
51533
|
-
return shape[disc] instanceof
|
|
51583
|
+
return shape[disc] instanceof z15.ZodLiteral && shape[disc].value === discValue;
|
|
51534
51584
|
});
|
|
51535
51585
|
if (match) return checkCustomPropsRecursive(data, match, path);
|
|
51536
51586
|
return [];
|
|
@@ -55339,31 +55389,14 @@ import { resolve as resolve4, dirname as dirname4 } from "path";
|
|
|
55339
55389
|
import { parse as parseYaml2 } from "yaml";
|
|
55340
55390
|
|
|
55341
55391
|
// src/config/types.ts
|
|
55342
|
-
import { z as
|
|
55343
|
-
var
|
|
55344
|
-
|
|
55345
|
-
"task",
|
|
55346
|
-
"artifact",
|
|
55347
|
-
"tool",
|
|
55348
|
-
"validation",
|
|
55349
|
-
"handoff_type",
|
|
55350
|
-
"workflow",
|
|
55351
|
-
"policy",
|
|
55352
|
-
"guardrail",
|
|
55353
|
-
"guardrail_policy",
|
|
55354
|
-
"system"
|
|
55355
|
-
];
|
|
55356
|
-
var ContextTypeSchema = z16.enum(CONTEXT_TYPES);
|
|
55357
|
-
var ITERABLE_CONTEXT_TYPES = CONTEXT_TYPES.filter(
|
|
55358
|
-
(t3) => t3 !== "system"
|
|
55359
|
-
);
|
|
55360
|
-
var RenderTargetSchema = z16.object({
|
|
55361
|
-
template: z16.string(),
|
|
55392
|
+
import { z as z17 } from "zod";
|
|
55393
|
+
var RenderTargetSchema = z17.object({
|
|
55394
|
+
template: z17.string(),
|
|
55362
55395
|
context: ContextTypeSchema,
|
|
55363
|
-
output:
|
|
55364
|
-
include:
|
|
55365
|
-
exclude:
|
|
55366
|
-
skip_empty:
|
|
55396
|
+
output: z17.string(),
|
|
55397
|
+
include: z17.array(z17.string()).optional(),
|
|
55398
|
+
exclude: z17.array(z17.string()).optional(),
|
|
55399
|
+
skip_empty: z17.boolean().optional()
|
|
55367
55400
|
}).refine(
|
|
55368
55401
|
(data) => !(data.include && data.exclude),
|
|
55369
55402
|
{ message: "include and exclude are mutually exclusive" }
|
|
@@ -55376,13 +55409,13 @@ var RenderTargetSchema = z16.object({
|
|
|
55376
55409
|
},
|
|
55377
55410
|
{ message: "include/exclude cannot be used with context: system" }
|
|
55378
55411
|
);
|
|
55379
|
-
var AgentContractsConfigSchema =
|
|
55380
|
-
dsl:
|
|
55381
|
-
vars:
|
|
55382
|
-
renders:
|
|
55383
|
-
bindings:
|
|
55384
|
-
active_guardrail_policy:
|
|
55385
|
-
paths:
|
|
55412
|
+
var AgentContractsConfigSchema = z17.object({
|
|
55413
|
+
dsl: z17.string(),
|
|
55414
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
55415
|
+
renders: z17.array(RenderTargetSchema).default([]),
|
|
55416
|
+
bindings: z17.array(z17.string()).default([]),
|
|
55417
|
+
active_guardrail_policy: z17.string().optional(),
|
|
55418
|
+
paths: z17.record(z17.string(), z17.string()).optional()
|
|
55386
55419
|
});
|
|
55387
55420
|
|
|
55388
55421
|
// src/config/loader.ts
|
|
@@ -55473,11 +55506,12 @@ function resolveDslPath(dirArg, dirArgDefault, config) {
|
|
|
55473
55506
|
function isRecord4(v2) {
|
|
55474
55507
|
return typeof v2 === "object" && v2 !== null && !Array.isArray(v2);
|
|
55475
55508
|
}
|
|
55476
|
-
var
|
|
55509
|
+
var BINDING_MAP_MERGE_SECTIONS = ["guardrail_impl", "outputs"];
|
|
55510
|
+
var BINDING_ARRAY_MERGE_SECTIONS = ["renders"];
|
|
55477
55511
|
function mergeBinding(base, project) {
|
|
55478
55512
|
const hasExtends = typeof project["extends"] === "string";
|
|
55479
55513
|
const result = { ...base, ...project };
|
|
55480
|
-
for (const section of
|
|
55514
|
+
for (const section of BINDING_MAP_MERGE_SECTIONS) {
|
|
55481
55515
|
const baseVal = base[section];
|
|
55482
55516
|
const projVal = project[section];
|
|
55483
55517
|
if (projVal === void 0) {
|
|
@@ -55491,6 +55525,14 @@ function mergeBinding(base, project) {
|
|
|
55491
55525
|
hasExtends
|
|
55492
55526
|
);
|
|
55493
55527
|
}
|
|
55528
|
+
for (const section of BINDING_ARRAY_MERGE_SECTIONS) {
|
|
55529
|
+
const baseVal = base[section];
|
|
55530
|
+
const projVal = project[section];
|
|
55531
|
+
if (projVal === void 0) continue;
|
|
55532
|
+
const baseArr = Array.isArray(baseVal) ? baseVal : [];
|
|
55533
|
+
const projArr = Array.isArray(projVal) ? projVal : [];
|
|
55534
|
+
result[section] = [...baseArr, ...projArr];
|
|
55535
|
+
}
|
|
55494
55536
|
if (project["reporting"] !== void 0 && isRecord4(base["reporting"]) && isRecord4(project["reporting"])) {
|
|
55495
55537
|
result["reporting"] = deepMergeEntities(
|
|
55496
55538
|
base["reporting"],
|
|
@@ -56113,7 +56155,7 @@ async function generateGuardrails(options) {
|
|
|
56113
56155
|
if (filterBindings && !filterBindings.includes(binding.software)) {
|
|
56114
56156
|
continue;
|
|
56115
56157
|
}
|
|
56116
|
-
if (!binding.outputs) continue;
|
|
56158
|
+
if (!binding.outputs && !binding.renders) continue;
|
|
56117
56159
|
const checkResult = resolveChecks(dsl, binding, policy);
|
|
56118
56160
|
diagnostics.push(...checkResult.diagnostics);
|
|
56119
56161
|
const ctx = {
|
|
@@ -56125,9 +56167,14 @@ async function generateGuardrails(options) {
|
|
|
56125
56167
|
vars,
|
|
56126
56168
|
paths,
|
|
56127
56169
|
reporting,
|
|
56128
|
-
resolved_checks: checkResult.resolved
|
|
56129
|
-
|
|
56130
|
-
|
|
56170
|
+
resolved_checks: checkResult.resolved,
|
|
56171
|
+
tasks: dsl.tasks,
|
|
56172
|
+
artifacts: dsl.artifacts,
|
|
56173
|
+
agents: dsl.agents,
|
|
56174
|
+
handoff_types: dsl.handoff_types,
|
|
56175
|
+
workflow: dsl.workflow
|
|
56176
|
+
};
|
|
56177
|
+
for (const [outputId, outputDef] of Object.entries(binding.outputs ?? {})) {
|
|
56131
56178
|
const pathResult = resolveBindingTargetPath(
|
|
56132
56179
|
outputDef.target,
|
|
56133
56180
|
paths,
|
|
@@ -56257,9 +56304,98 @@ async function generateGuardrails(options) {
|
|
|
56257
56304
|
}
|
|
56258
56305
|
}
|
|
56259
56306
|
}
|
|
56307
|
+
for (const renderTarget of binding.renders ?? []) {
|
|
56308
|
+
let templateContent;
|
|
56309
|
+
if (renderTarget.inline_template) {
|
|
56310
|
+
templateContent = renderTarget.inline_template;
|
|
56311
|
+
} else if (renderTarget.template) {
|
|
56312
|
+
const templatePath = resolve6(config.configDir, renderTarget.template);
|
|
56313
|
+
try {
|
|
56314
|
+
templateContent = await readFile5(templatePath, "utf8");
|
|
56315
|
+
} catch {
|
|
56316
|
+
diagnostics.push({
|
|
56317
|
+
path: `binding.${binding.software}.renders`,
|
|
56318
|
+
message: `Template file not found: ${templatePath}`,
|
|
56319
|
+
severity: "error"
|
|
56320
|
+
});
|
|
56321
|
+
continue;
|
|
56322
|
+
}
|
|
56323
|
+
} else {
|
|
56324
|
+
diagnostics.push({
|
|
56325
|
+
path: `binding.${binding.software}.renders`,
|
|
56326
|
+
message: "Render target has neither template nor inline_template",
|
|
56327
|
+
severity: "error"
|
|
56328
|
+
});
|
|
56329
|
+
continue;
|
|
56330
|
+
}
|
|
56331
|
+
const compiled = Handlebars2.compile(templateContent, { noEscape: true });
|
|
56332
|
+
const shouldSkipEmpty = renderTarget.skip_empty === true;
|
|
56333
|
+
const context = renderTarget.context;
|
|
56334
|
+
if (context === "system") {
|
|
56335
|
+
const sysCtx = buildSystemContext(dsl);
|
|
56336
|
+
const mergedCtx = { ...sysCtx, vars, paths, binding, resolved_checks: checkResult.resolved };
|
|
56337
|
+
const rendered = compiled(mergedCtx);
|
|
56338
|
+
const resolvedOutput = resolveBindingRenderOutputPath(renderTarget.output, paths);
|
|
56339
|
+
const outputPath = resolve6(config.configDir, resolvedOutput);
|
|
56340
|
+
if (shouldSkipEmpty && rendered.trim().length === 0) {
|
|
56341
|
+
if (!dryRun) {
|
|
56342
|
+
try {
|
|
56343
|
+
await unlink2(outputPath);
|
|
56344
|
+
} catch {
|
|
56345
|
+
}
|
|
56346
|
+
}
|
|
56347
|
+
continue;
|
|
56348
|
+
}
|
|
56349
|
+
if (!dryRun) {
|
|
56350
|
+
await mkdir2(dirname6(outputPath), { recursive: true });
|
|
56351
|
+
await writeFile2(outputPath, rendered, "utf8");
|
|
56352
|
+
if (renderTarget.executable) {
|
|
56353
|
+
await chmod(outputPath, 493);
|
|
56354
|
+
}
|
|
56355
|
+
}
|
|
56356
|
+
outputFiles.push(outputPath);
|
|
56357
|
+
} else {
|
|
56358
|
+
const section = getDslSection(dsl, context);
|
|
56359
|
+
const allIds = Object.keys(section);
|
|
56360
|
+
const ids = filterIds(allIds, renderTarget.include, renderTarget.exclude);
|
|
56361
|
+
for (const entityId of ids) {
|
|
56362
|
+
const entityCtx = buildEntityContext(dsl, context, entityId);
|
|
56363
|
+
const mergedCtx = { ...entityCtx, vars, paths, binding, resolved_checks: checkResult.resolved };
|
|
56364
|
+
const rendered = compiled(mergedCtx);
|
|
56365
|
+
const resolvedOutput = resolveBindingRenderOutputPath(
|
|
56366
|
+
expandOutputPath(renderTarget.output, context, entityId),
|
|
56367
|
+
paths
|
|
56368
|
+
);
|
|
56369
|
+
const outputPath = resolve6(config.configDir, resolvedOutput);
|
|
56370
|
+
if (shouldSkipEmpty && rendered.trim().length === 0) {
|
|
56371
|
+
if (!dryRun) {
|
|
56372
|
+
try {
|
|
56373
|
+
await unlink2(outputPath);
|
|
56374
|
+
} catch {
|
|
56375
|
+
}
|
|
56376
|
+
}
|
|
56377
|
+
continue;
|
|
56378
|
+
}
|
|
56379
|
+
if (!dryRun) {
|
|
56380
|
+
await mkdir2(dirname6(outputPath), { recursive: true });
|
|
56381
|
+
await writeFile2(outputPath, rendered, "utf8");
|
|
56382
|
+
if (renderTarget.executable) {
|
|
56383
|
+
await chmod(outputPath, 493);
|
|
56384
|
+
}
|
|
56385
|
+
}
|
|
56386
|
+
outputFiles.push(outputPath);
|
|
56387
|
+
}
|
|
56388
|
+
}
|
|
56389
|
+
}
|
|
56260
56390
|
}
|
|
56261
56391
|
return { outputFiles, diagnostics };
|
|
56262
56392
|
}
|
|
56393
|
+
function resolveBindingRenderOutputPath(output, paths) {
|
|
56394
|
+
return output.replace(/\{(\w+)\}/g, (match, varName) => {
|
|
56395
|
+
const value = paths[varName];
|
|
56396
|
+
return value !== void 0 ? value : match;
|
|
56397
|
+
});
|
|
56398
|
+
}
|
|
56263
56399
|
export {
|
|
56264
56400
|
AgentContractsConfigSchema,
|
|
56265
56401
|
AgentSchema,
|
|
@@ -56267,6 +56403,7 @@ export {
|
|
|
56267
56403
|
ArtifactSchema,
|
|
56268
56404
|
BaseResolveError,
|
|
56269
56405
|
BindingOutputSchema,
|
|
56406
|
+
BindingRenderTargetSchema,
|
|
56270
56407
|
CONTEXT_TYPES,
|
|
56271
56408
|
CheckSchema,
|
|
56272
56409
|
CommandSchema,
|
|
@@ -56284,6 +56421,7 @@ export {
|
|
|
56284
56421
|
GuardrailSchema,
|
|
56285
56422
|
GuardrailScopeSchema,
|
|
56286
56423
|
HandoffTypeSchema,
|
|
56424
|
+
ITERABLE_CONTEXT_TYPES,
|
|
56287
56425
|
InsertAfterOperatorSchema,
|
|
56288
56426
|
MatcherSchema,
|
|
56289
56427
|
MergeError,
|