@pyxmate/memory 0.17.7 → 0.18.1

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-55E3V44T.mjs";
3
+ } from "./chunk-SHT5FPV6.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -513,6 +513,10 @@ var MemoryClient = class {
513
513
  throw error;
514
514
  }
515
515
  }
516
+ async lint(options) {
517
+ const qs = options?.limit ? `?limit=${encodeURIComponent(String(options.limit))}` : "";
518
+ return this.fetchApi(`/api/memory/lint${qs}`, { method: "GET" });
519
+ }
516
520
  async runDecay() {
517
521
  const result = await this.fetchApi("/api/memory/decay", {
518
522
  method: "POST"
@@ -546,6 +550,19 @@ var MemoryClient = class {
546
550
  );
547
551
  return result.entries;
548
552
  }
553
+ async log(filters = {}) {
554
+ const params = new URLSearchParams();
555
+ if (filters.since) params.set("since", filters.since);
556
+ if (filters.limit) params.set("limit", String(filters.limit));
557
+ if (filters.type) params.set("type", filters.type);
558
+ if (filters.agentId) params.set("agentId", filters.agentId);
559
+ if (filters.source) params.set("source", filters.source);
560
+ const qs = params.toString();
561
+ const result = await this.fetchApi(
562
+ `/api/memory/log${qs ? `?${qs}` : ""}`
563
+ );
564
+ return result.entries;
565
+ }
549
566
  async queryByEventTime(startTime, endTime, filters = {}) {
550
567
  const params = new URLSearchParams({ startTime, endTime });
551
568
  if (filters.type) params.set("type", filters.type);
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-PUDKYGQI.mjs";
15
- import "./chunk-55E3V44T.mjs";
14
+ } from "./chunk-HV6A2WTS.mjs";
15
+ import "./chunk-SHT5FPV6.mjs";
16
16
  export {
17
17
  DashboardClient,
18
18
  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, ExtractedImageMeta as ExtractedImageMeta$1, IngestEntity as IngestEntity$1, IngestRelationship as IngestRelationship$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, ExtractedImageMeta as ExtractedImageMeta$1, IngestEntity as IngestEntity$1, IngestRelationship as IngestRelationship$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 {
@@ -34,6 +34,16 @@ interface TemporalQueryFilters {
34
34
  source?: string;
35
35
  limit?: number;
36
36
  }
37
+ /** Filters for the chronological feed (`log`, Karpathy `log.md` primitive). */
38
+ interface MemoryLogFilters {
39
+ /** Inclusive lower bound on `created_at` (ISO 8601). Cursor for "what's new since X". */
40
+ since?: string;
41
+ /** Maximum entries to return. The HTTP layer clamps to [1, 100]. */
42
+ limit?: number;
43
+ type?: MemoryType$1;
44
+ agentId?: string;
45
+ source?: string;
46
+ }
37
47
  /** Options for scoping operations to a specific tenant. */
38
48
  interface TenantScopeOptions {
39
49
  tenantId?: string;
@@ -78,12 +88,25 @@ interface ExtendedMemoryInterface extends MemoryInterface {
78
88
  forget(id: string, reason?: string): Promise<boolean>;
79
89
  /** Summarize a session's memories into a long-term entry. */
80
90
  summarizeSession(sessionId: string): Promise<MemoryEntry$1 | null>;
91
+ /**
92
+ * Read-only memory-wide lint report (v0.18.0 Karpathy-wiki Item B):
93
+ * orphans, decay candidates, stale entries, dedup candidates. Pure
94
+ * projection — no writes.
95
+ */
96
+ lint(options?: {
97
+ limit?: number;
98
+ }): Promise<WikiLintReport$1>;
81
99
  /** Run decay on all entries, archiving those below threshold. */
82
100
  runDecay(): Promise<number>;
83
101
  /** Reindex the FTS5 full-text search index. */
84
102
  reindex(): Promise<void>;
85
103
  /** Delete all entries matching a source, cleaning up all stores. */
86
104
  deleteBySource(source: string): Promise<number>;
105
+ /**
106
+ * Chronological feed of memory entries (Karpathy `log.md` primitive).
107
+ * Cursor-based via `since` (created_at lower bound). No totalCount.
108
+ */
109
+ log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
87
110
  }
88
111
 
89
112
  /**
@@ -245,11 +268,15 @@ declare class MemoryClient implements ExtendedMemoryInterface {
245
268
  consolidate(): Promise<ConsolidationRunResult>;
246
269
  forget(id: string, reason?: string): Promise<boolean>;
247
270
  summarizeSession(sessionId: string): Promise<MemoryEntry$1 | null>;
271
+ lint(options?: {
272
+ limit?: number;
273
+ }): Promise<WikiLintReport$1>;
248
274
  runDecay(): Promise<number>;
249
275
  reindex(): Promise<void>;
250
276
  clearGraph(): Promise<number>;
251
277
  deleteBySource(source: string): Promise<number>;
252
278
  queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
279
+ log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
253
280
  queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
254
281
  protected fetchApi<T>(path: string, options?: RequestInit): Promise<T>;
255
282
  /**
@@ -579,6 +606,24 @@ interface GraphTraversalResult {
579
606
  relationshipIds: string[];
580
607
  }>;
581
608
  }
609
+ /**
610
+ * Memory.lint() report shape — Karpathy-wiki Item B (v0.18.0).
611
+ * Read-only projection composed from signals every owning module
612
+ * already exposes. Lives in shared so the HTTP client can hold the
613
+ * same type as core without re-declaring it.
614
+ */
615
+ interface WikiLintReport {
616
+ orphans: GraphNode[];
617
+ decayCandidates: MemoryEntry[];
618
+ staleSyntheses: Array<{
619
+ entry: MemoryEntry;
620
+ reason: string;
621
+ }>;
622
+ dedupCandidates: Array<{
623
+ hash: string;
624
+ entryIds: string[];
625
+ }>;
626
+ }
582
627
 
583
628
  /** Metadata for a single image extracted from a PDF. */
584
629
  interface ExtractedImageMeta {
@@ -845,4 +890,4 @@ interface PrincipalContext {
845
890
  /** Sentinel tenant ID used in single-tenant deployments. */
846
891
  declare const SINGLE_TENANT_ID = "_single";
847
892
 
848
- export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type EnrichmentCallbacks, 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 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, VectorProvider };
893
+ export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type EnrichmentCallbacks, 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, VectorProvider, type WikiLintReport };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MemoryClient,
3
3
  MemoryServerError
4
- } from "./chunk-55E3V44T.mjs";
4
+ } from "./chunk-SHT5FPV6.mjs";
5
5
 
6
6
  // ../shared/src/constants/defaults.ts
7
7
  var DEFAULTS = {
package/dist/react.mjs CHANGED
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-PUDKYGQI.mjs";
15
- import "./chunk-55E3V44T.mjs";
14
+ } from "./chunk-HV6A2WTS.mjs";
15
+ import "./chunk-SHT5FPV6.mjs";
16
16
 
17
17
  // ../dashboard/src/hooks/use-consolidation-log.ts
18
18
  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.17.7",
3
+ "version": "0.18.1",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",