@pyxmate/memory 0.26.0 → 0.26.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MemoryClient
3
- } from "./chunk-N6IRAUXH.mjs";
3
+ } from "./chunk-5X2HOMDQ.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -1,7 +1,8 @@
1
- // ../client/src/memory-client.ts
2
1
  import {
3
2
  mergeExtractedEntities
4
- } from "@pyx-memory/shared";
3
+ } from "./chunk-SSUYQJUI.mjs";
4
+
5
+ // ../client/src/memory-client.ts
5
6
  var MemoryServerError = class extends Error {
6
7
  status;
7
8
  constructor(message, status) {
@@ -124,8 +125,11 @@ var MemoryClient = class {
124
125
  );
125
126
  return result.cleared;
126
127
  }
127
- async stats() {
128
- const stats = await this.fetchApi("/api/memory/stats");
128
+ async stats(options = {}) {
129
+ const searchParams = new URLSearchParams();
130
+ if (options.graphVisibility) searchParams.set("graphVisibility", options.graphVisibility);
131
+ const qs = searchParams.toString();
132
+ const stats = await this.fetchApi(`/api/memory/stats${qs ? `?${qs}` : ""}`);
129
133
  return { ...stats, connected: true };
130
134
  }
131
135
  /**
@@ -516,9 +520,7 @@ var MemoryClient = class {
516
520
  return result.nodes;
517
521
  }
518
522
  async graphEdges() {
519
- return this.fetchApi(
520
- "/api/memory/graph/edges"
521
- );
523
+ return this.fetchApi("/api/memory/graph/edges");
522
524
  }
523
525
  async graphQuery(query) {
524
526
  return this.fetchApi("/api/memory/graph/query", {
@@ -574,6 +576,9 @@ var MemoryClient = class {
574
576
  });
575
577
  return result.deleted;
576
578
  }
579
+ async repairGraph() {
580
+ return this.fetchApi("/api/memory/graph/repair", { method: "POST" });
581
+ }
577
582
  async deleteBySource(source) {
578
583
  const result = await this.fetchApi(
579
584
  `/api/memory/source/${this.encodePathSegment(source)}`,
@@ -629,6 +634,35 @@ var MemoryClient = class {
629
634
  );
630
635
  return result.entry;
631
636
  }
637
+ /**
638
+ * v0.26 user-profile snapshot — upsert. The server derives `userId`
639
+ * from `X-User-Id` (caller wires it via `defaultHeaders` on the
640
+ * client constructor or per-request middleware); the body cannot
641
+ * override it. See spec §Requirements 10.
642
+ */
643
+ async upsertUserProfile(input) {
644
+ return this.fetchApi("/api/memory/profile/user", {
645
+ method: "PUT",
646
+ body: JSON.stringify(input)
647
+ });
648
+ }
649
+ /**
650
+ * v0.26 user-profile snapshot — fetch by namespace. Returns `null` on
651
+ * HTTP 404 (`isNotFound`), rethrows any other non-2xx as
652
+ * `MemoryServerError`. Mirrors `get()`'s 404-to-null pattern so callers
653
+ * can branch on "no profile yet" without inspecting status codes.
654
+ */
655
+ async getUserProfile(namespaceId) {
656
+ const params = new URLSearchParams({ namespaceId });
657
+ try {
658
+ return await this.fetchApi(
659
+ `/api/memory/profile/user?${params}`
660
+ );
661
+ } catch (error) {
662
+ if (error instanceof MemoryServerError && error.isNotFound) return null;
663
+ throw error;
664
+ }
665
+ }
632
666
  async fetchApi(path, options) {
633
667
  const signal = options?.signal ?? AbortSignal.timeout(this._requestTimeoutMs);
634
668
  let res;
@@ -0,0 +1,121 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // ../shared/src/constants/defaults.ts
8
+ var DEFAULTS = {
9
+ DATA_DIR: "./data",
10
+ VECTOR_PROVIDER: "lancedb",
11
+ MEMORY_SERVER_PORT: 7822
12
+ };
13
+
14
+ // ../shared/src/graph/extraction.ts
15
+ function mergeExtractedEntities(callerEntities, callerRelationships, extracted) {
16
+ const entities = [...callerEntities ?? []];
17
+ const relationships = [...callerRelationships ?? []];
18
+ const nameByLowercase = /* @__PURE__ */ new Map();
19
+ for (const entity of entities) {
20
+ const key = entity.name.toLowerCase();
21
+ if (!nameByLowercase.has(key)) nameByLowercase.set(key, entity.name);
22
+ }
23
+ for (const entity of extracted.entities) {
24
+ const key = entity.name.toLowerCase();
25
+ if (nameByLowercase.has(key)) continue;
26
+ entities.push(entity);
27
+ nameByLowercase.set(key, entity.name);
28
+ }
29
+ for (const relationship of extracted.relations) {
30
+ const source = nameByLowercase.get(relationship.source.toLowerCase());
31
+ const target = nameByLowercase.get(relationship.target.toLowerCase());
32
+ if (source && target) {
33
+ relationships.push({ ...relationship, source, target });
34
+ }
35
+ }
36
+ return { entities, relationships };
37
+ }
38
+
39
+ // ../shared/src/types/isolation.ts
40
+ var NamespaceIsolation = {
41
+ SHARED: "shared",
42
+ STRICT: "strict"
43
+ };
44
+
45
+ // ../shared/src/types/memory.ts
46
+ var MemoryType = {
47
+ SHORT_TERM: "short-term",
48
+ LONG_TERM: "long-term",
49
+ WORKING: "working",
50
+ EPISODIC: "episodic",
51
+ SUMMARY: "summary"
52
+ };
53
+ var SensitivityLevel = {
54
+ PUBLIC: "public",
55
+ INTERNAL: "internal",
56
+ SECRET: "secret"
57
+ };
58
+ var RAGStrategy = {
59
+ NAIVE: "naive",
60
+ GRAPH: "graph",
61
+ HYBRID: "hybrid"
62
+ };
63
+ var DEPRECATED_RAG_STRATEGIES = /* @__PURE__ */ new Map([
64
+ ["agentic", "strategy.deprecated:agentic \u2014 removed in v0.26, use hybrid"]
65
+ ]);
66
+ var VectorProvider = {
67
+ LANCEDB: "lancedb"
68
+ };
69
+ var EmbeddingProviderName = {
70
+ STUB: "stub",
71
+ /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
72
+ ANTHROPIC: "anthropic",
73
+ /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
74
+ OPENAI: "openai",
75
+ /** In-process ONNX model (default: EmbeddingGemma-300M). */
76
+ LOCAL: "local",
77
+ /** Remote OpenAI-compatible embedding service (pyx-cloud shared, custom, etc.). */
78
+ HTTP: "http"
79
+ };
80
+ var StoreTarget = {
81
+ SQLITE: "sqlite",
82
+ VECTOR: "vector",
83
+ GRAPH: "graph"
84
+ };
85
+
86
+ // ../shared/src/types/move.ts
87
+ var MoveFailureReason = {
88
+ /** Entry not found in the caller's tenant. */
89
+ NOT_FOUND: "not_found",
90
+ /** Move would cross tenant boundary (always forbidden). */
91
+ CROSS_TENANT_FORBIDDEN: "cross_tenant_forbidden",
92
+ /** Target namespace ID does not exist in the caller's tenant. */
93
+ TARGET_NAMESPACE_NOT_FOUND: "target_namespace_not_found",
94
+ /** SQLite metadata update failed; no compensation needed. */
95
+ SQLITE_UPDATE_FAILED: "sqlite_update_failed",
96
+ /** Vector store metadata update failed; SQLite reverted. */
97
+ VECTOR_UPDATE_FAILED: "vector_update_failed",
98
+ /** Graph edge namespace update failed; SQLite + vector reverted. */
99
+ GRAPH_UPDATE_FAILED: "graph_update_failed",
100
+ /** Compensation itself failed — manual intervention required. */
101
+ COMPENSATION_FAILED: "compensation_failed"
102
+ };
103
+
104
+ // ../shared/src/types/principal.ts
105
+ var SINGLE_TENANT_ID = "_single";
106
+
107
+ export {
108
+ __export,
109
+ DEFAULTS,
110
+ mergeExtractedEntities,
111
+ NamespaceIsolation,
112
+ MemoryType,
113
+ SensitivityLevel,
114
+ RAGStrategy,
115
+ DEPRECATED_RAG_STRATEGIES,
116
+ VectorProvider,
117
+ EmbeddingProviderName,
118
+ StoreTarget,
119
+ MoveFailureReason,
120
+ SINGLE_TENANT_ID
121
+ };
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- __export
4
- } from "../chunk-7P6ASYW6.mjs";
3
+ __export,
4
+ mergeExtractedEntities
5
+ } from "../chunk-SSUYQJUI.mjs";
5
6
 
6
7
  // src/cli/exit-codes.ts
7
8
  var EXIT = {
@@ -337,7 +338,7 @@ async function readSingleLineFromStdin() {
337
338
 
338
339
  // src/cli/commands/login.ts
339
340
  var DEFAULT_ENDPOINT = "https://memory.api.pyxmate.com";
340
- var PROBE_PATH = "/api/memory/stats";
341
+ var PROBE_PATH = "/api/memory/stats?graphVisibility=raw";
341
342
  var PROBE_TIMEOUT_MS = 8e3;
342
343
  async function loginCommand(opts = {}) {
343
344
  const provider = opts.keychain ?? getDefaultKeychain();
@@ -15333,11 +15334,66 @@ var listMemoriesTool = {
15333
15334
  }
15334
15335
  };
15335
15336
 
15337
+ // src/mcp/tools/profile.ts
15338
+ var getInputShape = {
15339
+ namespaceId: external_exports.string().min(1).describe("Namespace id whose user-profile to fetch."),
15340
+ ...scopeShape
15341
+ };
15342
+ var getUserProfileTool = {
15343
+ name: "get_user_profile",
15344
+ config: {
15345
+ title: "Get pyx-memory user profile",
15346
+ description: "Fetch the current user-profile snapshot for a namespace. HTTP proxy to GET /api/memory/profile/user \u2014 returns `{content, updatedAt, contentSize}` or a not-found error.",
15347
+ inputSchema: getInputShape,
15348
+ annotations: { readOnlyHint: true, openWorldHint: true }
15349
+ },
15350
+ handler: (deps) => async (raw) => {
15351
+ const args = raw;
15352
+ const creds = await deps.readCredentials();
15353
+ if (!creds.ok) return creds.result;
15354
+ const http = createHttpClient(creds.credentials, deps.fetchImpl);
15355
+ const res = await http.requestJson({
15356
+ method: "GET",
15357
+ path: "/api/memory/profile/user",
15358
+ query: { namespaceId: args.namespaceId },
15359
+ scope: args
15360
+ });
15361
+ return res.ok ? mcpJson(res.data) : res.result;
15362
+ }
15363
+ };
15364
+ var upsertInputShape = {
15365
+ namespaceId: external_exports.string().min(1).describe("Namespace id to upsert the user-profile into."),
15366
+ content: external_exports.string().min(1).describe("Full freeform profile content (UTF-8, \u22648192 bytes; server enforces the cap)."),
15367
+ ...scopeShape
15368
+ };
15369
+ var upsertUserProfileTool = {
15370
+ name: "upsert_user_profile",
15371
+ config: {
15372
+ title: "Upsert pyx-memory user profile",
15373
+ description: "Upsert the user-profile snapshot for a namespace. HTTP proxy to PUT /api/memory/profile/user \u2014 returns `{updatedAt, contentSize}`. Idempotent: re-upsert preserves `createdAt` and refreshes `updatedAt`.",
15374
+ inputSchema: upsertInputShape,
15375
+ annotations: { readOnlyHint: false, openWorldHint: true }
15376
+ },
15377
+ handler: (deps) => async (raw) => {
15378
+ const args = raw;
15379
+ const creds = await deps.readCredentials();
15380
+ if (!creds.ok) return creds.result;
15381
+ const http = createHttpClient(creds.credentials, deps.fetchImpl);
15382
+ const res = await http.requestJson({
15383
+ method: "PUT",
15384
+ path: "/api/memory/profile/user",
15385
+ body: { namespaceId: args.namespaceId, content: args.content },
15386
+ scope: args
15387
+ });
15388
+ return res.ok ? mcpJson(res.data) : res.result;
15389
+ }
15390
+ };
15391
+
15336
15392
  // src/mcp/tools/search.ts
15337
15393
  var inputShape5 = {
15338
15394
  query: external_exports.string().min(1).describe("Required natural-language search text."),
15339
15395
  limit: external_exports.number().int().min(1).max(100).optional().describe("Maximum results; server clamps to 1\u2013100. Default 5."),
15340
- strategy: external_exports.enum(["naive", "graph", "agentic", "hybrid"]).optional().describe(
15396
+ strategy: external_exports.enum(["naive", "graph", "hybrid"]).optional().describe(
15341
15397
  "RAG strategy. Server default is `naive`; use `hybrid` for cross-encoder reranking, multi-entity decomposition, and confidence scoring."
15342
15398
  ),
15343
15399
  type: external_exports.enum(["short-term", "long-term", "working", "episodic", "summary"]).optional().describe("Filter by memory type."),
@@ -15400,9 +15456,6 @@ var statusTool = {
15400
15456
  }
15401
15457
  };
15402
15458
 
15403
- // src/mcp/tools/store.ts
15404
- import { mergeExtractedEntities } from "@pyx-memory/shared";
15405
-
15406
15459
  // src/mcp/extraction-prompt.ts
15407
15460
  var ENTITY_TYPES = ["PERSON", "ORGANIZATION", "CONCEPT", "TOOL", "LOCATION", "EVENT"];
15408
15461
  var RELATION_TYPES = [
@@ -15616,14 +15669,16 @@ var ALL_TOOLS = [
15616
15669
  deleteMemoryTool,
15617
15670
  ingestMemoryFileTool,
15618
15671
  summarizeMemoryEntityTool,
15619
- statusTool
15672
+ statusTool,
15673
+ getUserProfileTool,
15674
+ upsertUserProfileTool
15620
15675
  ];
15621
15676
  var ALL_TOOL_NAMES = ALL_TOOLS.map((t) => t.name);
15622
15677
 
15623
15678
  // src/mcp/server.ts
15624
15679
  async function runMcpServer(opts) {
15625
15680
  const fetchImpl = opts.fetchImpl ?? fetch;
15626
- const version2 = opts.version ?? (true ? "0.26.0" : "0.0.0-dev");
15681
+ const version2 = opts.version ?? (true ? "0.26.3" : "0.0.0-dev");
15627
15682
  const server = new McpServer(
15628
15683
  { name: "pyx-memory", version: version2 },
15629
15684
  { instructions: PYX_MEMORY_INSTRUCTIONS, capabilities: { tools: {} } }
@@ -11,9 +11,9 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-47O2JYAP.mjs";
15
- import "./chunk-N6IRAUXH.mjs";
16
- import "./chunk-7P6ASYW6.mjs";
14
+ } from "./chunk-4BJCSQOO.mjs";
15
+ import "./chunk-5X2HOMDQ.mjs";
16
+ import "./chunk-SSUYQJUI.mjs";
17
17
  export {
18
18
  DashboardClient,
19
19
  Poller,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StoreInput as StoreInput$1, MemoryEntry as MemoryEntry$1, MemorySearchParams as MemorySearchParams$1, MemorySearchResult as MemorySearchResult$1, MemoryType as MemoryType$1, PrincipalContext as PrincipalContext$1, MemoryStats as MemoryStats$1, WikiLintReport as WikiLintReport$1, ExtractedImageMeta as ExtractedImageMeta$1, IngestEntity as IngestEntity$1, IngestRelationship as IngestRelationship$1, EntityExtractionResult as EntityExtractionResult$1, Topology as Topology$1, IngestEvent as IngestEvent$1, GraphNode as GraphNode$1, GraphTraversalResult as GraphTraversalResult$1 } from '@pyx-memory/shared';
1
+ import { StoreInput as StoreInput$1, MemoryEntry as MemoryEntry$1, MemorySearchParams as MemorySearchParams$1, MemorySearchResult as MemorySearchResult$1, MemoryType as MemoryType$1, PrincipalContext as PrincipalContext$1, MemoryStats as MemoryStats$1, WikiLintReport as WikiLintReport$1, GraphRepairResult as GraphRepairResult$1, ExtractedImageMeta as ExtractedImageMeta$1, IngestEntity as IngestEntity$1, IngestRelationship as IngestRelationship$1, EntityExtractionResult as EntityExtractionResult$1, Topology as Topology$1, IngestEvent as IngestEvent$1, GraphNode as GraphNode$1, GraphTraversalResult as GraphTraversalResult$1 } from '@pyx-memory/shared';
2
2
 
3
3
  /** Parameters for paginated entry listing. */
4
4
  interface MemoryListParams {
@@ -56,6 +56,11 @@ interface MemoryLogFilters {
56
56
  /** Options for scoping operations to a specific tenant. */
57
57
  interface TenantScopeOptions {
58
58
  tenantId?: string;
59
+ /**
60
+ * Graph count mode for stats(). Use raw on liveness/admin-health paths
61
+ * that should avoid the visible graph projection.
62
+ */
63
+ graphVisibility?: 'visible' | 'raw';
59
64
  /**
60
65
  * Calling principal. When supplied alongside or instead of tenantId,
61
66
  * the operation applies the AuthzPlan visibility filter — get/delete
@@ -111,6 +116,8 @@ interface ExtendedMemoryInterface extends MemoryInterface {
111
116
  reindex(): Promise<void>;
112
117
  /** Delete all entries matching a source, cleaning up all stores. */
113
118
  deleteBySource(source: string): Promise<number>;
119
+ /** Repair stale graph references left by older delete paths or crashed cleanup. */
120
+ repairGraph(): Promise<GraphRepairResult$1>;
114
121
  /**
115
122
  * Chronological feed of memory entries (Karpathy `log.md` primitive).
116
123
  * Cursor-based via `since` (created_at lower bound). No totalCount.
@@ -248,7 +255,7 @@ declare class MemoryClient implements ExtendedMemoryInterface {
248
255
  get(id: string): Promise<MemoryEntry$1 | null>;
249
256
  delete(id: string): Promise<boolean>;
250
257
  clearSession(sessionId: string): Promise<number>;
251
- stats(): Promise<MemoryStats$1>;
258
+ stats(options?: TenantScopeOptions): Promise<MemoryStats$1>;
252
259
  /**
253
260
  * Fetch the running server's topology snapshot (build variant, declared
254
261
  * role, embedding location, active model profile). Round-trips the
@@ -319,6 +326,8 @@ declare class MemoryClient implements ExtendedMemoryInterface {
319
326
  stats: {
320
327
  nodeCount: number;
321
328
  edgeCount: number;
329
+ rawNodeCount: number;
330
+ rawEdgeCount: number;
322
331
  };
323
332
  }>;
324
333
  graphQuery(query: {
@@ -334,12 +343,37 @@ declare class MemoryClient implements ExtendedMemoryInterface {
334
343
  runDecay(): Promise<number>;
335
344
  reindex(): Promise<void>;
336
345
  clearGraph(): Promise<number>;
346
+ repairGraph(): Promise<GraphRepairResult$1>;
337
347
  deleteBySource(source: string): Promise<number>;
338
348
  queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
339
349
  log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
340
350
  queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
341
351
  summarizeEntity(name: string): Promise<MemoryEntry$1>;
342
352
  getEntitySynthesis(name: string): Promise<MemoryEntry$1 | null>;
353
+ /**
354
+ * v0.26 user-profile snapshot — upsert. The server derives `userId`
355
+ * from `X-User-Id` (caller wires it via `defaultHeaders` on the
356
+ * client constructor or per-request middleware); the body cannot
357
+ * override it. See spec §Requirements 10.
358
+ */
359
+ upsertUserProfile(input: {
360
+ namespaceId: string;
361
+ content: string;
362
+ }): Promise<{
363
+ updatedAt: string;
364
+ contentSize: number;
365
+ }>;
366
+ /**
367
+ * v0.26 user-profile snapshot — fetch by namespace. Returns `null` on
368
+ * HTTP 404 (`isNotFound`), rethrows any other non-2xx as
369
+ * `MemoryServerError`. Mirrors `get()`'s 404-to-null pattern so callers
370
+ * can branch on "no profile yet" without inspecting status codes.
371
+ */
372
+ getUserProfile(namespaceId: string): Promise<{
373
+ content: string;
374
+ updatedAt: string;
375
+ contentSize: number;
376
+ } | null>;
343
377
  protected fetchApi<T>(path: string, options?: RequestInit): Promise<T>;
344
378
  /**
345
379
  * Map fetch-layer rejections into a typed `MemoryServerError` so callers
@@ -388,10 +422,20 @@ type SensitivityLevel = (typeof SensitivityLevel)[keyof typeof SensitivityLevel]
388
422
  declare const RAGStrategy: {
389
423
  readonly NAIVE: "naive";
390
424
  readonly GRAPH: "graph";
391
- readonly AGENTIC: "agentic";
392
425
  readonly HYBRID: "hybrid";
393
426
  };
394
427
  type RAGStrategy = (typeof RAGStrategy)[keyof typeof RAGStrategy];
428
+ /**
429
+ * Strategy identifiers that were public in earlier versions and have been
430
+ * removed. Server/SDK reject requests using these with a stable
431
+ * `strategy.deprecated:<name>` error code (not the generic "invalid
432
+ * strategy" message) so callers and dashboards can detect the removal
433
+ * cleanly across a version bump.
434
+ *
435
+ * v0.26: `agentic` removed (Codex pair: silent-catch in agentic.ts
436
+ * violated Production-ready; behavior subsumed by HybridRAGEngine).
437
+ */
438
+ declare const DEPRECATED_RAG_STRATEGIES: ReadonlyMap<string, string>;
395
439
  declare const VectorProvider: {
396
440
  readonly LANCEDB: "lancedb";
397
441
  };
@@ -634,11 +678,20 @@ interface MemoryStats {
634
678
  recentAccessCount: number;
635
679
  graphNodeCount?: number;
636
680
  graphEdgeCount?: number;
681
+ /** Raw graph node count before tenant/ReBAC visibility filtering. */
682
+ graphRawNodeCount?: number;
683
+ /** Raw graph edge count before tenant/ReBAC visibility filtering. */
684
+ graphRawEdgeCount?: number;
637
685
  /** Name of the active graph store ('neo4j', 'sqlite', or undefined if none). */
638
686
  graphStore?: string;
639
687
  /** Whether the memory service is connected. False when using DisabledMemory. */
640
688
  connected?: boolean;
641
689
  }
690
+ interface GraphRepairResult {
691
+ staleEdgesDeleted: number;
692
+ staleNodeRefsRemoved: number;
693
+ orphanNodesDeleted: number;
694
+ }
642
695
  interface GraphNode {
643
696
  id: string;
644
697
  name: string;
@@ -1036,4 +1089,4 @@ interface PrincipalContext {
1036
1089
  /** Sentinel tenant ID used in single-tenant deployments. */
1037
1090
  declare const SINGLE_TENANT_ID = "_single";
1038
1091
 
1039
- export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, SINGLE_TENANT_ID, SensitivityLevel, type StoreInput, StoreTarget, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyServiceVariant, VectorProvider, type WikiLintReport, mergeExtractedEntities };
1092
+ export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, DEPRECATED_RAG_STRATEGIES, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphRepairResult, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, SINGLE_TENANT_ID, SensitivityLevel, type StoreInput, StoreTarget, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyServiceVariant, VectorProvider, type WikiLintReport, mergeExtractedEntities };
package/dist/index.mjs CHANGED
@@ -1,108 +1,24 @@
1
1
  import {
2
2
  MemoryClient,
3
3
  MemoryServerError
4
- } from "./chunk-N6IRAUXH.mjs";
5
- import "./chunk-7P6ASYW6.mjs";
6
-
7
- // ../shared/src/constants/defaults.ts
8
- var DEFAULTS = {
9
- DATA_DIR: "./data",
10
- VECTOR_PROVIDER: "lancedb",
11
- MEMORY_SERVER_PORT: 7822
12
- };
13
-
14
- // ../shared/src/graph/extraction.ts
15
- function mergeExtractedEntities(callerEntities, callerRelationships, extracted) {
16
- const entities = [...callerEntities ?? []];
17
- const relationships = [...callerRelationships ?? []];
18
- const nameByLowercase = /* @__PURE__ */ new Map();
19
- for (const entity of entities) {
20
- const key = entity.name.toLowerCase();
21
- if (!nameByLowercase.has(key)) nameByLowercase.set(key, entity.name);
22
- }
23
- for (const entity of extracted.entities) {
24
- const key = entity.name.toLowerCase();
25
- if (nameByLowercase.has(key)) continue;
26
- entities.push(entity);
27
- nameByLowercase.set(key, entity.name);
28
- }
29
- for (const relationship of extracted.relations) {
30
- const source = nameByLowercase.get(relationship.source.toLowerCase());
31
- const target = nameByLowercase.get(relationship.target.toLowerCase());
32
- if (source && target) {
33
- relationships.push({ ...relationship, source, target });
34
- }
35
- }
36
- return { entities, relationships };
37
- }
38
-
39
- // ../shared/src/types/isolation.ts
40
- var NamespaceIsolation = {
41
- SHARED: "shared",
42
- STRICT: "strict"
43
- };
44
-
45
- // ../shared/src/types/memory.ts
46
- var MemoryType = {
47
- SHORT_TERM: "short-term",
48
- LONG_TERM: "long-term",
49
- WORKING: "working",
50
- EPISODIC: "episodic",
51
- SUMMARY: "summary"
52
- };
53
- var SensitivityLevel = {
54
- PUBLIC: "public",
55
- INTERNAL: "internal",
56
- SECRET: "secret"
57
- };
58
- var RAGStrategy = {
59
- NAIVE: "naive",
60
- GRAPH: "graph",
61
- AGENTIC: "agentic",
62
- HYBRID: "hybrid"
63
- };
64
- var VectorProvider = {
65
- LANCEDB: "lancedb"
66
- };
67
- var EmbeddingProviderName = {
68
- STUB: "stub",
69
- /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
70
- ANTHROPIC: "anthropic",
71
- /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
72
- OPENAI: "openai",
73
- /** In-process ONNX model (default: EmbeddingGemma-300M). */
74
- LOCAL: "local",
75
- /** Remote OpenAI-compatible embedding service (pyx-cloud shared, custom, etc.). */
76
- HTTP: "http"
77
- };
78
- var StoreTarget = {
79
- SQLITE: "sqlite",
80
- VECTOR: "vector",
81
- GRAPH: "graph"
82
- };
83
-
84
- // ../shared/src/types/move.ts
85
- var MoveFailureReason = {
86
- /** Entry not found in the caller's tenant. */
87
- NOT_FOUND: "not_found",
88
- /** Move would cross tenant boundary (always forbidden). */
89
- CROSS_TENANT_FORBIDDEN: "cross_tenant_forbidden",
90
- /** Target namespace ID does not exist in the caller's tenant. */
91
- TARGET_NAMESPACE_NOT_FOUND: "target_namespace_not_found",
92
- /** SQLite metadata update failed; no compensation needed. */
93
- SQLITE_UPDATE_FAILED: "sqlite_update_failed",
94
- /** Vector store metadata update failed; SQLite reverted. */
95
- VECTOR_UPDATE_FAILED: "vector_update_failed",
96
- /** Graph edge namespace update failed; SQLite + vector reverted. */
97
- GRAPH_UPDATE_FAILED: "graph_update_failed",
98
- /** Compensation itself failed — manual intervention required. */
99
- COMPENSATION_FAILED: "compensation_failed"
100
- };
101
-
102
- // ../shared/src/types/principal.ts
103
- var SINGLE_TENANT_ID = "_single";
4
+ } from "./chunk-5X2HOMDQ.mjs";
5
+ import {
6
+ DEFAULTS,
7
+ DEPRECATED_RAG_STRATEGIES,
8
+ EmbeddingProviderName,
9
+ MemoryType,
10
+ MoveFailureReason,
11
+ NamespaceIsolation,
12
+ RAGStrategy,
13
+ SINGLE_TENANT_ID,
14
+ SensitivityLevel,
15
+ StoreTarget,
16
+ VectorProvider,
17
+ mergeExtractedEntities
18
+ } from "./chunk-SSUYQJUI.mjs";
104
19
  export {
105
20
  DEFAULTS,
21
+ DEPRECATED_RAG_STRATEGIES,
106
22
  EmbeddingProviderName,
107
23
  MemoryClient,
108
24
  MemoryServerError,
package/dist/react.mjs CHANGED
@@ -11,9 +11,9 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-47O2JYAP.mjs";
15
- import "./chunk-N6IRAUXH.mjs";
16
- import "./chunk-7P6ASYW6.mjs";
14
+ } from "./chunk-4BJCSQOO.mjs";
15
+ import "./chunk-5X2HOMDQ.mjs";
16
+ import "./chunk-SSUYQJUI.mjs";
17
17
 
18
18
  // ../dashboard/src/hooks/use-consolidation-log.ts
19
19
  import { useCallback as useCallback2, useMemo } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyxmate/memory",
3
- "version": "0.26.0",
3
+ "version": "0.26.3",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",
@@ -57,10 +57,10 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
- "@napi-rs/keyring": "^1.3.0",
61
- "@pyx-memory/shared": "workspace:*"
60
+ "@napi-rs/keyring": "^1.3.0"
62
61
  },
63
62
  "devDependencies": {
63
+ "@pyx-memory/shared": "workspace:*",
64
64
  "tsup": "^8.4.0"
65
65
  }
66
66
  }
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };