@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.
Files changed (244) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/package.json +5 -4
  3. package/src/cli/commands/artifact/delivery/link.ts +1 -1
  4. package/src/cli/commands/artifact/delivery/output.ts +10 -1
  5. package/src/cli/commands/artifact/delivery/resolve.ts +3 -2
  6. package/src/cli/commands/artifact/delivery/submit.ts +9 -4
  7. package/src/cli/commands/artifact/delivery/take.ts +12 -9
  8. package/src/cli/commands/artifact/finish/command.ts +16 -14
  9. package/src/cli/commands/artifact/finish/engine.ts +8 -8
  10. package/src/cli/commands/artifact/project/command.ts +2 -3
  11. package/src/cli/commands/companion/hub.ts +11 -6
  12. package/src/cli/commands/companion/link.ts +173 -46
  13. package/src/cli/commands/doctor.ts +17 -0
  14. package/src/cli/commands/report/contract.ts +0 -17
  15. package/src/cli/commands/studio/access.ts +4 -0
  16. package/src/cli/commands/studio/actions.ts +35 -2
  17. package/src/cli/commands/studio/mcp-manager.ts +162 -0
  18. package/src/cli/commands/studio/routes.ts +12 -0
  19. package/src/cli/commands/studio/selection.ts +44 -11
  20. package/src/cli/commands/studio/server.ts +246 -2
  21. package/src/cli/commands/studio/services.ts +26 -0
  22. package/src/cli/commands/studio/terminal-launch.ts +21 -4
  23. package/src/cli/commands/studio/terminal.ts +3 -14
  24. package/src/cli/commands/studio/work-requests.ts +9 -0
  25. package/src/cli/commands/studio/work.ts +473 -0
  26. package/src/cli/commands/vscode/release-vsix.json +2 -2
  27. package/src/cli/commands/working/cleanup.ts +1 -18
  28. package/src/cli/companion-link-wizard.tsx +158 -91
  29. package/src/cli/usage.ts +1 -1
  30. package/src/create-mate.ts +4 -1
  31. package/src/lib/agent-credential.ts +131 -0
  32. package/src/lib/credential-kinds.ts +7 -0
  33. package/src/lib/delivery/merge-git.ts +16 -0
  34. package/src/lib/delivery/record-delivery.ts +12 -6
  35. package/src/lib/delivery/record.ts +5 -0
  36. package/src/lib/delivery/refresh.ts +34 -6
  37. package/src/lib/delivery/staging/refs.ts +9 -4
  38. package/src/lib/delivery/staging/submit.ts +81 -22
  39. package/src/lib/mcp-manager/resolve.ts +88 -0
  40. package/src/lib/mcp-manager/store.ts +133 -0
  41. package/src/lib/mcp-manager/types.ts +72 -0
  42. package/src/lib/mcp-manager/validate.ts +242 -0
  43. package/src/lib/opencode-server.ts +2 -17
  44. package/src/lib/orchestrator/config-store.ts +30 -7
  45. package/src/lib/orchestrator/engine-floor.ts +16 -4
  46. package/src/lib/orchestrator/engine-guard.ts +7 -1
  47. package/src/lib/orchestrator/repo-local-store.ts +14 -0
  48. package/src/lib/orchestrator/repository-link.ts +80 -52
  49. package/src/lib/orchestrator/root-context.ts +17 -1
  50. package/src/lib/orchestrator/types.ts +4 -0
  51. package/src/lib/studio-chat/agent.ts +139 -0
  52. package/src/lib/studio-chat/companion-context.ts +136 -0
  53. package/src/lib/studio-chat/credential.ts +79 -0
  54. package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
  55. package/src/lib/studio-chat/host-sandbox.ts +578 -0
  56. package/src/lib/studio-chat/prepare-bridges.ts +95 -0
  57. package/src/lib/studio-chat/session.ts +15 -0
  58. package/src/lib/studio-chat/turns.ts +112 -0
  59. package/src/lib/workset/claims.ts +85 -0
  60. package/src/lib/workset/execution.ts +71 -0
  61. package/src/lib/workset/git-transaction.ts +74 -0
  62. package/src/lib/workset/groups.ts +176 -0
  63. package/src/lib/workset/inventory.ts +196 -0
  64. package/src/lib/workset/projection.ts +237 -0
  65. package/src/lib/workset/record.ts +101 -36
  66. package/src/lib/workset/repositories.ts +24 -0
  67. package/src/lib/workset/sharing.ts +951 -0
  68. package/src/lib/workset/stages.ts +50 -14
  69. package/src/lib/workset/transactions.ts +158 -0
  70. package/src/runtime/companion-git-state.ts +1 -0
  71. package/src/runtime/companion-guidance.ts +2 -2
  72. package/src/runtime/forge-remote.ts +6 -0
  73. package/src/runtime/host-process.ts +28 -0
  74. package/src/runtime/secret-guard.ts +18 -1
  75. package/src/runtime/secret-patterns.ts +4 -3
  76. package/src/runtime/submitted-arrivals.ts +28 -2
  77. package/src/runtime/workflow/turn.ts +14 -12
  78. package/src/runtime/write-atomic.ts +2 -2
  79. package/src/studio.ts +61 -0
  80. package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
  81. package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
  82. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
  83. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
  84. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
  85. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
  86. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
  87. package/src/tools/setup/capabilities/mcp-manager.ts +73 -0
  88. package/src/tools/setup/context-services.ts +35 -6
  89. package/src/tools/setup/dynamic-plugins/audiences.ts +3 -2
  90. package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
  91. package/src/tools/setup/engine.ts +55 -3
  92. package/src/tools/setup/plugin.ts +14 -0
  93. package/src/tools/setup/plugins/gitignore.ts +1 -0
  94. package/src/tools/setup/providers/claude-format.ts +40 -7
  95. package/src/tools/setup/providers/claude.ts +38 -3
  96. package/src/tools/setup/providers/opencode-format.ts +13 -3
  97. package/src/tools/setup/providers/opencode.ts +7 -18
  98. package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
  99. package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
  100. package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
  101. package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
  102. package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
  103. package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
  104. package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
  105. package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
  106. package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
  107. package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
  108. package/studio-dist/client/assets/{companion-view-C_N237bf.js → companion-view-B54_Lj0S.js} +1 -1
  109. package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
  110. package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
  111. package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
  112. package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-CAszmdDJ.js} +1 -1
  113. package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
  114. package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
  115. package/studio-dist/client/assets/{graph-canvas-ySGKMhmk.js → graph-canvas-BdNk2F9O.js} +1 -1
  116. package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
  117. package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
  118. package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
  119. package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
  120. package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-CJ8JsLb7.js} +1 -1
  121. package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
  122. package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
  123. package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
  124. package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
  125. package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
  126. package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-sD_LlrDN.js} +1 -1
  127. package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-COL925ML.js} +1 -1
  128. package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
  129. package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
  130. package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
  131. package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
  132. package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
  133. package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
  134. package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
  135. package/studio-dist/client/assets/{specs-BrCOjOch.js → specs-C_tZnAvF.js} +1 -1
  136. package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
  137. package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
  138. package/studio-dist/client/assets/{store-C3vJq8Wj.js → store-pY9gU4uS.js} +1 -1
  139. package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
  140. package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
  141. package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
  142. package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
  143. package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
  144. package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
  145. package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
  146. package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
  147. package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
  148. package/studio-dist/client/assets/{warnings-CqOOGlPD.js → warnings-D7YY1HSG.js} +1 -1
  149. package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
  150. package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
  151. package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
  152. package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
  153. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-gVfW5vIV.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
  154. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
  155. package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
  156. package/studio-dist/server/assets/{cn-FXJAM0KO.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
  157. package/studio-dist/server/assets/{button-D6bvrFmm.js → button-BqA1urbl.js} +14 -7
  158. package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
  159. package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
  160. package/studio-dist/server/assets/{combobox-D2MbYV1O.js → combobox-iTjvPCtS.js} +7 -6
  161. package/studio-dist/server/assets/{companion-view-Mf1ANbMb.js → companion-view-DIQ6AFIY.js} +2 -2
  162. package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-aVwjRL8j.js} +1 -1
  163. package/studio-dist/server/assets/{fields-B4mAPETz.js → fields-BMap2_Ju.js} +10 -3
  164. package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BER50hoD.js} +2 -2
  165. package/studio-dist/server/assets/{friction-9a5S1m7U.js → friction-BPs9KWdq.js} +8 -8
  166. package/studio-dist/server/assets/{getting-started-RU6tYU2Q.js → getting-started-DGfRVmZ_.js} +2 -2
  167. package/studio-dist/server/assets/{getting-started._topic-C02HGrC6.js → getting-started._topic-BgrBA4Vj.js} +2 -2
  168. package/studio-dist/server/assets/{getting-started.index-EzLRosbb.js → getting-started.index-BaFfQ9Mn.js} +2 -2
  169. package/studio-dist/server/assets/{graph-CZ2H9Fzr.js → graph-Cgzlrv3P.js} +8 -8
  170. package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DODpuOy_.js} +1 -1
  171. package/studio-dist/server/assets/{graph-canvas-rP5TT14Z.js → graph-canvas-DW_zU1nA.js} +2 -2
  172. package/studio-dist/server/assets/{guides-BGftp4wf.js → guides-CA_EMG7E.js} +1 -1
  173. package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-D0SpoD32.js} +1 -1
  174. package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-DJjQuy03.js} +1 -1
  175. package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
  176. package/studio-dist/server/assets/{markdown-view-CArpV-CS.js → markdown-view-CvVBGMZV.js} +1 -1
  177. package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
  178. package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
  179. package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
  180. package/studio-dist/server/assets/{panel-DR0iq46J.js → panel-D1K6Bsux.js} +4 -32
  181. package/studio-dist/server/assets/{plugins._service._view-n7u2k5dF.js → plugins._service._view-DdO1nELF.js} +4 -4
  182. package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BB3dwSmz.js} +1 -1
  183. package/studio-dist/server/assets/{queries-D-yVP9i0.js → queries-BwiDxQy5.js} +1 -1
  184. package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
  185. package/studio-dist/server/assets/{reports-C2SmTgqh.js → reports-9Pr7Bz6o.js} +7 -7
  186. package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-Cc9M3phM.js} +1 -1
  187. package/studio-dist/server/assets/{router-CPt0TAk_.js → router-DcWe0J7Y.js} +827 -548
  188. package/studio-dist/server/assets/{routes-CwH8LEy2.js → routes-BEXxl0py.js} +8 -8
  189. package/studio-dist/server/assets/{search-b-yQesv3.js → search-bltT7gwy.js} +39 -7
  190. package/studio-dist/server/assets/{select-C3i6TTX-.js → select-CZvHgGCi.js} +7 -6
  191. package/studio-dist/server/assets/{shell-CagqZZMZ.js → shell-BQ0vMKXN.js} +13 -4
  192. package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Be_52h0i.js} +1 -1
  193. package/studio-dist/server/assets/{skills-C21Mg_8-.js → skills-BpGGUl6L.js} +8 -8
  194. package/studio-dist/server/assets/{specs-DetoMiaB.js → specs-CCGgXE-V.js} +5 -5
  195. package/studio-dist/server/assets/{specs-view-CmbfLDwN.js → specs-view-DtL5JxYM.js} +12 -11
  196. package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-BWFSO6dM.js} +1 -1
  197. package/studio-dist/server/assets/{store-aC-I6f6o.js → store-X7yLPp7v.js} +1 -1
  198. package/studio-dist/server/assets/{studio-queries-Dqf-3nzj.js → studio-queries-ur1ygXi3.js} +117 -13
  199. package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-qzH-UETC.js} +1555 -179
  200. package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-C1o0DLzS.js} +1 -1
  201. package/studio-dist/server/assets/{usage-CS4CBK9D.js → usage-DWbSPrPD.js} +10 -9
  202. package/studio-dist/server/assets/{useAnchoredPopupScrollLock-BjMNgXv9.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
  203. package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
  204. package/studio-dist/server/assets/{useMutation-DpBIuWXt.js → useMutation-NjlA8oFY.js} +2 -2
  205. package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
  206. package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
  207. package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-B_kfi1h-.js} +1 -1
  208. package/studio-dist/server/assets/{vault-DVQidlId.js → vault-dL79JlKH.js} +8 -115
  209. package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-BSGH56lb.js} +3 -3
  210. package/studio-dist/server/assets/{warnings-C7hgXpdk.js → warnings-DtUVPV-k.js} +2 -2
  211. package/studio-dist/server/assets/work-D789VXGH.js +110 -0
  212. package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
  213. package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
  214. package/studio-dist/server/assets/{workflow-6dZZ1ofw.js → workflow-BOZ2sRYg.js} +9 -9
  215. package/studio-dist/server/server.js +3 -3
  216. package/wrappers/bin/openspec +87 -2
  217. package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
  218. package/studio-dist/client/assets/button-amJ3g5oD.js +0 -1
  219. package/studio-dist/client/assets/cn-BQPKiwI4.js +0 -1
  220. package/studio-dist/client/assets/combobox-CJ7aGFid.js +0 -1
  221. package/studio-dist/client/assets/fields-BAiGkJ5N.js +0 -1
  222. package/studio-dist/client/assets/friction-DqOU59v7.js +0 -1
  223. package/studio-dist/client/assets/getting-started-yp42dj5S.js +0 -1
  224. package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +0 -1
  225. package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +0 -1
  226. package/studio-dist/client/assets/graph-BYaD_5Bq.js +0 -2
  227. package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
  228. package/studio-dist/client/assets/index-Qx7reRPD.js +0 -40
  229. package/studio-dist/client/assets/panel-C4bf_h2W.js +0 -1
  230. package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +0 -1
  231. package/studio-dist/client/assets/reports-JFSwSueq.js +0 -1
  232. package/studio-dist/client/assets/routes-BdOWSgzK.js +0 -1
  233. package/studio-dist/client/assets/search-CXosfvYh.js +0 -1
  234. package/studio-dist/client/assets/select-BHYYWPhK.js +0 -1
  235. package/studio-dist/client/assets/skills-Bo9FLsBd.js +0 -1
  236. package/studio-dist/client/assets/specs-view-CdE2rlli.js +0 -1
  237. package/studio-dist/client/assets/steps-CKUno4lh.js +0 -1
  238. package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
  239. package/studio-dist/client/assets/studio-queries-BflKt9va.js +0 -2
  240. package/studio-dist/client/assets/usage-BLsLy0nN.js +0 -55
  241. package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +0 -1
  242. package/studio-dist/client/assets/useMutation-uJUrejsi.js +0 -1
  243. package/studio-dist/client/assets/vault-BB1B_OhR.js +0 -1
  244. package/studio-dist/client/assets/workflow-BFzmI-06.js +0 -1
