@uniqbit/mate-core 1.0.0-canary.8 → 1.0.0
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 +5 -4
- package/src/cli/commands/artifact/delivery/link.ts +1 -1
- package/src/cli/commands/artifact/delivery/output.ts +10 -1
- package/src/cli/commands/artifact/delivery/resolve.ts +3 -2
- package/src/cli/commands/artifact/delivery/submit.ts +9 -4
- package/src/cli/commands/artifact/delivery/take.ts +12 -9
- package/src/cli/commands/artifact/finish/command.ts +16 -14
- package/src/cli/commands/artifact/finish/engine.ts +8 -8
- package/src/cli/commands/artifact/project/command.ts +2 -3
- package/src/cli/commands/companion/hub.ts +11 -6
- package/src/cli/commands/companion/link.ts +173 -46
- package/src/cli/commands/doctor.ts +17 -0
- package/src/cli/commands/report/contract.ts +0 -17
- package/src/cli/commands/studio/access.ts +4 -0
- package/src/cli/commands/studio/actions.ts +35 -2
- package/src/cli/commands/studio/mcp-manager.ts +162 -0
- package/src/cli/commands/studio/routes.ts +12 -0
- package/src/cli/commands/studio/selection.ts +44 -11
- package/src/cli/commands/studio/server.ts +246 -2
- package/src/cli/commands/studio/services.ts +26 -0
- package/src/cli/commands/studio/terminal-launch.ts +21 -4
- package/src/cli/commands/studio/terminal.ts +3 -14
- package/src/cli/commands/studio/work-requests.ts +9 -0
- package/src/cli/commands/studio/work.ts +473 -0
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/commands/working/cleanup.ts +1 -18
- package/src/cli/companion-link-wizard.tsx +158 -91
- package/src/cli/usage.ts +1 -1
- package/src/create-mate.ts +4 -1
- package/src/lib/agent-credential.ts +131 -0
- package/src/lib/credential-kinds.ts +7 -0
- package/src/lib/delivery/merge-git.ts +16 -0
- package/src/lib/delivery/record-delivery.ts +12 -6
- package/src/lib/delivery/record.ts +5 -0
- package/src/lib/delivery/refresh.ts +34 -6
- package/src/lib/delivery/staging/refs.ts +9 -4
- package/src/lib/delivery/staging/submit.ts +81 -22
- package/src/lib/mcp-manager/resolve.ts +88 -0
- package/src/lib/mcp-manager/store.ts +133 -0
- package/src/lib/mcp-manager/types.ts +72 -0
- package/src/lib/mcp-manager/validate.ts +242 -0
- package/src/lib/opencode-server.ts +2 -17
- package/src/lib/orchestrator/config-store.ts +30 -7
- package/src/lib/orchestrator/engine-floor.ts +16 -4
- package/src/lib/orchestrator/engine-guard.ts +7 -1
- package/src/lib/orchestrator/repo-local-store.ts +14 -0
- package/src/lib/orchestrator/repository-link.ts +80 -52
- package/src/lib/orchestrator/root-context.ts +17 -1
- package/src/lib/orchestrator/types.ts +4 -0
- package/src/lib/studio-chat/agent.ts +139 -0
- package/src/lib/studio-chat/companion-context.ts +136 -0
- package/src/lib/studio-chat/credential.ts +79 -0
- package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
- package/src/lib/studio-chat/host-sandbox.ts +578 -0
- package/src/lib/studio-chat/prepare-bridges.ts +95 -0
- package/src/lib/studio-chat/session.ts +15 -0
- package/src/lib/studio-chat/turns.ts +112 -0
- package/src/lib/workset/claims.ts +85 -0
- package/src/lib/workset/execution.ts +71 -0
- package/src/lib/workset/git-transaction.ts +74 -0
- package/src/lib/workset/groups.ts +176 -0
- package/src/lib/workset/inventory.ts +196 -0
- package/src/lib/workset/projection.ts +237 -0
- package/src/lib/workset/record.ts +101 -36
- package/src/lib/workset/repositories.ts +24 -0
- package/src/lib/workset/sharing.ts +951 -0
- package/src/lib/workset/stages.ts +50 -14
- package/src/lib/workset/transactions.ts +158 -0
- package/src/runtime/companion-git-state.ts +1 -0
- package/src/runtime/companion-guidance.ts +2 -2
- package/src/runtime/forge-remote.ts +6 -0
- package/src/runtime/host-process.ts +28 -0
- package/src/runtime/secret-guard.ts +18 -1
- package/src/runtime/secret-patterns.ts +4 -3
- package/src/runtime/submitted-arrivals.ts +28 -2
- package/src/runtime/workflow/turn.ts +14 -12
- package/src/runtime/write-atomic.ts +2 -2
- package/src/studio.ts +61 -0
- package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
- package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
- package/src/tools/setup/capabilities/mcp-manager.ts +73 -0
- package/src/tools/setup/context-services.ts +35 -6
- package/src/tools/setup/dynamic-plugins/audiences.ts +3 -2
- package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
- package/src/tools/setup/engine.ts +55 -3
- package/src/tools/setup/plugin.ts +14 -0
- package/src/tools/setup/plugins/gitignore.ts +1 -0
- package/src/tools/setup/providers/claude-format.ts +40 -7
- package/src/tools/setup/providers/claude.ts +38 -3
- package/src/tools/setup/providers/opencode-format.ts +13 -3
- package/src/tools/setup/providers/opencode.ts +7 -18
- package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
- package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
- package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
- package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
- package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
- package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
- package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
- package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
- package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
- package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
- package/studio-dist/client/assets/{companion-view-C_N237bf.js → companion-view-B54_Lj0S.js} +1 -1
- package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
- package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
- package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
- package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-CAszmdDJ.js} +1 -1
- package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
- package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
- package/studio-dist/client/assets/{graph-canvas-ySGKMhmk.js → graph-canvas-BdNk2F9O.js} +1 -1
- package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
- package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
- package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
- package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
- package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-CJ8JsLb7.js} +1 -1
- package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
- package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
- package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
- package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
- package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-sD_LlrDN.js} +1 -1
- package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-COL925ML.js} +1 -1
- package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
- package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
- package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
- package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
- package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
- package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
- package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
- package/studio-dist/client/assets/{specs-BrCOjOch.js → specs-C_tZnAvF.js} +1 -1
- package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
- package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
- package/studio-dist/client/assets/{store-C3vJq8Wj.js → store-pY9gU4uS.js} +1 -1
- package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
- package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
- package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
- package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
- package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
- package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
- package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
- package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
- package/studio-dist/client/assets/{warnings-CqOOGlPD.js → warnings-D7YY1HSG.js} +1 -1
- package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
- package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
- package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
- package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-gVfW5vIV.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
- package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
- package/studio-dist/server/assets/{cn-FXJAM0KO.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
- package/studio-dist/server/assets/{button-D6bvrFmm.js → button-BqA1urbl.js} +14 -7
- package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
- package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
- package/studio-dist/server/assets/{combobox-D2MbYV1O.js → combobox-iTjvPCtS.js} +7 -6
- package/studio-dist/server/assets/{companion-view-Mf1ANbMb.js → companion-view-DIQ6AFIY.js} +2 -2
- package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-aVwjRL8j.js} +1 -1
- package/studio-dist/server/assets/{fields-B4mAPETz.js → fields-BMap2_Ju.js} +10 -3
- package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BER50hoD.js} +2 -2
- package/studio-dist/server/assets/{friction-9a5S1m7U.js → friction-BPs9KWdq.js} +8 -8
- package/studio-dist/server/assets/{getting-started-RU6tYU2Q.js → getting-started-DGfRVmZ_.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-C02HGrC6.js → getting-started._topic-BgrBA4Vj.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-EzLRosbb.js → getting-started.index-BaFfQ9Mn.js} +2 -2
- package/studio-dist/server/assets/{graph-CZ2H9Fzr.js → graph-Cgzlrv3P.js} +8 -8
- package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DODpuOy_.js} +1 -1
- package/studio-dist/server/assets/{graph-canvas-rP5TT14Z.js → graph-canvas-DW_zU1nA.js} +2 -2
- package/studio-dist/server/assets/{guides-BGftp4wf.js → guides-CA_EMG7E.js} +1 -1
- package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-D0SpoD32.js} +1 -1
- package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-DJjQuy03.js} +1 -1
- package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
- package/studio-dist/server/assets/{markdown-view-CArpV-CS.js → markdown-view-CvVBGMZV.js} +1 -1
- package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
- package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
- package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
- package/studio-dist/server/assets/{panel-DR0iq46J.js → panel-D1K6Bsux.js} +4 -32
- package/studio-dist/server/assets/{plugins._service._view-n7u2k5dF.js → plugins._service._view-DdO1nELF.js} +4 -4
- package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BB3dwSmz.js} +1 -1
- package/studio-dist/server/assets/{queries-D-yVP9i0.js → queries-BwiDxQy5.js} +1 -1
- package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
- package/studio-dist/server/assets/{reports-C2SmTgqh.js → reports-9Pr7Bz6o.js} +7 -7
- package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-Cc9M3phM.js} +1 -1
- package/studio-dist/server/assets/{router-CPt0TAk_.js → router-DcWe0J7Y.js} +827 -548
- package/studio-dist/server/assets/{routes-CwH8LEy2.js → routes-BEXxl0py.js} +8 -8
- package/studio-dist/server/assets/{search-b-yQesv3.js → search-bltT7gwy.js} +39 -7
- package/studio-dist/server/assets/{select-C3i6TTX-.js → select-CZvHgGCi.js} +7 -6
- package/studio-dist/server/assets/{shell-CagqZZMZ.js → shell-BQ0vMKXN.js} +13 -4
- package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Be_52h0i.js} +1 -1
- package/studio-dist/server/assets/{skills-C21Mg_8-.js → skills-BpGGUl6L.js} +8 -8
- package/studio-dist/server/assets/{specs-DetoMiaB.js → specs-CCGgXE-V.js} +5 -5
- package/studio-dist/server/assets/{specs-view-CmbfLDwN.js → specs-view-DtL5JxYM.js} +12 -11
- package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-BWFSO6dM.js} +1 -1
- package/studio-dist/server/assets/{store-aC-I6f6o.js → store-X7yLPp7v.js} +1 -1
- package/studio-dist/server/assets/{studio-queries-Dqf-3nzj.js → studio-queries-ur1ygXi3.js} +117 -13
- package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-qzH-UETC.js} +1555 -179
- package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-C1o0DLzS.js} +1 -1
- package/studio-dist/server/assets/{usage-CS4CBK9D.js → usage-DWbSPrPD.js} +10 -9
- package/studio-dist/server/assets/{useAnchoredPopupScrollLock-BjMNgXv9.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
- package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
- package/studio-dist/server/assets/{useMutation-DpBIuWXt.js → useMutation-NjlA8oFY.js} +2 -2
- package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
- package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
- package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-B_kfi1h-.js} +1 -1
- package/studio-dist/server/assets/{vault-DVQidlId.js → vault-dL79JlKH.js} +8 -115
- package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-BSGH56lb.js} +3 -3
- package/studio-dist/server/assets/{warnings-C7hgXpdk.js → warnings-DtUVPV-k.js} +2 -2
- package/studio-dist/server/assets/work-D789VXGH.js +110 -0
- package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
- package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
- package/studio-dist/server/assets/{workflow-6dZZ1ofw.js → workflow-BOZ2sRYg.js} +9 -9
- package/studio-dist/server/server.js +3 -3
- package/wrappers/bin/openspec +87 -2
- package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
- package/studio-dist/client/assets/button-amJ3g5oD.js +0 -1
- package/studio-dist/client/assets/cn-BQPKiwI4.js +0 -1
- package/studio-dist/client/assets/combobox-CJ7aGFid.js +0 -1
- package/studio-dist/client/assets/fields-BAiGkJ5N.js +0 -1
- package/studio-dist/client/assets/friction-DqOU59v7.js +0 -1
- package/studio-dist/client/assets/getting-started-yp42dj5S.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +0 -1
- package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +0 -1
- package/studio-dist/client/assets/graph-BYaD_5Bq.js +0 -2
- package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
- package/studio-dist/client/assets/index-Qx7reRPD.js +0 -40
- package/studio-dist/client/assets/panel-C4bf_h2W.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +0 -1
- package/studio-dist/client/assets/reports-JFSwSueq.js +0 -1
- package/studio-dist/client/assets/routes-BdOWSgzK.js +0 -1
- package/studio-dist/client/assets/search-CXosfvYh.js +0 -1
- package/studio-dist/client/assets/select-BHYYWPhK.js +0 -1
- package/studio-dist/client/assets/skills-Bo9FLsBd.js +0 -1
- package/studio-dist/client/assets/specs-view-CdE2rlli.js +0 -1
- package/studio-dist/client/assets/steps-CKUno4lh.js +0 -1
- package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
- package/studio-dist/client/assets/studio-queries-BflKt9va.js +0 -2
- package/studio-dist/client/assets/usage-BLsLy0nN.js +0 -55
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +0 -1
- package/studio-dist/client/assets/useMutation-uJUrejsi.js +0 -1
- package/studio-dist/client/assets/vault-BB1B_OhR.js +0 -1
- package/studio-dist/client/assets/workflow-BFzmI-06.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniqbit/mate-core",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Core framework and plugin APIs for Mate.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"format:check": "oxfmt src/ opencode-plugin/ claude-capability-plugins/ \"!**/*.generated.*\" --check"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@ai-sdk/harness": "1.0.
|
|
57
|
-
"@ai-sdk/harness-claude-code": "1.0.
|
|
56
|
+
"@ai-sdk/harness": "1.0.183",
|
|
57
|
+
"@ai-sdk/harness-claude-code": "1.0.187",
|
|
58
|
+
"@ai-sdk/harness-opencode": "1.0.186",
|
|
58
59
|
"@fission-ai/openspec": "1.15.0",
|
|
59
60
|
"@opencode/plugin": "^2.0.23",
|
|
60
61
|
"@secretlint/core": "13.0.7",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
68
69
|
"@xterm/addon-web-links": "^0.12.0",
|
|
69
70
|
"@xterm/xterm": "^6.0.0",
|
|
70
|
-
"ai": "7.0.
|
|
71
|
+
"ai": "7.0.172",
|
|
71
72
|
"ink": "^7.1.0",
|
|
72
73
|
"jsonc-parser": "^3.3.1",
|
|
73
74
|
"marked": "^18.1.1",
|
|
@@ -94,7 +94,7 @@ function renderHuman(result: LinkResult): string[] {
|
|
|
94
94
|
* `--not-applicable`; refused unless the openspec capability sets `ticket: jira`.
|
|
95
95
|
* - `--refresh` — check each recorded branch in its checkout linked on this machine: a merge
|
|
96
96
|
* commit or a default-branch commit containing its head records it merged; anything else is
|
|
97
|
-
* an outcome needing an answer (`answerReason`: `likely-merged`, `not-on-default`,
|
|
97
|
+
* an outcome needing an answer (`answerReason`: `likely-merged`, `empty-branch`, `not-on-default`,
|
|
98
98
|
* `branch-deleted`, `no-checkout`, `direct`).
|
|
99
99
|
* - `--fetch` — with `--refresh`, fetch the default and delivery branches and list the
|
|
100
100
|
* remote's pull refs first even when the companion's Git mode is not `auto`.
|
|
@@ -53,6 +53,12 @@ export function renderOutcome(outcome: BranchOutcome): string[] {
|
|
|
53
53
|
lines.push(
|
|
54
54
|
` ${outcome.branch}: likely merged (${style}, ${commit.slice(0, 12)}); needs your confirmation`,
|
|
55
55
|
);
|
|
56
|
+
} else if (outcome.answerReason === "empty-branch") {
|
|
57
|
+
lines.push(
|
|
58
|
+
` ${outcome.branch}: has no commits of its own, so nothing of it is merged; needs an answer`,
|
|
59
|
+
);
|
|
60
|
+
} else if (outcome.answerReason === "not-on-default" && outcome.fetch?.branchUnpushed) {
|
|
61
|
+
lines.push(` ${outcome.branch}: never pushed and not on the default branch; needs an answer`);
|
|
56
62
|
} else if (outcome.answerReason === "not-on-default" && outcome.fetch?.branchDeleted) {
|
|
57
63
|
lines.push(
|
|
58
64
|
` ${outcome.branch}: deleted on the remote and its commits are not on this machine, so Git cannot check it; needs an answer`,
|
|
@@ -102,7 +108,10 @@ export function sharedRefusalMessage(
|
|
|
102
108
|
return `mate: ${refusal.change} records ${refusal.delivery} for ${refusal.repository}; a ticket does not replace it, pass --branch to relink.`;
|
|
103
109
|
}
|
|
104
110
|
if (refusal.reason === "uncommitted-work") {
|
|
105
|
-
return `mate: ${refusal.change} is not submitted: ${refusal.branch}
|
|
111
|
+
return `mate: ${refusal.change} is not submitted: ${refusal.branch} counts or is suggested as merged in ${refusal.repository}, but ${refusal.worktree} holds uncommitted changes to tracked files. Commit or stash them, then submit again.`;
|
|
112
|
+
}
|
|
113
|
+
if (refusal.reason === "empty-delivery-branch") {
|
|
114
|
+
return `mate: ${refusal.change} is not submitted: ${refusal.branch} has no commits of its own in ${refusal.repository}, so it delivers nothing. Commit the work on ${refusal.branch} first, or record the repository as not applicable with --repository ${refusal.repository} --not-applicable "<reason>", then submit again.`;
|
|
106
115
|
}
|
|
107
116
|
if (refusal.reason === "protected-branch") {
|
|
108
117
|
return `mate: ${refusal.branch} is a protected branch (${refusal.protection}); record it only as an explicit direct delivery with --direct.`;
|
|
@@ -96,6 +96,7 @@ export async function runArtifactResolveCommand(
|
|
|
96
96
|
const result: ResolveResult = await (artifactType
|
|
97
97
|
? resolve(companionPath, change, parts, { artifactType })
|
|
98
98
|
: resolve(companionPath, change, parts));
|
|
99
|
-
if (result.status === "refused")
|
|
100
|
-
|
|
99
|
+
if (result.status === "refused") refuse(result.message);
|
|
100
|
+
if (flags.json === true) emitOut(JSON.stringify(result));
|
|
101
|
+
else if (result.status !== "refused") emitOut(result.message);
|
|
101
102
|
}
|
|
@@ -117,9 +117,11 @@ export async function runArtifactSubmitCommand(
|
|
|
117
117
|
...deps,
|
|
118
118
|
...(environment.artifactType ? { artifactType: environment.artifactType } : {}),
|
|
119
119
|
});
|
|
120
|
-
|
|
120
|
+
for (const result of dropped) {
|
|
121
|
+
if (result.status === "refused") refuse(result.message);
|
|
122
|
+
else if (!json) emitOut(result.message);
|
|
123
|
+
}
|
|
121
124
|
if (json) emitOut(JSON.stringify(dropped));
|
|
122
|
-
else for (const result of dropped) emitOut(result.message);
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
127
|
if ([branch !== undefined, notApplicable !== undefined, skip].filter(Boolean).length > 1) {
|
|
@@ -160,7 +162,10 @@ export async function runArtifactSubmitCommand(
|
|
|
160
162
|
for (const result of results) {
|
|
161
163
|
for (const diagnostic of result.diagnostics) emitErr(`warning: ${diagnostic}`);
|
|
162
164
|
}
|
|
163
|
-
|
|
165
|
+
for (const result of results) {
|
|
166
|
+
const failed = result.status === "failed";
|
|
167
|
+
if (failed) refuse(json ? result.message : null);
|
|
168
|
+
if (!json) for (const line of renderHuman(result)) (failed ? emitErr : emitOut)(line);
|
|
169
|
+
}
|
|
164
170
|
if (json) emitOut(JSON.stringify(results));
|
|
165
|
-
else for (const result of results) for (const line of renderHuman(result)) emitOut(line);
|
|
166
171
|
}
|
|
@@ -14,14 +14,16 @@ const BOOLEAN_FLAGS: BooleanFlagSet = new Set(["json"]);
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @command mate artifact take <change>
|
|
17
|
-
* @description Takes a
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* @description Takes a change from the pending branch into this checkout: a submitted one to
|
|
18
|
+
* revise it, or one Studio's Work shared to continue it. Fetches the pending branch and writes
|
|
19
|
+
* the change's folder as it is there to `openspec/changes/<change>/`, untracked, recorded as
|
|
20
|
+
* pushed from this checkout. `mate artifact submit <change>` then pushes the revised folder
|
|
21
|
+
* again. Nothing is pushed and the pending branch is not changed.
|
|
21
22
|
* @flags
|
|
22
23
|
* - `--json` — emit a {@link TakeResult}.
|
|
23
|
-
* @remarks Refused, exiting non-zero, when the checkout
|
|
24
|
-
*
|
|
24
|
+
* @remarks Refused, exiting non-zero, when the checkout holds a folder of that name changed
|
|
25
|
+
* since this checkout last pushed or took it (an unchanged one is replaced), or the pending
|
|
26
|
+
* branch does not hold the change.
|
|
25
27
|
*/
|
|
26
28
|
export async function runArtifactTakeCommand(
|
|
27
29
|
argv: string[],
|
|
@@ -31,7 +33,7 @@ export async function runArtifactTakeCommand(
|
|
|
31
33
|
const flags = parseFlags(argv, BOOLEAN_FLAGS);
|
|
32
34
|
const [change, ...extra] = positionalArgs(argv, BOOLEAN_FLAGS);
|
|
33
35
|
if (!change || extra.length > 0 || !isChangeName(change)) {
|
|
34
|
-
return refuse("mate: artifact take requires one
|
|
36
|
+
return refuse("mate: artifact take requires one change name.");
|
|
35
37
|
}
|
|
36
38
|
const environment = await resolveDeliveryEnvironment(deps);
|
|
37
39
|
if ("error" in environment) return refuse(environment.error);
|
|
@@ -40,6 +42,7 @@ export async function runArtifactTakeCommand(
|
|
|
40
42
|
const result: TakeResult = await (artifactType
|
|
41
43
|
? take(companionPath, change, { artifactType })
|
|
42
44
|
: take(companionPath, change));
|
|
43
|
-
if (result.status === "refused")
|
|
44
|
-
|
|
45
|
+
if (result.status === "refused") refuse(result.message);
|
|
46
|
+
if (flags.json === true) emitOut(JSON.stringify(result));
|
|
47
|
+
else if (result.status !== "refused") emitOut(result.message);
|
|
45
48
|
}
|
|
@@ -427,16 +427,19 @@ export async function runArtifactPublishCommand(
|
|
|
427
427
|
);
|
|
428
428
|
} catch (err) {
|
|
429
429
|
const message = `mate: publish Git guard rejected the target: ${String(err)}`;
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
emitErr(message);
|
|
431
|
+
if (json) {
|
|
432
|
+
const refusal = refusalResult(type, positionals[0] ?? "", message);
|
|
433
|
+
emitOut(JSON.stringify(allMode ? [refusal] : refusal));
|
|
434
|
+
}
|
|
432
435
|
process.exitCode = 1;
|
|
433
436
|
return;
|
|
434
437
|
}
|
|
435
438
|
|
|
436
439
|
const now = deps.now ?? (() => new Date());
|
|
437
440
|
/**
|
|
438
|
-
* Under `--all --json` the array is the whole
|
|
439
|
-
*
|
|
441
|
+
* Under `--all --json` the array is the whole stdout, so per-publication stdout is suppressed;
|
|
442
|
+
* stderr still names each failure as it happens.
|
|
440
443
|
*/
|
|
441
444
|
const quiet = allMode && json;
|
|
442
445
|
const scanPublicationFn = deps.scanPublication ?? scanPublication;
|
|
@@ -444,7 +447,7 @@ export async function runArtifactPublishCommand(
|
|
|
444
447
|
git,
|
|
445
448
|
json: !allMode && json,
|
|
446
449
|
stdout: quiet ? (): void => {} : emitOut,
|
|
447
|
-
stderr:
|
|
450
|
+
stderr: emitErr,
|
|
448
451
|
secretScan: (commitPaths: string[]) => scanPublicationFn(context.companionPath, commitPaths),
|
|
449
452
|
};
|
|
450
453
|
|
|
@@ -467,7 +470,7 @@ export async function runArtifactPublishCommand(
|
|
|
467
470
|
environment,
|
|
468
471
|
deps.deliveryEnvironment ?? {},
|
|
469
472
|
);
|
|
470
|
-
if (settled.warning
|
|
473
|
+
if (settled.warning) emitErr(`mate: ${settled.warning}`);
|
|
471
474
|
return settled.recorded.length > 0;
|
|
472
475
|
})());
|
|
473
476
|
|
|
@@ -677,9 +680,10 @@ export async function runArtifactPublishCommand(
|
|
|
677
680
|
const runSpecs = async (requested: string[]): Promise<FinishResult | null> => {
|
|
678
681
|
const drift = await resolveDriftedSpecs(context.companionPath, git, requested);
|
|
679
682
|
if (!drift.ok) {
|
|
680
|
-
|
|
683
|
+
const refusal = refusalResult(type, "--specs", drift.message);
|
|
684
|
+
printFinishResult(refusal, engineDeps);
|
|
681
685
|
process.exitCode = 1;
|
|
682
|
-
return
|
|
686
|
+
return refusal;
|
|
683
687
|
}
|
|
684
688
|
if (drift.paths.length === 0) return null;
|
|
685
689
|
const makeSpecsFinisher = deps.specsFinisher ?? openspecSpecsFinisher;
|
|
@@ -708,7 +712,7 @@ export async function runArtifactPublishCommand(
|
|
|
708
712
|
for (const group of queue.groups) {
|
|
709
713
|
// oxlint-disable-next-line no-await-in-loop -- publications push one after another
|
|
710
714
|
const result = await publishGroup(group, true);
|
|
711
|
-
|
|
715
|
+
printFinishResult(result, engineDeps);
|
|
712
716
|
results.push(result);
|
|
713
717
|
// A group waiting on a merge, a dependency or a publisher does not stop the others.
|
|
714
718
|
if (result.status === "held" || result.status === "awaiting-publisher") continue;
|
|
@@ -739,7 +743,7 @@ export async function runArtifactPublishCommand(
|
|
|
739
743
|
finishContext.holdCache,
|
|
740
744
|
);
|
|
741
745
|
if (hold) {
|
|
742
|
-
|
|
746
|
+
emitErr(hold);
|
|
743
747
|
results.push(nothingToPublish(entry.anchor, hold));
|
|
744
748
|
continue;
|
|
745
749
|
}
|
|
@@ -763,10 +767,8 @@ export async function runArtifactPublishCommand(
|
|
|
763
767
|
if (specResult) results.push(specResult);
|
|
764
768
|
if (blocked) process.exitCode = 1;
|
|
765
769
|
|
|
766
|
-
await
|
|
767
|
-
|
|
768
|
-
if (json) emitOut(JSON.stringify(results));
|
|
769
|
-
else if (results.length === 0) emitOut("Nothing to publish.");
|
|
770
|
+
await stop();
|
|
771
|
+
if (!json && results.length === 0) emitOut("Nothing to publish.");
|
|
770
772
|
return;
|
|
771
773
|
}
|
|
772
774
|
|
|
@@ -101,18 +101,18 @@ export interface EngineDeps {
|
|
|
101
101
|
printResult?: boolean;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Prints a result: the message on stdout when it succeeded, stderr otherwise; with `json`, the
|
|
106
|
+
* JSON document on stdout, plus the message on stderr otherwise.
|
|
107
|
+
*/
|
|
105
108
|
export function printFinishResult(
|
|
106
109
|
result: FinishResult,
|
|
107
110
|
out: Pick<EngineDeps, "json" | "stdout" | "stderr">,
|
|
108
111
|
): void {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
} else {
|
|
114
|
-
out.stderr(result.message);
|
|
115
|
-
}
|
|
112
|
+
const succeeded = result.status === "ok" || result.status === "skipped";
|
|
113
|
+
if (!succeeded) out.stderr(result.message);
|
|
114
|
+
if (out.json) out.stdout(JSON.stringify(result));
|
|
115
|
+
else if (succeeded) out.stdout(result.message);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/** The publication commit's message: subject, then its `Mate-*` trailers. */
|
|
@@ -41,7 +41,7 @@ export async function runArtifactProjectCommand(
|
|
|
41
41
|
argv: string[],
|
|
42
42
|
deps: ProjectCommandDeps = {},
|
|
43
43
|
): Promise<void> {
|
|
44
|
-
const { emitOut,
|
|
44
|
+
const { emitOut, refuse } = commandOutput(deps);
|
|
45
45
|
const flags = parseFlags(argv, BOOLEAN_FLAGS);
|
|
46
46
|
const [change, ...extra] = positionalArgs(argv, BOOLEAN_FLAGS);
|
|
47
47
|
if (!change || extra.length > 0) {
|
|
@@ -53,8 +53,7 @@ export async function runArtifactProjectCommand(
|
|
|
53
53
|
const result = await (deps.project ?? projectChange)(environment.companionPath, change, {
|
|
54
54
|
fetch: environment.gitAutoMode === true,
|
|
55
55
|
});
|
|
56
|
-
if (result.status !== "ok")
|
|
56
|
+
if (result.status !== "ok") refuse(result.message);
|
|
57
57
|
if (flags.json === true) emitOut(JSON.stringify(result));
|
|
58
58
|
else if (result.status === "ok") for (const line of renderHuman(result)) emitOut(line);
|
|
59
|
-
else emitErr(result.message);
|
|
60
59
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "../../../lib/orchestrator/companion-hub";
|
|
10
10
|
import { GlobalConfigStore } from "../../../lib/orchestrator/global-config-store";
|
|
11
11
|
import { writeJsonStdout } from "../../write-json-stdout";
|
|
12
|
+
import { commandOutput } from "../artifact/delivery/output";
|
|
12
13
|
|
|
13
14
|
function positionalArgs(argv: string[]): string[] {
|
|
14
15
|
const values: string[] = [];
|
|
@@ -71,16 +72,20 @@ async function runHubAdd(argv: string[]): Promise<void> {
|
|
|
71
72
|
async function runHubSync(argv: string[]): Promise<void> {
|
|
72
73
|
const results = await syncHub(process.cwd());
|
|
73
74
|
const plugins = await updateHubPlugins(process.cwd());
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const json = argv.includes("--json");
|
|
76
|
+
if (json) await writeJsonStdout({ companions: results, plugins }, { space: 0 });
|
|
77
|
+
const { emitOut, refuse } = commandOutput({});
|
|
78
|
+
const report = (failed: boolean, line: string): void => {
|
|
79
|
+
if (failed) refuse(line);
|
|
80
|
+
else if (!json) emitOut(line);
|
|
81
|
+
};
|
|
82
|
+
for (const result of results) {
|
|
83
|
+
report(result.status === "failed", `${result.id}: ${result.status} (${result.message})`);
|
|
77
84
|
}
|
|
78
|
-
for (const result of results) console.log(`${result.id}: ${result.status} (${result.message})`);
|
|
79
85
|
for (const plugin of plugins) {
|
|
80
86
|
const detail = plugin.status === "failed" ? `: ${plugin.error ?? "failed"}` : "";
|
|
81
|
-
|
|
87
|
+
report(plugin.status === "failed", `hub plugin ${plugin.package}: ${plugin.status}${detail}`);
|
|
82
88
|
}
|
|
83
|
-
if (plugins.some((plugin) => plugin.status === "failed")) process.exitCode = 1;
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
export async function runHubCommand(argv: string[]): Promise<void> {
|