openpond 0.2.54 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +10823 -9118
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-QU4H53OG.js +2 -0
- package/dist/chunks/{app-layer-I7MZYVLL.js → app-layer-NSTE5HIT.js} +1 -1
- package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
- package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
- package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
- package/dist/chunks/app-server-runtime-DVKOZ5B6.js +2 -0
- package/dist/chunks/apps-BKTOR4F7.js +2 -0
- package/dist/chunks/chunk-25MBPJVY.js +2 -0
- package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
- package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
- package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
- package/dist/chunks/chunk-3K4VVB7S.js +6 -0
- package/dist/chunks/chunk-3QIB5FXI.js +10 -0
- package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
- package/dist/chunks/chunk-3VUATFZD.js +2 -0
- package/dist/chunks/chunk-3Z47M3YY.js +2 -0
- package/dist/chunks/{chunk-GXSTZBM6.js → chunk-4D7HWVWD.js} +1 -1
- package/dist/chunks/chunk-4EPSHPZL.js +2 -0
- package/dist/chunks/chunk-4NESNOK5.js +2 -0
- package/dist/chunks/chunk-523TE4BI.js +2 -0
- package/dist/chunks/chunk-5MCNZCVQ.js +2 -0
- package/dist/chunks/chunk-6QSSIT62.js +2 -0
- package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
- package/dist/chunks/chunk-74IIXVAE.js +2 -0
- package/dist/chunks/chunk-74ZXXBGN.js +6 -0
- package/dist/chunks/chunk-773TH7FN.js +2 -0
- package/dist/chunks/chunk-7E6T7GP5.js +2 -0
- package/dist/chunks/chunk-7ED24PP6.js +2 -0
- package/dist/chunks/chunk-7HPDGZOR.js +86 -0
- package/dist/chunks/chunk-7KWD2I6W.js +2 -0
- package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
- package/dist/chunks/chunk-A6USMRWK.js +2 -0
- package/dist/chunks/chunk-ABD5M2D2.js +2 -0
- package/dist/chunks/chunk-ACYFMLWG.js +10 -0
- package/dist/chunks/chunk-AN525SPP.js +6 -0
- package/dist/chunks/chunk-APB2STJK.js +2 -0
- package/dist/chunks/chunk-AY64VY4E.js +2 -0
- package/dist/chunks/{chunk-UJ5EFSEC.js → chunk-B7RFL4N2.js} +1 -1
- package/dist/chunks/chunk-BFKYRQMA.js +2 -0
- package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
- package/dist/chunks/chunk-D74JEERO.js +5 -0
- package/dist/chunks/{chunk-PA7XP42P.js → chunk-DARVPBZ4.js} +1 -1
- package/dist/chunks/chunk-DBK66CJP.js +8 -0
- package/dist/chunks/chunk-DDMZSZFL.js +1 -0
- package/dist/chunks/chunk-DIO5CB6U.js +2 -0
- package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
- package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
- package/dist/chunks/chunk-DUURYZOI.js +2 -0
- package/dist/chunks/chunk-DZUAT3TP.js +1 -0
- package/dist/chunks/chunk-EIEZHFIW.js +6 -0
- package/dist/chunks/chunk-EIRYMSEG.js +19 -0
- package/dist/chunks/{chunk-JDLAHVAJ.js → chunk-EKM2D7JU.js} +1 -1
- package/dist/chunks/chunk-EQFGBL3O.js +2 -0
- package/dist/chunks/chunk-EYPCBBMS.js +2 -0
- package/dist/chunks/chunk-F4KOGISR.js +10 -0
- package/dist/chunks/chunk-F74GBN6K.js +2 -0
- package/dist/chunks/chunk-FEAKTSRS.js +2 -0
- package/dist/chunks/chunk-FFRFSDBM.js +2 -0
- package/dist/chunks/chunk-FTEOCCPB.js +23 -0
- package/dist/chunks/chunk-FUOEIDMA.js +8 -0
- package/dist/chunks/{chunk-AH22RHPS.js → chunk-FV2R5RUN.js} +2 -2
- package/dist/chunks/chunk-FWIPHEVA.js +12 -0
- package/dist/chunks/chunk-FY5KHLMW.js +2 -0
- package/dist/chunks/chunk-G3RXYI2L.js +6 -0
- package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
- package/dist/chunks/chunk-GLDYJM7O.js +1 -0
- package/dist/chunks/chunk-GPVCOEUH.js +2 -0
- package/dist/chunks/chunk-GW766ZSO.js +5 -0
- package/dist/chunks/chunk-GWCHDF2C.js +4 -0
- package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
- package/dist/chunks/chunk-H6IW2R22.js +140 -0
- package/dist/chunks/chunk-HCYX6RHP.js +2 -0
- package/dist/chunks/chunk-HDL5YSAA.js +2 -0
- package/dist/chunks/chunk-HIOKCIL7.js +2 -0
- package/dist/chunks/chunk-HY3GOBFJ.js +58 -0
- package/dist/chunks/chunk-HZEIRHEB.js +2 -0
- package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
- package/dist/chunks/chunk-I7AQMAQI.js +33 -0
- package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
- package/dist/chunks/chunk-J2TWKFML.js +1871 -0
- package/dist/chunks/chunk-JDEEWOD7.js +2 -0
- package/dist/chunks/chunk-JFXWI3EN.js +6 -0
- package/dist/chunks/chunk-JYKRR7E5.js +5 -0
- package/dist/chunks/chunk-KCJVFLBB.js +2 -0
- package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
- package/dist/chunks/chunk-KGNCKIFP.js +3 -0
- package/dist/chunks/chunk-KUERKVEU.js +3 -0
- package/dist/chunks/chunk-KVTBX2UP.js +2 -0
- package/dist/chunks/chunk-L6K7ERG5.js +2 -0
- package/dist/chunks/{chunk-N5QNXMIS.js → chunk-LQQNBVEB.js} +1 -1
- package/dist/chunks/{chunk-YJ4PNAST.js → chunk-M4JWQSV7.js} +1 -1
- package/dist/chunks/chunk-MQULU465.js +2 -0
- package/dist/chunks/chunk-N4FFQPLR.js +2 -0
- package/dist/chunks/chunk-N73MU2C3.js +2 -0
- package/dist/chunks/chunk-NHQ36THU.js +3 -0
- package/dist/chunks/{chunk-4SHKI3BH.js → chunk-O6ULLQJ6.js} +1 -1
- package/dist/chunks/chunk-O72BSKSO.js +2 -0
- package/dist/chunks/chunk-OGDADQGH.js +143 -0
- package/dist/chunks/chunk-OIUTWU6K.js +2 -0
- package/dist/chunks/chunk-OLLLZVHF.js +2 -0
- package/dist/chunks/{chunk-XM26DGML.js → chunk-OPNRWESL.js} +1 -1
- package/dist/chunks/chunk-OQKJGTTO.js +4 -0
- package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
- package/dist/chunks/{chunk-R3XFY7VL.js → chunk-OS3LO5J3.js} +1 -1
- package/dist/chunks/{chunk-T5LE6R5S.js → chunk-OSIO7PLX.js} +1 -1
- package/dist/chunks/chunk-OUVIWDL2.js +2 -0
- package/dist/chunks/chunk-PCSIOUHF.js +7 -0
- package/dist/chunks/chunk-PF5R6CMP.js +21 -0
- package/dist/chunks/chunk-PPAPVGJP.js +3 -0
- package/dist/chunks/chunk-PRGBLQVH.js +2 -0
- package/dist/chunks/chunk-PSGGOZFM.js +2 -0
- package/dist/chunks/chunk-PUZQU66L.js +2 -0
- package/dist/chunks/{chunk-WITSXYEW.js → chunk-Q2QL6UWN.js} +1 -1
- package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
- package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
- package/dist/chunks/{chunk-YL6VFJ4P.js → chunk-QDC4OW3S.js} +1 -1
- package/dist/chunks/chunk-QEFHOJFE.js +7 -0
- package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
- package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
- package/dist/chunks/chunk-QNG27G3T.js +6 -0
- package/dist/chunks/chunk-QOGJAQDO.js +3 -0
- package/dist/chunks/chunk-QOTVNQDI.js +4 -0
- package/dist/chunks/{chunk-N3DEA6PG.js → chunk-RAXOSUSW.js} +1 -1
- package/dist/chunks/chunk-RNIAFXMB.js +50 -0
- package/dist/chunks/chunk-S5ESN275.js +42 -0
- package/dist/chunks/chunk-SDAUS5PY.js +2 -0
- package/dist/chunks/chunk-SDXFLO7J.js +5 -0
- package/dist/chunks/chunk-SH5CBAFC.js +2 -0
- package/dist/chunks/chunk-SWUEFLOH.js +2 -0
- package/dist/chunks/chunk-SYUKES6H.js +3 -0
- package/dist/chunks/chunk-T5AACNJI.js +2 -0
- package/dist/chunks/chunk-TRQQNFMO.js +4 -0
- package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
- package/dist/chunks/chunk-UCPGRPWY.js +2 -0
- package/dist/chunks/chunk-UGL7WF3W.js +2 -0
- package/dist/chunks/chunk-UHFZHBGW.js +2 -0
- package/dist/chunks/chunk-UKMA4R6X.js +6 -0
- package/dist/chunks/{chunk-7ZG3IT7C.js → chunk-VRIEKBBH.js} +6 -6
- package/dist/chunks/chunk-VYLGI3IH.js +13 -0
- package/dist/chunks/chunk-W45RKGM6.js +1 -0
- package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
- package/dist/chunks/chunk-WMKYHXVM.js +3 -0
- package/dist/chunks/chunk-WN3V6KDN.js +3 -0
- package/dist/chunks/chunk-X4OSOOSU.js +3 -0
- package/dist/chunks/chunk-XDQMGUWL.js +2 -0
- package/dist/chunks/chunk-XTFPDQMH.js +3 -0
- package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
- package/dist/chunks/chunk-XW6HGSIT.js +8 -0
- package/dist/chunks/chunk-XXYGGNVM.js +2 -0
- package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
- package/dist/chunks/chunk-YBT2NB32.js +2 -0
- package/dist/chunks/chunk-YCJO3YVD.js +10 -0
- package/dist/chunks/{chunk-YD55Z5H3.js → chunk-YOBN7KTF.js} +11 -11
- package/dist/chunks/chunk-YOQRYNLP.js +2 -0
- package/dist/chunks/chunk-YR5ID2SS.js +2 -0
- package/dist/chunks/chunk-YY7LEQGP.js +2 -0
- package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
- package/dist/chunks/chunk-Z54O534A.js +3 -0
- package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
- package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
- package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
- package/dist/chunks/{chunk-NAZ26IZL.js → chunk-ZRDGQDZL.js} +1 -1
- package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
- package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
- package/dist/chunks/cli-X25RSO2X.js +2 -0
- package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
- package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
- package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
- package/dist/chunks/connection-HTF6CC7M.js +2 -0
- package/dist/chunks/{continual-PKK2BOTB.js → continual-6CQAMTTR.js} +3 -3
- package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
- package/dist/chunks/datasets-7BNMVJOY.js +2 -0
- package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
- package/dist/chunks/dist-OMGUJYPD.js +2 -0
- package/dist/chunks/{chunk-6VF3Q6QJ.js → dist-SKYG5LZO.js} +2 -4
- package/dist/chunks/dist-VYC5VMQB.js +2 -0
- package/dist/chunks/dist-ZVJPJLXR.js +2 -0
- package/dist/chunks/enclave-QS4BUNDU.js +2 -0
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
- package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
- package/dist/chunks/experiments-DFGQYA4O.js +2 -0
- package/dist/chunks/experiments-VFQGE4HC.js +2 -0
- package/dist/chunks/extension-XKXXOP5N.js +4 -0
- package/dist/chunks/{help-WLKSACLZ.js → help-S7THC6IE.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-JJQWJUBT.js +2 -0
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
- package/dist/chunks/hosted-app-server-composition-BCOO5ANF.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
- package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
- package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
- package/dist/chunks/human-review-WR777ODH.js +2 -0
- package/dist/chunks/import-MLZUHITH.js +4 -0
- package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +2 -0
- package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +2 -0
- package/dist/chunks/learning-ACEVFL5M.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
- package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
- package/dist/chunks/model-projects-QPO22JPA.js +2 -0
- package/dist/chunks/opchat-T4QTNEIY.js +3 -0
- package/dist/chunks/organizations-75L5DZDV.js +2 -0
- package/dist/chunks/profile-TFZMUEDR.js +3 -0
- package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
- package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
- package/dist/chunks/project-agent-6RRO233B.js +2 -0
- package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
- package/dist/chunks/runtime-A7OZXM43.js +6 -0
- package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
- package/dist/chunks/{sandbox-template-BBGGPJMI.js → sandbox-template-C4V6T36U.js} +1 -1
- package/dist/chunks/saved-work-6BMBFP43.js +2 -0
- package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
- package/dist/chunks/sql-execution-process-source-B4HQM6ZV.js +2 -0
- package/dist/chunks/src-CJM6HY5Y.js +326 -0
- package/dist/chunks/{src-CR6UZYTX.js → src-LMC3K6LH.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
- package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
- package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
- package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
- package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
- package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
- package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
- package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
- package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
- package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
- package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
- package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
- package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
- package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
- package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
- package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
- package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
- package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
- package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
- package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
- package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
- package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
- package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
- package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
- package/dist/chunks/store-training-G6YLFSIR.js +70 -0
- package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
- package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
- package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
- package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
- package/dist/chunks/taskset-EQRFQBYM.js +2 -0
- package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
- package/dist/chunks/{teams-bot-7I4BAUVO.js → teams-bot-EAPGPTHZ.js} +1 -1
- package/dist/chunks/training-UF6RPI4T.js +2 -0
- package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
- package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-CaRMZoxo.css +1 -0
- package/dist/web/assets/App-s-CJswyt.js +154 -0
- package/dist/web/assets/{AppDialog-BdusXgU0.js → AppDialog-t2Fx5tK3.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-C4uRpnBz.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
- package/dist/web/assets/AppsView-BYE5EBDJ.js +1 -0
- package/dist/web/assets/{BrowserSidebar-Bl7V6YO2.js → BrowserSidebar-jhWi4rVm.js} +1 -1
- package/dist/web/assets/{CartesianChart-BstFbsdn.js → CartesianChart-C1DIx0Ia.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-B8YAf0c1.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
- package/dist/web/assets/{CommandMenu-DZct7zUJ.js → CommandMenu-Ux2yOHAc.js} +1 -1
- package/dist/web/assets/{CommunityView-CR0-W-uG.js → CommunityView-DPEeVKFn.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DR-Qo7b4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
- package/dist/web/assets/{GetStartedView-xqQoMMei.js → GetStartedView-CFHP0AaI.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-D8BGTPVN.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-De3i9wF4.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DAY1MmqP.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-DLnIgnry.js → LabSkillSidebar-BxffN-pN.js} +1 -1
- package/dist/web/assets/LabsRoute-CyYF8-dw.js +99 -0
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +2 -0
- package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
- package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
- package/dist/web/assets/{MarkdownText-gJMuefaJ.js → MarkdownText-BR4V6lNO.js} +24 -24
- package/dist/web/assets/{NativeSkillSidebar-Dlxb8iOC.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DM-cqJ-K.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cu1q75gq.js → NewProjectDialog-RfTZTHxl.js} +1 -1
- package/dist/web/assets/{OutputsPage-DiXMkasl.js → OutputsPage-Cr1Spf7S.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DqiBHiCB.js → ProjectsPage-CE6QUB-b.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-vOrYv8pp.js +1 -0
- package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
- package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
- package/dist/web/assets/{TeamChatView-DM0adMtj.js → TeamChatView-Bwrjr-vk.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CFlH51DD.js → TerminalOverlay-DhPoKZAq.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-Bbo3RRie.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CSRjJUSa.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DwlEMEoG.js → WorkSidebarPanel-DSSikNFQ.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-BAFo0CPN.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-BVHAhwnJ.js +63 -0
- package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-BR4qxMgU.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
- package/dist/web/assets/arrow-up-right-C9aE8Mfz.js +1 -0
- package/dist/web/assets/chunk-P3BRSSRD-DUGfuKA8.js +1 -0
- package/dist/web/assets/{clipboard-BZzZ82Bk.js → clipboard-Dk158Qp4.js} +1 -1
- package/dist/web/assets/{cloud-upload-CJPYPVl8.js → cloud-upload-k9eqBsHr.js} +1 -1
- package/dist/web/assets/{cssMode-WC4Rg1l-.js → cssMode-CO35ARZp.js} +1 -1
- package/dist/web/assets/{folder-open-sLZJxLQy.js → folder-open-sYgceW_f.js} +1 -1
- package/dist/web/assets/folder-plus-CS0R49m9.js +1 -0
- package/dist/web/assets/{git-commit-horizontal-Cotm7KEC.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
- package/dist/web/assets/{htmlMode-C6oZGeaB.js → htmlMode-REMmzdfq.js} +1 -1
- package/dist/web/assets/index-3iPNbbER.css +1 -0
- package/dist/web/assets/{index-BxWTVKtn.js → index-C8aCGagb.js} +2 -2
- package/dist/web/assets/info-DLdbiUrh.js +1 -0
- package/dist/web/assets/{jsonMode-BET4LQIn.js → jsonMode-KEdMfkIf.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-BPxA_-Kg.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
- package/dist/web/assets/minimize-2-CqcI4zcM.js +1 -0
- package/dist/web/assets/{monaco.contribution-DFzEyaHi.js → monaco.contribution-BJGj65F9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DXzyQfVi.js → monaco.contribution-Cly9Wt7L.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BH6kkO4b.js → monaco.contribution-DO10L0zW.js} +2 -2
- package/dist/web/assets/{monaco.contribution-7AUuf2NS.js → monaco.contribution-omszXBEj.js} +2 -2
- package/dist/web/assets/monitor-BFVCcbxp.js +1 -0
- package/dist/web/assets/play-C469pVZq.js +1 -0
- package/dist/web/assets/{python-PzBkTjWx.js → python-Dw0YcVy9.js} +1 -1
- package/dist/web/assets/{save-DpezrtH2.js → save-CtSjPydi.js} +1 -1
- package/dist/web/assets/square-BuImvLhT.js +1 -0
- package/dist/web/assets/{toggleHighContrast-Cto-fOXm.js → toggleHighContrast-DjCO9lIP.js} +1 -1
- package/dist/web/assets/{tsMode-BYA4LNc6.js → tsMode-BAOnxKd6.js} +1 -1
- package/dist/web/assets/{upload-C5YFNgtS.js → upload-2JkFZo3h.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CnyTsqlf.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
- package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-DICuJSJW.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
- package/dist/web/assets/{wifi-off-nzHj7JXp.js → wifi-off-CpOAH62M.js} +1 -1
- package/dist/web/assets/{workers-Dboaw6f_.js → workers-0QvlA2T5.js} +1 -1
- package/dist/web/assets/{yaml-uuY5JmO8.js → yaml-BK3qxo7D.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/chunks/actions-command-DSO6YOEE.js +0 -2
- package/dist/chunks/app-server-runtime-7AXV6JZI.js +0 -2
- package/dist/chunks/apps-TM74FFQB.js +0 -2
- package/dist/chunks/chunk-2JO2KWT3.js +0 -5
- package/dist/chunks/chunk-2SPZYBDN.js +0 -16
- package/dist/chunks/chunk-37DXASQL.js +0 -191
- package/dist/chunks/chunk-4EEH7MEC.js +0 -2
- package/dist/chunks/chunk-4TZHH5FC.js +0 -2409
- package/dist/chunks/chunk-5TNDPNS3.js +0 -2
- package/dist/chunks/chunk-6JAN4RMN.js +0 -42
- package/dist/chunks/chunk-7QEE4PBI.js +0 -8
- package/dist/chunks/chunk-BX4J2VDU.js +0 -2
- package/dist/chunks/chunk-DALJMSJG.js +0 -33
- package/dist/chunks/chunk-EMKZVP7Z.js +0 -2
- package/dist/chunks/chunk-FPUUZQUP.js +0 -6
- package/dist/chunks/chunk-GCOUYYHG.js +0 -5
- package/dist/chunks/chunk-GS2NKNKG.js +0 -4
- package/dist/chunks/chunk-H2VT22JK.js +0 -2
- package/dist/chunks/chunk-HA7EFTPF.js +0 -23
- package/dist/chunks/chunk-IKWDL3RB.js +0 -17
- package/dist/chunks/chunk-NHFGEVVH.js +0 -518
- package/dist/chunks/chunk-NNF6KCHD.js +0 -3
- package/dist/chunks/chunk-PJM2G7SG.js +0 -21
- package/dist/chunks/chunk-PQHTZ5CP.js +0 -2
- package/dist/chunks/chunk-PYABBF53.js +0 -53
- package/dist/chunks/chunk-QRWPEW3Z.js +0 -24
- package/dist/chunks/chunk-QXVIIM4T.js +0 -2
- package/dist/chunks/chunk-SDEDAHV6.js +0 -160
- package/dist/chunks/chunk-TGIB24K4.js +0 -22
- package/dist/chunks/chunk-UE3DMPGM.js +0 -3
- package/dist/chunks/chunk-USKE34VR.js +0 -9
- package/dist/chunks/chunk-USMZT5FZ.js +0 -18
- package/dist/chunks/chunk-WV2APYWG.js +0 -2
- package/dist/chunks/chunk-YIB3J4RC.js +0 -2
- package/dist/chunks/chunk-Z3D4C7BG.js +0 -12
- package/dist/chunks/cli-JVB345H2.js +0 -2
- package/dist/chunks/configuration-command-MATM4XR5.js +0 -2
- package/dist/chunks/connected-evidence-YDPGNHLP.js +0 -2
- package/dist/chunks/core-commands-MTV4EKXY.js +0 -2
- package/dist/chunks/datasets-CP3IT47T.js +0 -2
- package/dist/chunks/desktop-test-IAZC5MAH.js +0 -3
- package/dist/chunks/dist-4HV2W6V4.js +0 -2
- package/dist/chunks/dist-SAABJU5F.js +0 -2
- package/dist/chunks/evaluation-coordination-EPHLZXYM.js +0 -2
- package/dist/chunks/experiment-improvements-6JTOPA74.js +0 -2
- package/dist/chunks/experiments-XHPFGECH.js +0 -2
- package/dist/chunks/extension-GX7DLW2X.js +0 -4
- package/dist/chunks/hosted-experiment-improvement-HAB3UE6A.js +0 -3
- package/dist/chunks/hosted-harness-runtime-YM23QNDK.js +0 -2
- package/dist/chunks/hosted-profile-candidate-EOBGKQAS.js +0 -3
- package/dist/chunks/hosted-profile-compiler-SCVJI2CP.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-RJ6XJZCS.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-OC4XNGL2.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-ZD4FM3FD.js +0 -3
- package/dist/chunks/human-review-AAVMISBF.js +0 -2
- package/dist/chunks/import-V3HUGRHR.js +0 -4
- package/dist/chunks/learning-FNBEIAY6.js +0 -2
- package/dist/chunks/opchat-QK43DXTY.js +0 -3
- package/dist/chunks/organizations-SRPAWKC7.js +0 -2
- package/dist/chunks/profile-C6CQNVYE.js +0 -3
- package/dist/chunks/project-agent-GZV5HNYI.js +0 -2
- package/dist/chunks/sandbox-command-4TJXQTKT.js +0 -2
- package/dist/chunks/src-NE6R4XC6.js +0 -329
- package/dist/chunks/taskset-LUG3ZU6J.js +0 -2
- package/dist/chunks/training-XHE6FVII.js +0 -2
- package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
- package/dist/web/assets/App-CO2F717V.css +0 -1
- package/dist/web/assets/App-CuhaCsfb.js +0 -235
- package/dist/web/assets/AppsView-BS1czXUP.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-CHxxf_Lu.js +0 -1
- package/dist/web/assets/LabsRoute-CXJRJMhr.js +0 -99
- package/dist/web/assets/MainChatThread-BwAla81W.js +0 -2
- package/dist/web/assets/MainPane-CakOBCHw.js +0 -19
- package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
- package/dist/web/assets/RightChatPanelStack-VaOOmxwd.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CeSFJM5s.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-D1jRQxFs.js +0 -1
- package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
- package/dist/web/assets/SettingsView-RA9OXgcu.js +0 -5
- package/dist/web/assets/TrainingCreationPanel-CgIBVGha.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-pGVezNMw.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-Byjngd9V.js +0 -32
- package/dist/web/assets/WorkspaceGitDialogs-Dgmg-6XG.js +0 -1
- package/dist/web/assets/arrow-up-right-H0pvnH2s.js +0 -1
- package/dist/web/assets/chunk-UHVJOMWN-BqXRe639.js +0 -1
- package/dist/web/assets/folder-plus-C84wrpt_.js +0 -1
- package/dist/web/assets/index-dSmk3FLJ.css +0 -1
- package/dist/web/assets/info-Dc81lEfw.js +0 -1
- package/dist/web/assets/minimize-2-Bs7MVN3C.js +0 -1
- package/dist/web/assets/monitor-DXL019Wf.js +0 -1
- package/dist/web/assets/play-CXkxUZeU.js +0 -1
- package/dist/web/assets/square-oy7f5Ce6.js +0 -1
- package/dist/web/assets/useProviderSettings-B_KeQjE5.js +0 -5
- /package/dist/chunks/{chunk-OGPHXXCD.js → chunk-BT5YNE5U.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-TxLyhzNp.js","assets/index-C8aCGagb.js","assets/index-3iPNbbER.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as l,_ as ka}from"./index-C8aCGagb.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-BR4V6lNO.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bK as Aa,e as ge,K as ot,aK as qs,aF as fn,bd as Ae,V as z,c0 as At,bB as Pt,bz as Ue,aA as is,c1 as Pa,b6 as La,c2 as Da,b7 as _a,F as Ta,J as pn,x as Ma,X as Xs,t as za,b8 as Ia,aI as Wa,aJ as Ba,bY as Oa,c3 as Ua,ay as Zs,c4 as Ha,bo as Va,c5 as rs,c6 as Ka,c7 as ls,c8 as Ga,v as qa,W as hn,U as Xa,c9 as ts,ca as Za,cb as os,bI as Re,cc as Qa,cd as Qs,ce as Ya,cf as Ja,cg as ei}from"./App-s-CJswyt.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-sYgceW_f.js";import{I as Ys}from"./info-DLdbiUrh.js";import{M as ci}from"./minimize-2-CqcI4zcM.js";import{S as di}from"./save-CtSjPydi.js";import{C as ui}from"./clipboard-Dk158Qp4.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Aa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Ai({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Pi,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Pi({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Ae(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Ae(o,{prefix:"Sandbox"}),Ae(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=At(v.provider),D=$?Pt($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=At(t.provider);return s?Pt(s):null}function re(t){const s=At(t),n=s?Pt(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=At(t);return(n?Pt(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Pa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function P(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",P)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const P=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=P.indexOf(O);if(_<0||P.length===0)return;w.preventDefault();const Lt=Ha(_,P.length,w.key),Pe=P[Lt];if(!Pe)return;Pe.focus(),Pe.click();const ct=Pe.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
|
|
3
|
+
|
|
4
|
+
[file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-TxLyhzNp.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Ae(u,{prefix:"File preview"}),Ae(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
|
|
5
|
+
`).slice(0,800),[E]),q=fs(c.path),X=n!=null||c.content!=null,B=E.endsWith(br),Q=I&&X&&rs(c.path),ne=X&&Ka(c.path)&&Nr(E);return x?e.jsxs("div",{className:"workspace-file-preview",children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),p]}),e.jsx("div",{className:"workspace-file-image-stage",children:e.jsx("button",{type:"button",className:"workspace-file-image-button","aria-label":`Open image preview for ${c.path}`,onClick:S,children:e.jsx("img",{alt:c.path,decoding:"async",src:x})})})]}):!b&&c.patch||!X&&c.patch?W?e.jsx(Sr,{collapsed:t,file:c,hideWhiteSpace:d,onSelectBreadcrumbPath:k,wordDiffs:v,wordWrap:$,headerActions:p,workspaceName:D,workspaceRootPath:M}):e.jsx(yr,{collapsed:t,file:c,hideWhiteSpace:d,wordWrap:$,workspaceName:D,workspaceRootPath:M,onSelectBreadcrumbPath:k,headerActions:p}):e.jsxs("div",{className:`workspace-file-preview ${$?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[H?e.jsx("span",{className:"workspace-file-save-state",children:"Saving"}):null,p]})]}),X?Q?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(Na,{content:E})}):ne?e.jsx(mr,{path:c.path,contentBase64:E}):a&&!B?e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"workspace-diff-code-empty",children:"Loading editor"}),children:e.jsx(gr,{diagnostics:s,filePath:c.path,onChange:Y=>N?.(Y),onLspAction:F,onSave:()=>T?.(),ref:i,value:E,wordWrap:$})}):e.jsx("div",{className:"workspace-file-code",children:se.map((Y,oe)=>e.jsxs("div",{className:"workspace-file-code-row",children:[e.jsx("span",{children:oe+1}),e.jsx("code",{children:e.jsx(Rt,{language:q,text:Y||" "})})]},`${oe}-${Y}`))}):e.jsx("div",{className:"workspace-diff-code-empty",children:o?"Loading file content":"No file content available."})]})}function yr({collapsed:t=!1,file:s,hideWhiteSpace:n=!1,wordWrap:a,workspaceName:i,workspaceRootPath:u,onSelectBreadcrumbPath:c,headerActions:d}){const p=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),x=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview ${a?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:i??null,workspaceRootPath:u,onSelectPath:c}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),d]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} diff`,className:"workspace-diff-code",emptyMessage:"No patch available.",rows:p,renderRow:(o,b)=>o.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer",role:"row",children:o.label},`${o.label}-${b}`):e.jsxs("div",{className:`workspace-diff-code-row ${o.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number",role:"cell",children:o.newLine||o.oldLine}),e.jsx("code",{role:"cell",children:e.jsx(Rt,{language:x,text:o.newContent||o.oldContent||" "})})]},`${o.oldLine}-${o.newLine}-${b}`),wordWrap:a})]})}function Sr({collapsed:t,file:s,hideWhiteSpace:n,wordDiffs:a,wordWrap:i,workspaceName:u,workspaceRootPath:c,onSelectBreadcrumbPath:d,headerActions:p}){const x=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),o=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview split ${i?"wrap":""} ${a?"word-diffs":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:u,workspaceRootPath:c,onSelectPath:d}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[p,e.jsx(Ca,{size:14})]})]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} split diff`,className:"workspace-split-code",emptyMessage:"No patch available.",rows:x,renderRow:(b,S)=>b.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer split",role:"row",children:b.label},`${b.label}-${S}`):e.jsxs("div",{className:`workspace-split-row ${b.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number old",role:"cell",children:b.oldLine}),e.jsx("code",{className:"old",role:"cell",children:e.jsx(Rt,{language:o,text:b.oldContent||" "})}),e.jsx("span",{className:"workspace-diff-line-number new",role:"cell",children:b.newLine}),e.jsx("code",{className:"new",role:"cell",children:e.jsx(Rt,{language:o,text:b.newContent||" "})})]},`${b.oldLine}-${b.newLine}-${S}`),wordWrap:i})]})}function Nr(t){return t.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(t)}function kn({ariaLabel:t,className:s,emptyMessage:n,rows:a,renderRow:i,wordWrap:u}){const c=!u&&a.length>vr,{endIndex:d,offsetTop:p,scrollRef:x,startIndex:o,totalHeight:b}=Cr(a.length,c);return a.length===0?e.jsx("div",{className:s,role:"table","aria-label":t,children:e.jsx("div",{className:"workspace-diff-code-empty",children:n})}):c?e.jsx("div",{className:`${s} virtualized`,ref:x,role:"table","aria-label":t,"aria-rowcount":a.length,children:e.jsx("div",{className:"workspace-diff-virtual-spacer",style:{height:b},children:e.jsx("div",{className:"workspace-diff-virtual-window",style:{transform:`translateY(${p}px)`},children:a.slice(o,d).map((S,k)=>i(S,o+k))})})}):e.jsx("div",{className:s,role:"table","aria-label":t,children:a.map(i)})}function Cr(t,s){const n=l.useRef(null),[a,i]=l.useState({height:Fe*an,scrollTop:0}),u=l.useCallback(()=>{const x=n.current;x&&i({height:x.clientHeight||Fe*an,scrollTop:x.scrollTop})},[]);if(l.useEffect(()=>{if(!s)return;const x=n.current;if(!x)return;u();let o=0;const b=()=>{if(typeof window>"u"){u();return}window.cancelAnimationFrame(o),o=window.requestAnimationFrame(u)};x.addEventListener("scroll",b,{passive:!0});const S=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>b());return S?.observe(x),()=>{x.removeEventListener("scroll",b),S?.disconnect(),typeof window<"u"&&window.cancelAnimationFrame(o)}},[s,u]),!s)return{endIndex:t,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:t*Fe};const c=Math.ceil(a.height/Fe),d=Math.max(0,Math.floor(a.scrollTop/Fe)-rn);return{endIndex:Math.min(t,d+c+rn*2),offsetTop:d*Fe,scrollRef:n,startIndex:d,totalHeight:t*Fe}}function wn(t,s){if(!t.trim())return[];const n=[];let a=0,i=0,u=null,c=null,d=!1,p=[];function x(){n.push(...Rr(p)),p=[]}function o(){d&&(x(),u=a,c=i,d=!1)}for(const b of t.split(`
|
|
6
|
+
`)){const S=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(b);if(S){o();const F=Number(S[1]),T=Number(S[2]);if(u!==null&&c!==null){const I=Math.max(F-u,T-c,0);I>0&&n.push({kind:"spacer",label:yn(I)})}a=F,i=T,d=!0;continue}if(b.startsWith("diff --git")||b.startsWith("index ")||b.startsWith("--- ")||b.startsWith("+++ ")||!d||b.startsWith("\\ No newline"))continue;const k=b.slice(1)||" ";if(s&&!k.trim())continue;if(b.startsWith("+")){x(),n.push({kind:"addition",oldLine:"",newLine:String(i||""),oldContent:"",newContent:k}),i+=1;continue}if(b.startsWith("-")){x(),n.push({kind:"deletion",oldLine:String(a||""),newLine:"",oldContent:k,newContent:""}),a+=1;continue}const N=b.startsWith(" ")?b.slice(1)||" ":b||" ";s&&!N.trim()||(p.push({kind:"context",oldLine:String(a||""),newLine:String(i||""),oldContent:N,newContent:N}),a+=1,i+=1)}return o(),n}function Rr(t){if(t.length<jr)return t;const s=t.length-ns*2;return s<=0?t:[...t.slice(0,ns),{kind:"spacer",label:yn(s)},...t.slice(-ns)]}function yn(t){return`${t} unmodified ${t===1?"line":"lines"}`}const Ft=`
|
|
7
|
+
|
|
8
|
+
[file truncated]`,$r="openpond.sandboxSourceReadback.v1";async function Fr(t,s,n,a=[]){let i;try{i=await z.sandboxDownloadFile(t,s,n,{maxBytes:256*1024})}catch(c){const d=c instanceof Error?c.message:String(c);if(!Er(d))throw c;const p=Lr(a,s,n);if(p)return p;const x=!!ps(a,s)?.artifact,o=await z.sandbox(t,s).catch(()=>null);throw new Error(Ar(n,o?.sandbox??null,d,{hasReadbackArtifact:x}))}const u=i.file.isBinary?i.file.contentsBase64||null:`${i.contents}${i.file.truncated?Ft:""}`;return{path:i.file.path,status:"",additions:0,deletions:0,patch:"",content:u}}function Er(t){return t.includes("sandbox_not_ready")&&t.includes("placement_stale")||t.includes("sandbox_not_running")}function Ar(t,s,n="sandbox_not_ready:placement_stale",a={}){const i=s?Dr(s):null,u=t||"this file";if(a.hasReadbackArtifact)return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint has a saved readback artifact, but ${u} was not captured as text. Resume the sandbox to inspect it. ${n}`;if(!i)return`Sandbox file content is unavailable because the stopped runtime placement is stale. Resume the sandbox to inspect ${u}. ${n}`;const c=i.preservedSha?i.preservedSha.slice(0,12):null,d=i.sourceRef?` (${i.sourceRef})`:"";return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint is saved${c?` at ${c}`:""}${d}, but this Desktop app cannot read file bodies from preserved source refs yet. Resume the sandbox to inspect ${u}.`}function Pr(t,s){if(!s)return null;const n=ps(t,s);if(!n)return null;const a=Nn(n.artifact),i=new Map;for(const d of hs(a))i.set(d.path,d);for(const d of Cn(n.artifact)){const p=Sn(n.artifact,d.path);p&&i.set(d.path,p)}const u=[...i.values()].sort((d,p)=>d.path.localeCompare(p.path)),c=[...new Set(u.map(d=>d.path))].sort((d,p)=>d.localeCompare(p));return{appId:s,repoPath:"",initialized:!0,dirty:!1,filesChanged:u.length,additions:u.reduce((d,p)=>d+p.additions,0),deletions:u.reduce((d,p)=>d+p.deletions,0),repoFiles:c,files:u,error:null,updatedAt:He(le(n.artifact)?.createdAt)??n.event.timestamp}}function Lr(t,s,n){if(!s)return null;const a=ps(t,s);return a?Sn(a.artifact,n):null}function ps(t,s){for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=le(a.data),u=le(i?.sourcePreservation),c=le(u?.sourceReadbackArtifact);if(c&&c.schemaVersion===$r&&c.sandboxId===s)return{artifact:c,event:a}}return null}function Sn(t,s){const n=hs(Nn(t)).find(u=>u.path===s),a=Cn(t).find(u=>u.path===s);if(!n&&!a)return null;const i=typeof a?.content=="string"?`${a.content}${a.truncated?Ft:""}`:null;return{path:a?.path??n?.path??s,status:n?.status??"M",additions:n?.additions??0,deletions:n?.deletions??0,patch:n?.patch??"",content:i}}function Nn(t){const s=le(t.patch);return typeof s?.text=="string"?s.text:""}function Cn(t){return(Array.isArray(t.files)?t.files:[]).map(n=>{const a=le(n),i=He(a?.path);return i?{path:i,...typeof a?.content=="string"?{content:a.content}:{},...a?.truncated===!0?{truncated:!0}:{}}:null}).filter(n=>!!n)}function Dr(t){const s=le(t.metadata)??{},n=le(s.sourcePreservation)??le(s.sourcePreserve),a=le(s.sourceChangeDetection),i=He(n?.preservedSha)??He(a?.preservedSha)??null,u=He(n?.sourceRef)??He(a?.sourceRef)??(typeof t.repoRef=="string"?t.repoRef:null);return!i&&!u?null:{preservedSha:i,sourceRef:u}}function le(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function He(t){return typeof t=="string"&&t.trim()?t.trim():null}async function _r(t,s,n,a){const i=await z.sandboxUploadFile(t,s,{path:n,contents:a});return await z.preserveSandboxSource(t,s,{message:"Auto-preserve source after right sidebar save"}),{path:i.file.path,status:"M",additions:0,deletions:0,patch:"",content:a}}function Tr(t){return t.filter(s=>s.type==="file").map(s=>s.path).sort((s,n)=>s.localeCompare(n))}function Mr(t,s){const n=new Map;for(const a of hs(t?.diff??""))n.set(a.path,a);for(const a of zr(s?.porcelain??""))n.has(a.path)||n.set(a.path,a);return[...n.values()].sort((a,i)=>a.path.localeCompare(i.path))}function hs(t){const s=[];let n=null;const a=()=>{n&&(s.push({path:n.path,status:n.status,additions:n.additions,deletions:n.deletions,patch:n.patchLines.join(`
|
|
9
|
+
`),content:null}),n=null)};for(const i of t.split(`
|
|
10
|
+
`)){if(i.startsWith("diff --git ")){a(),n={path:Wr(i)??"changed-file",status:"M",additions:0,deletions:0,patchLines:[i]};continue}if(n){if(n.patchLines.push(i),i.startsWith("+++ ")){const u=ln(i.slice(4));u&&(n.path=u);continue}if(i.startsWith("--- ")){const u=ln(i.slice(4));u&&n.path==="changed-file"&&(n.path=u);continue}i.startsWith("new file mode ")&&(n.status="A"),i.startsWith("deleted file mode ")&&(n.status="D"),i.startsWith("rename to ")&&(n.status="R",n.path=i.slice(10).trim()||n.path),i.startsWith("+")&&!i.startsWith("+++")&&(n.additions+=1),i.startsWith("-")&&!i.startsWith("---")&&(n.deletions+=1)}}return a(),s}function zr(t){const s=[];for(const n of t.split(`
|
|
11
|
+
`)){if(!n.trim())continue;const a=Ir(n);a&&s.push({path:a,status:n.slice(0,2).trim()||"M",additions:0,deletions:0,patch:"",content:null})}return s}function Ir(t){const s=t.slice(3).trim();return s?s.split(" -> ").pop()?.trim()||s:null}function Wr(t){const s=/^diff --git a\/(.+) b\/(.+)$/.exec(t.trim());return s?.[2]??s?.[1]??null}function ln(t){const s=t.trim();return!s||s==="/dev/null"?null:s.startsWith("a/")||s.startsWith("b/")?s.slice(2):s}const Rn="openpond.workspace.editorControlsVisible";function on(){try{return hn.getItem(Rn)==="true"}catch{return!1}}function Br(t){try{hn.setItem(Rn,String(t))}catch{}}function Or({activeDiagnostics:t,activeServers:s,editorDiagnosticsChecking:n,editorLspEnabled:a,showEditorCommandBar:i}){if(!i)return null;if(!a)return{label:"LSP off",severity:"unavailable"};if(n)return{label:"Checking",severity:"info"};const u=t.filter(x=>x.severity==="error").length;if(u>0)return{label:`${u} error${u===1?"":"s"}`,severity:"error"};const c=t.filter(x=>x.severity==="warning").length;if(c>0)return{label:`${c} warning${c===1?"":"s"}`,severity:"warning"};const d=t.length;if(d>0)return{label:`${d} note${d===1?"":"s"}`,severity:"info"};if(!s)return null;const p=s.find(x=>x.status!=="connected");return p?{label:p.id==="none"?"No LSP":`${p.id} unavailable`,severity:"unavailable"}:{label:"No issues",severity:"none"}}const cn=3e3,Ur=2e3,dn=[],Hr=[];function Vr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k=!1,openFileRequest:N,readOnly:F=!1,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y=[],sidebarFileSourceSessionId:oe=null,onSetSidebarFileStatus:w}){return e.jsx(Zr,{appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i??[],diff:u,editorPreferences:c??null,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S??null,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T??[],sourceSwitcher:I??null,tabRequest:K??null,viewState:H??null,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B??null,sandboxFileSource:Q??null,trainingSummary:ne??null,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w})}function Kr(t,s,n,a){return t&&s?.content!=null?{...t,content:s.content}:s&&!t&&as(s)?s:t&&as(t)?t:s&&as(s)?s:t??s??n??os(a)}function as(t){return!!(t.patch||t.content!=null)}function Gr({changedFiles:t,checkpointStatus:s,dirty:n,error:a,loading:i,preservedReadback:u,sandboxMode:c,sourcePending:d}){if(d)return{label:"sandbox pending",tone:"loading"};if(i)return{label:"refreshing",tone:"loading"};if(c&&u&&s)return s;if(a)return{label:"status unavailable",tone:"error"};if(c&&s?.tone==="error"||c&&s&&!n&&t===0)return s;if(n||t>0){const p=Math.max(1,t),x=p===1?"change":"changes";return{label:c?`${p} unpreserved ${x}`:`${p} local ${x}`,tone:"dirty"}}return{label:c?"sandbox clean":"local clean",tone:"clean"}}function qr(t,s){if(!s)return null;for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:null,u=i?.sourcePreservation&&typeof i.sourcePreservation=="object"&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(u?.attempted===!0&&u.sandboxId===s)return u.ok!==!0?{label:"checkpoint failed",tone:"error"}:u.preserved===!0?{label:"checkpoint saved",tone:"clean"}:{label:"checkpoint clean",tone:"clean"}}return null}function Xr(t){const s=t.split("/").filter(Boolean);return s.map((n,a)=>s.slice(0,a+1).join("/"))}function Zr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w}){const O=H??ei(),[P,_]=l.useState(O.activeTab),[Lt,Pe]=l.useState(!1),[ct,ce]=l.useState(!1),[$n,ae]=l.useState(!1),[Dt,_t]=l.useState(""),[J,Ve]=l.useState(()=>[...O.openFilePaths]),[j,je]=l.useState(O.selectedPath),[ms,Fn]=l.useState(!1),[xs,En]=l.useState(!1),[Le,An]=l.useState(!1),[Tt,Pn]=l.useState(!0),[bs,gs]=l.useState(on);Xa(()=>gs(on()));const[js,Ln]=l.useState(!1),[vs,Dn]=l.useState(!1),[ks,_n]=l.useState(!1),[ie,De]=l.useState({}),[dt,ut]=l.useState(()=>new Set),[ws,ft]=l.useState({}),[fe,Ke]=l.useState({}),[ys,Mt]=l.useState(()=>new Set),[Ge,qe]=l.useState(null),[Tn,zt]=l.useState(!1),[Ss,Xe]=l.useState(null),[Ns,It]=l.useState({}),[Mn,Wt]=l.useState({}),[zn,Bt]=l.useState(null),[In,ve]=l.useState(null),[Cs,Ot]=l.useState(null),[Wn,ke]=l.useState(null);Ae(o,{prefix:"Workspace"}),Ae(Ss,{prefix:"Sandbox files"});const[Ut,pt]=l.useState(null),[Bn,Ze]=l.useState({}),[ht,Ht]=l.useState(null),[_e,mt]=l.useState(null),[xt,bt]=l.useState(null),ee=c??Ja.editor,Rs=l.useRef(ie),Vt=l.useRef(ts(O)),Kt=l.useRef(ts(O)),$s=l.useRef(null),Gt=l.useRef(W),de=l.useRef(!1),Qe=l.useRef(null),Ye=l.useRef(0),pe=l.useRef(null),Je=l.useRef(null),A=Q?.sandboxId?.trim()||null,C=!!Q,Te=!!ne||C&&!!A,gt=C?`sandbox:${A??"pending"}`:`workspace:${t??"none"}`,Fs=C?!!A:!!t,Es=l.useRef(gt),he=!!(B?.createRuntime||B?.goalRuntime||B?.subagentRuntime),Me=l.useCallback(async(r={})=>{if(C){if(!a){qe(null),Xe("OpenPond App server is not connected.");return}if(!A){qe(null),Xe(null);return}r.silent||zt(!0);try{const[m,f,g]=await Promise.allSettled([z.sandboxFiles(a,A,{recursive:!0,maxEntries:Ur}),z.sandboxGitStatus(a,A),z.sandboxGitDiff(a,A,{})]);if(m.status==="rejected")throw m.reason;const y=Tr(m.value.files),h=f.status==="fulfilled"?f.value.status:null,R=g.status==="fulfilled"?g.value.diff:null,L=Mr(R,h),it=L.reduce((Jt,es)=>Jt+es.additions,0),va=L.reduce((Jt,es)=>Jt+es.deletions,0);qe({appId:A,repoPath:"",initialized:!0,dirty:h?!h.clean:L.length>0,filesChanged:L.length,additions:it,deletions:va,repoFiles:y,files:L,error:null,updatedAt:new Date().toISOString()}),Xe(null)}catch(m){qe(null),Xe(m instanceof Error?m.message:String(m))}finally{r.silent||zt(!1)}}},[a,A,C]),As=l.useMemo(()=>Pr(i,A),[i,A]),Ps=!!(Ge&&((Ge.files?.length??0)>0||(Ge.repoFiles?.length??0)>0)),On=C&&!Ps&&!!As,me=C?Ps?Ge:As??Ge:u,et=me?.repoPath??null,Un=l.useMemo(()=>qr(i,A),[i,A]),ze=me?.files??dn,Ls=me?.files??dn,we=l.useMemo(()=>new Map(Ls.map(r=>[r.path,r])),[Ls]),ye=l.useMemo(()=>new Map(ze.map(r=>[r.path,r])),[ze]),Ie=me?.repoFiles??(ze.length>0?ze.map(r=>r.path):Hr),We=l.useMemo(()=>ze.filter(r=>!Za(r,Ie)),[Ie,ze]),Se=l.useMemo(()=>xt&&!Ie.includes(xt)?[xt,...Ie]:Ie,[Ie,xt]),Ds=l.useMemo(()=>J.map(r=>we.get(r)??ie[r]??ye.get(r)??os(r)),[we,ye,ie,J]),jt=l.useMemo(()=>{const r={};for(const m of J){if(Re(m))continue;const f=we.get(m)??ie[m]??ye.get(m)??os(m);f.content!=null&&(r[m]=f.content)}return r},[we,ye,ie,J]),Be=l.useMemo(()=>{const r=new Set;for(const[m,f]of Object.entries(fe))f.content!==f.savedContent&&r.add(m);return r},[fe]),Hn=l.useMemo(()=>{const r=Dt.trim().toLowerCase(),m=Se;return r?m.filter(f=>f.toLowerCase().includes(r)):m},[Se,Dt]),qt=l.useMemo(()=>({activeTab:P,openFilePaths:J,selectedPath:j}),[P,J,j]);l.useEffect(()=>{Rs.current=ie},[ie]),l.useEffect(()=>{Qe.current=ht},[ht]),l.useEffect(()=>{Ke(r=>{let m=!1;const f={...r},g=new Set(J),y=u?.updatedAt?Date.parse(u.updatedAt):null;for(const[h,R]of Object.entries(f))g.has(h)||R.content!==R.savedContent||(delete f[h],m=!0);for(const[h,R]of Object.entries(jt)){const L=f[h];if(!L){f[h]={content:R,savedContent:R},m=!0;continue}if(L.content===L.savedContent&&L.savedContent!==R){if(L.savedAt&&(y===null||y<L.savedAt))continue;f[h]={content:R,savedContent:R},m=!0}}return m?f:r})},[u?.updatedAt,jt,J]),l.useEffect(()=>{Gt.current=W},[W]),l.useEffect(()=>{if(!H)return;const r=Qa(H,et);Qs(Vt.current,r)||(Vt.current=r,Kt.current=r,_(r.activeTab),Ve(r.openFilePaths),je(r.selectedPath))},[H,et]),l.useEffect(()=>{if(dt.size>0||Qs(Kt.current,qt))return;const r=ts(qt);Kt.current=r,Vt.current=r,E?.(r)},[qt,E,dt]),l.useEffect(()=>{F||C||!a||!t||!x||u||o||de.current||(de.current=!0,Promise.resolve(Gt.current({silent:!0})).catch(()=>{}).finally(()=>{de.current=!1}))},[t,a,u,F,C,o,x]),l.useEffect(()=>(Es.current!==gt&&(Es.current=gt,pe.current?.abort(new Error("lsp_diagnostics_source_changed")),pe.current=null,Ve([]),je(null),De({}),ut(new Set),ft({}),Ke({}),Mt(new Set),qe(null),Xe(null),zt(!1),It({}),Wt({}),Bt(null),ve(null),ke(null),pt(null),Ze({}),Ht(null),mt(null),bt(null)),()=>{pe.current?.abort(new Error("lsp_diagnostics_unmounted")),pe.current=null}),[gt]),l.useEffect(()=>{if(!(!N||$s.current===N.id)&&!(!N.file&&!Fs)){if($s.current=N.id,N.file){Vn(N.file,N.imageUrl,N.source);return}vt(N.path,{source:N.source})}},[Fs,N]),l.useEffect(()=>{if(!C||(Me(),!a||!A))return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Me({silent:!0})}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[a,Me,A,C]),l.useEffect(()=>{if(F||C||!a||!t||!x)return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Gt.current({silent:!0})}catch{}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[t,a,F,C,x]),l.useEffect(()=>{if(C||!a||!t||n==="local_project"){bt(null);return}let r=!1;return z.workspaceTemplateConfig(a,t).then(m=>{r||bt(m.exists?m.configPath??Ya:null)}).catch(()=>{r||bt(null)}),()=>{r=!0}},[t,a,C,n]),l.useEffect(()=>{!j||Se.includes(j)||J.includes(j)||je(We[0]?.path??null)},[We,J,Se,j]),l.useEffect(()=>{B?.active&&he&&_("goal")},[B?.active,he]),l.useEffect(()=>{K&&_(K.tab)},[K]),l.useEffect(()=>{!he&&P==="goal"&&_("files")},[P,he]),l.useEffect(()=>{!Te&&P==="summary"&&_("files")},[P,Te]);const G=P==="file"||k&&P==="files"?j:null;l.useEffect(()=>{if(!a||!G)return;if(Re(G)){ke(null),ve(h=>h===G?null:h);return}const r=Ut?.path===G,m=tt(G);if(F&&(m?.content!=null||m?.patch)){ke(null),ve(h=>h===G?null:h);return}if(!r&&(m?.content!=null||m?.patch&&!Le)){ke(null),ve(h=>h===G?null:h);return}let f=!1;const g=Rs.current[G];return g?.content==null&&(Le||!g?.patch)&&ve(G),ke(null),(C?A?Fr(a,A,G,i):Promise.reject(new Error(Q?.emptyMessage??"No sandbox filesystem is available.")):t?z.workspaceFile(a,t,G):Promise.reject(new Error("Workspace files are unavailable."))).then(h=>{f||De(R=>{const L=R[h.path];return L?.content===h.content&&L.patch===h.patch&&L.status===h.status?R:{...R,[h.path]:h}})}).catch(h=>{f||ke(h instanceof Error?h.message:String(h))}).finally(()=>{f||(ve(h=>h===G?null:h),pt(h=>h&&h.id===Ut?.id&&h.path===G?null:h))}),()=>{f=!0}},[P,t,a,Ut,Le,F,i,Q?.emptyMessage,A,C,G]);function vt(r,m){Ot(null);const f=C?A:t;if(Ks(r)&&!m?.source&&a&&f){Ra(a,f,r,C?"sandbox":"local").then(M).catch(y=>Ot(y instanceof Error?y.message:"Could not open HTML preview."));return}const g=ls(r,et);g&&(ut(y=>{if(!y.has(g))return y;const h=new Set(y);return h.delete(g),h}),De(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),ft(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),pt({id:Date.now(),path:g}),k||Ve(y=>y.includes(g)?y:[...y,g]),je(g),_(k?"files":"file"),!C&&a&&t&&Re(g)&&mt(g),ce(!1),ae(!1),_t(""))}function Vn(r,m,f=!1){if(Ks(r.path)&&r.content!=null&&!f&&a){$a(a,r.path,r.content).then(M).catch(h=>Ot(h instanceof Error?h.message:"Could not open HTML preview."));return}const g=ls(r.path,et);if(!g)return;const y={...r,path:g};De(h=>({...h,[g]:y})),ut(h=>{const R=new Set(h);return R.add(g),R}),ft(h=>{if(!m){if(!(g in h))return h;const R={...h};return delete R[g],R}return h[g]===m?h:{...h,[g]:m}}),pt(null),ke(null),ve(null),k||Ve(h=>h.includes(g)?h:[...h,g]),je(g),_(k?"files":"file"),ce(!1),ae(!1),_t("")}const Kn=l.useCallback(()=>{gs(r=>{const m=!r;return Br(m),m})},[]),tt=r=>Kr(we.get(r),ie[r],ye.get(r),r),Gn=l.useCallback((r,m)=>{Ke(f=>{const g=f[r],y=g?.savedContent??jt[r]??tt(r).content??"";return{...f,[r]:{content:m,savedContent:y,savedAt:g?.savedAt}}}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})},[we,ye,ie,jt]),Oe=l.useCallback(async(r,m={})=>{if(C||!a||!t||Re(r))return;const f=tt(r),g=m.content??fe[r]?.content??f.content??void 0;if(g?.endsWith(Ft))return;const y=Ye.current+1;Ye.current=y,pe.current?.abort(new Error("lsp_diagnostics_superseded"));const h=new AbortController;pe.current=h,Bt(r);try{const R=await z.workspaceLspTouch(a,t,{path:r,content:g,waitForDiagnostics:m.waitForDiagnostics??!0},{signal:h.signal});if(y!==Ye.current)return;It(L=>({...L,[R.path]:R.diagnostics})),Wt(L=>({...L,[R.path]:R.servers}))}catch(R){if(h.signal.aborted||y!==Ye.current)return;const L=R instanceof Error?R.message:String(R);It(it=>({...it,[r]:[]})),Wt(it=>({...it,[r]:[{id:"lsp",root:"",status:"error",message:L}]}))}finally{if(pe.current===h&&(pe.current=null),h.signal.aborted)return;y===Ye.current&&Bt(R=>R===r?null:R)}},[t,a,we,ye,fe,ie,C]),qn=l.useCallback(async r=>{if(C||!a||!t)throw new Error("Workspace LSP is unavailable.");return z.workspaceLspAction(a,t,r)},[t,a,C]),st=l.useCallback(async r=>{if(!a||!t&&!A||Qe.current===r)return;const m=fe[r];if(!m||m.content===m.savedContent)return;const f=m.content,g=Date.now();Qe.current=r,Ht(r),Ze(y=>{if(!(r in y))return y;const h={...y};return delete h[r],h});try{const y=C?await _r(a,A,r,f):await z.saveWorkspaceFile(a,t,{path:r,content:f});De(h=>({...h,[y.path]:y})),Ke(h=>{const R=h[r];return R?{...h,[r]:{content:R.content,savedContent:f,savedAt:g}}:h}),ee.languageServers!=="off"&&ee.checkOnSave&&await Oe(r,{content:f,waitForDiagnostics:!0}),C?await Me({silent:!0}):await W({silent:!0})}catch(y){Ze(h=>({...h,[r]:y instanceof Error?y.message:String(y)}))}finally{Qe.current===r&&(Qe.current=null),Ht(y=>y===r?null:y)}},[ee.checkOnSave,ee.languageServers,t,a,fe,W,Oe,Me,A,C]),_s=j?tt(j):null,nt=!!(j&&dt.has(j)),Ne=j?fe[j]?.content??_s?.content??null:null,Xn=!!(_s?.patch&&!Le),Xt=!!(!F&&!nt&&P==="file"&&!Xn&&j&&Ne!=null&&!Re(j)&&!(Tt&&rs(j))&&!Ne.endsWith(Ft));l.useEffect(()=>{if(ee.languageServers==="off"||!ee.diagnosticsWhileEditing||!j||!Xt||Ne==null)return;const r=window.setTimeout(()=>{Oe(j,{content:Ne,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(r)},[ee.diagnosticsWhileEditing,ee.languageServers,Oe,Ne,Xt,j]),l.useEffect(()=>{function r(m){!(m.ctrlKey||m.metaKey)||m.key.toLowerCase()!=="s"||P!=="file"||!j||(m.preventDefault(),Be.has(j)&&st(j))}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[P,Be,st,j]);const Zn=l.useCallback(()=>{j&&(Je.current?Je.current.save():st(j))},[st,j]),Qn=l.useCallback(()=>{Je.current?.undo()},[]),Yn=l.useCallback(()=>{Je.current?.redo()},[]),Jn=l.useCallback(()=>{j&&ee.languageServers!=="off"&&Oe(j,{content:Ne??void 0,waitForDiagnostics:!0})},[ee.languageServers,Oe,Ne,j]);function ea(r,m){if(m.stopPropagation(),!(Be.has(r)&&!window.confirm(`Discard unsaved changes to ${r}?`))&&(Be.has(r)&&(Ke(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})),Ve(f=>f.filter(g=>g!==r)),dt.has(r)&&De(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ft(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ut(f=>{if(!f.has(r))return f;const g=new Set(f);return g.delete(r),g}),j===r)){const f=Ds.find(g=>g.path!==r)??null;je(f?.path??We[0]?.path??null),f||_("files")}}function ta(){_("files"),ce(!1),ae(!1)}function Ts(r){Mt(m=>{const f=new Set(m);return f.has(r)?f.delete(r):f.add(r),f})}function sa(r){r&&Mt(m=>{const f=new Set(m);for(const g of Xr(r))f.add(g);return f}),_("files"),ce(!1),ae(!1)}function na(){const m=`git apply <<'PATCH'
|
|
12
|
+
${We.map(f=>f.patch).filter(Boolean).join(`
|
|
13
|
+
`)}
|
|
14
|
+
PATCH`;navigator.clipboard?.writeText(m)}const aa=We.length>0,ia=Se.length>0,ra=J.length>0,la=he||Te||aa||ia||ra,xe=P==="goal"&&he?"goal":P==="summary"&&Te?"summary":P==="file"&&j?"file":"files",oa=xe==="files"?"No files to show":"No local changes",ca=n==="local_project"&&!x&&!o,Ms=C?Tn:d,zs=C?Ss:o,da=Gr({changedFiles:me?.filesChanged??We.length,checkpointStatus:Un,dirty:!!me?.dirty,error:zs,loading:Ms,preservedReadback:On,sandboxMode:C,sourcePending:C&&!A}),ua=Ms?"Loading workspace files":zs?"Workspace files are unavailable":C&&!A?Q?.emptyMessage??"No sandbox filesystem is available.":ca?"Loading workspace files":x?oa:"No local files to show",Is=j?ws[j]??null:null,fa=!Is&&!C&&j&&Re(j)?j:null,Ws=_e?ws[_e]??null:null,pa=!Ws&&!C&&_e&&Re(_e)?_e:null,ha=Gs(a,t,fa),ma=Gs(a,t,pa),Zt=Is??ha,Bs=Ws??ma,Os=xe==="file"||k&&xe==="files"?j:null,xa=!!(Os&&rs(Os)),Us=j?Ns[j]??[]:[],Hs=j?Mn[j]??null:null,Qt=!!(j&&zn===j),Yt=bs&&Xt,at=!F&&!nt&&!C&&ee.languageServers!=="off",ba=l.useMemo(()=>Or({activeDiagnostics:Us,activeServers:Hs,editorDiagnosticsChecking:Qt,editorLspEnabled:at,showEditorCommandBar:Yt}),[Us,Hs,Qt,at,Yt]),ga=l.useCallback(async r=>{if(!a)throw new Error("OpenPond server connection is unavailable.");await z.runSubagentLifecycleAction(a,r.runId,{action:r.action,reason:"User requested from Goal details."}),await W({silent:!0})},[a,W]),be=C?"sandbox":n==="local_project"?"local":null,kt=l.useMemo(()=>{const r=new Map;if(!be||!s)return r;for(const m of Y)m.workspaceKind!==be||m.workspaceId!==s||r.set(m.path,m);return r},[Y,be,s]),wt=l.useCallback(r=>{try{return kt.get(cs(r))?.status??null}catch{return null}},[kt]),yt=l.useCallback((r,m)=>{if(!be||!s||!p||!w)return;let f;try{f=cs(r)}catch{return}const g=kt.get(f),y=new Date().toISOString(),h=g??{id:hi({workspaceKind:be,workspaceId:s,path:f}),workspaceKind:be,workspaceId:s,workspaceName:p,path:f,status:"pinned",order:null,sourceSessionId:oe,available:!0,createdAt:y,updatedAt:y};w(h,m)},[w,kt,oe,be,s,p]),Ce=!!(be&&s&&p&&w),ja=j&&Ce&&!nt?e.jsx(us,{currentStatus:wt(j),onSetStatus:r=>yt(j,r)}):null,Vs=j?e.jsx(wr,{diagnostics:at?Ns[j]??[]:[],draftContent:fe[j]?.content,editorRef:Je,editable:!F&&!nt&&!Zt,error:Wn,file:tt(j),collapsed:xs,hideWhiteSpace:vs,headerActions:ja,imageSrc:Zt,loading:In===j,loadFullFiles:Le,saveError:Bn[j]??null,saving:ht===j,onOpenImage:()=>{Zt&&mt(j)},onDraftContentChange:r=>Gn(j,r),onLspAction:at?qn:void 0,onSave:()=>{st(j)},onSelectBreadcrumbPath:sa,renderMarkdown:Tt,splitView:ks,wordDiffs:js,wordWrap:ms,workspaceName:p,workspaceRootPath:et}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{className:`workspace-diff-panel ${b?"expanded":""}`,id:"right-sidebar-files-panel",role:"tabpanel","aria-label":"Workspace diffs",children:[!b&&e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize diff panel",onPointerDown:v}),e.jsx(cr,{addMenuOpen:ct,expanded:b,filteredFiles:Hn,openFiles:Ds,dirtyFilePaths:Be,goalDetailsAvailable:he,searchOpen:$n,searchQuery:Dt,selectedPath:j,sideChatTabs:T,summaryAvailable:Te,sourceStatus:da,sourceSwitcher:I,visibleTab:xe,getFileBookmarkStatus:Ce?wt:void 0,onCloseFileTab:ea,onCloseSideChat:se,onCloseSearch:()=>ae(!1),onOpenFile:vt,onOpenBrowser:D?()=>{ce(!1),ae(!1),D()}:void 0,onOpenSearch:()=>{ce(!1),ae(!0)},onOpenSideChat:q?()=>{ce(!1),ae(!1),q()}:void 0,onSearchQueryChange:_t,onSetFileBookmarkStatus:Ce?yt:void 0,onSelectFile:r=>{je(r),_("file")},onSelectFiles:ta,onSelectGoal:()=>_("goal"),onSelectSummary:()=>{_("summary"),ce(!1),ae(!1)},onSelectSideChat:X,onToggleAddMenu:()=>{ce(r=>!r),ae(!1)},onToggleExpanded:$}),Cs&&e.jsx("div",{className:"workspace-diff-empty",role:"alert",children:Cs}),xe==="goal"&&he?e.jsx(Ai,{createRuntime:B?.createRuntime??null,goalRuntime:B?.goalRuntime??null,subagentRuntime:B?.subagentRuntime??null,onRunSubagentLifecycleAction:a?ga:void 0}):xe==="summary"&&Te?ne?e.jsx(ir,{summary:ne}):e.jsx(Qi,{sandboxId:A,connection:a}):la?e.jsxs(e.Fragment,{children:[e.jsx(dr,{canSaveActiveFile:!!(!F&&!nt&&j&&Be.has(j)&&ht!==j),canCheckActiveFile:at,collapsed:xs,editorControlsVisible:bs,editorDiagnosticStatus:ba,editorDiagnosticsChecking:Qt,hideWhiteSpace:vs,loadFullFiles:Le,menuOpen:Lt,renderMarkdown:Tt,showEditorCommandBar:Yt,showRenderMarkdownToggle:xa,splitView:ks,wordDiffs:js,wordWrap:ms,onCopyGitApply:na,onEditorCheck:Jn,onEditorRedo:Yn,onEditorSave:Zn,onEditorUndo:Qn,onRefresh:()=>{C?Me():W()},onToggleCollapsed:()=>En(r=>!r),onToggleEditorControlsVisible:Kn,onToggleHideWhiteSpace:()=>Dn(r=>!r),onToggleLoadFullFiles:()=>An(r=>!r),onToggleMenu:r=>Pe(m=>r??!m),onToggleRenderMarkdown:()=>Pn(r=>!r),onToggleSplitView:()=>_n(r=>!r),onToggleWordDiffs:()=>Ln(r=>!r),onToggleWordWrap:()=>Fn(r=>!r)}),xe==="files"&&(k?e.jsxs("div",{className:"workspace-diff-files-preview-layout",children:[e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts}),Vs??e.jsx("div",{className:"workspace-diff-files-preview-empty",children:"Select a file to review its changes."})]}):e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts})),xe==="file"&&j&&Vs]}):e.jsx("div",{className:"workspace-diff-empty",children:e.jsx("span",{children:ua})})]}),e.jsx(Fa,{open:!!Bs,src:Bs,title:_e??"",onClose:()=>mt(null)})]})}const rl=Object.freeze(Object.defineProperty({__proto__:null,WorkspaceDiffPanel:Vr},Symbol.toStringTag,{value:"Module"}));export{vi as C,Vr as W,rl as a};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import{r as q,j as r}from"./index-C8aCGagb.js";import{bK as le,s as L,o as ee,bL as bn,bM as Qe,n as ze,_ as rn,bN as We,b as en,e as ji,X as Ut,bO as sn,aO as Ai,bv as Ci,aA as An,a2 as Ni,ay as at,a0 as wi,bP as Ii,bo as _i,bd as Ei,bQ as Ri,bR as ot,V as xe,bk as Ti,aC as Pi,T as Oi,az as Cn,C as Li,aI as ki,x as Mi}from"./App-s-CJswyt.js";import{I as qi}from"./info-DLdbiUrh.js";import{M as Fi}from"./monitor-BFVCcbxp.js";import{P as cn}from"./play-C469pVZq.js";import{G as Di}from"./git-commit-horizontal-DrGxH2h4.js";import{S as Ui}from"./square-BuImvLhT.js";import{U as lt}from"./upload-2JkFZo3h.js";const Ee={custom:"custom"};function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var be={},pn={},Ve={},st;function dn(){if(st)return Ve;st=1;function n(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function o(s){return Array.isArray(s)?s:n(s)?[]:[s]}function h(s,f){if(f){const g=Object.keys(f);for(let p=0,l=g.length;p<l;p+=1){const w=g[p];s[w]=f[w]}}return s}function c(s,f){let g="";for(let p=0;p<f;p+=1)g+=s;return g}function u(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ve.isNothing=n,Ve.isObject=i,Ve.toArray=o,Ve.repeat=c,Ve.isNegativeZero=u,Ve.extend=h,Ve}var Nn,ct;function mn(){if(ct)return Nn;ct=1;function n(o,h){let c="";const u=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!h&&o.mark.snippet&&(c+=`
|
|
2
|
+
|
|
3
|
+
`+o.mark.snippet),u+" "+c):u}function i(o,h){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=h,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(h){return this.name+": "+n(this,h)},Nn=i,Nn}var wn,ut;function zi(){if(ut)return wn;ut=1;const n=dn();function i(c,u,s,f,g){let p="",l="";const w=Math.floor(g/2)-1;return f-u>w&&(p=" ... ",u=f-w+p.length),s-f>w&&(l=" ...",s=f+w-l.length),{str:p+c.slice(u,s).replace(/\t/g,"→")+l,pos:f-u+p.length}}function o(c,u){return n.repeat(" ",u-c.length)+c}function h(c,u){if(u=Object.create(u||null),!c.buffer)return null;u.maxLength||(u.maxLength=79),typeof u.indent!="number"&&(u.indent=1),typeof u.linesBefore!="number"&&(u.linesBefore=3),typeof u.linesAfter!="number"&&(u.linesAfter=2);const s=/\r?\n|\r|\0/g,f=[0],g=[];let p,l=-1;for(;p=s.exec(c.buffer);)g.push(p.index),f.push(p.index+p[0].length),c.position<=p.index&&l<0&&(l=f.length-2);l<0&&(l=f.length-1);let w="";const T=Math.min(c.line+u.linesAfter,g.length).toString().length,U=u.maxLength-(u.indent+T+3);for(let D=1;D<=u.linesBefore&&!(l-D<0);D++){const Y=i(c.buffer,f[l-D],g[l-D],c.position-(f[l]-f[l-D]),U);w=n.repeat(" ",u.indent)+o((c.line-D+1).toString(),T)+" | "+Y.str+`
|
|
4
|
+
`+w}const J=i(c.buffer,f[l],g[l],c.position,U);w+=n.repeat(" ",u.indent)+o((c.line+1).toString(),T)+" | "+J.str+`
|
|
5
|
+
`,w+=n.repeat("-",u.indent+T+3+J.pos)+`^
|
|
6
|
+
`;for(let D=1;D<=u.linesAfter&&!(l+D>=g.length);D++){const Y=i(c.buffer,f[l+D],g[l+D],c.position-(f[l]-f[l+D]),U);w+=n.repeat(" ",u.indent)+o((c.line+D+1).toString(),T)+" | "+Y.str+`
|
|
7
|
+
`}return w.replace(/\n$/,"")}return wn=h,wn}var In,dt;function Ae(){if(dt)return In;dt=1;const n=mn(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function h(u){const s={};return u!==null&&Object.keys(u).forEach(function(f){u[f].forEach(function(g){s[String(g)]=f})}),s}function c(u,s){if(s=s||{},Object.keys(s).forEach(function(f){if(i.indexOf(f)===-1)throw new n('Unknown option "'+f+'" is met in definition of "'+u+'" YAML type.')}),this.options=s,this.tag=u,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(f){return f},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=h(s.styleAliases||null),o.indexOf(this.kind)===-1)throw new n('Unknown kind "'+this.kind+'" is specified for "'+u+'" YAML type.')}return In=c,In}var _n,mt;function $t(){if(mt)return _n;mt=1;const n=mn(),i=Ae();function o(u,s){const f=[];return u[s].forEach(function(g){let p=f.length;f.forEach(function(l,w){l.tag===g.tag&&l.kind===g.kind&&l.multi===g.multi&&(p=w)}),f[p]=g}),f}function h(){const u={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(f){f.multi?(u.multi[f.kind].push(f),u.multi.fallback.push(f)):u[f.kind][f.tag]=u.fallback[f.tag]=f}for(let f=0,g=arguments.length;f<g;f+=1)arguments[f].forEach(s);return u}function c(u){return this.extend(u)}return c.prototype.extend=function(s){let f=[],g=[];if(s instanceof i)g.push(s);else if(Array.isArray(s))g=g.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(f=f.concat(s.implicit)),s.explicit&&(g=g.concat(s.explicit));else throw new n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");f.forEach(function(l){if(!(l instanceof i))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),g.forEach(function(l){if(!(l instanceof i))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const p=Object.create(c.prototype);return p.implicit=(this.implicit||[]).concat(f),p.explicit=(this.explicit||[]).concat(g),p.compiledImplicit=o(p,"implicit"),p.compiledExplicit=o(p,"explicit"),p.compiledTypeMap=h(p.compiledImplicit,p.compiledExplicit),p},_n=c,_n}var En,pt;function zt(){if(pt)return En;pt=1;const n=Ae();return En=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),En}var Rn,ft;function Bt(){if(ft)return Rn;ft=1;const n=Ae();return Rn=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),Rn}var Tn,ht;function Ht(){if(ht)return Tn;ht=1;const n=Ae();return Tn=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),Tn}var Pn,gt;function Yt(){if(gt)return Pn;gt=1;const n=$t();return Pn=new n({explicit:[zt(),Bt(),Ht()]}),Pn}var On,xt;function Gt(){if(xt)return On;xt=1;const n=Ae();function i(c){if(c===null)return!0;const u=c.length;return u===1&&c==="~"||u===4&&(c==="null"||c==="Null"||c==="NULL")}function o(){return null}function h(c){return c===null}return On=new n("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:o,predicate:h,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),On}var Ln,bt;function Kt(){if(bt)return Ln;bt=1;const n=Ae();function i(c){if(c===null)return!1;const u=c.length;return u===4&&(c==="true"||c==="True"||c==="TRUE")||u===5&&(c==="false"||c==="False"||c==="FALSE")}function o(c){return c==="true"||c==="True"||c==="TRUE"}function h(c){return Object.prototype.toString.call(c)==="[object Boolean]"}return Ln=new n("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:o,predicate:h,represent:{lowercase:function(c){return c?"true":"false"},uppercase:function(c){return c?"TRUE":"FALSE"},camelcase:function(c){return c?"True":"False"}},defaultStyle:"lowercase"}),Ln}var kn,St;function Vt(){if(St)return kn;St=1;const n=dn(),i=Ae();function o(p){return p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102}function h(p){return p>=48&&p<=55}function c(p){return p>=48&&p<=57}function u(p){if(p===null)return!1;const l=p.length;let w=0,T=!1;if(!l)return!1;let U=p[w];if((U==="-"||U==="+")&&(U=p[++w]),U==="0"){if(w+1===l)return!0;if(U=p[++w],U==="b"){for(w++;w<l;w++){if(U=p[w],U!=="0"&&U!=="1")return!1;T=!0}return T&&isFinite(s(p))}if(U==="x"){for(w++;w<l;w++){if(!o(p.charCodeAt(w)))return!1;T=!0}return T&&isFinite(s(p))}if(U==="o"){for(w++;w<l;w++){if(!h(p.charCodeAt(w)))return!1;T=!0}return T&&isFinite(s(p))}}for(;w<l;w++){if(!c(p.charCodeAt(w)))return!1;T=!0}return T?isFinite(s(p)):!1}function s(p){let l=p,w=1,T=l[0];if((T==="-"||T==="+")&&(T==="-"&&(w=-1),l=l.slice(1),T=l[0]),l==="0")return 0;if(T==="0"){if(l[1]==="b")return w*parseInt(l.slice(2),2);if(l[1]==="x")return w*parseInt(l.slice(2),16);if(l[1]==="o")return w*parseInt(l.slice(2),8)}return w*parseInt(l,10)}function f(p){return s(p)}function g(p){return Object.prototype.toString.call(p)==="[object Number]"&&p%1===0&&!n.isNegativeZero(p)}return kn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:u,construct:f,predicate:g,represent:{binary:function(p){return p>=0?"0b"+p.toString(2):"-0b"+p.toString(2).slice(1)},octal:function(p){return p>=0?"0o"+p.toString(8):"-0o"+p.toString(8).slice(1)},decimal:function(p){return p.toString(10)},hexadecimal:function(p){return p>=0?"0x"+p.toString(16).toUpperCase():"-0x"+p.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),kn}var Mn,yt;function Qt(){if(yt)return Mn;yt=1;const n=dn(),i=Ae(),o=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),h=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(p){return p===null||!o.test(p)?!1:isFinite(parseFloat(p,10))?!0:h.test(p)}function u(p){let l=p.toLowerCase();const w=l[0]==="-"?-1:1;return"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?w===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:w*parseFloat(l,10)}const s=/^[-+]?[0-9]+e/;function f(p,l){if(isNaN(p))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===p)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===p)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(n.isNegativeZero(p))return"-0.0";const w=p.toString(10);return s.test(w)?w.replace("e",".e"):w}function g(p){return Object.prototype.toString.call(p)==="[object Number]"&&(p%1!==0||n.isNegativeZero(p))}return Mn=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:u,predicate:g,represent:f,defaultStyle:"lowercase"}),Mn}var qn,vt;function Zt(){return vt||(vt=1,qn=Yt().extend({implicit:[Gt(),Kt(),Vt(),Qt()]})),qn}var Fn,jt;function Xt(){return jt||(jt=1,Fn=Zt()),Fn}var Dn,At;function Jt(){if(At)return Dn;At=1;const n=Ae(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function h(s){return s===null?!1:i.exec(s)!==null||o.exec(s)!==null}function c(s){let f=0,g=null,p=i.exec(s);if(p===null&&(p=o.exec(s)),p===null)throw new Error("Date resolve error");const l=+p[1],w=+p[2]-1,T=+p[3];if(!p[4])return new Date(Date.UTC(l,w,T));const U=+p[4],J=+p[5],D=+p[6];if(p[7]){for(f=p[7].slice(0,3);f.length<3;)f+="0";f=+f}if(p[9]){const te=+p[10],V=+(p[11]||0);g=(te*60+V)*6e4,p[9]==="-"&&(g=-g)}const Y=new Date(Date.UTC(l,w,T,U,J,D,f));return g&&Y.setTime(Y.getTime()-g),Y}function u(s){return s.toISOString()}return Dn=new n("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:h,construct:c,instanceOf:Date,represent:u}),Dn}var Un,Ct;function Wt(){if(Ct)return Un;Ct=1;const n=Ae();function i(o){return o==="<<"||o===null}return Un=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),Un}var $n,Nt;function ei(){if(Nt)return $n;Nt=1;const n=Ae(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function o(s){if(s===null)return!1;let f=0;const g=s.length,p=i;for(let l=0;l<g;l++){const w=p.indexOf(s.charAt(l));if(!(w>64)){if(w<0)return!1;f+=6}}return f%8===0}function h(s){const f=s.replace(/[\r\n=]/g,""),g=f.length,p=i;let l=0;const w=[];for(let U=0;U<g;U++)U%4===0&&U&&(w.push(l>>16&255),w.push(l>>8&255),w.push(l&255)),l=l<<6|p.indexOf(f.charAt(U));const T=g%4*6;return T===0?(w.push(l>>16&255),w.push(l>>8&255),w.push(l&255)):T===18?(w.push(l>>10&255),w.push(l>>2&255)):T===12&&w.push(l>>4&255),new Uint8Array(w)}function c(s){let f="",g=0;const p=s.length,l=i;for(let T=0;T<p;T++)T%3===0&&T&&(f+=l[g>>18&63],f+=l[g>>12&63],f+=l[g>>6&63],f+=l[g&63]),g=(g<<8)+s[T];const w=p%3;return w===0?(f+=l[g>>18&63],f+=l[g>>12&63],f+=l[g>>6&63],f+=l[g&63]):w===2?(f+=l[g>>10&63],f+=l[g>>4&63],f+=l[g<<2&63],f+=l[64]):w===1&&(f+=l[g>>2&63],f+=l[g<<4&63],f+=l[64],f+=l[64]),f}function u(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return $n=new n("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:h,predicate:u,represent:c}),$n}var zn,wt;function ni(){if(wt)return zn;wt=1;const n=Ae(),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;function h(u){if(u===null)return!0;const s=[],f=u;for(let g=0,p=f.length;g<p;g+=1){const l=f[g];let w=!1;if(o.call(l)!=="[object Object]")return!1;let T;for(T in l)if(i.call(l,T))if(!w)w=!0;else return!1;if(!w)return!1;if(s.indexOf(T)===-1)s.push(T);else return!1}return!0}function c(u){return u!==null?u:[]}return zn=new n("tag:yaml.org,2002:omap",{kind:"sequence",resolve:h,construct:c}),zn}var Bn,It;function ti(){if(It)return Bn;It=1;const n=Ae(),i=Object.prototype.toString;function o(c){if(c===null)return!0;const u=c,s=new Array(u.length);for(let f=0,g=u.length;f<g;f+=1){const p=u[f];if(i.call(p)!=="[object Object]")return!1;const l=Object.keys(p);if(l.length!==1)return!1;s[f]=[l[0],p[l[0]]]}return!0}function h(c){if(c===null)return[];const u=c,s=new Array(u.length);for(let f=0,g=u.length;f<g;f+=1){const p=u[f],l=Object.keys(p);s[f]=[l[0],p[l[0]]]}return s}return Bn=new n("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:o,construct:h}),Bn}var Hn,_t;function ii(){if(_t)return Hn;_t=1;const n=Ae(),i=Object.prototype.hasOwnProperty;function o(c){if(c===null)return!0;const u=c;for(const s in u)if(i.call(u,s)&&u[s]!==null)return!1;return!0}function h(c){return c!==null?c:{}}return Hn=new n("tag:yaml.org,2002:set",{kind:"mapping",resolve:o,construct:h}),Hn}var Yn,Et;function Jn(){return Et||(Et=1,Yn=Xt().extend({implicit:[Jt(),Wt()],explicit:[ei(),ni(),ti(),ii()]})),Yn}var Rt;function Bi(){if(Rt)return pn;Rt=1;const n=dn(),i=mn(),o=zi(),h=Jn(),c=Object.prototype.hasOwnProperty,u=1,s=2,f=3,g=4,p=1,l=2,w=3,T=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,U=/[\x85\u2028\u2029]/,J=/[,\[\]{}]/,D=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Y=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function te(e){return Object.prototype.toString.call(e)}function V(e){return e===10||e===13}function O(e){return e===9||e===32}function F(e){return e===9||e===32||e===10||e===13}function Z(e){return e===44||e===91||e===93||e===123||e===125}function W(e){if(e>=48&&e<=57)return e-48;const m=e|32;return m>=97&&m<=102?m-97+10:-1}function oe(e){return e===120?2:e===117?4:e===85?8:0}function ie(e){return e>=48&&e<=57?e-48:-1}function Ce(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
9
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Ne(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Oe(e,m,b){m==="__proto__"?Object.defineProperty(e,m,{configurable:!0,enumerable:!0,writable:!0,value:b}):e[m]=b}const fe=new Array(256),he=new Array(256);for(let e=0;e<256;e++)fe[e]=Ce(e)?1:0,he[e]=Ce(e);function I(e,m){this.input=e,this.filename=m.filename||null,this.schema=m.schema||h,this.onWarning=m.onWarning||null,this.legacy=m.legacy||!1,this.json=m.json||!1,this.listener=m.listener||null,this.maxDepth=typeof m.maxDepth=="number"?m.maxDepth:100,this.maxTotalMergeKeys=typeof m.maxTotalMergeKeys=="number"?m.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function B(e,m){const b={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return b.snippet=o(b),new i(m,b)}function _(e,m){throw B(e,m)}function H(e,m){e.onWarning&&e.onWarning.call(null,B(e,m))}function Q(e,m,b){const j=e.anchorMapTransactions;if(j.length!==0){const a=j[j.length-1];c.call(a,m)||(a[m]={existed:c.call(e.anchorMap,m),value:e.anchorMap[m]})}e.anchorMap[m]=b}function de(e){e.anchorMapTransactions.push(Object.create(null))}function Se(e){const m=e.anchorMapTransactions.pop(),b=e.anchorMapTransactions;if(b.length===0)return;const j=b[b.length-1],a=Object.keys(m);for(let x=0,t=a.length;x<t;x+=1){const d=a[x];c.call(j,d)||(j[d]=m[d])}}function Be(e){const m=e.anchorMapTransactions.pop(),b=Object.keys(m);for(let j=b.length-1;j>=0;j-=1){const a=m[b[j]];a.existed?e.anchorMap[b[j]]=a.value:delete e.anchorMap[b[j]]}}function Re(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function ne(e,m){e.position=m.position,e.line=m.line,e.lineStart=m.lineStart,e.lineIndent=m.lineIndent,e.firstTabInLine=m.firstTabInLine,e.tag=m.tag,e.anchor=m.anchor,e.kind=m.kind,e.result=m.result}const He={YAML:function(m,b,j){m.version!==null&&_(m,"duplication of %YAML directive"),j.length!==1&&_(m,"YAML directive accepts exactly one argument");const a=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);a===null&&_(m,"ill-formed argument of the YAML directive");const x=parseInt(a[1],10),t=parseInt(a[2],10);x!==1&&_(m,"unacceptable YAML version of the document"),m.version=j[0],m.checkLineBreaks=t<2,t!==1&&t!==2&&H(m,"unsupported YAML version of the document")},TAG:function(m,b,j){let a;j.length!==2&&_(m,"TAG directive accepts exactly two arguments");const x=j[0];a=j[1],D.test(x)||_(m,"ill-formed tag handle (first argument) of the TAG directive"),c.call(m.tagMap,x)&&_(m,'there is a previously declared suffix for "'+x+'" tag handle'),Y.test(a)||_(m,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{_(m,"tag prefix is malformed: "+a)}m.tagMap[x]=a}};function se(e,m,b,j){if(m<b){const a=e.input.slice(m,b);if(j)for(let x=0,t=a.length;x<t;x+=1){const d=a.charCodeAt(x);d===9||d>=32&&d<=1114111||_(e,"expected valid JSON character")}else T.test(a)&&_(e,"the stream contains non-printable characters");e.result+=a}}function me(e,m,b,j){n.isObject(b)||_(e,"cannot merge mappings; the provided source object is unacceptable");const a=Object.keys(b);for(let x=0,t=a.length;x<t;x+=1){const d=a[x];e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&_(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")"),c.call(m,d)||(Oe(m,d,b[d]),j[d]=!0)}}function ce(e,m,b,j,a,x,t,d,C){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let v=0,A=a.length;v<A;v+=1)Array.isArray(a[v])&&_(e,"nested arrays are not supported inside keys"),typeof a=="object"&&te(a[v])==="[object Object]"&&(a[v]="[object Object]")}if(typeof a=="object"&&te(a)==="[object Object]"&&(a="[object Object]"),a=String(a),m===null&&(m={}),j==="tag:yaml.org,2002:merge")if(Array.isArray(x))for(let v=0,A=x.length;v<A;v+=1)me(e,m,x[v],b);else me(e,m,x,b);else!e.json&&!c.call(b,a)&&c.call(m,a)&&(e.line=t||e.line,e.lineStart=d||e.lineStart,e.position=C||e.position,_(e,"duplicated mapping key")),Oe(m,a,x),delete b[a];return m}function we(e){const m=e.input.charCodeAt(e.position);m===10?e.position++:m===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):_(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function K(e,m,b){let j=0,a=e.input.charCodeAt(e.position);for(;a!==0;){for(;O(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(m&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(V(a))for(we(e),a=e.input.charCodeAt(e.position),j++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return b!==-1&&j!==0&&e.lineIndent<b&&H(e,"deficient indentation"),j}function Le(e){let m=e.position,b=e.input.charCodeAt(m);return!!((b===45||b===46)&&b===e.input.charCodeAt(m+1)&&b===e.input.charCodeAt(m+2)&&(m+=3,b=e.input.charCodeAt(m),b===0||F(b)))}function pe(e,m){m===1?e.result+=" ":m>1&&(e.result+=n.repeat(`
|
|
10
|
+
`,m-1))}function re(e,m,b){let j,a,x,t,d,C;const v=e.kind,A=e.result;let N=e.input.charCodeAt(e.position);if(F(N)||Z(N)||N===35||N===38||N===42||N===33||N===124||N===62||N===39||N===34||N===37||N===64||N===96)return!1;if(N===63||N===45){const S=e.input.charCodeAt(e.position+1);if(F(S)||b&&Z(S))return!1}for(e.kind="scalar",e.result="",j=a=e.position,x=!1;N!==0;){if(N===58){const S=e.input.charCodeAt(e.position+1);if(F(S)||b&&Z(S))break}else if(N===35){const S=e.input.charCodeAt(e.position-1);if(F(S))break}else{if(e.position===e.lineStart&&Le(e)||b&&Z(N))break;if(V(N))if(t=e.line,d=e.lineStart,C=e.lineIndent,K(e,!1,-1),e.lineIndent>=m){x=!0,N=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=t,e.lineStart=d,e.lineIndent=C;break}}x&&(se(e,j,a,!1),pe(e,e.line-t),j=a=e.position,x=!1),O(N)||(a=e.position+1),N=e.input.charCodeAt(++e.position)}return se(e,j,a,!1),e.result?!0:(e.kind=v,e.result=A,!1)}function ke(e,m){let b,j,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,b=j=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(se(e,b,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)b=e.position,e.position++,j=e.position;else return!0;else V(a)?(se(e,b,j,!0),pe(e,K(e,!1,m)),b=j=e.position):e.position===e.lineStart&&Le(e)?_(e,"unexpected end of the document within a single quoted scalar"):(e.position++,O(a)||(j=e.position));_(e,"unexpected end of the stream within a single quoted scalar")}function Ie(e,m){let b,j,a,x=e.input.charCodeAt(e.position);if(x!==34)return!1;for(e.kind="scalar",e.result="",e.position++,b=j=e.position;(x=e.input.charCodeAt(e.position))!==0;){if(x===34)return se(e,b,e.position,!0),e.position++,!0;if(x===92){if(se(e,b,e.position,!0),x=e.input.charCodeAt(++e.position),V(x))K(e,!1,m);else if(x<256&&fe[x])e.result+=he[x],e.position++;else if((a=oe(x))>0){let t=a,d=0;for(;t>0;t--)x=e.input.charCodeAt(++e.position),(a=W(x))>=0?d=(d<<4)+a:_(e,"expected hexadecimal character");e.result+=Ne(d),e.position++}else _(e,"unknown escape sequence");b=j=e.position}else V(x)?(se(e,b,j,!0),pe(e,K(e,!1,m)),b=j=e.position):e.position===e.lineStart&&Le(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,O(x)||(j=e.position))}_(e,"unexpected end of the stream within a double quoted scalar")}function Te(e,m){let b=!0,j,a,x;const t=e.tag;let d;const C=e.anchor;let v,A,N,S;const R=Object.create(null);let E,k,M,z=e.input.charCodeAt(e.position);if(z===91)v=93,S=!1,d=[];else if(z===123)v=125,S=!0,d={};else return!1;for(e.anchor!==null&&Q(e,e.anchor,d),z=e.input.charCodeAt(++e.position);z!==0;){if(K(e,!0,m),z=e.input.charCodeAt(e.position),z===v)return e.position++,e.tag=t,e.anchor=C,e.kind=S?"mapping":"sequence",e.result=d,!0;if(b?z===44&&_(e,"expected the node content, but found ','"):_(e,"missed comma between flow collection entries"),k=E=M=null,A=N=!1,z===63){const X=e.input.charCodeAt(e.position+1);F(X)&&(A=N=!0,e.position++,K(e,!0,m))}j=e.line,a=e.lineStart,x=e.position,_e(e,m,u,!1,!0),k=e.tag,E=e.result,K(e,!0,m),z=e.input.charCodeAt(e.position),(N||e.line===j)&&z===58&&(A=!0,z=e.input.charCodeAt(++e.position),K(e,!0,m),_e(e,m,u,!1,!0),M=e.result),S?ce(e,d,R,k,E,M,j,a,x):A?d.push(ce(e,null,R,k,E,M,j,a,x)):d.push(E),K(e,!0,m),z=e.input.charCodeAt(e.position),z===44?(b=!0,z=e.input.charCodeAt(++e.position)):b=!1}_(e,"unexpected end of the stream within a flow collection")}function Ge(e,m){let b,j=p,a=!1,x=!1,t=m,d=0,C=!1,v,A=e.input.charCodeAt(e.position);if(A===124)b=!1;else if(A===62)b=!0;else return!1;for(e.kind="scalar",e.result="";A!==0;)if(A=e.input.charCodeAt(++e.position),A===43||A===45)p===j?j=A===43?w:l:_(e,"repeat of a chomping mode identifier");else if((v=ie(A))>=0)v===0?_(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):x?_(e,"repeat of an indentation width identifier"):(t=m+v-1,x=!0);else break;if(O(A)){do A=e.input.charCodeAt(++e.position);while(O(A));if(A===35)do A=e.input.charCodeAt(++e.position);while(!V(A)&&A!==0)}for(;A!==0;){for(we(e),e.lineIndent=0,A=e.input.charCodeAt(e.position);(!x||e.lineIndent<t)&&A===32;)e.lineIndent++,A=e.input.charCodeAt(++e.position);if(!x&&e.lineIndent>t&&(t=e.lineIndent),V(A)){d++;continue}if(!x&&t===0&&_(e,"missing indentation for block scalar"),e.lineIndent<t){j===w?e.result+=n.repeat(`
|
|
11
|
+
`,a?1+d:d):j===p&&a&&(e.result+=`
|
|
12
|
+
`);break}b?O(A)?(C=!0,e.result+=n.repeat(`
|
|
13
|
+
`,a?1+d:d)):C?(C=!1,e.result+=n.repeat(`
|
|
14
|
+
`,d+1)):d===0?a&&(e.result+=" "):e.result+=n.repeat(`
|
|
15
|
+
`,d):e.result+=n.repeat(`
|
|
16
|
+
`,a?1+d:d),a=!0,x=!0,d=0;const N=e.position;for(;!V(A)&&A!==0;)A=e.input.charCodeAt(++e.position);se(e,N,e.position,!1)}return!0}function ue(e,m){const b=e.tag,j=e.anchor,a=[];let x=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&Q(e,e.anchor,a);let t=e.input.charCodeAt(e.position);for(;t!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),t===45);){const d=e.input.charCodeAt(e.position+1);if(!F(d))break;if(x=!0,e.position++,K(e,!0,-1)&&e.lineIndent<=m){a.push(null),t=e.input.charCodeAt(e.position);continue}const C=e.line;if(_e(e,m,f,!1,!0),a.push(e.result),K(e,!0,-1),t=e.input.charCodeAt(e.position),(e.line===C||e.lineIndent>m)&&t!==0)_(e,"bad indentation of a sequence entry");else if(e.lineIndent<m)break}return x?(e.tag=b,e.anchor=j,e.kind="sequence",e.result=a,!0):!1}function qe(e,m,b){let j,a,x,t;const d=e.tag,C=e.anchor,v={},A=Object.create(null);let N=null,S=null,R=null,E=!1,k=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&Q(e,e.anchor,v);let M=e.input.charCodeAt(e.position);for(;M!==0;){!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation"));const z=e.input.charCodeAt(e.position+1),X=e.line;if((M===63||M===58)&&F(z))M===63?(E&&(ce(e,v,A,N,S,null,a,x,t),N=S=R=null),k=!0,E=!0,j=!0):E?(E=!1,j=!0):_(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,M=z;else{if(a=e.line,x=e.lineStart,t=e.position,!_e(e,b,s,!1,!0))break;if(e.line===X){for(M=e.input.charCodeAt(e.position);O(M);)M=e.input.charCodeAt(++e.position);if(M===58)M=e.input.charCodeAt(++e.position),F(M)||_(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(ce(e,v,A,N,S,null,a,x,t),N=S=R=null),k=!0,E=!1,j=!1,N=e.tag,S=e.result;else if(k)_(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=C,!0}else if(k)_(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=C,!0}if((e.line===X||e.lineIndent>m)&&(E&&(a=e.line,x=e.lineStart,t=e.position),_e(e,m,g,!0,j)&&(E?S=e.result:R=e.result),E||(ce(e,v,A,N,S,R,a,x,t),N=S=R=null),K(e,!0,-1),M=e.input.charCodeAt(e.position)),(e.line===X||e.lineIndent>m)&&M!==0)_(e,"bad indentation of a mapping entry");else if(e.lineIndent<m)break}return E&&ce(e,v,A,N,S,null,a,x,t),k&&(e.tag=d,e.anchor=C,e.kind="mapping",e.result=v),k}function Pe(e){let m=!1,b=!1,j,a,x=e.input.charCodeAt(e.position);if(x!==33)return!1;e.tag!==null&&_(e,"duplication of a tag property"),x=e.input.charCodeAt(++e.position),x===60?(m=!0,x=e.input.charCodeAt(++e.position)):x===33?(b=!0,j="!!",x=e.input.charCodeAt(++e.position)):j="!";let t=e.position;if(m){do x=e.input.charCodeAt(++e.position);while(x!==0&&x!==62);e.position<e.length?(a=e.input.slice(t,e.position),x=e.input.charCodeAt(++e.position)):_(e,"unexpected end of the stream within a verbatim tag")}else{for(;x!==0&&!F(x);)x===33&&(b?_(e,"tag suffix cannot contain exclamation marks"):(j=e.input.slice(t-1,e.position+1),D.test(j)||_(e,"named tag handle cannot contain such characters"),b=!0,t=e.position+1)),x=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),J.test(a)&&_(e,"tag suffix cannot contain flow indicator characters")}a&&!Y.test(a)&&_(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{_(e,"tag name is malformed: "+a)}return m?e.tag=a:c.call(e.tagMap,j)?e.tag=e.tagMap[j]+a:j==="!"?e.tag="!"+a:j==="!!"?e.tag="tag:yaml.org,2002:"+a:_(e,'undeclared tag handle "'+j+'"'),!0}function ae(e){let m=e.input.charCodeAt(e.position);if(m!==38)return!1;e.anchor!==null&&_(e,"duplication of an anchor property"),m=e.input.charCodeAt(++e.position);const b=e.position;for(;m!==0&&!F(m)&&!Z(m);)m=e.input.charCodeAt(++e.position);return e.position===b&&_(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(b,e.position),!0}function ye(e){let m=e.input.charCodeAt(e.position);if(m!==42)return!1;m=e.input.charCodeAt(++e.position);const b=e.position;for(;m!==0&&!F(m)&&!Z(m);)m=e.input.charCodeAt(++e.position);e.position===b&&_(e,"name of an alias node must contain at least one character");const j=e.input.slice(b,e.position);return c.call(e.anchorMap,j)||_(e,'unidentified alias "'+j+'"'),e.result=e.anchorMap[j],K(e,!0,-1),!0}function Fe(e,m,b,j){const a=Re(e);return de(e),ne(e,m),e.tag=null,e.anchor=null,e.kind=null,e.result=null,qe(e,b,j)&&e.kind==="mapping"?(Se(e),!0):(Be(e),ne(e,a),!1)}function _e(e,m,b,j,a){let x,t,d=1,C=!1,v=!1,A=null,N,S,R;e.depth>=e.maxDepth&&_(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;const E=x=t=g===b||f===b;if(j&&K(e,!0,-1)&&(C=!0,e.lineIndent>m?d=1:e.lineIndent===m?d=0:e.lineIndent<m&&(d=-1)),d===1)for(;;){const k=e.input.charCodeAt(e.position),M=Re(e);if(C&&(k===33&&e.tag!==null||k===38&&e.anchor!==null)||!Pe(e)&&!ae(e))break;A===null&&(A=M),K(e,!0,-1)?(C=!0,t=E,e.lineIndent>m?d=1:e.lineIndent===m?d=0:e.lineIndent<m&&(d=-1)):t=!1}if(t&&(t=C||a),d===1||g===b)if(u===b||s===b?S=m:S=m+1,R=e.position-e.lineStart,d===1)if(t&&(ue(e,R)||qe(e,R,S))||Te(e,S))v=!0;else{const k=e.input.charCodeAt(e.position);A!==null&&E&&!t&&k!==124&&k!==62&&Fe(e,A,A.position-A.lineStart,S)||x&&Ge(e,S)||ke(e,S)||Ie(e,S)?v=!0:ye(e)?(v=!0,(e.tag!==null||e.anchor!==null)&&_(e,"alias node should not have any properties")):re(e,S,u===b)&&(v=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&Q(e,e.anchor,e.result)}else d===0&&(v=t&&ue(e,R));if(e.tag===null)e.anchor!==null&&Q(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&_(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let k=0,M=e.implicitTypes.length;k<M;k+=1)if(N=e.implicitTypes[k],N.resolve(e.result)){e.result=N.construct(e.result),e.tag=N.tag,e.anchor!==null&&Q(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(c.call(e.typeMap[e.kind||"fallback"],e.tag))N=e.typeMap[e.kind||"fallback"][e.tag];else{N=null;const k=e.typeMap.multi[e.kind||"fallback"];for(let M=0,z=k.length;M<z;M+=1)if(e.tag.slice(0,k[M].tag.length)===k[M].tag){N=k[M];break}}N||_(e,"unknown tag !<"+e.tag+">"),e.result!==null&&N.kind!==e.kind&&_(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+N.kind+'", not "'+e.kind+'"'),N.resolve(e.result,e.tag)?(e.result=N.construct(e.result,e.tag),e.anchor!==null&&Q(e,e.anchor,e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||v}function De(e){const m=e.position;let b=!1,j;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(j=e.input.charCodeAt(e.position))!==0&&(K(e,!0,-1),j=e.input.charCodeAt(e.position),!(e.lineIndent>0||j!==37));){b=!0,j=e.input.charCodeAt(++e.position);let a=e.position;for(;j!==0&&!F(j);)j=e.input.charCodeAt(++e.position);const x=e.input.slice(a,e.position),t=[];for(x.length<1&&_(e,"directive name must not be less than one character in length");j!==0;){for(;O(j);)j=e.input.charCodeAt(++e.position);if(j===35){do j=e.input.charCodeAt(++e.position);while(j!==0&&!V(j));break}if(V(j))break;for(a=e.position;j!==0&&!F(j);)j=e.input.charCodeAt(++e.position);t.push(e.input.slice(a,e.position))}j!==0&&we(e),c.call(He,x)?He[x](e,x,t):H(e,'unknown document directive "'+x+'"')}if(K(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,K(e,!0,-1)):b&&_(e,"directives end mark is expected"),_e(e,e.lineIndent-1,g,!1,!0),K(e,!0,-1),e.checkLineBreaks&&U.test(e.input.slice(m,e.position))&&H(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Le(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,K(e,!0,-1));return}e.position<e.length-1&&_(e,"end of the stream or a document separator is expected")}function Ue(e,m){e=String(e),m=m||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));const b=new I(e,m),j=e.indexOf("\0");for(j!==-1&&(b.position=j,_(b,"null byte is not allowed in input")),b.input+="\0";b.input.charCodeAt(b.position)===32;)b.lineIndent+=1,b.position+=1;for(;b.position<b.length-1;)De(b);return b.documents}function Ke(e,m,b){m!==null&&typeof m=="object"&&typeof b>"u"&&(b=m,m=null);const j=Ue(e,b);if(typeof m!="function")return j;for(let a=0,x=j.length;a<x;a+=1)m(j[a])}function Ye(e,m){const b=Ue(e,m);if(b.length!==0){if(b.length===1)return b[0];throw new i("expected a single document in the stream, but found more")}}return pn.loadAll=Ke,pn.load=Ye,pn}var Gn={},Tt;function Hi(){if(Tt)return Gn;Tt=1;const n=dn(),i=mn(),o=Jn(),h=Object.prototype.toString,c=Object.prototype.hasOwnProperty,u=65279,s=9,f=10,g=13,p=32,l=33,w=34,T=35,U=37,J=38,D=39,Y=42,te=44,V=45,O=58,F=61,Z=62,W=63,oe=64,ie=91,Ce=93,Ne=96,Oe=123,fe=124,he=125,I={};I[0]="\\0",I[7]="\\a",I[8]="\\b",I[9]="\\t",I[10]="\\n",I[11]="\\v",I[12]="\\f",I[13]="\\r",I[27]="\\e",I[34]='\\"',I[92]="\\\\",I[133]="\\N",I[160]="\\_",I[8232]="\\L",I[8233]="\\P";const B=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],_=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function H(t,d){if(d===null)return{};const C={},v=Object.keys(d);for(let A=0,N=v.length;A<N;A+=1){let S=v[A],R=String(d[S]);S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2));const E=t.compiledTypeMap.fallback[S];E&&c.call(E.styleAliases,R)&&(R=E.styleAliases[R]),C[S]=R}return C}function Q(t){let d,C;const v=t.toString(16).toUpperCase();if(t<=255)d="x",C=2;else if(t<=65535)d="u",C=4;else if(t<=4294967295)d="U",C=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+d+n.repeat("0",C-v.length)+v}const de=1,Se=2;function Be(t){this.schema=t.schema||o,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=n.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=H(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Se:de,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Re(t,d){const C=n.repeat(" ",d);let v=0,A="";const N=t.length;for(;v<N;){let S;const R=t.indexOf(`
|
|
18
|
+
`,v);R===-1?(S=t.slice(v),v=N):(S=t.slice(v,R+1),v=R+1),S.length&&S!==`
|
|
19
|
+
`&&(A+=C),A+=S}return A}function ne(t,d){return`
|
|
20
|
+
`+n.repeat(" ",t.indent*d)}function He(t,d){for(let C=0,v=t.implicitTypes.length;C<v;C+=1)if(t.implicitTypes[C].resolve(d))return!0;return!1}function se(t){return t===p||t===s}function me(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==u||t>=65536&&t<=1114111}function ce(t){return me(t)&&t!==u&&t!==g&&t!==f}function we(t,d,C){const v=ce(t),A=v&&!se(t);return(C?v:v&&t!==te&&t!==ie&&t!==Ce&&t!==Oe&&t!==he)&&t!==T&&!(d===O&&!A)||ce(d)&&!se(d)&&t===T||d===O&&A}function K(t){return me(t)&&t!==u&&!se(t)&&t!==V&&t!==W&&t!==O&&t!==te&&t!==ie&&t!==Ce&&t!==Oe&&t!==he&&t!==T&&t!==J&&t!==Y&&t!==l&&t!==fe&&t!==F&&t!==Z&&t!==D&&t!==w&&t!==U&&t!==oe&&t!==Ne}function Le(t){return!se(t)&&t!==O}function pe(t,d){const C=t.charCodeAt(d);let v;return C>=55296&&C<=56319&&d+1<t.length&&(v=t.charCodeAt(d+1),v>=56320&&v<=57343)?(C-55296)*1024+v-56320+65536:C}function re(t){return/^\n* /.test(t)}const ke=1,Ie=2,Te=3,Ge=4,ue=5;function qe(t,d,C,v,A,N,S,R){let E,k=0,M=null,z=!1,X=!1;const on=v!==-1;let Ze=-1,Xe=K(pe(t,0))&&Le(pe(t,t.length-1));if(d||S)for(E=0;E<t.length;k>=65536?E+=2:E++){if(k=pe(t,E),!me(k))return ue;Xe=Xe&&we(k,M,R),M=k}else{for(E=0;E<t.length;k>=65536?E+=2:E++){if(k=pe(t,E),k===f)z=!0,on&&(X=X||E-Ze-1>v&&t[Ze+1]!==" ",Ze=E);else if(!me(k))return ue;Xe=Xe&&we(k,M,R),M=k}X=X||on&&E-Ze-1>v&&t[Ze+1]!==" "}return!z&&!X?Xe&&!S&&!A(t)?ke:N===Se?ue:Ie:C>9&&re(t)?ue:S?N===Se?ue:Ie:X?Ge:Te}function Pe(t,d,C,v,A){t.dump=(function(){if(d.length===0)return t.quotingType===Se?'""':"''";if(!t.noCompatMode&&(B.indexOf(d)!==-1||_.test(d)))return t.quotingType===Se?'"'+d+'"':"'"+d+"'";const N=t.indent*Math.max(1,C),S=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-N),R=v||t.flowLevel>-1&&C>=t.flowLevel;function E(k){return He(t,k)}switch(qe(d,R,t.indent,S,E,t.quotingType,t.forceQuotes&&!v,A)){case ke:return d;case Ie:return"'"+d.replace(/'/g,"''")+"'";case Te:return"|"+ae(d,t.indent)+ye(Re(d,N));case Ge:return">"+ae(d,t.indent)+ye(Re(Fe(d,S),N));case ue:return'"'+De(d)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function ae(t,d){const C=re(t)?String(d):"",v=t[t.length-1]===`
|
|
21
|
+
`,N=v&&(t[t.length-2]===`
|
|
22
|
+
`||t===`
|
|
23
|
+
`)?"+":v?"":"-";return C+N+`
|
|
24
|
+
`}function ye(t){return t[t.length-1]===`
|
|
25
|
+
`?t.slice(0,-1):t}function Fe(t,d){const C=/(\n+)([^\n]*)/g;let v=(function(){let R=t.indexOf(`
|
|
26
|
+
`);return R=R!==-1?R:t.length,C.lastIndex=R,_e(t.slice(0,R),d)})(),A=t[0]===`
|
|
27
|
+
`||t[0]===" ",N,S;for(;S=C.exec(t);){const R=S[1],E=S[2];N=E[0]===" ",v+=R+(!A&&!N&&E!==""?`
|
|
28
|
+
`:"")+_e(E,d),A=N}return v}function _e(t,d){if(t===""||t[0]===" ")return t;const C=/ [^ ]/g;let v,A=0,N,S=0,R=0,E="";for(;v=C.exec(t);)R=v.index,R-A>d&&(N=S>A?S:R,E+=`
|
|
29
|
+
`+t.slice(A,N),A=N+1),S=R;return E+=`
|
|
30
|
+
`,t.length-A>d&&S>A?E+=t.slice(A,S)+`
|
|
31
|
+
`+t.slice(S+1):E+=t.slice(A),E.slice(1)}function De(t){let d="",C=0;for(let v=0;v<t.length;C>=65536?v+=2:v++){C=pe(t,v);const A=I[C];!A&&me(C)?(d+=t[v],C>=65536&&(d+=t[v+1])):d+=A||Q(C)}return d}function Ue(t,d,C){let v="";const A=t.tag;for(let N=0,S=C.length;N<S;N+=1){let R=C[N];t.replacer&&(R=t.replacer.call(C,String(N),R)),(b(t,d,R,!1,!1)||typeof R>"u"&&b(t,d,null,!1,!1))&&(v!==""&&(v+=","+(t.condenseFlow?"":" ")),v+=t.dump)}t.tag=A,t.dump="["+v+"]"}function Ke(t,d,C,v){let A="";const N=t.tag;for(let S=0,R=C.length;S<R;S+=1){let E=C[S];t.replacer&&(E=t.replacer.call(C,String(S),E)),(b(t,d+1,E,!0,!0,!1,!0)||typeof E>"u"&&b(t,d+1,null,!0,!0,!1,!0))&&((!v||A!=="")&&(A+=ne(t,d)),t.dump&&f===t.dump.charCodeAt(0)?A+="-":A+="- ",A+=t.dump)}t.tag=N,t.dump=A||"[]"}function Ye(t,d,C){let v="";const A=t.tag,N=Object.keys(C);for(let S=0,R=N.length;S<R;S+=1){let E="";v!==""&&(E+=", "),t.condenseFlow&&(E+='"');const k=N[S];let M=C[k];t.replacer&&(M=t.replacer.call(C,k,M)),b(t,d,k,!1,!1)&&(t.dump.length>1024&&(E+="? "),E+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),b(t,d,M,!1,!1)&&(E+=t.dump,v+=E))}t.tag=A,t.dump="{"+v+"}"}function e(t,d,C,v){let A="";const N=t.tag,S=Object.keys(C);if(t.sortKeys===!0)S.sort();else if(typeof t.sortKeys=="function")S.sort(t.sortKeys);else if(t.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let R=0,E=S.length;R<E;R+=1){let k="";(!v||A!=="")&&(k+=ne(t,d));const M=S[R];let z=C[M];if(t.replacer&&(z=t.replacer.call(C,M,z)),!b(t,d+1,M,!0,!0,!0))continue;const X=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;X&&(t.dump&&f===t.dump.charCodeAt(0)?k+="?":k+="? "),k+=t.dump,X&&(k+=ne(t,d)),b(t,d+1,z,!0,X)&&(t.dump&&f===t.dump.charCodeAt(0)?k+=":":k+=": ",k+=t.dump,A+=k)}t.tag=N,t.dump=A||"{}"}function m(t,d,C){const v=C?t.explicitTypes:t.implicitTypes;for(let A=0,N=v.length;A<N;A+=1){const S=v[A];if((S.instanceOf||S.predicate)&&(!S.instanceOf||typeof d=="object"&&d instanceof S.instanceOf)&&(!S.predicate||S.predicate(d))){if(C?S.multi&&S.representName?t.tag=S.representName(d):t.tag=S.tag:t.tag="?",S.represent){const R=t.styleMap[S.tag]||S.defaultStyle;let E;if(h.call(S.represent)==="[object Function]")E=S.represent(d,R);else if(c.call(S.represent,R))E=S.represent[R](d,R);else throw new i("!<"+S.tag+'> tag resolver accepts not "'+R+'" style');t.dump=E}return!0}}return!1}function b(t,d,C,v,A,N,S){t.tag=null,t.dump=C,m(t,C,!1)||m(t,C,!0);const R=h.call(t.dump),E=v;v&&(v=t.flowLevel<0||t.flowLevel>d);const k=R==="[object Object]"||R==="[object Array]";let M,z;if(k&&(M=t.duplicates.indexOf(C),z=M!==-1),(t.tag!==null&&t.tag!=="?"||z||t.indent!==2&&d>0)&&(A=!1),z&&t.usedDuplicates[M])t.dump="*ref_"+M;else{if(k&&z&&!t.usedDuplicates[M]&&(t.usedDuplicates[M]=!0),R==="[object Object]")v&&Object.keys(t.dump).length!==0?(e(t,d,t.dump,A),z&&(t.dump="&ref_"+M+t.dump)):(Ye(t,d,t.dump),z&&(t.dump="&ref_"+M+" "+t.dump));else if(R==="[object Array]")v&&t.dump.length!==0?(t.noArrayIndent&&!S&&d>0?Ke(t,d-1,t.dump,A):Ke(t,d,t.dump,A),z&&(t.dump="&ref_"+M+t.dump)):(Ue(t,d,t.dump),z&&(t.dump="&ref_"+M+" "+t.dump));else if(R==="[object String]")t.tag!=="?"&&Pe(t,t.dump,d,N,E);else{if(R==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+R)}if(t.tag!==null&&t.tag!=="?"){let X=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?X="!"+X:X.slice(0,18)==="tag:yaml.org,2002:"?X="!!"+X.slice(18):X="!<"+X+">",t.dump=X+" "+t.dump}}return!0}function j(t,d){const C=[],v=[];a(t,C,v);const A=v.length;for(let N=0;N<A;N+=1)d.duplicates.push(C[v[N]]);d.usedDuplicates=new Array(A)}function a(t,d,C){if(t!==null&&typeof t=="object"){const v=d.indexOf(t);if(v!==-1)C.indexOf(v)===-1&&C.push(v);else if(d.push(t),Array.isArray(t))for(let A=0,N=t.length;A<N;A+=1)a(t[A],d,C);else{const A=Object.keys(t);for(let N=0,S=A.length;N<S;N+=1)a(t[A[N]],d,C)}}}function x(t,d){d=d||{};const C=new Be(d);C.noRefs||j(t,C);let v=t;return C.replacer&&(v=C.replacer.call({"":v},"",v)),b(C,0,v,!0,!0)?C.dump+`
|
|
32
|
+
`:""}return Gn.dump=x,Gn}var Pt;function Yi(){if(Pt)return be;Pt=1;const n=Bi(),i=Hi();function o(h,c){return function(){throw new Error("Function yaml."+h+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}return be.Type=Ae(),be.Schema=$t(),be.FAILSAFE_SCHEMA=Yt(),be.JSON_SCHEMA=Zt(),be.CORE_SCHEMA=Xt(),be.DEFAULT_SCHEMA=Jn(),be.load=n.load,be.loadAll=n.loadAll,be.dump=i.dump,be.YAMLException=mn(),be.types={binary:ei(),float:Qt(),map:Ht(),null:Gt(),pairs:ti(),set:ii(),timestamp:Jt(),bool:Kt(),int:Vt(),merge:Wt(),omap:ni(),seq:Bt(),str:zt()},be.safeLoad=o("safeLoad","load"),be.safeLoadAll=o("safeLoadAll","loadAll"),be.safeDump=o("safeDump","dump"),be}var Gi=Yi();const Ki=$i(Gi),{Type:da,Schema:ma,FAILSAFE_SCHEMA:pa,JSON_SCHEMA:fa,CORE_SCHEMA:ha,DEFAULT_SCHEMA:ga,load:xa,loadAll:ba,dump:Sa,YAMLException:ya,types:va,safeLoad:ja,safeLoadAll:Aa,safeDump:Ca}=Ki,Sn=3e3,yn=9999,an="openpond.yaml",Vi=["google","github","x"],Wn=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),Ot=le(L().trim().min(1).max(1e3)).max(50),un=L().trim().min(1).max(4096).refine(li,{message:"path must be a relative workspace path"}),Qi=L().trim().min(1).max(500).refine(n=>!n.includes("\0")&&!/\s/.test(n),"image ref must be a single OCI reference"),Zi=L().trim().regex(/^sha256:[0-9a-f]{64}$/i),ri=L().trim().min(1).max(500).refine(n=>n.startsWith("/")&&!n.includes("\0"),"workspaceRoot must be an absolute guest path"),Xi=ee({ref:Qi,digest:Zi.optional(),registrySecretRef:L().trim().min(1).max(500).optional(),platform:bn("linux/amd64").optional(),workspaceRoot:ri.optional()}).strict(),Ji=ee({context:un.default("."),path:un.default("Dockerfile"),target:L().trim().min(1).max(191).optional(),buildArgs:Qe(L().max(191),L().max(500)).optional(),registrySecretRefs:le(L().trim().min(1).max(500)).max(10).optional(),platform:bn("linux/amd64").optional(),workspaceRoot:ri.optional()}).strict(),Wi=ee({base:L().trim().min(1).max(120).optional(),snapshot:L().trim().min(1).max(191).optional(),image:Xi.optional(),dockerfile:Ji.optional()}).strict().superRefine((n,i)=>{[n.base,n.snapshot,n.image,n.dockerfile].filter(Boolean).length!==1&&i.addIssue({code:Ee.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),ai=ee({cpu:ze().positive().max(8).optional(),memoryGb:ze().positive().max(32).optional(),diskGb:ze().positive().max(100).optional()}).strict(),er=ee({provider:rn(Vi),scopes:le(L().trim().min(1).max(200)).max(100).default([]),capabilities:le(L().trim().min(1).max(200)).max(100).default([])}).strict(),nr=ee({models:le(L().trim().min(1).max(200)).max(100).default([]),scopes:le(L().trim().min(1).max(200)).max(100).default([])}).strict(),tr=ee({opchat:nr.optional()}).catchall(Qe(L(),We())).default({}),ir=ee({name:L().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:L().trim().min(1).max(256).optional(),storageGb:ze().int().positive().max(100).optional(),deleteOnSandboxDelete:en().optional()}).strict(),rr=ee({port:ze().int().min(Sn).max(yn).refine(n=>!Wn.has(n),{message:"preview port is reserved"}),protocol:bn("http").default("http"),label:L().trim().min(1).max(80).optional(),access:rn(["private","public"]).default("private"),path:L().trim().min(1).max(512).refine(n=>n.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),oi=ee({command:L().trim().min(1).max(1e3),cwd:un.optional(),timeoutSeconds:ze().int().positive().max(86400).optional(),requiresStart:en().default(!1),ports:le(rr).max(20).default([]),artifactPaths:le(un).max(100).default([])}).strict(),Lt=oi.extend({name:L().trim().min(1).max(80)}).strict(),ar=ee({name:L().trim().min(1).max(80).optional(),service:L().trim().min(1).max(80).optional(),port:ze().int().min(Sn).max(yn).refine(n=>!Wn.has(n),{message:"app MCP port is reserved"}),path:L().trim().min(1).max(512).refine(n=>n.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),or=ee({name:L().trim().min(1).max(80).optional(),port:ze().int().min(Sn).max(yn).refine(n=>!Wn.has(n),{message:"validation probe port is reserved"}),path:L().trim().min(1).max(512).refine(n=>n.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:ze().int().min(100).max(599).default(200)}).strict(),lr=Qe(L(),We()).refine(n=>n.type==="object","input schema must be a JSON schema object"),sr=ee({name:L().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:en().default(!1),secret:en().default(!0),description:L().trim().max(500).optional()}).strict(),Kn=L().trim().min(1).max(120),cr=ee({name:L().trim().min(1).max(120),description:L().trim().max(500).optional(),cron:L().trim().min(1).max(500).optional(),rate:L().trim().min(1).max(500).optional(),once:Kn.optional(),scheduleType:rn(["rate","cron","once"]).optional(),scheduleExpression:L().trim().min(1).max(500).optional(),timezone:L().trim().min(1).max(100).optional(),enabled:en().default(!0),startAt:Kn.optional(),endAt:Kn.optional(),maxRuns:ze().int().positive().nullable().optional(),runtimePolicy:rn(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:L().trim().min(1).max(120).optional(),actionName:L().trim().min(1).max(120).optional(),command:L().trim().min(1).max(2e3).optional(),target:ee({kind:rn(["start","action","service","command"]).optional(),name:L().trim().min(1).max(120).optional(),actionName:L().trim().min(1).max(120).optional(),command:L().trim().min(1).max(2e3).optional(),requiresStart:en().optional()}).strict().optional(),requiresStart:en().optional(),budget:ee({maxUsd:L().trim().min(1).max(40).optional()}).strict().optional(),resources:ai.optional(),quotas:Qe(L(),We()).optional(),lifecycle:Qe(L(),We()).optional(),retentionPolicy:Qe(L(),We()).optional(),env:le(ee({name:L().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:L().optional(),secretRef:L().optional()}).strict()).max(100).optional(),integrationLeases:le(Qe(L(),We())).max(20).optional(),metadata:Qe(L(),We()).optional()}).strict().superRefine((n,i)=>{[n.cron,n.rate,n.once,n.scheduleExpression].filter(f=>typeof f=="string"&&f.trim()).length!==1&&i.addIssue({code:Ee.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),n.scheduleExpression&&!n.scheduleType&&i.addIssue({code:Ee.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});const h=n.command??n.target?.command??null,c=n.target?.name??null,u=n.actionName??n.action??n.target?.actionName??(n.target?.kind==="action"?c:null),s=n.target?.kind??(h?"command":"action");s==="action"&&!u&&i.addIssue({code:Ee.custom,path:["action"],message:"schedule action target is required"}),s==="service"&&!c&&i.addIssue({code:Ee.custom,path:["target","name"],message:"schedule service target name is required"}),s==="command"&&!h&&i.addIssue({code:Ee.custom,path:["command"],message:"schedule command target is required"})});ee({schemaVersion:bn(1),name:L().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:L().trim().min(1).max(40),useCase:L().trim().min(1).max(80),description:L().trim().min(1).max(500),runtime:Wi,resources:ai.optional(),setup:ee({commands:Ot.default([])}).strict().default({commands:[]}),validation:ee({commands:Ot.min(1),probes:le(or).max(20).default([])}).strict(),start:oi,actions:le(Lt).max(20).default([]),services:le(Lt).max(20).default([]),schedules:le(cr).max(20).default([]),mcp:ee({endpoints:le(ar).max(10).default([])}).strict().default({endpoints:[]}),volumes:le(ir).max(5).default([]),integrations:ee({requiredLeases:le(er).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:tr,inputs:ee({schema:lr.default({type:"object"}),env:le(sr).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:ee({paths:le(un).max(100).default([])}).strict().default({paths:[]}),network:ee({egress:rn(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((n,i)=>{ur(n,i),nt(i,n.volumes.flatMap(o=>o.name?[o.name]:[]),"volume names must be unique","volumes"),dr(n,i),mr(n,i),pr(n,i),fr(n,i)});ee({path:L(),message:L(),code:L()});function et(n){return[{kind:"start",name:"start",...n.start,artifactPaths:Qn(n.start,n)},...n.actions.map(i=>({kind:"action",name:i.name,command:i.command,cwd:i.cwd,timeoutSeconds:i.timeoutSeconds,requiresStart:i.requiresStart,ports:i.ports,artifactPaths:Qn(i,n)})),...n.services.map(i=>({kind:"service",name:i.name,command:i.command,cwd:i.cwd,timeoutSeconds:i.timeoutSeconds,requiresStart:i.requiresStart,ports:i.ports,artifactPaths:Qn(i,n)}))]}function li(n){return!n.includes("\0")&&!n.startsWith("/")&&!n.split(/[\\/]+/).some(i=>i===".."||i==="")}function nt(n,i,o,h){const c=new Set;for(const u of i){if(c.has(u)){n.addIssue({code:Ee.custom,path:[h],message:o});return}c.add(u)}}function ur(n,i){const o=["start",...n.actions.map(h=>h.name),...n.services.map(h=>h.name)];nt(i,o,"start, action, and service names must be unique","actions")}function dr(n,i){const o=Vn(n.inputs.schema.properties),h=new Set(n.volumes.map(c=>c.name).filter(c=>!!c));for(const[c,u]of Object.entries(o)){const s=Vn(u),f=Vn(s["x-openpond-upload"]??s.xOpenPondUpload),g=typeof f.targetPath=="string"&&f.targetPath.trim()?f.targetPath.trim():typeof f.path=="string"&&f.path.trim()?f.path.trim():"";if(!g)continue;const p=g.replace(/^workspace\//,"").replace(/^\/+/,"").replace(/\/+$/,"");if(!li(p)){i.addIssue({code:Ee.custom,path:["inputs","schema","properties",c,"x-openpond-upload","targetPath"],message:"upload target must be a relative workspace path"});continue}const l=p.split("/");l[0]==="volumes"&&(!l[1]||!h.has(l[1]))&&i.addIssue({code:Ee.custom,path:["inputs","schema","properties",c,"x-openpond-upload","targetPath"],message:"upload target references an undeclared volume"})}}function mr(n,i){nt(i,n.inputs.env.map(o=>o.name),"env input names must be unique","inputs")}function pr(n,i){const o=new Map(n.services.map(c=>[c.name,new Set(c.ports.map(u=>u.port))])),h=new Set([...n.start.ports.map(c=>c.port),...n.services.flatMap(c=>c.ports.map(u=>u.port))]);for(const[c,u]of n.mcp.endpoints.entries()){if(u.service){const s=o.get(u.service);if(!s){i.addIssue({code:Ee.custom,path:["mcp","endpoints",c,"service"],message:`app MCP service does not exist: ${u.service}`});continue}s.has(u.port)||i.addIssue({code:Ee.custom,path:["mcp","endpoints",c,"port"],message:`app MCP port ${u.port} is not declared on service ${u.service}`});continue}h.has(u.port)||i.addIssue({code:Ee.custom,path:["mcp","endpoints",c,"port"],message:`app MCP port ${u.port} is not declared on start or services`})}}function fr(n,i){const o=new Set(n.actions.map(c=>c.name)),h=new Set(n.services.map(c=>c.name));for(const[c,u]of n.schedules.entries()){const s=u.command??u.target?.command??null;if(u.target?.kind==="command"||s)continue;const f=u.actionName??u.action??u.target?.actionName??(u.target?.kind==="action"?u.target?.name:null);if(f&&!o.has(f)&&i.addIssue({code:Ee.custom,path:["schedules",c,"action"],message:`schedule action target does not exist: ${f}`}),u.target?.kind==="service"){const g=u.target.name??"";g&&!h.has(g)&&i.addIssue({code:Ee.custom,path:["schedules",c,"target","name"],message:`schedule service target does not exist: ${g}`})}}}function Vn(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function Qn(n,i){return n.artifactPaths.length>0?n.artifactPaths:i.artifacts.paths}const hr=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],gr=ji("hammer",hr);function xr(n){const i=$e(n?.data),o=$e(i.preview);return(typeof o.url=="string"?o.url.trim():"")||null}function br(){const n=window.open("","_blank");return n?(n.document.write('<!doctype html><title>Opening sandbox preview</title><body style="margin:0;background:#05070a;color:#f5f5f4;font:14px system-ui,sans-serif;display:grid;place-items:center;height:100vh;">Opening sandbox preview...</body>'),n.document.close(),n):null}function tn(n,i){if(!i){n?.close();return}if(n){n.opener=null,n.location.href=i;return}window.open(i,"_blank","noopener,noreferrer")}function si(n){const i=Sr(n),o=yr($e(n?.resources)),h=$e($e(n?.inputs).schema),c=$e(h.properties),u=new Set(di(h.required)),s=[],f=[];for(const[g,p]of Object.entries(c)){const l=$e(p),w=$e(l["x-openpond-upload"]??l.xOpenPondUpload),T=typeof l.type=="string"?l.type:"string",U=$e(l.items),J=wr(l,w),D=l.format==="file"||w.enabled===!0||T==="array"&&U.format==="file",Y=typeof l.title=="string"&&l.title.trim()?l.title.trim():Rr(g);if(D){f.push({name:g,label:Y,required:u.has(g),multiple:T==="array"||w.multiple===!0,accept:Ir(w,l),targetPath:_r(w,g),targetNames:J});continue}(T==="string"||T==="number"||T==="integer"||T==="boolean")&&s.push({name:g,label:Y,required:u.has(g),type:T,defaultValue:typeof l.default=="string"||typeof l.default=="number"||typeof l.default=="boolean"?String(l.default):"",targetNames:J})}return{entrypoints:i,scalarInputs:s,fileInputs:f,envInputs:jr(n),resources:o,volumes:vr(n,f),schedules:Ar(n)}}function hn(n,i){const o=i.trim();return n.filter(h=>!h.targetNames||h.targetNames.length===0?!0:h.targetNames.includes(o))}function Sr(n){return n?et(n).flatMap(i=>{if(i.kind==="action")return[];const o=i.name.trim(),h=i.command.trim(),c=gn(i.timeoutSeconds),u=i.ports.flatMap(s=>{const f=gn(s.port);return f?[{port:f,label:typeof s.label=="string"&&s.label.trim()?s.label.trim():"web",access:s.access==="public"?"public":"private",path:typeof s.path=="string"&&s.path.trim()?s.path.trim():"/"}]:[]});return o&&h?[{name:o,command:h,timeoutSeconds:c,ports:u}]:[]}):[]}function yr(n){return{cpu:Zn(n.cpu)??1,memoryGb:Zn(n.memoryGb)??1,diskGb:Zn(n.diskGb)??8}}function vr(n,i){const o=Array.isArray(n?.volumes)?n.volumes:[];if(o.length>0)return o.map((u,s)=>{const f=s===0?"volume":`volume-${s+1}`,g=typeof u.name=="string"&&u.name.trim()?u.name.trim():f;return{name:g,mountPath:typeof u.mountPath=="string"&&u.mountPath.trim()?u.mountPath.trim():`/workspace/volumes/${g}`,...gn(u.storageGb)?{storageGb:gn(u.storageGb)??void 0}:{},deleteOnSandboxDelete:u.deleteOnSandboxDelete===!0}});const h=i.find(u=>u.targetPath.startsWith("volumes/"));if(!h)return[];const[,c="volume"]=h.targetPath.split("/");return[{name:c,mountPath:`/workspace/volumes/${c}`,storageGb:8,deleteOnSandboxDelete:!1}]}function jr(n){return(Array.isArray(n?.inputs.env)?n.inputs.env:[]).flatMap(o=>{const h=typeof o.name=="string"?o.name.trim():"";return h?[{name:h,required:o.required===!0,secret:o.secret!==!1,description:typeof o.description=="string"?o.description.trim():""}]:[]})}function Ar(n){return n?.schedules?.length?n.schedules.flatMap(i=>{const o=typeof i.name=="string"?i.name.trim():"",h=Cr(i);if(!o||!h.scheduleExpression)return[];try{return[{name:o,...typeof i.description=="string"&&i.description.trim()?{description:i.description.trim()}:{},enabled:!1,...h,...typeof i.timezone=="string"&&i.timezone.trim()?{timezone:i.timezone.trim()}:{},...typeof i.startAt=="string"&&i.startAt.trim()?{startAt:i.startAt.trim()}:{},...typeof i.endAt=="string"&&i.endAt.trim()?{endAt:i.endAt.trim()}:{},...typeof i.maxRuns=="number"&&Number.isInteger(i.maxRuns)&&i.maxRuns>0?{maxRuns:i.maxRuns}:{},runtimePolicy:i.runtimePolicy,target:Nr(n,i),...i.budget?{budget:i.budget}:{},...i.resources?{resources:i.resources}:{},...i.quotas?{quotas:i.quotas}:{},...i.lifecycle?{lifecycle:i.lifecycle}:{},...i.retentionPolicy?{retentionPolicy:i.retentionPolicy}:{},...i.env?{env:i.env}:{},...i.integrationLeases?{integrationLeases:i.integrationLeases}:{},metadata:{...$e(i.metadata),manifestScheduleName:o,source:"openpond-app-sandbox-template-start"}}]}catch{return[]}}):[]}function Cr(n){return n.scheduleExpression?{scheduleType:n.scheduleType??"cron",scheduleExpression:n.scheduleExpression}:n.rate?{scheduleType:"rate",scheduleExpression:/^rate\(/i.test(n.rate)?n.rate:`rate(${n.rate})`}:n.once?{scheduleType:"once",scheduleExpression:/^at\(/i.test(n.once)?n.once:`at(${n.once})`}:{scheduleType:"cron",scheduleExpression:n.cron??""}}function Nr(n,i){const o=i.command??i.target?.command??null;if(o)return{kind:"command",command:o,requiresStart:i.requiresStart??i.target?.requiresStart??!1};const h=i.target?.kind??"action";if(h==="start")return{kind:"command",command:n.start.command,requiresStart:i.requiresStart??i.target?.requiresStart??n.start.requiresStart??!1};if(h==="service"){const s=i.target?.name??"",f=n.services.find(g=>g.name===s);if(!f)throw new Error("schedule_service_target_missing");return{kind:"command",command:f.command,requiresStart:i.requiresStart??i.target?.requiresStart??f.requiresStart??!1}}const c=i.actionName??i.action??i.target?.actionName??(i.target?.kind==="action"?i.target?.name:void 0),u=n.actions.find(s=>s.name===c);if(!u)throw new Error("schedule_action_target_missing");return{kind:"command",command:u.command,requiresStart:i.requiresStart??i.target?.requiresStart??u.requiresStart??!1}}function ci(n,i){return n.flatMap(o=>{const h=(i[o.name]??"").trim();return h?[{name:o.name,secretRef:h}]:[]})}function ui(n,i){const o={};for(const h of n){const c=i[h.name]??"";if(!(!c.trim()&&!h.required))if(h.type==="boolean")o[h.name]=c==="true";else if(h.type==="number"||h.type==="integer"){const u=Number(c);Number.isFinite(u)&&(o[h.name]=h.type==="integer"?Math.trunc(u):u)}else o[h.name]=c}return o}function wr(n,i){const o=n["x-openpond-targets"]??n.xOpenPondTargets??i.targets??i.actions,h=di(o).map(c=>c.trim()).filter(Boolean);return h.length>0?[...new Set(h)]:null}function Ir(n,i){return typeof n.accept=="string"?n.accept.trim():Array.isArray(n.accept)?n.accept.filter(o=>typeof o=="string").join(","):typeof i.accept=="string"?i.accept.trim():""}function _r(n,i){return(typeof n.targetPath=="string"&&n.targetPath.trim()?n.targetPath.trim():typeof n.path=="string"&&n.path.trim()?n.path.trim():`uploads/${i}`).replace(/^\/+/,"").replace(/^workspace\//,"").replace(/\/+$/,"")}function Zn(n){const i=Number(n);return Number.isFinite(i)&&i>0?i:null}function gn(n){const i=Number(n);return Number.isInteger(i)&&i>0?i:null}function Er(n,i){return[i,...n.slice(1)]}function di(n){return Array.isArray(n)?n.filter(i=>typeof i=="string"):[]}function Rr(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function $e(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function Tr({busy:n,defaultRepoUrl:i,projectName:o,commitBeforeCreate:h,templateManifest:c,uploadBeforeCreate:u,onClose:s,onSubmit:f}){const g=q.useMemo(()=>si(c),[c]),p=g.entrypoints[0]??null,[l,w]=q.useState(i),[T,U]=q.useState(p?.name??""),[J,D]=q.useState(p?.command??""),[Y,te]=q.useState(p?.timeoutSeconds?String(p.timeoutSeconds):""),[V,O]=q.useState(`Update ${o}`),[F,Z]=q.useState("0.05"),[W,oe]=q.useState(()=>Object.fromEntries(g.scalarInputs.map(a=>[a.name,a.defaultValue]))),[ie,Ce]=q.useState(()=>Object.fromEntries(g.envInputs.map(a=>[a.name,""]))),[Ne,Oe]=q.useState({}),fe=g.volumes[0]??null,[he,I]=q.useState(g.volumes.length>0||g.fileInputs.length>0),[B,_]=q.useState(fe?.name??"volume"),[H,Q]=q.useState(fe?.mountPath??"/workspace/volumes/volume"),[de,Se]=q.useState(String(fe?.storageGb??8)),[Be,Re]=q.useState(!(fe?.deleteOnSandboxDelete??!1)),[ne,He]=q.useState(g.schedules),se=g.entrypoints.find(a=>a.name===T)??p,me=se?.ports??[],ce=me[0]??null,[we,K]=q.useState(!!ce),[Le,pe]=q.useState(ce?String(ce.port):""),re=Number(Le),ke=Number(F),Ie=Number(de),Te=Number(Y),Ge=!Y.trim()||Number.isInteger(Te)&&Te>0&&Te<=86400,ue=!we||Number.isInteger(re)&&re>=Sn&&re<=yn&&me.some(a=>a.port===re),qe=Number.isFinite(ke)&&ke>0,Pe=!he||Number.isInteger(Ie)&&Ie>0,ae=ne.every(a=>!a.enabled||!!a.scheduleExpression.trim()),ye=hn(g.scalarInputs,T),Fe=hn(g.fileInputs,T),_e=g.envInputs.every(a=>!a.required||!!(ie[a.name]??"").trim()),De=g.envInputs.filter(a=>a.required&&!(ie[a.name]??"").trim()),Ue=(u||!!l.trim())&&!!J.trim()&&qe&&Ge&&Pe&&ye.every(a=>!a.required||!!(W[a.name]??"").trim())&&Fe.every(a=>!a.required||(Ne[a.name]?.length??0)>0)&&_e&&ae&&ue;function Ke(a){U(a);const x=g.entrypoints.find(d=>d.name===a);if(!x)return;D(x.command),te(x.timeoutSeconds?String(x.timeoutSeconds):"");const t=x.ports[0]??null;pe(t?String(t.port):""),K(!!t)}function Ye(a,x){oe(t=>({...t,[a]:x}))}function e(a,x){Ce(t=>({...t,[a]:x}))}function m(a,x){const t=Array.from(x.target.files??[]);Oe(d=>({...d,[a.name]:a.multiple?t:t.slice(0,1)}))}function b(a,x){He(t=>t.map((d,C)=>C===a?{...d,...x}:d))}function j(a){a.preventDefault(),!(!Ue||n)&&f({repoUrl:l.trim(),command:J.trim(),entrypointName:T,commitMessage:V.trim(),budgetUsd:F.trim(),params:ui(ye,W),env:ci(g.envInputs,ie),timeoutSeconds:Y.trim()&&Number.isInteger(Te)?Te:se?.timeoutSeconds??null,uploads:Fe.flatMap(x=>{const t=Ne[x.name]??[];return t.length>0?[{inputName:x.name,label:x.label,targetPath:x.targetPath,multiple:x.multiple,files:t}]:[]}),resources:g.resources,volumes:he?Er(g.volumes,{...B.trim()?{name:B.trim()}:{},...H.trim()?{mountPath:H.trim()}:{},...Number.isInteger(Ie)&&Ie>0?{storageGb:Ie}:{},deleteOnSandboxDelete:!Be}):[],schedules:ne.filter(x=>x.enabled),openPreview:we,previewPort:we?re:null,previewLabel:me.find(x=>x.port===re)?.label??"web",previewAccess:me.find(x=>x.port===re)?.access??"private"})}return r.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:r.jsxs("form",{className:"git-dialog run-once-dialog sandbox-start-dialog",role:"dialog","aria-modal":"true","aria-label":"Start sandbox",onSubmit:j,children:[r.jsx("button",{className:"git-dialog-close",disabled:n,type:"button",title:"Close","aria-label":"Close",onClick:s,children:r.jsx(Ut,{size:15})}),r.jsxs("div",{className:"sandbox-start-dialog-heading",children:[r.jsx("div",{className:"git-dialog-icon",children:r.jsx(sn,{size:18})}),r.jsx("h2",{children:"Start sandbox"}),r.jsxs("div",{className:"git-dialog-row",children:[r.jsx("span",{children:"Project"}),r.jsx("strong",{children:o})]})]}),r.jsxs("div",{className:"sandbox-start-dialog-body",children:[u?null:r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Repository"}),r.jsx("input",{disabled:n,value:l,onChange:a=>w(a.target.value)})]}),h?r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Commit message"}),r.jsx("input",{disabled:n,value:V,onChange:a=>O(a.target.value)})]}):null,g.entrypoints.length>0?r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Run target"}),r.jsx("select",{disabled:n,value:T,onChange:a=>Ke(a.target.value),children:g.entrypoints.map(a=>r.jsx("option",{value:a.name,children:a.name},a.name))})]}):null,r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Shell command"}),r.jsx("input",{disabled:n,value:J,onChange:a=>D(a.target.value)})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Timeout seconds"}),r.jsx("input",{disabled:n,inputMode:"numeric",value:Y,onChange:a=>te(a.target.value)})]}),ye.map(a=>a.type==="boolean"?r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:(W[a.name]??"")==="true",disabled:n,type:"checkbox",onChange:x=>Ye(a.name,x.target.checked?"true":"false")}),r.jsx("span",{}),a.label]},a.name):r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:a.label}),r.jsx("input",{disabled:n,inputMode:a.type==="number"||a.type==="integer"?"decimal":void 0,value:W[a.name]??"",onChange:x=>Ye(a.name,x.target.value)})]},a.name)),Fe.map(a=>r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:a.label}),r.jsx("input",{accept:a.accept||void 0,disabled:n,multiple:a.multiple,type:"file",onChange:x=>m(a,x)})]},a.name)),g.envInputs.length>0?r.jsxs("div",{className:"sandbox-start-env-section",children:[r.jsx("div",{className:"sandbox-start-section-title",children:"Environment"}),De.length>0?r.jsxs("p",{className:"sandbox-start-env-warning",role:"status",children:["Required sandbox secret ref missing: ",De.map(a=>a.name).join(", ")]}):null,g.envInputs.map(a=>{const x=ie[a.name]??"",t=a.required&&!x.trim(),d=`sandbox-env-${a.name}-description`;return r.jsxs("label",{className:"git-dialog-field",children:[r.jsxs("span",{children:[a.name,a.required?" *":""]}),r.jsx("input",{"aria-describedby":d,"aria-invalid":t,disabled:n,placeholder:"openpond://secret/...",value:x,onChange:C=>e(a.name,C.target.value)}),r.jsx("small",{id:d,children:t?"Add a sandbox secret ref before starting.":a.description||"Sandbox secret ref only."})]},a.name)})]}):null,Fe.length>0||g.volumes.length>0?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:he,disabled:n,type:"checkbox",onChange:a=>I(a.target.checked)}),r.jsx("span",{}),"Mount volume"]}),he?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"run-once-dialog-grid",children:[r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Volume"}),r.jsx("input",{disabled:n,value:B,onChange:a=>_(a.target.value)})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Storage GiB"}),r.jsx("input",{disabled:n,inputMode:"numeric",value:de,onChange:a=>Se(a.target.value)})]})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Mount path"}),r.jsx("input",{disabled:n,value:H,onChange:a=>Q(a.target.value)})]}),r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:Be,disabled:n,type:"checkbox",onChange:a=>Re(a.target.checked)}),r.jsx("span",{}),"Keep volume"]})]}):null]}):null,ne.length>0?r.jsxs("div",{className:"sandbox-start-schedules",children:[r.jsx("div",{className:"sandbox-start-section-title",children:"Schedules"}),ne.map((a,x)=>r.jsxs("div",{className:"sandbox-start-schedule-row",children:[r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:a.enabled,disabled:n,type:"checkbox",onChange:t=>b(x,{enabled:t.target.checked})}),r.jsx("span",{}),a.name]}),r.jsxs("div",{className:"run-once-dialog-grid",children:[r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Type"}),r.jsxs("select",{disabled:n||!a.enabled,value:a.scheduleType,onChange:t=>b(x,{scheduleType:t.target.value}),children:[r.jsx("option",{value:"rate",children:"Rate"}),r.jsx("option",{value:"cron",children:"Cron"}),r.jsx("option",{value:"once",children:"Once"})]})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Max runs"}),r.jsx("input",{disabled:n||!a.enabled,inputMode:"numeric",value:a.maxRuns??"",onChange:t=>{const d=Number(t.target.value);b(x,{maxRuns:Number.isInteger(d)&&d>0?d:null})}})]})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Expression"}),r.jsx("input",{disabled:n||!a.enabled,value:a.scheduleExpression,onChange:t=>b(x,{scheduleExpression:t.target.value})})]})]},a.name))]}):null,r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Budget"}),r.jsx("input",{disabled:n,inputMode:"decimal",value:F,onChange:a=>Z(a.target.value)})]}),me.length>0?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:we,disabled:n,type:"checkbox",onChange:a=>K(a.target.checked)}),r.jsx("span",{}),"Open preview"]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Preview port"}),r.jsx("select",{disabled:n||!we,value:Le,onChange:a=>pe(a.target.value),children:me.map(a=>r.jsx("option",{value:a.port,children:a.label?`${a.label} (${a.port})`:a.port},a.port))})]})]}):null]}),r.jsxs("div",{className:"git-dialog-footer sandbox-start-dialog-footer",children:[r.jsx("button",{className:"git-dialog-secondary",disabled:n,type:"button",onClick:s,children:"Cancel"}),r.jsxs("button",{className:"git-dialog-primary",disabled:n||!Ue,title:_e?void 0:"Required sandbox secret refs are missing.",type:"submit",children:[r.jsx(Ai,{size:14}),"Start"]})]})]})})}function Pr({busy:n,projectName:i,templateManifest:o,onClose:h,onSubmit:c}){const u=q.useMemo(()=>si(o),[o]),s=q.useMemo(()=>o?et(o).filter(I=>I.kind==="action"):[],[o]),f=s[0]??null,[g,p]=q.useState("sandbox"),[l,w]=q.useState(f?.name??""),[T,U]=q.useState(()=>Object.fromEntries(u.scalarInputs.map(I=>[I.name,I.defaultValue]))),[J,D]=q.useState(()=>Object.fromEntries(u.envInputs.map(I=>[I.name,""]))),[Y,te]=q.useState({}),V=hn(u.scalarInputs,l),O=hn(u.fileInputs,l),F=g==="sandbox"?u.envInputs:[],Z=V.every(I=>!I.required||!!(T[I.name]??"").trim()),W=O.every(I=>!I.required||(Y[I.name]?.length??0)>0),oe=F.every(I=>!I.required||!!(J[I.name]??"").trim()),ie=F.filter(I=>I.required&&!(J[I.name]??"").trim()),Ce=!!l&&Z&&W&&oe;function Ne(I,B){U(_=>({..._,[I]:B}))}function Oe(I,B){D(_=>({..._,[I]:B}))}function fe(I,B,_){const H=Array.from(_.target.files??[]);te(Q=>({...Q,[I]:B?H:H.slice(0,1)}))}function he(I){I.preventDefault(),!(!Ce||n)&&c({mode:g,target:l,params:ui(V,T),env:g==="sandbox"?ci(F,J):[],uploads:O.flatMap(B=>{const _=Y[B.name]??[];return _.length>0?[{inputName:B.name,label:B.label,targetPath:B.targetPath,multiple:B.multiple,files:_}]:[]})})}return r.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:r.jsxs("form",{className:"git-dialog run-once-dialog sandbox-start-dialog",role:"dialog","aria-modal":"true","aria-label":"Run sandbox action",onSubmit:he,children:[r.jsx("button",{className:"git-dialog-close",disabled:n,type:"button",title:"Close","aria-label":"Close",onClick:h,children:r.jsx(Ut,{size:15})}),r.jsxs("div",{className:"sandbox-start-dialog-heading",children:[r.jsx("div",{className:"git-dialog-icon",children:r.jsx(cn,{size:18})}),r.jsx("h2",{children:"Run action"}),r.jsxs("div",{className:"git-dialog-row",children:[r.jsx("span",{children:"Project"}),r.jsx("strong",{children:i})]})]}),r.jsxs("div",{className:"sandbox-start-dialog-body",children:[r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Action"}),r.jsx("select",{disabled:n||s.length===0,value:l,onChange:I=>w(I.target.value),children:s.map(I=>r.jsx("option",{value:I.name,children:I.name},I.name))})]}),r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:"Run on"}),r.jsxs("select",{disabled:n,value:g,onChange:I=>p(I.target.value==="local"?"local":"sandbox"),children:[r.jsx("option",{value:"sandbox",children:"Hosted sandbox (start/update)"}),r.jsx("option",{value:"local",children:"Local machine"})]})]}),V.map(I=>I.type==="boolean"?r.jsxs("label",{className:"git-dialog-toggle",children:[r.jsx("input",{checked:(T[I.name]??"")==="true",disabled:n,type:"checkbox",onChange:B=>Ne(I.name,B.target.checked?"true":"false")}),r.jsx("span",{}),I.label]},I.name):r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:I.label}),r.jsx("input",{disabled:n,inputMode:I.type==="number"||I.type==="integer"?"decimal":void 0,value:T[I.name]??"",onChange:B=>Ne(I.name,B.target.value)})]},I.name)),O.map(I=>r.jsxs("label",{className:"git-dialog-field",children:[r.jsx("span",{children:I.label}),r.jsx("input",{accept:I.accept||void 0,disabled:n,multiple:I.multiple,type:"file",onChange:B=>fe(I.name,I.multiple,B)})]},I.name)),F.length>0?r.jsxs("div",{className:"sandbox-start-env-section",children:[r.jsx("div",{className:"sandbox-start-section-title",children:"Environment"}),ie.length>0?r.jsxs("p",{className:"sandbox-start-env-warning",role:"status",children:["Required sandbox secret ref missing: ",ie.map(I=>I.name).join(", ")]}):null,F.map(I=>{const B=J[I.name]??"",_=I.required&&!B.trim(),H=`sandbox-action-env-${I.name}-description`;return r.jsxs("label",{className:"git-dialog-field",children:[r.jsxs("span",{children:[I.name,I.required?" *":""]}),r.jsx("input",{"aria-describedby":H,"aria-invalid":_,disabled:n,placeholder:"openpond://secret/...",value:B,onChange:Q=>Oe(I.name,Q.target.value)}),r.jsx("small",{id:H,children:_?"Add a sandbox secret ref before running.":I.description||"Sandbox secret ref only."})]},I.name)})]}):null]}),r.jsxs("div",{className:"git-dialog-footer sandbox-start-dialog-footer",children:[r.jsx("button",{className:"git-dialog-secondary",disabled:n,type:"button",onClick:h,children:"Cancel"}),r.jsxs("button",{className:"git-dialog-primary",disabled:n||!Ce,title:oe?void 0:"Required sandbox secret refs are missing.",type:"submit",children:[r.jsx(cn,{size:14}),"Run"]})]})]})})}function mi(n,i){const o=n.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"agent";return i==="cron"?`name: ${o}
|
|
33
|
+
version: 0.1.0
|
|
34
|
+
useCase: scheduled_report
|
|
35
|
+
start:
|
|
36
|
+
command: pnpm report
|
|
37
|
+
schedules:
|
|
38
|
+
- name: daily-report
|
|
39
|
+
command: pnpm report
|
|
40
|
+
cron: "0 9 * * *"`:i==="background"?`name: ${o}
|
|
41
|
+
version: 0.1.0
|
|
42
|
+
useCase: background_worker
|
|
43
|
+
start:
|
|
44
|
+
command: pnpm worker
|
|
45
|
+
services:
|
|
46
|
+
- name: worker
|
|
47
|
+
command: pnpm worker`:i==="resources"?`name: ${o}
|
|
48
|
+
version: 0.1.0
|
|
49
|
+
useCase: resource_profile
|
|
50
|
+
resources:
|
|
51
|
+
cpu: 1
|
|
52
|
+
memoryGb: 2
|
|
53
|
+
diskGb: 16
|
|
54
|
+
start:
|
|
55
|
+
command: pnpm start`:`name: ${o}
|
|
56
|
+
version: 0.1.0
|
|
57
|
+
useCase: action
|
|
58
|
+
start:
|
|
59
|
+
command: pnpm start
|
|
60
|
+
actions:
|
|
61
|
+
- name: hello
|
|
62
|
+
command: pnpm hello`}function Or(n,i){return i||(n==="missing_config"?`${an} missing`:n==="needs_project"?"Local config is ready":n==="needs_sync"?"Project needs manifest sync":n==="needs_agent"?"Project is synced":n==="ready"?"Agent is ready":"Setup unavailable")}function Lr(n){return n?.source==="openpond"?"OpenPond Git":n?.source==="github"?"GitHub":n?.source==="local_git"?"Local Git":n?.source==="local_folder"?"Local folder":"Workspace"}function kr(n){const i=xn(n.data),o=xn(i.remote);return(typeof o.remoteUrl=="string"?o.remoteUrl.trim():"")||null}function Mr(n){const i=xn(n.data),o=xn(i.sandbox);return(typeof o.id=="string"?o.id.trim():"")||null}function kt(n){return n?typeof n.metadata?.name=="string"&&n.metadata.name.trim()?n.metadata.name.trim():n.projectId?`Project sandbox ${Xn(n.id)}`:n.agentId?`Agent sandbox ${Xn(n.id)}`:`Sandbox ${Xn(n.id)}`:null}function qr(n,i){return{sourceSandboxId:i,name:n.name,...n.description?{description:n.description}:{},scheduleType:n.scheduleType,scheduleExpression:n.scheduleExpression,enabled:!0,...n.timezone?{timezone:n.timezone}:{},...n.startAt?{startAt:n.startAt}:{},...n.endAt?{endAt:n.endAt}:{},...n.maxRuns!==void 0?{maxRuns:n.maxRuns}:{},...n.runtimePolicy?{runtimePolicy:n.runtimePolicy}:{},target:n.target,...n.budget?{budget:n.budget}:{},...n.resources?{resources:n.resources}:{},...n.quotas?{quotas:n.quotas}:{},...n.lifecycle?{lifecycle:n.lifecycle}:{},...n.retentionPolicy?{retentionPolicy:n.retentionPolicy}:{},...n.env?{env:n.env}:{},...n.integrationLeases?{integrationLeases:n.integrationLeases}:{},metadata:n.metadata??{},managementSource:"openpond.yaml",manifestPath:an}}function Fr(n){const i=n?.gitOwner?.trim()??"",o=n?.gitRepo?.trim()??"",h=n?.gitHost?.trim()??"";if(!i||!o||!h)return null;const c=o.endsWith(".git")?o:`${o}.git`;return/^https?:\/\//i.test(h)?`${h.replace(/\/+$/,"")}/${i}/${c}`:`https://${h.replace(/\/+$/,"")}/${i}/${c}`}function Dr(n,i){const o=i.trim();if(n==="github_repo"){const h=o.replace(/^https:\/\/github\.com\//i,"").replace(/^git@github\.com:/i,"").replace(/\.git$/i,""),[c,u]=h.split("/").filter(Boolean);return{gitHost:"github.com",gitOwner:c??null,gitRepo:u??null,internalRepoPath:null,templateRepoUrl:null}}return n==="internal_repo"?{gitHost:"openpond.ai",gitOwner:null,gitRepo:o.split("/").filter(Boolean).at(-1)??null,internalRepoPath:o||null,templateRepoUrl:null}:n==="template"?{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:o||null}:{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:null}}function Mt(n,i){const o=n.trim().replace(/^\/+/,"").replace(/^workspace\//,"").replace(/\/+$/,""),h=i.trim().replace(/[/\\]+/g,"-").replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"upload";return`${o||"uploads"}/${h}`}function Ur(n,i){return`OPENPOND_REPLAY_PARAMS_BASE64='${zr({input:i})}' ${n}`}function $r(n,i,o){return["cd",qt(n),"&&","openpond","sandbox-template",i,"--file",an,"--target",qt(o)].join(" ")}function qt(n){return`'${n.replace(/'/g,"'\\''")}'`}function Ft(n){return new Promise((i,o)=>{const h=new FileReader;h.onload=()=>{const c=typeof h.result=="string"?h.result:"",[,u=""]=c.split(",",2);i(u)},h.onerror=()=>o(h.error??new Error("Failed to read file")),h.readAsDataURL(n)})}function zr(n){const i=JSON.stringify(n),o=new TextEncoder().encode(i);let h="";for(const c of o)h+=String.fromCharCode(c);return window.btoa(h)}function xn(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function Je(n){return n instanceof Error?n.message:String(n)}function Xn(n){return n.length<=10?n:`${n.slice(0,6)}...${n.slice(-4)}`}async function Br(n){n&&(await n("sandbox_preserve_source"),await n("sandbox_stop"))}function Hr(n){return{...n.teamId?{teamId:n.teamId}:{},...n.projectId?{projectId:n.projectId}:{},runtime:{runtimeId:n.runtimeId},visibility:"team",budget:{maxUsd:"0.05"},quotas:{idleTimeoutSeconds:900,maxSpendUsd:"0.05"},metadata:{source:"openpond-app-environment-menu-sandbox-resume",resumeSandboxId:n.id,previousState:n.state}}}function Yr({canCreateSandboxProject:n,canInitGit:i,defaultSandboxRepoUrl:o,gitWorkspace:h,hasRemote:c,isProjectWorkspace:u,isSandboxWorkspace:s,managed:f,onOpenCommitDialog:g,onRunTerminalCommand:p,onWorkspaceToolAction:l,projectSandboxTemplate:w,projectSandboxTemplateValid:T,sandboxTemplateActionTargetCount:U,sandboxTemplateServiceTargets:J,sandboxResumeTarget:D,selectedApp:Y,selectedProject:te,setSandboxCreateDialogOpen:V,setSandboxRunActionDialogOpen:O,workspaceBusyValue:F,workspaceReady:Z,workspaceState:W}){const oe=[{icon:r.jsx(Ci,{size:14}),label:"Initialize Git",disabled:f||!i||F||!Z||!l,onSelect:()=>l?.("git_init")},{icon:r.jsx(Di,{size:14}),label:"Commit changes",disabled:f||!h||F||!Z||!W?.dirty||!g,onSelect:()=>g?.("commit")},{icon:r.jsx(lt,{size:14}),label:"Push branch",disabled:f||!h||F||!Z||!c||!l,onSelect:()=>l?.("git_push")},{icon:r.jsx(An,{size:14}),label:"Fetch remote",disabled:f||!h||F||!Z||!c||!l,onSelect:()=>l?.("git_fetch")},{icon:r.jsx(Ni,{size:14}),label:"Create PR",disabled:!0,onSelect:()=>{}}],ie=[...w?[]:[{icon:r.jsx(sn,{size:14}),label:"Create sandbox template",disabled:f||F||!Z||!l,onSelect:()=>l?.("create_sandbox_template_scaffold")}],{icon:r.jsx(at,{size:14}),label:`Validate ${an}`,disabled:f||F||!Z||!l,onSelect:()=>l?.("validate_sandbox_template")},{icon:r.jsx(gr,{size:14}),label:"Build template",disabled:f||F||!Z||!l,onSelect:()=>l?.("build_sandbox_template")},{icon:r.jsx(cn,{size:14}),label:"Run start locally",disabled:f||F||!Z||!l,onSelect:()=>l?.("run_sandbox_template",{mode:"local",target:"start"})},{icon:r.jsx(cn,{size:14}),label:"Run action",disabled:f||F||!Z||!T||U===0,onSelect:()=>O(!0)},...J.map(fe=>({icon:r.jsx(wi,{size:14}),label:`Dev ${fe.name} locally`,disabled:f||F||!Z||!T||!te?.sandboxTemplate?.rootPath||!p,onSelect:()=>p?.($r(te?.sandboxTemplate?.rootPath??"","dev",fe.name))})),{icon:r.jsx(sn,{size:14}),label:"Start sandbox",disabled:f||F||!Z||!n,onSelect:()=>V(!0)}],Ce=[{icon:r.jsx(An,{size:14}),label:"Sandbox status",disabled:F||!l,onSelect:()=>l?.("sandbox_status")},{icon:r.jsx(cn,{size:14}),label:"Resume sandbox",disabled:F||!l||!D?.runtimeId||D.state==="running"||D.state==="creating",onSelect:()=>D?.runtimeId?l?.("sandbox_create",Hr(D)):void 0},{icon:r.jsx(Ii,{size:14}),label:"Sandbox logs",disabled:F||!l,onSelect:()=>l?.("sandbox_logs")},{icon:r.jsx(at,{size:14}),label:"Receipts",disabled:F||!l,onSelect:()=>l?.("sandbox_receipts")},{icon:r.jsx(_i,{size:14}),label:"Export patch",disabled:F||!l,onSelect:()=>l?.("sandbox_git_export_patch")},{icon:r.jsx(lt,{size:14}),label:"Apply locally",disabled:F||!l,onSelect:()=>l?.("sandbox_git_apply_patch_local")},{icon:r.jsx(Ui,{size:14}),label:"Checkpoint and stop",disabled:F||!l,onSelect:()=>Br(l)}];return{gitActionItems:oe,sandboxActionItems:s?Ce:u?ie:[{icon:r.jsx(sn,{size:14}),label:o?"Create sandbox from repo":"Create sandbox",disabled:F||!l,onSelect:()=>l?.("sandbox_create",{...o?{repo:o}:{},visibility:"team",budget:{maxUsd:"0.05"},quotas:{maxSpendUsd:"0.05"},metadata:{source:"openpond-app-environment-menu-sandbox",...Y?.name?{appName:Y.name}:{}}})},{icon:r.jsx(An,{size:14}),label:"List templates",disabled:F||!l,onSelect:()=>l?.("sandbox_templates")}]}}function Gr({busy:n,error:i,projectName:o,onClose:h,onSubmit:c}){const[u,s]=q.useState("action"),[f,g]=q.useState(an),p=o.trim()||"local-agent";return r.jsxs(vn,{title:"Add Agent config",busy:n,error:i,onClose:h,children:[r.jsxs("label",{children:[r.jsx("span",{children:"Template preset"}),r.jsxs("select",{value:u,onChange:l=>s(l.target.value),disabled:n,children:[r.jsx("option",{value:"action",children:"Action"}),r.jsx("option",{value:"cron",children:"Cron"}),r.jsx("option",{value:"background",children:"Background worker"}),r.jsx("option",{value:"resources",children:"Resource profile"})]})]}),r.jsxs("label",{children:[r.jsx("span",{children:"Manifest path"}),r.jsx("input",{value:f,onChange:l=>g(l.target.value),disabled:n})]}),r.jsx("pre",{children:mi(p,u)}),r.jsx(jn,{busy:n,actionLabel:"Write config",canSubmit:!!f.trim(),onClose:h,onSubmit:()=>c({name:p,preset:u,manifestPath:f.trim()})})]})}function Kr({busy:n,defaultBranch:i,defaultTeamId:o,error:h,projectName:c,sourceIdentity:u,onClose:s,onSubmit:f}){const g=o,[p,l]=q.useState(c),[w,T]=q.useState(/github\.com[:/]/i.test(u)?"github_repo":"manual"),[U,J]=q.useState(u),[D,Y]=q.useState(i||"main"),[te,V]=q.useState(!0);return r.jsxs(vn,{title:"Connect Project",busy:n,error:h,onClose:s,children:[r.jsxs("label",{children:[r.jsx("span",{children:"Project name"}),r.jsx("input",{value:p,onChange:O=>l(O.target.value),disabled:n})]}),r.jsxs("div",{className:"agent-setup-two-col",children:[r.jsxs("label",{children:[r.jsx("span",{children:"Source type"}),r.jsxs("select",{value:w,onChange:O=>T(O.target.value),disabled:n,children:[r.jsx("option",{value:"manual",children:"Manual"}),r.jsx("option",{value:"github_repo",children:"GitHub repo"}),r.jsx("option",{value:"internal_repo",children:"Internal repo"}),r.jsx("option",{value:"template",children:"Template"})]})]}),r.jsxs("label",{children:[r.jsx("span",{children:"Default branch"}),r.jsx("input",{value:D,onChange:O=>Y(O.target.value),disabled:n})]})]}),r.jsxs("label",{children:[r.jsx("span",{children:"Source identity"}),r.jsx("input",{value:U,onChange:O=>J(O.target.value),disabled:n})]}),r.jsxs("label",{className:"agent-setup-check",children:[r.jsx("input",{type:"checkbox",checked:te,onChange:O=>V(O.target.checked),disabled:n}),r.jsx("span",{children:"Sync now"})]}),r.jsx(jn,{busy:n,actionLabel:te?"Connect and sync":"Connect Project",canSubmit:!!(p.trim()&&g),onClose:s,onSubmit:()=>f({teamId:g,projectName:p.trim(),sourceType:w,sourceIdentity:U.trim(),defaultBranch:D.trim(),syncNow:te})})]})}function Vr({busy:n,defaultName:i,error:o,onClose:h,onSubmit:c}){const[u,s]=q.useState(i),[f,g]=q.useState(!0);return r.jsxs(vn,{title:"Create Agent",busy:n,error:o,onClose:h,children:[r.jsxs("label",{children:[r.jsx("span",{children:"Agent name"}),r.jsx("input",{value:u,onChange:p=>s(p.target.value),disabled:n})]}),r.jsx("div",{className:"agent-setup-summary",children:"Entire manifest · Manual trigger · Package defaults"}),r.jsxs("label",{className:"agent-setup-check",children:[r.jsx("input",{type:"checkbox",checked:f,onChange:p=>g(p.target.checked),disabled:n}),r.jsx("span",{children:"Create and test run"})]}),r.jsx(jn,{busy:n,actionLabel:"Create Agent",canSubmit:!!u.trim(),onClose:h,onSubmit:()=>c({agentName:u.trim(),createTestRun:f})})]})}function Dt({actionLabel:n,busy:i,error:o,summary:h,title:c,onClose:u,onSubmit:s}){return r.jsxs(vn,{title:c,busy:i,error:o,onClose:u,children:[r.jsx("div",{className:"agent-setup-summary",children:h}),r.jsx(jn,{busy:i,actionLabel:n,canSubmit:!0,onClose:u,onSubmit:s})]})}function vn({busy:n,children:i,error:o,title:h,onClose:c}){return Ei(o),r.jsx("div",{className:"agent-setup-dialog-backdrop",role:"presentation",onMouseDown:c,children:r.jsxs("section",{className:"agent-setup-dialog",role:"dialog","aria-modal":"true","aria-label":h,onMouseDown:u=>u.stopPropagation(),children:[r.jsxs("header",{children:[r.jsx("h3",{children:h}),r.jsx("button",{type:"button",disabled:n,onClick:c,children:"Close"})]}),r.jsx("div",{className:"agent-setup-fields",children:i})]})})}function jn({actionLabel:n,busy:i,canSubmit:o,onClose:h,onSubmit:c}){return r.jsxs("div",{className:"agent-setup-dialog-actions",children:[r.jsx("button",{type:"button",disabled:i,onClick:h,children:"Cancel"}),r.jsx("button",{type:"button",disabled:i||!o,onClick:c,children:i?"Working":n})]})}function Qr(n){return n.split(`
|
|
63
|
+
`).filter(i=>i.trim()).length}function Zr(n){return n.status==="loading"?"Checking sandbox changes":n.status==="error"?"Sandbox status unavailable":n.status!=="ready"?"Sandbox changes unknown":n.changedFiles===0?"Sandbox clean":`${n.changedFiles} sandbox changed ${n.changedFiles===1?"file":"files"}`}function Xr(n){return n>0&&n%3600===0?`${n/3600} hr`:n>0&&n%60===0?`${n/60} min`:`${n} sec`}function fn(n){const i=n?.trim();if(!i)return null;if(i.startsWith("$"))return i;const o=Number(i);if(!Number.isFinite(o))return`$${i}`;if(o===0)return"$0";const h=o>=1?2:4;return`$${o.toFixed(h).replace(/0+$/,"").replace(/\.$/,"")}`}function Jr(n){return n.receipts.slice().sort((i,o)=>Date.parse(o.createdAt)-Date.parse(i.createdAt))[0]??null}function Wr(n){const i=Jr(n);if(i){const o=fn(i.totalUsd);if(i.reason==="idle_timeout")return o?`stopped by idle timeout · charged ${o}`:"stopped by idle timeout";if(i.reason==="budget_exhausted")return o?`budget exhausted · charged ${o}`:"budget exhausted";if(n.state!=="running")return o?`receipt ${i.status} · charged ${o}`:`receipt ${i.status}`}if(n.reservation.status==="reserved"){const o=fn(n.reservation.reservedUsd);return o?`reservation active ${o}`:"reservation active"}if(n.reservation.status==="captured"){const o=fn(n.reservation.capturedUsd);return o?`captured ${o}`:"captured"}return n.reservation.status==="released"?"reservation released":null}function ea(n){if(!n)return"Loading sandbox policy";const i=typeof n.quotas?.idleTimeoutSeconds=="number"&&n.quotas.idleTimeoutSeconds>0?n.quotas.idleTimeoutSeconds:null,o=fn(n.quotas?.maxSpendUsd??n.budget.maxUsd),h=[i?`Auto-stop after ${Xr(i)} idle`:"Auto-stop policy unavailable"];o&&h.push(`cap ${o}`);const c=Wr(n);return c&&h.push(c),h.join(" · ")}function Na({mode:n,busy:i,workspaceState:o,workspaceId:h,workspaceKind:c,selectedApp:u,selectedProject:s,workspaceBusy:f,defaultTeamId:g,workspaceDiff:p,managedWorkspace:l,showDiffControls:w,diffPanelOpen:T,onToggleDiffPanel:U,onRunTerminalCommand:J,onWorkspaceToolAction:D,onOpenCommitDialog:Y,onWorkspaceBranchChange:te,onWorkspaceBranchCreate:V,connection:O,onBootstrap:F,onOpenSandboxWorkspace:Z}){const[W,oe]=q.useState(!1),[ie,Ce]=q.useState(!1),[Ne,Oe]=q.useState(""),[fe,he]=q.useState(!1),[I,B]=q.useState(!1),[_,H]=q.useState(null),[Q,de]=q.useState(!1),[Se,Be]=q.useState(!1),[Re,ne]=q.useState(null),[He,se]=q.useState([]),[me,ce]=q.useState([]),[we,K]=q.useState([]),[Le,pe]=q.useState({status:"idle",changedFiles:0,error:null}),[re,ke]=q.useState(null),Ie=q.useRef(null),Te=q.useRef(null),Ge=!!o?.initialized,ue=!!f,qe=!!l,Pe=c==="local_project"||!!s,ae=c==="sandbox"||c==="sandbox_template",ye=ae&&h?.trim()||null,Fe=ae?0:p?.additions??0,_e=ae?0:p?.deletions??0,De=ae?Le.changedFiles:p?.filesChanged??o?.changedFilesCount??0,Ue=De>0,Ke=ae?Zr(Le):Ue?`${De} changed ${De===1?"file":"files"}`:"No changes",Ye=ae?ea(re):"",e=o?.source!=="local_folder",m=Pe&&o?.source==="local_folder",b=!!o?.remoteUrl,j=o?.remoteUrl?.trim()??"",a=Fr(u??null),x=!!s?.sandboxTemplate?.detected,t=!!(s?.sandboxTemplate?.valid&&s.sandboxTemplate.normalizedManifest),d=s?.sandboxTemplate?.normalizedManifest??null,C=d?et(d):[],v=C.filter(y=>y.kind==="action"),A=C.filter(y=>y.kind==="service"),N=!!s?.linkedOpenPondApp?.appId,S=Ri({localProject:s,organizations:He,projects:me,agents:we,defaultTeamId:g}),R=ot(He,g),E=Pe&&x&&!N,k=Pe&&x&&t&&(E||!!j),M=o?Array.from(new Set([o.currentBranch,...o.branches].filter(y=>!!y))):[],z=o?.initialized?o.currentBranch??M[0]??"No branch":"Not synced",X=Lr(o),on=q.useMemo(()=>{const y=Ne.trim().toLowerCase();return y?M.filter(P=>P.toLowerCase().includes(y)):M},[M,Ne]);q.useEffect(()=>{if(!W)return;function y($){Ie.current?.contains($.target)||oe(!1)}function P($){$.key==="Escape"&&oe(!1)}return document.addEventListener("pointerdown",y),document.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",y),document.removeEventListener("keydown",P)}},[W]),q.useEffect(()=>{W&&ie&&Te.current?.focus()},[ie,W]),q.useEffect(()=>{if(!O||!W||!Pe)return;let y=!1;return Be(!0),ne(null),xe.organizations(O).then(async P=>{if(y)return;const $=P.organizations.map(Ti).filter(ge=>!!ge).filter(ge=>ge.status==="active");se($);const G=ot($,g);if(!G)return;const[ve,Me]=await Promise.all([xe.listSandboxProjects(O,{teamId:G.teamId}),xe.listSandboxAgents(O,{teamId:G.teamId})]);y||(ce(ve.projects),K(Me.agents))}).catch(P=>{y||ne(Je(P))}).finally(()=>{y||Be(!1)}),()=>{y=!0}},[O,g,Pe,W]),q.useEffect(()=>{if(!W||!ae||!O||!ye){pe({status:"idle",changedFiles:0,error:null});return}let y=!1;return pe(P=>({status:"loading",changedFiles:P.changedFiles,error:null})),xe.sandboxGitStatus(O,ye).then(P=>{y||pe({status:"ready",changedFiles:Qr(P.status?.porcelain??""),error:null})}).catch(P=>{y||pe({status:"error",changedFiles:0,error:Je(P)})}),()=>{y=!0}},[O,ae,W,ye]),q.useEffect(()=>{if(!W||!ae||!O||!ye){ke(null);return}let y=!1;return xe.sandbox(O,ye).then(P=>{y||ke(P.sandbox)}).catch(()=>{y||ke(null)}),()=>{y=!0}},[O,ae,W,ye]);async function Ze(y){if(!D)return;const P=y.openPreview?br():null;let $=y.repoUrl||j;if(E){if(b&&!window.confirm("Replace the current origin remote with a new OpenPond repo before starting the sandbox?")){tn(P,null);return}const je=await D("publish_openpond_repo",{replaceOrigin:b,...o?.dirty?{commitDirty:!0,commitMessage:y.commitMessage}:{}});if(!je?.ok){tn(P,null);return}$=kr(je)??$}else if(e&&b){if(o?.dirty&&!(await D("git_commit",{message:y.commitMessage,includeUnstaged:!0,runChecks:!1}))?.ok){tn(P,null);return}if(!(await D("git_push",{runChecks:!1}))?.ok){tn(P,null);return}}if(!$){tn(P,null);return}const G=await D("sandbox_create",{repo:$,visibility:"team",resources:y.resources,budget:{maxUsd:y.budgetUsd},quotas:{idleTimeoutSeconds:900,maxSpendUsd:y.budgetUsd},...y.env.length>0?{env:y.env}:{},...y.volumes.length>0?{volumes:y.volumes}:{},metadata:{source:"openpond-app-local-sandbox-template-start",...y.entrypointName?{entrypointName:y.entrypointName}:{},...s?.id?{localProjectId:s.id}:{},...s?.name?{projectName:s.name}:{},...d?{templateName:d.name,templateVersion:d.version,templateUseCase:d.useCase,templateTargets:C.map(je=>({name:je.name,kind:je.kind}))}:{}},...y.openPreview&&y.previewPort?{previewPort:y.previewPort,previewLabel:y.previewLabel,previewAccess:y.previewAccess,previewAutoStart:!0}:{}}),ve=xr(G);if(y.openPreview&&tn(P,ve),!G?.ok)return;const Me=Mr(G);for(const je of d?.setup.commands??[])if(!(await D("sandbox_exec",{command:je,timeoutSeconds:900}))?.ok)return;const ge={};for(const je of y.uploads){const nn=[];for(const it of je.files){const rt=Mt(je.targetPath,it.name),vi=await Ft(it);if(!(await D("sandbox_upload_file",{path:rt,contentsBase64:vi}))?.ok)return;nn.push(rt)}ge[je.inputName]=je.multiple?nn:nn[0]??""}const ln=Ur(y.command,{...y.params,...ge});if((await D("sandbox_exec",{command:ln,timeoutSeconds:y.timeoutSeconds??900}))?.ok){if(Me){for(const je of y.schedules)if(!(await D("sandbox_schedule_create",qr(je,Me)))?.ok)return}he(!1)}}async function Xe(y){if(!D)return;const P={},$=[];for(const G of y.uploads){const ve=[];for(const Me of G.files){const ge=Mt(G.targetPath,Me.name),ln=await Ft(Me);$.push({path:ge,contentsBase64:ln}),ve.push(ge)}P[G.inputName]=G.multiple?ve:ve[0]??""}B(!1),await D("run_sandbox_template",{mode:y.mode,target:y.target,params:{...y.params,...P},...y.env.length>0?{env:y.env}:{},...$.length>0?{uploads:$}:{}})}async function pi(y=R?.teamId){if(!O||!y)return;const[P,$]=await Promise.all([xe.listSandboxProjects(O,{teamId:y}),xe.listSandboxAgents(O,{teamId:y})]);ce(P.projects),K($.agents)}async function fi(y){if(!(!D||!s)){de(!0),ne(null);try{if(!(await D("create_sandbox_template_scaffold",{manifestOnly:!0,manifestContent:mi(y.name,y.preset),name:y.name,preset:y.preset,manifestPath:y.manifestPath}))?.ok)return;H(null)}catch(P){ne(Je(P))}finally{de(!1)}}}async function hi(y){if(!O||!s||!F)return;const P=y.teamId;de(!0),ne(null);try{const $=Dr(y.sourceType,y.sourceIdentity);let G=(await xe.upsertSandboxProject(O,{teamId:P,name:y.projectName,sourceType:y.sourceType,normalizedSourceIdentity:y.sourceIdentity||y.projectName,defaultBranch:y.defaultBranch||null,gitProvider:y.sourceType==="github_repo"?"github":null,gitHost:$.gitHost,gitOwner:$.gitOwner,gitRepo:$.gitRepo,internalRepoPath:$.internalRepoPath,templateRepoUrl:$.templateRepoUrl,sourceConfig:{sourceType:y.sourceType,sourceValue:y.sourceIdentity||y.projectName},metadata:{source:"openpond-app-local-project-agent-setup"}})).project;y.syncNow&&(G=(await xe.syncSandboxProject(O,G.id,{teamId:P})).project);const ve=await xe.updateLocalProjectAgentSetup(O,s.id,{linkedSandboxProject:{teamId:P,projectId:G.id,projectSlug:G.slug,projectName:G.name,sourceRepoUrl:y.sourceIdentity||null,defaultBranch:G.defaultBranch,lastUploadedCommit:null,lastUploadTransport:null,manifestPath:G.sandboxManifestPath,manifestHash:G.sandboxManifestHash,syncedAt:G.sandboxManifestSyncedAt,linkedAt:new Date().toISOString()}});F(ve.bootstrap),ce(Me=>[G,...Me.filter(ge=>ge.id!==G.id)]),H(null)}catch($){ne(Je($))}finally{de(!1)}}async function gi(){if(!O||!s||!S.project||!F)return;const y=S.project;de(!0),ne(null);try{const P=(await xe.syncSandboxProject(O,y.id,{teamId:y.teamId})).project,$=await xe.updateLocalProjectAgentSetup(O,s.id,{linkedSandboxProject:{teamId:P.teamId,projectId:P.id,projectSlug:P.slug,projectName:P.name,sourceRepoUrl:o?.remoteUrl??s.linkedSandboxProject?.sourceRepoUrl??null,defaultBranch:P.defaultBranch,lastUploadedCommit:s.linkedSandboxProject?.lastUploadedCommit??null,lastUploadTransport:s.linkedSandboxProject?.lastUploadTransport??null,manifestPath:P.sandboxManifestPath,manifestHash:P.sandboxManifestHash,syncedAt:P.sandboxManifestSyncedAt,linkedAt:s.linkedSandboxProject?.linkedAt??new Date().toISOString()}});F($.bootstrap),ce(G=>[P,...G.filter(ve=>ve.id!==P.id)]),H(null)}catch(P){ne(Je(P))}finally{de(!1)}}async function xi(y){if(!O||!s||!S.project||!F)return;const P=S.project;de(!0),ne(null);try{const $=(await xe.upsertSandboxAgent(O,{teamId:P.teamId,projectId:P.id,name:y.agentName,selectedEntrypoint:{scope:"entire_manifest",name:null},triggerType:"manual",backgroundTaskPolicy:{},defaultWorkflowMode:"attempt",defaultResourcePolicy:{},metadata:{source:"openpond-app-local-project-agent-setup"}})).agent;let G=null,ve=null;if(y.createTestRun){const ge=await xe.runSandboxAgent(O,$.id,{teamId:P.teamId,triggerType:"manual",metadata:{source:"openpond-app-local-project-agent-setup"}});G=ge.sandbox??null,ve=G?.id??ge.run.sandboxId??null}const Me=await xe.updateLocalProjectAgentSetup(O,s.id,{preferredSandboxAgentId:$.id});F(Me.bootstrap),K(ge=>[$,...ge.filter(ln=>ln.id!==$.id)]),H(null),ve&&await Z?.({sandboxId:ve,name:kt(G)??`${$.name} sandbox`})}catch($){ne(Je($))}finally{de(!1)}}async function bi(){if(!(!O||!S.agent)){de(!0),ne(null);try{const y=await xe.runSandboxAgent(O,S.agent.id,{teamId:S.agent.teamId,triggerType:"manual",metadata:{source:"openpond-app-local-project-agent-setup"}});await pi(S.agent.teamId),H(null);const P=y.sandbox?.id??y.run.sandboxId;P&&await Z?.({sandboxId:P,name:kt(y.sandbox??null)??`${S.agent.name} sandbox`})}catch(y){ne(Je(y))}finally{de(!1)}}}const{gitActionItems:Si,sandboxActionItems:yi}=Yr({canCreateSandboxProject:k,canInitGit:m,defaultSandboxRepoUrl:a??"",gitWorkspace:e,hasRemote:b,isProjectWorkspace:Pe,isSandboxWorkspace:ae,managed:qe,onOpenCommitDialog:Y,onRunTerminalCommand:J,onWorkspaceToolAction:D,projectSandboxTemplate:x,projectSandboxTemplateValid:t,sandboxTemplateActionTargetCount:v.length,sandboxTemplateServiceTargets:A,sandboxResumeTarget:re?{id:re.id,runtimeId:re.runtimeId??null,teamId:re.teamId??null,projectId:re.projectId??null,state:re.state??null}:null,selectedApp:u,selectedProject:s,setSandboxCreateDialogOpen:he,setSandboxRunActionDialogOpen:B,workspaceBusyValue:ue,workspaceReady:Ge,workspaceState:o});if(!o)return null;function tt(y){oe(!1),y.onSelect()}return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`workspace-environment-menu ${n==="dock"?"open-up":""} ${n==="topbar"?"topbar":""}`,ref:Ie,children:[r.jsx("button",{type:"button",className:`environment-info-button ${n==="topbar"?"titlebar-icon":"composer-icon"} ${W?"active":""}`,title:"Environment","data-tooltip":"Environment","aria-label":"Environment","aria-haspopup":"menu","aria-expanded":W,onClick:()=>oe(y=>!y),children:r.jsx(qi,{size:16})}),W&&r.jsxs("div",{className:"environment-popover",role:"menu","aria-label":"Environment",children:[r.jsx("div",{className:"environment-popover-header",children:r.jsx("span",{children:"Environment"})}),Pe&&s?r.jsxs("button",{type:"button",className:"environment-row",disabled:Se||!S.canAct||Q,title:Se?"Loading Agent setup state":S.reason??"Set up this project as an Agent",onClick:()=>{Se||!S.canAct||(S.state==="missing_config"&&H("config"),S.state==="needs_project"&&H("connect"),S.state==="needs_sync"&&H("sync"),S.state==="needs_agent"&&H("agent"),S.state==="ready"&&H("run"),oe(!1))},children:[r.jsx(sn,{size:15}),r.jsxs("span",{children:[r.jsx("strong",{children:"Agent setup"}),r.jsx("small",{children:Se?"Loading setup state":Or(S.state,S.reason)})]}),r.jsx("span",{className:"environment-row-action",children:Q?"Working":Se?"Loading":S.actionLabel})]}):null,r.jsxs("button",{type:"button",className:`environment-row ${T?"active":""}`,disabled:!w||!U,onClick:()=>{oe(!1),U?.()},children:[r.jsx(Pi,{size:15}),r.jsxs("span",{children:[r.jsx("strong",{children:"Changes"}),r.jsx("small",{children:Ke})]}),!ae&&(Ue||p)&&r.jsxs("span",{className:"environment-change-counts",children:[r.jsxs("span",{className:"diff-addition",children:["+",Fe]}),r.jsxs("span",{className:"diff-deletion",children:["-",_e]})]})]}),r.jsxs("div",{className:"environment-row static",children:[r.jsx(Fi,{size:15}),r.jsxs("span",{children:[r.jsx("strong",{children:X}),r.jsx("small",{children:o.repoPath||o.workspacePath})]})]}),ae?r.jsxs("div",{className:"environment-row static",title:Ye,children:[r.jsx(Oi,{size:15}),r.jsxs("span",{children:[r.jsx("strong",{children:"Idle cleanup"}),r.jsx("small",{children:Ye})]})]}):null,r.jsxs("button",{type:"button",className:`environment-row ${ie?"active":""}`,disabled:qe||!e||i||ue||!o.initialized,"aria-expanded":ie,onClick:()=>Ce(y=>!y),children:[r.jsx(Cn,{size:15}),r.jsxs("span",{children:[r.jsx("strong",{children:z}),r.jsx("small",{children:qe?"Managed workspace":e?"Branch":"Git not initialized"})]}),r.jsx(Li,{size:13})]}),ie&&r.jsxs("div",{className:"environment-branch-panel",children:[r.jsxs("label",{className:"environment-branch-search",children:[r.jsx(ki,{size:13}),r.jsx("input",{ref:Te,value:Ne,placeholder:"Search branches",onChange:y=>Oe(y.target.value)})]}),r.jsxs("div",{className:"environment-branch-list",children:[on.map(y=>{const P=y===o.currentBranch,$=i||o.dirty&&!P;return r.jsxs("button",{type:"button",className:P?"selected":"",disabled:$,role:"menuitemradio","aria-checked":P,title:$&&!P?"Commit or discard local changes before switching branches.":y,onClick:()=>{oe(!1),P||te?.(y)},children:[r.jsx(Cn,{size:13}),r.jsxs("span",{children:[r.jsx("strong",{children:y}),P&&o.dirty&&r.jsxs("small",{children:["Uncommitted: ",o.changedFilesCount," ",o.changedFilesCount===1?"file":"files"]})]}),P&&r.jsx(Mi,{size:14})]},y)}),on.length===0&&r.jsx("div",{className:"environment-branch-empty",children:"No branches found"})]}),r.jsxs("button",{type:"button",className:"environment-branch-create",disabled:i||!o.initialized||!V,onClick:()=>{oe(!1),V?.()},children:[r.jsx(Cn,{size:14}),r.jsx("span",{children:"Create branch"})]})]}),r.jsx("div",{className:"environment-section-title",children:"Git"}),Si.map(y=>r.jsxs("button",{type:"button",className:"environment-action",disabled:y.disabled,onClick:()=>tt(y),children:[y.icon,r.jsx("span",{children:y.label})]},y.label)),r.jsx("div",{className:"environment-section-title",children:"Sandbox"}),yi.map(y=>r.jsxs("button",{type:"button",className:"environment-action",disabled:y.disabled,onClick:()=>tt(y),children:[y.icon,r.jsx("span",{children:y.label})]},y.label))]})]}),fe&&r.jsx(Tr,{busy:ue,commitBeforeCreate:(E||e&&b)&&!!o?.dirty,defaultRepoUrl:j,projectName:s?.name??"sandbox template",templateManifest:s?.sandboxTemplate?.normalizedManifest??null,uploadBeforeCreate:E,onClose:()=>{ue||he(!1)},onSubmit:y=>{Ze(y)}}),I&&r.jsx(Pr,{busy:ue,projectName:s?.name??"sandbox template",templateManifest:s?.sandboxTemplate?.normalizedManifest??null,onClose:()=>{ue||B(!1)},onSubmit:y=>{Xe(y)}}),_==="config"&&s?r.jsx(Gr,{busy:Q,error:Re,projectName:s.name,onClose:()=>!Q&&H(null),onSubmit:y=>{fi(y)}}):null,_==="connect"&&s&&R?r.jsx(Kr,{busy:Q,error:Re,defaultTeamId:R.teamId,projectName:s.name,sourceIdentity:o?.remoteUrl??"",defaultBranch:o?.currentBranch??"main",onClose:()=>!Q&&H(null),onSubmit:y=>{hi(y)}}):null,_==="sync"&&S.project?r.jsx(Dt,{busy:Q,error:Re,title:"Sync Project",actionLabel:"Sync Project",summary:`${S.project.name} · ${S.project.sandboxManifestPath??an}`,onClose:()=>!Q&&H(null),onSubmit:()=>{gi()}}):null,_==="agent"&&S.project?r.jsx(Vr,{busy:Q,error:Re,defaultName:`${s?.name??S.project.name} Agent`,onClose:()=>!Q&&H(null),onSubmit:y=>{xi(y)}}):null,_==="run"&&S.agent?r.jsx(Dt,{busy:Q,error:Re,title:"Run Agent",actionLabel:"Run Agent",summary:S.agent.name,onClose:()=>!Q&&H(null),onSubmit:()=>{bi()}}):null]})}export{Na as WorkspaceEnvironmentMenu,Xr as formatIdleTimeout,Zr as sandboxChangeLabel,Qr as sandboxChangedFileCount,ea as sandboxRuntimePolicyLabel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-C8aCGagb.js";/* empty css */import{C as z}from"./cloud-upload-k9eqBsHr.js";import{az as j,a2 as _,X as D}from"./App-s-CJswyt.js";import{G as h}from"./git-commit-horizontal-DrGxH2h4.js";import{U as B}from"./upload-2JkFZo3h.js";function F({open:s,branch:l,filesChanged:i,additions:c,deletions:n,message:m,includeUnstaged:g,nextStep:a,draft:p,busy:t,canPush:u,canPublish:b,onMessageChange:f,onIncludeUnstagedChange:C,onNextStepChange:r,onDraftChange:N,onClose:v,onSubmit:k}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog commit-dialog","aria-label":"Commit changes",onSubmit:o=>{o.preventDefault(),k()},children:[e.jsx(x,{disabled:t,onClose:v}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(h,{size:18})}),e.jsx("h2",{children:"Commit your changes"}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Branch"}),e.jsxs("strong",{children:[e.jsx(j,{size:14}),l??"No branch"]})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Changes"}),e.jsxs("strong",{children:[i," ",i===1?"file":"files",e.jsxs("span",{className:"git-dialog-additions",children:["+",c]}),e.jsxs("span",{className:"git-dialog-deletions",children:["-",n]})]})]}),e.jsxs("label",{className:"git-dialog-toggle",children:[e.jsx("input",{checked:g,disabled:t,type:"checkbox",onChange:o=>C(o.target.checked)}),e.jsx("span",{}),"Include unstaged"]}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Commit message",e.jsx("small",{children:"Leave blank to use an autogenerated message"})]}),e.jsx("textarea",{value:m,disabled:t,placeholder:"Update workspace",onChange:o=>f(o.target.value)})]}),e.jsxs("fieldset",{className:"git-dialog-next",children:[e.jsx("legend",{children:"Next steps"}),e.jsx(d,{active:a==="commit",icon:e.jsx(h,{size:14}),label:"Commit",disabled:t,onSelect:()=>r("commit")}),e.jsx(d,{active:a==="commit_push",icon:e.jsx(B,{size:14}),label:"Commit & push",disabled:t||!u,onSelect:()=>r("commit_push")}),b&&e.jsx(d,{active:a==="commit_publish",icon:e.jsx(z,{size:14}),label:"Commit & publish",disabled:t,onSelect:()=>r("commit_publish")}),e.jsx(d,{active:a==="commit_pr",icon:e.jsx(_,{size:14}),label:"Commit & create PR",disabled:!0,onSelect:()=>r("commit_pr")})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsxs("label",{className:"git-dialog-toggle draft-toggle",children:[e.jsx("input",{checked:p,disabled:t||a!=="commit_pr",type:"checkbox",onChange:o=>N(o.target.checked)}),e.jsx("span",{}),"Draft"]}),e.jsx("button",{className:"git-dialog-primary",disabled:t||i===0,type:"submit",children:"Continue"})]})]})}):null}function H({open:s,branchName:l,busy:i,onBranchNameChange:c,onSetPrefix:n,onClose:m,onSubmit:g}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog branch-dialog","aria-label":"Create branch",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx(x,{disabled:i,onClose:m}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(j,{size:18})}),e.jsx("h2",{children:"Work here"}),e.jsx("p",{children:"Create a branch to commit changes, push, and create a PR from this worktree."}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Branch name",e.jsx("button",{className:"git-dialog-inline-action",disabled:i,type:"button",onClick:n,children:"Set prefix"})]}),e.jsx("input",{autoFocus:!0,disabled:i,value:l,onChange:a=>c(a.target.value)})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:i||!l.trim(),type:"submit",children:"Create"})]})}):null}function d({active:s,icon:l,label:i,disabled:c,onSelect:n}){return e.jsxs("button",{"aria-pressed":s,className:s?"active":"",disabled:c,type:"button",onClick:n,children:[l,e.jsx("span",{children:i}),s&&e.jsx("span",{className:"git-dialog-check",children:"✓"})]})}function x({disabled:s,onClose:l}){return e.jsx("button",{className:"git-dialog-close",disabled:s,type:"button",onClick:l,children:e.jsx(D,{size:16})})}export{H as BranchDialog,F as CommitDialog};
|