@concord-ai/concord-mcp 0.3.0 → 0.4.1
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/README.md +48 -10
- package/dist/artifacts/index.js +3 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/artifacts/work-state-json.d.ts +3 -2
- package/dist/artifacts/work-state-json.js +15 -2
- package/dist/artifacts/work-state-json.js.map +1 -1
- package/dist/artifacts/work-state-view.d.ts +9 -1
- package/dist/artifacts/work-state-view.js +30 -2
- package/dist/artifacts/work-state-view.js.map +1 -1
- package/dist/cli/commands/dashboard.d.ts +6 -0
- package/dist/cli/commands/dashboard.js +45 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/hook.d.ts +17 -0
- package/dist/cli/commands/hook.js +73 -1
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/who.d.ts +4 -0
- package/dist/cli/commands/who.js +17 -0
- package/dist/cli/commands/who.js.map +1 -0
- package/dist/cli/dashboard/app.d.ts +10 -0
- package/dist/cli/dashboard/app.js +237 -0
- package/dist/cli/dashboard/app.js.map +1 -0
- package/dist/cli/dashboard/model.d.ts +18 -0
- package/dist/cli/dashboard/model.js +29 -0
- package/dist/cli/dashboard/model.js.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/update-notifier.d.ts +19 -0
- package/dist/cli/update-notifier.js +127 -0
- package/dist/cli/update-notifier.js.map +1 -0
- package/dist/config/paths.d.ts +11 -0
- package/dist/config/paths.js +21 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/db/index.d.ts +4 -1
- package/dist/db/index.js +2 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/repositories/agents.d.ts +27 -0
- package/dist/db/repositories/agents.js +68 -0
- package/dist/db/repositories/agents.js.map +1 -0
- package/dist/db/repositories/tasks.d.ts +1 -0
- package/dist/db/repositories/tasks.js +3 -2
- package/dist/db/repositories/tasks.js.map +1 -1
- package/dist/db/rows.d.ts +25 -0
- package/dist/db/rows.js +38 -0
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +27 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/domain/presence.d.ts +54 -0
- package/dist/domain/presence.js +86 -0
- package/dist/domain/presence.js.map +1 -0
- package/dist/domain/schemas.d.ts +59 -5
- package/dist/domain/schemas.js +33 -0
- package/dist/domain/schemas.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/install/claude-hooks.d.ts +9 -6
- package/dist/install/claude-hooks.js +31 -17
- package/dist/install/claude-hooks.js.map +1 -1
- package/dist/install/instructions.d.ts +1 -1
- package/dist/install/instructions.js +17 -7
- package/dist/install/instructions.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/claim-work.js +5 -0
- package/dist/tools/claim-work.js.map +1 -1
- package/dist/tools/get-work-state.js +6 -3
- package/dist/tools/get-work-state.js.map +1 -1
- package/dist/tools/handoff.js +4 -0
- package/dist/tools/handoff.js.map +1 -1
- package/dist/tools/register-agent.d.ts +23 -0
- package/dist/tools/register-agent.js +83 -0
- package/dist/tools/register-agent.js.map +1 -0
- package/dist/tools/review-ready.js +1 -0
- package/dist/tools/review-ready.js.map +1 -1
- package/dist/tools/update-task.js +3 -0
- package/dist/tools/update-task.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConcordDatabase } from '../connection.js';
|
|
2
|
+
import { type AgentRecord, type AgentStatus } from '../rows.js';
|
|
3
|
+
/** A registration payload. Optional fields are explicit `null`. `agentId` is
|
|
4
|
+
* supplied by the caller (generated once per session and reused). */
|
|
5
|
+
export interface NewAgent {
|
|
6
|
+
agentId: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
owner: string | null;
|
|
9
|
+
model: string | null;
|
|
10
|
+
pid: number | null;
|
|
11
|
+
cwd: string | null;
|
|
12
|
+
worktree: string | null;
|
|
13
|
+
branch: string | null;
|
|
14
|
+
summary: string | null;
|
|
15
|
+
status: AgentStatus;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentRepository {
|
|
18
|
+
/** Insert or refresh an agent. On re-registration the mutable fields and
|
|
19
|
+
* `last_seen` are updated while `first_seen` is preserved. */
|
|
20
|
+
upsert(agent: NewAgent): AgentRecord;
|
|
21
|
+
get(agentId: string): AgentRecord | undefined;
|
|
22
|
+
list(): AgentRecord[];
|
|
23
|
+
/** Bump `last_seen` to now so an agent stays present just by doing work.
|
|
24
|
+
* Returns undefined if the agent has never registered. */
|
|
25
|
+
touch(agentId: string): AgentRecord | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare function createAgentRepository(db: ConcordDatabase): AgentRepository;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { parseAgentRow } from '../rows.js';
|
|
3
|
+
const rawListSchema = z.array(z.unknown());
|
|
4
|
+
export function createAgentRepository(db) {
|
|
5
|
+
const upsertStmt = db.prepare(`
|
|
6
|
+
INSERT INTO agents (
|
|
7
|
+
agent_id, kind, owner, model, pid, cwd, worktree, branch, summary, status,
|
|
8
|
+
first_seen, last_seen
|
|
9
|
+
) VALUES (
|
|
10
|
+
@agent_id, @kind, @owner, @model, @pid, @cwd, @worktree, @branch, @summary, @status,
|
|
11
|
+
@now, @now
|
|
12
|
+
)
|
|
13
|
+
ON CONFLICT(agent_id) DO UPDATE SET
|
|
14
|
+
kind = excluded.kind,
|
|
15
|
+
owner = excluded.owner,
|
|
16
|
+
model = excluded.model,
|
|
17
|
+
pid = excluded.pid,
|
|
18
|
+
cwd = excluded.cwd,
|
|
19
|
+
worktree = excluded.worktree,
|
|
20
|
+
branch = excluded.branch,
|
|
21
|
+
summary = excluded.summary,
|
|
22
|
+
status = excluded.status,
|
|
23
|
+
last_seen = excluded.last_seen
|
|
24
|
+
`);
|
|
25
|
+
const getStmt = db.prepare('SELECT * FROM agents WHERE agent_id = ?');
|
|
26
|
+
const listStmt = db.prepare('SELECT * FROM agents ORDER BY first_seen ASC, agent_id ASC');
|
|
27
|
+
const touchStmt = db.prepare('UPDATE agents SET last_seen = @now WHERE agent_id = @agent_id');
|
|
28
|
+
function get(agentId) {
|
|
29
|
+
const raw = getStmt.get(agentId);
|
|
30
|
+
if (raw === undefined) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return parseAgentRow(raw);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
upsert(agent) {
|
|
37
|
+
const now = new Date().toISOString();
|
|
38
|
+
upsertStmt.run({
|
|
39
|
+
agent_id: agent.agentId,
|
|
40
|
+
kind: agent.kind,
|
|
41
|
+
owner: agent.owner,
|
|
42
|
+
model: agent.model,
|
|
43
|
+
pid: agent.pid,
|
|
44
|
+
cwd: agent.cwd,
|
|
45
|
+
worktree: agent.worktree,
|
|
46
|
+
branch: agent.branch,
|
|
47
|
+
summary: agent.summary,
|
|
48
|
+
status: agent.status,
|
|
49
|
+
now,
|
|
50
|
+
});
|
|
51
|
+
const stored = get(agent.agentId);
|
|
52
|
+
if (stored === undefined) {
|
|
53
|
+
throw new Error(`Agent ${agent.agentId} could not be read back after upsert`);
|
|
54
|
+
}
|
|
55
|
+
return stored;
|
|
56
|
+
},
|
|
57
|
+
get,
|
|
58
|
+
list() {
|
|
59
|
+
const raw = listStmt.all();
|
|
60
|
+
return rawListSchema.parse(raw).map(parseAgentRow);
|
|
61
|
+
},
|
|
62
|
+
touch(agentId) {
|
|
63
|
+
touchStmt.run({ agent_id: agentId, now: new Date().toISOString() });
|
|
64
|
+
return get(agentId);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","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AO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,GAAG;aACJ,CAAC,CAAC;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;YAChF,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,GAAG;QACH,IAAI;YACF,MAAM,GAAG,GAAY,QAAQ,CAAC,GAAG,EAAE,CAAC;YACpC,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrD,CAAC;QACD,KAAK,CAAC,OAAO;YACX,SAAS,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACpE,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -6,11 +6,11 @@ export function createTaskRepository(db) {
|
|
|
6
6
|
INSERT INTO tasks (
|
|
7
7
|
task_id, title, owner, agent, branch, worktree,
|
|
8
8
|
expected_files, modules, domains, risk_tags, notes, status,
|
|
9
|
-
parent_task_id, created_at, updated_at
|
|
9
|
+
parent_task_id, agent_id, created_at, updated_at
|
|
10
10
|
) VALUES (
|
|
11
11
|
@task_id, @title, @owner, @agent, @branch, @worktree,
|
|
12
12
|
@expected_files, @modules, @domains, @risk_tags, @notes, @status,
|
|
13
|
-
@parent_task_id, @created_at, @updated_at
|
|
13
|
+
@parent_task_id, @agent_id, @created_at, @updated_at
|
|
14
14
|
)
|
|
15
15
|
`);
|
|
16
16
|
const getStmt = db.prepare('SELECT * FROM tasks WHERE task_id = ?');
|
|
@@ -43,6 +43,7 @@ export function createTaskRepository(db) {
|
|
|
43
43
|
notes: task.notes,
|
|
44
44
|
status: 'active',
|
|
45
45
|
parent_task_id: task.parentTaskId,
|
|
46
|
+
agent_id: task.agentId,
|
|
46
47
|
created_at: now,
|
|
47
48
|
updated_at: now,
|
|
48
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/db/repositories/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAoC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/db/repositories/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAoC,MAAM,YAAY,CAAC;AAoClG,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAE3C,MAAM,UAAU,oBAAoB,CAAC,EAAmB;IACtD,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC;;;;;;;;;;GAU7B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,0DAA0D,CAAC,CAAC;IACxF,MAAM,gBAAgB,GAAG,EAAE,CAAC,OAAO,CACjC,sFAAsF,CACvF,CAAC;IACF,MAAM,eAAe,GAAG,EAAE,CAAC,OAAO,CAChC;;8BAE0B,CAC3B,CAAC;IAEF,SAAS,GAAG,CAAC,MAAc;QACzB,MAAM,GAAG,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO,S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AAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACpD,CAAC;QACD,YAAY,CAAC,MAAM,EAAE,MAAM;YACzB,gBAAgB,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACxF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;QACD,WAAW,CAAC,MAAM,EAAE,KAAK;YACvB,eAAe,CAAC,GAAG,CAAC;gBAClB,OAAO,EAAE,MAAM;gBACf,cAAc,EAAE,oBAAoB,CAAC,KAAK,CAAC,aAAa,CAAC;gBACzD,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC;gBAC5C,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC;gBAC5C,SAAS,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAC/C,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACrC,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/db/rows.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ export interface TaskRecord {
|
|
|
40
40
|
status: TaskStatus;
|
|
41
41
|
/** The parent task this is a subtask of, or null for a top-level task. */
|
|
42
42
|
parentTaskId: string | null;
|
|
43
|
+
/** The agent instance (register_agent identity) that claimed this, or null.
|
|
44
|
+
* Distinct from `agent` (the kind string): used to check the claimant's
|
|
45
|
+
* liveness for stale-claim detection. */
|
|
46
|
+
agentId: string | null;
|
|
43
47
|
createdAt: string;
|
|
44
48
|
updatedAt: string;
|
|
45
49
|
}
|
|
@@ -93,3 +97,24 @@ export interface EventRecord {
|
|
|
93
97
|
createdAt: string;
|
|
94
98
|
}
|
|
95
99
|
export declare function parseEventRow(raw: unknown): EventRecord;
|
|
100
|
+
/** Status an agent reports about its own work. Liveness (live/idle/away) is
|
|
101
|
+
* derived separately from `last_seen` in `domain/presence.ts`. */
|
|
102
|
+
export declare const agentStatusValues: readonly ["active", "blocked", "waiting_review", "done"];
|
|
103
|
+
export type AgentStatus = (typeof agentStatusValues)[number];
|
|
104
|
+
/** A registered agent instance. `agentId` is a distinct per-session identity
|
|
105
|
+
* (e.g. `claude-code:7p8v`), unlike the `agent` *kind* string on a task. */
|
|
106
|
+
export interface AgentRecord {
|
|
107
|
+
agentId: string;
|
|
108
|
+
kind: string;
|
|
109
|
+
owner: string | null;
|
|
110
|
+
model: string | null;
|
|
111
|
+
pid: number | null;
|
|
112
|
+
cwd: string | null;
|
|
113
|
+
worktree: string | null;
|
|
114
|
+
branch: string | null;
|
|
115
|
+
summary: string | null;
|
|
116
|
+
status: AgentStatus;
|
|
117
|
+
firstSeen: string;
|
|
118
|
+
lastSeen: string;
|
|
119
|
+
}
|
|
120
|
+
export declare function parseAgentRow(raw: unknown): AgentRecord;
|
package/dist/db/rows.js
CHANGED
|
@@ -46,6 +46,7 @@ const taskDbRowSchema = z.object({
|
|
|
46
46
|
notes: z.string().nullable(),
|
|
47
47
|
status: taskStatusSchema,
|
|
48
48
|
parent_task_id: z.string().nullable(),
|
|
49
|
+
agent_id: z.string().nullable(),
|
|
49
50
|
created_at: z.string(),
|
|
50
51
|
updated_at: z.string(),
|
|
51
52
|
});
|
|
@@ -65,6 +66,7 @@ export function parseTaskRow(raw) {
|
|
|
65
66
|
notes: row.notes,
|
|
66
67
|
status: row.status,
|
|
67
68
|
parentTaskId: row.parent_task_id,
|
|
69
|
+
agentId: row.agent_id,
|
|
68
70
|
createdAt: row.created_at,
|
|
69
71
|
updatedAt: row.updated_at,
|
|
70
72
|
};
|
|
@@ -179,4 +181,40 @@ export function parseEventRow(raw) {
|
|
|
179
181
|
createdAt: row.created_at,
|
|
180
182
|
};
|
|
181
183
|
}
|
|
184
|
+
// --- agents ----------------------------------------------------------------
|
|
185
|
+
/** Status an agent reports about its own work. Liveness (live/idle/away) is
|
|
186
|
+
* derived separately from `last_seen` in `domain/presence.ts`. */
|
|
187
|
+
export const agentStatusValues = ['active', 'blocked', 'waiting_review', 'done'];
|
|
188
|
+
const agentStatusSchema = z.enum(agentStatusValues);
|
|
189
|
+
const agentDbRowSchema = z.object({
|
|
190
|
+
agent_id: z.string(),
|
|
191
|
+
kind: z.string(),
|
|
192
|
+
owner: z.string().nullable(),
|
|
193
|
+
model: z.string().nullable(),
|
|
194
|
+
pid: z.number().int().nullable(),
|
|
195
|
+
cwd: z.string().nullable(),
|
|
196
|
+
worktree: z.string().nullable(),
|
|
197
|
+
branch: z.string().nullable(),
|
|
198
|
+
summary: z.string().nullable(),
|
|
199
|
+
status: agentStatusSchema,
|
|
200
|
+
first_seen: z.string(),
|
|
201
|
+
last_seen: z.string(),
|
|
202
|
+
});
|
|
203
|
+
export function parseAgentRow(raw) {
|
|
204
|
+
const row = agentDbRowSchema.parse(raw);
|
|
205
|
+
return {
|
|
206
|
+
agentId: row.agent_id,
|
|
207
|
+
kind: row.kind,
|
|
208
|
+
owner: row.owner,
|
|
209
|
+
model: row.model,
|
|
210
|
+
pid: row.pid,
|
|
211
|
+
cwd: row.cwd,
|
|
212
|
+
worktree: row.worktree,
|
|
213
|
+
branch: row.branch,
|
|
214
|
+
summary: row.summary,
|
|
215
|
+
status: row.status,
|
|
216
|
+
firstSeen: row.first_seen,
|
|
217
|
+
lastSeen: row.last_seen,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
182
220
|
//# sourceMappingURL=rows.js.map
|
package/dist/db/rows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/db/rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,Y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C,KAAK;QAChB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,QAAQ,EAAE,GAAG,CAAC,SAAS;KACxB,CAAC;AACJ,CAAC"}
|
package/dist/db/schema.js
CHANGED
|
@@ -86,6 +86,33 @@ export const migrations = [
|
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
CREATE INDEX idx_task_updates_task_id ON task_updates(task_id);
|
|
89
|
+
`,
|
|
90
|
+
// 005 — agent presence registry. Each running agent registers a distinct
|
|
91
|
+
// instance identity (agent_id) so concurrent agents are distinguishable and
|
|
92
|
+
// can see who else is active. Liveness is derived from last_seen, not stored.
|
|
93
|
+
`
|
|
94
|
+
CREATE TABLE agents (
|
|
95
|
+
agent_id TEXT PRIMARY KEY,
|
|
96
|
+
kind TEXT NOT NULL,
|
|
97
|
+
owner TEXT,
|
|
98
|
+
model TEXT,
|
|
99
|
+
pid INTEGER,
|
|
100
|
+
cwd TEXT,
|
|
101
|
+
worktree TEXT,
|
|
102
|
+
branch TEXT,
|
|
103
|
+
summary TEXT,
|
|
104
|
+
status TEXT NOT NULL DEFAULT 'active',
|
|
105
|
+
first_seen TEXT NOT NULL,
|
|
106
|
+
last_seen TEXT NOT NULL
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
CREATE INDEX idx_agents_last_seen ON agents(last_seen);
|
|
110
|
+
`,
|
|
111
|
+
// 006 — link a claim to the agent instance that made it, so stale claims
|
|
112
|
+
// (an active task whose owning agent has gone away) can be detected. A soft
|
|
113
|
+
// reference (no FK): the agent may register after, or not at all.
|
|
114
|
+
`
|
|
115
|
+
ALTER TABLE tasks ADD COLUMN agent_id TEXT;
|
|
89
116
|
`,
|
|
90
117
|
];
|
|
91
118
|
//# sourceMappingURL=schema.js.map
|
package/dist/db/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,iDAAiD;IACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CC;IACD,iDAAiD;IACjD;;;;;;;;;;;;;;;GAeC;IACD,6EAA6E;IAC7E,wDAAwD;IACxD;;GAEC;IACD,uEAAuE;IACvE;;;;;;;;;;;GAWC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,iDAAiD;IACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CC;IACD,iDAAiD;IACjD;;;;;;;;;;;;;;;GAeC;IACD,6EAA6E;IAC7E,wDAAwD;IACxD;;GAEC;IACD,uEAAuE;IACvE;;;;;;;;;;;GAWC;IACD,yEAAyE;IACzE,4EAA4E;IAC5E,8EAA8E;IAC9E;;;;;;;;;;;;;;;;;GAiBC;IACD,yEAAyE;IACzE,4EAA4E;IAC5E,kEAAkE;IAClE;;GAEC;CACF,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AgentRecord, AgentStatus, TaskRecord } from '../db/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Liveness is *derived* from how long ago an agent was last seen — never stored.
|
|
4
|
+
* A registered claim is durable, but presence must decay so a crashed or
|
|
5
|
+
* walked-away agent stops looking active. Distinct from the agent's *reported*
|
|
6
|
+
* status (active/blocked/waiting_review/done), which says what it is doing.
|
|
7
|
+
*/
|
|
8
|
+
export type Liveness = 'live' | 'idle' | 'away';
|
|
9
|
+
/** How long since `last_seen` before an agent is considered idle, then away. */
|
|
10
|
+
export interface PresenceThresholds {
|
|
11
|
+
idleAfterMs: number;
|
|
12
|
+
awayAfterMs: number;
|
|
13
|
+
}
|
|
14
|
+
/** Live under 5 min, idle under 30 min, away beyond. */
|
|
15
|
+
export declare const DEFAULT_PRESENCE_THRESHOLDS: PresenceThresholds;
|
|
16
|
+
/** A single agent's presence for display in a roster. */
|
|
17
|
+
export interface PresenceEntry {
|
|
18
|
+
agentId: string;
|
|
19
|
+
kind: string;
|
|
20
|
+
owner: string | null;
|
|
21
|
+
summary: string | null;
|
|
22
|
+
status: AgentStatus;
|
|
23
|
+
liveness: Liveness;
|
|
24
|
+
lastSeen: string;
|
|
25
|
+
/** Whole seconds since `last_seen`, floored at 0. */
|
|
26
|
+
ageSeconds: number;
|
|
27
|
+
}
|
|
28
|
+
/** Derive liveness from a `last_seen` ISO timestamp relative to `now` (ms since
|
|
29
|
+
* epoch). Unparseable timestamps are treated as `away`. */
|
|
30
|
+
export declare function deriveLiveness(lastSeen: string, now: number, thresholds?: PresenceThresholds): Liveness;
|
|
31
|
+
/**
|
|
32
|
+
* Build the presence roster from registered agents: live agents first, then by
|
|
33
|
+
* most-recently-seen. This is the "who is here and what are they doing" view
|
|
34
|
+
* that other agents read before or while working.
|
|
35
|
+
*/
|
|
36
|
+
/** An active claim whose owning agent is no longer reliably present. */
|
|
37
|
+
export interface StaleClaim {
|
|
38
|
+
taskId: string;
|
|
39
|
+
title: string;
|
|
40
|
+
agentId: string;
|
|
41
|
+
/** Why it is stale: the agent is `away`, or was never seen (unregistered). */
|
|
42
|
+
reason: 'agent-away' | 'agent-unregistered';
|
|
43
|
+
/** Seconds since the owning agent was last seen, or null when unregistered. */
|
|
44
|
+
ageSeconds: number | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Flag active claims whose owning agent has gone away — the "agent walked off
|
|
48
|
+
* without handing off" case a durable claim alone cannot surface. Only claims
|
|
49
|
+
* carrying an `agentId` are assessed; unattributed claims are left alone (they
|
|
50
|
+
* predate presence and would be noise). A claim is stale when its agent is
|
|
51
|
+
* `away`, or when the referenced agent never registered.
|
|
52
|
+
*/
|
|
53
|
+
export declare function detectStaleClaims(tasks: readonly TaskRecord[], agents: readonly AgentRecord[], now: number, thresholds?: PresenceThresholds): StaleClaim[];
|
|
54
|
+
export declare function buildRoster(agents: readonly AgentRecord[], now: number, thresholds?: PresenceThresholds): PresenceEntry[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Live under 5 min, idle under 30 min, away beyond. */
|
|
2
|
+
export const DEFAULT_PRESENCE_THRESHOLDS = {
|
|
3
|
+
idleAfterMs: 5 * 60 * 1000,
|
|
4
|
+
awayAfterMs: 30 * 60 * 1000,
|
|
5
|
+
};
|
|
6
|
+
/** Derive liveness from a `last_seen` ISO timestamp relative to `now` (ms since
|
|
7
|
+
* epoch). Unparseable timestamps are treated as `away`. */
|
|
8
|
+
export function deriveLiveness(lastSeen, now, thresholds = DEFAULT_PRESENCE_THRESHOLDS) {
|
|
9
|
+
const seen = Date.parse(lastSeen);
|
|
10
|
+
if (Number.isNaN(seen)) {
|
|
11
|
+
return 'away';
|
|
12
|
+
}
|
|
13
|
+
const age = now - seen;
|
|
14
|
+
if (age >= thresholds.awayAfterMs) {
|
|
15
|
+
return 'away';
|
|
16
|
+
}
|
|
17
|
+
if (age >= thresholds.idleAfterMs) {
|
|
18
|
+
return 'idle';
|
|
19
|
+
}
|
|
20
|
+
return 'live';
|
|
21
|
+
}
|
|
22
|
+
const LIVENESS_ORDER = { live: 0, idle: 1, away: 2 };
|
|
23
|
+
function ageSecondsOf(lastSeen, now) {
|
|
24
|
+
const seen = Date.parse(lastSeen);
|
|
25
|
+
if (Number.isNaN(seen)) {
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
return Math.max(0, Math.floor((now - seen) / 1000));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Flag active claims whose owning agent has gone away — the "agent walked off
|
|
32
|
+
* without handing off" case a durable claim alone cannot surface. Only claims
|
|
33
|
+
* carrying an `agentId` are assessed; unattributed claims are left alone (they
|
|
34
|
+
* predate presence and would be noise). A claim is stale when its agent is
|
|
35
|
+
* `away`, or when the referenced agent never registered.
|
|
36
|
+
*/
|
|
37
|
+
export function detectStaleClaims(tasks, agents, now, thresholds = DEFAULT_PRESENCE_THRESHOLDS) {
|
|
38
|
+
const byId = new Map(agents.map((agent) => [agent.agentId, agent]));
|
|
39
|
+
const stale = [];
|
|
40
|
+
for (const task of tasks) {
|
|
41
|
+
if (task.status !== 'active' || task.agentId === null) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const agent = byId.get(task.agentId);
|
|
45
|
+
if (agent === undefined) {
|
|
46
|
+
stale.push({
|
|
47
|
+
taskId: task.taskId,
|
|
48
|
+
title: task.title,
|
|
49
|
+
agentId: task.agentId,
|
|
50
|
+
reason: 'agent-unregistered',
|
|
51
|
+
ageSeconds: null,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else if (deriveLiveness(agent.lastSeen, now, thresholds) === 'away') {
|
|
55
|
+
stale.push({
|
|
56
|
+
taskId: task.taskId,
|
|
57
|
+
title: task.title,
|
|
58
|
+
agentId: task.agentId,
|
|
59
|
+
reason: 'agent-away',
|
|
60
|
+
ageSeconds: ageSecondsOf(agent.lastSeen, now),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return stale;
|
|
65
|
+
}
|
|
66
|
+
export function buildRoster(agents, now, thresholds = DEFAULT_PRESENCE_THRESHOLDS) {
|
|
67
|
+
return agents
|
|
68
|
+
.map((agent) => ({
|
|
69
|
+
agentId: agent.agentId,
|
|
70
|
+
kind: agent.kind,
|
|
71
|
+
owner: agent.owner,
|
|
72
|
+
summary: agent.summary,
|
|
73
|
+
status: agent.status,
|
|
74
|
+
liveness: deriveLiveness(agent.lastSeen, now, thresholds),
|
|
75
|
+
lastSeen: agent.lastSeen,
|
|
76
|
+
ageSeconds: ageSecondsOf(agent.lastSeen, now),
|
|
77
|
+
}))
|
|
78
|
+
.sort((a, b) => {
|
|
79
|
+
const byLiveness = LIVENESS_ORDER[a.liveness] - LIVENESS_ORDER[b.liveness];
|
|
80
|
+
if (byLiveness !== 0) {
|
|
81
|
+
return byLiveness;
|
|
82
|
+
}
|
|
83
|
+
return b.lastSeen.localeCompare(a.lastSeen);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=presence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../../src/domain/presence.ts"],"names":[],"mappings":"AAgBA,wDAAwD;AACxD,MAAM,CAAC,MAAM,2BAA2B,GAAuB;IAC7D,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;IAC1B,WAAW,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;CAC5B,CAAC;AAeF;2DAC2D;AAC3D,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,GAAW,EACX,aAAiC,2BAA2B;IAE5D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IACvB,IAAI,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,cAAc,GAA6B,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,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AAC;AACP,CAAC"}
|
package/dist/domain/schemas.d.ts
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare const registerAgentInputShape: {
|
|
3
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
readonly kind: z.ZodString;
|
|
5
|
+
readonly owner: z.ZodOptional<z.ZodString>;
|
|
6
|
+
readonly model: z.ZodOptional<z.ZodString>;
|
|
7
|
+
readonly summary: z.ZodOptional<z.ZodString>;
|
|
8
|
+
readonly status: z.ZodOptional<z.ZodEnum<["active", "blocked", "waiting_review", "done"]>>;
|
|
9
|
+
readonly branch: z.ZodOptional<z.ZodString>;
|
|
10
|
+
readonly worktree: z.ZodOptional<z.ZodString>;
|
|
11
|
+
readonly cwd: z.ZodOptional<z.ZodString>;
|
|
12
|
+
readonly pid: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
};
|
|
14
|
+
export declare const registerAgentInputSchema: z.ZodObject<{
|
|
15
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
readonly kind: z.ZodString;
|
|
17
|
+
readonly owner: z.ZodOptional<z.ZodString>;
|
|
18
|
+
readonly model: z.ZodOptional<z.ZodString>;
|
|
19
|
+
readonly summary: z.ZodOptional<z.ZodString>;
|
|
20
|
+
readonly status: z.ZodOptional<z.ZodEnum<["active", "blocked", "waiting_review", "done"]>>;
|
|
21
|
+
readonly branch: z.ZodOptional<z.ZodString>;
|
|
22
|
+
readonly worktree: z.ZodOptional<z.ZodString>;
|
|
23
|
+
readonly cwd: z.ZodOptional<z.ZodString>;
|
|
24
|
+
readonly pid: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
kind: string;
|
|
27
|
+
status?: "active" | "blocked" | "waiting_review" | "done" | undefined;
|
|
28
|
+
owner?: string | undefined;
|
|
29
|
+
branch?: string | undefined;
|
|
30
|
+
worktree?: string | undefined;
|
|
31
|
+
agent_id?: string | undefined;
|
|
32
|
+
model?: string | undefined;
|
|
33
|
+
pid?: number | undefined;
|
|
34
|
+
cwd?: string | undefined;
|
|
35
|
+
summary?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
kind: string;
|
|
38
|
+
status?: "active" | "blocked" | "waiting_review" | "done" | undefined;
|
|
39
|
+
owner?: string | undefined;
|
|
40
|
+
branch?: string | undefined;
|
|
41
|
+
worktree?: string | undefined;
|
|
42
|
+
agent_id?: string | undefined;
|
|
43
|
+
model?: string | undefined;
|
|
44
|
+
pid?: number | undefined;
|
|
45
|
+
cwd?: string | undefined;
|
|
46
|
+
summary?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export type RegisterAgentInput = z.infer<typeof registerAgentInputSchema>;
|
|
7
49
|
export declare const claimWorkInputShape: {
|
|
8
50
|
readonly task_id: z.ZodString;
|
|
9
51
|
readonly title: z.ZodString;
|
|
@@ -17,6 +59,7 @@ export declare const claimWorkInputShape: {
|
|
|
17
59
|
readonly domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
60
|
readonly risk_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
61
|
readonly notes: z.ZodOptional<z.ZodString>;
|
|
62
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
20
63
|
};
|
|
21
64
|
export declare const claimWorkInputSchema: z.ZodObject<{
|
|
22
65
|
readonly task_id: z.ZodString;
|
|
@@ -31,6 +74,7 @@ export declare const claimWorkInputSchema: z.ZodObject<{
|
|
|
31
74
|
readonly domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
75
|
readonly risk_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
76
|
readonly notes: z.ZodOptional<z.ZodString>;
|
|
77
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
34
78
|
}, "strip", z.ZodTypeAny, {
|
|
35
79
|
task_id: string;
|
|
36
80
|
title: string;
|
|
@@ -44,6 +88,7 @@ export declare const claimWorkInputSchema: z.ZodObject<{
|
|
|
44
88
|
risk_tags?: string[] | undefined;
|
|
45
89
|
notes?: string | undefined;
|
|
46
90
|
parent_task_id?: string | undefined;
|
|
91
|
+
agent_id?: string | undefined;
|
|
47
92
|
}, {
|
|
48
93
|
task_id: string;
|
|
49
94
|
title: string;
|
|
@@ -57,6 +102,7 @@ export declare const claimWorkInputSchema: z.ZodObject<{
|
|
|
57
102
|
risk_tags?: string[] | undefined;
|
|
58
103
|
notes?: string | undefined;
|
|
59
104
|
parent_task_id?: string | undefined;
|
|
105
|
+
agent_id?: string | undefined;
|
|
60
106
|
}>;
|
|
61
107
|
export type ClaimWorkInput = z.infer<typeof claimWorkInputSchema>;
|
|
62
108
|
export declare const updateTaskInputShape: {
|
|
@@ -64,22 +110,26 @@ export declare const updateTaskInputShape: {
|
|
|
64
110
|
readonly kind: z.ZodEnum<["intent", "progress", "assumption", "decision", "question", "answer", "blocker", "finding"]>;
|
|
65
111
|
readonly content: z.ZodString;
|
|
66
112
|
readonly agent: z.ZodOptional<z.ZodString>;
|
|
113
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
67
114
|
};
|
|
68
115
|
export declare const updateTaskInputSchema: z.ZodObject<{
|
|
69
116
|
readonly task_id: z.ZodString;
|
|
70
117
|
readonly kind: z.ZodEnum<["intent", "progress", "assumption", "decision", "question", "answer", "blocker", "finding"]>;
|
|
71
118
|
readonly content: z.ZodString;
|
|
72
119
|
readonly agent: z.ZodOptional<z.ZodString>;
|
|
120
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
73
121
|
}, "strip", z.ZodTypeAny, {
|
|
74
122
|
task_id: string;
|
|
75
123
|
kind: "intent" | "progress" | "assumption" | "decision" | "question" | "answer" | "blocker" | "finding";
|
|
76
124
|
content: string;
|
|
77
125
|
agent?: string | undefined;
|
|
126
|
+
agent_id?: string | undefined;
|
|
78
127
|
}, {
|
|
79
128
|
task_id: string;
|
|
80
129
|
kind: "intent" | "progress" | "assumption" | "decision" | "question" | "answer" | "blocker" | "finding";
|
|
81
130
|
content: string;
|
|
82
131
|
agent?: string | undefined;
|
|
132
|
+
agent_id?: string | undefined;
|
|
83
133
|
}>;
|
|
84
134
|
export type UpdateTaskInput = z.infer<typeof updateTaskInputSchema>;
|
|
85
135
|
export declare const getTaskContextInputShape: {
|
|
@@ -118,6 +168,7 @@ export declare const handoffInputShape: {
|
|
|
118
168
|
field: string;
|
|
119
169
|
source: string;
|
|
120
170
|
}>, "many">>;
|
|
171
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
121
172
|
};
|
|
122
173
|
export declare const handoffInputSchema: z.ZodObject<{
|
|
123
174
|
readonly task_id: z.ZodString;
|
|
@@ -144,10 +195,12 @@ export declare const handoffInputSchema: z.ZodObject<{
|
|
|
144
195
|
field: string;
|
|
145
196
|
source: string;
|
|
146
197
|
}>, "many">>;
|
|
198
|
+
readonly agent_id: z.ZodOptional<z.ZodString>;
|
|
147
199
|
}, "strip", z.ZodTypeAny, {
|
|
148
200
|
status: string;
|
|
149
201
|
task_id: string;
|
|
150
202
|
what_changed: string;
|
|
203
|
+
agent_id?: string | undefined;
|
|
151
204
|
changed_files?: string[] | undefined;
|
|
152
205
|
tests_run?: string[] | undefined;
|
|
153
206
|
known_risks?: string[] | undefined;
|
|
@@ -167,6 +220,7 @@ export declare const handoffInputSchema: z.ZodObject<{
|
|
|
167
220
|
status: string;
|
|
168
221
|
task_id: string;
|
|
169
222
|
what_changed: string;
|
|
223
|
+
agent_id?: string | undefined;
|
|
170
224
|
changed_files?: string[] | undefined;
|
|
171
225
|
tests_run?: string[] | undefined;
|
|
172
226
|
known_risks?: string[] | undefined;
|