@pyxmate/memory 1.19.9 → 1.20.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.
@@ -101,6 +101,51 @@ function mergeExtractedEntities(callerEntities, callerRelationships, extracted)
101
101
  return { entities, relationships: dedupedRelationships };
102
102
  }
103
103
 
104
+ // ../shared/src/types/memory.ts
105
+ var MemoryType = {
106
+ SHORT_TERM: "short-term",
107
+ LONG_TERM: "long-term",
108
+ WORKING: "working",
109
+ EPISODIC: "episodic",
110
+ SUMMARY: "summary"
111
+ };
112
+ var SensitivityLevel = {
113
+ PUBLIC: "public",
114
+ INTERNAL: "internal",
115
+ SECRET: "secret"
116
+ };
117
+ var RAGStrategy = {
118
+ NAIVE: "naive",
119
+ GRAPH: "graph",
120
+ HYBRID: "hybrid"
121
+ };
122
+ var DEPRECATED_RAG_STRATEGIES = /* @__PURE__ */ new Map([
123
+ ["agentic", "strategy.deprecated:agentic \u2014 removed in v0.26, use hybrid"]
124
+ ]);
125
+ var VectorProvider = {
126
+ LANCEDB: "lancedb"
127
+ };
128
+ var EmbeddingProviderName = {
129
+ STUB: "stub",
130
+ /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
131
+ ANTHROPIC: "anthropic",
132
+ /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
133
+ OPENAI: "openai",
134
+ /** In-process ONNX model (default: EmbeddingGemma-300M). */
135
+ LOCAL: "local",
136
+ /** Remote OpenAI-compatible embedding service (pyx-cloud shared, custom, etc.). */
137
+ HTTP: "http"
138
+ };
139
+ var SESSION_ORDINAL_MAX = Number.MAX_SAFE_INTEGER - 2;
140
+ function isSessionOrdinal(value) {
141
+ return Number.isSafeInteger(value) && value >= 0 && value <= SESSION_ORDINAL_MAX;
142
+ }
143
+ var StoreTarget = {
144
+ SQLITE: "sqlite",
145
+ VECTOR: "vector",
146
+ GRAPH: "graph"
147
+ };
148
+
104
149
  // ../shared/src/data-plane-contract.ts
105
150
  import { createHash } from "crypto";
106
151
  var DATA_PLANE_CONTRACT_VERSION = "pyx-data-plane-contract-v1";
@@ -155,6 +200,7 @@ var DATA_PLANE_OPERATION_COVERAGE = {
155
200
  support: "journal_multi_step"
156
201
  },
157
202
  "rest:get": { support: "sqlite_atomic_one_step" },
203
+ "rest:expand": { support: "sqlite_atomic_one_step" },
158
204
  "rest:delete": {
159
205
  support: "journal_multi_step"
160
206
  },
@@ -182,6 +228,7 @@ var DATA_PLANE_OPERATION_COVERAGE = {
182
228
  support: "journal_multi_step"
183
229
  },
184
230
  "mcp:get_memory": { support: "sqlite_atomic_one_step" },
231
+ "mcp:expand_memories": { support: "sqlite_atomic_one_step" },
185
232
  "mcp:lineage": {
186
233
  support: "journal_multi_step"
187
234
  },
@@ -461,6 +508,44 @@ function normalizeGet(input) {
461
508
  id: requireString(value.id, "input.id", { maxBytes: DATA_PLANE_COMPILER_LIMITS.identityBytes })
462
509
  };
463
510
  }
