@ricsam/r5dctl 0.0.41 → 0.0.43

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
@@ -64,6 +64,7 @@ r5dctl -s <session-id> conversation --tools # include provider-shaped
64
64
  r5dctl -s <session-id> conversation --system # include system prompt messages
65
65
  r5dctl -s <session-id> conversation --raw --tools --system # exact raw agent request transcript
66
66
  r5dctl conversation overview <session-id> # dialogue/thinking with tool work omitted
67
+ r5dctl conversation inspect-node <session-id> <node-id> # raw persisted node plus traversal metadata
67
68
  r5dctl conversation inspect-work <session-id> <work-id> # compact call list for one omitted turn
68
69
  r5dctl conversation inspect-work <session-id> <work-id> --summary
69
70
  r5dctl conversation inspect-work <session-id> <work-id> --full
@@ -92,6 +93,8 @@ When available, conversation rendering uses the newest complete persisted model-
92
93
 
93
94
  `conversation overview` is a deterministic active-branch projection for continuing work in another session. It keeps user messages, injected context, assistant thinking/commentary/final responses, and user decisions, while replacing each turn's tool batches with a stable work ID and numbered call ranges. Adjacent tool batches with no visible content between them are coalesced into one range. Use `conversation inspect-work` with that session and work ID to inspect the omitted calls. Inspection is compact by default; `--summary` adds bounded targets/outcomes and `--full` renders persisted inputs and results with the normal tool renderers. The explicit `--compact`, `--summary`, and `--full` flags are mutually exclusive. Compact and summary output are designed to be narrowed with `grep`, `head`, `tail`, `sed`, or `cat -n`.
94
95
 
96
+ `conversation inspect-node` reads one exact persisted conversation node as formatted JSON. Its header includes the previous node, every direct next node, the next node on the active branch, whether the selected node is active, and the containing `work_...` ID when one is available. This allows callers that start with only a copied chat node ID to traverse nearby nodes or zoom out with `conversation inspect-work`.
97
+
95
98
  Project mode is derived from the persisted `backwardsCompatible` project setting:
96
99
 
97
100
  - `greenfield`: agent can make breaking/reset-style changes
