@xopcai/xopc 0.0.431 → 0.0.433
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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-WqnVruhY.js → activity-store-BpYGrRXw.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CSiO9c2F.js → agent-avatar-dicebear-DTgOSv6G.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-D-yds6wG.js → agent-avatar-display-BUH7ljEo.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-_UT9C7bg.js → agent-defaults-settings-panel-B_FAikHA.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DVzYXsAy.js → agent-plugin-dialog-DPabZaSE.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Ds7K3D7T.js → agents-BAPYP1Ka.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-Bgv4lJ9Y.js → agents-admin-api-CXCAHNPj.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Dv6Cn-Rs.js → api-DMbimMEi.js} +1 -1
- package/dist/gateway/static/root/assets/{api-C-9J9ghT.js → api-oIK4hYkJ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BXJrrjH5.js → app-management-settings-panel-BZ3Fy8ZR.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-oYjAVulT.js → appearance-settings-DsRTj1by.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D95yzj-f.js → apps-page-D-n71lO1.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DBPu3xCJ.js → archive-plugin-Bg1VTieK.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-DAou8Kji.js → automation-api-CLPsgcQN.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CA7LV098.js → automation-result-state-CKVnR4KG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DIjI_Y1X.js → automation-task-card-D27Mw66U.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BQwSCkmd.js → automations-page-DGNTJ8lN.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BUFTTjBq.js → automations-workspace-DWDWy-SG.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-D25P9ZxQ.js → binary-plugins-CuwSdCG5.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BI105p1U.js → block-editor-Dtl2BG3t.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DhDRvWQE.js → browser-automation-inputs-uGK086ag.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CCPi1Bvy.js → browser-automations-page-Da_edNNS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-BN4F-bM1.js → browser-control-api-k3OOX3bS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BZXUZpjp.js → browser-settings-page-C1bSw-Jq.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-LC-yEQYo.js → capabilities-CoeuLRt6.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-u2z_KFRt.js → capabilities-DlHPLld_.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-B8UgQ4dD.js → capabilities-page-IcwojmJK.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-Bxn8HtEO.js → capabilities-settings-panel-CtY-bGIi.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-9Uaa-IN0.js → channels-Cn1MWBL_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-Cffxfzi1.js → chat-agents-api-BB0biwc7.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Bbk0b3TV.js → chat-chart-block-QSvjx4w6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-e-xCsrdS.js → chat-page-CwP4OMdW.js} +16 -16
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CQMuG-Bz.js → chat-terminal-dock-Cd51G9eG.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-BRxfFgGA.js → command-palette-api-CEG10uE-.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-_9L2A5AZ.js → composer-payload-handoff-Bogdq9Hy.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-BIHbjBVt.js → computer-settings-page-DyAlOzqY.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-B7ktDgqt.js → connected-providers-grid-D0lXg22c.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BVMEg8n-.js → connector-service-page-k2rjyjrp.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-B07yoCzk.js → connectors-api-DtvB9Cjm.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-hPKaJUWY.js → connectors-page-DI_Q0CKz.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BvEnSGZK.js → date-picker-CAankdQw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C1z9YDEg.js → desktop-pet-DjM73fir.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CbbVb8GY.js → desktop-pet-settings-Rmh-GxHl.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-38EmUIEC.js → dev-view-store-BgW2Riyk.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Wb1EKiXA.js → device-pairing-wizard-UdzSpNa5.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BvKDrKc4.js → directory-picker-path-field-Rkw3f7lG.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BfVzIwe2.js → discussion-annotation-sync-Dudoj_Fz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CB9Lu3Sq.js → extension-debug-page-DxIGAO23.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-BzjrVAUR.js → extension-iframe-host-63KpX6IP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DigziAgd.js → extension-marketplace-api-yXNUkQDA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DUa9MeaZ.js → extension-page-C811A_Ww.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-301x0rh-.js → extension-provider-C4jLFIgh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CP9ciZUI.js → extension-settings-page-WJSw5MT0.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-BaMGmCbw.js → file-preview-surface-zE9AcaHM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BD4Bf8uu.js → gateway-config-swr-D6cc6W6E.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CSd9VB7Z.js → gateway-realtime-BSRNLciy.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BFeFfApQ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CIUCTKYR.js → gateway-restart-Unun5hRL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CCqF1uZv.js → gateway-settings-DP-DV-e5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BsU5k8oi.js → gateway-startup-retry-C8g666Ja.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-asOZQeM8.js → global-defaults-api-BObi-1ww.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Bb_RC1O9.js → home-page-CIcs7Mzy.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-CdwYgzhU.js → image-generation-api-C2SqYNyD.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CVnoGUyp.js → imports-page-C8ezUkOJ.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BmUSsdwn.js → index-D1_PUrJf.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-DXVOHMhS.js → install-connector-dialog-Cn4nRSyt.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BCl90SrD.js → keyboard-shortcuts-settings-BRaY4-wA.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CcJc9xLJ.js → local-app-workbench-page-BZtVcjF3.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CdAKoWfg.js → local-apps-page-MqP4EnJm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-nRGeybku.js → local-session-drafts-DTq9776a.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-B7y-RVe8.js → locale-store-B6OrWgY1.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-McbSQwJI.js → logs-page-hkHBjblX.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BIR0BwNV.js → management-settings-DoX4eTM3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DFHa8rUg.js → markdown-view-DrhYZSmg.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Dwx4TuIr.js → mcp-conversation-setup-page-BEp5E6TD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BzzLV7wW.js → media-plugins-D987i9Gc.js} +1 -1
- package/dist/gateway/static/root/assets/messages-jwdBhfL9.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-YsCHu1Gn.js → model-selector-DXm4NS1_.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BUapaPTN.js → models-hub-cache-BLcha5rx.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-CJ-dPovd.js → note-detail-panel-Cl851ivY.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DGYRJS03.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-ulup1oFS.js → notes-api-Ddsf7FVg.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BaFNplIr.js → notes-page-DSwA1MU1.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DINa08-z.js → oauth-api-CMmu4DzH.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-C0PVEHC2.js → oauth-provider-connect-BkhnftBq.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CGfR0dsc.js → page-context-capture-button-urhQBRaN.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-DhRNxc0v.js → page-context-draft-BuNUerth.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CEn_kPsn.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-DiVFO2Aw.js → personal-avatar-B49ueeZO.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Cvd-v9kT.js → personal-page-f05ceuFn.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-Ds4ntiqu.js → personal-settings-panel-DLQxzPYr.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-B3R6L5Qu.js → phone-dependencies-card-DjmC1Z5j.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-BieYnAJ5.js → phone-model-connection-BRjHSgYn.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-Bkex4Sre.js → phone-model-picker-DgIiWLhR.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-D8PuvEuJ.js → phone-settings-page-DCZGCL_z.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-Cmes9gQ4.js → phone-workspace-store-DbqktZbO.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-DblFhnuC.js → plugin-details-dialog-D4tGKip4.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-D2-QfMN5.js → preference-select-fields-BZWqG7pu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BzY3z8zu.js → product-automation-feedback-DDQUsag7.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BKw6H0Mn.js → product-open-page-BkRP_HmA.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-VcvxaO2S.js → product-preview-content-o2Y3VNE7.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-Ym6bomTW.js → product-preview-modal-7Ohx-7OR.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-CFbXWvcd.js → project-detail-page-B2RsSHya.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-CrSkrJnM.js → project-understanding-BIMouiYX.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Cp91_KzA.js → projects-page-C9R5u3tF.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-CBSC3jdu.js → providers-api-BOCkRZ7X.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DBHAGKZj.js → recording-upload-C6muEHEO.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-QZEjziDq.js → registry-api-Bl2guMRg.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BdXxFQfH.js → remote-access-hub-BceSMbCs.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-BTNhcOHF.js → resource-unavailable-CUNbPkdj.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-C-VRKwB1.js → route-preload-C1BKDjnu.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-BDTUD8Rj.js → runtime-tools-api-LopLjgvu.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CYEzIrDf.js → runtime-tools-settings-panel-9HIPerDP.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CfeYH6lK.js → service-recommendation-list-CoMI6MB1.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DVXLCZX2.js → session-api-Bfmlmn9F.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-X4UHOjjO.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-C2CH-55n.js → sessions-page-BT0GdXdS.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dk9c-Z5e.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BmrbHgQa.js → settings-advanced-section-CEorDLUp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-Bk_hzwPK.js → settings-mode-store-C2LZqBES.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B6vrcc6f.js → settings-page-C_Np_6qZ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BLKI3_9N.js → settings-page-header-BAN34UQi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BqBVrkC9.js → settings-page-layout-B5TVFBV2.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-BDPte58u.js → setup-interaction-page-BYvTJW3_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DEefuWo3.js → setup-status-panel-UY2dH-sK.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C2LyeNzj.js → share-link-dialog-BMcXyzr2.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BFwEr7Ws.js → share-preview-page-UQ6eUM2_.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CTFkLQxq.js → shares-api-DOeDN6Tm.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CpK3yhtc.js → shares-settings-W8XhuAoL.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-DpicfA6o.js → skill-api-Do_c0d9n.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B8fegRLZ.js → skill-list-api-DpHaXI2l.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-VmC8ySUy.js → skill-reload-api-DDRd9IJ2.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-BIWXS6Ki.js → skills-page-CaeJVKhO.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BmoA92oX.js → system-settings-panel-DYWlWPJL.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CC3Rzqq9.js → task-detail-page-De0qD7xw.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-BV-6hBVU.js → task-result-evidence-CICR5K1t.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BGdKE9hU.js → terminal-panel-store-BbWUcQe7.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Dvv79Wb2.js → theme-store-TkG5mo0p.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-B4uA4Pnz.js → tracing-settings-page-CYXEy4EG.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BurZtvqx.js → tunnel-api-DquDm6U2.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-C1cLL8zq.js → understanding-activity-store-Ot3wZ3oQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-C3Lr_pjY.js → understanding-refresh-store-C5KYFMaC.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C91ZzLm9.js → usage-page-1xFO4smo.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-zkzRuUtx.js → use-autosave-HL8XRNR8.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-CoiQAgjo.js → use-composer-attachments-XRlQBdNF.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-DFzy6iVy.js → use-file-preview-expanded-CW956CXS.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-BB10h9ED.js → use-personal-profile-202s6tJt.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-sF5DcONt.js → use-workspace-tree-CjydkmH1.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-WFnD5utO.js → user-model-page-OGPXx3pe.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bqa4PeZx.js → voice-api-key-field-CxFu4MEA.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-LNO2xXHk.js → voice-config-api-MHe5Pn-A.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-AzfhxBX7.js → voice-input-shortcut-events-B9xc1oK8.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-Cb8i6dLb.js → voice-transcribe-api-CVEcB6Pe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CdQUiV-a.js → work-discovery-overlay-C-JoAg2D.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-HcUloXxf.js → work-discovery-page-B5Kx29Ru.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-Dv1HUipe.js → working-directory-picker-modal-DGp9cNzH.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Am2ee4R6.js → workspace-api-HBXn8pL9.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-msZa42fU.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-z5Q00v92.js → workspace-file-preview-dialog-3cpwSG2w.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-4ONYaGy0.js → workspace-open-location-menu-D0VOFvuP.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DimGN59n.js → xopc-cloud-account-card-BkdW2p3v.js} +1 -1
- package/dist/gateway/static/root/index.html +78 -78
- package/dist/package.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/phone/adb-driver.js +2 -2
- package/dist/src/phone/model-adapter.d.ts +2 -0
- package/dist/src/phone/model-adapter.js +10 -3
- package/dist/src/phone/reliability.js +24 -2
- package/dist/src/phone/runtime.js +6 -1
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/session/client-history.d.ts +2 -0
- package/dist/src/session/client-history.js +3 -0
- package/dist/src/session/compact-history.js +1 -0
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bxkv62qs.js +0 -1
- package/dist/gateway/static/root/assets/messages-DYDkJvXj.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-ClPkeHe5.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-CoKMiYoi.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-DjRWxXJG.js +0 -23
- package/dist/gateway/static/root/assets/settings-advanced-gate-BMHe9uwy.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CqHcVFhS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{m as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-B7y-RVe8.js";import{t as c}from"./messages-DYDkJvXj.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./service-recommendation-list-CfeYH6lK.js";import{t as d}from"./calendar-days-hw_Y-g-s.js";import{t as f}from"./check-DUBLcKHA.js";import{t as p}from"./chevron-down-ccbiQQz_.js";import{t as m}from"./chevron-right-BweFrslA.js";import{i as h,t as g}from"./working-directory-picker-modal-Dv1HUipe.js";import{t as _}from"./circle-check-C23XjkUj.js";import{t as ee}from"./clock-3-DnrAnuyZ.js";import{t as v}from"./database-CjjeZfRG.js";import{a as te,c as ne,d as re,f as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k}from"./understanding-activity-store-C1cLL8zq.js";import{t as A}from"./file-text-D12HbeVy.js";import{t as j}from"./folder-open-CyzJ19I9.js";import{t as M}from"./git-branch-Dh9uxTot.js";import{t as N}from"./list-todo-CTVRto8O.js";import{t as P}from"./loader-circle-CifKLtgG.js";import{t as F}from"./messages-square-BckAJrEW.js";import{n as I,s as L,t as R}from"./install-connector-dialog-DXVOHMhS.js";import{t as z}from"./plug-zap-L8NMe3Sv.js";import{t as B}from"./plus-Q2yW6OE7.js";import{t as V}from"./shield-check-BU58siTV.js";import{t as ie}from"./sparkles-DHlfQFAF.js";import{t as ae}from"./x-B_N4OPjy.js";import{t as H}from"./cn-0WouolD0.js";import{t as oe}from"./skeleton-BI5TyibZ.js";import{t as U}from"./button-Cc4hUNTt.js";import{a as se,r as ce}from"./connectors-api-B07yoCzk.js";import{t as le}from"./loopi-CNtmi9FU.js";import{t as ue}from"./use-directory-picker-C4p7AgWY.js";var W=l(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),G=e(n(),1),K=new Set([`completed`,`failed`,`canceled`]);function de(){return new Promise(e=>window.setTimeout(e,1200))}async function fe(e,t){let n=[],r=t.wait??de;for(let i=0;i<e.length&&!t.shouldStop?.();i+=1){let a=e[i];if(a)try{await t.grantDirectory(a.rootPath);let o=await t.startRun(a.rootPath);for(t.onRun(o,i,e.length);!K.has(o.status)&&!t.shouldStop?.();)await r(),o=await t.fetchRun(o.id),t.onRun(o,i,e.length);if(n.push(o),o.status===`canceled`||t.shouldStop?.())break}catch(e){if(t.onError?.(e,a,i),t.shouldStop?.())break}}return n}var pe=r();function q(e,t){let n=e.result?.conversationStarter?.trim();if(n)return n;let r=e.result?.suggestions.find(t=>t.id===e.result?.primarySuggestionId)??e.result?.suggestions[0];if(r?.actionPrompt.trim())return r.actionPrompt.trim();let i=e.rootPath.split(/[\\/]/).filter(Boolean).at(-1)??e.rootPath;return t===`zh`?`请先结合 ${i} 当前目录和最近变更,帮我说明这个项目在做什么、现在最值得关注什么,以及建议我下一步从哪里开始。`:`Help me understand ${i}: explain what this project is doing, what matters most right now, and where I should start next.`}var J=i(),me={zh:{eyebrow:`当前理解`,summaryTitle:`我理解的是这样`,summaryQuestion:`可以继续,也可以随时修改。`,matches:`准确,继续`,adjust:`修改`,why:`查看依据`,evidenceHint:`这些内容只用于本次判断。`,current:`当前`,ongoing:`持续`,longTerm:`长期`,correctionTitle:`告诉我正确的重点`,correctionPlaceholder:`你现在真正想推进什么?`,continueWithCorrection:`按此继续`,starterTitle:`从这里开始`,starterHint:`可以修改后直接开始对话。`,startConversation:`进入对话`,cancel:`取消`},en:{eyebrow:`Current understanding`,summaryTitle:`Here’s how I understand it`,summaryQuestion:`Continue, or adjust this anytime.`,matches:`Accurate, continue`,adjust:`Edit`,why:`View sources`,evidenceHint:`These sources are only used for this assessment.`,current:`Current`,ongoing:`Ongoing`,longTerm:`Long term`,correctionTitle:`Tell me the right focus`,correctionPlaceholder:`What do you want to move forward right now?`,continueWithCorrection:`Continue`,starterTitle:`Start here`,starterHint:`Edit this if needed, then start the conversation.`,startConversation:`Start conversation`,cancel:`Cancel`}};function he(e){let t=(0,pe.c)(84),{run:n,language:r,busy:i,error:a,onFinish:o,onStartConversation:s}=e,c=me[r],l=n.result?.lowConfidence===!0,u;t[0]!==r||t[1]!==n?(u=q(n,r),t[0]=r,t[1]=n,t[2]=u):u=t[2];let d=u,[f,m]=(0,G.useState)(l),[h,g]=(0,G.useState)(l?d:``),[_,ee]=(0,G.useState)(!1),[v,te]=(0,G.useState)(!1),[ne,re]=(0,G.useState)(!1),y,b,x,S,C,w,T,E,D,O,k,A;if(t[3]!==i||t[4]!==v||t[5]!==h||t[6]!==f||t[7]!==a||t[8]!==ne||t[9]!==o||t[10]!==s||t[11]!==n.result||t[12]!==c.current||t[13]!==c.evidenceHint||t[14]!==c.eyebrow||t[15]!==c.longTerm||t[16]!==c.ongoing||t[17]!==c.summaryTitle||t[18]!==c.why){let e=n.result?.workThreads?.slice(0,3)??[],r=n.result?.suggestions.find(e=>e.id===n.result?.primarySuggestionId)??n.result?.suggestions[0],l;t[31]!==h||t[32]!==o?(l=async e=>{ee(!0),await o(e,e===`corrected`?h.trim():void 0)||ee(!1)},t[31]=h,t[32]=o,t[33]=l):l=t[33],y=l;let u;t[34]!==h||t[35]!==s?(u=async()=>{let e=h.trim();e&&(te(!0),await s(e,`corrected`)||te(!1))},t[34]=h,t[35]=s,t[36]=u):u=t[36],b=u,x=`xopc-understanding-reveal flex min-h-full flex-1 flex-col`,S=`polite`,D=`xopc-reveal-scene mx-auto flex w-full max-w-[40rem] flex-1 flex-col justify-center py-6 text-center sm:py-10`;let d=a?`care`:i||v?`work`:f?`listen`:`decision`;t[37]===d?O=t[38]:(O=(0,J.jsx)(le,{className:`mx-auto mb-3 size-28`,mood:d}),t[37]=d,t[38]=O),t[39]===c.eyebrow?k=t[40]:(k=(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-accent-fg`,children:c.eyebrow}),t[39]=c.eyebrow,t[40]=k),t[41]===c.summaryTitle?A=t[42]:(A=(0,J.jsx)(`h1`,{className:`mx-auto mt-4 max-w-[34rem] text-3xl font-semibold tracking-[-0.035em] text-fg sm:text-[2.25rem]`,children:c.summaryTitle}),t[41]=c.summaryTitle,t[42]=A),C=`xopc-understanding-hero-card relative mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel px-6 py-7 text-left shadow-surface sm:px-8`,t[43]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,J.jsx)(`div`,{className:`mb-5 flex size-9 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,"aria-hidden":!0,children:(0,J.jsx)(ie,{className:`size-[1.125rem]`})}),t[43]=w):w=t[43];let m=n.result?.projectSummary;t[44]===m?T=t[45]:(T=(0,J.jsx)(`p`,{className:`relative text-lg font-medium leading-8 text-fg sm:text-xl`,children:m}),t[44]=m,t[45]=T),E=n.result?.currentState||e.length||r?.evidence.length?(0,J.jsxs)(`div`,{className:`relative mt-5 border-t border-edge-subtle pt-4`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 text-xs font-medium text-fg-muted hover:text-fg`,onClick:()=>re(_e),children:[c.why,(0,J.jsx)(p,{className:H(`size-3.5 transition-transform`,ne&&`rotate-180`)})]}),ne?(0,J.jsxs)(`div`,{className:`mt-3 space-y-3 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(`p`,{className:`text-fg-subtle`,children:c.evidenceHint}),n.result?.currentState?(0,J.jsx)(`p`,{children:n.result.currentState}):null,e.length?(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,J.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:e.title}),` · `,e.horizon===`current`?c.current:e.horizon===`ongoing`?c.ongoing:c.longTerm]},e.id))}):null,r?.evidence.slice(0,3).map(ge)]}):null]}):null,t[3]=i,t[4]=v,t[5]=h,t[6]=f,t[7]=a,t[8]=ne,t[9]=o,t[10]=s,t[11]=n.result,t[12]=c.current,t[13]=c.evidenceHint,t[14]=c.eyebrow,t[15]=c.longTerm,t[16]=c.ongoing,t[17]=c.summaryTitle,t[18]=c.why,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A}else y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30];let j;t[46]!==C||t[47]!==w||t[48]!==T||t[49]!==E?(j=(0,J.jsxs)(`div`,{className:C,children:[w,T,E]}),t[46]=C,t[47]=w,t[48]=T,t[49]=E,t[50]=j):j=t[50];let M;t[51]!==y||t[52]!==i||t[53]!==v||t[54]!==h||t[55]!==f||t[56]!==l||t[57]!==b||t[58]!==_||t[59]!==c.adjust||t[60]!==c.cancel||t[61]!==c.continueWithCorrection||t[62]!==c.correctionPlaceholder||t[63]!==c.correctionTitle||t[64]!==c.matches||t[65]!==c.startConversation||t[66]!==c.starterHint||t[67]!==c.starterTitle||t[68]!==c.summaryQuestion?(M=f?(0,J.jsxs)(`div`,{className:`xopc-reveal-calibration mx-auto mt-7 w-full max-w-xl rounded-xl border border-edge bg-surface-panel p-5 text-left shadow-surface`,children:[(0,J.jsx)(`label`,{className:`text-sm font-semibold text-fg`,htmlFor:`understanding-correction`,children:l?c.starterTitle:c.correctionTitle}),l?(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-fg-muted`,children:c.starterHint}):null,(0,J.jsx)(`textarea`,{id:`understanding-correction`,value:h,onChange:e=>g(e.target.value),placeholder:c.correctionPlaceholder,className:`mt-3 min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[l?null:(0,J.jsx)(U,{variant:`ghost`,disabled:_,onClick:()=>m(!1),children:c.cancel}),(0,J.jsx)(U,{variant:`primary`,disabled:i||v||!h.trim(),onClick:()=>void b(),children:l?c.startConversation:c.continueWithCorrection})]})]}):(0,J.jsxs)(`div`,{className:`mx-auto mt-8 w-full max-w-sm`,children:[(0,J.jsx)(`p`,{className:`text-base font-medium text-fg`,children:c.summaryQuestion}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{className:`h-11 flex-1`,variant:`primary`,disabled:_,onClick:()=>void y(`confirmed`),children:c.matches}),(0,J.jsx)(U,{className:`h-11 flex-1`,variant:`secondary`,disabled:_,onClick:()=>m(!0),children:c.adjust})]})]}),t[51]=y,t[52]=i,t[53]=v,t[54]=h,t[55]=f,t[56]=l,t[57]=b,t[58]=_,t[59]=c.adjust,t[60]=c.cancel,t[61]=c.continueWithCorrection,t[62]=c.correctionPlaceholder,t[63]=c.correctionTitle,t[64]=c.matches,t[65]=c.startConversation,t[66]=c.starterHint,t[67]=c.starterTitle,t[68]=c.summaryQuestion,t[69]=M):M=t[69];let N;t[70]===a?N=t[71]:(N=a?(0,J.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:a}):null,t[70]=a,t[71]=N);let P;t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==D||t[76]!==O||t[77]!==k||t[78]!==A?(P=(0,J.jsxs)(`div`,{className:D,children:[O,k,A,j,M,N]}),t[72]=j,t[73]=M,t[74]=N,t[75]=D,t[76]=O,t[77]=k,t[78]=A,t[79]=P):P=t[79];let F;return t[80]!==x||t[81]!==S||t[82]!==P?(F=(0,J.jsx)(`section`,{className:x,"aria-live":S,children:P}),t[80]=x,t[81]=S,t[82]=P,t[83]=F):F=t[83],F}function ge(e,t){return(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`mt-0.5 size-3.5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{children:[e.path?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`code`,{className:`font-mono text-fg`,children:e.path}),`: `]}):null,e.observation]})]},`${t}-${e.path??e.observation}`)}function _e(e){return!e}var ve={folder:j,file:A,recent:S,git:M,calendar:d,task:N,note:W,mail:T,message:F,service:z,data:v};function ye(e){let t=(0,pe.c)(28),{signals:n,ariaLabel:r,centerLabel:i}=e,a,o,s,c,l,u,d,f;if(t[0]!==r||t[1]!==i||t[2]!==n){let e=n.slice(0,3);a=Math.max(0,n.length-e.length),c=`xopc-source-convergence mx-auto mt-9 w-full max-w-[34rem] overflow-hidden rounded-xl border border-edge bg-surface-panel px-5 py-6 shadow-surface sm:px-6`,l=`img`,u=r;let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,J.jsx)(le,{className:`size-24`,mood:`work`}),t[11]=p):p=t[11],t[12]===i?d=t[13]:(d=(0,J.jsxs)(`div`,{className:`flex flex-col items-center text-center`,"aria-hidden":!0,children:[p,(0,J.jsx)(`span`,{className:`mt-3 text-[11px] font-semibold tracking-[0.16em] text-fg-muted`,children:i})]}),t[12]=i,t[13]=d),t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(`div`,{className:`mt-5 h-1 overflow-hidden rounded-full bg-surface-hover`,"aria-hidden":!0,children:(0,J.jsx)(`span`,{className:`xopc-source-convergence-progress block h-full w-2/5 rounded-full bg-accent`})}),t[14]=f):f=t[14],o=`mt-5 divide-y divide-edge-subtle border-y border-edge-subtle`,s=e.map(be),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10];let p;t[15]!==o||t[16]!==s?(p=(0,J.jsx)(`div`,{className:o,children:s}),t[15]=o,t[16]=s,t[17]=p):p=t[17];let m;t[18]===a?m=t[19]:(m=a>0?(0,J.jsxs)(`p`,{className:`mt-3 text-center text-xs text-fg-muted`,"aria-hidden":!0,children:[`+`,a]}):null,t[18]=a,t[19]=m);let h;return t[20]!==c||t[21]!==l||t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==m?(h=(0,J.jsxs)(`div`,{className:c,role:l,"aria-label":u,children:[d,f,p,m]}),t[20]=c,t[21]=l,t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=m,t[27]=h):h=t[27],h}function be(e){let t=ve[e.kind];return(0,J.jsxs)(`div`,{className:`flex min-h-12 items-center gap-3 py-2.5 text-left`,"aria-hidden":!0,children:[(0,J.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-hover text-fg-muted`,children:(0,J.jsx)(t,{className:`size-4`})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,title:e.detail,children:[(0,J.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.label}),e.meta?(0,J.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:e.meta}):null]}),(0,J.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`})]},e.id)}var xe=[`gmail`,`googlecalendar`,`googledrive`,`github`,`linear`];function Y({toolkit:e,displayName:t,description:n,category:r,mode:i,bootstrapWindowDays:a,logoFileName:o=e}){return{id:`composio-${e}`,version:`sessions-v1`,displayName:t,description:n,category:r,kind:`composio`,source:`registry`,capabilities:[`tools`,`auth.oauth`,`events`,`context`,`memory_source`],benefits:[`understand`,`act`],understanding:{mode:i,bootstrapWindowDays:a,readOnly:!0},tags:[`composio`,e,`verified`],branding:{logoUrl:`/connector-icons/${o}.svg`,source:`builtin`},verificationLevel:`verified`,auth:{mode:`oauth`,provider:`composio`},setup:{},runtime:{type:`composio`,toolkit:e,role:`toolkit`},integrationStrategy:{lane:`composio`,workload:`long_tail`,preferred:!0}}}var Se=[Y({toolkit:`gmail`,displayName:`Gmail`,description:`Find and understand recent email, then draft or send with your approval.`,category:`automation`,mode:`activity`,bootstrapWindowDays:30}),Y({toolkit:`googlecalendar`,displayName:`Google Calendar`,description:`Understand your schedule and work with approved calendar events.`,category:`automation`,mode:`activity`,bootstrapWindowDays:90,logoFileName:`google-calendar`}),Y({toolkit:`googledrive`,displayName:`Google Drive`,description:`Search and understand approved files in Google Drive.`,category:`data`,mode:`inventory`,bootstrapWindowDays:90,logoFileName:`google-drive`}),Y({toolkit:`github`,displayName:`GitHub`,description:`Understand repositories, issues, pull requests, and reviews.`,category:`code`,mode:`activity`,bootstrapWindowDays:90}),Y({toolkit:`linear`,displayName:`Linear`,description:`Understand and work with Linear issues and projects.`,category:`code`,mode:`activity`,bootstrapWindowDays:60})];function Ce(e){return e.runtime.type===`composio`&&e.runtime.role===`toolkit`?e.runtime.toolkit.toLocaleLowerCase():``}function we(e){let t=new Map(xe.map((e,t)=>[e,t]));return e.filter(e=>e.understanding!=null&&Ce(e)).sort((e,n)=>(t.get(Ce(e))??2**53-1)-(t.get(Ce(n))??2**53-1)||e.displayName.localeCompare(n.displayName))}function Te(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t)n.set(e.id,e);return we([...n.values()])}var Ee=2500;function De(e){return!!(e?.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`))}function Oe(e){return e===`gmail`?`mail`:e===`googlecalendar`?`calendar`:e===`googledrive`?`data`:e===`github`?`git`:e===`linear`?`task`:`service`}function ke(e){let t=(0,pe.c)(59),{busy:n,onBack:r,onContinue:i,onSkip:a,onConnectedSignalsChange:o}=e,l=s(Pe),d=c(l),f=d.onboarding.workDiscovery,m=d.connectorsSettings,[g,ee]=(0,G.useState)(Ne),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[0]=v):v=t[0];let[te,ne]=(0,G.useState)(v),[re,y]=(0,G.useState)(!0),[b,x]=(0,G.useState)(null),[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(null),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=async()=>{let e=await se();return ne(e),e},t[1]=E):E=t[1];let D=E,O,k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{let e=!1,t=window.setTimeout(()=>{e||y(!1)},Ee);return se().then(t=>{e||ne(t)}).catch(t=>{e||x(t instanceof Error?t.message:String(t))}).finally(()=>{e||y(!1),window.clearTimeout(t)}),ce({page:1,pageSize:24,verification:`verified`}).then(t=>{e||ee(Te(Se,t.connectors))}).catch(Me),()=>{e=!0,window.clearTimeout(t)}},k=[],t[2]=O,t[3]=k):(O=t[2],k=t[3]),(0,G.useEffect)(O,k);let A;t[4]===te?A=t[5]:(A=new Map(te.map(je)),t[4]=te,t[5]=A);let j=A,M;if(t[6]!==g||t[7]!==j){let e;t[9]===j?e=t[10]:(e=e=>{if(!De(j.get(e.id)))return[];let t=Ce(e);return[{id:e.id,label:e.displayName,kind:Oe(t)}]},t[9]=j,t[10]=e),M=g.flatMap(e),t[6]=g,t[7]=j,t[8]=M}else M=t[8];let N=M,F,z;t[11]!==N||t[12]!==o?(F=()=>{o(N)},z=[N,o],t[11]=N,t[12]=o,t[13]=F,t[14]=z):(F=t[13],z=t[14]),(0,G.useEffect)(F,z);let V;t[15]!==g||t[16]!==S?(V=S?g:g.slice(0,3),t[15]=g,t[16]=S,t[17]=V):V=t[17];let ie=V,ae=N.length,H;t[18]!==g.length||t[19]!==m||t[20]!==f.connected||t[21]!==f.noWorkServices||t[22]!==f.showFewerServices||t[23]!==f.showMoreServices||t[24]!==S||t[25]!==j||t[26]!==re||t[27]!==l||t[28]!==D||t[29]!==C||t[30]!==T||t[31]!==ie?(H=l===`zh`?(0,J.jsx)(u,{onChanged:async()=>{await D()}}):(0,J.jsxs)(J.Fragment,{children:[ie.length?(0,J.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-base/55`,children:ie.map(e=>{let t=De(j.get(e.id));return(0,J.jsxs)(`article`,{className:`flex min-h-[4.75rem] items-center gap-3 px-3 py-3 sm:px-4`,children:[(0,J.jsx)(I,{connector:e,size:`sm`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.displayName}),(0,J.jsx)(`p`,{className:`mt-1 line-clamp-1 text-xs text-fg-muted`,children:e.description})]}),t?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-success`,children:[(0,J.jsx)(_,{className:`size-4`}),f.connected]}):re?(0,J.jsx)(oe,{className:`h-8 w-[4.5rem] shrink-0 rounded-lg`,"aria-label":m.loading}):(0,J.jsxs)(U,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-3 text-xs`,onClick:()=>T(L(e)),children:[(0,J.jsx)(B,{className:`size-3.5`}),m.connect]})]},e.id)})}):(0,J.jsx)(`p`,{className:`rounded-xl border border-dashed border-edge px-4 py-8 text-center text-sm text-fg-muted`,children:f.noWorkServices}),g.length>3?(0,J.jsxs)(`button`,{type:`button`,className:`mx-auto mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>C(Ae),children:[S?(0,J.jsx)(h,{className:`size-3.5`}):(0,J.jsx)(p,{className:`size-3.5`}),S?f.showFewerServices:f.showMoreServices]}):null]}),t[18]=g.length,t[19]=m,t[20]=f.connected,t[21]=f.noWorkServices,t[22]=f.showFewerServices,t[23]=f.showMoreServices,t[24]=S,t[25]=j,t[26]=re,t[27]=l,t[28]=D,t[29]=C,t[30]=T,t[31]=ie,t[32]=H):H=t[32];let le;t[33]!==f.connectorLoadFailed||t[34]!==b?(le=b?(0,J.jsxs)(`p`,{className:`mt-3 text-center text-xs text-danger`,role:`alert`,children:[f.connectorLoadFailed,`: `,b]}):null,t[33]=f.connectorLoadFailed,t[34]=b,t[35]=le):le=t[35];let ue;t[36]===n?ue=t[37]:(ue=n?(0,J.jsx)(P,{className:`size-4 animate-spin`}):null,t[36]=n,t[37]=ue);let W;t[38]!==n||t[39]!==f.startUnderstanding||t[40]!==i||t[41]!==ue?(W=(0,J.jsxs)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:n,onClick:i,children:[ue,f.startUnderstanding]}),t[38]=n,t[39]=f.startUnderstanding,t[40]=i,t[41]=ue,t[42]=W):W=t[42];let K;t[43]!==n||t[44]!==f.back||t[45]!==r?(K=(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:n,onClick:r,children:f.back}),t[43]=n,t[44]=f.back,t[45]=r,t[46]=K):K=t[46];let de;t[47]!==W||t[48]!==K?(de=(0,J.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[W,K]}),t[47]=W,t[48]=K,t[49]=de):de=t[49];let fe;t[50]!==n||t[51]!==f.skipAndEnter||t[52]!==a?(fe=(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,disabled:n,onClick:a,children:f.skipAndEnter}),t[50]=n,t[51]=f.skipAndEnter,t[52]=a,t[53]=fe):fe=t[53];let q;return t[54]!==m||t[55]!==w||t[56]!==D||t[57]!==T?(q=w?(0,J.jsx)(R,{draft:w,onChange:T,onClose:()=>T(null),t:m,onInstalled:async()=>{await D(),T(null)}}):null,t[54]=m,t[55]=w,t[56]=D,t[57]=T,t[58]=q):q=t[58],(0,J.jsxs)(`section`,{className:`mx-auto flex w-full max-w-[42rem] flex-1 flex-col`,"aria-labelledby":`work-discovery-connectors-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:f.connectorStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-connectors-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:f.connectorStepTitle}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-[36rem] text-[0.95rem] leading-7 text-fg-muted`,children:f.connectorStepSubtitle})]}),(0,J.jsxs)(`div`,{className:`mt-7 rounded-xl border border-edge bg-surface-panel p-3 shadow-surface sm:p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pb-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:f.popularWorkServices}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:f.connectorsOptional})]}),ae?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 rounded-full bg-success-soft px-2.5 py-1 text-xs font-medium text-success`,children:[(0,J.jsx)(_,{className:`size-3.5`}),f.connectedCount.replace(`{{count}}`,String(ae))]}):null]}),H,le]}),de,fe,q]})}function Ae(e){return!e}function je(e){return[e.connectorId,e]}function Me(){}function Ne(){return we(Se)}function Pe(e){return e.language}var Fe=new Set([`local-recent-files`,`chromium-bookmarks`,`apple-notes`,`apple-mail`,`apple-calendar`,`apple-reminders`]);function Ie(e){return new Set(e.filter(e=>e.availability===`available`&&Fe.has(e.id)).map(e=>e.id))}var Le=t({WorkDiscoveryPage:()=>Ve}),Re=[`folder_structure`,`recent_progress`,`next_steps`];function X(e){return e instanceof Error?e.message:String(e)}function ze(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(Boolean).slice(-2).join(`/`)||e}function Be(e,t){return e.replace(`{{count}}`,String(t))}function Ve({embedded:e=!1,onRequestClose:t,onNavigateAway:n}={}){let r=s(e=>e.language),i=c(r).onboarding.workDiscovery,l=c(r).chat.workingDirectory,u=o(),[d]=a(),h=d.get(`new`)===`1`,[_,v]=(0,G.useState)(`loading`),[S,T]=(0,G.useState)(null),[M,N]=(0,G.useState)(null),[F,I]=(0,G.useState)(null),[L,R]=(0,G.useState)(!1),[z,B]=(0,G.useState)(null),[ie,se]=(0,G.useState)(!1),[ce,W]=(0,G.useState)([]),[K,de]=(0,G.useState)(()=>new Set),[pe,q]=(0,G.useState)([]),[me,ge]=(0,G.useState)(!1),[_e,ve]=(0,G.useState)({current:0,total:0}),[be,xe]=(0,G.useState)([]),[Y,Se]=(0,G.useState)(()=>new Set),[Ce,we]=(0,G.useState)([]),Te=(0,G.useRef)(!1),Ee={recent_documents:`recent`,calendar:`calendar`,tasks:`task`,notes:`note`,mail:`mail`,messages:`message`,code_activity:`git`,files:`file`},De=F?.snapshot?.projectKind??S?.projectKind,Oe=De===`coding`?i.codingProject:De===`general`?i.generalProject:De===`unknown`?i.unknownProject:null,Ae=(F?.snapshot?.files??[]).slice(0,4).map(e=>({id:`snapshot-file:${e.relativePath}`,label:ze(e.relativePath),kind:e.source===`git_change`?`recent`:`file`,meta:e.source===`git_change`?i.sourceSignals.changedFile:e.source===`document`?i.sourceSignals.contextFile:i.sourceSignals.structureFile,detail:e.relativePath})),je=F?.rootPath??S?.canonicalRootPath,Me=Ae.length===0?(S?.fingerprint.recentAreas??[]).slice(0,2).map(e=>({id:`recent-area:${e}`,label:e,kind:`recent`,meta:i.sourceSignals.recentArea,detail:e})):[],Ne=Ae.length===0?Me.length>0?Me:[{id:`project-files`,label:i.sourceSignals.projectFiles,kind:`file`,meta:i.sourceSignals.scanningFiles},{id:`recent-changes`,label:i.sourceSignals.recentChanges,kind:`recent`,meta:i.sourceSignals.checkingChanges}]:[],Pe=F?.snapshot?.sampledPathCount,Fe=[Oe,Pe==null?null:Be(i.sourceSignals.filesScanned,Pe)].filter(e=>!!e).join(` · `),Le=F?.snapshot?.branch??S?.fingerprint.branch,Ve=F?.snapshot?.changedPathCount??S?.fingerprint.changedFileCount,He=[{id:`work-folder`,label:je?ze(je):i.sourceSignals.workFolder,kind:`folder`,...Fe?{meta:Fe}:{},...je?{detail:je}:{}},...Ae,...Ne,{id:`git-state`,label:Le??i.sourceSignals.gitState,kind:`git`,...Ve==null?{}:{meta:Be(i.sourceSignals.changedFiles,Ve)},...Le?{detail:`Git · ${Le}`}:{}},...be.filter(e=>Y.has(e.id)).map(e=>({id:e.id,label:e.displayName,kind:Ee[e.category]??`data`})),...Ce],Ue=e=>{Se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};(0,G.useEffect)(()=>{let e=!1;return window.electronAPI?.understandingSources?.catalog().then(t=>{e||(xe(t),Se(Ie(t)))}),()=>{e=!0}},[]);let Z=(0,G.useCallback)(e=>{O.getState().updateDirectoryRun(e),I(e),e.status===`completed`?v(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`):e.status===`failed`||e.status===`canceled`?v(`error`):v(`running`)},[]),We=async()=>{R(!0),B(null);try{let e=await E();if(N(e.processingTarget),!e.candidates.length){B(i.noCandidates);return}W(e.candidates),de(new Set([e.candidates[0].rootPath])),v(`candidates`)}catch(e){B(X(e))}finally{R(!1)}},Ge=e=>{de(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ke=(0,G.useCallback)((e,t,n)=>{O.getState().updateDirectoryRun(e),I(e),ve({current:t+1,total:n}),q(n=>{let r=[...n];return r[t]=e,r}),v(`running`)},[]),qe=(0,G.useCallback)(e=>{q(t=>t.map(t=>t?.id===e.id?e:t))},[]),Je=async()=>{let e=ce.filter(e=>K.has(e.rootPath));if(!e.length)return;R(!0),B(null),q([]),ve({current:1,total:e.length}),ge(!0),Te.current=!1;let t=!1,n=M?.remoteModel?`remote_allowed`:`local_only`;try{let r=await fe(e,{grantDirectory:e=>D(e,n),startRun:re,fetchRun:w,shouldStop:()=>Te.current,onRun:(e,r,i)=>{Ke(e,r,i),t||(t=!0,O.getState().collectSources(e.id,[...Y],n))},onError:(t,n,r)=>{ve({current:r+1,total:e.length}),B(i.folderAnalysisFailed.replace(`{{folder}}`,n.displayName).replace(`{{error}}`,X(t)))}});if(Te.current)return;let a=r.find(e=>e.status===`completed`)??r.at(-1);a?Z(a):v(`candidates`)}catch(e){B(X(e)),v(`candidates`)}finally{ge(!1),R(!1)}},Q=ue({onPicked:(0,G.useCallback)(async e=>{R(!0),B(null);try{let t=await ne(e);T(t),N({provider:t.provider,remoteModel:t.remoteModel}),v(`consent`)}catch(e){B(X(e)),v(`intro`)}finally{R(!1)}},[])});(0,G.useEffect)(()=>{if(!h){let e=O.getState().directoryRun;if(e){Z(e);return}}let e=!1,n=window.setTimeout(()=>{e||v(`intro`)},4e3);return te().then(async({enabled:r,state:i})=>{if(!e){if(!r){window.clearTimeout(n),t?t():u(`/chat`,{replace:!0});return}if(!h&&i.activeRunId)try{let t=await w(i.activeRunId);e||(window.clearTimeout(n),Z(t));return}catch{}e||(window.clearTimeout(n),v(`intro`))}}).catch(t=>{window.clearTimeout(n),e||(B(X(t)),v(`intro`))}),()=>{e=!0,window.clearTimeout(n)}},[Z,u,t,h]),(0,G.useEffect)(()=>{if(!F||_!==`running`||me)return;let e=!1,t=async()=>{try{let t=await w(F.id);e||Z(t)}catch{}},n=window.setInterval(()=>void t(),1200),r=e=>{let n=e.detail;(!n?.runId||n.runId===F.id)&&t()};for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.addEventListener(e,r);return()=>{e=!0,window.clearInterval(n);for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.removeEventListener(e,r)}},[Z,me,_,F]);let Ye=async()=>{R(!0);try{await b()}finally{t?t():u(`/chat`,{replace:!0})}},Xe=async()=>{if(S){R(!0),B(null),q([]),ve({current:0,total:0});try{let e=S.remoteModel?`remote_allowed`:`local_only`;await D(S.canonicalRootPath,e);let t=await re(S.canonicalRootPath);Z(t),O.getState().collectSources(t.id,[...Y],e)}catch(e){B(X(e)),v(`consent`)}finally{R(!1)}}},Ze=(e,t,r=!1)=>{let i=new URLSearchParams;t&&i.set(`draft`,t),t&&r&&i.set(`autoSend`,`1`);let a=i.toString();n?.(),u(`/chat/${encodeURIComponent(e)}${a?`?${a}`:``}`)},Qe=e=>{I(e),se(!1),e.status===`completed`?v(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`):e.status===`failed`||e.status===`canceled`?v(`error`):v(`running`)},$e=async()=>{if(!F)return;Te.current=!0;let e=await C(F.id);Z(e)},et=()=>{n?.(),u(`/chat`)},tt=()=>{if(S){Xe();return}Je()},nt=()=>{v(S?`consent`:ce.length?`candidates`:`intro`)},rt=async(e,t)=>{if(!F)return;await k(F.id,e.id).catch(()=>{});let n=t?`${r===`zh`?`先帮我评估这个方向,不要修改文件:`:`First assess this direction without changing files:`}\n\n${e.actionPrompt}`:e.actionPrompt;Ze(F.conversationId,n)},it=async(e,t)=>{if(!F)return!1;R(!0),B(null);try{let n=await y(F.id,e,t);return I(n),qe(n),v(`recommendation`),!0}catch(e){return B(X(e)),!1}finally{R(!1)}},at=async(e,t)=>{if(!F)return!1;R(!0),B(null);try{let n=await y(F.id,t,t===`corrected`?e:void 0);return I(n),qe(n),Ze(F.conversationId,e,!0),!0}catch(e){return B(X(e)),!1}finally{R(!1)}},$=F?.result?.suggestions.find(e=>e.id===F.result?.primarySuggestionId)??F?.result?.suggestions[0],ot=F?.result?.suggestions.filter(e=>e.id!==$?.id)??[],st=e=>e===`command`?i.riskCommand:e===`file_write`?i.riskFileWrite:i.riskAnalysis,ct=pe.filter(e=>e?.status===`completed`),lt=e&&_===`candidates`,ut=ct.length>1?(0,J.jsxs)(`div`,{className:`mt-6 rounded-xl border border-edge bg-surface-panel p-2`,children:[(0,J.jsx)(`p`,{className:`px-2 pb-2 text-xs font-medium text-fg-muted`,children:i.analysisResults}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ct.map(e=>{let t=ce.find(t=>t.rootPath===e.rootPath)?.displayName??e.rootPath.split(/[\\/]/).filter(Boolean).at(-1)??e.rootPath;return(0,J.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-sm font-medium transition ${e.id===F?.id?`bg-accent text-on-accent`:`bg-surface-hover text-fg hover:bg-surface-active`}`,onClick:()=>Qe(e),children:t},e.id)})})]}):null;return(0,J.jsxs)(`div`,{className:e?`xopc-work-discovery-experience relative flex h-full min-h-0 flex-1 flex-col overflow-hidden`:`xopc-work-discovery-experience relative flex min-h-full flex-1 flex-col`,children:[(0,J.jsxs)(`main`,{className:e?`app-main-surface xopc-work-discovery-stage xopc-onboarding-scroll relative z-10 mx-auto my-3 flex min-h-0 w-[calc(100%_-_1.5rem)] ${_===`recognition`?`max-w-[58rem]`:`max-w-[46rem]`} flex-1 flex-col rounded-xl bg-surface-panel px-5 py-7 shadow-surface sm:my-4 sm:w-[calc(100%_-_2rem)] sm:px-8 sm:py-9 ${lt?`overflow-hidden`:`overflow-y-auto`}`:`app-main-surface mx-auto my-4 flex w-[calc(100%_-_2rem)] ${_===`recognition`?`max-w-[58rem]`:`max-w-[40rem]`} flex-1 flex-col rounded-xl bg-surface-panel px-5 py-10 shadow-surface sm:px-8 sm:py-16`,children:[_===`intro`?(0,J.jsx)(`div`,{className:H(`flex items-center justify-center`,e?`mb-7 sm:mb-9`:`mb-10`),children:(0,J.jsx)(le,{className:`size-28`,mood:`curious`})}):null,_===`loading`?(0,J.jsxs)(`section`,{className:`mx-auto flex min-h-[32rem] w-full max-w-md flex-1 flex-col items-center justify-center text-center`,"aria-busy":!0,"aria-label":i.loading,children:[(0,J.jsx)(oe,{className:`size-14 rounded-xl`}),(0,J.jsx)(oe,{className:`mt-7 h-5 w-44 rounded-full`}),(0,J.jsx)(oe,{className:`mt-3 h-3.5 w-64 max-w-full rounded-full`})]}):null,_===`intro`?(0,J.jsxs)(`section`,{className:`flex flex-1 flex-col text-center`,"aria-labelledby":`work-discovery-title`,children:[(0,J.jsxs)(`div`,{className:`mx-auto max-w-[36rem]`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.title}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-[34rem] text-[0.95rem] leading-7 text-fg-muted`,children:i.subtitle})]}),(0,J.jsxs)(`div`,{className:`mx-auto mt-9 w-full max-w-md`,children:[be.length?(0,J.jsxs)(`div`,{className:`mb-5 overflow-hidden rounded-xl border border-edge bg-surface-panel text-left shadow-surface`,children:[(0,J.jsxs)(`div`,{className:`px-4 py-3.5`,children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.localSourcesTitle}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:i.localSourcesSubtitle})]}),(0,J.jsx)(`div`,{className:`grid border-t border-edge-subtle sm:grid-cols-2`,children:be.map(e=>{let t=Y.has(e.id);return(0,J.jsxs)(`button`,{type:`button`,className:H(`flex min-h-12 items-center justify-between gap-3 border-b border-edge-subtle px-4 py-3 text-left text-sm transition-colors last:border-b-0 sm:[&:nth-last-child(-n+2)]:border-b-0 sm:[&:nth-child(odd)]:border-r`,t?`bg-accent-soft/55 text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-pressed":t,onClick:()=>Ue(e.id),children:[(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.displayName}),(0,J.jsx)(`span`,{className:H(`flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors`,t?`border-accent bg-accent text-on-accent`:`border-edge`),children:t?(0,J.jsx)(f,{className:`size-3`,"aria-hidden":!0}):null})]},e.id)})})]}):null,(0,J.jsxs)(U,{type:`button`,variant:`primary`,className:`h-12 w-full gap-2`,onClick:()=>void We(),disabled:L||Q.picking,children:[L?(0,J.jsx)(P,{className:`size-4 animate-spin`}):(0,J.jsx)(V,{className:`size-4`}),i.quickScan]}),(0,J.jsxs)(U,{type:`button`,variant:`secondary`,className:`mt-3 h-11 w-full gap-2`,onClick:Q.pick,disabled:L||Q.picking,children:[Q.picking?(0,J.jsx)(P,{className:`size-4 animate-spin`}):(0,J.jsx)(j,{className:`size-4`}),i.chooseFolderManually]}),(0,J.jsxs)(`div`,{className:`mt-4 flex items-start justify-center gap-2 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsx)(`span`,{children:i.quickScanNote})]}),z?(0,J.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:z}):null]}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-auto pt-10 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void Ye(),disabled:L,children:i.skip})]}):null,_===`candidates`?(0,J.jsxs)(`section`,{className:e?`flex h-full min-h-0 flex-col`:void 0,"aria-labelledby":`work-discovery-candidates-title`,children:[(0,J.jsxs)(`div`,{className:e?`shrink-0 text-center`:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-candidates-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.candidatesTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.candidatesSubtitle})]}),(0,J.jsx)(`div`,{className:e?`xopc-onboarding-scroll mt-5 min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain pr-1`:`mt-7 space-y-2`,children:ce.map((e,t)=>{let n=K.has(e.rootPath);return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":n,className:`flex w-full items-start gap-3 rounded-xl border p-4 text-left transition ${n?`border-accent bg-accent-soft/45`:`border-edge bg-surface-panel hover:border-edge-strong`}`,onClick:()=>Ge(e.rootPath),children:[(0,J.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md border ${n?`border-accent bg-accent text-on-accent`:`border-edge bg-surface-base text-transparent`}`,children:(0,J.jsx)(f,{className:`size-3.5`})}),(0,J.jsx)(j,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),t===0?(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[0.7rem] font-medium text-accent-fg`,children:i.recommendedCandidate}):null]}),(0,J.jsx)(`span`,{className:`mt-1 block truncate font-mono text-xs text-fg-muted`,children:e.rootPath}),(0,J.jsxs)(`span`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,J.jsx)(`span`,{children:e.projectKind===`coding`?i.codingProject:e.projectKind===`general`?i.generalProject:i.unknownProject}),e.branch?(0,J.jsx)(`span`,{children:i.branchValue.replace(`{{branch}}`,e.branch)}):null,e.changedFileCount>0?(0,J.jsx)(`span`,{children:i.changedFiles.replace(`{{count}}`,String(e.changedFileCount))}):null]})]})]},e.id)})}),(0,J.jsxs)(`div`,{className:e?`shrink-0 border-t border-edge-subtle pt-4`:void 0,children:[(0,J.jsxs)(`div`,{className:`${e?``:`mt-5 `}flex items-start gap-2 rounded-xl bg-surface-hover/70 px-4 py-3 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{children:[i.multiFolderPrivacyNote,` `,M?.remoteModel?i.providerDisclosure.replace(`{{provider}}`,M.provider):i.localDisclosure]})]}),z?(0,J.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:z}):null,(0,J.jsxs)(`div`,{className:`${e?`mt-4`:`mt-7`} flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:L||K.size===0,onClick:()=>v(`connectors`),children:i.continueToConnectors}),(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:L,onClick:Q.pick,children:i.chooseFolderManually})]}),(0,J.jsx)(`button`,{type:`button`,className:`${e?`mt-3`:`mt-6`} mx-auto block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>v(`intro`),children:i.back})]})]}):null,_===`consent`&&S?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-consent-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-consent-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.selectedTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.selectedSubtitle})]}),(0,J.jsxs)(`div`,{className:`mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-surface`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-edge-subtle px-4 py-3.5`,children:[(0,J.jsx)(j,{className:`size-5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:S.displayName}),(0,J.jsx)(`p`,{className:`truncate font-mono text-xs text-fg-muted`,children:S.canonicalRootPath})]}),(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:S.projectKind===`coding`?i.codingProject:S.projectKind===`general`?i.generalProject:i.unknownProject})]}),(0,J.jsxs)(`div`,{className:`grid gap-4 border-b border-edge-subtle bg-surface-base/35 p-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.localFingerprint}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:S.fingerprint.branch?i.branchValue.replace(`{{branch}}`,S.fingerprint.branch):i.noGitBranch})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.recentActivity}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:i.changedFiles.replace(`{{count}}`,String(S.fingerprint.changedFileCount))})]}),S.fingerprint.recentAreas.length>0?(0,J.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.recentAreas}),(0,J.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:S.fingerprint.recentAreas.map(e=>(0,J.jsx)(`code`,{className:`rounded-md bg-surface-hover px-2 py-1 text-xs text-fg`,children:e},e))})]}):null]}),(0,J.jsxs)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:[(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(A,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.willRead}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.willReadValue})]})]}),(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(ae,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.willIgnore}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.willIgnoreValue})]})]}),(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:S.remoteModel?i.providerDisclosure.replace(`{{provider}}`,S.provider):i.localDisclosure})]})]})]}),z?(0,J.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:z}):null,(0,J.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:L,onClick:()=>v(`connectors`),children:i.continueToConnectors}),(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:L,onClick:Q.pick,children:i.changeFolder})]}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void Ye(),children:i.skip})]}):null,_===`connectors`?(0,J.jsx)(ke,{busy:L,onBack:nt,onContinue:tt,onSkip:()=>void Ye(),onConnectedSignalsChange:we}):null,_===`running`&&F?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-running-title`,"aria-live":`polite`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.understandingStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-running-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.analyzingTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.analyzingSubtitle}),_e.total>1?(0,J.jsx)(`p`,{className:`mt-2 text-sm font-medium text-accent-fg`,children:i.analyzingFolderProgress.replace(`{{current}}`,String(_e.current)).replace(`{{total}}`,String(_e.total))}):null]}),(0,J.jsx)(ye,{signals:He,ariaLabel:i.sourceSignals.ariaLabel,centerLabel:i.sourceSignals.centerLabel}),(0,J.jsx)(`div`,{className:`xopc-understanding-progress mx-auto mt-6 grid max-w-[34rem] grid-cols-3 gap-2`,children:Re.map((e,t)=>{let n=Math.max(0,Re.indexOf(F.stage??`folder_structure`)),r=t<n,a=t===n;return(0,J.jsxs)(`div`,{className:`xopc-understanding-step min-w-0 text-left`,"data-active":a||void 0,"data-complete":r||void 0,children:[(0,J.jsx)(`span`,{className:H(`block h-1 rounded-full`,a||r?`bg-accent`:`bg-surface-hover`)}),(0,J.jsx)(`span`,{className:H(`mt-2 block text-[11px] leading-4`,a?`font-medium text-fg`:`text-fg-muted`),children:i.stages[e]})]},e)})}),(0,J.jsx)(`p`,{className:`mt-4 truncate text-center font-mono text-xs text-fg-muted`,children:F.rootPath}),(0,J.jsx)(`p`,{className:`mx-auto mt-4 max-w-lg text-center text-xs leading-5 text-fg-muted`,children:i.backgroundChoiceHint}),(0,J.jsxs)(`div`,{className:`mx-auto mt-5 flex max-w-md flex-col gap-3`,children:[(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 w-full`,onClick:et,children:i.continueInBackground}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto text-sm text-fg-muted hover:text-danger hover:underline`,onClick:()=>void $e(),children:i.cancelAnalysis})]})]}):null,_===`recognition`&&F?.result?(0,J.jsx)(he,{run:F,language:r,busy:L,error:z,onFinish:it,onStartConversation:at},F.id):null,_===`recommendation`&&F?.result&&$?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-recommendation-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.understandingConfirmed}),(0,J.jsx)(`h1`,{id:`work-discovery-recommendation-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:i.primaryRecommendationTitle})]}),ut,(0,J.jsx)(`article`,{className:`mt-7 rounded-xl border border-edge bg-surface-panel p-5 shadow-surface sm:p-7`,children:(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,J.jsx)(m,{className:`size-5`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:$.title}),(0,J.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:$.rationale}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-hover px-2.5 py-1 text-fg-muted`,children:[(0,J.jsx)(ee,{className:`size-3.5`}),i.estimatedMinutes.replace(`{{count}}`,String($.estimatedMinutes))]}),(0,J.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-fg-muted`,children:st($.risk)})]}),(0,J.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base px-4 py-3`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.expectedTask}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg`,children:$.expectedTask})]}),(0,J.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,J.jsx)(U,{variant:`primary`,className:`h-10 px-4`,onClick:()=>void rt($,!1),children:i.startRecommendedAction}),(0,J.jsx)(U,{className:`h-10 px-4`,variant:`secondary`,onClick:()=>void rt($,!0),children:i.explainFirst})]})]})]})}),ot.length>0?(0,J.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between py-2 text-sm font-medium text-fg-muted hover:text-fg`,onClick:()=>se(e=>!e),children:[i.otherDirections,(0,J.jsx)(p,{className:`size-4 transition-transform ${ie?`rotate-180`:``}`})]}),ie?(0,J.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle rounded-xl border border-edge bg-surface-panel px-4`,children:ot.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-3 py-4 text-left`,onClick:()=>void rt(e,!0),children:[(0,J.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title}),(0,J.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e.expectedTask})]})]},e.id))}):null]}):null,(0,J.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-3`,children:[(0,J.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Ze(F.conversationId),children:i.doSomethingElse}),(0,J.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>v(`recognition`),children:i.correctUnderstanding})]})]}):null,_===`error`&&F?(0,J.jsxs)(`section`,{className:`text-center`,"aria-labelledby":`work-discovery-error-title`,children:[(0,J.jsx)(`div`,{className:`mx-auto flex size-11 items-center justify-center rounded-xl bg-danger-soft text-danger`,children:(0,J.jsx)(ae,{className:`size-5`})}),(0,J.jsx)(`h1`,{id:`work-discovery-error-title`,className:`mt-5 text-2xl font-semibold tracking-tight text-fg`,children:i.errorTitle}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-lg text-sm leading-6 text-fg-muted`,children:F.errorMessage}),(0,J.jsxs)(`div`,{className:`mx-auto mt-7 flex max-w-md flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{variant:`primary`,className:`h-11 flex-1`,onClick:()=>void x(F.id).then(Z),children:i.retry}),(0,J.jsx)(U,{variant:`secondary`,className:`h-11 flex-1`,onClick:()=>{I(null),T(null),v(`intro`)},children:i.chooseDifferent})]}),(0,J.jsx)(`button`,{type:`button`,className:`mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Ze(F.conversationId),children:i.openConversation})]}):null]},_),Q.hasNativePicker?null:(0,J.jsx)(g,{open:Q.modalOpen,onOpenChange:Q.setModalOpen,initialAbsolutePath:S?.canonicalRootPath,onConfirm:Q.confirmPick,wd:l})]})}export{Le as n,W as r,Ve as t};
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{m as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-B6OrWgY1.js";import{t as c}from"./messages-jwdBhfL9.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./service-recommendation-list-CoMI6MB1.js";import{t as d}from"./calendar-days-hw_Y-g-s.js";import{t as f}from"./check-DUBLcKHA.js";import{t as p}from"./chevron-down-ccbiQQz_.js";import{t as m}from"./chevron-right-BweFrslA.js";import{i as h,t as g}from"./working-directory-picker-modal-DGp9cNzH.js";import{t as _}from"./circle-check-C23XjkUj.js";import{t as ee}from"./clock-3-DnrAnuyZ.js";import{t as v}from"./database-CjjeZfRG.js";import{a as te,c as ne,d as re,f as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k}from"./understanding-activity-store-Ot3wZ3oQ.js";import{t as A}from"./file-text-D12HbeVy.js";import{t as j}from"./folder-open-CyzJ19I9.js";import{t as M}from"./git-branch-Dh9uxTot.js";import{t as N}from"./list-todo-CTVRto8O.js";import{t as P}from"./loader-circle-CifKLtgG.js";import{t as F}from"./messages-square-BckAJrEW.js";import{n as I,s as L,t as R}from"./install-connector-dialog-Cn4nRSyt.js";import{t as z}from"./plug-zap-L8NMe3Sv.js";import{t as B}from"./plus-Q2yW6OE7.js";import{t as V}from"./shield-check-BU58siTV.js";import{t as ie}from"./sparkles-DHlfQFAF.js";import{t as ae}from"./x-B_N4OPjy.js";import{t as H}from"./cn-0WouolD0.js";import{t as oe}from"./skeleton-BI5TyibZ.js";import{t as U}from"./button-Cc4hUNTt.js";import{a as se,r as ce}from"./connectors-api-DtvB9Cjm.js";import{t as le}from"./loopi-CNtmi9FU.js";import{t as ue}from"./use-directory-picker-C4p7AgWY.js";var W=l(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),G=e(n(),1),K=new Set([`completed`,`failed`,`canceled`]);function de(){return new Promise(e=>window.setTimeout(e,1200))}async function fe(e,t){let n=[],r=t.wait??de;for(let i=0;i<e.length&&!t.shouldStop?.();i+=1){let a=e[i];if(a)try{await t.grantDirectory(a.rootPath);let o=await t.startRun(a.rootPath);for(t.onRun(o,i,e.length);!K.has(o.status)&&!t.shouldStop?.();)await r(),o=await t.fetchRun(o.id),t.onRun(o,i,e.length);if(n.push(o),o.status===`canceled`||t.shouldStop?.())break}catch(e){if(t.onError?.(e,a,i),t.shouldStop?.())break}}return n}var pe=r();function q(e,t){let n=e.result?.conversationStarter?.trim();if(n)return n;let r=e.result?.suggestions.find(t=>t.id===e.result?.primarySuggestionId)??e.result?.suggestions[0];if(r?.actionPrompt.trim())return r.actionPrompt.trim();let i=e.rootPath.split(/[\\/]/).filter(Boolean).at(-1)??e.rootPath;return t===`zh`?`请先结合 ${i} 当前目录和最近变更,帮我说明这个项目在做什么、现在最值得关注什么,以及建议我下一步从哪里开始。`:`Help me understand ${i}: explain what this project is doing, what matters most right now, and where I should start next.`}var J=i(),me={zh:{eyebrow:`当前理解`,summaryTitle:`我理解的是这样`,summaryQuestion:`可以继续,也可以随时修改。`,matches:`准确,继续`,adjust:`修改`,why:`查看依据`,evidenceHint:`这些内容只用于本次判断。`,current:`当前`,ongoing:`持续`,longTerm:`长期`,correctionTitle:`告诉我正确的重点`,correctionPlaceholder:`你现在真正想推进什么?`,continueWithCorrection:`按此继续`,starterTitle:`从这里开始`,starterHint:`可以修改后直接开始对话。`,startConversation:`进入对话`,cancel:`取消`},en:{eyebrow:`Current understanding`,summaryTitle:`Here’s how I understand it`,summaryQuestion:`Continue, or adjust this anytime.`,matches:`Accurate, continue`,adjust:`Edit`,why:`View sources`,evidenceHint:`These sources are only used for this assessment.`,current:`Current`,ongoing:`Ongoing`,longTerm:`Long term`,correctionTitle:`Tell me the right focus`,correctionPlaceholder:`What do you want to move forward right now?`,continueWithCorrection:`Continue`,starterTitle:`Start here`,starterHint:`Edit this if needed, then start the conversation.`,startConversation:`Start conversation`,cancel:`Cancel`}};function he(e){let t=(0,pe.c)(84),{run:n,language:r,busy:i,error:a,onFinish:o,onStartConversation:s}=e,c=me[r],l=n.result?.lowConfidence===!0,u;t[0]!==r||t[1]!==n?(u=q(n,r),t[0]=r,t[1]=n,t[2]=u):u=t[2];let d=u,[f,m]=(0,G.useState)(l),[h,g]=(0,G.useState)(l?d:``),[_,ee]=(0,G.useState)(!1),[v,te]=(0,G.useState)(!1),[ne,re]=(0,G.useState)(!1),y,b,x,S,C,w,T,E,D,O,k,A;if(t[3]!==i||t[4]!==v||t[5]!==h||t[6]!==f||t[7]!==a||t[8]!==ne||t[9]!==o||t[10]!==s||t[11]!==n.result||t[12]!==c.current||t[13]!==c.evidenceHint||t[14]!==c.eyebrow||t[15]!==c.longTerm||t[16]!==c.ongoing||t[17]!==c.summaryTitle||t[18]!==c.why){let e=n.result?.workThreads?.slice(0,3)??[],r=n.result?.suggestions.find(e=>e.id===n.result?.primarySuggestionId)??n.result?.suggestions[0],l;t[31]!==h||t[32]!==o?(l=async e=>{ee(!0),await o(e,e===`corrected`?h.trim():void 0)||ee(!1)},t[31]=h,t[32]=o,t[33]=l):l=t[33],y=l;let u;t[34]!==h||t[35]!==s?(u=async()=>{let e=h.trim();e&&(te(!0),await s(e,`corrected`)||te(!1))},t[34]=h,t[35]=s,t[36]=u):u=t[36],b=u,x=`xopc-understanding-reveal flex min-h-full flex-1 flex-col`,S=`polite`,D=`xopc-reveal-scene mx-auto flex w-full max-w-[40rem] flex-1 flex-col justify-center py-6 text-center sm:py-10`;let d=a?`care`:i||v?`work`:f?`listen`:`decision`;t[37]===d?O=t[38]:(O=(0,J.jsx)(le,{className:`mx-auto mb-3 size-28`,mood:d}),t[37]=d,t[38]=O),t[39]===c.eyebrow?k=t[40]:(k=(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-accent-fg`,children:c.eyebrow}),t[39]=c.eyebrow,t[40]=k),t[41]===c.summaryTitle?A=t[42]:(A=(0,J.jsx)(`h1`,{className:`mx-auto mt-4 max-w-[34rem] text-3xl font-semibold tracking-[-0.035em] text-fg sm:text-[2.25rem]`,children:c.summaryTitle}),t[41]=c.summaryTitle,t[42]=A),C=`xopc-understanding-hero-card relative mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel px-6 py-7 text-left shadow-surface sm:px-8`,t[43]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,J.jsx)(`div`,{className:`mb-5 flex size-9 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,"aria-hidden":!0,children:(0,J.jsx)(ie,{className:`size-[1.125rem]`})}),t[43]=w):w=t[43];let m=n.result?.projectSummary;t[44]===m?T=t[45]:(T=(0,J.jsx)(`p`,{className:`relative text-lg font-medium leading-8 text-fg sm:text-xl`,children:m}),t[44]=m,t[45]=T),E=n.result?.currentState||e.length||r?.evidence.length?(0,J.jsxs)(`div`,{className:`relative mt-5 border-t border-edge-subtle pt-4`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 text-xs font-medium text-fg-muted hover:text-fg`,onClick:()=>re(_e),children:[c.why,(0,J.jsx)(p,{className:H(`size-3.5 transition-transform`,ne&&`rotate-180`)})]}),ne?(0,J.jsxs)(`div`,{className:`mt-3 space-y-3 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(`p`,{className:`text-fg-subtle`,children:c.evidenceHint}),n.result?.currentState?(0,J.jsx)(`p`,{children:n.result.currentState}):null,e.length?(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,J.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:e.title}),` · `,e.horizon===`current`?c.current:e.horizon===`ongoing`?c.ongoing:c.longTerm]},e.id))}):null,r?.evidence.slice(0,3).map(ge)]}):null]}):null,t[3]=i,t[4]=v,t[5]=h,t[6]=f,t[7]=a,t[8]=ne,t[9]=o,t[10]=s,t[11]=n.result,t[12]=c.current,t[13]=c.evidenceHint,t[14]=c.eyebrow,t[15]=c.longTerm,t[16]=c.ongoing,t[17]=c.summaryTitle,t[18]=c.why,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A}else y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30];let j;t[46]!==C||t[47]!==w||t[48]!==T||t[49]!==E?(j=(0,J.jsxs)(`div`,{className:C,children:[w,T,E]}),t[46]=C,t[47]=w,t[48]=T,t[49]=E,t[50]=j):j=t[50];let M;t[51]!==y||t[52]!==i||t[53]!==v||t[54]!==h||t[55]!==f||t[56]!==l||t[57]!==b||t[58]!==_||t[59]!==c.adjust||t[60]!==c.cancel||t[61]!==c.continueWithCorrection||t[62]!==c.correctionPlaceholder||t[63]!==c.correctionTitle||t[64]!==c.matches||t[65]!==c.startConversation||t[66]!==c.starterHint||t[67]!==c.starterTitle||t[68]!==c.summaryQuestion?(M=f?(0,J.jsxs)(`div`,{className:`xopc-reveal-calibration mx-auto mt-7 w-full max-w-xl rounded-xl border border-edge bg-surface-panel p-5 text-left shadow-surface`,children:[(0,J.jsx)(`label`,{className:`text-sm font-semibold text-fg`,htmlFor:`understanding-correction`,children:l?c.starterTitle:c.correctionTitle}),l?(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-fg-muted`,children:c.starterHint}):null,(0,J.jsx)(`textarea`,{id:`understanding-correction`,value:h,onChange:e=>g(e.target.value),placeholder:c.correctionPlaceholder,className:`mt-3 min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[l?null:(0,J.jsx)(U,{variant:`ghost`,disabled:_,onClick:()=>m(!1),children:c.cancel}),(0,J.jsx)(U,{variant:`primary`,disabled:i||v||!h.trim(),onClick:()=>void b(),children:l?c.startConversation:c.continueWithCorrection})]})]}):(0,J.jsxs)(`div`,{className:`mx-auto mt-8 w-full max-w-sm`,children:[(0,J.jsx)(`p`,{className:`text-base font-medium text-fg`,children:c.summaryQuestion}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{className:`h-11 flex-1`,variant:`primary`,disabled:_,onClick:()=>void y(`confirmed`),children:c.matches}),(0,J.jsx)(U,{className:`h-11 flex-1`,variant:`secondary`,disabled:_,onClick:()=>m(!0),children:c.adjust})]})]}),t[51]=y,t[52]=i,t[53]=v,t[54]=h,t[55]=f,t[56]=l,t[57]=b,t[58]=_,t[59]=c.adjust,t[60]=c.cancel,t[61]=c.continueWithCorrection,t[62]=c.correctionPlaceholder,t[63]=c.correctionTitle,t[64]=c.matches,t[65]=c.startConversation,t[66]=c.starterHint,t[67]=c.starterTitle,t[68]=c.summaryQuestion,t[69]=M):M=t[69];let N;t[70]===a?N=t[71]:(N=a?(0,J.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:a}):null,t[70]=a,t[71]=N);let P;t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==D||t[76]!==O||t[77]!==k||t[78]!==A?(P=(0,J.jsxs)(`div`,{className:D,children:[O,k,A,j,M,N]}),t[72]=j,t[73]=M,t[74]=N,t[75]=D,t[76]=O,t[77]=k,t[78]=A,t[79]=P):P=t[79];let F;return t[80]!==x||t[81]!==S||t[82]!==P?(F=(0,J.jsx)(`section`,{className:x,"aria-live":S,children:P}),t[80]=x,t[81]=S,t[82]=P,t[83]=F):F=t[83],F}function ge(e,t){return(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`mt-0.5 size-3.5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{children:[e.path?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`code`,{className:`font-mono text-fg`,children:e.path}),`: `]}):null,e.observation]})]},`${t}-${e.path??e.observation}`)}function _e(e){return!e}var ve={folder:j,file:A,recent:S,git:M,calendar:d,task:N,note:W,mail:T,message:F,service:z,data:v};function ye(e){let t=(0,pe.c)(28),{signals:n,ariaLabel:r,centerLabel:i}=e,a,o,s,c,l,u,d,f;if(t[0]!==r||t[1]!==i||t[2]!==n){let e=n.slice(0,3);a=Math.max(0,n.length-e.length),c=`xopc-source-convergence mx-auto mt-9 w-full max-w-[34rem] overflow-hidden rounded-xl border border-edge bg-surface-panel px-5 py-6 shadow-surface sm:px-6`,l=`img`,u=r;let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,J.jsx)(le,{className:`size-24`,mood:`work`}),t[11]=p):p=t[11],t[12]===i?d=t[13]:(d=(0,J.jsxs)(`div`,{className:`flex flex-col items-center text-center`,"aria-hidden":!0,children:[p,(0,J.jsx)(`span`,{className:`mt-3 text-[11px] font-semibold tracking-[0.16em] text-fg-muted`,children:i})]}),t[12]=i,t[13]=d),t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(`div`,{className:`mt-5 h-1 overflow-hidden rounded-full bg-surface-hover`,"aria-hidden":!0,children:(0,J.jsx)(`span`,{className:`xopc-source-convergence-progress block h-full w-2/5 rounded-full bg-accent`})}),t[14]=f):f=t[14],o=`mt-5 divide-y divide-edge-subtle border-y border-edge-subtle`,s=e.map(be),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10];let p;t[15]!==o||t[16]!==s?(p=(0,J.jsx)(`div`,{className:o,children:s}),t[15]=o,t[16]=s,t[17]=p):p=t[17];let m;t[18]===a?m=t[19]:(m=a>0?(0,J.jsxs)(`p`,{className:`mt-3 text-center text-xs text-fg-muted`,"aria-hidden":!0,children:[`+`,a]}):null,t[18]=a,t[19]=m);let h;return t[20]!==c||t[21]!==l||t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==m?(h=(0,J.jsxs)(`div`,{className:c,role:l,"aria-label":u,children:[d,f,p,m]}),t[20]=c,t[21]=l,t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=m,t[27]=h):h=t[27],h}function be(e){let t=ve[e.kind];return(0,J.jsxs)(`div`,{className:`flex min-h-12 items-center gap-3 py-2.5 text-left`,"aria-hidden":!0,children:[(0,J.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-hover text-fg-muted`,children:(0,J.jsx)(t,{className:`size-4`})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,title:e.detail,children:[(0,J.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.label}),e.meta?(0,J.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:e.meta}):null]}),(0,J.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`})]},e.id)}var xe=[`gmail`,`googlecalendar`,`googledrive`,`github`,`linear`];function Y({toolkit:e,displayName:t,description:n,category:r,mode:i,bootstrapWindowDays:a,logoFileName:o=e}){return{id:`composio-${e}`,version:`sessions-v1`,displayName:t,description:n,category:r,kind:`composio`,source:`registry`,capabilities:[`tools`,`auth.oauth`,`events`,`context`,`memory_source`],benefits:[`understand`,`act`],understanding:{mode:i,bootstrapWindowDays:a,readOnly:!0},tags:[`composio`,e,`verified`],branding:{logoUrl:`/connector-icons/${o}.svg`,source:`builtin`},verificationLevel:`verified`,auth:{mode:`oauth`,provider:`composio`},setup:{},runtime:{type:`composio`,toolkit:e,role:`toolkit`},integrationStrategy:{lane:`composio`,workload:`long_tail`,preferred:!0}}}var Se=[Y({toolkit:`gmail`,displayName:`Gmail`,description:`Find and understand recent email, then draft or send with your approval.`,category:`automation`,mode:`activity`,bootstrapWindowDays:30}),Y({toolkit:`googlecalendar`,displayName:`Google Calendar`,description:`Understand your schedule and work with approved calendar events.`,category:`automation`,mode:`activity`,bootstrapWindowDays:90,logoFileName:`google-calendar`}),Y({toolkit:`googledrive`,displayName:`Google Drive`,description:`Search and understand approved files in Google Drive.`,category:`data`,mode:`inventory`,bootstrapWindowDays:90,logoFileName:`google-drive`}),Y({toolkit:`github`,displayName:`GitHub`,description:`Understand repositories, issues, pull requests, and reviews.`,category:`code`,mode:`activity`,bootstrapWindowDays:90}),Y({toolkit:`linear`,displayName:`Linear`,description:`Understand and work with Linear issues and projects.`,category:`code`,mode:`activity`,bootstrapWindowDays:60})];function Ce(e){return e.runtime.type===`composio`&&e.runtime.role===`toolkit`?e.runtime.toolkit.toLocaleLowerCase():``}function we(e){let t=new Map(xe.map((e,t)=>[e,t]));return e.filter(e=>e.understanding!=null&&Ce(e)).sort((e,n)=>(t.get(Ce(e))??2**53-1)-(t.get(Ce(n))??2**53-1)||e.displayName.localeCompare(n.displayName))}function Te(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t)n.set(e.id,e);return we([...n.values()])}var Ee=2500;function De(e){return!!(e?.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`))}function Oe(e){return e===`gmail`?`mail`:e===`googlecalendar`?`calendar`:e===`googledrive`?`data`:e===`github`?`git`:e===`linear`?`task`:`service`}function ke(e){let t=(0,pe.c)(59),{busy:n,onBack:r,onContinue:i,onSkip:a,onConnectedSignalsChange:o}=e,l=s(Pe),d=c(l),f=d.onboarding.workDiscovery,m=d.connectorsSettings,[g,ee]=(0,G.useState)(Ne),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[0]=v):v=t[0];let[te,ne]=(0,G.useState)(v),[re,y]=(0,G.useState)(!0),[b,x]=(0,G.useState)(null),[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(null),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=async()=>{let e=await se();return ne(e),e},t[1]=E):E=t[1];let D=E,O,k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{let e=!1,t=window.setTimeout(()=>{e||y(!1)},Ee);return se().then(t=>{e||ne(t)}).catch(t=>{e||x(t instanceof Error?t.message:String(t))}).finally(()=>{e||y(!1),window.clearTimeout(t)}),ce({page:1,pageSize:24,verification:`verified`}).then(t=>{e||ee(Te(Se,t.connectors))}).catch(Me),()=>{e=!0,window.clearTimeout(t)}},k=[],t[2]=O,t[3]=k):(O=t[2],k=t[3]),(0,G.useEffect)(O,k);let A;t[4]===te?A=t[5]:(A=new Map(te.map(je)),t[4]=te,t[5]=A);let j=A,M;if(t[6]!==g||t[7]!==j){let e;t[9]===j?e=t[10]:(e=e=>{if(!De(j.get(e.id)))return[];let t=Ce(e);return[{id:e.id,label:e.displayName,kind:Oe(t)}]},t[9]=j,t[10]=e),M=g.flatMap(e),t[6]=g,t[7]=j,t[8]=M}else M=t[8];let N=M,F,z;t[11]!==N||t[12]!==o?(F=()=>{o(N)},z=[N,o],t[11]=N,t[12]=o,t[13]=F,t[14]=z):(F=t[13],z=t[14]),(0,G.useEffect)(F,z);let V;t[15]!==g||t[16]!==S?(V=S?g:g.slice(0,3),t[15]=g,t[16]=S,t[17]=V):V=t[17];let ie=V,ae=N.length,H;t[18]!==g.length||t[19]!==m||t[20]!==f.connected||t[21]!==f.noWorkServices||t[22]!==f.showFewerServices||t[23]!==f.showMoreServices||t[24]!==S||t[25]!==j||t[26]!==re||t[27]!==l||t[28]!==D||t[29]!==C||t[30]!==T||t[31]!==ie?(H=l===`zh`?(0,J.jsx)(u,{onChanged:async()=>{await D()}}):(0,J.jsxs)(J.Fragment,{children:[ie.length?(0,J.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-base/55`,children:ie.map(e=>{let t=De(j.get(e.id));return(0,J.jsxs)(`article`,{className:`flex min-h-[4.75rem] items-center gap-3 px-3 py-3 sm:px-4`,children:[(0,J.jsx)(I,{connector:e,size:`sm`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.displayName}),(0,J.jsx)(`p`,{className:`mt-1 line-clamp-1 text-xs text-fg-muted`,children:e.description})]}),t?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-success`,children:[(0,J.jsx)(_,{className:`size-4`}),f.connected]}):re?(0,J.jsx)(oe,{className:`h-8 w-[4.5rem] shrink-0 rounded-lg`,"aria-label":m.loading}):(0,J.jsxs)(U,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-3 text-xs`,onClick:()=>T(L(e)),children:[(0,J.jsx)(B,{className:`size-3.5`}),m.connect]})]},e.id)})}):(0,J.jsx)(`p`,{className:`rounded-xl border border-dashed border-edge px-4 py-8 text-center text-sm text-fg-muted`,children:f.noWorkServices}),g.length>3?(0,J.jsxs)(`button`,{type:`button`,className:`mx-auto mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>C(Ae),children:[S?(0,J.jsx)(h,{className:`size-3.5`}):(0,J.jsx)(p,{className:`size-3.5`}),S?f.showFewerServices:f.showMoreServices]}):null]}),t[18]=g.length,t[19]=m,t[20]=f.connected,t[21]=f.noWorkServices,t[22]=f.showFewerServices,t[23]=f.showMoreServices,t[24]=S,t[25]=j,t[26]=re,t[27]=l,t[28]=D,t[29]=C,t[30]=T,t[31]=ie,t[32]=H):H=t[32];let le;t[33]!==f.connectorLoadFailed||t[34]!==b?(le=b?(0,J.jsxs)(`p`,{className:`mt-3 text-center text-xs text-danger`,role:`alert`,children:[f.connectorLoadFailed,`: `,b]}):null,t[33]=f.connectorLoadFailed,t[34]=b,t[35]=le):le=t[35];let ue;t[36]===n?ue=t[37]:(ue=n?(0,J.jsx)(P,{className:`size-4 animate-spin`}):null,t[36]=n,t[37]=ue);let W;t[38]!==n||t[39]!==f.startUnderstanding||t[40]!==i||t[41]!==ue?(W=(0,J.jsxs)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:n,onClick:i,children:[ue,f.startUnderstanding]}),t[38]=n,t[39]=f.startUnderstanding,t[40]=i,t[41]=ue,t[42]=W):W=t[42];let K;t[43]!==n||t[44]!==f.back||t[45]!==r?(K=(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:n,onClick:r,children:f.back}),t[43]=n,t[44]=f.back,t[45]=r,t[46]=K):K=t[46];let de;t[47]!==W||t[48]!==K?(de=(0,J.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[W,K]}),t[47]=W,t[48]=K,t[49]=de):de=t[49];let fe;t[50]!==n||t[51]!==f.skipAndEnter||t[52]!==a?(fe=(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,disabled:n,onClick:a,children:f.skipAndEnter}),t[50]=n,t[51]=f.skipAndEnter,t[52]=a,t[53]=fe):fe=t[53];let q;return t[54]!==m||t[55]!==w||t[56]!==D||t[57]!==T?(q=w?(0,J.jsx)(R,{draft:w,onChange:T,onClose:()=>T(null),t:m,onInstalled:async()=>{await D(),T(null)}}):null,t[54]=m,t[55]=w,t[56]=D,t[57]=T,t[58]=q):q=t[58],(0,J.jsxs)(`section`,{className:`mx-auto flex w-full max-w-[42rem] flex-1 flex-col`,"aria-labelledby":`work-discovery-connectors-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:f.connectorStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-connectors-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:f.connectorStepTitle}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-[36rem] text-[0.95rem] leading-7 text-fg-muted`,children:f.connectorStepSubtitle})]}),(0,J.jsxs)(`div`,{className:`mt-7 rounded-xl border border-edge bg-surface-panel p-3 shadow-surface sm:p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pb-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:f.popularWorkServices}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:f.connectorsOptional})]}),ae?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 rounded-full bg-success-soft px-2.5 py-1 text-xs font-medium text-success`,children:[(0,J.jsx)(_,{className:`size-3.5`}),f.connectedCount.replace(`{{count}}`,String(ae))]}):null]}),H,le]}),de,fe,q]})}function Ae(e){return!e}function je(e){return[e.connectorId,e]}function Me(){}function Ne(){return we(Se)}function Pe(e){return e.language}var Fe=new Set([`local-recent-files`,`chromium-bookmarks`,`apple-notes`,`apple-mail`,`apple-calendar`,`apple-reminders`]);function Ie(e){return new Set(e.filter(e=>e.availability===`available`&&Fe.has(e.id)).map(e=>e.id))}var Le=t({WorkDiscoveryPage:()=>Ve}),Re=[`folder_structure`,`recent_progress`,`next_steps`];function X(e){return e instanceof Error?e.message:String(e)}function ze(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(Boolean).slice(-2).join(`/`)||e}function Be(e,t){return e.replace(`{{count}}`,String(t))}function Ve({embedded:e=!1,onRequestClose:t,onNavigateAway:n}={}){let r=s(e=>e.language),i=c(r).onboarding.workDiscovery,l=c(r).chat.workingDirectory,u=o(),[d]=a(),h=d.get(`new`)===`1`,[_,v]=(0,G.useState)(`loading`),[S,T]=(0,G.useState)(null),[M,N]=(0,G.useState)(null),[F,I]=(0,G.useState)(null),[L,R]=(0,G.useState)(!1),[z,B]=(0,G.useState)(null),[ie,se]=(0,G.useState)(!1),[ce,W]=(0,G.useState)([]),[K,de]=(0,G.useState)(()=>new Set),[pe,q]=(0,G.useState)([]),[me,ge]=(0,G.useState)(!1),[_e,ve]=(0,G.useState)({current:0,total:0}),[be,xe]=(0,G.useState)([]),[Y,Se]=(0,G.useState)(()=>new Set),[Ce,we]=(0,G.useState)([]),Te=(0,G.useRef)(!1),Ee={recent_documents:`recent`,calendar:`calendar`,tasks:`task`,notes:`note`,mail:`mail`,messages:`message`,code_activity:`git`,files:`file`},De=F?.snapshot?.projectKind??S?.projectKind,Oe=De===`coding`?i.codingProject:De===`general`?i.generalProject:De===`unknown`?i.unknownProject:null,Ae=(F?.snapshot?.files??[]).slice(0,4).map(e=>({id:`snapshot-file:${e.relativePath}`,label:ze(e.relativePath),kind:e.source===`git_change`?`recent`:`file`,meta:e.source===`git_change`?i.sourceSignals.changedFile:e.source===`document`?i.sourceSignals.contextFile:i.sourceSignals.structureFile,detail:e.relativePath})),je=F?.rootPath??S?.canonicalRootPath,Me=Ae.length===0?(S?.fingerprint.recentAreas??[]).slice(0,2).map(e=>({id:`recent-area:${e}`,label:e,kind:`recent`,meta:i.sourceSignals.recentArea,detail:e})):[],Ne=Ae.length===0?Me.length>0?Me:[{id:`project-files`,label:i.sourceSignals.projectFiles,kind:`file`,meta:i.sourceSignals.scanningFiles},{id:`recent-changes`,label:i.sourceSignals.recentChanges,kind:`recent`,meta:i.sourceSignals.checkingChanges}]:[],Pe=F?.snapshot?.sampledPathCount,Fe=[Oe,Pe==null?null:Be(i.sourceSignals.filesScanned,Pe)].filter(e=>!!e).join(` · `),Le=F?.snapshot?.branch??S?.fingerprint.branch,Ve=F?.snapshot?.changedPathCount??S?.fingerprint.changedFileCount,He=[{id:`work-folder`,label:je?ze(je):i.sourceSignals.workFolder,kind:`folder`,...Fe?{meta:Fe}:{},...je?{detail:je}:{}},...Ae,...Ne,{id:`git-state`,label:Le??i.sourceSignals.gitState,kind:`git`,...Ve==null?{}:{meta:Be(i.sourceSignals.changedFiles,Ve)},...Le?{detail:`Git · ${Le}`}:{}},...be.filter(e=>Y.has(e.id)).map(e=>({id:e.id,label:e.displayName,kind:Ee[e.category]??`data`})),...Ce],Ue=e=>{Se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};(0,G.useEffect)(()=>{let e=!1;return window.electronAPI?.understandingSources?.catalog().then(t=>{e||(xe(t),Se(Ie(t)))}),()=>{e=!0}},[]);let Z=(0,G.useCallback)(e=>{O.getState().updateDirectoryRun(e),I(e),e.status===`completed`?v(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`):e.status===`failed`||e.status===`canceled`?v(`error`):v(`running`)},[]),We=async()=>{R(!0),B(null);try{let e=await E();if(N(e.processingTarget),!e.candidates.length){B(i.noCandidates);return}W(e.candidates),de(new Set([e.candidates[0].rootPath])),v(`candidates`)}catch(e){B(X(e))}finally{R(!1)}},Ge=e=>{de(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ke=(0,G.useCallback)((e,t,n)=>{O.getState().updateDirectoryRun(e),I(e),ve({current:t+1,total:n}),q(n=>{let r=[...n];return r[t]=e,r}),v(`running`)},[]),qe=(0,G.useCallback)(e=>{q(t=>t.map(t=>t?.id===e.id?e:t))},[]),Je=async()=>{let e=ce.filter(e=>K.has(e.rootPath));if(!e.length)return;R(!0),B(null),q([]),ve({current:1,total:e.length}),ge(!0),Te.current=!1;let t=!1,n=M?.remoteModel?`remote_allowed`:`local_only`;try{let r=await fe(e,{grantDirectory:e=>D(e,n),startRun:re,fetchRun:w,shouldStop:()=>Te.current,onRun:(e,r,i)=>{Ke(e,r,i),t||(t=!0,O.getState().collectSources(e.id,[...Y],n))},onError:(t,n,r)=>{ve({current:r+1,total:e.length}),B(i.folderAnalysisFailed.replace(`{{folder}}`,n.displayName).replace(`{{error}}`,X(t)))}});if(Te.current)return;let a=r.find(e=>e.status===`completed`)??r.at(-1);a?Z(a):v(`candidates`)}catch(e){B(X(e)),v(`candidates`)}finally{ge(!1),R(!1)}},Q=ue({onPicked:(0,G.useCallback)(async e=>{R(!0),B(null);try{let t=await ne(e);T(t),N({provider:t.provider,remoteModel:t.remoteModel}),v(`consent`)}catch(e){B(X(e)),v(`intro`)}finally{R(!1)}},[])});(0,G.useEffect)(()=>{if(!h){let e=O.getState().directoryRun;if(e){Z(e);return}}let e=!1,n=window.setTimeout(()=>{e||v(`intro`)},4e3);return te().then(async({enabled:r,state:i})=>{if(!e){if(!r){window.clearTimeout(n),t?t():u(`/chat`,{replace:!0});return}if(!h&&i.activeRunId)try{let t=await w(i.activeRunId);e||(window.clearTimeout(n),Z(t));return}catch{}e||(window.clearTimeout(n),v(`intro`))}}).catch(t=>{window.clearTimeout(n),e||(B(X(t)),v(`intro`))}),()=>{e=!0,window.clearTimeout(n)}},[Z,u,t,h]),(0,G.useEffect)(()=>{if(!F||_!==`running`||me)return;let e=!1,t=async()=>{try{let t=await w(F.id);e||Z(t)}catch{}},n=window.setInterval(()=>void t(),1200),r=e=>{let n=e.detail;(!n?.runId||n.runId===F.id)&&t()};for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.addEventListener(e,r);return()=>{e=!0,window.clearInterval(n);for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.removeEventListener(e,r)}},[Z,me,_,F]);let Ye=async()=>{R(!0);try{await b()}finally{t?t():u(`/chat`,{replace:!0})}},Xe=async()=>{if(S){R(!0),B(null),q([]),ve({current:0,total:0});try{let e=S.remoteModel?`remote_allowed`:`local_only`;await D(S.canonicalRootPath,e);let t=await re(S.canonicalRootPath);Z(t),O.getState().collectSources(t.id,[...Y],e)}catch(e){B(X(e)),v(`consent`)}finally{R(!1)}}},Ze=(e,t,r=!1)=>{let i=new URLSearchParams;t&&i.set(`draft`,t),t&&r&&i.set(`autoSend`,`1`);let a=i.toString();n?.(),u(`/chat/${encodeURIComponent(e)}${a?`?${a}`:``}`)},Qe=e=>{I(e),se(!1),e.status===`completed`?v(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`):e.status===`failed`||e.status===`canceled`?v(`error`):v(`running`)},$e=async()=>{if(!F)return;Te.current=!0;let e=await C(F.id);Z(e)},et=()=>{n?.(),u(`/chat`)},tt=()=>{if(S){Xe();return}Je()},nt=()=>{v(S?`consent`:ce.length?`candidates`:`intro`)},rt=async(e,t)=>{if(!F)return;await k(F.id,e.id).catch(()=>{});let n=t?`${r===`zh`?`先帮我评估这个方向,不要修改文件:`:`First assess this direction without changing files:`}\n\n${e.actionPrompt}`:e.actionPrompt;Ze(F.conversationId,n)},it=async(e,t)=>{if(!F)return!1;R(!0),B(null);try{let n=await y(F.id,e,t);return I(n),qe(n),v(`recommendation`),!0}catch(e){return B(X(e)),!1}finally{R(!1)}},at=async(e,t)=>{if(!F)return!1;R(!0),B(null);try{let n=await y(F.id,t,t===`corrected`?e:void 0);return I(n),qe(n),Ze(F.conversationId,e,!0),!0}catch(e){return B(X(e)),!1}finally{R(!1)}},$=F?.result?.suggestions.find(e=>e.id===F.result?.primarySuggestionId)??F?.result?.suggestions[0],ot=F?.result?.suggestions.filter(e=>e.id!==$?.id)??[],st=e=>e===`command`?i.riskCommand:e===`file_write`?i.riskFileWrite:i.riskAnalysis,ct=pe.filter(e=>e?.status===`completed`),lt=e&&_===`candidates`,ut=ct.length>1?(0,J.jsxs)(`div`,{className:`mt-6 rounded-xl border border-edge bg-surface-panel p-2`,children:[(0,J.jsx)(`p`,{className:`px-2 pb-2 text-xs font-medium text-fg-muted`,children:i.analysisResults}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ct.map(e=>{let t=ce.find(t=>t.rootPath===e.rootPath)?.displayName??e.rootPath.split(/[\\/]/).filter(Boolean).at(-1)??e.rootPath;return(0,J.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-sm font-medium transition ${e.id===F?.id?`bg-accent text-on-accent`:`bg-surface-hover text-fg hover:bg-surface-active`}`,onClick:()=>Qe(e),children:t},e.id)})})]}):null;return(0,J.jsxs)(`div`,{className:e?`xopc-work-discovery-experience relative flex h-full min-h-0 flex-1 flex-col overflow-hidden`:`xopc-work-discovery-experience relative flex min-h-full flex-1 flex-col`,children:[(0,J.jsxs)(`main`,{className:e?`app-main-surface xopc-work-discovery-stage xopc-onboarding-scroll relative z-10 mx-auto my-3 flex min-h-0 w-[calc(100%_-_1.5rem)] ${_===`recognition`?`max-w-[58rem]`:`max-w-[46rem]`} flex-1 flex-col rounded-xl bg-surface-panel px-5 py-7 shadow-surface sm:my-4 sm:w-[calc(100%_-_2rem)] sm:px-8 sm:py-9 ${lt?`overflow-hidden`:`overflow-y-auto`}`:`app-main-surface mx-auto my-4 flex w-[calc(100%_-_2rem)] ${_===`recognition`?`max-w-[58rem]`:`max-w-[40rem]`} flex-1 flex-col rounded-xl bg-surface-panel px-5 py-10 shadow-surface sm:px-8 sm:py-16`,children:[_===`intro`?(0,J.jsx)(`div`,{className:H(`flex items-center justify-center`,e?`mb-7 sm:mb-9`:`mb-10`),children:(0,J.jsx)(le,{className:`size-28`,mood:`curious`})}):null,_===`loading`?(0,J.jsxs)(`section`,{className:`mx-auto flex min-h-[32rem] w-full max-w-md flex-1 flex-col items-center justify-center text-center`,"aria-busy":!0,"aria-label":i.loading,children:[(0,J.jsx)(oe,{className:`size-14 rounded-xl`}),(0,J.jsx)(oe,{className:`mt-7 h-5 w-44 rounded-full`}),(0,J.jsx)(oe,{className:`mt-3 h-3.5 w-64 max-w-full rounded-full`})]}):null,_===`intro`?(0,J.jsxs)(`section`,{className:`flex flex-1 flex-col text-center`,"aria-labelledby":`work-discovery-title`,children:[(0,J.jsxs)(`div`,{className:`mx-auto max-w-[36rem]`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.title}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-[34rem] text-[0.95rem] leading-7 text-fg-muted`,children:i.subtitle})]}),(0,J.jsxs)(`div`,{className:`mx-auto mt-9 w-full max-w-md`,children:[be.length?(0,J.jsxs)(`div`,{className:`mb-5 overflow-hidden rounded-xl border border-edge bg-surface-panel text-left shadow-surface`,children:[(0,J.jsxs)(`div`,{className:`px-4 py-3.5`,children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.localSourcesTitle}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:i.localSourcesSubtitle})]}),(0,J.jsx)(`div`,{className:`grid border-t border-edge-subtle sm:grid-cols-2`,children:be.map(e=>{let t=Y.has(e.id);return(0,J.jsxs)(`button`,{type:`button`,className:H(`flex min-h-12 items-center justify-between gap-3 border-b border-edge-subtle px-4 py-3 text-left text-sm transition-colors last:border-b-0 sm:[&:nth-last-child(-n+2)]:border-b-0 sm:[&:nth-child(odd)]:border-r`,t?`bg-accent-soft/55 text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-pressed":t,onClick:()=>Ue(e.id),children:[(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.displayName}),(0,J.jsx)(`span`,{className:H(`flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors`,t?`border-accent bg-accent text-on-accent`:`border-edge`),children:t?(0,J.jsx)(f,{className:`size-3`,"aria-hidden":!0}):null})]},e.id)})})]}):null,(0,J.jsxs)(U,{type:`button`,variant:`primary`,className:`h-12 w-full gap-2`,onClick:()=>void We(),disabled:L||Q.picking,children:[L?(0,J.jsx)(P,{className:`size-4 animate-spin`}):(0,J.jsx)(V,{className:`size-4`}),i.quickScan]}),(0,J.jsxs)(U,{type:`button`,variant:`secondary`,className:`mt-3 h-11 w-full gap-2`,onClick:Q.pick,disabled:L||Q.picking,children:[Q.picking?(0,J.jsx)(P,{className:`size-4 animate-spin`}):(0,J.jsx)(j,{className:`size-4`}),i.chooseFolderManually]}),(0,J.jsxs)(`div`,{className:`mt-4 flex items-start justify-center gap-2 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsx)(`span`,{children:i.quickScanNote})]}),z?(0,J.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:z}):null]}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-auto pt-10 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void Ye(),disabled:L,children:i.skip})]}):null,_===`candidates`?(0,J.jsxs)(`section`,{className:e?`flex h-full min-h-0 flex-col`:void 0,"aria-labelledby":`work-discovery-candidates-title`,children:[(0,J.jsxs)(`div`,{className:e?`shrink-0 text-center`:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-candidates-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.candidatesTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.candidatesSubtitle})]}),(0,J.jsx)(`div`,{className:e?`xopc-onboarding-scroll mt-5 min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain pr-1`:`mt-7 space-y-2`,children:ce.map((e,t)=>{let n=K.has(e.rootPath);return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":n,className:`flex w-full items-start gap-3 rounded-xl border p-4 text-left transition ${n?`border-accent bg-accent-soft/45`:`border-edge bg-surface-panel hover:border-edge-strong`}`,onClick:()=>Ge(e.rootPath),children:[(0,J.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md border ${n?`border-accent bg-accent text-on-accent`:`border-edge bg-surface-base text-transparent`}`,children:(0,J.jsx)(f,{className:`size-3.5`})}),(0,J.jsx)(j,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),t===0?(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[0.7rem] font-medium text-accent-fg`,children:i.recommendedCandidate}):null]}),(0,J.jsx)(`span`,{className:`mt-1 block truncate font-mono text-xs text-fg-muted`,children:e.rootPath}),(0,J.jsxs)(`span`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,J.jsx)(`span`,{children:e.projectKind===`coding`?i.codingProject:e.projectKind===`general`?i.generalProject:i.unknownProject}),e.branch?(0,J.jsx)(`span`,{children:i.branchValue.replace(`{{branch}}`,e.branch)}):null,e.changedFileCount>0?(0,J.jsx)(`span`,{children:i.changedFiles.replace(`{{count}}`,String(e.changedFileCount))}):null]})]})]},e.id)})}),(0,J.jsxs)(`div`,{className:e?`shrink-0 border-t border-edge-subtle pt-4`:void 0,children:[(0,J.jsxs)(`div`,{className:`${e?``:`mt-5 `}flex items-start gap-2 rounded-xl bg-surface-hover/70 px-4 py-3 text-xs leading-5 text-fg-muted`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsxs)(`span`,{children:[i.multiFolderPrivacyNote,` `,M?.remoteModel?i.providerDisclosure.replace(`{{provider}}`,M.provider):i.localDisclosure]})]}),z?(0,J.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:z}):null,(0,J.jsxs)(`div`,{className:`${e?`mt-4`:`mt-7`} flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:L||K.size===0,onClick:()=>v(`connectors`),children:i.continueToConnectors}),(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:L,onClick:Q.pick,children:i.chooseFolderManually})]}),(0,J.jsx)(`button`,{type:`button`,className:`${e?`mt-3`:`mt-6`} mx-auto block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>v(`intro`),children:i.back})]})]}):null,_===`consent`&&S?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-consent-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.sourceStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-consent-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.selectedTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.selectedSubtitle})]}),(0,J.jsxs)(`div`,{className:`mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-surface`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-edge-subtle px-4 py-3.5`,children:[(0,J.jsx)(j,{className:`size-5 shrink-0 text-accent-fg`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:S.displayName}),(0,J.jsx)(`p`,{className:`truncate font-mono text-xs text-fg-muted`,children:S.canonicalRootPath})]}),(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:S.projectKind===`coding`?i.codingProject:S.projectKind===`general`?i.generalProject:i.unknownProject})]}),(0,J.jsxs)(`div`,{className:`grid gap-4 border-b border-edge-subtle bg-surface-base/35 p-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.localFingerprint}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:S.fingerprint.branch?i.branchValue.replace(`{{branch}}`,S.fingerprint.branch):i.noGitBranch})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.recentActivity}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:i.changedFiles.replace(`{{count}}`,String(S.fingerprint.changedFileCount))})]}),S.fingerprint.recentAreas.length>0?(0,J.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.recentAreas}),(0,J.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:S.fingerprint.recentAreas.map(e=>(0,J.jsx)(`code`,{className:`rounded-md bg-surface-hover px-2 py-1 text-xs text-fg`,children:e},e))})]}):null]}),(0,J.jsxs)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:[(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(A,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.willRead}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.willReadValue})]})]}),(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(ae,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i.willIgnore}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.willIgnoreValue})]})]}),(0,J.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,J.jsx)(V,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,J.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:S.remoteModel?i.providerDisclosure.replace(`{{provider}}`,S.provider):i.localDisclosure})]})]})]}),z?(0,J.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:z}):null,(0,J.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{type:`button`,variant:`primary`,className:`h-11 flex-1`,disabled:L,onClick:()=>v(`connectors`),children:i.continueToConnectors}),(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:L,onClick:Q.pick,children:i.changeFolder})]}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void Ye(),children:i.skip})]}):null,_===`connectors`?(0,J.jsx)(ke,{busy:L,onBack:nt,onContinue:tt,onSkip:()=>void Ye(),onConnectedSignalsChange:we}):null,_===`running`&&F?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-running-title`,"aria-live":`polite`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.understandingStepEyebrow}),(0,J.jsx)(`h1`,{id:`work-discovery-running-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:i.analyzingTitle}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:i.analyzingSubtitle}),_e.total>1?(0,J.jsx)(`p`,{className:`mt-2 text-sm font-medium text-accent-fg`,children:i.analyzingFolderProgress.replace(`{{current}}`,String(_e.current)).replace(`{{total}}`,String(_e.total))}):null]}),(0,J.jsx)(ye,{signals:He,ariaLabel:i.sourceSignals.ariaLabel,centerLabel:i.sourceSignals.centerLabel}),(0,J.jsx)(`div`,{className:`xopc-understanding-progress mx-auto mt-6 grid max-w-[34rem] grid-cols-3 gap-2`,children:Re.map((e,t)=>{let n=Math.max(0,Re.indexOf(F.stage??`folder_structure`)),r=t<n,a=t===n;return(0,J.jsxs)(`div`,{className:`xopc-understanding-step min-w-0 text-left`,"data-active":a||void 0,"data-complete":r||void 0,children:[(0,J.jsx)(`span`,{className:H(`block h-1 rounded-full`,a||r?`bg-accent`:`bg-surface-hover`)}),(0,J.jsx)(`span`,{className:H(`mt-2 block text-[11px] leading-4`,a?`font-medium text-fg`:`text-fg-muted`),children:i.stages[e]})]},e)})}),(0,J.jsx)(`p`,{className:`mt-4 truncate text-center font-mono text-xs text-fg-muted`,children:F.rootPath}),(0,J.jsx)(`p`,{className:`mx-auto mt-4 max-w-lg text-center text-xs leading-5 text-fg-muted`,children:i.backgroundChoiceHint}),(0,J.jsxs)(`div`,{className:`mx-auto mt-5 flex max-w-md flex-col gap-3`,children:[(0,J.jsx)(U,{type:`button`,variant:`secondary`,className:`h-11 w-full`,onClick:et,children:i.continueInBackground}),(0,J.jsx)(`button`,{type:`button`,className:`mx-auto text-sm text-fg-muted hover:text-danger hover:underline`,onClick:()=>void $e(),children:i.cancelAnalysis})]})]}):null,_===`recognition`&&F?.result?(0,J.jsx)(he,{run:F,language:r,busy:L,error:z,onFinish:it,onStartConversation:at},F.id):null,_===`recommendation`&&F?.result&&$?(0,J.jsxs)(`section`,{"aria-labelledby":`work-discovery-recommendation-title`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:i.understandingConfirmed}),(0,J.jsx)(`h1`,{id:`work-discovery-recommendation-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:i.primaryRecommendationTitle})]}),ut,(0,J.jsx)(`article`,{className:`mt-7 rounded-xl border border-edge bg-surface-panel p-5 shadow-surface sm:p-7`,children:(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,J.jsx)(m,{className:`size-5`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:$.title}),(0,J.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:$.rationale}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-hover px-2.5 py-1 text-fg-muted`,children:[(0,J.jsx)(ee,{className:`size-3.5`}),i.estimatedMinutes.replace(`{{count}}`,String($.estimatedMinutes))]}),(0,J.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-fg-muted`,children:st($.risk)})]}),(0,J.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base px-4 py-3`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.expectedTask}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg`,children:$.expectedTask})]}),(0,J.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,J.jsx)(U,{variant:`primary`,className:`h-10 px-4`,onClick:()=>void rt($,!1),children:i.startRecommendedAction}),(0,J.jsx)(U,{className:`h-10 px-4`,variant:`secondary`,onClick:()=>void rt($,!0),children:i.explainFirst})]})]})]})}),ot.length>0?(0,J.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between py-2 text-sm font-medium text-fg-muted hover:text-fg`,onClick:()=>se(e=>!e),children:[i.otherDirections,(0,J.jsx)(p,{className:`size-4 transition-transform ${ie?`rotate-180`:``}`})]}),ie?(0,J.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle rounded-xl border border-edge bg-surface-panel px-4`,children:ot.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-3 py-4 text-left`,onClick:()=>void rt(e,!0),children:[(0,J.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title}),(0,J.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e.expectedTask})]})]},e.id))}):null]}):null,(0,J.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-3`,children:[(0,J.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Ze(F.conversationId),children:i.doSomethingElse}),(0,J.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>v(`recognition`),children:i.correctUnderstanding})]})]}):null,_===`error`&&F?(0,J.jsxs)(`section`,{className:`text-center`,"aria-labelledby":`work-discovery-error-title`,children:[(0,J.jsx)(`div`,{className:`mx-auto flex size-11 items-center justify-center rounded-xl bg-danger-soft text-danger`,children:(0,J.jsx)(ae,{className:`size-5`})}),(0,J.jsx)(`h1`,{id:`work-discovery-error-title`,className:`mt-5 text-2xl font-semibold tracking-tight text-fg`,children:i.errorTitle}),(0,J.jsx)(`p`,{className:`mx-auto mt-3 max-w-lg text-sm leading-6 text-fg-muted`,children:F.errorMessage}),(0,J.jsxs)(`div`,{className:`mx-auto mt-7 flex max-w-md flex-col gap-3 sm:flex-row-reverse`,children:[(0,J.jsx)(U,{variant:`primary`,className:`h-11 flex-1`,onClick:()=>void x(F.id).then(Z),children:i.retry}),(0,J.jsx)(U,{variant:`secondary`,className:`h-11 flex-1`,onClick:()=>{I(null),T(null),v(`intro`)},children:i.chooseDifferent})]}),(0,J.jsx)(`button`,{type:`button`,className:`mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Ze(F.conversationId),children:i.openConversation})]}):null]},_),Q.hasNativePicker?null:(0,J.jsx)(g,{open:Q.modalOpen,onOpenChange:Q.setModalOpen,initialAbsolutePath:S?.canonicalRootPath,onConfirm:Q.confirmPick,wd:l})]})}export{Le as n,W as r,Ve as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,o as i}from"./locale-store-B7y-RVe8.js";import{a as ee,i as a,o,r as s,s as c,t as te}from"./dist-BGTk37IG.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./file-archive-DanfQJNe.js";import{t as d}from"./loader-circle-CifKLtgG.js";import{t as f}from"./cn-0WouolD0.js";import{t as p}from"./button-Cc4hUNTt.js";import{n as ne}from"./interaction-BdhHBbYa.js";import{s as m}from"./form-field-width-DJw_jULe.js";import{r as h}from"./settings-form-draft-Dy10ldo8.js";var g=l(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),_=l(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),v=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),y=e(t(),1);async function b(e){let t=new URLSearchParams;e!=null&&e!==``&&t.set(`path`,e);let n=t.toString();return(await i(r(`/api/host/fs/list${n?`?${n}`:``}`))).payload}async function x(){return(await i(r(`/api/host/fs/meta`))).payload}async function S(e,t){return(await i(r(`/api/host/fs/directory`),{method:`POST`,body:JSON.stringify({parentPath:e,name:t})})).payload.absolutePath}var C=n();function w(){return f(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-sm text-fg`,`placeholder:text-fg-subtle`,m,`dark:border-edge`)}function T(e){return/^[A-Za-z]:\\?$/.test(e.replace(/\\$/,`\\`))}function E(e){return!e||e.currentPath===``?!1:e.parentPath!==null||e.currentPath!==`/`&&!!T(e.currentPath)}var D={metaHostname:null,listState:null,listLoading:!1,listError:null,manualPath:``,createFolderOpen:!1,createFolderName:``,createFolderLoading:!1,createFolderError:null,selectedFilePath:``};function O({open:e,onOpenChange:t,initialAbsolutePath:n,onConfirm:r,wd:i,selectKind:l=`directory`,fileExtensions:m,title:O,description:k,confirmLabel:A,nested:j=!1}){let M=(0,y.useId)(),N=(0,y.useId)(),[re,P]=(0,y.useReducer)(h,D),{metaHostname:F,listState:I,listLoading:L,listError:R,manualPath:z,createFolderOpen:B,createFolderName:V,createFolderLoading:H,createFolderError:U,selectedFilePath:W}=re,G=(0,y.useCallback)(async e=>{P({type:`patch`,patch:{listLoading:!0,listError:null,selectedFilePath:``}});try{let t=await b(e);P({type:`patch`,patch:{listState:t}})}catch(e){let t=e instanceof Error?e.message:String(e);P({type:`patch`,patch:{listError:t,listState:null}})}finally{P({type:`patch`,patch:{listLoading:!1}})}},[]);(0,y.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await x();t||P({type:`patch`,patch:{metaHostname:e.hostname}})}catch{t||P({type:`patch`,patch:{metaHostname:null}})}})(),()=>{t=!0}},[e]),(0,y.useEffect)(()=>{if(!e)return;let t=n?.trim()??``;P({type:`patch`,patch:{manualPath:t,createFolderOpen:!1,createFolderName:``,createFolderLoading:!1,createFolderError:null,selectedFilePath:``}});let r=!1;return(async()=>{P({type:`patch`,patch:{listLoading:!0,listError:null}});try{if(t)try{let e=await b(t);r||P({type:`patch`,patch:{listState:e}})}catch{let e=await b();r||P({type:`patch`,patch:{listState:e}})}else{let e=await b();r||P({type:`patch`,patch:{listState:e}})}}catch(e){let t=e instanceof Error?e.message:String(e);r||P({type:`patch`,patch:{listError:t,listState:null}})}finally{r||P({type:`patch`,patch:{listLoading:!1}})}})(),()=>{r=!0}},[e,n]);let K=e=>{e.isDirectory&&(P({type:`patch`,patch:{selectedFilePath:``}}),G(e.absolutePath))},q=()=>{if(!I)return;let{parentPath:e,currentPath:t}=I;if(e!==null){G(e);return}t===`/`||t===``||T(t)&&G(void 0)},J=I?.currentPath===``?i.pickerDrives:I?.currentPath??``,Y=!!I&&I.currentPath!==``&&!L&&!R,X=m?.map(e=>e.replace(/^\./,``).toLocaleLowerCase()),ie=e=>{if(l!==`file-or-directory`||e.isDirectory)return!1;if(!X?.length)return!0;let t=e.name.includes(`.`)?e.name.split(`.`).pop()?.toLocaleLowerCase():``;return!!(t&&X.includes(t))},ae=Y&&!H,Z=()=>{P({type:`patch`,patch:{createFolderOpen:!1,createFolderName:``,createFolderError:null}})},Q=async()=>{let e=V.trim();if(!(!I||I.currentPath===``||!e||H)){P({type:`patch`,patch:{createFolderLoading:!0,createFolderError:null}});try{let t=await S(I.currentPath,e);P({type:`patch`,patch:{createFolderOpen:!1,createFolderName:``,createFolderError:null}}),await G(t)}catch(e){let t=e?.status,n=t===409?i.pickerCreateFolderExists:t===400?i.pickerCreateFolderInvalid:t===403?i.pickerCreateFolderPermission:i.pickerCreateFolderError;P({type:`patch`,patch:{createFolderError:n}})}finally{P({type:`patch`,patch:{createFolderLoading:!1}})}}},oe=async()=>{let e=W||I?.currentPath;if(e)try{await r(e),t(!1)}catch{}},$=async()=>{let e=z.trim();if(e)try{await r(e),t(!1)}catch{}},se=L&&I;return(0,C.jsx)(te,{open:e,onOpenChange:t,children:(0,C.jsxs)(o,{children:[(0,C.jsx)(ee,{className:f(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[2px]`,j?`z-[139]`:`z-[100]`)}),(0,C.jsxs)(s,{className:f(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,32rem)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover`,j?`z-[140]`:`z-[101]`,`dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,C.jsx)(c,{className:`text-base font-semibold text-fg`,children:O??i.pathModalTitle}),(0,C.jsx)(a,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:k??i.pathModalDescription}),F?(0,C.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i.pickerHostHint.replace(`{{hostname}}`,F)}):null,(0,C.jsxs)(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(p,{type:`button`,variant:`secondary`,className:`shrink-0 gap-1 px-2 py-1.5 text-xs`,disabled:L||!E(I)||!!R,onClick:()=>q(),title:i.pickerUp,children:[(0,C.jsx)(g,{className:`size-4`,"aria-hidden":!0}),i.pickerUp]}),(0,C.jsx)(`div`,{className:`min-w-0 flex-1 truncate rounded-md border border-edge-subtle/80 bg-surface-hover/30 px-2 py-1.5 font-mono text-xs text-fg`,title:J,children:L&&!I?i.pickerLoading:J||`—`}),(0,C.jsxs)(p,{type:`button`,variant:`secondary`,className:`shrink-0 gap-1 px-2 py-1.5 text-xs`,disabled:!ae,onClick:()=>P({type:`patch`,patch:{createFolderOpen:!0,createFolderName:``,createFolderError:null}}),title:i.pickerNewFolder,children:[(0,C.jsx)(v,{className:`size-4`,"aria-hidden":!0}),i.pickerNewFolder]})]}),B?(0,C.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-2`,children:[(0,C.jsx)(`label`,{htmlFor:N,className:`text-xs font-medium text-fg-muted`,children:i.pickerNewFolderName}),(0,C.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[(0,C.jsx)(`input`,{id:N,type:`text`,value:V,onChange:e=>P({type:`patch`,patch:{createFolderName:e.target.value,createFolderError:null}}),className:w(),autoFocus:!0,autoComplete:`off`,spellCheck:!1,disabled:H,onKeyDown:e=>{e.key===`Enter`&&V.trim()?(e.preventDefault(),Q()):e.key===`Escape`&&(e.preventDefault(),Z())}}),(0,C.jsx)(p,{type:`button`,variant:`ghost`,className:`shrink-0`,disabled:H,onClick:Z,children:i.pickerCreateFolderCancel}),(0,C.jsxs)(p,{type:`button`,variant:`primary`,className:`shrink-0`,disabled:!V.trim()||H,onClick:()=>void Q(),children:[H?(0,C.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,i.pickerCreateFolder]})]}),U?(0,C.jsx)(`p`,{className:`mt-1.5 text-xs text-danger`,role:`alert`,children:U}):null]}):null,(0,C.jsxs)(`div`,{className:f(`relative min-h-[12rem] overflow-y-auto rounded-lg border border-edge-subtle/80 bg-surface-hover/20 p-1 dark:border-edge-subtle`,ne.focusRingPanel),role:`listbox`,"aria-label":O??i.pathModalTitle,children:[se?(0,C.jsx)(`div`,{className:`absolute inset-0 z-[1] flex items-center justify-center rounded-lg bg-surface-panel/60`,"aria-hidden":!0,children:(0,C.jsx)(d,{className:`size-6 animate-spin text-fg-muted`})}):null,L&&!I?(0,C.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-12 text-sm text-fg-muted`,children:[(0,C.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}),i.pickerLoading]}):null,R?(0,C.jsx)(`p`,{className:`px-2 py-8 text-center text-sm text-fg-muted`,children:i.pickerListError}):null,!L&&I&&!R&&I.entries.length===0?(0,C.jsx)(`p`,{className:`px-2 py-8 text-center text-sm text-fg-muted`,children:i.pickerEmptyFolder}):null,I?.entries.map(e=>{let t=ie(e),n=W===e.absolutePath;return(0,C.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,disabled:!e.isDirectory&&!t,className:f(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm`,e.isDirectory||t?`cursor-pointer text-fg hover:bg-surface-hover`:`cursor-default text-fg-muted opacity-60`,n&&`bg-accent-soft text-accent-fg ring-1 ring-inset ring-accent`),onClick:()=>e.isDirectory?K(e):t&&P({type:`patch`,patch:{selectedFilePath:e.absolutePath}}),children:[e.isDirectory?(0,C.jsx)(_,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}):(0,C.jsx)(u,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]},e.absolutePath)})]}),(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(`label`,{htmlFor:M,className:`text-xs text-fg-muted`,children:i.pickerManualPath}),(0,C.jsx)(`input`,{id:M,type:`text`,value:z,onChange:e=>P({type:`patch`,patch:{manualPath:e.target.value}}),placeholder:i.pathInputPlaceholder,className:w(),autoComplete:`off`,spellCheck:!1,onKeyDown:e=>{e.key===`Enter`&&z.trim()&&(e.preventDefault(),$())}})]})]}),(0,C.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[(0,C.jsx)(p,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:i.pathModalCancel}),(0,C.jsx)(p,{type:`button`,variant:`secondary`,disabled:!z.trim(),onClick:()=>void $(),children:i.pickerApplyManual}),(0,C.jsx)(p,{type:`button`,disabled:!W&&!Y,onClick:()=>void oe(),children:A??i.pickerUseThisFolder})]})]})]})})}export{g as i,v as n,_ as r,O as t};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,o as i}from"./locale-store-B6OrWgY1.js";import{a as ee,i as a,o,r as s,s as c,t as te}from"./dist-BGTk37IG.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./file-archive-DanfQJNe.js";import{t as d}from"./loader-circle-CifKLtgG.js";import{t as f}from"./cn-0WouolD0.js";import{t as p}from"./button-Cc4hUNTt.js";import{n as ne}from"./interaction-BdhHBbYa.js";import{s as m}from"./form-field-width-DJw_jULe.js";import{r as h}from"./settings-form-draft-Dy10ldo8.js";var g=l(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),_=l(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),v=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),y=e(t(),1);async function b(e){let t=new URLSearchParams;e!=null&&e!==``&&t.set(`path`,e);let n=t.toString();return(await i(r(`/api/host/fs/list${n?`?${n}`:``}`))).payload}async function x(){return(await i(r(`/api/host/fs/meta`))).payload}async function S(e,t){return(await i(r(`/api/host/fs/directory`),{method:`POST`,body:JSON.stringify({parentPath:e,name:t})})).payload.absolutePath}var C=n();function w(){return f(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-sm text-fg`,`placeholder:text-fg-subtle`,m,`dark:border-edge`)}function T(e){return/^[A-Za-z]:\\?$/.test(e.replace(/\\$/,`\\`))}function E(e){return!e||e.currentPath===``?!1:e.parentPath!==null||e.currentPath!==`/`&&!!T(e.currentPath)}var D={metaHostname:null,listState:null,listLoading:!1,listError:null,manualPath:``,createFolderOpen:!1,createFolderName:``,createFolderLoading:!1,createFolderError:null,selectedFilePath:``};function O({open:e,onOpenChange:t,initialAbsolutePath:n,onConfirm:r,wd:i,selectKind:l=`directory`,fileExtensions:m,title:O,description:k,confirmLabel:A,nested:j=!1}){let M=(0,y.useId)(),N=(0,y.useId)(),[re,P]=(0,y.useReducer)(h,D),{metaHostname:F,listState:I,listLoading:L,listError:R,manualPath:z,createFolderOpen:B,createFolderName:V,createFolderLoading:H,createFolderError:U,selectedFilePath:W}=re,G=(0,y.useCallback)(async e=>{P({type:`patch`,patch:{listLoading:!0,listError:null,selectedFilePath:``}});try{let t=await b(e);P({type:`patch`,patch:{listState:t}})}catch(e){let t=e instanceof Error?e.message:String(e);P({type:`patch`,patch:{listError:t,listState:null}})}finally{P({type:`patch`,patch:{listLoading:!1}})}},[]);(0,y.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await x();t||P({type:`patch`,patch:{metaHostname:e.hostname}})}catch{t||P({type:`patch`,patch:{metaHostname:null}})}})(),()=>{t=!0}},[e]),(0,y.useEffect)(()=>{if(!e)return;let t=n?.trim()??``;P({type:`patch`,patch:{manualPath:t,createFolderOpen:!1,createFolderName:``,createFolderLoading:!1,createFolderError:null,selectedFilePath:``}});let r=!1;return(async()=>{P({type:`patch`,patch:{listLoading:!0,listError:null}});try{if(t)try{let e=await b(t);r||P({type:`patch`,patch:{listState:e}})}catch{let e=await b();r||P({type:`patch`,patch:{listState:e}})}else{let e=await b();r||P({type:`patch`,patch:{listState:e}})}}catch(e){let t=e instanceof Error?e.message:String(e);r||P({type:`patch`,patch:{listError:t,listState:null}})}finally{r||P({type:`patch`,patch:{listLoading:!1}})}})(),()=>{r=!0}},[e,n]);let K=e=>{e.isDirectory&&(P({type:`patch`,patch:{selectedFilePath:``}}),G(e.absolutePath))},q=()=>{if(!I)return;let{parentPath:e,currentPath:t}=I;if(e!==null){G(e);return}t===`/`||t===``||T(t)&&G(void 0)},J=I?.currentPath===``?i.pickerDrives:I?.currentPath??``,Y=!!I&&I.currentPath!==``&&!L&&!R,X=m?.map(e=>e.replace(/^\./,``).toLocaleLowerCase()),ie=e=>{if(l!==`file-or-directory`||e.isDirectory)return!1;if(!X?.length)return!0;let t=e.name.includes(`.`)?e.name.split(`.`).pop()?.toLocaleLowerCase():``;return!!(t&&X.includes(t))},ae=Y&&!H,Z=()=>{P({type:`patch`,patch:{createFolderOpen:!1,createFolderName:``,createFolderError:null}})},Q=async()=>{let e=V.trim();if(!(!I||I.currentPath===``||!e||H)){P({type:`patch`,patch:{createFolderLoading:!0,createFolderError:null}});try{let t=await S(I.currentPath,e);P({type:`patch`,patch:{createFolderOpen:!1,createFolderName:``,createFolderError:null}}),await G(t)}catch(e){let t=e?.status,n=t===409?i.pickerCreateFolderExists:t===400?i.pickerCreateFolderInvalid:t===403?i.pickerCreateFolderPermission:i.pickerCreateFolderError;P({type:`patch`,patch:{createFolderError:n}})}finally{P({type:`patch`,patch:{createFolderLoading:!1}})}}},oe=async()=>{let e=W||I?.currentPath;if(e)try{await r(e),t(!1)}catch{}},$=async()=>{let e=z.trim();if(e)try{await r(e),t(!1)}catch{}},se=L&&I;return(0,C.jsx)(te,{open:e,onOpenChange:t,children:(0,C.jsxs)(o,{children:[(0,C.jsx)(ee,{className:f(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[2px]`,j?`z-[139]`:`z-[100]`)}),(0,C.jsxs)(s,{className:f(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,32rem)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover`,j?`z-[140]`:`z-[101]`,`dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,C.jsx)(c,{className:`text-base font-semibold text-fg`,children:O??i.pathModalTitle}),(0,C.jsx)(a,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:k??i.pathModalDescription}),F?(0,C.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i.pickerHostHint.replace(`{{hostname}}`,F)}):null,(0,C.jsxs)(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(p,{type:`button`,variant:`secondary`,className:`shrink-0 gap-1 px-2 py-1.5 text-xs`,disabled:L||!E(I)||!!R,onClick:()=>q(),title:i.pickerUp,children:[(0,C.jsx)(g,{className:`size-4`,"aria-hidden":!0}),i.pickerUp]}),(0,C.jsx)(`div`,{className:`min-w-0 flex-1 truncate rounded-md border border-edge-subtle/80 bg-surface-hover/30 px-2 py-1.5 font-mono text-xs text-fg`,title:J,children:L&&!I?i.pickerLoading:J||`—`}),(0,C.jsxs)(p,{type:`button`,variant:`secondary`,className:`shrink-0 gap-1 px-2 py-1.5 text-xs`,disabled:!ae,onClick:()=>P({type:`patch`,patch:{createFolderOpen:!0,createFolderName:``,createFolderError:null}}),title:i.pickerNewFolder,children:[(0,C.jsx)(v,{className:`size-4`,"aria-hidden":!0}),i.pickerNewFolder]})]}),B?(0,C.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-2`,children:[(0,C.jsx)(`label`,{htmlFor:N,className:`text-xs font-medium text-fg-muted`,children:i.pickerNewFolderName}),(0,C.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[(0,C.jsx)(`input`,{id:N,type:`text`,value:V,onChange:e=>P({type:`patch`,patch:{createFolderName:e.target.value,createFolderError:null}}),className:w(),autoFocus:!0,autoComplete:`off`,spellCheck:!1,disabled:H,onKeyDown:e=>{e.key===`Enter`&&V.trim()?(e.preventDefault(),Q()):e.key===`Escape`&&(e.preventDefault(),Z())}}),(0,C.jsx)(p,{type:`button`,variant:`ghost`,className:`shrink-0`,disabled:H,onClick:Z,children:i.pickerCreateFolderCancel}),(0,C.jsxs)(p,{type:`button`,variant:`primary`,className:`shrink-0`,disabled:!V.trim()||H,onClick:()=>void Q(),children:[H?(0,C.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,i.pickerCreateFolder]})]}),U?(0,C.jsx)(`p`,{className:`mt-1.5 text-xs text-danger`,role:`alert`,children:U}):null]}):null,(0,C.jsxs)(`div`,{className:f(`relative min-h-[12rem] overflow-y-auto rounded-lg border border-edge-subtle/80 bg-surface-hover/20 p-1 dark:border-edge-subtle`,ne.focusRingPanel),role:`listbox`,"aria-label":O??i.pathModalTitle,children:[se?(0,C.jsx)(`div`,{className:`absolute inset-0 z-[1] flex items-center justify-center rounded-lg bg-surface-panel/60`,"aria-hidden":!0,children:(0,C.jsx)(d,{className:`size-6 animate-spin text-fg-muted`})}):null,L&&!I?(0,C.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-12 text-sm text-fg-muted`,children:[(0,C.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}),i.pickerLoading]}):null,R?(0,C.jsx)(`p`,{className:`px-2 py-8 text-center text-sm text-fg-muted`,children:i.pickerListError}):null,!L&&I&&!R&&I.entries.length===0?(0,C.jsx)(`p`,{className:`px-2 py-8 text-center text-sm text-fg-muted`,children:i.pickerEmptyFolder}):null,I?.entries.map(e=>{let t=ie(e),n=W===e.absolutePath;return(0,C.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,disabled:!e.isDirectory&&!t,className:f(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm`,e.isDirectory||t?`cursor-pointer text-fg hover:bg-surface-hover`:`cursor-default text-fg-muted opacity-60`,n&&`bg-accent-soft text-accent-fg ring-1 ring-inset ring-accent`),onClick:()=>e.isDirectory?K(e):t&&P({type:`patch`,patch:{selectedFilePath:e.absolutePath}}),children:[e.isDirectory?(0,C.jsx)(_,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}):(0,C.jsx)(u,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]},e.absolutePath)})]}),(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(`label`,{htmlFor:M,className:`text-xs text-fg-muted`,children:i.pickerManualPath}),(0,C.jsx)(`input`,{id:M,type:`text`,value:z,onChange:e=>P({type:`patch`,patch:{manualPath:e.target.value}}),placeholder:i.pathInputPlaceholder,className:w(),autoComplete:`off`,spellCheck:!1,onKeyDown:e=>{e.key===`Enter`&&z.trim()&&(e.preventDefault(),$())}})]})]}),(0,C.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[(0,C.jsx)(p,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:i.pathModalCancel}),(0,C.jsx)(p,{type:`button`,variant:`secondary`,disabled:!z.trim(),onClick:()=>void $(),children:i.pickerApplyManual}),(0,C.jsx)(p,{type:`button`,disabled:!W&&!Y,onClick:()=>void oe(),children:A??i.pickerUseThisFolder})]})]})]})})}export{g as i,v as n,_ as r,O as t};
|
package/dist/gateway/static/root/assets/{workspace-api-Am2ee4R6.js → workspace-api-HBXn8pL9.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-manager-
|
|
2
|
-
import{t as e}from"./preload-helper-Czpn1I53.js";import{a as t,i as n}from"./locale-store-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-manager-X4UHOjjO.js","assets/rolldown-runtime-aKtaBQYM.js","assets/locale-store-B6OrWgY1.js","assets/vendor-react-BOUWij0V.js","assets/messages-jwdBhfL9.js","assets/schemas-CCWMleym.js","assets/constants-DBtMsXdW.js","assets/session-api-Bfmlmn9F.js","assets/gateway-startup-retry-C8g666Ja.js","assets/local-session-drafts-DTq9776a.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-BSRNLciy.js","assets/gateway-realtime-store-BFeFfApQ.js","assets/registry-api-Bl2guMRg.js","assets/preload-helper-Czpn1I53.js","assets/agents-admin-api-CXCAHNPj.js","assets/gateway-config-swr-D6cc6W6E.js","assets/vendor-swr-CdRzEUwF.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import{a as t,i as n}from"./locale-store-B6OrWgY1.js";import{i as r,n as i,r as a,t as o}from"./files-BNL4kkSB.js";async function s(e){let t=await e.json().catch(()=>null);return Error(t?.error?.message??`HTTP ${e.status}`)}async function c(e,r){let i=await t(n(e),r);if(!i.ok)throw await s(i);return i.json()}async function l(t){if(!t?.projectId&&t?.conversationId){let{SessionManager:n}=await e(async()=>{let{SessionManager:e}=await import(`./session-manager-X4UHOjjO.js`).then(e=>e.n);return{SessionManager:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));await new n().materialize(t.conversationId,`session_resources`)}let n=t?.projectId?{kind:`project`,id:t.projectId}:t?.conversationId?{kind:`session`,id:t.conversationId}:t?.agentId?{kind:`agent`,id:t.agentId}:null;if(n){let e=await c(`/api/files/contexts/${n.kind}/${encodeURIComponent(n.id)}`);return r.parse(e.space)}let i=await c(`/api/files/default-space`);return r.parse(i.space)}function u(e){return{id:e.id,name:e.name,path:e.relativePath,isDirectory:e.kind===`directory`,mimeType:e.mimeType,revision:e.revision}}async function d(e,t){let n=await l(t),r=await c(`/api/files/resolve`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,taskRunId:t?.taskRunId})});return i.parse(r.resource)}async function f(e,t){return d(e,t)}async function p(e=``,t){let n=await l(t),r=new URLSearchParams;return e&&r.set(`path`,e),{entries:a.parse(await c(`/api/files/spaces/${encodeURIComponent(n.id)}/children${r.size?`?${r}`:``}`)).items.map(u)}}async function m(e=``,t){return(await p(e,t)).entries}async function h(e){let t=await l(e);return u(o.parse(await c(`/api/files/spaces/${encodeURIComponent(t.id)}/root`)).resource)}async function g(e,t,n=50){let r=await l(t),i=new URLSearchParams({q:e.trim(),limit:String(n),spaceId:r.id});return a.parse(await c(`/api/files/search?${i}`)).items.map(u)}async function _(e,r){let i=await d(e,r),a=await t(n(`/api/files/${encodeURIComponent(i.id)}/content`));if(!a.ok)throw await s(a);return{content:await a.text(),path:i.relativePath,mtimeMs:i.modifiedAt,revision:a.headers.get(`ETag`)??i.revision}}async function v(e,t){let n;try{n=await l(t)}catch{return null}try{let r=await c(`/api/files/resolve`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,taskRunId:t?.taskRunId})}),a=i.parse(r.resource);return{absolutePath:r.absolutePath,fileId:a.id,inputPath:e,displayName:a.name,scope:r.absolutePath?`external`:`workspace`,locationKind:r.absolutePath?`host`:`workspace`,exists:!0,isDirectory:a.kind===`directory`,workspaceRelativePath:a.relativePath,capabilities:a.capabilities.filter(e=>e===`preview`||e===`edit`),mtimeMs:a.modifiedAt}}catch{try{return(await c(`/api/files/resolve-reference`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,conversationId:t?.conversationId})})).reference}catch{return null}}}async function y(e,t,n){return await c(`/api/files/references/${encodeURIComponent(e)}/action`,{method:`POST`,body:JSON.stringify({action:t,conversationId:n?.conversationId})})}async function b(e,r){let i=await d(e,r),a=await t(n(`/api/files/${encodeURIComponent(i.id)}/content`),{headers:{Accept:`*/*`}});if(!a.ok)throw await s(a);return a.blob()}async function x(e,t,n,r){let a=await d(e,n),o=await c(`/api/files/${encodeURIComponent(a.id)}/content`,{method:`PUT`,body:JSON.stringify({content:t,revision:r??a.revision})}),s=i.parse(o.resource);return{path:s.relativePath,mtimeMs:s.modifiedAt,revision:s.revision}}async function S(e,r=``,i){let a=await l(i),c=new FormData;c.set(`directory`,r),c.set(`file`,e);let d=await t(n(`/api/files/spaces/${encodeURIComponent(a.id)}/upload`),{method:`POST`,body:c});if(!d.ok)throw await s(d);return u(o.parse(await d.json()).resource)}async function C(e){let r=await t(n(`/api/files/${encodeURIComponent(e)}`),{method:`DELETE`});if(!r.ok)throw await s(r)}function w(e,t){let n=new Blob([t],{type:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function T(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}export{b as a,_ as c,f as d,g as f,p as i,y as l,x as m,T as n,h as o,S as p,w as r,m as s,C as t,v as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e}from"./locale-store-B6OrWgY1.js";var t=e(e=>({agentId:``,setAgentId:t=>e({agentId:t})}));export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-B6OrWgY1.js";import{t as a}from"./messages-jwdBhfL9.js";import{c as o,m as s,n as c,o as l,s as u,t as d,x as f}from"./use-file-preview-expanded-CW956CXS.js";import{n as p}from"./share-link-dialog-BMcXyzr2.js";import{t as m}from"./cn-0WouolD0.js";import{t as h}from"./skeleton-BI5TyibZ.js";import{a as ee,s as g,t as _}from"./file-preview-surface-zE9AcaHM.js";import{t as v}from"./copy-to-clipboard-HOJ79TWv.js";import{i as y}from"./theme-store-TkG5mo0p.js";import{n as b}from"./electron-env-DHOGevH3.js";var x=e(n(),1);async function S(e,t){try{let n=await e();return n&&`ok`in n&&n.code===`CANCELED`?!1:n&&(`ok`in n?n.ok:n.success)?!0:(f(`warning`,n?.error||t,void 0,{duration:4e3}),!1)}catch{return f(`warning`,t,void 0,{duration:4e3}),!1}}var C=new Map;function w(e,t){return C.set(e,t),()=>{C.get(e)===t&&C.delete(e)}}async function T(e){return await C.get(e)?.()??!0}var E=t({WorkspaceFilePreviewPanel:()=>j}),D=r(),O=new Intl.DateTimeFormat(`zh-CN`,{dateStyle:`medium`,timeStyle:`short`}),k=new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`});function A(e,t){return(t===`zh`?O:k).format(new Date(e))}function j({filePath:e,tabId:t,active:n=!0,onClose:r,targetLine:C,resultRevision:T,projectId:E,conversationId:O,agentId:k}){let j=i(e=>e.language),M=a(j),N=y(e=>e.resolved),P=o({filePath:e,projectId:E,conversationId:O,agentId:k,initialEditMode:t?l(t).sourceEditMode:!1}),{dialogOpen:F,loading:I,result:L,error:R,pendingParams:z,createShareLink:B,confirmShareLink:V,handleOpenChange:H}=ee(),[U,W]=(0,x.useState)(!1),[G,K]=(0,x.useState)(!1),{expanded:q,setExpanded:J}=d(!!e,F);(0,x.useEffect)(()=>{t&&u(t,{sourceEditMode:P.sourceEditMode})},[P.sourceEditMode,t]),(0,x.useEffect)(()=>{if(t)return w(t,P.flushSource)},[P.flushSource,t]),(0,x.useEffect)(()=>{t&&P.fileResourceId&&g.getState().resolveFileIdentity(t,P.fileResourceId)},[P.fileResourceId,t]),(0,x.useEffect)(()=>{t&&g.getState().setFileStatus(t,P.saveStatus===`error`?`error`:P.dirty?`dirty`:null)},[P.dirty,P.saveStatus,t]),(0,x.useEffect)(()=>{let e=()=>{document.visibilityState!==`hidden`&&P.checkForUpdates()};return window.addEventListener(`focus`,e),window.addEventListener(`workspace-refresh-files`,e),window.addEventListener(`agent-run-ended`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`workspace-refresh-files`,e),window.removeEventListener(`agent-run-ended`,e),document.removeEventListener(`visibilitychange`,e)}},[P.checkForUpdates]);let Y=e?s(e):``,X=[`text`,`markdown`,`code`,`html`].includes(P.descriptor.type),Z=(0,x.useCallback)(async()=>{if(e){if(await v(e)){W(!0),f(`success`,M.workspace.pathCopied,void 0,{duration:2500}),window.setTimeout(()=>W(!1),2e3);return}f(`warning`,M.clipboard.copyFailed,void 0,{duration:4e3})}},[e,M.clipboard.copyFailed,M.workspace.pathCopied]),Q=(0,x.useCallback)(()=>{P.fileResourceId&&B({fileId:P.fileResourceId,fileName:Y})},[B,Y,P.fileResourceId]),$=(0,x.useCallback)(async()=>{await S(()=>P.onOpenWithSystemApp(),M.chat.attachmentPreviewOpenLocalFailed)},[M.chat.attachmentPreviewOpenLocalFailed,P.onOpenWithSystemApp]),te=(0,x.useCallback)(async()=>{let e;return await S(async()=>{let t=await P.onChooseOpenWithApp();return t?.ok&&(e=t.app),t},M.workspace.openFileFailed),e},[M.workspace.openFileFailed,P.onChooseOpenWithApp]),ne=(0,x.useCallback)(async e=>{await S(()=>P.onOpenWithRecentApp(e),M.workspace.openFileFailed)},[M.workspace.openFileFailed,P.onOpenWithRecentApp]),re=(0,x.useCallback)(async()=>{await S(()=>P.onRevealInFolder(),M.workspace.revealFileFailed)},[M.workspace.revealFileFailed,P.onRevealInFolder]),ie=(0,x.useCallback)(()=>{J(!1),r()},[r]),ae=!!(e&&!P.loading&&!P.loadError),oe={onDownload:()=>void P.onDownload(),canDownload:P.canDownload,onOpenWithSystemApp:()=>void $(),canOpenWithSystemApp:P.canOpenWithSystemApp,onChooseOpenWithApp:()=>void P.onChooseOpenWithApp(),canChooseOpenWithApp:P.canChooseOpenWithApp};return!e||!n?null:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{expanded:q,children:(0,D.jsx)(c,{header:{subtitle:(0,D.jsxs)(D.Fragment,{children:[!P.loading&&P.mtimeMs!=null?(0,D.jsxs)(`p`,{suppressHydrationWarning:!0,className:`min-w-0 truncate`,title:new Date(P.mtimeMs).toISOString(),children:[M.workspace.lastModified,`: `,A(P.mtimeMs,j),C?` · Line ${C}`:``]}):null,P.externalChange?(0,D.jsx)(`span`,{role:`status`,className:`text-fg-muted`,children:j===`zh`?`文件已更新,请先处理当前编辑`:`File changed; review your current edits`}):null,T?(0,D.jsxs)(`span`,{className:`shrink-0`,"data-result-revision":!0,children:[j===`zh`?`成果版本`:`Result version`,` `,T]}):null,P.loading?(0,D.jsx)(h,{className:`h-3.5 w-32`}):null,X&&P.sourceEditMode&&P.saveStatus!==`idle`?(0,D.jsx)(`span`,{className:m(`shrink-0`,P.saveStatus===`error`&&`text-red-600 dark:text-red-400`),children:P.saveStatus===`saving`?M.workspace.saving:P.saveStatus===`error`?M.workspace.saveFailed:M.workspace.saved}):null]}),expanded:q,onRefresh:P.refresh,onRetrySave:P.saveStatus===`error`?()=>void P.flushSource():void 0,onToggleExpanded:ae?()=>J(e=>!e):void 0,hideClose:!!t,onClose:ie,edit:X?{active:P.sourceEditMode,onToggle:()=>P.setSourceEditMode(e=>!e)}:void 0,wordWrap:X&&P.sourceEditMode?{active:G,onToggle:()=>K(e=>!e)}:void 0,share:{onClick:Q,loading:I,disabled:!P.fileResourceId||P.loading||!!P.loadError},openWithSystemApp:P.canOpenWithSystemApp||b()&&window.electronAPI?.shell?.openFileResource?{onClick:()=>void $(),disabled:P.loading||!P.canOpenWithSystemApp}:void 0,chooseApp:P.canChooseOpenWithApp?{onClick:te}:void 0,recommendedApps:P.recommendedOpenWithApps,recentApps:P.recentOpenWithApps,onOpenWithApp:e=>void ne(e),onRevealInFolder:P.canRevealInFolder?()=>void re():void 0,copyPath:{copied:U,onClick:()=>void Z()}},chat:{createFile:P.createAttachmentFile,projectId:E,conversationId:O,agentId:k,disabled:P.saveStatus===`saving`},language:j,resolvedTheme:N,descriptor:t?{...P.descriptor,id:t}:P.descriptor,loading:P.loading,loadError:P.loadError,textContent:P.textContent,binaryBuffer:P.binaryBuffer,fileResourceId:P.fileResourceId,mtimeMs:P.mtimeMs,targetLine:C,extractedText:P.extractedText,extractedTextTruncated:P.extractedTextTruncated,workspaceEditing:{sourceEditMode:P.sourceEditMode,onSourceChange:e=>{t&&g.getState().keepFileOpen(t),P.onSourceChange(e)},sourceWordWrap:G,isDark:N===`dark`},actions:oe})}),(0,D.jsx)(p,{open:F,onOpenChange:H,loading:I,error:R,result:L,pendingParams:z,onConfirm:e=>void V(e)})]})}export{S as i,E as n,T as r,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{n as r}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{n as r}from"./locale-store-B6OrWgY1.js";import{t as i}from"./messages-jwdBhfL9.js";import{t as a}from"./createLucideIcon-DPHK1VkS.js";import{t as o}from"./chevron-down-ccbiQQz_.js";import{t as s}from"./copy-Dv6d4Dvw.js";import{t as c}from"./folder-open-CyzJ19I9.js";import{x as l}from"./use-file-preview-expanded-CW956CXS.js";import{t as u}from"./cn-0WouolD0.js";import{t as d}from"./button-Cc4hUNTt.js";import{a as f,i as p,o as m,s as h}from"./dist-GJ8-1PAx.js";import{n as g}from"./electron-env-DHOGevH3.js";var _=a(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),v=a(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),y=a(`focus`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]),b=a(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),x=a(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),S=a(`monitor-up`,[[`path`,{d:`m9 10 3-3 3 3`,key:`11gsxs`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),C=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),w=e(t(),1),T=n();function E({resourceId:e,displayName:t,className:n}){let a=i(r(e=>e.language)).workspace,[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)([]),[x,C]=(0,w.useState)([]),[E,D]=(0,w.useState)(!1),O=g(),k=O?window.electronAPI?.shell:void 0,A=O&&!!e.trim(),j=!!k?.openFileResource,M=(0,w.useCallback)(async()=>{if(!k?.getOpenWithAppsForFileResource||!e.trim()){b([]),C([]);return}try{let t=await k.getOpenWithAppsForFileResource(e);b(t.recommended.map(e=>({name:e.name,path:e.path}))),C(t.recent.map(e=>({name:e.name,path:e.path})))}catch{b([]),C([])}},[e,k]);(0,w.useEffect)(()=>{M()},[M]);let N=(0,w.useCallback)(e=>{l(`warning`,e||a.openLocationFailed,void 0,{duration:4e3})},[a.openLocationFailed]),P=(0,w.useCallback)(async()=>{if(!(!k?.openFileResource||!e)){D(!0);try{let t=await k.openFileResource(e);t.ok===!1&&N(t.error)}finally{D(!1),v(!1)}}},[N,e,k]),F=(0,w.useCallback)(async t=>{if(!(!k?.openFileResourceWithApp||!e)){D(!0);try{let n=await k.openFileResourceWithApp(e,t);n.ok===!1?N(n.error):M()}finally{D(!1),v(!1)}}},[M,N,e,k]),I=(0,w.useCallback)(async()=>{if(!(!k?.chooseAppAndOpenFileResource||!e)){D(!0);try{let t=await k.chooseAppAndOpenFileResource(e);t.ok===!1&&t.code!==`CANCELED`&&N(t.error),t.ok&&M()}finally{D(!1),v(!1)}}},[M,N,e,k]),L=(0,w.useCallback)(async()=>{if(!k?.copyFileResourcePath||!e)return;let t=await k.copyFileResourcePath(e);l(t.ok?`success`:`warning`,t.ok?a.pathCopied:t.error||a.copyPathFailed,void 0,{duration:t.ok?2500:4e3}),v(!1)},[a.copyPathFailed,a.pathCopied,e,k]);if(!A)return null;if(!j)return(0,T.jsxs)(d,{variant:`ghost`,className:u(`min-w-0 max-w-40 shrink rounded-md px-2 py-1.5 text-xs`,n),disabled:!0,title:a.desktopUpdateRequired,children:[(0,T.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:t||a.openLocation})]});let R=`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm text-fg hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,z=y[0]??x[0],B=z?y.filter(e=>e.path!==z.path):y,V=z?x.filter(e=>e.path!==z.path):x;return(0,T.jsxs)(m,{open:_,onOpenChange:e=>{v(e),e&&M()},children:[(0,T.jsx)(h,{asChild:!0,children:(0,T.jsxs)(d,{variant:`ghost`,className:u(`min-w-0 max-w-40 shrink rounded-md px-2 py-1.5 text-xs`,n),"aria-label":a.openLocation,title:a.openLocation,children:[(0,T.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:z?.name??t??a.openLocation}),(0,T.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]})}),(0,T.jsx)(f,{children:(0,T.jsxs)(p,{align:`end`,side:`bottom`,sideOffset:6,className:`z-50 w-60 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,children:[z?(0,T.jsxs)(`button`,{type:`button`,disabled:E,className:R,title:z.path,onClick:()=>void F(z.path),children:[(0,T.jsx)(S,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:z.name})]}):null,(0,T.jsx)(`div`,{className:u(z&&`border-t border-edge pt-1`),children:(0,T.jsxs)(`button`,{type:`button`,disabled:E,className:R,onClick:()=>void P(),children:[(0,T.jsx)(c,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),a.openInFileManager]})}),B.length>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{className:`border-t border-edge px-2.5 pb-1 pt-2 text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:a.recommendedApps}),B.map(e=>(0,T.jsxs)(`button`,{type:`button`,disabled:E,className:R,title:e.path,onClick:()=>void F(e.path),children:[(0,T.jsx)(S,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))]}):null,V.length>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{className:`border-t border-edge px-2.5 pb-1 pt-2 text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:a.recentApps}),V.map(e=>(0,T.jsxs)(`button`,{type:`button`,disabled:E,className:R,title:e.path,onClick:()=>void F(e.path),children:[(0,T.jsx)(S,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))]}):null,(0,T.jsxs)(`div`,{className:`mt-1 border-t border-edge pt-1`,children:[(0,T.jsxs)(`button`,{type:`button`,disabled:E,className:R,onClick:()=>void I(),children:[(0,T.jsx)(S,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),a.chooseApp]}),(0,T.jsxs)(`button`,{type:`button`,disabled:E||!k?.copyFileResourcePath,className:R,onClick:()=>void L(),children:[(0,T.jsx)(s,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),a.copyPath]})]})]})})]})}export{b as a,_ as c,x as i,C as n,y as o,S as r,v as s,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,n as r,o as i}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,n as r,o as i}from"./locale-store-B6OrWgY1.js";import{t as a}from"./cloud-C4-yfnnk.js";import{t as o}from"./external-link-DjqjBmc3.js";import{t as s}from"./refresh-cw-BRlGaq2w.js";import{t as c}from"./triangle-alert-2JXFNNKU.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{n as u,t as d}from"./cloud-credits-B-nbtkqv.js";import{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-Cc4hUNTt.js";var m=e(),h=t();function g(e){let t=(BigInt(e)+500n)/1000n*1000n;return u(String(t))}async function _(){let e=await i(n(`/api/models/xopc-cloud/account-summary`));return d.parse(e.payload)}function v(e){let t=(0,m.c)(152),{labels:n,children:i}=e,u=r(y)===`zh`?`zh-CN`:`en-US`,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={refreshInterval:6e4,revalidateOnFocus:!0},t[0]=d):d=t[0];let{data:v,error:b,isLoading:x,isValidating:S,mutate:C}=f(`/api/models/xopc-cloud/account-summary`,_,d);if(x){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(l,{className:`h-40 w-full rounded-xl`}),t[1]=e):e=t[1],e}if(b||!v){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),t[2]=e):e=t[2];let r;t[3]===n.title?r=t[4]:(r=(0,h.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[3]=n.title,t[4]=r);let a;t[5]===n.unavailable?a=t[6]:(a=(0,h.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.unavailable}),t[5]=n.unavailable,t[6]=a);let o;t[7]!==r||t[8]!==a?(o=(0,h.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[e,(0,h.jsxs)(`div`,{children:[r,a]})]}),t[7]=r,t[8]=a,t[9]=o):o=t[9];let l;t[10]===C?l=t[11]:(l=()=>void C(),t[10]=C,t[11]=l);let u=S?`size-4 animate-spin`:`size-4`,d;t[12]===u?d=t[13]:(d=(0,h.jsx)(s,{className:u,"aria-hidden":!0}),t[12]=u,t[13]=d);let f;t[14]!==S||t[15]!==n.retry||t[16]!==l||t[17]!==d?(f=(0,h.jsxs)(p,{type:`button`,variant:`secondary`,disabled:S,onClick:l,children:[d,n.retry]}),t[14]=S,t[15]=n.retry,t[16]=l,t[17]=d,t[18]=f):f=t[18];let m;t[19]!==o||t[20]!==f?(m=(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[o,f]}),t[19]=o,t[20]=f,t[21]=m):m=t[21];let g;return t[22]!==i||t[23]!==m?(g=(0,h.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/25 p-4`,children:[m,i]}),t[22]=i,t[23]=m,t[24]=g):g=t[24],g}let w,T,E,D,O,k,A,j,M,N;if(t[25]!==v.balance.availableCreditMicro||t[26]!==v.balance.expiring[0]||t[27]!==v.balance.grantedCreditMicro||t[28]!==v.balance.purchasedCreditMicro||t[29]!==v.balance.refundReservedCreditMicro||t[30]!==v.balance.usageReservedCreditMicro||t[31]!==v.links.details||t[32]!==v.links.purchase||t[33]!==v.usage.chargedCreditMicro||t[34]!==v.usage.requests||t[35]!==v.usage.totalTokens||t[36]!==n.availableCredits||t[37]!==n.connected||t[38]!==n.details||t[39]!==n.expiring||t[40]!==n.granted||t[41]!==n.purchase||t[42]!==n.purchased||t[43]!==n.recentUsage||t[44]!==n.reserved||t[45]!==n.title||t[46]!==n.tokenUsage||t[47]!==n.usageSummary||t[48]!==n.zeroBalance||t[49]!==u){let e=new Intl.NumberFormat(u),r=n.usageSummary.replace(`{{credits}}`,g(v.usage.chargedCreditMicro)).replace(`{{requests}}`,e.format(v.usage.requests));w=`rounded-xl bg-surface-hover/40 p-4 sm:p-5`;let i;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(a,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),t[60]=i):i=t[60];let s;t[61]===n.title?s=t[62]:(s=(0,h.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[61]=n.title,t[62]=s);let c;t[63]===n.connected?c=t[64]:(c=(0,h.jsx)(`span`,{className:`rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-300`,children:n.connected}),t[63]=n.connected,t[64]=c);let l;t[65]!==s||t[66]!==c?(l=(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i,s,c]}),t[65]=s,t[66]=c,t[67]=l):l=t[67];let d;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,h.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t[68]=d):d=t[68];let f;t[69]!==v.links.purchase||t[70]!==n.purchase?(f=(0,h.jsx)(p,{asChild:!0,variant:`primary`,children:(0,h.jsxs)(`a`,{href:v.links.purchase,target:`_blank`,rel:`noreferrer`,children:[n.purchase,d]})}),t[69]=v.links.purchase,t[70]=n.purchase,t[71]=f):f=t[71];let m;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,h.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t[72]=m):m=t[72];let _;t[73]!==v.links.details||t[74]!==n.details?(_=(0,h.jsx)(p,{asChild:!0,variant:`secondary`,children:(0,h.jsxs)(`a`,{href:v.links.details,target:`_blank`,rel:`noreferrer`,children:[n.details,m]})}),t[73]=v.links.details,t[74]=n.details,t[75]=_):_=t[75];let y;t[76]!==f||t[77]!==_?(y=(0,h.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[f,_]}),t[76]=f,t[77]=_,t[78]=y):y=t[78],t[79]!==l||t[80]!==y?(T=(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[l,y]}),t[79]=l,t[80]=y,t[81]=T):T=t[81],M=`mt-4 grid gap-4 rounded-lg bg-surface-base/45 p-3 sm:grid-cols-[minmax(12rem,0.7fr)_minmax(0,1.3fr)] sm:gap-6`;let b;t[82]===n.availableCredits?b=t[83]:(b=(0,h.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.availableCredits}),t[82]=n.availableCredits,t[83]=b);let x;t[84]===v.balance.availableCreditMicro?x=t[85]:(x=g(v.balance.availableCreditMicro),t[84]=v.balance.availableCreditMicro,t[85]=x);let S;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(`span`,{className:`ml-2 text-sm font-medium text-fg-muted`,children:`Credits`}),t[86]=S):S=t[86];let C;t[87]===x?C=t[88]:(C=(0,h.jsxs)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight text-fg`,children:[x,S]}),t[87]=x,t[88]=C);let P;t[89]!==v.balance.availableCreditMicro||t[90]!==n.zeroBalance?(P=v.balance.availableCreditMicro===`0`?(0,h.jsx)(`p`,{className:`mt-1 text-sm font-medium text-danger`,children:n.zeroBalance}):null,t[89]=v.balance.availableCreditMicro,t[90]=n.zeroBalance,t[91]=P):P=t[91];let F=n.purchased,I;t[92]===v.balance.purchasedCreditMicro?I=t[93]:(I=g(v.balance.purchasedCreditMicro),t[92]=v.balance.purchasedCreditMicro,t[93]=I);let L;t[94]!==n.purchased||t[95]!==I?(L=(0,h.jsxs)(`div`,{children:[F,`: `,I,` Credits`]}),t[94]=n.purchased,t[95]=I,t[96]=L):L=t[96];let R=n.granted,z;t[97]===v.balance.grantedCreditMicro?z=t[98]:(z=g(v.balance.grantedCreditMicro),t[97]=v.balance.grantedCreditMicro,t[98]=z);let B;t[99]!==n.granted||t[100]!==z?(B=(0,h.jsxs)(`div`,{children:[R,`: `,z,` Credits`]}),t[99]=n.granted,t[100]=z,t[101]=B):B=t[101];let V=n.reserved,H=String(BigInt(v.balance.usageReservedCreditMicro)+BigInt(v.balance.refundReservedCreditMicro)),U;t[102]===H?U=t[103]:(U=g(H),t[102]=H,t[103]=U);let W;t[104]!==n.reserved||t[105]!==U?(W=(0,h.jsxs)(`div`,{children:[V,`: `,U,` Credits`]}),t[104]=n.reserved,t[105]=U,t[106]=W):W=t[106];let G;t[107]!==L||t[108]!==B||t[109]!==W?(G=(0,h.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[L,B,W]}),t[107]=L,t[108]=B,t[109]=W,t[110]=G):G=t[110];let K;t[111]!==v.balance.expiring[0]||t[112]!==n.expiring||t[113]!==u?(K=v.balance.expiring[0]?(0,h.jsx)(`p`,{className:`mt-2 text-xs text-amber-600 dark:text-amber-400`,children:n.expiring.replace(`{{credits}}`,g(v.balance.expiring[0].creditMicro)).replace(`{{date}}`,new Date(v.balance.expiring[0].expiresAt).toLocaleDateString(u))}):null,t[111]=v.balance.expiring[0],t[112]=n.expiring,t[113]=u,t[114]=K):K=t[114],t[115]!==b||t[116]!==C||t[117]!==P||t[118]!==G||t[119]!==K?(N=(0,h.jsxs)(`div`,{children:[b,C,P,G,K]}),t[115]=b,t[116]=C,t[117]=P,t[118]=G,t[119]=K,t[120]=N):N=t[120],t[121]===n.recentUsage?A=t[122]:(A=(0,h.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.recentUsage}),t[121]=n.recentUsage,t[122]=A),j=(0,h.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:r}),O=`mt-2 text-xs text-fg-subtle`,t[123]===n.tokenUsage?k=t[124]:(k=(0,h.jsx)(`summary`,{className:`cursor-pointer`,children:n.tokenUsage}),t[123]=n.tokenUsage,t[124]=k),E=`mt-1`,D=e.format(v.usage.totalTokens),t[25]=v.balance.availableCreditMicro,t[26]=v.balance.expiring[0],t[27]=v.balance.grantedCreditMicro,t[28]=v.balance.purchasedCreditMicro,t[29]=v.balance.refundReservedCreditMicro,t[30]=v.balance.usageReservedCreditMicro,t[31]=v.links.details,t[32]=v.links.purchase,t[33]=v.usage.chargedCreditMicro,t[34]=v.usage.requests,t[35]=v.usage.totalTokens,t[36]=n.availableCredits,t[37]=n.connected,t[38]=n.details,t[39]=n.expiring,t[40]=n.granted,t[41]=n.purchase,t[42]=n.purchased,t[43]=n.recentUsage,t[44]=n.reserved,t[45]=n.title,t[46]=n.tokenUsage,t[47]=n.usageSummary,t[48]=n.zeroBalance,t[49]=u,t[50]=w,t[51]=T,t[52]=E,t[53]=D,t[54]=O,t[55]=k,t[56]=A,t[57]=j,t[58]=M,t[59]=N}else w=t[50],T=t[51],E=t[52],D=t[53],O=t[54],k=t[55],A=t[56],j=t[57],M=t[58],N=t[59];let P;t[125]!==E||t[126]!==D?(P=(0,h.jsxs)(`p`,{className:E,children:[D,` tokens`]}),t[125]=E,t[126]=D,t[127]=P):P=t[127];let F;t[128]!==P||t[129]!==O||t[130]!==k?(F=(0,h.jsxs)(`details`,{className:O,children:[k,P]}),t[128]=P,t[129]=O,t[130]=k,t[131]=F):F=t[131];let I;t[132]!==v.balance.updatedAt||t[133]!==n.updatedAt||t[134]!==u?(I=n.updatedAt.replace(`{{time}}`,new Date(v.balance.updatedAt).toLocaleString(u)),t[132]=v.balance.updatedAt,t[133]=n.updatedAt,t[134]=u,t[135]=I):I=t[135];let L;t[136]===I?L=t[137]:(L=(0,h.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:I}),t[136]=I,t[137]=L);let R;t[138]!==F||t[139]!==L||t[140]!==A||t[141]!==j?(R=(0,h.jsxs)(`div`,{children:[A,j,F,L]}),t[138]=F,t[139]=L,t[140]=A,t[141]=j,t[142]=R):R=t[142];let z;t[143]!==R||t[144]!==M||t[145]!==N?(z=(0,h.jsxs)(`div`,{className:M,children:[N,R]}),t[143]=R,t[144]=M,t[145]=N,t[146]=z):z=t[146];let B;return t[147]!==i||t[148]!==w||t[149]!==T||t[150]!==z?(B=(0,h.jsxs)(`section`,{className:w,children:[T,z,i]}),t[147]=i,t[148]=w,t[149]=T,t[150]=z,t[151]=B):B=t[151],B}function y(e){return e.language}export{v as t};
|