@remnic/core 1.0.3 → 1.1.0
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/abort-error.d.ts +32 -0
- package/dist/abort-error.js +11 -0
- package/dist/access-cli.js +41 -40
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +3 -2
- package/dist/access-http.js +11 -11
- package/dist/access-mcp.d.ts +3 -2
- package/dist/access-mcp.js +7 -7
- package/dist/access-schema.d.ts +16 -16
- package/dist/access-service-HmO1Trrx.d.ts +732 -0
- package/dist/access-service.d.ts +11 -658
- package/dist/access-service.js +9 -9
- package/dist/bootstrap.d.ts +1 -1
- package/dist/briefing.js +6 -6
- package/dist/calibration.js +3 -3
- package/dist/causal-consolidation.js +10 -10
- package/dist/{chunk-PMB3WGDL.js → chunk-37UIFYWO.js} +64 -3
- package/dist/chunk-37UIFYWO.js.map +1 -0
- package/dist/{chunk-X4WESCKA.js → chunk-3QHL5ABG.js} +5 -5
- package/dist/{chunk-2VFW5K5U.js → chunk-3SV6CQHO.js} +10 -8
- package/dist/chunk-3SV6CQHO.js.map +1 -0
- package/dist/{chunk-U2IQTSBY.js → chunk-3WHVNEN7.js} +1 -1
- package/dist/chunk-3WHVNEN7.js.map +1 -0
- package/dist/{chunk-QKAH5B6E.js → chunk-44ICJRF3.js} +97 -9
- package/dist/chunk-44ICJRF3.js.map +1 -0
- package/dist/{chunk-S4LX5EBI.js → chunk-47UU5PU2.js} +48 -9
- package/dist/chunk-47UU5PU2.js.map +1 -0
- package/dist/{chunk-ECKDIK5F.js → chunk-4LACOVZX.js} +2 -2
- package/dist/{chunk-AYPYCLR7.js → chunk-6LX5ORAS.js} +2 -2
- package/dist/{chunk-GJQPH5G3.js → chunk-6UJ47TVX.js} +2 -2
- package/dist/{chunk-KWP7T3DP.js → chunk-7ECD5ATE.js} +2 -2
- package/dist/{chunk-74JR4N5J.js → chunk-7WQ6SLIE.js} +2 -2
- package/dist/{chunk-7PA4OZEU.js → chunk-BLKTA7MM.js} +6 -14
- package/dist/chunk-BLKTA7MM.js.map +1 -0
- package/dist/{chunk-XMGSSBFX.js → chunk-DEPL3635.js} +172 -100
- package/dist/chunk-DEPL3635.js.map +1 -0
- package/dist/{chunk-JROGC36Y.js → chunk-DHHP2Z4X.js} +2 -2
- package/dist/{chunk-BKQJBXXX.js → chunk-GGD5W7TB.js} +2 -2
- package/dist/chunk-GGD5W7TB.js.map +1 -0
- package/dist/{chunk-POMSFKTB.js → chunk-GV6NLQ4X.js} +14 -14
- package/dist/{chunk-AAI7JARD.js → chunk-HMDCOMYU.js} +8 -11
- package/dist/chunk-HMDCOMYU.js.map +1 -0
- package/dist/{chunk-POBPGDWI.js → chunk-ITRLGI2T.js} +2 -2
- package/dist/{chunk-MYQWXITD.js → chunk-JIU55F3X.js} +2 -2
- package/dist/{chunk-UPMD5XND.js → chunk-JL2PU6AI.js} +16 -5
- package/dist/chunk-JL2PU6AI.js.map +1 -0
- package/dist/{chunk-OJFGVJS6.js → chunk-MBJHSA7F.js} +65 -9
- package/dist/chunk-MBJHSA7F.js.map +1 -0
- package/dist/{chunk-V7XCAHIB.js → chunk-MVTHXUBX.js} +46 -23
- package/dist/chunk-MVTHXUBX.js.map +1 -0
- package/dist/{chunk-BTY5RRRF.js → chunk-N42IWANG.js} +5 -5
- package/dist/{chunk-NSB3WSYS.js → chunk-NQEVYWX6.js} +74 -3
- package/dist/chunk-NQEVYWX6.js.map +1 -0
- package/dist/chunk-OIT5QGG4.js +80 -0
- package/dist/chunk-OIT5QGG4.js.map +1 -0
- package/dist/chunk-PVGDJXVK.js +21 -0
- package/dist/chunk-PVGDJXVK.js.map +1 -0
- package/dist/{chunk-RCICHSHL.js → chunk-SYUK3VLY.js} +2 -2
- package/dist/{chunk-YFYL2SIJ.js → chunk-WBSAYXVI.js} +127 -39
- package/dist/chunk-WBSAYXVI.js.map +1 -0
- package/dist/{chunk-KEG4GNGI.js → chunk-XZ2TIKGC.js} +38 -8
- package/dist/chunk-XZ2TIKGC.js.map +1 -0
- package/dist/chunk-Y4FHOFJ2.js +140 -0
- package/dist/chunk-Y4FHOFJ2.js.map +1 -0
- package/dist/chunk-YNB73F22.js +137 -0
- package/dist/chunk-YNB73F22.js.map +1 -0
- package/dist/{chunk-HITJFT7E.js → chunk-ZVBB3T7V.js} +10 -5
- package/dist/chunk-ZVBB3T7V.js.map +1 -0
- package/dist/{cli-DwIBnp2g.d.ts → cli-BneVIEvh.d.ts} +2 -2
- package/dist/cli.d.ts +4 -3
- package/dist/cli.js +25 -24
- package/dist/config.js +1 -1
- package/dist/contradiction-review-WIUBAR52.js +21 -0
- package/dist/contradiction-review-WIUBAR52.js.map +1 -0
- package/dist/contradiction-scan-GR33PONM.js +376 -0
- package/dist/contradiction-scan-GR33PONM.js.map +1 -0
- package/dist/direct-answer-wiring.d.ts +77 -0
- package/dist/direct-answer-wiring.js +75 -0
- package/dist/direct-answer-wiring.js.map +1 -0
- package/dist/direct-answer.d.ts +106 -0
- package/dist/direct-answer.js +10 -0
- package/dist/direct-answer.js.map +1 -0
- package/dist/{engine-X7X3AAG3.js → engine-5TIQBYZR.js} +7 -7
- package/dist/engine-5TIQBYZR.js.map +1 -0
- package/dist/entity-retrieval.js +6 -6
- package/dist/explicit-capture.d.ts +1 -1
- package/dist/extraction.js +6 -6
- package/dist/fallback-llm.d.ts +11 -2
- package/dist/fallback-llm.js +3 -3
- package/dist/harmonic-retrieval.js +2 -1
- package/dist/index.d.ts +10 -124
- package/dist/index.js +74 -137
- package/dist/index.js.map +1 -1
- package/dist/intent.js +1 -1
- package/dist/local-llm.d.ts +10 -3
- package/dist/local-llm.js +1 -1
- package/dist/operator-toolkit.js +12 -11
- package/dist/{orchestrator-B9kwlCep.d.ts → orchestrator-DRYA6_lW.d.ts} +21 -2
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.js +36 -35
- package/dist/qmd.js +2 -1
- package/dist/recall-state.d.ts +28 -1
- package/dist/recall-state.js +1 -1
- package/dist/resolution-QBTDHTG7.js +100 -0
- package/dist/resolution-QBTDHTG7.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +24 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +3 -3
- package/dist/schemas.d.ts +14 -14
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +6 -6
- package/dist/semantic-rule-verifier.js +6 -6
- package/dist/storage.js +5 -5
- package/dist/summarizer.js +5 -5
- package/dist/types-DJhqDJUV.d.ts +50 -0
- package/dist/types.d.ts +34 -2
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-2VFW5K5U.js.map +0 -1
- package/dist/chunk-7PA4OZEU.js.map +0 -1
- package/dist/chunk-AAI7JARD.js.map +0 -1
- package/dist/chunk-BKQJBXXX.js.map +0 -1
- package/dist/chunk-HITJFT7E.js.map +0 -1
- package/dist/chunk-KEG4GNGI.js.map +0 -1
- package/dist/chunk-NSB3WSYS.js.map +0 -1
- package/dist/chunk-OJFGVJS6.js.map +0 -1
- package/dist/chunk-PMB3WGDL.js.map +0 -1
- package/dist/chunk-QKAH5B6E.js.map +0 -1
- package/dist/chunk-S4LX5EBI.js.map +0 -1
- package/dist/chunk-U2IQTSBY.js.map +0 -1
- package/dist/chunk-UPMD5XND.js.map +0 -1
- package/dist/chunk-V7XCAHIB.js.map +0 -1
- package/dist/chunk-XMGSSBFX.js.map +0 -1
- package/dist/chunk-YFYL2SIJ.js.map +0 -1
- /package/dist/{engine-X7X3AAG3.js.map → abort-error.js.map} +0 -0
- /package/dist/{chunk-X4WESCKA.js.map → chunk-3QHL5ABG.js.map} +0 -0
- /package/dist/{chunk-ECKDIK5F.js.map → chunk-4LACOVZX.js.map} +0 -0
- /package/dist/{chunk-AYPYCLR7.js.map → chunk-6LX5ORAS.js.map} +0 -0
- /package/dist/{chunk-GJQPH5G3.js.map → chunk-6UJ47TVX.js.map} +0 -0
- /package/dist/{chunk-KWP7T3DP.js.map → chunk-7ECD5ATE.js.map} +0 -0
- /package/dist/{chunk-74JR4N5J.js.map → chunk-7WQ6SLIE.js.map} +0 -0
- /package/dist/{chunk-JROGC36Y.js.map → chunk-DHHP2Z4X.js.map} +0 -0
- /package/dist/{chunk-POMSFKTB.js.map → chunk-GV6NLQ4X.js.map} +0 -0
- /package/dist/{chunk-POBPGDWI.js.map → chunk-ITRLGI2T.js.map} +0 -0
- /package/dist/{chunk-MYQWXITD.js.map → chunk-JIU55F3X.js.map} +0 -0
- /package/dist/{chunk-BTY5RRRF.js.map → chunk-N42IWANG.js.map} +0 -0
- /package/dist/{chunk-RCICHSHL.js.map → chunk-SYUK3VLY.js.map} +0 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
import { DaySummaryResult, RecallPlanMode, MemoryFile, MemoryLifecycleEvent, EntityFile, MemoryStatus, PluginConfig } from './types.js';
|
|
2
|
+
import { ExplicitCaptureInput } from './explicit-capture.js';
|
|
3
|
+
import { r as readMemoryGovernanceRunArtifact } from './memory-projection-store-DeSXPh1j.js';
|
|
4
|
+
import { LastRecallSnapshot } from './recall-state.js';
|
|
5
|
+
import { O as Orchestrator, I as IntentDebugSnapshot, G as GraphRecallSnapshot } from './orchestrator-DRYA6_lW.js';
|
|
6
|
+
import { StorageManager } from './storage.js';
|
|
7
|
+
import { TrustZoneStoreStatus, TrustZoneName, TrustZoneRecordKind, TrustZoneSourceClass, TrustZoneProvenanceScore, TrustZonePromotionResult, TrustZoneDemoSeedResult } from './trust-zones.js';
|
|
8
|
+
import { LocalLlmClient } from './local-llm.js';
|
|
9
|
+
import { FallbackLlmClient } from './fallback-llm.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @remnic/core — Write-time semantic dedup guard
|
|
13
|
+
*
|
|
14
|
+
* Complements the exact content-hash check in the orchestrator's write path
|
|
15
|
+
* by detecting near-duplicate candidate facts via embedding cosine similarity.
|
|
16
|
+
*
|
|
17
|
+
* The module intentionally has no dependency on the EmbeddingFallback or QMD
|
|
18
|
+
* classes directly — callers pass in a `lookup` function that returns the
|
|
19
|
+
* top-K nearest neighbors with their cosine scores. This keeps the decision
|
|
20
|
+
* logic pure and trivially testable with synthetic fixtures, and lets the
|
|
21
|
+
* orchestrator reuse whichever backend it already has wired up.
|
|
22
|
+
*
|
|
23
|
+
* Related issue: joshuaswarren/remnic#373
|
|
24
|
+
*/
|
|
25
|
+
/** A single nearest-neighbor hit from the embedding backend. */
|
|
26
|
+
interface SemanticDedupHit {
|
|
27
|
+
/** Memory id of the existing neighbor. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Cosine similarity score in [0, 1]. */
|
|
30
|
+
score: number;
|
|
31
|
+
/** Optional source path, purely informational. */
|
|
32
|
+
path?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Lookup function passed by the caller. Must return an array of hits sorted
|
|
36
|
+
* descending by score. Implementations should return an empty array (never
|
|
37
|
+
* throw) when the embedding backend is unavailable — the decision function
|
|
38
|
+
* treats that as "no near duplicate" (fail-open).
|
|
39
|
+
*/
|
|
40
|
+
type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
|
|
41
|
+
interface SemanticDedupOptions {
|
|
42
|
+
/** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
|
|
45
|
+
threshold: number;
|
|
46
|
+
/** How many nearest neighbors to compare against. */
|
|
47
|
+
candidates: number;
|
|
48
|
+
}
|
|
49
|
+
type SemanticDedupDecision = {
|
|
50
|
+
action: "keep";
|
|
51
|
+
reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
|
|
52
|
+
topScore?: number;
|
|
53
|
+
topId?: string;
|
|
54
|
+
} | {
|
|
55
|
+
action: "skip";
|
|
56
|
+
reason: "near_duplicate";
|
|
57
|
+
topScore: number;
|
|
58
|
+
topId: string;
|
|
59
|
+
topPath?: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Pure decision function: given a lookup callback and options, decide whether
|
|
63
|
+
* the candidate content should be written or skipped as a near-duplicate.
|
|
64
|
+
*
|
|
65
|
+
* Contract:
|
|
66
|
+
* - When `options.enabled` is false → always keep, reason="disabled".
|
|
67
|
+
* - When the lookup throws (provider down / network error) → keep,
|
|
68
|
+
* reason="backend_unavailable". Fail-open: a lookup failure must not block
|
|
69
|
+
* writes.
|
|
70
|
+
* - When the lookup succeeds but returns 0 hits (empty index or no
|
|
71
|
+
* neighbors above the score floor) → keep, reason="no_candidates".
|
|
72
|
+
* This is distinct from backend_unavailable so telemetry dashboards can
|
|
73
|
+
* correctly distinguish "provider is down" from "index is empty".
|
|
74
|
+
* - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
|
|
75
|
+
* - Otherwise → keep with reason="no_near_duplicate".
|
|
76
|
+
*/
|
|
77
|
+
declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
|
|
78
|
+
|
|
79
|
+
declare class EngramAccessInputError extends Error {
|
|
80
|
+
}
|
|
81
|
+
declare const ENGRAM_ACCESS_WRITE_SCHEMA_VERSION = 1;
|
|
82
|
+
interface EngramAccessHealthResponse {
|
|
83
|
+
ok: true;
|
|
84
|
+
memoryDir: string;
|
|
85
|
+
namespacesEnabled: boolean;
|
|
86
|
+
defaultNamespace: string;
|
|
87
|
+
searchBackend: string;
|
|
88
|
+
qmdEnabled: boolean;
|
|
89
|
+
nativeKnowledgeEnabled: boolean;
|
|
90
|
+
projectionAvailable: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface EngramAccessRecallRequest {
|
|
93
|
+
query: string;
|
|
94
|
+
sessionKey?: string;
|
|
95
|
+
namespace?: string;
|
|
96
|
+
topK?: number;
|
|
97
|
+
mode?: RecallPlanMode | "auto";
|
|
98
|
+
includeDebug?: boolean;
|
|
99
|
+
}
|
|
100
|
+
interface EngramAccessRecallResponse {
|
|
101
|
+
query: string;
|
|
102
|
+
sessionKey?: string;
|
|
103
|
+
namespace: string;
|
|
104
|
+
context: string;
|
|
105
|
+
count: number;
|
|
106
|
+
memoryIds: string[];
|
|
107
|
+
results: EngramAccessMemorySummary[];
|
|
108
|
+
recordedAt?: string;
|
|
109
|
+
traceId?: string;
|
|
110
|
+
plannerMode?: RecallPlanMode;
|
|
111
|
+
fallbackUsed: boolean;
|
|
112
|
+
sourcesUsed: string[];
|
|
113
|
+
budgetsApplied?: LastRecallSnapshot["budgetsApplied"];
|
|
114
|
+
latencyMs?: number;
|
|
115
|
+
debug?: {
|
|
116
|
+
snapshot?: LastRecallSnapshot;
|
|
117
|
+
intent?: IntentDebugSnapshot | null;
|
|
118
|
+
graph?: GraphRecallSnapshot | null;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
interface EngramAccessRecallExplainRequest {
|
|
122
|
+
sessionKey?: string;
|
|
123
|
+
namespace?: string;
|
|
124
|
+
}
|
|
125
|
+
interface EngramAccessRecallExplainResponse {
|
|
126
|
+
found: boolean;
|
|
127
|
+
snapshot?: LastRecallSnapshot;
|
|
128
|
+
intent?: IntentDebugSnapshot | null;
|
|
129
|
+
graph?: GraphRecallSnapshot | null;
|
|
130
|
+
}
|
|
131
|
+
interface EngramAccessDaySummaryRequest {
|
|
132
|
+
memories?: string;
|
|
133
|
+
sessionKey?: string;
|
|
134
|
+
namespace?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Inputs accepted by the `remnic_briefing` MCP tool. */
|
|
137
|
+
interface EngramAccessBriefingRequest {
|
|
138
|
+
since?: string;
|
|
139
|
+
focus?: string;
|
|
140
|
+
namespace?: string;
|
|
141
|
+
format?: "markdown" | "json";
|
|
142
|
+
maxFollowups?: number;
|
|
143
|
+
/** Caller principal for namespace access checks. Transport-bound — never from untrusted payloads. */
|
|
144
|
+
principal?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Response for `remnic_briefing`. */
|
|
147
|
+
interface EngramAccessBriefingResponse {
|
|
148
|
+
format: "markdown" | "json";
|
|
149
|
+
window: {
|
|
150
|
+
from: string;
|
|
151
|
+
to: string;
|
|
152
|
+
};
|
|
153
|
+
namespace: string;
|
|
154
|
+
markdown: string;
|
|
155
|
+
json: Record<string, unknown>;
|
|
156
|
+
followupsUnavailableReason?: string;
|
|
157
|
+
}
|
|
158
|
+
interface EngramAccessMemoryRecord {
|
|
159
|
+
id: string;
|
|
160
|
+
path: string;
|
|
161
|
+
category: string;
|
|
162
|
+
status?: string;
|
|
163
|
+
created?: string;
|
|
164
|
+
updated?: string;
|
|
165
|
+
content: string;
|
|
166
|
+
frontmatter: MemoryFile["frontmatter"];
|
|
167
|
+
}
|
|
168
|
+
interface EngramAccessMemorySummary {
|
|
169
|
+
id: string;
|
|
170
|
+
path: string;
|
|
171
|
+
category: string;
|
|
172
|
+
status: string;
|
|
173
|
+
created?: string;
|
|
174
|
+
updated?: string;
|
|
175
|
+
tags: string[];
|
|
176
|
+
entityRef?: string;
|
|
177
|
+
preview: string;
|
|
178
|
+
}
|
|
179
|
+
interface EngramAccessMemoryBrowseRequest {
|
|
180
|
+
query?: string;
|
|
181
|
+
status?: string;
|
|
182
|
+
category?: string;
|
|
183
|
+
namespace?: string;
|
|
184
|
+
sort?: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
|
|
185
|
+
limit?: number;
|
|
186
|
+
offset?: number;
|
|
187
|
+
}
|
|
188
|
+
interface EngramAccessMemoryBrowseResponse {
|
|
189
|
+
namespace: string;
|
|
190
|
+
sort: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
|
|
191
|
+
total: number;
|
|
192
|
+
count: number;
|
|
193
|
+
limit: number;
|
|
194
|
+
offset: number;
|
|
195
|
+
memories: EngramAccessMemorySummary[];
|
|
196
|
+
}
|
|
197
|
+
interface EngramAccessMemoryResponse {
|
|
198
|
+
found: boolean;
|
|
199
|
+
namespace: string;
|
|
200
|
+
memory?: EngramAccessMemoryRecord;
|
|
201
|
+
}
|
|
202
|
+
interface EngramAccessTimelineResponse {
|
|
203
|
+
found: boolean;
|
|
204
|
+
namespace: string;
|
|
205
|
+
count: number;
|
|
206
|
+
timeline: MemoryLifecycleEvent[];
|
|
207
|
+
}
|
|
208
|
+
interface EngramAccessEntitySummary {
|
|
209
|
+
name: string;
|
|
210
|
+
type: string;
|
|
211
|
+
updated: string;
|
|
212
|
+
summary?: string;
|
|
213
|
+
aliases: string[];
|
|
214
|
+
}
|
|
215
|
+
interface EngramAccessEntityListResponse {
|
|
216
|
+
namespace: string;
|
|
217
|
+
total: number;
|
|
218
|
+
count: number;
|
|
219
|
+
limit: number;
|
|
220
|
+
offset: number;
|
|
221
|
+
entities: EngramAccessEntitySummary[];
|
|
222
|
+
}
|
|
223
|
+
interface EngramAccessEntityResponse {
|
|
224
|
+
found: boolean;
|
|
225
|
+
namespace: string;
|
|
226
|
+
entity?: EntityFile;
|
|
227
|
+
}
|
|
228
|
+
interface EngramAccessReviewQueueResponse {
|
|
229
|
+
found: boolean;
|
|
230
|
+
namespace?: string;
|
|
231
|
+
runId?: string;
|
|
232
|
+
summary?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["summary"];
|
|
233
|
+
metrics?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["metrics"];
|
|
234
|
+
qualityScore?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["qualityScore"];
|
|
235
|
+
reviewQueue?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["reviewQueue"];
|
|
236
|
+
appliedActions?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["appliedActions"];
|
|
237
|
+
transitionReport?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["transitionReport"];
|
|
238
|
+
report?: string;
|
|
239
|
+
}
|
|
240
|
+
interface EngramAccessMaintenanceResponse {
|
|
241
|
+
namespace: string;
|
|
242
|
+
health: EngramAccessHealthResponse;
|
|
243
|
+
latestGovernanceRun: EngramAccessReviewQueueResponse;
|
|
244
|
+
}
|
|
245
|
+
interface EngramAccessTrustZoneStatusResponse {
|
|
246
|
+
namespace: string;
|
|
247
|
+
status: TrustZoneStoreStatus;
|
|
248
|
+
}
|
|
249
|
+
interface EngramAccessTrustZoneRecordSummary {
|
|
250
|
+
recordId: string;
|
|
251
|
+
filePath: string;
|
|
252
|
+
zone: TrustZoneName;
|
|
253
|
+
recordedAt: string;
|
|
254
|
+
kind: TrustZoneRecordKind;
|
|
255
|
+
summary: string;
|
|
256
|
+
sourceClass: TrustZoneSourceClass;
|
|
257
|
+
sessionKey?: string;
|
|
258
|
+
sourceId?: string;
|
|
259
|
+
evidenceHashPresent: boolean;
|
|
260
|
+
anchored: boolean;
|
|
261
|
+
entityRefs: string[];
|
|
262
|
+
tags: string[];
|
|
263
|
+
metadata?: Record<string, string>;
|
|
264
|
+
trustScore?: TrustZoneProvenanceScore;
|
|
265
|
+
nextPromotionTarget?: TrustZoneName;
|
|
266
|
+
nextPromotionAllowed: boolean;
|
|
267
|
+
nextPromotionReasons: string[];
|
|
268
|
+
corroborationCount?: number;
|
|
269
|
+
corroborationSourceClasses?: TrustZoneSourceClass[];
|
|
270
|
+
}
|
|
271
|
+
interface EngramAccessTrustZoneBrowseRequest {
|
|
272
|
+
query?: string;
|
|
273
|
+
zone?: TrustZoneName;
|
|
274
|
+
kind?: TrustZoneRecordKind;
|
|
275
|
+
sourceClass?: TrustZoneSourceClass;
|
|
276
|
+
namespace?: string;
|
|
277
|
+
limit?: number;
|
|
278
|
+
offset?: number;
|
|
279
|
+
}
|
|
280
|
+
interface EngramAccessTrustZoneBrowseResponse {
|
|
281
|
+
namespace: string;
|
|
282
|
+
total: number;
|
|
283
|
+
count: number;
|
|
284
|
+
limit: number;
|
|
285
|
+
offset: number;
|
|
286
|
+
records: EngramAccessTrustZoneRecordSummary[];
|
|
287
|
+
}
|
|
288
|
+
interface EngramAccessTrustZonePromoteRequest {
|
|
289
|
+
recordId: string;
|
|
290
|
+
targetZone: TrustZoneName;
|
|
291
|
+
promotionReason: string;
|
|
292
|
+
recordedAt?: string;
|
|
293
|
+
summary?: string;
|
|
294
|
+
dryRun?: boolean;
|
|
295
|
+
namespace?: string;
|
|
296
|
+
authenticatedPrincipal?: string;
|
|
297
|
+
}
|
|
298
|
+
interface EngramAccessTrustZonePromoteResponse extends TrustZonePromotionResult {
|
|
299
|
+
namespace: string;
|
|
300
|
+
dryRun: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface EngramAccessTrustZoneDemoSeedRequest {
|
|
303
|
+
scenario?: string;
|
|
304
|
+
recordedAt?: string;
|
|
305
|
+
dryRun?: boolean;
|
|
306
|
+
namespace?: string;
|
|
307
|
+
authenticatedPrincipal?: string;
|
|
308
|
+
}
|
|
309
|
+
interface EngramAccessTrustZoneDemoSeedResponse extends TrustZoneDemoSeedResult {
|
|
310
|
+
namespace: string;
|
|
311
|
+
}
|
|
312
|
+
interface EngramAccessQualityResponse {
|
|
313
|
+
namespace: string;
|
|
314
|
+
totalMemories: number;
|
|
315
|
+
statusCounts: Record<string, number>;
|
|
316
|
+
categoryCounts: Record<string, number>;
|
|
317
|
+
confidenceTierCounts: Record<string, number>;
|
|
318
|
+
ageBucketCounts: Record<string, number>;
|
|
319
|
+
archivePressure: {
|
|
320
|
+
pendingReview: number;
|
|
321
|
+
quarantined: number;
|
|
322
|
+
archived: number;
|
|
323
|
+
staleActive: number;
|
|
324
|
+
lowConfidenceActive: number;
|
|
325
|
+
};
|
|
326
|
+
latestGovernanceRun: {
|
|
327
|
+
found: boolean;
|
|
328
|
+
runId?: string;
|
|
329
|
+
qualityScore?: EngramAccessReviewQueueResponse["qualityScore"];
|
|
330
|
+
reviewQueueCount: number;
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
interface EngramAccessReviewDispositionRequest {
|
|
334
|
+
memoryId: string;
|
|
335
|
+
status: MemoryStatus | "archived";
|
|
336
|
+
reasonCode: string;
|
|
337
|
+
namespace?: string;
|
|
338
|
+
/**
|
|
339
|
+
* Trusted transport-bound principal. This must never come from untrusted client payloads.
|
|
340
|
+
* When present, write authorization is evaluated against this principal instead of sessionKey.
|
|
341
|
+
*/
|
|
342
|
+
authenticatedPrincipal?: string;
|
|
343
|
+
}
|
|
344
|
+
interface EngramAccessReviewDispositionResponse {
|
|
345
|
+
ok: boolean;
|
|
346
|
+
namespace: string;
|
|
347
|
+
memoryId: string;
|
|
348
|
+
status: MemoryStatus | "archived";
|
|
349
|
+
previousStatus: MemoryStatus;
|
|
350
|
+
currentPath?: string;
|
|
351
|
+
}
|
|
352
|
+
interface EngramAccessWriteEnvelope {
|
|
353
|
+
schemaVersion?: number;
|
|
354
|
+
idempotencyKey?: string;
|
|
355
|
+
dryRun?: boolean;
|
|
356
|
+
sessionKey?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Trusted transport-bound principal. This must never come from untrusted client payloads.
|
|
359
|
+
* When present, write authorization is evaluated against this principal instead of sessionKey.
|
|
360
|
+
*/
|
|
361
|
+
authenticatedPrincipal?: string;
|
|
362
|
+
}
|
|
363
|
+
interface EngramAccessMemoryStoreRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
|
|
364
|
+
}
|
|
365
|
+
interface EngramAccessSuggestionSubmitRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
|
|
366
|
+
}
|
|
367
|
+
interface EngramAccessWriteResponse {
|
|
368
|
+
schemaVersion: 1;
|
|
369
|
+
operation: "memory_store" | "suggestion_submit";
|
|
370
|
+
namespace: string;
|
|
371
|
+
dryRun: boolean;
|
|
372
|
+
accepted: boolean;
|
|
373
|
+
queued: boolean;
|
|
374
|
+
status: "validated" | "stored" | "duplicate" | "queued_for_review";
|
|
375
|
+
memoryId?: string;
|
|
376
|
+
duplicateOf?: string;
|
|
377
|
+
idempotencyKey?: string;
|
|
378
|
+
idempotencyReplay?: boolean;
|
|
379
|
+
}
|
|
380
|
+
interface EngramAccessObserveRequest {
|
|
381
|
+
sessionKey: string;
|
|
382
|
+
messages: Array<{
|
|
383
|
+
role: "user" | "assistant";
|
|
384
|
+
content: string;
|
|
385
|
+
}>;
|
|
386
|
+
namespace?: string;
|
|
387
|
+
authenticatedPrincipal?: string;
|
|
388
|
+
skipExtraction?: boolean;
|
|
389
|
+
}
|
|
390
|
+
interface EngramAccessObserveResponse {
|
|
391
|
+
accepted: number;
|
|
392
|
+
sessionKey: string;
|
|
393
|
+
namespace: string;
|
|
394
|
+
lcmArchived: boolean;
|
|
395
|
+
extractionQueued: boolean;
|
|
396
|
+
}
|
|
397
|
+
interface EngramAccessLcmSearchRequest {
|
|
398
|
+
query: string;
|
|
399
|
+
sessionKey?: string;
|
|
400
|
+
namespace?: string;
|
|
401
|
+
limit?: number;
|
|
402
|
+
authenticatedPrincipal?: string;
|
|
403
|
+
}
|
|
404
|
+
interface EngramAccessLcmSearchResponse {
|
|
405
|
+
query: string;
|
|
406
|
+
namespace: string;
|
|
407
|
+
results: Array<{
|
|
408
|
+
sessionId: string;
|
|
409
|
+
content: string;
|
|
410
|
+
turnIndex?: number;
|
|
411
|
+
}>;
|
|
412
|
+
count: number;
|
|
413
|
+
lcmEnabled: boolean;
|
|
414
|
+
}
|
|
415
|
+
interface EngramAccessLcmStatusResponse {
|
|
416
|
+
enabled: boolean;
|
|
417
|
+
archiveAvailable: boolean;
|
|
418
|
+
stats?: {
|
|
419
|
+
totalTurns?: number;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
type EngramAccessIdempotencyStatus = "miss" | "replay" | "conflict";
|
|
423
|
+
declare class EngramAccessService {
|
|
424
|
+
private readonly orchestrator;
|
|
425
|
+
private readonly idempotency;
|
|
426
|
+
private readonly idempotencyLocks;
|
|
427
|
+
constructor(orchestrator: Orchestrator);
|
|
428
|
+
get briefingEnabled(): boolean;
|
|
429
|
+
private resolveNamespace;
|
|
430
|
+
private normalizeRecallMode;
|
|
431
|
+
private resolveRecallNamespace;
|
|
432
|
+
private resolveWritePrincipal;
|
|
433
|
+
private resolveWritableNamespace;
|
|
434
|
+
private resolveReadableNamespace;
|
|
435
|
+
private buildRecallDebug;
|
|
436
|
+
private serializeRecallResults;
|
|
437
|
+
private handleIdempotentWrite;
|
|
438
|
+
private peekIdempotentWrite;
|
|
439
|
+
private withIdempotencyLock;
|
|
440
|
+
health(namespace?: string): Promise<EngramAccessHealthResponse>;
|
|
441
|
+
daySummary(request: EngramAccessDaySummaryRequest): Promise<DaySummaryResult | null>;
|
|
442
|
+
/**
|
|
443
|
+
* Build a daily context briefing. Gracefully degrades when the OpenAI key
|
|
444
|
+
* or Responses API is unavailable — never throws for LLM-related problems.
|
|
445
|
+
*/
|
|
446
|
+
briefing(request: EngramAccessBriefingRequest): Promise<EngramAccessBriefingResponse>;
|
|
447
|
+
recall(request: EngramAccessRecallRequest): Promise<EngramAccessRecallResponse>;
|
|
448
|
+
recallExplain(request?: EngramAccessRecallExplainRequest): Promise<EngramAccessRecallExplainResponse>;
|
|
449
|
+
memoryStore(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessWriteResponse>;
|
|
450
|
+
peekMemoryStoreIdempotency(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessIdempotencyStatus>;
|
|
451
|
+
suggestionSubmit(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessWriteResponse>;
|
|
452
|
+
peekSuggestionSubmitIdempotency(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessIdempotencyStatus>;
|
|
453
|
+
private validateWriteCandidate;
|
|
454
|
+
memoryGet(memoryId: string, namespace?: string, principal?: string): Promise<EngramAccessMemoryResponse>;
|
|
455
|
+
memoryBrowse(request?: EngramAccessMemoryBrowseRequest): Promise<EngramAccessMemoryBrowseResponse>;
|
|
456
|
+
memoryTimeline(memoryId: string, namespace?: string, limit?: number, principal?: string): Promise<EngramAccessTimelineResponse>;
|
|
457
|
+
entityList(options?: {
|
|
458
|
+
namespace?: string;
|
|
459
|
+
query?: string;
|
|
460
|
+
limit?: number;
|
|
461
|
+
offset?: number;
|
|
462
|
+
}): Promise<EngramAccessEntityListResponse>;
|
|
463
|
+
entityGet(name: string, namespace?: string): Promise<EngramAccessEntityResponse>;
|
|
464
|
+
reviewQueue(runId?: string, namespace?: string, principal?: string): Promise<EngramAccessReviewQueueResponse>;
|
|
465
|
+
maintenance(namespace?: string, principal?: string): Promise<EngramAccessMaintenanceResponse>;
|
|
466
|
+
quality(namespace?: string, principal?: string): Promise<EngramAccessQualityResponse>;
|
|
467
|
+
governanceRun(request: {
|
|
468
|
+
namespace?: string;
|
|
469
|
+
mode?: "shadow" | "apply";
|
|
470
|
+
recentDays?: number;
|
|
471
|
+
maxMemories?: number;
|
|
472
|
+
batchSize?: number;
|
|
473
|
+
authenticatedPrincipal?: string;
|
|
474
|
+
}, principal?: string): Promise<{
|
|
475
|
+
namespace: string;
|
|
476
|
+
runId: string;
|
|
477
|
+
traceId: string;
|
|
478
|
+
mode: "shadow" | "apply";
|
|
479
|
+
reviewQueueCount: number;
|
|
480
|
+
proposedActionCount: number;
|
|
481
|
+
appliedActionCount: number;
|
|
482
|
+
summaryPath: string;
|
|
483
|
+
reportPath: string;
|
|
484
|
+
}>;
|
|
485
|
+
procedureMiningRun(request: {
|
|
486
|
+
namespace?: string;
|
|
487
|
+
authenticatedPrincipal?: string;
|
|
488
|
+
}, principal?: string): Promise<{
|
|
489
|
+
namespace: string;
|
|
490
|
+
clustersProcessed: number;
|
|
491
|
+
proceduresWritten: number;
|
|
492
|
+
skippedReason?: string;
|
|
493
|
+
}>;
|
|
494
|
+
trustZoneStatus(namespace?: string, principal?: string): Promise<EngramAccessTrustZoneStatusResponse>;
|
|
495
|
+
trustZoneBrowse(request: EngramAccessTrustZoneBrowseRequest, principal?: string): Promise<EngramAccessTrustZoneBrowseResponse>;
|
|
496
|
+
trustZonePromote(request: EngramAccessTrustZonePromoteRequest): Promise<EngramAccessTrustZonePromoteResponse>;
|
|
497
|
+
trustZoneDemoSeed(request: EngramAccessTrustZoneDemoSeedRequest): Promise<EngramAccessTrustZoneDemoSeedResponse>;
|
|
498
|
+
reviewDisposition(request: EngramAccessReviewDispositionRequest): Promise<EngramAccessReviewDispositionResponse>;
|
|
499
|
+
private serializeMemory;
|
|
500
|
+
private serializeMemorySummary;
|
|
501
|
+
observe(request: EngramAccessObserveRequest): Promise<EngramAccessObserveResponse>;
|
|
502
|
+
lcmSearch(request: EngramAccessLcmSearchRequest): Promise<EngramAccessLcmSearchResponse>;
|
|
503
|
+
continuityAuditGenerate(request: {
|
|
504
|
+
period?: "weekly" | "monthly";
|
|
505
|
+
key?: string;
|
|
506
|
+
}): Promise<{
|
|
507
|
+
enabled: boolean;
|
|
508
|
+
reason?: string;
|
|
509
|
+
period?: string;
|
|
510
|
+
key?: string;
|
|
511
|
+
reportPath?: string;
|
|
512
|
+
}>;
|
|
513
|
+
continuityIncidentOpen(request: {
|
|
514
|
+
symptom: string;
|
|
515
|
+
namespace?: string;
|
|
516
|
+
principal?: string;
|
|
517
|
+
triggerWindow?: string;
|
|
518
|
+
suspectedCause?: string;
|
|
519
|
+
}): Promise<unknown>;
|
|
520
|
+
continuityIncidentClose(request: {
|
|
521
|
+
id: string;
|
|
522
|
+
namespace?: string;
|
|
523
|
+
principal?: string;
|
|
524
|
+
fixApplied: string;
|
|
525
|
+
verificationResult: string;
|
|
526
|
+
preventiveRule?: string;
|
|
527
|
+
}): Promise<unknown>;
|
|
528
|
+
continuityIncidentList(request: {
|
|
529
|
+
state?: "open" | "closed" | "all";
|
|
530
|
+
namespace?: string;
|
|
531
|
+
principal?: string;
|
|
532
|
+
limit?: number;
|
|
533
|
+
}): Promise<unknown>;
|
|
534
|
+
continuityLoopAddOrUpdate(request: {
|
|
535
|
+
id: string;
|
|
536
|
+
cadence: "daily" | "weekly" | "monthly" | "quarterly";
|
|
537
|
+
purpose: string;
|
|
538
|
+
status: "active" | "paused" | "retired";
|
|
539
|
+
killCondition: string;
|
|
540
|
+
namespace?: string;
|
|
541
|
+
principal?: string;
|
|
542
|
+
lastReviewed?: string;
|
|
543
|
+
notes?: string;
|
|
544
|
+
}): Promise<unknown>;
|
|
545
|
+
continuityLoopReview(request: {
|
|
546
|
+
id: string;
|
|
547
|
+
namespace?: string;
|
|
548
|
+
principal?: string;
|
|
549
|
+
status?: "active" | "paused" | "retired";
|
|
550
|
+
notes?: string;
|
|
551
|
+
reviewedAt?: string;
|
|
552
|
+
}): Promise<unknown>;
|
|
553
|
+
identityAnchorGet(request: {
|
|
554
|
+
namespace?: string;
|
|
555
|
+
principal?: string;
|
|
556
|
+
}): Promise<unknown>;
|
|
557
|
+
identityAnchorUpdate(request: {
|
|
558
|
+
namespace?: string;
|
|
559
|
+
principal?: string;
|
|
560
|
+
identityTraits?: string;
|
|
561
|
+
communicationPreferences?: string;
|
|
562
|
+
operatingPrinciples?: string;
|
|
563
|
+
continuityNotes?: string;
|
|
564
|
+
}): Promise<unknown>;
|
|
565
|
+
memoryIdentity(request: {
|
|
566
|
+
namespace?: string;
|
|
567
|
+
principal?: string;
|
|
568
|
+
}): Promise<unknown>;
|
|
569
|
+
workTask(request: {
|
|
570
|
+
action: "create" | "get" | "list" | "update" | "transition" | "delete";
|
|
571
|
+
id?: string;
|
|
572
|
+
title?: string;
|
|
573
|
+
description?: string;
|
|
574
|
+
status?: string;
|
|
575
|
+
priority?: string;
|
|
576
|
+
owner?: string;
|
|
577
|
+
assignee?: string;
|
|
578
|
+
projectId?: string;
|
|
579
|
+
tags?: string[];
|
|
580
|
+
dueAt?: string;
|
|
581
|
+
}): Promise<unknown>;
|
|
582
|
+
workProject(request: {
|
|
583
|
+
action: "create" | "get" | "list" | "update" | "delete" | "link_task";
|
|
584
|
+
id?: string;
|
|
585
|
+
name?: string;
|
|
586
|
+
description?: string;
|
|
587
|
+
status?: string;
|
|
588
|
+
owner?: string;
|
|
589
|
+
tags?: string[];
|
|
590
|
+
taskId?: string;
|
|
591
|
+
projectId?: string;
|
|
592
|
+
}): Promise<unknown>;
|
|
593
|
+
workBoard(request: {
|
|
594
|
+
action: "export_markdown" | "export_snapshot" | "import_snapshot";
|
|
595
|
+
projectId?: string;
|
|
596
|
+
snapshotJson?: string;
|
|
597
|
+
linkToMemory?: boolean;
|
|
598
|
+
}): Promise<unknown>;
|
|
599
|
+
sharedContextWriteOutput(request: {
|
|
600
|
+
agentId: string;
|
|
601
|
+
title: string;
|
|
602
|
+
content: string;
|
|
603
|
+
}): Promise<unknown>;
|
|
604
|
+
sharedFeedbackRecord(request: {
|
|
605
|
+
agent: string;
|
|
606
|
+
decision: "approved" | "approved_with_feedback" | "rejected";
|
|
607
|
+
reason: string;
|
|
608
|
+
date?: string;
|
|
609
|
+
learning?: string;
|
|
610
|
+
outcome?: string;
|
|
611
|
+
severity?: "low" | "medium" | "high";
|
|
612
|
+
confidence?: number;
|
|
613
|
+
workflow?: string;
|
|
614
|
+
tags?: string[];
|
|
615
|
+
evidenceWindowStart?: string;
|
|
616
|
+
evidenceWindowEnd?: string;
|
|
617
|
+
refs?: string[];
|
|
618
|
+
}): Promise<unknown>;
|
|
619
|
+
sharedPrioritiesAppend(request: {
|
|
620
|
+
agentId: string;
|
|
621
|
+
text: string;
|
|
622
|
+
}): Promise<unknown>;
|
|
623
|
+
sharedContextCrossSignalsRun(request: {
|
|
624
|
+
date?: string;
|
|
625
|
+
}): Promise<unknown>;
|
|
626
|
+
sharedContextCurateDaily(request: {
|
|
627
|
+
date?: string;
|
|
628
|
+
}): Promise<unknown>;
|
|
629
|
+
compoundingWeeklySynthesize(request: {
|
|
630
|
+
weekId?: string;
|
|
631
|
+
}): Promise<unknown>;
|
|
632
|
+
compoundingPromoteCandidate(request: {
|
|
633
|
+
weekId: string;
|
|
634
|
+
candidateId: string;
|
|
635
|
+
dryRun?: boolean;
|
|
636
|
+
}): Promise<unknown>;
|
|
637
|
+
compressionGuidelinesOptimize(request: {
|
|
638
|
+
dryRun?: boolean;
|
|
639
|
+
eventLimit?: number;
|
|
640
|
+
}): Promise<unknown>;
|
|
641
|
+
compressionGuidelinesActivate(request: {
|
|
642
|
+
expectedContentHash?: string;
|
|
643
|
+
expectedGuidelineVersion?: number;
|
|
644
|
+
}): Promise<unknown>;
|
|
645
|
+
/** Conservative identity anchor section merge (matches tools.ts mergeIdentityAnchor logic). */
|
|
646
|
+
private mergeIdentityAnchorSections;
|
|
647
|
+
memorySearch(request: {
|
|
648
|
+
query: string;
|
|
649
|
+
namespace?: string;
|
|
650
|
+
maxResults?: number;
|
|
651
|
+
collection?: string;
|
|
652
|
+
principal?: string;
|
|
653
|
+
}): Promise<{
|
|
654
|
+
query: string;
|
|
655
|
+
results: Array<{
|
|
656
|
+
path: string;
|
|
657
|
+
score: number;
|
|
658
|
+
snippet: string;
|
|
659
|
+
}>;
|
|
660
|
+
count: number;
|
|
661
|
+
}>;
|
|
662
|
+
memoryProfile(namespace?: string, principal?: string): Promise<Record<string, unknown>>;
|
|
663
|
+
memoryEntitiesList(namespace?: string, principal?: string): Promise<{
|
|
664
|
+
entities: string[];
|
|
665
|
+
count: number;
|
|
666
|
+
}>;
|
|
667
|
+
memoryQuestions(namespace?: string, principal?: string): Promise<{
|
|
668
|
+
questions: Array<{
|
|
669
|
+
id: string;
|
|
670
|
+
question: string;
|
|
671
|
+
resolved: boolean;
|
|
672
|
+
}>;
|
|
673
|
+
count: number;
|
|
674
|
+
}>;
|
|
675
|
+
lastRecallSnapshot(sessionKey?: string): Promise<unknown>;
|
|
676
|
+
intentDebug(namespace?: string): Promise<unknown>;
|
|
677
|
+
qmdDebug(namespace?: string): Promise<unknown>;
|
|
678
|
+
graphExplainLastRecall(namespace?: string): Promise<unknown>;
|
|
679
|
+
memoryFeedback(request: {
|
|
680
|
+
memoryId: string;
|
|
681
|
+
vote: "up" | "down";
|
|
682
|
+
note?: string;
|
|
683
|
+
}): Promise<{
|
|
684
|
+
recorded: boolean;
|
|
685
|
+
enabled?: boolean;
|
|
686
|
+
reason?: string;
|
|
687
|
+
}>;
|
|
688
|
+
memoryPromote(request: {
|
|
689
|
+
memoryId: string;
|
|
690
|
+
namespace?: string;
|
|
691
|
+
principal?: string;
|
|
692
|
+
sessionKey?: string;
|
|
693
|
+
}): Promise<unknown>;
|
|
694
|
+
contextCheckpoint(request: {
|
|
695
|
+
sessionKey: string;
|
|
696
|
+
context: string;
|
|
697
|
+
namespace?: string;
|
|
698
|
+
principal?: string;
|
|
699
|
+
}): Promise<{
|
|
700
|
+
saved: boolean;
|
|
701
|
+
}>;
|
|
702
|
+
lcmStatus(): Promise<EngramAccessLcmStatusResponse>;
|
|
703
|
+
/**
|
|
704
|
+
* Record citation usage from an observed oai-mem-citation block.
|
|
705
|
+
* For each citation entry, extract the memory ID from the path and
|
|
706
|
+
* increment its access tracking via the orchestrator. Returns the
|
|
707
|
+
* count of submitted IDs and the count of IDs that matched real memories.
|
|
708
|
+
*/
|
|
709
|
+
recordCitationUsage(request: {
|
|
710
|
+
sessionId?: string;
|
|
711
|
+
namespace?: string;
|
|
712
|
+
authenticatedPrincipal?: string;
|
|
713
|
+
entries: Array<{
|
|
714
|
+
path: string;
|
|
715
|
+
lineStart: number;
|
|
716
|
+
lineEnd: number;
|
|
717
|
+
note: string;
|
|
718
|
+
}>;
|
|
719
|
+
rolloutIds: string[];
|
|
720
|
+
}): Promise<{
|
|
721
|
+
submitted: number;
|
|
722
|
+
matched: number;
|
|
723
|
+
}>;
|
|
724
|
+
get memoryDir(): string;
|
|
725
|
+
get storageRef(): StorageManager;
|
|
726
|
+
get configRef(): PluginConfig;
|
|
727
|
+
get localLlmRef(): LocalLlmClient | null;
|
|
728
|
+
get fallbackLlmRef(): FallbackLlmClient | null;
|
|
729
|
+
get embeddingLookupRef(): SemanticDedupLookup | undefined;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export { type EngramAccessRecallExplainRequest as A, type EngramAccessRecallExplainResponse as B, type EngramAccessRecallRequest as C, type EngramAccessRecallResponse as D, EngramAccessService as E, type EngramAccessReviewDispositionRequest as F, type EngramAccessReviewDispositionResponse as G, type EngramAccessReviewQueueResponse as H, type EngramAccessSuggestionSubmitRequest as I, type EngramAccessTimelineResponse as J, type EngramAccessTrustZoneBrowseRequest as K, type EngramAccessTrustZoneBrowseResponse as L, type EngramAccessTrustZoneDemoSeedRequest as M, type EngramAccessTrustZoneDemoSeedResponse as N, type EngramAccessTrustZonePromoteRequest as O, type EngramAccessTrustZonePromoteResponse as P, type EngramAccessTrustZoneRecordSummary as Q, type EngramAccessTrustZoneStatusResponse as R, type SemanticDedupDecision as S, type EngramAccessWriteEnvelope as T, type EngramAccessWriteResponse as U, EngramAccessInputError as a, type SemanticDedupHit as b, type SemanticDedupLookup as c, type SemanticDedupOptions as d, decideSemanticDedup as e, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as f, type EngramAccessBriefingRequest as g, type EngramAccessBriefingResponse as h, type EngramAccessDaySummaryRequest as i, type EngramAccessEntityListResponse as j, type EngramAccessEntityResponse as k, type EngramAccessEntitySummary as l, type EngramAccessHealthResponse as m, type EngramAccessLcmSearchRequest as n, type EngramAccessLcmSearchResponse as o, type EngramAccessLcmStatusResponse as p, type EngramAccessMaintenanceResponse as q, type EngramAccessMemoryBrowseRequest as r, type EngramAccessMemoryBrowseResponse as s, type EngramAccessMemoryRecord as t, type EngramAccessMemoryResponse as u, type EngramAccessMemoryStoreRequest as v, type EngramAccessMemorySummary as w, type EngramAccessObserveRequest as x, type EngramAccessObserveResponse as y, type EngramAccessQualityResponse as z };
|