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.
- package/package.json +4 -4
- package/src/__tests__/blind/c15-probe-ownership.test.ts +3 -3
- package/src/__tests__/blind/plugin-deps/doctor.test.ts +1 -0
- package/src/__tests__/cli-tools-adapter.test.ts +25 -6
- package/src/__tests__/plugin-mcp-source-shapes.test.ts +250 -0
- package/src/__tests__/tool-probe.test.ts +21 -13
- package/src/__tests__/update-plan.test.ts +19 -3
- package/src/__tests__/worktree-profiles.test.ts +583 -0
- package/src/cli/doctor.ts +24 -2
- package/src/cli/update-view.ts +72 -0
- package/src/cli/update.ts +21 -0
- package/src/cli/worktrees.ts +32 -0
- package/src/services/git-worktree.ts +41 -0
- package/src/services/plugin-mcp-config.ts +3 -1
- package/src/services/tool-probe.ts +41 -7
- package/src/services/update-plan.ts +9 -4
- package/src/services/worktree-profiles.ts +181 -0
- package/src/ui/App.tsx +32 -1
- package/src/ui/adapters/cliToolsAdapter.ts +15 -6
- package/src/ui/adapters/startupReports.ts +22 -2
- package/src/ui/renderers/cliToolRenderers.tsx +13 -2
|
@@ -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)
|
|
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
|
|
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>
|