OXYGENHUB
◆ main spectra / crates / spectra-core / migrations / 0005_rules_tools.sql
736 B · SQL · last changed The 0.1 tools: brief, rules, agents, status, say, read, inbox, wait with the idle guard, ack, search, redact; every call on the record (#8) 2 days ago source blame history raw
1
-- The rules version each agent last read (spec §12.3), and the tool calls
2
-- each agent made (spec §9.2), for the agent pages and the idle guard.
3
CREATE TABLE rules_read (
4
    agent    TEXT PRIMARY KEY,
5
    version  TEXT NOT NULL,
6
    at_ms    INTEGER NOT NULL
7
);
8
9
CREATE TABLE tool_calls (
10
    seq       INTEGER PRIMARY KEY,
11
    agent     TEXT NOT NULL,
12
    tool      TEXT NOT NULL,
13
    args      TEXT NOT NULL,     -- BLAKE3 of the arguments, kept under attachments/
14
    result    TEXT NOT NULL,     -- BLAKE3 of the result
15
    ms        INTEGER NOT NULL,
16
    is_error  INTEGER NOT NULL,
17
    read      INTEGER NOT NULL,
18
    session   TEXT,
19
    at_ms     INTEGER NOT NULL
20
);
21
CREATE INDEX tool_calls_agent ON tool_calls(agent, seq);