@concord-ai/concord-mcp 0.1.1 → 0.3.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/README.md +34 -17
- package/dist/artifacts/work-state-json.js +1 -0
- package/dist/artifacts/work-state-json.js.map +1 -1
- package/dist/artifacts/work-state-view.d.ts +36 -0
- package/dist/artifacts/work-state-view.js +99 -0
- package/dist/artifacts/work-state-view.js.map +1 -0
- package/dist/cli/commands/check.d.ts +20 -0
- package/dist/cli/commands/check.js +66 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/doctor.js +2 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/hook.d.ts +19 -0
- package/dist/cli/commands/hook.js +82 -0
- package/dist/cli/commands/hook.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +15 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.js +9 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/review-packet.js +1 -1
- package/dist/cli/commands/review-packet.js.map +1 -1
- package/dist/cli/commands/status.d.ts +0 -31
- package/dist/cli/commands/status.js +1 -95
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/watch.d.ts +5 -0
- package/dist/cli/commands/watch.js +35 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.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/task-updates.d.ts +13 -0
- package/dist/db/repositories/task-updates.js +32 -0
- package/dist/db/repositories/task-updates.js.map +1 -0
- package/dist/db/repositories/tasks.d.ts +10 -0
- package/dist/db/repositories/tasks.js +17 -2
- package/dist/db/repositories/tasks.js.map +1 -1
- package/dist/db/rows.d.ts +14 -1
- package/dist/db/rows.js +34 -1
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +18 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/domain/decomposition.d.ts +25 -0
- package/dist/domain/decomposition.js +32 -0
- package/dist/domain/decomposition.js.map +1 -0
- package/dist/domain/overlap.d.ts +11 -2
- package/dist/domain/overlap.js +51 -9
- package/dist/domain/overlap.js.map +1 -1
- package/dist/domain/schemas.d.ts +78 -0
- package/dist/domain/schemas.js +48 -2
- package/dist/domain/schemas.js.map +1 -1
- package/dist/install/claude-hooks.d.ts +13 -0
- package/dist/install/claude-hooks.js +48 -0
- package/dist/install/claude-hooks.js.map +1 -0
- package/dist/install/instructions.d.ts +1 -1
- package/dist/install/instructions.js +14 -4
- package/dist/install/instructions.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +14 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/claim-work.d.ts +39 -2
- package/dist/tools/claim-work.js +99 -28
- package/dist/tools/claim-work.js.map +1 -1
- package/dist/tools/get-task-context.d.ts +13 -0
- package/dist/tools/get-task-context.js +77 -0
- package/dist/tools/get-task-context.js.map +1 -0
- package/dist/tools/get-work-state.d.ts +22 -0
- package/dist/tools/get-work-state.js +72 -0
- package/dist/tools/get-work-state.js.map +1 -0
- package/dist/tools/handoff.d.ts +2 -0
- package/dist/tools/handoff.js +28 -3
- package/dist/tools/handoff.js.map +1 -1
- package/dist/tools/review-ready.d.ts +3 -4
- package/dist/tools/review-ready.js +5 -23
- package/dist/tools/review-ready.js.map +1 -1
- package/dist/tools/update-task.d.ts +10 -0
- package/dist/tools/update-task.js +48 -0
- package/dist/tools/update-task.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
**Shared work-state for coding agents.** Concord MCP gives Claude Code, Codex,
|
|
10
10
|
Cursor, and other MCP-capable coding assistants a shared work log. Agents can
|
|
11
|
-
claim work, leave handoffs, and generate review-ready
|
|
11
|
+
claim work, share task context, leave handoffs, and generate review-ready
|
|
12
|
+
packets before opening PRs.
|
|
12
13
|
|
|
13
|
-
> ⚠️ Early and under active development. The
|
|
14
|
-
> `claim_work`, `
|
|
14
|
+
> ⚠️ Early and under active development. The surface is five focused MCP tools:
|
|
15
|
+
> `get_work_state`, `claim_work`, `update_task`, `get_task_context`, and
|
|
16
|
+
> `handoff`.
|
|
15
17
|
|
|
16
18
|
## Why
|
|
17
19
|
|
|
@@ -40,22 +42,26 @@ setup:
|
|
|
40
42
|
> Concord works through MCP tools plus the installed instructions on any
|
|
41
43
|
> MCP-capable client.
|
|
42
44
|
|
|
43
|
-
## The
|
|
45
|
+
## The five tools
|
|
44
46
|
|
|
45
|
-
| Tool
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
47
|
+
| Tool | When | What it does |
|
|
48
|
+
| ------------------ | ------------------------ | -------------------------------------------------------------------------------- |
|
|
49
|
+
| `get_work_state` | before choosing work | shows active tasks, overlaps, review-ready work, and open questions |
|
|
50
|
+
| `claim_work` | before editing | records the task + expected files/modules; flags overlaps with other active work |
|
|
51
|
+
| `update_task` | while working | appends typed intent, progress, decisions, questions, blockers, and findings |
|
|
52
|
+
| `get_task_context` | resuming or coordinating | returns the task, ordered updates, handoff, review evidence, and live overlaps |
|
|
53
|
+
| `handoff` | done, blocked, or pre-PR | captures evidence; `ready_for_review` also produces the review packet |
|
|
50
54
|
|
|
51
55
|
## What you get
|
|
52
56
|
|
|
53
|
-
SQLite is the local source of truth
|
|
54
|
-
|
|
57
|
+
SQLite is the local source of truth. `concord init` adds `.concord/` to the
|
|
58
|
+
repository's `.gitignore`, so the generated workspace stays local by default.
|
|
59
|
+
Teams that want selected artifacts in PRs can remove that rule or force-add the
|
|
60
|
+
human-readable files:
|
|
55
61
|
|
|
56
62
|
```text
|
|
57
63
|
.concord/
|
|
58
|
-
├── concord.db local source of truth
|
|
64
|
+
├── concord.db local source of truth
|
|
59
65
|
├── HANDOFF.md human-readable handoff
|
|
60
66
|
├── REVIEW_PACKET.md review-ready evidence
|
|
61
67
|
└── WORK_STATE.json generated export (optional)
|
|
@@ -81,14 +87,15 @@ concord doctor # workspace checks + per-task tool adoption
|
|
|
81
87
|
pnpm demo
|
|
82
88
|
```
|
|
83
89
|
|
|
84
|
-
Runs the [two-agent overlap demo](./examples/two-agent-overlap/): two agents
|
|
85
|
-
overlapping work
|
|
86
|
-
|
|
90
|
+
Runs the [two-agent overlap demo](./examples/two-agent-overlap/): two agents
|
|
91
|
+
claim overlapping work, share and read task context, then one hands off and
|
|
92
|
+
marks the task review-ready.
|
|
87
93
|
|
|
88
94
|
## What this is / is not
|
|
89
95
|
|
|
90
|
-
Shared work-state and
|
|
91
|
-
orchestrator, code reviewer,
|
|
96
|
+
Shared work-state and task memory for coding agents using the same local
|
|
97
|
+
checkout. **Not** an orchestrator, code reviewer, hosted sync service, memory
|
|
98
|
+
vector DB, or autonomous coding agent.
|
|
92
99
|
|
|
93
100
|
See also: [Why not just use markdown?](./docs/why-not-markdown.md)
|
|
94
101
|
|
|
@@ -98,6 +105,16 @@ See [`CONTRIBUTING.md`](./CONTRIBUTING.md) and [`CLAUDE.md`](./CLAUDE.md). This
|
|
|
98
105
|
repo is strictly typed (no `any`, no typecasts), modular, and every PR stays under
|
|
99
106
|
600 LOC. Good first issues are labelled [`good first issue`](https://github.com/Get-Concord-AI/concord-mcp/labels/good%20first%20issue).
|
|
100
107
|
|
|
108
|
+
## Star History
|
|
109
|
+
|
|
110
|
+
<a href="https://www.star-history.com/?repos=Get-Concord-AI%2Fconcord-mcp&type=date&legend=top-left">
|
|
111
|
+
<picture>
|
|
112
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Get-Concord-AI/concord-mcp&type=date&theme=dark&legend=top-left&sealed_token=DbdI1sO4OagCGFjVA8u5Muv8TyjExR3cllFEq-O_HR3Lzj1jwj7p3N1KuL5fqohiyjzgevkwPQTT8oAw-rZfwTGNwRcTD9sb7aM0pDiJ6ZFGbGY2swwz0CNpbh3Usu4Dw6UIXBDuXacj3SBUTvdU7UYqEcAZtYdlTqUphLqPIrnMJa9WbAbg4ksGqaU2" />
|
|
113
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Get-Concord-AI/concord-mcp&type=date&legend=top-left&sealed_token=DbdI1sO4OagCGFjVA8u5Muv8TyjExR3cllFEq-O_HR3Lzj1jwj7p3N1KuL5fqohiyjzgevkwPQTT8oAw-rZfwTGNwRcTD9sb7aM0pDiJ6ZFGbGY2swwz0CNpbh3Usu4Dw6UIXBDuXacj3SBUTvdU7UYqEcAZtYdlTqUphLqPIrnMJa9WbAbg4ksGqaU2" />
|
|
114
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=Get-Concord-AI/concord-mcp&type=date&legend=top-left&sealed_token=DbdI1sO4OagCGFjVA8u5Muv8TyjExR3cllFEq-O_HR3Lzj1jwj7p3N1KuL5fqohiyjzgevkwPQTT8oAw-rZfwTGNwRcTD9sb7aM0pDiJ6ZFGbGY2swwz0CNpbh3Usu4Dw6UIXBDuXacj3SBUTvdU7UYqEcAZtYdlTqUphLqPIrnMJa9WbAbg4ksGqaU2" />
|
|
115
|
+
</picture>
|
|
116
|
+
</a>
|
|
117
|
+
|
|
101
118
|
## License
|
|
102
119
|
|
|
103
120
|
[MIT](./LICENSE)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-state-json.js","sourceRoot":"","sources":["../../src/artifacts/work-state-json.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"work-state-json.js","sourceRoot":"","sources":["../../src/artifacts/work-state-json.ts"],"names":[],"mappings":"AAoBA,SAAS,eAAe,CAAC,IAAgB;IACvC,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,MAAM;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,cAAc,EAAE,IAAI,CAAC,YAAY;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,cAAc,EAAE,IAAI,CAAC,aAAa;KACnC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,mBAAmB,CAAC,KAA4B,EAAE,WAAmB;IACnF,MAAM,KAAK,GAAc;QACvB,YAAY,EAAE,WAAW;QACzB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;KAClC,CAAC;IACF,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Repositories } from '../db/index.js';
|
|
2
|
+
interface ActiveEntry {
|
|
3
|
+
taskId: string;
|
|
4
|
+
agent: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
touches: string;
|
|
7
|
+
parentTaskId: string | null;
|
|
8
|
+
}
|
|
9
|
+
interface OverlapPair {
|
|
10
|
+
a: string;
|
|
11
|
+
b: string;
|
|
12
|
+
reasons: string[];
|
|
13
|
+
}
|
|
14
|
+
interface ReviewEntry {
|
|
15
|
+
taskId: string;
|
|
16
|
+
testsCount: number;
|
|
17
|
+
guardrailsCount: number;
|
|
18
|
+
openQuestionCount: number;
|
|
19
|
+
}
|
|
20
|
+
interface OpenQuestionEntry {
|
|
21
|
+
taskId: string;
|
|
22
|
+
question: string;
|
|
23
|
+
}
|
|
24
|
+
/** A read-only snapshot of shared work-state: active claims, overlaps computed
|
|
25
|
+
* live across all active tasks, and review-ready tasks with their open
|
|
26
|
+
* questions. Rendered by both the CLI (`concord status`) and the
|
|
27
|
+
* `get_work_state` MCP tool / `concord://work-state` resource. */
|
|
28
|
+
export interface StatusView {
|
|
29
|
+
active: ActiveEntry[];
|
|
30
|
+
overlaps: OverlapPair[];
|
|
31
|
+
reviewReady: ReviewEntry[];
|
|
32
|
+
openQuestions: OpenQuestionEntry[];
|
|
33
|
+
}
|
|
34
|
+
export declare function buildStatus(repos: Repositories): StatusView;
|
|
35
|
+
export declare function renderStatusText(view: StatusView): string;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { detectOverlaps } from '../domain/overlap.js';
|
|
3
|
+
function touchesOf(task) {
|
|
4
|
+
const values = task.modules.length > 0 ? task.modules : task.expectedFiles.map((f) => dirname(f));
|
|
5
|
+
const unique = [...new Set(values.filter((v) => v !== '.' && v !== ''))];
|
|
6
|
+
return unique.length > 0 ? unique.join(', ') : '-';
|
|
7
|
+
}
|
|
8
|
+
export function buildStatus(repos) {
|
|
9
|
+
const tasks = repos.tasks.list();
|
|
10
|
+
const active = tasks.filter((task) => task.status === 'active');
|
|
11
|
+
const overlaps = [];
|
|
12
|
+
const seenPairs = new Set();
|
|
13
|
+
for (const task of active) {
|
|
14
|
+
for (const warning of detectOverlaps({
|
|
15
|
+
taskId: task.taskId,
|
|
16
|
+
expectedFiles: task.expectedFiles,
|
|
17
|
+
modules: task.modules,
|
|
18
|
+
domains: task.domains,
|
|
19
|
+
riskTags: task.riskTags,
|
|
20
|
+
parentTaskId: task.parentTaskId,
|
|
21
|
+
}, active)) {
|
|
22
|
+
const key = [task.taskId, warning.taskId].sort((x, y) => x.localeCompare(y)).join('::');
|
|
23
|
+
if (!seenPairs.has(key)) {
|
|
24
|
+
seenPairs.add(key);
|
|
25
|
+
overlaps.push({ a: task.taskId, b: warning.taskId, reasons: warning.reasons });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const reviewReady = [];
|
|
30
|
+
const openQuestions = [];
|
|
31
|
+
for (const task of tasks.filter((t) => t.status === 'review_ready')) {
|
|
32
|
+
const review = repos.reviews.latestForTask(task.taskId);
|
|
33
|
+
if (review === undefined) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
reviewReady.push({
|
|
37
|
+
taskId: task.taskId,
|
|
38
|
+
testsCount: review.testsRun.length,
|
|
39
|
+
guardrailsCount: review.guardrailsChecked.length,
|
|
40
|
+
openQuestionCount: review.openQuestions.length,
|
|
41
|
+
});
|
|
42
|
+
for (const question of review.openQuestions) {
|
|
43
|
+
openQuestions.push({ taskId: task.taskId, question });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
active: active.map((task) => ({
|
|
48
|
+
taskId: task.taskId,
|
|
49
|
+
agent: task.agent ?? '-',
|
|
50
|
+
branch: task.branch ?? '-',
|
|
51
|
+
touches: touchesOf(task),
|
|
52
|
+
parentTaskId: task.parentTaskId,
|
|
53
|
+
})),
|
|
54
|
+
overlaps,
|
|
55
|
+
reviewReady,
|
|
56
|
+
openQuestions,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function renderStatusText(view) {
|
|
60
|
+
const lines = ['Concord workspace', '', 'Active work'];
|
|
61
|
+
if (view.active.length === 0) {
|
|
62
|
+
lines.push(' none');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
for (const entry of view.active) {
|
|
66
|
+
const parent = entry.parentTaskId === null ? '' : ` (child of ${entry.parentTaskId})`;
|
|
67
|
+
lines.push(` ${entry.taskId.padEnd(10)} ${entry.agent.padEnd(12)} ${entry.branch.padEnd(20)} touches: ${entry.touches}${parent}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
lines.push('', 'Potential overlaps');
|
|
71
|
+
if (view.overlaps.length === 0) {
|
|
72
|
+
lines.push(' none');
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
for (const overlap of view.overlaps) {
|
|
76
|
+
lines.push(` ${overlap.a} <-> ${overlap.b}: ${overlap.reasons.join('; ')}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
lines.push('', 'Review ready');
|
|
80
|
+
if (view.reviewReady.length === 0) {
|
|
81
|
+
lines.push(' none');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
for (const entry of view.reviewReady) {
|
|
85
|
+
lines.push(` ${entry.taskId.padEnd(10)} tests: ${String(entry.testsCount)} guardrails: ${String(entry.guardrailsCount)} open questions: ${String(entry.openQuestionCount)}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
lines.push('', 'Open questions');
|
|
89
|
+
if (view.openQuestions.length === 0) {
|
|
90
|
+
lines.push(' none');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const entry of view.openQuestions) {
|
|
94
|
+
lines.push(` ${entry.taskId} "${entry.question}"`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return lines.join('\n');
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=work-state-view.js.map
|
|
@@ -0,0 +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;AAuCtD,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,EA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c,CAAC,CAAC;IAC/B,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,qBAAqB,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CACpK,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACjC,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,MAAM,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import type { Repositories } from '../../db/index.js';
|
|
3
|
+
import { type OverlapWarning } from '../../domain/overlap.js';
|
|
4
|
+
/**
|
|
5
|
+
* Exact-file collisions between the given files and OTHER active tasks' declared
|
|
6
|
+
* files. This is the client-agnostic primitive behind edit-time enforcement: a
|
|
7
|
+
* PreToolUse hook (Claude Code), a git pre-commit hook, or CI can call it to
|
|
8
|
+
* find out whether the files about to change are already claimed by someone
|
|
9
|
+
* else. `selfTaskId` excludes your own claim so you are not flagged against
|
|
10
|
+
* yourself.
|
|
11
|
+
*
|
|
12
|
+
* Unlike claim-time overlap detection (which also warns on shared
|
|
13
|
+
* directories/modules/domains), this gate is intentionally precise: it fires
|
|
14
|
+
* only on the *same file*, since blocking an edit on a coarse signal like a
|
|
15
|
+
* shared top-level directory would be too noisy to be useful.
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkFileOverlaps(repos: Repositories, files: readonly string[], selfTaskId?: string): OverlapWarning[];
|
|
18
|
+
/** Human-readable result for `concord check`. */
|
|
19
|
+
export declare function renderCheck(files: readonly string[], overlaps: readonly OverlapWarning[]): string;
|
|
20
|
+
export declare function registerCheckCommand(program: Command): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { normalizePath } from '../../domain/overlap.js';
|
|
2
|
+
import { openContext } from '../context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Exact-file collisions between the given files and OTHER active tasks' declared
|
|
5
|
+
* files. This is the client-agnostic primitive behind edit-time enforcement: a
|
|
6
|
+
* PreToolUse hook (Claude Code), a git pre-commit hook, or CI can call it to
|
|
7
|
+
* find out whether the files about to change are already claimed by someone
|
|
8
|
+
* else. `selfTaskId` excludes your own claim so you are not flagged against
|
|
9
|
+
* yourself.
|
|
10
|
+
*
|
|
11
|
+
* Unlike claim-time overlap detection (which also warns on shared
|
|
12
|
+
* directories/modules/domains), this gate is intentionally precise: it fires
|
|
13
|
+
* only on the *same file*, since blocking an edit on a coarse signal like a
|
|
14
|
+
* shared top-level directory would be too noisy to be useful.
|
|
15
|
+
*/
|
|
16
|
+
export function checkFileOverlaps(repos, files, selfTaskId) {
|
|
17
|
+
const wanted = new Set(files.map(normalizePath).filter((file) => file !== ''));
|
|
18
|
+
const warnings = [];
|
|
19
|
+
for (const task of repos.tasks.list()) {
|
|
20
|
+
if (task.status !== 'active' || task.taskId === selfTaskId) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const shared = task.expectedFiles.map(normalizePath).filter((file) => wanted.has(file));
|
|
24
|
+
if (shared.length > 0) {
|
|
25
|
+
const unique = [...new Set(shared)].sort((a, b) => a.localeCompare(b));
|
|
26
|
+
warnings.push({
|
|
27
|
+
taskId: task.taskId,
|
|
28
|
+
title: task.title,
|
|
29
|
+
reasons: [`same file(s): ${unique.join(', ')}`],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return warnings;
|
|
34
|
+
}
|
|
35
|
+
/** Human-readable result for `concord check`. */
|
|
36
|
+
export function renderCheck(files, overlaps) {
|
|
37
|
+
if (files.length === 0) {
|
|
38
|
+
return 'No files to check. Usage: concord check [--task <id>] <file>...';
|
|
39
|
+
}
|
|
40
|
+
if (overlaps.length === 0) {
|
|
41
|
+
return `OK: none of the ${String(files.length)} file(s) overlap another active task.`;
|
|
42
|
+
}
|
|
43
|
+
const lines = [
|
|
44
|
+
`Overlap: files you are about to edit collide with ${String(overlaps.length)} active task(s):`,
|
|
45
|
+
];
|
|
46
|
+
for (const overlap of overlaps) {
|
|
47
|
+
lines.push(` - ${overlap.taskId} (${overlap.title}): ${overlap.reasons.join('; ')}`);
|
|
48
|
+
}
|
|
49
|
+
return lines.join('\n');
|
|
50
|
+
}
|
|
51
|
+
export function registerCheckCommand(program) {
|
|
52
|
+
program
|
|
53
|
+
.command('check [files...]')
|
|
54
|
+
.description('Check whether files you are about to edit overlap another active task (for hooks/CI)')
|
|
55
|
+
.option('-t, --task <id>', "your own task id, so its own claim isn't flagged as an overlap")
|
|
56
|
+
.action((files, options) => {
|
|
57
|
+
const overlaps = checkFileOverlaps(openContext(process.cwd()).repos, files, options.task);
|
|
58
|
+
process.stdout.write(`${renderCheck(files, overlaps)}\n`);
|
|
59
|
+
if (overlaps.length > 0) {
|
|
60
|
+
// Non-zero so a hook/CI can block. Claude Code PreToolUse hooks treat
|
|
61
|
+
// exit code 2 as "deny"; wrap as `concord check ... || exit 2` there.
|
|
62
|
+
process.exitCode = 1;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAuB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAmB,EACnB,KAAwB,EACxB,UAAmB;IAEnB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAC3D,SAAS;QACX,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,QAAQ,CAAC,IAAI,C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AE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,sEAAsE;YACtE,sEAAsE;YACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -18,8 +18,9 @@ export function buildDoctorReport(ctx) {
|
|
|
18
18
|
'Concord doctor',
|
|
19
19
|
'',
|
|
20
20
|
'Workspace',
|
|
21
|
-
` .concord/ ${existsSync(ctx.concordPath) ? 'ok' : 'missing'}`,
|
|
21
|
+
` .concord/ ${existsSync(ctx.concordPath) ? 'ok' : 'missing'} -> ${ctx.concordPath}`,
|
|
22
22
|
` concord.db ${existsSync(dbPath) ? 'ok' : 'missing'} (schema v${String(schemaVersion)}, expected v${String(migrations.length)})`,
|
|
23
|
+
` repo root ${ctx.repoRoot}`,
|
|
23
24
|
'',
|
|
24
25
|
'Activity',
|
|
25
26
|
` tasks: ${String(tasks.length)}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAE7D,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAA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E,CAAC;YAC7B,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAClJ,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,19 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import type { Repositories } from '../../db/index.js';
|
|
3
|
+
export interface HookDecision {
|
|
4
|
+
/** True → deny the tool call (exit 2). */
|
|
5
|
+
block: boolean;
|
|
6
|
+
/** Message for stderr (shown to the agent); empty when there is nothing to say. */
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Decide whether a Claude Code PreToolUse event (Edit/Write/MultiEdit) should be
|
|
11
|
+
* blocked because the edited file is claimed by another active task.
|
|
12
|
+
*
|
|
13
|
+
* `selfTaskId` (from `$CONCORD_TASK`) excludes your own claim. Without it we
|
|
14
|
+
* cannot tell your own files apart from a real conflict, so we advise but never
|
|
15
|
+
* block — blocking an agent from editing its own claimed files would be worse
|
|
16
|
+
* than the problem this guards against.
|
|
17
|
+
*/
|
|
18
|
+
export declare function decidePreToolUse(repos: Repositories, rawJson: string, selfTaskId?: string): HookDecision;
|
|
19
|
+
export declare function registerHookCommand(program: Command): void;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { openContext } from '../context.js';
|
|
4
|
+
import { checkFileOverlaps } from './check.js';
|
|
5
|
+
/** The subset of Claude Code's PreToolUse payload we need: the edited file path.
|
|
6
|
+
* Everything else is passed through and ignored. */
|
|
7
|
+
const preToolUsePayloadSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
tool_input: z.object({ file_path: z.string().optional() }).passthrough().optional(),
|
|
10
|
+
})
|
|
11
|
+
.passthrough();
|
|
12
|
+
/**
|
|
13
|
+
* Decide whether a Claude Code PreToolUse event (Edit/Write/MultiEdit) should be
|
|
14
|
+
* blocked because the edited file is claimed by another active task.
|
|
15
|
+
*
|
|
16
|
+
* `selfTaskId` (from `$CONCORD_TASK`) excludes your own claim. Without it we
|
|
17
|
+
* cannot tell your own files apart from a real conflict, so we advise but never
|
|
18
|
+
* block — blocking an agent from editing its own claimed files would be worse
|
|
19
|
+
* than the problem this guards against.
|
|
20
|
+
*/
|
|
21
|
+
export function decidePreToolUse(repos, rawJson, selfTaskId) {
|
|
22
|
+
let parsed;
|
|
23
|
+
try {
|
|
24
|
+
parsed = JSON.parse(rawJson);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return { block: false, message: '' };
|
|
28
|
+
}
|
|
29
|
+
const payload = preToolUsePayloadSchema.parse(parsed);
|
|
30
|
+
const filePath = payload.tool_input?.file_path;
|
|
31
|
+
if (filePath === undefined || filePath === '') {
|
|
32
|
+
return { block: false, message: '' };
|
|
33
|
+
}
|
|
34
|
+
const overlaps = checkFileOverlaps(repos, [filePath], selfTaskId);
|
|
35
|
+
if (overlaps.length === 0) {
|
|
36
|
+
return { block: false, message: '' };
|
|
37
|
+
}
|
|
38
|
+
const detail = overlaps.map((overlap) => `${overlap.taskId} (${overlap.title})`).join(', ');
|
|
39
|
+
if (selfTaskId === undefined) {
|
|
40
|
+
return {
|
|
41
|
+
block: false,
|
|
42
|
+
message: `Concord: ${filePath} is also claimed by ${detail}. Set CONCORD_TASK=<your task id> to block colliding edits.`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
block: true,
|
|
47
|
+
message: `Concord: ${filePath} is claimed by another active task (${detail}). Coordinate or update your claim before editing.`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Read piped stdin to a string. Returns '' when attached to a TTY (no input). */
|
|
51
|
+
function readStdin() {
|
|
52
|
+
if (process.stdin.isTTY) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
return readFileSync(0, 'utf8');
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function registerHookCommand(program) {
|
|
63
|
+
program
|
|
64
|
+
.command('hook <event>')
|
|
65
|
+
.description('Run a Concord hook. event: pre-tool-use (reads a Claude Code PreToolUse JSON payload on stdin)')
|
|
66
|
+
.action((event) => {
|
|
67
|
+
if (event !== 'pre-tool-use') {
|
|
68
|
+
process.stderr.write(`Unknown hook event: ${event}\n`);
|
|
69
|
+
process.exitCode = 1;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const decision = decidePreToolUse(openContext(process.cwd()).repos, readStdin(), process.env['CONCORD_TASK']);
|
|
73
|
+
if (decision.message !== '') {
|
|
74
|
+
process.stderr.write(`${decision.message}\n`);
|
|
75
|
+
}
|
|
76
|
+
if (decision.block) {
|
|
77
|
+
// Claude Code treats PreToolUse exit code 2 as "deny the tool call".
|
|
78
|
+
process.exitCode = 2;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
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C;QACD,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,EAChC,SAAS,EAAE,EACX,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAC5B,CAAC;QACF,IAAI,QAAQ,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,qEAAqE;YACrE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
/** Ensure Concord's generated workspace is ignored without changing other rules. */
|
|
3
|
+
export declare function ensureConcordIgnored(repoRoot: string): void;
|
|
2
4
|
/** Create the local `.concord/` workspace and return its path. */
|
|
3
5
|
export declare function runInit(cwd: string): string;
|
|
4
6
|
export declare function registerInit(program: Command): void;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
1
3
|
import { writeArtifacts } from '../../artifacts/index.js';
|
|
2
4
|
import { openContext } from '../context.js';
|
|
5
|
+
const CONCORD_GITIGNORE_ENTRY = '.concord/';
|
|
6
|
+
/** Ensure Concord's generated workspace is ignored without changing other rules. */
|
|
7
|
+
export function ensureConcordIgnored(repoRoot) {
|
|
8
|
+
const gitignorePath = join(repoRoot, '.gitignore');
|
|
9
|
+
const current = existsSync(gitignorePath) ? readFileSync(gitignorePath, 'utf8') : '';
|
|
10
|
+
const entries = current.split(/\r?\n/u).map((line) => line.trim());
|
|
11
|
+
if (entries.includes(CONCORD_GITIGNORE_ENTRY)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const separator = current.length > 0 && !current.endsWith('\n') ? '\n' : '';
|
|
15
|
+
writeFileSync(gitignorePath, `${current}${separator}${CONCORD_GITIGNORE_ENTRY}\n`);
|
|
16
|
+
}
|
|
3
17
|
/** Create the local `.concord/` workspace and return its path. */
|
|
4
18
|
export function runInit(cwd) {
|
|
5
19
|
const ctx = openContext(cwd);
|
|
20
|
+
ensureConcordIgnored(ctx.repoRoot);
|
|
6
21
|
writeArtifacts(ctx.concordPath, ctx.repos);
|
|
7
22
|
return ctx.concordPath;
|
|
8
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAE5C,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,IAAI,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,aAAa,CAAC,aAAa,EAAE,GAAG,OAAO,GAAG,SAAS,GAAG,uBAAuB,IAAI,CAAC,CAAC;AACrF,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,GAAG,CAAC,WAAW,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,IAAI,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { findRepoRoot } from '../../config/paths.js';
|
|
2
|
+
import { installClaudeHook } from '../../install/claude-hooks.js';
|
|
2
3
|
import { installConcord } from '../../install/index.js';
|
|
3
4
|
export function registerInstallCommand(program) {
|
|
4
5
|
program
|
|
5
6
|
.command('install')
|
|
6
7
|
.description('Write Concord usage instructions into supported client configs')
|
|
7
|
-
.
|
|
8
|
+
.option('--claude-hooks', 'also install an opt-in Claude Code PreToolUse overlap hook into .claude/settings.json')
|
|
9
|
+
.action((options) => {
|
|
8
10
|
const repoRoot = findRepoRoot(process.cwd());
|
|
9
11
|
const written = installConcord(repoRoot);
|
|
12
|
+
if (options.claudeHooks === true) {
|
|
13
|
+
written.push(installClaudeHook(repoRoot));
|
|
14
|
+
}
|
|
10
15
|
process.stdout.write(`Installed Concord instructions:\n`);
|
|
11
16
|
for (const relPath of written) {
|
|
12
17
|
process.stdout.write(` ${relPath}\n`);
|
|
13
18
|
}
|
|
19
|
+
if (options.claudeHooks === true) {
|
|
20
|
+
process.stdout.write('PreToolUse hook installed. Set CONCORD_TASK=<your task id> so it excludes your own claim.\n');
|
|
21
|
+
}
|
|
14
22
|
});
|
|
15
23
|
}
|
|
16
24
|
//# sourceMappingURL=install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,gEAAgE,CAAC;SAC7E,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,gEAAgE,CAAC;SAC7E,MAAM,CACL,gBAAgB,EAChB,uFAAuF,CACxF;SACA,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC1D,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;YAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6FAA6F,CAC9F,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -9,7 +9,7 @@ export function runReviewPacket(cwd, taskId) {
|
|
|
9
9
|
}
|
|
10
10
|
const review = ctx.repos.reviews.latestForTask(taskId);
|
|
11
11
|
if (review === undefined) {
|
|
12
|
-
return `No review packet for ${taskId}. Ask the agent to call
|
|
12
|
+
return `No review packet for ${taskId}. Ask the agent to call handoff with ready_for_review.`;
|
|
13
13
|
}
|
|
14
14
|
return renderReviewPacketMarkdown(task, review, ctx.repos.handoffs.latestForTask(taskId));
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-packet.js","sourceRoot":"","sources":["../../../src/cli/commands/review-packet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,M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B,CAAC,OAAgB;IAC1D,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,QAAQ,CAAC,UAAU,EAAE,sCAAsC,CAAC;SAC5D,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,34 +1,3 @@
|
|
|
1
1
|
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
-
import type { Repositories } from '../../db/index.js';
|
|
3
|
-
interface ActiveEntry {
|
|
4
|
-
taskId: string;
|
|
5
|
-
agent: string;
|
|
6
|
-
branch: string;
|
|
7
|
-
touches: string;
|
|
8
|
-
}
|
|
9
|
-
interface OverlapPair {
|
|
10
|
-
a: string;
|
|
11
|
-
b: string;
|
|
12
|
-
reasons: string[];
|
|
13
|
-
}
|
|
14
|
-
interface ReviewEntry {
|
|
15
|
-
taskId: string;
|
|
16
|
-
testsCount: number;
|
|
17
|
-
guardrailsCount: number;
|
|
18
|
-
openQuestionCount: number;
|
|
19
|
-
}
|
|
20
|
-
interface OpenQuestionEntry {
|
|
21
|
-
taskId: string;
|
|
22
|
-
question: string;
|
|
23
|
-
}
|
|
24
|
-
export interface StatusView {
|
|
25
|
-
active: ActiveEntry[];
|
|
26
|
-
overlaps: OverlapPair[];
|
|
27
|
-
reviewReady: ReviewEntry[];
|
|
28
|
-
openQuestions: OpenQuestionEntry[];
|
|
29
|
-
}
|
|
30
|
-
export declare function buildStatus(repos: Repositories): StatusView;
|
|
31
|
-
export declare function renderStatusText(view: StatusView): string;
|
|
32
2
|
export declare function runStatus(cwd: string): string;
|
|
33
3
|
export declare function registerStatus(program: Command): void;
|
|
34
|
-
export {};
|