@dereekb/dbx-cli 13.11.18 → 13.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/main.js +1314 -0
- package/generate-mcp-manifest/package.json +6 -0
- package/generated/firebase-models.generated.d.ts +3 -0
- package/index.cjs.js +45614 -640
- package/index.esm.js +45321 -643
- package/lint-cache/main.js +32 -28
- 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 +127 -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,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arktype schemas for the ui-components manifest format.
|
|
3
|
+
*
|
|
4
|
+
* Manifests are JSON files that catalog UI components, directives, pipes, and
|
|
5
|
+
* services from one source — either a `@dereekb/*` package bundled with this
|
|
6
|
+
* MCP, or a downstream-app manifest discovered via `dbx-mcp.config.json`.
|
|
7
|
+
* Each manifest contributes its entries to a merged registry that the
|
|
8
|
+
* `lookup-ui` and `search-ui` MCP tools query.
|
|
9
|
+
*
|
|
10
|
+
* The schemas in this module are the *contract* — once a downstream app
|
|
11
|
+
* commits a manifest file, breaking changes here mean every downstream
|
|
12
|
+
* regenerates. Optional fields can be added in v1; structural breaks must
|
|
13
|
+
* bump the manifest `version` and update the loader's accepted versions.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* High-level category bucket for a UI entry — the primary search index.
|
|
17
|
+
*/
|
|
18
|
+
export declare const UI_COMPONENT_CATEGORIES: readonly ["layout", "list", "button", "card", "feedback", "overlay", "navigation", "text", "screen", "action", "router", "misc"];
|
|
19
|
+
/**
|
|
20
|
+
* Static type for the closed category vocabulary.
|
|
21
|
+
*/
|
|
22
|
+
export type UiComponentCategoryValue = (typeof UI_COMPONENT_CATEGORIES)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Angular construct kind. Drives output formatting in tools (components have
|
|
25
|
+
* content projection, directives advertise selectors, pipes have transform
|
|
26
|
+
* signatures, services expose injection tokens).
|
|
27
|
+
*/
|
|
28
|
+
export declare const UI_COMPONENT_KINDS: readonly ["component", "directive", "pipe", "service"];
|
|
29
|
+
/**
|
|
30
|
+
* Static type for the closed kind vocabulary.
|
|
31
|
+
*/
|
|
32
|
+
export type UiComponentKindValue = (typeof UI_COMPONENT_KINDS)[number];
|
|
33
|
+
/**
|
|
34
|
+
* One input (signal `input()` or `@Input()`-decorated property) on a UI entry.
|
|
35
|
+
*/
|
|
36
|
+
export declare const UiComponentInputEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
37
|
+
name: string;
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
required: boolean;
|
|
41
|
+
default?: string | undefined;
|
|
42
|
+
}, {}>;
|
|
43
|
+
/**
|
|
44
|
+
* Static type inferred from {@link UiComponentInputEntry}.
|
|
45
|
+
*/
|
|
46
|
+
export type UiComponentInputEntry = typeof UiComponentInputEntry.infer;
|
|
47
|
+
/**
|
|
48
|
+
* One output (signal `output()` or `@Output()` `EventEmitter`) on a UI entry.
|
|
49
|
+
*/
|
|
50
|
+
export declare const UiComponentOutputEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
51
|
+
name: string;
|
|
52
|
+
emits: string;
|
|
53
|
+
description: string;
|
|
54
|
+
}, {}>;
|
|
55
|
+
/**
|
|
56
|
+
* Static type inferred from {@link UiComponentOutputEntry}.
|
|
57
|
+
*/
|
|
58
|
+
export type UiComponentOutputEntry = typeof UiComponentOutputEntry.infer;
|
|
59
|
+
/**
|
|
60
|
+
* One UI entry inside a manifest. Each entry describes a single exported
|
|
61
|
+
* Angular construct — its selector, where it lives, what category it indexes
|
|
62
|
+
* under, and the inputs/outputs callers wire to.
|
|
63
|
+
*
|
|
64
|
+
* Required fields are the minimum needed for `lookup-ui` to render a useful
|
|
65
|
+
* answer. Every other field is optional so the auto-generator can populate
|
|
66
|
+
* them progressively.
|
|
67
|
+
*/
|
|
68
|
+
export declare const UiComponentEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
69
|
+
slug: string;
|
|
70
|
+
category: "action" | "list" | "screen" | "text" | "layout" | "button" | "card" | "feedback" | "overlay" | "navigation" | "router" | "misc";
|
|
71
|
+
kind: "pipe" | "component" | "directive" | "service";
|
|
72
|
+
selector: string;
|
|
73
|
+
className: string;
|
|
74
|
+
module: string;
|
|
75
|
+
description: string;
|
|
76
|
+
inputs: {
|
|
77
|
+
name: string;
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
required: boolean;
|
|
81
|
+
default?: string | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
outputs: {
|
|
84
|
+
name: string;
|
|
85
|
+
emits: string;
|
|
86
|
+
description: string;
|
|
87
|
+
}[];
|
|
88
|
+
contentProjection?: string | undefined;
|
|
89
|
+
relatedSlugs?: string[] | undefined;
|
|
90
|
+
skillRefs?: string[] | undefined;
|
|
91
|
+
example?: string | undefined;
|
|
92
|
+
minimalExample?: string | undefined;
|
|
93
|
+
deprecated?: string | boolean | undefined;
|
|
94
|
+
since?: string | undefined;
|
|
95
|
+
}, {}>;
|
|
96
|
+
/**
|
|
97
|
+
* Static type inferred from {@link UiComponentEntry}. Co-named with the const
|
|
98
|
+
* so callers can write `import { UiComponentEntry }` and use it in both value
|
|
99
|
+
* and type positions.
|
|
100
|
+
*/
|
|
101
|
+
export type UiComponentEntry = typeof UiComponentEntry.infer;
|
|
102
|
+
/**
|
|
103
|
+
* Top-level manifest envelope. One file per source. The `source` field is the
|
|
104
|
+
* workspace-unique label used to detect collisions; `module` carries the npm
|
|
105
|
+
* package the entries ship in.
|
|
106
|
+
*
|
|
107
|
+
* `version` is the schema version. The loader currently accepts only
|
|
108
|
+
* `version: 1`; manifests with any other value are rejected (strict
|
|
109
|
+
* sources) or warned-and-skipped (non-strict sources).
|
|
110
|
+
*/
|
|
111
|
+
export declare const UiComponentManifest: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
112
|
+
version: 1;
|
|
113
|
+
source: string;
|
|
114
|
+
module: string;
|
|
115
|
+
generatedAt: string;
|
|
116
|
+
generator: string;
|
|
117
|
+
entries: {
|
|
118
|
+
slug: string;
|
|
119
|
+
category: "action" | "list" | "screen" | "text" | "layout" | "button" | "card" | "feedback" | "overlay" | "navigation" | "router" | "misc";
|
|
120
|
+
kind: "pipe" | "component" | "directive" | "service";
|
|
121
|
+
selector: string;
|
|
122
|
+
className: string;
|
|
123
|
+
module: string;
|
|
124
|
+
description: string;
|
|
125
|
+
inputs: {
|
|
126
|
+
name: string;
|
|
127
|
+
type: string;
|
|
128
|
+
description: string;
|
|
129
|
+
required: boolean;
|
|
130
|
+
default?: string | undefined;
|
|
131
|
+
}[];
|
|
132
|
+
outputs: {
|
|
133
|
+
name: string;
|
|
134
|
+
emits: string;
|
|
135
|
+
description: string;
|
|
136
|
+
}[];
|
|
137
|
+
contentProjection?: string | undefined;
|
|
138
|
+
relatedSlugs?: string[] | undefined;
|
|
139
|
+
skillRefs?: string[] | undefined;
|
|
140
|
+
example?: string | undefined;
|
|
141
|
+
minimalExample?: string | undefined;
|
|
142
|
+
deprecated?: string | boolean | undefined;
|
|
143
|
+
since?: string | undefined;
|
|
144
|
+
}[];
|
|
145
|
+
}, {}>;
|
|
146
|
+
/**
|
|
147
|
+
* Static type inferred from {@link UiComponentManifest}.
|
|
148
|
+
*/
|
|
149
|
+
export type UiComponentManifest = typeof UiComponentManifest.infer;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader for utils manifests.
|
|
3
|
+
*
|
|
4
|
+
* Reads one or more manifest files (bundled `@dereekb/*` registries plus any
|
|
5
|
+
* downstream-app manifests discovered via `dbx-mcp.config.json`), validates
|
|
6
|
+
* them against {@link UtilManifest}, and merges them into a single
|
|
7
|
+
* lookup-ready registry.
|
|
8
|
+
*
|
|
9
|
+
* Failure handling mirrors the pipes loader: bundled sources are strict by
|
|
10
|
+
* default, external sources are not. If no source loads successfully the
|
|
11
|
+
* loader throws.
|
|
12
|
+
*/
|
|
13
|
+
import { type UtilEntry } from './utils-schema.js';
|
|
14
|
+
import { type ManifestLoaderWarning, type ManifestReadFile, type ManifestSource } from './manifest-loader-base.js';
|
|
15
|
+
/**
|
|
16
|
+
* One manifest the loader is asked to ingest. `path` must be absolute.
|
|
17
|
+
*/
|
|
18
|
+
export type UtilManifestSource = ManifestSource;
|
|
19
|
+
/**
|
|
20
|
+
* Function shape used by the loader to read manifest contents.
|
|
21
|
+
*/
|
|
22
|
+
export type UtilManifestReadFile = ManifestReadFile;
|
|
23
|
+
/**
|
|
24
|
+
* Discriminated union of all non-fatal events the loader emits.
|
|
25
|
+
*/
|
|
26
|
+
export type UtilLoaderWarning = ManifestLoaderWarning;
|
|
27
|
+
/**
|
|
28
|
+
* Input to {@link loadUtilManifests}.
|
|
29
|
+
*/
|
|
30
|
+
export interface LoadUtilManifestsInput {
|
|
31
|
+
readonly sources: readonly UtilManifestSource[];
|
|
32
|
+
readonly readFile?: UtilManifestReadFile;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result of {@link loadUtilManifests}. `entries` is the merged lookup map
|
|
36
|
+
* keyed by `${module}::${slug}`; `categoryIndex` is the inverted index
|
|
37
|
+
* from category value to entry keys (sorted alphabetically for
|
|
38
|
+
* deterministic output).
|
|
39
|
+
*/
|
|
40
|
+
export interface LoadUtilManifestsResult {
|
|
41
|
+
readonly entries: ReadonlyMap<string, UtilEntry>;
|
|
42
|
+
readonly categoryIndex: ReadonlyMap<string, readonly string[]>;
|
|
43
|
+
readonly warnings: readonly UtilLoaderWarning[];
|
|
44
|
+
readonly loadedSources: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Loads, validates, and merges the supplied manifest sources into a single
|
|
48
|
+
* registry suitable for the `dbx_util_lookup` / `dbx_util_search` MCP tools.
|
|
49
|
+
*
|
|
50
|
+
* @param input - Manifest sources plus an optional injected `readFile`
|
|
51
|
+
* @returns Merged entries, category index, deterministic warnings, and the list of source labels that loaded.
|
|
52
|
+
* @throws {Error} When a strict source fails or when zero manifests load successfully.
|
|
53
|
+
*/
|
|
54
|
+
export declare function loadUtilManifests(input: LoadUtilManifestsInput): Promise<LoadUtilManifestsResult>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arktype schemas for the utils manifest format.
|
|
3
|
+
*
|
|
4
|
+
* Manifests are JSON files that catalog utilities (functions, classes,
|
|
5
|
+
* constants, factory factories) opted in via the `@dbxUtil` JSDoc marker.
|
|
6
|
+
* One manifest per source — bundled `@dereekb/*` packages plus any
|
|
7
|
+
* downstream-app manifests discovered via `dbx-mcp.config.json` — feeds
|
|
8
|
+
* the merged registry that powers the `dbx_util_lookup` and
|
|
9
|
+
* `dbx_util_search` MCP tools.
|
|
10
|
+
*
|
|
11
|
+
* The schemas in this module are the *contract* — once a downstream app
|
|
12
|
+
* commits a manifest file, breaking changes here mean every downstream
|
|
13
|
+
* regenerates. Optional fields can be added in v1; structural breaks must
|
|
14
|
+
* bump the manifest `version` and update the loader's accepted versions.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Closed vocabulary describing the kind of TypeScript export the utility
|
|
18
|
+
* is. The extractor auto-detects from the source declaration (function vs.
|
|
19
|
+
* class vs. const), and authors can override via `@dbxUtilKind`. `factory`
|
|
20
|
+
* is reserved for functions whose return type is itself a function — used
|
|
21
|
+
* by the configurable factory pattern.
|
|
22
|
+
*/
|
|
23
|
+
export declare const UTIL_KINDS: readonly ["function", "class", "const", "factory"];
|
|
24
|
+
/**
|
|
25
|
+
* Static type for the closed kind vocabulary.
|
|
26
|
+
*/
|
|
27
|
+
export type UtilKindValue = (typeof UTIL_KINDS)[number];
|
|
28
|
+
/**
|
|
29
|
+
* One documented parameter of a function/factory utility, or one
|
|
30
|
+
* constructor parameter for a class utility.
|
|
31
|
+
*/
|
|
32
|
+
export declare const UtilParamEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
optional: boolean;
|
|
37
|
+
}, {}>;
|
|
38
|
+
/**
|
|
39
|
+
* Static type inferred from {@link UtilParamEntry}.
|
|
40
|
+
*/
|
|
41
|
+
export type UtilParamEntry = typeof UtilParamEntry.infer;
|
|
42
|
+
/**
|
|
43
|
+
* One utility entry inside a manifest. Each entry describes a single
|
|
44
|
+
* exported symbol — its slug, kind, category, signature, and the
|
|
45
|
+
* documented parameters/return.
|
|
46
|
+
*
|
|
47
|
+
* Required fields are the minimum needed for `dbx_util_lookup` to render
|
|
48
|
+
* a useful answer; every other field is optional so the auto-generator
|
|
49
|
+
* can populate them progressively.
|
|
50
|
+
*/
|
|
51
|
+
export declare const UtilEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
52
|
+
slug: string;
|
|
53
|
+
name: string;
|
|
54
|
+
kind: "function" | "class" | "const" | "factory";
|
|
55
|
+
category: string;
|
|
56
|
+
module: string;
|
|
57
|
+
subpath: string;
|
|
58
|
+
signature: string;
|
|
59
|
+
description: string;
|
|
60
|
+
params: {
|
|
61
|
+
name: string;
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
optional: boolean;
|
|
65
|
+
}[];
|
|
66
|
+
returns: string;
|
|
67
|
+
tags: string[];
|
|
68
|
+
example?: string | undefined;
|
|
69
|
+
relatedSlugs?: string[] | undefined;
|
|
70
|
+
skillRefs?: string[] | undefined;
|
|
71
|
+
deprecated?: string | boolean | undefined;
|
|
72
|
+
since?: string | undefined;
|
|
73
|
+
}, {}>;
|
|
74
|
+
/**
|
|
75
|
+
* Static type inferred from {@link UtilEntry}.
|
|
76
|
+
*/
|
|
77
|
+
export type UtilEntry = typeof UtilEntry.infer;
|
|
78
|
+
/**
|
|
79
|
+
* Top-level manifest envelope. One file per source. The `source` field is
|
|
80
|
+
* the workspace-unique label used to detect collisions; `module` carries
|
|
81
|
+
* the npm package the entries ship in.
|
|
82
|
+
*
|
|
83
|
+
* `version` is the schema version. The loader currently accepts only
|
|
84
|
+
* `version: 1`; manifests with any other value are rejected (strict
|
|
85
|
+
* sources) or warned-and-skipped (non-strict sources).
|
|
86
|
+
*/
|
|
87
|
+
export declare const UtilManifest: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
88
|
+
version: 1;
|
|
89
|
+
source: string;
|
|
90
|
+
module: string;
|
|
91
|
+
generatedAt: string;
|
|
92
|
+
generator: string;
|
|
93
|
+
entries: {
|
|
94
|
+
slug: string;
|
|
95
|
+
name: string;
|
|
96
|
+
kind: "function" | "class" | "const" | "factory";
|
|
97
|
+
category: string;
|
|
98
|
+
module: string;
|
|
99
|
+
subpath: string;
|
|
100
|
+
signature: string;
|
|
101
|
+
description: string;
|
|
102
|
+
params: {
|
|
103
|
+
name: string;
|
|
104
|
+
type: string;
|
|
105
|
+
description: string;
|
|
106
|
+
optional: boolean;
|
|
107
|
+
}[];
|
|
108
|
+
returns: string;
|
|
109
|
+
tags: string[];
|
|
110
|
+
example?: string | undefined;
|
|
111
|
+
relatedSlugs?: string[] | undefined;
|
|
112
|
+
skillRefs?: string[] | undefined;
|
|
113
|
+
deprecated?: string | boolean | undefined;
|
|
114
|
+
since?: string | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
}, {}>;
|
|
117
|
+
/**
|
|
118
|
+
* Static type inferred from {@link UtilManifest}.
|
|
119
|
+
*/
|
|
120
|
+
export type UtilManifest = typeof UtilManifest.infer;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions runtime registry wrapper.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the raw {@link LoadActionManifestsResult} produced by the loader
|
|
5
|
+
* with domain-friendly accessors so the lookup tool and the registry
|
|
6
|
+
* resource don't have to walk Maps directly.
|
|
7
|
+
*
|
|
8
|
+
* Manifest entries (flat, JSON-friendly shape) are converted into the
|
|
9
|
+
* `ActionEntryInfo` discriminated union historically exposed by
|
|
10
|
+
* `registry/actions.ts`. The lookup tool keeps consuming that shape so
|
|
11
|
+
* this module is the only seam that changed when the hand-written entries
|
|
12
|
+
* were deleted.
|
|
13
|
+
*/
|
|
14
|
+
import type { LoadActionManifestsResult } from '../manifest/actions-loader.js';
|
|
15
|
+
import type { ActionEntry, DbxActionStateValue } from '../manifest/actions-schema.js';
|
|
16
|
+
/**
|
|
17
|
+
* Three roles share a slug index but differ in payload.
|
|
18
|
+
*/
|
|
19
|
+
export type ActionEntryRole = 'directive' | 'store' | 'state';
|
|
20
|
+
/**
|
|
21
|
+
* Stable rendering order for role buckets in the catalog view.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ACTION_ROLE_ORDER: readonly ActionEntryRole[];
|
|
24
|
+
/**
|
|
25
|
+
* Common base fields shared across all three entry shapes.
|
|
26
|
+
*/
|
|
27
|
+
export interface ActionEntryBase {
|
|
28
|
+
readonly slug: string;
|
|
29
|
+
readonly role: ActionEntryRole;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly skillRefs: readonly string[];
|
|
32
|
+
readonly example: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One input on a directive.
|
|
36
|
+
*/
|
|
37
|
+
export interface ActionInputInfo {
|
|
38
|
+
readonly alias: string;
|
|
39
|
+
readonly propertyName: string;
|
|
40
|
+
readonly type: string;
|
|
41
|
+
readonly required: boolean;
|
|
42
|
+
readonly defaultValue?: string;
|
|
43
|
+
readonly description: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One output / event emitter on a directive.
|
|
47
|
+
*/
|
|
48
|
+
export interface ActionOutputInfo {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly type: string;
|
|
51
|
+
readonly description: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Method exposed by a store entry.
|
|
55
|
+
*/
|
|
56
|
+
export interface ActionMethodInfo {
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly signature: string;
|
|
59
|
+
readonly description: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Observable exposed by a store entry.
|
|
63
|
+
*/
|
|
64
|
+
export interface ActionObservableInfo {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly type: string;
|
|
67
|
+
readonly description: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Directive entry. Captures selector + class + DI behavior + the action
|
|
71
|
+
* states the directive interacts with.
|
|
72
|
+
*/
|
|
73
|
+
export interface ActionDirectiveInfo extends ActionEntryBase {
|
|
74
|
+
readonly role: 'directive';
|
|
75
|
+
readonly selector: string;
|
|
76
|
+
readonly className: string;
|
|
77
|
+
readonly module: string;
|
|
78
|
+
readonly inputs: readonly ActionInputInfo[];
|
|
79
|
+
readonly outputs: readonly ActionOutputInfo[];
|
|
80
|
+
readonly producesContext: boolean;
|
|
81
|
+
readonly consumesContext: boolean;
|
|
82
|
+
readonly stateInteraction: readonly DbxActionStateValue[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Store entry. There is exactly one in the registry today
|
|
86
|
+
* (`ActionContextStore`), but the shape allows derivative stores to join.
|
|
87
|
+
*/
|
|
88
|
+
export interface ActionStoreInfo extends ActionEntryBase {
|
|
89
|
+
readonly role: 'store';
|
|
90
|
+
readonly className: string;
|
|
91
|
+
readonly module: string;
|
|
92
|
+
readonly methods: readonly ActionMethodInfo[];
|
|
93
|
+
readonly observables: readonly ActionObservableInfo[];
|
|
94
|
+
readonly disabledKeyDefaults: readonly string[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* State entry — one per member of the `DbxActionState` enum.
|
|
98
|
+
*/
|
|
99
|
+
export interface ActionStateInfo extends ActionEntryBase {
|
|
100
|
+
readonly role: 'state';
|
|
101
|
+
readonly enumName: 'DbxActionState';
|
|
102
|
+
readonly stateValue: DbxActionStateValue;
|
|
103
|
+
readonly literal: string;
|
|
104
|
+
readonly module: string;
|
|
105
|
+
readonly transitionsFrom: readonly DbxActionStateValue[];
|
|
106
|
+
readonly transitionsTo: readonly DbxActionStateValue[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Discriminated union exposed to the lookup tool.
|
|
110
|
+
*/
|
|
111
|
+
export type ActionEntryInfo = ActionDirectiveInfo | ActionStoreInfo | ActionStateInfo;
|
|
112
|
+
/**
|
|
113
|
+
* Domain-friendly read API over a merged actions manifest set.
|
|
114
|
+
*/
|
|
115
|
+
export interface ActionRegistry {
|
|
116
|
+
readonly all: readonly ActionEntryInfo[];
|
|
117
|
+
readonly loadedSources: readonly string[];
|
|
118
|
+
readonly roles: readonly ActionEntryRole[];
|
|
119
|
+
/**
|
|
120
|
+
* Returns the entry whose slug matches `slug` exactly.
|
|
121
|
+
*/
|
|
122
|
+
findBySlug(slug: string): ActionEntryInfo | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Returns the directive entry whose selector matches `selector` exactly.
|
|
125
|
+
*/
|
|
126
|
+
findDirectiveBySelector(selector: string): ActionDirectiveInfo | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the entry whose TypeScript class name matches `className`
|
|
129
|
+
* (case-insensitive).
|
|
130
|
+
*/
|
|
131
|
+
findByClassName(className: string): ActionEntryInfo | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Returns the state entry whose `stateValue` matches.
|
|
134
|
+
*/
|
|
135
|
+
findStateByValue(stateValue: DbxActionStateValue): ActionStateInfo | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Returns every entry in the supplied role, in registry order.
|
|
138
|
+
*/
|
|
139
|
+
findByRole(role: ActionEntryRole): readonly ActionEntryInfo[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Builds an {@link ActionRegistry} from a loader result.
|
|
143
|
+
*
|
|
144
|
+
* @param loaded - The result of loading action manifests.
|
|
145
|
+
* @returns A fully-indexed {@link ActionRegistry}.
|
|
146
|
+
* @__NO_SIDE_EFFECTS__
|
|
147
|
+
*/
|
|
148
|
+
export declare function createActionRegistry(loaded: LoadActionManifestsResult): ActionRegistry;
|
|
149
|
+
/**
|
|
150
|
+
* Builds an {@link ActionRegistry} from a raw {@link ActionEntryInfo} array.
|
|
151
|
+
*
|
|
152
|
+
* @param input - Pre-built entries and source labels.
|
|
153
|
+
* @param input.entries - Action entries already converted to runtime form.
|
|
154
|
+
* @param input.loadedSources - Labels of the manifest sources that contributed the entries.
|
|
155
|
+
* @returns A fully-indexed {@link ActionRegistry}.
|
|
156
|
+
* @__NO_SIDE_EFFECTS__
|
|
157
|
+
*/
|
|
158
|
+
export declare function createActionRegistryFromEntries(input: {
|
|
159
|
+
readonly entries: readonly ActionEntryInfo[];
|
|
160
|
+
readonly loadedSources: readonly string[];
|
|
161
|
+
}): ActionRegistry;
|
|
162
|
+
/**
|
|
163
|
+
* Empty registry for default-no-source scenarios.
|
|
164
|
+
*/
|
|
165
|
+
export declare const EMPTY_ACTION_REGISTRY: ActionRegistry;
|
|
166
|
+
/**
|
|
167
|
+
* Converts a manifest entry into the {@link ActionEntryInfo} shape the
|
|
168
|
+
* lookup tool consumes.
|
|
169
|
+
*
|
|
170
|
+
* @param entry - The action manifest entry (directive, store, or state).
|
|
171
|
+
* @returns The runtime-shaped {@link ActionEntryInfo} for the entry.
|
|
172
|
+
*/
|
|
173
|
+
export declare function toActionEntryInfo(entry: ActionEntry): ActionEntryInfo;
|