@mulmoclaude/core 3.4.0 → 3.5.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 (46) hide show
  1. package/dist/{calendarGrid-Csy2rpjp.js → calendarGrid-CQ8MVSRb.js} +141 -2
  2. package/dist/calendarGrid-CQ8MVSRb.js.map +1 -0
  3. package/dist/{calendarGrid-p8K-7cuB.cjs → calendarGrid-DGILaVxI.cjs} +194 -1
  4. package/dist/calendarGrid-DGILaVxI.cjs.map +1 -0
  5. package/dist/collection/core/collectionKey.d.ts +67 -0
  6. package/dist/collection/index.cjs +11 -2
  7. package/dist/collection/index.d.ts +1 -0
  8. package/dist/collection/index.js +3 -3
  9. package/dist/collection/registry/server/index.cjs +2 -2
  10. package/dist/collection/registry/server/index.js +2 -2
  11. package/dist/collection/server/host.d.ts +49 -8
  12. package/dist/collection/server/index.cjs +6 -3
  13. package/dist/collection/server/index.d.ts +1 -1
  14. package/dist/collection/server/index.js +4 -4
  15. package/dist/collection-watchers/index.cjs +33 -12
  16. package/dist/collection-watchers/index.cjs.map +1 -1
  17. package/dist/collection-watchers/index.js +33 -12
  18. package/dist/collection-watchers/index.js.map +1 -1
  19. package/dist/collection-watchers/reconciler.d.ts +35 -0
  20. package/dist/{discovery-CrA_EqUJ.cjs → discovery-Ck4AqikY.cjs} +63 -2
  21. package/dist/discovery-Ck4AqikY.cjs.map +1 -0
  22. package/dist/{discovery-D7LCN8gJ.js → discovery-DH9wweuj.js} +46 -3
  23. package/dist/discovery-DH9wweuj.js.map +1 -0
  24. package/dist/feeds/index.cjs +2 -2
  25. package/dist/feeds/index.js +2 -2
  26. package/dist/feeds/server/index.cjs +4 -4
  27. package/dist/feeds/server/index.js +4 -4
  28. package/dist/google/index.cjs +2 -2
  29. package/dist/google/index.js +2 -2
  30. package/dist/{ingestTypes-F2IJhOLJ.js → ingestTypes-CEi-Ot7F.js} +2 -2
  31. package/dist/{ingestTypes-F2IJhOLJ.js.map → ingestTypes-CEi-Ot7F.js.map} +1 -1
  32. package/dist/{ingestTypes-CPR-h-OZ.cjs → ingestTypes-iaiq33Ph.cjs} +2 -2
  33. package/dist/{ingestTypes-CPR-h-OZ.cjs.map → ingestTypes-iaiq33Ph.cjs.map} +1 -1
  34. package/dist/{promptSafety-ACXw_2Yu.js → promptSafety-CpiME8pj.js} +2 -2
  35. package/dist/{promptSafety-ACXw_2Yu.js.map → promptSafety-CpiME8pj.js.map} +1 -1
  36. package/dist/{promptSafety-CNEW3_qS.cjs → promptSafety-NNGViiCr.cjs} +2 -2
  37. package/dist/{promptSafety-CNEW3_qS.cjs.map → promptSafety-NNGViiCr.cjs.map} +1 -1
  38. package/dist/{server-CorfPQVQ.cjs → server-5EMj3naj.cjs} +4 -4
  39. package/dist/{server-CorfPQVQ.cjs.map → server-5EMj3naj.cjs.map} +1 -1
  40. package/dist/{server-D6QY853r.js → server-BiRLLMpW.js} +4 -4
  41. package/dist/{server-D6QY853r.js.map → server-BiRLLMpW.js.map} +1 -1
  42. package/package.json +1 -1
  43. package/dist/calendarGrid-Csy2rpjp.js.map +0 -1
  44. package/dist/calendarGrid-p8K-7cuB.cjs.map +0 -1
  45. package/dist/discovery-CrA_EqUJ.cjs.map +0 -1
  46. package/dist/discovery-D7LCN8gJ.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { a as isErrorWithCode, l as isUnknownArray, r as hasNumberProp, s as isRecord } from "./dist-D8zokgGo.js";
2
2
  import { n as writeFileAtomic, t as canonicalRoot } from "./root-BMroU_mB.js";
