@dereekb/dbx-components-mcp 14.4.0 → 14.5.1

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.4.0",
13
+ version: "14.5.1",
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.4.0",
26
- "@dereekb/util": "14.4.0"
25
+ "@dereekb/dbx-cli": "14.5.1",
26
+ "@dereekb/util": "14.5.1"
27
27
  }
28
28
  };
29
29
 
@@ -4925,10 +4925,10 @@ function extractCandidateParams(candidate, descriptions) {
4925
4925
  for (const param of params) {
4926
4926
  const name = param.getName();
4927
4927
  const typeNode = param.getTypeNode()?.getText();
4928
- const type109 = typeNode ?? param.getType().getText() ?? "unknown";
4928
+ const type110 = typeNode ?? param.getType().getText() ?? "unknown";
4929
4929
  const description = descriptions.get(name) ?? "";
4930
4930
  const optional = param.isOptional() || param.hasInitializer();
4931
- out.push({ name, type: type109, description, optional });
4931
+ out.push({ name, type: type110, description, optional });
4932
4932
  }
4933
4933
  return out;
4934
4934
  }
@@ -6034,6 +6034,23 @@ function serializeManifest(manifest) {
6034
6034
  `;
6035
6035
  }
6036
6036
 
6037
+ // packages/dbx-cli/src/lib/mcp-scan/scan/sanitize-type-text.ts
6038
+ import { isAbsolute, relative as relative3 } from "node:path";
6039
+ var INLINE_TYPE_IMPORT_PATTERN = /import\("([^"]*)"\)/g;
6040
+ function sanitizeTypeText(input) {
6041
+ const { typeText, workspaceRoot } = input;
6042
+ return typeText.replaceAll(INLINE_TYPE_IMPORT_PATTERN, (match, importPath) => {
6043
+ let replacement;
6044
+ if (isAbsolute(importPath)) {
6045
+ const relativePath = relative3(workspaceRoot, importPath).replaceAll("\\", "/");
6046
+ replacement = relativePath.length > 0 && !relativePath.startsWith("..") ? `import("${relativePath}")` : match;
6047
+ } else {
6048
+ replacement = match;
6049
+ }
6050
+ return replacement;
6051
+ });
6052
+ }
6053
+
6037
6054
  // packages/dbx-cli/src/lib/mcp-scan/scan/cli.ts
6038
6055
  import { readFile as nodeReadFile3, writeFile as nodeWriteFile } from "node:fs/promises";
6039
6056
  import { resolve as resolve5 } from "node:path";
@@ -6394,13 +6411,13 @@ function parseDecoratorInput(property) {
6394
6411
  const decoratorArg = decorator.getCallExpression()?.getArguments()[0];
6395
6412
  const { alias, requiredFromDecorator } = readInputDecoratorArg(decoratorArg);
6396
6413
  const required = requiredFromDecorator ?? !property.hasQuestionToken();
6397
- const type109 = property.getTypeNode()?.getText() ?? "unknown";
6414
+ const type110 = property.getTypeNode()?.getText() ?? "unknown";
6398
6415
  const initializer = property.getInitializer();
6399
6416
  const defaultValue = initializer === void 0 ? void 0 : initializer.getText();
6400
6417
  return {
6401
6418
  propertyName,
6402
6419
  alias: alias ?? propertyName,
6403
- type: type109,
6420
+ type: type110,
6404
6421
  required,
6405
6422
  description: readPropertyDescription(property),
6406
6423
  ...defaultValue === void 0 ? {} : { defaultValue }
@@ -6493,22 +6510,22 @@ function parseDecoratorOutput(property) {
6493
6510
  alias = decoratorArg.getLiteralText();
6494
6511
  }
6495
6512
  const initializer = property.getInitializer();
6496
- let type109 = "unknown";
6513
+ let type110 = "unknown";
6497
6514
  if (initializer !== void 0 && Node9.isNewExpression(initializer)) {
6498
6515
  const typeArgs = initializer.getTypeArguments();
6499
6516
  if (typeArgs.length > 0) {
6500
- type109 = typeArgs[0].getText();
6517
+ type110 = typeArgs[0].getText();
6501
6518
  }
6502
6519
  } else {
6503
6520
  const explicit = property.getTypeNode()?.getText();
6504
6521
  if (explicit !== void 0) {
6505
- type109 = explicit;
6522
+ type110 = explicit;
6506
6523
  }
6507
6524
  }
6508
6525
  return {
6509
6526
  propertyName,
6510
6527
  name: alias ?? propertyName,
6511
- type: type109,
6528
+ type: type110,
6512
6529
  description: readPropertyDescription(property)
6513
6530
  };
6514
6531
  }
@@ -6523,7 +6540,7 @@ function parseSignalOutput(property) {
6523
6540
  }
6524
6541
  const propertyName = property.getName();
6525
6542
  const typeArgs = initializer.getTypeArguments();
6526
- const type109 = typeArgs.length > 0 ? typeArgs[0].getText() : "void";
6543
+ const type110 = typeArgs.length > 0 ? typeArgs[0].getText() : "void";
6527
6544
  const args = initializer.getArguments();
6528
6545
  let alias;
6529
6546
  if (args.length > 0 && Node9.isObjectLiteralExpression(args[0])) {
@@ -6532,7 +6549,7 @@ function parseSignalOutput(property) {
6532
6549
  return {
6533
6550
  propertyName,
6534
6551
  name: alias ?? propertyName,
6535
- type: type109,
6552
+ type: type110,
6536
6553
  description: readPropertyDescription(property)
6537
6554
  };
6538
6555
  }
@@ -8772,7 +8789,7 @@ var DbxDocsUiExampleManifest = type16({
8772
8789
  });
8773
8790
 
8774
8791
  // packages/dbx-cli/src/lib/mcp-scan/scan/dbx-docs-ui-examples-extract.ts
8775
- import { dirname, isAbsolute, resolve as resolve10 } from "node:path";
8792
+ import { dirname, isAbsolute as isAbsolute2, resolve as resolve10 } from "node:path";
8776
8793
  import { type as type17 } from "arktype";
8777
8794
  import { Node as Node12 } from "ts-morph";
8778
8795
  var MARKER_TAG = "dbxDocsUiExample";
@@ -9153,7 +9170,7 @@ function collectCandidateModulePaths(sourceFile, fromFile) {
9153
9170
  }
9154
9171
  function resolveRelativeTsPath(fromFile, specifier) {
9155
9172
  const baseDir = dirname(fromFile);
9156
- const joined = isAbsolute(specifier) ? specifier : resolve10(baseDir, specifier);
9173
+ const joined = isAbsolute2(specifier) ? specifier : resolve10(baseDir, specifier);
9157
9174
  if (joined.endsWith(".ts")) {
9158
9175
  return joined;
9159
9176
  }
@@ -10460,7 +10477,7 @@ function formatExtractWarning5(warning) {
10460
10477
  }
10461
10478
 
10462
10479
  // packages/dbx-cli/firestore-indexes/src/model-firebase-index-build-manifest.ts
10463
- import { relative as relative3, resolve as resolve14 } from "node:path";
10480
+ import { relative as relative4, resolve as resolve14 } from "node:path";
10464
10481
  import { type as type26 } from "arktype";
10465
10482
 
10466
10483
  // packages/dbx-cli/firestore-indexes/src/model-firebase-index-schema.ts
@@ -11257,10 +11274,10 @@ function collectParams(decl, descriptions) {
11257
11274
  for (const param of params) {
11258
11275
  const name = param.getName();
11259
11276
  const typeNode = param.getTypeNode()?.getText();
11260
- const type109 = typeNode ?? param.getType().getText() ?? "unknown";
11277
+ const type110 = typeNode ?? param.getType().getText() ?? "unknown";
11261
11278
  const description = descriptions.get(name) ?? "";
11262
11279
  const optional = param.isOptional() || param.hasInitializer();
11263
- out.push({ name, type: type109, description, optional });
11280
+ out.push({ name, type: type110, description, optional });
11264
11281
  }
11265
11282
  return out;
11266
11283
  }
@@ -11913,7 +11930,7 @@ function deriveSubpath(filePath, projectRoot) {
11913
11930
  if (normalised.startsWith(projectNormalised)) {
11914
11931
  relativePath = normalised.slice(projectNormalised.length).replace(/^\/+/, "");
11915
11932
  } else {
11916
- relativePath = relative3(projectRoot, filePath).replaceAll("\\", "/");
11933
+ relativePath = relative4(projectRoot, filePath).replaceAll("\\", "/");
11917
11934
  }
11918
11935
  for (const prefix of SRC_PREFIXES) {
11919
11936
  const stripped = `/${relativePath}`;
@@ -12079,7 +12096,7 @@ function buildDispatcherCreditByName(dispatcherSummaries, references) {
12079
12096
  }
12080
12097
 
12081
12098
  // packages/dbx-cli/src/lib/mcp-scan/scan/model-firebase-index-reference-scan.ts
12082
- import { relative as relative4, resolve as resolvePath2 } from "node:path";
12099
+ import { relative as relative5, resolve as resolvePath2 } from "node:path";
12083
12100
  var DEFAULT_INCLUDE = ["src/**/*.ts"];
12084
12101
  var DEFAULT_EXCLUDE = ["**/*.spec.ts", "**/*.d.ts"];
12085
12102
  var WORKSPACE_FACTORY_SCAN_INCLUDE = ["apps/**/*.ts", "components/**/*.ts", "packages/**/*.ts"];
@@ -12220,13 +12237,13 @@ function toSubpath(absolutePath, projectRoot) {
12220
12237
  if (normalised.startsWith(rootNormalised)) {
12221
12238
  result = normalised.slice(rootNormalised.length).replace(/^\/+/, "");
12222
12239
  } else {
12223
- result = relative4(projectRoot, absolutePath).replaceAll("\\", "/");
12240
+ result = relative5(projectRoot, absolutePath).replaceAll("\\", "/");
12224
12241
  }
12225
12242
  return result;
12226
12243
  }
12227
12244
 
12228
12245
  // packages/dbx-cli/src/lib/mcp-scan/scan/model-snapshot-fields-build-manifest.ts
12229
- import { relative as relative5, resolve as resolve15 } from "node:path";
12246
+ import { relative as relative6, resolve as resolve15 } from "node:path";
12230
12247
  import { type as type29 } from "arktype";
12231
12248
 
12232
12249
  // packages/dbx-cli/src/lib/mcp-scan/manifest/model-snapshot-fields-schema.ts
@@ -12524,7 +12541,7 @@ var MODEL_SNAPSHOT_FIELDS_SCAN_CONFIG_FILENAME = "dbx-mcp.scan.json";
12524
12541
  var DEFAULT_READ_FILE11 = defaultReadFile;
12525
12542
  var DEFAULT_GLOBBER8 = defaultGlobber;
12526
12543
  async function buildModelSnapshotFieldsManifest(input) {
12527
- const { projectRoot, generator, readFile: readFile33 = DEFAULT_READ_FILE11, globber = DEFAULT_GLOBBER8, now = () => /* @__PURE__ */ new Date() } = input;
12544
+ const { projectRoot, generator, workspaceRoot = process.cwd(), readFile: readFile33 = DEFAULT_READ_FILE11, globber = DEFAULT_GLOBBER8, now = () => /* @__PURE__ */ new Date() } = input;
12528
12545
  const configPath = resolve15(projectRoot, MODEL_SNAPSHOT_FIELDS_SCAN_CONFIG_FILENAME);
12529
12546
  const packagePath = resolve15(projectRoot, "package.json");
12530
12547
  const configOutcome = await loadScanSection({
@@ -12556,7 +12573,7 @@ async function buildModelSnapshotFieldsManifest(input) {
12556
12573
  const extractResult = extractModelSnapshotFieldEntries({ project, projectRoot });
12557
12574
  const moduleName = scanSection.module ?? packageName;
12558
12575
  const sourceLabel = scanSection.source ?? packageName;
12559
- const entries = extractResult.entries.map((entry) => assembleEntry9({ entry, moduleName, projectRoot }));
12576
+ const entries = extractResult.entries.map((entry) => assembleEntry9({ entry, moduleName, projectRoot, workspaceRoot }));
12560
12577
  const manifest = {
12561
12578
  version: 1,
12562
12579
  source: sourceLabel,
@@ -12589,7 +12606,7 @@ function deriveSubpath2(filePath, projectRoot) {
12589
12606
  if (normalised.startsWith(projectNormalised)) {
12590
12607
  relativePath = normalised.slice(projectNormalised.length).replace(/^\/+/, "");
12591
12608
  } else {
12592
- relativePath = relative5(projectRoot, filePath).replaceAll("\\", "/");
12609
+ relativePath = relative6(projectRoot, filePath).replaceAll("\\", "/");
12593
12610
  }
12594
12611
  for (const prefix of SRC_PREFIXES2) {
12595
12612
  const stripped = `/${relativePath}`;
@@ -12602,7 +12619,7 @@ function deriveSubpath2(filePath, projectRoot) {
12602
12619
  return relativePath.replace(/\.ts$/, "");
12603
12620
  }
12604
12621
  function assembleEntry9(input) {
12605
- const { entry, moduleName, projectRoot } = input;
12622
+ const { entry, moduleName, projectRoot, workspaceRoot } = input;
12606
12623
  const subpath = deriveSubpath2(entry.filePath, projectRoot);
12607
12624
  const out = {
12608
12625
  slug: entry.slug,
@@ -12611,11 +12628,11 @@ function assembleEntry9(input) {
12611
12628
  category: entry.category,
12612
12629
  module: moduleName,
12613
12630
  subpath,
12614
- signature: entry.signature,
12631
+ signature: sanitizeTypeText({ typeText: entry.signature, workspaceRoot }),
12615
12632
  description: entry.description,
12616
12633
  optional: entry.optional,
12617
- params: entry.params.map((p) => ({ ...p })),
12618
- returns: entry.returns,
12634
+ params: entry.params.map((p) => ({ ...p, type: sanitizeTypeText({ typeText: p.type, workspaceRoot }) })),
12635
+ returns: sanitizeTypeText({ typeText: entry.returns, workspaceRoot }),
12619
12636
  tags: [...entry.tags],
12620
12637
  ...entry.example.length > 0 ? { example: entry.example } : {},
12621
12638
  ...entry.relatedSlugs && entry.relatedSlugs.length > 0 ? { relatedSlugs: [...entry.relatedSlugs] } : {},
@@ -12940,10 +12957,10 @@ function readTransformSignature(method, fallbackParamDescriptions) {
12940
12957
  for (let i = 1; i < params.length; i += 1) {
12941
12958
  const param = params[i];
12942
12959
  const name = param.getName();
12943
- const type109 = readParamType(param);
12960
+ const type110 = readParamType(param);
12944
12961
  const description = methodParamDescriptions.get(name) ?? fallbackParamDescriptions.get(name) ?? "";
12945
12962
  const required = !param.isOptional() && !param.hasInitializer();
12946
- args.push({ name, type: type109, description, required });
12963
+ args.push({ name, type: type110, description, required });
12947
12964
  }
12948
12965
  return { inputType, outputType, args };
12949
12966
  }
@@ -13677,7 +13694,7 @@ function formatExtractWarning8(warning) {
13677
13694
  }
13678
13695
 
13679
13696
  // packages/dbx-cli/src/lib/mcp-scan/scan/utils-build-manifest.ts
13680
- import { relative as relative6, resolve as resolve18 } from "node:path";
13697
+ import { relative as relative7, resolve as resolve18 } from "node:path";
13681
13698
  import { type as type39 } from "arktype";
13682
13699
 
13683
13700
  // packages/dbx-cli/src/lib/mcp-scan/manifest/utils-schema.ts
@@ -13965,7 +13982,7 @@ var UTILS_SCAN_CONFIG_FILENAME = "dbx-mcp.scan.json";
13965
13982
  var DEFAULT_READ_FILE14 = defaultReadFile;
13966
13983
  var DEFAULT_GLOBBER11 = defaultGlobber;
13967
13984
  async function buildUtilsManifest(input) {
13968
- const { projectRoot, generator, readFile: readFile33 = DEFAULT_READ_FILE14, globber = DEFAULT_GLOBBER11, now = () => /* @__PURE__ */ new Date() } = input;
13985
+ const { projectRoot, generator, workspaceRoot = process.cwd(), readFile: readFile33 = DEFAULT_READ_FILE14, globber = DEFAULT_GLOBBER11, now = () => /* @__PURE__ */ new Date() } = input;
13969
13986
  const configPath = resolve18(projectRoot, UTILS_SCAN_CONFIG_FILENAME);
13970
13987
  const packagePath = resolve18(projectRoot, "package.json");
13971
13988
  const configOutcome = await loadScanSection({
@@ -13997,7 +14014,7 @@ async function buildUtilsManifest(input) {
13997
14014
  const extractResult = extractUtilEntries({ project, projectRoot });
13998
14015
  const moduleName = scanSection.module ?? packageName;
13999
14016
  const sourceLabel = scanSection.source ?? packageName;
14000
- const entries = extractResult.entries.map((entry) => assembleEntry12({ entry, moduleName, projectRoot }));
14017
+ const entries = extractResult.entries.map((entry) => assembleEntry12({ entry, moduleName, projectRoot, workspaceRoot }));
14001
14018
  const manifest = {
14002
14019
  version: 1,
14003
14020
  source: sourceLabel,
@@ -14030,7 +14047,7 @@ function deriveSubpath3(filePath, projectRoot) {
14030
14047
  if (normalised.startsWith(projectNormalised)) {
14031
14048
  relativePath = normalised.slice(projectNormalised.length).replace(/^\/+/, "");
14032
14049
  } else {
14033
- relativePath = relative6(projectRoot, filePath).replaceAll("\\", "/");
14050
+ relativePath = relative7(projectRoot, filePath).replaceAll("\\", "/");
14034
14051
  }
14035
14052
  for (const prefix of SRC_PREFIXES3) {
14036
14053
  const stripped = `/${relativePath}`;
@@ -14043,7 +14060,7 @@ function deriveSubpath3(filePath, projectRoot) {
14043
14060
  return relativePath.replace(/\.ts$/, "");
14044
14061
  }
14045
14062
  function assembleEntry12(input) {
14046
- const { entry, moduleName, projectRoot } = input;
14063
+ const { entry, moduleName, projectRoot, workspaceRoot } = input;
14047
14064
  const subpath = deriveSubpath3(entry.filePath, projectRoot);
14048
14065
  const out = {
14049
14066
  slug: entry.slug,
@@ -14052,10 +14069,10 @@ function assembleEntry12(input) {
14052
14069
  category: entry.category,
14053
14070
  module: moduleName,
14054
14071
  subpath,
14055
- signature: entry.signature,
14072
+ signature: sanitizeTypeText({ typeText: entry.signature, workspaceRoot }),
14056
14073
  description: entry.description,
14057
- params: entry.params.map((p) => ({ ...p })),
14058
- returns: entry.returns,
14074
+ params: entry.params.map((p) => ({ ...p, type: sanitizeTypeText({ typeText: p.type, workspaceRoot }) })),
14075
+ returns: sanitizeTypeText({ typeText: entry.returns, workspaceRoot }),
14059
14076
  tags: [...entry.tags],
14060
14077
  ...entry.example.length > 0 ? { example: entry.example } : {},
14061
14078
  ...entry.relatedSlugs && entry.relatedSlugs.length > 0 ? { relatedSlugs: [...entry.relatedSlugs] } : {},
@@ -14300,7 +14317,7 @@ async function loadSemanticTypeManifests(input) {
14300
14317
  }
14301
14318
 
14302
14319
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-registry.ts
14303
- import { dirname as dirname3, isAbsolute as isAbsolute2, resolve as resolve20 } from "node:path";
14320
+ import { dirname as dirname3, isAbsolute as isAbsolute3, resolve as resolve20 } from "node:path";
14304
14321
 
14305
14322
  // packages/dbx-cli/src/lib/mcp-scan/manifest/package-root.ts
14306
14323
  import { existsSync } from "node:fs";
@@ -14339,7 +14356,7 @@ async function loadSemanticTypeRegistry(input) {
14339
14356
  const baseDir = dirname3(configResult.configPath);
14340
14357
  const declared = configResult.config.semanticTypes?.sources ?? [];
14341
14358
  for (const source of declared) {
14342
- const absolute = isAbsolute2(source) ? source : resolve20(baseDir, source);
14359
+ const absolute = isAbsolute3(source) ? source : resolve20(baseDir, source);
14343
14360
  externalSources.push({ origin: "external", path: absolute });
14344
14361
  }
14345
14362
  }
@@ -14362,7 +14379,7 @@ async function loadSemanticTypeRegistry(input) {
14362
14379
  }
14363
14380
 
14364
14381
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-actions-registry.ts
14365
- import { dirname as dirname4, isAbsolute as isAbsolute3, resolve as resolve21 } from "node:path";
14382
+ import { dirname as dirname4, isAbsolute as isAbsolute4, resolve as resolve21 } from "node:path";
14366
14383
 
14367
14384
  // packages/dbx-cli/src/lib/mcp-scan/manifest/manifest-loader-base.ts
14368
14385
  import { readFile as nodeReadFile6 } from "node:fs/promises";
@@ -14537,7 +14554,7 @@ async function loadActionRegistry(input) {
14537
14554
  const baseDir = dirname4(configResult.configPath);
14538
14555
  const declared = configResult.config.actions?.sources ?? [];
14539
14556
  for (const source of declared) {
14540
- const absolute = isAbsolute3(source) ? source : resolve21(baseDir, source);
14557
+ const absolute = isAbsolute4(source) ? source : resolve21(baseDir, source);
14541
14558
  externalSources.push({ origin: "external", path: absolute });
14542
14559
  }
14543
14560
  }
@@ -14561,7 +14578,7 @@ async function loadActionRegistry(input) {
14561
14578
 
14562
14579
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-auth-registry.ts
14563
14580
  import { glob as fsGlob4 } from "node:fs/promises";
14564
- import { join as join4, relative as relative7, resolve as resolvePath3, sep as sep4 } from "node:path";
14581
+ import { join as join4, relative as relative8, resolve as resolvePath3, sep as sep4 } from "node:path";
14565
14582
  import { Project as Project3 } from "ts-morph";
14566
14583
  var DEFAULT_GLOB_PATTERNS = ["components/*-firebase/src/**/auth/**/*claims*.ts", "components/*-shared/src/**/auth/**/*claims*.ts", "components/*-web/src/**/auth/**/*claims*.ts", "components/*-core/src/**/auth/**/*claims*.ts", "apps/*/src/**/auth/**/*claims*.ts"];
14567
14584
  var APP_TAG_MARKER = "@dbxAuthClaimsApp";
@@ -14713,14 +14730,14 @@ function toAuthAppInfo(input) {
14713
14730
  };
14714
14731
  }
14715
14732
  function toRelative(absolutePath, cwd) {
14716
- const isAbsolute20 = absolutePath.startsWith("/") || /^[A-Za-z]:[\\/]/.test(absolutePath);
14717
- const target = isAbsolute20 ? absolutePath : resolvePath3(cwd, absolutePath);
14718
- const rel = relative7(cwd, target);
14733
+ const isAbsolute21 = absolutePath.startsWith("/") || /^[A-Za-z]:[\\/]/.test(absolutePath);
14734
+ const target = isAbsolute21 ? absolutePath : resolvePath3(cwd, absolutePath);
14735
+ const rel = relative8(cwd, target);
14719
14736
  return toPosix(rel.length > 0 ? rel : absolutePath);
14720
14737
  }
14721
14738
 
14722
14739
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-css-utilities-registry.ts
14723
- import { dirname as dirname5, isAbsolute as isAbsolute4, resolve as resolve22 } from "node:path";
14740
+ import { dirname as dirname5, isAbsolute as isAbsolute5, resolve as resolve22 } from "node:path";
14724
14741
 
14725
14742
  // packages/dbx-cli/src/lib/mcp-scan/manifest/css-utilities-loader.ts
14726
14743
  async function loadCssUtilityManifests(input) {
@@ -14779,11 +14796,11 @@ function collectExternalCssUtilitySources(configResult) {
14779
14796
  return externalSources;
14780
14797
  }
14781
14798
  function toAbsolutePath(baseDir, value) {
14782
- return isAbsolute4(value) ? value : resolve22(baseDir, value);
14799
+ return isAbsolute5(value) ? value : resolve22(baseDir, value);
14783
14800
  }
14784
14801
 
14785
14802
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-dbx-docs-ui-examples-registry.ts
14786
- import { dirname as dirname6, isAbsolute as isAbsolute5, resolve as resolve23 } from "node:path";
14803
+ import { dirname as dirname6, isAbsolute as isAbsolute6, resolve as resolve23 } from "node:path";
14787
14804
 
14788
14805
  // packages/dbx-cli/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-loader.ts
14789
14806
  async function loadDbxDocsUiExamplesManifests(input) {
@@ -14811,7 +14828,7 @@ async function loadDbxDocsUiExamplesRegistry(input) {
14811
14828
  const baseDir = dirname6(configResult.configPath);
14812
14829
  const declared = configResult.config.dbxDocsUiExamples?.sources ?? [];
14813
14830
  for (const source of declared) {
14814
- const absolute = isAbsolute5(source) ? source : resolve23(baseDir, source);
14831
+ const absolute = isAbsolute6(source) ? source : resolve23(baseDir, source);
14815
14832
  externalSources.push({ origin: "external", path: absolute });
14816
14833
  }
14817
14834
  }
@@ -14837,7 +14854,7 @@ async function loadDbxDocsUiExamplesRegistry(input) {
14837
14854
  }
14838
14855
 
14839
14856
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-filters-registry.ts
14840
- import { dirname as dirname7, isAbsolute as isAbsolute6, resolve as resolve24 } from "node:path";
14857
+ import { dirname as dirname7, isAbsolute as isAbsolute7, resolve as resolve24 } from "node:path";
14841
14858
 
14842
14859
  // packages/dbx-cli/src/lib/mcp-scan/manifest/filters-loader.ts
14843
14860
  async function loadFilterManifests(input) {
@@ -14865,7 +14882,7 @@ async function loadFilterRegistry(input) {
14865
14882
  const baseDir = dirname7(configResult.configPath);
14866
14883
  const declared = configResult.config.filters?.sources ?? [];
14867
14884
  for (const source of declared) {
14868
- const absolute = isAbsolute6(source) ? source : resolve24(baseDir, source);
14885
+ const absolute = isAbsolute7(source) ? source : resolve24(baseDir, source);
14869
14886
  externalSources.push({ origin: "external", path: absolute });
14870
14887
  }
14871
14888
  }
@@ -14888,7 +14905,7 @@ async function loadFilterRegistry(input) {
14888
14905
  }
14889
14906
 
14890
14907
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-forge-fields-registry.ts
14891
- import { dirname as dirname8, isAbsolute as isAbsolute7, resolve as resolve25 } from "node:path";
14908
+ import { dirname as dirname8, isAbsolute as isAbsolute8, resolve as resolve25 } from "node:path";
14892
14909
 
14893
14910
  // packages/dbx-cli/src/lib/mcp-scan/manifest/forge-fields-loader.ts
14894
14911
  async function loadForgeFieldManifests(input) {
@@ -14916,7 +14933,7 @@ async function loadForgeFieldRegistry(input) {
14916
14933
  const baseDir = dirname8(configResult.configPath);
14917
14934
  const declared = configResult.config.forgeFields?.sources ?? [];
14918
14935
  for (const source of declared) {
14919
- const absolute = isAbsolute7(source) ? source : resolve25(baseDir, source);
14936
+ const absolute = isAbsolute8(source) ? source : resolve25(baseDir, source);
14920
14937
  externalSources.push({ origin: "external", path: absolute });
14921
14938
  }
14922
14939
  }
@@ -14939,7 +14956,7 @@ async function loadForgeFieldRegistry(input) {
14939
14956
  }
14940
14957
 
14941
14958
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-model-firebase-index-registry.ts
14942
- import { dirname as dirname9, isAbsolute as isAbsolute8, resolve as resolve27 } from "node:path";
14959
+ import { dirname as dirname10, isAbsolute as isAbsolute9, resolve as resolve28 } from "node:path";
14943
14960
 
14944
14961
  // packages/dbx-cli/firestore-indexes/src/firestore-indexes-generate.ts
14945
14962
  function generateFirestoreIndexesJson(input) {
@@ -15169,7 +15186,7 @@ function computeDiff(input) {
15169
15186
 
15170
15187
  // packages/dbx-cli/firestore-indexes/src/generate-firestore-indexes-cli.ts
15171
15188
  import { readFile as nodeReadFile7, writeFile as nodeWriteFile3 } from "node:fs/promises";
15172
- import { resolve as resolve26 } from "node:path";
15189
+ import { resolve as resolve27 } from "node:path";
15173
15190
 
15174
15191
  // packages/dbx-cli/firestore-indexes/src/model-firebase-index-runtime.ts
15175
15192
  // @__NO_SIDE_EFFECTS__
@@ -15271,17 +15288,128 @@ function pushInto13(map, key, entry) {
15271
15288
  }
15272
15289
  }
15273
15290
 
15291
+ // packages/dbx-cli/firestore-indexes/src/model-firebase-index-package-manifests.ts
15292
+ import { type as type42 } from "arktype";
15293
+ import { readdir as nodeReadDir } from "node:fs/promises";
15294
+ import { createRequire } from "node:module";
15295
+ import { dirname as dirname9, resolve as resolve26 } from "node:path";
15296
+ var MODEL_FIREBASE_INDEX_MANIFEST_FILENAME_SUFFIX = ".model-firebase-index.mcp.generated.json";
15297
+ var BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE = "@dereekb/dbx-components-mcp";
15298
+ var BUNDLED_MANIFEST_DIRECTORY_NAME = "generated";
15299
+ var defaultBundledManifestDirectoryResolver = (cwd) => {
15300
+ let result;
15301
+ try {
15302
+ const requireFromCwd = createRequire(resolve26(cwd, "noop.js"));
15303
+ const packageJsonPath = requireFromCwd.resolve(`${BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE}/package.json`);
15304
+ result = resolve26(dirname9(packageJsonPath), BUNDLED_MANIFEST_DIRECTORY_NAME);
15305
+ } catch {
15306
+ result = null;
15307
+ }
15308
+ return result;
15309
+ };
15310
+ var defaultReadDir = (path) => nodeReadDir(path);
15311
+ async function loadModelFirebaseIndexPackageManifests(input) {
15312
+ const { cwd, manifestPaths = [], discoverBundled = false, readFile: readFile33 = defaultReadFile, readDir = defaultReadDir, resolveBundledDirectory = defaultBundledManifestDirectoryResolver } = input;
15313
+ const paths = manifestPaths.map((path) => resolve26(cwd, path));
15314
+ let failure = null;
15315
+ if (discoverBundled) {
15316
+ const bundledDirectory = resolveBundledDirectory(cwd);
15317
+ if (bundledDirectory == null) {
15318
+ failure = { kind: "no-bundled-package", packageName: BUNDLED_MODEL_FIREBASE_INDEX_MANIFEST_PACKAGE };
15319
+ } else {
15320
+ paths.push(...await readBundledManifestPaths(bundledDirectory, readDir));
15321
+ }
15322
+ }
15323
+ const loaded = [];
15324
+ for (const path of paths) {
15325
+ if (failure != null) {
15326
+ break;
15327
+ }
15328
+ const readResult = await readManifestFile(path, readFile33);
15329
+ if (readResult.kind === "ok") {
15330
+ loaded.push({ path, manifest: readResult.manifest });
15331
+ } else {
15332
+ failure = readResult.outcome;
15333
+ }
15334
+ }
15335
+ return failure ?? { kind: "success", loaded };
15336
+ }
15337
+ function formatModelFirebaseIndexPackageManifestFailure(outcome) {
15338
+ let result;
15339
+ switch (outcome.kind) {
15340
+ case "unreadable-manifest":
15341
+ result = `could not read manifest at ${outcome.path} \u2014 ${outcome.error}`;
15342
+ break;
15343
+ case "invalid-manifest":
15344
+ result = `manifest at ${outcome.path} failed validation \u2014 ${outcome.error}`;
15345
+ break;
15346
+ default:
15347
+ result = `${outcome.packageName} is not installed, so no bundled index manifests could be discovered. Install it, or pass --manifest <path> explicitly.`;
15348
+ break;
15349
+ }
15350
+ return result;
15351
+ }
15352
+ async function readBundledManifestPaths(directory, readDir) {
15353
+ let result;
15354
+ try {
15355
+ const names = await readDir(directory);
15356
+ result = names.filter((name) => name.endsWith(MODEL_FIREBASE_INDEX_MANIFEST_FILENAME_SUFFIX)).toSorted().map((name) => resolve26(directory, name));
15357
+ } catch {
15358
+ result = [];
15359
+ }
15360
+ return result;
15361
+ }
15362
+ async function readManifestFile(path, readFile33) {
15363
+ let raw = null;
15364
+ let readError = null;
15365
+ try {
15366
+ raw = await readFile33(path);
15367
+ } catch (err) {
15368
+ readError = err instanceof Error ? err.message : String(err);
15369
+ }
15370
+ let result;
15371
+ if (raw == null) {
15372
+ result = { kind: "fail", outcome: { kind: "unreadable-manifest", path, error: readError ?? "unknown error" } };
15373
+ } else {
15374
+ let parsed;
15375
+ let parseError = null;
15376
+ try {
15377
+ parsed = JSON.parse(raw);
15378
+ } catch (err) {
15379
+ parseError = err instanceof Error ? err.message : String(err);
15380
+ }
15381
+ if (parseError == null) {
15382
+ const validated = ModelFirebaseIndexManifest(parsed);
15383
+ if (validated instanceof type42.errors) {
15384
+ result = { kind: "fail", outcome: { kind: "invalid-manifest", path, error: validated.summary } };
15385
+ } else {
15386
+ result = { kind: "ok", manifest: validated };
15387
+ }
15388
+ } else {
15389
+ result = { kind: "fail", outcome: { kind: "invalid-manifest", path, error: parseError } };
15390
+ }
15391
+ }
15392
+ return result;
15393
+ }
15394
+
15274
15395
  // packages/dbx-cli/firestore-indexes/src/generate-firestore-indexes-cli.ts
15275
15396
  var DEFAULT_BIN_NAME = "dbx-cli-generate-firestore-indexes";
15276
15397
  function buildUsage(binName) {
15277
15398
  return [
15278
- `Usage: ${binName} --component <dir> [--component <dir> ...] [--output <path>] [--check] [--json] [--help]`,
15399
+ `Usage: ${binName} [--component <dir> ...] [--packages] [--manifest <path> ...] [--output <path>] [--check] [--json] [--help]`,
15279
15400
  "",
15280
15401
  "Generates `firestore.indexes.json` from `@dbxModelFirebaseIndex`-tagged factories.",
15281
15402
  "",
15282
15403
  "Options:",
15283
- " --component <dir> Required, repeatable. Relative path to a `-firebase` component or package.",
15284
- " Repeat to derive one indexes file from several packages at once.",
15404
+ " --component <dir> Repeatable. Relative path to a `-firebase` component or package whose",
15405
+ " source is scanned for tagged factories. Repeat to derive one indexes",
15406
+ " file from several packages at once.",
15407
+ " --packages Also merge the pre-built index manifests bundled in the installed",
15408
+ " @dereekb/dbx-components-mcp. Lets an app derive the framework models\u2019",
15409
+ " indexes without a scannable copy of their source.",
15410
+ " --manifest <path> Repeatable. Merge a specific pre-built manifest JSON file.",
15411
+ "",
15412
+ " At least one of --component / --packages / --manifest is required.",
15285
15413
  " --output <path> Output path. Defaults to `firestore.indexes.json` at the cwd.",
15286
15414
  " --check Compare against the on-disk file; exit 1 on drift, do not write.",
15287
15415
  " --json Print the diff summary as JSON instead of human-readable text.",
@@ -15301,18 +15429,18 @@ async function runGenerateFirestoreIndexesCli(input) {
15301
15429
  stderr(usage);
15302
15430
  return { exitCode: 2 };
15303
15431
  }
15304
- if (parsed.components.length === 0) {
15305
- stderr("generate-firestore-indexes: --component is required");
15432
+ if (parsed.components.length === 0 && parsed.manifests.length === 0 && !parsed.packages) {
15433
+ stderr("generate-firestore-indexes: at least one of --component / --packages / --manifest is required");
15306
15434
  stderr(usage);
15307
15435
  return { exitCode: 2 };
15308
15436
  }
15309
- const outputAbs = resolve26(cwd, parsed.output);
15437
+ const outputAbs = resolve27(cwd, parsed.output);
15310
15438
  const entries = [];
15311
15439
  const loadedSources = [];
15312
15440
  let sawUnresolvedModel = false;
15313
15441
  for (const component of parsed.components) {
15314
15442
  const buildOutcome = await buildModelFirebaseIndexManifest({
15315
- projectRoot: resolve26(cwd, component),
15443
+ projectRoot: resolve27(cwd, component),
15316
15444
  generator
15317
15445
  });
15318
15446
  if (buildOutcome.kind !== "success") {
@@ -15330,6 +15458,15 @@ async function runGenerateFirestoreIndexesCli(input) {
15330
15458
  }
15331
15459
  loadedSources.push(buildOutcome.manifest.source);
15332
15460
  }
15461
+ if (parsed.packages || parsed.manifests.length > 0) {
15462
+ const merged = await collectPackageManifestEntries({ cwd, manifestPaths: parsed.manifests, discoverBundled: parsed.packages, readFile: readFile33 });
15463
+ if (merged.kind === "fail") {
15464
+ stderr(merged.message);
15465
+ return { exitCode: 1 };
15466
+ }
15467
+ entries.push(...merged.entries);
15468
+ loadedSources.push(...merged.sources);
15469
+ }
15333
15470
  if (sawUnresolvedModel) {
15334
15471
  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.");
15335
15472
  return { exitCode: 1 };
@@ -15356,8 +15493,29 @@ async function runGenerateFirestoreIndexesCli(input) {
15356
15493
  }
15357
15494
  return { exitCode: 0 };
15358
15495
  }
15496
+ async function collectPackageManifestEntries(input) {
15497
+ const { cwd, manifestPaths, discoverBundled, readFile: readFile33 } = input;
15498
+ const outcome = await loadModelFirebaseIndexPackageManifests({ cwd, manifestPaths, discoverBundled, readFile: readFile33 });
15499
+ let result;
15500
+ if (outcome.kind === "success") {
15501
+ const entries = [];
15502
+ const sources = [];
15503
+ for (const { manifest } of outcome.loaded) {
15504
+ for (const entry of manifest.entries) {
15505
+ entries.push(toModelFirebaseIndexEntryInfo(entry));
15506
+ }
15507
+ sources.push(manifest.source);
15508
+ }
15509
+ result = { kind: "ok", entries, sources };
15510
+ } else {
15511
+ result = { kind: "fail", message: `generate-firestore-indexes: ${formatModelFirebaseIndexPackageManifestFailure(outcome)}` };
15512
+ }
15513
+ return result;
15514
+ }
15359
15515
  function parseArgv(argv) {
15360
15516
  const components = [];
15517
+ const manifests = [];
15518
+ let packages = false;
15361
15519
  let output = "firestore.indexes.json";
15362
15520
  let check = false;
15363
15521
  let json = false;
@@ -15375,6 +15533,17 @@ function parseArgv(argv) {
15375
15533
  components.push(argv[i]);
15376
15534
  }
15377
15535
  break;
15536
+ case "--manifest":
15537
+ i += 1;
15538
+ if (i >= argv.length) {
15539
+ error = "generate-firestore-indexes: --manifest requires a value";
15540
+ } else {
15541
+ manifests.push(argv[i]);
15542
+ }
15543
+ break;
15544
+ case "--packages":
15545
+ packages = true;
15546
+ break;
15378
15547
  case "--output":
15379
15548
  i += 1;
15380
15549
  if (i >= argv.length) {
@@ -15399,7 +15568,7 @@ function parseArgv(argv) {
15399
15568
  }
15400
15569
  i += 1;
15401
15570
  }
15402
- return { components, output, check, json, help, error };
15571
+ return { components, manifests, packages, output, check, json, help, error };
15403
15572
  }
15404
15573
  async function readExistingIndexes(input) {
15405
15574
  const text = await readExistingIndexesText(input);
@@ -15525,7 +15694,7 @@ async function loadModelFirebaseIndexManifests(input) {
15525
15694
  var DEFAULT_BUNDLED_FILENAMES7 = ["dereekb-firebase.model-firebase-index.mcp.generated.json"];
15526
15695
  var DEFAULT_BUNDLED_PATHS7 = () => {
15527
15696
  const packageRoot = findPackageRoot(import.meta.url);
15528
- return DEFAULT_BUNDLED_FILENAMES7.map((name) => resolve27(packageRoot, "generated", name));
15697
+ return DEFAULT_BUNDLED_FILENAMES7.map((name) => resolve28(packageRoot, "generated", name));
15529
15698
  };
15530
15699
  async function loadModelFirebaseIndexRegistry(input) {
15531
15700
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS7, readFile: readFile33 } = input;
@@ -15533,10 +15702,10 @@ async function loadModelFirebaseIndexRegistry(input) {
15533
15702
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15534
15703
  const externalSources = [];
15535
15704
  if (configResult.config != null && configResult.configPath != null) {
15536
- const baseDir = dirname9(configResult.configPath);
15705
+ const baseDir = dirname10(configResult.configPath);
15537
15706
  const declared = configResult.config.modelFirebaseIndex?.sources ?? [];
15538
15707
  for (const source of declared) {
15539
- const absolute = isAbsolute8(source) ? source : resolve27(baseDir, source);
15708
+ const absolute = isAbsolute9(source) ? source : resolve28(baseDir, source);
15540
15709
  externalSources.push({ origin: "external", path: absolute });
15541
15710
  }
15542
15711
  }
@@ -15562,7 +15731,7 @@ async function loadModelFirebaseIndexRegistry(input) {
15562
15731
  }
15563
15732
 
15564
15733
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.ts
15565
- import { dirname as dirname10, isAbsolute as isAbsolute9, resolve as resolve28 } from "node:path";
15734
+ import { dirname as dirname11, isAbsolute as isAbsolute10, resolve as resolve29 } from "node:path";
15566
15735
 
15567
15736
  // packages/dbx-cli/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.ts
15568
15737
  async function loadModelSnapshotFieldManifests(input) {
@@ -15579,7 +15748,7 @@ async function loadModelSnapshotFieldManifests(input) {
15579
15748
  var DEFAULT_BUNDLED_FILENAMES8 = ["dereekb-firebase.model-snapshot-fields.mcp.generated.json"];
15580
15749
  var DEFAULT_BUNDLED_PATHS8 = () => {
15581
15750
  const packageRoot = findPackageRoot(import.meta.url);
15582
- return DEFAULT_BUNDLED_FILENAMES8.map((name) => resolve28(packageRoot, "generated", name));
15751
+ return DEFAULT_BUNDLED_FILENAMES8.map((name) => resolve29(packageRoot, "generated", name));
15583
15752
  };
15584
15753
  async function loadModelSnapshotFieldRegistry(input) {
15585
15754
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS8, readFile: readFile33 } = input;
@@ -15587,10 +15756,10 @@ async function loadModelSnapshotFieldRegistry(input) {
15587
15756
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15588
15757
  const externalSources = [];
15589
15758
  if (configResult.config != null && configResult.configPath != null) {
15590
- const baseDir = dirname10(configResult.configPath);
15759
+ const baseDir = dirname11(configResult.configPath);
15591
15760
  const declared = configResult.config.modelSnapshotFields?.sources ?? [];
15592
15761
  for (const source of declared) {
15593
- const absolute = isAbsolute9(source) ? source : resolve28(baseDir, source);
15762
+ const absolute = isAbsolute10(source) ? source : resolve29(baseDir, source);
15594
15763
  externalSources.push({ origin: "external", path: absolute });
15595
15764
  }
15596
15765
  }
@@ -15617,7 +15786,7 @@ async function loadModelSnapshotFieldRegistry(input) {
15617
15786
  }
15618
15787
 
15619
15788
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-pipes-registry.ts
15620
- import { dirname as dirname11, isAbsolute as isAbsolute10, resolve as resolve29 } from "node:path";
15789
+ import { dirname as dirname12, isAbsolute as isAbsolute11, resolve as resolve30 } from "node:path";
15621
15790
 
15622
15791
  // packages/dbx-cli/src/lib/mcp-scan/manifest/pipes-loader.ts
15623
15792
  async function loadPipeManifests(input) {
@@ -15634,7 +15803,7 @@ async function loadPipeManifests(input) {
15634
15803
  var DEFAULT_BUNDLED_FILENAMES9 = ["dereekb-dbx-core.pipes.mcp.generated.json"];
15635
15804
  var DEFAULT_BUNDLED_PATHS9 = () => {
15636
15805
  const packageRoot = findPackageRoot(import.meta.url);
15637
- return DEFAULT_BUNDLED_FILENAMES9.map((name) => resolve29(packageRoot, "generated", name));
15806
+ return DEFAULT_BUNDLED_FILENAMES9.map((name) => resolve30(packageRoot, "generated", name));
15638
15807
  };
15639
15808
  async function loadPipeRegistry(input) {
15640
15809
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS9, readFile: readFile33 } = input;
@@ -15642,10 +15811,10 @@ async function loadPipeRegistry(input) {
15642
15811
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15643
15812
  const externalSources = [];
15644
15813
  if (configResult.config != null && configResult.configPath != null) {
15645
- const baseDir = dirname11(configResult.configPath);
15814
+ const baseDir = dirname12(configResult.configPath);
15646
15815
  const declared = configResult.config.pipes?.sources ?? [];
15647
15816
  for (const source of declared) {
15648
- const absolute = isAbsolute10(source) ? source : resolve29(baseDir, source);
15817
+ const absolute = isAbsolute11(source) ? source : resolve30(baseDir, source);
15649
15818
  externalSources.push({ origin: "external", path: absolute });
15650
15819
  }
15651
15820
  }
@@ -15668,17 +15837,17 @@ async function loadPipeRegistry(input) {
15668
15837
  }
15669
15838
 
15670
15839
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-tokens-registry.ts
15671
- import { dirname as dirname12, isAbsolute as isAbsolute11, resolve as resolve30 } from "node:path";
15840
+ import { dirname as dirname13, isAbsolute as isAbsolute12, resolve as resolve31 } from "node:path";
15672
15841
 
15673
15842
  // packages/dbx-cli/src/lib/mcp-scan/manifest/tokens-schema.ts
15674
- import { type as type42 } from "arktype";
15843
+ import { type as type43 } from "arktype";
15675
15844
  var TOKEN_ROLES = ["color", "text-color", "surface", "spacing", "radius", "elevation", "shadow", "typography", "motion", "state-layer", "size", "breakpoint", "misc"];
15676
15845
  var TOKEN_SOURCES = ["dbx-web", "dbx-form", "mat-sys", "mdc", "app"];
15677
- var TokenDefaults = type42({
15846
+ var TokenDefaults = type43({
15678
15847
  "light?": "string",
15679
15848
  "dark?": "string"
15680
15849
  });
15681
- var TokenEntry = type42({
15850
+ var TokenEntry = type43({
15682
15851
  cssVariable: "string",
15683
15852
  "scssVariable?": "string",
15684
15853
  source: '"dbx-web" | "dbx-form" | "mat-sys" | "mdc" | "app"',
@@ -15692,7 +15861,7 @@ var TokenEntry = type42({
15692
15861
  "recommendedPrimitive?": "string",
15693
15862
  "seeAlso?": "string[]"
15694
15863
  });
15695
- var TokenManifest = type42({
15864
+ var TokenManifest = type43({
15696
15865
  version: "1",
15697
15866
  source: "string",
15698
15867
  module: "string",
@@ -15716,7 +15885,7 @@ async function loadTokenManifests(input) {
15716
15885
  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"];
15717
15886
  var DEFAULT_BUNDLED_PATHS10 = () => {
15718
15887
  const packageRoot = findPackageRoot(import.meta.url);
15719
- return DEFAULT_BUNDLED_FILENAMES10.map((name) => resolve30(packageRoot, "generated", name));
15888
+ return DEFAULT_BUNDLED_FILENAMES10.map((name) => resolve31(packageRoot, "generated", name));
15720
15889
  };
15721
15890
  async function loadTokenRegistry(input) {
15722
15891
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS10, readFile: readFile33 } = input;
@@ -15743,7 +15912,7 @@ async function loadTokenRegistry(input) {
15743
15912
  function collectExternalTokenSources(configResult) {
15744
15913
  const externalSources = [];
15745
15914
  if (configResult.config != null && configResult.configPath != null) {
15746
- const baseDir = dirname12(configResult.configPath);
15915
+ const baseDir = dirname13(configResult.configPath);
15747
15916
  const tokensCluster = configResult.config.tokens;
15748
15917
  for (const source of tokensCluster?.sources ?? []) {
15749
15918
  externalSources.push({ origin: "external", path: toAbsolutePath2(baseDir, source) });
@@ -15758,11 +15927,11 @@ function collectExternalTokenSources(configResult) {
15758
15927
  return externalSources;
15759
15928
  }
15760
15929
  function toAbsolutePath2(baseDir, value) {
15761
- return isAbsolute11(value) ? value : resolve30(baseDir, value);
15930
+ return isAbsolute12(value) ? value : resolve31(baseDir, value);
15762
15931
  }
15763
15932
 
15764
15933
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-ui-components-registry.ts
15765
- import { dirname as dirname13, isAbsolute as isAbsolute12, resolve as resolve31 } from "node:path";
15934
+ import { dirname as dirname14, isAbsolute as isAbsolute13, resolve as resolve32 } from "node:path";
15766
15935
 
15767
15936
  // packages/dbx-cli/src/lib/mcp-scan/manifest/ui-components-loader.ts
15768
15937
  async function loadUiComponentManifests(input) {
@@ -15779,7 +15948,7 @@ async function loadUiComponentManifests(input) {
15779
15948
  var DEFAULT_BUNDLED_FILENAMES11 = ["dereekb-dbx-web.ui-components.mcp.generated.json"];
15780
15949
  var DEFAULT_BUNDLED_PATHS11 = () => {
15781
15950
  const packageRoot = findPackageRoot(import.meta.url);
15782
- return DEFAULT_BUNDLED_FILENAMES11.map((name) => resolve31(packageRoot, "generated", name));
15951
+ return DEFAULT_BUNDLED_FILENAMES11.map((name) => resolve32(packageRoot, "generated", name));
15783
15952
  };
15784
15953
  async function loadUiComponentRegistry(input) {
15785
15954
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS11, readFile: readFile33 } = input;
@@ -15787,10 +15956,10 @@ async function loadUiComponentRegistry(input) {
15787
15956
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15788
15957
  const externalSources = [];
15789
15958
  if (configResult.config != null && configResult.configPath != null) {
15790
- const baseDir = dirname13(configResult.configPath);
15959
+ const baseDir = dirname14(configResult.configPath);
15791
15960
  const declared = configResult.config.uiComponents?.sources ?? [];
15792
15961
  for (const source of declared) {
15793
- const absolute = isAbsolute12(source) ? source : resolve31(baseDir, source);
15962
+ const absolute = isAbsolute13(source) ? source : resolve32(baseDir, source);
15794
15963
  externalSources.push({ origin: "external", path: absolute });
15795
15964
  }
15796
15965
  }
@@ -15813,7 +15982,7 @@ async function loadUiComponentRegistry(input) {
15813
15982
  }
15814
15983
 
15815
15984
  // packages/dbx-cli/src/lib/mcp-scan/manifest/load-utils-registry.ts
15816
- import { dirname as dirname14, isAbsolute as isAbsolute13, resolve as resolve32 } from "node:path";
15985
+ import { dirname as dirname15, isAbsolute as isAbsolute14, resolve as resolve33 } from "node:path";
15817
15986
 
15818
15987
  // packages/dbx-cli/src/lib/mcp-scan/manifest/utils-loader.ts
15819
15988
  async function loadUtilManifests(input) {
@@ -15830,7 +15999,7 @@ async function loadUtilManifests(input) {
15830
15999
  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"];
15831
16000
  var DEFAULT_BUNDLED_PATHS12 = () => {
15832
16001
  const packageRoot = findPackageRoot(import.meta.url);
15833
- return DEFAULT_BUNDLED_FILENAMES12.map((name) => resolve32(packageRoot, "generated", name));
16002
+ return DEFAULT_BUNDLED_FILENAMES12.map((name) => resolve33(packageRoot, "generated", name));
15834
16003
  };
15835
16004
  async function loadUtilRegistry(input) {
15836
16005
  const { cwd, bundledManifestPaths = DEFAULT_BUNDLED_PATHS12, readFile: readFile33 } = input;
@@ -15838,10 +16007,10 @@ async function loadUtilRegistry(input) {
15838
16007
  const configResult = await findAndLoadConfig({ cwd, readFile: readFile33 });
15839
16008
  const externalSources = [];
15840
16009
  if (configResult.config != null && configResult.configPath != null) {
15841
- const baseDir = dirname14(configResult.configPath);
16010
+ const baseDir = dirname15(configResult.configPath);
15842
16011
  const declared = configResult.config.utils?.sources ?? [];
15843
16012
  for (const source of declared) {
15844
- const absolute = isAbsolute13(source) ? source : resolve32(baseDir, source);
16013
+ const absolute = isAbsolute14(source) ? source : resolve33(baseDir, source);
15845
16014
  externalSources.push({ origin: "external", path: absolute });
15846
16015
  }
15847
16016
  }
@@ -16557,7 +16726,7 @@ function loadRouteTree(args) {
16557
16726
  }
16558
16727
 
16559
16728
  // packages/dbx-cli/src/lib/route/component-resolve.ts
16560
- import { dirname as dirname15, join as join5, normalize } from "node:path/posix";
16729
+ import { dirname as dirname16, join as join5, normalize } from "node:path/posix";
16561
16730
  var TRY_EXTENSIONS = [".ts", ".tsx", "/index.ts", "/index.tsx"];
16562
16731
  function resolveComponentSourceFromSources(input) {
16563
16732
  const byName = /* @__PURE__ */ new Map();
@@ -16577,7 +16746,7 @@ function resolveComponentSourceFromSources(input) {
16577
16746
  function resolveSpecifier(specifier, routerFile, byName) {
16578
16747
  let result;
16579
16748
  if (specifier.startsWith(".")) {
16580
- const base = normalize(join5(dirname15(routerFile), specifier));
16749
+ const base = normalize(join5(dirname16(routerFile), specifier));
16581
16750
  let resolved;
16582
16751
  for (const ext of TRY_EXTENSIONS) {
16583
16752
  const candidate = base + ext;
@@ -16989,7 +17158,7 @@ function detectMissingRouteModels(states, warnings) {
16989
17158
  // packages/dbx-components-mcp/src/server.ts
16990
17159
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
16991
17160
  import { McpServer } from "@modelcontextprotocol/server";
16992
- import { dirname as dirname23, isAbsolute as isAbsolute19, resolve as resolvePath4 } from "node:path";
17161
+ import { dirname as dirname24, isAbsolute as isAbsolute20, resolve as resolvePath4 } from "node:path";
16993
17162
 
16994
17163
  // packages/dbx-components-mcp/src/resources/form-fields.resource.ts
16995
17164
  import { ResourceTemplate } from "@modelcontextprotocol/server";
@@ -19495,7 +19664,7 @@ function registerAuthResource(server, options) {
19495
19664
 
19496
19665
  // packages/dbx-components-mcp/src/resources/firestore-rules.resource.ts
19497
19666
  import { readFile as readFile4 } from "node:fs/promises";
19498
- import { resolve as resolve33 } from "node:path";
19667
+ import { resolve as resolve34 } from "node:path";
19499
19668
  import { ResourceTemplate as ResourceTemplate15 } from "@modelcontextprotocol/server";
19500
19669
 
19501
19670
  // packages/dbx-cli/firestore-rules/src/firestore-rules-scan.ts
@@ -19722,7 +19891,7 @@ function registerFirestoreRulesResource(server, options = {}) {
19722
19891
  const cwd = options.cwd ?? process.cwd();
19723
19892
  let result;
19724
19893
  try {
19725
- result = { scan: scanFirestoreRules(await readFile4(resolve33(cwd, rulesFile), "utf8")) };
19894
+ result = { scan: scanFirestoreRules(await readFile4(resolve34(cwd, rulesFile), "utf8")) };
19726
19895
  } catch (e) {
19727
19896
  result = { error: `Failed to read ${rulesFile}: ${e instanceof Error ? e.message : String(e)}` };
19728
19897
  }
@@ -19845,7 +20014,7 @@ function registerResources(server, options = {}) {
19845
20014
  }
19846
20015
 
19847
20016
  // packages/dbx-components-mcp/src/tools/lookup-form.tool.ts
19848
- import { type as type43 } from "arktype";
20017
+ import { type as type44 } from "arktype";
19849
20018
 
19850
20019
  // packages/dbx-components-mcp/src/tools/form-alias-resolver.ts
19851
20020
  var ALIASES = {
@@ -20070,7 +20239,7 @@ function toolError(message) {
20070
20239
  return result;
20071
20240
  }
20072
20241
  function toCallToolResult(result) {
20073
- const content = result.content.map(({ type: type109, text }) => ({ type: type109, text }));
20242
+ const content = result.content.map(({ type: type110, text }) => ({ type: type110, text }));
20074
20243
  const callToolResult = result.isError === void 0 ? { content } : { content, isError: result.isError };
20075
20244
  return callToolResult;
20076
20245
  }
@@ -20107,13 +20276,13 @@ var DBX_FORM_LOOKUP_TOOL = {
20107
20276
  required: ["topic"]
20108
20277
  }
20109
20278
  };
20110
- var LookupFormArgsType = type43({
20279
+ var LookupFormArgsType = type44({
20111
20280
  topic: "string",
20112
20281
  "depth?": "'brief' | 'full'"
20113
20282
  });
20114
20283
  function parseLookupFormArgs(raw) {
20115
20284
  const parsed = LookupFormArgsType(raw);
20116
- if (parsed instanceof type43.errors) {
20285
+ if (parsed instanceof type44.errors) {
20117
20286
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20118
20287
  }
20119
20288
  return {
@@ -20237,14 +20406,14 @@ function createLookupFormTool(config) {
20237
20406
  }
20238
20407
 
20239
20408
  // packages/dbx-components-mcp/src/tools/_search/score.ts
20240
- import { type as type44 } from "arktype";
20241
- var SEARCH_ARGS_TYPE = type44({
20409
+ import { type as type45 } from "arktype";
20410
+ var SEARCH_ARGS_TYPE = type45({
20242
20411
  query: "string",
20243
20412
  "limit?": "number"
20244
20413
  });
20245
20414
  function parseSearchArgs(raw, config) {
20246
20415
  const parsed = SEARCH_ARGS_TYPE(raw);
20247
- if (parsed instanceof type44.errors) {
20416
+ if (parsed instanceof type45.errors) {
20248
20417
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20249
20418
  }
20250
20419
  const rawLimit = parsed.limit ?? config.defaultLimit;
@@ -20489,7 +20658,7 @@ function createSearchFormTool(config) {
20489
20658
  }
20490
20659
 
20491
20660
  // packages/dbx-components-mcp/src/tools/form-examples.tool.ts
20492
- import { type as type45 } from "arktype";
20661
+ import { type as type46 } from "arktype";
20493
20662
 
20494
20663
  // packages/dbx-components-mcp/src/tools/data/patterns/forms/form.address-form.pattern.ts
20495
20664
  var FORM_PATTERN_ADDRESS_FORM = {
@@ -20778,13 +20947,13 @@ var DBX_FORM_EXAMPLES_TOOL = {
20778
20947
  required: ["pattern"]
20779
20948
  }
20780
20949
  };
20781
- var ExamplesArgsType = type45({
20950
+ var ExamplesArgsType = type46({
20782
20951
  pattern: "string",
20783
20952
  "depth?": "'minimal' | 'brief' | 'full'"
20784
20953
  });
20785
20954
  function parseExamplesArgs(raw) {
20786
20955
  const parsed = ExamplesArgsType(raw);
20787
- if (parsed instanceof type45.errors) {
20956
+ if (parsed instanceof type46.errors) {
20788
20957
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20789
20958
  }
20790
20959
  const result = {
@@ -20845,7 +21014,7 @@ var FORM_EXAMPLES_TOOL = {
20845
21014
  };
20846
21015
 
20847
21016
  // packages/dbx-components-mcp/src/tools/form-scaffold.tool.ts
20848
- import { type as type46 } from "arktype";
21017
+ import { type as type47 } from "arktype";
20849
21018
  var DEFAULT_VALUE_TYPE_NAME = "ScaffoldedFormValue";
20850
21019
  var DBX_FORM_SCAFFOLD_TOOL = {
20851
21020
  name: "dbx_form_scaffold",
@@ -20883,14 +21052,14 @@ var DBX_FORM_SCAFFOLD_TOOL = {
20883
21052
  required: ["fields"]
20884
21053
  }
20885
21054
  };
20886
- var ScaffoldArgsType = type46({
21055
+ var ScaffoldArgsType = type47({
20887
21056
  fields: "string[]>0",
20888
21057
  "valueTypeName?": "string",
20889
21058
  "wrapInSection?": "boolean"
20890
21059
  });
20891
21060
  function parseScaffoldArgs(raw) {
20892
21061
  const parsed = ScaffoldArgsType(raw);
20893
- if (parsed instanceof type46.errors) {
21062
+ if (parsed instanceof type47.errors) {
20894
21063
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
20895
21064
  }
20896
21065
  const result = {
@@ -21048,7 +21217,7 @@ ${code17}
21048
21217
  }
21049
21218
 
21050
21219
  // packages/dbx-components-mcp/src/tools/lookup-ui.tool.ts
21051
- import { type as type47 } from "arktype";
21220
+ import { type as type48 } from "arktype";
21052
21221
  var DBX_UI_LOOKUP_TOOL = {
21053
21222
  name: "dbx_ui_lookup",
21054
21223
  description: [
@@ -21078,13 +21247,13 @@ var DBX_UI_LOOKUP_TOOL = {
21078
21247
  required: ["topic"]
21079
21248
  }
21080
21249
  };
21081
- var LookupUiArgsType = type47({
21250
+ var LookupUiArgsType = type48({
21082
21251
  topic: "string",
21083
21252
  "depth?": "'brief' | 'full'"
21084
21253
  });
21085
21254
  function parseLookupUiArgs(raw) {
21086
21255
  const parsed = LookupUiArgsType(raw);
21087
- if (parsed instanceof type47.errors) {
21256
+ if (parsed instanceof type48.errors) {
21088
21257
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
21089
21258
  }
21090
21259
  const result = {
@@ -21342,7 +21511,7 @@ function createLookupUiTool(input) {
21342
21511
  }
21343
21512
 
21344
21513
  // packages/dbx-components-mcp/src/tools/search-ui.tool.ts
21345
- import { type as type48 } from "arktype";
21514
+ import { type as type49 } from "arktype";
21346
21515
  var DEFAULT_LIMIT2 = 10;
21347
21516
  var MAX_LIMIT2 = 25;
21348
21517
  var DBX_UI_SEARCH_TOOL = {
@@ -21379,14 +21548,14 @@ var DBX_UI_SEARCH_TOOL = {
21379
21548
  required: ["query"]
21380
21549
  }
21381
21550
  };
21382
- var SearchUiArgsType = type48({
21551
+ var SearchUiArgsType = type49({
21383
21552
  query: "string",
21384
21553
  "category?": "'layout' | 'list' | 'button' | 'card' | 'feedback' | 'overlay' | 'navigation' | 'text' | 'screen' | 'action' | 'router' | 'misc'",
21385
21554
  "limit?": "number"
21386
21555
  });
21387
21556
  function parseSearchUiArgs(raw) {
21388
21557
  const parsed = SearchUiArgsType(raw);
21389
- if (parsed instanceof type48.errors) {
21558
+ if (parsed instanceof type49.errors) {
21390
21559
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
21391
21560
  }
21392
21561
  const rawLimit = parsed.limit ?? DEFAULT_LIMIT2;
@@ -21586,7 +21755,7 @@ function createSearchUiTool(input) {
21586
21755
  }
21587
21756
 
21588
21757
  // packages/dbx-components-mcp/src/tools/ui-examples.tool.ts
21589
- import { type as type49 } from "arktype";
21758
+ import { type as type50 } from "arktype";
21590
21759
 
21591
21760
  // packages/dbx-components-mcp/src/tools/data/patterns/ui/ui.card-with-action.pattern.ts
21592
21761
  var UI_PATTERN_CARD_WITH_ACTION = {
@@ -21984,13 +22153,13 @@ var DBX_UI_EXAMPLES_TOOL = {
21984
22153
  required: ["pattern"]
21985
22154
  }
21986
22155
  };
21987
- var UiExamplesArgsType = type49({
22156
+ var UiExamplesArgsType = type50({
21988
22157
  pattern: "string",
21989
22158
  "depth?": "'minimal' | 'brief' | 'full'"
21990
22159
  });
21991
22160
  function parseUiExamplesArgs(raw) {
21992
22161
  const parsed = UiExamplesArgsType(raw);
21993
- if (parsed instanceof type49.errors) {
22162
+ if (parsed instanceof type50.errors) {
21994
22163
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
21995
22164
  }
21996
22165
  return {
@@ -22159,7 +22328,7 @@ function createUiExamplesTool(input = {}) {
22159
22328
  }
22160
22329
 
22161
22330
  // packages/dbx-components-mcp/src/tools/lookup-model.tool.ts
22162
- import { type as type50 } from "arktype";
22331
+ import { type as type51 } from "arktype";
22163
22332
 
22164
22333
  // packages/dbx-components-mcp/src/tools/firebase-lookup.formatter.ts
22165
22334
  function applyFieldsFilter(model, filter) {
@@ -25663,23 +25832,23 @@ function formatSeeAlso(ref) {
25663
25832
 
25664
25833
  // packages/dbx-cli/validate/src/lib/_core/validate-input.ts
25665
25834
  import { glob as fsGlob5, readFile as readFile5, stat as stat4 } from "node:fs/promises";
25666
- import { resolve as resolve34, sep as sep5 } from "node:path";
25667
- function ensurePathInsideCwd(relative22, cwd) {
25835
+ import { resolve as resolve35, sep as sep5 } from "node:path";
25836
+ function ensurePathInsideCwd(relative23, cwd) {
25668
25837
  const cwdPrefix = cwd.endsWith(sep5) ? cwd : cwd + sep5;
25669
- const absolute = resolve34(cwd, relative22);
25838
+ const absolute = resolve35(cwd, relative23);
25670
25839
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
25671
- throw new Error(`Path \`${relative22}\` resolves outside the server cwd and is not allowed.`);
25840
+ throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
25672
25841
  }
