@dereekb/dbx-components-mcp 14.1.0 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,8 @@ var __export = (target, all) => {
10
10
  // packages/dbx-components-mcp/package.json
11
11
  var package_default = {
12
12
  name: "@dereekb/dbx-components-mcp",
13
- version: "14.1.0",
13
+ version: "14.3.0",
14
+ sideEffects: false,
14
15
  type: "module",
15
16
  bin: {
16
17
  "dbx-components-mcp": "dbx-components-mcp.js"
@@ -21,8 +22,8 @@ var package_default = {
21
22
  "ts-morph": "^21.0.0"
22
23
  },
23
24
  peerDependencies: {
24
- "@dereekb/dbx-cli": "14.1.0",
25
- "@dereekb/util": "14.1.0"
25
+ "@dereekb/dbx-cli": "14.3.0",
26
+ "@dereekb/util": "14.3.0"
26
27
  }
27
28
  };
28
29
 
@@ -1934,7 +1935,7 @@ var FIREBASE_MODELS = [
1934
1935
  {
1935
1936
  name: "x",
1936
1937
  longName: "extensionData",
1937
- converter: "optionalFirestorePassthroughJsonField<CalendarExtensionData>({ filterEmptyValues: true, dontStoreIfEmpty: true })",
1938
+ converter: "optionalFirestoreJsonStringField<CalendarExtensionData>({ filterEmptyValues: true, dontStoreIfEmpty: true })",
1938
1939
  tsType: "Maybe<CalendarExtensionData>",
1939
1940
  optional: true,
1940
1941
  description: `Extension data emitted as "X-" properties on the calendar's VCALENDAR.`
@@ -2048,7 +2049,7 @@ var FIREBASE_MODELS = [
2048
2049
  {
2049
2050
  name: "d",
2050
2051
  longName: "data",
2051
- converter: "optionalFirestorePassthroughJsonField<FormSpaceData>({ dontStoreIfEmpty: true })",
2052
+ converter: "optionalFirestoreJsonStringField<FormSpaceData>({ dontStoreIfEmpty: true })",
2052
2053
  tsType: "Maybe<T>",
2053
2054
  optional: true,
2054
2055
  description: "The form's own values, stored as pass-through JSON."
@@ -29298,6 +29299,9 @@ var MCP_TOOL_NAME_SEGMENT_TAG = "dbxModelMcpToolNameSegment";
29298
29299
  var MODEL_TYPE_VALUE_PATTERN2 = /^[a-z][A-Za-z0-9_$]*$/;
29299
29300
  var TOOL_NAME_SEGMENT_PATTERN = /^[A-Za-z][A-Za-z0-9_$]*$/;
29300
29301
  var IDENTITY_FN = "firestoreModelIdentity";
29302
+ var IDENTITY_TYPE = "FirestoreModelIdentity";
29303
+ var ROOT_IDENTITY_TYPE = "RootFirestoreModelIdentity";
29304
+ var IDENTITY_WITH_PARENT_TYPE = "FirestoreModelIdentityWithParent";
29301
29305
  var SINGLE_ITEM_COLLECTION_FN = "singleItemFirestoreCollection";
29302
29306
  var ROOT_SINGLE_ITEM_COLLECTION_FN = "rootSingleItemFirestoreCollection";
29303
29307
  var SINGLE_ITEM_COLLECTION_FN_NAMES = [SINGLE_ITEM_COLLECTION_FN, ROOT_SINGLE_ITEM_COLLECTION_FN];
@@ -29329,16 +29333,73 @@ function readIdentities(sourceFile) {
29329
29333
  if (!statement.isExported()) continue;
29330
29334
  for (const decl of statement.getDeclarations()) {
29331
29335
  const initializer = decl.getInitializer();
29332
- if (!initializer || !Node24.isCallExpression(initializer)) continue;
29333
- if (initializer.getExpression().getText() !== IDENTITY_FN) continue;
29334
- const parsed = parseFirestoreModelIdentityArgs(initializer.getArguments());
29335
- if (parsed) {
29336
- out.push({ identityConst: decl.getName(), ...parsed });
29336
+ if (initializer && Node24.isCallExpression(initializer)) {
29337
+ if (initializer.getExpression().getText() !== IDENTITY_FN) continue;
29338
+ const parsed = parseFirestoreModelIdentityArgs(initializer.getArguments());
29339
+ if (parsed) {
29340
+ out.push({ identityConst: decl.getName(), ...parsed, parentModelType: void 0 });
29341
+ }
29342
+ } else {
29343
+ const parsed = parseDeclaredIdentityType(decl.getTypeNode());
29344
+ if (parsed) {
29345
+ out.push({ identityConst: decl.getName(), ...parsed });
29346
+ }
29337
29347
  }
29338
29348
  }
29339
29349
  }
29340
29350
  return out;
29341
29351
  }
29352
+ function parseDeclaredIdentityType(typeNode) {
29353
+ let result;
29354
+ const named = readNamedTypeNode(typeNode);
29355
+ if (named) {
29356
+ const { typeName, args } = named;
29357
+ if (typeName === IDENTITY_WITH_PARENT_TYPE && args.length >= 3) {
29358
+ const parent = parseDeclaredIdentityType(args[0]);
29359
+ result = {
29360
+ modelType: readLiteralTypeText(args[1]) ?? "",
29361
+ collectionPrefix: readLiteralTypeText(args[2]),
29362
+ parentIdentityConst: void 0,
29363
+ parentModelType: parent?.modelType
29364
+ };
29365
+ } else if ((typeName === ROOT_IDENTITY_TYPE || typeName === IDENTITY_TYPE) && args.length >= 2) {
29366
+ result = {
29367
+ modelType: readLiteralTypeText(args[0]) ?? "",
29368
+ collectionPrefix: readLiteralTypeText(args[1]),
29369
+ parentIdentityConst: void 0,
29370
+ parentModelType: void 0
29371
+ };
29372
+ }
29373
+ if (result && !result.modelType) {
29374
+ result = void 0;
29375
+ }
29376
+ }
29377
+ return result;
29378
+ }
29379
+ function readNamedTypeNode(typeNode) {
29380
+ let result;
29381
+ if (typeNode) {
29382
+ if (Node24.isImportTypeNode(typeNode)) {
29383
+ const qualifier = typeNode.getQualifier();
29384
+ if (qualifier) {
29385
+ result = { typeName: qualifier.getText().split(".").pop() ?? "", args: typeNode.getTypeArguments() };
29386
+ }
29387
+ } else if (Node24.isTypeReference(typeNode)) {
29388
+ result = { typeName: typeNode.getTypeName().getText().split(".").pop() ?? "", args: typeNode.getTypeArguments() };
29389
+ }
29390
+ }
29391
+ return result;
29392
+ }
29393
+ function readLiteralTypeText(node) {
29394
+ let result;
29395
+ if (node && Node24.isLiteralTypeNode(node)) {
29396
+ const literal = node.getLiteral();
29397
+ if (Node24.isStringLiteral(literal)) {
29398
+ result = literal.getLiteralText();
29399
+ }
29400
+ }
29401
+ return result;
29402
+ }
29342
29403
  function readInterfaces(sourceFile) {
29343
29404
  const out = [];
29344
29405
  for (const decl of sourceFile.getInterfaces()) {
@@ -1795,7 +1795,7 @@
1795
1795
  "source": "@dereekb/dbx-web",
1796
1796
  "module": "@dereekb/dbx-web",
1797
1797
  "file": "src/lib/interaction/dialog/_dialog.scss",
1798
- "line": 20,
1798
+ "line": 45,
1799
1799
  "declarations": [
1800
1800
  {
1801
1801
  "property": "display",
@@ -1124,6 +1124,19 @@
1124
1124
  },
1125
1125
  "componentScope": "dialog"
1126
1126
  },
1127
+ {
1128
+ "cssVariable": "--dbx-dialog-max-width",
1129
+ "source": "dbx-web",
1130
+ "role": "size",
1131
+ "intents": [
1132
+ "dialog max width"
1133
+ ],
1134
+ "description": "Component-scoped override point (`dialog`) read in `packages/dbx-web/src/lib/interaction/dialog/_dialog.scss` — set it (from an app, or via the owning dbx directive where one exists) to override; unset, it falls back to `80vw`.",
1135
+ "defaults": {
1136
+ "light": "80vw"
1137
+ },
1138
+ "componentScope": "dialog"
1139
+ },
1127
1140
  {
1128
1141
  "cssVariable": "--dbx-disabled-color",
1129
1142
  "scssVariable": "$dbx-disabled-color-var",
@@ -132,6 +132,47 @@
132
132
  "firestore-sub-object"
133
133
  ]
134
134
  },
135
+ {
136
+ "slug": "optional-firestore-json-string-field",
137
+ "name": "optionalFirestoreJsonStringField",
138
+ "kind": "factory",
139
+ "category": "object",
140
+ "module": "@dereekb/firebase",
141
+ "subpath": "common/firestore/snapshot/snapshot.field",
142
+ "signature": "optionalFirestoreJsonStringField(config?: OptionalFirestoreJsonStringFieldConfig): FirestoreModelFieldMapFunctionsConfig<Maybe<T>, Maybe<string>>",
143
+ "description": "Creates a field mapping configuration for an optional object field that is stored as a JSON STRING.\n\nThe counterpart to {@link optionalFirestorePassthroughJsonField}, and the one to reach for when the\njson is arbitrary rather than merely unmodelled: a json schema, a tool definition, whatever an llm\nreturned. The passthrough field stores a native Firestore map, and a map cannot represent every legal\njson value — Firestore forbids an array directly inside an array, which an array-valued `enum`,\n`const`, `default`, or `examples` produces immediately. That write does not degrade, it FAILS, and it\nfails from inside whatever was doing the writing with an opaque \"invalid nested entity\" error.\n\nSerializing sidesteps the entire Firestore type system: the stored value is one string, so anything\n`JSON.stringify` accepts round-trips exactly, including the shapes a map rejects. The cost is that the\nfield is no longer queryable and no longer readable in the Firestore console — pick this one when the\njson is never a query target, and the passthrough field when it is.\n\nTwo behaviours worth knowing:\n\n- A value only `JSON.stringify` knows how to narrow is narrowed. A `Date` becomes an ISO string and\n stays a string on read, where the passthrough field would have kept it a `Timestamp`. Anything\n carrying non-json values wants the passthrough field, not this one.\n- Reads tolerate a legacy native map, so a field migrated from\n {@link optionalFirestorePassthroughJsonField} keeps reading documents written before the switch. New\n writes are always strings, so a document converts itself the next time it is written.",
144
+ "optional": true,
145
+ "params": [
146
+ {
147
+ "name": "config",
148
+ "type": "OptionalFirestoreJsonStringFieldConfig",
149
+ "description": "- Filtering and storage configuration. Defaults to stripping `undefined` values at every depth.",
150
+ "optional": true
151
+ }
152
+ ],
153
+ "returns": "A field mapping configuration for optional json values stored as a string.",
154
+ "tags": [
155
+ "json",
156
+ "string",
157
+ "serialized",
158
+ "stringify",
159
+ "object",
160
+ "raw",
161
+ "optional",
162
+ "arbitrary",
163
+ "schema",
164
+ "factory",
165
+ "firestore",
166
+ "field",
167
+ "optionalfirestorejsonstringfield"
168
+ ],
169
+ "example": "fields: {\n // { model: 'm', text: { format: { schema: { enum: [['a']] } } } }\n // stores as the string '{\"model\":\"m\",\"text\":{\"format\":{\"schema\":{\"enum\":[[\"a\"]]}}}}'\n config: optionalFirestoreJsonStringField<MyVendorConfig>(),\n // store null rather than the string '{}' when nothing survives the filtering\n usage: optionalFirestoreJsonStringField<MyVendorUsage>({ filterEmptyValues: true, dontStoreIfEmpty: true })\n}",
170
+ "relatedSlugs": [
171
+ "optional-firestore-passthrough-json-field",
172
+ "optional-firestore-field",
173
+ "firestore-sub-object"
174
+ ]
175
+ },
135
176
  {
136
177
  "slug": "firestore-string",
137
178
  "name": "firestoreString",
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-components-mcp",
3
- "version": "14.1.0",
3
+ "version": "14.3.0",
4
+ "sideEffects": false,
4
5
  "type": "module",
5
6
  "bin": {
6
7
  "dbx-components-mcp": "dbx-components-mcp.js"
@@ -11,7 +12,7 @@
11
12
  "ts-morph": "^21.0.0"
12
13
  },
13
14
  "peerDependencies": {
14
- "@dereekb/dbx-cli": "14.1.0",
15
- "@dereekb/util": "14.1.0"
15
+ "@dereekb/dbx-cli": "14.3.0",
16
+ "@dereekb/util": "14.3.0"
16
17
  }
17
18
  }