@ethlete/agent-rules 0.1.0-next.54 → 0.1.0-next.56
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/CHANGELOG.md +12 -0
- package/content/hooks/builder-idle-check.py +3 -2
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +1 -1
- package/content/skills/agent-sessions/SKILL.md +2 -2
- package/content/skills/agent-sessions/agent-sessions.mjs +22 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ethlete/agent-rules
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.56
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The `builder-idle-check` and `human-wait-check` hooks use a default slot limit of 2, one Claude subagent and one Codex agent. Set `builderSlots` in `ethlete-agents.config.local.json` to change it.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-next.55
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- `agent-sessions restart --process` is refused while the target pane shows running background shells or agents, and names them. Pass `--force` to stop them anyway. A plain restart still clears and leaves them running.
|
|
14
|
+
|
|
3
15
|
## 0.1.0-next.54
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,7 +6,8 @@ builder-...`) must not end a turn with free slots. When a turn ends with fewer
|
|
|
6
6
|
subagents and background commands running than the slot limit - a CI watcher or a
|
|
7
7
|
dev server does not count - and the queue (`plans/QUEUE.md`, rows owned by `Builder`) has open
|
|
8
8
|
rows without a wait reason, the stop is blocked and the reason names those rows, so
|
|
9
|
-
the turn goes on. The slot limit is `builderSlots` in the local config (default
|
|
9
|
+
the turn goes on. The slot limit is `builderSlots` in the local config (default 2:
|
|
10
|
+
one Claude subagent and one Codex agent).
|
|
10
11
|
|
|
11
12
|
Agents started before a `/clear` are read from the meta files in the session's `subagents/`
|
|
12
13
|
directory (an unfinished meta whose launch is not in the transcript counts as running; a finished one too while
|
|
@@ -55,7 +56,7 @@ HOOK_NAME = "builder-idle-check"
|
|
|
55
56
|
LOCAL_CONFIG_FILE = "ethlete-agents.config.local.json"
|
|
56
57
|
DEFAULT_QUEUES = [{"path": os.path.join("plans", "QUEUE.md"), "format": "table"}]
|
|
57
58
|
QUEUE_OWNER = "Builder"
|
|
58
|
-
DEFAULT_SLOTS =
|
|
59
|
+
DEFAULT_SLOTS = 2
|
|
59
60
|
CODEX_LOW_LEFT_PERCENT = 20
|
|
60
61
|
CODEX_SCAN_FILES = 12
|
|
61
62
|
EARLIER_TRANSCRIPT_WINDOW = 24 * 3600
|
|
@@ -20,7 +20,7 @@ script, so you do not need `<skill-dir>`. The older name `npx ethlete-agents mai
|
|
|
20
20
|
```bash
|
|
21
21
|
node <skill-dir>/agent-sessions.mjs run <name> <command...> [--role builder] [--dry-run]
|
|
22
22
|
node <skill-dir>/agent-sessions.mjs up <name>[=<command>]...
|
|
23
|
-
node <skill-dir>/agent-sessions.mjs restart <name> [--after <seconds>] [--notify <agent,...>] [--process [--config <dir>]] [--role builder|none] <prompt...>
|
|
23
|
+
node <skill-dir>/agent-sessions.mjs restart <name> [--after <seconds>] [--notify <agent,...>] [--process [--force] [--config <dir>]] [--role builder|none] <prompt...>
|
|
24
24
|
node <skill-dir>/agent-sessions.mjs down [<name>...]
|
|
25
25
|
node <skill-dir>/agent-sessions.mjs shell-install [<agent>...] [--file <path>] [--remove] [--dry-run]
|
|
26
26
|
node <skill-dir>/agent-sessions.mjs shell-init [<agent>...]
|
|
@@ -58,7 +58,7 @@ Nothing runs until you start it, so a person who does not use this does nothing.
|
|
|
58
58
|
- **Denied by permissions.** If the permission system denies your own `restart`, send one mailbox line to the grill/docs session, for example `send <you> --to <grill> 'restart denied, please /clear my pane and type: <prompt>'`. It types into your pane only when the pane is idle by the rule above.
|
|
59
59
|
- **Open questions.** For a `claude` session, `restart` reads the transcript and refuses while a chat line that starts with `❓` has no later message the human typed, unless the handoff the prompt resumes (`/handoff resume <name>`) names that question verbatim under "Open for the human". The refusal lists the questions to copy there.
|
|
60
60
|
|
|
61
|
-
`restart --process` ends the agent process instead of clearing it: it types `/exit` (`/quit` for a `codex` name) and starts the agent command again in the same tmux pane, through a login shell, with the prompt as its first message. It also stops the background shells and agents. Use it only after a change to an installed plugin, a settings file, an MCP server or `PATH`, use `--process`. The agent command is the one `run` started, without its prompt. It starts with `command`, so the shell function of the same name does not start a new session. If the exit opens the background work dialog, it selects "exit and stop tasks" and writes the stopped jobs to `restart.log` and a mailbox notice.
|
|
61
|
+
`restart --process` ends the agent process instead of clearing it: it types `/exit` (`/quit` for a `codex` name) and starts the agent command again in the same tmux pane, through a login shell, with the prompt as its first message. It also stops the background shells and agents, so it is refused while the pane shows any (footer count or agent panel row) and names them; `--force` stops them anyway. Use it only after a change to an installed plugin, a settings file, an MCP server or `PATH`, use `--process`. The agent command is the one `run` started, without its prompt. It starts with `command`, so the shell function of the same name does not start a new session. If the exit opens the background work dialog, it selects "exit and stop tasks" and writes the stopped jobs to `restart.log` and a mailbox notice.
|
|
62
62
|
|
|
63
63
|
The new process takes the target's role, not the caller's: `--role`, else a resumed `builder-*` or `doc-agent-*` handoff's (`doc-agent-*` is none), else its own. A builder process gets `ETHLETE_AGENT_ROLE=builder` and, for `claude`, the builder system prompt once. A session with no role next to another agent session in the repo, none of them a builder, is refused unless the prompt resumes a `builder-*` or `doc-agent-*` handoff or `--role` is passed (`--role none` restarts it without a role).
|
|
64
64
|
|
|
@@ -90,10 +90,11 @@ Run: node ${script} run <name> <command...> [--role builder] [--dry-run]
|
|
|
90
90
|
Install: node ${script} shell-install [<agent>...] [--file <path>] [--remove] [--dry-run]
|
|
91
91
|
(write the shell functions into ~/.zshrc or ~/.bashrc)
|
|
92
92
|
Shell: node ${script} shell-init [<agent>...] (print shell functions that wrap each agent with run; default: claude codex)
|
|
93
|
-
Restart: node ${script} restart <name> [--after <seconds>] [--notify <agent,...>] [--process [--config <dir>]] [--role builder|none] <prompt...>
|
|
93
|
+
Restart: node ${script} restart <name> [--after <seconds>] [--notify <agent,...>] [--process [--force] [--config <dir>]] [--role builder|none] <prompt...>
|
|
94
94
|
(type the clear command and then the prompt into the tmux session of <name>;
|
|
95
95
|
a long wait on a draft and a give-up go to <name> and each --notify agent;
|
|
96
|
-
--process ends the agent and starts it again in the same pane with the prompt
|
|
96
|
+
--process ends the agent and starts it again in the same pane with the prompt,
|
|
97
|
+
and is refused while the pane shows background shells or agents unless --force;
|
|
97
98
|
--config changes the saved CLAUDE_CONFIG_DIR for a process restart;
|
|
98
99
|
it takes --role, else the role a builder-*/doc-agent-* handoff names, else keeps the role, and refuses
|
|
99
100
|
a session with no role while another agent session runs in the repo;
|
|
@@ -650,6 +651,12 @@ const typeResume = (session, prompt) => {
|
|
|
650
651
|
return false;
|
|
651
652
|
};
|
|
652
653
|
|
|
654
|
+
const runningWorkOf = (lines) =>
|
|
655
|
+
lines
|
|
656
|
+
.slice(lastRuleIndex(lines) + 1)
|
|
657
|
+
.map((line) => plain(line).trim())
|
|
658
|
+
.filter((line) => BACKGROUND_FOOTER.test(line) || isPanelRow(line));
|
|
659
|
+
|
|
653
660
|
const backgroundWorkOf = (lines) => {
|
|
654
661
|
const footer = lines.slice(lastRuleIndex(lines) + 1).map(plain);
|
|
655
662
|
return footer.find((line) => BACKGROUND_FOOTER.test(line) || isPanelRow(line))?.trim() ?? null;
|
|
@@ -1173,6 +1180,13 @@ if (command === 'stop-own') {
|
|
|
1173
1180
|
);
|
|
1174
1181
|
process.exit(1);
|
|
1175
1182
|
}
|
|
1183
|
+
const running = force ? [] : runningWorkOf(paneLines(session));
|
|
1184
|
+
if (running.length) {
|
|
1185
|
+
restartNotice(
|
|
1186
|
+
`restart --process of ${session} refused, it still runs background work: ${running.join('; ')}. Wait for it, or pass --force to stop it`,
|
|
1187
|
+
);
|
|
1188
|
+
process.exit(1);
|
|
1189
|
+
}
|
|
1176
1190
|
if (stored !== recorded) {
|
|
1177
1191
|
tmux('set-option', '-t', pane, COMMAND_OPTION, stored);
|
|
1178
1192
|
restartLog(`${session} stored command could not restart, healed to: ${stored}`);
|
|
@@ -1257,12 +1271,18 @@ if (command === 'stop-own') {
|
|
|
1257
1271
|
process.exitCode = 1;
|
|
1258
1272
|
}
|
|
1259
1273
|
}
|
|
1274
|
+
} else if (newProcess && !force && runningWorkOf(paneLines(session)).length) {
|
|
1275
|
+
process.stderr.write(
|
|
1276
|
+
`Refused: ${session} runs background work that --process would stop: ${runningWorkOf(paneLines(session)).join('; ')}\nWait for it, or pass --force to stop it.\n`,
|
|
1277
|
+
);
|
|
1278
|
+
process.exitCode = 1;
|
|
1260
1279
|
} else {
|
|
1261
1280
|
if (own && own !== session) restartLog(`peer restart: ${own} restarted ${session}`);
|
|
1262
1281
|
const delay = Number(afterSeconds ?? RESTART_AFTER_SECONDS);
|
|
1263
1282
|
const forward = notify ? ['--notify', notify] : [];
|
|
1264
1283
|
const mode = [
|
|
1265
1284
|
...(newProcess ? ['--process'] : []),
|
|
1285
|
+
...(newProcess && force ? ['--force'] : []),
|
|
1266
1286
|
...(configOverride === undefined ? [] : ['--config', configOverride]),
|
|
1267
1287
|
...(role ? ['--role', role] : []),
|
|
1268
1288
|
];
|