@pyxmate/memory 1.13.0 → 1.15.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/agent-contract.mjs +1 -1
- package/dist/{chunk-OUSGU272.mjs → chunk-3BTAAGMM.mjs} +12 -11
- package/dist/{chunk-HOBDPIHO.mjs → chunk-3FRA37TI.mjs} +1 -1
- package/dist/chunk-A3L46P2G.mjs +57 -0
- package/dist/{chunk-5BLT7RSY.mjs → chunk-IEBF7BQF.mjs} +48 -67
- package/dist/cli/pyx-mem.mjs +38 -6
- package/dist/dashboard.mjs +3 -2
- package/dist/data-plane-contract.d.ts +234 -0
- package/dist/data-plane-contract.mjs +1150 -0
- package/dist/index.d.ts +93 -54
- package/dist/index.mjs +4 -2
- package/dist/react.mjs +3 -2
- package/package.json +5 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
declare const DATA_PLANE_CONTRACT_VERSION: "pyx-data-plane-contract-v1";
|
|
2
|
+
declare const DATA_PLANE_CATALOG_VERSION: "maas-request-v1";
|
|
3
|
+
declare const DATA_PLANE_MANIFEST_VERSION: "pyx-data-plane-manifest-v1";
|
|
4
|
+
declare const DATA_PLANE_STEP_INPUT_FRAME: "pyx-data-plane-step-input-v1\0";
|
|
5
|
+
declare const DATA_PLANE_MANIFEST_FRAME: "pyx-data-plane-manifest-v1\0";
|
|
6
|
+
declare const DATA_PLANE_HTTP_RESPONSE_FRAME: "pyx-data-plane-http-response-v1\0";
|
|
7
|
+
declare const DATA_PLANE_COMPILER_LIMITS: {
|
|
8
|
+
readonly operationIdBytes: 64;
|
|
9
|
+
readonly identityBytes: 256;
|
|
10
|
+
readonly semanticTextBytes: 128000;
|
|
11
|
+
readonly canonicalInputBytes: 1048576;
|
|
12
|
+
readonly profileContentBytes: 8192;
|
|
13
|
+
};
|
|
14
|
+
declare const SENSITIVITY_LEVELS: readonly ["public", "internal", "secret"];
|
|
15
|
+
declare const PRINCIPAL_KINDS: readonly ["api_key", "user"];
|
|
16
|
+
declare const TENANT_MODES: readonly ["single", "multi"];
|
|
17
|
+
type SensitivityLevel = (typeof SENSITIVITY_LEVELS)[number];
|
|
18
|
+
type CanonicalPrimitive = null | boolean | number | string;
|
|
19
|
+
type CanonicalDataPlaneValue = CanonicalPrimitive | readonly CanonicalDataPlaneValue[] | {
|
|
20
|
+
readonly [key: string]: CanonicalDataPlaneValue;
|
|
21
|
+
};
|
|
22
|
+
type CanonicalDataPlaneObject = {
|
|
23
|
+
readonly [key: string]: CanonicalDataPlaneValue;
|
|
24
|
+
};
|
|
25
|
+
interface CompileContext {
|
|
26
|
+
organizationId: string;
|
|
27
|
+
projectId: string;
|
|
28
|
+
instanceId: string;
|
|
29
|
+
operationId: string;
|
|
30
|
+
principal: {
|
|
31
|
+
kind: (typeof PRINCIPAL_KINDS)[number];
|
|
32
|
+
id: string;
|
|
33
|
+
};
|
|
34
|
+
scope: {
|
|
35
|
+
tenantId: string;
|
|
36
|
+
namespaceId?: string;
|
|
37
|
+
userId?: string;
|
|
38
|
+
teamId?: string;
|
|
39
|
+
callerAccessLevel?: SensitivityLevel;
|
|
40
|
+
};
|
|
41
|
+
resolvedAt: string;
|
|
42
|
+
runtimeAttestation: {
|
|
43
|
+
contractVersion: typeof DATA_PLANE_CONTRACT_VERSION;
|
|
44
|
+
tenantMode: (typeof TENANT_MODES)[number];
|
|
45
|
+
defaultAgentId: string | null;
|
|
46
|
+
effectiveSource: string;
|
|
47
|
+
sharedFallback: boolean;
|
|
48
|
+
sqliteAtomicOneStep: true;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface CompiledDataPlaneExecutionPlan {
|
|
52
|
+
mode: 'journal';
|
|
53
|
+
version: typeof DATA_PLANE_MANIFEST_VERSION;
|
|
54
|
+
steps: readonly {
|
|
55
|
+
sequence: number;
|
|
56
|
+
stepKey: string;
|
|
57
|
+
kind: 'sqlite' | 'vector' | 'graph' | 'embedding';
|
|
58
|
+
execution: 'sqlite_atomic' | 'idempotent_adapter';
|
|
59
|
+
inputSha256: string;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
interface CompileDataPlaneRequest {
|
|
63
|
+
catalogVersion: typeof DATA_PLANE_CATALOG_VERSION;
|
|
64
|
+
operation: DataPlaneCatalogOperation;
|
|
65
|
+
context: CompileContext;
|
|
66
|
+
input: unknown;
|
|
67
|
+
}
|
|
68
|
+
type DataPlaneUnsupportedReasonCode = 'embedding_execution_not_ready' | 'multi_step_execution_not_ready' | 'fanout_execution_not_ready' | 'graph_execution_not_ready' | 'corpus_dependent_execution_not_ready' | 'external_io_execution_not_ready' | 'nonchargeable_operation';
|
|
69
|
+
interface SupportedCatalogEntry {
|
|
70
|
+
support: 'sqlite_atomic_one_step' | 'journal_multi_step';
|
|
71
|
+
}
|
|
72
|
+
declare const DATA_PLANE_OPERATION_COVERAGE: {
|
|
73
|
+
readonly 'rest:store': {
|
|
74
|
+
readonly support: "journal_multi_step";
|
|
75
|
+
};
|
|
76
|
+
readonly 'rest:search': {
|
|
77
|
+
readonly support: "journal_multi_step";
|
|
78
|
+
};
|
|
79
|
+
readonly 'rest:query_as_of': {
|
|
80
|
+
readonly support: "sqlite_atomic_one_step";
|
|
81
|
+
};
|
|
82
|
+
readonly 'rest:query_by_event_time': {
|
|
83
|
+
readonly support: "sqlite_atomic_one_step";
|
|
84
|
+
};
|
|
85
|
+
readonly 'rest:log': {
|
|
86
|
+
readonly support: "sqlite_atomic_one_step";
|
|
87
|
+
};
|
|
88
|
+
readonly 'rest:lineage': {
|
|
89
|
+
readonly support: "journal_multi_step";
|
|
90
|
+
};
|
|
91
|
+
readonly 'rest:reinforce': {
|
|
92
|
+
readonly support: "journal_multi_step";
|
|
93
|
+
};
|
|
94
|
+
readonly 'rest:record_correction': {
|
|
95
|
+
readonly support: "sqlite_atomic_one_step";
|
|
96
|
+
};
|
|
97
|
+
readonly 'rest:fetch_corrections': {
|
|
98
|
+
readonly support: "sqlite_atomic_one_step";
|
|
99
|
+
};
|
|
100
|
+
readonly 'rest:synthesis_entity_refresh': {
|
|
101
|
+
readonly support: "not_execution_ready";
|
|
102
|
+
readonly reasonCode: "external_io_execution_not_ready";
|
|
103
|
+
readonly reason: "entity synthesis refresh invokes an external LLM with data-dependent output and is not execution-ready in data-plane contract v1";
|
|
104
|
+
};
|
|
105
|
+
readonly 'rest:get_synthesis_entity': {
|
|
106
|
+
readonly support: "sqlite_atomic_one_step";
|
|
107
|
+
};
|
|
108
|
+
readonly 'rest:list': {
|
|
109
|
+
readonly support: "sqlite_atomic_one_step";
|
|
110
|
+
};
|
|
111
|
+
readonly 'rest:batch_store': {
|
|
112
|
+
readonly support: "journal_multi_step";
|
|
113
|
+
};
|
|
114
|
+
readonly 'rest:get': {
|
|
115
|
+
readonly support: "sqlite_atomic_one_step";
|
|
116
|
+
};
|
|
117
|
+
readonly 'rest:delete': {
|
|
118
|
+
readonly support: "journal_multi_step";
|
|
119
|
+
};
|
|
120
|
+
readonly 'rest:graph_nodes': {
|
|
121
|
+
readonly support: "journal_multi_step";
|
|
122
|
+
};
|
|
123
|
+
readonly 'rest:graph_relationships': {
|
|
124
|
+
readonly support: "journal_multi_step";
|
|
125
|
+
};
|
|
126
|
+
readonly 'rest:graph_subgraph': {
|
|
127
|
+
readonly support: "journal_multi_step";
|
|
128
|
+
};
|
|
129
|
+
readonly 'rest:embedding_map': {
|
|
130
|
+
readonly support: "not_execution_ready";
|
|
131
|
+
readonly reasonCode: "corpus_dependent_execution_not_ready";
|
|
132
|
+
readonly reason: "embedding map reads cache state and may compute PCA over a data-dependent corpus, so it is not execution-ready in data-plane contract v1";
|
|
133
|
+
};
|
|
134
|
+
readonly 'mcp:search_memories': {
|
|
135
|
+
readonly support: "journal_multi_step";
|
|
136
|
+
};
|
|
137
|
+
readonly 'mcp:store_memory': {
|
|
138
|
+
readonly support: "journal_multi_step";
|
|
139
|
+
};
|
|
140
|
+
readonly 'mcp:get_memory': {
|
|
141
|
+
readonly support: "sqlite_atomic_one_step";
|
|
142
|
+
};
|
|
143
|
+
readonly 'mcp:lineage': {
|
|
144
|
+
readonly support: "journal_multi_step";
|
|
145
|
+
};
|
|
146
|
+
readonly 'mcp:reinforce': {
|
|
147
|
+
readonly support: "journal_multi_step";
|
|
148
|
+
};
|
|
149
|
+
readonly 'mcp:list_memories': {
|
|
150
|
+
readonly support: "sqlite_atomic_one_step";
|
|
151
|
+
};
|
|
152
|
+
readonly 'mcp:delete_memory': {
|
|
153
|
+
readonly support: "journal_multi_step";
|
|
154
|
+
};
|
|
155
|
+
readonly 'mcp:ingest_memory_file': {
|
|
156
|
+
readonly support: "not_execution_ready";
|
|
157
|
+
readonly reasonCode: "external_io_execution_not_ready";
|
|
158
|
+
readonly reason: "ingest_memory_file reads caller-local files and is not execution-ready in data-plane contract v1";
|
|
159
|
+
};
|
|
160
|
+
readonly 'mcp:summarize_memory_entity': {
|
|
161
|
+
readonly support: "sqlite_atomic_one_step";
|
|
162
|
+
};
|
|
163
|
+
readonly 'mcp:get_taxonomy_state': {
|
|
164
|
+
readonly support: "journal_multi_step";
|
|
165
|
+
};
|
|
166
|
+
readonly 'mcp:name_cluster': {
|
|
167
|
+
readonly support: "journal_multi_step";
|
|
168
|
+
};
|
|
169
|
+
readonly 'mcp:status': {
|
|
170
|
+
readonly support: "not_execution_ready";
|
|
171
|
+
readonly reasonCode: "nonchargeable_operation";
|
|
172
|
+
readonly reason: "status is nonchargeable and must bypass data-plane reservation";
|
|
173
|
+
};
|
|
174
|
+
readonly 'mcp:get_user_profile': {
|
|
175
|
+
readonly support: "sqlite_atomic_one_step";
|
|
176
|
+
};
|
|
177
|
+
readonly 'mcp:upsert_user_profile': {
|
|
178
|
+
readonly support: "sqlite_atomic_one_step";
|
|
179
|
+
};
|
|
180
|
+
readonly 'mcp:record_correction': {
|
|
181
|
+
readonly support: "sqlite_atomic_one_step";
|
|
182
|
+
};
|
|
183
|
+
readonly 'mcp:fetch_applicable_corrections': {
|
|
184
|
+
readonly support: "sqlite_atomic_one_step";
|
|
185
|
+
};
|
|
186
|
+
readonly 'mcp:fetch_due_facts': {
|
|
187
|
+
readonly support: "sqlite_atomic_one_step";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
type DataPlaneCatalogOperation = keyof typeof DATA_PLANE_OPERATION_COVERAGE;
|
|
191
|
+
type SupportedDataPlaneCatalogOperation = {
|
|
192
|
+
[Operation in DataPlaneCatalogOperation]: (typeof DATA_PLANE_OPERATION_COVERAGE)[Operation] extends SupportedCatalogEntry ? Operation : never;
|
|
193
|
+
}[DataPlaneCatalogOperation];
|
|
194
|
+
type CompileDataPlaneResult = {
|
|
195
|
+
kind: 'unsupported';
|
|
196
|
+
catalogVersion: typeof DATA_PLANE_CATALOG_VERSION;
|
|
197
|
+
operation: DataPlaneCatalogOperation;
|
|
198
|
+
reasonCode: DataPlaneUnsupportedReasonCode;
|
|
199
|
+
reason: string;
|
|
200
|
+
} | {
|
|
201
|
+
kind: 'compiled';
|
|
202
|
+
contractVersion: typeof DATA_PLANE_CONTRACT_VERSION;
|
|
203
|
+
catalogVersion: typeof DATA_PLANE_CATALOG_VERSION;
|
|
204
|
+
operation: SupportedDataPlaneCatalogOperation;
|
|
205
|
+
context: CompileContext;
|
|
206
|
+
normalizedInput: CanonicalDataPlaneObject;
|
|
207
|
+
stepInputCanonicalJson: string;
|
|
208
|
+
stepInputSha256: string;
|
|
209
|
+
executionPlan: CompiledDataPlaneExecutionPlan;
|
|
210
|
+
manifestCanonicalJson: string;
|
|
211
|
+
manifestSha256: string;
|
|
212
|
+
quoteDimensions: {
|
|
213
|
+
databaseOperations: number;
|
|
214
|
+
embeddingUnicodeScalars: number;
|
|
215
|
+
embeddingEvents: number;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
declare function canonicalDataPlaneJson(value: unknown): string;
|
|
219
|
+
declare function hashDataPlaneStepInputV1(value: unknown): {
|
|
220
|
+
canonicalJson: string;
|
|
221
|
+
sha256: string;
|
|
222
|
+
};
|
|
223
|
+
declare function hashDataPlaneManifestV1(value: unknown): {
|
|
224
|
+
canonicalJson: string;
|
|
225
|
+
sha256: string;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Hash the exact replayable HTTP metadata owned by the data-plane contract. Transport and
|
|
229
|
+
* security headers (CORS, HSTS, CSP) are intentionally middleware-owned and excluded.
|
|
230
|
+
*/
|
|
231
|
+
declare function hashDataPlaneHttpResponseV1(statusCode: number, contentType: string, body: Uint8Array): string;
|
|
232
|
+
declare function compileDataPlaneRequest(request: CompileDataPlaneRequest): CompileDataPlaneResult;
|
|
233
|
+
|
|
234
|
+
export { type CanonicalDataPlaneObject, type CanonicalDataPlaneValue, type CompileContext, type CompileDataPlaneRequest, type CompileDataPlaneResult, type CompiledDataPlaneExecutionPlan, DATA_PLANE_CATALOG_VERSION, DATA_PLANE_COMPILER_LIMITS, DATA_PLANE_CONTRACT_VERSION, DATA_PLANE_HTTP_RESPONSE_FRAME, DATA_PLANE_MANIFEST_FRAME, DATA_PLANE_MANIFEST_VERSION, DATA_PLANE_OPERATION_COVERAGE, DATA_PLANE_STEP_INPUT_FRAME, type DataPlaneCatalogOperation, type DataPlaneUnsupportedReasonCode, type SupportedDataPlaneCatalogOperation, canonicalDataPlaneJson, compileDataPlaneRequest, hashDataPlaneHttpResponseV1, hashDataPlaneManifestV1, hashDataPlaneStepInputV1 };
|