511
+ var EXPAND_BASE_MAX = 200;
512
+ function requireExpandIds(value, field, maximum) {
513
+ if (!Array.isArray(value) || value.length < 1 || value.length > maximum) {
514
+ throw new Error(`expand_input_invalid: ${field} must list 1 to ${maximum} entry ids`);
515
+ }
516
+ const ids = [];
517
+ const seen = /* @__PURE__ */ new Set();
518
+ for (const [index, id] of value.entries()) {
519
+ if (typeof id !== "string" || id.length === 0 || !id.isWellFormed() || Buffer.byteLength(id, "utf8") > DATA_PLANE_COMPILER_LIMITS.identityBytes) {
520
+ throw new Error(
521
+ `expand_input_invalid: ${field}[${index}] must be a non-empty entry id of at most ${DATA_PLANE_COMPILER_LIMITS.identityBytes} UTF-8 bytes`
522
+ );
523
+ }
524
+ if (seen.has(id)) throw new Error(`expand_input_invalid: ${field}[${index}] repeats an id`);
525
+ seen.add(id);
526
+ ids.push(id);
527
+ }
528
+ return ids;
529
+ }
530
+ function normalizeExpand(input) {
531
+ const value = requireObject(input, "input");
532
+ requireExactKeys(value, ["baseEntryIds", "anchorEntryIds"], "input");
533
+ const baseEntryIds = requireExpandIds(value.baseEntryIds, "input.baseEntryIds", EXPAND_BASE_MAX);
534
+ const anchorEntryIds = requireExpandIds(
535
+ value.anchorEntryIds,
536
+ "input.anchorEntryIds",
537
+ baseEntryIds.length
538
+ );
539
+ const base = new Set(baseEntryIds);
540
+ for (const [index, id] of anchorEntryIds.entries()) {
541
+ if (!base.has(id)) {
542
+ throw new Error(
543
+ `expand_input_invalid: input.anchorEntryIds[${index}] is not in input.baseEntryIds`
544
+ );
545
+ }
546
+ }
547
+ return { baseEntryIds, anchorEntryIds };
548
+ }
464
549
  var CALLER_ENTRY_ID_RESERVED_PREFIXES = ["synthesis:", "user-profile:", "correction:"];
