@ricsam/r5dctl 0.0.59 → 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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5dctl",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "type": "module"
5
5
  }
@@ -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 ChatMode, type ModelTier } from "@ricsam/r5d-api";
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;
@@ -29,19 +29,85 @@ type CommandExecutionPlan = {
29
29
  } | {
30
30
  kind: "shell";
31
31
  command?: string;
32
+ } | {
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;
32
42
  } | {
33
43
  kind: "cli-help";
34
44
  text: string;
35
45
  };
36
- type ConversationRenderOptions = Required<R5dctlConversationRenderOptions>;
46
+ type ConversationRenderOptions = Required<R5dctlConversationRenderOptions> & {
47
+ follow: boolean;
48
+ };
37
49
  export declare function getCliHelpText(): string;
38
50
  export declare function getR5dctlVersion(): string;
51
+ type R5dctlSessionStartCommand = {
52
+ kind: "start";
53
+ project: string;
54
+ worker: string;
55
+ model: ModelTier;
56
+ prompt: string;
57
+ follow: boolean;
58
+ includeTools: boolean;
59
+ } & ({
60
+ worktree: string;
61
+ newWorktree?: never;
62
+ source?: never;
63
+ } | {
64
+ worktree?: never;
65
+ newWorktree: string;
66
+ source: R5dctlWorktreeSource;
67
+ });
68
+ export type R5dctlSessionRunCommand = R5dctlSessionStartCommand | {
69
+ kind: "status";
70
+ sessionId: string;
71
+ } | {
72
+ kind: "prompt";
73
+ worker: string;
74
+ sessionId: string;
75
+ prompt: string;
76
+ mode: R5dctlSessionMode;
77
+ model: ModelTier;
78
+ } | {
79
+ kind: "stop";
80
+ sessionId: string;
81
+ };
82
+ export type R5dctlMergeCommand = {
83
+ kind: "merge";
84
+ project: string;
85
+ sourceWorktree: string;
86
+ worker?: string;
87
+ conflictMode: R5dctlMergeConflictMode;
88
+ } | {
89
+ kind: "finish";
90
+ project: string;
91
+ conflictWorktree: string;
92
+ worker: string;
93
+ summary?: string;
94
+ };
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;
39
97
  export declare function parseGlobalArgs(argv: string[]): {
40
98
  options: GlobalOptions;
41
99
  rest: string[];
42
100
  };
43
101
  export declare function writeConfig(configPath: string, config: R5dctlConfig): void;
44
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
+ };
45
111
  export type SetEnvOptions = {
46
112
  assignments: string[];
47
113
  fromEnvFile?: string;
@@ -56,6 +122,10 @@ export declare function parseEnvRequestResponseArgs(args: string[]): {
56
122
  envs?: string[];
57
123
  additionalContext?: string;
58
124
  };
125
+ export declare function parseAnswerEnvRequestCommandArgs(args: string[]): InteractiveExecutionContext & {
126
+ envs?: string[];
127
+ additionalContext?: string;
128
+ };
59
129
  export declare function parsePromptArgs(args: string[]): {
60
130
  mode: ChatMode;
61
131
  model: ModelTier;
@@ -134,8 +204,100 @@ export declare function parseGetEnvsArgs(args: string[]): {
134
204
  };
135
205
  export declare function renderEnvValues(data: R5dctlEnvData): string;
136
206
  export declare function getProjectEnvValue(data: R5dctlEnvData, name: string): string;
207
+ export type R5dctlCommandResponse = {
208
+ sessionId?: string;
209
+ sessionUrl?: string;
210
+ branchName?: string;
211
+ baselineCommit?: string | null;
212
+ workspaceHead?: string | null;
213
+ worker?: string;
214
+ status?: string;
215
+ runStatus?: unknown;
216
+ headCommit?: string | null;
217
+ headCommitError?: string;
218
+ promptDisposition?: string;
219
+ error?: string;
220
+ summary?: string;
221
+ diffSummary?: string;
222
+ attemptId?: string;
223
+ sourceWorktree?: string;
224
+ targetWorktree?: string;
225
+ commitHash?: string;
226
+ resolverSessionId?: string;
227
+ conflictWorktree?: string;
228
+ folderPath?: string;
229
+ conflictedFiles?: string[];
230
+ failureReason?: string;
231
+ message?: string;
232
+ };
233
+ export type R5dctlSessionRunClient = {
234
+ projects: {
235
+ sessions: {
236
+ start: (projectRef: string, input: R5dctlSessionStartInput) => Promise<R5dctlCommandResponse>;
237
+ };
238
+ };
239
+ sessions: {
240
+ status: (sessionId: string) => Promise<R5dctlCommandResponse>;
241
+ prompt: (sessionId: string, input: {
242
+ prompt: string;
243
+ worker: string;
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
+ };
263
+ };
264
+ };
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;
273
+ human: string;
274
+ };
275
+ export declare function dispatchSessionRunCommand(client: R5dctlSessionRunClient, command: R5dctlSessionRunCommand): Promise<R5dctlCommandDispatchResult>;
276
+ export declare function dispatchMergeCommand(client: R5dctlMergeClient, command: R5dctlMergeCommand): Promise<R5dctlCommandDispatchResult>;
137
277
  export declare function parseConversationRenderArgs(args: string[]): ConversationRenderOptions;
138
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>;
139
301
  export declare function parseConversationWorkDetailArgs(args: string[]): R5dctlConversationWorkDetail;
140
302
  export declare function renderConversationOverviewResponse(read: R5dctlConversationOverviewResponse): string;
141
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.59",
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.59",
29
+ "@ricsam/r5d-api": "^0.0.61",
30
30
  "dotenv": "^17",
31
31
  "qrcode": "^1.5.4",
32
32
  "ws": "^8.18.3"