@pyxmate/memory 0.5.11 → 0.6.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.
|
@@ -14,10 +14,21 @@ var MemoryServerError = class extends Error {
|
|
|
14
14
|
var MemoryClient = class {
|
|
15
15
|
baseUrl;
|
|
16
16
|
_authHeaders;
|
|
17
|
-
constructor(memoryUrl,
|
|
17
|
+
constructor(memoryUrl, apiKeyOrOptions) {
|
|
18
18
|
this.baseUrl = memoryUrl.replace(/\/$/, "");
|
|
19
|
+
let apiKey;
|
|
20
|
+
let defaultHeaders = {};
|
|
21
|
+
if (typeof apiKeyOrOptions === "string") {
|
|
22
|
+
apiKey = apiKeyOrOptions;
|
|
23
|
+
} else if (apiKeyOrOptions) {
|
|
24
|
+
apiKey = apiKeyOrOptions.apiKey;
|
|
25
|
+
defaultHeaders = apiKeyOrOptions.defaultHeaders ?? {};
|
|
26
|
+
}
|
|
19
27
|
const trimmed = apiKey?.trim();
|
|
20
|
-
this._authHeaders =
|
|
28
|
+
this._authHeaders = {
|
|
29
|
+
...trimmed ? { Authorization: `Bearer ${trimmed}` } : {},
|
|
30
|
+
...defaultHeaders
|
|
31
|
+
};
|
|
21
32
|
}
|
|
22
33
|
/** Encode a path segment to prevent URL injection */
|
|
23
34
|
encodePathSegment(segment) {
|
package/dist/dashboard.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ interface MemoryListParams {
|
|
|
10
10
|
type?: MemoryType$1;
|
|
11
11
|
/** Filter by agent ID. */
|
|
12
12
|
agentId?: string;
|
|
13
|
+
/** Filter by tenant ID for multi-tenant isolation. */
|
|
14
|
+
tenantId?: string;
|
|
13
15
|
}
|
|
14
16
|
/** Result of a paginated entry listing. */
|
|
15
17
|
interface MemoryListResult {
|
|
@@ -25,6 +27,10 @@ interface TemporalQueryFilters {
|
|
|
25
27
|
source?: string;
|
|
26
28
|
limit?: number;
|
|
27
29
|
}
|
|
30
|
+
/** Options for scoping operations to a specific tenant. */
|
|
31
|
+
interface TenantScopeOptions {
|
|
32
|
+
tenantId?: string;
|
|
33
|
+
}
|
|
28
34
|
/** Abstract interface for memory systems (local or remote). */
|
|
29
35
|
interface MemoryInterface {
|
|
30
36
|
initialize(): Promise<void>;
|
|
@@ -32,10 +38,10 @@ interface MemoryInterface {
|
|
|
32
38
|
search(params: MemorySearchParams$1): Promise<MemorySearchResult$1>;
|
|
33
39
|
/** List entries with SQL LIMIT/OFFSET pagination. */
|
|
34
40
|
list(params?: MemoryListParams): Promise<MemoryListResult>;
|
|
35
|
-
get(id: string): Promise<MemoryEntry$1 | null>;
|
|
36
|
-
delete(id: string): Promise<boolean>;
|
|
37
|
-
clearSession(sessionId: string): Promise<number>;
|
|
38
|
-
stats(): Promise<MemoryStats$1>;
|
|
41
|
+
get(id: string, options?: TenantScopeOptions): Promise<MemoryEntry$1 | null>;
|
|
42
|
+
delete(id: string, options?: TenantScopeOptions): Promise<boolean>;
|
|
43
|
+
clearSession(sessionId: string, options?: TenantScopeOptions): Promise<number>;
|
|
44
|
+
stats(options?: TenantScopeOptions): Promise<MemoryStats$1>;
|
|
39
45
|
/** Query entries as they existed at a point in time (by ingest time). */
|
|
40
46
|
queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
|
|
41
47
|
/** Query entries by event time range (when things actually happened). */
|
|
@@ -82,10 +88,16 @@ declare class MemoryServerError extends Error {
|
|
|
82
88
|
/** True when the server returned HTTP 404 (not found). */
|
|
83
89
|
get isNotFound(): boolean;
|
|
84
90
|
}
|
|
91
|
+
interface MemoryClientOptions {
|
|
92
|
+
/** API key for authentication. */
|
|
93
|
+
apiKey?: string;
|
|
94
|
+
/** Additional headers to send with every request (e.g., X-Caller-Access-Level). */
|
|
95
|
+
defaultHeaders?: Record<string, string>;
|
|
96
|
+
}
|
|
85
97
|
declare class MemoryClient implements ExtendedMemoryInterface {
|
|
86
98
|
protected baseUrl: string;
|
|
87
99
|
private readonly _authHeaders;
|
|
88
|
-
constructor(memoryUrl: string,
|
|
100
|
+
constructor(memoryUrl: string, apiKeyOrOptions?: string | MemoryClientOptions);
|
|
89
101
|
/** Encode a path segment to prevent URL injection */
|
|
90
102
|
private encodePathSegment;
|
|
91
103
|
initialize(): Promise<void>;
|
|
@@ -181,6 +193,12 @@ declare const MemoryType: {
|
|
|
181
193
|
readonly SUMMARY: "summary";
|
|
182
194
|
};
|
|
183
195
|
type MemoryType = (typeof MemoryType)[keyof typeof MemoryType];
|
|
196
|
+
declare const SensitivityLevel: {
|
|
197
|
+
readonly PUBLIC: "public";
|
|
198
|
+
readonly INTERNAL: "internal";
|
|
199
|
+
readonly SECRET: "secret";
|
|
200
|
+
};
|
|
201
|
+
type SensitivityLevel = (typeof SensitivityLevel)[keyof typeof SensitivityLevel];
|
|
184
202
|
declare const RAGStrategy: {
|
|
185
203
|
readonly NAIVE: "naive";
|
|
186
204
|
readonly GRAPH: "graph";
|
|
@@ -227,6 +245,16 @@ interface MemoryEntry {
|
|
|
227
245
|
eventTime?: string;
|
|
228
246
|
/** When this entry was ingested into the system. */
|
|
229
247
|
ingestTime?: string;
|
|
248
|
+
/** Sensitivity classification based on content analysis. */
|
|
249
|
+
sensitivity?: SensitivityLevel;
|
|
250
|
+
/** Whether the content field is encrypted at rest. */
|
|
251
|
+
encrypted?: boolean;
|
|
252
|
+
/** Tenant ID for multi-tenant isolation. */
|
|
253
|
+
tenantId?: string;
|
|
254
|
+
/** User ID within the tenant. */
|
|
255
|
+
userId?: string;
|
|
256
|
+
/** Team/group ID within the tenant. */
|
|
257
|
+
teamId?: string;
|
|
230
258
|
}
|
|
231
259
|
interface MemorySearchParams {
|
|
232
260
|
query: string;
|
|
@@ -240,6 +268,14 @@ interface MemorySearchParams {
|
|
|
240
268
|
asOf?: string;
|
|
241
269
|
/** Confidence threshold below which the system recommends abstention (0.0–1.0). Default: 0.3. */
|
|
242
270
|
abstentionThreshold?: number;
|
|
271
|
+
/** Maximum sensitivity level to include in results. Entries above this level are excluded or redacted. */
|
|
272
|
+
maxSensitivity?: SensitivityLevel;
|
|
273
|
+
/** Tenant ID for multi-tenant isolation. */
|
|
274
|
+
tenantId?: string;
|
|
275
|
+
/** User ID within the tenant. */
|
|
276
|
+
userId?: string;
|
|
277
|
+
/** Team/group ID within the tenant. */
|
|
278
|
+
teamId?: string;
|
|
243
279
|
}
|
|
244
280
|
interface MemorySearchResult {
|
|
245
281
|
entries: MemoryEntry[];
|
|
@@ -328,6 +364,12 @@ interface MemoryIngestRequest {
|
|
|
328
364
|
parentId?: string;
|
|
329
365
|
/** When this entry was ingested (ISO timestamp). Default: now. */
|
|
330
366
|
ingestTime?: string;
|
|
367
|
+
/** Tenant ID for multi-tenant isolation. */
|
|
368
|
+
tenantId?: string;
|
|
369
|
+
/** User ID within the tenant. */
|
|
370
|
+
userId?: string;
|
|
371
|
+
/** Team/group ID within the tenant. */
|
|
372
|
+
teamId?: string;
|
|
331
373
|
}
|
|
332
374
|
interface MemoryStats {
|
|
333
375
|
totalEntries: number;
|
|
@@ -365,4 +407,4 @@ interface GraphTraversalResult {
|
|
|
365
407
|
}>;
|
|
366
408
|
}
|
|
367
409
|
|
|
368
|
-
export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type EnrichmentCallbacks, type ExtendedMemoryInterface, type GraphNode, type GraphRelationship, type GraphTraversalResult, type IngestEntity, type IngestRelationship, type IngestionResult, MemoryClient, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, RAGStrategy, type StoreInput, StoreTarget, type TemporalQueryFilters, type Timestamp, VectorProvider };
|
|
410
|
+
export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type EnrichmentCallbacks, type ExtendedMemoryInterface, type GraphNode, type GraphRelationship, type GraphTraversalResult, type IngestEntity, type IngestRelationship, type IngestionResult, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, RAGStrategy, SensitivityLevel, type StoreInput, StoreTarget, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, VectorProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemoryClient,
|
|
3
3
|
MemoryServerError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KVRPHFDP.mjs";
|
|
5
5
|
|
|
6
6
|
// ../shared/src/constants/defaults.ts
|
|
7
7
|
var DEFAULTS = {
|
|
@@ -18,6 +18,11 @@ var MemoryType = {
|
|
|
18
18
|
EPISODIC: "episodic",
|
|
19
19
|
SUMMARY: "summary"
|
|
20
20
|
};
|
|
21
|
+
var SensitivityLevel = {
|
|
22
|
+
PUBLIC: "public",
|
|
23
|
+
INTERNAL: "internal",
|
|
24
|
+
SECRET: "secret"
|
|
25
|
+
};
|
|
21
26
|
var RAGStrategy = {
|
|
22
27
|
NAIVE: "naive",
|
|
23
28
|
GRAPH: "graph",
|
|
@@ -47,6 +52,7 @@ export {
|
|
|
47
52
|
MemoryServerError,
|
|
48
53
|
MemoryType,
|
|
49
54
|
RAGStrategy,
|
|
55
|
+
SensitivityLevel,
|
|
50
56
|
StoreTarget,
|
|
51
57
|
VectorProvider
|
|
52
58
|
};
|
package/dist/react.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-QFEFLBTN.mjs";
|
|
15
|
+
import "./chunk-KVRPHFDP.mjs";
|
|
16
16
|
|
|
17
17
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|
|
18
18
|
import { useCallback as useCallback2, useMemo } from "react";
|