eutaxy 0.15.1 → 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.
Files changed (34) hide show
  1. package/README.md +6 -6
  2. package/dist/aws.d.mts +2 -2
  3. package/dist/aws.d.mts.map +1 -1
  4. package/dist/aws.mjs +53 -79
  5. package/dist/aws.mjs.map +1 -1
  6. package/dist/bin.mjs +1 -1
  7. package/dist/{cli-DT4lxaPK.mjs → cli-DbLlYHTY.mjs} +180 -162
  8. package/dist/cli-DbLlYHTY.mjs.map +1 -0
  9. package/dist/cli.mjs +1 -1
  10. package/dist/cloudflare.d.mts +7 -7
  11. package/dist/cloudflare.d.mts.map +1 -1
  12. package/dist/cloudflare.mjs +2 -2
  13. package/dist/delivery-invariants-90c5xBcd.mjs +44 -0
  14. package/dist/delivery-invariants-90c5xBcd.mjs.map +1 -0
  15. package/dist/{delivery-invariants-DzMy3iPs.d.mts → delivery-invariants-B8ZZnCZg.d.mts} +2 -2
  16. package/dist/{delivery-invariants-DzMy3iPs.d.mts.map → delivery-invariants-B8ZZnCZg.d.mts.map} +1 -1
  17. package/dist/{explore-B52m-wmk.d.mts → explore-DlwIUowm.d.mts} +2 -2
  18. package/dist/{explore-B52m-wmk.d.mts.map → explore-DlwIUowm.d.mts.map} +1 -1
  19. package/dist/index.d.mts +2 -2
  20. package/dist/index.mjs +2 -2
  21. package/dist/{platform-Ba1Kvdza.d.mts → platform-DPJTjpSr.d.mts} +56 -4
  22. package/dist/{platform-Ba1Kvdza.d.mts.map → platform-DPJTjpSr.d.mts.map} +1 -1
  23. package/dist/{src-CPuihHZh.mjs → src-CmHdPsZy.mjs} +1089 -159
  24. package/dist/src-CmHdPsZy.mjs.map +1 -0
  25. package/dist/{src-wa0JZa-T.mjs → src-Dz9Wn2vL.mjs} +2 -2
  26. package/dist/{src-wa0JZa-T.mjs.map → src-Dz9Wn2vL.mjs.map} +1 -1
  27. package/dist/{workerd-DvhVDnQW.mjs → workerd-D9cUGjYv.mjs} +561 -480
  28. package/dist/workerd-D9cUGjYv.mjs.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/cli-DT4lxaPK.mjs.map +0 -1
  31. package/dist/delivery-invariants-Dr658H1W.mjs +0 -67
  32. package/dist/delivery-invariants-Dr658H1W.mjs.map +0 -1
  33. package/dist/src-CPuihHZh.mjs.map +0 -1
  34. package/dist/workerd-DvhVDnQW.mjs.map +0 -1
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./cli-DT4lxaPK.mjs";
2
+ import { t as main } from "./cli-DbLlYHTY.mjs";
3
3
  // packages/eutaxy/src/bin.ts
4
4
  process.stdout.on("error", (err) => {
5
5
  if (err.code === "EPIPE") process.exit(process.exitCode ?? 0);
@@ -1,8 +1,8 @@
1
- import { L as canonicalJson } from "./src-CPuihHZh.mjs";
2
- import { _ as render, a as renderText, c as checkSpecModule, d as shrinkRefutation, g as endpointNumber, h as endpointBigInt, i as renderSpecs, m as conforms, n as renderSpecReport, p as evaluate, r as renderSpecReportJson, v as describeType } from "./src-wa0JZa-T.mjs";
1
+ import { R as canonicalJson } from "./src-CmHdPsZy.mjs";
2
+ import { _ as render, a as renderText, c as checkSpecModule, d as shrinkRefutation, g as endpointNumber, h as endpointBigInt, i as renderSpecs, m as conforms, n as renderSpecReport, p as evaluate, r as renderSpecReportJson, v as describeType } from "./src-Dz9Wn2vL.mjs";
3
3
  import { n as isSpec } from "./combinators-CLfsPfhT.mjs";
4
4
  import { t as aggregate } from "./provers-DS44OeEm.mjs";
5
- import { G as cloudflareRegressionTest, n as globKey, r as specKey } from "./workerd-DvhVDnQW.mjs";
5
+ import { G as cloudflareRegressionTest, n as globKey, r as specKey } from "./workerd-D9cUGjYv.mjs";
6
6
  import { createRequire, registerHooks } from "node:module";
7
7
  import { Readable } from "node:stream";
8
8
  import { createHash, randomBytes } from "node:crypto";
@@ -6077,6 +6077,152 @@ function resolveAsTypeScript() {
6077
6077
  }
6078
6078
  } });