package/dist/cjs/cli.cjs CHANGED
@@ -44,6 +44,7 @@ __export(cli_exports, {
44
44
  parseSetEnvArgs: () => parseSetEnvArgs,
45
45
  parseShellArgs: () => parseShellArgs,
46
46
  readDotenvFile: () => readDotenvFile,
47
+ renderConversationNodeResponse: () => renderConversationNodeResponse,
47
48
  renderConversationOverviewResponse: () => renderConversationOverviewResponse,
48
49
  renderConversationResponse: () => renderConversationResponse,
49
50
  renderConversationWorkResponse: () => renderConversationWorkResponse,
@@ -195,6 +196,11 @@ const SHARED_HELP_ENTRIES = [
195
196
  usage: "conversation overview <session-id>",
196
197
  description: "Read dialogue and thinking while replacing tool work with inspectable ranges."
197
198
  },
199
+ {
200
+ section: "sessions",
201
+ usage: "conversation inspect-node <session-id> <node-id>",
202
+ description: "Read one raw conversation node with previous, next, and containing work IDs."
203
+ },
198
204
  {
199
205
  section: "sessions",
200
206
  usage: "conversation inspect-work <session-id> <work-id> [--compact|--summary|--full]",
@@ -1404,6 +1410,24 @@ function renderConversationOverviewResponse(read) {
1404
1410
  return read.overviewText.endsWith("\n") ? read.overviewText : `${read.overviewText}
1405
1411
  `;
1406
1412
  }
1413
+ function renderConversationNodeResponse(read) {
1414
+ const rawNode = JSON.stringify(read.node, null, 2) ?? String(read.node);
1415
+ return [
1416
+ "# Conversation Node",
1417
+ "",
1418
+ `node: ${read.nodeId}`,
1419
+ `previous: ${read.previousNodeId ?? "(none)"}`,
1420
+ `next: ${read.nextNodeIds.join(", ") || "(none)"}`,
1421
+ `active next: ${read.activeNextNodeId ?? "(none)"}`,
1422
+ `active branch: ${read.onActiveBranch ? "yes" : "no"}`,
1423
+ `work: ${read.workId ?? "(none)"}`,
1424
+ "",
1425
+ "## Raw Node",
1426
+ "",
1427
+ rawNode,
1428
+ ""
1429
+ ].join("\n");
1430
+ }
1407
1431
  function renderConversationWorkResponse(read) {
1408
1432
  return read.workText.endsWith("\n") ? read.workText : `${read.workText}
1409
1433
  `;
@@ -1632,6 +1656,16 @@ ${result.message}
1632
1656
  write(read, renderConversationOverviewResponse(read));
1633
1657
  return;
1634
1658
  }
1659
+ if (first === "conversation" && second === "inspect-node") {
1660
+ if (args.length > 4) {
1661
+ throw new Error(`Unexpected conversation inspect-node argument: ${args[4]}`);
1662
+ }
1663
+ const sessionId = requireValue(args[2], "Missing session id");
1664
+ const nodeId = requireValue(args[3], "Missing node id");
1665
+ const read = await client.sessions.inspectConversationNode(sessionId, nodeId);
1666
+ write(read, renderConversationNodeResponse(read));
1667
+ return;
1668
+ }
1635
1669
  if (first === "conversation" && second === "inspect-work") {
1636
1670
  const sessionId = requireValue(args[2], "Missing session id");
1637
1671
  const workId = requireValue(args[3], "Missing work id");
@@ -2013,6 +2047,21 @@ function resolveCommandExecution(options, rest) {
2013
2047
  pluginArgs: ["conversation", "inspect-work", sessionId2, workId, ...remainingArgs]
2014
2048
  };
2015
2049
  }
2050
+ if (subcommand === "inspect-node") {
2051
+ const sessionId2 = options.session ?? commandArgs[1];
2052
+ if (!sessionId2) {
2053
+ throw new Error("Session id is required for `conversation inspect-node`");
2054
+ }
2055
+ const nodeId = options.session ? commandArgs[1] : commandArgs[2];
2056
+ if (!nodeId) {
2057
+ throw new Error("Node id is required for `conversation inspect-node`");
2058
+ }
2059
+ const remainingArgs = options.session ? commandArgs.slice(2) : commandArgs.slice(3);
2060
+ return {
2061
+ kind: "plugin",
2062
+ pluginArgs: ["conversation", "inspect-node", sessionId2, nodeId, ...remainingArgs]
2063
+ };
2064
+ }
2016
2065
  const sessionId = options.session;
2017
2066
  if (!sessionId) {
2018
2067
  throw new Error("--session/-s is required for `conversation`");
@@ -2245,6 +2294,7 @@ async function main(argv = process.argv.slice(2)) {
2245
2294
  parseSetEnvArgs,
2246
2295
  parseShellArgs,
2247
2296
  readDotenvFile,
2297
+ renderConversationNodeResponse,
2248
2298
  renderConversationOverviewResponse,
2249
2299
  renderConversationResponse,
2250
2300
  renderConversationWorkResponse,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "type": "commonjs"
5
5
  }
package/dist/mjs/cli.mjs CHANGED
@@ -139,6 +139,11 @@ const SHARED_HELP_ENTRIES = [
139
139
  usage: "conversation overview <session-id>",
140
140
  description: "Read dialogue and thinking while replacing tool work with inspectable ranges."
141
141
  },
142
+ {
143
+ section: "sessions",
144
+ usage: "conversation inspect-node <session-id> <node-id>",
145
+ description: "Read one raw conversation node with previous, next, and containing work IDs."
146
+ },
142
147
  {
143
148
  section: "sessions",
144
149
  usage: "conversation inspect-work <session-id> <work-id> [--compact|--summary|--full]",
@@ -1348,6 +1353,24 @@ function renderConversationOverviewResponse(read) {
1348
1353
  return read.overviewText.endsWith("\n") ? read.overviewText : `${read.overviewText}
1349
1354
  `;
1350
1355
  }
1356
+ function renderConversationNodeResponse(read) {
1357
+ const rawNode = JSON.stringify(read.node, null, 2) ?? String(read.node);
1358
+ return [
1359
+ "# Conversation Node",
1360
+ "",
1361
+ `node: ${read.nodeId}`,
1362
+ `previous: ${read.previousNodeId ?? "(none)"}`,
1363
+ `next: ${read.nextNodeIds.join(", ") || "(none)"}`,
1364
+ `active next: ${read.activeNextNodeId ?? "(none)"}`,
1365
+ `active branch: ${read.onActiveBranch ? "yes" : "no"}`,
1366
+ `work: ${read.workId ?? "(none)"}`,
1367
+ "",
1368
+ "## Raw Node",
1369
+ "",
1370
+ rawNode,
1371
+ ""
1372
+ ].join("\n");
1373
+ }
1351
1374
  function renderConversationWorkResponse(read) {
1352
1375
  return read.workText.endsWith("\n") ? read.workText : `${read.workText}
1353
1376
  `;
@@ -1576,6 +1599,16 @@ ${result.message}
1576
1599
  write(read, renderConversationOverviewResponse(read));
1577
1600
  return;
1578
1601
  }
1602
+ if (first === "conversation" && second === "inspect-node") {
1603
+ if (args.length > 4) {
1604
+ throw new Error(`Unexpected conversation inspect-node argument: ${args[4]}`);
1605
+ }
1606
+ const sessionId = requireValue(args[2], "Missing session id");
1607
+ const nodeId = requireValue(args[3], "Missing node id");
1608
+ const read = await client.sessions.inspectConversationNode(sessionId, nodeId);
1609
+ write(read, renderConversationNodeResponse(read));
1610
+ return;
1611
+ }
1579
1612
  if (first === "conversation" && second === "inspect-work") {
1580
1613
  const sessionId = requireValue(args[2], "Missing session id");
1581
1614
  const workId = requireValue(args[3], "Missing work id");
@@ -1957,6 +1990,21 @@ function resolveCommandExecution(options, rest) {
1957
1990
  pluginArgs: ["conversation", "inspect-work", sessionId2, workId, ...remainingArgs]
1958
1991
  };
1959
1992
  }
1993
+ if (subcommand === "inspect-node") {
1994
+ const sessionId2 = options.session ?? commandArgs[1];
1995
+ if (!sessionId2) {
1996
+ throw new Error("Session id is required for `conversation inspect-node`");
1997
+ }
1998
+ const nodeId = options.session ? commandArgs[1] : commandArgs[2];
1999
+ if (!nodeId) {
2000
+ throw new Error("Node id is required for `conversation inspect-node`");
2001
+ }
2002
+ const remainingArgs = options.session ? commandArgs.slice(2) : commandArgs.slice(3);
2003
+ return {
2004
+ kind: "plugin",
2005
+ pluginArgs: ["conversation", "inspect-node", sessionId2, nodeId, ...remainingArgs]
2006
+ };
2007
+ }
1960
2008
  const sessionId = options.session;
1961
2009
  if (!sessionId) {
1962
2010
  throw new Error("--session/-s is required for `conversation`");
@@ -2188,6 +2236,7 @@ export {
2188
2236
  parseSetEnvArgs,
2189
2237
  parseShellArgs,
2190
2238
  readDotenvFile,
2239
+ renderConversationNodeResponse,
2191
2240
  renderConversationOverviewResponse,
2192
2241
  renderConversationResponse,
2193
2242
  renderConversationWorkResponse,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "type": "module"
5
5
  }
@@ -1,4 +1,4 @@
1
- import { type R5dctlConversationRenderOptions, type R5dctlConversationResponse, type R5dctlConversationOverviewResponse, type R5dctlConversationWorkDetail, type R5dctlConversationWorkResponse, type R5dctlEnvData, type R5dctlProcessInspection, type R5dctlProcessListInput, type R5dctlProcessRun, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
1
+ import { type R5dctlConversationRenderOptions, type R5dctlConversationResponse, type R5dctlConversationNodeResponse, type R5dctlConversationOverviewResponse, type R5dctlConversationWorkDetail, type R5dctlConversationWorkResponse, type R5dctlEnvData, type R5dctlProcessInspection, type R5dctlProcessListInput, type R5dctlProcessRun, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
2
2
  export type GlobalOptions = {
3
3
  baseUrl?: string;
4
4
  json: boolean;
@@ -80,6 +80,7 @@ export declare function parseConversationRenderArgs(args: string[]): Conversatio
80
80
  export declare function renderConversationResponse(read: R5dctlConversationResponse): string;
81
81
  export declare function parseConversationWorkDetailArgs(args: string[]): R5dctlConversationWorkDetail;
82
82
  export declare function renderConversationOverviewResponse(read: R5dctlConversationOverviewResponse): string;
83
+ export declare function renderConversationNodeResponse(read: R5dctlConversationNodeResponse): string;
83
84
  export declare function renderConversationWorkResponse(read: R5dctlConversationWorkResponse): string;
84
85
  export declare function resolveCommandExecution(options: GlobalOptions, rest: string[]): CommandExecutionPlan;
85
86
  export declare function runR5dctlCli(argv: string[]): Promise<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
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.41",
29
+ "@ricsam/r5d-api": "^0.0.43",
30
30
  "dotenv": "^17",
31
31
  "ws": "^8.18.3"
32
32
  },