Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

32 lines · 1.1 KBRaw History
1-- People's own model API keys for agent tasks (agentic/keys.ts), encrypted per
2-- account and provider. Write-only: nothing ever returns `ciphertext` decrypted
3-- except the model proxy, while a task of that person runs.
4CREATE TABLE model_keys (
5 account_id TEXT NOT NULL,
6 provider TEXT NOT NULL,
7 ciphertext TEXT NOT NULL,
8 hint TEXT NOT NULL,
9 opted_in_at TEXT NOT NULL,
10 created_at TEXT NOT NULL,
11 updated_at TEXT NOT NULL,
12 PRIMARY KEY (account_id, provider)
13);
14
15-- An index of agent tasks across repositories (each repository's ProjectDO holds
16-- the tasks themselves), for Today and task lists.
17CREATE TABLE agent_tasks (
18 id TEXT PRIMARY KEY,
19 repo_id TEXT NOT NULL,
20 number INTEGER NOT NULL,
21 title TEXT NOT NULL,
22 runtime TEXT NOT NULL,
23 agent_id TEXT NOT NULL,
24 started_by TEXT NOT NULL,
25 state TEXT NOT NULL,
26 pr_number INTEGER,
27 created_at TEXT NOT NULL,
28 updated_at TEXT NOT NULL
29);
30CREATE INDEX agent_tasks_person ON agent_tasks(started_by, updated_at);
31CREATE INDEX agent_tasks_agent ON agent_tasks(agent_id, updated_at);
32CREATE UNIQUE INDEX agent_tasks_repo ON agent_tasks(repo_id, number);