@remnic/core 9.3.544 → 9.3.545
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/access-cli.js +15 -15
- package/dist/access-http.js +9 -9
- package/dist/access-mcp.js +8 -8
- package/dist/access-schema.js +3 -3
- package/dist/access-service.js +6 -6
- package/dist/briefing.js +3 -3
- package/dist/causal-consolidation.js +4 -4
- package/dist/{chunk-FWYUJY4N.js → chunk-25BY3HHZ.js} +2 -2
- package/dist/{chunk-K6OABSBA.js → chunk-5GX5MUQ2.js} +2 -2
- package/dist/{chunk-NHZHAZCJ.js → chunk-5RIRL3XL.js} +2 -2
- package/dist/{chunk-QKV4LVLA.js → chunk-5WLYNZPC.js} +2 -2
- package/dist/{chunk-PR577DSG.js → chunk-6PDPQLSV.js} +12 -12
- package/dist/{chunk-NJBIGWAI.js → chunk-ACCAZOBX.js} +2 -2
- package/dist/{chunk-BRCYNT4I.js → chunk-CC2ESOOG.js} +2 -2
- package/dist/{chunk-QWQX7YK5.js → chunk-E5OECWZ5.js} +2 -2
- package/dist/{chunk-J62VXZR2.js → chunk-FADZBOR4.js} +2 -2
- package/dist/{chunk-GWUUEPOR.js → chunk-FVCZINOF.js} +2 -2
- package/dist/{chunk-73JGZ5VA.js → chunk-ILXTATKK.js} +47 -20
- package/dist/chunk-ILXTATKK.js.map +1 -0
- package/dist/{chunk-FXE46BJ5.js → chunk-JFN6K74Q.js} +2 -2
- package/dist/{chunk-ENIIJ3MZ.js → chunk-M3BAMVAE.js} +2 -2
- package/dist/{chunk-QCJLDMY5.js → chunk-OF46AKZC.js} +8 -8
- package/dist/{chunk-7NEW7PTS.js → chunk-QFGWYIB6.js} +5 -5
- package/dist/{chunk-LKUNOD7B.js → chunk-S53PAX2V.js} +2 -2
- package/dist/{chunk-INMWM3UZ.js → chunk-SCKIZM6L.js} +4 -4
- package/dist/{chunk-3M7OTJ5H.js → chunk-SI3QCHWF.js} +4 -4
- package/dist/{chunk-UMXWQL3P.js → chunk-SOTR74FK.js} +2 -2
- package/dist/{chunk-A5TLPLUO.js → chunk-TVZ6LKKS.js} +2 -2
- package/dist/{chunk-25XNFWT3.js → chunk-VKVKH6XO.js} +2 -2
- package/dist/{chunk-GAMKRZRP.js → chunk-XOSQ4MRE.js} +5 -5
- package/dist/{chunk-RGLJNOQN.js → chunk-Y4YATXHL.js} +3 -3
- package/dist/{chunk-XE23FSDQ.js → chunk-Z56KAZQL.js} +2 -2
- package/dist/cli.js +18 -18
- package/dist/compounding/engine.js +3 -3
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/index.js +3 -3
- package/dist/entity-retrieval.js +3 -3
- package/dist/index.js +24 -24
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/storage.js +3 -3
- package/dist/offline-sync.js +2 -2
- package/dist/operator-toolkit.js +6 -6
- package/dist/orchestrator.js +11 -11
- package/dist/schemas.d.ts +22 -22
- package/dist/secure-store/index.js +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/storage.js +2 -2
- package/dist/transfer/types.d.ts +12 -12
- package/dist/verified-recall.js +3 -3
- package/package.json +1 -1
- package/src/secure-store/secure-fs.ts +63 -38
- package/src/secure-store/secure-store.test.ts +155 -106
- package/dist/chunk-73JGZ5VA.js.map +0 -1
- /package/dist/{chunk-FWYUJY4N.js.map → chunk-25BY3HHZ.js.map} +0 -0
- /package/dist/{chunk-K6OABSBA.js.map → chunk-5GX5MUQ2.js.map} +0 -0
- /package/dist/{chunk-NHZHAZCJ.js.map → chunk-5RIRL3XL.js.map} +0 -0
- /package/dist/{chunk-QKV4LVLA.js.map → chunk-5WLYNZPC.js.map} +0 -0
- /package/dist/{chunk-PR577DSG.js.map → chunk-6PDPQLSV.js.map} +0 -0
- /package/dist/{chunk-NJBIGWAI.js.map → chunk-ACCAZOBX.js.map} +0 -0
- /package/dist/{chunk-BRCYNT4I.js.map → chunk-CC2ESOOG.js.map} +0 -0
- /package/dist/{chunk-QWQX7YK5.js.map → chunk-E5OECWZ5.js.map} +0 -0
- /package/dist/{chunk-J62VXZR2.js.map → chunk-FADZBOR4.js.map} +0 -0
- /package/dist/{chunk-GWUUEPOR.js.map → chunk-FVCZINOF.js.map} +0 -0
- /package/dist/{chunk-FXE46BJ5.js.map → chunk-JFN6K74Q.js.map} +0 -0
- /package/dist/{chunk-ENIIJ3MZ.js.map → chunk-M3BAMVAE.js.map} +0 -0
- /package/dist/{chunk-QCJLDMY5.js.map → chunk-OF46AKZC.js.map} +0 -0
- /package/dist/{chunk-7NEW7PTS.js.map → chunk-QFGWYIB6.js.map} +0 -0
- /package/dist/{chunk-LKUNOD7B.js.map → chunk-S53PAX2V.js.map} +0 -0
- /package/dist/{chunk-INMWM3UZ.js.map → chunk-SCKIZM6L.js.map} +0 -0
- /package/dist/{chunk-3M7OTJ5H.js.map → chunk-SI3QCHWF.js.map} +0 -0
- /package/dist/{chunk-UMXWQL3P.js.map → chunk-SOTR74FK.js.map} +0 -0
- /package/dist/{chunk-A5TLPLUO.js.map → chunk-TVZ6LKKS.js.map} +0 -0
- /package/dist/{chunk-25XNFWT3.js.map → chunk-VKVKH6XO.js.map} +0 -0
- /package/dist/{chunk-GAMKRZRP.js.map → chunk-XOSQ4MRE.js.map} +0 -0
- /package/dist/{chunk-RGLJNOQN.js.map → chunk-Y4YATXHL.js.map} +0 -0
- /package/dist/{chunk-XE23FSDQ.js.map → chunk-Z56KAZQL.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/secure-store/secure-fs.ts"],"sourcesContent":["/**\n * Transparent file-level encryption for the secure-store module.\n *\n * Issue #690 (PR 3/4) — storage.ts integration layer.\n *\n * This module sits between the raw filesystem and StorageManager.\n * Every memory file is either:\n * - a plain UTF-8 text file (legacy, back-compat), or\n * - a REMNIC-ENC sealed file (AES-256-GCM, see format below).\n *\n * On-disk format\n * --------------\n * Encrypted files begin with a 9-byte magic header:\n *\n * REMNIC-ENC (7 ASCII bytes)\n * VER (1 byte, currently 0x01)\n * FLAGS (1 byte, reserved, must be 0x00)\n *\n * Followed immediately by a `seal()` envelope from `cipher.ts`:\n *\n * [VERSION:1][SALT:16][IV:12][AUTHTAG:16][CIPHERTEXT:...]\n *\n * The magic header makes encrypted files sniffable without attempting\n * a full `open()` call and gives operators a clear signal that the\n * file cannot be read by opening it in an editor.\n *\n * AAD\n * ---\n * The file path relative to the memory root is bound as Associated\n * Authenticated Data (AAD) on both encrypt and decrypt. This means\n * moving or renaming an encrypted file without re-encrypting it will\n * cause auth-tag failure on the next read — the file is tied to its\n * path. Callers that move files must re-encrypt them.\n *\n * Back-compat\n * -----------\n * `readMaybeEncryptedFile` transparently handles both formats: if the\n * file does NOT start with the magic bytes, it is returned as-is (plain\n * text). This lets an operator migrate incrementally: newly-written\n * files are encrypted while existing files continue to be read in plain\n * form until `migrateMemoryDirToEncrypted` is run.\n *\n * Naming: `secure-fs.ts` (not `vault-fs.ts`) — see `kdf.ts` naming note.\n */\n\nimport { createCipheriv, randomBytes, randomUUID } from \"node:crypto\";\nimport { lstat, mkdir, open as openFile, readFile, readdir, rename, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport {\n AUTH_TAG_LENGTH,\n ENVELOPE_HEADER_SIZE,\n ENVELOPE_LAYOUT,\n ENVELOPE_SALT_LENGTH,\n ENVELOPE_VERSION,\n IV_LENGTH,\n generateSalt,\n open as openEnvelope,\n parseEnvelope,\n seal,\n} from \"./cipher.js\";\n\n// ---------------------------------------------------------------------------\n// Error classes\n// ---------------------------------------------------------------------------\n\n/**\n * Thrown when a read is attempted but the keyring entry for this\n * store is absent (i.e. `secure-store unlock` has not been run\n * since the last daemon start).\n */\nexport class SecureStoreLockedError extends Error {\n constructor(message = \"secure-store is locked — run `remnic secure-store unlock` to decrypt\") {\n super(message);\n this.name = \"SecureStoreLockedError\";\n }\n}\n\n/**\n * Thrown when `open()` fails because the auth tag does not validate.\n * This covers both wrong-key and tampered-ciphertext scenarios —\n * intentionally indistinguishable from the caller's perspective.\n */\nexport class SecureStoreDecryptError extends Error {\n constructor(message = \"secure-store decryption failed — wrong key or tampered ciphertext\") {\n super(message);\n this.name = \"SecureStoreDecryptError\";\n }\n}\n\n// ---------------------------------------------------------------------------\n// Magic header\n// ---------------------------------------------------------------------------\n\n/** Magic bytes: the ASCII string \"REMNIC-ENC\" (10 bytes). */\nexport const MAGIC_BYTES = Buffer.from(\"REMNIC-ENC\", \"ascii\");\n\n/** Current on-disk version byte. */\nexport const FILE_FORMAT_VERSION = 0x01;\n\n/** Reserved flags byte — must be 0x00. */\nexport const FILE_FORMAT_FLAGS = 0x00;\n\n/** Total size of the magic header prefix (magic + version + flags). */\nexport const MAGIC_HEADER_SIZE = MAGIC_BYTES.length + 2; // 12 bytes\n\n// ---------------------------------------------------------------------------\n// Detection\n// ---------------------------------------------------------------------------\n\n/**\n * Return true iff `buf` begins with the REMNIC-ENC magic header.\n * Does not validate the envelope; just identifies the format.\n */\nexport function isEncryptedFile(buf: Uint8Array): boolean {\n if (buf.length < MAGIC_HEADER_SIZE) return false;\n const b = Buffer.isBuffer(buf) ? buf : Buffer.from(buf);\n return b.subarray(0, MAGIC_BYTES.length).equals(MAGIC_BYTES);\n}\n\n// ---------------------------------------------------------------------------\n// Encrypt / decrypt file body\n// ---------------------------------------------------------------------------\n\n/**\n * Encrypt `plain` (UTF-8 content of a memory file) and return a\n * Buffer ready to write to disk.\n *\n * @param plain Plain-text file content (UTF-8 string or Buffer).\n * @param key 32-byte AES-256 key from the keyring.\n * @param aad Optional associated data — defaults to empty if omitted.\n * Callers should pass the file path relative to memoryDir\n * so the ciphertext is bound to its location.\n */\nexport function encryptFileBody(plain: string | Buffer, key: Buffer, aad?: Buffer): Buffer {\n const plainBuf = typeof plain === \"string\" ? Buffer.from(plain, \"utf8\") : plain;\n const salt = generateSalt();\n const envelope = seal(key, salt, plainBuf, aad ? { aad } : {});\n\n const header = Buffer.alloc(MAGIC_HEADER_SIZE);\n MAGIC_BYTES.copy(header, 0);\n header.writeUInt8(FILE_FORMAT_VERSION, MAGIC_BYTES.length);\n header.writeUInt8(FILE_FORMAT_FLAGS, MAGIC_BYTES.length + 1);\n\n return Buffer.concat([header, envelope]);\n}\n\n/**\n * Decrypt a buffer produced by `encryptFileBody` and return the\n * original UTF-8 content.\n *\n * Throws `SecureStoreDecryptError` on auth failure (wrong key or\n * tampered ciphertext). Throws a plain `Error` for structural problems\n * (truncated buffer, wrong magic, unsupported version).\n */\nexport function decryptFileBody(buf: Buffer, key: Buffer, aad?: Buffer): Buffer {\n if (!isEncryptedFile(buf)) {\n throw new Error(\"decryptFileBody: buffer does not start with REMNIC-ENC magic header\");\n }\n const version = buf.readUInt8(MAGIC_BYTES.length);\n if (version !== FILE_FORMAT_VERSION) {\n throw new Error(\n `decryptFileBody: unsupported file format version ${version} (this build supports ${FILE_FORMAT_VERSION})`\n );\n }\n const flags = buf.readUInt8(MAGIC_BYTES.length + 1);\n if (flags !== FILE_FORMAT_FLAGS) {\n throw new Error(`decryptFileBody: unknown flags byte 0x${flags.toString(16).padStart(2, \"0\")}`);\n }\n const envelope = buf.subarray(MAGIC_HEADER_SIZE);\n parseEnvelope(envelope);\n try {\n return openEnvelope(key, envelope, aad ? { aad } : {});\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n throw new SecureStoreDecryptError(`secure-store decryption failed: ${msg}`);\n }\n}\n\nfunction buildHeaderAad(salt: Uint8Array): Buffer {\n const out = Buffer.alloc(1 + ENVELOPE_SALT_LENGTH);\n out.writeUInt8(ENVELOPE_VERSION, 0);\n Buffer.from(salt).copy(out, 1);\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Path → AAD helper\n// ---------------------------------------------------------------------------\n\n/**\n * Build the AAD buffer for a file at `filePath` relative to\n * `memoryDir`. The AAD binds the ciphertext to its path so a\n * file cannot be silently relocated without re-encryption.\n *\n * When `memoryDir` is supplied and `filePath` is absolute, the\n * relative sub-path is used. Otherwise `filePath` is used verbatim.\n */\nexport function filePathAad(filePath: string, memoryDir?: string): Buffer {\n let rel = filePath;\n if (memoryDir && path.isAbsolute(filePath)) {\n rel = path.relative(memoryDir, filePath);\n }\n return Buffer.from(rel, \"utf8\");\n}\n\n// ---------------------------------------------------------------------------\n// High-level read / write helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Read a file from `filePath`.\n *\n * - If the file is plaintext (no magic header), return its content\n * as-is — back-compat with unencrypted stores.\n * - If the file is encrypted AND `key` is provided, decrypt and return\n * the plaintext content.\n * - If the file is encrypted AND `key` is null, throw\n * `SecureStoreLockedError`.\n *\n * @param filePath Absolute path to the file.\n * @param key 32-byte AES-256 key, or null when the store is locked.\n * @param memoryDir Memory root for path-bound AAD. Should be absolute.\n */\nexport async function readMaybeEncryptedFileBuffer(\n filePath: string,\n key: Buffer | null,\n memoryDir?: string\n): Promise<Buffer> {\n const buf = await readFile(filePath);\n if (!isEncryptedFile(buf)) {\n // Plain file — legacy or unencrypted store.\n return buf;\n }\n // Encrypted — key required.\n if (key === null) {\n throw new SecureStoreLockedError(\n `secure-store is locked — cannot read encrypted file at ${filePath}. Run \\`remnic secure-store unlock\\` to decrypt.`\n );\n }\n return decryptFileBodyForPath(buf, key, filePath, memoryDir);\n}\n\nexport async function readMaybeEncryptedFile(\n filePath: string,\n key: Buffer | null,\n memoryDir?: string\n): Promise<string> {\n return (await readMaybeEncryptedFileBuffer(filePath, key, memoryDir)).toString(\"utf8\");\n}\n\nexport interface WriteMaybeEncryptedFileOptions {\n /**\n * File mode bits. Default 0o600 (owner read/write only).\n * Applied only on create; existing files inherit their existing mode.\n */\n mode?: number;\n /**\n * If true, write atomically via a temp file + rename (CLAUDE.md gotcha #54).\n * Default true.\n */\n atomic?: boolean;\n}\n\n/**\n * Write `content` to `filePath`.\n *\n * - If `key` is provided and non-null, encrypt the content first.\n * - If `key` is null, write the content as plain UTF-8 (unencrypted store).\n *\n * Writes atomically: content is written to a unique temp file\n * first, then renamed into place (CLAUDE.md gotcha #54 — never delete\n * before write).\n */\nexport async function writeMaybeEncryptedFile(\n filePath: string,\n content: string | Buffer,\n key: Buffer | null,\n options: WriteMaybeEncryptedFileOptions = {},\n memoryDir?: string\n): Promise<void> {\n const { mode = 0o600, atomic = true } = options;\n await mkdir(path.dirname(filePath), { recursive: true });\n\n let data: Buffer | string;\n if (key !== null) {\n const aad = filePathAad(filePath, memoryDir);\n data = encryptFileBody(content, key, aad);\n } else {\n data = content;\n }\n\n if (atomic) {\n const tempPath = uniqueAtomicTempPath(filePath, \"tmp\");\n try {\n await writeFile(tempPath, data, { mode });\n await rename(tempPath, filePath);\n } catch (err) {\n // Best-effort cleanup of the temp file.\n try {\n await unlink(tempPath);\n } catch {\n // ignore\n }\n throw err;\n }\n } else {\n await writeFile(filePath, data, { mode });\n }\n}\n\nexport async function writeMaybeEncryptedFileFromChunks(\n filePath: string,\n chunks: AsyncIterable<Buffer>,\n key: Buffer | null,\n options: WriteMaybeEncryptedFileOptions = {},\n memoryDir?: string\n): Promise<void> {\n const { mode = 0o600, atomic = true } = options;\n await mkdir(path.dirname(filePath), { recursive: true });\n const writePath = atomic ? `${filePath}.tmp-${process.pid}-${Date.now()}` : filePath;\n let completed = false;\n try {\n const handle = await openFile(writePath, \"w\", mode);\n try {\n if (key !== null) {\n const salt = generateSalt();\n const iv = randomBytes(IV_LENGTH);\n const header = Buffer.alloc(MAGIC_HEADER_SIZE + ENVELOPE_HEADER_SIZE);\n MAGIC_BYTES.copy(header, 0);\n header.writeUInt8(FILE_FORMAT_VERSION, MAGIC_BYTES.length);\n header.writeUInt8(FILE_FORMAT_FLAGS, MAGIC_BYTES.length + 1);\n const envelopeOffset = MAGIC_HEADER_SIZE;\n header.writeUInt8(ENVELOPE_VERSION, envelopeOffset + ENVELOPE_LAYOUT.version);\n salt.copy(header, envelopeOffset + ENVELOPE_LAYOUT.salt);\n iv.copy(header, envelopeOffset + ENVELOPE_LAYOUT.iv);\n await handle.write(header);\n\n const cipher = createCipheriv(\"aes-256-gcm\", key, iv, { authTagLength: AUTH_TAG_LENGTH });\n const aad = filePathAad(filePath, memoryDir);\n cipher.setAAD(Buffer.concat([buildHeaderAad(salt), aad]));\n for await (const chunk of chunks) {\n if (chunk.length === 0) continue;\n const encrypted = cipher.update(chunk);\n if (encrypted.length > 0) await handle.write(encrypted);\n }\n const final = cipher.final();\n if (final.length > 0) await handle.write(final);\n const authTag = cipher.getAuthTag();\n await handle.write(authTag, 0, authTag.length, MAGIC_HEADER_SIZE + ENVELOPE_LAYOUT.authTag);\n } else {\n for await (const chunk of chunks) {\n if (chunk.length > 0) await handle.write(chunk);\n }\n }\n } finally {\n await handle.close();\n }\n if (atomic) {\n await rename(writePath, filePath);\n }\n completed = true;\n } finally {\n if (!completed && atomic) {\n await unlink(writePath).catch(() => {});\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Migration\n// ---------------------------------------------------------------------------\n\nexport interface MigrateResult {\n /** Number of files successfully encrypted. */\n encrypted: number;\n /** Number of files already encrypted (skipped). */\n skipped: number;\n /** Files that failed to encrypt (path → error message). */\n errors: Array<{ filePath: string; error: string }>;\n}\n\nexport interface DecryptResult {\n /** Number of files successfully decrypted back to plaintext. */\n decrypted: number;\n /** Number of files already plaintext (skipped). */\n skipped: number;\n /** Files that failed to decrypt (path → error message). */\n errors: Array<{ filePath: string; error: string }>;\n}\n\n/**\n * Walk `dir` recursively, find encryptable storage-managed files that are not\n * yet encrypted, and re-write them as encrypted files under `key`.\n *\n * Safety rules per CLAUDE.md gotchas #54 and #25:\n * 1. A page-version snapshot is taken (via `createVersion`) BEFORE\n * each overwrite so the plaintext version is preserved in history.\n * Since this module has no direct access to `page-versioning.ts`\n * internals, callers who have page-versioning configured should\n * pass `onBeforeEncrypt` to take the snapshot.\n * 2. The new encrypted content is written to a temp file first,\n * then renamed atomically — never deleted before written.\n * 3. If encryption of any file fails, the error is recorded and the\n * original file is left intact (partial migration is safe).\n *\n * @param dir Absolute path to the memory directory.\n * @param key 32-byte AES-256 key.\n * @param onBeforeEncrypt Optional callback invoked before encrypting\n * each file. Can be used to take page-version\n * snapshots. Errors here are non-fatal.\n */\nexport async function migrateMemoryDirToEncrypted(\n dir: string,\n key: Buffer,\n onBeforeEncrypt?: (filePath: string) => Promise<void>\n): Promise<MigrateResult> {\n const result: MigrateResult = { encrypted: 0, skipped: 0, errors: [] };\n\n const files = await collectEncryptableStorageFiles(dir);\n for (const filePath of files) {\n try {\n const buf = await readFile(filePath);\n if (isEncryptedFile(buf)) {\n result.skipped++;\n continue;\n }\n // Call optional pre-encryption hook (e.g. page-version snapshot).\n if (onBeforeEncrypt) {\n try {\n await onBeforeEncrypt(filePath);\n } catch {\n // Non-fatal — continue with encryption even if snapshot fails.\n }\n }\n const content = buf.toString(\"utf8\");\n const aad = filePathAad(filePath, dir);\n const encrypted = encryptFileBody(content, key, aad);\n\n // Atomic write: temp → rename (gotcha #54).\n const tempPath = uniqueAtomicTempPath(filePath, \"enc-tmp\");\n try {\n await writeFile(tempPath, encrypted, { mode: 0o600 });\n await rename(tempPath, filePath);\n result.encrypted++;\n } catch (writeErr) {\n // Clean up temp file, leave original intact.\n try {\n const { unlink } = await import(\"node:fs/promises\");\n await unlink(tempPath);\n } catch {\n // ignore\n }\n throw writeErr;\n }\n } catch (err) {\n result.errors.push({\n filePath,\n error: err instanceof Error ? err.message : String(err),\n });\n }\n }\n\n return result;\n}\n\n/**\n * Walk `dir` recursively, find storage-managed encrypted files, and\n * re-write them as plaintext under the same paths.\n *\n * This is the reversible counterpart to {@link migrateMemoryDirToEncrypted}.\n * It only touches files under the same storage-managed roots, skips\n * plaintext files, skips symlinks, excludes `.secure-store/`, and writes\n * each plaintext replacement via temp-file + rename so a per-file failure\n * leaves the ciphertext intact.\n */\nexport async function decryptMemoryDirToPlaintext(dir: string, key: Buffer): Promise<DecryptResult> {\n const result: DecryptResult = { decrypted: 0, skipped: 0, errors: [] };\n\n const files = await collectStorageManagedFiles(dir, isDecryptableStoragePath);\n for (const filePath of files) {\n try {\n const buf = await readFile(filePath);\n if (!isEncryptedFile(buf)) {\n result.skipped++;\n continue;\n }\n\n const plaintext = decryptFileBodyForPath(buf, key, filePath, dir);\n const tempPath = uniqueAtomicTempPath(filePath, \"dec-tmp\");\n try {\n await writeFile(tempPath, plaintext, { mode: 0o600 });\n await rename(tempPath, filePath);\n result.decrypted++;\n } catch (writeErr) {\n try {\n await unlink(tempPath);\n } catch {\n // ignore cleanup errors; original ciphertext is still intact.\n }\n throw writeErr;\n }\n } catch (err) {\n result.errors.push({\n filePath,\n error: err instanceof Error ? err.message : String(err),\n });\n }\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\nfunction uniqueAtomicTempPath(filePath: string, label: string): string {\n return `${filePath}.${label}-${process.pid}-${Date.now()}-${randomUUID()}`;\n}\n\nfunction decryptFileBodyForPath(buf: Buffer, key: Buffer, filePath: string, memoryDir?: string): Buffer {\n const aad = filePathAad(filePath, memoryDir);\n try {\n return decryptFileBody(buf, key, aad);\n } catch (err) {\n if (!(err instanceof SecureStoreDecryptError)) {\n throw err;\n }\n const legacyRoot = legacyNamespaceAadRootForFile(filePath, memoryDir);\n if (legacyRoot) {\n try {\n return decryptFileBody(buf, key, filePathAad(filePath, legacyRoot));\n } catch {\n // Fall through to the namespace-reader fallback below.\n }\n }\n\n const topLevelRoot = topLevelAadRootForNamespaceReader(filePath, memoryDir);\n if (topLevelRoot) {\n try {\n return decryptFileBody(buf, key, filePathAad(filePath, topLevelRoot));\n } catch {\n // Preserve the caller-facing error from the canonical decrypt attempt.\n }\n }\n\n throw err;\n }\n}\n\nfunction topLevelAadRootForNamespaceReader(filePath: string, memoryDir?: string): string | null {\n if (!memoryDir || !path.isAbsolute(filePath)) return null;\n const resolvedMemoryDir = path.resolve(memoryDir);\n const rel = path.relative(resolvedMemoryDir, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || path.isAbsolute(rel)) return null;\n const parts = resolvedMemoryDir.split(path.sep);\n if (parts.length < 3 || parts.at(-2) !== \"namespaces\" || !parts.at(-1)) return null;\n const topLevelRoot = parts.slice(0, -2).join(path.sep) || path.sep;\n const topRel = path.relative(topLevelRoot, filePath);\n if (topRel === \"\" || topRel.startsWith(\"..\") || path.isAbsolute(topRel)) {\n return null;\n }\n const topParts = topRel.split(path.sep);\n if (topParts[0] !== \"namespaces\" || topParts[1] !== parts.at(-1)) {\n return null;\n }\n return topLevelRoot;\n}\n\nfunction legacyNamespaceAadRootForFile(filePath: string, memoryDir?: string): string | null {\n if (!memoryDir || !path.isAbsolute(filePath)) return null;\n const rel = path.relative(memoryDir, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || path.isAbsolute(rel)) return null;\n const parts = rel.split(path.sep);\n if (parts[0] === \"namespaces\" && parts.length >= 3 && parts[1]) {\n return path.join(memoryDir, \"namespaces\", parts[1]);\n }\n return null;\n}\n\n/**\n * Recursively collect files under `dir` that are read through the\n * storage-layer secure-store helpers, excluding symlinked entries and\n * `.secure-store/` metadata.\n */\nasync function collectEncryptableStorageFiles(dir: string, rootDir = dir): Promise<string[]> {\n return collectStorageManagedFiles(dir, isEncryptableStoragePath, rootDir);\n}\n\n/**\n * Recursively collect regular files under storage-managed roots, excluding\n * symlinked entries and `.secure-store/` metadata. This broader collector is\n * used by the decrypt/disable path so future encrypted sidecars can be\n * restored without requiring extension-specific logic.\n */\nasync function collectStorageManagedFiles(\n dir: string,\n includeFile: (filePath: string, rootDir: string) => boolean,\n rootDir = dir\n): Promise<string[]> {\n const results: string[] = [];\n let scanDir = dir;\n let scanRootDir = rootDir;\n if (path.resolve(dir) === path.resolve(rootDir)) {\n const normalizedRoot = await resolveStorageManagedRootForScan(dir);\n if (!normalizedRoot) return results;\n scanDir = normalizedRoot;\n scanRootDir = normalizedRoot;\n }\n let names: string[];\n try {\n names = await readdir(scanDir, { encoding: \"utf8\" });\n } catch {\n return results;\n }\n for (const name of names) {\n if (name.startsWith(\".secure-store\")) continue;\n const full = path.join(scanDir, name);\n let isDir = false;\n let isFile = false;\n try {\n const s = await lstat(full);\n if (s.isSymbolicLink()) continue;\n isDir = s.isDirectory();\n isFile = s.isFile();\n } catch {\n continue;\n }\n if (isDir) {\n const sub = await collectStorageManagedFiles(full, includeFile, scanRootDir);\n results.push(...sub);\n } else if (isFile && includeFile(full, scanRootDir)) {\n results.push(full);\n }\n }\n return results;\n}\n\nasync function resolveStorageManagedRootForScan(dir: string): Promise<string | null> {\n const lstatPath = normalizePathForLstat(dir);\n let stat: Awaited<ReturnType<typeof lstat>>;\n try {\n stat = await lstat(lstatPath);\n } catch (error) {\n if (isFsErrorWithCode(error, \"ENOENT\")) return null;\n throw error;\n }\n if (stat.isSymbolicLink()) {\n throw new Error(`secure-store migration root must not be a symlink: ${dir}`);\n }\n if (!stat.isDirectory()) {\n throw new Error(`secure-store migration root must be a directory: ${dir}`);\n }\n return lstatPath;\n}\n\nfunction normalizePathForLstat(filePath: string): string {\n return stripTrailingPathSeparators(path.normalize(filePath));\n}\n\nfunction isFsErrorWithCode(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && (error as { code?: unknown }).code === code;\n}\n\nfunction stripTrailingPathSeparators(filePath: string): string {\n const root = path.parse(filePath).root;\n let end = filePath.length;\n while (\n end > root.length &&\n (filePath[end - 1] === path.sep || filePath[end - 1] === path.posix.sep || filePath[end - 1] === path.win32.sep)\n ) {\n end -= 1;\n }\n return end === filePath.length ? filePath : filePath.slice(0, end);\n}\n\nfunction isEncryptableStoragePath(filePath: string, rootDir: string): boolean {\n const rel = path.relative(rootDir, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || path.isAbsolute(rel)) return false;\n const normalized = normalizeStorageRelativePath(rel);\n if (normalized === \"profile.md\") return true;\n if (isEncryptableStateSidecar(normalized)) return true;\n if (isEncryptableSummarySidecar(normalized)) return true;\n const firstSegment = normalized.split(\"/\", 1)[0];\n return ENCRYPTABLE_MARKDOWN_STORAGE_ROOTS.has(firstSegment) && normalized.endsWith(\".md\");\n}\n\nfunction isDecryptableStoragePath(filePath: string, rootDir: string): boolean {\n if (isEncryptableStoragePath(filePath, rootDir)) return true;\n const rel = path.relative(rootDir, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || path.isAbsolute(rel)) return false;\n const normalized = normalizeStorageRelativePath(rel);\n const firstSegment = normalized.split(\"/\", 1)[0];\n return DECRYPTABLE_SIDECAR_ROOTS.has(firstSegment);\n}\n\nfunction normalizeStorageRelativePath(rel: string): string {\n const normalized = rel.split(path.sep).join(\"/\");\n const parts = normalized.split(\"/\");\n if (parts[0] === \"namespaces\" && parts.length >= 3) {\n return parts.slice(2).join(\"/\");\n }\n return normalized;\n}\n\nconst ENCRYPTABLE_MARKDOWN_STORAGE_ROOTS = new Set([\n \"facts\",\n \"corrections\",\n \"procedures\",\n \"reasoning-traces\",\n \"artifacts\",\n \"archive\",\n \"entities\",\n \"identity\",\n]);\n\nconst ENCRYPTABLE_STATE_SIDECARS = new Set([\n \"state/behavior-signals.jsonl\",\n \"state/buffer-surprise-ledger.jsonl\",\n \"state/buffer.json\",\n \"state/compression-guideline-draft-state.json\",\n \"state/compression-guideline-state.json\",\n \"state/compression-guidelines.draft.md\",\n \"state/compression-guidelines.md\",\n \"state/entity-synthesis-queue.json\",\n \"state/fact-hashes.txt\",\n \"state/memory-actions.jsonl\",\n \"state/memory-lifecycle-ledger.jsonl\",\n \"state/meta.json\",\n \"state/reextract-jobs.jsonl\",\n \"state/topics.json\",\n]);\n\nfunction isEncryptableStateSidecar(normalized: string): boolean {\n return ENCRYPTABLE_STATE_SIDECARS.has(normalized);\n}\n\nfunction isEncryptableSummarySidecar(normalized: string): boolean {\n return normalized.startsWith(\"summaries/\") && normalized.end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|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
5
5
|
import {
|
|
6
6
|
readEnvVar,
|
|
7
7
|
resolveHomeDir
|
|
@@ -824,4 +824,4 @@ export {
|
|
|
824
824
|
resolveBriefingSaveDir,
|
|
825
825
|
briefingFilename
|
|
826
826
|
};
|
|
827
|
-
//# sourceMappingURL=chunk-
|
|
827
|
+
//# sourceMappingURL=chunk-JFN6K74Q.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-4426WSWL.js";
|
|
7
7
|
import {
|
|
8
8
|
StorageManager
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
10
10
|
import {
|
|
11
11
|
buildLifecycleEventsForMemory,
|
|
12
12
|
sortMemoryLifecycleEvents
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
backupExistingLedger,
|
|
75
75
|
rebuildMemoryLifecycleLedger
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-M3BAMVAE.js.map
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
CompoundingEngine,
|
|
24
24
|
defaultTierMigrationCycleBudget
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-25BY3HHZ.js";
|
|
26
26
|
import {
|
|
27
27
|
SharedContextManager
|
|
28
28
|
} from "./chunk-DRD2Q7HQ.js";
|
|
@@ -168,7 +168,7 @@ import {
|
|
|
168
168
|
buildEntityRecallSection,
|
|
169
169
|
entityRecentTranscriptLookbackHours,
|
|
170
170
|
readRecentEntityTranscriptEntries
|
|
171
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-FVCZINOF.js";
|
|
172
172
|
import {
|
|
173
173
|
buildEventOrderRecallSection,
|
|
174
174
|
shouldRecallEventOrderEvidence
|
|
@@ -203,7 +203,7 @@ import {
|
|
|
203
203
|
materializeAfterSemanticConsolidation,
|
|
204
204
|
parseConsolidationResponse,
|
|
205
205
|
parseOperatorAwareConsolidationResponse
|
|
206
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-S53PAX2V.js";
|
|
207
207
|
import {
|
|
208
208
|
RoutingRulesStore
|
|
209
209
|
} from "./chunk-HPWVAEET.js";
|
|
@@ -212,13 +212,13 @@ import {
|
|
|
212
212
|
} from "./chunk-2PRQG7PV.js";
|
|
213
213
|
import {
|
|
214
214
|
searchVerifiedEpisodes
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-5WLYNZPC.js";
|
|
216
216
|
import {
|
|
217
217
|
ThreadingManager
|
|
218
218
|
} from "./chunk-W4RVMTHR.js";
|
|
219
219
|
import {
|
|
220
220
|
searchVerifiedSemanticRules
|
|
221
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-FADZBOR4.js";
|
|
222
222
|
import {
|
|
223
223
|
searchWorkProductLedgerEntries
|
|
224
224
|
} from "./chunk-XPXEJRUB.js";
|
|
@@ -240,7 +240,7 @@ import {
|
|
|
240
240
|
} from "./chunk-2I5JGH3M.js";
|
|
241
241
|
import {
|
|
242
242
|
NamespaceStorageRouter
|
|
243
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-SOTR74FK.js";
|
|
244
244
|
import {
|
|
245
245
|
namespaceIdentityFromToken
|
|
246
246
|
} from "./chunk-ZFXCQPNO.js";
|
|
@@ -342,7 +342,7 @@ import {
|
|
|
342
342
|
normalizeAttributePairs,
|
|
343
343
|
normalizeEntityName,
|
|
344
344
|
parseEntityFile
|
|
345
|
-
} from "./chunk-
|
|
345
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
346
346
|
import {
|
|
347
347
|
attachCitation,
|
|
348
348
|
hasCitationForTemplate,
|
|
@@ -12398,4 +12398,4 @@ export {
|
|
|
12398
12398
|
resolvePersistedMemoryRelativePath,
|
|
12399
12399
|
Orchestrator
|
|
12400
12400
|
};
|
|
12401
|
-
//# sourceMappingURL=chunk-
|
|
12401
|
+
//# sourceMappingURL=chunk-OF46AKZC.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-JBPKEARU.js";
|
|
4
4
|
import {
|
|
5
5
|
EngramMcpServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SCKIZM6L.js";
|
|
7
7
|
import {
|
|
8
8
|
EngramAccessInputError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XOSQ4MRE.js";
|
|
10
10
|
import {
|
|
11
11
|
projectTagProjectId
|
|
12
12
|
} from "./chunk-EDQVAMQI.js";
|
|
@@ -27,12 +27,12 @@ import {
|
|
|
27
27
|
} from "./chunk-2ODBA7MQ.js";
|
|
28
28
|
import {
|
|
29
29
|
validateRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VKVKH6XO.js";
|
|
31
31
|
import {
|
|
32
32
|
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
33
33
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
34
34
|
OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ACCAZOBX.js";
|
|
36
36
|
|
|
37
37
|
// src/access-http.ts
|
|
38
38
|
import { createServer } from "http";
|
|
@@ -1845,4 +1845,4 @@ var EngramAccessHttpServer = class {
|
|
|
1845
1845
|
export {
|
|
1846
1846
|
EngramAccessHttpServer
|
|
1847
1847
|
};
|
|
1848
|
-
//# sourceMappingURL=chunk-
|
|
1848
|
+
//# sourceMappingURL=chunk-QFGWYIB6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPostConsolidationMaterialize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CC2ESOOG.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverMemoryExtensions,
|
|
6
6
|
renderExtensionsBlock,
|
|
@@ -217,4 +217,4 @@ export {
|
|
|
217
217
|
buildExtensionsBlockForConsolidation,
|
|
218
218
|
materializeAfterSemanticConsolidation
|
|
219
219
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-S53PAX2V.js.map
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
} from "./chunk-D24OXEPB.js";
|
|
12
12
|
import {
|
|
13
13
|
EngramAccessInputError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XOSQ4MRE.js";
|
|
15
15
|
import {
|
|
16
16
|
projectTagProjectId
|
|
17
17
|
} from "./chunk-EDQVAMQI.js";
|
|
18
18
|
import {
|
|
19
19
|
validateBriefingFormat
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JFN6K74Q.js";
|
|
21
21
|
import {
|
|
22
22
|
expandTildePath
|
|
23
23
|
} from "./chunk-EYIEWJNI.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-JUC24CTX.js";
|
|
27
27
|
import {
|
|
28
28
|
validateRequest
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-VKVKH6XO.js";
|
|
30
30
|
|
|
31
31
|
// src/access-mcp.ts
|
|
32
32
|
import { readFile } from "fs/promises";
|
|
@@ -2859,4 +2859,4 @@ ${body}`;
|
|
|
2859
2859
|
export {
|
|
2860
2860
|
EngramMcpServer
|
|
2861
2861
|
};
|
|
2862
|
-
//# sourceMappingURL=chunk-
|
|
2862
|
+
//# sourceMappingURL=chunk-SCKIZM6L.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5GX5MUQ2.js";
|
|
4
4
|
import {
|
|
5
5
|
runConsolidationProvenanceCheck
|
|
6
6
|
} from "./chunk-LZ3VEOU5.js";
|
|
@@ -36,13 +36,13 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
listMemoryGovernanceRuns,
|
|
38
38
|
readMemoryGovernanceRunArtifact
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-E5OECWZ5.js";
|
|
40
40
|
import {
|
|
41
41
|
analyzeGraphHealth
|
|
42
42
|
} from "./chunk-4JRRISLU.js";
|
|
43
43
|
import {
|
|
44
44
|
StorageManager
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
46
46
|
import {
|
|
47
47
|
lintWorkspaceFiles
|
|
48
48
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1333,4 +1333,4 @@ export {
|
|
|
1333
1333
|
runBenchmarkRecall,
|
|
1334
1334
|
runOperatorRepair
|
|
1335
1335
|
};
|
|
1336
|
-
//# sourceMappingURL=chunk-
|
|
1336
|
+
//# sourceMappingURL=chunk-SI3QCHWF.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZFXCQPNO.js";
|
|
5
5
|
import {
|
|
6
6
|
StorageManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
8
8
|
import {
|
|
9
9
|
isSafeRouteNamespace
|
|
10
10
|
} from "./chunk-U3PN77QT.js";
|
|
@@ -156,4 +156,4 @@ export {
|
|
|
156
156
|
getCategoryDir,
|
|
157
157
|
NamespaceStorageRouter
|
|
158
158
|
};
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-SOTR74FK.js.map
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
readMaybeEncryptedFileBuffer,
|
|
70
70
|
writeMaybeEncryptedFile,
|
|
71
71
|
writeMaybeEncryptedFileFromChunks
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ILXTATKK.js";
|
|
73
73
|
import {
|
|
74
74
|
parseFlexibleIsoTimestamp
|
|
75
75
|
} from "./chunk-P7FMDTKL.js";
|
|
@@ -5326,4 +5326,4 @@ export {
|
|
|
5326
5326
|
serializeEntityFile,
|
|
5327
5327
|
StorageManager
|
|
5328
5328
|
};
|
|
5329
|
-
//# sourceMappingURL=chunk-
|
|
5329
|
+
//# sourceMappingURL=chunk-TVZ6LKKS.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
9
9
|
OFFLINE_SYNC_MAX_MTIME_MS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ACCAZOBX.js";
|
|
11
11
|
import {
|
|
12
12
|
validateArchiveRelativePath
|
|
13
13
|
} from "./chunk-GCGJW34D.js";
|
|
@@ -417,4 +417,4 @@ export {
|
|
|
417
417
|
actionConfidenceRequestSchema,
|
|
418
418
|
validateRequest
|
|
419
419
|
};
|
|
420
|
-
//# sourceMappingURL=chunk-
|
|
420
|
+
//# sourceMappingURL=chunk-VKVKH6XO.js.map
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
listMemoryGovernanceRuns,
|
|
51
51
|
readMemoryGovernanceRunArtifact,
|
|
52
52
|
runMemoryGovernance
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-E5OECWZ5.js";
|
|
54
54
|
import {
|
|
55
55
|
recordMemoryOutcome
|
|
56
56
|
} from "./chunk-EIR5VLIH.js";
|
|
@@ -80,10 +80,10 @@ import {
|
|
|
80
80
|
buildBriefing,
|
|
81
81
|
parseBriefingFocus,
|
|
82
82
|
parseBriefingWindow
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-JFN6K74Q.js";
|
|
84
84
|
import {
|
|
85
85
|
parseEntityFile
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
87
87
|
import {
|
|
88
88
|
DEFAULT_RECALL_DISCLOSURE,
|
|
89
89
|
isRecallDisclosure
|
|
@@ -135,7 +135,7 @@ import {
|
|
|
135
135
|
buildOfflineSyncSnapshotFromBase,
|
|
136
136
|
iterateOfflineSyncSnapshotFileRecords,
|
|
137
137
|
readOfflineSyncFileContentChunk
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-ACCAZOBX.js";
|
|
139
139
|
import {
|
|
140
140
|
evaluateActionConfidence
|
|
141
141
|
} from "./chunk-AH2JUU6X.js";
|
|
@@ -4211,4 +4211,4 @@ export {
|
|
|
4211
4211
|
shapeMemorySummary,
|
|
4212
4212
|
EngramAccessService
|
|
4213
4213
|
};
|
|
4214
|
-
//# sourceMappingURL=chunk-
|
|
4214
|
+
//# sourceMappingURL=chunk-XOSQ4MRE.js.map
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
listMemoryGovernanceRuns,
|
|
12
12
|
readMemoryGovernanceRunArtifact
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-E5OECWZ5.js";
|
|
14
14
|
import {
|
|
15
15
|
StorageManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
17
17
|
import {
|
|
18
18
|
normalizeProjectionPreview,
|
|
19
19
|
normalizeProjectionTags
|
|
@@ -929,4 +929,4 @@ export {
|
|
|
929
929
|
verifyMemoryProjection,
|
|
930
930
|
repairMemoryProjection
|
|
931
931
|
};
|
|
932
|
-
//# sourceMappingURL=chunk-
|
|
932
|
+
//# sourceMappingURL=chunk-Y4YATXHL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TVZ6LKKS.js";
|
|
4
4
|
|
|
5
5
|
// src/semantic-rule-promotion.ts
|
|
6
6
|
function normalizeRuleWhitespace(value) {
|
|
@@ -132,4 +132,4 @@ async function promoteSemanticRuleFromMemory(options) {
|
|
|
132
132
|
export {
|
|
133
133
|
promoteSemanticRuleFromMemory
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-Z56KAZQL.js.map
|
package/dist/cli.js
CHANGED
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
runWorkProductStatusCliCommand,
|
|
90
90
|
runWorkProjectCliCommand,
|
|
91
91
|
runWorkTaskCliCommand
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-6PDPQLSV.js";
|
|
93
93
|
import "./chunk-7F7Z6MOS.js";
|
|
94
94
|
import "./chunk-MC4FJXPA.js";
|
|
95
95
|
import "./chunk-LQHDIS7L.js";
|
|
@@ -108,8 +108,8 @@ import "./chunk-TKWGAOLV.js";
|
|
|
108
108
|
import "./chunk-UWY7GIVS.js";
|
|
109
109
|
import "./chunk-HOJZMQ4J.js";
|
|
110
110
|
import "./chunk-2NM43EWN.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-M3BAMVAE.js";
|
|
112
|
+
import "./chunk-Y4YATXHL.js";
|
|
113
113
|
import "./chunk-XR6DNK4U.js";
|
|
114
114
|
import "./chunk-RUZOJKNF.js";
|
|
115
115
|
import "./chunk-S7WU3Y3D.js";
|
|
@@ -117,13 +117,13 @@ import "./chunk-KJTKLXTH.js";
|
|
|
117
117
|
import "./chunk-H2NCNXMS.js";
|
|
118
118
|
import "./chunk-PU44GBL4.js";
|
|
119
119
|
import "./chunk-YR6GIWWY.js";
|
|
120
|
-
import "./chunk-
|
|
120
|
+
import "./chunk-Z56KAZQL.js";
|
|
121
121
|
import "./chunk-R3PS27B4.js";
|
|
122
122
|
import "./chunk-TGQ2NTWH.js";
|
|
123
123
|
import "./chunk-PM3QHTFT.js";
|
|
124
124
|
import "./chunk-AJA46VX5.js";
|
|
125
|
-
import "./chunk-
|
|
126
|
-
import "./chunk-
|
|
125
|
+
import "./chunk-SI3QCHWF.js";
|
|
126
|
+
import "./chunk-5GX5MUQ2.js";
|
|
127
127
|
import "./chunk-HL4DB7TO.js";
|
|
128
128
|
import "./chunk-YNDLCWXS.js";
|
|
129
129
|
import "./chunk-AUDJPF4N.js";
|
|
@@ -133,11 +133,11 @@ import "./chunk-LZ3VEOU5.js";
|
|
|
133
133
|
import "./chunk-YBPYIAA5.js";
|
|
134
134
|
import "./chunk-HPWVAEET.js";
|
|
135
135
|
import "./chunk-2PRQG7PV.js";
|
|
136
|
-
import "./chunk-
|
|
136
|
+
import "./chunk-5WLYNZPC.js";
|
|
137
137
|
import "./chunk-3BP57I6J.js";
|
|
138
138
|
import "./chunk-TERNBNJB.js";
|
|
139
139
|
import "./chunk-W4RVMTHR.js";
|
|
140
|
-
import "./chunk-
|
|
140
|
+
import "./chunk-FADZBOR4.js";
|
|
141
141
|
import "./chunk-XPXEJRUB.js";
|
|
142
142
|
import "./chunk-A6D7A2FW.js";
|
|
143
143
|
import "./chunk-FF4KLI5W.js";
|
|
@@ -153,7 +153,7 @@ import "./chunk-JNANKJLN.js";
|
|
|
153
153
|
import "./chunk-Q4CAQGKQ.js";
|
|
154
154
|
import "./chunk-ONPLNAPX.js";
|
|
155
155
|
import "./chunk-CINZGPSJ.js";
|
|
156
|
-
import "./chunk-
|
|
156
|
+
import "./chunk-SOTR74FK.js";
|
|
157
157
|
import "./chunk-ZFXCQPNO.js";
|
|
158
158
|
import "./chunk-KIB7SDIJ.js";
|
|
159
159
|
import "./chunk-ORFGK3XI.js";
|
|
@@ -181,7 +181,7 @@ import "./chunk-6HZ6AO2P.js";
|
|
|
181
181
|
import "./chunk-HQ6NIBL6.js";
|
|
182
182
|
import "./chunk-PVGDJXVK.js";
|
|
183
183
|
import "./chunk-OADWQ5CR.js";
|
|
184
|
-
import "./chunk-
|
|
184
|
+
import "./chunk-QFGWYIB6.js";
|
|
185
185
|
import "./chunk-SEDEKFYQ.js";
|
|
186
186
|
import "./chunk-JBPKEARU.js";
|
|
187
187
|
import "./chunk-TMSXWOBZ.js";
|
|
@@ -189,10 +189,10 @@ import "./chunk-J64TK33U.js";
|
|
|
189
189
|
import "./chunk-RSUYKGGZ.js";
|
|
190
190
|
import "./chunk-42NQ7AVG.js";
|
|
191
191
|
import "./chunk-7RXCMVFQ.js";
|
|
192
|
-
import "./chunk-
|
|
192
|
+
import "./chunk-SCKIZM6L.js";
|
|
193
193
|
import "./chunk-EAZGEEG2.js";
|
|
194
194
|
import "./chunk-D24OXEPB.js";
|
|
195
|
-
import "./chunk-
|
|
195
|
+
import "./chunk-XOSQ4MRE.js";
|
|
196
196
|
import "./chunk-ETUPBUHB.js";
|
|
197
197
|
import "./chunk-L227SKTB.js";
|
|
198
198
|
import "./chunk-DHGSZ3UD.js";
|
|
@@ -206,7 +206,7 @@ import "./chunk-7Q3RCKAQ.js";
|
|
|
206
206
|
import "./chunk-WSGF57U2.js";
|
|
207
207
|
import "./chunk-XKIQZXUB.js";
|
|
208
208
|
import "./chunk-UEY3VB6W.js";
|
|
209
|
-
import "./chunk-
|
|
209
|
+
import "./chunk-E5OECWZ5.js";
|
|
210
210
|
import "./chunk-EIR5VLIH.js";
|
|
211
211
|
import "./chunk-JKV57BTN.js";
|
|
212
212
|
import "./chunk-EI6V5UXY.js";
|
|
@@ -218,8 +218,8 @@ import "./chunk-CHCA44C3.js";
|
|
|
218
218
|
import "./chunk-4JRRISLU.js";
|
|
219
219
|
import "./chunk-2LSZVONP.js";
|
|
220
220
|
import "./chunk-DEUNUKTD.js";
|
|
221
|
-
import "./chunk-
|
|
222
|
-
import "./chunk-
|
|
221
|
+
import "./chunk-JFN6K74Q.js";
|
|
222
|
+
import "./chunk-TVZ6LKKS.js";
|
|
223
223
|
import "./chunk-5UZXUTVO.js";
|
|
224
224
|
import "./chunk-4H5ZJHEN.js";
|
|
225
225
|
import "./chunk-M5T4Q2ZU.js";
|
|
@@ -249,7 +249,7 @@ import "./chunk-TVVEYCNW.js";
|
|
|
249
249
|
import "./chunk-RFYAYKTD.js";
|
|
250
250
|
import "./chunk-LBLXEFWK.js";
|
|
251
251
|
import "./chunk-VFUEZZBS.js";
|
|
252
|
-
import "./chunk-
|
|
252
|
+
import "./chunk-VKVKH6XO.js";
|
|
253
253
|
import "./chunk-IPLYGWQF.js";
|
|
254
254
|
import "./chunk-J4EB7DNW.js";
|
|
255
255
|
import "./chunk-WEHSQBFR.js";
|
|
@@ -257,10 +257,10 @@ import "./chunk-X7Y7WX73.js";
|
|
|
257
257
|
import "./chunk-BJMBJZ2Y.js";
|
|
258
258
|
import "./chunk-UKJAGEXH.js";
|
|
259
259
|
import "./chunk-FP2373TW.js";
|
|
260
|
-
import "./chunk-
|
|
260
|
+
import "./chunk-ACCAZOBX.js";
|
|
261
261
|
import "./chunk-UI3NYK34.js";
|
|
262
262
|
import "./chunk-GCGJW34D.js";
|
|
263
|
-
import "./chunk-
|
|
263
|
+
import "./chunk-ILXTATKK.js";
|
|
264
264
|
import "./chunk-A6XUJE5D.js";
|
|
265
265
|
import "./chunk-P7FMDTKL.js";
|
|
266
266
|
import "./chunk-AH2JUU6X.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompoundingEngine,
|
|
3
3
|
defaultTierMigrationCycleBudget
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-25BY3HHZ.js";
|
|
5
5
|
import "../chunk-DRD2Q7HQ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-TVZ6LKKS.js";
|
|
7
7
|
import "../chunk-5UZXUTVO.js";
|
|
8
8
|
import "../chunk-4H5ZJHEN.js";
|
|
9
9
|
import "../chunk-M5T4Q2ZU.js";
|
|
@@ -21,7 +21,7 @@ import "../chunk-4DJQYKMN.js";
|
|
|
21
21
|
import "../chunk-EYIEWJNI.js";
|
|
22
22
|
import "../chunk-JUC24CTX.js";
|
|
23
23
|
import "../chunk-2ODBA7MQ.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-ILXTATKK.js";
|
|
25
25
|
import "../chunk-A6XUJE5D.js";
|
|
26
26
|
import "../chunk-P7FMDTKL.js";
|
|
27
27
|
import "../chunk-PZ5AY32C.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCodexMaterialize,
|
|
3
3
|
runPostConsolidationMaterialize
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-CC2ESOOG.js";
|
|
5
5
|
import "../chunk-JFEKNTX7.js";
|
|
6
6
|
import "../chunk-3UXOZBHV.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-TVZ6LKKS.js";
|
|
8
8
|
import "../chunk-5UZXUTVO.js";
|
|
9
9
|
import "../chunk-4H5ZJHEN.js";
|
|
10
10
|
import "../chunk-M5T4Q2ZU.js";
|
|
@@ -23,7 +23,7 @@ import "../chunk-4DJQYKMN.js";
|
|
|
23
23
|
import "../chunk-EYIEWJNI.js";
|
|
24
24
|
import "../chunk-JUC24CTX.js";
|
|
25
25
|
import "../chunk-2ODBA7MQ.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-ILXTATKK.js";
|
|
27
27
|
import "../chunk-A6XUJE5D.js";
|
|
28
28
|
import "../chunk-P7FMDTKL.js";
|
|
29
29
|
import "../chunk-PZ5AY32C.js";
|
package/dist/connectors/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import "../chunk-G56P5RLD.js";
|
|
28
28
|
import {
|
|
29
29
|
runCodexMaterialize
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-CC2ESOOG.js";
|
|
31
31
|
import {
|
|
32
32
|
MATERIALIZE_VERSION,
|
|
33
33
|
SENTINEL_FILE,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
coerceInstallExtension
|
|
49
49
|
} from "../chunk-PHK3HARR.js";
|
|
50
50
|
import "../chunk-NNVTUXEB.js";
|
|
51
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-TVZ6LKKS.js";
|
|
52
52
|
import "../chunk-5UZXUTVO.js";
|
|
53
53
|
import "../chunk-4H5ZJHEN.js";
|
|
54
54
|
import "../chunk-M5T4Q2ZU.js";
|
|
@@ -67,7 +67,7 @@ import "../chunk-4DJQYKMN.js";
|
|
|
67
67
|
import "../chunk-EYIEWJNI.js";
|
|
68
68
|
import "../chunk-JUC24CTX.js";
|
|
69
69
|
import "../chunk-2ODBA7MQ.js";
|
|
70
|
-
import "../chunk-
|
|
70
|
+
import "../chunk-ILXTATKK.js";
|
|
71
71
|
import "../chunk-A6XUJE5D.js";
|
|
72
72
|
import "../chunk-P7FMDTKL.js";
|
|
73
73
|
import "../chunk-PZ5AY32C.js";
|
package/dist/entity-retrieval.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
entityIndexVersion,
|
|
4
4
|
entityRecentTranscriptLookbackHours,
|
|
5
5
|
readRecentEntityTranscriptEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FVCZINOF.js";
|
|
7
7
|
import "./chunk-BEUDU7Y4.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-TVZ6LKKS.js";
|
|
9
9
|
import "./chunk-5UZXUTVO.js";
|
|
10
10
|
import "./chunk-4H5ZJHEN.js";
|
|
11
11
|
import "./chunk-M5T4Q2ZU.js";
|
|
@@ -21,7 +21,7 @@ import "./chunk-G7D6GZ5J.js";
|
|
|
21
21
|
import "./chunk-ALEPI75L.js";
|
|
22
22
|
import "./chunk-4DJQYKMN.js";
|
|
23
23
|
import "./chunk-2ODBA7MQ.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-ILXTATKK.js";
|
|
25
25
|
import "./chunk-A6XUJE5D.js";
|
|
26
26
|
import "./chunk-P7FMDTKL.js";
|
|
27
27
|
import "./chunk-PZ5AY32C.js";
|