@ricsam/r5dctl 0.0.16 → 0.0.18
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 +6 -1
- package/dist/cjs/cli.cjs +28 -9
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/cli.mjs +28 -9
- package/dist/mjs/package.json +1 -1
- package/dist/types/cli.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,13 +55,18 @@ r5dctl describe session <session-id>
|
|
|
55
55
|
r5dctl -s <session-id> update session --name "Renamed session"
|
|
56
56
|
r5dctl -s <session-id> delete session
|
|
57
57
|
|
|
58
|
-
r5dctl -s <session-id> conversation #
|
|
58
|
+
r5dctl -s <session-id> conversation # human-readable agent request transcript
|
|
59
|
+
r5dctl -s <session-id> conversation --raw # raw JSON message/tool parts
|
|
60
|
+
r5dctl -s <session-id> conversation --tools # include provider-shaped tool definitions
|
|
61
|
+
r5dctl -s <session-id> conversation --raw --tools # exact raw agent request transcript
|
|
59
62
|
r5dctl -s <session-id> prompt --mode plan --model max "..."
|
|
60
63
|
r5dctl -s <session-id> answer-questions -a1 "Recipe Collection" -a2 "Both Manual & AI"
|
|
61
64
|
r5dctl -s <session-id> apply-required-envs -e backend/KEY=value -e frontend/KEY=value
|
|
62
65
|
|
|
63
66
|
```
|
|
64
67
|
|
|
68
|
+
Conversation output is human-readable by default. `--raw` keeps the transcript layout but renders structured message and tool parts as JSON, while `--tools` includes the provider-shaped tool definitions. The global `--json` flag remains separate and prints the complete API response envelope.
|
|
69
|
+
|
|
65
70
|
Project mode is derived from the persisted `backwardsCompatible` project setting:
|
|
66
71
|
|
|
67
72
|
- `greenfield`: agent can make breaking/reset-style changes
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -116,7 +116,11 @@ const SHARED_HELP_ENTRIES = [
|
|
|
116
116
|
{ section: "sessions", usage: "describe session <session-id>", description: "Show session details." },
|
|
117
117
|
{ section: "sessions", usage: "-s <session-id> update session --name <name>", description: "Rename a session or clear its name." },
|
|
118
118
|
{ section: "sessions", usage: "-s <session-id> delete session", description: "Delete a session." },
|
|
119
|
-
{
|
|
119
|
+
{
|
|
120
|
+
section: "sessions",
|
|
121
|
+
usage: "-s <session-id> conversation [--raw] [--tools]",
|
|
122
|
+
description: "Read the agent request transcript in human-readable form."
|
|
123
|
+
},
|
|
120
124
|
{
|
|
121
125
|
section: "sessions",
|
|
122
126
|
usage: '-s <session-id> prompt --mode <mode> --model <tier> "<message>"',
|
|
@@ -205,8 +209,16 @@ function readInstalledPackageVersion(packageJsonPath) {
|
|
|
205
209
|
}
|
|
206
210
|
return null;
|
|
207
211
|
}
|
|
212
|
+
function resolveEntrypointPath(entrypoint) {
|
|
213
|
+
const resolved = import_node_path.default.resolve(entrypoint);
|
|
214
|
+
try {
|
|
215
|
+
return import_node_fs.default.realpathSync.native(resolved);
|
|
216
|
+
} catch {
|
|
217
|
+
return resolved;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
208
220
|
function getR5dctlVersion() {
|
|
209
|
-
const entrypoint = process.argv[1] ?
|
|
221
|
+
const entrypoint = process.argv[1] ? resolveEntrypointPath(process.argv[1]) : null;
|
|
210
222
|
let current = entrypoint ? import_node_path.default.dirname(entrypoint) : process.cwd();
|
|
211
223
|
for (let index = 0; index < 12; index += 1) {
|
|
212
224
|
const packageVersion = readInstalledPackageVersion(import_node_path.default.join(current, "package.json"));
|
|
@@ -838,15 +850,21 @@ function parseSessionUpdateArgs(args) {
|
|
|
838
850
|
return input;
|
|
839
851
|
}
|
|
840
852
|
function parseConversationRenderArgs(args) {
|
|
841
|
-
const options = {};
|
|
842
|
-
for (
|
|
843
|
-
|
|
853
|
+
const options = { format: "human", includeTools: false };
|
|
854
|
+
for (const arg of args) {
|
|
855
|
+
if (arg === "--raw") {
|
|
856
|
+
options.format = "raw";
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
if (arg === "--tools") {
|
|
860
|
+
options.includeTools = true;
|
|
861
|
+
continue;
|
|
862
|
+
}
|
|
844
863
|
throw new Error(`Unknown conversation argument: ${arg}`);
|
|
845
864
|
}
|
|
846
865
|
return options;
|
|
847
866
|
}
|
|
848
|
-
function renderConversationResponse(read
|
|
849
|
-
void options;
|
|
867
|
+
function renderConversationResponse(read) {
|
|
850
868
|
return read.agentText.endsWith("\n") ? read.agentText : `${read.agentText}
|
|
851
869
|
`;
|
|
852
870
|
}
|
|
@@ -1011,8 +1029,9 @@ ${result.message}
|
|
|
1011
1029
|
}
|
|
1012
1030
|
if (first === "sessions" && second === "conversation" || first === "conversation") {
|
|
1013
1031
|
const offset = first === "conversation" ? 1 : 2;
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1032
|
+
const renderOptions = parseConversationRenderArgs(args.slice(offset + 1));
|
|
1033
|
+
const read = await client.sessions.conversation(requireValue(args[offset], "Missing session id"), renderOptions);
|
|
1034
|
+
write(read, renderConversationResponse(read));
|
|
1016
1035
|
return;
|
|
1017
1036
|
}
|
|
1018
1037
|
if (first === "sessions" && second === "prompt" || first === "prompt") {
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/cli.mjs
CHANGED
|
@@ -76,7 +76,11 @@ const SHARED_HELP_ENTRIES = [
|
|
|
76
76
|
{ section: "sessions", usage: "describe session <session-id>", description: "Show session details." },
|
|
77
77
|
{ section: "sessions", usage: "-s <session-id> update session --name <name>", description: "Rename a session or clear its name." },
|
|
78
78
|
{ section: "sessions", usage: "-s <session-id> delete session", description: "Delete a session." },
|
|
79
|
-
{
|
|
79
|
+
{
|
|
80
|
+
section: "sessions",
|
|
81
|
+
usage: "-s <session-id> conversation [--raw] [--tools]",
|
|
82
|
+
description: "Read the agent request transcript in human-readable form."
|
|
83
|
+
},
|
|
80
84
|
{
|
|
81
85
|
section: "sessions",
|
|
82
86
|
usage: '-s <session-id> prompt --mode <mode> --model <tier> "<message>"',
|
|
@@ -165,8 +169,16 @@ function readInstalledPackageVersion(packageJsonPath) {
|
|
|
165
169
|
}
|
|
166
170
|
return null;
|
|
167
171
|
}
|
|
172
|
+
function resolveEntrypointPath(entrypoint) {
|
|
173
|
+
const resolved = path.resolve(entrypoint);
|
|
174
|
+
try {
|
|
175
|
+
return fs.realpathSync.native(resolved);
|
|
176
|
+
} catch {
|
|
177
|
+
return resolved;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
168
180
|
function getR5dctlVersion() {
|
|
169
|
-
const entrypoint = process.argv[1] ?
|
|
181
|
+
const entrypoint = process.argv[1] ? resolveEntrypointPath(process.argv[1]) : null;
|
|
170
182
|
let current = entrypoint ? path.dirname(entrypoint) : process.cwd();
|
|
171
183
|
for (let index = 0; index < 12; index += 1) {
|
|
172
184
|
const packageVersion = readInstalledPackageVersion(path.join(current, "package.json"));
|
|
@@ -798,15 +810,21 @@ function parseSessionUpdateArgs(args) {
|
|
|
798
810
|
return input;
|
|
799
811
|
}
|
|
800
812
|
function parseConversationRenderArgs(args) {
|
|
801
|
-
const options = {};
|
|
802
|
-
for (
|
|
803
|
-
|
|
813
|
+
const options = { format: "human", includeTools: false };
|
|
814
|
+
for (const arg of args) {
|
|
815
|
+
if (arg === "--raw") {
|
|
816
|
+
options.format = "raw";
|
|
817
|
+
continue;
|
|
818
|
+
}
|
|
819
|
+
if (arg === "--tools") {
|
|
820
|
+
options.includeTools = true;
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
804
823
|
throw new Error(`Unknown conversation argument: ${arg}`);
|
|
805
824
|
}
|
|
806
825
|
return options;
|
|
807
826
|
}
|
|
808
|
-
function renderConversationResponse(read
|
|
809
|
-
void options;
|
|
827
|
+
function renderConversationResponse(read) {
|
|
810
828
|
return read.agentText.endsWith("\n") ? read.agentText : `${read.agentText}
|
|
811
829
|
`;
|
|
812
830
|
}
|
|
@@ -971,8 +989,9 @@ ${result.message}
|
|
|
971
989
|
}
|
|
972
990
|
if (first === "sessions" && second === "conversation" || first === "conversation") {
|
|
973
991
|
const offset = first === "conversation" ? 1 : 2;
|
|
974
|
-
const
|
|
975
|
-
|
|
992
|
+
const renderOptions = parseConversationRenderArgs(args.slice(offset + 1));
|
|
993
|
+
const read = await client.sessions.conversation(requireValue(args[offset], "Missing session id"), renderOptions);
|
|
994
|
+
write(read, renderConversationResponse(read));
|
|
976
995
|
return;
|
|
977
996
|
}
|
|
978
997
|
if (first === "sessions" && second === "prompt" || first === "prompt") {
|
package/dist/mjs/package.json
CHANGED
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type R5dctlConversationResponse, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
|
|
1
|
+
import { type R5dctlConversationRenderOptions, type R5dctlConversationResponse, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
|
|
2
2
|
export type GlobalOptions = {
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
json: boolean;
|
|
@@ -30,7 +30,7 @@ type CommandExecutionPlan = {
|
|
|
30
30
|
kind: "cli-help";
|
|
31
31
|
text: string;
|
|
32
32
|
};
|
|
33
|
-
type ConversationRenderOptions =
|
|
33
|
+
type ConversationRenderOptions = Required<R5dctlConversationRenderOptions>;
|
|
34
34
|
export declare function getCliHelpText(): string;
|
|
35
35
|
export declare function getR5dctlVersion(): string;
|
|
36
36
|
export declare function parseGlobalArgs(argv: string[]): {
|
|
@@ -45,7 +45,7 @@ export declare function parsePromptArgs(args: string[]): {
|
|
|
45
45
|
message: string;
|
|
46
46
|
};
|
|
47
47
|
export declare function parseConversationRenderArgs(args: string[]): ConversationRenderOptions;
|
|
48
|
-
export declare function renderConversationResponse(read: R5dctlConversationResponse
|
|
48
|
+
export declare function renderConversationResponse(read: R5dctlConversationResponse): string;
|
|
49
49
|
export declare function resolveCommandExecution(options: GlobalOptions, rest: string[]): CommandExecutionPlan;
|
|
50
50
|
export declare function runR5dctlCli(argv: string[]): Promise<number>;
|
|
51
51
|
export declare function main(argv?: string[]): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5dctl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
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.18"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|