@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/index.d.ts CHANGED
@@ -261,6 +261,12 @@ interface StoreOptions {
261
261
  enrichment?: StoreEnrichmentCallbacks;
262
262
  /** Propagated into the `extractEntities` callback and the underlying fetch. */
263
263
  signal?: AbortSignal;
264
+ /** Stable logical request key. Reuse this exact value after a lost response. */
265
+ idempotencyKey?: string;
266
+ }
267
+ interface RequestAuthorityOptions {
268
+ /** Stable logical request key. Reuse this exact value after a lost response. */
269
+ idempotencyKey?: string;
264
270
  }
265
271
  /** Error thrown by MemoryClient when the server returns a non-success response. */
266
272
  declare class MemoryServerError extends Error {
@@ -297,11 +303,12 @@ declare class MemoryClient implements ExtendedMemoryInterface {
297
303
  constructor(memoryUrl: string, apiKeyOrOptions?: string | MemoryClientOptions);
298
304
  /** Encode a path segment to prevent URL injection */
299
305
  private encodePathSegment;
306
+ private authorityHeaders;
300
307
  initialize(): Promise<void>;
301
308
  store(entry: StoreInput$1, options?: StoreOptions): Promise<MemoryEntry$1>;
302
- search(params: MemorySearchParams$1): Promise<MemorySearchResult$1>;
303
- get(id: string): Promise<MemoryEntry$1 | null>;
304
- delete(id: string): Promise<boolean>;
309
+ search(params: MemorySearchParams$1, authority?: RequestAuthorityOptions): Promise<MemorySearchResult$1>;
310
+ get(id: string, authority?: TenantScopeOptions & RequestAuthorityOptions): Promise<MemoryEntry$1 | null>;
311
+ delete(id: string, authority?: TenantScopeOptions & RequestAuthorityOptions): Promise<boolean>;
305
312
  clearSession(sessionId: string): Promise<number>;
306
313
  stats(options?: TenantScopeOptions): Promise<MemoryStats$1>;
307
314
  /**
@@ -315,7 +322,7 @@ declare class MemoryClient implements ExtendedMemoryInterface {
315
322
  */
316
323
  status(): Promise<Topology$1>;
317
324
  shutdown(): Promise<void>;
318
- list(params?: MemoryListParams): Promise<MemoryListResult>;
325
+ list(params?: MemoryListParams, authority?: RequestAuthorityOptions): Promise<MemoryListResult>;
319
326
  /**
320
327
  * Native streaming file ingest. Yields typed {@link IngestEvent}s as the
321
328
  * server (parsing/storing) and the SDK (enrichment/result) make progress.
@@ -402,8 +409,8 @@ declare class MemoryClient implements ExtendedMemoryInterface {
402
409
  dryRun: boolean;
403
410
  }>;
404
411
  queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
405
- lineage(params: LineageParams$1): Promise<LineageResult$1>;
406
- reinforce(params: ReinforceParams$1): Promise<ReinforceResult$1>;
412
+ lineage(params: LineageParams$1, authority?: RequestAuthorityOptions): Promise<LineageResult$1>;
413
+ reinforce(params: ReinforceParams$1, authority?: RequestAuthorityOptions): Promise<ReinforceResult$1>;
407
414
  log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
408
415
  queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
409
416
  summarizeEntity(name: string): Promise<MemoryEntry$1>;
@@ -461,6 +468,18 @@ declare class MemoryClient implements ExtendedMemoryInterface {
461
468
  project?: string;
462
469
  limit?: number;
463
470
  }): Promise<CorrectionRecord$1[]>;
471
+ /**
472
+ * H26 B-d — deterministic prospective due-scan: entries with
473
+ * `eventTime ∈ [from, from+windowDays]` (inclusive), eventTime ascending,
474
+ * no relevance ranking. `GET /api/memory/due`.
475
+ */
476
+ dueScan(input: {
477
+ windowDays: number;
478
+ from?: string;
479
+ /** Omit in single-tenant deployments. */
480
+ namespaceId?: string;
481
+ limit?: number;
482
+ }): Promise<MemoryEntry$1[]>;
464
483
  protected fetchApi<T>(path: string, options?: RequestInit): Promise<T>;
465
484
  /**
466
485
  * Map fetch-layer rejections into a typed `MemoryServerError` so callers
@@ -493,6 +512,53 @@ type Timestamp = string;
493
512
  /** Unique agent identifier */
494
513
  type AgentId = string;
495
514
 
515
+ /**
516
+ * Caller identity for ReBAC authorization.
517
+ *
518
+ * The canonical "subject" in Zanzibar terms — passed alongside requests so the
519
+ * memory layer can compute an AuthzPlan (visible namespaces + entry overrides)
520
+ * before any retrieval source fans out.
521
+ *
522
+ * Identity comes from authenticated request context (X-Tenant-Id / auth token
523
+ * claims), never from request bodies or multipart form fields. The legacy
524
+ * `userId` / `teamId` / `agentId` columns on MemoryEntry remain for audit and
525
+ * legacy filters but MUST NOT drive authorization decisions — they are
526
+ * collision-prone aliases (a service principal sharing an ID with a human
527
+ * user has no protection against confused-deputy attacks).
528
+ *
529
+ * Sensitivity / clearance is intentionally NOT on this object. It is a
530
+ * MAC-style classification, orthogonal to RBAC, and continues to be carried
531
+ * via the `X-Caller-Access-Level` header → `MemorySearchParams.maxSensitivity`.
532
+ * Conflating the two couples future changes (e.g. per-namespace classification
533
+ * rules) to identity propagation.
534
+ */
535
+ interface PrincipalContext {
536
+ /**
537
+ * Hard isolation boundary. Required even in single-tenant deployments —
538
+ * single-mode passes a stable sentinel (`SINGLE_TENANT_ID`) so authz code
539
+ * paths look identical regardless of mode.
540
+ */
541
+ tenantId: string;
542
+ /**
543
+ * Stable subject ID (within the tenant). For humans this is the userId;
544
+ * for AI runtimes it is the agentId; for system actors it is a service
545
+ * identifier. Combined with `kind`, forms the Zanzibar subject coordinate
546
+ * `<kind>:<principalId>`.
547
+ */
548
+ principalId: string;
549
+ /**
550
+ * Subject namespace. Distinguishes humans from AI agents from internal
551
+ * services so a userId/agentId/serviceId collision cannot grant
552
+ * unintended access.
553
+ * - `user`: human end user
554
+ * - `agent`: AI runtime acting on a user's behalf or autonomously
555
+ * - `service`: non-AI internal system (cron, ETL, admin tooling)
556
+ */
557
+ kind: 'user' | 'agent' | 'service';
558
+ }
559
+ /** Sentinel tenant ID used in single-tenant deployments. */
560
+ declare const SINGLE_TENANT_ID = "_single";
561
+
496
562
  declare const MemoryType: {
497
563
  readonly SHORT_TERM: "short-term";
498
564
  readonly LONG_TERM: "long-term";
@@ -1002,6 +1068,26 @@ interface FetchCorrectionsInput {
1002
1068
  /** Optional sensitivity cap for hosted/HTTP callers. Omitted preserves trusted in-process behavior. */
1003
1069
  maxSensitivity?: SensitivityLevel;
1004
1070
  }
1071
+ /** Input to `Memory.dueScan` (H26 B-d — the one deterministic prospective primitive). */
1072
+ interface DueScanInput {
1073
+ /**
1074
+ * Window start, ISO-8601. Defaults to the server's injected clock ("now").
1075
+ * Benches and reproducible callers pass it explicitly.
1076
+ */
1077
+ from?: string;
1078
+ /** Window length in fixed 24-hour periods, endpoints inclusive. Integer 1..370 — out-of-range is a loud error, never a clamp. */
1079
+ windowDays: number;
1080
+ /** Max entries returned. Default 20, hard cap 100. */
1081
+ limit?: number;
1082
+ /** Tenant scope; defaults to the Memory instance's tenant. */
1083
+ tenantId?: string;
1084
+ /** Explicit namespace scope (tenant-root rows stay visible). Overrides principal-derived visibility. */
1085
+ namespaceId?: string;
1086
+ /** Optional principal for namespace visibility (AuthzPlan), like search. */
1087
+ principal?: PrincipalContext;
1088
+ /** Optional sensitivity cap for hosted/HTTP callers; filtered in SQL before LIMIT. */
1089
+ maxSensitivity?: SensitivityLevel;
1090
+ }
1005
1091
  /** One applicable correction returned by `fetchApplicableCorrections`. */
1006
1092
  interface CorrectionRecord {
1007
1093
  id: string;
@@ -1463,53 +1549,6 @@ interface MoveResult {
1463
1549
  error?: string;
1464
1550
  }
1465
1551
 
1466
- /**
1467
- * Caller identity for ReBAC authorization.
1468
- *
1469
- * The canonical "subject" in Zanzibar terms — passed alongside requests so the
1470
- * memory layer can compute an AuthzPlan (visible namespaces + entry overrides)
1471
- * before any retrieval source fans out.
1472
- *
1473
- * Identity comes from authenticated request context (X-Tenant-Id / auth token
1474
- * claims), never from request bodies or multipart form fields. The legacy
1475
- * `userId` / `teamId` / `agentId` columns on MemoryEntry remain for audit and
1476
- * legacy filters but MUST NOT drive authorization decisions — they are
1477
- * collision-prone aliases (a service principal sharing an ID with a human
1478
- * user has no protection against confused-deputy attacks).
1479
- *
1480
- * Sensitivity / clearance is intentionally NOT on this object. It is a
1481
- * MAC-style classification, orthogonal to RBAC, and continues to be carried
1482
- * via the `X-Caller-Access-Level` header → `MemorySearchParams.maxSensitivity`.
1483
- * Conflating the two couples future changes (e.g. per-namespace classification
1484
- * rules) to identity propagation.
1485
- */
1486
- interface PrincipalContext {
1487
- /**
1488
- * Hard isolation boundary. Required even in single-tenant deployments —
1489
- * single-mode passes a stable sentinel (`SINGLE_TENANT_ID`) so authz code
1490
- * paths look identical regardless of mode.
1491
- */
1492
- tenantId: string;
1493
- /**
1494
- * Stable subject ID (within the tenant). For humans this is the userId;
1495
- * for AI runtimes it is the agentId; for system actors it is a service
1496
- * identifier. Combined with `kind`, forms the Zanzibar subject coordinate
1497
- * `<kind>:<principalId>`.
1498
- */
1499
- principalId: string;
1500
- /**
1501
- * Subject namespace. Distinguishes humans from AI agents from internal
1502
- * services so a userId/agentId/serviceId collision cannot grant
1503
- * unintended access.
1504
- * - `user`: human end user
1505
- * - `agent`: AI runtime acting on a user's behalf or autonomously
1506
- * - `service`: non-AI internal system (cron, ETL, admin tooling)
1507
- */
1508
- kind: 'user' | 'agent' | 'service';
1509
- }
1510
- /** Sentinel tenant ID used in single-tenant deployments. */
1511
- declare const SINGLE_TENANT_ID = "_single";
1512
-
1513
1552
  interface CreatePyxMemoryOptions {
1514
1553
  url?: string;
1515
1554
  apiKey?: string;
@@ -1518,4 +1557,4 @@ interface CreatePyxMemoryOptions {
1518
1557
  }
1519
1558
  declare function createPyxMemory(opts?: CreatePyxMemoryOptions): MemoryClient;
1520
1559
 
1521
- export { type AgentId, type ApiResponse, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type GraphEnrichment, type GraphEnrichmentStatus, 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, 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, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SINGLE_TENANT_ID, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, createPyxMemory, mergeExtractedEntities, normalizeGraphLabel, normalizeNameKey };
1560
+ export { type AgentId, type ApiResponse, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, type DueScanInput, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type GraphEnrichment, type GraphEnrichmentStatus, 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, 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, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SINGLE_TENANT_ID, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, createPyxMemory, mergeExtractedEntities, normalizeGraphLabel, normalizeNameKey };
package/dist/index.mjs CHANGED
@@ -13,11 +13,13 @@ import {
13
13
  SensitivityLevel,
14
14
  StoreTarget,
15
15
  TAXONOMY_MAX_CATEGORIES,
16
- VectorProvider,
16
+ VectorProvider
17
+ } from "./chunk-IEBF7BQF.mjs";
18
+ import {
17
19
  mergeExtractedEntities,
18
20
  normalizeGraphLabel,
19
21
  normalizeNameKey
20
- } from "./chunk-5BLT7RSY.mjs";
22
+ } from "./chunk-A3L46P2G.mjs";
21
23
 
22
24
  // src/preset.ts
23
25
  var DEFAULT_MEMORY_URL = `http://localhost:${DEFAULTS.MEMORY_SERVER_PORT}`;
package/dist/react.mjs CHANGED
@@ -11,8 +11,9 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-HOBDPIHO.mjs";
15
- import "./chunk-5BLT7RSY.mjs";
14
+ } from "./chunk-3FRA37TI.mjs";
15
+ import "./chunk-IEBF7BQF.mjs";
16
+ import "./chunk-A3L46P2G.mjs";
16
17
 
17
18
  // ../dashboard/src/hooks/use-consolidation-log.ts
18
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": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",
@@ -28,6 +28,10 @@
28
28
  "import": "./dist/dashboard.mjs",
29
29
  "types": "./dist/dashboard.d.ts"
30
30
  },
31
+ "./data-plane-contract": {
32
+ "import": "./dist/data-plane-contract.mjs",
33
+ "types": "./dist/data-plane-contract.d.ts"
34
+ },
31
35
  "./agent-contract": {
32
36
  "import": "./dist/agent-contract.mjs",
33
37
  "types": "./dist/agent-contract.d.ts"