@remnic/core 9.66.10 → 9.66.12
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-admin-ops-surface.d.ts +1 -1
- package/dist/access-admin-ops-surface.js +24 -23
- package/dist/access-authorization-probe.d.ts +1 -1
- package/dist/access-authorization-probe.js +25 -24
- package/dist/access-boundary.d.ts +1 -1
- package/dist/access-boundary.js +24 -23
- package/dist/access-cli.js +82 -81
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +1 -1
- package/dist/access-extraction-force-flush.js +24 -23
- package/dist/access-http-lcm-compaction.d.ts +1 -1
- package/dist/access-http-lifecycle-flush.d.ts +1 -1
- package/dist/access-http-offline-stream.d.ts +1 -1
- package/dist/access-http-query.js +26 -25
- package/dist/access-http.d.ts +2 -2
- package/dist/access-http.js +42 -41
- package/dist/access-identity-continuity-surface.js +24 -23
- package/dist/access-lcm-surface.d.ts +1 -1
- package/dist/access-lcm-surface.js +24 -23
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +33 -32
- package/dist/access-namespace-preflight.js +24 -23
- package/dist/access-observe-write-surface.d.ts +1 -1
- package/dist/access-observe-write-surface.js +24 -23
- package/dist/access-operations-batch.js +27 -26
- package/dist/access-operations.d.ts +6 -6
- package/dist/access-operations.js +32 -31
- package/dist/access-recall-concurrency.d.ts +1 -1
- package/dist/access-recall-concurrency.js +24 -23
- package/dist/access-recall-response.d.ts +1 -1
- package/dist/access-recall-response.js +24 -23
- package/dist/access-recall-surface.d.ts +1 -1
- package/dist/access-recall-surface.js +24 -23
- package/dist/access-schema.d.ts +89 -89
- package/dist/access-schema.js +4 -4
- package/dist/access-service-helpers.d.ts +1 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +24 -23
- package/dist/access-surface-catalog.d.ts +1 -1
- package/dist/access-surface-catalog.js +26 -25
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/briefing.js +10 -10
- package/dist/buffer.js +4 -4
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-GWVG7LGC.js} +2 -2
- package/dist/causal-consolidation.js +12 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/chunk-3UXOZBHV.js +20 -0
- package/dist/chunk-3UXOZBHV.js.map +1 -0
- package/dist/{chunk-XN33JLRF.js → chunk-46XRYYOJ.js} +3 -3
- package/dist/{chunk-WD424KYT.js → chunk-4L7OKRGP.js} +2 -2
- package/dist/{chunk-ZPZLGN4Y.js → chunk-6KGBI54C.js} +5 -21
- package/dist/chunk-6KGBI54C.js.map +1 -0
- package/dist/{chunk-245QROHZ.js → chunk-6SRUPUTY.js} +7 -7
- package/dist/{chunk-ZIGSNLYI.js → chunk-A6HVSRGM.js} +3 -3
- package/dist/{chunk-JBPKEARU.js → chunk-AU7Q3LSC.js} +4 -4
- package/dist/{chunk-7BS5UVXA.js → chunk-AWMS3IFB.js} +3 -3
- package/dist/{chunk-HJQZQUPC.js → chunk-BE4Y6GK6.js} +6 -6
- package/dist/{chunk-D3AUQXTJ.js → chunk-BT7AQZQX.js} +2 -2
- package/dist/{chunk-IPLYGWQF.js → chunk-BUKK5SWA.js} +6 -6
- package/dist/{chunk-CEH2AFXG.js → chunk-C24UZSFW.js} +6 -6
- package/dist/{chunk-HCERYDRI.js → chunk-CJTZO5MW.js} +2 -2
- package/dist/{chunk-4QKWBVEE.js → chunk-CR73YTWC.js} +13 -13
- package/dist/{chunk-LTWFU6VJ.js → chunk-DDAHG5ZD.js} +2 -2
- package/dist/{chunk-S47XNAWD.js → chunk-EU5PDHU2.js} +2 -2
- package/dist/{chunk-KT3ERTF6.js → chunk-F3H7VNM4.js} +2 -2
- package/dist/{chunk-EG4FHU5C.js → chunk-FJP6MVRK.js} +2 -2
- package/dist/{chunk-7FLINMUE.js → chunk-GEHEBLVY.js} +2 -2
- package/dist/{chunk-KWVXCRFZ.js → chunk-GHSJBVVQ.js} +95 -55
- package/dist/chunk-GHSJBVVQ.js.map +1 -0
- package/dist/{chunk-G3B3LP6A.js → chunk-GRZYF6KK.js} +14 -14
- package/dist/{chunk-E2PORO7O.js → chunk-H6VYVOVP.js} +2 -2
- package/dist/{chunk-QKTGCL6M.js → chunk-HGRRJDUH.js} +2 -2
- package/dist/{chunk-J2R275FN.js → chunk-HQJM3BKH.js} +2 -2
- package/dist/{chunk-ZRQPX2DW.js → chunk-I3X5NWDU.js} +2 -2
- package/dist/{chunk-TGKLVAML.js → chunk-I7FVQMAA.js} +2 -2
- package/dist/{chunk-NR36NW24.js → chunk-IDPFBRPJ.js} +72 -75
- package/dist/{chunk-NR36NW24.js.map → chunk-IDPFBRPJ.js.map} +1 -1
- package/dist/{chunk-CNZVEU4X.js → chunk-IE7N2YK6.js} +2 -2
- package/dist/{chunk-M2BY5IZL.js → chunk-IYFL3534.js} +6 -3
- package/dist/chunk-IYFL3534.js.map +1 -0
- package/dist/{chunk-X5SDZMO7.js → chunk-JGXMA6HL.js} +2 -2
- package/dist/{chunk-SQEIPTDV.js → chunk-JKXPFIPC.js} +2 -2
- package/dist/{chunk-Y2ECPAJI.js → chunk-K5JFIA44.js} +7 -7
- package/dist/{chunk-JNZSNJ43.js → chunk-K7VTD5AZ.js} +2 -2
- package/dist/{chunk-E62M4H4M.js → chunk-KDCPIXIY.js} +2 -2
- package/dist/{chunk-TS37MXC7.js → chunk-KZAN4JXY.js} +2 -2
- package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
- package/dist/{chunk-5E7KXID5.js → chunk-M3BFW3VX.js} +1 -1
- package/dist/{chunk-VSQG4AXL.js → chunk-MUYJQ273.js} +2 -2
- package/dist/{chunk-5KVMT25I.js → chunk-MWLBRFLY.js} +2 -2
- package/dist/{chunk-2OXBS2LV.js → chunk-NROLO2HY.js} +2 -2
- package/dist/{chunk-YYDOUOYM.js → chunk-O2HDDAUM.js} +17 -12
- package/dist/chunk-O2HDDAUM.js.map +1 -0
- package/dist/{chunk-RLEJULGN.js → chunk-OMA2B7GY.js} +2 -2
- package/dist/{chunk-TXCLDIXJ.js → chunk-OQT34EVH.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-OWHERGF2.js} +2 -2
- package/dist/{chunk-4PWANX5V.js → chunk-PKRYQ222.js} +6 -6
- package/dist/{chunk-DJLH3XWM.js → chunk-QMIKXIAM.js} +2 -2
- package/dist/{chunk-Y6KDJQLK.js → chunk-QRHKJT7F.js} +7 -7
- package/dist/{chunk-7MOYAT4Y.js → chunk-QXDICB4J.js} +3 -3
- package/dist/{chunk-KWLDB64F.js → chunk-QZPSIQRB.js} +2 -2
- package/dist/{chunk-54BRW3BL.js → chunk-REJCULWA.js} +2 -2
- package/dist/{chunk-ISX7JODR.js → chunk-SBUQ4KIE.js} +2 -2
- package/dist/{chunk-HPGXB56F.js → chunk-STUPJFG7.js} +2 -2
- package/dist/{chunk-LPSTQR26.js → chunk-SV3MDTJI.js} +2 -2
- package/dist/{chunk-MK7EJLB4.js → chunk-UJICQ77Y.js} +2 -2
- package/dist/{chunk-4PHT7KE2.js → chunk-UUGU26P2.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-UVYI6VIX.js} +1 -1
- package/dist/{chunk-QB66LBXA.js → chunk-WGVAEVT7.js} +2 -2
- package/dist/{chunk-2L5FSNPC.js → chunk-X2NFFBTO.js} +7 -7
- package/dist/{chunk-EMAEDM2J.js → chunk-YWD5UIWY.js} +2 -2
- package/dist/{chunk-C6TMLF3A.js → chunk-ZFE7NXB7.js} +4 -4
- package/dist/{cli-CFpMhqz5.d.ts → cli-Bvy4jdBu.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +58 -57
- package/dist/coding/export-okf-codegraph.js +10 -10
- package/dist/compounding/engine.js +10 -10
- package/dist/connectors/codex-materialize-runner.js +11 -10
- package/dist/connectors/index.js +11 -10
- package/dist/convergence-refresh.js +12 -12
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +12 -12
- package/dist/entity-retrieval.js +10 -10
- package/dist/external-wiki-access.d.ts +1 -1
- package/dist/external-wiki-access.js +25 -24
- package/dist/external-wiki-mcp-tools.d.ts +1 -1
- package/dist/extraction-span-provenance.d.ts +28 -0
- package/dist/extraction-span-provenance.js +24 -0
- package/dist/extraction-span-provenance.js.map +1 -0
- package/dist/extraction.js +14 -13
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/index.d.ts +700 -681
- package/dist/index.js +116 -109
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.js +6 -6
- package/dist/location/index.js +12 -12
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +1 -1
- package/dist/memory-subject.d.ts +1 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/search.js +8 -8
- package/dist/namespaces/storage.js +10 -10
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-toolkit.js +18 -18
- package/dist/orchestration/maintenance.js +18 -18
- package/dist/orchestrator.js +83 -82
- package/dist/{public-http-C9-CHc40.d.ts → public-http-2MyshWxl.d.ts} +1 -1
- package/dist/qmd.js +4 -4
- package/dist/recall-deep-rewrite.d.ts +23 -0
- package/dist/recall-deep-rewrite.js +29 -0
- package/dist/recall-deep-rewrite.js.map +1 -0
- package/dist/schemas.d.ts +176 -176
- package/dist/search/factory.js +7 -7
- package/dist/search/index.js +11 -11
- package/dist/semantic-consolidation.js +12 -11
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/shared-context/manager.d.ts +6 -6
- package/dist/source-agent-qualifier.js +13 -12
- package/dist/standup/build.js +10 -10
- package/dist/storage.js +9 -9
- package/dist/support-passport/index.d.ts +4 -4
- package/dist/support-passport/index.js +27 -26
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.d.ts +8 -0
- package/dist/transfer/export-okf.js +12 -11
- package/dist/transfer/types.d.ts +78 -78
- package/dist/verified-recall.js +10 -10
- package/dist/who-knows-cli.d.ts +1 -1
- package/dist/who-knows-cli.js +11 -11
- package/dist/who-knows.d.ts +1 -1
- package/dist/who-knows.js +10 -10
- package/package.json +2 -2
- package/src/activity/timeline/analysis-failure.test.ts +104 -0
- package/src/activity/timeline/analysis-failure.ts +60 -0
- package/src/activity/timeline/index.ts +1 -0
- package/src/cli/okf-commands.ts +2 -5
- package/src/dedup/index.ts +7 -0
- package/src/dedup/merge-verdict.test.ts +74 -0
- package/src/dedup/merge-verdict.ts +31 -0
- package/src/extraction-span-provenance.test.ts +85 -0
- package/src/extraction-span-provenance.ts +41 -0
- package/src/okf/render.ts +11 -2
- package/src/recall-deep-rewrite.test.ts +199 -0
- package/src/recall-deep-rewrite.ts +50 -0
- package/src/transfer/export-okf.test.ts +77 -1
- package/src/transfer/export-okf.ts +25 -9
- package/dist/chunk-KWVXCRFZ.js.map +0 -1
- package/dist/chunk-M2BY5IZL.js.map +0 -1
- package/dist/chunk-YYDOUOYM.js.map +0 -1
- package/dist/chunk-ZPZLGN4Y.js.map +0 -1
- package/dist/{access-service-DcfM0Vf0.d.ts → access-service-LbwWl05g.d.ts} +64 -64
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
- /package/dist/{chunk-XN33JLRF.js.map → chunk-46XRYYOJ.js.map} +0 -0
- /package/dist/{chunk-WD424KYT.js.map → chunk-4L7OKRGP.js.map} +0 -0
- /package/dist/{chunk-245QROHZ.js.map → chunk-6SRUPUTY.js.map} +0 -0
- /package/dist/{chunk-ZIGSNLYI.js.map → chunk-A6HVSRGM.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-AU7Q3LSC.js.map} +0 -0
- /package/dist/{chunk-7BS5UVXA.js.map → chunk-AWMS3IFB.js.map} +0 -0
- /package/dist/{chunk-HJQZQUPC.js.map → chunk-BE4Y6GK6.js.map} +0 -0
- /package/dist/{chunk-D3AUQXTJ.js.map → chunk-BT7AQZQX.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-BUKK5SWA.js.map} +0 -0
- /package/dist/{chunk-CEH2AFXG.js.map → chunk-C24UZSFW.js.map} +0 -0
- /package/dist/{chunk-HCERYDRI.js.map → chunk-CJTZO5MW.js.map} +0 -0
- /package/dist/{chunk-4QKWBVEE.js.map → chunk-CR73YTWC.js.map} +0 -0
- /package/dist/{chunk-LTWFU6VJ.js.map → chunk-DDAHG5ZD.js.map} +0 -0
- /package/dist/{chunk-S47XNAWD.js.map → chunk-EU5PDHU2.js.map} +0 -0
- /package/dist/{chunk-KT3ERTF6.js.map → chunk-F3H7VNM4.js.map} +0 -0
- /package/dist/{chunk-EG4FHU5C.js.map → chunk-FJP6MVRK.js.map} +0 -0
- /package/dist/{chunk-7FLINMUE.js.map → chunk-GEHEBLVY.js.map} +0 -0
- /package/dist/{chunk-G3B3LP6A.js.map → chunk-GRZYF6KK.js.map} +0 -0
- /package/dist/{chunk-E2PORO7O.js.map → chunk-H6VYVOVP.js.map} +0 -0
- /package/dist/{chunk-QKTGCL6M.js.map → chunk-HGRRJDUH.js.map} +0 -0
- /package/dist/{chunk-J2R275FN.js.map → chunk-HQJM3BKH.js.map} +0 -0
- /package/dist/{chunk-ZRQPX2DW.js.map → chunk-I3X5NWDU.js.map} +0 -0
- /package/dist/{chunk-TGKLVAML.js.map → chunk-I7FVQMAA.js.map} +0 -0
- /package/dist/{chunk-CNZVEU4X.js.map → chunk-IE7N2YK6.js.map} +0 -0
- /package/dist/{chunk-X5SDZMO7.js.map → chunk-JGXMA6HL.js.map} +0 -0
- /package/dist/{chunk-SQEIPTDV.js.map → chunk-JKXPFIPC.js.map} +0 -0
- /package/dist/{chunk-Y2ECPAJI.js.map → chunk-K5JFIA44.js.map} +0 -0
- /package/dist/{chunk-JNZSNJ43.js.map → chunk-K7VTD5AZ.js.map} +0 -0
- /package/dist/{chunk-E62M4H4M.js.map → chunk-KDCPIXIY.js.map} +0 -0
- /package/dist/{chunk-TS37MXC7.js.map → chunk-KZAN4JXY.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-5E7KXID5.js.map → chunk-M3BFW3VX.js.map} +0 -0
- /package/dist/{chunk-VSQG4AXL.js.map → chunk-MUYJQ273.js.map} +0 -0
- /package/dist/{chunk-5KVMT25I.js.map → chunk-MWLBRFLY.js.map} +0 -0
- /package/dist/{chunk-2OXBS2LV.js.map → chunk-NROLO2HY.js.map} +0 -0
- /package/dist/{chunk-RLEJULGN.js.map → chunk-OMA2B7GY.js.map} +0 -0
- /package/dist/{chunk-TXCLDIXJ.js.map → chunk-OQT34EVH.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-OWHERGF2.js.map} +0 -0
- /package/dist/{chunk-4PWANX5V.js.map → chunk-PKRYQ222.js.map} +0 -0
- /package/dist/{chunk-DJLH3XWM.js.map → chunk-QMIKXIAM.js.map} +0 -0
- /package/dist/{chunk-Y6KDJQLK.js.map → chunk-QRHKJT7F.js.map} +0 -0
- /package/dist/{chunk-7MOYAT4Y.js.map → chunk-QXDICB4J.js.map} +0 -0
- /package/dist/{chunk-KWLDB64F.js.map → chunk-QZPSIQRB.js.map} +0 -0
- /package/dist/{chunk-54BRW3BL.js.map → chunk-REJCULWA.js.map} +0 -0
- /package/dist/{chunk-ISX7JODR.js.map → chunk-SBUQ4KIE.js.map} +0 -0
- /package/dist/{chunk-HPGXB56F.js.map → chunk-STUPJFG7.js.map} +0 -0
- /package/dist/{chunk-LPSTQR26.js.map → chunk-SV3MDTJI.js.map} +0 -0
- /package/dist/{chunk-MK7EJLB4.js.map → chunk-UJICQ77Y.js.map} +0 -0
- /package/dist/{chunk-4PHT7KE2.js.map → chunk-UUGU26P2.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-UVYI6VIX.js.map} +0 -0
- /package/dist/{chunk-QB66LBXA.js.map → chunk-WGVAEVT7.js.map} +0 -0
- /package/dist/{chunk-2L5FSNPC.js.map → chunk-X2NFFBTO.js.map} +0 -0
- /package/dist/{chunk-EMAEDM2J.js.map → chunk-YWD5UIWY.js.map} +0 -0
- /package/dist/{chunk-C6TMLF3A.js.map → chunk-ZFE7NXB7.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/okf/lint.ts","../src/okf/render.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { MAGIC_BYTES } from \"../secure-store/secure-fs.js\";\nimport { OKF_RESERVED_BASENAMES } from \"./type-mapping.js\";\n\nexport interface OkfLintFinding {\n file: string;\n code: \"missing_frontmatter\" | \"missing_type\" | \"empty_type\" | \"reserved_basename\" | \"skipped_encrypted\";\n message: string;\n}\n\nexport interface OkfLintResult {\n ok: boolean;\n scanned: number;\n findings: OkfLintFinding[];\n}\n\nfunction isEncryptedBlob(raw: string): boolean {\n // secure-store writes a binary envelope starting with MAGIC_BYTES at offset\n // 0 — match that fixed position, never a substring anywhere in the file.\n return raw.startsWith(MAGIC_BYTES.toString(\"ascii\"));\n}\n\nfunction hasFrontmatter(raw: string): boolean {\n return raw.startsWith(\"---\\n\") || raw.startsWith(\"---\\r\\n\");\n}\n\nfunction readType(raw: string): string | undefined {\n const close = raw.indexOf(\"\\n---\", 4);\n if (close === -1) return undefined;\n const block = raw.slice(4, close);\n const match = /^type:[ \\t]*(.*)$/m.exec(block);\n if (!match) return undefined;\n const value = match[1]!.trim().replace(/^[\"']|[\"']$/g, \"\");\n return value;\n}\n\nfunction walkMarkdown(root: string, out: string[]): void {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(root, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {\n if (entry.name === \"state\" || entry.name === \".git\") continue;\n const full = path.join(root, entry.name);\n let stat: fs.Stats;\n try {\n stat = fs.lstatSync(full);\n } catch {\n continue;\n }\n if (stat.isSymbolicLink()) continue;\n if (stat.isDirectory()) {\n walkMarkdown(full, out);\n continue;\n }\n if (stat.isFile() && entry.name.endsWith(\".md\")) out.push(full);\n }\n}\n\nexport function lintOkfDir(memoryDir: string): OkfLintResult {\n const files: string[] = [];\n walkMarkdown(memoryDir, files);\n const findings: OkfLintFinding[] = [];\n for (const file of files) {\n const rel = path.relative(memoryDir, file);\n const base = path.basename(file);\n if (OKF_RESERVED_BASENAMES[base] === true) {\n findings.push({\n file: rel,\n code: \"reserved_basename\",\n message: `${base} is reserved by OKF §6/§7`,\n });\n continue;\n }\n let raw: string;\n try {\n raw = fs.readFileSync(file, \"utf8\");\n } catch {\n continue;\n }\n if (isEncryptedBlob(raw)) {\n findings.push({\n file: rel,\n code: \"skipped_encrypted\",\n message: \"skipped (encrypted)\",\n });\n continue;\n }\n if (!hasFrontmatter(raw)) {\n findings.push({\n file: rel,\n code: \"missing_frontmatter\",\n message: \"missing YAML frontmatter\",\n });\n continue;\n }\n const type = readType(raw);\n if (type === undefined) {\n findings.push({ file: rel, code: \"missing_type\", message: \"missing type\" });\n } else if (type.length === 0) {\n findings.push({ file: rel, code: \"empty_type\", message: \"empty type\" });\n }\n }\n const actionable = findings.filter((f) => f.code !== \"skipped_encrypted\");\n return { ok: actionable.length === 0, scanned: files.length, findings };\n}\n","/**\n * Shared OKF bundle-rendering helpers (issues #1948 + #1950).\n *\n * One source of truth for the mechanics every OKF bundle exporter uses:\n * deterministic frontmatter rendering, staging-directory file writes, the\n * symlink-guarded atomic publish, and the bundle version stamp. The memory\n * exporter (transfer/export-okf.ts) and the codegraph exporter\n * (coding/export-okf-codegraph.ts) both consume this module so their\n * bundles are byte-compatible in convention (rule 38 — deterministic\n * rendering discipline; rule 9 — stable seam over shared mechanics).\n */\nimport { lstatSync, mkdirSync, readdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\n/** OKF spec version emitted in every bundle root index. */\nexport const OKF_EXPORT_VERSION = \"0.1\";\n\n/**\n * Render a YAML frontmatter block from a flat field map.\n *\n * Key order: the canonical OKF keys first (`type`, `title`, `description`,\n * `tags`, `timestamp`), everything else alphabetical — one deterministic\n * layout so identical inputs always render byte-identical files. A key set\n * to `undefined` is omitted; callers must not pass a key twice.\n */\nexport function renderFrontmatter(fields: Record<string, unknown>): string {\n const keys = Object.keys(fields).sort((a, b) => {\n const order = [\"type\", \"title\", \"description\", \"tags\", \"timestamp\"];\n const ai = order.indexOf(a);\n const bi = order.indexOf(b);\n if (ai >= 0 || bi >= 0) return (ai < 0 ? 99 : ai) - (bi < 0 ? 99 : bi);\n return a.localeCompare(b);\n });\n const lines = keys.flatMap((key) => yamlLine(key, fields[key]));\n return `---\\n${lines.join(\"\\n\")}\\n---\\n\\n`;\n}\n\nfunction yamlLine(key: string, value: unknown): string[] {\n if (value === undefined) return [];\n if (Array.isArray(value)) {\n if (value.length === 0) return [`${key}: []`];\n if (value.every((item) => typeof item !== \"object\" || item === null)) {\n return [`${key}:`, ...value.map((item) => ` - ${yamlScalar(item)}`)];\n }\n return [`${key}: ${JSON.stringify(value)}`];\n }\n if (typeof value === \"object\" && value !== null) return [`${key}: ${JSON.stringify(value)}`];\n return [`${key}: ${yamlScalar(value)}`];\n}\n\nfunction yamlScalar(value: unknown): string {\n if (typeof value === \"string\") {\n if (value === \"\" || /[:#\\n]/.test(value) || value !== value.trim()) return JSON.stringify(value);\n return value;\n }\n return String(value);\n}\n\n/**\n * Write one file into a bundle staging tree. `rel` is a POSIX-style\n * bundle-relative path; parent directories are created as needed.\n */\nexport function writeBundleFile(root: string, rel: string, content: string): void {\n const dest = path.join(root, ...rel.split(\"/\"));\n mkdirSync(path.dirname(dest), { recursive: true });\n writeFileSync(dest, content, \"utf8\");\n}\n\n/**\n * Publish a staged bundle: refuse a non-empty target without `--force`,\n * swap via rename so the target is never observed half-written, and keep a\n * restorable backup when replacing an existing tree.\n */\nexport function publishBundle(staging: string, outDir: string, force: boolean): void {\n let exists = false;\n try {\n const stat = lstatSync(outDir);\n if (stat.isSymbolicLink()) throw new Error(`--out must not be a symlink: ${outDir}`);\n exists = true;\n const entries = readdirSync(outDir).filter((name) => name !== \".\" && name !== \"..\");\n if (entries.length > 0 && !force) {\n rmSync(staging, { recursive: true, force: true });\n throw new Error(`--out ${outDir} is not empty; pass --force to replace it`);\n }\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n mkdirSync(path.dirname(outDir), { recursive: true });\n if (exists && force) {\n const backup = `${outDir}.okf-prev`;\n try {\n renameSync(outDir, backup);\n } catch {\n rmSync(staging, { recursive: true, force: true });\n throw new Error(`cannot replace --out ${outDir}`);\n }\n try {\n renameSync(staging, outDir);\n rmSync(backup, { recursive: true, force: true });\n } catch (err) {\n try {\n renameSync(backup, outDir);\n } catch {\n // Keep backup if restore fails.\n }\n throw err;\n }\n return;\n }\n renameSync(staging, outDir);\n}\n\n/**\n * Reject a --out path with a symlink anywhere in its component chain\n * (pattern 42 + hermes-shim precedent): a symlinked component could aim\n * the atomic rename outside the operator's chosen directory.\n */\nexport function rejectSymlinkPath(target: string): void {\n let current = path.resolve(target);\n while (true) {\n try {\n if (lstatSync(current).isSymbolicLink()) {\n throw new Error(`--out path component is a symlink: ${current}`);\n }\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const parent = path.dirname(current);\n if (parent === current) break;\n current = parent;\n }\n}\n\n"],"mappings":";;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAiBjB,SAAS,gBAAgB,KAAsB;AAG7C,SAAO,IAAI,WAAW,YAAY,SAAS,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IAAI,MAAM,sCAAsC,OAAO,EAAE;AAAA,MACjE;AAAA,IACF,SAAS,KAAK;AACZ,UAAK,IAA8B,SAAS,SAAU,OAAM;AAAA,IAC9D;AACA,UAAM,SAASA,MAAK,QAAQ,OAAO;AACnC,QAAI,WAAW,QAAS;AACxB,cAAU;AAAA,EACZ;AACF;","names":["path"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transfer/export-okf.ts"],"sourcesContent":["import { rmSync } from \"node:fs\";\nimport { mkdtemp } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { parseOaiMemCitation } from \"../citations.js\";\nimport { inferMemoryStatus } from \"../memory-lifecycle-ledger-utils.js\";\nimport { normalizeProjectionPreview } from \"../memory-projection-format.js\";\nimport { lintOkfDir } from \"../okf/lint.js\";\nimport { okfTypeForMemory, OKF_PROFILE_TYPE } from \"../okf/type-mapping.js\";\nimport {\n OKF_EXPORT_VERSION,\n publishBundle,\n renderFrontmatter,\n rejectSymlinkPath,\n writeBundleFile,\n} from \"../okf/render.js\";\n// Re-exported for the existing `@remnic/core/export-okf` consumers and tests\n// (one public surface; the value itself now lives in okf/render.ts).\nexport { OKF_EXPORT_VERSION };\nimport { StorageManager } from \"../storage.js\";\nimport type { MemoryFile, MemoryLink, MemoryStatus } from \"../types.js\";\n\n// Shared bundle mechanics (frontmatter, publish, symlink guard, file write)\n// live in ../okf/render.ts — one source of truth for every OKF exporter.\nexport const OKF_LOG_TRUNCATION_MARKER = \"<!-- okf-log-truncated -->\";\nexport const DEFAULT_OKF_LOG_MAX_ENTRIES = 500;\n\nconst MEMORY_STATUSES: readonly MemoryStatus[] = [\n \"active\",\n \"pending_review\",\n \"rejected\",\n \"quarantined\",\n \"superseded\",\n \"archived\",\n \"forgotten\",\n];\n\nexport interface ExportOkfOptions {\n memoryDir: string;\n outDir: string;\n includeStatus?: readonly string[];\n includeCategories?: readonly string[];\n excludeTags?: readonly string[];\n includeProfile?: boolean;\n includeWearables?: boolean;\n includeLog?: boolean;\n logMaxEntries?: number;\n force?: boolean;\n}\n\nexport interface ExportOkfResult {\n exported: number;\n excluded: number;\n byCategory: Record<string, number>;\n plaintextWarning: boolean;\n}\n\nexport function parseIncludeStatus(raw: unknown): MemoryStatus[] {\n const values = splitCsv(raw);\n if (values.length === 0) return [\"active\"];\n const allowed = new Set<string>(MEMORY_STATUSES);\n for (const value of values) {\n if (!allowed.has(value)) {\n throw new Error(`invalid --include-status ${value}; allowed: ${MEMORY_STATUSES.join(\", \")}`);\n }\n }\n return values as MemoryStatus[];\n}\n\nexport async function exportOkfBundle(opts: ExportOkfOptions): Promise<ExportOkfResult> {\n const outDir = path.resolve(opts.outDir);\n rejectSymlinkPath(outDir);\n const includeStatus = new Set(parseIncludeStatus(opts.includeStatus));\n const includeCategories = opts.includeCategories?.length ? new Set(opts.includeCategories) : null;\n const excludeTags = new Set(opts.excludeTags ?? []);\n const storage = new StorageManager(opts.memoryDir);\n const memories = await storage.readAllMemories();\n const included: MemoryFile[] = [];\n let excluded = 0;\n for (const memory of memories) {\n const rel = toRel(memory.path, opts.memoryDir);\n if (!opts.includeWearables && rel.startsWith(\"wearables/\")) {\n excluded += 1;\n continue;\n }\n const status = inferMemoryStatus(memory.frontmatter, memory.path);\n if (!includeStatus.has(status)) {\n excluded += 1;\n continue;\n }\n if (includeCategories && !includeCategories.has(memory.frontmatter.category)) {\n excluded += 1;\n continue;\n }\n if ((memory.frontmatter.tags ?? []).some((tag) => excludeTags.has(tag))) {\n excluded += 1;\n continue;\n }\n included.push(memory);\n }\n included.sort((a, b) => toRel(a.path, opts.memoryDir).localeCompare(toRel(b.path, opts.memoryDir)));\n\n const staging = await mkdtemp(path.join(os.tmpdir(), \"remnic-okf-export-\"));\n const byCategory: Record<string, number> = {};\n const idToRel = new Map<string, string>();\n for (const memory of included) {\n const rel = toRel(memory.path, opts.memoryDir);\n idToRel.set(memory.frontmatter.id, rel);\n }\n for (const memory of included) {\n const rel = toRel(memory.path, opts.memoryDir);\n const rendered = renderMemory(memory, rel, idToRel);\n writeBundleFile(staging, rel, rendered);\n const category = memory.frontmatter.category;\n byCategory[category] = (byCategory[category] ?? 0) + 1;\n }\n\n if (opts.includeProfile) {\n try {\n const profile = await storage.readProfile();\n if (profile) {\n writeBundleFile(\n staging,\n \"profile.md\",\n renderFrontmatter({\n type: OKF_PROFILE_TYPE,\n title: \"User Profile\",\n timestamp: new Date(0).toISOString(),\n }) + profile.replace(/^\\uFEFF/, \"\"),\n );\n }\n } catch {\n // Profile is optional even when requested.\n }\n }\n\n if (opts.includeLog) {\n const events = await storage.readAllMemoryLifecycleEvents();\n writeBundleFile(staging, \"log.md\", renderLog(events, idToRel, opts.logMaxEntries ?? DEFAULT_OKF_LOG_MAX_ENTRIES));\n }\n\n writeIndexes(staging, included, opts.memoryDir);\n const lint = lintOkfDir(staging);\n const blocking = lint.findings.filter((f) => f.code !== \"skipped_encrypted\" && f.code !== \"reserved_basename\");\n if (blocking.length > 0) {\n rmSync(staging, { recursive: true, force: true });\n throw new Error(`OKF export failed lint: ${blocking.map((f) => `${f.file}: ${f.message}`).join(\"; \")}`);\n }\n\n publishBundle(staging, outDir, opts.force === true);\n return {\n exported: included.length,\n excluded,\n byCategory,\n plaintextWarning: true,\n };\n}\n\n\nfunction renderMemory(memory: MemoryFile, rel: string, idToRel: Map<string, string>): string {\n const fm = memory.frontmatter;\n const title = firstHeading(memory.content) ?? `${humanize(fm.category)} ${fm.created.slice(0, 10)}`;\n const type = fm.type ?? okfTypeForMemory(fm);\n const fields: Record<string, unknown> = {\n ...fm,\n type,\n title,\n description: normalizeProjectionPreview(memory.content),\n tags: fm.tags ?? [],\n timestamp: fm.updated,\n };\n if (fm.artifactType) fields.resource = rel;\n let body = memory.content.trim();\n const citation = parseOaiMemCitation(body);\n if (citation) {\n const start = body.indexOf(\"<oai-mem-citation>\");\n const end = body.indexOf(\"</oai-mem-citation>\");\n if (start >= 0 && end > start) {\n body = `${body.slice(0, start).trimEnd()}\\n\\n${body.slice(end + \"</oai-mem-citation>\".length).trimStart()}`.trim();\n }\n const lines = citation.entries.map((entry, index) => `${index + 1}. [${entry.path}](${entry.path})`);\n body = `${body}\\n\\n# Citations\\n\\n${lines.join(\"\\n\")}\\n`;\n }\n const links = fm.links ?? [];\n if (links.length > 0) {\n body += `\\n# Related\\n\\n${links.map((link) => renderRelated(link, idToRel)).join(\"\\n\")}\\n`;\n }\n return renderFrontmatter(fields) + body + (body.endsWith(\"\\n\") ? \"\" : \"\\n\");\n}\n\nfunction renderRelated(link: MemoryLink, idToRel: Map<string, string>): string {\n const target = idToRel.get(link.targetId) ?? link.targetId;\n const href = target.startsWith(\"/\") ? target : `/${target}`;\n return `- ${link.linkType}: [${link.targetId}](${href})`;\n}\n\nfunction writeIndexes(root: string, memories: MemoryFile[], memoryDir: string): void {\n const groups = new Map<string, MemoryFile[]>();\n for (const memory of memories) {\n const rel = toRel(memory.path, memoryDir);\n const dir = path.posix.dirname(rel);\n const key = dir === \".\" ? \"\" : dir.split(\"/\")[0] ?? \"\";\n const list = groups.get(key) ?? [];\n list.push(memory);\n groups.set(key, list);\n }\n const sections = [...groups.keys()].sort().map((key) => {\n const heading = key === \"\" ? \"Root\" : humanize(key);\n const lines = (groups.get(key) ?? [])\n .sort((a, b) => toRel(a.path, memoryDir).localeCompare(toRel(b.path, memoryDir)))\n .map((memory) => {\n const rel = toRel(memory.path, memoryDir);\n const title = firstHeading(memory.content) ?? memory.frontmatter.id;\n const description = normalizeProjectionPreview(memory.content);\n return `* [${title}](/${rel}) - ${description}`;\n });\n return `## ${heading}\\n\\n${lines.join(\"\\n\")}`;\n });\n writeBundleFile(root, \"index.md\", `---\\nokf_version: \"${OKF_EXPORT_VERSION}\"\\n---\\n\\n${sections.join(\"\\n\\n\")}\\n`);\n}\n\nfunction renderLog(\n events: Array<{ timestamp?: string; type?: string; action?: string; memoryId?: string }>,\n idToRel: Map<string, string>,\n maxEntries: number,\n): string {\n const sorted = [...events].sort((a, b) => String(b.timestamp ?? \"\").localeCompare(String(a.timestamp ?? \"\")));\n const truncated = sorted.length > maxEntries;\n const kept = sorted.slice(0, maxEntries);\n const byDay = new Map<string, typeof kept>();\n for (const event of kept) {\n const day = String(event.timestamp ?? \"\").slice(0, 10) || \"unknown\";\n const list = byDay.get(day) ?? [];\n list.push(event);\n byDay.set(day, list);\n }\n const days = [...byDay.keys()].sort((a, b) => b.localeCompare(a));\n const parts = [\"# Log\", \"\"];\n for (const day of days) {\n parts.push(`## ${day}`, \"\");\n for (const event of byDay.get(day) ?? []) {\n const action = boldAction(event.type ?? event.action ?? \"Update\");\n const id = event.memoryId;\n const rel = id ? idToRel.get(id) : undefined;\n const target = rel ? `[${id}](/${rel})` : id ?? \"\";\n parts.push(`- **${action}** ${target}`.trimEnd());\n }\n parts.push(\"\");\n }\n if (truncated) parts.push(OKF_LOG_TRUNCATION_MARKER, \"\");\n return `${parts.join(\"\\n\")}\\n`;\n}\n\nfunction boldAction(raw: string): string {\n const lower = raw.toLowerCase();\n if (lower.includes(\"create\") || lower.includes(\"add\")) return \"Creation\";\n if (lower.includes(\"deprecat\") || lower.includes(\"delete\") || lower.includes(\"archiv\")) return \"Deprecation\";\n return \"Update\";\n}\n\n\nfunction firstHeading(content: string): string | undefined {\n for (const line of content.split(\"\\n\")) {\n const match = /^#\\s+(.+)$/.exec(line.trim());\n if (match) return match[1]!.trim();\n }\n return undefined;\n}\n\nfunction humanize(value: string): string {\n return value.replace(/[_-]/g, \" \").replace(/\\b\\w/g, (ch) => ch.toUpperCase());\n}\n\n\n\nfunction splitCsv(raw: unknown): string[] {\n if (raw === undefined || raw === null || raw === \"\") return [];\n const parts = Array.isArray(raw) ? raw.map(String) : String(raw).split(\",\");\n return parts.map((part) => part.trim()).filter((part) => part.length > 0);\n}\n\nfunction toRel(abs: string, root: string): string {\n return path.relative(path.resolve(root), path.resolve(abs)).split(path.sep).join(\"/\");\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;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O,GAAG,YAAY,CAAC;AAC9E;AAIA,SAAS,SAAS,KAAwB;AACxC,MAAI,QAAQ,UAAa,QAAQ,QAAQ,QAAQ,GAAI,QAAO,CAAC;AAC7D,QAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,OAAO,GAAG,EAAE,MAAM,GAAG;AAC1E,SAAO,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;AAC1E;AAEA,SAAS,MAAM,KAAa,MAAsB;AAChD,SAAO,KAAK,SAAS,KAAK,QAAQ,IAAI,GAAG,KAAK,QAAQ,GAAG,CAAC,EAAE,MAAM,KAAK,GAAG,EAAE,KAAK,GAAG;AACtF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connectors/codex-materialize-runner.ts","../src/namespaces/path.ts"],"sourcesContent":["/**\n * codex-materialize-runner.ts — Thin I/O bridge for the Codex materializer.\n *\n * The pure rendering logic lives in {@link ./codex-materialize.js}. This file\n * is the place callers (consolidation hooks, CLI, session-end hook) go when\n * they want the whole \"load memories from storage → render → write\" flow.\n *\n * Kept deliberately small so #378 never has to reach into orchestrator.ts /\n * importance.ts — the two files Wave 1 agents are editing concurrently.\n */\n\nimport { existsSync } from \"node:fs\";\n\nimport { log } from \"../logger.js\";\nimport { resolveNamespaceChildRoot } from \"../namespaces/path.js\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport { projectProceduresToSkills } from \"../procedural/skill-projection.js\";\nimport { BUILTIN_SKILLS } from \"../skills-registry.js\";\nimport { StorageManager } from \"../storage.js\";\nimport { excludeSupportPassportPrivateMemories } from \"../support-passport/card-projection.js\";\nimport type { PluginConfig, MemoryFile } from \"../types.js\";\nimport {\n hasCodexMaterializeSentinel,\n materializeForNamespace,\n type MaterializeResult,\n type RolloutSummaryInput,\n} from \"./codex-materialize.js\";\n\n/** Options accepted by the shared post-consolidation materialize helper. */\nexport interface PostConsolidationMaterializeOptions {\n config: PluginConfig;\n namespace?: string;\n memories?: MemoryFile[];\n memoryDir?: string;\n codexHome?: string;\n rolloutSummaries?: RolloutSummaryInput[];\n now?: Date;\n}\n\n/** Options accepted by the runner. */\nexport interface RunMaterializeOptions {\n /** Remnic config — we only read the `codexMaterialize*` fields. */\n config: PluginConfig;\n /** Namespace to materialize. Overrides the config's `codexMaterializeNamespace`. */\n namespace?: string;\n /** Override the memory directory (defaults to `config.memoryDir`). */\n memoryDir?: string;\n /** Override `<codex_home>` (useful for tests). */\n codexHome?: string;\n /** Optional pre-loaded memories (bypasses disk read — used in tests). */\n memories?: MemoryFile[];\n /** Optional rollout summaries supplied by the caller. */\n rolloutSummaries?: RolloutSummaryInput[];\n /** Current time injection for deterministic runs. */\n now?: Date;\n /** Reason string — logged for observability. */\n reason?: \"consolidation\" | \"session_end\" | \"manual\" | \"cli\";\n}\n\n/**\n * Run the Codex materialization end-to-end. Returns `null` when the feature\n * is disabled in config or when the user hasn't opted in via the sentinel.\n * Never throws for \"expected\" skips; only throws on schema validation or I/O\n * errors that callers actually need to surface.\n */\nexport async function runCodexMaterialize(\n options: RunMaterializeOptions,\n): Promise<MaterializeResult | null> {\n const cfg = options.config;\n if (!cfg.codexMaterializeMemories) {\n log.debug(`[codex-materialize] skipped — codexMaterializeMemories=false`);\n return null;\n }\n\n // Per-trigger gate: session-end runs must honor codexMaterializeOnSessionEnd.\n // The Codex Stop hook (remnic-codex-hook.cjs, session-end event) passes\n // reason=\"session_end\"; when the user has turned off the session-end trigger\n // we short-circuit here without touching disk.\n if (options.reason === \"session_end\" && cfg.codexMaterializeOnSessionEnd === false) {\n log.debug(\n `[codex-materialize] skipped — session-end disabled via codexMaterializeOnSessionEnd=false`,\n );\n return null;\n }\n\n const namespace = resolveNamespace(options.namespace, cfg);\n const memoryDir = options.memoryDir ?? cfg.memoryDir;\n const codexHome = options.codexHome ?? cfg.codex?.codexHome ?? undefined;\n if (!memoryDir) {\n log.warn(`[codex-materialize] skipped — no memoryDir available`);\n return null;\n }\n\n let memories: MemoryFile[];\n if (options.memories) {\n memories = options.memories;\n } else {\n if (!hasCodexMaterializeSentinel(codexHome)) {\n return materializeForNamespace(namespace, {\n memories: [],\n codexHome,\n maxSummaryTokens: cfg.codexMaterializeMaxSummaryTokens,\n rolloutRetentionDays: cfg.codexMaterializeRolloutRetentionDays,\n rolloutSummaries: options.rolloutSummaries,\n now: options.now,\n });\n }\n const nsDir = resolveNamespaceDir(memoryDir, namespace, cfg);\n const storage = new StorageManager(nsDir);\n memories = await storage.readAllMemories();\n }\n memories = excludeSupportPassportPrivateMemories(memories);\n\n // Skill projection (issue #2369). Gated on `procedural.enabled` AND\n // `procedural.skillProjection.enabled`; `maxSkills: 0` disables it too.\n // Passing `undefined` leaves `skills/` untouched, so a disabled gate never\n // deletes a folder the user curated.\n const skillProjection = cfg.procedural?.skillProjection;\n const skills =\n cfg.procedural?.enabled === true && skillProjection?.enabled === true\n ? projectProceduresToSkills(memories, {\n maxSkills: skillProjection.maxSkills,\n reservedSlugs: BUILTIN_SKILLS.map((skill) => skill.slug),\n })\n : undefined;\n\n // Intentionally NOT catching here: per the JSDoc contract above,\n // schema-validation and I/O errors from `materializeForNamespace` must\n // surface to callers so they can exit non-zero (CLI) or log + recover\n // (consolidation post-hook, which has its own narrower try/catch).\n // Catching everything would make a broken MEMORY.md render look like a\n // successful skip, and invisible failures are strictly worse than loud\n // ones for a feature that writes to `~/.codex/memories`.\n const result = materializeForNamespace(namespace, {\n memories,\n codexHome,\n maxSummaryTokens: cfg.codexMaterializeMaxSummaryTokens,\n rolloutRetentionDays: cfg.codexMaterializeRolloutRetentionDays,\n rolloutSummaries: options.rolloutSummaries,\n skills,\n now: options.now,\n });\n if (options.reason) {\n log.debug(\n `[codex-materialize] ran reason=${options.reason} wrote=${result.wrote} files=${result.filesWritten.length}`,\n );\n }\n return result;\n}\n\n/**\n * Shared helper for post-consolidation materialize hooks.\n *\n * `materializeAfterSemanticConsolidation` and `materializeAfterCausalConsolidation`\n * used to be two nearly-identical copies of this logic; keeping the actual\n * body here means any future guard/logging change happens in one place.\n *\n * The only per-caller knob is `logPrefix`, which is used to tag the\n * non-fatal warning emitted when the materializer throws.\n */\nexport async function runPostConsolidationMaterialize(\n logPrefix: string,\n options: PostConsolidationMaterializeOptions,\n): Promise<MaterializeResult | null> {\n if (!options.config.codexMaterializeMemories) return null;\n if (!options.config.codexMaterializeOnConsolidation) return null;\n try {\n return await runCodexMaterialize({\n config: options.config,\n namespace: options.namespace,\n memories: options.memories,\n memoryDir: options.memoryDir,\n codexHome: options.codexHome,\n rolloutSummaries: options.rolloutSummaries,\n now: options.now,\n reason: \"consolidation\",\n });\n } catch (error) {\n log.warn(\n `${logPrefix} Codex materialize post-hook failed (non-fatal): ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n return null;\n }\n}\n\nfunction resolveNamespace(override: string | undefined, cfg: PluginConfig): string {\n const requested = (override ?? cfg.codexMaterializeNamespace ?? \"auto\").trim();\n const defaultNamespace = (cfg.defaultNamespace ?? \"\").trim();\n const namespace =\n requested.length === 0 || requested === \"auto\"\n ? (defaultNamespace.length > 0 ? defaultNamespace : \"default\")\n : requested;\n if (!isSafeRouteNamespace(namespace)) {\n throw new Error(`invalid materialize namespace: ${namespace}`);\n }\n return namespace;\n}\n\n/**\n * Resolve the on-disk storage root for a namespace, matching\n * `NamespaceStorageRouter` in `packages/remnic-core/src/namespaces/storage.ts`.\n *\n * Contract:\n * - When namespaces are disabled, every namespace maps to `memoryDir` itself.\n * - When namespaces are enabled, non-default namespaces always live under\n * `memoryDir/namespaces/<namespace>`.\n * - The default namespace prefers `memoryDir/namespaces/<defaultNamespace>`\n * when that directory already exists (migrated install); otherwise it\n * falls back to the legacy `memoryDir` root so materialization does not\n * silently switch directories out from under an existing install.\n */\nfunction resolveNamespaceDir(\n memoryDir: string,\n namespace: string,\n cfg: PluginConfig,\n): string {\n if (!cfg.namespacesEnabled) return memoryDir;\n\n const configuredDefaultNamespace = (cfg.defaultNamespace ?? \"\").trim();\n const defaultNamespace =\n configuredDefaultNamespace.length > 0 ? configuredDefaultNamespace : \"default\";\n const ns = (namespace || defaultNamespace).trim();\n if (!isSafeRouteNamespace(ns)) {\n throw new Error(`invalid materialize namespace: ${ns}`);\n }\n const namespacedRoot = resolveNamespaceChildRoot(memoryDir, ns, \"materialize namespace path\");\n\n if (ns === defaultNamespace) {\n return existsSync(namespacedRoot) ? namespacedRoot : memoryDir;\n }\n return namespacedRoot;\n}\n","import path from \"node:path\";\n\nexport function assertNamespacePathInsideRoot(\n root: string,\n candidate: string,\n namespace: string,\n label = \"namespace path\",\n): void {\n const relative = path.relative(root, candidate);\n if (relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative))) {\n return;\n }\n throw new Error(`invalid ${label}: ${namespace}`);\n}\n\nexport function resolveNamespaceChildRoot(\n memoryDir: string,\n namespace: string,\n label = \"namespace path\",\n): string {\n const namespaceRoot = path.resolve(memoryDir, \"namespaces\");\n const candidate = path.resolve(namespaceRoot, namespace);\n assertNamespacePathInsideRoot(namespaceRoot, candidate, namespace, label);\n return candidate;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,kBAAkB;;;ACX3B,OAAO,UAAU;AAEV,SAAS,8BACd,MACA,WACA,WACA,QAAQ,kBACF;AACN,QAAM,WAAW,KAAK,SAAS,MAAM,SAAS;AAC9C,MAAI,aAAa,MAAO,CAAC,SAAS,WAAW,IAAI,KAAK,CAAC,KAAK,WAAW,QAAQ,GAAI;AACjF;AAAA,EACF;AACA,QAAM,IAAI,MAAM,WAAW,KAAK,KAAK,SAAS,EAAE;AAClD;AAEO,SAAS,0BACd,WACA,WACA,QAAQ,kBACA;AACR,QAAM,gBAAgB,KAAK,QAAQ,WAAW,YAAY;AAC1D,QAAM,YAAY,KAAK,QAAQ,eAAe,SAAS;AACvD,gCAA8B,eAAe,WAAW,WAAW,KAAK;AACx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AACrE,QAAM,mBACJ,2BAA2B,SAAS,IAAI,6BAA6B;AACvE,QAAM,MAAM,aAAa,kBAAkB,KAAK;AAChD,MAAI,CAAC,qBAAqB,EAAE,GAAG;AAC7B,UAAM,IAAI,MAAM,kCAAkC,EAAE,EAAE;AAAA,EACxD;AACA,QAAM,iBAAiB,0BAA0B,WAAW,IAAI,4BAA4B;AAE5F,MAAI,OAAO,kBAAkB;AAC3B,WAAO,WAAW,cAAc,IAAI,iBAAiB;AAAA,EACvD;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1029,24 +1029,24 @@ declare const SupportPassportDraftCardSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1029
1029
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
1030
1030
|
sourceMemoryIds: z.ZodArray<z.ZodString, "many">;
|
|
1031
1031
|
}, "strict", z.ZodTypeAny, {
|
|
1032
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1032
1033
|
title: string;
|
|
1033
1034
|
sourceMemoryIds: string[];
|
|
1034
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1035
1035
|
statement: string;
|
|
1036
1036
|
}, {
|
|
1037
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1037
1038
|
title: string;
|
|
1038
1039
|
sourceMemoryIds: string[];
|
|
1039
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1040
1040
|
statement: string;
|
|
1041
1041
|
}>, {
|
|
1042
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1042
1043
|
title: string;
|
|
1043
1044
|
sourceMemoryIds: string[];
|
|
1044
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1045
1045
|
statement: string;
|
|
1046
1046
|
}, {
|
|
1047
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1047
1048
|
title: string;
|
|
1048
1049
|
sourceMemoryIds: string[];
|
|
1049
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1050
1050
|
statement: string;
|
|
1051
1051
|
}>;
|
|
1052
1052
|
declare const SupportPassportDraftOutputSchema: z.ZodObject<{
|
|
@@ -1056,38 +1056,38 @@ declare const SupportPassportDraftOutputSchema: z.ZodObject<{
|
|
|
1056
1056
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
1057
1057
|
sourceMemoryIds: z.ZodArray<z.ZodString, "many">;
|
|
1058
1058
|
}, "strict", z.ZodTypeAny, {
|
|
1059
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1059
1060
|
title: string;
|
|
1060
1061
|
sourceMemoryIds: string[];
|
|
1061
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1062
1062
|
statement: string;
|
|
1063
1063
|
}, {
|
|
1064
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1064
1065
|
title: string;
|
|
1065
1066
|
sourceMemoryIds: string[];
|
|
1066
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1067
1067
|
statement: string;
|
|
1068
1068
|
}>, {
|
|
1069
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1069
1070
|
title: string;
|
|
1070
1071
|
sourceMemoryIds: string[];
|
|
1071
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1072
1072
|
statement: string;
|
|
1073
1073
|
}, {
|
|
1074
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1074
1075
|
title: string;
|
|
1075
1076
|
sourceMemoryIds: string[];
|
|
1076
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1077
1077
|
statement: string;
|
|
1078
1078
|
}>, "many">;
|
|
1079
1079
|
}, "strict", z.ZodTypeAny, {
|
|
1080
1080
|
cards: {
|
|
1081
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1081
1082
|
title: string;
|
|
1082
1083
|
sourceMemoryIds: string[];
|
|
1083
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1084
1084
|
statement: string;
|
|
1085
1085
|
}[];
|
|
1086
1086
|
}, {
|
|
1087
1087
|
cards: {
|
|
1088
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1088
1089
|
title: string;
|
|
1089
1090
|
sourceMemoryIds: string[];
|
|
1090
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1091
1091
|
statement: string;
|
|
1092
1092
|
}[];
|
|
1093
1093
|
}>;
|
|
@@ -1097,34 +1097,34 @@ declare const SupportPassportDraftModelInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1097
1097
|
memoryId: z.ZodString;
|
|
1098
1098
|
content: z.ZodString;
|
|
1099
1099
|
}, "strict", z.ZodTypeAny, {
|
|
1100
|
-
memoryId: string;
|
|
1101
1100
|
content: string;
|
|
1102
|
-
}, {
|
|
1103
1101
|
memoryId: string;
|
|
1102
|
+
}, {
|
|
1104
1103
|
content: string;
|
|
1104
|
+
memoryId: string;
|
|
1105
1105
|
}>, "many">;
|
|
1106
1106
|
}, "strict", z.ZodTypeAny, {
|
|
1107
1107
|
memories: {
|
|
1108
|
-
memoryId: string;
|
|
1109
1108
|
content: string;
|
|
1109
|
+
memoryId: string;
|
|
1110
1110
|
}[];
|
|
1111
1111
|
consent: true;
|
|
1112
1112
|
}, {
|
|
1113
1113
|
memories: {
|
|
1114
|
-
memoryId: string;
|
|
1115
1114
|
content: string;
|
|
1115
|
+
memoryId: string;
|
|
1116
1116
|
}[];
|
|
1117
1117
|
consent: true;
|
|
1118
1118
|
}>, {
|
|
1119
1119
|
memories: {
|
|
1120
|
-
memoryId: string;
|
|
1121
1120
|
content: string;
|
|
1121
|
+
memoryId: string;
|
|
1122
1122
|
}[];
|
|
1123
1123
|
consent: true;
|
|
1124
1124
|
}, {
|
|
1125
1125
|
memories: {
|
|
1126
|
-
memoryId: string;
|
|
1127
1126
|
content: string;
|
|
1127
|
+
memoryId: string;
|
|
1128
1128
|
}[];
|
|
1129
1129
|
consent: true;
|
|
1130
1130
|
}>;
|
|
@@ -1162,39 +1162,39 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
|
|
|
1162
1162
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
1163
1163
|
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
1164
1164
|
}, "strict", z.ZodTypeAny, {
|
|
1165
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1165
1166
|
title: string;
|
|
1166
1167
|
updatedAt: string;
|
|
1167
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1168
1168
|
cardId: string;
|
|
1169
1169
|
statement: string;
|
|
1170
1170
|
}, {
|
|
1171
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1171
1172
|
title: string;
|
|
1172
1173
|
updatedAt: string;
|
|
1173
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1174
1174
|
cardId: string;
|
|
1175
1175
|
statement: string;
|
|
1176
1176
|
}>, "many">;
|
|
1177
1177
|
}, "strict", z.ZodTypeAny, {
|
|
1178
|
+
expiresAt: string;
|
|
1178
1179
|
schemaVersion: 1;
|
|
1179
1180
|
updatedAt: string;
|
|
1180
|
-
expiresAt: string;
|
|
1181
1181
|
grantId: string;
|
|
1182
1182
|
cards: {
|
|
1183
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1183
1184
|
title: string;
|
|
1184
1185
|
updatedAt: string;
|
|
1185
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1186
1186
|
cardId: string;
|
|
1187
1187
|
statement: string;
|
|
1188
1188
|
}[];
|
|
1189
1189
|
}, {
|
|
1190
|
+
expiresAt: string;
|
|
1190
1191
|
schemaVersion: 1;
|
|
1191
1192
|
updatedAt: string;
|
|
1192
|
-
expiresAt: string;
|
|
1193
1193
|
grantId: string;
|
|
1194
1194
|
cards: {
|
|
1195
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1195
1196
|
title: string;
|
|
1196
1197
|
updatedAt: string;
|
|
1197
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1198
1198
|
cardId: string;
|
|
1199
1199
|
statement: string;
|
|
1200
1200
|
}[];
|
|
@@ -1203,14 +1203,14 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
|
|
|
1203
1203
|
}, "strict", z.ZodTypeAny, {
|
|
1204
1204
|
question: string;
|
|
1205
1205
|
guide: {
|
|
1206
|
+
expiresAt: string;
|
|
1206
1207
|
schemaVersion: 1;
|
|
1207
1208
|
updatedAt: string;
|
|
1208
|
-
expiresAt: string;
|
|
1209
1209
|
grantId: string;
|
|
1210
1210
|
cards: {
|
|
1211
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1211
1212
|
title: string;
|
|
1212
1213
|
updatedAt: string;
|
|
1213
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1214
1214
|
cardId: string;
|
|
1215
1215
|
statement: string;
|
|
1216
1216
|
}[];
|
|
@@ -1218,14 +1218,14 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
|
|
|
1218
1218
|
}, {
|
|
1219
1219
|
question: string;
|
|
1220
1220
|
guide: {
|
|
1221
|
+
expiresAt: string;
|
|
1221
1222
|
schemaVersion: 1;
|
|
1222
1223
|
updatedAt: string;
|
|
1223
|
-
expiresAt: string;
|
|
1224
1224
|
grantId: string;
|
|
1225
1225
|
cards: {
|
|
1226
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1226
1227
|
title: string;
|
|
1227
1228
|
updatedAt: string;
|
|
1228
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1229
1229
|
cardId: string;
|
|
1230
1230
|
statement: string;
|
|
1231
1231
|
}[];
|
|
@@ -1620,20 +1620,20 @@ declare const SupportPassportCardSchema: z.ZodObject<{
|
|
|
1620
1620
|
reviewBy: z.ZodEffects<z.ZodString, string, string>;
|
|
1621
1621
|
revision: z.ZodString;
|
|
1622
1622
|
}, "strict", z.ZodTypeAny, {
|
|
1623
|
-
|
|
1623
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1624
1624
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1625
|
+
title: string;
|
|
1625
1626
|
updatedAt: string;
|
|
1626
1627
|
revision: string;
|
|
1627
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1628
1628
|
cardId: string;
|
|
1629
1629
|
statement: string;
|
|
1630
1630
|
reviewBy: string;
|
|
1631
1631
|
}, {
|
|
1632
|
-
|
|
1632
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1633
1633
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1634
|
+
title: string;
|
|
1634
1635
|
updatedAt: string;
|
|
1635
1636
|
revision: string;
|
|
1636
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1637
1637
|
cardId: string;
|
|
1638
1638
|
statement: string;
|
|
1639
1639
|
reviewBy: string;
|
|
@@ -1648,38 +1648,38 @@ declare const SupportPassportCardListSchema: z.ZodEffects<z.ZodArray<z.ZodObject
|
|
|
1648
1648
|
reviewBy: z.ZodEffects<z.ZodString, string, string>;
|
|
1649
1649
|
revision: z.ZodString;
|
|
1650
1650
|
}, "strict", z.ZodTypeAny, {
|
|
1651
|
-
|
|
1651
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1652
1652
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1653
|
+
title: string;
|
|
1653
1654
|
updatedAt: string;
|
|
1654
1655
|
revision: string;
|
|
1655
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1656
1656
|
cardId: string;
|
|
1657
1657
|
statement: string;
|
|
1658
1658
|
reviewBy: string;
|
|
1659
1659
|
}, {
|
|
1660
|
-
|
|
1660
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1661
1661
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1662
|
+
title: string;
|
|
1662
1663
|
updatedAt: string;
|
|
1663
1664
|
revision: string;
|
|
1664
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1665
1665
|
cardId: string;
|
|
1666
1666
|
statement: string;
|
|
1667
1667
|
reviewBy: string;
|
|
1668
1668
|
}>, "many">, {
|
|
1669
|
-
|
|
1669
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1670
1670
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1671
|
+
title: string;
|
|
1671
1672
|
updatedAt: string;
|
|
1672
1673
|
revision: string;
|
|
1673
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1674
1674
|
cardId: string;
|
|
1675
1675
|
statement: string;
|
|
1676
1676
|
reviewBy: string;
|
|
1677
1677
|
}[], {
|
|
1678
|
-
|
|
1678
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1679
1679
|
status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
|
|
1680
|
+
title: string;
|
|
1680
1681
|
updatedAt: string;
|
|
1681
1682
|
revision: string;
|
|
1682
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1683
1683
|
cardId: string;
|
|
1684
1684
|
statement: string;
|
|
1685
1685
|
reviewBy: string;
|
|
@@ -1698,14 +1698,14 @@ declare const SupportPassportManualDraftInputSchema: z.ZodObject<{
|
|
|
1698
1698
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
1699
1699
|
reviewBy: z.ZodEffects<z.ZodString, string, string>;
|
|
1700
1700
|
}, "strict", z.ZodTypeAny, {
|
|
1701
|
-
title: string;
|
|
1702
1701
|
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1702
|
+
title: string;
|
|
1703
1703
|
statement: string;
|
|
1704
1704
|
reviewBy: string;
|
|
1705
1705
|
principal: string;
|
|
1706
1706
|
}, {
|
|
1707
|
-
title: string;
|
|
1708
1707
|
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1708
|
+
title: string;
|
|
1709
1709
|
statement: string;
|
|
1710
1710
|
reviewBy: string;
|
|
1711
1711
|
principal: string;
|
|
@@ -1737,8 +1737,8 @@ declare const SupportPassportReplaceCardInputSchema: z.ZodObject<{
|
|
|
1737
1737
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
1738
1738
|
reviewBy: z.ZodEffects<z.ZodString, string, string>;
|
|
1739
1739
|
}, "strict", z.ZodTypeAny, {
|
|
1740
|
-
title: string;
|
|
1741
1740
|
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1741
|
+
title: string;
|
|
1742
1742
|
cardId: string;
|
|
1743
1743
|
statement: string;
|
|
1744
1744
|
reviewBy: string;
|
|
@@ -1746,8 +1746,8 @@ declare const SupportPassportReplaceCardInputSchema: z.ZodObject<{
|
|
|
1746
1746
|
expectedRevision: string;
|
|
1747
1747
|
reasonCode?: string | undefined;
|
|
1748
1748
|
}, {
|
|
1749
|
-
title: string;
|
|
1750
1749
|
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
1750
|
+
title: string;
|
|
1751
1751
|
cardId: string;
|
|
1752
1752
|
statement: string;
|
|
1753
1753
|
reviewBy: string;
|
|
@@ -1806,10 +1806,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1806
1806
|
expiresAt: z.ZodEffects<z.ZodString, string, string>;
|
|
1807
1807
|
revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
1808
1808
|
}, "strict", z.ZodTypeAny, {
|
|
1809
|
-
|
|
1809
|
+
namespace: string;
|
|
1810
1810
|
createdAt: string;
|
|
1811
1811
|
expiresAt: string;
|
|
1812
|
-
|
|
1812
|
+
schemaVersion: 1;
|
|
1813
1813
|
stateVersion: number;
|
|
1814
1814
|
grantId: string;
|
|
1815
1815
|
principalHash: string;
|
|
@@ -1821,10 +1821,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1821
1821
|
}[];
|
|
1822
1822
|
revokedAt?: string | undefined;
|
|
1823
1823
|
}, {
|
|
1824
|
-
|
|
1824
|
+
namespace: string;
|
|
1825
1825
|
createdAt: string;
|
|
1826
1826
|
expiresAt: string;
|
|
1827
|
-
|
|
1827
|
+
schemaVersion: 1;
|
|
1828
1828
|
stateVersion: number;
|
|
1829
1829
|
grantId: string;
|
|
1830
1830
|
principalHash: string;
|
|
@@ -1836,10 +1836,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1836
1836
|
}[];
|
|
1837
1837
|
revokedAt?: string | undefined;
|
|
1838
1838
|
}>, {
|
|
1839
|
-
|
|
1839
|
+
namespace: string;
|
|
1840
1840
|
createdAt: string;
|
|
1841
1841
|
expiresAt: string;
|
|
1842
|
-
|
|
1842
|
+
schemaVersion: 1;
|
|
1843
1843
|
stateVersion: number;
|
|
1844
1844
|
grantId: string;
|
|
1845
1845
|
principalHash: string;
|
|
@@ -1851,10 +1851,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1851
1851
|
}[];
|
|
1852
1852
|
revokedAt?: string | undefined;
|
|
1853
1853
|
}, {
|
|
1854
|
-
|
|
1854
|
+
namespace: string;
|
|
1855
1855
|
createdAt: string;
|
|
1856
1856
|
expiresAt: string;
|
|
1857
|
-
|
|
1857
|
+
schemaVersion: 1;
|
|
1858
1858
|
stateVersion: number;
|
|
1859
1859
|
grantId: string;
|
|
1860
1860
|
principalHash: string;
|
|
@@ -2025,9 +2025,9 @@ declare const SupportPassportOwnerGrantSchema: z.ZodObject<{
|
|
|
2025
2025
|
revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
2026
2026
|
status: z.ZodEnum<["active", "expired", "revoked"]>;
|
|
2027
2027
|
}, "strict", z.ZodTypeAny, {
|
|
2028
|
-
status: "active" | "expired" | "revoked";
|
|
2029
2028
|
createdAt: string;
|
|
2030
2029
|
expiresAt: string;
|
|
2030
|
+
status: "active" | "expired" | "revoked";
|
|
2031
2031
|
stateVersion: number;
|
|
2032
2032
|
grantId: string;
|
|
2033
2033
|
cards: {
|
|
@@ -2036,9 +2036,9 @@ declare const SupportPassportOwnerGrantSchema: z.ZodObject<{
|
|
|
2036
2036
|
}[];
|
|
2037
2037
|
revokedAt?: string | undefined;
|
|
2038
2038
|
}, {
|
|
2039
|
-
status: "active" | "expired" | "revoked";
|
|
2040
2039
|
createdAt: string;
|
|
2041
2040
|
expiresAt: string;
|
|
2041
|
+
status: "active" | "expired" | "revoked";
|
|
2042
2042
|
stateVersion: number;
|
|
2043
2043
|
grantId: string;
|
|
2044
2044
|
cards: {
|
|
@@ -2066,9 +2066,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
|
|
|
2066
2066
|
revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
2067
2067
|
status: z.ZodEnum<["active", "expired", "revoked"]>;
|
|
2068
2068
|
}, "strict", z.ZodTypeAny, {
|
|
2069
|
-
status: "active" | "expired" | "revoked";
|
|
2070
2069
|
createdAt: string;
|
|
2071
2070
|
expiresAt: string;
|
|
2071
|
+
status: "active" | "expired" | "revoked";
|
|
2072
2072
|
stateVersion: number;
|
|
2073
2073
|
grantId: string;
|
|
2074
2074
|
cards: {
|
|
@@ -2077,9 +2077,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
|
|
|
2077
2077
|
}[];
|
|
2078
2078
|
revokedAt?: string | undefined;
|
|
2079
2079
|
}, {
|
|
2080
|
-
status: "active" | "expired" | "revoked";
|
|
2081
2080
|
createdAt: string;
|
|
2082
2081
|
expiresAt: string;
|
|
2082
|
+
status: "active" | "expired" | "revoked";
|
|
2083
2083
|
stateVersion: number;
|
|
2084
2084
|
grantId: string;
|
|
2085
2085
|
cards: {
|
|
@@ -2092,9 +2092,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
|
|
|
2092
2092
|
}, "strict", z.ZodTypeAny, {
|
|
2093
2093
|
secret: string;
|
|
2094
2094
|
grant: {
|
|
2095
|
-
status: "active" | "expired" | "revoked";
|
|
2096
2095
|
createdAt: string;
|
|
2097
2096
|
expiresAt: string;
|
|
2097
|
+
status: "active" | "expired" | "revoked";
|
|
2098
2098
|
stateVersion: number;
|
|
2099
2099
|
grantId: string;
|
|
2100
2100
|
cards: {
|
|
@@ -2106,9 +2106,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
|
|
|
2106
2106
|
}, {
|
|
2107
2107
|
secret: string;
|
|
2108
2108
|
grant: {
|
|
2109
|
-
status: "active" | "expired" | "revoked";
|
|
2110
2109
|
createdAt: string;
|
|
2111
2110
|
expiresAt: string;
|
|
2111
|
+
status: "active" | "expired" | "revoked";
|
|
2112
2112
|
stateVersion: number;
|
|
2113
2113
|
grantId: string;
|
|
2114
2114
|
cards: {
|
|
@@ -2125,15 +2125,15 @@ declare const SupportPassportPublicCardSchema: z.ZodObject<{
|
|
|
2125
2125
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
2126
2126
|
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
2127
2127
|
}, "strict", z.ZodTypeAny, {
|
|
2128
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2128
2129
|
title: string;
|
|
2129
2130
|
updatedAt: string;
|
|
2130
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2131
2131
|
cardId: string;
|
|
2132
2132
|
statement: string;
|
|
2133
2133
|
}, {
|
|
2134
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2134
2135
|
title: string;
|
|
2135
2136
|
updatedAt: string;
|
|
2136
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2137
2137
|
cardId: string;
|
|
2138
2138
|
statement: string;
|
|
2139
2139
|
}>;
|
|
@@ -2149,39 +2149,39 @@ declare const SupportPassportPublicGuideSchema: z.ZodObject<{
|
|
|
2149
2149
|
category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
|
|
2150
2150
|
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
2151
2151
|
}, "strict", z.ZodTypeAny, {
|
|
2152
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2152
2153
|
title: string;
|
|
2153
2154
|
updatedAt: string;
|
|
2154
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2155
2155
|
cardId: string;
|
|
2156
2156
|
statement: string;
|
|
2157
2157
|
}, {
|
|
2158
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2158
2159
|
title: string;
|
|
2159
2160
|
updatedAt: string;
|
|
2160
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2161
2161
|
cardId: string;
|
|
2162
2162
|
statement: string;
|
|
2163
2163
|
}>, "many">;
|
|
2164
2164
|
}, "strict", z.ZodTypeAny, {
|
|
2165
|
+
expiresAt: string;
|
|
2165
2166
|
schemaVersion: 1;
|
|
2166
2167
|
updatedAt: string;
|
|
2167
|
-
expiresAt: string;
|
|
2168
2168
|
grantId: string;
|
|
2169
2169
|
cards: {
|
|
2170
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2170
2171
|
title: string;
|
|
2171
2172
|
updatedAt: string;
|
|
2172
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2173
2173
|
cardId: string;
|
|
2174
2174
|
statement: string;
|
|
2175
2175
|
}[];
|
|
2176
2176
|
}, {
|
|
2177
|
+
expiresAt: string;
|
|
2177
2178
|
schemaVersion: 1;
|
|
2178
2179
|
updatedAt: string;
|
|
2179
|
-
expiresAt: string;
|
|
2180
2180
|
grantId: string;
|
|
2181
2181
|
cards: {
|
|
2182
|
+
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2182
2183
|
title: string;
|
|
2183
2184
|
updatedAt: string;
|
|
2184
|
-
category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
|
|
2185
2185
|
cardId: string;
|
|
2186
2186
|
statement: string;
|
|
2187
2187
|
}[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|