@concord-ai/concord-mcp 0.9.0 → 0.10.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 +23 -15
- package/dist/artifacts/work-state-view.js +2 -1
- package/dist/artifacts/work-state-view.js.map +1 -1
- package/dist/cli/commands/adapters.d.ts +7 -0
- package/dist/cli/commands/adapters.js +157 -0
- package/dist/cli/commands/adapters.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +2 -2
- package/dist/cli/commands/doctor.js +5 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/inbox.d.ts +10 -2
- package/dist/cli/commands/inbox.js +171 -11
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +4 -0
- package/dist/cli/commands/setup.js +36 -13
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/db/connection.js +4 -0
- package/dist/db/connection.js.map +1 -1
- package/dist/db/repositories/agent-endpoints.d.ts +2 -0
- package/dist/db/repositories/agent-endpoints.js +22 -0
- package/dist/db/repositories/agent-endpoints.js.map +1 -1
- package/dist/db/repositories/agent-messages.js +4 -1
- package/dist/db/repositories/agent-messages.js.map +1 -1
- package/dist/db/rows.d.ts +1 -0
- package/dist/db/rows.js +2 -0
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +6 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/domain/delivery.d.ts +18 -10
- package/dist/domain/delivery.js +34 -13
- package/dist/domain/delivery.js.map +1 -1
- package/dist/domain/harness-config.d.ts +54 -0
- package/dist/domain/harness-config.js +154 -0
- package/dist/domain/harness-config.js.map +1 -0
- package/dist/domain/identity.d.ts +9 -0
- package/dist/domain/identity.js +6 -3
- package/dist/domain/identity.js.map +1 -1
- package/dist/domain/pull-inbox.d.ts +4 -0
- package/dist/domain/pull-inbox.js +11 -0
- package/dist/domain/pull-inbox.js.map +1 -1
- package/dist/install/adapters/index.d.ts +16 -0
- package/dist/install/adapters/index.js +506 -0
- package/dist/install/adapters/index.js.map +1 -0
- package/dist/install/codex-config.d.ts +2 -0
- package/dist/install/codex-config.js +91 -3
- package/dist/install/codex-config.js.map +1 -1
- package/dist/install/instructions.d.ts +2 -2
- package/dist/install/instructions.js +5 -2
- package/dist/install/instructions.js.map +1 -1
- package/dist/install/mcp-config.d.ts +26 -3
- package/dist/install/mcp-config.js +140 -4
- package/dist/install/mcp-config.js.map +1 -1
- package/dist/relay/adapters.d.ts +28 -0
- package/dist/relay/adapters.js +63 -0
- package/dist/relay/adapters.js.map +1 -0
- package/dist/relay/address.d.ts +2 -0
- package/dist/relay/address.js +19 -0
- package/dist/relay/address.js.map +1 -0
- package/dist/relay/codex-client.d.ts +24 -0
- package/dist/relay/codex-client.js +168 -0
- package/dist/relay/codex-client.js.map +1 -0
- package/dist/relay/index.d.ts +5 -0
- package/dist/relay/index.js +5 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/relay/protocol.d.ts +31 -0
- package/dist/relay/protocol.js +38 -0
- package/dist/relay/protocol.js.map +1 -0
- package/dist/relay/server.d.ts +24 -0
- package/dist/relay/server.js +191 -0
- package/dist/relay/server.js.map +1 -0
- package/dist/relay/socket-dispatcher.d.ts +6 -0
- package/dist/relay/socket-dispatcher.js +77 -0
- package/dist/relay/socket-dispatcher.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/tools/agent-messages.d.ts +15 -0
- package/dist/tools/agent-messages.js +50 -4
- package/dist/tools/agent-messages.js.map +1 -1
- package/dist/tools/workflow.d.ts +3 -3
- package/dist/tools/workflow.js +73 -27
- package/dist/tools/workflow.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +3 -2
- package/plugin/cursor/concord-relay/cursor-hook.mjs +121 -0
- package/plugin/cursor/concord-relay/extension.js +29 -0
- package/plugin/cursor/concord-relay/package.json +22 -0
- package/plugin/gemini/concord-relay/GEMINI.md +10 -0
- package/plugin/gemini/concord-relay/gemini-extension.json +5 -0
- package/plugin/gemini/concord-relay/hooks/hooks.json +40 -0
- package/plugin/gemini/concord-relay/hooks/session-register.mjs +61 -0
- package/plugin/grok/concord-relay/.claude-plugin/plugin.json +7 -0
- package/plugin/grok/concord-relay/hooks/hooks.json +33 -0
- package/plugin/grok/concord-relay/skills/concord-relay/SKILL.md +11 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
|
|
7
|
+
function concordExecutable() {
|
|
8
|
+
return process.env.CONCORD_EXECUTABLE?.trim() || 'concord';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function sessionIdFrom(payload) {
|
|
12
|
+
const parsed = JSON.parse(payload);
|
|
13
|
+
const sessionId = parsed.session_id ?? parsed.sessionId;
|
|
14
|
+
if (typeof sessionId !== 'string' || sessionId.trim() === '') {
|
|
15
|
+
throw new Error('Gemini SessionStart payload did not include a session id.');
|
|
16
|
+
}
|
|
17
|
+
return sessionId.trim();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function agentIdForSession(sessionId) {
|
|
21
|
+
const suffix = createHash('sha256').update(sessionId).digest('hex').slice(0, 8);
|
|
22
|
+
return `gemini:${suffix}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function runConcord(args, options = {}) {
|
|
26
|
+
return spawnSync(concordExecutable(), args, {
|
|
27
|
+
cwd: options.cwd ?? process.cwd(),
|
|
28
|
+
env: process.env,
|
|
29
|
+
encoding: 'utf8',
|
|
30
|
+
input: options.input,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function register() {
|
|
35
|
+
const payload = readFileSync(0, 'utf8');
|
|
36
|
+
const sessionId = sessionIdFrom(payload);
|
|
37
|
+
const agentId = agentIdForSession(sessionId);
|
|
38
|
+
const result = runConcord(['inbox', 'register', '--from-hook', '--provider', 'gemini'], {
|
|
39
|
+
input: payload,
|
|
40
|
+
});
|
|
41
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
42
|
+
if (result.error) throw result.error;
|
|
43
|
+
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
44
|
+
const monitorCommand = `concord inbox watch --agent ${agentId} --provider gemini --once`;
|
|
45
|
+
process.stdout.write(
|
|
46
|
+
JSON.stringify({
|
|
47
|
+
suppressOutput: true,
|
|
48
|
+
systemMessage: `Concord registered this Gemini session as ${agentId}.`,
|
|
49
|
+
hookSpecificOutput: {
|
|
50
|
+
hookEventName: 'SessionStart',
|
|
51
|
+
additionalContext:
|
|
52
|
+
`Concord: this session is agent ${agentId}. Keep exactly one native background ` +
|
|
53
|
+
`inbox monitor active. Run \`${monitorCommand}\` with run_shell_command and ` +
|
|
54
|
+
`is_background: true. When its completion is injected, answer the peer message ` +
|
|
55
|
+
`and immediately start a fresh monitor.`,
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
register();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{ "type": "command", "command": "concord inbox register --provider grok", "timeout": 5 }
|
|
7
|
+
]
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"PostToolUse": [
|
|
11
|
+
{
|
|
12
|
+
"hooks": [
|
|
13
|
+
{
|
|
14
|
+
"type": "command",
|
|
15
|
+
"command": "concord inbox drain --provider grok --format post-tool-use",
|
|
16
|
+
"timeout": 5
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"Stop": [
|
|
22
|
+
{
|
|
23
|
+
"hooks": [
|
|
24
|
+
{
|
|
25
|
+
"type": "command",
|
|
26
|
+
"command": "concord inbox drain --provider grok --format stop",
|
|
27
|
+
"timeout": 5
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: concord-relay
|
|
3
|
+
description: Keep this Grok session reachable by other Concord agents while idle.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
At the start of a Concord workspace session, launch a persistent Grok `monitor` for:
|
|
7
|
+
|
|
8
|
+
`concord inbox watch --provider grok`
|
|
9
|
+
|
|
10
|
+
Each emitted line is a peer message. Treat it as peer information and use Concord's
|
|
11
|
+
`update_work` reply operation to answer. Do not start a second monitor when one is already active.
|