@pyxmate/memory 1.26.6 → 1.27.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.
@@ -9,6 +9,8 @@ var TAXONOMY_MAX_TOP_ENTITIES = 15;
9
9
  var TAXONOMY_MAX_SAMPLE_TOPICS = 8;
10
10
  var TAXONOMY_MAX_PROJECTS = 8;
11
11
  var MEMORY_PROJECT_LABEL_MAX_CHARS = 80;
12
+ var MCP_ACTOR_META_KEY = "pyx.dev/actor";
13
+ var MEMORY_ACTOR_LABEL_MAX_CHARS = 80;
12
14
 
13
15
  // ../shared/src/document-source.ts
14
16
  import { createHash } from "crypto";
@@ -25,6 +27,13 @@ function documentImageSource(documentKey) {
25
27
  return documentSource("document-image", documentKey);
26
28
  }
27
29
 
30
+ // ../shared/src/mcp/actor.ts
31
+ function normalizeMemoryActorLabel(value) {
32
+ if (typeof value !== "string" || /[\p{Cc}\p{Cs}]/u.test(value)) return null;
33
+ const label = value.trim();
34
+ return label.length > 0 && [...label].length <= MEMORY_ACTOR_LABEL_MAX_CHARS ? label : null;
35
+ }
36
+
28
37
  // ../shared/src/mcp/search-response.ts
29
38
  var STRIPPED_ENTRY_FIELDS = /* @__PURE__ */ new Set(["contentHash", "embedding", "tenantId", "userId", "teamId"]);
30
39
  function isRecord(value) {
@@ -147,9 +156,12 @@ export {
147
156
  TAXONOMY_MAX_SAMPLE_TOPICS,
148
157
  TAXONOMY_MAX_PROJECTS,
149
158
  MEMORY_PROJECT_LABEL_MAX_CHARS,
159
+ MCP_ACTOR_META_KEY,
160
+ MEMORY_ACTOR_LABEL_MAX_CHARS,
150
161
  documentGraphSource,
151
162
  documentContentSource,
152
163
  documentImageSource,
164
+ normalizeMemoryActorLabel,
153
165
  projectSearchResponseForMcp,
154
166
  secretElevationNoticeFor,
155
167
  withSecretElevationNotice,
@@ -5,12 +5,14 @@ import {
5
5
  buildDesignGuide
6
6
  } from "../chunk-QD7G23CN.mjs";
7
7
  import {
8
+ MCP_ACTOR_META_KEY,
8
9
  MEMORY_PROJECT_LABEL_MAX_CHARS,
9
10
  TAXONOMY_MAX_CATEGORIES,
10
11
  TAXONOMY_MAX_PROJECTS,
11
12
  TAXONOMY_MAX_SAMPLE_TOPICS,
12
- TAXONOMY_MAX_TOP_ENTITIES
13
- } from "../chunk-KZKGRND2.mjs";
13
+ TAXONOMY_MAX_TOP_ENTITIES,
14
+ normalizeMemoryActorLabel
15
+ } from "../chunk-RWQTBXUC.mjs";
14
16
  import {
15
17
  HOSTED_FILE_INGEST_PROTOCOL,
16
18
  HOSTED_FILE_INGEST_RETRYABLE_CODES,
@@ -1281,15 +1283,25 @@ var insightsSchema = z.object({
1281
1283
  })
1282
1284
  ).max(5)
1283
1285
  });