6079
6079
  }
6080
+ // packages/cli/src/wrangler.ts
6081
+ /**
6082
+ * Wrangler config reading, one copy for `check` and `draft`: JSON and JSONC
6083
+ * parsing, the bindings a config declares, and the rules that name their
6084
+ * resources (a D1 database's id, an R2 bucket's name, a KV namespace's id,
6085
+ * which Durable Object classes are SQLite-backed). Only JSON and JSONC are
6086
+ * read; a TOML config is refused.
6087
+ */
6088
+ /**
6089
+ * JSON with comments and trailing commas, as wrangler.jsonc allows: comments
6090
+ * are removed outside strings, a comma before `}` or `]` dropped, and the
6091
+ * rest is JSON.
6092
+ */
6093
+ function parseJsonc(text) {
6094
+ let out = "";
6095
+ let i = 0;
6096
+ /** The index of the next character that is neither whitespace nor inside a comment, from `from`. */
6097
+ const nextToken = (from) => {
6098
+ let k = from;
6099
+ for (;;) {
6100
+ while (k < text.length && /\s/.test(text[k])) k++;
6101
+ if (text[k] === "/" && text[k + 1] === "/") while (k < text.length && text[k] !== "\n") k++;
6102
+ else if (text[k] === "/" && text[k + 1] === "*") {
6103
+ const end = text.indexOf("*/", k + 2);
6104
+ k = end < 0 ? text.length : end + 2;
6105
+ } else return k;
6106
+ }
6107
+ };
6108
+ while (i < text.length) {
6109
+ const c = text[i];
6110
+ if (c === "\"") {
6111
+ let j = i + 1;
6112
+ while (j < text.length && text[j] !== "\"") j += text[j] === "\\" ? 2 : 1;
6113
+ out += text.slice(i, j + 1);
6114
+ i = j + 1;
6115
+ } else if (c === "/" && text[i + 1] === "/") while (i < text.length && text[i] !== "\n") i++;
6116
+ else if (c === "/" && text[i + 1] === "*") {
6117
+ const end = text.indexOf("*/", i + 2);
6118
+ i = end < 0 ? text.length : end + 2;
6119
+ } else if (c === ",") {
6120
+ const next = text[nextToken(i + 1)];
6121
+ if (next !== "}" && next !== "]") out += c;
6122
+ i++;
6123
+ } else {
6124
+ out += c;
6125
+ i++;
6126
+ }
6127
+ }
6128
+ return JSON.parse(out);
6129
+ }
6130
+ /** Read a wrangler config as an object; only JSON and JSONC are read. */
6131
+ function readWranglerConfig(path) {
6132
+ const ext = extname(path);
6133
+ if (ext !== ".json" && ext !== ".jsonc") throw new Error(`${basename(path)}: eutaxy reads a wrangler config as JSON or JSONC; a TOML config is not read`);
6134
+ const parsed = parseJsonc(readFileSync(path, "utf8"));
6135
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`${basename(path)}: not a wrangler config object`);
6136
+ return parsed;
6137
+ }
6138
+ /** The `name` of a wrangler config, when the config can be read and names one. */
6139
+ function workerName(path) {
6140
+ try {
6141
+ const name = readWranglerConfig(path)["name"];
6142
+ return typeof name === "string" && name ? name : void 0;
6143
+ } catch {
6144
+ return;
6145
+ }
6146
+ }
6147
+ /** The object entries of a config list; anything else is no entry. */
6148
+ const list = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "object" && x) : [];
6149
+ const str$1 = (v, fallback = "") => typeof v === "string" ? v : fallback;
6150
+ const strings$1 = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
6151
+ /** A D1 binding's database: its id, else its name, else the binding (the same database in two configs is one). */
6152
+ const d1Id = (db) => str$1(db["database_id"], str$1(db["database_name"], str$1(db["binding"])));
6153
+ /** An R2 binding's bucket: its name, else the binding. */
6154
+ const r2Bucket = (b) => str$1(b["bucket_name"], str$1(b["binding"]));
6155
+ /** A KV binding's namespace: its id, else the binding. */
6156
+ const kvId = (k) => str$1(k["id"], str$1(k["binding"]));
6157
+ /**
6158
+ * The SQLite-backed Durable Object classes of a config, with its migrations applied in order as
6159
+ * wrangler applies them: a class is SQLite-backed from the migration that created it so, through
6160
+ * renames, until one deletes it.
6161
+ */
6162
+ function sqliteClasses(config) {
6163
+ const sqlite = /* @__PURE__ */ new Set();
6164
+ for (const m of list(config["migrations"])) {
6165
+ for (const c of strings$1(m["new_sqlite_classes"])) sqlite.add(c);
6166
+ for (const r of list(m["renamed_classes"])) {
6167
+ const from = str$1(r["from"]);
6168
+ if (sqlite.delete(from)) sqlite.add(str$1(r["to"]));
6169
+ }
6170
+ for (const c of strings$1(m["deleted_classes"])) sqlite.delete(c);
6171
+ }
6172
+ return sqlite;
6173
+ }
6174
+ /** Read a config's bindings. */
6175
+ function readBindings(config) {
6176
+ const sqlite = sqliteClasses(config);
6177
+ const dos = config["durable_objects"];
6178
+ const queues = config["queues"];
6179
+ const vars = {};
6180
+ const rawVars = config["vars"];
6181
+ if (typeof rawVars === "object" && rawVars !== null) for (const [k, v] of Object.entries(rawVars)) vars[k] = v;
6182
+ return {
6183
+ name: str$1(config["name"]) || void 0,
6184
+ main: str$1(config["main"]) || void 0,
6185
+ d1: list(config["d1_databases"]).map((d) => ({
6186
+ binding: str$1(d["binding"]),
6187
+ id: d1Id(d)
6188
+ })),
6189
+ r2: list(config["r2_buckets"]).map((b) => ({
6190
+ binding: str$1(b["binding"]),
6191
+ bucket: r2Bucket(b)
6192
+ })),
6193
+ kv: list(config["kv_namespaces"]).map((k) => ({
6194
+ binding: str$1(k["binding"]),
6195
+ id: kvId(k)
6196
+ })),
6197
+ durableObjects: list(dos?.bindings).map((b) => {
6198
+ const className = str$1(b["class_name"]);
6199
+ return {
6200
+ binding: str$1(b["name"]),
6201
+ className,
6202
+ sqlite: sqlite.has(className),
6203
+ ...b["script_name"] === void 0 ? {} : { scriptName: str$1(b["script_name"]) }
6204
+ };
6205
+ }),
6206
+ workflows: list(config["workflows"]).map((w) => ({
6207
+ binding: str$1(w["binding"]),
6208
+ className: str$1(w["class_name"]),
6209
+ name: str$1(w["name"], str$1(w["binding"]))
6210
+ })),
6211
+ services: list(config["services"]).map((s) => ({
6212
+ binding: str$1(s["binding"]),
6213
+ service: str$1(s["service"]),
6214
+ ...typeof s["entrypoint"] === "string" ? { entrypoint: s["entrypoint"] } : {},
6215
+ ...typeof s["props"] === "object" && s["props"] !== null ? { props: s["props"] } : {}
6216
+ })),
6217
+ queues: list(queues?.producers).map((p) => ({
6218
+ binding: str$1(p["binding"]),
6219
+ queue: str$1(p["queue"])
6220
+ })),
6221
+ vars,
6222
+ sqliteClasses: [...sqlite],
6223
+ keys: Object.keys(config)
6224
+ };
6225
+ }
6080
6226
  // packages/cli/src/callees.ts
