agent-contracts 0.15.0 → 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/README.md +121 -1
- package/dist/cli.js +499 -232
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +76 -1
- package/dist/index.js +264 -160
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -159,11 +159,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
159
159
|
}
|
|
160
160
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
161
161
|
function adopt(value) {
|
|
162
|
-
return value instanceof P2 ? value : new P2(function(
|
|
163
|
-
|
|
162
|
+
return value instanceof P2 ? value : new P2(function(resolve9) {
|
|
163
|
+
resolve9(value);
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
return new (P2 || (P2 = Promise))(function(
|
|
166
|
+
return new (P2 || (P2 = Promise))(function(resolve9, reject) {
|
|
167
167
|
function fulfilled(value) {
|
|
168
168
|
try {
|
|
169
169
|
step(generator.next(value));
|
|
@@ -179,7 +179,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
function step(result) {
|
|
182
|
-
result.done ?
|
|
182
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
183
183
|
}
|
|
184
184
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
185
185
|
});
|
|
@@ -370,14 +370,14 @@ function __asyncValues(o3) {
|
|
|
370
370
|
}, i3);
|
|
371
371
|
function verb(n3) {
|
|
372
372
|
i3[n3] = o3[n3] && function(v2) {
|
|
373
|
-
return new Promise(function(
|
|
374
|
-
v2 = o3[n3](v2), settle(
|
|
373
|
+
return new Promise(function(resolve9, reject) {
|
|
374
|
+
v2 = o3[n3](v2), settle(resolve9, reject, v2.done, v2.value);
|
|
375
375
|
});
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
|
-
function settle(
|
|
378
|
+
function settle(resolve9, reject, d2, v2) {
|
|
379
379
|
Promise.resolve(v2).then(function(v3) {
|
|
380
|
-
|
|
380
|
+
resolve9({ value: v3, done: d2 });
|
|
381
381
|
}, reject);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -3952,7 +3952,7 @@ var require_lodash = __commonJS({
|
|
|
3952
3952
|
}
|
|
3953
3953
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
3954
3954
|
});
|
|
3955
|
-
function
|
|
3955
|
+
function join4(array, separator) {
|
|
3956
3956
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
3957
3957
|
}
|
|
3958
3958
|
function last(array) {
|
|
@@ -5876,7 +5876,7 @@ var require_lodash = __commonJS({
|
|
|
5876
5876
|
lodash.isUndefined = isUndefined;
|
|
5877
5877
|
lodash.isWeakMap = isWeakMap;
|
|
5878
5878
|
lodash.isWeakSet = isWeakSet;
|
|
5879
|
-
lodash.join =
|
|
5879
|
+
lodash.join = join4;
|
|
5880
5880
|
lodash.kebabCase = kebabCase;
|
|
5881
5881
|
lodash.last = last;
|
|
5882
5882
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -6293,7 +6293,7 @@ var init_index_es = __esm({
|
|
|
6293
6293
|
return { drive: t4.toLowerCase() + ":" };
|
|
6294
6294
|
}, k2 = function() {
|
|
6295
6295
|
return { drive: null };
|
|
6296
|
-
},
|
|
6296
|
+
}, z20 = function() {
|
|
6297
6297
|
return { drive: null };
|
|
6298
6298
|
}, B2 = function(t4) {
|
|
6299
6299
|
return { protocol: null, origin: null, absolute: false, drive: null, ...t4 };
|
|
@@ -6334,7 +6334,7 @@ var init_index_es = __esm({
|
|
|
6334
6334
|
var t4, n4, r4, e4, o4;
|
|
6335
6335
|
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() {
|
|
6336
6336
|
var t5;
|
|
6337
|
-
return (t5 = x3) !== c2 && (t5 =
|
|
6337
|
+
return (t5 = x3) !== c2 && (t5 = z20()), t5;
|
|
6338
6338
|
})()) !== c2 ? (n4 = f2(n4, r4, e4), t4 = n4) : (K2 = t4, t4 = c2)), t4;
|
|
6339
6339
|
})()) === c2 && (n3 = (function() {
|
|
6340
6340
|
var n4, r4, e4, o4;
|
|
@@ -7367,7 +7367,7 @@ var init_dist = __esm({
|
|
|
7367
7367
|
var require_stable = __commonJS({
|
|
7368
7368
|
"node_modules/safe-stable-stringify/stable.js"(exports, module) {
|
|
7369
7369
|
"use strict";
|
|
7370
|
-
module.exports =
|
|
7370
|
+
module.exports = stringify4;
|
|
7371
7371
|
var indentation = "";
|
|
7372
7372
|
var strEscapeSequencesRegExp = /[\x00-\x1f\x22\x5c]/;
|
|
7373
7373
|
var strEscapeSequencesReplacer = /[\x00-\x1f\x22\x5c]/g;
|
|
@@ -7497,7 +7497,7 @@ var require_stable = __commonJS({
|
|
|
7497
7497
|
return result;
|
|
7498
7498
|
}
|
|
7499
7499
|
function stringifyFullFn(key, parent, stack, replacer, indent) {
|
|
7500
|
-
var i3, res,
|
|
7500
|
+
var i3, res, join4;
|
|
7501
7501
|
const originalIndentation = indentation;
|
|
7502
7502
|
var value = parent[key];
|
|
7503
7503
|
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
@@ -7523,12 +7523,12 @@ var require_stable = __commonJS({
|
|
|
7523
7523
|
indentation += indent;
|
|
7524
7524
|
res += `
|
|
7525
7525
|
${indentation}`;
|
|
7526
|
-
|
|
7526
|
+
join4 = `,
|
|
7527
7527
|
${indentation}`;
|
|
7528
7528
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7529
7529
|
const tmp2 = stringifyFullFn(i3, value, stack, replacer, indent);
|
|
7530
7530
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7531
|
-
res +=
|
|
7531
|
+
res += join4;
|
|
7532
7532
|
}
|
|
7533
7533
|
const tmp = stringifyFullFn(i3, value, stack, replacer, indent);
|
|
7534
7534
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7550,7 +7550,7 @@ ${originalIndentation}`;
|
|
|
7550
7550
|
indentation += indent;
|
|
7551
7551
|
res += `
|
|
7552
7552
|
${indentation}`;
|
|
7553
|
-
|
|
7553
|
+
join4 = `,
|
|
7554
7554
|
${indentation}`;
|
|
7555
7555
|
var separator = "";
|
|
7556
7556
|
for (i3 = 0; i3 < keys.length; i3++) {
|
|
@@ -7558,7 +7558,7 @@ ${indentation}`;
|
|
|
7558
7558
|
const tmp = stringifyFullFn(key, value, stack, replacer, indent);
|
|
7559
7559
|
if (tmp !== void 0) {
|
|
7560
7560
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7561
|
-
separator =
|
|
7561
|
+
separator = join4;
|
|
7562
7562
|
}
|
|
7563
7563
|
}
|
|
7564
7564
|
if (separator !== "") {
|
|
@@ -7580,7 +7580,7 @@ ${originalIndentation}`;
|
|
|
7580
7580
|
}
|
|
7581
7581
|
}
|
|
7582
7582
|
function stringifyFullArr(key, value, stack, replacer, indent) {
|
|
7583
|
-
var i3, res,
|
|
7583
|
+
var i3, res, join4;
|
|
7584
7584
|
const originalIndentation = indentation;
|
|
7585
7585
|
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
7586
7586
|
value = value.toJSON(key);
|
|
@@ -7604,12 +7604,12 @@ ${originalIndentation}`;
|
|
|
7604
7604
|
indentation += indent;
|
|
7605
7605
|
res += `
|
|
7606
7606
|
${indentation}`;
|
|
7607
|
-
|
|
7607
|
+
join4 = `,
|
|
7608
7608
|
${indentation}`;
|
|
7609
7609
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7610
7610
|
const tmp2 = stringifyFullArr(i3, value[i3], stack, replacer, indent);
|
|
7611
7611
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7612
|
-
res +=
|
|
7612
|
+
res += join4;
|
|
7613
7613
|
}
|
|
7614
7614
|
const tmp = stringifyFullArr(i3, value[i3], stack, replacer, indent);
|
|
7615
7615
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7630,7 +7630,7 @@ ${originalIndentation}`;
|
|
|
7630
7630
|
indentation += indent;
|
|
7631
7631
|
res += `
|
|
7632
7632
|
${indentation}`;
|
|
7633
|
-
|
|
7633
|
+
join4 = `,
|
|
7634
7634
|
${indentation}`;
|
|
7635
7635
|
var separator = "";
|
|
7636
7636
|
for (i3 = 0; i3 < replacer.length; i3++) {
|
|
@@ -7639,7 +7639,7 @@ ${indentation}`;
|
|
|
7639
7639
|
const tmp = stringifyFullArr(key, value[key], stack, replacer, indent);
|
|
7640
7640
|
if (tmp !== void 0) {
|
|
7641
7641
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7642
|
-
separator =
|
|
7642
|
+
separator = join4;
|
|
7643
7643
|
}
|
|
7644
7644
|
}
|
|
7645
7645
|
}
|
|
@@ -7662,7 +7662,7 @@ ${originalIndentation}`;
|
|
|
7662
7662
|
}
|
|
7663
7663
|
}
|
|
7664
7664
|
function stringifyIndent(key, value, stack, indent) {
|
|
7665
|
-
var i3, res,
|
|
7665
|
+
var i3, res, join4;
|
|
7666
7666
|
const originalIndentation = indentation;
|
|
7667
7667
|
switch (typeof value) {
|
|
7668
7668
|
case "object":
|
|
@@ -7692,12 +7692,12 @@ ${originalIndentation}`;
|
|
|
7692
7692
|
indentation += indent;
|
|
7693
7693
|
res += `
|
|
7694
7694
|
${indentation}`;
|
|
7695
|
-
|
|
7695
|
+
join4 = `,
|
|
7696
7696
|
${indentation}`;
|
|
7697
7697
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7698
7698
|
const tmp2 = stringifyIndent(i3, value[i3], stack, indent);
|
|
7699
7699
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7700
|
-
res +=
|
|
7700
|
+
res += join4;
|
|
7701
7701
|
}
|
|
7702
7702
|
const tmp = stringifyIndent(i3, value[i3], stack, indent);
|
|
7703
7703
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7719,7 +7719,7 @@ ${originalIndentation}`;
|
|
|
7719
7719
|
indentation += indent;
|
|
7720
7720
|
res += `
|
|
7721
7721
|
${indentation}`;
|
|
7722
|
-
|
|
7722
|
+
join4 = `,
|
|
7723
7723
|
${indentation}`;
|
|
7724
7724
|
var separator = "";
|
|
7725
7725
|
for (i3 = 0; i3 < keys.length; i3++) {
|
|
@@ -7727,7 +7727,7 @@ ${indentation}`;
|
|
|
7727
7727
|
const tmp = stringifyIndent(key, value[key], stack, indent);
|
|
7728
7728
|
if (tmp !== void 0) {
|
|
7729
7729
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7730
|
-
separator =
|
|
7730
|
+
separator = join4;
|
|
7731
7731
|
}
|
|
7732
7732
|
}
|
|
7733
7733
|
if (separator !== "") {
|
|
@@ -7943,7 +7943,7 @@ ${originalIndentation}`;
|
|
|
7943
7943
|
}
|
|
7944
7944
|
return arr;
|
|
7945
7945
|
}
|
|
7946
|
-
function
|
|
7946
|
+
function stringify4(value, replacer, spacer) {
|
|
7947
7947
|
var i3;
|
|
7948
7948
|
var indent = "";
|
|
7949
7949
|
indentation = "";
|
|
@@ -7982,9 +7982,9 @@ ${originalIndentation}`;
|
|
|
7982
7982
|
var require_safe_stable_stringify = __commonJS({
|
|
7983
7983
|
"node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
7984
7984
|
"use strict";
|
|
7985
|
-
var
|
|
7986
|
-
module.exports =
|
|
7987
|
-
|
|
7985
|
+
var stringify4 = require_stable();
|
|
7986
|
+
module.exports = stringify4;
|
|
7987
|
+
stringify4.default = stringify4;
|
|
7988
7988
|
}
|
|
7989
7989
|
});
|
|
7990
7990
|
|
|
@@ -8023,7 +8023,7 @@ __export(index_es_exports2, {
|
|
|
8023
8023
|
resolveExternalRef: () => ye,
|
|
8024
8024
|
resolveExternalRefWithLocation: () => ge,
|
|
8025
8025
|
resolveInlineRef: () => B,
|
|
8026
|
-
resolveInlineRefWithLocation: () =>
|
|
8026
|
+
resolveInlineRefWithLocation: () => z19,
|
|
8027
8027
|
safeParse: () => de,
|
|
8028
8028
|
safeStringify: () => ve,
|
|
8029
8029
|
startsWith: () => be,
|
|
@@ -8067,9 +8067,9 @@ function* L(e3, t3, r3) {
|
|
|
8067
8067
|
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]);
|
|
8068
8068
|
}
|
|
8069
8069
|
function B(e3, t3) {
|
|
8070
|
-
return
|
|
8070
|
+
return z19(e3, t3).value;
|
|
8071
8071
|
}
|
|
8072
|
-
function
|
|
8072
|
+
function z19(e3, t3) {
|
|
8073
8073
|
return (function e4(t4, r3, n3, o3) {
|
|
8074
8074
|
if (null !== V(r3)) throw new ReferenceError("Cannot resolve external references");
|
|
8075
8075
|
const i3 = K(r3);
|
|
@@ -12937,13 +12937,13 @@ var require_yaml2 = __commonJS({
|
|
|
12937
12937
|
function getLocationForJsonPath(result, path) {
|
|
12938
12938
|
return (0, yaml_1.getLocationForJsonPath)(result, path);
|
|
12939
12939
|
}
|
|
12940
|
-
var
|
|
12940
|
+
var parseYaml5 = (input) => (0, yaml_1.parseWithPointers)(input, {
|
|
12941
12941
|
ignoreDuplicateKeys: false,
|
|
12942
12942
|
mergeKeys: true,
|
|
12943
12943
|
preserveKeyOrder: true,
|
|
12944
12944
|
attachComments: false
|
|
12945
12945
|
});
|
|
12946
|
-
exports.parseYaml =
|
|
12946
|
+
exports.parseYaml = parseYaml5;
|
|
12947
12947
|
exports.Yaml = {
|
|
12948
12948
|
parse: exports.parseYaml,
|
|
12949
12949
|
getLocationForJsonPath,
|
|
@@ -13033,11 +13033,11 @@ function __metadata2(metadataKey, metadataValue) {
|
|
|
13033
13033
|
}
|
|
13034
13034
|
function __awaiter2(thisArg, _arguments, P2, generator) {
|
|
13035
13035
|
function adopt(value) {
|
|
13036
|
-
return value instanceof P2 ? value : new P2(function(
|
|
13037
|
-
|
|
13036
|
+
return value instanceof P2 ? value : new P2(function(resolve9) {
|
|
13037
|
+
resolve9(value);
|
|
13038
13038
|
});
|
|
13039
13039
|
}
|
|
13040
|
-
return new (P2 || (P2 = Promise))(function(
|
|
13040
|
+
return new (P2 || (P2 = Promise))(function(resolve9, reject) {
|
|
13041
13041
|
function fulfilled(value) {
|
|
13042
13042
|
try {
|
|
13043
13043
|
step(generator.next(value));
|
|
@@ -13053,7 +13053,7 @@ function __awaiter2(thisArg, _arguments, P2, generator) {
|
|
|
13053
13053
|
}
|
|
13054
13054
|
}
|
|
13055
13055
|
function step(result) {
|
|
13056
|
-
result.done ?
|
|
13056
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
13057
13057
|
}
|
|
13058
13058
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13059
13059
|
});
|
|
@@ -13231,14 +13231,14 @@ function __asyncValues2(o3) {
|
|
|
13231
13231
|
}, i3);
|
|
13232
13232
|
function verb(n3) {
|
|
13233
13233
|
i3[n3] = o3[n3] && function(v2) {
|
|
13234
|
-
return new Promise(function(
|
|
13235
|
-
v2 = o3[n3](v2), settle(
|
|
13234
|
+
return new Promise(function(resolve9, reject) {
|
|
13235
|
+
v2 = o3[n3](v2), settle(resolve9, reject, v2.done, v2.value);
|
|
13236
13236
|
});
|
|
13237
13237
|
};
|
|
13238
13238
|
}
|
|
13239
|
-
function settle(
|
|
13239
|
+
function settle(resolve9, reject, d2, v2) {
|
|
13240
13240
|
Promise.resolve(v2).then(function(v3) {
|
|
13241
|
-
|
|
13241
|
+
resolve9({ value: v3, done: d2 });
|
|
13242
13242
|
}, reject);
|
|
13243
13243
|
}
|
|
13244
13244
|
}
|
|
@@ -15152,7 +15152,7 @@ function consumeBody() {
|
|
|
15152
15152
|
let accum = [];
|
|
15153
15153
|
let accumBytes = 0;
|
|
15154
15154
|
let abort = false;
|
|
15155
|
-
return new Body.Promise(function(
|
|
15155
|
+
return new Body.Promise(function(resolve9, reject) {
|
|
15156
15156
|
let resTimeout;
|
|
15157
15157
|
if (_this4.timeout) {
|
|
15158
15158
|
resTimeout = setTimeout(function() {
|
|
@@ -15186,7 +15186,7 @@ function consumeBody() {
|
|
|
15186
15186
|
}
|
|
15187
15187
|
clearTimeout(resTimeout);
|
|
15188
15188
|
try {
|
|
15189
|
-
|
|
15189
|
+
resolve9(Buffer.concat(accum, accumBytes));
|
|
15190
15190
|
} catch (err) {
|
|
15191
15191
|
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
|
|
15192
15192
|
}
|
|
@@ -15449,7 +15449,7 @@ function fetch(url, opts) {
|
|
|
15449
15449
|
throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
|
|
15450
15450
|
}
|
|
15451
15451
|
Body.Promise = fetch.Promise;
|
|
15452
|
-
return new fetch.Promise(function(
|
|
15452
|
+
return new fetch.Promise(function(resolve9, reject) {
|
|
15453
15453
|
const request = new Request(url, opts);
|
|
15454
15454
|
const options = getNodeRequestOptions(request);
|
|
15455
15455
|
const send = (options.protocol === "https:" ? https : http).request;
|
|
@@ -15582,7 +15582,7 @@ function fetch(url, opts) {
|
|
|
15582
15582
|
requestOpts.body = void 0;
|
|
15583
15583
|
requestOpts.headers.delete("content-length");
|
|
15584
15584
|
}
|
|
15585
|
-
|
|
15585
|
+
resolve9(fetch(new Request(locationURL, requestOpts)));
|
|
15586
15586
|
finalize();
|
|
15587
15587
|
return;
|
|
15588
15588
|
}
|
|
@@ -15603,7 +15603,7 @@ function fetch(url, opts) {
|
|
|
15603
15603
|
const codings = headers.get("Content-Encoding");
|
|
15604
15604
|
if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
15605
15605
|
response = new Response(body, response_options);
|
|
15606
|
-
|
|
15606
|
+
resolve9(response);
|
|
15607
15607
|
return;
|
|
15608
15608
|
}
|
|
15609
15609
|
const zlibOptions = {
|
|
@@ -15613,7 +15613,7 @@ function fetch(url, opts) {
|
|
|
15613
15613
|
if (codings == "gzip" || codings == "x-gzip") {
|
|
15614
15614
|
body = body.pipe(zlib.createGunzip(zlibOptions));
|
|
15615
15615
|
response = new Response(body, response_options);
|
|
15616
|
-
|
|
15616
|
+
resolve9(response);
|
|
15617
15617
|
return;
|
|
15618
15618
|
}
|
|
15619
15619
|
if (codings == "deflate" || codings == "x-deflate") {
|
|
@@ -15625,12 +15625,12 @@ function fetch(url, opts) {
|
|
|
15625
15625
|
body = body.pipe(zlib.createInflateRaw());
|
|
15626
15626
|
}
|
|
15627
15627
|
response = new Response(body, response_options);
|
|
15628
|
-
|
|
15628
|
+
resolve9(response);
|
|
15629
15629
|
});
|
|
15630
15630
|
raw.on("end", function() {
|
|
15631
15631
|
if (!response) {
|
|
15632
15632
|
response = new Response(body, response_options);
|
|
15633
|
-
|
|
15633
|
+
resolve9(response);
|
|
15634
15634
|
}
|
|
15635
15635
|
});
|
|
15636
15636
|
return;
|
|
@@ -15638,11 +15638,11 @@ function fetch(url, opts) {
|
|
|
15638
15638
|
if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
|
|
15639
15639
|
body = body.pipe(zlib.createBrotliDecompress());
|
|
15640
15640
|
response = new Response(body, response_options);
|
|
15641
|
-
|
|
15641
|
+
resolve9(response);
|
|
15642
15642
|
return;
|
|
15643
15643
|
}
|
|
15644
15644
|
response = new Response(body, response_options);
|
|
15645
|
-
|
|
15645
|
+
resolve9(response);
|
|
15646
15646
|
});
|
|
15647
15647
|
writeToStream(req, request);
|
|
15648
15648
|
});
|
|
@@ -16355,13 +16355,13 @@ var require_file = __commonJS({
|
|
|
16355
16355
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16356
16356
|
var fs_1 = __require("fs");
|
|
16357
16357
|
function resolveFile(ref) {
|
|
16358
|
-
return new Promise((
|
|
16358
|
+
return new Promise((resolve9, reject) => {
|
|
16359
16359
|
const path = ref.href();
|
|
16360
16360
|
fs_1.readFile(path, "utf8", (err, data) => {
|
|
16361
16361
|
if (err) {
|
|
16362
16362
|
reject(err);
|
|
16363
16363
|
} else {
|
|
16364
|
-
|
|
16364
|
+
resolve9(data);
|
|
16365
16365
|
}
|
|
16366
16366
|
});
|
|
16367
16367
|
});
|
|
@@ -16899,7 +16899,7 @@ var require_immer_cjs_production_min = __commonJS({
|
|
|
16899
16899
|
var t4 = n4[H2];
|
|
16900
16900
|
return (t4 ? s2(t4) : n4)[r4];
|
|
16901
16901
|
}
|
|
16902
|
-
function
|
|
16902
|
+
function z20(n4, r4) {
|
|
16903
16903
|
if (r4 in n4) for (var t4 = Object.getPrototypeOf(n4); t4; ) {
|
|
16904
16904
|
var e4 = Object.getOwnPropertyDescriptor(t4, r4);
|
|
16905
16905
|
if (e4) return e4;
|
|
@@ -17292,7 +17292,7 @@ var require_immer_cjs_production_min = __commonJS({
|
|
|
17292
17292
|
if (r4 === H2) return n4;
|
|
17293
17293
|
var e4 = s2(n4);
|
|
17294
17294
|
if (!u2(e4, r4)) return (function(n5, r5, t4) {
|
|
17295
|
-
var e5, i5 =
|
|
17295
|
+
var e5, i5 = z20(r5, t4);
|
|
17296
17296
|
return i5 ? "value" in i5 ? i5.value : null === (e5 = i5.get) || void 0 === e5 ? void 0 : e5.call(n5.k) : void 0;
|
|
17297
17297
|
})(n4, e4, r4);
|
|
17298
17298
|
var i4 = e4[r4];
|
|
@@ -17302,7 +17302,7 @@ var require_immer_cjs_production_min = __commonJS({
|
|
|
17302
17302
|
}, ownKeys: function(n4) {
|
|
17303
17303
|
return Reflect.ownKeys(s2(n4));
|
|
17304
17304
|
}, set: function(n4, r4, t4) {
|
|
17305
|
-
var e4 =
|
|
17305
|
+
var e4 = z20(s2(n4), r4);
|
|
17306
17306
|
if (null == e4 ? void 0 : e4.set) return e4.set.call(n4.k, t4), true;
|
|
17307
17307
|
if (!n4.g) {
|
|
17308
17308
|
var i4 = A2(s2(n4), r4), o4 = null == i4 ? void 0 : i4[H2];
|
|
@@ -23964,12 +23964,12 @@ var require_reader = __commonJS({
|
|
|
23964
23964
|
}
|
|
23965
23965
|
} else {
|
|
23966
23966
|
try {
|
|
23967
|
-
return await new Promise((
|
|
23967
|
+
return await new Promise((resolve9, reject) => {
|
|
23968
23968
|
fs.readFile(name, opts.encoding, (err, data) => {
|
|
23969
23969
|
if (err !== null) {
|
|
23970
23970
|
reject(err);
|
|
23971
23971
|
} else {
|
|
23972
|
-
|
|
23972
|
+
resolve9(data);
|
|
23973
23973
|
}
|
|
23974
23974
|
});
|
|
23975
23975
|
});
|
|
@@ -30464,7 +30464,7 @@ var require_astring = __commonJS({
|
|
|
30464
30464
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
30465
30465
|
return Constructor;
|
|
30466
30466
|
}
|
|
30467
|
-
var
|
|
30467
|
+
var stringify4 = JSON.stringify;
|
|
30468
30468
|
if (!String.prototype.repeat) {
|
|
30469
30469
|
throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");
|
|
30470
30470
|
}
|
|
@@ -31386,7 +31386,7 @@ var require_astring = __commonJS({
|
|
|
31386
31386
|
} else if (node.bigint != null) {
|
|
31387
31387
|
state.write(node.bigint + "n", node);
|
|
31388
31388
|
} else {
|
|
31389
|
-
state.write(
|
|
31389
|
+
state.write(stringify4(node.value), node);
|
|
31390
31390
|
}
|
|
31391
31391
|
},
|
|
31392
31392
|
RegExpLiteral: function RegExpLiteral(node, state) {
|
|
@@ -35641,11 +35641,11 @@ var require_brace_expansion = __commonJS({
|
|
|
35641
35641
|
if (pad) {
|
|
35642
35642
|
var need = width - c2.length;
|
|
35643
35643
|
if (need > 0) {
|
|
35644
|
-
var
|
|
35644
|
+
var z20 = new Array(need + 1).join("0");
|
|
35645
35645
|
if (i3 < 0)
|
|
35646
|
-
c2 = "-" +
|
|
35646
|
+
c2 = "-" + z20 + c2.slice(1);
|
|
35647
35647
|
else
|
|
35648
|
-
c2 =
|
|
35648
|
+
c2 = z20 + c2;
|
|
35649
35649
|
}
|
|
35650
35650
|
}
|
|
35651
35651
|
}
|
|
@@ -40854,14 +40854,14 @@ var require_AsyncFromSyncIteratorContinuation = __commonJS({
|
|
|
40854
40854
|
if (!$Promise) {
|
|
40855
40855
|
throw new $SyntaxError("This environment does not support Promises.");
|
|
40856
40856
|
}
|
|
40857
|
-
return new $Promise(function(
|
|
40857
|
+
return new $Promise(function(resolve9) {
|
|
40858
40858
|
var done = IteratorComplete(result);
|
|
40859
40859
|
var value = IteratorValue(result);
|
|
40860
40860
|
var valueWrapper = PromiseResolve($Promise, value);
|
|
40861
40861
|
var onFulfilled = function(value2) {
|
|
40862
40862
|
return CreateIteratorResultObject(value2, done);
|
|
40863
40863
|
};
|
|
40864
|
-
|
|
40864
|
+
resolve9($then(valueWrapper, onFulfilled));
|
|
40865
40865
|
});
|
|
40866
40866
|
};
|
|
40867
40867
|
}
|
|
@@ -41409,7 +41409,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41409
41409
|
var O2 = this;
|
|
41410
41410
|
SLOT.assert(O2, "[[SyncIteratorRecord]]");
|
|
41411
41411
|
var argsLength = arguments.length;
|
|
41412
|
-
return new $Promise(function(
|
|
41412
|
+
return new $Promise(function(resolve9) {
|
|
41413
41413
|
var syncIteratorRecord = SLOT.get(O2, "[[SyncIteratorRecord]]");
|
|
41414
41414
|
var result;
|
|
41415
41415
|
if (argsLength > 0) {
|
|
@@ -41417,7 +41417,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41417
41417
|
} else {
|
|
41418
41418
|
result = IteratorNext(syncIteratorRecord);
|
|
41419
41419
|
}
|
|
41420
|
-
|
|
41420
|
+
resolve9(AsyncFromSyncIteratorContinuation(result));
|
|
41421
41421
|
});
|
|
41422
41422
|
},
|
|
41423
41423
|
"return": function() {
|
|
@@ -41428,12 +41428,12 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41428
41428
|
SLOT.assert(O2, "[[SyncIteratorRecord]]");
|
|
41429
41429
|
var valueIsPresent = arguments.length > 0;
|
|
41430
41430
|
var value = valueIsPresent ? arguments[0] : void 0;
|
|
41431
|
-
return new $Promise(function(
|
|
41431
|
+
return new $Promise(function(resolve9, reject) {
|
|
41432
41432
|
var syncIterator = SLOT.get(O2, "[[SyncIteratorRecord]]")["[[Iterator]]"];
|
|
41433
41433
|
var iteratorReturn = GetMethod(syncIterator, "return");
|
|
41434
41434
|
if (typeof iteratorReturn === "undefined") {
|
|
41435
41435
|
var iterResult = CreateIteratorResultObject(value, true);
|
|
41436
|
-
Call(
|
|
41436
|
+
Call(resolve9, void 0, [iterResult]);
|
|
41437
41437
|
return;
|
|
41438
41438
|
}
|
|
41439
41439
|
var result;
|
|
@@ -41446,7 +41446,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41446
41446
|
Call(reject, void 0, [new $TypeError("Iterator `return` method returned a non-object value.")]);
|
|
41447
41447
|
return;
|
|
41448
41448
|
}
|
|
41449
|
-
|
|
41449
|
+
resolve9(AsyncFromSyncIteratorContinuation(result));
|
|
41450
41450
|
});
|
|
41451
41451
|
},
|
|
41452
41452
|
"throw": function() {
|
|
@@ -41457,7 +41457,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41457
41457
|
SLOT.assert(O2, "[[SyncIteratorRecord]]");
|
|
41458
41458
|
var valueIsPresent = arguments.length > 0;
|
|
41459
41459
|
var value = valueIsPresent ? arguments[0] : void 0;
|
|
41460
|
-
return new $Promise(function(
|
|
41460
|
+
return new $Promise(function(resolve9, reject) {
|
|
41461
41461
|
var syncIterator = SLOT.get(O2, "[[SyncIteratorRecord]]")["[[Iterator]]"];
|
|
41462
41462
|
var throwMethod = GetMethod(syncIterator, "throw");
|
|
41463
41463
|
if (typeof throwMethod === "undefined") {
|
|
@@ -41474,7 +41474,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
|
|
|
41474
41474
|
Call(reject, void 0, [new $TypeError("Iterator `throw` method returned a non-object value.")]);
|
|
41475
41475
|
return;
|
|
41476
41476
|
}
|
|
41477
|
-
|
|
41477
|
+
resolve9(AsyncFromSyncIteratorContinuation(
|
|
41478
41478
|
result
|
|
41479
41479
|
/* , promiseCapability */
|
|
41480
41480
|
));
|
|
@@ -46246,7 +46246,7 @@ var require_lodash3 = __commonJS({
|
|
|
46246
46246
|
}
|
|
46247
46247
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
46248
46248
|
});
|
|
46249
|
-
function
|
|
46249
|
+
function join4(array, separator) {
|
|
46250
46250
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
46251
46251
|
}
|
|
46252
46252
|
function last(array) {
|
|
@@ -48165,7 +48165,7 @@ var require_lodash3 = __commonJS({
|
|
|
48165
48165
|
lodash.isUndefined = isUndefined;
|
|
48166
48166
|
lodash.isWeakMap = isWeakMap;
|
|
48167
48167
|
lodash.isWeakSet = isWeakSet;
|
|
48168
|
-
lodash.join =
|
|
48168
|
+
lodash.join = join4;
|
|
48169
48169
|
lodash.kebabCase = kebabCase;
|
|
48170
48170
|
lodash.last = last;
|
|
48171
48171
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -49169,7 +49169,7 @@ var require_dist10 = __commonJS({
|
|
|
49169
49169
|
var getSiblings = (parent) => (node) => getChildren(parent).filter(not(eq(node)));
|
|
49170
49170
|
var concatAll = (
|
|
49171
49171
|
/*::<T>*/
|
|
49172
|
-
(xs) => (ys) => ys.reduce((zs,
|
|
49172
|
+
(xs) => (ys) => ys.reduce((zs, z20) => zs.concat(z20), xs)
|
|
49173
49173
|
);
|
|
49174
49174
|
function getLastSegment(instancePath) {
|
|
49175
49175
|
const index4 = instancePath.lastIndexOf("/");
|
|
@@ -50425,9 +50425,9 @@ var require_dist13 = __commonJS({
|
|
|
50425
50425
|
});
|
|
50426
50426
|
|
|
50427
50427
|
// src/cli/cli.ts
|
|
50428
|
-
import { readFileSync } from "fs";
|
|
50428
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
50429
50429
|
import { fileURLToPath } from "url";
|
|
50430
|
-
import { resolve as
|
|
50430
|
+
import { resolve as resolve8, dirname as dirname8 } from "path";
|
|
50431
50431
|
import { Command as Command8 } from "commander";
|
|
50432
50432
|
|
|
50433
50433
|
// src/cli/commands/resolve.ts
|
|
@@ -50618,7 +50618,7 @@ var SoftwareBindingSchema = z4.object({
|
|
|
50618
50618
|
}).passthrough();
|
|
50619
50619
|
|
|
50620
50620
|
// src/schema/dsl.ts
|
|
50621
|
-
import { z as
|
|
50621
|
+
import { z as z15 } from "zod";
|
|
50622
50622
|
|
|
50623
50623
|
// src/schema/handoff-type.ts
|
|
50624
50624
|
import { z as z5 } from "zod";
|
|
@@ -50719,106 +50719,143 @@ var TaskSchema = z9.object({
|
|
|
50719
50719
|
guardrails: z9.array(z9.string()).optional()
|
|
50720
50720
|
}).passthrough();
|
|
50721
50721
|
|
|
50722
|
-
// src/schema/
|
|
50722
|
+
// src/schema/team-import.ts
|
|
50723
50723
|
import { z as z10 } from "zod";
|
|
50724
|
-
var
|
|
50725
|
-
|
|
50726
|
-
|
|
50727
|
-
reads: z10.array(z10.string()).default([]),
|
|
50728
|
-
writes: z10.array(z10.string()).default([]),
|
|
50729
|
-
purpose: z10.string().optional()
|
|
50730
|
-
});
|
|
50731
|
-
var ToolSchema = z10.object({
|
|
50732
|
-
kind: z10.string(),
|
|
50733
|
-
description: z10.string().optional(),
|
|
50734
|
-
input_artifacts: z10.array(z10.string()).default([]),
|
|
50735
|
-
output_artifacts: z10.array(z10.string()).default([]),
|
|
50736
|
-
invokable_by: z10.array(z10.string()),
|
|
50737
|
-
side_effects: z10.array(z10.string()).default([]),
|
|
50738
|
-
commands: z10.array(CommandSchema).default([]),
|
|
50739
|
-
guardrails: z10.array(z10.string()).optional()
|
|
50724
|
+
var TeamImportSchema = z10.object({
|
|
50725
|
+
interface: z10.string(),
|
|
50726
|
+
version: z10.string().optional()
|
|
50740
50727
|
}).passthrough();
|
|
50741
50728
|
|
|
50742
|
-
// src/schema/
|
|
50729
|
+
// src/schema/team-interface.ts
|
|
50743
50730
|
import { z as z11 } from "zod";
|
|
50744
|
-
var
|
|
50745
|
-
|
|
50746
|
-
|
|
50747
|
-
|
|
50748
|
-
|
|
50749
|
-
|
|
50750
|
-
|
|
50731
|
+
var TeamInterfaceAcceptWorkflowSchema = z11.object({
|
|
50732
|
+
internal_workflow: z11.string().optional(),
|
|
50733
|
+
input_handoff: z11.string(),
|
|
50734
|
+
output_handoff: z11.string(),
|
|
50735
|
+
description: z11.string().optional()
|
|
50736
|
+
}).passthrough();
|
|
50737
|
+
var TeamInterfaceSchema = z11.object({
|
|
50738
|
+
version: z11.number(),
|
|
50739
|
+
description: z11.string().optional(),
|
|
50740
|
+
accepts: z11.object({
|
|
50741
|
+
workflows: z11.record(z11.string(), TeamInterfaceAcceptWorkflowSchema)
|
|
50742
|
+
}).passthrough().optional(),
|
|
50743
|
+
exposes: z11.object({
|
|
50744
|
+
artifacts: z11.array(z11.string())
|
|
50745
|
+
}).passthrough().optional(),
|
|
50746
|
+
constraints: z11.array(z11.string()).optional()
|
|
50751
50747
|
}).passthrough();
|
|
50752
50748
|
|
|
50753
|
-
// src/schema/
|
|
50749
|
+
// src/schema/tool.ts
|
|
50754
50750
|
import { z as z12 } from "zod";
|
|
50755
|
-
var
|
|
50756
|
-
|
|
50757
|
-
|
|
50758
|
-
|
|
50759
|
-
|
|
50760
|
-
|
|
50761
|
-
|
|
50762
|
-
|
|
50763
|
-
|
|
50764
|
-
description: z12.string().optional()
|
|
50765
|
-
});
|
|
50766
|
-
var WorkflowDelegateStepSchema = z12.object({
|
|
50767
|
-
type: z12.literal("delegate"),
|
|
50751
|
+
var CommandSchema = z12.object({
|
|
50752
|
+
command: z12.string(),
|
|
50753
|
+
category: z12.string(),
|
|
50754
|
+
reads: z12.array(z12.string()).default([]),
|
|
50755
|
+
writes: z12.array(z12.string()).default([]),
|
|
50756
|
+
purpose: z12.string().optional()
|
|
50757
|
+
});
|
|
50758
|
+
var ToolSchema = z12.object({
|
|
50759
|
+
kind: z12.string(),
|
|
50768
50760
|
description: z12.string().optional(),
|
|
50769
|
-
|
|
50770
|
-
|
|
50771
|
-
|
|
50761
|
+
input_artifacts: z12.array(z12.string()).default([]),
|
|
50762
|
+
output_artifacts: z12.array(z12.string()).default([]),
|
|
50763
|
+
invokable_by: z12.array(z12.string()),
|
|
50764
|
+
side_effects: z12.array(z12.string()).default([]),
|
|
50765
|
+
commands: z12.array(CommandSchema).default([]),
|
|
50766
|
+
guardrails: z12.array(z12.string()).optional()
|
|
50767
|
+
}).passthrough();
|
|
50768
|
+
|
|
50769
|
+
// src/schema/validation.ts
|
|
50770
|
+
import { z as z13 } from "zod";
|
|
50771
|
+
var ValidationSchema = z13.object({
|
|
50772
|
+
target_artifact: z13.string(),
|
|
50773
|
+
kind: z13.enum(["schema", "mechanical", "semantic", "approval", "provenance", "traceability", "fidelity"]),
|
|
50774
|
+
executor_type: z13.enum(["tool", "agent"]),
|
|
50775
|
+
executor: z13.string(),
|
|
50776
|
+
blocking: z13.boolean(),
|
|
50777
|
+
produces_evidence: z13.string().optional()
|
|
50778
|
+
}).passthrough();
|
|
50779
|
+
|
|
50780
|
+
// src/schema/workflow.ts
|
|
50781
|
+
import { z as z14 } from "zod";
|
|
50782
|
+
var RetrySchema = z14.object({
|
|
50783
|
+
condition: z14.string(),
|
|
50784
|
+
fix_task: z14.string(),
|
|
50785
|
+
revalidate_task: z14.string().optional()
|
|
50786
|
+
});
|
|
50787
|
+
var ExternalParticipantSchema = z14.object({
|
|
50788
|
+
id: z14.string(),
|
|
50789
|
+
kind: z14.enum(["actor", "participant"]),
|
|
50790
|
+
label: z14.string(),
|
|
50791
|
+
description: z14.string().optional()
|
|
50792
|
+
});
|
|
50793
|
+
var WorkflowDelegateStepSchema = z14.object({
|
|
50794
|
+
type: z14.literal("delegate"),
|
|
50795
|
+
description: z14.string().optional(),
|
|
50796
|
+
task: z14.string(),
|
|
50797
|
+
from_agent: z14.string(),
|
|
50798
|
+
group: z14.string().optional(),
|
|
50772
50799
|
retry: RetrySchema.optional()
|
|
50773
50800
|
}).passthrough();
|
|
50774
|
-
var WorkflowGateStepSchema =
|
|
50775
|
-
type:
|
|
50776
|
-
description:
|
|
50777
|
-
gate_kind:
|
|
50778
|
-
group:
|
|
50801
|
+
var WorkflowGateStepSchema = z14.object({
|
|
50802
|
+
type: z14.literal("gate"),
|
|
50803
|
+
description: z14.string().optional(),
|
|
50804
|
+
gate_kind: z14.string(),
|
|
50805
|
+
group: z14.string().optional()
|
|
50779
50806
|
}).passthrough();
|
|
50780
|
-
var WorkflowHandoffStepSchema =
|
|
50781
|
-
type:
|
|
50782
|
-
description:
|
|
50783
|
-
handoff_kind:
|
|
50784
|
-
task:
|
|
50785
|
-
from_agent:
|
|
50786
|
-
group:
|
|
50807
|
+
var WorkflowHandoffStepSchema = z14.object({
|
|
50808
|
+
type: z14.literal("handoff"),
|
|
50809
|
+
description: z14.string().optional(),
|
|
50810
|
+
handoff_kind: z14.string(),
|
|
50811
|
+
task: z14.string().optional(),
|
|
50812
|
+
from_agent: z14.string().optional(),
|
|
50813
|
+
group: z14.string().optional(),
|
|
50787
50814
|
retry: RetrySchema.optional()
|
|
50788
50815
|
}).passthrough();
|
|
50789
|
-
var WorkflowValidationStepSchema =
|
|
50790
|
-
type:
|
|
50791
|
-
description:
|
|
50792
|
-
validation:
|
|
50793
|
-
group:
|
|
50816
|
+
var WorkflowValidationStepSchema = z14.object({
|
|
50817
|
+
type: z14.literal("validation"),
|
|
50818
|
+
description: z14.string().optional(),
|
|
50819
|
+
validation: z14.string(),
|
|
50820
|
+
group: z14.string().optional()
|
|
50794
50821
|
}).passthrough();
|
|
50795
|
-
var WorkflowDecisionStepSchema =
|
|
50796
|
-
type:
|
|
50797
|
-
description:
|
|
50822
|
+
var WorkflowDecisionStepSchema = z14.object({
|
|
50823
|
+
type: z14.literal("decision"),
|
|
50824
|
+
description: z14.string().optional(),
|
|
50798
50825
|
/** @deprecated Use `routing_key` instead. `on` is kept for backward compatibility. */
|
|
50799
|
-
on:
|
|
50800
|
-
routing_key:
|
|
50801
|
-
branches:
|
|
50802
|
-
group:
|
|
50826
|
+
on: z14.string().optional(),
|
|
50827
|
+
routing_key: z14.string().optional(),
|
|
50828
|
+
branches: z14.record(z14.string(), z14.array(z14.string())),
|
|
50829
|
+
group: z14.string().optional()
|
|
50803
50830
|
}).passthrough();
|
|
50804
|
-
var
|
|
50831
|
+
var WorkflowTeamTaskStepSchema = z14.object({
|
|
50832
|
+
type: z14.literal("team_task"),
|
|
50833
|
+
description: z14.string().optional(),
|
|
50834
|
+
to_team: z14.string(),
|
|
50835
|
+
workflow: z14.string(),
|
|
50836
|
+
handoff: z14.string(),
|
|
50837
|
+
expects: z14.string(),
|
|
50838
|
+
group: z14.string().optional()
|
|
50839
|
+
}).passthrough();
|
|
50840
|
+
var WorkflowStepSchema = z14.discriminatedUnion("type", [
|
|
50805
50841
|
WorkflowDelegateStepSchema,
|
|
50806
50842
|
WorkflowGateStepSchema,
|
|
50807
50843
|
WorkflowHandoffStepSchema,
|
|
50808
50844
|
WorkflowValidationStepSchema,
|
|
50809
|
-
WorkflowDecisionStepSchema
|
|
50845
|
+
WorkflowDecisionStepSchema,
|
|
50846
|
+
WorkflowTeamTaskStepSchema
|
|
50810
50847
|
]);
|
|
50811
|
-
var WorkflowSchema =
|
|
50812
|
-
description:
|
|
50813
|
-
entry_conditions:
|
|
50814
|
-
trigger:
|
|
50815
|
-
steps:
|
|
50816
|
-
external_participants:
|
|
50848
|
+
var WorkflowSchema = z14.object({
|
|
50849
|
+
description: z14.string().optional(),
|
|
50850
|
+
entry_conditions: z14.array(z14.string()).default([]),
|
|
50851
|
+
trigger: z14.string().optional(),
|
|
50852
|
+
steps: z14.array(WorkflowStepSchema),
|
|
50853
|
+
external_participants: z14.array(ExternalParticipantSchema).default([])
|
|
50817
50854
|
}).passthrough();
|
|
50818
50855
|
|
|
50819
50856
|
// src/schema/dsl.ts
|
|
50820
|
-
var ComponentsSchema =
|
|
50821
|
-
schemas:
|
|
50857
|
+
var ComponentsSchema = z15.object({
|
|
50858
|
+
schemas: z15.record(z15.string(), z15.record(z15.string(), z15.any())).default({})
|
|
50822
50859
|
}).passthrough();
|
|
50823
50860
|
var SCOPE_NODE_TYPES = [
|
|
50824
50861
|
"root",
|
|
@@ -50840,32 +50877,34 @@ var SCOPE_NODE_TYPES = [
|
|
|
50840
50877
|
"escalation_criterion",
|
|
50841
50878
|
"prerequisite"
|
|
50842
50879
|
];
|
|
50843
|
-
var ScopeNodeTypeSchema =
|
|
50844
|
-
var XExtensionDeclSchema =
|
|
50845
|
-
type:
|
|
50846
|
-
items:
|
|
50847
|
-
description:
|
|
50848
|
-
scope:
|
|
50849
|
-
schema:
|
|
50850
|
-
required:
|
|
50851
|
-
});
|
|
50852
|
-
var DslSchema =
|
|
50853
|
-
version:
|
|
50854
|
-
extends:
|
|
50880
|
+
var ScopeNodeTypeSchema = z15.enum(SCOPE_NODE_TYPES);
|
|
50881
|
+
var XExtensionDeclSchema = z15.object({
|
|
50882
|
+
type: z15.string(),
|
|
50883
|
+
items: z15.string().optional(),
|
|
50884
|
+
description: z15.string().optional(),
|
|
50885
|
+
scope: z15.array(ScopeNodeTypeSchema).optional(),
|
|
50886
|
+
schema: z15.record(z15.string(), z15.any()).optional(),
|
|
50887
|
+
required: z15.boolean().default(false)
|
|
50888
|
+
});
|
|
50889
|
+
var DslSchema = z15.object({
|
|
50890
|
+
version: z15.literal(1),
|
|
50891
|
+
extends: z15.string().optional(),
|
|
50855
50892
|
system: SystemSchema,
|
|
50856
|
-
agents:
|
|
50857
|
-
tasks:
|
|
50858
|
-
artifacts:
|
|
50859
|
-
tools:
|
|
50860
|
-
validations:
|
|
50861
|
-
handoff_types:
|
|
50862
|
-
|
|
50863
|
-
|
|
50864
|
-
|
|
50865
|
-
|
|
50893
|
+
agents: z15.record(z15.string(), AgentSchema).default({}),
|
|
50894
|
+
tasks: z15.record(z15.string(), TaskSchema).default({}),
|
|
50895
|
+
artifacts: z15.record(z15.string(), ArtifactSchema).default({}),
|
|
50896
|
+
tools: z15.record(z15.string(), ToolSchema).default({}),
|
|
50897
|
+
validations: z15.record(z15.string(), ValidationSchema).default({}),
|
|
50898
|
+
handoff_types: z15.record(z15.string(), HandoffTypeSchema).default({}),
|
|
50899
|
+
team_interface: TeamInterfaceSchema.optional(),
|
|
50900
|
+
imports: z15.record(z15.string(), TeamImportSchema).optional(),
|
|
50901
|
+
workflow: z15.record(z15.string(), WorkflowSchema).default({}),
|
|
50902
|
+
policies: z15.record(z15.string(), PolicySchema).default({}),
|
|
50903
|
+
guardrails: z15.record(z15.string(), GuardrailSchema).default({}),
|
|
50904
|
+
guardrail_policies: z15.record(z15.string(), GuardrailPolicySchema).default({}),
|
|
50866
50905
|
components: ComponentsSchema.default({ schemas: {} }),
|
|
50867
|
-
extensions:
|
|
50868
|
-
extensions_strict:
|
|
50906
|
+
extensions: z15.record(z15.string(), XExtensionDeclSchema).default({}),
|
|
50907
|
+
extensions_strict: z15.boolean().default(false)
|
|
50869
50908
|
}).passthrough();
|
|
50870
50909
|
|
|
50871
50910
|
// src/schema/json-schema-utils.ts
|
|
@@ -50917,22 +50956,22 @@ function resolveAllOf(schema) {
|
|
|
50917
50956
|
}
|
|
50918
50957
|
|
|
50919
50958
|
// src/schema/merge-operators.ts
|
|
50920
|
-
import { z as
|
|
50921
|
-
var AppendOperatorSchema =
|
|
50922
|
-
$append:
|
|
50959
|
+
import { z as z16 } from "zod";
|
|
50960
|
+
var AppendOperatorSchema = z16.object({
|
|
50961
|
+
$append: z16.record(z16.string(), z16.any())
|
|
50923
50962
|
});
|
|
50924
|
-
var PrependOperatorSchema =
|
|
50925
|
-
$prepend:
|
|
50963
|
+
var PrependOperatorSchema = z16.object({
|
|
50964
|
+
$prepend: z16.record(z16.string(), z16.any())
|
|
50926
50965
|
});
|
|
50927
|
-
var InsertAfterOperatorSchema =
|
|
50928
|
-
$insert_after:
|
|
50929
|
-
after:
|
|
50930
|
-
entries:
|
|
50966
|
+
var InsertAfterOperatorSchema = z16.object({
|
|
50967
|
+
$insert_after: z16.object({
|
|
50968
|
+
after: z16.string(),
|
|
50969
|
+
entries: z16.record(z16.string(), z16.any())
|
|
50931
50970
|
})
|
|
50932
50971
|
});
|
|
50933
|
-
var ReplaceOperatorSchema =
|
|
50934
|
-
var RemoveOperatorSchema =
|
|
50935
|
-
$remove:
|
|
50972
|
+
var ReplaceOperatorSchema = z16.object({ $replace: z16.any() });
|
|
50973
|
+
var RemoveOperatorSchema = z16.object({
|
|
50974
|
+
$remove: z16.array(z16.string())
|
|
50936
50975
|
});
|
|
50937
50976
|
|
|
50938
50977
|
// src/config/loader.ts
|
|
@@ -50941,14 +50980,14 @@ import { resolve, dirname } from "path";
|
|
|
50941
50980
|
import { parse as parseYaml } from "yaml";
|
|
50942
50981
|
|
|
50943
50982
|
// src/config/types.ts
|
|
50944
|
-
import { z as
|
|
50945
|
-
var RenderTargetSchema =
|
|
50946
|
-
template:
|
|
50983
|
+
import { z as z17 } from "zod";
|
|
50984
|
+
var RenderTargetSchema = z17.object({
|
|
50985
|
+
template: z17.string(),
|
|
50947
50986
|
context: ContextTypeSchema,
|
|
50948
|
-
output:
|
|
50949
|
-
include:
|
|
50950
|
-
exclude:
|
|
50951
|
-
skip_empty:
|
|
50987
|
+
output: z17.string(),
|
|
50988
|
+
include: z17.array(z17.string()).optional(),
|
|
50989
|
+
exclude: z17.array(z17.string()).optional(),
|
|
50990
|
+
skip_empty: z17.boolean().optional()
|
|
50952
50991
|
}).refine(
|
|
50953
50992
|
(data) => !(data.include && data.exclude),
|
|
50954
50993
|
{ message: "include and exclude are mutually exclusive" }
|
|
@@ -50961,26 +51000,26 @@ var RenderTargetSchema = z15.object({
|
|
|
50961
51000
|
},
|
|
50962
51001
|
{ message: "include/exclude cannot be used with context: system" }
|
|
50963
51002
|
);
|
|
50964
|
-
var TeamConfigSchema =
|
|
50965
|
-
dsl:
|
|
50966
|
-
bindings:
|
|
50967
|
-
vars:
|
|
50968
|
-
paths:
|
|
50969
|
-
active_guardrail_policy:
|
|
50970
|
-
interface_output:
|
|
50971
|
-
});
|
|
50972
|
-
var AgentContractsConfigSchema =
|
|
50973
|
-
dsl:
|
|
50974
|
-
vars:
|
|
50975
|
-
renders:
|
|
50976
|
-
bindings:
|
|
50977
|
-
active_guardrail_policy:
|
|
50978
|
-
paths:
|
|
50979
|
-
teams:
|
|
51003
|
+
var TeamConfigSchema = z17.object({
|
|
51004
|
+
dsl: z17.string().optional(),
|
|
51005
|
+
bindings: z17.array(z17.string()).default([]),
|
|
51006
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
51007
|
+
paths: z17.record(z17.string(), z17.string()).optional(),
|
|
51008
|
+
active_guardrail_policy: z17.string().optional(),
|
|
51009
|
+
interface_output: z17.string().optional()
|
|
51010
|
+
});
|
|
51011
|
+
var AgentContractsConfigSchema = z17.object({
|
|
51012
|
+
dsl: z17.string().optional(),
|
|
51013
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
51014
|
+
renders: z17.array(RenderTargetSchema).default([]),
|
|
51015
|
+
bindings: z17.array(z17.string()).default([]),
|
|
51016
|
+
active_guardrail_policy: z17.string().optional(),
|
|
51017
|
+
paths: z17.record(z17.string(), z17.string()).optional(),
|
|
51018
|
+
teams: z17.record(z17.string(), TeamConfigSchema).optional()
|
|
50980
51019
|
}).superRefine((data, ctx) => {
|
|
50981
51020
|
if (data.dsl !== void 0 && data.teams !== void 0) {
|
|
50982
51021
|
ctx.addIssue({
|
|
50983
|
-
code:
|
|
51022
|
+
code: z17.ZodIssueCode.custom,
|
|
50984
51023
|
message: "dsl and teams are mutually exclusive",
|
|
50985
51024
|
path: ["teams"]
|
|
50986
51025
|
});
|
|
@@ -50988,7 +51027,7 @@ var AgentContractsConfigSchema = z15.object({
|
|
|
50988
51027
|
}
|
|
50989
51028
|
if (data.dsl === void 0 && data.teams === void 0) {
|
|
50990
51029
|
ctx.addIssue({
|
|
50991
|
-
code:
|
|
51030
|
+
code: z17.ZodIssueCode.custom,
|
|
50992
51031
|
message: "Either dsl or teams must be specified",
|
|
50993
51032
|
path: []
|
|
50994
51033
|
});
|
|
@@ -50999,7 +51038,7 @@ var AgentContractsConfigSchema = z15.object({
|
|
|
50999
51038
|
if (key === "_defaults") continue;
|
|
51000
51039
|
if (team.dsl === void 0) {
|
|
51001
51040
|
ctx.addIssue({
|
|
51002
|
-
code:
|
|
51041
|
+
code: z17.ZodIssueCode.custom,
|
|
51003
51042
|
message: `Team "${key}" must specify dsl`,
|
|
51004
51043
|
path: ["teams", key, "dsl"]
|
|
51005
51044
|
});
|
|
@@ -51673,6 +51712,7 @@ var MERGE_SECTIONS = [
|
|
|
51673
51712
|
"tools",
|
|
51674
51713
|
"validations",
|
|
51675
51714
|
"handoff_types",
|
|
51715
|
+
"imports",
|
|
51676
51716
|
"workflow",
|
|
51677
51717
|
"policies",
|
|
51678
51718
|
"guardrails",
|
|
@@ -52010,16 +52050,16 @@ import { Command as Command2 } from "commander";
|
|
|
52010
52050
|
|
|
52011
52051
|
// src/validator/schema-validator.ts
|
|
52012
52052
|
import Ajv from "ajv";
|
|
52013
|
-
import { z as
|
|
52053
|
+
import { z as z18 } from "zod";
|
|
52014
52054
|
function unwrap(schema) {
|
|
52015
|
-
if (schema instanceof
|
|
52016
|
-
if (schema instanceof
|
|
52017
|
-
if (schema instanceof
|
|
52055
|
+
if (schema instanceof z18.ZodOptional) return unwrap(schema.unwrap());
|
|
52056
|
+
if (schema instanceof z18.ZodDefault) return unwrap(schema.removeDefault());
|
|
52057
|
+
if (schema instanceof z18.ZodNullable) return unwrap(schema.unwrap());
|
|
52018
52058
|
return schema;
|
|
52019
52059
|
}
|
|
52020
52060
|
function checkCustomPropsRecursive(data, schema, path) {
|
|
52021
52061
|
const inner = unwrap(schema);
|
|
52022
|
-
if (inner instanceof
|
|
52062
|
+
if (inner instanceof z18.ZodObject) {
|
|
52023
52063
|
if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
|
|
52024
52064
|
const obj = data;
|
|
52025
52065
|
const shape = inner.shape;
|
|
@@ -52040,7 +52080,7 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
52040
52080
|
}
|
|
52041
52081
|
return diagnostics;
|
|
52042
52082
|
}
|
|
52043
|
-
if (inner instanceof
|
|
52083
|
+
if (inner instanceof z18.ZodRecord) {
|
|
52044
52084
|
if (typeof data !== "object" || data === null || Array.isArray(data)) return [];
|
|
52045
52085
|
const valueSchema = inner._def.valueType;
|
|
52046
52086
|
const diagnostics = [];
|
|
@@ -52049,7 +52089,7 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
52049
52089
|
}
|
|
52050
52090
|
return diagnostics;
|
|
52051
52091
|
}
|
|
52052
|
-
if (inner instanceof
|
|
52092
|
+
if (inner instanceof z18.ZodArray) {
|
|
52053
52093
|
if (!Array.isArray(data)) return [];
|
|
52054
52094
|
const diagnostics = [];
|
|
52055
52095
|
for (let i3 = 0; i3 < data.length; i3++) {
|
|
@@ -52057,14 +52097,14 @@ function checkCustomPropsRecursive(data, schema, path) {
|
|
|
52057
52097
|
}
|
|
52058
52098
|
return diagnostics;
|
|
52059
52099
|
}
|
|
52060
|
-
if (inner instanceof
|
|
52100
|
+
if (inner instanceof z18.ZodDiscriminatedUnion) {
|
|
52061
52101
|
if (typeof data !== "object" || data === null) return [];
|
|
52062
52102
|
const obj = data;
|
|
52063
52103
|
const disc = inner._def.discriminator;
|
|
52064
52104
|
const discValue = obj[disc];
|
|
52065
52105
|
const match = inner.options.find((opt) => {
|
|
52066
52106
|
const shape = opt.shape;
|
|
52067
|
-
return shape[disc] instanceof
|
|
52107
|
+
return shape[disc] instanceof z18.ZodLiteral && shape[disc].value === discValue;
|
|
52068
52108
|
});
|
|
52069
52109
|
if (match) return checkCustomPropsRecursive(data, match, path);
|
|
52070
52110
|
return [];
|
|
@@ -52866,6 +52906,25 @@ function checkReferences(dsl) {
|
|
|
52866
52906
|
}
|
|
52867
52907
|
} else if (step.type === "validation") {
|
|
52868
52908
|
checkExists(step.validation, validationIds, "validations", `workflow.${wfId}.steps[${j2}].validation`);
|
|
52909
|
+
} else if (step.type === "team_task") {
|
|
52910
|
+
const importKeys = dsl.imports !== void 0 ? new Set(Object.keys(dsl.imports)) : null;
|
|
52911
|
+
if (importKeys) {
|
|
52912
|
+
checkExists(
|
|
52913
|
+
step.to_team,
|
|
52914
|
+
importKeys,
|
|
52915
|
+
"imports",
|
|
52916
|
+
`workflow.${wfId}.steps[${j2}].to_team`,
|
|
52917
|
+
"team-import-not-found"
|
|
52918
|
+
);
|
|
52919
|
+
} else {
|
|
52920
|
+
diagnostics.push({
|
|
52921
|
+
path: `workflow.${wfId}.steps[${j2}].to_team`,
|
|
52922
|
+
message: `team_task step references team "${step.to_team}" but dsl.imports is not defined`,
|
|
52923
|
+
code: "team-task-missing-imports"
|
|
52924
|
+
});
|
|
52925
|
+
}
|
|
52926
|
+
checkExists(step.handoff, handoffKinds, "handoff_types", `workflow.${wfId}.steps[${j2}].handoff`);
|
|
52927
|
+
checkExists(step.expects, handoffKinds, "handoff_types", `workflow.${wfId}.steps[${j2}].expects`);
|
|
52869
52928
|
}
|
|
52870
52929
|
}
|
|
52871
52930
|
}
|
|
@@ -53043,6 +53102,48 @@ function checkReferences(dsl) {
|
|
|
53043
53102
|
);
|
|
53044
53103
|
}
|
|
53045
53104
|
}
|
|
53105
|
+
const workflowDefinitionIds = new Set(Object.keys(dsl.workflow));
|
|
53106
|
+
if (dsl.team_interface) {
|
|
53107
|
+
const ti = dsl.team_interface;
|
|
53108
|
+
if (ti.accepts?.workflows) {
|
|
53109
|
+
for (const [wfKey, spec] of Object.entries(ti.accepts.workflows)) {
|
|
53110
|
+
const internalWf = spec.internal_workflow ?? wfKey;
|
|
53111
|
+
checkExists(
|
|
53112
|
+
internalWf,
|
|
53113
|
+
workflowDefinitionIds,
|
|
53114
|
+
"workflow",
|
|
53115
|
+
`team_interface.accepts.workflows.${wfKey}.internal_workflow`,
|
|
53116
|
+
"team-interface-workflow-not-found"
|
|
53117
|
+
);
|
|
53118
|
+
checkExists(
|
|
53119
|
+
spec.input_handoff,
|
|
53120
|
+
handoffKinds,
|
|
53121
|
+
"handoff_types",
|
|
53122
|
+
`team_interface.accepts.workflows.${wfKey}.input_handoff`,
|
|
53123
|
+
"team-interface-handoff-not-found"
|
|
53124
|
+
);
|
|
53125
|
+
checkExists(
|
|
53126
|
+
spec.output_handoff,
|
|
53127
|
+
handoffKinds,
|
|
53128
|
+
"handoff_types",
|
|
53129
|
+
`team_interface.accepts.workflows.${wfKey}.output_handoff`,
|
|
53130
|
+
"team-interface-handoff-not-found"
|
|
53131
|
+
);
|
|
53132
|
+
}
|
|
53133
|
+
}
|
|
53134
|
+
if (ti.exposes?.artifacts) {
|
|
53135
|
+
for (let i3 = 0; i3 < ti.exposes.artifacts.length; i3++) {
|
|
53136
|
+
const artKey = ti.exposes.artifacts[i3];
|
|
53137
|
+
checkExists(
|
|
53138
|
+
artKey,
|
|
53139
|
+
artifactIds,
|
|
53140
|
+
"artifacts",
|
|
53141
|
+
`team_interface.exposes.artifacts[${i3}]`,
|
|
53142
|
+
"team-interface-artifact-not-found"
|
|
53143
|
+
);
|
|
53144
|
+
}
|
|
53145
|
+
}
|
|
53146
|
+
}
|
|
53046
53147
|
return diagnostics;
|
|
53047
53148
|
}
|
|
53048
53149
|
|
|
@@ -56188,9 +56289,90 @@ var renderCommand = new Command4("render").description("Render resolved DSL with
|
|
|
56188
56289
|
);
|
|
56189
56290
|
|
|
56190
56291
|
// src/cli/commands/check.ts
|
|
56292
|
+
import { existsSync, readFileSync } from "fs";
|
|
56293
|
+
import { join as join3 } from "path";
|
|
56191
56294
|
import { Command as Command5 } from "commander";
|
|
56295
|
+
import { parse as parseYaml4, stringify as stringify3 } from "yaml";
|
|
56192
56296
|
import { access as access2 } from "fs/promises";
|
|
56193
56297
|
import { resolve as pathResolve, dirname as dirname6 } from "path";
|
|
56298
|
+
|
|
56299
|
+
// src/interface-generator/generator.ts
|
|
56300
|
+
import { stringify as stringify2 } from "yaml";
|
|
56301
|
+
function buildInterfaceDocument(dsl, generatedAt) {
|
|
56302
|
+
const ti = dsl.team_interface;
|
|
56303
|
+
const doc = {
|
|
56304
|
+
team_id: dsl.system.id,
|
|
56305
|
+
team_name: dsl.system.name,
|
|
56306
|
+
version: ti.version,
|
|
56307
|
+
generated_at: generatedAt
|
|
56308
|
+
};
|
|
56309
|
+
if (ti.description !== void 0) {
|
|
56310
|
+
doc.description = ti.description;
|
|
56311
|
+
}
|
|
56312
|
+
if (ti.accepts?.workflows && Object.keys(ti.accepts.workflows).length > 0) {
|
|
56313
|
+
doc.accepts = { workflows: { ...ti.accepts.workflows } };
|
|
56314
|
+
}
|
|
56315
|
+
const handoffKeys = /* @__PURE__ */ new Set();
|
|
56316
|
+
if (ti.accepts?.workflows) {
|
|
56317
|
+
for (const spec of Object.values(ti.accepts.workflows)) {
|
|
56318
|
+
handoffKeys.add(spec.input_handoff);
|
|
56319
|
+
handoffKeys.add(spec.output_handoff);
|
|
56320
|
+
}
|
|
56321
|
+
}
|
|
56322
|
+
const handoff_types = {};
|
|
56323
|
+
for (const k2 of [...handoffKeys].sort()) {
|
|
56324
|
+
const ht = dsl.handoff_types[k2];
|
|
56325
|
+
if (ht) {
|
|
56326
|
+
const entry = {
|
|
56327
|
+
version: ht.version,
|
|
56328
|
+
schema: ht.schema
|
|
56329
|
+
};
|
|
56330
|
+
if (ht.description !== void 0) {
|
|
56331
|
+
entry.description = ht.description;
|
|
56332
|
+
}
|
|
56333
|
+
handoff_types[k2] = entry;
|
|
56334
|
+
}
|
|
56335
|
+
}
|
|
56336
|
+
if (Object.keys(handoff_types).length > 0) {
|
|
56337
|
+
doc.handoff_types = handoff_types;
|
|
56338
|
+
}
|
|
56339
|
+
const artifactsOut = {};
|
|
56340
|
+
if (ti.exposes?.artifacts) {
|
|
56341
|
+
for (const key of [...ti.exposes.artifacts].sort()) {
|
|
56342
|
+
const art = dsl.artifacts[key];
|
|
56343
|
+
if (art) {
|
|
56344
|
+
const entry = {
|
|
56345
|
+
type: art.type,
|
|
56346
|
+
states: art.states
|
|
56347
|
+
};
|
|
56348
|
+
if (art.description !== void 0) {
|
|
56349
|
+
entry.description = art.description;
|
|
56350
|
+
}
|
|
56351
|
+
artifactsOut[key] = entry;
|
|
56352
|
+
}
|
|
56353
|
+
}
|
|
56354
|
+
}
|
|
56355
|
+
if (Object.keys(artifactsOut).length > 0) {
|
|
56356
|
+
doc.exposes = { artifacts: artifactsOut };
|
|
56357
|
+
}
|
|
56358
|
+
if (ti.constraints !== void 0 && ti.constraints.length > 0) {
|
|
56359
|
+
doc.constraints = ti.constraints;
|
|
56360
|
+
}
|
|
56361
|
+
return doc;
|
|
56362
|
+
}
|
|
56363
|
+
function generateInterface(options) {
|
|
56364
|
+
if (!options.dsl.team_interface) {
|
|
56365
|
+
throw new Error("DSL has no team_interface section");
|
|
56366
|
+
}
|
|
56367
|
+
const doc = buildInterfaceDocument(options.dsl, (/* @__PURE__ */ new Date()).toISOString());
|
|
56368
|
+
const content = options.format === "json" ? `${JSON.stringify(doc, null, 2)}
|
|
56369
|
+
` : `${stringify2(doc, { sortMapEntries: true })}
|
|
56370
|
+
`;
|
|
56371
|
+
const outputPath = options.output ?? "team-interface.yaml";
|
|
56372
|
+
return { outputPath, content };
|
|
56373
|
+
}
|
|
56374
|
+
|
|
56375
|
+
// src/cli/commands/check.ts
|
|
56194
56376
|
var checkCommand = new Command5("check").description("Run full pipeline: resolve \u2192 validate \u2192 lint \u2192 render --check").option("-c, --config <path>", "Path to agent-contracts.config.yaml").option("--team <id>", "Limit to one team (multi-team config only)").option("--format <format>", "Output format (text|json)", "text").option("--quiet", "Suppress output on success", false).option("--strict", "Treat warnings as errors", false).action(
|
|
56195
56377
|
async (opts) => {
|
|
56196
56378
|
let hasErrors = false;
|
|
@@ -56369,6 +56551,33 @@ var checkCommand = new Command5("check").description("Run full pipeline: resolve
|
|
|
56369
56551
|
}
|
|
56370
56552
|
hasErrors = true;
|
|
56371
56553
|
}
|
|
56554
|
+
if (schemaResult.data.team_interface) {
|
|
56555
|
+
const interfacePath = join3(config.configDir, "team-interface.yaml");
|
|
56556
|
+
if (existsSync(interfacePath)) {
|
|
56557
|
+
const result = generateInterface({
|
|
56558
|
+
dsl: schemaResult.data,
|
|
56559
|
+
dryRun: true,
|
|
56560
|
+
format: "yaml"
|
|
56561
|
+
});
|
|
56562
|
+
const existing = readFileSync(interfacePath, "utf8");
|
|
56563
|
+
const normalize = (raw) => {
|
|
56564
|
+
try {
|
|
56565
|
+
const parsed = parseYaml4(raw);
|
|
56566
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
56567
|
+
const { generated_at: _t, ...rest } = parsed;
|
|
56568
|
+
return `${stringify3(rest, { sortMapEntries: true })}
|
|
56569
|
+
`;
|
|
56570
|
+
}
|
|
56571
|
+
} catch {
|
|
56572
|
+
}
|
|
56573
|
+
return raw.trim();
|
|
56574
|
+
};
|
|
56575
|
+
if (normalize(existing) !== normalize(result.content)) {
|
|
56576
|
+
process.stderr.write("Drift detected in team-interface.yaml\n");
|
|
56577
|
+
hasErrors = true;
|
|
56578
|
+
}
|
|
56579
|
+
}
|
|
56580
|
+
}
|
|
56372
56581
|
if (hasErrors) {
|
|
56373
56582
|
process.exit(1);
|
|
56374
56583
|
}
|
|
@@ -56829,6 +57038,32 @@ function resolveBindingRenderOutputPath(output, paths) {
|
|
|
56829
57038
|
});
|
|
56830
57039
|
}
|
|
56831
57040
|
|
|
57041
|
+
// src/cli/commands/generate-interface.ts
|
|
57042
|
+
import { writeFileSync } from "fs";
|
|
57043
|
+
import { resolve as resolve7 } from "path";
|
|
57044
|
+
function runGenerateInterfaceCli(opts) {
|
|
57045
|
+
if (!opts.dsl.team_interface) {
|
|
57046
|
+
process.stderr.write("Error: DSL has no team_interface section.\n");
|
|
57047
|
+
process.exit(1);
|
|
57048
|
+
}
|
|
57049
|
+
const outputPath = resolve7(process.cwd(), opts.output ?? "team-interface.yaml");
|
|
57050
|
+
const result = generateInterface({
|
|
57051
|
+
dsl: opts.dsl,
|
|
57052
|
+
output: outputPath,
|
|
57053
|
+
dryRun: opts.dryRun,
|
|
57054
|
+
format: opts.format
|
|
57055
|
+
});
|
|
57056
|
+
if (opts.dryRun) {
|
|
57057
|
+
process.stdout.write(result.content);
|
|
57058
|
+
return;
|
|
57059
|
+
}
|
|
57060
|
+
writeFileSync(result.outputPath, result.content, "utf8");
|
|
57061
|
+
if (!opts.quiet) {
|
|
57062
|
+
process.stdout.write(`Wrote ${result.outputPath}
|
|
57063
|
+
`);
|
|
57064
|
+
}
|
|
57065
|
+
}
|
|
57066
|
+
|
|
56832
57067
|
// src/cli/commands/generate-guardrails.ts
|
|
56833
57068
|
function resolvedConfigForTeam(workspace, teamConfig) {
|
|
56834
57069
|
return {
|
|
@@ -56841,10 +57076,22 @@ function resolvedConfigForTeam(workspace, teamConfig) {
|
|
|
56841
57076
|
paths: teamConfig.paths
|
|
56842
57077
|
};
|
|
56843
57078
|
}
|
|
56844
|
-
var generateGuardrailsCommand = new Command6("generate").description("Generate guardrail runtime artifacts from DSL, policies, and bindings").argument("[type]", "Type of artifacts to generate", "guardrails").option("-c, --config <path>", "Path to agent-contracts.config.yaml").option("--team <id>", "Limit to one team (multi-team config only)").option("--binding <name...>", "Filter to specific software binding(s)").option(
|
|
57079
|
+
var generateGuardrailsCommand = new Command6("generate").description("Generate guardrail runtime artifacts from DSL, policies, and bindings").argument("[type]", "Type of artifacts to generate (guardrails|interface)", "guardrails").option("-c, --config <path>", "Path to agent-contracts.config.yaml").option("--team <id>", "Limit to one team (multi-team config only)").option("--binding <name...>", "Filter to specific software binding(s)").option(
|
|
57080
|
+
"-o, --output <path>",
|
|
57081
|
+
"Output path for generated team interface (interface type only)"
|
|
57082
|
+
).option(
|
|
57083
|
+
"--format <format>",
|
|
57084
|
+
"Output format for team interface: yaml or json",
|
|
57085
|
+
"yaml"
|
|
57086
|
+
).option("--dry-run", "Print what would be generated without writing files", false).option("--quiet", "Suppress output on success", false).action(
|
|
56845
57087
|
async (type, opts) => {
|
|
56846
|
-
if (type !== "guardrails") {
|
|
57088
|
+
if (type !== "guardrails" && type !== "interface") {
|
|
56847
57089
|
process.stderr.write(`Unknown generate type: ${type}
|
|
57090
|
+
`);
|
|
57091
|
+
process.exit(1);
|
|
57092
|
+
}
|
|
57093
|
+
if (type === "interface" && opts.format !== "yaml" && opts.format !== "json") {
|
|
57094
|
+
process.stderr.write(`Invalid --format: expected yaml or json, got ${opts.format}
|
|
56848
57095
|
`);
|
|
56849
57096
|
process.exit(1);
|
|
56850
57097
|
}
|
|
@@ -56874,6 +57121,16 @@ var generateGuardrailsCommand = new Command6("generate").description("Generate g
|
|
|
56874
57121
|
exitWithError = true;
|
|
56875
57122
|
continue;
|
|
56876
57123
|
}
|
|
57124
|
+
if (type === "interface") {
|
|
57125
|
+
runGenerateInterfaceCli({
|
|
57126
|
+
dsl: schemaResult2.data,
|
|
57127
|
+
output: teamConfig.interfaceOutput ?? opts.output,
|
|
57128
|
+
dryRun: opts.dryRun,
|
|
57129
|
+
format: opts.format,
|
|
57130
|
+
quiet: opts.quiet
|
|
57131
|
+
});
|
|
57132
|
+
continue;
|
|
57133
|
+
}
|
|
56877
57134
|
const loadedBindings2 = await loadBindings(teamConfig.bindings);
|
|
56878
57135
|
const result2 = await generateGuardrails({
|
|
56879
57136
|
dsl: schemaResult2.data,
|
|
@@ -56932,6 +57189,16 @@ var generateGuardrailsCommand = new Command6("generate").description("Generate g
|
|
|
56932
57189
|
);
|
|
56933
57190
|
process.exit(1);
|
|
56934
57191
|
}
|
|
57192
|
+
if (type === "interface") {
|
|
57193
|
+
runGenerateInterfaceCli({
|
|
57194
|
+
dsl: schemaResult.data,
|
|
57195
|
+
output: opts.output,
|
|
57196
|
+
dryRun: opts.dryRun,
|
|
57197
|
+
format: opts.format,
|
|
57198
|
+
quiet: opts.quiet
|
|
57199
|
+
});
|
|
57200
|
+
return;
|
|
57201
|
+
}
|
|
56935
57202
|
const loadedBindings = await loadBindings(config.bindings);
|
|
56936
57203
|
const result = await generateGuardrails({
|
|
56937
57204
|
dsl: schemaResult.data,
|
|
@@ -57423,7 +57690,7 @@ ${issues}
|
|
|
57423
57690
|
|
|
57424
57691
|
// src/cli/cli.ts
|
|
57425
57692
|
var __dirname = dirname8(fileURLToPath(import.meta.url));
|
|
57426
|
-
var pkg = JSON.parse(
|
|
57693
|
+
var pkg = JSON.parse(readFileSync2(resolve8(__dirname, "../package.json"), "utf8"));
|
|
57427
57694
|
var program = new Command8();
|
|
57428
57695
|
program.name("agent-contracts").description("Agent contracts tooling \u2014 validate, lint, render DSL files").version(pkg.version);
|
|
57429
57696
|
program.addCommand(resolveCommand);
|