@mulmoclaude/core 0.27.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 (35) hide show
  1. package/assets/helps/wiki.md +47 -2
  2. package/dist/collection/index.cjs +4 -4
  3. package/dist/collection/index.cjs.map +1 -1
  4. package/dist/collection/index.js +4 -4
  5. package/dist/collection/index.js.map +1 -1
  6. package/dist/collection/registry/server/index.cjs +2 -2
  7. package/dist/collection/registry/server/index.js +2 -2
  8. package/dist/collection/server/csvStore.d.ts +0 -5
  9. package/dist/collection/server/index.cjs +2 -2
  10. package/dist/collection/server/index.js +2 -2
  11. package/dist/collection-watchers/index.cjs +3 -3
  12. package/dist/collection-watchers/index.js +3 -3
  13. package/dist/{discovery-BxbJy2VN.cjs → discovery-BKovdRpZ.cjs} +19 -7
  14. package/dist/discovery-BKovdRpZ.cjs.map +1 -0
  15. package/dist/{discovery-B9Vfojyy.js → discovery-BVdCgBFN.js} +20 -8
  16. package/dist/discovery-BVdCgBFN.js.map +1 -0
  17. package/dist/feeds/server/index.cjs +2 -2
  18. package/dist/feeds/server/index.js +2 -2
  19. package/dist/google/index.cjs +1 -1
  20. package/dist/google/index.js +1 -1
  21. package/dist/{promptSafety-0ZKHX-6J.cjs → promptSafety-BFt2g_wn.cjs} +2 -2
  22. package/dist/promptSafety-BFt2g_wn.cjs.map +1 -0
  23. package/dist/{promptSafety-RE1SPxBN.js → promptSafety-cZIeiZtB.js} +3 -3
  24. package/dist/promptSafety-cZIeiZtB.js.map +1 -0
  25. package/dist/{server-sGNe-msA.js → server-B8mvfZSF.js} +23 -11
  26. package/dist/server-B8mvfZSF.js.map +1 -0
  27. package/dist/{server-DOGKfUuD.cjs → server-rRQkNBvO.cjs} +22 -10
  28. package/dist/server-rRQkNBvO.cjs.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/discovery-B9Vfojyy.js.map +0 -1
  31. package/dist/discovery-BxbJy2VN.cjs.map +0 -1
  32. package/dist/promptSafety-0ZKHX-6J.cjs.map +0 -1
  33. package/dist/promptSafety-RE1SPxBN.js.map +0 -1
  34. package/dist/server-DOGKfUuD.cjs.map +0 -1
  35. package/dist/server-sGNe-msA.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { a as AGENT_INGEST_KIND, c as INGEST_KINDS, d as isReadOnlySchema, f as storageKindFor, i as isSafeSlug, n as SAFE_SLUG_PATTERN, o as COMPUTED_TYPES, r as isSafeRecordId, s as FEED_SCHEDULES, t as SAFE_RECORD_ID_PATTERN } from "./ids-D1M1T6KJ.js";
1
+ import { a as AGENT_INGEST_KIND, c as INGEST_KINDS, d as isReadOnlySchema, f as storageKindFor, i as isSafeSlug, m as fieldTextOrNull, n as SAFE_SLUG_PATTERN, o as COMPUTED_TYPES, p as fieldText, r as isSafeRecordId, s as FEED_SCHEDULES, t as SAFE_RECORD_ID_PATTERN } from "./ids-D1M1T6KJ.js";
2
2
  import { t as projectRecordFields } from "./project-bU98ycsy.js";
3
3
  import { n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, t as isSafeActionTemplatePath } from "./templatePath-k_WNbL_Q.js";
4
4
  import path from "node:path";