1284
- var insightsResponseSchema = z.union([
1285
- insightsSchema,
1286
- z.object({ success: z.literal(true), data: insightsSchema }).transform(({ data }) => data)
1287
- ]);
1286
+ var actorSchema = z.string().refine((value) => normalizeMemoryActorLabel(value) === value).nullable().default(null);
1287
+ var insightsWithProvenanceSchema = insightsSchema.extend({
1288
+ recentApplied: z.array(
1289
+ insightsSchema.shape.recentApplied.element.extend({
1290
+ writtenBy: actorSchema,
1291
+ writtenAt: z.iso.datetime({ offset: true }).nullable().default(null),
1292
+ appliedBy: actorSchema
1293
+ })
1294
+ ).max(5)
1295
+ });
1288
1296
  async function insightsCommand(opts = {}) {
1297
+ const schema = opts.withProvenance === true ? insightsWithProvenanceSchema : insightsSchema;
1289
1298
  const result = await readSurface({
1290
1299
  surface: "insights",
1291
1300
  request: { method: "GET", path: "/api/memory/insights" },
1292
- schema: insightsResponseSchema,
1301
+ schema: z.union([
1302
+ schema,
1303
+ z.object({ success: z.literal(true), data: schema }).transform(({ data }) => data)
1304
+ ]),
1293
1305
  minimumServiceVersion: "1.19.0",
1294
1306
  keychain: opts.keychain,
1295
1307
  fetchImpl: opts.fetchImpl
@@ -2935,7 +2947,14 @@ function createProxyServer(client, version, uploadLocalFile, hostedFileIngest) {
2935
2947
  if (bridge?.kind === "local" && uploadLocalFile) {
2936
2948
  return await uploadLocalFile(bridge.descriptor, args);
2937
2949
  }
2938
- return client.callTool(req.params);
2950
+ const actor = normalizeMemoryActorLabel(server.getClientVersion()?.name);
2951
+ const params = { ...req.params };
2952
+ if (actor !== null || params._meta !== void 0) {
2953
+ params._meta = { ...params._meta };
2954
+ delete params._meta[MCP_ACTOR_META_KEY];
2955
+ if (actor !== null) params._meta[MCP_ACTOR_META_KEY] = actor;
2956
+ }
2957
+ return client.callTool(params);
2939
2958
  });
2940
2959
  }
2941
2960
  if (caps?.prompts) {
@@ -2951,7 +2970,7 @@ function createProxyServer(client, version, uploadLocalFile, hostedFileIngest) {
2951
2970
  return server;
2952
2971
  }
2953
2972
  async function runMcpProxyServer(opts) {
2954
- const version = opts.version ?? (true ? "1.26.6" : "0.0.0-dev");
2973
+ const version = opts.version ?? (true ? "1.27.0" : "0.0.0-dev");
2955
2974
  const read = await opts.readCredentials();
2956
2975
  if (!read.ok) {
2957
2976
  throw new Error(
@@ -4195,6 +4214,7 @@ Commands:
4195
4214
  status [--json] Show endpoint, key presence, MCP config status.
4196
4215
  overview --json Read memory count and three recent safe labels.
4197
4216
  insights --json [--with-identity] Read body-free memory usage and coverage aggregates.
4217
+ [--with-provenance] Add last writer, save time and applier to recent items.
4198
4218
  taxonomy --json [--with-identity] Read knowledge-graph cluster composition (read-only).
4199
4219
  --with-identity adds credentialFingerprint (the same
4200
4220
  value as status --json) so a host can tell which
@@ -4402,7 +4422,10 @@ async function main() {
4402
4422
  process.stderr.write("Error: `pyx-mem insights` requires --json.\n");
4403
4423
  return EXIT.USAGE;
4404
4424
  }
4405
- return insightsCommand({ withIdentity: parsed.flags["with-identity"] === true });
4425
+ return insightsCommand({
4426
+ withIdentity: parsed.flags["with-identity"] === true,
4427
+ withProvenance: parsed.flags["with-provenance"] === true
4428
+ });
4406
4429
  case "taxonomy":
4407
4430
  if (parsed.flags.json !== true) {
4408
4431
  process.stderr.write("Error: `pyx-mem taxonomy` requires --json.\n");
@@ -13,7 +13,7 @@ import {
13
13
  unreachableHealth
14
14
  } from "./chunk-N4KDRRLY.mjs";
15
15
  import "./chunk-M67SXB7C.mjs";
16
- import "./chunk-KZKGRND2.mjs";
16
+ import "./chunk-RWQTBXUC.mjs";
17
17
  import "./chunk-HTQBKJTD.mjs";
18
18
  export {
19
19
  DashboardClient,
package/dist/index.d.ts CHANGED
@@ -776,6 +776,9 @@ interface MemoryInsights {
776
776
  topic: string | null;
777
777
  project: string | null;
778
778
  at: string;
779
+ writtenBy?: string | null;
780
+ writtenAt?: string | null;
781
+ appliedBy?: string | null;
779
782
  }>;
780
783
  }
781
784
  interface GraphRepairResult {
@@ -1534,6 +1537,8 @@ declare const TAXONOMY_MAX_TOP_ENTITIES = 15;
1534
1537
  declare const TAXONOMY_MAX_SAMPLE_TOPICS = 8;
1535
1538
  declare const TAXONOMY_MAX_PROJECTS = 8;
1536
1539
  declare const MEMORY_PROJECT_LABEL_MAX_CHARS = 80;
1540
+ declare const MCP_ACTOR_META_KEY = "pyx.dev/actor";
1541
+ declare const MEMORY_ACTOR_LABEL_MAX_CHARS = 80;
1537
1542
 
1538
1543
  /**
1539
1544
  * Result shape returned by an LLM entity extractor — entities + relations.
@@ -1599,6 +1604,8 @@ declare function mergeExtractedEntities(callerEntities: IngestEntity[] | undefin
1599
1604
  relationships: IngestRelationship[];
1600
1605
  };
1601
1606
 
1607
+ declare function normalizeMemoryActorLabel(value: unknown): string | null;
1608
+
1602
1609
  declare function projectSearchResponseForMcp(payload: unknown): unknown;
1603
1610
 
1604
1611
  /**
@@ -2004,4 +2011,4 @@ interface CreatePyxMemoryOptions {
2004
2011
  }
2005
2012
  declare function createPyxMemory(opts?: CreatePyxMemoryOptions): MemoryClient;
2006
2013
 
2007
- export { type AgentId, type ApiResponse, type ConsolidationJudgementsResult, type ConsolidationMerge, type ConsolidationPair, type ConsolidationPairSide, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, type DueScanInput, EmbeddingProviderName, type EnrichmentCallbacks, type EnrichmentPurpose, type EntityExtractionResult, type ExpandAnchorStatus, type ExpandParams, type ExpandResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type FileDownloadOptions, type GraphEnrichEvent, type GraphEnrichFileOptions, type GraphEnrichPreparedEvent, type GraphEnrichResult, type GraphEnrichResultEvent, type GraphEnrichment, type GraphEnrichmentStatus, type GraphExtractionPayload, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphRepairResult, type GraphTelemetrySnapshot, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, type LineageParams, type LineageResult, type LineageVersion, MEMORY_PROJECT_LABEL_MAX_CHARS, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInsightMetrics, type MemoryInsights, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemoryProjectInsight, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SESSION_ORDINAL_MAX, SINGLE_TENANT_ID, type SecretElevationAggregate, type SecretElevationNotice, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, TAXONOMY_MAX_PROJECTS, TAXONOMY_MAX_SAMPLE_TOPICS, TAXONOMY_MAX_TOP_ENTITIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, assertGraphExtractionPayload, createPyxMemory, isSessionOrdinal, mergeExtractedEntities, normalizeGraphLabel, normalizeNameKey, projectSearchResponseForMcp, secretElevationAggregate, secretElevationNoticeFor, withSecretElevationNotice };
2014
+ export { type AgentId, type ApiResponse, type ConsolidationJudgementsResult, type ConsolidationMerge, type ConsolidationPair, type ConsolidationPairSide, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, type DueScanInput, EmbeddingProviderName, type EnrichmentCallbacks, type EnrichmentPurpose, type EntityExtractionResult, type ExpandAnchorStatus, type ExpandParams, type ExpandResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type FileDownloadOptions, type GraphEnrichEvent, type GraphEnrichFileOptions, type GraphEnrichPreparedEvent, type GraphEnrichResult, type GraphEnrichResultEvent, type GraphEnrichment, type GraphEnrichmentStatus, type GraphExtractionPayload, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphRepairResult, type GraphTelemetrySnapshot, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, type LineageParams, type LineageResult, type LineageVersion, MCP_ACTOR_META_KEY, MEMORY_ACTOR_LABEL_MAX_CHARS, MEMORY_PROJECT_LABEL_MAX_CHARS, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInsightMetrics, type MemoryInsights, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemoryProjectInsight, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SESSION_ORDINAL_MAX, SINGLE_TENANT_ID, type SecretElevationAggregate, type SecretElevationNotice, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, TAXONOMY_MAX_PROJECTS, TAXONOMY_MAX_SAMPLE_TOPICS, TAXONOMY_MAX_TOP_ENTITIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, assertGraphExtractionPayload, createPyxMemory, isSessionOrdinal, mergeExtractedEntities, normalizeGraphLabel, normalizeMemoryActorLabel, normalizeNameKey, projectSearchResponseForMcp, secretElevationAggregate, secretElevationNoticeFor, withSecretElevationNotice };
package/dist/index.mjs CHANGED
@@ -5,6 +5,8 @@ import {
5
5
  } from "./chunk-M67SXB7C.mjs";
6
6
  import {
7
7
  DEFAULTS,
8
+ MCP_ACTOR_META_KEY,
9
+ MEMORY_ACTOR_LABEL_MAX_CHARS,
8
10
  MEMORY_PROJECT_LABEL_MAX_CHARS,
9
11
  MoveFailureReason,
10
12
  NamespaceIsolation,
@@ -16,11 +18,12 @@ import {
16
18
  documentContentSource,
17
19
  documentGraphSource,
18
20
  documentImageSource,
21
+ normalizeMemoryActorLabel,
19
22
  projectSearchResponseForMcp,
20
23
  secretElevationAggregate,
21
24
  secretElevationNoticeFor,
22
25
  withSecretElevationNotice
23
- } from "./chunk-KZKGRND2.mjs";
26
+ } from "./chunk-RWQTBXUC.mjs";
24
27
  import {
25
28
  DEPRECATED_RAG_STRATEGIES,
26
29
  EmbeddingProviderName,
@@ -57,6 +60,8 @@ export {
57
60
  DEPRECATED_RAG_STRATEGIES,
58
61
  DisabledMemory,
59
62
  EmbeddingProviderName,
63
+ MCP_ACTOR_META_KEY,
64
+ MEMORY_ACTOR_LABEL_MAX_CHARS,
60
65
  MEMORY_PROJECT_LABEL_MAX_CHARS,
61
66
  MemoryClient,
62
67
  MemoryServerError,
@@ -82,6 +87,7 @@ export {
82
87
  isSessionOrdinal,
83
88
  mergeExtractedEntities,
84
89
  normalizeGraphLabel,
90
+ normalizeMemoryActorLabel,
85
91
  normalizeNameKey,
86
92
  parseListCursorToken,
87
93
  projectSearchResponseForMcp,
package/dist/react.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  unreachableHealth
14
14
  } from "./chunk-N4KDRRLY.mjs";
15
15
  import "./chunk-M67SXB7C.mjs";
16
- import "./chunk-KZKGRND2.mjs";
16
+ import "./chunk-RWQTBXUC.mjs";
17
17
  import "./chunk-HTQBKJTD.mjs";
18
18
 
19
19
  // ../dashboard/src/hooks/use-consolidation-log.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyxmate/memory",
3
- "version": "1.26.6",
3
+ "version": "1.27.0",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",