@mergeline/agent 0.7.2 → 0.7.4
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 +8 -7
- package/dist/worker.js +5 -2
- package/engine/prompt.md +23 -4
- package/engine/review.md +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,10 +15,10 @@ committing. Nothing technical is needed from the person.
|
|
|
15
15
|
## By hand
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
npx -y @mergeline/agent init --claude --url https://acme.mergeline.app # once per repository; commit what it adds
|
|
19
|
-
npx -y @mergeline/agent login fe-1 --url https://acme.mergeline.app --key ab_... # once per agent and machine
|
|
20
|
-
npx -y @mergeline/agent start fe-1 # every session; then /pick
|
|
21
|
-
npx -y @mergeline/agent watch --agent fe-1 --engine claude --follow # or unattended: the worker
|
|
18
|
+
npx -y @mergeline/agent@latest init --claude --url https://acme.mergeline.app # once per repository; commit what it adds
|
|
19
|
+
npx -y @mergeline/agent@latest login fe-1 --url https://acme.mergeline.app --key ab_... # once per agent and machine
|
|
20
|
+
npx -y @mergeline/agent@latest start fe-1 # every session; then /pick
|
|
21
|
+
npx -y @mergeline/agent@latest watch --agent fe-1 --engine claude --follow # or unattended: the worker
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
`init --url` writes the board's address into `.mergeline.json` (no
|
|
@@ -122,7 +122,7 @@ MCP config (Claude Code `--mcp-config`, Codex, other MCP clients):
|
|
|
122
122
|
"mcpServers": {
|
|
123
123
|
"board": {
|
|
124
124
|
"command": "npx",
|
|
125
|
-
"args": ["-y", "@mergeline/agent", "mcp"],
|
|
125
|
+
"args": ["-y", "@mergeline/agent@latest", "mcp"],
|
|
126
126
|
"env": { "BOARD_URL": "https://board.example.com", "BOARD_AGENT_KEY": "ab_..." }
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -202,8 +202,9 @@ tickets, checking every `--interval <s>` (default 30); `--max-runs <n>`
|
|
|
202
202
|
(default 10) is the most tickets one start takes; `--timeout <min>`
|
|
203
203
|
(default 90) is the most one engine run may take; what follows `--` is
|
|
204
204
|
added to the engine's command line. It stops when the queue is empty
|
|
205
|
-
(unless `--follow`), after `--max-runs` tickets
|
|
206
|
-
|
|
205
|
+
(unless `--follow`), after `--max-runs` tickets (with `--follow` too: it
|
|
206
|
+
says so, and a new start goes on), or after 3 failed runs (releases) in a
|
|
207
|
+
row; after a failed run it waits `--interval` before
|
|
207
208
|
claiming again. Ctrl+C while the engine runs releases
|
|
208
209
|
the ticket. A worker killed outright leaves its ticket In progress; a new
|
|
209
210
|
one waits, claiming every `--interval`, until the board lets it resume (5
|
package/dist/worker.js
CHANGED
|
@@ -1348,10 +1348,13 @@ export async function work(opts) {
|
|
|
1348
1348
|
if (mine === null)
|
|
1349
1349
|
break;
|
|
1350
1350
|
if (hasWork(mine)) {
|
|
1351
|
-
log(`stopping after ${runs} runs (--max-runs) with work still in the queue`);
|
|
1351
|
+
log(`stopping after ${runs} runs (--max-runs ${opts.maxRuns}) with work still in the queue`);
|
|
1352
1352
|
return 1;
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
if (opts.follow)
|
|
1355
|
+
log(`stopping after ${runs} runs (--max-runs ${opts.maxRuns}); start it again to go on (--max-runs sets how many)`);
|
|
1356
|
+
else
|
|
1357
|
+
log(`queue empty after ${runs} run(s); stopping`);
|
|
1355
1358
|
return 0;
|
|
1356
1359
|
}
|
|
1357
1360
|
let claimed;
|
package/engine/prompt.md
CHANGED
|
@@ -13,9 +13,19 @@ on the ticket's branch. Stay in it: do not read or write outside it.
|
|
|
13
13
|
not a guess.
|
|
14
14
|
- On a rework run (the notes end with a review that asks for changes), the
|
|
15
15
|
ticket's notes say what to change: the run is done when each point there
|
|
16
|
-
is fixed or answered in the summary.
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
is fixed or answered in the summary. A point that is a red test this
|
|
17
|
+
change did not cause is answered in the summary, as step 4 says, not
|
|
18
|
+
fixed. The worker's own finding "The test command fails" is such a
|
|
19
|
+
point when its failure lines name a check in code the change does not
|
|
20
|
+
touch.
|
|
21
|
+
- A fresh worktree has no dependencies: install them before you run
|
|
22
|
+
anything, the way the repository's lockfile says: `package-lock.json`,
|
|
23
|
+
`npm ci`; `pnpm-lock.yaml`, `pnpm install --frozen-lockfile`;
|
|
24
|
+
`yarn.lock`, `yarn install --frozen-lockfile`. With no lockfile, run
|
|
25
|
+
`npm install --no-package-lock` (it writes none), and only when
|
|
26
|
+
`package.json` lists dependencies: with none, there is nothing to install.
|
|
27
|
+
- A lockfile the run did not mean to add is not part of the change: do not
|
|
28
|
+
leave one behind.
|
|
19
29
|
|
|
20
30
|
## Steps
|
|
21
31
|
|
|
@@ -28,7 +38,16 @@ on the ticket's branch. Stay in it: do not read or write outside it.
|
|
|
28
38
|
doing what nearby code already does is a guess too.
|
|
29
39
|
3. Work the plan. After each step append one line on what you finished to
|
|
30
40
|
`.mergeline-run/progress.log`.
|
|
31
|
-
4. Run the project's tests and linter and fix what
|
|
41
|
+
4. Run the project's tests and linter, and fix what this ticket's change
|
|
42
|
+
broke. A check that fails in code the change does not touch is not
|
|
43
|
+
this ticket's to fix. The code the change touches is the files in
|
|
44
|
+
`git diff origin/main...HEAD` and the code that uses them. For such a
|
|
45
|
+
check:
|
|
46
|
+
- Run it again. If it passes now, it failed by chance. Leave it, and
|
|
47
|
+
name it in the summary: the check, and that it passed when run
|
|
48
|
+
again.
|
|
49
|
+
- If it fails again, end with `ask`, naming the check and the end of
|
|
50
|
+
its output. Do not change code outside the ticket to make it pass.
|
|
32
51
|
5. Commit with `git commit -m "<message>"`. To bring the branch up to date
|
|
33
52
|
with `main`, run `git merge origin/main` (already fetched).
|
|
34
53
|
If `git commit` is not allowed where you run, leave the changes
|
package/engine/review.md
CHANGED
|
@@ -21,9 +21,13 @@ outside it.
|
|
|
21
21
|
|
|
22
22
|
1. **Read** `ticket.md` and `rules.md`, then the diff
|
|
23
23
|
(`git diff origin/main...HEAD`) and the code it touches.
|
|
24
|
-
2. **Install the dependencies**
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
2. **Install the dependencies** the way the repository's lockfile says:
|
|
25
|
+
`package-lock.json`, `npm ci`; `pnpm-lock.yaml`, `pnpm install
|
|
26
|
+
--frozen-lockfile`; `yarn.lock`, `yarn install --frozen-lockfile`. With
|
|
27
|
+
no lockfile, run `npm install --no-package-lock` (it writes none), and
|
|
28
|
+
only when `package.json` lists dependencies: with none, there is nothing
|
|
29
|
+
to install. Then run what `rules.md` says to run. Run nothing that
|
|
30
|
+
writes outside this folder.
|
|
27
31
|
3. **Check the change against the spec,** requirement by requirement, and
|
|
28
32
|
against `rules.md`. Then hunt for bugs in the changed code and in its
|
|
29
33
|
callers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mergeline/agent",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "The agent's side of a Mergeline board: an MCP server and the `board` CLI. Works with any agent tool that runs MCP servers or shell commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "frontender-ua",
|