@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,6 +1,6 @@
1
1
  import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
2
  import { n as createServerFn } from "../server.js";
3
- import { S as COMPANION_DIGEST_PATTERN } from "./studio-qRvQjRpz.js";
3
+ import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
4
4
  // src/server/usage.ts?tss-serverfn-split
5
5
  function validateUsageInput(input) {
6
6
  if (!input || typeof input.companion !== "string" || !COMPANION_DIGEST_PATTERN.test(input.companion)) throw new Error("No registered companion was selected");
@@ -1,14 +1,15 @@
1
- import { t as useMutation } from "./useMutation-DpBIuWXt.js";
2
- import { Lr as useQuery, dt as ToggleGroup, ft as ToggleGroupItem, o as require_with_selector$1, r as Icon, t as Button, ut as ViewLoading } from "./button-D6bvrFmm.js";
3
- import { m as useQueryClient, n as clsx, t as cn } from "./cn-FXJAM0KO.js";
4
- import { at as useNavigate, k as queryOptions, y as createSsrRpc } from "./studio-queries-Dqf-3nzj.js";
1
+ import { t as useMutation } from "./useMutation-NjlA8oFY.js";
2
+ import { N as useBrowser, Rt as useQuery, V as useMediaQuery, c as Route } from "./router-DcWe0J7Y.js";
3
+ import { p as useQueryClient, t as cn } from "./cn-B0fl6NWK.js";
4
+ import { F as queryOptions, S as createSsrRpc, dt as useNavigate } from "./studio-queries-ur1ygXi3.js";
5
5
  import { i as __exportAll, n as require_react, o as __toESM, r as __commonJSMin, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
6
- import { t as Input } from "./fields-B4mAPETz.js";
7
- import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-D2MbYV1O.js";
8
- import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-C3i6TTX-.js";
9
- import { C as useMediaQuery, h as useBrowser, s as Route } from "./router-CPt0TAk_.js";
6
+ import { dt as ToggleGroup, ft as ToggleGroupItem, o as require_with_selector$1, r as Icon, t as Button, ut as ViewLoading } from "./button-BqA1urbl.js";
7
+ import { t as Input } from "./fields-BMap2_Ju.js";
8
+ import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-iTjvPCtS.js";
9
+ import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-CZvHgGCi.js";
10
10
  import { i as require_react_dom, n as createServerFn } from "../server.js";
11
- import { S as COMPANION_DIGEST_PATTERN } from "./studio-qRvQjRpz.js";
11
+ import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
12
+ import { n as clsx } from "./bundle-mjs-Ot6dQ8Pq.js";
12
13
  // src/server/usage.ts
13
14
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
14
15
  function validateUsageInput(input) {
@@ -1,84 +1,6 @@
1
1
  import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
2
- import { A as useFloatingParentNodeId, Cn as activeElement, En as getTarget, Et as getNextListIndex, Fr as useId, G as useValueAsRef, Kn as listNavigation, Nr as useRefWithInit, Ot as isIndexOutOfListBounds, Qn as triggerPress, Qt as stopEvent, Sn as ARROW_UP, Tn as contains, Tt as getMinListIndex, W as useAnimationFrame, Xt as isVirtualClick, Y as useTimeout, Yt as isMouseLikePointerType, Zt as isVirtualPointerEvent, an as isTypeableElement, bn as ARROW_LEFT, c as PopupTriggerMap, er as createChangeEventDetails, i as FloatingRootStore, in as isTypeableCombobox, ir as ownerDocument, j as useFloatingTree, jn as ios, kn as webkit, kr as EMPTY_OBJECT, or as useIsoLayoutEffect, sr as useStableCallback, tn as getFloatingFocusElement, vr as isElement, wt as getMaxListIndex, xn as ARROW_RIGHT, yn as ARROW_DOWN, yr as isHTMLElement, zn as focusOut } from "./button-D6bvrFmm.js";
3
- import { i as useScrollLock, s as useValueChanged, y as enqueueFocus } from "./fields-B4mAPETz.js";
4
- // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
5
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
- /**
7
- * Opens or closes the floating element when clicking the reference element.
8
- * @see https://floating-ui.com/docs/useClick
9
- */
10
- function useClick(store, props = {}) {
11
- const { enabled = true, event: eventOption = "click", toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
12
- const dataRef = store.context.dataRef;
13
- const pointerTypeRef = import_react.useRef(void 0);
14
- const frame = useAnimationFrame();
15
- const touchOpenTimeout = useTimeout();
16
- const reference = import_react.useMemo(() => {
17
- function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
18
- const details = createChangeEventDetails(reason, nativeEvent, target);
19
- if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) touchOpenTimeout.start(touchOpenDelay, () => {
20
- store.setOpen(true, details);
21
- });
22
- else store.setOpen(nextOpen, details);
23
- }
24
- function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {
25
- const openEvent = dataRef.current.openEvent;
26
- const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
27
- if (open && hasClickedOnInactiveTrigger) return true;
28
- if (!open) return true;
29
- if (!toggle) return true;
30
- if (openEvent && (typeof stickIfOpen === "function" ? stickIfOpen() : stickIfOpen)) return !isClickLikeOpenEvent(openEvent.type);
31
- return false;
32
- }
33
- return {
34
- onPointerDown(event) {
35
- pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
36
- },
37
- onMouseDown(event) {
38
- const pointerType = pointerTypeRef.current;
39
- const nativeEvent = event.nativeEvent;
40
- const open = store.select("open");
41
- if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
42
- const nextOpen = getNextOpen(open, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
43
- const target = getTarget(nativeEvent);
44
- const isTypeable = isTypeableElement(target);
45
- if (isTypeable || pointerType === "virtual") {
46
- setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
47
- return;
48
- }
49
- const eventCurrentTarget = event.currentTarget;
50
- frame.request(() => {
51
- setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
52
- });
53
- },
54
- onClick(event) {
55
- if (eventOption === "mousedown-only") return;
56
- const pointerType = pointerTypeRef.current;
57
- if (eventOption === "mousedown" && pointerType) {
58
- pointerTypeRef.current = void 0;
59
- return;
60
- }
61
- if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
62
- setOpenWithTouchDelay(getNextOpen(store.select("open"), event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup"), event.nativeEvent, event.currentTarget, pointerType);
63
- },
64
- onKeyDown() {
65
- pointerTypeRef.current = void 0;
66
- }
67
- };
68
- }, [
69
- dataRef,
70
- eventOption,
71
- ignoreMouse,
72
- reason,
73
- store,
74
- stickIfOpen,
75
- toggle,
76
- frame,
77
- touchOpenTimeout,
78
- touchOpenDelay
79
- ]);
80
- return import_react.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]);
81
- }
2
+ import { A as useFloatingParentNodeId, Cn as ARROW_RIGHT, Dn as contains, Et as getNextListIndex, G as useValueAsRef, Ir as useRefWithInit, Jn as listNavigation, On as getTarget, Ot as isIndexOutOfListBounds, Qt as stopEvent, Rr as useId, Sn as ARROW_LEFT, Tn as activeElement, Tt as getMinListIndex, Vn as focusOut, W as useAnimationFrame, Xt as isVirtualClick, Zt as isVirtualPointerEvent, an as isTypeableElement, br as isElement, c as PopupTriggerMap, cr as useIsoLayoutEffect, i as FloatingRootStore, in as isTypeableCombobox, j as useFloatingTree, jn as webkit, lr as useStableCallback, nr as createChangeEventDetails, or as ownerDocument, tn as getFloatingFocusElement, wn as ARROW_UP, wt as getMaxListIndex, xn as ARROW_DOWN, xr as isHTMLElement } from "./button-BqA1urbl.js";
3
+ import { a as useScrollLock, b as enqueueFocus } from "./fields-BMap2_Ju.js";
82
4
  // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs
83
5
  function useFloatingRootContext(options) {
84
6
  const { open = false, onOpenChange, elements = {} } = options;
@@ -118,6 +40,7 @@ function useFloatingRootContext(options) {
118
40
  return store;
119
41
  }
120
42
  // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
43
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
121
44
  function isStationaryWebKitPointer(event) {
122
45
  return webkit && event.movementX === 0 && event.movementY === 0;
123
46
  }
@@ -675,60 +598,6 @@ function resolveMultipleLabels(values, items, itemToStringLabel) {
675
598
  return acc;
676
599
  }, []);
677
600
  }
678
- // ../../node_modules/.bun/@base-ui+utils@0.5.0+9e489665888c9e4a/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
679
- /**
680
- * Provides a cross-browser way to determine the type of the pointer used to click.
681
- * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
682
- * Additionally, this implementation detects if the click was triggered by the keyboard.
683
- *
684
- * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
685
- */
686
- function useEnhancedClickHandler(handler) {
687
- const lastClickInteractionTypeRef = import_react.useRef("");
688
- const handlePointerDown = import_react.useCallback((event) => {
689
- if (event.defaultPrevented) return;
690
- lastClickInteractionTypeRef.current = event.pointerType;
691
- handler(event, event.pointerType);
692
- }, [handler]);
693
- return {
694
- onClick: import_react.useCallback((event) => {
695
- if (event.detail === 0) {
696
- handler(event, "keyboard");
697
- return;
698
- }
699
- if ("pointerType" in event) handler(event, event.pointerType);
700
- else handler(event, lastClickInteractionTypeRef.current);
701
- lastClickInteractionTypeRef.current = "";
702
- }, [handler]),
703
- onPointerDown: handlePointerDown
704
- };
705
- }
706
- // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
707
- function useOpenMethodTriggerProps(open, setOpenMethod) {
708
- const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
709
- if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
710
- }));
711
- return import_react.useMemo(() => ({
712
- onClick,
713
- onPointerDown
714
- }), [onClick, onPointerDown]);
715
- }
716
- /**
717
- * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
718
- *
719
- * @param open The open state of the component.
720
- */
721
- function useOpenInteractionType(open) {
722
- const [openMethod, setOpenMethod] = import_react.useState(null);
723
- const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
724
- useValueChanged(open, (previousOpen) => {
725
- if (previousOpen && !open) setOpenMethod(null);
726
- });
727
- return import_react.useMemo(() => ({
728
- openMethod,
729
- triggerProps
730
- }), [openMethod, triggerProps]);
731
- }
732
601
  // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
