@dereekb/dbx-components-mcp 13.40.0 → 13.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ var __export = (target, all) => {
10
10
  // packages/dbx-components-mcp/package.json
11
11
  var package_default = {
12
12
  name: "@dereekb/dbx-components-mcp",
13
- version: "13.40.0",
13
+ version: "13.42.0",
14
14
  type: "module",
15
15
  bin: {
16
16
  "dbx-components-mcp": "dbx-components-mcp.js"
@@ -21,8 +21,8 @@ var package_default = {
21
21
  "ts-morph": "^21.0.0"
22
22
  },
23
23
  peerDependencies: {
24
- "@dereekb/dbx-cli": "13.40.0",
25
- "@dereekb/util": "13.40.0"
24
+ "@dereekb/dbx-cli": "13.42.0",
25
+ "@dereekb/util": "13.42.0"
26
26
  }
27
27
  };
28
28
 
@@ -1859,6 +1859,150 @@ var WORKSPACE_AUTH_CLAIMS = [...DEMO_CLAIMS];
1859
1859
 
1860
1860
  // packages/dbx-cli/generated/firebase-models.generated.ts
1861
1861
  var FIREBASE_MODELS = [
1862
+ {
1863
+ name: "Calendar",
1864
+ identityConst: "calendarIdentity",
1865
+ modelType: "calendar",
1866
+ collectionPrefix: "cal",
1867
+ sourcePackage: "@dereekb/firebase",
1868
+ sourceFile: "packages/firebase/src/lib/model/calendar/calendar.ts",
1869
+ fields: [
1870
+ {
1871
+ name: "t",
1872
+ longName: "calendarType",
1873
+ converter: "firestoreString<CalendarType>()",
1874
+ tsType: "CalendarType",
1875
+ optional: false,
1876
+ description: "The kind of calendar this is, resolving its retention policy and ICS emission config."
1877
+ },
1878
+ {
1879
+ name: "n",
1880
+ longName: "name",
1881
+ converter: "firestoreString<string>({ default: '' })",
1882
+ tsType: "string",
1883
+ optional: false,
1884
+ description: "Display name of the calendar. Emitted as NAME/X-WR-CALNAME."
1885
+ },
1886
+ {
1887
+ name: "d",
1888
+ longName: "description",
1889
+ converter: "optionalFirestoreString()",
1890
+ tsType: "Maybe<string>",
1891
+ optional: true,
1892
+ description: "Description of the calendar. Emitted as DESCRIPTION/X-WR-CALDESC."
1893
+ },
1894
+ {
1895
+ name: "tz",
1896
+ longName: "timezone",
1897
+ converter: "firestoreTimezoneString({ default: UTC_TIMEZONE_STRING })",
1898
+ tsType: "TimezoneString",
1899
+ optional: false,
1900
+ description: "Default timezone of the calendar. Emitted as X-WR-TIMEZONE, and the fallback for an event with no `tz`."
1901
+ },
1902
+ {
1903
+ name: "c",
1904
+ longName: "color",
1905
+ converter: "optionalFirestoreString()",
1906
+ tsType: "Maybe<string>",
1907
+ optional: true,
1908
+ description: "CSS3 color name for the calendar. Emitted as COLOR."
1909
+ },
1910
+ {
1911
+ name: "o",
1912
+ longName: "ownerKey",
1913
+ converter: "optionalFirestoreString()",
1914
+ tsType: "Maybe<FirebaseAuthOwnershipKey>",
1915
+ optional: true,
1916
+ description: "Ownership key, if applicable."
1917
+ },
1918
+ {
1919
+ name: "e",
1920
+ longName: "events",
1921
+ converter: "firestoreObjectArray({ objectField: calendarEventItem, sortWith: calendarEventItemsSortFunction<CalendarEventItem>(), filterUnique: calendarEventItemsFilterUniqueFunction<CalendarEventItem>() })",
1922
+ tsType: "CalendarEventItem[]",
1923
+ optional: false,
1924
+ description: "The calendar's one-off events, ascending by start instant and unique by id."
1925
+ },
1926
+ {
1927
+ name: "r",
1928
+ longName: "recurringEvents",
1929
+ converter: "firestoreObjectArray({ objectField: calendarRecurringEventItem, sortWith: calendarEventItemsSortFunction<CalendarRecurringEventItem>(), filterUnique: calendarEventItemsFilterUniqueFunction<CalendarRecurringEventItem>() })",
1930
+ tsType: "CalendarRecurringEventItem[]",
1931
+ optional: false,
1932
+ description: "The calendar's recurring events, ascending by anchor instant and unique by id."
1933
+ },
1934
+ {
1935
+ name: "x",
1936
+ longName: "extensionData",
1937
+ converter: "optionalFirestorePassthroughJsonField<CalendarExtensionData>({ filterEmptyValues: true, dontStoreIfEmpty: true })",
1938
+ tsType: "Maybe<CalendarExtensionData>",
1939
+ optional: true,
1940
+ description: `Extension data emitted as "X-" properties on the calendar's VCALENDAR.`
1941
+ },
1942
+ {
1943
+ name: "cat",
1944
+ longName: "createdAt",
1945
+ converter: "firestoreDate({ saveDefaultAsNow: true })",
1946
+ tsType: "Date",
1947
+ optional: false,
1948
+ description: "Created at date."
1949
+ },
1950
+ {
1951
+ name: "uat",
1952
+ longName: "updatedAt",
1953
+ converter: "firestoreDate({ saveDefaultAsNow: true })",
1954
+ tsType: "Date",
1955
+ optional: false,
1956
+ description: "Updated at date. Moves on every content change."
1957
+ },
1958
+ {
1959
+ name: "s",
1960
+ longName: "needsSync",
1961
+ converter: "optionalFirestoreBoolean({ dontStoreIf: false })",
1962
+ tsType: "Maybe<NeedsSyncBoolean>",
1963
+ optional: true,
1964
+ description: "True if this Calendar should be swept and its published ICS regenerated."
1965
+ },
1966
+ {
1967
+ name: "sat",
1968
+ longName: "syncedAt",
1969
+ converter: "optionalFirestoreDate()",
1970
+ tsType: "Maybe<Date>",
1971
+ optional: true,
1972
+ description: "The last date the published ICS was successfully uploaded."
1973
+ },
1974
+ {
1975
+ name: "rat",
1976
+ longName: "icsRotatedAt",
1977
+ converter: "optionalFirestoreDate()",
1978
+ tsType: "Maybe<Date>",
1979
+ optional: true,
1980
+ description: "The last date this calendar's published ICS link was rotated."
1981
+ },
1982
+ {
1983
+ name: "isf",
1984
+ longName: "icsStorageFileId",
1985
+ converter: "optionalFirestoreString()",
1986
+ tsType: "Maybe<StorageFileId>",
1987
+ optional: true,
1988
+ description: "StorageFile that holds the published ICS for this calendar."
1989
+ },
1990
+ {
1991
+ name: "iu",
1992
+ longName: "icsUrl",
1993
+ converter: "optionalFirestoreString<StorageFilePublicDownloadUrl>()",
1994
+ tsType: "Maybe<StorageFilePublicDownloadUrl>",
1995
+ optional: true,
1996
+ description: "The permanent, anonymously-readable URL the published ICS is served from."
1997
+ }
1998
+ ],
1999
+ enums: [],
2000
+ detectionHints: ["t", "n", "tz", "c", "e", "r", "x", "uat", "sat", "rat", "isf", "iu"],
2001
+ description: 'A calendar and all of its events, stored in one document and published as an ".ics" file.',
2002
+ modelGroup: "Calendar",
2003
+ collectionKind: "root",
2004
+ archetypes: ["root-entity"]
2005
+ },
1862
2006
  {
1863
2007
  name: "NotificationBox",
1864
2008
  identityConst: "notificationBoxIdentity",
@@ -2987,6 +3131,11 @@ var RESERVED_MODEL_FOLDERS = [
2987
3131
  name: "storagefile",
2988
3132
  reason: "StorageFile is a canonical group from `@dereekb/firebase` with a richer layout than the base 5 files (group, upload, file, etc.); downstream projects extend rather than redeclare it.",
2989
3133
  recommendedTool: "dbx_storagefile_m_validate_folder"
3134
+ },
3135
+ {
3136
+ name: "calendar",
3137
+ reason: "Calendar is a canonical group from `@dereekb/firebase` with a richer layout than the base 5 files (type, expand, ics, processing, etc.); downstream projects extend rather than redeclare it.",
3138
+ recommendedTool: "dbx_model_validate_folder"
2990
3139
  }
2991
3140
  ];
2992
3141
 
@@ -4375,7 +4524,7 @@ function extractGroupModelNames(text) {
4375
4524
  while ((match = MODEL_NAME_RE.exec(text)) !== null) {
4376
4525
  seen.add(match[1]);
4377
4526
  }
4378
- return [...seen].sort((a, b) => a.localeCompare(b));
4527
+ return Array.from(seen).sort((a, b) => a.localeCompare(b));
4379
4528
  }
4380
4529
 
4381
4530
  // packages/dbx-cli/src/lib/mcp-scan/scan/_jsdoc-tagged-export/extract-base.ts
@@ -8124,7 +8273,7 @@ function collectTokensReadFromBody(body) {
8124
8273
  while ((match = CSS_VAR_REFERENCE_RE.exec(body)) !== null) {
8125
8274
  set.add(match[1]);
8126
8275
  }
8127
- return [...set].sort((a, b) => a.localeCompare(b));
8276
+ return Array.from(set).sort((a, b) => a.localeCompare(b));
8128
8277
  }
8129
8278
  function collectTokensSet(declarations) {
8130
8279
  const set = /* @__PURE__ */ new Set();
@@ -8133,7 +8282,7 @@ function collectTokensSet(declarations) {
8133
8282
  set.add(decl.property);
8134
8283
  }
8135
8284
  }
8136
- return [...set].sort((a, b) => a.localeCompare(b));
8285
+ return Array.from(set).sort((a, b) => a.localeCompare(b));
8137
8286
  }
8138
8287
 
8139
8288
  // packages/dbx-cli/src/lib/mcp-scan/scan/css-utilities-scan-config-schema.ts
@@ -9050,7 +9199,7 @@ async function discoverConventionalDirs(workspaceRoot) {
9050
9199
  found.add(rel);
9051
9200
  }
9052
9201
  }
9053
- return [...found];
9202
+ return Array.from(found);
9054
9203
  }