25673
25842
  }
25674
25843
  async function resolveFolderPaths(config) {
25675
25844
  const { paths, glob: glob2, cwd } = config;
25676
25845
  const collected = [];
25677
25846
  const seen = /* @__PURE__ */ new Set();
25678
- const accept = (relative22) => {
25679
- if (seen.has(relative22)) return;
25680
- ensurePathInsideCwd(relative22, cwd);
25681
- seen.add(relative22);
25682
- collected.push(relative22);
25847
+ const accept = (relative23) => {
25848
+ if (seen.has(relative23)) return;
25849
+ ensurePathInsideCwd(relative23, cwd);
25850
+ seen.add(relative23);
25851
+ collected.push(relative23);
25683
25852
  };
25684
25853
  if (paths) {
25685
25854
  for (const p of paths) {
@@ -25688,7 +25857,7 @@ async function resolveFolderPaths(config) {
25688
25857
  }
25689
25858
  if (glob2) {
25690
25859
  for await (const match of fsGlob5(glob2, { cwd })) {
25691
- const absolute = resolve34(cwd, match);
25860
+ const absolute = resolve35(cwd, match);
25692
25861
  try {
25693
25862
  const stats = await stat4(absolute);
25694
25863
  if (!stats.isDirectory()) continue;
@@ -25722,13 +25891,13 @@ async function resolveValidatorSources(config) {
25722
25891
  pathList.push(match);
25723
25892
  }
25724
25893
  }
25725
- for (const relative22 of pathList) {
25726
- if (seenNames.has(relative22)) continue;
25727
- ensurePathInsideCwd(relative22, cwd);
25728
- const absolute = resolve34(cwd, relative22);
25894
+ for (const relative23 of pathList) {
25895
+ if (seenNames.has(relative23)) continue;
25896
+ ensurePathInsideCwd(relative23, cwd);
25897
+ const absolute = resolve35(cwd, relative23);
25729
25898
  const text = await readFile5(absolute, "utf8");
25730
- seenNames.add(relative22);
25731
- collected.push({ name: relative22, text });
25899
+ seenNames.add(relative23);
25900
+ collected.push({ name: relative23, text });
25732
25901
  }
25733
25902
  return collected;
25734
25903
  }
@@ -28979,7 +29148,7 @@ __export(model_api_validate_app_exports, {
28979
29148
 
28980
29149
  // packages/dbx-cli/validate/src/lib/model-api-validate-app/extract-declarations.ts
28981
29150
  import { readFile as readFile8 } from "node:fs/promises";
28982
- import { relative as relative8, sep as sep6 } from "node:path";
29151
+ import { relative as relative9, sep as sep6 } from "node:path";
28983
29152
 
28984
29153
  // packages/dbx-cli/manifest-extract/src/lib/extract-crud.ts
28985
29154
  import { Node as Node23, Project as Project8 } from "ts-morph";
@@ -29861,7 +30030,7 @@ var API_SUFFIX = ".api.ts";
29861
30030
  async function extractDeclaredEntriesFromFile(fileAbs, root) {
29862
30031
  const text = await readFile8(fileAbs, "utf8");
29863
30032
  if (!text.includes("callModelFirebaseFunctionMapFactory")) return [];
29864
- const fileRel = relative8(root.relativeBase, fileAbs).split(sep6).join("/");
30033
+ const fileRel = relative9(root.relativeBase, fileAbs).split(sep6).join("/");
29865
30034
  const extraction = extractCrudEntries({ name: fileRel, text });
29866
30035
  const out = [];
29867
30036
  for (const entry of extraction.entries) {
@@ -30117,7 +30286,7 @@ function normalize2(value) {
30117
30286
 
30118
30287
  // packages/dbx-cli/validate/src/lib/model-api-validate-app/source-roots.ts
30119
30288
  import { readFile as readFile10, stat as stat8 } from "node:fs/promises";
30120
- import { dirname as dirname16, isAbsolute as isAbsolute14, join as join10, relative as relative9, resolve as resolve35, sep as sep7 } from "node:path";
30289
+ import { dirname as dirname17, isAbsolute as isAbsolute15, join as join10, relative as relative10, resolve as resolve36, sep as sep7 } from "node:path";
30121
30290
  var TSCONFIG_BASE = "tsconfig.base.json";
30122
30291
  var COMPONENT_PACKAGE_JSON = "package.json";
30123
30292
  var SRC_LIB_SUBPATH = "src/lib";
@@ -30143,7 +30312,7 @@ async function resolveApiSourceRoots(input) {
30143
30312
  return { roots, workspaceRoot };
30144
30313
  }
30145
30314
  async function findWorkspaceRoot(startAbs) {
30146
- let current = resolve35(startAbs);
30315
+ let current = resolve36(startAbs);
30147
30316
  for (; ; ) {
30148
30317
  const candidate = join10(current, TSCONFIG_BASE);
30149
30318
  try {
@@ -30151,7 +30320,7 @@ async function findWorkspaceRoot(startAbs) {
30151
30320
  if (s.isFile()) return current;
30152
30321
  } catch {
30153
30322
  }
30154
- const parent = dirname16(current);
30323
+ const parent = dirname17(current);
30155
30324
  if (parent === current) return void 0;
30156
30325
  current = parent;
30157
30326
  }
@@ -30227,8 +30396,8 @@ async function readTsconfigPaths(workspaceRoot) {
30227
30396
  function resolvePackageRoot(input) {
30228
30397
  const target = input.paths.entries.get(input.packageName);
30229
30398
  if (!target) return void 0;
30230
- const targetAbs = isAbsolute14(target) ? target : resolve35(input.workspaceRoot, target);
30231
- return dirname16(dirname16(targetAbs));
30399
+ const targetAbs = isAbsolute15(target) ? target : resolve36(input.workspaceRoot, target);
30400
+ return dirname17(dirname17(targetAbs));
30232
30401
  }
30233
30402
  async function isDirectory2(path) {
30234
30403
  let result = false;
@@ -30244,7 +30413,7 @@ function isRecord(value) {
30244
30413
  return typeof value === "object" && value !== null && !Array.isArray(value);
30245
30414
  }
30246
30415
  function toWorkspaceRel(workspaceRoot, abs) {
30247
- const rel = relative9(workspaceRoot, abs);
30416
+ const rel = relative10(workspaceRoot, abs);
30248
30417
  return rel.split(sep7).join("/");
30249
30418
  }
30250
30419
  function stripJsonComments(value) {
@@ -31110,7 +31279,7 @@ function formatResult4(result) {
31110
31279
 
31111
31280
  // packages/dbx-cli/validate/src/lib/dbx-asset-validate-app/inspect.ts
31112
31281
  import { readdir as readdir5, readFile as readFile11, stat as stat9 } from "node:fs/promises";
31113
- import { join as join11, relative as relative10, sep as sep8 } from "node:path";
31282
+ import { join as join11, relative as relative11, sep as sep8 } from "node:path";
31114
31283
  var COMPONENT_LIB_SUBPATH = "src/lib";
31115
31284
  var APP_ROOT_CONFIG_RELPATH = "src/root.app.config.ts";
31116
31285
  var APP_ASSETS_SUBPATH = "src/assets";
@@ -31150,7 +31319,7 @@ async function inspectComponentLib(rootDir) {
31150
31319
  const abs = join11(libDir, name);
31151
31320
  const text = await readFileIfExists(abs);
31152
31321
  if (text !== void 0) {
31153
- const rel = relative10(rootDir, abs).split(sep8).join("/");
31322
+ const rel = relative11(rootDir, abs).split(sep8).join("/");
31154
31323
  files.push({ relPath: rel, text });
31155
31324
  }
31156
31325
  }
@@ -31215,7 +31384,7 @@ async function collectFilesUnder(absRoot) {
31215
31384
  continue;
31216
31385
  }
31217
31386
  if (!entry.isFile()) continue;
31218
- const rel = relative10(absRoot, full).split(sep8).join("/");
31387
+ const rel = relative11(absRoot, full).split(sep8).join("/");
31219
31388
  out.add(rel);
31220
31389
  }
31221
31390
  }
@@ -32555,7 +32724,7 @@ function formatResult6(result) {
32555
32724
 
32556
32725
  // packages/dbx-cli/validate/src/lib/_core/_validate/inspect.ts
32557
32726
  import { readdir as readdir6, readFile as readFile12, stat as stat10 } from "node:fs/promises";
32558
- import { join as join12, relative as relative11, sep as sep9 } from "node:path";
32727
+ import { join as join12, relative as relative12, sep as sep9 } from "node:path";
32559
32728
  async function inspectSide2(rootDir, subpaths) {
32560
32729
  const rootStatus = await readRootStatus(rootDir);
32561
32730
  if (rootStatus !== void 0) {
@@ -32626,7 +32795,7 @@ async function collectFromDirectory(input) {
32626
32795
  }
32627
32796
  if (!isCollectableTsFile(entry)) continue;
32628
32797
  const text = await readFile12(full, "utf8");
32629
- const rel = relative11(rootDir, full).split(sep9).join("/");
32798
+ const rel = relative12(rootDir, full).split(sep9).join("/");
32630
32799
  out.push({ relPath: rel, text });
32631
32800
  }
32632
32801
  }
@@ -34491,7 +34660,7 @@ __export(model_list_component_exports, {
34491
34660
 
34492
34661
  // packages/dbx-cli/model-test/src/lib/test/discover.ts
34493
34662
  import { readdir as readdir8, stat as stat12 } from "node:fs/promises";
34494
- import { join as join14, relative as relative12, sep as sep10 } from "node:path";
34663
+ import { join as join14, relative as relative13, sep as sep10 } from "node:path";
34495
34664
  var FUNCTION_DIR_REL = "src/app/function";
34496
34665
  async function discoverSpecFilesByGroup(config) {
34497
34666
  const { apiAbs, apiRel } = config;
@@ -34539,7 +34708,7 @@ async function collectSpecFiles(config) {
34539
34708
  }
34540
34709
  if (!entry.isFile()) continue;
34541
34710
  if (!entry.name.endsWith(".spec.ts")) continue;
34542
- const fileRel = toPosix2(`${apiRel}/${relative12(apiAbs, fullAbs)}`);
34711
+ const fileRel = toPosix2(`${apiRel}/${relative13(apiAbs, fullAbs)}`);
34543
34712
  const classification = classifySpecFile({ filename: entry.name, parentFolderName: current.relativeDirName });
34544
34713
  collected.push({ filename: entry.name, fileRel, classification });
34545
34714
  }
@@ -36645,7 +36814,7 @@ function topLevelColonIndex(text) {
36645
36814
 
36646
36815
  // packages/dbx-cli/validate/src/lib/model-list-component/extract.ts
36647
36816
  import { readdir as readdir9, readFile as readFile17, stat as stat13 } from "node:fs/promises";
36648
- import { basename as basename8, join as join17, relative as relative13, sep as sep11 } from "node:path";
36817
+ import { basename as basename8, join as join17, relative as relative14, sep as sep11 } from "node:path";
36649
36818
  import { Node as Node33, Project as Project16 } from "ts-morph";
36650
36819
  var MODEL_SUBPATH2 = "src/lib/model";
36651
36820
  var MODEL_SUBPATH_PREFIX = `${MODEL_SUBPATH2}/`;
@@ -36747,7 +36916,7 @@ async function fallbackForFolder(input) {
36747
36916
  const sourceFile = project.createSourceFile(mainFile.fileName, mainFile.text, { overwrite: true });
36748
36917
  const identity = findIdentityIn(sourceFile);
36749
36918
  if (!identity) return void 0;
36750
- const sourceFileRel = relative13(componentAbs, mainFile.absPath).split(sep11).join("/");
36919
+ const sourceFileRel = relative14(componentAbs, mainFile.absPath).split(sep11).join("/");
36751
36920
  return {
36752
36921
  folder,
36753
36922
  modelName: deriveModelName(identity.constName, folder),
@@ -36930,7 +37099,7 @@ __export(model_api_list_app_exports, {
36930
37099
 
36931
37100
  // packages/dbx-cli/validate/src/lib/model-api-list-app/extract.ts
36932
37101
  import { readFile as readFile18 } from "node:fs/promises";
36933
- import { join as join18, relative as relative14, sep as sep12 } from "node:path";
37102
+ import { join as join18, relative as relative15, sep as sep12 } from "node:path";
36934
37103
  var API_SUFFIX2 = ".api.ts";
36935
37104
  var MODEL_SUBPATH3 = "src/lib";
36936
37105
  async function extractApiList(input) {
@@ -36943,7 +37112,7 @@ async function extractApiList(input) {
36943
37112
  if (!text.includes("callModelFirebaseFunctionMapFactory")) {
36944
37113
  continue;
36945
37114
  }
36946
- const sourceFileRel = relative14(input.componentAbs, filePath).split(sep12).join("/");
37115
+ const sourceFileRel = relative15(input.componentAbs, filePath).split(sep12).join("/");
36947
37116
  const extraction = extractCrudEntries({ name: sourceFileRel, text });
36948
37117
  const fileEntries = extraction.entries.map((entry) => ({ ...entry, sourceFile: sourceFileRel }));
36949
37118
  const counts = countVerbs(fileEntries);
@@ -37075,11 +37244,11 @@ __export(model_api_lookup_exports, {
37075
37244
 
37076
37245
  // packages/dbx-cli/validate/src/lib/model-api-lookup/extract.ts
37077
37246
  import { readFile as readFile20 } from "node:fs/promises";
37078
- import { join as join20, relative as relative16, sep as sep14 } from "node:path";
37247
+ import { join as join20, relative as relative17, sep as sep14 } from "node:path";
37079
37248
 
37080
37249
  // packages/dbx-cli/validate/src/lib/model-api-lookup/extract-actions.ts
37081
37250
  import { readFile as readFile19 } from "node:fs/promises";
37082
- import { join as join19, relative as relative15, sep as sep13 } from "node:path";
37251
+ import { join as join19, relative as relative16, sep as sep13 } from "node:path";
37083
37252
  import { Project as Project17, SyntaxKind as SyntaxKind16 } from "ts-morph";
37084
37253
  var ACTION_SERVER_SUFFIX = ".action.server.ts";
37085
37254
  var COMMON_MODEL_SUBPATH = "src/app/common/model";
@@ -37095,7 +37264,7 @@ async function buildActionLookup(apiAbs) {
37095
37264
  for (const filePath of files) {
37096
37265
  const text = await readFile19(filePath, "utf8");
37097
37266
  const sourceFile = project.createSourceFile(filePath, text, { overwrite: true });
37098
- const sourceFileRel = relative15(apiAbs, filePath).split(sep13).join("/");
37267
+ const sourceFileRel = relative16(apiAbs, filePath).split(sep13).join("/");
37099
37268
  collectAbstractMethods({ sourceFile, sourceFileRel, methodsByParams });
37100
37269
  collectFactoryFunctions({ sourceFile, sourceFileRel, factoriesByParams });
37101
37270
  }
@@ -37261,7 +37430,7 @@ async function collectApiSources(componentAbs) {
37261
37430
  for (const fileAbs of files) {
37262
37431
  const text = await readFile20(fileAbs, "utf8");
37263
37432
  if (!text.includes("callModelFirebaseFunctionMapFactory")) continue;
37264
- const fileRel = relative16(componentAbs, fileAbs).split(sep14).join("/");
37433
+ const fileRel = relative17(componentAbs, fileAbs).split(sep14).join("/");
37265
37434
  sources.push({ fileAbs, fileRel, text });
37266
37435
  }
37267
37436
  return sources;
@@ -37410,7 +37579,7 @@ __export(server_actions_list_app_exports, {
37410
37579
 
37411
37580
  // packages/dbx-cli/validate/src/lib/server-actions-list-app/extract.ts
37412
37581
  import { readdir as readdir10, readFile as readFile21 } from "node:fs/promises";
37413
- import { dirname as dirname17, join as join21, relative as relative17, sep as sep15 } from "node:path";
37582
+ import { dirname as dirname18, join as join21, relative as relative18, sep as sep15 } from "node:path";
37414
37583
  import { Node as Node34, Project as Project18 } from "ts-morph";
37415
37584
  var ACTION_SERVER_SUFFIX2 = ".action.server.ts";
37416
37585
  var COMMON_MODEL_SUBPATH2 = "src/app/common/model";
@@ -37443,7 +37612,7 @@ async function extractServerActions(apiAbs, apiRel) {
37443
37612
  const wiring = await inspectSiblingModule(filePath, className);
37444
37613
  const expectedGetterName = camelize(className);
37445
37614
  const fixtureCoverage = fixtureStatus === "ok" ? fixtureCoverageMap.get(expectedGetterName) ?? unmatchedFixtureCoverage(expectedGetterName) : void 0;
37446
- const sourceFileRel = relative17(apiAbs, filePath).split(sep15).join("/");
37615
+ const sourceFileRel = relative18(apiAbs, filePath).split(sep15).join("/");
37447
37616
  entries.push({
37448
37617
  className,
37449
37618
  sourceFile: sourceFileRel,
@@ -37485,7 +37654,7 @@ async function inspectSiblingModule(actionFilePath, className) {
37485
37654
  return { modulePath: moduleCandidates[0], providedByModule: false, exportedByModule: false };
37486
37655
  }
37487
37656
  async function findModuleCandidates(actionFilePath) {
37488
- const dir = dirname17(actionFilePath);
37657
+ const dir = dirname18(actionFilePath);
37489
37658
  const out = [];
37490
37659
  try {
37491
37660
  const entries = await readdir10(dir, { withFileTypes: true });
@@ -38327,7 +38496,7 @@ __export(dbx_color_template_list_app_exports, {
38327
38496
 
38328
38497
  // packages/dbx-cli/validate/src/lib/dbx-color-template-list-app/inspect.ts
38329
38498
  import { readFile as readFile22 } from "node:fs/promises";
38330
- import { join as join22, relative as relative18, sep as sep16 } from "node:path";
38499
+ import { join as join22, relative as relative19, sep as sep16 } from "node:path";
38331
38500
  var CANDIDATE_RELPATHS = ["src/root.app.config.ts", "src/app.config.ts", "src/app.module.ts", "src/app/app.config.ts", "src/app/app.module.ts"];
38332
38501
  async function inspectColorTemplates(apiAbs, apiRel) {
38333
38502
  const present = [];
@@ -38337,7 +38506,7 @@ async function inspectColorTemplates(apiAbs, apiRel) {
38337
38506
  for (const candidate of candidates) {
38338
38507
  const text = await readFileIfExists2(candidate);
38339
38508
  if (text === void 0) continue;
38340
- const rel = relative18(apiAbs, candidate).split(sep16).join("/");
38509
+ const rel = relative19(apiAbs, candidate).split(sep16).join("/");
38341
38510
  present.push({ relPath: rel, text });
38342
38511
  }
38343
38512
  } catch (err) {
@@ -40071,7 +40240,7 @@ var DBX_MODEL_LOOKUP_TOOL = {
40071
40240
  required: ["topic"]
40072
40241
  }
40073
40242
  };
40074
- var LookupModelArgsType = type50({
40243
+ var LookupModelArgsType = type51({
40075
40244
  topic: "string",
40076
40245
  "depth?": "'brief' | 'full'",
40077
40246
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -40098,7 +40267,7 @@ function normalizeFieldsFilter(raw) {
40098
40267
  }
40099
40268
  function parseLookupModelArgs(raw) {
40100
40269
  const parsed = LookupModelArgsType(raw);
40101
- if (parsed instanceof type50.errors) {
40270
+ if (parsed instanceof type51.errors) {
40102
40271
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40103
40272
  }
40104
40273
  return {
@@ -40230,10 +40399,10 @@ var LOOKUP_MODEL_TOOL = {
40230
40399
  };
40231
40400
 
40232
40401
  // packages/dbx-components-mcp/src/tools/search-model.tool.ts
40233
- import { type as type51 } from "arktype";
40402
+ import { type as type52 } from "arktype";
40234
40403
  var DEFAULT_LIMIT3 = 10;
40235
40404
  var MAX_LIMIT3 = 25;
40236
- var SearchArgsType = type51({
40405
+ var SearchArgsType = type52({
40237
40406
  query: "string",
40238
40407
  "limit?": "number",
40239
40408
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -40390,7 +40559,7 @@ function formatSourceLine(scope, upstreamCount, downstreamPackages) {
40390
40559
  }
40391
40560
  function parseArgs2(rawArgs) {
40392
40561
  const parsed = SearchArgsType(rawArgs);
40393
- if (parsed instanceof type51.errors) {
40562
+ if (parsed instanceof type52.errors) {
40394
40563
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40395
40564
  }
40396
40565
  return {
@@ -40464,7 +40633,7 @@ var SEARCH_MODEL_TOOL = {
40464
40633
  };
40465
40634
 
40466
40635
  // packages/dbx-components-mcp/src/tools/model-decode.tool.ts
40467
- import { type as type52 } from "arktype";
40636
+ import { type as type53 } from "arktype";
40468
40637
 
40469
40638
  // packages/dbx-components-mcp/src/tools/decode.formatter.ts
40470
40639
  function formatDecode(context) {
@@ -40634,14 +40803,14 @@ var DBX_MODEL_DECODE_TOOL = {
40634
40803
  }
40635
40804
  }
40636
40805
  };
40637
- var DecodeArgsType = type52({
40806
+ var DecodeArgsType = type53({
40638
40807
  "data?": "string | object",
40639
40808
  "key?": "string",
40640
40809
  "model?": "string"
40641
40810
  });
40642
40811
  function parseDecodeArgs(raw) {
40643
40812
  const parsed = DecodeArgsType(raw);
40644
- if (parsed instanceof type52.errors) {
40813
+ if (parsed instanceof type53.errors) {
40645
40814
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
40646
40815
  }
40647
40816
  const result = {
@@ -40897,9 +41066,9 @@ var MODEL_DECODE_TOOL = {
40897
41066
  };
40898
41067
 
40899
41068
  // packages/dbx-components-mcp/src/tools/validate-tool.ts
40900
- import { resolve as resolve36 } from "node:path";
40901
- import { type as type53 } from "arktype";
40902
- var FolderValidateArgsType = type53({
41069
+ import { resolve as resolve37 } from "node:path";
41070
+ import { type as type54 } from "arktype";
41071
+ var FolderValidateArgsType = type54({
40903
41072
  "paths?": "string[]",
40904
41073
  "glob?": "string"
40905
41074
  });
@@ -40908,7 +41077,7 @@ function createFolderValidateTool(config) {
40908
41077
  const { definition, inspectFolder: inspectFolder5, validate, format } = config;
40909
41078
  async function run24(rawArgs) {
40910
41079
  const parsed = FolderValidateArgsType(rawArgs);
40911
- if (parsed instanceof type53.errors) {
41080
+ if (parsed instanceof type54.errors) {
40912
41081
  return toolError(`Invalid arguments: ${parsed.summary}`);
40913
41082
  }
40914
41083
  const hasAny = parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -40933,10 +41102,10 @@ function createFolderValidateTool(config) {
40933
41102
  const inspections = [];
40934
41103
  let readError;
40935
41104
  try {
40936
- for (const relative22 of paths) {
40937
- const absolute = resolve36(cwd, relative22);
41105
+ for (const relative23 of paths) {
41106
+ const absolute = resolve37(cwd, relative23);
40938
41107
  const inspection = await inspectFolder5(absolute);
40939
- const relativized = { ...inspection, path: relative22 };
41108
+ const relativized = { ...inspection, path: relative23 };
40940
41109
  inspections.push(relativized);
40941
41110
  }
40942
41111
  } catch (err) {
@@ -40959,8 +41128,8 @@ function createFolderValidateTool(config) {
40959
41128
  const tool = { definition, run: run24 };
40960
41129
  return tool;
40961
41130
  }
40962
- var SourceValidateArgsType = type53({
40963
- "sources?": type53({ name: "string", text: "string" }).array(),
41131
+ var SourceValidateArgsType = type54({
41132
+ "sources?": type54({ name: "string", text: "string" }).array(),
40964
41133
  "paths?": "string[]",
40965
41134
  "glob?": "string"
40966
41135
  });
@@ -40969,7 +41138,7 @@ function createSourceValidateTool(config) {
40969
41138
  const { definition, validate, format } = config;
40970
41139
  async function run24(rawArgs) {
40971
41140
  const parsed = SourceValidateArgsType(rawArgs);
40972
- if (parsed instanceof type53.errors) {
41141
+ if (parsed instanceof type54.errors) {
40973
41142
  return toolError(`Invalid arguments: ${parsed.summary}`);
40974
41143
  }
40975
41144
  const hasAny = parsed.sources && parsed.sources.length > 0 || parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -41002,7 +41171,7 @@ function createSourceValidateTool(config) {
41002
41171
  const tool = { definition, run: run24 };
41003
41172
  return tool;
41004
41173
  }
41005
- var TwoSideValidateArgsType = type53({
41174
+ var TwoSideValidateArgsType = type54({
41006
41175
  componentDir: "string",
41007
41176
  apiDir: "string"
41008
41177
  });
@@ -41020,9 +41189,9 @@ function resolveTwoSideInput(parsed) {
41020
41189
  }
41021
41190
  if (ensureError === void 0) {
41022
41191
  result = {
41023
- componentAbs: resolve36(cwd, componentRel),
41192
+ componentAbs: resolve37(cwd, componentRel),
41024
41193
  componentRel,
41025
- apiAbs: resolve36(cwd, apiRel),
41194
+ apiAbs: resolve37(cwd, apiRel),
41026
41195
  apiRel
41027
41196
  };
41028
41197
  } else {
@@ -41035,7 +41204,7 @@ function createTwoSideValidateTool(config) {
41035
41204
  const { definition, inspectAndValidate, format } = config;
41036
41205
  async function run24(rawArgs) {
41037
41206
  const parsed = TwoSideValidateArgsType(rawArgs);
41038
- if (parsed instanceof type53.errors) {
41207
+ if (parsed instanceof type54.errors) {
41039
41208
  return toolError(`Invalid arguments: ${parsed.summary}`);
41040
41209
  }
41041
41210
  const resolved = resolveTwoSideInput(parsed);
@@ -41053,7 +41222,7 @@ function createTwoSideValidateTool(config) {
41053
41222
  const tool = { definition, run: run24 };
41054
41223
  return tool;
41055
41224
  }
41056
- var ListAppArgsType = type53({
41225
+ var ListAppArgsType = type54({
41057
41226
  componentDir: "string",
41058
41227
  apiDir: "string",
41059
41228
  "format?": "'markdown' | 'json'"
@@ -41063,7 +41232,7 @@ function createListAppTool(config) {
41063
41232
  const { definition, inspectAndList, formatMarkdown: formatMarkdown3, formatJson: formatJson3 } = config;
41064
41233
  async function run24(rawArgs) {
41065
41234
  const parsed = ListAppArgsType(rawArgs);
41066
- if (parsed instanceof type53.errors) {
41235
+ if (parsed instanceof type54.errors) {
41067
41236
  return toolError(`Invalid arguments: ${parsed.summary}`);
41068
41237
  }
41069
41238
  const resolved = resolveTwoSideInput(parsed);
@@ -41184,10 +41353,10 @@ var modelValidateApiTool = createSourceValidateTool({
41184
41353
  });
41185
41354
 
41186
41355
  // packages/dbx-components-mcp/src/tools/model-api-list-app.tool.ts
41187
- import { resolve as resolve37 } from "node:path";
41188
- import { type as type54 } from "arktype";
41356
+ import { resolve as resolve38 } from "node:path";
41357
+ import { type as type55 } from "arktype";
41189
41358
  var { formatReportAsJson: formatReportAsJson9, formatReportAsMarkdown: formatReportAsMarkdown9, listAppModelApi: listAppModelApi2 } = model_api_list_app_exports;
41190
- var ListArgsType = type54({
41359
+ var ListArgsType = type55({
41191
41360
  componentDir: "string",
41192
41361
  "model?": "string",
41193
41362
  "identity?": "string",
@@ -41227,7 +41396,7 @@ var TOOL = {
41227
41396
  };
41228
41397
  async function run(rawArgs) {
41229
41398
  const parsed = ListArgsType(rawArgs);
41230
- if (parsed instanceof type54.errors) {
41399
+ if (parsed instanceof type55.errors) {
41231
41400
  return toolError(`Invalid arguments: ${parsed.summary}`);
41232
41401
  }
41233
41402
  const cwd = process.cwd();
@@ -41239,7 +41408,7 @@ async function run(rawArgs) {
41239
41408
  ensureError = err instanceof Error ? err.message : String(err);
41240
41409
  }
41241
41410
  if (ensureError === void 0) {
41242
- const componentAbs = resolve37(cwd, parsed.componentDir);
41411
+ const componentAbs = resolve38(cwd, parsed.componentDir);
41243
41412
  const modelFilter = parsed.model ?? (parsed.identity ? identityToModel(parsed.identity) : void 0);
41244
41413
  let report;
41245
41414
  let listError;
@@ -41267,10 +41436,10 @@ function identityToModel(identity) {
41267
41436
  var MODEL_API_LIST_APP_TOOL = { definition: TOOL, run };
41268
41437
 
41269
41438
  // packages/dbx-components-mcp/src/tools/model-api-lookup.tool.ts
41270
- import { resolve as resolve38 } from "node:path";
41271
- import { type as type55 } from "arktype";
41439
+ import { resolve as resolve39 } from "node:path";
41440
+ import { type as type56 } from "arktype";
41272
41441
  var { formatLookupAsJson: formatLookupAsJson3, formatLookupAsMarkdown: formatLookupAsMarkdown3, lookupModelApi: lookupModelApi2 } = model_api_lookup_exports;
41273
- var LookupArgsType = type55({
41442
+ var LookupArgsType = type56({
41274
41443
  componentDir: "string",
41275
41444
  "apiDir?": "string",
41276
41445
  "model?": "string",
@@ -41309,7 +41478,7 @@ var TOOL2 = {
41309
41478
  };
41310
41479
  async function run2(rawArgs) {
41311
41480
  const parsed = LookupArgsType(rawArgs);
41312
- if (parsed instanceof type55.errors) {
41481
+ if (parsed instanceof type56.errors) {
41313
41482
  return toolError(`Invalid arguments: ${parsed.summary}`);
41314
41483
  }
41315
41484
  if (!parsed.model && !parsed.identity) {
@@ -41327,8 +41496,8 @@ async function run2(rawArgs) {
41327
41496
  ensureError = err instanceof Error ? err.message : String(err);
41328
41497
  }
41329
41498
  if (ensureError === void 0) {
41330
- const componentAbs = resolve38(cwd, parsed.componentDir);
41331
- const apiAbs = parsed.apiDir ? resolve38(cwd, parsed.apiDir) : void 0;
41499
+ const componentAbs = resolve39(cwd, parsed.componentDir);
41500
+ const apiAbs = parsed.apiDir ? resolve39(cwd, parsed.apiDir) : void 0;
41332
41501
  const modelFilter = parsed.model ?? identityToModel2(parsed.identity);
41333
41502
  let report;
41334
41503
  let lookupError;
@@ -41366,10 +41535,10 @@ function identityToModel2(identity) {
41366
41535
  var MODEL_API_LOOKUP_TOOL = { definition: TOOL2, run: run2 };
41367
41536
 
41368
41537
  // packages/dbx-components-mcp/src/tools/model-api-validate-app.tool.ts
41369
- import { resolve as resolve39 } from "node:path";
41370
- import { type as type56 } from "arktype";
41538
+ import { resolve as resolve40 } from "node:path";
41539
+ import { type as type57 } from "arktype";
41371
41540
  var { formatValidationAsJson: formatValidationAsJson3, formatValidationAsMarkdown: formatValidationAsMarkdown3, validateAppModelApi: validateAppModelApi2 } = model_api_validate_app_exports;
41372
- var ValidateArgsType = type56({
41541
+ var ValidateArgsType = type57({
41373
41542
  componentDir: "string",
41374
41543
  apiDir: "string",
41375
41544
  "model?": "string",
@@ -41411,7 +41580,7 @@ var TOOL3 = {
41411
41580
  };
41412
41581
  async function run3(rawArgs) {
41413
41582
  const parsed = ValidateArgsType(rawArgs);
41414
- if (parsed instanceof type56.errors) {
41583
+ if (parsed instanceof type57.errors) {
41415
41584
  return toolError(`Invalid arguments: ${parsed.summary}`);
41416
41585
  }
41417
41586
  const cwd = process.cwd();
@@ -41424,8 +41593,8 @@ async function run3(rawArgs) {
41424
41593
  ensureError = err instanceof Error ? err.message : String(err);
41425
41594
  }
41426
41595
  if (ensureError === void 0) {
41427
- const componentAbs = resolve39(cwd, parsed.componentDir);
41428
- const apiAbs = resolve39(cwd, parsed.apiDir);
41596
+ const componentAbs = resolve40(cwd, parsed.componentDir);
41597
+ const apiAbs = resolve40(cwd, parsed.apiDir);
41429
41598
  const modelFilter = parsed.model ?? (parsed.identity ? identityToModel3(parsed.identity) : void 0);
41430
41599
  let report;
41431
41600
  let validateError;
@@ -41496,7 +41665,7 @@ function createModelValidateFolderTool(options = {}) {
41496
41665
  }
41497
41666
 
41498
41667
  // packages/dbx-components-mcp/src/tools/model-store-scaffold.tool.ts
41499
- import { type as type57 } from "arktype";
41668
+ import { type as type58 } from "arktype";
41500
41669
  var STORE_SHAPES = ["root", "root-singleton", "sub-collection", "singleton-sub", "system-state"];
41501
41670
  var SHAPE_PROFILES = {
41502
41671
  root: { defaultSurfaces: ["document", "collection"], allowedSurfaces: ["document", "collection"], hasParent: false, emitsDirectives: true, requiresCollectionsClass: true, requiresSystemStateTypeConst: false },
@@ -41592,7 +41761,7 @@ var DBX_MODEL_STORE_SCAFFOLD_TOOL = {
41592
41761
  required: ["model_name", "app_prefix", "firebase_package"]
41593
41762
  }
41594
41763
  };
41595
- var ScaffoldArgsType2 = type57({
41764
+ var ScaffoldArgsType2 = type58({
41596
41765
  model_name: "string",
41597
41766
  app_prefix: "string",
41598
41767
  firebase_package: "string",
@@ -41612,7 +41781,7 @@ var ScaffoldArgsType2 = type57({
41612
41781
  name: "string",
41613
41782
  functions_path: "string"
41614
41783
  },
41615
- "crud_functions?": type57({
41784
+ "crud_functions?": type58({
41616
41785
  name: "string",
41617
41786
  kind: "'create' | 'update' | 'crud'",
41618
41787
  functions_path: "string"
@@ -41632,7 +41801,7 @@ function requireString(value, label) {
41632
41801
  }
41633
41802
  function parseArgs3(raw) {
41634
41803
  const parsed = ScaffoldArgsType2(raw);
41635
- if (parsed instanceof type57.errors) {
41804
+ if (parsed instanceof type58.errors) {
41636
41805
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
41637
41806
  }
41638
41807
  const modelName = requireString(parsed.model_name, "model_name");
@@ -42077,9 +42246,9 @@ var MODEL_STORE_SCAFFOLD_TOOL = {
42077
42246
  };
42078
42247
 
42079
42248
  // packages/dbx-components-mcp/src/tools/model-fixture-list-app.tool.ts
42080
- import { resolve as resolve40 } from "node:path";
42081
- import { type as type58 } from "arktype";
42082
- var ListArgsType2 = type58({
42249
+ import { resolve as resolve41 } from "node:path";
42250
+ import { type as type59 } from "arktype";
42251
+ var ListArgsType2 = type59({
42083
42252
  apiDir: "string",
42084
42253
  "format?": "'markdown' | 'json'"
42085
42254
  });
@@ -42107,7 +42276,7 @@ var TOOL4 = {
42107
42276
  };
42108
42277
  async function run4(rawArgs) {
42109
42278
  const parsed = ListArgsType2(rawArgs);
42110
- if (parsed instanceof type58.errors) {
42279
+ if (parsed instanceof type59.errors) {
42111
42280
  return toolError(`Invalid arguments: ${parsed.summary}`);
42112
42281
  }
42113
42282
  const cwd = process.cwd();
@@ -42119,7 +42288,7 @@ async function run4(rawArgs) {
42119
42288
  }
42120
42289
  let result;
42121
42290
  if (ensureError === void 0) {
42122
- const apiAbs = resolve40(cwd, parsed.apiDir);
42291
+ const apiAbs = resolve41(cwd, parsed.apiDir);
42123
42292
  let extraction;
42124
42293
  let inspectError;
42125
42294
  try {
@@ -42141,9 +42310,9 @@ async function run4(rawArgs) {
42141
42310
  var MODEL_FIXTURE_LIST_APP_TOOL = { definition: TOOL4, run: run4 };
42142
42311
 
42143
42312
  // packages/dbx-components-mcp/src/tools/model-fixture-lookup.tool.ts
42144
- import { resolve as resolve41 } from "node:path";
42145
- import { type as type59 } from "arktype";
42146
- var LookupArgsType2 = type59({
42313
+ import { resolve as resolve42 } from "node:path";
42314
+ import { type as type60 } from "arktype";
42315
+ var LookupArgsType2 = type60({
42147
42316
  apiDir: "string",
42148
42317
  "model?": "string",
42149
42318
  "identity?": "string",
@@ -42175,7 +42344,7 @@ var TOOL5 = {
42175
42344
  };
42176
42345
  async function run5(rawArgs) {
42177
42346
  const parsed = LookupArgsType2(rawArgs);
42178
- if (parsed instanceof type59.errors) {
42347
+ if (parsed instanceof type60.errors) {
42179
42348
  return toolError(`Invalid arguments: ${parsed.summary}`);
42180
42349
  }
42181
42350
  if (!parsed.model && !parsed.identity) {
@@ -42185,7 +42354,7 @@ async function run5(rawArgs) {
42185
42354
  const ensureError = runEnsurePathInsideCwd(parsed.apiDir, cwd);
42186
42355
  let result;
42187
42356
  if (ensureError === void 0) {
42188
- const apiAbs = resolve41(cwd, parsed.apiDir);
42357
+ const apiAbs = resolve42(cwd, parsed.apiDir);
42189
42358
  const inspection = await inspectFixturesSafe(apiAbs, parsed.apiDir);
42190
42359
  if (inspection.kind === "error") {
42191
42360
  result = toolError(inspection.message);
@@ -42244,10 +42413,10 @@ function identityToModel4(identity) {
42244
42413
  var MODEL_FIXTURE_LOOKUP_TOOL = { definition: TOOL5, run: run5 };
42245
42414
 
42246
42415
  // packages/dbx-components-mcp/src/tools/model-fixture-validate-app.tool.ts
42247
- import { resolve as resolve42 } from "node:path";
42248
- import { type as type60 } from "arktype";
42416
+ import { resolve as resolve43 } from "node:path";
42417
+ import { type as type61 } from "arktype";
42249
42418
  var { formatValidationAsJson: formatValidationAsJson4, formatValidationAsMarkdown: formatValidationAsMarkdown4, validateAppFixtures: validateAppFixtures2 } = model_fixture_shared_exports;
42250
- var ValidateArgsType2 = type60({
42419
+ var ValidateArgsType2 = type61({
42251
42420
  apiDir: "string",
42252
42421
  "format?": "'markdown' | 'json'"
42253
42422
  });
@@ -42281,7 +42450,7 @@ var TOOL6 = {
42281
42450
  function createModelFixtureValidateAppTool(config = {}) {
42282
42451
  async function run24(rawArgs) {
42283
42452
  const parsed = ValidateArgsType2(rawArgs);
42284
- if (parsed instanceof type60.errors) {
42453
+ if (parsed instanceof type61.errors) {
42285
42454
  return toolError(`Invalid arguments: ${parsed.summary}`);
42286
42455
  }
42287
42456
  const cwd = process.cwd();
@@ -42293,7 +42462,7 @@ function createModelFixtureValidateAppTool(config = {}) {
42293
42462
  ensureError = err instanceof Error ? err.message : String(err);
42294
42463
  }
42295
42464
  if (ensureError === void 0) {
42296
- const apiAbs = resolve42(cwd, parsed.apiDir);
42465
+ const apiAbs = resolve43(cwd, parsed.apiDir);
42297
42466
  let extraction;
42298
42467
  let inspectError;
42299
42468
  try {
@@ -42322,16 +42491,16 @@ function createModelFixtureValidateAppTool(config = {}) {
42322
42491
 
42323
42492
  // packages/dbx-components-mcp/src/tools/model-fixture-scaffold.tool.ts
42324
42493
  import { readFile as readFile23, writeFile } from "node:fs/promises";
42325
- import { join as join23, resolve as resolve43 } from "node:path";
42326
- import { type as type61 } from "arktype";
42327
- var ScaffoldArgsType3 = type61({
42494
+ import { join as join23, resolve as resolve44 } from "node:path";
42495
+ import { type as type62 } from "arktype";
42496
+ var ScaffoldArgsType3 = type62({
42328
42497
  apiDir: "string",
42329
42498
  model: "string",
42330
42499
  archetype: "'top-level-simple' | 'top-level-with-deps' | 'sub-collection' | 'sub-collection-traversal'",
42331
42500
  "prefix?": "string",
42332
42501
  "parentFixture?": "string",
42333
42502
  "parentFixtureField?": "string",
42334
- "paramsDependsOn?": type61({
42503
+ "paramsDependsOn?": type62({
42335
42504
  field: "string",
42336
42505
  fixtureModel: "string",
42337
42506
  "optional?": "boolean",
@@ -42392,7 +42561,7 @@ var TOOL7 = {
42392
42561
  };
42393
42562
  async function run6(rawArgs) {
42394
42563
  const parsed = ScaffoldArgsType3(rawArgs);
42395
- if (parsed instanceof type61.errors) {
42564
+ if (parsed instanceof type62.errors) {
42396
42565
  return toolError(`Invalid arguments: ${parsed.summary}`);
42397
42566
  }
42398
42567
  const cwd = process.cwd();
@@ -42408,7 +42577,7 @@ async function run6(rawArgs) {
42408
42577
  return runScaffold(parsed, cwd);
42409
42578
  }
42410
42579
  async function runScaffold(parsed, cwd) {
42411
- const apiAbs = resolve43(cwd, parsed.apiDir);
42580
+ const apiAbs = resolve44(cwd, parsed.apiDir);
42412
42581
  let extraction;
42413
42582
  let extractionError;
42414
42583
  try {
@@ -42518,10 +42687,10 @@ function collectConflicts(extraction, rendered) {
42518
42687
  var MODEL_FIXTURE_SCAFFOLD_TOOL = { definition: TOOL7, run: run6 };
42519
42688
 
42520
42689
  // packages/dbx-components-mcp/src/tools/model-fixture-forward.tool.ts
42521
- import { join as join24, resolve as resolve44 } from "node:path";
42522
- import { type as type62 } from "arktype";
42690
+ import { join as join24, resolve as resolve45 } from "node:path";
42691
+ import { type as type63 } from "arktype";
42523
42692
  import { Project as Project21 } from "ts-morph";
42524
- var ForwardArgsType = type62({
42693
+ var ForwardArgsType = type63({
42525
42694
  apiDir: "string",
42526
42695
  model: "string",
42527
42696
  "methods?": "string[]"
@@ -42555,7 +42724,7 @@ var TOOL8 = {
42555
42724
  };
42556
42725
  async function run7(rawArgs) {
42557
42726
  const parsed = ForwardArgsType(rawArgs);
42558
- if (parsed instanceof type62.errors) {
42727
+ if (parsed instanceof type63.errors) {
42559
42728
  return toolError(`Invalid arguments: ${parsed.summary}`);
42560
42729
  }
42561
42730
  const cwd = process.cwd();
@@ -42567,7 +42736,7 @@ async function run7(rawArgs) {
42567
42736
  ensureError = toErrorMessage(err);
42568
42737
  }
42569
42738
  if (ensureError === void 0) {
42570
- const apiAbs = resolve44(cwd, parsed.apiDir);
42739
+ const apiAbs = resolve45(cwd, parsed.apiDir);
42571
42740
  let extraction;
42572
42741
  let inspectError;
42573
42742
  try {
@@ -42657,9 +42826,9 @@ function appendListSection(lines, heading, names) {
42657
42826
  var MODEL_FIXTURE_FORWARD_TOOL = { definition: TOOL8, run: run7 };
42658
42827
 
42659
42828
  // packages/dbx-components-mcp/src/tools/model-test-list-app.tool.ts
42660
- import { resolve as resolve45 } from "node:path";
42661
- import { type as type63 } from "arktype";
42662
- var ListAppArgsType2 = type63({
42829
+ import { resolve as resolve46 } from "node:path";
42830
+ import { type as type64 } from "arktype";
42831
+ var ListAppArgsType2 = type64({
42663
42832
  apiDir: "string",
42664
42833
  "group?": "string",
42665
42834
  "format?": "'markdown' | 'json'"
@@ -42699,7 +42868,7 @@ var TOOL9 = {
42699
42868
  };
42700
42869
  async function run8(rawArgs) {
42701
42870
  const parsed = ListAppArgsType2(rawArgs);
42702
- if (parsed instanceof type63.errors) {
42871
+ if (parsed instanceof type64.errors) {
42703
42872
  return toolError(`Invalid arguments: ${parsed.summary}`);
42704
42873
  }
42705
42874
  const cwd = process.cwd();
@@ -42711,7 +42880,7 @@ async function run8(rawArgs) {
42711
42880
  }
42712
42881
  let result;
42713
42882
  if (ensureError === void 0) {
42714
- const apiAbs = resolve45(cwd, parsed.apiDir);
42883
+ const apiAbs = resolve46(cwd, parsed.apiDir);
42715
42884
  let catalog;
42716
42885
  let discoveryError;
42717
42886
  try {
@@ -42746,9 +42915,9 @@ function filterCatalogByGroup(catalog, group) {
42746
42915
  var MODEL_TEST_LIST_APP_TOOL = { definition: TOOL9, run: run8 };
42747
42916
 
42748
42917
  // packages/dbx-components-mcp/src/tools/model-test-tree.tool.ts
42749
- import { resolve as resolve46 } from "node:path";
42750
- import { type as type64 } from "arktype";
42751
- var TreeArgsType = type64({
42918
+ import { resolve as resolve47 } from "node:path";
42919
+ import { type as type65 } from "arktype";
42920
+ var TreeArgsType = type65({
42752
42921
  specFile: "string",
42753
42922
  "apiDir?": "string",
42754
42923
  "view?": "'all' | 'describes' | 'fixtures' | 'its' | 'helpers'",
@@ -42788,7 +42957,7 @@ var TOOL10 = {
42788
42957
  };
42789
42958
  async function run9(rawArgs) {
42790
42959
  const parsed = TreeArgsType(rawArgs);
42791
- if (parsed instanceof type64.errors) {
42960
+ if (parsed instanceof type65.errors) {
42792
42961
  return toolError(`Invalid arguments: ${parsed.summary}`);
42793
42962
  }
42794
42963
  const cwd = process.cwd();
@@ -42801,8 +42970,8 @@ async function run9(rawArgs) {
42801
42970
  }
42802
42971
  let result;
42803
42972
  if (ensureError === void 0) {
42804
- const specAbs = resolve46(cwd, parsed.specFile);
42805
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve46(cwd, parsed.apiDir);
42973
+ const specAbs = resolve47(cwd, parsed.specFile);
42974
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve47(cwd, parsed.apiDir);
42806
42975
  let tree;
42807
42976
  let inspectError;
42808
42977
  try {
@@ -42826,9 +42995,9 @@ async function run9(rawArgs) {
42826
42995
  var MODEL_TEST_TREE_TOOL = { definition: TOOL10, run: run9 };
42827
42996
 
42828
42997
  // packages/dbx-components-mcp/src/tools/model-test-search.tool.ts
42829
- import { resolve as resolve47 } from "node:path";
42830
- import { type as type65 } from "arktype";
42831
- var SearchArgsType2 = type65({
42998
+ import { resolve as resolve48 } from "node:path";
42999
+ import { type as type66 } from "arktype";
43000
+ var SearchArgsType2 = type66({
42832
43001
  specFile: "string",
42833
43002
  "apiDir?": "string",
42834
43003
  "model?": "string",
@@ -42871,7 +43040,7 @@ var TOOL11 = {
42871
43040
  };
42872
43041
  async function run10(rawArgs) {
42873
43042
  const parsed = SearchArgsType2(rawArgs);
42874
- if (parsed instanceof type65.errors) {
43043
+ if (parsed instanceof type66.errors) {
42875
43044
  return toolError(`Invalid arguments: ${parsed.summary}`);
42876
43045
  }
42877
43046
  const queryFields = [
@@ -42897,8 +43066,8 @@ async function run10(rawArgs) {
42897
43066
  ensureError = err instanceof Error ? err.message : String(err);
42898
43067
  }
42899
43068
  if (ensureError === void 0) {
42900
- const specAbs = resolve47(cwd, parsed.specFile);
42901
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve47(cwd, parsed.apiDir);
43069
+ const specAbs = resolve48(cwd, parsed.specFile);
43070
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve48(cwd, parsed.apiDir);
42902
43071
  let tree;
42903
43072
  let inspectError;
42904
43073
  try {
@@ -42921,9 +43090,9 @@ async function run10(rawArgs) {
42921
43090
  var MODEL_TEST_SEARCH_TOOL = { definition: TOOL11, run: run10 };
42922
43091
 
42923
43092
  // packages/dbx-components-mcp/src/tools/model-test-convention.tool.ts
42924
- import { type as type66 } from "arktype";
43093
+ import { type as type67 } from "arktype";
42925
43094
  var API_DIR_PLACEHOLDER = "<apiDir>";
42926
- var ConventionArgsType = type66({
43095
+ var ConventionArgsType = type67({
42927
43096
  group: "string",
42928
43097
  "apiDir?": "string",
42929
43098
  "bucket?": "'crud' | 'scenario'",
@@ -42962,7 +43131,7 @@ var TOOL12 = {
42962
43131
  };
42963
43132
  function parseArgs4(rawArgs) {
42964
43133
  const parsed = ConventionArgsType(rawArgs);
42965
- if (parsed instanceof type66.errors) {
43134
+ if (parsed instanceof type67.errors) {
42966
43135
  return toolError(`Invalid arguments: ${parsed.summary}`);
42967
43136
  }
42968
43137
  if (parsed.subgroups !== void 0 && parsed.bucket === void 0) {
@@ -43050,9 +43219,9 @@ async function run11(rawArgs) {
43050
43219
  var MODEL_TEST_CONVENTION_TOOL = { definition: TOOL12, run: run11 };
43051
43220
 
43052
43221
  // packages/dbx-components-mcp/src/tools/model-test-hotspots.tool.ts
43053
- import { resolve as resolve48 } from "node:path";
43054
- import { type as type67 } from "arktype";
43055
- var HotspotsArgsType = type67({
43222
+ import { resolve as resolve49 } from "node:path";
43223
+ import { type as type68 } from "arktype";
43224
+ var HotspotsArgsType = type68({
43056
43225
  apiDir: "string",
43057
43226
  model: "string",
43058
43227
  "format?": "'markdown' | 'json'"
@@ -43085,7 +43254,7 @@ var TOOL13 = {
43085
43254
  };
43086
43255
  async function run12(rawArgs) {
43087
43256
  const parsed = HotspotsArgsType(rawArgs);
43088
- if (parsed instanceof type67.errors) {
43257
+ if (parsed instanceof type68.errors) {
43089
43258
  return toolError(`Invalid arguments: ${parsed.summary}`);
43090
43259
  }
43091
43260
  const cwd = process.cwd();
@@ -43097,7 +43266,7 @@ async function run12(rawArgs) {
43097
43266
  }
43098
43267
  let result;
43099
43268
  if (ensureError === void 0) {
43100
- const apiAbs = resolve48(cwd, parsed.apiDir);
43269
+ const apiAbs = resolve49(cwd, parsed.apiDir);
43101
43270
  let hotspots;
43102
43271
  let lookupError;
43103
43272
  try {
@@ -43119,11 +43288,11 @@ async function run12(rawArgs) {
43119
43288
  var MODEL_TEST_HOTSPOTS_TOOL = { definition: TOOL13, run: run12 };
43120
43289
 
43121
43290
  // packages/dbx-components-mcp/src/tools/model-test-validate-app.tool.ts
43122
- import { resolve as resolve49 } from "node:path";
43123
- import { type as type68 } from "arktype";
43291
+ import { resolve as resolve50 } from "node:path";
43292
+ import { type as type69 } from "arktype";
43124
43293
  var { extractComponentModels: extractComponentModels2 } = model_list_component_exports;
43125
43294
  var { formatModelTestValidateAppJson: formatModelTestValidateAppJson2, formatModelTestValidateAppMarkdown: formatModelTestValidateAppMarkdown2, validateModelTestApp: validateModelTestApp2 } = model_test_validate_app_exports;
43126
- var ValidateAppArgsType = type68({
43295
+ var ValidateAppArgsType = type69({
43127
43296
  componentDir: "string",
43128
43297
  apiDir: "string",
43129
43298
  "strict?": "boolean",
@@ -43161,7 +43330,7 @@ var TOOL14 = {
43161
43330
  };
43162
43331
  async function run13(rawArgs) {
43163
43332
  const parsed = ValidateAppArgsType(rawArgs);
43164
- if (parsed instanceof type68.errors) {
43333
+ if (parsed instanceof type69.errors) {
43165
43334
  return toolError(`Invalid arguments: ${parsed.summary}`);
43166
43335
  }
43167
43336
  const cwd = process.cwd();
@@ -43175,8 +43344,8 @@ async function run13(rawArgs) {
43175
43344
  if (ensureError !== void 0) {
43176
43345
  return toolError(ensureError);
43177
43346
  }
43178
- const componentAbs = resolve49(cwd, parsed.componentDir);
43179
- const apiAbs = resolve49(cwd, parsed.apiDir);
43347
+ const componentAbs = resolve50(cwd, parsed.componentDir);
43348
+ const apiAbs = resolve50(cwd, parsed.apiDir);
43180
43349
  let catalog;
43181
43350
  let extraction;
43182
43351
  let inspectionError;
@@ -43204,7 +43373,7 @@ async function run13(rawArgs) {
43204
43373
  var MODEL_TEST_VALIDATE_APP_TOOL = { definition: TOOL14, run: run13 };
43205
43374
 
43206
43375
  // packages/dbx-components-mcp/src/tools/archetype-recommend.tool.ts
43207
- import { type as type69 } from "arktype";
43376
+ import { type as type70 } from "arktype";
43208
43377
 
43209
43378
  // packages/dbx-components-mcp/src/tools/archetype/score.ts
43210
43379
  var FRAMEWORK_SHORT_CIRCUITS = [
@@ -43596,7 +43765,7 @@ function formatArchetypeCatalog(archetypes) {
43596
43765
  // packages/dbx-components-mcp/src/tools/archetype-recommend.tool.ts
43597
43766
  var DEFAULT_PEER_COUNT = 5;
43598
43767
  var DEFAULT_MAX_RESULTS = 3;
43599
- var QuestionnaireType = type69({
43768
+ var QuestionnaireType = type70({
43600
43769
  "candidateName?": "string",
43601
43770
  "candidateGroup?": "string",
43602
43771
  "domainDescription?": "string",
@@ -43634,7 +43803,7 @@ var QuestionnaireType = type69({
43634
43803
  "estimatedItemsPerParent?": "'0-50' | '50-500' | '500+' | 'unknown'",
43635
43804
  "alwaysReadWithParent?": "boolean"
43636
43805
  });
43637
- var RecommendArgsType = type69({
43806
+ var RecommendArgsType = type70({
43638
43807
  questionnaire: QuestionnaireType,
43639
43808
  "archetypeHint?": "string",
43640
43809
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -43688,7 +43857,7 @@ var DBX_MODEL_ARCHETYPE_RECOMMEND_TOOL = {
43688
43857
  };
43689
43858
  function parseArgs5(raw) {
43690
43859
  const parsed = RecommendArgsType(raw);
43691
- if (parsed instanceof type69.errors) {
43860
+ if (parsed instanceof type70.errors) {
43692
43861
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43693
43862
  }
43694
43863
  const result = {
@@ -43798,7 +43967,7 @@ var ARCHETYPE_RECOMMEND_TOOL = {
43798
43967
  };
43799
43968
 
43800
43969
  // packages/dbx-components-mcp/src/tools/archetype-lookup.tool.ts
43801
- import { type as type70 } from "arktype";
43970
+ import { type as type71 } from "arktype";
43802
43971
  var DBX_MODEL_ARCHETYPE_LOOKUP_TOOL = {
43803
43972
  name: "dbx_model_archetype_lookup",
43804
43973
  description: [
@@ -43822,14 +43991,14 @@ var DBX_MODEL_ARCHETYPE_LOOKUP_TOOL = {
43822
43991
  required: ["slug"]
43823
43992
  }
43824
43993
  };
43825
- var LookupArgsType3 = type70({
43994
+ var LookupArgsType3 = type71({
43826
43995
  slug: "string",
43827
43996
  "axes?": { "[string]": "string" }
43828
43997
  });
43829
43998
  var CATALOG_KEYWORDS = /* @__PURE__ */ new Set(["list", "catalog", "all"]);
43830
43999
  function parseArgs6(raw) {
43831
44000
  const parsed = LookupArgsType3(raw);
43832
- if (parsed instanceof type70.errors) {
44001
+ if (parsed instanceof type71.errors) {
43833
44002
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43834
44003
  }
43835
44004
  return { slug: parsed.slug, axes: parsed.axes };
@@ -43877,9 +44046,9 @@ var ARCHETYPE_LOOKUP_TOOL = {
43877
44046
  };
43878
44047
 
43879
44048
  // packages/dbx-components-mcp/src/tools/archetype-search.tool.ts
43880
- import { type as type71 } from "arktype";
44049
+ import { type as type72 } from "arktype";
43881
44050
  var DEFAULT_LIMIT4 = 25;
43882
- var SearchArgsType3 = type71({
44051
+ var SearchArgsType3 = type72({
43883
44052
  archetype: "string",
43884
44053
  "axes?": { "[string]": "string" },
43885
44054
  "scope?": "'all' | 'upstream' | 'downstream'",
@@ -43915,7 +44084,7 @@ var DBX_MODEL_ARCHETYPE_SEARCH_TOOL = {
43915
44084
  };
43916
44085
  function parseArgs7(raw) {
43917
44086
  const parsed = SearchArgsType3(raw);
43918
- if (parsed instanceof type71.errors) {
44087
+ if (parsed instanceof type72.errors) {
43919
44088
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
43920
44089
  }
43921
44090
  return {
@@ -44025,7 +44194,7 @@ var ARCHETYPE_SEARCH_TOOL = {
44025
44194
  };
44026
44195
 
44027
44196
  // packages/dbx-components-mcp/src/tools/model-hierarchy.tool.ts
44028
- import { type as type72 } from "arktype";
44197
+ import { type as type73 } from "arktype";
44029
44198
  var DBX_MODEL_HIERARCHY_TOOL = {
44030
44199
  name: "dbx_model_hierarchy",
44031
44200
  description: [
@@ -44083,7 +44252,7 @@ var DBX_MODEL_HIERARCHY_TOOL = {
44083
44252
  }
44084
44253
  }
44085
44254
  };
44086
- var HierarchyArgsType = type72({
44255
+ var HierarchyArgsType = type73({
44087
44256
  "rootModel?": "string",
44088
44257
  "maxDepth?": "number.integer >= 0",
44089
44258
  "format?": "'tree' | 'flat' | 'both'",
@@ -44093,7 +44262,7 @@ var HierarchyArgsType = type72({
44093
44262
  });
44094
44263
  function parseHierarchyArgs(raw) {
44095
44264
  const parsed = HierarchyArgsType(raw ?? {});
44096
- if (parsed instanceof type72.errors) {
44265
+ if (parsed instanceof type73.errors) {
44097
44266
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
44098
44267
  }
44099
44268
  return {
@@ -44514,10 +44683,10 @@ var systemMValidateFolderTool = createFolderValidateTool({
44514
44683
  });
44515
44684
 
44516
44685
  // packages/dbx-components-mcp/src/tools/system-m-list-app.tool.ts
44517
- import { resolve as resolve50 } from "node:path";
44518
- import { type as type73 } from "arktype";
44686
+ import { resolve as resolve51 } from "node:path";
44687
+ import { type as type74 } from "arktype";
44519
44688
  var { formatReportAsJson: formatReportAsJson12, formatReportAsMarkdown: formatReportAsMarkdown12, listAppSystem: listAppSystem2 } = system_m_list_app_exports;
44520
- var ListAppArgsType3 = type73({
44689
+ var ListAppArgsType3 = type74({
44521
44690
  componentDir: "string",
44522
44691
  "format?": "'markdown' | 'json'"
44523
44692
  });
@@ -44545,7 +44714,7 @@ var TOOL15 = {
44545
44714
  };
44546
44715
  async function run14(rawArgs) {
44547
44716
  const parsed = ListAppArgsType3(rawArgs);
44548
- if (parsed instanceof type73.errors) {
44717
+ if (parsed instanceof type74.errors) {
44549
44718
  return toolError(`Invalid arguments: ${parsed.summary}`);
44550
44719
  }
44551
44720
  const cwd = process.cwd();
@@ -44557,7 +44726,7 @@ async function run14(rawArgs) {
44557
44726
  ensureError = err instanceof Error ? err.message : String(err);
44558
44727
  }
44559
44728
  if (ensureError === void 0) {
44560
- const componentAbs = resolve50(cwd, parsed.componentDir);
44729
+ const componentAbs = resolve51(cwd, parsed.componentDir);
44561
44730
  let report;
44562
44731
  let listError;
44563
44732
  try {
@@ -44694,7 +44863,7 @@ var dbxAssetValidateFolderTool = createTwoSideValidateTool({
44694
44863
  });
44695
44864
 
44696
44865
  // packages/dbx-components-mcp/src/tools/dbx-asset-scaffold.tool.ts
44697
- import { type as type74 } from "arktype";
44866
+ import { type as type75 } from "arktype";
44698
44867
  var ASSET_BUILDERS = [
44699
44868
  { kind: "local", helper: "localAsset", signature: "(path: SlashPath)" },
44700
44869
  { kind: "remote", helper: "remoteAsset", signature: "(url: WebsiteUrlWithPrefix)" },
@@ -44730,7 +44899,7 @@ var DBX_ASSET_SCAFFOLD_TOOL_DEFINITION = {
44730
44899
  required: ["name", "kind"]
44731
44900
  }
44732
44901
  };
44733
- var ScaffoldArgsType4 = type74({
44902
+ var ScaffoldArgsType4 = type75({
44734
44903
  name: "string",
44735
44904
  kind: "'local' | 'remote' | 'folder' | 'remote-base'",
44736
44905
  "path?": "string",
@@ -44740,7 +44909,7 @@ var ScaffoldArgsType4 = type74({
44740
44909
  });
44741
44910
  function parseScaffoldArgs2(raw) {
44742
44911
  const parsed = ScaffoldArgsType4(raw);
44743
- if (parsed instanceof type74.errors) {
44912
+ if (parsed instanceof type75.errors) {
44744
44913
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
44745
44914
  }
44746
44915
  const name = parsed.name.trim();
@@ -44884,8 +45053,8 @@ var DBX_ASSET_SCAFFOLD_TOOL = {
44884
45053
  };
44885
45054
 
44886
45055
  // packages/dbx-components-mcp/src/tools/dbx-color-template-list-app.tool.ts
44887
- import { resolve as resolve51 } from "node:path";
44888
- import { type as type75 } from "arktype";
45056
+ import { resolve as resolve52 } from "node:path";
45057
+ import { type as type76 } from "arktype";
44889
45058
  var { formatReportAsJson: formatReportAsJson14, formatReportAsMarkdown: formatReportAsMarkdown14, inspectColorTemplates: inspectColorTemplates2, listAppColorTemplates: listAppColorTemplates2 } = dbx_color_template_list_app_exports;
44890
45059
  var DBX_COLOR_TEMPLATE_LIST_APP_TOOL_DEFINITION = {
44891
45060
  name: "dbx_color_template_list_app",
@@ -44911,14 +45080,14 @@ var DBX_COLOR_TEMPLATE_LIST_APP_TOOL_DEFINITION = {
44911
45080
  required: ["apiDir"]
44912
45081
  }
44913
45082
  };
44914
- var ColorTemplateListAppArgs = type75({
45083
+ var ColorTemplateListAppArgs = type76({
44915
45084
  apiDir: "string",
44916
45085
  "format?": "'markdown' | 'json'"
44917
45086
  });
44918
45087
  async function run15(rawArgs) {
44919
45088
  const parsed = ColorTemplateListAppArgs(rawArgs);
44920
45089
  let result;
44921
- if (parsed instanceof type75.errors) {
45090
+ if (parsed instanceof type76.errors) {
44922
45091
  result = toolError(`Invalid arguments: ${parsed.summary}`);
44923
45092
  } else {
44924
45093
  const cwd = process.cwd();
@@ -44930,7 +45099,7 @@ async function run15(rawArgs) {
44930
45099
  pathError = err instanceof Error ? err.message : String(err);
44931
45100
  }
44932
45101
  if (pathError === void 0) {
44933
- const apiAbs = resolve51(cwd, apiRel);
45102
+ const apiAbs = resolve52(cwd, apiRel);
44934
45103
  const inspection = await inspectColorTemplates2(apiAbs, apiRel);
44935
45104
  if (inspection.appExists) {
44936
45105
  const report = listAppColorTemplates2(inspection);
@@ -44951,8 +45120,8 @@ var DBX_COLOR_TEMPLATE_LIST_APP_TOOL = {
44951
45120
  };
44952
45121
 
44953
45122
  // packages/dbx-components-mcp/src/tools/dbx-color-smell-check.tool.ts
44954
- import { resolve as resolve52 } from "node:path";
44955
- import { type as type76 } from "arktype";
45123
+ import { resolve as resolve53 } from "node:path";
45124
+ import { type as type77 } from "arktype";
44956
45125
  var { extractHtmlLiterals: extractHtmlLiterals2, extractTsLiterals: extractTsLiterals2, formatResultAsJson: formatResultAsJson2, formatResultAsMarkdown: formatResultAsMarkdown2, groupColorSmells: groupColorSmells2 } = dbx_color_smell_check_exports;
44957
45126
  var { extractColorTemplates: extractColorTemplates2, inspectColorTemplates: inspectColorTemplates3 } = dbx_color_template_list_app_exports;
44958
45127
  var DBX_COLOR_SMELL_CHECK_TOOL_DEFINITION = {
@@ -44985,7 +45154,7 @@ var DBX_COLOR_SMELL_CHECK_TOOL_DEFINITION = {
44985
45154
  }
44986
45155
  }
44987
45156
  };
44988
- var ColorSmellCheckArgs = type76({
45157
+ var ColorSmellCheckArgs = type77({
44989
45158
  "paths?": "string[]",
44990
45159
  "glob?": "string",
44991
45160
  "equivalenceMode?": "'exact' | 'normalized'",
@@ -44995,7 +45164,7 @@ var ColorSmellCheckArgs = type76({
44995
45164
  });
44996
45165
  async function run16(rawArgs) {
44997
45166
  const parsed = ColorSmellCheckArgs(rawArgs);
44998
- if (parsed instanceof type76.errors) {
45167
+ if (parsed instanceof type77.errors) {
44999
45168
  return toolError(`Invalid arguments: ${parsed.summary}`);
45000
45169
  }
45001
45170
  const hasAny = parsed.paths && parsed.paths.length > 0 || parsed.glob;
@@ -45045,7 +45214,7 @@ async function resolveCrossReferenceTemplates(input) {
45045
45214
  let result;
45046
45215
  if (pathError === void 0) {
45047
45216
  try {
45048
- const inspection = await inspectColorTemplates3(resolve52(input.cwd, input.apiDir), input.apiDir);
45217
+ const inspection = await inspectColorTemplates3(resolve53(input.cwd, input.apiDir), input.apiDir);
45049
45218
  if (inspection.appExists) {
45050
45219
  const extracted = extractColorTemplates2(inspection);
45051
45220
  result = { kind: "value", value: extracted.templates };
@@ -45067,7 +45236,7 @@ var DBX_COLOR_SMELL_CHECK_TOOL = {
45067
45236
  };
45068
45237
 
45069
45238
  // packages/dbx-components-mcp/src/tools/lookup-action.tool.ts
45070
- import { type as type77 } from "arktype";
45239
+ import { type as type78 } from "arktype";
45071
45240
  var DBX_ACTION_LOOKUP_TOOL = {
45072
45241
  name: "dbx_action_lookup",
45073
45242
  description: [
@@ -45100,13 +45269,13 @@ var DBX_ACTION_LOOKUP_TOOL = {
45100
45269
  required: ["topic"]
45101
45270
  }
45102
45271
  };
45103
- var LookupActionArgsType = type77({
45272
+ var LookupActionArgsType = type78({
45104
45273
  topic: "string",
45105
45274
  "depth?": "'brief' | 'full'"
45106
45275
  });
45107
45276
  function parseLookupActionArgs(raw) {
45108
45277
  const parsed = LookupActionArgsType(raw);
45109
- if (parsed instanceof type77.errors) {
45278
+ if (parsed instanceof type78.errors) {
45110
45279
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
45111
45280
  }
45112
45281
  const result = {
@@ -45580,7 +45749,7 @@ function createSearchActionTool(config) {
45580
45749
  }
45581
45750
 
45582
45751
  // packages/dbx-components-mcp/src/tools/action-examples.tool.ts
45583
- import { type as type78 } from "arktype";
45752
+ import { type as type79 } from "arktype";
45584
45753
 
45585
45754
  // packages/dbx-components-mcp/src/tools/data/patterns/actions/action.auto-trigger-on-modify.pattern.ts
45586
45755
  var ACTION_PATTERN_AUTO_TRIGGER_ON_MODIFY = {
@@ -46017,13 +46186,13 @@ var DBX_ACTION_EXAMPLES_TOOL = {
46017
46186
  required: ["pattern"]
46018
46187
  }
46019
46188
  };
46020
- var ActionExamplesArgsType = type78({
46189
+ var ActionExamplesArgsType = type79({
46021
46190
  pattern: "string",
46022
46191
  "depth?": "'minimal' | 'brief' | 'full'"
46023
46192
  });
46024
46193
  function parseActionExamplesArgs(raw) {
46025
46194
  const parsed = ActionExamplesArgsType(raw);
46026
- if (parsed instanceof type78.errors) {
46195
+ if (parsed instanceof type79.errors) {
46027
46196
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46028
46197
  }
46029
46198
  const result = {
@@ -46085,7 +46254,7 @@ var ACTION_EXAMPLES_TOOL = {
46085
46254
  };
46086
46255
 
46087
46256
  // packages/dbx-components-mcp/src/tools/action-scaffold.tool.ts
46088
- import { type as type79 } from "arktype";
46257
+ import { type as type80 } from "arktype";
46089
46258
  var TRIGGER_VALUES = ["button", "form", "auto-modify"];
46090
46259
  var SUCCESS_FEEDBACK_VALUES = ["snackbar", "redirect", "none"];
46091
46260
  var CONTEXT_PROVIDER_VALUES = ["inline", "parent", "host-component"];
@@ -46119,7 +46288,7 @@ var DBX_ACTION_SCAFFOLD_TOOL = {
46119
46288
  required: ["use_case", "trigger", "value_type"]
46120
46289
  }
46121
46290
  };
46122
- var ScaffoldArgsType5 = type79({
46291
+ var ScaffoldArgsType5 = type80({
46123
46292
  use_case: "string",
46124
46293
  trigger: "'button' | 'form' | 'auto-modify'",
46125
46294
  "confirm?": "boolean",
@@ -46130,7 +46299,7 @@ var ScaffoldArgsType5 = type79({
46130
46299
  });
46131
46300
  function parseScaffoldArgs3(raw) {
46132
46301
  const parsed = ScaffoldArgsType5(raw);
46133
- if (parsed instanceof type79.errors) {
46302
+ if (parsed instanceof type80.errors) {
46134
46303
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46135
46304
  }
46136
46305
  const useCase = parsed.use_case.trim();
@@ -46356,14 +46525,14 @@ var ACTION_SCAFFOLD_TOOL = {
46356
46525
  };
46357
46526
 
46358
46527
  // packages/dbx-components-mcp/src/tools/route-tree.tool.ts
46359
- import { type as type80 } from "arktype";
46528
+ import { type as type81 } from "arktype";
46360
46529
 
46361
46530
  // packages/dbx-components-mcp/src/tools/route/load-sources.ts
46362
46531
  import { glob as fsGlob6, readFile as readFile24, stat as stat14 } from "node:fs/promises";
46363
- import { dirname as dirname18, isAbsolute as isAbsolute15, resolve as resolve53, sep as sep17 } from "node:path";
46532
+ import { dirname as dirname19, isAbsolute as isAbsolute16, resolve as resolve54, sep as sep17 } from "node:path";
46364
46533
  var TRY_EXTENSIONS2 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
46365
46534
  async function loadRouteSources(args) {
46366
- const cwdResolved = args.cwd ? resolve53(process.cwd(), args.cwd) : process.cwd();
46535
+ const cwdResolved = args.cwd ? resolve54(process.cwd(), args.cwd) : process.cwd();
46367
46536
  guardCwdInsideServer(args.cwd, cwdResolved);
46368
46537
  const collected = /* @__PURE__ */ new Map();
46369
46538
  if (args.sources) {
@@ -46374,8 +46543,8 @@ async function loadRouteSources(args) {
46374
46543
  }
46375
46544
  }
46376
46545
  const initialPaths = await collectInitialPaths(args, cwdResolved);
46377
- for (const relative22 of initialPaths) {
46378
- await loadOne(relative22, cwdResolved, collected);
46546
+ for (const relative23 of initialPaths) {
46547
+ await loadOne(relative23, cwdResolved, collected);
46379
46548
  }
46380
46549
  if (args.walkImports) {
46381
46550
  await walkRelativeImports(collected, cwdResolved);
@@ -46431,24 +46600,24 @@ async function walkRelativeImports(collected, cwdResolved) {
46431
46600
  }
46432
46601
  }
46433
46602
  }
46434
- async function loadOne(relative22, cwd, into) {
46435
- if (into.has(relative22)) {
46603
+ async function loadOne(relative23, cwd, into) {
46604
+ if (into.has(relative23)) {
46436
46605
  return;
46437
46606
  }
46438
- const absolute = resolve53(cwd, relative22);
46607
+ const absolute = resolve54(cwd, relative23);
46439
46608
  const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
46440
46609
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
46441
- throw new Error(`Path \`${relative22}\` resolves outside the server cwd and is not allowed.`);
46610
+ throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
46442
46611
  }
46443
46612
  const text = await readFile24(absolute, "utf8");
46444
- into.set(relative22, { name: relative22, text });
46613
+ into.set(relative23, { name: relative23, text });
46445
46614
  }
46446
46615
  async function resolveRelativeImport(fromFile, specifier, cwd) {
46447
46616
  let result;
46448
46617
  if (specifier.startsWith(".")) {
46449
- const fromAbsolute = isAbsolute15(fromFile) ? fromFile : resolve53(cwd, fromFile);
46450
- const fromDir = dirname18(fromAbsolute);
46451
- const baseAbsolute = resolve53(fromDir, specifier);
46618
+ const fromAbsolute = isAbsolute16(fromFile) ? fromFile : resolve54(cwd, fromFile);
46619
+ const fromDir = dirname19(fromAbsolute);
46620
+ const baseAbsolute = resolve54(fromDir, specifier);
46452
46621
  const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
46453
46622
  for (const ext of TRY_EXTENSIONS2) {
46454
46623
  const candidateAbsolute = baseAbsolute + ext;
@@ -46673,8 +46842,8 @@ var DBX_ROUTE_TREE_TOOL = {
46673
46842
  }
46674
46843
  }
46675
46844
  };
46676
- var TreeArgsType2 = type80({
46677
- "sources?": type80({ name: "string", text: "string" }).array(),
46845
+ var TreeArgsType2 = type81({
46846
+ "sources?": type81({ name: "string", text: "string" }).array(),
46678
46847
  "paths?": "string[]",
46679
46848
  "glob?": "string",
46680
46849
  "format?": "'markdown' | 'json' | 'flat'",
@@ -46683,7 +46852,7 @@ var TreeArgsType2 = type80({
46683
46852
  });
46684
46853
  function parseArgs8(raw) {
46685
46854
  const parsed = TreeArgsType2(raw);
46686
- if (parsed instanceof type80.errors) {
46855
+ if (parsed instanceof type81.errors) {
46687
46856
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46688
46857
  }
46689
46858
  const result = {
@@ -46739,7 +46908,7 @@ var ROUTE_TREE_TOOL = {
46739
46908
  };
46740
46909
 
46741
46910
  // packages/dbx-components-mcp/src/tools/route-lookup.tool.ts
46742
- import { type as type81 } from "arktype";
46911
+ import { type as type82 } from "arktype";
46743
46912
 
46744
46913
  // packages/dbx-components-mcp/src/tools/route/page-models.ts
46745
46914
  function buildPageModelsIndex(sources) {
@@ -46799,9 +46968,9 @@ var DBX_ROUTE_LOOKUP_TOOL = {
46799
46968
  required: ["topic"]
46800
46969
  }
46801
46970
  };
46802
- var LookupArgsType4 = type81({
46971
+ var LookupArgsType4 = type82({
46803
46972
  topic: "string",
46804
- "sources?": type81({ name: "string", text: "string" }).array(),
46973
+ "sources?": type82({ name: "string", text: "string" }).array(),
46805
46974
  "paths?": "string[]",
46806
46975
  "glob?": "string",
46807
46976
  "depth?": "'brief' | 'full'",
@@ -46809,7 +46978,7 @@ var LookupArgsType4 = type81({
46809
46978
  });
46810
46979
  function parseArgs9(raw) {
46811
46980
  const parsed = LookupArgsType4(raw);
46812
- if (parsed instanceof type81.errors) {
46981
+ if (parsed instanceof type82.errors) {
46813
46982
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
46814
46983
  }
46815
46984
  const result = {
@@ -47034,7 +47203,7 @@ var ROUTE_LOOKUP_TOOL = {
47034
47203
  };
47035
47204
 
47036
47205
  // packages/dbx-components-mcp/src/tools/route-search.tool.ts
47037
- import { type as type82 } from "arktype";
47206
+ import { type as type83 } from "arktype";
47038
47207
  var DBX_ROUTE_SEARCH_TOOL = {
47039
47208
  name: "dbx_route_search",
47040
47209
  description: [
@@ -47062,9 +47231,9 @@ var DBX_ROUTE_SEARCH_TOOL = {
47062
47231
  required: ["query"]
47063
47232
  }
47064
47233
  };
47065
- var SearchArgsType4 = type82({
47234
+ var SearchArgsType4 = type83({
47066
47235
  query: "string",
47067
- "sources?": type82({ name: "string", text: "string" }).array(),
47236
+ "sources?": type83({ name: "string", text: "string" }).array(),
47068
47237
  "paths?": "string[]",
47069
47238
  "glob?": "string",
47070
47239
  "scope?": "'name' | 'url' | 'component' | 'resolve' | 'all'",
@@ -47072,7 +47241,7 @@ var SearchArgsType4 = type82({
47072
47241
  });
47073
47242
  function parseArgs10(raw) {
47074
47243
  const parsed = SearchArgsType4(raw);
47075
- if (parsed instanceof type82.errors) {
47244
+ if (parsed instanceof type83.errors) {
47076
47245
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47077
47246
  }
47078
47247
  const result = {
@@ -47171,18 +47340,18 @@ var ROUTE_SEARCH_TOOL = {
47171
47340
  };
47172
47341
 
47173
47342
  // packages/dbx-components-mcp/src/tools/route-resolve-url.tool.ts
47174
- import { type as type83 } from "arktype";
47343
+ import { type as type84 } from "arktype";
47175
47344
 
47176
47345
  // packages/dbx-components-mcp/src/tools/route/resolve-url.ts
47177
47346
  import { readFile as readFile26, stat as stat15 } from "node:fs/promises";
47178
- import { dirname as dirname20, isAbsolute as isAbsolute16, resolve as resolve55, sep as sep19 } from "node:path";
47347
+ import { dirname as dirname21, isAbsolute as isAbsolute17, resolve as resolve56, sep as sep19 } from "node:path";
47179
47348
 
47180
47349
  // packages/dbx-components-mcp/src/tools/route/app-port-map.ts
47181
47350
  import { glob as fsGlob7, readFile as readFile25 } from "node:fs/promises";
47182
- import { dirname as dirname19, resolve as resolve54, sep as sep18 } from "node:path";
47351
+ import { dirname as dirname20, resolve as resolve55, sep as sep18 } from "node:path";
47183
47352
  var CACHE = /* @__PURE__ */ new Map();
47184
47353
  async function loadAppPortMap(cwd) {
47185
- const resolved = cwd ? resolve54(process.cwd(), cwd) : process.cwd();
47354
+ const resolved = cwd ? resolve55(process.cwd(), cwd) : process.cwd();
47186
47355
  let pending = CACHE.get(resolved);
47187
47356
  if (!pending) {
47188
47357
  pending = scanAppPortMap(resolved);
@@ -47193,8 +47362,8 @@ async function loadAppPortMap(cwd) {
47193
47362
  async function scanAppPortMap(cwdResolved) {
47194
47363
  const entries = [];
47195
47364
  for await (const match of fsGlob7("apps/*/project.json", { cwd: cwdResolved })) {
47196
- const projectRoot = dirname19(match);
47197
- const absolute = resolve54(cwdResolved, match);
47365
+ const projectRoot = dirname20(match);
47366
+ const absolute = resolve55(cwdResolved, match);
47198
47367
  const entry = await readEntry({ projectJsonAbsolute: absolute, projectRoot });
47199
47368
  if (entry) {
47200
47369
  entries.push(entry);
@@ -47422,8 +47591,8 @@ function collectSiblings(node) {
47422
47591
  }
47423
47592
  var TRY_EXTENSIONS3 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
47424
47593
  async function resolveComponentFile(input) {
47425
- const cwdResolved = input.cwd ? resolve55(process.cwd(), input.cwd) : process.cwd();
47426
- const routerAbsolute = isAbsolute16(input.routerFile) ? input.routerFile : resolve55(cwdResolved, input.routerFile);
47594
+ const cwdResolved = input.cwd ? resolve56(process.cwd(), input.cwd) : process.cwd();
47595
+ const routerAbsolute = isAbsolute17(input.routerFile) ? input.routerFile : resolve56(cwdResolved, input.routerFile);
47427
47596
  let text;
47428
47597
  try {
47429
47598
  text = await readFile26(routerAbsolute, "utf8");
@@ -47444,8 +47613,8 @@ async function resolveSpecifierToFile(input) {
47444
47613
  if (!specifier.startsWith(".")) {
47445
47614
  return { path: specifier, moduleSpecifier: specifier };
47446
47615
  }
47447
- const fromDir = dirname20(routerAbsolute);
47448
- const baseAbsolute = resolve55(fromDir, specifier);
47616
+ const fromDir = dirname21(routerAbsolute);
47617
+ const baseAbsolute = resolve56(fromDir, specifier);
47449
47618
  const cwdPrefix = cwdResolved.endsWith(sep19) ? cwdResolved : cwdResolved + sep19;
47450
47619
  let resolved;
47451
47620
  for (const ext of TRY_EXTENSIONS3) {
@@ -47531,7 +47700,7 @@ var DBX_ROUTE_RESOLVE_URL_TOOL = {
47531
47700
  required: ["url"]
47532
47701
  }
47533
47702
  };
47534
- var ResolveUrlArgsType = type83({
47703
+ var ResolveUrlArgsType = type84({
47535
47704
  url: "string",
47536
47705
  "app?": "string",
47537
47706
  "cwd?": "string",
@@ -47540,7 +47709,7 @@ var ResolveUrlArgsType = type83({
47540
47709
  });
47541
47710
  function parseArgs11(raw) {
47542
47711
  const parsed = ResolveUrlArgsType(raw);
47543
- if (parsed instanceof type83.errors) {
47712
+ if (parsed instanceof type84.errors) {
47544
47713
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47545
47714
  }
47546
47715
  const result = {
@@ -47780,14 +47949,14 @@ var ROUTE_RESOLVE_URL_TOOL = {
47780
47949
  };
47781
47950
 
47782
47951
  // packages/dbx-components-mcp/src/tools/_lookup.factory.ts
47783
- import { type as type84 } from "arktype";
47784
- var LOOKUP_ARGS_TYPE = type84({
47952
+ import { type as type85 } from "arktype";
47953
+ var LOOKUP_ARGS_TYPE = type85({
47785
47954
  topic: "string",
47786
47955
  "depth?": "'brief' | 'full'"
47787
47956
  });
47788
47957
  function parseLookupArgs(raw) {
47789
47958
  const parsed = LOOKUP_ARGS_TYPE(raw);
47790
- if (parsed instanceof type84.errors) {
47959
+ if (parsed instanceof type85.errors) {
47791
47960
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
47792
47961
  }
47793
47962
  const result = {
@@ -47991,7 +48160,7 @@ function createLookupFilterTool(input) {
47991
48160
  }
47992
48161
 
47993
48162
  // packages/dbx-components-mcp/src/tools/filter-scaffold.tool.ts
47994
- import { type as type85 } from "arktype";
48163
+ import { type as type86 } from "arktype";
47995
48164
  var DBX_FILTER_SCAFFOLD_TOOL = {
47996
48165
  name: "dbx_filter_scaffold",
47997
48166
  description: [
@@ -48016,7 +48185,7 @@ var DBX_FILTER_SCAFFOLD_TOOL = {
48016
48185
  required: ["model_name", "filter_type"]
48017
48186
  }
48018
48187
  };
48019
- var ScaffoldArgsType6 = type85({
48188
+ var ScaffoldArgsType6 = type86({
48020
48189
  model_name: "string",
48021
48190
  filter_type: "string",
48022
48191
  "preset_keys?": "string[]",
@@ -48024,7 +48193,7 @@ var ScaffoldArgsType6 = type85({
48024
48193
  });
48025
48194
  function parseArgs12(raw) {
48026
48195
  const parsed = ScaffoldArgsType6(raw);
48027
- if (parsed instanceof type85.errors) {
48196
+ if (parsed instanceof type86.errors) {
48028
48197
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
48029
48198
  }
48030
48199
  const modelName = parsed.model_name.trim();
@@ -49086,10 +49255,10 @@ function createSearchModelSnapshotFieldTool(config) {
49086
49255
 
49087
49256
  // packages/dbx-components-mcp/src/tools/list-app-model-snapshot-fields.tool.ts
49088
49257
  import { glob, readFile as readFile27 } from "node:fs/promises";
49089
- import { resolve as resolve56 } from "node:path";
49090
- import { type as type86 } from "arktype";
49258
+ import { resolve as resolve57 } from "node:path";
49259
+ import { type as type87 } from "arktype";
49091
49260
  import { Node as Node37, Project as Project22 } from "ts-morph";
49092
- var ListAppArgsType4 = type86({
49261
+ var ListAppArgsType4 = type87({
49093
49262
  componentDir: "string",
49094
49263
  "apiDir?": "string",
49095
49264
  "format?": "'markdown' | 'json'"
@@ -49124,7 +49293,7 @@ function createListAppModelSnapshotFieldsTool(input) {
49124
49293
  async function run24(rawArgs) {
49125
49294
  const parsed = ListAppArgsType4(rawArgs);
49126
49295
  let result;
49127
- if (parsed instanceof type86.errors) {
49296
+ if (parsed instanceof type87.errors) {
49128
49297
  result = toolError(`Invalid arguments: ${parsed.summary}`);
49129
49298
  } else {
49130
49299
  const cwd = process.cwd();
@@ -49138,8 +49307,8 @@ function createListAppModelSnapshotFieldsTool(input) {
49138
49307
  pathError = err instanceof Error ? err.message : String(err);
49139
49308
  }
49140
49309
  if (pathError === void 0) {
49141
- const componentAbs = resolve56(cwd, parsed.componentDir);
49142
- const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve56(cwd, parsed.apiDir);
49310
+ const componentAbs = resolve57(cwd, parsed.componentDir);
49311
+ const apiAbs = parsed.apiDir === void 0 ? void 0 : resolve57(cwd, parsed.apiDir);
49143
49312
  let report;
49144
49313
  let buildError;
49145
49314
  try {
@@ -49188,14 +49357,14 @@ async function buildListAppReport(input) {
49188
49357
  const project = new Project22({ useInMemoryFileSystem: true, skipAddingFilesFromTsConfig: true });
49189
49358
  const componentFiles = await collectFiles(componentAbs, COMPONENT_MODEL_GLOBS);
49190
49359
  for (const rel of componentFiles) {
49191
- const abs = resolve56(componentAbs, rel);
49360
+ const abs = resolve57(componentAbs, rel);
49192
49361
  const text = await readFile27(abs, "utf-8");
49193
49362
  project.createSourceFile(`/component/${rel}`, text, { overwrite: true });
49194
49363
  }
49195
49364
  if (apiAbs !== void 0) {
49196
49365
  const apiFiles = await collectFiles(apiAbs, API_MODEL_GLOBS);
49197
49366
  for (const rel of apiFiles) {
49198
- const abs = resolve56(apiAbs, rel);
49367
+ const abs = resolve57(apiAbs, rel);
49199
49368
  const text = await readFile27(abs, "utf-8");
49200
49369
  project.createSourceFile(`/api/${rel}`, text, { overwrite: true });
49201
49370
  }
@@ -49801,9 +49970,9 @@ function createSearchModelFirebaseIndexTool(config) {
49801
49970
  }
49802
49971
 
49803
49972
  // packages/dbx-components-mcp/src/tools/list-app-model-firebase-index.tool.ts
49804
- import { resolve as resolve57 } from "node:path";
49805
- import { type as type87 } from "arktype";
49806
- var ListAppArgsType5 = type87({
49973
+ import { resolve as resolve58 } from "node:path";
49974
+ import { type as type88 } from "arktype";
49975
+ var ListAppArgsType5 = type88({
49807
49976
  componentDir: "string",
49808
49977
  "format?": "'markdown' | 'json'",
49809
49978
  "model?": "string",
@@ -49852,7 +50021,7 @@ var DBX_MODEL_FIREBASE_INDEX_LIST_APP_TOOL = {
49852
50021
  async function runListAppModelFirebaseIndex(rawArgs) {
49853
50022
  const parsed = ListAppArgsType5(rawArgs);
49854
50023
  let result;
49855
- if (parsed instanceof type87.errors) {
50024
+ if (parsed instanceof type88.errors) {
49856
50025
  result = toolError(`Invalid arguments: ${parsed.summary}`);
49857
50026
  } else {
49858
50027
  const cwd = process.cwd();
@@ -49863,7 +50032,7 @@ async function runListAppModelFirebaseIndex(rawArgs) {
49863
50032
  pathError = err instanceof Error ? err.message : String(err);
49864
50033
  }
49865
50034
  if (pathError === void 0) {
49866
- const componentAbs = resolve57(cwd, parsed.componentDir);
50035
+ const componentAbs = resolve58(cwd, parsed.componentDir);
49867
50036
  const filters = {
49868
50037
  model: parsed.model,
49869
50038
  category: parsed.category,
@@ -50259,8 +50428,8 @@ function formatReportAsJson16(report) {
50259
50428
 
50260
50429
  // packages/dbx-components-mcp/src/tools/validate-app-model-firebase-index.tool.ts
50261
50430
  import { readFile as readFile28 } from "node:fs/promises";
50262
- import { resolve as resolve58 } from "node:path";
50263
- import { type as type88 } from "arktype";
50431
+ import { resolve as resolve59 } from "node:path";
50432
+ import { type as type89 } from "arktype";
50264
50433
 
50265
50434
  // packages/dbx-components-mcp/src/tools/model-firebase-index-validate-app/format-warnings.ts
50266
50435
  function mapModelFirebaseIndexBuildWarning(warning) {
@@ -50475,7 +50644,7 @@ function buildFirebaseIndexValidateAppViolation(mapped) {
50475
50644
  }
50476
50645
 
50477
50646
  // packages/dbx-components-mcp/src/tools/validate-app-model-firebase-index.tool.ts
50478
- var ValidateAppArgsType2 = type88({
50647
+ var ValidateAppArgsType2 = type89({
50479
50648
  componentDir: "string",
50480
50649
  "indexesFile?": "string",
50481
50650
  "format?": "'markdown' | 'json'"
@@ -50597,7 +50766,7 @@ var DBX_MODEL_FIREBASE_INDEX_VALIDATE_APP_TOOL = {
50597
50766
  };
50598
50767
  async function runValidateAppModelFirebaseIndex(rawArgs) {
50599
50768
  const parsed = ValidateAppArgsType2(rawArgs);
50600
- if (parsed instanceof type88.errors) {
50769
+ if (parsed instanceof type89.errors) {
50601
50770
  return toolError(`Invalid arguments: ${parsed.summary}`);
50602
50771
  }
50603
50772
  const cwd = process.cwd();
@@ -50613,8 +50782,8 @@ async function runValidateAppModelFirebaseIndex(rawArgs) {
50613
50782
  }
50614
50783
  if (ensureError === void 0) {
50615
50784
  const indexesRelative = parsed.indexesFile ?? "firestore.indexes.json";
50616
- const componentAbs = resolve58(cwd, parsed.componentDir);
50617
- const indexesAbs = resolve58(cwd, indexesRelative);
50785
+ const componentAbs = resolve59(cwd, parsed.componentDir);
50786
+ const indexesAbs = resolve59(cwd, indexesRelative);
50618
50787
  let report;
50619
50788
  let buildError;
50620
50789
  try {
@@ -50968,8 +51137,8 @@ function formatReportAsJson17(report) {
50968
51137
 
50969
51138
  // packages/dbx-components-mcp/src/tools/artifact-scaffold.tool.ts
50970
51139
  import { access } from "node:fs/promises";
50971
- import { resolve as resolve59, sep as sep20 } from "node:path";
50972
- import { type as type89 } from "arktype";
51140
+ import { resolve as resolve60, sep as sep20 } from "node:path";
51141
+ import { type as type90 } from "arktype";
50973
51142
 
50974
51143
  // packages/dbx-components-mcp/src/tools/artifact-scaffold/templates.ts
50975
51144
  function splitWords(input) {
@@ -51539,7 +51708,7 @@ var DBX_ARTIFACT_SCAFFOLD_TOOL = {
51539
51708
  required: ["artifact", "name", "componentDir", "apiDir"]
51540
51709
  }
51541
51710
  };
51542
- var ScaffoldArtifactArgsType = type89({
51711
+ var ScaffoldArtifactArgsType = type90({
51543
51712
  artifact: ARTIFACT_KIND_LITERAL_UNION,
51544
51713
  name: "string",
51545
51714
  componentDir: "string",
@@ -51552,7 +51721,7 @@ var ScaffoldArtifactArgsType = type89({
51552
51721
  });
51553
51722
  function parseArgs13(raw) {
51554
51723
  const parsed = ScaffoldArtifactArgsType(raw);
51555
- if (parsed instanceof type89.errors) {
51724
+ if (parsed instanceof type90.errors) {
51556
51725
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
51557
51726
  }
51558
51727
  const result = {
@@ -51565,7 +51734,7 @@ function parseArgs13(raw) {
51565
51734
  return result;
51566
51735
  }
51567
51736
  function ensureInsideCwd(relativePath, cwd) {
51568
- const absolute = resolve59(cwd, relativePath);
51737
+ const absolute = resolve60(cwd, relativePath);
51569
51738
  const cwdPrefix = cwd.endsWith(sep20) ? cwd : cwd + sep20;
51570
51739
  if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
51571
51740
  throw new Error(`Path \`${relativePath}\` resolves outside the server cwd and is not allowed.`);
@@ -51604,7 +51773,7 @@ async function runArtifactScaffold(rawArgs) {
51604
51773
  scaffoldError = `Scaffold failed: ${message}`;
51605
51774
  }
51606
51775
  if (scaffoldError === void 0) {
51607
- const checked = await applyIdempotency(raw, (relativePath) => fileExists4(resolve59(cwd, relativePath)));
51776
+ const checked = await applyIdempotency(raw, (relativePath) => fileExists4(resolve60(cwd, relativePath)));
51608
51777
  const text = formatResult21(checked);
51609
51778
  result = { content: [{ type: "text", text }] };
51610
51779
  } else {
@@ -51625,7 +51794,7 @@ var ARTIFACT_SCAFFOLD_TOOL = {
51625
51794
  };
51626
51795
 
51627
51796
  // packages/dbx-components-mcp/src/tools/artifact-file-convention.tool.ts
51628
- import { type as type90 } from "arktype";
51797
+ import { type as type91 } from "arktype";
51629
51798
 
51630
51799
  // packages/dbx-components-mcp/src/tools/artifact-file-convention/spec.ts
51631
51800
  var FIRESTORE_MODEL = {
@@ -52101,7 +52270,7 @@ var DBX_ARTIFACT_FILE_CONVENTION_TOOL = {
52101
52270
  required: ["artifact"]
52102
52271
  }
52103
52272
  };
52104
- var FileConventionArgsType = type90({
52273
+ var FileConventionArgsType = type91({
52105
52274
  artifact: ARTIFACT_KIND_LITERAL_UNION2,
52106
52275
  "componentDir?": "string",
52107
52276
  "apiDir?": "string",
@@ -52109,7 +52278,7 @@ var FileConventionArgsType = type90({
52109
52278
  });
52110
52279
  function parseArgs14(raw) {
52111
52280
  const parsed = FileConventionArgsType(raw);
52112
- if (parsed instanceof type90.errors) {
52281
+ if (parsed instanceof type91.errors) {
52113
52282
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
52114
52283
  }
52115
52284
  const result = {
@@ -52143,8 +52312,8 @@ var ARTIFACT_FILE_CONVENTION_TOOL = {
52143
52312
  };
52144
52313
 
52145
52314
  // packages/dbx-components-mcp/src/tools/explain-rule.tool.ts
52146
- import { type as type91 } from "arktype";
52147
- var ExplainRuleArgsType = type91({
52315
+ import { type as type92 } from "arktype";
52316
+ var ExplainRuleArgsType = type92({
52148
52317
  "code?": "string",
52149
52318
  "source?": "string",
52150
52319
  "severity?": "'error' | 'warning'",
@@ -52187,7 +52356,7 @@ var TOOL16 = {
52187
52356
  };
52188
52357
  async function run17(rawArgs) {
52189
52358
  const parsed = ExplainRuleArgsType(rawArgs);
52190
- if (parsed instanceof type91.errors) {
52359
+ if (parsed instanceof type92.errors) {
52191
52360
  return toolError(`Invalid arguments: ${parsed.summary}`);
52192
52361
  }
52193
52362
  if (parsed.code !== void 0) {
@@ -52275,9 +52444,9 @@ function groupBySource(entries) {
52275
52444
  var EXPLAIN_RULE_TOOL = { definition: TOOL16, run: run17 };
52276
52445
 
52277
52446
  // packages/dbx-components-mcp/src/tools/app-validate.tool.ts
52278
- import { resolve as resolve60, join as join25 } from "node:path";
52447
+ import { resolve as resolve61, join as join25 } from "node:path";
52279
52448
  import { readdir as readdir11, readFile as readFile29, stat as stat16 } from "node:fs/promises";
52280
- import { type as type92 } from "arktype";
52449
+ import { type as type93 } from "arktype";
52281
52450
  var { inspectAppStorageFiles: inspectAppStorageFiles4, validateAppStorageFiles: validateAppStorageFiles3 } = storagefile_m_validate_app_exports;
52282
52451
  var { inspectAppNotifications: inspectAppNotifications4, validateAppNotifications: validateAppNotifications3 } = notification_m_validate_app_exports;
52283
52452
  var { validateAppFixtures: validateAppFixtures3 } = model_fixture_shared_exports;
@@ -52289,7 +52458,7 @@ var { validateAppModelApi: validateAppModelApi3 } = model_api_validate_app_expor
52289
52458
  var { validateModelTestApp: validateModelTestApp3 } = model_test_validate_app_exports;
52290
52459
  var { extractComponentModels: extractComponentModels3 } = model_list_component_exports;
52291
52460
  var Cluster = "'storagefile_m' | 'notification_m' | 'model_folder' | 'system_m' | 'fixture' | 'manifest' | 'model_api' | 'firebase_index' | 'asset' | 'model_test'";
52292
- var AppValidateArgsType = type92({
52461
+ var AppValidateArgsType = type93({
52293
52462
  componentDir: "string",
52294
52463
  apiDir: "string",
52295
52464
  "webDir?": "string",
@@ -52345,17 +52514,17 @@ var TOOL17 = {
52345
52514
  };
52346
52515
  async function run18(rawArgs) {
52347
52516
  const parsed = AppValidateArgsType(rawArgs);
52348
- if (parsed instanceof type92.errors) {
52517
+ if (parsed instanceof type93.errors) {
52349
52518
  return toolError(`Invalid arguments: ${parsed.summary}`);
52350
52519
  }
52351
52520
  const cwd = process.cwd();
52352
52521
  const pathCheck = ensureArgPaths(parsed, cwd);
52353
52522
  if (pathCheck !== void 0) return pathCheck;
52354
- const componentAbs = resolve60(cwd, parsed.componentDir);
52355
- const apiAbs = resolve60(cwd, parsed.apiDir);
52356
- const webAbs = parsed.webDir === void 0 ? void 0 : resolve60(cwd, parsed.webDir);
52523
+ const componentAbs = resolve61(cwd, parsed.componentDir);
52524
+ const apiAbs = resolve61(cwd, parsed.apiDir);
52525
+ const webAbs = parsed.webDir === void 0 ? void 0 : resolve61(cwd, parsed.webDir);
52357
52526
  const indexesRel = parsed.indexesFile ?? "firestore.indexes.json";
52358
- const indexesAbs = resolve60(cwd, indexesRel);
52527
+ const indexesAbs = resolve61(cwd, indexesRel);
52359
52528
  const skip = new Set(parsed.skip ?? []);
52360
52529
  const findings = [];
52361
52530
  const skipped = [];
@@ -52713,9 +52882,9 @@ var APP_VALIDATE_TOOL = { definition: TOOL17, run: run18 };
52713
52882
 
52714
52883
  // packages/dbx-components-mcp/src/tools/firestore-rules-scan.tool.ts
52715
52884
  import { readFile as readFile30 } from "node:fs/promises";
52716
- import { resolve as resolve61 } from "node:path";
52717
- import { type as type93 } from "arktype";
52718
- var ScanArgsType = type93({
52885
+ import { resolve as resolve62 } from "node:path";
52886
+ import { type as type94 } from "arktype";
52887
+ var ScanArgsType = type94({
52719
52888
  "rulesFile?": "string",
52720
52889
  "collection?": "string",
52721
52890
  "serverOnly?": "boolean",
@@ -52821,7 +52990,7 @@ function formatFirestoreRulesScanReportAsMarkdown(report) {
52821
52990
  }
52822
52991
  async function run19(rawArgs) {
52823
52992
  const parsed = ScanArgsType(rawArgs ?? {});
52824
- if (parsed instanceof type93.errors) {
52993
+ if (parsed instanceof type94.errors) {
52825
52994
  return toolError(`Invalid arguments: ${parsed.summary}`);
52826
52995
  }
52827
52996
  const cwd = process.cwd();
@@ -52836,7 +53005,7 @@ async function run19(rawArgs) {
52836
53005
  if (failure === void 0) {
52837
53006
  let source;
52838
53007
  try {
52839
- source = await readFile30(resolve61(cwd, rulesFile), "utf8");
53008
+ source = await readFile30(resolve62(cwd, rulesFile), "utf8");
52840
53009
  } catch (err) {
52841
53010
  failure = `Failed to read ${rulesFile}: ${err instanceof Error ? err.message : String(err)}`;
52842
53011
  }
@@ -52858,8 +53027,8 @@ var FIRESTORE_RULES_SCAN_TOOL = { definition: TOOL18, run: run19 };
52858
53027
 
52859
53028
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app.tool.ts
52860
53029
  import { readdir as readdir12, readFile as readFile31, stat as stat17 } from "node:fs/promises";
52861
- import { join as join26, relative as relative19, resolve as resolve62 } from "node:path";
52862
- import { type as type94 } from "arktype";
53030
+ import { join as join26, relative as relative20, resolve as resolve63 } from "node:path";
53031
+ import { type as type95 } from "arktype";
52863
53032
 
52864
53033
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app/extract-service-flags.ts
52865
53034
  var SERVICE_FACTORY_TAG2 = /@dbxModelServiceFactory\s+([A-Za-z_$][\w$]*)/;
@@ -53180,7 +53349,7 @@ function buildViolation(input) {
53180
53349
  }
53181
53350
 
53182
53351
  // packages/dbx-components-mcp/src/tools/model-server-only-validate-app.tool.ts
53183
- var ValidateAppArgsType3 = type94({
53352
+ var ValidateAppArgsType3 = type95({
53184
53353
  componentDir: "string",
53185
53354
  "rulesFile?": "string",
53186
53355
  "serviceFile?": "string",
@@ -53234,10 +53403,10 @@ async function scanModelFacts(input) {
53234
53403
  const interfaces = /* @__PURE__ */ new Map();
53235
53404
  const identities = /* @__PURE__ */ new Map();
53236
53405
  for (const dir of input.dirs) {
53237
- for (const filePath of await walkTypeScriptFiles(resolve62(input.cwd, dir))) {
53406
+ for (const filePath of await walkTypeScriptFiles(resolve63(input.cwd, dir))) {
53238
53407
  const text = await readFile31(filePath, "utf8");
53239
53408
  if (!text.includes("firestoreModelIdentity(") && !text.includes("@dbxModel")) continue;
53240
- const relativePath = relative19(input.cwd, filePath);
53409
+ const relativePath = relative20(input.cwd, filePath);
53241
53410
  const extraction = extractModelsFromSource({ name: filePath, text });
53242
53411
  for (const iface of extraction.interfaces) {
53243
53412
  if (!interfaces.has(iface.name)) {
@@ -53283,7 +53452,7 @@ async function isDirectory5(path) {
53283
53452
  }
53284
53453
  async function run20(rawArgs) {
53285
53454
  const parsed = ValidateAppArgsType3(rawArgs);
53286
- if (parsed instanceof type94.errors) {
53455
+ if (parsed instanceof type95.errors) {
53287
53456
  return toolError(`Invalid arguments: ${parsed.summary}`);
53288
53457
  }
53289
53458
  const cwd = process.cwd();
@@ -53300,22 +53469,22 @@ async function run20(rawArgs) {
53300
53469
  if (failure !== void 0) {
53301
53470
  return toolError(failure);
53302
53471
  }
53303
- const rulesSource = await readOptionalFile(resolve62(cwd, rulesFile));
53472
+ const rulesSource = await readOptionalFile(resolve63(cwd, rulesFile));
53304
53473
  if (rulesSource === void 0) {
53305
53474
  return toolError(`Failed to read rules file \`${rulesFile}\`.`);
53306
53475
  }
53307
- const serviceSource = await readOptionalFile(resolve62(cwd, serviceFile));
53476
+ const serviceSource = await readOptionalFile(resolve63(cwd, serviceFile));
53308
53477
  if (serviceSource === void 0) {
53309
53478
  return toolError(`Failed to read service file \`${serviceFile}\`. Pass \`serviceFile\` when the component does not use the conventional \`src/lib/model/service.ts\` path.`);
53310
53479
  }
53311
53480
  const requestedDirs = [`${parsed.componentDir.replace(/[/\\]+$/, "")}/src/lib`, ...DEFAULT_UPSTREAM_MODEL_DIRS, ...parsed.modelDirs ?? []];
53312
53481
  const modelDirs = [];
53313
53482
  for (const dir of requestedDirs) {
53314
- if (!modelDirs.includes(dir) && await isDirectory5(resolve62(cwd, dir))) {
53483
+ if (!modelDirs.includes(dir) && await isDirectory5(resolve63(cwd, dir))) {
53315
53484
  modelDirs.push(dir);
53316
53485
  }
53317
53486
  }
53318
- const manifestSource = parsed.manifestFile === void 0 ? void 0 : await readOptionalFile(resolve62(cwd, parsed.manifestFile));
53487
+ const manifestSource = parsed.manifestFile === void 0 ? void 0 : await readOptionalFile(resolve63(cwd, parsed.manifestFile));
53319
53488
  if (parsed.manifestFile !== void 0 && manifestSource === void 0) {
53320
53489
  return toolError(`Failed to read model manifest \`${parsed.manifestFile}\`.`);
53321
53490
  }
@@ -53337,10 +53506,10 @@ async function run20(rawArgs) {
53337
53506
  var MODEL_SERVER_ONLY_VALIDATE_APP_TOOL = { definition: TOOL19, run: run20 };
53338
53507
 
53339
53508
  // packages/dbx-components-mcp/src/tools/model-list-component.tool.ts
53340
- import { resolve as resolve63 } from "node:path";
53341
- import { type as type95 } from "arktype";
53509
+ import { resolve as resolve64 } from "node:path";
53510
+ import { type as type96 } from "arktype";
53342
53511
  var { formatReportAsJson: formatReportAsJson18, formatReportAsMarkdown: formatReportAsMarkdown18, listComponentModels: listComponentModels2 } = model_list_component_exports;
53343
- var ListArgsType3 = type95({
53512
+ var ListArgsType3 = type96({
53344
53513
  componentDir: "string",
53345
53514
  "apiDir?": "string",
53346
53515
  "format?": "'markdown' | 'json'"
@@ -53371,7 +53540,7 @@ var TOOL20 = {
53371
53540
  };
53372
53541
  async function run21(rawArgs) {
53373
53542
  const parsed = ListArgsType3(rawArgs);
53374
- if (parsed instanceof type95.errors) {
53543
+ if (parsed instanceof type96.errors) {
53375
53544
  return toolError(`Invalid arguments: ${parsed.summary}`);
53376
53545
  }
53377
53546
  const cwd = process.cwd();
@@ -53384,8 +53553,8 @@ async function run21(rawArgs) {
53384
53553
  ensureError = err instanceof Error ? err.message : String(err);
53385
53554
  }
53386
53555
  if (ensureError === void 0) {
53387
- const componentAbs = resolve63(cwd, parsed.componentDir);
53388
- const apiAbs = parsed.apiDir ? resolve63(cwd, parsed.apiDir) : void 0;
53556
+ const componentAbs = resolve64(cwd, parsed.componentDir);
53557
+ const apiAbs = parsed.apiDir ? resolve64(cwd, parsed.apiDir) : void 0;
53389
53558
  let report;
53390
53559
  let listError;
53391
53560
  try {
@@ -53407,10 +53576,10 @@ async function run21(rawArgs) {
53407
53576
  var MODEL_LIST_COMPONENT_TOOL = { definition: TOOL20, run: run21 };
53408
53577
 
53409
53578
  // packages/dbx-components-mcp/src/tools/server-actions-list-app.tool.ts
53410
- import { resolve as resolve64 } from "node:path";
53411
- import { type as type96 } from "arktype";
53579
+ import { resolve as resolve65 } from "node:path";
53580
+ import { type as type97 } from "arktype";
53412
53581
  var { formatReportAsJson: formatReportAsJson19, formatReportAsMarkdown: formatReportAsMarkdown19, listAppServerActions: listAppServerActions2 } = server_actions_list_app_exports;
53413
- var ListArgsType4 = type96({
53582
+ var ListArgsType4 = type97({
53414
53583
  apiDir: "string",
53415
53584
  "format?": "'markdown' | 'json'"
53416
53585
  });
@@ -53439,7 +53608,7 @@ var TOOL21 = {
53439
53608
  };
53440
53609
  async function run22(rawArgs) {
53441
53610
  const parsed = ListArgsType4(rawArgs);
53442
- if (parsed instanceof type96.errors) {
53611
+ if (parsed instanceof type97.errors) {
53443
53612
  return toolError(`Invalid arguments: ${parsed.summary}`);
53444
53613
  }
53445
53614
  const cwd = process.cwd();
@@ -53451,7 +53620,7 @@ async function run22(rawArgs) {
53451
53620
  ensureError = err instanceof Error ? err.message : String(err);
53452
53621
  }
53453
53622
  if (ensureError === void 0) {
53454
- const apiAbs = resolve64(cwd, parsed.apiDir);
53623
+ const apiAbs = resolve65(cwd, parsed.apiDir);
53455
53624
  let report;
53456
53625
  let listError;
53457
53626
  try {
@@ -53473,16 +53642,16 @@ async function run22(rawArgs) {
53473
53642
  var SERVER_ACTIONS_LIST_APP_TOOL = { definition: TOOL21, run: run22 };
53474
53643
 
53475
53644
  // packages/dbx-components-mcp/src/tools/mcp-config.tool.ts
53476
- import { type as type97 } from "arktype";
53477
- import { resolve as resolve67 } from "node:path";
53645
+ import { type as type98 } from "arktype";
53646
+ import { resolve as resolve68 } from "node:path";
53478
53647
 
53479
53648
  // packages/dbx-components-mcp/src/tools/mcp-config/snapshot.ts
53480
- import { dirname as dirname21, isAbsolute as isAbsolute17, relative as relative20, resolve as resolve65 } from "node:path";
53649
+ import { dirname as dirname22, isAbsolute as isAbsolute18, relative as relative21, resolve as resolve66 } from "node:path";
53481
53650
  import { stat as stat18 } from "node:fs/promises";
53482
53651
  async function buildSnapshot(input) {
53483
53652
  const { workspaceRoot, explicitDirs } = input;
53484
53653
  const configResult = await findAndLoadConfig({ cwd: workspaceRoot });
53485
- const configBaseDir = configResult.configPath === null ? workspaceRoot : dirname21(configResult.configPath);
53654
+ const configBaseDir = configResult.configPath === null ? workspaceRoot : dirname22(configResult.configPath);
53486
53655
  const registeredSources = await collectRegisteredSources(configResult.config, configBaseDir, workspaceRoot);
53487
53656
  const packages = await discoverDownstreamPackages({ workspaceRoot, explicitDirs });
53488
53657
  const packageSnapshots = packages.map((pkg) => ({
@@ -53504,7 +53673,7 @@ async function collectRegisteredSources(config, configBaseDir, workspaceRoot) {
53504
53673
  for (const cluster of DOWNSTREAM_CLUSTERS) {
53505
53674
  const declared = config[cluster]?.sources ?? [];
53506
53675
  for (const declaredPath of declared) {
53507
- const absolutePath = isAbsolute17(declaredPath) ? declaredPath : resolve65(configBaseDir, declaredPath);
53676
+ const absolutePath = isAbsolute18(declaredPath) ? declaredPath : resolve66(configBaseDir, declaredPath);
53508
53677
  const exists = await fileExists5(absolutePath);
53509
53678
  const relativePath = relativeOrAbsolute(workspaceRoot, absolutePath);
53510
53679
  out.push({ cluster, declaredPath, absolutePath, relativePath, exists });
@@ -53536,7 +53705,7 @@ async function fileExists5(path) {
53536
53705
  return result;
53537
53706
  }
53538
53707
  function relativeOrAbsolute(from, target) {
53539
- const rel = relative20(from, target);
53708
+ const rel = relative21(from, target);
53540
53709
  if (rel.length === 0) return ".";
53541
53710
  if (rel.startsWith("..")) return target;
53542
53711
  return rel.replaceAll("\\", "/");
@@ -53544,7 +53713,7 @@ function relativeOrAbsolute(from, target) {
53544
53713
 
53545
53714
  // packages/dbx-components-mcp/src/tools/mcp-config/init.ts
53546
53715
  import { writeFile as nodeWriteFile4, mkdir as nodeMkdir, readFile as nodeReadFile8 } from "node:fs/promises";
53547
- import { dirname as dirname22, relative as relative21, resolve as resolve66 } from "node:path";
53716
+ import { dirname as dirname23, relative as relative22, resolve as resolve67 } from "node:path";
53548
53717
  var HEURISTIC_CLUSTERS = ["uiComponents", "forgeFields", "pipes", "actions", "filters"];
53549
53718
  var CLUSTER_FILENAME_SEGMENT = {
53550
53719
  semanticTypes: "semantic",
@@ -53583,7 +53752,7 @@ async function applyInitPlan(plan, opts) {
53583
53752
  const mkdir = opts?.mkdir ?? defaultMkdir;
53584
53753
  for (const change of plan.changes) {
53585
53754
  if (change.reason === "unchanged") continue;
53586
- await mkdir(dirname22(change.absolutePath));
53755
+ await mkdir(dirname23(change.absolutePath));
53587
53756
  await writeFile2(change.absolutePath, change.after);
53588
53757
  }
53589
53758
  }
@@ -53608,7 +53777,7 @@ function upsertClusterSection(input) {
53608
53777
  async function planPackageScanConfig(input) {
53609
53778
  const { snapshot, packageSnapshot, readFile: readFile33 } = input;
53610
53779
  const { pkg } = packageSnapshot;
53611
- const scanConfigPath = resolve66(pkg.absDir, "dbx-mcp.scan.json");
53780
+ const scanConfigPath = resolve67(pkg.absDir, "dbx-mcp.scan.json");
53612
53781
  const before = await tryRead(scanConfigPath, readFile33);
53613
53782
  const parsed = parseExisting(before);
53614
53783
  const targetClusters = HEURISTIC_CLUSTERS.filter((c) => pkg.candidateClusters.includes(c));
@@ -53638,7 +53807,7 @@ async function planPackageScanConfig(input) {
53638
53807
  }
53639
53808
  async function planRootConfig(input) {
53640
53809
  const { snapshot, sourcesToRegister, readFile: readFile33 } = input;
53641
- const configPath = snapshot.configPath ?? resolve66(snapshot.workspaceRoot, "dbx-mcp.config.json");
53810
+ const configPath = snapshot.configPath ?? resolve67(snapshot.workspaceRoot, "dbx-mcp.config.json");
53642
53811
  const before = snapshot.configPath === null ? null : await tryRead(configPath, readFile33);
53643
53812
  const baseConfig = snapshot.config === null ? { version: 1 } : cloneConfig(snapshot.config);
53644
53813
  if (baseConfig.version !== 1) baseConfig.version = 1;
@@ -53667,18 +53836,18 @@ async function planRootConfig(input) {
53667
53836
  };
53668
53837
  }
53669
53838
  function defaultOutFor(input) {
53670
- const targetAbs = resolve66(input.snapshot.workspaceRoot, ".tmp/dbx-mcp", `${input.slug}.${clusterFilenameSegment(input.cluster)}.json`);
53671
- return relative21(dirname22(input.scanConfigPath), targetAbs).replaceAll("\\", "/");
53839
+ const targetAbs = resolve67(input.snapshot.workspaceRoot, ".tmp/dbx-mcp", `${input.slug}.${clusterFilenameSegment(input.cluster)}.json`);
53840
+ return relative22(dirname23(input.scanConfigPath), targetAbs).replaceAll("\\", "/");
53672
53841
  }
53673
53842
  function resolveScanOut(scanConfigPath, out) {
53674
- return resolve66(dirname22(scanConfigPath), out);
53843
+ return resolve67(dirname23(scanConfigPath), out);
53675
53844
  }
53676
53845
  function relativeFromConfig(snapshot, absolute) {
53677
- const configDir = snapshot.configPath === null ? snapshot.workspaceRoot : dirname22(snapshot.configPath);
53678
- return relative21(configDir, absolute).replaceAll("\\", "/");
53846
+ const configDir = snapshot.configPath === null ? snapshot.workspaceRoot : dirname23(snapshot.configPath);
53847
+ return relative22(configDir, absolute).replaceAll("\\", "/");
53679
53848
  }
53680
53849
  function workspaceRel(workspaceRoot, absolute) {
53681
- const rel = relative21(workspaceRoot, absolute);
53850
+ const rel = relative22(workspaceRoot, absolute);
53682
53851
  if (rel.length === 0) return ".";
53683
53852
  return rel.replaceAll("\\", "/");
53684
53853
  }
@@ -54007,7 +54176,7 @@ var TOOL22 = {
54007
54176
  required: ["op"]
54008
54177
  }
54009
54178
  };
54010
- var McpConfigArgsType = type97({
54179
+ var McpConfigArgsType = type98({
54011
54180
  op: "'status' | 'validate' | 'init' | 'refresh'",
54012
54181
  "cwd?": "string",
54013
54182
  "dryRun?": "boolean",
@@ -54015,10 +54184,10 @@ var McpConfigArgsType = type97({
54015
54184
  });
54016
54185
  function parseArgs15(rawArgs, defaultCwd) {
54017
54186
  const parsed = McpConfigArgsType(rawArgs);
54018
- if (parsed instanceof type97.errors) {
54187
+ if (parsed instanceof type98.errors) {
54019
54188
  return `Invalid arguments: ${parsed.summary}`;
54020
54189
  }
54021
- const workspaceRoot = parsed.cwd !== void 0 && parsed.cwd.length > 0 ? resolve67(defaultCwd, parsed.cwd) : defaultCwd;
54190
+ const workspaceRoot = parsed.cwd !== void 0 && parsed.cwd.length > 0 ? resolve68(defaultCwd, parsed.cwd) : defaultCwd;
54022
54191
  const invalidDirError = validateExplicitDirs(parsed.explicitDirs, workspaceRoot);
54023
54192
  let result;
54024
54193
  if (invalidDirError === void 0) {
@@ -54087,12 +54256,12 @@ var MCP_CONFIG_TOOL = {
54087
54256
  };
54088
54257
 
54089
54258
  // packages/dbx-components-mcp/src/tools/log-search.tool.ts
54090
- import { type as type98 } from "arktype";
54259
+ import { type as type99 } from "arktype";
54091
54260
  import { basename as basename10 } from "node:path";
54092
54261
 
54093
54262
  // packages/dbx-components-mcp/src/tools/log-search/discover-logs.ts
54094
54263
  import { readdir as readdir13, stat as stat19 } from "node:fs/promises";
54095
- import { basename as basename9, join as join27, resolve as resolve68 } from "node:path";
54264
+ import { basename as basename9, join as join27, resolve as resolve69 } from "node:path";
54096
54265
  var DBX_LOG_PATH_ENV_VAR = "DBX_LOG_PATH";
54097
54266
  function resolveLogBasePath(input) {
54098
54267
  let result;
@@ -54100,11 +54269,11 @@ function resolveLogBasePath(input) {
54100
54269
  const fromEnv = input.env[DBX_LOG_PATH_ENV_VAR]?.trim();
54101
54270
  const fromConfig = input.configBasePath?.trim();
54102
54271
  if (fromArg !== void 0 && fromArg.length > 0) {
54103
- result = { kind: "ok", absolutePath: resolve68(fromArg), source: "arg" };
54272
+ result = { kind: "ok", absolutePath: resolve69(fromArg), source: "arg" };
54104
54273
  } else if (fromEnv !== void 0 && fromEnv.length > 0) {
54105
- result = { kind: "ok", absolutePath: resolve68(fromEnv), source: "env" };
54274
+ result = { kind: "ok", absolutePath: resolve69(fromEnv), source: "env" };
54106
54275
  } else if (fromConfig !== void 0 && fromConfig.length > 0) {
54107
- result = { kind: "ok", absolutePath: resolve68(fromConfig), source: "config" };
54276
+ result = { kind: "ok", absolutePath: resolve69(fromConfig), source: "config" };
54108
54277
  } else {
54109
54278
  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.` };
54110
54279
  }
@@ -54500,7 +54669,7 @@ var DBX_LOG_SEARCH_TOOL = {
54500
54669
  }
54501
54670
  }
54502
54671
  };
54503
- var LogSearchArgsType = type98({
54672
+ var LogSearchArgsType = type99({
54504
54673
  "query?": "string",
54505
54674
  "mode?": "'fuzzy' | 'keyword' | 'list'",
54506
54675
  "basePath?": "string",
@@ -54513,7 +54682,7 @@ var LogSearchArgsType = type98({
54513
54682
  });
54514
54683
  function parseArgs16(input) {
54515
54684
  const parsed = LogSearchArgsType(input.raw ?? {});
54516
- if (parsed instanceof type98.errors) {
54685
+ if (parsed instanceof type99.errors) {
54517
54686
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54518
54687
  }
54519
54688
  const rawQuery = parsed.query?.trim();
@@ -54635,7 +54804,7 @@ function createLogSearchTool(config) {
54635
54804
  var LOG_SEARCH_TOOL = createLogSearchTool();
54636
54805
 
54637
54806
  // packages/dbx-components-mcp/src/tools/lookup-semantic-type.tool.ts
54638
- import { type as type99 } from "arktype";
54807
+ import { type as type100 } from "arktype";
54639
54808
 
54640
54809
  // packages/dbx-components-mcp/src/tools/semantic-type-lookup.formatter.ts
54641
54810
  function formatSemanticTypeEntry(entry, depth) {
@@ -54811,13 +54980,13 @@ var DBX_SEMANTIC_TYPE_LOOKUP_TOOL = {
54811
54980
  required: ["name"]
54812
54981
  }
54813
54982
  };
54814
- var LookupSemanticTypeArgsType = type99({
54983
+ var LookupSemanticTypeArgsType = type100({
54815
54984
  name: "string",
54816
54985
  "depth?": "'brief' | 'full'"
54817
54986
  });
54818
54987
  function parseLookupArgs2(raw) {
54819
54988
  const parsed = LookupSemanticTypeArgsType(raw);
54820
- if (parsed instanceof type99.errors) {
54989
+ if (parsed instanceof type100.errors) {
54821
54990
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54822
54991
  }
54823
54992
  const result = {
@@ -54879,7 +55048,7 @@ function formatNotFound16(name, registry) {
54879
55048
  }
54880
55049
 
54881
55050
  // packages/dbx-components-mcp/src/tools/search-semantic-type.tool.ts
54882
- import { type as type100 } from "arktype";
55051
+ import { type as type101 } from "arktype";
54883
55052
  var DEFAULT_LIMIT9 = 25;
54884
55053
  var MAX_LIMIT8 = 100;
54885
55054
  var DBX_SEMANTIC_TYPE_SEARCH_TOOL = {
@@ -54912,7 +55081,7 @@ var DBX_SEMANTIC_TYPE_SEARCH_TOOL = {
54912
55081
  }
54913
55082
  }
54914
55083
  };
54915
- var SearchSemanticTypeArgsType = type100({
55084
+ var SearchSemanticTypeArgsType = type101({
54916
55085
  "topic?": "string",
54917
55086
  "baseType?": "string",
54918
55087
  "package?": "string",
@@ -54921,7 +55090,7 @@ var SearchSemanticTypeArgsType = type100({
54921
55090
  });
54922
55091
  function parseSearchArgs2(raw) {
54923
55092
  const parsed = SearchSemanticTypeArgsType(raw);
54924
- if (parsed instanceof type100.errors) {
55093
+ if (parsed instanceof type101.errors) {
54925
55094
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
54926
55095
  }
54927
55096
  const rawLimit = parsed.limit ?? DEFAULT_LIMIT9;
@@ -55038,7 +55207,7 @@ function describeFilters(args) {
55038
55207
  }
55039
55208
 
55040
55209
  // packages/dbx-components-mcp/src/tools/css-token-lookup.tool.ts
55041
- import { type as type101 } from "arktype";
55210
+ import { type as type102 } from "arktype";
55042
55211
 
55043
55212
  // packages/dbx-components-mcp/src/tools/css-token-lookup/synonyms.ts
55044
55213
  var INTENT_SYNONYMS = /* @__PURE__ */ new Map([
@@ -55607,7 +55776,7 @@ var DBX_CSS_TOKEN_LOOKUP_TOOL = {
55607
55776
  }
55608
55777
  }
55609
55778
  };
55610
- var CssTokenLookupArgs = type101({
55779
+ var CssTokenLookupArgs = type102({
55611
55780
  "intent?": "string",
55612
55781
  "value?": "string",
55613
55782
  "role?": "string",
@@ -55616,7 +55785,7 @@ var CssTokenLookupArgs = type101({
55616
55785
  });
55617
55786
  function parseArgs17(raw) {
55618
55787
  const parsed = CssTokenLookupArgs(raw);
55619
- if (parsed instanceof type101.errors) {
55788
+ if (parsed instanceof type102.errors) {
55620
55789
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
55621
55790
  }
55622
55791
  const result = {
@@ -55648,7 +55817,7 @@ function createCssTokenLookupTool(input) {
55648
55817
  }
55649
55818
 
55650
55819
  // packages/dbx-components-mcp/src/tools/css-class-lookup.tool.ts
55651
- import { type as type102 } from "arktype";
55820
+ import { type as type103 } from "arktype";
55652
55821
  var DBX_CSS_CLASS_LOOKUP_TOOL = {
55653
55822
  name: "dbx_css_class_lookup",
55654
55823
  description: [
@@ -55686,7 +55855,7 @@ var DBX_CSS_CLASS_LOOKUP_TOOL = {
55686
55855
  }
55687
55856
  }
55688
55857
  };
55689
- var CssClassLookupArgs = type102({
55858
+ var CssClassLookupArgs = type103({
55690
55859
  "name?": "string",
55691
55860
  "declarations?": "string",
55692
55861
  "intent?": "string",
@@ -55697,7 +55866,7 @@ var CssClassLookupArgs = type102({
55697
55866
  });
55698
55867
  function parseArgs18(raw) {
55699
55868
  const parsed = CssClassLookupArgs(raw);
55700
- if (parsed instanceof type102.errors) {
55869
+ if (parsed instanceof type103.errors) {
55701
55870
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
55702
55871
  }
55703
55872
  return {
@@ -56005,8 +56174,8 @@ function renderAmbiguous(matches) {
56005
56174
 
56006
56175
  // packages/dbx-components-mcp/src/tools/ui-smell-check.tool.ts
56007
56176
  import { readFile as nodeReadFile9 } from "node:fs/promises";
56008
- import { basename as basename11, extname, isAbsolute as isAbsolute18, resolve as resolve69 } from "node:path";
56009
- import { type as type103 } from "arktype";
56177
+ import { basename as basename11, extname, isAbsolute as isAbsolute19, resolve as resolve70 } from "node:path";
56178
+ import { type as type104 } from "arktype";
56010
56179
  var { detectSmellsDetailed: detectSmellsDetailed2, formatBatchSmellResult: formatBatchSmellResult2, formatSmellResult: formatSmellResult2 } = ui_smell_check_exports;
56011
56180
  var DBX_UI_SMELL_CHECK_TOOL = {
56012
56181
  name: "dbx_ui_smell_check",
@@ -56040,18 +56209,18 @@ var DBX_UI_SMELL_CHECK_TOOL = {
56040
56209
  }
56041
56210
  }
56042
56211
  };
56043
- var SmellCheckArgs = type103({
56212
+ var SmellCheckArgs = type104({
56044
56213
  "html?": "string",
56045
56214
  "scss?": "string",
56046
56215
  "htmlPath?": "string",
56047
56216
  "scssPath?": "string",
56048
56217
  "paths?": "string[]",
56049
56218
  "context?": "string",
56050
- "projectConventions?": type103({ "cardWrapperClasses?": "string[]" })
56219
+ "projectConventions?": type104({ "cardWrapperClasses?": "string[]" })
56051
56220
  });
56052
56221
  function parseArgs19(raw, defaults) {
56053
56222
  const parsed = SmellCheckArgs(raw);
56054
- if (parsed instanceof type103.errors) {
56223
+ if (parsed instanceof type104.errors) {
56055
56224
  throw new TypeError(`Invalid arguments: ${parsed.summary}`);
56056
56225
  }
56057
56226
  const html = parsed.html ?? "";
@@ -56063,7 +56232,7 @@ function parseArgs19(raw, defaults) {
56063
56232
  }
56064
56233
  var DEFAULT_READ_FILE17 = (path) => nodeReadFile9(path, "utf-8");
56065
56234
  async function readPathInput(path, cwd, readFile33) {
56066
- const absolute = isAbsolute18(path) ? path : resolve69(cwd, path);
56235
+ const absolute = isAbsolute19(path) ? path : resolve70(cwd, path);
56067
56236
  return readFile33(absolute);
56068
56237
  }
56069
56238
  function pairBatchPaths(paths) {
@@ -56270,7 +56439,7 @@ async function tryReadBatchPath(path, cwd, reader) {
56270
56439
  }
56271
56440
 
56272
56441
  // packages/dbx-components-mcp/src/tools/auth-claim-lookup.tool.ts
56273
- import { type as type104 } from "arktype";
56442
+ import { type as type105 } from "arktype";
56274
56443
  var DBX_AUTH_CLAIM_LOOKUP_TOOL = {
56275
56444
  name: "dbx_auth_claim_lookup",
56276
56445
  description: [
@@ -56290,7 +56459,7 @@ var DBX_AUTH_CLAIM_LOOKUP_TOOL = {
56290
56459
  required: ["topic"]
56291
56460
  }
56292
56461
  };
56293
- var ClaimArgsType = type104({
56462
+ var ClaimArgsType = type105({
56294
56463
  topic: "string",
56295
56464
  "app?": "string",
56296
56465
  "depth?": "'brief' | 'full'"
@@ -56303,7 +56472,7 @@ function createAuthClaimLookupTool(input) {
56303
56472
  run(rawArgs) {
56304
56473
  const parsed = ClaimArgsType(rawArgs);
56305
56474
  let result;
56306
- if (parsed instanceof type104.errors) {
56475
+ if (parsed instanceof type105.errors) {
56307
56476
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56308
56477
  } else {
56309
56478
  const { topic, app, depth = "full" } = parsed;
@@ -56402,7 +56571,7 @@ function code16(value) {
56402
56571
  }
56403
56572
 
56404
56573
  // packages/dbx-components-mcp/src/tools/auth-scope-lookup.tool.ts
56405
- import { type as type105 } from "arktype";
56574
+ import { type as type106 } from "arktype";
56406
56575
  var DBX_AUTH_SCOPE_LOOKUP_TOOL = {
56407
56576
  name: "dbx_auth_scope_lookup",
56408
56577
  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"),
@@ -56415,7 +56584,7 @@ var DBX_AUTH_SCOPE_LOOKUP_TOOL = {
56415
56584
  required: ["topic"]
56416
56585
  }
56417
56586
  };
56418
- var ScopeArgsType = type105({
56587
+ var ScopeArgsType = type106({
56419
56588
  topic: "string",
56420
56589
  "depth?": "'brief' | 'full'"
56421
56590
  });
@@ -56427,7 +56596,7 @@ function createAuthScopeLookupTool(input) {
56427
56596
  run(rawArgs) {
56428
56597
  const parsed = ScopeArgsType(rawArgs);
56429
56598
  let result;
56430
- if (parsed instanceof type105.errors) {
56599
+ if (parsed instanceof type106.errors) {
56431
56600
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56432
56601
  } else {
56433
56602
  const { topic, depth = "full" } = parsed;
@@ -56499,7 +56668,7 @@ function sourceLink2(path, line) {
56499
56668
  }
56500
56669
 
56501
56670
  // packages/dbx-components-mcp/src/tools/auth-role-lookup.tool.ts
56502
- import { type as type106 } from "arktype";
56671
+ import { type as type107 } from "arktype";
56503
56672
  var DBX_AUTH_ROLE_LOOKUP_TOOL = {
56504
56673
  name: "dbx_auth_role_lookup",
56505
56674
  description: [
@@ -56521,7 +56690,7 @@ var DBX_AUTH_ROLE_LOOKUP_TOOL = {
56521
56690
  }
56522
56691
  }
56523
56692
  };
56524
- var RoleArgsType = type106({
56693
+ var RoleArgsType = type107({
56525
56694
  "topic?": "string",
56526
56695
  "tag?": "string",
56527
56696
  "model?": "string",
@@ -56536,7 +56705,7 @@ function createAuthRoleLookupTool(input) {
56536
56705
  run(rawArgs) {
56537
56706
  const parsed = RoleArgsType(rawArgs);
56538
56707
  let result;
56539
- if (parsed instanceof type106.errors) {
56708
+ if (parsed instanceof type107.errors) {
56540
56709
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56541
56710
  } else {
56542
56711
  const text = dispatchRoleLookup(registry, parsed);
@@ -56689,7 +56858,7 @@ function sourceLink3(path, line) {
56689
56858
  }
56690
56859
 
56691
56860
  // packages/dbx-components-mcp/src/tools/auth-token-explain.tool.ts
56692
- import { type as type107 } from "arktype";
56861
+ import { type as type108 } from "arktype";
56693
56862
  var DBX_AUTH_TOKEN_EXPLAIN_TOOL = {
56694
56863
  name: "dbx_auth_token_explain",
56695
56864
  description: [
@@ -56707,7 +56876,7 @@ var DBX_AUTH_TOKEN_EXPLAIN_TOOL = {
56707
56876
  }
56708
56877
  }
56709
56878
  };
56710
- var TokenArgsType = type107({
56879
+ var TokenArgsType = type108({
56711
56880
  "token?": "string",
56712
56881
  "claims?": "object",
56713
56882
  "app?": "string",
@@ -56722,7 +56891,7 @@ function createAuthTokenExplainTool(input) {
56722
56891
  run(rawArgs) {
56723
56892
  const parsed = TokenArgsType(rawArgs);
56724
56893
  let result;
56725
- if (parsed instanceof type107.errors) {
56894
+ if (parsed instanceof type108.errors) {
56726
56895
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56727
56896
  } else {
56728
56897
  const { token, claims: claimsObj, app, expectedIssuer } = parsed;
@@ -56934,7 +57103,7 @@ function describeReserved(key) {
56934
57103
  }
56935
57104
 
56936
57105
  // packages/dbx-components-mcp/src/tools/auth-list-app.tool.ts
56937
- import { type as type108 } from "arktype";
57106
+ import { type as type109 } from "arktype";
56938
57107
  var DBX_AUTH_LIST_APP_TOOL = {
56939
57108
  name: "dbx_auth_list_app",
56940
57109
  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"),
@@ -56946,7 +57115,7 @@ var DBX_AUTH_LIST_APP_TOOL = {
56946
57115
  required: ["app"]
56947
57116
  }
56948
57117
  };
56949
- var ListAppArgsType6 = type108({
57118
+ var ListAppArgsType6 = type109({
56950
57119
  app: "string"
56951
57120
  });
56952
57121
  // @__NO_SIDE_EFFECTS__
@@ -56957,7 +57126,7 @@ function createAuthListAppTool(input) {
56957
57126
  run(rawArgs) {
56958
57127
  const parsed = ListAppArgsType6(rawArgs);
56959
57128
  let result;
56960
- if (parsed instanceof type108.errors) {
57129
+ if (parsed instanceof type109.errors) {
56961
57130
  result = toolError(`Invalid arguments: ${parsed.summary}`);
56962
57131
  } else {
56963
57132
  const { app } = parsed;
@@ -57268,7 +57437,7 @@ async function loadServerContext(options = {}) {
57268
57437
  `);
57269
57438
  }
57270
57439
  const modelValidateRuleOptions = resolveModelValidateRuleOptions(configResult.config);
57271
- const configBaseDir = configResult.configPath !== null && configResult.configPath !== void 0 ? dirname23(configResult.configPath) : cwd;
57440
+ const configBaseDir = configResult.configPath !== null && configResult.configPath !== void 0 ? dirname24(configResult.configPath) : cwd;
57272
57441
  const logSearchConfig = resolveLogSearchConfig(configResult.config, configBaseDir);
57273
57442
  const registry = await resolveOptionalRegistry({
57274
57443
  injected: options.semanticTypeRegistry,
@@ -57494,7 +57663,7 @@ function resolveLogSearchConfig(config, configBaseDir) {
57494
57663
  let absoluteBasePath;
57495
57664
  const rawBasePath = block.basePath?.trim();
57496
57665
  if (rawBasePath !== void 0 && rawBasePath.length > 0) {
57497
- absoluteBasePath = isAbsolute19(rawBasePath) ? rawBasePath : resolvePath4(configBaseDir, rawBasePath);
57666
+ absoluteBasePath = isAbsolute20(rawBasePath) ? rawBasePath : resolvePath4(configBaseDir, rawBasePath);
57498
57667
  }
57499
57668
  const defaultProject = block.defaultProject?.trim();
57500
57669
  if (absoluteBasePath === void 0 && (defaultProject === void 0 || defaultProject.length === 0)) {