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/index.js
CHANGED
|
@@ -54181,6 +54181,12 @@ function expandOutputPath(pattern, context, entityId, entity) {
|
|
|
54181
54181
|
}
|
|
54182
54182
|
);
|
|
54183
54183
|
}
|
|
54184
|
+
var CONTEXT_TYPE_PATTERN = new RegExp(
|
|
54185
|
+
`\\{(${CONTEXT_TYPES.join("|")})\\.[^}]+\\}`
|
|
54186
|
+
);
|
|
54187
|
+
function hasUnresolvedPathVars(path) {
|
|
54188
|
+
return CONTEXT_TYPE_PATTERN.test(path);
|
|
54189
|
+
}
|
|
54184
54190
|
function buildEntityContext(dsl, context, entityId) {
|
|
54185
54191
|
switch (context) {
|
|
54186
54192
|
case "agent": {
|
|
@@ -54246,6 +54252,7 @@ async function renderFromConfig(dsl, renderTargets, options) {
|
|
|
54246
54252
|
const output = compiled(ctx);
|
|
54247
54253
|
const entity = section[entityId];
|
|
54248
54254
|
const outputPath = expandOutputPath(target.output, target.context, entityId, entity);
|
|
54255
|
+
if (hasUnresolvedPathVars(outputPath)) continue;
|
|
54249
54256
|
if (target.skip_empty && isEffectivelyEmpty(output)) {
|
|
54250
54257
|
await removeIfExists(outputPath);
|
|
54251
54258
|
continue;
|
|
@@ -54296,6 +54303,7 @@ async function checkDriftFromConfig(dsl, renderTargets, options) {
|
|
|
54296
54303
|
const expected = compiled(ctx);
|
|
54297
54304
|
const entity = section[entityId];
|
|
54298
54305
|
const outputPath = expandOutputPath(target.output, target.context, entityId, entity);
|
|
54306
|
+
if (hasUnresolvedPathVars(outputPath)) continue;
|
|
54299
54307
|
await checkExpectedVsExisting(expected, outputPath, target.skip_empty, diffs);
|
|
54300
54308
|
}
|
|
54301
54309
|
}
|
|
@@ -56294,10 +56302,9 @@ async function generateGuardrails(options) {
|
|
|
56294
56302
|
const mergedCtx = { ...entityCtx, vars, paths, binding, resolved_checks: checkResult.resolved };
|
|
56295
56303
|
const rendered = compiled(mergedCtx);
|
|
56296
56304
|
const entity = section[entityId];
|
|
56297
|
-
const
|
|
56298
|
-
|
|
56299
|
-
|
|
56300
|
-
);
|
|
56305
|
+
const expandedOutput = expandOutputPath(renderTarget.output, context, entityId, entity);
|
|
56306
|
+
if (hasUnresolvedPathVars(expandedOutput)) continue;
|
|
56307
|
+
const resolvedOutput = resolveBindingRenderOutputPath(expandedOutput, paths);
|
|
56301
56308
|
const outputPath = resolve6(config.configDir, resolvedOutput);
|
|
56302
56309
|
if (shouldSkipEmpty && rendered.trim().length === 0) {
|
|
56303
56310
|
if (!dryRun) {
|