@ethlete/agent-rules 0.1.0-next.57 → 0.1.0-next.58
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 +10 -0
- 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 +1 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +24 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ethlete/agent-rules
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.58
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `agent-sessions pane <name>` reports whether a session is busy, holds a typed draft, or shows only a CLI suggestion.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- `agent-sessions restart` no longer waits on an idle session whose background agent row reads "Waiting for ...".
|
|
12
|
+
|
|
3
13
|
## 0.1.0-next.57
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -78,6 +78,7 @@ If the prompt of the agent holds typed text, the dispatcher waits until that tex
|
|
|
78
78
|
|
|
79
79
|
- `inbox` keeps one cursor per sender name, so it never repeats a message. The first call shows the last 20.
|
|
80
80
|
- `read` shows the last 20 messages. Use `--all` for the full history.
|
|
81
|
+
- `pane <name>` prints the state of a session's input box: `busy: <reason>`, `draft: <typed text>`, or `empty`, with the grey CLI suggestion if one shows. Use it instead of `tmux capture-pane`: a suggestion is not typed text.
|
|
81
82
|
- `send` with no message reads it from standard input, so a long message needs no shell quoting.
|
|
82
83
|
- `watch` is optional. It runs until you stop it. In Claude Code, start it with the `Monitor` tool, so a new message wakes the session. Without such a feature, rely on `inbox`.
|
|
83
84
|
- Never rewrite or truncate the file. Only the script appends to it.
|
|
@@ -557,10 +557,11 @@ const BACKGROUND_FOOTER = /\b\d+ (?:shells?|agents?)\b/i;
|
|
|
557
557
|
*/
|
|
558
558
|
const SGR = `${String.fromCharCode(27)}\\[([0-9;]*)m`;
|
|
559
559
|
const BUSY_TEXT = /esc to interrupt|Waiting for/i;
|
|
560
|
-
const isTranscript = (line) => /^\s*[
|
|
560
|
+
const isTranscript = (line) => /^\s*[●⎿◯]/.test(line);
|
|
561
561
|
/**
|
|
562
562
|
* The line that shows a running turn: the spinner line right above the input box, or a footer line below it.
|
|
563
|
-
* A transcript line (`●`, `⎿`)
|
|
563
|
+
* A transcript line (`●`, `⎿`) or a background agent row (`◯`) never counts, since its own text can read
|
|
564
|
+
* "Waiting for ...".
|
|
564
565
|
*/
|
|
565
566
|
const busyLineOf = (lines) => {
|
|
566
567
|
const bottom = lastRuleIndex(lines);
|
|
@@ -743,6 +744,20 @@ const leavePanel = (session) => {
|
|
|
743
744
|
return false;
|
|
744
745
|
};
|
|
745
746
|
const hasDraft = (session) => draftLine(session) !== null;
|
|
747
|
+
const promptText = (lines) =>
|
|
748
|
+
lines
|
|
749
|
+
.join('\n')
|
|
750
|
+
.replace(/^\s*[❯›]/, '')
|
|
751
|
+
.replace(IDE_CHIP, '')
|
|
752
|
+
.trim();
|
|
753
|
+
const paneStateOf = (session) => {
|
|
754
|
+
const busy = busyLine(session);
|
|
755
|
+
if (busy !== null) return `busy: ${busy.trim()}`;
|
|
756
|
+
const draft = draftLine(session);
|
|
757
|
+
if (draft !== null) return `draft: ${draft}`;
|
|
758
|
+
const suggestion = promptText(promptLines(paneLines(session)).map(plain));
|
|
759
|
+
return suggestion ? `empty; CLI suggestion, not typed: ${suggestion}` : 'empty';
|
|
760
|
+
};
|
|
746
761
|
const isAttached = (name) => tmux('list-clients', '-t', `=${name}`).stdout.trim() !== '';
|
|
747
762
|
const freeSessionFor = (agent) => {
|
|
748
763
|
for (let number = 1; ; number++) {
|
|
@@ -1374,6 +1389,13 @@ if (command === 'stop-own') {
|
|
|
1374
1389
|
};
|
|
1375
1390
|
process.stdout.write(`Dispatching for ${resolve(mailbox)}\n`);
|
|
1376
1391
|
setInterval(poll, 1000);
|
|
1392
|
+
} else if (command === 'pane' && sender) {
|
|
1393
|
+
const session = localSessionFor(sender) ?? (sessionExists(sender) ? sender : null);
|
|
1394
|
+
if (session) process.stdout.write(`${paneStateOf(session)}\n`);
|
|
1395
|
+
else {
|
|
1396
|
+
process.stderr.write(`No tmux session for ${sender}.\n`);
|
|
1397
|
+
process.exitCode = 1;
|
|
1398
|
+
}
|
|
1377
1399
|
} else if (command === 'inbox' && sender) {
|
|
1378
1400
|
showInbox(sender, Number(waitSeconds ?? 0));
|
|
1379
1401
|
} else if (command === 'read') {
|