@dereekb/dbx-components-mcp 14.4.0 → 14.5.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.
package/dbx-components-mcp.js
CHANGED
|
@@ -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.
|
|
13
|
+
version: "14.5.0",
|
|
14
14
|
sideEffects: false,
|
|
15
15
|
type: "module",
|
|
16
16
|
bin: {
|
|
@@ -22,8 +22,8 @@ var package_default = {
|
|
|
22
22
|
"ts-morph": "^21.0.0"
|
|
23
23
|
},
|
|
24
24
|
peerDependencies: {
|
|
25
|
-
"@dereekb/dbx-cli": "14.
|
|
26
|
-
"@dereekb/util": "14.
|
|
25
|
+
"@dereekb/dbx-cli": "14.5.0",
|
|
26
|
+
"@dereekb/util": "14.5.0"
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -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";
|
|
@@ -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 =
|
|
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
|
|
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
|
|
@@ -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 =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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] } : {},
|
|
@@ -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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
14717
|
-
const target =
|
|
14718
|
-
const rel =
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
14959
|
+
import { dirname as dirname9, isAbsolute as isAbsolute9, resolve as resolve27 } from "node:path";
|
|
14943
14960
|
|
|
14944
14961
|
// packages/dbx-cli/firestore-indexes/src/firestore-indexes-generate.ts
|
|
14945
14962
|
function generateFirestoreIndexesJson(input) {
|
|
@@ -15536,7 +15553,7 @@ async function loadModelFirebaseIndexRegistry(input) {
|
|
|
15536
15553
|
const baseDir = dirname9(configResult.configPath);
|
|
15537
15554
|
const declared = configResult.config.modelFirebaseIndex?.sources ?? [];
|
|
15538
15555
|
for (const source of declared) {
|
|
15539
|
-
const absolute =
|
|
15556
|
+
const absolute = isAbsolute9(source) ? source : resolve27(baseDir, source);
|
|
15540
15557
|
externalSources.push({ origin: "external", path: absolute });
|
|
15541
15558
|
}
|
|
15542
15559
|
}
|
|
@@ -15562,7 +15579,7 @@ async function loadModelFirebaseIndexRegistry(input) {
|
|
|
15562
15579
|
}
|
|
15563
15580
|
|
|
15564
15581
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.ts
|
|
15565
|
-
import { dirname as dirname10, isAbsolute as
|
|
15582
|
+
import { dirname as dirname10, isAbsolute as isAbsolute10, resolve as resolve28 } from "node:path";
|
|
15566
15583
|
|
|
15567
15584
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.ts
|
|
15568
15585
|
async function loadModelSnapshotFieldManifests(input) {
|
|
@@ -15590,7 +15607,7 @@ async function loadModelSnapshotFieldRegistry(input) {
|
|
|
15590
15607
|
const baseDir = dirname10(configResult.configPath);
|
|
15591
15608
|
const declared = configResult.config.modelSnapshotFields?.sources ?? [];
|
|
15592
15609
|
for (const source of declared) {
|
|
15593
|
-
const absolute =
|
|
15610
|
+
const absolute = isAbsolute10(source) ? source : resolve28(baseDir, source);
|
|
15594
15611
|
externalSources.push({ origin: "external", path: absolute });
|
|
15595
15612
|
}
|
|
15596
15613
|
}
|
|
@@ -15617,7 +15634,7 @@ async function loadModelSnapshotFieldRegistry(input) {
|
|
|
15617
15634
|
}
|
|
15618
15635
|
|
|
15619
15636
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/load-pipes-registry.ts
|
|
15620
|
-
import { dirname as dirname11, isAbsolute as
|
|
15637
|
+
import { dirname as dirname11, isAbsolute as isAbsolute11, resolve as resolve29 } from "node:path";
|
|
15621
15638
|
|
|
15622
15639
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/pipes-loader.ts
|
|
15623
15640
|
async function loadPipeManifests(input) {
|
|
@@ -15645,7 +15662,7 @@ async function loadPipeRegistry(input) {
|
|
|
15645
15662
|
const baseDir = dirname11(configResult.configPath);
|
|
15646
15663
|
const declared = configResult.config.pipes?.sources ?? [];
|
|
15647
15664
|
for (const source of declared) {
|
|
15648
|
-
const absolute =
|
|
15665
|
+
const absolute = isAbsolute11(source) ? source : resolve29(baseDir, source);
|
|
15649
15666
|
externalSources.push({ origin: "external", path: absolute });
|
|
15650
15667
|
}
|
|
15651
15668
|
}
|
|
@@ -15668,7 +15685,7 @@ async function loadPipeRegistry(input) {
|
|
|
15668
15685
|
}
|
|
15669
15686
|
|
|
15670
15687
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/load-tokens-registry.ts
|
|
15671
|
-
import { dirname as dirname12, isAbsolute as
|
|
15688
|
+
import { dirname as dirname12, isAbsolute as isAbsolute12, resolve as resolve30 } from "node:path";
|
|
15672
15689
|
|
|
15673
15690
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/tokens-schema.ts
|
|
15674
15691
|
import { type as type42 } from "arktype";
|
|
@@ -15758,11 +15775,11 @@ function collectExternalTokenSources(configResult) {
|
|
|
15758
15775
|
return externalSources;
|
|
15759
15776
|
}
|
|
15760
15777
|
function toAbsolutePath2(baseDir, value) {
|
|
15761
|
-
return
|
|
15778
|
+
return isAbsolute12(value) ? value : resolve30(baseDir, value);
|
|
15762
15779
|
}
|
|
15763
15780
|
|
|
15764
15781
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/load-ui-components-registry.ts
|
|
15765
|
-
import { dirname as dirname13, isAbsolute as
|
|
15782
|
+
import { dirname as dirname13, isAbsolute as isAbsolute13, resolve as resolve31 } from "node:path";
|
|
15766
15783
|
|
|
15767
15784
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/ui-components-loader.ts
|
|
15768
15785
|
async function loadUiComponentManifests(input) {
|
|
@@ -15790,7 +15807,7 @@ async function loadUiComponentRegistry(input) {
|
|
|
15790
15807
|
const baseDir = dirname13(configResult.configPath);
|
|
15791
15808
|
const declared = configResult.config.uiComponents?.sources ?? [];
|
|
15792
15809
|
for (const source of declared) {
|
|
15793
|
-
const absolute =
|
|
15810
|
+
const absolute = isAbsolute13(source) ? source : resolve31(baseDir, source);
|
|
15794
15811
|
externalSources.push({ origin: "external", path: absolute });
|
|
15795
15812
|
}
|
|
15796
15813
|
}
|
|
@@ -15813,7 +15830,7 @@ async function loadUiComponentRegistry(input) {
|
|
|
15813
15830
|
}
|
|
15814
15831
|
|
|
15815
15832
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/load-utils-registry.ts
|
|
15816
|
-
import { dirname as dirname14, isAbsolute as
|
|
15833
|
+
import { dirname as dirname14, isAbsolute as isAbsolute14, resolve as resolve32 } from "node:path";
|
|
15817
15834
|
|
|
15818
15835
|
// packages/dbx-cli/src/lib/mcp-scan/manifest/utils-loader.ts
|
|
15819
15836
|
async function loadUtilManifests(input) {
|
|
@@ -15841,7 +15858,7 @@ async function loadUtilRegistry(input) {
|
|
|
15841
15858
|
const baseDir = dirname14(configResult.configPath);
|
|
15842
15859
|
const declared = configResult.config.utils?.sources ?? [];
|
|
15843
15860
|
for (const source of declared) {
|
|
15844
|
-
const absolute =
|
|
15861
|
+
const absolute = isAbsolute14(source) ? source : resolve32(baseDir, source);
|
|
15845
15862
|
externalSources.push({ origin: "external", path: absolute });
|
|
15846
15863
|
}
|
|
15847
15864
|
}
|
|
@@ -16989,7 +17006,7 @@ function detectMissingRouteModels(states, warnings) {
|
|
|
16989
17006
|
// packages/dbx-components-mcp/src/server.ts
|
|
16990
17007
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
16991
17008
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
16992
|
-
import { dirname as dirname23, isAbsolute as
|
|
17009
|
+
import { dirname as dirname23, isAbsolute as isAbsolute20, resolve as resolvePath4 } from "node:path";
|
|
16993
17010
|
|
|
16994
17011
|
// packages/dbx-components-mcp/src/resources/form-fields.resource.ts
|
|
16995
17012
|
import { ResourceTemplate } from "@modelcontextprotocol/server";
|
|
@@ -25664,22 +25681,22 @@ function formatSeeAlso(ref) {
|
|
|
25664
25681
|
// packages/dbx-cli/validate/src/lib/_core/validate-input.ts
|
|
25665
25682
|
import { glob as fsGlob5, readFile as readFile5, stat as stat4 } from "node:fs/promises";
|
|
25666
25683
|
import { resolve as resolve34, sep as sep5 } from "node:path";
|
|
25667
|
-
function ensurePathInsideCwd(
|
|
25684
|
+
function ensurePathInsideCwd(relative23, cwd) {
|
|
25668
25685
|
const cwdPrefix = cwd.endsWith(sep5) ? cwd : cwd + sep5;
|
|
25669
|
-
const absolute = resolve34(cwd,
|
|
25686
|
+
const absolute = resolve34(cwd, relative23);
|
|
25670
25687
|
if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
|
|
25671
|
-
throw new Error(`Path \`${
|
|
25688
|
+
throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
|
|
25672
25689
|
}
|
|
25673
25690
|
}
|
|
25674
25691
|
async function resolveFolderPaths(config) {
|
|
25675
25692
|
const { paths, glob: glob2, cwd } = config;
|
|
25676
25693
|
const collected = [];
|
|
25677
25694
|
const seen = /* @__PURE__ */ new Set();
|
|
25678
|
-
const accept = (
|
|
25679
|
-
if (seen.has(
|
|
25680
|
-
ensurePathInsideCwd(
|
|
25681
|
-
seen.add(
|
|
25682
|
-
collected.push(
|
|
25695
|
+
const accept = (relative23) => {
|
|
25696
|
+
if (seen.has(relative23)) return;
|
|
25697
|
+
ensurePathInsideCwd(relative23, cwd);
|
|
25698
|
+
seen.add(relative23);
|
|
25699
|
+
collected.push(relative23);
|
|
25683
25700
|
};
|
|
25684
25701
|
if (paths) {
|
|
25685
25702
|
for (const p of paths) {
|
|
@@ -25722,13 +25739,13 @@ async function resolveValidatorSources(config) {
|
|
|
25722
25739
|
pathList.push(match);
|
|
25723
25740
|
}
|
|
25724
25741
|
}
|
|
25725
|
-
for (const
|
|
25726
|
-
if (seenNames.has(
|
|
25727
|
-
ensurePathInsideCwd(
|
|
25728
|
-
const absolute = resolve34(cwd,
|
|
25742
|
+
for (const relative23 of pathList) {
|
|
25743
|
+
if (seenNames.has(relative23)) continue;
|
|
25744
|
+
ensurePathInsideCwd(relative23, cwd);
|
|
25745
|
+
const absolute = resolve34(cwd, relative23);
|
|
25729
25746
|
const text = await readFile5(absolute, "utf8");
|
|
25730
|
-
seenNames.add(
|
|
25731
|
-
collected.push({ name:
|
|
25747
|
+
seenNames.add(relative23);
|
|
25748
|
+
collected.push({ name: relative23, text });
|
|
25732
25749
|
}
|
|
25733
25750
|
return collected;
|
|
25734
25751
|
}
|
|
@@ -28979,7 +28996,7 @@ __export(model_api_validate_app_exports, {
|
|
|
28979
28996
|
|
|
28980
28997
|
// packages/dbx-cli/validate/src/lib/model-api-validate-app/extract-declarations.ts
|
|
28981
28998
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
28982
|
-
import { relative as
|
|
28999
|
+
import { relative as relative9, sep as sep6 } from "node:path";
|
|
28983
29000
|
|
|
28984
29001
|
// packages/dbx-cli/manifest-extract/src/lib/extract-crud.ts
|
|
28985
29002
|
import { Node as Node23, Project as Project8 } from "ts-morph";
|
|
@@ -29861,7 +29878,7 @@ var API_SUFFIX = ".api.ts";
|
|
|
29861
29878
|
async function extractDeclaredEntriesFromFile(fileAbs, root) {
|
|
29862
29879
|
const text = await readFile8(fileAbs, "utf8");
|
|
29863
29880
|
if (!text.includes("callModelFirebaseFunctionMapFactory")) return [];
|
|
29864
|
-
const fileRel =
|
|
29881
|
+
const fileRel = relative9(root.relativeBase, fileAbs).split(sep6).join("/");
|
|
29865
29882
|
const extraction = extractCrudEntries({ name: fileRel, text });
|
|
29866
29883
|
const out = [];
|
|
29867
29884
|
for (const entry of extraction.entries) {
|
|
@@ -30117,7 +30134,7 @@ function normalize2(value) {
|
|
|
30117
30134
|
|
|
30118
30135
|
// packages/dbx-cli/validate/src/lib/model-api-validate-app/source-roots.ts
|
|
30119
30136
|
import { readFile as readFile10, stat as stat8 } from "node:fs/promises";
|
|
30120
|
-
import { dirname as dirname16, isAbsolute as
|
|
30137
|
+
import { dirname as dirname16, isAbsolute as isAbsolute15, join as join10, relative as relative10, resolve as resolve35, sep as sep7 } from "node:path";
|
|
30121
30138
|
var TSCONFIG_BASE = "tsconfig.base.json";
|
|
30122
30139
|
var COMPONENT_PACKAGE_JSON = "package.json";
|
|
30123
30140
|
var SRC_LIB_SUBPATH = "src/lib";
|
|
@@ -30227,7 +30244,7 @@ async function readTsconfigPaths(workspaceRoot) {
|
|
|
30227
30244
|
function resolvePackageRoot(input) {
|
|
30228
30245
|
const target = input.paths.entries.get(input.packageName);
|
|
30229
30246
|
if (!target) return void 0;
|
|
30230
|
-
const targetAbs =
|
|
30247
|
+
const targetAbs = isAbsolute15(target) ? target : resolve35(input.workspaceRoot, target);
|
|
30231
30248
|
return dirname16(dirname16(targetAbs));
|
|
30232
30249
|
}
|
|
30233
30250
|
async function isDirectory2(path) {
|
|
@@ -30244,7 +30261,7 @@ function isRecord(value) {
|
|
|
30244
30261
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30245
30262
|
}
|
|
30246
30263
|
function toWorkspaceRel(workspaceRoot, abs) {
|
|
30247
|
-
const rel =
|
|
30264
|
+
const rel = relative10(workspaceRoot, abs);
|
|
30248
30265
|
return rel.split(sep7).join("/");
|
|
30249
30266
|
}
|
|
30250
30267
|
function stripJsonComments(value) {
|
|
@@ -31110,7 +31127,7 @@ function formatResult4(result) {
|
|
|
31110
31127
|
|
|
31111
31128
|
// packages/dbx-cli/validate/src/lib/dbx-asset-validate-app/inspect.ts
|
|
31112
31129
|
import { readdir as readdir5, readFile as readFile11, stat as stat9 } from "node:fs/promises";
|
|
31113
|
-
import { join as join11, relative as
|
|
31130
|
+
import { join as join11, relative as relative11, sep as sep8 } from "node:path";
|
|
31114
31131
|
var COMPONENT_LIB_SUBPATH = "src/lib";
|
|
31115
31132
|
var APP_ROOT_CONFIG_RELPATH = "src/root.app.config.ts";
|
|
31116
31133
|
var APP_ASSETS_SUBPATH = "src/assets";
|
|
@@ -31150,7 +31167,7 @@ async function inspectComponentLib(rootDir) {
|
|
|
31150
31167
|
const abs = join11(libDir, name);
|
|
31151
31168
|
const text = await readFileIfExists(abs);
|
|
31152
31169
|
if (text !== void 0) {
|
|
31153
|
-
const rel =
|
|
31170
|
+
const rel = relative11(rootDir, abs).split(sep8).join("/");
|
|
31154
31171
|
files.push({ relPath: rel, text });
|
|
31155
31172
|
}
|
|
31156
31173
|
}
|
|
@@ -31215,7 +31232,7 @@ async function collectFilesUnder(absRoot) {
|
|
|
31215
31232
|
continue;
|
|
31216
31233
|
}
|
|
31217
31234
|
if (!entry.isFile()) continue;
|
|
31218
|
-
const rel =
|
|
31235
|
+
const rel = relative11(absRoot, full).split(sep8).join("/");
|
|
31219
31236
|
out.add(rel);
|
|
31220
31237
|
}
|
|
31221
31238
|
}
|
|
@@ -32555,7 +32572,7 @@ function formatResult6(result) {
|
|
|
32555
32572
|
|
|
32556
32573
|
// packages/dbx-cli/validate/src/lib/_core/_validate/inspect.ts
|
|
32557
32574
|
import { readdir as readdir6, readFile as readFile12, stat as stat10 } from "node:fs/promises";
|
|
32558
|
-
import { join as join12, relative as
|
|
32575
|
+
import { join as join12, relative as relative12, sep as sep9 } from "node:path";
|
|
32559
32576
|
async function inspectSide2(rootDir, subpaths) {
|
|
32560
32577
|
const rootStatus = await readRootStatus(rootDir);
|
|
32561
32578
|
if (rootStatus !== void 0) {
|
|
@@ -32626,7 +32643,7 @@ async function collectFromDirectory(input) {
|
|
|
32626
32643
|
}
|
|
32627
32644
|
if (!isCollectableTsFile(entry)) continue;
|
|
32628
32645
|
const text = await readFile12(full, "utf8");
|
|
32629
|
-
const rel =
|
|
32646
|
+
const rel = relative12(rootDir, full).split(sep9).join("/");
|
|
32630
32647
|
out.push({ relPath: rel, text });
|
|
32631
32648
|
}
|
|
32632
32649
|
}
|
|
@@ -34491,7 +34508,7 @@ __export(model_list_component_exports, {
|
|
|
34491
34508
|
|
|
34492
34509
|
// packages/dbx-cli/model-test/src/lib/test/discover.ts
|
|
34493
34510
|
import { readdir as readdir8, stat as stat12 } from "node:fs/promises";
|
|
34494
|
-
import { join as join14, relative as
|
|
34511
|
+
import { join as join14, relative as relative13, sep as sep10 } from "node:path";
|
|
34495
34512
|
var FUNCTION_DIR_REL = "src/app/function";
|
|
34496
34513
|
async function discoverSpecFilesByGroup(config) {
|
|
34497
34514
|
const { apiAbs, apiRel } = config;
|
|
@@ -34539,7 +34556,7 @@ async function collectSpecFiles(config) {
|
|
|
34539
34556
|
}
|
|
34540
34557
|
if (!entry.isFile()) continue;
|
|
34541
34558
|
if (!entry.name.endsWith(".spec.ts")) continue;
|
|
34542
|
-
const fileRel = toPosix2(`${apiRel}/${
|
|
34559
|
+
const fileRel = toPosix2(`${apiRel}/${relative13(apiAbs, fullAbs)}`);
|
|
34543
34560
|
const classification = classifySpecFile({ filename: entry.name, parentFolderName: current.relativeDirName });
|
|
34544
34561
|
collected.push({ filename: entry.name, fileRel, classification });
|
|
34545
34562
|
}
|
|
@@ -36645,7 +36662,7 @@ function topLevelColonIndex(text) {
|
|
|
36645
36662
|
|
|
36646
36663
|
// packages/dbx-cli/validate/src/lib/model-list-component/extract.ts
|
|
36647
36664
|
import { readdir as readdir9, readFile as readFile17, stat as stat13 } from "node:fs/promises";
|
|
36648
|
-
import { basename as basename8, join as join17, relative as
|
|
36665
|
+
import { basename as basename8, join as join17, relative as relative14, sep as sep11 } from "node:path";
|
|
36649
36666
|
import { Node as Node33, Project as Project16 } from "ts-morph";
|
|
36650
36667
|
var MODEL_SUBPATH2 = "src/lib/model";
|
|
36651
36668
|
var MODEL_SUBPATH_PREFIX = `${MODEL_SUBPATH2}/`;
|
|
@@ -36747,7 +36764,7 @@ async function fallbackForFolder(input) {
|
|
|
36747
36764
|
const sourceFile = project.createSourceFile(mainFile.fileName, mainFile.text, { overwrite: true });
|
|
36748
36765
|
const identity = findIdentityIn(sourceFile);
|
|
36749
36766
|
if (!identity) return void 0;
|
|
36750
|
-
const sourceFileRel =
|
|
36767
|
+
const sourceFileRel = relative14(componentAbs, mainFile.absPath).split(sep11).join("/");
|
|
36751
36768
|
return {
|
|
36752
36769
|
folder,
|
|
36753
36770
|
modelName: deriveModelName(identity.constName, folder),
|
|
@@ -36930,7 +36947,7 @@ __export(model_api_list_app_exports, {
|
|
|
36930
36947
|
|
|
36931
36948
|
// packages/dbx-cli/validate/src/lib/model-api-list-app/extract.ts
|
|
36932
36949
|
import { readFile as readFile18 } from "node:fs/promises";
|
|
36933
|
-
import { join as join18, relative as
|
|
36950
|
+
import { join as join18, relative as relative15, sep as sep12 } from "node:path";
|
|
36934
36951
|
var API_SUFFIX2 = ".api.ts";
|
|
36935
36952
|
var MODEL_SUBPATH3 = "src/lib";
|
|
36936
36953
|
async function extractApiList(input) {
|
|
@@ -36943,7 +36960,7 @@ async function extractApiList(input) {
|
|
|
36943
36960
|
if (!text.includes("callModelFirebaseFunctionMapFactory")) {
|
|
36944
36961
|
continue;
|
|
36945
36962
|
}
|
|
36946
|
-
const sourceFileRel =
|
|
36963
|
+
const sourceFileRel = relative15(input.componentAbs, filePath).split(sep12).join("/");
|
|
36947
36964
|
const extraction = extractCrudEntries({ name: sourceFileRel, text });
|
|
36948
36965
|
const fileEntries = extraction.entries.map((entry) => ({ ...entry, sourceFile: sourceFileRel }));
|
|
36949
36966
|
const counts = countVerbs(fileEntries);
|
|
@@ -37075,11 +37092,11 @@ __export(model_api_lookup_exports, {
|
|
|
37075
37092
|
|
|
37076
37093
|
// packages/dbx-cli/validate/src/lib/model-api-lookup/extract.ts
|
|
37077
37094
|
import { readFile as readFile20 } from "node:fs/promises";
|
|
37078
|
-
import { join as join20, relative as
|
|
37095
|
+
import { join as join20, relative as relative17, sep as sep14 } from "node:path";
|
|
37079
37096
|
|
|
37080
37097
|
// packages/dbx-cli/validate/src/lib/model-api-lookup/extract-actions.ts
|
|
37081
37098
|
import { readFile as readFile19 } from "node:fs/promises";
|
|
37082
|
-
import { join as join19, relative as
|
|
37099
|
+
import { join as join19, relative as relative16, sep as sep13 } from "node:path";
|
|
37083
37100
|
import { Project as Project17, SyntaxKind as SyntaxKind16 } from "ts-morph";
|
|
37084
37101
|
var ACTION_SERVER_SUFFIX = ".action.server.ts";
|
|
37085
37102
|
var COMMON_MODEL_SUBPATH = "src/app/common/model";
|
|
@@ -37095,7 +37112,7 @@ async function buildActionLookup(apiAbs) {
|
|
|
37095
37112
|
for (const filePath of files) {
|
|
37096
37113
|
const text = await readFile19(filePath, "utf8");
|
|
37097
37114
|
const sourceFile = project.createSourceFile(filePath, text, { overwrite: true });
|
|
37098
|
-
const sourceFileRel =
|
|
37115
|
+
const sourceFileRel = relative16(apiAbs, filePath).split(sep13).join("/");
|
|
37099
37116
|
collectAbstractMethods({ sourceFile, sourceFileRel, methodsByParams });
|
|
37100
37117
|
collectFactoryFunctions({ sourceFile, sourceFileRel, factoriesByParams });
|
|
37101
37118
|
}
|
|
@@ -37261,7 +37278,7 @@ async function collectApiSources(componentAbs) {
|
|
|
37261
37278
|
for (const fileAbs of files) {
|
|
37262
37279
|
const text = await readFile20(fileAbs, "utf8");
|
|
37263
37280
|
if (!text.includes("callModelFirebaseFunctionMapFactory")) continue;
|
|
37264
|
-
const fileRel =
|
|
37281
|
+
const fileRel = relative17(componentAbs, fileAbs).split(sep14).join("/");
|
|
37265
37282
|
sources.push({ fileAbs, fileRel, text });
|
|
37266
37283
|
}
|
|
37267
37284
|
return sources;
|
|
@@ -37410,7 +37427,7 @@ __export(server_actions_list_app_exports, {
|
|
|
37410
37427
|
|
|
37411
37428
|
// packages/dbx-cli/validate/src/lib/server-actions-list-app/extract.ts
|
|
37412
37429
|
import { readdir as readdir10, readFile as readFile21 } from "node:fs/promises";
|
|
37413
|
-
import { dirname as dirname17, join as join21, relative as
|
|
37430
|
+
import { dirname as dirname17, join as join21, relative as relative18, sep as sep15 } from "node:path";
|
|
37414
37431
|
import { Node as Node34, Project as Project18 } from "ts-morph";
|
|
37415
37432
|
var ACTION_SERVER_SUFFIX2 = ".action.server.ts";
|
|
37416
37433
|
var COMMON_MODEL_SUBPATH2 = "src/app/common/model";
|
|
@@ -37443,7 +37460,7 @@ async function extractServerActions(apiAbs, apiRel) {
|
|
|
37443
37460
|
const wiring = await inspectSiblingModule(filePath, className);
|
|
37444
37461
|
const expectedGetterName = camelize(className);
|
|
37445
37462
|
const fixtureCoverage = fixtureStatus === "ok" ? fixtureCoverageMap.get(expectedGetterName) ?? unmatchedFixtureCoverage(expectedGetterName) : void 0;
|
|
37446
|
-
const sourceFileRel =
|
|
37463
|
+
const sourceFileRel = relative18(apiAbs, filePath).split(sep15).join("/");
|
|
37447
37464
|
entries.push({
|
|
37448
37465
|
className,
|
|
37449
37466
|
sourceFile: sourceFileRel,
|
|
@@ -38327,7 +38344,7 @@ __export(dbx_color_template_list_app_exports, {
|
|
|
38327
38344
|
|
|
38328
38345
|
// packages/dbx-cli/validate/src/lib/dbx-color-template-list-app/inspect.ts
|
|
38329
38346
|
import { readFile as readFile22 } from "node:fs/promises";
|
|
38330
|
-
import { join as join22, relative as
|
|
38347
|
+
import { join as join22, relative as relative19, sep as sep16 } from "node:path";
|
|
38331
38348
|
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
38349
|
async function inspectColorTemplates(apiAbs, apiRel) {
|
|
38333
38350
|
const present = [];
|
|
@@ -38337,7 +38354,7 @@ async function inspectColorTemplates(apiAbs, apiRel) {
|
|
|
38337
38354
|
for (const candidate of candidates) {
|
|
38338
38355
|
const text = await readFileIfExists2(candidate);
|
|
38339
38356
|
if (text === void 0) continue;
|
|
38340
|
-
const rel =
|
|
38357
|
+
const rel = relative19(apiAbs, candidate).split(sep16).join("/");
|
|
38341
38358
|
present.push({ relPath: rel, text });
|
|
38342
38359
|
}
|
|
38343
38360
|
} catch (err) {
|
|
@@ -40933,10 +40950,10 @@ function createFolderValidateTool(config) {
|
|
|
40933
40950
|
const inspections = [];
|
|
40934
40951
|
let readError;
|
|
40935
40952
|
try {
|
|
40936
|
-
for (const
|
|
40937
|
-
const absolute = resolve36(cwd,
|
|
40953
|
+
for (const relative23 of paths) {
|
|
40954
|
+
const absolute = resolve36(cwd, relative23);
|
|
40938
40955
|
const inspection = await inspectFolder5(absolute);
|
|
40939
|
-
const relativized = { ...inspection, path:
|
|
40956
|
+
const relativized = { ...inspection, path: relative23 };
|
|
40940
40957
|
inspections.push(relativized);
|
|
40941
40958
|
}
|
|
40942
40959
|
} catch (err) {
|
|
@@ -46360,7 +46377,7 @@ import { type as type80 } from "arktype";
|
|
|
46360
46377
|
|
|
46361
46378
|
// packages/dbx-components-mcp/src/tools/route/load-sources.ts
|
|
46362
46379
|
import { glob as fsGlob6, readFile as readFile24, stat as stat14 } from "node:fs/promises";
|
|
46363
|
-
import { dirname as dirname18, isAbsolute as
|
|
46380
|
+
import { dirname as dirname18, isAbsolute as isAbsolute16, resolve as resolve53, sep as sep17 } from "node:path";
|
|
46364
46381
|
var TRY_EXTENSIONS2 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
|
|
46365
46382
|
async function loadRouteSources(args) {
|
|
46366
46383
|
const cwdResolved = args.cwd ? resolve53(process.cwd(), args.cwd) : process.cwd();
|
|
@@ -46374,8 +46391,8 @@ async function loadRouteSources(args) {
|
|
|
46374
46391
|
}
|
|
46375
46392
|
}
|
|
46376
46393
|
const initialPaths = await collectInitialPaths(args, cwdResolved);
|
|
46377
|
-
for (const
|
|
46378
|
-
await loadOne(
|
|
46394
|
+
for (const relative23 of initialPaths) {
|
|
46395
|
+
await loadOne(relative23, cwdResolved, collected);
|
|
46379
46396
|
}
|
|
46380
46397
|
if (args.walkImports) {
|
|
46381
46398
|
await walkRelativeImports(collected, cwdResolved);
|
|
@@ -46431,22 +46448,22 @@ async function walkRelativeImports(collected, cwdResolved) {
|
|
|
46431
46448
|
}
|
|
46432
46449
|
}
|
|
46433
46450
|
}
|
|
46434
|
-
async function loadOne(
|
|
46435
|
-
if (into.has(
|
|
46451
|
+
async function loadOne(relative23, cwd, into) {
|
|
46452
|
+
if (into.has(relative23)) {
|
|
46436
46453
|
return;
|
|
46437
46454
|
}
|
|
46438
|
-
const absolute = resolve53(cwd,
|
|
46455
|
+
const absolute = resolve53(cwd, relative23);
|
|
46439
46456
|
const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
|
|
46440
46457
|
if (!absolute.startsWith(cwdPrefix) && absolute !== cwd) {
|
|
46441
|
-
throw new Error(`Path \`${
|
|
46458
|
+
throw new Error(`Path \`${relative23}\` resolves outside the server cwd and is not allowed.`);
|
|
46442
46459
|
}
|
|
46443
46460
|
const text = await readFile24(absolute, "utf8");
|
|
46444
|
-
into.set(
|
|
46461
|
+
into.set(relative23, { name: relative23, text });
|
|
46445
46462
|
}
|
|
46446
46463
|
async function resolveRelativeImport(fromFile, specifier, cwd) {
|
|
46447
46464
|
let result;
|
|
46448
46465
|
if (specifier.startsWith(".")) {
|
|
46449
|
-
const fromAbsolute =
|
|
46466
|
+
const fromAbsolute = isAbsolute16(fromFile) ? fromFile : resolve53(cwd, fromFile);
|
|
46450
46467
|
const fromDir = dirname18(fromAbsolute);
|
|
46451
46468
|
const baseAbsolute = resolve53(fromDir, specifier);
|
|
46452
46469
|
const cwdPrefix = cwd.endsWith(sep17) ? cwd : cwd + sep17;
|
|
@@ -47175,7 +47192,7 @@ import { type as type83 } from "arktype";
|
|
|
47175
47192
|
|
|
47176
47193
|
// packages/dbx-components-mcp/src/tools/route/resolve-url.ts
|
|
47177
47194
|
import { readFile as readFile26, stat as stat15 } from "node:fs/promises";
|
|
47178
|
-
import { dirname as dirname20, isAbsolute as
|
|
47195
|
+
import { dirname as dirname20, isAbsolute as isAbsolute17, resolve as resolve55, sep as sep19 } from "node:path";
|
|
47179
47196
|
|
|
47180
47197
|
// packages/dbx-components-mcp/src/tools/route/app-port-map.ts
|
|
47181
47198
|
import { glob as fsGlob7, readFile as readFile25 } from "node:fs/promises";
|
|
@@ -47423,7 +47440,7 @@ function collectSiblings(node) {
|
|
|
47423
47440
|
var TRY_EXTENSIONS3 = [".ts", ".tsx", "/index.ts", "/index.tsx"];
|
|
47424
47441
|
async function resolveComponentFile(input) {
|
|
47425
47442
|
const cwdResolved = input.cwd ? resolve55(process.cwd(), input.cwd) : process.cwd();
|
|
47426
|
-
const routerAbsolute =
|
|
47443
|
+
const routerAbsolute = isAbsolute17(input.routerFile) ? input.routerFile : resolve55(cwdResolved, input.routerFile);
|
|
47427
47444
|
let text;
|
|
47428
47445
|
try {
|
|
47429
47446
|
text = await readFile26(routerAbsolute, "utf8");
|
|
@@ -52858,7 +52875,7 @@ var FIRESTORE_RULES_SCAN_TOOL = { definition: TOOL18, run: run19 };
|
|
|
52858
52875
|
|
|
52859
52876
|
// packages/dbx-components-mcp/src/tools/model-server-only-validate-app.tool.ts
|
|
52860
52877
|
import { readdir as readdir12, readFile as readFile31, stat as stat17 } from "node:fs/promises";
|
|
52861
|
-
import { join as join26, relative as
|
|
52878
|
+
import { join as join26, relative as relative20, resolve as resolve62 } from "node:path";
|
|
52862
52879
|
import { type as type94 } from "arktype";
|
|
52863
52880
|
|
|
52864
52881
|
// packages/dbx-components-mcp/src/tools/model-server-only-validate-app/extract-service-flags.ts
|
|
@@ -53237,7 +53254,7 @@ async function scanModelFacts(input) {
|
|
|
53237
53254
|
for (const filePath of await walkTypeScriptFiles(resolve62(input.cwd, dir))) {
|
|
53238
53255
|
const text = await readFile31(filePath, "utf8");
|
|
53239
53256
|
if (!text.includes("firestoreModelIdentity(") && !text.includes("@dbxModel")) continue;
|
|
53240
|
-
const relativePath =
|
|
53257
|
+
const relativePath = relative20(input.cwd, filePath);
|
|
53241
53258
|
const extraction = extractModelsFromSource({ name: filePath, text });
|
|
53242
53259
|
for (const iface of extraction.interfaces) {
|
|
53243
53260
|
if (!interfaces.has(iface.name)) {
|
|
@@ -53477,7 +53494,7 @@ import { type as type97 } from "arktype";
|
|
|
53477
53494
|
import { resolve as resolve67 } from "node:path";
|
|
53478
53495
|
|
|
53479
53496
|
// packages/dbx-components-mcp/src/tools/mcp-config/snapshot.ts
|
|
53480
|
-
import { dirname as dirname21, isAbsolute as
|
|
53497
|
+
import { dirname as dirname21, isAbsolute as isAbsolute18, relative as relative21, resolve as resolve65 } from "node:path";
|
|
53481
53498
|
import { stat as stat18 } from "node:fs/promises";
|
|
53482
53499
|
async function buildSnapshot(input) {
|
|
53483
53500
|
const { workspaceRoot, explicitDirs } = input;
|
|
@@ -53504,7 +53521,7 @@ async function collectRegisteredSources(config, configBaseDir, workspaceRoot) {
|
|
|
53504
53521
|
for (const cluster of DOWNSTREAM_CLUSTERS) {
|
|
53505
53522
|
const declared = config[cluster]?.sources ?? [];
|
|
53506
53523
|
for (const declaredPath of declared) {
|
|
53507
|
-
const absolutePath =
|
|
53524
|
+
const absolutePath = isAbsolute18(declaredPath) ? declaredPath : resolve65(configBaseDir, declaredPath);
|
|
53508
53525
|
const exists = await fileExists5(absolutePath);
|
|
53509
53526
|
const relativePath = relativeOrAbsolute(workspaceRoot, absolutePath);
|
|
53510
53527
|
out.push({ cluster, declaredPath, absolutePath, relativePath, exists });
|
|
@@ -53536,7 +53553,7 @@ async function fileExists5(path) {
|
|
|
53536
53553
|
return result;
|
|
53537
53554
|
}
|
|
53538
53555
|
function relativeOrAbsolute(from, target) {
|
|
53539
|
-
const rel =
|
|
53556
|
+
const rel = relative21(from, target);
|
|
53540
53557
|
if (rel.length === 0) return ".";
|
|
53541
53558
|
if (rel.startsWith("..")) return target;
|
|
53542
53559
|
return rel.replaceAll("\\", "/");
|
|
@@ -53544,7 +53561,7 @@ function relativeOrAbsolute(from, target) {
|
|
|
53544
53561
|
|
|
53545
53562
|
// packages/dbx-components-mcp/src/tools/mcp-config/init.ts
|
|
53546
53563
|
import { writeFile as nodeWriteFile4, mkdir as nodeMkdir, readFile as nodeReadFile8 } from "node:fs/promises";
|
|
53547
|
-
import { dirname as dirname22, relative as
|
|
53564
|
+
import { dirname as dirname22, relative as relative22, resolve as resolve66 } from "node:path";
|
|
53548
53565
|
var HEURISTIC_CLUSTERS = ["uiComponents", "forgeFields", "pipes", "actions", "filters"];
|
|
53549
53566
|
var CLUSTER_FILENAME_SEGMENT = {
|
|
53550
53567
|
semanticTypes: "semantic",
|
|
@@ -53668,17 +53685,17 @@ async function planRootConfig(input) {
|
|
|
53668
53685
|
}
|
|
53669
53686
|
function defaultOutFor(input) {
|
|
53670
53687
|
const targetAbs = resolve66(input.snapshot.workspaceRoot, ".tmp/dbx-mcp", `${input.slug}.${clusterFilenameSegment(input.cluster)}.json`);
|
|
53671
|
-
return
|
|
53688
|
+
return relative22(dirname22(input.scanConfigPath), targetAbs).replaceAll("\\", "/");
|
|
53672
53689
|
}
|
|
53673
53690
|
function resolveScanOut(scanConfigPath, out) {
|
|
53674
53691
|
return resolve66(dirname22(scanConfigPath), out);
|
|
53675
53692
|
}
|
|
53676
53693
|
function relativeFromConfig(snapshot, absolute) {
|
|
53677
53694
|
const configDir = snapshot.configPath === null ? snapshot.workspaceRoot : dirname22(snapshot.configPath);
|
|
53678
|
-
return
|
|
53695
|
+
return relative22(configDir, absolute).replaceAll("\\", "/");
|
|
53679
53696
|
}
|
|
53680
53697
|
function workspaceRel(workspaceRoot, absolute) {
|
|
53681
|
-
const rel =
|
|
53698
|
+
const rel = relative22(workspaceRoot, absolute);
|
|
53682
53699
|
if (rel.length === 0) return ".";
|
|
53683
53700
|
return rel.replaceAll("\\", "/");
|
|
53684
53701
|
}
|
|
@@ -56005,7 +56022,7 @@ function renderAmbiguous(matches) {
|
|
|
56005
56022
|
|
|
56006
56023
|
// packages/dbx-components-mcp/src/tools/ui-smell-check.tool.ts
|
|
56007
56024
|
import { readFile as nodeReadFile9 } from "node:fs/promises";
|
|
56008
|
-
import { basename as basename11, extname, isAbsolute as
|
|
56025
|
+
import { basename as basename11, extname, isAbsolute as isAbsolute19, resolve as resolve69 } from "node:path";
|
|
56009
56026
|
import { type as type103 } from "arktype";
|
|
56010
56027
|
var { detectSmellsDetailed: detectSmellsDetailed2, formatBatchSmellResult: formatBatchSmellResult2, formatSmellResult: formatSmellResult2 } = ui_smell_check_exports;
|
|
56011
56028
|
var DBX_UI_SMELL_CHECK_TOOL = {
|
|
@@ -56063,7 +56080,7 @@ function parseArgs19(raw, defaults) {
|
|
|
56063
56080
|
}
|
|
56064
56081
|
var DEFAULT_READ_FILE17 = (path) => nodeReadFile9(path, "utf-8");
|
|
56065
56082
|
async function readPathInput(path, cwd, readFile33) {
|
|
56066
|
-
const absolute =
|
|
56083
|
+
const absolute = isAbsolute19(path) ? path : resolve69(cwd, path);
|
|
56067
56084
|
return readFile33(absolute);
|
|
56068
56085
|
}
|
|
56069
56086
|
function pairBatchPaths(paths) {
|
|
@@ -57494,7 +57511,7 @@ function resolveLogSearchConfig(config, configBaseDir) {
|
|
|
57494
57511
|
let absoluteBasePath;
|
|
57495
57512
|
const rawBasePath = block.basePath?.trim();
|
|
57496
57513
|
if (rawBasePath !== void 0 && rawBasePath.length > 0) {
|
|
57497
|
-
absoluteBasePath =
|
|
57514
|
+
absoluteBasePath = isAbsolute20(rawBasePath) ? rawBasePath : resolvePath4(configBaseDir, rawBasePath);
|
|
57498
57515
|
}
|
|
57499
57516
|
const defaultProject = block.defaultProject?.trim();
|
|
57500
57517
|
if (absoluteBasePath === void 0 && (defaultProject === void 0 || defaultProject.length === 0)) {
|
|
@@ -1553,7 +1553,7 @@
|
|
|
1553
1553
|
"category": "firestore",
|
|
1554
1554
|
"module": "@dereekb/firebase",
|
|
1555
1555
|
"subpath": "common/firestore/accessor/document.utility",
|
|
1556
|
-
"signature": "useDocumentSnapshotData(): <D extends FirestoreDocument<any>, O = void>(document: Maybe<D>, use: UseAsync<import(\"
|
|
1556
|
+
"signature": "useDocumentSnapshotData(): <D extends FirestoreDocument<any>, O = void>(document: Maybe<D>, use: UseAsync<import(\"packages/firebase/src/lib/common/firestore/accessor/document\").FirestoreDocumentData<D>, O>, defaultValue?: any) => Promise<Maybe<O>>",
|
|
1557
1557
|
"description": "Fetches a document's snapshot data (via `snapshot.data()`) and passes it to a `use` callback.\n\nWraps {@link useDocumentSnapshot} with a mapping step that extracts raw data from the snapshot.\nIf the document doesn't exist (data is `undefined`), the `use` callback is not invoked\nand `defaultValue` is returned instead.",
|
|
1558
1558
|
"params": [],
|
|
1559
1559
|
"returns": "The result of `use`, or the default value",
|
|
@@ -2626,7 +2626,7 @@
|
|
|
2626
2626
|
"category": "array",
|
|
2627
2627
|
"module": "@dereekb/util",
|
|
2628
2628
|
"subpath": "array/array.value",
|
|
2629
|
-
"signature": "const filterMaybeArrayValues: import(\"
|
|
2629
|
+
"signature": "const filterMaybeArrayValues: import(\"packages/util/src/lib/array/array.value\").UniversalFilterMaybeArrayFunction",
|
|
2630
2630
|
"description": "Filters all maybe values from the input array. If a maybe value is input, returns an empty array.",
|
|
2631
2631
|
"params": [],
|
|
2632
2632
|
"returns": "An array containing only non-null and non-undefined values.",
|
|
@@ -2653,7 +2653,7 @@
|
|
|
2653
2653
|
"category": "array",
|
|
2654
2654
|
"module": "@dereekb/util",
|
|
2655
2655
|
"subpath": "array/array.value",
|
|
2656
|
-
"signature": "const filterEmptyArrayValues: import(\"
|
|
2656
|
+
"signature": "const filterEmptyArrayValues: import(\"packages/util/src/lib/array/array.value\").UniversalFilterMaybeArrayFunction",
|
|
2657
2657
|
"description": "Filters all empty and maybe values from the input array. If a maybe value is input, returns an empty array.",
|
|
2658
2658
|
"params": [],
|
|
2659
2659
|
"returns": "An array containing only non-null, non-undefined, and non-empty values.",
|
|
@@ -10933,7 +10933,7 @@
|
|
|
10933
10933
|
"category": "string",
|
|
10934
10934
|
"module": "@dereekb/util",
|
|
10935
10935
|
"subpath": "string/replace",
|
|
10936
|
-
"signature": "const escapeStringForRegex: import(\"
|
|
10936
|
+
"signature": "const escapeStringForRegex: import(\"packages/util/src/lib/string/replace\").EscapeStringCharactersFunction",
|
|
10937
10937
|
"description": "Escapes the input string so it can be safely used as a literal value in a regular expression.\n\nFor instance, `'hello.world'` will be escaped to `'hello\\\\.world'`.",
|
|
10938
10938
|
"params": [],
|
|
10939
10939
|
"returns": "The escaped string with all regex special characters prefixed with a backslash.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-components-mcp",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"ts-morph": "^21.0.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@dereekb/dbx-cli": "14.
|
|
16
|
-
"@dereekb/util": "14.
|
|
15
|
+
"@dereekb/dbx-cli": "14.5.0",
|
|
16
|
+
"@dereekb/util": "14.5.0"
|
|
17
17
|
}
|
|
18
18
|
}
|