733
602
  var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
734
603
  /**
@@ -753,4 +622,4 @@ function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, refer
753
622
  ]);
754
623
  useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
755
624
  }
756
- export { useClick as S, resolveSelectedIndex as _, hasNullItemLabel as a, useListNavigation as b, resolveSelectedLabel as c, compareItemEquality as d, defaultItemEquality as f, removeItem as g, isSelectedValueDirty as h, flattenLeafItems as i, stringifyAsLabel as l, findSelectionIndex as m, useOpenInteractionType as n, isGroupedItems as o, findItemIndex as p, useOpenMethodTriggerProps as r, resolveMultipleLabels as s, useAnchoredPopupScrollLock as t, stringifyAsValue as u, selectedValueIncludes as v, useFloatingRootContext as x, useOnFirstRender as y };
625
+ export { useOnFirstRender as _, resolveMultipleLabels as a, stringifyAsValue as c, findItemIndex as d, findSelectionIndex as f, selectedValueIncludes as g, resolveSelectedIndex as h, isGroupedItems as i, compareItemEquality as l, removeItem as m, flattenLeafItems as n, resolveSelectedLabel as o, isSelectedValueDirty as p, hasNullItemLabel as r, stringifyAsLabel as s, useAnchoredPopupScrollLock as t, defaultItemEquality as u, useListNavigation as v, useFloatingRootContext as y };
@@ -0,0 +1,111 @@
1
+ import { a as useRouter } from "./useSelector-DUmCUXAs.js";
2
+ import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
3
+ // ../../node_modules/.bun/@tanstack+react-router@1.170.46+7492c01c6988791b/node_modules/@tanstack/react-router/dist/esm/useBlocker.js
4
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
+ function _resolveBlockerOpts(opts, condition) {
6
+ if (opts === void 0) return {
7
+ shouldBlockFn: () => true,
8
+ withResolver: false
9
+ };
10
+ if ("shouldBlockFn" in opts) return opts;
11
+ if (typeof opts === "function") {
12
+ const shouldBlock = Boolean(condition ?? true);
13
+ const _customBlockerFn = async () => {
14
+ if (shouldBlock) return await opts();
15
+ return false;
16
+ };
17
+ return {
18
+ shouldBlockFn: _customBlockerFn,
19
+ enableBeforeUnload: shouldBlock,
20
+ withResolver: false
21
+ };
22
+ }
23
+ const shouldBlock = Boolean(opts.condition ?? true);
24
+ const fn = opts.blockerFn;
25
+ const _customBlockerFn = async () => {
26
+ if (shouldBlock && fn !== void 0) return await fn();
27
+ return shouldBlock;
28
+ };
29
+ return {
30
+ shouldBlockFn: _customBlockerFn,
31
+ enableBeforeUnload: shouldBlock,
32
+ withResolver: fn === void 0
33
+ };
34
+ }
35
+ function useBlocker(opts, condition) {
36
+ const { shouldBlockFn, enableBeforeUnload = true, disabled = false, withResolver = false } = _resolveBlockerOpts(opts, condition);
37
+ const router = useRouter();
38
+ const { history } = router;
39
+ const [resolver, setResolver] = import_react.useState({
40
+ status: "idle",
41
+ current: void 0,
42
+ next: void 0,
43
+ action: void 0,
44
+ proceed: void 0,
45
+ reset: void 0
46
+ });
47
+ import_react.useEffect(() => {
48
+ const blockerFnComposed = async (blockerFnArgs) => {
49
+ function getLocation(location) {
50
+ const parsedLocation = router.parseLocation(location);
51
+ const [, rawParams, foundRoute] = router.getMatchedRoutes(parsedLocation.pathname);
52
+ if (foundRoute === void 0) return {
53
+ routeId: "__notFound__",
54
+ fullPath: parsedLocation.pathname,
55
+ pathname: parsedLocation.pathname,
56
+ params: rawParams,
57
+ search: router.options.parseSearch(location.search)
58
+ };
59
+ return {
60
+ routeId: foundRoute.id,
61
+ fullPath: foundRoute.fullPath,
62
+ pathname: parsedLocation.pathname,
63
+ params: rawParams,
64
+ search: router.options.parseSearch(location.search)
65
+ };
66
+ }
67
+ const current = getLocation(blockerFnArgs.currentLocation);
68
+ const next = getLocation(blockerFnArgs.nextLocation);
69
+ if (current.routeId === "__notFound__" && next.routeId !== "__notFound__") return false;
70
+ const shouldBlock = await shouldBlockFn({
71
+ action: blockerFnArgs.action,
72
+ current,
73
+ next
74
+ });
75
+ if (!withResolver) return shouldBlock;
76
+ if (!shouldBlock) return false;
77
+ const canNavigateAsync = await new Promise((resolve) => {
78
+ setResolver({
79
+ status: "blocked",
80
+ current,
81
+ next,
82
+ action: blockerFnArgs.action,
83
+ proceed: () => resolve(false),
84
+ reset: () => resolve(true)
85
+ });
86
+ });
87
+ setResolver({
88
+ status: "idle",
89
+ current: void 0,
90
+ next: void 0,
91
+ action: void 0,
92
+ proceed: void 0,
93
+ reset: void 0
94
+ });
95
+ return canNavigateAsync;
96
+ };
97
+ return disabled ? void 0 : history.block({
98
+ blockerFn: blockerFnComposed,
99
+ enableBeforeUnload
100
+ });
101
+ }, [
102
+ shouldBlockFn,
103
+ enableBeforeUnload,
104
+ disabled,
105
+ withResolver,
106
+ history,
107
+ router
108
+ ]);
109
+ return resolver;
110
+ }
111
+ export { useBlocker as t };
@@ -1,6 +1,6 @@
1
- import { c as createRetryer, f as Subscribable, m as useQueryClient, s as Removable, u as notifyManager } from "./cn-FXJAM0KO.js";
1
+ import { d as Subscribable, l as notifyManager, o as Removable, p as useQueryClient, s as createRetryer } from "./cn-B0fl6NWK.js";
2
2
  import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
3
- import { I as hashKey, J as shallowEqualObjects, U as noop, Y as shouldThrowError } from "./studio-queries-Dqf-3nzj.js";
3
+ import { H as hashKey, Y as noop, et as shallowEqualObjects, tt as shouldThrowError } from "./studio-queries-ur1ygXi3.js";
4
4
  // ../../node_modules/.bun/@tanstack+query-core@5.105.3/node_modules/@tanstack/query-core/build/modern/mutation.js
5
5
  /**
6
6
  * Represents a single mutation attempt. A `Mutation` holds the mutation's
@@ -0,0 +1,136 @@
1
+ import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
2
+ import { Mr as EMPTY_OBJECT, Nn as ios, On as getTarget, W as useAnimationFrame, Y as useTimeout, Yt as isMouseLikePointerType, Zt as isVirtualPointerEvent, an as isTypeableElement, er as triggerPress, lr as useStableCallback, nr as createChangeEventDetails } from "./button-BqA1urbl.js";
3
+ import { c as useValueChanged } from "./fields-BMap2_Ju.js";
4
+ // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
5
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
+ /**
7
+ * Opens or closes the floating element when clicking the reference element.
8
+ * @see https://floating-ui.com/docs/useClick
9
+ */
10
+ function useClick(store, props = {}) {
11
+ const { enabled = true, event: eventOption = "click", toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
12
+ const dataRef = store.context.dataRef;
13
+ const pointerTypeRef = import_react.useRef(void 0);
14
+ const frame = useAnimationFrame();
15
+ const touchOpenTimeout = useTimeout();
16
+ const reference = import_react.useMemo(() => {
17
+ function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
18
+ const details = createChangeEventDetails(reason, nativeEvent, target);
19
+ if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) touchOpenTimeout.start(touchOpenDelay, () => {
20
+ store.setOpen(true, details);
21
+ });
22
+ else store.setOpen(nextOpen, details);
23
+ }
24
+ function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {
25
+ const openEvent = dataRef.current.openEvent;
26
+ const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
27
+ if (open && hasClickedOnInactiveTrigger) return true;
28
+ if (!open) return true;
29
+ if (!toggle) return true;
30
+ if (openEvent && (typeof stickIfOpen === "function" ? stickIfOpen() : stickIfOpen)) return !isClickLikeOpenEvent(openEvent.type);
31
+ return false;
32
+ }
33
+ return {
34
+ onPointerDown(event) {
35
+ pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
36
+ },
37
+ onMouseDown(event) {
38
+ const pointerType = pointerTypeRef.current;
39
+ const nativeEvent = event.nativeEvent;
40
+ const open = store.select("open");
41
+ if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
42
+ const nextOpen = getNextOpen(open, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
43
+ const target = getTarget(nativeEvent);
44
+ const isTypeable = isTypeableElement(target);
45
+ if (isTypeable || pointerType === "virtual") {
46
+ setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
47
+ return;
48
+ }
49
+ const eventCurrentTarget = event.currentTarget;
50
+ frame.request(() => {
51
+ setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
52
+ });
53
+ },
54
+ onClick(event) {
55
+ if (eventOption === "mousedown-only") return;
56
+ const pointerType = pointerTypeRef.current;
57
+ if (eventOption === "mousedown" && pointerType) {
58
+ pointerTypeRef.current = void 0;
59
+ return;
60
+ }
61
+ if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
62
+ setOpenWithTouchDelay(getNextOpen(store.select("open"), event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup"), event.nativeEvent, event.currentTarget, pointerType);
63
+ },
64
+ onKeyDown() {
65
+ pointerTypeRef.current = void 0;
66
+ }
67
+ };
68
+ }, [
69
+ dataRef,
70
+ eventOption,
71
+ ignoreMouse,
72
+ reason,
73
+ store,
74
+ stickIfOpen,
75
+ toggle,
76
+ frame,
77
+ touchOpenTimeout,
78
+ touchOpenDelay
79
+ ]);
80
+ return import_react.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]);
81
+ }
82
+ // ../../node_modules/.bun/@base-ui+utils@0.5.0+9e489665888c9e4a/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
83
+ /**
84
+ * Provides a cross-browser way to determine the type of the pointer used to click.
85
+ * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
86
+ * Additionally, this implementation detects if the click was triggered by the keyboard.
87
+ *
88
+ * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
89
+ */
90
+ function useEnhancedClickHandler(handler) {
91
+ const lastClickInteractionTypeRef = import_react.useRef("");
92
+ const handlePointerDown = import_react.useCallback((event) => {
93
+ if (event.defaultPrevented) return;
94
+ lastClickInteractionTypeRef.current = event.pointerType;
95
+ handler(event, event.pointerType);
96
+ }, [handler]);
97
+ return {
98
+ onClick: import_react.useCallback((event) => {
99
+ if (event.detail === 0) {
100
+ handler(event, "keyboard");
101
+ return;
102
+ }
103
+ if ("pointerType" in event) handler(event, event.pointerType);
104
+ else handler(event, lastClickInteractionTypeRef.current);
105
+ lastClickInteractionTypeRef.current = "";
106
+ }, [handler]),
107
+ onPointerDown: handlePointerDown
108
+ };
109
+ }
110
+ // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
111
+ function useOpenMethodTriggerProps(open, setOpenMethod) {
112
+ const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
113
+ if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
114
+ }));
115
+ return import_react.useMemo(() => ({
116
+ onClick,
117
+ onPointerDown
118
+ }), [onClick, onPointerDown]);
119
+ }
120
+ /**
121
+ * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
122
+ *
123
+ * @param open The open state of the component.
124
+ */
125
+ function useOpenInteractionType(open) {
126
+ const [openMethod, setOpenMethod] = import_react.useState(null);
127
+ const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
128
+ useValueChanged(open, (previousOpen) => {
129
+ if (previousOpen && !open) setOpenMethod(null);
130
+ });
131
+ return import_react.useMemo(() => ({
132
+ openMethod,
133
+ triggerProps
134
+ }), [openMethod, triggerProps]);
135
+ }
136
+ export { useOpenMethodTriggerProps as n, useClick as r, useOpenInteractionType as t };
@@ -0,0 +1,26 @@
1
+ import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
2
+ import { Nr as NOOP, s as require_shim } from "./button-BqA1urbl.js";
3
+ // ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
4
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
+ var import_shim = require_shim();
6
+ /**
7
+ * Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.
8
+ * Detached triggers use this to follow a handle as a root attaches or detaches: while no root is
9
+ * attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and
10
+ * read from the live root store.
11
+ *
12
+ * Returns `undefined` when no handle is provided so callers can fall back to their root context.
13
+ *
14
+ * @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.
15
+ */
16
+ function usePopupHandleStore(handle) {
17
+ const subscribe = import_react.useCallback((listener) => {
18
+ if (handle === void 0) return NOOP;
19
+ return handle.subscribeStore(listener);
20
+ }, [handle]);
21
+ const getSnapshot = import_react.useCallback(() => {
22
+ return handle === void 0 ? void 0 : handle.store;
23
+ }, [handle]);
24
+ return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore);
25
+ }
26
+ export { usePopupHandleStore as t };
@@ -1,6 +1,6 @@
1
1
  import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