9055
9204
  function normaliseExplicitDirs(dirs) {
9056
9205
  const result = [];
@@ -9155,7 +9304,7 @@ async function detectCandidateClusters(absDir) {
9155
9304
  }
9156
9305
  } catch {
9157
9306
  }
9158
- return [...found];
9307
+ return Array.from(found);
9159
9308
  }
9160
9309
  function mergeClusters(...lists) {
9161
9310
  const seen = /* @__PURE__ */ new Set();
@@ -10216,11 +10365,18 @@ function analyzeSequence(input) {
10216
10365
  if (isSingleFieldQuery(buckets)) {
10217
10366
  return analyzeSingleField({ buckets, collection, scope, warnings });
10218
10367
  }
10368
+ if (scope === "COLLECTION" && isEqualityOnlySequence(buckets)) {
10369
+ warnings.push({ kind: "equality-only-composite-skipped", factoryName, fields: buckets.equalities.map((e) => e.fieldPath) });
10370
+ return { kind: "auto", warnings };
10371
+ }
10219
10372
  return analyzeMultiField({ buckets, sequenceEntries: sequence.entries, collection, scope, factoryName, warnings });
10220
10373
  }
10221
10374
  function isSingleFieldQuery(buckets) {
10222
10375
  return buckets.distinctFieldCount === 1;
10223
10376
  }
10377
+ function isEqualityOnlySequence(buckets) {
10378
+ return buckets.ranges.length === 0 && buckets.arrays.length === 0 && buckets.orderBys.length === 0 && buckets.equalities.length > 0 && buckets.equalities.every((e) => (e.operator ?? "==") === "==");
10379
+ }
10224
10380
  function analyzeSingleField(input) {
10225
10381
  const { buckets, collection, scope, warnings } = input;
10226
10382
  if (scope === "COLLECTION") {
@@ -10315,7 +10471,7 @@ function collectOrderByDirections(input) {
10315
10471
  }
10316
10472
  }
10317
10473
  for (const [field, dirs] of conflicts) {
10318
- warnings.push({ kind: "orderby-conflict", factoryName, field, directions: [...dirs] });
10474
+ warnings.push({ kind: "orderby-conflict", factoryName, field, directions: Array.from(dirs) });
10319
10475
  }
10320
10476
  return out;
10321
10477
  }
@@ -10778,7 +10934,7 @@ function composeEntry(input) {
10778
10934
  }
10779
10935
  function resolveConstraintSequences(input) {
10780
10936
  const { candidate, tags, name, line, filePath, warnings } = input;
10781
- const bodyResult = extractConstraintsFromBody({ decl: candidate.decl, factoryName: name, filePath, dispatcher: tags.dispatcher });
10937
+ const bodyResult = extractConstraintsFromBody({ decl: candidate.decl, factoryName: name, filePath, dispatcher: tags.dispatcher, suppressed: tags.skip || tags.specOnly });
10782
10938
  for (const warning of bodyResult.warnings) {
10783
10939
  warnings.push(warning);
10784
10940
  }
@@ -10859,11 +11015,14 @@ function buildConstraintSequences(input) {
10859
11015
  return sequences;
10860
11016
  }
10861
11017
  function extractConstraintsFromBody(input) {
10862
- const { decl, factoryName, filePath, dispatcher } = input;
11018
+ const { decl, factoryName, filePath, dispatcher, suppressed } = input;
10863
11019
  const entries = [];
10864
11020
  const conditionalFieldSet = /* @__PURE__ */ new Set();
10865
11021
  const warnings = [];
10866
11022
  const body = decl.getBody();
11023
+ if (suppressed) {
11024
+ return { entries, conditionalFields: [], warnings, skipped: true, dispatcherDelegates: [] };
11025
+ }
10867
11026
  if (dispatcher) {
10868
11027
  const violation = body === void 0 ? void 0 : findFirstConstraintCall(body);
10869
11028
  if (violation !== void 0) {
@@ -11584,6 +11743,9 @@ function formatModelFirebaseIndexBuildWarning(warning) {
11584
11743
  case "unsupported-array-contains-any":
11585
11744
  result = `${w.factoryName} field "${w.field}" uses array-contains-any \u2014 index support is partial`;
11586
11745
  break;
11746
+ case "equality-only-composite-skipped":
11747
+ result = `${w.factoryName} is equality-only on [${w.fields.join(", ")}] \u2014 no composite emitted, Firestore serves this by merging the automatic single-field indexes`;
11748
+ break;
11587
11749
  }
11588
11750
  }
11589
11751
  return result;
@@ -14171,13 +14333,13 @@ async function discoverClaimsFiles(cwd) {
14171
14333
  } catch {
14172
14334
  }
14173
14335
  }
14174
- return [...found].sort((a, b) => a.localeCompare(b));
14336
+ return Array.from(found).sort((a, b) => a.localeCompare(b));
14175
14337
  }
14176
14338
  function mergeAndNormalisePaths(discovered, extra) {
14177
14339
  const out = /* @__PURE__ */ new Set();
14178
14340
  for (const p of discovered) out.add(p);
14179
14341
  for (const p of extra) out.add(toPosix(p));
14180
- return [...out].sort((a, b) => a.localeCompare(b));
14342
+ return Array.from(out).sort((a, b) => a.localeCompare(b));
14181
14343
  }
14182
14344
  function toPosix(value) {
14183
14345
  return value.split(sep4).join("/");
@@ -14827,12 +14989,13 @@ function pushInto13(map, key, entry) {
14827
14989
  var DEFAULT_BIN_NAME = "dbx-cli-generate-firestore-indexes";
14828
14990
  function buildUsage(binName) {
14829
14991
  return [
14830
- `Usage: ${binName} --component <dir> [--output <path>] [--check] [--json] [--help]`,
14992
+ `Usage: ${binName} --component <dir> [--component <dir> ...] [--output <path>] [--check] [--json] [--help]`,
14831
14993
  "",
14832
14994
  "Generates `firestore.indexes.json` from `@dbxModelFirebaseIndex`-tagged factories.",
14833
14995
  "",
14834
14996
  "Options:",
14835
- " --component <dir> Required. Relative path to the `-firebase` component package.",
14997
+ " --component <dir> Required, repeatable. Relative path to a `-firebase` component or package.",
14998
+ " Repeat to derive one indexes file from several packages at once.",
14836
14999
  " --output <path> Output path. Defaults to `firestore.indexes.json` at the cwd.",
14837
15000
  " --check Compare against the on-disk file; exit 1 on drift, do not write.",
14838
15001
  " --json Print the diff summary as JSON instead of human-readable text.",
@@ -14852,23 +15015,40 @@ async function runGenerateFirestoreIndexesCli(input) {
14852
15015
  stderr(usage);
14853
15016
  return { exitCode: 2 };
14854
15017
  }
14855
- if (parsed.component === void 0) {
15018
+ if (parsed.components.length === 0) {
14856
15019
  stderr("generate-firestore-indexes: --component is required");
14857
15020
  stderr(usage);
14858
15021
  return { exitCode: 2 };
14859
15022
  }
14860
- const componentAbs = resolve26(cwd, parsed.component);
14861
15023
  const outputAbs = resolve26(cwd, parsed.output);
14862
- const buildOutcome = await buildModelFirebaseIndexManifest({
14863
- projectRoot: componentAbs,
14864
- generator
14865
- });
14866
- if (buildOutcome.kind !== "success") {
14867
- stderr(formatBuildFailure(buildOutcome));
15024
+ const entries = [];
15025
+ const loadedSources = [];
15026
+ let sawUnresolvedModel = false;
15027
+ for (const component of parsed.components) {
15028
+ const buildOutcome = await buildModelFirebaseIndexManifest({
15029
+ projectRoot: resolve26(cwd, component),
15030
+ generator
15031
+ });
15032
+ if (buildOutcome.kind !== "success") {
15033
+ stderr(formatBuildFailure(buildOutcome));
15034
+ return { exitCode: 1 };
15035
+ }
15036
+ for (const warning of buildOutcome.extractWarnings) {
15037
+ stderr(`${warning.stage}-warning: ${formatModelFirebaseIndexBuildWarning(warning)}`);
15038
+ if (warning.stage === "extract" && warning.warning.kind === "unresolved-model") {
15039
+ sawUnresolvedModel = true;
15040
+ }
15041
+ }
15042
+ for (const entry of buildOutcome.manifest.entries) {
15043
+ entries.push(toModelFirebaseIndexEntryInfo(entry));
15044
+ }
15045
+ loadedSources.push(buildOutcome.manifest.source);
15046
+ }
15047
+ if (sawUnresolvedModel) {
15048
+ 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.");
14868
15049
  return { exitCode: 1 };
14869
15050
  }
14870
- const entries = buildOutcome.manifest.entries.map(toModelFirebaseIndexEntryInfo);
14871
- const registry = createModelFirebaseIndexRegistryFromEntries({ entries, loadedSources: [buildOutcome.manifest.source] });
15051
+ const registry = createModelFirebaseIndexRegistryFromEntries({ entries, loadedSources });
14872
15052
  const existingJson = await readExistingIndexes({ outputAbs, readFile: readFile33, stderr });
14873
15053
  const { json, diff } = generateFirestoreIndexesJson({ entries: registry.all, existingJson });
14874
15054
  const serialized = serializeFirestoreIndexesJson(json);
@@ -14891,7 +15071,7 @@ async function runGenerateFirestoreIndexesCli(input) {
14891
15071
  return { exitCode: 0 };
14892
15072
  }
14893
15073
  function parseArgv(argv) {
14894
- let component;
15074
+ const components = [];
14895
15075
  let output = "firestore.indexes.json";
14896
15076
  let check = false;
14897
15077
  let json = false;
@@ -14906,7 +15086,7 @@ function parseArgv(argv) {
14906
15086
  if (i >= argv.length) {
14907
15087
  error = "generate-firestore-indexes: --component requires a value";
14908
15088
  } else {
14909
- component = argv[i];
15089
+ components.push(argv[i]);
14910
15090
  }
14911
15091
  break;
14912
15092
  case "--output":
@@ -14933,7 +15113,7 @@ function parseArgv(argv) {
14933
15113
  }
14934
15114
  i += 1;
14935
15115
  }
14936
- return { component, output, check, json, help, error };
15116
+ return { components, output, check, json, help, error };
14937
15117
  }
14938
15118
  async function readExistingIndexes(input) {
14939
15119
  const text = await readExistingIndexesText(input);
@@ -16350,7 +16530,7 @@ function warnDroppedFutureStates(tree, realNames, warnings) {
16350
16530
  continue;
16351
16531
  }
16352
16532
  const prefix = node.data.name.slice(0, -3);
16353
- const hasRealSubtree = realNames.has(prefix) || [...realNames].some((name) => name.startsWith(`${prefix}.`));
16533
+ const hasRealSubtree = realNames.has(prefix) || Array.from(realNames).some((name) => name.startsWith(`${prefix}.`));
16354
16534
  if (!hasRealSubtree) {
16355
16535
  warnings.push({ kind: "dropped-future-state", severity: "warning", message: `Future state \`${node.data.name}\` was dropped and has no real subtree under \`${prefix}\`; its page will not match any URL.`, stateName: node.data.name });
16356
16536
  }
@@ -19044,9 +19224,9 @@ function scanFirestoreRules(source) {
19044
19224
  if (allow.ops.has("list") || allow.ops.has("read")) current.list = mergeAccess(current.list, allow.access);
19045
19225
  }
19046
19226
  });
19047
- const collections = [...accumulated.entries()].map(([collection, value]) => ({
19227
+ const collections = Array.from(accumulated.entries()).map(([collection, value]) => ({
19048
19228
  collection,
19049
- paths: [...value.paths].sort(),
19229
+ paths: Array.from(value.paths).sort(),
19050
19230
  get: value.get,
19051
19231
  list: value.list,
19052
19232
  collectionGroup: value.collectionGroup,
@@ -21958,7 +22138,7 @@ function formatDownstreamSection(downstream) {
21958
22138
  bucket.push(model);
21959
22139
  byPackage.set(model.sourcePackage, bucket);
21960
22140
  }
21961
- const packageNames = [...byPackage.keys()].sort((a, b) => a.localeCompare(b));
22141
+ const packageNames = Array.from(byPackage.keys()).sort((a, b) => a.localeCompare(b));
21962
22142
  for (const pkg of packageNames) {
21963
22143
  lines.push(`### \`${pkg}\``, "");
21964
22144
  const bucket = byPackage.get(pkg) ?? [];
@@ -28680,13 +28860,18 @@ function readJsDocSummary(node) {
28680
28860
  }
28681
28861
 
28682
28862
  // packages/dbx-cli/manifest-extract/src/lib/extract-models.ts
28683
- import { Node as Node24, Project as Project9 } from "ts-morph";
28863
+ import { Node as Node24, SyntaxKind as SyntaxKind10, Project as Project9 } from "ts-morph";
28684
28864
  var READ_LEVEL_VALUES2 = /* @__PURE__ */ new Set(["system", "owner", "admin-only", "permissions"]);
28685
28865
  var SERVICE_FACTORY_TAG = "dbxModelServiceFactory";
28686
28866
  var MCP_TOOL_NAME_SEGMENT_TAG = "dbxModelMcpToolNameSegment";
28687
28867
  var MODEL_TYPE_VALUE_PATTERN2 = /^[a-z][A-Za-z0-9_$]*$/;
28688
28868
  var TOOL_NAME_SEGMENT_PATTERN = /^[A-Za-z][A-Za-z0-9_$]*$/;
28689
28869
  var IDENTITY_FN = "firestoreModelIdentity";
28870
+ var SINGLE_ITEM_COLLECTION_FN = "singleItemFirestoreCollection";
28871
+ var ROOT_SINGLE_ITEM_COLLECTION_FN = "rootSingleItemFirestoreCollection";
28872
+ var SINGLE_ITEM_COLLECTION_FN_NAMES = [SINGLE_ITEM_COLLECTION_FN, ROOT_SINGLE_ITEM_COLLECTION_FN];
28873
+ var MODEL_IDENTITY_KEY = "modelIdentity";
28874
+ var SINGLE_ITEM_IDENTIFIER_KEY = "singleItemIdentifier";
28690
28875
  var CONVERTER_FN_NAMES = ["snapshotConverterFunctions", "firestoreSubObject", "firestoreObjectArray"];
28691
28876
  var SUB_OBJECT_FN = "firestoreSubObject";
28692
28877
  var OBJECT_ARRAY_FN = "firestoreObjectArray";
@@ -28703,7 +28888,9 @@ function extractModelsFromSource(input) {
28703
28888
  const enums = readEnums(sourceFile);
28704
28889
  const modelGroups = readModelGroups(sourceFile);
28705
28890
  const serviceFactories = readServiceFactories(sourceFile);
28706
- return { identities, interfaces, converters, enums, modelGroups, serviceFactories };
28891
+ const singleItemCollections = readSingleItemCollections(sourceFile);
28892
+ const stringConstants = readStringConstants(sourceFile);
28893
+ return { identities, interfaces, converters, enums, modelGroups, serviceFactories, singleItemCollections, stringConstants };
28707
28894
  }
28708
28895
  function readIdentities(sourceFile) {
28709
28896
  const out = [];
@@ -28823,6 +29010,65 @@ function readServiceFactoryModelType(jsDocs) {
28823
29010
  }
28824
29011
  return result;
28825
29012
  }
29013
+ function readSingleItemCollections(sourceFile) {
29014
+ const out = [];
29015
+ const text = sourceFile.getFullText();
29016
+ if (SINGLE_ITEM_COLLECTION_FN_NAMES.some((name) => text.includes(name))) {
29017
+ for (const call of sourceFile.getDescendantsOfKind(SyntaxKind10.CallExpression)) {
29018
+ const fnName = readCalleeName(call);
29019
+ if (fnName !== SINGLE_ITEM_COLLECTION_FN && fnName !== ROOT_SINGLE_ITEM_COLLECTION_FN) continue;
29020
+ const entry = buildSingleItemCollection(call, fnName === ROOT_SINGLE_ITEM_COLLECTION_FN);
29021
+ if (entry) out.push(entry);
29022
+ }
29023
+ }
29024
+ return out;
29025
+ }
29026
+ function readCalleeName(call) {
29027
+ const expression = call.getExpression();
29028
+ return Node24.isPropertyAccessExpression(expression) ? expression.getName() : expression.getText();
29029
+ }
29030
+ function buildSingleItemCollection(call, root) {
29031
+ let result;
29032
+ const args = call.getArguments();
29033
+ if (args.length > 0) {
29034
+ const config = args[0];
29035
+ if (Node24.isObjectLiteralExpression(config)) {
29036
+ const identityNode = readPropertyValue(config, MODEL_IDENTITY_KEY);
29037
+ if (identityNode && Node24.isIdentifier(identityNode)) {
29038
+ const identifierNode = readPropertyValue(config, SINGLE_ITEM_IDENTIFIER_KEY);
29039
+ result = {
29040
+ identityConst: identityNode.getText(),
29041
+ root,
29042
+ documentId: readStringLiteralText(identifierNode),
29043
+ documentIdConstRef: identifierNode && Node24.isIdentifier(identifierNode) ? identifierNode.getText() : void 0,
29044
+ explicitIdentifier: config.getProperty(SINGLE_ITEM_IDENTIFIER_KEY) !== void 0,
29045
+ line: call.getStartLineNumber()
29046
+ };
29047
+ }
29048
+ }
29049
+ }
29050
+ return result;
29051
+ }
29052
+ function readStringConstants(sourceFile) {
29053
+ const out = [];
29054
+ for (const statement of sourceFile.getVariableStatements()) {
29055
+ if (!statement.isExported()) continue;
29056
+ for (const decl of statement.getDeclarations()) {
29057
+ const value = readStringLiteralText(decl.getInitializer());
29058
+ if (value !== void 0) {
29059
+ out.push({ name: decl.getName(), value });
29060
+ }
29061
+ }
29062
+ }
29063
+ return out;
29064
+ }
29065
+ function readStringLiteralText(node) {
29066
+ let current = node;
29067
+ while (current !== void 0 && Node24.isAsExpression(current)) {
29068
+ current = current.getExpression();
29069
+ }
29070
+ return current !== void 0 && (Node24.isStringLiteral(current) || Node24.isNoSubstitutionTemplateLiteral(current)) ? current.getLiteralText() : void 0;
29071
+ }
28826
29072
  function readConverters(sourceFile) {
28827
29073
  const out = [];
28828
29074
  for (const statement of sourceFile.getVariableStatements()) {
@@ -29368,7 +29614,7 @@ function buildSummaries(entries, issues) {
29368
29614
  const summary = byModel.get(issue.model);
29369
29615
  if (summary) summary.errorCount += 1;
29370
29616
  }
29371
- return [...byModel.entries()].map(([model, s]) => ({ model, ...s })).sort((a, b) => a.model.localeCompare(b.model));
29617
+ return Array.from(byModel.entries()).map(([model, s]) => ({ model, ...s })).sort((a, b) => a.model.localeCompare(b.model));
29372
29618
  }
29373
29619
  function compareEntries(a, b) {
29374
29620
  return a.model.localeCompare(b.model) || a.verb.localeCompare(b.verb) || (a.specifier ?? "").localeCompare(b.specifier ?? "");
@@ -29444,7 +29690,7 @@ async function readComponentDereekbDeps(componentAbs) {
29444
29690
  addScopedDependencyNames(json[field], out);
29445
29691
  }
29446
29692
  }
29447
- return [...out];
29693
+ return Array.from(out);
29448
29694
  }
29449
29695
  function addScopedDependencyNames(field, out) {
29450
29696
  if (isRecord(field)) {
@@ -29804,7 +30050,7 @@ __export(dbx_asset_validate_app_exports, {
29804
30050
  import { Node as Node27, Project as Project12 } from "ts-morph";
29805
30051
 
29806
30052
  // packages/dbx-cli/validate/src/lib/_core/_validate/ast.ts
29807
- import { Node as Node26, Project as Project11, SyntaxKind as SyntaxKind10 } from "ts-morph";
30053
+ import { Node as Node26, Project as Project11, SyntaxKind as SyntaxKind11 } from "ts-morph";
29808
30054
  var COMPONENT_VIRTUAL_PREFIX = "__component__/";
29809
30055
  var API_VIRTUAL_PREFIX = "__api__/";
29810
30056
  // @__NO_SIDE_EFFECTS__
@@ -29906,7 +30152,7 @@ function findLocalVariable(sf, name) {
29906
30152
  if (decl.getName() === name) return decl;
29907
30153
  }
29908
30154
  }
29909
- for (const decl of sf.getDescendantsOfKind(SyntaxKind10.VariableDeclaration)) {
30155
+ for (const decl of sf.getDescendantsOfKind(SyntaxKind11.VariableDeclaration)) {
29910
30156
  if (decl.getName() === name) return decl;
29911
30157
  }
29912
30158
  return void 0;
@@ -29916,7 +30162,7 @@ function collectTypeofReferences(node, out) {
29916
30162
  out.push(node.getExprName().getText());
29917
30163
  return;
29918
30164
  }
29919
- for (const tq of node.getDescendantsOfKind(SyntaxKind10.TypeQuery)) {
30165
+ for (const tq of node.getDescendantsOfKind(SyntaxKind11.TypeQuery)) {
29920
30166
  out.push(tq.getExprName().getText());
29921
30167
  }
29922
30168
  }
@@ -30607,7 +30853,7 @@ __export(notification_m_validate_app_exports, {
30607
30853
  });
30608
30854
 
30609
30855
  // packages/dbx-cli/validate/src/lib/notification-m-validate-app/extract.ts
30610
- import { Node as Node28, SyntaxKind as SyntaxKind11 } from "ts-morph";
30856
+ import { Node as Node28, SyntaxKind as SyntaxKind12 } from "ts-morph";
30611
30857
  var NOTIF_TEMPLATE_TYPE = "NotificationTemplateType";
30612
30858
  var NOTIF_TEMPLATE_TYPE_INFO = "NotificationTemplateTypeInfo";
30613
30859
  var NOTIF_TEMPLATE_TYPE_INFO_ARRAY = "NotificationTemplateTypeInfo[]";
@@ -30877,7 +31123,7 @@ function tryReadTemplateInfoRecord(decl, rel, index) {
30877
31123
  symbolName: decl.getName(),
30878
31124
  directInfoIdentifiers: direct,
30879
31125
  spreadAggregateIdentifiers: spreads,
30880
- resolvedInfoIdentifiers: [...resolved],
31126
+ resolvedInfoIdentifiers: Array.from(resolved),
30881
31127
  unresolvedSpreadIdentifiers: unresolved,
30882
31128
  sourceFile: rel
30883
31129
  };
@@ -30914,7 +31160,7 @@ function extractTemplateInfoRecordWiring(sources) {
30914
31160
  let result;
30915
31161
  outer: for (const sf of sources) {
30916
31162
  const rel = apiRelPath(sf);
30917
- for (const call of sf.getDescendantsOfKind(SyntaxKind11.CallExpression)) {
31163
+ for (const call of sf.getDescendantsOfKind(SyntaxKind12.CallExpression)) {
30918
31164
  if (call.getExpression().getText() !== TEMPLATE_INFO_RECORD_SERVICE) continue;
30919
31165
  const args = call.getArguments();
30920
31166
  const first = args[0];
@@ -30934,7 +31180,7 @@ function extractTemplateConfigsArrayWiring(sources) {
30934
31180
  let result;
30935
31181
  outer: for (const sf of sources) {
30936
31182
  const rel = apiRelPath(sf);
30937
- for (const obj of sf.getDescendantsOfKind(SyntaxKind11.ObjectLiteralExpression)) {
31183
+ for (const obj of sf.getDescendantsOfKind(SyntaxKind12.ObjectLiteralExpression)) {
30938
31184
  const provideIdent = readIdentifierProperty(obj, "provide");
30939
31185
  if (provideIdent !== TEMPLATE_CONFIGS_ARRAY_TOKEN) continue;
30940
31186
  const useFactoryIdent = readIdentifierProperty(obj, "useFactory");
@@ -31128,7 +31374,7 @@ function extractTaskServiceCalls(sources, index, trustedExternal) {
31128
31374
  const out = [];
31129
31375
  for (const sf of sources) {
31130
31376
  const rel = apiRelPath(sf);
31131
- for (const call of sf.getDescendantsOfKind(SyntaxKind11.CallExpression)) {
31377
+ for (const call of sf.getDescendantsOfKind(SyntaxKind12.CallExpression)) {
31132
31378
  const expr = call.getExpression();
31133
31379
  if (!Node28.isIdentifier(expr) || expr.getText() !== TASK_SERVICE_FACTORY) continue;
31134
31380
  const args = call.getArguments();
@@ -31315,7 +31561,7 @@ function extractTaskHandlerEntries(sources) {
31315
31561
  const seenSymbols = /* @__PURE__ */ new Set();
31316
31562
  for (const sf of sources) {
31317
31563
  const rel = apiRelPath(sf);
31318
- for (const decl of sf.getDescendantsOfKind(SyntaxKind11.VariableDeclaration)) {
31564
+ for (const decl of sf.getDescendantsOfKind(SyntaxKind12.VariableDeclaration)) {
31319
31565
  const entry = tryReadTaskHandlerEntry(decl, rel, seenSymbols);
31320
31566
  if (entry) {
31321
31567
  out.push(entry);
@@ -31994,7 +32240,7 @@ __export(storagefile_m_validate_app_exports, {
31994
32240
  });
31995
32241
 
31996
32242
  // packages/dbx-cli/validate/src/lib/storagefile-m-validate-app/extract.ts
31997
- import { Node as Node29, SyntaxKind as SyntaxKind12 } from "ts-morph";
32243
+ import { Node as Node29, SyntaxKind as SyntaxKind13 } from "ts-morph";
31998
32244
 
31999
32245
  // packages/dbx-cli/validate/src/lib/storagefile-m-validate-app/group-ids.ts
32000
32246
  var GROUP_IDS_FUNCTION_SUFFIXES = ["StorageFileGroupIds", "FileGroupIds"];
@@ -32138,7 +32384,7 @@ function extractUploadInitializerEntries(sources) {
32138
32384
  const out = [];
32139
32385
  for (const sf of sources) {
32140
32386
  const rel = apiRelPath(sf);
32141
- for (const decl of sf.getDescendantsOfKind(SyntaxKind12.VariableDeclaration)) {
32387
+ for (const decl of sf.getDescendantsOfKind(SyntaxKind13.VariableDeclaration)) {
32142
32388
  const typeText = typeAnnotationText(decl);
32143
32389
  if (typeText !== UPLOAD_SERVICE_INITIALIZER_TYPE) continue;
32144
32390
  const obj = asObjectLiteral(decl.getInitializer());
@@ -32303,7 +32549,7 @@ function extractUploadServiceCalls(sources, index) {
32303
32549
  const out = [];
32304
32550
  for (const sf of sources) {
32305
32551
  const rel = apiRelPath(sf);
32306
- for (const call of sf.getDescendantsOfKind(SyntaxKind12.CallExpression)) {
32552
+ for (const call of sf.getDescendantsOfKind(SyntaxKind13.CallExpression)) {
32307
32553
  const expr = call.getExpression();
32308
32554
  if (!Node29.isIdentifier(expr) || expr.getText() !== UPLOAD_SERVICE_FACTORY) continue;
32309
32555
  const args = call.getArguments();
@@ -32380,7 +32626,7 @@ function extractUploadServiceWirings(sources) {
32380
32626
  const out = [];
32381
32627
  for (const sf of sources) {
32382
32628
  const rel = apiRelPath(sf);
32383
- for (const obj of sf.getDescendantsOfKind(SyntaxKind12.ObjectLiteralExpression)) {
32629
+ for (const obj of sf.getDescendantsOfKind(SyntaxKind13.ObjectLiteralExpression)) {
32384
32630
  const provideIdent = readIdentifierProperty(obj, "provide");
32385
32631
  if (provideIdent !== UPLOAD_SERVICE_PROVIDE_TOKEN) continue;
32386
32632
  const useFactory = readIdentifierProperty(obj, "useFactory");
@@ -32393,7 +32639,7 @@ function extractProcessingConfigs(sources) {
32393
32639
  const out = [];
32394
32640
  for (const sf of sources) {
32395
32641
  const rel = apiRelPath(sf);
32396
- for (const decl of sf.getDescendantsOfKind(SyntaxKind12.VariableDeclaration)) {
32642
+ for (const decl of sf.getDescendantsOfKind(SyntaxKind13.VariableDeclaration)) {
32397
32643
  const config = extractProcessingConfigFromDecl(decl, rel);
32398
32644
  if (config) {
32399
32645
  out.push(config);
@@ -32437,7 +32683,7 @@ function extractProcessingHandlerCalls(sources) {
32437
32683
  const out = [];
32438
32684
  for (const sf of sources) {
32439
32685
  const rel = apiRelPath(sf);
32440
- for (const call of sf.getDescendantsOfKind(SyntaxKind12.CallExpression)) {
32686
+ for (const call of sf.getDescendantsOfKind(SyntaxKind13.CallExpression)) {
32441
32687
  const expr = call.getExpression();
32442
32688
  if (!Node29.isIdentifier(expr) || expr.getText() !== PROCESSING_HANDLER_FACTORY) continue;
32443
32689
  const args = call.getArguments();
@@ -32657,7 +32903,7 @@ function flagUploadServiceWiring(extracted, violations) {
32657
32903
  if (!anyWired) {
32658
32904
  pushViolation9(violations, {
32659
32905
  code: "STORAGEFILE_UPLOAD_SERVICE_NOT_WIRED",
32660
- message: `No NestJS provider with \`provide: StorageFileInitializeFromUploadService, useFactory: ${factoryNames.size > 0 ? [...factoryNames].join(" | ") : "<storage-file-upload-factory>"}\` found. Bind the factory function in a NestJS module.`,
32906
+ message: `No NestJS provider with \`provide: StorageFileInitializeFromUploadService, useFactory: ${factoryNames.size > 0 ? Array.from(factoryNames).join(" | ") : "<storage-file-upload-factory>"}\` found. Bind the factory function in a NestJS module.`,
32661
32907
  side: "api",
32662
32908
  file: void 0
32663
32909
  });
@@ -33833,7 +34079,7 @@ function toPosix2(p) {
33833
34079
  }
33834
34080
 
33835
34081
  // packages/dbx-cli/model-test/src/lib/test/extract.ts
33836
- import { Node as Node31, Project as Project14, SyntaxKind as SyntaxKind13 } from "ts-morph";
34082
+ import { Node as Node31, Project as Project14, SyntaxKind as SyntaxKind14 } from "ts-morph";
33837
34083
  var SPEC_FILE_VIRTUAL_PATH = "__spec__/spec.ts";
33838
34084
  var FIXTURE_CONTEXT_SUFFIX = "Context";
33839
34085
  var FIXTURE_FACTORY_SUFFIX = "ContextFactory";
@@ -33919,7 +34165,7 @@ function collectFixtureImports(sourceFile) {
33919
34165
  seen.add(name);
33920
34166
  }
33921
34167
  }
33922
- return [...seen];
34168
+ return Array.from(seen);
33923
34169
  }
33924
34170
  function matchesFixtureModulePath(spec) {
33925
34171
  return /(^|\/)test\/fixture(\.[a-z]+)?$/.test(spec);
@@ -33951,7 +34197,7 @@ function trimToCamelBoundary(s) {
33951
34197
  return s;
33952
34198
  }
33953
34199
  function dedupedSorted(names) {
33954
- return [...new Set(names)].sort((a, b) => a.localeCompare(b));
34200
+ return Array.from(new Set(names)).sort((a, b) => a.localeCompare(b));
33955
34201
  }
33956
34202
  function walkCall(call, ctx) {
33957
34203
  const calleeName = getCalleeName(call);
@@ -34161,7 +34407,7 @@ function appendHelperIfUsesDescribeOrIt(input) {
34161
34407
  function scanForDescribeOrIt(node) {
34162
34408
  const usage = { emitsDescribe: false, emitsIt: false };
34163
34409
  node.forEachDescendant((descendant) => {
34164
- if (descendant.getKind() !== SyntaxKind13.CallExpression) return;
34410
+ if (descendant.getKind() !== SyntaxKind14.CallExpression) return;
34165
34411
  const call = descendant;
34166
34412
  const expr = call.getExpression();
34167
34413
  if (!Node31.isIdentifier(expr)) return;
@@ -34180,7 +34426,7 @@ import { readFile as readFile14 } from "node:fs/promises";
34180
34426
  import { join as join15 } from "node:path";
34181
34427
 
34182
34428
  // packages/dbx-cli/model-test/src/lib/fixture/extract.ts
34183
- import { Node as Node32, Project as Project15, SyntaxKind as SyntaxKind14 } from "ts-morph";
34429
+ import { Node as Node32, Project as Project15, SyntaxKind as SyntaxKind15 } from "ts-morph";
34184
34430
 
34185
34431
  // packages/dbx-cli/model-test/src/lib/fixture/archetype.ts
34186
34432
  function classifyFixtureArchetype(input) {
@@ -34557,7 +34803,7 @@ function readParamsAccessFieldName(fn) {
34557
34803
  if (!Node32.isArrowFunction(fn) && !Node32.isFunctionExpression(fn)) return void 0;
34558
34804
  const body = fn.getBody();
34559
34805
  if (!body) return void 0;
34560
- for (const access2 of body.getDescendantsOfKind(SyntaxKind14.PropertyAccessExpression)) {
34806
+ for (const access2 of body.getDescendantsOfKind(SyntaxKind15.PropertyAccessExpression)) {
34561
34807
  const expr = access2.getExpression();
34562
34808
  if (Node32.isIdentifier(expr) && expr.getText() === "params") {
34563
34809
  return access2.getName();
@@ -34612,7 +34858,7 @@ function collectAllModels(fixtures, instances) {
34612
34858
  const all = /* @__PURE__ */ new Set();
34613
34859
  for (const k of fixtures.keys()) all.add(k);
34614
34860
  for (const k of instances.keys()) all.add(k);
34615
- const list = [...all];
34861
+ const list = Array.from(all);
34616
34862
  list.sort((a, b) => {
34617
34863
  const aLine = (fixtures.get(a) ?? instances.get(a))?.getStartLineNumber() ?? 0;
34618
34864
  const bLine = (fixtures.get(b) ?? instances.get(b))?.getStartLineNumber() ?? 0;
@@ -34647,8 +34893,8 @@ function readMethod(m) {
34647
34893
  return result;
34648
34894
  }
34649
34895
  function readVisibility(m) {
34650
- if (m.hasModifier(SyntaxKind14.PrivateKeyword)) return "private";
34651
- if (m.hasModifier(SyntaxKind14.ProtectedKeyword)) return "protected";
34896
+ if (m.hasModifier(SyntaxKind15.PrivateKeyword)) return "private";
34897
+ if (m.hasModifier(SyntaxKind15.ProtectedKeyword)) return "protected";
34652
34898
  return "public";
34653
34899
  }
34654
34900
  function readExtendsGenerics(cls) {
@@ -34666,7 +34912,7 @@ function collectIdentityImports(sourceFile) {
34666
34912
  }
34667
34913
  }
34668
34914
  }
34669
- const list = [...out];
34915
+ const list = Array.from(out);
34670
34916
  list.sort((a, b) => a.localeCompare(b));
34671
34917
  return list;
34672
34918
  }
@@ -36290,7 +36536,7 @@ import { join as join20, relative as relative16, sep as sep14 } from "node:path"
36290
36536
  // packages/dbx-cli/validate/src/lib/model-api-lookup/extract-actions.ts
36291
36537
  import { readFile as readFile19 } from "node:fs/promises";
36292
36538
  import { join as join19, relative as relative15, sep as sep13 } from "node:path";
36293
- import { Project as Project17, SyntaxKind as SyntaxKind15 } from "ts-morph";
36539
+ import { Project as Project17, SyntaxKind as SyntaxKind16 } from "ts-morph";
36294
36540
  var ACTION_SERVER_SUFFIX = ".action.server.ts";
36295
36541
  var COMMON_MODEL_SUBPATH = "src/app/common/model";
36296
36542
  async function buildActionLookup(apiAbs) {
@@ -36363,7 +36609,7 @@ function collectFactoryFunctions(input) {
36363
36609
  }
36364
36610
  }
36365
36611
  function findValidatorArgInBody(fn) {
36366
- for (const call of fn.getDescendantsOfKind(SyntaxKind15.CallExpression)) {
36612
+ for (const call of fn.getDescendantsOfKind(SyntaxKind16.CallExpression)) {
36367
36613
  const expr = call.getExpression();
36368
36614
  const exprText = expr.getText();
36369
36615
  if (!exprText.endsWith("firebaseServerActionTransformFunctionFactory")) continue;
@@ -37586,7 +37832,7 @@ async function readFileIfExists2(absPath) {
37586
37832
  }
37587
37833
 
37588
37834
  // packages/dbx-cli/validate/src/lib/dbx-color-template-list-app/extract.ts
37589
- import { Node as Node35, Project as Project19, SyntaxKind as SyntaxKind16 } from "ts-morph";
37835
+ import { Node as Node35, Project as Project19, SyntaxKind as SyntaxKind17 } from "ts-morph";
37590
37836
  var PROVIDE_FN_NAME = "provideDbxStyleService";
37591
37837
  var COLOR_SERVICE_CONFIG_PROP = "dbxColorServiceConfig";
37592
37838
  var TEMPLATES_PROP = "templates";
@@ -37612,7 +37858,7 @@ function extractColorTemplates(inspection) {
37612
37858
  }
37613
37859
  function findProvideCall(sf) {
37614
37860
  let result;
37615
- for (const call of sf.getDescendantsOfKind(SyntaxKind16.CallExpression)) {
37861
+ for (const call of sf.getDescendantsOfKind(SyntaxKind17.CallExpression)) {
37616
37862
  const callee = call.getExpression();
37617
37863
  if (Node35.isIdentifier(callee) && callee.getText() === PROVIDE_FN_NAME) {
37618
37864
  result = call;
@@ -37710,9 +37956,9 @@ function parseConfig(ctx, sf, obj) {
37710
37956
  function assignConfigField(input) {
37711
37957
  const { ctx, sf, result, name, value } = input;
37712
37958
  if (name === "tonal") {
37713
- if (value.getKind() === SyntaxKind16.TrueKeyword) {
37959
+ if (value.getKind() === SyntaxKind17.TrueKeyword) {
37714
37960
  result.tonal = true;
37715
- } else if (value.getKind() === SyntaxKind16.FalseKeyword) {
37961
+ } else if (value.getKind() === SyntaxKind17.FalseKeyword) {
37716
37962
  result.tonal = false;
37717
37963
  } else {
37718
37964
  ctx.warnings.push(buildWarning(sf, value, `Template config field \`tonal\` is not a boolean literal; ignored.`));
@@ -37831,7 +38077,7 @@ __export(dbx_color_smell_check_exports, {
37831
38077
  });
37832
38078
 
37833
38079
  // packages/dbx-cli/validate/src/lib/dbx-color-smell-check/extract.ts
37834
- import { Node as Node36, Project as Project20, SyntaxKind as SyntaxKind17 } from "ts-morph";
38080
+ import { Node as Node36, Project as Project20, SyntaxKind as SyntaxKind18 } from "ts-morph";
37835
38081
  var COLOR_INPUT_NAMES = /* @__PURE__ */ new Set(["color", "dbxColor", "dbxTextColor"]);
37836
38082
  var COLOR_TYPE_NAMES = /* @__PURE__ */ new Set(["DbxColorConfig", "DbxColorInput", "Maybe<DbxColorInput>", "Maybe<DbxColorConfig>"]);
37837
38083
  var KNOWN_CONFIG_KEYS = /* @__PURE__ */ new Set(["template", "color", "contrast", "tone", "tonal"]);
@@ -37839,7 +38085,7 @@ function extractTsLiterals(filePath, text) {
37839
38085
  const project = new Project20({ useInMemoryFileSystem: true, skipAddingFilesFromTsConfig: true });
37840
38086
  const sf = project.createSourceFile(filePath, text, { overwrite: true });
37841
38087
  const out = [];
37842
- for (const obj of sf.getDescendantsOfKind(SyntaxKind17.ObjectLiteralExpression)) {
38088
+ for (const obj of sf.getDescendantsOfKind(SyntaxKind18.ObjectLiteralExpression)) {
37843
38089
  if (!isInColorPosition(obj)) continue;
37844
38090
  const literal = parseObjectLiteral({ filePath, sf, obj });
37845
38091
  if (literal !== void 0) out.push(literal);
@@ -37905,8 +38151,8 @@ function parseObjectLiteral(input) {
37905
38151
  function assignRawField(input) {
37906
38152
  const { raw, name, value, onDynamic } = input;
37907
38153
  if (name === "tonal") {
37908
- if (value.getKind() === SyntaxKind17.TrueKeyword) raw.tonal = true;
37909
- else if (value.getKind() === SyntaxKind17.FalseKeyword) raw.tonal = false;
38154
+ if (value.getKind() === SyntaxKind18.TrueKeyword) raw.tonal = true;
38155
+ else if (value.getKind() === SyntaxKind18.FalseKeyword) raw.tonal = false;
37910
38156
  else onDynamic();
37911
38157
  return;
37912
38158
  }
@@ -41667,7 +41913,7 @@ function collectConflicts(extraction, rendered) {
41667
41913
  if (e.factoryName === rendered.factoryName) out.push(rendered.factoryName);
41668
41914
  if (e.singletonName === rendered.singletonName) out.push(rendered.singletonName);
41669
41915
  }
41670
- return [...new Set(out)];
41916
+ return Array.from(new Set(out));
41671
41917
  }
41672
41918
  var MODEL_FIXTURE_SCAFFOLD_TOOL = { definition: TOOL7, run: run6 };
41673
41919
 
@@ -43973,7 +44219,7 @@ function buildRemoteBase(args) {
43973
44219
  return { fragment, imports: buildImportLines(importsSet), notes };
43974
44220
  }
43975
44221
  function buildImportLines(symbols) {
43976
- const sorted = [...symbols].sort((a, b) => a.localeCompare(b));
44222
+ const sorted = Array.from(symbols).sort((a, b) => a.localeCompare(b));
43977
44223
  const result = [`import { ${sorted.join(", ")} } from '@dereekb/rxjs';`];
43978
44224
  return result;
43979
44225
  }
@@ -51217,7 +51463,7 @@ function groupBySource(entries) {
51217
51463
  bucket.push(entry);
51218
51464
  }
51219
51465
  }
51220
- return [...map.entries()].sort(([a], [b]) => a.localeCompare(b));
51466
+ return Array.from(map.entries()).sort(([a], [b]) => a.localeCompare(b));
51221
51467
  }
51222
51468
  var EXPLAIN_RULE_TOOL = { definition: TOOL16, run: run17 };
51223
51469
 
@@ -52129,7 +52375,7 @@ async function scanModelFacts(input) {
52129
52375
  }
52130
52376
  }
52131
52377
  }
52132
- return { interfaces: [...interfaces.values()], identities: [...identities.values()] };
52378
+ return { interfaces: Array.from(interfaces.values()), identities: Array.from(identities.values()) };
52133
52379
  }
52134
52380
  async function walkTypeScriptFiles(dir) {
52135
52381
  const out = [];
@@ -52152,7 +52398,7 @@ async function walkTypeScriptFiles(dir) {
52152
52398
  return out;
52153
52399
  }
52154
52400
  function readManifestModelTypes(source) {
52155
- return [...source.matchAll(/modelType:\s*'([^']+)'/g)].map((m) => m[1]);
52401
+ return Array.from(source.matchAll(/modelType:\s*'([^']+)'/g)).map((m) => m[1]);
52156
52402
  }
52157
52403
  async function readOptionalFile(path) {
52158
52404
  return readFile31(path, "utf8").catch(() => void 0);
@@ -53947,7 +54193,7 @@ function expandIntentQuery(query) {
53947
54193
  if (trimmed.length === 0) {
53948
54194
  result = [];
53949
54195
  } else {
53950
- result = [...collectSynonyms(trimmed)];
54196
+ result = Array.from(collectSynonyms(trimmed));
53951
54197
  }
53952
54198
  return result;
53953
54199
  }