openpond 0.2.58 → 0.2.60
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/README.md +27 -0
- package/dist/app-server.d.ts +8 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/acp-ARBNMIPT.js +2 -0
- package/dist/chunks/acp-agent-53COYDHB.js +21 -0
- package/dist/chunks/{actions-command-QU4H53OG.js → actions-command-6YSZ7EJS.js} +1 -1
- package/dist/chunks/{app-layer-NSTE5HIT.js → app-layer-TVG7KTW6.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-JHGWLBXT.js → app-server-connected-apps-K62M6LCT.js} +1 -1
- package/dist/chunks/{app-server-evaluations-K52NAQLP.js → app-server-evaluations-RM6WXX3H.js} +1 -1
- package/dist/chunks/app-server-harness-services-RLKMWOQ4.js +2 -0
- package/dist/chunks/app-server-runtime-OKMEHNEU.js +2 -0
- package/dist/chunks/apps-YWZL2H34.js +2 -0
- package/dist/chunks/{chunk-DARVPBZ4.js → chunk-23P2O7PH.js} +1 -1
- package/dist/chunks/{chunk-PF5R6CMP.js → chunk-2GICDASL.js} +1 -1
- package/dist/chunks/{chunk-6MI4KKWF.js → chunk-2ITZW2CN.js} +1 -1
- package/dist/chunks/chunk-2MMCZHKL.js +2 -0
- package/dist/chunks/{chunk-ABD5M2D2.js → chunk-2PAJCXFC.js} +1 -1
- package/dist/chunks/chunk-2RNCXDJC.js +5 -0
- package/dist/chunks/{chunk-APB2STJK.js → chunk-2SUMZ73C.js} +1 -1
- package/dist/chunks/{chunk-YOQRYNLP.js → chunk-3CWRTKHY.js} +1 -1
- package/dist/chunks/{chunk-TRQQNFMO.js → chunk-44LWH5U6.js} +1 -1
- package/dist/chunks/{chunk-HPBQ4VTW.js → chunk-52KIORRX.js} +1 -1
- package/dist/chunks/{chunk-NHQ36THU.js → chunk-5RHYSQZ5.js} +1 -1
- package/dist/chunks/{chunk-3QIB5FXI.js → chunk-5ZBLCWEJ.js} +1 -1
- package/dist/chunks/{chunk-FTEOCCPB.js → chunk-637UACKH.js} +1 -1
- package/dist/chunks/chunk-655DQ6AX.js +145 -0
- package/dist/chunks/{chunk-N4FFQPLR.js → chunk-6GWOVHIG.js} +1 -1
- package/dist/chunks/chunk-6HQB3MQO.js +2 -0
- package/dist/chunks/{chunk-UKMA4R6X.js → chunk-7LZISGTA.js} +2 -2
- package/dist/chunks/{chunk-A6USMRWK.js → chunk-7RC5WPVT.js} +1 -1
- package/dist/chunks/{chunk-H6IW2R22.js → chunk-7YTHEMWI.js} +1 -1
- package/dist/chunks/{chunk-PCSIOUHF.js → chunk-A3L74U3W.js} +1 -1
- package/dist/chunks/{chunk-25MBPJVY.js → chunk-A66CSUBJ.js} +1 -1
- package/dist/chunks/{chunk-OUVIWDL2.js → chunk-AGVOGPAZ.js} +1 -1
- package/dist/chunks/{chunk-M4JWQSV7.js → chunk-AW5Q6NXT.js} +1 -1
- package/dist/chunks/{chunk-RWWE5OXU.js → chunk-B46HZ3MX.js} +1 -1
- package/dist/chunks/{chunk-KGNCKIFP.js → chunk-BIPQCJ5V.js} +1 -1
- package/dist/chunks/{chunk-HCYX6RHP.js → chunk-BIQ33JV5.js} +1 -1
- package/dist/chunks/{chunk-JFXWI3EN.js → chunk-BK63OQRW.js} +1 -1
- package/dist/chunks/{chunk-2D4Y3HNW.js → chunk-CFSIU6CW.js} +1 -1
- package/dist/chunks/{chunk-EIEZHFIW.js → chunk-D3RRUWNN.js} +1 -1
- package/dist/chunks/{chunk-X4OSOOSU.js → chunk-D4UX2O45.js} +1 -1
- package/dist/chunks/{chunk-GJ2ZJFDD.js → chunk-DG4TYVPF.js} +1 -1
- package/dist/chunks/{chunk-QIKWJ2AA.js → chunk-DGIEXZJV.js} +1 -1
- package/dist/chunks/{chunk-PRGBLQVH.js → chunk-DIGX56JY.js} +1 -1
- package/dist/chunks/{chunk-JYKRR7E5.js → chunk-DISNCX6R.js} +1 -1
- package/dist/chunks/{chunk-773TH7FN.js → chunk-DK7IKI7O.js} +1 -1
- package/dist/chunks/{chunk-74IIXVAE.js → chunk-DX7YEUNQ.js} +1 -1
- package/dist/chunks/{chunk-523TE4BI.js → chunk-E63VWAQA.js} +1 -1
- package/dist/chunks/{chunk-5MCNZCVQ.js → chunk-EL454L26.js} +1 -1
- package/dist/chunks/{chunk-OS3LO5J3.js → chunk-ENSB6ZTM.js} +1 -1
- package/dist/chunks/{chunk-EAPFMACH.js → chunk-ERJV5BMC.js} +1 -1
- package/dist/chunks/{chunk-RNIAFXMB.js → chunk-EXJGCNRS.js} +1 -1
- package/dist/chunks/chunk-F5KCCDQM.js +2 -0
- package/dist/chunks/chunk-FSQWAANK.js +3 -0
- package/dist/chunks/{chunk-Z54O534A.js → chunk-G5B3PB5X.js} +1 -1
- package/dist/chunks/{chunk-4D7HWVWD.js → chunk-GAWGIJQG.js} +1 -1
- package/dist/chunks/{chunk-IIZ4CWBX.js → chunk-GGGF5NHJ.js} +1 -1
- package/dist/chunks/{chunk-APB4O67E.js → chunk-GOYBYYPQ.js} +1 -1
- package/dist/chunks/{chunk-XDQMGUWL.js → chunk-H3BSIAQO.js} +1 -1
- package/dist/chunks/{chunk-EYPCBBMS.js → chunk-HCEJAOIF.js} +1 -1
- package/dist/chunks/{chunk-OPNRWESL.js → chunk-IFQCOSU6.js} +1 -1
- package/dist/chunks/chunk-IJHZBHEK.js +9 -0
- package/dist/chunks/{chunk-RAXOSUSW.js → chunk-ISFIDCIH.js} +1 -1
- package/dist/chunks/{chunk-OLLLZVHF.js → chunk-ITKTILKI.js} +1 -1
- package/dist/chunks/{chunk-D74JEERO.js → chunk-IUBARBGI.js} +1 -1
- package/dist/chunks/{chunk-O72BSKSO.js → chunk-J24I74EM.js} +1 -1
- package/dist/chunks/{chunk-H4QHIHMK.js → chunk-J7QGHA7G.js} +3 -3
- package/dist/chunks/chunk-JFXINDOQ.js +3 -0
- package/dist/chunks/{chunk-HIOKCIL7.js → chunk-JGWINTT5.js} +1 -1
- package/dist/chunks/{chunk-Q2QL6UWN.js → chunk-JHEFWB6O.js} +1 -1
- package/dist/chunks/{chunk-QNG27G3T.js → chunk-JHMS2WXM.js} +2 -2
- package/dist/chunks/{chunk-PSGGOZFM.js → chunk-JHR3LF2F.js} +1 -1
- package/dist/chunks/{chunk-JE7RJZOA.js → chunk-KGLJU66U.js} +3 -3
- package/dist/chunks/{chunk-XEOEKFG6.js → chunk-KJFRCVQC.js} +1 -1
- package/dist/chunks/chunk-KNO355LC.js +2 -0
- package/dist/chunks/{chunk-ZGTOK7ZK.js → chunk-LD7PGREF.js} +2 -2
- package/dist/chunks/{chunk-I7AQMAQI.js → chunk-LHA7RQBA.js} +6 -6
- package/dist/chunks/{chunk-6QSSIT62.js → chunk-LO3O45IX.js} +1 -1
- package/dist/chunks/{chunk-G3RXYI2L.js → chunk-M2SKXY5C.js} +2 -2
- package/dist/chunks/{chunk-2IHO4GDJ.js → chunk-M3ZQDPRS.js} +1 -1
- package/dist/chunks/{chunk-JDEEWOD7.js → chunk-M4ZF44H5.js} +1 -1
- package/dist/chunks/{chunk-Y4OWBBDD.js → chunk-M55H7KVR.js} +1 -1
- package/dist/chunks/{chunk-JAJ46T5X.js → chunk-MGKMIRYG.js} +1 -1
- package/dist/chunks/{chunk-4EQA2M7K.js → chunk-MJGU2JJ2.js} +2 -2
- package/dist/chunks/{chunk-65PL62KH.js → chunk-MS37ISA4.js} +2 -2
- package/dist/chunks/{chunk-NH6UUX5S.js → chunk-NCKXI2VB.js} +11 -11
- package/dist/chunks/chunk-NHUUCNAD.js +2 -0
- package/dist/chunks/{chunk-O6ULLQJ6.js → chunk-O3VP46SE.js} +1 -1
- package/dist/chunks/chunk-O4FBOUNX.js +2 -0
- package/dist/chunks/chunk-O6IFVTZT.js +9 -0
- package/dist/chunks/{chunk-5IPFI25K.js → chunk-O7B44IYN.js} +1 -1
- package/dist/chunks/{chunk-DMVD2RFZ.js → chunk-OGMDEA3Y.js} +1 -1
- package/dist/chunks/{chunk-BLXEAZCQ.js → chunk-OKBIWRHC.js} +1 -1
- package/dist/chunks/{chunk-FFRFSDBM.js → chunk-ON2RNOCG.js} +1 -1
- package/dist/chunks/{chunk-LQQNBVEB.js → chunk-ONDCV5QC.js} +1 -1
- package/dist/chunks/{chunk-UCPGRPWY.js → chunk-OQ4VGCRG.js} +1 -1
- package/dist/chunks/{chunk-YNH3NMPF.js → chunk-OWK7HU5I.js} +1 -1
- package/dist/chunks/{chunk-DBK66CJP.js → chunk-OY5HC2P6.js} +1 -1
- package/dist/chunks/{chunk-T5AACNJI.js → chunk-P7HRF4FM.js} +1 -1
- package/dist/chunks/{chunk-7ED24PP6.js → chunk-PCNLC5H3.js} +1 -1
- package/dist/chunks/{chunk-ES2ISFJC.js → chunk-PF56N7ZY.js} +1 -1
- package/dist/chunks/{chunk-VVCKLCF3.js → chunk-PKALOVHC.js} +2 -2
- package/dist/chunks/{chunk-ZCHXGRRU.js → chunk-PR5TYTY4.js} +1 -1
- package/dist/chunks/{chunk-Q4TBTRIG.js → chunk-PWK5Z5S3.js} +1 -1
- package/dist/chunks/chunk-PXS4SVQG.js +16 -0
- package/dist/chunks/{chunk-AY64VY4E.js → chunk-QGOPYQW3.js} +1 -1
- package/dist/chunks/{chunk-7E6T7GP5.js → chunk-R7YEURUQ.js} +1 -1
- package/dist/chunks/{chunk-ACYFMLWG.js → chunk-RCA6NGVA.js} +2 -2
- package/dist/chunks/{chunk-DUURYZOI.js → chunk-RG3NH6YQ.js} +1 -1
- package/dist/chunks/{chunk-7SC46OFC.js → chunk-RJIUOLWY.js} +1 -1
- package/dist/chunks/{chunk-F4KOGISR.js → chunk-RXE3FYMJ.js} +1 -1
- package/dist/chunks/chunk-RYGWCN2R.js +2 -0
- package/dist/chunks/{chunk-VYLGI3IH.js → chunk-SFNCAPCJ.js} +1 -1
- package/dist/chunks/{chunk-Z4Z5UOZM.js → chunk-SG6JZ7HD.js} +1 -1
- package/dist/chunks/{chunk-XX6SMFDY.js → chunk-SKRNWRKV.js} +5 -5
- package/dist/chunks/{chunk-ZRDGQDZL.js → chunk-SLZH4Z6C.js} +1 -1
- package/dist/chunks/{chunk-WN3V6KDN.js → chunk-SPDSSMFD.js} +1 -1
- package/dist/chunks/chunk-STWRTNRK.js +2 -0
- package/dist/chunks/{chunk-HZEIRHEB.js → chunk-T5J7HIHR.js} +1 -1
- package/dist/chunks/{chunk-ROGF26KV.js → chunk-TBUAQWFS.js} +1 -1
- package/dist/chunks/{chunk-ZUJ3XUCP.js → chunk-TEPRCBDV.js} +1 -1
- package/dist/chunks/{chunk-HDGTHRY7.js → chunk-TOFMA2L5.js} +2 -2
- package/dist/chunks/{chunk-QOGJAQDO.js → chunk-UFHLLSCE.js} +1 -1
- package/dist/chunks/{chunk-TTVS6JMC.js → chunk-UJKQLO6B.js} +2 -2
- package/dist/chunks/{chunk-OQKJGTTO.js → chunk-UZQNFTLR.js} +1 -1
- package/dist/chunks/{chunk-F74GBN6K.js → chunk-V2HMWCT6.js} +1 -1
- package/dist/chunks/{chunk-6ZFPQYHG.js → chunk-V4KT5FCJ.js} +1 -1
- package/dist/chunks/{chunk-TVQAPBLZ.js → chunk-VHSX3JPX.js} +1 -1
- package/dist/chunks/{chunk-SDXFLO7J.js → chunk-W2SXOGTQ.js} +1 -1
- package/dist/chunks/{chunk-FUOEIDMA.js → chunk-WDEO44UN.js} +1 -1
- package/dist/chunks/{chunk-4NESNOK5.js → chunk-WEHBK3MC.js} +1 -1
- package/dist/chunks/{chunk-4EPSHPZL.js → chunk-WGX7WY4N.js} +1 -1
- package/dist/chunks/{chunk-NC27T4AB.js → chunk-WHREO7A2.js} +1 -1
- package/dist/chunks/{chunk-RNQF63ZR.js → chunk-WS2ZZBAQ.js} +4 -4
- package/dist/chunks/{chunk-DIO5CB6U.js → chunk-WYZWDMMF.js} +1 -1
- package/dist/chunks/{chunk-MQULU465.js → chunk-XO3H32KX.js} +1 -1
- package/dist/chunks/{chunk-EIRYMSEG.js → chunk-XQBIHPPX.js} +1 -1
- package/dist/chunks/chunk-XRKFTPHD.js +2 -0
- package/dist/chunks/{chunk-B7RFL4N2.js → chunk-XSCIOQYE.js} +1 -1
- package/dist/chunks/{chunk-TJ6GVTYB.js → chunk-XTWEWYK7.js} +9 -9
- package/dist/chunks/{chunk-JUHZ5S3R.js → chunk-Y3GIM6WK.js} +1 -1
- package/dist/chunks/{chunk-74ZXXBGN.js → chunk-Y54RKLOI.js} +1 -1
- package/dist/chunks/{chunk-SWUEFLOH.js → chunk-Y777GISF.js} +1 -1
- package/dist/chunks/{chunk-EKM2D7JU.js → chunk-YDU3S6UT.js} +1 -1
- package/dist/chunks/{chunk-UGL7WF3W.js → chunk-YOZIZYSC.js} +1 -1
- package/dist/chunks/{chunk-OSIO7PLX.js → chunk-YQKOB56U.js} +1 -1
- package/dist/chunks/chunk-YVNDDNMK.js +3 -0
- package/dist/chunks/chunk-ZAZKJJOT.js +86 -0
- package/dist/chunks/{chunk-QL4OIPEZ.js → chunk-ZR7LIMJS.js} +2 -2
- package/dist/chunks/{chunk-L3KCP52O.js → chunk-ZTJOOY2F.js} +1 -1
- package/dist/chunks/{chunk-GPVCOEUH.js → chunk-ZTVXRZ6D.js} +1 -1
- package/dist/chunks/cli-CNYNXKGQ.js +2 -0
- package/dist/chunks/configuration-command-5K7EE2J5.js +2 -0
- package/dist/chunks/connected-app-executor-E25XCNAS.js +2 -0
- package/dist/chunks/connected-evidence-QNSO5BTF.js +2 -0
- package/dist/chunks/connection-Y2KCMBYD.js +2 -0
- package/dist/chunks/{continual-6CQAMTTR.js → continual-SOO3QBNQ.js} +1 -1
- package/dist/chunks/core-commands-ZTWPYAFQ.js +2 -0
- package/dist/chunks/datasets-XPUMWGOC.js +2 -0
- package/dist/chunks/desktop-test-HVSW4JHY.js +3 -0
- package/dist/chunks/dist-4N6AHWNN.js +2 -0
- package/dist/chunks/{dist-OMGUJYPD.js → dist-N6R6VNFD.js} +1 -1
- package/dist/chunks/{dist-VYC5VMQB.js → dist-QN7WKZ2D.js} +1 -1
- package/dist/chunks/{enclave-QS4BUNDU.js → enclave-VURYNILU.js} +1 -1
- package/dist/chunks/evaluation-coordination-AOTFPVMS.js +2 -0
- package/dist/chunks/experiment-improvements-75CN3VI7.js +2 -0
- package/dist/chunks/experiments-AGAHM2AK.js +2 -0
- package/dist/chunks/{experiments-VFQGE4HC.js → experiments-DYSHYBGB.js} +1 -1
- package/dist/chunks/{extension-XKXXOP5N.js → extension-UT4CSDJF.js} +1 -1
- package/dist/chunks/help-KU52CFMW.js +8 -0
- package/dist/chunks/host-profile-evaluation-tools-LZDMQCMT.js +2 -0
- package/dist/chunks/host-profile-external-dataset-VK3NJHMC.js +2 -0
- package/dist/chunks/hosted-app-server-composition-P7V7K7CG.js +2 -0
- package/dist/chunks/{hosted-experiment-improvement-HVMDGS75.js → hosted-experiment-improvement-P433KDX2.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-Y4DONWPC.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-EXNN6MVN.js → hosted-profile-candidate-72MMPN6U.js} +1 -1
- package/dist/chunks/hosted-profile-compiler-RXHLK224.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-LS4DCSDO.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-inspection-ZUANDYZ6.js → hosted-profile-evaluation-inspection-3Q6EHO66.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-ORVZ6MBD.js → hosted-profile-evaluation-preparation-ZD27HNLF.js} +1 -1
- package/dist/chunks/{hosted-tasksets-ANAE2PIW.js → hosted-tasksets-V2PQZJN4.js} +1 -1
- package/dist/chunks/human-review-4FJFINQX.js +2 -0
- package/dist/chunks/import-GBHSLA3G.js +3 -0
- package/dist/chunks/{learning-ACEVFL5M.js → learning-U3FZL5YB.js} +1 -1
- package/dist/chunks/local-harness-improvement-runtime-UP2P7UT4.js +2 -0
- package/dist/chunks/local-harness-taskset-review-ZNOKSPJJ.js +2 -0
- package/dist/chunks/{local-scope-HVF2GZ5W.js → local-scope-62GWHDXS.js} +1 -1
- package/dist/chunks/{model-projects-QPO22JPA.js → model-projects-LQ4C6R3X.js} +1 -1
- package/dist/chunks/opchat-Q4PIWPYW.js +3 -0
- package/dist/chunks/organizations-TEH6HBQ3.js +2 -0
- package/dist/chunks/{profile-TFZMUEDR.js → profile-SWPVCGTR.js} +1 -1
- package/dist/chunks/{profile-training-source-6GOT7AHM.js → profile-training-source-J73ZLNSC.js} +1 -1
- package/dist/chunks/project-action-payload-OU3ZPHW7.js +2 -0
- package/dist/chunks/project-agent-J7ILCRBS.js +2 -0
- package/dist/chunks/{published-experiment-source-HVP5IGRH.js → published-experiment-source-HVHKSYDL.js} +1 -1
- package/dist/chunks/refiner-profile-service-E7YU4E3N.js +2 -0
- package/dist/chunks/{runtime-A7OZXM43.js → runtime-LIPHPKKJ.js} +2 -2
- package/dist/chunks/sandbox-command-G6KID3OP.js +2 -0
- package/dist/chunks/{sandbox-template-C4V6T36U.js → sandbox-template-MZTMAUFS.js} +1 -1
- package/dist/chunks/saved-work-LOUWLF37.js +2 -0
- package/dist/chunks/{send-turn-XTAIS2JN.js → send-turn-UEUEGY5W.js} +1 -1
- package/dist/chunks/{src-R36AGJY7.js → src-7WMZOWZZ.js} +107 -100
- package/dist/chunks/{src-DZL5T2MT.js → src-MVAK6D6Y.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-YRKEOEJ2.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-LJPNG4SP.js → store-continual-support-reviews-FJLLNKCY.js} +1 -1
- package/dist/chunks/{store-conversation-serving-KPC62UEY.js → store-conversation-serving-4KWR4IZY.js} +1 -1
- package/dist/chunks/{store-create-improve-SW5FTBTL.js → store-create-improve-JWBJZRAU.js} +1 -1
- package/dist/chunks/{store-datasets-WMA7AJKN.js → store-datasets-4N2M6Y3K.js} +2 -2
- package/dist/chunks/{store-evaluation-results-ZO6R653G.js → store-evaluation-results-OBM4623U.js} +1 -1
- package/dist/chunks/{store-harness-memory-VINCZ4GK.js → store-harness-memory-4HUEMRCD.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-EA5KFQPH.js → store-harness-refinement-candidates-NMRWMN23.js} +1 -1
- package/dist/chunks/store-harness-workspaces-BGONIQDY.js +2 -0
- package/dist/chunks/{store-human-review-7QQ7ZQ6P.js → store-human-review-J75SIZAL.js} +1 -1
- package/dist/chunks/store-learned-preference-migration-validation-VLASM4CT.js +2 -0
- package/dist/chunks/store-learning-TUCQFBLT.js +2 -0
- package/dist/chunks/{store-learning-credentials-WZQJ4HPJ.js → store-learning-credentials-S4RF57NV.js} +1 -1
- package/dist/chunks/{store-local-experiments-SAULQSBN.js → store-local-experiments-LULRLTII.js} +5 -5
- package/dist/chunks/{store-model-batch-review-VKLDYGH3.js → store-model-batch-review-SVL4MT6D.js} +1 -1
- package/dist/chunks/{store-model-configuration-BYRJUR3C.js → store-model-configuration-ZHDSM3XM.js} +2 -2
- package/dist/chunks/{store-preference-comparison-LV32MHVL.js → store-preference-comparison-YMMCKXS5.js} +1 -1
- package/dist/chunks/{store-schedules-VGTEQVKH.js → store-schedules-6Z4QS3NU.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-VB5GTLFY.js → store-sidebar-file-bookmarks-MX6EP6OB.js} +2 -2
- package/dist/chunks/{store-sidebar-preferences-GWIOG2NH.js → store-sidebar-preferences-VYREPW26.js} +1 -1
- package/dist/chunks/{store-subagents-T7R2Z6TB.js → store-subagents-WGBCRALX.js} +1 -1
- package/dist/chunks/{store-task-inbox-QPE44OSS.js → store-task-inbox-43BNZSB7.js} +6 -6
- package/dist/chunks/{store-task-inventory-I3RDRI52.js → store-task-inventory-AEW4POAJ.js} +2 -2
- package/dist/chunks/{store-taskset-drafts-2IULRV2W.js → store-taskset-drafts-DKFO2CYB.js} +1 -1
- package/dist/chunks/{store-training-B2TW2MLA.js → store-training-6PFFR6ST.js} +1 -1
- package/dist/chunks/{store-training-jobs-VBNG23RL.js → store-training-jobs-ANDEBQ67.js} +2 -2
- package/dist/chunks/{store-training-models-OMV5FIC4.js → store-training-models-OOI4ZJPX.js} +2 -2
- package/dist/chunks/{store-usage-IE2U2FD3.js → store-usage-U72RNW64.js} +1 -1
- package/dist/chunks/{store-work-evidence-QQDKM5AQ.js → store-work-evidence-NY5OBATB.js} +1 -1
- package/dist/chunks/{taskset-EQRFQBYM.js → taskset-SL3YOXW7.js} +1 -1
- package/dist/chunks/{taskset-packages-XC6HEE3K.js → taskset-packages-3PCEYYDA.js} +1 -1
- package/dist/chunks/{teams-bot-EAPGPTHZ.js → teams-bot-IDEF3BMI.js} +1 -1
- package/dist/chunks/{training-UF6RPI4T.js → training-57ISIC7U.js} +1 -1
- package/dist/chunks/web-search-222Y63QW.js +2 -0
- package/dist/chunks/{workspaces-EKKE5NAC.js → workspaces-5DF4H5EX.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox-template/manifest.js +1 -1
- package/dist/web/assets/{App-CaRMZoxo.css → App-DbYvV_W6.css} +1 -1
- package/dist/web/assets/App-nzE7JU_O.js +154 -0
- package/dist/web/assets/{AppDialog-t2Fx5tK3.js → AppDialog-VtNvqbDm.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-Dj1Y32oI.js → AppTerminalPanel-BMfKdrrN.js} +2 -2
- package/dist/web/assets/AppsView-CdWyrDEb.js +1 -0
- package/dist/web/assets/{BrowserSidebar-jhWi4rVm.js → BrowserSidebar-CtOIciOa.js} +1 -1
- package/dist/web/assets/{CartesianChart-C1DIx0Ia.js → CartesianChart-u1lvLM30.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-Bdr-HmOL.js → CollaborationTabs-CaBfDYRW.js} +1 -1
- package/dist/web/assets/{CommandMenu-Ux2yOHAc.js → CommandMenu-CFW3WJ11.js} +1 -1
- package/dist/web/assets/{CommunityView-DPEeVKFn.js → CommunityView-D2EjaeuH.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-6wYSJdzv.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-BJ4QhF7p.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-PfUa8V7X.css +1 -0
- package/dist/web/assets/{GetStartedView-CFHP0AaI.js → GetStartedView-DBcOwIJn.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-D8BGTPVN.js → HostedModelLearningReview-BNpK6_W9.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JS1S7vNO.js → HostedModelLearningSettings-SrsdeeoA.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Dx5Q3xV2.js → LabModelVersionDetailPage-Cd6bRHt9.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-CQfvel4w.js +1 -0
- package/dist/web/assets/{LabsRoute-CyYF8-dw.js → LabsRoute-sXLJt1KR.js} +4 -4
- package/dist/web/assets/MainChatThread-dlDDK2JM.js +2 -0
- package/dist/web/assets/MainPane-DCz38-qy.js +65 -0
- package/dist/web/assets/{MarkdownText-BR4V6lNO.js → MarkdownText-Drjq6-JM.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DU9IEgIO.js → NativeSkillSidebar-jncZijt-.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-mIy6FzCj.js → NewExperienceSwitcher-DXKzoMaM.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-RfTZTHxl.js → NewProjectDialog-DIyjAxJG.js} +1 -1
- package/dist/web/assets/OutputsPage-Dy1cNr3n.js +1 -0
- package/dist/web/assets/{ProjectsPage-CE6QUB-b.js → ProjectsPage-D2EeybIv.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-4wUL-W9_.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-Bd_AHUp8.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-vOrYv8pp.js → ScheduledWorkPage-BJkSzwz2.js} +1 -1
- package/dist/web/assets/{SettingsView-DCKVrfjj.js → SettingsView-BhcP72KH.js} +4 -4
- package/dist/web/assets/SettingsView-DjjnCnlb.css +1 -0
- package/dist/web/assets/{TeamChatView-Bwrjr-vk.js → TeamChatView-CR0fdicZ.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DhPoKZAq.js → TerminalOverlay-DGrZRZ_3.js} +10 -10
- package/dist/web/assets/TrainingCreationPanel-BsTG7aFS.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-C9cRX5qf.js → TrainingDraftPanel-ByErrht7.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CrdcSGeW.js → UsageSettingsSection-DeYTJbcM.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DSSikNFQ.js → WorkSidebarPanel-DcNvEEoy.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-BAFo0CPN.js → WorkspaceDiffPanel-CdPRcYWN.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BVHAhwnJ.js → WorkspaceEnvironmentMenu-xUYg-iGn.js} +18 -18
- package/dist/web/assets/{WorkspaceGitDialogs-CwVoiDQ2.js → WorkspaceGitDialogs-CBViLL3S.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-TxLyhzNp.js → WorkspaceMonacoEditor-frxie2_S.js} +3 -3
- package/dist/web/assets/agent-connections-D7ao-vbU.js +1 -0
- package/dist/web/assets/{arrow-up-right-C9aE8Mfz.js → arrow-up-right-DCWPxdbD.js} +1 -1
- package/dist/web/assets/{chunk-P3BRSSRD-DUGfuKA8.js → chunk-P3BRSSRD-B5JXa0Nh.js} +1 -1
- package/dist/web/assets/{clipboard-Dk158Qp4.js → clipboard-B-GnMVLp.js} +1 -1
- package/dist/web/assets/{cloud-upload-k9eqBsHr.js → cloud-upload-DpaGFZ9J.js} +1 -1
- package/dist/web/assets/{cssMode-CO35ARZp.js → cssMode-DJHE7R3W.js} +1 -1
- package/dist/web/assets/{folder-open-sYgceW_f.js → folder-open-B-DFLDFH.js} +1 -1
- package/dist/web/assets/{folder-plus-CS0R49m9.js → folder-plus-CPXxPvSH.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DrGxH2h4.js → git-commit-horizontal-DCTzcivA.js} +1 -1
- package/dist/web/assets/{htmlMode-REMmzdfq.js → htmlMode-DxZVBAYd.js} +1 -1
- package/dist/web/assets/index-BojtIRzO.css +1 -0
- package/dist/web/assets/{index-C8aCGagb.js → index-Di1MU6Xr.js} +2 -2
- package/dist/web/assets/{info-DLdbiUrh.js → info-BMxsR_bn.js} +1 -1
- package/dist/web/assets/{jsonMode-KEdMfkIf.js → jsonMode-CzWoMkpp.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-5KZwEoxW.js → lspLanguageFeatures-15K7ND6Q.js} +1 -1
- package/dist/web/assets/{minimize-2-CqcI4zcM.js → minimize-2-DwUgqXoR.js} +1 -1
- package/dist/web/assets/{monaco.contribution-Cly9Wt7L.js → monaco.contribution-BBLKjER5.js} +2 -2
- package/dist/web/assets/{monaco.contribution-omszXBEj.js → monaco.contribution-DBjvSu8p.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DO10L0zW.js → monaco.contribution-DUWvjhIG.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BJGj65F9.js → monaco.contribution-w0zfkYLX.js} +2 -2
- package/dist/web/assets/{monitor-BFVCcbxp.js → monitor-Ihu5LVYx.js} +1 -1
- package/dist/web/assets/{play-C469pVZq.js → play-D_YGCdxU.js} +1 -1
- package/dist/web/assets/{python-Dw0YcVy9.js → python-Q4OuoXYc.js} +1 -1
- package/dist/web/assets/{save-CtSjPydi.js → save-DJYUOhtD.js} +1 -1
- package/dist/web/assets/{square-BuImvLhT.js → square-DXtoCBNw.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DjCO9lIP.js → toggleHighContrast-CaNeuWVE.js} +1 -1
- package/dist/web/assets/{tsMode-BAOnxKd6.js → tsMode-CJnQ2wmM.js} +1 -1
- package/dist/web/assets/{upload-2JkFZo3h.js → upload-fCP3_OEO.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BNqAisfS.js → useLocalAgentSchedules-BFoH_gwZ.js} +1 -1
- package/dist/web/assets/useProviderSettings-2eysgqiA.js +5 -0
- package/dist/web/assets/{useProviderSettings-CmL_BaxP.css → useProviderSettings-Cktvzinz.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BHU2-Jmz.js → useSessionTurnCache-DLF5SPD-.js} +1 -1
- package/dist/web/assets/{wifi-off-CpOAH62M.js → wifi-off-DZoiFrRz.js} +1 -1
- package/dist/web/assets/{workers-0QvlA2T5.js → workers-D5nr74M-.js} +1 -1
- package/dist/web/assets/{yaml-BK3qxo7D.js → yaml-CwsoTJmk.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +22 -3
- package/docs/conversation-imports.md +57 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-harness-services-QMUOEYOA.js +0 -2
- package/dist/chunks/app-server-runtime-ISGGLQHU.js +0 -2
- package/dist/chunks/apps-BKTOR4F7.js +0 -2
- package/dist/chunks/chunk-3VUATFZD.js +0 -2
- package/dist/chunks/chunk-3Z47M3YY.js +0 -2
- package/dist/chunks/chunk-6UDGARFC.js +0 -143
- package/dist/chunks/chunk-FV2R5RUN.js +0 -3
- package/dist/chunks/chunk-HY3GOBFJ.js +0 -58
- package/dist/chunks/chunk-I3HZKJB3.js +0 -2
- package/dist/chunks/chunk-I3VVWNUW.js +0 -5
- package/dist/chunks/chunk-KG325WTN.js +0 -2
- package/dist/chunks/chunk-Q5LEXXJG.js +0 -16
- package/dist/chunks/chunk-QDC4OW3S.js +0 -2
- package/dist/chunks/chunk-SDAUS5PY.js +0 -2
- package/dist/chunks/chunk-VRIEKBBH.js +0 -9
- package/dist/chunks/chunk-WJ43MJ3F.js +0 -2
- package/dist/chunks/chunk-X2HIHF2I.js +0 -2
- package/dist/chunks/chunk-YBT2NB32.js +0 -2
- package/dist/chunks/chunk-ZTNHW2K7.js +0 -10
- package/dist/chunks/cli-XZENDZ7Z.js +0 -2
- package/dist/chunks/configuration-command-6C5UO7GE.js +0 -2
- package/dist/chunks/connected-app-executor-LQNIU5NR.js +0 -2
- package/dist/chunks/connected-evidence-GH2ATNEX.js +0 -2
- package/dist/chunks/connection-HTF6CC7M.js +0 -2
- package/dist/chunks/core-commands-A2DGGIPS.js +0 -2
- package/dist/chunks/datasets-7BNMVJOY.js +0 -2
- package/dist/chunks/desktop-test-3CUHVLXV.js +0 -3
- package/dist/chunks/dist-ZVJPJLXR.js +0 -2
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +0 -2
- package/dist/chunks/experiment-improvements-KRX2DP27.js +0 -2
- package/dist/chunks/experiments-DFGQYA4O.js +0 -2
- package/dist/chunks/help-S7THC6IE.js +0 -8
- package/dist/chunks/host-profile-evaluation-tools-JOFBL5OF.js +0 -2
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +0 -2
- package/dist/chunks/hosted-app-server-composition-T5IWGOTA.js +0 -2
- package/dist/chunks/hosted-harness-runtime-YCKB6NBI.js +0 -2
- package/dist/chunks/hosted-profile-compiler-IYLLHCRY.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-TJVER3NW.js +0 -2
- package/dist/chunks/human-review-WR777ODH.js +0 -2
- package/dist/chunks/import-MLZUHITH.js +0 -4
- package/dist/chunks/local-harness-improvement-runtime-QRFGPFRM.js +0 -2
- package/dist/chunks/local-harness-taskset-review-HR7KLY4B.js +0 -2
- package/dist/chunks/opchat-T4QTNEIY.js +0 -3
- package/dist/chunks/organizations-75L5DZDV.js +0 -2
- package/dist/chunks/project-action-payload-JDS6OQAW.js +0 -2
- package/dist/chunks/project-agent-6RRO233B.js +0 -2
- package/dist/chunks/refiner-profile-service-FDTQKY33.js +0 -2
- package/dist/chunks/sandbox-command-IU5XFTJP.js +0 -2
- package/dist/chunks/saved-work-SHEEDZ6Z.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +0 -2
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +0 -2
- package/dist/chunks/store-learned-preference-migration-validation-NADPXOTG.js +0 -2
- package/dist/chunks/store-learning-WLG6KFIO.js +0 -2
- package/dist/chunks/web-search-CZ3NCLPY.js +0 -2
- package/dist/web/assets/App-s-CJswyt.js +0 -154
- package/dist/web/assets/AppsView-BYE5EBDJ.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-CEgh4OtN.js +0 -1
- package/dist/web/assets/LabSkillSidebar-BxffN-pN.js +0 -1
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +0 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +0 -65
- package/dist/web/assets/OutputsPage-Cr1Spf7S.js +0 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +0 -1
- package/dist/web/assets/SettingsView-Dulr_xlq.css +0 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +0 -1
- package/dist/web/assets/index-3iPNbbER.css +0 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as T0,g as ia,as as M0,at as oe,V as $e,aD as bn,bo as yn,X as wn,aE as z0,bI as A0,bJ as xn,x as kn}from"./App-s-CJswyt.js";import{r as U,j as B}from"./index-C8aCGagb.js";const Sn=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Xs=T0("archive",Sn);const Mn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ys=T0("arrow-right",Mn);const zn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zs=T0("chevron-up",zn);const An=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Tn=T0("code-xml",An);const Cn=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bn=T0("copy",Cn);const In=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Ks=T0("file",In);const Dn=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Js=T0("pause",Dn);const En=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Qs=T0("trash-2",En);const Nn=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],_s=T0("workflow",Nn);const qn=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],Rn=T0("text-wrap",qn),dr=r=>/\.html?(?:[?#].*)?$/i.test(r);async function el(r,e,t,a="local"){return(await ia(r,`/v1/${a==="sandbox"?"sandboxes":"workspaces"}/${encodeURIComponent(e)}/html-preview`,{method:"POST",body:JSON.stringify({path:t})})).url}async function tl(r,e,t){return(await ia(r,"/v1/html-previews",{method:"POST",body:JSON.stringify({name:e,content:t})})).url}function sa(r,e,t){const[a,n]=U.useState({key:e,url:null,status:"loading"}),i=U.useRef(null);U.useEffect(()=>{if(!r||!e)return;M0.activateConnection(r);const u=M0.watch(e,t,d=>n({...d,key:e}));i.current=u;const c=()=>{document.visibilityState!=="hidden"&&u.refresh()};return window.addEventListener("focus",c),window.addEventListener("openpond-runtime-connected",c),document.addEventListener("visibilitychange",c),()=>{u.close(),i.current=null,window.removeEventListener("focus",c),window.removeEventListener("openpond-runtime-connected",c),document.removeEventListener("visibilitychange",c)}},[r,e,t]);const o=U.useCallback(()=>i.current?.refresh(!0),[]);return{...a.key===e&&r&&e?a:{url:null,status:"loading"},retry:o}}function la(r,e,t){return/^(?:[~/\\]|[A-Za-z]:|file:\/\/)/.test(t)?$e.signLocalImageUrl(r,{path:t}):$e.signWorkspaceImageUrl(r,{appId:e,path:t})}function Ln(r,e,t){return oa(r,e,t).url}function oa(r,e,t){const a=U.useCallback(()=>la(r,e,t),[r,e,t]);return sa(r,r&&e&&t?oe(r,"workspace-image",e,t):null,a)}function On(r){const[,e]=U.useState(0),t=U.useCallback((i,o)=>!r||!i||!o?null:(M0.activateConnection(r),M0.get(oe(r,"workspace-image",i,o))),[r]),a=U.useCallback(async(i,o)=>{if(!r||!i||!o)return null;M0.activateConnection(r);const u=oe(r,"workspace-image",i,o);return M0.load(u,()=>la(r,i,o)).finally(()=>e(c=>c+1))},[r]),n=U.useCallback((i,o)=>{a(i,o)},[a]);return U.useMemo(()=>({ensureUrl:n,getUrl:t,loadUrl:a}),[n,t,a])}async function Fn(r,e){const t=window.openpond?.files?.saveImage;if(t){const d=await t({url:new URL(r,window.location.href).href,suggestedName:e});if(!d.ok&&!d.canceled)throw new Error(d.error||"Could not save image.");return}const a=window.showSaveFilePicker;let n;try{n=a?await a.call(window,{suggestedName:e}):void 0}catch(d){if(d instanceof DOMException&&d.name==="AbortError")return;throw d}const i=await fetch(r);if(!i.ok)throw new Error(`Image download failed (${i.status}).`);const o=await i.blob();if(n){const d=await n.createWritable();try{await d.write(o),await d.close()}catch(f){throw await d.abort().catch(()=>{}),f}return}const u=URL.createObjectURL(o),c=document.createElement("a");c.href=u,c.download=e,document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(u),6e4)}function Pn({open:r,src:e,title:t,onClose:a}){const[n,i]=U.useState(!1),[o,u]=U.useState(!1),[c,d]=U.useState(null);if(U.useEffect(()=>{if(!r)return;const y=w=>{w.key==="Escape"&&a()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[a,r]),U.useEffect(()=>{i(!1),d(null)},[e]),!r||!e)return null;const f=(()=>{const y=t.split("/").pop()?.trim();if(y&&/\.[A-Za-z0-9]+$/.test(y))return y;try{const w=new URL(e,window.location.href),z=(w.searchParams.get("path")??w.searchParams.get("storageName")??w.pathname).split(/[\\/]/).pop()?.trim();if(z&&/\.[A-Za-z0-9]+$/.test(z))return z}catch{}return"image.png"})(),b=async()=>{if(!o){u(!0),d(null);try{await Fn(e,f)}catch(y){d(y instanceof Error?y.message:"Could not save image.")}finally{u(!1)}}};return bn.createPortal(B.jsx("div",{className:"image-lightbox-backdrop",role:"presentation",onMouseDown:y=>{y.target===y.currentTarget&&a()},children:B.jsxs("section",{"aria-label":t?`Image preview: ${t}`:"Image preview","aria-modal":"true",className:"image-lightbox-dialog",role:"dialog",children:[B.jsxs("header",{className:"image-lightbox-header",children:[B.jsx("span",{title:t,children:t}),B.jsxs("div",{className:"image-lightbox-actions",children:[B.jsx("button",{type:"button","aria-label":"Download image",title:"Download",disabled:o,"aria-busy":o,onClick:b,children:B.jsx(yn,{size:16})}),B.jsx("button",{type:"button","aria-label":"Close image preview",title:"Close",onClick:a,children:B.jsx(wn,{size:16})})]})]}),c&&B.jsx("div",{className:"image-lightbox-error",role:"alert",children:c}),B.jsx("div",{className:"image-lightbox-frame",children:n?B.jsx("div",{className:"image-lightbox-error",children:"Image preview unavailable"}):B.jsx("img",{alt:t||"Image preview",decoding:"async",draggable:!1,src:e,onError:()=>i(!0)})})]})}),document.body)}async function kt(r){if(!r)return!1;try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(r),!0}catch(e){console.warn("Clipboard write failed",e)}try{const e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.style.position="fixed",e.style.left="-1000px",e.style.top="-1000px",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return e.remove(),t}catch(e){return console.warn("Clipboard fallback failed",e),!1}}const Hn=new Set(["bash","c","cc","cjs","cpp","css","csv","docx","env","gif","go","graphql","h","hpp","html","htm","ico","java","jpeg","jpg","js","json","jsx","lock","lockb","md","mdx","m4v","mjs","mov","mp4","pdf","pptx","png","py","rs","scss","sh","sql","svg","toml","ts","tsx","txt","xlsx","webp","webm","yaml","yml","zsh"]),jn=new Set(["AGENTS.md","Dockerfile","LICENSE","Makefile","README"]),St=String.raw`[A-Za-z0-9_.@+-]+`,Un=new RegExp(String.raw`^(?:(?:\.{1,2}|~)?[\\/]|[A-Za-z]:[\\/])?(?:${St}[\\/])+${St}(?::\d+(?::\d+)?)?`),$n=new RegExp(String.raw`^${St}(?::\d+(?::\d+)?)?`),Gn=/^(?:workspace|sandbox):file:[^\s<>()]+/;function rl({projectTargetDetail:r,projectTargetValue:e,workspaceRepoPath:t,workspaceTargetValue:a}){const n=t?.trim();return n||(a!=="local"||!e.startsWith("local:")?null:r.trim()||null)}function Wn(r,e,t={}){if(!Kn(r[e-1]))return null;const a=r.slice(e),n=Gn.exec(a),i=n?null:Un.exec(a),o=n||i?null:$n.exec(a),u=ua((n??i??o)?.[0]??"");if(!u)return null;const c=Me(u,t);return c?{...c,end:e+u.length}:null}function Me(r,e={}){const t=ua(r.trim().replace(/^['"`]+|['"`]+$/g,""));if(!t||/^https?:\/\//i.test(t))return null;const n=Xn(Vn(t)).replace(/:\d+(?::\d+)?$/,"");return Zn(n.replace(/(\.html?)[?#].*$/i,"$1"))?{displayPath:t,path:Yn(e.fileBasePath&&!/^(?:workspace|sandbox):file:/i.test(t)&&!/^(?:[~/\\]|[A-Za-z]:|(?:workspace|sandbox):file:)/.test(n)?`${e.fileBasePath.replace(/[\\/]+$/,"")}/${n.replace(/^\.\//,"")}`:n)}:null}function Vn(r){const e=/^(workspace|sandbox):file:(.*)$/i.exec(r);if(!e)return r;const t=e[1]?.toLowerCase();let a=e[2]??"";return t==="sandbox"&&(a=a.replace(/^\/workspace\/app\//,"").replace(/^\/workspace\//,"")),a}function Xn(r){if(!/^file:\/\//i.test(r))return r;try{const e=new URL(r);return decodeURIComponent(e.pathname)+(/\.html?$/i.test(e.pathname)?e.search+e.hash:"")}catch{return r.replace(/^file:\/\//i,"")}}function Yn(r){return r.replace(/\\/g,"/").replace(/^\.\/+/,"")}function Zn(r){if(/[\n\r]/.test(r)||/^[^/\\]*\s/.test(r)||/[=;?<>|]/.test(r))return!1;if(/[\\/]$/.test(r)&&/[^.~/\\]/.test(r))return!0;const e=r.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??r;if(jn.has(e)||/^\.[A-Za-z_]/.test(e))return!0;const t=e.includes(".")?e.split(".").at(-1)?.toLowerCase():null;return!!(t&&Hn.has(t))}function Kn(r){return!r||/[\s([{<"'`]/.test(r)}function ua(r){return r.replace(/[.,;!?]+$/,"").replace(/[\])}]+$/,"")}function Jn(r){return/^(?:#{1,6}\s*)?(?:\*\*)?(?:(?:the|both|all)\s+)?(?:updated\s+)?(?:files|outputs|deliverables|everything|slide\s+and\s+deck)(?:\*\*)?\s*(?:(?:is|are)\s+)?(?:\(\s*)?(?:in|at|under|:)\s*`((?:~[\/]|[\/]|[A-Za-z]:[\/])[^`\n]+[\/])`/i.exec(r.trim())?.[1]??null}function Qn(r,e){return ha(r,e).url}function ha(r,e){const t=U.useCallback(()=>$e.signLocalImageUrl(r,{path:e}),[r,e]);return sa(r,r&&e?oe(r,"local-image",e):null,t)}function _n(r){const[,e]=U.useState(0),t=U.useCallback(n=>!r||!n?null:(M0.activateConnection(r),M0.get(oe(r,"local-image",n))),[r]),a=U.useCallback(async n=>{if(!r||!n)return null;M0.activateConnection(r);const i=oe(r,"local-image",n);return M0.load(i,()=>$e.signLocalImageUrl(r,{path:n})).finally(()=>e(o=>o+1))},[r]);return U.useMemo(()=>({getUrl:t,loadUrl:a}),[t,a])}function He(r){const e=r.replace(/\r\n/g,`
|
|
1
|
+
import{e as T0,g as ia,at as M0,au as oe,W as $e,aE as bn,bp as yn,X as wn,aF as z0,bJ as A0,bK as xn,y as kn}from"./App-nzE7JU_O.js";import{r as U,j as B}from"./index-Di1MU6Xr.js";const Sn=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Xs=T0("archive",Sn);const Mn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ys=T0("arrow-right",Mn);const zn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zs=T0("chevron-up",zn);const An=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Tn=T0("code-xml",An);const Cn=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bn=T0("copy",Cn);const In=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Ks=T0("file",In);const Dn=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Js=T0("pause",Dn);const En=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Qs=T0("trash-2",En);const Nn=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],_s=T0("workflow",Nn);const qn=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],Rn=T0("text-wrap",qn),dr=r=>/\.html?(?:[?#].*)?$/i.test(r);async function el(r,e,t,a="local"){return(await ia(r,`/v1/${a==="sandbox"?"sandboxes":"workspaces"}/${encodeURIComponent(e)}/html-preview`,{method:"POST",body:JSON.stringify({path:t})})).url}async function tl(r,e,t){return(await ia(r,"/v1/html-previews",{method:"POST",body:JSON.stringify({name:e,content:t})})).url}function sa(r,e,t){const[a,n]=U.useState({key:e,url:null,status:"loading"}),i=U.useRef(null);U.useEffect(()=>{if(!r||!e)return;M0.activateConnection(r);const u=M0.watch(e,t,d=>n({...d,key:e}));i.current=u;const c=()=>{document.visibilityState!=="hidden"&&u.refresh()};return window.addEventListener("focus",c),window.addEventListener("openpond-runtime-connected",c),document.addEventListener("visibilitychange",c),()=>{u.close(),i.current=null,window.removeEventListener("focus",c),window.removeEventListener("openpond-runtime-connected",c),document.removeEventListener("visibilitychange",c)}},[r,e,t]);const o=U.useCallback(()=>i.current?.refresh(!0),[]);return{...a.key===e&&r&&e?a:{url:null,status:"loading"},retry:o}}function la(r,e,t){return/^(?:[~/\\]|[A-Za-z]:|file:\/\/)/.test(t)?$e.signLocalImageUrl(r,{path:t}):$e.signWorkspaceImageUrl(r,{appId:e,path:t})}function Ln(r,e,t){return oa(r,e,t).url}function oa(r,e,t){const a=U.useCallback(()=>la(r,e,t),[r,e,t]);return sa(r,r&&e&&t?oe(r,"workspace-image",e,t):null,a)}function On(r){const[,e]=U.useState(0),t=U.useCallback((i,o)=>!r||!i||!o?null:(M0.activateConnection(r),M0.get(oe(r,"workspace-image",i,o))),[r]),a=U.useCallback(async(i,o)=>{if(!r||!i||!o)return null;M0.activateConnection(r);const u=oe(r,"workspace-image",i,o);return M0.load(u,()=>la(r,i,o)).finally(()=>e(c=>c+1))},[r]),n=U.useCallback((i,o)=>{a(i,o)},[a]);return U.useMemo(()=>({ensureUrl:n,getUrl:t,loadUrl:a}),[n,t,a])}async function Fn(r,e){const t=window.openpond?.files?.saveImage;if(t){const d=await t({url:new URL(r,window.location.href).href,suggestedName:e});if(!d.ok&&!d.canceled)throw new Error(d.error||"Could not save image.");return}const a=window.showSaveFilePicker;let n;try{n=a?await a.call(window,{suggestedName:e}):void 0}catch(d){if(d instanceof DOMException&&d.name==="AbortError")return;throw d}const i=await fetch(r);if(!i.ok)throw new Error(`Image download failed (${i.status}).`);const o=await i.blob();if(n){const d=await n.createWritable();try{await d.write(o),await d.close()}catch(f){throw await d.abort().catch(()=>{}),f}return}const u=URL.createObjectURL(o),c=document.createElement("a");c.href=u,c.download=e,document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(u),6e4)}function Pn({open:r,src:e,title:t,onClose:a}){const[n,i]=U.useState(!1),[o,u]=U.useState(!1),[c,d]=U.useState(null);if(U.useEffect(()=>{if(!r)return;const y=w=>{w.key==="Escape"&&a()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[a,r]),U.useEffect(()=>{i(!1),d(null)},[e]),!r||!e)return null;const f=(()=>{const y=t.split("/").pop()?.trim();if(y&&/\.[A-Za-z0-9]+$/.test(y))return y;try{const w=new URL(e,window.location.href),z=(w.searchParams.get("path")??w.searchParams.get("storageName")??w.pathname).split(/[\\/]/).pop()?.trim();if(z&&/\.[A-Za-z0-9]+$/.test(z))return z}catch{}return"image.png"})(),b=async()=>{if(!o){u(!0),d(null);try{await Fn(e,f)}catch(y){d(y instanceof Error?y.message:"Could not save image.")}finally{u(!1)}}};return bn.createPortal(B.jsx("div",{className:"image-lightbox-backdrop",role:"presentation",onMouseDown:y=>{y.target===y.currentTarget&&a()},children:B.jsxs("section",{"aria-label":t?`Image preview: ${t}`:"Image preview","aria-modal":"true",className:"image-lightbox-dialog",role:"dialog",children:[B.jsxs("header",{className:"image-lightbox-header",children:[B.jsx("span",{title:t,children:t}),B.jsxs("div",{className:"image-lightbox-actions",children:[B.jsx("button",{type:"button","aria-label":"Download image",title:"Download",disabled:o,"aria-busy":o,onClick:b,children:B.jsx(yn,{size:16})}),B.jsx("button",{type:"button","aria-label":"Close image preview",title:"Close",onClick:a,children:B.jsx(wn,{size:16})})]})]}),c&&B.jsx("div",{className:"image-lightbox-error",role:"alert",children:c}),B.jsx("div",{className:"image-lightbox-frame",children:n?B.jsx("div",{className:"image-lightbox-error",children:"Image preview unavailable"}):B.jsx("img",{alt:t||"Image preview",decoding:"async",draggable:!1,src:e,onError:()=>i(!0)})})]})}),document.body)}async function kt(r){if(!r)return!1;try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(r),!0}catch(e){console.warn("Clipboard write failed",e)}try{const e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.style.position="fixed",e.style.left="-1000px",e.style.top="-1000px",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return e.remove(),t}catch(e){return console.warn("Clipboard fallback failed",e),!1}}const Hn=new Set(["bash","c","cc","cjs","cpp","css","csv","docx","env","gif","go","graphql","h","hpp","html","htm","ico","java","jpeg","jpg","js","json","jsx","lock","lockb","md","mdx","m4v","mjs","mov","mp4","pdf","pptx","png","py","rs","scss","sh","sql","svg","toml","ts","tsx","txt","xlsx","webp","webm","yaml","yml","zsh"]),jn=new Set(["AGENTS.md","Dockerfile","LICENSE","Makefile","README"]),St=String.raw`[A-Za-z0-9_.@+-]+`,Un=new RegExp(String.raw`^(?:(?:\.{1,2}|~)?[\\/]|[A-Za-z]:[\\/])?(?:${St}[\\/])+${St}(?::\d+(?::\d+)?)?`),$n=new RegExp(String.raw`^${St}(?::\d+(?::\d+)?)?`),Gn=/^(?:workspace|sandbox):file:[^\s<>()]+/;function rl({projectTargetDetail:r,projectTargetValue:e,workspaceRepoPath:t,workspaceTargetValue:a}){const n=t?.trim();return n||(a!=="local"||!e.startsWith("local:")?null:r.trim()||null)}function Wn(r,e,t={}){if(!Kn(r[e-1]))return null;const a=r.slice(e),n=Gn.exec(a),i=n?null:Un.exec(a),o=n||i?null:$n.exec(a),u=ua((n??i??o)?.[0]??"");if(!u)return null;const c=Me(u,t);return c?{...c,end:e+u.length}:null}function Me(r,e={}){const t=ua(r.trim().replace(/^['"`]+|['"`]+$/g,""));if(!t||/^https?:\/\//i.test(t))return null;const n=Xn(Vn(t)).replace(/:\d+(?::\d+)?$/,"");return Zn(n.replace(/(\.html?)[?#].*$/i,"$1"))?{displayPath:t,path:Yn(e.fileBasePath&&!/^(?:workspace|sandbox):file:/i.test(t)&&!/^(?:[~/\\]|[A-Za-z]:|(?:workspace|sandbox):file:)/.test(n)?`${e.fileBasePath.replace(/[\\/]+$/,"")}/${n.replace(/^\.\//,"")}`:n)}:null}function Vn(r){const e=/^(workspace|sandbox):file:(.*)$/i.exec(r);if(!e)return r;const t=e[1]?.toLowerCase();let a=e[2]??"";return t==="sandbox"&&(a=a.replace(/^\/workspace\/app\//,"").replace(/^\/workspace\//,"")),a}function Xn(r){if(!/^file:\/\//i.test(r))return r;try{const e=new URL(r);return decodeURIComponent(e.pathname)+(/\.html?$/i.test(e.pathname)?e.search+e.hash:"")}catch{return r.replace(/^file:\/\//i,"")}}function Yn(r){return r.replace(/\\/g,"/").replace(/^\.\/+/,"")}function Zn(r){if(/[\n\r]/.test(r)||/^[^/\\]*\s/.test(r)||/[=;?<>|]/.test(r))return!1;if(/[\\/]$/.test(r)&&/[^.~/\\]/.test(r))return!0;const e=r.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??r;if(jn.has(e)||/^\.[A-Za-z_]/.test(e))return!0;const t=e.includes(".")?e.split(".").at(-1)?.toLowerCase():null;return!!(t&&Hn.has(t))}function Kn(r){return!r||/[\s([{<"'`]/.test(r)}function ua(r){return r.replace(/[.,;!?]+$/,"").replace(/[\])}]+$/,"")}function Jn(r){return/^(?:#{1,6}\s*)?(?:\*\*)?(?:(?:the|both|all)\s+)?(?:updated\s+)?(?:files|outputs|deliverables|everything|slide\s+and\s+deck)(?:\*\*)?\s*(?:(?:is|are)\s+)?(?:\(\s*)?(?:in|at|under|:)\s*`((?:~[\/]|[\/]|[A-Za-z]:[\/])[^`\n]+[\/])`/i.exec(r.trim())?.[1]??null}function Qn(r,e){return ha(r,e).url}function ha(r,e){const t=U.useCallback(()=>$e.signLocalImageUrl(r,{path:e}),[r,e]);return sa(r,r&&e?oe(r,"local-image",e):null,t)}function _n(r){const[,e]=U.useState(0),t=U.useCallback(n=>!r||!n?null:(M0.activateConnection(r),M0.get(oe(r,"local-image",n))),[r]),a=U.useCallback(async n=>{if(!r||!n)return null;M0.activateConnection(r);const i=oe(r,"local-image",n);return M0.load(i,()=>$e.signLocalImageUrl(r,{path:n})).finally(()=>e(o=>o+1))},[r]);return U.useMemo(()=>({getUrl:t,loadUrl:a}),[t,a])}function He(r){const e=r.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),t=[];let a=[],n=[],i=[],o=!1,u,c=null,d,f=0,b=null;function y(){a.length!==0&&(t.push({type:"paragraph",content:a.join(`
|
|
4
4
|
`).trim()}),a=[])}function w(){n.length!==0&&(t.push({type:"blockquote",content:n.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-Di1MU6Xr.js";import{L as o,bZ as c,X as n}from"./App-nzE7JU_O.js";import{M as d}from"./minimize-2-DwUgqXoR.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-mIy6FzCj.js → NewExperienceSwitcher-DXKzoMaM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./index-
|
|
1
|
+
import{j as a}from"./index-Di1MU6Xr.js";import{cj as i}from"./App-nzE7JU_O.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-Di1MU6Xr.js";import{X as z,z as B,F as D}from"./App-nzE7JU_O.js";import{F as $}from"./folder-open-B-DFLDFH.js";import{F as w}from"./folder-plus-CPXxPvSH.js";import{M as q}from"./monitor-Ihu5LVYx.js";function Q({open:h,mode:N="local",name:i,path:f,directory:S,busy:a,onNameChange:x,onPathChange:v,onClose:g,onSubmit:A}){const[o,y]=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}y(s=>[...s,r]),u||b(r),i.trim()||x(r.split(/[\\/]/).filter(Boolean).at(-1)??r),d||(v(""),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(z,{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(D,{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(D,{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:()=>{y(r=>{const s=r.filter(m=>m!==t);return u===t&&b(s[0]??""),s})},children:e.jsx(z,{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=>v(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as e}from"./index-Di1MU6Xr.js";import{W,bA as E,bp as D,X as B,L as R}from"./App-nzE7JU_O.js";import{s as M,r as z,C as K,F as X}from"./MarkdownText-Drjq6-JM.js";import{F as q,I as H,d as Y,e as V,f as G}from"./MainPane-DCz38-qy.js";import{F as J}from"./folder-open-B-DFLDFH.js";import"./arrow-up-right-DCWPxdbD.js";import"./cloud-upload-DpaGFZ9J.js";import"./square-DXtoCBNw.js";import"./play-D_YGCdxU.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),A=U.type==="text"||U.type==="html";l?.objectUrl&&URL.revokeObjectURL(l.objectUrl),T({file:N,objectUrl:A?null:URL.createObjectURL(N),output:n,text:A?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(E,{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(E,{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"?Y:t==="table"?V: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-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
|
+
import{j as e,r as h}from"./index-Di1MU6Xr.js";import{fj as ee,W as L,x as te,aP as M,aH as F,c2 as _,b7 as H,bw as A,z as W,bb as $}from"./App-nzE7JU_O.js";import{C as O}from"./cloud-upload-DpaGFZ9J.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 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(O,{"aria-hidden":"true",size:14}),e.jsx("span",{children:"Upload"})]}):null,w?e.jsxs("button",{onClick:()=>{k(w)},type:"button",children:[e.jsx(M,{"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(H,{"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(W,{"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(W,{"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(O,{"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(H,{"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:I(r)}),e.jsx(M,{"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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as o}from"./index-Di1MU6Xr.js";import{F as ke}from"./folder-open-B-DFLDFH.js";import{fl as Re,fm as Ie,fn as je,fo as ye,ar as Ce,aT as Pe,b4 as Te,fp as Se,aU as Ae,aV as Me,aZ as Ne,aW as Ee,X as Fe,v as $e,b9 as De}from"./App-nzE7JU_O.js";import{u as Be,a as Le}from"./useSessionTurnCache-DLF5SPD-.js";import{g as Oe,u as Ue,h as qe,i as ze,j as He,T as Ke,M as Ve,A as We,k as Qe}from"./MainPane-DCz38-qy.js";import"./MarkdownText-Drjq6-JM.js";import"./arrow-up-right-DCWPxdbD.js";import"./cloud-upload-DpaGFZ9J.js";import"./square-DXtoCBNw.js";import"./play-D_YGCdxU.js";function Ge({panel:t,runtimeEventStore:O,actionCatalog:y,createImproveActions:C,contextCompaction:P,steerActiveResponses:U,initialScrollState:p,codexPermissionMode:q,codexReasoningEffort:z,openPondCommandAccessMode:T,connection:k,connectedAppMentions:H,mentionApps:K,codexPersonalSkills:V,profileSkills:W,profileTarget:S,projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:Z,billingTeamId:_,showToast:J,workspaceTarget:Y,onCodexPermissionModeChange:ee,onCodexReasoningEffortChange:te,onOpenPondCommandAccessModeChange:A,onModelChange:se,onOpenAttachmentInSidebar:oe,onOpenFileInSidebar:ie,onOpenProfileSettings:ne,onOpenSession:re,onOpenPonder:ae,onProviderChange:ce,onProviderSetupOpen:de,onPromptChange:le,onProfileTargetChange:ue,onScrollStateChange:he,onProjectTargetChange:fe,onResolveApproval:me,onShowBrowserPanel:M,onStop:pe,onSubmit:b,onWorkspaceTargetChange:ge}){const x=r.useRef(null),[g]=r.useState(()=>new Oe),w=r.useRef(p?.stickyToBottom??!0),N=r.useRef(!1),R=Ue(O,t.runtimeSource==="live"?t.sessionId:null),s=r.useMemo(()=>{if(t.runtimeSource==="history"||!t.sessionId)return t;const i=R.events,a=Re(i,[]);return{...t,messages:Pe(g.project(i),t.pendingUserMessage),createImproveRun:Ce({events:i}),contextWindowStatus:je({provider:t.provider,snapshot:ye(a,t.sessionId),preferences:P}),goalRuntime:Ie(a,t.sessionId)}},[g,P,R,t]),u=s.running&&!s.pendingApproval&&qe(s.messages),f=r.useMemo(()=>s.createImproveRun?{...C,run:s.createImproveRun}:null,[s.createImproveRun,C]),E=r.useMemo(()=>ze(s.messages,{showThinkingIndicator:u}),[s.messages,u]),F=Be(s.messages,s.sessionId??`draft:${s.id}`),m=s.messages.at(-1),I=Le({connection:k,latestTurnId:m?.turnId??null,sessionId:s.sessionId,turnRunning:s.running}),$=[s.id,s.sessionId??"draft",E.length,m?.id??"",m?.content?.length??0,m?.timestamp??"",u?"thinking":""].join(":");r.useLayoutEffect(()=>{const i=x.current;!i||N.current||(N.current=!0,i.scrollTop=p?.stickyToBottom?i.scrollHeight:p?.scrollTop??0)},[p]),He({contentKey:$,onContentChange:i=>{w.current&&(i.scrollTop=i.scrollHeight)},threadRef:x});const D=r.useCallback((i,a)=>{const v=s.sessionId??`side-chat:${s.id}`;Te({conversationId:v,href:i,explicitFile:a?.explicitFile,newTab:a?.newTab}).then(B=>{B&&M()})},[s.id,s.sessionId,M]),d=r.useCallback(async(i,a)=>{const v=a.action==="answer"?a.text:"Dismiss this question";if(!await b([],null,null,{displayPrompt:v,promptOverride:v,turnMetadata:{userQuestionResolution:a}}))throw new Error("The question response could not be sent.")},[b]);return o.jsxs("section",{className:`right-chat-pane ${s.pendingApproval?"has-approval":""}`,id:`right-chat-panel-${s.id}`,role:"tabpanel","aria-labelledby":`right-chat-tab-${s.id}`,children:[o.jsx("div",{className:"chat-thread right-chat-thread",ref:x,onScroll:i=>{const a=i.currentTarget;w.current=a.scrollHeight-a.scrollTop-a.clientHeight<=72,he({scrollTop:a.scrollTop,stickyToBottom:w.current})},children:E.map(i=>i.type==="thinking"?o.jsx(Ke,{},i.id):o.jsx(Ve,{activeWorkspaceAppId:s.activeWorkspaceAppId,accountBaseUrl:X,billingOrganizationSlug:Z,billingTeamId:_,connection:k,animateInitialContent:i.message.role==="assistant"&&F.has(i.message.id),kvCacheSummary:i.showFooter&&i.message.turnId?I.get(i.message.turnId)??null:null,message:i.message,onOpenBrowserLink:D,onOpenAttachmentInSidebar:oe,onOpenFileInSidebar:ie,onOpenProfileSettings:ne,onResolveUserQuestion:d,onOpenSession:re,onOpenPonder:ae,userAttachmentDisplay:t.provider==="codex"?"compact":"full",workspaceRootPath:s.workspaceRootPath,showFooter:i.showFooter},i.id))}),o.jsxs("div",{className:`composer-stack dock right-chat-composer ${s.pendingApproval?"has-approval":""}`,children:[o.jsx(We,{approval:s.pendingApproval,onResolve:me}),o.jsx(Qe,{mode:"dock",prompt:t.prompt,mentionApps:K,connectedAppMentions:H,profileSkills:t.provider==="codex"?V:W,profileTarget:t.provider==="codex"?null:S,selectedMentionAppId:null,contextWindowStatus:s.contextWindowStatus,goalRuntime:s.goalRuntime,createImproveRuntime:f,busy:s.running,running:s.running,steerActiveResponses:U,taskSessionId:t.runtimeSource==="live"?t.sessionId:null,taskEvents:R.events,submissionScopeKey:s.sessionId??s.id,showProjectFooter:!1,connection:k,providerSettings:G,provider:t.provider,model:t.model,projectTarget:Q,actionCatalog:y,workspaceTarget:Y,codexPermissionMode:q,codexReasoningEffort:z,openPondCommandAccessMode:t.provider==="codex"?T:s.session?.openPondCommandAccessMode??T,onProviderChange:ce,onProviderSetupOpen:de,onProjectTargetChange:fe,onWorkspaceTargetChange:ge,onModelChange:se,onCodexPermissionModeChange:ee,onCodexReasoningEffortChange:te,onOpenPondCommandAccessModeChange:A,onPromptChange:le,onProfileTargetChange:ue,onMentionAppSelect:void 0,showToast:J,onSubmit:b,onStop:pe})]})]})}function nt({panels:t,runtimeEventStore:O,actionCatalog:y=[],createImproveActions:C,contextCompaction:P,steerActiveResponses:U,busy:p,codexPermissionMode:q,codexReasoningEffort:z,openPondCommandAccessMode:T,connection:k,connectedAppMentions:H,mentionApps:K,codexPersonalSkills:V,profileSkills:W=[],profileLibrary:S={lastUsed:null,profiles:[]},extensionCatalog:Q,projectTarget:G,providerSettings:X,accountBaseUrl:Z,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:ee,onAddChat:te,onActivatePanel:A,onClosePanel:se,onCodexPermissionModeChange:oe,onCodexReasoningEffortChange:ie,onOpenPondCommandAccessModeChange:ne,onModelChange:re,onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:ce,onOpenProfileSettings:de,onOpenSession:le,onOpenPonder:ue,onProviderChange:he,onProviderSetupOpen:fe,onPromptChange:me,onProfileTargetChange:M,onScrollStateChange:pe,onProjectTargetChange:b,onResolveApproval:ge,onResizeStart:x,onSelectFiles:g,onShowBrowserPanel:w,onStop:N,onSubmit:R,onWorkspaceTargetChange:s}){const[u,f]=r.useState(!1),[E,F]=r.useState(()=>Se(t)?.id??null),m=r.useRef(null),I=r.useRef(new Map),$=r.useRef(new Set(t.map(e=>e.id))),D=r.useRef(new Map(t.map(e=>[e.id,e.activationVersion]))),d=t.find(e=>e.id===E)??t.at(-1)??null,i=d?.session?.currentProfile??S.lastUsed,a=Ae(S,i),v=a?Me(a,Q):W,B=a?[...y.filter(e=>!Ne(e)),...Ee(a)]:y;r.useEffect(()=>{const e=$.current,l=D.current;let c=null,h=null;for(const n of t)e.has(n.id)||(c=n),e.has(n.id)&&n.activationVersion>(l.get(n.id)??0)&&(h=n);$.current=new Set(t.map(n=>n.id)),D.current=new Map(t.map(n=>[n.id,n.activationVersion])),F(n=>h?h.id:c?c.id:n&&t.some(L=>L.id===n)?n:t.at(-1)?.id??null)},[t]),r.useEffect(()=>{if(!u)return;function e(c){m.current?.contains(c.target)||f(!1)}function l(c){c.key==="Escape"&&f(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",l),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",l)}},[u]);const j=r.useCallback((e,l=!1)=>{F(e),A(e),l&&window.requestAnimationFrame(()=>I.current.get(e)?.focus())},[A]),ve=r.useCallback((e=!1)=>{g(),e&&window.requestAnimationFrame(()=>{document.getElementById("right-sidebar-files-tab")?.focus()})},[g]),be=r.useCallback((e,l)=>{const c=t.findIndex(we=>we.id===l);if(c<0)return;const h=c+1;let n=null;if(e.key==="ArrowRight"&&(n=(h+1)%(t.length+1)),e.key==="ArrowLeft"&&(n=(h-1+t.length+1)%(t.length+1)),e.key==="Home"&&(n=0),e.key==="End"&&(n=t.length),n===null)return;if(e.preventDefault(),n===0){ve(!0);return}const L=t[n-1];L&&j(L.id,!0)},[t,ve,j]),xe=r.useCallback(e=>{if(!["ArrowRight","ArrowLeft","Home","End"].includes(e.key)||(e.preventDefault(),e.key==="Home"))return;const l=e.key==="ArrowLeft"||e.key==="End"?t.at(-1):t[0];l&&j(l.id,!0)},[t,j]);return o.jsxs("aside",{className:"workspace-diff-panel right-chat-panel-stack","aria-label":"Side chats",children:[o.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize side chat panel",onPointerDown:x}),o.jsx("div",{className:"workspace-diff-topbar right-chat-topbar",children:o.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:[o.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:[o.jsx(ke,{size:14}),o.jsx("span",{children:"Files"})]}),t.map(e=>{const l=e.id===d?.id;return o.jsxs("div",{className:`workspace-diff-tab right-chat-tab ${l?"active":""}`,children:[o.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":l,tabIndex:l?0:-1,title:e.title,ref:c=>{c?I.current.set(e.id,c):I.current.delete(e.id)},onClick:()=>j(e.id),onKeyDown:c=>be(c,e.id),children:[e.running?o.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,o.jsx("span",{children:e.title})]}),o.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:c=>{c.stopPropagation(),se(e.id)},children:o.jsx(Fe,{size:12})})]},e.id)}),o.jsxs("div",{className:"workspace-diff-add-anchor",ref:m,children:[o.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:()=>f(e=>!e),children:o.jsx($e,{size:15})}),u?o.jsxs("div",{className:"workspace-diff-add-menu right-chat-add-popover",role:"menu",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{f(!1),te()},children:[o.jsx(De,{size:13}),o.jsx("span",{children:"New task"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{f(!1),g()},children:[o.jsx(ke,{size:13}),o.jsx("span",{children:"Files"})]})]}):null]})]})}),o.jsx("div",{className:"right-chat-stack-body panes-1",children:d?o.jsx(Ge,{busy:p,createImproveActions:C,contextCompaction:P,steerActiveResponses:U,codexPermissionMode:q,codexReasoningEffort:z,openPondCommandAccessMode:T,connection:k,connectedAppMentions:H,actionCatalog:B,mentionApps:K,codexPersonalSkills:V,profileSkills:v,profileTarget:null,panel:d,runtimeEventStore:O,initialScrollState:{scrollTop:d.scrollTop,stickyToBottom:d.stickyToBottom},projectTarget:G,providerSettings:X,accountBaseUrl:Z,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:ee,onCodexPermissionModeChange:oe,onCodexReasoningEffortChange:ie,onOpenPondCommandAccessModeChange:e=>ne(e,d.session),onModelChange:e=>re(d.id,e),onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:ce,onOpenProfileSettings:de,onOpenSession:le,onOpenPonder:ue,onProviderChange:e=>he(d.id,e),onProviderSetupOpen:fe,onPromptChange:e=>me(d.id,e),onProfileTargetChange:e=>M(d.sessionId,e),onScrollStateChange:e=>pe(d.id,e),onProjectTargetChange:b,onResolveApproval:ge,onShowBrowserPanel:w,onStop:()=>N(d.sessionId),onSubmit:(e,l,c,h)=>R(d.id,e,l,c,h),onWorkspaceTargetChange:s},d.id):null})]})}export{nt as RightChatPanelStack};
|
package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-Bd_AHUp8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-Di1MU6Xr.js";import{aD as f,bZ as x,aK as j,b9 as u,bz as k,a1 as g}from"./App-nzE7JU_O.js";import{C as w}from"./clipboard-B-GnMVLp.js";import{F as S}from"./folder-open-B-DFLDFH.js";import{M as v}from"./minimize-2-DwUgqXoR.js";function y({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{y as RightSidebarHomePanel};
|
|
@@ -1 +1 @@
|
|
|
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};
|
|
1
|
+
import{r as o,j as e}from"./index-Di1MU6Xr.js";import{W as E,Y as Re,bA as Ce,fi as Ae,bZ as Te,X as $e,aP as xe,x as De,bt as X,a5 as ee,V as Ee,be as U,aB as Ie,aI as We}from"./App-nzE7JU_O.js";import{u as Me}from"./useLocalAgentSchedules-BFoH_gwZ.js";import{a as Pe,P as le,T as pe}from"./MarkdownText-Drjq6-JM.js";import{P as ae}from"./play-D_YGCdxU.js";import{S as ze}from"./save-DJYUOhtD.js";import{M as Le}from"./minimize-2-DwUgqXoR.js";import{r as Fe,c as Ze,b as Oe}from"./MainPane-DCz38-qy.js";import"./arrow-up-right-DCWPxdbD.js";import"./cloud-upload-DpaGFZ9J.js";import"./square-DXtoCBNw.js";import"./folder-open-B-DFLDFH.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 Y(s.replaceAll("_"," "))}function Y(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 Be({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 Ye({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:[Y(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 W({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(Y).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(W,{label:"Runs in",value:a.sessionTitle}),e.jsx(W,{label:"Cadence",value:re(a.recurrence)}),e.jsx(W,{label:"Next run",value:M(a.nextRunAt,a.recurrence.timeZone)}),e.jsx(W,{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:Y(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:Oe(),file:y,name:y.name,mediaType:y.type||"application/octet-stream",sizeBytes:y.size,kind:Ze(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)=>Z(n.schedule.nextRunAt)-Z(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)=>Z(n.nextRunAt)-Z(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=Z(ue(l)),p=Z(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:B(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 B(s){return`hosted:${s}`}function Z(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=>B(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,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&&!I&&!D&&!z&&!h&&A(null)},[h,D,S,I,z,u]),o.useEffect(()=>{!l&&u&&A(null)},[l,u]),o.useEffect(()=>()=>x(!1),[x]);function O(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||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(Ie,{className:m?"scheduled-spin":void 0,size:16})}),e.jsxs("label",{className:"scheduled-filter",children:[e.jsx(We,{"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:O,selectedKey:u}):e.jsxs("div",{className:"scheduled-list-rows",children:[k?.workflows.map(i=>e.jsx(es,{entry:i,onSelect:()=>O(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:()=>O(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:()=>O(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:()=>O(B(i.row.schedule.id)),schedule:i.row.schedule,selected:u===B(i.row.schedule.id)},B(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):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(W,{label:"Environment",value:"Local"}),e.jsx(W,{label:"Project",value:r.localProjectName}),e.jsx(W,{label:"Agent",value:r.agentName}),e.jsx(W,{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(W,{label:"Cadence",value:ge(r)}),e.jsx(W,{label:"Expression",value:r.scheduleExpression}),e.jsx(W,{label:"Timezone",value:r.timezone??"Local time"}),e.jsx(W,{label:"Next run",value:M(r.nextRunAt,r.timezone)}),e.jsx(W,{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(Be,{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,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")||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:Y(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||!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(Ye,{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};
|