6081
6227
  /**
6082
6228
  * The callees a scenario names (`callee()` steps), read on the Node side for
@@ -6199,58 +6345,6 @@ function isolateBindings(callees) {
6199
6345
  }
6200
6346
  return names;
6201
6347
  }
6202
- /**
6203
- * JSON with comments and trailing commas, as wrangler.jsonc allows: comments
6204
- * are removed outside strings, a comma before `}` or `]` dropped, and the
6205
- * rest is JSON.
6206
- */
6207
- function parseJsonc(text) {
6208
- let out = "";
6209
- let i = 0;
6210
- /** The index of the next character that is neither whitespace nor inside a comment, from `from`. */
6211
- const nextToken = (from) => {
6212
- let k = from;
6213
- for (;;) {
6214
- while (k < text.length && /\s/.test(text[k])) k++;
6215
- if (text[k] === "/" && text[k + 1] === "/") while (k < text.length && text[k] !== "\n") k++;
6216
- else if (text[k] === "/" && text[k + 1] === "*") {
6217
- const end = text.indexOf("*/", k + 2);
6218
- k = end < 0 ? text.length : end + 2;
6219
- } else return k;
6220
- }
6221
- };
6222
- while (i < text.length) {
6223
- const c = text[i];
6224
- if (c === "\"") {
6225
- let j = i + 1;
6226
- while (j < text.length && text[j] !== "\"") j += text[j] === "\\" ? 2 : 1;
6227
- out += text.slice(i, j + 1);
6228
- i = j + 1;
6229
- } else if (c === "/" && text[i + 1] === "/") while (i < text.length && text[i] !== "\n") i++;
6230
- else if (c === "/" && text[i + 1] === "*") {
6231
- const end = text.indexOf("*/", i + 2);
6232
- i = end < 0 ? text.length : end + 2;
6233
- } else if (c === ",") {
6234
- const next = text[nextToken(i + 1)];
6235
- if (next !== "}" && next !== "]") out += c;
6236
- i++;
6237
- } else {
6238
- out += c;
6239
- i++;
6240
- }
6241
- }
6242
- return JSON.parse(out);
6243
- }
6244
- /** Read a wrangler config as an object; only JSON and JSONC are read here. */
6245
- function readWranglerConfig(path) {
6246
- const ext = extname(path);
6247
- if (ext !== ".json" && ext !== ".jsonc") throw new Error(`${basename(path)}: eutaxy check reads a callee's wrangler config as JSON or JSONC; a TOML config is not read`);
6248
- const parsed = parseJsonc(readFileSync(path, "utf8"));
6249
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`${basename(path)}: not a wrangler config object`);
6250
- return parsed;
6251
- }
6252
- const list$1 = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "object" && x) : [];
6253
- const str$1 = (v, fallback = "") => typeof v === "string" ? v : fallback;
6254
6348
  /** The keys of a wrangler config whose bindings the command carries into the isolate. */
