@uniqbit/mate-core 0.20.0 → 0.21.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 (286) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
  3. package/claude-plugin/hooks/hooks.json +10 -1
  4. package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
  5. package/opencode-plugin/src/server.ts +9 -2
  6. package/package.json +2 -1
  7. package/src/cli/commands/artifact/delivery/environment.ts +28 -8
  8. package/src/cli/commands/artifact/delivery/link.ts +28 -9
  9. package/src/cli/commands/artifact/delivery/output.ts +7 -0
  10. package/src/cli/commands/companion/update.ts +2 -19
  11. package/src/cli/commands/factory/factory.ts +11 -1
  12. package/src/cli/commands/install.ts +47 -36
  13. package/src/cli/commands/launch/claude.ts +2 -0
  14. package/src/cli/commands/launch/shared.ts +33 -6
  15. package/src/cli/commands/plugin/install.ts +27 -11
  16. package/src/cli/commands/report/index.ts +180 -184
  17. package/src/cli/commands/report/markdown.ts +67 -72
  18. package/src/cli/commands/shared/companion-selection.ts +3 -1
  19. package/src/cli/commands/studio/access.ts +6 -14
  20. package/src/cli/commands/studio/areas.ts +112 -33
  21. package/src/cli/commands/studio/companion-add.ts +87 -0
  22. package/src/cli/commands/studio/companion-removal.ts +15 -8
  23. package/src/cli/commands/studio/factory-credential.ts +1 -15
  24. package/src/cli/commands/studio/factory-git-tokens.ts +40 -0
  25. package/src/cli/commands/studio/factory-relay.ts +18 -0
  26. package/src/cli/commands/studio/graph-model.ts +61 -0
  27. package/src/cli/commands/studio/graph.ts +336 -0
  28. package/src/cli/commands/studio/index.ts +4 -4
  29. package/src/cli/commands/studio/payload.ts +42 -15
  30. package/src/cli/commands/studio/repository-add.ts +116 -0
  31. package/src/cli/commands/studio/routes.ts +6 -0
  32. package/src/cli/commands/studio/selection.ts +12 -3
  33. package/src/cli/commands/studio/server.ts +127 -5
  34. package/src/cli/commands/studio/services.ts +40 -0
  35. package/src/cli/commands/studio/terminal.ts +45 -3
  36. package/src/cli/commands/studio/views/vault/markdown-tree.ts +84 -3
  37. package/src/cli/commands/studio/workset-session.ts +47 -14
  38. package/src/cli/commands/unwrap.ts +3 -0
  39. package/src/cli/commands/update.ts +2 -0
  40. package/src/cli/commands/vscode/release-vsix.json +4 -0
  41. package/src/cli/commands/vscode/setup.ts +71 -13
  42. package/src/cli/commands/vscode/vsix.ts +48 -7
  43. package/src/cli/commands/working/cleanup.ts +40 -8
  44. package/src/cli/commands/working/worktree.ts +176 -35
  45. package/src/cli/main.ts +17 -2
  46. package/src/cli/usage.ts +1 -1
  47. package/src/hooks/rtk-worktree-git.ts +48 -0
  48. package/src/hooks/validate-artifact-path.ts +38 -7
  49. package/src/lib/delivery/branch-template.ts +122 -0
  50. package/src/lib/delivery/branches.ts +21 -16
  51. package/src/lib/delivery/checkout.ts +102 -0
  52. package/src/lib/delivery/environment.ts +2 -0
  53. package/src/lib/delivery/merge-git.ts +13 -1
  54. package/src/lib/delivery/record-delivery.ts +83 -29
  55. package/src/lib/delivery/record.ts +15 -3
  56. package/src/lib/delivery/resolve-branch.ts +157 -110
  57. package/src/lib/factory/attach-client.ts +11 -1
  58. package/src/lib/factory/broker.ts +37 -40
  59. package/src/lib/factory/client.ts +22 -1
  60. package/src/lib/factory/clone-url.ts +39 -0
  61. package/src/lib/factory/command.ts +21 -5
  62. package/src/lib/factory/git-auth.ts +61 -0
  63. package/src/lib/factory/git-credential-store.ts +181 -0
  64. package/src/lib/factory/ids.ts +12 -2
  65. package/src/lib/factory/outcomes/actions.ts +20 -4
  66. package/src/lib/factory/outcomes/index.ts +77 -11
  67. package/src/lib/factory/outcomes/lifecycle.ts +9 -2
  68. package/src/lib/factory/outcomes/sessions.ts +23 -1
  69. package/src/lib/factory/prepare.ts +9 -3
  70. package/src/lib/factory/runner/scheduler.ts +96 -14
  71. package/src/lib/factory/runner/workflow.ts +5 -1
  72. package/src/lib/factory/runtime.ts +143 -43
  73. package/src/lib/orchestrator/companion-hub.ts +6 -1
  74. package/src/lib/orchestrator/engine-floor.ts +48 -0
  75. package/src/lib/orchestrator/launcher.ts +34 -1
  76. package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
  77. package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
  78. package/src/lib/orchestrator/projection-claude-links.ts +32 -8
  79. package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
  80. package/src/lib/orchestrator/projection-entries.ts +22 -18
  81. package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
  82. package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
  83. package/src/lib/orchestrator/projection-types.ts +28 -1
  84. package/src/lib/orchestrator/refresh-working-claude-links.ts +3 -1
  85. package/src/lib/orchestrator/session-prepare.ts +6 -1
  86. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  87. package/src/lib/orchestrator/types.ts +4 -0
  88. package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
  89. package/src/lib/orchestrator/working-repo-projection.ts +24 -4
  90. package/src/lib/orchestrator/wrap-pass.ts +1 -0
  91. package/src/lib/public-npm.ts +95 -50
  92. package/src/lib/session-state.ts +72 -2
  93. package/src/lib/update-checker.ts +7 -1
  94. package/src/lib/usage/aggregate.ts +202 -0
  95. package/src/lib/usage/cache.ts +87 -0
  96. package/src/lib/usage/claude-pricing.ts +71 -0
  97. package/src/lib/usage/claude.ts +189 -0
  98. package/src/lib/usage/collect.ts +56 -0
  99. package/src/lib/usage/opencode.ts +188 -0
  100. package/src/lib/usage/records.ts +80 -0
  101. package/src/lib/usage/rtk-database.ts +72 -0
  102. package/src/lib/usage/savings.ts +209 -0
  103. package/src/lib/usage/scope.ts +182 -0
  104. package/src/lib/usage/source.ts +102 -0
  105. package/src/lib/usage/types.ts +143 -0
  106. package/src/lib/usage/window.ts +37 -0
  107. package/src/lib/workset/factory-local.ts +157 -0
  108. package/src/lib/workset/record.ts +25 -11
  109. package/src/lib/workset/repositories.ts +118 -25
  110. package/src/lib/workset/worktree-include.ts +161 -0
  111. package/src/lib/workset/worktree-index.ts +6 -2
  112. package/src/lib/workset/worktree.ts +591 -101
  113. package/src/opencode/companion-hooks.ts +46 -8
  114. package/src/opencode/companion-policy.ts +18 -5
  115. package/src/opencode/enter-worktree.ts +254 -6
  116. package/src/opencode/session-register.ts +2 -2
  117. package/src/runtime/claude-bg-isolation.ts +138 -0
  118. package/src/runtime/companion-git.ts +10 -2
  119. package/src/runtime/companion-guidance.ts +17 -4
  120. package/src/runtime/current-branch.ts +16 -2
  121. package/src/runtime/entered-worktree.ts +24 -0
  122. package/src/runtime/git-tracked.ts +60 -0
  123. package/src/runtime/repo-destination.ts +72 -0
  124. package/src/runtime/repo-local.ts +25 -3
  125. package/src/runtime/rtk-git-guard.ts +66 -0
  126. package/src/runtime/runtime-document-manifest.ts +229 -19
  127. package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
  128. package/src/runtime/secret-guard.ts +9 -2
  129. package/src/runtime/secret-policy-weakening.ts +122 -0
  130. package/src/runtime/serving-claude-wrap.ts +15 -2
  131. package/src/runtime/umbrella-folder.ts +56 -0
  132. package/src/runtime/wrap-state.ts +5 -13
  133. package/src/studio.ts +37 -0
  134. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +61 -6
  135. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +8 -4
  136. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +9 -5
  137. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +5 -4
  138. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +10 -4
  139. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +5 -1
  140. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +61 -6
  141. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +8 -4
  142. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +9 -5
  143. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +5 -4
  144. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +10 -4
  145. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +5 -1
  146. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +305 -42
  147. package/src/tools/setup/capabilities/rtk.ts +93 -1
  148. package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
  149. package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
  150. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
  151. package/src/tools/setup/dynamic-plugins/install.ts +24 -22
  152. package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
  153. package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
  154. package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
  155. package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
  156. package/src/tools/setup/mate.ts +3 -3
  157. package/src/tools/setup/plugins/gitignore.ts +15 -9
  158. package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
  159. package/src/tools/setup/providers/claude.ts +25 -3
  160. package/src/tools/setup/utils.ts +4 -2
  161. package/src/tools/setup/working-repo-cleanup.ts +2 -2
  162. package/src/tools/setup.ts +25 -14
  163. package/studio-dist/client/assets/app-D9cw6szy.css +2 -0
  164. package/studio-dist/client/assets/artifacts-WD2ZXYrx.js +1 -0
  165. package/studio-dist/client/assets/button-Br0O1sXw.js +1 -0
  166. package/studio-dist/client/assets/combobox-DA7RAUUZ.js +1 -0
  167. package/studio-dist/client/assets/companion-view-CrabvxS8.js +1 -0
  168. package/studio-dist/client/assets/factory-DGS0E16C.js +6 -0
  169. package/studio-dist/client/assets/fields-6aXBpFhJ.js +1 -0
  170. package/studio-dist/client/assets/getting-started-Clde4w6P.js +1 -0
  171. package/studio-dist/client/assets/getting-started-D6kgWwWZ.js +1 -0
  172. package/studio-dist/client/assets/getting-started._topic-BiunccbT.js +1 -0
  173. package/studio-dist/client/assets/getting-started.index-DpiNoGw8.js +1 -0
  174. package/studio-dist/client/assets/graph-B_TCBVbu.js +2 -0
  175. package/studio-dist/client/assets/graph-canvas-Ba37Y5AE.js +3242 -0
  176. package/studio-dist/client/assets/guides-Du_RtJxP.js +1 -0
  177. package/studio-dist/client/assets/index-Df8L1LQa.js +40 -0
  178. package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
  179. package/studio-dist/client/assets/markdown-view-BOX6x0rL.js +1 -0
  180. package/studio-dist/client/assets/panel-dbmCx7Mx.js +1 -0
  181. package/studio-dist/client/assets/queries-RvHeXY12.js +1 -0
  182. package/studio-dist/client/assets/react-3QStrcDO.js +27 -0
  183. package/studio-dist/client/assets/report-url-XRL0x1SY.js +1 -0
  184. package/studio-dist/client/assets/reports-r3IK7Doz.js +1 -0
  185. package/studio-dist/client/assets/routes-C0A5LTFc.js +1 -0
  186. package/studio-dist/client/assets/select-CnaMd617.js +1 -0
  187. package/studio-dist/client/assets/skills-CzjzHpBT.js +1 -0
  188. package/studio-dist/client/assets/specs-B0ldF_6J.js +1 -0
  189. package/studio-dist/client/assets/specs-view-BnCLA0gW.js +1 -0
  190. package/studio-dist/client/assets/spinner-Dcm3fqK1.js +1 -0
  191. package/studio-dist/client/assets/steps-C0p2N1Pb.js +1 -0
  192. package/studio-dist/client/assets/store-Dw34catY.js +1 -0
  193. package/studio-dist/client/assets/studio-Cpz_HRHp.js +100 -0
  194. package/studio-dist/client/assets/studio-queries-ibmpFo6R.js +2 -0
  195. package/studio-dist/client/assets/usage-C2QJ_0IZ.js +55 -0
  196. package/studio-dist/client/assets/useAnchoredPopupScrollLock-Bj-FWb8z.js +1 -0
  197. package/studio-dist/client/assets/useMutation-aAr2uiay.js +1 -0
  198. package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
  199. package/studio-dist/client/assets/vault-BGcxkSIY.js +1 -0
  200. package/studio-dist/client/assets/warnings-R1cE1rLf.js +1 -0
  201. package/studio-dist/client/assets/workflow-C2qTrMDH.js +1 -0
  202. package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-Bn896ZYj.js +122 -0
  203. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +102 -35
  204. package/studio-dist/server/assets/{actions-Bvgj9eb8.js → actions-DYSv-9VV.js} +10 -4
  205. package/studio-dist/server/assets/artifacts-DnF9L3dZ.js +216 -0
  206. package/studio-dist/server/assets/{button-CIJqAhni.js → button-CgOIVdmD.js} +13 -1702
  207. package/studio-dist/server/assets/combobox-DV_s9W0s.js +483 -0
  208. package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-BKVXD3TO.js} +3 -3
  209. package/studio-dist/server/assets/companions-C7fctnU9.js +31 -0
  210. package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
  211. package/studio-dist/server/assets/{factory-DUTa0eDs.js → factory-C7Ybg0xG.js} +1256 -353
  212. package/studio-dist/server/assets/{factory-DGPmNGbo.js → factory-Df5uAHjb.js} +53 -6
  213. package/studio-dist/server/assets/fields-BbieQTD0.js +1190 -0
  214. package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
  215. package/studio-dist/server/assets/getting-started-CRxMWorQ.js +67 -0
  216. package/studio-dist/server/assets/getting-started._topic-DJKQAzYl.js +13 -0
  217. package/studio-dist/server/assets/getting-started.index-D84gec1t.js +13 -0
  218. package/studio-dist/server/assets/graph-CSje3029.js +801 -0
  219. package/studio-dist/server/assets/graph-DDZzXM1L.js +16 -0
  220. package/studio-dist/server/assets/graph-canvas-22bWB5-2.js +21066 -0
  221. package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
  222. package/studio-dist/server/assets/guides-D9dk1Frq.js +13 -0
  223. package/studio-dist/server/assets/guides-IE-19POz.js +5 -0
  224. package/studio-dist/server/assets/guides.server-vcYRY5wx.js +66 -0
  225. package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
  226. package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-BR8dJ7aR.js} +28 -9
  227. package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-BR_t9iMM.js} +4 -4
  228. package/studio-dist/server/assets/queries-DWoTin-q.js +32 -0
  229. package/studio-dist/server/assets/react-CdqSUhaL.js +89 -0
  230. package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
  231. package/studio-dist/server/assets/report-url-BUXPcE_8.js +9 -0
  232. package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CQ9qQ1-n.js} +9 -10
  233. package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-dYDEoBeq.js} +3 -3
  234. package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DkRHNTpE.js} +787 -2862
  235. package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-B6GfOew4.js} +22 -171
  236. package/studio-dist/server/assets/{search-JAKurDNh.js → search-BJnWLfkG.js} +21 -2
  237. package/studio-dist/server/assets/select-Af7Wibii.js +1609 -0
  238. package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-Hq-hXgnT.js} +6 -5
  239. package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-B7nEuVbx.js} +9 -8
  240. package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-B_YYL7q8.js} +3 -3
  241. package/studio-dist/server/assets/specs-BpLUFntA.js +51 -0
  242. package/studio-dist/server/assets/specs-view-0peMVd22.js +426 -0
  243. package/studio-dist/server/assets/spinner-CdwJW4VB.js +20 -0
  244. package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D56DApvK.js} +1 -1
  245. package/studio-dist/server/assets/store-Cs17okNG.js +280 -0
  246. package/studio-dist/server/assets/studio-CAcKp3bM.js +10340 -0
  247. package/studio-dist/server/assets/studio-queries-BtRGzDdh.js +1451 -0
  248. package/studio-dist/server/assets/usage-COdjd1gD.js +25570 -0
  249. package/studio-dist/server/assets/usage-f6pqE1tm.js +24 -0
  250. package/studio-dist/server/assets/useAnchoredPopupScrollLock-DlBKHRw7.js +756 -0
  251. package/studio-dist/server/assets/useMutation-DzTZGenE.js +690 -0
  252. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
  253. package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-BDuIUq0F.js} +8 -5
  254. package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-BVLp6zu3.js} +3 -3
  255. package/studio-dist/server/assets/{views-BgYa-za2.js → views-flRUr21z.js} +4 -4
  256. package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-CDy9pdgL.js} +3 -2
  257. package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-D9GKI2EV.js} +132 -106
  258. package/studio-dist/server/server.js +582 -8
  259. package/src/cli/commands/report/collector.ts +0 -288
  260. package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
  261. package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
  262. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
  263. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
  264. package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
  265. package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
  266. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
  267. package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
  268. package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
  269. package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
  270. package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
  271. package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  272. package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
  273. package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
  274. package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
  275. package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
  276. package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
  277. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
  278. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
  279. package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
  280. package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
  281. package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
  282. package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
  283. package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
  284. package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
  285. package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
  286. package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
