@mulmoclaude/core 0.2.7 → 0.2.8

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.
@@ -1503,29 +1503,21 @@ 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 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. */
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`). */
1525
1517
  function isDataDirSafe(dataDir, slug, workspaceRoot) {
1526
- const acceptableRoots = [node_path.default.resolve(workspaceRoot, "data", slug), node_path.default.resolve(workspaceRoot, "data", "collections", slug)];
1518
+ const expectedRoot = node_path.default.resolve(workspaceRoot, "data", slug);
1527
1519
  const resolved = node_path.default.resolve(dataDir);
1528
- return acceptableRoots.some((root) => resolved === root || resolved.startsWith(root + node_path.default.sep));
1520
+ return resolved === expectedRoot || resolved.startsWith(expectedRoot + node_path.default.sep);
1529
1521
  }
1530
1522
  function buildRestoreDoc(collection) {
1531
1523
  const { slug, schema } = collection;
@@ -1990,4 +1982,4 @@ Object.defineProperty(exports, "writeItem", {
1990
1982
  }
1991
1983
  });
1992
1984
 
1993
- //# sourceMappingURL=server-Db-x7OXz.cjs.map
1985
+ //# sourceMappingURL=server-D27UzXug.cjs.map