@mulmoclaude/core 0.26.0 → 0.28.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.
Files changed (92) hide show
  1. package/assets/helps/error-recovery.md +55 -0
  2. package/assets/helps/wiki.md +47 -2
  3. package/dist/collection/core/errorMessage.d.ts +1 -4
  4. package/dist/collection/core/ontologyGraph.d.ts +58 -0
  5. package/dist/collection/core/uiTypes.d.ts +7 -0
  6. package/dist/collection/index.cjs +84 -13
  7. package/dist/collection/index.cjs.map +1 -1
  8. package/dist/collection/index.d.ts +1 -0
  9. package/dist/collection/index.js +77 -7
  10. package/dist/collection/index.js.map +1 -1
  11. package/dist/collection/registry/server/index.cjs +8 -7
  12. package/dist/collection/registry/server/index.cjs.map +1 -1
  13. package/dist/collection/registry/server/index.js +3 -2
  14. package/dist/collection/registry/server/index.js.map +1 -1
  15. package/dist/collection/server/csvStore.d.ts +0 -5
  16. package/dist/collection/server/index.cjs +3 -3
  17. package/dist/collection/server/index.js +3 -3
  18. package/dist/collection/server/ontology.d.ts +2 -24
  19. package/dist/collection/server/util.d.ts +1 -2
  20. package/dist/collection-watchers/index.cjs +5 -4
  21. package/dist/collection-watchers/index.cjs.map +1 -1
  22. package/dist/collection-watchers/index.js +4 -3
  23. package/dist/collection-watchers/index.js.map +1 -1
  24. package/dist/{discovery-cwtfyDxl.cjs → discovery-BKovdRpZ.cjs} +20 -8
  25. package/dist/discovery-BKovdRpZ.cjs.map +1 -0
  26. package/dist/{discovery-QUi_7aNG.js → discovery-BVdCgBFN.js} +20 -8
  27. package/dist/discovery-BVdCgBFN.js.map +1 -0
  28. package/dist/errors-7P5eMOSX.cjs +30 -0
  29. package/dist/errors-7P5eMOSX.cjs.map +1 -0
  30. package/dist/errors-eid6Mes3.js +19 -0
  31. package/dist/errors-eid6Mes3.js.map +1 -0
  32. package/dist/feeds/index.cjs +2 -2
  33. package/dist/feeds/index.js +2 -2
  34. package/dist/feeds/server/index.cjs +4 -4
  35. package/dist/feeds/server/index.js +4 -4
  36. package/dist/google/index.cjs +8 -18
  37. package/dist/google/index.cjs.map +1 -1
  38. package/dist/google/index.js +3 -13
  39. package/dist/google/index.js.map +1 -1
  40. package/dist/google/util.d.ts +2 -4
  41. package/dist/{ids-P2T89Gou.js → ids-D1M1T6KJ.js} +26 -3
  42. package/dist/ids-D1M1T6KJ.js.map +1 -0
  43. package/dist/{ids-Dl9Ij63K.cjs → ids-DWmHjm17.cjs} +37 -2
  44. package/dist/ids-DWmHjm17.cjs.map +1 -0
  45. package/dist/{ingestTypes-C-IQB4nw.js → ingestTypes-Ci4eOgv-.js} +2 -2
  46. package/dist/{ingestTypes-C-IQB4nw.js.map → ingestTypes-Ci4eOgv-.js.map} +1 -1
  47. package/dist/{ingestTypes-DZpAC3N_.cjs → ingestTypes-DbuQNuK6.cjs} +2 -2
  48. package/dist/{ingestTypes-DZpAC3N_.cjs.map → ingestTypes-DbuQNuK6.cjs.map} +1 -1
  49. package/dist/{promptSafety-BOc1B3im.cjs → promptSafety-BFt2g_wn.cjs} +6 -40
  50. package/dist/promptSafety-BFt2g_wn.cjs.map +1 -0
  51. package/dist/{promptSafety-B5KPkaNY.js → promptSafety-cZIeiZtB.js} +4 -26
  52. package/dist/promptSafety-cZIeiZtB.js.map +1 -0
  53. package/dist/remote-host/server/index.cjs +4 -4
  54. package/dist/remote-host/server/index.cjs.map +1 -1
  55. package/dist/remote-host/server/index.js +1 -1
  56. package/dist/scheduler/index.cjs +2 -4
  57. package/dist/scheduler/index.cjs.map +1 -1
  58. package/dist/scheduler/index.js +1 -3
  59. package/dist/scheduler/index.js.map +1 -1
  60. package/dist/{server-CNLZZONa.js → server-B8mvfZSF.js} +28 -18
  61. package/dist/server-B8mvfZSF.js.map +1 -0
  62. package/dist/{server-B7mtx4Cd.cjs → server-rRQkNBvO.cjs} +28 -24
  63. package/dist/server-rRQkNBvO.cjs.map +1 -0
  64. package/dist/text-CaAh9ZSO.cjs +27 -0
  65. package/dist/text-CaAh9ZSO.cjs.map +1 -0
  66. package/dist/text-CjDbP2O1.js +22 -0
  67. package/dist/text-CjDbP2O1.js.map +1 -0
  68. package/dist/utils/errors.d.ts +2 -0
  69. package/dist/utils/index.cjs +6 -0
  70. package/dist/utils/index.d.ts +2 -0
  71. package/dist/utils/index.js +3 -0
  72. package/dist/utils/text.d.ts +12 -0
  73. package/dist/whisper/index.cjs +7 -9
  74. package/dist/whisper/index.cjs.map +1 -1
  75. package/dist/whisper/index.js +1 -3
  76. package/dist/whisper/index.js.map +1 -1
  77. package/dist/whisper/internal.d.ts +1 -1
  78. package/dist/workspace-setup/index.js +12 -3
  79. package/dist/workspace-setup/index.js.map +1 -1
  80. package/package.json +7 -1
  81. package/dist/discovery-QUi_7aNG.js.map +0 -1
  82. package/dist/discovery-cwtfyDxl.cjs.map +0 -1
  83. package/dist/errorMessage--LvXe_Jx.cjs +0 -16
  84. package/dist/errorMessage--LvXe_Jx.cjs.map +0 -1
  85. package/dist/errorMessage-DIdhheHk.js +0 -11
  86. package/dist/errorMessage-DIdhheHk.js.map +0 -1
  87. package/dist/ids-Dl9Ij63K.cjs.map +0 -1
  88. package/dist/ids-P2T89Gou.js.map +0 -1
  89. package/dist/promptSafety-B5KPkaNY.js.map +0 -1
  90. package/dist/promptSafety-BOc1B3im.cjs.map +0 -1
  91. package/dist/server-B7mtx4Cd.cjs.map +0 -1
  92. package/dist/server-CNLZZONa.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
