Skip to content
40 linesCodeBlameRaw
1-- Abilities (docs.g1t.sh/guides/agent-abilities/): what each agent may do
2-- through g1t, the workspace's integrations and MCP servers an owner adds,
3-- and whether it does each alone, only when asked for it, after asking
4-- first, or never.
5
6-- The agent's choices (@g1t/contracts abilities.ts `AgentAbilities`, JSON):
7-- levels and credentials per ability, and its MCP servers with the tools
8-- each listed. Saved as a version like every other change.
9ALTER TABLE agents ADD COLUMN abilities TEXT NOT NULL DEFAULT '{}';
10
11-- An ability set to "Ask first", asked: the call an agent wanted to make,
12-- waiting on the person it acts for (or an owner) to allow it from the
13-- card in chat. Allowed, the call runs as that person and the result goes
14-- back to the agent (a session reads it at its next step).
15-- status: pending, allowed, denied, failed.
16CREATE TABLE agent_ability_requests (
17 id TEXT PRIMARY KEY,
18 agent_id TEXT NOT NULL,
19 workspace_id TEXT NOT NULL,
20 workspace TEXT NOT NULL,
21 channel_id TEXT NOT NULL,
22 message_id TEXT,
23 session_id TEXT,
24 -- The ability's id (integration:linear:comment) and the tool call it was for.
25 ability TEXT NOT NULL,
26 tool TEXT NOT NULL,
27 input TEXT NOT NULL,
28 -- What it would do, in a line, as the card says it.
29 summary TEXT NOT NULL,
30 asked_by TEXT,
31 status TEXT NOT NULL DEFAULT 'pending',
32 decided_by TEXT,
33 decided_at TEXT,
34 -- What came of it, as the agent was told.
35 result TEXT,
36 created_at TEXT NOT NULL,
37 updated_at TEXT NOT NULL
38);
39CREATE INDEX agent_ability_requests_session ON agent_ability_requests (session_id, status);
40CREATE INDEX agent_ability_requests_agent ON agent_ability_requests (agent_id, created_at);