@p4code/cli 0.9.12 → 0.9.14

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 (336) hide show
  1. package/dist/AcpMcpStdioBridge-BinVfs5k.mjs +3 -0
  2. package/dist/{AcpMcpStdioBridge-DGUY2q8q.mjs → AcpMcpStdioBridge-z_p02VlR.mjs} +3 -3
  3. package/dist/{Effect-Cus50zSB.mjs → Effect-Bwkv2ifD.mjs} +25 -2
  4. package/dist/{Schema-B1iWvOKX.mjs → Schema-CFgoTmE6.mjs} +2 -2
  5. package/dist/{Stream-XZd8srjf.mjs → Stream-B4Gds95A.mjs} +2 -2
  6. package/dist/bin.mjs +2 -2
  7. package/dist/{binCli-D9zhTalS.mjs → binCli-BGRfVnO9.mjs} +4969 -3690
  8. package/dist/claude-history-worker.mjs +1 -1
  9. package/dist/{claudeHistoryWorker-Ew_jxLJH.mjs → claudeHistoryWorker-DVpahhef.mjs} +2 -2
  10. package/dist/client/.vite/manifest.json +2136 -2095
  11. package/dist/client/assets/{2NI2N5EU-DOvURDwM.js → 2NI2N5EU-Bk2qNhha.js} +2 -2
  12. package/dist/client/assets/{4UO7MD6I-CArKQR6u.js → 4UO7MD6I-CPV9277r.js} +2 -2
  13. package/dist/client/assets/{5B3SVYGG-D3yJKYTq.js → 5B3SVYGG-LgRjxbnj.js} +2 -2
  14. package/dist/client/assets/{5GK6JWQ2-C7D6qJvm.js → 5GK6JWQ2-9ndiKpIs.js} +2 -2
  15. package/dist/client/assets/{5N7A7DKN-DDTV444t.js → 5N7A7DKN-DnUhiayz.js} +2 -2
  16. package/dist/client/assets/{5OC2THR4-CYaAiBA5.js → 5OC2THR4-DxmpZihk.js} +2 -2
  17. package/dist/client/assets/{5S6HY5KT-jYzQX9YI.js → 5S6HY5KT-C4cUz8RB.js} +2 -2
  18. package/dist/client/assets/{6IMQ5BUJ-CZSZgyOb.js → 6IMQ5BUJ-2G8Rrp9t.js} +2 -2
  19. package/dist/client/assets/{6OLKWJ4F-D_TpeHsd.js → 6OLKWJ4F-CW3F_AM6.js} +2 -2
  20. package/dist/client/assets/{74OO7NKP-VJq-BY7c.js → 74OO7NKP-z5ujM5KH.js} +2 -2
  21. package/dist/client/assets/{75O6YZUN-BCik3Y9V.js → 75O6YZUN-CSeaYNtt.js} +2 -2
  22. package/dist/client/assets/{77XECAW3-Ce_-nZaY.js → 77XECAW3-DxL0AHyZ.js} +2 -2
  23. package/dist/client/assets/{ABYRPUBD-C1hL61qL.js → ABYRPUBD-DvBcJj7G.js} +2 -2
  24. package/dist/client/assets/AlertDialogRoot-z7O2CaB2.js +2 -0
  25. package/dist/client/assets/{AnimatedHeight-DEeywxgS.js → AnimatedHeight-DChvigzz.js} +2 -2
  26. package/dist/client/assets/{AuthSurfaceShell-835o12nS.js → AuthSurfaceShell-29ykag3m.js} +2 -2
  27. package/dist/client/assets/{BB2UYUI2-DlIE2g50.js → BB2UYUI2-Cun87LIm.js} +2 -2
  28. package/dist/client/assets/{BUM34MOA-D9NQPxww.js → BUM34MOA-D6aIFnwf.js} +2 -2
  29. package/dist/client/assets/{CEQABKGZ-BsiY6pPC.js → CEQABKGZ-DYzEk-9p.js} +2 -2
  30. package/dist/client/assets/{CXAC5362-t7YfF0UQ.js → CXAC5362-CdQgNtpk.js} +2 -2
  31. package/dist/client/assets/ChatGptUsageButton-DQjnXjt6.js +2 -0
  32. package/dist/client/assets/ChatMarkdown-C7ocX514.js +48 -0
  33. package/dist/client/assets/{CheckboxIndicator-XdXpYxXy.js → CheckboxIndicator-D2jNOqVc.js} +2 -2
  34. package/dist/client/assets/{ClippedText-C-unQqBz.js → ClippedText-CDOkzr7r.js} +2 -2
  35. package/dist/client/assets/{CodexSetupSection.logic-Bl5OcEqH.js → CodexSetupSection.logic-BIpypa3y.js} +2 -2
  36. package/dist/client/assets/{ComboboxClear-CBRGIQSm.js → ComboboxClear-CPvB2whi.js} +2 -2
  37. package/dist/client/assets/{ComboboxGroupLabel-DVAwRoGV.js → ComboboxGroupLabel-DN75A_2f.js} +2 -2
  38. package/dist/client/assets/{CommandBlock-D6NTupaO.js → CommandBlock-DBGDwDRu.js} +2 -2
  39. package/dist/client/assets/{CompositeRoot-DBS-Yo_S.js → CompositeRoot-Jf3zEGLN.js} +2 -2
  40. package/dist/client/assets/{ConnectAgentSurface-TBgGDnVI.js → ConnectAgentSurface-Cv2oB5Cw.js} +2 -2
  41. package/dist/client/assets/{ConnectionStatusDot-CR_qWdCU.js → ConnectionStatusDot-C_9jtSee.js} +2 -2
  42. package/dist/client/assets/{DRLTVNUE-DkTzG_pM.js → DRLTVNUE-CftE6Aa3.js} +2 -2
  43. package/dist/client/assets/{DYY6UVD2-BBRUtn6A.js → DYY6UVD2-DezK9sBO.js} +2 -2
  44. package/dist/client/assets/DevicePanel-CKWUjHEE.js +2 -0
  45. package/dist/client/assets/DeviceSetup-BrOsu1Y4.js +2 -0
  46. package/dist/client/assets/{DialogTitle-DzoEjZ6h.js → DialogTitle-COHuuWBE.js} +2 -2
  47. package/dist/client/assets/{DiffCommentAnnotation-y1CrEDvy.js → DiffCommentAnnotation-QtrnUuSs.js} +2 -2
  48. package/dist/client/assets/{DiffFileTree-BM7RDTEn.js → DiffFileTree-B_4bn5J8.js} +2 -2
  49. package/dist/client/assets/DiffPanel-CGIIHSDI.js +2 -0
  50. package/dist/client/assets/{DiffWorkerPoolProvider-D2t5zRbN.js → DiffWorkerPoolProvider-CtpHksSf.js} +3 -3
  51. package/dist/client/assets/{EmbeddedDesign-_id3IQO6.js → EmbeddedDesign-BU5m6_ou.js} +5 -5
  52. package/dist/client/assets/{EnvironmentMachineIcon-oObSi9GI.js → EnvironmentMachineIcon-DTUBsEaI.js} +2 -2
  53. package/dist/client/assets/{ExpandableText-BLwIQ2BJ.js → ExpandableText-Wij8nL6W.js} +2 -2
  54. package/dist/client/assets/{FNOVOB4O-B469NSHv.js → FNOVOB4O-DHCmE6LN.js} +2 -2
  55. package/dist/client/assets/{FieldControl-Btl-j-6W.js → FieldControl-Yp1Yjlg7.js} +2 -2
  56. package/dist/client/assets/{FileDiff-CGLKzg3V.js → FileDiff-CAtJtUC5.js} +2 -2
  57. package/dist/client/assets/FilePreviewPanel-CjKP3Q7G.js +34 -0
  58. package/dist/client/assets/{FoldedSettingsSection-DPTJODig.js → FoldedSettingsSection-CAZumPht.js} +2 -2
  59. package/dist/client/assets/{FormContext-Be16jmaZ.js → FormContext-BEFZtJu9.js} +2 -2
  60. package/dist/client/assets/{HDGCDEEZ-BUMQl9WF.js → HDGCDEEZ-DNHIctoG.js} +2 -2
  61. package/dist/client/assets/{HSJLKHB7-C08sJAK2.js → HSJLKHB7-BfNhUjhw.js} +2 -2
  62. package/dist/client/assets/{Icons-2l7Ym4KO.js → Icons-DYaY7Otq.js} +2 -2
  63. package/dist/client/assets/Input-CVeLgfX4.js +2 -0
  64. package/dist/client/assets/JZOYTAAL-Bngs0npp.js +1 -0
  65. package/dist/client/assets/{K3MD6TGW-D4RWgVJJ.js → K3MD6TGW-D-q4Z_68.js} +2 -2
  66. package/dist/client/assets/{K7RP3OMA-B8UDebPA.js → K7RP3OMA-C5AEGeo9.js} +2 -2
  67. package/dist/client/assets/{KeybindingsSettings.logic-CCfOv-KZ.js → KeybindingsSettings.logic-A_266dBm.js} +2 -2
  68. package/dist/client/assets/{LHDIQX7Q-DwRY1EjH.js → LHDIQX7Q-CY4nmSyZ.js} +2 -2
  69. package/dist/client/assets/{LUXOKEGN-BTGUp3oJ.js → LUXOKEGN-BHmzrQMD.js} +2 -2
  70. package/dist/client/assets/{LinkMachineSelect-DoHeQGoj.js → LinkMachineSelect-tm04n5mK.js} +2 -2
  71. package/dist/client/assets/{MathTypeset-DZCUnfpK.js → MathTypeset-C1sAcsZE.js} +2 -2
  72. package/dist/client/assets/{N3JZAHOW-C-bkdj1S.js → N3JZAHOW-D1VvHXNc.js} +2 -2
  73. package/dist/client/assets/{NUIALGQ3-COfmKsf1.js → NUIALGQ3-DKQw5Xvm.js} +2 -2
  74. package/dist/client/assets/{NoProjectsHero-CbIPjHEJ.js → NoProjectsHero-DVJOMY01.js} +2 -2
  75. package/dist/client/assets/{O65XPQGZ-BPK2EL3_.js → O65XPQGZ-B7xlpxd0.js} +2 -2
  76. package/dist/client/assets/{O7XIQ6OM-qzVUZXbW.js → O7XIQ6OM-D_yohKEz.js} +2 -2
  77. package/dist/client/assets/{OFQON5FD-DJVnaZou.js → OFQON5FD-Eb1UafMJ.js} +2 -2
  78. package/dist/client/assets/{P4ConnectAccountPages-DwBbHN5Q.js → P4ConnectAccountPages-BkOCG7hq.js} +2 -2
  79. package/dist/client/assets/{P4ConnectSidebarSignIn-D7VczA30.js → P4ConnectSidebarSignIn-BarFXVdD.js} +2 -2
  80. package/dist/client/assets/{PJQHF43J-CTXALHLE.js → PJQHF43J-xu8MNrTl.js} +2 -2
  81. package/dist/client/assets/PanelLayoutControls-amKHUz1V.js +216 -0
  82. package/dist/client/assets/{PierreEntryIcon-CUoKY0yE.js → PierreEntryIcon-CbhCWTjd.js} +2 -2
  83. package/dist/client/assets/{PopoverHandle-tRSwNzqr.js → PopoverHandle-DbGxLy3d.js} +2 -2
  84. package/dist/client/assets/PreviewPanel-B1KmgL5R.js +2 -0
  85. package/dist/client/assets/ProjectDefaultsSettings-D_2ixmme.js +2 -0
  86. package/dist/client/assets/{ProjectFavicon-in-OyDkg.js → ProjectFavicon-BXd2O1Gh.js} +3 -3
  87. package/dist/client/assets/{ProjectIconPickerDialog-JCPOaZup.js → ProjectIconPickerDialog-Ccwf3eo1.js} +2 -2
  88. package/dist/client/assets/{ProjectMonogram-DdbScW3Y.js → ProjectMonogram-Bui44V7z.js} +2 -2
  89. package/dist/client/assets/{ProviderAuthTerminal-CCw2XmNz.js → ProviderAuthTerminal-DjIpg2-V.js} +2 -2
  90. package/dist/client/assets/ProviderModelPicker-DJl5IM1n.js +2 -0
  91. package/dist/client/assets/{ProviderSettingsForm-_viBEB9w.js → ProviderSettingsForm-sjzQFb8p.js} +2 -2
  92. package/dist/client/assets/PullRequestCodeTab-BcFFbURH.js +6 -0
  93. package/dist/client/assets/{RHNBAITX-BR5h8H8U.js → RHNBAITX-DWaFNhmX.js} +2 -2
  94. package/dist/client/assets/ReadOnlySourcePreview-DDDARz8g.js +2 -0
  95. package/dist/client/assets/{RedactedSensitiveText-DM7Kme26.js → RedactedSensitiveText-BFwVjGRJ.js} +2 -2
  96. package/dist/client/assets/{RenderErrorBoundary-BeYcnW7D.js → RenderErrorBoundary-DianZAsM.js} +4 -4
  97. package/dist/client/assets/RightPanelResizeHandle-DstJn39I.js +2 -0
  98. package/dist/client/assets/{SLD4V6NK-DfUtjUb_.js → SLD4V6NK-kuRIO20K.js} +2 -2
  99. package/dist/client/assets/ScheduledTasksSettings-BHT9WAFD.js +6 -0
  100. package/dist/client/assets/{ScopedSwitch-CD9C3Bhs.js → ScopedSwitch-B7HEwool.js} +2 -2
  101. package/dist/client/assets/{ScrollAreaCorner-D5JbJL5g.js → ScrollAreaCorner-DW6lxPPn.js} +2 -2
  102. package/dist/client/assets/{SecretInput-ttyiYbVY.js → SecretInput-CxRazSuj.js} +2 -2
  103. package/dist/client/assets/{SelectScrollUpArrow-BV1xykNQ.js → SelectScrollUpArrow-DZfqWvZD.js} +2 -2
  104. package/dist/client/assets/SelfImproveSettingsSection-BxPUr-AT.js +2 -0
  105. package/dist/client/assets/SettingsPanels-CrMsCqvq.js +46 -0
  106. package/dist/client/assets/{SettingsPanels.logic-DS-Semyc.js → SettingsPanels.logic-B406HX50.js} +2 -2
  107. package/dist/client/assets/{SettingsScopeNotice--a-aNSRR.js → SettingsScopeNotice-Dt7vuLO5.js} +2 -2
  108. package/dist/client/assets/{SidebarStageBackdrop-ntSLLOvm.js → SidebarStageBackdrop-BzsUCj2G.js} +2 -2
  109. package/dist/client/assets/{T3PCR2KE-C5JeZecU.js → T3PCR2KE-C14xVwSj.js} +2 -2
  110. package/dist/client/assets/{TKWO2OVW-B11aaxW8.js → TKWO2OVW-CC_4uZad.js} +2 -2
  111. package/dist/client/assets/{TSHNXIZL-2800Jt5F.js → TSHNXIZL-Kizqv5oh.js} +2 -2
  112. package/dist/client/assets/{ThemeEditorPanel-CTXEQSgi.js → ThemeEditorPanel-BuMI6s2A.js} +3 -3
  113. package/dist/client/assets/{ComposerPromptEditor-BqLNVkse.js → ThreadDetailsItemsMenu-CSCIFtTP.js} +60 -60
  114. package/dist/client/assets/ThreadTerminalDrawer-FZ0zyNm1.js +5 -0
  115. package/dist/client/assets/TooltipViewport-DjveMpIl.js +2 -0
  116. package/dist/client/assets/{UQJE5E4I-BG1U9EIM.js → UQJE5E4I-KUX5qtvS.js} +2 -2
  117. package/dist/client/assets/{USNYFO5S-d4iGw5HU.js → USNYFO5S-XMF6TRXj.js} +2 -2
  118. package/dist/client/assets/{Virtualizer-CzClYBap.js → Virtualizer-CqFZ9IgG.js} +2 -2
  119. package/dist/client/assets/{WEVWDWVA-V2MwjUCO.js → WEVWDWVA-BNUvxLQd.js} +2 -2
  120. package/dist/client/assets/{WorkspaceBreadcrumb-Dpau2BKr.js → WorkspaceBreadcrumb-DyZsM9TF.js} +2 -2
  121. package/dist/client/assets/{WorkspacePageContainer-C3u06BW-.js → WorkspacePageContainer-DFXSkFyh.js} +2 -2
  122. package/dist/client/assets/{WorkspacePageHeader-MBEFb20_.js → WorkspacePageHeader-FTc6UfB-.js} +2 -2
  123. package/dist/client/assets/{X5RFHQXM-D_mIa6o9.js → X5RFHQXM-BtifjFQb.js} +2 -2
  124. package/dist/client/assets/{X62E3GBT-Cwvyi_iR.js → X62E3GBT-DT_qCIPw.js} +2 -2
  125. package/dist/client/assets/{XBNEOJTC-sfA1U_fe.js → XBNEOJTC-7FdMX9IP.js} +2 -2
  126. package/dist/client/assets/{YHV2MVVZ-CZoP6AAo.js → YHV2MVVZ-D6KCo9Qp.js} +2 -2
  127. package/dist/client/assets/{YURCZMG2-DYo6rqon.js → YURCZMG2-D0_CST6F.js} +2 -2
  128. package/dist/client/assets/{YVG2LODB-D8sTsTwc.js → YVG2LODB-CRU4fKD2.js} +2 -2
  129. package/dist/client/assets/_chat-P2jEGe91.js +47 -0
  130. package/dist/client/assets/{_chat.design-Nh4vxHDS.js → _chat.design-k56_YrCY.js} +2 -2
  131. package/dist/client/assets/{_chat.index-YNITFXX3.js → _chat.index-CUR_1FMo.js} +2 -2
  132. package/dist/client/assets/{_chat.new-B16PAbQN.js → _chat.new-7EgBpaGD.js} +2 -2
  133. package/dist/client/assets/_chat.pull-requests-C97pdH91.js +2 -0
  134. package/dist/client/assets/{alert-UH7IbYie.js → alert-D0u2-4Zh.js} +2 -2
  135. package/dist/client/assets/{alert-dialog-D3mCT6Vy.js → alert-dialog-DK40IDMO.js} +2 -2
  136. package/dist/client/assets/{assetUrls-BNjjSBLP.js → assetUrls-ChygJppW.js} +2 -2
  137. package/dist/client/assets/assets-Cv1qxio9.js +2 -0
  138. package/dist/client/assets/{browserHistoryStore-CW_ylkPy.js → browserHistoryStore-PB9BBl0N.js} +2 -2
  139. package/dist/client/assets/{browserLinkTarget-Dlnk6CC2.js → browserLinkTarget-BOF3rlV5.js} +2 -2
  140. package/dist/client/assets/{checkbox-Bqcsvpsf.js → checkbox-bsJs8Zu-.js} +2 -2
  141. package/dist/client/assets/{color-picker-DAcpRn0k.js → color-picker-W4KTEgfL.js} +2 -2
  142. package/dist/client/assets/{combobox-CoLp0McG.js → combobox-UDn50qHb.js} +2 -2
  143. package/dist/client/assets/{command-cKnhWwdw.js → command-C7CgDZ25.js} +2 -2
  144. package/dist/client/assets/{connect-rbXRyqde.js → connect-CguaBRtJ.js} +2 -2
  145. package/dist/client/assets/connect-agent-BitywHYq.js +2 -0
  146. package/dist/client/assets/{design-BJbd-4a9.js → design-NrL4Xyzh.js} +2 -2
  147. package/dist/client/assets/device-DsIsK_g9.js +2 -0
  148. package/dist/client/assets/{dialog-CjB1WWbE.js → dialog-BEXthTAp.js} +2 -2
  149. package/dist/client/assets/{diffRendering-JsGpyVJ1.js → diffRendering-DosiBwUN.js} +2 -2
  150. package/dist/client/assets/{dist-D4GndTOF.js → dist-p5OtQFc9.js} +3 -3
  151. package/dist/client/assets/{draft-input-1ySc55QI.js → draft-input-Cp7zSsLs.js} +2 -2
  152. package/dist/client/assets/{duoViewer-DvlUJy5A.js → duoViewer-BcsodgGy.js} +2 -2
  153. package/dist/client/assets/{dynamic-B8PD-aHj.js → dynamic-XOmtS0-B.js} +3 -3
  154. package/dist/client/assets/{embeddedScripts-ByokzHX1.js → embeddedScripts-BQl_ld6u.js} +2 -2
  155. package/dist/client/assets/{empty-CMnFXg8W.js → empty-CTv2Unxd.js} +2 -2
  156. package/dist/client/assets/entities-Ci9sZwRJ.js +2 -0
  157. package/dist/client/assets/env-BfPir1X4.js +2 -0
  158. package/dist/client/assets/{fileLinks-lUzqPrjb.js → fileLinks-T2ko6Qmp.js} +2 -2
  159. package/dist/client/assets/{fileTreeExpansion-B6sjoSXU.js → fileTreeExpansion-BOutPxUH.js} +2 -2
  160. package/dist/client/assets/{getDiffFileInput-Bt5vSiss.js → getDiffFileInput-Do7OSxYn.js} +2 -2
  161. package/dist/client/assets/{guideRunStore-DFawhaj_.js → guideRunStore-DGAK_XSV.js} +2 -2
  162. package/dist/client/assets/{htmlRender-DJLbbd4O.js → htmlRender-DAhG7IlW.js} +2 -2
  163. package/dist/client/assets/index-4XHdM2Yx.js +3 -0
  164. package/dist/client/assets/{input-CSgYZgdv.js → input-BGKmQVHf.js} +2 -2
  165. package/dist/client/assets/{input-group-a-sGQMiV.js → input-group-BdgWY0OZ.js} +2 -2
  166. package/dist/client/assets/{kbd-D3uRVBMx.js → kbd-BIypvknl.js} +2 -2
  167. package/dist/client/assets/key-round-POn1aRXW.js +2 -0
  168. package/dist/client/assets/{keybindings-B9X0TLvu.js → keybindings-C0ntbKmL.js} +2 -2
  169. package/dist/client/assets/{lazy-C_hQh3dP.js → lazy-DudfZwDr.js} +4 -4
  170. package/dist/client/assets/{lazyRouteComponent-GMfIUG8o.js → lazyRouteComponent-VtherrNw.js} +2 -2
  171. package/dist/client/assets/{link-BmkuqfGQ.js → link--eZ8ZXuK.js} +2 -2
  172. package/dist/client/assets/{linkedPrompt-BNxBPorU.js → linkedPrompt-DRNVlalr.js} +2 -2
  173. package/dist/client/assets/main-CKOKCTSr.css +2 -0
  174. package/dist/client/assets/main-CRJyb41E.js +37 -0
  175. package/dist/client/assets/{mediaReference-CVS-Yvam.js → mediaReference-CMwg4kE3.js} +2 -2
  176. package/dist/client/assets/mediaSource-BQpgJ9hG.js +2 -0
  177. package/dist/client/assets/number-field-pjPmm2hH.js +2 -0
  178. package/dist/client/assets/{observeResize-Br7VOcTc.js → observeResize-CV41SgJr.js} +2 -2
  179. package/dist/client/assets/{onboarding-D6kvYnD1.js → onboarding-C7BynXti.js} +2 -2
  180. package/dist/client/assets/openFileInPreview-Cs7GoIEO.js +2 -0
  181. package/dist/client/assets/{p4ProjectFile-B1qTw64E.js → p4ProjectFile-DqqWNGdD.js} +2 -2
  182. package/dist/client/assets/{pair-Das8G2kV.js → pair-Wl7C9P9c.js} +2 -2
  183. package/dist/client/assets/{pendingSendStore-B1MXHU-Y.js → pendingSendStore-CFKdq-QP.js} +2 -2
  184. package/dist/client/assets/{phoneViewer-iWL9Ocv_.js → phoneViewer-C1sFfV5x.js} +2 -2
  185. package/dist/client/assets/{pierre-icons-CyZxWykW.js → pierre-icons-2mAt8csu.js} +2 -2
  186. package/dist/client/assets/{popover-Cpc0L75h.js → popover-oNrAhEOs.js} +2 -2
  187. package/dist/client/assets/{preview-DRZGCh-w.js → preview-CAzlFJXG.js} +2 -2
  188. package/dist/client/assets/{preview-CDQ5ceMi.js → preview-D8H2Itzr.js} +2 -2
  189. package/dist/client/assets/{previewMiniPlayerStore-Dd2KfilQ.js → previewMiniPlayerStore-DwJUVJAq.js} +2 -2
  190. package/dist/client/assets/primary-BdVzsWIK.js +2 -0
  191. package/dist/client/assets/primaryCloudLinkState-eu2avrjG.js +2 -0
  192. package/dist/client/assets/projectFilesQueryState-f8odJKc-.js +2 -0
  193. package/dist/client/assets/{projectScriptEditor-lOSI5meb.js → projectScriptEditor-D8Os7g21.js} +2 -2
  194. package/dist/client/assets/{providerSkills-CRmME5qO.js → providerSkills-B9Q5OmXk.js} +2 -2
  195. package/dist/client/assets/{pullRequestDetail.logic-CXEtJJcn.js → pullRequestDetail.logic-CVJbFct1.js} +4 -4
  196. package/dist/client/assets/{pullRequestIcons-D8Koo716.js → pullRequestIcons-ZE5MB0dW.js} +2 -2
  197. package/dist/client/assets/{pullRequestReviewStore-CpLjLBJR.js → pullRequestReviewStore-CF0UmQoG.js} +2 -2
  198. package/dist/client/assets/pullRequests-p7FMtHTx.js +2 -0
  199. package/dist/client/assets/queries-C1_RUJ-8.js +2 -0
  200. package/dist/client/assets/query-DszcgUku.js +2 -0
  201. package/dist/client/assets/{radio-group-DpxVKrML.js → radio-group-Cb2KobOI.js} +2 -2
  202. package/dist/client/assets/{renderScheduler-B1rJHKDM.js → renderScheduler-BLYWx2Dl.js} +2 -2
  203. package/dist/client/assets/rightPanelStore-BzpX6F8n.js +2 -0
  204. package/dist/client/assets/runtime-CcgzOADx.js +6 -0
  205. package/dist/client/assets/runtime-D2NRh41I.js +3 -0
  206. package/dist/client/assets/{runtimeModeConfig-CZCsG9b4.js → runtimeModeConfig-DTaQ5JjA.js} +2 -2
  207. package/dist/client/assets/{scheduledTasksSettings.logic-gN3n5v-e.js → scheduledTasksSettings.logic-FST8Bc6V.js} +3 -3
  208. package/dist/client/assets/{scroll-area-C9Jh_pl0.js → scroll-area-BN4-XX3T.js} +2 -2
  209. package/dist/client/assets/{select-oshTwPZM.js → select-CHOl11x1.js} +2 -2
  210. package/dist/client/assets/selfImproveFindings-BTdfhZ3z.js +2 -0
  211. package/dist/client/assets/server-C-cSQN_G.js +2 -0
  212. package/dist/client/assets/{session-Bb7JWdWO.js → session-D6BRf77P.js} +2 -2
  213. package/dist/client/assets/{session-logic-D0Wb0fc2.js → session-logic-BwAELIPU.js} +5 -5
  214. package/dist/client/assets/{settings-CQtFOh_t.js → settings-fuKhbSed.js} +2 -2
  215. package/dist/client/assets/{settings.appearance-CqHPJVJ2.js → settings.appearance-K-0McYk9.js} +2 -2
  216. package/dist/client/assets/settings.archived-CalSrYkZ.js +2 -0
  217. package/dist/client/assets/{settings.computer-use-CDrWkvkD.js → settings.computer-use-C8dDJqmo.js} +2 -2
  218. package/dist/client/assets/settings.connections-D_XSkcFH.js +2 -0
  219. package/dist/client/assets/{settings.data-controls-Bd79f82M.js → settings.data-controls-CTlXbRrO.js} +2 -2
  220. package/dist/client/assets/{settings.decisions-B-i781li.js → settings.decisions-C1RgAwXn.js} +2 -2
  221. package/dist/client/assets/{settings.designs-DpX9xXFH.js → settings.designs-BgEqEGXM.js} +2 -2
  222. package/dist/client/assets/settings.diagnostics-BxqI_9bx.js +2 -0
  223. package/dist/client/assets/{settings.general-6bgZAoM7.js → settings.general-BeLPMggF.js} +2 -2
  224. package/dist/client/assets/settings.integrations-4rKfTDFW.js +2 -0
  225. package/dist/client/assets/{settings.keybindings-DzB2I9OY.js → settings.keybindings-DSavoJxs.js} +2 -2
  226. package/dist/client/assets/{settings.open-source-licenses-C-RX63iR.js → settings.open-source-licenses-DWVgu9MJ.js} +2 -2
  227. package/dist/client/assets/{settings.plugins-CqpVlMrk.js → settings.plugins-DsfEfMST.js} +4 -4
  228. package/dist/client/assets/settings.projects-CJzRAMVM.js +4 -0
  229. package/dist/client/assets/settings.providers-BoTCdGuy.js +3 -0
  230. package/dist/client/assets/{settings.scheduled-tasks-Ca4XxyAg.js → settings.scheduled-tasks-BJMUub-y.js} +2 -2
  231. package/dist/client/assets/settings.secrets-Ch_XS6ak.js +2 -0
  232. package/dist/client/assets/{settings.snap-shot-BkSOnsJ3.js → settings.snap-shot-6aF3J4Zd.js} +2 -2
  233. package/dist/client/assets/{settings.source-control-uZ0ges0j.js → settings.source-control-B7PW3yi5.js} +2 -2
  234. package/dist/client/assets/{settings.storage-BkURtSS0.js → settings.storage-PmxiGFaE.js} +2 -2
  235. package/dist/client/assets/settingsLayout-fG812pJ2.js +3 -0
  236. package/dist/client/assets/{sidebar-PSpwc3Zu.js → sidebar-Dt9UYgk1.js} +2 -2
  237. package/dist/client/assets/{sidebarProjectGrouping-D02jVAL6.js → sidebarProjectGrouping-lpBYOlht.js} +2 -2
  238. package/dist/client/assets/{skeleton-DIPW_H7N.js → skeleton-BiqtjWsk.js} +2 -2
  239. package/dist/client/assets/{sourceControl-B9aMMjp2.js → sourceControl-BUEFlHbW.js} +2 -2
  240. package/dist/client/assets/{sourceControlClients-XtdH6kjx.js → sourceControlClients-Bcd4sqEi.js} +2 -2
  241. package/dist/client/assets/{spinner-BeAnBYcY.js → spinner-C64jtA3m.js} +2 -2
  242. package/dist/client/assets/{terminal-links-CYEBYRi6.js → terminal-links-DxE1mEi0.js} +2 -2
  243. package/dist/client/assets/{terminalSessions-C2k3TT8f.js → terminalSessions-Ceajv0BZ.js} +2 -2
  244. package/dist/client/assets/{textarea-DBTtAB2q.js → textarea-DtceyvOF.js} +2 -2
  245. package/dist/client/assets/{themePalette-Uk7bx8zb.js → themePalette-tZPF0oN0.js} +3 -3
  246. package/dist/client/assets/threadCheckpoints-BXz5LJLz.js +2 -0
  247. package/dist/client/assets/toast-BYGaCmZu.js +2 -0
  248. package/dist/client/assets/{toggle-DYYe3Gb8.js → toggle-Be7gb_vD.js} +2 -2
  249. package/dist/client/assets/{toggle-group-hQw0fxkT.js → toggle-group-Cz65VaLC.js} +2 -2
  250. package/dist/client/assets/{tooltip-BeHmtauD.js → tooltip-BYZIg_IY.js} +2 -2
  251. package/dist/client/assets/{uiStateStore-Cd96D_GT.js → uiStateStore-yyuUmO2M.js} +2 -2
  252. package/dist/client/assets/usage-B6rUsIoY.js +2 -0
  253. package/dist/client/assets/{usageAccess-DTKEwCKL.js → usageAccess-0MZ9DMCW.js} +2 -2
  254. package/dist/client/assets/{usageFormat-D1mf8I5d.js → usageFormat-4k8-70X2.js} +2 -2
  255. package/dist/client/assets/{usageShortcuts-C0jTsdR4.js → usageShortcuts-C4Dhwzkz.js} +2 -2
  256. package/dist/client/assets/{use-atom-command-D4TeQyNE.js → use-atom-command-DEluSG6k.js} +2 -2
  257. package/dist/client/assets/{useAriaLabelledBy-Cod6bMX5.js → useAriaLabelledBy-Ca8fkLAD.js} +2 -2
  258. package/dist/client/assets/{useHandleNewThread-CJ3yJ6tD.js → useHandleNewThread-BOej8pJq.js} +2 -2
  259. package/dist/client/assets/{useLocation-DNv7cb59.js → useLocation-_8If3LN3.js} +2 -2
  260. package/dist/client/assets/{useNavigate-PfhtEZbl.js → useNavigate-5WivMyAa.js} +2 -2
  261. package/dist/client/assets/{useNavigateBack-DUje4FcE.js → useNavigateBack-DXfbYF86.js} +2 -2
  262. package/dist/client/assets/{useP4ConnectAuthPrompt-evKe5nuS.js → useP4ConnectAuthPrompt-D0Equ6mY.js} +2 -2
  263. package/dist/client/assets/{useParams-CzC0HF0R.js → useParams-DV-Nw6Lj.js} +2 -2
  264. package/dist/client/assets/{usePermissionStatus-BUDWSxLm.js → usePermissionStatus-CIobAIHF.js} +2 -2
  265. package/dist/client/assets/{usePullRequestActions-Cxt5UQ0d.js → usePullRequestActions-Cf39XlVv.js} +3 -3
  266. package/dist/client/assets/{useRegisterFieldControl-B4MJ2axN.js → useRegisterFieldControl-Dmsxd6H8.js} +2 -2
  267. package/dist/client/assets/{useScopedModelAvailability-ujoqpGuE.js → useScopedModelAvailability-Cc-bmdqn.js} +2 -2
  268. package/dist/client/assets/useSettings-jZr_DfW0.js +3 -0
  269. package/dist/client/assets/utils-OWUgXvpr.js +37 -0
  270. package/dist/client/assets/vcsRefInvalidation-CRToBQE1.js +2 -0
  271. package/dist/client/assets/{welcome-DqtsIjdN.js → welcome-BcjbPbMq.js} +2 -2
  272. package/dist/client/index.html +1 -1
  273. package/dist/client/third-party-licenses.json +1 -1
  274. package/dist/pele-RvfyfJB5.mjs +29609 -0
  275. package/dist/{renderer-CmxAcIV2.mjs → renderer-D_KFqL06.mjs} +2 -2
  276. package/dist/resource-monitor/darwin-arm64/p4-resource-monitor +0 -0
  277. package/dist/{runtime-CAtWuL14.mjs → runtime-Tslhhp69.mjs} +106 -19
  278. package/package.json +1 -1
  279. package/dist/AcpMcpStdioBridge-BFMDWrrj.mjs +0 -3
  280. package/dist/client/assets/AlertDialogRoot-C6RQ4Ag-.js +0 -2
  281. package/dist/client/assets/ChatGptUsageButton-C3xHekTe.js +0 -2
  282. package/dist/client/assets/ChatMarkdown-Cw9bEYxG.js +0 -48
  283. package/dist/client/assets/DevicePanel-BS7y97f_.js +0 -2
  284. package/dist/client/assets/DeviceSetup-TIKLCkls.js +0 -2
  285. package/dist/client/assets/DiffPanel-CAK_DAYa.js +0 -2
  286. package/dist/client/assets/FilePreviewPanel-DJ-LkCJ7.js +0 -34
  287. package/dist/client/assets/Input--rtZ2Jji.js +0 -2
  288. package/dist/client/assets/JZOYTAAL-PmkwTnld.js +0 -1
  289. package/dist/client/assets/PanelLayoutControls-D8g6TJ8z.js +0 -216
  290. package/dist/client/assets/PreviewPanel-cYx50TF6.js +0 -2
  291. package/dist/client/assets/ProjectDefaultsSettings-G0FTRG0c.js +0 -2
  292. package/dist/client/assets/ProviderModelPicker-DWqfDVY9.js +0 -2
  293. package/dist/client/assets/PullRequestCodeTab-D3ntjIAg.js +0 -6
  294. package/dist/client/assets/ReadOnlySourcePreview-Bx9Jebzp.js +0 -2
  295. package/dist/client/assets/ScheduledTasksSettings-BcF7IiOl.js +0 -4
  296. package/dist/client/assets/SelfImproveSettingsSection-Dm8NhqV7.js +0 -2
  297. package/dist/client/assets/SettingsPanels-BsyJETg8.js +0 -46
  298. package/dist/client/assets/ThreadTerminalDrawer-DIUp50A3.js +0 -5
  299. package/dist/client/assets/TooltipViewport-rDmof6w5.js +0 -2
  300. package/dist/client/assets/_chat-DNoJniWX.js +0 -47
  301. package/dist/client/assets/_chat.pull-requests-DEHC0db5.js +0 -2
  302. package/dist/client/assets/assets-CrCgj2yM.js +0 -2
  303. package/dist/client/assets/connect-agent-CsvW078q.js +0 -2
  304. package/dist/client/assets/device-BqGYZxfg.js +0 -2
  305. package/dist/client/assets/entities-CTJ1ube2.js +0 -2
  306. package/dist/client/assets/env-wK1YYxA8.js +0 -2
  307. package/dist/client/assets/index-CxLeDuff.js +0 -3
  308. package/dist/client/assets/key-round-CoEmBzzZ.js +0 -2
  309. package/dist/client/assets/main-BD4pReCY.css +0 -2
  310. package/dist/client/assets/main-DIEsHSIy.js +0 -37
  311. package/dist/client/assets/mediaSource-DQsJoeCH.js +0 -2
  312. package/dist/client/assets/number-field-Bw2BDGyn.js +0 -2
  313. package/dist/client/assets/openFileInPreview-52PEk4wb.js +0 -2
  314. package/dist/client/assets/primary-YDhFfOF8.js +0 -2
  315. package/dist/client/assets/primaryCloudLinkState-kvnCGEBC.js +0 -2
  316. package/dist/client/assets/projectFilesQueryState-DvEcN38K.js +0 -2
  317. package/dist/client/assets/pullRequests-DKqH-UAm.js +0 -2
  318. package/dist/client/assets/queries-eqpX-CHf.js +0 -2
  319. package/dist/client/assets/query-D5Kb9u_z.js +0 -2
  320. package/dist/client/assets/rightPanelStore-DQ1c3-Lt.js +0 -2
  321. package/dist/client/assets/runtime-DCbEdU32.js +0 -3
  322. package/dist/client/assets/runtime-DeVKKxNz.js +0 -6
  323. package/dist/client/assets/selfImproveFindings-DUmfxmCO.js +0 -2
  324. package/dist/client/assets/server-Ct4-BCZx.js +0 -2
  325. package/dist/client/assets/settings.archived-DDtPGPcJ.js +0 -2
  326. package/dist/client/assets/settings.connections-CHXX5kH0.js +0 -2
  327. package/dist/client/assets/settings.diagnostics-Du6_cMwQ.js +0 -2
  328. package/dist/client/assets/settings.integrations-Ct8ruO3E.js +0 -2
  329. package/dist/client/assets/settings.projects-DosfFxrs.js +0 -4
  330. package/dist/client/assets/settings.providers-DKgzTRpw.js +0 -3
  331. package/dist/client/assets/settingsLayout-krWuVpsF.js +0 -3
  332. package/dist/client/assets/toast-Dkj3G-UM.js +0 -2
  333. package/dist/client/assets/usage-ChIGOn5O.js +0 -2
  334. package/dist/client/assets/useSettings-Cg0O7Ek7.js +0 -3
  335. package/dist/client/assets/utils-CcBaVOX5.js +0 -37
  336. package/dist/client/assets/vcsRefInvalidation-B5V_HlR9.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$C as t,AS as n,BS as r,CE as i,Gx as a,JS as o,KC as s,Kx as c,OC as l,QC as u,Tv as d,VC as ee,WC as f,Xc as p,Xw as te,Xx as m,_S as h,_s as g,as as _,bS as v,cs as y,ew as b,jC as x,jE as ne,nS as S,ov as C,qx as w,ss as T,tw as E,uS as D,xT as O}from"./utils-OWUgXvpr.js";import{N as k,_t as A,k as j,qt as M}from"./runtime-CcgzOADx.js";import{$ as N,X as P,et as F,it as I,nt as L,tt as R}from"./entities-Ci9sZwRJ.js";import{t as re}from"./runtime-D2NRh41I.js";import{at as z}from"./useSettings-jZr_DfW0.js";import{t as B}from"./session-D6BRf77P.js";import{n as V}from"./query-DszcgUku.js";var H=e(),U=`~effect/PartitionedSemaphore`,W=e=>{let n=Math.max(0,e.permits);if(!Number.isFinite(n))return{[U]:U,capacity:n,available:l(n),take:()=>f,release:()=>l(n),withPermits:()=>e=>e,withPermit:()=>e=>e,withPermitsIfAvailable:()=>e=>w(e)};let r=n,a=0,c=u(),d=c[Symbol.iterator](),p=!1,g=0,_=e=>{if(e>0&&(g+=e),!p){p=!0;try{for(;g>0&&a>0;){let e=d.next();if(e.done&&(d=c[Symbol.iterator](),e=d.next(),e.done))break;let t=e.value[1].values().next().value;t!==void 0&&(--t.permits,--a,--g,t.permits===0&&t.resume())}}finally{p=!1}}return a===0&&(r=Math.min(n,r+g),g=0),r},v=(e,l)=>l<=0?f:n<l?o:s(n=>r>=l?(r-=l,O(n,e=>{te(e)&&_(l)}),f):m(n=>{if(r>=l){n(v(e,l));return}let o=l-r;r>0&&(r=0),a+=o;let s=i(t(c,e),()=>{let t=new Set;return E(c,e,t),t}),u={permits:o,resume:()=>{d(),n(f)}},d=()=>{s.delete(u)&&s.size===0&&b(c,e)};return s.add(u),x(()=>{d(),a-=u.permits,_(l-u.permits)})})),y=(e,t)=>n=>{if(t<=0)return n;let r=v(e,t);return ee(e=>h(e(r),()=>D(e(n),x(()=>{_(t)}))))},S=e=>e<=0?!0:n<e||r<e?!1:(r-=e,!0);return{[U]:U,capacity:n,available:x(()=>r),take:v,release:e=>x(()=>_(e)),withPermits:y,withPermit:e=>y(e,1),withPermitsIfAvailable:e=>t=>e<=0?w(t):s(n=>S(e)?(O(n,()=>{_(e)}),w(t)):l(ne()))}};function G(e){if(e.sessionError!==null)return{canReadFiles:!1,isPending:!1,error:e.sessionError};if(e.session===null){let t=!e.isCatalogReady||e.connection?.phase===`connected`||e.connection?.phase===`connecting`||e.connection?.phase===`reconnecting`;return{canReadFiles:!1,isPending:t,error:t?null:e.connection?.error??`This environment is not connected.`}}return{canReadFiles:d(e.session,C),isPending:!1,error:null}}function K(e,t=``,n=!0){let r=n&&I(e,t),i=r?N(e):``;return{isBrowsing:r,directoryPath:i,filterQuery:r&&!L(e)?F(e):``,parentPath:r?R(i):null,canBrowseUp:r&&P(i)}}function q(e,t){let n=t.toLowerCase(),r=t.startsWith(`.`),i=e.filter(e=>e.name.toLowerCase().startsWith(n)&&(r||!e.name.startsWith(`.`)));return{visibleEntries:i,exactEntry:t.length>0?i.find(e=>e.name===t)??null:null}}function J(){let e=0;return{invalidate:()=>{e+=1},run:async(t,n)=>{let r=++e;return await t(),r===e&&(n(),!0)}}}function Y(e){return e===`connected`}function X(e){return{browse:k(e,{label:`environment-data:filesystem:browse`,tag:p.filesystemBrowse})}}var ie=X(re);function ae(e){let t=(0,H.c)(7),n;t[0]===e?n=t[1]:(n=e===null?null:B.sessionStateAtom(e),t[0]=e,t[1]=n);let r=V(n),i=z(e),a=i.presentation?.connection??null,o;return t[2]!==i.isReady||t[3]!==r.data||t[4]!==r.error||t[5]!==a?(o=G({isCatalogReady:i.isReady,connection:a,session:r.data,sessionError:r.error}),t[2]=i.isReady,t[3]=r.data,t[4]=r.error,t[5]=a,t[6]=o):o=t[6],o}var oe=j(),se={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd])},ce=_(e=>y({revision:0,persistedCacheReadable:!0}).pipe(T,g(`environment-data:vcs:list-refs-state:${e}`))),Z=W({permits:1});function Q(e){return ce(e.environmentId)}function le(e,t,n){e.update(Q(t),e=>({revision:e.revision+1,persistedCacheReadable:n??e.persistedCacheReadable}))}function $(e,t){return Z.withPermit(e)(t)}var ue=v(`VcsRefsState.invalidateCached`)(function*(e,t){let i=yield*M;yield*$(t.environmentId,n(function*(){le(e,t,yield*i.clearVcsRefs(t.environmentId).pipe(c(!0),S(e=>r(`Could not remove invalidated cached Git refs.`).pipe(a({environmentId:t.environmentId,cwd:t.cwd,...A(e)}),c(!1)))))}))});export{oe as a,Y as c,K as d,se as i,J as l,Q as n,ie as o,$ as r,ae as s,ue as t,q as u};