3
- import { A as fieldTextOrNull, C as FEED_SCHEDULES, D as isReadOnlySchema, O as storageKindFor, S as COMPUTED_TYPES, g as SAFE_SLUG_PATTERN, h as SAFE_RECORD_ID_PATTERN, k as fieldText, v as isSafeRecordId, w as INGEST_KINDS, x as AGENT_INGEST_KIND, y as isSafeSlug } from "./calendarGrid-Csy2rpjp.js";
3
+ import { A as AGENT_INGEST_KIND, C as sharedCollectionKey, D as isSafeRecordId, I as isReadOnlySchema, L as storageKindFor, M as FEED_SCHEDULES, N as INGEST_KINDS, O as isSafeSlug, R as fieldText, T as SAFE_SLUG_PATTERN, b as localCollectionKeyOf, j as COMPUTED_TYPES, w as SAFE_RECORD_ID_PATTERN, z as fieldTextOrNull } from "./calendarGrid-CQ8MVSRb.js";
4
4
  import { n as projectRecordFields } from "./project-B0j_Vf_Q.js";
5
5
  import { n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, t as isSafeActionTemplatePath } from "./templatePath-k_WNbL_Q.js";
6
6
  import { realpathSync, watch } from "node:fs";
@@ -48,6 +48,10 @@ function createForwardingLogger(getLogger) {
48
48
  * watcher is already running — and a host catching both in one place should
49
49
  * not have to match on message text to tell them apart. */
50
50
  var COLLECTION_ROOT_REQUIRED = "COLLECTION_ROOT_REQUIRED";
51
+ /** Build a local {@link CollectionKey}, canonicalising the root. The identity
52
+ * type itself is isomorphic and cannot canonicalise (that needs `node:path`),
53
+ * so this is the constructor server code should use. */
54
+ var localCollectionKey = (root, slug) => localCollectionKeyOf(canonicalRoot(root), slug);
51
55
  /** Build a change payload, attaching `root` only when the engine call carried
52
56
  * an explicit one. Centralised so every publish site states the root the same
53
57
  * way, and so a single-workspace host's payload shape stays byte-identical to
@@ -58,6 +62,45 @@ function collectionChangePayload(base, root) {
58
62
  root: canonicalRoot(root)
59
63
  };
60
64
  }
65
+ /** Build a change payload for a SHARED collection. `slug` carries the `cid`,
66
+ * which is what it is called inside its app; `aid` is what makes it an
67
+ * identity. Never stamps a `root` — a shared collection does not have one. */
68
+ function sharedCollectionChangePayload(base, aid) {
69
+ sharedCollectionKey(aid, base.slug);
70
+ return {
71
+ ...base,
72
+ aid
73
+ };
74
+ }
75
+ /** The identity a change is about, as a value — the thing to key a fan-out on.
76
+ *
77
+ * This is the one place that decides what an absent field means, so no host
78
+ * has to: `aid` present is a shared collection, otherwise it is local, and a
79
+ * local payload with no `root` means the host's configured root (which is why
80
+ * a single-workspace host's payloads still say nothing about roots).
81
+ *
82
+ * `fallbackRoot` is what a payload with no root resolves to. An explicit-root
83
+ * host has no such default and must not guess — pass the root the call was
84
+ * made for. */
85
+ /** Refuse a payload that names both an app and a root.
86
+ *
87
+ * The two arms are mutually exclusive in the TYPE, so this cannot come from
88
+ * the constructors -- it is corrupt input (a JS caller, a cast, something off
89
+ * a wire). Throwing rather than picking one: whichever way it were guessed,
90
+ * the update would be fanned out on a channel it does not belong to, and that
91
+ * is invisible where a throw is not.
92
+ *
93
+ * Takes the WIDENED shape deliberately. Written inline, TypeScript narrows the
94
+ * union to `never` inside the branch and the fields cannot be read at all --
95
+ * which is the type-level guarantee doing its job, and exactly why the runtime
96
+ * check has to be stated somewhere it can still see them. */
97
+ function requireOneScope(payload) {
98
+ if (payload.aid !== void 0 && payload.root !== void 0) throw new Error(`collectionChangeKey: payload for "${payload.slug}" carries both an app (${payload.aid}) and a root (${payload.root})`);
99
+ }
100
+ function collectionChangeKey(payload, fallbackRoot) {
101
+ requireOneScope(payload);
102
+ return payload.aid === void 0 ? localCollectionKey(payload.root ?? fallbackRoot, payload.slug) : sharedCollectionKey(payload.aid, payload.slug);
103
+ }
61
104
  var hostSlot = createHostSlot("@mulmoclaude/core/collection/server: configureCollectionHost()");
62
105
  var changePublisher = null;
63
106
  /** Wire the engine to a host. Call once at server startup, before any
@@ -2776,6 +2819,6 @@ function toDetail(collection) {
2776
2819
  };
2777
2820
  }
2778
2821
  //#endregion
2779
- export { projectSkillsDir as $, deleteItem as A, resolveDataDir as B, compileCsvQuery as C, MAX_QUERY_ROWS as D, DEFAULT_QUERY_ROWS as E, resolveCreateItemId as F, archiveDir as G, safeRecordId as H, writeItem as I, configureCollectionHost as J, collectionChangePayload as K, SCHEMA_FILE as L, isRegularFile as M, listItems as N, BackendUnavailableError as O, readItem as P, peekWorkspaceRoot as Q, isContainedInRoot as R, queryCsv as S, CollectionQueryZ as T, safeSlugName as U, resolveTemplatePath as V, COLLECTION_ROOT_REQUIRED as W, isPresetSlug as X, getWorkspaceRoot as Y, log as Z, csvRowToItem as _, toDetail as a, createHostSlot as at, encodeCsvRecordId as b, resolveMutateSet as c, storeFor as d, publishCollectionChange as et, checkpointSqliteDatabase as f, cacheDir as g, MAX_CSV_ROWS as h, resolvePrimaryField as i, createForwardingLogger as it, generateItemId as j, isBackendUnavailable as k, collectionWritable as l, projectItemFields as m, discoverCollections as n, skillsStagingDir as nt, toSummary as o, pageFromFullRead as p, collectionsRegistriesConfigPath as q, loadCollection as r, stagingSkillDir as rt, CollectionSchemaZ as s, acceptParsedSchema as t, setCollectionChangePublisher as tt, readOnlyRefusal as u, decodeCsvRecordId as v, compileJsonlQuery as w, normalizeCsvValue as x, dedupeByRecordId as y, itemFilePath as z };
2822
+ export { log as $, deleteItem as A, resolveDataDir as B, compileCsvQuery as C, MAX_QUERY_ROWS as D, DEFAULT_QUERY_ROWS as E, resolveCreateItemId as F, archiveDir as G, safeRecordId as H, writeItem as I, collectionsRegistriesConfigPath as J, collectionChangeKey as K, SCHEMA_FILE as L, isRegularFile as M, listItems as N, BackendUnavailableError as O, readItem as P, localCollectionKey as Q, isContainedInRoot as R, queryCsv as S, CollectionQueryZ as T, safeSlugName as U, resolveTemplatePath as V, COLLECTION_ROOT_REQUIRED as W, getWorkspaceRoot as X, configureCollectionHost as Y, isPresetSlug as Z, csvRowToItem as _, toDetail as a, skillsStagingDir as at, encodeCsvRecordId as b, resolveMutateSet as c, createHostSlot as ct, storeFor as d, peekWorkspaceRoot as et, checkpointSqliteDatabase as f, cacheDir as g, MAX_CSV_ROWS as h, resolvePrimaryField as i, sharedCollectionChangePayload as it, generateItemId as j, isBackendUnavailable as k, collectionWritable as l, projectItemFields as m, discoverCollections as n, publishCollectionChange as nt, toSummary as o, stagingSkillDir as ot, pageFromFullRead as p, collectionChangePayload as q, loadCollection as r, setCollectionChangePublisher as rt, CollectionSchemaZ as s, createForwardingLogger as st, acceptParsedSchema as t, projectSkillsDir as tt, readOnlyRefusal as u, decodeCsvRecordId as v, compileJsonlQuery as w, normalizeCsvValue as x, dedupeByRecordId as y, itemFilePath as z };
2780
2823
 
2781
- //# sourceMappingURL=discovery-D7LCN8gJ.js.map
2824
+ //# sourceMappingURL=discovery-DH9wweuj.js.map