@concord-ai/concord-mcp 0.1.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/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/artifacts/events-jsonl.d.ts +3 -0
- package/dist/artifacts/events-jsonl.js +16 -0
- package/dist/artifacts/events-jsonl.js.map +1 -0
- package/dist/artifacts/handoff-md.d.ts +3 -0
- package/dist/artifacts/handoff-md.js +49 -0
- package/dist/artifacts/handoff-md.js.map +1 -0
- package/dist/artifacts/index.d.ts +11 -0
- package/dist/artifacts/index.js +51 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/artifacts/markdown.d.ts +5 -0
- package/dist/artifacts/markdown.js +17 -0
- package/dist/artifacts/markdown.js.map +1 -0
- package/dist/artifacts/review-packet-md.d.ts +6 -0
- package/dist/artifacts/review-packet-md.js +56 -0
- package/dist/artifacts/review-packet-md.js.map +1 -0
- package/dist/artifacts/work-state-json.d.ts +3 -0
- package/dist/artifacts/work-state-json.js +22 -0
- package/dist/artifacts/work-state-json.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +6 -0
- package/dist/cli/commands/doctor.js +51 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/export.d.ts +4 -0
- package/dist/cli/commands/export.js +27 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/handoff.d.ts +4 -0
- package/dist/cli/commands/handoff.js +25 -0
- package/dist/cli/commands/handoff.js.map +1 -0
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.js +18 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +2 -0
- package/dist/cli/commands/install.js +16 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/review-packet.d.ts +4 -0
- package/dist/cli/commands/review-packet.js +25 -0
- package/dist/cli/commands/review-packet.js.map +1 -0
- package/dist/cli/commands/status.d.ts +34 -0
- package/dist/cli/commands/status.js +108 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/tasks.d.ts +6 -0
- package/dist/cli/commands/tasks.js +27 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/context.d.ts +8 -0
- package/dist/cli/context.js +12 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +23 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/paths.d.ts +14 -0
- package/dist/config/paths.js +33 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/db/connection.d.ts +9 -0
- package/dist/db/connection.js +37 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +24 -0
- package/dist/db/index.js +21 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/repositories/events.d.ts +15 -0
- package/dist/db/repositories/events.js +37 -0
- package/dist/db/repositories/events.js.map +1 -0
- package/dist/db/repositories/handoffs.d.ts +22 -0
- package/dist/db/repositories/handoffs.js +54 -0
- package/dist/db/repositories/handoffs.js.map +1 -0
- package/dist/db/repositories/reviews.d.ts +19 -0
- package/dist/db/repositories/reviews.js +49 -0
- package/dist/db/repositories/reviews.js.map +1 -0
- package/dist/db/repositories/tasks.d.ts +23 -0
- package/dist/db/repositories/tasks.js +62 -0
- package/dist/db/repositories/tasks.js.map +1 -0
- package/dist/db/rows.d.ts +82 -0
- package/dist/db/rows.js +149 -0
- package/dist/db/rows.js.map +1 -0
- package/dist/db/schema.d.ts +6 -0
- package/dist/db/schema.js +73 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/domain/adoption.d.ts +13 -0
- package/dist/domain/adoption.js +22 -0
- package/dist/domain/adoption.js.map +1 -0
- package/dist/domain/overlap.d.ts +21 -0
- package/dist/domain/overlap.js +61 -0
- package/dist/domain/overlap.js.map +1 -0
- package/dist/domain/schemas.d.ts +171 -0
- package/dist/domain/schemas.js +49 -0
- package/dist/domain/schemas.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/install/block.d.ts +8 -0
- package/dist/install/block.js +23 -0
- package/dist/install/block.js.map +1 -0
- package/dist/install/index.d.ts +6 -0
- package/dist/install/index.js +27 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/instructions.d.ts +4 -0
- package/dist/install/instructions.js +26 -0
- package/dist/install/instructions.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +19 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/claim-work.d.ts +16 -0
- package/dist/tools/claim-work.js +73 -0
- package/dist/tools/claim-work.js.map +1 -0
- package/dist/tools/handoff.d.ts +15 -0
- package/dist/tools/handoff.js +78 -0
- package/dist/tools/handoff.js.map +1 -0
- package/dist/tools/review-ready.d.ts +14 -0
- package/dist/tools/review-ready.js +77 -0
- package/dist/tools/review-ready.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Concord AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Concord MCP
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@concord-ai/concord-mcp)
|
|
4
|
+
[](https://www.npmjs.com/package/@concord-ai/concord-mcp)
|
|
5
|
+
[](https://github.com/Get-Concord-AI/concord-mcp/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/@concord-ai/concord-mcp)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
**Shared work-state for coding agents.** Concord MCP gives Claude Code, Codex,
|
|
10
|
+
Cursor, and other MCP-capable coding assistants a shared work log. Agents can
|
|
11
|
+
claim work, leave handoffs, and generate review-ready packets before opening PRs.
|
|
12
|
+
|
|
13
|
+
> ⚠️ Early and under active development. The v0 surface is three MCP tools:
|
|
14
|
+
> `claim_work`, `handoff`, and `review_ready`.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Agents work well in isolation, but their plans, assumptions, and decisions only
|
|
19
|
+
become visible at PR time. Teams hack around this today with `AGENTS.md`, handoff
|
|
20
|
+
files, worktrees, and custom scripts. Concord packages the smallest useful version
|
|
21
|
+
of that: a local place for agents to record what they are doing while they do it.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @concord-ai/concord-mcp
|
|
27
|
+
concord install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`concord install` writes Concord's tool instructions into your client configs
|
|
31
|
+
(`CLAUDE.md`, `AGENTS.md`, `.codex/`, `.cursor/rules/`). Then register the MCP
|
|
32
|
+
server with your client and let your agent use the tools through MCP. Per-client
|
|
33
|
+
setup:
|
|
34
|
+
|
|
35
|
+
- [Claude Code](./docs/claude-code.md)
|
|
36
|
+
- [Codex](./docs/codex.md)
|
|
37
|
+
- [Cursor](./docs/cursor.md)
|
|
38
|
+
|
|
39
|
+
> There is no universal `/concord` slash command — commands are client-specific.
|
|
40
|
+
> Concord works through MCP tools plus the installed instructions on any
|
|
41
|
+
> MCP-capable client.
|
|
42
|
+
|
|
43
|
+
## The three tools
|
|
44
|
+
|
|
45
|
+
| Tool | When | What it does |
|
|
46
|
+
| -------------- | -------------------- | -------------------------------------------------------------------------------- |
|
|
47
|
+
| `claim_work` | before editing | records the task + expected files/modules; flags overlaps with other active work |
|
|
48
|
+
| `handoff` | when done or blocked | captures what changed, tests run, assumptions, decisions, guardrails |
|
|
49
|
+
| `review_ready` | before a PR | records plan, tests, open questions, and provenance |
|
|
50
|
+
|
|
51
|
+
## What you get
|
|
52
|
+
|
|
53
|
+
SQLite is the local source of truth (gitignored). Concord renders human-readable
|
|
54
|
+
artifacts you can commit so they show up in PRs:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
.concord/
|
|
58
|
+
├── concord.db local source of truth (gitignored)
|
|
59
|
+
├── HANDOFF.md human-readable handoff
|
|
60
|
+
├── REVIEW_PACKET.md review-ready evidence
|
|
61
|
+
└── WORK_STATE.json generated export (optional)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## CLI
|
|
65
|
+
|
|
66
|
+
Agents use the MCP tools; humans use the CLI.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
concord init # create the .concord/ workspace
|
|
70
|
+
concord status # active work, overlaps, review-ready, open questions
|
|
71
|
+
concord tasks # list all tracked tasks
|
|
72
|
+
concord handoff <task-id> # print the latest handoff
|
|
73
|
+
concord review-packet <id> # print the latest review packet
|
|
74
|
+
concord export markdown # regenerate .concord/ artifacts
|
|
75
|
+
concord doctor # workspace checks + per-task tool adoption
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Try the demo
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm demo
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Runs the [two-agent overlap demo](./examples/two-agent-overlap/): two agents claim
|
|
85
|
+
overlapping work (Concord flags it), then one hands off and marks the task
|
|
86
|
+
review-ready — printing the generated artifacts.
|
|
87
|
+
|
|
88
|
+
## What this is / is not
|
|
89
|
+
|
|
90
|
+
Shared work-state and guardrails for the coding agents you already use. **Not** an
|
|
91
|
+
orchestrator, code reviewer, memory vector DB, or autonomous coding agent.
|
|
92
|
+
|
|
93
|
+
See also: [Why not just use markdown?](./docs/why-not-markdown.md)
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
|
|
97
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) and [`CLAUDE.md`](./CLAUDE.md). This
|
|
98
|
+
repo is strictly typed (no `any`, no typecasts), modular, and every PR stays under
|
|
99
|
+
600 LOC. Good first issues are labelled [`good first issue`](https://github.com/Get-Concord-AI/concord-mcp/labels/good%20first%20issue).
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Render events.jsonl: one JSON object per line, in chronological order. */
|
|
2
|
+
export function renderEventsJsonl(events) {
|
|
3
|
+
if (events.length === 0) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
return `${events
|
|
7
|
+
.map((event) => JSON.stringify({
|
|
8
|
+
task_id: event.taskId,
|
|
9
|
+
tool: event.tool,
|
|
10
|
+
status: event.status,
|
|
11
|
+
detail: event.detail,
|
|
12
|
+
created_at: event.createdAt,
|
|
13
|
+
}))
|
|
14
|
+
.join('\n')}\n`;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=events-jsonl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-jsonl.js","sourceRoot":"","sources":["../../src/artifacts/events-jsonl.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,MAAM;SACb,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACb,IAAI,CAAC,SAAS,CAAC;QACb,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,SAAS;KAC5B,CAAC,CACH;SACA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { bulletList, codeBulletList } from './markdown.js';
|
|
2
|
+
/** Render a human-readable HANDOFF.md for a task and its latest handoff. */
|
|
3
|
+
export function renderHandoffMarkdown(task, handoff) {
|
|
4
|
+
return [
|
|
5
|
+
`# Handoff: ${task.taskId} — ${task.title}`,
|
|
6
|
+
'',
|
|
7
|
+
`**Status:** ${handoff.status}`,
|
|
8
|
+
`**Agent:** ${task.agent ?? 'unknown'}`,
|
|
9
|
+
`**Branch:** ${task.branch ?? 'unknown'}`,
|
|
10
|
+
'',
|
|
11
|
+
'## What changed',
|
|
12
|
+
'',
|
|
13
|
+
handoff.whatChanged,
|
|
14
|
+
'',
|
|
15
|
+
'## Changed files',
|
|
16
|
+
'',
|
|
17
|
+
codeBulletList(handoff.changedFiles),
|
|
18
|
+
'',
|
|
19
|
+
'## Tests run',
|
|
20
|
+
'',
|
|
21
|
+
codeBulletList(handoff.testsRun),
|
|
22
|
+
'',
|
|
23
|
+
'## Assumptions',
|
|
24
|
+
'',
|
|
25
|
+
bulletList(handoff.assumptions),
|
|
26
|
+
'',
|
|
27
|
+
'## Decisions',
|
|
28
|
+
'',
|
|
29
|
+
bulletList(handoff.decisions),
|
|
30
|
+
'',
|
|
31
|
+
'## Known risks',
|
|
32
|
+
'',
|
|
33
|
+
bulletList(handoff.knownRisks),
|
|
34
|
+
'',
|
|
35
|
+
'## Guardrails checked',
|
|
36
|
+
'',
|
|
37
|
+
bulletList(handoff.guardrailsChecked),
|
|
38
|
+
'',
|
|
39
|
+
'## Needs review from',
|
|
40
|
+
'',
|
|
41
|
+
bulletList(handoff.needsReviewFrom),
|
|
42
|
+
'',
|
|
43
|
+
'## Next steps',
|
|
44
|
+
'',
|
|
45
|
+
bulletList(handoff.nextSteps),
|
|
46
|
+
'',
|
|
47
|
+
].join('\n');
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=handoff-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff-md.js","sourceRoot":"","sources":["../../src/artifacts/handoff-md.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CAAC,IAAgB,EAAE,OAAsB;IAC5E,OAAO;QACL,cAAc,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,KAAK,EAAE;QAC3C,EAAE;QACF,eAAe,OAAO,CAAC,MAAM,EAAE;QAC/B,cAAc,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE;QACvC,eAAe,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE;QACzC,EAAE;QACF,iBAAiB;QACjB,EAAE;QACF,OAAO,CAAC,WAAW;QACnB,EAAE;QACF,kBAAkB;QAClB,EAAE;QACF,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC;QACpC,EAAE;QACF,cAAc;QACd,EAAE;QACF,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC;QAChC,EAAE;QACF,gBAAgB;QAChB,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC;QAC/B,EAAE;QACF,cAAc;QACd,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7B,EAAE;QACF,gBAAgB;QAChB,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC;QAC9B,EAAE;QACF,uBAAuB;QACvB,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACrC,EAAE;QACF,sBAAsB;QACtB,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC;QACnC,EAAE;QACF,eAAe;QACf,EAAE;QACF,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7B,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Repositories } from '../db/index.js';
|
|
2
|
+
export { renderEventsJsonl } from './events-jsonl.js';
|
|
3
|
+
export { renderHandoffMarkdown } from './handoff-md.js';
|
|
4
|
+
export { renderReviewPacketMarkdown } from './review-packet-md.js';
|
|
5
|
+
export { renderWorkStateJson } from './work-state-json.js';
|
|
6
|
+
/**
|
|
7
|
+
* Regenerate all committed/exported artifacts from the database (the source of
|
|
8
|
+
* truth). Called after every tool write so `.concord/` never drifts from the DB.
|
|
9
|
+
* HANDOFF.md and REVIEW_PACKET.md reflect the most recent handoff/review.
|
|
10
|
+
*/
|
|
11
|
+
export declare function writeArtifacts(concordDirPath: string, repos: Repositories, generatedAt?: string): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { renderEventsJsonl } from './events-jsonl.js';
|
|
4
|
+
import { renderHandoffMarkdown } from './handoff-md.js';
|
|
5
|
+
import { renderReviewPacketMarkdown } from './review-packet-md.js';
|
|
6
|
+
import { renderWorkStateJson } from './work-state-json.js';
|
|
7
|
+
export { renderEventsJsonl } from './events-jsonl.js';
|
|
8
|
+
export { renderHandoffMarkdown } from './handoff-md.js';
|
|
9
|
+
export { renderReviewPacketMarkdown } from './review-packet-md.js';
|
|
10
|
+
export { renderWorkStateJson } from './work-state-json.js';
|
|
11
|
+
function latestHandoff(repos, tasks) {
|
|
12
|
+
let best;
|
|
13
|
+
for (const task of tasks) {
|
|
14
|
+
const handoff = repos.handoffs.latestForTask(task.taskId);
|
|
15
|
+
if (handoff !== undefined &&
|
|
16
|
+
(best === undefined || handoff.createdAt >= best.handoff.createdAt)) {
|
|
17
|
+
best = { task, handoff };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return best;
|
|
21
|
+
}
|
|
22
|
+
function latestReview(repos, tasks) {
|
|
23
|
+
let best;
|
|
24
|
+
for (const task of tasks) {
|
|
25
|
+
const review = repos.reviews.latestForTask(task.taskId);
|
|
26
|
+
if (review !== undefined && (best === undefined || review.createdAt >= best.review.createdAt)) {
|
|
27
|
+
best = { task, review };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return best;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Regenerate all committed/exported artifacts from the database (the source of
|
|
34
|
+
* truth). Called after every tool write so `.concord/` never drifts from the DB.
|
|
35
|
+
* HANDOFF.md and REVIEW_PACKET.md reflect the most recent handoff/review.
|
|
36
|
+
*/
|
|
37
|
+
export function writeArtifacts(concordDirPath, repos, generatedAt = new Date().toISOString()) {
|
|
38
|
+
mkdirSync(concordDirPath, { recursive: true });
|
|
39
|
+
const tasks = repos.tasks.list();
|
|
40
|
+
writeFileSync(join(concordDirPath, 'WORK_STATE.json'), renderWorkStateJson(tasks, generatedAt));
|
|
41
|
+
writeFileSync(join(concordDirPath, 'events.jsonl'), renderEventsJsonl(repos.events.list()));
|
|
42
|
+
const handoff = latestHandoff(repos, tasks);
|
|
43
|
+
if (handoff !== undefined) {
|
|
44
|
+
writeFileSync(join(concordDirPath, 'HANDOFF.md'), renderHandoffMarkdown(handoff.task, handoff.handoff));
|
|
45
|
+
}
|
|
46
|
+
const review = latestReview(repos, tasks);
|
|
47
|
+
if (review !== undefined) {
|
|
48
|
+
writeFileSync(join(concordDirPath, 'REVIEW_PACKET.md'), renderReviewPacketMarkdown(review.task, review.review, repos.handoffs.latestForTask(review.task.taskId)));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAY3D,SAAS,aAAa,CACpB,KAAmB,EACnB,KAA4B;IAE5B,IAAI,IAAgC,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,IACE,OAAO,KAAK,SAAS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,CAAC,CAAC;IAC5C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,aAAa,CACX,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,EAClC,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CACrD,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,aAAa,CACX,IAAI,CAAC,cAAc,EAAE,kBAAkB,CAAC,EACxC,0BAA0B,CACxB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,MAAM,EACb,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CACjD,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Small shared helpers for rendering markdown artifacts. */
|
|
2
|
+
/** Render items as a markdown bullet list, or a placeholder when empty. */
|
|
3
|
+
export declare function bulletList(items: readonly string[]): string;
|
|
4
|
+
/** Render items as a markdown bullet list with each item in inline code. */
|
|
5
|
+
export declare function codeBulletList(items: readonly string[]): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Small shared helpers for rendering markdown artifacts. */
|
|
2
|
+
const EMPTY = '_None_';
|
|
3
|
+
/** Render items as a markdown bullet list, or a placeholder when empty. */
|
|
4
|
+
export function bulletList(items) {
|
|
5
|
+
if (items.length === 0) {
|
|
6
|
+
return EMPTY;
|
|
7
|
+
}
|
|
8
|
+
return items.map((item) => `- ${item}`).join('\n');
|
|
9
|
+
}
|
|
10
|
+
/** Render items as a markdown bullet list with each item in inline code. */
|
|
11
|
+
export function codeBulletList(items) {
|
|
12
|
+
if (items.length === 0) {
|
|
13
|
+
return EMPTY;
|
|
14
|
+
}
|
|
15
|
+
return items.map((item) => `- \`${item}\``).join('\n');
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/artifacts/markdown.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,MAAM,KAAK,GAAG,QAAQ,CAAC;AAEvB,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,KAAwB;IACjD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,KAAwB;IACrD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HandoffRecord, ReviewRecord, TaskRecord } from '../db/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render a REVIEW_PACKET.md combining the task, its latest review packet, and
|
|
4
|
+
* (when available) its latest handoff for changed files and decisions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function renderReviewPacketMarkdown(task: TaskRecord, review: ReviewRecord, handoff: HandoffRecord | undefined): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { bulletList, codeBulletList } from './markdown.js';
|
|
2
|
+
function renderProvenance(review) {
|
|
3
|
+
if (review.provenance.length === 0) {
|
|
4
|
+
return '_None_';
|
|
5
|
+
}
|
|
6
|
+
return review.provenance.map((entry) => `- ${entry.field}: ${entry.source}`).join('\n');
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Render a REVIEW_PACKET.md combining the task, its latest review packet, and
|
|
10
|
+
* (when available) its latest handoff for changed files and decisions.
|
|
11
|
+
*/
|
|
12
|
+
export function renderReviewPacketMarkdown(task, review, handoff) {
|
|
13
|
+
const filesTouched = handoff?.changedFiles ?? task.expectedFiles;
|
|
14
|
+
const decisions = handoff?.decisions ?? [];
|
|
15
|
+
return [
|
|
16
|
+
`# Review Packet: ${task.taskId} — ${task.title}`,
|
|
17
|
+
'',
|
|
18
|
+
'## Plan',
|
|
19
|
+
'',
|
|
20
|
+
review.planSummary,
|
|
21
|
+
'',
|
|
22
|
+
'## Files touched',
|
|
23
|
+
'',
|
|
24
|
+
codeBulletList(filesTouched),
|
|
25
|
+
'',
|
|
26
|
+
'## Guardrails checked',
|
|
27
|
+
'',
|
|
28
|
+
bulletList(review.guardrailsChecked),
|
|
29
|
+
'',
|
|
30
|
+
'## Decisions',
|
|
31
|
+
'',
|
|
32
|
+
bulletList(decisions),
|
|
33
|
+
'',
|
|
34
|
+
'## Tests run',
|
|
35
|
+
'',
|
|
36
|
+
codeBulletList(review.testsRun),
|
|
37
|
+
'',
|
|
38
|
+
'## Assumptions',
|
|
39
|
+
'',
|
|
40
|
+
bulletList(review.assumptions),
|
|
41
|
+
'',
|
|
42
|
+
'## Diff size',
|
|
43
|
+
'',
|
|
44
|
+
review.diffSize ?? '_Unknown_',
|
|
45
|
+
'',
|
|
46
|
+
'## Open questions',
|
|
47
|
+
'',
|
|
48
|
+
bulletList(review.openQuestions),
|
|
49
|
+
'',
|
|
50
|
+
'## Provenance',
|
|
51
|
+
'',
|
|
52
|
+
renderProvenance(review),
|
|
53
|
+
'',
|
|
54
|
+
].join('\n');
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=review-packet-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-packet-md.js","sourceRoot":"","sources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nB,EAAE;QACF,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;QAChC,EAAE;QACF,eAAe;QACf,EAAE;QACF,gBAAgB,CAAC,MAAM,CAAC;QACxB,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function toWorkStateTask(task) {
|
|
2
|
+
return {
|
|
3
|
+
task_id: task.taskId,
|
|
4
|
+
title: task.title,
|
|
5
|
+
status: task.status,
|
|
6
|
+
agent: task.agent,
|
|
7
|
+
owner: task.owner,
|
|
8
|
+
branch: task.branch,
|
|
9
|
+
modules: task.modules,
|
|
10
|
+
domains: task.domains,
|
|
11
|
+
expected_files: task.expectedFiles,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Render WORK_STATE.json: a snapshot of all tasks and their current status. */
|
|
15
|
+
export function renderWorkStateJson(tasks, generatedAt) {
|
|
16
|
+
const state = {
|
|
17
|
+
generated_at: generatedAt,
|
|
18
|
+
tasks: tasks.map(toWorkStateTask),
|
|
19
|
+
};
|
|
20
|
+
return `${JSON.stringify(state, null, 2)}\n`;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=work-state-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-state-json.js","sourceRoot":"","sources":["../../src/artifacts/work-state-json.ts"],"names":[],"mappings":"AAmBA,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,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,6 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import { type CliContext } from '../context.js';
|
|
3
|
+
/** Produce a human-readable diagnostics report for the workspace. */
|
|
4
|
+
export declare function buildDoctorReport(ctx: CliContext): string;
|
|
5
|
+
export declare function runDoctor(cwd: string): string;
|
|
6
|
+
export declare function registerDoctorCommand(program: Command): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { migrations } from '../../db/schema.js';
|
|
5
|
+
import { buildAdoption } from '../../domain/adoption.js';
|
|
6
|
+
import { openContext } from '../context.js';
|
|
7
|
+
function yesNo(value) {
|
|
8
|
+
return value ? 'yes' : 'no ';
|
|
9
|
+
}
|
|
10
|
+
/** Produce a human-readable diagnostics report for the workspace. */
|
|
11
|
+
export function buildDoctorReport(ctx) {
|
|
12
|
+
const dbPath = join(ctx.concordPath, 'concord.db');
|
|
13
|
+
const schemaVersion = z.number().parse(ctx.repos.db.pragma('user_version', { simple: true }));
|
|
14
|
+
const tasks = ctx.repos.tasks.list();
|
|
15
|
+
const events = ctx.repos.events.list();
|
|
16
|
+
const adoption = buildAdoption(events);
|
|
17
|
+
const lines = [
|
|
18
|
+
'Concord doctor',
|
|
19
|
+
'',
|
|
20
|
+
'Workspace',
|
|
21
|
+
` .concord/ ${existsSync(ctx.concordPath) ? 'ok' : 'missing'}`,
|
|
22
|
+
` concord.db ${existsSync(dbPath) ? 'ok' : 'missing'} (schema v${String(schemaVersion)}, expected v${String(migrations.length)})`,
|
|
23
|
+
'',
|
|
24
|
+
'Activity',
|
|
25
|
+
` tasks: ${String(tasks.length)}`,
|
|
26
|
+
` events: ${String(events.length)}`,
|
|
27
|
+
'',
|
|
28
|
+
'Adoption',
|
|
29
|
+
];
|
|
30
|
+
if (adoption.length === 0) {
|
|
31
|
+
lines.push(' none');
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
for (const entry of adoption) {
|
|
35
|
+
lines.push(` ${entry.taskId.padEnd(10)} claim_work: ${yesNo(entry.claimWork)} handoff: ${yesNo(entry.handoff)} review_ready: ${yesNo(entry.reviewReady)}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return lines.join('\n');
|
|
39
|
+
}
|
|
40
|
+
export function runDoctor(cwd) {
|
|
41
|
+
return buildDoctorReport(openContext(cwd));
|
|
42
|
+
}
|
|
43
|
+
export function registerDoctorCommand(program) {
|
|
44
|
+
program
|
|
45
|
+
.command('doctor')
|
|
46
|
+
.description('Check the workspace and report tool adoption')
|
|
47
|
+
.action(() => {
|
|
48
|
+
process.stdout.write(`${runDoctor(process.cwd())}\n`);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +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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AC1B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;SAAM,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,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,4 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
/** Regenerate the markdown/JSON artifacts and return the files that now exist. */
|
|
3
|
+
export declare function runExportMarkdown(cwd: string): string[];
|
|
4
|
+
export declare function registerExportCommand(program: Command): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { writeArtifacts } from '../../artifacts/index.js';
|
|
4
|
+
import { openContext } from '../context.js';
|
|
5
|
+
const ARTIFACT_FILES = ['HANDOFF.md', 'REVIEW_PACKET.md', 'WORK_STATE.json', 'events.jsonl'];
|
|
6
|
+
/** Regenerate the markdown/JSON artifacts and return the files that now exist. */
|
|
7
|
+
export function runExportMarkdown(cwd) {
|
|
8
|
+
const ctx = openContext(cwd);
|
|
9
|
+
writeArtifacts(ctx.concordPath, ctx.repos);
|
|
10
|
+
return ARTIFACT_FILES.filter((file) => existsSync(join(ctx.concordPath, file)));
|
|
11
|
+
}
|
|
12
|
+
export function registerExportCommand(program) {
|
|
13
|
+
program
|
|
14
|
+
.command('export')
|
|
15
|
+
.argument('[format]', 'export format', 'markdown')
|
|
16
|
+
.description('Regenerate .concord/ artifacts from the database')
|
|
17
|
+
.action((format) => {
|
|
18
|
+
if (format !== 'markdown') {
|
|
19
|
+
process.stderr.write(`Unsupported export format: ${format}. Only "markdown" is supported.\n`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const written = runExportMarkdown(process.cwd());
|
|
24
|
+
process.stdout.write(`Wrote ${String(written.length)} artifact(s): ${written.join(', ')}\n`);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAE7F,kFAAkF;AAClF,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC;SACjD,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QACjB,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,8BAA8B,MAAM,mCAAmC,CACxE,CAAC;YACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
/** Render the latest handoff for a task as markdown, or an explanatory message. */
|
|
3
|
+
export declare function runHandoffPacket(cwd: string, taskId: string): string;
|
|
4
|
+
export declare function registerHandoffCommand(program: Command): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { renderHandoffMarkdown } from '../../artifacts/index.js';
|
|
2
|
+
import { openContext } from '../context.js';
|
|
3
|
+
/** Render the latest handoff for a task as markdown, or an explanatory message. */
|
|
4
|
+
export function runHandoffPacket(cwd, taskId) {
|
|
5
|
+
const ctx = openContext(cwd);
|
|
6
|
+
const task = ctx.repos.tasks.get(taskId);
|
|
7
|
+
if (task === undefined) {
|
|
8
|
+
return `No task ${taskId}.`;
|
|
9
|
+
}
|
|
10
|
+
const handoff = ctx.repos.handoffs.latestForTask(taskId);
|
|
11
|
+
if (handoff === undefined) {
|
|
12
|
+
return `No handoff recorded for ${taskId}. Ask the agent to call the handoff tool.`;
|
|
13
|
+
}
|
|
14
|
+
return renderHandoffMarkdown(task, handoff);
|
|
15
|
+
}
|
|
16
|
+
export function registerHandoffCommand(program) {
|
|
17
|
+
program
|
|
18
|
+
.command('handoff')
|
|
19
|
+
.argument('<taskId>', 'the task to show a handoff for')
|
|
20
|
+
.description('Print the latest handoff for a task')
|
|
21
|
+
.action((taskId) => {
|
|
22
|
+
process.stdout.write(`${runHandoffPacket(process.cwd(), taskId)}\n`);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=handoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../../src/cli/commands/handoff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,WAAW,MAAM,GAAG,CAAC;IAC9B,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACzD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,2BAA2B,MAAM,2CAA2C,CAAC;IACtF,CAAC;IACD,OAAO,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;SACtD,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { writeArtifacts } from '../../artifacts/index.js';
|
|
2
|
+
import { openContext } from '../context.js';
|
|
3
|
+
/** Create the local `.concord/` workspace and return its path. */
|
|
4
|
+
export function runInit(cwd) {
|
|
5
|
+
const ctx = openContext(cwd);
|
|
6
|
+
writeArtifacts(ctx.concordPath, ctx.repos);
|
|
7
|
+
return ctx.concordPath;
|
|
8
|
+
}
|
|
9
|
+
export function registerInit(program) {
|
|
10
|
+
program
|
|
11
|
+
.command('init')
|
|
12
|
+
.description('Create the local .concord/ workspace')
|
|
13
|
+
.action(() => {
|
|
14
|
+
const path = runInit(process.cwd());
|
|
15
|
+
process.stdout.write(`Initialized Concord workspace at ${path}\n`);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,kEAAkE;AAClE,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { findRepoRoot } from '../../config/paths.js';
|
|
2
|
+
import { installConcord } from '../../install/index.js';
|
|
3
|
+
export function registerInstallCommand(program) {
|
|
4
|
+
program
|
|
5
|
+
.command('install')
|
|
6
|
+
.description('Write Concord usage instructions into supported client configs')
|
|
7
|
+
.action(() => {
|
|
8
|
+
const repoRoot = findRepoRoot(process.cwd());
|
|
9
|
+
const written = installConcord(repoRoot);
|
|
10
|
+
process.stdout.write(`Installed Concord instructions:\n`);
|
|
11
|
+
for (const relPath of written) {
|
|
12
|
+
process.stdout.write(` ${relPath}\n`);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +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,GAAG,EAAE;QACX,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QACzC,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;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from '@commander-js/extra-typings';
|
|
2
|
+
/** Render the latest review packet for a task as markdown, or a message. */
|
|
3
|
+
export declare function runReviewPacket(cwd: string, taskId: string): string;
|
|
4
|
+
export declare function registerReviewPacketCommand(program: Command): void;
|