agent-contracts 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -97,29 +97,31 @@ type Artifact = z.infer<typeof ArtifactSchema>;
97
97
  declare const MatcherSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
98
98
  type: z.ZodLiteral<"command_regex">;
99
99
  pattern: z.ZodString;
100
- }, z.core.$strip>, z.ZodObject<{
100
+ }, z.core.$loose>, z.ZodObject<{
101
101
  type: z.ZodLiteral<"content_regex">;
102
102
  pattern: z.ZodString;
103
103
  file_glob: z.ZodOptional<z.ZodString>;
104
104
  exclude_glob: z.ZodOptional<z.ZodString>;
105
- }, z.core.$strip>, z.ZodObject<{
105
+ }, z.core.$loose>, z.ZodObject<{
106
106
  type: z.ZodLiteral<"file_glob">;
107
107
  pattern: z.ZodString;
108
- }, z.core.$strip>], "type">;
108
+ exclude_glob: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$loose>], "type">;
109
110
  type Matcher = z.infer<typeof MatcherSchema>;
110
111
  declare const CheckSchema: z.ZodObject<{
111
112
  matcher: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
112
113
  type: z.ZodLiteral<"command_regex">;
113
114
  pattern: z.ZodString;
114
- }, z.core.$strip>, z.ZodObject<{
115
+ }, z.core.$loose>, z.ZodObject<{
115
116
  type: z.ZodLiteral<"content_regex">;
116
117
  pattern: z.ZodString;
117
118
  file_glob: z.ZodOptional<z.ZodString>;
118
119
  exclude_glob: z.ZodOptional<z.ZodString>;
119
- }, z.core.$strip>, z.ZodObject<{
120
+ }, z.core.$loose>, z.ZodObject<{
120
121
  type: z.ZodLiteral<"file_glob">;
121
122
  pattern: z.ZodString;
122
- }, z.core.$strip>], "type">>;
123
+ exclude_glob: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$loose>], "type">>;
123
125
  script: z.ZodOptional<z.ZodString>;
124
126
  message: z.ZodOptional<z.ZodString>;
125
127
  }, z.core.$loose>;
@@ -151,15 +153,16 @@ declare const SoftwareBindingSchema: z.ZodObject<{
151
153
  matcher: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
152
154
  type: z.ZodLiteral<"command_regex">;
153
155
  pattern: z.ZodString;
154
- }, z.core.$strip>, z.ZodObject<{
156
+ }, z.core.$loose>, z.ZodObject<{
155
157
  type: z.ZodLiteral<"content_regex">;
156
158
  pattern: z.ZodString;
157
159
  file_glob: z.ZodOptional<z.ZodString>;
158
160
  exclude_glob: z.ZodOptional<z.ZodString>;
159
- }, z.core.$strip>, z.ZodObject<{
161
+ }, z.core.$loose>, z.ZodObject<{
160
162
  type: z.ZodLiteral<"file_glob">;
161
163
  pattern: z.ZodString;
162
- }, z.core.$strip>], "type">>;
164
+ exclude_glob: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$loose>], "type">>;
163
166
  script: z.ZodOptional<z.ZodString>;
164
167
  message: z.ZodOptional<z.ZodString>;
165
168
  }, z.core.$loose>>;
package/dist/index.js CHANGED
@@ -158,11 +158,11 @@ function __metadata(metadataKey, metadataValue) {
158
158
  }
