@mulmoclaude/core 0.2.6 → 0.2.7

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.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_server = require("../../server-D27UzXug.cjs");
2
+ const require_server = require("../../server-Db-x7OXz.cjs");
3
3
  const require_collection_paths = require("../paths.cjs");
4
4
  exports.COMPUTED_TYPES = require_server.COMPUTED_TYPES;
5
5
  exports.CollectionSchemaZ = require_server.CollectionSchemaZ;
@@ -1,3 +1,3 @@
1
- import { A as readSkillTemplate, B as safeSlugName, C as buildActionSeedPrompt, D as listItems, E as generateItemId, F as isContainedInWorkspace, G as setCollectionChangePublisher, H as getWorkspaceRoot, I as itemFilePath, L as resolveDataDir, M as writeItem, N as SCHEMA_FILE, O as readCustomViewHtml, P as isContainedInRoot, R as resolveTemplatePath, S as validateRecordObject, T as deleteItem, U as log, V as configureCollectionHost, W as publishCollectionChange, _ as loadCollection, a as computeSuccessor, b as COMPUTED_TYPES, c as isTriggerDue, d as resolveEvery, f as successorId, g as discoverCollections, h as acceptParsedSchema, i as advanceTriggerDate, j as resolveCreateItemId, k as readItem, l as maybeSpawnSuccessor, m as CollectionSchemaZ, n as deleteCollection, o as daysInMonth, p as enrichItems, r as deleteCollectionRefusalMessage, s as formatCivil, t as deleteCustomView, u as parseCivil, v as toDetail, w as buildCollectionActionSeedPrompt, x as validateCollectionRecords, y as toSummary, z as safeRecordId } from "../../server-B2YkcCwl.js";
1
+ import { A as readSkillTemplate, B as safeSlugName, C as buildActionSeedPrompt, D as listItems, E as generateItemId, F as isContainedInWorkspace, G as setCollectionChangePublisher, H as getWorkspaceRoot, I as itemFilePath, L as resolveDataDir, M as writeItem, N as SCHEMA_FILE, O as readCustomViewHtml, P as isContainedInRoot, R as resolveTemplatePath, S as validateRecordObject, T as deleteItem, U as log, V as configureCollectionHost, W as publishCollectionChange, _ as loadCollection, a as computeSuccessor, b as COMPUTED_TYPES, c as isTriggerDue, d as resolveEvery, f as successorId, g as discoverCollections, h as acceptParsedSchema, i as advanceTriggerDate, j as resolveCreateItemId, k as readItem, l as maybeSpawnSuccessor, m as CollectionSchemaZ, n as deleteCollection, o as daysInMonth, p as enrichItems, r as deleteCollectionRefusalMessage, s as formatCivil, t as deleteCustomView, u as parseCivil, v as toDetail, w as buildCollectionActionSeedPrompt, x as validateCollectionRecords, y as toSummary, z as safeRecordId } from "../../server-q4WPXtbU.js";
2
2
  import { isSafeActionTemplatePath, isSafeCustomViewPath, isSafeTemplatePath } from "../paths.js";
3
3
  export { COMPUTED_TYPES, CollectionSchemaZ, SCHEMA_FILE, acceptParsedSchema, advanceTriggerDate, buildActionSeedPrompt, buildCollectionActionSeedPrompt, computeSuccessor, configureCollectionHost, daysInMonth, deleteCollection, deleteCollectionRefusalMessage, deleteCustomView, deleteItem, discoverCollections, enrichItems, formatCivil, generateItemId, getWorkspaceRoot, isContainedInRoot, isContainedInWorkspace, isSafeActionTemplatePath, isSafeCustomViewPath, isSafeTemplatePath, isTriggerDue, itemFilePath, listItems, loadCollection, log, maybeSpawnSuccessor, parseCivil, publishCollectionChange, readCustomViewHtml, readItem, readSkillTemplate, resolveCreateItemId, resolveDataDir, resolveEvery, resolveTemplatePath, safeRecordId, safeSlugName, setCollectionChangePublisher, successorId, toDetail, toSummary, validateCollectionRecords, validateRecordObject, writeItem };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_collection_index = require("../collection/index.cjs");
3
- const require_server = require("../server-D27UzXug.cjs");
3
+ const require_server = require("../server-Db-x7OXz.cjs");
4
4
  const require_notifier = require("../notifier-bS8IEeLA.cjs");
5
5
  let node_fs = require("node:fs");
6
6
  let node_fs_promises = require("node:fs/promises");
@@ -1,5 +1,5 @@
1
1
  import { whenMatches } from "../collection/index.js";
2
- import { D as listItems, _ as loadCollection, c as isTriggerDue, g as discoverCollections, k as readItem, l as maybeSpawnSuccessor } from "../server-B2YkcCwl.js";
2
+ import { D as listItems, _ as loadCollection, c as isTriggerDue, g as discoverCollections, k as readItem, l as maybeSpawnSuccessor } from "../server-q4WPXtbU.js";
3
3
  import { d as publish, m as updateForPlugin, n as clear, s as listAll } from "../notifier-ChpY0XrY.js";
