@dereekb/dbx-cli 13.11.17 → 13.12.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/firebase-api-manifest/main.js +70 -9
- package/firebase-api-manifest/package.json +1 -1
- package/firestore-indexes/src/firestore-indexes-generate.d.ts +125 -0
- package/firestore-indexes/src/firestore-model-identity-resolver.d.ts +93 -0
- package/firestore-indexes/src/firestore-query-helpers.d.ts +108 -0
- package/firestore-indexes/src/generate-firestore-indexes-cli.d.ts +94 -0
- package/firestore-indexes/src/index.d.ts +7 -0
- package/firestore-indexes/src/model-firebase-index-analyze.d.ts +68 -0
- package/firestore-indexes/src/model-firebase-index-build-manifest.d.ts +123 -0
- package/firestore-indexes/src/model-firebase-index-extract.d.ts +246 -0
- package/firestore-indexes/src/model-firebase-index-runtime.d.ts +126 -0
- package/firestore-indexes/src/model-firebase-index-scan-config-schema.d.ts +58 -0
- package/firestore-indexes/src/model-firebase-index-schema.d.ts +366 -0
- package/generate-firestore-indexes/main.js +1 -1
- package/generate-firestore-indexes/package.json +1 -1
- package/generate-mcp-manifest/src/generate-mcp-manifest/main.d.ts +26 -0
- package/generate-mcp-manifest/src/generate-mcp-manifest/render.d.ts +38 -0
- package/generated/firebase-models.generated.d.ts +3 -0
- package/index.cjs.js +45234 -640
- package/index.esm.js +44941 -643
- package/lint-cache/main.js +19 -19
- package/lint-cache/package.json +2 -2
- package/manifest-extract/index.cjs.js +169 -4
- package/manifest-extract/index.esm.js +169 -4
- package/manifest-extract/package.json +1 -1
- package/manifest-extract/src/lib/types.d.ts +26 -1
- package/package.json +14 -10
- package/src/lib/index.d.ts +3 -0
- package/src/lib/manifest/types.d.ts +155 -0
- package/src/lib/mcp-scan/config/config-schema.d.ts +226 -0
- package/src/lib/mcp-scan/config/load-config.d.ts +63 -0
- package/src/lib/mcp-scan/index.d.ts +16 -0
- package/src/lib/mcp-scan/manifest/actions-loader.d.ts +49 -0
- package/src/lib/mcp-scan/manifest/actions-schema.d.ts +328 -0
- package/src/lib/mcp-scan/manifest/core-topics.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/css-utilities-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/css-utilities-schema.d.ts +168 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-loader.d.ts +33 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-schema.d.ts +133 -0
- package/src/lib/mcp-scan/manifest/filters-loader.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/filters-schema.d.ts +190 -0
- package/src/lib/mcp-scan/manifest/forge-fields-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/forge-fields-schema.d.ts +170 -0
- package/src/lib/mcp-scan/manifest/index.d.ts +43 -0
- package/src/lib/mcp-scan/manifest/load-actions-registry.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/load-auth-registry.d.ts +82 -0
- package/src/lib/mcp-scan/manifest/load-css-utilities-registry.d.ts +67 -0
- package/src/lib/mcp-scan/manifest/load-dbx-docs-ui-examples-registry.d.ts +45 -0
- package/src/lib/mcp-scan/manifest/load-filters-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-forge-fields-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-model-firebase-index-registry.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.d.ts +74 -0
- package/src/lib/mcp-scan/manifest/load-pipes-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-registry.d.ts +76 -0
- package/src/lib/mcp-scan/manifest/load-tokens-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-ui-components-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-utils-registry.d.ts +73 -0
- package/src/lib/mcp-scan/manifest/loader.d.ts +120 -0
- package/src/lib/mcp-scan/manifest/manifest-loader-base.d.ts +130 -0
- package/src/lib/mcp-scan/manifest/model-firebase-index-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-schema.d.ts +127 -0
- package/src/lib/mcp-scan/manifest/pipes-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/pipes-schema.d.ts +125 -0
- package/src/lib/mcp-scan/manifest/semantic-types-schema.d.ts +108 -0
- package/src/lib/mcp-scan/manifest/tokens-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/tokens-schema.d.ts +116 -0
- package/src/lib/mcp-scan/manifest/ui-components-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/ui-components-schema.d.ts +149 -0
- package/src/lib/mcp-scan/manifest/utils-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/utils-schema.d.ts +120 -0
- package/src/lib/mcp-scan/registry/actions-runtime.d.ts +173 -0
- package/src/lib/mcp-scan/registry/archetypes.d.ts +235 -0
- package/src/lib/mcp-scan/registry/auth-builtin.d.ts +59 -0
- package/src/lib/mcp-scan/registry/auth-runtime.d.ts +343 -0
- package/src/lib/mcp-scan/registry/css-utilities-runtime.d.ts +133 -0
- package/src/lib/mcp-scan/registry/dbx-docs-ui-examples-runtime.d.ts +58 -0
- package/src/lib/mcp-scan/registry/downstream-models-runtime.d.ts +93 -0
- package/src/lib/mcp-scan/registry/filters-runtime.d.ts +128 -0
- package/src/lib/mcp-scan/registry/firebase-models.d.ts +387 -0
- package/src/lib/mcp-scan/registry/forge-fields.d.ts +101 -0
- package/src/lib/mcp-scan/registry/form-fields.d.ts +203 -0
- package/src/lib/mcp-scan/registry/index.d.ts +165 -0
- package/src/lib/mcp-scan/registry/model-snapshot-fields-runtime.d.ts +138 -0
- package/src/lib/mcp-scan/registry/pipes-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/registry/reserved-model-folders.d.ts +29 -0
- package/src/lib/mcp-scan/registry/semantic-types.d.ts +81 -0
- package/src/lib/mcp-scan/registry/tokens-runtime.d.ts +96 -0
- package/src/lib/mcp-scan/registry/ui-components-runtime.d.ts +90 -0
- package/src/lib/mcp-scan/registry/utils-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/scan/_jsdoc-tagged-export/extract-base.d.ts +245 -0
- package/src/lib/mcp-scan/scan/actions-build-manifest.d.ts +58 -0
- package/src/lib/mcp-scan/scan/actions-cli.d.ts +38 -0
- package/src/lib/mcp-scan/scan/actions-extract.d.ts +99 -0
- package/src/lib/mcp-scan/scan/actions-scan-config-schema.d.ts +42 -0
- package/src/lib/mcp-scan/scan/auth-extract.d.ts +120 -0
- package/src/lib/mcp-scan/scan/build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/cli.d.ts +60 -0
- package/src/lib/mcp-scan/scan/css-utilities-build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/css-utilities-cli.d.ts +36 -0
- package/src/lib/mcp-scan/scan/css-utilities-extract.d.ts +187 -0
- package/src/lib/mcp-scan/scan/css-utilities-scan-config-schema.d.ts +57 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-build-manifest.d.ts +68 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-cli.d.ts +20 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-extract.d.ts +160 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/discover-downstream-packages.d.ts +76 -0
- package/src/lib/mcp-scan/scan/discover-firebase-packages.d.ts +58 -0
- package/src/lib/mcp-scan/scan/extract-models/assemble.d.ts +105 -0
- package/src/lib/mcp-scan/scan/extract-models/collect-inherited.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/find-converters.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-enums.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-identities.d.ts +25 -0
- package/src/lib/mcp-scan/scan/extract-models/find-interfaces.d.ts +31 -0
- package/src/lib/mcp-scan/scan/extract-models/find-model-groups.d.ts +21 -0
- package/src/lib/mcp-scan/scan/extract-models/find-service-factories.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-sub-object-consts.d.ts +20 -0
- package/src/lib/mcp-scan/scan/extract-models/index.d.ts +74 -0
- package/src/lib/mcp-scan/scan/extract-models/infer-collection-kind.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/service-factory-constants.d.ts +6 -0
- package/src/lib/mcp-scan/scan/extract-models/types.d.ts +171 -0
- package/src/lib/mcp-scan/scan/extract.d.ts +82 -0
- package/src/lib/mcp-scan/scan/filters-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/filters-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/filters-extract.d.ts +101 -0
- package/src/lib/mcp-scan/scan/filters-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/forge-fields-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/forge-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/forge-fields-extract.d.ts +165 -0
- package/src/lib/mcp-scan/scan/forge-fields-scan-config-schema.d.ts +61 -0
- package/src/lib/mcp-scan/scan/index.d.ts +60 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-cli.d.ts +22 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-dispatcher-credit.d.ts +47 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-reference-scan.d.ts +100 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-build-manifest.d.ts +79 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-extract.d.ts +115 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-scan-config-schema.d.ts +59 -0
- package/src/lib/mcp-scan/scan/pipes-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/pipes-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/pipes-extract.d.ts +90 -0
- package/src/lib/mcp-scan/scan/pipes-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/scan-angular-io.d.ts +89 -0
- package/src/lib/mcp-scan/scan/scan-cli-base.d.ts +162 -0
- package/src/lib/mcp-scan/scan/scan-config-schema.d.ts +44 -0
- package/src/lib/mcp-scan/scan/ui-components-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/ui-components-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/ui-components-extract.d.ts +124 -0
- package/src/lib/mcp-scan/scan/ui-components-scan-config-schema.d.ts +62 -0
- package/src/lib/mcp-scan/scan/utils-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/utils-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/utils-extract.d.ts +103 -0
- package/src/lib/mcp-scan/scan/utils-scan-config-schema.d.ts +57 -0
- package/test/package.json +9 -9
- package/index.cjs.default.js +0 -1
- package/index.cjs.mjs +0 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadActionManifests}, and {@link createActionRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled `@dereekb/*` actions manifests that ship inside this
|
|
6
|
+
* package's `generated/` directory and merges them with any external sources
|
|
7
|
+
* declared in `dbx-mcp.config.json` under `actions.sources`.
|
|
8
|
+
*/
|
|
9
|
+
import type { Maybe } from '@dereekb/util';
|
|
10
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
11
|
+
import { type ActionRegistry } from '../registry/actions-runtime.js';
|
|
12
|
+
import { type ActionLoaderWarning, type ActionManifestReadFile } from './actions-loader.js';
|
|
13
|
+
export type BundledActionManifestPathsFactory = () => readonly string[];
|
|
14
|
+
export interface LoadActionRegistryInput {
|
|
15
|
+
readonly cwd: string;
|
|
16
|
+
readonly bundledManifestPaths?: BundledActionManifestPathsFactory;
|
|
17
|
+
readonly readFile?: ActionManifestReadFile;
|
|
18
|
+
}
|
|
19
|
+
export interface LoadActionRegistryResult {
|
|
20
|
+
readonly registry: ActionRegistry;
|
|
21
|
+
readonly configPath: Maybe<string>;
|
|
22
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
23
|
+
readonly loaderWarnings: readonly ActionLoaderWarning[];
|
|
24
|
+
readonly externalSourceCount: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Loads the merged actions registry for the current MCP server.
|
|
28
|
+
*
|
|
29
|
+
* @param input - The load configuration: working directory, bundled manifest path factory, and file reader.
|
|
30
|
+
* @returns The combined registry, config path, and any warnings emitted while reading config or manifests.
|
|
31
|
+
*/
|
|
32
|
+
export declare function loadActionRegistry(input: LoadActionRegistryInput): Promise<LoadActionRegistryResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the absolute paths of the action manifests bundled with this package.
|
|
35
|
+
*
|
|
36
|
+
* @returns The absolute paths to the bundled action manifest JSON files.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getDefaultBundledActionManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader for the auth catalog.
|
|
3
|
+
*
|
|
4
|
+
* Walks the workspace looking for `claims.ts`-style downstream files
|
|
5
|
+
* (those tagged with `@dbxAuthClaimsApp`), parses them via the auth
|
|
6
|
+
* extractor, and merges the extracted entries with the bundled built-ins
|
|
7
|
+
* (`@dereekb/util` roles, the `fr` upload claim and the five `model.*` OIDC
|
|
8
|
+
* scopes from `@dereekb/firebase`).
|
|
9
|
+
*
|
|
10
|
+
* Discovery is intentionally cheap:
|
|
11
|
+
* - Glob `components/*-{firebase,shared,web,core}/**/auth/*claims*.ts`
|
|
12
|
+
* - Glob `apps/*/**/auth/*claims*.ts`
|
|
13
|
+
* - Anything else is opt-in via `extraFiles` (used by tests).
|
|
14
|
+
*
|
|
15
|
+
* Files are read with the package's standard reader and pushed into an
|
|
16
|
+
* in-memory ts-morph project. Loader and extractor warnings are returned
|
|
17
|
+
* as structured objects so the server bootstrap can echo them on stderr.
|
|
18
|
+
*/
|
|
19
|
+
import { type AuthRegistry } from '../registry/auth-runtime.js';
|
|
20
|
+
import { type AuthExtractWarning } from '../scan/auth-extract.js';
|
|
21
|
+
import { type ScanReadFile } from '../../scan-helpers/scan-io.js';
|
|
22
|
+
/**
|
|
23
|
+
* Discriminated union surfacing per-file failures the loader can't recover
|
|
24
|
+
* from. Forwarded to the server bootstrap so operators can spot mis-tagged
|
|
25
|
+
* downstream files at startup.
|
|
26
|
+
*/
|
|
27
|
+
export type AuthLoaderFileWarning = {
|
|
28
|
+
readonly kind: 'read-failed';
|
|
29
|
+
readonly relPath: string;
|
|
30
|
+
readonly error: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'parse-failed';
|
|
33
|
+
readonly relPath: string;
|
|
34
|
+
readonly error: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Result of {@link loadAuthRegistry}. The registry is always populated —
|
|
38
|
+
* it includes the bundled built-ins plus whatever extracted entries
|
|
39
|
+
* succeeded. Warnings are returned alongside so callers can decide
|
|
40
|
+
* whether to fail loudly or merely log.
|
|
41
|
+
*/
|
|
42
|
+
export interface LoadAuthRegistryResult {
|
|
43
|
+
readonly registry: AuthRegistry;
|
|
44
|
+
readonly extractWarnings: readonly AuthExtractWarning[];
|
|
45
|
+
readonly fileWarnings: readonly AuthLoaderFileWarning[];
|
|
46
|
+
readonly scannedFiles: readonly string[];
|
|
47
|
+
readonly extractedAppCount: number;
|
|
48
|
+
readonly extractedClaimCount: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Input to {@link loadAuthRegistry}. `extraFiles` is reserved for tests
|
|
52
|
+
* that want to inject in-memory claims modules instead of touching disk.
|
|
53
|
+
*
|
|
54
|
+
* `skipDiscovery: true` disables the workspace glob walk so only `extraFiles`
|
|
55
|
+
* are scanned. Used by build-time CLIs (e.g. `generate-mcp-manifest`) when
|
|
56
|
+
* the caller knows exactly which claims module(s) belong to their app.
|
|
57
|
+
*/
|
|
58
|
+
export interface LoadAuthRegistryInput {
|
|
59
|
+
readonly cwd: string;
|
|
60
|
+
readonly readFile?: ScanReadFile;
|
|
61
|
+
readonly extraFiles?: readonly string[];
|
|
62
|
+
readonly skipDiscovery?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Discovers downstream `claims.ts` files, runs the auth extractor, and
|
|
66
|
+
* returns a fully composed {@link AuthRegistry} merged with the package's
|
|
67
|
+
* built-in roles/claims/scopes. Always returns a valid registry — when
|
|
68
|
+
* no downstream files are found, the registry contains only the
|
|
69
|
+
* built-ins.
|
|
70
|
+
*
|
|
71
|
+
* @param input - Workspace cwd plus optional injected reader / extra files.
|
|
72
|
+
* @returns The merged registry plus loader/extractor diagnostics.
|
|
73
|
+
*/
|
|
74
|
+
export declare function loadAuthRegistry(input: LoadAuthRegistryInput): Promise<LoadAuthRegistryResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Resolves the workspace-relative path of the demo claims module without
|
|
77
|
+
* leaking the constant into the public surface of {@link loadAuthRegistry}.
|
|
78
|
+
*
|
|
79
|
+
* @param workspaceRoot - Absolute workspace root.
|
|
80
|
+
* @returns The absolute path of `components/demo-firebase/src/lib/auth/claims.ts`
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveDemoClaimsPath(workspaceRoot: string): string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadCssUtilityManifests}, and {@link createCssUtilityRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled css-utility manifest that ships inside this
|
|
6
|
+
* package's `generated/` directory and merges it with any external
|
|
7
|
+
* sources declared in `dbx-mcp.config.json` under either
|
|
8
|
+
* `cssUtilities.sources` (full manifest paths) or `cssUtilities.scan[].out`
|
|
9
|
+
* (paths produced by a downstream app's own scan run).
|
|
10
|
+
*
|
|
11
|
+
* The resulting {@link CssUtilityRegistry} is the data the
|
|
12
|
+
* `dbx_css_class_lookup` tool and the css-utility resource read from. All
|
|
13
|
+
* I/O is injectable so unit tests can drive every branch without touching
|
|
14
|
+
* disk.
|
|
15
|
+
*/
|
|
16
|
+
import type { Maybe } from '@dereekb/util';
|
|
17
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
18
|
+
import { type CssUtilityRegistry } from '../registry/css-utilities-runtime.js';
|
|
19
|
+
import { type CssUtilityLoaderWarning, type CssUtilityManifestReadFile } from './css-utilities-loader.js';
|
|
20
|
+
/**
|
|
21
|
+
* Function shape used by {@link loadCssUtilityRegistry} to enumerate the
|
|
22
|
+
* bundled css-utility manifest paths shipped with this package.
|
|
23
|
+
*/
|
|
24
|
+
export type BundledCssUtilityManifestPathsFactory = () => readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Input to {@link loadCssUtilityRegistry}.
|
|
27
|
+
*/
|
|
28
|
+
export interface LoadCssUtilityRegistryInput {
|
|
29
|
+
readonly cwd: string;
|
|
30
|
+
readonly bundledManifestPaths?: BundledCssUtilityManifestPathsFactory;
|
|
31
|
+
readonly readFile?: CssUtilityManifestReadFile;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Outcome from {@link loadCssUtilityRegistry}. Surfaces both the registry
|
|
35
|
+
* and the loader warnings so callers (the server bootstrap) can log
|
|
36
|
+
* anything that fell through warn-and-skip.
|
|
37
|
+
*/
|
|
38
|
+
export interface LoadCssUtilityRegistryResult {
|
|
39
|
+
readonly registry: CssUtilityRegistry;
|
|
40
|
+
readonly configPath: Maybe<string>;
|
|
41
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
42
|
+
readonly loaderWarnings: readonly CssUtilityLoaderWarning[];
|
|
43
|
+
readonly externalSourceCount: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads the merged css-utilities registry for the current MCP server.
|
|
47
|
+
*
|
|
48
|
+
* Bundled manifests load as strict sources — a malformed or missing
|
|
49
|
+
* bundled file is a build-time bug, not a configuration problem. External
|
|
50
|
+
* manifests declared in `dbx-mcp.config.json` (`cssUtilities.sources` plus
|
|
51
|
+
* `cssUtilities.scan[].out`) load as non-strict sources so a single bad
|
|
52
|
+
* downstream manifest does not take the registry down.
|
|
53
|
+
*
|
|
54
|
+
* Returns an {@link EMPTY_CSS_UTILITY_REGISTRY} with surfaced warnings
|
|
55
|
+
* when neither bundled nor external manifests yield any successful load.
|
|
56
|
+
*
|
|
57
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
58
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
59
|
+
*/
|
|
60
|
+
export declare function loadCssUtilityRegistry(input: LoadCssUtilityRegistryInput): Promise<LoadCssUtilityRegistryResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Re-exported so callers can build a deterministic test fixture pointing
|
|
63
|
+
* at the package's bundled manifests without touching `import.meta.url`.
|
|
64
|
+
*
|
|
65
|
+
* @returns The absolute paths of the bundled css-utility manifests.
|
|
66
|
+
*/
|
|
67
|
+
export declare function getDefaultBundledCssUtilityManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadDbxDocsUiExamplesManifests}, and
|
|
4
|
+
* {@link createDbxDocsUiExamplesRegistry}.
|
|
5
|
+
*
|
|
6
|
+
* Resolves the bundled `apps/demo` dbx-docs-ui-examples manifest plus any
|
|
7
|
+
* external sources declared in `dbx-mcp.config.json` under
|
|
8
|
+
* `dbxDocsUiExamples.sources`. Mirrors `load-ui-components-registry.ts`.
|
|
9
|
+
*/
|
|
10
|
+
import type { Maybe } from '@dereekb/util';
|
|
11
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
12
|
+
import { type DbxDocsUiExamplesRegistry } from '../registry/dbx-docs-ui-examples-runtime.js';
|
|
13
|
+
import { type DbxDocsUiExamplesLoaderWarning, type DbxDocsUiExamplesManifestReadFile } from './dbx-docs-ui-examples-loader.js';
|
|
14
|
+
export type BundledDbxDocsUiExamplesManifestPathsFactory = () => readonly string[];
|
|
15
|
+
export interface LoadDbxDocsUiExamplesRegistryInput {
|
|
16
|
+
readonly cwd: string;
|
|
17
|
+
readonly bundledManifestPaths?: BundledDbxDocsUiExamplesManifestPathsFactory;
|
|
18
|
+
readonly readFile?: DbxDocsUiExamplesManifestReadFile;
|
|
19
|
+
}
|
|
20
|
+
export interface LoadDbxDocsUiExamplesRegistryResult {
|
|
21
|
+
readonly registry: DbxDocsUiExamplesRegistry;
|
|
22
|
+
readonly configPath: Maybe<string>;
|
|
23
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
24
|
+
readonly loaderWarnings: readonly DbxDocsUiExamplesLoaderWarning[];
|
|
25
|
+
readonly externalSourceCount: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Loads the merged dbx-docs-ui-examples registry for the current MCP server.
|
|
29
|
+
*
|
|
30
|
+
* Bundled manifests load as strict sources; external manifests declared in
|
|
31
|
+
* `dbx-mcp.config.json` load as non-strict sources.
|
|
32
|
+
*
|
|
33
|
+
* @param input - Resolution context.
|
|
34
|
+
* @param input.cwd - Working directory used to locate `dbx-mcp.config.json`.
|
|
35
|
+
* @param input.bundledManifestPaths - Optional override for the bundled manifest path factory; defaults to the manifests shipped with this package.
|
|
36
|
+
* @param input.readFile - Optional file reader used during testing.
|
|
37
|
+
* @returns The composed registry, the resolved config path (if any), config and loader warnings, and the count of external sources.
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadDbxDocsUiExamplesRegistry(input: LoadDbxDocsUiExamplesRegistryInput): Promise<LoadDbxDocsUiExamplesRegistryResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Resolves the absolute paths of the bundled dbx-docs-ui-examples manifests shipped with this package.
|
|
42
|
+
*
|
|
43
|
+
* @returns Absolute filesystem paths of the bundled manifests.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getDefaultBundledDbxDocsUiExamplesManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadFilterManifests}, and {@link createFilterRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled `@dereekb/*` filter manifests that ship inside this
|
|
6
|
+
* package's `generated/` directory and merges them with any external sources
|
|
7
|
+
* declared in `dbx-mcp.config.json` under `filters.sources`. The resulting
|
|
8
|
+
* {@link FilterRegistry} is the data the `dbx_filter_lookup` tool reads from.
|
|
9
|
+
*
|
|
10
|
+
* All I/O is injectable so unit tests can drive every branch without
|
|
11
|
+
* touching disk. The default `bundledManifestPaths` factory uses
|
|
12
|
+
* `import.meta.url` to locate the package's `generated/` directory
|
|
13
|
+
* regardless of whether the caller imports the source or the bundled binary.
|
|
14
|
+
*/
|
|
15
|
+
import type { Maybe } from '@dereekb/util';
|
|
16
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
17
|
+
import { type FilterRegistry } from '../registry/filters-runtime.js';
|
|
18
|
+
import { type FilterLoaderWarning, type FilterManifestReadFile } from './filters-loader.js';
|
|
19
|
+
/**
|
|
20
|
+
* Function shape used by {@link loadFilterRegistry} to enumerate the bundled
|
|
21
|
+
* `@dereekb/*` manifest paths shipped with this package. Defaults to the
|
|
22
|
+
* JSON files inside the package's `generated/` directory.
|
|
23
|
+
*/
|
|
24
|
+
export type BundledFilterManifestPathsFactory = () => readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Input to {@link loadFilterRegistry}.
|
|
27
|
+
*/
|
|
28
|
+
export interface LoadFilterRegistryInput {
|
|
29
|
+
readonly cwd: string;
|
|
30
|
+
readonly bundledManifestPaths?: BundledFilterManifestPathsFactory;
|
|
31
|
+
readonly readFile?: FilterManifestReadFile;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Outcome from {@link loadFilterRegistry}. Surfaces both the registry and the
|
|
35
|
+
* loader warnings so callers (the server bootstrap) can log anything that
|
|
36
|
+
* fell through warn-and-skip.
|
|
37
|
+
*/
|
|
38
|
+
export interface LoadFilterRegistryResult {
|
|
39
|
+
readonly registry: FilterRegistry;
|
|
40
|
+
readonly configPath: Maybe<string>;
|
|
41
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
42
|
+
readonly loaderWarnings: readonly FilterLoaderWarning[];
|
|
43
|
+
readonly externalSourceCount: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads the merged filter registry for the current MCP server.
|
|
47
|
+
*
|
|
48
|
+
* Bundled `@dereekb/*` manifests load as strict sources — a malformed or
|
|
49
|
+
* missing bundled file is a build-time bug, not a configuration problem.
|
|
50
|
+
* External manifests declared in `dbx-mcp.config.json` load as non-strict
|
|
51
|
+
* sources so a single bad downstream manifest does not take the registry
|
|
52
|
+
* down.
|
|
53
|
+
*
|
|
54
|
+
* Returns an {@link EMPTY_FILTER_REGISTRY} with surfaced warnings when neither
|
|
55
|
+
* bundled nor external manifests yield any successful load — the loader's
|
|
56
|
+
* "zero successful manifests" guard. The caller is responsible for deciding
|
|
57
|
+
* whether an empty registry is a fatal startup error.
|
|
58
|
+
*
|
|
59
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
60
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadFilterRegistry(input: LoadFilterRegistryInput): Promise<LoadFilterRegistryResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Re-exported so callers can build a deterministic test fixture pointing at
|
|
65
|
+
* the package's bundled manifests without touching `import.meta.url`.
|
|
66
|
+
*
|
|
67
|
+
* @returns The absolute paths of the bundled `@dereekb/*` manifests.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getDefaultBundledFilterManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadForgeFieldManifests}, and {@link createForgeFieldRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled `@dereekb/*` forge-fields manifests that ship inside
|
|
6
|
+
* this package's `generated/` directory and merges them with any external
|
|
7
|
+
* sources declared in `dbx-mcp.config.json` under `forgeFields.sources`. The
|
|
8
|
+
* resulting {@link ForgeFieldRegistry} is the data the lookup-form /
|
|
9
|
+
* search-form tools and the registry resource read from.
|
|
10
|
+
*
|
|
11
|
+
* All I/O is injectable so unit tests can drive every branch without touching
|
|
12
|
+
* disk. The default `bundledManifestPaths` factory uses `import.meta.url` to
|
|
13
|
+
* locate the package's `generated/` directory regardless of whether the
|
|
14
|
+
* caller imports the source or the bundled binary.
|
|
15
|
+
*/
|
|
16
|
+
import type { Maybe } from '@dereekb/util';
|
|
17
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
18
|
+
import { type ForgeFieldRegistry } from '../registry/forge-fields.js';
|
|
19
|
+
import { type ForgeFieldLoaderWarning, type ForgeFieldManifestReadFile } from './forge-fields-loader.js';
|
|
20
|
+
/**
|
|
21
|
+
* Function shape used by {@link loadForgeFieldRegistry} to enumerate the
|
|
22
|
+
* bundled `@dereekb/*` manifest paths shipped with this package. Defaults to
|
|
23
|
+
* the JSON files inside the package's `generated/` directory.
|
|
24
|
+
*/
|
|
25
|
+
export type BundledForgeFieldManifestPathsFactory = () => readonly string[];
|
|
26
|
+
/**
|
|
27
|
+
* Input to {@link loadForgeFieldRegistry}.
|
|
28
|
+
*/
|
|
29
|
+
export interface LoadForgeFieldRegistryInput {
|
|
30
|
+
readonly cwd: string;
|
|
31
|
+
readonly bundledManifestPaths?: BundledForgeFieldManifestPathsFactory;
|
|
32
|
+
readonly readFile?: ForgeFieldManifestReadFile;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Outcome from {@link loadForgeFieldRegistry}. Surfaces both the registry
|
|
36
|
+
* and the loader warnings so callers (the server bootstrap) can log anything
|
|
37
|
+
* that fell through warn-and-skip.
|
|
38
|
+
*/
|
|
39
|
+
export interface LoadForgeFieldRegistryResult {
|
|
40
|
+
readonly registry: ForgeFieldRegistry;
|
|
41
|
+
readonly configPath: Maybe<string>;
|
|
42
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
43
|
+
readonly loaderWarnings: readonly ForgeFieldLoaderWarning[];
|
|
44
|
+
readonly externalSourceCount: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Loads the merged forge-fields registry for the current MCP server.
|
|
48
|
+
*
|
|
49
|
+
* Bundled `@dereekb/*` manifests load as strict sources — a malformed or
|
|
50
|
+
* missing bundled file is a build-time bug, not a configuration problem.
|
|
51
|
+
* External manifests declared in `dbx-mcp.config.json` load as non-strict
|
|
52
|
+
* sources so a single bad downstream manifest does not take the registry
|
|
53
|
+
* down.
|
|
54
|
+
*
|
|
55
|
+
* Returns an {@link EMPTY_FORGE_FIELD_REGISTRY} with surfaced warnings when
|
|
56
|
+
* neither bundled nor external manifests yield any successful load — the
|
|
57
|
+
* loader's "zero successful manifests" guard. The caller is responsible for
|
|
58
|
+
* deciding whether an empty registry is a fatal startup error.
|
|
59
|
+
*
|
|
60
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
61
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
62
|
+
*/
|
|
63
|
+
export declare function loadForgeFieldRegistry(input: LoadForgeFieldRegistryInput): Promise<LoadForgeFieldRegistryResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Re-exported so callers can build a deterministic test fixture pointing at
|
|
66
|
+
* the package's bundled manifests without touching `import.meta.url`.
|
|
67
|
+
*
|
|
68
|
+
* @returns The absolute paths of the bundled `@dereekb/*` manifests.
|
|
69
|
+
*/
|
|
70
|
+
export declare function getDefaultBundledForgeFieldManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadModelFirebaseIndexManifests}, and
|
|
4
|
+
* {@link createModelFirebaseIndexRegistry}.
|
|
5
|
+
*
|
|
6
|
+
* Resolves the bundled `@dereekb/firebase` model-firebase-index manifest
|
|
7
|
+
* that ships inside this package's `generated/` directory and merges it
|
|
8
|
+
* with any external sources declared in `dbx-mcp.config.json` under
|
|
9
|
+
* `modelFirebaseIndex.sources`. The resulting
|
|
10
|
+
* {@link ModelFirebaseIndexRegistry} is the data the
|
|
11
|
+
* `dbx_model_firebase_index_*` tools read from.
|
|
12
|
+
*
|
|
13
|
+
* All I/O is injectable so unit tests can drive every branch without
|
|
14
|
+
* touching disk. The default `bundledManifestPaths` factory uses
|
|
15
|
+
* `import.meta.url` to locate the package's `generated/` directory
|
|
16
|
+
* regardless of whether the caller imports the source or the bundled
|
|
17
|
+
* binary.
|
|
18
|
+
*/
|
|
19
|
+
import type { Maybe } from '@dereekb/util';
|
|
20
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
21
|
+
import { type ModelFirebaseIndexRegistry } from '@dereekb/dbx-cli/firestore-indexes';
|
|
22
|
+
import { type ModelFirebaseIndexLoaderWarning, type ModelFirebaseIndexManifestReadFile } from './model-firebase-index-loader.js';
|
|
23
|
+
/**
|
|
24
|
+
* Function shape used by {@link loadModelFirebaseIndexRegistry} to
|
|
25
|
+
* enumerate the bundled `@dereekb/firebase` manifest path shipped with
|
|
26
|
+
* this package. Defaults to the JSON file inside the package's
|
|
27
|
+
* `generated/` directory.
|
|
28
|
+
*/
|
|
29
|
+
export type BundledModelFirebaseIndexManifestPathsFactory = () => readonly string[];
|
|
30
|
+
/**
|
|
31
|
+
* Input to {@link loadModelFirebaseIndexRegistry}.
|
|
32
|
+
*/
|
|
33
|
+
export interface LoadModelFirebaseIndexRegistryInput {
|
|
34
|
+
readonly cwd: string;
|
|
35
|
+
readonly bundledManifestPaths?: BundledModelFirebaseIndexManifestPathsFactory;
|
|
36
|
+
readonly readFile?: ModelFirebaseIndexManifestReadFile;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Outcome from {@link loadModelFirebaseIndexRegistry}.
|
|
40
|
+
*/
|
|
41
|
+
export interface LoadModelFirebaseIndexRegistryResult {
|
|
42
|
+
readonly registry: ModelFirebaseIndexRegistry;
|
|
43
|
+
readonly configPath: Maybe<string>;
|
|
44
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
45
|
+
readonly loaderWarnings: readonly ModelFirebaseIndexLoaderWarning[];
|
|
46
|
+
readonly externalSourceCount: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Loads the merged model-firebase-index registry for the current MCP server.
|
|
50
|
+
*
|
|
51
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
52
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
53
|
+
*/
|
|
54
|
+
export declare function loadModelFirebaseIndexRegistry(input: LoadModelFirebaseIndexRegistryInput): Promise<LoadModelFirebaseIndexRegistryResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Re-exported so callers can build a deterministic test fixture pointing
|
|
57
|
+
* at the package's bundled manifests without touching `import.meta.url`.
|
|
58
|
+
*
|
|
59
|
+
* @returns The absolute paths of the bundled `@dereekb/firebase` manifests.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getDefaultBundledModelFirebaseIndexManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadModelSnapshotFieldManifests}, and
|
|
4
|
+
* {@link createModelSnapshotFieldRegistry}.
|
|
5
|
+
*
|
|
6
|
+
* Resolves the bundled `@dereekb/firebase` model-snapshot-fields manifest that
|
|
7
|
+
* ships inside this package's `generated/` directory and merges it with any
|
|
8
|
+
* external sources declared in `dbx-mcp.config.json` under
|
|
9
|
+
* `modelSnapshotFields.sources`. The resulting
|
|
10
|
+
* {@link ModelSnapshotFieldRegistry} is the data the
|
|
11
|
+
* `dbx_model_snapshot_field_*` tools read from.
|
|
12
|
+
*
|
|
13
|
+
* All I/O is injectable so unit tests can drive every branch without
|
|
14
|
+
* touching disk. The default `bundledManifestPaths` factory uses
|
|
15
|
+
* `import.meta.url` to locate the package's `generated/` directory
|
|
16
|
+
* regardless of whether the caller imports the source or the bundled
|
|
17
|
+
* binary.
|
|
18
|
+
*/
|
|
19
|
+
import type { Maybe } from '@dereekb/util';
|
|
20
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
21
|
+
import { type ModelSnapshotFieldRegistry } from '../registry/model-snapshot-fields-runtime.js';
|
|
22
|
+
import { type ModelSnapshotFieldLoaderWarning, type ModelSnapshotFieldManifestReadFile } from './model-snapshot-fields-loader.js';
|
|
23
|
+
/**
|
|
24
|
+
* Function shape used by {@link loadModelSnapshotFieldRegistry} to enumerate
|
|
25
|
+
* the bundled `@dereekb/firebase` manifest path shipped with this package.
|
|
26
|
+
* Defaults to the JSON file inside the package's `generated/` directory.
|
|
27
|
+
*/
|
|
28
|
+
export type BundledModelSnapshotFieldManifestPathsFactory = () => readonly string[];
|
|
29
|
+
/**
|
|
30
|
+
* Input to {@link loadModelSnapshotFieldRegistry}.
|
|
31
|
+
*/
|
|
32
|
+
export interface LoadModelSnapshotFieldRegistryInput {
|
|
33
|
+
readonly cwd: string;
|
|
34
|
+
readonly bundledManifestPaths?: BundledModelSnapshotFieldManifestPathsFactory;
|
|
35
|
+
readonly readFile?: ModelSnapshotFieldManifestReadFile;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Outcome from {@link loadModelSnapshotFieldRegistry}. Surfaces both the
|
|
39
|
+
* registry and the loader warnings so callers (the server bootstrap) can
|
|
40
|
+
* log anything that fell through warn-and-skip.
|
|
41
|
+
*/
|
|
42
|
+
export interface LoadModelSnapshotFieldRegistryResult {
|
|
43
|
+
readonly registry: ModelSnapshotFieldRegistry;
|
|
44
|
+
readonly configPath: Maybe<string>;
|
|
45
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
46
|
+
readonly loaderWarnings: readonly ModelSnapshotFieldLoaderWarning[];
|
|
47
|
+
readonly externalSourceCount: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Loads the merged model-snapshot-fields registry for the current MCP server.
|
|
51
|
+
*
|
|
52
|
+
* Bundled manifests load as non-strict sources because the `@dereekb/firebase`
|
|
53
|
+
* scan may not have produced a manifest yet (e.g. before the first
|
|
54
|
+
* `generate-manifests` run). External manifests declared in
|
|
55
|
+
* `dbx-mcp.config.json` likewise load as non-strict sources so a single bad
|
|
56
|
+
* downstream manifest does not take the registry down.
|
|
57
|
+
*
|
|
58
|
+
* Returns an {@link EMPTY_MODEL_SNAPSHOT_FIELD_REGISTRY} with surfaced
|
|
59
|
+
* warnings when neither bundled nor external manifests yield any successful
|
|
60
|
+
* load — the loader's "zero successful manifests" guard is caught and
|
|
61
|
+
* translated into an empty registry so a workspace that hasn't run
|
|
62
|
+
* `generate-manifests` yet still boots.
|
|
63
|
+
*
|
|
64
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
65
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadModelSnapshotFieldRegistry(input: LoadModelSnapshotFieldRegistryInput): Promise<LoadModelSnapshotFieldRegistryResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Re-exported so callers can build a deterministic test fixture pointing
|
|
70
|
+
* at the package's bundled manifests without touching `import.meta.url`.
|
|
71
|
+
*
|
|
72
|
+
* @returns The absolute paths of the bundled `@dereekb/firebase` manifests.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getDefaultBundledModelSnapshotFieldManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadPipeManifests}, and {@link createPipeRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled `@dereekb/*` pipes manifests that ship inside this
|
|
6
|
+
* package's `generated/` directory and merges them with any external sources
|
|
7
|
+
* declared in `dbx-mcp.config.json` under `pipes.sources`. The resulting
|
|
8
|
+
* {@link PipeRegistry} is the data the `dbx_pipe_lookup` tool reads from.
|
|
9
|
+
*
|
|
10
|
+
* All I/O is injectable so unit tests can drive every branch without
|
|
11
|
+
* touching disk. The default `bundledManifestPaths` factory uses
|
|
12
|
+
* `import.meta.url` to locate the package's `generated/` directory
|
|
13
|
+
* regardless of whether the caller imports the source or the bundled binary.
|
|
14
|
+
*/
|
|
15
|
+
import type { Maybe } from '@dereekb/util';
|
|
16
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
17
|
+
import { type PipeRegistry } from '../registry/pipes-runtime.js';
|
|
18
|
+
import { type PipeLoaderWarning, type PipeManifestReadFile } from './pipes-loader.js';
|
|
19
|
+
/**
|
|
20
|
+
* Function shape used by {@link loadPipeRegistry} to enumerate the bundled
|
|
21
|
+
* `@dereekb/*` manifest paths shipped with this package. Defaults to the
|
|
22
|
+
* JSON files inside the package's `generated/` directory.
|
|
23
|
+
*/
|
|
24
|
+
export type BundledPipeManifestPathsFactory = () => readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Input to {@link loadPipeRegistry}.
|
|
27
|
+
*/
|
|
28
|
+
export interface LoadPipeRegistryInput {
|
|
29
|
+
readonly cwd: string;
|
|
30
|
+
readonly bundledManifestPaths?: BundledPipeManifestPathsFactory;
|
|
31
|
+
readonly readFile?: PipeManifestReadFile;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Outcome from {@link loadPipeRegistry}. Surfaces both the registry and the
|
|
35
|
+
* loader warnings so callers (the server bootstrap) can log anything that
|
|
36
|
+
* fell through warn-and-skip.
|
|
37
|
+
*/
|
|
38
|
+
export interface LoadPipeRegistryResult {
|
|
39
|
+
readonly registry: PipeRegistry;
|
|
40
|
+
readonly configPath: Maybe<string>;
|
|
41
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
42
|
+
readonly loaderWarnings: readonly PipeLoaderWarning[];
|
|
43
|
+
readonly externalSourceCount: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads the merged pipes registry for the current MCP server.
|
|
47
|
+
*
|
|
48
|
+
* Bundled `@dereekb/*` manifests load as strict sources — a malformed or
|
|
49
|
+
* missing bundled file is a build-time bug, not a configuration problem.
|
|
50
|
+
* External manifests declared in `dbx-mcp.config.json` load as non-strict
|
|
51
|
+
* sources so a single bad downstream manifest does not take the registry
|
|
52
|
+
* down.
|
|
53
|
+
*
|
|
54
|
+
* Returns an {@link EMPTY_PIPE_REGISTRY} with surfaced warnings when neither
|
|
55
|
+
* bundled nor external manifests yield any successful load — the loader's
|
|
56
|
+
* "zero successful manifests" guard. The caller is responsible for deciding
|
|
57
|
+
* whether an empty registry is a fatal startup error.
|
|
58
|
+
*
|
|
59
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
60
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadPipeRegistry(input: LoadPipeRegistryInput): Promise<LoadPipeRegistryResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Re-exported so callers can build a deterministic test fixture pointing at
|
|
65
|
+
* the package's bundled manifests without touching `import.meta.url`.
|
|
66
|
+
*
|
|
67
|
+
* @returns The absolute paths of the bundled `@dereekb/*` manifests.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getDefaultBundledPipeManifestPaths(): readonly string[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side composition of {@link findAndLoadConfig},
|
|
3
|
+
* {@link loadSemanticTypeManifests}, and {@link createSemanticTypeRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the bundled `@dereekb/*` manifests that ship inside this package's
|
|
6
|
+
* `generated/` directory and merges them with any external sources declared
|
|
7
|
+
* in `dbx-mcp.config.json`. The resulting {@link SemanticTypeRegistry} is the
|
|
8
|
+
* data the lookup / search tools and the registry resource read from.
|
|
9
|
+
*
|
|
10
|
+
* All I/O is injectable so unit tests can drive every branch without touching
|
|
11
|
+
* disk. The default `bundledManifestUrls` factory uses `import.meta.url` to
|
|
12
|
+
* locate the package's `generated/` directory regardless of whether the
|
|
13
|
+
* caller imports the source or the bundled binary.
|
|
14
|
+
*/
|
|
15
|
+
import type { Maybe } from '@dereekb/util';
|
|
16
|
+
import { type ConfigWarning } from '../config/load-config.js';
|
|
17
|
+
import { type SemanticTypeRegistry } from '../registry/semantic-types.js';
|
|
18
|
+
import { type LoaderWarning, type ManifestReadFile } from './loader.js';
|
|
19
|
+
/**
|
|
20
|
+
* Function shape used by {@link loadSemanticTypeRegistry} to enumerate the
|
|
21
|
+
* bundled `@dereekb/*` manifest paths shipped with this package. Defaults to
|
|
22
|
+
* the JSON files inside the package's `generated/` directory.
|
|
23
|
+
*/
|
|
24
|
+
export type BundledManifestPathsFactory = () => readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Input to {@link loadSemanticTypeRegistry}.
|
|
27
|
+
*/
|
|
28
|
+
export interface LoadSemanticTypeRegistryInput {
|
|
29
|
+
readonly cwd: string;
|
|
30
|
+
readonly bundledManifestPaths?: BundledManifestPathsFactory;
|
|
31
|
+
readonly readFile?: ManifestReadFile;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Outcome from {@link loadSemanticTypeRegistry}. Surfaces both the registry
|
|
35
|
+
* and the loader warnings so callers (the server bootstrap) can log anything
|
|
36
|
+
* that fell through warn-and-skip.
|
|
37
|
+
*/
|
|
38
|
+
export interface LoadSemanticTypeRegistryResult {
|
|
39
|
+
readonly registry: SemanticTypeRegistry;
|
|
40
|
+
readonly configPath: Maybe<string>;
|
|
41
|
+
readonly configWarnings: readonly ConfigWarning[];
|
|
42
|
+
readonly loaderWarnings: readonly LoaderWarning[];
|
|
43
|
+
readonly externalSourceCount: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads the merged semantic-types registry for the current MCP server.
|
|
47
|
+
*
|
|
48
|
+
* Bundled `@dereekb/*` manifests load as strict sources — a malformed or
|
|
49
|
+
* missing bundled file is a build-time bug, not a configuration problem.
|
|
50
|
+
* External manifests declared in `dbx-mcp.config.json` load as non-strict
|
|
51
|
+
* sources so a single bad downstream manifest does not take the registry
|
|
52
|
+
* down.
|
|
53
|
+
*
|
|
54
|
+
* Returns an {@link EMPTY_SEMANTIC_TYPE_REGISTRY} with surfaced warnings
|
|
55
|
+
* when neither bundled nor external manifests yield any successful load —
|
|
56
|
+
* the loader's "zero successful manifests" guard. The caller is responsible
|
|
57
|
+
* for deciding whether an empty registry is a fatal startup error.
|
|
58
|
+
*
|
|
59
|
+
* @param input - Cwd plus optional injected bundled-path factory and reader.
|
|
60
|
+
* @returns The registry, the resolved config path (if any), and any warnings.
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadSemanticTypeRegistry(input: LoadSemanticTypeRegistryInput): Promise<LoadSemanticTypeRegistryResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Re-exported so callers can build a deterministic test fixture pointing at
|
|
65
|
+
* the package's bundled manifests without touching `import.meta.url`.
|
|
66
|
+
*
|
|
67
|
+
* @returns The absolute paths of the bundled `@dereekb/*` manifests.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getDefaultBundledManifestPaths(): readonly string[];
|
|
70
|
+
/**
|
|
71
|
+
* Returns the package's `generated/` directory. Useful for callers that want
|
|
72
|
+
* to derive sibling paths without re-deriving the package root themselves.
|
|
73
|
+
*
|
|
74
|
+
* @returns The absolute path of the bundled manifests directory.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getBundledManifestsDirectory(): string;
|