feat: IPC additions for reminders/events/routines, ack tracking, tool management
- Extend IPC wire protocol: add ListReminders, ListEvents, ListProposedRoutines, DismissProposedRoutine, AcceptProposedRoutine IPC methods with request/response types. Update wire.go with new message kinds. - Add ack_sends table (migration #5): tracks sev4 telegram repeat-til-ack delivery state with rule name + timestamp, indexed for dedup. - Add Store.DeleteTool: permanently removes a tool row (for dismissing proposed tools), idempotent on missing tool. - Update tick.go: wire new IPC handlers into daemon tick.
This commit is contained in:
@@ -26,6 +26,30 @@ ALTER TABLE reminders ADD COLUMN next_fire_ts INTEGER;`, // #2
|
||||
meta TEXT NOT NULL DEFAULT '{}',
|
||||
created_ts INTEGER NOT NULL
|
||||
);`, // #3 — long-term vector memory (persistent backend for internal/memory)
|
||||
`CREATE TABLE IF NOT EXISTS events (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
fact_id INTEGER NOT NULL REFERENCES facts(id),
|
||||
action TEXT NOT NULL,
|
||||
object TEXT NOT NULL,
|
||||
ts INTEGER NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_events_action_object ON events (action, object, ts DESC);
|
||||
CREATE TABLE IF NOT EXISTS proposed_routines (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
action TEXT NOT NULL,
|
||||
object TEXT NOT NULL,
|
||||
interval_days REAL NOT NULL,
|
||||
status TEXT NOT NULL DEFAULT 'proposed' CHECK (status IN ('proposed','accepted','dismissed')),
|
||||
created_ts INTEGER NOT NULL,
|
||||
reminder_id INTEGER REFERENCES reminders(id),
|
||||
UNIQUE(action, object)
|
||||
);`, // #4 — event extraction + pattern inference
|
||||
|
||||
`CREATE TABLE IF NOT EXISTS ack_sends (
|
||||
rule TEXT NOT NULL,
|
||||
sent_at INTEGER NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_ack_sends_rule ON ack_sends (rule, sent_at DESC);`, // #5 — sev4 telegram repeat-til-ack tracking
|
||||
}
|
||||
|
||||
// migrate applies every migration with a number greater than the DB's current
|
||||
|
||||
Reference in New Issue
Block a user