openpond 0.2.55 → 0.2.57
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/app-server.d.ts +10545 -10254
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-QU4H53OG.js +2 -0
- package/dist/chunks/{app-layer-Y2UERCPY.js → app-layer-NSTE5HIT.js} +1 -1
- package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
- package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
- package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
- package/dist/chunks/app-server-runtime-VCRNCNX2.js +2 -0
- package/dist/chunks/apps-BKTOR4F7.js +2 -0
- package/dist/chunks/chunk-25MBPJVY.js +2 -0
- package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
- package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
- package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
- package/dist/chunks/chunk-3K4VVB7S.js +6 -0
- package/dist/chunks/chunk-3QIB5FXI.js +10 -0
- package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
- package/dist/chunks/chunk-3VUATFZD.js +2 -0
- package/dist/chunks/chunk-3Z47M3YY.js +2 -0
- package/dist/chunks/{chunk-UA5DA5I2.js → chunk-4D7HWVWD.js} +1 -1
- package/dist/chunks/chunk-4EPSHPZL.js +2 -0
- package/dist/chunks/chunk-4NESNOK5.js +2 -0
- package/dist/chunks/chunk-523TE4BI.js +2 -0
- package/dist/chunks/{chunk-B7QDZPNX.js → chunk-5MCNZCVQ.js} +1 -1
- package/dist/chunks/chunk-6FDWRG55.js +2 -0
- package/dist/chunks/{chunk-DLVPSCTB.js → chunk-6QSSIT62.js} +1 -1
- package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
- package/dist/chunks/chunk-74IIXVAE.js +2 -0
- package/dist/chunks/chunk-74ZXXBGN.js +6 -0
- package/dist/chunks/chunk-773TH7FN.js +2 -0
- package/dist/chunks/chunk-7E6T7GP5.js +2 -0
- package/dist/chunks/chunk-7ED24PP6.js +2 -0
- package/dist/chunks/chunk-7HPDGZOR.js +86 -0
- package/dist/chunks/chunk-7KWD2I6W.js +2 -0
- package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
- package/dist/chunks/chunk-A6USMRWK.js +2 -0
- package/dist/chunks/chunk-ABD5M2D2.js +2 -0
- package/dist/chunks/chunk-ACYFMLWG.js +10 -0
- package/dist/chunks/chunk-AN525SPP.js +6 -0
- package/dist/chunks/chunk-APB2STJK.js +2 -0
- package/dist/chunks/chunk-AY64VY4E.js +2 -0
- package/dist/chunks/{chunk-G6JMQGX7.js → chunk-B7RFL4N2.js} +1 -1
- package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
- package/dist/chunks/chunk-D74JEERO.js +5 -0
- package/dist/chunks/{chunk-U2YMBCX7.js → chunk-DARVPBZ4.js} +1 -1
- package/dist/chunks/chunk-DBK66CJP.js +8 -0
- package/dist/chunks/chunk-DDMZSZFL.js +1 -0
- package/dist/chunks/chunk-DIO5CB6U.js +2 -0
- package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
- package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
- package/dist/chunks/chunk-DUURYZOI.js +2 -0
- package/dist/chunks/chunk-DZUAT3TP.js +1 -0
- package/dist/chunks/chunk-EIEZHFIW.js +6 -0
- package/dist/chunks/chunk-EIRYMSEG.js +19 -0
- package/dist/chunks/{chunk-R27YGT77.js → chunk-EKM2D7JU.js} +1 -1
- package/dist/chunks/chunk-EQFGBL3O.js +2 -0
- package/dist/chunks/chunk-EYPCBBMS.js +2 -0
- package/dist/chunks/chunk-F4KOGISR.js +10 -0
- package/dist/chunks/chunk-F74GBN6K.js +2 -0
- package/dist/chunks/chunk-FEAKTSRS.js +2 -0
- package/dist/chunks/chunk-FFRFSDBM.js +2 -0
- package/dist/chunks/chunk-FTEOCCPB.js +23 -0
- package/dist/chunks/chunk-FUOEIDMA.js +8 -0
- package/dist/chunks/{chunk-BQAF5P7K.js → chunk-FV2R5RUN.js} +2 -2
- package/dist/chunks/chunk-FWIPHEVA.js +12 -0
- package/dist/chunks/chunk-FY5KHLMW.js +2 -0
- package/dist/chunks/chunk-G3RXYI2L.js +6 -0
- package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
- package/dist/chunks/chunk-GLDYJM7O.js +1 -0
- package/dist/chunks/chunk-GPVCOEUH.js +2 -0
- package/dist/chunks/chunk-GW766ZSO.js +5 -0
- package/dist/chunks/chunk-GWCHDF2C.js +4 -0
- package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
- package/dist/chunks/chunk-H6IW2R22.js +140 -0
- package/dist/chunks/chunk-HCYX6RHP.js +2 -0
- package/dist/chunks/chunk-HDL5YSAA.js +2 -0
- package/dist/chunks/chunk-HIOKCIL7.js +2 -0
- package/dist/chunks/{chunk-IODUCRBA.js → chunk-HY3GOBFJ.js} +1 -1
- package/dist/chunks/chunk-HZEIRHEB.js +2 -0
- package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
- package/dist/chunks/chunk-I7AQMAQI.js +33 -0
- package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
- package/dist/chunks/chunk-J2TWKFML.js +1871 -0
- package/dist/chunks/chunk-JDEEWOD7.js +2 -0
- package/dist/chunks/chunk-JFXWI3EN.js +6 -0
- package/dist/chunks/chunk-JYKRR7E5.js +5 -0
- package/dist/chunks/chunk-KCJVFLBB.js +2 -0
- package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
- package/dist/chunks/chunk-KUERKVEU.js +3 -0
- package/dist/chunks/chunk-KVTBX2UP.js +2 -0
- package/dist/chunks/chunk-L3KS6MOV.js +2 -0
- package/dist/chunks/chunk-L6K7ERG5.js +2 -0
- package/dist/chunks/{chunk-MH3LHSGX.js → chunk-LQQNBVEB.js} +1 -1
- package/dist/chunks/{chunk-BTI4N7YO.js → chunk-M4JWQSV7.js} +1 -1
- package/dist/chunks/chunk-MQULU465.js +2 -0
- package/dist/chunks/chunk-MULXCKG7.js +10 -0
- package/dist/chunks/chunk-N4FFQPLR.js +2 -0
- package/dist/chunks/chunk-N73MU2C3.js +2 -0
- package/dist/chunks/chunk-NHQ36THU.js +3 -0
- package/dist/chunks/chunk-O6ULLQJ6.js +2 -0
- package/dist/chunks/chunk-O72BSKSO.js +2 -0
- package/dist/chunks/chunk-OGDADQGH.js +143 -0
- package/dist/chunks/chunk-OIUTWU6K.js +2 -0
- package/dist/chunks/chunk-OLLLZVHF.js +2 -0
- package/dist/chunks/chunk-OPNRWESL.js +3 -0
- package/dist/chunks/chunk-OQKJGTTO.js +4 -0
- package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
- package/dist/chunks/{chunk-TERVLCRG.js → chunk-OS3LO5J3.js} +1 -1
- package/dist/chunks/chunk-OUVIWDL2.js +2 -0
- package/dist/chunks/chunk-PCSIOUHF.js +7 -0
- package/dist/chunks/chunk-PF5R6CMP.js +21 -0
- package/dist/chunks/chunk-PPAPVGJP.js +3 -0
- package/dist/chunks/chunk-PRGBLQVH.js +2 -0
- package/dist/chunks/chunk-PSGGOZFM.js +2 -0
- package/dist/chunks/chunk-PUZQU66L.js +2 -0
- package/dist/chunks/{chunk-NOTXPD2T.js → chunk-Q2QL6UWN.js} +1 -1
- package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
- package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
- package/dist/chunks/chunk-QDC4OW3S.js +2 -0
- package/dist/chunks/chunk-QEFHOJFE.js +7 -0
- package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
- package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
- package/dist/chunks/chunk-QNG27G3T.js +6 -0
- package/dist/chunks/chunk-QOGJAQDO.js +3 -0
- package/dist/chunks/chunk-QOTVNQDI.js +4 -0
- package/dist/chunks/{chunk-NNIRIUSY.js → chunk-RAXOSUSW.js} +1 -1
- package/dist/chunks/chunk-RNIAFXMB.js +50 -0
- package/dist/chunks/{chunk-SHQOIROR.js → chunk-S5ESN275.js} +3 -3
- package/dist/chunks/chunk-SDAUS5PY.js +2 -0
- package/dist/chunks/chunk-SDXFLO7J.js +5 -0
- package/dist/chunks/chunk-SH5CBAFC.js +2 -0
- package/dist/chunks/chunk-SWUEFLOH.js +2 -0
- package/dist/chunks/chunk-SYUKES6H.js +3 -0
- package/dist/chunks/chunk-T5AACNJI.js +2 -0
- package/dist/chunks/chunk-TRQQNFMO.js +4 -0
- package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
- package/dist/chunks/chunk-UCPGRPWY.js +2 -0
- package/dist/chunks/chunk-UGL7WF3W.js +2 -0
- package/dist/chunks/{chunk-C6D4WAYN.js → chunk-UKMA4R6X.js} +2 -2
- package/dist/chunks/{chunk-4WEUCGJ3.js → chunk-VRIEKBBH.js} +1 -1
- package/dist/chunks/chunk-VYLGI3IH.js +13 -0
- package/dist/chunks/chunk-W45RKGM6.js +1 -0
- package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
- package/dist/chunks/chunk-WMKYHXVM.js +3 -0
- package/dist/chunks/chunk-WN3V6KDN.js +3 -0
- package/dist/chunks/chunk-X4OSOOSU.js +3 -0
- package/dist/chunks/chunk-XDQMGUWL.js +2 -0
- package/dist/chunks/chunk-XTFPDQMH.js +3 -0
- package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
- package/dist/chunks/chunk-XW6HGSIT.js +8 -0
- package/dist/chunks/chunk-XXYGGNVM.js +2 -0
- package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
- package/dist/chunks/chunk-YBT2NB32.js +2 -0
- package/dist/chunks/{chunk-QRAKXZOC.js → chunk-YOBN7KTF.js} +6 -6
- package/dist/chunks/chunk-YOQRYNLP.js +2 -0
- package/dist/chunks/chunk-YY7LEQGP.js +2 -0
- package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
- package/dist/chunks/chunk-Z54O534A.js +3 -0
- package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
- package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
- package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
- package/dist/chunks/{chunk-Q7AXHFZV.js → chunk-ZRDGQDZL.js} +1 -1
- package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
- package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
- package/dist/chunks/cli-X25RSO2X.js +2 -0
- package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
- package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
- package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
- package/dist/chunks/connection-HTF6CC7M.js +2 -0
- package/dist/chunks/{continual-TTGJ6YTR.js → continual-6CQAMTTR.js} +3 -3
- package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
- package/dist/chunks/datasets-7BNMVJOY.js +2 -0
- package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
- package/dist/chunks/dist-OMGUJYPD.js +2 -0
- package/dist/chunks/dist-VYC5VMQB.js +2 -0
- package/dist/chunks/{dist-FAJX2UBW.js → dist-ZVJPJLXR.js} +1 -1
- package/dist/chunks/enclave-QS4BUNDU.js +2 -0
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
- package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
- package/dist/chunks/experiments-DFGQYA4O.js +2 -0
- package/dist/chunks/experiments-VFQGE4HC.js +2 -0
- package/dist/chunks/{extension-DWMY6D2R.js → extension-XKXXOP5N.js} +1 -1
- package/dist/chunks/{help-A72QDRNG.js → help-S7THC6IE.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-NRLXL2S5.js +2 -0
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
- package/dist/chunks/hosted-app-server-composition-HPL3CRXN.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
- package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
- package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
- package/dist/chunks/human-review-WR777ODH.js +2 -0
- package/dist/chunks/import-MLZUHITH.js +4 -0
- package/dist/chunks/learning-ACEVFL5M.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
- package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
- package/dist/chunks/model-projects-QPO22JPA.js +2 -0
- package/dist/chunks/opchat-T4QTNEIY.js +3 -0
- package/dist/chunks/organizations-75L5DZDV.js +2 -0
- package/dist/chunks/{profile-NOZ6TVXL.js → profile-TFZMUEDR.js} +1 -1
- package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
- package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
- package/dist/chunks/project-agent-6RRO233B.js +2 -0
- package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
- package/dist/chunks/runtime-A7OZXM43.js +6 -0
- package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
- package/dist/chunks/{sandbox-template-LKGBDVJ4.js → sandbox-template-C4V6T36U.js} +1 -1
- package/dist/chunks/saved-work-6BMBFP43.js +2 -0
- package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
- package/dist/chunks/src-INHPJ63Z.js +326 -0
- package/dist/chunks/{src-ZWJ5IO7A.js → src-LMC3K6LH.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
- package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
- package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
- package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
- package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
- package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
- package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
- package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
- package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
- package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
- package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
- package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
- package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
- package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
- package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
- package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
- package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
- package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
- package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
- package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
- package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
- package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
- package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
- package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
- package/dist/chunks/store-training-G6YLFSIR.js +70 -0
- package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
- package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
- package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
- package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
- package/dist/chunks/taskset-EQRFQBYM.js +2 -0
- package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
- package/dist/chunks/{teams-bot-H7XT23XB.js → teams-bot-EAPGPTHZ.js} +1 -1
- package/dist/chunks/training-UF6RPI4T.js +2 -0
- package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
- package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/{App-CTlAPuCY.css → App-CaRMZoxo.css} +1 -1
- package/dist/web/assets/App-s-CJswyt.js +154 -0
- package/dist/web/assets/{AppDialog-CPHTPqrx.js → AppDialog-t2Fx5tK3.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-BVj5Tj93.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
- package/dist/web/assets/{AppsView-O69zEBY3.js → AppsView-BYE5EBDJ.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Pr_Kpe8p.js → BrowserSidebar-jhWi4rVm.js} +1 -1
- package/dist/web/assets/{CartesianChart-JPqo6YOf.js → CartesianChart-C1DIx0Ia.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CAJcQFn2.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
- package/dist/web/assets/{CommandMenu-B-w53n9A.js → CommandMenu-Ux2yOHAc.js} +1 -1
- package/dist/web/assets/{CommunityView-DbZKK8_P.js → CommunityView-DPEeVKFn.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-3_083PF4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
- package/dist/web/assets/{GetStartedView-D7JGm_6c.js → GetStartedView-CFHP0AaI.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DwgMfZ7_.js → HostedModelLearningReview-D8BGTPVN.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JRfQadRl.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BUYflJY_.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BBiqk7Rf.js → LabSkillSidebar-BxffN-pN.js} +1 -1
- package/dist/web/assets/{LabsRoute-Ci6vUnSd.js → LabsRoute-CyYF8-dw.js} +4 -4
- package/dist/web/assets/{MainChatThread-BQK3oI2N.js → MainChatThread-DZpcFRFl.js} +2 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
- package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
- package/dist/web/assets/{MarkdownText-DOdOVFXL.js → MarkdownText-BR4V6lNO.js} +21 -21
- package/dist/web/assets/{NativeSkillSidebar-CRI_ri8z.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DhYtfE68.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-D8sy1gOz.js → NewProjectDialog-RfTZTHxl.js} +1 -1
- package/dist/web/assets/{OutputsPage-CbWgrhXA.js → OutputsPage-Cr1Spf7S.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DLB67lyA.js → ProjectsPage-CE6QUB-b.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-ozSKnDyX.js → RightChatPanelStack-T6VRWuHo.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-Cafv_QnR.js → ScheduledWorkPage-vOrYv8pp.js} +1 -1
- package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
- package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
- package/dist/web/assets/{TeamChatView-vIrmXOY_.js → TeamChatView-Bwrjr-vk.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CAmF__Dq.js → TerminalOverlay-DhPoKZAq.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-D7XZePAk.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CYTmp7PG.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DSSikNFQ.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-DQGoIjH9.js → WorkspaceDiffPanel-BAFo0CPN.js} +6 -6
- package/dist/web/assets/{WorkspaceEnvironmentMenu-c1pHDskn.js → WorkspaceEnvironmentMenu-BVHAhwnJ.js} +1 -1
- package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-BCKzvSj2.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CP4hZdrJ.js → arrow-up-right-C9aE8Mfz.js} +1 -1
- package/dist/web/assets/{chunk-NOJECMB7-Bhcms-w5.js → chunk-P3BRSSRD-DUGfuKA8.js} +1 -1
- package/dist/web/assets/{clipboard-BgrXorn-.js → clipboard-Dk158Qp4.js} +1 -1
- package/dist/web/assets/{cloud-upload-B_zYztb6.js → cloud-upload-k9eqBsHr.js} +1 -1
- package/dist/web/assets/{cssMode-DanjGgA8.js → cssMode-CO35ARZp.js} +1 -1
- package/dist/web/assets/{folder-open-CdVKbtGq.js → folder-open-sYgceW_f.js} +1 -1
- package/dist/web/assets/{folder-plus-Cc5KElB6.js → folder-plus-CS0R49m9.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CjGIIgRi.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
- package/dist/web/assets/{htmlMode-DRGDF_UL.js → htmlMode-REMmzdfq.js} +1 -1
- package/dist/web/assets/index-3iPNbbER.css +1 -0
- package/dist/web/assets/{index-BE-wXZ5R.js → index-C8aCGagb.js} +2 -2
- package/dist/web/assets/{info-BLj0RvhA.js → info-DLdbiUrh.js} +1 -1
- package/dist/web/assets/{jsonMode-CCu0j2GD.js → jsonMode-KEdMfkIf.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-s_Lhm7P6.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
- package/dist/web/assets/{minimize-2-Cyg_zD9z.js → minimize-2-CqcI4zcM.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CY7mRgOB.js → monaco.contribution-BJGj65F9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CAzXvYkn.js → monaco.contribution-Cly9Wt7L.js} +2 -2
- package/dist/web/assets/{monaco.contribution-mUPNK9ra.js → monaco.contribution-DO10L0zW.js} +2 -2
- package/dist/web/assets/{monaco.contribution-aUeLcBEg.js → monaco.contribution-omszXBEj.js} +2 -2
- package/dist/web/assets/{monitor-DZvOs_wC.js → monitor-BFVCcbxp.js} +1 -1
- package/dist/web/assets/{play-BJPzemuY.js → play-C469pVZq.js} +1 -1
- package/dist/web/assets/{python-B_qnnVaG.js → python-Dw0YcVy9.js} +1 -1
- package/dist/web/assets/{save-BDy9tA3E.js → save-CtSjPydi.js} +1 -1
- package/dist/web/assets/{square-Cb2c5td4.js → square-BuImvLhT.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-MhO1JLyR.js → toggleHighContrast-DjCO9lIP.js} +1 -1
- package/dist/web/assets/{tsMode-DfBXJb9V.js → tsMode-BAOnxKd6.js} +1 -1
- package/dist/web/assets/{upload-D56kThRh.js → upload-2JkFZo3h.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DMnGfswi.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
- package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-ClAY8gze.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
- package/dist/web/assets/{wifi-off-C9lWJmVm.js → wifi-off-CpOAH62M.js} +1 -1
- package/dist/web/assets/{workers-BYzrH8by.js → workers-0QvlA2T5.js} +1 -1
- package/dist/web/assets/{yaml-D3T8UkT3.js → yaml-BK3qxo7D.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunks/actions-command-WTFZA7LF.js +0 -2
- package/dist/chunks/app-server-runtime-2RM3N4I6.js +0 -2
- package/dist/chunks/apps-KDNWYO3G.js +0 -2
- package/dist/chunks/chunk-2DFR7PJ4.js +0 -2460
- package/dist/chunks/chunk-4CRM2ADK.js +0 -2
- package/dist/chunks/chunk-55G6B54U.js +0 -6
- package/dist/chunks/chunk-73G5UYBB.js +0 -12
- package/dist/chunks/chunk-ARQEJOEK.js +0 -33
- package/dist/chunks/chunk-CGBI2VYJ.js +0 -2
- package/dist/chunks/chunk-GGIG3XU7.js +0 -3
- package/dist/chunks/chunk-JIMU3KDA.js +0 -24
- package/dist/chunks/chunk-JUJSA7KI.js +0 -22
- package/dist/chunks/chunk-K5SBVO3B.js +0 -195
- package/dist/chunks/chunk-KD3QVRIJ.js +0 -21
- package/dist/chunks/chunk-L4235TRQ.js +0 -140
- package/dist/chunks/chunk-MVF3F5QS.js +0 -2
- package/dist/chunks/chunk-OULAKUIN.js +0 -2
- package/dist/chunks/chunk-OWNLDB2O.js +0 -2
- package/dist/chunks/chunk-QDHMP5FS.js +0 -2
- package/dist/chunks/chunk-QKD5OMDI.js +0 -2
- package/dist/chunks/chunk-R2BSIRYL.js +0 -3
- package/dist/chunks/chunk-STDMBJOQ.js +0 -9
- package/dist/chunks/chunk-T4QGDQHP.js +0 -4
- package/dist/chunks/chunk-USMZT5FZ.js +0 -18
- package/dist/chunks/chunk-VJEZPDBS.js +0 -5
- package/dist/chunks/chunk-WDFLCNRC.js +0 -8
- package/dist/chunks/chunk-WZYRAR7X.js +0 -16
- package/dist/chunks/chunk-YDT7L3VZ.js +0 -24
- package/dist/chunks/chunk-YUPBAWBJ.js +0 -554
- package/dist/chunks/cli-465VC2WP.js +0 -2
- package/dist/chunks/configuration-command-LAAP2EXT.js +0 -2
- package/dist/chunks/connected-evidence-XM626247.js +0 -2
- package/dist/chunks/core-commands-W7EK552V.js +0 -2
- package/dist/chunks/datasets-QJWYTTQL.js +0 -2
- package/dist/chunks/desktop-test-3B2D34NF.js +0 -3
- package/dist/chunks/dist-HUAE2KFZ.js +0 -2
- package/dist/chunks/evaluation-coordination-2MONR4AX.js +0 -2
- package/dist/chunks/experiment-improvements-WVQ5FK46.js +0 -2
- package/dist/chunks/experiments-S5UQ32QB.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-2OWOQLHC.js +0 -3
- package/dist/chunks/hosted-harness-runtime-TGFMAV7W.js +0 -2
- package/dist/chunks/hosted-profile-candidate-WQSI6HZO.js +0 -3
- package/dist/chunks/hosted-profile-compiler-Z2A4TEA6.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-FKGARUEE.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-QOY2JKV4.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-WVP6CALP.js +0 -3
- package/dist/chunks/human-review-TGHQKXFZ.js +0 -2
- package/dist/chunks/import-4UE5XNSG.js +0 -4
- package/dist/chunks/learning-R2XBMMEM.js +0 -2
- package/dist/chunks/opchat-WULL6CUP.js +0 -3
- package/dist/chunks/organizations-I37HISVX.js +0 -2
- package/dist/chunks/project-agent-T6XKC54C.js +0 -2
- package/dist/chunks/sandbox-command-STB47FRY.js +0 -2
- package/dist/chunks/src-T3KWWCAH.js +0 -322
- package/dist/chunks/taskset-RNYDR4GS.js +0 -2
- package/dist/chunks/training-M6FAPRSJ.js +0 -2
- package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
- package/dist/web/assets/App-CLFfy_Av.js +0 -154
- package/dist/web/assets/MainPane-D3ojiN-p.js +0 -18
- package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CKs3OwhD.js +0 -1
- package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
- package/dist/web/assets/SettingsView-T1vYDPjh.js +0 -5
- package/dist/web/assets/TrainingCreationPanel-D75K0yk5.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CODMjVHY.js +0 -1
- package/dist/web/assets/WorkspaceGitDialogs-DrVtapQQ.js +0 -1
- package/dist/web/assets/index-B5re-RJy.css +0 -1
- package/dist/web/assets/useProviderSettings-Bv5B9eNk.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-C8aCGagb.js";import{K as o,bY as c,X as n}from"./App-s-CJswyt.js";import{M as d}from"./minimize-2-CqcI4zcM.js";function x({expanded:s,skill:a,onClose:i,onResizeStart:r,onToggleExpanded:l}){const t=a.path.split("/").at(-1)??a.path;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar ${s?"expanded":""}`,"aria-label":`Skill source: ${a.name}`,children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize native skill source",onPointerDown:r}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Native skill files",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(o,{size:14}),e.jsx("span",{children:t})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:l,children:s?e.jsx(d,{size:14}):e.jsx(c,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:i,children:e.jsx(n,{size:14})})]})]}),e.jsxs("div",{className:"native-skill-sidebar-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsx("h2",{children:a.name}),e.jsx("p",{children:a.description}),e.jsx("code",{children:a.path})]}),e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${a.name} Markdown source`,children:e.jsx("code",{children:a.body})})]})]})}export{x as NativeSkillSidebar};
|
package/dist/web/assets/{NewExperienceSwitcher-DhYtfE68.js → NewExperienceSwitcher-mIy6FzCj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./index-
|
|
1
|
+
import{j as a}from"./index-C8aCGagb.js";import{ci as i}from"./App-s-CJswyt.js";function f({value:c,onChange:o,allowPonder:s=!1}){const t=s?[{value:"ponder",label:"Ponder Pal"},...i]:i,p=(e,l)=>{let r;if(e.key==="Home")r=0;else if(e.key==="End")r=t.length-1;else if(e.key==="ArrowRight"||e.key==="ArrowDown")r=(l+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")r=(l-1+t.length)%t.length;else return;e.preventDefault();const n=t[r];if(!n)return;o(n.value),e.currentTarget.parentElement?.querySelectorAll(".new-experience-option")?.[r]?.focus()};return a.jsx("div",{className:"new-experience-switcher",role:"radiogroup","aria-label":"Choose task mode",children:t.map((e,l)=>{const r=e.value===c;return a.jsx("button",{type:"button",role:"radio","aria-checked":r,className:`new-experience-option ${r?"active":""}`,"data-experience":e.value,tabIndex:r?0:-1,onClick:()=>{r||o(e.value)},onKeyDown:n=>p(n,l),children:e.label},e.value)})})}export{f as NewExperienceSwitcher};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as e}from"./index-
|
|
1
|
+
import{r as n,j as e}from"./index-C8aCGagb.js";import{X as D,y as B,F as z}from"./App-s-CJswyt.js";import{F as $}from"./folder-open-sYgceW_f.js";import{F as w}from"./folder-plus-CS0R49m9.js";import{M as q}from"./monitor-BFVCcbxp.js";function Q({open:h,mode:N="local",name:i,path:f,directory:S,busy:a,onNameChange:x,onPathChange:y,onClose:g,onSubmit:A}){const[o,v]=n.useState([]),[u,b]=n.useState(""),[C,p]=n.useState(""),[F,P]=n.useState(!1),k=n.useRef(null),E=n.useRef(null);if(n.useEffect(()=>{if(h)return k.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>k.current?.focus()},[h]),!h)return null;const c=N==="cloud",l=N==="existing-local",L=c?B:l?$:w,K=c?"New Cloud Project":l?"Create project":"New Local Project",M=c?"Create a hosted project in OpenPond Cloud.":"Create a new local Git project and add it to Projects.",d=!!window.openpond?.selectFolder,O=d?"This computer":"Connected computer",j=async()=>{if(!d&&!F){P(!0);return}const t=d?await window.openpond.selectFolder():{path:f.trim(),canceled:!1},r=t.path?.trim();if(!(!r||t.canceled)){if(o.includes(r)){p("This folder is already selected.");return}v(s=>[...s,r]),u||b(r),i.trim()||x(r.split(/[\\/]/).filter(Boolean).at(-1)??r),d||(y(""),P(!1)),p("")}},R=a||(l?!i.trim()||o.length===0:!i.trim()),T=a?"Creating":c?"Create Cloud Project":"Create project";return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onKeyDown:t=>{t.key==="Escape"&&!a&&(t.stopPropagation(),g())},children:e.jsxs("form",{ref:E,className:`git-dialog new-project-dialog${l?" new-project-collection":""}`,role:"dialog","aria-modal":"true","aria-label":"Create project",onKeyDown:t=>{if(t.key!=="Tab")return;const r=Array.from(E.current?.querySelectorAll("button:not(:disabled), input:not(:disabled)")??[]);if(!r.length)return;const s=r[0],m=r.at(-1);t.shiftKey&&document.activeElement===s?(t.preventDefault(),m?.focus()):!t.shiftKey&&document.activeElement===m&&(t.preventDefault(),s?.focus())},onSubmit:async t=>{t.preventDefault(),p(""),await A(l?{name:i.trim(),sourceFolders:o,primaryFolder:u}:void 0)||p("Project could not be created. Check the selected folders and try again.")},children:[e.jsx("button",{className:"git-dialog-close",disabled:a,type:"button",onClick:g,children:e.jsx(D,{size:14})}),l?null:e.jsx("div",{className:"git-dialog-icon",children:e.jsx(L,{size:18})}),e.jsx("h2",{children:K}),l?null:e.jsx("p",{children:M}),l?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"new-project-name-field",children:[e.jsx(z,{size:16,"aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,"aria-label":"Project name",disabled:a,value:i,onChange:t=>x(t.target.value),placeholder:"Project name"})]}),e.jsxs("div",{className:"new-project-source-heading",children:[e.jsx("span",{children:"Source folders"}),o.length?e.jsxs("span",{children:[e.jsx(q,{size:15,"aria-hidden":"true"}),O]}):null]}),e.jsxs("div",{className:`new-project-source-box${o.length?" populated":" empty"}`,children:[o.length===0?e.jsxs("div",{className:"new-project-empty-source",children:[e.jsxs("span",{children:["Add a folder on ",d?"this":"the connected"," computer"]}),e.jsxs("button",{type:"button",disabled:a,onClick:()=>{j()},children:[e.jsx(w,{size:14,"aria-hidden":"true"}),"Add"]})]}):e.jsx("ul",{className:"new-project-folder-list",children:o.map(t=>e.jsxs("li",{className:"new-project-folder-row",children:[e.jsx(z,{size:15,"aria-hidden":"true"}),e.jsx("span",{title:t,"aria-label":t,children:t.split(/[\\/]/).filter(Boolean).at(-1)??t}),u===t?e.jsx("span",{className:"new-project-primary-pill",children:"Primary"}):e.jsx("button",{className:"new-project-make-primary",type:"button",disabled:a,onClick:()=>b(t),children:"Make primary"}),e.jsx("button",{className:"new-project-remove",type:"button",disabled:a,"aria-label":`Remove ${t}`,onClick:()=>{v(r=>{const s=r.filter(m=>m!==t);return u===t&&b(s[0]??""),s})},children:e.jsx(D,{size:14,"aria-hidden":"true"})})]},t))}),o.length?e.jsxs("button",{className:"new-project-add-row",type:"button",disabled:a,onClick:()=>{j()},children:[e.jsx(w,{size:15,"aria-hidden":"true"}),"Add folder"]}):null,F?e.jsxs("label",{className:"new-project-manual-path",children:[e.jsx("span",{children:"Folder path on connected computer"}),e.jsx("input",{value:f,onChange:t=>y(t.target.value),placeholder:"/path/to/folder",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),j())}}),e.jsx("button",{type:"button",disabled:!f.trim(),onClick:()=>{j()},children:"Add folder"})]}):null]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Project name"}),e.jsx("input",{autoFocus:!0,disabled:a,placeholder:"New project",value:i,onChange:t=>x(t.target.value)})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Location"}),e.jsx("strong",{className:"git-dialog-path",children:c?"OpenPond Cloud":S})]})]}),C?e.jsx("p",{className:"new-project-error",role:"alert",children:C}):null,e.jsxs("div",{className:"new-project-footer",children:[e.jsx("button",{className:"new-project-cancel",type:"button",disabled:a,onClick:g,children:"Cancel"}),e.jsx("button",{className:"git-dialog-primary",disabled:R,type:"submit",children:T})]})]})})}export{Q as NewProjectDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-
|
|
1
|
+
import{r as i,j as e}from"./index-C8aCGagb.js";import{V as W,bz as A,bo as D,X as B,K as R}from"./App-s-CJswyt.js";import{s as M,r as z,C as K,F as X}from"./MarkdownText-BR4V6lNO.js";import{F as q,I as H,d as V,e as Y,f as G}from"./MainPane-5DTtwVCk.js";import{F as J}from"./folder-open-sYgceW_f.js";import"./cloud-upload-k9eqBsHr.js";import"./arrow-up-right-C9aE8Mfz.js";import"./square-BuImvLhT.js";import"./play-C469pVZq.js";const Q="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Z="application/vnd.openxmlformats-officedocument.presentationml.presentation",tt="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";function x(t){const s=t.contentType.toLowerCase(),o=t.title.toLowerCase();return s===Q||o.endsWith(".docx")?{label:"Document",type:"document"}:s==="application/pdf"||o.endsWith(".pdf")?{label:"PDF",type:"pdf"}:s===Z||o.endsWith(".pptx")?{label:"Presentation",type:"presentation"}:s===tt||s==="text/csv"||s==="text/tab-separated-values"||o.endsWith(".xlsx")||o.endsWith(".csv")||o.endsWith(".tsv")?{label:"Table",type:"table"}:s==="text/html"||o.endsWith(".html")?{label:"HTML",type:"html"}:s==="application/json"||s==="text/markdown"||s==="text/plain"?{label:"Text",type:"text"}:s.startsWith("image/")?{label:"Image",type:"image"}:s.startsWith("audio/")?{label:"Audio",type:"audio"}:s.startsWith("video/")?{label:"Video",type:"video"}:{label:"File",type:"file"}}function et(t){return[...t].sort((s,o)=>P(o.createdAt)-P(s.createdAt)||o.revision-s.revision)}function P(t){const s=new Date(t).getTime();return Number.isNaN(s)?0:s}const st=15e3,f=new Map;function nt(t){const s=i.useMemo(()=>t?_(t):null,[t]),o=s?L(s):null,[a,r]=i.useState(o??[]),[j,h]=i.useState(!!t&&!o),[b,d]=i.useState(null);return i.useEffect(()=>{let p=!1;if(!t||!s){r([]),h(!1),d(null);return}const m=L(s);return r(m??[]),h(!m),d(null),ot(t).then(l=>{p||r(l)}).catch(l=>{p||d(rt(l))}).finally(()=>{p||h(!1)}),()=>{p=!0}},[s,t]),{error:b,loading:j,outputs:a}}function L(t){const s=f.get(t);return s&&s.refreshedAt>0?s.outputs:null}function ot(t){const s=_(t),o=f.get(s);if(o?.request)return o.request;if(o&&o.refreshedAt>0&&Date.now()-o.refreshedAt<st)return Promise.resolve(o.outputs);const a=W.workOutputs(t).then(r=>et(r.outputs)).then(r=>(f.set(s,{outputs:r,refreshedAt:Date.now(),request:null}),r)).catch(r=>{throw o?f.set(s,{...o,request:null}):f.delete(s),r});return f.set(s,{outputs:o?.outputs??[],refreshedAt:o?.refreshedAt??0,request:a}),a}function _(t){return`${t.serverUrl}\0${t.token}`}function rt(t){return t instanceof Error?t.message:"Could not load Work outputs."}const v="all",at=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function Tt({connection:t,onViewChat:s}){const{error:o,loading:a,outputs:r}=nt(t),[j,h]=i.useState(v),[b,d]=i.useState(null),[p,m]=i.useState(null),[l,T]=i.useState(null);i.useEffect(()=>()=>{l?.objectUrl&&URL.revokeObjectURL(l.objectUrl)},[l?.objectUrl]);const k=i.useMemo(()=>Array.from(new Set(r.map(n=>x(n).label))).sort((n,u)=>n.localeCompare(u)),[r]),y=k.includes(j)?j:v,w=i.useMemo(()=>y===v?r:r.filter(n=>x(n).label===y),[y,r]);async function I(n){if(!t)return;const u=S(n);m(u),d(null);try{const c=await W.workspaceTool(t,n.sourceTaskId,{action:"work_output_read",source:"ui_button",args:{outputId:n.id,revision:n.revision}});if(!c.ok)throw new Error(c.output);const F=pt(c.data),O=typeof F.contentsBase64=="string"?F.contentsBase64:"";if(!O)throw new Error("The output did not include file data.");const N=new File([dt(O)],n.title,{type:n.contentType}),U=x(n),E=U.type==="text"||U.type==="html";l?.objectUrl&&URL.revokeObjectURL(l.objectUrl),T({file:N,objectUrl:E?null:URL.createObjectURL(N),output:n,text:E?await N.text():null})}catch(c){d(ft(c))}finally{m(null)}}async function C(n){if(n.location.kind!=="local")return;const u=await M(n.location.path,n.title);!u.ok&&!u.canceled&&d("Could not save a copy of the Work output.")}return e.jsxs("section",{"aria-label":"Outputs",className:`outputs-view${l?" detail-open":""}`,children:[e.jsx("div",{className:"outputs-scroll",children:e.jsxs("div",{className:"outputs-content",children:[r.length>0?e.jsx("header",{className:"outputs-header",children:e.jsx("label",{className:"outputs-filter",children:e.jsxs("select",{"aria-label":"Filter files by file type",onChange:n=>h(n.target.value),value:y,children:[e.jsx("option",{value:v,children:"All file types"}),k.map(n=>e.jsx("option",{value:n,children:n},n))]})})}):null,o||b?e.jsx("p",{className:"outputs-error",children:b??o}):null,t?a&&r.length===0?e.jsxs("div",{className:"outputs-loading",role:"status",children:[e.jsx(A,{className:"outputs-spin",size:16}),e.jsx("span",{children:"Loading files"})]}):r.length===0?e.jsx(g,{children:"Files created in Work will appear here."}):w.length===0?e.jsx(g,{children:"No files match this file type."}):e.jsx("div",{className:"outputs-grid","data-testid":"desktop-output-cards",children:w.map(n=>{const u=x(n),c=S(n);return e.jsxs("article",{className:"output-card",children:[e.jsxs("button",{"aria-label":`Preview ${n.title}`,className:"output-card-main",disabled:p===c,onClick:()=>{I(n)},type:"button",children:[e.jsx("span",{className:"output-card-icon",children:e.jsx($,{type:u.type})}),e.jsxs("span",{className:"output-card-copy",children:[e.jsx("strong",{children:n.title}),e.jsxs("small",{children:[u.label," · ",ut(n.sizeBytes)]}),e.jsxs("small",{children:["Revision ",n.revision," ·"," ",e.jsx("time",{dateTime:n.createdAt,children:ct(n.createdAt)})]})]}),p===c?e.jsx(A,{className:"outputs-spin",size:15}):null]}),e.jsxs("div",{className:"output-card-actions",children:[n.location.kind==="local"?e.jsx("button",{"aria-label":`Download ${n.title}`,className:"output-download-button",onClick:()=>{C(n)},title:"Download",type:"button",children:e.jsx(D,{"aria-hidden":"true",size:14})}):null,e.jsx("button",{onClick:()=>s(n.sourceTaskId),type:"button",children:"View chat"})]})]},c)})}):e.jsx(g,{children:"Connect to the local OpenPond server to view outputs."})]})}),l?e.jsx(lt,{onClose:()=>T(null),onSave:()=>{C(l.output)},onViewChat:()=>s(l.output.sourceTaskId),preview:l}):null]})}function lt({onClose:t,onSave:s,onViewChat:o,preview:a}){const r=x(a.output);return e.jsxs("aside",{"aria-label":`${a.output.title} preview`,className:"output-detail",children:[e.jsxs("header",{className:"output-detail-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:a.output.title}),e.jsxs("p",{children:[r.label," · Revision ",a.output.revision]})]}),e.jsx("button",{"aria-label":"Close output preview",onClick:t,type:"button",children:e.jsx(B,{size:16})})]}),e.jsx("div",{className:"output-preview-surface",children:a.text!==null?r.type==="html"?e.jsx("iframe",{sandbox:"",srcDoc:a.text,title:a.output.title}):e.jsx("pre",{children:a.text}):r.type==="image"&&a.objectUrl?e.jsx("img",{alt:a.output.title,src:a.objectUrl}):r.type==="pdf"&&a.objectUrl?e.jsx("iframe",{src:a.objectUrl,title:a.output.title}):r.type==="audio"&&a.objectUrl?e.jsx("audio",{controls:!0,src:a.objectUrl}):r.type==="video"&&a.objectUrl?e.jsx("video",{controls:!0,src:a.objectUrl}):e.jsxs("div",{className:"output-native-preview",children:[e.jsx($,{type:r.type}),e.jsx("p",{children:"This file type uses its native application for detailed review."})]})}),e.jsxs("div",{className:"output-detail-actions",children:[a.output.location.kind==="local"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{z(a.output.location.kind==="local"?a.output.location.path:"")},type:"button",children:[e.jsx(J,{size:14}),"Reveal"]}),e.jsx("button",{"aria-label":`Download ${a.output.title}`,className:"output-download-button",onClick:s,title:"Download",type:"button",children:e.jsx(D,{"aria-hidden":"true",size:14})})]}):null,e.jsx("button",{onClick:o,type:"button",children:"View chat"})]})]})}function $({type:t}){const s=it(t);return e.jsx(s,{"aria-hidden":"true",size:18})}function it(t){return t==="audio"?q:t==="html"||t==="text"?K:t==="image"?H:t==="presentation"?V:t==="table"?Y:t==="video"?G:t==="file"?X:R}function g({children:t}){return e.jsx("p",{className:"outputs-empty",children:t})}function S(t){return`${t.sourceTaskId}:${t.id}:${t.revision}`}function ut(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:`${(t/1e6).toFixed(1)} MB`}function ct(t){const s=new Date(t);return Number.isNaN(s.getTime())?"Unknown date":at.format(s)}function dt(t){const s=window.atob(t),o=new ArrayBuffer(s.length),a=new Uint8Array(o);for(let r=0;r<s.length;r+=1)a[r]=s.charCodeAt(r);return o}function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function ft(t){return t instanceof Error?t.message:"Could not load Work outputs."}export{Tt as OutputsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as h}from"./index-BE-wXZ5R.js";import{fe as ee,R as L,r as te,aL as W,aD as F,b_ as _,b3 as O,bt as A,v as M,b7 as $}from"./App-CLFfy_Av.js";import{C as H}from"./cloud-upload-B_zYztb6.js";function V(t,s){const r=t.project.sourceLabel?.trim()??"";if(t.project.sourceType==="github_repo"&&r){if(/^https?:\/\//i.test(r))return r;if(/^[^/\s]+\/[^/\s]+$/.test(r))return`https://github.com/${r}`}return ee({accountBaseUrl:s,organizationSlug:t.project.organizationSlug,projectSlug:t.project.slug})}function re(t,s){return t.kind==="cloud"?V(t,s):t.project.linkedSandboxProject?.sourceRepoUrl??null}function D(t){return t.replace(/^https?:\/\//i,"").replace(/\/$/,"")}async function k(t){const s=window.openpond?.browser;if(s){const r=await s.openExternal({conversationId:"projects",url:t});if(!r.ok)throw new Error(r.error??"Unable to open project URL.");return}window.open(t,"_blank","noopener,noreferrer")}function se({loading:t,workspace:s,linked:r,unavailable:n}){if(t)return e.jsx(c,{children:"Loading environments…"});if(!r)return e.jsx(c,{children:"Upload this local project to create cloud development environments."});if(n)return e.jsx(c,{error:!0,children:"Unable to load environments."});if(!s?.environments.length)return e.jsx(c,{children:"No development environment has been created for this project yet."});const o=ce(s);return e.jsx(G,{headings:["Environment","Status","Branch","Default","Updated"],children:s.environments.map(({sandbox:a,runtime:l})=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:de(a.metadata,a.id)})}),e.jsx("td",{children:e.jsx(I,{status:a.state})}),e.jsx("td",{children:e.jsx("code",{children:l?.baseBranch??a.repoRef??"Not available"})}),e.jsx("td",{children:a.id===o?"Preferred":"—"}),e.jsx("td",{children:q(a.updatedAt)})]},a.id))})}function ne({loading:t,workspace:s,linked:r,unavailable:n}){return t?e.jsx(c,{children:"Loading deployments…"}):r?n?e.jsx(c,{error:!0,children:"Unable to load deployments."}):s?.errors.deployments?e.jsx(c,{error:!0,children:"Unable to load deployments."}):s?.website?s.deployments.length?e.jsx(G,{headings:["Deployment","Status","Commit","Build","Created by","Created"],children:s.deployments.map(o=>e.jsx(le,{deployment:o},o.release.id))}):e.jsx(c,{children:"No deployments yet."}):e.jsx(c,{children:"Set up Website before creating a deployment."}):e.jsx(c,{children:"Upload this local project before creating deployments."})}function ie({loading:t,workspace:s,linked:r,unavailable:n}){const[o,a]=h.useState(null);return t?e.jsx(c,{children:"Loading requests…"}):r?n?e.jsx(c,{error:!0,children:"Unable to load requests."}):s?.errors.requests?e.jsx(c,{error:!0,children:"Unable to load requests."}):s?.website?s.requests.length?e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table project-request-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Request"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Runtime"}),e.jsx("th",{children:"Started"}),e.jsx("th",{children:"Duration"})]})}),s.requests.map(l=>{const p=o===l.id;return e.jsxs("tbody",{children:[e.jsxs("tr",{"aria-expanded":p,className:"project-request-row",onClick:()=>a(j=>j===l.id?null:l.id),children:[e.jsxs("td",{children:[e.jsx("code",{children:l.method})," ",je(l.path)]}),e.jsx("td",{children:e.jsx(I,{status:String(l.responseStatus),tone:l.outcome==="failure"?"error":"success"})}),e.jsx("td",{children:l.coldStart===null?"Unknown":l.coldStart?"Cold":"Warm"}),e.jsx("td",{children:q(l.startedAt)}),e.jsx("td",{children:K(l.totalDurationMs)})]}),p?e.jsx(ae,{trace:l}):null]},l.id)})]})}):e.jsx(c,{children:"No requests yet."}):e.jsx(c,{children:"Set up Website to receive requests."}):e.jsx(c,{children:"Upload this local project and set up Website to receive requests."})}function oe({loading:t,workspace:s,linked:r,unavailable:n}){if(t)return e.jsx(c,{children:"Loading website…"});if(!r)return e.jsx(c,{children:"Upload this local project before setting up Website."});if(n)return e.jsx(c,{error:!0,children:"Unable to load the website."});if(s?.errors.website)return e.jsx(c,{error:!0,children:"Unable to load the website."});const o=s?.website??null,a=o?.settings.platformDomain?`https://${o.settings.platformDomain}`:null,l=o?.releases.find(j=>j.id===o.settings.activeReleaseId)?.sourceCommitSha??null,p=[["Public URL",a?e.jsx("a",{href:a,onClick:j=>{j.preventDefault(),k(a)},children:D(a)}):"Not assigned"],["Live release",o?.settings.activeReleaseId?"Active":"Not published"],["Source",l?J(l):"Not available"],["Account database",ue(s)],["Availability",o?.settings.runtimePolicy?.availabilityMode==="always_on"?"Always on":"On demand"]];return e.jsxs("div",{className:"project-detail-table-frame",children:[e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Setting"}),e.jsx("th",{children:"Value"})]})}),e.jsx("tbody",{children:p.map(([j,d])=>e.jsxs("tr",{children:[e.jsx("td",{children:j}),e.jsx("td",{children:d})]},j))})]}),o?null:e.jsx("div",{className:"project-detail-table-note",children:"Website has not been set up for this project."})]})}function G({headings:t,children:s}){return e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(r=>e.jsx("th",{children:r},r))})}),e.jsx("tbody",{children:s})]})})}function c({children:t,error:s=!1}){return e.jsx("div",{className:`project-detail-empty${s?" error":""}`,children:t})}function I({status:t,tone:s}){return e.jsx("span",{className:`project-detail-status${s?` ${s}`:""}`,children:t.replaceAll("_"," ")})}function le({deployment:t}){const{build:s,release:r}=t;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("strong",{children:["v",r.version]})}),e.jsx("td",{children:e.jsx(I,{status:r.status,tone:r.status==="failed"?"error":r.status==="active"||r.status==="ready"?"success":void 0})}),e.jsx("td",{children:e.jsx("code",{children:r.sourceCommitSha?J(r.sourceCommitSha):"Not available"})}),e.jsx("td",{children:s?`${s.status.replaceAll("_"," ")} · ${s.currentStage.replaceAll("_"," ")}`:"Not started"}),e.jsx("td",{children:t.creatorName??"Unknown"}),e.jsx("td",{children:q(r.createdAt)})]})}function ae({trace:t}){return e.jsx("tr",{className:"project-request-detail",children:e.jsxs("td",{colSpan:5,children:[e.jsx("dl",{children:t.stages.map((s,r)=>e.jsxs("div",{children:[e.jsxs("dt",{children:[s.name.replaceAll("_"," "),s.errorCode?` · ${s.errorCode}`:""]}),e.jsx("dd",{children:K(s.durationMs)})]},`${s.name}:${r}`))}),t.errorCode?e.jsx("p",{children:t.errorCode}):null]})})}function ce(t){const s=t.project.metadata.preferredDevelopmentSandboxId;return typeof s=="string"&&s.trim()?s:null}function de(t,s){for(const r of["name","label","environmentName"]){const n=t[r];if(typeof n=="string"&&n.trim())return n}return s.length>18?s.slice(0,18):s}function ue(t){return t?.website?t.errors.database?"Unavailable":t.database?.status==="ready"?`Connected · ${t.database.provider}`:t.database?.status==="provisioning"?"Connecting…":"Not connected":"Set up the website first"}function je(t){const s="/ingress",r=t.indexOf(s);return r===-1?t:`/api${t.slice(r+s.length)||"/"}`}function J(t){return t.length>12?t.slice(0,12):t}function K(t){return t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function q(t){const s=Date.parse(t);return Number.isFinite(s)?new Date(s).toLocaleString():t}function he({accountBaseUrl:t,connection:s,project:r,taskCount:n,teamName:o,onBack:a,onNewTask:l,onTogglePinned:p,onUploadLocalProject:j}){const[d,u]=h.useState("source"),[b,x]=h.useState(null),[i,f]=h.useState(null),[N,R]=h.useState(!1),[z,T]=h.useState([]),[y,P]=h.useState(!1),[E,B]=h.useState(null),m=fe(r);h.useEffect(()=>{u("source")},[r.id]),h.useEffect(()=>{let U=!0;if(f(null),x(null),R(!1),T([]),B(null),!s)return P(!1),()=>{U=!1};P(!0);const X=m?pe(s,m):Promise.resolve(null),Y=r.kind==="local"?L.localProjectActions(s,r.project.id):Promise.resolve(null);return Promise.allSettled([X,Y]).then(([v,g])=>{if(!U)return;v.status==="fulfilled"&&v.value&&(x(v.value.project),f(v.value.workspace),R(v.value.workspaceUnavailable)),g.status==="fulfilled"&&g.value&&T(g.value.actions.map(ve));const S=[v,g].filter(Z=>Z.status==="rejected");S.length>0&&S.length===+!!m+ +(r.kind==="local")&&B(S[0]?.reason instanceof Error?S[0].reason.message:"Project details could not be loaded."),P(!1)}),()=>{U=!1}},[s,m?.projectId,m?.teamId,r]);const C=h.useMemo(()=>Ne(ye(b),z),[b,z]),w=re(r,t),Q=be({hostedProject:b,project:r,repositoryUrl:w,taskCount:n,teamName:o});return e.jsxs("section",{"aria-label":`${r.project.name} project`,className:"project-detail-view",children:[e.jsxs("header",{className:"project-detail-header",children:[e.jsxs("div",{className:"project-detail-heading",children:[e.jsxs("button",{className:"project-detail-back",onClick:a,type:"button",children:[e.jsx(te,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"Projects"})]}),e.jsx("h1",{children:r.project.name})]}),e.jsxs("div",{className:"project-detail-actions",children:[r.kind==="local"?e.jsxs("button",{onClick:()=>j(r),type:"button",children:[e.jsx(H,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"Upload"})]}):null,w?e.jsxs("button",{onClick:()=>{k(w)},type:"button",children:[e.jsx(W,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"Open repository"})]}):null,e.jsxs("button",{onClick:()=>l(r),type:"button",children:[e.jsx(F,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"New task"})]}),e.jsx("button",{"aria-label":`${r.pinned?"Unpin":"Pin"} ${r.project.name}`,onClick:()=>p(r),title:r.pinned?"Unpin project":"Pin project",type:"button",children:r.pinned?e.jsx(_,{"aria-hidden":"true",size:14}):e.jsx(O,{"aria-hidden":"true",size:14})})]})]}),e.jsxs("div",{"aria-label":"Project detail",className:"project-detail-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":d==="source",onClick:()=>u("source"),role:"tab",type:"button",children:"Source"}),e.jsxs("button",{"aria-selected":d==="actions",onClick:()=>u("actions"),role:"tab",type:"button",children:["Project Actions",C.length>0?e.jsx("span",{children:C.length}):null]}),e.jsx("button",{"aria-selected":d==="environments",onClick:()=>u("environments"),role:"tab",type:"button",children:"Environments"}),e.jsx("button",{"aria-selected":d==="deployments",onClick:()=>u("deployments"),role:"tab",type:"button",children:"Deployments"}),e.jsx("button",{"aria-selected":d==="requests",onClick:()=>u("requests"),role:"tab",type:"button",children:"Requests"}),e.jsx("button",{"aria-selected":d==="website",onClick:()=>u("website"),role:"tab",type:"button",children:"Website"})]}),E?e.jsx("div",{className:"project-detail-error",role:"alert",children:E}):null,d==="source"?e.jsx(me,{loading:y,rows:Q}):d==="actions"?e.jsx(xe,{actions:C,loading:y}):d==="environments"?e.jsx(se,{linked:!!m,loading:y,unavailable:N,workspace:i}):d==="deployments"?e.jsx(ne,{linked:!!m,loading:y,unavailable:N,workspace:i}):d==="requests"?e.jsx(ie,{linked:!!m,loading:y,unavailable:N,workspace:i}):e.jsx(oe,{linked:!!m,loading:y,unavailable:N,workspace:i})]})}async function pe(t,s){try{const r=await L.getSandboxProjectWorkspace(t,s.projectId,{teamId:s.teamId});return{project:r.project,workspace:r,workspaceUnavailable:!1}}catch{return{project:(await L.getSandboxProject(t,s.projectId,{teamId:s.teamId})).project,workspace:null,workspaceUnavailable:!0}}}function me({loading:t,rows:s}){return e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Setting"}),e.jsx("th",{children:"Value"})]})}),e.jsx("tbody",{children:s.map(([r,n])=>e.jsxs("tr",{children:[e.jsx("td",{children:r}),e.jsx("td",{children:t&&r==="Latest commit"?"Loading…":n})]},r))})]})})}function xe({actions:t,loading:s}){return s?e.jsx("div",{className:"project-detail-empty",children:"Loading Project Actions…"}):t.length===0?e.jsx("div",{className:"project-detail-empty",children:"No Project Actions are registered from this source."}):e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table actions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Action"}),e.jsx("th",{children:"Description"}),e.jsx("th",{children:"Source"})]})}),e.jsx("tbody",{children:t.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:r.id})}),e.jsx("td",{children:r.description??"No description"}),e.jsx("td",{children:r.source==="hosted"?"Hosted project":"Local source"})]},`${r.source}:${r.id}`))})]})})}function be(t){const{hostedProject:s,project:r,repositoryUrl:n,taskCount:o,teamName:a}=t,l=r.kind==="local"?r.project.linkedSandboxProject:null,p=s?.gitBranch??s?.defaultBranch??(r.kind==="cloud"?r.project.defaultBranch:l?.defaultBranch)??"Not set",j=s?ge(s):l?.lastUploadedCommit??null,d=s?.sandboxManifestSyncedAt??(r.kind==="cloud"?r.project.syncedAt:l?.syncedAt)??null;return[["Repository",n?e.jsx("a",{href:n,onClick:u=>{u.preventDefault(),k(n)},children:D(n)}):r.kind==="local"?r.project.path:"Not available"],...r.kind==="local"?[["Primary folder",r.project.workspacePath],["Source folders",e.jsx("ul",{className:"project-source-folder-list",children:(r.project.sourceFolders??[r.project.workspacePath]).map(u=>e.jsx("li",{children:u},u))},"source-folders")]]:[],["Branch",p],["Latest commit",j?Se(j):"Not available"],["Last synced",d?ke(d):"Not available"],["Team",a??(r.kind==="cloud"?r.project.organizationName:null)??"Local only"],["Tasks",String(o)]]}function fe(t){if(t.kind==="cloud")return{projectId:t.project.id,teamId:t.project.teamId};const s=t.project.linkedSandboxProject;return s?{projectId:s.projectId,teamId:s.teamId}:null}function ye(t){const s=t?.sandboxActionRegistry?.actions;return Array.isArray(s)?s.flatMap(r=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=r,o=typeof(n.id??n.name)=="string"?String(n.id??n.name).trim():"";return o?[{id:o,description:typeof n.description=="string"?n.description:null,source:"hosted"}]:[]}):[]}function ve(t){return{id:t.id,description:t.description??t.label??t.name??null,source:"local"}}function Ne(t,s){const r=new Map;for(const n of[...t,...s])r.has(n.id)||r.set(n.id,n);return Array.from(r.values()).sort((n,o)=>n.id.localeCompare(o.id))}function ge(t){return[t.sourceConfig.commitSha,t.sourceConfig.sourceCommitSha,t.metadata.commitSha,t.metadata.sourceCommitSha,t.templateRemoteSha].find(r=>typeof r=="string"&&!!r.trim())??null}function Se(t){return t.length>12?t.slice(0,12):t}function ke(t){const s=Date.parse(t);return Number.isFinite(s)?new Date(s).toLocaleString():t}const Pe=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function De({accountBaseUrl:t,connection:s,projects:r,taskCountByProjectId:n,teamName:o,onNewCloudProject:a,onNewLocalProject:l,onNewTask:p,onTogglePinned:j,onUploadLocalProject:d}){const[u,b]=h.useState(null),x=h.useMemo(()=>r.find(i=>i.id===u)??null,[r,u]);return h.useEffect(()=>{u&&!x&&b(null)},[x,u]),x?e.jsx(he,{accountBaseUrl:t,connection:s,onBack:()=>b(null),onNewTask:p,onTogglePinned:j,onUploadLocalProject:d,project:x,taskCount:n[x.id]??0,teamName:o}):e.jsxs("section",{"aria-label":"Projects",className:"projects-page",children:[e.jsxs("header",{className:"projects-page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{children:"Projects"}),e.jsxs("p",{children:["Local projects on this device and hosted projects for ",o??"your active team","."]})]}),e.jsxs("div",{className:"projects-cloud-actions",children:[e.jsxs("button",{className:"projects-cloud-button",onClick:l,type:"button",children:[e.jsx(A,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"Add project"})]}),e.jsxs("button",{className:"projects-cloud-button",onClick:a,type:"button",children:[e.jsx(M,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"New cloud project"})]})]})]}),r.length===0?e.jsxs("div",{className:"projects-empty",children:[e.jsx(A,{"aria-hidden":"true",size:24}),e.jsx("h2",{children:"No projects yet"}),e.jsx("p",{children:"Add folders from this computer or create a hosted project."})]}):e.jsx("div",{className:"projects-table-frame",children:e.jsxs("table",{className:"projects-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Project"}),e.jsx("th",{scope:"col",children:"Location"}),e.jsx("th",{scope:"col",children:"Tasks"}),e.jsx("th",{scope:"col",children:"Updated"}),e.jsx("th",{"aria-label":"Project actions",scope:"col"})]})}),e.jsx("tbody",{children:r.map(i=>{const f=i.project.updatedAt;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("button",{className:"projects-name-button",onClick:()=>b(i.id),type:"button",children:[e.jsx("span",{className:`projects-kind-icon ${Ce(i)}`,children:$(i)?e.jsx(A,{"aria-hidden":"true",size:16}):e.jsx(M,{"aria-hidden":"true",size:16})}),e.jsx("span",{className:"projects-name-copy",children:e.jsx("strong",{children:i.project.name})})]})}),e.jsx("td",{children:$(i)?e.jsxs("div",{className:"projects-location-cell",children:[e.jsx("span",{className:"projects-location",title:i.project.path,children:i.project.path}),e.jsxs("button",{className:"projects-upload-button",onClick:()=>d(i),title:`Upload ${i.project.name} to the active team`,type:"button",children:[e.jsx(H,{"aria-hidden":"true",size:13}),e.jsx("span",{children:"Upload"})]})]}):e.jsx(we,{accountBaseUrl:t,project:i})}),e.jsx("td",{children:n[i.id]??0}),e.jsx("td",{children:f?e.jsx("time",{dateTime:f,children:Ue(f)}):e.jsx("span",{className:"projects-table-muted",children:"—"})}),e.jsx("td",{children:e.jsxs("div",{className:"projects-row-actions",children:[e.jsx("button",{"aria-label":`Start a new task in ${i.project.name}`,onClick:()=>p(i),title:"New task",type:"button",children:e.jsx(F,{"aria-hidden":"true",size:15})}),e.jsx("button",{"aria-label":`${i.pinned?"Unpin":"Pin"} ${i.project.name}`,onClick:()=>j(i),title:i.pinned?"Unpin project":"Pin project",type:"button",children:i.pinned?e.jsx(_,{"aria-hidden":"true",size:15}):e.jsx(O,{"aria-hidden":"true",size:15})})]})})]},i.id)})})]})})]})}function Ce(t){return $(t)?t.project.linkedSandboxProject&&t.cloudLinkTrusted?"linked":"desktop":"cloud"}function we({accountBaseUrl:t,project:s}){const r=V(s,t);return r?e.jsxs("a",{className:"projects-location-link",href:r,onClick:n=>{n.preventDefault(),k(r)},title:r,children:[e.jsx("span",{children:D(r)}),e.jsx(W,{"aria-hidden":"true",size:12})]}):e.jsx("span",{className:"projects-table-muted",children:"Repository unavailable"})}function Ue(t){const s=Date.parse(t);return Number.isFinite(s)?Pe.format(s):t}export{De as ProjectsPage};
|
|
1
|
+
import{j as e,r as h}from"./index-C8aCGagb.js";import{fi as ee,V as L,w as te,aO as W,aG as F,c1 as _,b6 as O,bv as A,y as M,ba as $}from"./App-s-CJswyt.js";import{C as V}from"./cloud-upload-k9eqBsHr.js";function H(t,s){const r=t.project.sourceLabel?.trim()??"";if(t.project.sourceType==="github_repo"&&r){if(/^https?:\/\//i.test(r))return r;if(/^[^/\s]+\/[^/\s]+$/.test(r))return`https://github.com/${r}`}return ee({accountBaseUrl:s,organizationSlug:t.project.organizationSlug,projectSlug:t.project.slug})}function re(t,s){return t.kind==="cloud"?H(t,s):t.project.linkedSandboxProject?.sourceRepoUrl??null}function I(t){return t.replace(/^https?:\/\//i,"").replace(/\/$/,"")}async function k(t){const s=window.openpond?.browser;if(s){const r=await s.openExternal({conversationId:"projects",url:t});if(!r.ok)throw new Error(r.error??"Unable to open project URL.");return}window.open(t,"_blank","noopener,noreferrer")}function se({loading:t,workspace:s,linked:r,unavailable:n}){if(t)return e.jsx(c,{children:"Loading environments…"});if(!r)return e.jsx(c,{children:"Upload this local project to create cloud development environments."});if(n)return e.jsx(c,{error:!0,children:"Unable to load environments."});if(!s?.environments.length)return e.jsx(c,{children:"No development environment has been created for this project yet."});const o=ce(s);return e.jsx(G,{headings:["Environment","Status","Branch","Default","Updated"],children:s.environments.map(({sandbox:a,runtime:l})=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:de(a.metadata,a.id)})}),e.jsx("td",{children:e.jsx(D,{status:a.state})}),e.jsx("td",{children:e.jsx("code",{children:l?.baseBranch??a.repoRef??"Not available"})}),e.jsx("td",{children:a.id===o?"Preferred":"—"}),e.jsx("td",{children:q(a.updatedAt)})]},a.id))})}function ne({loading:t,workspace:s,linked:r,unavailable:n}){return t?e.jsx(c,{children:"Loading deployments…"}):r?n?e.jsx(c,{error:!0,children:"Unable to load deployments."}):s?.errors.deployments?e.jsx(c,{error:!0,children:"Unable to load deployments."}):s?.website?s.deployments.length?e.jsx(G,{headings:["Deployment","Status","Commit","Build","Created by","Created"],children:s.deployments.map(o=>e.jsx(le,{deployment:o},o.release.id))}):e.jsx(c,{children:"No deployments yet."}):e.jsx(c,{children:"Set up Website before creating a deployment."}):e.jsx(c,{children:"Upload this local project before creating deployments."})}function ie({loading:t,workspace:s,linked:r,unavailable:n}){const[o,a]=h.useState(null);return t?e.jsx(c,{children:"Loading requests…"}):r?n?e.jsx(c,{error:!0,children:"Unable to load requests."}):s?.errors.requests?e.jsx(c,{error:!0,children:"Unable to load requests."}):s?.website?s.requests.length?e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table project-request-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Request"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Runtime"}),e.jsx("th",{children:"Started"}),e.jsx("th",{children:"Duration"})]})}),s.requests.map(l=>{const p=o===l.id;return e.jsxs("tbody",{children:[e.jsxs("tr",{"aria-expanded":p,className:"project-request-row",onClick:()=>a(j=>j===l.id?null:l.id),children:[e.jsxs("td",{children:[e.jsx("code",{children:l.method})," ",je(l.path)]}),e.jsx("td",{children:e.jsx(D,{status:String(l.responseStatus),tone:l.outcome==="failure"?"error":"success"})}),e.jsx("td",{children:l.coldStart===null?"Unknown":l.coldStart?"Cold":"Warm"}),e.jsx("td",{children:q(l.startedAt)}),e.jsx("td",{children:K(l.totalDurationMs)})]}),p?e.jsx(ae,{trace:l}):null]},l.id)})]})}):e.jsx(c,{children:"No requests yet."}):e.jsx(c,{children:"Set up Website to receive requests."}):e.jsx(c,{children:"Upload this local project and set up Website to receive requests."})}function oe({loading:t,workspace:s,linked:r,unavailable:n}){if(t)return e.jsx(c,{children:"Loading website…"});if(!r)return e.jsx(c,{children:"Upload this local project before setting up Website."});if(n)return e.jsx(c,{error:!0,children:"Unable to load the website."});if(s?.errors.website)return e.jsx(c,{error:!0,children:"Unable to load the website."});const o=s?.website??null,a=o?.settings.platformDomain?`https://${o.settings.platformDomain}`:null,l=o?.releases.find(j=>j.id===o.settings.activeReleaseId)?.sourceCommitSha??null,p=[["Public URL",a?e.jsx("a",{href:a,onClick:j=>{j.preventDefault(),k(a)},children:I(a)}):"Not assigned"],["Live release",o?.settings.activeReleaseId?"Active":"Not published"],["Source",l?J(l):"Not available"],["Account database",ue(s)],["Availability",o?.settings.runtimePolicy?.availabilityMode==="always_on"?"Always on":"On demand"]];return e.jsxs("div",{className:"project-detail-table-frame",children:[e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Setting"}),e.jsx("th",{children:"Value"})]})}),e.jsx("tbody",{children:p.map(([j,d])=>e.jsxs("tr",{children:[e.jsx("td",{children:j}),e.jsx("td",{children:d})]},j))})]}),o?null:e.jsx("div",{className:"project-detail-table-note",children:"Website has not been set up for this project."})]})}function G({headings:t,children:s}){return e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(r=>e.jsx("th",{children:r},r))})}),e.jsx("tbody",{children:s})]})})}function c({children:t,error:s=!1}){return e.jsx("div",{className:`project-detail-empty${s?" error":""}`,children:t})}function D({status:t,tone:s}){return e.jsx("span",{className:`project-detail-status${s?` ${s}`:""}`,children:t.replaceAll("_"," ")})}function le({deployment:t}){const{build:s,release:r}=t;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("strong",{children:["v",r.version]})}),e.jsx("td",{children:e.jsx(D,{status:r.status,tone:r.status==="failed"?"error":r.status==="active"||r.status==="ready"?"success":void 0})}),e.jsx("td",{children:e.jsx("code",{children:r.sourceCommitSha?J(r.sourceCommitSha):"Not available"})}),e.jsx("td",{children:s?`${s.status.replaceAll("_"," ")} · ${s.currentStage.replaceAll("_"," ")}`:"Not started"}),e.jsx("td",{children:t.creatorName??"Unknown"}),e.jsx("td",{children:q(r.createdAt)})]})}function ae({trace:t}){return e.jsx("tr",{className:"project-request-detail",children:e.jsxs("td",{colSpan:5,children:[e.jsx("dl",{children:t.stages.map((s,r)=>e.jsxs("div",{children:[e.jsxs("dt",{children:[s.name.replaceAll("_"," "),s.errorCode?` · ${s.errorCode}`:""]}),e.jsx("dd",{children:K(s.durationMs)})]},`${s.name}:${r}`))}),t.errorCode?e.jsx("p",{children:t.errorCode}):null]})})}function ce(t){const s=t.project.metadata.preferredDevelopmentSandboxId;return typeof s=="string"&&s.trim()?s:null}function de(t,s){for(const r of["name","label","environmentName"]){const n=t[r];if(typeof n=="string"&&n.trim())return n}return s.length>18?s.slice(0,18):s}function ue(t){return t?.website?t.errors.database?"Unavailable":t.database?.status==="ready"?`Connected · ${t.database.provider}`:t.database?.status==="provisioning"?"Connecting…":"Not connected":"Set up the website first"}function je(t){const s="/ingress",r=t.indexOf(s);return r===-1?t:`/api${t.slice(r+s.length)||"/"}`}function J(t){return t.length>12?t.slice(0,12):t}function K(t){return t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function q(t){const s=Date.parse(t);return Number.isFinite(s)?new Date(s).toLocaleString():t}function he({accountBaseUrl:t,connection:s,project:r,taskCount:n,teamName:o,onBack:a,onNewTask:l,onTogglePinned:p,onUploadLocalProject:j}){const[d,u]=h.useState("source"),[b,x]=h.useState(null),[i,f]=h.useState(null),[N,z]=h.useState(!1),[R,T]=h.useState([]),[y,P]=h.useState(!1),[E,B]=h.useState(null),m=fe(r);h.useEffect(()=>{u("source")},[r.id]),h.useEffect(()=>{let U=!0;if(f(null),x(null),z(!1),T([]),B(null),!s)return P(!1),()=>{U=!1};P(!0);const X=m?pe(s,m):Promise.resolve(null),Y=r.kind==="local"?L.localProjectActions(s,r.project.id):Promise.resolve(null);return Promise.allSettled([X,Y]).then(([v,g])=>{if(!U)return;v.status==="fulfilled"&&v.value&&(x(v.value.project),f(v.value.workspace),z(v.value.workspaceUnavailable)),g.status==="fulfilled"&&g.value&&T(g.value.actions.map(ve));const S=[v,g].filter(Z=>Z.status==="rejected");S.length>0&&S.length===+!!m+ +(r.kind==="local")&&B(S[0]?.reason instanceof Error?S[0].reason.message:"Project details could not be loaded."),P(!1)}),()=>{U=!1}},[s,m?.projectId,m?.teamId,r]);const C=h.useMemo(()=>Ne(ye(b),R),[b,R]),w=re(r,t),Q=be({hostedProject:b,project:r,repositoryUrl:w,taskCount:n,teamName:o});return e.jsxs("section",{"aria-label":`${r.project.name} project`,className:"project-detail-view",children:[e.jsxs("header",{className:"project-detail-header",children:[e.jsxs("div",{className:"project-detail-heading",children:[e.jsxs("button",{className:"project-detail-back",onClick:a,type:"button",children:[e.jsx(te,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"Projects"})]}),e.jsx("h1",{children:r.project.name})]}),e.jsxs("div",{className:"project-detail-actions",children:[r.kind==="local"?e.jsxs("button",{onClick:()=>j(r),type:"button",children:[e.jsx(V,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"Upload"})]}):null,w?e.jsxs("button",{onClick:()=>{k(w)},type:"button",children:[e.jsx(W,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"Open repository"})]}):null,e.jsxs("button",{onClick:()=>l(r),type:"button",children:[e.jsx(F,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"New task"})]}),e.jsx("button",{"aria-label":`${r.pinned?"Unpin":"Pin"} ${r.project.name}`,onClick:()=>p(r),title:r.pinned?"Unpin project":"Pin project",type:"button",children:r.pinned?e.jsx(_,{"aria-hidden":"true",size:14}):e.jsx(O,{"aria-hidden":"true",size:14})})]})]}),e.jsxs("div",{"aria-label":"Project detail",className:"project-detail-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":d==="source",onClick:()=>u("source"),role:"tab",type:"button",children:"Source"}),e.jsxs("button",{"aria-selected":d==="actions",onClick:()=>u("actions"),role:"tab",type:"button",children:["Project Actions",C.length>0?e.jsx("span",{children:C.length}):null]}),e.jsx("button",{"aria-selected":d==="environments",onClick:()=>u("environments"),role:"tab",type:"button",children:"Environments"}),e.jsx("button",{"aria-selected":d==="deployments",onClick:()=>u("deployments"),role:"tab",type:"button",children:"Deployments"}),e.jsx("button",{"aria-selected":d==="requests",onClick:()=>u("requests"),role:"tab",type:"button",children:"Requests"}),e.jsx("button",{"aria-selected":d==="website",onClick:()=>u("website"),role:"tab",type:"button",children:"Website"})]}),E?e.jsx("div",{className:"project-detail-error",role:"alert",children:E}):null,d==="source"?e.jsx(me,{loading:y,rows:Q}):d==="actions"?e.jsx(xe,{actions:C,loading:y}):d==="environments"?e.jsx(se,{linked:!!m,loading:y,unavailable:N,workspace:i}):d==="deployments"?e.jsx(ne,{linked:!!m,loading:y,unavailable:N,workspace:i}):d==="requests"?e.jsx(ie,{linked:!!m,loading:y,unavailable:N,workspace:i}):e.jsx(oe,{linked:!!m,loading:y,unavailable:N,workspace:i})]})}async function pe(t,s){try{const r=await L.getSandboxProjectWorkspace(t,s.projectId,{teamId:s.teamId});return{project:r.project,workspace:r,workspaceUnavailable:!1}}catch{return{project:(await L.getSandboxProject(t,s.projectId,{teamId:s.teamId})).project,workspace:null,workspaceUnavailable:!0}}}function me({loading:t,rows:s}){return e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Setting"}),e.jsx("th",{children:"Value"})]})}),e.jsx("tbody",{children:s.map(([r,n])=>e.jsxs("tr",{children:[e.jsx("td",{children:r}),e.jsx("td",{children:t&&r==="Latest commit"?"Loading…":n})]},r))})]})})}function xe({actions:t,loading:s}){return s?e.jsx("div",{className:"project-detail-empty",children:"Loading Project Actions…"}):t.length===0?e.jsx("div",{className:"project-detail-empty",children:"No Project Actions are registered from this source."}):e.jsx("div",{className:"project-detail-table-frame",children:e.jsxs("table",{className:"project-detail-table actions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Action"}),e.jsx("th",{children:"Description"}),e.jsx("th",{children:"Source"})]})}),e.jsx("tbody",{children:t.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:r.id})}),e.jsx("td",{children:r.description??"No description"}),e.jsx("td",{children:r.source==="hosted"?"Hosted project":"Local source"})]},`${r.source}:${r.id}`))})]})})}function be(t){const{hostedProject:s,project:r,repositoryUrl:n,taskCount:o,teamName:a}=t,l=r.kind==="local"?r.project.linkedSandboxProject:null,p=s?.gitBranch??s?.defaultBranch??(r.kind==="cloud"?r.project.defaultBranch:l?.defaultBranch)??"Not set",j=s?ge(s):l?.lastUploadedCommit??null,d=s?.sandboxManifestSyncedAt??(r.kind==="cloud"?r.project.syncedAt:l?.syncedAt)??null;return[["Repository",n?e.jsx("a",{href:n,onClick:u=>{u.preventDefault(),k(n)},children:I(n)}):r.kind==="local"?r.project.path:"Not available"],...r.kind==="local"?[["Primary folder",r.project.workspacePath],["Source folders",e.jsx("ul",{className:"project-source-folder-list",children:(r.project.sourceFolders??[r.project.workspacePath]).map(u=>e.jsx("li",{children:u},u))},"source-folders")]]:[],["Branch",p],["Latest commit",j?Se(j):"Not available"],["Last synced",d?ke(d):"Not available"],["Team",a??(r.kind==="cloud"?r.project.organizationName:null)??"Local only"],["Tasks",String(o)]]}function fe(t){if(t.kind==="cloud")return{projectId:t.project.id,teamId:t.project.teamId};const s=t.project.linkedSandboxProject;return s?{projectId:s.projectId,teamId:s.teamId}:null}function ye(t){const s=t?.sandboxActionRegistry?.actions;return Array.isArray(s)?s.flatMap(r=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=r,o=typeof(n.id??n.name)=="string"?String(n.id??n.name).trim():"";return o?[{id:o,description:typeof n.description=="string"?n.description:null,source:"hosted"}]:[]}):[]}function ve(t){return{id:t.id,description:t.description??t.label??t.name??null,source:"local"}}function Ne(t,s){const r=new Map;for(const n of[...t,...s])r.has(n.id)||r.set(n.id,n);return Array.from(r.values()).sort((n,o)=>n.id.localeCompare(o.id))}function ge(t){return[t.sourceConfig.commitSha,t.sourceConfig.sourceCommitSha,t.metadata.commitSha,t.metadata.sourceCommitSha,t.templateRemoteSha].find(r=>typeof r=="string"&&!!r.trim())??null}function Se(t){return t.length>12?t.slice(0,12):t}function ke(t){const s=Date.parse(t);return Number.isFinite(s)?new Date(s).toLocaleString():t}const Pe=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function Ie({accountBaseUrl:t,connection:s,projects:r,taskCountByProjectId:n,teamName:o,onNewCloudProject:a,onNewLocalProject:l,onNewTask:p,onTogglePinned:j,onUploadLocalProject:d}){const[u,b]=h.useState(null),x=h.useMemo(()=>r.find(i=>i.id===u)??null,[r,u]);return h.useEffect(()=>{u&&!x&&b(null)},[x,u]),x?e.jsx(he,{accountBaseUrl:t,connection:s,onBack:()=>b(null),onNewTask:p,onTogglePinned:j,onUploadLocalProject:d,project:x,taskCount:n[x.id]??0,teamName:o}):e.jsxs("section",{"aria-label":"Projects",className:"projects-page",children:[e.jsxs("header",{className:"projects-page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{children:"Projects"}),e.jsxs("p",{children:["Local projects on this device and hosted projects for ",o??"your active team","."]})]}),e.jsxs("div",{className:"projects-cloud-actions",children:[e.jsxs("button",{className:"projects-cloud-button",onClick:l,type:"button",children:[e.jsx(A,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"Add project"})]}),e.jsxs("button",{className:"projects-cloud-button",onClick:a,type:"button",children:[e.jsx(M,{"aria-hidden":"true",size:15}),e.jsx("span",{children:"New cloud project"})]})]})]}),r.length===0?e.jsxs("div",{className:"projects-empty",children:[e.jsx(A,{"aria-hidden":"true",size:24}),e.jsx("h2",{children:"No projects yet"}),e.jsx("p",{children:"Add folders from this computer or create a hosted project."})]}):e.jsx("div",{className:"projects-table-frame",children:e.jsxs("table",{className:"projects-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Project"}),e.jsx("th",{scope:"col",children:"Location"}),e.jsx("th",{scope:"col",children:"Tasks"}),e.jsx("th",{scope:"col",children:"Updated"}),e.jsx("th",{"aria-label":"Project actions",scope:"col"})]})}),e.jsx("tbody",{children:r.map(i=>{const f=i.project.updatedAt;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("button",{className:"projects-name-button",onClick:()=>b(i.id),type:"button",children:[e.jsx("span",{className:`projects-kind-icon ${Ce(i)}`,children:$(i)?e.jsx(A,{"aria-hidden":"true",size:16}):e.jsx(M,{"aria-hidden":"true",size:16})}),e.jsx("span",{className:"projects-name-copy",children:e.jsx("strong",{children:i.project.name})})]})}),e.jsx("td",{children:$(i)?e.jsxs("div",{className:"projects-location-cell",children:[e.jsx("span",{className:"projects-location",title:i.project.path,children:i.project.path}),e.jsxs("button",{className:"projects-upload-button",onClick:()=>d(i),title:`Upload ${i.project.name} to the active team`,type:"button",children:[e.jsx(V,{"aria-hidden":"true",size:13}),e.jsx("span",{children:"Upload"})]})]}):e.jsx(we,{accountBaseUrl:t,project:i})}),e.jsx("td",{children:n[i.id]??0}),e.jsx("td",{children:f?e.jsx("time",{dateTime:f,children:Ue(f)}):e.jsx("span",{className:"projects-table-muted",children:"—"})}),e.jsx("td",{children:e.jsxs("div",{className:"projects-row-actions",children:[e.jsx("button",{"aria-label":`Start a new task in ${i.project.name}`,onClick:()=>p(i),title:"New task",type:"button",children:e.jsx(F,{"aria-hidden":"true",size:15})}),e.jsx("button",{"aria-label":`${i.pinned?"Unpin":"Pin"} ${i.project.name}`,onClick:()=>j(i),title:i.pinned?"Unpin project":"Pin project",type:"button",children:i.pinned?e.jsx(_,{"aria-hidden":"true",size:15}):e.jsx(O,{"aria-hidden":"true",size:15})})]})})]},i.id)})})]})})]})}function Ce(t){return $(t)?t.project.linkedSandboxProject&&t.cloudLinkTrusted?"linked":"desktop":"cloud"}function we({accountBaseUrl:t,project:s}){const r=H(s,t);return r?e.jsxs("a",{className:"projects-location-link",href:r,onClick:n=>{n.preventDefault(),k(r)},title:r,children:[e.jsx("span",{children:I(r)}),e.jsx(W,{"aria-hidden":"true",size:12})]}):e.jsx("span",{className:"projects-table-muted",children:"Repository unavailable"})}function Ue(t){const s=Date.parse(t);return Number.isFinite(s)?Pe.format(s):t}export{Ie as ProjectsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as i}from"./index-BE-wXZ5R.js";import{F as ke}from"./folder-open-CdVKbtGq.js";import{fg as Re,fh as Ie,fi as ye,fj as je,an as Ce,aP as Pe,b0 as Te,fk as Ae,aQ as Se,aR as Me,aV as Ne,aS as Ee,X as Fe,p as Be,b5 as $e}from"./App-CLFfy_Av.js";import{u as De,a as Le}from"./useSessionTurnCache-ClAY8gze.js";import{g as Oe,u as Ue,h as qe,j as ze,l as He,k as Ke,T as Ve,M as We,i as Qe,A as Ge,m as Xe}from"./MainPane-D3ojiN-p.js";import"./MarkdownText-DOdOVFXL.js";import"./cloud-upload-B_zYztb6.js";import"./arrow-up-right-CP4hZdrJ.js";import"./square-Cb2c5td4.js";import"./play-BJPzemuY.js";function _e({panel:s,runtimeEventStore:L,actionCatalog:j,createImproveActions:C,contextCompaction:P,steerActiveResponses:O,initialScrollState:g,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,mentionApps:H,codexPersonalSkills:K,profileSkills:V,profileTarget:A,projectTarget:W,providerSettings:Q,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,showToast:J,workspaceTarget:Y,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onModelChange:se,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ie,onOpenProfileSettings:ne,onOpenSession:oe,onOpenPonder:ae,onProviderChange:re,onProviderSetupOpen:ce,onPromptChange:de,onProfileTargetChange:le,onScrollStateChange:ue,onProjectTargetChange:he,onResolveApproval:fe,onShowBrowserPanel:M,onStop:me,onSubmit:x,onWorkspaceTargetChange:pe}){const w=a.useRef(null),[v]=a.useState(()=>new Oe),R=a.useRef(g?.stickyToBottom??!0),N=a.useRef(!1),I=Ue(L,s.runtimeSource==="live"?s.sessionId:null),t=a.useMemo(()=>{if(s.runtimeSource==="history"||!s.sessionId)return s;const n=I.events,l=Re(n,[]);return{...s,messages:Pe(v.project(n),s.pendingUserMessage),createImproveRun:Ce({events:n}),contextWindowStatus:ye({provider:s.provider,snapshot:je(l,s.sessionId),preferences:P}),goalRuntime:Ie(l,s.sessionId)}},[v,P,I,s]),u=t.running&&!t.pendingApproval&&qe(t.messages),m=a.useMemo(()=>t.createImproveRun?{...C,run:t.createImproveRun}:null,[t.createImproveRun,C]),E=a.useMemo(()=>ze(t.messages,{showThinkingIndicator:u}),[t.messages,u]),F=De(t.messages,t.sessionId??`draft:${t.id}`),p=t.messages.at(-1),y=a.useMemo(()=>He(t.messages),[t.messages]),B=Le({connection:b,latestTurnId:p?.turnId??null,sessionId:t.sessionId,turnRunning:t.running}),$=[t.id,t.sessionId??"draft",E.length,p?.id??"",p?.content?.length??0,p?.timestamp??"",u?"thinking":""].join(":");a.useLayoutEffect(()=>{const n=w.current;!n||N.current||(N.current=!0,n.scrollTop=g?.stickyToBottom?n.scrollHeight:g?.scrollTop??0)},[g]),Ke({contentKey:$,onContentChange:n=>{R.current&&(n.scrollTop=n.scrollHeight)},threadRef:w});const c=a.useCallback((n,l)=>{const k=t.sessionId??`side-chat:${t.id}`;Te({conversationId:k,href:n,explicitFile:l?.explicitFile,newTab:l?.newTab}).then(h=>{h&&M()})},[t.id,t.sessionId,M]),ge=a.useCallback(async(n,l)=>{const k=l.action==="answer"?l.text:"Dismiss this question";if(!await x([],null,null,{displayPrompt:k,promptOverride:k,turnMetadata:{userQuestionResolution:l}}))throw new Error("The question response could not be sent.")},[x]);return i.jsxs("section",{className:`right-chat-pane ${t.pendingApproval?"has-approval":""}`,id:`right-chat-panel-${t.id}`,role:"tabpanel","aria-labelledby":`right-chat-tab-${t.id}`,children:[i.jsx("div",{className:"chat-thread right-chat-thread",ref:w,onScroll:n=>{const l=n.currentTarget;R.current=l.scrollHeight-l.scrollTop-l.clientHeight<=72,ue({scrollTop:l.scrollTop,stickyToBottom:R.current})},children:E.map(n=>n.type==="thinking"?i.jsx(Ve,{},n.id):i.jsx(We,{activeWorkspaceAppId:t.activeWorkspaceAppId,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,connection:b,animateInitialContent:n.message.role==="assistant"&&F.has(n.message.id),kvCacheSummary:Qe(n.message,y)&&n.message.turnId?B.get(n.message.turnId)??null:null,message:n.message,onOpenBrowserLink:c,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ie,onOpenProfileSettings:ne,onResolveUserQuestion:ge,onOpenSession:oe,onOpenPonder:ae,userAttachmentDisplay:s.provider==="codex"?"compact":"full",workspaceRootPath:t.workspaceRootPath,showFooter:n.showFooter},n.id))}),i.jsxs("div",{className:`composer-stack dock right-chat-composer ${t.pendingApproval?"has-approval":""}`,children:[i.jsx(Ge,{approval:t.pendingApproval,onResolve:fe}),i.jsx(Xe,{mode:"dock",prompt:s.prompt,mentionApps:H,connectedAppMentions:z,profileSkills:s.provider==="codex"?K:V,profileTarget:s.provider==="codex"?null:A,selectedMentionAppId:null,contextWindowStatus:t.contextWindowStatus,goalRuntime:t.goalRuntime,createImproveRuntime:m,busy:t.running,running:t.running,steerActiveResponses:O,taskSessionId:s.runtimeSource==="live"?s.sessionId:null,taskEvents:I.events,submissionScopeKey:t.sessionId??t.id,showProjectFooter:!1,connection:b,providerSettings:Q,provider:s.provider,model:s.model,projectTarget:W,actionCatalog:j,workspaceTarget:Y,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:s.provider==="codex"?T:t.session?.openPondCommandAccessMode??T,onProviderChange:re,onProviderSetupOpen:ce,onProjectTargetChange:he,onWorkspaceTargetChange:pe,onModelChange:se,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onPromptChange:de,onProfileTargetChange:le,onMentionAppSelect:void 0,showToast:J,onSubmit:x,onStop:me})]})]})}function rs({panels:s,runtimeEventStore:L,actionCatalog:j=[],createImproveActions:C,contextCompaction:P,steerActiveResponses:O,busy:g,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,mentionApps:H,codexPersonalSkills:K,profileSkills:V=[],profileLibrary:A={lastUsed:null,profiles:[]},extensionCatalog:W,projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:Z,onAddChat:ee,onActivatePanel:S,onClosePanel:se,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ie,onOpenPondCommandAccessModeChange:ne,onModelChange:oe,onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onOpenPonder:le,onProviderChange:ue,onProviderSetupOpen:he,onPromptChange:fe,onProfileTargetChange:M,onScrollStateChange:me,onProjectTargetChange:x,onResolveApproval:pe,onResizeStart:w,onSelectFiles:v,onShowBrowserPanel:R,onStop:N,onSubmit:I,onWorkspaceTargetChange:t}){const[u,m]=a.useState(!1),[E,F]=a.useState(()=>Ae(s)?.id??null),p=a.useRef(null),y=a.useRef(new Map),B=a.useRef(new Set(s.map(e=>e.id))),$=a.useRef(new Map(s.map(e=>[e.id,e.activationVersion]))),c=s.find(e=>e.id===E)??s.at(-1)??null,ge=c?.session?.currentProfile??A.lastUsed,n=Se(A,ge),l=n?Me(n,W):V,k=n?[...j.filter(e=>!Ne(e)),...Ee(n)]:j;a.useEffect(()=>{const e=B.current,d=$.current;let r=null,f=null;for(const o of s)e.has(o.id)||(r=o),e.has(o.id)&&o.activationVersion>(d.get(o.id)??0)&&(f=o);B.current=new Set(s.map(o=>o.id)),$.current=new Map(s.map(o=>[o.id,o.activationVersion])),F(o=>f?f.id:r?r.id:o&&s.some(D=>D.id===o)?o:s.at(-1)?.id??null)},[s]),a.useEffect(()=>{if(!u)return;function e(r){p.current?.contains(r.target)||m(!1)}function d(r){r.key==="Escape"&&m(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",d)}},[u]);const h=a.useCallback((e,d=!1)=>{F(e),S(e),d&&window.requestAnimationFrame(()=>y.current.get(e)?.focus())},[S]),ve=a.useCallback((e=!1)=>{v(),e&&window.requestAnimationFrame(()=>{document.getElementById("right-sidebar-files-tab")?.focus()})},[v]),be=a.useCallback((e,d)=>{const r=s.findIndex(we=>we.id===d);if(r<0)return;const f=r+1;let o=null;if(e.key==="ArrowRight"&&(o=(f+1)%(s.length+1)),e.key==="ArrowLeft"&&(o=(f-1+s.length+1)%(s.length+1)),e.key==="Home"&&(o=0),e.key==="End"&&(o=s.length),o===null)return;if(e.preventDefault(),o===0){ve(!0);return}const D=s[o-1];D&&h(D.id,!0)},[s,ve,h]),xe=a.useCallback(e=>{if(!["ArrowRight","ArrowLeft","Home","End"].includes(e.key)||(e.preventDefault(),e.key==="Home"))return;const d=e.key==="ArrowLeft"||e.key==="End"?s.at(-1):s[0];d&&h(d.id,!0)},[s,h]);return i.jsxs("aside",{className:"workspace-diff-panel right-chat-panel-stack","aria-label":"Side chats",children:[i.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize side chat panel",onPointerDown:w}),i.jsx("div",{className:"workspace-diff-topbar right-chat-topbar",children:i.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:[i.jsxs("button",{type:"button",className:"workspace-diff-tab",role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":!1,tabIndex:-1,onClick:()=>ve(!1),onKeyDown:xe,children:[i.jsx(ke,{size:14}),i.jsx("span",{children:"Files"})]}),s.map(e=>{const d=e.id===c?.id;return i.jsxs("div",{className:`workspace-diff-tab right-chat-tab ${d?"active":""}`,children:[i.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":d,tabIndex:d?0:-1,title:e.title,ref:r=>{r?y.current.set(e.id,r):y.current.delete(e.id)},onClick:()=>h(e.id),onKeyDown:r=>be(r,e.id),children:[e.running?i.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,i.jsx("span",{children:e.title})]}),i.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:r=>{r.stopPropagation(),se(e.id)},children:i.jsx(Fe,{size:12})})]},e.id)}),i.jsxs("div",{className:"workspace-diff-add-anchor",ref:p,children:[i.jsx("button",{type:"button",className:`workspace-diff-add-tab ${u?"active":""}`,title:"Add to right sidebar","aria-label":"Add to right sidebar","aria-haspopup":"menu","aria-expanded":u,onClick:()=>m(e=>!e),children:i.jsx(Be,{size:15})}),u?i.jsxs("div",{className:"workspace-diff-add-menu right-chat-add-popover",role:"menu",children:[i.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),ee()},children:[i.jsx($e,{size:13}),i.jsx("span",{children:"New task"})]}),i.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),v()},children:[i.jsx(ke,{size:13}),i.jsx("span",{children:"Files"})]})]}):null]})]})}),i.jsx("div",{className:"right-chat-stack-body panes-1",children:c?i.jsx(_e,{busy:g,createImproveActions:C,contextCompaction:P,steerActiveResponses:O,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,actionCatalog:k,mentionApps:H,codexPersonalSkills:K,profileSkills:l,profileTarget:null,panel:c,runtimeEventStore:L,initialScrollState:{scrollTop:c.scrollTop,stickyToBottom:c.stickyToBottom},projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:Z,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ie,onOpenPondCommandAccessModeChange:e=>ne(e,c.session),onModelChange:e=>oe(c.id,e),onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onOpenPonder:le,onProviderChange:e=>ue(c.id,e),onProviderSetupOpen:he,onPromptChange:e=>fe(c.id,e),onProfileTargetChange:e=>M(c.sessionId,e),onScrollStateChange:e=>me(c.id,e),onProjectTargetChange:x,onResolveApproval:pe,onShowBrowserPanel:R,onStop:()=>N(c.sessionId),onSubmit:(e,d,r,f)=>I(c.id,e,d,r,f),onWorkspaceTargetChange:t},c.id):null})]})}export{rs as RightChatPanelStack};
|
|
1
|
+
import{r as a,j as n}from"./index-C8aCGagb.js";import{F as ke}from"./folder-open-sYgceW_f.js";import{fk as Re,fl as Ie,fm as ye,fn as je,aq as Ce,aS as Pe,b3 as Te,fo as Ae,aT as Se,aU as Me,aY as Ne,aV as Ee,X as Fe,t as Be,b8 as $e}from"./App-s-CJswyt.js";import{u as De,a as Le}from"./useSessionTurnCache-BHU2-Jmz.js";import{g as Oe,u as Ue,h as qe,j as ze,l as He,k as Ke,T as Ve,M as We,i as Qe,A as Ge,m as Xe}from"./MainPane-5DTtwVCk.js";import"./MarkdownText-BR4V6lNO.js";import"./cloud-upload-k9eqBsHr.js";import"./arrow-up-right-C9aE8Mfz.js";import"./square-BuImvLhT.js";import"./play-C469pVZq.js";function Ye({panel:s,runtimeEventStore:L,actionCatalog:j,createImproveActions:C,contextCompaction:P,steerActiveResponses:O,initialScrollState:g,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,mentionApps:H,codexPersonalSkills:K,profileSkills:V,profileTarget:A,projectTarget:W,providerSettings:Q,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:Y,showToast:_,workspaceTarget:J,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onModelChange:se,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ne,onOpenProfileSettings:ie,onOpenSession:oe,onOpenPonder:ae,onProviderChange:re,onProviderSetupOpen:ce,onPromptChange:de,onProfileTargetChange:le,onScrollStateChange:ue,onProjectTargetChange:me,onResolveApproval:fe,onShowBrowserPanel:M,onStop:he,onSubmit:x,onWorkspaceTargetChange:pe}){const w=a.useRef(null),[v]=a.useState(()=>new Oe),R=a.useRef(g?.stickyToBottom??!0),N=a.useRef(!1),I=Ue(L,s.runtimeSource==="live"?s.sessionId:null),t=a.useMemo(()=>{if(s.runtimeSource==="history"||!s.sessionId)return s;const i=I.events,l=Re(i,[]);return{...s,messages:Pe(v.project(i),s.pendingUserMessage),createImproveRun:Ce({events:i}),contextWindowStatus:ye({provider:s.provider,snapshot:je(l,s.sessionId),preferences:P}),goalRuntime:Ie(l,s.sessionId)}},[v,P,I,s]),u=t.running&&!t.pendingApproval&&qe(t.messages),h=a.useMemo(()=>t.createImproveRun?{...C,run:t.createImproveRun}:null,[t.createImproveRun,C]),E=a.useMemo(()=>ze(t.messages,{showThinkingIndicator:u}),[t.messages,u]),F=De(t.messages,t.sessionId??`draft:${t.id}`),p=t.messages.at(-1),y=a.useMemo(()=>He(t.messages),[t.messages]),B=Le({connection:b,latestTurnId:p?.turnId??null,sessionId:t.sessionId,turnRunning:t.running}),$=[t.id,t.sessionId??"draft",E.length,p?.id??"",p?.content?.length??0,p?.timestamp??"",u?"thinking":""].join(":");a.useLayoutEffect(()=>{const i=w.current;!i||N.current||(N.current=!0,i.scrollTop=g?.stickyToBottom?i.scrollHeight:g?.scrollTop??0)},[g]),Ke({contentKey:$,onContentChange:i=>{R.current&&(i.scrollTop=i.scrollHeight)},threadRef:w});const c=a.useCallback((i,l)=>{const k=t.sessionId??`side-chat:${t.id}`;Te({conversationId:k,href:i,explicitFile:l?.explicitFile,newTab:l?.newTab}).then(m=>{m&&M()})},[t.id,t.sessionId,M]),ge=a.useCallback(async(i,l)=>{const k=l.action==="answer"?l.text:"Dismiss this question";if(!await x([],null,null,{displayPrompt:k,promptOverride:k,turnMetadata:{userQuestionResolution:l}}))throw new Error("The question response could not be sent.")},[x]);return n.jsxs("section",{className:`right-chat-pane ${t.pendingApproval?"has-approval":""}`,id:`right-chat-panel-${t.id}`,role:"tabpanel","aria-labelledby":`right-chat-tab-${t.id}`,children:[n.jsx("div",{className:"chat-thread right-chat-thread",ref:w,onScroll:i=>{const l=i.currentTarget;R.current=l.scrollHeight-l.scrollTop-l.clientHeight<=72,ue({scrollTop:l.scrollTop,stickyToBottom:R.current})},children:E.map(i=>i.type==="thinking"?n.jsx(Ve,{},i.id):n.jsx(We,{activeWorkspaceAppId:t.activeWorkspaceAppId,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:Y,connection:b,animateInitialContent:i.message.role==="assistant"&&F.has(i.message.id),kvCacheSummary:Qe(i.message,y)&&i.message.turnId?B.get(i.message.turnId)??null:null,message:i.message,onOpenBrowserLink:c,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ne,onOpenProfileSettings:ie,onResolveUserQuestion:ge,onOpenSession:oe,onOpenPonder:ae,userAttachmentDisplay:s.provider==="codex"?"compact":"full",workspaceRootPath:t.workspaceRootPath,showFooter:i.showFooter},i.id))}),n.jsxs("div",{className:`composer-stack dock right-chat-composer ${t.pendingApproval?"has-approval":""}`,children:[n.jsx(Ge,{approval:t.pendingApproval,onResolve:fe}),n.jsx(Xe,{mode:"dock",prompt:s.prompt,mentionApps:H,connectedAppMentions:z,profileSkills:s.provider==="codex"?K:V,profileTarget:s.provider==="codex"?null:A,selectedMentionAppId:null,contextWindowStatus:t.contextWindowStatus,goalRuntime:t.goalRuntime,createImproveRuntime:h,busy:t.running,running:t.running,steerActiveResponses:O,taskSessionId:s.runtimeSource==="live"?s.sessionId:null,taskEvents:I.events,submissionScopeKey:t.sessionId??t.id,showProjectFooter:!1,connection:b,providerSettings:Q,provider:s.provider,model:s.model,projectTarget:W,actionCatalog:j,workspaceTarget:J,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:s.provider==="codex"?T:t.session?.openPondCommandAccessMode??T,onProviderChange:re,onProviderSetupOpen:ce,onProjectTargetChange:me,onWorkspaceTargetChange:pe,onModelChange:se,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onPromptChange:de,onProfileTargetChange:le,onMentionAppSelect:void 0,showToast:_,onSubmit:x,onStop:he})]})]})}function rs({panels:s,runtimeEventStore:L,actionCatalog:j=[],createImproveActions:C,contextCompaction:P,steerActiveResponses:O,busy:g,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,mentionApps:H,codexPersonalSkills:K,profileSkills:V=[],profileLibrary:A={lastUsed:null,profiles:[]},extensionCatalog:W,projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:Y,billingTeamId:_,showToast:J,workspaceTarget:Z,onAddChat:ee,onActivatePanel:S,onClosePanel:se,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ne,onOpenPondCommandAccessModeChange:ie,onModelChange:oe,onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onOpenPonder:le,onProviderChange:ue,onProviderSetupOpen:me,onPromptChange:fe,onProfileTargetChange:M,onScrollStateChange:he,onProjectTargetChange:x,onResolveApproval:pe,onResizeStart:w,onSelectFiles:v,onShowBrowserPanel:R,onStop:N,onSubmit:I,onWorkspaceTargetChange:t}){const[u,h]=a.useState(!1),[E,F]=a.useState(()=>Ae(s)?.id??null),p=a.useRef(null),y=a.useRef(new Map),B=a.useRef(new Set(s.map(e=>e.id))),$=a.useRef(new Map(s.map(e=>[e.id,e.activationVersion]))),c=s.find(e=>e.id===E)??s.at(-1)??null,ge=c?.session?.currentProfile??A.lastUsed,i=Se(A,ge),l=i?Me(i,W):V,k=i?[...j.filter(e=>!Ne(e)),...Ee(i)]:j;a.useEffect(()=>{const e=B.current,d=$.current;let r=null,f=null;for(const o of s)e.has(o.id)||(r=o),e.has(o.id)&&o.activationVersion>(d.get(o.id)??0)&&(f=o);B.current=new Set(s.map(o=>o.id)),$.current=new Map(s.map(o=>[o.id,o.activationVersion])),F(o=>f?f.id:r?r.id:o&&s.some(D=>D.id===o)?o:s.at(-1)?.id??null)},[s]),a.useEffect(()=>{if(!u)return;function e(r){p.current?.contains(r.target)||h(!1)}function d(r){r.key==="Escape"&&h(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",d)}},[u]);const m=a.useCallback((e,d=!1)=>{F(e),S(e),d&&window.requestAnimationFrame(()=>y.current.get(e)?.focus())},[S]),ve=a.useCallback((e=!1)=>{v(),e&&window.requestAnimationFrame(()=>{document.getElementById("right-sidebar-files-tab")?.focus()})},[v]),be=a.useCallback((e,d)=>{const r=s.findIndex(we=>we.id===d);if(r<0)return;const f=r+1;let o=null;if(e.key==="ArrowRight"&&(o=(f+1)%(s.length+1)),e.key==="ArrowLeft"&&(o=(f-1+s.length+1)%(s.length+1)),e.key==="Home"&&(o=0),e.key==="End"&&(o=s.length),o===null)return;if(e.preventDefault(),o===0){ve(!0);return}const D=s[o-1];D&&m(D.id,!0)},[s,ve,m]),xe=a.useCallback(e=>{if(!["ArrowRight","ArrowLeft","Home","End"].includes(e.key)||(e.preventDefault(),e.key==="Home"))return;const d=e.key==="ArrowLeft"||e.key==="End"?s.at(-1):s[0];d&&m(d.id,!0)},[s,m]);return n.jsxs("aside",{className:"workspace-diff-panel right-chat-panel-stack","aria-label":"Side chats",children:[n.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize side chat panel",onPointerDown:w}),n.jsx("div",{className:"workspace-diff-topbar right-chat-topbar",children:n.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:[n.jsxs("button",{type:"button",className:"workspace-diff-tab",role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":!1,tabIndex:-1,onClick:()=>ve(!1),onKeyDown:xe,children:[n.jsx(ke,{size:14}),n.jsx("span",{children:"Files"})]}),s.map(e=>{const d=e.id===c?.id;return n.jsxs("div",{className:`workspace-diff-tab right-chat-tab ${d?"active":""}`,children:[n.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":d,tabIndex:d?0:-1,title:e.title,ref:r=>{r?y.current.set(e.id,r):y.current.delete(e.id)},onClick:()=>m(e.id),onKeyDown:r=>be(r,e.id),children:[e.running?n.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,n.jsx("span",{children:e.title})]}),n.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:r=>{r.stopPropagation(),se(e.id)},children:n.jsx(Fe,{size:12})})]},e.id)}),n.jsxs("div",{className:"workspace-diff-add-anchor",ref:p,children:[n.jsx("button",{type:"button",className:`workspace-diff-add-tab ${u?"active":""}`,title:"Add to right sidebar","aria-label":"Add to right sidebar","aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(e=>!e),children:n.jsx(Be,{size:15})}),u?n.jsxs("div",{className:"workspace-diff-add-menu right-chat-add-popover",role:"menu",children:[n.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),ee()},children:[n.jsx($e,{size:13}),n.jsx("span",{children:"New task"})]}),n.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),v()},children:[n.jsx(ke,{size:13}),n.jsx("span",{children:"Files"})]})]}):null]})]})}),n.jsx("div",{className:"right-chat-stack-body panes-1",children:c?n.jsx(Ye,{busy:g,createImproveActions:C,contextCompaction:P,steerActiveResponses:O,codexPermissionMode:U,codexReasoningEffort:q,openPondCommandAccessMode:T,connection:b,connectedAppMentions:z,actionCatalog:k,mentionApps:H,codexPersonalSkills:K,profileSkills:l,profileTarget:null,panel:c,runtimeEventStore:L,initialScrollState:{scrollTop:c.scrollTop,stickyToBottom:c.stickyToBottom},projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:Y,billingTeamId:_,showToast:J,workspaceTarget:Z,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ne,onOpenPondCommandAccessModeChange:e=>ie(e,c.session),onModelChange:e=>oe(c.id,e),onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onOpenPonder:le,onProviderChange:e=>ue(c.id,e),onProviderSetupOpen:me,onPromptChange:e=>fe(c.id,e),onProfileTargetChange:e=>M(c.sessionId,e),onScrollStateChange:e=>he(c.id,e),onProjectTargetChange:x,onResolveApproval:pe,onShowBrowserPanel:R,onStop:()=>N(c.sessionId),onSubmit:(e,d,r,f)=>I(c.id,e,d,r,f),onWorkspaceTargetChange:t},c.id):null})]})}export{rs as RightChatPanelStack};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-C8aCGagb.js";import{aC as f,bY as x,aJ as j,b8 as u,by as k,a0 as g}from"./App-s-CJswyt.js";import{C as w}from"./clipboard-Dk158Qp4.js";import{F as S}from"./folder-open-sYgceW_f.js";import{M as v}from"./minimize-2-CqcI4zcM.js";function D({expanded:i,terminalOpen:s,sideChatAvailable:r,onOpenBrowser:l,onOpenFiles:t,onOpenReview:o,onOpenSideChat:n,onOpenTrainingDraft:d,trainingDraftAvailable:c,onResizeStart:b,onToggleExpanded:m,onToggleTerminal:h}){const p=[{id:"review",label:"Review",meta:"Diffs",icon:w,onSelect:o},{id:"files",label:"Files",meta:"Workspace",icon:S,onSelect:t},{id:"browser",label:"Browser",meta:"Preview",icon:j,onSelect:l},{id:"side-chat",label:"Side chat",meta:"Context",icon:u,onSelect:n,disabled:!r},{id:"training-draft",label:"Task draft",meta:"Training",icon:k,onSelect:d,disabled:!c},{id:"terminal",label:s?"Hide terminal":"Terminal",meta:"Shell",icon:g,onSelect:h}];return e.jsxs("aside",{className:`workspace-diff-panel right-sidebar-home-panel ${i?"expanded":""}`,"aria-label":"Right sidebar",children:[i?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize right sidebar",onPointerDown:b}),e.jsxs("div",{className:"workspace-diff-topbar right-sidebar-home-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:e.jsxs("button",{type:"button",className:"workspace-diff-tab active",role:"tab","aria-selected":!0,children:[e.jsx(f,{size:14}),e.jsx("span",{children:"Workspace"})]})}),e.jsx("div",{className:"workspace-diff-toolbar-actions",children:e.jsx("button",{type:"button",className:"diff-icon-button",title:i?"Dock sidebar":"Expand sidebar","aria-label":i?"Dock sidebar":"Expand sidebar",onClick:m,children:i?e.jsx(v,{size:14}):e.jsx(x,{size:14})})})]}),e.jsx("div",{className:"right-sidebar-home-body",children:e.jsx("div",{className:"right-sidebar-home-actions",role:"menu","aria-label":"Workspace actions",children:p.map(a=>e.jsxs("button",{type:"button",className:"right-sidebar-home-row",role:"menuitem",disabled:a.disabled,onClick:a.onSelect,children:[e.jsx(a.icon,{size:15}),e.jsx("span",{children:a.label}),a.meta?e.jsx("span",{className:"right-sidebar-home-chip",children:a.meta}):null]},a.id))})})]})}export{D as RightSidebarHomePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e}from"./index-BE-wXZ5R.js";import{R as E,T as Re,bw as Ce,fd as Ae,bV as Te,X as $e,aL as xe,r as De,bq as X,a1 as ee,Q as Ee,ba as U,ax as Ie,aE as Me}from"./App-CLFfy_Av.js";import{u as We}from"./useLocalAgentSchedules-DMnGfswi.js";import{a as Pe,P as le,T as pe}from"./MarkdownText-DOdOVFXL.js";import{P as ae}from"./play-BJPzemuY.js";import{S as Le}from"./save-BDy9tA3E.js";import{M as ze}from"./minimize-2-Cyg_zD9z.js";import{r as Fe,c as Oe,b as Ze}from"./MainPane-D3ojiN-p.js";import"./cloud-upload-B_zYztb6.js";import"./arrow-up-right-CP4hZdrJ.js";import"./square-Cb2c5td4.js";import"./folder-open-CdVKbtGq.js";const _e=3e4;function He(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(null),[j,r]=o.useState(!1),[a,c]=o.useState(null),[k,w]=o.useState(()=>new Set);async function h(m,f){f&&r(!0);try{const u=await E.hostedSavedWork(m);n(u.definitions),d(u.runs),p(u.webBaseUrl??null),c(null)}catch(u){c(se(u))}finally{f&&r(!1)}}o.useEffect(()=>{if(!s){n([]),d([]),p(null),c(null),r(!1);return}let m=!1;const f=async A=>{if(!m){A&&r(!0);try{const y=await E.hostedSavedWork(s);if(m)return;n(y.definitions),d(y.runs),p(y.webBaseUrl??null),c(null)}catch(y){m||c(se(y))}finally{!m&&A&&r(!1)}}};f(!0);const u=window.setInterval(()=>{f(!1)},_e);return()=>{m=!0,window.clearInterval(u)}},[s]);async function b(){s&&await h(s,!0)}async function R(m){s&&(await E.createHostedSavedWork(s,m),await h(s,!1))}async function $(m,f){await C(m,async u=>{await E.updateHostedSavedWork(u,m,f)})}async function g(m){await C(m,async f=>{await E.deleteHostedSavedWork(f,m)})}async function P(m){await C(m,async f=>{await E.runHostedSavedWork(f,m,crypto.randomUUID())})}async function C(m,f){if(!(!s||k.has(m))){N(m,!0);try{await f(s),await h(s,!1)}catch(u){throw c(se(u)),u}finally{N(m,!1)}}}function N(m,f){w(u=>{const A=new Set(u);return f?A.add(m):A.delete(m),A})}return{create:R,definitions:t,error:a,loading:j,pendingScheduleIds:k,refresh:b,remove:g,run:P,runs:l,update:$,webBaseUrl:x}}function se(s){return s instanceof Error?s.message:String(s)}const Ue=3e4;function Ke(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(!1),[j,r]=o.useState(null),[a,c]=o.useState(()=>new Set),k=o.useCallback(async h=>{if(s){h&&p(!0);try{const b=await E.chatWorkflows(s);n(b.workflows),d(b.runs),r(null)}catch(b){r(b instanceof Error?b.message:String(b))}finally{h&&p(!1)}}},[s]);o.useEffect(()=>{if(!s){n([]),d([]),r(null),p(!1);return}k(!0);const h=window.setInterval(()=>{k(!1)},Ue);return()=>window.clearInterval(h)},[s,k]);async function w(h,b){if(!a.has(h)){c(R=>new Set(R).add(h));try{await b(),await k(!1)}catch(R){throw r(R instanceof Error?R.message:String(R)),R}finally{c(R=>{const $=new Set(R);return $.delete(h),$})}}}return{workflows:t,runs:l,loading:x,error:j,pendingIds:a,refresh:()=>k(!0),update:(h,b)=>w(h,()=>E.updateChatWorkflow(s,h,b)),remove:h=>w(h,()=>E.deleteChatWorkflow(s,h)),run:h=>w(h,()=>E.runChatWorkflow(s,h))}}const je="openpond.scheduled-work.view.v1";function oe(s=we()){try{return s?.getItem(je)==="list"?"list":"calendar"}catch{return"calendar"}}function Ve(s,t=we()){try{t?.setItem(je,s)}catch{}}function we(){if(typeof window>"u")return null;try{return Re}catch{return null}}function W(s,t){if(!s)return"None";const n=new Date(s);if(!Number.isFinite(n.getTime()))return"None";try{return n.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",...t?{timeZone:t,timeZoneName:"short"}:{}})}catch{return n.toLocaleString()}}function be(s){return B(s.replaceAll("_"," "))}function B(s){return s.replace(/^./,t=>t.toUpperCase())}function ve(s){const[t="0",n="00"]=s.split(":");return new Date(2020,0,1,Number(t),Number(n)).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function qe({run:s}){const t=s.error||s.stderr||s.stdout;return e.jsxs("details",{className:"scheduled-run-row",children:[e.jsxs("summary",{children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(s.status)}),e.jsx("small",{children:W(s.createdAt,null)})]}),e.jsx("span",{className:"scheduled-run-trigger",children:s.trigger==="manual"?"Manual":"Scheduled"})]}),t?e.jsx("pre",{children:t}):null]})}function Be({onOpen:s,run:t}){return e.jsxs("button",{className:"scheduled-run-row hosted",onClick:s,type:"button",children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(t.status)}),e.jsx("small",{children:W(t.createdAt,null)})]}),e.jsxs("span",{className:"scheduled-run-trigger",children:[B(t.triggerKind)," ",e.jsx(xe,{size:11})]}),t.deliveryError?e.jsx("p",{children:t.deliveryError}):null]})}function Q({children:s,detailExpanded:t,kind:n="schedule",label:l,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:p}){return e.jsxs("aside",{"aria-label":l,className:`workspace-diff-panel scheduled-detail${t?" expanded":""}`,children:[t?null:e.jsx("div",{"aria-label":"Resize schedule details","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:x,role:"separator"}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":`${n==="workflow"?"Workflow":"Schedule"} details`,children:e.jsxs("button",{"aria-selected":"true",className:"workspace-diff-tab active",role:"tab",type:"button",children:[e.jsx(Ae,{size:14}),e.jsx("span",{children:n==="workflow"?"Workflow":"Schedule"})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{"aria-label":t?`Dock ${n} details`:`Expand ${n} details`,className:"diff-icon-button",onClick:p,title:t?`Dock ${n} details`:`Expand ${n} details`,type:"button",children:t?e.jsx(ze,{size:14}):e.jsx(Te,{size:14})}),e.jsx("button",{"aria-label":`Close ${n} details`,className:"diff-icon-button",onClick:d,title:`Close ${n} details`,type:"button",children:e.jsx($e,{size:14})})]})]}),e.jsx("div",{className:"scheduled-detail-body",children:s})]})}function T({children:s,title:t}){return e.jsxs("section",{className:"scheduled-detail-section",children:[e.jsx("div",{className:"scheduled-detail-section-heading",children:e.jsx("h3",{children:t})}),s]})}function M({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:t})]})}function te({children:s}){return e.jsx("p",{className:"scheduled-empty",children:s})}function ke({label:s}){return e.jsxs("div",{className:"scheduled-loading",role:"status",children:[e.jsx(Ce,{className:"scheduled-spin",size:16}),e.jsx("span",{children:s})]})}const Ye=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ge({items:s,onSelect:t,selectedKey:n}){const[l,d]=o.useState(()=>de(new Date)),x=o.useMemo(()=>Je(l),[l]),p=o.useMemo(()=>Xe(s),[s]),j=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(l),r=s.filter(a=>!ye(a.nextRunAt));return e.jsxs("div",{className:"scheduled-calendar",children:[e.jsxs("div",{className:"scheduled-calendar-toolbar",children:[e.jsx("strong",{children:j}),e.jsxs("div",{children:[e.jsx("button",{"aria-label":"Previous month",className:"scheduled-icon-button",onClick:()=>d(ce(l,-1)),type:"button",children:e.jsx(De,{size:15})}),e.jsx("button",{className:"scheduled-calendar-today",onClick:()=>d(de(new Date)),type:"button",children:"Today"}),e.jsx("button",{"aria-label":"Next month",className:"scheduled-icon-button",onClick:()=>d(ce(l,1)),type:"button",children:e.jsx(Pe,{size:15})})]})]}),e.jsxs("div",{className:"scheduled-calendar-grid",role:"grid","aria-label":j,children:[Ye.map(a=>e.jsx("div",{className:"scheduled-calendar-weekday",role:"columnheader",children:a},a)),x.map(a=>{const c=ne(a),k=p.get(c)??[],w=a.getMonth()!==l.getMonth(),h=c===ne(new Date);return e.jsxs("div",{className:`scheduled-calendar-day${w?" outside":""}${h?" today":""}`,role:"gridcell",children:[e.jsx("span",{className:"scheduled-calendar-day-number",children:a.getDate()}),e.jsx("div",{className:"scheduled-calendar-events",children:k.map(b=>e.jsxs("button",{"aria-current":n===b.key?"true":void 0,className:`scheduled-calendar-event${b.enabled?"":" paused"}`,onClick:()=>t(b.key),title:b.title,type:"button",children:[e.jsx("span",{children:Qe(b.nextRunAt)}),e.jsx("strong",{children:b.title})]},b.key))})]},c)})]}),r.length?e.jsxs("div",{className:"scheduled-calendar-unscheduled",children:[e.jsx("span",{children:"No upcoming run"}),e.jsx("div",{children:r.map(a=>e.jsx("button",{onClick:()=>t(a.key),type:"button",children:a.title},a.key))})]}):null]})}function Je(s){const t=new Date(s.getFullYear(),s.getMonth(),1),n=new Date(t);return n.setDate(t.getDate()-t.getDay()),Array.from({length:42},(l,d)=>{const x=new Date(n);return x.setDate(n.getDate()+d),x})}function Xe(s){const t=new Map;for(const n of s){const l=ye(n.nextRunAt);if(!l)continue;const d=ne(l);t.set(d,[...t.get(d)??[],n])}for(const n of t.values())n.sort((l,d)=>l.nextRunAt.localeCompare(d.nextRunAt));return t}function ye(s){if(!s)return null;const t=new Date(s);return Number.isNaN(t.getTime())?null:t}function ne(s){return`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`}function de(s){return new Date(s.getFullYear(),s.getMonth(),1)}function ce(s,t){return new Date(s.getFullYear(),s.getMonth()+t,1)}function Qe(s){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(new Date(s))}function es({entry:s,onSelect:t,selected:n}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:"scheduled-status-dot"}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:s.workflow.label})}),e.jsx("span",{children:s.workflow.description}),e.jsxs("small",{children:["On demand · Source ",s.binding.sourceRevision.slice(0,10)]})]})]})}function ss({cadence:s,onSelect:t,schedule:n,selected:l}){return e.jsxs("button",{"aria-current":l?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${n.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:n.scheduleName})}),e.jsx("span",{children:n.localProjectName}),e.jsxs("small",{children:[s,n.nextRunAt?` · Next ${W(n.nextRunAt,n.timezone)}`:" · No next run"]})]})]})}function ts({cadence:s,definition:t,onSelect:n,schedule:l,selected:d}){return e.jsxs("button",{"aria-current":d?"true":void 0,className:"scheduled-list-row",onClick:n,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:t.name}),e.jsx("small",{className:"scheduled-environment-badge hosted",children:"Hosted"})]}),e.jsx("span",{children:t.prompt}),e.jsxs("small",{children:[s,l.nextRunAt?` · Next ${W(l.nextRunAt,l.timeZone)}`:" · No next run"]})]})]})}function ns({cadence:s,onSelect:t,selected:n,workflow:l}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:l.name}),e.jsx("small",{className:"scheduled-environment-badge",children:"Chat"})]}),e.jsx("span",{children:l.prompt}),e.jsxs("small",{children:["Runs in ",l.sessionTitle," · ",s,l.nextRunAt?` · Next ${W(l.nextRunAt,l.recurrence.timeZone)}`:" · No next run"]})]})]})}function ls(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>{const d=n.nextRunAt?new Date(n.nextRunAt).getTime():Number.POSITIVE_INFINITY,x=l.nextRunAt?new Date(l.nextRunAt).getTime():Number.POSITIVE_INFINITY;return d-x||n.name.localeCompare(l.name)})}function re(s){const t=ve(s.localTime);return s.kind==="once"?`Once on ${s.startDate} at ${t} · ${s.timeZone}`:s.kind==="weekdays"?`Weekdays at ${t} · ${s.timeZone}`:s.kind==="weekly"?`${s.weekdays?.map(B).join(", ")??"Weekly"} at ${t} · ${s.timeZone}`:s.kind==="monthly"?`Monthly on day ${s.dayOfMonth??1} at ${t} · ${s.timeZone}`:`Daily at ${t} · ${s.timeZone}`}function as({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onToggle:x,onToggleDetailExpanded:p,pending:j,runs:r,workflow:a}){return e.jsxs(Q,{detailExpanded:s,label:`${a.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Workflow details"}),e.jsx("span",{children:a.enabled?"Active":"Paused"})]}),e.jsx("p",{children:a.name})]})}),e.jsx(T,{title:"Prompt",children:e.jsx("pre",{className:"scheduled-prompt",children:a.prompt})}),e.jsx(T,{title:"Profile source",children:a.profileRef&&a.profileWorkflowId?e.jsxs("p",{children:[a.profileRef.profileId," · workflows/",a.profileWorkflowId,"/PROMPT.md"]}):e.jsx("p",{className:"scheduled-detail-error",children:a.profileMigrationError??"Profile package is unresolved."})}),e.jsxs(T,{title:"Delivery",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(M,{label:"Runs in",value:a.sessionTitle}),e.jsx(M,{label:"Cadence",value:re(a.recurrence)}),e.jsx(M,{label:"Next run",value:W(a.nextRunAt,a.recurrence.timeZone)}),e.jsx(M,{label:"Last run",value:W(a.lastRunAt,a.recurrence.timeZone)})]}),a.lastError?e.jsx("p",{className:"scheduled-detail-error",children:a.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{x()},type:"button",children:[a.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.enabled?"Pause":"Resume"})]}),e.jsxs("button",{disabled:j,onClick:()=>{n()},type:"button",children:[e.jsx(pe,{size:15}),e.jsx("span",{children:"Delete"})]})]}),e.jsx(T,{title:"Runs",children:r.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:r.map(c=>e.jsxs("div",{className:"scheduled-run-row",children:[e.jsx("span",{children:B(c.status)}),e.jsx("small",{children:W(c.createdAt,a.recurrence.timeZone)}),c.error?e.jsx("p",{children:c.error}):null]},c.id))})})]})}async function rs(s){const t=s.catalog.workflows.find(d=>d.workflow.id===s.workflowId);if(!t)throw new Error("Selected Profile workflow is unavailable.");const n=s.client??E,l=await n.createSession(s.connection,{experience:"work",provider:"openpond",...s.workspaceTarget==="local"?{metadata:{workspaceTarget:"local"}}:{},currentProfile:s.catalog.profileRef,profileWorkflowBinding:t.binding,title:t.workflow.label});return s.onSessionCreated?.(l.id),await n.sendTurn(s.connection,l.id,{prompt:s.prompt?.trim()||t.workflow.label,workflowInput:s.value,...s.attachments?.length?{attachments:s.attachments}:{},approvalPolicy:"on-request",sandbox:"workspace-write",codexPermissionMode:"default"}),l.id}function is({catalog:s,connection:t,detailExpanded:n,entry:l,onClose:d,onDetailResizeStart:x,onOpenSession:p,onToggleDetailExpanded:j}){const[r,a]=o.useState(""),[c,k]=o.useState([]),[w,h]=o.useState("{}"),[b,R]=o.useState(s.profileRef.source==="local"?"local":"hosted"),[$,g]=o.useState(!1),[P,C]=o.useState(null),N=l.workflow;async function m(f){if(f.preventDefault(),!$){g(!0),C(null);try{const u=JSON.parse(w);if(c.length>ee.maxAttachments)throw new Error(`Choose at most ${ee.maxAttachments} files.`);const A=await Promise.all(c.map(async y=>{if(y.size>ee.maxAttachmentBytes)throw new Error(`${y.name} exceeds the attachment size limit.`);return Fe({id:Ze(),file:y,name:y.name,mediaType:y.type||"application/octet-stream",sizeBytes:y.size,kind:Oe(y)})}));await rs({connection:t,catalog:s,workflowId:N.id,value:u,prompt:r,attachments:A,workspaceTarget:b,onSessionCreated:p})}catch(u){C(u instanceof Error?u.message:String(u))}finally{g(!1)}}}return e.jsxs(Q,{detailExpanded:n,kind:"workflow",label:`${N.label} details`,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:j,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsx("div",{className:"scheduled-detail-title-row",children:e.jsx("h2",{children:"Workflow details"})}),e.jsx("p",{children:N.label})]})}),e.jsx(T,{title:"Description",children:e.jsx("p",{children:N.description})}),e.jsxs(T,{title:"Source",children:[e.jsxs("p",{children:["workflows/",N.id,"/",N.invocation.kind==="instructions"?"PROMPT.md":"ACTION.json"]}),e.jsxs("p",{children:["Revision ",l.binding.sourceRevision.slice(0,12)," · Release ",l.binding.harnessRelease.contentHash.slice(0,12)]})]}),N.skillPaths.length>0?e.jsx(T,{title:"Skills",children:e.jsx("p",{children:N.skillPaths.join(", ")})}):null,N.invocation.kind==="instructions"?e.jsx(T,{title:"Instructions",children:e.jsx("pre",{className:"scheduled-prompt",children:N.invocation.instructions})}):null,e.jsx(T,{title:"Start a run",children:e.jsxs("form",{className:"scheduled-profile-workflow-form",onSubmit:f=>{m(f)},children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-prompt",children:"Instructions for this run"}),e.jsx("textarea",{id:"scheduled-profile-workflow-prompt",onChange:f=>a(f.target.value),value:r}),e.jsx("label",{htmlFor:"scheduled-profile-workflow-files",children:"Files for this run"}),e.jsx("input",{id:"scheduled-profile-workflow-files",type:"file",multiple:!0,onChange:f=>k(Array.from(f.target.files??[]))}),c.length>0?e.jsx("small",{children:c.map(f=>f.name).join(", ")}):null,e.jsx("label",{htmlFor:"scheduled-profile-workflow-target",children:"Run in"}),e.jsxs("select",{id:"scheduled-profile-workflow-target",value:b,onChange:f=>R(f.target.value),children:[e.jsx("option",{value:"local",children:"Desktop local workspace"}),e.jsx("option",{value:"hosted",children:"Hosted Work"})]}),N.invocation.kind==="agent_action"?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-input",children:"Input JSON"}),e.jsx("textarea",{id:"scheduled-profile-workflow-input",onChange:f=>h(f.target.value),value:w})]}):null,P?e.jsx("p",{className:"scheduled-detail-error",role:"alert",children:P}):null,e.jsx("div",{className:"scheduled-detail-actions",children:e.jsxs("button",{disabled:$,type:"submit",children:[e.jsx(X,{size:15}),e.jsx("span",{children:$?"Starting…":"Run now"})]})})]})})]})}function os(s){return s.flatMap(t=>t.schedules.map(n=>({definition:t,schedule:n})))}function ds(s,t){return s.filter(n=>t==="active"?n.schedule.enabled:t==="paused"?!n.schedule.enabled:!0).sort((n,l)=>O(n.schedule.nextRunAt)-O(l.schedule.nextRunAt)||n.definition.name.localeCompare(l.definition.name))}function cs(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>O(n.nextRunAt)-O(l.nextRunAt)||n.scheduleName.localeCompare(l.scheduleName))}function us(s,t,n){return[...s.map(l=>({kind:"chat",workflow:l})),...t.map(l=>({kind:"local",schedule:l})),...n.map(l=>({kind:"hosted",row:l}))].sort((l,d)=>{const x=O(ue(l)),p=O(ue(d));if(x!==p)return x-p;const j=he(l),r=he(d);return j.localeCompare(r)})}function hs(s){return s.kind==="chat"?{enabled:s.workflow.enabled,key:V(s.workflow.id),nextRunAt:s.workflow.nextRunAt,title:s.workflow.name}:s.kind==="local"?{enabled:s.schedule.enabled,key:K(s.schedule.id),nextRunAt:s.schedule.nextRunAt,title:s.schedule.scheduleName}:{enabled:s.row.schedule.enabled,key:q(s.row.schedule.id),nextRunAt:s.row.schedule.nextRunAt,title:s.row.definition.name}}function fs(s){const t=s.recurrence;return t?re(t):s.expression??"Manual"}function ue(s){return s.kind==="chat"?s.workflow.nextRunAt:s.kind==="local"?s.schedule.nextRunAt:s.row.schedule.nextRunAt}function he(s){return s.kind==="chat"?s.workflow.name:s.kind==="local"?s.schedule.scheduleName:s.row.definition.name}function ge(s){const t=s.timezone?` · ${s.timezone}`:"";if(s.scheduleType==="rate")return`Every ${s.scheduleExpression}${t}`;const n=s.scheduleExpression.trim().split(/\s+/);if(n.length===5&&/^\d+$/.test(n[0])&&/^\d+$/.test(n[1])){const l=ve(`${n[1].padStart(2,"0")}:${n[0].padStart(2,"0")}`);if(n[2]==="*"&&n[3]==="*"&&n[4]==="*")return`Daily at ${l}${t}`;if(n[2]==="*"&&n[3]==="*"&&n[4]==="MON-FRI")return`Weekdays at ${l}${t}`}return`Cron ${s.scheduleExpression}${t}`}function K(s){return`local:${s}`}function V(s){return`chat:${s}`}function H(s){return`profile:${s}`}function q(s){return`hosted:${s}`}function O(s){if(!s)return Number.MAX_SAFE_INTEGER;const t=new Date(s).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}const ms=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Ws({connection:s,selectedProfileKey:t,onOpenSession:n,detailOpen:l,detailExpanded:d,onDetailOpenChange:x,onDetailResizeStart:p,onToggleDetailExpanded:j}){const r=He(s),a=Ke(s),c=We(s),[k,w]=o.useState(null),[h,b]=o.useState(!1),[R,$]=o.useState(null),[g,P]=o.useState("all"),[C,N]=o.useState(oe);Ee(()=>N(oe()));const[m,f]=o.useState(!1),[u,A]=o.useState(null),y=o.useMemo(()=>os(r.definitions),[r.definitions]),Y=o.useMemo(()=>ds(y,g),[g,y]),z=o.useMemo(()=>cs(c.schedules,g),[g,c.schedules]),G=o.useMemo(()=>ls(a.workflows,g),[a.workflows,g]),S=y.find(i=>q(i.schedule.id)===u)??null,I=c.schedules.find(i=>K(i.id)===u)??null,D=a.workflows.find(i=>V(i.id)===u)??null,L=k?.workflows.find(i=>H(i.workflow.id)===u)??null,v=S?r.runs.filter(i=>i.scheduleId===S.schedule.id):[],J=o.useMemo(()=>us(G,z,Y),[G,z,Y]),Ne=o.useMemo(()=>[...J.map(hs),...k?.workflows.map(i=>({enabled:!0,key:H(i.workflow.id),nextRunAt:null,title:i.workflow.label}))??[]],[J,k]);U(r.error,{prefix:"Workflows"}),U(c.error,{prefix:"Local schedules"}),U(a.error,{prefix:"Chat workflows"}),U(R,{prefix:"Profile workflows"}),o.useEffect(()=>{if(!s||!t){w(null),$(null);return}let i=!0;return b(!0),E.profileWorkflows(s).then(_=>{i&&(w(_),$(null))}).catch(_=>{i&&$(_ instanceof Error?_.message:String(_))}).finally(()=>{i&&b(!1)}),()=>{i=!1}},[s,t]),o.useEffect(()=>{u&&!S&&!I&&!D&&!L&&!h&&A(null)},[h,D,S,I,L,u]),o.useEffect(()=>{!l&&u&&A(null)},[l,u]),o.useEffect(()=>()=>x(!1),[x]);function Z(i){A(i),x(!0)}function F(){A(null),x(!1)}function ie(i){N(i),Ve(i)}async function Se(){f(!0);try{await Promise.all([r.refresh(),c.refresh(),a.refresh(),s&&t?E.profileWorkflows(s).then(w):Promise.resolve()])}finally{f(!1)}}return e.jsxs("section",{"aria-label":"Workflows",className:`scheduled-work-view${S||I||D||L?" detail-open":""}${d?" detail-expanded":""}`,children:[e.jsx("div",{className:"scheduled-work-scroll",children:e.jsxs("div",{className:"scheduled-work-content",children:[e.jsxs("header",{className:"scheduled-work-header",children:[e.jsxs("div",{"aria-label":"Workflow view",className:"scheduled-view-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":C==="calendar",className:C==="calendar"?"active":void 0,onClick:()=>ie("calendar"),role:"tab",type:"button",children:"Calendar"}),e.jsx("button",{"aria-selected":C==="list",className:C==="list"?"active":void 0,onClick:()=>ie("list"),role:"tab",type:"button",children:"List"})]}),e.jsxs("div",{className:"scheduled-work-header-actions",children:[e.jsx("button",{"aria-label":"Refresh schedules",className:"scheduled-icon-button",disabled:!s||r.loading||c.loading||a.loading||h,onClick:()=>{Se()},title:"Refresh schedules",type:"button",children:e.jsx(Ie,{className:m?"scheduled-spin":void 0,size:16})}),e.jsxs("label",{className:"scheduled-filter",children:[e.jsx(Me,{"aria-hidden":"true",size:16}),e.jsxs("select",{"aria-label":"Schedule filter",onChange:i=>P(i.target.value),value:g,children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"paused",children:"Paused"}),e.jsx("option",{value:"all",children:"All"})]})]})]})]}),e.jsx("section",{"aria-busy":r.loading||c.loading||a.loading||h,className:"scheduled-list",children:s?(r.loading||c.loading||a.loading||h)&&y.length===0&&c.schedules.length===0&&a.workflows.length===0&&!k?.workflows.length?e.jsx(ke,{label:"Loading schedules"}):r.error&&c.error&&y.length===0&&c.schedules.length===0?e.jsx(te,{children:"Schedules are unavailable. Refresh to try again."}):J.length===0&&!k?.workflows.length?e.jsx(te,{children:"Create a scheduled task here or ask for one in Work."}):C==="calendar"?e.jsx(Ge,{items:Ne,onSelect:Z,selectedKey:u}):e.jsxs("div",{className:"scheduled-list-rows",children:[k?.workflows.map(i=>e.jsx(es,{entry:i,onSelect:()=>Z(H(i.workflow.id)),selected:u===H(i.workflow.id)},H(i.workflow.id))),J.map(i=>i.kind==="chat"?e.jsx(ns,{cadence:re(i.workflow.recurrence),onSelect:()=>Z(V(i.workflow.id)),selected:u===V(i.workflow.id),workflow:i.workflow},V(i.workflow.id)):i.kind==="local"?e.jsx(ss,{cadence:ge(i.schedule),onSelect:()=>Z(K(i.schedule.id)),schedule:i.schedule,selected:u===K(i.schedule.id)},K(i.schedule.id)):e.jsx(ts,{cadence:fs(i.row.schedule),definition:i.row.definition,onSelect:()=>Z(q(i.row.schedule.id)),schedule:i.row.schedule,selected:u===q(i.row.schedule.id)},q(i.row.schedule.id)))]}):e.jsx(te,{children:"Connect to OpenPond to view scheduled Work."})})]})}),L&&k&&s?e.jsx(is,{catalog:k,connection:s,detailExpanded:d,entry:L,onClose:F,onDetailResizeStart:p,onOpenSession:n,onToggleDetailExpanded:j},L.workflow.id):S?e.jsx(ps,{onClose:F,onDelete:async()=>{await r.remove(S.schedule.id),F()},onRun:()=>r.run(S.schedule.id),onSave:i=>r.update(S.schedule.id,i),onToggle:()=>r.update(S.schedule.id,{enabled:!S.schedule.enabled}),pending:r.pendingScheduleIds.has(S.schedule.id),row:S,runs:v,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j,webBaseUrl:r.webBaseUrl},`${S.schedule.id}:${S.definition.version}:${S.schedule.configurationVersion}`):D?e.jsx(as,{detailExpanded:d,onClose:F,onDelete:async()=>{await a.remove(D.id),F()},onDetailResizeStart:p,onRun:()=>a.run(D.id),onToggle:()=>a.update(D.id,{enabled:!D.enabled}),onToggleDetailExpanded:j,pending:a.pendingIds.has(D.id),runs:a.runs.filter(i=>i.workflowId===D.id),workflow:D},D.id):I?e.jsx(xs,{connection:s,onClose:F,onRun:()=>c.run(I),onToggle:()=>c.toggle(I),pending:c.pendingScheduleIds.has(I.id),schedule:I,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j},I.id):null]})}function xs({connection:s,detailExpanded:t,onClose:n,onDetailResizeStart:l,onRun:d,onToggleDetailExpanded:x,onToggle:p,pending:j,schedule:r}){const a=bs(s,r.id);return U(a.error,{prefix:"Local schedule runs"}),e.jsxs(Q,{detailExpanded:t,label:`${r.scheduleName} details`,onClose:n,onDetailResizeStart:l,onToggleDetailExpanded:x,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:r.enabled?"Active":"Paused"})]}),e.jsx("p",{children:r.scheduleName})]})}),e.jsxs(T,{title:"Task",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(M,{label:"Environment",value:"Local"}),e.jsx(M,{label:"Project",value:r.localProjectName}),e.jsx(M,{label:"Agent",value:r.agentName}),e.jsx(M,{label:"Action",value:r.targetAction})]}),e.jsx("pre",{className:"scheduled-prompt",children:ws(r)})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(M,{label:"Cadence",value:ge(r)}),e.jsx(M,{label:"Expression",value:r.scheduleExpression}),e.jsx(M,{label:"Timezone",value:r.timezone??"Local time"}),e.jsx(M,{label:"Next run",value:W(r.nextRunAt,r.timezone)}),e.jsx(M,{label:"Last run",value:W(r.lastRunAt,r.timezone)})]}),r.lastError?e.jsx("p",{className:"scheduled-detail-error",children:r.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{p()},type:"button",children:[r.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:r.enabled?"Pause":"Resume"})]})]}),e.jsx(T,{title:"Runs",children:a.loading&&a.runs.length===0?e.jsx(ke,{label:"Loading runs"}):a.runs.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:a.runs.map(c=>e.jsx(qe,{run:c},c.id))})})]})}function ps({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onSave:x,onToggleDetailExpanded:p,onToggle:j,pending:r,row:a,runs:c,webBaseUrl:k}){const w=js(a.schedule),[h,b]=o.useState(a.definition.name),[R,$]=o.useState(a.definition.prompt),[g,P]=o.useState(w.kind),[C,N]=o.useState(w.timeZone),[m,f]=o.useState(w.startDate),[u,A]=o.useState(w.localTime),[y,Y]=o.useState(w.weekdays?.[0]??"monday"),[z,G]=o.useState(w.dayOfMonth??1),S=c[0]?.conversationId??null,I=k?fe(k,S):null,D=h!==a.definition.name||R!==a.definition.prompt||g!==w.kind||C!==w.timeZone||m!==w.startDate||u!==w.localTime||y!==(w.weekdays?.[0]??"monday")||z!==(w.dayOfMonth??1);async function L(v){v.preventDefault(),await x({name:h,prompt:R,recurrence:{version:1,kind:g,timeZone:C,startDate:m,localTime:u,end:{kind:"never"},...g==="weekly"?{weekdays:[y]}:{},...g==="monthly"?{dayOfMonth:z}:{}}})}return e.jsx(Q,{detailExpanded:s,label:`${a.definition.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:e.jsxs("form",{onSubmit:L,children:[e.jsxs("div",{className:"scheduled-detail-header",children:[e.jsx("div",{children:e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:a.schedule.enabled?"Active":"Paused"})]})}),e.jsx("div",{className:"scheduled-detail-header-controls",children:e.jsx("button",{"aria-label":"Delete schedule",className:"scheduled-icon-button",disabled:r,onClick:()=>{n()},title:"Delete schedule",type:"button",children:e.jsx(pe,{size:16})})})]}),e.jsxs(T,{title:"Task",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Name"}),e.jsx("input",{maxLength:180,onChange:v=>b(v.target.value),required:!0,value:h})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Prompt"}),e.jsx("textarea",{onChange:v=>$(v.target.value),required:!0,value:R})]})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("div",{className:"scheduled-field-grid",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Repeat"}),e.jsxs("select",{onChange:v=>P(v.target.value),value:g,children:[e.jsx("option",{value:"once",children:"Once"}),e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekdays",children:"Weekdays"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]}),g==="weekly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day"}),e.jsx("select",{onChange:v=>Y(v.target.value),value:y,children:ms.map(v=>e.jsx("option",{value:v,children:B(v)},v))})]}):g==="monthly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day of month"}),e.jsx("input",{max:31,min:1,onChange:v=>G(Number(v.target.value)),type:"number",value:z})]}):null,e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Start date"}),e.jsx("input",{onChange:v=>f(v.target.value),required:!0,type:"date",value:m})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Time"}),e.jsx("input",{onChange:v=>A(v.target.value),required:!0,type:"time",value:u})]}),e.jsxs("label",{className:"scheduled-field scheduled-field-wide",children:[e.jsx("span",{children:"Timezone"}),e.jsx("input",{onChange:v=>N(v.target.value),required:!0,value:C})]})]}),e.jsxs("p",{className:"scheduled-next-run",children:["Next run: ",W(a.schedule.nextRunAt,w.timeZone)]})]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[D?e.jsxs("button",{disabled:r,type:"submit",children:[e.jsx(Le,{size:15}),e.jsx("span",{children:"Save"})]}):null,e.jsxs("button",{disabled:r,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:r,onClick:()=>{j()},type:"button",children:[a.schedule.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.schedule.enabled?"Pause":"Resume"})]})]}),e.jsxs("button",{className:"scheduled-open-chat",disabled:r||!I,onClick:()=>{I&&me(I,S)},type:"button",children:[e.jsx("span",{children:"Open hosted chat"}),e.jsx(xe,{size:14})]}),e.jsx(T,{title:"Runs",children:c.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:c.map(v=>e.jsx(Be,{onOpen:()=>{k&&me(fe(k,v.conversationId),v.conversationId)},run:v},v.id))})})]})})}function js(s){return s.recurrence??{version:1,kind:"daily",timeZone:s.timeZone||ks(),startDate:vs(),localTime:"08:00",end:{kind:"never"}}}function ws(s){const t=s.input.prompt;return typeof t=="string"&&t.trim()?t.trim():Object.keys(s.input).length>0?JSON.stringify(s.input,null,2):"No task input configured."}function bs(s,t){const[n,l]=o.useState([]),[d,x]=o.useState(!1),[p,j]=o.useState(null);return o.useEffect(()=>{if(!s){l([]),x(!1),j(null);return}let r=!1;return x(!0),E.localAgentScheduleRuns(s,t,{limit:20}).then(a=>{r||(l(a.runs),j(null))}).catch(a=>{r||j(ys(a))}).finally(()=>{r||x(!1)}),()=>{r=!0}},[s,t]),{error:p,loading:d,runs:n}}function fe(s,t){const n=new URL(s);return n.pathname=t?`/sandboxes/work/${encodeURIComponent(t)}`:"/sandboxes/work",n.search="",n.hash="",n.toString()}async function me(s,t){const n=window.openpond?.browser;n?.openExternal&&(await n.openExternal({conversationId:t??"hosted-scheduled-work",url:s})).ok||window.open(s,"_blank","noopener,noreferrer")}function vs(){return new Date().toISOString().slice(0,10)}function ks(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function ys(s){return s instanceof Error?s.message:String(s)}export{Ws as ScheduledWorkPage,W as formatScheduledRunAt,fe as hostedConversationUrl};
|
|
1
|
+
import{r as o,j as e}from"./index-C8aCGagb.js";import{V as E,W as Re,bz as Ce,fh as Ae,bY as Te,X as $e,aO as xe,w as De,bs as X,a4 as ee,U as Ee,bd as U,aA as We,aH as Ie}from"./App-s-CJswyt.js";import{u as Me}from"./useLocalAgentSchedules-BNqAisfS.js";import{a as Pe,P as le,T as pe}from"./MarkdownText-BR4V6lNO.js";import{P as ae}from"./play-C469pVZq.js";import{S as ze}from"./save-CtSjPydi.js";import{M as Le}from"./minimize-2-CqcI4zcM.js";import{r as Fe,c as Oe,b as Ze}from"./MainPane-5DTtwVCk.js";import"./cloud-upload-k9eqBsHr.js";import"./arrow-up-right-C9aE8Mfz.js";import"./square-BuImvLhT.js";import"./folder-open-sYgceW_f.js";const _e=3e4;function He(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(null),[j,r]=o.useState(!1),[a,c]=o.useState(null),[k,w]=o.useState(()=>new Set);async function h(m,f){f&&r(!0);try{const u=await E.hostedSavedWork(m);n(u.definitions),d(u.runs),p(u.webBaseUrl??null),c(null)}catch(u){c(se(u))}finally{f&&r(!1)}}o.useEffect(()=>{if(!s){n([]),d([]),p(null),c(null),r(!1);return}let m=!1;const f=async A=>{if(!m){A&&r(!0);try{const y=await E.hostedSavedWork(s);if(m)return;n(y.definitions),d(y.runs),p(y.webBaseUrl??null),c(null)}catch(y){m||c(se(y))}finally{!m&&A&&r(!1)}}};f(!0);const u=window.setInterval(()=>{f(!1)},_e);return()=>{m=!0,window.clearInterval(u)}},[s]);async function b(){s&&await h(s,!0)}async function R(m){s&&(await E.createHostedSavedWork(s,m),await h(s,!1))}async function $(m,f){await C(m,async u=>{await E.updateHostedSavedWork(u,m,f)})}async function g(m){await C(m,async f=>{await E.deleteHostedSavedWork(f,m)})}async function P(m){await C(m,async f=>{await E.runHostedSavedWork(f,m,crypto.randomUUID())})}async function C(m,f){if(!(!s||k.has(m))){N(m,!0);try{await f(s),await h(s,!1)}catch(u){throw c(se(u)),u}finally{N(m,!1)}}}function N(m,f){w(u=>{const A=new Set(u);return f?A.add(m):A.delete(m),A})}return{create:R,definitions:t,error:a,loading:j,pendingScheduleIds:k,refresh:b,remove:g,run:P,runs:l,update:$,webBaseUrl:x}}function se(s){return s instanceof Error?s.message:String(s)}const Ue=3e4;function Ke(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(!1),[j,r]=o.useState(null),[a,c]=o.useState(()=>new Set),k=o.useCallback(async h=>{if(s){h&&p(!0);try{const b=await E.chatWorkflows(s);n(b.workflows),d(b.runs),r(null)}catch(b){r(b instanceof Error?b.message:String(b))}finally{h&&p(!1)}}},[s]);o.useEffect(()=>{if(!s){n([]),d([]),r(null),p(!1);return}k(!0);const h=window.setInterval(()=>{k(!1)},Ue);return()=>window.clearInterval(h)},[s,k]);async function w(h,b){if(!a.has(h)){c(R=>new Set(R).add(h));try{await b(),await k(!1)}catch(R){throw r(R instanceof Error?R.message:String(R)),R}finally{c(R=>{const $=new Set(R);return $.delete(h),$})}}}return{workflows:t,runs:l,loading:x,error:j,pendingIds:a,refresh:()=>k(!0),update:(h,b)=>w(h,()=>E.updateChatWorkflow(s,h,b)),remove:h=>w(h,()=>E.deleteChatWorkflow(s,h)),run:h=>w(h,()=>E.runChatWorkflow(s,h))}}const je="openpond.scheduled-work.view.v1";function oe(s=we()){try{return s?.getItem(je)==="list"?"list":"calendar"}catch{return"calendar"}}function Ve(s,t=we()){try{t?.setItem(je,s)}catch{}}function we(){if(typeof window>"u")return null;try{return Re}catch{return null}}function M(s,t){if(!s)return"None";const n=new Date(s);if(!Number.isFinite(n.getTime()))return"None";try{return n.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",...t?{timeZone:t,timeZoneName:"short"}:{}})}catch{return n.toLocaleString()}}function be(s){return B(s.replaceAll("_"," "))}function B(s){return s.replace(/^./,t=>t.toUpperCase())}function ve(s){const[t="0",n="00"]=s.split(":");return new Date(2020,0,1,Number(t),Number(n)).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ye({run:s}){const t=s.error||s.stderr||s.stdout;return e.jsxs("details",{className:"scheduled-run-row",children:[e.jsxs("summary",{children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(s.status)}),e.jsx("small",{children:M(s.createdAt,null)})]}),e.jsx("span",{className:"scheduled-run-trigger",children:s.trigger==="manual"?"Manual":"Scheduled"})]}),t?e.jsx("pre",{children:t}):null]})}function Be({onOpen:s,run:t}){return e.jsxs("button",{className:"scheduled-run-row hosted",onClick:s,type:"button",children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(t.status)}),e.jsx("small",{children:M(t.createdAt,null)})]}),e.jsxs("span",{className:"scheduled-run-trigger",children:[B(t.triggerKind)," ",e.jsx(xe,{size:11})]}),t.deliveryError?e.jsx("p",{children:t.deliveryError}):null]})}function Q({children:s,detailExpanded:t,kind:n="schedule",label:l,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:p}){return e.jsxs("aside",{"aria-label":l,className:`workspace-diff-panel scheduled-detail${t?" expanded":""}`,children:[t?null:e.jsx("div",{"aria-label":"Resize schedule details","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:x,role:"separator"}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":`${n==="workflow"?"Workflow":"Schedule"} details`,children:e.jsxs("button",{"aria-selected":"true",className:"workspace-diff-tab active",role:"tab",type:"button",children:[e.jsx(Ae,{size:14}),e.jsx("span",{children:n==="workflow"?"Workflow":"Schedule"})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{"aria-label":t?`Dock ${n} details`:`Expand ${n} details`,className:"diff-icon-button",onClick:p,title:t?`Dock ${n} details`:`Expand ${n} details`,type:"button",children:t?e.jsx(Le,{size:14}):e.jsx(Te,{size:14})}),e.jsx("button",{"aria-label":`Close ${n} details`,className:"diff-icon-button",onClick:d,title:`Close ${n} details`,type:"button",children:e.jsx($e,{size:14})})]})]}),e.jsx("div",{className:"scheduled-detail-body",children:s})]})}function T({children:s,title:t}){return e.jsxs("section",{className:"scheduled-detail-section",children:[e.jsx("div",{className:"scheduled-detail-section-heading",children:e.jsx("h3",{children:t})}),s]})}function I({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:t})]})}function te({children:s}){return e.jsx("p",{className:"scheduled-empty",children:s})}function ke({label:s}){return e.jsxs("div",{className:"scheduled-loading",role:"status",children:[e.jsx(Ce,{className:"scheduled-spin",size:16}),e.jsx("span",{children:s})]})}const qe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ge({items:s,onSelect:t,selectedKey:n}){const[l,d]=o.useState(()=>de(new Date)),x=o.useMemo(()=>Je(l),[l]),p=o.useMemo(()=>Xe(s),[s]),j=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(l),r=s.filter(a=>!ye(a.nextRunAt));return e.jsxs("div",{className:"scheduled-calendar",children:[e.jsxs("div",{className:"scheduled-calendar-toolbar",children:[e.jsx("strong",{children:j}),e.jsxs("div",{children:[e.jsx("button",{"aria-label":"Previous month",className:"scheduled-icon-button",onClick:()=>d(ce(l,-1)),type:"button",children:e.jsx(De,{size:15})}),e.jsx("button",{className:"scheduled-calendar-today",onClick:()=>d(de(new Date)),type:"button",children:"Today"}),e.jsx("button",{"aria-label":"Next month",className:"scheduled-icon-button",onClick:()=>d(ce(l,1)),type:"button",children:e.jsx(Pe,{size:15})})]})]}),e.jsxs("div",{className:"scheduled-calendar-grid",role:"grid","aria-label":j,children:[qe.map(a=>e.jsx("div",{className:"scheduled-calendar-weekday",role:"columnheader",children:a},a)),x.map(a=>{const c=ne(a),k=p.get(c)??[],w=a.getMonth()!==l.getMonth(),h=c===ne(new Date);return e.jsxs("div",{className:`scheduled-calendar-day${w?" outside":""}${h?" today":""}`,role:"gridcell",children:[e.jsx("span",{className:"scheduled-calendar-day-number",children:a.getDate()}),e.jsx("div",{className:"scheduled-calendar-events",children:k.map(b=>e.jsxs("button",{"aria-current":n===b.key?"true":void 0,className:`scheduled-calendar-event${b.enabled?"":" paused"}`,onClick:()=>t(b.key),title:b.title,type:"button",children:[e.jsx("span",{children:Qe(b.nextRunAt)}),e.jsx("strong",{children:b.title})]},b.key))})]},c)})]}),r.length?e.jsxs("div",{className:"scheduled-calendar-unscheduled",children:[e.jsx("span",{children:"No upcoming run"}),e.jsx("div",{children:r.map(a=>e.jsx("button",{onClick:()=>t(a.key),type:"button",children:a.title},a.key))})]}):null]})}function Je(s){const t=new Date(s.getFullYear(),s.getMonth(),1),n=new Date(t);return n.setDate(t.getDate()-t.getDay()),Array.from({length:42},(l,d)=>{const x=new Date(n);return x.setDate(n.getDate()+d),x})}function Xe(s){const t=new Map;for(const n of s){const l=ye(n.nextRunAt);if(!l)continue;const d=ne(l);t.set(d,[...t.get(d)??[],n])}for(const n of t.values())n.sort((l,d)=>l.nextRunAt.localeCompare(d.nextRunAt));return t}function ye(s){if(!s)return null;const t=new Date(s);return Number.isNaN(t.getTime())?null:t}function ne(s){return`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`}function de(s){return new Date(s.getFullYear(),s.getMonth(),1)}function ce(s,t){return new Date(s.getFullYear(),s.getMonth()+t,1)}function Qe(s){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(new Date(s))}function es({entry:s,onSelect:t,selected:n}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:"scheduled-status-dot"}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:s.workflow.label})}),e.jsx("span",{children:s.workflow.description}),e.jsxs("small",{children:["On demand · Source ",s.binding.sourceRevision.slice(0,10)]})]})]})}function ss({cadence:s,onSelect:t,schedule:n,selected:l}){return e.jsxs("button",{"aria-current":l?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${n.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:n.scheduleName})}),e.jsx("span",{children:n.localProjectName}),e.jsxs("small",{children:[s,n.nextRunAt?` · Next ${M(n.nextRunAt,n.timezone)}`:" · No next run"]})]})]})}function ts({cadence:s,definition:t,onSelect:n,schedule:l,selected:d}){return e.jsxs("button",{"aria-current":d?"true":void 0,className:"scheduled-list-row",onClick:n,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:t.name}),e.jsx("small",{className:"scheduled-environment-badge hosted",children:"Hosted"})]}),e.jsx("span",{children:t.prompt}),e.jsxs("small",{children:[s,l.nextRunAt?` · Next ${M(l.nextRunAt,l.timeZone)}`:" · No next run"]})]})]})}function ns({cadence:s,onSelect:t,selected:n,workflow:l}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:l.name}),e.jsx("small",{className:"scheduled-environment-badge",children:"Chat"})]}),e.jsx("span",{children:l.prompt}),e.jsxs("small",{children:["Runs in ",l.sessionTitle," · ",s,l.nextRunAt?` · Next ${M(l.nextRunAt,l.recurrence.timeZone)}`:" · No next run"]})]})]})}function ls(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>{const d=n.nextRunAt?new Date(n.nextRunAt).getTime():Number.POSITIVE_INFINITY,x=l.nextRunAt?new Date(l.nextRunAt).getTime():Number.POSITIVE_INFINITY;return d-x||n.name.localeCompare(l.name)})}function re(s){const t=ve(s.localTime);return s.kind==="once"?`Once on ${s.startDate} at ${t} · ${s.timeZone}`:s.kind==="weekdays"?`Weekdays at ${t} · ${s.timeZone}`:s.kind==="weekly"?`${s.weekdays?.map(B).join(", ")??"Weekly"} at ${t} · ${s.timeZone}`:s.kind==="monthly"?`Monthly on day ${s.dayOfMonth??1} at ${t} · ${s.timeZone}`:`Daily at ${t} · ${s.timeZone}`}function as({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onToggle:x,onToggleDetailExpanded:p,pending:j,runs:r,workflow:a}){return e.jsxs(Q,{detailExpanded:s,label:`${a.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Workflow details"}),e.jsx("span",{children:a.enabled?"Active":"Paused"})]}),e.jsx("p",{children:a.name})]})}),e.jsx(T,{title:"Prompt",children:e.jsx("pre",{className:"scheduled-prompt",children:a.prompt})}),e.jsx(T,{title:"Profile source",children:a.profileRef&&a.profileWorkflowId?e.jsxs("p",{children:[a.profileRef.profileId," · workflows/",a.profileWorkflowId,"/PROMPT.md"]}):e.jsx("p",{className:"scheduled-detail-error",children:a.profileMigrationError??"Profile package is unresolved."})}),e.jsxs(T,{title:"Delivery",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Runs in",value:a.sessionTitle}),e.jsx(I,{label:"Cadence",value:re(a.recurrence)}),e.jsx(I,{label:"Next run",value:M(a.nextRunAt,a.recurrence.timeZone)}),e.jsx(I,{label:"Last run",value:M(a.lastRunAt,a.recurrence.timeZone)})]}),a.lastError?e.jsx("p",{className:"scheduled-detail-error",children:a.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{x()},type:"button",children:[a.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.enabled?"Pause":"Resume"})]}),e.jsxs("button",{disabled:j,onClick:()=>{n()},type:"button",children:[e.jsx(pe,{size:15}),e.jsx("span",{children:"Delete"})]})]}),e.jsx(T,{title:"Runs",children:r.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:r.map(c=>e.jsxs("div",{className:"scheduled-run-row",children:[e.jsx("span",{children:B(c.status)}),e.jsx("small",{children:M(c.createdAt,a.recurrence.timeZone)}),c.error?e.jsx("p",{children:c.error}):null]},c.id))})})]})}async function rs(s){const t=s.catalog.workflows.find(d=>d.workflow.id===s.workflowId);if(!t)throw new Error("Selected Profile workflow is unavailable.");const n=s.client??E,l=await n.createSession(s.connection,{experience:"work",provider:"openpond",...s.workspaceTarget==="local"?{metadata:{workspaceTarget:"local"}}:{},currentProfile:s.catalog.profileRef,profileWorkflowBinding:t.binding,title:t.workflow.label});return s.onSessionCreated?.(l.id),await n.sendTurn(s.connection,l.id,{prompt:s.prompt?.trim()||t.workflow.label,workflowInput:s.value,...s.attachments?.length?{attachments:s.attachments}:{},approvalPolicy:"on-request",sandbox:"workspace-write",codexPermissionMode:"default"}),l.id}function is({catalog:s,connection:t,detailExpanded:n,entry:l,onClose:d,onDetailResizeStart:x,onOpenSession:p,onToggleDetailExpanded:j}){const[r,a]=o.useState(""),[c,k]=o.useState([]),[w,h]=o.useState("{}"),[b,R]=o.useState(s.profileRef.source==="local"?"local":"hosted"),[$,g]=o.useState(!1),[P,C]=o.useState(null),N=l.workflow;async function m(f){if(f.preventDefault(),!$){g(!0),C(null);try{const u=JSON.parse(w);if(c.length>ee.maxAttachments)throw new Error(`Choose at most ${ee.maxAttachments} files.`);const A=await Promise.all(c.map(async y=>{if(y.size>ee.maxAttachmentBytes)throw new Error(`${y.name} exceeds the attachment size limit.`);return Fe({id:Ze(),file:y,name:y.name,mediaType:y.type||"application/octet-stream",sizeBytes:y.size,kind:Oe(y)})}));await rs({connection:t,catalog:s,workflowId:N.id,value:u,prompt:r,attachments:A,workspaceTarget:b,onSessionCreated:p})}catch(u){C(u instanceof Error?u.message:String(u))}finally{g(!1)}}}return e.jsxs(Q,{detailExpanded:n,kind:"workflow",label:`${N.label} details`,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:j,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsx("div",{className:"scheduled-detail-title-row",children:e.jsx("h2",{children:"Workflow details"})}),e.jsx("p",{children:N.label})]})}),e.jsx(T,{title:"Description",children:e.jsx("p",{children:N.description})}),e.jsxs(T,{title:"Source",children:[e.jsxs("p",{children:["workflows/",N.id,"/",N.invocation.kind==="instructions"?"PROMPT.md":"ACTION.json"]}),e.jsxs("p",{children:["Revision ",l.binding.sourceRevision.slice(0,12)," · Release ",l.binding.harnessRelease.contentHash.slice(0,12)]})]}),N.skillPaths.length>0?e.jsx(T,{title:"Skills",children:e.jsx("p",{children:N.skillPaths.join(", ")})}):null,N.invocation.kind==="instructions"?e.jsx(T,{title:"Instructions",children:e.jsx("pre",{className:"scheduled-prompt",children:N.invocation.instructions})}):null,e.jsx(T,{title:"Start a run",children:e.jsxs("form",{className:"scheduled-profile-workflow-form",onSubmit:f=>{m(f)},children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-prompt",children:"Instructions for this run"}),e.jsx("textarea",{id:"scheduled-profile-workflow-prompt",onChange:f=>a(f.target.value),value:r}),e.jsx("label",{htmlFor:"scheduled-profile-workflow-files",children:"Files for this run"}),e.jsx("input",{id:"scheduled-profile-workflow-files",type:"file",multiple:!0,onChange:f=>k(Array.from(f.target.files??[]))}),c.length>0?e.jsx("small",{children:c.map(f=>f.name).join(", ")}):null,e.jsx("label",{htmlFor:"scheduled-profile-workflow-target",children:"Run in"}),e.jsxs("select",{id:"scheduled-profile-workflow-target",value:b,onChange:f=>R(f.target.value),children:[e.jsx("option",{value:"local",children:"Desktop local workspace"}),e.jsx("option",{value:"hosted",children:"Hosted Work"})]}),N.invocation.kind==="agent_action"?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-input",children:"Input JSON"}),e.jsx("textarea",{id:"scheduled-profile-workflow-input",onChange:f=>h(f.target.value),value:w})]}):null,P?e.jsx("p",{className:"scheduled-detail-error",role:"alert",children:P}):null,e.jsx("div",{className:"scheduled-detail-actions",children:e.jsxs("button",{disabled:$,type:"submit",children:[e.jsx(X,{size:15}),e.jsx("span",{children:$?"Starting…":"Run now"})]})})]})})]})}function os(s){return s.flatMap(t=>t.schedules.map(n=>({definition:t,schedule:n})))}function ds(s,t){return s.filter(n=>t==="active"?n.schedule.enabled:t==="paused"?!n.schedule.enabled:!0).sort((n,l)=>O(n.schedule.nextRunAt)-O(l.schedule.nextRunAt)||n.definition.name.localeCompare(l.definition.name))}function cs(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>O(n.nextRunAt)-O(l.nextRunAt)||n.scheduleName.localeCompare(l.scheduleName))}function us(s,t,n){return[...s.map(l=>({kind:"chat",workflow:l})),...t.map(l=>({kind:"local",schedule:l})),...n.map(l=>({kind:"hosted",row:l}))].sort((l,d)=>{const x=O(ue(l)),p=O(ue(d));if(x!==p)return x-p;const j=he(l),r=he(d);return j.localeCompare(r)})}function hs(s){return s.kind==="chat"?{enabled:s.workflow.enabled,key:V(s.workflow.id),nextRunAt:s.workflow.nextRunAt,title:s.workflow.name}:s.kind==="local"?{enabled:s.schedule.enabled,key:K(s.schedule.id),nextRunAt:s.schedule.nextRunAt,title:s.schedule.scheduleName}:{enabled:s.row.schedule.enabled,key:Y(s.row.schedule.id),nextRunAt:s.row.schedule.nextRunAt,title:s.row.definition.name}}function fs(s){const t=s.recurrence;return t?re(t):s.expression??"Manual"}function ue(s){return s.kind==="chat"?s.workflow.nextRunAt:s.kind==="local"?s.schedule.nextRunAt:s.row.schedule.nextRunAt}function he(s){return s.kind==="chat"?s.workflow.name:s.kind==="local"?s.schedule.scheduleName:s.row.definition.name}function ge(s){const t=s.timezone?` · ${s.timezone}`:"";if(s.scheduleType==="rate")return`Every ${s.scheduleExpression}${t}`;const n=s.scheduleExpression.trim().split(/\s+/);if(n.length===5&&/^\d+$/.test(n[0])&&/^\d+$/.test(n[1])){const l=ve(`${n[1].padStart(2,"0")}:${n[0].padStart(2,"0")}`);if(n[2]==="*"&&n[3]==="*"&&n[4]==="*")return`Daily at ${l}${t}`;if(n[2]==="*"&&n[3]==="*"&&n[4]==="MON-FRI")return`Weekdays at ${l}${t}`}return`Cron ${s.scheduleExpression}${t}`}function K(s){return`local:${s}`}function V(s){return`chat:${s}`}function H(s){return`profile:${s}`}function Y(s){return`hosted:${s}`}function O(s){if(!s)return Number.MAX_SAFE_INTEGER;const t=new Date(s).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}const ms=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Ms({connection:s,selectedProfileKey:t,onOpenSession:n,detailOpen:l,detailExpanded:d,onDetailOpenChange:x,onDetailResizeStart:p,onToggleDetailExpanded:j}){const r=He(s),a=Ke(s),c=Me(s),[k,w]=o.useState(null),[h,b]=o.useState(!1),[R,$]=o.useState(null),[g,P]=o.useState("all"),[C,N]=o.useState(oe);Ee(()=>N(oe()));const[m,f]=o.useState(!1),[u,A]=o.useState(null),y=o.useMemo(()=>os(r.definitions),[r.definitions]),q=o.useMemo(()=>ds(y,g),[g,y]),L=o.useMemo(()=>cs(c.schedules,g),[g,c.schedules]),G=o.useMemo(()=>ls(a.workflows,g),[a.workflows,g]),S=y.find(i=>Y(i.schedule.id)===u)??null,W=c.schedules.find(i=>K(i.id)===u)??null,D=a.workflows.find(i=>V(i.id)===u)??null,z=k?.workflows.find(i=>H(i.workflow.id)===u)??null,v=S?r.runs.filter(i=>i.scheduleId===S.schedule.id):[],J=o.useMemo(()=>us(G,L,q),[G,L,q]),Ne=o.useMemo(()=>[...J.map(hs),...k?.workflows.map(i=>({enabled:!0,key:H(i.workflow.id),nextRunAt:null,title:i.workflow.label}))??[]],[J,k]);U(r.error,{prefix:"Workflows"}),U(c.error,{prefix:"Local schedules"}),U(a.error,{prefix:"Chat workflows"}),U(R,{prefix:"Profile workflows"}),o.useEffect(()=>{if(!s||!t){w(null),$(null);return}let i=!0;return b(!0),E.profileWorkflows(s).then(_=>{i&&(w(_),$(null))}).catch(_=>{i&&$(_ instanceof Error?_.message:String(_))}).finally(()=>{i&&b(!1)}),()=>{i=!1}},[s,t]),o.useEffect(()=>{u&&!S&&!W&&!D&&!z&&!h&&A(null)},[h,D,S,W,z,u]),o.useEffect(()=>{!l&&u&&A(null)},[l,u]),o.useEffect(()=>()=>x(!1),[x]);function Z(i){A(i),x(!0)}function F(){A(null),x(!1)}function ie(i){N(i),Ve(i)}async function Se(){f(!0);try{await Promise.all([r.refresh(),c.refresh(),a.refresh(),s&&t?E.profileWorkflows(s).then(w):Promise.resolve()])}finally{f(!1)}}return e.jsxs("section",{"aria-label":"Workflows",className:`scheduled-work-view${S||W||D||z?" detail-open":""}${d?" detail-expanded":""}`,children:[e.jsx("div",{className:"scheduled-work-scroll",children:e.jsxs("div",{className:"scheduled-work-content",children:[e.jsxs("header",{className:"scheduled-work-header",children:[e.jsxs("div",{"aria-label":"Workflow view",className:"scheduled-view-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":C==="calendar",className:C==="calendar"?"active":void 0,onClick:()=>ie("calendar"),role:"tab",type:"button",children:"Calendar"}),e.jsx("button",{"aria-selected":C==="list",className:C==="list"?"active":void 0,onClick:()=>ie("list"),role:"tab",type:"button",children:"List"})]}),e.jsxs("div",{className:"scheduled-work-header-actions",children:[e.jsx("button",{"aria-label":"Refresh schedules",className:"scheduled-icon-button",disabled:!s||r.loading||c.loading||a.loading||h,onClick:()=>{Se()},title:"Refresh schedules",type:"button",children:e.jsx(We,{className:m?"scheduled-spin":void 0,size:16})}),e.jsxs("label",{className:"scheduled-filter",children:[e.jsx(Ie,{"aria-hidden":"true",size:16}),e.jsxs("select",{"aria-label":"Schedule filter",onChange:i=>P(i.target.value),value:g,children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"paused",children:"Paused"}),e.jsx("option",{value:"all",children:"All"})]})]})]})]}),e.jsx("section",{"aria-busy":r.loading||c.loading||a.loading||h,className:"scheduled-list",children:s?(r.loading||c.loading||a.loading||h)&&y.length===0&&c.schedules.length===0&&a.workflows.length===0&&!k?.workflows.length?e.jsx(ke,{label:"Loading schedules"}):r.error&&c.error&&y.length===0&&c.schedules.length===0?e.jsx(te,{children:"Schedules are unavailable. Refresh to try again."}):J.length===0&&!k?.workflows.length?e.jsx(te,{children:"Create a scheduled task here or ask for one in Work."}):C==="calendar"?e.jsx(Ge,{items:Ne,onSelect:Z,selectedKey:u}):e.jsxs("div",{className:"scheduled-list-rows",children:[k?.workflows.map(i=>e.jsx(es,{entry:i,onSelect:()=>Z(H(i.workflow.id)),selected:u===H(i.workflow.id)},H(i.workflow.id))),J.map(i=>i.kind==="chat"?e.jsx(ns,{cadence:re(i.workflow.recurrence),onSelect:()=>Z(V(i.workflow.id)),selected:u===V(i.workflow.id),workflow:i.workflow},V(i.workflow.id)):i.kind==="local"?e.jsx(ss,{cadence:ge(i.schedule),onSelect:()=>Z(K(i.schedule.id)),schedule:i.schedule,selected:u===K(i.schedule.id)},K(i.schedule.id)):e.jsx(ts,{cadence:fs(i.row.schedule),definition:i.row.definition,onSelect:()=>Z(Y(i.row.schedule.id)),schedule:i.row.schedule,selected:u===Y(i.row.schedule.id)},Y(i.row.schedule.id)))]}):e.jsx(te,{children:"Connect to OpenPond to view scheduled Work."})})]})}),z&&k&&s?e.jsx(is,{catalog:k,connection:s,detailExpanded:d,entry:z,onClose:F,onDetailResizeStart:p,onOpenSession:n,onToggleDetailExpanded:j},z.workflow.id):S?e.jsx(ps,{onClose:F,onDelete:async()=>{await r.remove(S.schedule.id),F()},onRun:()=>r.run(S.schedule.id),onSave:i=>r.update(S.schedule.id,i),onToggle:()=>r.update(S.schedule.id,{enabled:!S.schedule.enabled}),pending:r.pendingScheduleIds.has(S.schedule.id),row:S,runs:v,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j,webBaseUrl:r.webBaseUrl},`${S.schedule.id}:${S.definition.version}:${S.schedule.configurationVersion}`):D?e.jsx(as,{detailExpanded:d,onClose:F,onDelete:async()=>{await a.remove(D.id),F()},onDetailResizeStart:p,onRun:()=>a.run(D.id),onToggle:()=>a.update(D.id,{enabled:!D.enabled}),onToggleDetailExpanded:j,pending:a.pendingIds.has(D.id),runs:a.runs.filter(i=>i.workflowId===D.id),workflow:D},D.id):W?e.jsx(xs,{connection:s,onClose:F,onRun:()=>c.run(W),onToggle:()=>c.toggle(W),pending:c.pendingScheduleIds.has(W.id),schedule:W,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j},W.id):null]})}function xs({connection:s,detailExpanded:t,onClose:n,onDetailResizeStart:l,onRun:d,onToggleDetailExpanded:x,onToggle:p,pending:j,schedule:r}){const a=bs(s,r.id);return U(a.error,{prefix:"Local schedule runs"}),e.jsxs(Q,{detailExpanded:t,label:`${r.scheduleName} details`,onClose:n,onDetailResizeStart:l,onToggleDetailExpanded:x,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:r.enabled?"Active":"Paused"})]}),e.jsx("p",{children:r.scheduleName})]})}),e.jsxs(T,{title:"Task",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Environment",value:"Local"}),e.jsx(I,{label:"Project",value:r.localProjectName}),e.jsx(I,{label:"Agent",value:r.agentName}),e.jsx(I,{label:"Action",value:r.targetAction})]}),e.jsx("pre",{className:"scheduled-prompt",children:ws(r)})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Cadence",value:ge(r)}),e.jsx(I,{label:"Expression",value:r.scheduleExpression}),e.jsx(I,{label:"Timezone",value:r.timezone??"Local time"}),e.jsx(I,{label:"Next run",value:M(r.nextRunAt,r.timezone)}),e.jsx(I,{label:"Last run",value:M(r.lastRunAt,r.timezone)})]}),r.lastError?e.jsx("p",{className:"scheduled-detail-error",children:r.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{p()},type:"button",children:[r.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:r.enabled?"Pause":"Resume"})]})]}),e.jsx(T,{title:"Runs",children:a.loading&&a.runs.length===0?e.jsx(ke,{label:"Loading runs"}):a.runs.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:a.runs.map(c=>e.jsx(Ye,{run:c},c.id))})})]})}function ps({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onSave:x,onToggleDetailExpanded:p,onToggle:j,pending:r,row:a,runs:c,webBaseUrl:k}){const w=js(a.schedule),[h,b]=o.useState(a.definition.name),[R,$]=o.useState(a.definition.prompt),[g,P]=o.useState(w.kind),[C,N]=o.useState(w.timeZone),[m,f]=o.useState(w.startDate),[u,A]=o.useState(w.localTime),[y,q]=o.useState(w.weekdays?.[0]??"monday"),[L,G]=o.useState(w.dayOfMonth??1),S=c[0]?.conversationId??null,W=k?fe(k,S):null,D=h!==a.definition.name||R!==a.definition.prompt||g!==w.kind||C!==w.timeZone||m!==w.startDate||u!==w.localTime||y!==(w.weekdays?.[0]??"monday")||L!==(w.dayOfMonth??1);async function z(v){v.preventDefault(),await x({name:h,prompt:R,recurrence:{version:1,kind:g,timeZone:C,startDate:m,localTime:u,end:{kind:"never"},...g==="weekly"?{weekdays:[y]}:{},...g==="monthly"?{dayOfMonth:L}:{}}})}return e.jsx(Q,{detailExpanded:s,label:`${a.definition.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:e.jsxs("form",{onSubmit:z,children:[e.jsxs("div",{className:"scheduled-detail-header",children:[e.jsx("div",{children:e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:a.schedule.enabled?"Active":"Paused"})]})}),e.jsx("div",{className:"scheduled-detail-header-controls",children:e.jsx("button",{"aria-label":"Delete schedule",className:"scheduled-icon-button",disabled:r,onClick:()=>{n()},title:"Delete schedule",type:"button",children:e.jsx(pe,{size:16})})})]}),e.jsxs(T,{title:"Task",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Name"}),e.jsx("input",{maxLength:180,onChange:v=>b(v.target.value),required:!0,value:h})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Prompt"}),e.jsx("textarea",{onChange:v=>$(v.target.value),required:!0,value:R})]})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("div",{className:"scheduled-field-grid",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Repeat"}),e.jsxs("select",{onChange:v=>P(v.target.value),value:g,children:[e.jsx("option",{value:"once",children:"Once"}),e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekdays",children:"Weekdays"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]}),g==="weekly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day"}),e.jsx("select",{onChange:v=>q(v.target.value),value:y,children:ms.map(v=>e.jsx("option",{value:v,children:B(v)},v))})]}):g==="monthly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day of month"}),e.jsx("input",{max:31,min:1,onChange:v=>G(Number(v.target.value)),type:"number",value:L})]}):null,e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Start date"}),e.jsx("input",{onChange:v=>f(v.target.value),required:!0,type:"date",value:m})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Time"}),e.jsx("input",{onChange:v=>A(v.target.value),required:!0,type:"time",value:u})]}),e.jsxs("label",{className:"scheduled-field scheduled-field-wide",children:[e.jsx("span",{children:"Timezone"}),e.jsx("input",{onChange:v=>N(v.target.value),required:!0,value:C})]})]}),e.jsxs("p",{className:"scheduled-next-run",children:["Next run: ",M(a.schedule.nextRunAt,w.timeZone)]})]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[D?e.jsxs("button",{disabled:r,type:"submit",children:[e.jsx(ze,{size:15}),e.jsx("span",{children:"Save"})]}):null,e.jsxs("button",{disabled:r,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:r,onClick:()=>{j()},type:"button",children:[a.schedule.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.schedule.enabled?"Pause":"Resume"})]})]}),e.jsxs("button",{className:"scheduled-open-chat",disabled:r||!W,onClick:()=>{W&&me(W,S)},type:"button",children:[e.jsx("span",{children:"Open hosted chat"}),e.jsx(xe,{size:14})]}),e.jsx(T,{title:"Runs",children:c.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:c.map(v=>e.jsx(Be,{onOpen:()=>{k&&me(fe(k,v.conversationId),v.conversationId)},run:v},v.id))})})]})})}function js(s){return s.recurrence??{version:1,kind:"daily",timeZone:s.timeZone||ks(),startDate:vs(),localTime:"08:00",end:{kind:"never"}}}function ws(s){const t=s.input.prompt;return typeof t=="string"&&t.trim()?t.trim():Object.keys(s.input).length>0?JSON.stringify(s.input,null,2):"No task input configured."}function bs(s,t){const[n,l]=o.useState([]),[d,x]=o.useState(!1),[p,j]=o.useState(null);return o.useEffect(()=>{if(!s){l([]),x(!1),j(null);return}let r=!1;return x(!0),E.localAgentScheduleRuns(s,t,{limit:20}).then(a=>{r||(l(a.runs),j(null))}).catch(a=>{r||j(ys(a))}).finally(()=>{r||x(!1)}),()=>{r=!0}},[s,t]),{error:p,loading:d,runs:n}}function fe(s,t){const n=new URL(s);return n.pathname=t?`/sandboxes/work/${encodeURIComponent(t)}`:"/sandboxes/work",n.search="",n.hash="",n.toString()}async function me(s,t){const n=window.openpond?.browser;n?.openExternal&&(await n.openExternal({conversationId:t??"hosted-scheduled-work",url:s})).ok||window.open(s,"_blank","noopener,noreferrer")}function vs(){return new Date().toISOString().slice(0,10)}function ks(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function ys(s){return s instanceof Error?s.message:String(s)}export{Ms as ScheduledWorkPage,M as formatScheduledRunAt,fe as hostedConversationUrl};
|