@rudderhq/cli 0.2.0-canary.5 → 0.2.0-canary.7

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/dist/index.js CHANGED
@@ -10915,10 +10915,17 @@ async function removePathWithRetry(targetPath, attempts = 5) {
10915
10915
  }
10916
10916
  return false;
10917
10917
  }
10918
- async function prepareForDesktopReplace(paths, target) {
10918
+ async function prepareForDesktopReplace(paths, target, options = {}) {
10919
10919
  const hasManagedExecutable = await pathExists(paths.executablePath);
10920
10920
  if (hasManagedExecutable) {
10921
- const quitResponse = await requestDesktopQuit(paths.executablePath, target);
10921
+ let quitResponse = await requestDesktopQuit(paths.executablePath, target);
10922
+ while (quitResponse && !quitResponse.ok && quitResponse.status === "active_runs" && options.waitForActiveRuns) {
10923
+ p13.log.warn(
10924
+ `Rudder Desktop has ${quitResponse.totalRuns} active run${quitResponse.totalRuns === 1 ? "" : "s"}; waiting before replacing Desktop.`
10925
+ );
10926
+ await delay(options.activeRunPollIntervalMs ?? 15e3);
10927
+ quitResponse = await requestDesktopQuit(paths.executablePath, target);
10928
+ }
10922
10929
  if (quitResponse && !quitResponse.ok && quitResponse.status === "active_runs") {
10923
10930
  throw new Error(
10924
10931
  `Rudder Desktop has ${quitResponse.totalRuns} active run${quitResponse.totalRuns === 1 ? "" : "s"}. Stop active work, then rerun start.`
@@ -11153,7 +11160,7 @@ async function startCommand(opts) {
11153
11160
  await runStartPhase(
11154
11161
  "Replacing existing Rudder Desktop if needed...",
11155
11162
  "Existing Desktop install is ready for replacement.",
11156
- () => prepareForDesktopReplace(installPaths, target)
11163
+ () => prepareForDesktopReplace(installPaths, target, { waitForActiveRuns: opts.waitForActiveRuns === true })
11157
11164
  );
11158
11165
  await runStartPhase(
11159
11166
  "Installing portable Desktop app...",
@@ -19021,6 +19028,13 @@ function formatJson(value) {
19021
19028
  return String(value);
19022
19029
  }
19023
19030
  }
19031
+ function formatTodoList(entry) {
19032
+ return entry.items.map((item) => `${item.status === "completed" ? "[x]" : item.status === "in_progress" ? "[~]" : "[ ]"} ${item.text}`).join("\n");
19033
+ }
19034
+ function summarizeTodoList(entry) {
19035
+ const completed = entry.items.filter((item) => item.status === "completed").length;
19036
+ return `Todo list updated: ${completed}/${entry.items.length} complete`;
19037
+ }
19024
19038
  function isModelTranscriptEntry(entry) {
19025
19039
  return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "result";
19026
19040
  }
@@ -19030,6 +19044,7 @@ function isPayloadTranscriptEntry(entry) {
19030
19044
  function detailTextForTranscriptEntry(entry) {
19031
19045
  if (entry.kind === "tool_call") return formatJson(entry.input);
19032
19046
  if (entry.kind === "tool_result") return entry.content || "";
19047
+ if (entry.kind === "todo_list") return formatTodoList(entry);
19033
19048
  if (entry.kind === "result") {
19034
19049
  return [
19035
19050
  entry.text || "",
@@ -19049,6 +19064,9 @@ function previewTextForTranscriptEntry(entry, maxLength = 180) {
19049
19064
  const detail = detailTextForTranscriptEntry(entry);
19050
19065
  return truncate(firstMeaningfulLine(detail) || entry.toolName || "(empty tool result)", maxLength);
19051
19066
  }
19067
+ if (entry.kind === "todo_list") {
19068
+ return truncate(summarizeTodoList(entry), maxLength);
19069
+ }
19052
19070
  if (entry.kind === "result") {
19053
19071
  const summary = entry.text ? firstMeaningfulLine(entry.text) : "";
19054
19072
  if (summary) return truncate(summary, maxLength);
@@ -19063,7 +19081,7 @@ function previewTextForTranscriptEntry(entry, maxLength = 180) {
19063
19081
  return "";
19064
19082
  }
19065
19083
  function isTurnScopedEntry(entry) {
19066
- return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "tool_call" || entry.kind === "tool_result" || entry.kind === "result";
19084
+ return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "todo_list" || entry.kind === "tool_call" || entry.kind === "tool_result" || entry.kind === "result";
19067
19085
  }
19068
19086
  function isErrorTranscriptEntry(entry) {
19069
19087
  return entry.kind === "stderr" || entry.kind === "tool_result" && entry.isError || entry.kind === "result" && entry.isError;
@@ -20266,7 +20284,7 @@ function createProgram() {
20266
20284
  });
20267
20285
  loadRudderEnvFile(options.config);
20268
20286
  });
20269
- program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI 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("--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);
20287
+ program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI 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);
20270
20288
  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);
20271
20289
  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) => {
20272
20290
  await doctor(opts);