@concord-ai/concord-mcp 0.8.0 → 0.9.0

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/dist/db/rows.d.ts CHANGED
@@ -128,7 +128,7 @@ export interface EventRecord {
128
128
  createdAt: string;
129
129
  }
130
130
  export declare function parseEventRow(raw: unknown): EventRecord;
131
- /** Status an agent reports about its own work. Liveness (live/idle/away) is
131
+ /** Status an agent reports about its own work. Liveness (live/idle/away/archived) is
132
132
  * derived separately from `last_seen` in `domain/presence.ts`. */
133
133
  export declare const agentStatusValues: readonly ["active", "blocked", "waiting_review", "done"];
134
134
  export type AgentStatus = (typeof agentStatusValues)[number];
package/dist/db/rows.js CHANGED
@@ -267,7 +267,7 @@ export function parseEventRow(raw) {
267
267
  };
268
268
  }
269
269
  // --- agents ----------------------------------------------------------------
270
- /** Status an agent reports about its own work. Liveness (live/idle/away) is
270
+ /** Status an agent reports about its own work. Liveness (live/idle/away/archived) is
271
271
  * derived separately from `last_seen` in `domain/presence.ts`. */
272
272
  export const agentStatusValues = ['active', 'blocked', 'waiting_review', 'done'];
273
273
  const agentStatusSchema = z.enum(agentStatusValues);
@@ -4,14 +4,18 @@ import type { AgentRecord, AgentStatus, TaskRecord } from '../db/index.js';
4
4
  * A registered claim is durable, but presence must decay so a crashed or
5
5
  * walked-away agent stops looking active. Distinct from the agent's *reported*
6
6
  * status (active/blocked/waiting_review/done), which says what it is doing.
7
+ * Agent records are never deleted: an agent unseen for long enough becomes
8
+ * `archived` and drops off the roster, but its id and history remain.
7
9
  */
8
- export type Liveness = 'live' | 'idle' | 'away';
9
- /** How long since `last_seen` before an agent is considered idle, then away. */
10
+ export type Liveness = 'live' | 'idle' | 'away' | 'archived';
11
+ /** How long since `last_seen` before an agent is considered idle, away, then
12
+ * archived. */
10
13
  export interface PresenceThresholds {
11
14
  idleAfterMs: number;
12
15
  awayAfterMs: number;
16
+ archiveAfterMs: number;
13
17
  }
14
- /** Live under 5 min, idle under 30 min, away beyond. */
18
+ /** Live under 5 min, idle under 30 min, away under 1 h, archived beyond. */
15
19
  export declare const DEFAULT_PRESENCE_THRESHOLDS: PresenceThresholds;
16
20
  /** A single agent's presence for display in a roster. */
17
21
  export interface PresenceEntry {
@@ -26,12 +30,14 @@ export interface PresenceEntry {
26
30
  ageSeconds: number;
27
31
  }
28
32
  /** Derive liveness from a `last_seen` ISO timestamp relative to `now` (ms since
29
- * epoch). Unparseable timestamps are treated as `away`. */
33
+ * epoch). Unparseable timestamps are treated as `archived` — an agent whose
34
+ * last activity cannot be read must not sit on the roster forever. */
30
35
  export declare function deriveLiveness(lastSeen: string, now: number, thresholds?: PresenceThresholds): Liveness;
31
36
  /**
32
37
  * Build the presence roster from registered agents: live agents first, then by
33
38
  * most-recently-seen. This is the "who is here and what are they doing" view
34
- * that other agents read before or while working.
39
+ * that other agents read before or while working. Archived agents are omitted
40
+ * — they stay registered forever, they just no longer appear here.
35
41
  */
36
42
  /** An active claim whose owning agent is no longer reliably present. */
