@ricsam/r5dctl 0.0.101 → 0.0.104
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 +18 -1
- package/dist/cjs/cli.cjs +374 -25
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/cli.mjs +362 -25
- package/dist/mjs/package.json +1 -1
- package/dist/types/cli.d.ts +53 -1
- package/package.json +2 -2
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { 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 R5dctlProcessRun, type R5dctlSessionEvent, type R5dctlSessionStartInput, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, 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 R5dctlSessionEvent, type R5dctlSessionStartInput, type R5dctlWorkspaceStatus, type R5dctlWorkspaceSyncResult, type R5dctlWorkingTreeMode, type R5dctlWorktreeSource, type R5dctlSessionMode, type ChatMode, type ModelTier } from "@ricsam/r5d-api";
|
|
2
2
|
export type GlobalOptions = {
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
json: boolean;
|
|
@@ -53,14 +53,17 @@ type R5dctlSessionStartCommand = {
|
|
|
53
53
|
prompt: string;
|
|
54
54
|
follow: boolean;
|
|
55
55
|
includeTools: boolean;
|
|
56
|
+
parentSessionId?: string;
|
|
56
57
|
} & ({
|
|
57
58
|
worktree: string;
|
|
58
59
|
newWorktree?: never;
|
|
59
60
|
source?: never;
|
|
61
|
+
workingTree?: never;
|
|
60
62
|
} | {
|
|
61
63
|
worktree?: never;
|
|
62
64
|
newWorktree: string;
|
|
63
65
|
source: R5dctlWorktreeSource;
|
|
66
|
+
workingTree: R5dctlWorkingTreeMode;
|
|
64
67
|
});
|
|
65
68
|
export type R5dctlSessionRunCommand = R5dctlSessionStartCommand | {
|
|
66
69
|
kind: "status";
|
|
@@ -76,7 +79,42 @@ export type R5dctlSessionRunCommand = R5dctlSessionStartCommand | {
|
|
|
76
79
|
kind: "stop";
|
|
77
80
|
sessionId: string;
|
|
78
81
|
};
|
|
82
|
+
export type R5dctlBranchCreateArgs = {
|
|
83
|
+
source: R5dctlWorktreeSource;
|
|
84
|
+
workingTree: R5dctlWorkingTreeMode;
|
|
85
|
+
worker?: string;
|
|
86
|
+
};
|
|
87
|
+
export declare function parseBranchCreateArgs(args: string[]): R5dctlBranchCreateArgs;
|
|
88
|
+
export declare function parseBranchDeleteArgs(args: string[]): {
|
|
89
|
+
confirmed: boolean;
|
|
90
|
+
};
|
|
91
|
+
/** An older server strips unknown routes and answers with this generic 404; a route's own not-found carries a specific message. */
|
|
92
|
+
export declare function isUnsupportedServerRoute(error: unknown): error is R5dctlApiError;
|
|
93
|
+
export declare function createBranchThroughPlatform(client: R5dctlClient, projectRef: string, input: {
|
|
94
|
+
branchName: string;
|
|
95
|
+
} & R5dctlBranchCreateArgs): Promise<R5dctlBranchOperation>;
|
|
96
|
+
export type R5dctlBranchDeletionOutcome = {
|
|
97
|
+
kind: "preview";
|
|
98
|
+
branch: R5dctlBranchDescription;
|
|
99
|
+
} | {
|
|
100
|
+
kind: "deleted";
|
|
101
|
+
result: R5dctlBranchDeleteResponse;
|
|
102
|
+
};
|
|
103
|
+
export declare function deleteBranchThroughPlatform(client: R5dctlClient, projectRef: string, branchName: string, options: {
|
|
104
|
+
confirmed: boolean;
|
|
105
|
+
}): Promise<R5dctlBranchDeletionOutcome>;
|
|
106
|
+
export declare function renderBranchDeletionPreview(branch: R5dctlBranchDescription): string;
|
|
107
|
+
export declare function branchDeletionConfirmationMessage(branch: R5dctlBranchDescription): string;
|
|
108
|
+
export declare function renderBranchDeletion(result: R5dctlBranchDeleteResponse): string;
|
|
109
|
+
/** Operation facts only: no commit hash, because a hash is stale as soon as the branch commits. */
|
|
110
|
+
export declare function renderBranchOperation(operation: R5dctlBranchOperation, projectRef: string): string;
|
|
79
111
|
export declare function parseSessionRunCommand(options: Pick<GlobalOptions, "project" | "branch" | "session">, args: string[]): R5dctlSessionRunCommand;
|
|
112
|
+
export type R5dctlSessionProcessLogArgs = {
|
|
113
|
+
runId: string;
|
|
114
|
+
tail?: number;
|
|
115
|
+
grep?: string;
|
|
116
|
+
};
|
|
117
|
+
export declare function parseSessionProcessLogArgs(args: string[]): R5dctlSessionProcessLogArgs;
|
|
80
118
|
export declare function parseGlobalArgs(argv: string[]): {
|
|
81
119
|
options: GlobalOptions;
|
|
82
120
|
rest: string[];
|
|
@@ -137,6 +175,7 @@ export declare function advanceTransientDevicePollBackoff(intervalMs: number, tr
|
|
|
137
175
|
};
|
|
138
176
|
export declare function handleAuthLogin(client: R5dctlClient, options: GlobalOptions, commandArgs: string[], config: R5dctlConfig): Promise<void>;
|
|
139
177
|
export declare function renderWorkspaceStatus(status: R5dctlWorkspaceStatus): string;
|
|
178
|
+
export declare function renderBranchList(branches: R5dctlBranch[]): string;
|
|
140
179
|
export declare function renderWorkspaceSync(result: R5dctlWorkspaceSyncResult): string;
|
|
141
180
|
export type K8sUsageSummary = {
|
|
142
181
|
cpuMinNanoCores: number | null;
|
|
@@ -176,6 +215,11 @@ export declare function renderK8sUsageReport(report: K8sUsageReport): string;
|
|
|
176
215
|
export declare function formatProcessAge(startedAt: string, nowMs?: number): string;
|
|
177
216
|
export declare function renderProcessList(processes: R5dctlProcessRun[], nowMs?: number): string;
|
|
178
217
|
export declare function renderProcessHistory(processes: R5dctlProcessRun[], nowMs?: number): string;
|
|
218
|
+
/** Streams go to stdout under `==> name <==` headers; the selection summary is returned separately for stderr. */
|
|
219
|
+
export declare function renderProcessLog(log: R5dctlProcessLog): {
|
|
220
|
+
text: string;
|
|
221
|
+
summary: string;
|
|
222
|
+
};
|
|
179
223
|
export declare function renderProcessInspection(process: R5dctlProcessInspection): string;
|
|
180
224
|
export type EnvSummaryData = Record<string, {
|
|
181
225
|
description: string;
|
|
@@ -191,11 +235,19 @@ export type R5dctlCommandResponse = {
|
|
|
191
235
|
sessionId?: string;
|
|
192
236
|
sessionUrl?: string;
|
|
193
237
|
branchName?: string;
|
|
238
|
+
/** Launch-time worktree origin of a new-worktree run; absent or null on an existing worktree. */
|
|
239
|
+
sourceBranch?: string | null;
|
|
240
|
+
workingTree?: string | null;
|
|
241
|
+
/** Launch-time hashes: present in --json output but never rendered. */
|
|
194
242
|
baselineCommit?: string | null;
|
|
195
243
|
workspaceHead?: string | null;
|
|
196
244
|
worker?: string;
|
|
197
245
|
status?: string;
|
|
198
246
|
runStatus?: unknown;
|
|
247
|
+
/** Worker queue state while a new worktree provisions; older servers and workers omit it. */
|
|
248
|
+
provisioningQueuePosition?: number;
|
|
249
|
+
provisioningQueuedAt?: string;
|
|
250
|
+
/** Legacy fields older servers still send; never rendered because a reported hash goes stale. */
|
|
199
251
|
headCommit?: string | null;
|
|
200
252
|
headCommitError?: string;
|
|
201
253
|
promptDisposition?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5dctl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.104",
|
|
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.104",
|
|
30
30
|
"dotenv": "^17",
|
|
31
31
|
"qrcode": "^1.5.4",
|
|
32
32
|
"ws": "^8.18.3"
|