@remnic/core 9.3.701 → 9.3.702
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-boundary.d.ts +7 -7
- package/dist/access-boundary.js +15 -12
- package/dist/access-cli.js +36 -33
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +7 -7
- package/dist/access-http.js +18 -15
- package/dist/access-mcp.d.ts +7 -7
- package/dist/access-mcp.js +17 -14
- package/dist/access-operations.d.ts +7 -7
- package/dist/access-operations.js +16 -13
- package/dist/{access-service-CGVWK6lZ.d.ts → access-service-COCzhgEL.d.ts} +397 -19
- package/dist/access-service.d.ts +6 -6
- package/dist/access-service.js +14 -11
- package/dist/access-surface-catalog.d.ts +7 -7
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +7 -6
- package/dist/active-recall.js.map +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +5 -5
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +6 -5
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-DBIghceA.d.ts → catalog-DxCzhjE6.d.ts} +2 -2
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +7 -6
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-YXLT4EMM.js → chunk-4463LUIE.js} +12 -2
- package/dist/chunk-4463LUIE.js.map +1 -0
- package/dist/{chunk-R5DB26G6.js → chunk-4SBW47WK.js} +9 -23
- package/dist/chunk-4SBW47WK.js.map +1 -0
- package/dist/{chunk-KF4TXW7Z.js → chunk-5VXVXJH6.js} +149 -6
- package/dist/{chunk-KF4TXW7Z.js.map → chunk-5VXVXJH6.js.map} +1 -1
- package/dist/{chunk-ODTWHSY2.js → chunk-64XXOQRW.js} +2 -2
- package/dist/{chunk-ZT7B64BE.js → chunk-6TAETM63.js} +2 -2
- package/dist/{chunk-HF4N43Q7.js → chunk-6VVP6NK7.js} +2 -2
- package/dist/{chunk-FN2SM5SN.js → chunk-ABCGDW3A.js} +75 -12
- package/dist/chunk-ABCGDW3A.js.map +1 -0
- package/dist/{chunk-7TAQEPLE.js → chunk-AMNLZ6SF.js} +2 -2
- package/dist/{chunk-KS7WQ4BZ.js → chunk-CZJ6QSKG.js} +3 -3
- package/dist/{chunk-27LQPUMZ.js → chunk-EOOVJK2U.js} +3 -3
- package/dist/{chunk-QP37KL5H.js → chunk-EYJD6KIO.js} +2 -2
- package/dist/{chunk-WFEZUGU5.js → chunk-EZR35XHX.js} +2 -2
- package/dist/{chunk-UU6MVCJ6.js → chunk-FIOYURII.js} +32 -25
- package/dist/chunk-FIOYURII.js.map +1 -0
- package/dist/{chunk-JO3E5VGS.js → chunk-FVI5B7DE.js} +2 -2
- package/dist/{chunk-SFMRLXIV.js → chunk-GFIARMA7.js} +15 -7
- package/dist/chunk-GFIARMA7.js.map +1 -0
- package/dist/{chunk-PONNZ54D.js → chunk-GY3SKOS4.js} +4 -4
- package/dist/{chunk-U33LWTQQ.js → chunk-HV57RHMD.js} +4 -4
- package/dist/{chunk-IKNQAGBV.js → chunk-IX3UQT4H.js} +1 -1
- package/dist/{chunk-IKNQAGBV.js.map → chunk-IX3UQT4H.js.map} +1 -1
- package/dist/{chunk-IYOPIG3E.js → chunk-IX72AAMZ.js} +2 -2
- package/dist/{chunk-JKOKX3PS.js → chunk-JMA4RYRN.js} +2 -2
- package/dist/{chunk-DEDQXIDL.js → chunk-JTKFZMZ7.js} +2 -2
- package/dist/{chunk-OLOYQZFB.js → chunk-KC6TCAWV.js} +5 -5
- package/dist/{chunk-ROZJACKP.js → chunk-KKK7YTYN.js} +4 -1
- package/dist/chunk-KKK7YTYN.js.map +1 -0
- package/dist/{chunk-EC2AYKRX.js → chunk-L6W77GWW.js} +10 -24
- package/dist/chunk-L6W77GWW.js.map +1 -0
- package/dist/{chunk-ED35D32I.js → chunk-LQ4J7ELC.js} +2 -2
- package/dist/chunk-LUPVCGYK.js +63 -0
- package/dist/chunk-LUPVCGYK.js.map +1 -0
- package/dist/{chunk-TFVVONWD.js → chunk-MBUM2Y3L.js} +2 -2
- package/dist/{chunk-T5QAZIBO.js → chunk-MOXFPLD6.js} +3 -3
- package/dist/{chunk-XTIRCSIH.js → chunk-MXEWQKM7.js} +2 -2
- package/dist/{chunk-ZYNMX6IU.js → chunk-NUIJEGVD.js} +6 -6
- package/dist/{chunk-FUCJAZ25.js → chunk-OXEAMU42.js} +529 -9
- package/dist/chunk-OXEAMU42.js.map +1 -0
- package/dist/{chunk-YO4MBK3I.js → chunk-QGJAGC2J.js} +2 -2
- package/dist/{chunk-ISLJ5WIM.js → chunk-QIMFOCSH.js} +2 -2
- package/dist/{chunk-IJEZMWKA.js → chunk-SFOAQQDJ.js} +3 -3
- package/dist/{chunk-HRUULBBV.js → chunk-SHRRWOVY.js} +81 -4
- package/dist/chunk-SHRRWOVY.js.map +1 -0
- package/dist/{chunk-NINRTFSV.js → chunk-SINGJCUR.js} +5 -5
- package/dist/{chunk-ZPQVJEVQ.js → chunk-SK2CR6MW.js} +146 -2
- package/dist/chunk-SK2CR6MW.js.map +1 -0
- package/dist/{chunk-6W2D6FGG.js → chunk-TGAHHCB6.js} +2 -2
- package/dist/{chunk-D75JXBV4.js → chunk-WN4GHSDH.js} +2 -2
- package/dist/{chunk-K4DWSPMW.js → chunk-WRGPE6AW.js} +2 -2
- package/dist/{chunk-4HIAWLA2.js → chunk-XGMCUY5P.js} +60 -114
- package/dist/chunk-XGMCUY5P.js.map +1 -0
- package/dist/{chunk-SDPDU2PM.js → chunk-YTMDF6S7.js} +2 -2
- package/dist/{chunk-MNU5G4TK.js → chunk-Z7XEIAV4.js} +2 -2
- package/dist/{chunk-HXHKLVAS.js → chunk-ZCEI242W.js} +23 -23
- package/dist/{cli-D3XeenwN.d.ts → cli-BM4xQPp4.d.ts} +3 -3
- package/dist/cli.d.ts +7 -7
- package/dist/cli.js +33 -32
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +6 -5
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +6 -5
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +7 -6
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +6 -5
- package/dist/entity-schema.d.ts +1 -1
- package/dist/event-order-recall.js +2 -1
- package/dist/explicit-capture.d.ts +5 -5
- package/dist/explicit-capture.js +2 -2
- package/dist/explicit-cue-recall.js +2 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +14 -1
- package/dist/extraction.js +5 -3
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +123 -123
- package/dist/index.js +53 -52
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +6 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -5
- package/dist/maintenance/rebuild-memory-projection.js +7 -6
- package/dist/mcp-memory-inspector-app.d.ts +7 -7
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +2 -2
- package/dist/namespaces/migrate.js +7 -6
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +6 -5
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +12 -11
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +8 -7
- package/dist/{orchestrator-BzMCZlKn.d.ts → orchestrator-C9CDWAm6.d.ts} +4 -4
- package/dist/orchestrator.d.ts +5 -5
- package/dist/orchestrator.js +29 -27
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +36 -2
- package/dist/provenance.js +5 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-pipeline-stages.d.ts +15 -0
- package/dist/recall-pipeline-stages.js +3 -56
- package/dist/recall-pipeline-stages.js.map +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/response-guidance-recall.js +2 -1
- package/dist/resume-bundles.js +7 -5
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/schemas.d.ts +19 -0
- package/dist/schemas.js +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-DJR8_DMQ.d.ts → semantic-SLAa_prH.d.ts} +1 -1
- package/dist/{semantic-consolidation-BtUfv-AL.d.ts → semantic-consolidation-DgFXyALl.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +7 -6
- package/dist/semantic-rule-promotion.js +6 -5
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +6 -5
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +13 -1
- package/dist/storage.js +5 -4
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/targeted-fact-recall.js +2 -1
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transcript.js +2 -2
- package/dist/{types-PuiPZ9iE.d.ts → types-MWKPZnM0.d.ts} +25 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +6 -5
- package/package.json +2 -2
- package/src/access-http.ts +162 -0
- package/src/access-service.ts +215 -0
- package/src/admin/admin-surfaces.test.ts +458 -0
- package/src/admin/admin-surfaces.ts +819 -0
- package/src/event-order-recall.test.ts +53 -0
- package/src/event-order-recall.ts +61 -37
- package/src/explicit-cue-recall.ts +21 -1
- package/src/extraction.ts +91 -6
- package/src/orchestrator.ts +46 -5
- package/src/provenance-extraction.test.ts +838 -0
- package/src/provenance.ts +413 -0
- package/src/recall-pipeline-parity.test.ts +288 -0
- package/src/recall-pipeline-stages.test.ts +43 -0
- package/src/recall-pipeline-stages.ts +22 -0
- package/src/response-guidance-recall.ts +32 -36
- package/src/schemas.ts +7 -0
- package/src/storage.ts +23 -0
- package/src/targeted-fact-recall.ts +25 -32
- package/src/types.ts +24 -0
- package/dist/chunk-4HIAWLA2.js.map +0 -1
- package/dist/chunk-EC2AYKRX.js.map +0 -1
- package/dist/chunk-FN2SM5SN.js.map +0 -1
- package/dist/chunk-FUCJAZ25.js.map +0 -1
- package/dist/chunk-HRUULBBV.js.map +0 -1
- package/dist/chunk-R5DB26G6.js.map +0 -1
- package/dist/chunk-ROZJACKP.js.map +0 -1
- package/dist/chunk-SFMRLXIV.js.map +0 -1
- package/dist/chunk-UU6MVCJ6.js.map +0 -1
- package/dist/chunk-YXLT4EMM.js.map +0 -1
- package/dist/chunk-ZPQVJEVQ.js.map +0 -1
- /package/dist/{chunk-ODTWHSY2.js.map → chunk-64XXOQRW.js.map} +0 -0
- /package/dist/{chunk-ZT7B64BE.js.map → chunk-6TAETM63.js.map} +0 -0
- /package/dist/{chunk-HF4N43Q7.js.map → chunk-6VVP6NK7.js.map} +0 -0
- /package/dist/{chunk-7TAQEPLE.js.map → chunk-AMNLZ6SF.js.map} +0 -0
- /package/dist/{chunk-KS7WQ4BZ.js.map → chunk-CZJ6QSKG.js.map} +0 -0
- /package/dist/{chunk-27LQPUMZ.js.map → chunk-EOOVJK2U.js.map} +0 -0
- /package/dist/{chunk-QP37KL5H.js.map → chunk-EYJD6KIO.js.map} +0 -0
- /package/dist/{chunk-WFEZUGU5.js.map → chunk-EZR35XHX.js.map} +0 -0
- /package/dist/{chunk-JO3E5VGS.js.map → chunk-FVI5B7DE.js.map} +0 -0
- /package/dist/{chunk-PONNZ54D.js.map → chunk-GY3SKOS4.js.map} +0 -0
- /package/dist/{chunk-U33LWTQQ.js.map → chunk-HV57RHMD.js.map} +0 -0
- /package/dist/{chunk-IYOPIG3E.js.map → chunk-IX72AAMZ.js.map} +0 -0
- /package/dist/{chunk-JKOKX3PS.js.map → chunk-JMA4RYRN.js.map} +0 -0
- /package/dist/{chunk-DEDQXIDL.js.map → chunk-JTKFZMZ7.js.map} +0 -0
- /package/dist/{chunk-OLOYQZFB.js.map → chunk-KC6TCAWV.js.map} +0 -0
- /package/dist/{chunk-ED35D32I.js.map → chunk-LQ4J7ELC.js.map} +0 -0
- /package/dist/{chunk-TFVVONWD.js.map → chunk-MBUM2Y3L.js.map} +0 -0
- /package/dist/{chunk-T5QAZIBO.js.map → chunk-MOXFPLD6.js.map} +0 -0
- /package/dist/{chunk-XTIRCSIH.js.map → chunk-MXEWQKM7.js.map} +0 -0
- /package/dist/{chunk-ZYNMX6IU.js.map → chunk-NUIJEGVD.js.map} +0 -0
- /package/dist/{chunk-YO4MBK3I.js.map → chunk-QGJAGC2J.js.map} +0 -0
- /package/dist/{chunk-ISLJ5WIM.js.map → chunk-QIMFOCSH.js.map} +0 -0
- /package/dist/{chunk-IJEZMWKA.js.map → chunk-SFOAQQDJ.js.map} +0 -0
- /package/dist/{chunk-NINRTFSV.js.map → chunk-SINGJCUR.js.map} +0 -0
- /package/dist/{chunk-6W2D6FGG.js.map → chunk-TGAHHCB6.js.map} +0 -0
- /package/dist/{chunk-D75JXBV4.js.map → chunk-WN4GHSDH.js.map} +0 -0
- /package/dist/{chunk-K4DWSPMW.js.map → chunk-WRGPE6AW.js.map} +0 -0
- /package/dist/{chunk-SDPDU2PM.js.map → chunk-YTMDF6S7.js.map} +0 -0
- /package/dist/{chunk-MNU5G4TK.js.map → chunk-Z7XEIAV4.js.map} +0 -0
- /package/dist/{chunk-HXHKLVAS.js.map → chunk-ZCEI242W.js.map} +0 -0
|
@@ -9,9 +9,12 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
importCapsule
|
|
11
11
|
} from "./chunk-DL6H3D7S.js";
|
|
12
|
+
import {
|
|
13
|
+
planSessionTranscriptMigration
|
|
14
|
+
} from "./chunk-IQ7WCZRW.js";
|
|
12
15
|
import {
|
|
13
16
|
toRecallExplainJson
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WN4GHSDH.js";
|
|
15
18
|
import {
|
|
16
19
|
applyTagFilter,
|
|
17
20
|
normalizeTags,
|
|
@@ -29,9 +32,10 @@ import {
|
|
|
29
32
|
projectTagProjectId,
|
|
30
33
|
resolveCodingNamespaceOverlay,
|
|
31
34
|
resolveGitContext,
|
|
35
|
+
resolveScopePlan,
|
|
32
36
|
resolveScopeProfilePlan,
|
|
33
37
|
sanitizeFragment
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-SHRRWOVY.js";
|
|
35
39
|
import {
|
|
36
40
|
getTrustZoneStoreStatus,
|
|
37
41
|
isTrustZoneName,
|
|
@@ -46,7 +50,7 @@ import {
|
|
|
46
50
|
} from "./chunk-FF4KLI5W.js";
|
|
47
51
|
import {
|
|
48
52
|
estimateRecallTokens
|
|
49
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-YTMDF6S7.js";
|
|
50
54
|
import {
|
|
51
55
|
recordObjectiveStateSnapshotsFromObservedMessages
|
|
52
56
|
} from "./chunk-BMFZLLNI.js";
|
|
@@ -60,7 +64,7 @@ import {
|
|
|
60
64
|
listMemoryGovernanceRuns,
|
|
61
65
|
readMemoryGovernanceRunArtifact,
|
|
62
66
|
runMemoryGovernance
|
|
63
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-MBUM2Y3L.js";
|
|
64
68
|
import {
|
|
65
69
|
namespaceCollectionName
|
|
66
70
|
} from "./chunk-VPAFWWCL.js";
|
|
@@ -83,7 +87,7 @@ import {
|
|
|
83
87
|
persistExplicitCapture,
|
|
84
88
|
queueExplicitCaptureForReview,
|
|
85
89
|
validateExplicitCaptureInput
|
|
86
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-HV57RHMD.js";
|
|
87
91
|
import {
|
|
88
92
|
buildProcedurePersistBody,
|
|
89
93
|
normalizeProcedureSteps
|
|
@@ -103,17 +107,17 @@ import {
|
|
|
103
107
|
buildBriefing,
|
|
104
108
|
parseBriefingFocus,
|
|
105
109
|
parseBriefingWindow
|
|
106
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-6VVP6NK7.js";
|
|
107
111
|
import {
|
|
108
112
|
parseEntityFile
|
|
109
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-GFIARMA7.js";
|
|
110
114
|
import {
|
|
111
115
|
stripAttributesSuffix
|
|
112
116
|
} from "./chunk-SVOZFLIQ.js";
|
|
113
117
|
import {
|
|
114
118
|
DEFAULT_RECALL_DISCLOSURE,
|
|
115
119
|
isRecallDisclosure
|
|
116
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-IX3UQT4H.js";
|
|
117
121
|
import {
|
|
118
122
|
normalizeProjectionPreview,
|
|
119
123
|
normalizeProjectionTags
|
|
@@ -2420,6 +2424,365 @@ function formatProcedureStatsText(report) {
|
|
|
2420
2424
|
return lines.join("\n") + "\n";
|
|
2421
2425
|
}
|
|
2422
2426
|
|
|
2427
|
+
// src/admin/admin-surfaces.ts
|
|
2428
|
+
import path5 from "path";
|
|
2429
|
+
var REDACTED = "<redacted>";
|
|
2430
|
+
var SENSITIVE_KEY_RE = /(token|secret|password|api[_-]?key|bearer|authorization|credential|private[_-]?key)/i;
|
|
2431
|
+
var BEARER_VALUE_RE = /^(bearer|sk-|pk-|xox[bp]-|AKIA)/i;
|
|
2432
|
+
var LONG_OPAQUE_RE = /^[A-Za-z0-9_\-]{32,}$/;
|
|
2433
|
+
var SAFE_DIAGNOSTIC_KEYS = /* @__PURE__ */ new Set(["identityToken"]);
|
|
2434
|
+
function redactSensitive(value) {
|
|
2435
|
+
return walkRedact(value, void 0);
|
|
2436
|
+
}
|
|
2437
|
+
function walkRedact(value, key) {
|
|
2438
|
+
if (typeof value === "string") {
|
|
2439
|
+
if (key && SENSITIVE_KEY_RE.test(key) && !SAFE_DIAGNOSTIC_KEYS.has(key)) {
|
|
2440
|
+
return REDACTED;
|
|
2441
|
+
}
|
|
2442
|
+
if (BEARER_VALUE_RE.test(value)) return REDACTED;
|
|
2443
|
+
if (!(key && SAFE_DIAGNOSTIC_KEYS.has(key)) && LONG_OPAQUE_RE.test(value) && value.length >= 40 && !/^[0-9a-f]{16}$/.test(value)) {
|
|
2444
|
+
return REDACTED;
|
|
2445
|
+
}
|
|
2446
|
+
return value;
|
|
2447
|
+
}
|
|
2448
|
+
if (Array.isArray(value)) {
|
|
2449
|
+
return value.map((entry) => walkRedact(entry, void 0));
|
|
2450
|
+
}
|
|
2451
|
+
if (value && typeof value === "object") {
|
|
2452
|
+
const record = value;
|
|
2453
|
+
const out = {};
|
|
2454
|
+
for (const [k, v] of Object.entries(record)) {
|
|
2455
|
+
out[k] = walkRedact(v, k);
|
|
2456
|
+
}
|
|
2457
|
+
return out;
|
|
2458
|
+
}
|
|
2459
|
+
return value;
|
|
2460
|
+
}
|
|
2461
|
+
function inspectScope(options) {
|
|
2462
|
+
const { config } = options;
|
|
2463
|
+
const namespacesEnabled = options.namespacesEnabled ?? config.namespacesEnabled === true;
|
|
2464
|
+
const plan = resolveScopePlan({
|
|
2465
|
+
config,
|
|
2466
|
+
sessionKey: options.sessionKey,
|
|
2467
|
+
namespace: options.namespace,
|
|
2468
|
+
principalOverride: options.principalOverride,
|
|
2469
|
+
codingContext: options.codingContext ?? null,
|
|
2470
|
+
namespacesEnabled
|
|
2471
|
+
});
|
|
2472
|
+
const warnings = [];
|
|
2473
|
+
if (namespacesEnabled && !plan.principal) {
|
|
2474
|
+
warnings.push("namespace routing is enabled but no principal resolved for this session key");
|
|
2475
|
+
}
|
|
2476
|
+
if (config.codingMode?.projectScope && namespacesEnabled && options.codingContext && !plan.codingOverlay) {
|
|
2477
|
+
warnings.push("coding project scope is enabled but the overlay was suppressed by an explicit namespace override");
|
|
2478
|
+
}
|
|
2479
|
+
if (options.namespace && options.namespace.trim().length > 0 && !plan.namespaceOverride) {
|
|
2480
|
+
warnings.push(
|
|
2481
|
+
`requested namespace override '${options.namespace}' is not readable by this principal and was ignored`
|
|
2482
|
+
);
|
|
2483
|
+
}
|
|
2484
|
+
const layers = [];
|
|
2485
|
+
const scopeProfilePlan = plan.scopeProfilePlan;
|
|
2486
|
+
if (scopeProfilePlan) {
|
|
2487
|
+
for (const layer of scopeProfilePlan.layers) {
|
|
2488
|
+
layers.push({
|
|
2489
|
+
id: layer.id,
|
|
2490
|
+
namespace: layer.namespace,
|
|
2491
|
+
readable: layer.readable,
|
|
2492
|
+
writable: layer.writable,
|
|
2493
|
+
promotable: layer.promotable,
|
|
2494
|
+
reason: layer.reason
|
|
2495
|
+
});
|
|
2496
|
+
}
|
|
2497
|
+
for (const target of scopeProfilePlan.promotionTargets) {
|
|
2498
|
+
if (!layers.some((layer) => layer.id === target.target)) {
|
|
2499
|
+
layers.push({
|
|
2500
|
+
id: target.target,
|
|
2501
|
+
namespace: target.namespace,
|
|
2502
|
+
readable: false,
|
|
2503
|
+
writable: false,
|
|
2504
|
+
promotable: target.authorized,
|
|
2505
|
+
reason: target.reason
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
} else {
|
|
2510
|
+
layers.push({
|
|
2511
|
+
id: "self",
|
|
2512
|
+
namespace: plan.baseNamespace,
|
|
2513
|
+
readable: canReadNamespace(plan.principal, plan.baseNamespace, config),
|
|
2514
|
+
writable: canWriteNamespace(plan.principal, plan.baseNamespace, config),
|
|
2515
|
+
promotable: false,
|
|
2516
|
+
reason: "principal self namespace (no scope profile active)"
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
if (plan.codingOverlay) {
|
|
2520
|
+
layers.push({
|
|
2521
|
+
id: "coding",
|
|
2522
|
+
namespace: plan.codingOverlay.namespace,
|
|
2523
|
+
readable: true,
|
|
2524
|
+
writable: true,
|
|
2525
|
+
promotable: false,
|
|
2526
|
+
reason: "coding overlay namespace combined with the principal base (rule 42)"
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
if (plan.namespaceOverride) {
|
|
2530
|
+
layers.push({
|
|
2531
|
+
id: "explicit",
|
|
2532
|
+
namespace: plan.namespaceOverride,
|
|
2533
|
+
readable: true,
|
|
2534
|
+
writable: canWriteNamespace(plan.principal, plan.namespaceOverride, config),
|
|
2535
|
+
promotable: false,
|
|
2536
|
+
reason: "explicit namespace override authorized for this principal"
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
const promotionTargets = scopeProfilePlan ? scopeProfilePlan.promotionTargets.map((target) => ({
|
|
2540
|
+
target: target.target,
|
|
2541
|
+
namespace: target.namespace,
|
|
2542
|
+
authorized: target.authorized,
|
|
2543
|
+
reason: target.reason
|
|
2544
|
+
})) : [];
|
|
2545
|
+
for (const warning of scopeProfilePlan?.warnings ?? []) {
|
|
2546
|
+
warnings.push(warning);
|
|
2547
|
+
}
|
|
2548
|
+
return {
|
|
2549
|
+
principal: plan.principal,
|
|
2550
|
+
namespaceOverride: plan.namespaceOverride,
|
|
2551
|
+
writeNamespace: plan.baseNamespace,
|
|
2552
|
+
readNamespaces: [...plan.readNamespaces],
|
|
2553
|
+
codingOverlay: plan.codingOverlay ? {
|
|
2554
|
+
namespace: plan.codingOverlay.namespace,
|
|
2555
|
+
readFallbacks: plan.codingOverlay.readFallbacks
|
|
2556
|
+
} : null,
|
|
2557
|
+
scopeProfileId: scopeProfilePlan?.profileId ?? null,
|
|
2558
|
+
layers,
|
|
2559
|
+
promotionTargets,
|
|
2560
|
+
warnings,
|
|
2561
|
+
plan
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
async function listAdminNamespaces(options) {
|
|
2565
|
+
const { catalog, filter } = options;
|
|
2566
|
+
if (!catalog.enabled) {
|
|
2567
|
+
return { enabled: false, entries: [] };
|
|
2568
|
+
}
|
|
2569
|
+
const staleMs = (options.staleThresholdDays ?? 30) * 24 * 60 * 60 * 1e3;
|
|
2570
|
+
const staleBefore = new Date(Date.now() - staleMs);
|
|
2571
|
+
const records = await catalog.listNamespaces({
|
|
2572
|
+
kind: filter?.kind,
|
|
2573
|
+
discoveredBy: filter?.discoveredBy,
|
|
2574
|
+
writtenSince: filter?.writtenSince
|
|
2575
|
+
});
|
|
2576
|
+
let entries = records.map((record) => toAdminEntry(record, staleBefore));
|
|
2577
|
+
if (filter?.principal) {
|
|
2578
|
+
entries = entries.filter((entry) => entry.principal === filter.principal);
|
|
2579
|
+
}
|
|
2580
|
+
if (filter?.projectId) {
|
|
2581
|
+
entries = entries.filter((entry) => entry.projectId === filter.projectId);
|
|
2582
|
+
}
|
|
2583
|
+
if (filter?.staleBefore) {
|
|
2584
|
+
const cutoff = filter.staleBefore.getTime();
|
|
2585
|
+
entries = entries.filter((entry) => {
|
|
2586
|
+
if (!entry.lastWriteAt) return true;
|
|
2587
|
+
const ms = Date.parse(entry.lastWriteAt);
|
|
2588
|
+
return Number.isFinite(ms) && ms <= cutoff;
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
return { enabled: true, entries };
|
|
2592
|
+
}
|
|
2593
|
+
function toAdminEntry(record, staleBefore) {
|
|
2594
|
+
const lastWriteMs = record.lastWriteAt ? Date.parse(record.lastWriteAt) : Number.NaN;
|
|
2595
|
+
const stale = !Number.isFinite(lastWriteMs) || lastWriteMs < staleBefore.getTime();
|
|
2596
|
+
return {
|
|
2597
|
+
namespace: record.namespace,
|
|
2598
|
+
identityToken: record.identityToken,
|
|
2599
|
+
kind: record.kind,
|
|
2600
|
+
principal: record.principal,
|
|
2601
|
+
projectId: record.projectId,
|
|
2602
|
+
branch: record.branch,
|
|
2603
|
+
parentNamespace: record.parentNamespace,
|
|
2604
|
+
createdAt: record.createdAt,
|
|
2605
|
+
lastReadAt: record.lastReadAt,
|
|
2606
|
+
lastWriteAt: record.lastWriteAt,
|
|
2607
|
+
lastMaintenanceAt: record.lastMaintenanceAt,
|
|
2608
|
+
storageDir: record.storageDir,
|
|
2609
|
+
discoveredBy: record.discoveredBy,
|
|
2610
|
+
stale
|
|
2611
|
+
};
|
|
2612
|
+
}
|
|
2613
|
+
async function gatherMaintenanceHealth(options) {
|
|
2614
|
+
const { catalog, qmdHealthProvider } = options;
|
|
2615
|
+
if (!catalog.enabled) {
|
|
2616
|
+
return { enabled: false, degradedMode: false, perNamespace: [] };
|
|
2617
|
+
}
|
|
2618
|
+
const records = await catalog.listNamespaces();
|
|
2619
|
+
let degradedMode = false;
|
|
2620
|
+
const perNamespace = await Promise.all(
|
|
2621
|
+
records.map(async (record) => {
|
|
2622
|
+
const entry = {
|
|
2623
|
+
namespace: record.namespace,
|
|
2624
|
+
kind: record.kind,
|
|
2625
|
+
lastMaintenanceAt: record.lastMaintenanceAt,
|
|
2626
|
+
maintenanceMissing: !record.lastMaintenanceAt || Object.keys(record.lastMaintenanceAt).length === 0,
|
|
2627
|
+
qmdDegraded: false
|
|
2628
|
+
};
|
|
2629
|
+
if (qmdHealthProvider) {
|
|
2630
|
+
try {
|
|
2631
|
+
const qmd = await qmdHealthProvider(record.namespace);
|
|
2632
|
+
if (qmd) {
|
|
2633
|
+
entry.qmd = qmd;
|
|
2634
|
+
entry.qmdDegraded = !qmd.available || qmd.collectionState === "missing" || qmd.collectionState === "unknown";
|
|
2635
|
+
}
|
|
2636
|
+
} catch (err) {
|
|
2637
|
+
entry.qmdDegraded = true;
|
|
2638
|
+
entry.qmdError = "QMD health probe failed";
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
if (entry.qmdDegraded) degradedMode = true;
|
|
2642
|
+
return entry;
|
|
2643
|
+
})
|
|
2644
|
+
);
|
|
2645
|
+
return { enabled: true, degradedMode, perNamespace };
|
|
2646
|
+
}
|
|
2647
|
+
async function auditTranscripts(memoryDir) {
|
|
2648
|
+
const plan = await planSessionTranscriptMigration({
|
|
2649
|
+
memoryDir,
|
|
2650
|
+
apply: false
|
|
2651
|
+
});
|
|
2652
|
+
const files = plan.files.map((file) => ({
|
|
2653
|
+
sourceRelPath: file.sourceRelPath,
|
|
2654
|
+
fileName: file.fileName,
|
|
2655
|
+
distinctSessions: file.groups.length,
|
|
2656
|
+
movedEntries: file.groups.reduce((sum, group) => sum + group.entryCount, 0),
|
|
2657
|
+
unmovableLines: file.unmovableLines
|
|
2658
|
+
}));
|
|
2659
|
+
const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path5.sep).includes("other"));
|
|
2660
|
+
const summary = plan.movedEntries === 0 ? "No mixed-session transcript data detected; nothing to migrate." : `Found ${plan.movedEntries} entries across ${plan.distinctSessions} distinct sessions stranded in shared/legacy directories. Run the CLI migration command to re-home them.`;
|
|
2661
|
+
return {
|
|
2662
|
+
generatedAt: plan.generatedAt,
|
|
2663
|
+
dryRun: true,
|
|
2664
|
+
transcriptsDir: plan.transcriptsDir,
|
|
2665
|
+
mixedOtherDefault,
|
|
2666
|
+
distinctSessions: plan.distinctSessions,
|
|
2667
|
+
movedEntries: plan.movedEntries,
|
|
2668
|
+
files,
|
|
2669
|
+
summary
|
|
2670
|
+
};
|
|
2671
|
+
}
|
|
2672
|
+
var AdminPromotionError = class extends Error {
|
|
2673
|
+
code;
|
|
2674
|
+
constructor(code, message) {
|
|
2675
|
+
super(message);
|
|
2676
|
+
this.name = "AdminPromotionError";
|
|
2677
|
+
this.code = code;
|
|
2678
|
+
}
|
|
2679
|
+
};
|
|
2680
|
+
async function promoteMemory(options) {
|
|
2681
|
+
const reason = options.reason.trim();
|
|
2682
|
+
if (reason.length === 0) {
|
|
2683
|
+
throw new AdminPromotionError("reason_required", "promotion requires a non-empty reason");
|
|
2684
|
+
}
|
|
2685
|
+
if (options.targets.length === 0) {
|
|
2686
|
+
throw new AdminPromotionError("targets_required", "promotion requires at least one target");
|
|
2687
|
+
}
|
|
2688
|
+
const { config, principal, scopeProfilePlan } = options;
|
|
2689
|
+
const resolvedTargets = options.targets.map((requested) => {
|
|
2690
|
+
if (requested.kind === "explicit") {
|
|
2691
|
+
const namespace = requested.namespace?.trim();
|
|
2692
|
+
if (!namespace) {
|
|
2693
|
+
return {
|
|
2694
|
+
target: requested.kind,
|
|
2695
|
+
namespace: "",
|
|
2696
|
+
authorized: false,
|
|
2697
|
+
promoted: false,
|
|
2698
|
+
reason: "explicit promotion requires a namespace"
|
|
2699
|
+
};
|
|
2700
|
+
}
|
|
2701
|
+
const authorized = canWriteNamespace(principal, namespace, config);
|
|
2702
|
+
return {
|
|
2703
|
+
target: requested.kind,
|
|
2704
|
+
namespace,
|
|
2705
|
+
authorized,
|
|
2706
|
+
promoted: false,
|
|
2707
|
+
reason: authorized ? "explicit namespace writable by this principal" : "explicit namespace is not writable by this principal"
|
|
2708
|
+
};
|
|
2709
|
+
}
|
|
2710
|
+
const layer = scopeProfilePlan?.promotionTargets.find((t) => t.target === requested.kind);
|
|
2711
|
+
if (!layer) {
|
|
2712
|
+
return {
|
|
2713
|
+
target: requested.kind,
|
|
2714
|
+
namespace: "",
|
|
2715
|
+
authorized: false,
|
|
2716
|
+
promoted: false,
|
|
2717
|
+
reason: `promotion target '${requested.kind}' is not configured on the active scope profile`
|
|
2718
|
+
};
|
|
2719
|
+
}
|
|
2720
|
+
return {
|
|
2721
|
+
target: requested.kind,
|
|
2722
|
+
namespace: layer.namespace ?? "",
|
|
2723
|
+
authorized: layer.authorized && Boolean(layer.namespace),
|
|
2724
|
+
promoted: false,
|
|
2725
|
+
reason: layer.reason
|
|
2726
|
+
};
|
|
2727
|
+
});
|
|
2728
|
+
const sourceMemory = await options.storage.readMemory(options.sourceNamespace, options.sourceMemoryId);
|
|
2729
|
+
if (!sourceMemory) {
|
|
2730
|
+
throw new AdminPromotionError(
|
|
2731
|
+
"source_not_found",
|
|
2732
|
+
`source memory ${options.sourceMemoryId} not found in namespace ${options.sourceNamespace}`
|
|
2733
|
+
);
|
|
2734
|
+
}
|
|
2735
|
+
const auditTargets = [];
|
|
2736
|
+
for (const target of resolvedTargets) {
|
|
2737
|
+
if (!target.authorized || !target.namespace) {
|
|
2738
|
+
auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
|
|
2739
|
+
continue;
|
|
2740
|
+
}
|
|
2741
|
+
if (target.namespace === options.sourceNamespace) {
|
|
2742
|
+
target.reason = "target namespace equals source namespace; nothing to promote";
|
|
2743
|
+
auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
|
|
2744
|
+
continue;
|
|
2745
|
+
}
|
|
2746
|
+
try {
|
|
2747
|
+
const promotedId = await options.storage.writePromotedMemory(target.namespace, {
|
|
2748
|
+
category: sourceMemory.category,
|
|
2749
|
+
content: sourceMemory.content,
|
|
2750
|
+
confidence: sourceMemory.frontmatter.confidence ?? 0.5,
|
|
2751
|
+
tags: [...sourceMemory.frontmatter.tags ?? [], `admin-promotion-${target.target}`],
|
|
2752
|
+
entityRef: sourceMemory.frontmatter.entityRef,
|
|
2753
|
+
sourceMemoryId: options.sourceMemoryId,
|
|
2754
|
+
sourceNamespace: options.sourceNamespace,
|
|
2755
|
+
reason,
|
|
2756
|
+
actor: options.actor,
|
|
2757
|
+
validAt: sourceMemory.frontmatter.valid_at,
|
|
2758
|
+
lineage: [options.sourceMemoryId]
|
|
2759
|
+
});
|
|
2760
|
+
target.promoted = true;
|
|
2761
|
+
target.promotedMemoryId = promotedId;
|
|
2762
|
+
auditTargets.push({ target: target.target, namespace: target.namespace, promoted: true });
|
|
2763
|
+
} catch (err) {
|
|
2764
|
+
target.reason = "promotion write failed";
|
|
2765
|
+
auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
2769
|
+
const audit = {
|
|
2770
|
+
at,
|
|
2771
|
+
actor: options.actor,
|
|
2772
|
+
sourceMemoryId: options.sourceMemoryId,
|
|
2773
|
+
sourceNamespace: options.sourceNamespace,
|
|
2774
|
+
reason,
|
|
2775
|
+
targets: auditTargets
|
|
2776
|
+
};
|
|
2777
|
+
return {
|
|
2778
|
+
ok: resolvedTargets.some((t) => t.promoted),
|
|
2779
|
+
sourceMemoryId: options.sourceMemoryId,
|
|
2780
|
+
sourceNamespace: options.sourceNamespace,
|
|
2781
|
+
targets: resolvedTargets,
|
|
2782
|
+
audit
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2423
2786
|
// src/access-service.ts
|
|
2424
2787
|
import * as nodePath from "path";
|
|
2425
2788
|
var EngramAccessInputError = class extends Error {
|
|
@@ -7730,6 +8093,163 @@ ${next}`);
|
|
|
7730
8093
|
limit: request.limit
|
|
7731
8094
|
});
|
|
7732
8095
|
}
|
|
8096
|
+
// ── Admin console surfaces (issue #1502) ────────────────────────────────
|
|
8097
|
+
//
|
|
8098
|
+
// Thin delegators. Every method threads `this.orchestrator` references
|
|
8099
|
+
// into the pure `admin/admin-surfaces.ts` functions so the dashboard
|
|
8100
|
+
// never re-resolves scope, re-derives promotion targets, or re-lists
|
|
8101
|
+
// namespaces.
|
|
8102
|
+
/**
|
|
8103
|
+
* Resolve an effective scope inspection for the console. Inputs are
|
|
8104
|
+
* redacted before return so an operator-supplied principal preview /
|
|
8105
|
+
* namespace override never echoes a pasted credential back.
|
|
8106
|
+
*/
|
|
8107
|
+
async adminInspectScope(options) {
|
|
8108
|
+
const config = this.orchestrator.config;
|
|
8109
|
+
const codingContext = options.sessionKey ? this.orchestrator.getCodingContextForSession(options.sessionKey) ?? null : null;
|
|
8110
|
+
const inspection = inspectScope({
|
|
8111
|
+
config,
|
|
8112
|
+
sessionKey: options.sessionKey,
|
|
8113
|
+
namespace: options.namespace,
|
|
8114
|
+
principalOverride: options.principalOverride,
|
|
8115
|
+
codingContext,
|
|
8116
|
+
operation: options.operation
|
|
8117
|
+
});
|
|
8118
|
+
return redactSensitive(inspection);
|
|
8119
|
+
}
|
|
8120
|
+
/**
|
|
8121
|
+
* List configured + discovered namespaces from the catalog with the
|
|
8122
|
+
* admin filters the console exposes.
|
|
8123
|
+
*/
|
|
8124
|
+
async adminListNamespaces(filter) {
|
|
8125
|
+
const result = await listAdminNamespaces({
|
|
8126
|
+
catalog: this.orchestrator.namespaceCatalog,
|
|
8127
|
+
filter
|
|
8128
|
+
});
|
|
8129
|
+
return redactSensitive(result);
|
|
8130
|
+
}
|
|
8131
|
+
/**
|
|
8132
|
+
* Per-namespace maintenance + QMD health. QMD diagnostics are probed via
|
|
8133
|
+
* the orchestrator's search health accessor (one probe per namespace).
|
|
8134
|
+
*/
|
|
8135
|
+
async adminMaintenanceHealth() {
|
|
8136
|
+
const report = await gatherMaintenanceHealth({
|
|
8137
|
+
catalog: this.orchestrator.namespaceCatalog,
|
|
8138
|
+
qmdHealthProvider: async (namespace) => {
|
|
8139
|
+
try {
|
|
8140
|
+
const health = await this.orchestrator.searchHealthForNamespace(namespace);
|
|
8141
|
+
return {
|
|
8142
|
+
namespace,
|
|
8143
|
+
collection: health.collection,
|
|
8144
|
+
available: health.available,
|
|
8145
|
+
collectionState: health.collectionState,
|
|
8146
|
+
debugStatus: health.debugStatus,
|
|
8147
|
+
installedVersion: health.installedVersion,
|
|
8148
|
+
supportedVersion: health.supportedVersion,
|
|
8149
|
+
supported: health.supported,
|
|
8150
|
+
upgradeAvailable: health.upgradeAvailable,
|
|
8151
|
+
daemonMode: health.daemonMode
|
|
8152
|
+
};
|
|
8153
|
+
} catch (err) {
|
|
8154
|
+
throw err;
|
|
8155
|
+
}
|
|
8156
|
+
}
|
|
8157
|
+
});
|
|
8158
|
+
return redactSensitive(report);
|
|
8159
|
+
}
|
|
8160
|
+
/**
|
|
8161
|
+
* Dry-run transcript/session audit. Detects mixed `other/default` data
|
|
8162
|
+
* and legacy stranded directories. Never applies a migration.
|
|
8163
|
+
*/
|
|
8164
|
+
async adminTranscriptAudit() {
|
|
8165
|
+
const result = await auditTranscripts(this.orchestrator.config.memoryDir);
|
|
8166
|
+
return redactSensitive(result);
|
|
8167
|
+
}
|
|
8168
|
+
/**
|
|
8169
|
+
* Manually promote a memory into one or more authorized targets. Requires
|
|
8170
|
+
* a non-empty reason (audit-logged). Reuses the scope-profile promotion
|
|
8171
|
+
* resolution and `canWriteNamespace` gate — there is no dashboard-only
|
|
8172
|
+
* write path.
|
|
8173
|
+
*/
|
|
8174
|
+
async adminPromoteMemory(request) {
|
|
8175
|
+
const config = this.orchestrator.config;
|
|
8176
|
+
const namespacesEnabled = config.namespacesEnabled === true;
|
|
8177
|
+
let sourceNamespace;
|
|
8178
|
+
if (request.namespace) {
|
|
8179
|
+
sourceNamespace = this.resolveReadableNamespace(
|
|
8180
|
+
request.namespace,
|
|
8181
|
+
request.principal
|
|
8182
|
+
);
|
|
8183
|
+
} else {
|
|
8184
|
+
const codingContext2 = request.sessionKey ? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null : null;
|
|
8185
|
+
const plan = resolveScopePlan({
|
|
8186
|
+
config,
|
|
8187
|
+
sessionKey: request.sessionKey,
|
|
8188
|
+
principalOverride: request.principal,
|
|
8189
|
+
codingContext: codingContext2,
|
|
8190
|
+
namespacesEnabled
|
|
8191
|
+
});
|
|
8192
|
+
sourceNamespace = this.resolveReadableNamespace(
|
|
8193
|
+
plan.baseNamespace,
|
|
8194
|
+
request.principal
|
|
8195
|
+
);
|
|
8196
|
+
}
|
|
8197
|
+
const codingContext = request.sessionKey ? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null : null;
|
|
8198
|
+
const codingOverlay = codingContext ? resolveCodingNamespaceOverlay(
|
|
8199
|
+
codingContext,
|
|
8200
|
+
config.codingMode,
|
|
8201
|
+
config.defaultNamespace
|
|
8202
|
+
) : null;
|
|
8203
|
+
const scopeProfilePlan = resolveScopeProfilePlan({
|
|
8204
|
+
config,
|
|
8205
|
+
principal: request.principal,
|
|
8206
|
+
codingContext,
|
|
8207
|
+
codingOverlay
|
|
8208
|
+
});
|
|
8209
|
+
const storage = {
|
|
8210
|
+
readMemory: async (namespace, memoryId) => {
|
|
8211
|
+
const resolved = await this.orchestrator.getStorage(namespace);
|
|
8212
|
+
const memory = await resolved.getMemoryById(memoryId);
|
|
8213
|
+
if (!memory) return null;
|
|
8214
|
+
return {
|
|
8215
|
+
category: memory.frontmatter.category,
|
|
8216
|
+
content: memory.content,
|
|
8217
|
+
frontmatter: memory.frontmatter
|
|
8218
|
+
};
|
|
8219
|
+
},
|
|
8220
|
+
writePromotedMemory: async (namespace, memory) => {
|
|
8221
|
+
const resolved = await this.orchestrator.getStorage(namespace);
|
|
8222
|
+
return resolved.writeMemory(memory.category, memory.content, {
|
|
8223
|
+
confidence: memory.confidence,
|
|
8224
|
+
tags: memory.tags,
|
|
8225
|
+
entityRef: memory.entityRef,
|
|
8226
|
+
source: `admin-promotion:${memory.sourceNamespace}:${memory.reason.slice(0, 120)}`,
|
|
8227
|
+
lineage: memory.lineage,
|
|
8228
|
+
sourceMemoryId: memory.sourceMemoryId,
|
|
8229
|
+
actor: memory.actor,
|
|
8230
|
+
validAt: memory.validAt
|
|
8231
|
+
});
|
|
8232
|
+
}
|
|
8233
|
+
};
|
|
8234
|
+
try {
|
|
8235
|
+
return await promoteMemory({
|
|
8236
|
+
config,
|
|
8237
|
+
sourceMemoryId: request.sourceMemoryId,
|
|
8238
|
+
sourceNamespace,
|
|
8239
|
+
principal: request.principal,
|
|
8240
|
+
targets: request.targets,
|
|
8241
|
+
reason: request.reason,
|
|
8242
|
+
actor: request.principal ?? "admin-console",
|
|
8243
|
+
storage,
|
|
8244
|
+
scopeProfilePlan
|
|
8245
|
+
});
|
|
8246
|
+
} catch (err) {
|
|
8247
|
+
if (err instanceof AdminPromotionError) {
|
|
8248
|
+
throw new EngramAccessInputError(err.message);
|
|
8249
|
+
}
|
|
8250
|
+
throw err;
|
|
8251
|
+
}
|
|
8252
|
+
}
|
|
7733
8253
|
};
|
|
7734
8254
|
|
|
7735
8255
|
export {
|
|
@@ -7743,4 +8263,4 @@ export {
|
|
|
7743
8263
|
shapeMemorySummary,
|
|
7744
8264
|
EngramAccessService
|
|
7745
8265
|
};
|
|
7746
|
-
//# sourceMappingURL=chunk-
|
|
8266
|
+
//# sourceMappingURL=chunk-OXEAMU42.js.map
|