@p4code/cli 0.9.7 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-BDhIHi_h.mjs → binCli-CLYknQ8Q.mjs} +2397 -3012
  3. package/dist/client/.vite/manifest.json +2000 -2001
  4. package/dist/client/assets/{2NI2N5EU-sFO2CLlt.js → 2NI2N5EU-D0DC_qzC.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-CcT8Zfhc.js → 4UO7MD6I-CUZSFvTG.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-Bd_wcJLx.js → 5B3SVYGG-5ibYwkgG.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Cp0eFbVE.js → 5GK6JWQ2-DEtRbsDS.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-Czpp-hnK.js → 5N7A7DKN-CwQP1dKj.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-C6OEDFC6.js → 5OC2THR4-BriFYPQx.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-DUo-T0Pv.js → 5S6HY5KT-BBNxENgt.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-ZY7dYS3y.js → 6IMQ5BUJ-xl7U-rLA.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-KMXuFNsu.js → 6OLKWJ4F-BGGDxoUW.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-aJ6kvSey.js → 74OO7NKP-9vkDTl8T.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-DIHv8J29.js → 75O6YZUN-B9ocscUs.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-JuMUaReb.js → 77XECAW3-DQ3S_7U7.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-2Yn9PEzm.js → ABYRPUBD-DFu3UszL.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-Dxu9crTa.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-Cd_V66Dq.js → AnimatedHeight-DEH7bEtg.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-z6JhHCp1.js → AuthSurfaceShell-DDlvsg4m.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-D5xDmPxh.js → BB2UYUI2-DzdR7ZyB.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-B9FvXzqk.js → BUM34MOA-LkeHTV8a.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-Dx_FGvDv.js → CEQABKGZ-BX1CWous.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-DGpvh6KQ.js → CXAC5362-DMlUWuvv.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-CXEX1qrn.js +2 -0
  25. package/dist/client/assets/ChatMarkdown-yTbjRmgo.js +48 -0
  26. package/dist/client/assets/{CheckboxIndicator-mFuXoA30.js → CheckboxIndicator-DSA5Ujdj.js} +2 -2
  27. package/dist/client/assets/{ClippedText-3QYVxO0t.js → ClippedText-DlUFaCzw.js} +2 -2
  28. package/dist/client/assets/CodexSetupSection.logic-D3odRubx.js +2 -0
  29. package/dist/client/assets/{ComboboxClear-BNtFgSHF.js → ComboboxClear-DkaA60b7.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-sq7Mhle4.js → ComboboxGroupLabel-AEuoHUH8.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-DHXlU5C7.js → CommandBlock-BUHVWYBr.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-qOyyjScc.js → ComposerPromptEditor-zRTz5xec.js} +11 -11
  33. package/dist/client/assets/{CompositeRoot-DY7iUA_s.js → CompositeRoot-38NDvFsA.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-xhfXplsX.js → ConnectionDiagnosisDetails-WKkRENJB.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-BBmbajLh.js → ConnectionStatusDot-B-U5Wv6b.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-v1NbOvdX.js → DRLTVNUE-CNkbJcIE.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Dgv-rkDR.js → DYY6UVD2-Csqmb0Yg.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Cyg1Yk9F.js → DevicePanel-B3G_KDJN.js} +2 -2
  39. package/dist/client/assets/DeviceSetup-DqTJRSli.js +2 -0
  40. package/dist/client/assets/{DialogTitle-9BKGozK3.js → DialogTitle-Bz-7IYD8.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-shKWlLXb.js → DiffCommentAnnotation-C3_yEiAB.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-Cw3IoBPF.js → DiffFileTree-BJxoYt-I.js} +2 -2
  43. package/dist/client/assets/DiffPanel-Bfxdj8td.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-DwAxcJ_J.js → DiffWorkerPoolProvider-DPfZNt42.js} +3 -3
  45. package/dist/client/assets/{EmbeddedDesign-BwBy_4w8.js → EmbeddedDesign-CsCt-RW1.js} +5 -5
  46. package/dist/client/assets/{EnvironmentMachineIcon-KqncPHh8.js → EnvironmentMachineIcon-CKfntUmE.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-CEDcsLah.js → ExpandableText-DGu2RH_j.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-D_GK0hHx.js → FNOVOB4O-CH8BTfJM.js} +2 -2
  49. package/dist/client/assets/{FieldControl-CVCCrg1T.js → FieldControl-DAh0lUDV.js} +2 -2
  50. package/dist/client/assets/{FileDiff-CkTyrHs_.js → FileDiff-C1enHrMi.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-pD3XdWFT.js → FilePreviewPanel-67DQ3_gp.js} +5 -5
  52. package/dist/client/assets/{FoldedSettingsSection-VcaJg5wH.js → FoldedSettingsSection-CILGGC6I.js} +2 -2
  53. package/dist/client/assets/{FormContext-CbLQYizu.js → FormContext-BdrDIRv0.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-B_87CdVQ.js → HDGCDEEZ-Ox1-cFjL.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-BWrZ2oua.js → HSJLKHB7-BEBG51eo.js} +2 -2
  56. package/dist/client/assets/{Icons-CQY6Z_tn.js → Icons-C-FXpOud.js} +2 -2
  57. package/dist/client/assets/Input-DWhR3WLZ.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-K5yyV5fj.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-Dl_xvRh8.js → K3MD6TGW-DhfhwRRq.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-CMEWK15T.js → K7RP3OMA-DdE8zx2_.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-6SIFjdPx.js → KeybindingsSettings.logic-Ddu7cDVA.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-BYodQH-L.js → LHDIQX7Q-_CTEfstz.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-qRQxfpo6.js → LUXOKEGN-BZTFKFlr.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-DEu7ewh2.js → MathTypeset-hiZgZUOa.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-D39dZXbh.js → N3JZAHOW-CC607oJ3.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-DesFcM7Z.js → NUIALGQ3-YZiFnb1D.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-DR2kWrZ4.js → NoProjectsHero-BaAbresy.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-xGzNLFO_.js → O65XPQGZ-CJWG3hrr.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-D_A5CSzR.js → O7XIQ6OM-CO58SxOd.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-wUDkF0Vl.js → OFQON5FD-ZVCn5Afz.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-CCDq5J6P.js → P4ConnectAccountPages-nuGk_jH6.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-CX9WTYV1.js → P4ConnectSidebarSignIn-DMU_ZGur.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-CDUmALBZ.js → PJQHF43J-Dyo99try.js} +2 -2
  74. package/dist/client/assets/PanelLayoutControls-CwJW9Vo-.js +216 -0
  75. package/dist/client/assets/{PierreEntryIcon-Cuq8Bvxz.js → PierreEntryIcon-BGnGqbZS.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-CaIeAISC.js → PopoverHandle-BGTDdU32.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-C914U2vc.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-Bxz5MdOY.js → ProjectDefaultsSettings-B8-DHhbT.js} +2 -2
  79. package/dist/client/assets/ProjectFavicon-Bnd4lTxL.js +3 -0
  80. package/dist/client/assets/{ProjectIconPickerDialog-DqEEBoMA.js → ProjectIconPickerDialog-D_7XapzM.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-CjI4Va2u.js → ProjectMonogram-BRycZjMZ.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-UctA57cb.js → ProviderAuthTerminal-ejODeZci.js} +2 -2
  83. package/dist/client/assets/ProviderModelPicker-BigVoJfZ.js +2 -0
  84. package/dist/client/assets/{ProviderSettingsForm-BEq2pSXW.js → ProviderSettingsForm-TxiFYWfI.js} +2 -2
  85. package/dist/client/assets/PullRequestCodeTab-D99_acmK.js +6 -0
  86. package/dist/client/assets/{RHNBAITX-C7xWa0v8.js → RHNBAITX-B2MpzGNB.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-BzoQdNnt.js → ReadOnlySourcePreview-Clh1I7db.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-BQJlFG3C.js → RenderErrorBoundary-UQ8iqwRx.js} +3 -3
  89. package/dist/client/assets/{SLD4V6NK-DmuNvRiU.js → SLD4V6NK-DDlJ2xA8.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-BslOTNM_.js → ScheduledTasksSettings-VxM8-W1a.js} +4 -4
  91. package/dist/client/assets/{ScopedSwitch-B93s5VHZ.js → ScopedSwitch-B9HsEBfG.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-Dhc-TjWb.js → ScrollAreaCorner-DaAMqe_x.js} +2 -2
  93. package/dist/client/assets/{SecretInput-B2ihrOsq.js → SecretInput-Dfsqp38C.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-krk2Fk-_.js → SelectScrollUpArrow-CBbON2Cr.js} +2 -2
  95. package/dist/client/assets/SettingsPanels-D16J4fBs.js +46 -0
  96. package/dist/client/assets/{SettingsPanels.logic-Bl4RFuAy.js → SettingsPanels.logic-DLPcHVw0.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-LfKqlEQx.js → SettingsScopeNotice-CLuK5ZOQ.js} +2 -2
  98. package/dist/client/assets/{SidebarStageBackdrop-6e7hvpNA.js → SidebarStageBackdrop-Bgae69g1.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-CiK8lMNJ.js → T3PCR2KE-DQ6cSkUG.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-BdJsjYHm.js → TKWO2OVW-DlInq0TH.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-CRJjDWez.js → TSHNXIZL-DL8cfasx.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-D8zwe2Nv.js → ThemeEditorPanel-Dhd_0CzC.js} +2 -2
  103. package/dist/client/assets/ThreadTerminalDrawer-Bga-TMJR.js +5 -0
  104. package/dist/client/assets/{TooltipViewport-MMBPNW3u.js → TooltipViewport-UaR0JZsl.js} +2 -2
  105. package/dist/client/assets/{UQJE5E4I-V8ZBwQ4s.js → UQJE5E4I-WMwM-nEH.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-B5nY9-j7.js → USNYFO5S-D-mgcpxb.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-CzVPu6W0.js → Virtualizer-CUj2Cqvm.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-roZxnVYX.js → WEVWDWVA-CiAqWYrx.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-DHwNjJoP.js → WorkspaceBreadcrumb-D8GTBuA5.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-BEL6F4GP.js → WorkspacePageContainer-BKXvWv-9.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-eTadd7tx.js → WorkspacePageHeader-zMZD9Zz8.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-3waZyk5u.js → X5RFHQXM-YS48_sFp.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-B2f7sUz7.js → X62E3GBT-C444MNd3.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-C4ImOubv.js → XBNEOJTC-0O1bjE8y.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-D1HZySVT.js → YHV2MVVZ-Coy_OiWg.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-B95ZHwnq.js → YURCZMG2-Lc2Tv_HR.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-Ba9ElJXR.js → YVG2LODB-CWUTdxUc.js} +2 -2
  118. package/dist/client/assets/_chat-BWNTWBCr.js +45 -0
  119. package/dist/client/assets/_chat.design-CajRPBez.js +2 -0
  120. package/dist/client/assets/_chat.index-OsM078CN.js +2 -0
  121. package/dist/client/assets/_chat.new-BI8wuTGQ.js +4 -0
  122. package/dist/client/assets/_chat.pull-requests-Alx1g9Xh.js +2 -0
  123. package/dist/client/assets/{alert-BeaSxmEt.js → alert-RktpFBv6.js} +2 -2
  124. package/dist/client/assets/{assetUrls-DSRw9lrZ.js → assetUrls-COCOS1bm.js} +2 -2
  125. package/dist/client/assets/assets-B36wSN1M.js +2 -0
  126. package/dist/client/assets/{browserHistoryStore-Cb-pQxvb.js → browserHistoryStore-CBcm7bje.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-DnEgq1JN.js → browserLinkTarget-D-M5yQc0.js} +2 -2
  128. package/dist/client/assets/{checkbox-BwnKO_BU.js → checkbox-vIS3kn6A.js} +2 -2
  129. package/dist/client/assets/{color-picker-D8AK_9SM.js → color-picker-vozMHo5G.js} +2 -2
  130. package/dist/client/assets/{combobox-CXEo8oot.js → combobox-CzEFd5LA.js} +2 -2
  131. package/dist/client/assets/{command-BAykm7lf.js → command-CLf9yckl.js} +2 -2
  132. package/dist/client/assets/{connect-DsnzdYd-.js → connect-BoLhf5rG.js} +2 -2
  133. package/dist/client/assets/{connect-agent-BHUM9uJ5.js → connect-agent-BUjhhqbv.js} +2 -2
  134. package/dist/client/assets/{design-BugojS6P.js → design-LeaOcSZl.js} +2 -2
  135. package/dist/client/assets/device-D9IuUJmU.js +2 -0
  136. package/dist/client/assets/{dialog-CsGXTrQp.js → dialog-B69qrNtB.js} +2 -2
  137. package/dist/client/assets/{diffRendering-WBaaL1Hw.js → diffRendering-DU37Uneg.js} +2 -2
  138. package/dist/client/assets/{dist-CEhsFKQt.js → dist-CtnQm06p.js} +3 -3
  139. package/dist/client/assets/{draft-input-DSO1M98X.js → draft-input-BUsvwNIU.js} +2 -2
  140. package/dist/client/assets/{duoViewer-DWTF6ZzH.js → duoViewer-CPd6U9x5.js} +2 -2
  141. package/dist/client/assets/{dynamic-cm3g4l5C.js → dynamic-DDiw9bBP.js} +2 -2
  142. package/dist/client/assets/{embeddedScripts-CCEJSzbY.js → embeddedScripts-DjnGPWZd.js} +2 -2
  143. package/dist/client/assets/{empty-D39LEkAH.js → empty-B1FuCXoG.js} +2 -2
  144. package/dist/client/assets/entities-Cd_YDhEa.js +2 -0
  145. package/dist/client/assets/{fileLinks-BGiaZuCI.js → fileLinks-DzCsEQpS.js} +2 -2
  146. package/dist/client/assets/{fileTreeExpansion-B5-rhZPf.js → fileTreeExpansion-eHhwnC6l.js} +2 -2
  147. package/dist/client/assets/{getDiffFileInput-BVsGumGL.js → getDiffFileInput-eC26FmPf.js} +2 -2
  148. package/dist/client/assets/{guideRunStore-CIC0I9tc.js → guideRunStore-CugTzRRn.js} +2 -2
  149. package/dist/client/assets/{htmlRender-CuZDEfr_.js → htmlRender-CcVnPpcS.js} +2 -2
  150. package/dist/client/assets/{index-DFvDwgHR.js → index-CZlF3wQ9.js} +3 -3
  151. package/dist/client/assets/{input-DTnuNfU_.js → input-D8R-9BO3.js} +2 -2
  152. package/dist/client/assets/{input-group-ZnG52HFh.js → input-group-CevCumL6.js} +2 -2
  153. package/dist/client/assets/{kbd-NONAAU_c.js → kbd-Fy-v90ND.js} +2 -2
  154. package/dist/client/assets/keybindings-DMghyE3A.js +2 -0
  155. package/dist/client/assets/{lazy-BGLv0LoM.js → lazy-BA6aXmZc.js} +4 -4
  156. package/dist/client/assets/{lazyRouteComponent-D02c00C-.js → lazyRouteComponent-DVNAnyiv.js} +2 -2
  157. package/dist/client/assets/{link-oQzJ7nu3.js → link-ci_EPfAz.js} +2 -2
  158. package/dist/client/assets/{linkedPrompt-C_XIR4Xr.js → linkedPrompt-CPHt2jcO.js} +2 -2
  159. package/dist/client/assets/{main-DsXJbQH-.css → main-B-tAk2zT.css} +1 -1
  160. package/dist/client/assets/main-om7hc1qE.js +37 -0
  161. package/dist/client/assets/{mediaReference-DKoeCSSJ.js → mediaReference-CZmbKByR.js} +2 -2
  162. package/dist/client/assets/{mediaSource-CENz-NYA.js → mediaSource-DX6oP8x9.js} +2 -2
  163. package/dist/client/assets/{number-field-D1mdZQVp.js → number-field-CmK8oJMM.js} +2 -2
  164. package/dist/client/assets/{observeResize-BNf0FASw.js → observeResize-YxzDUnDW.js} +2 -2
  165. package/dist/client/assets/{onboarding-B-b2hpCr.js → onboarding-eClefFKp.js} +2 -2
  166. package/dist/client/assets/openFileInPreview-H9M5FxLy.js +2 -0
  167. package/dist/client/assets/{p4ProjectFile-BQUacEue.js → p4ProjectFile-BC2tSEs4.js} +2 -2
  168. package/dist/client/assets/{pair-DTrJC971.js → pair-BUZJqgA1.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-BsAQrtOv.js → pendingSendStore-C5UcT8R0.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-D64KFma1.js → phoneViewer-fmWF20qy.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-CtTUePAY.js → pierre-icons-DlYshDSm.js} +2 -2
  172. package/dist/client/assets/{popover-Cr0R7gdF.js → popover-CtJuJW_f.js} +2 -2
  173. package/dist/client/assets/{preview-C1PD_g9k.js → preview-D-Cm6hTR.js} +2 -2
  174. package/dist/client/assets/{preview-BuuE-gMP.js → preview-DtLn0r5X.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-v5xBLM6_.js → previewMiniPlayerStore-BQgCK2RM.js} +2 -2
  176. package/dist/client/assets/primary-CuSE-Dwp.js +2 -0
  177. package/dist/client/assets/primaryCloudLinkState-BsKyx6nh.js +2 -0
  178. package/dist/client/assets/projectFilesQueryState-FiXJc2AO.js +2 -0
  179. package/dist/client/assets/projectScriptEditor-CwMYFrgO.js +2 -0
  180. package/dist/client/assets/{providerSkills-CK0_chtE.js → providerSkills-DRtgduYo.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-BmPSn0PA.js → pullRequestDetail.logic-CqcRjGbR.js} +4 -4
  182. package/dist/client/assets/{pullRequestIcons-CfKXhDuO.js → pullRequestIcons-Bk_-BZhA.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-CrDUhUKX.js → pullRequestReviewStore-Br0qNCn2.js} +2 -2
  184. package/dist/client/assets/pullRequests-C9YbqDXl.js +2 -0
  185. package/dist/client/assets/queries-DMkaYL1H.js +2 -0
  186. package/dist/client/assets/query-B1dBedyO.js +2 -0
  187. package/dist/client/assets/{radio-group-CkR7fabD.js → radio-group-CQTaM9n2.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-BJowI8SS.js → renderScheduler-fJB2sQwM.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-DUtuG_mq.js → rightPanelStore-C5nnGDev.js} +2 -2
  190. package/dist/client/assets/runtime-B6yGAVz4.js +6 -0
  191. package/dist/client/assets/runtime-BhGr1QCf.js +3 -0
  192. package/dist/client/assets/{runtimeModeConfig-CZ3ZrCmY.js → runtimeModeConfig-Htoh7tJb.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-YVexB6ub.js → scheduledTasksSettings.logic-DRYrMw8R.js} +3 -3
  194. package/dist/client/assets/{scroll-area-D1ITiKsD.js → scroll-area-DJaTwtcr.js} +2 -2
  195. package/dist/client/assets/{select-CT4O76xq.js → select-BFALokxW.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-wLxnhAIe.js → selfImproveFindings-H2XgphDi.js} +2 -2
  197. package/dist/client/assets/server-Dc9414wM.js +2 -0
  198. package/dist/client/assets/session-B6T_Arzf.js +2 -0
  199. package/dist/client/assets/session-logic-BaSoFnqy.js +26 -0
  200. package/dist/client/assets/settings-BkLvGwfm.js +2 -0
  201. package/dist/client/assets/{settings.appearance-CJCZI-Xj.js → settings.appearance-OuApP6hX.js} +2 -2
  202. package/dist/client/assets/settings.archived-DLycLGH2.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-CijjzsIQ.js → settings.computer-use-DbtSE70m.js} +2 -2
  204. package/dist/client/assets/settings.connections-D8EmrGJK.js +2 -0
  205. package/dist/client/assets/{settings.data-controls-DkLkW74X.js → settings.data-controls-DqM0dqdr.js} +2 -2
  206. package/dist/client/assets/settings.decisions-BNBjCRqL.js +2 -0
  207. package/dist/client/assets/{settings.designs-DS1WBGjv.js → settings.designs-BIB7y5ry.js} +2 -2
  208. package/dist/client/assets/settings.diagnostics-CZPZhIn-.js +2 -0
  209. package/dist/client/assets/{settings.general-BWHDfXfO.js → settings.general-D73jxwiz.js} +2 -2
  210. package/dist/client/assets/settings.integrations-Vq3IT0_R.js +2 -0
  211. package/dist/client/assets/{settings.keybindings-tc_MLaPn.js → settings.keybindings-DMI2SOqT.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-ucPvq0ML.js → settings.open-source-licenses-QRv0v3-V.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-M2Rc23zw.js → settings.plugins-Ddb8m4nE.js} +4 -4
  214. package/dist/client/assets/settings.projects-r-irj-Zr.js +4 -0
  215. package/dist/client/assets/settings.providers-Ce4kHZsP.js +3 -0
  216. package/dist/client/assets/{settings.scheduled-tasks-BTioGx2i.js → settings.scheduled-tasks-RWniN8Lw.js} +2 -2
  217. package/dist/client/assets/settings.snap-shot-D6hiK4XK.js +2 -0
  218. package/dist/client/assets/settings.source-control-GPOjx565.js +2 -0
  219. package/dist/client/assets/settings.storage-CZsmFyZ8.js +2 -0
  220. package/dist/client/assets/settingsLayout-CthOqZyP.js +3 -0
  221. package/dist/client/assets/{sidebar-DRWJdn3r.js → sidebar-BDFu5cf2.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-BRZt_Xqk.js → sidebarProjectGrouping-CURnoavN.js} +2 -2
  223. package/dist/client/assets/{skeleton-DOfA4sjN.js → skeleton-CIpn5ufH.js} +2 -2
  224. package/dist/client/assets/{sourceControl-CKZL-8Mu.js → sourceControl-DjMIOzv1.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-D-frc1l_.js → sourceControlClients-C2uvUFSM.js} +2 -2
  226. package/dist/client/assets/{spinner-DMCmqCAh.js → spinner-t32AzjJr.js} +2 -2
  227. package/dist/client/assets/{terminal-links-Cdw7HYhQ.js → terminal-links-D6dqW3h9.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-DGp0Zt7-.js → terminalSessions-DoRkjVz9.js} +2 -2
  229. package/dist/client/assets/{textarea-B2ogIlGU.js → textarea-EVmRNBWL.js} +2 -2
  230. package/dist/client/assets/{themePalette-CiLEjm0l.js → themePalette-01TQqdkx.js} +3 -3
  231. package/dist/client/assets/toast-UFTwkJWj.js +2 -0
  232. package/dist/client/assets/{toggle-BrZqohX5.js → toggle-Dqrwe7LT.js} +2 -2
  233. package/dist/client/assets/{toggle-group-DpO88ac2.js → toggle-group-DS75Gx6B.js} +2 -2
  234. package/dist/client/assets/{tooltip-QdplMyeY.js → tooltip-B1rLXiVx.js} +2 -2
  235. package/dist/client/assets/{uiStateStore-vt_JyvTj.js → uiStateStore-_K2mvZYL.js} +2 -2
  236. package/dist/client/assets/{usage-CHD3cyvN.js → usage-DwGF-B0Q.js} +2 -2
  237. package/dist/client/assets/{usageAccess-DVnjHuB7.js → usageAccess-YanE4PaX.js} +2 -2
  238. package/dist/client/assets/{usageFormat-tjRl8Hbq.js → usageFormat-Bgm6YXnR.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-DMKWst47.js → usageShortcuts-D6H92HUx.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-BfhNaUIU.js → use-atom-command-BT7sz8Lx.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-BlIdXeWO.js → useAriaLabelledBy-CCDZPAYX.js} +2 -2
  242. package/dist/client/assets/{useHandleNewThread-Bv9hl6Vv.js → useHandleNewThread-nNF3Xnbt.js} +2 -2
  243. package/dist/client/assets/{useLocation-jsSq4KCV.js → useLocation-CDlqpnf6.js} +2 -2
  244. package/dist/client/assets/{useNavigate-ut7tie8O.js → useNavigate-mNhNGdvJ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-DQAO81KK.js → useNavigateBack-zj9tpAPV.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-IuajGXvV.js → useP4ConnectAuthPrompt-CkJyw_jV.js} +2 -2
  247. package/dist/client/assets/{useParams-2ErCyxxB.js → useParams-CZ_VOC6E.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-BlueIAuh.js → usePermissionStatus-DFE8UnJC.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-VZpGy8dq.js → usePullRequestActions-CVcuaade.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-BTyFUE5E.js → useRegisterFieldControl-gW7DDA6v.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-CH6hfrU_.js → useScopedModelAvailability-BCNsRHrC.js} +2 -2
  252. package/dist/client/assets/useSettings-BAP_yCCK.js +3 -0
  253. package/dist/client/assets/utils-Dv1DrWoz.js +37 -0
  254. package/dist/client/assets/vcsRefInvalidation-BI3mMuIW.js +2 -0
  255. package/dist/client/assets/welcome-CfpSLEhO.js +2 -0
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-DKZZL6cd.mjs → renderer-B3Ia4LBS.mjs} +2 -2
  258. package/dist/{runtime-Bbjyj8bt.mjs → runtime-DvE0t3kv.mjs} +4 -38
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-CW_9Mq9o.js +0 -2
  261. package/dist/client/assets/ChatGptUsageButton-hgahwAd8.js +0 -2
  262. package/dist/client/assets/ChatMarkdown-DzBQ6o2z.js +0 -48
  263. package/dist/client/assets/CodexSetupSection.logic-BBoRdk5p.js +0 -2
  264. package/dist/client/assets/DeviceSetup-C2Zve35j.js +0 -2
  265. package/dist/client/assets/DiffPanel-DhYILwt4.js +0 -2
  266. package/dist/client/assets/Input-Bple6iXe.js +0 -2
  267. package/dist/client/assets/JZOYTAAL-BMx5dMBx.js +0 -1
  268. package/dist/client/assets/PanelLayoutControls-C34I_7ba.js +0 -216
  269. package/dist/client/assets/PreviewPanel-CG-MeUjw.js +0 -2
  270. package/dist/client/assets/ProjectFavicon-DCKipqYA.js +0 -3
  271. package/dist/client/assets/ProviderModelPicker-QRPUsruj.js +0 -2
  272. package/dist/client/assets/PullRequestCodeTab-DQDQ2-AY.js +0 -6
  273. package/dist/client/assets/SettingsPanels-DxAtLrQJ.js +0 -46
  274. package/dist/client/assets/ThreadTerminalDrawer-Dscicgos.js +0 -5
  275. package/dist/client/assets/_chat-CAKiqq8Z.js +0 -45
  276. package/dist/client/assets/_chat.design-xDdLq2Pm.js +0 -2
  277. package/dist/client/assets/_chat.index-DZFF0AGm.js +0 -2
  278. package/dist/client/assets/_chat.new-UcQULkDl.js +0 -4
  279. package/dist/client/assets/_chat.pull-requests-wqTxTIsj.js +0 -2
  280. package/dist/client/assets/assets-DhuueFtK.js +0 -2
  281. package/dist/client/assets/device-CH53vde0.js +0 -2
  282. package/dist/client/assets/entities-BjGK6yEY.js +0 -2
  283. package/dist/client/assets/keybindings-CCgj9REF.js +0 -2
  284. package/dist/client/assets/main-BqFaDMNs.js +0 -37
  285. package/dist/client/assets/openFileInPreview-CLTNM-qs.js +0 -2
  286. package/dist/client/assets/primary-BMTtrcja.js +0 -2
  287. package/dist/client/assets/primaryCloudLinkState-CJaRG6QK.js +0 -2
  288. package/dist/client/assets/projectFilesQueryState-CZkTtV37.js +0 -2
  289. package/dist/client/assets/projectScriptEditor-BApTdMa4.js +0 -2
  290. package/dist/client/assets/pullRequests-D-lKKR28.js +0 -2
  291. package/dist/client/assets/queries-CEdylITb.js +0 -2
  292. package/dist/client/assets/query-DM1uxcKV.js +0 -2
  293. package/dist/client/assets/runtime-Du_4upLP.js +0 -6
  294. package/dist/client/assets/runtime-mXszmljC.js +0 -3
  295. package/dist/client/assets/server-BRIc5okw.js +0 -2
  296. package/dist/client/assets/session-logic-BiU6P8DR.js +0 -26
  297. package/dist/client/assets/session-wmJod3Hf.js +0 -2
  298. package/dist/client/assets/settings-NLDl4Bmy.js +0 -2
  299. package/dist/client/assets/settings.archived-CLWZylu3.js +0 -2
  300. package/dist/client/assets/settings.connections-Cf7-ZN_h.js +0 -2
  301. package/dist/client/assets/settings.decisions-JeevVBZt.js +0 -2
  302. package/dist/client/assets/settings.diagnostics-lQ8O62tl.js +0 -2
  303. package/dist/client/assets/settings.integrations-DEdu9gwQ.js +0 -2
  304. package/dist/client/assets/settings.projects-tykSh6-D.js +0 -4
  305. package/dist/client/assets/settings.providers--RJFEbkT.js +0 -3
  306. package/dist/client/assets/settings.snap-shot-BUehYnKo.js +0 -2
  307. package/dist/client/assets/settings.source-control-Dxm6Jir5.js +0 -2
  308. package/dist/client/assets/settings.storage-CrdP11yD.js +0 -2
  309. package/dist/client/assets/settingsLayout-7rl00kQL.js +0 -3
  310. package/dist/client/assets/toast-NSvYVPhH.js +0 -2
  311. package/dist/client/assets/useSettings-FRbaNpbg.js +0 -3
  312. package/dist/client/assets/utils-CxCThU1r.js +0 -37
  313. package/dist/client/assets/vcsRefInvalidation-CiJ0pwCz.js +0 -2
  314. package/dist/client/assets/welcome-CBJlRbzG.js +0 -2