@@ -858,13 +858,23 @@ function decodeCsvRecordId(itemId) {
858
858
  * (date-only when the clock is exactly UTC midnight, matching the `date`
859
859
  * field contract), exotic DuckDB values → their string form. Pure +
860
860
  * exported for unit tests. */
861
+ /** `JSON.stringify` restricted to what a CSV cell can survive. Returns the
862
+ * serialised value, or `String(value)` when serialisation is impossible —
863
+ * losing the content of one cell is bad, failing the entire query is worse. */
864
+ function safeJsonCell(value) {
865
+ try {
866
+ return JSON.stringify(value, (_key, entry) => typeof entry === "bigint" ? entry.toString() : entry) ?? String(value);
867
+ } catch {
868
+ return String(value);
869
+ }
870
+ }
861
871
  function normalizeCsvValue(value) {
862
872
  if (typeof value === "bigint") return value <= BigInt(Number.MAX_SAFE_INTEGER) && value >= BigInt(-Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString();
863
873
  if (value instanceof Date) {
864
874
  const iso = value.toISOString();
865
875
  return iso.endsWith("T00:00:00.000Z") ? iso.slice(0, 10) : iso;
866
876
  }
867
- if (value !== null && typeof value === "object") return String(value);
877
+ if (value !== null && typeof value === "object") return safeJsonCell(value);
868
878
  return value;
869
879
  }
870
880
  /** One raw DuckDB row → a CollectionItem, or null when the key cell is
@@ -875,10 +885,11 @@ function normalizeCsvValue(value) {
875
885
  function csvRowToItem(row, primaryKey) {
876
886
  const normalized = Object.fromEntries(Object.entries(row).map(([key, value]) => [key, normalizeCsvValue(value)]));
877
887
  const rawKey = normalized[primaryKey];
878
- if (rawKey === null || rawKey === void 0 || String(rawKey) === "") return null;
888
+ const keyText = fieldTextOrNull(rawKey);
889
+ if (keyText === null || keyText === "") return null;
879
890
  return {
880
891
  ...normalized,
881
- [primaryKey]: encodeCsvRecordId(String(rawKey))
892
+ [primaryKey]: encodeCsvRecordId(keyText)
882
893
  };
883
894
  }
884
895
  /** Dedupe by record id, LAST row wins (matches `csvRead`'s last-match
@@ -1395,8 +1406,8 @@ function sqliteStoreFor(collection, opts) {
1395
1406
  * is filesystem-dependent; paging needs determinism. */
1396
1407
  function sortByRecordId(items, primaryKey) {
1397
1408
  return [...items].sort((left, right) => {
1398
- const leftId = String(left[primaryKey] ?? "");
1399
- const rightId = String(right[primaryKey] ?? "");
1409
+ const leftId = fieldText(left[primaryKey]);
1410
+ const rightId = fieldText(right[primaryKey]);
1400
1411
  if (leftId < rightId) return -1;
1401
1412
  return leftId > rightId ? 1 : 0;
1402
1413
  });
@@ -2031,7 +2042,8 @@ function fieldDrivenFromFieldCarried(schema) {
2031
2042
  if (set && Object.prototype.hasOwnProperty.call(set, driven.fromField)) {
2032
2043
  const raw = set[driven.fromField];
2033
2044
  if (raw === void 0 || raw === null || raw === "") return false;
2034
- return Object.prototype.hasOwnProperty.call(driven.map, String(raw));
2045
+ const key = fieldTextOrNull(raw);
2046
+ return key !== null && Object.prototype.hasOwnProperty.call(driven.map, key);
2035
2047
  }
2036
2048
  return (carry ?? []).includes(driven.fromField);
2037
2049
  }
@@ -2508,4 +2520,4 @@ function toDetail(collection) {
2508
2520
  //#endregion
2509
2521
  export { isPresetSlug as $, generateItemId as A, writeFileAtomic as B, compileJsonlQuery as C, buildActionSeedPrompt as D, MAX_QUERY_ROWS as E, readCustomViewI18n as F, resolveDataDir as G, isContainedInRoot as H, readItem as I, safeSlugName as J, resolveTemplatePath as K, readSkillTemplate as L, listItems as M, promptPathsFor as N, buildCollectionActionSeedPrompt as O, readCustomViewHtml as P, getWorkspaceRoot as Q, resolveCreateItemId as R, compileCsvQuery as S, DEFAULT_QUERY_ROWS as T, isContainedInWorkspace as U, SCHEMA_FILE as V, itemFilePath as W, collectionsRegistriesConfigPath as X, archiveDir as Y, configureCollectionHost as Z, decodeCsvRecordId as _, toSummary as a, normalizeCsvValue as b, collectionWritable as c, checkpointSqliteDatabase as d, log as et, pageFromFullRead as f, csvRowToItem as g, cacheDir as h, toDetail as i, isRegularFile as j, deleteItem as k, readOnlyRefusal as l, MAX_CSV_ROWS as m, discoverCollections as n, setCollectionChangePublisher as nt, CollectionSchemaZ as o, projectItemFields as p, safeRecordId as q, loadCollection as r, skillsStagingDir as rt, resolveMutateSet as s, acceptParsedSchema as t, publishCollectionChange as tt, storeFor as u, dedupeByRecordId as v, CollectionQueryZ as w, queryCsv as x, encodeCsvRecordId as y, writeItem as z };
2510
2522
 
2511
- //# sourceMappingURL=discovery-B9Vfojyy.js.map
2523
+ //# sourceMappingURL=discovery-BVdCgBFN.js.map