@ricsam/r5dctl 0.0.60 → 0.0.61
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 +19 -10
- package/dist/cjs/cli.cjs +691 -235
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/cli.mjs +681 -230
- package/dist/mjs/package.json +1 -1
- package/dist/types/cli.d.ts +114 -48
- package/package.json +2 -2
package/dist/mjs/package.json
CHANGED
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R5dctlClient, 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 R5dctlProcessRun, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type
|
|
1
|
+
import { R5dctlClient, 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 R5dctlProcessRun, type R5dctlSessionEvent, type R5dctlSessionStartInput, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type R5dctlWorktreeSource, type R5dctlMergeConflictMode, type R5dctlSessionMode, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
|
|
2
2
|
export type GlobalOptions = {
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
json: boolean;
|
|
@@ -30,23 +30,42 @@ type CommandExecutionPlan = {
|
|
|
30
30
|
kind: "shell";
|
|
31
31
|
command?: string;
|
|
32
32
|
} | {
|
|
33
|
-
kind: "
|
|
34
|
-
command:
|
|
33
|
+
kind: "session-run";
|
|
34
|
+
command: R5dctlSessionRunCommand;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "merge";
|
|
37
|
+
command: R5dctlMergeCommand;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "conversation-follow";
|
|
40
|
+
sessionId: string;
|
|
41
|
+
renderOptions: ConversationRenderOptions;
|
|
35
42
|
} | {
|
|
36
43
|
kind: "cli-help";
|
|
37
44
|
text: string;
|
|
38
45
|
};
|
|
39
|
-
type ConversationRenderOptions = Required<R5dctlConversationRenderOptions
|
|
46
|
+
type ConversationRenderOptions = Required<R5dctlConversationRenderOptions> & {
|
|
47
|
+
follow: boolean;
|
|
48
|
+
};
|
|
40
49
|
export declare function getCliHelpText(): string;
|
|
41
50
|
export declare function getR5dctlVersion(): string;
|
|
42
|
-
|
|
51
|
+
type R5dctlSessionStartCommand = {
|
|
43
52
|
kind: "start";
|
|
44
53
|
project: string;
|
|
45
54
|
worker: string;
|
|
46
|
-
|
|
47
|
-
agentType: R5dctlAgentType;
|
|
55
|
+
model: ModelTier;
|
|
48
56
|
prompt: string;
|
|
57
|
+
follow: boolean;
|
|
58
|
+
includeTools: boolean;
|
|
59
|
+
} & ({
|
|
60
|
+
worktree: string;
|
|
61
|
+
newWorktree?: never;
|
|
62
|
+
source?: never;
|
|
49
63
|
} | {
|
|
64
|
+
worktree?: never;
|
|
65
|
+
newWorktree: string;
|
|
66
|
+
source: R5dctlWorktreeSource;
|
|
67
|
+
});
|
|
68
|
+
export type R5dctlSessionRunCommand = R5dctlSessionStartCommand | {
|
|
50
69
|
kind: "status";
|
|
51
70
|
sessionId: string;
|
|
52
71
|
} | {
|
|
@@ -54,26 +73,41 @@ export type R5dctlBranchAgentCommand = {
|
|
|
54
73
|
worker: string;
|
|
55
74
|
sessionId: string;
|
|
56
75
|
prompt: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
worker: string;
|
|
60
|
-
sessionId: string;
|
|
76
|
+
mode: R5dctlSessionMode;
|
|
77
|
+
model: ModelTier;
|
|
61
78
|
} | {
|
|
62
79
|
kind: "stop";
|
|
63
80
|
sessionId: string;
|
|
81
|
+
};
|
|
82
|
+
export type R5dctlMergeCommand = {
|
|
83
|
+
kind: "merge";
|
|
84
|
+
project: string;
|
|
85
|
+
sourceWorktree: string;
|
|
86
|
+
worker?: string;
|
|
87
|
+
conflictMode: R5dctlMergeConflictMode;
|
|
64
88
|
} | {
|
|
65
|
-
kind: "finish
|
|
89
|
+
kind: "finish";
|
|
90
|
+
project: string;
|
|
91
|
+
conflictWorktree: string;
|
|
66
92
|
worker: string;
|
|
67
|
-
|
|
68
|
-
summary: string;
|
|
93
|
+
summary?: string;
|
|
69
94
|
};
|
|
70
|
-
export declare function
|
|
95
|
+
export declare function parseSessionRunCommand(options: Pick<GlobalOptions, "project" | "branch" | "session">, args: string[]): R5dctlSessionRunCommand;
|
|
96
|
+
export declare function parseMergeCommand(options: Pick<GlobalOptions, "project" | "branch" | "session">, args: string[]): R5dctlMergeCommand;
|
|
71
97
|
export declare function parseGlobalArgs(argv: string[]): {
|
|
72
98
|
options: GlobalOptions;
|
|
73
99
|
rest: string[];
|
|
74
100
|
};
|
|
75
101
|
export declare function writeConfig(configPath: string, config: R5dctlConfig): void;
|
|
76
102
|
export declare function parseAnswerFlags(args: string[]): string[];
|
|
103
|
+
type InteractiveExecutionContext = {
|
|
104
|
+
worker: string;
|
|
105
|
+
mode: ChatMode;
|
|
106
|
+
model: ModelTier;
|
|
107
|
+
};
|
|
108
|
+
export declare function parseAnswerQuestionsCommandArgs(args: string[]): InteractiveExecutionContext & {
|
|
109
|
+
answers: string[];
|
|
110
|
+
};
|
|
77
111
|
export type SetEnvOptions = {
|
|
78
112
|
assignments: string[];
|
|
79
113
|
fromEnvFile?: string;
|
|
@@ -88,6 +122,10 @@ export declare function parseEnvRequestResponseArgs(args: string[]): {
|
|
|
88
122
|
envs?: string[];
|
|
89
123
|
additionalContext?: string;
|
|
90
124
|
};
|
|
125
|
+
export declare function parseAnswerEnvRequestCommandArgs(args: string[]): InteractiveExecutionContext & {
|
|
126
|
+
envs?: string[];
|
|
127
|
+
additionalContext?: string;
|
|
128
|
+
};
|
|
91
129
|
export declare function parsePromptArgs(args: string[]): {
|
|
92
130
|
mode: ChatMode;
|
|
93
131
|
model: ModelTier;
|
|
@@ -166,11 +204,10 @@ export declare function parseGetEnvsArgs(args: string[]): {
|
|
|
166
204
|
};
|
|
167
205
|
export declare function renderEnvValues(data: R5dctlEnvData): string;
|
|
168
206
|
export declare function getProjectEnvValue(data: R5dctlEnvData, name: string): string;
|
|
169
|
-
export type
|
|
207
|
+
export type R5dctlCommandResponse = {
|
|
170
208
|
sessionId?: string;
|
|
171
209
|
sessionUrl?: string;
|
|
172
210
|
branchName?: string;
|
|
173
|
-
source?: R5dctlAgentSource;
|
|
174
211
|
baselineCommit?: string | null;
|
|
175
212
|
workspaceHead?: string | null;
|
|
176
213
|
worker?: string;
|
|
@@ -182,56 +219,85 @@ export type R5dctlBranchAgentResponse = {
|
|
|
182
219
|
error?: string;
|
|
183
220
|
summary?: string;
|
|
184
221
|
diffSummary?: string;
|
|
185
|
-
merge?: unknown;
|
|
186
222
|
attemptId?: string;
|
|
187
|
-
|
|
188
|
-
|
|
223
|
+
sourceWorktree?: string;
|
|
224
|
+
targetWorktree?: string;
|
|
189
225
|
commitHash?: string;
|
|
190
226
|
resolverSessionId?: string;
|
|
191
|
-
|
|
227
|
+
conflictWorktree?: string;
|
|
192
228
|
folderPath?: string;
|
|
193
229
|
conflictedFiles?: string[];
|
|
194
230
|
failureReason?: string;
|
|
195
231
|
message?: string;
|
|
196
232
|
};
|
|
197
|
-
export type
|
|
233
|
+
export type R5dctlSessionRunClient = {
|
|
198
234
|
projects: {
|
|
199
|
-
|
|
200
|
-
start: (projectRef: string, input:
|
|
201
|
-
source: R5dctlAgentSource;
|
|
202
|
-
agentType: R5dctlAgentType;
|
|
203
|
-
prompt: string;
|
|
204
|
-
worker: string;
|
|
205
|
-
requestId: string;
|
|
206
|
-
}) => Promise<R5dctlBranchAgentResponse>;
|
|
235
|
+
sessions: {
|
|
236
|
+
start: (projectRef: string, input: R5dctlSessionStartInput) => Promise<R5dctlCommandResponse>;
|
|
207
237
|
};
|
|
208
238
|
};
|
|
209
|
-
|
|
210
|
-
status: (sessionId: string) => Promise<
|
|
211
|
-
|
|
239
|
+
sessions: {
|
|
240
|
+
status: (sessionId: string) => Promise<R5dctlCommandResponse>;
|
|
241
|
+
prompt: (sessionId: string, input: {
|
|
212
242
|
prompt: string;
|
|
213
243
|
worker: string;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}) => Promise<
|
|
218
|
-
stop: (sessionId: string) => Promise<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
244
|
+
mode: R5dctlSessionMode;
|
|
245
|
+
model: ModelTier;
|
|
246
|
+
requestId: string;
|
|
247
|
+
}) => Promise<R5dctlCommandResponse>;
|
|
248
|
+
stop: (sessionId: string) => Promise<R5dctlCommandResponse>;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
export type R5dctlMergeClient = {
|
|
252
|
+
projects: {
|
|
253
|
+
worktrees: {
|
|
254
|
+
merge: (projectRef: string, sourceWorktree: string, input: {
|
|
255
|
+
worker?: string;
|
|
256
|
+
conflictMode: R5dctlMergeConflictMode;
|
|
257
|
+
}) => Promise<R5dctlCommandResponse>;
|
|
258
|
+
finishMerge: (projectRef: string, conflictWorktree: string, input: {
|
|
259
|
+
worker: string;
|
|
260
|
+
summary?: string;
|
|
261
|
+
}) => Promise<R5dctlCommandResponse>;
|
|
262
|
+
};
|
|
223
263
|
};
|
|
224
264
|
};
|
|
225
|
-
export declare function
|
|
226
|
-
export declare function
|
|
227
|
-
export declare function
|
|
228
|
-
|
|
229
|
-
|
|
265
|
+
export declare function renderSessionRunStart(session: R5dctlCommandResponse): string;
|
|
266
|
+
export declare function renderSessionRunStatus(session: R5dctlCommandResponse): string;
|
|
267
|
+
export declare function renderWorktreeMerge(result: R5dctlCommandResponse, input: {
|
|
268
|
+
project: string;
|
|
269
|
+
worker?: string;
|
|
270
|
+
}): string;
|
|
271
|
+
export type R5dctlCommandDispatchResult = {
|
|
272
|
+
data: R5dctlCommandResponse;
|
|
230
273
|
human: string;
|
|
231
274
|
};
|
|
232
|
-
export declare function
|
|
275
|
+
export declare function dispatchSessionRunCommand(client: R5dctlSessionRunClient, command: R5dctlSessionRunCommand): Promise<R5dctlCommandDispatchResult>;
|
|
276
|
+
export declare function dispatchMergeCommand(client: R5dctlMergeClient, command: R5dctlMergeCommand): Promise<R5dctlCommandDispatchResult>;
|
|
233
277
|
export declare function parseConversationRenderArgs(args: string[]): ConversationRenderOptions;
|
|
234
278
|
export declare function renderConversationResponse(read: R5dctlConversationResponse): string;
|
|
279
|
+
type R5dctlFollowClient = {
|
|
280
|
+
sessions: {
|
|
281
|
+
conversation: (sessionId: string, input?: R5dctlConversationRenderOptions) => Promise<R5dctlConversationResponse>;
|
|
282
|
+
status: (sessionId: string) => Promise<R5dctlCommandResponse>;
|
|
283
|
+
events: (sessionId: string, input?: {
|
|
284
|
+
signal?: AbortSignal;
|
|
285
|
+
}) => AsyncIterable<R5dctlSessionEvent>;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
export type R5dctlFollowOptions = {
|
|
289
|
+
json: boolean;
|
|
290
|
+
includeTools: boolean;
|
|
291
|
+
renderOptions?: R5dctlConversationRenderOptions;
|
|
292
|
+
initialConversation?: R5dctlConversationResponse;
|
|
293
|
+
printInitialTranscript?: boolean;
|
|
294
|
+
signal?: AbortSignal;
|
|
295
|
+
stdout?: (text: string) => void;
|
|
296
|
+
stderr?: (text: string) => void;
|
|
297
|
+
reconnectDelayMs?: number;
|
|
298
|
+
maxReconnects?: number;
|
|
299
|
+
};
|
|
300
|
+
export declare function followR5dctlSession(client: R5dctlFollowClient, sessionId: string, options: R5dctlFollowOptions): Promise<number>;
|
|
235
301
|
export declare function parseConversationWorkDetailArgs(args: string[]): R5dctlConversationWorkDetail;
|
|
236
302
|
export declare function renderConversationOverviewResponse(read: R5dctlConversationOverviewResponse): string;
|
|
237
303
|
export declare function renderConversationNodeResponse(read: R5dctlConversationNodeResponse): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5dctl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
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.61",
|
|
30
30
|
"dotenv": "^17",
|
|
31
31
|
"qrcode": "^1.5.4",
|
|
32
32
|
"ws": "^8.18.3"
|