159
159
  function __awaiter(thisArg, _arguments, P2, generator) {
160
160
  function adopt(value) {
161
- return value instanceof P2 ? value : new P2(function(resolve6) {
162
- resolve6(value);
161
+ return value instanceof P2 ? value : new P2(function(resolve7) {
162
+ resolve7(value);
163
163
  });
164
164
  }
165
- return new (P2 || (P2 = Promise))(function(resolve6, reject) {
165
+ return new (P2 || (P2 = Promise))(function(resolve7, reject) {
166
166
  function fulfilled(value) {
167
167
  try {
168
168
  step(generator.next(value));
@@ -178,7 +178,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
178
178
  }
179
179
  }
180
180
  function step(result) {
181
- result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
181
+ result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected);
182
182
  }
183
183
  step((generator = generator.apply(thisArg, _arguments || [])).next());
184
184
  });
@@ -369,14 +369,14 @@ function __asyncValues(o3) {
369
369
  }, i3);
370
370
  function verb(n3) {
371
371
  i3[n3] = o3[n3] && function(v2) {
372
- return new Promise(function(resolve6, reject) {
373
- v2 = o3[n3](v2), settle(resolve6, reject, v2.done, v2.value);
372
+ return new Promise(function(resolve7, reject) {
373
+ v2 = o3[n3](v2), settle(resolve7, reject, v2.done, v2.value);
374
374
  });
375
375
  };
376
376
  }
377
- function settle(resolve6, reject, d2, v2) {
377
+ function settle(resolve7, reject, d2, v2) {
378
378
  Promise.resolve(v2).then(function(v3) {
379
- resolve6({ value: v3, done: d2 });
379
+ resolve7({ value: v3, done: d2 });
380
380
  }, reject);
381
381
  }
382
382
  }
@@ -13032,11 +13032,11 @@ function __metadata2(metadataKey, metadataValue) {
13032
13032
  }
13033
13033
  function __awaiter2(thisArg, _arguments, P2, generator) {
13034
13034
  function adopt(value) {
13035
- return value instanceof P2 ? value : new P2(function(resolve6) {
13036
- resolve6(value);
13035
+ return value instanceof P2 ? value : new P2(function(resolve7) {
13036
+ resolve7(value);
13037
13037
  });
13038
13038
  }
13039
- return new (P2 || (P2 = Promise))(function(resolve6, reject) {
13039
+ return new (P2 || (P2 = Promise))(function(resolve7, reject) {
13040
13040
  function fulfilled(value) {
13041
13041
  try {
13042
13042
  step(generator.next(value));
@@ -13052,7 +13052,7 @@ function __awaiter2(thisArg, _arguments, P2, generator) {
13052
13052
  }
13053
13053
  }
13054
13054
  function step(result) {
13055
- result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
13055
+ result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected);
13056
13056
  }
13057
13057
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13058
13058
  });
@@ -13230,14 +13230,14 @@ function __asyncValues2(o3) {
13230
13230
  }, i3);
13231
13231
  function verb(n3) {
13232
13232
  i3[n3] = o3[n3] && function(v2) {
13233
- return new Promise(function(resolve6, reject) {
13234
- v2 = o3[n3](v2), settle(resolve6, reject, v2.done, v2.value);
13233
+ return new Promise(function(resolve7, reject) {
13234
+ v2 = o3[n3](v2), settle(resolve7, reject, v2.done, v2.value);
13235
13235
  });
13236
13236
  };
13237
13237
  }
13238
- function settle(resolve6, reject, d2, v2) {
13238
+ function settle(resolve7, reject, d2, v2) {
13239
13239
  Promise.resolve(v2).then(function(v3) {
13240
- resolve6({ value: v3, done: d2 });
13240
+ resolve7({ value: v3, done: d2 });
13241
13241
  }, reject);
13242
13242
  }
13243
13243
  }
@@ -15151,7 +15151,7 @@ function consumeBody() {
15151
15151
  let accum = [];
15152
15152
  let accumBytes = 0;
15153
15153
  let abort = false;
15154
- return new Body.Promise(function(resolve6, reject) {
15154
+ return new Body.Promise(function(resolve7, reject) {
15155
15155
  let resTimeout;
15156
15156
  if (_this4.timeout) {
15157
15157
  resTimeout = setTimeout(function() {
@@ -15185,7 +15185,7 @@ function consumeBody() {
15185
15185
  }
15186
15186
  clearTimeout(resTimeout);
15187
15187
  try {
15188
- resolve6(Buffer.concat(accum, accumBytes));
15188
+ resolve7(Buffer.concat(accum, accumBytes));
15189
15189
  } catch (err) {
15190
15190
  reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
15191
15191
  }
@@ -15448,7 +15448,7 @@ function fetch(url, opts) {
15448
15448
  throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
15449
15449
  }
15450
15450
  Body.Promise = fetch.Promise;
15451
- return new fetch.Promise(function(resolve6, reject) {
15451
+ return new fetch.Promise(function(resolve7, reject) {
15452
15452
  const request = new Request(url, opts);
15453
15453
  const options = getNodeRequestOptions(request);
15454
15454
  const send = (options.protocol === "https:" ? https : http).request;
@@ -15581,7 +15581,7 @@ function fetch(url, opts) {
15581
15581
  requestOpts.body = void 0;
15582
15582
  requestOpts.headers.delete("content-length");
15583
15583
  }
15584
- resolve6(fetch(new Request(locationURL, requestOpts)));
15584
+ resolve7(fetch(new Request(locationURL, requestOpts)));
15585
15585
  finalize();
15586
15586
  return;
15587
15587
  }
@@ -15602,7 +15602,7 @@ function fetch(url, opts) {
15602
15602
  const codings = headers.get("Content-Encoding");
15603
15603
  if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
15604
15604
  response = new Response(body, response_options);
15605
- resolve6(response);
15605
+ resolve7(response);
15606
15606
  return;
15607
15607
  }
15608
15608
  const zlibOptions = {
@@ -15612,7 +15612,7 @@ function fetch(url, opts) {
15612
15612
  if (codings == "gzip" || codings == "x-gzip") {
15613
15613
  body = body.pipe(zlib.createGunzip(zlibOptions));
15614
15614
  response = new Response(body, response_options);
15615
- resolve6(response);
15615
+ resolve7(response);
15616
15616
  return;
15617
15617
  }
15618
15618
  if (codings == "deflate" || codings == "x-deflate") {
@@ -15624,12 +15624,12 @@ function fetch(url, opts) {
15624
15624
  body = body.pipe(zlib.createInflateRaw());
15625
15625
  }
15626
15626
  response = new Response(body, response_options);
15627
- resolve6(response);
15627
+ resolve7(response);
15628
15628
  });
15629
15629
  raw.on("end", function() {
15630
15630
  if (!response) {
15631
15631
  response = new Response(body, response_options);
15632
- resolve6(response);
15632
+ resolve7(response);
15633
15633
  }
15634
15634
  });
15635
15635
  return;
@@ -15637,11 +15637,11 @@ function fetch(url, opts) {
15637
15637
  if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
15638
15638
  body = body.pipe(zlib.createBrotliDecompress());
15639
15639
  response = new Response(body, response_options);
15640
- resolve6(response);
15640
+ resolve7(response);
15641
15641
  return;
15642
15642
  }
15643
15643
  response = new Response(body, response_options);
15644
- resolve6(response);
15644
+ resolve7(response);
15645
15645
  });
15646
15646
  writeToStream(req, request);
15647
15647
  });
@@ -16354,13 +16354,13 @@ var require_file = __commonJS({
16354
16354
  Object.defineProperty(exports, "__esModule", { value: true });
16355
16355
  var fs_1 = __require("fs");
16356
16356
  function resolveFile(ref) {
16357
- return new Promise((resolve6, reject) => {
16357
+ return new Promise((resolve7, reject) => {
16358
16358
  const path = ref.href();
16359
16359
  fs_1.readFile(path, "utf8", (err, data) => {
16360
16360
  if (err) {
16361
16361
  reject(err);
16362
16362
  } else {
16363
- resolve6(data);
16363
+ resolve7(data);
16364
16364
  }
16365
16365
  });
16366
16366
  });
@@ -23963,12 +23963,12 @@ var require_reader = __commonJS({
23963
23963
  }
23964
23964
  } else {
23965
23965
  try {
23966
- return await new Promise((resolve6, reject) => {
23966
+ return await new Promise((resolve7, reject) => {
23967
23967
  fs.readFile(name, opts.encoding, (err, data) => {
23968
23968
  if (err !== null) {
23969
23969
  reject(err);
23970
23970
  } else {
23971
- resolve6(data);
23971
+ resolve7(data);
23972
23972
  }
23973
23973
  });
23974
23974
  });
@@ -40853,14 +40853,14 @@ var require_AsyncFromSyncIteratorContinuation = __commonJS({
40853
40853
  if (!$Promise) {
40854
40854
  throw new $SyntaxError("This environment does not support Promises.");
40855
40855
  }
40856
- return new $Promise(function(resolve6) {
40856
+ return new $Promise(function(resolve7) {
40857
40857
  var done = IteratorComplete(result);
40858
40858
  var value = IteratorValue(result);
40859
40859
  var valueWrapper = PromiseResolve($Promise, value);
40860
40860
  var onFulfilled = function(value2) {
40861
40861
  return CreateIteratorResultObject(value2, done);
40862
40862
  };
40863
- resolve6($then(valueWrapper, onFulfilled));
40863
+ resolve7($then(valueWrapper, onFulfilled));
40864
40864
  });
40865
40865
  };
40866
40866
  }
@@ -41408,7 +41408,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41408
41408
  var O2 = this;
41409
41409
  SLOT.assert(O2, "[[SyncIteratorRecord]]");
41410
41410
  var argsLength = arguments.length;
41411
- return new $Promise(function(resolve6) {
41411
+ return new $Promise(function(resolve7) {
41412
41412
  var syncIteratorRecord = SLOT.get(O2, "[[SyncIteratorRecord]]");
41413
41413
  var result;
41414
41414
  if (argsLength > 0) {
@@ -41416,7 +41416,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41416
41416
  } else {
41417
41417
  result = IteratorNext(syncIteratorRecord);
41418
41418
  }
41419
- resolve6(AsyncFromSyncIteratorContinuation(result));
41419
+ resolve7(AsyncFromSyncIteratorContinuation(result));
41420
41420
  });
41421
41421
  },
41422
41422
  "return": function() {
@@ -41427,12 +41427,12 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41427
41427
  SLOT.assert(O2, "[[SyncIteratorRecord]]");
41428
41428
  var valueIsPresent = arguments.length > 0;
41429
41429
  var value = valueIsPresent ? arguments[0] : void 0;
41430
- return new $Promise(function(resolve6, reject) {
41430
+ return new $Promise(function(resolve7, reject) {
41431
41431
  var syncIterator = SLOT.get(O2, "[[SyncIteratorRecord]]")["[[Iterator]]"];
41432
41432
  var iteratorReturn = GetMethod(syncIterator, "return");
41433
41433
  if (typeof iteratorReturn === "undefined") {
41434
41434
  var iterResult = CreateIteratorResultObject(value, true);
41435
- Call(resolve6, void 0, [iterResult]);
41435
+ Call(resolve7, void 0, [iterResult]);
41436
41436
  return;
41437
41437
  }
41438
41438
  var result;
@@ -41445,7 +41445,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41445
41445
  Call(reject, void 0, [new $TypeError("Iterator `return` method returned a non-object value.")]);
41446
41446
  return;
41447
41447
  }
41448
- resolve6(AsyncFromSyncIteratorContinuation(result));
41448
+ resolve7(AsyncFromSyncIteratorContinuation(result));
41449
41449
  });
41450
41450
  },
41451
41451
  "throw": function() {
@@ -41456,7 +41456,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41456
41456
  SLOT.assert(O2, "[[SyncIteratorRecord]]");
41457
41457
  var valueIsPresent = arguments.length > 0;
41458
41458
  var value = valueIsPresent ? arguments[0] : void 0;
41459
- return new $Promise(function(resolve6, reject) {
41459
+ return new $Promise(function(resolve7, reject) {
41460
41460
  var syncIterator = SLOT.get(O2, "[[SyncIteratorRecord]]")["[[Iterator]]"];
41461
41461
  var throwMethod = GetMethod(syncIterator, "throw");
41462
41462
  if (typeof throwMethod === "undefined") {
@@ -41473,7 +41473,7 @@ var require_CreateAsyncFromSyncIterator = __commonJS({
41473
41473
  Call(reject, void 0, [new $TypeError("Iterator `throw` method returned a non-object value.")]);
41474
41474
  return;
41475
41475
  }
41476
- resolve6(AsyncFromSyncIteratorContinuation(
41476
+ resolve7(AsyncFromSyncIteratorContinuation(
41477
41477
  result
41478
41478
  /* , promiseCapability */
41479
41479
  ));
@@ -50485,17 +50485,18 @@ import { z as z3 } from "zod";
50485
50485
  var CommandRegexMatcherSchema = z3.object({
50486
50486
  type: z3.literal("command_regex"),
50487
50487
  pattern: z3.string()
50488
- });
50488
+ }).passthrough();
50489
50489
  var ContentRegexMatcherSchema = z3.object({
50490
50490
  type: z3.literal("content_regex"),
50491
50491
  pattern: z3.string(),
50492
50492
  file_glob: z3.string().optional(),
50493
50493
  exclude_glob: z3.string().optional()
50494
- });
50494
+ }).passthrough();
50495
50495
  var FileGlobMatcherSchema = z3.object({
50496
50496
  type: z3.literal("file_glob"),
50497
- pattern: z3.string()
50498
- });
50497
+ pattern: z3.string(),
50498
+ exclude_glob: z3.string().optional()
50499
+ }).passthrough();
50499
50500
  var MatcherSchema = z3.discriminatedUnion("type", [
50500
50501
  CommandRegexMatcherSchema,
50501
50502
  ContentRegexMatcherSchema,
@@ -54021,6 +54022,8 @@ async function checkDriftFromConfig(dsl, renderTargets) {
54021
54022
 
54022
54023
  // src/config/binding-loader.ts
54023
54024
  import { readFile as readFile4 } from "fs/promises";
54025
+ import { dirname as dirname5, resolve as resolve5 } from "path";
54026
+ import { stat as stat2 } from "fs/promises";
54024
54027
  import { parse as parseYaml3 } from "yaml";
54025
54028
 
54026
54029
  // src/config/loader.ts
@@ -54158,30 +54161,130 @@ function resolveDslPath(dirArg, dirArgDefault, config) {
54158
54161
  return resolve4(dirArgDefault);
54159
54162
  }
54160
54163
 
54164
+ // src/config/binding-merger.ts
54165
+ function isRecord3(v2) {
54166
+ return typeof v2 === "object" && v2 !== null && !Array.isArray(v2);
54167
+ }
54168
+ var BINDING_MERGE_SECTIONS = ["guardrail_impl", "outputs"];
54169
+ function mergeBinding(base, project) {
54170
+ const hasExtends = typeof project["extends"] === "string";
54171
+ const result = { ...base, ...project };
54172
+ for (const section of BINDING_MERGE_SECTIONS) {
54173
+ const baseVal = base[section];
54174
+ const projVal = project[section];
54175
+ if (projVal === void 0) {
54176
+ continue;
54177
+ }
54178
+ const baseMap = isRecord3(baseVal) ? baseVal : {};
54179
+ result[section] = mergeEntityMaps(
54180
+ baseMap,
54181
+ projVal,
54182
+ section,
54183
+ hasExtends
54184
+ );
54185
+ }
54186
+ if (project["reporting"] !== void 0 && isRecord3(base["reporting"]) && isRecord3(project["reporting"])) {
54187
+ result["reporting"] = deepMergeEntities(
54188
+ base["reporting"],
54189
+ project["reporting"],
54190
+ "reporting",
54191
+ hasExtends
54192
+ );
54193
+ }
54194
+ delete result["extends"];
54195
+ return result;
54196
+ }
54197
+
54161
54198
  // src/config/binding-loader.ts
54162
- async function loadBindings(bindingPaths) {
54163
- const results = [];
54164
- for (const filePath of bindingPaths) {
54165
- let content;
54199
+ async function loadRawBinding(filePath) {
54200
+ let content;
54201
+ try {
54202
+ content = await readFile4(filePath, "utf8");
54203
+ } catch {
54204
+ throw new ConfigLoadError(
54205
+ `Failed to read binding file: ${filePath}`,
54206
+ filePath
54207
+ );
54208
+ }
54209
+ try {
54210
+ return parseYaml3(content);
54211
+ } catch (err) {
54212
+ const msg = err instanceof Error ? err.message : String(err);
54213
+ throw new ConfigLoadError(
54214
+ `Invalid YAML syntax in binding file ${filePath}: ${msg}`,
54215
+ filePath
54216
+ );
54217
+ }
54218
+ }
54219
+ async function resolveBindingExtends(raw, filePath, seen) {
54220
+ const extendsValue = raw["extends"];
54221
+ if (typeof extendsValue !== "string") {
54222
+ return raw;
54223
+ }
54224
+ const bindingDir = dirname5(filePath);
54225
+ let basePath;
54226
+ if (extendsValue.startsWith("./") || extendsValue.startsWith("../")) {
54227
+ basePath = resolve5(bindingDir, extendsValue);
54228
+ } else {
54166
54229
  try {
54167
- content = await readFile4(filePath, "utf8");
54230
+ const resolved = import.meta.resolve(extendsValue);
54231
+ basePath = new URL(resolved).pathname;
54168
54232
  } catch {
54169
54233
  throw new ConfigLoadError(
54170
- `Failed to read binding file: ${filePath}`,
54234
+ `Could not resolve binding extends package: ${extendsValue}`,
54171
54235
  filePath
54172
54236
  );
54173
54237
  }
54174
- let raw;
54175
- try {
54176
- raw = parseYaml3(content);
54177
- } catch (err) {
54178
- const msg = err instanceof Error ? err.message : String(err);
54179
- throw new ConfigLoadError(
54180
- `Invalid YAML syntax in binding file ${filePath}: ${msg}`,
54181
- filePath
54182
- );
54238
+ }
54239
+ try {
54240
+ const s2 = await stat2(basePath);
54241
+ if (s2.isDirectory()) {
54242
+ const candidates = ["binding.yaml", "binding.yml"];
54243
+ let found = false;
54244
+ for (const name of candidates) {
54245
+ const candidate = resolve5(basePath, name);
54246
+ try {
54247
+ const cs = await stat2(candidate);
54248
+ if (cs.isFile()) {
54249
+ basePath = candidate;
54250
+ found = true;
54251
+ break;
54252
+ }
54253
+ } catch {
54254
+ continue;
54255
+ }
54256
+ }
54257
+ if (!found) {
54258
+ throw new ConfigLoadError(
54259
+ `No binding.yaml found in directory: ${basePath}`,
54260
+ filePath
54261
+ );
54262
+ }
54183
54263
  }
54184
- const result = SoftwareBindingSchema.safeParse(raw);
54264
+ } catch (err) {
54265
+ if (err instanceof ConfigLoadError) throw err;
54266
+ throw new ConfigLoadError(
54267
+ `Base binding path not found: ${basePath}`,
54268
+ filePath
54269
+ );
54270
+ }
54271
+ if (seen.has(basePath)) {
54272
+ throw new ConfigLoadError(
54273
+ `Circular binding extends detected: ${basePath}`,
54274
+ filePath
54275
+ );
54276
+ }
54277
+ seen.add(basePath);
54278
+ const baseRaw = await loadRawBinding(basePath);
54279
+ const resolvedBase = await resolveBindingExtends(baseRaw, basePath, seen);
54280
+ return mergeBinding(resolvedBase, raw);
54281
+ }
54282
+ async function loadBindings(bindingPaths) {
54283
+ const results = [];
54284
+ for (const filePath of bindingPaths) {
54285
+ const raw = await loadRawBinding(filePath);
54286
+ const merged = await resolveBindingExtends(raw, filePath, /* @__PURE__ */ new Set([filePath]));
54287
+ const result = SoftwareBindingSchema.safeParse(merged);
54185
54288
  if (!result.success) {
54186
54289
  const issues = result.error.issues.map((i3) => ` ${i3.path.join(".")}: ${i3.message}`).join("\n");
54187
54290
  throw new ConfigLoadError(
@@ -54197,7 +54300,7 @@ ${issues}`,
54197
54300
 
54198
54301
  // src/guardrail-generator/generator.ts
54199
54302
  import { readFile as readFile5, writeFile as writeFile2, mkdir as mkdir2, chmod } from "fs/promises";
54200
- import { resolve as resolve5, dirname as dirname5 } from "path";
54303
+ import { resolve as resolve6, dirname as dirname6 } from "path";
54201
54304
  import Handlebars2 from "handlebars";
54202
54305
 
54203
54306
  // src/guardrail-generator/resolve-checks.ts
@@ -54338,7 +54441,7 @@ async function generateGuardrails(options) {
54338
54441
  if (pathResult.diagnostics.some((d2) => d2.severity === "error")) {
54339
54442
  continue;
54340
54443
  }
54341
- const targetPath = resolve5(config.configDir, pathResult.resolved);
54444
+ const targetPath = resolve6(config.configDir, pathResult.resolved);
54342
54445
  let templateContent;
54343
54446
  if (outputDef.inline_template) {
54344
54447
  templateContent = outputDef.inline_template;
@@ -54351,7 +54454,7 @@ async function generateGuardrails(options) {
54351
54454
  });
54352
54455
  continue;
54353
54456
  }
54354
- const templatePath = resolve5(config.configDir, outputDef.template);
54457
+ const templatePath = resolve6(config.configDir, outputDef.template);
54355
54458
  try {
54356
54459
  templateContent = await readFile5(templatePath, "utf8");
54357
54460
  } catch {
@@ -54388,9 +54491,9 @@ async function generateGuardrails(options) {
54388
54491
  };
54389
54492
  const compiled = Handlebars2.compile(templateContent, { noEscape: true });
54390
54493
  const output = compiled(groupCtx);
54391
- const groupTarget = resolve5(targetPath, groupKey);
54494
+ const groupTarget = resolve6(targetPath, groupKey);
54392
54495
  if (!dryRun) {
54393
- await mkdir2(dirname5(groupTarget), { recursive: true });
54496
+ await mkdir2(dirname6(groupTarget), { recursive: true });
54394
54497
  await writeFile2(groupTarget, output, "utf8");
54395
54498
  if (outputDef.executable) {
54396
54499
  await chmod(groupTarget, 493);
@@ -54402,7 +54505,7 @@ async function generateGuardrails(options) {
54402
54505
  const compiled = Handlebars2.compile(templateContent, { noEscape: true });
54403
54506
  const output = compiled(ctx);
54404
54507
  if (!dryRun) {
54405
- await mkdir2(dirname5(targetPath), { recursive: true });
54508
+ await mkdir2(dirname6(targetPath), { recursive: true });
54406
54509
  await writeFile2(targetPath, output, "utf8");
54407
54510
  if (outputDef.executable) {
54408
54511
  await chmod(targetPath, 493);