@mongodb-js/agent-engine-sdk-memory 0.11.3
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/LICENSE.md +201 -0
- package/README.md +115 -0
- package/dist/errors.d.ts +65 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +96 -0
- package/dist/http/client_adapter.d.ts +82 -0
- package/dist/http/client_adapter.d.ts.map +1 -0
- package/dist/http/client_adapter.js +452 -0
- package/dist/identity.d.ts +31 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +48 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/memory.d.ts +221 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +601 -0
- package/dist/models.d.ts +168 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +147 -0
- package/dist/tag_syntax.d.ts +22 -0
- package/dist/tag_syntax.d.ts.map +1 -0
- package/dist/tag_syntax.js +110 -0
- package/dist/transport.d.ts +191 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +6 -0
- package/package.json +52 -0
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical models for the Memory API (TypeScript port).
|
|
3
|
+
*
|
|
4
|
+
* These zod schemas define the response types the Memory Server returns and the
|
|
5
|
+
* facade surfaces. They are the TypeScript counterpart of the Python
|
|
6
|
+
* `agent_engine_sdk_memory.models` module — only the shapes the unified `Memory`
|
|
7
|
+
* facade actually returns are ported here.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
11
|
+
[key: string]: JsonValue;
|
|
12
|
+
};
|
|
13
|
+
export declare const WriteTurnResultSchema: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
session_id: z.ZodString;
|
|
16
|
+
turn_seq: z.ZodNumber;
|
|
17
|
+
acknowledged: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
has_embedding: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type WriteTurnResult = z.infer<typeof WriteTurnResultSchema>;
|
|
21
|
+
export declare const CreateSemanticResultSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
label: z.ZodString;
|
|
24
|
+
has_embedding: z.ZodBoolean;
|
|
25
|
+
acknowledged: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type CreateSemanticResult = z.infer<typeof CreateSemanticResultSchema>;
|
|
28
|
+
export declare const CreateEpisodicResultSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
title: z.ZodString;
|
|
31
|
+
has_embedding: z.ZodBoolean;
|
|
32
|
+
acknowledged: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type CreateEpisodicResult = z.infer<typeof CreateEpisodicResultSchema>;
|
|
35
|
+
export declare const CreateTaxonomicResultSchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
domain: z.ZodString;
|
|
38
|
+
term: z.ZodString;
|
|
39
|
+
has_embedding: z.ZodBoolean;
|
|
40
|
+
acknowledged: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type CreateTaxonomicResult = z.infer<typeof CreateTaxonomicResultSchema>;
|
|
43
|
+
export declare const CreateProceduralResultSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
procedure: z.ZodString;
|
|
46
|
+
has_embedding: z.ZodBoolean;
|
|
47
|
+
acknowledged: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type CreateProceduralResult = z.infer<typeof CreateProceduralResultSchema>;
|
|
50
|
+
export declare const TagScalarSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
51
|
+
export type TagScalar = z.infer<typeof TagScalarSchema>;
|
|
52
|
+
export declare const CustomMemorySaveResultSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
type: z.ZodString;
|
|
55
|
+
tags: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
56
|
+
has_embedding: z.ZodBoolean;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type CustomMemorySaveResult = z.infer<typeof CustomMemorySaveResultSchema>;
|
|
59
|
+
export declare const RetrievedCustomMemorySchema: z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
type: z.ZodString;
|
|
62
|
+
content: z.ZodString;
|
|
63
|
+
tags: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
64
|
+
contextual_metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
65
|
+
user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type RetrievedCustomMemory = z.infer<typeof RetrievedCustomMemorySchema>;
|
|
69
|
+
export declare const CustomMemoryRetrieveResultSchema: z.ZodObject<{
|
|
70
|
+
results: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
type: z.ZodString;
|
|
73
|
+
content: z.ZodString;
|
|
74
|
+
tags: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
75
|
+
contextual_metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
76
|
+
user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
count: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type CustomMemoryRetrieveResult = z.infer<typeof CustomMemoryRetrieveResultSchema>;
|
|
82
|
+
/** Source type for memory chunks. */
|
|
83
|
+
export declare const MemorySource: {
|
|
84
|
+
readonly STM: "stm";
|
|
85
|
+
readonly EPISODIC: "episodic";
|
|
86
|
+
readonly SEMANTIC: "semantic";
|
|
87
|
+
readonly TAXONOMIC: "taxonomic";
|
|
88
|
+
readonly PROCEDURAL: "procedural";
|
|
89
|
+
};
|
|
90
|
+
export type MemorySource = (typeof MemorySource)[keyof typeof MemorySource];
|
|
91
|
+
/**
|
|
92
|
+
* A memory source that `Memory.search` can query.
|
|
93
|
+
*
|
|
94
|
+
* Mirrors `MemorySource` minus `stm` (short-term turns are not a search target).
|
|
95
|
+
* Callers may pass either the constant or its string value.
|
|
96
|
+
*/
|
|
97
|
+
export declare const SearchSource: {
|
|
98
|
+
readonly SEMANTIC: "semantic";
|
|
99
|
+
readonly EPISODIC: "episodic";
|
|
100
|
+
readonly TAXONOMIC: "taxonomic";
|
|
101
|
+
readonly PROCEDURAL: "procedural";
|
|
102
|
+
};
|
|
103
|
+
export type SearchSource = (typeof SearchSource)[keyof typeof SearchSource];
|
|
104
|
+
/** Narrow an arbitrary string to a `SearchSource`, throwing on an unknown value. */
|
|
105
|
+
export declare function toSearchSource(value: string): SearchSource;
|
|
106
|
+
/**
|
|
107
|
+
* Unified representation of memory from any source (STM, episodic, semantic, …).
|
|
108
|
+
*
|
|
109
|
+
* `timestamp` is coerced to a `Date`; a missing value on the wire is a server
|
|
110
|
+
* contract violation and surfaces as a schema error at parse time.
|
|
111
|
+
*
|
|
112
|
+
* `similarity_score` is on the scale of the retrieval mode that produced the
|
|
113
|
+
* chunk: vector similarity for semantic mode, text relevance for text mode, and
|
|
114
|
+
* the fused rank-fusion score for hybrid mode. Comparable between chunks
|
|
115
|
+
* retrieved the same way; not comparable across modes, or across sources
|
|
116
|
+
* searched differently. Null when the chunk did not come from a search.
|
|
117
|
+
*/
|
|
118
|
+
export declare const MemoryChunkSchema: z.ZodObject<{
|
|
119
|
+
id: z.ZodString;
|
|
120
|
+
content: z.ZodString;
|
|
121
|
+
source: z.ZodEnum<{
|
|
122
|
+
stm: "stm";
|
|
123
|
+
episodic: "episodic";
|
|
124
|
+
semantic: "semantic";
|
|
125
|
+
taxonomic: "taxonomic";
|
|
126
|
+
procedural: "procedural";
|
|
127
|
+
}>;
|
|
128
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
129
|
+
embedding: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
130
|
+
similarity_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
131
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
export type MemoryChunk = z.infer<typeof MemoryChunkSchema>;
|
|
134
|
+
export declare const ContextMetadataSchema: z.ZodObject<{
|
|
135
|
+
token_count: z.ZodDefault<z.ZodNumber>;
|
|
136
|
+
memory_counts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
137
|
+
timing: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
export type ContextMetadata = z.infer<typeof ContextMetadataSchema>;
|
|
140
|
+
/**
|
|
141
|
+
* Final response model for context building. `formatted_context` is a string or
|
|
142
|
+
* a list of message dicts depending on the server's format style.
|
|
143
|
+
*/
|
|
144
|
+
export declare const ContextResponseSchema: z.ZodObject<{
|
|
145
|
+
formatted_context: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
|
|
146
|
+
metadata: z.ZodDefault<z.ZodObject<{
|
|
147
|
+
token_count: z.ZodDefault<z.ZodNumber>;
|
|
148
|
+
memory_counts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
149
|
+
timing: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
selected_memories: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
content: z.ZodString;
|
|
154
|
+
source: z.ZodEnum<{
|
|
155
|
+
stm: "stm";
|
|
156
|
+
episodic: "episodic";
|
|
157
|
+
semantic: "semantic";
|
|
158
|
+
taxonomic: "taxonomic";
|
|
159
|
+
procedural: "procedural";
|
|
160
|
+
}>;
|
|
161
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
162
|
+
embedding: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
163
|
+
similarity_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
164
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
165
|
+
}, z.core.$strip>>>>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
export type ContextResponse = z.infer<typeof ContextResponseSchema>;
|
|
168
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAMjC,eAAO,MAAM,qBAA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,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAI5E,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAK1D;AAcD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;iBAQ5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;iBAWhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/models.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical models for the Memory API (TypeScript port).
|
|
3
|
+
*
|
|
4
|
+
* These zod schemas define the response types the Memory Server returns and the
|
|
5
|
+
* facade surfaces. They are the TypeScript counterpart of the Python
|
|
6
|
+
* `agent_engine_sdk_memory.models` module — only the shapes the unified `Memory`
|
|
7
|
+
* facade actually returns are ported here.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Result models (operation results)
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const WriteTurnResultSchema = z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
session_id: z.string(),
|
|
16
|
+
turn_seq: z.number().int(),
|
|
17
|
+
acknowledged: z.boolean().default(true),
|
|
18
|
+
has_embedding: z.boolean().default(false),
|
|
19
|
+
});
|
|
20
|
+
export const CreateSemanticResultSchema = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
label: z.string(),
|
|
23
|
+
has_embedding: z.boolean(),
|
|
24
|
+
acknowledged: z.boolean().default(true),
|
|
25
|
+
});
|
|
26
|
+
export const CreateEpisodicResultSchema = z.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
title: z.string(),
|
|
29
|
+
has_embedding: z.boolean(),
|
|
30
|
+
acknowledged: z.boolean().default(true),
|
|
31
|
+
});
|
|
32
|
+
export const CreateTaxonomicResultSchema = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
domain: z.string(),
|
|
35
|
+
term: z.string(),
|
|
36
|
+
has_embedding: z.boolean(),
|
|
37
|
+
acknowledged: z.boolean().default(true),
|
|
38
|
+
});
|
|
39
|
+
export const CreateProceduralResultSchema = z.object({
|
|
40
|
+
id: z.string(),
|
|
41
|
+
procedure: z.string(),
|
|
42
|
+
has_embedding: z.boolean(),
|
|
43
|
+
acknowledged: z.boolean().default(true),
|
|
44
|
+
});
|
|
45
|
+
export const TagScalarSchema = z.union([z.string(), z.number(), z.boolean()]);
|
|
46
|
+
export const CustomMemorySaveResultSchema = z.object({
|
|
47
|
+
id: z.string(),
|
|
48
|
+
type: z.string(),
|
|
49
|
+
tags: z.record(z.string(), TagScalarSchema),
|
|
50
|
+
has_embedding: z.boolean(),
|
|
51
|
+
});
|
|
52
|
+
export const RetrievedCustomMemorySchema = z.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
type: z.string(),
|
|
55
|
+
content: z.string(),
|
|
56
|
+
tags: z.record(z.string(), TagScalarSchema),
|
|
57
|
+
contextual_metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
58
|
+
user_id: z.string().nullish(),
|
|
59
|
+
agent_id: z.string().nullish(),
|
|
60
|
+
});
|
|
61
|
+
export const CustomMemoryRetrieveResultSchema = z.object({
|
|
62
|
+
results: z.array(RetrievedCustomMemorySchema),
|
|
63
|
+
count: z.number(),
|
|
64
|
+
});
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// Retrieval enums
|
|
67
|
+
// =============================================================================
|
|
68
|
+
/** Source type for memory chunks. */
|
|
69
|
+
export const MemorySource = {
|
|
70
|
+
STM: "stm",
|
|
71
|
+
EPISODIC: "episodic",
|
|
72
|
+
SEMANTIC: "semantic",
|
|
73
|
+
TAXONOMIC: "taxonomic",
|
|
74
|
+
PROCEDURAL: "procedural",
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* A memory source that `Memory.search` can query.
|
|
78
|
+
*
|
|
79
|
+
* Mirrors `MemorySource` minus `stm` (short-term turns are not a search target).
|
|
80
|
+
* Callers may pass either the constant or its string value.
|
|
81
|
+
*/
|
|
82
|
+
export const SearchSource = {
|
|
83
|
+
SEMANTIC: "semantic",
|
|
84
|
+
EPISODIC: "episodic",
|
|
85
|
+
TAXONOMIC: "taxonomic",
|
|
86
|
+
PROCEDURAL: "procedural",
|
|
87
|
+
};
|
|
88
|
+
const SEARCH_SOURCE_VALUES = new Set(Object.values(SearchSource));
|
|
89
|
+
/** Narrow an arbitrary string to a `SearchSource`, throwing on an unknown value. */
|
|
90
|
+
export function toSearchSource(value) {
|
|
91
|
+
if (!SEARCH_SOURCE_VALUES.has(value)) {
|
|
92
|
+
throw new RangeError(`unknown search source: ${value}`);
|
|
93
|
+
}
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
// =============================================================================
|
|
97
|
+
// Retrieval models (memory chunks and context)
|
|
98
|
+
// =============================================================================
|
|
99
|
+
const MemorySourceSchema = z.enum([
|
|
100
|
+
MemorySource.STM,
|
|
101
|
+
MemorySource.EPISODIC,
|
|
102
|
+
MemorySource.SEMANTIC,
|
|
103
|
+
MemorySource.TAXONOMIC,
|
|
104
|
+
MemorySource.PROCEDURAL,
|
|
105
|
+
]);
|
|
106
|
+
/**
|
|
107
|
+
* Unified representation of memory from any source (STM, episodic, semantic, …).
|
|
108
|
+
*
|
|
109
|
+
* `timestamp` is coerced to a `Date`; a missing value on the wire is a server
|
|
110
|
+
* contract violation and surfaces as a schema error at parse time.
|
|
111
|
+
*
|
|
112
|
+
* `similarity_score` is on the scale of the retrieval mode that produced the
|
|
113
|
+
* chunk: vector similarity for semantic mode, text relevance for text mode, and
|
|
114
|
+
* the fused rank-fusion score for hybrid mode. Comparable between chunks
|
|
115
|
+
* retrieved the same way; not comparable across modes, or across sources
|
|
116
|
+
* searched differently. Null when the chunk did not come from a search.
|
|
117
|
+
*/
|
|
118
|
+
export const MemoryChunkSchema = z.object({
|
|
119
|
+
id: z.string(),
|
|
120
|
+
content: z.string(),
|
|
121
|
+
source: MemorySourceSchema,
|
|
122
|
+
timestamp: z.coerce.date(),
|
|
123
|
+
embedding: z.array(z.number()).nullish(),
|
|
124
|
+
similarity_score: z.number().nullish(),
|
|
125
|
+
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
126
|
+
});
|
|
127
|
+
export const ContextMetadataSchema = z.object({
|
|
128
|
+
token_count: z.number().int().default(0),
|
|
129
|
+
memory_counts: z.record(z.string(), z.number()).default({}),
|
|
130
|
+
timing: z.record(z.string(), z.number()).default({}),
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* Final response model for context building. `formatted_context` is a string or
|
|
134
|
+
* a list of message dicts depending on the server's format style.
|
|
135
|
+
*/
|
|
136
|
+
export const ContextResponseSchema = z.object({
|
|
137
|
+
formatted_context: z.union([
|
|
138
|
+
z.string(),
|
|
139
|
+
z.array(z.record(z.string(), z.unknown())),
|
|
140
|
+
]),
|
|
141
|
+
metadata: ContextMetadataSchema.default(() => ({
|
|
142
|
+
token_count: 0,
|
|
143
|
+
memory_counts: {},
|
|
144
|
+
timing: {},
|
|
145
|
+
})),
|
|
146
|
+
selected_memories: z.array(MemoryChunkSchema).nullish(),
|
|
147
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax-only client-side checks for custom-type names and tag payloads.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the shape rules of the memory-server's tag canonicalization with
|
|
5
|
+
* byte-identical messages, so a fail-fast client error reads the same as a
|
|
6
|
+
* server rejection. Deliberately NOT mirrored (server-owned): the int64 range
|
|
7
|
+
* guard, dotted+nested mixed-form detection, operator-expression detection,
|
|
8
|
+
* key-count caps, declaration membership — those values reach the platform
|
|
9
|
+
* intact, so the server's own rejection is the one the caller sees.
|
|
10
|
+
*
|
|
11
|
+
* Non-finite numbers are the exception: JSON.stringify rewrites them to null,
|
|
12
|
+
* so the value never survives the wire for the server to judge. Rejecting here
|
|
13
|
+
* is what makes the server's rule reachable at all.
|
|
14
|
+
*/
|
|
15
|
+
import type { TagScalar } from "./models.js";
|
|
16
|
+
export type { TagScalar };
|
|
17
|
+
export type TagMap = Record<string, TagScalar | Record<string, TagScalar>>;
|
|
18
|
+
/** Mirror of pkg/memoryconfig/reserved_names.json (parity-tested in Python). */
|
|
19
|
+
export declare const RESERVED_TYPE_NAMES: ReadonlySet<string>;
|
|
20
|
+
export declare function validateMemoryType(memoryType: string): void;
|
|
21
|
+
export declare function validateTagSyntax(tags: Record<string, unknown>): void;
|
|
22
|
+
//# sourceMappingURL=tag_syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag_syntax.d.ts","sourceRoot":"","sources":["../src/tag_syntax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAE3E,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAWlD,CAAC;AAWH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAc3D;AA4ED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAKrE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax-only client-side checks for custom-type names and tag payloads.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the shape rules of the memory-server's tag canonicalization with
|
|
5
|
+
* byte-identical messages, so a fail-fast client error reads the same as a
|
|
6
|
+
* server rejection. Deliberately NOT mirrored (server-owned): the int64 range
|
|
7
|
+
* guard, dotted+nested mixed-form detection, operator-expression detection,
|
|
8
|
+
* key-count caps, declaration membership — those values reach the platform
|
|
9
|
+
* intact, so the server's own rejection is the one the caller sees.
|
|
10
|
+
*
|
|
11
|
+
* Non-finite numbers are the exception: JSON.stringify rewrites them to null,
|
|
12
|
+
* so the value never survives the wire for the server to judge. Rejecting here
|
|
13
|
+
* is what makes the server's rule reachable at all.
|
|
14
|
+
*/
|
|
15
|
+
import { MemoryClientError } from "./errors.js";
|
|
16
|
+
/** Mirror of pkg/memoryconfig/reserved_names.json (parity-tested in Python). */
|
|
17
|
+
export const RESERVED_TYPE_NAMES = new Set([
|
|
18
|
+
"semantic",
|
|
19
|
+
"episodic",
|
|
20
|
+
"taxonomic",
|
|
21
|
+
"procedural",
|
|
22
|
+
"snapshot",
|
|
23
|
+
"entity",
|
|
24
|
+
"preferences",
|
|
25
|
+
"turn",
|
|
26
|
+
"stm",
|
|
27
|
+
"short_term",
|
|
28
|
+
]);
|
|
29
|
+
const MAX_TAG_KEY_DEPTH = 2;
|
|
30
|
+
/**
|
|
31
|
+
* Mirror of the name_pattern in pkg/memoryconfig/reserved_names.json. A name
|
|
32
|
+
* that cannot be declared can never exist, so checking it here turns an
|
|
33
|
+
* unroutable request into a precise local error.
|
|
34
|
+
*/
|
|
35
|
+
const NAME_RE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
36
|
+
export function validateMemoryType(memoryType) {
|
|
37
|
+
if (typeof memoryType !== "string" || memoryType.trim() === "") {
|
|
38
|
+
throw new MemoryClientError("memory_type must be a non-empty string");
|
|
39
|
+
}
|
|
40
|
+
if (RESERVED_TYPE_NAMES.has(memoryType)) {
|
|
41
|
+
throw new MemoryClientError(`'${memoryType}' is a built-in memory type and is not accepted by this operation`);
|
|
42
|
+
}
|
|
43
|
+
if (!NAME_RE.test(memoryType)) {
|
|
44
|
+
throw new MemoryClientError(`custom type name '${memoryType}' must match ${NAME_RE.source}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function isPlainObject(value) {
|
|
48
|
+
return (typeof value === "object" &&
|
|
49
|
+
value !== null &&
|
|
50
|
+
!Array.isArray(value) &&
|
|
51
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
52
|
+
}
|
|
53
|
+
function checkPath(path) {
|
|
54
|
+
const segments = path.split(".");
|
|
55
|
+
if (segments.some((segment) => segment === "")) {
|
|
56
|
+
throw new MemoryClientError(`tag '${path}' must have a non-empty path`);
|
|
57
|
+
}
|
|
58
|
+
if (segments.length > MAX_TAG_KEY_DEPTH) {
|
|
59
|
+
throw new MemoryClientError(`tag '${path}': nesting is at most one level deep`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function checkScalar(path, value) {
|
|
63
|
+
if (typeof value === "string") {
|
|
64
|
+
if (value.trim() === "") {
|
|
65
|
+
throw new MemoryClientError(`tag '${path}' must have a non-empty string value`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (typeof value === "number") {
|
|
69
|
+
// JSON.stringify turns NaN and Infinity into null, which would store a
|
|
70
|
+
// value the server never agreed to. Reject before that silent rewrite.
|
|
71
|
+
if (!Number.isFinite(value)) {
|
|
72
|
+
throw new MemoryClientError(`tag '${path}' must be a finite number`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (typeof value !== "boolean") {
|
|
76
|
+
throw new MemoryClientError(`tag '${path}' must be a non-empty string, number, or boolean`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Yield [dotted path, value] pairs from either accepted wire form.
|
|
81
|
+
*
|
|
82
|
+
* Group-level rules are applied here, so the per-leaf checks that follow run
|
|
83
|
+
* over one uniform sequence rather than once per wire form.
|
|
84
|
+
*/
|
|
85
|
+
function* flatten(tags) {
|
|
86
|
+
for (const [key, value] of Object.entries(tags)) {
|
|
87
|
+
if (!isPlainObject(value)) {
|
|
88
|
+
yield [key, value];
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (key.includes(".")) {
|
|
92
|
+
throw new MemoryClientError(`tag '${key}': nesting is at most one level deep`);
|
|
93
|
+
}
|
|
94
|
+
if (Object.keys(value).length === 0) {
|
|
95
|
+
throw new MemoryClientError(`tag group '${key}' must contain at least one key`);
|
|
96
|
+
}
|
|
97
|
+
for (const [subkey, subvalue] of Object.entries(value)) {
|
|
98
|
+
if (subkey.includes(".") || isPlainObject(subvalue)) {
|
|
99
|
+
throw new MemoryClientError(`tag '${key}': nesting is at most one level deep`);
|
|
100
|
+
}
|
|
101
|
+
yield [`${key}.${subkey}`, subvalue];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export function validateTagSyntax(tags) {
|
|
106
|
+
for (const [path, value] of flatten(tags)) {
|
|
107
|
+
checkPath(path);
|
|
108
|
+
checkScalar(path, value);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/** Seam primitives: the request context and the runtime/CRUD interfaces. */
|
|
2
|
+
import type { ContextResponse, CreateEpisodicResult, CreateProceduralResult, CreateSemanticResult, CreateTaxonomicResult, CustomMemoryRetrieveResult, CustomMemorySaveResult, MemoryChunk, WriteTurnResult } from "./models.js";
|
|
3
|
+
/** A minimal fetch signature so tests can inject a stub. */
|
|
4
|
+
export type FetchLike = (url: string, init: RequestInit) => Promise<Response>;
|
|
5
|
+
/** Extra per-request options a transport implementation can layer in (e.g. mTLS agent). */
|
|
6
|
+
export type RequestExtras = () => RequestInit;
|
|
7
|
+
/** Immutable identity context carried across a memory call. */
|
|
8
|
+
export interface MemoryRequestContext {
|
|
9
|
+
readonly userId?: string | null;
|
|
10
|
+
readonly agentId?: string | null;
|
|
11
|
+
readonly sessionId?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Transport seam every memory backend implements.
|
|
15
|
+
*
|
|
16
|
+
* Identity is passed as resolved arguments; tenancy is internal to each runtime.
|
|
17
|
+
*/
|
|
18
|
+
export interface MemoryRuntime {
|
|
19
|
+
recordTurn(args: {
|
|
20
|
+
role: string;
|
|
21
|
+
content?: string | null;
|
|
22
|
+
sessionId?: string | null;
|
|
23
|
+
userId?: string | null;
|
|
24
|
+
agentId?: string | null;
|
|
25
|
+
toolCalls?: Array<Record<string, unknown>> | null;
|
|
26
|
+
toolCallId?: string | null;
|
|
27
|
+
toolName?: string | null;
|
|
28
|
+
isError?: boolean;
|
|
29
|
+
modelName?: string | null;
|
|
30
|
+
idempotencyKey?: string | null;
|
|
31
|
+
}): Promise<WriteTurnResult>;
|
|
32
|
+
buildContext(args: {
|
|
33
|
+
query: string;
|
|
34
|
+
sessionId?: string | null;
|
|
35
|
+
userId?: string | null;
|
|
36
|
+
visibility?: string | null;
|
|
37
|
+
metadataFilter?: Record<string, unknown> | null;
|
|
38
|
+
enabledSources?: Set<string> | null;
|
|
39
|
+
topK?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Optional gross context-construction budget. After retrieval and ranking,
|
|
42
|
+
* the server subtracts a 500-token formatting reserve, then greedily
|
|
43
|
+
* selects whole memory chunks that fit in the remainder. Positive values
|
|
44
|
+
* at or below 500 leave no budget for memories. Values above 500
|
|
45
|
+
* can still yield empty context when no chunk fits.
|
|
46
|
+
*/
|
|
47
|
+
maxTokens?: number;
|
|
48
|
+
}): Promise<ContextResponse>;
|
|
49
|
+
searchSemantic(args: {
|
|
50
|
+
query: string;
|
|
51
|
+
userId?: string | null;
|
|
52
|
+
visibility?: string | null;
|
|
53
|
+
topK?: number;
|
|
54
|
+
}): Promise<MemoryChunk[]>;
|
|
55
|
+
searchEpisodes(args: {
|
|
56
|
+
query: string;
|
|
57
|
+
userId?: string | null;
|
|
58
|
+
visibility?: string | null;
|
|
59
|
+
sessionId?: string | null;
|
|
60
|
+
topK?: number;
|
|
61
|
+
}): Promise<MemoryChunk[]>;
|
|
62
|
+
searchTaxonomic(args: {
|
|
63
|
+
query: string;
|
|
64
|
+
userId?: string | null;
|
|
65
|
+
domain?: string | null;
|
|
66
|
+
visibility?: string | null;
|
|
67
|
+
topK?: number;
|
|
68
|
+
}): Promise<MemoryChunk[]>;
|
|
69
|
+
discoverProcedures(args: {
|
|
70
|
+
query: string;
|
|
71
|
+
userId?: string | null;
|
|
72
|
+
visibility?: string | null;
|
|
73
|
+
tags?: string[] | null;
|
|
74
|
+
topK?: number;
|
|
75
|
+
similarityThreshold?: number;
|
|
76
|
+
metadataFilter?: Record<string, unknown> | null;
|
|
77
|
+
}): Promise<Array<Record<string, unknown>>>;
|
|
78
|
+
/** Optional: release underlying resources. */
|
|
79
|
+
close?(): void | Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Optional capability: a runtime that can supply per-call ambient identity.
|
|
83
|
+
*
|
|
84
|
+
* Only app-bound runtimes running inside the platform stack have access to
|
|
85
|
+
* per-request context. This is a separate interface so the facade can detect the
|
|
86
|
+
* capability without requiring every runtime to implement it.
|
|
87
|
+
*/
|
|
88
|
+
export interface AmbientIdentityRuntime {
|
|
89
|
+
requestContext(): MemoryRequestContext | null;
|
|
90
|
+
}
|
|
91
|
+
/** Duck-typed check for the {@link AmbientIdentityRuntime} capability. */
|
|
92
|
+
export declare function hasAmbientIdentity(runtime: MemoryRuntime): runtime is MemoryRuntime & AmbientIdentityRuntime;
|
|
93
|
+
/**
|
|
94
|
+
* CRUD seam the facade's type-specific conveniences delegate to.
|
|
95
|
+
*
|
|
96
|
+
* Like `MemoryRuntime`, tenancy is internal to each implementation.
|
|
97
|
+
*/
|
|
98
|
+
export interface MemoryCrudClient {
|
|
99
|
+
createSemantic(args: {
|
|
100
|
+
label: string;
|
|
101
|
+
text: string;
|
|
102
|
+
userId: string;
|
|
103
|
+
source?: string;
|
|
104
|
+
visibility?: string;
|
|
105
|
+
agentId?: string | null;
|
|
106
|
+
metadata?: Record<string, unknown> | null;
|
|
107
|
+
upsert?: boolean;
|
|
108
|
+
}): Promise<CreateSemanticResult>;
|
|
109
|
+
getSemantic(args: {
|
|
110
|
+
label: string;
|
|
111
|
+
userId?: string | null;
|
|
112
|
+
visibility?: string | null;
|
|
113
|
+
}): Promise<unknown | null>;
|
|
114
|
+
createEpisodic(args: {
|
|
115
|
+
title: string;
|
|
116
|
+
content: string;
|
|
117
|
+
userId: string;
|
|
118
|
+
sessionId: string;
|
|
119
|
+
summaryText?: string | null;
|
|
120
|
+
participants?: string[] | null;
|
|
121
|
+
tags?: string[] | null;
|
|
122
|
+
visibility?: string;
|
|
123
|
+
metadata?: Record<string, unknown> | null;
|
|
124
|
+
agentId?: string | null;
|
|
125
|
+
}): Promise<CreateEpisodicResult>;
|
|
126
|
+
listEpisodic(args: {
|
|
127
|
+
userId?: string | null;
|
|
128
|
+
sessionId?: string | null;
|
|
129
|
+
visibility?: string | null;
|
|
130
|
+
limit?: number;
|
|
131
|
+
}): Promise<unknown[]>;
|
|
132
|
+
createTaxonomic(args: {
|
|
133
|
+
domain: string;
|
|
134
|
+
term: string;
|
|
135
|
+
definition: string;
|
|
136
|
+
userId: string;
|
|
137
|
+
relatedTerms?: string[] | null;
|
|
138
|
+
visibility?: string;
|
|
139
|
+
}): Promise<CreateTaxonomicResult>;
|
|
140
|
+
getTaxonomic(args: {
|
|
141
|
+
domain: string;
|
|
142
|
+
term?: string | null;
|
|
143
|
+
userId?: string | null;
|
|
144
|
+
visibility?: string | null;
|
|
145
|
+
}): Promise<unknown | null>;
|
|
146
|
+
getDistinctDomains(args: {
|
|
147
|
+
visibility?: string | null;
|
|
148
|
+
}): Promise<string[]>;
|
|
149
|
+
createProcedural(args: {
|
|
150
|
+
procedure: string;
|
|
151
|
+
description: string;
|
|
152
|
+
content: string;
|
|
153
|
+
userId: string;
|
|
154
|
+
steps?: Array<Record<string, unknown>> | null;
|
|
155
|
+
resources?: Array<Record<string, unknown>> | null;
|
|
156
|
+
allowedTools?: string[] | null;
|
|
157
|
+
compatibility?: string | null;
|
|
158
|
+
license?: string | null;
|
|
159
|
+
triggerConditions?: string[] | null;
|
|
160
|
+
tags?: string[] | null;
|
|
161
|
+
visibility?: string;
|
|
162
|
+
agentId?: string | null;
|
|
163
|
+
extractionSource?: string | null;
|
|
164
|
+
sourceFormat?: string | null;
|
|
165
|
+
sourcePath?: string | null;
|
|
166
|
+
updateExisting?: boolean;
|
|
167
|
+
}): Promise<CreateProceduralResult>;
|
|
168
|
+
getProcedural(args: {
|
|
169
|
+
procedure?: string | null;
|
|
170
|
+
userId?: string | null;
|
|
171
|
+
visibility?: string | null;
|
|
172
|
+
includeDeleted?: boolean;
|
|
173
|
+
}): Promise<unknown | null>;
|
|
174
|
+
/** Identity is stamped by the platform. */
|
|
175
|
+
createCustom(args: {
|
|
176
|
+
memoryType: string;
|
|
177
|
+
content: string;
|
|
178
|
+
tags?: Record<string, unknown> | null;
|
|
179
|
+
contextualMetadata?: Record<string, unknown> | null;
|
|
180
|
+
}): Promise<CustomMemorySaveResult>;
|
|
181
|
+
/** Identity is stamped by the platform. */
|
|
182
|
+
retrieveCustom(args: {
|
|
183
|
+
memoryType: string;
|
|
184
|
+
query: string;
|
|
185
|
+
tags?: Record<string, unknown> | null;
|
|
186
|
+
topK?: number;
|
|
187
|
+
}): Promise<CustomMemoryRetrieveResult>;
|
|
188
|
+
/** Optional: release underlying resources. */
|
|
189
|
+
close?(): void | Promise<void>;
|
|
190
|
+
}
|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