37
43
  export interface StaleClaim {
@@ -48,7 +54,7 @@ export interface StaleClaim {
48
54
  * without handing off" case a durable claim alone cannot surface. Only claims
49
55
  * carrying an `agentId` are assessed; unattributed claims are left alone (they
50
56
  * predate presence and would be noise). A claim is stale when its agent is
51
- * `away`, or when the referenced agent never registered.
57
+ * `away` or `archived`, or when the referenced agent never registered.
52
58
  */
53
59
  export declare function detectStaleClaims(tasks: readonly TaskRecord[], agents: readonly AgentRecord[], now: number, thresholds?: PresenceThresholds): StaleClaim[];
54
60
  export declare function buildRoster(agents: readonly AgentRecord[], now: number, thresholds?: PresenceThresholds): PresenceEntry[];
@@ -1,16 +1,21 @@
1
- /** Live under 5 min, idle under 30 min, away beyond. */
1
+ /** Live under 5 min, idle under 30 min, away under 1 h, archived beyond. */
2
2
  export const DEFAULT_PRESENCE_THRESHOLDS = {
3
3
  idleAfterMs: 5 * 60 * 1000,
4
4
  awayAfterMs: 30 * 60 * 1000,
5
+ archiveAfterMs: 60 * 60 * 1000,
5
6
  };
6
7
  /** Derive liveness from a `last_seen` ISO timestamp relative to `now` (ms since
7
- * epoch). Unparseable timestamps are treated as `away`. */
8
+ * epoch). Unparseable timestamps are treated as `archived` — an agent whose
9
+ * last activity cannot be read must not sit on the roster forever. */
8
10
  export function deriveLiveness(lastSeen, now, thresholds = DEFAULT_PRESENCE_THRESHOLDS) {
9
11
  const seen = Date.parse(lastSeen);
10
12
  if (Number.isNaN(seen)) {
11
- return 'away';
13
+ return 'archived';
12
14
  }
13
15
  const age = now - seen;
16
+ if (age >= thresholds.archiveAfterMs) {
17
+ return 'archived';
18
+ }
14
19
  if (age >= thresholds.awayAfterMs) {
15
20
  return 'away';
16
21
  }
@@ -19,7 +24,7 @@ export function deriveLiveness(lastSeen, now, thresholds = DEFAULT_PRESENCE_THRE
19
24
  }
20
25
  return 'live';
21
26
  }
22
- const LIVENESS_ORDER = { live: 0, idle: 1, away: 2 };
27
+ const LIVENESS_ORDER = { live: 0, idle: 1, away: 2, archived: 3 };
23
28
  function ageSecondsOf(lastSeen, now) {
24
29
  const seen = Date.parse(lastSeen);
25
30
  if (Number.isNaN(seen)) {
@@ -32,7 +37,7 @@ function ageSecondsOf(lastSeen, now) {
32
37
  * without handing off" case a durable claim alone cannot surface. Only claims
33
38
  * carrying an `agentId` are assessed; unattributed claims are left alone (they
34
39
  * predate presence and would be noise). A claim is stale when its agent is
35
- * `away`, or when the referenced agent never registered.
40
+ * `away` or `archived`, or when the referenced agent never registered.
36
41
  */
37
42
  export function detectStaleClaims(tasks, agents, now, thresholds = DEFAULT_PRESENCE_THRESHOLDS) {
38
43
  const byId = new Map(agents.map((agent) => [agent.agentId, agent]));
@@ -51,7 +56,7 @@ export function detectStaleClaims(tasks, agents, now, thresholds = DEFAULT_PRESE
51
56
  ageSeconds: null,
52
57
  });
53
58
  }
54
- else if (deriveLiveness(agent.lastSeen, now, thresholds) === 'away') {
59
+ else if (LIVENESS_ORDER[deriveLiveness(agent.lastSeen, now, thresholds)] >= LIVENESS_ORDER.away) {
55
60
  stale.push({
56
61
  taskId: task.taskId,
57
62
  title: task.title,
@@ -75,6 +80,7 @@ export function buildRoster(agents, now, thresholds = DEFAULT_PRESENCE_THRESHOLD
75
80
  lastSeen: agent.lastSeen,
76
81
  ageSeconds: ageSecondsOf(agent.lastSeen, now),
77
82
  }))
83
+ .filter((entry) => entry.liveness !== 'archived')
78
84
  .sort((a, b) => {
79
85
  const byLiveness = LIVENESS_ORDER[a.liveness] - LIVENESS_ORDER[b.liveness];
80
86
  if (byLiveness !== 0) {
@@ -1 +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,IAAI,EAAE,CAAC,EAAE,CAAC;AAE/E,SAA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dist/server.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { Repositories } from './db/index.js';
3
3
  import type { AgentIdentity } from './domain/identity.js';
4
4
  import { type WorkspaceContext, type WorkspaceManager } from './workspaces/manager.js';
5
5
  /** Concord's advertised MCP server version. */
6
- export declare const SERVER_VERSION = "0.8.0";
6
+ export declare const SERVER_VERSION = "0.9.0";
7
7
  export interface ServerOptions {
8
8
  /** Called after any tool writes to the database (used to regenerate artifacts). */
9
9
  onToolWrite?: (workspace: WorkspaceContext | undefined) => void;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Single source of truth for the package version, shared by the CLI and server. */
2
- export declare const VERSION = "0.8.0";
2
+ export declare const VERSION = "0.9.0";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Single source of truth for the package version, shared by the CLI and server. */
2
- export const VERSION = '0.8.0';
2
+ export const VERSION = '0.9.0';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concord-ai/concord-mcp",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Shared work-state and task memory for coding agents: coordinate work, preserve decisions, and hand off through MCP.",
5
5
  "keywords": [
6
6
  "mcp",