465
550
  function optionalCallerEntryId(value, field) {
466
551
  if (value === void 0) return void 0;
@@ -699,6 +784,7 @@ function canonicalizeStorePayload(input, resolvedAt, mcp, compileAdmission) {
699
784
  "agentId",
700
785
  "namespaceId",
701
786
  "sessionId",
787
+ "sessionOrdinal",
702
788
  "parentId",
703
789
  "entities",
704
790
  "relationships",
@@ -723,6 +809,19 @@ function canonicalizeStorePayload(input, resolvedAt, mcp, compileAdmission) {
723
809
  withOptional(normalized, "source", optionalNonemptyString(value.source, "input.source"));
724
810
  withOptional(normalized, "agentId", optionalNonemptyString(value.agentId, "input.agentId"));
725
811
  withOptional(normalized, "sessionId", optionalNonemptyString(value.sessionId, "input.sessionId"));
812
+ if (value.sessionOrdinal !== void 0) {
813
+ if (!isSessionOrdinal(value.sessionOrdinal)) {
814
+ throw new Error(
815
+ `session_ordinal_invalid: input.sessionOrdinal must be an integer between 0 and ${SESSION_ORDINAL_MAX}`
816
+ );
817
+ }
818
+ if (normalized.sessionId === void 0 && normalized.id === void 0) {
819
+ throw new Error(
820
+ "session_ordinal_requires_session_id: input.sessionOrdinal needs input.sessionId"
821
+ );
822
+ }
823
+ normalized.sessionOrdinal = value.sessionOrdinal;
824
+ }
726
825
  withOptional(normalized, "parentId", optionalNonemptyString(value.parentId, "input.parentId"));
727
826
  withOptional(
728
827
  normalized,
@@ -1034,6 +1133,9 @@ function normalizeSupportedInput(operation, input, context) {
1034
1133
  return normalizeGet(input);
1035
1134
  case "mcp:get_memory":
1036
1135
  return normalizeGet(input);
1136
+ case "rest:expand":
1137
+ case "mcp:expand_memories":
1138
+ return normalizeExpand(input);
1037
1139
  case "mcp:list_memories":
1038
1140
  return normalizeMcpList(input, defaultAgentId);
1039
1141
  case "mcp:get_user_profile":
@@ -1392,6 +1494,15 @@ export {
1392
1494
  normalizeNameKey,
1393
1495
  assertGraphExtractionPayload,
1394
1496
  mergeExtractedEntities,
1497
+ MemoryType,
1498
+ SensitivityLevel,
1499
+ RAGStrategy,
1500
+ DEPRECATED_RAG_STRATEGIES,
1501
+ VectorProvider,
1502
+ EmbeddingProviderName,
1503
+ SESSION_ORDINAL_MAX,
1504
+ isSessionOrdinal,
1505
+ StoreTarget,
1395
1506
  DATA_PLANE_CONTRACT_VERSION,
1396
1507
  DATA_PLANE_CATALOG_VERSION,
1397
1508
  DATA_PLANE_MANIFEST_VERSION,
@@ -1,10 +1,8 @@
1
1
  import {
2
- RAGStrategy
3
- } from "./chunk-KVYCISUI.mjs";
4
- import {
2
+ RAGStrategy,
5
3
  assertGraphExtractionPayload,
6
4
  mergeExtractedEntities
7
- } from "./chunk-VORP6NHJ.mjs";
5
+ } from "./chunk-BUKDWHTY.mjs";
8
6
 
9
7
  // ../client/src/disabled-memory.ts
10
8
  var DEFAULT_PAGE_LIMIT = 20;
@@ -117,47 +117,6 @@ var NamespaceIsolation = {
117
117
  STRICT: "strict"
118
118
  };
119
119
 
120
- // ../shared/src/types/memory.ts
121
- var MemoryType = {
122
- SHORT_TERM: "short-term",
123
- LONG_TERM: "long-term",
124
- WORKING: "working",
125
- EPISODIC: "episodic",
126
- SUMMARY: "summary"
127
- };
128
- var SensitivityLevel = {
129
- PUBLIC: "public",
130
- INTERNAL: "internal",
131
- SECRET: "secret"
132
- };
133
- var RAGStrategy = {
134
- NAIVE: "naive",
135
- GRAPH: "graph",
136
- HYBRID: "hybrid"
137
- };
138
- var DEPRECATED_RAG_STRATEGIES = /* @__PURE__ */ new Map([
139
- ["agentic", "strategy.deprecated:agentic \u2014 removed in v0.26, use hybrid"]
140
- ]);
141
- var VectorProvider = {
142
- LANCEDB: "lancedb"
143
- };
144
- var EmbeddingProviderName = {
145
- STUB: "stub",
146
- /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
147
- ANTHROPIC: "anthropic",
148
- /** @deprecated Vestigial — pyx-memory uses internal EmbeddingGemma embeddings. */
149
- OPENAI: "openai",
150
- /** In-process ONNX model (default: EmbeddingGemma-300M). */
151
- LOCAL: "local",
152
- /** Remote OpenAI-compatible embedding service (pyx-cloud shared, custom, etc.). */
153
- HTTP: "http"
154
- };
155
- var StoreTarget = {
156
- SQLITE: "sqlite",
157
- VECTOR: "vector",
158
- GRAPH: "graph"
159
- };
160
-
161
120
  // ../shared/src/types/move.ts
162
121
  var MoveFailureReason = {
163
122
  /** Entry not found in the caller's tenant. */
@@ -173,7 +132,9 @@ var MoveFailureReason = {
173
132
  /** Graph edge namespace update failed; SQLite + vector reverted. */
174
133
  GRAPH_UPDATE_FAILED: "graph_update_failed",
175
134
  /** Compensation itself failed — manual intervention required. */
176
- COMPENSATION_FAILED: "compensation_failed"
135
+ COMPENSATION_FAILED: "compensation_failed",
136
+ /** Target namespace already holds the entry's (session, ordinal) coordinate; nothing moved. */
137
+ SESSION_ORDINAL_CONFLICT: "session_ordinal_conflict"
177
138
  };
178
139
 
179
140
  // ../shared/src/types/principal.ts
@@ -194,13 +155,6 @@ export {
194
155
  withSecretElevationNotice,
195
156
  secretElevationAggregate,
196
157
  NamespaceIsolation,
197
- MemoryType,
198
- SensitivityLevel,
199
- RAGStrategy,
200
- DEPRECATED_RAG_STRATEGIES,
201
- VectorProvider,
202
- EmbeddingProviderName,
203
- StoreTarget,
204
158
  MoveFailureReason,
205
159
  SINGLE_TENANT_ID
206
160
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MemoryClient
3
- } from "./chunk-LWFCE4OS.mjs";
3
+ } from "./chunk-HVJZDJGH.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -9,8 +9,8 @@ import {
9
9
  TAXONOMY_MAX_PROJECTS,
10
10
  TAXONOMY_MAX_SAMPLE_TOPICS,
11
11
  TAXONOMY_MAX_TOP_ENTITIES
12
- } from "../chunk-KVYCISUI.mjs";
13
- import "../chunk-VORP6NHJ.mjs";
12
+ } from "../chunk-KZKGRND2.mjs";
13
+ import "../chunk-BUKDWHTY.mjs";
14
14
 
15
15
  // src/cli/exit-codes.ts
16
16
  var EXIT = {
@@ -1086,7 +1086,7 @@ function createProxyServer(client, version, uploadLocalFile) {
1086
1086
  return server;
1087
1087
  }
1088
1088
  async function runMcpProxyServer(opts) {
1089
- const version = opts.version ?? (true ? "1.19.9" : "0.0.0-dev");
1089
+ const version = opts.version ?? (true ? "1.20.0" : "0.0.0-dev");
1090
1090
  const read = await opts.readCredentials();
1091
1091
  if (!read.ok) {
1092
1092
  const text = read.result.content.map((c) => c.type === "text" ? c.text : "").join(" ").trim();
@@ -11,10 +11,10 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-FIRMGTFX.mjs";
15
- import "./chunk-LWFCE4OS.mjs";
16
- import "./chunk-KVYCISUI.mjs";
17
- import "./chunk-VORP6NHJ.mjs";
14
+ } from "./chunk-QWLTZIIK.mjs";
15
+ import "./chunk-HVJZDJGH.mjs";
16
+ import "./chunk-KZKGRND2.mjs";
17
+ import "./chunk-BUKDWHTY.mjs";
18
18
  export {
19
19
  DashboardClient,
20
20
  Poller,
@@ -120,6 +120,9 @@ declare const DATA_PLANE_OPERATION_COVERAGE: {
120
120
  readonly 'rest:get': {
121
121
  readonly support: "sqlite_atomic_one_step";
122
122
  };
123
+ readonly 'rest:expand': {
124
+ readonly support: "sqlite_atomic_one_step";
125
+ };
123
126
  readonly 'rest:delete': {
124
127
  readonly support: "journal_multi_step";
125
128
  };
@@ -149,6 +152,9 @@ declare const DATA_PLANE_OPERATION_COVERAGE: {
149
152
  readonly 'mcp:get_memory': {
150
153
  readonly support: "sqlite_atomic_one_step";
151
154
  };
155
+ readonly 'mcp:expand_memories': {
156
+ readonly support: "sqlite_atomic_one_step";
157
+ };
152
158
  readonly 'mcp:lineage': {
153
159
  readonly support: "journal_multi_step";
154
160
  };
@@ -1 +1 @@
1
- export { C as CanonicalDataPlaneObject, a as CanonicalDataPlaneValue, b as CompileContext, c as CompileDataPlaneRequest, d as CompileDataPlaneResult, f as CompiledDataPlaneExecutionPlan, D as DATA_PLANE_CATALOG_VERSION, g as DATA_PLANE_COMPILER_LIMITS, h as DATA_PLANE_CONTRACT_VERSION, i as DATA_PLANE_HTTP_RESPONSE_FRAME, j as DATA_PLANE_MANIFEST_FRAME, k as DATA_PLANE_MANIFEST_VERSION, l as DATA_PLANE_OPERATION_COVERAGE, m as DATA_PLANE_SEARCH_EMBEDDING_CONTRACT, n as DATA_PLANE_STEP_INPUT_FRAME, o as DataPlaneCatalogOperation, q as DataPlaneUnsupportedReasonCode, S as SupportedDataPlaneCatalogOperation, r as canonicalDataPlaneJson, s as compileDataPlaneRequest, t as hashDataPlaneHttpResponseV1, u as hashDataPlaneManifestV1, v as hashDataPlaneStepInputV1 } from './data-plane-contract-CmosA5XV.js';
1
+ export { C as CanonicalDataPlaneObject, a as CanonicalDataPlaneValue, b as CompileContext, c as CompileDataPlaneRequest, d as CompileDataPlaneResult, f as CompiledDataPlaneExecutionPlan, D as DATA_PLANE_CATALOG_VERSION, g as DATA_PLANE_COMPILER_LIMITS, h as DATA_PLANE_CONTRACT_VERSION, i as DATA_PLANE_HTTP_RESPONSE_FRAME, j as DATA_PLANE_MANIFEST_FRAME, k as DATA_PLANE_MANIFEST_VERSION, l as DATA_PLANE_OPERATION_COVERAGE, m as DATA_PLANE_SEARCH_EMBEDDING_CONTRACT, n as DATA_PLANE_STEP_INPUT_FRAME, o as DataPlaneCatalogOperation, q as DataPlaneUnsupportedReasonCode, S as SupportedDataPlaneCatalogOperation, r as canonicalDataPlaneJson, s as compileDataPlaneRequest, t as hashDataPlaneHttpResponseV1, u as hashDataPlaneManifestV1, v as hashDataPlaneStepInputV1 } from './data-plane-contract-webbeMs5.js';
@@ -13,7 +13,7 @@ import {
13
13
  hashDataPlaneHttpResponseV1,
14
14
  hashDataPlaneManifestV1,
15
15
  hashDataPlaneStepInputV1
16
- } from "./chunk-VORP6NHJ.mjs";
16
+ } from "./chunk-BUKDWHTY.mjs";
17
17
  export {
18
18
  DATA_PLANE_CATALOG_VERSION,
19
19
  DATA_PLANE_COMPILER_LIMITS,