@dereekb/dbx-components-mcp 14.5.0 → 14.6.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.
@@ -10,7 +10,7 @@ var __export = (target, all) => {
10
10
  // packages/dbx-components-mcp/package.json
11
11
  var package_default = {
12
12
  name: "@dereekb/dbx-components-mcp",
13
- version: "14.5.0",
13
+ version: "14.6.0",
14
14
  sideEffects: false,
15
15
  type: "module",
16
16
  bin: {
@@ -22,8 +22,8 @@ var package_default = {
22
22
  "ts-morph": "^21.0.0"
23
23
  },
24
24
  peerDependencies: {
25
- "@dereekb/dbx-cli": "14.5.0",
26
- "@dereekb/util": "14.5.0"
25
+ "@dereekb/dbx-cli": "14.6.0",
26
+ "@dereekb/util": "14.6.0"
27
27
  }
28
28
  };
29
29
 
@@ -2337,6 +2337,10 @@ var FIREBASE_MODELS = [
2337
2337
  description: "Root notification container for a model. The document ID is the two-way flat key of the model it represents (see {@link notificationBoxIdForModel} in `notification.id.ts`).",
2338
2338
  modelGroup: "Notification",
2339
2339
  collectionKind: "root",
2340
+ compositeKey: {
2341
+ from: "*",
2342
+ encoding: "two-way"
2343
+ },
2340
2344
  archetypes: ["composite-key-root"]
2341
2345
  },
2342
2346
  {
@@ -2417,6 +2421,10 @@ var FIREBASE_MODELS = [
2417
2421
  description: "Aggregated notification feed for a specific model. Holds embedded {@link NotificationItem} entries that summarize recent notifications, similar to an activity feed.",
2418
2422
  modelGroup: "Notification",
2419
2423
  collectionKind: "root",
2424
+ compositeKey: {
2425
+ from: "*",
2426
+ encoding: "two-way"
2427
+ },
2420
2428
  archetypes: ["root-singleton-aggregate", "composite-key-root"]
2421
2429
  },
2422
2430
  {
@@ -4925,10 +4933,10 @@ function extractCandidateParams(candidate, descriptions) {
4925
4933
  for (const param of params) {
4926
4934
  const name = param.getName();
4927
4935
  const typeNode = param.getTypeNode()?.getText();
4928
- const type109 = typeNode ?? param.getType().getText() ?? "unknown";
4936
+ const type110 = typeNode ?? param.getType().getText() ?? "unknown";
4929
4937
  const description = descriptions.get(name) ?? "";
4930
4938
  const optional = param.isOptional() || param.hasInitializer();
4931
- out.push({ name, type: type109, description, optional });
4939
+ out.push({ name, type: type110, description, optional });
4932
4940
  }
4933
4941
  return out;
4934
4942
  }
@@ -6411,13 +6419,13 @@ function parseDecoratorInput(property) {
6411
6419
  const decoratorArg = decorator.getCallExpression()?.getArguments()[0];
6412
6420
  const { alias, requiredFromDecorator } = readInputDecoratorArg(decoratorArg);
6413
6421
  const required = requiredFromDecorator ?? !property.hasQuestionToken();
6414
- const type109 = property.getTypeNode()?.getText() ?? "unknown";
6422
+ const type110 = property.getTypeNode()?.getText() ?? "unknown";
6415
6423
  const initializer = property.getInitializer();
6416
6424
  const defaultValue = initializer === void 0 ? void 0 : initializer.getText();
6417
6425
  return {
6418
6426
  propertyName,
6419
6427
  alias: alias ?? propertyName,
6420
- type: type109,
6428
+ type: type110,
6421
6429
  required,
6422
6430
  description: readPropertyDescription(property),
6423
6431
  ...defaultValue === void 0 ? {} : { defaultValue }
@@ -6510,22 +6518,22 @@ function parseDecoratorOutput(property) {
6510
6518
  alias = decoratorArg.getLiteralText();
6511
6519
  }
6512
6520
  const initializer = property.getInitializer();
6513
- let type109 = "unknown";
6521
+ let type110 = "unknown";
6514
6522
  if (initializer !== void 0 && Node9.isNewExpression(initializer)) {
6515
6523
  const typeArgs = initializer.getTypeArguments();
6516
6524
  if (typeArgs.length > 0) {
6517
- type109 = typeArgs[0].getText();
6525
+ type110 = typeArgs[0].getText();
6518
6526
  }
6519
6527
  } else {
6520
6528
  const explicit = property.getTypeNode()?.getText();
6521
6529
  if (explicit !== void 0) {
6522
- type109 = explicit;
6530
+ type110 = explicit;
6523
6531
  }
6524
6532
  }
6525
6533
  return {
6526
6534
  propertyName,
6527
6535
  name: alias ?? propertyName,
6528
- type: type109,
6536
+ type: type110,
6529
6537
  description: readPropertyDescription(property)
6530
6538
  };
6531
6539
  }
@@ -6540,7 +6548,7 @@ function parseSignalOutput(property) {
6540
6548
  }
6541
6549
  const propertyName = property.getName();
6542
6550
  const typeArgs = initializer.getTypeArguments();
6543
- const type109 = typeArgs.length > 0 ? typeArgs[0].getText() : "void";
6551
+ const type110 = typeArgs.length > 0 ? typeArgs[0].getText() : "void";
6544
6552
  const args = initializer.getArguments();
6545
6553
  let alias;
6546
6554
  if (args.length > 0 && Node9.isObjectLiteralExpression(args[0])) {
@@ -6549,7 +6557,7 @@ function parseSignalOutput(property) {
6549
6557
  return {
6550
6558
  propertyName,
6551
6559
  name: alias ?? propertyName,
6552
- type: type109,
6560
+ type: type110,
6553
6561
  description: readPropertyDescription(property)
6554
6562
  };
6555
6563
  }
@@ -11274,10 +11282,10 @@ function collectParams(decl, descriptions) {
11274
11282
  for (const param of params) {
11275
11283
  const name = param.getName();
11276
11284
  const typeNode = param.getTypeNode()?.getText();
11277
- const type109 = typeNode ?? param.getType().getText() ?? "unknown";
11285
+ const type110 = typeNode ?? param.getType().getText() ?? "unknown";
11278
11286
  const description = descriptions.get(name) ?? "";
11279
11287
  const optional = param.isOptional() || param.hasInitializer();
11280
- out.push({ name, type: type109, description, optional });
11288
+ out.push({ name, type: type110, description, optional });
11281
11289
  }
11282
11290
  return out;
11283
11291
  }
@@ -12957,10 +12965,10 @@ function readTransformSignature(method, fallbackParamDescriptions) {
12957
12965
  for (let i = 1; i < params.length; i += 1) {
12958
12966
  const param = params[i];
12959
12967
  const name = param.getName();
12960
- const type109 = readParamType(param);
12968
+ const type110 = readParamType(param);
12961
12969
  const description = methodParamDescriptions.get(name) ?? fallbackParamDescriptions.get(name) ?? "";
12962
12970
  const required = !param.isOptional() && !param.hasInitializer();
12963
- args.push({ name, type: type109, description, required });
12971
+ args.push({ name, type: type110, description, required });
12964
12972
  }
12965
12973
  return { inputType, outputType, args };
12966
12974
  }
@@ -14956,7 +14964,7 @@ async function loadForgeFieldRegistry(input) {
14956
14964
  }
14957
14965
 
14958
14966
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-model-firebase-index-registry.ts
14959
- import { dirname as dirname9, isAbsolute as isAbsolute9, resolve as resolve27 } from "node:path";
14967
+ import { dirname as dirname10, isAbsolute as isAbsolute9, resolve as resolve28 } from "node:path";
14960
14968
 
14961
14969
  // packages/dbx-cli/firestore-indexes/src/firestore-indexes-generate.ts
14962
14970
  function generateFirestoreIndexesJson(input) {
@@ -15186,7 +15194,7 @@ function computeDiff(input) {
15186
15194
 
15187
15195
  // packages/dbx-cli/firestore-indexes/src/generate-firestore-indexes-cli.ts
15188
15196
  import { readFile as nodeReadFile7, writeFile as nodeWriteFile3 } from "node:fs/promises";
15189
- import { resolve as resolve26 } from "node:path";
15197
+ import { resolve as resolve27 } from "node:path";
15190
15198
 
15191
15199
  // packages/dbx-cli/firestore-indexes/src/model-firebase-index-runtime.ts
15192
15200
  // @__NO_SIDE_EFFECTS__
@@ -15288,17 +15296,128 @@ function pushInto13(map, key, entry) {
15288
15296
  }
15289
15297
  }
15290
15298
 
15299
+ // packages/dbx-cli/firestore-indexes/src/model-firebase-index-package-manifests.ts
15300
+ import { type as type42 } from "arktype";
15301
+ import { readdir as nodeReadDir } from "node:fs/promises";
15302
+ import { createRequire } from "node:module";
15303
+ import { dirname as dirname9, resolve as resolve26 } from "node:path";
15304
+ var MODEL_FIREBASE_INDEX_MANIFEST_FILENAME_SUFFIX = ".model-firebase-index.mcp.generated.json";
15305
+ var BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE = "@dereekb/dbx-components-mcp";
15306
+ var BUNDLED_MANIFEST_DIRECTORY_NAME = "generated";
15307
+ var defaultBundledManifestDirectoryResolver = (cwd) => {
15308
+ let result;
15309
+ try {
15310
+ const requireFromCwd = createRequire(resolve26(cwd, "noop.js"));
15311
+ const packageJsonPath = requireFromCwd.resolve(`${BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE}/package.json`);
15312
+ result = resolve26(dirname9(packageJsonPath), BUNDLED_MANIFEST_DIRECTORY_NAME);
15313
+ } catch {
15314
+ result = null;
15315
+ }
15316
+ return result;
15317
+ };
15318
+ var defaultReadDir = (path) => nodeReadDir(path);
15319
+ async function loadModelFirebaseIndexPackageManifests(input) {
15320
+ const { cwd, manifestPaths = [], discoverBundled = false, readFile: readFile33 = defaultReadFile, readDir = defaultReadDir, resolveBundledDirectory = defaultBundledManifestDirectoryResolver } = input;
15321
+ const paths = manifestPaths.map((path) => resolve26(cwd, path));
15322
+ let failure = null;
15323
+ if (discoverBundled) {
15324
+ const bundledDirectory = resolveBundledDirectory(cwd);
15325
+ if (bundledDirectory == null) {
15326
+ failure = { kind: "no-bundled-package", packageName: BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE };
15327
+ } else {
15328
+ paths.push(...await readBundledManifestPaths(bundledDirectory, readDir));
15329
+ }
15330
+ }
15331
+ const loaded = [];
15332
+ for (const path of paths) {
15333
+ if (failure != null) {
15334
+ break;
15335
+ }
15336
+ const readResult = await readManifestFile(path, readFile33);
15337
+ if (readResult.kind === "ok") {
15338
+ loaded.push({ path, manifest: readResult.manifest });
15339
+ } else {
15340
+ failure = readResult.outcome;
15341
+ }
15342
+ }
15343
+ return failure ?? { kind: "success", loaded };
15344
+ }
15345
+ function formatModelFirebaseIndexPackageManifestFailure(outcome) {
15346
+ let result;
15347
+ switch (outcome.kind) {
15348
+ case "unreadable-manifest":
15349
+ result = `could not read manifest at ${outcome.path} \u2014 ${outcome.error}`;
15350
+ break;
15351
+ case "invalid-manifest":
15352
+ result = `manifest at ${outcome.path} failed validation \u2014 ${outcome.error}`;
15353
+ break;
15354
+ default:
15355
+ result = `${outcome.packageName} is not installed, so no bundled index manifests could be discovered. Install it, or pass --manifest <path> explicitly.`;
15356
+ break;
15357
+ }
15358
+ return result;
15359
+ }
15360
+ async function readBundledManifestPaths(directory, readDir) {
15361
+ let result;
15362
+ try {
15363
+ const names = await readDir(directory);
15364
+ result = names.filter((name) => name.endsWith(MODEL_FIREBASE_INDEX_MANIFEST_FILENAME_SUFFIX)).toSorted().map((name) => resolve26(directory, name));
15365
+ } catch {
15366
+ result = [];
15367
+ }
15368
+ return result;
15369
+ }
15370
+ async function readManifestFile(path, readFile33) {
15371
+ let raw = null;
15372
+ let readError = null;
15373
+ try {
15374
+ raw = await readFile33(path);
15375
+ } catch (err) {
15376
+ readError = err instanceof Error ? err.message : String(err);
15377
+ }
15378
+ let result;
15379
+ if (raw == null) {
15380
+ result = { kind: "fail", outcome: { kind: "unreadable-manifest", path, error: readError ?? "unknown error" } };
15381
+ } else {
15382
+ let parsed;
15383
+ let parseError = null;
15384
+ try {
15385
+ parsed = JSON.parse(raw);
15386
+ } catch (err) {
15387
+ parseError = err instanceof Error ? err.message : String(err);
15388
+ }
15389
+ if (parseError == null) {
15390
+ const validated = ModelFirebaseIndexManifest(parsed);
15391
+ if (validated instanceof type42.errors) {
15392
+ result = { kind: "fail", outcome: { kind: "invalid-manifest", path, error: validated.summary } };
15393
+ } else {
15394
+ result = { kind: "ok", manifest: validated };
15395
+ }
15396
+ } else {
15397
+ result = { kind: "fail", outcome: { kind: "invalid-manifest", path, error: parseError } };
15398
+ }
15399
+ }
15400
+ return result;
15401
+ }
15402
+
15291
15403
  // packages/dbx-cli/firestore-indexes/src/generate-firestore-indexes-cli.ts
15292
15404
  var DEFAULT_BIN_NAME = "dbx-cli-generate-firestore-indexes";
15293
15405
  function buildUsage(binName) {
15294
15406
  return [
15295
- `Usage: ${binName} --component <dir> [--component <dir> ...] [--output <path>] [--check] [--json] [--help]`,
15407
+ `Usage: ${binName} [--component <dir> ...] [--packages] [--manifest <path> ...] [--output <path>] [--check] [--json] [--help]`,
15296
15408
  "",
15297
15409
  "Generates `firestore.indexes.json` from `@dbxModelFirebaseIndex`-tagged factories.",
15298
15410
  "",
15299
15411
  "Options:",
15300
- " --component <dir> Required, repeatable. Relative path to a `-firebase` component or package.",
15301
- " Repeat to derive one indexes file from several packages at once.",
15412
+ " --component <dir> Repeatable. Relative path to a `-firebase` component or package whose",
15413
+ " source is scanned for tagged factories. Repeat to derive one indexes",
15414
+ " file from several packages at once.",
15415
+ " --packages Also merge the pre-built index manifests bundled in the installed",
15416
+ " @dereekb/dbx-components-mcp. Lets an app derive the framework models\u2019",
15417
+ " indexes without a scannable copy of their source.",
15418
+ " --manifest <path> Repeatable. Merge a specific pre-built manifest JSON file.",
15419
+ "",
15420
+ " At least one of --component / --packages / --manifest is required.",
15302
15421
  " --output <path> Output path. Defaults to `firestore.indexes.json` at the cwd.",
15303
15422
  " --check Compare against the on-disk file; exit 1 on drift, do not write.",
15304
15423
  " --json Print the diff summary as JSON instead of human-readable text.",
@@ -15318,18 +15437,18 @@ async function runGenerateFirestoreIndexesCli(input) {
15318
15437
  stderr(usage);
15319
15438
  return { exitCode: 2 };
15320
15439
  }
15321
- if (parsed.components.length === 0) {
15322
- stderr("generate-firestore-indexes: --component is required");
15440
+ if (parsed.components.length === 0 && parsed.manifests.length === 0 && !parsed.packages) {
15441
+ stderr("generate-firestore-indexes: at least one of --component / --packages / --manifest is required");
15323
15442
  stderr(usage);
15324
15443
  return { exitCode: 2 };
15325
15444
  }
15326
- const outputAbs = resolve26(cwd, parsed.output);
15445
+ const outputAbs = resolve27(cwd, parsed.output);
15327
15446
  const entries = [];
15328
15447
  const loadedSources = [];
15329
15448
  let sawUnresolvedModel = false;
15330
15449
  for (const component of parsed.components) {
15331
15450
  const buildOutcome = await buildModelFirebaseIndexManifest({
15332
- projectRoot: resolve26(cwd, component),
15451
+ projectRoot: resolve27(cwd, component),
15333
15452
  generator
15334
15453
  });
15335
15454
  if (buildOutcome.kind !== "success") {
@@ -15347,6 +15466,15 @@ async function runGenerateFirestoreIndexesCli(input) {
15347
15466
  }
15348
15467
  loadedSources.push(buildOutcome.manifest.source);
15349
15468
  }
15469
+ if (parsed.packages || parsed.manifests.length > 0) {
15470
+ const merged = await collectPackageManifestEntries({ cwd, manifestPaths: parsed.manifests, discoverBundled: parsed.packages, readFile: readFile33 });
15471
+ if (merged.kind === "fail") {
15472
+ stderr(merged.message);
15473
+ return { exitCode: 1 };
15474
+ }
15475
+ entries.push(...merged.entries);
15476
+ loadedSources.push(...merged.sources);
15477
+ }
15350
15478
  if (sawUnresolvedModel) {
15351
15479
  stderr("generate-firestore-indexes: one or more @dbxModelFirebaseIndexModel tags could not be resolved, so their indexes were dropped. Add the missing identity file to the component\u2019s `dbx-mcp.scan.json` include globs.");
15352
15480
  return { exitCode: 1 };
@@ -15373,8 +15501,29 @@ async function runGenerateFirestoreIndexesCli(input) {
15373
15501
  }
15374
15502
  return { exitCode: 0 };
15375
15503
  }
15504
+ async function collectPackageManifestEntries(input) {
15505
+ const { cwd, manifestPaths, discoverBundled, readFile: readFile33 } = input;
15506
+ const outcome = await loadModelFirebaseIndexPackageManifests({ cwd, manifestPaths, discoverBundled, readFile: readFile33 });
15507
+ let result;
15508
+ if (outcome.kind === "success") {
15509
+ const entries = [];
15510
+ const sources = [];
15511
+ for (const { manifest } of outcome.loaded) {
15512
+ for (const entry of manifest.entries) {
15513
+ entries.push(toModelFirebaseIndexEntryInfo(entry));
15514
+ }
15515
+ sources.push(manifest.source);
15516
+ }
15517
+ result = { kind: "ok", entries, sources };
15518
+ } else {
15519
+ result = { kind: "fail", message: `generate-firestore-indexes: ${formatModelFirebaseIndexPackageManifestFailure(outcome)}` };
15520
+ }
15521
+ return result;
15522
+ }
15376
15523
  function parseArgv(argv) {
15377
15524
  const components = [];
15525
+ const manifests = [];
15526
+ let packages = false;
15378
15527
  let output = "firestore.indexes.json";
15379
15528
  let check = false;
15380
15529
  let json = false;
@@ -15392,6 +15541,17 @@ function parseArgv(argv) {
15392
15541
  components.push(argv[i]);
15393
15542
  }
15394
15543
  break;
15544
+ case "--manifest":
15545
+ i += 1;
15546
+ if (i >= argv.length) {
15547
+ error = "generate-firestore-indexes: --manifest requires a value";
15548
+ } else {
15549
+ manifests.push(argv[i]);
15550
+ }
15551
+ break;
15552
+ case "--packages":
15553
+ packages = true;
15554
+ break;
15395
15555
  case "--output":
15396
15556
  i += 1;
15397
15557
  if (i >= argv.length) {
@@ -15416,7 +15576,7 @@ function parseArgv(argv) {
15416
15576
  }
15417
15577
  i += 1;
15418
15578
  }
15419
- return { components, output, check, json, help, error };
15579
+ return { components, manifests, packages, output, check, json, help, error };
15420
15580
  }
15421
15581
  async function readExistingIndexes(input) {
15422
15582
  const text = await readExistingIndexesText(input);
@@ -15542,7 +15702,7 @@ async function loadModelFirebaseIndexManifests(input) {
15542
15702
  var DEFAULT_BUNDLED_FILENAMES7 = ["dereekb-firebase.model-firebase-index.mcp.generated.json"];
15543
15703
  var DEFAULT_BUNDLED_PATHS7 = () => {
15544
15704
  const packageRoot = findPackageRoot(import.meta.url);
15545
- return DEFAULT_BUNDLED_FILENAMES7.map((name) => resolve27(packageRoot, "generated", name));
15705
+ return DEFAULT_BUNDLED_FILENAMES7.map((name) => resolve28(packageRoot, "generated", name));
15546
15706
  };
15547
15707
  async function loadModelFirebaseIndexRegistry(input) {
15548
15708
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS7, readFile: readFile33 } = input;
@@ -15550,10 +15710,10 @@ async function loadModelFirebaseIndexRegistry(input) {
15550
15710
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15551
15711
  const externalSources = [];
15552
15712
  if (configResult.config != null && configResult.configPath != null) {
15553
- const baseDir = dirname9(configResult.configPath);
15713
+ const baseDir = dirname10(configResult.configPath);
15554
15714
  const declared = configResult.config.modelFirebaseIndex?.sources ?? [];
15555
15715
  for (const source of declared) {
15556
- const absolute = isAbsolute9(source) ? source : resolve27(baseDir, source);
15716
+ const absolute = isAbsolute9(source) ? source : resolve28(baseDir, source);
15557
15717
  externalSources.push({ origin: "external", path: absolute });
15558
15718
  }
15559
15719
  }
@@ -15579,7 +15739,7 @@ async function loadModelFirebaseIndexRegistry(input) {
15579
15739
  }
15580
15740
 
15581
15741
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.ts
15582
- import { dirname as dirname10, isAbsolute as isAbsolute10, resolve as resolve28 } from "node:path";
15742
+ import { dirname as dirname11, isAbsolute as isAbsolute10, resolve as resolve29 } from "node:path";
15583
15743
 
15584
15744
  // packages/dbx-cli/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.ts
15585
15745
  async function loadModelSnapshotFieldManifests(input) {
@@ -15596,7 +15756,7 @@ async function loadModelSnapshotFieldManifests(input) {
15596
15756
  var DEFAULT_BUNDLED_FILENAMES8 = ["dereekb-firebase.model-snapshot-fields.mcp.generated.json"];
15597
15757
  var DEFAULT_BUNDLED_PATHS8 = () => {
15598
15758
  const packageRoot = findPackageRoot(import.meta.url);
15599
- return DEFAULT_BUNDLED_FILENAMES8.map((name) => resolve28(packageRoot, "generated", name));
15759
+ return DEFAULT_BUNDLED_FILENAMES8.map((name) => resolve29(packageRoot, "generated", name));
15600
15760
  };
15601
15761
  async function loadModelSnapshotFieldRegistry(input) {
15602
15762
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS8, readFile: readFile33 } = input;
@@ -15604,10 +15764,10 @@ async function loadModelSnapshotFieldRegistry(input) {
15604
15764
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15605
15765
  const externalSources = [];
15606
15766
  if (configResult.config != null && configResult.configPath != null) {
15607
- const baseDir = dirname10(configResult.configPath);
15767
+ const baseDir = dirname11(configResult.configPath);
15608
15768
  const declared = configResult.config.modelSnapshotFields?.sources ?? [];
15609
15769
  for (const source of declared) {
15610
- const absolute = isAbsolute10(source) ? source : resolve28(baseDir, source);
15770
+ const absolute = isAbsolute10(source) ? source : resolve29(baseDir, source);
15611
15771
  externalSources.push({ origin: "external", path: absolute });
15612
15772
  }
15613
15773
  }
@@ -15634,7 +15794,7 @@ async function loadModelSnapshotFieldRegistry(input) {
15634
15794
  }
15635
15795
 
15636
15796
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-pipes-registry.ts
15637
- import { dirname as dirname11, isAbsolute as isAbsolute11, resolve as resolve29 } from "node:path";
15797
+ import { dirname as dirname12, isAbsolute as isAbsolute11, resolve as resolve30 } from "node:path";
15638
15798
 
15639
15799
  // packages/dbx-cli/src/lib/mcp-scan/manifest/pipes-loader.ts
15640
15800
  async function loadPipeManifests(input) {
@@ -15651,7 +15811,7 @@ async function loadPipeManifests(input) {
15651
15811
  var DEFAULT_BUNDLED_FILENAMES9 = ["dereekb-dbx-core.pipes.mcp.generated.json"];
15652
15812
  var DEFAULT_BUNDLED_PATHS9 = () => {
15653
15813
  const packageRoot = findPackageRoot(import.meta.url);
15654
- return DEFAULT_BUNDLED_FILENAMES9.map((name) => resolve29(packageRoot, "generated", name));
15814
+ return DEFAULT_BUNDLED_FILENAMES9.map((name) => resolve30(packageRoot, "generated", name));
15655
15815
  };
15656
15816
  async function loadPipeRegistry(input) {
15657
15817
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS9, readFile: readFile33 } = input;
@@ -15659,10 +15819,10 @@ async function loadPipeRegistry(input) {
15659
15819
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15660
15820
  const externalSources = [];
15661
15821
  if (configResult.config != null && configResult.configPath != null) {
15662
- const baseDir = dirname11(configResult.configPath);
15822
+ const baseDir = dirname12(configResult.configPath);
15663
15823
  const declared = configResult.config.pipes?.sources ?? [];
15664
15824
  for (const source of declared) {
15665
- const absolute = isAbsolute11(source) ? source : resolve29(baseDir, source);
15825
+ const absolute = isAbsolute11(source) ? source : resolve30(baseDir, source);
15666
15826
  externalSources.push({ origin: "external", path: absolute });
15667
15827
  }
15668
15828
  }
@@ -15685,17 +15845,17 @@ async function loadPipeRegistry(input) {
15685
15845
  }
15686
15846
 
15687
15847
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-tokens-registry.ts
15688
- import { dirname as dirname12, isAbsolute as isAbsolute12, resolve as resolve30 } from "node:path";
15848
+ import { dirname as dirname13, isAbsolute as isAbsolute12, resolve as resolve31 } from "node:path";
15689
15849
 
15690
15850
  // packages/dbx-cli/src/lib/mcp-scan/manifest/tokens-schema.ts
15691
- import { type as type42 } from "arktype";
15851
+ import { type as type43 } from "arktype";
15692
15852
  var TOKEN_ROLES = ["color", "text-color", "surface", "spacing", "radius", "elevation", "shadow", "typography", "motion", "state-layer", "size", "breakpoint", "misc"];
15693
15853
  var TOKEN_SOURCES = ["dbx-web", "dbx-form", "mat-sys", "mdc", "app"];
15694
- var TokenDefaults = type42({
15854
+ var TokenDefaults = type43({
15695
15855
  "light?": "string",
15696
15856
  "dark?": "string"
15697
15857
  });
15698
- var TokenEntry = type42({
15858
+ var TokenEntry = type43({
15699
15859
  cssVariable: "string",
15700
15860
  "scssVariable?": "string",
15701
15861
  source: '"dbx-web" | "dbx-form" | "mat-sys" | "mdc" | "app"',
@@ -15709,7 +15869,7 @@ var TokenEntry = type42({
15709
15869
  "recommendedPrimitive?": "string",
15710
15870
  "seeAlso?": "string[]"
15711
15871
  });
15712
- var TokenManifest = type42({
15872
+ var TokenManifest = type43({
15713
15873
  version: "1",
15714
15874
  source: "string",
15715
15875
  module: "string",
@@ -15733,7 +15893,7 @@ async function loadTokenManifests(input) {
15733
15893
  var DEFAULT_BUNDLED_FILENAMES10 = ["dereekb-dbx-web.tokens.mcp.generated.json", "dereekb-dbx-form.tokens.mcp.generated.json", "angular-material-m3.tokens.mcp.generated.json", "angular-material-mdc.tokens.mcp.generated.json"];
15734
15894
  var DEFAULT_BUNDLED_PATHS10 = () => {
15735
15895
  const packageRoot = findPackageRoot(import.meta.url);
15736
- return DEFAULT_BUNDLED_FILENAMES10.map((name) => resolve30(packageRoot, "generated", name));
15896
+ return DEFAULT_BUNDLED_FILENAMES10.map((name) => resolve31(packageRoot, "generated", name));
15737
15897
  };
15738
15898
  async function loadTokenRegistry(input) {
15739
15899
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS10, readFile: readFile33 } = input;
@@ -15760,7 +15920,7 @@ async function loadTokenRegistry(input) {
15760
15920
  function collectExternalTokenSources(configResult) {
15761
15921
  const externalSources = [];
15762
15922
  if (configResult.config != null && configResult.configPath != null) {
15763
- const baseDir = dirname12(configResult.configPath);
15923
+ const baseDir = dirname13(configResult.configPath);
15764
15924
  const tokensCluster = configResult.config.tokens;
15765
15925
  for (const source of tokensCluster?.sources ?? []) {
15766
15926
  externalSources.push({ origin: "external", path: toAbsolutePath2(baseDir, source) });
@@ -15775,11 +15935,11 @@ function collectExternalTokenSources(configResult) {
15775
15935
  return externalSources;
15776
15936
  }
15777
15937
  function toAbsolutePath2(baseDir, value) {
15778
- return isAbsolute12(value) ? value : resolve30(baseDir, value);
15938
+ return isAbsolute12(value) ? value : resolve31(baseDir, value);
15779
15939
  }
15780
15940
 
15781
15941
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-ui-components-registry.ts
15782
- import { dirname as dirname13, isAbsolute as isAbsolute13, resolve as resolve31 } from "node:path";
15942
+ import { dirname as dirname14, isAbsolute as isAbsolute13, resolve as resolve32 } from "node:path";
15783
15943
 
15784
15944
  // packages/dbx-cli/src/lib/mcp-scan/manifest/ui-components-loader.ts
15785
15945
  async function loadUiComponentManifests(input) {
@@ -15796,7 +15956,7 @@ async function loadUiComponentManifests(input) {
15796
15956
  var DEFAULT_BUNDLED_FILENAMES11 = ["dereekb-dbx-web.ui-components.mcp.generated.json"];
15797
15957
  var DEFAULT_BUNDLED_PATHS11 = () => {
15798
15958
  const packageRoot = findPackageRoot(import.meta.url);
15799
- return DEFAULT_BUNDLED_FILENAMES11.map((name) => resolve31(packageRoot, "generated", name));
15959
+ return DEFAULT_BUNDLED_FILENAMES11.map((name) => resolve32(packageRoot, "generated", name));
15800
15960
  };
15801
15961
  async function loadUiComponentRegistry(input) {
15802
15962
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS11, readFile: readFile33 } = input;
@@ -15804,10 +15964,10 @@ async function loadUiComponentRegistry(input) {
15804
15964
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15805
15965
  const externalSources = [];
15806
15966
  if (configResult.config != null && configResult.configPath != null) {
15807
- const baseDir = dirname13(configResult.configPath);
15967
+ const baseDir = dirname14(configResult.configPath);
15808
15968
  const declared = configResult.config.uiComponents?.sources ?? [];
15809
15969
  for (const source of declared) {
15810
- const absolute = isAbsolute13(source) ? source : resolve31(baseDir, source);
15970
+ const absolute = isAbsolute13(source) ? source : resolve32(baseDir, source);
15811
15971
  externalSources.push({ origin: "external", path: absolute });
15812
15972
  }
15813
15973
  }
@@ -15830,7 +15990,7 @@ async function loadUiComponentRegistry(input) {
15830
15990
  }
15831
15991
 
15832
15992
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-utils-registry.ts
15833
- import { dirname as dirname14, isAbsolute as isAbsolute14, resolve as resolve32 } from "node:path";
15993
+ import { dirname as dirname15, isAbsolute as isAbsolute14, resolve as resolve33 } from "node:path";
15834
15994
 
15835
15995
  // packages/dbx-cli/src/lib/mcp-scan/manifest/utils-loader.ts
15836
15996
  async function loadUtilManifests(input) {
@@ -15847,7 +16007,7 @@ async function loadUtilManifests(input) {
15847
16007
  var DEFAULT_BUNDLED_FILENAMES12 = ["dereekb-util.utils.mcp.generated.json", "dereekb-date.utils.mcp.generated.json", "dereekb-rxjs.utils.mcp.generated.json", "dereekb-model.utils.mcp.generated.json"];
15848
16008
  var DEFAULT_BUNDLED_PATHS12 = () => {
15849
16009
  const packageRoot = findPackageRoot(import.meta.url);
15850
- return DEFAULT_BUNDLED_FILENAMES12.map((name) => resolve32(packageRoot, "generated", name));
16010
+ return DEFAULT_BUNDLED_FILENAMES12.map((name) => resolve33(packageRoot, "generated", name));
15851
16011
  };
15852
16012
  async function loadUtilRegistry(input) {
15853
16013
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS12, readFile: readFile33 } = input;
@@ -15855,10 +16015,10 @@ async function loadUtilRegistry(input) {
15855
16015
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15856
16016
  const externalSources = [];
15857
16017
  if (configResult.config != null && configResult.configPath != null) {
15858
- const baseDir = dirname14(configResult.configPath);
16018
+ const baseDir = dirname15(configResult.configPath);
15859
16019
  const declared = configResult.config.utils?.sources ?? [];
15860
16020
  for (const source of declared) {
15861
- const absolute = isAbsolute14(source) ? source : resolve32(baseDir, source);
16021
+ const absolute = isAbsolute14(source) ? source : resolve33(baseDir, source);
15862
16022
  externalSources.push({ origin: "external", path: absolute });
15863
16023
  }
15864
16024
  }
@@ -16574,7 +16734,7 @@ function loadRouteTree(args) {
16574
16734
  }
16575
16735
 
16576
16736
  // packages/dbx-cli/src/lib/route/component-resolve.ts
16577
- import { dirname as dirname15, join as join5, normalize } from "node:path/posix";
16737
+ import { dirname as dirname16, join as join5, normalize } from "node:path/posix";
16578
16738
  var TRY_EXTENSIONS = [".ts", ".tsx", "/index.ts", "/index.tsx"];
16579
16739
  function resolveComponentSourceFromSources(input) {
16580
16740
  const byName = /* @__PURE__ */ new Map();
@@ -16594,7 +16754,7 @@ function resolveComponentSourceFromSources(input) {
16594
16754
  function resolveSpecifier(specifier, routerFile, byName) {
16595
16755
  let result;
16596
16756
  if (specifier.startsWith(".")) {
16597
- const base = normalize(join5(dirname15(routerFile), specifier));
16757
+ const base = normalize(join5(dirname16(routerFile), specifier));
16598
16758
  let resolved;
16599
16759
  for (const ext of TRY_EXTENSIONS) {
16600
16760
  const candidate = base + ext;
@@ -17006,7 +17166,7 @@ function detectMissingRouteModels(states, warnings) {
17006
17166
  // packages/dbx-components-mcp/src/server.ts
17007
17167
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
17008
17168
  import { McpServer } from "@modelcontextprotocol/server";
17009
- import { dirname as dirname23, isAbsolute as isAbsolute20, resolve as resolvePath4 } from "node:path";
17169
+ import { dirname as dirname24, isAbsolute as isAbsolute20, resolve as resolvePath4 } from "node:path";
17010
17170
 
17011
17171
  // packages/dbx-components-mcp/src/resources/form-fields.resource.ts
17012
17172
  import { ResourceTemplate } from "@modelcontextprotocol/server";
@@ -19512,7 +19672,7 @@ function registerAuthResource(server, options) {
19512
19672
 
19513
19673
  // packages/dbx-components-mcp/src/resources/firestore-rules.resource.ts
19514
19674
  import { readFile as readFile4 } from "node:fs/promises";
19515
- import { resolve as resolve33 } from "node:path";
19675
+ import { resolve as resolve34 } from "node:path";
19516
19676
  import { ResourceTemplate as ResourceTemplate15 } from "@modelcontextprotocol/server";
19517
19677
 
19518
19678
  // packages/dbx-cli/firestore-rules/src/firestore-rules-scan.ts
@@ -19739,7 +19899,7 @@ function registerFirestoreRulesResource(server, options = {}) {
19739
19899
  const cwd = options.cwd ?? process.cwd();
19740
19900
  let result;
19741
19901
  try {
19742
- result = { scan: scanFirestoreRules(await readFile4(resolve33(cwd, rulesFile), "utf8")) };
19902
+ result = { scan: scanFirestoreRules(await readFile4(resolve34(cwd, rulesFile), "utf8")) };
19743
19903
  } catch (e) {
19744
19904
  result = { error: `Failed to read ${rulesFile}: ${e instanceof Error ? e.message : String(e)}` };
19745
19905
  }
@@ -19862,7 +20022,7 @@ function registerResources(server, options = {}) {
19862
20022
  }
19863
20023
 
19864
20024
  // packages/dbx-components-mcp/src/tools/lookup-form.tool.ts
19865
- import { type as type43 } from "arktype";
20025
+ import { type as type44 } from "arktype";
19866
20026
 
19867
20027
  // packages/dbx-components-mcp/src/tools/form-alias-resolver.ts
19868
20028
  var ALIASES = {
@@ -20087,7 +20247,7 @@ function toolError(message) {
20087
20247
  return result;
20088
20248
  }
20089
20249
  function toCallToolResult(result) {
20090
- const content = result.content.map(({ type: type109, text }) => ({ type: type109, text }));
20250
+ const content = result.content.map(({ type: type110, text }) => ({ type: type110, text }));
20091
20251
  const callToolResult = result.isError === void 0 ? { content } : { content, isError: result.isError };
20092
20252
  return callToolResult;
20093
20253
  }
@@ -20124,13 +20284,13 @@ var DBX_FORM_LOOKUP_TOOL = {
20124
20284
  required: ["topic"]
20125
20285
  }
20126
20286
  };
20127
- var LookupFormArgsType = type43({
20287
+ var LookupFormArgsType = type44({
20128
20288
  topic: "string",
20129
20289
  "depth?": "'brief' | 'full'"
20130
20290
  });
20131
20291
  function parseLookupFormArgs(raw) {
20132
20292
  const parsed = LookupFormArgsType(raw);
20133
- if (parsed instanceof type43.errors) {
20293
+ if (parsed instanceof type44.errors) {
20134
20294
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20135
20295
  }
20136
20296
  return {
@@ -20254,14 +20414,14 @@ function createLookupFormTool(config) {
20254
20414
  }
20255
20415
 
20256
20416
  // packages/dbx-components-mcp/src/tools/_search/score.ts
20257
- import { type as type44 } from "arktype";
20258
- var SEARCH_ARGS_TYPE = type44({
20417
+ import { type as type45 } from "arktype";
20418
+ var SEARCH_ARGS_TYPE = type45({
20259
20419
  query: "string",
20260
20420
  "limit?": "number"
20261
20421
  });
20262
20422
  function parseSearchArgs(raw, config) {
20263
20423
  const parsed = SEARCH_ARGS_TYPE(raw);
20264
- if (parsed instanceof type44.errors) {
20424
+ if (parsed instanceof type45.errors) {
20265
20425
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20266
20426
  }
20267
20427
  const rawLimit = parsed.limit ?? config.defaultLimit;
@@ -20506,7 +20666,7 @@ function createSearchFormTool(config) {
20506
20666
  }
20507
20667
 
20508
20668
  // packages/dbx-components-mcp/src/tools/form-examples.tool.ts
20509
- import { type as type45 } from "arktype";
20669
+ import { type as type46 } from "arktype";
20510
20670
 
20511
20671
  // packages/dbx-components-mcp/src/tools/data/patterns/forms/form.address-form.pattern.ts
20512
20672
  var FORM_PATTERN_ADDRESS_FORM = {
@@ -20795,13 +20955,13 @@ var DBX_FORM_EXAMPLES_TOOL = {
20795
20955
  required: ["pattern"]
20796
20956
  }
20797
20957
  };
20798
- var ExamplesArgsType = type45({
20958
+ var ExamplesArgsType = type46({
20799
20959
  pattern: "string",
20800
20960
  "depth?": "'minimal' | 'brief' | 'full'"
20801
20961
  });
20802
20962
  function parseExamplesArgs(raw) {
20803
20963
  const parsed = ExamplesArgsType(raw);
20804
- if (parsed instanceof type45.errors) {
20964
+ if (parsed instanceof type46.errors) {
20805
20965
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20806
20966
  }
20807
20967
  const result = {
@@ -20862,7 +21022,7 @@ var FORM_EXAMPLES_TOOL = {
20862
21022
  };
20863
21023
 
20864
21024
  // packages/dbx-components-mcp/src/tools/form-scaffold.tool.ts
20865
- import { type as type46 } from "arktype";
21025
+ import { type as type47 } from "arktype";
20866
21026
  var DEFAULT_VALUE_TYPE_NAME = "ScaffoldedFormValue";
20867
21027
  var DBX_FORM_SCAFFOLD_TOOL = {
20868
21028
  name: "dbx_form_scaffold",
@@ -20900,14 +21060,14 @@ var DBX_FORM_SCAFFOLD_TOOL = {
20900
21060
  required: ["fields"]
20901
21061
  }
20902
21062
  };
20903
- var ScaffoldArgsType = type46({
21063
+ var ScaffoldArgsType = type47({
20904
21064
  fields: "string[]>0",
20905
21065
  "valueTypeName?": "string",
20906
21066
  "wrapInSection?": "boolean"
20907
21067
  });
20908
21068
  function parseScaffoldArgs(raw) {
20909
21069
  const parsed = ScaffoldArgsType(raw);
20910
- if (parsed instanceof type46.errors) {
21070
+ if (parsed instanceof type47.errors) {
20911
21071
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20912
21072
  }
20913
21073
  const result = {
@@ -21065,7 +21225,7 @@ ${code17}
21065
21225
  }
21066
21226
 
21067
21227
  // packages/dbx-components-mcp/src/tools/lookup-ui.tool.ts
21068
- import { type as type47 } from "arktype";
21228
+ import { type as type48 } from "arktype";
21069
21229
  var DBX_UI_LOOKUP_TOOL = {
21070
21230
  name: "dbx_ui_lookup",
21071
21231
  description: [
@@ -21095,13 +21255,13 @@ var DBX_UI_LOOKUP_TOOL = {
21095
21255
  required: ["topic"]
21096
21256
  }
21097
21257
  };
21098
- var LookupUiArgsType = type47({
21258
+ var LookupUiArgsType = type48({
21099
21259
  topic: "string",
21100
21260
  "depth?": "'brief' | 'full'"
21101
21261
  });
21102
21262
  function parseLookupUiArgs(raw) {
21103
21263
  const parsed = LookupUiArgsType(raw);
21104
- if (parsed instanceof type47.errors) {
21264
+ if (parsed instanceof type48.errors) {
21105
21265
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
21106
21266
  }
21107
21267
  const result = {
@@ -21359,7 +21519,7 @@ function createLookupUiTool(input) {
21359
21519
  }
21360
21520
 
21361
21521
  // packages/dbx-components-mcp/src/tools/search-ui.tool.ts
21362
- import { type as type48 } from "arktype";
21522
+ import { type as type49 } from "arktype";
21363
21523
  var DEFAULT_LIMIT2 = 10;
21364
21524
  var MAX_LIMIT2 = 25;
21365
21525
  var DBX_UI_SEARCH_TOOL = {
@@ -21396,14 +21556,14 @@ var DBX_UI_SEARCH_TOOL = {
21396
21556
  required: ["query"]
21397
21557
  }
21398
21558
  };
21399
- var SearchUiArgsType = type48({
21559
+ var SearchUiArgsType = type49({
21400
21560
  query: "string",
21401
21561
  "category?": "'layout' | 'list' | 'button' | 'card' | 'feedback' | 'overlay' | 'navigation' | 'text' | 'screen' | 'action' | 'router' | 'misc'",
21402
21562
  "limit?": "number"
21403
21563
  });
21404
21564
  function parseSearchUiArgs(raw) {
21405
21565
  const parsed = SearchUiArgsType(raw);
21406
- if (parsed instanceof type48.errors) {
21566
+ if (parsed instanceof type49.errors) {
21407
21567
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
21408
21568
  }
21409
21569
  const rawLimit = parsed.limit ?? DEFAULT_LIMIT2;
@@ -21603,7 +21763,7 @@ function createSearchUiTool(input) {
21603
21763
  }
21604
21764
 
21605
21765
  // packages/dbx-components-mcp/src/tools/ui-examples.tool.ts
21606
- import { type as type49 } from "arktype";
21766
+ import { type as type50 } from "arktype";
21607
21767
 
21608
21768
  // packages/dbx-components-mcp/src/tools/data/patterns/ui/ui.card-with-action.pattern.ts
21609
21769
  var UI_PATTERN_CARD_WITH_ACTION = {
@@ -22001,13 +22161,13 @@ var DBX_UI_EXAMPLES_TOOL = {
22001
22161
  required: ["pattern"]
22002
22162
  }
22003
22163
  };
22004
- var UiExamplesArgsType = type49({
22164
+ var UiExamplesArgsType = type50({
22005
22165
  pattern: "string",
22006
22166
  "depth?": "'minimal' | 'brief' | 'full'"
22007
22167
  });
22008
22168
  function parseUiExamplesArgs(raw) {
22009
22169
  const parsed = UiExamplesArgsType(raw);
22010
- if (parsed instanceof type49.errors) {
22170
+ if (parsed instanceof type50.errors) {
22011
22171
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
22012
22172
  }
22013
22173
  return {
@@ -22176,7 +22336,7 @@ function createUiExamplesTool(input = {}) {
22176
22336
  }
22177
22337
 
22178
22338
  // packages/dbx-components-mcp/src/tools/lookup-model.tool.ts
22179
- import { type as type50 } from "arktype";
22339
+ import { type as type51 } from "arktype";
22180
22340
 
22181
22341
  // packages/dbx-components-mcp/src/tools/firebase-lookup.formatter.ts
22182
22342
  function applyFieldsFilter(model, filter) {
@@ -25680,10 +25840,10 @@ function formatSeeAlso(ref) {
25680
25840
 
25681
25841
  // packages/dbx-cli/validate/src/lib/_core/validate-input.ts
25682
25842
  import { glob as fsGlob5, readFile as readFile5, stat as stat4 } from "node:fs/promises";
25683
- import { resolve as resolve34, sep as sep5 } from "node:path";
25843
+ import { resolve as resolve35, sep as sep5 } from "node:path";
25684
25844
  function ensurePathInsideCwd(relative23, cwd) {
25685
25845
  const cwdPrefix = cwd.endsWith(sep5) ? cwd : cwd + sep5;
25686
- const absolute = resolve34(cwd, relative23);
25846
+ const absolute = resolve35(cwd, relative23);
25687
25847
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
25688
25848
  throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
25689
25849
  }
@@ -25705,7 +25865,7 @@ async function resolveFolderPaths(config) {
25705
25865
  }
25706
25866
  if (glob2) {
25707
25867
  for await (const match of fsGlob5(glob2, { cwd })) {
25708
- const absolute = resolve34(cwd, match);
25868
+ const absolute = resolve35(cwd, match);
25709
25869
  try {
25710
25870
  const stats = await stat4(absolute);
25711
25871
  if (!stats.isDirectory()) continue;
@@ -25742,7 +25902,7 @@ async function resolveValidatorSources(config) {
25742
25902
  for (const relative23 of pathList) {
25743
25903
  if (seenNames.has(relative23)) continue;
25744
25904
  ensurePathInsideCwd(relative23, cwd);
25745
- const absolute = resolve34(cwd, relative23);
25905
+ const absolute = resolve35(cwd, relative23);
25746
25906
  const text = await readFile5(absolute, "utf8");
25747
25907
  seenNames.add(relative23);
25748
25908
  collected.push({ name: relative23, text });
@@ -29315,6 +29475,7 @@ var SERVICE_FACTORY_TAG = "dbxModelServiceFactory";
29315
29475
  var MCP_TOOL_NAME_SEGMENT_TAG = "dbxModelMcpToolNameSegment";
29316
29476
  var MODEL_TYPE_VALUE_PATTERN2 = /^[a-z][A-Za-z0-9_$]*$/;
29317
29477
  var TOOL_NAME_SEGMENT_PATTERN = /^[A-Za-z][A-Za-z0-9_$]*$/;
29478
+ var COMPOSITE_KEY_MODEL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_$]*$/;
29318
29479
  var IDENTITY_FN = "firestoreModelIdentity";
29319
29480
  var IDENTITY_TYPE = "FirestoreModelIdentity";
29320
29481
  var ROOT_IDENTITY_TYPE = "RootFirestoreModelIdentity";
@@ -29431,6 +29592,7 @@ function buildInterface2(decl) {
29431
29592
  const dbxModelRead = readDbxModelReadTag(jsDocs);
29432
29593
  const dbxModelServerOnly = jsDocsHaveTag(jsDocs, "dbxModelServerOnly");
29433
29594
  const mcpToolNameSegment = readMcpToolNameSegmentTag(jsDocs);
29595
+ const compositeKey2 = readDbxModelCompositeKeyTag2(jsDocs);
29434
29596
  const extendsNames = decl.getExtends().map(resolveExtendsName);
29435
29597
  const props = [];
29436
29598
  for (const prop of decl.getProperties()) {
@@ -29456,7 +29618,8 @@ function buildInterface2(decl) {
29456
29618
  props,
29457
29619
  ...dbxModelRead === void 0 ? {} : { dbxModelRead },
29458
29620
  ...dbxModelServerOnly ? { dbxModelServerOnly: true } : {},
29459
- ...mcpToolNameSegment === void 0 ? {} : { mcpToolNameSegment }
29621
+ ...mcpToolNameSegment === void 0 ? {} : { mcpToolNameSegment },
29622
+ ...compositeKey2 === void 0 ? {} : { compositeKey: compositeKey2 }
29460
29623
  };
29461
29624
  }
29462
29625
  function readMcpToolNameSegmentTag(jsDocs) {
@@ -29491,6 +29654,43 @@ function readDbxModelReadTag(jsDocs) {
29491
29654
  }
29492
29655
  return result;
29493
29656
  }
29657
+ function readDbxModelCompositeKeyTag2(jsDocs) {
29658
+ let result;
29659
+ for (const doc of jsDocs) {
29660
+ for (const tag of doc.getTags()) {
29661
+ if (tag.getTagName() !== "dbxModelCompositeKey") continue;
29662
+ if (result !== void 0) continue;
29663
+ result = parseCompositeKeyTagValue2(tag.getCommentText() ?? "");
29664
+ }
29665
+ }
29666
+ return result;
29667
+ }
29668
+ function parseCompositeKeyTagValue2(raw) {
29669
+ let from;
29670
+ let encoding;
29671
+ for (const token of raw.trim().split(/\s+/)) {
29672
+ const eq = token.indexOf("=");
29673
+ if (eq <= 0) continue;
29674
+ const key = token.slice(0, eq);
29675
+ const value = token.slice(eq + 1);
29676
+ if (key === "from") {
29677
+ from = parseCompositeKeyFromValue3(value);
29678
+ } else if (key === "encoding" && (value === "one-way" || value === "two-way")) {
29679
+ encoding = value;
29680
+ }
29681
+ }
29682
+ return from !== void 0 && encoding !== void 0 ? { from, encoding } : void 0;
29683
+ }
29684
+ function parseCompositeKeyFromValue3(value) {
29685
+ let result;
29686
+ if (value === "*") {
29687
+ result = "*";
29688
+ } else {
29689
+ const names = value.split(",").map((x) => x.trim()).filter((x) => COMPOSITE_KEY_MODEL_NAME_PATTERN.test(x));
29690
+ result = names.length > 0 ? names : void 0;
29691
+ }
29692
+ return result;
29693
+ }
29494
29694
  function readServiceFactories(sourceFile) {
29495
29695
  const out = [];
29496
29696
  for (const statement of sourceFile.getVariableStatements()) {
@@ -30134,7 +30334,7 @@ function normalize2(value) {
30134
30334
 
30135
30335
  // packages/dbx-cli/validate/src/lib/model-api-validate-app/source-roots.ts
30136
30336
  import { readFile as readFile10, stat as stat8 } from "node:fs/promises";
30137
- import { dirname as dirname16, isAbsolute as isAbsolute15, join as join10, relative as relative10, resolve as resolve35, sep as sep7 } from "node:path";
30337
+ import { dirname as dirname17, isAbsolute as isAbsolute15, join as join10, relative as relative10, resolve as resolve36, sep as sep7 } from "node:path";
30138
30338
  var TSCONFIG_BASE = "tsconfig.base.json";
30139
30339
  var COMPONENT_PACKAGE_JSON = "package.json";
30140
30340
  var SRC_LIB_SUBPATH = "src/lib";
@@ -30160,7 +30360,7 @@ async function resolveApiSourceRoots(input) {
30160
30360
  return { roots, workspaceRoot };
30161
30361
  }
30162
30362
  async function findWorkspaceRoot(startAbs) {
30163
- let current = resolve35(startAbs);
30363
+ let current = resolve36(startAbs);
30164
30364
  for (; ; ) {
30165
30365
  const candidate = join10(current, TSCONFIG_BASE);
30166
30366
  try {
@@ -30168,7 +30368,7 @@ async function findWorkspaceRoot(startAbs) {
30168
30368
  if (s.isFile()) return current;
30169
30369
  } catch {
30170
30370
  }
30171
- const parent = dirname16(current);
30371
+ const parent = dirname17(current);
30172
30372
  if (parent === current) return void 0;
30173
30373
  current = parent;
30174
30374
  }
@@ -30244,8 +30444,8 @@ async function readTsconfigPaths(workspaceRoot) {
30244
30444
  function resolvePackageRoot(input) {
30245
30445
  const target = input.paths.entries.get(input.packageName);
30246
30446
  if (!target) return void 0;
30247
- const targetAbs = isAbsolute15(target) ? target : resolve35(input.workspaceRoot, target);
30248
- return dirname16(dirname16(targetAbs));
30447
+ const targetAbs = isAbsolute15(target) ? target : resolve36(input.workspaceRoot, target);
30448
+ return dirname17(dirname17(targetAbs));
30249
30449
  }
30250
30450
  async function isDirectory2(path) {
30251
30451
  let result = false;
@@ -37427,7 +37627,7 @@ __export(server_actions_list_app_exports, {
37427
37627
 
37428
37628
  // packages/dbx-cli/validate/src/lib/server-actions-list-app/extract.ts
37429
37629
  import { readdir as readdir10, readFile as readFile21 } from "node:fs/promises";
37430
- import { dirname as dirname17, join as join21, relative as relative18, sep as sep15 } from "node:path";
37630
+ import { dirname as dirname18, join as join21, relative as relative18, sep as sep15 } from "node:path";
37431
37631
  import { Node as Node34, Project as Project18 } from "ts-morph";
37432
37632
  var ACTION_SERVER_SUFFIX2 = ".action.server.ts";
37433
37633
  var COMMON_MODEL_SUBPATH2 = "src/app/common/model";
@@ -37502,7 +37702,7 @@ async function inspectSiblingModule(actionFilePath, className) {
37502
37702
  return { modulePath: moduleCandidates[0], providedByModule: false, exportedByModule: false };
37503
37703
  }
37504
37704
  async function findModuleCandidates(actionFilePath) {
37505
- const dir = dirname17(actionFilePath);
37705
+ const dir = dirname18(actionFilePath);
37506
37706
  const out = [];
37507
37707
  try {
37508
37708
  const entries = await readdir10(dir, { withFileTypes: true });
@@ -40088,7 +40288,7 @@ var DBX_MODEL_LOOKUP_TOOL = {
40088
40288
  required: ["topic"]
40089
40289
  }
40090
40290
  };
40091
- var LookupModelArgsType = type50({
40291
+ var LookupModelArgsType = type51({
40092
40292
  topic: "string",
40093
40293
  "depth?": "'brief' | 'full'",
40094
40294
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -40115,7 +40315,7 @@ function normalizeFieldsFilter(raw) {
40115
40315
  }
40116
40316
  function parseLookupModelArgs(raw) {
40117
40317
  const parsed = LookupModelArgsType(raw);
40118
- if (parsed instanceof type50.errors) {
40318
+ if (parsed instanceof type51.errors) {
40119
40319
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40120
40320
  }
40121
40321
  return {
@@ -40247,10 +40447,10 @@ var LOOKUP_MODEL_TOOL = {
40247
40447
  };
40248
40448
 
40249
40449
  // packages/dbx-components-mcp/src/tools/search-model.tool.ts
40250
- import { type as type51 } from "arktype";
40450
+ import { type as type52 } from "arktype";
40251
40451
  var DEFAULT_LIMIT3 = 10;
40252
40452
  var MAX_LIMIT3 = 25;
40253
- var SearchArgsType = type51({
40453
+ var SearchArgsType = type52({
40254
40454
  query: "string",
40255
40455
  "limit?": "number",
40256
40456
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -40407,7 +40607,7 @@ function formatSourceLine(scope, upstreamCount, downstreamPackages) {
40407
40607
  }
40408
40608
  function parseArgs2(rawArgs) {
40409
40609
  const parsed = SearchArgsType(rawArgs);
40410
- if (parsed instanceof type51.errors) {
40610
+ if (parsed instanceof type52.errors) {
40411
40611
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40412
40612
  }
40413
40613
  return {
@@ -40481,7 +40681,7 @@ var SEARCH_MODEL_TOOL = {
40481
40681
  };
40482
40682
 
40483
40683
  // packages/dbx-components-mcp/src/tools/model-decode.tool.ts
40484
- import { type as type52 } from "arktype";
40684
+ import { type as type53 } from "arktype";
40485
40685
 
40486
40686
  // packages/dbx-components-mcp/src/tools/decode.formatter.ts
40487
40687
  function formatDecode(context) {
@@ -40629,7 +40829,7 @@ var DBX_MODEL_DECODE_TOOL = {
40629
40829
  "",
40630
40830
  'Document mode \u2014 pass `data` as a JSON string (copied straight from the Firestore console) or an already-parsed object to identify the model, expand abbreviated field names, decode enum integer values, and surface foreign-key relationships. Optionally pass `model` to skip detection and target a specific model by interface name (`"StorageFile"`), identity constant (`"storageFileIdentity"`), `modelType` (`"storageFile"`), or collection prefix (`"sf"`).',
40631
40831
  "",
40632
- 'Key mode \u2014 pass just `key` (e.g. `"jwr/hkzQa9W6MpaP99RTlQJcImbWdZm2"`) to resolve the model identity and id from the collection prefix alone, no document required. Subcollection paths like `"nb/abc/nbn/def"` are walked end-to-end so the leaf model is reported alongside its parent chain.',
40832
+ 'Key mode \u2014 pass just `key` (e.g. `"jwr/hkzQa9W6MpaP99RTlQJcImbWdZm2"`) to resolve the model identity and id from the collection prefix alone, no document required. Subcollection paths like `"nb/abc/nbn/def"` are walked end-to-end so the leaf model is reported alongside its parent chain. Composite-key models derived from the key (`@dbxModelCompositeKey from=\u2026`) are listed with their ready-to-use flattened keys, and a two-way composite-key leaf reports the source key recovered from its id.',
40633
40833
  "",
40634
40834
  "At least one of `data` or `key` is required."
40635
40835
  ].join("\n"),
@@ -40651,14 +40851,14 @@ var DBX_MODEL_DECODE_TOOL = {
40651
40851
  }
40652
40852
  }
40653
40853
  };
40654
- var DecodeArgsType = type52({
40854
+ var DecodeArgsType = type53({
40655
40855
  "data?": "string | object",
40656
40856
  "key?": "string",
40657
40857
  "model?": "string"
40658
40858
  });
40659
40859
  function parseDecodeArgs(raw) {
40660
40860
  const parsed = DecodeArgsType(raw);
40661
- if (parsed instanceof type52.errors) {
40861
+ if (parsed instanceof type53.errors) {
40662
40862
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40663
40863
  }
40664
40864
  const result = {
@@ -40753,6 +40953,29 @@ function buildPrefixMap() {
40753
40953
  }
40754
40954
  return out;
40755
40955
  }
40956
+ function findDerivedCompositeKeys(rawKey, leafModel) {
40957
+ const out = [];
40958
+ for (const model of FIREBASE_MODELS) {
40959
+ const compositeKey2 = model.compositeKey;
40960
+ if (!compositeKey2 || model.modelType === leafModel.modelType) continue;
40961
+ const matches = compositeKey2.from === "*" || compositeKey2.from.some((name) => name === leafModel.name || name === leafModel.identityConst || name === leafModel.modelType);
40962
+ if (!matches) continue;
40963
+ const flatId = compositeKey2.encoding === "two-way" ? rawKey.replaceAll("/", "_") : rawKey.replaceAll("/", "");
40964
+ out.push({ key: `${model.collectionPrefix}/${flatId}`, model, encoding: compositeKey2.encoding });
40965
+ }
40966
+ return out;
40967
+ }
40968
+ function decodeCompositeSource(leaf) {
40969
+ let result;
40970
+ if (leaf.model?.compositeKey?.encoding === "two-way" && leaf.id.includes("_")) {
40971
+ const sourceKey = leaf.id.replaceAll("_", "/");
40972
+ const decoded = decodeKeyPath(sourceKey, void 0);
40973
+ if (!("error" in decoded)) {
40974
+ result = { key: sourceKey, path: decoded };
40975
+ }
40976
+ }
40977
+ return result;
40978
+ }
40756
40979
  function decodeKeyPath(key, hint) {
40757
40980
  const trimmed = key.trim();
40758
40981
  if (trimmed.length === 0) {
@@ -40819,8 +41042,24 @@ function formatUnresolved(unresolvedPrefixes) {
40819
41042
  const list = unresolvedPrefixes.map((p) => `\`${p}\``).join(", ");
40820
41043
  return ["", `_Unresolved ${label}: ${list}. Run \`dbx_model_lookup\` to browse known models._`];
40821
41044
  }
41045
+ function formatCompositeSource(source) {
41046
+ if (!source) return [];
41047
+ const sourceModel = source.path.leaf.model ? source.path.leaf.model.name : `_unknown_ (prefix \`${source.path.leaf.prefix}\`)`;
41048
+ return ["", `**Composite source (two-way):** \`${source.key}\` \u2192 ${sourceModel}`];
41049
+ }
41050
+ function formatDerivedKeys(derived) {
41051
+ if (derived.length === 0) return [];
41052
+ const out = ["", "**Derived keys:**"];
41053
+ for (const entry of derived) {
41054
+ out.push(`- ${entry.model.name} (${entry.encoding}) \u2014 \`${entry.key}\``);
41055
+ }
41056
+ return out;
41057
+ }
40822
41058
  function formatKeyDecode(input, rawKey) {
40823
- const lines = ["_Model decoded from key prefix._", "", ...formatLeaf(input.leaf), ...formatAncestors(input.ancestors), ...formatUnresolved(input.unresolvedPrefixes), "", `_Key:_ \`${rawKey}\``];
41059
+ const trimmedKey = rawKey.trim();
41060
+ const derived = input.leaf.model ? findDerivedCompositeKeys(trimmedKey, input.leaf.model) : [];
41061
+ const compositeSource = decodeCompositeSource(input.leaf);
41062
+ const lines = ["_Model decoded from key prefix._", "", ...formatLeaf(input.leaf), ...formatAncestors(input.ancestors), ...formatUnresolved(input.unresolvedPrefixes), ...formatCompositeSource(compositeSource), ...formatDerivedKeys(derived), "", `_Key:_ \`${rawKey}\``];
40824
41063
  return lines.join("\n");
40825
41064
  }
40826
41065
  function runModelDecode(rawArgs) {
@@ -40914,9 +41153,9 @@ var MODEL_DECODE_TOOL = {
40914
41153
  };
40915
41154
 
40916
41155
  // packages/dbx-components-mcp/src/tools/validate-tool.ts
40917
- import { resolve as resolve36 } from "node:path";
40918
- import { type as type53 } from "arktype";
40919
- var FolderValidateArgsType = type53({
41156
+ import { resolve as resolve37 } from "node:path";
41157
+ import { type as type54 } from "arktype";
41158
+ var FolderValidateArgsType = type54({
40920
41159
  "paths?": "string[]",
40921
41160
  "glob?": "string"
40922
41161
  });
@@ -40925,7 +41164,7 @@ function createFolderValidateTool(config) {
40925
41164
  const { definition, inspectFolder: inspectFolder5, validate, format } = config;
40926
41165
  async function run24(rawArgs) {
40927
41166
  const parsed = FolderValidateArgsType(rawArgs);
40928
- if (parsed instanceof type53.errors) {
41167
+ if (parsed instanceof type54.errors) {
40929
41168
  return toolError(`Invalid arguments: ${parsed.summary}`);
40930
41169
  }
40931
41170
  const hasAny = parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -40951,7 +41190,7 @@ function createFolderValidateTool(config) {
40951
41190
  let readError;
40952
41191
  try {
40953
41192
  for (const relative23 of paths) {
40954
- const absolute = resolve36(cwd, relative23);
41193
+ const absolute = resolve37(cwd, relative23);
40955
41194
  const inspection = await inspectFolder5(absolute);
40956
41195
  const relativized = { ...inspection, path: relative23 };
40957
41196
  inspections.push(relativized);
@@ -40976,8 +41215,8 @@ function createFolderValidateTool(config) {
40976
41215
  const tool = { definition, run: run24 };
40977
41216
  return tool;
40978
41217
  }
40979
- var SourceValidateArgsType = type53({
40980
- "sources?": type53({ name: "string", text: "string" }).array(),
41218
+ var SourceValidateArgsType = type54({
41219
+ "sources?": type54({ name: "string", text: "string" }).array(),
40981
41220
  "paths?": "string[]",
40982
41221
  "glob?": "string"
40983
41222
  });
@@ -40986,7 +41225,7 @@ function createSourceValidateTool(config) {
40986
41225
  const { definition, validate, format } = config;
40987
41226
  async function run24(rawArgs) {
40988
41227
  const parsed = SourceValidateArgsType(rawArgs);
40989
- if (parsed instanceof type53.errors) {
41228
+ if (parsed instanceof type54.errors) {
40990
41229
  return toolError(`Invalid arguments: ${parsed.summary}`);
40991
41230
  }
40992
41231
  const hasAny = parsed.sources && parsed.sources.length > 0 || parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -41019,7 +41258,7 @@ function createSourceValidateTool(config) {
41019
41258
  const tool = { definition, run: run24 };
41020
41259
  return tool;
41021
41260
  }
41022
- var TwoSideValidateArgsType = type53({
41261
+ var TwoSideValidateArgsType = type54({
41023
41262
  componentDir: "string",
41024
41263
  apiDir: "string"
41025
41264
  });
@@ -41037,9 +41276,9 @@ function resolveTwoSideInput(parsed) {
41037
41276
  }
41038
41277
  if (ensureError === void 0) {
41039
41278
  result = {
41040
- componentAbs: resolve36(cwd, componentRel),
41279
+ componentAbs: resolve37(cwd, componentRel),
41041
41280
  componentRel,
41042
- apiAbs: resolve36(cwd, apiRel),
41281
+ apiAbs: resolve37(cwd, apiRel),
41043
41282
  apiRel
41044
41283
  };
41045
41284
  } else {
@@ -41052,7 +41291,7 @@ function createTwoSideValidateTool(config) {
41052
41291
  const { definition, inspectAndValidate, format } = config;
41053
41292
  async function run24(rawArgs) {
41054
41293
  const parsed = TwoSideValidateArgsType(rawArgs);
41055
- if (parsed instanceof type53.errors) {
41294
+ if (parsed instanceof type54.errors) {
41056
41295
  return toolError(`Invalid arguments: ${parsed.summary}`);
41057
41296
  }
41058
41297
  const resolved = resolveTwoSideInput(parsed);
@@ -41070,7 +41309,7 @@ function createTwoSideValidateTool(config) {
41070
41309
  const tool = { definition, run: run24 };
41071
41310
  return tool;
41072
41311
  }
41073
- var ListAppArgsType = type53({
41312
+ var ListAppArgsType = type54({
41074
41313
  componentDir: "string",
41075
41314
  apiDir: "string",
41076
41315
  "format?": "'markdown' | 'json'"
@@ -41080,7 +41319,7 @@ function createListAppTool(config) {
41080
41319
  const { definition, inspectAndList, formatMarkdown: formatMarkdown3, formatJson: formatJson3 } = config;
41081
41320
  async function run24(rawArgs) {
41082
41321
  const parsed = ListAppArgsType(rawArgs);
41083
- if (parsed instanceof type53.errors) {
41322
+ if (parsed instanceof type54.errors) {
41084
41323
  return toolError(`Invalid arguments: ${parsed.summary}`);
41085
41324
  }
41086
41325
  const resolved = resolveTwoSideInput(parsed);
@@ -41201,10 +41440,10 @@ var modelValidateApiTool = createSourceValidateTool({
41201
41440
  });
41202
41441
 
41203
41442
  // packages/dbx-components-mcp/src/tools/model-api-list-app.tool.ts
41204
- import { resolve as resolve37 } from "node:path";
41205
- import { type as type54 } from "arktype";
41443
+ import { resolve as resolve38 } from "node:path";
41444
+ import { type as type55 } from "arktype";
41206
41445
  var { formatReportAsJson: formatReportAsJson9, formatReportAsMarkdown: formatReportAsMarkdown9, listAppModelApi: listAppModelApi2 } = model_api_list_app_exports;
41207
- var ListArgsType = type54({
41446
+ var ListArgsType = type55({
41208
41447
  componentDir: "string",
41209
41448
  "model?": "string",
41210
41449
  "identity?": "string",
@@ -41244,7 +41483,7 @@ var TOOL = {
41244
41483
  };
41245
41484
  async function run(rawArgs) {
41246
41485
  const parsed = ListArgsType(rawArgs);
41247
- if (parsed instanceof type54.errors) {
41486
+ if (parsed instanceof type55.errors) {
41248
41487
  return toolError(`Invalid arguments: ${parsed.summary}`);
41249
41488
  }
41250
41489
  const cwd = process.cwd();
@@ -41256,7 +41495,7 @@ async function run(rawArgs) {
41256
41495
  ensureError = err instanceof Error ? err.message : String(err);
41257
41496
  }
41258
41497
  if (ensureError === void 0) {
41259
- const componentAbs = resolve37(cwd, parsed.componentDir);
41498
+ const componentAbs = resolve38(cwd, parsed.componentDir);
41260
41499
  const modelFilter = parsed.model ?? (parsed.identity ? identityToModel(parsed.identity) : void 0);
41261
41500
  let report;
41262
41501
  let listError;
@@ -41284,10 +41523,10 @@ function identityToModel(identity) {
41284
41523
  var MODEL_API_LIST_APP_TOOL = { definition: TOOL, run };
41285
41524
 
41286
41525
  // packages/dbx-components-mcp/src/tools/model-api-lookup.tool.ts
41287
- import { resolve as resolve38 } from "node:path";
41288
- import { type as type55 } from "arktype";
41526
+ import { resolve as resolve39 } from "node:path";
41527
+ import { type as type56 } from "arktype";
41289
41528
  var { formatLookupAsJson: formatLookupAsJson3, formatLookupAsMarkdown: formatLookupAsMarkdown3, lookupModelApi: lookupModelApi2 } = model_api_lookup_exports;
41290
- var LookupArgsType = type55({
41529
+ var LookupArgsType = type56({
41291
41530
  componentDir: "string",
41292
41531
  "apiDir?": "string",
41293
41532
  "model?": "string",
@@ -41326,7 +41565,7 @@ var TOOL2 = {
41326
41565
  };
41327
41566
  async function run2(rawArgs) {
41328
41567
  const parsed = LookupArgsType(rawArgs);
41329
- if (parsed instanceof type55.errors) {
41568
+ if (parsed instanceof type56.errors) {
41330
41569
  return toolError(`Invalid arguments: ${parsed.summary}`);
41331
41570
  }
41332
41571
  if (!parsed.model && !parsed.identity) {
@@ -41344,8 +41583,8 @@ async function run2(rawArgs) {
41344
41583
  ensureError = err instanceof Error ? err.message : String(err);
41345
41584
  }
41346
41585
  if (ensureError === void 0) {
41347
- const componentAbs = resolve38(cwd, parsed.componentDir);
41348
- const apiAbs = parsed.apiDir ? resolve38(cwd, parsed.apiDir) : void 0;
41586
+ const componentAbs = resolve39(cwd, parsed.componentDir);
41587
+ const apiAbs = parsed.apiDir ? resolve39(cwd, parsed.apiDir) : void 0;
41349
41588
  const modelFilter = parsed.model ?? identityToModel2(parsed.identity);
41350
41589
  let report;
41351
41590
  let lookupError;
@@ -41383,10 +41622,10 @@ function identityToModel2(identity) {
41383
41622
  var MODEL_API_LOOKUP_TOOL = { definition: TOOL2, run: run2 };
41384
41623
 
41385
41624
  // packages/dbx-components-mcp/src/tools/model-api-validate-app.tool.ts
41386
- import { resolve as resolve39 } from "node:path";
41387
- import { type as type56 } from "arktype";
41625
+ import { resolve as resolve40 } from "node:path";
41626
+ import { type as type57 } from "arktype";
41388
41627
  var { formatValidationAsJson: formatValidationAsJson3, formatValidationAsMarkdown: formatValidationAsMarkdown3, validateAppModelApi: validateAppModelApi2 } = model_api_validate_app_exports;
41389
- var ValidateArgsType = type56({
41628
+ var ValidateArgsType = type57({
41390
41629
  componentDir: "string",
41391
41630
  apiDir: "string",
41392
41631
  "model?": "string",
@@ -41428,7 +41667,7 @@ var TOOL3 = {
41428
41667
  };
41429
41668
  async function run3(rawArgs) {
41430
41669
  const parsed = ValidateArgsType(rawArgs);
41431
- if (parsed instanceof type56.errors) {
41670
+ if (parsed instanceof type57.errors) {
41432
41671
  return toolError(`Invalid arguments: ${parsed.summary}`);
41433
41672
  }
41434
41673
  const cwd = process.cwd();
@@ -41441,8 +41680,8 @@ async function run3(rawArgs) {
41441
41680
  ensureError = err instanceof Error ? err.message : String(err);
41442
41681
  }
41443
41682
  if (ensureError === void 0) {
41444
- const componentAbs = resolve39(cwd, parsed.componentDir);
41445
- const apiAbs = resolve39(cwd, parsed.apiDir);
41683
+ const componentAbs = resolve40(cwd, parsed.componentDir);
41684
+ const apiAbs = resolve40(cwd, parsed.apiDir);
41446
41685
  const modelFilter = parsed.model ?? (parsed.identity ? identityToModel3(parsed.identity) : void 0);
41447
41686
  let report;
41448
41687
  let validateError;
@@ -41513,7 +41752,7 @@ function createModelValidateFolderTool(options = {}) {
41513
41752
  }
41514
41753
 
41515
41754
  // packages/dbx-components-mcp/src/tools/model-store-scaffold.tool.ts
41516
- import { type as type57 } from "arktype";
41755
+ import { type as type58 } from "arktype";
41517
41756
  var STORE_SHAPES = ["root", "root-singleton", "sub-collection", "singleton-sub", "system-state"];
41518
41757
  var SHAPE_PROFILES = {
41519
41758
  root: { defaultSurfaces: ["document", "collection"], allowedSurfaces: ["document", "collection"], hasParent: false, emitsDirectives: true, requiresCollectionsClass: true, requiresSystemStateTypeConst: false },
@@ -41609,7 +41848,7 @@ var DBX_MODEL_STORE_SCAFFOLD_TOOL = {
41609
41848
  required: ["model_name", "app_prefix", "firebase_package"]
41610
41849
  }
41611
41850
  };
41612
- var ScaffoldArgsType2 = type57({
41851
+ var ScaffoldArgsType2 = type58({
41613
41852
  model_name: "string",
41614
41853
  app_prefix: "string",
41615
41854
  firebase_package: "string",
@@ -41629,7 +41868,7 @@ var ScaffoldArgsType2 = type57({
41629
41868
  name: "string",
41630
41869
  functions_path: "string"
41631
41870
  },
41632
- "crud_functions?": type57({
41871
+ "crud_functions?": type58({
41633
41872
  name: "string",
41634
41873
  kind: "'create' | 'update' | 'crud'",
41635
41874
  functions_path: "string"
@@ -41649,7 +41888,7 @@ function requireString(value, label) {
41649
41888
  }
41650
41889
  function parseArgs3(raw) {
41651
41890
  const parsed = ScaffoldArgsType2(raw);
41652
- if (parsed instanceof type57.errors) {
41891
+ if (parsed instanceof type58.errors) {
41653
41892
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
41654
41893
  }
41655
41894
  const modelName = requireString(parsed.model_name, "model_name");
@@ -42094,9 +42333,9 @@ var MODEL_STORE_SCAFFOLD_TOOL = {
42094
42333
  };
42095
42334
 
42096
42335
  // packages/dbx-components-mcp/src/tools/model-fixture-list-app.tool.ts
42097
- import { resolve as resolve40 } from "node:path";
42098
- import { type as type58 } from "arktype";
42099
- var ListArgsType2 = type58({
42336
+ import { resolve as resolve41 } from "node:path";
42337
+ import { type as type59 } from "arktype";
42338
+ var ListArgsType2 = type59({
42100
42339
  apiDir: "string",
42101
42340
  "format?": "'markdown' | 'json'"
42102
42341
  });
@@ -42124,7 +42363,7 @@ var TOOL4 = {
42124
42363
  };
42125
42364
  async function run4(rawArgs) {
42126
42365
  const parsed = ListArgsType2(rawArgs);
42127
- if (parsed instanceof type58.errors) {
42366
+ if (parsed instanceof type59.errors) {
42128
42367
  return toolError(`Invalid arguments: ${parsed.summary}`);
42129
42368
  }
42130
42369
  const cwd = process.cwd();
@@ -42136,7 +42375,7 @@ async function run4(rawArgs) {
42136
42375
  }
42137
42376
  let result;
42138
42377
  if (ensureError === void 0) {
42139
- const apiAbs = resolve40(cwd, parsed.apiDir);
42378
+ const apiAbs = resolve41(cwd, parsed.apiDir);
42140
42379
  let extraction;
42141
42380
  let inspectError;
42142
42381
  try {
@@ -42158,9 +42397,9 @@ async function run4(rawArgs) {
42158
42397
  var MODEL_FIXTURE_LIST_APP_TOOL = { definition: TOOL4, run: run4 };
42159
42398
 
42160
42399
  // packages/dbx-components-mcp/src/tools/model-fixture-lookup.tool.ts
42161
- import { resolve as resolve41 } from "node:path";
42162
- import { type as type59 } from "arktype";
42163
- var LookupArgsType2 = type59({
42400
+ import { resolve as resolve42 } from "node:path";
42401
+ import { type as type60 } from "arktype";
42402
+ var LookupArgsType2 = type60({
42164
42403
  apiDir: "string",
42165
42404
  "model?": "string",
42166
42405
  "identity?": "string",
@@ -42192,7 +42431,7 @@ var TOOL5 = {
42192
42431
  };
42193
42432
  async function run5(rawArgs) {
42194
42433
  const parsed = LookupArgsType2(rawArgs);
42195
- if (parsed instanceof type59.errors) {
42434
+ if (parsed instanceof type60.errors) {
42196
42435
  return toolError(`Invalid arguments: ${parsed.summary}`);
42197
42436
  }
42198
42437
  if (!parsed.model && !parsed.identity) {
@@ -42202,7 +42441,7 @@ async function run5(rawArgs) {
42202
42441
  const ensureError = runEnsurePathInsideCwd(parsed.apiDir, cwd);
42203
42442
  let result;
42204
42443
  if (ensureError === void 0) {
42205
- const apiAbs = resolve41(cwd, parsed.apiDir);
42444
+ const apiAbs = resolve42(cwd, parsed.apiDir);
42206
42445
  const inspection = await inspectFixturesSafe(apiAbs, parsed.apiDir);
42207
42446
  if (inspection.kind === "error") {
42208
42447
  result = toolError(inspection.message);
@@ -42261,10 +42500,10 @@ function identityToModel4(identity) {
42261
42500
  var MODEL_FIXTURE_LOOKUP_TOOL = { definition: TOOL5, run: run5 };
42262
42501
 
42263
42502
  // packages/dbx-components-mcp/src/tools/model-fixture-validate-app.tool.ts
42264
- import { resolve as resolve42 } from "node:path";
42265
- import { type as type60 } from "arktype";
42503
+ import { resolve as resolve43 } from "node:path";
42504
+ import { type as type61 } from "arktype";
42266
42505
  var { formatValidationAsJson: formatValidationAsJson4, formatValidationAsMarkdown: formatValidationAsMarkdown4, validateAppFixtures: validateAppFixtures2 } = model_fixture_shared_exports;
42267
- var ValidateArgsType2 = type60({
42506
+ var ValidateArgsType2 = type61({
42268
42507
  apiDir: "string",
42269
42508
  "format?": "'markdown' | 'json'"
42270
42509
  });
@@ -42298,7 +42537,7 @@ var TOOL6 = {
42298
42537
  function createModelFixtureValidateAppTool(config = {}) {
42299
42538
  async function run24(rawArgs) {
42300
42539
  const parsed = ValidateArgsType2(rawArgs);
42301
- if (parsed instanceof type60.errors) {
42540
+ if (parsed instanceof type61.errors) {
42302
42541
  return toolError(`Invalid arguments: ${parsed.summary}`);
42303
42542
  }
42304
42543
  const cwd = process.cwd();
@@ -42310,7 +42549,7 @@ function createModelFixtureValidateAppTool(config = {}) {
42310
42549
  ensureError = err instanceof Error ? err.message : String(err);
42311
42550
  }
42312
42551
  if (ensureError === void 0) {
42313
- const apiAbs = resolve42(cwd, parsed.apiDir);
42552
+ const apiAbs = resolve43(cwd, parsed.apiDir);
42314
42553
  let extraction;
42315
42554
  let inspectError;
42316
42555
  try {
@@ -42339,16 +42578,16 @@ function createModelFixtureValidateAppTool(config = {}) {
42339
42578
 
42340
42579
  // packages/dbx-components-mcp/src/tools/model-fixture-scaffold.tool.ts
42341
42580
  import { readFile as readFile23, writeFile } from "node:fs/promises";
42342
- import { join as join23, resolve as resolve43 } from "node:path";
42343
- import { type as type61 } from "arktype";
42344
- var ScaffoldArgsType3 = type61({
42581
+ import { join as join23, resolve as resolve44 } from "node:path";
42582
+ import { type as type62 } from "arktype";
42583
+ var ScaffoldArgsType3 = type62({
42345
42584
  apiDir: "string",
42346
42585
  model: "string",
42347
42586
  archetype: "'top-level-simple' | 'top-level-with-deps' | 'sub-collection' | 'sub-collection-traversal'",
42348
42587
  "prefix?": "string",
42349
42588
  "parentFixture?": "string",
42350
42589
  "parentFixtureField?": "string",
42351
- "paramsDependsOn?": type61({
42590
+ "paramsDependsOn?": type62({
42352
42591
  field: "string",
42353
42592
  fixtureModel: "string",
42354
42593
  "optional?": "boolean",
@@ -42409,7 +42648,7 @@ var TOOL7 = {
42409
42648
  };
42410
42649
  async function run6(rawArgs) {
42411
42650
  const parsed = ScaffoldArgsType3(rawArgs);
42412
- if (parsed instanceof type61.errors) {
42651
+ if (parsed instanceof type62.errors) {
42413
42652
  return toolError(`Invalid arguments: ${parsed.summary}`);
42414
42653
  }
42415
42654
  const cwd = process.cwd();
@@ -42425,7 +42664,7 @@ async function run6(rawArgs) {
42425
42664
  return runScaffold(parsed, cwd);
42426
42665
  }
42427
42666
  async function runScaffold(parsed, cwd) {
42428
- const apiAbs = resolve43(cwd, parsed.apiDir);
42667
+ const apiAbs = resolve44(cwd, parsed.apiDir);
42429
42668
  let extraction;
42430
42669
  let extractionError;
42431
42670
  try {
@@ -42535,10 +42774,10 @@ function collectConflicts(extraction, rendered) {
42535
42774
  var MODEL_FIXTURE_SCAFFOLD_TOOL = { definition: TOOL7, run: run6 };
42536
42775
 
42537
42776
  // packages/dbx-components-mcp/src/tools/model-fixture-forward.tool.ts
42538
- import { join as join24, resolve as resolve44 } from "node:path";
42539
- import { type as type62 } from "arktype";
42777
+ import { join as join24, resolve as resolve45 } from "node:path";
42778
+ import { type as type63 } from "arktype";
42540
42779
  import { Project as Project21 } from "ts-morph";
42541
- var ForwardArgsType = type62({
42780
+ var ForwardArgsType = type63({
42542
42781
  apiDir: "string",
42543
42782
  model: "string",
42544
42783
  "methods?": "string[]"
@@ -42572,7 +42811,7 @@ var TOOL8 = {
42572
42811
  };
42573
42812
  async function run7(rawArgs) {
42574
42813
  const parsed = ForwardArgsType(rawArgs);
42575
- if (parsed instanceof type62.errors) {
42814
+ if (parsed instanceof type63.errors) {
42576
42815
  return toolError(`Invalid arguments: ${parsed.summary}`);
42577
42816
  }
42578
42817
  const cwd = process.cwd();
@@ -42584,7 +42823,7 @@ async function run7(rawArgs) {
42584
42823
  ensureError = toErrorMessage(err);
42585
42824
  }
42586
42825
  if (ensureError === void 0) {
42587
- const apiAbs = resolve44(cwd, parsed.apiDir);
42826
+ const apiAbs = resolve45(cwd, parsed.apiDir);
42588
42827
  let extraction;
42589
42828
  let inspectError;
42590
42829
  try {
@@ -42674,9 +42913,9 @@ function appendListSection(lines, heading, names) {
42674
42913
  var MODEL_FIXTURE_FORWARD_TOOL = { definition: TOOL8, run: run7 };
42675
42914
 
42676
42915
  // packages/dbx-components-mcp/src/tools/model-test-list-app.tool.ts
42677
- import { resolve as resolve45 } from "node:path";
42678
- import { type as type63 } from "arktype";
42679
- var ListAppArgsType2 = type63({
42916
+ import { resolve as resolve46 } from "node:path";
42917
+ import { type as type64 } from "arktype";
42918
+ var ListAppArgsType2 = type64({
42680
42919
  apiDir: "string",
42681
42920
  "group?": "string",
42682
42921
  "format?": "'markdown' | 'json'"
@@ -42716,7 +42955,7 @@ var TOOL9 = {
42716
42955
  };
42717
42956
  async function run8(rawArgs) {
42718
42957
  const parsed = ListAppArgsType2(rawArgs);
42719
- if (parsed instanceof type63.errors) {
42958
+ if (parsed instanceof type64.errors) {
42720
42959
  return toolError(`Invalid arguments: ${parsed.summary}`);
42721
42960
  }
42722
42961
  const cwd = process.cwd();
@@ -42728,7 +42967,7 @@ async function run8(rawArgs) {
42728
42967
  }
42729
42968
  let result;
42730
42969
  if (ensureError === void 0) {
42731
- const apiAbs = resolve45(cwd, parsed.apiDir);
42970
+ const apiAbs = resolve46(cwd, parsed.apiDir);
42732
42971
  let catalog;
42733
42972
  let discoveryError;
42734
42973
  try {
@@ -42763,9 +43002,9 @@ function filterCatalogByGroup(catalog, group) {
42763
43002
  var MODEL_TEST_LIST_APP_TOOL = { definition: TOOL9, run: run8 };
42764
43003
 
42765
43004
  // packages/dbx-components-mcp/src/tools/model-test-tree.tool.ts
42766
- import { resolve as resolve46 } from "node:path";
42767
- import { type as type64 } from "arktype";
42768
- var TreeArgsType = type64({
43005
+ import { resolve as resolve47 } from "node:path";
43006
+ import { type as type65 } from "arktype";
43007
+ var TreeArgsType = type65({
42769
43008
  specFile: "string",
42770
43009
  "apiDir?": "string",
42771
43010
  "view?": "'all' | 'describes' | 'fixtures' | 'its' | 'helpers'",
@@ -42805,7 +43044,7 @@ var TOOL10 = {
42805
43044
  };
42806
43045
  async function run9(rawArgs) {
42807
43046
  const parsed = TreeArgsType(rawArgs);
42808
- if (parsed instanceof type64.errors) {
43047
+ if (parsed instanceof type65.errors) {
42809
43048
  return toolError(`Invalid arguments: ${parsed.summary}`);
42810
43049
  }
42811
43050
  const cwd = process.cwd();
@@ -42818,8 +43057,8 @@ async function run9(rawArgs) {
42818
43057
  }
42819
43058
  let result;
42820
43059
  if (ensureError === void 0) {
42821
- const specAbs = resolve46(cwd, parsed.specFile);
42822
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve46(cwd, parsed.apiDir);
43060
+ const specAbs = resolve47(cwd, parsed.specFile);
43061
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve47(cwd, parsed.apiDir);
42823
43062
  let tree;
42824
43063
  let inspectError;
42825
43064
  try {
@@ -42843,9 +43082,9 @@ async function run9(rawArgs) {
42843
43082
  var MODEL_TEST_TREE_TOOL = { definition: TOOL10, run: run9 };
42844
43083
 
42845
43084
  // packages/dbx-components-mcp/src/tools/model-test-search.tool.ts
42846
- import { resolve as resolve47 } from "node:path";
42847
- import { type as type65 } from "arktype";
42848
- var SearchArgsType2 = type65({
43085
+ import { resolve as resolve48 } from "node:path";
43086
+ import { type as type66 } from "arktype";
43087
+ var SearchArgsType2 = type66({
42849
43088
  specFile: "string",
42850
43089
  "apiDir?": "string",
42851
43090
  "model?": "string",
@@ -42888,7 +43127,7 @@ var TOOL11 = {
42888
43127
  };
42889
43128
  async function run10(rawArgs) {
42890
43129
  const parsed = SearchArgsType2(rawArgs);
42891
- if (parsed instanceof type65.errors) {
43130
+ if (parsed instanceof type66.errors) {
42892
43131
  return toolError(`Invalid arguments: ${parsed.summary}`);
42893
43132
  }
42894
43133
  const queryFields = [
@@ -42914,8 +43153,8 @@ async function run10(rawArgs) {
42914
43153
  ensureError = err instanceof Error ? err.message : String(err);
42915
43154
  }
42916
43155
  if (ensureError === void 0) {
42917
- const specAbs = resolve47(cwd, parsed.specFile);
42918
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve47(cwd, parsed.apiDir);
43156
+ const specAbs = resolve48(cwd, parsed.specFile);
43157
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve48(cwd, parsed.apiDir);
42919
43158
  let tree;
42920
43159
  let inspectError;
42921
43160
  try {
@@ -42938,9 +43177,9 @@ async function run10(rawArgs) {
42938
43177
  var MODEL_TEST_SEARCH_TOOL = { definition: TOOL11, run: run10 };
42939
43178
 
42940
43179
  // packages/dbx-components-mcp/src/tools/model-test-convention.tool.ts
42941
- import { type as type66 } from "arktype";
43180
+ import { type as type67 } from "arktype";
42942
43181
  var API_DIR_PLACEHOLDER = "<apiDir>";
42943
- var ConventionArgsType = type66({
43182
+ var ConventionArgsType = type67({
42944
43183
  group: "string",
42945
43184
  "apiDir?": "string",
42946
43185
  "bucket?": "'crud' | 'scenario'",
@@ -42979,7 +43218,7 @@ var TOOL12 = {
42979
43218
  };
42980
43219
  function parseArgs4(rawArgs) {
42981
43220
  const parsed = ConventionArgsType(rawArgs);
42982
- if (parsed instanceof type66.errors) {
43221
+ if (parsed instanceof type67.errors) {
42983
43222
  return toolError(`Invalid arguments: ${parsed.summary}`);
42984
43223
  }
42985
43224
  if (parsed.subgroups !== void 0 && parsed.bucket === void 0) {
@@ -43067,9 +43306,9 @@ async function run11(rawArgs) {
43067
43306
  var MODEL_TEST_CONVENTION_TOOL = { definition: TOOL12, run: run11 };
43068
43307
 
43069
43308
  // packages/dbx-components-mcp/src/tools/model-test-hotspots.tool.ts
43070
- import { resolve as resolve48 } from "node:path";
43071
- import { type as type67 } from "arktype";
43072
- var HotspotsArgsType = type67({
43309
+ import { resolve as resolve49 } from "node:path";
43310
+ import { type as type68 } from "arktype";
43311
+ var HotspotsArgsType = type68({
43073
43312
  apiDir: "string",
43074
43313
  model: "string",
43075
43314
  "format?": "'markdown' | 'json'"
@@ -43102,7 +43341,7 @@ var TOOL13 = {
43102
43341
  };
43103
43342
  async function run12(rawArgs) {
43104
43343
  const parsed = HotspotsArgsType(rawArgs);
43105
- if (parsed instanceof type67.errors) {
43344
+ if (parsed instanceof type68.errors) {
43106
43345
  return toolError(`Invalid arguments: ${parsed.summary}`);
43107
43346
  }
43108
43347
  const cwd = process.cwd();
@@ -43114,7 +43353,7 @@ async function run12(rawArgs) {
43114
43353
  }
43115
43354
  let result;
43116
43355
  if (ensureError === void 0) {
43117
- const apiAbs = resolve48(cwd, parsed.apiDir);
43356
+ const apiAbs = resolve49(cwd, parsed.apiDir);
43118
43357
  let hotspots;
43119
43358
  let lookupError;
43120
43359
  try {
@@ -43136,11 +43375,11 @@ async function run12(rawArgs) {
43136
43375
  var MODEL_TEST_HOTSPOTS_TOOL = { definition: TOOL13, run: run12 };
43137
43376
 
43138
43377
  // packages/dbx-components-mcp/src/tools/model-test-validate-app.tool.ts
43139
- import { resolve as resolve49 } from "node:path";
43140
- import { type as type68 } from "arktype";
43378
+ import { resolve as resolve50 } from "node:path";
43379
+ import { type as type69 } from "arktype";
43141
43380
  var { extractComponentModels: extractComponentModels2 } = model_list_component_exports;
43142
43381
  var { formatModelTestValidateAppJson: formatModelTestValidateAppJson2, formatModelTestValidateAppMarkdown: formatModelTestValidateAppMarkdown2, validateModelTestApp: validateModelTestApp2 } = model_test_validate_app_exports;
43143
- var ValidateAppArgsType = type68({
43382
+ var ValidateAppArgsType = type69({
43144
43383
  componentDir: "string",
43145
43384
  apiDir: "string",
43146
43385
  "strict?": "boolean",
@@ -43178,7 +43417,7 @@ var TOOL14 = {
43178
43417
  };
43179
43418
  async function run13(rawArgs) {
43180
43419
  const parsed = ValidateAppArgsType(rawArgs);
43181
- if (parsed instanceof type68.errors) {
43420
+ if (parsed instanceof type69.errors) {
43182
43421
  return toolError(`Invalid arguments: ${parsed.summary}`);
43183
43422
  }
43184
43423
  const cwd = process.cwd();
@@ -43192,8 +43431,8 @@ async function run13(rawArgs) {
43192
43431
  if (ensureError !== void 0) {
43193
43432
  return toolError(ensureError);
43194
43433
  }
43195
- const componentAbs = resolve49(cwd, parsed.componentDir);
43196
- const apiAbs = resolve49(cwd, parsed.apiDir);
43434
+ const componentAbs = resolve50(cwd, parsed.componentDir);
43435
+ const apiAbs = resolve50(cwd, parsed.apiDir);
43197
43436
  let catalog;
43198
43437
  let extraction;
43199
43438
  let inspectionError;
@@ -43221,7 +43460,7 @@ async function run13(rawArgs) {
43221
43460
  var MODEL_TEST_VALIDATE_APP_TOOL = { definition: TOOL14, run: run13 };
43222
43461
 
43223
43462
  // packages/dbx-components-mcp/src/tools/archetype-recommend.tool.ts
43224
- import { type as type69 } from "arktype";
43463
+ import { type as type70 } from "arktype";
43225
43464
 
43226
43465
  // packages/dbx-components-mcp/src/tools/archetype/score.ts
43227
43466
  var FRAMEWORK_SHORT_CIRCUITS = [
@@ -43613,7 +43852,7 @@ function formatArchetypeCatalog(archetypes) {
43613
43852
  // packages/dbx-components-mcp/src/tools/archetype-recommend.tool.ts
43614
43853
  var DEFAULT_PEER_COUNT = 5;
43615
43854
  var DEFAULT_MAX_RESULTS = 3;
43616
- var QuestionnaireType = type69({
43855
+ var QuestionnaireType = type70({
43617
43856
  "candidateName?": "string",
43618
43857
  "candidateGroup?": "string",
43619
43858
  "domainDescription?": "string",
@@ -43651,7 +43890,7 @@ var QuestionnaireType = type69({
43651
43890
  "estimatedItemsPerParent?": "'0-50' | '50-500' | '500+' | 'unknown'",
43652
43891
  "alwaysReadWithParent?": "boolean"
43653
43892
  });
43654
- var RecommendArgsType = type69({
43893
+ var RecommendArgsType = type70({
43655
43894
  questionnaire: QuestionnaireType,
43656
43895
  "archetypeHint?": "string",
43657
43896
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -43705,7 +43944,7 @@ var DBX_MODEL_ARCHETYPE_RECOMMEND_TOOL = {
43705
43944
  };
43706
43945
  function parseArgs5(raw) {
43707
43946
  const parsed = RecommendArgsType(raw);
43708
- if (parsed instanceof type69.errors) {
43947
+ if (parsed instanceof type70.errors) {
43709
43948
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43710
43949
  }
43711
43950
  const result = {
@@ -43815,7 +44054,7 @@ var ARCHETYPE_RECOMMEND_TOOL = {
43815
44054
  };
43816
44055
 
43817
44056
  // packages/dbx-components-mcp/src/tools/archetype-lookup.tool.ts
43818
- import { type as type70 } from "arktype";
44057
+ import { type as type71 } from "arktype";
43819
44058
  var DBX_MODEL_ARCHETYPE_LOOKUP_TOOL = {
43820
44059
  name: "dbx_model_archetype_lookup",
43821
44060
  description: [
@@ -43839,14 +44078,14 @@ var DBX_MODEL_ARCHETYPE_LOOKUP_TOOL = {
43839
44078
  required: ["slug"]
43840
44079
  }
43841
44080
  };
43842
- var LookupArgsType3 = type70({
44081
+ var LookupArgsType3 = type71({
43843
44082
  slug: "string",
43844
44083
  "axes?": { "[string]": "string" }
43845
44084
  });
43846
44085
  var CATALOG_KEYWORDS = /* @__PURE__ */ new Set(["list", "catalog", "all"]);
43847
44086
  function parseArgs6(raw) {
43848
44087
  const parsed = LookupArgsType3(raw);
43849
- if (parsed instanceof type70.errors) {
44088
+ if (parsed instanceof type71.errors) {
43850
44089
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43851
44090
  }
43852
44091
  return { slug: parsed.slug, axes: parsed.axes };
@@ -43894,9 +44133,9 @@ var ARCHETYPE_LOOKUP_TOOL = {
43894
44133
  };
43895
44134
 
43896
44135
  // packages/dbx-components-mcp/src/tools/archetype-search.tool.ts
43897
- import { type as type71 } from "arktype";
44136
+ import { type as type72 } from "arktype";
43898
44137
  var DEFAULT_LIMIT4 = 25;
43899
- var SearchArgsType3 = type71({
44138
+ var SearchArgsType3 = type72({
43900
44139
  archetype: "string",
43901
44140
  "axes?": { "[string]": "string" },
43902
44141
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -43932,7 +44171,7 @@ var DBX_MODEL_ARCHETYPE_SEARCH_TOOL = {
43932
44171
  };
43933
44172
  function parseArgs7(raw) {
43934
44173
  const parsed = SearchArgsType3(raw);
43935
- if (parsed instanceof type71.errors) {
44174
+ if (parsed instanceof type72.errors) {
43936
44175
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43937
44176
  }
43938
44177
  return {
@@ -44042,7 +44281,7 @@ var ARCHETYPE_SEARCH_TOOL = {
44042
44281
  };
44043
44282
 
44044
44283
  // packages/dbx-components-mcp/src/tools/model-hierarchy.tool.ts
44045
- import { type as type72 } from "arktype";
44284
+ import { type as type73 } from "arktype";
44046
44285
  var DBX_MODEL_HIERARCHY_TOOL = {
44047
44286
  name: "dbx_model_hierarchy",
44048
44287
  description: [
@@ -44100,7 +44339,7 @@ var DBX_MODEL_HIERARCHY_TOOL = {
44100
44339
  }
44101
44340
  }
44102
44341
  };
44103
- var HierarchyArgsType = type72({
44342
+ var HierarchyArgsType = type73({
44104
44343
  "rootModel?": "string",
44105
44344
  "maxDepth?": "number.integer >= 0",
44106
44345
  "format?": "'tree' | 'flat' | 'both'",
@@ -44110,7 +44349,7 @@ var HierarchyArgsType = type72({
44110
44349
  });
44111
44350
  function parseHierarchyArgs(raw) {
44112
44351
  const parsed = HierarchyArgsType(raw ?? {});
44113
- if (parsed instanceof type72.errors) {
44352
+ if (parsed instanceof type73.errors) {
44114
44353
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
44115
44354
  }
44116
44355
  return {
@@ -44531,10 +44770,10 @@ var systemMValidateFolderTool = createFolderValidateTool({
44531
44770
  });
44532
44771
 
44533
44772
  // packages/dbx-components-mcp/src/tools/system-m-list-app.tool.ts
44534
- import { resolve as resolve50 } from "node:path";
44535
- import { type as type73 } from "arktype";
44773
+ import { resolve as resolve51 } from "node:path";
44774
+ import { type as type74 } from "arktype";
44536
44775
  var { formatReportAsJson: formatReportAsJson12, formatReportAsMarkdown: formatReportAsMarkdown12, listAppSystem: listAppSystem2 } = system_m_list_app_exports;
44537
- var ListAppArgsType3 = type73({
44776
+ var ListAppArgsType3 = type74({
44538
44777
  componentDir: "string",
44539
44778
  "format?": "'markdown' | 'json'"
44540
44779
  });
@@ -44562,7 +44801,7 @@ var TOOL15 = {
44562
44801
  };
44563
44802
  async function run14(rawArgs) {
44564
44803
  const parsed = ListAppArgsType3(rawArgs);
44565
- if (parsed instanceof type73.errors) {
44804
+ if (parsed instanceof type74.errors) {
44566
44805
  return toolError(`Invalid arguments: ${parsed.summary}`);
44567
44806
  }
44568
44807
  const cwd = process.cwd();
@@ -44574,7 +44813,7 @@ async function run14(rawArgs) {
44574
44813
  ensureError = err instanceof Error ? err.message : String(err);
44575
44814
  }
44576
44815
  if (ensureError === void 0) {
44577
- const componentAbs = resolve50(cwd, parsed.componentDir);
44816
+ const componentAbs = resolve51(cwd, parsed.componentDir);
44578
44817
  let report;
44579
44818
  let listError;
44580
44819
  try {
@@ -44711,7 +44950,7 @@ var dbxAssetValidateFolderTool = createTwoSideValidateTool({
44711
44950
  });
44712
44951
 
44713
44952
  // packages/dbx-components-mcp/src/tools/dbx-asset-scaffold.tool.ts
44714
- import { type as type74 } from "arktype";
44953
+ import { type as type75 } from "arktype";
44715
44954
  var ASSET_BUILDERS = [
44716
44955
  { kind: "local", helper: "localAsset", signature: "(path: SlashPath)" },
44717
44956
  { kind: "remote", helper: "remoteAsset", signature: "(url: WebsiteUrlWithPrefix)" },
@@ -44747,7 +44986,7 @@ var DBX_ASSET_SCAFFOLD_TOOL_DEFINITION = {
44747
44986
  required: ["name", "kind"]
44748
44987
  }
44749
44988
  };
44750
- var ScaffoldArgsType4 = type74({
44989
+ var ScaffoldArgsType4 = type75({
44751
44990
  name: "string",
44752
44991
  kind: "'local' | 'remote' | 'folder' | 'remote-base'",
44753
44992
  "path?": "string",
@@ -44757,7 +44996,7 @@ var ScaffoldArgsType4 = type74({
44757
44996
  });
44758
44997
  function parseScaffoldArgs2(raw) {
44759
44998
  const parsed = ScaffoldArgsType4(raw);
44760
- if (parsed instanceof type74.errors) {
44999
+ if (parsed instanceof type75.errors) {
44761
45000
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
44762
45001
  }
44763
45002
  const name = parsed.name.trim();
@@ -44901,8 +45140,8 @@ var DBX_ASSET_SCAFFOLD_TOOL = {
44901
45140
  };
44902
45141
 
44903
45142
  // packages/dbx-components-mcp/src/tools/dbx-color-template-list-app.tool.ts
44904
- import { resolve as resolve51 } from "node:path";
44905
- import { type as type75 } from "arktype";
45143
+ import { resolve as resolve52 } from "node:path";
45144
+ import { type as type76 } from "arktype";
44906
45145
  var { formatReportAsJson: formatReportAsJson14, formatReportAsMarkdown: formatReportAsMarkdown14, inspectColorTemplates: inspectColorTemplates2, listAppColorTemplates: listAppColorTemplates2 } = dbx_color_template_list_app_exports;
44907
45146
  var DBX_COLOR_TEMPLATE_LIST_APP_TOOL_DEFINITION = {
44908
45147
  name: "dbx_color_template_list_app",
@@ -44928,14 +45167,14 @@ var DBX_COLOR_TEMPLATE_LIST_APP_TOOL_DEFINITION = {
44928
45167
  required: ["apiDir"]
44929
45168
  }
44930
45169
  };
44931
- var ColorTemplateListAppArgs = type75({
45170
+ var ColorTemplateListAppArgs = type76({
44932
45171
  apiDir: "string",
44933
45172
  "format?": "'markdown' | 'json'"
44934
45173
  });
44935
45174
  async function run15(rawArgs) {
44936
45175
  const parsed = ColorTemplateListAppArgs(rawArgs);
44937
45176
  let result;
44938
- if (parsed instanceof type75.errors) {
45177
+ if (parsed instanceof type76.errors) {
44939
45178
  result = toolError(`Invalid arguments: ${parsed.summary}`);
44940
45179
  } else {
44941
45180
  const cwd = process.cwd();
@@ -44947,7 +45186,7 @@ async function run15(rawArgs) {
44947
45186
  pathError = err instanceof Error ? err.message : String(err);
44948
45187
  }
44949
45188
  if (pathError === void 0) {
44950
- const apiAbs = resolve51(cwd, apiRel);
45189
+ const apiAbs = resolve52(cwd, apiRel);
44951
45190
  const inspection = await inspectColorTemplates2(apiAbs, apiRel);
44952
45191
  if (inspection.appExists) {
44953
45192
  const report = listAppColorTemplates2(inspection);
@@ -44968,8 +45207,8 @@ var DBX_COLOR_TEMPLATE_LIST_APP_TOOL = {
44968
45207
  };
44969
45208
 
44970
45209
  // packages/dbx-components-mcp/src/tools/dbx-color-smell-check.tool.ts
44971
- import { resolve as resolve52 } from "node:path";
44972
- import { type as type76 } from "arktype";
45210
+ import { resolve as resolve53 } from "node:path";
45211
+ import { type as type77 } from "arktype";
44973
45212
  var { extractHtmlLiterals: extractHtmlLiterals2, extractTsLiterals: extractTsLiterals2, formatResultAsJson: formatResultAsJson2, formatResultAsMarkdown: formatResultAsMarkdown2, groupColorSmells: groupColorSmells2 } = dbx_color_smell_check_exports;
44974
45213
  var { extractColorTemplates: extractColorTemplates2, inspectColorTemplates: inspectColorTemplates3 } = dbx_color_template_list_app_exports;
44975
45214
  var DBX_COLOR_SMELL_CHECK_TOOL_DEFINITION = {
@@ -45002,7 +45241,7 @@ var DBX_COLOR_SMELL_CHECK_TOOL_DEFINITION = {
45002
45241
  }
45003
45242
  }
45004
45243
  };
45005
- var ColorSmellCheckArgs = type76({
45244
+ var ColorSmellCheckArgs = type77({
45006
45245
  "paths?": "string[]",
45007
45246
  "glob?": "string",
45008
45247
  "equivalenceMode?": "'exact' | 'normalized'",
@@ -45012,7 +45251,7 @@ var ColorSmellCheckArgs = type76({
45012
45251
  });
45013
45252
  async function run16(rawArgs) {
45014
45253
  const parsed = ColorSmellCheckArgs(rawArgs);
45015
- if (parsed instanceof type76.errors) {
45254
+ if (parsed instanceof type77.errors) {
45016
45255
  return toolError(`Invalid arguments: ${parsed.summary}`);
45017
45256
  }
45018
45257
  const hasAny = parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -45062,7 +45301,7 @@ async function resolveCrossReferenceTemplates(input) {
45062
45301
  let result;
45063
45302
  if (pathError === void 0) {
45064
45303
  try {
45065
- const inspection = await inspectColorTemplates3(resolve52(input.cwd, input.apiDir), input.apiDir);
45304
+ const inspection = await inspectColorTemplates3(resolve53(input.cwd, input.apiDir), input.apiDir);
45066
45305
  if (inspection.appExists) {
45067
45306
  const extracted = extractColorTemplates2(inspection);
45068
45307
  result = { kind: "value", value: extracted.templates };
@@ -45084,7 +45323,7 @@ var DBX_COLOR_SMELL_CHECK_TOOL = {
45084
45323
  };
45085
45324
 
45086
45325
  // packages/dbx-components-mcp/src/tools/lookup-action.tool.ts
45087
- import { type as type77 } from "arktype";
45326
+ import { type as type78 } from "arktype";
45088
45327
  var DBX_ACTION_LOOKUP_TOOL = {
45089
45328
  name: "dbx_action_lookup",
45090
45329
  description: [
@@ -45117,13 +45356,13 @@ var DBX_ACTION_LOOKUP_TOOL = {
45117
45356
  required: ["topic"]
45118
45357
  }
45119
45358
  };
45120
- var LookupActionArgsType = type77({
45359
+ var LookupActionArgsType = type78({
45121
45360
  topic: "string",
45122
45361
  "depth?": "'brief' | 'full'"
45123
45362
  });
45124
45363
  function parseLookupActionArgs(raw) {
45125
45364
  const parsed = LookupActionArgsType(raw);
45126
- if (parsed instanceof type77.errors) {
45365
+ if (parsed instanceof type78.errors) {
45127
45366
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
45128
45367
  }
45129
45368
  const result = {
@@ -45597,7 +45836,7 @@ function createSearchActionTool(config) {
45597
45836
  }
45598
45837
 
45599
45838
  // packages/dbx-components-mcp/src/tools/action-examples.tool.ts
45600
- import { type as type78 } from "arktype";
45839
+ import { type as type79 } from "arktype";
45601
45840
 
45602
45841
  // packages/dbx-components-mcp/src/tools/data/patterns/actions/action.auto-trigger-on-modify.pattern.ts
45603
45842
  var ACTION_PATTERN_AUTO_TRIGGER_ON_MODIFY = {
@@ -46034,13 +46273,13 @@ var DBX_ACTION_EXAMPLES_TOOL = {
46034
46273
  required: ["pattern"]
46035
46274
  }
46036
46275
  };
46037
- var ActionExamplesArgsType = type78({
46276
+ var ActionExamplesArgsType = type79({
46038
46277
  pattern: "string",
46039
46278
  "depth?": "'minimal' | 'brief' | 'full'"
46040
46279
  });
46041
46280
  function parseActionExamplesArgs(raw) {
46042
46281
  const parsed = ActionExamplesArgsType(raw);
46043
- if (parsed instanceof type78.errors) {
46282
+ if (parsed instanceof type79.errors) {
46044
46283
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46045
46284
  }
46046
46285
  const result = {
@@ -46102,7 +46341,7 @@ var ACTION_EXAMPLES_TOOL = {
46102
46341
  };
46103
46342
 
46104
46343
  // packages/dbx-components-mcp/src/tools/action-scaffold.tool.ts
46105
- import { type as type79 } from "arktype";
46344
+ import { type as type80 } from "arktype";
46106
46345
  var TRIGGER_VALUES = ["button", "form", "auto-modify"];
46107
46346
  var SUCCESS_FEEDBACK_VALUES = ["snackbar", "redirect", "none"];
46108
46347
  var CONTEXT_PROVIDER_VALUES = ["inline", "parent", "host-component"];
@@ -46136,7 +46375,7 @@ var DBX_ACTION_SCAFFOLD_TOOL = {
46136
46375
  required: ["use_case", "trigger", "value_type"]
46137
46376
  }
46138
46377
  };
46139
- var ScaffoldArgsType5 = type79({
46378
+ var ScaffoldArgsType5 = type80({
46140
46379
  use_case: "string",
46141
46380
  trigger: "'button' | 'form' | 'auto-modify'",
46142
46381
  "confirm?": "boolean",
@@ -46147,7 +46386,7 @@ var ScaffoldArgsType5 = type79({
46147
46386
  });
46148
46387
  function parseScaffoldArgs3(raw) {
46149
46388
  const parsed = ScaffoldArgsType5(raw);
46150
- if (parsed instanceof type79.errors) {
46389
+ if (parsed instanceof type80.errors) {
46151
46390
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46152
46391
  }
46153
46392
  const useCase = parsed.use_case.trim();
@@ -46373,14 +46612,14 @@ var ACTION_SCAFFOLD_TOOL = {
46373
46612
  };
46374
46613
 
46375
46614
  // packages/dbx-components-mcp/src/tools/route-tree.tool.ts
46376
- import { type as type80 } from "arktype";
46615
+ import { type as type81 } from "arktype";
46377
46616
 
46378
46617
  // packages/dbx-components-mcp/src/tools/route/load-sources.ts
46379
46618
  import { glob as fsGlob6, readFile as readFile24, stat as stat14 } from "node:fs/promises";
46380
- import { dirname as dirname18, isAbsolute as isAbsolute16, resolve as resolve53, sep as sep17 } from "node:path";
46619
+ import { dirname as dirname19, isAbsolute as isAbsolute16, resolve as resolve54, sep as sep17 } from "node:path";
46381
46620
  var TRY_EXTENSIONS2 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
46382
46621
  async function loadRouteSources(args) {
46383
- const cwdResolved = args.cwd ? resolve53(process.cwd(), args.cwd) : process.cwd();
46622
+ const cwdResolved = args.cwd ? resolve54(process.cwd(), args.cwd) : process.cwd();
46384
46623
  guardCwdInsideServer(args.cwd, cwdResolved);
46385
46624
  const collected = /* @__PURE__ */ new Map();
46386
46625
  if (args.sources) {
@@ -46452,7 +46691,7 @@ async function loadOne(relative23, cwd, into) {
46452
46691
  if (into.has(relative23)) {
46453
46692
  return;
46454
46693
  }
46455
- const absolute = resolve53(cwd, relative23);
46694
+ const absolute = resolve54(cwd, relative23);
46456
46695
  const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
46457
46696
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
46458
46697
  throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
@@ -46463,9 +46702,9 @@ async function loadOne(relative23, cwd, into) {
46463
46702
  async function resolveRelativeImport(fromFile, specifier, cwd) {
46464
46703
  let result;
46465
46704
  if (specifier.startsWith(".")) {
46466
- const fromAbsolute = isAbsolute16(fromFile) ? fromFile : resolve53(cwd, fromFile);
46467
- const fromDir = dirname18(fromAbsolute);
46468
- const baseAbsolute = resolve53(fromDir, specifier);
46705
+ const fromAbsolute = isAbsolute16(fromFile) ? fromFile : resolve54(cwd, fromFile);
46706
+ const fromDir = dirname19(fromAbsolute);
46707
+ const baseAbsolute = resolve54(fromDir, specifier);
46469
46708
  const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
46470
46709
  for (const ext of TRY_EXTENSIONS2) {
46471
46710
  const candidateAbsolute = baseAbsolute + ext;
@@ -46690,8 +46929,8 @@ var DBX_ROUTE_TREE_TOOL = {
46690
46929
  }
46691
46930
  }
46692
46931
  };
46693
- var TreeArgsType2 = type80({
46694
- "sources?": type80({ name: "string", text: "string" }).array(),
46932
+ var TreeArgsType2 = type81({
46933
+ "sources?": type81({ name: "string", text: "string" }).array(),
46695
46934
  "paths?": "string[]",
46696
46935
  "glob?": "string",
46697
46936
  "format?": "'markdown' | 'json' | 'flat'",
@@ -46700,7 +46939,7 @@ var TreeArgsType2 = type80({
46700
46939
  });
46701
46940
  function parseArgs8(raw) {
46702
46941
  const parsed = TreeArgsType2(raw);
46703
- if (parsed instanceof type80.errors) {
46942
+ if (parsed instanceof type81.errors) {
46704
46943
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46705
46944
  }
46706
46945
  const result = {
@@ -46756,7 +46995,7 @@ var ROUTE_TREE_TOOL = {
46756
46995
  };
46757
46996
 
46758
46997
  // packages/dbx-components-mcp/src/tools/route-lookup.tool.ts
46759
- import { type as type81 } from "arktype";
46998
+ import { type as type82 } from "arktype";
46760
46999
 
46761
47000
  // packages/dbx-components-mcp/src/tools/route/page-models.ts
46762
47001
  function buildPageModelsIndex(sources) {
@@ -46816,9 +47055,9 @@ var DBX_ROUTE_LOOKUP_TOOL = {
46816
47055
  required: ["topic"]
46817
47056
  }
46818
47057
  };
46819
- var LookupArgsType4 = type81({
47058
+ var LookupArgsType4 = type82({
46820
47059
  topic: "string",
46821
- "sources?": type81({ name: "string", text: "string" }).array(),
47060
+ "sources?": type82({ name: "string", text: "string" }).array(),
46822
47061
  "paths?": "string[]",
46823
47062
  "glob?": "string",
46824
47063
  "depth?": "'brief' | 'full'",
@@ -46826,7 +47065,7 @@ var LookupArgsType4 = type81({
46826
47065
  });
46827
47066
  function parseArgs9(raw) {
46828
47067
  const parsed = LookupArgsType4(raw);
46829
- if (parsed instanceof type81.errors) {
47068
+ if (parsed instanceof type82.errors) {
46830
47069
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46831
47070
  }
46832
47071
  const result = {
@@ -47051,7 +47290,7 @@ var ROUTE_LOOKUP_TOOL = {
47051
47290
  };
47052
47291
 
47053
47292
  // packages/dbx-components-mcp/src/tools/route-search.tool.ts
47054
- import { type as type82 } from "arktype";
47293
+ import { type as type83 } from "arktype";
47055
47294
  var DBX_ROUTE_SEARCH_TOOL = {
47056
47295
  name: "dbx_route_search",
47057
47296
  description: [
@@ -47079,9 +47318,9 @@ var DBX_ROUTE_SEARCH_TOOL = {
47079
47318
  required: ["query"]
47080
47319
  }
47081
47320
  };
47082
- var SearchArgsType4 = type82({
47321
+ var SearchArgsType4 = type83({
47083
47322
  query: "string",
47084
- "sources?": type82({ name: "string", text: "string" }).array(),
47323
+ "sources?": type83({ name: "string", text: "string" }).array(),
47085
47324
  "paths?": "string[]",
47086
47325
  "glob?": "string",
47087
47326
  "scope?": "'name' | 'url' | 'component' | 'resolve' | 'all'",
@@ -47089,7 +47328,7 @@ var SearchArgsType4 = type82({
47089
47328
  });
47090
47329
  function parseArgs10(raw) {
47091
47330
  const parsed = SearchArgsType4(raw);
47092
- if (parsed instanceof type82.errors) {
47331
+ if (parsed instanceof type83.errors) {
47093
47332
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47094
47333
  }
47095
47334
  const result = {
@@ -47188,18 +47427,18 @@ var ROUTE_SEARCH_TOOL = {
47188
47427
  };
47189
47428
 
47190
47429
  // packages/dbx-components-mcp/src/tools/route-resolve-url.tool.ts
47191
- import { type as type83 } from "arktype";
47430
+ import { type as type84 } from "arktype";
47192
47431
 
47193
47432
  // packages/dbx-components-mcp/src/tools/route/resolve-url.ts
47194
47433
  import { readFile as readFile26, stat as stat15 } from "node:fs/promises";
47195
- import { dirname as dirname20, isAbsolute as isAbsolute17, resolve as resolve55, sep as sep19 } from "node:path";
47434
+ import { dirname as dirname21, isAbsolute as isAbsolute17, resolve as resolve56, sep as sep19 } from "node:path";
47196
47435
 
47197
47436
  // packages/dbx-components-mcp/src/tools/route/app-port-map.ts
47198
47437
  import { glob as fsGlob7, readFile as readFile25 } from "node:fs/promises";
47199
- import { dirname as dirname19, resolve as resolve54, sep as sep18 } from "node:path";
47438
+ import { dirname as dirname20, resolve as resolve55, sep as sep18 } from "node:path";
47200
47439
  var CACHE = /* @__PURE__ */ new Map();
47201
47440
  async function loadAppPortMap(cwd) {
47202
- const resolved = cwd ? resolve54(process.cwd(), cwd) : process.cwd();
47441
+ const resolved = cwd ? resolve55(process.cwd(), cwd) : process.cwd();
47203
47442
  let pending = CACHE.get(resolved);
47204
47443
  if (!pending) {
47205
47444
  pending = scanAppPortMap(resolved);
@@ -47210,8 +47449,8 @@ async function loadAppPortMap(cwd) {
47210
47449
  async function scanAppPortMap(cwdResolved) {
47211
47450
  const entries = [];
47212
47451
  for await (const match of fsGlob7("apps/*/project.json", { cwd: cwdResolved })) {
47213
- const projectRoot = dirname19(match);
47214
- const absolute = resolve54(cwdResolved, match);
47452
+ const projectRoot = dirname20(match);
47453
+ const absolute = resolve55(cwdResolved, match);
47215
47454
  const entry = await readEntry({ projectJsonAbsolute: absolute, projectRoot });
47216
47455
  if (entry) {
47217
47456
  entries.push(entry);
@@ -47439,8 +47678,8 @@ function collectSiblings(node) {
47439
47678
  }
47440
47679
  var TRY_EXTENSIONS3 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
47441
47680
  async function resolveComponentFile(input) {
47442
- const cwdResolved = input.cwd ? resolve55(process.cwd(), input.cwd) : process.cwd();
47443
- const routerAbsolute = isAbsolute17(input.routerFile) ? input.routerFile : resolve55(cwdResolved, input.routerFile);
47681
+ const cwdResolved = input.cwd ? resolve56(process.cwd(), input.cwd) : process.cwd();
47682
+ const routerAbsolute = isAbsolute17(input.routerFile) ? input.routerFile : resolve56(cwdResolved, input.routerFile);
47444
47683
  let text;
47445
47684
  try {
47446
47685
  text = await readFile26(routerAbsolute, "utf8");
@@ -47461,8 +47700,8 @@ async function resolveSpecifierToFile(input) {
47461
47700
  if (!specifier.startsWith(".")) {
47462
47701
  return { path: specifier, moduleSpecifier: specifier };
47463
47702
  }
47464
- const fromDir = dirname20(routerAbsolute);
47465
- const baseAbsolute = resolve55(fromDir, specifier);
47703
+ const fromDir = dirname21(routerAbsolute);
47704
+ const baseAbsolute = resolve56(fromDir, specifier);
47466
47705
  const cwdPrefix = cwdResolved.endsWith(sep19) ? cwdResolved : cwdResolved + sep19;
47467
47706
  let resolved;
47468
47707
  for (const ext of TRY_EXTENSIONS3) {
@@ -47548,7 +47787,7 @@ var DBX_ROUTE_RESOLVE_URL_TOOL = {
47548
47787
  required: ["url"]
47549
47788
  }
47550
47789
  };
47551
- var ResolveUrlArgsType = type83({
47790
+ var ResolveUrlArgsType = type84({
47552
47791
  url: "string",
47553
47792
  "app?": "string",
47554
47793
  "cwd?": "string",
@@ -47557,7 +47796,7 @@ var ResolveUrlArgsType = type83({
47557
47796
  });
47558
47797
  function parseArgs11(raw) {
47559
47798
  const parsed = ResolveUrlArgsType(raw);
47560
- if (parsed instanceof type83.errors) {
47799
+ if (parsed instanceof type84.errors) {
47561
47800
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47562
47801
  }
47563
47802
  const result = {
@@ -47797,14 +48036,14 @@ var ROUTE_RESOLVE_URL_TOOL = {
47797
48036
  };
47798
48037
 
47799
48038
  // packages/dbx-components-mcp/src/tools/_lookup.factory.ts
47800
- import { type as type84 } from "arktype";
47801
- var LOOKUP_ARGS_TYPE = type84({
48039
+ import { type as type85 } from "arktype";
48040
+ var LOOKUP_ARGS_TYPE = type85({
47802
48041
  topic: "string",
47803
48042
  "depth?": "'brief' | 'full'"
47804
48043
  });
47805
48044
  function parseLookupArgs(raw) {
47806
48045
  const parsed = LOOKUP_ARGS_TYPE(raw);
47807
- if (parsed instanceof type84.errors) {
48046
+ if (parsed instanceof type85.errors) {
47808
48047
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47809
48048
  }
47810
48049
  const result = {
@@ -48008,7 +48247,7 @@ function createLookupFilterTool(input) {
48008
48247
  }
48009
48248
 
48010
48249
  // packages/dbx-components-mcp/src/tools/filter-scaffold.tool.ts
48011
- import { type as type85 } from "arktype";
48250
+ import { type as type86 } from "arktype";
48012
48251
  var DBX_FILTER_SCAFFOLD_TOOL = {
48013
48252
  name: "dbx_filter_scaffold",
48014
48253
  description: [
@@ -48033,7 +48272,7 @@ var DBX_FILTER_SCAFFOLD_TOOL = {
48033
48272
  required: ["model_name", "filter_type"]
48034
48273
  }
48035
48274
  };
48036
- var ScaffoldArgsType6 = type85({
48275
+ var ScaffoldArgsType6 = type86({
48037
48276
  model_name: "string",
48038
48277
  filter_type: "string",
48039
48278
  "preset_keys?": "string[]",
@@ -48041,7 +48280,7 @@ var ScaffoldArgsType6 = type85({
48041
48280
  });
48042
48281
  function parseArgs12(raw) {
48043
48282
  const parsed = ScaffoldArgsType6(raw);
48044
- if (parsed instanceof type85.errors) {
48283
+ if (parsed instanceof type86.errors) {
48045
48284
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
48046
48285
  }
48047
48286
  const modelName = parsed.model_name.trim();
@@ -49103,10 +49342,10 @@ function createSearchModelSnapshotFieldTool(config) {
49103
49342
 
49104
49343
  // packages/dbx-components-mcp/src/tools/list-app-model-snapshot-fields.tool.ts
49105
49344
  import { glob, readFile as readFile27 } from "node:fs/promises";
49106
- import { resolve as resolve56 } from "node:path";
49107
- import { type as type86 } from "arktype";
49345
+ import { resolve as resolve57 } from "node:path";
49346
+ import { type as type87 } from "arktype";
49108
49347
  import { Node as Node37, Project as Project22 } from "ts-morph";
49109
- var ListAppArgsType4 = type86({
49348
+ var ListAppArgsType4 = type87({
49110
49349
  componentDir: "string",
49111
49350
  "apiDir?": "string",
49112
49351
  "format?": "'markdown' | 'json'"
@@ -49141,7 +49380,7 @@ function createListAppModelSnapshotFieldsTool(input) {
49141
49380
  async function run24(rawArgs) {
49142
49381
  const parsed = ListAppArgsType4(rawArgs);
49143
49382
  let result;
49144
- if (parsed instanceof type86.errors) {
49383
+ if (parsed instanceof type87.errors) {
49145
49384
  result = toolError(`Invalid arguments: ${parsed.summary}`);
49146
49385
  } else {
49147
49386
  const cwd = process.cwd();
@@ -49155,8 +49394,8 @@ function createListAppModelSnapshotFieldsTool(input) {
49155
49394
  pathError = err instanceof Error ? err.message : String(err);
49156
49395
  }
49157
49396
  if (pathError === void 0) {
49158
- const componentAbs = resolve56(cwd, parsed.componentDir);
49159
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve56(cwd, parsed.apiDir);
49397
+ const componentAbs = resolve57(cwd, parsed.componentDir);
49398
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve57(cwd, parsed.apiDir);
49160
49399
  let report;
49161
49400
  let buildError;
49162
49401
  try {
@@ -49205,14 +49444,14 @@ async function buildListAppReport(input) {
49205
49444
  const project = new Project22({ useInMemoryFileSystem: true, skipAddingFilesFromTsConfig: true });
49206
49445
  const componentFiles = await collectFiles(componentAbs, COMPONENT_MODEL_GLOBS);
49207
49446
  for (const rel of componentFiles) {
49208
- const abs = resolve56(componentAbs, rel);
49447
+ const abs = resolve57(componentAbs, rel);
49209
49448
  const text = await readFile27(abs, "utf-8");
49210
49449
  project.createSourceFile(`/component/${rel}`, text, { overwrite: true });
49211
49450
  }
49212
49451
  if (apiAbs !== void 0) {
49213
49452
  const apiFiles = await collectFiles(apiAbs, API_MODEL_GLOBS);
49214
49453
  for (const rel of apiFiles) {
49215
- const abs = resolve56(apiAbs, rel);
49454
+ const abs = resolve57(apiAbs, rel);
49216
49455
  const text = await readFile27(abs, "utf-8");
49217
49456
  project.createSourceFile(`/api/${rel}`, text, { overwrite: true });
49218
49457
  }
@@ -49818,9 +50057,9 @@ function createSearchModelFirebaseIndexTool(config) {
49818
50057
  }
49819
50058
 
49820
50059
  // packages/dbx-components-mcp/src/tools/list-app-model-firebase-index.tool.ts
49821
- import { resolve as resolve57 } from "node:path";
49822
- import { type as type87 } from "arktype";
49823
- var ListAppArgsType5 = type87({
50060
+ import { resolve as resolve58 } from "node:path";
50061
+ import { type as type88 } from "arktype";
50062
+ var ListAppArgsType5 = type88({
49824
50063
  componentDir: "string",
49825
50064
  "format?": "'markdown' | 'json'",
49826
50065
  "model?": "string",
@@ -49869,7 +50108,7 @@ var DBX_MODEL_FIREBASE_INDEX_LIST_APP_TOOL = {
49869
50108
  async function runListAppModelFirebaseIndex(rawArgs) {
49870
50109
  const parsed = ListAppArgsType5(rawArgs);
49871
50110
  let result;
49872
- if (parsed instanceof type87.errors) {
50111
+ if (parsed instanceof type88.errors) {
49873
50112
  result = toolError(`Invalid arguments: ${parsed.summary}`);
49874
50113
  } else {
49875
50114
  const cwd = process.cwd();
@@ -49880,7 +50119,7 @@ async function runListAppModelFirebaseIndex(rawArgs) {
49880
50119
  pathError = err instanceof Error ? err.message : String(err);
49881
50120
  }
49882
50121
  if (pathError === void 0) {
49883
- const componentAbs = resolve57(cwd, parsed.componentDir);
50122
+ const componentAbs = resolve58(cwd, parsed.componentDir);
49884
50123
  const filters = {
49885
50124
  model: parsed.model,
49886
50125
  category: parsed.category,
@@ -50276,8 +50515,8 @@ function formatReportAsJson16(report) {
50276
50515
 
50277
50516
  // packages/dbx-components-mcp/src/tools/validate-app-model-firebase-index.tool.ts
50278
50517
  import { readFile as readFile28 } from "node:fs/promises";
50279
- import { resolve as resolve58 } from "node:path";
50280
- import { type as type88 } from "arktype";
50518
+ import { resolve as resolve59 } from "node:path";
50519
+ import { type as type89 } from "arktype";
50281
50520
 
50282
50521
  // packages/dbx-components-mcp/src/tools/model-firebase-index-validate-app/format-warnings.ts
50283
50522
  function mapModelFirebaseIndexBuildWarning(warning) {
@@ -50492,7 +50731,7 @@ function buildFirebaseIndexValidateAppViolation(mapped) {
50492
50731
  }
50493
50732
 
50494
50733
  // packages/dbx-components-mcp/src/tools/validate-app-model-firebase-index.tool.ts
50495
- var ValidateAppArgsType2 = type88({
50734
+ var ValidateAppArgsType2 = type89({
50496
50735
  componentDir: "string",
50497
50736
  "indexesFile?": "string",
50498
50737
  "format?": "'markdown' | 'json'"
@@ -50614,7 +50853,7 @@ var DBX_MODEL_FIREBASE_INDEX_VALIDATE_APP_TOOL = {
50614
50853
  };
50615
50854
  async function runValidateAppModelFirebaseIndex(rawArgs) {
50616
50855
  const parsed = ValidateAppArgsType2(rawArgs);
50617
- if (parsed instanceof type88.errors) {
50856
+ if (parsed instanceof type89.errors) {
50618
50857
  return toolError(`Invalid arguments: ${parsed.summary}`);
50619
50858
  }
50620
50859
  const cwd = process.cwd();
@@ -50630,8 +50869,8 @@ async function runValidateAppModelFirebaseIndex(rawArgs) {
50630
50869
  }
50631
50870
  if (ensureError === void 0) {
50632
50871
  const indexesRelative = parsed.indexesFile ?? "firestore.indexes.json";
50633
- const componentAbs = resolve58(cwd, parsed.componentDir);
50634
- const indexesAbs = resolve58(cwd, indexesRelative);
50872
+ const componentAbs = resolve59(cwd, parsed.componentDir);
50873
+ const indexesAbs = resolve59(cwd, indexesRelative);
50635
50874
  let report;
50636
50875
  let buildError;
50637
50876
  try {
@@ -50985,8 +51224,8 @@ function formatReportAsJson17(report) {
50985
51224
 
50986
51225
  // packages/dbx-components-mcp/src/tools/artifact-scaffold.tool.ts
50987
51226
  import { access } from "node:fs/promises";
50988
- import { resolve as resolve59, sep as sep20 } from "node:path";
50989
- import { type as type89 } from "arktype";
51227
+ import { resolve as resolve60, sep as sep20 } from "node:path";
51228
+ import { type as type90 } from "arktype";
50990
51229
 
50991
51230
  // packages/dbx-components-mcp/src/tools/artifact-scaffold/templates.ts
50992
51231
  function splitWords(input) {
@@ -51556,7 +51795,7 @@ var DBX_ARTIFACT_SCAFFOLD_TOOL = {
51556
51795
  required: ["artifact", "name", "componentDir", "apiDir"]
51557
51796
  }
51558
51797
  };
51559
- var ScaffoldArtifactArgsType = type89({
51798
+ var ScaffoldArtifactArgsType = type90({
51560
51799
  artifact: ARTIFACT_KIND_LITERAL_UNION,
51561
51800
  name: "string",
51562
51801
  componentDir: "string",
@@ -51569,7 +51808,7 @@ var ScaffoldArtifactArgsType = type89({
51569
51808
  });
51570
51809
  function parseArgs13(raw) {
51571
51810
  const parsed = ScaffoldArtifactArgsType(raw);
51572
- if (parsed instanceof type89.errors) {
51811
+ if (parsed instanceof type90.errors) {
51573
51812
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
51574
51813
  }
51575
51814
  const result = {
@@ -51582,7 +51821,7 @@ function parseArgs13(raw) {
51582
51821
  return result;
51583
51822
  }
51584
51823
  function ensureInsideCwd(relativePath, cwd) {
51585
- const absolute = resolve59(cwd, relativePath);
51824
+ const absolute = resolve60(cwd, relativePath);
51586
51825
  const cwdPrefix = cwd.endsWith(sep20) ? cwd : cwd + sep20;
51587
51826
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
51588
51827
  throw new Error(`Path \`${relativePath}\` resolves outside the server cwd and is not allowed.`);
@@ -51621,7 +51860,7 @@ async function runArtifactScaffold(rawArgs) {
51621
51860
  scaffoldError = `Scaffold failed: ${message}`;
51622
51861
  }
51623
51862
  if (scaffoldError === void 0) {
51624
- const checked = await applyIdempotency(raw, (relativePath) => fileExists4(resolve59(cwd, relativePath)));
51863
+ const checked = await applyIdempotency(raw, (relativePath) => fileExists4(resolve60(cwd, relativePath)));
51625
51864
  const text = formatResult21(checked);
51626
51865
  result = { content: [{ type: "text", text }] };
51627
51866
  } else {
@@ -51642,7 +51881,7 @@ var ARTIFACT_SCAFFOLD_TOOL = {
51642
51881
  };
51643
51882
 
51644
51883
  // packages/dbx-components-mcp/src/tools/artifact-file-convention.tool.ts
51645
- import { type as type90 } from "arktype";
51884
+ import { type as type91 } from "arktype";
51646
51885
 
51647
51886
  // packages/dbx-components-mcp/src/tools/artifact-file-convention/spec.ts
51648
51887
  var FIRESTORE_MODEL = {
@@ -52118,7 +52357,7 @@ var DBX_ARTIFACT_FILE_CONVENTION_TOOL = {
52118
52357
  required: ["artifact"]
52119
52358
  }
52120
52359
  };
52121
- var FileConventionArgsType = type90({
52360
+ var FileConventionArgsType = type91({
52122
52361
  artifact: ARTIFACT_KIND_LITERAL_UNION2,
52123
52362
  "componentDir?": "string",
52124
52363
  "apiDir?": "string",
@@ -52126,7 +52365,7 @@ var FileConventionArgsType = type90({
52126
52365
  });
52127
52366
  function parseArgs14(raw) {
52128
52367
  const parsed = FileConventionArgsType(raw);
52129
- if (parsed instanceof type90.errors) {
52368
+ if (parsed instanceof type91.errors) {
52130
52369
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
52131
52370
  }
52132
52371
  const result = {
@@ -52160,8 +52399,8 @@ var ARTIFACT_FILE_CONVENTION_TOOL = {
52160
52399
  };
52161
52400
 
52162
52401
  // packages/dbx-components-mcp/src/tools/explain-rule.tool.ts
52163
- import { type as type91 } from "arktype";
52164
- var ExplainRuleArgsType = type91({
52402
+ import { type as type92 } from "arktype";
52403
+ var ExplainRuleArgsType = type92({
52165
52404
  "code?": "string",
52166
52405
  "source?": "string",
52167
52406
  "severity?": "'error' | 'warning'",
@@ -52204,7 +52443,7 @@ var TOOL16 = {
52204
52443
  };
52205
52444
  async function run17(rawArgs) {
52206
52445
  const parsed = ExplainRuleArgsType(rawArgs);
52207
- if (parsed instanceof type91.errors) {
52446
+ if (parsed instanceof type92.errors) {
52208
52447
  return toolError(`Invalid arguments: ${parsed.summary}`);
52209
52448
  }
52210
52449
  if (parsed.code !== void 0) {
@@ -52292,9 +52531,9 @@ function groupBySource(entries) {
52292
52531
  var EXPLAIN_RULE_TOOL = { definition: TOOL16, run: run17 };
52293
52532
 
52294
52533
  // packages/dbx-components-mcp/src/tools/app-validate.tool.ts
52295
- import { resolve as resolve60, join as join25 } from "node:path";
52534
+ import { resolve as resolve61, join as join25 } from "node:path";
52296
52535
  import { readdir as readdir11, readFile as readFile29, stat as stat16 } from "node:fs/promises";
52297
- import { type as type92 } from "arktype";
52536
+ import { type as type93 } from "arktype";
52298
52537
  var { inspectAppStorageFiles: inspectAppStorageFiles4, validateAppStorageFiles: validateAppStorageFiles3 } = storagefile_m_validate_app_exports;
52299
52538
  var { inspectAppNotifications: inspectAppNotifications4, validateAppNotifications: validateAppNotifications3 } = notification_m_validate_app_exports;
52300
52539
  var { validateAppFixtures: validateAppFixtures3 } = model_fixture_shared_exports;
@@ -52306,7 +52545,7 @@ var { validateAppModelApi: validateAppModelApi3 } = model_api_validate_app_expor
52306
52545
  var { validateModelTestApp: validateModelTestApp3 } = model_test_validate_app_exports;
52307
52546
  var { extractComponentModels: extractComponentModels3 } = model_list_component_exports;
52308
52547
  var Cluster = "'storagefile_m' | 'notification_m' | 'model_folder' | 'system_m' | 'fixture' | 'manifest' | 'model_api' | 'firebase_index' | 'asset' | 'model_test'";
52309
- var AppValidateArgsType = type92({
52548
+ var AppValidateArgsType = type93({
52310
52549
  componentDir: "string",
52311
52550
  apiDir: "string",
52312
52551
  "webDir?": "string",
@@ -52362,17 +52601,17 @@ var TOOL17 = {
52362
52601
  };
52363
52602
  async function run18(rawArgs) {
52364
52603
  const parsed = AppValidateArgsType(rawArgs);
52365
- if (parsed instanceof type92.errors) {
52604
+ if (parsed instanceof type93.errors) {
52366
52605
  return toolError(`Invalid arguments: ${parsed.summary}`);
52367
52606
  }
52368
52607
  const cwd = process.cwd();
52369
52608
  const pathCheck = ensureArgPaths(parsed, cwd);
52370
52609
  if (pathCheck !== void 0) return pathCheck;
52371
- const componentAbs = resolve60(cwd, parsed.componentDir);
52372
- const apiAbs = resolve60(cwd, parsed.apiDir);
52373
- const webAbs = parsed.webDir === void 0 ? void 0 : resolve60(cwd, parsed.webDir);
52610
+ const componentAbs = resolve61(cwd, parsed.componentDir);
52611
+ const apiAbs = resolve61(cwd, parsed.apiDir);
52612
+ const webAbs = parsed.webDir === void 0 ? void 0 : resolve61(cwd, parsed.webDir);
52374
52613
  const indexesRel = parsed.indexesFile ?? "firestore.indexes.json";
52375
- const indexesAbs = resolve60(cwd, indexesRel);
52614
+ const indexesAbs = resolve61(cwd, indexesRel);
52376
52615
  const skip = new Set(parsed.skip ?? []);
52377
52616
  const findings = [];
52378
52617
  const skipped = [];
@@ -52730,9 +52969,9 @@ var APP_VALIDATE_TOOL = { definition: TOOL17, run: run18 };
52730
52969
 
52731
52970
  // packages/dbx-components-mcp/src/tools/firestore-rules-scan.tool.ts
52732
52971
  import { readFile as readFile30 } from "node:fs/promises";
52733
- import { resolve as resolve61 } from "node:path";
52734
- import { type as type93 } from "arktype";
52735
- var ScanArgsType = type93({
52972
+ import { resolve as resolve62 } from "node:path";
52973
+ import { type as type94 } from "arktype";
52974
+ var ScanArgsType = type94({
52736
52975
  "rulesFile?": "string",
52737
52976
  "collection?": "string",
52738
52977
  "serverOnly?": "boolean",
@@ -52838,7 +53077,7 @@ function formatFirestoreRulesScanReportAsMarkdown(report) {
52838
53077
  }
52839
53078
  async function run19(rawArgs) {
52840
53079
  const parsed = ScanArgsType(rawArgs ?? {});
52841
- if (parsed instanceof type93.errors) {
53080
+ if (parsed instanceof type94.errors) {
52842
53081
  return toolError(`Invalid arguments: ${parsed.summary}`);
52843
53082
  }
52844
53083
  const cwd = process.cwd();
@@ -52853,7 +53092,7 @@ async function run19(rawArgs) {
52853
53092
  if (failure === void 0) {
52854
53093
  let source;
52855
53094
  try {
52856
- source = await readFile30(resolve61(cwd, rulesFile), "utf8");
53095
+ source = await readFile30(resolve62(cwd, rulesFile), "utf8");
52857
53096
  } catch (err) {
52858
53097
  failure = `Failed to read ${rulesFile}: ${err instanceof Error ? err.message : String(err)}`;
52859
53098
  }
@@ -52875,8 +53114,8 @@ var FIRESTORE_RULES_SCAN_TOOL = { definition: TOOL18, run: run19 };
52875
53114
 
52876
53115
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app.tool.ts
52877
53116
  import { readdir as readdir12, readFile as readFile31, stat as stat17 } from "node:fs/promises";
52878
- import { join as join26, relative as relative20, resolve as resolve62 } from "node:path";
52879
- import { type as type94 } from "arktype";
53117
+ import { join as join26, relative as relative20, resolve as resolve63 } from "node:path";
53118
+ import { type as type95 } from "arktype";
52880
53119
 
52881
53120
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app/extract-service-flags.ts
52882
53121
  var SERVICE_FACTORY_TAG2 = /@dbxModelServiceFactory\s+([A-Za-z_$][\w$]*)/;
@@ -53197,7 +53436,7 @@ function buildViolation(input) {
53197
53436
  }
53198
53437
 
53199
53438
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app.tool.ts
53200
- var ValidateAppArgsType3 = type94({
53439
+ var ValidateAppArgsType3 = type95({
53201
53440
  componentDir: "string",
53202
53441
  "rulesFile?": "string",
53203
53442
  "serviceFile?": "string",
@@ -53251,7 +53490,7 @@ async function scanModelFacts(input) {
53251
53490
  const interfaces = /* @__PURE__ */ new Map();
53252
53491
  const identities = /* @__PURE__ */ new Map();
53253
53492
  for (const dir of input.dirs) {
53254
- for (const filePath of await walkTypeScriptFiles(resolve62(input.cwd, dir))) {
53493
+ for (const filePath of await walkTypeScriptFiles(resolve63(input.cwd, dir))) {
53255
53494
  const text = await readFile31(filePath, "utf8");
53256
53495
  if (!text.includes("firestoreModelIdentity(") && !text.includes("@dbxModel")) continue;
53257
53496
  const relativePath = relative20(input.cwd, filePath);
@@ -53300,7 +53539,7 @@ async function isDirectory5(path) {
53300
53539
  }
53301
53540
  async function run20(rawArgs) {
53302
53541
  const parsed = ValidateAppArgsType3(rawArgs);
53303
- if (parsed instanceof type94.errors) {
53542
+ if (parsed instanceof type95.errors) {
53304
53543
  return toolError(`Invalid arguments: ${parsed.summary}`);
53305
53544
  }
53306
53545
  const cwd = process.cwd();
@@ -53317,22 +53556,22 @@ async function run20(rawArgs) {
53317
53556
  if (failure !== void 0) {
53318
53557
  return toolError(failure);
53319
53558
  }
53320
- const rulesSource = await readOptionalFile(resolve62(cwd, rulesFile));
53559
+ const rulesSource = await readOptionalFile(resolve63(cwd, rulesFile));
53321
53560
  if (rulesSource === void 0) {
53322
53561
  return toolError(`Failed to read rules file \`${rulesFile}\`.`);
53323
53562
  }
53324
- const serviceSource = await readOptionalFile(resolve62(cwd, serviceFile));
53563
+ const serviceSource = await readOptionalFile(resolve63(cwd, serviceFile));
53325
53564
  if (serviceSource === void 0) {
53326
53565
  return toolError(`Failed to read service file \`${serviceFile}\`. Pass \`serviceFile\` when the component does not use the conventional \`src/lib/model/service.ts\` path.`);
53327
53566
  }
53328
53567
  const requestedDirs = [`${parsed.componentDir.replace(/[/\\]+$/, "")}/src/lib`, ...DEFAULT_UPSTREAM_MODEL_DIRS, ...parsed.modelDirs ?? []];
53329
53568
  const modelDirs = [];
53330
53569
  for (const dir of requestedDirs) {
53331
- if (!modelDirs.includes(dir) && await isDirectory5(resolve62(cwd, dir))) {
53570
+ if (!modelDirs.includes(dir) && await isDirectory5(resolve63(cwd, dir))) {
53332
53571
  modelDirs.push(dir);
53333
53572
  }
53334
53573
  }
53335
- const manifestSource = parsed.manifestFile === void 0 ? void 0 : await readOptionalFile(resolve62(cwd, parsed.manifestFile));
53574
+ const manifestSource = parsed.manifestFile === void 0 ? void 0 : await readOptionalFile(resolve63(cwd, parsed.manifestFile));
53336
53575
  if (parsed.manifestFile !== void 0 && manifestSource === void 0) {
53337
53576
  return toolError(`Failed to read model manifest \`${parsed.manifestFile}\`.`);
53338
53577
  }
@@ -53354,10 +53593,10 @@ async function run20(rawArgs) {
53354
53593
  var MODEL_SERVER_ONLY_VALIDATE_APP_TOOL = { definition: TOOL19, run: run20 };
53355
53594
 
53356
53595
  // packages/dbx-components-mcp/src/tools/model-list-component.tool.ts
53357
- import { resolve as resolve63 } from "node:path";
53358
- import { type as type95 } from "arktype";
53596
+ import { resolve as resolve64 } from "node:path";
53597
+ import { type as type96 } from "arktype";
53359
53598
  var { formatReportAsJson: formatReportAsJson18, formatReportAsMarkdown: formatReportAsMarkdown18, listComponentModels: listComponentModels2 } = model_list_component_exports;
53360
- var ListArgsType3 = type95({
53599
+ var ListArgsType3 = type96({
53361
53600
  componentDir: "string",
53362
53601
  "apiDir?": "string",
53363
53602
  "format?": "'markdown' | 'json'"
@@ -53388,7 +53627,7 @@ var TOOL20 = {
53388
53627
  };
53389
53628
  async function run21(rawArgs) {
53390
53629
  const parsed = ListArgsType3(rawArgs);
53391
- if (parsed instanceof type95.errors) {
53630
+ if (parsed instanceof type96.errors) {
53392
53631
  return toolError(`Invalid arguments: ${parsed.summary}`);
53393
53632
  }
53394
53633
  const cwd = process.cwd();
@@ -53401,8 +53640,8 @@ async function run21(rawArgs) {
53401
53640
  ensureError = err instanceof Error ? err.message : String(err);
53402
53641
  }
53403
53642
  if (ensureError === void 0) {
53404
- const componentAbs = resolve63(cwd, parsed.componentDir);
53405
- const apiAbs = parsed.apiDir ? resolve63(cwd, parsed.apiDir) : void 0;
53643
+ const componentAbs = resolve64(cwd, parsed.componentDir);
53644
+ const apiAbs = parsed.apiDir ? resolve64(cwd, parsed.apiDir) : void 0;
53406
53645
  let report;
53407
53646
  let listError;
53408
53647
  try {
@@ -53424,10 +53663,10 @@ async function run21(rawArgs) {
53424
53663
  var MODEL_LIST_COMPONENT_TOOL = { definition: TOOL20, run: run21 };
53425
53664
 
53426
53665
  // packages/dbx-components-mcp/src/tools/server-actions-list-app.tool.ts
53427
- import { resolve as resolve64 } from "node:path";
53428
- import { type as type96 } from "arktype";
53666
+ import { resolve as resolve65 } from "node:path";
53667
+ import { type as type97 } from "arktype";
53429
53668
  var { formatReportAsJson: formatReportAsJson19, formatReportAsMarkdown: formatReportAsMarkdown19, listAppServerActions: listAppServerActions2 } = server_actions_list_app_exports;
53430
- var ListArgsType4 = type96({
53669
+ var ListArgsType4 = type97({
53431
53670
  apiDir: "string",
53432
53671
  "format?": "'markdown' | 'json'"
53433
53672
  });
@@ -53456,7 +53695,7 @@ var TOOL21 = {
53456
53695
  };
53457
53696
  async function run22(rawArgs) {
53458
53697
  const parsed = ListArgsType4(rawArgs);
53459
- if (parsed instanceof type96.errors) {
53698
+ if (parsed instanceof type97.errors) {
53460
53699
  return toolError(`Invalid arguments: ${parsed.summary}`);
53461
53700
  }
53462
53701
  const cwd = process.cwd();
@@ -53468,7 +53707,7 @@ async function run22(rawArgs) {
53468
53707
  ensureError = err instanceof Error ? err.message : String(err);
53469
53708
  }
53470
53709
  if (ensureError === void 0) {
53471
- const apiAbs = resolve64(cwd, parsed.apiDir);
53710
+ const apiAbs = resolve65(cwd, parsed.apiDir);
53472
53711
  let report;
53473
53712
  let listError;
53474
53713
  try {
@@ -53490,16 +53729,16 @@ async function run22(rawArgs) {
53490
53729
  var SERVER_ACTIONS_LIST_APP_TOOL = { definition: TOOL21, run: run22 };
53491
53730
 
53492
53731
  // packages/dbx-components-mcp/src/tools/mcp-config.tool.ts
53493
- import { type as type97 } from "arktype";
53494
- import { resolve as resolve67 } from "node:path";
53732
+ import { type as type98 } from "arktype";
53733
+ import { resolve as resolve68 } from "node:path";
53495
53734
 
53496
53735
  // packages/dbx-components-mcp/src/tools/mcp-config/snapshot.ts
53497
- import { dirname as dirname21, isAbsolute as isAbsolute18, relative as relative21, resolve as resolve65 } from "node:path";
53736
+ import { dirname as dirname22, isAbsolute as isAbsolute18, relative as relative21, resolve as resolve66 } from "node:path";
53498
53737
  import { stat as stat18 } from "node:fs/promises";
53499
53738
  async function buildSnapshot(input) {
53500
53739
  const { workspaceRoot, explicitDirs } = input;
53501
53740
  const configResult = await findAndLoadConfig({ cwd: workspaceRoot });
53502
- const configBaseDir = configResult.configPath === null ? workspaceRoot : dirname21(configResult.configPath);
53741
+ const configBaseDir = configResult.configPath === null ? workspaceRoot : dirname22(configResult.configPath);
53503
53742
  const registeredSources = await collectRegisteredSources(configResult.config, configBaseDir, workspaceRoot);
53504
53743
  const packages = await discoverDownstreamPackages({ workspaceRoot, explicitDirs });
53505
53744
  const packageSnapshots = packages.map((pkg) => ({
@@ -53521,7 +53760,7 @@ async function collectRegisteredSources(config, configBaseDir, workspaceRoot) {
53521
53760
  for (const cluster of DOWNSTREAM_CLUSTERS) {
53522
53761
  const declared = config[cluster]?.sources ?? [];
53523
53762
  for (const declaredPath of declared) {
53524
- const absolutePath = isAbsolute18(declaredPath) ? declaredPath : resolve65(configBaseDir, declaredPath);
53763
+ const absolutePath = isAbsolute18(declaredPath) ? declaredPath : resolve66(configBaseDir, declaredPath);
53525
53764
  const exists = await fileExists5(absolutePath);
53526
53765
  const relativePath = relativeOrAbsolute(workspaceRoot, absolutePath);
53527
53766
  out.push({ cluster, declaredPath, absolutePath, relativePath, exists });
@@ -53561,7 +53800,7 @@ function relativeOrAbsolute(from, target) {
53561
53800
 
53562
53801
  // packages/dbx-components-mcp/src/tools/mcp-config/init.ts
53563
53802
  import { writeFile as nodeWriteFile4, mkdir as nodeMkdir, readFile as nodeReadFile8 } from "node:fs/promises";
53564
- import { dirname as dirname22, relative as relative22, resolve as resolve66 } from "node:path";
53803
+ import { dirname as dirname23, relative as relative22, resolve as resolve67 } from "node:path";
53565
53804
  var HEURISTIC_CLUSTERS = ["uiComponents", "forgeFields", "pipes", "actions", "filters"];
53566
53805
  var CLUSTER_FILENAME_SEGMENT = {
53567
53806
  semanticTypes: "semantic",
@@ -53600,7 +53839,7 @@ async function applyInitPlan(plan, opts) {
53600
53839
  const mkdir = opts?.mkdir ?? defaultMkdir;
53601
53840
  for (const change of plan.changes) {
53602
53841
  if (change.reason === "unchanged") continue;
53603
- await mkdir(dirname22(change.absolutePath));
53842
+ await mkdir(dirname23(change.absolutePath));
53604
53843
  await writeFile2(change.absolutePath, change.after);
53605
53844
  }
53606
53845
  }
@@ -53625,7 +53864,7 @@ function upsertClusterSection(input) {
53625
53864
  async function planPackageScanConfig(input) {
53626
53865
  const { snapshot, packageSnapshot, readFile: readFile33 } = input;
53627
53866
  const { pkg } = packageSnapshot;
53628
- const scanConfigPath = resolve66(pkg.absDir, "dbx-mcp.scan.json");
53867
+ const scanConfigPath = resolve67(pkg.absDir, "dbx-mcp.scan.json");
53629
53868
  const before = await tryRead(scanConfigPath, readFile33);
53630
53869
  const parsed = parseExisting(before);
53631
53870
  const targetClusters = HEURISTIC_CLUSTERS.filter((c) => pkg.candidateClusters.includes(c));
@@ -53655,7 +53894,7 @@ async function planPackageScanConfig(input) {
53655
53894
  }
53656
53895
  async function planRootConfig(input) {
53657
53896
  const { snapshot, sourcesToRegister, readFile: readFile33 } = input;
53658
- const configPath = snapshot.configPath ?? resolve66(snapshot.workspaceRoot, "dbx-mcp.config.json");
53897
+ const configPath = snapshot.configPath ?? resolve67(snapshot.workspaceRoot, "dbx-mcp.config.json");
53659
53898
  const before = snapshot.configPath === null ? null : await tryRead(configPath, readFile33);
53660
53899
  const baseConfig = snapshot.config === null ? { version: 1 } : cloneConfig(snapshot.config);
53661
53900
  if (baseConfig.version !== 1) baseConfig.version = 1;
@@ -53684,14 +53923,14 @@ async function planRootConfig(input) {
53684
53923
  };
53685
53924
  }
53686
53925
  function defaultOutFor(input) {
53687
- const targetAbs = resolve66(input.snapshot.workspaceRoot, ".tmp/dbx-mcp", `${input.slug}.${clusterFilenameSegment(input.cluster)}.json`);
53688
- return relative22(dirname22(input.scanConfigPath), targetAbs).replaceAll("\\", "/");
53926
+ const targetAbs = resolve67(input.snapshot.workspaceRoot, ".tmp/dbx-mcp", `${input.slug}.${clusterFilenameSegment(input.cluster)}.json`);
53927
+ return relative22(dirname23(input.scanConfigPath), targetAbs).replaceAll("\\", "/");
53689
53928
  }
53690
53929
  function resolveScanOut(scanConfigPath, out) {
53691
- return resolve66(dirname22(scanConfigPath), out);
53930
+ return resolve67(dirname23(scanConfigPath), out);
53692
53931
  }
53693
53932
  function relativeFromConfig(snapshot, absolute) {
53694
- const configDir = snapshot.configPath === null ? snapshot.workspaceRoot : dirname22(snapshot.configPath);
53933
+ const configDir = snapshot.configPath === null ? snapshot.workspaceRoot : dirname23(snapshot.configPath);
53695
53934
  return relative22(configDir, absolute).replaceAll("\\", "/");
53696
53935
  }
53697
53936
  function workspaceRel(workspaceRoot, absolute) {
@@ -54024,7 +54263,7 @@ var TOOL22 = {
54024
54263
  required: ["op"]
54025
54264
  }
54026
54265
  };
54027
- var McpConfigArgsType = type97({
54266
+ var McpConfigArgsType = type98({
54028
54267
  op: "'status' | 'validate' | 'init' | 'refresh'",
54029
54268
  "cwd?": "string",
54030
54269
  "dryRun?": "boolean",
@@ -54032,10 +54271,10 @@ var McpConfigArgsType = type97({
54032
54271
  });
54033
54272
  function parseArgs15(rawArgs, defaultCwd) {
54034
54273
  const parsed = McpConfigArgsType(rawArgs);
54035
- if (parsed instanceof type97.errors) {
54274
+ if (parsed instanceof type98.errors) {
54036
54275
  return `Invalid arguments: ${parsed.summary}`;
54037
54276
  }
54038
- const workspaceRoot = parsed.cwd !== void 0 && parsed.cwd.length > 0 ? resolve67(defaultCwd, parsed.cwd) : defaultCwd;
54277
+ const workspaceRoot = parsed.cwd !== void 0 && parsed.cwd.length > 0 ? resolve68(defaultCwd, parsed.cwd) : defaultCwd;
54039
54278
  const invalidDirError = validateExplicitDirs(parsed.explicitDirs, workspaceRoot);
54040
54279
  let result;
54041
54280
  if (invalidDirError === void 0) {
@@ -54104,12 +54343,12 @@ var MCP_CONFIG_TOOL = {
54104
54343
  };
54105
54344
 
54106
54345
  // packages/dbx-components-mcp/src/tools/log-search.tool.ts
54107
- import { type as type98 } from "arktype";
54346
+ import { type as type99 } from "arktype";
54108
54347
  import { basename as basename10 } from "node:path";
54109
54348
 
54110
54349
  // packages/dbx-components-mcp/src/tools/log-search/discover-logs.ts
54111
54350
  import { readdir as readdir13, stat as stat19 } from "node:fs/promises";
54112
- import { basename as basename9, join as join27, resolve as resolve68 } from "node:path";
54351
+ import { basename as basename9, join as join27, resolve as resolve69 } from "node:path";
54113
54352
  var DBX_LOG_PATH_ENV_VAR = "DBX_LOG_PATH";
54114
54353
  function resolveLogBasePath(input) {
54115
54354
  let result;
@@ -54117,11 +54356,11 @@ function resolveLogBasePath(input) {
54117
54356
  const fromEnv = input.env[DBX_LOG_PATH_ENV_VAR]?.trim();
54118
54357
  const fromConfig = input.configBasePath?.trim();
54119
54358
  if (fromArg !== void 0 && fromArg.length > 0) {
54120
- result = { kind: "ok", absolutePath: resolve68(fromArg), source: "arg" };
54359
+ result = { kind: "ok", absolutePath: resolve69(fromArg), source: "arg" };
54121
54360
  } else if (fromEnv !== void 0 && fromEnv.length > 0) {
54122
- result = { kind: "ok", absolutePath: resolve68(fromEnv), source: "env" };
54361
+ result = { kind: "ok", absolutePath: resolve69(fromEnv), source: "env" };
54123
54362
  } else if (fromConfig !== void 0 && fromConfig.length > 0) {
54124
- result = { kind: "ok", absolutePath: resolve68(fromConfig), source: "config" };
54363
+ result = { kind: "ok", absolutePath: resolve69(fromConfig), source: "config" };
54125
54364
  } else {
54126
54365
  result = { kind: "error", message: `No log path configured. Set ${DBX_LOG_PATH_ENV_VAR}, pass basePath, or add a logs.basePath block to dbx-mcp.config.json.` };
54127
54366
  }
@@ -54517,7 +54756,7 @@ var DBX_LOG_SEARCH_TOOL = {
54517
54756
  }
54518
54757
  }
54519
54758
  };
54520
- var LogSearchArgsType = type98({
54759
+ var LogSearchArgsType = type99({
54521
54760
  "query?": "string",
54522
54761
  "mode?": "'fuzzy' | 'keyword' | 'list'",
54523
54762
  "basePath?": "string",
@@ -54530,7 +54769,7 @@ var LogSearchArgsType = type98({
54530
54769
  });
54531
54770
  function parseArgs16(input) {
54532
54771
  const parsed = LogSearchArgsType(input.raw ?? {});
54533
- if (parsed instanceof type98.errors) {
54772
+ if (parsed instanceof type99.errors) {
54534
54773
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54535
54774
  }
54536
54775
  const rawQuery = parsed.query?.trim();
@@ -54652,7 +54891,7 @@ function createLogSearchTool(config) {
54652
54891
  var LOG_SEARCH_TOOL = createLogSearchTool();
54653
54892
 
54654
54893
  // packages/dbx-components-mcp/src/tools/lookup-semantic-type.tool.ts
54655
- import { type as type99 } from "arktype";
54894
+ import { type as type100 } from "arktype";
54656
54895
 
54657
54896
  // packages/dbx-components-mcp/src/tools/semantic-type-lookup.formatter.ts
54658
54897
  function formatSemanticTypeEntry(entry, depth) {
@@ -54828,13 +55067,13 @@ var DBX_SEMANTIC_TYPE_LOOKUP_TOOL = {
54828
55067
  required: ["name"]
54829
55068
  }
54830
55069
  };
54831
- var LookupSemanticTypeArgsType = type99({
55070
+ var LookupSemanticTypeArgsType = type100({
54832
55071
  name: "string",
54833
55072
  "depth?": "'brief' | 'full'"
54834
55073
  });
54835
55074
  function parseLookupArgs2(raw) {
54836
55075
  const parsed = LookupSemanticTypeArgsType(raw);
54837
- if (parsed instanceof type99.errors) {
55076
+ if (parsed instanceof type100.errors) {
54838
55077
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54839
55078
  }
54840
55079
  const result = {
@@ -54896,7 +55135,7 @@ function formatNotFound16(name, registry) {
54896
55135
  }
54897
55136
 
54898
55137
  // packages/dbx-components-mcp/src/tools/search-semantic-type.tool.ts
54899
- import { type as type100 } from "arktype";
55138
+ import { type as type101 } from "arktype";
54900
55139
  var DEFAULT_LIMIT9 = 25;
54901
55140
  var MAX_LIMIT8 = 100;
54902
55141
  var DBX_SEMANTIC_TYPE_SEARCH_TOOL = {
@@ -54929,7 +55168,7 @@ var DBX_SEMANTIC_TYPE_SEARCH_TOOL = {
54929
55168
  }
54930
55169
  }
54931
55170
  };
54932
- var SearchSemanticTypeArgsType = type100({
55171
+ var SearchSemanticTypeArgsType = type101({
54933
55172
  "topic?": "string",
54934
55173
  "baseType?": "string",
54935
55174
  "package?": "string",
@@ -54938,7 +55177,7 @@ var SearchSemanticTypeArgsType = type100({
54938
55177
  });
54939
55178
  function parseSearchArgs2(raw) {
54940
55179
  const parsed = SearchSemanticTypeArgsType(raw);
54941
- if (parsed instanceof type100.errors) {
55180
+ if (parsed instanceof type101.errors) {
54942
55181
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54943
55182
  }
54944
55183
  const rawLimit = parsed.limit ?? DEFAULT_LIMIT9;
@@ -55055,7 +55294,7 @@ function describeFilters(args) {
55055
55294
  }
55056
55295
 
55057
55296
  // packages/dbx-components-mcp/src/tools/css-token-lookup.tool.ts
55058
- import { type as type101 } from "arktype";
55297
+ import { type as type102 } from "arktype";
55059
55298
 
55060
55299
  // packages/dbx-components-mcp/src/tools/css-token-lookup/synonyms.ts
55061
55300
  var INTENT_SYNONYMS = /* @__PURE__ */ new Map([
@@ -55624,7 +55863,7 @@ var DBX_CSS_TOKEN_LOOKUP_TOOL = {
55624
55863
  }
55625
55864
  }
55626
55865
  };
55627
- var CssTokenLookupArgs = type101({
55866
+ var CssTokenLookupArgs = type102({
55628
55867
  "intent?": "string",
55629
55868
  "value?": "string",
55630
55869
  "role?": "string",
@@ -55633,7 +55872,7 @@ var CssTokenLookupArgs = type101({
55633
55872
  });
55634
55873
  function parseArgs17(raw) {
55635
55874
  const parsed = CssTokenLookupArgs(raw);
55636
- if (parsed instanceof type101.errors) {
55875
+ if (parsed instanceof type102.errors) {
55637
55876
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
55638
55877
  }
55639
55878
  const result = {
@@ -55665,7 +55904,7 @@ function createCssTokenLookupTool(input) {
55665
55904
  }
55666
55905
 
55667
55906
  // packages/dbx-components-mcp/src/tools/css-class-lookup.tool.ts
55668
- import { type as type102 } from "arktype";
55907
+ import { type as type103 } from "arktype";
55669
55908
  var DBX_CSS_CLASS_LOOKUP_TOOL = {
55670
55909
  name: "dbx_css_class_lookup",
55671
55910
  description: [
@@ -55703,7 +55942,7 @@ var DBX_CSS_CLASS_LOOKUP_TOOL = {
55703
55942
  }
55704
55943
  }
55705
55944
  };
55706
- var CssClassLookupArgs = type102({
55945
+ var CssClassLookupArgs = type103({
55707
55946
  "name?": "string",
55708
55947
  "declarations?": "string",
55709
55948
  "intent?": "string",
@@ -55714,7 +55953,7 @@ var CssClassLookupArgs = type102({
55714
55953
  });
55715
55954
  function parseArgs18(raw) {
55716
55955
  const parsed = CssClassLookupArgs(raw);
55717
- if (parsed instanceof type102.errors) {
55956
+ if (parsed instanceof type103.errors) {
55718
55957
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
55719
55958
  }
55720
55959
  return {
@@ -56022,8 +56261,8 @@ function renderAmbiguous(matches) {
56022
56261
 
56023
56262
  // packages/dbx-components-mcp/src/tools/ui-smell-check.tool.ts
56024
56263
  import { readFile as nodeReadFile9 } from "node:fs/promises";
56025
- import { basename as basename11, extname, isAbsolute as isAbsolute19, resolve as resolve69 } from "node:path";
56026
- import { type as type103 } from "arktype";
56264
+ import { basename as basename11, extname, isAbsolute as isAbsolute19, resolve as resolve70 } from "node:path";
56265
+ import { type as type104 } from "arktype";
56027
56266
  var { detectSmellsDetailed: detectSmellsDetailed2, formatBatchSmellResult: formatBatchSmellResult2, formatSmellResult: formatSmellResult2 } = ui_smell_check_exports;
56028
56267
  var DBX_UI_SMELL_CHECK_TOOL = {
56029
56268
  name: "dbx_ui_smell_check",
@@ -56057,18 +56296,18 @@ var DBX_UI_SMELL_CHECK_TOOL = {
56057
56296
  }
56058
56297
  }
56059
56298
  };
56060
- var SmellCheckArgs = type103({
56299
+ var SmellCheckArgs = type104({
56061
56300
  "html?": "string",
56062
56301
  "scss?": "string",
56063
56302
  "htmlPath?": "string",
56064
56303
  "scssPath?": "string",
56065
56304
  "paths?": "string[]",
56066
56305
  "context?": "string",
56067
- "projectConventions?": type103({ "cardWrapperClasses?": "string[]" })
56306
+ "projectConventions?": type104({ "cardWrapperClasses?": "string[]" })
56068
56307
  });
56069
56308
  function parseArgs19(raw, defaults) {
56070
56309
  const parsed = SmellCheckArgs(raw);
56071
- if (parsed instanceof type103.errors) {
56310
+ if (parsed instanceof type104.errors) {
56072
56311
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
56073
56312
  }
56074
56313
  const html = parsed.html ?? "";
@@ -56080,7 +56319,7 @@ function parseArgs19(raw, defaults) {
56080
56319
  }
56081
56320
  var DEFAULT_READ_FILE17 = (path) => nodeReadFile9(path, "utf-8");
56082
56321
  async function readPathInput(path, cwd, readFile33) {
56083
- const absolute = isAbsolute19(path) ? path : resolve69(cwd, path);
56322
+ const absolute = isAbsolute19(path) ? path : resolve70(cwd, path);
56084
56323
  return readFile33(absolute);
56085
56324
  }
56086
56325
  function pairBatchPaths(paths) {
@@ -56287,7 +56526,7 @@ async function tryReadBatchPath(path, cwd, reader) {
56287
56526
  }
56288
56527
 
56289
56528
  // packages/dbx-components-mcp/src/tools/auth-claim-lookup.tool.ts
56290
- import { type as type104 } from "arktype";
56529
+ import { type as type105 } from "arktype";
56291
56530
  var DBX_AUTH_CLAIM_LOOKUP_TOOL = {
56292
56531
  name: "dbx_auth_claim_lookup",
56293
56532
  description: [
@@ -56307,7 +56546,7 @@ var DBX_AUTH_CLAIM_LOOKUP_TOOL = {
56307
56546
  required: ["topic"]
56308
56547
  }
56309
56548
  };
56310
- var ClaimArgsType = type104({
56549
+ var ClaimArgsType = type105({
56311
56550
  topic: "string",
56312
56551
  "app?": "string",
56313
56552
  "depth?": "'brief' | 'full'"
@@ -56320,7 +56559,7 @@ function createAuthClaimLookupTool(input) {
56320
56559
  run(rawArgs) {
56321
56560
  const parsed = ClaimArgsType(rawArgs);
56322
56561
  let result;
56323
- if (parsed instanceof type104.errors) {
56562
+ if (parsed instanceof type105.errors) {
56324
56563
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56325
56564
  } else {
56326
56565
  const { topic, app, depth = "full" } = parsed;
@@ -56419,7 +56658,7 @@ function code16(value) {
56419
56658
  }
56420
56659
 
56421
56660
  // packages/dbx-components-mcp/src/tools/auth-scope-lookup.tool.ts
56422
- import { type as type105 } from "arktype";
56661
+ import { type as type106 } from "arktype";
56423
56662
  var DBX_AUTH_SCOPE_LOOKUP_TOOL = {
56424
56663
  name: "dbx_auth_scope_lookup",
56425
56664
  description: ["Look up an OIDC scope (`model.read`, `model.write`, `demo`).", "", "Returns the prefix family, the CRUD verb (when a callModel scope), the source `path:line` declaration, every gate that enforces it, the error code thrown on rejection, and the apps that accept it."].join("\n"),
@@ -56432,7 +56671,7 @@ var DBX_AUTH_SCOPE_LOOKUP_TOOL = {
56432
56671
  required: ["topic"]
56433
56672
  }
56434
56673
  };
56435
- var ScopeArgsType = type105({
56674
+ var ScopeArgsType = type106({
56436
56675
  topic: "string",
56437
56676
  "depth?": "'brief' | 'full'"
56438
56677
  });
@@ -56444,7 +56683,7 @@ function createAuthScopeLookupTool(input) {
56444
56683
  run(rawArgs) {
56445
56684
  const parsed = ScopeArgsType(rawArgs);
56446
56685
  let result;
56447
- if (parsed instanceof type105.errors) {
56686
+ if (parsed instanceof type106.errors) {
56448
56687
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56449
56688
  } else {
56450
56689
  const { topic, depth = "full" } = parsed;
@@ -56516,7 +56755,7 @@ function sourceLink2(path, line) {
56516
56755
  }
56517
56756
 
56518
56757
  // packages/dbx-components-mcp/src/tools/auth-role-lookup.tool.ts
56519
- import { type as type106 } from "arktype";
56758
+ import { type as type107 } from "arktype";
56520
56759
  var DBX_AUTH_ROLE_LOOKUP_TOOL = {
56521
56760
  name: "dbx_auth_role_lookup",
56522
56761
  description: [
@@ -56538,7 +56777,7 @@ var DBX_AUTH_ROLE_LOOKUP_TOOL = {
56538
56777
  }
56539
56778
  }
56540
56779
  };
56541
- var RoleArgsType = type106({
56780
+ var RoleArgsType = type107({
56542
56781
  "topic?": "string",
56543
56782
  "tag?": "string",
56544
56783
  "model?": "string",
@@ -56553,7 +56792,7 @@ function createAuthRoleLookupTool(input) {
56553
56792
  run(rawArgs) {
56554
56793
  const parsed = RoleArgsType(rawArgs);
56555
56794
  let result;
56556
- if (parsed instanceof type106.errors) {
56795
+ if (parsed instanceof type107.errors) {
56557
56796
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56558
56797
  } else {
56559
56798
  const text = dispatchRoleLookup(registry, parsed);
@@ -56706,7 +56945,7 @@ function sourceLink3(path, line) {
56706
56945
  }
56707
56946
 
56708
56947
  // packages/dbx-components-mcp/src/tools/auth-token-explain.tool.ts
56709
- import { type as type107 } from "arktype";
56948
+ import { type as type108 } from "arktype";
56710
56949
  var DBX_AUTH_TOKEN_EXPLAIN_TOOL = {
56711
56950
  name: "dbx_auth_token_explain",
56712
56951
  description: [
@@ -56724,7 +56963,7 @@ var DBX_AUTH_TOKEN_EXPLAIN_TOOL = {
56724
56963
  }
56725
56964
  }
56726
56965
  };
56727
- var TokenArgsType = type107({
56966
+ var TokenArgsType = type108({
56728
56967
  "token?": "string",
56729
56968
  "claims?": "object",
56730
56969
  "app?": "string",
@@ -56739,7 +56978,7 @@ function createAuthTokenExplainTool(input) {
56739
56978
  run(rawArgs) {
56740
56979
  const parsed = TokenArgsType(rawArgs);
56741
56980
  let result;
56742
- if (parsed instanceof type107.errors) {
56981
+ if (parsed instanceof type108.errors) {
56743
56982
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56744
56983
  } else {
56745
56984
  const { token, claims: claimsObj, app, expectedIssuer } = parsed;
@@ -56951,7 +57190,7 @@ function describeReserved(key) {
56951
57190
  }
56952
57191
 
56953
57192
  // packages/dbx-components-mcp/src/tools/auth-list-app.tool.ts
56954
- import { type as type108 } from "arktype";
57193
+ import { type as type109 } from "arktype";
56955
57194
  var DBX_AUTH_LIST_APP_TOOL = {
56956
57195
  name: "dbx_auth_list_app",
56957
57196
  description: ["Enumerate the auth surface of one app: every custom claim on its `*ApiAuthClaims` interface, every OIDC scope it accepts, and every server-action gate wired up.", "", 'Pass `app="list"` to enumerate the apps catalogued by the registry.'].join("\n"),
@@ -56963,7 +57202,7 @@ var DBX_AUTH_LIST_APP_TOOL = {
56963
57202
  required: ["app"]
56964
57203
  }
56965
57204
  };
56966
- var ListAppArgsType6 = type108({
57205
+ var ListAppArgsType6 = type109({
56967
57206
  app: "string"
56968
57207
  });
56969
57208
  // @__NO_SIDE_EFFECTS__
@@ -56974,7 +57213,7 @@ function createAuthListAppTool(input) {
56974
57213
  run(rawArgs) {
56975
57214
  const parsed = ListAppArgsType6(rawArgs);
56976
57215
  let result;
56977
- if (parsed instanceof type108.errors) {
57216
+ if (parsed instanceof type109.errors) {
56978
57217
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56979
57218
  } else {
56980
57219
  const { app } = parsed;
@@ -57285,7 +57524,7 @@ async function loadServerContext(options = {}) {
57285
57524
  `);
57286
57525
  }
57287
57526
  const modelValidateRuleOptions = resolveModelValidateRuleOptions(configResult.config);
57288
- const configBaseDir = configResult.configPath !== null && configResult.configPath !== void 0 ? dirname23(configResult.configPath) : cwd;
57527
+ const configBaseDir = configResult.configPath !== null && configResult.configPath !== void 0 ? dirname24(configResult.configPath) : cwd;
57289
57528
  const logSearchConfig = resolveLogSearchConfig(configResult.config, configBaseDir);
57290
57529
  const registry = await resolveOptionalRegistry({
57291
57530
  injected: options.semanticTypeRegistry,