6255
6349
  const carried = /* @__PURE__ */ new Set([
6256
6350
  "name",
@@ -6283,67 +6377,22 @@ const carried = /* @__PURE__ */ new Set([
6283
6377
  /** Read a callee's wrangler config into what the isolate needs; `scenarioDir` resolves the step's paths. */
6284
6378
  function readCalleeConfig(step, scenarioDir) {
6285
6379
  const path = resolve(scenarioDir, step.config);
6286
- const config = readWranglerConfig(path);
6287
- const name = str$1(config["name"]);
6288
- if (!name) throw new Error(`${basename(path)}: the callee's wrangler config has no name, which qualifies its bindings`);
6289
- const notAdded = [];
6290
- const sqlite = /* @__PURE__ */ new Set();
6291
- const strings = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
6292
- for (const m of list$1(config["migrations"])) {
6293
- for (const c of strings(m["new_sqlite_classes"])) sqlite.add(c);
6294
- for (const r of list$1(m["renamed_classes"])) {
6295
- const from = str$1(r["from"]);
6296
- if (sqlite.delete(from)) sqlite.add(str$1(r["to"]));
6297
- }
6298
- for (const c of strings(m["deleted_classes"])) sqlite.delete(c);
6299
- }
6300
- const durableObjects = [];
6301
- const dos = config["durable_objects"];
6302
- for (const b of list$1(dos?.bindings)) {
6303
- const className = str$1(b["class_name"]);
6304
- const scriptName = b["script_name"] === void 0 ? void 0 : str$1(b["script_name"]);
6305
- durableObjects.push({
6306
- binding: str$1(b["name"]),
6307
- className,
6308
- sqlite: sqlite.has(className),
6309
- ...scriptName === void 0 ? {} : { scriptName }
6310
- });
6311
- }
6312
- const queues = config["queues"];
6313
- for (const key of Object.keys(config)) if (!carried.has(key)) notAdded.push(key);
6314
- const vars = {};
6315
- const rawVars = config["vars"];
6316
- if (typeof rawVars === "object" && rawVars !== null) for (const [k, v] of Object.entries(rawVars)) vars[k] = v;
6380
+ const bindings = readBindings(readWranglerConfig(path));
6381
+ if (bindings.name === void 0) throw new Error(`${basename(path)}: the callee's wrangler config has no name, which qualifies its bindings`);
6317
6382
  return {
6318
6383
  binding: step.binding,
6319
- name,
6384
+ name: bindings.name,
6320
6385
  entry: resolve(scenarioDir, step.entry),
6321
- d1: list$1(config["d1_databases"]).map((d) => ({
6322
- binding: str$1(d["binding"]),
6323
- id: str$1(d["database_id"], str$1(d["database_name"], str$1(d["binding"])))
6324
- })),
6325
- r2: list$1(config["r2_buckets"]).map((b) => ({
6326
- binding: str$1(b["binding"]),
6327
- bucket: str$1(b["bucket_name"], str$1(b["binding"]))
6328
- })),
6329
- kv: list$1(config["kv_namespaces"]).map((k) => ({
6330
- binding: str$1(k["binding"]),
6331
- id: str$1(k["id"], str$1(k["binding"]))
6332
- })),
6333
- durableObjects,
6334
- workflows: list$1(config["workflows"]).map((w) => ({
6335
- binding: str$1(w["binding"]),
6336
- className: str$1(w["class_name"]),
6337
- name: str$1(w["name"], str$1(w["binding"]))
6338
- })),
6339
- services: list$1(config["services"]).map((s) => str$1(s["binding"])),
6340
- queues: list$1(queues?.producers).map((p) => ({
6341
- binding: str$1(p["binding"]),
6342
- queue: str$1(p["queue"])
6343
- })),
6344
- vars,
6345
- sqliteClasses: [...sqlite],
6346
- notAdded
6386
+ d1: bindings.d1,
6387
+ r2: bindings.r2,
6388
+ kv: bindings.kv,
6389
+ durableObjects: bindings.durableObjects,
6390
+ workflows: bindings.workflows,
6391
+ services: bindings.services.map((s) => s.binding),
6392
+ queues: bindings.queues,
6393
+ vars: bindings.vars,
6394
+ sqliteClasses: bindings.sqliteClasses,
6395
+ notAdded: bindings.keys.filter((key) => !carried.has(key))
6347
6396
  };
6348
6397
  }
6349
6398
  /** A Worker's name as an identifier prefix (`my-worker` → `my_worker`, `1st` → `_1st`). */
@@ -6463,32 +6512,14 @@ function miniflareOptionsSource(callees, isolate = noIsolate, callerServices = [
6463
6512
  /** The caller's resources from its wrangler config, when the config can be read (JSON or JSONC); none otherwise. */
6464
6513
  function readCallerResources(wranglerPath) {
6465
6514
  try {
6466
- const config = readWranglerConfig(wranglerPath);
6467
- const dos = config["durable_objects"];
6515
+ const bindings = readBindings(readWranglerConfig(wranglerPath));
6468
6516
  return {
6469
- name: str$1(config["name"]) || void 0,
6470
- d1: list$1(config["d1_databases"]).map((d) => ({
6471
- binding: str$1(d["binding"]),
6472
- id: str$1(d["database_id"], str$1(d["database_name"], str$1(d["binding"])))
6473
- })),
6474
- r2: list$1(config["r2_buckets"]).map((b) => ({
6475
- binding: str$1(b["binding"]),
6476
- bucket: str$1(b["bucket_name"], str$1(b["binding"]))
6477
- })),
6478
- kv: list$1(config["kv_namespaces"]).map((k) => ({
6479
- binding: str$1(k["binding"]),
6480
- id: str$1(k["id"], str$1(k["binding"]))
6481
- })),
6482
- durableObjects: list$1(dos?.bindings).map((b) => ({
6483
- binding: str$1(b["name"]),
6484
- className: str$1(b["class_name"]),
6485
- ...b["script_name"] === void 0 ? {} : { scriptName: str$1(b["script_name"]) }
6486
- })),
6487
- services: list$1(config["services"]).map((b) => ({
6488
- binding: str$1(b["binding"]),
6489
- ...typeof b["entrypoint"] === "string" ? { entrypoint: b["entrypoint"] } : {},
6490
- ...typeof b["props"] === "object" && b["props"] !== null ? { props: b["props"] } : {}
6491
- }))
6517
+ name: bindings.name,
6518
+ d1: bindings.d1,
6519
+ r2: bindings.r2,
6520
+ kv: bindings.kv,
6521
+ durableObjects: bindings.durableObjects,
6522
+ services: bindings.services
6492
6523
  };
6493
6524
  } catch {
6494
6525
  return;
@@ -7017,7 +7048,6 @@ function cleanUp(workDir, stamp) {
7017
7048
  * imported or run: the config is read as JSON or JSONC and the module's
7018
7049
  * source (with the modules it imports relatively) is scanned as text.
7019
7050
  */
7020
- const list = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "object" && x) : [];
7021
7051
  const text$1 = (v) => typeof v === "string" ? v : "";
7022
7052
  const record = (v) => typeof v === "object" && v !== null && !Array.isArray(v) ? v : {};
7023
7053
  /** A path relative to `from`, with forward slashes and a leading `./`. */
@@ -7025,11 +7055,6 @@ function ref(from, to) {
7025
7055
  const p = relative(from, to).split("\\").join("/");
7026
7056
  return p.startsWith(".") ? p : `./${p}`;
7027
7057
  }
7028
- /** Read a wrangler config as JSON or JSONC; TOML is not read. */
7029
- function readConfig(path) {
7030
- if (extname(path) !== ".json" && extname(path) !== ".jsonc") throw new Error(`${basename(path)}: eutaxy draft reads a wrangler config as JSON or JSONC; a TOML config is not read`);
7031
- return readWranglerConfig(path);
7032
- }
7033
7058
  /** Binding kinds the simulation does not proxy: a run that touches one is UNSUPPORTED. */
7034
7059
  const unmodelled = {
7035
7060
  kv_namespaces: "KV namespace",
@@ -7046,12 +7071,6 @@ const unmodelled = {
7046
7071
  version_metadata: "version metadata",
7047
7072
  pipelines: "pipeline"
7048
7073
  };
7049
- /** The SQLite-backed classes of a config's migrations (the ones created so, as wrangler applies them). */
7050
- function sqliteClasses(config) {
7051
- const out = /* @__PURE__ */ new Set();
7052
- for (const m of list(config["migrations"])) for (const c of Array.isArray(m["new_sqlite_classes"]) ? m["new_sqlite_classes"] : []) if (typeof c === "string") out.add(c);
7053
- return out;
7054
- }
7055
7074
  /**
7056
7075
  * The schema file of a D1 binding, beside its config: `schema.sql`, else `<database_name>.sql`, else the
7057
7076
  * only `.sql` file there; `found` false when none is, and the step names `schema.sql` to create.
@@ -7109,10 +7128,10 @@ function configsByName(root, depth = 3) {
7109
7128
  const path = join(dir, e.name);
7110
7129
  if (e.isDirectory()) {
7111
7130
  if (left > 0 && e.name !== "node_modules" && !e.name.startsWith(".")) walk(path, left - 1);
7112
- } else if (e.name === "wrangler.jsonc" || e.name === "wrangler.json") try {
7113
- const name = text$1(readConfig(path)["name"]);
7114
- if (name && !out.has(name)) out.set(name, path);
7115
- } catch {}
7131
+ } else if (e.name === "wrangler.jsonc" || e.name === "wrangler.json") {
7132
+ const name = workerName(path);
7133
+ if (name !== void 0 && !out.has(name)) out.set(name, path);
7134
+ }
7116
7135
  }
7117
7136
  };
7118
7137
  walk(root, depth);
@@ -7173,7 +7192,7 @@ function agentSegment(binding) {
7173
7192
  return (kebab.startsWith("-") ? kebab.slice(1) : kebab).replaceAll("_", "-").replace(/-$/, "");
7174
7193
  }
7175
7194
  function draftScenario(input) {
7176
- const config = readConfig(input.config);
7195
+ const config = readWranglerConfig(input.config);
7177
7196
  const configDir = dirname(input.config);
7178
7197
  const scenarioDir = input.scenarioDir ?? configDir;
7179
7198
  const name = text$1(config["name"]) || basename(configDir);
@@ -7192,9 +7211,8 @@ function draftScenario(input) {
7192
7211
  const found = service && service !== name ? others.get(service) : void 0;
7193
7212
  if (found !== void 0) callees.set(service, found);
7194
7213
  }
7195
- const d1Id = (db) => text$1(db["database_id"]) || text$1(db["database_name"]) || text$1(db["binding"]);
7196
7214
  const callerDatabases = new Map(list(config["d1_databases"]).map((db) => [d1Id(db), text$1(db["binding"])]));
7197
- const callerBuckets = new Map(list(config["r2_buckets"]).map((b) => [text$1(b["bucket_name"]) || text$1(b["binding"]), text$1(b["binding"])]));
7215
+ const callerBuckets = new Map(list(config["r2_buckets"]).map((b) => [r2Bucket(b), text$1(b["binding"])]));
7198
7216
  /** Classes of a callee's script the caller binds itself: one namespace, set up under the caller's name. */
7199
7217
  const sharedClasses = new Set(list(record(config["durable_objects"])["bindings"]).filter((b) => callees.has(text$1(b["script_name"]))).map((b) => `${text$1(b["script_name"])}:${text$1(b["class_name"])}`));
7200
7218
  /** The setup steps of one Worker's own resources: the caller's (prefix ""), or a callee's (`<name>/`). */
@@ -7236,7 +7254,7 @@ function draftScenario(input) {
7236
7254
  if (!prefix && callees.has(script)) setup.push({
7237
7255
  kind: "durable_object",
7238
7256
  binding,
7239
- sqlite: sqliteClasses(readConfig(callees.get(script))).has(className)
7257
+ sqlite: sqliteClasses(readWranglerConfig(callees.get(script))).has(className)
7240
7258
  });
7241
7259
  else notes.push(`Durable Object ${prefix}${binding} is ${script}'s class ${className}: name ${script} with callee() to run it`);
7242
7260
  continue;
@@ -7254,7 +7272,7 @@ function draftScenario(input) {
7254
7272
  for (const b of list(cfg["r2_buckets"])) {
7255
7273
  const binding = text$1(b["binding"]);
7256
7274
  if (!binding) continue;
7257
- const shared = prefix ? callerBuckets.get(text$1(b["bucket_name"]) || binding) : void 0;
7275
+ const shared = prefix ? callerBuckets.get(r2Bucket(b)) : void 0;
7258
7276
  if (shared !== void 0) {
7259
7277
  notes.push(`R2 ${prefix}${binding} is the caller's bucket ${shared}: set it up and read it as ${shared}`);
7260
7278
  continue;
@@ -7302,7 +7320,7 @@ function draftScenario(input) {
7302
7320
  notes.push(`service binding ${binding}: no wrangler config named ${service || "(none)"} under the scenario's directory, so its answers are scripted; script them with service(), or run that Worker with callee()`);
7303
7321
  continue;
7304
7322
  }
7305
- const callee = readConfig(calleeConfig);
7323
+ const callee = readWranglerConfig(calleeConfig);
7306
7324
  const calleeDir = dirname(calleeConfig);
7307
7325
  const calleeMain = resolve(calleeDir, text$1(callee["main"]));
7308
7326
  setup.push({
@@ -8285,7 +8303,7 @@ async function runReport(o) {
8285
8303
  }
8286
8304
  // packages/cli/src/version.ts
8287
8305
  /** The published package's version, as the MCP server reports it; the release tooling keeps it in step. */
8288
- const eutaxyVersion = "0.15.1";
8306
+ const eutaxyVersion = "0.16.0";
8289
8307
  // packages/cli/src/mcp.ts
8290
8308
  /**
8291
8309
  * `eutaxy mcp`: a Model Context Protocol server over stdio, so a coding
@@ -9043,4 +9061,4 @@ async function main(argv, io) {
9043
9061
  }
9044
9062
  export { main as t };
9045
9063
 
9046
- //# sourceMappingURL=cli-DT4lxaPK.mjs.map
9064
+ //# sourceMappingURL=cli-DbLlYHTY.mjs.map