4
4
  import { watch } from "node:fs";
5
5
  import { mkdir } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../../rolldown-runtime-D6vf50IK.cjs");
3
3
  const require_deriveAll = require("../../deriveAll-VRWrs3SF.cjs");
4
- const require_server = require("../../server-D27UzXug.cjs");
4
+ const require_server = require("../../server-Db-x7OXz.cjs");
5
5
  const require_ingestTypes = require("../../ingestTypes-DDOVhOYC.cjs");
6
6
  const require_feeds_paths = require("../paths.cjs");
7
7
  const require_notifier = require("../../notifier-bS8IEeLA.cjs");
@@ -1,5 +1,5 @@
1
1
  import { a as FEED_SCHEDULES, o as INGEST_KINDS } from "../../deriveAll-vzIhhKBK.js";
2
- import { A as readSkillTemplate, B as safeSlugName, D as listItems, L as resolveDataDir, M as writeItem, T as deleteItem, g as discoverCollections, w as buildCollectionActionSeedPrompt } from "../../server-B2YkcCwl.js";
2
+ import { A as readSkillTemplate, B as safeSlugName, D as listItems, L as resolveDataDir, M as writeItem, T as deleteItem, g as discoverCollections, w as buildCollectionActionSeedPrompt } from "../../server-q4WPXtbU.js";
3
3
  import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-B8DaQOTy.js";
4
4
  import { FEEDS_DIR, feedDir, feedStatePath, feedsRoot, ingestStateDir, ingestStatePath } from "../paths.js";
5
5
  import { d as publish, n as clear } from "../../notifier-ChpY0XrY.js";
@@ -1503,21 +1503,29 @@ function deleteTargets(collection, workspaceRoot) {
1503
1503
  ];
1504
1504
  }
1505
1505
  /** The records directory the delete recursively archives + removes
1506
- * (`collection.dataDir`) must live in this collection's OWN
1507
- * `data/<slug>/` subtree. `dataDir` is normally derived from
1508
- * `schema.dataPath`, but `deleteCollection` accepts a `LoadedCollection`
1509
- * whose fields could be inconsistent — so we validate the RESOLVED
1510
- * target the destructive ops actually touch, not the schema string.
1511
- * `resolveDataDir` only proves containment in the workspace; a shared
1512
- * root like `data` or `data/skills` would otherwise turn the recursive
1513
- * removal into a workspace-wide wipe whose archive captures only this
1514
- * collection. `path.resolve` collapses any `..` before the prefix test
1515
- * (symlink escapes are caught separately by the realpath containment
1516
- * check in `deleteTargets`). */
1506
+ * (`collection.dataDir`) must live in this collection's OWN per-slug
1507
+ * subtree. `dataDir` is normally derived from `schema.dataPath`, but
1508
+ * `deleteCollection` accepts a `LoadedCollection` whose fields could be
1509
+ * inconsistent — so we validate the RESOLVED target the destructive ops
1510
+ * actually touch, not the schema string. A shared root like `data` or
1511
+ * `data/skills` would otherwise turn the recursive removal into a
1512
+ * workspace-wide wipe whose archive captures only this collection.
1513
+ * `path.resolve` collapses any `..` before the prefix test (symlink
1514
+ * escapes are caught separately by the realpath containment check in
1515
+ * `deleteTargets`).
1516
+ *
1517
+ * TWO acceptable per-slug subtrees:
1518
+ * - `data/<slug>/...` — the convention authored collections default to.
1519
+ * - `data/collections/<slug>/...` — what `normalizedDataPath` in the
1520
+ * registry-import path stamps onto every imported schema (so imported
1521
+ * collections never collide with `data/<slug>/`-shaped authored ones).
1522
+ * Both are equally per-collection and equally safe; a delete that targets
1523
+ * anything else (e.g. raw `data/`, `data/wiki/`, a sibling slug) is
1524
+ * refused. */
1517
1525
  function isDataDirSafe(dataDir, slug, workspaceRoot) {
1518
- const expectedRoot = node_path.default.resolve(workspaceRoot, "data", slug);
1526
+ const acceptableRoots = [node_path.default.resolve(workspaceRoot, "data", slug), node_path.default.resolve(workspaceRoot, "data", "collections", slug)];
1519
1527
  const resolved = node_path.default.resolve(dataDir);
1520
- return resolved === expectedRoot || resolved.startsWith(expectedRoot + node_path.default.sep);
1528
+ return acceptableRoots.some((root) => resolved === root || resolved.startsWith(root + node_path.default.sep));
1521
1529
  }
1522
1530
  function buildRestoreDoc(collection) {
1523
1531
  const { slug, schema } = collection;
@@ -1982,4 +1990,4 @@ Object.defineProperty(exports, "writeItem", {
1982
1990
  }
1983
1991
  });
1984
1992
 
1985
- //# sourceMappingURL=server-D27UzXug.cjs.map
1993
+ //# sourceMappingURL=server-Db-x7OXz.cjs.map