@rudderhq/cli 0.2.1 → 0.2.2
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 +0 -2
- package/dist/index.js +229 -31
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,8 +8,6 @@ Rudder began from a fork of an early version of Paperclip. That gave us a practi
|
|
|
8
8
|
|
|
9
9
|
Rudder is built for the moment when agent work stops looking like a single prompt and starts looking like a real team.
|
|
10
10
|
|
|
11
|
-
Current status: V1 is under active development. The current north-star metric is the weekly count of real agent-work loops completed end-to-end through Rudder.
|
|
12
|
-
|
|
13
11
|
## The Design Idea
|
|
14
12
|
|
|
15
13
|
Rudder is shaped by a simple belief: the most useful way to work with agents is closer to the way humans coordinate with each other.
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,7 @@ var init_constants = __esm({
|
|
|
117
117
|
CHAT_MESSAGE_ROLES = ["user", "assistant", "system"];
|
|
118
118
|
CHAT_MESSAGE_KINDS = [
|
|
119
119
|
"message",
|
|
120
|
+
"ask_user",
|
|
120
121
|
"issue_proposal",
|
|
121
122
|
"operation_proposal",
|
|
122
123
|
"system_event"
|
|
@@ -579,7 +580,7 @@ var init_resource = __esm({
|
|
|
579
580
|
|
|
580
581
|
// ../packages/shared/src/validators/chat.ts
|
|
581
582
|
import { z as z5 } from "zod";
|
|
582
|
-
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, addChatMessageSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema;
|
|
583
|
+
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, addChatMessageSchema, chatRichReferenceDisplaySchema, chatIssueIdentifierSchema, chatAskUserIdentifierSchema, chatAskUserOptionSchema, chatAskUserQuestionSchema, chatAskUserRequestSchema, chatIssueRichReferenceSchema, chatIssueCommentRichReferenceSchema, chatRichReferenceSchema, chatRichReferencesSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema;
|
|
583
584
|
var init_chat = __esm({
|
|
584
585
|
"../packages/shared/src/validators/chat.ts"() {
|
|
585
586
|
"use strict";
|
|
@@ -616,6 +617,47 @@ var init_chat = __esm({
|
|
|
616
617
|
body: z5.string().trim().min(1).max(2e4),
|
|
617
618
|
editUserMessageId: z5.string().uuid().optional().nullable()
|
|
618
619
|
});
|
|
620
|
+
chatRichReferenceDisplaySchema = z5.enum(["card", "inline"]);
|
|
621
|
+
chatIssueIdentifierSchema = z5.string().trim().min(1).max(64).regex(/^[A-Z0-9][A-Z0-9-]*$/i);
|
|
622
|
+
chatAskUserIdentifierSchema = z5.string().trim().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/);
|
|
623
|
+
chatAskUserOptionSchema = z5.object({
|
|
624
|
+
id: chatAskUserIdentifierSchema,
|
|
625
|
+
label: z5.string().trim().min(1).max(80),
|
|
626
|
+
description: z5.string().trim().min(1).max(220).optional(),
|
|
627
|
+
recommended: z5.boolean().optional()
|
|
628
|
+
});
|
|
629
|
+
chatAskUserQuestionSchema = z5.object({
|
|
630
|
+
id: chatAskUserIdentifierSchema,
|
|
631
|
+
header: z5.string().trim().min(1).max(32).optional(),
|
|
632
|
+
question: z5.string().trim().min(1).max(240),
|
|
633
|
+
options: z5.array(chatAskUserOptionSchema).min(2).max(3),
|
|
634
|
+
allowFreeform: z5.boolean().optional()
|
|
635
|
+
});
|
|
636
|
+
chatAskUserRequestSchema = z5.object({
|
|
637
|
+
questions: z5.array(chatAskUserQuestionSchema).min(1).max(3)
|
|
638
|
+
});
|
|
639
|
+
chatIssueRichReferenceSchema = z5.object({
|
|
640
|
+
type: z5.literal("issue"),
|
|
641
|
+
issueId: z5.string().uuid().optional(),
|
|
642
|
+
identifier: chatIssueIdentifierSchema.optional(),
|
|
643
|
+
display: chatRichReferenceDisplaySchema.optional()
|
|
644
|
+
}).refine((value) => Boolean(value.issueId || value.identifier), {
|
|
645
|
+
message: "issueId or identifier is required"
|
|
646
|
+
});
|
|
647
|
+
chatIssueCommentRichReferenceSchema = z5.object({
|
|
648
|
+
type: z5.literal("issue_comment"),
|
|
649
|
+
issueId: z5.string().uuid().optional(),
|
|
650
|
+
identifier: chatIssueIdentifierSchema.optional(),
|
|
651
|
+
commentId: z5.string().uuid(),
|
|
652
|
+
display: chatRichReferenceDisplaySchema.optional()
|
|
653
|
+
}).refine((value) => Boolean(value.issueId || value.identifier), {
|
|
654
|
+
message: "issueId or identifier is required"
|
|
655
|
+
});
|
|
656
|
+
chatRichReferenceSchema = z5.union([
|
|
657
|
+
chatIssueRichReferenceSchema,
|
|
658
|
+
chatIssueCommentRichReferenceSchema
|
|
659
|
+
]);
|
|
660
|
+
chatRichReferencesSchema = z5.array(chatRichReferenceSchema).max(5);
|
|
619
661
|
createChatAttachmentMetadataSchema = z5.object({
|
|
620
662
|
messageId: z5.string().uuid()
|
|
621
663
|
});
|
|
@@ -2491,7 +2533,10 @@ var init_organization_skill_reference = __esm({
|
|
|
2491
2533
|
"para-memory-files",
|
|
2492
2534
|
"rudder",
|
|
2493
2535
|
"rudder-create-agent",
|
|
2494
|
-
"rudder-create-plugin"
|
|
2536
|
+
"rudder-create-plugin",
|
|
2537
|
+
"skill-creator",
|
|
2538
|
+
"skill-optimizer",
|
|
2539
|
+
"conversation-to-skill"
|
|
2495
2540
|
];
|
|
2496
2541
|
RUDDER_BUNDLED_SKILL_KEYS = new Set(
|
|
2497
2542
|
RUDDER_BUNDLED_SKILL_SLUGS.map((slug) => `rudder/${slug}`)
|
|
@@ -6132,6 +6177,71 @@ var CLI_REGISTRY_LATEST_URL = "https://registry.npmjs.org/@rudderhq%2fcli/latest
|
|
|
6132
6177
|
var DESKTOP_APP_NAME = "Rudder";
|
|
6133
6178
|
var DESKTOP_METADATA_FILE = ".rudder-desktop-install.json";
|
|
6134
6179
|
var DESKTOP_CHECKSUM_ASSET_NAME = "SHASUMS256.txt";
|
|
6180
|
+
var GITHUB_ASSET_DOWNLOAD_ACCEPT = "application/octet-stream";
|
|
6181
|
+
function normalizeProgressTotal(totalBytes) {
|
|
6182
|
+
return typeof totalBytes === "number" && Number.isFinite(totalBytes) && totalBytes > 0 ? totalBytes : null;
|
|
6183
|
+
}
|
|
6184
|
+
function writeDesktopProgress(event) {
|
|
6185
|
+
const payload = {
|
|
6186
|
+
source: "rudder-desktop-update",
|
|
6187
|
+
...event,
|
|
6188
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6189
|
+
};
|
|
6190
|
+
try {
|
|
6191
|
+
process.stdout.write(`${JSON.stringify(payload)}
|
|
6192
|
+
`);
|
|
6193
|
+
} catch (error) {
|
|
6194
|
+
const code = typeof error === "object" && error && "code" in error ? String(error.code) : "";
|
|
6195
|
+
if (code !== "EPIPE") throw error;
|
|
6196
|
+
}
|
|
6197
|
+
}
|
|
6198
|
+
function desktopDownloadPhase(label) {
|
|
6199
|
+
return label.toLowerCase().includes("shasums") ? "downloading_checksums" : "downloading_asset";
|
|
6200
|
+
}
|
|
6201
|
+
function createDesktopProgressFactory() {
|
|
6202
|
+
return (label) => {
|
|
6203
|
+
const phase = desktopDownloadPhase(label);
|
|
6204
|
+
let latestReceivedBytes = 0;
|
|
6205
|
+
let latestTotalBytes = null;
|
|
6206
|
+
function emitByteProgress(message, receivedBytes, totalBytes) {
|
|
6207
|
+
const total = normalizeProgressTotal(totalBytes);
|
|
6208
|
+
writeDesktopProgress({
|
|
6209
|
+
phase,
|
|
6210
|
+
message,
|
|
6211
|
+
transferredBytes: Math.max(0, receivedBytes),
|
|
6212
|
+
...total === null ? {} : {
|
|
6213
|
+
totalBytes: total,
|
|
6214
|
+
percent: Math.max(0, Math.min(100, Math.floor(Math.max(0, receivedBytes) / total * 100)))
|
|
6215
|
+
}
|
|
6216
|
+
});
|
|
6217
|
+
}
|
|
6218
|
+
return {
|
|
6219
|
+
start(totalBytes) {
|
|
6220
|
+
latestReceivedBytes = 0;
|
|
6221
|
+
latestTotalBytes = totalBytes;
|
|
6222
|
+
emitByteProgress(label, 0, totalBytes);
|
|
6223
|
+
},
|
|
6224
|
+
update(receivedBytes, totalBytes) {
|
|
6225
|
+
latestReceivedBytes = receivedBytes;
|
|
6226
|
+
latestTotalBytes = totalBytes;
|
|
6227
|
+
emitByteProgress(label, receivedBytes, totalBytes);
|
|
6228
|
+
},
|
|
6229
|
+
finish(receivedBytes = latestReceivedBytes, totalBytes = latestTotalBytes) {
|
|
6230
|
+
latestReceivedBytes = receivedBytes;
|
|
6231
|
+
latestTotalBytes = totalBytes;
|
|
6232
|
+
emitByteProgress(`${label} complete`, receivedBytes, totalBytes);
|
|
6233
|
+
},
|
|
6234
|
+
fail() {
|
|
6235
|
+
writeDesktopProgress({
|
|
6236
|
+
phase,
|
|
6237
|
+
message: `${label} failed`,
|
|
6238
|
+
transferredBytes: Math.max(0, latestReceivedBytes),
|
|
6239
|
+
error: `${label} failed`
|
|
6240
|
+
});
|
|
6241
|
+
}
|
|
6242
|
+
};
|
|
6243
|
+
};
|
|
6244
|
+
}
|
|
6135
6245
|
function resolveCurrentCliVersion(env = process.env) {
|
|
6136
6246
|
const version = resolveCliVersion(import.meta.url, env);
|
|
6137
6247
|
return version === "0.0.0" ? "latest" : version;
|
|
@@ -6313,6 +6423,26 @@ function buildGithubReleaseAsset(repo, tag, assetName) {
|
|
|
6313
6423
|
browser_download_url: buildGithubReleaseAssetDownloadUrl(repo, tag, assetName)
|
|
6314
6424
|
};
|
|
6315
6425
|
}
|
|
6426
|
+
function uniqueAssetDownloadUrls(asset) {
|
|
6427
|
+
const urls = [asset.url, asset.browser_download_url].filter((url) => Boolean(url));
|
|
6428
|
+
return Array.from(new Set(urls));
|
|
6429
|
+
}
|
|
6430
|
+
function downloadHeadersForAssetUrl(asset, url) {
|
|
6431
|
+
return {
|
|
6432
|
+
Accept: url === asset.url ? GITHUB_ASSET_DOWNLOAD_ACCEPT : "*/*",
|
|
6433
|
+
"User-Agent": "rudder-cli-installer"
|
|
6434
|
+
};
|
|
6435
|
+
}
|
|
6436
|
+
function formatFetchError(error) {
|
|
6437
|
+
if (!(error instanceof Error)) return String(error);
|
|
6438
|
+
const cause = error.cause;
|
|
6439
|
+
if (cause instanceof Error) {
|
|
6440
|
+
const code = cause.code;
|
|
6441
|
+
const suffix = typeof code === "string" ? ` [${code}]` : "";
|
|
6442
|
+
return `${error.message}: ${cause.message}${suffix}`;
|
|
6443
|
+
}
|
|
6444
|
+
return error.message;
|
|
6445
|
+
}
|
|
6316
6446
|
function contentLengthFromHeaders(headers) {
|
|
6317
6447
|
const raw = headers.get("content-length");
|
|
6318
6448
|
if (!raw) return null;
|
|
@@ -6322,11 +6452,24 @@ function contentLengthFromHeaders(headers) {
|
|
|
6322
6452
|
async function downloadAsset(asset, outputDir, progressFactory = createByteProgress) {
|
|
6323
6453
|
mkdirSync(outputDir, { recursive: true });
|
|
6324
6454
|
const outputPath = path11.join(outputDir, path11.basename(asset.name));
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6455
|
+
let response = null;
|
|
6456
|
+
const failures = [];
|
|
6457
|
+
for (const url of uniqueAssetDownloadUrls(asset)) {
|
|
6458
|
+
try {
|
|
6459
|
+
const candidate = await fetch(url, {
|
|
6460
|
+
headers: downloadHeadersForAssetUrl(asset, url)
|
|
6461
|
+
});
|
|
6462
|
+
if (candidate.ok && candidate.body) {
|
|
6463
|
+
response = candidate;
|
|
6464
|
+
break;
|
|
6465
|
+
}
|
|
6466
|
+
failures.push(`Failed to download ${asset.name} from ${url} (${candidate.status}).`);
|
|
6467
|
+
} catch (error) {
|
|
6468
|
+
failures.push(`Failed to download ${asset.name} from ${url}: ${formatFetchError(error)}.`);
|
|
6469
|
+
}
|
|
6470
|
+
}
|
|
6471
|
+
if (!response) {
|
|
6472
|
+
throw new Error(failures.join("\n"));
|
|
6330
6473
|
}
|
|
6331
6474
|
const totalBytes = contentLengthFromHeaders(response.headers);
|
|
6332
6475
|
const progress = progressFactory(`Downloading ${asset.name}`);
|
|
@@ -6401,9 +6544,25 @@ function runChecked(command, args, options = {}) {
|
|
|
6401
6544
|
const output = [result.stdout, result.stderr].filter((value) => typeof value === "string" && value.trim().length > 0).join("\n").trim();
|
|
6402
6545
|
throw new Error(`${command} ${args.join(" ")} failed${output ? `: ${output}` : ""}`);
|
|
6403
6546
|
}
|
|
6547
|
+
function formatCommandFailure(command, args, stdout, stderr) {
|
|
6548
|
+
const output = [stdout, stderr].filter((value) => typeof value === "string" && value.trim().length > 0).join("\n").trim();
|
|
6549
|
+
return `${command} ${args.join(" ")} failed${output ? `: ${output}` : ""}`;
|
|
6550
|
+
}
|
|
6404
6551
|
function powershellQuote(value) {
|
|
6405
6552
|
return `'${value.replaceAll("'", "''")}'`;
|
|
6406
6553
|
}
|
|
6554
|
+
function buildWindowsZipExtractCommand(zipPath, outputDir) {
|
|
6555
|
+
return { command: "tar.exe", args: ["-xf", zipPath, "-C", outputDir] };
|
|
6556
|
+
}
|
|
6557
|
+
function buildWindowsRobocopyMirrorCommand(sourcePath, destinationPath) {
|
|
6558
|
+
return {
|
|
6559
|
+
command: "robocopy.exe",
|
|
6560
|
+
args: [sourcePath, destinationPath, "/MIR", "/R:2", "/W:1", "/NFL", "/NDL", "/NJH", "/NJS", "/NP"]
|
|
6561
|
+
};
|
|
6562
|
+
}
|
|
6563
|
+
function isSuccessfulRobocopyExitCode(status) {
|
|
6564
|
+
return typeof status === "number" && status >= 0 && status <= 7;
|
|
6565
|
+
}
|
|
6407
6566
|
async function extractZip(zipPath, outputDir, target) {
|
|
6408
6567
|
await rm(outputDir, { recursive: true, force: true });
|
|
6409
6568
|
await mkdir2(outputDir, { recursive: true });
|
|
@@ -6412,13 +6571,8 @@ async function extractZip(zipPath, outputDir, target) {
|
|
|
6412
6571
|
return;
|
|
6413
6572
|
}
|
|
6414
6573
|
if (target.platform === "windows") {
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
"-ExecutionPolicy",
|
|
6418
|
-
"Bypass",
|
|
6419
|
-
"-Command",
|
|
6420
|
-
`Expand-Archive -LiteralPath ${powershellQuote(zipPath)} -DestinationPath ${powershellQuote(outputDir)} -Force`
|
|
6421
|
-
]);
|
|
6574
|
+
const command = buildWindowsZipExtractCommand(zipPath, outputDir);
|
|
6575
|
+
runChecked(command.command, command.args);
|
|
6422
6576
|
return;
|
|
6423
6577
|
}
|
|
6424
6578
|
throw new Error(`Zip assets are not supported for ${target.platform}.`);
|
|
@@ -6564,6 +6718,16 @@ async function installPortableDesktop(installerPath, paths, target) {
|
|
|
6564
6718
|
}
|
|
6565
6719
|
}
|
|
6566
6720
|
async function copyPortableAppBundle(sourcePath, destinationPath) {
|
|
6721
|
+
if (process.platform === "win32") {
|
|
6722
|
+
await mkdir2(destinationPath, { recursive: true });
|
|
6723
|
+
const command = buildWindowsRobocopyMirrorCommand(sourcePath, destinationPath);
|
|
6724
|
+
const result = spawnSync3(command.command, command.args, {
|
|
6725
|
+
encoding: "utf8",
|
|
6726
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
6727
|
+
});
|
|
6728
|
+
if (isSuccessfulRobocopyExitCode(result.status)) return;
|
|
6729
|
+
throw new Error(formatCommandFailure(command.command, command.args, result.stdout, result.stderr));
|
|
6730
|
+
}
|
|
6567
6731
|
await cp(sourcePath, destinationPath, { recursive: true, verbatimSymlinks: true });
|
|
6568
6732
|
}
|
|
6569
6733
|
async function removeMacQuarantine(paths, target) {
|
|
@@ -6651,15 +6815,28 @@ async function writeInstallMetadata(paths, releaseTag, assetName, assetChecksum)
|
|
|
6651
6815
|
await writeFile2(paths.metadataPath, `${JSON.stringify(metadata, null, 2)}
|
|
6652
6816
|
`, "utf8");
|
|
6653
6817
|
}
|
|
6654
|
-
async function runStartPhase(message, successMessage, task) {
|
|
6818
|
+
async function runStartPhase(message, successMessage, task, progressPhase) {
|
|
6819
|
+
if (progressPhase) {
|
|
6820
|
+
writeDesktopProgress({ phase: progressPhase, message });
|
|
6821
|
+
}
|
|
6655
6822
|
const spinner3 = p13.spinner();
|
|
6656
6823
|
spinner3.start(message);
|
|
6657
6824
|
try {
|
|
6658
6825
|
const result = await task();
|
|
6659
6826
|
spinner3.stop(successMessage);
|
|
6827
|
+
if (progressPhase) {
|
|
6828
|
+
writeDesktopProgress({ phase: progressPhase, message: successMessage });
|
|
6829
|
+
}
|
|
6660
6830
|
return result;
|
|
6661
6831
|
} catch (error) {
|
|
6662
6832
|
spinner3.stop(pc8.red(`${message} failed.`));
|
|
6833
|
+
if (progressPhase) {
|
|
6834
|
+
writeDesktopProgress({
|
|
6835
|
+
phase: "failed",
|
|
6836
|
+
message: `${message} failed.`,
|
|
6837
|
+
error: error instanceof Error ? error.message : String(error)
|
|
6838
|
+
});
|
|
6839
|
+
}
|
|
6663
6840
|
throw error;
|
|
6664
6841
|
}
|
|
6665
6842
|
}
|
|
@@ -6670,6 +6847,12 @@ async function startCommand(opts) {
|
|
|
6670
6847
|
const repo = opts.repo?.trim() || DEFAULT_DESKTOP_RELEASE_REPO;
|
|
6671
6848
|
const version = opts.targetVersion?.trim() || opts.version?.trim() || resolveCurrentCliVersion();
|
|
6672
6849
|
const dryRun = opts.dryRun === true;
|
|
6850
|
+
const desktopProgressJson = opts.desktopProgressJson === true;
|
|
6851
|
+
if (desktopProgressJson) {
|
|
6852
|
+
process.stdout.on("error", (error) => {
|
|
6853
|
+
if (error.code !== "EPIPE") throw error;
|
|
6854
|
+
});
|
|
6855
|
+
}
|
|
6673
6856
|
if (!installCli && !installDesktop && !installRuntime) {
|
|
6674
6857
|
throw new Error("Nothing to start. Remove --no-cli, --no-runtime, or --no-desktop.");
|
|
6675
6858
|
}
|
|
@@ -6743,21 +6926,30 @@ async function startCommand(opts) {
|
|
|
6743
6926
|
return;
|
|
6744
6927
|
}
|
|
6745
6928
|
const directReleaseVersion = resolveDesktopReleaseVersion(tag);
|
|
6746
|
-
const progressFactory = createByteProgress;
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6929
|
+
const progressFactory = desktopProgressJson ? createDesktopProgressFactory() : createByteProgress;
|
|
6930
|
+
let release = null;
|
|
6931
|
+
try {
|
|
6932
|
+
release = await runStartPhase(
|
|
6933
|
+
"Resolving Desktop release...",
|
|
6934
|
+
"Desktop release resolved.",
|
|
6935
|
+
() => fetchGithubRelease(repo, tag),
|
|
6936
|
+
desktopProgressJson ? "resolving_release" : null
|
|
6937
|
+
);
|
|
6938
|
+
} catch (error) {
|
|
6939
|
+
if (!directReleaseVersion) throw error;
|
|
6940
|
+
p13.log.warn(
|
|
6941
|
+
`Desktop release metadata could not be resolved; falling back to deterministic download URLs. ${formatFetchError(error)}`
|
|
6942
|
+
);
|
|
6943
|
+
}
|
|
6944
|
+
const releaseTag = release?.tag_name ?? (directReleaseVersion ? tag : null);
|
|
6753
6945
|
if (!releaseTag) {
|
|
6754
6946
|
throw new Error(`Unable to resolve Rudder Desktop release tag for ${repo}@${tag}.`);
|
|
6755
6947
|
}
|
|
6756
|
-
const asset = directReleaseVersion ? buildGithubReleaseAsset(repo, tag, resolveDesktopAssetName(directReleaseVersion, target)) :
|
|
6948
|
+
const asset = selectDesktopAsset(release?.assets ?? [], target) ?? (directReleaseVersion ? buildGithubReleaseAsset(repo, tag, resolveDesktopAssetName(directReleaseVersion, target)) : null);
|
|
6757
6949
|
if (!asset) {
|
|
6758
6950
|
throw new Error(`No Rudder Desktop portable asset found for ${target.platform}/${target.arch} in ${repo}@${releaseTag}.`);
|
|
6759
6951
|
}
|
|
6760
|
-
const checksumAsset = directReleaseVersion ? buildGithubReleaseAsset(repo, tag, DESKTOP_CHECKSUM_ASSET_NAME) :
|
|
6952
|
+
const checksumAsset = selectChecksumAsset(release?.assets ?? []) ?? (directReleaseVersion ? buildGithubReleaseAsset(repo, tag, DESKTOP_CHECKSUM_ASSET_NAME) : null);
|
|
6761
6953
|
const checksums = await downloadChecksums(checksumAsset, outputDir, progressFactory);
|
|
6762
6954
|
const expectedChecksum = resolveAssetChecksum(checksums, asset.name);
|
|
6763
6955
|
const metadata = await readInstallMetadata(installPaths.metadataPath);
|
|
@@ -6769,24 +6961,28 @@ async function startCommand(opts) {
|
|
|
6769
6961
|
async () => {
|
|
6770
6962
|
await removeMacQuarantine(installPaths, target);
|
|
6771
6963
|
await createPlatformLaunchers(installPaths, target);
|
|
6772
|
-
}
|
|
6964
|
+
},
|
|
6965
|
+
desktopProgressJson ? "preparing_restart" : null
|
|
6773
6966
|
);
|
|
6774
6967
|
} else {
|
|
6775
6968
|
const installerPath = await downloadAsset(asset, outputDir, progressFactory);
|
|
6776
6969
|
const checksum = await runStartPhase(
|
|
6777
6970
|
"Verifying Desktop checksum...",
|
|
6778
6971
|
`Verified ${pc8.cyan(path11.basename(installerPath))}.`,
|
|
6779
|
-
() => assertChecksumMatch(installerPath, expectedChecksum)
|
|
6972
|
+
() => assertChecksumMatch(installerPath, expectedChecksum),
|
|
6973
|
+
desktopProgressJson ? "verifying_checksum" : null
|
|
6780
6974
|
);
|
|
6781
6975
|
await runStartPhase(
|
|
6782
6976
|
"Replacing existing Rudder Desktop if needed...",
|
|
6783
6977
|
"Existing Desktop install is ready for replacement.",
|
|
6784
|
-
() => prepareForDesktopReplace(installPaths, target, { waitForActiveRuns: opts.waitForActiveRuns === true })
|
|
6978
|
+
() => prepareForDesktopReplace(installPaths, target, { waitForActiveRuns: opts.waitForActiveRuns === true }),
|
|
6979
|
+
desktopProgressJson ? opts.waitForActiveRuns === true ? "waiting_for_active_runs" : "preparing_restart" : null
|
|
6785
6980
|
);
|
|
6786
6981
|
await runStartPhase(
|
|
6787
6982
|
"Installing portable Desktop app...",
|
|
6788
6983
|
`Installed Rudder Desktop to ${pc8.cyan(installPaths.appPath)}.`,
|
|
6789
|
-
() => installPortableDesktop(installerPath, installPaths, target)
|
|
6984
|
+
() => installPortableDesktop(installerPath, installPaths, target),
|
|
6985
|
+
desktopProgressJson ? "preparing_restart" : null
|
|
6790
6986
|
);
|
|
6791
6987
|
await runStartPhase(
|
|
6792
6988
|
"Preparing Desktop launchers...",
|
|
@@ -6794,7 +6990,8 @@ async function startCommand(opts) {
|
|
|
6794
6990
|
async () => {
|
|
6795
6991
|
await removeMacQuarantine(installPaths, target);
|
|
6796
6992
|
await createPlatformLaunchers(installPaths, target);
|
|
6797
|
-
}
|
|
6993
|
+
},
|
|
6994
|
+
desktopProgressJson ? "preparing_restart" : null
|
|
6798
6995
|
);
|
|
6799
6996
|
await writeInstallMetadata(installPaths, releaseTag, asset.name, checksum);
|
|
6800
6997
|
}
|
|
@@ -6802,7 +6999,8 @@ async function startCommand(opts) {
|
|
|
6802
6999
|
await runStartPhase(
|
|
6803
7000
|
"Launching Rudder Desktop...",
|
|
6804
7001
|
"Rudder Desktop launched.",
|
|
6805
|
-
() => launchDesktop(installPaths, target)
|
|
7002
|
+
() => launchDesktop(installPaths, target),
|
|
7003
|
+
desktopProgressJson ? "closing" : null
|
|
6806
7004
|
);
|
|
6807
7005
|
}
|
|
6808
7006
|
}
|
|
@@ -11357,7 +11555,7 @@ function createProgram() {
|
|
|
11357
11555
|
});
|
|
11358
11556
|
loadRudderEnvFile(options.config);
|
|
11359
11557
|
});
|
|
11360
|
-
program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI installation").option("--no-runtime", "Skip Rudder runtime installation").option("--no-desktop", "Skip desktop app installation").option("--version <version>", "Rudder version to start (default: current CLI version)").option("--target-version <version>", "Rudder version to start; avoids the root CLI version flag").option("--repo <owner/repo>", "GitHub repository that hosts desktop releases").option("--output-dir <path>", "Directory for downloaded desktop release assets").option("--desktop-install-dir <path>", "Directory for the portable Desktop install").option("--no-open", "Install Desktop without launching it").option("--wait-for-active-runs", "Wait for active Rudder runs to finish before replacing Desktop", false).option("--no-version-check", "Skip checking npm for a newer Rudder CLI version").option("--dry-run", "Print the start actions without changing the machine", false).action(startCommand);
|
|
11558
|
+
program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI installation").option("--no-runtime", "Skip Rudder runtime installation").option("--no-desktop", "Skip desktop app installation").option("--version <version>", "Rudder version to start (default: current CLI version)").option("--target-version <version>", "Rudder version to start; avoids the root CLI version flag").option("--repo <owner/repo>", "GitHub repository that hosts desktop releases").option("--output-dir <path>", "Directory for downloaded desktop release assets").option("--desktop-install-dir <path>", "Directory for the portable Desktop install").option("--no-open", "Install Desktop without launching it").option("--wait-for-active-runs", "Wait for active Rudder runs to finish before replacing Desktop", false).option("--desktop-progress-json", "Emit newline-delimited Desktop update progress events").option("--no-version-check", "Skip checking npm for a newer Rudder CLI version").option("--dry-run", "Print the start actions without changing the machine", false).action(startCommand);
|
|
11361
11559
|
program.command("onboard").description("Interactive first-run setup wizard").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("-y, --yes", "Accept defaults (quickstart + start immediately)", false).option("--run", "Start Rudder immediately after saving config", false).action(onboard);
|
|
11362
11560
|
program.command("doctor").description("Run diagnostic checks on your Rudder setup").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("--repair", "Attempt to repair issues automatically").alias("--fix").option("-y, --yes", "Skip repair confirmation prompts").action(async (opts) => {
|
|
11363
11561
|
await doctor(opts);
|