@@ -1,2 +0,0 @@
1
- import{Go as e,Ho as t,Ko as n,Lo as r,Lw as i,Rw as a,Wo as o,bs as s,pT as c}from"./utils-CxCThU1r.js";import{z as l}from"./runtime-Du_4upLP.js";import{s as u,u as d}from"./rightPanelStore-DUtuG_mq.js";import{t as f}from"./mediaReference-DKoeCSSJ.js";import{u as p}from"./assets-DhuueFtK.js";import"./assetUrls-DSRw9lrZ.js";import{S as m,c as h,d as g,s as _,x as v}from"./browserHistoryStore-Cb-pQxvb.js";var y=e=>/\.(?:html?|pdf)$/i.test(e.split(/[?#]/,1)[0]??``),b=class extends c(`BrowserPreviewUnavailableError`){},x=class extends c(`BrowserSettingsReadError`){get message(){return`Saved browser settings could not be loaded.`}};async function S(i){let c=await g().catch(e=>new x({cause:e}));if(c instanceof x)return s(a(c));let f=m(i.threadRef.environmentId),p=t(i.threadRef).activeTabId,v=()=>u(d.getState().byThreadKey,i.threadRef)?.id??null,y=v(),b=await i.openPreview({environmentId:i.threadRef.environmentId,input:{threadId:i.threadRef.threadId,url:i.url,viewport:h(c),profileId:i.profileId??_(c),...f===void 0?{}:{runtime:f}}});return l(b,a=>{o(i.threadRef,i.url),i.background?(n(i.threadRef,a),p&&t(i.threadRef).activeTabId===a.tabId&&v()===y&&e(i.threadRef,p)):(r(i.threadRef,a),d.getState().openBrowser(i.threadRef,a.tabId))})}async function C(e){if(!v(e.threadRef.environmentId))return s(a(new b({message:`The integrated browser is unavailable in this runtime.`})));let t=f(e.filePath,e.workspaceRoot).relativePath!==void 0,n=await e.createAssetUrl({environmentId:e.threadRef.environmentId,input:{resource:{_tag:t?`workspace-file`:`media-file`,threadId:e.threadRef.threadId,path:e.filePath}}});if(n._tag===`Failure`)return s(n.cause);let r=p(e.httpBaseUrl,n.value.relativeUrl);return r===null?s(i(Error(`The environment returned an invalid asset URL.`))):S({threadRef:e.threadRef,url:r,openPreview:e.openPreview})}export{S as a,C as i,x as n,y as r,b as t};
2
- //# sourceMappingURL=openFileInPreview-CLTNM-qs.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ab as t,Ag as n,Hl as r,Lb as i,Ll as a,Os as ee,RS as o,Yy as s,Zo as c,aE as l,ab as u,as as d,cb as f,dC as p,eS as m,eb as h,fb as g,ls as _,nT as v,pC as y,ps as b,ts as x,us as S}from"./utils-CxCThU1r.js";import{b as C,n as w,w as T}from"./runtime-Du_4upLP.js";import{Ft as E,Nt as D}from"./runtime-mXszmljC.js";var te=h([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),O=class e extends g()(`PrimaryEnvironmentRequestError`,{operation:te,status:u,pairingLinkId:i(f),sessionId:i(f),cause:s()}){static fromCause(t){let n=ne(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},k=t(O),A=class extends g()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:u,cause:s()}){get message(){return`Invalid pairing token. Check the token and try again.`}};t(A);var j=class extends g()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:u,elapsedMs:u}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},M=class extends g()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:u}){get message(){return`Enter a pairing token to continue.`}},N=t(r),P=null,F=null,I=!1,L=2e3,R=100;function z(){return D(new URL(window.location.href))}function B(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function V(){let e=z();return e?(B(),e):null}function H(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===a);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function U(){return X(async()=>{try{return await w(C.pipe(m(e=>e.auth.session({headers:{}}))))}catch(e){throw O.fromCause({operation:`fetch-session-state`,cause:e})}})}function ne(e){return N(e)?W(e):n(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(m(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw N(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new A({providedLength:e.length,cause:t}):O.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await U();if(t.authenticated)return t;let n=Date.now()-e;if(n>=L)throw new j({timeoutMs:L,elapsedMs:n});await Z(R)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return k(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await U();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??H();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new M({providedLength:e.length});F=null,await G(t),await K(),F={status:`authenticated`},P=null,I=!1,B()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(m(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw O.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(m(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw O.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(m(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw O.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(m(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw O.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?z()&&(I=!0):I=!1,I)return{status:`requires-auth`,auth:(await U()).auth};let e=V(),t=P;if(e)F=null;else{if(t)return t;if(F?.status===`authenticated`)return F}let n=t?t.catch(()=>void 0).then(()=>(F=null,Q(e))):Q(e);return P=n,n.then(e=>(P===n&&e.status===`authenticated`&&(F=e),e)).finally(()=>{P===n&&(P=null)})}var ue=e(),$=d(y(()=>T()?p(null):o(U))).pipe(S({staleTime:5e3,revalidateOnMount:!0}),_(3e5),b(`primary-environment:session`));function de(){c.refresh($)}function fe(){let e=(0,ue.c)(8),t=x($),n=pe,r=null;if(t._tag===`Failure`){let n;e[0]===t.cause?n=e[1]:(n=v(t.cause),e[0]=t.cause,e[1]=n);let i=n;r=i instanceof Error?i.message:`Could not read environment session.`}let i;e[2]===t?i=e[3]:(i=l(ee(t)),e[2]=t,e[3]=i);let a;return e[4]!==r||e[5]!==t.waiting||e[6]!==i?(a={data:i,error:r,isPending:t.waiting,refresh:n},e[4]=r,e[5]=t.waiting,e[6]=i,e[7]=a):a=e[7],a}function pe(){de()}export{ce as a,B as c,le as i,ie as l,ae as n,se as o,z as r,oe as s,fe as t};
2
- //# sourceMappingURL=primary-BMTtrcja.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$C as t,Ab as n,Bl as r,CS as i,DC as a,DS as o,Ds as s,Gl as c,Iy as l,Kl as u,Lb as d,MT as f,Mu as p,Os as ee,Rl as te,TS as ne,Ul as re,Vl as ie,Wc as m,Wl as h,Wv as g,Xv as ae,Zo as _,aE as oe,as as se,cE as ce,cb as v,cs as le,eb as ue,fb as de,gb as fe,is as pe,ls as me,mC as y,nT as he,pS as b,pT as ge,ps as x,qx as S,rs as C,sc as w,ts as T,tv as E,us as D,xC as O,zS as k,zx as A}from"./utils-CxCThU1r.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-Du_4upLP.js";import"./runtime-mXszmljC.js";import{E as ve}from"./useSettings-FRbaNpbg.js";import{i as ye,n as z}from"./session-wmJod3Hf.js";var be=e(),xe=class extends de()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:v,activeVersion:v,activeDialogStatus:ue([`confirming`,`installing`,`closing`]),activeInstallStage:d(te)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends ge(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return b(function*(){let t=yield*P,n=yield*t.run(e,N(m.cloudGetRelayClientStatus,{})).pipe(o(q(`Could not check relay client availability.`)));if(n.status===`available`)return;if(n.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${n.platform}-${n.arch}.`});if(!(yield*O({try:()=>we(n.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let r=yield*t.runStream(e,j(m.cloudInstallRelayClient,{}).pipe(ae(e=>y(()=>Ee(e))))).pipe(g,o(q(`Could not install the relay client.`)),S(y(De)));if(ce(r)||r.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let i=r.value.status;if(i.status!==`available`)return yield*new K({message:i.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${i.platform}-${i.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=n(fe([ie,u,h,re,c,r]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?a:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return b(function*(){return yield*(yield*w(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(o(X(`Could not read environment cloud link state.`)))}).pipe(k(R))}function Fe(e){return b(function*(){let t=yield*w(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(o(X(`Could not update environment cloud preferences.`)))}).pipe(k(R))}function Ie(e){return b(function*(){yield*(yield*w(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(o(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:l.make(e.target.environmentId)}).pipe(A(e=>i(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(k(R))}var Z=`manual`;function Le(e){return b(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,i=yield*F,a=yield*w(e.target.httpBaseUrl);n&&(yield*ke(l.make(e.target.environmentId)));let s=yield*i.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(o(J(`${t}/v1/client/environment-link-challenges failed`))),c=yield*a.connect.linkProof({headers:{},payload:{challenge:s.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(o(X(`Could not obtain environment link proof.`))),u=yield*i.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:c,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(o(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:u}),yield*a.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:u.relayIssuer,cloudUserId:u.cloudUserId,environmentCredential:u.environmentCredential,cloudMintPublicKey:u.cloudMintPublicKey,endpointRuntime:u.endpointRuntime}}).pipe(o(X(`Could not configure environment relay access.`)))}).pipe(k(R))}var Re=le(t(p,L.contextEffect.pipe(ne(e=>f(e,p))))),Q=C(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(D({staleTime:5e3,revalidateOnMount:!0}),me(3e5),x(`primary-cloud-link:${t.environmentId}`))}),ze=se(s(null)).pipe(pe,x(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(l.make(e.environmentId),`relay:read`)&&_.refresh(Q($(e)))}function Ve(e){if(!z(l.make(e.environmentId),`relay:read`))return null;let t=_.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),n=ye(t?.environmentId??null,E),r;e[0]===t?r=e[1]:(r=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=r);let i=r,a;e[2]!==n||e[3]!==i?(a=i&&I()&&n?Q($(i)):ze,e[2]=n,e[3]=i,e[4]=a):a=e[4];let o=T(a),s;e[5]===i?s=e[6]:(s=()=>{Be(i)},e[5]=i,e[6]=s);let c=s,l=null;if(o._tag===`Failure`){let t;e[7]===o.cause?t=e[8]:(t=he(o.cause),e[7]=o.cause,e[8]=t);let n=t;l=n instanceof Error?n.message:`Could not read P4 Connect link state.`}let u;e[9]===o?u=e[10]:(u=o._tag===`Failure`?null:oe(ee(o)),e[9]=o,e[10]=u);let d;return e[11]!==l||e[12]!==c||e[13]!==o.waiting||e[14]!==u||e[15]!==i?(d={data:u,error:l,isPending:o.waiting,refresh:c,target:i},e[11]=l,e[12]=c,e[13]=o.waiting,e[14]=u,e[15]=i,e[16]=d):d=e[16],d}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
- //# sourceMappingURL=primaryCloudLinkState-CJaRG6QK.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ab as t,Os as n,Zo as r,aE as i,as as a,es as o,l_ as s,ll as c,nT as l,ps as u,sE as d,ts as f,ws as p}from"./utils-CxCThU1r.js";import{L as m}from"./runtime-Du_4upLP.js";import{s as h}from"./vcsRefInvalidation-CiJ0pwCz.js";import{G as g}from"./entities-BjGK6yEY.js";import{o as _}from"./queries-CEdylITb.js";var v=e(),y=``,b=a(p(!1)),x=a(p(!1)).pipe(u(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,t,n,i){let a=S(e,t,n);C.has(a)||C.set(a,r.mount(a)),r.set(a,{confirmedAgainst:void 0,data:{relativePath:n,contents:i,byteLength:new TextEncoder().encode(i).byteLength,truncated:!1}})}function k(e,t,n){return r.get(S(e,t,n))?.data??null}function A(e,t,i){let a=k(e,t,i);if(a)return a.contents;let o=r.get(E(e,t,i));return d(n(o))?.contents}function j(e,t,n){let i=r.get(S(e,t,n));return i?.confirmedAgainst===void 0?i?.data??null:null}function M(e,t,n,i){let a=S(e,t,n),o=r.get(a);if(o?.data.contents!==i)return!1;let s=E(e,t,n),l={...o,confirmedAgainst:r.get(s)};return r.set(a,l),w(a),r.refresh(s),m(r,s,{reportDefect:!1,reportFailure:!1}).then(async i=>{if(n===`p4.json`){let n=D(e,t,c);r.refresh(n),await m(r,n,{reportDefect:!1,reportFailure:!1})}i._tag===`Success`&&r.get(a)===l&&r.set(a,null)}),!0}function N(e,t,n,i){return n===null?i:r.get(S(e,t,n))?.data??i}function P(e){return e._tag===`Failure`?l(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=t(s);function L(e,t,r){let a=(0,v.c)(19),s=h(e),{canReadFiles:c}=s,l;a[0]!==c||a[1]!==t||a[2]!==r||a[3]!==e?(l=c?T(e,t,r):b,a[0]=c,a[1]=t,a[2]=r,a[3]=e,a[4]=l):l=a[4];let u=l,d=f(u),p=o(u),m;a[5]===p?m=a[6]:(m=()=>p(),a[5]=p,a[6]=m);let g=m,_;a[7]===d?_=a[8]:(_=i(n(d)),a[7]=d,a[8]=_);let y;a[9]!==c||a[10]!==s.error||a[11]!==s.isPending||a[12]!==d?(y=s.isPending?null:c?F(P(d)):s.error??`This connection cannot read host files.`,a[9]=c,a[10]=s.error,a[11]=s.isPending,a[12]=d,a[13]=y):y=a[13];let x=s.isPending||d.waiting,S;return a[14]!==g||a[15]!==_||a[16]!==y||a[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},a[14]=g,a[15]=_,a[16]=y,a[17]=x,a[18]=S):S=a[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,r,a,s){let l=(0,v.c)(36),u=a===void 0||a,d=s!==void 0&&s,p=h(e),{canReadFiles:m}=p,g=u,_;l[0]!==m||l[1]!==d||l[2]!==t||l[3]!==u||l[4]!==e||l[5]!==r?(_=u&&m?d&&r!==null?D(e,t,r):E(e,t,r):x,l[0]=m,l[1]=d,l[2]=t,l[3]=u,l[4]=e,l[5]=r,l[6]=_):_=l[6];let b=_,C=f(b),w=o(b),T;l[7]===w?T=l[8]:(T=()=>w(),l[7]=w,l[8]=T);let O=T,k;l[9]===C?k=l[10]:(k=i(n(C)),l[9]=C,l[10]=k);let A=k,j=A?.relativePath??r??y,M;l[11]!==t||l[12]!==e||l[13]!==j?(M=S(e,t,j),l[11]=t,l[12]=e,l[13]=j,l[14]=M):M=l[14];let N=f(M),L=d?c:y,R;l[15]!==t||l[16]!==e||l[17]!==L?(R=S(e,t,L),l[15]=t,l[16]=e,l[17]=L,l[18]=R):R=l[18];let z=f(R),B=r===null?null:d?z??N:N,V,H,U;if(l[19]!==m||l[20]!==A||l[21]!==p.error||l[22]!==p.isPending||l[23]!==g||l[24]!==B?.data||l[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,l[19]=m,l[20]=A,l[21]=p.error,l[22]=p.isPending,l[23]=g,l[24]=B?.data,l[25]=C,l[26]=V,l[27]=H,l[28]=U}else V=l[26],H=l[27],U=l[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return l[29]!==V||l[30]!==O||l[31]!==H||l[32]!==W||l[33]!==G||l[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},l[29]=V,l[30]=O,l[31]=H,l[32]=W,l[33]=G,l[34]=U,l[35]=K):K=l[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
- //# sourceMappingURL=projectFilesQueryState-CZkTtV37.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Sd as i,Tb as a,Vf as o,Z_ as s,__ as c,dr as l,ll as u,nh as d,on as f,qp as p,rv as m,tp as h,yf as g}from"./utils-CxCThU1r.js";import{R as ee,W as te}from"./runtime-Du_4upLP.js";import{i as _,n as v}from"./session-wmJod3Hf.js";import{t as y}from"./textarea-B2ogIlGU.js";import{t as b}from"./input-DTnuNfU_.js";import{a as ne,c as re,i as ie,o as ae,r as oe,s as se,t as ce}from"./dialog-CsGXTrQp.js";import{D as x,O as le}from"./keybindings-CCgj9REF.js";import{i as ue,o as de,t as S}from"./popover-Cr0R7gdF.js";import{f as C}from"./projectFilesQueryState-CZkTtV37.js";import{t as w}from"./p4ProjectFile-BQUacEue.js";import{l as fe}from"./KeybindingsSettings.logic-6SIFjdPx.js";import{Gr as pe,Jr as me,Kr as he,Xr as ge,Yr as _e,Zr as ve,do as T,qr as ye,sa as E}from"./main-BqFaDMNs.js";function D(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function O(e){return e.worktreePath??e.project.cwd}function k(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function A(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var j=e(t(),1),M=n(),N=`Invalid keybinding.`,P=a(c);function F(e){let t=e?.trim()??``;return t.length>0?t:null}function I(e){let t=F(e.keybinding);if(!t)return null;if(e.command===null)throw Error(N);let n=P({key:t,command:e.command});if(n._tag===`None`)throw Error(N);return n.value}function L(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var R=[];function z(e,t){let n=(0,M.c)(8),r=C(e,t??``,u,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:R},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=w(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:R},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??R,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function B(e,t){return z(e,t).scripts}var V=e(r(),1),be=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function H(e){let t=(0,M.c)(12),{icon:n,className:r}=e,a=r===void 0?`size-3.5`:r;if(n===`test`){let e;return t[0]===a?e=t[1]:(e=(0,V.jsx)(g,{className:a}),t[0]=a,t[1]=e),e}if(n===`lint`){let e;return t[2]===a?e=t[3]:(e=(0,V.jsx)(h,{className:a}),t[2]=a,t[3]=e),e}if(n===`configure`){let e;return t[4]===a?e=t[5]:(e=(0,V.jsx)(d,{className:a}),t[4]=a,t[5]=e),e}if(n===`build`){let e;return t[6]===a?e=t[7]:(e=(0,V.jsx)(o,{className:a}),t[6]=a,t[7]=e),e}if(n===`debug`){let e;return t[8]===a?e=t[9]:(e=(0,V.jsx)(i,{className:a}),t[8]=a,t[9]=e),e}let s;return t[10]===a?s=t[11]:(s=(0,V.jsx)(p,{className:a}),t[10]=a,t[11]=s),s}var U={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function W(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:L(t,x(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function G({environmentId:e,editScope:t=s,request:n,scripts:r,onSubmit:i,onDelete:a,onClose:o}){let c=_(e,t),u=_(e,m),d=j.useId(),[p,h]=(0,j.useState)(``),[g,C]=(0,j.useState)(``),[w,D]=(0,j.useState)(`play`),[O,k]=f(!c),[A,M]=(0,j.useState)(!1),[N,P]=(0,j.useState)(!1),[F,L]=(0,j.useState)(!1),[R,z]=(0,j.useState)(``),[B,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(null),[xe,J]=f(!c),[Se,Y]=(0,j.useState)(null),X=(0,j.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,j.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,j.useEffect)(()=>{n&&(h(n.initial.name),C(n.initial.command),D(n.initial.icon),k(!1),M(n.initial.runOnWorktreeCreate),P(n.initial.waitForSetup),L(n.initial.runOnSettle),z(n.initial.keybinding??``),U(n.initial.previewUrl??``),G(n.initial.autoOpenPreview),q(n.error??null),Y(null))},[n,k]);let $=()=>{X.current=null,Y(null),k(!1),o()};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ce,{open:Ce,onOpenChange:e=>{e||$()},children:(0,V.jsxs)(se,{children:[(0,V.jsxs)(ne,{children:[(0,V.jsx)(re,{children:Z?`Edit Action`:`Add Action`}),(0,V.jsx)(oe,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,V.jsx)(ae,{children:(0,V.jsx)(`form`,{id:d,onSubmit:async a=>{if(a.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){q(`This connection cannot change project actions.`);return}let o=(R.trim()||null)!==(n.initial.keybinding?.trim()||null),s=v(e,m);if(o&&!s){q(`This connection cannot change keyboard shortcuts.`);return}let c=p.trim(),l=g.trim();if(c.length===0){q(`Name is required.`);return}if(l.length===0){q(`Command is required.`);return}q(null);let u;try{let e=n.scriptId??le(c,r.map(e=>e.id)),t=I({keybinding:R,command:x(e)}),i=B.trim();u={name:c,command:l,icon:w,runOnWorktreeCreate:A,waitForSetup:A&&N,runOnSettle:F,...n.scriptId===null&&s||o?{keybinding:t?.key??null}:{},previewUrl:i.length>0?i:null,autoOpenPreview:i.length>0&&W}}catch(e){q(e instanceof Error?e.message:`Failed to save action.`);return}let d={request:n};X.current=d,Y(n),k(!1);try{let e=await i(n.scriptId,u);if(X.current===d){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);q(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===d&&q(e instanceof Error?e.message:`Failed to save action.`)}X.current===d&&(X.current=null,Y(null))},children:(0,V.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!c,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-name`,children:`Name`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(S,{onOpenChange:k,open:O,children:[(0,V.jsx)(de,{render:(0,V.jsx)(l,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,V.jsx)(H,{icon:w,className:`size-4.5`})}),(0,V.jsx)(ue,{align:`start`,children:(0,V.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:be.map(e=>{let t=e.id===w;return(0,V.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{D(e.id),k(!1)},children:[(0,V.jsx)(H,{icon:e.id,className:`size-4`}),(0,V.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,V.jsx)(b,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:p,onChange:e=>h(e.target.value)})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,V.jsx)(b,{disabled:!u,id:`script-keybinding`,placeholder:`Press shortcut`,value:R,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){z(``);return}let r=fe(n,navigator.platform);r&&z(r)}}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,V.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-command`,children:`Command`}),(0,V.jsx)(y,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>C(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,V.jsx)(b,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:B,onChange:e=>U(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,V.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,V.jsx)(T,{checked:A,onCheckedChange:e=>M(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${A?``:`opacity-60`}`,children:[(0,V.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,V.jsx)(T,{checked:N,disabled:!A,onCheckedChange:e=>P(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,V.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,V.jsx)(T,{checked:F,onCheckedChange:e=>L(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${B.trim().length===0?`opacity-60`:``}`,children:[(0,V.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,V.jsx)(T,{checked:W,disabled:B.trim().length===0,onCheckedChange:e=>G(!!e)})]}),K&&(0,V.jsx)(`p`,{className:`text-sm text-destructive`,children:K})]})})}),(0,V.jsxs)(ie,{variant:`bare`,children:[Z&&(0,V.jsx)(l,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!c,onClick:()=>J(!0),children:`Delete`}),(0,V.jsx)(l,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,V.jsx)(l,{form:d,type:`submit`,disabled:Q||!c,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,V.jsx)(pe,{open:xe&&c,onOpenChange:J,children:(0,V.jsxs)(ge,{children:[(0,V.jsxs)(_e,{children:[(0,V.jsxs)(ve,{children:[`Delete action "`,p,`"?`]}),(0,V.jsx)(ye,{children:`This action cannot be undone.`})]}),(0,V.jsxs)(me,{children:[(0,V.jsx)(he,{render:(0,V.jsx)(l,{variant:`outline`}),children:`Cancel`}),(0,V.jsx)(l,{variant:`destructive`,disabled:Q||!c,onClick:()=>{n?.scriptId&&(v(e,t)?(J(!1),$(),a(n.scriptId)):q(`This connection cannot change project actions.`))},children:`Delete action`})]})]})})]})}export{B as a,L as c,k as d,D as f,W as i,O as l,G as n,z as o,H as r,I as s,U as t,A as u};
2
- //# sourceMappingURL=projectScriptEditor-BApTdMa4.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Iy as r,Ky as i,Lb as a,Os as o,Tb as s,Zo as c,aE as l,as as u,bg as d,cb as f,dg as p,fg as m,fs as ee,lg as te,ls as h,ob as ne,ps as g,rs as _,ts as v,ub as y}from"./utils-CxCThU1r.js";import{z as re}from"./entities-BjGK6yEY.js";import{B as ie,H as ae,V as oe,_n as se,pn as ce,t as b}from"./runtime-mXszmljC.js";import{t as x}from"./query-DM1uxcKV.js";import{n as S}from"./sourceControlClients-D-frc1l_.js";import{o as C}from"./threadSort-Bd2rijEy.js";var w=e(t(),1),T=n(),le=e=>`${e.environmentId??``} ${e.host}`,E={reviewRequested:`Review requested`,authored:`Authored`,others:`Others`};function D(e){let t=e?.trim().toLowerCase()??``;return t.length>0?t:null}function ue(e){let t=e?.trim().replace(/^#/,``)??``;return/^[0-9a-fA-F]{6}$/.test(t)?`#${t}`:null}function de(e,t){let n=new Map,r=new Map,i=new Map(e.map(e=>[F(e),e]));for(let e of i.values()){let i=t===`all`||e.state===t;if(e.author!==null){let t=D(e.author.login);if(t!==null){let r=n.get(t);n.set(t,{actor:r?.actor??e.author,count:(r?.count??0)+Number(i),mergedCount:(r?.mergedCount??0)+Number(e.state===`merged`)})}}if(i)for(let t of e.labels){let e=D(t.name);if(e===null)continue;let n=r.get(e);r.set(e,{...t,name:n?.name??t.name,color:n?.color??t.color,count:(n?.count??0)+1})}}return{authors:[...n.values()].filter(e=>e.count>0).toSorted((e,t)=>t.mergedCount-e.mergedCount||t.count-e.count||e.actor.login.localeCompare(t.actor.login)),labels:[...r.values()].toSorted((e,t)=>t.count-e.count||e.name.localeCompare(t.name))}}function O(e,t){return D(t[le(e)]??t[e.host])}function k(e,t){let n=O(e,t);return n!==null&&D(e.author?.login)===n}var fe={approved:`approved`,changes_requested:`changes-requested`,"changes-requested":`changes-requested`,required:`review-required`,"review-required":`review-required`,none:`none`},pe={success:`passing`,passing:`passing`,failure:`failing`,failing:`failing`},me=/(?:[^\s"]|"[^"]*")+/g,A=10,j=200;function M(e){return e.replaceAll(`"`,``).trim()}function N(e){if(/^\s*"[^"]*"\s*$/.test(e)){let t=M(e);return t.length===0?[]:[t]}return e.split(`,`).map(e=>M(e)).filter(e=>e.length>0)}function P(e){return e.slice(0,A).map(e=>e.slice(0,j).trim()).filter(e=>e.length>0)}function he(e){let t=[],n=[],r=[],i,a,o,s;for(let[c]of e.matchAll(me)){let e=/^(-?)([A-Za-z][A-Za-z0-9_-]*):(.*)$/.exec(c),l=e===null?``:M(e[3]??``),u=e?.[1]===`-`;switch(l.length===0?``:e?.[2]?.toLowerCase()??``){case`label`:{let t=P(N(e?.[3]??``));if(t.length===0)break;u?r.push(...t):n.push(t);continue}case`author`:if(u)break;i=l.slice(0,j).trim();continue;case`draft`:if(u||l.toLowerCase()!==`true`&&l.toLowerCase()!==`false`)break;a=l.toLowerCase()===`true`?`only`:`hide`;continue;case`review`:{let e=u?void 0:fe[l.toLowerCase()];if(e===void 0)break;o=e;continue}case`status`:case`checks`:{let e=u?void 0:pe[l.toLowerCase()];if(e===void 0)break;s=e;continue}case``:break;default:if(!l.startsWith(`/`)){let t=P(N(e?.[3]??``).map(t=>t.includes(`:`)?t:`${e?.[2]??``}:${t}`));if(t.length===0)break;u?r.push(...t):n.push(t);continue}}t.push(c)}return{text:t.join(` `),filters:{...n.length===0?{}:{labels:n.slice(0,A)},...r.length===0?{}:{excludedLabels:r.slice(0,A)},...i===void 0?{}:{author:i},...a===void 0?{}:{draft:a},...o===void 0?{}:{review:o},...s===void 0?{}:{checks:s}}}}function ge(e,t){let n=t.trim().toLowerCase();return n.length===0||`#${e.number} ${e.title} ${e.repository} ${e.headBranch} ${e.author?.login??``}`.toLowerCase().includes(n)}function _e(e,t,n){return n===`reviewing`?e.filter(e=>e.viewerReviewRequested):n===`authored`?e.filter(e=>k(e,t)):e}function ve(e,t){return e.filter(e=>(t.state===`all`||e.state===t.state)&&(t.projectId===void 0||e.projectId===t.projectId)&&(t.host===void 0||e.host===t.host))}function ye(e,t,n){let r=e.labels.map(e=>e.name.trim().toLowerCase()),i=e=>r.includes(e.trim().toLowerCase());return(t.draft===void 0||e.isDraft===(t.draft===`only`))&&(t.review===void 0||(t.review===`none`?e.reviewDecision===void 0:e.reviewDecision===t.review))&&(t.labels===void 0||t.labels.every(e=>e.some(i)))&&(t.excludedLabels===void 0||!t.excludedLabels.some(i))&&(t.author===void 0||e.author?.login.toLowerCase()===d(t.author,n).toLowerCase())}function be(e,t){let n={reviewRequested:[],authored:[],others:[]};for(let r of e)k(r,t)?n.authored.push(r):r.viewerReviewRequested?n.reviewRequested.push(r):n.others.push(r);return[`authored`,`reviewRequested`,`others`].filter(e=>n[e].length>0).map(e=>({key:e,label:E[e],entries:n[e]}))}function F(e){return`${e.environmentId===void 0?``:`${e.environmentId}:`}${e.host}:${e.repository}#${e.number}`}var I=500;function xe(e,t,n,r){let i=new Set(n.flatMap(e=>[...e.keys]));return new Set([...t].filter(t=>{let n=e.get(t);return n!==void 0&&n.additions===0&&n.deletions===0&&!i.has(t)&&!r.has(R(n))}))}function Se(e,t){let n=new Map;for(let r of t){let t=e.get(r);if(t===void 0)continue;let i=n.get(t.environmentId)??[];i.push({key:r,ref:{projectId:t.projectId,repository:t.repository,number:t.number}}),n.set(t.environmentId,i)}return[...n].flatMap(([e,t])=>{let n=[];for(let r=0;r<t.length;r+=I){let i=t.slice(r,r+I);n.push({environmentId:e,input:{refs:i.map(e=>e.ref)},keys:new Set(i.map(e=>e.key))})}return n})}function L({entriesByKey:e,candidateKeys:t,policy:n,activeBatches:r,statsByRow:i,refresh:a=!1}){let o=n===`eager`?new Set(e.keys()):t;return Se(e,a?o:xe(e,o,r,i))}function Ce({requestedScope:e,currentScope:t,entriesByKey:n,candidateKeys:r,statsByRow:i}){return e.key!==t.key||e.policy!==t.policy?null:L({entriesByKey:n,candidateKeys:r,policy:e.policy,activeBatches:[],statsByRow:i,refresh:!0})}function we(e,t){return e.filter(e=>{for(let n of e.keys)if(t.has(n))return!0;return!1})}function Te(e,t,n){let r=new Map(t.map(e=>[F(e),e])),i=new Map(n.flatMap(e=>{let t=F(e);return r.has(t)?[]:[[t,e]]})),a=[];for(let t of e){let e=F(t);r.has(e)?r.set(e,t):i.has(e)?i.set(e,t):a.push(t)}let o=(e,t)=>t.updatedAt.localeCompare(e.updatedAt);return[{key:`authored`,entries:[...r.values()].toSorted(o)},{key:`reviewRequested`,entries:[...i.values()].toSorted(o)},{key:`others`,entries:a}].filter(e=>e.entries.length>0).map(e=>({...e,label:E[e.key]}))}function Ee(e,t){if(t.length===0)return e;let n=new Map(e);for(let e of t)n.set(R(e),{additions:e.additions,deletions:e.deletions});return n}var R=e=>`${e.environmentId} ${e.projectId} ${e.number}`;function De(e){if(e.length===0)return null;let t={},n=[],r=new Map,i=[],a=[],o={},s=!1;for(let[c,l]of e){for(let[e,n]of Object.entries(l.viewers))t[`${c} ${e}`]=n;for(let e of l.providers){let t=r.get(e.host);r.set(e.host,t===void 0?e:{...t.configured?t:e,projectCount:t.projectCount+e.projectCount,searchesOnHost:t.searchesOnHost&&e.searchesOnHost,configured:t.configured||e.configured})}i.push(...l.entries.map(e=>({...e,environmentId:c}))),a.push(...l.errors.map(e=>({...e,environmentId:c}))),s||=l.truncated,l.truncated&&n.push(c),Object.keys(l.nextCursors).length>0&&(o[c]=l.nextCursors)}return{viewers:t,providers:[...r.values()],entries:i.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),errors:a,truncated:s,nextCursors:o,truncatedEnvironments:n}}var z=99,Oe=e=>[...e].sort((e,t)=>e.localeCompare(t)).join(`,`),B=e=>`p4.pullRequests.list:${e}`,V=y({...te.fields,environmentId:r}),ke=y({...p.fields,environmentId:r}),Ae=s(y({scope:f,data:y({...m.fields,entries:i(V),errors:i(ke),nextCursors:ne(f,m.fields.nextCursors),truncatedEnvironments:i(f)}),partitions:a(y({authored:i(V),reviewing:i(V)}))}));function je(e,t){try{let n=e?.getItem(B(t));if(!n)return null;let r=Ae(JSON.parse(n));return r._tag===`Some`?r.value:null}catch{return null}}function Me(e,t,n){try{e?.setItem(B(t),JSON.stringify({scope:n.scope,data:{...n.data,entries:n.data.entries.slice(0,z),errors:[],nextCursors:{},truncatedEnvironments:[]},...n.partitions===void 0?{}:{partitions:{authored:n.partitions.authored.slice(0,z),reviewing:n.partitions.reviewing.slice(0,z)}}}))}catch{}}function Ne(e,t,n){return e===void 0||!n||t.some(t=>t.id===e)?e:void 0}function Pe(e,t,n){if(n===void 0)return;let r=e.filter(e=>e.id===n);return t==null?r.length===1?r[0]:void 0:r.find(e=>e.environmentId===t)}function Fe(e,t,n,r,i){if(n!==void 0)return e.filter(e=>e===n.environmentId);if(r===void 0||!i)return e;let a=new Set(t.filter(e=>e.id===r).map(e=>e.environmentId));return e.filter(e=>a.has(e))}function Ie(e,t,n){return e===void 0?n:t.has(e)?e:n}function H(e,t){let n=t.trim().toLowerCase();if(n.length===0)return 0;let r=n.replace(/^#/u,``);if(/^\d+$/u.test(r))return String(e.number)===r?100:0;let i=e.title.toLowerCase(),a=n.split(/\s+/u).filter(e=>e.length>0);return i===n?90:i.includes(n)?80:a.length>1&&a.every(e=>i.includes(e))?70:e.headBranch.toLowerCase().includes(n)?60:(e.author?.login??``).toLowerCase().includes(n)?50:e.repository.toLowerCase().includes(n)?40:a.some(e=>i.includes(e))?30:10}function Le(e,t){return t.trim().length===0?e:e.toSorted((e,n)=>{let r=H(n,t)-H(e,t);return r===0?n.updatedAt.localeCompare(e.updatedAt):r})}function Re(e,t=e=>e.additions+e.deletions>0){let n=e=>e.mergeability===`conflicting`?4:e.state===`open`?e.isDraft?2:e.checksState===`passing`&&e.reviewDecision===`approved`?0:e.checksState===`passing`?1:2:3;return e.toSorted((e,r)=>{let i=n(e)-n(r);if(i!==0)return i;let a=Number(t(r))-Number(t(e)),o=e.additions+e.deletions-(r.additions+r.deletions);return a||o||r.updatedAt.localeCompare(e.updatedAt)})}function U(e,t){let n=e=>C(e.updatedAt);return e.toSorted((e,r)=>{let i=t(e)-t(r);if(i!==0)return i;let a=n(e),o=n(r),s=Number(a===null)-Number(o===null);return s===0?a===null||o===null?0:o-a:s})}function ze(e){return U(e,e=>e.state===`open`?e.mergeability===`conflicting`?0:e.reviewDecision===`changes-requested`?1:e.checksState===`failing`?2:e.isDraft?3:e.checksState===`passing`&&e.reviewDecision===`approved`?5:4:6)}function Be(e){return U(e,e=>e.state===`open`?0:1)}function Ve(e,t,n,r=e=>e.additions+e.deletions>0,i=`all`){let a=t=>e.map(e=>({...e,entries:t(e.entries)}));if(t===`ready`)return n.trim().length===0?a(e=>Re(e,r)):e;if(t===`blocked`){if(n.trim().length>0)return e;let t=e=>e===`others`?i:e===`authored`?`authored`:`reviewing`;return e.map(e=>{let n=t(e.key);if(n===`all`)return e;let r=n===`authored`?ze:Be;return{...e,entries:r(e.entries)}})}if(t===`updated`)return e;let o=e=>C(e.updatedAt)??C(e.createdAt)??0;return a(e=>e.toSorted((e,n)=>{if(t===`newest`||t===`oldest`){let r=C(e.createdAt),i=C(n.createdAt),a=Number(i!==null)-Number(r!==null),s=(r??0)-(i??0);return a||(t===`newest`?-s:s)||o(n)-o(e)}let i=Number(r(n))-Number(r(e)),a=e.additions+e.deletions-(n.additions+n.deletions);return i||(t===`largest`?-a:a)||o(n)-o(e)}))}function He(e,t){if(e.additions!==0||e.deletions!==0)return e;let n=t.get(R(e));return n===void 0?e:{...e,...n}}function Ue(e,t,n,r){let i={updatedAt:n.toISOString(),token:r,at:n.getTime()};switch(t){case`close`:return{state:`closed`,...i};case`reopen`:return{state:`open`,...i};case`merge`:return{state:`merged`,...i};case`draft`:return{state:e.state,isDraft:!0,...i};case`ready`:return{state:e.state,isDraft:!1,...i};default:return null}}function We(e,t,n,r){if(t.size===0&&r===`all`)return e;let i=[];for(let a of e){let e=t.get(n(a));(r===`all`||(e?.state??a.state)===r)&&i.push(e===void 0?a:{...a,...e})}return t.size===0&&i.length===e.length?e:i}function Ge(e,t,n){if(e.length===0)return t;let r=new Map(e.map(e=>[n(e),e])),i=0,a=t.map(e=>{let t=r.get(n(e));return t!==void 0&&JSON.stringify(t)===JSON.stringify(e)?(i+=1,t):e});return i===t.length&&e.length===t.length&&e.every((e,r)=>n(e)===n(t[r]))?e:a}var Ke=6e4;function qe(e,t,n,r){if(e.size===0)return e;let i=new Map(t.map(e=>[n(e),e])),a=new Map;for(let[t,n]of e){let e=i.get(t);if(e===void 0){a.set(t,n);continue}let o=e.state===n.state&&(n.isDraft===void 0||e.isDraft===n.isDraft),s=r-n.at>Ke;!o&&!s&&a.set(t,n)}return a.size===e.size?e:a}function Je(e){let t=new Map(e.flatMap(e=>e.actions===void 0?[]:[[e.host.toLowerCase(),new Set(e.actions)]])),n=new Set([`close`,`merge`,`ready`,`reopen`]),r=new Set;return e=>t.get(e.host.toLowerCase())??(e.provider===`github`?n:r)}function Ye(e,t){return(e.state===`merged`?[]:e.state===`closed`?[`reopen`]:e.isDraft?[`close`,`ready`]:[`close`,`merge`]).filter(e=>t.has(e))}var W=oe(b),Xe=ie(b,W.refreshes),G=_(e=>u(null).pipe(h(3e5),g(`web-pull-requests:observed-summary:${e}`)));function K(e,t){let n=Number(t.state===`merged`)-Number(e.state===`merged`);if(n!==0)return n;let r=Date.parse(t.updatedAt)-Date.parse(e.updatedAt);return r===0?e.observedAt===void 0&&t.observedAt===void 0?0:(t.observedAt??-1/0)-(e.observedAt??-1/0):r}function q(e,t){return e===null?t:t===null?e:K(e,t)>=0?t:e}function J(e){return{provider:e.provider,projectId:e.projectId,repository:e.repository,number:e.number,title:e.title,url:e.url,state:e.state,isDraft:e.isDraft,headBranch:e.headBranch,baseBranch:e.baseBranch,updatedAt:e.updatedAt,...e.observedAt===void 0?{}:{observedAt:e.observedAt},author:e.author,...e.reviewDecision===void 0?{}:{reviewDecision:e.reviewDecision},...e.checksState===void 0?{}:{checksState:e.checksState},mergeability:e.mergeability}}function Y(e,t){return JSON.stringify([e,t.projectId,t.repository.toLowerCase(),t.number])}function X(e,t){if(e===null)return t;if(t===null)return e;let n=K(e.summary,t.summary);return n===0&&e.summary.observedAt===void 0&&t.summary.observedAt===void 0&&(n=t.observedAt-e.observedAt),n>0?{...t,summary:{...t.summary,isDraft:t.summary.isDraft??e.summary.isDraft,mergeability:t.summary.mergeability??e.summary.mergeability,reviewDecision:t.summary.reviewDecision===void 0?e.summary.reviewDecision:t.summary.reviewDecision,checksState:t.summary.checksState===void 0?e.summary.checksState:t.summary.checksState}}:e}function Z(e,t,n,r){let i=G(Y(e,t));c.modify(i,e=>{let t=X(e,{summary:n,observedAt:r});return t===e?[!1,e]:[!0,t]})}function Ze(e,t){let n=e.snapshot?.updatedAt;return e.snapshot===null||n==null?null:{...e.snapshot,provider:(S.findByChangeRequestUrl(e.url)??S.get(void 0)).kind,projectId:t,repository:e.repository,number:e.number,url:e.url,updatedAt:n}}function Q(e,t){return t.host===void 0?``:`${e}:${ce({...t,host:t.host})}`}var Qe=u(e=>{let t=new Map;for(let n of e(re.threadShellsAtom))for(let e of se(n.pullRequests)){let r=Ze(e,n.projectId);if(r===null)continue;let i=Q(n.environmentId,e);t.set(i,q(t.get(i)??null,r)??r)}return t}),$e=_(e=>u(t=>t(Qe).get(e)??null).pipe(ee((e,t)=>JSON.stringify(e)===JSON.stringify(t)),h(3e5)));function et(e,t,n,r){let i=(0,T.c)(19),a=r===void 0?null:r,o;i[0]!==e||i[1]!==t?(o=G(e===null||t===null?`none`:Y(e,t)),i[0]=e,i[1]=t,i[2]=o):o=i[2];let s=v(o),c;i[3]!==e||i[4]!==t?(c=$e(e===null||t===null?``:Q(e,t)),i[3]=e,i[4]=t,i[5]=c):c=i[5];let l=v(c),u,d;i[6]!==n||i[7]!==e||i[8]!==a||i[9]!==t?(u=()=>{e!==null&&t!==null&&n!==null&&a!==null&&Z(e,t,n,a)},d=[n,e,t,a],i[6]=n,i[7]=e,i[8]=a,i[9]=t,i[10]=u,i[11]=d):(u=i[10],d=i[11]),(0,w.useLayoutEffect)(u,d);let f;i[12]!==n||i[13]!==s||i[14]!==a?(f=X(s,n===null||a===null?null:{summary:n,observedAt:a})?.summary??n,i[12]=n,i[13]=s,i[14]=a,i[15]=f):f=i[15];let p=f,m;return i[16]!==l||i[17]!==p?(m=q(p,l),i[16]=l,i[17]=p,i[18]=m):m=i[18],m}var tt=ae(b,W.refreshes);function $(e,t){let n=_(n=>u(e=>{let r=JSON.parse(n),i=[],a=[],s=null,c=!1;for(let n of r){let r=e(t(n));c||=r.waiting,r._tag===`Failure`&&s===null&&(s=x(r.cause));let u=l(o(r));u!==null&&i.push([n.environmentId,u]),r._tag===`Success`&&a.push([n.environmentId,r.value,r.timestamp])}return{values:i,error:s,isPending:c,observations:a}}).pipe(g(`${e}:${n}`))),r=u({values:[],observations:[],error:null,isPending:!1}).pipe(g(`${e}:empty`));return function(e){let i=JSON.stringify(e),a=v(e.length===0?r:n(i)),o=(0,w.useCallback)(e=>{let n=e??JSON.parse(i);for(let e of new Set(n.map(t)))c.refresh(e)},[i]);return{...a,refresh:o}}}var nt=$(`web-pull-requests:list`,W.list),rt=$(`web-pull-requests:list-stats`,W.listStats),it=$(`web-pull-requests:turn-refreshes`,({environmentId:e})=>W.refreshes({environmentId:e,input:{}}));function at(e){let t=(0,T.c)(2),n;return t[0]===e?n=t[1]:(n=e.map(ot),t[0]=e,t[1]=n),it(n).values}function ot(e){return{environmentId:e,input:{}}}function st(e){let t=(0,T.c)(4),n;t[0]===e?n=t[1]:(n=W.refreshes({environmentId:e,input:{}}),t[0]=e,t[1]=n);let r=v(n),i;return t[2]===r?i=t[3]:(i=l(o(r)),t[2]=r,t[3]=i),i}function ct(e){let t=(0,T.c)(10),n=nt(e),r,i;t[0]===n.observations?(r=t[1],i=t[2]):(r=()=>{for(let[e,t,r]of n.observations)for(let n of t.entries)Z(e,{projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},J(n),r)},i=[n.observations],t[0]=n.observations,t[1]=r,t[2]=i),(0,w.useLayoutEffect)(r,i);let a;t[3]===n.values?a=t[4]:(a=De(n.values),t[3]=n.values,t[4]=a);let o=a,s;return t[5]!==o||t[6]!==n.error||t[7]!==n.isPending||t[8]!==n.refresh?(s={data:o,error:n.error,isPending:n.isPending,refresh:n.refresh},t[5]=o,t[6]=n.error,t[7]=n.isPending,t[8]=n.refresh,t[9]=s):s=t[9],s}function lt(e){let t=(0,T.c)(6),n=rt(e),r;t[0]===n.values?r=t[1]:(r=n.values.length===0?null:n.values.flatMap(ut),t[0]=n.values,t[1]=r);let i=r,a;return t[2]!==n.isPending||t[3]!==n.refresh||t[4]!==i?(a={stats:i,isPending:n.isPending,refresh:n.refresh},t[2]=n.isPending,t[3]=n.refresh,t[4]=i,t[5]=a):a=t[5],a}function ut(e){let[t,n]=e;return n.stats.map(e=>({...e,environmentId:t}))}export{Ce as A,qe as B,F as C,ue as D,Je as E,Fe as F,He as H,Ie as I,we as L,Le as M,je as N,Ue as O,Ne as P,Ge as R,R as S,Oe as T,Me as U,Ve as V,ge as _,tt as a,he as b,st as c,We as d,de as f,ye as g,be as h,J as i,L as j,Ye as k,at as l,Pe as m,q as n,ct as o,_e as p,W as r,lt as s,Xe as t,et as u,Ee as v,O as w,Te as x,ve as y,H as z};
2
- //# sourceMappingURL=pullRequests-D-lKKR28.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$v as r,BC as i,Bv as a,CS as o,CT as s,DC as c,Dv as l,Eb as u,Gw as d,Hg as f,Iy as p,Jv as m,KT as h,Ky as g,Mv as _,Nv as v,Os as y,Ov as b,Ox as x,PS as ee,Rw as te,Sv as ne,Tb as re,Ts as ie,UC as ae,VS as oe,Vg as se,Vv as ce,Wc as S,Yx as C,Yy as le,ZT as ue,Zo as de,_C as fe,_u as w,_v as pe,aE as me,ab as he,as as T,bT as ge,bl as _e,bs as ve,cE as ye,cb as E,dC as D,dE as be,dl as xe,eS as Se,eb as Ce,fE as O,fb as k,gb as we,gs as Te,hC as Ee,hv as De,ib as A,is as Oe,kb as ke,kx as Ae,ls as je,mC as j,nT as Me,pC as Ne,pE as Pe,pS as Fe,pb as Ie,ps as M,qx as Le,rS as N,rs as P,ts as Re,xl as ze,xx as Be,yx as Ve,zx as F}from"./utils-CxCThU1r.js";import{F as He,I as Ue,J as We,M as I,N as L,P as R,Z as Ge,_t as z,et as Ke,it as qe,ot as Je,pt as Ye,qt as Xe,st as Ze,tt as Qe}from"./runtime-Du_4upLP.js";import{a as B,i as V,n as $e,r as et,s as tt,t as nt}from"./vcsRefInvalidation-CiJ0pwCz.js";import{G as rt,W as it}from"./entities-BjGK6yEY.js";import{t as H}from"./runtime-mXszmljC.js";import{n as U}from"./query-DM1uxcKV.js";var W=n(),at=ke(Ie([g(p),xe.fields.query])),ot=re(at);function st(e,t){return JSON.stringify([[...e].sort((e,t)=>e.localeCompare(t)),t])}function ct(e){return ot(e)}function lt(e){return JSON.stringify([e.environmentId,e.threadId])}function ut(e){return P(t=>T(n=>{let r=ct(t);if(ye(r))return{matches:[],isLoading:!1};let[i,a]=r.value,o=[],s=!1;for(let t of i){let r=n(e.getSearchAtom(t,a));s||=r.waiting;let i=me(y(r));i!==null&&o.push(...i.matches.map(e=>({...e,environmentId:t})))}return{matches:o,isLoading:s}}).pipe(M(`${e.labelPrefix}:${t}`)))}var G=e(t(),1);function dt(e){return{v2:{dispatchCommand:I(e,{label:`environment-data:orchestration-v2:dispatch-command`,tag:w.dispatchCommand}),threadProjection:L(e,{label:`environment-data:orchestration-v2:thread-projection`,tag:w.getThreadProjection,staleTimeMs:0,idleTtlMs:0}),shell:R(e,{label:`environment-data:orchestration-v2:shell`,tag:w.subscribeShell}),thread:R(e,{label:`environment-data:orchestration-v2:thread`,tag:w.subscribeThread,idleTtlMs:0})},turnDiff:L(e,{label:`environment-data:orchestration:turn-diff`,tag:w.getTurnDiff}),workflowScript:L(e,{label:`environment-data:orchestration:workflow-script`,tag:w.getWorkflowScript,staleTimeMs:3e5,idleTtlMs:3e5}),stopWorkflow:I(e,{label:`environment-data:orchestration:stop-workflow`,tag:w.stopWorkflow}),rankUserInput:I(e,{label:`environment-data:orchestration:rank-user-input`,tag:S.userInputRank,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t])}}),turnItem:L(e,{label:`environment-data:orchestration:turn-item`,tag:w.getTurnItem,staleTimeMs:6e4,idleTtlMs:6e4}),fullThreadDiff:L(e,{label:`environment-data:orchestration:full-thread-diff`,tag:w.getFullThreadDiff}),threadFind:L(e,{label:`environment-data:orchestration:thread-find`,tag:w.searchThread,staleTimeMs:0,idleTtlMs:0}),threadFindProgressive:R(e,{label:`environment-data:orchestration:thread-find-progressive`,tag:w.searchThreadStream,completeWhen:e=>e.complete!==!1,idleTtlMs:0}),threadSearch:L(e,{label:`environment-data:orchestration:thread-search`,tag:w.searchThreads,staleTimeMs:3e4,idleTtlMs:6e4}),archivedShellSnapshot:L(e,{label:`environment-data:orchestration:archived-shell-snapshot`,tag:w.getArchivedShellSnapshot})}}var K=dt(H),ft=96;function pt(e){let t=e.at(-1);return e.length>1&&t?.waiting===!0&&ye(y(t))}function mt({previousScrollTop:e,scrollTop:t,scrollHeight:n,clientHeight:r,distanceThreshold:i=ft}){return e===null||t<=e?!1:n-t-r<=i}var ht=RegExp(`^p4c[-/][0-9a-f]{8}$`);function gt(e){let t=e.indexOf(`/`);return t<=0||t===e.length-1?e:e.slice(t+1)}function _t(e){return ht.test(e.trim().toLowerCase())}function vt(e){return e.trim().replace(/[ \t\n\r\f\v]+/g,`-`)}var yt={hasUpstream:!1,aheadCount:0,behindCount:0,aheadOfDefaultCount:0,pr:null};function q(e,t){return{...e,...t??yt}}function bt(e){return{hasUpstream:e.hasUpstream,aheadCount:e.aheadCount,behindCount:e.behindCount,...e.aheadOfDefaultCount===void 0?{}:{aheadOfDefaultCount:e.aheadOfDefaultCount},pr:e.pr}}function xt(e){return{isRepo:e.isRepo,...e.sourceControlProvider?{sourceControlProvider:e.sourceControlProvider}:{},hasPrimaryRemote:e.hasPrimaryRemote,isDefaultRef:e.isDefaultRef,refName:e.refName,hasWorkingTreeChanges:e.hasWorkingTreeChanges,workingTree:e.workingTree,...e.branchChanges?{branchChanges:e.branchChanges}:{}}}function St(e,t){switch(t._tag){case`snapshot`:return q(t.local,t.remote);case`localUpdated`:return q(t.local,e?bt(e):null);case`remoteUpdated`:return q(e===null?{isRepo:!0,hasPrimaryRemote:!1,isDefaultRef:!1,refName:null,hasWorkingTreeChanges:!1,workingTree:{files:[],insertions:0,deletions:0}}:xt(e),t.remote)}}var Ct=Ce([`refresh_status`,`run_change_request`,`pull`,`switch_ref`,`create_ref`,`create_worktree`,`init`,`publish_repository`,`prepare_pull_request_thread`]),J=class extends k()(`VcsActionUnavailableError`,{operation:Ct,environmentId:A(p),cwd:A(E)}){get message(){return`Source control operation '${this.operation.replaceAll(`_`,` `)}' is unavailable.`}},wt=class extends k()(`VcsActionRemoteFailureError`,{actionId:E,transportActionId:E,action:ze,environmentId:p,cwd:E,phase:A(_e),remoteMessageLength:he}){get message(){let e=this.phase===null?`execution`:this.phase;return`Source control action '${this.action}' failed during ${e}.`}},Tt=class extends k()(`VcsActionMissingTerminalEventError`,{actionId:E,transportActionId:E,action:ze,environmentId:p,cwd:E}){get message(){return`Source control action '${this.action}' ended without a terminal result.`}},Et=class extends k()(`VcsActionTargetKeyParseError`,{keyLength:he,cause:le()}){get message(){return`Invalid source control action target key (${this.keyLength} characters).`}};we([wt,Tt]);var Y=Object.freeze({isRunning:!1,operation:null,actionId:null,action:null,currentLabel:null,currentPhaseLabel:null,hookName:null,lastOutputLine:null,phaseStartedAtMs:null,hookStartedAtMs:null,error:null}),Dt=()=>Be(Ve()),Ot=0,kt=u(Ie([p,E])),X=P(e=>T(Y).pipe(Oe,M(`vcs-action:${e}`))),At=T(Y).pipe(Oe,M(`vcs-action:null`));function Z(e){return e.environmentId===null||e.cwd===null?null:JSON.stringify([e.environmentId,e.cwd])}function jt(e){try{let[t,n]=kt(JSON.parse(e));return{environmentId:t,cwd:n}}catch(t){throw new Et({keyLength:e.length,cause:t})}}function Mt(e){let t=Z(e);return t===null?At:X(t)}function Nt(){return Ot+=1,`local-vcs-action:${Ot}`}function Pt(e){let t=e.actionId??Nt(),n=Dt();return{...Y,isRunning:!0,operation:e.operation,actionId:t,currentLabel:e.label,currentPhaseLabel:e.label,phaseStartedAtMs:n}}function Ft(e,t,n){return{...Y,operation:e,actionId:t,error:n instanceof Error?n.message:`Source control action failed.`}}function It(e,t){let n=JSON.stringify([e.environmentId,e.cwd]);return`${n.length}:${n}${t}`}function Lt(e,t,n,r){return r.actionId!==t||r.cwd!==e.cwd?null:{...r,actionId:n}}function Rt(e,t){return Ne(()=>{let n=null;return e.pipe(ce(e=>{let r=Lt(t.target,t.transportActionId,t.actionId,e);return r===null?c:((r.kind===`action_finished`||r.kind===`action_failed`)&&(n=r),t.onProgress(r))}),Se(()=>n?.kind===`action_finished`?D(n.result):n?.kind===`action_failed`?C(new wt({actionId:t.actionId,transportActionId:t.transportActionId,action:n.action,environmentId:t.target.environmentId,cwd:t.target.cwd,phase:n.phase,remoteMessageLength:n.message.length})):C(new Tt({actionId:t.actionId,transportActionId:t.transportActionId,action:t.action,environmentId:t.target.environmentId,cwd:t.target.cwd}))))})}function zt(e,t){if(e.actionId!==t.actionId)return e;let n=Dt();switch(t.kind){case`action_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,phaseStartedAtMs:n,hookStartedAtMs:null,hookName:null,lastOutputLine:null,error:null};case`phase_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:t.label,currentPhaseLabel:t.label,phaseStartedAtMs:n,hookStartedAtMs:null,hookName:null,lastOutputLine:null,error:null};case`hook_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:`Running ${t.hookName}...`,hookName:t.hookName,hookStartedAtMs:n,lastOutputLine:null,error:null};case`hook_output`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,lastOutputLine:t.text,error:null};case`hook_finished`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:e.currentPhaseLabel,hookName:null,hookStartedAtMs:null,lastOutputLine:null,error:null};case`action_finished`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,error:null};case`action_failed`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,error:t.message}}}function Bt(e){let t=new Map,n=n=>{let r=Z(n),i=r??JSON.stringify([`vcs-action-target:unavailable`,n.environmentId,n.cwd]),a=t.get(i);if(a!==void 0)return a;let o=r===null?null:jt(r),s=r===null?At:X(r),c=Ue(e,{label:`vcs-action:run-stacked:${i}`,scheduler:B,concurrency:{mode:`serial`,key:()=>i},execute:(t,r)=>{if(o===null)return C(new J({operation:`run_change_request`,environmentId:n.environmentId,cwd:n.cwd}));let i=It(o,t.actionId);r.set(s,Pt({operation:`run_change_request`,label:`Running source control action`,actionId:t.actionId}));let a={actionId:i,cwd:o.cwd,action:t.action,...t.commitMessage?{commitMessage:t.commitMessage}:{},...t.featureBranch?{featureBranch:!0}:{},...t.filePaths?.length?{filePaths:[...t.filePaths]}:{},...t.threadId===void 0?{}:{threadId:t.threadId},...t.projectId===void 0?{}:{projectId:t.projectId}},c=j(()=>{r.get(s).actionId===t.actionId&&r.set(s,Y)});return Rt(Ze(o.environmentId,Ke(S.gitRunStackedAction,a)),{target:o,transportActionId:i,actionId:t.actionId,action:t.action,onProgress:e=>j(()=>{let n=r.get(s);if(n.actionId===t.actionId&&(r.set(s,zt(n,e)),t.onProgress!==void 0))try{t.onProgress(e)}catch{}})}).pipe(oe(We,{authorize:(t,n,i)=>qe(e,n).authorize(r,t,i)}),Le(nt(r,o)),Ee(()=>c),fe(e=>j(()=>{let n=r.get(s);n.actionId===t.actionId&&n.isRunning&&r.set(s,Ft(`run_change_request`,t.actionId,e))})),ee(()=>c))}});return t.set(i,c),c},r=(e,t,n)=>{let r=Z(t);if(r===null)return;let i=X(r);e.set(i,n(e.get(i)))};return{stateAtom:Mt,runStackedAction:e=>n(e),track:async(e,t,n,r)=>{let i=Z(t);if(i===null)return ve(te(new J({operation:n.operation,environmentId:t.environmentId,cwd:t.cwd})));let a=X(i),o=Pt(n);e.set(a,o);let s=await r();return e.get(a).actionId===o.actionId&&(ie(s)||d(s.cause)?e.set(a,Y):e.get(a).actionId===o.actionId&&e.set(a,Ft(n.operation,o.actionId,Me(s.cause)))),s},resetError:(e,t,n)=>{r(e,t,e=>!e.isRunning&&e.operation===n?Y:e)}}}var Vt=100,Ht=3e4,Ut=1e4,Wt=i(`1 second`).pipe(ae(({duration:e})=>D(ge(e,s(30)))));function Gt(e){return e.query===void 0&&e.cursor===void 0&&e.includeMatchingRemoteRefs===void 0&&e.refKind===void 0&&e.limit===Vt}var Kt=N(`CachedVcsRefsState.commitRefresh`)(function*(e,t,n){return yield*et(n.environmentId,Fe(function*(){let r=$e({environmentId:n.environmentId}),i=e.get(r);if(i.revision!==n.expectedRevision)return!1;let a=i.persistedCacheReadable;return n.persist&&(a||=yield*t.clearVcsRefs(n.environmentId).pipe(Ae(!0),F(e=>o(`Could not recover invalidated cached Git refs.`).pipe(x({environmentId:n.environmentId,cwd:n.cwd,...z(e)}),Ae(!1)))),yield*t.saveVcsRefs(n.environmentId,n.cwd,n.refs).pipe(F(e=>o(`Could not persist cached Git refs.`).pipe(x({environmentId:n.environmentId,cwd:n.cwd,...z(e)})))),a!==i.persistedCacheReadable&&e.update(r,e=>e.revision===n.expectedRevision?{...e,persistedCacheReadable:a}:e)),!0}))}),qt=N(`CachedVcsRefsState.makeChanges`)(function*(e,t,n,r=!0){let i=yield*Ye,s=yield*Xe,c=i.target.environmentId,u=Gt(e),d=u&&r?yield*s.loadVcsRefs(c,e.cwd).pipe(F(t=>o(`Could not load cached Git refs.`).pipe(x({environmentId:c,cwd:e.cwd,...z(t)}),Ae(O())))):O(),p=N(`CachedVcsRefsState.refresh`)(function*(){let r=yield*Ge(S.vcsListRefs,e).pipe(oe(Ye,i)),a=s.saveVcsRefs(c,e.cwd,r).pipe(F(t=>o(`Could not persist cached Git refs.`).pipe(x({environmentId:c,cwd:e.cwd,...z(t)}))));return t===void 0||n===void 0?(u&&(yield*a),Pe(r)):(yield*Kt(n,s,{environmentId:c,cwd:e.cwd,refs:r,expectedRevision:t,persist:u}))?Pe(r):O()}),g=b(D(d)).pipe(l(e=>be(e,{onNone:()=>h,onSome:ue}))),v=pe(b(f(i.state)),se(i.state)).pipe(_(e=>e.phase===`connected`?e.generation:null),De,m(t=>t===null?ne:b(p().pipe(fe(t=>o(`Could not refresh Git refs.`).pipe(x({environmentId:c,cwd:e.cwd,...z(t)}))))).pipe(a(Wt),l(e=>be(e,{onNone:()=>h,onSome:ue})))));return pe(g,v)});function Jt(e,t,n,i){return Je(e,r(Fe(function*(){return yield*qt(t,n,yield*Te,i)})))}function Yt(e){let t=P(t=>{let[n,r]=JSON.parse(t);return e.atom(e=>{let t=e($e({environmentId:n}));return Jt(n,r,t.revision,t.persistedCacheReadable)}).pipe(je(Ht),M(`environment-data:vcs:list-refs:${t}`))}),n=e=>t(JSON.stringify([e.environmentId,e.input])),r=(e,t)=>nt(t,{environmentId:e.environmentId,cwd:e.input.cwd});return{listRefs:n,status:He(e,{label:`environment-data:vcs:status`,idleTtlMs:Ut,subscribe:e=>Qe(S.subscribeVcsStatus,e).pipe(v(()=>null,(e,t)=>{let n=St(e,t);return[n,[n]]}))}),pull:I(e,{label:`environment-data:vcs:pull`,tag:S.vcsPull,scheduler:B,concurrency:V,onSettled:r}),refreshStatus:I(e,{label:`environment-data:vcs:refresh-status`,tag:S.vcsRefreshStatus,scheduler:B,concurrency:V,onSettled:r}),createWorktree:I(e,{label:`environment-data:vcs:create-worktree`,tag:S.vcsCreateWorktree,scheduler:B,concurrency:V,onSettled:r}),worktreeSetup:R(e,{label:`environment-data:vcs:worktree-setup`,tag:S.subscribeWorktreeSetup,idleTtlMs:Ut}),cancelWorktreeSetup:I(e,{label:`environment-data:vcs:cancel-worktree-setup`,tag:S.worktreeSetupCancel}),removeWorktree:I(e,{label:`environment-data:vcs:remove-worktree`,tag:S.vcsRemoveWorktree,scheduler:B,concurrency:V,onSettled:r}),createRef:I(e,{label:`environment-data:vcs:create-ref`,tag:S.vcsCreateRef,scheduler:B,concurrency:V,onSettled:r}),switchRef:I(e,{label:`environment-data:vcs:switch-ref`,tag:S.vcsSwitchRef,scheduler:B,concurrency:V,onSettled:r}),init:I(e,{label:`environment-data:vcs:init`,tag:S.vcsInit,scheduler:B,concurrency:V,onSettled:r})}}var Xt=Yt(H),Zt=Bt(H),Qt=120,$t=80,en=120,tn=500,nn=200,rn=100,an=[],on=[],sn=[],Q=[void 0],cn=Object.freeze([]),ln=T({matches:cn,isLoading:!1}).pipe(M(`web:thread-search:empty`)),un=ut({getSearchAtom:(e,t)=>K.threadSearch({environmentId:e,input:{query:t}}),labelPrefix:`web:thread-search`});function $(e,t){let n=(0,W.c)(4),[r,i]=(0,G.useState)(e),a,o;return n[0]!==t||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t);return()=>{window.clearTimeout(n)}},o=[t,e],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,G.useEffect)(a,o),r}function dn(e,t){let n=(0,W.c)(11),r;n[0]===t?r=n[1]:(r=t.trim(),n[0]=t,n[1]=r);let i=r,a=$(i,nn),o=e.length>0&&i.length>=2,s=o&&i===a?a:null,c;n[2]!==e||n[3]!==s?(c=s===null?null:st(e,s),n[2]=e,n[3]=s,n[4]=c):c=n[4];let l=c,u;n[5]===l?u=n[6]:(u=l===null?ln:un(l),n[5]=l,n[6]=u);let d=Re(u),f=o&&i!==a,p=f?cn:d.matches,m=s??``,h=o&&(f||d.isLoading),g;return n[7]!==p||n[8]!==m||n[9]!==h?(g={matches:p,query:m,isPending:h},n[7]=p,n[8]=m,n[9]=h,n[10]=g):g=n[10],g}function fn(e){let t=e.query?.trim()??``,n=e.environmentId!==null&&e.cwd!==null?JSON.stringify([e.environmentId,e.cwd,t]):null,[r,i]=(0,G.useState)({targetKey:n,cursors:Q}),a=r.targetKey===n?r.cursors:Q,o=(0,G.useMemo)(()=>e.environmentId!==null&&e.cwd!==null?a.map(n=>Xt.listRefs({environmentId:e.environmentId,input:{cwd:e.cwd,...t.length>0?{query:t}:{},...n===void 0?{}:{cursor:n},limit:rn}})):[],[a,t,e.cwd,e.environmentId]),s=(0,G.useMemo)(()=>T(e=>o.map(t=>e(t))).pipe(M(`web:vcs-ref-pages:${n??`empty`}`)),[o,n]),c=Re(s),l=c.flatMap(e=>{let t=me(y(e));return t===null?[]:[t]}),u=new Map;for(let e of l)for(let t of e.refs)u.set(t.name,t);let d=l[0]??null,f=l.at(-1)??null,p=d===null||f===null?null:{refs:[...u.values()],isRepo:d.isRepo,hasPrimaryRemote:d.hasPrimaryRemote,nextCursor:f.nextCursor,totalCount:Math.max(...l.map(e=>e.totalCount))},m=c.find(e=>e._tag===`Failure`),h=pt(c),g=m?._tag===`Failure`?(()=>{let e=Me(m.cause);return e instanceof Error&&e.message.trim().length>0?e.message:`Failed to load refs.`})():null,_=(0,G.useCallback)(()=>{let e=o[0];i({targetKey:n,cursors:Q}),e!==void 0&&de.refresh(e)},[o,n]),v=(0,G.useCallback)(()=>{n!==null&&p?.nextCursor!==null&&p?.nextCursor!==void 0&&i(e=>{let t=e.targetKey===n?e.cursors:Q;return t.includes(p.nextCursor)?{targetKey:n,cursors:t}:{targetKey:n,cursors:[...t,p.nextCursor]}})},[p?.nextCursor,n]);return{data:p,refs:p?.refs??an,error:g,isPending:c.some(e=>e.waiting),isFetchingNextPage:h,refresh:_,loadNext:v}}function pn(e,t){return e.environmentId===t.environmentId&&e.cwd===t.cwd&&e.query===t.query&&e.kind===t.kind&&e.imageOnly===t.imageOnly}function mn(e,t,n){let r=(0,W.c)(32),i=n?.allowEmptyQuery===!0,a;r[0]===e.query?a=r[1]:(a=e.query==null?null:e.query.trim(),r[0]=e.query,r[1]=a);let o;r[2]!==a||r[3]!==e.cwd||r[4]!==e.environmentId||r[5]!==e.imageOnly||r[6]!==e.kind?(o={environmentId:e.environmentId,cwd:e.cwd,query:a,kind:e.kind,imageOnly:e.imageOnly},r[2]=a,r[3]=e.cwd,r[4]=e.environmentId,r[5]=e.imageOnly,r[6]=e.kind,r[7]=o):o=r[7];let s=o,c=$(s,Qt),l=tt(c.environmentId),{canReadFiles:u}=l,d,f,p;r[8]!==i||r[9]!==u||r[10]!==c.cwd||r[11]!==c.environmentId||r[12]!==c.imageOnly||r[13]!==c.kind||r[14]!==c.query||r[15]!==t?(d=c.environmentId!==null&&c.cwd!==null&&c.query!==null&&(i||c.query.length>0)?{environmentId:c.environmentId,input:{cwd:c.cwd,query:c.query,limit:t,...c.kind?{kind:c.kind}:{},...c.imageOnly?{imageOnly:!0}:{}}}:null,f=U,p=u&&d!==null?rt.searchEntries(d):null,r[8]=i,r[9]=u,r[10]=c.cwd,r[11]=c.environmentId,r[12]=c.imageOnly,r[13]=c.kind,r[14]=c.query,r[15]=t,r[16]=d,r[17]=f,r[18]=p):(d=r[16],f=r[17],p=r[18]);let m=f(p),h=d!==null,g=m.data?.entries??on,_=!h||l.isPending?null:u?m.error:l.error??`This connection cannot search host files.`,v;r[19]!==c||r[20]!==l.isPending||r[21]!==h||r[22]!==s||r[23]!==m.isPending?(v=!pn(s,c)||h&&(l.isPending||m.isPending),r[19]=c,r[20]=l.isPending,r[21]=h,r[22]=s,r[23]=m.isPending,r[24]=v):v=r[24];let y=c.query??``,b=m.data?.truncated??!1,x;return r[25]!==m.refresh||r[26]!==g||r[27]!==_||r[28]!==v||r[29]!==y||r[30]!==b?(x={entries:g,error:_,isPending:v,searchedQuery:y,truncated:b,refresh:m.refresh},r[25]=m.refresh,r[26]=g,r[27]=_,r[28]=v,r[29]=y,r[30]=b,r[31]=x):x=r[31],x}function hn(e){return mn(e,$t)}function gn(e){let t=(0,W.c)(20),n=e.environmentId!==null&&e.cwd!==null,r=tt(e.environmentId),i=n&&r.canReadFiles,a=n&&r.isPending,o=e.query,s;t[0]===o?s=t[1]:(s=o.trim(),t[0]=o,t[1]=s);let c=s.length>0,l=$(o,en),u;t[2]!==i||t[3]!==l||t[4]!==c||t[5]!==e.caseSensitive||t[6]!==e.cwd||t[7]!==e.environmentId||t[8]!==e.useRegex||t[9]!==e.wholeWord?(u=i&&e.environmentId!==null&&e.cwd!==null&&c&&l.trim().length>0?it({environmentId:e.environmentId,input:{cwd:e.cwd,query:l,limit:tn,caseSensitive:e.caseSensitive,wholeWord:e.wholeWord,useRegex:e.useRegex}}):null,t[2]=i,t[3]=l,t[4]=c,t[5]=e.caseSensitive,t[6]=e.cwd,t[7]=e.environmentId,t[8]=e.useRegex,t[9]=e.wholeWord,t[10]=u):u=t[10];let d=U(u),f=d.data?.matches??sn,p=!n||a?null:i?d.error:r.error??`This connection cannot search host files.`,m=a||i&&c&&(o!==l||d.isPending),h=d.data?.truncated??!1,g=e.useRegex&&d.data?.regexFallbackError!==void 0,_;return t[11]!==i||t[12]!==c||t[13]!==a||t[14]!==f||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_={canReadFiles:i,isCheckingAccess:a,matches:f,error:p,isPending:m,hasQuery:c,truncated:h,invalidRegex:g},t[11]=i,t[12]=c,t[13]=a,t[14]=f,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function _n(e,t){let n=t?.enabled!==!1&&e.environmentId!==null&&e.threadId!==null&&e.fromTurnCount!==null&&e.toTurnCount!==null,r=n&&e.fromTurnCount===0?{environmentId:e.environmentId,input:{threadId:e.threadId,toTurnCount:e.toTurnCount,ignoreWhitespace:e.ignoreWhitespace}}:null,i=n&&e.fromTurnCount!==0?{environmentId:e.environmentId,input:{threadId:e.threadId,fromTurnCount:e.fromTurnCount,toTurnCount:e.toTurnCount,ignoreWhitespace:e.ignoreWhitespace}}:null,a=U(r===null?null:K.fullThreadDiff(r)),o=U(i===null?null:K.turnDiff(i));return r===null?o:a}function vn(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?null:K.turnItem({environmentId:e.environmentId,input:{threadId:e.threadId,itemId:e.itemId,revision:e.revision}}),t[0]=e,t[1]=n),U(n)}export{lt as _,gn as a,vn as c,J as d,gt as f,K as g,mt as h,fn as i,Zt as l,vt as m,hn as n,mn as o,_t as p,$ as r,dn as s,_n as t,Xt as u};
2
- //# sourceMappingURL=queries-CEdylITb.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Os as t,Vw as n,aE as r,as as i,es as a,nT as o,ps as s,ts as c,ws as l}from"./utils-CxCThU1r.js";var u=e(),d=i(l(!1)).pipe(s(`web-environment-query:empty`));function f(e){let t=o(e);return t instanceof Error&&t.message.trim().length>0?t.message:`The environment request failed.`}function p(e){let i=(0,u.c)(20),o=e??d,s=c(o),l=a(o),p;i[0]===s?p=i[1]:(p=r(t(s)),i[0]=s,i[1]=p);let m;i[2]!==s._tag||i[3]!==s.previousSuccess||i[4]!==s.timestamp?(m=s._tag===`Success`?s.timestamp:s._tag===`Failure`?r(s.previousSuccess)?.timestamp??0:0,i[2]=s._tag,i[3]=s.previousSuccess,i[4]=s.timestamp,i[5]=m):m=i[5];let h;i[6]!==s._tag||i[7]!==s.cause?(h=s._tag===`Failure`?f(s.cause):null,i[6]=s._tag,i[7]=s.cause,i[8]=h):h=i[8];let g;i[9]!==s._tag||i[10]!==s.cause?(g=s._tag===`Failure`?r(n(s.cause)):null,i[9]=s._tag,i[10]=s.cause,i[11]=g):g=i[11];let _=e!==null&&s.waiting,v=s._tag===`Success`,y;return i[12]!==l||i[13]!==p||i[14]!==m||i[15]!==h||i[16]!==g||i[17]!==_||i[18]!==v?(y={data:p,dataUpdatedAt:m,error:h,failure:g,isPending:_,isSuccess:v,refresh:l},i[12]=l,i[13]=p,i[14]=m,i[15]=h,i[16]=g,i[17]=_,i[18]=v,i[19]=y):y=i[19],y}export{p as n,f as t};
2
- //# sourceMappingURL=query-DM1uxcKV.js.map