MCPcopy Create free account
hub / github.com/EvoMap/evolver / appendCapsule

Function appendCapsule

src/gep/assetStore.js:629–638  ·  view source on GitHub ↗
(capsuleObj)

Source from the content-addressed store, hash-verified

627}
628
629function appendCapsule(capsuleObj) {
630 _validateAssetWarn('Capsule', validateCapsule, capsuleObj);
631 ensureSchemaFields(capsuleObj);
632 return withFileLock(capsulesPath(), () => {
633 const current = readJsonIfExists(capsulesPath(), getDefaultCapsules());
634 const capsules = Array.isArray(current.capsules) ? current.capsules : [];
635 capsules.push(capsuleObj);
636 writeJsonAtomic(capsulesPath(), { version: current.version || 1, capsules });
637 });
638}
639
640function upsertCapsule(capsuleObj) {
641 if (!capsuleObj || capsuleObj.type !== 'Capsule' || !capsuleObj.id) return;

Callers

nothing calls this directly

Calls 7

_validateAssetWarnFunction · 0.85
ensureSchemaFieldsFunction · 0.85
withFileLockFunction · 0.85
capsulesPathFunction · 0.85
getDefaultCapsulesFunction · 0.85
writeJsonAtomicFunction · 0.85
readJsonIfExistsFunction · 0.70

Tested by

no test coverage detected