@ricsam/r5dctl 0.0.106 → 0.0.107

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 CHANGED
@@ -87,6 +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> "..." # after the current turn
90
91
  r5dctl -s <session-id> answer-questions --worker <label> --mode plan --model max -a1 "Recipe Collection" -a2 "Both Manual & AI"
91
92
  r5dctl -s <session-id> answer-env-request --worker <label> --mode agent --model max -e KEY=value --context "Generate the remaining salts"
92
93
 
@@ -95,6 +96,7 @@ r5dctl -p <project> session start --worker <label> --new-worktree fix/tests --so
95
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"
96
97
  r5dctl session status <session-id>
97
98
  r5dctl session prompt --worker <label> --mode agent --model max <session-id> "Also check the migration"
99
+ r5dctl session prompt --worker <label> --mode agent --model max --delivery force <session-id> "Stop that and fix the build first"
98
100
  r5dctl session stop <session-id>
99
101
  r5dctl session process-log <run-id> --tail 200
100
102
  r5dctl session process-log <run-id> --grep "error|failed"
@@ -129,7 +131,9 @@ pull requests.
129
131
 
130
132
  `get branches` lists every branch the project knows about, including managed branches without sessions. A worker whose workspace sync found a configured branch's checkout directory missing, or present but not a linked worktree of the project, skips that branch and reports it; the listing then shows `checkout=missing on <worker>` or `checkout=not_a_worktree on <worker>`, and `workspace status` prints a `Missing checkouts on <worker>` line. Recover either by deleting the branch with `delete branch <branch> --confirm` or by reconnecting that worker, which recreates the checkout without snapshotting the project's other checkouts.
131
133
 
132
- `session start` creates an ordinary agent-mode chat on an explicitly selected existing worktree, or creates a named linked worktree from an explicit `worktree:<branch>` source. A new worktree is cut from the source branch's current commit; `--working-tree carry` (the default, `git switch -c` semantics) also copies the source checkout's uncommitted changes into it, while `--working-tree clean` checks out that commit only. The new session's first message states which mode applies, and the start output prints `Source` and `Working tree` lines. A clean request fails with a clear error when the selected worker predates the option, because such a worker would silently carry instead. It requires project, worker, model, and prompt and never infers them from the current shell. Start returns a durable `provisioning` handle immediately; workspace synchronization, linked-worktree creation, and prompt enqueue continue in the background and are visible through `session status`. Idempotent request retries return the same handle. Prompts return after durable enqueue. Task specialization belongs in the prompt; there are no predefined debug, explore, research, or test agents. `session stop` returns as soon as the agent run is stopped; the stopped worktree's workspace Git synchronization finishes asynchronously behind the response.
134
+ `session start` creates an ordinary agent-mode chat on an explicitly selected existing worktree, or creates a named linked worktree from an explicit `worktree:<branch>` source. A new worktree is cut from the source branch's current commit; `--working-tree carry` (the default, `git switch -c` semantics) also copies the source checkout's uncommitted changes into it, while `--working-tree clean` checks out that commit only. The new session's first message states which mode applies, and the start output prints `Source` and `Working tree` lines. A clean request fails with a clear error when the selected worker predates the option, because such a worker would silently carry instead. It requires project, worker, model, and prompt and never infers them from the current shell. Start returns a durable `provisioning` handle immediately; workspace synchronization, linked-worktree creation, and prompt enqueue continue in the background and are visible through `session status`. Idempotent request retries return the same handle. Prompts return after durable enqueue. Task specialization belongs in the prompt; there are no predefined debug, explore, research, or test agents.
135
+
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.
133
137
 
