@adhd/agent-store-runtime 2.1.2 → 2.1.4

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 2.1.4 (2026-07-23)
2
+
3
+ This was a version bump only for agent-store-runtime to align it with other projects, there were no code changes.
4
+
5
+ ## 2.1.3 (2026-07-23)
6
+
7
+ This was a version bump only for agent-store-runtime to align it with other projects, there were no code changes.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @adhd/agent-store-runtime
2
+
3
+ Persistent state store for @adhd/agent-mcp. Manages SQLite schema, migrations, and runtime access to agents, sessions, messages, task events, and usage tracking.
4
+
5
+ **Status:** Core store (shipped v0.0.1)
6
+ **Package:** `npm install @adhd/agent-store-runtime`
7
+ **Consumers:** `@adhd/agent-mcp`, `@adhd/agent-engine-orchestrator`
8
+
9
+ ## What it does
10
+
11
+ - **SQLite persistence** — agents, sessions, messages, task_events, task_usage tables with proper indexing
12
+ - **Migrations** — drizzle-kit migrations (0000–0009) applied on server startup; tracks schema evolution
13
+ - **Query API** — type-safe Drizzle ORM wrappers for all read/write operations
14
+ - **Transaction support** — atomic multi-table operations for consistency
15
+ - **Usage tracking** — accumulates token counts, cost, and execution traces per task
16
+ - **Cascade cleanup** — sessions→agents FK cascade (restored in 2.0.2) via migration 0009
17
+
18
+ ## Usage
19
+
20
+ This is an internal package consumed by `@adhd/agent-mcp`. Direct use is rare.
21
+
22
+ For store access (rare):
23
+
24
+ ```typescript
25
+ import { AgentStore } from '@adhd/agent-store-runtime';
26
+
27
+ const store = new AgentStore({
28
+ databasePath: '~/.adhd/agent-mcp/agent-mcp.db',
29
+ });
30
+
31
+ const agents = await store.listAgents();
32
+ const task = await store.getTask(taskId);
33
+ ```
34
+
35
+ ## Database schema
36
+
37
+ - `agents` — registered agent configs
38
+ - `sessions` — conversation instances
39
+ - `messages` — chat history (role, content, tool_calls, tool_results)
40
+ - `task_events` — MODEL_REQUEST, TOOL_CALL, TASK_COMPLETED events
41
+ - `task_usage` — token counts, cost estimates, execution stats
42
+
43
+ ## Key files
44
+
45
+ - `src/db/schema.ts` — Drizzle ORM schema
46
+ - `drizzle/` — migrations (0000–0009)
47
+ - `src/database.ts` — AgentStore class and query API
48
+
49
+ ## 2.0.2 changes
50
+
51
+ - **Migration 0008** — adds `peakContextTokens`, `peakContextAt` columns
52
+ - **Migration 0009** — restores `sessions.agent_name → agents.name ON DELETE CASCADE` FK
53
+
54
+ ## Architecture
55
+
56
+ - Part of the 6-package agent framework family
57
+ - Depends on: `drizzle-orm`, `better-sqlite3`
58
+ - Depended on by: `@adhd/agent-mcp`, `@adhd/agent-engine-orchestrator`
59
+
60
+ See `/entrypoint/agent-mcp/docs/architecture-and-security.md` for the full agent runtime architecture.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhd/agent-store-runtime",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Runtime state stores for sessions, tasks, and usage tracking — extracted from agent-mcp",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@adhd/agent-base-types": "^2.1.1",
16
+ "@adhd/agent-base-types": "^2.1.3",
17
17
  "better-sqlite3": "12.10.0",
18
18
  "drizzle-orm": "0.45.2",
19
19
  "uuid": "14.0.0",