@lumerahq/cli 0.22.3 → 0.22.5

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/dist/index.js CHANGED
@@ -226,25 +226,25 @@ async function main() {
226
226
  switch (command) {
227
227
  // Resource commands
228
228
  case "plan":
229
- await import("./resources-DP24VKSG.js").then((m) => m.plan(args.slice(1)));
229
+ await import("./resources-62N77NOM.js").then((m) => m.plan(args.slice(1)));
230
230
  break;
231
231
  case "apply":
232
- await import("./resources-DP24VKSG.js").then((m) => m.apply(args.slice(1)));
232
+ await import("./resources-62N77NOM.js").then((m) => m.apply(args.slice(1)));
233
233
  break;
234
234
  case "pull":
235
- await import("./resources-DP24VKSG.js").then((m) => m.pull(args.slice(1)));
235
+ await import("./resources-62N77NOM.js").then((m) => m.pull(args.slice(1)));
236
236
  break;
237
237
  case "destroy":
238
- await import("./resources-DP24VKSG.js").then((m) => m.destroy(args.slice(1)));
238
+ await import("./resources-62N77NOM.js").then((m) => m.destroy(args.slice(1)));
239
239
  break;
240
240
  case "list":
241
- await import("./resources-DP24VKSG.js").then((m) => m.list(args.slice(1)));
241
+ await import("./resources-62N77NOM.js").then((m) => m.list(args.slice(1)));
242
242
  break;
243
243
  case "show":
244
- await import("./resources-DP24VKSG.js").then((m) => m.show(args.slice(1)));
244
+ await import("./resources-62N77NOM.js").then((m) => m.show(args.slice(1)));
245
245
  break;
246
246
  case "diff":
247
- await import("./resources-DP24VKSG.js").then((m) => m.diff(args.slice(1)));
247
+ await import("./resources-62N77NOM.js").then((m) => m.diff(args.slice(1)));
248
248
  break;
249
249
  // Development
250
250
  case "dev":
@@ -186,14 +186,18 @@ var collectionSchemaRule = {
186
186
  if (!isRecord2(search)) {
187
187
  issues.push(error(target, 'Optional field "search" must be an object when present.'));
188
188
  } else {
189
- const unknownSearchKeys = Object.keys(search).filter((key) => key !== "fulltext");
189
+ const unknownSearchKeys = Object.keys(search).filter((key) => key !== "fulltext" && key !== "semantic");
190
190
  for (const key of unknownSearchKeys) {
191
191
  issues.push(error(target, `Unknown search option "${key}".`));
192
192
  }
193
193
  const fulltext = search.fulltext;
194
- if (!isRecord2(fulltext)) {
195
- issues.push(error(target, '"search.fulltext" must be an object.'));
196
- } else {
194
+ const semantic = search.semantic;
195
+ if (fulltext === void 0 && semantic === void 0) {
196
+ issues.push(error(target, '"search" must include "fulltext" or "semantic".'));
197
+ }
198
+ if (fulltext !== void 0 && !isRecord2(fulltext)) {
199
+ issues.push(error(target, '"search.fulltext" must be an object when present.'));
200
+ } else if (isRecord2(fulltext)) {
197
201
  const allowed = /* @__PURE__ */ new Set(["fields", "language", "fuzzy_fields"]);
198
202
  for (const key of Object.keys(fulltext).filter((key2) => !allowed.has(key2))) {
199
203
  issues.push(error(target, `Unknown search.fulltext option "${key}".`));
@@ -230,6 +234,30 @@ var collectionSchemaRule = {
230
234
  }
231
235
  }
232
236
  }
237
+ if (semantic !== void 0 && !isRecord2(semantic)) {
238
+ issues.push(error(target, '"search.semantic" must be an object when present.'));
239
+ } else if (isRecord2(semantic)) {
240
+ const allowed = /* @__PURE__ */ new Set(["fields", "model"]);
241
+ for (const key of Object.keys(semantic).filter((key2) => !allowed.has(key2))) {
242
+ issues.push(error(target, `Unknown search.semantic option "${key}".`));
243
+ }
244
+ if (!Array.isArray(semantic.fields) || semantic.fields.length === 0 || !semantic.fields.every((field) => typeof field === "string")) {
245
+ issues.push(error(target, '"search.semantic.fields" must be a non-empty array of field names.'));
246
+ } else {
247
+ if (semantic.fields.length > 8) {
248
+ issues.push(error(target, '"search.semantic.fields" cannot contain more than 8 fields.'));
249
+ }
250
+ for (const field of semantic.fields) {
251
+ const type = localFieldTypes.get(field);
252
+ if (type !== "text" && type !== "editor") {
253
+ issues.push(error(target, `Semantic search field "${field}" must name a text or editor field.`));
254
+ }
255
+ }
256
+ }
257
+ if (semantic.model !== void 0 && semantic.model !== "text-embedding-3-small") {
258
+ issues.push(error(target, '"search.semantic.model" must be "text-embedding-3-small".'));
259
+ }
260
+ }
233
261
  }
234
262
  }
235
263
  return issues;
@@ -1606,15 +1634,22 @@ function indexesDiffer(local, remoteIndexes) {
1606
1634
  }
1607
1635
  function normalizeCollectionSearch(search) {
1608
1636
  if (!search) return "null";
1609
- const fields = Object.fromEntries(
1610
- Object.entries(search.fulltext.fields).sort(([left], [right]) => left.localeCompare(right))
1611
- );
1612
1637
  return JSON.stringify({
1613
- fulltext: {
1614
- fields,
1615
- language: search.fulltext.language ?? "english",
1616
- fuzzy_fields: [...search.fulltext.fuzzy_fields ?? []].sort()
1617
- }
1638
+ ...search.fulltext ? {
1639
+ fulltext: {
1640
+ fields: Object.fromEntries(
1641
+ Object.entries(search.fulltext.fields).sort(([left], [right]) => left.localeCompare(right))
1642
+ ),
1643
+ language: search.fulltext.language ?? "english",
1644
+ fuzzy_fields: [...search.fulltext.fuzzy_fields ?? []].sort()
1645
+ }
1646
+ } : {},
1647
+ ...search.semantic ? {
1648
+ semantic: {
1649
+ fields: [...search.semantic.fields],
1650
+ model: search.semantic.model ?? "text-embedding-3-small"
1651
+ }
1652
+ } : {}
1618
1653
  });
1619
1654
  }
1620
1655
  async function planCollections(api, localCollections) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.22.3",
3
+ "version": "0.22.5",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,7 +24,7 @@
24
24
  "check:ci": "biome check . && tsr generate && tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@lumerahq/ui": "^0.11.2",
27
+ "@lumerahq/ui": "^0.12.0",
28
28
  "@tanstack/react-query": "^5.90.11",
29
29
  "@tanstack/react-router": "1.155.0",
30
30
  "clsx": "^2.1.1",