@concord-ai/concord-mcp 0.6.0 → 0.6.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 +28 -28
- package/dist/artifacts/work-state-view.d.ts +8 -0
- package/dist/artifacts/work-state-view.js +19 -0
- package/dist/artifacts/work-state-view.js.map +1 -1
- package/dist/cli/commands/doctor.js +7 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +21 -0
- package/dist/cli/commands/setup.js +117 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/index.js +2 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/db/index.d.ts +7 -1
- package/dist/db/index.js +4 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/repositories/agent-endpoints.d.ts +22 -0
- package/dist/db/repositories/agent-endpoints.js +87 -0
- package/dist/db/repositories/agent-endpoints.js.map +1 -0
- package/dist/db/repositories/agent-messages.d.ts +25 -0
- package/dist/db/repositories/agent-messages.js +151 -0
- package/dist/db/repositories/agent-messages.js.map +1 -0
- package/dist/db/rows.d.ts +51 -0
- package/dist/db/rows.js +104 -0
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +64 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/domain/operations.d.ts +1 -1
- package/dist/domain/schemas.d.ts +9 -2
- package/dist/domain/schemas.js +21 -2
- package/dist/domain/schemas.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/install/agent-communications.d.ts +28 -0
- package/dist/install/agent-communications.js +61 -0
- package/dist/install/agent-communications.js.map +1 -0
- package/dist/install/instructions.d.ts +3 -3
- package/dist/install/instructions.js +5 -4
- package/dist/install/instructions.js.map +1 -1
- package/dist/install/mcp-config.d.ts +1 -1
- package/dist/install/mcp-config.js +9 -3
- package/dist/install/mcp-config.js.map +1 -1
- package/dist/relay/adapters.d.ts +33 -0
- package/dist/relay/adapters.js +70 -0
- package/dist/relay/adapters.js.map +1 -0
- package/dist/relay/index.d.ts +4 -0
- package/dist/relay/index.js +5 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/relay/protocol.d.ts +64 -0
- package/dist/relay/protocol.js +38 -0
- package/dist/relay/protocol.js.map +1 -0
- package/dist/relay/server.d.ts +40 -0
- package/dist/relay/server.js +196 -0
- package/dist/relay/server.js.map +1 -0
- package/dist/relay/socket-dispatcher.d.ts +9 -0
- package/dist/relay/socket-dispatcher.js +74 -0
- package/dist/relay/socket-dispatcher.js.map +1 -0
- package/dist/server.d.ts +4 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-messages.d.ts +45 -0
- package/dist/tools/agent-messages.js +158 -0
- package/dist/tools/agent-messages.js.map +1 -0
- package/dist/tools/get-task-context.d.ts +2 -1
- package/dist/tools/get-task-context.js +1 -0
- package/dist/tools/get-task-context.js.map +1 -1
- package/dist/tools/workflow.d.ts +11 -2
- package/dist/tools/workflow.js +152 -30
- package/dist/tools/workflow.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspaces/manager.js +6 -0
- package/dist/workspaces/manager.js.map +1 -1
- package/package.json +7 -1
- package/dist/cli/commands/init.d.ts +0 -6
- package/dist/cli/commands/init.js +0 -33
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/install.d.ts +0 -2
- package/dist/cli/commands/install.js +0 -44
- package/dist/cli/commands/install.js.map +0 -1
package/README.md
CHANGED
|
@@ -52,32 +52,23 @@ small MCP server.
|
|
|
52
52
|
|
|
53
53
|
## Quick start
|
|
54
54
|
|
|
55
|
-
### Cursor — one-click MCP install
|
|
56
|
-
|
|
57
|
-
[](cursor://anysphere.cursor-deeplink/mcp/install?name=concord&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjb25jb3JkLWFpL2NvbmNvcmQtbWNwQGxhdGVzdCJdfQ==)
|
|
58
|
-
|
|
59
|
-
The deeplink registers Concord with Cursor through `npx`. Install the CLI and
|
|
60
|
-
add Concord's always-on agent instructions to the current repository:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
npm install -g @concord-ai/concord-mcp
|
|
64
|
-
concord install
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Claude Code, Codex, and other MCP clients
|
|
68
|
-
|
|
69
55
|
```bash
|
|
70
56
|
npm install -g @concord-ai/concord-mcp
|
|
71
|
-
|
|
57
|
+
cd /path/to/your/repository
|
|
58
|
+
concord setup
|
|
72
59
|
```
|
|
73
60
|
|
|
74
|
-
`concord
|
|
61
|
+
`concord setup` creates the local `.concord/` workspace, registers the MCP server
|
|
75
62
|
(`.mcp.json`, `.cursor/mcp.json`, and Codex's `~/.codex/config.toml`) and writes
|
|
76
63
|
Concord's tool instructions into your client configs (`CLAUDE.md`, `AGENTS.md`,
|
|
77
64
|
`.codex/`, `.cursor/rules/`). It merges into existing config rather than
|
|
78
65
|
replacing it, and is safe to re-run. Pass `--no-mcp` to write only the
|
|
79
|
-
|
|
80
|
-
afterwards so it picks up the new server.
|
|
66
|
+
workspace and instructions while managing MCP registration yourself. Restart
|
|
67
|
+
your client afterwards so it picks up the new server.
|
|
68
|
+
|
|
69
|
+
In an interactive terminal, setup detects Codex, Claude, and Cursor and asks
|
|
70
|
+
once whether to enable their live-prompt integrations. Use
|
|
71
|
+
`concord setup --agent-comms` to approve them non-interactively.
|
|
81
72
|
|
|
82
73
|
- [Claude Code](./docs/claude-code.md)
|
|
83
74
|
- [Codex](./docs/codex.md)
|
|
@@ -105,18 +96,27 @@ available. Set `CONCORD_NO_UPDATE_CHECK=1` to disable this best-effort check.
|
|
|
105
96
|
|
|
106
97
|
## The tools
|
|
107
98
|
|
|
108
|
-
| Tool | Purpose
|
|
109
|
-
| --------------- |
|
|
110
|
-
| `start_work` | registers presence, claims or accepts one task, and reports scope overlaps before editing
|
|
111
|
-
| `inspect_work` | reads
|
|
112
|
-
| `update_work` | records
|
|
113
|
-
| `transfer_work` | assigns, accepts, declines, releases, reassigns, offers handoffs, or reopens versioned work
|
|
114
|
-
| `finish_work` | records evidence and optionally marks a task review-ready, complete, or closed
|
|
99
|
+
| Tool | Purpose |
|
|
100
|
+
| --------------- | ------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `start_work` | registers presence, claims or accepts one task, and reports scope overlaps before editing |
|
|
102
|
+
| `inspect_work` | reads workspace/task state, an agent inbox/outbox, or a durable prompt/reply thread |
|
|
103
|
+
| `update_work` | records task context or immediately prompts/replies to another promptable workspace agent |
|
|
104
|
+
| `transfer_work` | assigns, accepts, declines, releases, reassigns, offers handoffs, or reopens versioned work |
|
|
105
|
+
| `finish_work` | records evidence and optionally marks a task review-ready, complete, or closed |
|
|
115
106
|
|
|
116
107
|
Writes accept an `agent_id`, which keeps presence live just by working.
|
|
117
108
|
`inspect_work` shows **who is here** and flags **stale claims** — an active
|
|
118
109
|
claim whose owning agent has gone away without handing off.
|
|
119
110
|
|
|
111
|
+
For live agent-to-agent communication, run `concord setup --agent-comms` (or
|
|
112
|
+
accept the one-time interactive setup prompt), then restart existing client
|
|
113
|
+
sessions once. A prompt uses `update_work` with `operation: "prompt"`, the
|
|
114
|
+
target `to_agent_id`, content, and an `idempotency_key`; a reply uses
|
|
115
|
+
`operation: "reply"` and `reply_to_message_id`. Busy targets are steered into
|
|
116
|
+
their current turn, while idle targets start a new turn. Delivery fails
|
|
117
|
+
immediately when the named agent has no reachable relay; Concord does not
|
|
118
|
+
silently reroute it.
|
|
119
|
+
|
|
120
120
|
Concord resolves the repository workspace automatically. Operations return its
|
|
121
121
|
`workspace_id` and repository root so a client can detect a misrouted call; the
|
|
122
122
|
id can be passed explicitly when one server is coordinating multiple roots.
|
|
@@ -131,7 +131,7 @@ is retained in an append-only audit history.
|
|
|
131
131
|
### Migrating from the granular surface
|
|
132
132
|
|
|
133
133
|
The five tools replace the earlier public names; there are no legacy aliases.
|
|
134
|
-
Update the package and re-run `concord
|
|
134
|
+
Update the package and re-run `concord setup` to refresh generated
|
|
135
135
|
instructions. `concord doctor` reports stale instruction blocks.
|
|
136
136
|
|
|
137
137
|
| Earlier tools | Replacement |
|
|
@@ -161,7 +161,7 @@ To restrict explicit workspace selection, set `CONCORD_ALLOWED_ROOTS` to a
|
|
|
161
161
|
path-delimited list of allowed repository roots. Without an allowlist, decoded
|
|
162
162
|
roots must still exist and be directories.
|
|
163
163
|
|
|
164
|
-
`concord
|
|
164
|
+
`concord setup` adds `.concord/` to the
|
|
165
165
|
repository's `.gitignore`, so the generated workspace stays local by default.
|
|
166
166
|
Teams that want selected artifacts in PRs can remove that rule or force-add the
|
|
167
167
|
human-readable files:
|
|
@@ -181,7 +181,7 @@ call the tools directly; humans and CLI-oriented agents can work with the same
|
|
|
181
181
|
shared workspace through `concord` commands.
|
|
182
182
|
|
|
183
183
|
```bash
|
|
184
|
-
concord
|
|
184
|
+
concord setup # set up local state, instructions, and MCP clients
|
|
185
185
|
concord status # roster, active work, overlaps, stale claims, review-ready
|
|
186
186
|
concord dashboard # live, keyboard-driven view of agents, tasks, alerts, and activity
|
|
187
187
|
concord who # which agents are present and what they are working on
|
|
@@ -26,6 +26,12 @@ interface OpenQuestionEntry {
|
|
|
26
26
|
taskId: string;
|
|
27
27
|
question: string;
|
|
28
28
|
}
|
|
29
|
+
interface CommunicationEntry {
|
|
30
|
+
agentId: string;
|
|
31
|
+
promptable: boolean;
|
|
32
|
+
provider: string | null;
|
|
33
|
+
capabilities: string[];
|
|
34
|
+
}
|
|
29
35
|
/** A read-only snapshot of shared work-state: active claims, overlaps computed
|
|
30
36
|
* live across all active tasks, and review-ready tasks with their open
|
|
31
37
|
* questions. Rendered by both the CLI (`concord status`) and the
|
|
@@ -40,6 +46,8 @@ export interface StatusView {
|
|
|
40
46
|
presence: PresenceEntry[];
|
|
41
47
|
/** Active claims whose owning agent has gone away or never registered. */
|
|
42
48
|
staleClaims: StaleClaim[];
|
|
49
|
+
/** Prompt addressability without exposing provider session handles. */
|
|
50
|
+
communications: CommunicationEntry[];
|
|
43
51
|
}
|
|
44
52
|
export declare function buildStatus(repos: Repositories, now?: number): StatusView;
|
|
45
53
|
/** Render the presence roster as indented lines, or a placeholder when empty. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dirname } from 'node:path';
|
|
2
2
|
import { detectOverlaps } from '../domain/overlap.js';
|
|
3
|
+
import { endpointPromptable } from '../tools/agent-messages.js';
|
|
3
4
|
import { buildRoster, detectStaleClaims, } from '../domain/presence.js';
|
|
4
5
|
function touchesOf(task) {
|
|
5
6
|
const values = task.modules.length > 0 ? task.modules : task.expectedFiles.map((f) => dirname(f));
|
|
@@ -62,6 +63,15 @@ export function buildStatus(repos, now = Date.now()) {
|
|
|
62
63
|
openQuestions,
|
|
63
64
|
presence: buildRoster(repos.agents.list(), now),
|
|
64
65
|
staleClaims: detectStaleClaims(tasks, repos.agents.list(), now),
|
|
66
|
+
communications: repos.agents.list().map((agent) => {
|
|
67
|
+
const endpoint = repos.agentEndpoints.getByAgent(agent.agentId);
|
|
68
|
+
return {
|
|
69
|
+
agentId: agent.agentId,
|
|
70
|
+
promptable: endpointPromptable(endpoint, now),
|
|
71
|
+
provider: endpoint?.provider ?? null,
|
|
72
|
+
capabilities: endpoint?.capabilities ?? [],
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
65
75
|
};
|
|
66
76
|
}
|
|
67
77
|
/** Render the presence roster as indented lines, or a placeholder when empty. */
|
|
@@ -78,6 +88,15 @@ export function renderRosterLines(roster) {
|
|
|
78
88
|
export function renderStatusText(view) {
|
|
79
89
|
const lines = ['Concord workspace', '', "Who's here"];
|
|
80
90
|
lines.push(...renderRosterLines(view.presence));
|
|
91
|
+
lines.push('', 'Live prompting');
|
|
92
|
+
if (view.communications.length === 0) {
|
|
93
|
+
lines.push(' none');
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
for (const entry of view.communications) {
|
|
97
|
+
lines.push(` ${entry.agentId.padEnd(18)} ${entry.promptable ? 'promptable' : 'unreachable'}${entry.provider === null ? '' : ` via ${entry.provider}`}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
81
100
|
lines.push('', 'Active work');
|
|
82
101
|
if (view.active.length === 0) {
|
|
83
102
|
lines.push(' none');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-state-view.js","sourceRoot":"","sources":["../../src/artifacts/work-state-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,WAAW,EACX,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"work-state-view.js","sourceRoot":"","sources":["../../src/artifacts/work-state-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,WAAW,EACX,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAyD/B,SAAS,SAAS,CAAC,IAAgB;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAA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AAK,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -5,6 +5,8 @@ import { migrations } from '../../db/schema.js';
|
|
|
5
5
|
import { buildAdoption } from '../../domain/adoption.js';
|
|
6
6
|
import { BLOCK_END, BLOCK_START } from '../../install/block.js';
|
|
7
7
|
import { CONCORD_INSTRUCTION_VERSION } from '../../install/instructions.js';
|
|
8
|
+
import { readAgentCommunicationConfig } from '../../install/agent-communications.js';
|
|
9
|
+
import { endpointPromptable } from '../../tools/agent-messages.js';
|
|
8
10
|
import { openContext } from '../context.js';
|
|
9
11
|
const instructionTargets = [
|
|
10
12
|
'CLAUDE.md',
|
|
@@ -43,6 +45,9 @@ export function buildDoctorReport(ctx) {
|
|
|
43
45
|
const events = ctx.repos.events.list();
|
|
44
46
|
const adoption = buildAdoption(events);
|
|
45
47
|
const instructions = instructionStatus(ctx.repoRoot);
|
|
48
|
+
const communications = readAgentCommunicationConfig(ctx.concordPath);
|
|
49
|
+
const endpoints = ctx.repos.agentEndpoints.list();
|
|
50
|
+
const connectedEndpoints = endpoints.filter((endpoint) => endpointPromptable(endpoint));
|
|
46
51
|
const lines = [
|
|
47
52
|
'Concord doctor',
|
|
48
53
|
'',
|
|
@@ -52,6 +57,8 @@ export function buildDoctorReport(ctx) {
|
|
|
52
57
|
` concord.db ${existsSync(dbPath) ? 'ok' : 'missing'} (schema v${String(schemaVersion)}, expected v${String(migrations.length)})`,
|
|
53
58
|
` repo root ${ctx.repoRoot}`,
|
|
54
59
|
` instructions ${instructions}`,
|
|
60
|
+
` live prompts ${communications?.approved === true ? `enabled (${communications.providers.join(', ') || 'no detected clients'})` : 'not enabled'}`,
|
|
61
|
+
` endpoints ${String(connectedEndpoints.length)} reachable / ${String(endpoints.length)} registered`,
|
|
55
62
|
'',
|
|
56
63
|
'Activity',
|
|
57
64
|
` tasks: ${String(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CAAC;QACN,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,kBAAkB,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,mBAAmB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACjL,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import { type CommunicationProvider } from '../../install/agent-communications.js';
|
|
3
|
+
export interface SetupOptions {
|
|
4
|
+
claudeHooks?: boolean;
|
|
5
|
+
mcp?: boolean;
|
|
6
|
+
agentCommunications?: boolean;
|
|
7
|
+
communicationProviders?: readonly CommunicationProvider[];
|
|
8
|
+
env?: NodeJS.ProcessEnv;
|
|
9
|
+
}
|
|
10
|
+
export interface SetupResult {
|
|
11
|
+
repoRoot: string;
|
|
12
|
+
workspaceId: string;
|
|
13
|
+
concordPath: string;
|
|
14
|
+
written: string[];
|
|
15
|
+
communicationProviders: CommunicationProvider[];
|
|
16
|
+
}
|
|
17
|
+
/** Ensure Concord's generated workspace is ignored without changing other rules. */
|
|
18
|
+
export declare function ensureConcordIgnored(repoRoot: string): void;
|
|
19
|
+
/** Set up one repository completely: state, instructions, and client registration. */
|
|
20
|
+
export declare function runSetup(cwd: string, options?: SetupOptions): SetupResult;
|
|
21
|
+
export declare function registerSetupCommand(program: Command): void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { createInterface } from 'node:readline/promises';
|
|
4
|
+
import { writeArtifacts } from '../../artifacts/index.js';
|
|
5
|
+
import { concordDir, resolveRepoRoot } from '../../config/paths.js';
|
|
6
|
+
import { detectCommunicationProviders, readAgentCommunicationConfig, writeAgentCommunicationConfig, } from '../../install/agent-communications.js';
|
|
7
|
+
import { installClaudeHook } from '../../install/claude-hooks.js';
|
|
8
|
+
import { installCodexMcpConfig } from '../../install/codex-config.js';
|
|
9
|
+
import { installConcord } from '../../install/index.js';
|
|
10
|
+
import { McpConfigParseError, installMcpConfigs } from '../../install/mcp-config.js';
|
|
11
|
+
import { openContext } from '../context.js';
|
|
12
|
+
const CONCORD_GITIGNORE_ENTRY = '.concord/';
|
|
13
|
+
/** Ensure Concord's generated workspace is ignored without changing other rules. */
|
|
14
|
+
export function ensureConcordIgnored(repoRoot) {
|
|
15
|
+
const gitignorePath = join(repoRoot, '.gitignore');
|
|
16
|
+
const current = existsSync(gitignorePath) ? readFileSync(gitignorePath, 'utf8') : '';
|
|
17
|
+
const entries = current.split(/\r?\n/u).map((line) => line.trim());
|
|
18
|
+
if (entries.includes(CONCORD_GITIGNORE_ENTRY)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const separator = current.length > 0 && !current.endsWith('\n') ? '\n' : '';
|
|
22
|
+
writeFileSync(gitignorePath, `${current}${separator}${CONCORD_GITIGNORE_ENTRY}\n`);
|
|
23
|
+
}
|
|
24
|
+
/** Set up one repository completely: state, instructions, and client registration. */
|
|
25
|
+
export function runSetup(cwd, options = {}) {
|
|
26
|
+
const env = options.env ?? process.env;
|
|
27
|
+
const ctx = openContext(cwd, env);
|
|
28
|
+
ensureConcordIgnored(ctx.repoRoot);
|
|
29
|
+
writeArtifacts(ctx.concordPath, ctx.repos);
|
|
30
|
+
const written = installConcord(ctx.repoRoot);
|
|
31
|
+
if (options.claudeHooks === true) {
|
|
32
|
+
written.push(installClaudeHook(ctx.repoRoot));
|
|
33
|
+
}
|
|
34
|
+
if (options.mcp !== false) {
|
|
35
|
+
written.push(...installMcpConfigs(ctx.repoRoot));
|
|
36
|
+
written.push(installCodexMcpConfig(env));
|
|
37
|
+
}
|
|
38
|
+
const communicationProviders = options.communicationProviders === undefined
|
|
39
|
+
? detectCommunicationProviders(ctx.repoRoot, env)
|
|
40
|
+
: [...options.communicationProviders];
|
|
41
|
+
if (options.agentCommunications !== undefined) {
|
|
42
|
+
written.push(writeAgentCommunicationConfig(ctx.concordPath, options.agentCommunications, communicationProviders));
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
repoRoot: ctx.repoRoot,
|
|
46
|
+
workspaceId: ctx.workspaceId,
|
|
47
|
+
concordPath: ctx.concordPath,
|
|
48
|
+
written,
|
|
49
|
+
communicationProviders,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async function askToInstallAgentCommunications(providers) {
|
|
53
|
+
const prompt = createInterface({ input: process.stdin, output: process.stdout });
|
|
54
|
+
try {
|
|
55
|
+
const answer = await prompt.question(`Enable live inter-agent prompting for detected clients (${providers.join(', ')})? [Y/n] `);
|
|
56
|
+
return !['n', 'no'].includes(answer.trim().toLowerCase());
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
prompt.close();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function registerSetupCommand(program) {
|
|
63
|
+
program
|
|
64
|
+
.command('setup')
|
|
65
|
+
.description('Set up Concord state, instructions, and MCP clients for this repository')
|
|
66
|
+
.option('--claude-hooks', 'also install an opt-in Claude Code PreToolUse overlap hook into .claude/settings.json')
|
|
67
|
+
.option('--no-mcp', 'skip MCP client registration; write local state and instructions only')
|
|
68
|
+
.option('--agent-comms', 'approve and install the local live-prompt relay integration without prompting')
|
|
69
|
+
.action(async (options) => {
|
|
70
|
+
try {
|
|
71
|
+
const setupOptions = { mcp: options.mcp };
|
|
72
|
+
if (options.claudeHooks === true) {
|
|
73
|
+
setupOptions.claudeHooks = true;
|
|
74
|
+
}
|
|
75
|
+
const repoRoot = resolveRepoRoot(process.cwd(), process.env);
|
|
76
|
+
const concordPath = concordDir(repoRoot);
|
|
77
|
+
const detected = detectCommunicationProviders(repoRoot);
|
|
78
|
+
if (options.agentComms === true) {
|
|
79
|
+
setupOptions.agentCommunications = true;
|
|
80
|
+
setupOptions.communicationProviders = detected;
|
|
81
|
+
}
|
|
82
|
+
else if (process.stdin.isTTY &&
|
|
83
|
+
process.stdout.isTTY &&
|
|
84
|
+
detected.length > 0 &&
|
|
85
|
+
readAgentCommunicationConfig(concordPath) === undefined) {
|
|
86
|
+
setupOptions.agentCommunications = await askToInstallAgentCommunications(detected);
|
|
87
|
+
setupOptions.communicationProviders = detected;
|
|
88
|
+
}
|
|
89
|
+
const result = runSetup(process.cwd(), setupOptions);
|
|
90
|
+
process.stdout.write(`Concord setup complete\n` +
|
|
91
|
+
` repository: ${result.repoRoot}\n` +
|
|
92
|
+
` workspace: ${result.workspaceId}\n` +
|
|
93
|
+
` state: ${result.concordPath}\n` +
|
|
94
|
+
` configured:\n`);
|
|
95
|
+
for (const path of result.written) {
|
|
96
|
+
process.stdout.write(` ${path}\n`);
|
|
97
|
+
}
|
|
98
|
+
if (options.claudeHooks === true) {
|
|
99
|
+
process.stdout.write('PreToolUse hook installed. Set CONCORD_TASK=<your task id> so it excludes your own claim.\n');
|
|
100
|
+
}
|
|
101
|
+
if (options.mcp) {
|
|
102
|
+
process.stdout.write('Restart your coding client so it reloads the project MCP server.\n');
|
|
103
|
+
}
|
|
104
|
+
if (setupOptions.agentCommunications === true) {
|
|
105
|
+
process.stdout.write(`Live prompting approved for: ${result.communicationProviders.join(', ')}. Existing sessions must be restarted once.\n`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (!(error instanceof McpConfigParseError)) {
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
process.stderr.write(`${error.message}\n`);
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,GAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;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CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -10,9 +10,8 @@ import { registerDoctorCommand } from './commands/doctor.js';
|
|
|
10
10
|
import { registerExportCommand } from './commands/export.js';
|
|
11
11
|
import { registerHandoffCommand } from './commands/handoff.js';
|
|
12
12
|
import { registerHookCommand } from './commands/hook.js';
|
|
13
|
-
import { registerInit } from './commands/init.js';
|
|
14
|
-
import { registerInstallCommand } from './commands/install.js';
|
|
15
13
|
import { registerReviewPacketCommand } from './commands/review-packet.js';
|
|
14
|
+
import { registerSetupCommand } from './commands/setup.js';
|
|
16
15
|
import { registerStatus } from './commands/status.js';
|
|
17
16
|
import { registerTasks } from './commands/tasks.js';
|
|
18
17
|
import { registerWatchCommand } from './commands/watch.js';
|
|
@@ -47,8 +46,7 @@ program.hook('postAction', (_command, actionCommand) => {
|
|
|
47
46
|
activeCommand = undefined;
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
|
-
|
|
51
|
-
registerInstallCommand(program);
|
|
49
|
+
registerSetupCommand(program);
|
|
52
50
|
registerStatus(program);
|
|
53
51
|
registerWhoCommand(program);
|
|
54
52
|
registerTasks(program);
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,E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-1,4 +1,6 @@
|
|
|
1
1
|
import { type ConcordDatabase } from './connection.js';
|
|
2
|
+
import { type AgentEndpointRepository } from './repositories/agent-endpoints.js';
|
|
3
|
+
import { type AgentMessageRepository } from './repositories/agent-messages.js';
|
|
2
4
|
import { type AgentRepository } from './repositories/agents.js';
|
|
3
5
|
import { type EventRepository } from './repositories/events.js';
|
|
4
6
|
import { type HandoffRepository } from './repositories/handoffs.js';
|
|
@@ -15,7 +17,9 @@ export type { NewTaskUpdate, TaskUpdateRepository } from './repositories/task-up
|
|
|
15
17
|
export type { NewEvent, EventRepository } from './repositories/events.js';
|
|
16
18
|
export type { NewOwnershipEvent, OwnershipEventRepository, } from './repositories/ownership-events.js';
|
|
17
19
|
export type { NewAgent, AgentRepository } from './repositories/agents.js';
|
|
18
|
-
export type {
|
|
20
|
+
export type { NewAgentEndpoint, AgentEndpointRepository } from './repositories/agent-endpoints.js';
|
|
21
|
+
export type { NewAgentMessage, AgentMessageRepository } from './repositories/agent-messages.js';
|
|
22
|
+
export type { TaskRecord, TaskStatus, HandoffRecord, ReviewRecord, ProvenanceEntry, EventRecord, EventStatus, ToolName, TaskUpdateKind, TaskUpdateRecord, AgentRecord, AgentStatus, OwnershipEventRecord, HandoffDeliveryStatus, AgentEndpointRecord, AgentEndpointStatus, AgentMessageRecord, AgentMessageStatus, AgentMessageErrorCode, AgentMessageEventRecord, } from './rows.js';
|
|
19
23
|
/** The full set of Concord repositories bound to one database. */
|
|
20
24
|
export interface Repositories {
|
|
21
25
|
db: ConcordDatabase;
|
|
@@ -25,6 +29,8 @@ export interface Repositories {
|
|
|
25
29
|
taskUpdates: TaskUpdateRepository;
|
|
26
30
|
events: EventRepository;
|
|
27
31
|
agents: AgentRepository;
|
|
32
|
+
agentEndpoints: AgentEndpointRepository;
|
|
33
|
+
agentMessages: AgentMessageRepository;
|
|
28
34
|
ownershipEvents: OwnershipEventRepository;
|
|
29
35
|
}
|
|
30
36
|
/** Bind all repositories to an already-open database. */
|
package/dist/db/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { openDatabase } from './connection.js';
|
|
2
|
+
import { createAgentEndpointRepository, } from './repositories/agent-endpoints.js';
|
|
3
|
+
import { createAgentMessageRepository, } from './repositories/agent-messages.js';
|
|
2
4
|
import { createAgentRepository } from './repositories/agents.js';
|
|
3
5
|
import { createEventRepository } from './repositories/events.js';
|
|
4
6
|
import { createHandoffRepository } from './repositories/handoffs.js';
|
|
@@ -17,6 +19,8 @@ export function createRepositories(db) {
|
|
|
17
19
|
taskUpdates: createTaskUpdateRepository(db),
|
|
18
20
|
events: createEventRepository(db),
|
|
19
21
|
agents: createAgentRepository(db),
|
|
22
|
+
agentEndpoints: createAgentEndpointRepository(db),
|
|
23
|
+
agentMessages: createAgentMessageRepository(db),
|
|
20
24
|
ownershipEvents: createOwnershipEventRepository(db),
|
|
21
25
|
};
|
|
22
26
|
}
|
package/dist/db/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAwB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAwB,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAwB,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAA0B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EACL,8BAA8B,GAE/B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAyB,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAuB,MAAM,yBAAyB,CAAC;AAGpF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"m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C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ConcordDatabase } from '../connection.js';
|
|
2
|
+
import { type AgentEndpointRecord, type AgentEndpointStatus } from '../rows.js';
|
|
3
|
+
export interface NewAgentEndpoint {
|
|
4
|
+
endpointId: string;
|
|
5
|
+
agentId: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
transport: string;
|
|
8
|
+
capabilities: readonly string[];
|
|
9
|
+
address: string;
|
|
10
|
+
credentialHash: string;
|
|
11
|
+
status?: AgentEndpointStatus;
|
|
12
|
+
expiresAt?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface AgentEndpointRepository {
|
|
15
|
+
upsert(endpoint: NewAgentEndpoint): AgentEndpointRecord;
|
|
16
|
+
get(endpointId: string): AgentEndpointRecord | undefined;
|
|
17
|
+
getByAgent(agentId: string): AgentEndpointRecord | undefined;
|
|
18
|
+
list(): AgentEndpointRecord[];
|
|
19
|
+
heartbeat(endpointId: string, expiresAt?: string | null): AgentEndpointRecord | undefined;
|
|
20
|
+
disconnect(endpointId: string): AgentEndpointRecord | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function createAgentEndpointRepository(db: ConcordDatabase): AgentEndpointRepository;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { parseAgentEndpointRow, serializeStringArray, } from '../rows.js';
|
|
3
|
+
const rawListSchema = z.array(z.unknown());
|
|
4
|
+
export function createAgentEndpointRepository(db) {
|
|
5
|
+
const upsertStmt = db.prepare(`
|
|
6
|
+
INSERT INTO agent_endpoints (
|
|
7
|
+
endpoint_id, agent_id, provider, transport, capabilities, address,
|
|
8
|
+
credential_hash, status, last_seen, expires_at, created_at, updated_at
|
|
9
|
+
) VALUES (
|
|
10
|
+
@endpoint_id, @agent_id, @provider, @transport, @capabilities, @address,
|
|
11
|
+
@credential_hash, @status, @now, @expires_at, @now, @now
|
|
12
|
+
)
|
|
13
|
+
ON CONFLICT(agent_id) DO UPDATE SET
|
|
14
|
+
endpoint_id = excluded.endpoint_id,
|
|
15
|
+
provider = excluded.provider,
|
|
16
|
+
transport = excluded.transport,
|
|
17
|
+
capabilities = excluded.capabilities,
|
|
18
|
+
address = excluded.address,
|
|
19
|
+
credential_hash = excluded.credential_hash,
|
|
20
|
+
status = excluded.status,
|
|
21
|
+
last_seen = excluded.last_seen,
|
|
22
|
+
expires_at = excluded.expires_at,
|
|
23
|
+
updated_at = excluded.updated_at
|
|
24
|
+
`);
|
|
25
|
+
const getStmt = db.prepare('SELECT * FROM agent_endpoints WHERE endpoint_id = ?');
|
|
26
|
+
const getByAgentStmt = db.prepare('SELECT * FROM agent_endpoints WHERE agent_id = ?');
|
|
27
|
+
const listStmt = db.prepare('SELECT * FROM agent_endpoints ORDER BY created_at, endpoint_id');
|
|
28
|
+
const heartbeatStmt = db.prepare(`
|
|
29
|
+
UPDATE agent_endpoints
|
|
30
|
+
SET status = 'connected', last_seen = @now, expires_at = @expires_at, updated_at = @now
|
|
31
|
+
WHERE endpoint_id = @endpoint_id
|
|
32
|
+
`);
|
|
33
|
+
const disconnectStmt = db.prepare(`
|
|
34
|
+
UPDATE agent_endpoints
|
|
35
|
+
SET status = 'disconnected', updated_at = @now
|
|
36
|
+
WHERE endpoint_id = @endpoint_id
|
|
37
|
+
`);
|
|
38
|
+
function get(endpointId) {
|
|
39
|
+
const raw = getStmt.get(endpointId);
|
|
40
|
+
return raw === undefined ? undefined : parseAgentEndpointRow(raw);
|
|
41
|
+
}
|
|
42
|
+
function getByAgent(agentId) {
|
|
43
|
+
const raw = getByAgentStmt.get(agentId);
|
|
44
|
+
return raw === undefined ? undefined : parseAgentEndpointRow(raw);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
upsert(endpoint) {
|
|
48
|
+
const now = new Date().toISOString();
|
|
49
|
+
upsertStmt.run({
|
|
50
|
+
endpoint_id: endpoint.endpointId,
|
|
51
|
+
agent_id: endpoint.agentId,
|
|
52
|
+
provider: endpoint.provider,
|
|
53
|
+
transport: endpoint.transport,
|
|
54
|
+
capabilities: serializeStringArray(endpoint.capabilities),
|
|
55
|
+
address: endpoint.address,
|
|
56
|
+
credential_hash: endpoint.credentialHash,
|
|
57
|
+
status: endpoint.status ?? 'connected',
|
|
58
|
+
expires_at: endpoint.expiresAt ?? null,
|
|
59
|
+
now,
|
|
60
|
+
});
|
|
61
|
+
const stored = getByAgent(endpoint.agentId);
|
|
62
|
+
if (stored === undefined) {
|
|
63
|
+
throw new Error(`Agent endpoint ${endpoint.endpointId} could not be read back`);
|
|
64
|
+
}
|
|
65
|
+
return stored;
|
|
66
|
+
},
|
|
67
|
+
get,
|
|
68
|
+
getByAgent,
|
|
69
|
+
list() {
|
|
70
|
+
const raw = listStmt.all();
|
|
71
|
+
return rawListSchema.parse(raw).map(parseAgentEndpointRow);
|
|
72
|
+
},
|
|
73
|
+
heartbeat(endpointId, expiresAt = null) {
|
|
74
|
+
heartbeatStmt.run({
|
|
75
|
+
endpoint_id: endpointId,
|
|
76
|
+
expires_at: expiresAt,
|
|
77
|
+
now: new Date().toISOString(),
|
|
78
|
+
});
|
|
79
|
+
return get(endpointId);
|
|
80
|
+
},
|
|
81
|
+
disconnect(endpointId) {
|
|
82
|
+
disconnectStmt.run({ endpoint_id: endpointId, now: new Date().toISOString() });
|
|
83
|
+
return get(endpointId);
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=agent-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-endpoints.js","sourceRoot":"","sources":["../../../src/db/repositories/agent-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AAuBpB,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,C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ageErrorCode, type AgentMessageEvent, type AgentMessageEventRecord, type AgentMessageRecord } from '../rows.js';
|
|
3
|
+
export interface NewAgentMessage {
|
|
4
|
+
messageId: string;
|
|
5
|
+
taskId: string | null;
|
|
6
|
+
senderAgentId: string;
|
|
7
|
+
recipientAgentId: string;
|
|
8
|
+
replyToMessageId: string | null;
|
|
9
|
+
content: string;
|
|
10
|
+
idempotencyKey: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentMessageRepository {
|
|
13
|
+
create(message: NewAgentMessage): AgentMessageRecord;
|
|
14
|
+
get(messageId: string): AgentMessageRecord | undefined;
|
|
15
|
+
getByIdempotency(senderAgentId: string, idempotencyKey: string): AgentMessageRecord | undefined;
|
|
16
|
+
listByAgent(agentId: string): AgentMessageRecord[];
|
|
17
|
+
listByTask(taskId: string): AgentMessageRecord[];
|
|
18
|
+
listThread(messageId: string): AgentMessageRecord[];
|
|
19
|
+
markDelivered(messageId: string, provider: string, receipt: string | null): AgentMessageRecord;
|
|
20
|
+
markFailed(messageId: string, code: AgentMessageErrorCode, detail: string | null): AgentMessageRecord;
|
|
21
|
+
markReplied(messageId: string): AgentMessageRecord;
|
|
22
|
+
recordEvent(messageId: string, event: AgentMessageEvent, detail?: string | null): void;
|
|
23
|
+
listEvents(messageId: string): AgentMessageEventRecord[];
|
|
24
|
+
}
|
|
25
|
+
export declare function createAgentMessageRepository(db: ConcordDatabase): AgentMessageRepository;
|