@mulmoclaude/core 0.2.5 → 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.
- package/dist/collection/server/index.cjs +1 -1
- package/dist/collection/server/index.js +1 -1
- package/dist/collection-watchers/index.cjs +1 -1
- package/dist/collection-watchers/index.js +1 -1
- package/dist/feeds/index.cjs +0 -9
- package/dist/feeds/index.d.ts +0 -1
- package/dist/feeds/index.js +1 -2
- package/dist/feeds/server/index.cjs +1 -1
- package/dist/feeds/server/index.js +1 -1
- package/dist/{server-D27UzXug.cjs → server-Db-x7OXz.cjs} +22 -14
- package/dist/{server-D27UzXug.cjs.map → server-Db-x7OXz.cjs.map} +1 -1
- package/dist/{server-B2YkcCwl.js → server-q4WPXtbU.js} +22 -14
- package/dist/{server-B2YkcCwl.js.map → server-q4WPXtbU.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1501,21 +1501,29 @@ function deleteTargets(collection, workspaceRoot) {
|
|
|
1501
1501
|
];
|
|
1502
1502
|
}
|
|
1503
1503
|
/** The records directory the delete recursively archives + removes
|
|
1504
|
-
* (`collection.dataDir`) must live in this collection's OWN
|
|
1505
|
-
*
|
|
1506
|
-
* `
|
|
1507
|
-
*
|
|
1508
|
-
*
|
|
1509
|
-
* `
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1504
|
+
* (`collection.dataDir`) must live in this collection's OWN per-slug
|
|
1505
|
+
* subtree. `dataDir` is normally derived from `schema.dataPath`, but
|
|
1506
|
+
* `deleteCollection` accepts a `LoadedCollection` whose fields could be
|
|
1507
|
+
* inconsistent — so we validate the RESOLVED target the destructive ops
|
|
1508
|
+
* actually touch, not the schema string. A shared root like `data` or
|
|
1509
|
+
* `data/skills` would otherwise turn the recursive removal into a
|
|
1510
|
+
* workspace-wide wipe whose archive captures only this collection.
|
|
1511
|
+
* `path.resolve` collapses any `..` before the prefix test (symlink
|
|
1512
|
+
* escapes are caught separately by the realpath containment check in
|
|
1513
|
+
* `deleteTargets`).
|
|
1514
|
+
*
|
|
1515
|
+
* TWO acceptable per-slug subtrees:
|
|
1516
|
+
* - `data/<slug>/...` — the convention authored collections default to.
|
|
1517
|
+
* - `data/collections/<slug>/...` — what `normalizedDataPath` in the
|
|
1518
|
+
* registry-import path stamps onto every imported schema (so imported
|
|
1519
|
+
* collections never collide with `data/<slug>/`-shaped authored ones).
|
|
1520
|
+
* Both are equally per-collection and equally safe; a delete that targets
|
|
1521
|
+
* anything else (e.g. raw `data/`, `data/wiki/`, a sibling slug) is
|
|
1522
|
+
* refused. */
|
|
1515
1523
|
function isDataDirSafe(dataDir, slug, workspaceRoot) {
|
|
1516
|
-
const
|
|
1524
|
+
const acceptableRoots = [path.resolve(workspaceRoot, "data", slug), path.resolve(workspaceRoot, "data", "collections", slug)];
|
|
1517
1525
|
const resolved = path.resolve(dataDir);
|
|
1518
|
-
return resolved ===
|
|
1526
|
+
return acceptableRoots.some((root) => resolved === root || resolved.startsWith(root + path.sep));
|
|
1519
1527
|
}
|
|
1520
1528
|
function buildRestoreDoc(collection) {
|
|
1521
1529
|
const { slug, schema } = collection;
|
|
@@ -1711,4 +1719,4 @@ async function deleteCustomView(collection, viewId, opts = {}) {
|
|
|
1711
1719
|
//#endregion
|
|
1712
1720
|
export { readSkillTemplate as A, safeSlugName as B, buildActionSeedPrompt as C, listItems as D, generateItemId as E, isContainedInWorkspace as F, setCollectionChangePublisher as G, getWorkspaceRoot as H, itemFilePath as I, resolveDataDir as L, writeItem as M, SCHEMA_FILE as N, readCustomViewHtml as O, isContainedInRoot as P, resolveTemplatePath as R, validateRecordObject as S, deleteItem as T, log as U, configureCollectionHost as V, publishCollectionChange as W, loadCollection as _, computeSuccessor as a, COMPUTED_TYPES as b, isTriggerDue as c, resolveEvery as d, successorId as f, discoverCollections as g, acceptParsedSchema as h, advanceTriggerDate as i, resolveCreateItemId as j, readItem as k, maybeSpawnSuccessor as l, CollectionSchemaZ as m, deleteCollection as n, daysInMonth as o, enrichItems as p, deleteCollectionRefusalMessage as r, formatCivil as s, deleteCustomView as t, parseCivil as u, toDetail as v, buildCollectionActionSeedPrompt as w, validateCollectionRecords as x, toSummary as y, safeRecordId as z };
|
|
1713
1721
|
|
|
1714
|
-
//# sourceMappingURL=server-
|
|
1722
|
+
//# sourceMappingURL=server-q4WPXtbU.js.map
|