@uniqbit/mate-core 1.0.0-canary.6 → 1.0.0-canary.8
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/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/package.json +6 -3
- package/src/cli/commands/artifact/delivery/submit.ts +6 -4
- package/src/cli/commands/artifact/finish/command.ts +28 -11
- package/src/cli/commands/artifact/pending/command.ts +71 -7
- package/src/cli/commands/cap/tokensave.ts +2 -2
- package/src/cli/commands/companion/update.ts +2 -3
- package/src/cli/commands/doctor.ts +67 -4
- package/src/cli/commands/friction.ts +558 -0
- package/src/cli/commands/install.ts +8 -4
- package/src/cli/commands/plugin/install.ts +82 -35
- package/src/cli/commands/studio/connection.ts +53 -0
- package/src/cli/commands/studio/routes.ts +3 -0
- package/src/cli/commands/studio/selection.ts +10 -1
- package/src/cli/commands/studio/server.ts +31 -0
- package/src/cli/commands/studio/service-host.ts +3 -0
- package/src/cli/commands/studio/services.ts +25 -0
- package/src/cli/commands/triage.ts +172 -0
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/install-plan.tsx +3 -0
- package/src/cli/main.ts +85 -19
- package/src/cli/plugin-commands.ts +6 -1
- package/src/cli/usage.ts +12 -2
- package/src/create-mate.ts +11 -5
- package/src/distribution.ts +2 -0
- package/src/factory-host.ts +6 -0
- package/src/hooks/validate-artifact-path.ts +64 -14
- package/src/index.ts +1 -0
- package/src/lib/delivery/merge-git.ts +31 -7
- package/src/lib/delivery/overlap.ts +14 -1
- package/src/lib/delivery/repository-access.ts +11 -6
- package/src/lib/delivery/staging/apply-chain.ts +25 -7
- package/src/lib/delivery/staging/linked-merges.ts +175 -0
- package/src/lib/delivery/staging/naming.ts +3 -0
- package/src/lib/delivery/staging/openspec-type.ts +38 -7
- package/src/lib/delivery/staging/pending.ts +153 -11
- package/src/lib/delivery/staging/preflight.ts +239 -0
- package/src/lib/delivery/staging/project.ts +243 -104
- package/src/lib/delivery/staging/replay.ts +5 -3
- package/src/lib/delivery/staging/settle-linked.ts +5 -119
- package/src/lib/delivery/staging/submit.ts +139 -18
- package/src/lib/delivery/submit-change.ts +163 -37
- package/src/lib/friction/describe.ts +42 -0
- package/src/lib/friction/fields.ts +60 -0
- package/src/lib/friction/mark.ts +194 -0
- package/src/lib/friction/view/model.ts +67 -0
- package/src/lib/friction/view/read.ts +145 -0
- package/src/lib/friction/view/select.ts +54 -0
- package/src/lib/openspec-cli.ts +10 -5
- package/src/lib/orchestrator/adapters/claude.ts +5 -4
- package/src/lib/orchestrator/adapters/opencode.ts +2 -0
- package/src/lib/orchestrator/root-context.ts +23 -6
- package/src/lib/package-paths.ts +23 -15
- package/src/lib/session-attribution.ts +3 -7
- package/src/lib/skills-cli.ts +38 -0
- package/src/lib/tool-manifest.ts +73 -0
- package/src/lib/triage/context.ts +312 -0
- package/src/lib/triage/launch.ts +52 -0
- package/src/lib/triage/prepare.ts +112 -0
- package/src/lib/triage/session.ts +126 -0
- package/src/opencode/companion-hooks.ts +53 -5
- package/src/opencode/projected-guidance.ts +2 -0
- package/src/playbooks/companion-guidance.ts +2 -2
- package/src/plugin-api.ts +6 -0
- package/src/runtime/command-arg.ts +15 -0
- package/src/runtime/command-friction.ts +97 -0
- package/src/runtime/companion-guidance.ts +33 -16
- package/src/runtime/friction-fingerprint.ts +35 -0
- package/src/runtime/friction-log.ts +376 -0
- package/src/runtime/friction-recorder.ts +212 -0
- package/src/runtime/friction-retention.ts +1 -0
- package/src/runtime/friction-state.ts +110 -0
- package/src/runtime/friction-switch.ts +26 -0
- package/src/runtime/friction-vocabulary.ts +42 -0
- package/src/runtime/git-tracked.ts +13 -2
- package/src/runtime/projected-guidance.ts +2 -1
- package/src/runtime/secret-values.ts +16 -0
- package/src/runtime/session-id.ts +24 -0
- package/src/runtime/session-prepare-runner.ts +3 -0
- package/src/runtime/workflow/next-handoff-process.ts +2 -1
- package/src/studio.ts +47 -1
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +5 -1
- package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +24 -2
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +24 -2
- package/src/templates/triage/PLAYBOOK.md +120 -0
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +108 -108
- package/src/tools/setup/capabilities/graphify.ts +23 -1
- package/src/tools/setup/capabilities/rtk.ts +46 -94
- package/src/tools/setup/capabilities/tokensave.ts +76 -54
- package/src/tools/setup/dynamic-plugins/audiences.ts +28 -14
- package/src/tools/setup/dynamic-plugins/hydrate.ts +32 -14
- package/src/tools/setup/dynamic-plugins/install.ts +2 -0
- package/src/tools/setup/dynamic-plugins/installed.ts +73 -0
- package/src/tools/setup/dynamic-plugins/loader.ts +12 -10
- package/src/tools/setup/dynamic-plugins/local.ts +492 -0
- package/src/tools/setup/dynamic-plugins/paths.ts +34 -6
- package/src/tools/setup/dynamic-plugins/verify.ts +34 -14
- package/src/tools/setup/dynamic-plugins/workspaces.ts +17 -8
- package/src/tools/setup/mate.ts +26 -1
- package/src/tools/setup/plugin.ts +5 -0
- package/src/tools/setup/plugins/gitignore.ts +45 -12
- package/src/tools/setup/service.ts +12 -0
- package/src/tools/setup/utils.ts +10 -1
- package/src/tools/setup.ts +16 -2
- package/studio-dist/client/assets/app-ggXJ_QVh.css +2 -0
- package/studio-dist/client/assets/button-amJ3g5oD.js +1 -0
- package/studio-dist/client/assets/cn-BQPKiwI4.js +1 -0
- package/studio-dist/client/assets/combobox-CJ7aGFid.js +1 -0
- package/studio-dist/client/assets/{companion-view-BVaZNtiI.js → companion-view-C_N237bf.js} +1 -1
- package/studio-dist/client/assets/fields-BAiGkJ5N.js +1 -0
- package/studio-dist/client/assets/friction-DqOU59v7.js +1 -0
- package/studio-dist/client/assets/getting-started-djaQeWlu.js +1 -0
- package/studio-dist/client/assets/getting-started-yp42dj5S.js +1 -0
- package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +1 -0
- package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +1 -0
- package/studio-dist/client/assets/graph-BYaD_5Bq.js +2 -0
- package/studio-dist/client/assets/{graph-canvas-DDuzsNSx.js → graph-canvas-ySGKMhmk.js} +1 -1
- package/studio-dist/client/assets/guides-D6T6W_jV.js +1 -0
- package/studio-dist/client/assets/index-Qx7reRPD.js +40 -0
- package/studio-dist/client/assets/markdown-view-jMiaBTSO.js +1 -0
- package/studio-dist/client/assets/panel-C4bf_h2W.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +1 -0
- package/studio-dist/client/assets/prepaint-CKsXyJOR.js +27 -0
- package/studio-dist/client/assets/{queries-axYk2u9L.js → queries-Dfp5deWj.js} +1 -1
- package/studio-dist/client/assets/react-BYUSgtBs.js +1 -0
- package/studio-dist/client/assets/reports-JFSwSueq.js +1 -0
- package/studio-dist/client/assets/routes-BdOWSgzK.js +1 -0
- package/studio-dist/client/assets/search-CXosfvYh.js +1 -0
- package/studio-dist/client/assets/select-BHYYWPhK.js +1 -0
- package/studio-dist/client/assets/skills-Bo9FLsBd.js +1 -0
- package/studio-dist/client/assets/{specs-DU1kqcp5.js → specs-BrCOjOch.js} +1 -1
- package/studio-dist/client/assets/specs-view-CdE2rlli.js +1 -0
- package/studio-dist/client/assets/{steps-DhIFuAZy.js → steps-CKUno4lh.js} +1 -1
- package/studio-dist/client/assets/store-C3vJq8Wj.js +1 -0
- package/studio-dist/client/assets/{studio-BR9j15J0.js → studio-0ueISxwP.js} +8 -8
- package/studio-dist/client/assets/{studio-queries-CFP_yTpr.js → studio-queries-BflKt9va.js} +2 -2
- package/studio-dist/client/assets/{usage-CHmwtkoM.js → usage-BLsLy0nN.js} +16 -16
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +1 -0
- package/studio-dist/client/assets/useMutation-uJUrejsi.js +1 -0
- package/studio-dist/client/assets/vault-BB1B_OhR.js +1 -0
- package/studio-dist/client/assets/warnings-CqOOGlPD.js +1 -0
- package/studio-dist/client/assets/workflow-BFzmI-06.js +1 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-DAbZ6fzY.js → __23tanstack-start-server-fn-resolver-gVfW5vIV.js} +30 -14
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +66 -50
- package/studio-dist/server/assets/{button-BfoNadNR.js → button-D6bvrFmm.js} +226 -3478
- package/studio-dist/server/assets/cn-FXJAM0KO.js +5528 -0
- package/studio-dist/server/assets/combobox-D2MbYV1O.js +484 -0
- package/studio-dist/server/assets/{companion-view-DHUjPpA0.js → companion-view-Mf1ANbMb.js} +2 -2
- package/studio-dist/server/assets/{companions-kBrJZAd6.js → companions-Dr6IpNAb.js} +1 -1
- package/studio-dist/server/assets/{fields-BD_c65T1.js → fields-B4mAPETz.js} +2 -1
- package/studio-dist/server/assets/friction-9a5S1m7U.js +943 -0
- package/studio-dist/server/assets/friction-CWOTjpCV.js +62 -0
- package/studio-dist/server/assets/{getting-started-7P0oyWaM.js → getting-started-RU6tYU2Q.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-B1mV0kGz.js → getting-started._topic-C02HGrC6.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-CeGtvUsm.js → getting-started.index-EzLRosbb.js} +2 -2
- package/studio-dist/server/assets/{graph-BWtmJOH2.js → graph-B11ITte0.js} +1 -1
- package/studio-dist/server/assets/{graph-DSDVEELZ.js → graph-CZ2H9Fzr.js} +8 -8
- package/studio-dist/server/assets/{graph-canvas-CID9Nksc.js → graph-canvas-rP5TT14Z.js} +2 -2
- package/studio-dist/server/assets/{guides-Bm3RbUB-.js → guides-B8HdeK_C.js} +1 -1
- package/studio-dist/server/assets/{guides-BLJenHwQ.js → guides-BGftp4wf.js} +1 -1
- package/studio-dist/server/assets/{guides.server-rHHqRuzV.js → guides.server-DqFQAStf.js} +1 -1
- package/studio-dist/server/assets/{markdown-view-D3v9x-cM.js → markdown-view-CArpV-CS.js} +1 -1
- package/studio-dist/server/assets/{panel-yqOl5GMU.js → panel-DR0iq46J.js} +4 -3
- package/studio-dist/server/assets/{plugins._service._view-DwqJX7s9.js → plugins._service._view-n7u2k5dF.js} +11 -6
- package/studio-dist/server/assets/prepaint-B28ClcPN.js +45 -0
- package/studio-dist/server/assets/{queries-DYmGrhNO.js → queries-D-yVP9i0.js} +1 -1
- package/studio-dist/server/assets/react-CiBZPDs8.js +45 -0
- package/studio-dist/server/assets/{reports-C4Y_Jd-x.js → reports-B9k98oE6.js} +1 -1
- package/studio-dist/server/assets/{reports-7yaPz7aP.js → reports-C2SmTgqh.js} +7 -7
- package/studio-dist/server/assets/{router-Dnoq5auE.js → router-CPt0TAk_.js} +654 -1565
- package/studio-dist/server/assets/{routes-Cok4p3mK.js → routes-CwH8LEy2.js} +8 -8
- package/studio-dist/server/assets/{search-DUK7Jl6f.js → search-b-yQesv3.js} +25 -2
- package/studio-dist/server/assets/{combobox-oxUI6r4V.js → select-C3i6TTX-.js} +35 -514
- package/studio-dist/server/assets/{shell-DNVXedgE.js → shell-CagqZZMZ.js} +4 -3
- package/studio-dist/server/assets/{skills-D8qdXSku.js → skills-C21Mg_8-.js} +8 -8
- package/studio-dist/server/assets/{skills-pKmuAs0F.js → skills-DGg0mWDM.js} +1 -1
- package/studio-dist/server/assets/{specs-DeHYUNFp.js → specs-DetoMiaB.js} +4 -4
- package/studio-dist/server/assets/{specs-view-BGn-5Ik_.js → specs-view-CmbfLDwN.js} +10 -9
- package/studio-dist/server/assets/{steps-CV7Yk7L7.js → steps-D1tYAyWZ.js} +1 -1
- package/studio-dist/server/assets/store-aC-I6f6o.js +93 -0
- package/studio-dist/server/assets/{studio-CB94np48.js → studio-qRvQjRpz.js} +47 -2
- package/studio-dist/server/assets/{studio-queries-BqZGBE70.js → studio-queries-Dqf-3nzj.js} +66 -8
- package/studio-dist/server/assets/{usage-M6Gi6Km7.js → usage-CS4CBK9D.js} +13 -44
- package/studio-dist/server/assets/{usage-j5jR9gX9.js → usage-Cwle9-xY.js} +1 -1
- package/studio-dist/server/assets/useAnchoredPopupScrollLock-BjMNgXv9.js +756 -0
- package/studio-dist/server/assets/useMutation-DpBIuWXt.js +690 -0
- package/studio-dist/server/assets/{vault-lBlvSyD4.js → vault-CEBBRLMb.js} +1 -1
- package/studio-dist/server/assets/{vault-PqVmssmW.js → vault-DVQidlId.js} +6 -6
- package/studio-dist/server/assets/{views-CsFp1i1G.js → views-UgO0Qz_g.js} +2 -2
- package/studio-dist/server/assets/{warnings-BDs34j_m.js → warnings-C7hgXpdk.js} +2 -2
- package/studio-dist/server/assets/{workflow-T0eEldsa.js → workflow-6dZZ1ofw.js} +9 -9
- package/studio-dist/server/server.js +2 -2
- package/tool-manifest.yaml +85 -0
- package/studio-dist/client/assets/app-BFVyWHGo.css +0 -2
- package/studio-dist/client/assets/button-D6LrRkOG.js +0 -1
- package/studio-dist/client/assets/combobox-Dk2MMZWE.js +0 -1
- package/studio-dist/client/assets/fields-D_FYhxQr.js +0 -1
- package/studio-dist/client/assets/getting-started-ByWRg7hC.js +0 -1
- package/studio-dist/client/assets/getting-started-DZSjYC-b.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-C6OyQ4G6.js +0 -1
- package/studio-dist/client/assets/getting-started.index-BkmPHdEm.js +0 -1
- package/studio-dist/client/assets/graph-7jm2XzyL.js +0 -2
- package/studio-dist/client/assets/guides-D9VTjWXP.js +0 -1
- package/studio-dist/client/assets/index-BBmFpG4y.js +0 -40
- package/studio-dist/client/assets/markdown-view-RL5YvfZg.js +0 -1
- package/studio-dist/client/assets/panel-B8F8sOKQ.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-CynxTbMx.js +0 -1
- package/studio-dist/client/assets/react-r45OnJCw.js +0 -27
- package/studio-dist/client/assets/reports-BCAyXh6p.js +0 -1
- package/studio-dist/client/assets/routes-BFPqq89E.js +0 -1
- package/studio-dist/client/assets/skills-DTks_uBx.js +0 -1
- package/studio-dist/client/assets/specs-view-omrd_5P3.js +0 -1
- package/studio-dist/client/assets/store-DJ5cncKA.js +0 -1
- package/studio-dist/client/assets/useBaseQuery-BlC-AZ35.js +0 -1
- package/studio-dist/client/assets/vault-DRg8MScm.js +0 -1
- package/studio-dist/client/assets/warnings-UHFy6HAp.js +0 -1
- package/studio-dist/client/assets/workflow-Bv9vSfVV.js +0 -1
- package/studio-dist/server/assets/react-BO0uMhpm.js +0 -89
- package/studio-dist/server/assets/store-CWDGIp6x.js +0 -280
- package/studio-dist/server/assets/useBaseQuery-Tv_QJt9r.js +0 -2051
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniqbit/mate-core",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.8",
|
|
4
4
|
"description": "Core framework and plugin APIs for Mate.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"src/",
|
|
13
13
|
"studio-dist/",
|
|
14
14
|
"wrappers/",
|
|
15
|
+
"tool-manifest.yaml",
|
|
15
16
|
"claude-plugin/",
|
|
16
17
|
"opencode-plugin/",
|
|
17
18
|
"claude-capability-plugins/",
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"react": "^19.2.7",
|
|
74
75
|
"react-doctor": "0.9.13",
|
|
75
76
|
"semver": "^7.8.5",
|
|
77
|
+
"skills": "1.7.6",
|
|
76
78
|
"smol-toml": "1.9.1",
|
|
77
79
|
"yaml": "^2.9.0",
|
|
78
80
|
"zod": "4.6.7"
|
|
@@ -84,7 +86,8 @@
|
|
|
84
86
|
"@types/bun": "^1.3.14",
|
|
85
87
|
"@types/node": "^26.0.1",
|
|
86
88
|
"@types/react": "^19.2.17",
|
|
87
|
-
"@types/semver": "^7.7.1"
|
|
89
|
+
"@types/semver": "^7.7.1",
|
|
90
|
+
"typescript": "^7.0.2"
|
|
88
91
|
},
|
|
89
92
|
"peerDependencies": {
|
|
90
93
|
"@opentui/core": ">=0.5.14",
|
|
@@ -103,7 +106,7 @@
|
|
|
103
106
|
}
|
|
104
107
|
},
|
|
105
108
|
"engines": {
|
|
106
|
-
"node": ">=22.
|
|
109
|
+
"node": ">=22.20.0"
|
|
107
110
|
},
|
|
108
111
|
"packageManager": "bun@1.4.4"
|
|
109
112
|
}
|
|
@@ -61,10 +61,12 @@ function renderHuman(result: SubmitResult): string[] {
|
|
|
61
61
|
* warnings to stderr, and runs the artifact type's check (`openspec validate <change>
|
|
62
62
|
* --strict`). The other active changes of its Delivery Group (`<repository>/<delivery-branch>`,
|
|
63
63
|
* or `change/<change>` without a branch) in this checkout join when all their tasks are
|
|
64
|
-
* checked
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
64
|
+
* checked, and its `submitted` members edited since this checkout submitted or took them go
|
|
65
|
+
* through the same steps and get a result entry. The group is then pushed whole, in one
|
|
66
|
+
* secret-scanned commit that sets `state: submitted` in each `delivery.yaml` and carries a
|
|
67
|
+
* `Mate-Transaction` trailer, to the pending branch, the inbox `mate/inbox`. While a member has
|
|
68
|
+
* open tasks or fails its check the group answers `waiting`, naming it, and nothing is pushed or
|
|
69
|
+
* changed. The commit is built in a
|
|
68
70
|
* temporary worktree, pushed without force and rebuilt up to three times; the checkout is not
|
|
69
71
|
* touched.
|
|
70
72
|
* Nothing is archived and no canonical spec is written; publication does that after the merge.
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "../../../../lib/delivery/record-delivery";
|
|
8
8
|
import type { ArtifactType } from "../../../../lib/delivery/staging/artifact-type";
|
|
9
9
|
import { isDeliveryGroup } from "../../../../lib/delivery/staging/naming";
|
|
10
|
+
import { groupOfChange } from "../../../../lib/delivery/staging/submit";
|
|
10
11
|
import { declaredSubmitType } from "../../../../lib/delivery/staging/registry";
|
|
11
12
|
import { errorMessage } from "../../../../runtime/error-message";
|
|
12
13
|
import { settleLinked } from "../../../../lib/delivery/staging/settle-linked";
|
|
@@ -271,7 +272,8 @@ function refusalResult(type: string, name: string, message: string): FinishResul
|
|
|
271
272
|
* checkout, recorded in its `delivery.yaml` on the pending branch (published with the group,
|
|
272
273
|
* else pushed there alone).
|
|
273
274
|
* - `--confirm-merged` / `--confirm-open` / `--confirm-dropped` — the user's answer for the
|
|
274
|
-
* group's Working Repository delivery,
|
|
275
|
+
* group's Working Repository delivery, else for the repository the group is named after,
|
|
276
|
+
* recorded the same way. One at a time; never with
|
|
275
277
|
* `--all`, `--specs` or `--no-push`.
|
|
276
278
|
* - `--specs [<path>...]` — publish drifted canonical specs as their own publication. Bare, it
|
|
277
279
|
* publishes every drifted spec; with paths, only those. A bare name alongside it is a change
|
|
@@ -501,11 +503,12 @@ export async function runArtifactPublishCommand(
|
|
|
501
503
|
const environment = await deliveryEnvironment();
|
|
502
504
|
if ("error" in environment) return environment.error;
|
|
503
505
|
const answer = refreshOnly ? undefined : confirm;
|
|
504
|
-
const record = (names: string[], edit: DeliveryEdit = {}) =>
|
|
506
|
+
const record = (names: string[], edit: DeliveryEdit = {}, repository?: string) =>
|
|
505
507
|
recordDelivery(
|
|
506
508
|
{ ...environment, companionPath: dir },
|
|
507
509
|
{
|
|
508
510
|
changes: names,
|
|
511
|
+
repository,
|
|
509
512
|
refresh: edit.confirm === undefined && refresh,
|
|
510
513
|
refreshAll: true,
|
|
511
514
|
edit,
|
|
@@ -522,16 +525,30 @@ export async function runArtifactPublishCommand(
|
|
|
522
525
|
}
|
|
523
526
|
}
|
|
524
527
|
if (!answer) return null;
|
|
525
|
-
// The answer is for the Working Repository's delivery
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
528
|
+
// The answer is for the Working Repository's delivery, else, as in the companion or for a
|
|
529
|
+
// group of another repository, for the repository the group is named after; changes
|
|
530
|
+
// without that delivery keep theirs.
|
|
531
|
+
const groupRepository = async (change: string) =>
|
|
532
|
+
(await groupOfChange(dir, change, declaredType)).repository;
|
|
533
|
+
const confirmEach = async (
|
|
534
|
+
repositoryOf: (change: string) => Promise<string | undefined>,
|
|
535
|
+
): Promise<number | string> => {
|
|
536
|
+
let confirmed = 0;
|
|
537
|
+
for (const change of changes) {
|
|
538
|
+
// oxlint-disable-next-line no-await-in-loop -- one record at a time, in group order
|
|
539
|
+
const outcome = await record([change], { confirm: answer }, await repositoryOf(change));
|
|
540
|
+
if (!("refusal" in outcome)) confirmed += 1;
|
|
541
|
+
else if (outcome.refusal.reason !== "no-delivery-branch") {
|
|
542
|
+
return deliveryRefusal([change], outcome.refusal.reason);
|
|
543
|
+
}
|
|
533
544
|
}
|
|
534
|
-
|
|
545
|
+
return confirmed;
|
|
546
|
+
};
|
|
547
|
+
const working = environment.workingRepo;
|
|
548
|
+
const inWorking = Boolean(working?.slug || working?.umbrellaChildren);
|
|
549
|
+
let confirmed = await confirmEach(inWorking ? async () => undefined : groupRepository);
|
|
550
|
+
if (confirmed === 0 && inWorking) confirmed = await confirmEach(groupRepository);
|
|
551
|
+
if (typeof confirmed === "string") return confirmed;
|
|
535
552
|
return confirmed > 0 ? null : deliveryRefusal(changes, "no-delivery-branch");
|
|
536
553
|
};
|
|
537
554
|
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
linkedDeliveryEnvironment,
|
|
5
|
+
type DeliveryEnvironment,
|
|
6
|
+
} from "../../../../lib/delivery/environment";
|
|
3
7
|
import { readDeliveryState, type DeliveryState } from "../../../../lib/delivery/record";
|
|
4
8
|
import {
|
|
5
9
|
discoverSubmitted,
|
|
6
10
|
type DiscoverSubmittedOptions,
|
|
11
|
+
type MergeCheck,
|
|
7
12
|
type MergeClaim,
|
|
8
13
|
type SubmittedChangeView,
|
|
9
14
|
type SubmittedDiscovery,
|
|
@@ -44,12 +49,31 @@ export interface PendingCommandDeps {
|
|
|
44
49
|
) => Promise<SubmittedDiscovery>;
|
|
45
50
|
/** True when the companion's Git mode is `auto`. */
|
|
46
51
|
loadGitAutoMode?: (context: LaunchContext) => Promise<boolean>;
|
|
52
|
+
/** The checkouts linked on this machine that the merge check inspects. */
|
|
53
|
+
deliveryEnvironment?: (
|
|
54
|
+
context: LaunchContext,
|
|
55
|
+
capabilities: CapabilityConfig[],
|
|
56
|
+
) => Promise<DeliveryEnvironment>;
|
|
47
57
|
stdout?: (line: string) => void;
|
|
48
58
|
stderr?: (line: string) => void;
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
/** Presence-only flags; every other `--flag` consumes the following token as its value. */
|
|
52
|
-
const BOOLEAN_FLAGS: BooleanFlagSet = new Set(["json"]);
|
|
62
|
+
const BOOLEAN_FLAGS: BooleanFlagSet = new Set(["json", "no-merge-check"]);
|
|
63
|
+
|
|
64
|
+
/** After this, the merge check starts no further delivery. */
|
|
65
|
+
const MERGE_CHECK_BUDGET_MS = 30_000;
|
|
66
|
+
|
|
67
|
+
function defaultDeliveryEnvironment(
|
|
68
|
+
context: LaunchContext,
|
|
69
|
+
capabilities: CapabilityConfig[],
|
|
70
|
+
): Promise<DeliveryEnvironment> {
|
|
71
|
+
return linkedDeliveryEnvironment(
|
|
72
|
+
context,
|
|
73
|
+
capabilities,
|
|
74
|
+
context.repository?.path ?? process.env.MATE_REPO_PATH,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
53
77
|
|
|
54
78
|
/**
|
|
55
79
|
* Whether `mate artifact publish --all` would publish this entry. Discovery does not know
|
|
@@ -148,7 +172,29 @@ function renderClaim(claim: MergeClaim): string {
|
|
|
148
172
|
: `answered by ${who}, not checked by Git`;
|
|
149
173
|
}
|
|
150
174
|
|
|
175
|
+
/** Deliveries the merge check left unchecked and why it failed; empty when neither. */
|
|
176
|
+
function renderMergeCheck(check: MergeCheck | undefined): string[] {
|
|
177
|
+
if (!check || (check.unchecked.length === 0 && !check.warning)) return [];
|
|
178
|
+
return [
|
|
179
|
+
...(check.unchecked.length > 0
|
|
180
|
+
? [
|
|
181
|
+
"Not checked for a merge on this machine, stored state shown:",
|
|
182
|
+
...check.unchecked.map(
|
|
183
|
+
(entry) =>
|
|
184
|
+
` ${inboxText(entry.change)}: ${inboxText(entry.branch)} in ${inboxText(entry.repository)}`,
|
|
185
|
+
),
|
|
186
|
+
]
|
|
187
|
+
: []),
|
|
188
|
+
...(check.warning ? [`Merge check: ${inboxText(check.warning)}`] : []),
|
|
189
|
+
"",
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
|
|
151
193
|
function renderSubmitted(submitted: SubmittedDiscovery): string[] {
|
|
194
|
+
return [...renderGroups(submitted), ...renderMergeCheck(submitted.mergeCheck)];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function renderGroups(submitted: SubmittedDiscovery): string[] {
|
|
152
198
|
const fetched = submitted.fetchedAt ? `fetched ${submitted.fetchedAt}` : "never fetched";
|
|
153
199
|
const freshness = submitted.stale
|
|
154
200
|
? `last known state, ${fetched}${submitted.error ? `: ${submitted.error}` : ""}`
|
|
@@ -160,7 +206,7 @@ function renderSubmitted(submitted: SubmittedDiscovery): string[] {
|
|
|
160
206
|
return [
|
|
161
207
|
`${count} submitted change${count === 1 ? "" : "s"} on ${submitted.pendingBranch} by Delivery Group (${freshness}):`,
|
|
162
208
|
...submitted.groups.flatMap((group) => [
|
|
163
|
-
` ${inboxText(group.group)}${group.publishable ?
|
|
209
|
+
` ${inboxText(group.group)}${group.publishable ? ` publishable${group.needsRefresh ? " with --refresh" : ""}` : ""}${group.blocked ? " blocked" : ""}`,
|
|
164
210
|
...(group.heldBy.length > 0
|
|
165
211
|
? [` held by unpublished ${group.heldBy.map(inboxText).join(", ")}`]
|
|
166
212
|
: []),
|
|
@@ -170,6 +216,10 @@ function renderSubmitted(submitted: SubmittedDiscovery): string[] {
|
|
|
170
216
|
(part) =>
|
|
171
217
|
` touches ${inboxText(part.capability)} › ${inboxText(part.requirement)}`,
|
|
172
218
|
),
|
|
219
|
+
...(change.found ?? []).map(
|
|
220
|
+
(found) =>
|
|
221
|
+
` merged in ${inboxText(found.repository)}: found by Git on this machine, not recorded yet`,
|
|
222
|
+
),
|
|
173
223
|
...change.merges
|
|
174
224
|
.filter((claim) => !claim.yours)
|
|
175
225
|
.map(
|
|
@@ -216,17 +266,25 @@ function renderHuman(result: PendingResult): string[] {
|
|
|
216
266
|
* the pending branch: `git show <submitted.ref>:<path>/<file>` reads a file of it. Each group
|
|
217
267
|
* carries `publishable`, `blocked` and `heldBy` (unpublished dependencies whose group cannot
|
|
218
268
|
* publish). In Git mode `auto` the default and pending branches are fetched first; otherwise, or
|
|
219
|
-
* when the fetch fails, the last fetched state is reported as `stale`.
|
|
269
|
+
* when the fetch fails, the last fetched state is reported as `stale`. Then each unsettled branch
|
|
270
|
+
* delivery in a repository linked on this machine is checked for a merge by local Git, starting
|
|
271
|
+
* none after 30 s: a proven merge counts in `delivery.status` and `publishable`, is named in the
|
|
272
|
+
* change's `found` and sets its group's `needsRefresh`, since nothing records it and
|
|
273
|
+
* `delivery.record` stays as stored; `submitted.mergeCheck` names the deliveries left `unchecked`,
|
|
274
|
+
* whose stored state stands. In Git mode `auto` the check first fetches the default and delivery
|
|
275
|
+
* branches into the linked checkout, and a recorded pull request's head when the branch and its
|
|
276
|
+
* recorded head are missing there. Separately, `pending` lists archives an earlier Mate left uncommitted, publishable
|
|
220
277
|
* from this checkout only: archived OpenSpec changes whose own files — the archive directory or
|
|
221
278
|
* the active directory archiving deleted — are still uncommitted in the companion working
|
|
222
279
|
* tree, each with the uncommitted canonical specs it applied to, so the publication
|
|
223
280
|
* workflow can offer exact selectable entries instead of parsing OpenSpec prose.
|
|
224
281
|
* Uncommitted specs no pending change accounts for are reported separately, each with the
|
|
225
282
|
* archives whose delta specs name it. Every reported entry carries `coveredByAll`, marking
|
|
226
|
-
* what `mate artifact publish --all` would publish. Read-only
|
|
227
|
-
* nothing is validated, produced, committed, or pushed.
|
|
283
|
+
* what `mate artifact publish --all` would publish. Read-only apart
|
|
284
|
+
* from those fetches: nothing is validated, produced, committed, or pushed.
|
|
228
285
|
* @flags
|
|
229
286
|
* - `--json` — emit a machine-readable {@link PendingResult} instead of human-readable text.
|
|
287
|
+
* - `--no-merge-check` — skip the merge check and report only stored merge results.
|
|
230
288
|
* @remarks No-ops (with a message on stderr) when the openspec capability is disabled for
|
|
231
289
|
* this repo. Exits non-zero only when the companion, launch context, or Git guard rejects.
|
|
232
290
|
*/
|
|
@@ -236,7 +294,9 @@ export async function runArtifactPendingCommand(
|
|
|
236
294
|
): Promise<void> {
|
|
237
295
|
const emitOut = deps.stdout ?? ((line: string) => process.stdout.write(`${line}\n`));
|
|
238
296
|
const emitErr = deps.stderr ?? ((line: string) => process.stderr.write(`${line}\n`));
|
|
239
|
-
const
|
|
297
|
+
const flags = parseFlags(argv, BOOLEAN_FLAGS);
|
|
298
|
+
const json = flags.json === true;
|
|
299
|
+
const mergeCheck = flags["no-merge-check"] !== true;
|
|
240
300
|
|
|
241
301
|
const ensureCompanion = deps.ensureUnambiguousCompanion ?? ensureUnambiguousCompanion;
|
|
242
302
|
if (!(await ensureCompanion(process.cwd()))) {
|
|
@@ -258,7 +318,8 @@ export async function runArtifactPendingCommand(
|
|
|
258
318
|
}
|
|
259
319
|
|
|
260
320
|
const loadCapabilities = deps.loadCapabilities ?? defaultLoadCapabilities;
|
|
261
|
-
|
|
321
|
+
const capabilities = await loadCapabilities(context);
|
|
322
|
+
if (!hasOpenspecCapability(capabilities)) {
|
|
262
323
|
emitErr("mate: the openspec capability must be enabled to list pending artifacts.");
|
|
263
324
|
return;
|
|
264
325
|
}
|
|
@@ -286,11 +347,14 @@ export async function runArtifactPendingCommand(
|
|
|
286
347
|
// The local listing stands on its own; a failed discovery is reported, not fatal.
|
|
287
348
|
// A declared type's submitted changes are listed in place of the built-in type's; an invalid
|
|
288
349
|
// declaration is reported with the discovery.
|
|
350
|
+
const environment = () =>
|
|
351
|
+
(deps.deliveryEnvironment ?? defaultDeliveryEnvironment)(context, capabilities);
|
|
289
352
|
const submitted = await declaredSubmitType(context.companionPath)
|
|
290
353
|
.then((type) =>
|
|
291
354
|
(deps.discoverSubmitted ?? discoverSubmitted)(context.companionPath, {
|
|
292
355
|
fetch: gitAutoMode,
|
|
293
356
|
...(type ? { type } : {}),
|
|
357
|
+
...(mergeCheck ? { checkMerges: { environment, budgetMs: MERGE_CHECK_BUDGET_MS } } : {}),
|
|
294
358
|
}),
|
|
295
359
|
)
|
|
296
360
|
.catch((error: unknown): SubmittedDiscovery => ({
|
|
@@ -19,8 +19,8 @@ interface TokensaveCapDeps {
|
|
|
19
19
|
* runs in. Requires the `tokensave` capability to be enabled
|
|
20
20
|
* in `.mate/config/framework.yaml` and a registered working repo for the
|
|
21
21
|
* current `MATE_REPO_ID`. Ensures the `tokensave` binary is installed in that
|
|
22
|
-
* repo (via {@link ensureTokensaveInstalled}) before forwarding. Never
|
|
23
|
-
* this runs mid-session (e.g. `mate cap index`), and
|
|
22
|
+
* repo (via {@link ensureTokensaveInstalled}) before forwarding. Never checks its version:
|
|
23
|
+
* this runs mid-session (e.g. `mate cap index`), and the check belongs to `mate setup`.
|
|
24
24
|
* @remarks The child process's exit code is propagated via `process.exitCode`.
|
|
25
25
|
*/
|
|
26
26
|
export async function runTokensaveCapCommand(
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type LinkRefreshResult,
|
|
15
15
|
} from "../../../lib/orchestrator/refresh-working-claude-links";
|
|
16
16
|
import type { FrameworkConfig } from "../../../lib/orchestrator/types";
|
|
17
|
+
import { runSkillsCli } from "../../../lib/skills-cli";
|
|
17
18
|
import {
|
|
18
19
|
fetchLatestVersion,
|
|
19
20
|
getCurrentVersion,
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
type CompanionSyncOptions,
|
|
28
29
|
} from "../../../tools/setup";
|
|
29
30
|
import type { ManagedOutputOwner, ManagedOutputReport } from "../../../tools/setup/plugin";
|
|
30
|
-
import { runCommand } from "../../../tools/setup/utils";
|
|
31
31
|
import { confirm } from "../../confirm";
|
|
32
32
|
import { defaultGitOps, type GitOps } from "../artifact/finish/git";
|
|
33
33
|
import { resolveCompanionPath } from "./tui";
|
|
@@ -132,8 +132,7 @@ export const companionUpdateDeps: CompanionUpdateDeps = {
|
|
|
132
132
|
.access(path.join(companionPath, SKILLS_LOCKFILE))
|
|
133
133
|
.then(() => true)
|
|
134
134
|
.catch(() => false),
|
|
135
|
-
runSkillsUpdate: (companionPath) =>
|
|
136
|
-
runCommand("npx", ["skills", "update", "-p", "-y"], { cwd: companionPath }),
|
|
135
|
+
runSkillsUpdate: (companionPath) => runSkillsCli(["update", "-p", "-y"], companionPath),
|
|
137
136
|
createGitOps: (companionPath) => defaultGitOps(companionPath, undefined),
|
|
138
137
|
snapshotPath,
|
|
139
138
|
confirm,
|
|
@@ -6,6 +6,9 @@ import { parse as parseYaml } from "yaml";
|
|
|
6
6
|
|
|
7
7
|
import { FRAMEWORK_NAME } from "../../framework";
|
|
8
8
|
import { gitEnvironment } from "../../runtime/companion-git";
|
|
9
|
+
import { readFrictionView } from "../../lib/friction/view/read";
|
|
10
|
+
import { selectFriction } from "../../lib/friction/view/select";
|
|
11
|
+
import { readFrictionSwitch } from "../../runtime/friction-switch";
|
|
9
12
|
import { checkoutCommonDir, checkoutAt, sameClone } from "../../runtime/git-layout";
|
|
10
13
|
import { physicalPath } from "../../runtime/physical-path";
|
|
11
14
|
import { otherServingClaudeWrapRoot } from "../../runtime/serving-claude-wrap";
|
|
@@ -57,11 +60,15 @@ import { printSection, renderKeyValueTable, renderTable } from "./status";
|
|
|
57
60
|
|
|
58
61
|
interface DoctorDeps {
|
|
59
62
|
globalConfigStore?: GlobalConfigStore;
|
|
63
|
+
/** `false` reports without repairing the repo-local registry, so the evidence stays as found. */
|
|
64
|
+
write?: boolean;
|
|
60
65
|
cwd?: string;
|
|
61
66
|
pathValue?: string;
|
|
62
67
|
/** Returns a member checkout's HEAD commit, or null when unreadable. */
|
|
63
68
|
gitHead?: (memberPath: string) => string | null;
|
|
64
69
|
inspectPlugins?: (companionPath: string) => Promise<PluginInspection>;
|
|
70
|
+
/** Appliance startup: this machine's local plugins neither load nor count. */
|
|
71
|
+
committedPluginsOnly?: boolean;
|
|
65
72
|
/** Loads the companion's declared plugins so their Capabilities contribute. */
|
|
66
73
|
hydratePlugins?: (companionPath: string) => Promise<void>;
|
|
67
74
|
inspectClaudePlugins?: (
|
|
@@ -71,6 +78,8 @@ interface DoctorDeps {
|
|
|
71
78
|
/** Environment `MATE_AUDIENCE` is read from; defaults to the process environment. */
|
|
72
79
|
env?: Record<string, string | undefined>;
|
|
73
80
|
createProgress?: typeof createStartupProgress;
|
|
81
|
+
/** Time the friction window ends at; defaults to now. */
|
|
82
|
+
now?: Date;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
export type DoctorKind = "core" | "working" | "companion" | "hub";
|
|
@@ -130,6 +139,36 @@ export interface DoctorReport {
|
|
|
130
139
|
resolutionFailures: Array<{ companionPath: string; message: string }>;
|
|
131
140
|
/** Present inside a Git Checkout of a linked clone, or a worktree Git no longer recognizes. */
|
|
132
141
|
checkout?: DoctorCheckout;
|
|
142
|
+
/** Present while the Friction Switch is on. */
|
|
143
|
+
friction?: DoctorFriction;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface DoctorFriction {
|
|
147
|
+
days: number;
|
|
148
|
+
events: number;
|
|
149
|
+
top: { fingerprint: string; events: number } | null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const DOCTOR_FRICTION_DAYS = 7;
|
|
153
|
+
|
|
154
|
+
function collectFriction(
|
|
155
|
+
companionPath: string,
|
|
156
|
+
env: Record<string, string | undefined>,
|
|
157
|
+
now?: Date,
|
|
158
|
+
): DoctorFriction {
|
|
159
|
+
const view = readFrictionView(
|
|
160
|
+
{ companion: companionPath },
|
|
161
|
+
{ days: DOCTOR_FRICTION_DAYS, homeDir: env.HOME, now },
|
|
162
|
+
);
|
|
163
|
+
const { groups } = selectFriction(view, { state: "open" });
|
|
164
|
+
let top: DoctorFriction["top"] = null;
|
|
165
|
+
for (const group of groups) {
|
|
166
|
+
if (!top || group.events > top.events) {
|
|
167
|
+
top = { fingerprint: group.fingerprint, events: group.events };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const events = groups.reduce((sum, group) => sum + group.events, 0);
|
|
171
|
+
return { days: DOCTOR_FRICTION_DAYS, events, top };
|
|
133
172
|
}
|
|
134
173
|
|
|
135
174
|
export interface DoctorCheckout {
|
|
@@ -534,7 +573,13 @@ export async function collectDoctorReport(deps: DoctorDeps = {}): Promise<Doctor
|
|
|
534
573
|
/** Doctor reports plugin failures below; hydration supplies their contributions. */
|
|
535
574
|
const hydrate =
|
|
536
575
|
deps.hydratePlugins ??
|
|
537
|
-
((companionPath) =>
|
|
576
|
+
((companionPath) =>
|
|
577
|
+
hydrateDynamicPlugins({
|
|
578
|
+
companionPath,
|
|
579
|
+
env,
|
|
580
|
+
warn: () => {},
|
|
581
|
+
includeLocal: !deps.committedPluginsOnly,
|
|
582
|
+
}));
|
|
538
583
|
await hydrate(root.rootPath);
|
|
539
584
|
const inspectClaudePlugins = deps.inspectClaudePlugins ?? inspectClaudePluginDirectories;
|
|
540
585
|
const inspection = await inspectClaudePlugins(root.rootPath, root.config);
|
|
@@ -544,12 +589,18 @@ export async function collectDoctorReport(deps: DoctorDeps = {}): Promise<Doctor
|
|
|
544
589
|
|
|
545
590
|
if (root.rootPath && root.config) {
|
|
546
591
|
const inspect =
|
|
547
|
-
deps.inspectPlugins ??
|
|
592
|
+
deps.inspectPlugins ??
|
|
593
|
+
((companionPath) =>
|
|
594
|
+
inspectDeclaredPlugins(companionPath, { env, includeLocal: !deps.committedPluginsOnly }));
|
|
548
595
|
const inspection = await inspect(root.rootPath);
|
|
549
596
|
report.pluginFailures = inspection.failures;
|
|
550
597
|
report.pluginCapabilities = inspection.capabilities;
|
|
551
598
|
}
|
|
552
599
|
|
|
600
|
+
if (root.rootPath && readFrictionSwitch(env.HOME)) {
|
|
601
|
+
report.friction = collectFriction(root.rootPath, env, deps.now);
|
|
602
|
+
}
|
|
603
|
+
|
|
553
604
|
return report;
|
|
554
605
|
}
|
|
555
606
|
|
|
@@ -779,6 +830,16 @@ function renderHumanReport(report: DoctorReport): void {
|
|
|
779
830
|
|
|
780
831
|
if (report.checkout) printSection("Checkout", renderCheckout(report.checkout));
|
|
781
832
|
|
|
833
|
+
if (report.friction) {
|
|
834
|
+
const { days, events, top } = report.friction;
|
|
835
|
+
const rows: Array<[string, string]> = [
|
|
836
|
+
[`Events, last ${days} days`, String(events)],
|
|
837
|
+
["Most frequent", top ? `${top.fingerprint} (${top.events})` : "none"],
|
|
838
|
+
];
|
|
839
|
+
if (top) rows.push(["Next action", `${FRAMEWORK_NAME} triage`]);
|
|
840
|
+
printSection("Friction", renderKeyValueTable(rows));
|
|
841
|
+
}
|
|
842
|
+
|
|
782
843
|
printSection(
|
|
783
844
|
"Resolution Failures",
|
|
784
845
|
report.resolutionFailures.length > 0
|
|
@@ -800,7 +861,8 @@ function renderHumanReport(report: DoctorReport): void {
|
|
|
800
861
|
* audience) are verified strictly (installed, loadable); any failure is named
|
|
801
862
|
* on stderr and exits non-zero, as is an undeclared `MATE_AUDIENCE` or a
|
|
802
863
|
* Capability whose runtime contributions fail to load.
|
|
803
|
-
* `--json` emits the same report as one JSON document.
|
|
864
|
+
* `--json` emits the same report as one JSON document. `--frozen-plugins`
|
|
865
|
+
* ignores local plugins, for appliance startup verification.
|
|
804
866
|
*/
|
|
805
867
|
/** One step: the checks run concurrently, so finer steps would finish in arbitrary order. */
|
|
806
868
|
async function collectWithProgress(deps: DoctorDeps): Promise<DoctorReport> {
|
|
@@ -814,7 +876,8 @@ async function collectWithProgress(deps: DoctorDeps): Promise<DoctorReport> {
|
|
|
814
876
|
|
|
815
877
|
export async function runDoctorCommand(argv: string[] = [], deps: DoctorDeps = {}): Promise<void> {
|
|
816
878
|
const json = argv.includes("--json");
|
|
817
|
-
const
|
|
879
|
+
const checkDeps = { ...deps, committedPluginsOnly: argv.includes("--frozen-plugins") };
|
|
880
|
+
const report = json ? await collectDoctorReport(checkDeps) : await collectWithProgress(checkDeps);
|
|
818
881
|
if (json) await writeJsonStdout(report);
|
|
819
882
|
else renderHumanReport(report);
|
|
820
883
|
|