@ricsam/r5dctl 0.0.107 → 0.0.109
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 -2
- package/dist/cjs/cli.cjs +19 -6
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/cli.mjs +19 -6
- package/dist/mjs/package.json +1 -1
- package/dist/types/cli.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ r5dctl conversation move-head <session-id> <node-id> # rewind or replay the
|
|
|
87
87
|
r5dctl conversation fork <session-id> <node-id> # copy the branch up to a node into a new session
|
|
88
88
|
r5dctl conversation fork <session-id> <node-id> --name "Retry with tests"
|
|
89
89
|
r5dctl session prompt --worker <label> --mode plan --model max <session-id> "..."
|
|
90
|
-
r5dctl session prompt --worker <label> --mode agent --model max --delivery queue <session-id> "
|
|
90
|
+
r5dctl session prompt --worker <label> --mode agent --model max --delivery queue <session-id> "After you finish your current task, review the release notes" # deliberately deferred work
|
|
91
91
|
r5dctl -s <session-id> answer-questions --worker <label> --mode plan --model max -a1 "Recipe Collection" -a2 "Both Manual & AI"
|
|
92
92
|
r5dctl -s <session-id> answer-env-request --worker <label> --mode agent --model max -e KEY=value --context "Generate the remaining salts"
|
|
93
93
|
|
|
@@ -95,7 +95,7 @@ r5dctl -p <project> session start --worker <label> --worktree main --model max "
|
|
|
95
95
|
r5dctl -p <project> session start --worker <label> --new-worktree fix/tests --source worktree:main --model max -f "Fix the failing tests"
|
|
96
96
|
r5dctl -p <project> session start --worker <label> --new-worktree fix/tests --source worktree:main --working-tree clean --model max "Fix the failing tests from main's committed state"
|
|
97
97
|
r5dctl session status <session-id>
|
|
98
|
-
r5dctl session prompt --worker <label> --mode agent --model max <session-id> "Also check the migration"
|
|
98
|
+
r5dctl session prompt --worker <label> --mode agent --model max --delivery steer <session-id> "Also check the migration"
|
|
99
99
|
r5dctl session prompt --worker <label> --mode agent --model max --delivery force <session-id> "Stop that and fix the build first"
|
|
100
100
|
r5dctl session stop <session-id>
|
|
101
101
|
r5dctl session process-log <run-id> --tail 200
|
|
@@ -135,6 +135,12 @@ pull requests.
|
|
|
135
135
|
|
|
136
136
|
`session prompt` works on any project session you can access, including one created in the web UI. `--delivery` decides how the prompt reaches a session whose agent is busy: `steer` (the default) lands inside the current turn right after the agent's next tool result, `queue` waits until the agent finishes the whole turn, and `force` aborts the agent's current round of tool calls and continues from the prompt instead. An idle session starts a new generation whatever the delivery, and a steer queued while the session was idle with an unfinished turn is still heard by the generation that resumes it. The response's `Prompt:` line reports `started`, `steered`, `queued`, or `forced`. `session stop` returns as soon as the agent run is stopped; the stopped worktree's workspace Git synchronization finishes asynchronously behind the response.
|
|
137
137
|
|
|
138
|
+
Use the optional `--sender "Authentication review"` flag to display a title above the usual message bubble. Agent shells expose `R5D_SESSION_NAME`, refreshed at each command start from the session name (or its ID until named), so agents can pass `--sender "$R5D_SESSION_NAME"`. The sender is a caller-supplied label; omitting the flag sends no title and leaves the message body unchanged.
|
|
139
|
+
|
|
140
|
+
For messages to an active session, explicitly use `--delivery steer` for coordination such as merge notices, requests to pause or avoid files, blockers, corrections, and handoff or resume notices. Use `--delivery force` when its current tool round must be interrupted. Reserve `--delivery queue` for work intentionally deferred until the entire current turn ends; even an FYI needs steering when it affects current work. These rules apply equally to peers, parents, and children.
|
|
141
|
+
|
|
142
|
+
Delivery is not acknowledgment. If a merge or shared-checkout change depends on another session pausing edits, send the pause request separately, wait for its explicit reply, and recheck the working tree before proceeding. `Prompt: queued` cannot establish that coordination, and even `steered` or `forced` does not prove the agent has read or acted on the request. Reply to coordination requests and send resume notices with `--delivery steer`.
|
|
143
|
+
|
|
138
144
|
`get sessions` lists a project's sessions, newest first, and appends each session's live state (`running`, `stopping`, `paused`, `provisioning`, `queued`, or `idle`) and how long ago its conversation last advanced (`running, last active 12s ago`). Several sessions can work in the same branch checkout at once (task chips, shared-mode sub-agents, sessions the user starts), so run it with `--branch` before relying on a working tree or reviewing what changed in it. A server that predates the fields prints the id, branch, and name only.
|
|
139
145
|
|
|
140
146
|
`session stop` also stops every sub-agent session the stopped session started, directly or through its own children, and `session status` prints `Child sessions: <active> active of <total>` for a session that launched sub-agents.
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -177,13 +177,16 @@ const SESSION_RUN_HELP_TEXT = [
|
|
|
177
177
|
' r5dctl -p <project> session start --worker <label> --worktree <branch> --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
|
|
178
178
|
' r5dctl -p <project> session start --worker <label> --new-worktree <branch> --source worktree:<branch> [--working-tree carry|clean] --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
|
|
179
179
|
" r5dctl session status <session-id>",
|
|
180
|
-
' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
|
|
180
|
+
' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] [--sender <name>] <session-id> "<prompt>"',
|
|
181
181
|
" r5dctl session stop <session-id>",
|
|
182
182
|
" r5dctl session process-log <run-id> [--tail <n>] [--grep <pattern>]",
|
|
183
183
|
"",
|
|
184
184
|
"Create, inspect, resume, and stop ordinary agent sessions.",
|
|
185
185
|
"prompt reaches a busy session by --delivery: steer (default) lands after the agent's next tool result,",
|
|
186
186
|
"queue waits for the current turn to finish, force replaces the agent's current tool round. An idle session starts a new generation either way.",
|
|
187
|
+
"Use --delivery steer for active-session coordination, including merge notices, pause requests, blockers, and handoffs.",
|
|
188
|
+
"Use force when the current tool round must be interrupted; queue is only for work deliberately deferred until the turn ends.",
|
|
189
|
+
"Prompt delivery is not acknowledgment. If a shared-checkout change depends on a pause, wait for the recipient's reply before proceeding.",
|
|
187
190
|
"A new worktree starts with the source checkout's uncommitted changes (--working-tree carry, the default);",
|
|
188
191
|
"--working-tree clean checks out the source branch's current commit only. Start and status print the mode, never a commit hash.",
|
|
189
192
|
"Use -f/--follow/--watch to attach after a start; Ctrl-C detaches without stopping the session.",
|
|
@@ -313,8 +316,8 @@ const SHARED_HELP_ENTRIES = [
|
|
|
313
316
|
},
|
|
314
317
|
{
|
|
315
318
|
section: "sessions",
|
|
316
|
-
usage: 'session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
|
|
317
|
-
description: "Prompt a session: steer into the current turn after the next tool result (default), queue behind the turn, or force in place of the current tool round; an idle session starts a new generation."
|
|
319
|
+
usage: 'session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] [--sender <name>] <session-id> "<prompt>"',
|
|
320
|
+
description: "Prompt a session: steer into the current turn after the next tool result (default), queue behind the turn, or force in place of the current tool round; an idle session starts a new generation. Use steer for active-session coordination; queue only deliberately deferred work. --sender adds an optional title above the message."
|
|
318
321
|
},
|
|
319
322
|
{
|
|
320
323
|
section: "sessions",
|
|
@@ -814,15 +817,24 @@ function parseSessionRunCommand(options, args) {
|
|
|
814
817
|
return { kind: subcommand, sessionId };
|
|
815
818
|
}
|
|
816
819
|
if (subcommand === "prompt") {
|
|
817
|
-
const parsed = parseCommandOperands(
|
|
820
|
+
const parsed = parseCommandOperands(
|
|
821
|
+
commandArgs,
|
|
822
|
+
/* @__PURE__ */ new Set(["--worker", "--mode", "--model", "--delivery", "--sender"]),
|
|
823
|
+
/* @__PURE__ */ new Map(),
|
|
824
|
+
"session prompt",
|
|
825
|
+
1
|
|
826
|
+
);
|
|
818
827
|
const sessionId = requireValue(parsed.positionals[0], "Session id is required for `session prompt`");
|
|
819
828
|
const prompt = parsed.positionals.slice(1).join(" ").trim();
|
|
820
829
|
if (!prompt) throw new Error("Prompt is required for `session prompt`");
|
|
830
|
+
const sender = parsed.values.get("--sender")?.trim();
|
|
831
|
+
if (sender !== void 0 && !sender) throw new Error("--sender must not be empty");
|
|
821
832
|
return {
|
|
822
833
|
kind: "prompt",
|
|
823
834
|
worker: requireWorker(parsed.values),
|
|
824
835
|
sessionId,
|
|
825
836
|
prompt,
|
|
837
|
+
...sender ? { sender } : {},
|
|
826
838
|
mode: requireSessionMode(parsed.values.get("--mode")),
|
|
827
839
|
model: requireModel(parsed.values.get("--model")),
|
|
828
840
|
delivery: parsePromptDelivery(parsed.values.get("--delivery"))
|
|
@@ -2185,7 +2197,7 @@ function renderSessionRunStatus(session) {
|
|
|
2185
2197
|
const summary = responseString(session, "summary");
|
|
2186
2198
|
if (summary) lines.push("", summary);
|
|
2187
2199
|
const sessionId = responseString(session, "sessionId");
|
|
2188
|
-
if (sessionId && ["provisioning", "queued", "running"].includes(status)) {
|
|
2200
|
+
if (sessionId && ["provisioning", "queued", "running", "waiting"].includes(status)) {
|
|
2189
2201
|
lines.push("", "Next:", ` r5dctl session status ${sessionId}`, ` r5dctl session stop ${sessionId}`);
|
|
2190
2202
|
}
|
|
2191
2203
|
return `${lines.join("\n")}
|
|
@@ -2222,7 +2234,8 @@ async function dispatchSessionRunCommand(client, command) {
|
|
|
2222
2234
|
mode: command.mode,
|
|
2223
2235
|
model: command.model,
|
|
2224
2236
|
requestId: (0, import_node_crypto.randomUUID)(),
|
|
2225
|
-
delivery: command.delivery
|
|
2237
|
+
delivery: command.delivery,
|
|
2238
|
+
...command.sender ? { sender: command.sender } : {}
|
|
2226
2239
|
});
|
|
2227
2240
|
return { data: data2, human: renderSessionRunStatus(data2) };
|
|
2228
2241
|
}
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/cli.mjs
CHANGED
|
@@ -77,13 +77,16 @@ const SESSION_RUN_HELP_TEXT = [
|
|
|
77
77
|
' r5dctl -p <project> session start --worker <label> --worktree <branch> --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
|
|
78
78
|
' r5dctl -p <project> session start --worker <label> --new-worktree <branch> --source worktree:<branch> [--working-tree carry|clean] --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
|
|
79
79
|
" r5dctl session status <session-id>",
|
|
80
|
-
' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
|
|
80
|
+
' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] [--sender <name>] <session-id> "<prompt>"',
|
|
81
81
|
" r5dctl session stop <session-id>",
|
|
82
82
|
" r5dctl session process-log <run-id> [--tail <n>] [--grep <pattern>]",
|
|
83
83
|
"",
|
|
84
84
|
"Create, inspect, resume, and stop ordinary agent sessions.",
|
|
85
85
|
"prompt reaches a busy session by --delivery: steer (default) lands after the agent's next tool result,",
|
|
86
86
|
"queue waits for the current turn to finish, force replaces the agent's current tool round. An idle session starts a new generation either way.",
|
|
87
|
+
"Use --delivery steer for active-session coordination, including merge notices, pause requests, blockers, and handoffs.",
|
|
88
|
+
"Use force when the current tool round must be interrupted; queue is only for work deliberately deferred until the turn ends.",
|
|
89
|
+
"Prompt delivery is not acknowledgment. If a shared-checkout change depends on a pause, wait for the recipient's reply before proceeding.",
|
|
87
90
|
"A new worktree starts with the source checkout's uncommitted changes (--working-tree carry, the default);",
|
|
88
91
|
"--working-tree clean checks out the source branch's current commit only. Start and status print the mode, never a commit hash.",
|
|
89
92
|
"Use -f/--follow/--watch to attach after a start; Ctrl-C detaches without stopping the session.",
|
|
@@ -213,8 +216,8 @@ const SHARED_HELP_ENTRIES = [
|
|
|
213
216
|
},
|
|
214
217
|
{
|
|
215
218
|
section: "sessions",
|
|
216
|
-
usage: 'session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
|
|
217
|
-
description: "Prompt a session: steer into the current turn after the next tool result (default), queue behind the turn, or force in place of the current tool round; an idle session starts a new generation."
|
|
219
|
+
usage: 'session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] [--sender <name>] <session-id> "<prompt>"',
|
|
220
|
+
description: "Prompt a session: steer into the current turn after the next tool result (default), queue behind the turn, or force in place of the current tool round; an idle session starts a new generation. Use steer for active-session coordination; queue only deliberately deferred work. --sender adds an optional title above the message."
|
|
218
221
|
},
|
|
219
222
|
{
|
|
220
223
|
section: "sessions",
|
|
@@ -714,15 +717,24 @@ function parseSessionRunCommand(options, args) {
|
|
|
714
717
|
return { kind: subcommand, sessionId };
|
|
715
718
|
}
|
|
716
719
|
if (subcommand === "prompt") {
|
|
717
|
-
const parsed = parseCommandOperands(
|
|
720
|
+
const parsed = parseCommandOperands(
|
|
721
|
+
commandArgs,
|
|
722
|
+
/* @__PURE__ */ new Set(["--worker", "--mode", "--model", "--delivery", "--sender"]),
|
|
723
|
+
/* @__PURE__ */ new Map(),
|
|
724
|
+
"session prompt",
|
|
725
|
+
1
|
|
726
|
+
);
|
|
718
727
|
const sessionId = requireValue(parsed.positionals[0], "Session id is required for `session prompt`");
|
|
719
728
|
const prompt = parsed.positionals.slice(1).join(" ").trim();
|
|
720
729
|
if (!prompt) throw new Error("Prompt is required for `session prompt`");
|
|
730
|
+
const sender = parsed.values.get("--sender")?.trim();
|
|
731
|
+
if (sender !== void 0 && !sender) throw new Error("--sender must not be empty");
|
|
721
732
|
return {
|
|
722
733
|
kind: "prompt",
|
|
723
734
|
worker: requireWorker(parsed.values),
|
|
724
735
|
sessionId,
|
|
725
736
|
prompt,
|
|
737
|
+
...sender ? { sender } : {},
|
|
726
738
|
mode: requireSessionMode(parsed.values.get("--mode")),
|
|
727
739
|
model: requireModel(parsed.values.get("--model")),
|
|
728
740
|
delivery: parsePromptDelivery(parsed.values.get("--delivery"))
|
|
@@ -2085,7 +2097,7 @@ function renderSessionRunStatus(session) {
|
|
|
2085
2097
|
const summary = responseString(session, "summary");
|
|
2086
2098
|
if (summary) lines.push("", summary);
|
|
2087
2099
|
const sessionId = responseString(session, "sessionId");
|
|
2088
|
-
if (sessionId && ["provisioning", "queued", "running"].includes(status)) {
|
|
2100
|
+
if (sessionId && ["provisioning", "queued", "running", "waiting"].includes(status)) {
|
|
2089
2101
|
lines.push("", "Next:", ` r5dctl session status ${sessionId}`, ` r5dctl session stop ${sessionId}`);
|
|
2090
2102
|
}
|
|
2091
2103
|
return `${lines.join("\n")}
|
|
@@ -2122,7 +2134,8 @@ async function dispatchSessionRunCommand(client, command) {
|
|
|
2122
2134
|
mode: command.mode,
|
|
2123
2135
|
model: command.model,
|
|
2124
2136
|
requestId: randomUUID(),
|
|
2125
|
-
delivery: command.delivery
|
|
2137
|
+
delivery: command.delivery,
|
|
2138
|
+
...command.sender ? { sender: command.sender } : {}
|
|
2126
2139
|
});
|
|
2127
2140
|
return { data: data2, human: renderSessionRunStatus(data2) };
|
|
2128
2141
|
}
|
package/dist/mjs/package.json
CHANGED
package/dist/types/cli.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5dctl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.109",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/cjs/cli.cjs",
|
|
6
6
|
"module": "./dist/mjs/cli.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"r5dctl": "dist/cjs/main.cjs"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ricsam/r5d-api": "^0.0.
|
|
29
|
+
"@ricsam/r5d-api": "^0.0.109",
|
|
30
30
|
"dotenv": "^17",
|
|
31
31
|
"qrcode": "^1.5.4",
|
|
32
32
|
"ws": "^8.18.3"
|