@fgv/ts-agent-memory 5.1.0-36 → 5.1.0-39
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/.rush/temp/{f6a88bfdd66517ccb98c2c7ae1be6e6fe9e15d38.tar.log → b82cf6bdece20481260e6bab946179eeec9d7b46.tar.log} +116 -2
- package/.rush/temp/chunked-rush-logs/ts-agent-memory.build.chunks.jsonl +4 -4
- package/.rush/temp/operation/build/all.log +4 -4
- package/.rush/temp/operation/build/log-chunks.jsonl +4 -4
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +222 -221
- package/config/jest.config.json +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/packlets/ingest/cycleGuard.js +111 -0
- package/dist/packlets/ingest/cycleGuard.js.map +1 -0
- package/dist/packlets/ingest/hostStages.js +6 -0
- package/dist/packlets/ingest/hostStages.js.map +1 -0
- package/dist/packlets/ingest/index.js +9 -0
- package/dist/packlets/ingest/index.js.map +1 -0
- package/dist/packlets/ingest/model.js +6 -0
- package/dist/packlets/ingest/model.js.map +1 -0
- package/dist/packlets/ingest/orchestrator.js +438 -0
- package/dist/packlets/ingest/orchestrator.js.map +1 -0
- package/dist/packlets/retrieve/index.js +1 -0
- package/dist/packlets/retrieve/index.js.map +1 -1
- package/dist/packlets/retrieve/temporalRetrievers.js +172 -0
- package/dist/packlets/retrieve/temporalRetrievers.js.map +1 -0
- package/dist/packlets/store/fileTreeMemoryStore.js +323 -41
- package/dist/packlets/store/fileTreeMemoryStore.js.map +1 -1
- package/dist/packlets/tools/index.js +6 -0
- package/dist/packlets/tools/index.js.map +1 -0
- package/dist/packlets/tools/memoryTools.js +337 -0
- package/dist/packlets/tools/memoryTools.js.map +1 -0
- package/dist/packlets/types/identityCodec.js +115 -0
- package/dist/packlets/types/identityCodec.js.map +1 -1
- package/dist/packlets/types/index.js +1 -0
- package/dist/packlets/types/index.js.map +1 -1
- package/dist/packlets/types/temporal.js +85 -0
- package/dist/packlets/types/temporal.js.map +1 -0
- package/dist/packlets/types/writePolicy.js +96 -0
- package/dist/packlets/types/writePolicy.js.map +1 -1
- package/dist/test/unit/converters/antagonistRoundTrip.test.js +95 -0
- package/dist/test/unit/converters/antagonistRoundTrip.test.js.map +1 -0
- package/dist/test/unit/ingest/antagonistCycleAndParity.test.js +273 -0
- package/dist/test/unit/ingest/antagonistCycleAndParity.test.js.map +1 -0
- package/dist/test/unit/ingest/cycleGuard.test.js +54 -0
- package/dist/test/unit/ingest/cycleGuard.test.js.map +1 -0
- package/dist/test/unit/ingest/orchestrator.test.js +913 -0
- package/dist/test/unit/ingest/orchestrator.test.js.map +1 -0
- package/dist/test/unit/retrieve/temporalRetrievers.test.js +182 -0
- package/dist/test/unit/retrieve/temporalRetrievers.test.js.map +1 -0
- package/dist/test/unit/store/antagonistTemporalBoundary.test.js +120 -0
- package/dist/test/unit/store/antagonistTemporalBoundary.test.js.map +1 -0
- package/dist/test/unit/store/fileTreeMemoryStore.test.js +74 -7
- package/dist/test/unit/store/fileTreeMemoryStore.test.js.map +1 -1
- package/dist/test/unit/store/temporalStore.test.js +398 -0
- package/dist/test/unit/store/temporalStore.test.js.map +1 -0
- package/dist/test/unit/tools/memoryTools.test.js +572 -0
- package/dist/test/unit/tools/memoryTools.test.js.map +1 -0
- package/dist/test/unit/types/temporalCodec.test.js +203 -0
- package/dist/test/unit/types/temporalCodec.test.js.map +1 -0
- package/dist/test/unit/types/temporalPolicy.test.js +62 -0
- package/dist/test/unit/types/temporalPolicy.test.js.map +1 -0
- package/dist/ts-agent-memory.d.ts +1042 -10
- package/dist/tsdoc-metadata.json +1 -1
- package/etc/ts-agent-memory.api.md +284 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/packlets/ingest/cycleGuard.d.ts +41 -0
- package/lib/packlets/ingest/cycleGuard.d.ts.map +1 -0
- package/lib/packlets/ingest/cycleGuard.js +115 -0
- package/lib/packlets/ingest/cycleGuard.js.map +1 -0
- package/lib/packlets/ingest/hostStages.d.ts +88 -0
- package/lib/packlets/ingest/hostStages.d.ts.map +1 -0
- package/lib/packlets/ingest/hostStages.js +7 -0
- package/lib/packlets/ingest/hostStages.js.map +1 -0
- package/lib/packlets/ingest/index.d.ts +5 -0
- package/lib/packlets/ingest/index.d.ts.map +1 -0
- package/lib/packlets/ingest/index.js +25 -0
- package/lib/packlets/ingest/index.js.map +1 -0
- package/lib/packlets/ingest/model.d.ts +177 -0
- package/lib/packlets/ingest/model.d.ts.map +1 -0
- package/lib/packlets/ingest/model.js +7 -0
- package/lib/packlets/ingest/model.js.map +1 -0
- package/lib/packlets/ingest/orchestrator.d.ts +206 -0
- package/lib/packlets/ingest/orchestrator.d.ts.map +1 -0
- package/lib/packlets/ingest/orchestrator.js +442 -0
- package/lib/packlets/ingest/orchestrator.js.map +1 -0
- package/lib/packlets/retrieve/index.d.ts +1 -0
- package/lib/packlets/retrieve/index.d.ts.map +1 -1
- package/lib/packlets/retrieve/index.js +1 -0
- package/lib/packlets/retrieve/index.js.map +1 -1
- package/lib/packlets/retrieve/temporalRetrievers.d.ts +78 -0
- package/lib/packlets/retrieve/temporalRetrievers.d.ts.map +1 -0
- package/lib/packlets/retrieve/temporalRetrievers.js +178 -0
- package/lib/packlets/retrieve/temporalRetrievers.js.map +1 -0
- package/lib/packlets/store/fileTreeMemoryStore.d.ts +118 -9
- package/lib/packlets/store/fileTreeMemoryStore.d.ts.map +1 -1
- package/lib/packlets/store/fileTreeMemoryStore.js +322 -40
- package/lib/packlets/store/fileTreeMemoryStore.js.map +1 -1
- package/lib/packlets/tools/index.d.ts +2 -0
- package/lib/packlets/tools/index.d.ts.map +1 -0
- package/lib/packlets/tools/index.js +22 -0
- package/lib/packlets/tools/index.js.map +1 -0
- package/lib/packlets/tools/memoryTools.d.ts +139 -0
- package/lib/packlets/tools/memoryTools.d.ts.map +1 -0
- package/lib/packlets/tools/memoryTools.js +341 -0
- package/lib/packlets/tools/memoryTools.js.map +1 -0
- package/lib/packlets/types/identityCodec.d.ts +86 -0
- package/lib/packlets/types/identityCodec.d.ts.map +1 -1
- package/lib/packlets/types/identityCodec.js +118 -1
- package/lib/packlets/types/identityCodec.js.map +1 -1
- package/lib/packlets/types/index.d.ts +1 -0
- package/lib/packlets/types/index.d.ts.map +1 -1
- package/lib/packlets/types/index.js +1 -0
- package/lib/packlets/types/index.js.map +1 -1
- package/lib/packlets/types/temporal.d.ts +40 -0
- package/lib/packlets/types/temporal.d.ts.map +1 -0
- package/lib/packlets/types/temporal.js +92 -0
- package/lib/packlets/types/temporal.js.map +1 -0
- package/lib/packlets/types/writePolicy.d.ts +49 -0
- package/lib/packlets/types/writePolicy.d.ts.map +1 -1
- package/lib/packlets/types/writePolicy.js +98 -1
- package/lib/packlets/types/writePolicy.js.map +1 -1
- package/lib/test/unit/converters/antagonistRoundTrip.test.d.ts +10 -0
- package/lib/test/unit/converters/antagonistRoundTrip.test.d.ts.map +1 -0
- package/lib/test/unit/converters/antagonistRoundTrip.test.js +97 -0
- package/lib/test/unit/converters/antagonistRoundTrip.test.js.map +1 -0
- package/lib/test/unit/ingest/antagonistCycleAndParity.test.d.ts +9 -0
- package/lib/test/unit/ingest/antagonistCycleAndParity.test.d.ts.map +1 -0
- package/lib/test/unit/ingest/antagonistCycleAndParity.test.js +275 -0
- package/lib/test/unit/ingest/antagonistCycleAndParity.test.js.map +1 -0
- package/lib/test/unit/ingest/cycleGuard.test.d.ts +2 -0
- package/lib/test/unit/ingest/cycleGuard.test.d.ts.map +1 -0
- package/lib/test/unit/ingest/cycleGuard.test.js +56 -0
- package/lib/test/unit/ingest/cycleGuard.test.js.map +1 -0
- package/lib/test/unit/ingest/orchestrator.test.d.ts +2 -0
- package/lib/test/unit/ingest/orchestrator.test.d.ts.map +1 -0
- package/lib/test/unit/ingest/orchestrator.test.js +915 -0
- package/lib/test/unit/ingest/orchestrator.test.js.map +1 -0
- package/lib/test/unit/retrieve/temporalRetrievers.test.d.ts +2 -0
- package/lib/test/unit/retrieve/temporalRetrievers.test.d.ts.map +1 -0
- package/lib/test/unit/retrieve/temporalRetrievers.test.js +184 -0
- package/lib/test/unit/retrieve/temporalRetrievers.test.js.map +1 -0
- package/lib/test/unit/store/antagonistTemporalBoundary.test.d.ts +9 -0
- package/lib/test/unit/store/antagonistTemporalBoundary.test.d.ts.map +1 -0
- package/lib/test/unit/store/antagonistTemporalBoundary.test.js +122 -0
- package/lib/test/unit/store/antagonistTemporalBoundary.test.js.map +1 -0
- package/lib/test/unit/store/fileTreeMemoryStore.test.js +74 -7
- package/lib/test/unit/store/fileTreeMemoryStore.test.js.map +1 -1
- package/lib/test/unit/store/temporalStore.test.d.ts +2 -0
- package/lib/test/unit/store/temporalStore.test.d.ts.map +1 -0
- package/lib/test/unit/store/temporalStore.test.js +400 -0
- package/lib/test/unit/store/temporalStore.test.js.map +1 -0
- package/lib/test/unit/tools/memoryTools.test.d.ts +2 -0
- package/lib/test/unit/tools/memoryTools.test.d.ts.map +1 -0
- package/lib/test/unit/tools/memoryTools.test.js +574 -0
- package/lib/test/unit/tools/memoryTools.test.js.map +1 -0
- package/lib/test/unit/types/temporalCodec.test.d.ts +2 -0
- package/lib/test/unit/types/temporalCodec.test.d.ts.map +1 -0
- package/lib/test/unit/types/temporalCodec.test.js +205 -0
- package/lib/test/unit/types/temporalCodec.test.js.map +1 -0
- package/lib/test/unit/types/temporalPolicy.test.d.ts +2 -0
- package/lib/test/unit/types/temporalPolicy.test.d.ts.map +1 -0
- package/lib/test/unit/types/temporalPolicy.test.js +64 -0
- package/lib/test/unit/types/temporalPolicy.test.js.map +1 -0
- package/package.json +19 -19
- package/rush-logs/ts-agent-memory.build.cache.log +1 -1
- package/rush-logs/ts-agent-memory.build.log +4 -4
- package/src/index.ts +2 -0
- package/src/packlets/ingest/cycleGuard.ts +142 -0
- package/src/packlets/ingest/hostStages.ts +111 -0
- package/src/packlets/ingest/index.ts +9 -0
- package/src/packlets/ingest/model.ts +184 -0
- package/src/packlets/ingest/orchestrator.ts +797 -0
- package/src/packlets/retrieve/index.ts +1 -0
- package/src/packlets/retrieve/temporalRetrievers.ts +210 -0
- package/src/packlets/store/fileTreeMemoryStore.ts +460 -66
- package/src/packlets/tools/index.ts +6 -0
- package/src/packlets/tools/memoryTools.ts +579 -0
- package/src/packlets/types/identityCodec.ts +184 -0
- package/src/packlets/types/index.ts +1 -0
- package/src/packlets/types/temporal.ts +96 -0
- package/src/packlets/types/writePolicy.ts +127 -0
- package/src/test/unit/converters/antagonistRoundTrip.test.ts +110 -0
- package/src/test/unit/ingest/antagonistCycleAndParity.test.ts +362 -0
- package/src/test/unit/ingest/cycleGuard.test.ts +68 -0
- package/src/test/unit/ingest/orchestrator.test.ts +1158 -0
- package/src/test/unit/retrieve/temporalRetrievers.test.ts +226 -0
- package/src/test/unit/store/antagonistTemporalBoundary.test.ts +158 -0
- package/src/test/unit/store/fileTreeMemoryStore.test.ts +98 -7
- package/src/test/unit/store/temporalStore.test.ts +469 -0
- package/src/test/unit/tools/memoryTools.test.ts +771 -0
- package/src/test/unit/types/temporalCodec.test.ts +259 -0
- package/src/test/unit/types/temporalPolicy.test.ts +96 -0
- package/temp/build/lint/_eslint-5eVG3S6w.json +122 -46
- package/temp/build/typescript/ts_8nwakTlr.json +1 -1
- package/temp/ts-agent-memory.api.json +11984 -6314
- package/temp/ts-agent-memory.api.md +284 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
import { AiAssist } from '@fgv/ts-extras';
|
|
7
8
|
import { Brand } from '@fgv/ts-utils';
|
|
8
9
|
import { Converter } from '@fgv/ts-utils';
|
|
9
10
|
import { FileTree } from '@fgv/ts-json-base';
|
|
@@ -22,6 +23,16 @@ export type AdmissionDecision = {
|
|
|
22
23
|
readonly evict: ReadonlyArray<MemoryId>;
|
|
23
24
|
};
|
|
24
25
|
|
|
26
|
+
// @public
|
|
27
|
+
export class AsOfRetriever implements IMemoryRetriever {
|
|
28
|
+
get capabilities(): IMemoryRetrieverCapabilities;
|
|
29
|
+
static create(index: IMemoryIndex): Result<AsOfRetriever>;
|
|
30
|
+
retrieve(query: IMemoryQuery): Promise<Result<ReadonlyArray<IMemoryRecord<unknown>>>>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// @public
|
|
34
|
+
export function assertNoCycles(existing: ReadonlyArray<ICycleGuardEdge>, proposed: ReadonlyArray<ICycleGuardEdge>): Result<true>;
|
|
35
|
+
|
|
25
36
|
// @public
|
|
26
37
|
export function assertPortableFilenameStem(stem: string): Result<string>;
|
|
27
38
|
|
|
@@ -35,6 +46,12 @@ export class BodyConverterRegistry implements IBodyConverterRegistry {
|
|
|
35
46
|
registerSchema<T>(kind: Kind, schema: JsonSchema.ISchemaValidator<T>): void;
|
|
36
47
|
}
|
|
37
48
|
|
|
49
|
+
// @public
|
|
50
|
+
export function buildCycleKey(edge: ICycleGuardEdge): Result<string>;
|
|
51
|
+
|
|
52
|
+
// @public
|
|
53
|
+
export const CONTRADICTS_LINK_TYPE: LinkType;
|
|
54
|
+
|
|
38
55
|
// @public
|
|
39
56
|
export const Convert: {
|
|
40
57
|
readonly memoryId: Converter<MemoryId>;
|
|
@@ -45,12 +62,34 @@ export const Convert: {
|
|
|
45
62
|
readonly linkType: Converter<LinkType>;
|
|
46
63
|
};
|
|
47
64
|
|
|
65
|
+
// @public
|
|
66
|
+
export function createMemoryTools(params: ICreateMemoryToolsParams): ReadonlyArray<AiAssist.IAiClientTool>;
|
|
67
|
+
|
|
68
|
+
// @public
|
|
69
|
+
export class CurrentValidRetriever implements IMemoryRetriever {
|
|
70
|
+
get capabilities(): IMemoryRetrieverCapabilities;
|
|
71
|
+
static create(index: IMemoryIndex): Result<CurrentValidRetriever>;
|
|
72
|
+
retrieve(query: IMemoryQuery): Promise<Result<ReadonlyArray<IMemoryRecord<unknown>>>>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// @public
|
|
76
|
+
export type CycleGuardMode = 'reject' | 'off';
|
|
77
|
+
|
|
48
78
|
// @public
|
|
49
79
|
export type DedupScope = 'content' | 'entity';
|
|
50
80
|
|
|
51
81
|
// @public
|
|
52
82
|
export const DEFAULT_DEDUP_SCOPE: DedupScope;
|
|
53
83
|
|
|
84
|
+
// @public
|
|
85
|
+
export const DEFAULT_MEMORY_TOOLS: ReadonlyArray<MemoryToolName>;
|
|
86
|
+
|
|
87
|
+
// @public
|
|
88
|
+
export const DEFAULT_SIMILARITY_THRESHOLD: number;
|
|
89
|
+
|
|
90
|
+
// @public
|
|
91
|
+
export const DEFAULT_SIMILARITY_TOP_K: number;
|
|
92
|
+
|
|
54
93
|
// @public
|
|
55
94
|
export function defaultMemoryScopeEncoding(scope: MemoryScopeKey): Result<string>;
|
|
56
95
|
|
|
@@ -79,6 +118,16 @@ export class FileTreeMemoryStore implements IMemoryStore {
|
|
|
79
118
|
// @public
|
|
80
119
|
export function guardRetrieverCapabilities(query: IMemoryQuery, capabilities: IMemoryRetrieverCapabilities): Result<true>;
|
|
81
120
|
|
|
121
|
+
// @public
|
|
122
|
+
export class HistoryRetriever implements IMemoryRetriever {
|
|
123
|
+
get capabilities(): IMemoryRetrieverCapabilities;
|
|
124
|
+
static create(index: IMemoryIndex): Result<HistoryRetriever>;
|
|
125
|
+
retrieve(query: IMemoryQuery): Promise<Result<ReadonlyArray<IMemoryRecord<unknown>>>>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// @public
|
|
129
|
+
export const HOST_INGEST_PROVENANCE_SOURCE: string;
|
|
130
|
+
|
|
82
131
|
// @public
|
|
83
132
|
export class HybridRetriever implements IMemoryRetriever {
|
|
84
133
|
get capabilities(): IMemoryRetrieverCapabilities;
|
|
@@ -95,6 +144,40 @@ export interface IBodyConverterRegistry {
|
|
|
95
144
|
registerSchema<T>(kind: Kind, schema: JsonSchema.ISchemaValidator<T>): void;
|
|
96
145
|
}
|
|
97
146
|
|
|
147
|
+
// @public
|
|
148
|
+
export interface ICandidateEdge {
|
|
149
|
+
readonly edge: IEdge;
|
|
150
|
+
readonly source: MemoryId;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// @public
|
|
154
|
+
export interface ICandidateRecord {
|
|
155
|
+
readonly body: unknown;
|
|
156
|
+
readonly envelope: Omit<IMemoryEnvelope, StoreStampedEnvelopeField>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// @public
|
|
160
|
+
export interface ICreateMemoryToolsParams {
|
|
161
|
+
readonly codecs?: ReadonlyMap<Kind, IIdentityCodec>;
|
|
162
|
+
readonly defaultCodec?: IIdentityCodec;
|
|
163
|
+
readonly handleFor?: (record: IMemoryRecord<unknown>) => string;
|
|
164
|
+
readonly kinds?: ReadonlyArray<Kind>;
|
|
165
|
+
readonly registry: IBodyConverterRegistry;
|
|
166
|
+
readonly retriever: IMemoryRetriever;
|
|
167
|
+
readonly store: IMemoryStore;
|
|
168
|
+
readonly tools?: ReadonlyArray<MemoryToolName>;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// @public
|
|
172
|
+
export interface ICycleGuardEdge {
|
|
173
|
+
// (undocumented)
|
|
174
|
+
readonly source: MemoryId;
|
|
175
|
+
// (undocumented)
|
|
176
|
+
readonly target: MemoryId;
|
|
177
|
+
// (undocumented)
|
|
178
|
+
readonly type: LinkType;
|
|
179
|
+
}
|
|
180
|
+
|
|
98
181
|
// @public
|
|
99
182
|
export interface IEdge {
|
|
100
183
|
readonly confidence?: number;
|
|
@@ -105,6 +188,23 @@ export interface IEdge {
|
|
|
105
188
|
readonly valid_at?: number;
|
|
106
189
|
}
|
|
107
190
|
|
|
191
|
+
// @public
|
|
192
|
+
export interface IEntityResolutionCandidate {
|
|
193
|
+
readonly id: MemoryId;
|
|
194
|
+
readonly record: IMemoryRecord<unknown>;
|
|
195
|
+
readonly score: number;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// @public
|
|
199
|
+
export interface IEntityResolver {
|
|
200
|
+
resolve(candidate: ICandidateRecord, similar: ReadonlyArray<IEntityResolutionCandidate>): Promise<Result<ResolutionVerdict>>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// @public
|
|
204
|
+
export interface IFactExtractor {
|
|
205
|
+
extract(item: IIngestItem, classification: IMemoryClassification): Promise<Result<ReadonlyArray<ICandidateRecord>>>;
|
|
206
|
+
}
|
|
207
|
+
|
|
108
208
|
// @public
|
|
109
209
|
export interface IFileTreeMemoryStoreCreateParams {
|
|
110
210
|
readonly clock?: () => number;
|
|
@@ -140,12 +240,50 @@ export interface IIndexedMemoryRecord {
|
|
|
140
240
|
readonly scope: MemoryScopeKey;
|
|
141
241
|
}
|
|
142
242
|
|
|
243
|
+
// @public
|
|
244
|
+
export interface IIngestedRecordResult {
|
|
245
|
+
readonly candidate: ICandidateRecord;
|
|
246
|
+
readonly disposition: IngestDisposition;
|
|
247
|
+
readonly edges: ReadonlyArray<ICandidateEdge>;
|
|
248
|
+
readonly id: MemoryId;
|
|
249
|
+
readonly interlock?: 'temporal-versioned';
|
|
250
|
+
readonly record?: IMemoryRecord<unknown>;
|
|
251
|
+
readonly resolution: ResolutionVerdict;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// @public
|
|
255
|
+
export interface IIngestItem {
|
|
256
|
+
readonly content: unknown;
|
|
257
|
+
readonly id: string;
|
|
258
|
+
readonly metadata?: Record<string, unknown>;
|
|
259
|
+
readonly sourceId?: MemoryId;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// @public
|
|
263
|
+
export interface IIngestItemResult {
|
|
264
|
+
readonly item: IIngestItem;
|
|
265
|
+
readonly records: ReadonlyArray<IIngestedRecordResult>;
|
|
266
|
+
}
|
|
267
|
+
|
|
143
268
|
// @public
|
|
144
269
|
export interface IMemoryCapCullPolicyParams {
|
|
145
270
|
readonly maxRecords?: number;
|
|
146
271
|
readonly mutableFields: ReadonlyArray<string>;
|
|
147
272
|
}
|
|
148
273
|
|
|
274
|
+
// @public
|
|
275
|
+
export interface IMemoryClassification {
|
|
276
|
+
readonly [key: string]: unknown;
|
|
277
|
+
readonly confidence?: number;
|
|
278
|
+
readonly kind: Kind;
|
|
279
|
+
readonly tags?: ReadonlyArray<Tag>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// @public
|
|
283
|
+
export interface IMemoryClassifier {
|
|
284
|
+
classify(item: IIngestItem): Promise<Result<IMemoryClassification>>;
|
|
285
|
+
}
|
|
286
|
+
|
|
149
287
|
// @public
|
|
150
288
|
export interface IMemoryEnvelope {
|
|
151
289
|
readonly contentHash: string;
|
|
@@ -179,6 +317,30 @@ export interface IMemoryIndex {
|
|
|
179
317
|
rebuild(entries: ReadonlyArray<IIndexedMemoryRecord>): Result<number>;
|
|
180
318
|
}
|
|
181
319
|
|
|
320
|
+
// @public
|
|
321
|
+
export interface IMemoryIngestOrchestrator {
|
|
322
|
+
ingestBatch(items: ReadonlyArray<IIngestItem>): Promise<Result<ReadonlyArray<IIngestItemResult>>>;
|
|
323
|
+
ingestItem(item: IIngestItem): Promise<Result<IIngestItemResult>>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// @public
|
|
327
|
+
export interface IMemoryIngestOrchestratorCreateParams {
|
|
328
|
+
readonly classifier: IMemoryClassifier;
|
|
329
|
+
readonly codecs?: ReadonlyMap<Kind, IIdentityCodec>;
|
|
330
|
+
readonly cycleGuard?: CycleGuardMode;
|
|
331
|
+
readonly defaultCodec?: IIdentityCodec;
|
|
332
|
+
readonly embed?: MemoryEmbedder;
|
|
333
|
+
readonly entityResolver?: IEntityResolver;
|
|
334
|
+
readonly extractor: IFactExtractor;
|
|
335
|
+
readonly logger?: Logging.ILogger;
|
|
336
|
+
readonly registry: IBodyConverterRegistry;
|
|
337
|
+
readonly relationExtractor: IRelationExtractor;
|
|
338
|
+
readonly similarityThreshold?: number;
|
|
339
|
+
readonly similarityTopK?: number;
|
|
340
|
+
readonly store: IMemoryStore;
|
|
341
|
+
readonly vectorIndex?: IVectorIndex;
|
|
342
|
+
}
|
|
343
|
+
|
|
182
344
|
// @public
|
|
183
345
|
export interface IMemoryObservationQuery {
|
|
184
346
|
readonly kind?: Kind;
|
|
@@ -272,6 +434,23 @@ export interface IMemoryStoreListFilter {
|
|
|
272
434
|
readonly tag?: Tag;
|
|
273
435
|
}
|
|
274
436
|
|
|
437
|
+
// @public
|
|
438
|
+
export interface IMemoryToolResultItem {
|
|
439
|
+
readonly body: unknown;
|
|
440
|
+
readonly entityId: EntityId;
|
|
441
|
+
readonly handle: string;
|
|
442
|
+
readonly kind: Kind;
|
|
443
|
+
readonly tags: ReadonlyArray<string>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// @public
|
|
447
|
+
export interface IMemoryWriteResult {
|
|
448
|
+
readonly entityId: EntityId;
|
|
449
|
+
readonly id: MemoryId;
|
|
450
|
+
readonly kind: Kind;
|
|
451
|
+
readonly outcome: MemoryWriteOutcome;
|
|
452
|
+
}
|
|
453
|
+
|
|
275
454
|
// @public
|
|
276
455
|
export interface IMergeStrategy {
|
|
277
456
|
merge(resultSets: ReadonlyArray<ReadonlyArray<IMemoryRecord<unknown>>>): Result<ReadonlyArray<IMemoryRecord<unknown>>>;
|
|
@@ -280,6 +459,9 @@ export interface IMergeStrategy {
|
|
|
280
459
|
// @public
|
|
281
460
|
export function indexedRecordMatchesQuery(entry: IIndexedMemoryRecord, query: IMemoryQuery): boolean;
|
|
282
461
|
|
|
462
|
+
// @public
|
|
463
|
+
export type IngestDisposition = 'written' | 'deduped' | 'merged';
|
|
464
|
+
|
|
283
465
|
// @public
|
|
284
466
|
export class InMemoryCosineIndex implements IVectorIndex {
|
|
285
467
|
add(id: MemoryId, vector: Float32Array): Promise<Result<string>>;
|
|
@@ -300,6 +482,23 @@ export interface IProvenance {
|
|
|
300
482
|
readonly source: ProvenanceSource;
|
|
301
483
|
}
|
|
302
484
|
|
|
485
|
+
// @public
|
|
486
|
+
export interface IRelationCandidate {
|
|
487
|
+
readonly candidate: ICandidateRecord;
|
|
488
|
+
readonly id: MemoryId;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// @public
|
|
492
|
+
export interface IRelationContext {
|
|
493
|
+
readonly candidates: ReadonlyArray<IRelationCandidate>;
|
|
494
|
+
readonly item: IIngestItem;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// @public
|
|
498
|
+
export interface IRelationExtractor {
|
|
499
|
+
relate(context: IRelationContext): Promise<Result<ReadonlyArray<ICandidateEdge>>>;
|
|
500
|
+
}
|
|
501
|
+
|
|
303
502
|
// @public
|
|
304
503
|
export interface ISemanticBackend {
|
|
305
504
|
readonly embedQuery: QueryEmbedder;
|
|
@@ -312,12 +511,36 @@ export interface ISemanticRetrieverCreateParams {
|
|
|
312
511
|
readonly index: IMemoryIndex;
|
|
313
512
|
}
|
|
314
513
|
|
|
514
|
+
// @public
|
|
515
|
+
export function isTemporalIdentityCodec(codec: IIdentityCodec): codec is ITemporalIdentityCodec;
|
|
516
|
+
|
|
517
|
+
// @public
|
|
518
|
+
export function isTemporalRecord(record: IMemoryRecord<unknown>): boolean;
|
|
519
|
+
|
|
520
|
+
// @public
|
|
521
|
+
export function isVersionCurrent(record: IMemoryRecord<unknown>): boolean;
|
|
522
|
+
|
|
523
|
+
// @public
|
|
524
|
+
export function isVersionValidAt(record: IMemoryRecord<unknown>, asOf: number): boolean;
|
|
525
|
+
|
|
315
526
|
// @public
|
|
316
527
|
export interface ITemporalBlock {
|
|
317
528
|
readonly invalid_at?: number | null;
|
|
318
529
|
readonly valid_at?: number;
|
|
319
530
|
}
|
|
320
531
|
|
|
532
|
+
// @public
|
|
533
|
+
export interface ITemporalIdentityCodec extends IIdentityCodec {
|
|
534
|
+
decodeVersion(scope: MemoryScopeKey, stem: string): Result<ITemporalVersionAddress>;
|
|
535
|
+
encodeVersion(entityId: EntityId, seq: number): Result<string>;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// @public
|
|
539
|
+
export interface ITemporalVersionAddress {
|
|
540
|
+
readonly entityId: EntityId;
|
|
541
|
+
readonly seq: number;
|
|
542
|
+
}
|
|
543
|
+
|
|
321
544
|
// @public
|
|
322
545
|
export interface IVectorIndex {
|
|
323
546
|
add(id: MemoryId, vector: Float32Array): Promise<Result<string>>;
|
|
@@ -419,6 +642,13 @@ export class MemoryIndex implements IMemoryIndex {
|
|
|
419
642
|
// @public
|
|
420
643
|
export type MemoryIndexPatchOp = 'put' | 'delete';
|
|
421
644
|
|
|
645
|
+
// @public
|
|
646
|
+
export class MemoryIngestOrchestrator implements IMemoryIngestOrchestrator {
|
|
647
|
+
static create(params: IMemoryIngestOrchestratorCreateParams): Result<MemoryIngestOrchestrator>;
|
|
648
|
+
ingestBatch(items: ReadonlyArray<IIngestItem>): Promise<Result<ReadonlyArray<IIngestItemResult>>>;
|
|
649
|
+
ingestItem(item: IIngestItem): Promise<Result<IIngestItemResult>>;
|
|
650
|
+
}
|
|
651
|
+
|
|
422
652
|
// @public
|
|
423
653
|
export type MemoryObservationOutcome = 'success' | 'failure';
|
|
424
654
|
|
|
@@ -438,6 +668,12 @@ export class MemoryObservationStore implements IMemoryObserver {
|
|
|
438
668
|
// @public
|
|
439
669
|
export type MemoryScopeKey = Brand<string, 'MemoryScopeKey'>;
|
|
440
670
|
|
|
671
|
+
// @public
|
|
672
|
+
export type MemoryToolName = 'memory_write' | 'memory_read' | 'memory_search' | 'memory_context' | 'memory_delete';
|
|
673
|
+
|
|
674
|
+
// @public
|
|
675
|
+
export type MemoryWriteOutcome = 'written' | 'deduped';
|
|
676
|
+
|
|
441
677
|
// @public
|
|
442
678
|
export class MtmIdentityCodec implements IIdentityCodec {
|
|
443
679
|
decode(scope: MemoryScopeKey, encodedStem: string): Result<EntityId>;
|
|
@@ -472,6 +708,20 @@ export class RecencyRetriever implements IMemoryRetriever {
|
|
|
472
708
|
retrieve(query: IMemoryQuery): Promise<Result<ReadonlyArray<IMemoryRecord<unknown>>>>;
|
|
473
709
|
}
|
|
474
710
|
|
|
711
|
+
// @public
|
|
712
|
+
export type ResolutionVerdict = {
|
|
713
|
+
readonly verdict: 'new';
|
|
714
|
+
} | {
|
|
715
|
+
readonly verdict: 'duplicate-of';
|
|
716
|
+
readonly target: MemoryId;
|
|
717
|
+
} | {
|
|
718
|
+
readonly verdict: 'supersede';
|
|
719
|
+
readonly target: MemoryId;
|
|
720
|
+
} | {
|
|
721
|
+
readonly verdict: 'merge-into';
|
|
722
|
+
readonly target: MemoryId;
|
|
723
|
+
};
|
|
724
|
+
|
|
475
725
|
// @public
|
|
476
726
|
export class ScoreUnionMergeStrategy implements IMergeStrategy {
|
|
477
727
|
static create(): Result<ScoreUnionMergeStrategy>;
|
|
@@ -481,6 +731,12 @@ export class ScoreUnionMergeStrategy implements IMergeStrategy {
|
|
|
481
731
|
// @public
|
|
482
732
|
export function selectByQuery(entries: ReadonlyArray<IIndexedMemoryRecord>, query: IMemoryQuery): IMemoryRecord<unknown>[];
|
|
483
733
|
|
|
734
|
+
// @public
|
|
735
|
+
export function selectCurrentVersion(versions: ReadonlyArray<IMemoryRecord<unknown>>): IMemoryRecord<unknown> | undefined;
|
|
736
|
+
|
|
737
|
+
// @public
|
|
738
|
+
export function selectVersionAsOf(versions: ReadonlyArray<IMemoryRecord<unknown>>, asOf: number): IMemoryRecord<unknown> | undefined;
|
|
739
|
+
|
|
484
740
|
// @public
|
|
485
741
|
export const SEMANTIC_UNWIRED_MESSAGE: string;
|
|
486
742
|
|
|
@@ -497,6 +753,9 @@ export function serializeMemoryFile(envelope: IMemoryEnvelope, body: string): Re
|
|
|
497
753
|
// @public
|
|
498
754
|
export function splitFrontmatter(raw: string): Result<IMemoryFileParts>;
|
|
499
755
|
|
|
756
|
+
// @public
|
|
757
|
+
export type StoreStampedEnvelopeField = 'id' | 'seq' | 'contentHash' | 'created' | 'updated';
|
|
758
|
+
|
|
500
759
|
// @public
|
|
501
760
|
export class StructuredFilterRetriever implements IMemoryRetriever {
|
|
502
761
|
get capabilities(): IMemoryRetrieverCapabilities;
|
|
@@ -514,12 +773,37 @@ export class TagRetriever implements IMemoryRetriever {
|
|
|
514
773
|
retrieve(query: IMemoryQuery): Promise<Result<ReadonlyArray<IMemoryRecord<unknown>>>>;
|
|
515
774
|
}
|
|
516
775
|
|
|
776
|
+
// @public
|
|
777
|
+
export const TEMPORAL_CAPABILITIES: IMemoryRetrieverCapabilities;
|
|
778
|
+
|
|
517
779
|
// @public
|
|
518
780
|
export const temporalConverter: Converter<ITemporalBlock>;
|
|
519
781
|
|
|
782
|
+
// @public
|
|
783
|
+
export class TemporalIdentityCodec implements ITemporalIdentityCodec {
|
|
784
|
+
readonly baseScope: string;
|
|
785
|
+
static create(baseScope: string): Result<TemporalIdentityCodec>;
|
|
786
|
+
decode(scope: MemoryScopeKey, encodedStem: string): Result<EntityId>;
|
|
787
|
+
decodeVersion(scope: MemoryScopeKey, stem: string): Result<ITemporalVersionAddress>;
|
|
788
|
+
encode(entityId: EntityId): Result<IIdentityCodecResult>;
|
|
789
|
+
encodeVersion(entityId: EntityId, seq: number): Result<string>;
|
|
790
|
+
static readonly entitiesSegment: string;
|
|
791
|
+
verifyRoundTrip(scope: MemoryScopeKey, stem: string): Result<true>;
|
|
792
|
+
static readonly versionInfix: string;
|
|
793
|
+
}
|
|
794
|
+
|
|
520
795
|
// @public
|
|
521
796
|
export function temporalUnwiredMessage(kind?: Kind): string;
|
|
522
797
|
|
|
798
|
+
// @public
|
|
799
|
+
export class TemporalVersionedPolicy implements IWritePolicy {
|
|
800
|
+
admit(__incoming: IMemoryRecord<unknown>, __existing: ReadonlyArray<IMemoryRecord<unknown>>): Result<AdmissionDecision>;
|
|
801
|
+
applyUpdate(existing: IMemoryRecord<unknown>, patch: Record<string, unknown>): Result<IMemoryRecord<unknown>>;
|
|
802
|
+
static create(): Result<TemporalVersionedPolicy>;
|
|
803
|
+
readonly dedupScope: DedupScope;
|
|
804
|
+
readonly mutableFields: ReadonlyArray<string>;
|
|
805
|
+
}
|
|
806
|
+
|
|
523
807
|
// (No @packageDocumentation comment for this package)
|
|
524
808
|
|
|
525
809
|
```
|