@@ -0,0 +1,58 @@
1
+ // src/lib/graph-wire.ts
2
+ function packGraph(graph) {
3
+ const { nodes, archives } = graph;
4
+ return {
5
+ nodes: JSON.stringify([
6
+ nodes.map((node) => node.kind),
7
+ nodes.map((node) => node.id),
8
+ nodes.map((node) => node.label),
9
+ nodes.map((node) => node.repository ?? ""),
10
+ nodes.map((node) => node.area ?? "")
11
+ ]),
12
+ edges: graph.edges.join(","),
13
+ archives: JSON.stringify([
14
+ archives.map((archive) => archive.anchor),
15
+ archives.map((archive) => archive.name),
16
+ archives.map((archive) => archive.archivedOn),
17
+ archives.map((archive) => archive.artifacts.join(","))
18
+ ]),
19
+ history: graph.history.map((indices) => indices.join(",")).join(";"),
20
+ order: nodes.length,
21
+ unbound: graph.unbound,
22
+ broken: graph.broken
23
+ };
24
+ }
25
+ /** `count` equally long string columns from packed JSON; anything else is a broken answer. */
26
+ function columns(text, count, what) {
27
+ const parsed = JSON.parse(text);
28
+ if (!(Array.isArray(parsed) && parsed.length === count && parsed.every((column) => Array.isArray(column) && column.length === parsed[0].length && column.every((cell) => typeof cell === "string")))) throw new Error(`the graph's ${what} could not be read`);
29
+ return parsed;
30
+ }
31
+ var numbers = (text) => text ? text.split(",").map(Number) : [];
32
+ function unpackGraph(packed) {
33
+ const [kinds, ids, labels, repositories, areas] = columns(packed.nodes, 5, "nodes");
34
+ const nodes = ids.map((id, index) => ({
35
+ kind: kinds[index],
36
+ id,
37
+ label: labels[index],
38
+ ...repositories[index] ? { repository: repositories[index] } : {},
39
+ ...areas[index] ? { area: areas[index] } : {}
40
+ }));
41
+ const [anchors, names, dates, artifacts] = columns(packed.archives, 4, "archives");
42
+ const archives = anchors.map((anchor, index) => ({
43
+ anchor,
44
+ name: names[index],
45
+ archivedOn: dates[index],
46
+ artifacts: artifacts[index] ? artifacts[index].split(",") : []
47
+ }));
48
+ const history = packed.order === 0 ? [] : packed.history.split(";").map(numbers);
49
+ return {
50
+ nodes,
51
+ edges: numbers(packed.edges),
52
+ archives,
53
+ history,
54
+ unbound: packed.unbound,
55
+ broken: packed.broken
56
+ };
57
+ }
58
+ export { unpackGraph as n, packGraph as t };
@@ -0,0 +1,13 @@
1
+ import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
+ import { n as createServerFn } from "../server.js";
3
+ // src/server/guides.ts?tss-serverfn-split
4
+ var getGuide_createServerFn_handler = createServerRpc({
5
+ id: "b2e22d82aeef8a3802144ae67d3a53a4fff5860a1a0b957618e8dcc7c0ef36c8",
6
+ name: "getGuide",
7
+ filename: "src/server/guides.ts"
8
+ }, (opts) => getGuide.__executeServer(opts));
9
+ var getGuide = createServerFn({ method: "GET" }).validator((input) => ({ topic: String(input.topic) })).handler(getGuide_createServerFn_handler, async ({ data }) => {
10
+ const { guides } = await import("./guides.server-vcYRY5wx.js");
11
+ return Object.hasOwn(guides, data.topic) ? guides[data.topic] : null;
12
+ });
13
+ export { getGuide_createServerFn_handler };
@@ -0,0 +1,5 @@
1
+ import { C as createSsrRpc } from "./studio-queries-BtRGzDdh.js";
2
+ import { n as createServerFn } from "../server.js";
3
+ // src/server/guides.ts
4
+ var getGuide = createServerFn({ method: "GET" }).validator((input) => ({ topic: String(input.topic) })).handler(createSsrRpc("b2e22d82aeef8a3802144ae67d3a53a4fff5860a1a0b957618e8dcc7c0ef36c8"));
5
+ export { getGuide as t };
@@ -0,0 +1,66 @@
1
+ import { c as guideTree } from "./studio-CAcKp3bM.js";
2
+ // src/views/getting-started/start.md?raw
3
+ var start_default = "## Your first change\n\nYour **Working Repository** holds product code. The **Companion Repository**\nholds shared context, plans, specs, and tasks. Mate brings that context into\nyour agent session. Reading this guide runs nothing and writes no files.\n\n### 1. Link your project\n\nYou need Git, Mate, an installed OpenCode or Claude Code, and a Companion\nRepository with OpenSpec enabled. In your project checkout:\n\n```sh\ncd ~/src/acme\nmate companion link\n```\n\nChoose your intended companion. Selecting it in Studio alone does not link\nthe checkout. If linking or launch fails, run `mate doctor` here and resolve\nits diagnostics; ask your Companion Maintainer about missing capabilities.\n\n### 2. Start an agent\n\nFrom the same checkout, choose your installed runtime:\n\n```sh\nmate opencode\n```\n\nOr use `mate claude`. The session starts with your project's context and\nskills. Check the reported Working Repository and Session Companion.\n\n### 3. Plan, review, then apply\n\nSkill examples belong in the **agent conversation, not your terminal**.\nOpenCode uses `@name`; Claude Code uses `/name`.\n\n- **Explore:** describe the problem with `@mate-explore-change acme-fix`.\n Agree on scope and direction before implementation.\n- **Propose:** `@mate-propose-change acme-fix` writes the plan, specs, and\n tasks in the Companion Repository—not product code.\n- **Review:** read those artifacts yourself. Request revisions if needed.\n Validation is evidence, not approval.\n- **Apply:** only after review, request `@mate-apply-change acme-fix`.\n Confirm the delivery branch in this checkout. The agent implements the\n tasks and reports checks; resolve blockers or scope changes before resuming.\n\n### 4. Review and deliver\n\nInspect the diff, run project checks, and review behavior. Explicitly authorize\ncommit, push, pull request, and merge through your team's normal process;\napply does not do these for you.\n\nThen ask the agent to **archive** the change locally and **publish** its\ncompanion artifacts for teammates. Archival, merge, and publication are\nseparate actions: publication requires archival and a merged delivery branch,\nplus your confirmation of the companion commit, dated revert tag, and push.\n\nOptional: [Worktrees](/docs/concepts/worktrees) for isolated checkouts;\n[VS Code & Cursor](/docs/getting-started/vscode) for editor integration.\n";
4
+ // src/views/getting-started/vscode.md?raw
5
+ var vscode_default = "## VS Code & Cursor\n\nThe Mate sidebar puts agent sessions and change progress beside your code.\nEditor integration is optional; the same workflow works in a terminal.\n\n### Install the extension\n\nWith Mate and your Agent Runtime installed, enable your editor's CLI\n(`code` or `cursor`) on PATH, then run in a terminal:\n\n```sh\nmate vscode setup\n```\n\nThis installs the matching extension into detected editors. If no editor is\nfound, enable its CLI and retry.\n\n### Open your workspace\n\nOpen your linked project folder, then the **Mate** sidebar. Choose\n**Open workspace** when prompted. The managed workspace groups your Working\nRepository and linked Companion Repositories; it does not create a worktree\nor switch branches.\n\n### Start or resume\n\nStart Claude or OpenCode from the sidebar in the checkout you intend to edit.\nCheck its branch and change before asking for implementation.\n\nUse **Sessions** to attach to a running session or resume a saved conversation.\nOnly sidebar-started sessions appear here; return to your runtime for sessions\nstarted in another terminal. Opening a worktree window does not move a running\nconversation.\n\n### Follow progress\n\n**Open changes** shows plans and task progress. **Worktrees** opens another\ncheckout in its own window. **Ready to publish** lists archived changes,\nincluding those still waiting for merge—not proof of publication.\n";
6
+ // src/views/getting-started/worktrees.md?raw
7
+ var worktrees_default = "## Work in an isolated checkout\n\nA worktree is another checkout of the same Git repository. Use one to keep\na change's files separate while your original checkout stays available.\nIt is optional, not a prerequisite for Mate.\n\n### Choose it during apply\n\nExplore, propose, and review your change in the agent conversation first.\nWhen apply asks where to implement, choose **Create a worktree**. Mate creates\nor reuses the checkout and records its delivery branch.\n\nThe agent enters it when the runtime supports moving the session. Otherwise,\nfollow the reported path: open a new agent session there and resume apply.\nCheck the checkout and branch before implementation continues.\n\n### Continue there\n\nYou can open another terminal in that worktree for tests, a development\nserver, or inspecting the diff. Set its working directory to the reported\ncheckout; opening a terminal elsewhere does not move the agent.\n\nProduct edits stay isolated. Plans, specs, and tasks remain in the shared\nCompanion Repository, so coordinate concurrent edits to those artifacts.\nReview, deliver, merge, and archive through the normal workflow.\n\n### Clean up safely\n\nPublication attempts cleanup when the **Workset becomes Done**, not after\nevery individual publication. Dirty, locked, unpushed, or currently used\ncheckouts are kept. Cleanup does not delete the branch or close your terminals.\nRead the reported cleanup result rather than assuming the checkout is gone.\n";
8
+ // src/server/guide-content.ts
9
+ /** Published docs; linked pages Studio doesn't bundle open there. */
10
+ var DOCS_SITE = "https://uniqbit-ag.github.io/mate-cli";
11
+ var GUIDE_ROUTES = {
12
+ "/docs/concepts/umbrella-repository": `${DOCS_SITE}/docs/concepts/umbrella-repository/`,
13
+ "/docs/concepts/repositories": `${DOCS_SITE}/docs/concepts/repositories/`,
14
+ "/docs/concepts/worktrees": "/getting-started/worktrees",
15
+ "/docs/getting-started/vscode": "/getting-started/vscode"
16
+ };
17
+ function visit(nodes, run) {
18
+ for (const node of nodes) {
19
+ if (typeof node === "string") continue;
20
+ run(node);
21
+ if (node.c) visit(node.c, run);
22
+ }
23
+ }
24
+ /** Pure compilation; no filesystem or network access in an installed release. */
25
+ function compileGuides(sources) {
26
+ const result = Object.fromEntries(Object.entries(sources).map(([topic, { source, path, title }]) => [topic, {
27
+ title,
28
+ nodes: guideTree(source, path, GUIDE_ROUTES)
29
+ }]));
30
+ const headingIdsByTopic = /* @__PURE__ */ new Map();
31
+ for (const [topic, guide] of Object.entries(result)) {
32
+ const headings = /* @__PURE__ */ new Set();
33
+ visit(guide.nodes, (node) => {
34
+ if (node.a?.id) headings.add(node.a.id);
35
+ });
36
+ headingIdsByTopic.set(topic, headings);
37
+ }
38
+ for (const [topic, guide] of Object.entries(result)) visit(guide.nodes, (node) => {
39
+ const target = node.a?.guide;
40
+ if (!target) return;
41
+ const [route, fragment] = target.split("#");
42
+ const targetTopic = route ? route.split("/").at(-1) : topic;
43
+ const targetHeadings = headingIdsByTopic.get(targetTopic);
44
+ if (!targetHeadings || fragment !== void 0 && !targetHeadings.has(fragment)) throw new Error(`${sources[topic].path}: unresolved guide target: ${target}`);
45
+ });
46
+ return result;
47
+ }
48
+ // src/server/guides.server.ts
49
+ var guides = compileGuides({
50
+ start: {
51
+ source: start_default,
52
+ path: "start.md",
53
+ title: "Start here"
54
+ },
55
+ worktrees: {
56
+ source: worktrees_default,
57
+ path: "worktrees.md",
58
+ title: "Worktrees"
59
+ },
60
+ vscode: {
61
+ source: vscode_default,
62
+ path: "vscode.md",
63
+ title: "VS Code & Cursor"
64
+ }
65
+ });
66
+ export { guides };
@@ -0,0 +1,451 @@
1
+ import { createRequire } from "node:module";
2
+ // \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
10
+ var __exportAll = (all, no_symbols) => {
11
+ let target = {};
12
+ for (var name in all) __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
17
+ return target;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
21
+ key = keys[i];
22
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
23
+ get: ((k) => from[k]).bind(null, key),
24
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
+ });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
34
+ // ../../node_modules/.bun/react@19.2.7/node_modules/react/cjs/react.production.js
35
+ /**
36
+ * @license React
37
+ * react.production.js
38
+ *
39
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */
44
+ var require_react_production = /* @__PURE__ */ __commonJSMin(((exports) => {
45
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
46
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
47
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
48
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
49
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
50
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
51
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
52
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
53
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
54
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
55
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
56
+ var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
57
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
58
+ function getIteratorFn(maybeIterable) {
59
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
60
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
61
+ return "function" === typeof maybeIterable ? maybeIterable : null;
62
+ }
63
+ var ReactNoopUpdateQueue = {
64
+ isMounted: function() {
65
+ return !1;
66
+ },
67
+ enqueueForceUpdate: function() {},
68
+ enqueueReplaceState: function() {},
69
+ enqueueSetState: function() {}
70
+ };
71
+ var assign = Object.assign;
72
+ var emptyObject = {};
73
+ function Component(props, context, updater) {
74
+ this.props = props;
75
+ this.context = context;
76
+ this.refs = emptyObject;
77
+ this.updater = updater || ReactNoopUpdateQueue;
78
+ }
79
+ Component.prototype.isReactComponent = {};
80
+ Component.prototype.setState = function(partialState, callback) {
81
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
82
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
83
+ };
84
+ Component.prototype.forceUpdate = function(callback) {
85
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
86
+ };
87
+ function ComponentDummy() {}
88
+ ComponentDummy.prototype = Component.prototype;
89
+ function PureComponent(props, context, updater) {
90
+ this.props = props;
91
+ this.context = context;
92
+ this.refs = emptyObject;
93
+ this.updater = updater || ReactNoopUpdateQueue;
94
+ }
95
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
96
+ pureComponentPrototype.constructor = PureComponent;
97
+ assign(pureComponentPrototype, Component.prototype);
98
+ pureComponentPrototype.isPureReactComponent = !0;
99
+ var isArrayImpl = Array.isArray;
100
+ function noop() {}
101
+ var ReactSharedInternals = {
102
+ H: null,
103
+ A: null,
104
+ T: null,
105
+ S: null
106
+ };
107
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
108
+ function ReactElement(type, key, props) {
109
+ var refProp = props.ref;
110
+ return {
111
+ $$typeof: REACT_ELEMENT_TYPE,
112
+ type,
113
+ key,
114
+ ref: void 0 !== refProp ? refProp : null,
115
+ props
116
+ };
117
+ }
118
+ function cloneAndReplaceKey(oldElement, newKey) {
119
+ return ReactElement(oldElement.type, newKey, oldElement.props);
120
+ }
121
+ function isValidElement(object) {
122
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
123
+ }
124
+ function escape(key) {
125
+ var escaperLookup = {
126
+ "=": "=0",
127
+ ":": "=2"
128
+ };
129
+ return "$" + key.replace(/[=:]/g, function(match) {
130
+ return escaperLookup[match];
131
+ });
132
+ }
133
+ var userProvidedKeyEscapeRegex = /\/+/g;
134
+ function getElementKey(element, index) {
135
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
136
+ }
137
+ function resolveThenable(thenable) {
138
+ switch (thenable.status) {
139
+ case "fulfilled": return thenable.value;
140
+ case "rejected": throw thenable.reason;
141
+ default: switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
142
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
143
+ }, function(error) {
144
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
145
+ })), thenable.status) {
146
+ case "fulfilled": return thenable.value;
147
+ case "rejected": throw thenable.reason;
148
+ }
149
+ }
150
+ throw thenable;
151
+ }
152
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
153
+ var type = typeof children;
154
+ if ("undefined" === type || "boolean" === type) children = null;
155
+ var invokeCallback = !1;
156
+ if (null === children) invokeCallback = !0;
157
+ else switch (type) {
158
+ case "bigint":
159
+ case "string":
160
+ case "number":
161
+ invokeCallback = !0;
162
+ break;
163
+ case "object": switch (children.$$typeof) {
164
+ case REACT_ELEMENT_TYPE:
165
+ case REACT_PORTAL_TYPE:
166
+ invokeCallback = !0;
167
+ break;
168
+ case REACT_LAZY_TYPE: return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
169
+ }
170
+ }
171
+ if (invokeCallback) return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
172
+ return c;
173
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(callback, escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + invokeCallback)), array.push(callback)), 1;
174
+ invokeCallback = 0;
175
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
176
+ if (isArrayImpl(children)) for (var i = 0; i < children.length; i++) nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
177
+ else if (i = getIteratorFn(children), "function" === typeof i) for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done;) nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
178
+ else if ("object" === type) {
179
+ if ("function" === typeof children.then) return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
180
+ array = String(children);
181
+ throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead.");
182
+ }
183
+ return invokeCallback;
184
+ }
185
+ function mapChildren(children, func, context) {
186
+ if (null == children) return children;
187
+ var result = [], count = 0;
188
+ mapIntoArray(children, result, "", "", function(child) {
189
+ return func.call(context, child, count++);
190
+ });
191
+ return result;
192
+ }
193
+ function lazyInitializer(payload) {
194
+ if (-1 === payload._status) {
195
+ var ctor = payload._result;
196
+ ctor = ctor();
197
+ ctor.then(function(moduleObject) {
198
+ if (0 === payload._status || -1 === payload._status) payload._status = 1, payload._result = moduleObject;
199
+ }, function(error) {
200
+ if (0 === payload._status || -1 === payload._status) payload._status = 2, payload._result = error;
201
+ });
202
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
203
+ }
204
+ if (1 === payload._status) return payload._result.default;
205
+ throw payload._result;
206
+ }
207
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
208
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
209
+ var event = new window.ErrorEvent("error", {
210
+ bubbles: !0,
211
+ cancelable: !0,
212
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
213
+ error
214
+ });
215
+ if (!window.dispatchEvent(event)) return;
216
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
217
+ process.emit("uncaughtException", error);
218
+ return;
219
+ }
220
+ console.error(error);
221
+ };
222
+ var Children = {
223
+ map: mapChildren,
224
+ forEach: function(children, forEachFunc, forEachContext) {
225
+ mapChildren(children, function() {
226
+ forEachFunc.apply(this, arguments);
227
+ }, forEachContext);
228
+ },
229
+ count: function(children) {
230
+ var n = 0;
231
+ mapChildren(children, function() {
232
+ n++;
233
+ });
234
+ return n;
235
+ },
236
+ toArray: function(children) {
237
+ return mapChildren(children, function(child) {
238
+ return child;
239
+ }) || [];
240
+ },
241
+ only: function(children) {
242
+ if (!isValidElement(children)) throw Error("React.Children.only expected to receive a single React element child.");
243
+ return children;
244
+ }
245
+ };
246
+ exports.Activity = REACT_ACTIVITY_TYPE;
247
+ exports.Children = Children;
248
+ exports.Component = Component;
249
+ exports.Fragment = REACT_FRAGMENT_TYPE;
250
+ exports.Profiler = REACT_PROFILER_TYPE;
251
+ exports.PureComponent = PureComponent;
252
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
253
+ exports.Suspense = REACT_SUSPENSE_TYPE;
254
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
255
+ exports.__COMPILER_RUNTIME = {
256
+ __proto__: null,
257
+ c: function(size) {
258
+ return ReactSharedInternals.H.useMemoCache(size);
259
+ }
260
+ };
261
+ exports.cache = function(fn) {
262
+ return function() {
263
+ return fn.apply(null, arguments);
264
+ };
265
+ };
266
+ exports.cacheSignal = function() {
267
+ return null;
268
+ };
269
+ exports.cloneElement = function(element, config, children) {
270
+ if (null === element || void 0 === element) throw Error("The argument must be a React element, but you passed " + element + ".");
271
+ var props = assign({}, element.props), key = element.key;
272
+ if (null != config) for (propName in void 0 !== config.key && (key = "" + config.key), config) !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
273
+ var propName = arguments.length - 2;
274
+ if (1 === propName) props.children = children;
275
+ else if (1 < propName) {
276
+ for (var childArray = Array(propName), i = 0; i < propName; i++) childArray[i] = arguments[i + 2];
277
+ props.children = childArray;
278
+ }
279
+ return ReactElement(element.type, key, props);
280
+ };
281
+ exports.createContext = function(defaultValue) {
282
+ defaultValue = {
283
+ $$typeof: REACT_CONTEXT_TYPE,
284
+ _currentValue: defaultValue,
285
+ _currentValue2: defaultValue,
286
+ _threadCount: 0,
287
+ Provider: null,
288
+ Consumer: null
289
+ };
290
+ defaultValue.Provider = defaultValue;
291
+ defaultValue.Consumer = {
292
+ $$typeof: REACT_CONSUMER_TYPE,
293
+ _context: defaultValue
294
+ };
295
+ return defaultValue;
296
+ };
297
+ exports.createElement = function(type, config, children) {
298
+ var propName, props = {}, key = null;
299
+ if (null != config) for (propName in void 0 !== config.key && (key = "" + config.key), config) hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
300
+ var childrenLength = arguments.length - 2;
301
+ if (1 === childrenLength) props.children = children;
302
+ else if (1 < childrenLength) {
303
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2];
304
+ props.children = childArray;
305
+ }
306
+ if (type && type.defaultProps) for (propName in childrenLength = type.defaultProps, childrenLength) void 0 === props[propName] && (props[propName] = childrenLength[propName]);
307
+ return ReactElement(type, key, props);
308
+ };
309
+ exports.createRef = function() {
310
+ return { current: null };
311
+ };
312
+ exports.forwardRef = function(render) {
313
+ return {
314
+ $$typeof: REACT_FORWARD_REF_TYPE,
315
+ render
316
+ };
317
+ };
318
+ exports.isValidElement = isValidElement;
319
+ exports.lazy = function(ctor) {
320
+ return {
321
+ $$typeof: REACT_LAZY_TYPE,
322
+ _payload: {
323
+ _status: -1,
324
+ _result: ctor
325
+ },
326
+ _init: lazyInitializer
327
+ };
328
+ };
329
+ exports.memo = function(type, compare) {
330
+ return {
331
+ $$typeof: REACT_MEMO_TYPE,
332
+ type,
333
+ compare: void 0 === compare ? null : compare
334
+ };
335
+ };
336
+ exports.startTransition = function(scope) {
337
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
338
+ ReactSharedInternals.T = currentTransition;
339
+ try {
340
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
341
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
342
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
343
+ } catch (error) {
344
+ reportGlobalError(error);
345
+ } finally {
346
+ null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
347
+ }
348
+ };
349
+ exports.unstable_useCacheRefresh = function() {
350
+ return ReactSharedInternals.H.useCacheRefresh();
351
+ };
352
+ exports.use = function(usable) {
353
+ return ReactSharedInternals.H.use(usable);
354
+ };
355
+ exports.useActionState = function(action, initialState, permalink) {
356
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
357
+ };
358
+ exports.useCallback = function(callback, deps) {
359
+ return ReactSharedInternals.H.useCallback(callback, deps);
360
+ };
361
+ exports.useContext = function(Context) {
362
+ return ReactSharedInternals.H.useContext(Context);
363
+ };
364
+ exports.useDebugValue = function() {};
365
+ exports.useDeferredValue = function(value, initialValue) {
366
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
367
+ };
368
+ exports.useEffect = function(create, deps) {
369
+ return ReactSharedInternals.H.useEffect(create, deps);
370
+ };
371
+ exports.useEffectEvent = function(callback) {
372
+ return ReactSharedInternals.H.useEffectEvent(callback);
373
+ };
374
+ exports.useId = function() {
375
+ return ReactSharedInternals.H.useId();
376
+ };
377
+ exports.useImperativeHandle = function(ref, create, deps) {
378
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
379
+ };
380
+ exports.useInsertionEffect = function(create, deps) {
381
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
382
+ };
383
+ exports.useLayoutEffect = function(create, deps) {
384
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
385
+ };
386
+ exports.useMemo = function(create, deps) {
387
+ return ReactSharedInternals.H.useMemo(create, deps);
388
+ };
389
+ exports.useOptimistic = function(passthrough, reducer) {
390
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
391
+ };
392
+ exports.useReducer = function(reducer, initialArg, init) {
393
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
394
+ };
395
+ exports.useRef = function(initialValue) {
396
+ return ReactSharedInternals.H.useRef(initialValue);
397
+ };
398
+ exports.useState = function(initialState) {
399
+ return ReactSharedInternals.H.useState(initialState);
400
+ };
401
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
402
+ return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
403
+ };
404
+ exports.useTransition = function() {
405
+ return ReactSharedInternals.H.useTransition();
406
+ };
407
+ exports.version = "19.2.7";
408
+ }));
409
+ // ../../node_modules/.bun/react@19.2.7/node_modules/react/index.js
410
+ var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
411
+ module.exports = require_react_production();
412
+ }));
413
+ // ../../node_modules/.bun/react@19.2.7/node_modules/react/cjs/react-jsx-runtime.production.js
414
+ /**
415
+ * @license React
416
+ * react-jsx-runtime.production.js
417
+ *
418
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
419
+ *
420
+ * This source code is licensed under the MIT license found in the
421
+ * LICENSE file in the root directory of this source tree.
422
+ */
423
+ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
424
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
425
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
426
+ function jsxProd(type, config, maybeKey) {
427
+ var key = null;
428
+ void 0 !== maybeKey && (key = "" + maybeKey);
429
+ void 0 !== config.key && (key = "" + config.key);
430
+ if ("key" in config) {
431
+ maybeKey = {};
432
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
433
+ } else maybeKey = config;
434
+ config = maybeKey.ref;
435
+ return {
436
+ $$typeof: REACT_ELEMENT_TYPE,
437
+ type,
438
+ key,
439
+ ref: void 0 !== config ? config : null,
440
+ props: maybeKey
441
+ };
442
+ }
443
+ exports.Fragment = REACT_FRAGMENT_TYPE;
444
+ exports.jsx = jsxProd;
445
+ exports.jsxs = jsxProd;
446
+ }));
447
+ // ../../node_modules/.bun/react@19.2.7/node_modules/react/jsx-runtime.js
448
+ var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
449
+ module.exports = require_react_jsx_runtime_production();
450
+ }));
451
+ export { __require as a, __exportAll as i, require_react as n, __toESM as o, __commonJSMin as r, require_jsx_runtime as t };
@@ -1,6 +1,5 @@
1
- import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
2
- import { Bi as Link } from "./button-CIJqAhni.js";
3
- import { j as require_react, u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
1
+ import { ft as Link } from "./studio-queries-BtRGzDdh.js";
2
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
4
3
  // src/views/vault/markdown-view.tsx
5
4
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
5
  var import_jsx_runtime = require_jsx_runtime();
@@ -35,10 +34,20 @@ var TAGS = /* @__PURE__ */ new Set([
35
34
  "del",
36
35
  "br"
37
36
  ]);
38
- function element(node, key) {
39
- const children = node.c?.map(render);
37
+ function element(node, key, guideSearch) {
38
+ const children = node.c?.map((child, index) => render(child, index, guideSearch));
40
39
  const { a } = node;
41
40
  if (node.t === "a") {
41
+ if (guideSearch && a?.guide) {
42
+ const [path, hash] = a.guide.split("#");
43
+ if (path && !/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(path)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children }, key);
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
45
+ to: path || ".",
46
+ hash,
47
+ search: guideSearch,
48
+ children
49
+ }, key);
50
+ }
42
51
  if (a?.note) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
43
52
  to: "/vault",
44
53
  search: (previous) => ({
@@ -66,21 +75,31 @@ function element(node, key) {
66
75
  "aria-label": "Task"
67
76
  }, key);
68
77
  if (!TAGS.has(node.t)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children }, key);
78
+ if (guideSearch && a?.id && children) children.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
79
+ to: ".",
80
+ hash: a.id,
81
+ search: guideSearch,
82
+ className: "guide-anchor",
83
+ "aria-label": `Link to ${a.id}`,
84
+ children: "#"
85
+ }, "anchor"));
69
86
  return (0, import_react.createElement)(node.t, {
70
87
  key,
71
88
  className: a?.className,
89
+ id: guideSearch ? a?.id : void 0,
90
+ tabIndex: guideSearch && a?.id ? -1 : void 0,
72
91
  start: a?.start,
73
92
  style: a?.align ? { textAlign: a.align } : void 0
74
93
  }, children && children.length > 0 ? children : void 0);
75
94
  }
76
- function render(node, key) {
77
- return typeof node === "string" ? node : element(node, key);
95
+ function render(node, key, guideSearch) {
96
+ return typeof node === "string" ? node : element(node, key, guideSearch);
78
97
  }
79
98
  /** A file the server rendered to data; React escapes every value it shows. */
80
- function MarkdownView({ nodes }) {
99
+ function MarkdownView({ nodes, guideSearch }) {
81
100
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
82
101
  className: "markdown-body",
83
- children: nodes.map(render)
102
+ children: nodes.map((node, index) => render(node, index, guideSearch))
84
103
  });
85
104
  }
86
105
  export { MarkdownView as t };