2
- const require_ids = require("./ids-Dl9Ij63K.cjs");
2
+ const require_ids = require("./ids-DWmHjm17.cjs");
3
3
  const require_project = require("./project-BWI5w_BT.cjs");
4
4
  const require_templatePath = require("./templatePath-27vUZowm.cjs");
5
5
  let node_path = require("node:path");
@@ -861,13 +861,23 @@ function decodeCsvRecordId(itemId) {
861
861
  * (date-only when the clock is exactly UTC midnight, matching the `date`
862
862
  * field contract), exotic DuckDB values → their string form. Pure +
863
863
  * exported for unit tests. */
864
+ /** `JSON.stringify` restricted to what a CSV cell can survive. Returns the
865
+ * serialised value, or `String(value)` when serialisation is impossible —
866
+ * losing the content of one cell is bad, failing the entire query is worse. */
867
+ function safeJsonCell(value) {
868
+ try {
869
+ return JSON.stringify(value, (_key, entry) => typeof entry === "bigint" ? entry.toString() : entry) ?? String(value);
870
+ } catch {
871
+ return String(value);
872
+ }
873
+ }
864
874
  function normalizeCsvValue(value) {
865
875
  if (typeof value === "bigint") return value <= BigInt(Number.MAX_SAFE_INTEGER) && value >= BigInt(-Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString();
866
876
  if (value instanceof Date) {
867
877
  const iso = value.toISOString();
868
878
  return iso.endsWith("T00:00:00.000Z") ? iso.slice(0, 10) : iso;
869
879
  }
870
- if (value !== null && typeof value === "object") return String(value);
880
+ if (value !== null && typeof value === "object") return safeJsonCell(value);
871
881
  return value;
872
882
  }
873
883
  /** One raw DuckDB row → a CollectionItem, or null when the key cell is
@@ -878,10 +888,11 @@ function normalizeCsvValue(value) {
878
888
  function csvRowToItem(row, primaryKey) {
879
889
  const normalized = Object.fromEntries(Object.entries(row).map(([key, value]) => [key, normalizeCsvValue(value)]));
880
890
  const rawKey = normalized[primaryKey];
881
- if (rawKey === null || rawKey === void 0 || String(rawKey) === "") return null;
891
+ const keyText = require_ids.fieldTextOrNull(rawKey);
892
+ if (keyText === null || keyText === "") return null;
882
893
  return {
883
894
  ...normalized,
884
- [primaryKey]: encodeCsvRecordId(String(rawKey))
895
+ [primaryKey]: encodeCsvRecordId(keyText)
885
896
  };
886
897
  }
887
898
  /** Dedupe by record id, LAST row wins (matches `csvRead`'s last-match
@@ -1398,8 +1409,8 @@ function sqliteStoreFor(collection, opts) {
1398
1409
  * is filesystem-dependent; paging needs determinism. */
1399
1410
  function sortByRecordId(items, primaryKey) {
1400
1411
  return [...items].sort((left, right) => {
1401
- const leftId = String(left[primaryKey] ?? "");
1402
- const rightId = String(right[primaryKey] ?? "");
1412
+ const leftId = require_ids.fieldText(left[primaryKey]);
1413
+ const rightId = require_ids.fieldText(right[primaryKey]);
1403
1414
  if (leftId < rightId) return -1;
1404
1415
  return leftId > rightId ? 1 : 0;
1405
1416
  });
@@ -2034,7 +2045,8 @@ function fieldDrivenFromFieldCarried(schema) {
2034
2045
  if (set && Object.prototype.hasOwnProperty.call(set, driven.fromField)) {
2035
2046
  const raw = set[driven.fromField];
2036
2047
  if (raw === void 0 || raw === null || raw === "") return false;
2037
- return Object.prototype.hasOwnProperty.call(driven.map, String(raw));
2048
+ const key = require_ids.fieldTextOrNull(raw);
2049
+ return key !== null && Object.prototype.hasOwnProperty.call(driven.map, key);
2038
2050
  }
2039
2051
  return (carry ?? []).includes(driven.fromField);
2040
2052
  }
@@ -2852,4 +2864,4 @@ Object.defineProperty(exports, "writeItem", {
2852
2864
  }
2853
2865
  });
2854
2866
 
2855
- //# sourceMappingURL=discovery-cwtfyDxl.cjs.map
2867
+ //# sourceMappingURL=discovery-BKovdRpZ.cjs.map