@mergeline/agent 0.5.0 → 0.5.2
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 +17 -6
- package/dist/init.js +15 -3
- package/kit/claude-settings.json +26 -3
- package/kit/done.md +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,19 +73,23 @@ name exists or where the file still carries the kit's marker line, adds its
|
|
|
73
73
|
permissions to `.claude/settings.json` (plus the repository's own package
|
|
74
74
|
manager: install and its test, lint and typecheck scripts, from the lockfile
|
|
75
75
|
and `package.json`) and removes only the broad rules an older kit wrote
|
|
76
|
-
(`Bash(board *)`, `Bash(git push *)` and the like)
|
|
76
|
+
(`Bash(board *)`, `Bash(git push *)` and the like) and the deny rule
|
|
77
|
+
`Bash(git push *:*)` of kits 3 and 4, which Claude Code reads as a literal
|
|
78
|
+
prefix, so it stopped nothing; it adds a `board` server to
|
|
77
79
|
`.mcp.json` that reads `${BOARD_URL}` and `${BOARD_AGENT_KEY}` from the
|
|
78
80
|
environment, or else the key `login` saved: the key is never written to the
|
|
79
81
|
repository.
|
|
80
82
|
|
|
81
|
-
What the agent may run without asking (kit
|
|
83
|
+
What the agent may run without asking (kit 5, in `.claude/settings.json`):
|
|
82
84
|
|
|
83
85
|
- the board's MCP tools, and `board` (or `npx -y @mergeline/agent`) with
|
|
84
86
|
`claim`, `heartbeat`, `log`, `record-spec`, `ask`, `submit`, `release`,
|
|
85
87
|
`list`, `whoami`, `help`; Claude Code asks the person for `start`,
|
|
86
88
|
`watch`, `login`, `init` and `mcp`;
|
|
87
89
|
- `git fetch origin ...`, `git show`, `git rev-parse`, `git status`,
|
|
88
|
-
`git diff
|
|
90
|
+
`git diff` (inside the working tree), `git log`, `git add`,
|
|
91
|
+
`git commit -m ...` (also `-am`, `-a -m`: the message on the command
|
|
92
|
+
line, never from a file), `git worktree add
|
|
89
93
|
../.wt/...`, `git worktree list`, `git push origin agent/...` and
|
|
90
94
|
`git push -u origin agent/...` (one branch, nothing after it),
|
|
91
95
|
`git merge origin/main`;
|
|
@@ -93,9 +97,16 @@ What the agent may run without asking (kit 3, in `.claude/settings.json`):
|
|
|
93
97
|
- `npm test`, `npm run lint` and the project's own install, test, lint and
|
|
94
98
|
typecheck scripts.
|
|
95
99
|
|
|
96
|
-
Denied, whatever else allows it: `--upload-pack` (`git fetch -u
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
Denied, whatever else allows it: `--upload-pack` (`git fetch -u`, and
|
|
101
|
+
any prefix from `--upl`, since git takes an unambiguous prefix of a long
|
|
102
|
+
option),
|
|
103
|
+
`--receive-pack`, `--exec`, `--output`, `--git-dir`, `--work-tree` and
|
|
104
|
+
`--pathspec-from-file` (from `--pathspec-fr`) on any `git` command;
|
|
105
|
+
`git diff` with `--no-index`, an argument starting with `/`, `~` or `$`
|
|
106
|
+
(bare or quoted), or `../`; a push to `main`, with `--force`, a refspec
|
|
107
|
+
with `:`
|
|
108
|
+
(`git push origin agent/x:main`; kit 5's rule is `git push *:**`, since
|
|
109
|
+
Claude Code reads a rule that ends in `:*` as a literal prefix),
|
|
99
110
|
`--delete`, `-d`, `--mirror`, `--all` or `--tags`; a worktree path that
|
|
100
111
|
leaves `../.wt/`; `--repo` (`-R`) on `gh pr`, `--body-file` (`-F`) on
|
|
101
112
|
`gh pr create`; `gh pr merge`, `gh api`, `gh repo`, `curl`. An agent
|
package/dist/init.js
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
// the kit's marker line; a file of the same name that the kit did not write
|
|
9
9
|
// is skipped with a note.
|
|
10
10
|
// - .claude/settings.json gets the kit's permissions added to its lists
|
|
11
|
-
// (and loses the broad allow rules of kits 1 and 2, RETIRED_ALLOW
|
|
11
|
+
// (and loses the broad allow rules of kits 1 and 2, RETIRED_ALLOW, and
|
|
12
|
+
// the deny rule Claude Code misreads in kits 3 and 4, RETIRED_DENY);
|
|
12
13
|
// .mcp.json gets a `board` server unless it already has one. The agent key
|
|
13
14
|
// is never written: .mcp.json refers to ${BOARD_URL} and ${BOARD_AGENT_KEY}.
|
|
14
15
|
// The permissions also allow the repository's own package manager (from its
|
|
@@ -44,7 +45,7 @@ export const PACKAGE_VERSION = PACKAGE.version;
|
|
|
44
45
|
* which wrote no version. The board says when a claim's kit is older than it
|
|
45
46
|
* expects (KIT_MIN in pocketbase/pb_hooks/board_lib.js).
|
|
46
47
|
*/
|
|
47
|
-
export const KIT_VERSION =
|
|
48
|
+
export const KIT_VERSION = 5;
|
|
48
49
|
const START = `<!-- mergeline:start (kit ${KIT_VERSION}; managed by \`board init\`; edit outside these markers) -->`;
|
|
49
50
|
/** Markers are found by these prefixes, so an edited marker line or an older kit's still counts. */
|
|
50
51
|
const START_PREFIX = "<!-- mergeline:start";
|
|
@@ -59,7 +60,8 @@ const COMMANDS = {
|
|
|
59
60
|
done: "Finish the current ticket: test, push, open a PR, submit for review",
|
|
60
61
|
};
|
|
61
62
|
/**
|
|
62
|
-
* Allow rules an older kit wrote that kit 3 narrows (security audit run 1)
|
|
63
|
+
* Allow rules an older kit wrote that kit 3 narrows (security audit run 1),
|
|
64
|
+
* and `git commit *` (kits 2 and 3) that kit 4 narrows to `-m` (R9.6.1):
|
|
63
65
|
* init takes them out of settings.json, since adding the narrow rules next to
|
|
64
66
|
* them would change nothing.
|
|
65
67
|
*/
|
|
@@ -69,7 +71,15 @@ const RETIRED_ALLOW = [
|
|
|
69
71
|
"Bash(git fetch *)",
|
|
70
72
|
"Bash(git worktree *)",
|
|
71
73
|
"Bash(git push *)",
|
|
74
|
+
"Bash(git commit *)",
|
|
72
75
|
];
|
|
76
|
+
/**
|
|
77
|
+
* Deny rules an older kit wrote that a newer one replaces: `Bash(git push *:*)`
|
|
78
|
+
* (kits 3 and 4) ends in `:*`, which Claude Code reads as its old prefix form
|
|
79
|
+
* (a literal prefix `git push *`, with the `*` not expanded), so it matched
|
|
80
|
+
* nothing and Claude Code warned at every start. Kit 5 has `git push *:**`.
|
|
81
|
+
*/
|
|
82
|
+
const RETIRED_DENY = ["Bash(git push *:*)"];
|
|
73
83
|
/** Scripts the agent runs before a PR (done.md), when the project has them. */
|
|
74
84
|
const CHECK_SCRIPTS = ["test", "lint", "typecheck", "check"];
|
|
75
85
|
/**
|
|
@@ -248,6 +258,8 @@ export function init(opts) {
|
|
|
248
258
|
let have = Array.isArray(data.permissions[list]) ? data.permissions[list] : [];
|
|
249
259
|
if (list === "allow")
|
|
250
260
|
have = have.filter((e) => !RETIRED_ALLOW.includes(e));
|
|
261
|
+
if (list === "deny")
|
|
262
|
+
have = have.filter((e) => !RETIRED_DENY.includes(e));
|
|
251
263
|
data.permissions[list] = [...have, ...entries.filter((e) => !have.includes(e))];
|
|
252
264
|
}
|
|
253
265
|
});
|
package/kit/claude-settings.json
CHANGED
|
@@ -56,7 +56,9 @@
|
|
|
56
56
|
"Bash(git log)",
|
|
57
57
|
"Bash(git log *)",
|
|
58
58
|
"Bash(git add *)",
|
|
59
|
-
"Bash(git commit *)",
|
|
59
|
+
"Bash(git commit -m *)",
|
|
60
|
+
"Bash(git commit -am *)",
|
|
61
|
+
"Bash(git commit -a -m *)",
|
|
60
62
|
"Bash(git worktree add ../.wt/*)",
|
|
61
63
|
"Bash(git worktree list)",
|
|
62
64
|
"Bash(git push origin agent/*)",
|
|
@@ -76,12 +78,33 @@
|
|
|
76
78
|
"Bash(gh pr merge *)",
|
|
77
79
|
"Bash(gh api *)",
|
|
78
80
|
"Bash(gh repo *)",
|
|
79
|
-
"Bash(git *--
|
|
81
|
+
"Bash(git *--upl*)",
|
|
80
82
|
"Bash(git *--receive-pack*)",
|
|
81
83
|
"Bash(git *--exec*)",
|
|
82
84
|
"Bash(git *--output*)",
|
|
83
85
|
"Bash(git *--git-dir*)",
|
|
84
86
|
"Bash(git *--work-tree*)",
|
|
87
|
+
"Bash(git *--pathspec-fr*)",
|
|
88
|
+
"Bash(git diff *--no-index*)",
|
|
89
|
+
"Bash(git diff *../*)",
|
|
90
|
+
"Bash(git diff /*)",
|
|
91
|
+
"Bash(git diff * /*)",
|
|
92
|
+
"Bash(git diff ~*)",
|
|
93
|
+
"Bash(git diff * ~*)",
|
|
94
|
+
"Bash(git diff $*)",
|
|
95
|
+
"Bash(git diff * $*)",
|
|
96
|
+
"Bash(git diff '/*)",
|
|
97
|
+
"Bash(git diff * '/*)",
|
|
98
|
+
"Bash(git diff '~*)",
|
|
99
|
+
"Bash(git diff * '~*)",
|
|
100
|
+
"Bash(git diff '$*)",
|
|
101
|
+
"Bash(git diff * '$*)",
|
|
102
|
+
"Bash(git diff \"/*)",
|
|
103
|
+
"Bash(git diff * \"/*)",
|
|
104
|
+
"Bash(git diff \"~*)",
|
|
105
|
+
"Bash(git diff * \"~*)",
|
|
106
|
+
"Bash(git diff \"$*)",
|
|
107
|
+
"Bash(git diff * \"$*)",
|
|
85
108
|
"Bash(git fetch -u*)",
|
|
86
109
|
"Bash(git fetch * -u*)",
|
|
87
110
|
"Bash(git push origin main*)",
|
|
@@ -91,7 +114,7 @@
|
|
|
91
114
|
"Bash(git push -f *)",
|
|
92
115
|
"Bash(git push * --force*)",
|
|
93
116
|
"Bash(git push * -f*)",
|
|
94
|
-
"Bash(git push
|
|
117
|
+
"Bash(git push *:**)",
|
|
95
118
|
"Bash(git push origin agent/* *)",
|
|
96
119
|
"Bash(git push -u origin agent/* *)",
|
|
97
120
|
"Bash(git push * --delete*)",
|
package/kit/done.md
CHANGED
|
@@ -9,7 +9,8 @@ the `board` command of the same name (`submit_for_review` is `board submit`).
|
|
|
9
9
|
2. Call `heartbeat` before you push. If it says another session holds the
|
|
10
10
|
ticket, stop at once: do not commit, push or open a PR. If it says to
|
|
11
11
|
claim again, stop and claim.
|
|
12
|
-
3. Commit with a clear message
|
|
12
|
+
3. Commit with a clear message given on the command line,
|
|
13
|
+
`git commit -m "<message>"` (or `-am`), and push the branch:
|
|
13
14
|
`git push -u origin <branch>`.
|
|
14
15
|
4. Open a PR against `main` with `gh pr create`. Title: the ticket title.
|
|
15
16
|
The body names the ticket id, the spec path and the spec commit
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mergeline/agent",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
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",
|