magus-cli 7.9.1 → 7.10.1

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,8 +1,8 @@
1
1
  /**
2
2
  * The failure popup's words for everything outside the Plugins screen's apply
3
3
  * paths: the profile gate at startup, a profile activation, the startup
4
- * repairs (stale plugin loads, marketplace refreshes, gitignore fixes) and the
5
- * Git State screen. Each is a pure builder over what the service returned, on
4
+ * repairs (stale plugin loads, marketplace refreshes, gitignore fixes), the
5
+ * setup of other worktrees and the Git State screen. Each is a pure builder over what the service returned, on
6
6
  * top of {@link failureReport}, so they read like every other failure.
7
7
  *
8
8
  * Each returns null when nothing failed: success says nothing, because the
@@ -13,6 +13,7 @@ import type { StaleLoadRepairResult } from "../../services/claude-settings.js";
13
13
  import type { ActivationResult } from "../../services/profile-activate.js";
14
14
  import { SettingsParseError } from "../../services/settings-file.js";
15
15
  import { pluginName } from "../../services/update-engine.js";
16
+ import type { WorktreeSetupResult } from "../../services/worktree-profiles.js";
16
17
  import { userFacingPath, withUserFacingPath } from "../../utils/user-path.js";
17
18
  import type { FailureReport, FailureRow } from "../state/types.js";
18
19
  import {
@@ -212,6 +213,25 @@ export function stepFailureReport(
212
213
  };
213
214
  }
214
215
 
216
+ /**
217
+ * Worktrees the startup setup could not put on their declared profile, each
218
+ * by folder name with its reason. Null when every one was set up.
219
+ */
220
+ export function worktreeSetupReport(
221
+ results: readonly WorktreeSetupResult[],
222
+ ): FailureReport | null {
223
+ const failed = results.filter(
224
+ (r): r is Extract<WorktreeSetupResult, { ok: false }> => !r.ok,
225
+ );
226
+ return failureReport(
227
+ `${counted(failed.length, "worktree")} ${failed.length === 1 ? "was" : "were"} not set up`,
228
+ failed.map((r) => ({
229
+ subject: r.name,
230
+ reason: exceptionReason(r.reason).reason,
231
+ })),
232
+ );
233
+ }
234
+
215
235
  /**
216
236
  * M9: generated files the startup gitignore fix could not untrack, each with
217
237
  * git's own reason.
@@ -250,6 +250,10 @@ export function renderCliToolRow(
250
250
  } else if (status?.state === "unknown") {
251
251
  icon = "?";
252
252
  iconColor = theme.colors.warning;
253
+ } else if (status?.state === "external") {
254
+ // Installed, and left alone on purpose: present, not a finding.
255
+ icon = "●";
256
+ iconColor = theme.colors.muted;
253
257
  } else {
254
258
  icon = "●";
255
259
  iconColor = theme.colors.success;
@@ -353,6 +357,8 @@ export function renderCliToolDetail(
353
357
  </text>
354
358
  ) : state === "upgrade" ? (
355
359
  <text fg={theme.colors.warning}>{"● Update available"}</text>
360
+ ) : state === "external" ? (
361
+ <text fg={theme.colors.muted}>{"● Installed, kept as is"}</text>
356
362
  ) : state === "unknown" ? (
357
363
  // A version that was read but cannot be checked for updates is
358
364
  // still a version: say "installed", and let Why say the rest.
@@ -365,12 +371,17 @@ export function renderCliToolDetail(
365
371
  <text fg={theme.colors.success}>{"● Up to date"}</text>
366
372
  )}
367
373
  </box>
368
- {state === "unknown" && status?.note ? (
374
+ {(state === "unknown" || state === "external") && status?.note ? (
369
375
  <box flexDirection="row">
370
376
  <text fg={theme.colors.muted} flexShrink={0}>
371
377
  {"Why "}
372
378
  </text>
373
- <text fg={theme.colors.warning} minWidth={0}>
379
+ <text
380
+ fg={
381
+ state === "external" ? theme.colors.muted : theme.colors.warning
382
+ }
383
+ minWidth={0}
384
+ >
374
385
  {wrapValue(status.note, width)}
375
386
  </text>
376
387
  </box>