134
138
  `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.
135
139
 
package/dist/cjs/cli.cjs CHANGED
@@ -113,6 +113,8 @@ var import_r5d_api = require("@ricsam/r5d-api");
113
113
  var import_shell = require("./shell.cjs");
114
114
  const CHAT_MODES = /* @__PURE__ */ new Set(["plan", "agent", "large_diff_remediation"]);
115
115
  const R5DCTL_SESSION_MODES = /* @__PURE__ */ new Set(["plan", "agent"]);
116
+ const R5DCTL_PROMPT_DELIVERIES = /* @__PURE__ */ new Set(["queue", "steer", "force"]);
117
+ const R5DCTL_PROMPT_DEFAULT_DELIVERY = "steer";
116
118
  const MODEL_TIERS = /* @__PURE__ */ new Set(["low", "medium", "high", "max"]);
117
119
  const R5DCTL_PACKAGE_NAME = "@ricsam/r5dctl";
118
120
  const CLI_GLOBAL_OPTION_HELP = [
@@ -175,11 +177,13 @@ const SESSION_RUN_HELP_TEXT = [
175
177
  ' r5dctl -p <project> session start --worker <label> --worktree <branch> --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
176
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>"',
177
179
  " r5dctl session status <session-id>",
178
- ' r5dctl session prompt --worker <label> --mode <mode> --model <tier> <session-id> "<prompt>"',
180
+ ' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
179
181
  " r5dctl session stop <session-id>",
180
182
  " r5dctl session process-log <run-id> [--tail <n>] [--grep <pattern>]",
181
183
  "",
182
184
  "Create, inspect, resume, and stop ordinary agent sessions.",
185
+ "prompt reaches a busy session by --delivery: steer (default) lands after the agent's next tool result,",
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.",
183
187
  "A new worktree starts with the source checkout's uncommitted changes (--working-tree carry, the default);",
184
188
  "--working-tree clean checks out the source branch's current commit only. Start and status print the mode, never a commit hash.",
185
189
  "Use -f/--follow/--watch to attach after a start; Ctrl-C detaches without stopping the session.",
@@ -309,8 +313,8 @@ const SHARED_HELP_ENTRIES = [
309
313
  },
310
314
  {
311
315
  section: "sessions",
312
- usage: 'session prompt --worker <label> --mode <mode> --model <tier> <session-id> "<prompt>"',
313
- description: "Queue a prompt or start a new session generation."
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."
314
318
  },
315
319
  {
316
320
  section: "sessions",
@@ -603,6 +607,14 @@ function requireSessionMode(value) {
603
607
  }
604
608
  return mode;
605
609
  }
610
+ function parsePromptDelivery(value) {
611
+ if (value === void 0) return R5DCTL_PROMPT_DEFAULT_DELIVERY;
612
+ const delivery = value.trim();
613
+ if (!R5DCTL_PROMPT_DELIVERIES.has(delivery)) {
614
+ throw new Error("Invalid --delivery. Expected one of: queue, steer, force");
615
+ }
616
+ return delivery;
617
+ }
606
618
  function parseBranchCreateArgs(args) {
607
619
  const parsed = parseCommandOperands(args, /* @__PURE__ */ new Set(["--source", "--working-tree", "--worker"]), /* @__PURE__ */ new Map(), "create branch", 1);
608
620
  if (parsed.positionals.length > 0) throw new Error(`Unexpected create branch argument: ${parsed.positionals[0]}`);
@@ -802,7 +814,7 @@ function parseSessionRunCommand(options, args) {
802
814
  return { kind: subcommand, sessionId };
803
815
  }
804
816
  if (subcommand === "prompt") {
805
- const parsed = parseCommandOperands(commandArgs, /* @__PURE__ */ new Set(["--worker", "--mode", "--model"]), /* @__PURE__ */ new Map(), "session prompt", 1);
817
+ const parsed = parseCommandOperands(commandArgs, /* @__PURE__ */ new Set(["--worker", "--mode", "--model", "--delivery"]), /* @__PURE__ */ new Map(), "session prompt", 1);
806
818
  const sessionId = requireValue(parsed.positionals[0], "Session id is required for `session prompt`");
807
819
  const prompt = parsed.positionals.slice(1).join(" ").trim();
808
820
  if (!prompt) throw new Error("Prompt is required for `session prompt`");
@@ -812,7 +824,8 @@ function parseSessionRunCommand(options, args) {
812
824
  sessionId,
813
825
  prompt,
814
826
  mode: requireSessionMode(parsed.values.get("--mode")),
815
- model: requireModel(parsed.values.get("--model"))
827
+ model: requireModel(parsed.values.get("--model")),
828
+ delivery: parsePromptDelivery(parsed.values.get("--delivery"))
816
829
  };
817
830
  }
818
831
  throw new Error(`Unknown session command: ${subcommand}`);
@@ -2208,7 +2221,8 @@ async function dispatchSessionRunCommand(client, command) {
2208
2221
  worker: command.worker,
2209
2222
  mode: command.mode,
2210
2223
  model: command.model,
2211
- requestId: (0, import_node_crypto.randomUUID)()
2224
+ requestId: (0, import_node_crypto.randomUUID)(),
2225
+ delivery: command.delivery
2212
2226
  });
2213
2227
  return { data: data2, human: renderSessionRunStatus(data2) };
2214
2228
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
4
4
  "type": "commonjs"
5
5
  }
package/dist/mjs/cli.mjs CHANGED
@@ -13,6 +13,8 @@ import {
13
13
  import { runR5dctlShell } from "./shell.mjs";
14
14
  const CHAT_MODES = /* @__PURE__ */ new Set(["plan", "agent", "large_diff_remediation"]);
15
15
  const R5DCTL_SESSION_MODES = /* @__PURE__ */ new Set(["plan", "agent"]);
16
+ const R5DCTL_PROMPT_DELIVERIES = /* @__PURE__ */ new Set(["queue", "steer", "force"]);
17
+ const R5DCTL_PROMPT_DEFAULT_DELIVERY = "steer";
16
18
  const MODEL_TIERS = /* @__PURE__ */ new Set(["low", "medium", "high", "max"]);
17
19
  const R5DCTL_PACKAGE_NAME = "@ricsam/r5dctl";
18
20
  const CLI_GLOBAL_OPTION_HELP = [
@@ -75,11 +77,13 @@ const SESSION_RUN_HELP_TEXT = [
75
77
  ' r5dctl -p <project> session start --worker <label> --worktree <branch> --model <tier> [-f|--follow|--watch] [--tools] [--parent-session <session-id>] "<prompt>"',
76
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>"',
77
79
  " r5dctl session status <session-id>",
78
- ' r5dctl session prompt --worker <label> --mode <mode> --model <tier> <session-id> "<prompt>"',
80
+ ' r5dctl session prompt --worker <label> --mode <mode> --model <tier> [--delivery queue|steer|force] <session-id> "<prompt>"',
79
81
  " r5dctl session stop <session-id>",
80
82
  " r5dctl session process-log <run-id> [--tail <n>] [--grep <pattern>]",
81
83
  "",
82
84
  "Create, inspect, resume, and stop ordinary agent sessions.",
85
+ "prompt reaches a busy session by --delivery: steer (default) lands after the agent's next tool result,",
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.",
83
87
  "A new worktree starts with the source checkout's uncommitted changes (--working-tree carry, the default);",
84
88
  "--working-tree clean checks out the source branch's current commit only. Start and status print the mode, never a commit hash.",
85
89
  "Use -f/--follow/--watch to attach after a start; Ctrl-C detaches without stopping the session.",
@@ -209,8 +213,8 @@ const SHARED_HELP_ENTRIES = [
209
213
  },
210
214
  {
211
215
  section: "sessions",
212
- usage: 'session prompt --worker <label> --mode <mode> --model <tier> <session-id> "<prompt>"',
213
- description: "Queue a prompt or start a new session generation."
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."
214
218
  },
215
219
  {
216
220
  section: "sessions",
@@ -503,6 +507,14 @@ function requireSessionMode(value) {
503
507
  }
504
508
  return mode;
505
509
  }
510
+ function parsePromptDelivery(value) {
511
+ if (value === void 0) return R5DCTL_PROMPT_DEFAULT_DELIVERY;
512
+ const delivery = value.trim();
513
+ if (!R5DCTL_PROMPT_DELIVERIES.has(delivery)) {
514
+ throw new Error("Invalid --delivery. Expected one of: queue, steer, force");
515
+ }
516
+ return delivery;
517
+ }
506
518
  function parseBranchCreateArgs(args) {
507
519
  const parsed = parseCommandOperands(args, /* @__PURE__ */ new Set(["--source", "--working-tree", "--worker"]), /* @__PURE__ */ new Map(), "create branch", 1);
508
520
  if (parsed.positionals.length > 0) throw new Error(`Unexpected create branch argument: ${parsed.positionals[0]}`);
@@ -702,7 +714,7 @@ function parseSessionRunCommand(options, args) {
702
714
  return { kind: subcommand, sessionId };
703
715
  }
704
716
  if (subcommand === "prompt") {
705
- const parsed = parseCommandOperands(commandArgs, /* @__PURE__ */ new Set(["--worker", "--mode", "--model"]), /* @__PURE__ */ new Map(), "session prompt", 1);
717
+ const parsed = parseCommandOperands(commandArgs, /* @__PURE__ */ new Set(["--worker", "--mode", "--model", "--delivery"]), /* @__PURE__ */ new Map(), "session prompt", 1);
706
718
  const sessionId = requireValue(parsed.positionals[0], "Session id is required for `session prompt`");
707
719
  const prompt = parsed.positionals.slice(1).join(" ").trim();
708
720
  if (!prompt) throw new Error("Prompt is required for `session prompt`");
@@ -712,7 +724,8 @@ function parseSessionRunCommand(options, args) {
712
724
  sessionId,
713
725
  prompt,
714
726
  mode: requireSessionMode(parsed.values.get("--mode")),
715
- model: requireModel(parsed.values.get("--model"))
727
+ model: requireModel(parsed.values.get("--model")),
728
+ delivery: parsePromptDelivery(parsed.values.get("--delivery"))
716
729
  };
717
730
  }
718
731
  throw new Error(`Unknown session command: ${subcommand}`);
@@ -2108,7 +2121,8 @@ async function dispatchSessionRunCommand(client, command) {
2108
2121
  worker: command.worker,
2109
2122
  mode: command.mode,
2110
2123
  model: command.model,
2111
- requestId: randomUUID()
2124
+ requestId: randomUUID(),
2125
+ delivery: command.delivery
2112
2126
  });
2113
2127
  return { data: data2, human: renderSessionRunStatus(data2) };
2114
2128
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
4
4
  "type": "module"
5
5
  }
@@ -1,4 +1,4 @@
1
- import { R5dctlApiError, R5dctlClient, type R5dctlConversationForkResponse, type R5dctlConversationHeadResponse, type R5dctlConversationRenderOptions, type R5dctlConversationResponse, type R5dctlConversationNodeResponse, type R5dctlConversationOverviewResponse, type R5dctlConversationWorkDetail, type R5dctlConversationWorkResponse, type R5dctlEnvData, type R5dctlK8sResourceHistory, type R5dctlK8sUsage, type R5dctlK8sWorkload, type R5dctlProcessInspection, type R5dctlProcessListInput, type R5dctlProcessLog, type R5dctlProcessRun, type R5dctlBranch, type R5dctlBranchDeleteResponse, type R5dctlBranchDescription, type R5dctlBranchOperation, type R5dctlSessionSummary, type R5dctlSessionEvent, type R5dctlSessionStartInput, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type R5dctlWorkingTreeMode, type R5dctlWorktreeSource, type R5dctlSessionMode, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
1
+ import { R5dctlApiError, R5dctlClient, type R5dctlConversationForkResponse, type R5dctlConversationHeadResponse, type R5dctlConversationRenderOptions, type R5dctlConversationResponse, type R5dctlConversationNodeResponse, type R5dctlConversationOverviewResponse, type R5dctlConversationWorkDetail, type R5dctlConversationWorkResponse, type R5dctlEnvData, type R5dctlK8sResourceHistory, type R5dctlK8sUsage, type R5dctlK8sWorkload, type R5dctlProcessInspection, type R5dctlProcessListInput, type R5dctlProcessLog, type R5dctlProcessRun, type R5dctlBranch, type R5dctlBranchDeleteResponse, type R5dctlBranchDescription, type R5dctlBranchOperation, type R5dctlSessionSummary, type R5dctlSessionEvent, type R5dctlSessionStartInput, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type R5dctlWorkingTreeMode, type R5dctlWorktreeSource, type R5dctlPromptDelivery, type R5dctlSessionMode, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
2
2
  export type GlobalOptions = {
3
3
  baseUrl?: string;
4
4
  json: boolean;
@@ -75,6 +75,7 @@ export type R5dctlSessionRunCommand = R5dctlSessionStartCommand | {
75
75
  prompt: string;
76
76
  mode: R5dctlSessionMode;
77
77
  model: ModelTier;
78
+ delivery: R5dctlPromptDelivery;
78
79
  } | {
79
80
  kind: "stop";
80
81
  sessionId: string;
@@ -305,6 +306,7 @@ export type R5dctlSessionRunClient = {
305
306
  mode: R5dctlSessionMode;
306
307
  model: ModelTier;
307
308
  requestId: string;
309
+ delivery?: R5dctlPromptDelivery;
308
310
  }) => Promise<R5dctlCommandResponse>;
309
311
  stop: (sessionId: string) => Promise<R5dctlCommandResponse>;
310
312
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
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.106",
29
+ "@ricsam/r5d-api": "^0.0.107",
30
30
  "dotenv": "^17",
31
31
  "qrcode": "^1.5.4",
32
32
  "ws": "^8.18.3"