@remnic/core 9.14.0 → 9.15.1
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 +4 -1
- package/dist/access-admin-ops-surface.js +18 -18
- package/dist/access-boundary.d.ts +4 -1
- package/dist/access-boundary.js +18 -19
- package/dist/access-cli.js +64 -66
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +2 -1
- package/dist/access-http.js +24 -25
- package/dist/access-identity-continuity-surface.js +18 -18
- package/dist/access-lcm-surface.d.ts +4 -1
- package/dist/access-lcm-surface.js +18 -18
- package/dist/access-mcp.d.ts +4 -1
- package/dist/access-mcp.js +23 -24
- package/dist/access-namespace-preflight-DgJtZCmU.d.ts +146 -0
- package/dist/access-namespace-preflight.d.ts +8 -0
- package/dist/access-namespace-preflight.js +158 -0
- package/dist/access-observe-write-surface.d.ts +4 -1
- package/dist/access-observe-write-surface.js +18 -18
- package/dist/access-operations-batch.js +20 -21
- package/dist/access-operations.d.ts +8 -5
- package/dist/access-operations.js +22 -23
- package/dist/access-recall-concurrency.d.ts +4 -1
- package/dist/access-recall-concurrency.js +18 -18
- package/dist/access-recall-response.d.ts +4 -1
- package/dist/access-recall-response.js +18 -18
- package/dist/access-recall-surface.d.ts +4 -1
- package/dist/access-recall-surface.js +18 -18
- package/dist/access-schema.d.ts +76 -76
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DbZ1G3zV.d.ts → access-service-bw2p9ULX.d.ts} +6 -114
- package/dist/access-service.d.ts +4 -1
- package/dist/access-service.js +18 -18
- package/dist/access-surface-catalog.d.ts +4 -1
- package/dist/active-recall.js +1 -1
- package/dist/briefing.js +5 -5
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/capsule-crypto-7FJQINUR.js.map +1 -0
- package/dist/causal-consolidation.js +6 -6
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-5RZHHANR.js → chunk-63P3PJED.js} +50 -50
- package/dist/{chunk-ALSGMEJR.js → chunk-7CPOZH6Y.js} +5 -5
- package/dist/{chunk-TY6NBWV4.js → chunk-7FNHLCQE.js} +2 -2
- package/dist/{chunk-MMGGVZ4Q.js → chunk-7VZWZVYG.js} +40 -18
- package/dist/{chunk-MMGGVZ4Q.js.map → chunk-7VZWZVYG.js.map} +1 -1
- package/dist/{chunk-HLG7VAZP.js → chunk-BOP256DB.js} +2 -2
- package/dist/{chunk-7G7DVA2C.js → chunk-BVC242OS.js} +2 -2
- package/dist/{chunk-CAZ2SHEP.js → chunk-CCNSCRJ2.js} +2 -2
- package/dist/{chunk-3332THSR.js → chunk-CVZYPFEH.js} +4 -4
- package/dist/{chunk-SK7AMF2J.js → chunk-DETNBTZS.js} +3 -3
- package/dist/{chunk-226RNKRU.js → chunk-FFF4XIGB.js} +32 -32
- package/dist/{chunk-AS6UOOXF.js → chunk-FMMZQDCT.js} +2 -2
- package/dist/{chunk-YQQYS2K4.js → chunk-H3MDWWGN.js} +2 -2
- package/dist/{chunk-TC5HBIIT.js → chunk-HBYQAOED.js} +2 -2
- package/dist/{chunk-3HYWNJDA.js → chunk-HWFK24UD.js} +420 -42
- package/dist/chunk-HWFK24UD.js.map +1 -0
- package/dist/{chunk-YO3ZB3PJ.js → chunk-I7DUEPE2.js} +30 -15
- package/dist/chunk-I7DUEPE2.js.map +1 -0
- package/dist/{chunk-YUQOAKPX.js → chunk-JRXN5LYL.js} +5 -5
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-PYHOAXTI.js → chunk-LRGSLV7M.js} +4 -4
- package/dist/{chunk-A56B2AJR.js → chunk-MUQ3BD2C.js} +3 -3
- package/dist/{chunk-QJAQNXWI.js → chunk-ONHRRJZM.js} +6 -6
- package/dist/{chunk-DF552QUN.js → chunk-QCLQ4BGA.js} +5 -5
- package/dist/{chunk-IAHNKI2E.js → chunk-QDNE35FU.js} +2 -2
- package/dist/{chunk-W2OST2HH.js → chunk-QLOOCKKE.js} +2 -2
- package/dist/{chunk-I4NJ2CDY.js → chunk-RRHEV5HA.js} +4 -6
- package/dist/{chunk-I4NJ2CDY.js.map → chunk-RRHEV5HA.js.map} +1 -1
- package/dist/{chunk-7HZMTXXB.js → chunk-RWSLO24I.js} +10 -10
- package/dist/{chunk-UDIJMITR.js → chunk-SDZWOEZH.js} +22 -22
- package/dist/chunk-SDZWOEZH.js.map +1 -0
- package/dist/{chunk-QZGN4773.js → chunk-SW2KEZNX.js} +3 -3
- package/dist/{chunk-O4K3DWK2.js → chunk-SWVW42CG.js} +2 -2
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-CQ6WP3PA.js → chunk-XII2XSHL.js} +5 -5
- package/dist/{chunk-YSDVEPV2.js → chunk-XKFXY3ZA.js} +10 -10
- package/dist/{chunk-AVPXXV6J.js → chunk-XKGPIWGI.js} +4 -4
- package/dist/{chunk-IQFS4AU7.js → chunk-YEU4VEU4.js} +2 -2
- package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
- package/dist/{chunk-Y6XODVJ4.js → chunk-YS7KIG3A.js} +8 -8
- package/dist/{chunk-XRNU7OEQ.js → chunk-ZNFVYUYF.js} +3 -3
- package/dist/{cli-5tNLVTvJ.d.ts → cli-DzPVFfGe.d.ts} +1 -1
- package/dist/cli.d.ts +5 -2
- package/dist/cli.js +45 -46
- package/dist/compounding/engine.js +5 -5
- package/dist/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.js +5 -5
- package/dist/connectors/index.js +5 -5
- package/dist/contradiction/index.js +4 -4
- package/dist/dashboard-runtime.js +2 -2
- package/dist/entity-retrieval.js +5 -5
- package/dist/index.d.ts +406 -405
- package/dist/index.js +76 -78
- package/dist/lcm/index.js +3 -3
- 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 +4 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/search.js +5 -5
- package/dist/namespaces/storage.js +5 -5
- package/dist/offline-sync-impression-drain.js +4 -4
- package/dist/operator-toolkit.js +16 -16
- package/dist/orchestration/maintenance.js +9 -9
- package/dist/orchestrator.js +65 -66
- package/dist/qmd.js +4 -4
- package/dist/resume-bundles.js +1 -1
- package/dist/schemas.d.ts +54 -54
- package/dist/search/factory.js +4 -4
- package/dist/search/index.js +6 -6
- package/dist/semantic-consolidation.js +6 -6
- 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/storage.js +4 -4
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/import-sqlite.js +2 -2
- package/dist/transfer/types.d.ts +66 -66
- package/dist/verified-recall.js +5 -5
- package/package.json +2 -2
- package/src/access-http.test.ts +91 -0
- package/src/access-http.ts +13 -14
- package/src/access-namespace-preflight.test.ts +111 -0
- package/src/access-namespace-preflight.ts +111 -0
- package/src/access-operations-batch.ts +25 -2
- package/src/access-service-observe-scope.test.ts +81 -0
- package/src/access-service.ts +64 -32
- package/src/scopes/scope-plan.ts +66 -0
- package/dist/chunk-3HYWNJDA.js.map +0 -1
- package/dist/chunk-KF5EUVKQ.js +0 -289
- package/dist/chunk-KF5EUVKQ.js.map +0 -1
- package/dist/chunk-UDIJMITR.js.map +0 -1
- package/dist/chunk-YO3ZB3PJ.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-namespace-preflight.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-5RZHHANR.js.map → chunk-63P3PJED.js.map} +0 -0
- /package/dist/{chunk-ALSGMEJR.js.map → chunk-7CPOZH6Y.js.map} +0 -0
- /package/dist/{chunk-TY6NBWV4.js.map → chunk-7FNHLCQE.js.map} +0 -0
- /package/dist/{chunk-HLG7VAZP.js.map → chunk-BOP256DB.js.map} +0 -0
- /package/dist/{chunk-7G7DVA2C.js.map → chunk-BVC242OS.js.map} +0 -0
- /package/dist/{chunk-CAZ2SHEP.js.map → chunk-CCNSCRJ2.js.map} +0 -0
- /package/dist/{chunk-3332THSR.js.map → chunk-CVZYPFEH.js.map} +0 -0
- /package/dist/{chunk-SK7AMF2J.js.map → chunk-DETNBTZS.js.map} +0 -0
- /package/dist/{chunk-226RNKRU.js.map → chunk-FFF4XIGB.js.map} +0 -0
- /package/dist/{chunk-AS6UOOXF.js.map → chunk-FMMZQDCT.js.map} +0 -0
- /package/dist/{chunk-YQQYS2K4.js.map → chunk-H3MDWWGN.js.map} +0 -0
- /package/dist/{chunk-TC5HBIIT.js.map → chunk-HBYQAOED.js.map} +0 -0
- /package/dist/{chunk-YUQOAKPX.js.map → chunk-JRXN5LYL.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-PYHOAXTI.js.map → chunk-LRGSLV7M.js.map} +0 -0
- /package/dist/{chunk-A56B2AJR.js.map → chunk-MUQ3BD2C.js.map} +0 -0
- /package/dist/{chunk-QJAQNXWI.js.map → chunk-ONHRRJZM.js.map} +0 -0
- /package/dist/{chunk-DF552QUN.js.map → chunk-QCLQ4BGA.js.map} +0 -0
- /package/dist/{chunk-IAHNKI2E.js.map → chunk-QDNE35FU.js.map} +0 -0
- /package/dist/{chunk-W2OST2HH.js.map → chunk-QLOOCKKE.js.map} +0 -0
- /package/dist/{chunk-7HZMTXXB.js.map → chunk-RWSLO24I.js.map} +0 -0
- /package/dist/{chunk-QZGN4773.js.map → chunk-SW2KEZNX.js.map} +0 -0
- /package/dist/{chunk-O4K3DWK2.js.map → chunk-SWVW42CG.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-CQ6WP3PA.js.map → chunk-XII2XSHL.js.map} +0 -0
- /package/dist/{chunk-YSDVEPV2.js.map → chunk-XKFXY3ZA.js.map} +0 -0
- /package/dist/{chunk-AVPXXV6J.js.map → chunk-XKGPIWGI.js.map} +0 -0
- /package/dist/{chunk-IQFS4AU7.js.map → chunk-YEU4VEU4.js.map} +0 -0
- /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
- /package/dist/{chunk-Y6XODVJ4.js.map → chunk-YS7KIG3A.js.map} +0 -0
- /package/dist/{chunk-XRNU7OEQ.js.map → chunk-ZNFVYUYF.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-GDB4J2H3.js";
|
|
9
9
|
import {
|
|
10
10
|
importCapsule
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7CPOZH6Y.js";
|
|
12
12
|
import {
|
|
13
13
|
WriteQuarantineStore
|
|
14
14
|
} from "./chunk-PJSK6OJM.js";
|
|
@@ -30,18 +30,18 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
planSessionTranscriptMigration
|
|
32
32
|
} from "./chunk-P5FPO2BR.js";
|
|
33
|
-
import {
|
|
34
|
-
decideDisclosureEscalation
|
|
35
|
-
} from "./chunk-H7XKCNR6.js";
|
|
36
33
|
import {
|
|
37
34
|
toRecallExplainJson
|
|
38
35
|
} from "./chunk-CQMEM5CC.js";
|
|
39
36
|
import {
|
|
40
37
|
estimateRecallTokens
|
|
41
38
|
} from "./chunk-U3ZAVRP3.js";
|
|
39
|
+
import {
|
|
40
|
+
decideDisclosureEscalation
|
|
41
|
+
} from "./chunk-H7XKCNR6.js";
|
|
42
42
|
import {
|
|
43
43
|
namespaceCollectionName
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QDNE35FU.js";
|
|
45
45
|
import {
|
|
46
46
|
buildProposedActions,
|
|
47
47
|
buildQualityScore,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
listMemoryGovernanceRuns,
|
|
50
50
|
readMemoryGovernanceRunArtifact,
|
|
51
51
|
runMemoryGovernance
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-BOP256DB.js";
|
|
53
53
|
import {
|
|
54
54
|
recordObjectiveStateSnapshotsFromObservedMessages
|
|
55
55
|
} from "./chunk-ICP53SKG.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./chunk-6HMYUWXR.js";
|
|
59
59
|
import {
|
|
60
60
|
offlineSyncStorageForSnapshot
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-DETNBTZS.js";
|
|
62
62
|
import {
|
|
63
63
|
combineNamespaces,
|
|
64
64
|
defaultGitInvoker,
|
|
@@ -69,9 +69,10 @@ import {
|
|
|
69
69
|
resolveGitContext,
|
|
70
70
|
resolveScopePlan,
|
|
71
71
|
resolveScopeProfilePlan,
|
|
72
|
+
resolveScopedWritableNamespaceValue,
|
|
72
73
|
resolveWritableNamespaceValue,
|
|
73
74
|
sanitizeFragment
|
|
74
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-7VZWZVYG.js";
|
|
75
76
|
import {
|
|
76
77
|
recordMemoryOutcome
|
|
77
78
|
} from "./chunk-EIR5VLIH.js";
|
|
@@ -113,13 +114,13 @@ import {
|
|
|
113
114
|
enqueuePassiveCorrectionNotification,
|
|
114
115
|
parseBriefingFocus,
|
|
115
116
|
parseBriefingWindow
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-BVC242OS.js";
|
|
117
118
|
import {
|
|
118
119
|
parseEntityFile,
|
|
119
120
|
qmdCollectionPathParts,
|
|
120
121
|
qmdResultPathCandidates,
|
|
121
122
|
selfDeps
|
|
122
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-RWSLO24I.js";
|
|
123
124
|
import {
|
|
124
125
|
supersessionKeysForFact
|
|
125
126
|
} from "./chunk-DNHVPZOD.js";
|
|
@@ -133,6 +134,10 @@ import {
|
|
|
133
134
|
import {
|
|
134
135
|
serializeMutations
|
|
135
136
|
} from "./chunk-WL5EBRDH.js";
|
|
137
|
+
import {
|
|
138
|
+
inferMemoryStatus,
|
|
139
|
+
toMemoryPathRel
|
|
140
|
+
} from "./chunk-ILGC6JH6.js";
|
|
136
141
|
import {
|
|
137
142
|
normalizeProjectionPreview,
|
|
138
143
|
normalizeProjectionTags
|
|
@@ -143,10 +148,6 @@ import {
|
|
|
143
148
|
import {
|
|
144
149
|
displayErrorDetail
|
|
145
150
|
} from "./chunk-RL6NEVXT.js";
|
|
146
|
-
import {
|
|
147
|
-
inferMemoryStatus,
|
|
148
|
-
toMemoryPathRel
|
|
149
|
-
} from "./chunk-ILGC6JH6.js";
|
|
150
151
|
import {
|
|
151
152
|
STRUCTURED_ATTRIBUTE_LIMITS,
|
|
152
153
|
buildAccessWriteRequestFingerprint,
|
|
@@ -168,6 +169,14 @@ import {
|
|
|
168
169
|
import {
|
|
169
170
|
computeContentHash
|
|
170
171
|
} from "./chunk-W5H6ZRPT.js";
|
|
172
|
+
import {
|
|
173
|
+
assertFleetWideOperationAllowed,
|
|
174
|
+
assertOperationAllowed,
|
|
175
|
+
capabilityAllowsOp,
|
|
176
|
+
enforceNamespaceAllowList,
|
|
177
|
+
isNamespaceAllowed,
|
|
178
|
+
tokenCapabilityStore
|
|
179
|
+
} from "./chunk-7AMFUATK.js";
|
|
171
180
|
import {
|
|
172
181
|
sanitizeMemoryContent
|
|
173
182
|
} from "./chunk-5GKPFL3S.js";
|
|
@@ -180,7 +189,7 @@ import {
|
|
|
180
189
|
} from "./chunk-JAKIDQB2.js";
|
|
181
190
|
import {
|
|
182
191
|
exportCapsule
|
|
183
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-KQAFEZQX.js";
|
|
184
193
|
import {
|
|
185
194
|
evaluateActionConfidence
|
|
186
195
|
} from "./chunk-Z2YFLXHU.js";
|
|
@@ -196,6 +205,7 @@ import {
|
|
|
196
205
|
readOfflineSyncFileContentChunk
|
|
197
206
|
} from "./chunk-E4OCKU67.js";
|
|
198
207
|
import {
|
|
208
|
+
EngramAccessForbiddenError,
|
|
199
209
|
EngramAccessInputError,
|
|
200
210
|
NamespaceNotWritableError
|
|
201
211
|
} from "./chunk-2Z24E5W2.js";
|
|
@@ -4782,6 +4792,333 @@ function formatProcedureStatsText(report) {
|
|
|
4782
4792
|
return lines.join("\n") + "\n";
|
|
4783
4793
|
}
|
|
4784
4794
|
|
|
4795
|
+
// src/access-boundary.ts
|
|
4796
|
+
import { z } from "zod";
|
|
4797
|
+
var OPERATION_NAMES = [
|
|
4798
|
+
"memory_get",
|
|
4799
|
+
"memory_search",
|
|
4800
|
+
"memory_store",
|
|
4801
|
+
"coding_decision",
|
|
4802
|
+
"coding_architecture",
|
|
4803
|
+
// codegraph parity tools (issue #1554) -- each maps to one codegraph_*
|
|
4804
|
+
// boundary operation that delegates to the surface handler in
|
|
4805
|
+
// coding/codegraph-surfaces.ts. Names match the external tool suffixes.
|
|
4806
|
+
"codegraph_index",
|
|
4807
|
+
"codegraph_list_projects",
|
|
4808
|
+
"codegraph_delete_project",
|
|
4809
|
+
"codegraph_index_status",
|
|
4810
|
+
"codegraph_search_graph",
|
|
4811
|
+
"codegraph_trace_path",
|
|
4812
|
+
"codegraph_detect_changes",
|
|
4813
|
+
"codegraph_query_graph",
|
|
4814
|
+
"codegraph_get_schema",
|
|
4815
|
+
"codegraph_get_snippet",
|
|
4816
|
+
"codegraph_get_architecture",
|
|
4817
|
+
"codegraph_search_code",
|
|
4818
|
+
"codegraph_manage_adr",
|
|
4819
|
+
"codegraph_ingest_traces",
|
|
4820
|
+
"memory_correct_plan",
|
|
4821
|
+
"memory_correct_apply",
|
|
4822
|
+
"coding_delta",
|
|
4823
|
+
// Remaining MCP/HTTP handlers migrated through the boundary (issue #1525).
|
|
4824
|
+
"recall",
|
|
4825
|
+
"recall_explain",
|
|
4826
|
+
"set_coding_context",
|
|
4827
|
+
"recall_tier_explain",
|
|
4828
|
+
"recall_xray",
|
|
4829
|
+
"namespace_writable",
|
|
4830
|
+
"wearables_status",
|
|
4831
|
+
"wearables_sync",
|
|
4832
|
+
"transcript_day",
|
|
4833
|
+
"transcript_search",
|
|
4834
|
+
"transcript_memories",
|
|
4835
|
+
"action_confidence",
|
|
4836
|
+
"chatgpt_memory_inspector",
|
|
4837
|
+
"day_summary",
|
|
4838
|
+
"capsule_export",
|
|
4839
|
+
"capsule_import",
|
|
4840
|
+
"capsule_list",
|
|
4841
|
+
"memory_governance_run",
|
|
4842
|
+
"procedure_mining_run",
|
|
4843
|
+
"pattern_reinforcement_run",
|
|
4844
|
+
"procedural_stats",
|
|
4845
|
+
"memory_timeline",
|
|
4846
|
+
"suggestion_submit",
|
|
4847
|
+
"entity_get",
|
|
4848
|
+
"review_queue_list",
|
|
4849
|
+
"correction_pending",
|
|
4850
|
+
"observe",
|
|
4851
|
+
"lcm_search",
|
|
4852
|
+
"lcm_compaction_flush",
|
|
4853
|
+
"lcm_compaction_record",
|
|
4854
|
+
"continuity_audit_generate",
|
|
4855
|
+
"continuity_incident_open",
|
|
4856
|
+
"continuity_incident_close",
|
|
4857
|
+
"continuity_incident_list",
|
|
4858
|
+
"continuity_loop_add_or_update",
|
|
4859
|
+
"continuity_loop_review",
|
|
4860
|
+
"identity_anchor_get",
|
|
4861
|
+
"identity_anchor_update",
|
|
4862
|
+
"memory_identity",
|
|
4863
|
+
"work_task",
|
|
4864
|
+
"work_project",
|
|
4865
|
+
"work_board",
|
|
4866
|
+
"shared_context_write_output",
|
|
4867
|
+
"shared_feedback_record",
|
|
4868
|
+
"shared_priorities_append",
|
|
4869
|
+
"relay_mission_append",
|
|
4870
|
+
"relay_mission_read",
|
|
4871
|
+
"shared_context_cross_signals_run",
|
|
4872
|
+
"shared_context_curate_daily",
|
|
4873
|
+
"compounding_weekly_synthesize",
|
|
4874
|
+
"compounding_promote_candidate",
|
|
4875
|
+
"compression_guidelines_optimize",
|
|
4876
|
+
"compression_guidelines_activate",
|
|
4877
|
+
"memory_profile",
|
|
4878
|
+
"memory_entities_list",
|
|
4879
|
+
"memory_questions",
|
|
4880
|
+
"memory_last_recall",
|
|
4881
|
+
"memory_intent_debug",
|
|
4882
|
+
"memory_qmd_debug",
|
|
4883
|
+
"memory_graph_explain",
|
|
4884
|
+
"graph_snapshot",
|
|
4885
|
+
"memory_feedback",
|
|
4886
|
+
"memory_promote",
|
|
4887
|
+
"memory_outcome",
|
|
4888
|
+
"memory_action_apply",
|
|
4889
|
+
"context_checkpoint",
|
|
4890
|
+
"briefing",
|
|
4891
|
+
"review_list",
|
|
4892
|
+
"review_resolve",
|
|
4893
|
+
"contradiction_scan_run",
|
|
4894
|
+
"memory_summarize_hourly",
|
|
4895
|
+
"conversation_index_update",
|
|
4896
|
+
"profiling_report",
|
|
4897
|
+
"graph_edge_decay_run",
|
|
4898
|
+
"live_connectors_run",
|
|
4899
|
+
"peer_list",
|
|
4900
|
+
"peer_get",
|
|
4901
|
+
"peer_set",
|
|
4902
|
+
"peer_delete",
|
|
4903
|
+
"peer_profile_get",
|
|
4904
|
+
"peer_forget",
|
|
4905
|
+
"console_state",
|
|
4906
|
+
"dreams_status",
|
|
4907
|
+
"dreams_run",
|
|
4908
|
+
// HTTP-only routes (no direct MCP tool equivalent).
|
|
4909
|
+
"adapters_status",
|
|
4910
|
+
"offline_sync_snapshot",
|
|
4911
|
+
"offline_sync_snapshot_stream",
|
|
4912
|
+
"offline_sync_files",
|
|
4913
|
+
"offline_sync_file_content",
|
|
4914
|
+
"offline_sync_apply_file_content",
|
|
4915
|
+
"offline_sync_apply",
|
|
4916
|
+
"lcm_status",
|
|
4917
|
+
"memory_list",
|
|
4918
|
+
"recall_timings",
|
|
4919
|
+
"entity_list",
|
|
4920
|
+
"maintenance_status",
|
|
4921
|
+
"quality_status",
|
|
4922
|
+
"trust_zones_status",
|
|
4923
|
+
"trust_zones_records",
|
|
4924
|
+
"review_disposition",
|
|
4925
|
+
"trust_zones_promote",
|
|
4926
|
+
"trust_zones_demo_seed",
|
|
4927
|
+
"citations_observed",
|
|
4928
|
+
"contradiction_detail",
|
|
4929
|
+
"graph_events",
|
|
4930
|
+
// Chat surface — conversational memory inspection/correction (issue #1583).
|
|
4931
|
+
"chat_message",
|
|
4932
|
+
"chat_events"
|
|
4933
|
+
];
|
|
4934
|
+
function coerceBooleanLike(value) {
|
|
4935
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
4936
|
+
if (typeof value === "boolean") return value;
|
|
4937
|
+
if (typeof value === "string") {
|
|
4938
|
+
const lower = value.trim().toLowerCase();
|
|
4939
|
+
if (lower === "true" || lower === "1" || lower === "yes" || lower === "on") return true;
|
|
4940
|
+
if (lower === "false" || lower === "0" || lower === "no" || lower === "off") return false;
|
|
4941
|
+
}
|
|
4942
|
+
throw new EngramAccessInputError(
|
|
4943
|
+
`expected a boolean-like value (true|false|1|0|yes|no|on|off); got ${JSON.stringify(value)}`
|
|
4944
|
+
);
|
|
4945
|
+
}
|
|
4946
|
+
function coercePositiveInteger(value, label) {
|
|
4947
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
4948
|
+
if (typeof value === "number") {
|
|
4949
|
+
if (!Number.isFinite(value) || value <= 0 || !Number.isInteger(value)) {
|
|
4950
|
+
throw new EngramAccessInputError(`${label} expects a positive integer; got ${JSON.stringify(value)}`);
|
|
4951
|
+
}
|
|
4952
|
+
return value;
|
|
4953
|
+
}
|
|
4954
|
+
if (typeof value === "string") {
|
|
4955
|
+
const trimmed = value.trim();
|
|
4956
|
+
if (!/^[+-]?\d+$/.test(trimmed)) {
|
|
4957
|
+
throw new EngramAccessInputError(`${label} expects a positive integer; got ${JSON.stringify(value)}`);
|
|
4958
|
+
}
|
|
4959
|
+
const parsed = Number(trimmed);
|
|
4960
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0) {
|
|
4961
|
+
throw new EngramAccessInputError(`${label} expects a positive integer; got ${JSON.stringify(value)}`);
|
|
4962
|
+
}
|
|
4963
|
+
return parsed;
|
|
4964
|
+
}
|
|
4965
|
+
throw new EngramAccessInputError(`${label} expects a positive integer; got ${JSON.stringify(value)}`);
|
|
4966
|
+
}
|
|
4967
|
+
function normalizeOptionalPath(value) {
|
|
4968
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
4969
|
+
if (typeof value !== "string") {
|
|
4970
|
+
throw new EngramAccessInputError(`expected a path string; got ${JSON.stringify(value)}`);
|
|
4971
|
+
}
|
|
4972
|
+
return expandTildePath(value);
|
|
4973
|
+
}
|
|
4974
|
+
function formatZodIssues(error) {
|
|
4975
|
+
const parts = [];
|
|
4976
|
+
for (const issue of error.issues) {
|
|
4977
|
+
const hasNumeric = issue.path.some((p) => typeof p === "number");
|
|
4978
|
+
const path9 = hasNumeric ? issue.path.filter((p) => typeof p === "string").join(".") || "(root)" : issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
4979
|
+
const options = enumOptionsFromIssue(issue);
|
|
4980
|
+
const suffix = options ? `. Valid: ${options.join(", ")}` : "";
|
|
4981
|
+
parts.push(`${path9}: ${issue.message}${suffix}`);
|
|
4982
|
+
}
|
|
4983
|
+
return parts.length > 0 ? `request validation failed: ${parts.join("; ")}` : "request validation failed";
|
|
4984
|
+
}
|
|
4985
|
+
function enumOptionsFromIssue(issue) {
|
|
4986
|
+
if (issue.code === z.ZodIssueCode.invalid_enum_value) {
|
|
4987
|
+
const rawOptions = issue.options;
|
|
4988
|
+
if (Array.isArray(rawOptions)) {
|
|
4989
|
+
return rawOptions.map((opt) => String(opt));
|
|
4990
|
+
}
|
|
4991
|
+
}
|
|
4992
|
+
return void 0;
|
|
4993
|
+
}
|
|
4994
|
+
var registry = /* @__PURE__ */ new Map();
|
|
4995
|
+
var humanReadableErrorMap = (issue, ctx) => {
|
|
4996
|
+
if (issue.code === z.ZodIssueCode.invalid_type) {
|
|
4997
|
+
if (issue.received === "undefined") return { message: ctx.defaultError };
|
|
4998
|
+
if (issue.path.some((p) => typeof p === "number")) {
|
|
4999
|
+
const arrField = issue.path.filter((p) => typeof p === "string").join(".");
|
|
5000
|
+
return { message: `${arrField} must be an array of ${issue.expected}s` };
|
|
5001
|
+
}
|
|
5002
|
+
const fieldName = issue.path.length > 0 ? String(issue.path[issue.path.length - 1]) : "value";
|
|
5003
|
+
switch (issue.expected) {
|
|
5004
|
+
case "string":
|
|
5005
|
+
return { message: `${fieldName} must be a string` };
|
|
5006
|
+
case "boolean":
|
|
5007
|
+
return { message: `${fieldName} must be a boolean` };
|
|
5008
|
+
case "number":
|
|
5009
|
+
return { message: `${fieldName} must be a number` };
|
|
5010
|
+
case "array":
|
|
5011
|
+
return { message: `${fieldName} must be an array` };
|
|
5012
|
+
case "object":
|
|
5013
|
+
return { message: `${fieldName} must be an object` };
|
|
5014
|
+
default:
|
|
5015
|
+
return { message: ctx.defaultError };
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
return { message: ctx.defaultError };
|
|
5019
|
+
};
|
|
5020
|
+
function defineOperation(spec) {
|
|
5021
|
+
if (registry.has(spec.name)) {
|
|
5022
|
+
throw new Error(`access-boundary: operation already registered: ${spec.name}`);
|
|
5023
|
+
}
|
|
5024
|
+
const bound = {
|
|
5025
|
+
spec,
|
|
5026
|
+
run: async (rawInput, ctx) => {
|
|
5027
|
+
const parseResult = spec.schema.safeParse(rawInput, { errorMap: humanReadableErrorMap });
|
|
5028
|
+
if (!parseResult.success) {
|
|
5029
|
+
throw new EngramAccessInputError(formatZodIssues(parseResult.error));
|
|
5030
|
+
}
|
|
5031
|
+
if (spec.allowedByOps && spec.allowedByOps.length > 0) {
|
|
5032
|
+
const store = tokenCapabilityStore.getStore();
|
|
5033
|
+
if (!spec.allowedByOps.some((op) => capabilityAllowsOp(store, op))) {
|
|
5034
|
+
throw new EngramAccessForbiddenError(`token is not permitted to call operation: ${spec.name}`);
|
|
5035
|
+
}
|
|
5036
|
+
} else {
|
|
5037
|
+
assertOperationAllowed(tokenCapabilityStore.getStore(), spec.name);
|
|
5038
|
+
}
|
|
5039
|
+
if (spec.fleetWide) {
|
|
5040
|
+
assertFleetWideOperationAllowed(tokenCapabilityStore.getStore());
|
|
5041
|
+
}
|
|
5042
|
+
return spec.handler(parseResult.data, ctx);
|
|
5043
|
+
}
|
|
5044
|
+
};
|
|
5045
|
+
registry.set(spec.name, bound);
|
|
5046
|
+
return bound;
|
|
5047
|
+
}
|
|
5048
|
+
function getOperation(name) {
|
|
5049
|
+
return registry.get(name);
|
|
5050
|
+
}
|
|
5051
|
+
function listRegisteredOperations() {
|
|
5052
|
+
return [...registry.keys()];
|
|
5053
|
+
}
|
|
5054
|
+
function __resetRegistryForTest() {
|
|
5055
|
+
registry.clear();
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5058
|
+
// src/access-namespace-preflight.ts
|
|
5059
|
+
function namespaceWritableRequest(params, authenticatedPrincipal) {
|
|
5060
|
+
const namespace = params.get("namespace") || void 0;
|
|
5061
|
+
return {
|
|
5062
|
+
namespace,
|
|
5063
|
+
sessionKey: params.get("session") || void 0,
|
|
5064
|
+
authenticatedPrincipal,
|
|
5065
|
+
cwd: params.get("cwd") || void 0,
|
|
5066
|
+
projectTag: params.get("projectTag") || void 0
|
|
5067
|
+
};
|
|
5068
|
+
}
|
|
5069
|
+
function parseNamespacePreflightWriteOp(value) {
|
|
5070
|
+
if (value === void 0 || value === "observe") return "observe";
|
|
5071
|
+
if (value === "memory_store") return "memory_store";
|
|
5072
|
+
throw new EngramAccessInputError(`unsupported namespace preflight operation: ${value}`);
|
|
5073
|
+
}
|
|
5074
|
+
function assertNamespacePreflightPermitted(caps) {
|
|
5075
|
+
const allowedOps = getOperation("namespace_writable")?.spec.allowedByOps ?? [];
|
|
5076
|
+
if (!allowedOps.some((op) => capabilityAllowsOp(caps, op))) {
|
|
5077
|
+
throw new EngramAccessForbiddenError("token is not permitted to run the namespace preflight");
|
|
5078
|
+
}
|
|
5079
|
+
}
|
|
5080
|
+
async function resolveNamespaceWritablePreflight(request, resolveWritable) {
|
|
5081
|
+
try {
|
|
5082
|
+
return { ok: true, namespace: await resolveWritable(request) };
|
|
5083
|
+
} catch (error) {
|
|
5084
|
+
if (error instanceof NamespaceNotWritableError) {
|
|
5085
|
+
return { ok: false, reason: "not_writable", namespace: error.attemptedNamespace };
|
|
5086
|
+
}
|
|
5087
|
+
if (error instanceof EngramAccessInputError) {
|
|
5088
|
+
return {
|
|
5089
|
+
ok: false,
|
|
5090
|
+
reason: "unsupported",
|
|
5091
|
+
namespace: request.namespace?.trim() ?? ""
|
|
5092
|
+
};
|
|
5093
|
+
}
|
|
5094
|
+
throw error;
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
async function resolveAuthorizedNamespaceWritablePreflight(caps, request, defaultNamespace, writeOp, resolvePreflight) {
|
|
5098
|
+
if (!capabilityAllowsOp(caps, writeOp)) {
|
|
5099
|
+
return {
|
|
5100
|
+
ok: false,
|
|
5101
|
+
reason: "not_writable",
|
|
5102
|
+
namespace: request.namespace?.trim() || defaultNamespace
|
|
5103
|
+
};
|
|
5104
|
+
}
|
|
5105
|
+
const result = await resolvePreflight(request);
|
|
5106
|
+
if (!isNamespaceAllowed(caps, result.namespace, defaultNamespace)) {
|
|
5107
|
+
return { ok: false, reason: "not_writable", namespace: result.namespace };
|
|
5108
|
+
}
|
|
5109
|
+
return result;
|
|
5110
|
+
}
|
|
5111
|
+
function resolveQueryNamespaceWritablePreflight(caps, params, authenticatedPrincipal, defaultNamespace, resolvePreflight) {
|
|
5112
|
+
assertNamespacePreflightPermitted(caps);
|
|
5113
|
+
return resolveAuthorizedNamespaceWritablePreflight(
|
|
5114
|
+
caps,
|
|
5115
|
+
namespaceWritableRequest(params, authenticatedPrincipal),
|
|
5116
|
+
defaultNamespace,
|
|
5117
|
+
parseNamespacePreflightWriteOp(params.get("op") ?? void 0),
|
|
5118
|
+
resolvePreflight
|
|
5119
|
+
);
|
|
5120
|
+
}
|
|
5121
|
+
|
|
4785
5122
|
// src/admin/admin-surfaces.ts
|
|
4786
5123
|
import path7 from "path";
|
|
4787
5124
|
var REDACTED = "<redacted>";
|
|
@@ -8623,6 +8960,13 @@ var EngramAccessService = class {
|
|
|
8623
8960
|
});
|
|
8624
8961
|
return { principal, codingContext, overlay, profilePlan };
|
|
8625
8962
|
}
|
|
8963
|
+
assertTokenCanWriteNamespace(namespace) {
|
|
8964
|
+
enforceNamespaceAllowList(
|
|
8965
|
+
tokenCapabilityStore.getStore(),
|
|
8966
|
+
namespace,
|
|
8967
|
+
this.orchestrator.config.defaultNamespace
|
|
8968
|
+
);
|
|
8969
|
+
}
|
|
8626
8970
|
/**
|
|
8627
8971
|
* Resolve the write namespace for explicit-write tools (memory_store /
|
|
8628
8972
|
* suggestion_submit), project-scoping the write the same way recall does so a
|
|
@@ -8632,42 +8976,49 @@ var EngramAccessService = class {
|
|
|
8632
8976
|
* (`canWriteNamespace` / profile-layer writability). Read-only: never mutates
|
|
8633
8977
|
* session coding context.
|
|
8634
8978
|
*/
|
|
8635
|
-
async resolveCodingScopedWriteNamespace(request) {
|
|
8636
|
-
const
|
|
8637
|
-
if (
|
|
8638
|
-
|
|
8639
|
-
|
|
8979
|
+
async resolveCodingScopedWriteNamespace(request, enforceToken = true) {
|
|
8980
|
+
const requested = request.namespace?.trim();
|
|
8981
|
+
if (requested) {
|
|
8982
|
+
const namespace = this.writableNamespaceFor(
|
|
8983
|
+
requested,
|
|
8640
8984
|
request.sessionKey,
|
|
8641
8985
|
request.authenticatedPrincipal
|
|
8642
8986
|
);
|
|
8987
|
+
if (enforceToken) this.assertTokenCanWriteNamespace(namespace);
|
|
8988
|
+
return namespace;
|
|
8643
8989
|
}
|
|
8644
8990
|
const { principal, overlay, profilePlan } = await this.resolveCodingScopeInputs(request);
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
return
|
|
8991
|
+
const result = resolveScopedWritableNamespaceValue({
|
|
8992
|
+
sessionKey: request.sessionKey,
|
|
8993
|
+
authenticatedPrincipal: request.authenticatedPrincipal,
|
|
8994
|
+
principal,
|
|
8995
|
+
codingOverlay: overlay,
|
|
8996
|
+
scopeProfile: profilePlan,
|
|
8997
|
+
config: this.orchestrator.config
|
|
8998
|
+
});
|
|
8999
|
+
if (result.ok) {
|
|
9000
|
+
if (enforceToken) this.assertTokenCanWriteNamespace(result.namespace);
|
|
9001
|
+
return result.namespace;
|
|
8656
9002
|
}
|
|
8657
|
-
if (
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
9003
|
+
if (profilePlan && result.namespace === profilePlan.writeNamespace) {
|
|
9004
|
+
throw new NamespaceNotWritableError(
|
|
9005
|
+
result.namespace,
|
|
9006
|
+
principal,
|
|
9007
|
+
`scope profile ${profilePlan.profileId} has no writable layer for principal ${principal ?? "anonymous"}`
|
|
8662
9008
|
);
|
|
8663
9009
|
}
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
throw new NamespaceNotWritableError(base, principal);
|
|
9010
|
+
if (result.reason === "unsupported") {
|
|
9011
|
+
throw new EngramAccessInputError(`unsupported namespace: ${result.namespace}`);
|
|
8667
9012
|
}
|
|
8668
|
-
|
|
9013
|
+
throw new NamespaceNotWritableError(result.namespace, principal);
|
|
9014
|
+
}
|
|
9015
|
+
async namespaceWritablePreflight(request) {
|
|
9016
|
+
return resolveNamespaceWritablePreflight(
|
|
9017
|
+
request,
|
|
9018
|
+
(preflightRequest) => this.resolveCodingScopedWriteNamespace(preflightRequest, false)
|
|
9019
|
+
);
|
|
8669
9020
|
}
|
|
8670
|
-
/**
|
|
9021
|
+
/**
|
|
8671
9022
|
* `list`/`get` use this so a record written by a project-scoped session is
|
|
8672
9023
|
* listable/fetchable by the SAME session without manually supplying the
|
|
8673
9024
|
* overlaid namespace (review P2). Derivation is IDENTICAL to the write path
|
|
@@ -8738,6 +9089,7 @@ var EngramAccessService = class {
|
|
|
8738
9089
|
request.sessionKey,
|
|
8739
9090
|
request.authenticatedPrincipal
|
|
8740
9091
|
);
|
|
9092
|
+
this.assertTokenCanWriteNamespace(writeNamespace2);
|
|
8741
9093
|
return {
|
|
8742
9094
|
principal,
|
|
8743
9095
|
explicitNamespace: request.namespace.trim(),
|
|
@@ -8772,6 +9124,14 @@ var EngramAccessService = class {
|
|
|
8772
9124
|
this.orchestrator.setCodingContextForSession(request.sessionKey, null);
|
|
8773
9125
|
}
|
|
8774
9126
|
};
|
|
9127
|
+
const assertWriteNamespaceAllowed = (namespace) => {
|
|
9128
|
+
try {
|
|
9129
|
+
this.assertTokenCanWriteNamespace(namespace);
|
|
9130
|
+
} catch (error) {
|
|
9131
|
+
clearSeededContext();
|
|
9132
|
+
throw error;
|
|
9133
|
+
}
|
|
9134
|
+
};
|
|
8775
9135
|
const overlaidBase = this.orchestrator.applyCodingNamespaceOverlay(
|
|
8776
9136
|
request.sessionKey,
|
|
8777
9137
|
baseNamespace
|
|
@@ -8814,6 +9174,7 @@ var EngramAccessService = class {
|
|
|
8814
9174
|
(layer) => (layer.id === "userProject" || layer.id === "teamProject") && layer.readable && layer.namespace && readNamespaces2.includes(layer.namespace)
|
|
8815
9175
|
)
|
|
8816
9176
|
);
|
|
9177
|
+
assertWriteNamespaceAllowed(profilePlan.writeNamespace);
|
|
8817
9178
|
return {
|
|
8818
9179
|
principal,
|
|
8819
9180
|
baseNamespace: profilePlan.baseNamespace,
|
|
@@ -8839,6 +9200,7 @@ var EngramAccessService = class {
|
|
|
8839
9200
|
clearSeededContext();
|
|
8840
9201
|
throw new NamespaceNotWritableError(baseNamespace, principal);
|
|
8841
9202
|
}
|
|
9203
|
+
assertWriteNamespaceAllowed(writeNamespace2);
|
|
8842
9204
|
return {
|
|
8843
9205
|
principal,
|
|
8844
9206
|
// scopeDebug.baseNamespace must report the principal SELF base
|
|
@@ -8867,6 +9229,7 @@ var EngramAccessService = class {
|
|
|
8867
9229
|
const ns = combineNamespaces(baseNamespace, fallback);
|
|
8868
9230
|
if (!readNamespaces.includes(ns)) readNamespaces.push(ns);
|
|
8869
9231
|
}
|
|
9232
|
+
assertWriteNamespaceAllowed(writeNamespace);
|
|
8870
9233
|
return {
|
|
8871
9234
|
principal,
|
|
8872
9235
|
baseNamespace,
|
|
@@ -11992,6 +12355,21 @@ export {
|
|
|
11992
12355
|
clusterByKey,
|
|
11993
12356
|
computeProcedureStats,
|
|
11994
12357
|
formatProcedureStatsText,
|
|
12358
|
+
OPERATION_NAMES,
|
|
12359
|
+
coerceBooleanLike,
|
|
12360
|
+
coercePositiveInteger,
|
|
12361
|
+
normalizeOptionalPath,
|
|
12362
|
+
formatZodIssues,
|
|
12363
|
+
defineOperation,
|
|
12364
|
+
getOperation,
|
|
12365
|
+
listRegisteredOperations,
|
|
12366
|
+
__resetRegistryForTest,
|
|
12367
|
+
namespaceWritableRequest,
|
|
12368
|
+
parseNamespacePreflightWriteOp,
|
|
12369
|
+
assertNamespacePreflightPermitted,
|
|
12370
|
+
resolveNamespaceWritablePreflight,
|
|
12371
|
+
resolveAuthorizedNamespaceWritablePreflight,
|
|
12372
|
+
resolveQueryNamespaceWritablePreflight,
|
|
11995
12373
|
AccessObserveWriteSurface,
|
|
11996
12374
|
AccessLcmSurface,
|
|
11997
12375
|
hasIdentityRecoveryIntent,
|
|
@@ -12007,4 +12385,4 @@ export {
|
|
|
12007
12385
|
EngramAccessService,
|
|
12008
12386
|
AccessAdminOpsSurface
|
|
12009
12387
|
};
|
|
12010
|
-
//# sourceMappingURL=chunk-
|
|
12388
|
+
//# sourceMappingURL=chunk-HWFK24UD.js.map
|