@@ -1,7 +1,9 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
3
 
4
- import type { McpEntryDescriptor } from "./claude-format";
4
+ import { mcpEntryEnvironment, mcpEntryHeaders, type McpEntryDescriptor } from "./claude-format";
5
+
6
+ const openCodeRef = (variable: string) => `{env:${variable}}`;
5
7
 
6
8
  // OpenCode V2 config format primitives, plus the one-time V1-to-V2 normalization
7
9
  // used while reconciling an existing companion config. This module owns file
@@ -299,12 +301,20 @@ export function mergeOpenCodeConfigContent(
299
301
  /** Map a provider-agnostic MCP descriptor to OpenCode V2's server entry shape. */
300
302
  export function toOpenCodeMcpEntry(descriptor: McpEntryDescriptor): Record<string, unknown> {
301
303
  if (descriptor.url) {
302
- return { type: "remote", url: descriptor.url, disabled: false };
304
+ // OpenCode picks the remote transport itself, so `transport` is not rendered.
305
+ const headers = mcpEntryHeaders(descriptor, openCodeRef);
306
+ return {
307
+ type: "remote",
308
+ url: descriptor.url,
309
+ ...(headers ? { headers } : {}),
310
+ disabled: false,
311
+ };
303
312
  }
313
+ const environment = mcpEntryEnvironment(descriptor, openCodeRef);
304
314
  return {
305
315
  type: "local",
306
316
  command: [descriptor.command ?? "", ...(descriptor.args ?? [])].filter(Boolean),
307
- ...(descriptor.env ? { environment: descriptor.env } : {}),
317
+ ...(environment ? { environment } : {}),
308
318
  disabled: false,
309
319
  };
310
320
  }
@@ -39,6 +39,7 @@ import {
39
39
  writeOpenCodeConfig,
40
40
  type OpenCodeConfig,
41
41
  } from "./opencode-format";
42
+ import { relativePathWarnings } from "./relative-path-warnings";
42
43
  import { getSetupProvidersRoot, getSetupRootTemplates } from "./utils";
43
44
 
44
45
  const COMPANION_GITIGNORE_ENTRIES = [".opencode/service.json"];
@@ -602,19 +603,6 @@ export async function renderOpenCodeWorkingDocuments(
602
603
  /** Keys Mate renders its own regions for; the companion's values join those regions. */
603
604
  const MATE_OPENCODE_KEYS = new Set(["plugins", "permissions", "skills", "mcp", "references"]);
604
605
 
605
- function relativePathValues(value: unknown, at: string[]): string[] {
606
- if (typeof value === "string") {
607
- return value.startsWith("./") || value.startsWith("../") ? [at.join(".")] : [];
608
- }
609
- if (Array.isArray(value)) {
610
- return value.flatMap((entry, index) => relativePathValues(entry, [...at, String(index)]));
611
- }
612
- if (isRecord(value)) {
613
- return Object.entries(value).flatMap(([key, entry]) => relativePathValues(entry, [...at, key]));
614
- }
615
- return [];
616
- }
617
-
618
606
  /** Replaces the region at `at` with what `merge` builds from it, or appends one. */
619
607
  function upsertRegion(
620
608
  regions: ManagedRegion[],
@@ -689,11 +677,12 @@ async function mergeCompanionOpenCodeConfig(
689
677
  mergeMapRegion(regions, ["references"], resolveReferences(value, companionDir));
690
678
  continue;
691
679
  }
692
- for (const at of relativePathValues(value, [key])) {
693
- warnings.push(
694
- `${companionConfigPath}: ${at} is a relative path, which resolves against the working repository once merged into ${OPENCODE_CONFIG_DOCUMENT}; use an absolute path.`,
695
- );
696
- }
680
+ warnings.push(
681
+ ...relativePathWarnings(companionConfigPath, value, [key], {
682
+ document: OPENCODE_CONFIG_DOCUMENT,
683
+ resolvesAgainst: "the working repository",
684
+ }),
685
+ );
697
686
  if (MATE_OPENCODE_KEYS.has(key)) {
698
687
  if (key === "mcp" && isRecord(value) && isRecord(value.servers)) {
699
688
  mergeMapRegion(regions, [...OPENCODE_MCP_SERVERS_AT], value.servers);
@@ -0,0 +1,26 @@
1
+ /** Dotted key path of each string under `value` that starts with `./` or `../`. */
2
+ function relativePathValues(value: unknown, at: string[]): string[] {
3
+ if (typeof value === "string") {
4
+ return value.startsWith("./") || value.startsWith("../") ? [at.join(".")] : [];
5
+ }
6
+ if (Array.isArray(value)) {
7
+ return value.flatMap((entry, index) => relativePathValues(entry, [...at, String(index)]));
8
+ }
9
+ if (typeof value === "object" && value !== null) {
10
+ return Object.entries(value).flatMap(([key, entry]) => relativePathValues(entry, [...at, key]));
11
+ }
12
+ return [];
13
+ }
14
+
15
+ /** One wrap warning per relative path under `value`; a fold reports them, never rewrites. */
16
+ export function relativePathWarnings(
17
+ configPath: string,
18
+ value: unknown,
19
+ at: string[],
20
+ target: { document: string; resolvesAgainst: string },
21
+ ): string[] {
22
+ return relativePathValues(value, at).map(
23
+ (keyPath) =>
24
+ `${configPath}: ${keyPath} is a relative path, which resolves against ${target.resolvesAgainst} once merged into ${target.document}; use an absolute path.`,
25
+ );
26
+ }
@@ -0,0 +1,297 @@
1
+ # Third-party notices
2
+
3
+ Mate is MIT licensed (see `LICENSE`). This file lists third-party software that Mate's
4
+ packages redistribute, with the notices their licenses require.
5
+
6
+ The list covers Studio's Analysis chat: the packages it bundles into Studio and the AI
7
+ Elements components adapted into `packages/mate-studio/src/components/ai-elements`. The full
8
+ inventory of what the Studio bundle carries, each package with its license text, is written by
9
+ the build beside it: `studio-dist/client/THIRD-PARTY-LICENSES.md` and
10
+ `studio-dist/server/THIRD-PARTY-LICENSES.md`.
11
+
12
+ ## Apache License 2.0
13
+
14
+ None of these ships a `NOTICE` file. The license text is under
15
+ [Apache License, Version 2.0](#apache-license-version-20) below.
16
+
17
+ ### AI SDK: `ai`, `@ai-sdk/react`, `@ai-sdk/mcp`, `@ai-sdk/provider`, `@ai-sdk/provider-utils`
18
+
19
+ - Source: https://github.com/vercel/ai
20
+ - Copyright 2023 Vercel, Inc.
21
+
22
+ ### Streamdown: `streamdown`
23
+
24
+ - Source: https://github.com/vercel/streamdown
25
+ - Copyright 2023 Vercel, Inc.
26
+
27
+ ### AI Elements (adapted source, not an npm dependency)
28
+
29
+ - Source: https://github.com/vercel/ai-elements
30
+ - Copyright 2023 Vercel, Inc.
31
+ - Changed for Studio. Each adapted file names its changes in its header.
32
+
33
+ ## MIT License
34
+
35
+ ### `use-stick-to-bottom`
36
+
37
+ - Source: https://github.com/stackblitz-labs/use-stick-to-bottom
38
+
39
+ ```
40
+ MIT License
41
+
42
+ Copyright (c) 2024 - present StackBlitz
43
+
44
+ Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ of this software and associated documentation files (the "Software"), to deal
46
+ in the Software without restriction, including without limitation the rights
47
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ copies of the Software, and to permit persons to whom the Software is
49
+ furnished to do so, subject to the following conditions:
50
+
51
+ The above copyright notice and this permission notice shall be included in all
52
+ copies or substantial portions of the Software.
53
+
54
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ SOFTWARE.
61
+ ```
62
+
63
+ ### `pkce-challenge`
64
+
65
+ - Source: https://github.com/crouchcd/pkce-challenge
66
+ - Pulled in by `@ai-sdk/mcp`.
67
+
68
+ ```
69
+ MIT License
70
+
71
+ Copyright (c) 2019
72
+
73
+ Permission is hereby granted, free of charge, to any person obtaining a copy
74
+ of this software and associated documentation files (the "Software"), to deal
75
+ in the Software without restriction, including without limitation the rights
76
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77
+ copies of the Software, and to permit persons to whom the Software is
78
+ furnished to do so, subject to the following conditions:
79
+
80
+ The above copyright notice and this permission notice shall be included in all
81
+ copies or substantial portions of the Software.
82
+
83
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
86
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
88
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
89
+ SOFTWARE.
90
+ ```
91
+
92
+ ## Apache License, Version 2.0
93
+
94
+ ```
95
+
96
+ Apache License
97
+ Version 2.0, January 2004
98
+ http://www.apache.org/licenses/
99
+
100
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
101
+
102
+ 1. Definitions.
103
+
104
+ "License" shall mean the terms and conditions for use, reproduction,
105
+ and distribution as defined by Sections 1 through 9 of this document.
106
+
107
+ "Licensor" shall mean the copyright owner or entity authorized by
108
+ the copyright owner that is granting the License.
109
+
110
+ "Legal Entity" shall mean the union of the acting entity and all
111
+ other entities that control, are controlled by, or are under common
112
+ control with that entity. For the purposes of this definition,
113
+ "control" means (i) the power, direct or indirect, to cause the
114
+ direction or management of such entity, whether by contract or
115
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
116
+ outstanding shares, or (iii) beneficial ownership of such entity.
117
+
118
+ "You" (or "Your") shall mean an individual or Legal Entity
119
+ exercising permissions granted by this License.
120
+
121
+ "Source" form shall mean the preferred form for making modifications,
122
+ including but not limited to software source code, documentation
123
+ source, and configuration files.
124
+
125
+ "Object" form shall mean any form resulting from mechanical
126
+ transformation or translation of a Source form, including but
127
+ not limited to compiled object code, generated documentation,
128
+ and conversions to other media types.
129
+
130
+ "Work" shall mean the work of authorship, whether in Source or
131
+ Object form, made available under the License, as indicated by a
132
+ copyright notice that is included in or attached to the work
133
+ (an example is provided in the Appendix below).
134
+
135
+ "Derivative Works" shall mean any work, whether in Source or Object
136
+ form, that is based on (or derived from) the Work and for which the
137
+ editorial revisions, annotations, elaborations, or other modifications
138
+ represent, as a whole, an original work of authorship. For the purposes
139
+ of this License, Derivative Works shall not include works that remain
140
+ separable from, or merely link (or bind by name) to the interfaces of,
141
+ the Work and Derivative Works thereof.
142
+
143
+ "Contribution" shall mean any work of authorship, including
144
+ the original version of the Work and any modifications or additions
145
+ to that Work or Derivative Works thereof, that is intentionally
146
+ submitted to Licensor for inclusion in the Work by the copyright owner
147
+ or by an individual or Legal Entity authorized to submit on behalf of
148
+ the copyright owner. For the purposes of this definition, "submitted"
149
+ means any form of electronic, verbal, or written communication sent
150
+ to the Licensor or its representatives, including but not limited to
151
+ communication on electronic mailing lists, source code control systems,
152
+ and issue tracking systems that are managed by, or on behalf of, the
153
+ Licensor for the purpose of discussing and improving the Work, but
154
+ excluding communication that is conspicuously marked or otherwise
155
+ designated in writing by the copyright owner as "Not a Contribution."
156
+
157
+ "Contributor" shall mean Licensor and any individual or Legal Entity
158
+ on behalf of whom a Contribution has been received by Licensor and
159
+ subsequently incorporated within the Work.
160
+
161
+ 2. Grant of Copyright License. Subject to the terms and conditions of
162
+ this License, each Contributor hereby grants to You a perpetual,
163
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
164
+ copyright license to reproduce, prepare Derivative Works of,
165
+ publicly display, publicly perform, sublicense, and distribute the
166
+ Work and such Derivative Works in Source or Object form.
167
+
168
+ 3. Grant of Patent License. Subject to the terms and conditions of
169
+ this License, each Contributor hereby grants to You a perpetual,
170
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
171
+ (except as stated in this section) patent license to make, have made,
172
+ use, offer to sell, sell, import, and otherwise transfer the Work,
173
+ where such license applies only to those patent claims licensable
174
+ by such Contributor that are necessarily infringed by their
175
+ Contribution(s) alone or by combination of their Contribution(s)
176
+ with the Work to which such Contribution(s) was submitted. If You
177
+ institute patent litigation against any entity (including a
178
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
179
+ or a Contribution incorporated within the Work constitutes direct
180
+ or contributory patent infringement, then any patent licenses
181
+ granted to You under this License for that Work shall terminate
182
+ as of the date such litigation is filed.
183
+
184
+ 4. Redistribution. You may reproduce and distribute copies of the
185
+ Work or Derivative Works thereof in any medium, with or without
186
+ modifications, and in Source or Object form, provided that You
187
+ meet the following conditions:
188
+
189
+ (a) You must give any other recipients of the Work or
190
+ Derivative Works a copy of this License; and
191
+
192
+ (b) You must cause any modified files to carry prominent notices
193
+ stating that You changed the files; and
194
+
195
+ (c) You must retain, in the Source form of any Derivative Works
196
+ that You distribute, all copyright, patent, trademark, and
197
+ attribution notices from the Source form of the Work,
198
+ excluding those notices that do not pertain to any part of
199
+ the Derivative Works; and
200
+
201
+ (d) If the Work includes a "NOTICE" text file as part of its
202
+ distribution, then any Derivative Works that You distribute must
203
+ include a readable copy of the attribution notices contained
204
+ within such NOTICE file, excluding those notices that do not
205
+ pertain to any part of the Derivative Works, in at least one
206
+ of the following places: within a NOTICE text file distributed
207
+ as part of the Derivative Works; within the Source form or
208
+ documentation, if provided along with the Derivative Works; or,
209
+ within a display generated by the Derivative Works, if and
210
+ wherever such third-party notices normally appear. The contents
211
+ of the NOTICE file are for informational purposes only and
212
+ do not modify the License. You may add Your own attribution
213
+ notices within Derivative Works that You distribute, alongside
214
+ or as an addendum to the NOTICE text from the Work, provided
215
+ that such additional attribution notices cannot be construed
216
+ as modifying the License.
217
+
218
+ You may add Your own copyright statement to Your modifications and
219
+ may provide additional or different license terms and conditions
220
+ for use, reproduction, or distribution of Your modifications, or
221
+ for any such Derivative Works as a whole, provided Your use,
222
+ reproduction, and distribution of the Work otherwise complies with
223
+ the conditions stated in this License.
224
+
225
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
226
+ any Contribution intentionally submitted for inclusion in the Work
227
+ by You to the Licensor shall be under the terms and conditions of
228
+ this License, without any additional terms or conditions.
229
+ Notwithstanding the above, nothing herein shall supersede or modify
230
+ the terms of any separate license agreement you may have executed
231
+ with Licensor regarding such Contributions.
232
+
233
+ 6. Trademarks. This License does not grant permission to use the trade
234
+ names, trademarks, service marks, or product names of the Licensor,
235
+ except as required for reasonable and customary use in describing the
236
+ origin of the Work and reproducing the content of the NOTICE file.
237
+
238
+ 7. Disclaimer of Warranty. Unless required by applicable law or
239
+ agreed to in writing, Licensor provides the Work (and each
240
+ Contributor provides its Contributions) on an "AS IS" BASIS,
241
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
242
+ implied, including, without limitation, any warranties or conditions
243
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
244
+ PARTICULAR PURPOSE. You are solely responsible for determining the
245
+ appropriateness of using or redistributing the Work and assume any
246
+ risks associated with Your exercise of permissions under this License.
247
+
248
+ 8. Limitation of Liability. In no event and under no legal theory,
249
+ whether in tort (including negligence), contract, or otherwise,
250
+ unless required by applicable law (such as deliberate and grossly
251
+ negligent acts) or agreed to in writing, shall any Contributor be
252
+ liable to You for damages, including any direct, indirect, special,
253
+ incidental, or consequential damages of any character arising as a
254
+ result of this License or out of the use or inability to use the
255
+ Work (including but not limited to damages for loss of goodwill,
256
+ work stoppage, computer failure or malfunction, or any and all
257
+ other commercial damages or losses), even if such Contributor
258
+ has been advised of the possibility of such damages.
259
+
260
+ 9. Accepting Warranty or Additional Liability. While redistributing
261
+ the Work or Derivative Works thereof, You may choose to offer,
262
+ and charge a fee for, acceptance of support, warranty, indemnity,
263
+ or other liability obligations and/or rights consistent with this
264
+ License. However, in accepting such obligations, You may act only
265
+ on Your own behalf and on Your sole responsibility, not on behalf
266
+ of any other Contributor, and only if You agree to indemnify,
267
+ defend, and hold each Contributor harmless for any liability
268
+ incurred by, or claims asserted against, such Contributor by reason
269
+ of your accepting any such warranty or additional liability.
270
+
271
+ END OF TERMS AND CONDITIONS
272
+
273
+ APPENDIX: How to apply the Apache License to your work.
274
+
275
+ To apply the Apache License to your work, attach the following
276
+ boilerplate notice, with the fields enclosed by brackets "[]"
277
+ replaced with your own identifying information. (Don't include
278
+ the brackets!) The text should be enclosed in the appropriate
279
+ comment syntax for the file format. We also recommend that a
280
+ file or class name and description of purpose be included on the
281
+ same "printed page" as the copyright notice for easier
282
+ identification within third-party archives.
283
+
284
+ Copyright [yyyy] [name of copyright owner]
285
+
286
+ Licensed under the Apache License, Version 2.0 (the "License");
287
+ you may not use this file except in compliance with the License.
288
+ You may obtain a copy of the License at
289
+
290
+ http://www.apache.org/licenses/LICENSE-2.0
291
+
292
+ Unless required by applicable law or agreed to in writing, software
293
+ distributed under the License is distributed on an "AS IS" BASIS,
294
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
+ See the License for the specific language governing permissions and
296
+ limitations under the License.
297
+ ```