agent-contracts 0.23.2 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +11 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -55310,6 +55310,12 @@ function expandOutputPath(pattern, context, entityId, entity) {
|
|
|
55310
55310
|
}
|
|
55311
55311
|
);
|
|
55312
55312
|
}
|
|
55313
|
+
var CONTEXT_TYPE_PATTERN = new RegExp(
|
|
55314
|
+
`\\{(${CONTEXT_TYPES.join("|")})\\.[^}]+\\}`
|
|
55315
|
+
);
|
|
55316
|
+
function hasUnresolvedPathVars(path) {
|
|
55317
|
+
return CONTEXT_TYPE_PATTERN.test(path);
|
|
55318
|
+
}
|
|
55313
55319
|
function buildEntityContext(dsl, context, entityId) {
|
|
55314
55320
|
switch (context) {
|
|
55315
55321
|
case "agent": {
|
|
@@ -55375,6 +55381,7 @@ async function renderFromConfig(dsl, renderTargets, options) {
|
|
|
55375
55381
|
const output = compiled(ctx);
|
|
55376
55382
|
const entity = section[entityId];
|
|
55377
55383
|
const outputPath = expandOutputPath(target.output, target.context, entityId, entity);
|
|
55384
|
+
if (hasUnresolvedPathVars(outputPath)) continue;
|
|
55378
55385
|
if (target.skip_empty && isEffectivelyEmpty(output)) {
|
|
55379
55386
|
await removeIfExists(outputPath);
|
|
55380
55387
|
continue;
|
|
@@ -55425,6 +55432,7 @@ async function checkDriftFromConfig(dsl, renderTargets, options) {
|
|
|
55425
55432
|
const expected = compiled(ctx);
|
|
55426
55433
|
const entity = section[entityId];
|
|
55427
55434
|
const outputPath = expandOutputPath(target.output, target.context, entityId, entity);
|
|
55435
|
+
if (hasUnresolvedPathVars(outputPath)) continue;
|
|
55428
55436
|
await checkExpectedVsExisting(expected, outputPath, target.skip_empty, diffs);
|
|
55429
55437
|
}
|
|
55430
55438
|
}
|
|
@@ -56147,10 +56155,9 @@ async function generateGuardrails(options) {
|
|
|
56147
56155
|
const mergedCtx = { ...entityCtx, vars, paths, binding, resolved_checks: checkResult.resolved };
|
|
56148
56156
|
const rendered = compiled(mergedCtx);
|
|
56149
56157
|
const entity = section[entityId];
|
|
56150
|
-
const
|
|
56151
|
-
|
|
56152
|
-
|
|
56153
|
-
);
|
|
56158
|
+
const expandedOutput = expandOutputPath(renderTarget.output, context, entityId, entity);
|
|
56159
|
+
if (hasUnresolvedPathVars(expandedOutput)) continue;
|
|
56160
|
+
const resolvedOutput = resolveBindingRenderOutputPath(expandedOutput, paths);
|
|
56154
56161
|
const outputPath = resolve6(config.configDir, resolvedOutput);
|
|
56155
56162
|
if (shouldSkipEmpty && rendered.trim().length === 0) {
|
|
56156
56163
|
if (!dryRun) {
|