dotmem 0.1.8 → 0.2.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/types/agent.d.ts DELETED
@@ -1,87 +0,0 @@
1
- /**
2
- * DOTMEM AGENT DECLARATIONS
3
- *
4
- * Mirrors the agent-facing memory API exported from `dotmem/agent`.
5
- * Every agent gets an isolated namespace: keys are stored as
6
- * `agent:<agentId>:<key>` and entries are tagged with the agent id, so two
7
- * agents never share private memory by accident.
8
- */
9
-
10
- import type {
11
- ContextEntry,
12
- MemoryEntry,
13
- MemoryScope,
14
- MemoryStats,
15
- MemoryType,
16
- RecallOptions
17
- } from './memory'
18
-
19
- export interface AgentContextOptions {
20
- tags?: string | string[]
21
- types?: MemoryType | MemoryType[]
22
- minConfidence?: number
23
- maxEntries?: number
24
- scopes?: MemoryScope[]
25
- }
26
-
27
- export interface AgentRememberOptions {
28
- type?: MemoryType
29
- confidence?: number
30
- scope?: MemoryScope
31
- ttl?: number | null
32
- tags?: string[]
33
- source?: string
34
- }
35
-
36
- export interface AgentReplayOptions {
37
- from: number | string
38
- to: number | string
39
- }
40
-
41
- export interface AgentBranchState {
42
- state: Record<string, unknown>
43
- temporal: {
44
- history: (path?: string) => MemoryEntry[]
45
- at: (path: string, timestamp: string | number) => unknown
46
- diff: (path: string, from: string | number, to: string | number) => MemoryEntry[]
47
- replay: (opts?: { from?: string | number; to?: string | number }) => Record<string, unknown>
48
- explain: (path: string) => unknown
49
- branch: () => AgentBranchState
50
- discard: () => void
51
- }
52
- }
53
-
54
- export interface AgentMemory {
55
- /** Identifier of the agent owning this isolated namespace. */
56
- readonly agentId: string
57
- /** Store a memory entry, namespaced and tagged for this agent. */
58
- remember: (key: string, value: unknown, options?: AgentRememberOptions) => Promise<void>
59
- /** Read a memory entry by key. Expired, obsolete, and superseded entries are null. */
60
- recall: (key: string, options?: RecallOptions) => Promise<MemoryEntry | null>
61
- /** Ranked memories for this agent only. Additional tags use AND semantics. */
62
- context: (options?: AgentContextOptions) => Promise<ContextEntry[]>
63
- /** Mutation history, optionally for one path. */
64
- history: (path?: string) => Promise<MemoryEntry[]>
65
- /** Replay the state evolution over a temporal range. */
66
- replay: (opts: AgentReplayOptions) => Promise<Record<string, unknown>>
67
- /** Open an isolated temporal branch for experimentation. */
68
- branch: () => Promise<AgentBranchState>
69
- /** Memory usage statistics. */
70
- stats: () => Promise<MemoryStats>
71
- /** Update an existing memory entry. */
72
- update: (key: string, value: unknown, options?: AgentRememberOptions) => Promise<void>
73
- /** Delete a memory entry. */
74
- forget: (key: string) => Promise<void>
75
- /** Enable temporal and history tracking. */
76
- enable: (bool?: boolean) => Promise<void>
77
- /** Disable temporal tracking. */
78
- disable: () => Promise<void>
79
- /** Clear the temporal log and every memory of this agent. */
80
- clear: () => Promise<void>
81
- }
82
-
83
- /** Create an agent-specific memory instance with an isolated namespace. */
84
- export declare function createAgentMemory(agentId: string): AgentMemory
85
-
86
- /** Create an agent memory instance with the default agent id. */
87
- export declare function createDefaultAgentMemory(): AgentMemory