@mulmoclaude/core 3.2.0 → 3.4.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 (34) hide show
  1. package/assets/helps/error-recovery.md +71 -0
  2. package/assets/helps/google-calendar-collection.md +10 -0
  3. package/dist/collection/registry/server/index.cjs +3 -3
  4. package/dist/collection/registry/server/index.cjs.map +1 -1
  5. package/dist/collection/registry/server/index.js +3 -3
  6. package/dist/collection/registry/server/index.js.map +1 -1
  7. package/dist/collection/server/discovery.d.ts +10 -2
  8. package/dist/collection/server/host.d.ts +27 -3
  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 +2 -2
  12. package/dist/collection-watchers/index.js +2 -2
  13. package/dist/{discovery-CDOjfctD.cjs → discovery-CrA_EqUJ.cjs} +19 -7
  14. package/dist/discovery-CrA_EqUJ.cjs.map +1 -0
  15. package/dist/{discovery-CC7kuwHf.js → discovery-D7LCN8gJ.js} +19 -7
  16. package/dist/discovery-D7LCN8gJ.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/calendar.d.ts +15 -0
  20. package/dist/google/calendarBackfillState.d.ts +19 -0
  21. package/dist/google/calendarSyncStore.d.ts +15 -0
  22. package/dist/google/collectionSync.d.ts +78 -11
  23. package/dist/google/index.cjs +207 -35
  24. package/dist/google/index.cjs.map +1 -1
  25. package/dist/google/index.d.ts +4 -3
  26. package/dist/google/index.js +197 -35
  27. package/dist/google/index.js.map +1 -1
  28. package/dist/{server-WU35UYlF.cjs → server-CorfPQVQ.cjs} +2 -2
  29. package/dist/{server-WU35UYlF.cjs.map → server-CorfPQVQ.cjs.map} +1 -1
  30. package/dist/{server-AA2kfDfk.js → server-D6QY853r.js} +2 -2
  31. package/dist/{server-AA2kfDfk.js.map → server-D6QY853r.js.map} +1 -1
  32. package/package.json +1 -1
  33. package/dist/discovery-CC7kuwHf.js.map +0 -1
  34. package/dist/discovery-CDOjfctD.cjs.map +0 -1
@@ -107,8 +107,12 @@ function getWorkspaceRoot() {
107
107
  function peekWorkspaceRoot() {
108
108
  return hostSlot.peek()?.workspaceRoot ?? null;
109
109
  }
110
- function userSkillsDir() {
111
- return requireHost().paths.userSkillsDir;
110
+ /** The user-scope skills dir for a root, or `null` when it has none. The one
111
+ * place the pre-3.3.0 `string` binding is normalized, so nothing downstream
112
+ * has to know the host might not have upgraded its shape yet. */
113
+ function userSkillsDir(workspaceRoot) {
114
+ const binding = requireHost().paths.userSkillsDir;
115
+ return typeof binding === "string" ? binding : binding(workspaceRoot);
112
116
  }
113
117
  function projectSkillsDir(workspaceRoot) {
114
118
  return requireHost().paths.projectSkillsDir(workspaceRoot);
@@ -2718,6 +2722,14 @@ async function collectFromDir(skillsRoot, source, workspaceRoot) {
2718
2722
  }
2719
2723
  return results;
2720
2724
  }
2725
+ /** The user-scope dir this call should scan, or `null` for none. The single
2726
+ * place the "explicit override beats the host binding, and either may say
2727
+ * none" rule is spelled — `??` cannot express it, because `undefined` there
2728
+ * means "ask the host" and would silently re-enable a scope the caller
2729
+ * passed `null` to switch off. */
2730
+ function resolveUserDir(opts, workspaceRoot) {
2731
+ return opts.userSkillsDir !== void 0 ? opts.userSkillsDir : userSkillsDir(workspaceRoot);
2732
+ }
2721
2733
  /** Discover every schema-driven collection available to this
2722
2734
  * workspace. Project-scope collections override user-scope on slug
2723
2735
  * collision. The `workspaceRoot` override also flows into each
@@ -2727,10 +2739,10 @@ async function collectFromDir(skillsRoot, source, workspaceRoot) {
2727
2739
  * regardless of override). */
2728
2740
  async function discoverCollections(opts = {}) {
2729
2741
  const workspaceRoot = opts.workspaceRoot ?? getWorkspaceRoot();
2730
- const userDir = opts.userSkillsDir ?? userSkillsDir();
2742
+ const userDir = resolveUserDir(opts, workspaceRoot);
2731
2743
  const projectDir = projectSkillsDir(workspaceRoot);
2732
2744
  const feedCollections = await collectFromDir(feedsRoot(workspaceRoot), "feed", workspaceRoot);
2733
- const userCollections = await collectFromDir(userDir, "user", workspaceRoot);
2745
+ const userCollections = userDir === null ? [] : await collectFromDir(userDir, "user", workspaceRoot);
2734
2746
  const projectCollections = await collectFromDir(projectDir, "project", workspaceRoot);
2735
2747
  const merged = /* @__PURE__ */ new Map();
2736
2748
  for (const entry of feedCollections) merged.set(entry.slug, entry);
@@ -2744,10 +2756,10 @@ async function loadCollection(slug, opts = {}) {
2744
2756
  const safeName = safeSlugName(slug);
2745
2757
  if (safeName === null) return null;
2746
2758
  const workspaceRoot = opts.workspaceRoot ?? getWorkspaceRoot();
2747
- const userDir = opts.userSkillsDir ?? userSkillsDir();
2759
+ const userDir = resolveUserDir(opts, workspaceRoot);
2748
2760
  const projectCollection = await loadOneCollection(projectSkillsDir(workspaceRoot), safeName, "project", workspaceRoot);
2749
2761
  if (projectCollection) return projectCollection;
2750
- const userCollection = await loadOneCollection(userDir, safeName, "user", workspaceRoot);
2762
+ const userCollection = userDir === null ? null : await loadOneCollection(userDir, safeName, "user", workspaceRoot);
2751
2763
  if (userCollection) return userCollection;
2752
2764
  return loadOneCollection(feedsRoot(workspaceRoot), safeName, "feed", workspaceRoot);
2753
2765
  }
@@ -3122,4 +3134,4 @@ Object.defineProperty(exports, "writeItem", {
3122
3134
  }
3123
3135
  });
3124
3136
 
3125
- //# sourceMappingURL=discovery-CDOjfctD.cjs.map
3137
+ //# sourceMappingURL=discovery-CrA_EqUJ.cjs.map