2
  import { n as createServerFn } from "../server.js";
3
- import { S as COMPANION_DIGEST_PATTERN } from "./studio-qRvQjRpz.js";
3
+ import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
4
4
  // src/server/vault.ts?tss-serverfn-split
5
5
  var MAX_CONTENT = 5242880;
6
6
  function companionOf(input) {
@@ -1,120 +1,13 @@
1
- import { C as useMediaQuery, at as Tooltip, m as ViewPlaceholder, nt as useVaultUi, o as Route, ut as useSuspenseQuery } from "./router-CPt0TAk_.js";
2
- import { _ as saveVaultFile, at as useNavigate, f as vaultChildrenQuery, g as previewVaultFile, h as getVault, i as afterVaultRefresh, it as Link, m as vaultQuery, p as vaultMatchesQuery, r as afterVaultFileChange, u as shellQuery } from "./studio-queries-Dqf-3nzj.js";
3
- import { t as useMutation } from "./useMutation-DpBIuWXt.js";
4
- import { Lr as useQuery, ct as ROW, n as buttonVariants, r as Icon, rt as ListCard, t as Button } from "./button-D6bvrFmm.js";
5
- import { m as useQueryClient, t as cn } from "./cn-FXJAM0KO.js";
1
+ import { Ct as Tooltip, Lt as useSuspenseQuery, M as ViewPlaceholder, Rt as useQuery, V as useMediaQuery, s as Route, yt as useVaultUi } from "./router-DcWe0J7Y.js";
2
+ import { b as saveVaultFile, d as shellQuery, dt as useNavigate, h as vaultQuery, i as afterVaultRefresh, m as vaultMatchesQuery, p as vaultChildrenQuery, r as afterVaultFileChange, ut as Link, v as getVault, y as previewVaultFile } from "./studio-queries-ur1ygXi3.js";
3
+ import { t as useMutation } from "./useMutation-NjlA8oFY.js";
4
+ import { p as useQueryClient, t as cn } from "./cn-B0fl6NWK.js";
6
5
  import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
7
- import { a as useRouter } from "./useSelector-DUmCUXAs.js";
8
- import { t as MarkdownView } from "./markdown-view-CArpV-CS.js";
9
- // ../../node_modules/.bun/@tanstack+react-router@1.170.46+7492c01c6988791b/node_modules/@tanstack/react-router/dist/esm/useBlocker.js
10
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
11
- function _resolveBlockerOpts(opts, condition) {
12
- if (opts === void 0) return {
13
- shouldBlockFn: () => true,
14
- withResolver: false
15
- };
16
- if ("shouldBlockFn" in opts) return opts;
17
- if (typeof opts === "function") {
18
- const shouldBlock = Boolean(condition ?? true);
19
- const _customBlockerFn = async () => {
20
- if (shouldBlock) return await opts();
21
- return false;
22
- };
23
- return {
24
- shouldBlockFn: _customBlockerFn,
25
- enableBeforeUnload: shouldBlock,
26
- withResolver: false
27
- };
28
- }
29
- const shouldBlock = Boolean(opts.condition ?? true);
30
- const fn = opts.blockerFn;
31
- const _customBlockerFn = async () => {
32
- if (shouldBlock && fn !== void 0) return await fn();
33
- return shouldBlock;
34
- };
35
- return {
36
- shouldBlockFn: _customBlockerFn,
37
- enableBeforeUnload: shouldBlock,
38
- withResolver: fn === void 0
39
- };
40
- }
41
- function useBlocker(opts, condition) {
42
- const { shouldBlockFn, enableBeforeUnload = true, disabled = false, withResolver = false } = _resolveBlockerOpts(opts, condition);
43
- const router = useRouter();
44
- const { history } = router;
45
- const [resolver, setResolver] = import_react.useState({
46
- status: "idle",
47
- current: void 0,
48
- next: void 0,
49
- action: void 0,
50
- proceed: void 0,
51
- reset: void 0
52
- });
53
- import_react.useEffect(() => {
54
- const blockerFnComposed = async (blockerFnArgs) => {
55
- function getLocation(location) {
56
- const parsedLocation = router.parseLocation(location);
57
- const [, rawParams, foundRoute] = router.getMatchedRoutes(parsedLocation.pathname);
58
- if (foundRoute === void 0) return {
59
- routeId: "__notFound__",
60
- fullPath: parsedLocation.pathname,
61
- pathname: parsedLocation.pathname,
62
- params: rawParams,
63
- search: router.options.parseSearch(location.search)
64
- };
65
- return {
66
- routeId: foundRoute.id,
67
- fullPath: foundRoute.fullPath,
68
- pathname: parsedLocation.pathname,
69
- params: rawParams,
70
- search: router.options.parseSearch(location.search)
71
- };
72
- }
73
- const current = getLocation(blockerFnArgs.currentLocation);
74
- const next = getLocation(blockerFnArgs.nextLocation);
75
- if (current.routeId === "__notFound__" && next.routeId !== "__notFound__") return false;
76
- const shouldBlock = await shouldBlockFn({
77
- action: blockerFnArgs.action,
78
- current,
79
- next
80
- });
81
- if (!withResolver) return shouldBlock;
82
- if (!shouldBlock) return false;
83
- const canNavigateAsync = await new Promise((resolve) => {
84
- setResolver({
85
- status: "blocked",
86
- current,
87
- next,
88
- action: blockerFnArgs.action,
89
- proceed: () => resolve(false),
90
- reset: () => resolve(true)
91
- });
92
- });
93
- setResolver({
94
- status: "idle",
95
- current: void 0,
96
- next: void 0,
97
- action: void 0,
98
- proceed: void 0,
99
- reset: void 0
100
- });
101
- return canNavigateAsync;
102
- };
103
- return disabled ? void 0 : history.block({
104
- blockerFn: blockerFnComposed,
105
- enableBeforeUnload
106
- });
107
- }, [
108
- shouldBlockFn,
109
- enableBeforeUnload,
110
- disabled,
111
- withResolver,
112
- history,
113
- router
114
- ]);
115
- return resolver;
116
- }
6
+ import { ct as ROW, n as buttonVariants, r as Icon, rt as ListCard, t as Button } from "./button-BqA1urbl.js";
7
+ import { t as useBlocker } from "./useBlocker-CQtANHK8.js";
8
+ import { t as MarkdownView } from "./markdown-view-CvVBGMZV.js";
117
9
  // src/views/vault/vault-file.tsx
10
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
118
11
  var import_jsx_runtime = require_jsx_runtime();
119
12
  var eventsUrl = (companion, path) => `/api/vault/events?${new URLSearchParams({
120
13
  companion,
@@ -1,8 +1,8 @@
1
1
  import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
2
  import { n as createServerFn } from "../server.js";
3
- import { A as VIEW_PARAM, C as COMPANION_PARAM, S as COMPANION_DIGEST_PATTERN, j as companionDigest, k as STUDIO_MODE_PARAM } from "./studio-qRvQjRpz.js";
4
- import { r as specActionOffers } from "./actions-D8erOphH.js";
5
- import { i as validateStudioSearch } from "./search-b-yQesv3.js";
3
+ import { E as COMPANION_PARAM, M as VIEW_PARAM, N as companionDigest, T as COMPANION_DIGEST_PATTERN, j as STUDIO_MODE_PARAM } from "./studio-qzH-UETC.js";
4
+ import { r as specActionOffers } from "./actions-CHEFA1i9.js";
5
+ import { o as validateStudioSearch } from "./search-bltT7gwy.js";
6
6
  // src/server/views.ts?tss-serverfn-split
7
7
  var VIEWS = /* @__PURE__ */ new Set([
8
8
  "dashboard",
@@ -1,5 +1,5 @@
1
- import { t as cn } from "./cn-FXJAM0KO.js";
2
- import { it as PAGE_PAD } from "./button-D6bvrFmm.js";
1
+ import { t as cn } from "./cn-B0fl6NWK.js";
2
+ import { it as PAGE_PAD } from "./button-BqA1urbl.js";
3
3
  import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
4
4
  // src/views/warnings.tsx
5
5
  var import_jsx_runtime = require_jsx_runtime();