2
+ //# sourceMappingURL=vcsRefInvalidation-CRToBQE1.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ap as i,Fd as a,H_ as o,Hy as s,Is as c,Ms as l,Ob as u,Rd as d,Rm as f,Uy as p,W_ as m,Xy as h,Yc as g,_E as _,cs as v,eb as y,fr as b,fv as x,hE as S,l as C,md as w,nc as T,ns as E,o as D,op as O,rs as k,rv as A,t as j,tc as M,tf as N}from"./utils-CcBaVOX5.js";import{At as P,M as F,N as I,R as L,W as R,o as z}from"./runtime-DeVKKxNz.js";import{N as B,Q as V,W as H,u as U}from"./entities-CTJ1ube2.js";import{t as W}from"./runtime-DCbEdU32.js";import{t as G}from"./spinner-BeAnBYcY.js";import{t as ee}from"./useNavigate-PfhtEZbl.js";import{t as K}from"./useLocation-DNv7cb59.js";import{i as q}from"./toast-Dkj3G-UM.js";import{D as J,E as te}from"./useSettings-Cg0O7Ek7.js";import{f as Y}from"./server-Ct4-BCZx.js";import{i as ne,n as X,o as re}from"./session-Bb7JWdWO.js";import{t as ie}from"./query-D5Kb9u_z.js";import{t as ae}from"./use-atom-command-D4TeQyNE.js";import{a as oe}from"./timestampFormat-wac2e_Jz.js";import{a as se,n as ce,t as le}from"./tooltip-BeHmtauD.js";import{t as ue}from"./input-CSgYZgdv.js";import{t as de}from"./scroll-area-C9Jh_pl0.js";import{r as fe}from"./dist-D4GndTOF.js";import{t as pe}from"./dialog-CjB1WWbE.js";import{t as me}from"./useP4ConnectAuthPrompt-evKe5nuS.js";import{t as he}from"./CommandBlock-D6NTupaO.js";import{t as ge}from"./checkbox-Bqcsvpsf.js";import{t as _e}from"./ThreadTerminalDrawer-DIUp50A3.js";import{i as ve}from"./terminalSessions-C2k3TT8f.js";import{n as ye}from"./useHandleNewThread-CJ3yJ6tD.js";import{r as be,t as xe}from"./alert-UH7IbYie.js";import{i as Se,n as Ce}from"./ChatGptUsageButton-C3xHekTe.js";import{t as we}from"./onboarding-D6kvYnD1.js";import{_ as Te,ai as Ee,an as De,do as Oe,eo as ke,f as Ae,fo as je,ho as Me,lo as Ne,mo as Pe,on as Fe,po as Ie,un as Le,uo as Re}from"./main-DIEsHSIy.js";import{t as ze}from"./NoProjectsHero-CbIPjHEJ.js";import{t as Be}from"./legalLinks-C4VP5hPh.js";import{r as Ve}from"./SettingsPanels.logic-DS-Semyc.js";import{d as He,f as Ue,i as We,l as Ge,n as Ke,o as qe,t as Je,u as Ye}from"./CodexSetupSection.logic-Bl5OcEqH.js";var Z=e(t(),1),Q=n(),Xe=2592e6,Ze=3;function Qe(e,t=Date.now()){let n=t-Xe;return{available:e,recent:e.filter(e=>{if(e.git===null||e.threadCount<Ze||e.lastActiveAt===null)return!1;let r=Date.parse(e.lastActiveAt);return r>=n&&r<=t})}}function $e(e,t){return e===null?t:t===null||e>t?e:t}function et(e){let t=new Map,n=[];for(let r of e){if(r.git===null){n.push(r);continue}let e=r.git??{remoteKey:null,repository:null},i=e.remoteKey===null?`path:${r.path}`:`remote:${e.remoteKey}`,a=t.get(i);a===void 0?t.set(i,{key:i,label:e.repository??r.title,repository:e.repository,candidates:[r],threadCount:r.threadCount,lastActiveAt:r.lastActiveAt}):(a.candidates.push(r),t.set(i,{...a,threadCount:a.threadCount+r.threadCount,lastActiveAt:$e(a.lastActiveAt,r.lastActiveAt)}))}return{repositories:[...t.values()].sort((e,t)=>e.lastActiveAt===t.lastActiveAt?e.label.localeCompare(t.label):e.lastActiveAt===null?1:t.lastActiveAt===null?-1:t.lastActiveAt.localeCompare(e.lastActiveAt)),other:n}}function tt(e,t,n){if(n.projectId!==void 0)return n.projectId;let r=e.filter(e=>e.environmentId===t),i=V(r,n.path);return i===void 0?null:i.id}function nt(e,t,n){for(let n of e){let e=t.get(n);if(e!==void 0)return e}for(let t of e){let e=n.get(t);if(e!==void 0)return e}}function rt(e){if(/^[A-Za-z]:[\\/]+$/.test(e)||/^[\\/]{2}[^\\/]+[\\/][^\\/]+[\\/]*$/.test(e))return{name:e,parent:``};let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.length===0?{name:e,parent:``}:n<0?{name:t,parent:``}:{name:t.slice(n+1),parent:t.slice(0,n+1)}}function it(e,t){return JSON.stringify([e,t])}var at=I(W,{label:`environment-data:agent-sessions:scan`,tag:g.agentSessionsScan,staleTimeMs:3e4,idleTtlMs:3e5}),ot=F(W,{label:`environment-data:agent-sessions:import`,tag:g.agentSessionsImport});function st(e){return P(e.entry)}function ct(e,t){let n=e.filter(e=>t.has(e.environmentId)),r=e=>n.filter(t=>e(t.connection.phase)).map(e=>e.environmentId),i=r(e=>e===`connected`),a=n.some(e=>e.connection.phase===`connecting`);return{ready:i.length>0&&!a,environmentIds:i,skippedIds:r(e=>e!==`connected`&&e!==`connecting`)}}function lt(e){let t=(0,Q.c)(3),n=(0,Z.useContext)(k),r;return t[0]!==e||t[1]!==n?(r=v(t=>e.map(e=>{let r=at({environmentId:e,input:{}}),i=t(r);return{environmentId:e,data:S(l(i)),error:i._tag===`Failure`?ie(i.cause):null,isPending:i.waiting||i._tag===`Initial`,refresh:()=>n.refresh(r)}})),t[0]=e,t[1]=n,t[2]=r):r=t[2],E(r)}var $=e(r(),1),ut=[],dt=h.make(`onboarding-agent-setup`),ft=[`Connect`,`Agents`,`Projects`],pt=`Scan limit reached. Some projects or conversations may be missing.`;function mt({localAvailable:e,onDone:t,resumeEnvironmentId:n}){let r=Le(),[i,a]=(0,Z.useState)(n?`agents`:`connection`),{environments:o}=te(),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(new Set),[u,d]=(0,Z.useState)(n?[n]:[]),[f,p]=(0,Z.useState)(!1),m=(0,Z.useRef)(null),h=(0,Z.useRef)(null),g=J();(0,Z.useEffect)(()=>{let e=o.filter(e=>!l.current.has(e.environmentId));if(e.length===0)return;for(let t of e)l.current.add(t.environmentId);let t=e.filter(e=>e.entry.enabled);t.length!==0&&c(e=>new Set([...e??[],...t.map(e=>e.environmentId)]))},[o]);let _=s??new Set(g?[g.environmentId]:[]),v=lt(i===`import`?u:ut),y=i===`import`&&v.every(e=>e.data===null)&&v.some(e=>e.isPending),b=e=>{e.length!==0&&(d(e),a(`agents`))},x=i===`agents`?1:i===`import`?2:0,S=(0,Z.useCallback)((e,n,i=0)=>{if(m.current!==null)return m.current;h.current!==null&&(q.close(h.current),h.current=null);let a=r().then(async()=>(h.current!==null&&(q.close(h.current),h.current=null),await t(e),n?q.add({type:`warning`,title:`Some history was not imported`,description:n,timeout:0}):i>0&&q.add({type:`success`,title:`Imported ${i} ${i===1?`thread`:`threads`}`}),!0)).catch(()=>{let e={type:`error`,title:`Could not finish setup`,description:`Your settings could not be saved. Try again.`};return h.current===null?h.current=q.add(e):q.update(h.current,e),!1}).finally(()=>{m.current===a&&(m.current=null)});return m.current=a,a},[r,t]);return(0,$.jsxs)(pe,{open:!0,disablePointerDismissal:!0,onOpenChange:(e,t)=>t.cancel(),children:[(0,$.jsxs)(Oe,{size:`wide`,bottomStickOnMobile:!1,showCloseButton:!1,initialFocus:()=>document.getElementById(`onboarding-pairing-url`)??!0,children:[(0,$.jsx)(Ne,{title:`Set up P4 Code`,identity:(0,$.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,role:`img`,"aria-label":`P4 Code`,children:[(0,$.jsx)(Ee,{className:`h-4 w-auto shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-2xl font-medium tracking-tight text-muted-foreground`,children:`Code`})]}),children:(0,$.jsx)(je,{steps:ft,currentStep:x,isStepDisabled:e=>f||e>=x,onStepChange:e=>{f||e>x||a(e===0?`connection`:`agents`)}})}),(0,$.jsx)(Re,{holdHeight:y,children:i===`connection`?(0,$.jsx)(ht,{expandPairingInitially:!e&&!z(),selectedIds:_,autoSelectedComputers:l.current,onSelectionChange:c,onToggleEnvironment:(e,t)=>c(n=>{let r=new Set(n??_);return t?r.add(e):r.delete(e),r}),onContinue:()=>b(ct(o,_).environmentIds),onPaired:e=>{c(new Set([..._,e]))}}):i===`agents`?(0,$.jsx)(xt,{environmentIds:u,onContinue:()=>a(`import`)}):(0,$.jsx)(At,{scans:v,isImporting:f,setIsImporting:p,onDone:S})})]}),(0,$.jsx)(Te,{})]})}function ht(e){let t=(0,Q.c)(44),{autoSelectedComputers:n,expandPairingInitially:r,selectedIds:a,onSelectionChange:o,onToggleEnvironment:s,onContinue:c,onPaired:l}=e,{environments:u}=te(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=z(),t[0]=f):f=t[0];let p=f,m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>!p||!st(e),t[1]=m):m=t[1];let h=u.filter(m),[g,_]=(0,Z.useState)(r),[v,y]=(0,Z.useState)(!1),{ready:x,skippedIds:S}=ct(u,a),C=u.filter(e=>S.includes(e.environmentId)).map(gt),T=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{x&&(document.activeElement===document.body||document.activeElement?.getAttribute(`role`)===`dialog`)&&T.current?.focus()},[x]);let E,D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Connect your computers`}),D=(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:`Choose one or more computers. We’ll set up agents and projects on each.`}),t[2]=E,t[3]=D):(E=t[2],D=t[3]);let k=h.length>0?(0,$.jsxs)(`fieldset`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:`Computers to set up`}),h.map(e=>(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border border-border bg-background px-3 py-3`,children:[(0,$.jsx)(ge,{checked:a.has(e.environmentId),onCheckedChange:t=>{let n=new Set(a);t?n.add(e.environmentId):n.delete(e.environmentId),o(n)}}),(0,$.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex items-baseline justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium break-words`,children:e.label}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:!e.entry.enabled&&e.connection.phase!==`unsupported`?`Off`:Fe(e.connection).buttonLabel})]}),e.displayUrl?(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs break-all text-muted-foreground`,children:e.displayUrl}):null]})]},e.environmentId))]}):null,A;t[4]!==n||t[5]!==v||t[6]!==s||t[7]!==a?(A=p?(0,$.jsx)(_t,{autoSelectedComputers:n,disabled:v,selectedIds:a,onToggleEnvironment:s}):null,t[4]=n,t[5]=v,t[6]=s,t[7]=a,t[8]=A):A=t[8];let M,N,P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(b,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),N=(0,$.jsx)(O,{className:`size-4 text-muted-foreground`}),P=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`Add a computer`}),t[9]=M,t[10]=N,t[11]=P):(M=t[9],N=t[10],P=t[11]);let F=g&&`rotate-90`,I;t[12]===F?I=t[13]:(I=j(`size-4 text-muted-foreground`,F),t[12]=F,t[13]=I);let L;t[14]===I?L=t[15]:(L=(0,$.jsx)(d,{className:I}),t[14]=I,t[15]=L);let R;t[16]!==v||t[17]!==L?(R=(0,$.jsxs)(Me,{disabled:v,render:M,children:[N,P,L]}),t[16]=v,t[17]=L,t[18]=R):R=t[18];let B;t[19]===l?B=t[20]:(B=e=>{_(!1),l(e),requestAnimationFrame(()=>T.current?.focus())},t[19]=l,t[20]=B);let V;t[21]!==v||t[22]!==B?(V=(0,$.jsx)(Pe,{children:(0,$.jsx)(`div`,{className:`px-3 pb-3`,children:(0,$.jsx)(vt,{isPairing:v,setIsPairing:y,onPaired:B})})}),t[21]=v,t[22]=B,t[23]=V):V=t[23];let H;t[24]!==g||t[25]!==R||t[26]!==V?(H=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Ie,{open:g,onOpenChange:_,children:[R,V]})}),t[24]=g,t[25]=R,t[26]=V,t[27]=H):H=t[27];let U;t[28]!==H||t[29]!==A?(U=(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[A,H]}),t[28]=H,t[29]=A,t[30]=U):U=t[30];let W=C.length>0?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:[`Not connected, so setup skips `,C.join(`, `),`. You can set`,` `,C.length===1?`it`:`them`,` up later from Settings.`]}):null,G;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsxs)(`p`,{className:`min-w-0 text-xs leading-relaxed text-muted-foreground`,children:[`P4 Code collects anonymous usage data to help us improve it. To read more about how your data is used and how to opt out, see our`,` `,(0,$.jsx)(`a`,{className:`underline underline-offset-2 hover:text-foreground`,href:Be,target:`_blank`,rel:`noreferrer noopener`,children:`privacy policy`}),`.`]}),t[31]=G):G=t[31];let ee=!r,K=!x||v,q;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(w,{className:`size-3.5`}),t[32]=q):q=t[32];let J;t[33]!==c||t[34]!==ee||t[35]!==K?(J=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[G,(0,$.jsxs)(b,{className:`shrink-0 self-end`,ref:T,autoFocus:ee,disabled:K,onClick:c,children:[`Continue`,q]})]}),t[33]=c,t[34]=ee,t[35]=K,t[36]=J):J=t[36];let Y;return t[37]!==U||t[38]!==W||t[39]!==J||t[40]!==E||t[41]!==D||t[42]!==k?(Y=(0,$.jsxs)($.Fragment,{children:[E,D,k,U,W,J]}),t[37]=U,t[38]=W,t[39]=J,t[40]=E,t[41]=D,t[42]=k,t[43]=Y):Y=t[43],Y}function gt(e){return e.label}function _t(e){let t=(0,Q.c)(36),{autoSelectedComputers:n,disabled:r,selectedIds:i,onToggleEnvironment:a}=e,{environments:o}=te(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={treatPendingAsSignedOut:!1},t[0]=s):s=t[0];let{isLoaded:c,isSignedIn:l}=fe(s),{openAuthPrompt:u}=me(),[f,p]=(0,Z.useState)(!0),[m,h]=(0,Z.useState)(!1),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>h(!0),t[1]=g):g=t[1];let _=g,v=f&&!!l&&m,y=r||!c,x;t[2]!==l||t[3]!==u?(x=e=>{l||(e.preventDefault(),p(!0),u())},t[2]=l,t[3]=u,t[4]=x):x=t[4];let S,C,w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(b,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),C=(0,$.jsx)(N,{className:`size-4 text-muted-foreground`}),w=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`P4 Connect`}),t[5]=S,t[6]=C,t[7]=w):(S=t[5],C=t[6],w=t[7]);let T=c?l?m?null:`Loading computers…`:`Sign in`:`Loading sign-in…`,E;t[8]===T?E=t[9]:(E=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:T}),t[8]=T,t[9]=E);let D=f&&l&&`rotate-90`,O;t[10]===D?O=t[11]:(O=j(`size-4 text-muted-foreground`,D),t[10]=D,t[11]=O);let k;t[12]===O?k=t[13]:(k=(0,$.jsx)(d,{className:O}),t[12]=O,t[13]=k);let A;t[14]!==E||t[15]!==k||t[16]!==y||t[17]!==x?(A=(0,$.jsxs)(Me,{disabled:y,onClick:x,render:S,children:[C,w,E,k]}),t[14]=E,t[15]=k,t[16]=y,t[17]=x,t[18]=A):A=t[18];let M;t[19]!==n||t[20]!==o||t[21]!==l||t[22]!==a||t[23]!==i?(M=l?(0,$.jsx)(De,{primaryEnvironmentId:null,savedEnvironments:o,showSavedEnvironments:!0,onDiscoveryReady:_,selection:{selectedIds:i,onChange:a,autoSelectedComputers:n},refreshWhileEmpty:!0,empty:(0,$.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No computers linked yet.`})}):null,t[19]=n,t[20]=o,t[21]=l,t[22]=a,t[23]=i,t[24]=M):M=t[24];let P;t[25]===M?P=t[26]:(P=(0,$.jsx)(`div`,{className:`mb-3 space-y-1.5`,children:M}),t[25]=M,t[26]=P);let F,I,L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run this on each computer you want to connect.`}),I=(0,$.jsx)(he,{command:`npx @p4code/cli connect`,className:`mt-3`}),L=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Keep P4 Code running. Select the computers you want to set up above.`}),t[27]=F,t[28]=I,t[29]=L):(F=t[27],I=t[28],L=t[29]);let R;t[30]===P?R=t[31]:(R=(0,$.jsx)(Pe,{keepMounted:!0,children:(0,$.jsxs)(`div`,{className:`px-3 pb-3`,children:[P,F,I,L]})}),t[30]=P,t[31]=R);let z;return t[32]!==A||t[33]!==R||t[34]!==v?(z=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Ie,{open:v,onOpenChange:p,children:[A,R]})}),t[32]=A,t[33]=R,t[34]=v,t[35]=z):z=t[35],z}function vt(e){let t=(0,Q.c)(38),{isPairing:n,setIsPairing:r,onPaired:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},t[0]=a):a=t[0];let o=ae(we,a),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),f=(0,Z.useRef)(!0),p,m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>(f.current=!0,()=>{f.current=!1}),m=[],t[1]=p,t[2]=m):(p=t[1],m=t[2]),(0,Z.useEffect)(p,m);let h;t[3]!==o||t[4]!==n||t[5]!==i||t[6]!==s||t[7]!==r?(h=async()=>{if(n||s.trim().length===0)return;r(!0),u(``);let e=await o({pairingUrl:s.trim()});if(!f.current)return;if(r(!1),e._tag===`Success`){i(e.value);return}if(L(e))return;let t=R(e);u(t instanceof Error?t.message:`Pairing failed.`)},t[3]=o,t[4]=n,t[5]=i,t[6]=s,t[7]=r,t[8]=h):h=t[8];let g=h,_;t[9]===g?_=t[10]:(_=e=>{e.preventDefault(),g()},t[9]=g,t[10]=_);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`label`,{className:`block text-sm text-muted-foreground`,htmlFor:`onboarding-pairing-url`,children:`Pairing link`}),t[11]=v):v=t[11];let y=l.length>0,x=l?`onboarding-pairing-error`:void 0,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>c(e.currentTarget.value),t[12]=S):S=t[12];let C;t[13]!==n||t[14]!==s||t[15]!==y||t[16]!==x?(C=(0,$.jsxs)(`div`,{children:[v,(0,$.jsx)(ue,{id:`onboarding-pairing-url`,autoFocus:!0,"aria-invalid":y,"aria-describedby":x,className:`mt-2`,size:`lg`,autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,nativeInput:!0,readOnly:n,placeholder:`https://your-server:5230/pair#token=…`,value:s,onChange:S,onKeyDown:yt})]}),t[13]=n,t[14]=s,t[15]=y,t[16]=x,t[17]=C):C=t[17];let w;t[18]===l?w=t[19]:(w=l?(0,$.jsx)(xe,{id:`onboarding-pairing-error`,variant:`error`,children:(0,$.jsx)(be,{children:l})}):null,t[18]=l,t[19]=w);let T;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsxs)(Me,{type:`button`,className:`group flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,$.jsx)(d,{className:`size-3.5 group-data-panel-open:rotate-90`}),`Need a pairing link?`]}),t[20]=T):T=t[20];let E;t[21]!==n||t[22]!==s?(E=n||s.trim().length===0,t[21]=n,t[22]=s,t[23]=E):E=t[23];let D=n?`Pairing...`:`Pair`,O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[T,(0,$.jsx)(b,{type:`submit`,disabled:E,children:D})]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k,A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(`p`,{className:`pt-3 text-sm text-muted-foreground`,children:`Run this on the computer with your code.`}),A=(0,$.jsx)(he,{command:`npx @p4code/cli pair`,className:`mt-2`}),t[27]=k,t[28]=A):(k=t[27],A=t[28]);let j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli serve`}),t[29]=j):j=t[29];let M;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(Pe,{children:[k,A,(0,$.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`Start P4 Code first, or run `,j,`. Add `,(0,$.jsx)(`code`,{className:`font-mono`,children:`--tailscale`}),` to use your tailnet.`]})]}),t[30]=M):M=t[30];let N;t[31]===O?N=t[32]:(N=(0,$.jsxs)(Ie,{children:[O,M]}),t[31]=O,t[32]=N);let P;return t[33]!==C||t[34]!==w||t[35]!==N||t[36]!==_?(P=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`form`,{className:`space-y-3`,onSubmit:_,children:[C,w,N]})}),t[33]=C,t[34]=w,t[35]=N,t[36]=_,t[37]=P):P=t[37],P}function yt(e){e.key===`Enter`&&(e.nativeEvent.isComposing||e.keyCode===229)&&e.preventDefault()}var bt=[`codex`,`claudeAgent`];function xt(e){let t=(0,Q.c)(13),{environmentIds:n,onContinue:r}=e,{environments:i}=te(),a;if(t[0]!==n||t[1]!==i){let e;t[3]===i?e=t[4]:(e=e=>(0,$.jsx)(St,{environmentId:e,machineLabel:i.find(t=>t.environmentId===e)?.label??`Computer`},e),t[3]=i,t[4]=e),a=n.map(e),t[0]=n,t[1]=i,t[2]=a}else a=t[2];let o;t[5]===a?o=t[6]:(o=(0,$.jsx)(de,{scrollFade:!0,className:`mt-5 h-auto max-h-[min(32rem,55dvh)]`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:a})}),t[5]=a,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(w,{className:`size-3.5`}),t[7]=s):s=t[7];let c;t[8]===r?c=t[9]:(c=(0,$.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,$.jsxs)(b,{autoFocus:!0,onClick:r,children:[`Continue`,s]})}),t[8]=r,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,$.jsxs)(qt,{title:`Connect your agents`,description:`Choose an agent to start coding. You can add more later.`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function St(e){let t=(0,Q.c)(57),{environmentId:n,machineLabel:r}=e,i;t[0]===n?i=t[1]:(i=Y.providersValueAtom(n),t[0]=n,t[1]=i);let a=E(i),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[2]=o):o=t[2];let s=ae(Y.refreshProviders,o),c;t[3]===n?c=t[4]:(c=Y.configValueAtom(n),t[3]=n,t[4]=c);let l=E(c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=ne(n,x),_,v;t[5]!==n||t[6]!==s?(_=()=>{s({environmentId:n,input:{}})},v=[n,s],t[5]=n,t[6]=s,t[7]=_,t[8]=v):(_=t[7],v=t[8]),(0,Z.useEffect)(_,v);let y;t[9]===a?y=t[10]:(y=Ue(a),t[9]=a,t[10]=y);let S=y,C,w,T,D;if(t[11]!==S||t[12]!==g||t[13]!==m||t[14]!==n||t[15]!==r||t[16]!==a||t[17]!==l||t[18]!==u?.driver){let e;t[23]!==S||t[24]!==a?(e=e=>{let t=e===`codex`?a?.filter(t=>t.driver===e):void 0;return t?.length?t.map(t=>({driver:e,provider:t,instanceId:t.instanceId})):[{driver:e,provider:S.get(e),instanceId:S.get(e)?.instanceId}]},t[23]=S,t[24]=a,t[25]=e):e=t[25];let i=bt.flatMap(e);if(m){let e;t[26]===m?e=t[27]:(e=e=>e.instanceId===m.instanceId,t[26]=m,t[27]=e);let n=i.findIndex(e),[r]=n>=0?i.splice(n,1):[];i.unshift(r??{driver:`codex`,provider:void 0,instanceId:m.instanceId})}t[28]===r?D=t[29]:(D=(0,$.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:r}),t[28]=r,t[29]=D),t[30]===g?C=t[31]:(C=g?null:(0,$.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`This connection cannot control terminals.`}),t[30]=g,t[31]=C),w=`space-y-1.5`;let o;t[32]!==g||t[33]!==m||t[34]!==n||t[35]!==l||t[36]!==u?.driver?(o=e=>{let{driver:t,provider:r,instanceId:i}=e;return t===`codex`&&l!==null?(0,$.jsx)(Tt,{environmentId:n,provider:r,serverConfig:l,createdAccount:i===m?.instanceId?m:null,onAutoStartConsumed:()=>h(wt),terminalOpen:u?.driver===t,onOpenTerminal:()=>{r!==void 0&&X(n,`terminal:operate`)&&d({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:l.cwd,command:r.installed?He(r,l.settings,l.environment.platform.os):Ye(t,l.environment.platform.os),keybindings:l.keybindings})}},i??t):(0,$.jsx)(Et,{driver:t,provider:r,terminalOpen:u?.driver===t,terminalAvailable:l!==null&&g,onOpenTerminal:()=>{r!==void 0&&l!==null&&X(n,`terminal:operate`)&&d({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:l.cwd,command:r.installed?He(r,l.settings,l.environment.platform.os):Ye(t,l.environment.platform.os),keybindings:l.keybindings})}},t)},t[32]=g,t[33]=m,t[34]=n,t[35]=l,t[36]=u?.driver,t[37]=o):o=t[37],T=i.map(o),t[11]=S,t[12]=g,t[13]=m,t[14]=n,t[15]=r,t[16]=a,t[17]=l,t[18]=u?.driver,t[19]=C,t[20]=w,t[21]=T,t[22]=D}else C=t[19],w=t[20],T=t[21],D=t[22];let O;t[38]!==w||t[39]!==T?(O=(0,$.jsx)(`div`,{className:w,children:T}),t[38]=w,t[39]=T,t[40]=O):O=t[40];let k;t[41]===a?k=t[42]:(k=a?.some(Ct)?(0,$.jsx)(`div`,{className:`mt-3`,children:(0,$.jsx)(b,{size:`xs`,variant:`ghost-muted`,onClick:()=>p(!0),children:`Connect another ChatGPT account`})}):null,t[41]=a,t[42]=k);let A;t[43]!==f||t[44]!==n?(A=f?(0,$.jsx)(Ke,{environmentId:n,onClose:()=>p(!1),onAccountCreated:(e,t)=>h({instanceId:e,displayName:t,autoStart:!0})}):null,t[43]=f,t[44]=n,t[45]=A):A=t[45];let j;t[46]!==n||t[47]!==s||t[48]!==u?(j=u===null?null:(0,$.jsx)(Dt,{session:u,onClose:()=>{d(null),s({environmentId:n,input:{}})}},`${u.environmentId}:${u.providerInstanceId}:${u.driver}`),t[46]=n,t[47]=s,t[48]=u,t[49]=j):j=t[49];let M;return t[50]!==C||t[51]!==O||t[52]!==k||t[53]!==A||t[54]!==j||t[55]!==D?(M=(0,$.jsxs)(`section`,{children:[D,C,O,k,A,j]}),t[50]=C,t[51]=O,t[52]=k,t[53]=A,t[54]=j,t[55]=D,t[56]=M):M=t[56],M}function Ct(e){return e.driver===`codex`&&Ge(e)===`ready`}function wt(e){return e?{...e,autoStart:!1}:null}function Tt(e){let t=(0,Q.c)(28),{createdAccount:n,onAutoStartConsumed:r,environmentId:i,provider:a,serverConfig:s,terminalOpen:c,onOpenTerminal:l}=e,u=ne(i,x),d=ae(Y.updateSettings,`Codex setup settings`),f;t[0]!==n?.instanceId||t[1]!==a?.instanceId?(f=n?.instanceId??a?.instanceId??m(o.make(`codex`)),t[0]=n?.instanceId,t[1]=a?.instanceId,t[2]=f):f=t[2];let p=f,h=s.settings,g;t[3]!==n||t[4]!==p||t[5]!==h.providerInstances?(g=h.providerInstances[p]??{driver:o.make(`codex`),config:n?{enabled:!0,setupMode:`managed`}:{}},t[3]=n,t[4]=p,t[5]=h.providerInstances,t[6]=g):g=t[6];let _=g,v;t[7]===_.config?v=t[8]:(v=Je(_.config),t[7]=_.config,t[8]=v);let y=v,b=y===`existing`&&_.config!==null&&typeof _.config==`object`&&`setupMode`in _.config&&_.config.setupMode===`existing`,S;t[9]!==i||t[10]!==_||t[11]!==p||t[12]!==h||t[13]!==d?(S=e=>{d({environmentId:i,input:{patch:Ve({settings:h,instanceId:p,instance:{..._,enabled:!0,config:{..._.config!==null&&typeof _.config==`object`?_.config:{},enabled:!0,setupMode:e}}})}})},t[9]=i,t[10]=_,t[11]=p,t[12]=h,t[13]=d,t[14]=S):S=t[14];let C=S,w;return t[15]!==u||t[16]!==C||t[17]!==n?.autoStart||t[18]!==n?.displayName||t[19]!==i||t[20]!==b||t[21]!==p||t[22]!==y||t[23]!==r||t[24]!==l||t[25]!==a||t[26]!==c?(w=b?(0,$.jsx)(Et,{driver:`codex`,provider:a,terminalOpen:c,terminalAvailable:u,onOpenTerminal:l}):(0,$.jsx)(We,{presentation:`onboarding`,autoStart:n?.autoStart===!0,displayName:n?.displayName,onAutoStartConsumed:r,environmentId:i,instanceId:p,provider:a,mode:y,enabled:a?.enabled??!0,onModeChange:C}),t[15]=u,t[16]=C,t[17]=n?.autoStart,t[18]=n?.displayName,t[19]=i,t[20]=b,t[21]=p,t[22]=y,t[23]=r,t[24]=l,t[25]=a,t[26]=c,t[27]=w):w=t[27],w}function Et(e){let t=(0,Q.c)(29),{driver:n,provider:r,terminalOpen:i,terminalAvailable:s,onOpenTerminal:c}=e,l;t[0]===n?l=t[1]:(l=Se.get(o.make(n)),t[0]=n,t[1]=l);let u=l,d=r?.displayName||(n===`claudeAgent`?`Claude Code`:u?.label??n),p;t[2]===r?p=t[3]:(p=qe(r),t[2]=r,t[3]=p);let m=p,h;t[4]===r?h=t[5]:(h=Ge(r),t[4]=r,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=o.make(n),t[6]=n,t[7]=_);let v;t[8]!==d||t[9]!==_?(v=(0,$.jsx)(Ce,{driverKind:_,displayName:d,iconClassName:`size-5`}),t[8]=d,t[9]=_,t[10]=v):v=t[10];let y;t[11]===d?y=t[12]:(y=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:d}),t[11]=d,t[12]=y);let x=g===`ready`?`Ready to code.`:m.headline,S=g!==`ready`&&m.detail?` · ${m.detail}`:``,C;t[13]!==x||t[14]!==S?(C=(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground`,children:[x,S]}),t[13]=x,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==y||t[17]!==C?(w=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[y,C]}),t[16]=y,t[17]=C,t[18]=w):w=t[18];let T;t[19]!==c||t[20]!==g||t[21]!==m||t[22]!==s||t[23]!==i?(T=(0,$.jsx)(`div`,{className:`shrink-0`,children:g===`ready`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,$.jsx)(a,{className:`size-3.5`}),`Ready`]}):g===`checking`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):g===`disabled`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Disabled`}):g===`attention`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m.headline}):(0,$.jsxs)(b,{size:`xs`,variant:`ghost`,onClick:c,disabled:i||!s,children:[(0,$.jsx)(f,{className:`size-3.5`}),g===`signIn`?`Sign in`:`Install`]})}),t[19]=c,t[20]=g,t[21]=m,t[22]=s,t[23]=i,t[24]=T):T=t[24];let E;return t[25]!==w||t[26]!==T||t[27]!==v?(E=(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-4`,children:[v,w,T]}),t[25]=w,t[26]=T,t[27]=v,t[28]=E):E=t[28],E}function Dt(e){let t=(0,Q.c)(60),{session:n,onClose:r}=e,{command:i,cwd:a,driver:o,environmentId:s,keybindings:l,providerInstanceId:u}=n,d=ne(s,x),[f]=c(ke,!1,y),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={reportFailure:!1},t[0]=p):p=t[0];let m=ae(ve.open,p),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h={reportFailure:!1},t[1]=h):h=t[1];let g=ae(ve.write,h),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={reportFailure:!1},t[2]=_):_=t[2];let v=ae(ve.close,_),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=Promise.resolve(),t[3]=S):S=t[3];let w=(0,Z.useRef)(S),E=(0,Z.useRef)(0),D=(0,Z.useRef)(null),O;t[4]===o?O=t[5]:(O=()=>`onboarding-${o}-${C()}`,t[4]=o,t[5]=O);let[k]=(0,Z.useState)(O),A;t[6]===s?A=t[7]:(A=T(s,dt),t[6]=s,t[7]=A);let j=A,[M,N]=(0,Z.useState)(0),[P,F]=(0,Z.useState)(`preparing`),I=P===`ready`||P===`writeFailed`,L;t[8]!==v||t[9]!==i||t[10]!==a||t[11]!==s||t[12]!==m||t[13]!==u||t[14]!==k||t[15]!==g?(L=()=>{let e=E.current+1;return E.current=e,D.current=e,F(`preparing`),w.current=w.current.then(async()=>{if(D.current!==e)return;if(!X(s,`terminal:operate`)){F(`openFailed`);return}if((await m({environmentId:s,input:{threadId:dt,terminalId:k,cwd:a,providerInstanceId:u}}))._tag!==`Success`){D.current===e&&F(`openFailed`);return}if(D.current!==e)return;if(!X(s,`terminal:operate`)){F(`writeFailed`);return}let t=await g({environmentId:s,input:{threadId:dt,terminalId:k,data:i}});D.current===e&&F(t._tag===`Success`?`ready`:`writeFailed`)}),()=>{D.current===e&&(D.current=null),w.current=w.current.then(async()=>{X(s,`terminal:operate`)&&await v({environmentId:s,input:{threadId:dt,terminalId:k,deleteHistory:!0}})})}},t[8]=v,t[9]=i,t[10]=a,t[11]=s,t[12]=m,t[13]=u,t[14]=k,t[15]=g,t[16]=L):L=t[16];let R;t[17]!==v||t[18]!==i||t[19]!==a||t[20]!==s||t[21]!==m||t[22]!==u||t[23]!==M||t[24]!==k||t[25]!==g?(R=[v,i,a,s,m,u,M,k,g],t[17]=v,t[18]=i,t[19]=a,t[20]=s,t[21]=m,t[22]=u,t[23]=M,t[24]=k,t[25]=g,t[26]=R):R=t[26],(0,Z.useEffect)(L,R);let z;t[27]!==d||t[28]!==i||t[29]!==P?(z=d?P===`writeFailed`?(0,$.jsxs)($.Fragment,{children:[`Run `,(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:i}),` in this terminal.`]}):P===`ready`?`Review the command, then press Enter to run it.`:P===`openFailed`?`Could not open the setup terminal.`:`Preparing command...`:`This connection cannot control terminals.`,t[27]=d,t[28]=i,t[29]=P,t[30]=z):z=t[30];let B;t[31]===z?B=t[32]:(B=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:z}),t[31]=z,t[32]=B);let V;t[33]!==d||t[34]!==s||t[35]!==P?(V=P===`openFailed`?(0,$.jsx)(b,{size:`xs`,variant:`ghost`,disabled:!d,onClick:()=>{X(s,`terminal:operate`)&&N(Ot)},children:`Retry`}):null,t[33]=d,t[34]=s,t[35]=P,t[36]=V):V=t[36];let H;t[37]===r?H=t[38]:(H=(0,$.jsx)(b,{size:`xs`,variant:`ghost-muted`,onClick:r,children:`Close`}),t[37]=r,t[38]=H);let U;t[39]!==V||t[40]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[V,H]}),t[39]=V,t[40]=H,t[41]=U):U=t[41];let W;t[42]!==B||t[43]!==U?(W=(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/60 bg-background/60 px-3 py-1.5`,children:[B,U]}),t[42]=B,t[43]=U,t[44]=W):W=t[44];let G;t[45]!==f||t[46]!==a||t[47]!==o||t[48]!==l||t[49]!==r||t[50]!==u||t[51]!==k||t[52]!==I||t[53]!==j?(G=I?(0,$.jsx)(_e,{threadRef:j,threadId:dt,terminalId:k,terminalLabel:`Install ${o}`,cwd:a,providerInstanceId:u,advancedTypography:f,onSessionExited:r,focusRequestId:1,autoFocus:!0,visible:!0,resizeEpoch:0,drawerHeight:256,keybindings:l}):null,t[45]=f,t[46]=a,t[47]=o,t[48]=l,t[49]=r,t[50]=u,t[51]=k,t[52]=I,t[53]=j,t[54]=G):G=t[54];let ee;t[55]===G?ee=t[56]:(ee=(0,$.jsx)(`div`,{className:`h-64`,children:G}),t[55]=G,t[56]=ee);let K;return t[57]!==W||t[58]!==ee?(K=(0,$.jsxs)(`div`,{"data-thread-terminal-drawer":!0,className:`mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground`,children:[W,ee]}),t[57]=W,t[58]=ee,t[59]=K):K=t[59],K}function Ot(e){return e+1}var kt=`This connection cannot import projects or thread history.`;function At(e){let t=(0,Q.c)(75),{scans:n,isImporting:r,setIsImporting:i,onDone:a}=e,{environments:o}=te(),c=re(n,A),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[0]=l):l=t[0];let u=ae(H.create,l),d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d={reportFailure:!1},t[1]=d):d=t[1];let f=ae(ot,d),[p,m]=(0,Z.useState)(null),h=(0,Z.useRef)(``),g=(0,Z.useRef)(0),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Map,t[2]=_):_=t[2];let v=(0,Z.useRef)(_),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[3]=y):y=t[3];let x=(0,Z.useRef)(y),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[4]=S):S=t[4];let C=(0,Z.useRef)(S),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Map,t[5]=w):w=t[5];let T=(0,Z.useRef)(w),E=(0,Z.useRef)(0),O,k;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>(E.current+=1,()=>{E.current+=1}),k=[],t[6]=O,t[7]=k):(O=t[6],k=t[7]),(0,Z.useEffect)(O,k);let j;t[8]===n?j=t[9]:(j=Qe(n.flatMap(Rt)),t[8]=n,t[9]=j);let{available:N,recent:P}=j,F;t[10]!==P||t[11]!==p?(F=p??new Set(P.map(Lt)),t[10]=P,t[11]=p,t[12]=F):F=t[12];let I=F,R,z;if(t[13]!==N||t[14]!==I||t[15]!==c){let e;t[18]===I?e=t[19]:(e=e=>I.has(e.key),t[18]=I,t[19]=e),R=N.filter(e);let n;t[20]===c?n=t[21]:(n=e=>c.has(e.environmentId),t[20]=c,t[21]=n),z=R.every(n),t[13]=N,t[14]=I,t[15]=c,t[16]=R,t[17]=z}else R=t[16],z=t[17];let V=z,[W,ee]=(0,Z.useState)(``),K=V?W===kt?``:W:kt,q;t[22]!==a||t[23]!==i?(q=()=>{let e=nt(C.current,x.current,v.current);if(e===void 0){a(void 0,h.current,g.current);return}i(!0);let t=E.current;B(e).then(()=>e,It).then(async e=>{t===E.current&&(await a(e,h.current,g.current)||i(!1))})},t[22]=a,t[23]=i,t[24]=q):q=t[24];let J=q,Y;t[25]!==u||t[26]!==J||t[27]!==f||t[28]!==r||t[29]!==a||t[30]!==n||t[31]!==i?(Y=async e=>{if(r)return;let t=()=>e.every(Ft),o=()=>{i(!1),ee(kt)};if(!t()){o();return}if(e.length===0){a();return}i(!0),h.current=``,g.current=0,C.current=e.map(Pt);let c=E.current,l=v.current,d=T.current,p=l.size>0?e.filter(e=>l.has(e.key)).length:0,m=0,_=0,y=new Set;for(let n of e){let{environmentId:e}=n;if(c!==E.current||l!==v.current)return;if(!t()){o();return}if(l.has(n.key))continue;let r=tt(U(),e,n);if(r===null){let t=d.get(n.key);if(t===void 0){let e=D();t={projectId:e,commandId:s.make(`onboarding:project:create:${e}`)},d.set(n.key,t)}r=t.projectId;let i=await u({environmentId:e,input:{projectId:r,commandId:t.commandId,title:n.title,workspaceRoot:n.path,createWorkspaceRootIfMissing:!1,defaultModelSelection:null}});if(c!==E.current||l!==v.current)return;if(i._tag!==`Success`){L(i)||(d.delete(n.key),y.add(e));continue}}if(!t()){o();return}let i=await f({environmentId:e,input:{projectId:r,expectedWorkspaceRoot:n.path}});if(c!==E.current||l!==v.current)return;i._tag===`Success`?(m+=i.value.importedCount,_+=i.value.skippedCount,i.value.importedCount>0&&x.current.set(n.key,M(e,r)),i.value.skippedCount===0&&(p+=1,l.set(n.key,M(e,r)))):L(i)||(d.delete(n.key),y.add(e))}for(let e of n)y.has(e.environmentId)&&e.refresh();i(!1),g.current=m,p<e.length&&(m>0&&_>0?h.current=`Imported ${m} ${m===1?`thread`:`threads`}. ${_} ${_===1?`thread`:`threads`} could not be imported.`:_>0?h.current=`${_} ${_===1?`thread could`:`threads could`} not be imported.`:m>0?h.current=`Imported ${m} ${m===1?`thread`:`threads`}. Some thread history could not be imported.`:h.current=`Could not import thread history.`),J()},t[25]=u,t[26]=J,t[27]=f,t[28]=r,t[29]=a,t[30]=n,t[31]=i,t[32]=Y):Y=t[32];let ne=Y;if(n.every(Nt)&&n.some(Mt)){let e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Your projects`}),t[33]=e):e=t[33];let n;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6`,children:[(0,$.jsx)(G,{size:`lg`,tone:`muted`}),(0,$.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`Looking for projects from Claude Code and Codex…`})]}),t[34]=n):n=t[34];let r;return t[35]===a?r=t[36]:(r=(0,$.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col`,children:[e,n,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(b,{variant:`ghost-muted`,onClick:()=>void a(),children:`Do not import projects`})})]}),t[35]=a,t[36]=r),r}let X;t[37]!==N||t[38]!==r||t[39]!==R?(X=N.length>0?(0,$.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{role:`status`,children:[R.length,` of `,N.length,` selected`]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(b,{variant:`ghost`,size:`xs`,disabled:r||R.length===N.length,onClick:()=>m(new Set(N.map(jt))),children:`Select all`}),(0,$.jsx)(b,{variant:`ghost`,size:`xs`,disabled:r||R.length===0,onClick:()=>m(new Set),children:`Select none`})]})]}):null,t[37]=N,t[38]=r,t[39]=R,t[40]=X):X=t[40];let ie;if(t[41]!==N||t[42]!==o||t[43]!==r||t[44]!==n||t[45]!==I){let e;t[47]!==N||t[48]!==o||t[49]!==r||t[50]!==n.length||t[51]!==I?(e=e=>{let t=N.filter(t=>t.environmentId===e.environmentId),i=o.find(t=>t.environmentId===e.environmentId)?.label??`Computer`;return(0,$.jsxs)(`fieldset`,{className:`min-w-0 space-y-0.5`,disabled:r,children:[n.length>1?(0,$.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:i}):null,e.isPending&&e.data===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(G,{size:`md`}),`Looking for projects…`]}):e.error===null?t.length===0?(0,$.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No existing Claude Code or Codex projects found.`}):null:(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 text-sm text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Could not check projects. `,e.error]}),(0,$.jsx)(b,{variant:`ghost`,size:`sm`,onClick:e.refresh,children:`Retry`})]}),e.data?.truncated?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:pt}):null,(0,$.jsx)(zt,{candidates:t,selectedKeys:I,onSelectionChange:m})]},e.environmentId)},t[47]=N,t[48]=o,t[49]=r,t[50]=n.length,t[51]=I,t[52]=e):e=t[52],ie=n.map(e),t[41]=N,t[42]=o,t[43]=r,t[44]=n,t[45]=I,t[46]=ie}else ie=t[46];let oe;t[53]===ie?oe=t[54]:(oe=(0,$.jsx)(de,{scrollFade:!0,className:`mt-2 h-auto max-h-80`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:ie})}),t[53]=ie,t[54]=oe);let se;t[55]===K?se=t[56]:(se=K?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:K}):null,t[55]=K,t[56]=se);let ce;t[57]!==J||t[58]!==r?(ce=(0,$.jsx)(b,{variant:`ghost-muted`,disabled:r,onClick:J,children:`Do not import projects`}),t[57]=J,t[58]=r,t[59]=ce):ce=t[59];let le=!V||r||R.length===0,ue;t[60]!==ne||t[61]!==R?(ue=()=>void ne(R),t[60]=ne,t[61]=R,t[62]=ue):ue=t[62];let fe=r?`Importing…`:`Import ${R.length} ${R.length===1?`project`:`projects`}`,pe;t[63]!==le||t[64]!==ue||t[65]!==fe?(pe=(0,$.jsx)(b,{autoFocus:!0,disabled:le,onClick:ue,children:fe}),t[63]=le,t[64]=ue,t[65]=fe,t[66]=pe):pe=t[66];let me;t[67]!==ce||t[68]!==pe?(me=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-end gap-3`,children:[ce,pe]}),t[67]=ce,t[68]=pe,t[69]=me):me=t[69];let he;return t[70]!==X||t[71]!==oe||t[72]!==se||t[73]!==me?(he=(0,$.jsxs)(qt,{title:`Import your projects`,description:`Import projects and conversations from Claude Code and Codex on your selected computers.`,children:[X,oe,se,me]}),t[70]=X,t[71]=oe,t[72]=se,t[73]=me,t[74]=he):he=t[74],he}function jt(e){return e.key}function Mt(e){return e.isPending}function Nt(e){return e.data===null}function Pt(e){return e.key}function Ft(e){return X(e.environmentId,A)}function It(){}function Lt(e){return e.key}function Rt(e){return(e.data?.candidates??[]).map(t=>({...t,environmentId:e.environmentId,key:it(e.environmentId,t.path)}))}function zt(e){let t=(0,Q.c)(25),{candidates:n,selectedKeys:r,onSelectionChange:i}=e,a;t[0]===n?a=t[1]:(a=et(n),t[0]=n,t[1]=a);let{repositories:o,other:s}=a,c;t[2]!==i||t[3]!==r?(c=(e,t)=>{let n=new Set(r);for(let r of e)t?n.add(r):n.delete(r);i(n)},t[2]=i,t[3]=r,t[4]=c):c=t[4];let l=c,u;if(t[5]!==s||t[6]!==r){let e;t[8]===r?e=t[9]:(e=e=>r.has(e.key),t[8]=r,t[9]=e),u=s.filter(e),t[5]=s,t[6]=r,t[7]=u}else u=t[7];let f=u.length,p;if(t[10]!==o||t[11]!==r||t[12]!==l){let e;t[14]!==r||t[15]!==l?(e=e=>(0,$.jsx)(Vt,{group:e,selectedKeys:r,onToggle:l},e.key),t[14]=r,t[15]=l,t[16]=e):e=t[16],p=o.map(e),t[10]=o,t[11]=r,t[12]=l,t[13]=p}else p=t[13];let m;t[17]!==s||t[18]!==f||t[19]!==r||t[20]!==l?(m=s.length>0?(0,$.jsxs)(Ie,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[(0,$.jsx)(ge,{checked:f===s.length,indeterminate:f>0&&f<s.length,onCheckedChange:e=>l(s.map(Bt),e===!0)}),(0,$.jsxs)(Me,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,$.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),(0,$.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:`Other folders`}),(0,$.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[s.length,` `,s.length===1?`folder`:`folders`]})]})]}),(0,$.jsx)(Pe,{children:s.map(e=>(0,$.jsx)(Gt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>l([e.key],t)},e.key))})]}):null,t[17]=s,t[18]=f,t[19]=r,t[20]=l,t[21]=m):m=t[21];let h;return t[22]!==p||t[23]!==m?(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function Bt(e){return e.key}function Vt(e){let t=(0,Q.c)(53),{group:n,selectedKeys:r,onToggle:i}=e,a,o;if(t[0]!==n.candidates||t[1]!==r){a=n.candidates.map(Ut);let e;t[4]===r?e=t[5]:(e=e=>r.has(e),t[4]=r,t[5]=e),o=a.filter(e),t[0]=n.candidates,t[1]=r,t[2]=a,t[3]=o}else a=t[2],o=t[3];let s=o.length,c=n.candidates.length===1,l=n.candidates[0];if(c&&l!==void 0){let e=n.label,a=l.path,o;t[6]!==l.key||t[7]!==r?(o=r.has(l.key),t[6]=l.key,t[7]=r,t[8]=o):o=t[8];let s;t[9]!==i||t[10]!==l.key?(s=e=>i([l.key],e),t[9]=i,t[10]=l.key,t[11]=s):s=t[11];let c;return t[12]!==n.label||t[13]!==l||t[14]!==o||t[15]!==s?(c=(0,$.jsx)(Gt,{candidate:l,label:e,path:a,checked:o,onCheckedChange:s}),t[12]=n.label,t[13]=l,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}let u=s===a.length,f=s>0&&s<a.length,p;t[17]!==a||t[18]!==i?(p=e=>i(a,e===!0),t[17]=a,t[18]=i,t[19]=p):p=t[19];let m;t[20]!==u||t[21]!==f||t[22]!==p?(m=(0,$.jsx)(ge,{checked:u,indeterminate:f,onCheckedChange:p}),t[20]=u,t[21]=f,t[22]=p,t[23]=m):m=t[23];let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),t[24]=h):h=t[24];let g;t[25]===n.label?g=t[26]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.label}),t[25]=n.label,t[26]=g);let _;t[27]===n.candidates?_=t[28]:(_=new Set(n.candidates.flatMap(Ht)),t[27]=n.candidates,t[28]=_);let v;t[29]===_?v=t[30]:(v=[..._],t[29]=_,t[30]=v);let y;t[31]!==n.lastActiveAt||t[32]!==n.threadCount||t[33]!==v?(y=(0,$.jsx)(Kt,{sources:v,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[31]=n.lastActiveAt,t[32]=n.threadCount,t[33]=v,t[34]=y):y=t[34];let b;t[35]!==y||t[36]!==g?(b=(0,$.jsxs)(Me,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[h,g,y]}),t[35]=y,t[36]=g,t[37]=b):b=t[37];let x;t[38]!==b||t[39]!==m?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[m,b]}),t[38]=b,t[39]=m,t[40]=x):x=t[40];let S;if(t[41]!==n.candidates||t[42]!==i||t[43]!==r){let e;t[45]!==i||t[46]!==r?(e=e=>(0,$.jsx)(Gt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>i([e.key],t)},e.key),t[45]=i,t[46]=r,t[47]=e):e=t[47],S=n.candidates.map(e),t[41]=n.candidates,t[42]=i,t[43]=r,t[44]=S}else S=t[44];let C;t[48]===S?C=t[49]:(C=(0,$.jsx)(Pe,{children:S}),t[48]=S,t[49]=C);let w;return t[50]!==x||t[51]!==C?(w=(0,$.jsxs)(Ie,{defaultOpen:!0,children:[x,C]}),t[50]=x,t[51]=C,t[52]=w):w=t[52],w}function Ht(e){return e.sources}function Ut(e){return e.key}function Wt(e){let t=(0,Q.c)(12),{path:n,className:r}=e,i;t[0]===n?i=t[1]:(i=rt(n),t[0]=n,t[1]=i);let{name:a,parent:o}=i,s;t[2]===r?s=t[3]:(s=j(`flex min-w-0 items-baseline font-mono`,r),t[2]=r,t[3]=s);let c;t[4]===o?c=t[5]:(c=o.length>0?(0,$.jsx)(`span`,{className:`truncate`,children:o}):null,t[4]=o,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,$.jsx)(`span`,{className:`max-w-full shrink-0 truncate`,children:a}),t[6]=a,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Gt(e){let t=(0,Q.c)(30),{candidate:n,label:r,path:i,nested:a,checked:o,onCheckedChange:s}=e,c=a!==void 0&&a,l=c&&`pl-8`,u;t[0]===l?u=t[1]:(u=j(`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40 has-disabled:cursor-default`,l),t[0]=l,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e===!0),t[2]=s,t[3]=d);let f;t[4]!==o||t[5]!==d?(f=(0,$.jsx)(ge,{checked:o,onCheckedChange:d}),t[4]=o,t[5]=d,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2 truncate`}),t[7]=p):p=t[7];let m;t[8]===r?m=t[9]:(m=r===void 0?null:(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r}),t[8]=r,t[9]=m);let h;t[10]!==r||t[11]!==i?(h=i===void 0?null:(0,$.jsx)(Wt,{path:i,className:r===void 0?`text-xs`:`text-2xs text-muted-foreground`}),t[10]=r,t[11]=i,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,$.jsxs)(se,{render:p,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===n.path?_=t[17]:(_=(0,$.jsx)(ce,{variant:`code`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==_||t[19]!==g?(v=(0,$.jsxs)(le,{children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let y=c?null:n.sources,b;t[21]!==n.lastActiveAt||t[22]!==n.threadCount||t[23]!==y?(b=(0,$.jsx)(Kt,{sources:y,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[21]=n.lastActiveAt,t[22]=n.threadCount,t[23]=y,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b||t[27]!==u||t[28]!==f?(x=(0,$.jsxs)(`label`,{className:u,children:[f,v,b]}),t[25]=v,t[26]=b,t[27]=u,t[28]=f,t[29]=x):x=t[29],x}function Kt(e){let t=(0,Q.c)(19),{sources:n,threadCount:r,lastActiveAt:i}=e,a;t[0]===i?a=t[1]:(a=i===null?null:oe(i),t[0]=i,t[1]=a);let s=a,c=s===null?``:s.suffix===null?`now`:s.value,l;t[2]===n?l=t[3]:(l=n?.includes(`claudeAgent`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Claude Code`,children:(0,$.jsx)(Ce,{driverKind:o.make(`claudeAgent`),displayName:`Claude Code`,iconClassName:`size-3`})}):null,t[2]=n,t[3]=l);let u;t[4]===l?u=t[5]:(u=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:l}),t[4]=l,t[5]=u);let d;t[6]===n?d=t[7]:(d=n?.includes(`codex`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Codex`,children:(0,$.jsx)(Ce,{driverKind:o.make(`codex`),displayName:`Codex`,iconClassName:`size-3`})}):null,t[6]=n,t[7]=d);let f;t[8]===d?f=t[9]:(f=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:d}),t[8]=d,t[9]=f);let p;t[10]===r?p=t[11]:(p=(0,$.jsx)(`span`,{className:`text-right`,children:r}),t[10]=r,t[11]=p);let m;t[12]===c?m=t[13]:(m=(0,$.jsx)(`span`,{className:`text-right whitespace-nowrap`,children:c}),t[12]=c,t[13]=m);let h;return t[14]!==u||t[15]!==f||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:`ml-auto grid shrink-0 grid-cols-[1rem_1rem_2.5rem_2.25rem] items-center gap-x-1 text-xs text-muted-foreground tabular-nums`,children:[u,f,p,m]}),t[14]=u,t[15]=f,t[16]=p,t[17]=m,t[18]=h):h=t[18],h}function qt(e){let t=(0,Q.c)(8),{title:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)($.Fragment,{children:[a,o,i]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Jt=u(p);function Yt(){let e=(0,Q.c)(14),{authGateState:t}=Ae.useRouteContext(),n=ee(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:Zt},e[0]=r):r=e[0];let i=K(r),a;e[1]===i?a=e[2]:(a=i.startsWith(`agents:`)?_(Jt(i.slice(7))):void 0,e[1]=i,e[2]=a);let o=a,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={select:Xt},e[3]=s):s=e[3];let c=K(s),[l,u]=(0,Z.useState)(!1),d=ye(),f=t.status===`authenticated`,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ze,{}),e[4]=p):p=e[4];let m;e[5]!==l||e[6]!==c||e[7]!==f||e[8]!==n||e[9]!==d||e[10]!==o?(m=c&&!l?(0,$.jsx)(mt,{localAvailable:f,resumeEnvironmentId:o,onDone:async e=>{u(!0),e===void 0?await n({to:`/`,replace:!0}):await d(e,{replace:!0}).catch(()=>n({to:`/`,replace:!0}))}}):null,e[5]=l,e[6]=c,e[7]=f,e[8]=n,e[9]=d,e[10]=o,e[11]=m):m=e[11];let h;return e[12]===m?h=e[13]:(h=(0,$.jsxs)($.Fragment,{children:[p,m]}),e[12]=m,e[13]=h),h}function Xt(e){return e.pathname===`/welcome`}function Zt(e){return e.hash}export{Yt as component};
2
- //# sourceMappingURL=welcome-DqtsIjdN.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bm as i,EE as a,Fb as o,Id as s,Is as c,Mp as l,Ms as u,Xc as d,Xy as f,Y_ as p,Yy as m,Z_ as h,cp as g,cs as _,fr as v,hd as y,l as b,nc as x,nf as S,ns as C,o as w,rb as T,rs as E,sb as D,t as O,tc as k,uv as A,wE as j,yv as M,zd as N}from"./utils-OWUgXvpr.js";import{At as P,M as F,N as I,R as L,W as R,o as z}from"./runtime-CcgzOADx.js";import{N as B,Q as V,W as H,u as U}from"./entities-Ci9sZwRJ.js";import{t as W}from"./runtime-D2NRh41I.js";import{t as G}from"./spinner-C64jtA3m.js";import{t as ee}from"./useNavigate-5WivMyAa.js";import{t as K}from"./useLocation-_8If3LN3.js";import{i as q}from"./toast-BYGaCmZu.js";import{D as J,E as te}from"./useSettings-jZr_DfW0.js";import{f as Y}from"./server-C-cSQN_G.js";import{i as ne,n as X,o as re}from"./session-D6BRf77P.js";import{t as ie}from"./query-DszcgUku.js";import{t as ae}from"./use-atom-command-DEluSG6k.js";import{a as oe}from"./timestampFormat-wac2e_Jz.js";import{a as se,n as ce,t as le}from"./tooltip-BYZIg_IY.js";import{t as ue}from"./input-BGKmQVHf.js";import{t as de}from"./scroll-area-BN4-XX3T.js";import{r as fe}from"./dist-p5OtQFc9.js";import{t as pe}from"./dialog-BEXthTAp.js";import{t as me}from"./useP4ConnectAuthPrompt-D0Equ6mY.js";import{t as he}from"./CommandBlock-DBGDwDRu.js";import{t as ge}from"./checkbox-bsJs8Zu-.js";import{t as _e}from"./ThreadTerminalDrawer-FZ0zyNm1.js";import{i as ve}from"./terminalSessions-Ceajv0BZ.js";import{n as ye}from"./useHandleNewThread-BOej8pJq.js";import{r as be,t as xe}from"./alert-D0u2-4Zh.js";import{i as Se,n as Ce}from"./ChatGptUsageButton-DQjnXjt6.js";import{t as we}from"./onboarding-C7BynXti.js";import{_ as Te,ai as Ee,an as De,do as Oe,eo as ke,f as Ae,fo as je,ho as Me,lo as Ne,mo as Pe,on as Fe,po as Ie,un as Le,uo as Re}from"./main-CRJyb41E.js";import{t as ze}from"./NoProjectsHero-DVJOMY01.js";import{t as Be}from"./legalLinks-C4VP5hPh.js";import{r as Ve}from"./SettingsPanels.logic-B406HX50.js";import{d as He,f as Ue,i as We,l as Ge,n as Ke,o as qe,t as Je,u as Ye}from"./CodexSetupSection.logic-BIpypa3y.js";var Z=e(t(),1),Q=n(),Xe=2592e6,Ze=3;function Qe(e,t=Date.now()){let n=t-Xe;return{available:e,recent:e.filter(e=>{if(e.git===null||e.threadCount<Ze||e.lastActiveAt===null)return!1;let r=Date.parse(e.lastActiveAt);return r>=n&&r<=t})}}function $e(e,t){return e===null?t:t===null||e>t?e:t}function et(e){let t=new Map,n=[];for(let r of e){if(r.git===null){n.push(r);continue}let e=r.git??{remoteKey:null,repository:null},i=e.remoteKey===null?`path:${r.path}`:`remote:${e.remoteKey}`,a=t.get(i);a===void 0?t.set(i,{key:i,label:e.repository??r.title,repository:e.repository,candidates:[r],threadCount:r.threadCount,lastActiveAt:r.lastActiveAt}):(a.candidates.push(r),t.set(i,{...a,threadCount:a.threadCount+r.threadCount,lastActiveAt:$e(a.lastActiveAt,r.lastActiveAt)}))}return{repositories:[...t.values()].sort((e,t)=>e.lastActiveAt===t.lastActiveAt?e.label.localeCompare(t.label):e.lastActiveAt===null?1:t.lastActiveAt===null?-1:t.lastActiveAt.localeCompare(e.lastActiveAt)),other:n}}function tt(e,t,n){if(n.projectId!==void 0)return n.projectId;let r=e.filter(e=>e.environmentId===t),i=V(r,n.path);return i===void 0?null:i.id}function nt(e,t,n){for(let n of e){let e=t.get(n);if(e!==void 0)return e}for(let t of e){let e=n.get(t);if(e!==void 0)return e}}function rt(e){if(/^[A-Za-z]:[\\/]+$/.test(e)||/^[\\/]{2}[^\\/]+[\\/][^\\/]+[\\/]*$/.test(e))return{name:e,parent:``};let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.length===0?{name:e,parent:``}:n<0?{name:t,parent:``}:{name:t.slice(n+1),parent:t.slice(0,n+1)}}function it(e,t){return JSON.stringify([e,t])}var at=I(W,{label:`environment-data:agent-sessions:scan`,tag:d.agentSessionsScan,staleTimeMs:3e4,idleTtlMs:3e5}),ot=F(W,{label:`environment-data:agent-sessions:import`,tag:d.agentSessionsImport});function st(e){return P(e.entry)}function ct(e,t){let n=e.filter(e=>t.has(e.environmentId)),r=e=>n.filter(t=>e(t.connection.phase)).map(e=>e.environmentId),i=r(e=>e===`connected`),a=n.some(e=>e.connection.phase===`connecting`);return{ready:i.length>0&&!a,environmentIds:i,skippedIds:r(e=>e!==`connected`&&e!==`connecting`)}}function lt(e){let t=(0,Q.c)(3),n=(0,Z.useContext)(E),r;return t[0]!==e||t[1]!==n?(r=_(t=>e.map(e=>{let r=at({environmentId:e,input:{}}),i=t(r);return{environmentId:e,data:j(u(i)),error:i._tag===`Failure`?ie(i.cause):null,isPending:i.waiting||i._tag===`Initial`,refresh:()=>n.refresh(r)}})),t[0]=e,t[1]=n,t[2]=r):r=t[2],C(r)}var $=e(r(),1),ut=[],dt=T.make(`onboarding-agent-setup`),ft=[`Connect`,`Agents`,`Projects`],pt=`Scan limit reached. Some projects or conversations may be missing.`;function mt({localAvailable:e,onDone:t,resumeEnvironmentId:n}){let r=Le(),[i,a]=(0,Z.useState)(n?`agents`:`connection`),{environments:o}=te(),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(new Set),[u,d]=(0,Z.useState)(n?[n]:[]),[f,p]=(0,Z.useState)(!1),m=(0,Z.useRef)(null),h=(0,Z.useRef)(null),g=J();(0,Z.useEffect)(()=>{let e=o.filter(e=>!l.current.has(e.environmentId));if(e.length===0)return;for(let t of e)l.current.add(t.environmentId);let t=e.filter(e=>e.entry.enabled);t.length!==0&&c(e=>new Set([...e??[],...t.map(e=>e.environmentId)]))},[o]);let _=s??new Set(g?[g.environmentId]:[]),v=lt(i===`import`?u:ut),y=i===`import`&&v.every(e=>e.data===null)&&v.some(e=>e.isPending),b=e=>{e.length!==0&&(d(e),a(`agents`))},x=i===`agents`?1:i===`import`?2:0,S=(0,Z.useCallback)((e,n,i=0)=>{if(m.current!==null)return m.current;h.current!==null&&(q.close(h.current),h.current=null);let a=r().then(async()=>(h.current!==null&&(q.close(h.current),h.current=null),await t(e),n?q.add({type:`warning`,title:`Some history was not imported`,description:n,timeout:0}):i>0&&q.add({type:`success`,title:`Imported ${i} ${i===1?`thread`:`threads`}`}),!0)).catch(()=>{let e={type:`error`,title:`Could not finish setup`,description:`Your settings could not be saved. Try again.`};return h.current===null?h.current=q.add(e):q.update(h.current,e),!1}).finally(()=>{m.current===a&&(m.current=null)});return m.current=a,a},[r,t]);return(0,$.jsxs)(pe,{open:!0,disablePointerDismissal:!0,onOpenChange:(e,t)=>t.cancel(),children:[(0,$.jsxs)(Oe,{size:`wide`,bottomStickOnMobile:!1,showCloseButton:!1,initialFocus:()=>document.getElementById(`onboarding-pairing-url`)??!0,children:[(0,$.jsx)(Ne,{title:`Set up P4 Code`,identity:(0,$.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,role:`img`,"aria-label":`P4 Code`,children:[(0,$.jsx)(Ee,{className:`h-4 w-auto shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-2xl font-medium tracking-tight text-muted-foreground`,children:`Code`})]}),children:(0,$.jsx)(je,{steps:ft,currentStep:x,isStepDisabled:e=>f||e>=x,onStepChange:e=>{f||e>x||a(e===0?`connection`:`agents`)}})}),(0,$.jsx)(Re,{holdHeight:y,children:i===`connection`?(0,$.jsx)(ht,{expandPairingInitially:!e&&!z(),selectedIds:_,autoSelectedComputers:l.current,onSelectionChange:c,onToggleEnvironment:(e,t)=>c(n=>{let r=new Set(n??_);return t?r.add(e):r.delete(e),r}),onContinue:()=>b(ct(o,_).environmentIds),onPaired:e=>{c(new Set([..._,e]))}}):i===`agents`?(0,$.jsx)(xt,{environmentIds:u,onContinue:()=>a(`import`)}):(0,$.jsx)(At,{scans:v,isImporting:f,setIsImporting:p,onDone:S})})]}),(0,$.jsx)(Te,{})]})}function ht(e){let t=(0,Q.c)(44),{autoSelectedComputers:n,expandPairingInitially:r,selectedIds:i,onSelectionChange:a,onToggleEnvironment:o,onContinue:s,onPaired:c}=e,{environments:u}=te(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=z(),t[0]=d):d=t[0];let f=d,p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>!f||!st(e),t[1]=p):p=t[1];let m=u.filter(p),[h,_]=(0,Z.useState)(r),[b,x]=(0,Z.useState)(!1),{ready:S,skippedIds:C}=ct(u,i),w=u.filter(e=>C.includes(e.environmentId)).map(gt),T=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{S&&(document.activeElement===document.body||document.activeElement?.getAttribute(`role`)===`dialog`)&&T.current?.focus()},[S]);let E,D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Connect your computers`}),D=(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:`Choose one or more computers. We’ll set up agents and projects on each.`}),t[2]=E,t[3]=D):(E=t[2],D=t[3]);let k=m.length>0?(0,$.jsxs)(`fieldset`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:`Computers to set up`}),m.map(e=>(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border border-border bg-background px-3 py-3`,children:[(0,$.jsx)(ge,{checked:i.has(e.environmentId),onCheckedChange:t=>{let n=new Set(i);t?n.add(e.environmentId):n.delete(e.environmentId),a(n)}}),(0,$.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex items-baseline justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium break-words`,children:e.label}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:!e.entry.enabled&&e.connection.phase!==`unsupported`?`Off`:Fe(e.connection).buttonLabel})]}),e.displayUrl?(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs break-all text-muted-foreground`,children:e.displayUrl}):null]})]},e.environmentId))]}):null,A;t[4]!==n||t[5]!==b||t[6]!==o||t[7]!==i?(A=f?(0,$.jsx)(_t,{autoSelectedComputers:n,disabled:b,selectedIds:i,onToggleEnvironment:o}):null,t[4]=n,t[5]=b,t[6]=o,t[7]=i,t[8]=A):A=t[8];let j,M,P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(v,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),M=(0,$.jsx)(g,{className:`size-4 text-muted-foreground`}),P=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`Add a computer`}),t[9]=j,t[10]=M,t[11]=P):(j=t[9],M=t[10],P=t[11]);let F=h&&`rotate-90`,I;t[12]===F?I=t[13]:(I=O(`size-4 text-muted-foreground`,F),t[12]=F,t[13]=I);let L;t[14]===I?L=t[15]:(L=(0,$.jsx)(N,{className:I}),t[14]=I,t[15]=L);let R;t[16]!==b||t[17]!==L?(R=(0,$.jsxs)(Me,{disabled:b,render:j,children:[M,P,L]}),t[16]=b,t[17]=L,t[18]=R):R=t[18];let B;t[19]===c?B=t[20]:(B=e=>{_(!1),c(e),requestAnimationFrame(()=>T.current?.focus())},t[19]=c,t[20]=B);let V;t[21]!==b||t[22]!==B?(V=(0,$.jsx)(Pe,{children:(0,$.jsx)(`div`,{className:`px-3 pb-3`,children:(0,$.jsx)(vt,{isPairing:b,setIsPairing:x,onPaired:B})})}),t[21]=b,t[22]=B,t[23]=V):V=t[23];let H;t[24]!==h||t[25]!==R||t[26]!==V?(H=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Ie,{open:h,onOpenChange:_,children:[R,V]})}),t[24]=h,t[25]=R,t[26]=V,t[27]=H):H=t[27];let U;t[28]!==H||t[29]!==A?(U=(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[A,H]}),t[28]=H,t[29]=A,t[30]=U):U=t[30];let W=w.length>0?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:[`Not connected, so setup skips `,w.join(`, `),`. You can set`,` `,w.length===1?`it`:`them`,` up later from Settings.`]}):null,G;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsxs)(`p`,{className:`min-w-0 text-xs leading-relaxed text-muted-foreground`,children:[`P4 Code collects anonymous usage data to help us improve it. To read more about how your data is used and how to opt out, see our`,` `,(0,$.jsx)(`a`,{className:`underline underline-offset-2 hover:text-foreground`,href:Be,target:`_blank`,rel:`noreferrer noopener`,children:`privacy policy`}),`.`]}),t[31]=G):G=t[31];let ee=!r,K=!S||b,q;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(y,{className:`size-3.5`}),t[32]=q):q=t[32];let J;t[33]!==s||t[34]!==ee||t[35]!==K?(J=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[G,(0,$.jsxs)(v,{className:`shrink-0 self-end`,ref:T,autoFocus:ee,disabled:K,onClick:s,children:[`Continue`,q]})]}),t[33]=s,t[34]=ee,t[35]=K,t[36]=J):J=t[36];let Y;return t[37]!==U||t[38]!==W||t[39]!==J||t[40]!==E||t[41]!==D||t[42]!==k?(Y=(0,$.jsxs)($.Fragment,{children:[E,D,k,U,W,J]}),t[37]=U,t[38]=W,t[39]=J,t[40]=E,t[41]=D,t[42]=k,t[43]=Y):Y=t[43],Y}function gt(e){return e.label}function _t(e){let t=(0,Q.c)(36),{autoSelectedComputers:n,disabled:r,selectedIds:i,onToggleEnvironment:a}=e,{environments:o}=te(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={treatPendingAsSignedOut:!1},t[0]=s):s=t[0];let{isLoaded:c,isSignedIn:l}=fe(s),{openAuthPrompt:u}=me(),[d,f]=(0,Z.useState)(!0),[p,m]=(0,Z.useState)(!1),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>m(!0),t[1]=h):h=t[1];let g=h,_=d&&!!l&&p,y=r||!c,b;t[2]!==l||t[3]!==u?(b=e=>{l||(e.preventDefault(),f(!0),u())},t[2]=l,t[3]=u,t[4]=b):b=t[4];let x,C,w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(v,{variant:`ghost`,size:`sm-multiline`,className:`min-h-14 w-full justify-start`}),C=(0,$.jsx)(S,{className:`size-4 text-muted-foreground`}),w=(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:`P4 Connect`}),t[5]=x,t[6]=C,t[7]=w):(x=t[5],C=t[6],w=t[7]);let T=c?l?p?null:`Loading computers…`:`Sign in`:`Loading sign-in…`,E;t[8]===T?E=t[9]:(E=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:T}),t[8]=T,t[9]=E);let D=d&&l&&`rotate-90`,k;t[10]===D?k=t[11]:(k=O(`size-4 text-muted-foreground`,D),t[10]=D,t[11]=k);let A;t[12]===k?A=t[13]:(A=(0,$.jsx)(N,{className:k}),t[12]=k,t[13]=A);let j;t[14]!==E||t[15]!==A||t[16]!==y||t[17]!==b?(j=(0,$.jsxs)(Me,{disabled:y,onClick:b,render:x,children:[C,w,E,A]}),t[14]=E,t[15]=A,t[16]=y,t[17]=b,t[18]=j):j=t[18];let M;t[19]!==n||t[20]!==o||t[21]!==l||t[22]!==a||t[23]!==i?(M=l?(0,$.jsx)(De,{primaryEnvironmentId:null,savedEnvironments:o,showSavedEnvironments:!0,onDiscoveryReady:g,selection:{selectedIds:i,onChange:a,autoSelectedComputers:n},refreshWhileEmpty:!0,empty:(0,$.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No computers linked yet.`})}):null,t[19]=n,t[20]=o,t[21]=l,t[22]=a,t[23]=i,t[24]=M):M=t[24];let P;t[25]===M?P=t[26]:(P=(0,$.jsx)(`div`,{className:`mb-3 space-y-1.5`,children:M}),t[25]=M,t[26]=P);let F,I,L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run this on each computer you want to connect.`}),I=(0,$.jsx)(he,{command:`npx @p4code/cli connect`,className:`mt-3`}),L=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Keep P4 Code running. Select the computers you want to set up above.`}),t[27]=F,t[28]=I,t[29]=L):(F=t[27],I=t[28],L=t[29]);let R;t[30]===P?R=t[31]:(R=(0,$.jsx)(Pe,{keepMounted:!0,children:(0,$.jsxs)(`div`,{className:`px-3 pb-3`,children:[P,F,I,L]})}),t[30]=P,t[31]=R);let z;return t[32]!==j||t[33]!==R||t[34]!==_?(z=(0,$.jsx)(`div`,{className:`rounded-lg border border-border bg-background`,children:(0,$.jsxs)(Ie,{open:_,onOpenChange:f,children:[j,R]})}),t[32]=j,t[33]=R,t[34]=_,t[35]=z):z=t[35],z}function vt(e){let t=(0,Q.c)(38),{isPairing:n,setIsPairing:r,onPaired:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},t[0]=a):a=t[0];let o=ae(we,a),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),d=(0,Z.useRef)(!0),f,p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>(d.current=!0,()=>{d.current=!1}),p=[],t[1]=f,t[2]=p):(f=t[1],p=t[2]),(0,Z.useEffect)(f,p);let m;t[3]!==o||t[4]!==n||t[5]!==i||t[6]!==s||t[7]!==r?(m=async()=>{if(n||s.trim().length===0)return;r(!0),u(``);let e=await o({pairingUrl:s.trim()});if(!d.current)return;if(r(!1),e._tag===`Success`){i(e.value);return}if(L(e))return;let t=R(e);u(t instanceof Error?t.message:`Pairing failed.`)},t[3]=o,t[4]=n,t[5]=i,t[6]=s,t[7]=r,t[8]=m):m=t[8];let h=m,g;t[9]===h?g=t[10]:(g=e=>{e.preventDefault(),h()},t[9]=h,t[10]=g);let _;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`label`,{className:`block text-sm text-muted-foreground`,htmlFor:`onboarding-pairing-url`,children:`Pairing link`}),t[11]=_):_=t[11];let y=l.length>0,b=l?`onboarding-pairing-error`:void 0,x;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>c(e.currentTarget.value),t[12]=x):x=t[12];let S;t[13]!==n||t[14]!==s||t[15]!==y||t[16]!==b?(S=(0,$.jsxs)(`div`,{children:[_,(0,$.jsx)(ue,{id:`onboarding-pairing-url`,autoFocus:!0,"aria-invalid":y,"aria-describedby":b,className:`mt-2`,size:`lg`,autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,nativeInput:!0,readOnly:n,placeholder:`https://your-server:5230/pair#token=…`,value:s,onChange:x,onKeyDown:yt})]}),t[13]=n,t[14]=s,t[15]=y,t[16]=b,t[17]=S):S=t[17];let C;t[18]===l?C=t[19]:(C=l?(0,$.jsx)(xe,{id:`onboarding-pairing-error`,variant:`error`,children:(0,$.jsx)(be,{children:l})}):null,t[18]=l,t[19]=C);let w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsxs)(Me,{type:`button`,className:`group flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,$.jsx)(N,{className:`size-3.5 group-data-panel-open:rotate-90`}),`Need a pairing link?`]}),t[20]=w):w=t[20];let T;t[21]!==n||t[22]!==s?(T=n||s.trim().length===0,t[21]=n,t[22]=s,t[23]=T):T=t[23];let E=n?`Pairing...`:`Pair`,D;t[24]!==T||t[25]!==E?(D=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[w,(0,$.jsx)(v,{type:`submit`,disabled:T,children:E})]}),t[24]=T,t[25]=E,t[26]=D):D=t[26];let O,k;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`p`,{className:`pt-3 text-sm text-muted-foreground`,children:`Run this on the computer with your code.`}),k=(0,$.jsx)(he,{command:`npx @p4code/cli pair`,className:`mt-2`}),t[27]=O,t[28]=k):(O=t[27],k=t[28]);let A;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`code`,{className:`font-mono`,children:`npx @p4code/cli serve`}),t[29]=A):A=t[29];let j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsxs)(Pe,{children:[O,k,(0,$.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`Start P4 Code first, or run `,A,`. Add `,(0,$.jsx)(`code`,{className:`font-mono`,children:`--tailscale`}),` to use your tailnet.`]})]}),t[30]=j):j=t[30];let M;t[31]===D?M=t[32]:(M=(0,$.jsxs)(Ie,{children:[D,j]}),t[31]=D,t[32]=M);let P;return t[33]!==S||t[34]!==C||t[35]!==M||t[36]!==g?(P=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`form`,{className:`space-y-3`,onSubmit:g,children:[S,C,M]})}),t[33]=S,t[34]=C,t[35]=M,t[36]=g,t[37]=P):P=t[37],P}function yt(e){e.key===`Enter`&&(e.nativeEvent.isComposing||e.keyCode===229)&&e.preventDefault()}var bt=[`codex`,`claudeAgent`];function xt(e){let t=(0,Q.c)(13),{environmentIds:n,onContinue:r}=e,{environments:i}=te(),a;if(t[0]!==n||t[1]!==i){let e;t[3]===i?e=t[4]:(e=e=>(0,$.jsx)(St,{environmentId:e,machineLabel:i.find(t=>t.environmentId===e)?.label??`Computer`},e),t[3]=i,t[4]=e),a=n.map(e),t[0]=n,t[1]=i,t[2]=a}else a=t[2];let o;t[5]===a?o=t[6]:(o=(0,$.jsx)(de,{scrollFade:!0,className:`mt-5 h-auto max-h-[min(32rem,55dvh)]`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:a})}),t[5]=a,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(y,{className:`size-3.5`}),t[7]=s):s=t[7];let c;t[8]===r?c=t[9]:(c=(0,$.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,$.jsxs)(v,{autoFocus:!0,onClick:r,children:[`Continue`,s]})}),t[8]=r,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,$.jsxs)(qt,{title:`Connect your agents`,description:`Choose an agent to start coding. You can add more later.`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function St(e){let t=(0,Q.c)(57),{environmentId:n,machineLabel:r}=e,i;t[0]===n?i=t[1]:(i=Y.providersValueAtom(n),t[0]=n,t[1]=i);let a=C(i),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[2]=o):o=t[2];let s=ae(Y.refreshProviders,o),c;t[3]===n?c=t[4]:(c=Y.configValueAtom(n),t[3]=n,t[4]=c);let l=C(c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=ne(n,M),_,y;t[5]!==n||t[6]!==s?(_=()=>{s({environmentId:n,input:{}})},y=[n,s],t[5]=n,t[6]=s,t[7]=_,t[8]=y):(_=t[7],y=t[8]),(0,Z.useEffect)(_,y);let b;t[9]===a?b=t[10]:(b=Ue(a),t[9]=a,t[10]=b);let x=b,S,w,T,E;if(t[11]!==x||t[12]!==g||t[13]!==m||t[14]!==n||t[15]!==r||t[16]!==a||t[17]!==l||t[18]!==u?.driver){let e;t[23]!==x||t[24]!==a?(e=e=>{let t=e===`codex`?a?.filter(t=>t.driver===e):void 0;return t?.length?t.map(t=>({driver:e,provider:t,instanceId:t.instanceId})):[{driver:e,provider:x.get(e),instanceId:x.get(e)?.instanceId}]},t[23]=x,t[24]=a,t[25]=e):e=t[25];let i=bt.flatMap(e);if(m){let e;t[26]===m?e=t[27]:(e=e=>e.instanceId===m.instanceId,t[26]=m,t[27]=e);let n=i.findIndex(e),[r]=n>=0?i.splice(n,1):[];i.unshift(r??{driver:`codex`,provider:void 0,instanceId:m.instanceId})}t[28]===r?E=t[29]:(E=(0,$.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:r}),t[28]=r,t[29]=E),t[30]===g?S=t[31]:(S=g?null:(0,$.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`This connection cannot control terminals.`}),t[30]=g,t[31]=S),w=`space-y-1.5`;let o;t[32]!==g||t[33]!==m||t[34]!==n||t[35]!==l||t[36]!==u?.driver?(o=e=>{let{driver:t,provider:r,instanceId:i}=e;return t===`codex`&&l!==null?(0,$.jsx)(Tt,{environmentId:n,provider:r,serverConfig:l,createdAccount:i===m?.instanceId?m:null,onAutoStartConsumed:()=>h(wt),terminalOpen:u?.driver===t,onOpenTerminal:()=>{r!==void 0&&X(n,`terminal:operate`)&&d({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:l.cwd,command:r.installed?He(r,l.settings,l.environment.platform.os):Ye(t,l.environment.platform.os),keybindings:l.keybindings})}},i??t):(0,$.jsx)(Et,{driver:t,provider:r,terminalOpen:u?.driver===t,terminalAvailable:l!==null&&g,onOpenTerminal:()=>{r!==void 0&&l!==null&&X(n,`terminal:operate`)&&d({environmentId:n,driver:t,providerInstanceId:r.instanceId,cwd:l.cwd,command:r.installed?He(r,l.settings,l.environment.platform.os):Ye(t,l.environment.platform.os),keybindings:l.keybindings})}},t)},t[32]=g,t[33]=m,t[34]=n,t[35]=l,t[36]=u?.driver,t[37]=o):o=t[37],T=i.map(o),t[11]=x,t[12]=g,t[13]=m,t[14]=n,t[15]=r,t[16]=a,t[17]=l,t[18]=u?.driver,t[19]=S,t[20]=w,t[21]=T,t[22]=E}else S=t[19],w=t[20],T=t[21],E=t[22];let D;t[38]!==w||t[39]!==T?(D=(0,$.jsx)(`div`,{className:w,children:T}),t[38]=w,t[39]=T,t[40]=D):D=t[40];let O;t[41]===a?O=t[42]:(O=a?.some(Ct)?(0,$.jsx)(`div`,{className:`mt-3`,children:(0,$.jsx)(v,{size:`xs`,variant:`ghost-muted`,onClick:()=>p(!0),children:`Connect another ChatGPT account`})}):null,t[41]=a,t[42]=O);let k;t[43]!==f||t[44]!==n?(k=f?(0,$.jsx)(Ke,{environmentId:n,onClose:()=>p(!1),onAccountCreated:(e,t)=>h({instanceId:e,displayName:t,autoStart:!0})}):null,t[43]=f,t[44]=n,t[45]=k):k=t[45];let A;t[46]!==n||t[47]!==s||t[48]!==u?(A=u===null?null:(0,$.jsx)(Dt,{session:u,onClose:()=>{d(null),s({environmentId:n,input:{}})}},`${u.environmentId}:${u.providerInstanceId}:${u.driver}`),t[46]=n,t[47]=s,t[48]=u,t[49]=A):A=t[49];let j;return t[50]!==S||t[51]!==D||t[52]!==O||t[53]!==k||t[54]!==A||t[55]!==E?(j=(0,$.jsxs)(`section`,{children:[E,S,D,O,k,A]}),t[50]=S,t[51]=D,t[52]=O,t[53]=k,t[54]=A,t[55]=E,t[56]=j):j=t[56],j}function Ct(e){return e.driver===`codex`&&Ge(e)===`ready`}function wt(e){return e?{...e,autoStart:!1}:null}function Tt(e){let t=(0,Q.c)(28),{createdAccount:n,onAutoStartConsumed:r,environmentId:i,provider:a,serverConfig:o,terminalOpen:s,onOpenTerminal:c}=e,l=ne(i,M),u=ae(Y.updateSettings,`Codex setup settings`),d;t[0]!==n?.instanceId||t[1]!==a?.instanceId?(d=n?.instanceId??a?.instanceId??h(p.make(`codex`)),t[0]=n?.instanceId,t[1]=a?.instanceId,t[2]=d):d=t[2];let f=d,m=o.settings,g;t[3]!==n||t[4]!==f||t[5]!==m.providerInstances?(g=m.providerInstances[f]??{driver:p.make(`codex`),config:n?{enabled:!0,setupMode:`managed`}:{}},t[3]=n,t[4]=f,t[5]=m.providerInstances,t[6]=g):g=t[6];let _=g,v;t[7]===_.config?v=t[8]:(v=Je(_.config),t[7]=_.config,t[8]=v);let y=v,b=y===`existing`&&_.config!==null&&typeof _.config==`object`&&`setupMode`in _.config&&_.config.setupMode===`existing`,x;t[9]!==i||t[10]!==_||t[11]!==f||t[12]!==m||t[13]!==u?(x=e=>{u({environmentId:i,input:{patch:Ve({settings:m,instanceId:f,instance:{..._,enabled:!0,config:{..._.config!==null&&typeof _.config==`object`?_.config:{},enabled:!0,setupMode:e}}})}})},t[9]=i,t[10]=_,t[11]=f,t[12]=m,t[13]=u,t[14]=x):x=t[14];let S=x,C;return t[15]!==l||t[16]!==S||t[17]!==n?.autoStart||t[18]!==n?.displayName||t[19]!==i||t[20]!==b||t[21]!==f||t[22]!==y||t[23]!==r||t[24]!==c||t[25]!==a||t[26]!==s?(C=b?(0,$.jsx)(Et,{driver:`codex`,provider:a,terminalOpen:s,terminalAvailable:l,onOpenTerminal:c}):(0,$.jsx)(We,{presentation:`onboarding`,autoStart:n?.autoStart===!0,displayName:n?.displayName,onAutoStartConsumed:r,environmentId:i,instanceId:f,provider:a,mode:y,enabled:a?.enabled??!0,onModeChange:S}),t[15]=l,t[16]=S,t[17]=n?.autoStart,t[18]=n?.displayName,t[19]=i,t[20]=b,t[21]=f,t[22]=y,t[23]=r,t[24]=c,t[25]=a,t[26]=s,t[27]=C):C=t[27],C}function Et(e){let t=(0,Q.c)(29),{driver:n,provider:r,terminalOpen:a,terminalAvailable:o,onOpenTerminal:c}=e,l;t[0]===n?l=t[1]:(l=Se.get(p.make(n)),t[0]=n,t[1]=l);let u=l,d=r?.displayName||(n===`claudeAgent`?`Claude Code`:u?.label??n),f;t[2]===r?f=t[3]:(f=qe(r),t[2]=r,t[3]=f);let m=f,h;t[4]===r?h=t[5]:(h=Ge(r),t[4]=r,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=p.make(n),t[6]=n,t[7]=_);let y;t[8]!==d||t[9]!==_?(y=(0,$.jsx)(Ce,{driverKind:_,displayName:d,iconClassName:`size-5`}),t[8]=d,t[9]=_,t[10]=y):y=t[10];let b;t[11]===d?b=t[12]:(b=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:d}),t[11]=d,t[12]=b);let x=g===`ready`?`Ready to code.`:m.headline,S=g!==`ready`&&m.detail?` · ${m.detail}`:``,C;t[13]!==x||t[14]!==S?(C=(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground`,children:[x,S]}),t[13]=x,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==b||t[17]!==C?(w=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,C]}),t[16]=b,t[17]=C,t[18]=w):w=t[18];let T;t[19]!==c||t[20]!==g||t[21]!==m||t[22]!==o||t[23]!==a?(T=(0,$.jsx)(`div`,{className:`shrink-0`,children:g===`ready`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,$.jsx)(s,{className:`size-3.5`}),`Ready`]}):g===`checking`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):g===`disabled`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Disabled`}):g===`attention`?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m.headline}):(0,$.jsxs)(v,{size:`xs`,variant:`ghost`,onClick:c,disabled:a||!o,children:[(0,$.jsx)(i,{className:`size-3.5`}),g===`signIn`?`Sign in`:`Install`]})}),t[19]=c,t[20]=g,t[21]=m,t[22]=o,t[23]=a,t[24]=T):T=t[24];let E;return t[25]!==w||t[26]!==T||t[27]!==y?(E=(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-4`,children:[y,w,T]}),t[25]=w,t[26]=T,t[27]=y,t[28]=E):E=t[28],E}function Dt(e){let t=(0,Q.c)(60),{session:n,onClose:r}=e,{command:i,cwd:a,driver:o,environmentId:s,keybindings:l,providerInstanceId:u}=n,d=ne(s,M),[f]=c(ke,!1,D),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={reportFailure:!1},t[0]=p):p=t[0];let m=ae(ve.open,p),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h={reportFailure:!1},t[1]=h):h=t[1];let g=ae(ve.write,h),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={reportFailure:!1},t[2]=_):_=t[2];let y=ae(ve.close,_),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=Promise.resolve(),t[3]=S):S=t[3];let C=(0,Z.useRef)(S),w=(0,Z.useRef)(0),T=(0,Z.useRef)(null),E;t[4]===o?E=t[5]:(E=()=>`onboarding-${o}-${b()}`,t[4]=o,t[5]=E);let[O]=(0,Z.useState)(E),k;t[6]===s?k=t[7]:(k=x(s,dt),t[6]=s,t[7]=k);let A=k,[j,N]=(0,Z.useState)(0),[P,F]=(0,Z.useState)(`preparing`),I=P===`ready`||P===`writeFailed`,L;t[8]!==y||t[9]!==i||t[10]!==a||t[11]!==s||t[12]!==m||t[13]!==u||t[14]!==O||t[15]!==g?(L=()=>{let e=w.current+1;return w.current=e,T.current=e,F(`preparing`),C.current=C.current.then(async()=>{if(T.current!==e)return;if(!X(s,`terminal:operate`)){F(`openFailed`);return}if((await m({environmentId:s,input:{threadId:dt,terminalId:O,cwd:a,providerInstanceId:u}}))._tag!==`Success`){T.current===e&&F(`openFailed`);return}if(T.current!==e)return;if(!X(s,`terminal:operate`)){F(`writeFailed`);return}let t=await g({environmentId:s,input:{threadId:dt,terminalId:O,data:i}});T.current===e&&F(t._tag===`Success`?`ready`:`writeFailed`)}),()=>{T.current===e&&(T.current=null),C.current=C.current.then(async()=>{X(s,`terminal:operate`)&&await y({environmentId:s,input:{threadId:dt,terminalId:O,deleteHistory:!0}})})}},t[8]=y,t[9]=i,t[10]=a,t[11]=s,t[12]=m,t[13]=u,t[14]=O,t[15]=g,t[16]=L):L=t[16];let R;t[17]!==y||t[18]!==i||t[19]!==a||t[20]!==s||t[21]!==m||t[22]!==u||t[23]!==j||t[24]!==O||t[25]!==g?(R=[y,i,a,s,m,u,j,O,g],t[17]=y,t[18]=i,t[19]=a,t[20]=s,t[21]=m,t[22]=u,t[23]=j,t[24]=O,t[25]=g,t[26]=R):R=t[26],(0,Z.useEffect)(L,R);let z;t[27]!==d||t[28]!==i||t[29]!==P?(z=d?P===`writeFailed`?(0,$.jsxs)($.Fragment,{children:[`Run `,(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:i}),` in this terminal.`]}):P===`ready`?`Review the command, then press Enter to run it.`:P===`openFailed`?`Could not open the setup terminal.`:`Preparing command...`:`This connection cannot control terminals.`,t[27]=d,t[28]=i,t[29]=P,t[30]=z):z=t[30];let B;t[31]===z?B=t[32]:(B=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:z}),t[31]=z,t[32]=B);let V;t[33]!==d||t[34]!==s||t[35]!==P?(V=P===`openFailed`?(0,$.jsx)(v,{size:`xs`,variant:`ghost`,disabled:!d,onClick:()=>{X(s,`terminal:operate`)&&N(Ot)},children:`Retry`}):null,t[33]=d,t[34]=s,t[35]=P,t[36]=V):V=t[36];let H;t[37]===r?H=t[38]:(H=(0,$.jsx)(v,{size:`xs`,variant:`ghost-muted`,onClick:r,children:`Close`}),t[37]=r,t[38]=H);let U;t[39]!==V||t[40]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[V,H]}),t[39]=V,t[40]=H,t[41]=U):U=t[41];let W;t[42]!==B||t[43]!==U?(W=(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/60 bg-background/60 px-3 py-1.5`,children:[B,U]}),t[42]=B,t[43]=U,t[44]=W):W=t[44];let G;t[45]!==f||t[46]!==a||t[47]!==o||t[48]!==l||t[49]!==r||t[50]!==u||t[51]!==O||t[52]!==I||t[53]!==A?(G=I?(0,$.jsx)(_e,{threadRef:A,threadId:dt,terminalId:O,terminalLabel:`Install ${o}`,cwd:a,providerInstanceId:u,advancedTypography:f,onSessionExited:r,focusRequestId:1,autoFocus:!0,visible:!0,resizeEpoch:0,drawerHeight:256,keybindings:l}):null,t[45]=f,t[46]=a,t[47]=o,t[48]=l,t[49]=r,t[50]=u,t[51]=O,t[52]=I,t[53]=A,t[54]=G):G=t[54];let ee;t[55]===G?ee=t[56]:(ee=(0,$.jsx)(`div`,{className:`h-64`,children:G}),t[55]=G,t[56]=ee);let K;return t[57]!==W||t[58]!==ee?(K=(0,$.jsxs)(`div`,{"data-thread-terminal-drawer":!0,className:`mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground`,children:[W,ee]}),t[57]=W,t[58]=ee,t[59]=K):K=t[59],K}function Ot(e){return e+1}var kt=`This connection cannot import projects or thread history.`;function At(e){let t=(0,Q.c)(75),{scans:n,isImporting:r,setIsImporting:i,onDone:a}=e,{environments:o}=te(),s=re(n,A),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=ae(H.create,c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[1]=u):u=t[1];let d=ae(ot,u),[f,p]=(0,Z.useState)(null),h=(0,Z.useRef)(``),g=(0,Z.useRef)(0),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Map,t[2]=_):_=t[2];let y=(0,Z.useRef)(_),b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=new Map,t[3]=b):b=t[3];let x=(0,Z.useRef)(b),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[4]=S):S=t[4];let C=(0,Z.useRef)(S),T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Map,t[5]=T):T=t[5];let E=(0,Z.useRef)(T),D=(0,Z.useRef)(0),O,j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>(D.current+=1,()=>{D.current+=1}),j=[],t[6]=O,t[7]=j):(O=t[6],j=t[7]),(0,Z.useEffect)(O,j);let M;t[8]===n?M=t[9]:(M=Qe(n.flatMap(Rt)),t[8]=n,t[9]=M);let{available:N,recent:P}=M,F;t[10]!==P||t[11]!==f?(F=f??new Set(P.map(Lt)),t[10]=P,t[11]=f,t[12]=F):F=t[12];let I=F,R,z;if(t[13]!==N||t[14]!==I||t[15]!==s){let e;t[18]===I?e=t[19]:(e=e=>I.has(e.key),t[18]=I,t[19]=e),R=N.filter(e);let n;t[20]===s?n=t[21]:(n=e=>s.has(e.environmentId),t[20]=s,t[21]=n),z=R.every(n),t[13]=N,t[14]=I,t[15]=s,t[16]=R,t[17]=z}else R=t[16],z=t[17];let V=z,[W,ee]=(0,Z.useState)(``),K=V?W===kt?``:W:kt,q;t[22]!==a||t[23]!==i?(q=()=>{let e=nt(C.current,x.current,y.current);if(e===void 0){a(void 0,h.current,g.current);return}i(!0);let t=D.current;B(e).then(()=>e,It).then(async e=>{t===D.current&&(await a(e,h.current,g.current)||i(!1))})},t[22]=a,t[23]=i,t[24]=q):q=t[24];let J=q,Y;t[25]!==l||t[26]!==J||t[27]!==d||t[28]!==r||t[29]!==a||t[30]!==n||t[31]!==i?(Y=async e=>{if(r)return;let t=()=>e.every(Ft),o=()=>{i(!1),ee(kt)};if(!t()){o();return}if(e.length===0){a();return}i(!0),h.current=``,g.current=0,C.current=e.map(Pt);let s=D.current,c=y.current,u=E.current,f=c.size>0?e.filter(e=>c.has(e.key)).length:0,p=0,_=0,v=new Set;for(let n of e){let{environmentId:e}=n;if(s!==D.current||c!==y.current)return;if(!t()){o();return}if(c.has(n.key))continue;let r=tt(U(),e,n);if(r===null){let t=u.get(n.key);if(t===void 0){let e=w();t={projectId:e,commandId:m.make(`onboarding:project:create:${e}`)},u.set(n.key,t)}r=t.projectId;let i=await l({environmentId:e,input:{projectId:r,commandId:t.commandId,title:n.title,workspaceRoot:n.path,createWorkspaceRootIfMissing:!1,defaultModelSelection:null}});if(s!==D.current||c!==y.current)return;if(i._tag!==`Success`){L(i)||(u.delete(n.key),v.add(e));continue}}if(!t()){o();return}let i=await d({environmentId:e,input:{projectId:r,expectedWorkspaceRoot:n.path}});if(s!==D.current||c!==y.current)return;i._tag===`Success`?(p+=i.value.importedCount,_+=i.value.skippedCount,i.value.importedCount>0&&x.current.set(n.key,k(e,r)),i.value.skippedCount===0&&(f+=1,c.set(n.key,k(e,r)))):L(i)||(u.delete(n.key),v.add(e))}for(let e of n)v.has(e.environmentId)&&e.refresh();i(!1),g.current=p,f<e.length&&(p>0&&_>0?h.current=`Imported ${p} ${p===1?`thread`:`threads`}. ${_} ${_===1?`thread`:`threads`} could not be imported.`:_>0?h.current=`${_} ${_===1?`thread could`:`threads could`} not be imported.`:p>0?h.current=`Imported ${p} ${p===1?`thread`:`threads`}. Some thread history could not be imported.`:h.current=`Could not import thread history.`),J()},t[25]=l,t[26]=J,t[27]=d,t[28]=r,t[29]=a,t[30]=n,t[31]=i,t[32]=Y):Y=t[32];let ne=Y;if(n.every(Nt)&&n.some(Mt)){let e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:`Your projects`}),t[33]=e):e=t[33];let n;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6`,children:[(0,$.jsx)(G,{size:`lg`,tone:`muted`}),(0,$.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`Looking for projects from Claude Code and Codex…`})]}),t[34]=n):n=t[34];let r;return t[35]===a?r=t[36]:(r=(0,$.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col`,children:[e,n,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(v,{variant:`ghost-muted`,onClick:()=>void a(),children:`Do not import projects`})})]}),t[35]=a,t[36]=r),r}let X;t[37]!==N||t[38]!==r||t[39]!==R?(X=N.length>0?(0,$.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{role:`status`,children:[R.length,` of `,N.length,` selected`]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(v,{variant:`ghost`,size:`xs`,disabled:r||R.length===N.length,onClick:()=>p(new Set(N.map(jt))),children:`Select all`}),(0,$.jsx)(v,{variant:`ghost`,size:`xs`,disabled:r||R.length===0,onClick:()=>p(new Set),children:`Select none`})]})]}):null,t[37]=N,t[38]=r,t[39]=R,t[40]=X):X=t[40];let ie;if(t[41]!==N||t[42]!==o||t[43]!==r||t[44]!==n||t[45]!==I){let e;t[47]!==N||t[48]!==o||t[49]!==r||t[50]!==n.length||t[51]!==I?(e=e=>{let t=N.filter(t=>t.environmentId===e.environmentId),i=o.find(t=>t.environmentId===e.environmentId)?.label??`Computer`;return(0,$.jsxs)(`fieldset`,{className:`min-w-0 space-y-0.5`,disabled:r,children:[n.length>1?(0,$.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:i}):null,e.isPending&&e.data===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(G,{size:`md`}),`Looking for projects…`]}):e.error===null?t.length===0?(0,$.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No existing Claude Code or Codex projects found.`}):null:(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 text-sm text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Could not check projects. `,e.error]}),(0,$.jsx)(v,{variant:`ghost`,size:`sm`,onClick:e.refresh,children:`Retry`})]}),e.data?.truncated?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:pt}):null,(0,$.jsx)(zt,{candidates:t,selectedKeys:I,onSelectionChange:p})]},e.environmentId)},t[47]=N,t[48]=o,t[49]=r,t[50]=n.length,t[51]=I,t[52]=e):e=t[52],ie=n.map(e),t[41]=N,t[42]=o,t[43]=r,t[44]=n,t[45]=I,t[46]=ie}else ie=t[46];let oe;t[53]===ie?oe=t[54]:(oe=(0,$.jsx)(de,{scrollFade:!0,className:`mt-2 h-auto max-h-80`,children:(0,$.jsx)(`div`,{className:`space-y-5 pr-3`,children:ie})}),t[53]=ie,t[54]=oe);let se;t[55]===K?se=t[56]:(se=K?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:K}):null,t[55]=K,t[56]=se);let ce;t[57]!==J||t[58]!==r?(ce=(0,$.jsx)(v,{variant:`ghost-muted`,disabled:r,onClick:J,children:`Do not import projects`}),t[57]=J,t[58]=r,t[59]=ce):ce=t[59];let le=!V||r||R.length===0,ue;t[60]!==ne||t[61]!==R?(ue=()=>void ne(R),t[60]=ne,t[61]=R,t[62]=ue):ue=t[62];let fe=r?`Importing…`:`Import ${R.length} ${R.length===1?`project`:`projects`}`,pe;t[63]!==le||t[64]!==ue||t[65]!==fe?(pe=(0,$.jsx)(v,{autoFocus:!0,disabled:le,onClick:ue,children:fe}),t[63]=le,t[64]=ue,t[65]=fe,t[66]=pe):pe=t[66];let me;t[67]!==ce||t[68]!==pe?(me=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-end gap-3`,children:[ce,pe]}),t[67]=ce,t[68]=pe,t[69]=me):me=t[69];let he;return t[70]!==X||t[71]!==oe||t[72]!==se||t[73]!==me?(he=(0,$.jsxs)(qt,{title:`Import your projects`,description:`Import projects and conversations from Claude Code and Codex on your selected computers.`,children:[X,oe,se,me]}),t[70]=X,t[71]=oe,t[72]=se,t[73]=me,t[74]=he):he=t[74],he}function jt(e){return e.key}function Mt(e){return e.isPending}function Nt(e){return e.data===null}function Pt(e){return e.key}function Ft(e){return X(e.environmentId,A)}function It(){}function Lt(e){return e.key}function Rt(e){return(e.data?.candidates??[]).map(t=>({...t,environmentId:e.environmentId,key:it(e.environmentId,t.path)}))}function zt(e){let t=(0,Q.c)(25),{candidates:n,selectedKeys:r,onSelectionChange:i}=e,a;t[0]===n?a=t[1]:(a=et(n),t[0]=n,t[1]=a);let{repositories:o,other:s}=a,c;t[2]!==i||t[3]!==r?(c=(e,t)=>{let n=new Set(r);for(let r of e)t?n.add(r):n.delete(r);i(n)},t[2]=i,t[3]=r,t[4]=c):c=t[4];let l=c,u;if(t[5]!==s||t[6]!==r){let e;t[8]===r?e=t[9]:(e=e=>r.has(e.key),t[8]=r,t[9]=e),u=s.filter(e),t[5]=s,t[6]=r,t[7]=u}else u=t[7];let d=u.length,f;if(t[10]!==o||t[11]!==r||t[12]!==l){let e;t[14]!==r||t[15]!==l?(e=e=>(0,$.jsx)(Vt,{group:e,selectedKeys:r,onToggle:l},e.key),t[14]=r,t[15]=l,t[16]=e):e=t[16],f=o.map(e),t[10]=o,t[11]=r,t[12]=l,t[13]=f}else f=t[13];let p;t[17]!==s||t[18]!==d||t[19]!==r||t[20]!==l?(p=s.length>0?(0,$.jsxs)(Ie,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[(0,$.jsx)(ge,{checked:d===s.length,indeterminate:d>0&&d<s.length,onCheckedChange:e=>l(s.map(Bt),e===!0)}),(0,$.jsxs)(Me,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,$.jsx)(N,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),(0,$.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:`Other folders`}),(0,$.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[s.length,` `,s.length===1?`folder`:`folders`]})]})]}),(0,$.jsx)(Pe,{children:s.map(e=>(0,$.jsx)(Gt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>l([e.key],t)},e.key))})]}):null,t[17]=s,t[18]=d,t[19]=r,t[20]=l,t[21]=p):p=t[21];let m;return t[22]!==f||t[23]!==p?(m=(0,$.jsxs)($.Fragment,{children:[f,p]}),t[22]=f,t[23]=p,t[24]=m):m=t[24],m}function Bt(e){return e.key}function Vt(e){let t=(0,Q.c)(53),{group:n,selectedKeys:r,onToggle:i}=e,a,o;if(t[0]!==n.candidates||t[1]!==r){a=n.candidates.map(Ut);let e;t[4]===r?e=t[5]:(e=e=>r.has(e),t[4]=r,t[5]=e),o=a.filter(e),t[0]=n.candidates,t[1]=r,t[2]=a,t[3]=o}else a=t[2],o=t[3];let s=o.length,c=n.candidates.length===1,l=n.candidates[0];if(c&&l!==void 0){let e=n.label,a=l.path,o;t[6]!==l.key||t[7]!==r?(o=r.has(l.key),t[6]=l.key,t[7]=r,t[8]=o):o=t[8];let s;t[9]!==i||t[10]!==l.key?(s=e=>i([l.key],e),t[9]=i,t[10]=l.key,t[11]=s):s=t[11];let c;return t[12]!==n.label||t[13]!==l||t[14]!==o||t[15]!==s?(c=(0,$.jsx)(Gt,{candidate:l,label:e,path:a,checked:o,onCheckedChange:s}),t[12]=n.label,t[13]=l,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}let u=s===a.length,d=s>0&&s<a.length,f;t[17]!==a||t[18]!==i?(f=e=>i(a,e===!0),t[17]=a,t[18]=i,t[19]=f):f=t[19];let p;t[20]!==u||t[21]!==d||t[22]!==f?(p=(0,$.jsx)(ge,{checked:u,indeterminate:d,onCheckedChange:f}),t[20]=u,t[21]=d,t[22]=f,t[23]=p):p=t[23];let m;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(N,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-90`}),t[24]=m):m=t[24];let h;t[25]===n.label?h=t[26]:(h=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.label}),t[25]=n.label,t[26]=h);let g;t[27]===n.candidates?g=t[28]:(g=new Set(n.candidates.flatMap(Ht)),t[27]=n.candidates,t[28]=g);let _;t[29]===g?_=t[30]:(_=[...g],t[29]=g,t[30]=_);let v;t[31]!==n.lastActiveAt||t[32]!==n.threadCount||t[33]!==_?(v=(0,$.jsx)(Kt,{sources:_,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[31]=n.lastActiveAt,t[32]=n.threadCount,t[33]=_,t[34]=v):v=t[34];let y;t[35]!==v||t[36]!==h?(y=(0,$.jsxs)(Me,{className:`group flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[m,h,v]}),t[35]=v,t[36]=h,t[37]=y):y=t[37];let b;t[38]!==y||t[39]!==p?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40`,children:[p,y]}),t[38]=y,t[39]=p,t[40]=b):b=t[40];let x;if(t[41]!==n.candidates||t[42]!==i||t[43]!==r){let e;t[45]!==i||t[46]!==r?(e=e=>(0,$.jsx)(Gt,{candidate:e,path:e.path,nested:!0,checked:r.has(e.key),onCheckedChange:t=>i([e.key],t)},e.key),t[45]=i,t[46]=r,t[47]=e):e=t[47],x=n.candidates.map(e),t[41]=n.candidates,t[42]=i,t[43]=r,t[44]=x}else x=t[44];let S;t[48]===x?S=t[49]:(S=(0,$.jsx)(Pe,{children:x}),t[48]=x,t[49]=S);let C;return t[50]!==b||t[51]!==S?(C=(0,$.jsxs)(Ie,{defaultOpen:!0,children:[b,S]}),t[50]=b,t[51]=S,t[52]=C):C=t[52],C}function Ht(e){return e.sources}function Ut(e){return e.key}function Wt(e){let t=(0,Q.c)(12),{path:n,className:r}=e,i;t[0]===n?i=t[1]:(i=rt(n),t[0]=n,t[1]=i);let{name:a,parent:o}=i,s;t[2]===r?s=t[3]:(s=O(`flex min-w-0 items-baseline font-mono`,r),t[2]=r,t[3]=s);let c;t[4]===o?c=t[5]:(c=o.length>0?(0,$.jsx)(`span`,{className:`truncate`,children:o}):null,t[4]=o,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,$.jsx)(`span`,{className:`max-w-full shrink-0 truncate`,children:a}),t[6]=a,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Gt(e){let t=(0,Q.c)(30),{candidate:n,label:r,path:i,nested:a,checked:o,onCheckedChange:s}=e,c=a!==void 0&&a,l=c&&`pl-8`,u;t[0]===l?u=t[1]:(u=O(`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-muted/40 has-disabled:cursor-default`,l),t[0]=l,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e===!0),t[2]=s,t[3]=d);let f;t[4]!==o||t[5]!==d?(f=(0,$.jsx)(ge,{checked:o,onCheckedChange:d}),t[4]=o,t[5]=d,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2 truncate`}),t[7]=p):p=t[7];let m;t[8]===r?m=t[9]:(m=r===void 0?null:(0,$.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r}),t[8]=r,t[9]=m);let h;t[10]!==r||t[11]!==i?(h=i===void 0?null:(0,$.jsx)(Wt,{path:i,className:r===void 0?`text-xs`:`text-2xs text-muted-foreground`}),t[10]=r,t[11]=i,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,$.jsxs)(se,{render:p,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===n.path?_=t[17]:(_=(0,$.jsx)(ce,{variant:`code`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==_||t[19]!==g?(v=(0,$.jsxs)(le,{children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let y=c?null:n.sources,b;t[21]!==n.lastActiveAt||t[22]!==n.threadCount||t[23]!==y?(b=(0,$.jsx)(Kt,{sources:y,threadCount:n.threadCount,lastActiveAt:n.lastActiveAt}),t[21]=n.lastActiveAt,t[22]=n.threadCount,t[23]=y,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b||t[27]!==u||t[28]!==f?(x=(0,$.jsxs)(`label`,{className:u,children:[f,v,b]}),t[25]=v,t[26]=b,t[27]=u,t[28]=f,t[29]=x):x=t[29],x}function Kt(e){let t=(0,Q.c)(19),{sources:n,threadCount:r,lastActiveAt:i}=e,a;t[0]===i?a=t[1]:(a=i===null?null:oe(i),t[0]=i,t[1]=a);let o=a,s=o===null?``:o.suffix===null?`now`:o.value,c;t[2]===n?c=t[3]:(c=n?.includes(`claudeAgent`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Claude Code`,children:(0,$.jsx)(Ce,{driverKind:p.make(`claudeAgent`),displayName:`Claude Code`,iconClassName:`size-3`})}):null,t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=n?.includes(`codex`)?(0,$.jsx)(`span`,{role:`img`,"aria-label":`Codex`,children:(0,$.jsx)(Ce,{driverKind:p.make(`codex`),displayName:`Codex`,iconClassName:`size-3`})}):null,t[6]=n,t[7]=u);let d;t[8]===u?d=t[9]:(d=(0,$.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:u}),t[8]=u,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,$.jsx)(`span`,{className:`text-right`,children:r}),t[10]=r,t[11]=f);let m;t[12]===s?m=t[13]:(m=(0,$.jsx)(`span`,{className:`text-right whitespace-nowrap`,children:s}),t[12]=s,t[13]=m);let h;return t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:`ml-auto grid shrink-0 grid-cols-[1rem_1rem_2.5rem_2.25rem] items-center gap-x-1 text-xs text-muted-foreground tabular-nums`,children:[l,d,f,m]}),t[14]=l,t[15]=d,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}function qt(e){let t=(0,Q.c)(8),{title:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`p`,{className:`mt-2.5 text-sm leading-relaxed text-muted-foreground`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)($.Fragment,{children:[a,o,i]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Jt=o(f);function Yt(){let e=(0,Q.c)(14),{authGateState:t}=Ae.useRouteContext(),n=ee(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:Zt},e[0]=r):r=e[0];let i=K(r),o;e[1]===i?o=e[2]:(o=i.startsWith(`agents:`)?a(Jt(i.slice(7))):void 0,e[1]=i,e[2]=o);let s=o,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={select:Xt},e[3]=c):c=e[3];let l=K(c),[u,d]=(0,Z.useState)(!1),f=ye(),p=t.status===`authenticated`,m;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(ze,{}),e[4]=m):m=e[4];let h;e[5]!==u||e[6]!==l||e[7]!==p||e[8]!==n||e[9]!==f||e[10]!==s?(h=l&&!u?(0,$.jsx)(mt,{localAvailable:p,resumeEnvironmentId:s,onDone:async e=>{d(!0),e===void 0?await n({to:`/`,replace:!0}):await f(e,{replace:!0}).catch(()=>n({to:`/`,replace:!0}))}}):null,e[5]=u,e[6]=l,e[7]=p,e[8]=n,e[9]=f,e[10]=s,e[11]=h):h=e[11];let g;return e[12]===h?g=e[13]:(g=(0,$.jsxs)($.Fragment,{children:[m,h]}),e[12]=h,e[13]=g),g}function Xt(e){return e.pathname===`/welcome`}function Zt(e){return e.hash}export{Yt as component};
2
+ //# sourceMappingURL=welcome-BcjbPbMq.js.map
@@ -384,7 +384,7 @@
384
384
  </script>
385
385
  <style>html,body,#root{width:100%;height:100%;margin:0}body{color:#262626;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}html.dark body{color:#f5f5f5;background:#0a0a0a}#boot-shell{background:inherit;min-height:100%;color:inherit;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}html[data-theme-selected=true] #boot-shell{background:var(--boot-background);color:var(--boot-foreground)}#boot-shell-card{z-index:1;justify-content:center;align-items:center;width:96px;height:96px;display:flex;position:relative}#boot-shell-logo{object-fit:contain;width:64px;height:64px}#boot-error{text-align:center;justify-items:center;gap:16px;max-width:600px;padding:24px;display:grid}#boot-error p{overflow-wrap:anywhere;margin:0}#boot-error button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:8px 16px}</style>
386
386
  <title>P4 Code</title>
387
- <script type="module" crossorigin src="/assets/index-CxLeDuff.js"></script>
387
+ <script type="module" crossorigin src="/assets/index-4XHdM2Yx.js"></script>
388
388
  </head>
389
389
  <body>
390
390
  <div id="root">