@dereekb/dbx-cli 13.11.18 → 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,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arktype schemas for the model-firebase-index manifest format.
|
|
3
|
+
*
|
|
4
|
+
* Manifests catalog the Firestore query-constraint factories opted in via
|
|
5
|
+
* the `@dbxModelFirebaseIndex` JSDoc marker — `*.query.ts` exports whose
|
|
6
|
+
* `where`/`orderBy` constraint sequences imply a required composite index
|
|
7
|
+
* or `fieldOverrides` entry in `firestore.indexes.json`. One manifest per
|
|
8
|
+
* source — bundled `@dereekb/firebase` plus any downstream-app manifests
|
|
9
|
+
* discovered via `dbx-mcp.config.json` — feeds the merged registry that
|
|
10
|
+
* powers the `dbx_model_firebase_index_lookup`,
|
|
11
|
+
* `dbx_model_firebase_index_search`, `dbx_model_firebase_index_list_app`,
|
|
12
|
+
* and `dbx_model_firebase_index_validate_app` MCP tools, and the
|
|
13
|
+
* `generate-firestore-indexes` CLI subcommand that emits a canonical
|
|
14
|
+
* `firestore.indexes.json` from the merged registry.
|
|
15
|
+
*
|
|
16
|
+
* Mirrors {@link ModelSnapshotFieldManifest} — both are tag-driven scanners
|
|
17
|
+
* over plain TS exports, so the schema shapes line up one-to-one. The
|
|
18
|
+
* model-firebase-index schema adds the Firestore-specific payload:
|
|
19
|
+
* - `model` (the target TS type name)
|
|
20
|
+
* - `collection` (the resolved short collection name, e.g. `'jlw'`)
|
|
21
|
+
* - `isNested` (parent identity present, defaults scope to `COLLECTION_GROUP`)
|
|
22
|
+
* - `scope` (`COLLECTION` | `COLLECTION_GROUP`)
|
|
23
|
+
* - `manual` / `skip` flags from the JSDoc tags
|
|
24
|
+
* - `constraintSequences` (raw extracted ordered constraints, one per
|
|
25
|
+
* conditional-branch path)
|
|
26
|
+
* - `derivedComposites` (required composite indexes after analysis)
|
|
27
|
+
* - `derivedFieldOverrides` (required `fieldOverrides[]` contributions
|
|
28
|
+
* after analysis — single-field `COLLECTION_GROUP` queries)
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Firestore query scopes. `COLLECTION` runs against one collection by path;
|
|
32
|
+
* `COLLECTION_GROUP` runs across every collection with the same id under any
|
|
33
|
+
* parent. Auto single-field indexes are `COLLECTION` scope only — anything
|
|
34
|
+
* `COLLECTION_GROUP` needs either a composite or a `fieldOverrides` entry.
|
|
35
|
+
*/
|
|
36
|
+
export declare const FIRESTORE_QUERY_SCOPES: readonly ["COLLECTION", "COLLECTION_GROUP"];
|
|
37
|
+
/**
|
|
38
|
+
* Static type for {@link FIRESTORE_QUERY_SCOPES}.
|
|
39
|
+
*/
|
|
40
|
+
export type FirestoreQueryScope = (typeof FIRESTORE_QUERY_SCOPES)[number];
|
|
41
|
+
/**
|
|
42
|
+
* Ascending vs descending for `orderBy`-bound index fields.
|
|
43
|
+
*/
|
|
44
|
+
export declare const FIRESTORE_INDEX_ORDERS: readonly ["ASCENDING", "DESCENDING"];
|
|
45
|
+
/**
|
|
46
|
+
* Static type for {@link FIRESTORE_INDEX_ORDERS}.
|
|
47
|
+
*/
|
|
48
|
+
export type FirestoreIndexOrder = (typeof FIRESTORE_INDEX_ORDERS)[number];
|
|
49
|
+
/**
|
|
50
|
+
* Array config for an index field — currently only `CONTAINS` (for
|
|
51
|
+
* `array-contains` / `array-contains-any`). Vector configs are out of scope.
|
|
52
|
+
*/
|
|
53
|
+
export declare const FIRESTORE_INDEX_ARRAY_CONFIGS: readonly ["CONTAINS"];
|
|
54
|
+
/**
|
|
55
|
+
* Static type for {@link FIRESTORE_INDEX_ARRAY_CONFIGS}.
|
|
56
|
+
*/
|
|
57
|
+
export type FirestoreIndexArrayConfig = (typeof FIRESTORE_INDEX_ARRAY_CONFIGS)[number];
|
|
58
|
+
/**
|
|
59
|
+
* Index density. Firestore's default for composites is `SPARSE_ALL` — skip
|
|
60
|
+
* documents missing any indexed field. Every composite in the live HelloSubs
|
|
61
|
+
* deploy carries this; the generator emits it on every entry so generated
|
|
62
|
+
* output round-trips cleanly against `firebase firestore:indexes`.
|
|
63
|
+
*/
|
|
64
|
+
export declare const FIRESTORE_INDEX_DENSITY_VALUES: readonly ["SPARSE_ALL", "SPARSE_ANY", "DENSE"];
|
|
65
|
+
/**
|
|
66
|
+
* Static type for {@link FIRESTORE_INDEX_DENSITY_VALUES}.
|
|
67
|
+
*/
|
|
68
|
+
export type FirestoreIndexDensity = (typeof FIRESTORE_INDEX_DENSITY_VALUES)[number];
|
|
69
|
+
/**
|
|
70
|
+
* Default density emitted by the generator. Matches the live HelloSubs deploy.
|
|
71
|
+
*/
|
|
72
|
+
export declare const DEFAULT_FIRESTORE_INDEX_DENSITY: FirestoreIndexDensity;
|
|
73
|
+
/**
|
|
74
|
+
* Constraint kind inside a {@link ConstraintSequenceEntry}. `where` and
|
|
75
|
+
* `orderBy` are the base SDK calls; `helper` records an expanded helper
|
|
76
|
+
* (e.g. `whereDateIsBeforeWithSort`) so the source factory is faithful.
|
|
77
|
+
*/
|
|
78
|
+
export declare const FIRESTORE_CONSTRAINT_KINDS: readonly ["where", "orderBy"];
|
|
79
|
+
/**
|
|
80
|
+
* Static type for {@link FIRESTORE_CONSTRAINT_KINDS}.
|
|
81
|
+
*/
|
|
82
|
+
export type FirestoreConstraintKind = (typeof FIRESTORE_CONSTRAINT_KINDS)[number];
|
|
83
|
+
/**
|
|
84
|
+
* Closed vocabulary of Firestore `where` operators the extractor knows
|
|
85
|
+
* about. Drives the "is this equality / range / array-contains?" decision
|
|
86
|
+
* the analyzer uses to apply Firestore composite-field-order rules.
|
|
87
|
+
*/
|
|
88
|
+
export declare const FIRESTORE_WHERE_OPERATORS: readonly ["==", "!=", "<", "<=", ">", ">=", "in", "not-in", "array-contains", "array-contains-any"];
|
|
89
|
+
/**
|
|
90
|
+
* Static type for {@link FIRESTORE_WHERE_OPERATORS}.
|
|
91
|
+
*/
|
|
92
|
+
export type FirestoreWhereOperator = (typeof FIRESTORE_WHERE_OPERATORS)[number];
|
|
93
|
+
/**
|
|
94
|
+
* One constraint inside a {@link ConstraintSequence}. `kind` tells the
|
|
95
|
+
* analyzer which field-order bucket the entry falls into; `operator` is
|
|
96
|
+
* `where`-only; `direction` is `orderBy`-only; `fromHelper` records the
|
|
97
|
+
* source helper when the entry was expanded from one of the
|
|
98
|
+
* `firestoreQueryHelpers` registry entries (used for diagnostics).
|
|
99
|
+
*/
|
|
100
|
+
export declare const ConstraintSequenceEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
101
|
+
kind: "where" | "orderBy";
|
|
102
|
+
fieldPath: string;
|
|
103
|
+
operator?: ">" | ">=" | "<" | "<=" | "==" | "in" | "!=" | "not-in" | "array-contains" | "array-contains-any" | undefined;
|
|
104
|
+
direction?: "asc" | "desc" | undefined;
|
|
105
|
+
fromHelper?: string | undefined;
|
|
106
|
+
}, {}>;
|
|
107
|
+
/**
|
|
108
|
+
* Static type for {@link ConstraintSequenceEntry}.
|
|
109
|
+
*/
|
|
110
|
+
export type ConstraintSequenceEntry = typeof ConstraintSequenceEntry.infer;
|
|
111
|
+
/**
|
|
112
|
+
* One linear path through a factory body. Conditional branches enumerate
|
|
113
|
+
* into multiple sequences. The generator dedupes equivalent index outputs;
|
|
114
|
+
* the sequence list itself is kept verbatim so diagnostics can point back
|
|
115
|
+
* to the source branch.
|
|
116
|
+
*/
|
|
117
|
+
export declare const ConstraintSequence: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
118
|
+
entries: {
|
|
119
|
+
kind: "where" | "orderBy";
|
|
120
|
+
fieldPath: string;
|
|
121
|
+
operator?: ">" | ">=" | "<" | "<=" | "==" | "in" | "!=" | "not-in" | "array-contains" | "array-contains-any" | undefined;
|
|
122
|
+
direction?: "asc" | "desc" | undefined;
|
|
123
|
+
fromHelper?: string | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
pathLabel?: string | undefined;
|
|
126
|
+
}, {}>;
|
|
127
|
+
/**
|
|
128
|
+
* Static type for {@link ConstraintSequence}.
|
|
129
|
+
*/
|
|
130
|
+
export type ConstraintSequence = typeof ConstraintSequence.infer;
|
|
131
|
+
/**
|
|
132
|
+
* One field inside a derived composite index. Exactly one of `order` /
|
|
133
|
+
* `arrayConfig` is set.
|
|
134
|
+
*/
|
|
135
|
+
export declare const DerivedIndexField: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
136
|
+
fieldPath: string;
|
|
137
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
138
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
139
|
+
}, {}>;
|
|
140
|
+
/**
|
|
141
|
+
* Static type for {@link DerivedIndexField}.
|
|
142
|
+
*/
|
|
143
|
+
export type DerivedIndexField = typeof DerivedIndexField.infer;
|
|
144
|
+
/**
|
|
145
|
+
* One composite index a factory requires. Field order matches Firestore's
|
|
146
|
+
* required form (equality → range → array-contains → orderBy). The
|
|
147
|
+
* `__name__` tiebreaker is NOT stored here — the generator appends it at
|
|
148
|
+
* emission time, picking direction from the last orderBy.
|
|
149
|
+
*/
|
|
150
|
+
export declare const DerivedComposite: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
151
|
+
collectionGroup: string;
|
|
152
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
153
|
+
fields: {
|
|
154
|
+
fieldPath: string;
|
|
155
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
156
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
density: "SPARSE_ALL" | "SPARSE_ANY" | "DENSE";
|
|
159
|
+
}, {}>;
|
|
160
|
+
/**
|
|
161
|
+
* Static type for {@link DerivedComposite}.
|
|
162
|
+
*/
|
|
163
|
+
export type DerivedComposite = typeof DerivedComposite.infer;
|
|
164
|
+
/**
|
|
165
|
+
* One single-field `fieldOverrides[]` variant a factory contributes. Only
|
|
166
|
+
* emitted for `COLLECTION_GROUP`-scope single-field queries (auto indexes
|
|
167
|
+
* cover the `COLLECTION`-scope case). The generator combines multiple
|
|
168
|
+
* factory contributions on the same `(collectionGroup, fieldPath)` plus
|
|
169
|
+
* the standard `COLLECTION` quartet, mirroring the live HelloSubs deploy
|
|
170
|
+
* shape.
|
|
171
|
+
*/
|
|
172
|
+
export declare const DerivedFieldOverrideVariant: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
173
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
174
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
175
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
176
|
+
}, {}>;
|
|
177
|
+
/**
|
|
178
|
+
* Static type for {@link DerivedFieldOverrideVariant}.
|
|
179
|
+
*/
|
|
180
|
+
export type DerivedFieldOverrideVariant = typeof DerivedFieldOverrideVariant.infer;
|
|
181
|
+
/**
|
|
182
|
+
* One `fieldOverrides[]` contribution from a factory. `collectionGroup`
|
|
183
|
+
* is the resolved short collection name, `fieldPath` is the field name
|
|
184
|
+
* the factory queries by, and `variants[]` lists the (scope, order or
|
|
185
|
+
* arrayConfig) tuples implied by the factory's constraint sequences.
|
|
186
|
+
*/
|
|
187
|
+
export declare const DerivedFieldOverride: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
188
|
+
collectionGroup: string;
|
|
189
|
+
fieldPath: string;
|
|
190
|
+
variants: {
|
|
191
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
192
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
193
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
}, {}>;
|
|
196
|
+
/**
|
|
197
|
+
* Static type for {@link DerivedFieldOverride}.
|
|
198
|
+
*/
|
|
199
|
+
export type DerivedFieldOverride = typeof DerivedFieldOverride.infer;
|
|
200
|
+
/**
|
|
201
|
+
* One documented parameter of a query-factory function. Mirrors
|
|
202
|
+
* {@link ModelSnapshotFieldParamEntry} so the same JSDoc-`@param`
|
|
203
|
+
* extraction logic can be reused.
|
|
204
|
+
*/
|
|
205
|
+
export declare const ModelFirebaseIndexParamEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
206
|
+
name: string;
|
|
207
|
+
type: string;
|
|
208
|
+
description: string;
|
|
209
|
+
optional: boolean;
|
|
210
|
+
}, {}>;
|
|
211
|
+
/**
|
|
212
|
+
* Static type for {@link ModelFirebaseIndexParamEntry}.
|
|
213
|
+
*/
|
|
214
|
+
export type ModelFirebaseIndexParamEntry = typeof ModelFirebaseIndexParamEntry.infer;
|
|
215
|
+
/**
|
|
216
|
+
* One model-firebase-index entry inside a manifest. Each entry describes a
|
|
217
|
+
* single `@dbxModelFirebaseIndex`-tagged query factory — its slug, target
|
|
218
|
+
* model, resolved collection name, scope, constraint sequences, and the
|
|
219
|
+
* indexes/field-overrides it requires.
|
|
220
|
+
*
|
|
221
|
+
* Required fields are the minimum needed for
|
|
222
|
+
* `dbx_model_firebase_index_lookup` to render a useful answer; every other
|
|
223
|
+
* field is optional so the extractor can populate them progressively.
|
|
224
|
+
*/
|
|
225
|
+
export declare const ModelFirebaseIndexEntry: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
226
|
+
slug: string;
|
|
227
|
+
name: string;
|
|
228
|
+
module: string;
|
|
229
|
+
subpath: string;
|
|
230
|
+
signature: string;
|
|
231
|
+
description: string;
|
|
232
|
+
model: string;
|
|
233
|
+
collection: string;
|
|
234
|
+
isNested: boolean;
|
|
235
|
+
scope: "COLLECTION" | "COLLECTION_GROUP";
|
|
236
|
+
manual: boolean;
|
|
237
|
+
skip: boolean;
|
|
238
|
+
category: string;
|
|
239
|
+
params: {
|
|
240
|
+
name: string;
|
|
241
|
+
type: string;
|
|
242
|
+
description: string;
|
|
243
|
+
optional: boolean;
|
|
244
|
+
}[];
|
|
245
|
+
returns: string;
|
|
246
|
+
tags: string[];
|
|
247
|
+
constraintSequences: {
|
|
248
|
+
entries: {
|
|
249
|
+
kind: "where" | "orderBy";
|
|
250
|
+
fieldPath: string;
|
|
251
|
+
operator?: ">" | ">=" | "<" | "<=" | "==" | "in" | "!=" | "not-in" | "array-contains" | "array-contains-any" | undefined;
|
|
252
|
+
direction?: "asc" | "desc" | undefined;
|
|
253
|
+
fromHelper?: string | undefined;
|
|
254
|
+
}[];
|
|
255
|
+
pathLabel?: string | undefined;
|
|
256
|
+
}[];
|
|
257
|
+
derivedComposites: {
|
|
258
|
+
collectionGroup: string;
|
|
259
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
260
|
+
fields: {
|
|
261
|
+
fieldPath: string;
|
|
262
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
263
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
264
|
+
}[];
|
|
265
|
+
density: "SPARSE_ALL" | "SPARSE_ANY" | "DENSE";
|
|
266
|
+
}[];
|
|
267
|
+
derivedFieldOverrides: {
|
|
268
|
+
collectionGroup: string;
|
|
269
|
+
fieldPath: string;
|
|
270
|
+
variants: {
|
|
271
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
272
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
273
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
274
|
+
}[];
|
|
275
|
+
}[];
|
|
276
|
+
specOnly?: boolean | undefined;
|
|
277
|
+
excluded?: boolean | undefined;
|
|
278
|
+
example?: string | undefined;
|
|
279
|
+
relatedSlugs?: string[] | undefined;
|
|
280
|
+
skillRefs?: string[] | undefined;
|
|
281
|
+
deprecated?: string | boolean | undefined;
|
|
282
|
+
since?: string | undefined;
|
|
283
|
+
}, {}>;
|
|
284
|
+
/**
|
|
285
|
+
* Static type for {@link ModelFirebaseIndexEntry}.
|
|
286
|
+
*/
|
|
287
|
+
export type ModelFirebaseIndexEntry = typeof ModelFirebaseIndexEntry.infer;
|
|
288
|
+
/**
|
|
289
|
+
* Top-level manifest envelope. One file per source. The `source` field is
|
|
290
|
+
* the workspace-unique label used to detect collisions; `module` carries
|
|
291
|
+
* the npm package the entries ship in.
|
|
292
|
+
*
|
|
293
|
+
* `version` is the schema version. The loader currently accepts only
|
|
294
|
+
* `version: 1`; manifests with any other value are rejected (strict
|
|
295
|
+
* sources) or warned-and-skipped (non-strict sources).
|
|
296
|
+
*/
|
|
297
|
+
export declare const ModelFirebaseIndexManifest: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
298
|
+
version: 1;
|
|
299
|
+
source: string;
|
|
300
|
+
module: string;
|
|
301
|
+
generatedAt: string;
|
|
302
|
+
generator: string;
|
|
303
|
+
entries: {
|
|
304
|
+
slug: string;
|
|
305
|
+
name: string;
|
|
306
|
+
module: string;
|
|
307
|
+
subpath: string;
|
|
308
|
+
signature: string;
|
|
309
|
+
description: string;
|
|
310
|
+
model: string;
|
|
311
|
+
collection: string;
|
|
312
|
+
isNested: boolean;
|
|
313
|
+
scope: "COLLECTION" | "COLLECTION_GROUP";
|
|
314
|
+
manual: boolean;
|
|
315
|
+
skip: boolean;
|
|
316
|
+
category: string;
|
|
317
|
+
params: {
|
|
318
|
+
name: string;
|
|
319
|
+
type: string;
|
|
320
|
+
description: string;
|
|
321
|
+
optional: boolean;
|
|
322
|
+
}[];
|
|
323
|
+
returns: string;
|
|
324
|
+
tags: string[];
|
|
325
|
+
constraintSequences: {
|
|
326
|
+
entries: {
|
|
327
|
+
kind: "where" | "orderBy";
|
|
328
|
+
fieldPath: string;
|
|
329
|
+
operator?: ">" | ">=" | "<" | "<=" | "==" | "in" | "!=" | "not-in" | "array-contains" | "array-contains-any" | undefined;
|
|
330
|
+
direction?: "asc" | "desc" | undefined;
|
|
331
|
+
fromHelper?: string | undefined;
|
|
332
|
+
}[];
|
|
333
|
+
pathLabel?: string | undefined;
|
|
334
|
+
}[];
|
|
335
|
+
derivedComposites: {
|
|
336
|
+
collectionGroup: string;
|
|
337
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
338
|
+
fields: {
|
|
339
|
+
fieldPath: string;
|
|
340
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
341
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
342
|
+
}[];
|
|
343
|
+
density: "SPARSE_ALL" | "SPARSE_ANY" | "DENSE";
|
|
344
|
+
}[];
|
|
345
|
+
derivedFieldOverrides: {
|
|
346
|
+
collectionGroup: string;
|
|
347
|
+
fieldPath: string;
|
|
348
|
+
variants: {
|
|
349
|
+
queryScope: "COLLECTION" | "COLLECTION_GROUP";
|
|
350
|
+
order?: "ASCENDING" | "DESCENDING" | undefined;
|
|
351
|
+
arrayConfig?: "CONTAINS" | undefined;
|
|
352
|
+
}[];
|
|
353
|
+
}[];
|
|
354
|
+
specOnly?: boolean | undefined;
|
|
355
|
+
excluded?: boolean | undefined;
|
|
356
|
+
example?: string | undefined;
|
|
357
|
+
relatedSlugs?: string[] | undefined;
|
|
358
|
+
skillRefs?: string[] | undefined;
|
|
359
|
+
deprecated?: string | boolean | undefined;
|
|
360
|
+
since?: string | undefined;
|
|
361
|
+
}[];
|
|
362
|
+
}, {}>;
|
|
363
|
+
/**
|
|
364
|
+
* Static type for {@link ModelFirebaseIndexManifest}.
|
|
365
|
+
*/
|
|
366
|
+
export type ModelFirebaseIndexManifest = typeof ModelFirebaseIndexManifest.infer;
|
|
@@ -5,7 +5,7 @@ const require = __createRequire(import.meta.url);
|
|
|
5
5
|
// packages/dbx-cli/generate-firestore-indexes/package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@dereekb/dbx-cli-generate-firestore-indexes",
|
|
8
|
-
version: "13.
|
|
8
|
+
version: "13.12.0",
|
|
9
9
|
private: true,
|
|
10
10
|
type: "module",
|
|
11
11
|
devDependencies: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a pre-rendered MCP manifest JSON file from a generated CliApiManifest.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline (build-time, run via `nx run <demo-api>:generate-mcp-manifest`):
|
|
5
|
+
*
|
|
6
|
+
* 1. Load the TS module passed via `--input`, expecting either an `<X>_API_MANIFEST`
|
|
7
|
+
* named export or a default export typed as `CliApiManifest`. The file is loaded
|
|
8
|
+
* via dynamic `import()` so it must compile under ESM — same as the demo-cli
|
|
9
|
+
* manifests written by `dbx-cli-generate-firebase-api-manifest`.
|
|
10
|
+
* 2. Run the pure {@link renderMcpManifest} renderer to pre-merge descriptions,
|
|
11
|
+
* enrich the input JSON Schema with `paramsFields[]` descriptions, and
|
|
12
|
+
* synthesize an `outputSchema` from `resultFields[]`.
|
|
13
|
+
* 3. Write the result to `<output>.tmp`, then `fs.renameSync` to `<output>` so
|
|
14
|
+
* partial files never land on disk.
|
|
15
|
+
*
|
|
16
|
+
* Flags:
|
|
17
|
+
* --input=<path> (required) path to the *.api.manifest.generated.ts file.
|
|
18
|
+
* Absolute or workspace-relative.
|
|
19
|
+
* --output=<path> (required) destination JSON path (workspace-relative ok).
|
|
20
|
+
* --regenerate-input Reserved for a future revision that will invoke
|
|
21
|
+
* `dbx-cli-generate-firebase-api-manifest` first when the
|
|
22
|
+
* input file is missing. Today this flag is accepted but
|
|
23
|
+
* not honored; missing inputs still fail with a clear
|
|
24
|
+
* pointer to the right manifest target.
|
|
25
|
+
*/
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type AuthRegistry, type CliApiManifest, type CliModelManifest, type McpManifest } from '@dereekb/dbx-cli';
|
|
2
|
+
/**
|
|
3
|
+
* Inputs to {@link renderMcpManifest}.
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderMcpManifestInput {
|
|
6
|
+
/**
|
|
7
|
+
* Generated API manifest used to render tool entries.
|
|
8
|
+
*/
|
|
9
|
+
readonly apiManifest: CliApiManifest;
|
|
10
|
+
/**
|
|
11
|
+
* Optional generated model manifest. When present, projects each entry into
|
|
12
|
+
* the runtime {@link McpManifestModelEntry} shape and emits a `models` array
|
|
13
|
+
* on the output JSON for the runtime's built-in catalog tools.
|
|
14
|
+
*/
|
|
15
|
+
readonly modelManifest?: CliModelManifest;
|
|
16
|
+
/**
|
|
17
|
+
* Optional auth registry + primary-app slug used to project the runtime
|
|
18
|
+
* `auth` section on the manifest. The renderer filters entries to the
|
|
19
|
+
* primary app's claim catalog (inherited claims like `fr` are included
|
|
20
|
+
* via the app's `claimKeys` list).
|
|
21
|
+
*/
|
|
22
|
+
readonly auth?: {
|
|
23
|
+
readonly registry: AuthRegistry;
|
|
24
|
+
readonly app: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pure renderer: turns a {@link CliApiManifest} (and optional {@link CliModelManifest})
|
|
29
|
+
* into the {@link McpManifest} JSON shape.
|
|
30
|
+
*
|
|
31
|
+
* No file I/O — the main entry handles writing. Skips `verb === 'standalone'` entries
|
|
32
|
+
* (they aren't dispatched through callModel and have no MCP tool counterpart).
|
|
33
|
+
*
|
|
34
|
+
* @param input - The render config carrying the API manifest and optional model manifest.
|
|
35
|
+
* @param now - Override for the `generatedAt` timestamp. Tests pass a fixed value.
|
|
36
|
+
* @returns The rendered MCP manifest with tools keyed by {@link mcpManifestKey} and an optional models array.
|
|
37
|
+
*/
|
|
38
|
+
export declare function renderMcpManifest(input: RenderMcpManifestInput, now?: Date): McpManifest;
|