@remnic/core 9.57.3 → 9.57.5
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 +23 -23
- package/dist/access-authorization-probe.d.ts +1 -1
- package/dist/access-authorization-probe.js +24 -24
- package/dist/access-boundary.d.ts +1 -1
- package/dist/access-boundary.js +23 -23
- package/dist/access-cli.js +57 -57
- package/dist/access-extraction-force-flush.d.ts +1 -1
- package/dist/access-extraction-force-flush.js +23 -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 +23 -23
- package/dist/access-http.d.ts +2 -2
- package/dist/access-http.js +34 -34
- package/dist/access-identity-continuity-surface.js +23 -23
- package/dist/access-lcm-surface.d.ts +1 -1
- package/dist/access-lcm-surface.js +23 -23
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +30 -30
- package/dist/access-memory-search-fanout.js +4 -3
- package/dist/access-namespace-preflight.js +23 -23
- package/dist/access-observe-write-surface.d.ts +1 -1
- package/dist/access-observe-write-surface.js +23 -23
- package/dist/access-offline-manifest.js +10 -10
- package/dist/access-operations-batch.js +26 -26
- package/dist/access-operations.d.ts +4 -4
- package/dist/access-operations.js +29 -29
- package/dist/access-recall-concurrency.d.ts +1 -1
- package/dist/access-recall-concurrency.js +23 -23
- package/dist/access-recall-response.d.ts +1 -1
- package/dist/access-recall-response.js +23 -23
- package/dist/access-recall-surface.d.ts +1 -1
- package/dist/access-recall-surface.js +23 -23
- package/dist/access-schema.d.ts +88 -88
- package/dist/access-service-helpers.d.ts +1 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +23 -23
- package/dist/access-surface-catalog.d.ts +1 -1
- package/dist/access-surface-catalog.js +25 -25
- package/dist/active-memory-bridge.js +5 -5
- package/dist/briefing.js +5 -5
- package/dist/buffer.js +6 -5
- package/dist/causal-consolidation.js +7 -7
- package/dist/{chunk-O54B5YNM.js → chunk-24PNX2GF.js} +3 -3
- package/dist/{chunk-ONCWJBWV.js → chunk-3AJOJOFP.js} +2 -2
- package/dist/{chunk-QSDPVZPD.js → chunk-4O6R3GPK.js} +8 -8
- package/dist/{chunk-IXGQP4RZ.js → chunk-4SGDYYWV.js} +4 -4
- package/dist/{chunk-UTDMY476.js → chunk-4UUF2EX3.js} +3 -3
- package/dist/{chunk-T6EQPZ6E.js → chunk-4YZCIK5E.js} +16 -14
- package/dist/chunk-4YZCIK5E.js.map +1 -0
- package/dist/{chunk-S6AH7WSF.js → chunk-5PGYCWA7.js} +5 -5
- package/dist/{chunk-7NSC4IVA.js → chunk-6RK2X7BR.js} +3 -3
- package/dist/{chunk-VWP5DEHU.js → chunk-6SX4MY5Q.js} +2 -2
- package/dist/{chunk-GUNIXT36.js → chunk-7BY7V4YX.js} +2 -2
- package/dist/{chunk-R7UHWPYI.js → chunk-7PJARJS4.js} +3 -3
- package/dist/{chunk-V3IT3XNG.js → chunk-7VSHDLJQ.js} +6 -6
- package/dist/{chunk-SFCJCMZQ.js → chunk-A7266TRJ.js} +2 -2
- package/dist/{chunk-4THNU7OF.js → chunk-AW4A4XOP.js} +22 -22
- package/dist/{chunk-IFFW25NG.js → chunk-C5B3CIMJ.js} +34 -34
- package/dist/{chunk-TF3LMM5E.js → chunk-CSV34HIW.js} +3 -3
- package/dist/{chunk-FK7T55BA.js → chunk-CZUHNJHX.js} +19 -19
- package/dist/{chunk-NFQB6RJT.js → chunk-D4OCJSLV.js} +3 -3
- package/dist/{chunk-JKL53MOY.js → chunk-DLQQU4EG.js} +3 -3
- package/dist/{chunk-CME347TM.js → chunk-DNC4A7RS.js} +2 -2
- package/dist/{chunk-F2JRDPON.js → chunk-EGBDFJ36.js} +2 -2
- package/dist/{chunk-TFXYQNBH.js → chunk-FI3PIOOI.js} +9 -9
- package/dist/{chunk-CKSEJD7K.js → chunk-FKTD7IVS.js} +2 -2
- package/dist/{chunk-FONW766A.js → chunk-GXIY65UH.js} +2 -2
- package/dist/{chunk-2YREVL4T.js → chunk-HZC3OECF.js} +2 -2
- package/dist/{chunk-X5OIPQME.js → chunk-HZNYJN77.js} +6 -6
- package/dist/{chunk-LYPG7GOO.js → chunk-I2GIYTRU.js} +2 -2
- package/dist/{chunk-FR3FNPCJ.js → chunk-IT57AOMC.js} +4 -4
- package/dist/{chunk-CMRUIKVA.js → chunk-KCT36JAW.js} +25 -9
- package/dist/chunk-KCT36JAW.js.map +1 -0
- package/dist/{chunk-KJH6W2I7.js → chunk-L3CHRBHE.js} +4 -4
- package/dist/{chunk-PSH3VFZ7.js → chunk-L3LRWDJW.js} +7 -7
- package/dist/{chunk-JFPZEWY3.js → chunk-LIF6DO6U.js} +37 -13
- package/dist/chunk-LIF6DO6U.js.map +1 -0
- package/dist/{chunk-QZR3WT3L.js → chunk-LJJWFV2Q.js} +2 -2
- package/dist/{chunk-TLVLJSWS.js → chunk-LRDP2AC2.js} +2 -2
- package/dist/{chunk-QV7OEHFN.js → chunk-LTBKKSCX.js} +2 -2
- package/dist/{chunk-IGWVMA4Y.js → chunk-MRV7VSQK.js} +20 -10
- package/dist/chunk-MRV7VSQK.js.map +1 -0
- package/dist/{chunk-6P2NUVM5.js → chunk-NEJQ65NV.js} +2 -2
- package/dist/{chunk-7PKNOXYB.js → chunk-NTJ6TY44.js} +2 -2
- package/dist/{chunk-HYVBJLEK.js → chunk-O5AFC5KM.js} +2 -2
- package/dist/{chunk-U3PN77QT.js → chunk-PCXDUHQH.js} +11 -4
- package/dist/chunk-PCXDUHQH.js.map +1 -0
- package/dist/{chunk-N655QIA2.js → chunk-PEDYKCJI.js} +3 -3
- package/dist/{chunk-TVKWT2CY.js → chunk-Q57GOHLF.js} +11 -9
- package/dist/{chunk-TVKWT2CY.js.map → chunk-Q57GOHLF.js.map} +1 -1
- package/dist/{chunk-4QFCAKNM.js → chunk-RUZM6Z52.js} +1 -1
- package/dist/{chunk-O4TTIMOP.js → chunk-SFR7J2G6.js} +2 -2
- package/dist/{chunk-ION47U3Z.js → chunk-SNW3YRO6.js} +2 -2
- package/dist/{chunk-XL24QQ63.js → chunk-TBUEE7XF.js} +2 -2
- package/dist/{chunk-TAPFJ3ET.js → chunk-U7XLOSG2.js} +3 -3
- package/dist/{chunk-T3HC7RJ7.js → chunk-USAUBGBC.js} +2 -2
- package/dist/{chunk-TAMY4NKO.js → chunk-USGKHF36.js} +2 -2
- package/dist/{chunk-XRPPHIRI.js → chunk-VUDALPI5.js} +2 -2
- package/dist/{chunk-EGGE52UU.js → chunk-VUFL7X3H.js} +13 -6
- package/dist/chunk-VUFL7X3H.js.map +1 -0
- package/dist/{chunk-HC55YCNK.js → chunk-VYIXCMUP.js} +4 -4
- package/dist/{chunk-HQ2VGCGP.js → chunk-XBGLEOID.js} +8 -8
- package/dist/{chunk-XX4HPFFM.js → chunk-XDL5CYZN.js} +4 -4
- package/dist/{chunk-THACANBI.js → chunk-YOKSRIFI.js} +3 -3
- package/dist/{chunk-BWJMBJCY.js → chunk-YTZA7U6Q.js} +6 -6
- package/dist/{chunk-4KM3V6VS.js → chunk-ZN7SMKAK.js} +2 -2
- package/dist/{cli-Bx9FA3KA.d.ts → cli-DTOkYhKI.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +45 -45
- package/dist/compounding/engine.js +5 -5
- package/dist/connectors/codex-materialize-runner.js +6 -6
- package/dist/connectors/index.js +6 -6
- package/dist/contradiction/index.js +3 -3
- package/dist/{contradiction-scan-522AYLQC.js → contradiction-scan-VOTQRRSX.js} +4 -4
- package/dist/convergence-refresh.js +7 -7
- package/dist/corpus-watermark.js +8 -8
- package/dist/entity-retrieval.js +5 -5
- package/dist/explicit-capture.js +4 -4
- package/dist/external-wiki-access.d.ts +1 -1
- package/dist/external-wiki-access.js +24 -24
- package/dist/external-wiki-mcp-tools.d.ts +1 -1
- package/dist/extraction.js +11 -11
- package/dist/{first-start-migration-HZ4VPRFQ.js → first-start-migration-4NETATFF.js} +4 -4
- package/dist/{graph-edge-decay-ZXGBXNPW.js → graph-edge-decay-A4SDFMMS.js} +4 -3
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/index.d.ts +678 -678
- package/dist/index.js +57 -57
- package/dist/maintenance/memory-governance.js +5 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
- package/dist/maintenance/rebuild-memory-projection.js +6 -6
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/namespaces/migrate.js +7 -7
- package/dist/namespaces/principal.js +3 -2
- package/dist/namespaces/search.js +2 -2
- package/dist/namespaces/storage.js +6 -6
- package/dist/offline-sync-impression-drain.js +6 -6
- package/dist/operator-doctor-corpus.js +9 -9
- package/dist/operator-toolkit.js +16 -16
- package/dist/orchestration/maintenance.js +14 -14
- package/dist/orchestrator.js +57 -57
- package/dist/{public-http-D1Bw5yVb.d.ts → public-http-C01DLhAp.d.ts} +1 -1
- package/dist/reconcile/manifest.js +3 -3
- package/dist/reconcile/plan.js +2 -2
- package/dist/routing/engine.js +2 -1
- package/dist/routing/store.js +3 -2
- package/dist/schemas.d.ts +116 -116
- package/dist/semantic-consolidation.js +7 -7
- package/dist/semantic-rule-promotion.js +5 -5
- package/dist/semantic-rule-verifier.js +5 -5
- package/dist/shared-context/manager.d.ts +8 -8
- package/dist/source-agent-qualifier.js +10 -10
- package/dist/storage.js +4 -4
- package/dist/support-passport/index.d.ts +4 -4
- package/dist/support-passport/index.js +26 -26
- package/dist/tier-routing.js +3 -3
- package/dist/{tier-stats-7E6OBUSD.js → tier-stats-4B5IJ3NE.js} +4 -4
- package/dist/transfer/types.d.ts +66 -66
- package/dist/verified-recall.js +5 -5
- package/package.json +2 -2
- package/src/namespaces/catalog.ts +9 -9
- package/src/namespaces/identity.ts +15 -6
- package/src/namespaces/principal.test.ts +10 -1
- package/src/namespaces/principal.ts +17 -9
- package/src/namespaces/scope-profiles.ts +35 -13
- package/src/namespaces/storage.ts +63 -13
- package/src/namespaces/unicode-routing.test.ts +71 -0
- package/src/routing/engine.test.ts +30 -0
- package/src/routing/engine.ts +12 -3
- package/src/scopes/scope-plan.ts +8 -2
- package/src/storage-contract/namespace-routing.test.ts +18 -1
- package/dist/chunk-CMRUIKVA.js.map +0 -1
- package/dist/chunk-EGGE52UU.js.map +0 -1
- package/dist/chunk-IGWVMA4Y.js.map +0 -1
- package/dist/chunk-JFPZEWY3.js.map +0 -1
- package/dist/chunk-T6EQPZ6E.js.map +0 -1
- package/dist/chunk-U3PN77QT.js.map +0 -1
- package/dist/{access-service-SYs9ROK9.d.ts → access-service-D9xXmKvd.d.ts} +58 -58
- /package/dist/{chunk-O54B5YNM.js.map → chunk-24PNX2GF.js.map} +0 -0
- /package/dist/{chunk-ONCWJBWV.js.map → chunk-3AJOJOFP.js.map} +0 -0
- /package/dist/{chunk-QSDPVZPD.js.map → chunk-4O6R3GPK.js.map} +0 -0
- /package/dist/{chunk-IXGQP4RZ.js.map → chunk-4SGDYYWV.js.map} +0 -0
- /package/dist/{chunk-UTDMY476.js.map → chunk-4UUF2EX3.js.map} +0 -0
- /package/dist/{chunk-S6AH7WSF.js.map → chunk-5PGYCWA7.js.map} +0 -0
- /package/dist/{chunk-7NSC4IVA.js.map → chunk-6RK2X7BR.js.map} +0 -0
- /package/dist/{chunk-VWP5DEHU.js.map → chunk-6SX4MY5Q.js.map} +0 -0
- /package/dist/{chunk-GUNIXT36.js.map → chunk-7BY7V4YX.js.map} +0 -0
- /package/dist/{chunk-R7UHWPYI.js.map → chunk-7PJARJS4.js.map} +0 -0
- /package/dist/{chunk-V3IT3XNG.js.map → chunk-7VSHDLJQ.js.map} +0 -0
- /package/dist/{chunk-SFCJCMZQ.js.map → chunk-A7266TRJ.js.map} +0 -0
- /package/dist/{chunk-4THNU7OF.js.map → chunk-AW4A4XOP.js.map} +0 -0
- /package/dist/{chunk-IFFW25NG.js.map → chunk-C5B3CIMJ.js.map} +0 -0
- /package/dist/{chunk-TF3LMM5E.js.map → chunk-CSV34HIW.js.map} +0 -0
- /package/dist/{chunk-FK7T55BA.js.map → chunk-CZUHNJHX.js.map} +0 -0
- /package/dist/{chunk-NFQB6RJT.js.map → chunk-D4OCJSLV.js.map} +0 -0
- /package/dist/{chunk-JKL53MOY.js.map → chunk-DLQQU4EG.js.map} +0 -0
- /package/dist/{chunk-CME347TM.js.map → chunk-DNC4A7RS.js.map} +0 -0
- /package/dist/{chunk-F2JRDPON.js.map → chunk-EGBDFJ36.js.map} +0 -0
- /package/dist/{chunk-TFXYQNBH.js.map → chunk-FI3PIOOI.js.map} +0 -0
- /package/dist/{chunk-CKSEJD7K.js.map → chunk-FKTD7IVS.js.map} +0 -0
- /package/dist/{chunk-FONW766A.js.map → chunk-GXIY65UH.js.map} +0 -0
- /package/dist/{chunk-2YREVL4T.js.map → chunk-HZC3OECF.js.map} +0 -0
- /package/dist/{chunk-X5OIPQME.js.map → chunk-HZNYJN77.js.map} +0 -0
- /package/dist/{chunk-LYPG7GOO.js.map → chunk-I2GIYTRU.js.map} +0 -0
- /package/dist/{chunk-FR3FNPCJ.js.map → chunk-IT57AOMC.js.map} +0 -0
- /package/dist/{chunk-KJH6W2I7.js.map → chunk-L3CHRBHE.js.map} +0 -0
- /package/dist/{chunk-PSH3VFZ7.js.map → chunk-L3LRWDJW.js.map} +0 -0
- /package/dist/{chunk-QZR3WT3L.js.map → chunk-LJJWFV2Q.js.map} +0 -0
- /package/dist/{chunk-TLVLJSWS.js.map → chunk-LRDP2AC2.js.map} +0 -0
- /package/dist/{chunk-QV7OEHFN.js.map → chunk-LTBKKSCX.js.map} +0 -0
- /package/dist/{chunk-6P2NUVM5.js.map → chunk-NEJQ65NV.js.map} +0 -0
- /package/dist/{chunk-7PKNOXYB.js.map → chunk-NTJ6TY44.js.map} +0 -0
- /package/dist/{chunk-HYVBJLEK.js.map → chunk-O5AFC5KM.js.map} +0 -0
- /package/dist/{chunk-N655QIA2.js.map → chunk-PEDYKCJI.js.map} +0 -0
- /package/dist/{chunk-4QFCAKNM.js.map → chunk-RUZM6Z52.js.map} +0 -0
- /package/dist/{chunk-O4TTIMOP.js.map → chunk-SFR7J2G6.js.map} +0 -0
- /package/dist/{chunk-ION47U3Z.js.map → chunk-SNW3YRO6.js.map} +0 -0
- /package/dist/{chunk-XL24QQ63.js.map → chunk-TBUEE7XF.js.map} +0 -0
- /package/dist/{chunk-TAPFJ3ET.js.map → chunk-U7XLOSG2.js.map} +0 -0
- /package/dist/{chunk-T3HC7RJ7.js.map → chunk-USAUBGBC.js.map} +0 -0
- /package/dist/{chunk-TAMY4NKO.js.map → chunk-USGKHF36.js.map} +0 -0
- /package/dist/{chunk-XRPPHIRI.js.map → chunk-VUDALPI5.js.map} +0 -0
- /package/dist/{chunk-HC55YCNK.js.map → chunk-VYIXCMUP.js.map} +0 -0
- /package/dist/{chunk-HQ2VGCGP.js.map → chunk-XBGLEOID.js.map} +0 -0
- /package/dist/{chunk-XX4HPFFM.js.map → chunk-XDL5CYZN.js.map} +0 -0
- /package/dist/{chunk-THACANBI.js.map → chunk-YOKSRIFI.js.map} +0 -0
- /package/dist/{chunk-BWJMBJCY.js.map → chunk-YTZA7U6Q.js.map} +0 -0
- /package/dist/{chunk-4KM3V6VS.js.map → chunk-ZN7SMKAK.js.map} +0 -0
- /package/dist/{contradiction-scan-522AYLQC.js.map → contradiction-scan-VOTQRRSX.js.map} +0 -0
- /package/dist/{first-start-migration-HZ4VPRFQ.js.map → first-start-migration-4NETATFF.js.map} +0 -0
- /package/dist/{graph-edge-decay-ZXGBXNPW.js.map → graph-edge-decay-A4SDFMMS.js.map} +0 -0
- /package/dist/{tier-stats-7E6OBUSD.js.map → tier-stats-4B5IJ3NE.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-TBBDFYXW.js";
|
|
6
6
|
import {
|
|
7
7
|
hasLiveSupportPassportCard
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XDL5CYZN.js";
|
|
9
9
|
|
|
10
10
|
// src/tier-routing.ts
|
|
11
11
|
function requiresHotTier(memory) {
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
computeTierValueScore,
|
|
81
81
|
decideTierTransition
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-EGBDFJ36.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
readNamespaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4YZCIK5E.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzeSessionIntegrity,
|
|
9
9
|
applySessionRepair,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-CMTINOFS.js";
|
|
15
15
|
import {
|
|
16
16
|
summarizeCorpusAndReplica
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-USAUBGBC.js";
|
|
18
18
|
import {
|
|
19
19
|
readJudgeVerdictStats
|
|
20
20
|
} from "./chunk-OZKOPQCM.js";
|
|
@@ -41,20 +41,20 @@ import {
|
|
|
41
41
|
} from "./chunk-3VFVQDZO.js";
|
|
42
42
|
import {
|
|
43
43
|
readAggregateExtractionWatermark
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-5PGYCWA7.js";
|
|
45
45
|
import {
|
|
46
46
|
listMemoryGovernanceRuns,
|
|
47
47
|
readMemoryGovernanceRunArtifact
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-6RK2X7BR.js";
|
|
49
49
|
import {
|
|
50
50
|
listNamespaces
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-L3LRWDJW.js";
|
|
52
52
|
import {
|
|
53
53
|
analyzeGraphHealth
|
|
54
54
|
} from "./chunk-YMOPYG3K.js";
|
|
55
55
|
import {
|
|
56
56
|
StorageManager
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-YTZA7U6Q.js";
|
|
58
58
|
import {
|
|
59
59
|
lintWorkspaceFiles
|
|
60
60
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1069,7 +1069,7 @@ async function summarizeBufferSurpriseDistribution(storage, config) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
1071
|
async function summarizeGraphEdgeDecayStatus(config) {
|
|
1072
|
-
const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-
|
|
1072
|
+
const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-A4SDFMMS.js");
|
|
1073
1073
|
const { graphEdgeDecayEnabled } = config;
|
|
1074
1074
|
const enabled = graphEdgeDecayEnabled === true;
|
|
1075
1075
|
if (!enabled) {
|
|
@@ -1109,7 +1109,7 @@ async function summarizeGraphEdgeDecayStatus(config) {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
async function summarizeTierDistribution(storage) {
|
|
1111
1111
|
try {
|
|
1112
|
-
const { summarizeTiers } = await import("./tier-stats-
|
|
1112
|
+
const { summarizeTiers } = await import("./tier-stats-4B5IJ3NE.js");
|
|
1113
1113
|
const summary = await summarizeTiers(storage);
|
|
1114
1114
|
const storageDir = storage.dir ?? "";
|
|
1115
1115
|
const journalPath = storageDir.length > 0 ? path.join(storageDir, "state", "tier-migration-journal.jsonl") : null;
|
|
@@ -1683,4 +1683,4 @@ export {
|
|
|
1683
1683
|
runBenchmarkRecall,
|
|
1684
1684
|
runOperatorRepair
|
|
1685
1685
|
};
|
|
1686
|
-
//# sourceMappingURL=chunk-
|
|
1686
|
+
//# sourceMappingURL=chunk-FI3PIOOI.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getOperation,
|
|
4
4
|
operationRequiresAuthorizedNamespace,
|
|
5
5
|
operationUsesPrincipalNamespace
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CZUHNJHX.js";
|
|
7
7
|
import {
|
|
8
8
|
assertOperationAuthorizationAllowed
|
|
9
9
|
} from "./chunk-MZWSOLMT.js";
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
authorizationProbeNamespaces,
|
|
61
61
|
authorizationProbeRequiresPrincipalNamespace
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-FKTD7IVS.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-B7RWBZXW.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YTZA7U6Q.js";
|
|
7
7
|
import {
|
|
8
8
|
getCachedEpisodeMap,
|
|
9
9
|
setCachedEpisodeMap
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
compareVerifiedEpisodeResults,
|
|
110
110
|
searchVerifiedEpisodes
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-GXIY65UH.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-7T4TOGMS.js";
|
|
4
4
|
import {
|
|
5
5
|
defineOperation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CZUHNJHX.js";
|
|
7
7
|
|
|
8
8
|
// src/external-wiki-access.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -26,4 +26,4 @@ var externalWikiSearchOperation = defineOperation({
|
|
|
26
26
|
export {
|
|
27
27
|
externalWikiSearchOperation
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-HZC3OECF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfiguredNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q57GOHLF.js";
|
|
4
4
|
import {
|
|
5
5
|
writeFileAtomically
|
|
6
6
|
} from "./chunk-AW4QUFQF.js";
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
displayErrorDetail
|
|
17
17
|
} from "./chunk-RL6NEVXT.js";
|
|
18
|
-
import {
|
|
19
|
-
namespaceIdentityFromToken
|
|
20
|
-
} from "./chunk-EGGE52UU.js";
|
|
21
18
|
import {
|
|
22
19
|
isSafeRouteNamespace
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PCXDUHQH.js";
|
|
21
|
+
import {
|
|
22
|
+
namespaceIdentityFromToken
|
|
23
|
+
} from "./chunk-VUFL7X3H.js";
|
|
24
24
|
import {
|
|
25
25
|
isErrnoCode
|
|
26
26
|
} from "./chunk-5UZXUTVO.js";
|
|
@@ -181,4 +181,4 @@ export {
|
|
|
181
181
|
offlineSyncStorageForSnapshot,
|
|
182
182
|
drainPendingLifecycleForOfflineSync
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-HZNYJN77.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YTZA7U6Q.js";
|
|
4
4
|
import {
|
|
5
5
|
composeMemoryEnvelope
|
|
6
6
|
} from "./chunk-LCU5R6TQ.js";
|
|
@@ -546,4 +546,4 @@ export {
|
|
|
546
546
|
setSemanticRulePromotionTestHooks,
|
|
547
547
|
promoteSemanticRuleFromMemory
|
|
548
548
|
};
|
|
549
|
-
//# sourceMappingURL=chunk-
|
|
549
|
+
//# sourceMappingURL=chunk-I2GIYTRU.js.map
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
listMemoryGovernanceRuns,
|
|
9
9
|
readMemoryGovernanceRunArtifact
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6RK2X7BR.js";
|
|
11
11
|
import {
|
|
12
12
|
StorageManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YTZA7U6Q.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeProjectionPreview,
|
|
16
16
|
normalizeProjectionTags
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
} from "./chunk-RL6NEVXT.js";
|
|
48
48
|
import {
|
|
49
49
|
isSupportPassportPrivateMemory
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-XDL5CYZN.js";
|
|
51
51
|
import {
|
|
52
52
|
log
|
|
53
53
|
} from "./chunk-3WCASNQZ.js";
|
|
@@ -1005,4 +1005,4 @@ export {
|
|
|
1005
1005
|
verifyMemoryProjection,
|
|
1006
1006
|
repairMemoryProjection
|
|
1007
1007
|
};
|
|
1008
|
-
//# sourceMappingURL=chunk-
|
|
1008
|
+
//# sourceMappingURL=chunk-IT57AOMC.js.map
|
|
@@ -2,10 +2,13 @@ import {
|
|
|
2
2
|
canReadNamespace,
|
|
3
3
|
canWriteNamespace,
|
|
4
4
|
defaultNamespaceForPrincipal
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MRV7VSQK.js";
|
|
6
6
|
import {
|
|
7
7
|
isSafeRouteNamespace
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PCXDUHQH.js";
|
|
9
|
+
import {
|
|
10
|
+
normalizeNamespaceIdentity
|
|
11
|
+
} from "./chunk-VUFL7X3H.js";
|
|
9
12
|
import {
|
|
10
13
|
resolveNamespaceCapabilities
|
|
11
14
|
} from "./chunk-JUOZ62Y7.js";
|
|
@@ -27,22 +30,27 @@ function principalListed(list, principal) {
|
|
|
27
30
|
return list.includes(principal) || list.includes("*");
|
|
28
31
|
}
|
|
29
32
|
function derivedScopeProfileSelfNamespace(principal, config) {
|
|
30
|
-
if (!principal || principal === config.defaultNamespace || principal === config.sharedNamespace)
|
|
33
|
+
if (!principal || normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.defaultNamespace) || normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.sharedNamespace)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
31
36
|
if (isSafeRouteNamespace(principal)) return principal;
|
|
32
37
|
return "principal-" + createHash("sha256").update(principal).digest("hex").slice(0, 54);
|
|
33
38
|
}
|
|
34
39
|
function scopeProfileSelfNamespace(principal, config) {
|
|
35
40
|
const existing = defaultNamespaceForPrincipal(principal, config);
|
|
36
|
-
if (existing !== config.defaultNamespace) return existing;
|
|
41
|
+
if (normalizeNamespaceIdentity(existing) !== normalizeNamespaceIdentity(config.defaultNamespace)) return existing;
|
|
37
42
|
return derivedScopeProfileSelfNamespace(principal, config) ?? existing;
|
|
38
43
|
}
|
|
39
44
|
function hasExplicitNamespacePolicy(namespace, config) {
|
|
40
|
-
|
|
45
|
+
const identity = normalizeNamespaceIdentity(namespace);
|
|
46
|
+
return (config.namespacePolicies ?? []).some(
|
|
47
|
+
(policy) => normalizeNamespaceIdentity(policy.name) === identity
|
|
48
|
+
);
|
|
41
49
|
}
|
|
42
50
|
function isScopeProfileImplicitSelfNamespace(principal, namespace, config) {
|
|
43
51
|
const derived = derivedScopeProfileSelfNamespace(principal, config);
|
|
44
52
|
return Boolean(
|
|
45
|
-
derived && namespace === derived && namespace !== config.defaultNamespace && namespace !== config.sharedNamespace && isSafeRouteNamespace(namespace) && !hasExplicitNamespacePolicy(namespace, config)
|
|
53
|
+
derived && normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(derived) && normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.defaultNamespace) && normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.sharedNamespace) && isSafeRouteNamespace(namespace) && !hasExplicitNamespacePolicy(namespace, config)
|
|
46
54
|
);
|
|
47
55
|
}
|
|
48
56
|
function canReadScopeProfileNamespace(principal, namespace, config) {
|
|
@@ -200,8 +208,16 @@ function resolveLayer(params) {
|
|
|
200
208
|
const teamPromotable = principalListed(team.team.promote, principal) || principalListed(team.team.write, principal);
|
|
201
209
|
const userProjectSuffix = `-${codingOverlay.namespace}`;
|
|
202
210
|
const userProjectBase = namespace.endsWith(userProjectSuffix) ? namespace.slice(0, -userProjectSuffix.length) : "";
|
|
203
|
-
const
|
|
204
|
-
const
|
|
211
|
+
const userProjectBaseIdentity = normalizeNamespaceIdentity(userProjectBase);
|
|
212
|
+
const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);
|
|
213
|
+
const sharedIdentity = normalizeNamespaceIdentity(config.sharedNamespace);
|
|
214
|
+
const namespaceIdentity = normalizeNamespaceIdentity(namespace);
|
|
215
|
+
const dynamicUserProjectCollision = userProjectBase.length > 0 && (userProjectBaseIdentity === defaultIdentity || userProjectBaseIdentity === sharedIdentity || (config.namespacePolicies ?? []).some(
|
|
216
|
+
(policy) => normalizeNamespaceIdentity(policy.name) === userProjectBaseIdentity
|
|
217
|
+
));
|
|
218
|
+
const protectedNamespace = namespaceIdentity === defaultIdentity || namespaceIdentity === sharedIdentity || dynamicUserProjectCollision || (config.namespacePolicies ?? []).some(
|
|
219
|
+
(policy) => normalizeNamespaceIdentity(policy.name) === namespaceIdentity
|
|
220
|
+
);
|
|
205
221
|
const policyReadable = !protectedNamespace || canReadNamespace(principal, namespace, config);
|
|
206
222
|
const policyWritable = !protectedNamespace || canWriteNamespace(principal, namespace, config);
|
|
207
223
|
const policyBlocked = protectedNamespace && (!policyReadable || !policyWritable);
|
|
@@ -322,4 +338,4 @@ export {
|
|
|
322
338
|
resolveScopeProfilePlan,
|
|
323
339
|
expandScopeProfileReadNamespaces
|
|
324
340
|
};
|
|
325
|
-
//# sourceMappingURL=chunk-
|
|
341
|
+
//# sourceMappingURL=chunk-KCT36JAW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/namespaces/scope-profiles.ts"],"sourcesContent":["import { resolveNamespaceCapabilities } from \"../capabilities.js\";\nimport { createHash } from \"node:crypto\";\n\nimport { combineNamespaces, type CodingNamespaceOverlay } from \"../coding/coding-namespace.js\";\nimport { stableHash } from \"../coding/git-context.js\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport type {\n CodingContext,\n PluginConfig,\n ScopeProfileConfig,\n ScopeProfileLayerId,\n ScopeProfilePromotionTarget,\n ScopeTeamConfig,\n} from \"../types.js\";\nimport {\n canReadNamespace,\n canWriteNamespace,\n defaultNamespaceForPrincipal,\n} from \"./principal.js\";\nimport { normalizeNamespaceIdentity } from \"./identity.js\";\n\ntype ScopeProfileCodingOverlay = Pick<CodingNamespaceOverlay, \"namespace\" | \"readFallbacks\">;\n\nexport interface ScopeProfileLayerResolution {\n id: ScopeProfileLayerId;\n kind: \"user-project\" | \"team-project\" | \"user-global\" | \"server-shared\";\n namespace?: string;\n readable: boolean;\n writable: boolean;\n promotable: boolean;\n reason: string;\n}\n\nexport interface ScopeProfilePromotionResolution {\n target: ScopeProfilePromotionTarget;\n namespace?: string;\n authorized: boolean;\n reason: string;\n}\n\nexport interface ResolvedScopeProfilePlan {\n profileId: string;\n profile: ScopeProfileConfig;\n baseNamespace: string;\n writeLayer: ScopeProfileLayerId;\n writeNamespace: string;\n readNamespaces: string[];\n layers: ScopeProfileLayerResolution[];\n promotionTargets: ScopeProfilePromotionResolution[];\n warnings: string[];\n}\n\nexport interface ResolveScopeProfilePlanOptions {\n config: PluginConfig;\n principal?: string;\n codingContext?: CodingContext | null;\n codingOverlay?: ScopeProfileCodingOverlay | null;\n}\n\nfunction activeScopeProfile(config: PluginConfig): { profileId: string; profile: ScopeProfileConfig } | null {\n const profileId = config.defaultScopeProfile;\n if (!profileId) return null;\n const profile = (config.scopeProfiles ?? {})[profileId];\n return profile ? { profileId, profile } : null;\n}\n\nfunction principalListed(list: string[], principal: string | undefined): boolean {\n if (!principal) return false;\n return list.includes(principal) || list.includes(\"*\");\n}\n\nfunction derivedScopeProfileSelfNamespace(principal: string | undefined, config: PluginConfig): string | null {\n if (\n !principal ||\n normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.defaultNamespace) ||\n normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.sharedNamespace)\n ) {\n return null;\n }\n if (isSafeRouteNamespace(principal)) return principal;\n return \"principal-\" + createHash(\"sha256\").update(principal).digest(\"hex\").slice(0, 54);\n}\n\nfunction scopeProfileSelfNamespace(principal: string | undefined, config: PluginConfig): string {\n const existing = defaultNamespaceForPrincipal(principal, config);\n if (normalizeNamespaceIdentity(existing) !== normalizeNamespaceIdentity(config.defaultNamespace)) return existing;\n return derivedScopeProfileSelfNamespace(principal, config) ?? existing;\n}\n\nfunction hasExplicitNamespacePolicy(namespace: string, config: PluginConfig): boolean {\n const identity = normalizeNamespaceIdentity(namespace);\n return (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === identity,\n );\n}\n\nfunction isScopeProfileImplicitSelfNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n const derived = derivedScopeProfileSelfNamespace(principal, config);\n return Boolean(\n derived &&\n normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(derived) &&\n normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.defaultNamespace) &&\n normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.sharedNamespace) &&\n isSafeRouteNamespace(namespace) &&\n !hasExplicitNamespacePolicy(namespace, config),\n );\n}\n\nfunction canReadScopeProfileNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n return isScopeProfileImplicitSelfNamespace(principal, namespace, config) || canReadNamespace(principal, namespace, config);\n}\n\nfunction canWriteScopeProfileNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n return isScopeProfileImplicitSelfNamespace(principal, namespace, config) || canWriteNamespace(principal, namespace, config);\n}\n\nfunction resolveTeam(\n config: PluginConfig,\n profile: ScopeProfileConfig,\n principal: string | undefined,\n): { teamId: string; team: ScopeTeamConfig } | null {\n const configuredTeamId = profile.teamProject?.teamId;\n if (configuredTeamId) {\n const configured = (config.teams ?? {})[configuredTeamId];\n return configured ? { teamId: configuredTeamId, team: configured } : null;\n }\n const readableTeams = Object.entries(config.teams ?? {}).filter(([, team]) =>\n principalListed(team.principals, principal) || principalListed(team.read, principal),\n );\n const needsWritableTeam = profile.writeDefault === \"teamProject\" || profile.readOrder.includes(\"teamProject\");\n if (needsWritableTeam) {\n const writableTeam = readableTeams.find(([, team]) => principalListed(team.write, principal));\n if (writableTeam) return { teamId: writableTeam[0], team: writableTeam[1] };\n }\n const needsPromotableTeam =\n profile.promotionTargets.includes(\"teamProject\") || profile.autoPromote.targets.includes(\"teamProject\");\n if (needsPromotableTeam) {\n const promotableTeam = readableTeams.find(\n ([, team]) => principalListed(team.promote, principal) || principalListed(team.write, principal),\n );\n if (promotableTeam) return { teamId: promotableTeam[0], team: promotableTeam[1] };\n }\n const firstReadableTeam = readableTeams[0];\n return firstReadableTeam\n ? { teamId: firstReadableTeam[0], team: firstReadableTeam[1] }\n : null;\n}\n\nfunction renderTeamProjectNamespace(params: {\n template: string;\n teamId: string;\n principal: string | undefined;\n codingContext: CodingContext;\n codingOverlay: ScopeProfileCodingOverlay;\n}): { namespace: string; unknownPlaceholders: string[] } {\n const replacements: Record<string, string> = {\n teamId: params.teamId,\n principal: params.principal ?? \"anonymous\",\n projectId: params.codingContext.projectId,\n projectHash: stableHash(params.codingContext.projectId),\n projectNamespace: params.codingOverlay.namespace,\n };\n const unknownPlaceholders: string[] = [];\n const namespace = params.template.replace(/\\{([A-Za-z][A-Za-z0-9]*)\\}/g, (match, key: string) => {\n const replacement = replacements[key];\n if (replacement !== undefined) return replacement;\n if (!unknownPlaceholders.includes(key)) unknownPlaceholders.push(key);\n return match;\n });\n return { namespace, unknownPlaceholders };\n}\n\nfunction resolveLayer(params: {\n id: ScopeProfileLayerId;\n config: PluginConfig;\n profile: ScopeProfileConfig;\n principal: string | undefined;\n baseNamespace: string;\n codingContext: CodingContext | null | undefined;\n codingOverlay: ScopeProfileCodingOverlay | null | undefined;\n}): ScopeProfileLayerResolution {\n const { id, config, profile, principal, baseNamespace, codingContext, codingOverlay } = params;\n if (id === \"userGlobal\") {\n return {\n id,\n kind: \"user-global\",\n namespace: baseNamespace,\n readable: canReadScopeProfileNamespace(principal, baseNamespace, config),\n writable: canWriteScopeProfileNamespace(principal, baseNamespace, config),\n promotable: canWriteScopeProfileNamespace(principal, baseNamespace, config),\n reason: \"principal self/global namespace\",\n };\n }\n if (id === \"serverShared\") {\n return {\n id,\n kind: \"server-shared\",\n namespace: config.sharedNamespace,\n readable: canReadNamespace(principal, config.sharedNamespace, config),\n writable: canWriteNamespace(principal, config.sharedNamespace, config),\n promotable: canWriteNamespace(principal, config.sharedNamespace, config),\n reason: \"configured shared namespace\",\n };\n }\n if (id === \"userProject\") {\n if (!codingContext || !codingOverlay) {\n return {\n id,\n kind: \"user-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"missing project context\",\n };\n }\n const namespace = combineNamespaces(baseNamespace, codingOverlay.namespace);\n const explicitProjectPolicy = hasExplicitNamespacePolicy(namespace, config);\n const baseReadable = canReadScopeProfileNamespace(principal, baseNamespace, config);\n const baseWritable = canWriteScopeProfileNamespace(principal, baseNamespace, config);\n const projectReadable = explicitProjectPolicy\n ? canReadNamespace(principal, namespace, config)\n : baseReadable;\n const projectWritable = explicitProjectPolicy\n ? canWriteNamespace(principal, namespace, config)\n : baseWritable;\n return {\n id,\n kind: \"user-project\",\n namespace,\n readable: projectReadable,\n writable: projectWritable,\n promotable: projectWritable,\n reason: explicitProjectPolicy\n ? \"explicit user-project namespace policy\"\n : baseReadable || baseWritable\n ? \"principal project namespace derived from coding context\"\n : \"principal base namespace is not authorized\",\n };\n }\n const team = resolveTeam(config, profile, principal);\n if (!team) {\n return {\n id,\n kind: \"team-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"no authorized team mapping\",\n };\n }\n if (!codingContext || !codingOverlay) {\n return {\n id,\n kind: \"team-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"missing project context\",\n };\n }\n const template =\n profile.teamProject?.namespaceTemplate ??\n team.team.projectNamespaceTemplate ??\n \"team-{teamId}-project-{projectHash}\";\n const renderedNamespace = renderTeamProjectNamespace({\n template,\n teamId: team.teamId,\n principal,\n codingContext,\n codingOverlay,\n });\n const namespace = renderedNamespace.namespace.trim();\n if (renderedNamespace.unknownPlaceholders.length > 0) {\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: false,\n writable: false,\n promotable: false,\n reason: `unknown team-project namespace template placeholder(s): ${renderedNamespace.unknownPlaceholders.join(\", \")}`,\n };\n }\n if (!namespace || !isSafeRouteNamespace(namespace)) {\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: false,\n writable: false,\n promotable: false,\n reason: \"team-project namespace template resolved to an unsafe namespace\",\n };\n }\n const teamReadable = principalListed(team.team.read, principal) || principalListed(team.team.principals, principal);\n const teamWritable = principalListed(team.team.write, principal);\n const teamPromotable = principalListed(team.team.promote, principal) || principalListed(team.team.write, principal);\n const userProjectSuffix = `-${codingOverlay.namespace}`;\n const userProjectBase = namespace.endsWith(userProjectSuffix)\n ? namespace.slice(0, -userProjectSuffix.length)\n : \"\";\n const userProjectBaseIdentity = normalizeNamespaceIdentity(userProjectBase);\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const sharedIdentity = normalizeNamespaceIdentity(config.sharedNamespace);\n const namespaceIdentity = normalizeNamespaceIdentity(namespace);\n const dynamicUserProjectCollision =\n userProjectBase.length > 0 &&\n (userProjectBaseIdentity === defaultIdentity ||\n userProjectBaseIdentity === sharedIdentity ||\n (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === userProjectBaseIdentity,\n ));\n const protectedNamespace =\n namespaceIdentity === defaultIdentity ||\n namespaceIdentity === sharedIdentity ||\n dynamicUserProjectCollision ||\n (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === namespaceIdentity,\n );\n const policyReadable = !protectedNamespace || canReadNamespace(principal, namespace, config);\n const policyWritable = !protectedNamespace || canWriteNamespace(principal, namespace, config);\n const policyBlocked = protectedNamespace && (!policyReadable || !policyWritable);\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: teamReadable && policyReadable,\n writable: teamWritable && policyWritable,\n promotable: teamPromotable && policyWritable,\n reason: policyBlocked\n ? \"team-project namespace collides with a protected namespace policy\"\n : \"trusted team-project namespace derived from team and project config\",\n };\n}\n\nexport function resolveScopeProfilePlan(\n options: ResolveScopeProfilePlanOptions,\n): ResolvedScopeProfilePlan | null {\n const active = activeScopeProfile(options.config);\n if (!active || !resolveNamespaceCapabilities(options.config).namespaces) return null;\n\n const baseNamespace = scopeProfileSelfNamespace(options.principal, options.config);\n const layerIds = Array.from(\n new Set<ScopeProfileLayerId>([\n ...active.profile.readOrder,\n active.profile.writeDefault,\n \"userGlobal\",\n ...active.profile.promotionTargets.filter((target): target is ScopeProfileLayerId =>\n [\"userProject\", \"teamProject\", \"userGlobal\", \"serverShared\"].includes(target),\n ),\n ]),\n );\n const layerMap = new Map<ScopeProfileLayerId, ScopeProfileLayerResolution>();\n for (const id of layerIds) {\n layerMap.set(\n id,\n resolveLayer({\n id,\n config: options.config,\n profile: active.profile,\n principal: options.principal,\n baseNamespace,\n codingContext: options.codingContext,\n codingOverlay: options.codingOverlay,\n }),\n );\n }\n\n const readNamespaces: string[] = [];\n for (const id of active.profile.readOrder) {\n const layer = layerMap.get(id);\n if (layer?.readable && layer.namespace && !readNamespaces.includes(layer.namespace)) {\n readNamespaces.push(layer.namespace);\n }\n }\n\n const preferredWriteLayer = layerMap.get(active.profile.writeDefault);\n const readableWriteLayers = active.profile.readOrder\n .map((id) => layerMap.get(id))\n .filter(\n (layer): layer is ScopeProfileLayerResolution =>\n Boolean(layer?.writable && layer.namespace && readNamespaces.includes(layer.namespace)),\n );\n const fallbackWriteLayer =\n preferredWriteLayer?.writable &&\n preferredWriteLayer.namespace &&\n readNamespaces.includes(preferredWriteLayer.namespace)\n ? preferredWriteLayer\n : readableWriteLayers[0];\n const warnings: string[] = [];\n if (!fallbackWriteLayer?.namespace) {\n warnings.push(`scope profile ${active.profileId} has no writable layer inside the profile read stack; writes disabled`);\n } else if (fallbackWriteLayer.id !== active.profile.writeDefault) {\n warnings.push(\n `scope profile ${active.profileId} writeDefault ${active.profile.writeDefault} unavailable: ${preferredWriteLayer?.reason ?? \"not resolved\"}`,\n );\n }\n\n const promotionTargets = active.profile.promotionTargets.map((target) => {\n const layer = layerMap.get(target as ScopeProfileLayerId);\n if (!layer) {\n return {\n target,\n authorized: false,\n reason: \"promotion target did not resolve to a profile layer\",\n };\n }\n return {\n target,\n namespace: layer.namespace,\n authorized: layer.promotable && Boolean(layer.namespace),\n reason: layer.reason,\n };\n });\n\n return {\n profileId: active.profileId,\n profile: active.profile,\n baseNamespace,\n writeLayer: fallbackWriteLayer?.id ?? active.profile.writeDefault,\n writeNamespace: fallbackWriteLayer?.namespace ?? \"\",\n readNamespaces,\n layers: [...layerMap.values()],\n promotionTargets,\n warnings,\n };\n}\n\nexport function expandScopeProfileReadNamespaces(options: {\n profilePlan: ResolvedScopeProfilePlan;\n principalSelfNamespace: string;\n config: PluginConfig;\n principal?: string;\n codingOverlay?: ScopeProfileCodingOverlay | null;\n legacyRecallNamespaces?: string[];\n}): string[] {\n if (options.profilePlan.readNamespaces.length === 0) {\n return [];\n }\n const out = [...options.profilePlan.readNamespaces];\n const add = (namespace: string | undefined): void => {\n if (namespace && !out.includes(namespace)) out.push(namespace);\n };\n const userProjectReadable =\n options.profilePlan.profile.readOrder.includes(\"userProject\") &&\n options.profilePlan.layers.some(\n (layer) => layer.id === \"userProject\" && layer.readable && layer.namespace,\n );\n const userGlobalReadable =\n options.profilePlan.profile.readOrder.includes(\"userGlobal\") &&\n options.profilePlan.layers.some(\n (layer) => layer.id === \"userGlobal\" && layer.readable && layer.namespace,\n );\n if (userProjectReadable) {\n for (const fallback of options.codingOverlay?.readFallbacks ?? []) {\n if (fallback === \"\" && !userGlobalReadable) continue;\n const fallbackNamespace = combineNamespaces(options.principalSelfNamespace, fallback);\n if (\n !hasExplicitNamespacePolicy(fallbackNamespace, options.config) ||\n canReadScopeProfileNamespace(options.principal, fallbackNamespace, options.config)\n ) {\n add(fallbackNamespace);\n }\n }\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAS,kBAAkB;AA0D3B,SAAS,mBAAmB,QAAiF;AAC3G,QAAM,YAAY,OAAO;AACzB,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,WAAW,OAAO,iBAAiB,CAAC,GAAG,SAAS;AACtD,SAAO,UAAU,EAAE,WAAW,QAAQ,IAAI;AAC5C;AAEA,SAAS,gBAAgB,MAAgB,WAAwC;AAC/E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,KAAK,SAAS,SAAS,KAAK,KAAK,SAAS,GAAG;AACtD;AAEA,SAAS,iCAAiC,WAA+B,QAAqC;AAC5G,MACE,CAAC,aACD,2BAA2B,SAAS,MAAM,2BAA2B,OAAO,gBAAgB,KAC5F,2BAA2B,SAAS,MAAM,2BAA2B,OAAO,eAAe,GAC3F;AACA,WAAO;AAAA,EACT;AACA,MAAI,qBAAqB,SAAS,EAAG,QAAO;AAC5C,SAAO,eAAe,WAAW,QAAQ,EAAE,OAAO,SAAS,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AACxF;AAEA,SAAS,0BAA0B,WAA+B,QAA8B;AAC9F,QAAM,WAAW,6BAA6B,WAAW,MAAM;AAC/D,MAAI,2BAA2B,QAAQ,MAAM,2BAA2B,OAAO,gBAAgB,EAAG,QAAO;AACzG,SAAO,iCAAiC,WAAW,MAAM,KAAK;AAChE;AAEA,SAAS,2BAA2B,WAAmB,QAA+B;AACpF,Q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M,CAAC,mBAAoB;AAC5C,YAAM,oBAAoB,kBAAkB,QAAQ,wBAAwB,QAAQ;AACpF,UACE,CAAC,2BAA2B,mBAAmB,QAAQ,MAAM,KAC7D,6BAA6B,QAAQ,WAAW,mBAAmB,QAAQ,MAAM,GACjF;AACA,YAAI,iBAAiB;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":["namespace"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
normalizeNamespaceIdentity
|
|
3
|
-
} from "./chunk-EGGE52UU.js";
|
|
4
1
|
import {
|
|
5
2
|
CONVERGE_CONFLICT_POLICIES,
|
|
6
3
|
DEFAULT_CONVERGE_CONFLICT_POLICY
|
|
@@ -11,6 +8,9 @@ import {
|
|
|
11
8
|
import {
|
|
12
9
|
validateArchiveRelativePath
|
|
13
10
|
} from "./chunk-GCGJW34D.js";
|
|
11
|
+
import {
|
|
12
|
+
normalizeNamespaceIdentity
|
|
13
|
+
} from "./chunk-VUFL7X3H.js";
|
|
14
14
|
|
|
15
15
|
// src/reconcile/plan.ts
|
|
16
16
|
var ReconcilePlanInputError = class extends Error {
|
|
@@ -446,4 +446,4 @@ export {
|
|
|
446
446
|
summarizeReconcilePlan,
|
|
447
447
|
planReconciliation
|
|
448
448
|
};
|
|
449
|
-
//# sourceMappingURL=chunk-
|
|
449
|
+
//# sourceMappingURL=chunk-L3CHRBHE.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceStorageRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LIF6DO6U.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SNW3YRO6.js";
|
|
7
|
+
import {
|
|
8
|
+
isSafeRouteNamespace
|
|
9
|
+
} from "./chunk-PCXDUHQH.js";
|
|
7
10
|
import {
|
|
8
11
|
namespaceIdentityFromToken,
|
|
9
12
|
namespaceIdentityToken
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
isSafeRouteNamespace
|
|
13
|
-
} from "./chunk-U3PN77QT.js";
|
|
13
|
+
} from "./chunk-VUFL7X3H.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveNamespaceCapabilities
|
|
16
16
|
} from "./chunk-JUOZ62Y7.js";
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
verifyNamespaces,
|
|
214
214
|
runNamespaceMigration
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-L3LRWDJW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YTZA7U6Q.js";
|
|
4
4
|
import {
|
|
5
5
|
keyring_exports,
|
|
6
6
|
secureStoreDir
|
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
MutationSerializer
|
|
10
10
|
} from "./chunk-FFAZ2XFU.js";
|
|
11
11
|
import {
|
|
12
|
+
isSafeRouteNamespace
|
|
13
|
+
} from "./chunk-PCXDUHQH.js";
|
|
14
|
+
import {
|
|
15
|
+
namespaceIdentityLegacyToken,
|
|
12
16
|
namespaceIdentityToken,
|
|
13
17
|
normalizeNamespaceIdentity
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
isSafeRouteNamespace
|
|
17
|
-
} from "./chunk-U3PN77QT.js";
|
|
18
|
+
} from "./chunk-VUFL7X3H.js";
|
|
18
19
|
import {
|
|
19
20
|
resolveNamespaceCapabilities,
|
|
20
21
|
resolveRecallAuxiliaryCapabilities
|
|
@@ -85,13 +86,22 @@ async function resolveDefaultNamespaceRoot(config) {
|
|
|
85
86
|
return config.memoryDir;
|
|
86
87
|
}
|
|
87
88
|
const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);
|
|
89
|
+
const defaultNfdIdentity = defaultIdentity.normalize("NFD");
|
|
88
90
|
const legacyNsDir = resolveNamespaceDir(config.memoryDir, defaultIdentity);
|
|
91
|
+
const legacyNfdNsDir = resolveNamespaceDir(config.memoryDir, defaultNfdIdentity);
|
|
89
92
|
const tokenizedNsDir = resolveNamespaceDir(
|
|
90
93
|
config.memoryDir,
|
|
91
|
-
namespaceIdentityToken(
|
|
94
|
+
namespaceIdentityToken(defaultIdentity)
|
|
95
|
+
);
|
|
96
|
+
const legacyTokenNsDir = resolveNamespaceDir(
|
|
97
|
+
config.memoryDir,
|
|
98
|
+
namespaceIdentityLegacyToken(defaultNfdIdentity)
|
|
92
99
|
);
|
|
93
100
|
const tokenizedHasData = await exists(tokenizedNsDir) && await hasAnyNamespaceStorageMarker(tokenizedNsDir, { includeRuntimeState: true });
|
|
94
|
-
const
|
|
101
|
+
const legacyTokenHasData = await exists(legacyTokenNsDir) && await hasAnyNamespaceStorageMarker(legacyTokenNsDir, { includeRuntimeState: true });
|
|
102
|
+
const legacyHasData = await exists(legacyNsDir) && await hasAnyNamespaceStorageMarker(legacyNsDir, { includeRuntimeState: true });
|
|
103
|
+
const legacyNfdHasData = legacyNfdNsDir !== legacyNsDir && await exists(legacyNfdNsDir) && await hasAnyNamespaceStorageMarker(legacyNfdNsDir, { includeRuntimeState: true });
|
|
104
|
+
const nsDir = tokenizedHasData ? tokenizedNsDir : legacyTokenHasData ? legacyTokenNsDir : legacyHasData ? legacyNsDir : legacyNfdHasData ? legacyNfdNsDir : await exists(legacyNsDir) ? legacyNsDir : legacyNfdNsDir !== legacyNsDir && await exists(legacyNfdNsDir) ? legacyNfdNsDir : tokenizedNsDir;
|
|
95
105
|
return await exists(nsDir) && !await hasAnyLegacyData(config.memoryDir) ? nsDir : config.memoryDir;
|
|
96
106
|
}
|
|
97
107
|
async function resolveNamespaceStorageRoot(config, namespace) {
|
|
@@ -99,12 +109,26 @@ async function resolveNamespaceStorageRoot(config, namespace) {
|
|
|
99
109
|
if (normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(config.defaultNamespace)) {
|
|
100
110
|
return resolveDefaultNamespaceRoot(config);
|
|
101
111
|
}
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
const normalized = normalizeNamespaceIdentity(namespace);
|
|
113
|
+
const legacyExactNamespace = namespace.trim();
|
|
114
|
+
const legacyNfdNamespace = normalized.normalize("NFD");
|
|
115
|
+
const legacyRoot = resolveNamespaceDir(config.memoryDir, normalized);
|
|
116
|
+
const legacyExactRoot = legacyExactNamespace !== normalized && isSafeRouteNamespace(legacyExactNamespace) ? resolveNamespaceDir(config.memoryDir, legacyExactNamespace) : null;
|
|
117
|
+
const legacyNfdRoot = legacyNfdNamespace !== normalized ? resolveNamespaceDir(config.memoryDir, legacyNfdNamespace) : null;
|
|
118
|
+
const tokenizedRoot = resolveNamespaceDir(config.memoryDir, namespaceIdentityToken(normalized));
|
|
119
|
+
const legacyTokenRoots = [
|
|
120
|
+
namespaceIdentityLegacyToken(legacyExactNamespace),
|
|
121
|
+
namespaceIdentityLegacyToken(legacyNfdNamespace)
|
|
122
|
+
].filter((token, index, tokens) => tokens.indexOf(token) === index).map((token) => resolveNamespaceDir(config.memoryDir, token));
|
|
123
|
+
for (const candidate of [tokenizedRoot, ...legacyTokenRoots]) {
|
|
124
|
+
if (await exists(candidate) && await hasAnyNamespaceStorageMarker(candidate, { includeRuntimeState: true })) {
|
|
125
|
+
return candidate;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
for (const candidate of [legacyRoot, legacyExactRoot, legacyNfdRoot]) {
|
|
129
|
+
if (candidate && await exists(candidate)) return candidate;
|
|
106
130
|
}
|
|
107
|
-
return
|
|
131
|
+
return tokenizedRoot;
|
|
108
132
|
}
|
|
109
133
|
var NamespaceStorageRouter = class {
|
|
110
134
|
constructor(config, hooks = {}, catalog) {
|
|
@@ -388,4 +412,4 @@ export {
|
|
|
388
412
|
resolveNamespaceStorageRoot,
|
|
389
413
|
NamespaceStorageRouter
|
|
390
414
|
};
|
|
391
|
-
//# sourceMappingURL=chunk-
|
|
415
|
+
//# sourceMappingURL=chunk-LIF6DO6U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/namespaces/storage.ts"],"sourcesContent":["import { resolveNamespaceCapabilities, resolveRecallAuxiliaryCapabilities } from \"../capabilities.js\";\nimport path from \"node:path\";\nimport { access, lstat, readdir } from \"node:fs/promises\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport { StorageManager } from \"../storage.js\";\nimport { keyring, secureStoreDir } from \"../secure-store/index.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport {\n namespaceIdentityLegacyToken,\n namespaceIdentityToken,\n normalizeNamespaceIdentity,\n} from \"./identity.js\";\nimport type { NamespaceCatalog } from \"./catalog.js\";\nimport { MutationSerializer } from \"../utils/serialize-mutations.js\";\n\nasync function exists(p: string): Promise<boolean> {\n try {\n await access(p);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function hasStoredEntries(p: string): Promise<boolean> {\n try {\n const entry = await lstat(p);\n if (entry.isSymbolicLink()) return true;\n if (!entry.isDirectory()) return true;\n const children = await readdir(p, { withFileTypes: true });\n for (const child of children) {\n const childPath = path.join(p, child.name);\n if (child.isSymbolicLink() || child.isFile()) return true;\n if (child.isDirectory() && (await hasStoredEntries(childPath))) return true;\n }\n return false;\n } catch {\n return false;\n }\n}\n\n// Build a per-namespace directory under `<memoryDir>/namespaces` and assert the\n// resolved path stays inside that base. Namespace identifiers can originate from\n// operator config (config.defaultNamespace) and request-derived routing, so this\n// containment check prevents directory traversal (CodeQL js/path-injection).\n// For safe segments this returns exactly `path.join(base, segment)`, so there is\n// no behavioral change for valid namespaces.\nfunction resolveNamespaceDir(memoryDir: string, segment: string): string {\n // Mirror isSafeRouteNamespace's separator/parent-ref rejection (without its\n // 64-char cap, so identity tokens still pass). Rejecting separators and \"..\"\n // up front keeps the value a single contained child of <memoryDir>/namespaces.\n if (\n segment.length === 0 ||\n segment.includes(\"/\") ||\n segment.includes(\"\\\\\") ||\n segment.includes(\"..\") ||\n path.isAbsolute(segment)\n ) {\n throw new Error(`unsafe namespace path segment: ${segment}`);\n }\n return path.join(memoryDir, \"namespaces\", segment);\n}\n\nconst LEGACY_NAMESPACE_CONTENT_CHILDREN = [\n ...ALL_CATEGORY_DIRS,\n \"entities\",\n \"artifacts\",\n \"identity\",\n \"config\",\n \"summaries\",\n \"profile.md\",\n] as const;\n\nconst LEGACY_NAMESPACE_RUNTIME_CHILDREN = [\"state\"] as const;\n\nasync function hasAnyLegacyData(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await hasStoredEntries(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\nasync function hasAnyNamespaceStorageMarker(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await exists(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\n/**\n * Storage routing for namespaces.\n *\n * Compatibility note:\n * - When namespaces are enabled, existing raw namespace roots are preserved.\n * New namespace roots use tokenized names under `memoryDir/namespaces/<token>`.\n * - The default namespace continues to use the legacy `memoryDir` root unless the caller\n * has created `memoryDir/namespaces/<defaultNamespace>` (in which case we use that).\n *\n * This avoids surprising \"lost memories\" when an install flips namespaces on without\n * migrating existing data.\n */\n/**\n * Optional hooks for the storage router. `onResolve` fires whenever a namespace's\n * storage is resolved/created, so a downstream consumer (e.g. the namespace\n * catalog, issue #1499) can register the namespace. The hook MUST NOT throw into\n * the router; the router invokes it defensively and a hook failure never affects\n * storage resolution.\n *\n * The hook MAY return (or resolve to) a boolean indicating whether the\n * registration actually PERSISTED (round 6, codex P2 — NEFoX). When it resolves\n * to `false` (a dropped/no-op registration), the router does NOT mark the\n * (namespace, storageDir) pair as notified, so the next resolve RETRIES it\n * instead of suppressing it forever. A `void`/`undefined` result is treated as\n * success (legacy hooks).\n */\nexport interface NamespaceStorageRouterHooks {\n onResolve?: (\n namespace: string,\n storageDir: string,\n ) => void | boolean | Promise<void | boolean>;\n}\n\n/**\n * Resolve the runtime storage root for the configured DEFAULT namespace.\n *\n * Shared between the live router (`NamespaceStorageRouter.defaultNamespaceRoot`)\n * and the rebuildable catalog (`NamespaceCatalog.rebuildFromDisk`) so the two\n * can never diverge (CLAUDE.md rule #22/#42 — read & write paths resolve through\n * the same logic). The contract is: while legacy memory data still lives\n * directly under `memoryDir`, the default root stays `memoryDir`; only once the\n * legacy root is empty and a `namespaces/<default|token>` dir holds data does\n * the default migrate into that tokenized/legacy-named dir.\n */\nexport async function resolveDefaultNamespaceRoot(config: PluginConfig): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) {\n return config.memoryDir;\n }\n\n // Build the legacy default root from the NORMALIZED (trimmed) name so a\n // whitespace-padded `defaultNamespace` still finds the live `namespaces/default`\n // root (NIabe). `storageFor()` classifies the trimmed value as the default, and\n // the on-disk legacy dir is created under the trimmed name; using the raw spaced\n // name here would look for `namespaces/<spaced>` and miss the real root, falling\n // back to memoryDir/tokenized. `namespaceIdentityToken` already normalizes\n // internally, so the tokenized path is unaffected.\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const defaultNfdIdentity = defaultIdentity.normalize(\"NFD\");\n const legacyNsDir = resolveNamespaceDir(config.memoryDir, defaultIdentity);\n const legacyNfdNsDir = resolveNamespaceDir(config.memoryDir, defaultNfdIdentity);\n const tokenizedNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityToken(defaultIdentity),\n );\n const legacyTokenNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityLegacyToken(defaultNfdIdentity),\n );\n const tokenizedHasData =\n (await exists(tokenizedNsDir)) &&\n (await hasAnyNamespaceStorageMarker(tokenizedNsDir, { includeRuntimeState: true }));\n const legacyTokenHasData =\n (await exists(legacyTokenNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyTokenNsDir, { includeRuntimeState: true }));\n const legacyHasData =\n (await exists(legacyNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNsDir, { includeRuntimeState: true }));\n const legacyNfdHasData =\n legacyNfdNsDir !== legacyNsDir &&\n (await exists(legacyNfdNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNfdNsDir, { includeRuntimeState: true }));\n const nsDir = tokenizedHasData\n ? tokenizedNsDir\n : legacyTokenHasData\n ? legacyTokenNsDir\n : legacyHasData\n ? legacyNsDir\n : legacyNfdHasData\n ? legacyNfdNsDir\n : (await exists(legacyNsDir))\n ? legacyNsDir\n : legacyNfdNsDir !== legacyNsDir && (await exists(legacyNfdNsDir))\n ? legacyNfdNsDir\n : tokenizedNsDir;\n return (await exists(nsDir)) && !(await hasAnyLegacyData(config.memoryDir))\n ? nsDir\n : config.memoryDir;\n}\n\n/**\n * Resolve the runtime storage root for ANY namespace exactly as the live router\n * would (`NamespaceStorageRouter.namespaceRoot`). Shared so the rebuildable\n * catalog records the SAME on-disk root the router routes to — a recall/read\n * touch must not guess `namespaces/<token>` when the router actually serves a\n * legacy raw-name dir or a migrated default root (CLAUDE.md rule #22/#42; round\n * 4, cursor Medium). The default namespace delegates to `resolveDefaultNamespaceRoot`;\n * every other namespace prefers the tokenized root when it has a storage marker,\n * else a legacy raw-name dir when present, else the tokenized root.\n */\nexport async function resolveNamespaceStorageRoot(\n config: PluginConfig,\n namespace: string,\n): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) return config.memoryDir;\n // Compare on NORMALIZED identity so a whitespace-padded configured default name\n // still routes to the default root rather than a tokenized non-default dir\n // (NH-FH). The catalog keys records by the same normalized identity.\n if (normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(config.defaultNamespace)) {\n return resolveDefaultNamespaceRoot(config);\n }\n const normalized = normalizeNamespaceIdentity(namespace);\n const legacyExactNamespace = namespace.trim();\n const legacyNfdNamespace = normalized.normalize(\"NFD\");\n const legacyRoot = resolveNamespaceDir(config.memoryDir, normalized);\n const legacyExactRoot =\n legacyExactNamespace !== normalized && isSafeRouteNamespace(legacyExactNamespace)\n ? resolveNamespaceDir(config.memoryDir, legacyExactNamespace)\n : null;\n const legacyNfdRoot =\n legacyNfdNamespace !== normalized\n ? resolveNamespaceDir(config.memoryDir, legacyNfdNamespace)\n : null;\n const tokenizedRoot = resolveNamespaceDir(config.memoryDir, namespaceIdentityToken(normalized));\n const legacyTokenRoots = [\n namespaceIdentityLegacyToken(legacyExactNamespace),\n namespaceIdentityLegacyToken(legacyNfdNamespace),\n ]\n .filter((token, index, tokens) => tokens.indexOf(token) === index)\n .map((token) => resolveNamespaceDir(config.memoryDir, token));\n for (const candidate of [tokenizedRoot, ...legacyTokenRoots]) {\n if (\n (await exists(candidate)) &&\n (await hasAnyNamespaceStorageMarker(candidate, { includeRuntimeState: true }))\n ) {\n return candidate;\n }\n }\n for (const candidate of [legacyRoot, legacyExactRoot, legacyNfdRoot]) {\n if (candidate && (await exists(candidate))) return candidate;\n }\n return tokenizedRoot;\n}\n\nexport class NamespaceStorageRouter {\n private readonly cache = new Map<string, StorageManager>();\n private defaultNsRootResolved: string | null = null;\n // Dedup the resolve hook (round 6, cursor Medium — NCNL2). Recall/extraction\n // call `storageFor` repeatedly; firing `onResolve` (→ catalog loadCompacted +\n // append) on every cache hit grows `namespaces.jsonl` without bound between\n // rebuilds. We fire the hook only when the (namespace, storageDir) pair is new\n // or its dir changed, so a steady-state cache hit is a no-op for the catalog.\n private readonly notifiedResolved = new Map<string, string>();\n // Instance-scoped serializer for the resolve hook (issue #1524 adoption).\n // Replaces the bespoke `inFlightResolved` marker-then-clear pattern: the\n // serializer's per-key chain strictly orders concurrent notifications for the\n // SAME namespace, and the task re-checks `notifiedResolved` once it runs, so a\n // burst of cache hits before the first hook settles collapses to a single\n // hook invocation (the once-per-namespace intent). Recovery is preserved —\n // one rejected hook never poisons subsequent notifications for that key.\n private readonly resolveSerializer = new MutationSerializer();\n // (namespace, storageDir) pairs whose resolve hook is currently pending. Set SYNCHRONOUSLY in\n // notifyResolved (before queueing) so a burst of concurrent storageFor()\n // cache hits collapses onto the one in-flight hook instead of each enqueuing\n // its own task. Cleared when the queued hook settles. Without this, a dropped\n // hook (returns false on a rebuild-lock timeout) leaves notifiedResolved\n // unset, so every queued sibling task would re-run the hook — N serial lock\n // waits (cursor Medium 06f58a7c, codex P2).\n private readonly inFlightResolveHooks = new Set<string>();\n // Tracks every in-flight resolve-hook promise so callers can deterministically\n // await the fire-and-forget registrations that `storageFor()` kicks off (see\n // `whenResolveHooksSettled`). Entries are removed as each hook settles, so the\n // set holds at most one promise per concurrently-resolving namespace.\n private readonly pendingResolveHooks = new Set<Promise<unknown>>();\n // Pending post-write catalog touch promises (#1522). Like pendingResolveHooks,\n // lets tests await fire-and-forget write touches deterministically.\n private readonly pendingWriteTouches = new Set<Promise<unknown>>();\n\n // Normalized (trimmed) default namespace identity (NH-FH). `storageFor`\n // normalizes its input, so default-namespace branches must compare against the\n // normalized config default too — otherwise a whitespace-padded configured\n // default name routes the default namespace to a tokenized non-default root.\n private readonly defaultNamespaceIdentity: string;\n\n /** #2019: hook fired when a new namespace storage is created via storageFor. */\n onStorageCreated?: (storage: StorageManager, namespace: string) => void;\n\n constructor(\n private readonly config: PluginConfig,\n private readonly hooks: NamespaceStorageRouterHooks = {},\n /** Catalog reference for post-write/read touches (issue #1522 chokepoint). */\n private readonly catalog?: NamespaceCatalog,\n ) {\n this.defaultNamespaceIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n }\n\n private async defaultNamespaceRoot(): Promise<string> {\n this.defaultNsRootResolved = await resolveDefaultNamespaceRoot(this.config);\n return this.defaultNsRootResolved;\n }\n\n private async namespaceRoot(namespace: string): Promise<string> {\n // NOTE: only used after defaultNamespaceRoot() resolution.\n if (!resolveNamespaceCapabilities(this.config).namespaces) return this.config.memoryDir;\n if (normalizeNamespaceIdentity(namespace) === this.defaultNamespaceIdentity) {\n return this.defaultNsRootResolved ?? this.config.memoryDir;\n }\n return resolveNamespaceStorageRoot(this.config, namespace);\n }\n\n async storageFor(namespace: string): Promise<StorageManager> {\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n if (ns !== this.defaultNamespaceIdentity && !isSafeRouteNamespace(ns)) {\n throw new Error(`unsafe namespace: ${ns}`);\n }\n // Even when the default namespace is exempt from the check above, every\n // on-disk path is built through resolveNamespaceDir(), which rejects\n // traversal segments — so an unsafe configured default still cannot escape\n // <memoryDir>/namespaces (CodeQL js/path-injection).\n\n let root: string;\n if (ns === this.defaultNamespaceIdentity) {\n root = await this.defaultNamespaceRoot();\n const cached = this.cache.get(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n } else {\n const cached = this.cache.get(ns);\n root = await this.namespaceRoot(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n }\n\n // Pass the hot-memories cache gate explicitly (issue #1902, Codex P2): a\n // per-namespace child root is never registered in the per-dir default map,\n // so without this it would fall back to the process-wide default and ignore\n // THIS daemon's hotMemoriesCacheEnabled config. Threading it from config\n // keeps every namespace storage aligned with its owning orchestrator.\n const sm = new StorageManager(\n root,\n this.config.entitySchemas,\n this.config.hotMemoriesCacheEnabled,\n );\n // Register this child root's gate AND TTL in the per-dir maps (issue #1902,\n // Codex P2). The constructor override above fixes the child's own gate, but\n // its TTL is resolved via the per-dir map (hotCacheTtlMs); an unregistered\n // child root would fall back to the last process-wide TTL and could inherit\n // another daemon's value. Registering keyed by root keeps both per-dir.\n StorageManager.setHotMemoriesCacheDefault(\n root,\n this.config.hotMemoriesCacheEnabled,\n this.config.hotMemoriesCacheTtlMs,\n );\n const { scopedCacheInvalidationEnabled } = this.config;\n StorageManager.setScopedCacheInvalidationDefault(root, scopedCacheInvalidationEnabled);\n // Propagate the inline-attribution template so that router-created storages\n // (used by extraction and shared-promotion paths) strip citations consistently,\n // matching the behaviour of the primary this.storage instance in the orchestrator.\n sm.citationTemplate = this.config.inlineSourceAttributionFormat;\n // #1522: install the post-write catalog touch at the chokepoint — every\n // successful write on this StorageManager records the namespace touch.\n this.bindCatalogWriteHook(sm, ns);\n // #1579: apply the tombstone non-resurrection config so every namespace\n // storage enforces the invariant at its own writeMemory chokepoint.\n this.applyTombstonesConfig(sm, ns);\n // #2033: install the secure-store context on router-created stores. The\n // orchestrator keys ONLY its primary default-namespace storage; without\n // this, a store resolved through the router reads isSecureStoreUnlocked()\n // === false even after the operator unlocked the keyring, so secure-store\n // recovery paths (e.g. the CLI lifecycle-ledger rebuild) refuse an encrypted\n // ledger they could actually rewrite, and namespace writes could silently\n // fall back to plaintext. Mirror the orchestrator's setup exactly.\n await this.applySecureStoreConfig(sm);\n this.cache.set(ns, sm);\n // #2019: let the orchestrator wire write-triggered prioritized embedding on\n // every router-created namespace storage, not just the primary default store.\n this.onStorageCreated?.(sm, ns);\n this.notifyResolved(ns, root);\n return sm;\n }\n\n /**\n * Fire the resolve hook defensively. A hook failure (e.g. a catalog write\n * error) MUST NOT crash storage resolution — see CLAUDE.md gotcha #13.\n *\n * Issue #1524 adoption: hook invocations for the SAME namespace are now\n * strictly ordered through the shared `MutationSerializer` rather than the\n * bespoke `inFlightResolved` marker-then-clear pattern. The serializer\n * guarantees one in-flight hook per namespace; a concurrent burst of\n * `storageFor()` cache hits collapses to a single hook invocation because\n * each queued task re-checks `notifiedResolved` before invoking the hook. A\n * dropped (`false`) or rejected hook leaves `notifiedResolved` unset so the\n * next `storageFor()` retries — the serializer recovers from the rejection,\n * so a failed hook never poisons later notifications.\n */\n private notifyResolved(namespace: string, storageDir: string): void {\n const hook = this.hooks.onResolve;\n if (!hook) return;\n // Permanent dedup: skip once we've SUCCESSFULLY notified this exact\n // (namespace, storageDir). A changed dir (rare: migration/realignment)\n // still re-fires once. The mark is set ONLY AFTER the hook succeeds, so a\n // dropped registration (e.g. rebuild-lock timeout) is RETRIED on the next\n // cache hit instead of being suppressed forever (round 6, cursor Medium —\n // ND3EJ).\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n // In-flight dedup (cursor Medium 06f58a7c, codex P2): if a hook for THIS\n // namespace is already pending, collapse this call onto it instead of\n // enqueueing another task. The serializer strictly orders queued tasks, but\n // ordering alone is not enough — when the first hook returns `false`\n // (dropped touch, e.g. rebuild-lock timeout), `notifiedResolved` stays\n // unset, so each queued sibling task would pass its re-check and re-run the\n // hook. With the real catalog hook each retry can spend the full lock wait,\n // so N cache hits during a rebuild leave N serial background lock attempts.\n // Collapsing here means at most ONE hook runs per in-flight registration;\n // its result (set `notifiedResolved` on success, leave unset on drop)\n // decides whether a LATER `storageFor()` retries — collapsing loses\n // nothing because the drop is already retried on the next cache hit.\n // Keyed by the composite (namespace, storageDir) so a CHANGED dir\n // (migration/realignment) for the same namespace still gets its own hook —\n // it is NOT collapsed onto the old dir's pending registration (cursor\n // Medium, codex P2).\n const inFlightKey = namespace + \"\\u0000\" + storageDir;\n if (this.inFlightResolveHooks.has(inFlightKey)) return;\n this.inFlightResolveHooks.add(inFlightKey);\n // Queue through the serializer. Concurrent calls for the same namespace\n // strictly order here; the 2nd call's task runs only after the 1st's hook\n // settles, by which point `notifiedResolved` is either set (no-op) or still\n // unset (retry). The returned promise is tracked for\n // `whenResolveHooksSettled()`. Rejections from the task body are caught so\n // they never reach the caller (best-effort hook contract); the serializer's\n // recovered tail still lets subsequent notifications run.\n const task = async (): Promise<void> => {\n // Re-check after queueing: a prior task in this same chain may have just\n // marked the pair as notified.\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n try {\n // Hook may be sync or async; Promise.resolve normalizes both. A result\n // of `false` means the registration was dropped/no-op (e.g. rebuild-lock\n // timeout) — leave notifiedResolved UNSET so the next storageFor retries\n // (round 6, codex P2 — NEFoX). `void`/`undefined` is success for legacy\n // hooks. A rejection leaves notifiedResolved unset for the same reason.\n const persisted = await Promise.resolve(hook(namespace, storageDir));\n if (persisted !== false) {\n this.notifiedResolved.set(namespace, storageDir);\n }\n } catch {\n // Best-effort: a hook failure MUST NOT crash storage resolution. Leave\n // notifiedResolved unset so a later storageFor retries the registration.\n }\n };\n const queued = this.resolveSerializer.serialize(namespace, task);\n this.pendingResolveHooks.add(queued);\n // Clear the in-flight marker when the hook settles so a subsequent\n // storageFor() can retry after a drop, or short-circuit via notifiedResolved\n // after a success.\n const cleanup = (): void => {\n this.inFlightResolveHooks.delete(inFlightKey);\n this.pendingResolveHooks.delete(queued);\n };\n void queued.then(cleanup, cleanup);\n }\n\n /**\n * Install the post-write catalog touch hook on an externally-constructed\n * StorageManager (issue #1522). Used by the orchestrator for the legacy\n * default-namespace storage (`this.storage`) that bypasses the router.\n */\n bindCatalogWriteHook(sm: StorageManager, namespace: string): void {\n // Issue #1903: pure state-file writes only touch the catalog when explicitly\n // opted in. Router-created storages (storageFor) and the legacy default\n // storage both flow through here, so this is the single wiring point.\n sm.touchStateWrites = this.config.namespacesCatalogTouchStateWrites === true;\n sm.onCatalogWrite = () => this.touchCatalogWrite(namespace, sm.dir);\n }\n\n /**\n * Install the tombstone config on an externally-constructed StorageManager\n * (issue #1579). Mirrors `bindCatalogWriteHook` — used for the legacy\n * default-namespace storage that bypasses the router. Router-created\n * storages are wired inline in `storageFor()` via `applyTombstonesConfig`.\n */\n bindTombstonesConfig(\n sm: StorageManager,\n namespace: string,\n config: { enabled: boolean; semanticMatch: boolean; semanticThreshold: number },\n ): void {\n this.tombstonesGlobalConfig = { ...config };\n sm.setTombstonesConfig({ ...config, namespace });\n }\n\n private tombstonesGlobalConfig: {\n enabled: boolean;\n semanticMatch: boolean;\n semanticThreshold: number;\n } = { enabled: false, semanticMatch: false, semanticThreshold: 0.9 };\n\n /**\n * Apply the tombstone config to a router-created StorageManager. Called\n * inline in `storageFor()` so every namespace storage enforces the\n * non-resurrection invariant, namespace-scoped (rule 42).\n */\n private applyTombstonesConfig(sm: StorageManager, namespace: string): void {\n sm.setTombstonesConfig({ ...this.tombstonesGlobalConfig, namespace });\n }\n\n /**\n * Install the at-rest secure-store context on a router-created StorageManager\n * (#2033). Mirrors the orchestrator's primary-storage setup: mark the store\n * required so a locked store throws instead of silently writing plaintext, and\n * install the master key when the process-local keyring already holds it (the\n * operator unlocked). The secure store is one key per memory ROOT (single\n * header + per-file path-bound AAD), so every namespace store keys off the\n * root keyring id — exactly the id the orchestrator and `secure-store unlock`\n * register under. No-op when secure-store is disabled.\n */\n private async applySecureStoreConfig(sm: StorageManager): Promise<void> {\n if (!resolveRecallAuxiliaryCapabilities(this.config).secureStore) return;\n sm.setSecureStoreRequired(true);\n const existingKey = keyring.getKey(secureStoreDir(this.config.memoryDir));\n if (existingKey) {\n await sm.setSecureStoreKeyAndWait(existingKey, this.config.secureStoreEncryptOnWrite);\n }\n }\n\n /**\n * Post-write catalog touch (issue #1522 chokepoint). Called by every\n * StorageManager's post-write hook AFTER a successful write. Best-effort\n * and failure-tolerant — a catalog error MUST NOT affect the primary write\n * (gotcha #13, rule #40). Fire-and-forget by design.\n */\n private touchCatalogWrite(namespace: string, storageDir: string): void {\n if (!this.catalog) return;\n const touch = this.catalog\n .markWrite(namespace, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Record a namespace read in the catalog (issue #1522 chokepoint move).\n * Best-effort and failure-tolerant. Used by recall paths so the read touch\n * lives in the storage layer, not at the caller.\n */\n recordRead(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n void this.catalog\n .markRead(ns, { discoveredBy: \"read\", storageDir })\n .catch(() => undefined);\n }\n /**\n * Record a namespace write touch in the catalog (issue #1522). Best-effort\n * and failure-tolerant. Used by consolidation/cleanup passes that may mutate\n * the store via delete-only paths (e.g. entity-file merges, TTL cleanup) so\n * the namespace's lastWriteAt stays fresh even when no explicit write went\n * through the storage chokepoint. This is NOT a substitute for the chokepoint\n * — it's a belt-and-suspenders for paths the chokepoint doesn't cover.\n */\n recordWrite(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n const touch = this.catalog\n .markWrite(ns, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Resolve once every in-flight post-write catalog touch has settled (#1522).\n * Mirrors `whenResolveHooksSettled()`: the StorageManager's post-write hook\n * fires the catalog touch fire-and-forget, so tests asserting lastWriteAt\n * moved should await this instead of racing a timer.\n */\n async whenWriteTouchesSettled(): Promise<void> {\n // Flush any coalesced (buffered) touches first so their appends join the\n // pending set below — otherwise this could resolve while a buffered touch's\n // lastWriteAt is still unwritten on disk (#1903, Cursor). No-op when\n // coalescing is disabled (window 0) or the catalog is inert.\n await this.catalog?.flushPendingTouches().catch(() => undefined);\n while (this.pendingWriteTouches.size > 0) {\n await Promise.allSettled([...this.pendingWriteTouches]);\n }\n }\n\n /**\n * Resolve once every in-flight `onResolve` registration has settled.\n *\n * `storageFor()` fires the resolve hook fire-and-forget, so its catalog side\n * effect (e.g. `registerResolved(...)`) is not observable the moment\n * `storageFor()` returns. Callers that must act on that side effect — notably\n * tests asserting the catalog was updated — should await this instead of\n * racing a timer. Resolves immediately when no hook is registered or nothing\n * is in flight. The loop re-checks because a settling hook could, in\n * principle, trigger a follow-on resolution.\n */\n async whenResolveHooksSettled(): Promise<void> {\n while (this.pendingResolveHooks.size > 0) {\n await Promise.allSettled([...this.pendingResolveHooks]);\n }\n }\n\n /**\n * #2019: iterate the currently cached router storages with their namespace so\n * callers can wire hooks on stores resolved before the hook was installed.\n */\n forEachCachedStorage(fn: (storage: StorageManager, namespace: string) => void): void {\n for (const [namespace, storage] of this.cache) fn(storage, namespace);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,QAAQ,OAAO,eAAe;AAcvC,eAAe,OAAO,GAA6B;AACjD,MAAI;AACF,UAAM,OAAO,CAAC;AACd,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,iBAAiB,GAA6B;AAC3D,MAAI;AACF,UAAM,QAAQ,MAAM,MAAM,CAAC;AAC3B,QAAI,MAAM,eAAe,EAAG,QAAO;AACnC,QAAI,CAAC,MAAM,YAAY,EAAG,QAAO;AACjC,UAAM,WAAW,MAAM,QAAQ,GAAG,EAAE,eAAe,KAAK,CAAC;AACzD,eAAW,SAAS,UAAU;AAC5B,YAAM,YAAY,KAAK,KAAK,GAAG,MAAM,IAAI;AACzC,UAAI,MAAM,eAAe,KAAK,MAAM,OAAO,EAAG,QAAO;AACrD,UAAI,MAAM,YAAY,KAAM,MAAM,iBAAiB,SAAS,EAAI,QAAO;AAAA,IACzE;AACA,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAQA,SAAS,oBAAoB,WAAmB,SAAyB;AAIvE,MACE,QAAQ,WAAW,KACnB,QAAQ,SAAS,GAAG,KACpB,QAAQ,SAAS,IAAI,KACrB,QAAQ,SAAS,IAAI,KACrB,KAAK,WAAW,OAAO,GACvB;AACA,UAAM,IAAI,MAAM,kCAA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js";
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
computeServiceCorpusWatermarks,
|
|
283
283
|
computeServiceCorpusCensus
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-LJJWFV2Q.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SupportPassportError,
|
|
3
3
|
getOperation
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CZUHNJHX.js";
|
|
5
5
|
import {
|
|
6
6
|
abortError,
|
|
7
7
|
isAbortError
|
|
@@ -499,4 +499,4 @@ export {
|
|
|
499
499
|
buildSupportPassportPublicRequestHandler,
|
|
500
500
|
composeSupportPassportExternalRequestHandlers
|
|
501
501
|
};
|
|
502
|
-
//# sourceMappingURL=chunk-
|
|
502
|
+
//# sourceMappingURL=chunk-LRDP2AC2.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-2LSZVONP.js";
|
|
14
14
|
import {
|
|
15
15
|
isSafeRouteNamespace
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PCXDUHQH.js";
|
|
17
17
|
|
|
18
18
|
// src/maintenance/graph-edge-decay.ts
|
|
19
19
|
import {
|
|
@@ -203,4 +203,4 @@ export {
|
|
|
203
203
|
discoverGraphNamespaceRoots,
|
|
204
204
|
runGraphEdgeDecayMaintenanceAcrossNamespaces
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-LTBKKSCX.js.map
|