@sanity-labs/nuum 0.2.2 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity-labs/nuum",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "AI coding agent with continuous memory - infinite context across sessions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,36 @@
1
+ -- Background Tasks: conscious async tasks (research, reflect) and alarms
2
+ -- These are tasks the agent explicitly started and expects results from.
3
+
4
+ -- Background tasks table
5
+ CREATE TABLE IF NOT EXISTS background_tasks (
6
+ id TEXT PRIMARY KEY,
7
+ type TEXT NOT NULL, -- 'research' | 'reflect'
8
+ description TEXT NOT NULL, -- Human-readable description
9
+ status TEXT NOT NULL, -- 'running' | 'completed' | 'failed' | 'killed'
10
+ created_at TEXT NOT NULL,
11
+ completed_at TEXT,
12
+ result TEXT, -- JSON blob with task result
13
+ error TEXT -- Error message if failed
14
+ );
15
+
16
+ CREATE INDEX IF NOT EXISTS idx_background_tasks_status ON background_tasks(status);
17
+
18
+ -- Queue for completed task results waiting to be delivered
19
+ CREATE TABLE IF NOT EXISTS background_task_queue (
20
+ id TEXT PRIMARY KEY,
21
+ task_id TEXT NOT NULL,
22
+ created_at TEXT NOT NULL,
23
+ content TEXT NOT NULL -- The message to inject
24
+ );
25
+
26
+ CREATE INDEX IF NOT EXISTS idx_background_task_queue_created ON background_task_queue(created_at);
27
+
28
+ -- Alarms: scheduled "notes to self" that trigger turns
29
+ CREATE TABLE IF NOT EXISTS alarms (
30
+ id TEXT PRIMARY KEY,
31
+ fires_at TEXT NOT NULL, -- ISO timestamp
32
+ note TEXT NOT NULL, -- The "note to self"
33
+ fired INTEGER NOT NULL DEFAULT 0 -- 1 if already fired
34
+ );
35
+
36
+ CREATE INDEX IF NOT EXISTS idx_alarms_fires_at ON alarms(fires_at);