openpond 0.2.66 → 0.2.67
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 +23 -0
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-YYZ3ZO3Q.js → acp-NASAJV5E.js} +1 -1
- package/dist/chunks/{acp-agent-T26S7TU2.js → acp-agent-C3CRF6DT.js} +1 -1
- package/dist/chunks/{actions-command-VLKMHCMI.js → actions-command-BYPLSGZL.js} +1 -1
- package/dist/chunks/{app-layer-5XUMNHDO.js → app-layer-XIEZ6ALX.js} +1 -1
- package/dist/chunks/{app-server-evaluations-V6LRWDUF.js → app-server-evaluations-5YZUFXQ2.js} +1 -1
- package/dist/chunks/{app-server-harness-services-6ZRLA3YD.js → app-server-harness-services-N5F5QVZI.js} +1 -1
- package/dist/chunks/{app-server-runtime-TH56EG2Z.js → app-server-runtime-HJ2N57DL.js} +1 -1
- package/dist/chunks/{apps-MNT3KXIY.js → apps-WJTW64NW.js} +1 -1
- package/dist/chunks/{chunk-ZWW227M3.js → chunk-263WS3TB.js} +1 -1
- package/dist/chunks/{chunk-HX6GXMDK.js → chunk-26ID6A5C.js} +1 -1
- package/dist/chunks/{chunk-DSJZS77R.js → chunk-2RSGVLZT.js} +4 -4
- package/dist/chunks/{chunk-L4EJ5R3B.js → chunk-2UZHLO2V.js} +1 -1
- package/dist/chunks/{chunk-QYQZQVVN.js → chunk-375PADDM.js} +1 -1
- package/dist/chunks/{chunk-FUFI4THX.js → chunk-43QYVOYA.js} +1 -1
- package/dist/chunks/{chunk-H5ML7735.js → chunk-46RMTR2Z.js} +1 -1
- package/dist/chunks/{chunk-Z2TOBS3P.js → chunk-4B7EGNYX.js} +1 -1
- package/dist/chunks/{chunk-2GJD23CM.js → chunk-4EZI4KCT.js} +1 -1
- package/dist/chunks/{chunk-DMO3UIS7.js → chunk-4JJ4RYIB.js} +1 -1
- package/dist/chunks/{chunk-JKI53ED7.js → chunk-4NN5OLKW.js} +2 -2
- package/dist/chunks/{chunk-66HFW4OU.js → chunk-4VZJQRQI.js} +1 -1
- package/dist/chunks/{chunk-7PKTCMZ6.js → chunk-543QHE3D.js} +1 -1
- package/dist/chunks/{chunk-TVDZXDQW.js → chunk-5QOFUGYQ.js} +1 -1
- package/dist/chunks/{chunk-6S2MWJVD.js → chunk-5TPYBXWM.js} +1 -1
- package/dist/chunks/{chunk-WLZJOCLA.js → chunk-5ZNE43XC.js} +1 -1
- package/dist/chunks/{chunk-KOKBDIGR.js → chunk-6HQUIKC5.js} +1 -1
- package/dist/chunks/{chunk-3BJ7LPE3.js → chunk-6IS5OLI5.js} +1 -1
- package/dist/chunks/{chunk-VS3AMJEK.js → chunk-6LFTQBXP.js} +1 -1
- package/dist/chunks/{chunk-VD2TQCMH.js → chunk-7HAGSE7L.js} +1 -1
- package/dist/chunks/{chunk-NTM3KQ25.js → chunk-ADOCQA4D.js} +1 -1
- package/dist/chunks/{chunk-4D3CICBG.js → chunk-ATFV2NA4.js} +1 -1
- package/dist/chunks/{chunk-YU4JYWCA.js → chunk-AXO6OHJB.js} +1 -1
- package/dist/chunks/{chunk-5KJMFK65.js → chunk-AXYAEWWA.js} +1 -1
- package/dist/chunks/{chunk-Q4AXZY2P.js → chunk-B2K5WQZE.js} +1 -1
- package/dist/chunks/{chunk-ANG2YMMD.js → chunk-B7XJBP4U.js} +1 -1
- package/dist/chunks/{chunk-BQVB2SPF.js → chunk-BBIA24GD.js} +6 -6
- package/dist/chunks/{chunk-CYQLXS2U.js → chunk-BUZ7CBJC.js} +1 -1
- package/dist/chunks/{chunk-MVPKU72J.js → chunk-CJDGLPNX.js} +1 -1
- package/dist/chunks/{chunk-ZU3YBRXS.js → chunk-CSU7RDA5.js} +1 -1
- package/dist/chunks/{chunk-JLW5BQVO.js → chunk-CWAQOFLP.js} +1 -1
- package/dist/chunks/{chunk-WKHGXLJD.js → chunk-CX7HKSQ4.js} +2 -2
- package/dist/chunks/{chunk-M5QPL5NO.js → chunk-D5OFN47Z.js} +1 -1
- package/dist/chunks/{chunk-QCJY6FTC.js → chunk-FCXDPVGJ.js} +1 -1
- package/dist/chunks/{chunk-FEQ7HNJR.js → chunk-FE2ENE3U.js} +1 -1
- package/dist/chunks/{chunk-6TRVEA3T.js → chunk-FVK4W27G.js} +1 -1
- package/dist/chunks/{chunk-7FBWUVX7.js → chunk-GC6RJBRZ.js} +1 -1
- package/dist/chunks/{chunk-5Z3AU5CL.js → chunk-H2XG5N7D.js} +1 -1
- package/dist/chunks/chunk-H6EUFJJK.js +2 -0
- package/dist/chunks/{chunk-V3S2B6WU.js → chunk-IDILAYCW.js} +1 -1
- package/dist/chunks/{chunk-PLVWARB7.js → chunk-IF5A3XWP.js} +1 -1
- package/dist/chunks/chunk-IHAEZ73V.js +2 -0
- package/dist/chunks/{chunk-GDJ4X2ZN.js → chunk-IR2Y2VQY.js} +1 -1
- package/dist/chunks/{chunk-WBO6FQHR.js → chunk-IXZ5ZGIL.js} +1 -1
- package/dist/chunks/{chunk-67HXM6AL.js → chunk-K3LS5SK7.js} +1 -1
- package/dist/chunks/{chunk-4MQHIFZL.js → chunk-K6DB5QWG.js} +1 -1
- package/dist/chunks/{chunk-QJJNHKLT.js → chunk-KQD36SBJ.js} +1 -1
- package/dist/chunks/{chunk-LXZLLTYQ.js → chunk-LI56PPCN.js} +1 -1
- package/dist/chunks/{chunk-KAWXVMHI.js → chunk-MX7KV5DA.js} +1 -1
- package/dist/chunks/{chunk-LARJARMS.js → chunk-N54CPLVD.js} +1 -1
- package/dist/chunks/{chunk-JRGECNP3.js → chunk-OE2OOWEQ.js} +1 -1
- package/dist/chunks/{chunk-B32CW3NT.js → chunk-OY4B7Y3T.js} +1 -1
- package/dist/chunks/chunk-OYIFH2OM.js +2 -0
- package/dist/chunks/{chunk-C5B3FMV3.js → chunk-P6NQYXN6.js} +1 -1
- package/dist/chunks/{chunk-D7R2AAX2.js → chunk-QFL2VQKX.js} +1 -1
- package/dist/chunks/{chunk-Y3B6ZUE6.js → chunk-QOUOU7FE.js} +1 -1
- package/dist/chunks/{chunk-GIU3Z45P.js → chunk-QQLS5FB7.js} +1 -1
- package/dist/chunks/chunk-R5GRESW3.js +2 -0
- package/dist/chunks/{chunk-6ZTP6CUJ.js → chunk-R6MMWEH4.js} +1 -1
- package/dist/chunks/{chunk-XHBMK6LC.js → chunk-R6VI7MX5.js} +1 -1
- package/dist/chunks/{chunk-GFAI2MCJ.js → chunk-RS526BG7.js} +1 -1
- package/dist/chunks/{chunk-EVQISX7M.js → chunk-RWRKUO5D.js} +1 -1
- package/dist/chunks/{chunk-DXA2UHBE.js → chunk-SD2XDZQW.js} +1 -1
- package/dist/chunks/{chunk-S6UCVXBC.js → chunk-SODAOLAP.js} +1 -1
- package/dist/chunks/{chunk-UK5LGSGT.js → chunk-SVNEPXU3.js} +1 -1
- package/dist/chunks/{chunk-5WPMI6QX.js → chunk-TERKCK4I.js} +1 -1
- package/dist/chunks/{chunk-OKEC2EIE.js → chunk-TS5HNRZB.js} +1 -1
- package/dist/chunks/{chunk-5KWKSR4P.js → chunk-TSQ2I6XV.js} +1 -1
- package/dist/chunks/{chunk-YRDPVTEI.js → chunk-TV2LE2BD.js} +1 -1
- package/dist/chunks/chunk-U3MVH2YT.js +2 -0
- package/dist/chunks/{chunk-FS2VKOT7.js → chunk-UBTP3QWI.js} +1 -1
- package/dist/chunks/{chunk-7XOUM6RK.js → chunk-UKSSFB4Q.js} +1 -1
- package/dist/chunks/{chunk-W7NXFRHN.js → chunk-UNE52L3Y.js} +1 -1
- package/dist/chunks/{chunk-ZUT4EM64.js → chunk-UXO33ST5.js} +1 -1
- package/dist/chunks/{chunk-FHLSLOKH.js → chunk-V3ILZQER.js} +1 -1
- package/dist/chunks/chunk-V3T2OJBZ.js +33 -0
- package/dist/chunks/{chunk-QAEZNFAM.js → chunk-V5AOM5MZ.js} +1 -1
- package/dist/chunks/{chunk-LI3FTPAH.js → chunk-VEXJV5H5.js} +1 -1
- package/dist/chunks/{chunk-AF3AVDPP.js → chunk-VPAEFG7X.js} +1 -1
- package/dist/chunks/{chunk-NABPZ7AK.js → chunk-W3ZILZUL.js} +1 -1
- package/dist/chunks/{chunk-U2BD545L.js → chunk-WD6ANOLL.js} +1 -1
- package/dist/chunks/{chunk-OTUS7NTQ.js → chunk-WDKZMXIU.js} +1 -1
- package/dist/chunks/chunk-WGISITX6.js +4 -0
- package/dist/chunks/{chunk-55Q64WWF.js → chunk-XD4ZIQZ2.js} +1 -1
- package/dist/chunks/{chunk-W22KWKF6.js → chunk-XDFXKRTI.js} +1 -1
- package/dist/chunks/{chunk-GRLQHYAU.js → chunk-XEU4J4GJ.js} +1 -1
- package/dist/chunks/{chunk-IEVJLG3V.js → chunk-XGJG2ZKE.js} +1 -1
- package/dist/chunks/chunk-XHU4BZQY.js +13 -0
- package/dist/chunks/{chunk-DIDQHTAX.js → chunk-XKZ4PFMQ.js} +1 -1
- package/dist/chunks/{chunk-B666Z2NS.js → chunk-XT5WUQGT.js} +1 -1
- package/dist/chunks/{chunk-UXPO3ZV7.js → chunk-YKTJPCYZ.js} +3 -3
- package/dist/chunks/{chunk-5AU5Y6KS.js → chunk-YMCF5GR2.js} +1 -1
- package/dist/chunks/{chunk-LYVHYT3L.js → chunk-YONDU5TN.js} +1 -1
- package/dist/chunks/{chunk-BTJACFU3.js → chunk-YQBL5P6R.js} +1 -1
- package/dist/chunks/{chunk-SAZTOGX6.js → chunk-YR5URT73.js} +1 -1
- package/dist/chunks/{chunk-OXRVILDW.js → chunk-ZVMQLIRA.js} +1 -1
- package/dist/chunks/{chunk-MHPCVQOE.js → chunk-ZWEY66RT.js} +1 -1
- package/dist/chunks/cli-HV32F7HD.js +2 -0
- package/dist/chunks/command-NWOZXU57.js +58 -0
- package/dist/chunks/{configuration-command-4WTS2MZS.js → configuration-command-ZEIBQKB3.js} +1 -1
- package/dist/chunks/{connected-app-executor-7DYMZCD7.js → connected-app-executor-DFHWNMRM.js} +1 -1
- package/dist/chunks/{connected-evidence-D7C45HYD.js → connected-evidence-WOM6N5HO.js} +1 -1
- package/dist/chunks/{connected-starting-assets-4LDXQVLN.js → connected-starting-assets-66Y46ZPM.js} +1 -1
- package/dist/chunks/{continual-HQCFY7GN.js → continual-TNPTWTKK.js} +1 -1
- package/dist/chunks/{core-commands-RXPXOYOP.js → core-commands-GWRHH53F.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-KWRTMKN6.js → dataset-preparation-authoring-WJ2XEUO7.js} +1 -1
- package/dist/chunks/{datasets-LBLEKLCS.js → datasets-XIMF54QN.js} +1 -1
- package/dist/chunks/{desktop-test-INJPZ5VP.js → desktop-test-HF42V2EP.js} +1 -1
- package/dist/chunks/dist-T6ES2TSM.js +2 -0
- package/dist/chunks/{evaluation-coordination-3ARLJAFH.js → evaluation-coordination-WZT6FDMS.js} +1 -1
- package/dist/chunks/{experiment-improvements-UB4C5CSP.js → experiment-improvements-H35VS6XZ.js} +1 -1
- package/dist/chunks/{experiments-AHHKFJD6.js → experiments-F54C32EE.js} +1 -1
- package/dist/chunks/{experiments-signal-MTR475QV.js → experiments-signal-ONIGTGYR.js} +1 -1
- package/dist/chunks/{help-JQA3YMCX.js → help-O53DTZGN.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +2 -0
- package/dist/chunks/{host-profile-external-dataset-YRKG2GL5.js → host-profile-external-dataset-4HOXANWK.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-GPXH3BOG.js → hosted-app-server-composition-Y64A2A2B.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-NZTPZTDH.js → hosted-experiment-improvement-B2V2WIUI.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-3CAT3XBI.js → hosted-profile-candidate-CXPVEEYQ.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-RXU626Q6.js → hosted-profile-compiler-FGCI2VRW.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-CBDRKJ5J.js → hosted-profile-evaluation-control-INNUYMBD.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-CHYKDYUQ.js → hosted-profile-evaluation-inspection-UPTBRYMS.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-H5S7JZMD.js → hosted-profile-evaluation-preparation-TIQSVKLQ.js} +1 -1
- package/dist/chunks/{hosted-tasksets-AMGDDB2R.js → hosted-tasksets-7VMYOTIO.js} +1 -1
- package/dist/chunks/{human-review-DVHVJXBA.js → human-review-7XC77NQP.js} +1 -1
- package/dist/chunks/{import-CLWTKDG6.js → import-OBAKUJPM.js} +1 -1
- package/dist/chunks/javascript-isolate-process-source-YAT3GPW4.js +2 -0
- package/dist/chunks/javascript-verifier-worker-source-LGRP74W4.js +2 -0
- package/dist/chunks/learning-3XDGIYUL.js +2 -0
- package/dist/chunks/{learning-XTY5VOTK.js → learning-CRR6NRPN.js} +1 -1
- package/dist/chunks/{local-harness-improvement-runtime-XEA73RGS.js → local-harness-improvement-runtime-UIKQSAMM.js} +1 -1
- package/dist/chunks/{local-harness-taskset-review-SW35G4DM.js → local-harness-taskset-review-6KJN3EQL.js} +1 -1
- package/dist/chunks/{model-projects-GHWCKDON.js → model-projects-HP4DELCP.js} +1 -1
- package/dist/chunks/{opchat-LMKH3OWR.js → opchat-NWYWWIA7.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-PPOWO7H4.js → opchat-bounded-chat-ICURZM6R.js} +1 -1
- package/dist/chunks/{organizations-T6ZUSHNJ.js → organizations-7DBQGCCV.js} +1 -1
- package/dist/chunks/{profile-RIDNU2I5.js → profile-3WZJ65CT.js} +1 -1
- package/dist/chunks/{project-action-payload-2G57RL74.js → project-action-payload-7DRABTHY.js} +1 -1
- package/dist/chunks/{project-agent-GBMVDJY3.js → project-agent-AXJOWXRU.js} +1 -1
- package/dist/chunks/{published-experiment-source-D3C2AWQD.js → published-experiment-source-YBBPLNF2.js} +1 -1
- package/dist/chunks/{refiner-profile-service-PPGGNVOV.js → refiner-profile-service-ATEFPF5O.js} +1 -1
- package/dist/chunks/{runtime-VSOOPNYN.js → runtime-XP4DEGR3.js} +1 -1
- package/dist/chunks/{sandbox-command-L5VQ2T6C.js → sandbox-command-CF2PJCFX.js} +1 -1
- package/dist/chunks/{sandbox-template-NN3XQI7M.js → sandbox-template-YFMHEMUQ.js} +1 -1
- package/dist/chunks/{saved-work-LAVTNKPT.js → saved-work-3OAVRBH3.js} +1 -1
- package/dist/chunks/setup-RHIMFI2Y.js +2 -0
- package/dist/chunks/{src-662QOKNP.js → src-GQPWOPYA.js} +1 -1
- package/dist/chunks/{src-HJHIBDFX.js → src-V236S6MV.js} +112 -112
- package/dist/chunks/{standalone-experiment-turn-owner-KKYIGGPF.js → standalone-experiment-turn-owner-CDRMGLWW.js} +1 -1
- package/dist/chunks/{store-chat-resources-ZWDYMDJF.js → store-chat-resources-P4EKCLSY.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-7PDLGRWF.js → store-continual-support-reviews-VVRQO2JK.js} +1 -1
- package/dist/chunks/{store-conversation-serving-WRT4N7N2.js → store-conversation-serving-YFEZYQD3.js} +1 -1
- package/dist/chunks/{store-create-improve-G46KIUVT.js → store-create-improve-2XI36AET.js} +1 -1
- package/dist/chunks/{store-datasets-O67F75BL.js → store-datasets-UFY422NG.js} +1 -1
- package/dist/chunks/{store-evaluation-results-BEPR4LVD.js → store-evaluation-results-VBH4R2U7.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-PJJQ74G6.js → store-harness-workspaces-SGUEYDO2.js} +1 -1
- package/dist/chunks/{store-human-review-HJ3D7ZFA.js → store-human-review-RFCVZ3HP.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-EXNRDHCO.js → store-learned-preference-migration-validation-FNBGGZU6.js} +1 -1
- package/dist/chunks/{store-learning-6P6IS7GH.js → store-learning-BFOT4QVT.js} +1 -1
- package/dist/chunks/{store-learning-credentials-EGJ2WTZI.js → store-learning-credentials-DYTMWQTC.js} +1 -1
- package/dist/chunks/{store-local-experiments-CBJA56X2.js → store-local-experiments-XPXGYXNM.js} +1 -1
- package/dist/chunks/{store-model-batch-review-YIVD7T2T.js → store-model-batch-review-J2L5JQV2.js} +1 -1
- package/dist/chunks/{store-model-configuration-T6XJJDAB.js → store-model-configuration-NJFWSYSA.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-WWU5CJTV.js → store-model-project-preparation-OCLIFKI2.js} +1 -1
- package/dist/chunks/{store-preference-comparison-XQFTLMGH.js → store-preference-comparison-MZAYONCK.js} +1 -1
- package/dist/chunks/{store-task-inbox-VVXZUJIO.js → store-task-inbox-3BREANOX.js} +1 -1
- package/dist/chunks/{store-task-inventory-MQX44AI6.js → store-task-inventory-5HRZCDUT.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-G3WFVN4M.js → store-taskset-drafts-BNKUVHPA.js} +1 -1
- package/dist/chunks/{store-training-DUVIDYK5.js → store-training-S3FXWLT6.js} +1 -1
- package/dist/chunks/{store-training-jobs-HHFH3V5O.js → store-training-jobs-2LCXPA7G.js} +1 -1
- package/dist/chunks/{store-training-models-C7UUZDTO.js → store-training-models-7AMKS7ZW.js} +1 -1
- package/dist/chunks/{taskset-7FQCJ55X.js → taskset-PLKWRT4X.js} +1 -1
- package/dist/chunks/{taskset-packages-NRRPON7B.js → taskset-packages-SXBLYHSP.js} +1 -1
- package/dist/chunks/{taskset-packages-RW4SFGDU.js → taskset-packages-V5T4V7YN.js} +1 -1
- package/dist/chunks/{teams-bot-FXMCOCPP.js → teams-bot-VQXUA7U4.js} +1 -1
- package/dist/chunks/{tool-learning-O7QTTEDB.js → tool-learning-47XQKELE.js} +1 -1
- package/dist/chunks/{training-XFM3OOPN.js → training-7VQNCOGH.js} +1 -1
- package/dist/chunks/{training-XILDD5RG.js → training-VKLPNCMC.js} +1 -1
- package/dist/chunks/{training-hosted-6BX2IASC.js → training-hosted-NNE6BP6S.js} +1 -1
- package/dist/chunks/training-hosted-checkpoint-evaluation-2X7RSOLC.js +2 -0
- package/dist/chunks/{training-hosted-learning-YN5VD3PW.js → training-hosted-learning-WQ2IP5FP.js} +1 -1
- package/dist/chunks/training-hosted-report-T633TNJG.js +2 -0
- package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +2 -0
- package/dist/chunks/training-hosted-workers-Y2PO5IOA.js +2 -0
- package/dist/chunks/{training-model-start-E5MP3URL.js → training-model-start-G7YDZ7ZG.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/App-DmEA-Lia.js +53 -0
- package/dist/web/assets/{AppDialog-DuSd0wk6.js → AppDialog-BvskhHE9.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +2 -0
- package/dist/web/assets/{AppToastContext-Dklk6CaG.js → AppToastContext-D2788RqX.js} +1 -1
- package/dist/web/assets/AppsView-B1uNg9IQ.js +1 -0
- package/dist/web/assets/{AppsView-DNHWzJb2.css → AppsView-D3vVesNd.css} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-DipNT6Tj.js → AttachmentTypeIcon-DVluUHuc.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BBaaanMS.js → BrowserSidebar-DfVQoJHn.js} +1 -1
- package/dist/web/assets/{CartesianChart-UU1sdoUO.js → CartesianChart-DdBZ69lI.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-Ct59FKw1.js → ChatTimelineEntry-Bbc6HRks.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BWYRQ1PE.js → CollaborationTabs-ba6WupeJ.js} +1 -1
- package/dist/web/assets/{CommandMenu-B08F9x5g.js → CommandMenu-D7wTaEgl.js} +1 -1
- package/dist/web/assets/{CommunityView-BLTlSxyb.js → CommunityView-mO58f2B0.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-srWBKvCv.js → ComposerAttachments-aO90qXYz.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DqTpU5cO.js → ComposerCreateImproveStrip-BPUJBSyS.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-2KC-KQvu.js → ConversationImportsSettings-Bo836wKJ.js} +1 -1
- package/dist/web/assets/{FilePagePreview-B-iUVPhh.js → FilePagePreview-C6wIp6uX.js} +2 -2
- package/dist/web/assets/{GetStartedView-5v0vBWXy.js → GetStartedView-CxMv8q-h.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-Bn4072K-.js → GettingStartedDialog-CEb0cS-o.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DWF6WPao.js → HostedModelLearningReview-BQIS7hkd.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +1 -0
- package/dist/web/assets/{HtmlVisual-C2WsMj90.js → HtmlVisual-CCuUkYT8.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-CQz29DwD.js → LabModelVersionDetailPage-BkHeVbAx.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-C50P74LI.js → LabSkillSidebar-CFROlATQ.js} +1 -1
- package/dist/web/assets/LabsRoute-YA9YckKj.js +101 -0
- package/dist/web/assets/MainChatThread-DpyPgGKW.js +2 -0
- package/dist/web/assets/{MainPane-Dje-hfUM.css → MainPane-BOWkynGB.css} +1 -1
- package/dist/web/assets/MainPane-WOeodByM.js +10 -0
- package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +2 -0
- package/dist/web/assets/{NativeSkillSidebar-Clv0IWyn.js → NativeSkillSidebar-MAJWS4mL.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cw_F5Eaa.js → NewProjectDialog-MQiUBVx3.js} +1 -1
- package/dist/web/assets/{OutputsPage-Btyiie4B.js → OutputsPage-DpF-aRTu.js} +1 -1
- package/dist/web/assets/{PageChrome-BLLw_cEA.js → PageChrome-8gH2hyDb.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BpSHWQgj.js → ProjectsPage-BQ98oGyu.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-xW5rKbp0.js → RightChatPanelStack-Bs7A4dLs.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-WytWGQgw.js → ScheduledWorkPage-CGCqZz_H.js} +1 -1
- package/dist/web/assets/{SettingsView-BJq5zNkv.js → SettingsView-CqpMFLxy.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-BxFEWI9W.js → TasksetDraftEditorPrimitives-DJvIvzBb.js} +1 -1
- package/dist/web/assets/{TeamChatView-BisSMAXy.js → TeamChatView-DjmIaLO1.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-C7OM2F0-.js → TerminalOverlay-D--M876l.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-KH5GFacT.js → TrainingCreationPanel-DDUoHQHU.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DzOw13Md.js → TrainingDraftPanel-CwLXn3Z7.js} +1 -1
- package/dist/web/assets/{TrainingRunLineage-B2WBOchk.js → TrainingRunLineage-CtYe1KGX.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-nZHno_4P.js → UsageSettingsSection-CGwPregx.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-CyTa8Cjs.js → WorkspaceDiffPanel-JDOUmrC-.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-CtZzxQ1e.js → WorkspaceEnvironmentMenu-sfL5LZeB.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-1U8DDj1J.js → WorkspaceFileLocation-D-ctFM4d.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BO1EUA3G.js → WorkspaceGitDialogs-CQ28j3R7.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-Rqq_sKW_.js → WorkspaceMonacoEditor-BrZs6-EW.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-zmmMp09R.js → WorkspacePdfPreview-CU6PSjjN.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DNbhGjkE.js → WorkspacePresentationPreview-IjXVXpIy.js} +1 -1
- package/dist/web/assets/{app-models-Cz3yxq4x.js → app-models-CKXrDTEU.js} +1 -1
- package/dist/web/assets/{bot-D-eTQib6.js → bot-Cd761lRF.js} +1 -1
- package/dist/web/assets/{browser-sidebar-links-ZyYiYBBd.js → browser-sidebar-links-D9v2cyJa.js} +1 -1
- package/dist/web/assets/chat-resources-BUDXdoG0.js +1 -0
- package/dist/web/assets/{chevron-down-75im8nFF.js → chevron-down-DEbd6Ek-.js} +1 -1
- package/dist/web/assets/chevron-right-DLYNg_Oq.js +1 -0
- package/dist/web/assets/{chevron-up-BD8jg0bQ.js → chevron-up-DFJJccDl.js} +1 -1
- package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +9 -0
- package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +1 -0
- package/dist/web/assets/chunk-H3JZ3P5T-CzpTARDY.js +2 -0
- package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +1 -0
- package/dist/web/assets/chunk-TLSP5JKG-BrrVo5rJ.js +1 -0
- package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +1 -0
- package/dist/web/assets/client-BNjO4Xi8.js +1 -0
- package/dist/web/assets/{client-choice-storage-CXlWJW5g.js → client-choice-storage-DUWsS4X0.js} +1 -1
- package/dist/web/assets/{cloud-upload-4lP-5zmp.js → cloud-upload-CoM1FGeB.js} +1 -1
- package/dist/web/assets/{common-BMjyKlX-.js → common-CFsO2ppZ.js} +1 -1
- package/dist/web/assets/{copy-DRnATDDY.js → copy-BGOhV6Pk.js} +1 -1
- package/dist/web/assets/{create-pipeline-CyUZrbbO.js → create-pipeline-DRR0Qeec.js} +1 -1
- package/dist/web/assets/{createLucideIcon-CmkSm39S.js → createLucideIcon-Bv-_eGcE.js} +1 -1
- package/dist/web/assets/{cssMode-Cps-05f3.js → cssMode-SclUkqPt.js} +1 -1
- package/dist/web/assets/{external-link-D_nBEDFO.js → external-link-CVXsNeO3.js} +1 -1
- package/dist/web/assets/{folder-open-tD5Lle1M.js → folder-open-MnOmh19D.js} +1 -1
- package/dist/web/assets/{folder-plus-DlZ4hM48.js → folder-plus-BRddLBtO.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-g8KBhvfr.js → git-commit-horizontal-Bm4rkXug.js} +1 -1
- package/dist/web/assets/{htmlMode-Do72TyNy.js → htmlMode-X3mQtOeh.js} +1 -1
- package/dist/web/assets/icons-CZxmQtZs.js +1 -0
- package/dist/web/assets/{image-CUZMnZYi.js → image-BViGUAiq.js} +1 -1
- package/dist/web/assets/{index-D7igQSAg.js → index-LXNhSUEL.js} +2 -2
- package/dist/web/assets/{info-SmuBZiE5.js → info-DYPIbKKD.js} +1 -1
- package/dist/web/assets/intake-contracts-wCkD2ErR.js +1 -0
- package/dist/web/assets/{jsonMode-B2N7W15Y.js → jsonMode-BoKiIdHd.js} +1 -1
- package/dist/web/assets/loader-circle-JFgFNsP5.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DPmyOFVA.js → lspLanguageFeatures-CO2mzpy1.js} +1 -1
- package/dist/web/assets/{maximize-2-B8HN3jsA.js → maximize-2-DXZCQO0b.js} +1 -1
- package/dist/web/assets/{message-square-CrDvzn66.js → message-square-cOCAL8J1.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CRdTg0FH.js → monaco.contribution-C7CAQIKF.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BfOxF9PJ.js → monaco.contribution-CVe3mWSY.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DNONXznc.js → monaco.contribution-hrusiaZi.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DqqJBDzF.js → monaco.contribution-wacA5FjV.js} +2 -2
- package/dist/web/assets/{monitor-CW-M_aaj.js → monitor-B35XSAvn.js} +1 -1
- package/dist/web/assets/{paperclip-DL449Io5.js → paperclip-CKgDxioG.js} +1 -1
- package/dist/web/assets/{pdf-BCq2Oosd.js → pdf-Ct3M2mVw.js} +1 -1
- package/dist/web/assets/play-DzqLr7fM.js +1 -0
- package/dist/web/assets/plus-Ddp1vXnw.js +1 -0
- package/dist/web/assets/{ponder-desktop-Dm7tOkKo.js → ponder-desktop-D-zB6X4L.js} +1 -1
- package/dist/web/assets/{presentation-CupIXaYv.js → presentation-B0S9v7ib.js} +1 -1
- package/dist/web/assets/{profile-ref-DSNkG6Ol.js → profile-ref-CCxrOCio.js} +1 -1
- package/dist/web/assets/{python-DuGMr666.js → python-C0-pUUAU.js} +1 -1
- package/dist/web/assets/{refresh-cw-CzVf5_oo.js → refresh-cw-D45mW-vs.js} +1 -1
- package/dist/web/assets/{requests-BCbaFiqV.js → requests-DjSt-duM.js} +1 -1
- package/dist/web/assets/{reward-checks-Bcq9ETCA.js → reward-checks-D139zwha.js} +2 -2
- package/dist/web/assets/{save-DatjrYPV.js → save-Gu4R_82E.js} +1 -1
- package/dist/web/assets/schemas-C9IwV7NS.js +64 -0
- package/dist/web/assets/{settings-D7C-Auyi.js → settings-DdonLCIN.js} +1 -1
- package/dist/web/assets/settings-lists-CFHFtO0D.js +5 -0
- package/dist/web/assets/square-Dqduqyyu.js +1 -0
- package/dist/web/assets/{square-terminal-Buj-s-fz.js → square-terminal-DS3zwi6X.js} +1 -1
- package/dist/web/assets/{submit-issue-command-wfngGS6Y.js → submit-issue-command-Gk3RKrY-.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-cl0cw2QK.js → toggleHighContrast-BnYUBgZB.js} +1 -1
- package/dist/web/assets/training-QBuGBGJd.js +2 -0
- package/dist/web/assets/{training-model-data-CWnu1bz9.js → training-model-data-CxR3xpmK.js} +1 -1
- package/dist/web/assets/{tsMode-DLEc0PYL.js → tsMode-BVNyOY8h.js} +1 -1
- package/dist/web/assets/{upload-DaFVH6R1.js → upload-ABSJxuUM.js} +1 -1
- package/dist/web/assets/{useAccountSettings-ByxjI9BG.js → useAccountSettings-4_XfwJQi.js} +1 -1
- package/dist/web/assets/{useAgentInventory-Df64T07n.js → useAgentInventory-CVuamyT3.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DNh_x9gQ.js → useLocalAgentSchedules-CmwN4ohy.js} +1 -1
- package/dist/web/assets/{useQuery-yUz7Ui8g.js → useQuery-CCjwL8VI.js} +1 -1
- package/dist/web/assets/{wifi-off-CtNwnIJc.js → wifi-off-DGJH7Pke.js} +1 -1
- package/dist/web/assets/{work-outputs-CK0nHe4g.js → work-outputs-CnbRtTLg.js} +1 -1
- package/dist/web/assets/{workers-CnqrOtic.js → workers-CjtQ2aBD.js} +1 -1
- package/dist/web/assets/x-B-_zJVOZ.js +1 -0
- package/dist/web/assets/{yaml-C9vtYV4w.js → yaml-N1KUjBZ8.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +7 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-2ZNW6GUU.js +0 -2
- package/dist/chunks/chunk-3MVKXAH7.js +0 -2
- package/dist/chunks/chunk-G4E3WGLM.js +0 -13
- package/dist/chunks/chunk-I3NYYOSS.js +0 -2
- package/dist/chunks/chunk-JBFPTEVE.js +0 -2
- package/dist/chunks/chunk-OW3EOC5Q.js +0 -4
- package/dist/chunks/chunk-SBQ6KLXB.js +0 -33
- package/dist/chunks/chunk-YBKDEEEH.js +0 -2
- package/dist/chunks/cli-TE7RP5H7.js +0 -2
- package/dist/chunks/command-NW6BGKOM.js +0 -13
- package/dist/chunks/dist-J4KHAVO3.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +0 -2
- package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +0 -2
- package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +0 -2
- package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +0 -2
- package/dist/chunks/learning-NJLTGZFQ.js +0 -2
- package/dist/chunks/setup-TXEM2QSG.js +0 -2
- package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +0 -2
- package/dist/chunks/training-hosted-report-UVGTPDOK.js +0 -2
- package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +0 -2
- package/dist/chunks/training-hosted-workers-6JTDCCWA.js +0 -2
- package/dist/web/assets/App-CNQi3RlI.js +0 -53
- package/dist/web/assets/AppTerminalPanel-DLz34eSs.js +0 -2
- package/dist/web/assets/AppsView-DkCMr67-.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-BYl-2j7B.js +0 -1
- package/dist/web/assets/LabsRoute-DJRgF1kQ.js +0 -101
- package/dist/web/assets/MainChatThread-gwmhe1Nw.js +0 -2
- package/dist/web/assets/MainPane-CqtgV9rU.js +0 -10
- package/dist/web/assets/NativeSetupTerminal-DrQldDsG.js +0 -2
- package/dist/web/assets/RightSidebarHomePanel-BDmIxvIm.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-D3Ub_jVj.js +0 -1
- package/dist/web/assets/chat-resources-CTN4f6KC.js +0 -1
- package/dist/web/assets/chevron-right-CpbCIUFo.js +0 -1
- package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +0 -9
- package/dist/web/assets/chunk-H3JZ3P5T-B0SCoPw4.js +0 -2
- package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +0 -1
- package/dist/web/assets/contracts-BLiqJxBv.js +0 -1
- package/dist/web/assets/icons-B8_Rkg-l.js +0 -1
- package/dist/web/assets/intake-contracts-BW0Y0C2R.js +0 -1
- package/dist/web/assets/loader-circle-D_KVxLLz.js +0 -1
- package/dist/web/assets/play-DYLqBrwg.js +0 -1
- package/dist/web/assets/plus-DXZIpQuY.js +0 -1
- package/dist/web/assets/schemas-lO3MoWQr.js +0 -64
- package/dist/web/assets/settings-lists-D2ol3uNK.js +0 -5
- package/dist/web/assets/square-BWB1nbZF.js +0 -1
- package/dist/web/assets/training-DCdoHJ0Y.js +0 -2
- package/dist/web/assets/x-Bhl-4Zlt.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePagePreview-
|
|
2
|
-
import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{g as n,m as r,t as i}from"./index-D7igQSAg.js";import{t as a}from"./useQuery-yUz7Ui8g.js";import{a as o,m as s,o as c,p as l,r as u,v as d}from"./schemas-lO3MoWQr.js";import{n as f,o as p}from"./client-choice-storage-CXlWJW5g.js";import{n as m}from"./create-pipeline-CyUZrbbO.js";import{n as ee}from"./app-models-Cz3yxq4x.js";import{t as h}from"./query-scope-BRpcgljO.js";import"./icons-B8_Rkg-l.js";import{t as g}from"./createLucideIcon-CmkSm39S.js";import{A as _,B as te,E as ne,F as re,L as v,M as y,R as b,T as x,V as ie,_ as ae,a as oe,b as S,c as se,f as C,g as ce,h as le,j as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e,x as ve,y as ye}from"./training-model-data-CWnu1bz9.js";import{t as be}from"./chevron-up-BD8jg0bQ.js";import{t as w}from"./folder-open-tD5Lle1M.js";import{t as xe}from"./info-SmuBZiE5.js";import{t as Se}from"./loader-circle-D_KVxLLz.js";import{t as Ce}from"./maximize-2-B8HN3jsA.js";import{t as we}from"./message-square-CrDvzn66.js";import{t as Te}from"./plus-DXZIpQuY.js";import{t as T}from"./refresh-cw-CzVf5_oo.js";import{t as Ee}from"./save-DatjrYPV.js";import{t as De}from"./x-Bhl-4Zlt.js";import{n as E,r as Oe}from"./AppToastContext-Dklk6CaG.js";import{B as ke,Bt as Ae,Fn as D,G as je,Gt as Me,H as Ne,J as Pe,Jt as O,K as Fe,L as Ie,O as Le,Pn as Re,R as ze,U as Be,V as Ve,W as k,Yt as A,Zt as j,_n as He,an as Ue,bn as M,dn as We,en as N,gn as Ge,hn as P,in as Ke,ln as qe,on as F,q as Je,un as Ye}from"./App-CNQi3RlI.js";import{n as I,t as L}from"./WorkspaceFileLocation-1U8DDj1J.js";var Xe=u([`local`,`sandbox`]),Ze=u([`pinned`,`saved_for_later`]),Qe=s({id:d().min(1),workspaceKind:Xe,workspaceId:d().min(1),workspaceName:d().min(1),path:d().min(1),status:Ze,order:l().int().nonnegative().nullable().default(null),sourceSessionId:d().min(1).nullable().default(null),available:c().default(!0),createdAt:d().min(1),updatedAt:d().min(1)});s({items:o(Qe)}),s({workspaceKind:Xe,workspaceId:d().trim().min(1),workspaceName:d().trim().min(1),path:d().trim().min(1),status:u([`pinned`,`saved_for_later`,`none`]),order:l().int().nonnegative().nullable().optional(),sourceSessionId:d().trim().min(1).nullable().optional()}),u([`pin`,`save_for_later`,`remove`,`list`]);function $e(e){let t=e.trim().replaceAll(`\\`,`/`);if(t=t.replace(/^(?:workspace|sandbox):file:/,``),t=t.replace(/^\/workspace\/app\//,``),t=t.replace(/^\.\//,``),!t||t.startsWith(`/`))throw Error(`File path must be relative to the workspace.`);let n=t.split(`/`).filter(e=>e&&e!==`.`);if(n.some(e=>e===`..`))throw Error(`File path cannot leave the workspace.`);if(n.length===0)throw Error(`File path is required.`);return n.join(`/`)}function et(e){return[`sidebar-file`,e.workspaceKind,encodeURIComponent(e.workspaceId),encodeURIComponent($e(e.path))].join(`:`)}var tt=g(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),nt=g(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),rt=g(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),it=g(`eye-off`,[[`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`}]]),at=g(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),ot=g(`plug`,[[`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`}]]),st=g(`redo-2`,[[`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`}]]),ct=g(`undo-2`,[[`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`}]]),R=e(n(),1),z=r();function lt({createRuntime:e,goalRuntime:t,subagentRuntime:n=null,onRunSubagentLifecycleAction:r}){let i=e?`Create/Improve Details`:`Goal Details`,a=e?H(e.run.state):n?.activeCount?n.label:t?.actionLabel??`No active goal`;return(0,z.jsxs)(`div`,{className:`goal-details-view`,"aria-label":i,children:[(0,z.jsxs)(`div`,{className:`goal-details-header`,children:[(0,z.jsxs)(`div`,{className:`goal-details-title`,children:[(0,z.jsx)(Ue,{size:15,"aria-hidden":`true`}),(0,z.jsx)(`span`,{children:i})]}),(0,z.jsx)(`span`,{className:`goal-details-state ${Ft(e?.run.state??null)}`,children:a})]}),(0,z.jsx)(`div`,{className:`goal-details-body`,children:e?(0,z.jsx)(ut,{runtime:e}):t||n?(0,z.jsx)(ft,{goalRuntime:t,subagentRuntime:n,onRunSubagentLifecycleAction:r}):(0,z.jsx)(At,{})})]})}function ut({runtime:e}){let t=e.run,n=t.plan,r=m(n?.metadata)??m(t.metadata),i=t.questions,a=i.filter(e=>e.status===`pending`),o=t.sourceRefs,s=t.checkRefs,c=t.state,l=t.target.kind===`agent`?t.target.defaultActionKey:null;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(V,{title:`Current Work`,children:(0,z.jsx)(jt,{rows:[[`State`,H(c)],[`Operation`,t.operation],[`Target`,H(t.target.kind)],[`Name`,t.target.displayName??t.target.id??`Pending`],[`Target ID`,t.target.id??`Pending`],[`Default action`,l??n?.defaultChatAction.key??`Pending`],[`Adapter`,H(t.adapter.kind)],[`Run`,t.id],[`Revision`,String(t.revision)]]})}),(0,z.jsx)(V,{title:`Plan`,children:n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`goal-details-summary`,children:n.summary}),(0,z.jsx)(jt,{rows:[[`Objective`,n.objective],[`Context`,n.capturedContextSummary],[`Status`,H(n.status)],[`Plan ID`,n.id],[`Run ID`,n.runId],[`Approval`,n.approvalId??`Pending`],[`Approved`,n.approvedAt??`Not approved`]]})]}):a.length?(0,z.jsx)(`p`,{className:`goal-details-summary`,children:`Waiting for answers before the model finalizes the Create plan.`}):(0,z.jsx)(`p`,{className:`goal-details-summary`,children:`The model is preparing the Create plan.`})}),r?(0,z.jsxs)(V,{title:`Action Shape`,children:[(0,z.jsx)(jt,{rows:[[`Mode`,r.label],[`Default action`,r.defaultActionKey??`None`],[`Direct action`,r.directActionHint??`None planned`],[`Artifacts`,r.artifactPolicy]]}),(0,z.jsx)(`p`,{className:`goal-details-note`,children:r.detail})]}):null,i.length?(0,z.jsx)(V,{title:`Questions`,children:(0,z.jsx)(`div`,{className:`goal-details-list`,children:i.map(e=>(0,z.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:e.title}),(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:H(e.status)})]}),(0,z.jsx)(`p`,{children:e.prompt}),e.answer?(0,z.jsxs)(`small`,{children:[`Answer: `,e.answer.label??e.answer.value]}):e.options.length?(0,z.jsxs)(`small`,{children:[`Options: `,e.options.map(e=>e.label).join(`, `)]}):null]},e.id))})}):null,n?.requirements.length?(0,z.jsx)(V,{title:`Setup Requirements`,children:(0,z.jsx)(`div`,{className:`goal-details-list`,children:n.requirements.map(e=>(0,z.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:e.name}),(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:H(e.status)})]}),(0,z.jsxs)(`small`,{children:[H(e.kind),e.detail?`: ${e.detail}`:``]})]},`${e.kind}:${e.name}`))})}):null,n?.sourcePlan.length?(0,z.jsx)(V,{title:`Source Plan`,children:(0,z.jsx)(Mt,{refs:n.sourcePlan.map(e=>({id:`${e.operation}:${e.path}`,primary:e.path,secondary:`${H(e.operation)}: ${e.reason}`}))})}):null,n?.checks.length?(0,z.jsx)(V,{title:`Checks`,children:(0,z.jsx)(Mt,{refs:n.checks.map(e=>({id:e.name,primary:e.name,secondary:`${e.required?`Required`:`Optional`}: ${e.command}`}))})}):null,o.length||s.length?(0,z.jsx)(V,{title:`Run Refs`,children:(0,z.jsx)(Mt,{refs:[...o.map(e=>({id:`source:${e}`,primary:e,secondary:`Source ref`})),...s.map(e=>({id:`check:${e}`,primary:e,secondary:`Check ref`}))]})}):null,(0,z.jsx)(dt,{run:t}),t.blockedReason?(0,z.jsx)(V,{title:`Blocked`,children:(0,z.jsxs)(`div`,{className:`goal-details-alert`,children:[(0,z.jsx)(qe,{size:15}),(0,z.jsx)(`span`,{children:t.blockedReason})]})}):null,(0,z.jsx)(V,{title:`Raw State`,children:(0,z.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,z.jsx)(`summary`,{children:`Show structured payload`}),(0,z.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]})})]})}function dt({run:e}){let t=[...e.context.attachments.map(e=>({id:`attachment:${e.id??e.name}`,primary:e.name,secondary:e.ref??e.mediaType??`Attachment`})),...e.context.apps.map(e=>({id:`app:${e.id}`,primary:e.name,secondary:e.required?`Required app context`:`Optional app context`})),...e.context.tools.map(e=>({id:`tool:${e.name}`,primary:e.name,secondary:e.outputSummary??e.inputSummary??`Tool context`})),...e.context.targetRepoAssumptions.map(e=>({id:`target:${e}`,primary:e,secondary:`Target assumption`}))],n=e.workflowCapture,r=n?[...n.files.map(e=>({id:`workflow-file:${e}`,primary:e,secondary:`Captured file`})),...n.outputArtifacts.map(e=>({id:`workflow-artifact:${e}`,primary:e,secondary:`Output artifact`})),...n.traceRefs.map(e=>({id:`workflow-trace:${e}`,primary:e,secondary:`Trace`}))]:[];return!t.length&&!r.length?null:(0,z.jsx)(V,{title:`Context`,children:(0,z.jsx)(Mt,{refs:[...t,...r]})})}function ft({goalRuntime:e,subagentRuntime:t,onRunSubagentLifecycleAction:n}){return(0,z.jsxs)(z.Fragment,{children:[e?(0,z.jsxs)(V,{title:`Goal`,children:[(0,z.jsx)(`p`,{className:`goal-details-summary`,children:e.objective}),(0,z.jsx)(jt,{rows:[[`Status`,e.actionLabel],[`Runtime`,e.timeLabel],[`Detail`,e.detail]]})]}):null,t?(0,z.jsx)(pt,{runtime:t,onRunSubagentLifecycleAction:n}):null,(0,z.jsx)(V,{title:`Raw State`,children:(0,z.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,z.jsx)(`summary`,{children:`Show structured payload`}),(0,z.jsx)(`pre`,{children:JSON.stringify({goalRuntime:e,subagentRuntime:t},null,2)})]})})]})}function pt({runtime:e,onRunSubagentLifecycleAction:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(null);Oe(i);let o=async(e,n)=>{if(!t)return;let i=`${e}:${n}`;r(i),a(null);try{await t({runId:e,action:n})}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(e=>e===i?null:e)}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(V,{title:`Subagents`,children:[(0,z.jsx)(jt,{rows:[[`Latest update`,bt(e)],[`Active`,String(e.activeCount)],[`Completed`,String(e.completedCount)],[`Failed`,String(e.failedCount)],[`Cancelled`,String(e.cancelledCount)],[`Paused`,String(e.needsResumeCount)],[`Terminal`,String(e.terminalCount)],[`Usage`,xt(e.usage.totalTokens,e.usage.requestCount)],[`Evidence`,String(e.evidenceRefs.length)],[`Checks`,String(e.testsRunCount)]]}),e.blockers.length>0?(0,z.jsx)(`ul`,{className:`goal-details-list compact`,children:e.blockers.slice(0,4).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`p`,{children:e.message})]})]},`${e.runId}:${e.message}`))}):null,(0,z.jsx)(`ul`,{className:`goal-details-list`,children:e.runs.slice(0,8).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`p`,{children:e.objective}),e.report?.summary?(0,z.jsx)(`small`,{children:e.report.summary}):null,t?(0,z.jsx)(B,{pendingAction:n,run:e,onRun:o}):null]})]},e.id))})]}),e.finalResults.length>0?(0,z.jsx)(mt,{results:e.finalResults}):null]})}function mt({results:e}){return(0,z.jsx)(V,{title:`Child Results`,children:(0,z.jsx)(`ol`,{className:`goal-details-task-graph`,children:e.slice(0,6).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-task-node`,children:[(0,z.jsxs)(`div`,{className:`goal-details-task-node-header`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`small`,{children:e.objective})]})]}),(0,z.jsx)(`p`,{children:e.summary}),(0,z.jsxs)(`div`,{className:`goal-details-task-node-meta`,children:[(0,z.jsxs)(`span`,{children:[e.refs.length,` refs`]}),(0,z.jsxs)(`span`,{children:[e.testsRun.length+e.validationAttempts.length,` checks`]}),(0,z.jsxs)(`span`,{children:[e.blockers.length,` blockers`]}),(0,z.jsx)(`span`,{children:e.confidence?`${H(e.confidence)} confidence`:`Confidence unknown`})]}),e.findings.length>0?(0,z.jsxs)(`small`,{children:[`Findings: `,Et(e.findings,3)]}):null,e.changedFiles.length>0?(0,z.jsxs)(`small`,{children:[`Files: `,Et(e.changedFiles,4)]}):null,e.testsRun.length>0?(0,z.jsxs)(`small`,{children:[`Tests: `,Et(e.testsRun,3)]}):null,e.validationAttempts.length>0?(0,z.jsxs)(`small`,{children:[`Validation: `,Et(e.validationAttempts,2)]}):null,e.refs.length>0?(0,z.jsxs)(`small`,{children:[`Refs: `,Et(e.refs.map(Ct),4)]}):null,e.blockers.length>0?(0,z.jsxs)(`small`,{children:[`Blockers: `,Et(e.blockers,3)]}):null,e.workspaceRetention?(0,z.jsxs)(`small`,{children:[`Workspace: `,Tt(e.workspaceRetention)]}):null,e.importantMessages.length>0?(0,z.jsxs)(`small`,{children:[`Messages: `,Et(e.importantMessages.map(wt),2)]}):null]},e.runId))})})}function B({pendingAction:e,run:t,onRun:n}){let r=ht(t);return r.length===0?null:(0,z.jsx)(`div`,{className:`goal-details-actions`,children:r.map(r=>{let i=e===`${t.id}:${r}`;return(0,z.jsx)(`button`,{type:`button`,disabled:!!e,onClick:()=>void n(t.id,r),children:i?`Working...`:gt(r)},r)})})}function ht(e){let t=[],n=_t(e),r=vt(e);return n&&t.push(`cleanup`),r&&t.push(`archive`),t}function gt(e){return e===`cleanup`?`Clean`:e===`archive`?`Archive`:`Clean + archive`}function _t(e){if(!yt(e))return!1;let t=Nt(e.metadata);if(!t?.subagentWorkspace&&!t?.workspaceHandoff)return!1;let n=Pt(Nt(Nt(t.lifecycleCleanup)?.workspaceCleanup)?.status);return n!==`removed`&&n!==`deleted`&&n!==`retained`&&n!==`skipped`}function vt(e){if(!e.childSessionId||!yt(e))return!1;let t=Pt(Nt(Nt(e.metadata)?.childSessionArchive)?.status);return t!==`archived`&&t!==`already_archived`}function yt(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`}function bt(e){let t=e.latestMeaningfulUpdate;return t?`${St(t.roleId)} ${t.status}: ${t.message}`:`No structured update`}function xt(e,t){if(e<=0&&t<=0)return`0 tokens`;let n=`${t} ${t===1?`request`:`requests`}`;return`${Dt(e)} tokens · ${n}`}function St(e){return e.slice(0,1).toUpperCase()+e.slice(1).replace(/[-_]+/g,` `)}function Ct(e){return`${e.kind}: ${e.label}`}function wt(e){return`${H(e.kind)}: ${e.body}`}function Tt(e){return`retained ${e.expiresAt?`until ${Ot(e.expiresAt)}`:`for inspection`}${e.trigger?` · ${H(e.trigger)}`:``}`}function Et(e,t){let n=e.slice(0,t),r=e.length-n.length;return r>0?`${n.join(`, `)} +${r}`:n.join(`, `)}function Dt(e){if(e<1e3)return String(e);if(e>=1e6){let t=e/1e6;return`${kt(t,t<10?2:1)}M`}let t=e/1e3;return`${kt(t,+(t<10))}k`}function Ot(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function kt(e,t){return e.toFixed(t).replace(/\.0+$/,``).replace(/(\.\d*?)0+$/,`$1`)}function At(){return(0,z.jsxs)(`div`,{className:`goal-details-empty`,children:[(0,z.jsx)(Ue,{size:18}),(0,z.jsx)(`span`,{children:`No active Goal or Create workflow.`})]})}function V({children:e,title:t}){return(0,z.jsxs)(`section`,{className:`goal-details-section`,children:[(0,z.jsx)(`h2`,{children:t}),e]})}function jt({rows:e}){return(0,z.jsx)(`dl`,{className:`goal-details-grid`,children:e.map(([e,t])=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:e}),(0,z.jsx)(`dd`,{children:t})]},e))})}function Mt({refs:e}){return(0,z.jsx)(`ul`,{className:`goal-details-ref-list`,children:e.map(e=>(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`code`,{title:e.primary,children:e.primary}),(0,z.jsx)(`span`,{children:e.secondary})]},e.id))})}function Nt(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function Pt(e){return typeof e==`string`&&e.trim()?e.trim():null}function H(e){return e.split(/[_-]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ft(e){return e===`ready_local`||e===`published_hosted`?`success`:e===`blocked`||e===`failed`||e===`cancelled`?`danger`:e===`awaiting_questions`||e===`awaiting_plan_approval`?`warning`:`active`}function It({sandboxId:e,connection:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)([]),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null);Oe(u,{prefix:`Sandbox`}),Oe(f,{prefix:`Sandbox integrations`});let m=n?.integrationLeases??[],ee=(0,R.useMemo)(()=>i.filter(e=>e.status===`active`),[i]),h=(0,R.useMemo)(()=>zt(n),[n]),g=(0,R.useCallback)(async()=>{if(!t)d(`OpenPond App server is not connected.`);else if(!e)r(null),a([]),d(null);else{s(`summary`),d(null);try{let n=await M.sandbox(t,e),i=await M.integrationConnections(t,Lt(n.sandbox));r(n.sandbox),a(i.connections),p(null)}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(null)}}},[t,e]),_=(0,R.useCallback)(async()=>{if(t&&n){l(`load`),p(null);try{let[e,i]=await Promise.all([M.integrationConnections(t,Lt(n)),M.sandboxIntegrationLeases(t,n.id)]);a(e.connections),r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),te=(0,R.useCallback)(async e=>{if(!t||!n)return;let i=D(e.provider),a=i?Re(i):null,o=a?.leasePolicy.allowedCapabilityIds??[];if(!i||!a?.leasePolicy.leaseable||o.length===0)p(`${U(e.provider)} cannot be attached to this sandbox.`);else{l(`attach:${e.id}`),p(null);try{let i=await M.attachSandboxIntegrationConnection(t,n.id,{connectionId:e.id,provider:e.provider,capabilities:o,...e.scopes.length>0?{scopes:e.scopes}:{},...a.leasePolicy.defaultTtlSeconds?{ttlSeconds:a.leasePolicy.defaultTtlSeconds}:{},required:!1});r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),ne=(0,R.useCallback)(async e=>{if(t&&n){l(`remove:${e}`),p(null);try{let i=await M.removeSandboxIntegrationLease(t,n.id,e);r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]);return(0,R.useEffect)(()=>{g()},[g]),e?(0,z.jsxs)(`div`,{className:`sandbox-summary-tab`,children:[(0,z.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,z.jsx)(`h3`,{children:`Sandbox`}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[n?(0,z.jsx)(`span`,{children:n.state}):null,(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh summary`,"aria-label":`Refresh summary`,disabled:o!==null,onClick:()=>void g(),children:o===`summary`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(T,{size:14})})]})]}),n?(0,z.jsxs)(`dl`,{className:`sandbox-workspace-kv`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Sandbox`}),(0,z.jsx)(`dd`,{children:Gt(n.id)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Spend`}),(0,z.jsxs)(`dd`,{children:[qt(n.reservation.capturedUsd),` / `,qt(n.budget.maxUsd)]})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Reservation`}),(0,z.jsx)(`dd`,{children:n.reservation.status})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Idle cleanup`}),(0,z.jsx)(`dd`,{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:`-`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Updated`}),(0,z.jsx)(`dd`,{children:Kt(n.updatedAt)})]}),h?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Receipt`}),(0,z.jsxs)(`dd`,{children:[Gt(h.id),` / `,qt(h.totalUsd)]})]}):null]}):(0,z.jsxs)(`div`,{className:`sandbox-workspace-loading`,children:[o===`summary`?(0,z.jsx)(Se,{className:`spinning`,size:16}):null,(0,z.jsx)(`span`,{children:o===`summary`?`Loading sandbox`:`Sandbox unavailable`})]})]}),(0,z.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,z.jsx)(`h3`,{children:`Integrations`}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[(0,z.jsx)(`span`,{children:m.length}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh integrations`,"aria-label":`Refresh integrations`,disabled:c!==null||!n,onClick:()=>void _(),children:c===`load`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(T,{size:14})})]})]}),m.length>0?(0,z.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:m.map(e=>(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-row`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,z.jsx)(`span`,{children:U(e.provider)}),(0,z.jsxs)(`small`,{children:[e.required?`required`:`optional`,` / `,Ht(e),` / `,Rt(e)]})]}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Revoke ${U(e.provider)} lease`,"aria-label":`Revoke ${U(e.provider)} lease`,disabled:c!==null,onClick:()=>void ne(e.leaseId),children:c===`remove:${e.leaseId}`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(re,{size:14})}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-chip-row`,children:[e.capabilities.slice(0,5).map(t=>(0,z.jsx)(`span`,{children:Vt(e.provider,t)},t)),e.capabilities.length>5?(0,z.jsxs)(`span`,{children:[`+`,e.capabilities.length-5]}):null]})]},e.leaseId))}):(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No active integration leases.`}),ee.length>0?(0,z.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:ee.map(e=>{let t=m.some(t=>t.provider===e.provider),n=Bt(e)?.leasePolicy.allowedCapabilityIds.length??0;return(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-row compact`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,z.jsx)(`span`,{children:Ut(e)}),(0,z.jsx)(`small`,{children:Wt(e,n)})]}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`${U(e.provider)} already attached`:`Attach ${U(e.provider)}`,"aria-label":t?`${U(e.provider)} already attached`:`Attach ${U(e.provider)}`,disabled:t||c!==null||n===0,onClick:()=>void te(e),children:c===`attach:${e.id}`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(ot,{size:14})})]},e.id)})}):(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No connected accounts available.`})]})]}):(0,z.jsx)(`div`,{className:`sandbox-summary-tab`,children:(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No sandbox is attached yet.`})})}function Lt(e){return{status:`active`}}function Rt(e){return e.proxyUrl?`runtime proxy available`:`metadata only, no runtime proxy`}function zt(e){return e?.receipts?.at(-1)??null}function Bt(e){let t=D(e.provider);return t?Re(t):null}function U(e){let t=D(e),n=t?Re(t):null;return n?n.label:e===`microsoft_teams`?`Microsoft Teams`:e?e.replace(/_/g,` `):`Integration`}function Vt(e,t){let n=D(e);return(n?Re(n):null)?.capabilities.find(e=>e.id===t)?.label??t}function Ht(e){return e.expiresAt?`expires ${Kt(e.expiresAt)}`:`active`}function Ut(e){let t=e.providerAccountName?.trim();return t?`${U(e.provider)} / ${t}`:U(e.provider)}function Wt(e,t){let n=[];return e.providerWorkspaceName&&n.push(e.providerWorkspaceName),n.push(`${t} lease ${t===1?`capability`:`capabilities`}`),e.scopes.length>0&&n.push(`${e.scopes.length} ${e.scopes.length===1?`scope`:`scopes`}`),n.join(` / `)}function Gt(e){return e.length>10?`${e.slice(0,8)}...`:e}function Kt(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.valueOf())?`-`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(t)}function qt(e){let t=Number(e??0);return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:t>=10?2:4}).format(Number.isFinite(t)?t:0)}function Jt({summary:e}){let t=he(e.taskset),n=e.taskset.learningSignals.demonstrations.filter(e=>e.approved).length,r=e.taskset.tasks.filter(e=>e.split===`frozen_eval`).length,i=e.plan?.recipe.method===`sft`||e.plan?.recipe.method===`grpo`?e.plan.recipe:null,a=C(e.taskset,e.plan),o=e.job?se(e.job.status,e.job.completedAt,e.job.updatedAt):null;return(0,z.jsxs)(`div`,{className:`training-sidebar-summary`,children:[(0,z.jsxs)(`header`,{children:[(0,z.jsx)(`h2`,{children:oe(e.taskset.name,t)}),(0,z.jsx)(`span`,{children:e.job?pe(e.job.status):e.taskset.readiness?.ready?`Ready to train`:`Needs review`})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Run`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Primary recommendation`,value:t.toUpperCase()}),(0,z.jsx)(W,{label:`Training stage`,value:a}),(0,z.jsx)(W,{label:`Base model`,value:i?.baseModel.id??`Not selected`}),(0,z.jsx)(W,{label:`Compute`,value:e.plan?ge(e.plan.destinationId):`Not selected`}),(0,z.jsx)(W,{label:`Started`,value:fe(e.job?.startedAt??null)}),(0,z.jsx)(W,{label:`Duration`,value:me(e.job?.startedAt??null,o)})]})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Data`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Training examples`,value:String(n)}),(0,z.jsx)(W,{label:`Test examples`,value:String(r)}),(0,z.jsx)(W,{label:`Dataset sources`,value:String(e.taskset.sourceRefs.length)})]})]}),i?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Recipe`}),(0,z.jsxs)(`dl`,{children:[i.method===`grpo`?(0,z.jsx)(W,{label:`RL loss`,value:i.loss.method===`gspo-token`?`GSPO-token`:i.loss.method.toUpperCase()}):null,(0,z.jsx)(W,{label:`LoRA rank`,value:String(i.lora.rank)}),(0,z.jsx)(W,{label:`Learning rate`,value:String(i.optimizer.learningRate)}),(0,z.jsx)(W,{label:`Optimizer steps`,value:String(i.optimizer.maxSteps)}),(0,z.jsx)(W,{label:i.method===`grpo`?`Prompt length`:`Sequence length`,value:String(i.method===`grpo`?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Result`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Adapter`,value:e.lineage?`${a} ready`:`Not created`}),(0,z.jsx)(W,{label:`Evaluation`,value:e.lineage?.frozenEvaluationArtifactId?`Completed`:`Not completed`}),(0,z.jsx)(W,{label:`Artifacts`,value:String(e.artifacts.length)})]})]})]})}function W({label:e,value:t}){return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:e}),(0,z.jsx)(`dd`,{children:t})]})}function Yt(e){let t=Xt(``,``,`folder`);for(let n of e){let e=n.endsWith(`/`),r=n.split(`/`).filter(Boolean);if(r.length===0)continue;let i=t,a=``;for(let t=0;t<r.length;t+=1){let n=r[t];a=a?`${a}/${n}`:n;let o=!e&&t===r.length-1?`file`:`folder`,s=`${o}:${n}`,c=i.childMap.get(s);c||(c=Xt(n,a,o),i.childMap.set(s,c),i.children.push(c)),i=c}}return Zt(t.children)}function Xt(e,t,n){return{name:e,path:t,type:n,children:[],childMap:new Map}}function Zt(e){return e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`folder`?-1:1).map(e=>({name:e.name,path:e.path,type:e.type,children:Zt(e.children)}))}function Qt({className:e,currentStatus:t,onSetStatus:n}){let r=t===`pinned`,i=t===`saved_for_later`;return(0,z.jsxs)(`span`,{className:`workspace-file-bookmark-actions ${e??`workspace-file-heading-actions`}`,children:[(0,z.jsx)(`button`,{type:`button`,className:r?`active`:void 0,"data-tooltip":r?`Unpin file`:`Pin file`,"aria-label":r?`Unpin file`:`Pin file`,"aria-pressed":r,onClick:()=>n(r?`none`:`pinned`),children:r?(0,z.jsx)(O,{size:14}):(0,z.jsx)(A,{size:14})}),(0,z.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?(0,z.jsx)(Ge,{size:14}):(0,z.jsx)(He,{size:14})})]})}function $t({changedByPath:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=(0,R.useMemo)(()=>Yt(r),[r]);return(0,z.jsxs)(`div`,{className:`workspace-file-tree-view`,children:[(0,z.jsxs)(`div`,{className:`workspace-file-tree-header`,children:[(0,z.jsx)(w,{size:14}),(0,z.jsx)(`strong`,{title:n??void 0,children:n?n.split(`/`).at(-1):`Files`}),(0,z.jsx)(`span`,{children:r.length})]}),(0,z.jsx)(`div`,{className:`workspace-file-tree`,children:l.map(r=>(0,z.jsx)(G,{changedByPath:e,expandedFolderPaths:t,node:r,rootPath:n,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c},`${r.type}:${r.path}`))})]})}function G({changedByPath:e,depth:t=0,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l}){let u=i?`${i}/${r.path}`:r.path,d=r.type===`folder`&&n.has(u),f=e.get(u),p=2+t*11;return r.type===`folder`?(0,z.jsxs)(`div`,{className:`workspace-file-tree-node`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row folder`,"aria-expanded":d,style:{paddingLeft:p},onClick:()=>l(u),children:[d?(0,z.jsx)(w,{size:14}):(0,z.jsx)(Ke,{size:14}),(0,z.jsx)(`span`,{children:r.name})]}),d&&r.children.map(r=>(0,z.jsx)(G,{changedByPath:e,depth:t+1,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l},`${r.type}:${r.path}`))]}):(0,z.jsxs)(`div`,{className:`workspace-file-tree-row file ${f?`changed`:``} ${a===u?`selected`:``}`,style:{paddingLeft:p},children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row-main`,title:u,onClick:()=>s(u),children:[(0,z.jsx)(b,{size:13}),(0,z.jsx)(`span`,{children:r.name}),f&&(0,z.jsxs)(`small`,{children:[(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,f.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,f.deletions]})]})]}),/\.html?$/i.test(u)&&(0,z.jsx)(`button`,{type:`button`,className:`workspace-file-tree-bookmark-actions`,title:`View source`,"aria-label":`View source for ${r.name}`,onClick:()=>s(u,{source:!0}),children:`</>`}),c?(0,z.jsx)(Qt,{className:`workspace-file-tree-bookmark-actions`,currentStatus:o?.(u)??null,onSetStatus:e=>c(u,e)}):null]})}function en({diff:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=e?.files??[],u=(0,R.useMemo)(()=>new Map(l.map(e=>[e.path,e])),[l]),d=n?.replace(/^\/+|\/+$/g,``)||null,f=(0,R.useMemo)(()=>{if(!d)return r;let e=`${d}/`;return r.filter(t=>t.startsWith(e)).map(t=>t.slice(e.length)).filter(Boolean)},[d,r]);return(0,z.jsx)(`div`,{className:`workspace-diff-files-view`,children:(0,z.jsx)($t,{changedByPath:u,expandedFolderPaths:t,rootPath:d,repoFiles:f,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c})})}function tn({collapsed:e,editorControlsVisible:t,hideWhiteSpace:n,loadFullFiles:r,renderMarkdown:i,wordDiffs:a,wordWrap:o,onClose:s,onCopyGitApply:c,onRefresh:l,onToggleCollapsed:u,onToggleEditorControlsVisible:d,onToggleHideWhiteSpace:f,onToggleLoadFullFiles:p,onToggleRenderMarkdown:m,onToggleWordDiffs:ee,onToggleWordWrap:h}){return(0,z.jsxs)(`div`,{className:`workspace-diff-options-menu`,role:`menu`,children:[(0,z.jsx)(K,{icon:(0,z.jsx)(T,{size:14}),label:`Refresh`,onClick:l,onClose:s}),(0,z.jsx)(K,{checked:o,icon:(0,z.jsx)(ie,{size:14}),label:`Enable word wrap`,onClick:h,onClose:s}),(0,z.jsx)(K,{checked:e,icon:(0,z.jsx)(nt,{size:14}),label:`Collapse all diffs`,onClick:u,onClose:s}),(0,z.jsx)(`div`,{className:`workspace-diff-menu-divider`}),(0,z.jsx)(K,{checked:t,icon:(0,z.jsx)(at,{size:14}),label:`Show editor controls`,onClick:d,onClose:s}),(0,z.jsx)(K,{checked:i,icon:(0,z.jsx)(P,{size:14}),label:`Render Markdown`,onClick:m,onClose:s}),(0,z.jsx)(K,{checked:!r,icon:(0,z.jsx)(Ue,{size:14}),label:`Show diffs first`,onClick:p,onClose:s}),(0,z.jsx)(K,{checked:a,icon:(0,z.jsx)(tt,{size:14}),label:`Enable word diffs`,onClick:ee,onClose:s}),(0,z.jsx)(K,{checked:n,icon:(0,z.jsx)(it,{size:14}),label:`Hide white space`,onClick:f,onClose:s}),(0,z.jsx)(K,{icon:(0,z.jsx)(te,{size:14}),label:`Copy git apply command`,onClick:c,onClose:s})]})}function K({checked:e,icon:t,label:n,onClick:r,onClose:i}){return(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r?.(),i()},children:[t,(0,z.jsx)(`span`,{children:n}),e&&(0,z.jsx)(We,{size:14})]})}function nn({addMenuOpen:e,expanded:t,filteredFiles:n,dirtyFilePaths:r,openFiles:i,goalDetailsAvailable:a,searchOpen:o,searchQuery:s,selectedPath:c,sideChatTabs:l=[],summaryAvailable:u,sourceStatus:d,sourceSwitcher:f,visibleTab:p,toolbarActions:m,additionalTabs:ee,tabOrder:h=[],filesTabOpen:g=!0,onCloseFilesTab:_,overviewTabs:te=[],outputsLabel:ne=`Training`,activeOverviewId:re,onNewOverview:y,onSelectOverview:b,onCloseOverview:x,getFileBookmarkStatus:ie,onCloseFileTab:ae,onCloseSideChat:oe,onCloseSearch:S,onOpenFile:se,onOpenBrowser:C,onOpenSearch:ce,onOpenSideChat:le,onSearchQueryChange:ue,onSetFileBookmarkStatus:de,onSelectFile:fe,onSelectFiles:pe,onSelectOutputs:me,onSelectGoal:he,onSelectSummary:ge,onSelectSideChat:_e,onToggleAddMenu:ve,onToggleExpanded:ye}){let be=(0,R.useRef)(null),Se=(0,R.useRef)(null);(0,R.useEffect)(()=>{Se.current?.querySelector(`button[role="tab"][aria-selected="true"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[re,i.length,c,p]),(0,R.useEffect)(()=>{if(!e&&!o)return;function t(){e&&ve(),o&&S()}function n(e){be.current?.contains(e.target)||t()}function r(e){e.key===`Escape`&&t()}return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r)}},[e,S,ve,o]);function T(e){e.key===`Escape`?S():e.key===`Enter`&&(n[0]||s.trim())&&se(n[0]||s.trim())}function Ee(e){if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLButtonElement)||t.getAttribute(`role`)!==`tab`)return;let n=Array.from(e.currentTarget.querySelectorAll(`button[role="tab"]`)),r=n.indexOf(t);if(r<0||n.length===0)return;e.preventDefault();let i=n[k(r,n.length,e.key)];if(!i)return;i.focus(),i.click();let a=i.id;a&&window.requestAnimationFrame(()=>document.getElementById(a)?.focus())}let E=[...te.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`outputs`&&re===e?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`outputs`&&re===e,tabIndex:p===`outputs`&&re===e?0:-1,onClick:()=>b?.(e),children:[(0,z.jsx)(Ue,{className:`workspace-diff-tab-icon`,size:14}),(0,z.jsx)(`span`,{children:e===-2?`Agents`:e===-1?ne:`New tab`})]}),(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":e===-2?`Close Agents`:e===-1?`Close ${ne}`:`Close new tab`,onClick:()=>x?.(e),children:(0,z.jsx)(De,{size:12})})]},`overview-${e}`)),a?(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`goal`?`active`:``}`,role:`tab`,"aria-selected":p===`goal`,onClick:he,children:[(0,z.jsx)(Ue,{size:14}),(0,z.jsx)(`span`,{children:`Goal`})]},`goal`):null,u&&ge?(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`summary`?`active`:``}`,role:`tab`,"aria-selected":p===`summary`,onClick:ge,children:[(0,z.jsx)(xe,{size:14}),(0,z.jsx)(`span`,{children:`Summary`})]},`summary`):null,g?(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`files`?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":p===`files`,tabIndex:p===`files`?0:-1,onClick:pe,children:[(0,z.jsx)(w,{className:`workspace-diff-tab-icon`,size:14}),(0,z.jsx)(`span`,{children:`Files`})]}),_?(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":`Close files tab`,onClick:_,children:(0,z.jsx)(De,{size:12})}):null]},`files`):null,...i.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`file`&&c===e.path?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`file`&&c===e.path,title:e.path,onClick:()=>fe(e.path),children:[(0,z.jsx)(Ue,{className:`workspace-diff-tab-icon`,size:13}),r.has(e.path)&&(0,z.jsx)(`span`,{className:`workspace-diff-tab-dirty`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{children:I(e.path)})]}),de?(0,z.jsx)(Qt,{className:`workspace-diff-tab-bookmark-actions`,currentStatus:ie?.(e.path)??null,onSetStatus:t=>de(e.path,t)}):null,(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.path}`,onClick:t=>ae(e.path,t),children:(0,z.jsx)(De,{size:12})})]},e.path)),...l.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":!1,tabIndex:-1,title:e.title,onClick:()=>_e?.(e.id),children:[e.running?(0,z.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,z.jsx)(`span`,{children:e.title})]}),oe?(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),oe(e.id)},children:(0,z.jsx)(De,{size:12})}):null]},e.id))].filter(e=>e!==null),Oe=new Map(h.map((e,t)=>[e,t]));return E.sort((e,t)=>(Oe.get(String(e.key))??h.length)-(Oe.get(String(t.key))??h.length)),(0,z.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,ref:Se,onKeyDown:Ee,children:[E,ee]}),(0,z.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:be,children:[(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${!y&&(e||o)?`active`:``}`,title:`Add`,"aria-label":y?`New tab`:`Add to right sidebar`,onClick:y??ve,children:(0,z.jsx)(Te,{size:15})}),e&&(0,z.jsxs)(`div`,{className:`workspace-diff-add-menu`,role:`menu`,children:[me?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:me,children:[(0,z.jsx)(Ue,{size:14}),(0,z.jsx)(`span`,{children:`Training`}),(0,z.jsx)(`kbd`,{})]}):null,le?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:le,children:[(0,z.jsx)(we,{size:14}),(0,z.jsx)(`span`,{children:`New task`}),(0,z.jsx)(`kbd`,{})]}):null,(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:pe,children:[(0,z.jsx)(w,{size:14}),(0,z.jsx)(`span`,{children:`Files`}),(0,z.jsx)(`kbd`,{})]}),u&&ge?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ge,children:[(0,z.jsx)(xe,{size:14}),(0,z.jsx)(`span`,{children:`Summary`}),(0,z.jsx)(`kbd`,{})]}):null,(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ce,children:[(0,z.jsx)(Me,{size:14}),(0,z.jsx)(`span`,{children:`Open file`}),(0,z.jsx)(`kbd`,{children:`Ctrl+P`})]}),C?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:C,children:[(0,z.jsx)(N,{size:14}),(0,z.jsx)(`span`,{children:`Browser`}),(0,z.jsx)(`kbd`,{children:`Ctrl+I`})]}):null]}),o&&(0,z.jsxs)(`div`,{className:`workspace-file-search-popover`,children:[(0,z.jsx)(`input`,{autoFocus:!0,placeholder:`Search files`,value:s,onChange:e=>ue(e.target.value),onKeyDown:T}),(0,z.jsx)(`span`,{children:`Files`}),(0,z.jsx)(`div`,{className:`workspace-file-search-results`,children:n.length===0?(0,z.jsx)(`small`,{children:`Type to search for files`}):n.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>se(e),children:e},e))})]})]}),p!==`outputs`&&(f||d)?(0,z.jsxs)(`div`,{className:`workspace-diff-source-bar`,"aria-label":`Workspace source`,children:[f?(0,z.jsx)(`div`,{className:`workspace-diff-source-toggle`,role:`group`,"aria-label":`File source`,children:f.options.map(e=>(0,z.jsx)(`button`,{type:`button`,className:f.value===e.value?`active`:``,"aria-pressed":f.value===e.value,onClick:()=>f.onChange(e.value),children:e.label},e.value))}):null,d?(0,z.jsx)(`span`,{className:`workspace-diff-source-status ${d.tone}`,children:d.label}):null]}):null,m,(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`Restore files panel`:`Expand files panel`,"aria-label":t?`Restore files panel`:`Expand files panel`,onClick:ye,children:t?(0,z.jsx)(v,{size:14}):(0,z.jsx)(Ce,{size:14})})]})}function rn({inline:e=!1,canCheckActiveFile:t,canSaveActiveFile:n,collapsed:r,editorControlsVisible:i,editorDiagnosticStatus:a,editorDiagnosticsChecking:o,hideWhiteSpace:s,loadFullFiles:c,menuOpen:l,renderMarkdown:u,showEditorCommandBar:d,showRenderMarkdownToggle:f,splitView:p,wordDiffs:m,wordWrap:ee,onCopyGitApply:h,onEditorCheck:g,onEditorRedo:_,onEditorSave:te,onEditorUndo:ne,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleMenu:ie,onToggleRenderMarkdown:ae,onToggleSplitView:oe,onToggleWordDiffs:S,onToggleWordWrap:se}){return(0,z.jsx)(`div`,{className:`workspace-diff-toolbar ${e?`inline`:``}`,children:(0,z.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-menu-anchor`,children:[(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Diff options`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>ie(),children:(0,z.jsx)(j,{size:15})}),l&&(0,z.jsx)(tn,{collapsed:r,editorControlsVisible:i,hideWhiteSpace:s,loadFullFiles:c,renderMarkdown:u,wordDiffs:m,wordWrap:ee,onClose:()=>ie(!1),onCopyGitApply:h,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleRenderMarkdown:ae,onToggleWordDiffs:S,onToggleWordWrap:se})]}),d&&(0,z.jsxs)(`div`,{className:`workspace-editor-command-bar`,"aria-label":`Editor controls`,children:[(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Save file`,"aria-label":`Save file`,disabled:!n,onClick:te,children:(0,z.jsx)(Ee,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Undo`,"aria-label":`Undo`,onClick:ne,children:(0,z.jsx)(ct,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Redo`,"aria-label":`Redo`,onClick:_,children:(0,z.jsx)(st,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Check file`,"aria-label":`Check file`,disabled:!t,onClick:g,children:o?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(Ye,{size:14})}),a&&(0,z.jsxs)(`span`,{className:`workspace-editor-diagnostic-chip ${a.severity}`,children:[a.severity===`error`||a.severity===`warning`||a.severity===`unavailable`?(0,z.jsx)(qe,{size:13}):(0,z.jsx)(Ye,{size:13}),(0,z.jsx)(`span`,{children:a.label})]})]}),f&&(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button ${u?`active`:``}`,title:u?`Show Markdown source`:`Render Markdown`,"aria-label":u?`Show Markdown source`:`Render Markdown`,"aria-pressed":u,onClick:ae,children:(0,z.jsx)(P,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button ${p?`active`:``}`,title:p?`Show unified diff`:`Show split diff`,"aria-label":p?`Show unified diff`:`Show split diff`,"aria-pressed":p,onClick:oe,children:(0,z.jsx)(rt,{size:14})})]})})}var an=class{pending=new Map;cancelled=new Set;receive(e,t){let n=t?.loadId;if(n===void 0)return`open`;let r=this.pending.get(e);return t?.loading?(r!==void 0&&r!==n&&this.cancelled.add(r),this.pending.set(e,n),`open`):this.cancelled.delete(n)||r!==void 0&&r!==n?`ignore`:(this.pending.delete(e),r===void 0?`open`:`complete`)}close(e){let t=this.pending.get(e);t!==void 0&&this.cancelled.add(t),this.pending.delete(e)}retain(e){for(let t of this.pending.keys())e.has(t)||this.close(t)}};function on({connection:e,workspaceId:t,sandboxId:n,file:r,dirty:i,onReload:o}){let s=S(r.path)||t,c=E(),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(!0);(0,R.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let[m,ee]=(0,R.useState)(r.readVersion),g=(0,R.useRef)(null),_=a({queryKey:[`open-file-version`,h(e),n??s,r.path],enabled:!!(e&&(n||s)),queryFn:async()=>{if(!n)return M.workspaceFileVersion(e,s,r.path);let t=r.path.includes(`/`)?r.path.slice(0,r.path.lastIndexOf(`/`))||`/`:`.`,{files:i}=await M.sandboxFiles(e,n,{path:t,recursive:!1}),a=i.find(e=>e.path===r.path||e.path.split(`/`).pop()===r.path.split(`/`).pop());if(!a)return{exists:!1,revision:null};let o=`${a.sizeBytes}:${a.updatedAt}`;if(r.readStamp===o)return{exists:!0,revision:r.readVersion??null};if(g.current?.stamp===o)return{exists:!0,revision:g.current.revision??null};let c=await de(e,n,r.path);return g.current={stamp:o,revision:c.readVersion},{exists:!0,revision:c.readVersion??null}},refetchInterval:5e3,refetchOnWindowFocus:!0}),te=_.refetch;(0,R.useEffect)(()=>{let t=!1;return f(!1),(async()=>{let i=r.contentEncoding===`base64`&&r.content?await ye(r.content):r.readVersion;t||(ee(i),e&&(n||s)&&await te(),t||f(!0))})().catch(()=>{t||f(!0)}),()=>{t=!0}},[te,e,r.content,r.contentEncoding,r.readVersion,n,s]),(0,R.useEffect)(()=>{m===void 0&&!r.content&&_.data&&ee(_.data.revision)},[m,r.content,_.data]);let ne=d&&m!==void 0&&!_.isError&&_.data?.exists&&m!==_.data.revision;async function re(){if(e&&(n||s)&&!l&&(!i||window.confirm(`Discard unsaved edits and refresh this file from disk?`))){u(!0);try{let t=await _.refetch();if(t.error)throw t.error;if(!n&&Le(r.path)){let n=/^(?:[~/\\]|[A-Za-z]:)/.test(r.path)?await M.signLocalImageUrl(e,{path:r.path}):await M.signWorkspaceImageUrl(e,{appId:s,path:r.path}),i=new URL(n.url);if(i.searchParams.set(`refresh`,String(Date.now())),!p.current)return;o({...r,readVersion:t.data?.revision},i.href)}else{let i=n?await de(e,n,r.path):await M.workspaceFile(e,s,r.path);if(!p.current)return;o(i,Le(r.path)&&i.contentEncoding===`base64`&&i.content?`data:image/${/\.jpe?g$/i.test(r.path)?`jpeg`:r.path.split(`.`).pop()};base64,${i.content}`:void 0),ee(i.readVersion??t.data?.revision)}_.refetch()}catch(e){p.current&&c?.(e instanceof Error?e.message:`Could not refresh file.`,`error`)}finally{p.current&&u(!1)}}}return!ne&&!l?null:(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-refresh`,disabled:l||!e||!n&&!s,onClick:()=>void re(),"aria-label":`Reload updated file`,title:ne?`The file changed. Reload to show the latest version.`:`Reload this file from disk`,children:[(0,z.jsx)(T,{size:14,className:l?`spinning`:void 0}),(0,z.jsx)(`span`,{children:l?`Reloading…`:`Reload`})]})}var sn={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 cn(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`?`shell`:t===`readme`||t===`readme.md`?`markdown`:sn[t.includes(`.`)?t.split(`.`).pop()??``:``]??`text`}function ln(e,t){return e?t===`markdown`?un(e):t===`json`?q(e,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):t===`css`?q(e,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):t===`html`?q(e,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):t===`shell`?q(e,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):t===`python`?q(e,/(#.*$|"""[\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):q(e,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\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 un(e){return/^\s{0,3}#{1,6}\s/.test(e)?[{text:e,kind:`keyword`}]:/^\s*[-*+]\s/.test(e)?[{text:e,kind:`property`}]:q(e,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function dn(e){return/^(\/\/|#|\/\*|<!--)/.test(e)?`comment`:/^["'`]/.test(e)?`string`:/^[-]?\d/.test(e)||/^#[\da-fA-F]{3,8}\b/.test(e)?`number`:/^\b[A-Z]/.test(e)?`type`:/^[.#]?[\w-]+$/.test(e)&&e.includes(`-`)?`property`:/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(e)?`operator`:/^(?:--|\$)/.test(e)?`property`:`keyword`}function q(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i.index??0;t>r&&n.push({text:e.slice(r,t),kind:`plain`});let a=i[0];if(n.push({text:a,kind:dn(a)}),r=t+a.length,/^(\/\/|#|<!--)/.test(a))break}return r<e.length&&n.push({text:e.slice(r),kind:`plain`}),n.length>0?n:[{text:e,kind:`plain`}]}function J({language:e,text:t}){return(0,z.jsx)(z.Fragment,{children:ln(t,e).map((e,t)=>(0,z.jsx)(`span`,{className:`syntax-token ${e.kind}`,children:e.text},`${t}-${e.text}`))})}var fn=(0,R.lazy)(()=>i(()=>import(`./FilePagePreview-B-iUVPhh.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]))),Y=(0,R.lazy)(()=>i(()=>import(`./WorkspacePdfPreview-zmmMp09R.js`),__vite__mapDeps([55,1,2,3,45,54])));function X({path:e,contentBase64:t}){let n=I(e),r=(0,R.useMemo)(()=>{try{let n=atob(t.replace(/\s/g,``)),r=Uint8Array.from(n,e=>e.charCodeAt(0));return new Blob([r],{type:pn(e)})}catch{return null}},[t,e]),[i,a]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(!r)return;let e=URL.createObjectURL(r);return a({blob:r,url:e}),()=>URL.revokeObjectURL(e)},[r]);let o=i?.blob===r?i.url:null;return r?o?(0,z.jsxs)(`div`,{className:`workspace-document-preview`,children:[(0,z.jsxs)(`div`,{className:`workspace-document-preview-card`,children:[(0,z.jsx)(L,{path:e}),(0,z.jsxs)(`div`,{className:`workspace-document-preview-actions`,children:[(0,z.jsx)(`span`,{children:/\.pdf$/i.test(e)?`PDF`:`Word`}),(0,z.jsx)(`a`,{href:o,download:n,"aria-label":`Download document`,title:`Download document`,children:(0,z.jsx)(F,{size:16,"aria-hidden":`true`})})]})]}),/\.docx$/i.test(e)?(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,z.jsx)(fn,{thumbnail:!1,file:{path:e,content:t,contentEncoding:`base64`,status:``,additions:0,deletions:0,patch:``}})}):(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,z.jsx)(Y,{contentBase64:t})})]}):(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading document…`}):(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Document preview unavailable.`})}function pn(e){return/\.pdf$/i.test(e)?`application/pdf`:/\.docx$/i.test(e)?`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:`application/msword`}var mn=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePagePreview-C6wIp6uX.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-LXNhSUEL.js","assets/index-g7UqJhnX.css","assets/icons-CZxmQtZs.js","assets/App-DmEA-Lia.js","assets/useQuery-CCjwL8VI.js","assets/schemas-C9IwV7NS.js","assets/common-CFsO2ppZ.js","assets/settings-DdonLCIN.js","assets/client-choice-storage-DUWsS4X0.js","assets/api-client-Dgz-fOMl.js","assets/requests-DjSt-duM.js","assets/create-pipeline-DRR0Qeec.js","assets/profile-ref-CCxrOCio.js","assets/chunk-H3JZ3P5T-CzpTARDY.js","assets/work-outputs-CnbRtTLg.js","assets/training-QBuGBGJd.js","assets/chunk-GJRXJL6G-luaxRTYI.js","assets/chunk-GHPCQXG5-DKDBSd8H.js","assets/reward-checks-D139zwha.js","assets/intake-contracts-wCkD2ErR.js","assets/chunk-JDQVAG3R-C0-rh1aR.js","assets/ponder-desktop-D-zB6X4L.js","assets/chat-resources-BUDXdoG0.js","assets/app-models-CKXrDTEU.js","assets/model-display-zPvC4L2B.js","assets/submit-issue-command-Gk3RKrY-.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-D9v2cyJa.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/createLucideIcon-Bv-_eGcE.js","assets/bot-Cd761lRF.js","assets/chevron-down-DEbd6Ek-.js","assets/chevron-right-DLYNg_Oq.js","assets/copy-BGOhV6Pk.js","assets/external-link-CVXsNeO3.js","assets/loader-circle-JFgFNsP5.js","assets/maximize-2-DXZCQO0b.js","assets/message-square-cOCAL8J1.js","assets/plus-Ddp1vXnw.js","assets/refresh-cw-D45mW-vs.js","assets/square-terminal-DS3zwi6X.js","assets/x-B-_zJVOZ.js","assets/AppToastContext-D2788RqX.js","assets/models-route-CWcJuOd0.js","assets/NativeSetupTerminal-fmG2c65K.js","assets/AppDialog-BvskhHE9.js","assets/PageChrome-8gH2hyDb.js","assets/NativeSetupTerminal-3eR9D_R3.css","assets/organization-types-PP-yuR2J.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-DpFKLxuA.css","assets/pdf.worker.min-BrEVksTu.js","assets/WorkspacePdfPreview-CU6PSjjN.js","assets/WorkspaceMonacoEditor-BrZs6-EW.js","assets/WorkspaceMonacoEditor-C5uazxST.css","assets/WorkspacePresentationPreview-IjXVXpIy.js","assets/WorkspaceFileLocation-D-ctFM4d.js","assets/aiden0z-pptx-renderer.es-Bo43EjzT.js","assets/jszip.min-BWcKrrYP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{g as n,m as r,t as i}from"./index-LXNhSUEL.js";import{t as a}from"./useQuery-CCjwL8VI.js";import{a as o,m as s,o as c,p as l,r as u,v as d}from"./schemas-C9IwV7NS.js";import{n as f,o as p}from"./client-choice-storage-DUWsS4X0.js";import{n as m}from"./create-pipeline-DRR0Qeec.js";import{n as ee}from"./app-models-CKXrDTEU.js";import{t as h}from"./query-scope-BRpcgljO.js";import"./icons-CZxmQtZs.js";import{t as g}from"./createLucideIcon-Bv-_eGcE.js";import{A as _,B as te,E as ne,F as re,L as v,M as y,R as b,T as x,V as ie,_ as ae,a as oe,b as S,c as se,f as C,g as ce,h as le,j as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e,x as ve,y as ye}from"./training-model-data-CxR3xpmK.js";import{t as be}from"./chevron-up-DFJJccDl.js";import{t as w}from"./folder-open-MnOmh19D.js";import{t as xe}from"./info-DYPIbKKD.js";import{t as Se}from"./loader-circle-JFgFNsP5.js";import{t as Ce}from"./maximize-2-DXZCQO0b.js";import{t as we}from"./message-square-cOCAL8J1.js";import{t as Te}from"./plus-Ddp1vXnw.js";import{t as T}from"./refresh-cw-D45mW-vs.js";import{t as Ee}from"./save-Gu4R_82E.js";import{t as De}from"./x-B-_zJVOZ.js";import{n as E,r as Oe}from"./AppToastContext-D2788RqX.js";import{B as ke,Bt as Ae,Fn as D,G as je,Gt as Me,H as Ne,J as Pe,Jt as O,K as Fe,L as Ie,O as Le,Pn as Re,R as ze,U as Be,V as Ve,W as k,Yt as A,Zt as j,_n as He,an as Ue,bn as M,dn as We,en as N,gn as Ge,hn as P,in as Ke,ln as qe,on as F,q as Je,un as Ye}from"./App-DmEA-Lia.js";import{n as I,t as L}from"./WorkspaceFileLocation-D-ctFM4d.js";var Xe=u([`local`,`sandbox`]),Ze=u([`pinned`,`saved_for_later`]),Qe=s({id:d().min(1),workspaceKind:Xe,workspaceId:d().min(1),workspaceName:d().min(1),path:d().min(1),status:Ze,order:l().int().nonnegative().nullable().default(null),sourceSessionId:d().min(1).nullable().default(null),available:c().default(!0),createdAt:d().min(1),updatedAt:d().min(1)});s({items:o(Qe)}),s({workspaceKind:Xe,workspaceId:d().trim().min(1),workspaceName:d().trim().min(1),path:d().trim().min(1),status:u([`pinned`,`saved_for_later`,`none`]),order:l().int().nonnegative().nullable().optional(),sourceSessionId:d().trim().min(1).nullable().optional()}),u([`pin`,`save_for_later`,`remove`,`list`]);function $e(e){let t=e.trim().replaceAll(`\\`,`/`);if(t=t.replace(/^(?:workspace|sandbox):file:/,``),t=t.replace(/^\/workspace\/app\//,``),t=t.replace(/^\.\//,``),!t||t.startsWith(`/`))throw Error(`File path must be relative to the workspace.`);let n=t.split(`/`).filter(e=>e&&e!==`.`);if(n.some(e=>e===`..`))throw Error(`File path cannot leave the workspace.`);if(n.length===0)throw Error(`File path is required.`);return n.join(`/`)}function et(e){return[`sidebar-file`,e.workspaceKind,encodeURIComponent(e.workspaceId),encodeURIComponent($e(e.path))].join(`:`)}var tt=g(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),nt=g(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),rt=g(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),it=g(`eye-off`,[[`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`}]]),at=g(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),ot=g(`plug`,[[`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`}]]),st=g(`redo-2`,[[`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`}]]),ct=g(`undo-2`,[[`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`}]]),R=e(n(),1),z=r();function lt({createRuntime:e,goalRuntime:t,subagentRuntime:n=null,onRunSubagentLifecycleAction:r}){let i=e?`Create/Improve Details`:`Goal Details`,a=e?H(e.run.state):n?.activeCount?n.label:t?.actionLabel??`No active goal`;return(0,z.jsxs)(`div`,{className:`goal-details-view`,"aria-label":i,children:[(0,z.jsxs)(`div`,{className:`goal-details-header`,children:[(0,z.jsxs)(`div`,{className:`goal-details-title`,children:[(0,z.jsx)(Ue,{size:15,"aria-hidden":`true`}),(0,z.jsx)(`span`,{children:i})]}),(0,z.jsx)(`span`,{className:`goal-details-state ${Ft(e?.run.state??null)}`,children:a})]}),(0,z.jsx)(`div`,{className:`goal-details-body`,children:e?(0,z.jsx)(ut,{runtime:e}):t||n?(0,z.jsx)(ft,{goalRuntime:t,subagentRuntime:n,onRunSubagentLifecycleAction:r}):(0,z.jsx)(At,{})})]})}function ut({runtime:e}){let t=e.run,n=t.plan,r=m(n?.metadata)??m(t.metadata),i=t.questions,a=i.filter(e=>e.status===`pending`),o=t.sourceRefs,s=t.checkRefs,c=t.state,l=t.target.kind===`agent`?t.target.defaultActionKey:null;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(V,{title:`Current Work`,children:(0,z.jsx)(jt,{rows:[[`State`,H(c)],[`Operation`,t.operation],[`Target`,H(t.target.kind)],[`Name`,t.target.displayName??t.target.id??`Pending`],[`Target ID`,t.target.id??`Pending`],[`Default action`,l??n?.defaultChatAction.key??`Pending`],[`Adapter`,H(t.adapter.kind)],[`Run`,t.id],[`Revision`,String(t.revision)]]})}),(0,z.jsx)(V,{title:`Plan`,children:n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`goal-details-summary`,children:n.summary}),(0,z.jsx)(jt,{rows:[[`Objective`,n.objective],[`Context`,n.capturedContextSummary],[`Status`,H(n.status)],[`Plan ID`,n.id],[`Run ID`,n.runId],[`Approval`,n.approvalId??`Pending`],[`Approved`,n.approvedAt??`Not approved`]]})]}):a.length?(0,z.jsx)(`p`,{className:`goal-details-summary`,children:`Waiting for answers before the model finalizes the Create plan.`}):(0,z.jsx)(`p`,{className:`goal-details-summary`,children:`The model is preparing the Create plan.`})}),r?(0,z.jsxs)(V,{title:`Action Shape`,children:[(0,z.jsx)(jt,{rows:[[`Mode`,r.label],[`Default action`,r.defaultActionKey??`None`],[`Direct action`,r.directActionHint??`None planned`],[`Artifacts`,r.artifactPolicy]]}),(0,z.jsx)(`p`,{className:`goal-details-note`,children:r.detail})]}):null,i.length?(0,z.jsx)(V,{title:`Questions`,children:(0,z.jsx)(`div`,{className:`goal-details-list`,children:i.map(e=>(0,z.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:e.title}),(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:H(e.status)})]}),(0,z.jsx)(`p`,{children:e.prompt}),e.answer?(0,z.jsxs)(`small`,{children:[`Answer: `,e.answer.label??e.answer.value]}):e.options.length?(0,z.jsxs)(`small`,{children:[`Options: `,e.options.map(e=>e.label).join(`, `)]}):null]},e.id))})}):null,n?.requirements.length?(0,z.jsx)(V,{title:`Setup Requirements`,children:(0,z.jsx)(`div`,{className:`goal-details-list`,children:n.requirements.map(e=>(0,z.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:e.name}),(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:H(e.status)})]}),(0,z.jsxs)(`small`,{children:[H(e.kind),e.detail?`: ${e.detail}`:``]})]},`${e.kind}:${e.name}`))})}):null,n?.sourcePlan.length?(0,z.jsx)(V,{title:`Source Plan`,children:(0,z.jsx)(Mt,{refs:n.sourcePlan.map(e=>({id:`${e.operation}:${e.path}`,primary:e.path,secondary:`${H(e.operation)}: ${e.reason}`}))})}):null,n?.checks.length?(0,z.jsx)(V,{title:`Checks`,children:(0,z.jsx)(Mt,{refs:n.checks.map(e=>({id:e.name,primary:e.name,secondary:`${e.required?`Required`:`Optional`}: ${e.command}`}))})}):null,o.length||s.length?(0,z.jsx)(V,{title:`Run Refs`,children:(0,z.jsx)(Mt,{refs:[...o.map(e=>({id:`source:${e}`,primary:e,secondary:`Source ref`})),...s.map(e=>({id:`check:${e}`,primary:e,secondary:`Check ref`}))]})}):null,(0,z.jsx)(dt,{run:t}),t.blockedReason?(0,z.jsx)(V,{title:`Blocked`,children:(0,z.jsxs)(`div`,{className:`goal-details-alert`,children:[(0,z.jsx)(qe,{size:15}),(0,z.jsx)(`span`,{children:t.blockedReason})]})}):null,(0,z.jsx)(V,{title:`Raw State`,children:(0,z.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,z.jsx)(`summary`,{children:`Show structured payload`}),(0,z.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]})})]})}function dt({run:e}){let t=[...e.context.attachments.map(e=>({id:`attachment:${e.id??e.name}`,primary:e.name,secondary:e.ref??e.mediaType??`Attachment`})),...e.context.apps.map(e=>({id:`app:${e.id}`,primary:e.name,secondary:e.required?`Required app context`:`Optional app context`})),...e.context.tools.map(e=>({id:`tool:${e.name}`,primary:e.name,secondary:e.outputSummary??e.inputSummary??`Tool context`})),...e.context.targetRepoAssumptions.map(e=>({id:`target:${e}`,primary:e,secondary:`Target assumption`}))],n=e.workflowCapture,r=n?[...n.files.map(e=>({id:`workflow-file:${e}`,primary:e,secondary:`Captured file`})),...n.outputArtifacts.map(e=>({id:`workflow-artifact:${e}`,primary:e,secondary:`Output artifact`})),...n.traceRefs.map(e=>({id:`workflow-trace:${e}`,primary:e,secondary:`Trace`}))]:[];return!t.length&&!r.length?null:(0,z.jsx)(V,{title:`Context`,children:(0,z.jsx)(Mt,{refs:[...t,...r]})})}function ft({goalRuntime:e,subagentRuntime:t,onRunSubagentLifecycleAction:n}){return(0,z.jsxs)(z.Fragment,{children:[e?(0,z.jsxs)(V,{title:`Goal`,children:[(0,z.jsx)(`p`,{className:`goal-details-summary`,children:e.objective}),(0,z.jsx)(jt,{rows:[[`Status`,e.actionLabel],[`Runtime`,e.timeLabel],[`Detail`,e.detail]]})]}):null,t?(0,z.jsx)(pt,{runtime:t,onRunSubagentLifecycleAction:n}):null,(0,z.jsx)(V,{title:`Raw State`,children:(0,z.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,z.jsx)(`summary`,{children:`Show structured payload`}),(0,z.jsx)(`pre`,{children:JSON.stringify({goalRuntime:e,subagentRuntime:t},null,2)})]})})]})}function pt({runtime:e,onRunSubagentLifecycleAction:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(null);Oe(i);let o=async(e,n)=>{if(!t)return;let i=`${e}:${n}`;r(i),a(null);try{await t({runId:e,action:n})}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(e=>e===i?null:e)}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(V,{title:`Subagents`,children:[(0,z.jsx)(jt,{rows:[[`Latest update`,bt(e)],[`Active`,String(e.activeCount)],[`Completed`,String(e.completedCount)],[`Failed`,String(e.failedCount)],[`Cancelled`,String(e.cancelledCount)],[`Paused`,String(e.needsResumeCount)],[`Terminal`,String(e.terminalCount)],[`Usage`,xt(e.usage.totalTokens,e.usage.requestCount)],[`Evidence`,String(e.evidenceRefs.length)],[`Checks`,String(e.testsRunCount)]]}),e.blockers.length>0?(0,z.jsx)(`ul`,{className:`goal-details-list compact`,children:e.blockers.slice(0,4).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`p`,{children:e.message})]})]},`${e.runId}:${e.message}`))}):null,(0,z.jsx)(`ul`,{className:`goal-details-list`,children:e.runs.slice(0,8).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`p`,{children:e.objective}),e.report?.summary?(0,z.jsx)(`small`,{children:e.report.summary}):null,t?(0,z.jsx)(B,{pendingAction:n,run:e,onRun:o}):null]})]},e.id))})]}),e.finalResults.length>0?(0,z.jsx)(mt,{results:e.finalResults}):null]})}function mt({results:e}){return(0,z.jsx)(V,{title:`Child Results`,children:(0,z.jsx)(`ol`,{className:`goal-details-task-graph`,children:e.slice(0,6).map(e=>(0,z.jsxs)(`li`,{className:`goal-details-task-node`,children:[(0,z.jsxs)(`div`,{className:`goal-details-task-node-header`,children:[(0,z.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`strong`,{children:St(e.roleId)}),(0,z.jsx)(`small`,{children:e.objective})]})]}),(0,z.jsx)(`p`,{children:e.summary}),(0,z.jsxs)(`div`,{className:`goal-details-task-node-meta`,children:[(0,z.jsxs)(`span`,{children:[e.refs.length,` refs`]}),(0,z.jsxs)(`span`,{children:[e.testsRun.length+e.validationAttempts.length,` checks`]}),(0,z.jsxs)(`span`,{children:[e.blockers.length,` blockers`]}),(0,z.jsx)(`span`,{children:e.confidence?`${H(e.confidence)} confidence`:`Confidence unknown`})]}),e.findings.length>0?(0,z.jsxs)(`small`,{children:[`Findings: `,Et(e.findings,3)]}):null,e.changedFiles.length>0?(0,z.jsxs)(`small`,{children:[`Files: `,Et(e.changedFiles,4)]}):null,e.testsRun.length>0?(0,z.jsxs)(`small`,{children:[`Tests: `,Et(e.testsRun,3)]}):null,e.validationAttempts.length>0?(0,z.jsxs)(`small`,{children:[`Validation: `,Et(e.validationAttempts,2)]}):null,e.refs.length>0?(0,z.jsxs)(`small`,{children:[`Refs: `,Et(e.refs.map(Ct),4)]}):null,e.blockers.length>0?(0,z.jsxs)(`small`,{children:[`Blockers: `,Et(e.blockers,3)]}):null,e.workspaceRetention?(0,z.jsxs)(`small`,{children:[`Workspace: `,Tt(e.workspaceRetention)]}):null,e.importantMessages.length>0?(0,z.jsxs)(`small`,{children:[`Messages: `,Et(e.importantMessages.map(wt),2)]}):null]},e.runId))})})}function B({pendingAction:e,run:t,onRun:n}){let r=ht(t);return r.length===0?null:(0,z.jsx)(`div`,{className:`goal-details-actions`,children:r.map(r=>{let i=e===`${t.id}:${r}`;return(0,z.jsx)(`button`,{type:`button`,disabled:!!e,onClick:()=>void n(t.id,r),children:i?`Working...`:gt(r)},r)})})}function ht(e){let t=[],n=_t(e),r=vt(e);return n&&t.push(`cleanup`),r&&t.push(`archive`),t}function gt(e){return e===`cleanup`?`Clean`:e===`archive`?`Archive`:`Clean + archive`}function _t(e){if(!yt(e))return!1;let t=Nt(e.metadata);if(!t?.subagentWorkspace&&!t?.workspaceHandoff)return!1;let n=Pt(Nt(Nt(t.lifecycleCleanup)?.workspaceCleanup)?.status);return n!==`removed`&&n!==`deleted`&&n!==`retained`&&n!==`skipped`}function vt(e){if(!e.childSessionId||!yt(e))return!1;let t=Pt(Nt(Nt(e.metadata)?.childSessionArchive)?.status);return t!==`archived`&&t!==`already_archived`}function yt(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`}function bt(e){let t=e.latestMeaningfulUpdate;return t?`${St(t.roleId)} ${t.status}: ${t.message}`:`No structured update`}function xt(e,t){if(e<=0&&t<=0)return`0 tokens`;let n=`${t} ${t===1?`request`:`requests`}`;return`${Dt(e)} tokens · ${n}`}function St(e){return e.slice(0,1).toUpperCase()+e.slice(1).replace(/[-_]+/g,` `)}function Ct(e){return`${e.kind}: ${e.label}`}function wt(e){return`${H(e.kind)}: ${e.body}`}function Tt(e){return`retained ${e.expiresAt?`until ${Ot(e.expiresAt)}`:`for inspection`}${e.trigger?` · ${H(e.trigger)}`:``}`}function Et(e,t){let n=e.slice(0,t),r=e.length-n.length;return r>0?`${n.join(`, `)} +${r}`:n.join(`, `)}function Dt(e){if(e<1e3)return String(e);if(e>=1e6){let t=e/1e6;return`${kt(t,t<10?2:1)}M`}let t=e/1e3;return`${kt(t,+(t<10))}k`}function Ot(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function kt(e,t){return e.toFixed(t).replace(/\.0+$/,``).replace(/(\.\d*?)0+$/,`$1`)}function At(){return(0,z.jsxs)(`div`,{className:`goal-details-empty`,children:[(0,z.jsx)(Ue,{size:18}),(0,z.jsx)(`span`,{children:`No active Goal or Create workflow.`})]})}function V({children:e,title:t}){return(0,z.jsxs)(`section`,{className:`goal-details-section`,children:[(0,z.jsx)(`h2`,{children:t}),e]})}function jt({rows:e}){return(0,z.jsx)(`dl`,{className:`goal-details-grid`,children:e.map(([e,t])=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:e}),(0,z.jsx)(`dd`,{children:t})]},e))})}function Mt({refs:e}){return(0,z.jsx)(`ul`,{className:`goal-details-ref-list`,children:e.map(e=>(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`code`,{title:e.primary,children:e.primary}),(0,z.jsx)(`span`,{children:e.secondary})]},e.id))})}function Nt(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function Pt(e){return typeof e==`string`&&e.trim()?e.trim():null}function H(e){return e.split(/[_-]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ft(e){return e===`ready_local`||e===`published_hosted`?`success`:e===`blocked`||e===`failed`||e===`cancelled`?`danger`:e===`awaiting_questions`||e===`awaiting_plan_approval`?`warning`:`active`}function It({sandboxId:e,connection:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)([]),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null);Oe(u,{prefix:`Sandbox`}),Oe(f,{prefix:`Sandbox integrations`});let m=n?.integrationLeases??[],ee=(0,R.useMemo)(()=>i.filter(e=>e.status===`active`),[i]),h=(0,R.useMemo)(()=>zt(n),[n]),g=(0,R.useCallback)(async()=>{if(!t)d(`OpenPond App server is not connected.`);else if(!e)r(null),a([]),d(null);else{s(`summary`),d(null);try{let n=await M.sandbox(t,e),i=await M.integrationConnections(t,Lt(n.sandbox));r(n.sandbox),a(i.connections),p(null)}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(null)}}},[t,e]),_=(0,R.useCallback)(async()=>{if(t&&n){l(`load`),p(null);try{let[e,i]=await Promise.all([M.integrationConnections(t,Lt(n)),M.sandboxIntegrationLeases(t,n.id)]);a(e.connections),r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),te=(0,R.useCallback)(async e=>{if(!t||!n)return;let i=D(e.provider),a=i?Re(i):null,o=a?.leasePolicy.allowedCapabilityIds??[];if(!i||!a?.leasePolicy.leaseable||o.length===0)p(`${U(e.provider)} cannot be attached to this sandbox.`);else{l(`attach:${e.id}`),p(null);try{let i=await M.attachSandboxIntegrationConnection(t,n.id,{connectionId:e.id,provider:e.provider,capabilities:o,...e.scopes.length>0?{scopes:e.scopes}:{},...a.leasePolicy.defaultTtlSeconds?{ttlSeconds:a.leasePolicy.defaultTtlSeconds}:{},required:!1});r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),ne=(0,R.useCallback)(async e=>{if(t&&n){l(`remove:${e}`),p(null);try{let i=await M.removeSandboxIntegrationLease(t,n.id,e);r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]);return(0,R.useEffect)(()=>{g()},[g]),e?(0,z.jsxs)(`div`,{className:`sandbox-summary-tab`,children:[(0,z.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,z.jsx)(`h3`,{children:`Sandbox`}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[n?(0,z.jsx)(`span`,{children:n.state}):null,(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh summary`,"aria-label":`Refresh summary`,disabled:o!==null,onClick:()=>void g(),children:o===`summary`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(T,{size:14})})]})]}),n?(0,z.jsxs)(`dl`,{className:`sandbox-workspace-kv`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Sandbox`}),(0,z.jsx)(`dd`,{children:Gt(n.id)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Spend`}),(0,z.jsxs)(`dd`,{children:[qt(n.reservation.capturedUsd),` / `,qt(n.budget.maxUsd)]})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Reservation`}),(0,z.jsx)(`dd`,{children:n.reservation.status})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Idle cleanup`}),(0,z.jsx)(`dd`,{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:`-`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Updated`}),(0,z.jsx)(`dd`,{children:Kt(n.updatedAt)})]}),h?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Receipt`}),(0,z.jsxs)(`dd`,{children:[Gt(h.id),` / `,qt(h.totalUsd)]})]}):null]}):(0,z.jsxs)(`div`,{className:`sandbox-workspace-loading`,children:[o===`summary`?(0,z.jsx)(Se,{className:`spinning`,size:16}):null,(0,z.jsx)(`span`,{children:o===`summary`?`Loading sandbox`:`Sandbox unavailable`})]})]}),(0,z.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,z.jsx)(`h3`,{children:`Integrations`}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[(0,z.jsx)(`span`,{children:m.length}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh integrations`,"aria-label":`Refresh integrations`,disabled:c!==null||!n,onClick:()=>void _(),children:c===`load`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(T,{size:14})})]})]}),m.length>0?(0,z.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:m.map(e=>(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-row`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,z.jsx)(`span`,{children:U(e.provider)}),(0,z.jsxs)(`small`,{children:[e.required?`required`:`optional`,` / `,Ht(e),` / `,Rt(e)]})]}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Revoke ${U(e.provider)} lease`,"aria-label":`Revoke ${U(e.provider)} lease`,disabled:c!==null,onClick:()=>void ne(e.leaseId),children:c===`remove:${e.leaseId}`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(re,{size:14})}),(0,z.jsxs)(`div`,{className:`sandbox-workspace-chip-row`,children:[e.capabilities.slice(0,5).map(t=>(0,z.jsx)(`span`,{children:Vt(e.provider,t)},t)),e.capabilities.length>5?(0,z.jsxs)(`span`,{children:[`+`,e.capabilities.length-5]}):null]})]},e.leaseId))}):(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No active integration leases.`}),ee.length>0?(0,z.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:ee.map(e=>{let t=m.some(t=>t.provider===e.provider),n=Bt(e)?.leasePolicy.allowedCapabilityIds.length??0;return(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-row compact`,children:[(0,z.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,z.jsx)(`span`,{children:Ut(e)}),(0,z.jsx)(`small`,{children:Wt(e,n)})]}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`${U(e.provider)} already attached`:`Attach ${U(e.provider)}`,"aria-label":t?`${U(e.provider)} already attached`:`Attach ${U(e.provider)}`,disabled:t||c!==null||n===0,onClick:()=>void te(e),children:c===`attach:${e.id}`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(ot,{size:14})})]},e.id)})}):(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No connected accounts available.`})]})]}):(0,z.jsx)(`div`,{className:`sandbox-summary-tab`,children:(0,z.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No sandbox is attached yet.`})})}function Lt(e){return{status:`active`}}function Rt(e){return e.proxyUrl?`runtime proxy available`:`metadata only, no runtime proxy`}function zt(e){return e?.receipts?.at(-1)??null}function Bt(e){let t=D(e.provider);return t?Re(t):null}function U(e){let t=D(e),n=t?Re(t):null;return n?n.label:e===`microsoft_teams`?`Microsoft Teams`:e?e.replace(/_/g,` `):`Integration`}function Vt(e,t){let n=D(e);return(n?Re(n):null)?.capabilities.find(e=>e.id===t)?.label??t}function Ht(e){return e.expiresAt?`expires ${Kt(e.expiresAt)}`:`active`}function Ut(e){let t=e.providerAccountName?.trim();return t?`${U(e.provider)} / ${t}`:U(e.provider)}function Wt(e,t){let n=[];return e.providerWorkspaceName&&n.push(e.providerWorkspaceName),n.push(`${t} lease ${t===1?`capability`:`capabilities`}`),e.scopes.length>0&&n.push(`${e.scopes.length} ${e.scopes.length===1?`scope`:`scopes`}`),n.join(` / `)}function Gt(e){return e.length>10?`${e.slice(0,8)}...`:e}function Kt(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.valueOf())?`-`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(t)}function qt(e){let t=Number(e??0);return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:t>=10?2:4}).format(Number.isFinite(t)?t:0)}function Jt({summary:e}){let t=he(e.taskset),n=e.taskset.learningSignals.demonstrations.filter(e=>e.approved).length,r=e.taskset.tasks.filter(e=>e.split===`frozen_eval`).length,i=e.plan?.recipe.method===`sft`||e.plan?.recipe.method===`grpo`?e.plan.recipe:null,a=C(e.taskset,e.plan),o=e.job?se(e.job.status,e.job.completedAt,e.job.updatedAt):null;return(0,z.jsxs)(`div`,{className:`training-sidebar-summary`,children:[(0,z.jsxs)(`header`,{children:[(0,z.jsx)(`h2`,{children:oe(e.taskset.name,t)}),(0,z.jsx)(`span`,{children:e.job?pe(e.job.status):e.taskset.readiness?.ready?`Ready to train`:`Needs review`})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Run`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Primary recommendation`,value:t.toUpperCase()}),(0,z.jsx)(W,{label:`Training stage`,value:a}),(0,z.jsx)(W,{label:`Base model`,value:i?.baseModel.id??`Not selected`}),(0,z.jsx)(W,{label:`Compute`,value:e.plan?ge(e.plan.destinationId):`Not selected`}),(0,z.jsx)(W,{label:`Started`,value:fe(e.job?.startedAt??null)}),(0,z.jsx)(W,{label:`Duration`,value:me(e.job?.startedAt??null,o)})]})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Data`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Training examples`,value:String(n)}),(0,z.jsx)(W,{label:`Test examples`,value:String(r)}),(0,z.jsx)(W,{label:`Dataset sources`,value:String(e.taskset.sourceRefs.length)})]})]}),i?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Recipe`}),(0,z.jsxs)(`dl`,{children:[i.method===`grpo`?(0,z.jsx)(W,{label:`RL loss`,value:i.loss.method===`gspo-token`?`GSPO-token`:i.loss.method.toUpperCase()}):null,(0,z.jsx)(W,{label:`LoRA rank`,value:String(i.lora.rank)}),(0,z.jsx)(W,{label:`Learning rate`,value:String(i.optimizer.learningRate)}),(0,z.jsx)(W,{label:`Optimizer steps`,value:String(i.optimizer.maxSteps)}),(0,z.jsx)(W,{label:i.method===`grpo`?`Prompt length`:`Sequence length`,value:String(i.method===`grpo`?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{children:`Result`}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(W,{label:`Adapter`,value:e.lineage?`${a} ready`:`Not created`}),(0,z.jsx)(W,{label:`Evaluation`,value:e.lineage?.frozenEvaluationArtifactId?`Completed`:`Not completed`}),(0,z.jsx)(W,{label:`Artifacts`,value:String(e.artifacts.length)})]})]})]})}function W({label:e,value:t}){return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:e}),(0,z.jsx)(`dd`,{children:t})]})}function Yt(e){let t=Xt(``,``,`folder`);for(let n of e){let e=n.endsWith(`/`),r=n.split(`/`).filter(Boolean);if(r.length===0)continue;let i=t,a=``;for(let t=0;t<r.length;t+=1){let n=r[t];a=a?`${a}/${n}`:n;let o=!e&&t===r.length-1?`file`:`folder`,s=`${o}:${n}`,c=i.childMap.get(s);c||(c=Xt(n,a,o),i.childMap.set(s,c),i.children.push(c)),i=c}}return Zt(t.children)}function Xt(e,t,n){return{name:e,path:t,type:n,children:[],childMap:new Map}}function Zt(e){return e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`folder`?-1:1).map(e=>({name:e.name,path:e.path,type:e.type,children:Zt(e.children)}))}function Qt({className:e,currentStatus:t,onSetStatus:n}){let r=t===`pinned`,i=t===`saved_for_later`;return(0,z.jsxs)(`span`,{className:`workspace-file-bookmark-actions ${e??`workspace-file-heading-actions`}`,children:[(0,z.jsx)(`button`,{type:`button`,className:r?`active`:void 0,"data-tooltip":r?`Unpin file`:`Pin file`,"aria-label":r?`Unpin file`:`Pin file`,"aria-pressed":r,onClick:()=>n(r?`none`:`pinned`),children:r?(0,z.jsx)(O,{size:14}):(0,z.jsx)(A,{size:14})}),(0,z.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?(0,z.jsx)(Ge,{size:14}):(0,z.jsx)(He,{size:14})})]})}function $t({changedByPath:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=(0,R.useMemo)(()=>Yt(r),[r]);return(0,z.jsxs)(`div`,{className:`workspace-file-tree-view`,children:[(0,z.jsxs)(`div`,{className:`workspace-file-tree-header`,children:[(0,z.jsx)(w,{size:14}),(0,z.jsx)(`strong`,{title:n??void 0,children:n?n.split(`/`).at(-1):`Files`}),(0,z.jsx)(`span`,{children:r.length})]}),(0,z.jsx)(`div`,{className:`workspace-file-tree`,children:l.map(r=>(0,z.jsx)(G,{changedByPath:e,expandedFolderPaths:t,node:r,rootPath:n,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c},`${r.type}:${r.path}`))})]})}function G({changedByPath:e,depth:t=0,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l}){let u=i?`${i}/${r.path}`:r.path,d=r.type===`folder`&&n.has(u),f=e.get(u),p=2+t*11;return r.type===`folder`?(0,z.jsxs)(`div`,{className:`workspace-file-tree-node`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row folder`,"aria-expanded":d,style:{paddingLeft:p},onClick:()=>l(u),children:[d?(0,z.jsx)(w,{size:14}):(0,z.jsx)(Ke,{size:14}),(0,z.jsx)(`span`,{children:r.name})]}),d&&r.children.map(r=>(0,z.jsx)(G,{changedByPath:e,depth:t+1,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l},`${r.type}:${r.path}`))]}):(0,z.jsxs)(`div`,{className:`workspace-file-tree-row file ${f?`changed`:``} ${a===u?`selected`:``}`,style:{paddingLeft:p},children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row-main`,title:u,onClick:()=>s(u),children:[(0,z.jsx)(b,{size:13}),(0,z.jsx)(`span`,{children:r.name}),f&&(0,z.jsxs)(`small`,{children:[(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,f.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,f.deletions]})]})]}),/\.html?$/i.test(u)&&(0,z.jsx)(`button`,{type:`button`,className:`workspace-file-tree-bookmark-actions`,title:`View source`,"aria-label":`View source for ${r.name}`,onClick:()=>s(u,{source:!0}),children:`</>`}),c?(0,z.jsx)(Qt,{className:`workspace-file-tree-bookmark-actions`,currentStatus:o?.(u)??null,onSetStatus:e=>c(u,e)}):null]})}function en({diff:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=e?.files??[],u=(0,R.useMemo)(()=>new Map(l.map(e=>[e.path,e])),[l]),d=n?.replace(/^\/+|\/+$/g,``)||null,f=(0,R.useMemo)(()=>{if(!d)return r;let e=`${d}/`;return r.filter(t=>t.startsWith(e)).map(t=>t.slice(e.length)).filter(Boolean)},[d,r]);return(0,z.jsx)(`div`,{className:`workspace-diff-files-view`,children:(0,z.jsx)($t,{changedByPath:u,expandedFolderPaths:t,rootPath:d,repoFiles:f,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c})})}function tn({collapsed:e,editorControlsVisible:t,hideWhiteSpace:n,loadFullFiles:r,renderMarkdown:i,wordDiffs:a,wordWrap:o,onClose:s,onCopyGitApply:c,onRefresh:l,onToggleCollapsed:u,onToggleEditorControlsVisible:d,onToggleHideWhiteSpace:f,onToggleLoadFullFiles:p,onToggleRenderMarkdown:m,onToggleWordDiffs:ee,onToggleWordWrap:h}){return(0,z.jsxs)(`div`,{className:`workspace-diff-options-menu`,role:`menu`,children:[(0,z.jsx)(K,{icon:(0,z.jsx)(T,{size:14}),label:`Refresh`,onClick:l,onClose:s}),(0,z.jsx)(K,{checked:o,icon:(0,z.jsx)(ie,{size:14}),label:`Enable word wrap`,onClick:h,onClose:s}),(0,z.jsx)(K,{checked:e,icon:(0,z.jsx)(nt,{size:14}),label:`Collapse all diffs`,onClick:u,onClose:s}),(0,z.jsx)(`div`,{className:`workspace-diff-menu-divider`}),(0,z.jsx)(K,{checked:t,icon:(0,z.jsx)(at,{size:14}),label:`Show editor controls`,onClick:d,onClose:s}),(0,z.jsx)(K,{checked:i,icon:(0,z.jsx)(P,{size:14}),label:`Render Markdown`,onClick:m,onClose:s}),(0,z.jsx)(K,{checked:!r,icon:(0,z.jsx)(Ue,{size:14}),label:`Show diffs first`,onClick:p,onClose:s}),(0,z.jsx)(K,{checked:a,icon:(0,z.jsx)(tt,{size:14}),label:`Enable word diffs`,onClick:ee,onClose:s}),(0,z.jsx)(K,{checked:n,icon:(0,z.jsx)(it,{size:14}),label:`Hide white space`,onClick:f,onClose:s}),(0,z.jsx)(K,{icon:(0,z.jsx)(te,{size:14}),label:`Copy git apply command`,onClick:c,onClose:s})]})}function K({checked:e,icon:t,label:n,onClick:r,onClose:i}){return(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r?.(),i()},children:[t,(0,z.jsx)(`span`,{children:n}),e&&(0,z.jsx)(We,{size:14})]})}function nn({addMenuOpen:e,expanded:t,filteredFiles:n,dirtyFilePaths:r,openFiles:i,goalDetailsAvailable:a,searchOpen:o,searchQuery:s,selectedPath:c,sideChatTabs:l=[],summaryAvailable:u,sourceStatus:d,sourceSwitcher:f,visibleTab:p,toolbarActions:m,additionalTabs:ee,tabOrder:h=[],filesTabOpen:g=!0,onCloseFilesTab:_,overviewTabs:te=[],outputsLabel:ne=`Training`,activeOverviewId:re,onNewOverview:y,onSelectOverview:b,onCloseOverview:x,getFileBookmarkStatus:ie,onCloseFileTab:ae,onCloseSideChat:oe,onCloseSearch:S,onOpenFile:se,onOpenBrowser:C,onOpenSearch:ce,onOpenSideChat:le,onSearchQueryChange:ue,onSetFileBookmarkStatus:de,onSelectFile:fe,onSelectFiles:pe,onSelectOutputs:me,onSelectGoal:he,onSelectSummary:ge,onSelectSideChat:_e,onToggleAddMenu:ve,onToggleExpanded:ye}){let be=(0,R.useRef)(null),Se=(0,R.useRef)(null);(0,R.useEffect)(()=>{Se.current?.querySelector(`button[role="tab"][aria-selected="true"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[re,i.length,c,p]),(0,R.useEffect)(()=>{if(!e&&!o)return;function t(){e&&ve(),o&&S()}function n(e){be.current?.contains(e.target)||t()}function r(e){e.key===`Escape`&&t()}return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r)}},[e,S,ve,o]);function T(e){e.key===`Escape`?S():e.key===`Enter`&&(n[0]||s.trim())&&se(n[0]||s.trim())}function Ee(e){if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLButtonElement)||t.getAttribute(`role`)!==`tab`)return;let n=Array.from(e.currentTarget.querySelectorAll(`button[role="tab"]`)),r=n.indexOf(t);if(r<0||n.length===0)return;e.preventDefault();let i=n[k(r,n.length,e.key)];if(!i)return;i.focus(),i.click();let a=i.id;a&&window.requestAnimationFrame(()=>document.getElementById(a)?.focus())}let E=[...te.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`outputs`&&re===e?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`outputs`&&re===e,tabIndex:p===`outputs`&&re===e?0:-1,onClick:()=>b?.(e),children:[(0,z.jsx)(Ue,{className:`workspace-diff-tab-icon`,size:14}),(0,z.jsx)(`span`,{children:e===-2?`Agents`:e===-1?ne:`New tab`})]}),(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":e===-2?`Close Agents`:e===-1?`Close ${ne}`:`Close new tab`,onClick:()=>x?.(e),children:(0,z.jsx)(De,{size:12})})]},`overview-${e}`)),a?(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`goal`?`active`:``}`,role:`tab`,"aria-selected":p===`goal`,onClick:he,children:[(0,z.jsx)(Ue,{size:14}),(0,z.jsx)(`span`,{children:`Goal`})]},`goal`):null,u&&ge?(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`summary`?`active`:``}`,role:`tab`,"aria-selected":p===`summary`,onClick:ge,children:[(0,z.jsx)(xe,{size:14}),(0,z.jsx)(`span`,{children:`Summary`})]},`summary`):null,g?(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`files`?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":p===`files`,tabIndex:p===`files`?0:-1,onClick:pe,children:[(0,z.jsx)(w,{className:`workspace-diff-tab-icon`,size:14}),(0,z.jsx)(`span`,{children:`Files`})]}),_?(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":`Close files tab`,onClick:_,children:(0,z.jsx)(De,{size:12})}):null]},`files`):null,...i.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`file`&&c===e.path?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`file`&&c===e.path,title:e.path,onClick:()=>fe(e.path),children:[(0,z.jsx)(Ue,{className:`workspace-diff-tab-icon`,size:13}),r.has(e.path)&&(0,z.jsx)(`span`,{className:`workspace-diff-tab-dirty`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{children:I(e.path)})]}),de?(0,z.jsx)(Qt,{className:`workspace-diff-tab-bookmark-actions`,currentStatus:ie?.(e.path)??null,onSetStatus:t=>de(e.path,t)}):null,(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.path}`,onClick:t=>ae(e.path,t),children:(0,z.jsx)(De,{size:12})})]},e.path)),...l.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":!1,tabIndex:-1,title:e.title,onClick:()=>_e?.(e.id),children:[e.running?(0,z.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,z.jsx)(`span`,{children:e.title})]}),oe?(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),oe(e.id)},children:(0,z.jsx)(De,{size:12})}):null]},e.id))].filter(e=>e!==null),Oe=new Map(h.map((e,t)=>[e,t]));return E.sort((e,t)=>(Oe.get(String(e.key))??h.length)-(Oe.get(String(t.key))??h.length)),(0,z.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,ref:Se,onKeyDown:Ee,children:[E,ee]}),(0,z.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:be,children:[(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${!y&&(e||o)?`active`:``}`,title:`Add`,"aria-label":y?`New tab`:`Add to right sidebar`,onClick:y??ve,children:(0,z.jsx)(Te,{size:15})}),e&&(0,z.jsxs)(`div`,{className:`workspace-diff-add-menu`,role:`menu`,children:[me?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:me,children:[(0,z.jsx)(Ue,{size:14}),(0,z.jsx)(`span`,{children:`Training`}),(0,z.jsx)(`kbd`,{})]}):null,le?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:le,children:[(0,z.jsx)(we,{size:14}),(0,z.jsx)(`span`,{children:`New task`}),(0,z.jsx)(`kbd`,{})]}):null,(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:pe,children:[(0,z.jsx)(w,{size:14}),(0,z.jsx)(`span`,{children:`Files`}),(0,z.jsx)(`kbd`,{})]}),u&&ge?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ge,children:[(0,z.jsx)(xe,{size:14}),(0,z.jsx)(`span`,{children:`Summary`}),(0,z.jsx)(`kbd`,{})]}):null,(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ce,children:[(0,z.jsx)(Me,{size:14}),(0,z.jsx)(`span`,{children:`Open file`}),(0,z.jsx)(`kbd`,{children:`Ctrl+P`})]}),C?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:C,children:[(0,z.jsx)(N,{size:14}),(0,z.jsx)(`span`,{children:`Browser`}),(0,z.jsx)(`kbd`,{children:`Ctrl+I`})]}):null]}),o&&(0,z.jsxs)(`div`,{className:`workspace-file-search-popover`,children:[(0,z.jsx)(`input`,{autoFocus:!0,placeholder:`Search files`,value:s,onChange:e=>ue(e.target.value),onKeyDown:T}),(0,z.jsx)(`span`,{children:`Files`}),(0,z.jsx)(`div`,{className:`workspace-file-search-results`,children:n.length===0?(0,z.jsx)(`small`,{children:`Type to search for files`}):n.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>se(e),children:e},e))})]})]}),p!==`outputs`&&(f||d)?(0,z.jsxs)(`div`,{className:`workspace-diff-source-bar`,"aria-label":`Workspace source`,children:[f?(0,z.jsx)(`div`,{className:`workspace-diff-source-toggle`,role:`group`,"aria-label":`File source`,children:f.options.map(e=>(0,z.jsx)(`button`,{type:`button`,className:f.value===e.value?`active`:``,"aria-pressed":f.value===e.value,onClick:()=>f.onChange(e.value),children:e.label},e.value))}):null,d?(0,z.jsx)(`span`,{className:`workspace-diff-source-status ${d.tone}`,children:d.label}):null]}):null,m,(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`Restore files panel`:`Expand files panel`,"aria-label":t?`Restore files panel`:`Expand files panel`,onClick:ye,children:t?(0,z.jsx)(v,{size:14}):(0,z.jsx)(Ce,{size:14})})]})}function rn({inline:e=!1,canCheckActiveFile:t,canSaveActiveFile:n,collapsed:r,editorControlsVisible:i,editorDiagnosticStatus:a,editorDiagnosticsChecking:o,hideWhiteSpace:s,loadFullFiles:c,menuOpen:l,renderMarkdown:u,showEditorCommandBar:d,showRenderMarkdownToggle:f,splitView:p,wordDiffs:m,wordWrap:ee,onCopyGitApply:h,onEditorCheck:g,onEditorRedo:_,onEditorSave:te,onEditorUndo:ne,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleMenu:ie,onToggleRenderMarkdown:ae,onToggleSplitView:oe,onToggleWordDiffs:S,onToggleWordWrap:se}){return(0,z.jsx)(`div`,{className:`workspace-diff-toolbar ${e?`inline`:``}`,children:(0,z.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-menu-anchor`,children:[(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Diff options`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>ie(),children:(0,z.jsx)(j,{size:15})}),l&&(0,z.jsx)(tn,{collapsed:r,editorControlsVisible:i,hideWhiteSpace:s,loadFullFiles:c,renderMarkdown:u,wordDiffs:m,wordWrap:ee,onClose:()=>ie(!1),onCopyGitApply:h,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleRenderMarkdown:ae,onToggleWordDiffs:S,onToggleWordWrap:se})]}),d&&(0,z.jsxs)(`div`,{className:`workspace-editor-command-bar`,"aria-label":`Editor controls`,children:[(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Save file`,"aria-label":`Save file`,disabled:!n,onClick:te,children:(0,z.jsx)(Ee,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Undo`,"aria-label":`Undo`,onClick:ne,children:(0,z.jsx)(ct,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Redo`,"aria-label":`Redo`,onClick:_,children:(0,z.jsx)(st,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Check file`,"aria-label":`Check file`,disabled:!t,onClick:g,children:o?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(Ye,{size:14})}),a&&(0,z.jsxs)(`span`,{className:`workspace-editor-diagnostic-chip ${a.severity}`,children:[a.severity===`error`||a.severity===`warning`||a.severity===`unavailable`?(0,z.jsx)(qe,{size:13}):(0,z.jsx)(Ye,{size:13}),(0,z.jsx)(`span`,{children:a.label})]})]}),f&&(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button ${u?`active`:``}`,title:u?`Show Markdown source`:`Render Markdown`,"aria-label":u?`Show Markdown source`:`Render Markdown`,"aria-pressed":u,onClick:ae,children:(0,z.jsx)(P,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button ${p?`active`:``}`,title:p?`Show unified diff`:`Show split diff`,"aria-label":p?`Show unified diff`:`Show split diff`,"aria-pressed":p,onClick:oe,children:(0,z.jsx)(rt,{size:14})})]})})}var an=class{pending=new Map;cancelled=new Set;receive(e,t){let n=t?.loadId;if(n===void 0)return`open`;let r=this.pending.get(e);return t?.loading?(r!==void 0&&r!==n&&this.cancelled.add(r),this.pending.set(e,n),`open`):this.cancelled.delete(n)||r!==void 0&&r!==n?`ignore`:(this.pending.delete(e),r===void 0?`open`:`complete`)}close(e){let t=this.pending.get(e);t!==void 0&&this.cancelled.add(t),this.pending.delete(e)}retain(e){for(let t of this.pending.keys())e.has(t)||this.close(t)}};function on({connection:e,workspaceId:t,sandboxId:n,file:r,dirty:i,onReload:o}){let s=S(r.path)||t,c=E(),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(!0);(0,R.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let[m,ee]=(0,R.useState)(r.readVersion),g=(0,R.useRef)(null),_=a({queryKey:[`open-file-version`,h(e),n??s,r.path],enabled:!!(e&&(n||s)),queryFn:async()=>{if(!n)return M.workspaceFileVersion(e,s,r.path);let t=r.path.includes(`/`)?r.path.slice(0,r.path.lastIndexOf(`/`))||`/`:`.`,{files:i}=await M.sandboxFiles(e,n,{path:t,recursive:!1}),a=i.find(e=>e.path===r.path||e.path.split(`/`).pop()===r.path.split(`/`).pop());if(!a)return{exists:!1,revision:null};let o=`${a.sizeBytes}:${a.updatedAt}`;if(r.readStamp===o)return{exists:!0,revision:r.readVersion??null};if(g.current?.stamp===o)return{exists:!0,revision:g.current.revision??null};let c=await de(e,n,r.path);return g.current={stamp:o,revision:c.readVersion},{exists:!0,revision:c.readVersion??null}},refetchInterval:5e3,refetchOnWindowFocus:!0}),te=_.refetch;(0,R.useEffect)(()=>{let t=!1;return f(!1),(async()=>{let i=r.contentEncoding===`base64`&&r.content?await ye(r.content):r.readVersion;t||(ee(i),e&&(n||s)&&await te(),t||f(!0))})().catch(()=>{t||f(!0)}),()=>{t=!0}},[te,e,r.content,r.contentEncoding,r.readVersion,n,s]),(0,R.useEffect)(()=>{m===void 0&&!r.content&&_.data&&ee(_.data.revision)},[m,r.content,_.data]);let ne=d&&m!==void 0&&!_.isError&&_.data?.exists&&m!==_.data.revision;async function re(){if(e&&(n||s)&&!l&&(!i||window.confirm(`Discard unsaved edits and refresh this file from disk?`))){u(!0);try{let t=await _.refetch();if(t.error)throw t.error;if(!n&&Le(r.path)){let n=/^(?:[~/\\]|[A-Za-z]:)/.test(r.path)?await M.signLocalImageUrl(e,{path:r.path}):await M.signWorkspaceImageUrl(e,{appId:s,path:r.path}),i=new URL(n.url);if(i.searchParams.set(`refresh`,String(Date.now())),!p.current)return;o({...r,readVersion:t.data?.revision},i.href)}else{let i=n?await de(e,n,r.path):await M.workspaceFile(e,s,r.path);if(!p.current)return;o(i,Le(r.path)&&i.contentEncoding===`base64`&&i.content?`data:image/${/\.jpe?g$/i.test(r.path)?`jpeg`:r.path.split(`.`).pop()};base64,${i.content}`:void 0),ee(i.readVersion??t.data?.revision)}_.refetch()}catch(e){p.current&&c?.(e instanceof Error?e.message:`Could not refresh file.`,`error`)}finally{p.current&&u(!1)}}}return!ne&&!l?null:(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-refresh`,disabled:l||!e||!n&&!s,onClick:()=>void re(),"aria-label":`Reload updated file`,title:ne?`The file changed. Reload to show the latest version.`:`Reload this file from disk`,children:[(0,z.jsx)(T,{size:14,className:l?`spinning`:void 0}),(0,z.jsx)(`span`,{children:l?`Reloading…`:`Reload`})]})}var sn={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 cn(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`?`shell`:t===`readme`||t===`readme.md`?`markdown`:sn[t.includes(`.`)?t.split(`.`).pop()??``:``]??`text`}function ln(e,t){return e?t===`markdown`?un(e):t===`json`?q(e,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):t===`css`?q(e,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):t===`html`?q(e,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):t===`shell`?q(e,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):t===`python`?q(e,/(#.*$|"""[\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):q(e,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\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 un(e){return/^\s{0,3}#{1,6}\s/.test(e)?[{text:e,kind:`keyword`}]:/^\s*[-*+]\s/.test(e)?[{text:e,kind:`property`}]:q(e,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function dn(e){return/^(\/\/|#|\/\*|<!--)/.test(e)?`comment`:/^["'`]/.test(e)?`string`:/^[-]?\d/.test(e)||/^#[\da-fA-F]{3,8}\b/.test(e)?`number`:/^\b[A-Z]/.test(e)?`type`:/^[.#]?[\w-]+$/.test(e)&&e.includes(`-`)?`property`:/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(e)?`operator`:/^(?:--|\$)/.test(e)?`property`:`keyword`}function q(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i.index??0;t>r&&n.push({text:e.slice(r,t),kind:`plain`});let a=i[0];if(n.push({text:a,kind:dn(a)}),r=t+a.length,/^(\/\/|#|<!--)/.test(a))break}return r<e.length&&n.push({text:e.slice(r),kind:`plain`}),n.length>0?n:[{text:e,kind:`plain`}]}function J({language:e,text:t}){return(0,z.jsx)(z.Fragment,{children:ln(t,e).map((e,t)=>(0,z.jsx)(`span`,{className:`syntax-token ${e.kind}`,children:e.text},`${t}-${e.text}`))})}var fn=(0,R.lazy)(()=>i(()=>import(`./FilePagePreview-C6wIp6uX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]))),Y=(0,R.lazy)(()=>i(()=>import(`./WorkspacePdfPreview-CU6PSjjN.js`),__vite__mapDeps([56,1,2,3,46,55])));function X({path:e,contentBase64:t}){let n=I(e),r=(0,R.useMemo)(()=>{try{let n=atob(t.replace(/\s/g,``)),r=Uint8Array.from(n,e=>e.charCodeAt(0));return new Blob([r],{type:pn(e)})}catch{return null}},[t,e]),[i,a]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(!r)return;let e=URL.createObjectURL(r);return a({blob:r,url:e}),()=>URL.revokeObjectURL(e)},[r]);let o=i?.blob===r?i.url:null;return r?o?(0,z.jsxs)(`div`,{className:`workspace-document-preview`,children:[(0,z.jsxs)(`div`,{className:`workspace-document-preview-card`,children:[(0,z.jsx)(L,{path:e}),(0,z.jsxs)(`div`,{className:`workspace-document-preview-actions`,children:[(0,z.jsx)(`span`,{children:/\.pdf$/i.test(e)?`PDF`:`Word`}),(0,z.jsx)(`a`,{href:o,download:n,"aria-label":`Download document`,title:`Download document`,children:(0,z.jsx)(F,{size:16,"aria-hidden":`true`})})]})]}),/\.docx$/i.test(e)?(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,z.jsx)(fn,{thumbnail:!1,file:{path:e,content:t,contentEncoding:`base64`,status:``,additions:0,deletions:0,patch:``}})}):(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,z.jsx)(Y,{contentBase64:t})})]}):(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading document…`}):(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Document preview unavailable.`})}function pn(e){return/\.pdf$/i.test(e)?`application/pdf`:/\.docx$/i.test(e)?`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:`application/msword`}var mn=`
|
|
3
3
|
|
|
4
|
-
[file truncated]`,hn=(0,R.lazy)(()=>i(()=>import(`./WorkspaceMonacoEditor-
|
|
4
|
+
[file truncated]`,hn=(0,R.lazy)(()=>i(()=>import(`./WorkspaceMonacoEditor-BrZs6-EW.js`).then(e=>e.t),__vite__mapDeps([57,1,2,3,58]))),gn=(0,R.lazy)(()=>i(()=>import(`./WorkspacePresentationPreview-IjXVXpIy.js`),__vite__mapDeps([59,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,60,61,62]))),_n=6,vn=18,yn=22,bn=160,xn=12;function Sn({collapsed:e=!1,diagnostics:t=[],draftContent:n,editable:r=!1,editorRef:i,error:a,file:o,hideWhiteSpace:s=!1,headerActions:c,imageSrc:l,loading:u,loadFullFiles:d,onOpenImage:f,onSelectBreadcrumbPath:p,onDraftContentChange:m,onLspAction:ee,onSave:h,renderMarkdown:g,saveError:_,saving:te=!1,splitView:ne=!1,wordDiffs:re=!1,wordWrap:v,workspaceName:y,workspaceRootPath:b}){Oe(a,{prefix:`File preview`}),Oe(_,{prefix:`Save failed`});let x=o.contentEncoding===`base64`?o.content??``:n??o.content??``,ie=(0,R.useMemo)(()=>x.split(`
|
|
5
5
|
`).slice(0,800),[x]),ae=cn(o.path),oe=n!=null||o.content!=null,S=x.endsWith(mn),se=g&&oe&&Ne(o.path),C=Be(o),ce=oe&&(o.contentEncoding===`base64`||Ve(o.path))&&Tn(x);return l?(0,z.jsxs)(`div`,{className:`workspace-file-preview`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(L,{path:o.path,workspaceName:y,workspaceRootPath:b,onSelectPath:p}),(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),c]}),(0,z.jsx)(`div`,{className:`workspace-file-image-stage`,children:(0,z.jsx)(`button`,{type:`button`,className:`workspace-file-image-button`,"aria-label":`Open image preview for ${o.path}`,onClick:f,children:(0,z.jsx)(`img`,{alt:o.path,decoding:`async`,src:l})})})]}):!d&&o.patch||!oe&&o.patch?ne?(0,z.jsx)(wn,{collapsed:e,file:o,hideWhiteSpace:s,onSelectBreadcrumbPath:p,wordDiffs:re,wordWrap:v,headerActions:c,workspaceName:y,workspaceRootPath:b}):(0,z.jsx)(Cn,{collapsed:e,file:o,hideWhiteSpace:s,wordWrap:v,workspaceName:y,workspaceRootPath:b,onSelectBreadcrumbPath:p,headerActions:c}):(0,z.jsxs)(`div`,{className:`workspace-file-preview ${v?`wrap`:``} ${ce?`document-only`:``}`,children:[ce?null:(0,z.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(L,{path:o.path,workspaceName:y,workspaceRootPath:b,onSelectPath:p}),(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),(0,z.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[te?(0,z.jsx)(`span`,{className:`workspace-file-save-state`,children:`Saving`}):null,c]})]}),oe?se?(0,z.jsx)(`div`,{className:`workspace-markdown-preview`,children:(0,z.jsx)(ve,{content:x})}):C&&ce?(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading presentation…`}),children:(0,z.jsx)(gn,{path:o.path,contentBase64:x})}):ce?(0,z.jsx)(X,{path:o.path,contentBase64:x}):r&&!S?(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Loading editor`}),children:(0,z.jsx)(hn,{diagnostics:t,filePath:o.path,onChange:e=>m?.(e),onLspAction:ee,onSave:()=>h?.(),ref:i,value:x,wordWrap:v})}):(0,z.jsx)(`div`,{className:`workspace-file-code`,children:ie.map((e,t)=>(0,z.jsxs)(`div`,{className:`workspace-file-code-row`,children:[(0,z.jsx)(`span`,{children:t+1}),(0,z.jsx)(`code`,{children:(0,z.jsx)(J,{language:ae,text:e||` `})})]},`${t}-${e}`))}):(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:u?`Loading file content…`:`No file content available.`})]})}function Cn({collapsed:e=!1,file:t,hideWhiteSpace:n=!1,wordWrap:r,workspaceName:i,workspaceRootPath:a,onSelectBreadcrumbPath:o,headerActions:s}){let c=(0,R.useMemo)(()=>On(t.patch,n),[t.patch,n]),l=cn(t.path);return(0,z.jsxs)(`div`,{className:`workspace-diff-preview ${r?`wrap`:``}`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(L,{path:t.path,workspaceName:i??null,workspaceRootPath:a,onSelectPath:o}),(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),s]}),e?(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,z.jsx)(En,{ariaLabel:`${t.path} diff`,className:`workspace-diff-code`,emptyMessage:`No patch available.`,rows:c,renderRow:(e,t)=>e.kind===`spacer`?(0,z.jsx)(`div`,{className:`workspace-diff-spacer`,role:`row`,children:e.label},`${e.label}-${t}`):(0,z.jsxs)(`div`,{className:`workspace-diff-code-row ${e.kind}`,role:`row`,children:[(0,z.jsx)(`span`,{className:`workspace-diff-line-number`,role:`cell`,children:e.newLine||e.oldLine}),(0,z.jsx)(`code`,{role:`cell`,children:(0,z.jsx)(J,{language:l,text:e.newContent||e.oldContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:r})]})}function wn({collapsed:e,file:t,hideWhiteSpace:n,wordDiffs:r,wordWrap:i,workspaceName:a,workspaceRootPath:o,onSelectBreadcrumbPath:s,headerActions:c}){let l=(0,R.useMemo)(()=>On(t.patch,n),[t.patch,n]),u=cn(t.path);return(0,z.jsxs)(`div`,{className:`workspace-diff-preview split ${i?`wrap`:``} ${r?`word-diffs`:``}`,children:[(0,z.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(L,{path:t.path,workspaceName:a,workspaceRootPath:o,onSelectPath:s}),(0,z.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,z.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),(0,z.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[c,(0,z.jsx)(be,{size:14})]})]}),e?(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,z.jsx)(En,{ariaLabel:`${t.path} split diff`,className:`workspace-split-code`,emptyMessage:`No patch available.`,rows:l,renderRow:(e,t)=>e.kind===`spacer`?(0,z.jsx)(`div`,{className:`workspace-diff-spacer split`,role:`row`,children:e.label},`${e.label}-${t}`):(0,z.jsxs)(`div`,{className:`workspace-split-row ${e.kind}`,role:`row`,children:[(0,z.jsx)(`span`,{className:`workspace-diff-line-number old`,role:`cell`,children:e.oldLine}),(0,z.jsx)(`code`,{className:`old`,role:`cell`,children:(0,z.jsx)(J,{language:u,text:e.oldContent||` `})}),(0,z.jsx)(`span`,{className:`workspace-diff-line-number new`,role:`cell`,children:e.newLine}),(0,z.jsx)(`code`,{className:`new`,role:`cell`,children:(0,z.jsx)(J,{language:u,text:e.newContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:i})]})}function Tn(e){return e.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(e)}function En({ariaLabel:e,className:t,emptyMessage:n,rows:r,renderRow:i,wordWrap:a}){let o=!a&&r.length>bn,{endIndex:s,offsetTop:c,scrollRef:l,startIndex:u,totalHeight:d}=Dn(r.length,o);return r.length===0?(0,z.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:(0,z.jsx)(`div`,{className:`workspace-diff-code-empty`,children:n})}):o?(0,z.jsx)(`div`,{className:`${t} virtualized`,ref:l,role:`table`,"aria-label":e,"aria-rowcount":r.length,children:(0,z.jsx)(`div`,{className:`workspace-diff-virtual-spacer`,style:{height:d},children:(0,z.jsx)(`div`,{className:`workspace-diff-virtual-window`,style:{transform:`translateY(${c}px)`},children:r.slice(u,s).map((e,t)=>i(e,u+t))})})}):(0,z.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:r.map(i)})}function Dn(e,t){let n=(0,R.useRef)(null),[r,i]=(0,R.useState)({height:968,scrollTop:0}),a=(0,R.useCallback)(()=>{let e=n.current;e&&i({height:e.clientHeight||968,scrollTop:e.scrollTop})},[]);if((0,R.useEffect)(()=>{if(!t)return;let e=n.current;if(!e)return;a();let r=0,i=()=>{typeof window>`u`?a():(window.cancelAnimationFrame(r),r=window.requestAnimationFrame(a))};e.addEventListener(`scroll`,i,{passive:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>i());return o?.observe(e),()=>{e.removeEventListener(`scroll`,i),o?.disconnect(),typeof window<`u`&&window.cancelAnimationFrame(r)}},[t,a]),!t)return{endIndex:e,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:e*yn};let o=Math.ceil(r.height/yn),s=Math.max(0,Math.floor(r.scrollTop/yn)-xn);return{endIndex:Math.min(e,s+o+24),offsetTop:s*yn,scrollRef:n,startIndex:s,totalHeight:e*yn}}function On(e,t){if(!e.trim())return[];let n=[],r=0,i=0,a=null,o=null,s=!1,c=[];function l(){n.push(...kn(c)),c=[]}function u(){s&&=(l(),a=r,o=i,!1)}for(let d of e.split(`
|
|
6
6
|
`)){let e=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(d);if(e){u();let t=Number(e[1]),c=Number(e[2]);if(a!==null&&o!==null){let e=Math.max(t-a,c-o,0);e>0&&n.push({kind:`spacer`,label:An(e)})}r=t,i=c,s=!0;continue}if(d.startsWith(`diff --git`)||d.startsWith(`index `)||d.startsWith(`--- `)||d.startsWith(`+++ `)||!s||d.startsWith(`\\ No newline`))continue;let f=d.slice(1)||` `;if(t&&!f.trim())continue;if(d.startsWith(`+`)){l(),n.push({kind:`addition`,oldLine:``,newLine:String(i||``),oldContent:``,newContent:f}),i+=1;continue}if(d.startsWith(`-`)){l(),n.push({kind:`deletion`,oldLine:String(r||``),newLine:``,oldContent:f,newContent:``}),r+=1;continue}let p=d.startsWith(` `)?d.slice(1)||` `:d||` `;(!t||p.trim())&&(c.push({kind:`context`,oldLine:String(r||``),newLine:String(i||``),oldContent:p,newContent:p}),r+=1,i+=1)}return u(),n}function kn(e){if(e.length<vn)return e;let t=e.length-12;return t<=0?e:[...e.slice(0,_n),{kind:`spacer`,label:An(t)},...e.slice(-6)]}function An(e){return`${e} unmodified ${e===1?`line`:`lines`}`}var jn=`openpond.workspace.editorControlsVisible`;function Mn(){try{return f.getItem(jn)===`true`}catch{return!1}}function Nn(e){try{f.setItem(jn,String(e))}catch{}}function Pn({activeDiagnostics:e,activeServers:t,editorDiagnosticsChecking:n,editorLspEnabled:r,showEditorCommandBar:i}){if(!i)return null;if(!r)return{label:`LSP off`,severity:`unavailable`};if(n)return{label:`Checking`,severity:`info`};let a=e.filter(e=>e.severity===`error`).length;if(a>0)return{label:`${a} error${a===1?``:`s`}`,severity:`error`};let o=e.filter(e=>e.severity===`warning`).length;if(o>0)return{label:`${o} warning${o===1?``:`s`}`,severity:`warning`};let s=e.length;if(s>0)return{label:`${s} note${s===1?``:`s`}`,severity:`info`};if(!t)return null;let c=t.find(e=>e.status!==`connected`);return c?{label:c.id===`none`?`No LSP`:`${c.id} unavailable`,severity:`unavailable`}:{label:`No issues`,severity:`none`}}var Fn=t({WorkspaceDiffPanel:()=>Bn}),In=3e3,Ln=2e3,Rn=[],zn=[];function Bn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:p=!1,openFileRequest:m,readOnly:ee=!1,sideChatTabs:h,sourceSwitcher:g,tabRequest:_,renderOutputs:te,outputsLabel:ne,additionalTabs:re,viewState:v,onRefresh:y,onResizeStart:b,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:se,onSelectSideChat:C,goalDetails:ce,sandboxFileSource:le,trainingSummary:ue,sidebarFileBookmarks:de=[],sidebarFileSourceSessionId:fe=null,onSetSidebarFileStatus:pe}){return(0,z.jsx)(Kn,{appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i??[],diff:a,editorPreferences:o??null,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f??null,filesWithPreview:p,openFileRequest:m,readOnly:ee,sideChatTabs:h??[],sourceSwitcher:g??null,tabRequest:_??null,additionalTabs:re,renderOutputs:te??null,outputsLabel:ne,viewState:v??null,onRefresh:y,onResizeStart:b,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:se,onSelectSideChat:C,goalDetails:ce??null,sandboxFileSource:le??null,trainingSummary:ue??null,sidebarFileBookmarks:de,sidebarFileSourceSessionId:fe,onSetSidebarFileStatus:pe})}function Vn(e,t,n,r){return e&&t?.content!=null?{...e,content:t.content,contentType:t.contentType,contentEncoding:t.contentEncoding,readVersion:t.readVersion,readStamp:t.readStamp}:t&&!e&&Hn(t)?t:e&&Hn(e)?e:t&&Hn(t)?t:e??t??n??Je(r)}function Hn(e){return!!(e.patch||e.content!=null)}function Un({changedFiles:e,checkpointStatus:t,dirty:n,error:r,loading:i,preservedReadback:a,sandboxMode:o,sourcePending:s}){if(s)return{label:`sandbox pending`,tone:`loading`};if(i)return{label:`refreshing`,tone:`loading`};if(o&&a&&t)return t;if(r)return{label:`status unavailable`,tone:`error`};if(o&&t?.tone===`error`||o&&t&&!n&&e===0)return t;if(n||e>0){let t=Math.max(1,e),n=t===1?`change`:`changes`;return{label:o?`${t} unpreserved ${n}`:`${t} local ${n}`,tone:`dirty`}}return{label:o?`sandbox clean`:`local clean`,tone:`clean`}}function Wn(e,t){if(!t)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(r?.name!==`workspace_action_result`)continue;let i=r.data&&typeof r.data==`object`&&!Array.isArray(r.data)?r.data:null,a=i?.sourcePreservation&&typeof i.sourcePreservation==`object`&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(a?.attempted===!0&&a.sandboxId===t)return a.ok===!0?a.preserved===!0?{label:`checkpoint saved`,tone:`clean`}:{label:`checkpoint clean`,tone:`clean`}:{label:`checkpoint failed`,tone:`error`}}return null}function Gn(e){let t=e.split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function Kn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:m,openFileRequest:h,readOnly:g,sideChatTabs:te,sourceSwitcher:re,tabRequest:v,renderOutputs:b,outputsLabel:ie,additionalTabs:oe,viewState:se,onRefresh:C,onResizeStart:fe,onToggleExpanded:pe,onOpenBrowser:me,onOpenBrowserUrl:he,onViewStateChange:ge,onCloseSideChat:ve,onOpenSideChat:ye,onSelectSideChat:be,goalDetails:w,sandboxFileSource:xe,trainingSummary:Se,sidebarFileBookmarks:Ce,sidebarFileSourceSessionId:we,onSetSidebarFileStatus:Te}){let T=se??ze(),[Ee,De]=(0,R.useState)(!b||v?.tab===`files`||T.filesTabOpen),[E,D]=(0,R.useState)(T.overviewTabs),[Me,O]=(0,R.useState)(T.activeOverviewId),Re=(0,R.useRef)(Math.max(0,...T.overviewTabs)+1),[Be,k]=(0,R.useState)(T.tabOrder),[A,j]=(0,R.useState)(v?.tab??T.activeTab),[He,Ue]=(0,R.useState)(!1),[We,N]=(0,R.useState)(!1),[Ge,P]=(0,R.useState)(!1),[Ke,qe]=(0,R.useState)(``),[F,Ye]=(0,R.useState)(()=>[...T.openFilePaths]),[I,L]=(0,R.useState)(T.selectedPath),[Xe,Ze]=(0,R.useState)(!1),[Qe,tt]=(0,R.useState)(!1),[nt,rt]=(0,R.useState)(!1),[it,at]=(0,R.useState)(!0),[ot,st]=(0,R.useState)(Mn);p(()=>st(Mn()));let[ct,ut]=(0,R.useState)(!1),[dt,ft]=(0,R.useState)(!1),[pt,mt]=(0,R.useState)(!1),[B,ht]=(0,R.useState)({}),gt=(0,R.useRef)(new an),[_t,vt]=(0,R.useState)({}),[yt,bt]=(0,R.useState)(()=>new Set),[xt,St]=(0,R.useState)({}),[Ct,wt]=(0,R.useState)({}),[Tt,Et]=(0,R.useState)(()=>new Set),[Dt,Ot]=(0,R.useState)(null),[kt,At]=(0,R.useState)(!1),[V,jt]=(0,R.useState)(null),[Mt,Nt]=(0,R.useState)({}),[Pt,H]=(0,R.useState)({}),[Ft,Lt]=(0,R.useState)(null),[Rt,zt]=(0,R.useState)(null),[Bt,U]=(0,R.useState)(null),[Vt,Ht]=(0,R.useState)(null);Oe(u,{prefix:`Workspace`}),Oe(V,{prefix:`Sandbox files`});let[Ut,Wt]=(0,R.useState)(null),[Gt,Kt]=(0,R.useState)({}),[qt,W]=(0,R.useState)(null),[Yt,Xt]=(0,R.useState)(null),[Zt,$t]=(0,R.useState)(null),G=o??ee.editor,tn=(0,R.useRef)(B),K=(0,R.useRef)(Ie(T)),sn=(0,R.useRef)(Ie(T)),cn=(0,R.useRef)(null),ln=(0,R.useRef)(C),un=(0,R.useRef)(!1),dn=(0,R.useRef)(null),q=(0,R.useRef)(0),J=(0,R.useRef)(null),fn=(0,R.useRef)(null),Y=xe?.sandboxId?.trim()||null,X=!!xe,pn=!!Se||X&&!!Y,mn=X?`sandbox:${Y??`pending`}`:`workspace:${e??`none`}`,hn=X?!!Y:!!(e||r&&h&&S(h.path)),gn=(0,R.useRef)(mn),_n=!!(w?.createRuntime||w?.goalRuntime||w?.subagentRuntime),vn=(0,R.useCallback)(async(e={})=>{if(X){if(!r)Ot(null),jt(`OpenPond App server is not connected.`);else if(!Y)Ot(null),jt(null);else{e.silent||At(!0);try{let[e,t,n]=await Promise.allSettled([M.sandboxFiles(r,Y,{recursive:!0,maxEntries:Ln}),M.sandboxGitStatus(r,Y),M.sandboxGitDiff(r,Y,{})]);if(e.status===`rejected`)throw e.reason;let i=ce(e.value.files),a=t.status===`fulfilled`?t.value.status:null,o=n.status===`fulfilled`?n.value.diff:null,s=le(o,a),c=s.reduce((e,t)=>e+t.additions,0),l=s.reduce((e,t)=>e+t.deletions,0);Ot({appId:Y,repoPath:``,initialized:!0,dirty:a?!a.clean:s.length>0,filesChanged:s.length,additions:c,deletions:l,repoFiles:i,files:s,error:null,updatedAt:new Date().toISOString()}),jt(null)}catch(e){Ot(null),jt(e instanceof Error?e.message:String(e))}finally{e.silent||At(!1)}}}},[r,Y,X]),yn=(0,R.useMemo)(()=>ae(i,Y),[i,Y]),bn=!!(Dt&&((Dt.files?.length??0)>0||(Dt.repoFiles?.length??0)>0)),xn=X&&!bn&&!!yn,Cn=X?bn?Dt:yn??Dt:a,wn=Cn?.repoPath??null,Tn=(0,R.useMemo)(()=>Wn(i,Y),[i,Y]),En=Cn?.files??Rn,Dn=Cn?.files??Rn,On=(0,R.useMemo)(()=>new Map(Dn.map(e=>[e.path,e])),[Dn]),kn=(0,R.useMemo)(()=>new Map(En.map(e=>[e.path,e])),[En]),An=Cn?.repoFiles??(En.length>0?En.map(e=>e.path):zn),jn=(0,R.useMemo)(()=>En.filter(e=>!ke(e,An)),[An,En]),Fn=(0,R.useMemo)(()=>Zt&&!An.includes(Zt)?[Zt,...An]:An,[An,Zt]),Bn=(0,R.useMemo)(()=>F.map(e=>On.get(e)??B[e]??kn.get(e)??Je(e)),[On,kn,B,F]),Hn=(0,R.useMemo)(()=>{let e={};for(let t of F){if(Le(t)||Ve(t))continue;let n=Vn(On.get(t),B[t],kn.get(t),t);n.content!=null&&n.contentEncoding!==`base64`&&(e[t]=n.content)}return e},[On,kn,B,F]),Kn=(0,R.useMemo)(()=>{let e=new Set;for(let[t,n]of Object.entries(Ct))n.content!==n.savedContent&&e.add(t);return e},[Ct]),qn=(0,R.useMemo)(()=>{let e=Ke.trim().toLowerCase(),t=Fn;return e?t.filter(t=>t.toLowerCase().includes(e)):t},[Fn,Ke]),Jn=(0,R.useMemo)(()=>({activeTab:A,openFilePaths:F,selectedPath:I,filesTabOpen:Ee,overviewTabs:E,activeOverviewId:Me,tabOrder:Be}),[A,F,I,Ee,E,Me,Be]);(0,R.useEffect)(()=>{tn.current=B},[B]),(0,R.useEffect)(()=>{dn.current=qt},[qt]),(0,R.useEffect)(()=>{wt(e=>{let t=!1,n={...e},r=new Set(F),i=a?.updatedAt?Date.parse(a.updatedAt):null;for(let[e,i]of Object.entries(n))r.has(e)||i.content!==i.savedContent||(delete n[e],t=!0);for(let[e,r]of Object.entries(Hn)){let a=n[e];if(!a)n[e]={content:r,savedContent:r},t=!0;else if(a.content===a.savedContent&&a.savedContent!==r){if(a.savedAt&&(i===null||i<a.savedAt))continue;n[e]={content:r,savedContent:r},t=!0}}return t?n:e})},[a?.updatedAt,Hn,F]),(0,R.useEffect)(()=>{ln.current=C},[C]),(0,R.useEffect)(()=>{if(!se)return;let e=je(se,wn);yt.size>0?K.current=e:Pe(K.current,e)||(K.current=e,sn.current=e,j(t=>v?.tab===`outputs`&&t===`outputs`?t:e.activeTab),Ye(e.openFilePaths),L(e.selectedPath),De(!b||e.filesTabOpen),D(e.overviewTabs),O(e.activeOverviewId),k(e.tabOrder),Re.current=Math.max(0,...e.overviewTabs)+1)},[se,wn,v?.tab,yt]),(0,R.useEffect)(()=>{if(yt.size>0||Pe(sn.current,Jn))return;let e=Ie(Jn);sn.current=e,K.current=e,ge?.(e)},[Jn,ge,yt]),(0,R.useEffect)(()=>{g||X||!r||!e||!l||a||u||un.current||(un.current=!0,Promise.resolve(ln.current({silent:!0})).catch(()=>{}).finally(()=>{un.current=!1}))},[e,r,a,g,X,u,l]),(0,R.useEffect)(()=>{if(gn.current!==mn){gn.current=mn,J.current?.abort(Error(`lsp_diagnostics_source_changed`)),J.current=null;let e=new Set([...yt].filter(e=>S(e)&&_t[e]===null));Ye(t=>t.filter(t=>e.has(t))),L(t=>t&&e.has(t)?t:null),ht(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),bt(e),vt(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),gt.current.retain(e),St(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),wt({}),Et(new Set),Ot(null),jt(null),At(!1),Nt({}),H({}),Lt(null),zt(t=>t&&e.has(t)?t:null),Ht(null),Wt(null),Kt({}),W(null),Xt(null),$t(null)}return()=>{J.current?.abort(Error(`lsp_diagnostics_unmounted`)),J.current=null}},[mn]),(0,R.useEffect)(()=>{h&&cn.current!==h.id&&(h.file||hn)&&(cn.current=h.id,h.file?Qn(h.file,h.imageUrl,h.source,h):Zn(h.path,{source:h.source}))},[hn,h]),(0,R.useEffect)(()=>{if(!X||(vn(),!r||!Y))return;let e=!1;async function t(){if(!(e||un.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){un.current=!0;try{await vn({silent:!0})}finally{un.current=!1}}}let n=window.setInterval(()=>{t()},In),i=()=>{t()};return window.addEventListener(`focus`,i),()=>{e=!0,window.clearInterval(n),window.removeEventListener(`focus`,i)}},[r,vn,Y,X]),(0,R.useEffect)(()=>{if(g||X||!r||!e||!l)return;let t=!1;async function n(){if(!(t||un.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){un.current=!0;try{await ln.current({silent:!0})}catch{}finally{un.current=!1}}}let i=window.setInterval(()=>{n()},In),a=()=>{n()};return window.addEventListener(`focus`,a),()=>{t=!0,window.clearInterval(i),window.removeEventListener(`focus`,a)}},[e,r,g,X,l]),(0,R.useEffect)(()=>{if(X||!r||!e||n===`local_project`){$t(null);return}let t=!1;return M.workspaceTemplateConfig(r,e).then(e=>{t||$t(e.exists?e.configPath??`openpond.config.json`:null)}).catch(()=>{t||$t(null)}),()=>{t=!0}},[e,r,X,n]),(0,R.useEffect)(()=>{!I||Fn.includes(I)||F.includes(I)||L(jn[0]?.path??null)},[jn,F,Fn,I]),(0,R.useEffect)(()=>{w?.active&&_n&&j(`goal`)},[w?.active,_n]),(0,R.useEffect)(()=>{if(v){if(v.tab===`files`&&hr(),v.tab===`outputs`){if(v.overview===`agents`)D(e=>e.includes(-2)?e:[...e,-2]),O(-2),k(e=>e.includes(`overview--2`)?e:[...e,`overview--2`]);else if(v.overview===`experiments`)D(e=>e.includes(-1)?e:[...e,-1]),O(-1),k(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]);else if(v.overview===`new`){let e=E.find(e=>e>=0)??Re.current++;D(t=>t.includes(e)?t:[...t,e]),O(e),k(t=>t.includes(`overview-${e}`)?t:[...t,`overview-${e}`])}}j(v.tab)}},[v]),(0,R.useEffect)(()=>{!_n&&A===`goal`&&j(`files`)},[A,_n]),(0,R.useEffect)(()=>{!pn&&A===`summary`&&j(`files`)},[A,pn]);let Z=A===`file`||m&&A===`files`?I:null;(0,R.useEffect)(()=>{if(!r||!Z||yt.has(Z))return;if(Le(Z)){Ht(null),zt(e=>e===Z?null:e);return}let t=Ut?.path===Z,n=er(Z);if(g&&(n?.content!=null||n?.patch)||!t&&(n?.content!=null||n?.patch&&!nt)){Ht(null),zt(e=>e===Z?null:e);return}let a=!1,o=tn.current[Z];o?.content==null&&(nt||!o?.patch)&&zt(Z),Ht(null);let s=e||S(Z);return(X?Y?de(r,Y,Z,i):Promise.reject(Error(xe?.emptyMessage??`No sandbox filesystem is available.`)):s?M.workspaceFile(r,s,Z):Promise.reject(Error(`Workspace files are unavailable.`))).then(e=>{a||ht(t=>{let n=t[e.path];return n?.content===e.content&&n.contentType===e.contentType&&n.contentEncoding===e.contentEncoding&&n.patch===e.patch&&n.status===e.status?t:{...t,[e.path]:e}})}).catch(e=>{a||Ht(e instanceof Error?e.message:String(e))}).finally(()=>{a||(zt(e=>e===Z?null:e),Wt(e=>e&&e.id===Ut?.id&&e.path===Z?null:e))}),()=>{a=!0}},[A,e,r,Ut,nt,g,i,xe?.emptyMessage,Y,X,Z,yt]);function Yn(e){let t=A===`outputs`||b&&A===`files`&&!Ee?`overview-${Me}`:null;t&&D(e=>e.filter(e=>e!==Me)),k(n=>n.includes(e)?t?n.filter(e=>e!==t):n:t&&n.includes(t)?n.map(n=>n===t?e:n):[...n,e])}function Xn(){if(E.some(e=>e>=0))O(E.filter(e=>e>=0).at(-1));else{let e=Re.current++;D([e]),O(e),k(t=>[...t,`overview-${e}`])}j(`outputs`)}function Zn(t,n){U(null);let i=X?Y:e;if(y(t)&&!n?.source&&r&&i){ue(r,i,t,X?`sandbox`:`local`).then(he).catch(e=>U(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=Fe(t,wn);a&&(gt.current.close(a),vt(e=>{if(!Object.hasOwn(e,a))return e;let t={...e};return delete t[a],t}),Yn(m?`files`:a),m&&De(!0),bt(e=>{if(!e.has(a))return e;let t=new Set(e);return t.delete(a),t}),ht(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),St(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),Wt({id:Date.now(),path:a}),m||Ye(e=>e.includes(a)?e:[...e,a]),L(a),j(m?`files`:`file`),!X&&r&&e&&Le(a)&&Xt(a),N(!1),P(!1),qe(``))}function Qn(e,t,n=!1,i){if(y(e.path)&&e.content!=null&&!n&&r){_(r,e.path,e.content).then(he).catch(e=>U(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=S(e.path)?e.path:Fe(e.path,wn);if(!a)return;let o=gt.current.receive(a,i);if(o===`ignore`)return;let s=o===`complete`;if(s&&!m&&!F.includes(a))return;s||(Yn(m?`files`:a),m&&De(!0)),i?.sandboxId!==void 0&&vt(e=>({...e,[a]:i.sandboxId}));let c={...e,path:a};ht(e=>i?.loading&&e[a]?.content!=null?e:{...e,[a]:c}),bt(e=>{let t=new Set(e);return t.add(a),t}),St(e=>{if(!t){if(!(a in e))return e;let t={...e};return delete t[a],t}return e[a]===t?e:{...e,[a]:t}}),s?(I===a&&Ht(i?.error??null),zt(e=>e===a?null:e)):(Wt(null),Ht(i?.error??null),zt(i?.loading?a:null),m||Ye(e=>e.includes(a)?e:[...e,a]),L(a),j(m?`files`:`file`),N(!1),P(!1),qe(``))}let $n=(0,R.useCallback)(()=>{st(e=>{let t=!e;return Nn(t),t})},[]),er=e=>Vn(On.get(e),B[e],kn.get(e),e),tr=(0,R.useCallback)((e,t)=>{wt(n=>{let r=n[e],i=r?.savedContent??Hn[e]??er(e).content??``;return{...n,[e]:{content:t,savedContent:i,savedAt:r?.savedAt}}}),Kt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},[On,kn,B,Hn]),nr=(0,R.useCallback)(async(t,n={})=>{if(X||!r||!e||Le(t))return;let i=er(t),a=n.content??Ct[t]?.content??i.content??void 0;if(a?.endsWith(`
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-LXNhSUEL.js";import{a as r,d as i,g as a,m as o,o as s,p as c,r as l,v as u,x as d}from"./schemas-C9IwV7NS.js";import"./icons-CZxmQtZs.js";import{t as f}from"./createLucideIcon-Bv-_eGcE.js";import{t as p}from"./chevron-down-DEbd6Ek-.js";import{t as m}from"./external-link-CVXsNeO3.js";import{t as h}from"./git-commit-horizontal-Bm4rkXug.js";import{t as g}from"./info-DYPIbKKD.js";import{t as _}from"./monitor-B35XSAvn.js";import{t as v}from"./play-DzqLr7fM.js";import{t as y}from"./refresh-cw-D45mW-vs.js";import{t as b}from"./square-Dqduqyyu.js";import{t as x}from"./square-terminal-DS3zwi6X.js";import{t as S}from"./upload-ABSJxuUM.js";import{t as C}from"./x-B-_zJVOZ.js";import{r as w}from"./AppToastContext-D2788RqX.js";import{r as T}from"./organization-types-PP-yuR2J.js";import{n as E}from"./ui-theme.generated-D-mc26qt.js";import{Gt as D,Ut as ee,Xt as te,a as O,bn as k,dn as ne,gt as A,mn as j,nn as M,o as N,on as P,rn as F,tn as re,un as ie,yn as ae}from"./App-DmEA-Lia.js";var I={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},oe;oe||={};function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var L={},R={},z={},B;function V(){if(B)return z;B=1;function e(e){return e==null}function t(e){return typeof e==`object`&&!!e}function n(t){return Array.isArray(t)?t:e(t)?[]:[t]}function r(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function i(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function a(e){return e===0&&1/e==-1/0}return z.isNothing=e,z.isObject=t,z.toArray=n,z.repeat=i,z.isNegativeZero=a,z.extend=r,z}var ce,H;function U(){if(H)return ce;H=1;function e(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
2
2
|
|
|
3
3
|
`+e.mark.snippet),r+` `+n):r}function t(t,n){Error.call(this),this.name=`YAMLException`,this.reason=t,this.mark=n,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(t){return this.name+`: `+e(this,t)},ce=t,ce}var W,le;function ue(){if(le)return W;le=1;let e=V();function t(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function n(t,n){return e.repeat(` `,n-t.length)+t}function r(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!=`number`&&(i.indent=1),typeof i.linesBefore!=`number`&&(i.linesBefore=3),typeof i.linesAfter!=`number`&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;for(;c=a.exec(r.buffer);)s.push(c.index),o.push(c.index+c[0].length),r.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);let u=``,d=Math.min(r.line+i.linesAfter,s.length).toString().length,f=i.maxLength-(i.indent+d+3);for(let a=1;a<=i.linesBefore&&!(l-a<0);a++){let c=t(r.buffer,o[l-a],s[l-a],r.position-(o[l]-o[l-a]),f);u=e.repeat(` `,i.indent)+n((r.line-a+1).toString(),d)+` | `+c.str+`
|
|
4
4
|
`+u}let p=t(r.buffer,o[l],s[l],r.position,f);u+=e.repeat(` `,i.indent)+n((r.line+1).toString(),d)+` | `+p.str+`
|
package/dist/web/assets/{WorkspaceFileLocation-1U8DDj1J.js → WorkspaceFileLocation-D-ctFM4d.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./index-
|
|
1
|
+
import{m as e}from"./index-LXNhSUEL.js";import"./icons-CZxmQtZs.js";import{t}from"./chevron-right-DLYNg_Oq.js";import{K as n,z as r}from"./App-DmEA-Lia.js";var i=e();function a(e){return(e.replace(/\\/g,`/`).split(`/`).pop()||`File`).replace(/^\d{3}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-/i,``)}function o({path:e,workspaceName:o=null,workspaceRootPath:c,onSelectPath:l}){let u=n(e,c),d=r(u),f=d?s(u):o?.trim()||`Workspace`,p=(d&&f!==`/`&&u.startsWith(`${f}/`)?u.slice(f.length+1):u).split(`/`).filter(Boolean),m=!(!l||d);return(0,i.jsxs)(`details`,{className:`workspace-file-location`,children:[(0,i.jsx)(`summary`,{title:e,"aria-label":`File path: ${a(e)}`,children:a(e)}),(0,i.jsxs)(`div`,{className:`workspace-file-path-popover`,children:[(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumbs`,children:[l&&!d?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(null),children:f}):(0,i.jsx)(`span`,{children:f}),p.map((e,n)=>{let r=n===p.length-1,a=p.slice(0,n+1).join(`/`);return(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumb-segment`,children:[(0,i.jsx)(t,{size:13}),l&&m&&!r?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(a),children:e}):(0,i.jsx)(`span`,{children:e})]},`${n}-${e}`)})]}),(0,i.jsx)(`code`,{children:e})]})]},e)}function s(e){let t=/^[A-Za-z]:\//.exec(e);return t?t[0].slice(0,-1):`/`}export{a as n,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./index-
|
|
1
|
+
import{m as e}from"./index-LXNhSUEL.js";import"./icons-CZxmQtZs.js";import{t}from"./cloud-upload-CoM1FGeB.js";import{t as n}from"./git-commit-horizontal-Bm4rkXug.js";import{t as r}from"./upload-ABSJxuUM.js";import{t as i}from"./x-B-_zJVOZ.js";import{nn as a,tn as o}from"./App-DmEA-Lia.js";var s=e();function c({open:e,branch:i,filesChanged:c,additions:l,deletions:f,message:p,includeUnstaged:m,nextStep:h,draft:g,busy:_,canPush:v,canPublish:y,onMessageChange:b,onIncludeUnstagedChange:x,onNextStepChange:S,onDraftChange:C,onClose:w,onSubmit:T}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog commit-dialog`,"aria-label":`Commit changes`,onSubmit:e=>{e.preventDefault(),T()},children:[(0,s.jsx)(d,{disabled:_,onClose:w}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(n,{size:18})}),(0,s.jsx)(`h2`,{children:`Commit your changes`}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Branch`}),(0,s.jsxs)(`strong`,{children:[(0,s.jsx)(a,{size:14}),i??`No branch`]})]}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Changes`}),(0,s.jsxs)(`strong`,{children:[c,` `,c===1?`file`:`files`,(0,s.jsxs)(`span`,{className:`git-dialog-additions`,children:[`+`,l]}),(0,s.jsxs)(`span`,{className:`git-dialog-deletions`,children:[`-`,f]})]})]}),(0,s.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,s.jsx)(`input`,{checked:m,disabled:_,type:`checkbox`,onChange:e=>x(e.target.checked)}),(0,s.jsx)(`span`,{}),`Include unstaged`]}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Commit message`,(0,s.jsx)(`small`,{children:`Leave blank to use an autogenerated message`})]}),(0,s.jsx)(`textarea`,{value:p,disabled:_,placeholder:`Update workspace`,onChange:e=>b(e.target.value)})]}),(0,s.jsxs)(`fieldset`,{className:`git-dialog-next`,children:[(0,s.jsx)(`legend`,{children:`Next steps`}),(0,s.jsx)(u,{active:h===`commit`,icon:(0,s.jsx)(n,{size:14}),label:`Commit`,disabled:_,onSelect:()=>S(`commit`)}),(0,s.jsx)(u,{active:h===`commit_push`,icon:(0,s.jsx)(r,{size:14}),label:`Commit & push`,disabled:_||!v,onSelect:()=>S(`commit_push`)}),y&&(0,s.jsx)(u,{active:h===`commit_publish`,icon:(0,s.jsx)(t,{size:14}),label:`Commit & publish`,disabled:_,onSelect:()=>S(`commit_publish`)}),(0,s.jsx)(u,{active:h===`commit_pr`,icon:(0,s.jsx)(o,{size:14}),label:`Commit & create PR`,disabled:!0,onSelect:()=>S(`commit_pr`)})]}),(0,s.jsxs)(`div`,{className:`git-dialog-footer`,children:[(0,s.jsxs)(`label`,{className:`git-dialog-toggle draft-toggle`,children:[(0,s.jsx)(`input`,{checked:g,disabled:_||h!==`commit_pr`,type:`checkbox`,onChange:e=>C(e.target.checked)}),(0,s.jsx)(`span`,{}),`Draft`]}),(0,s.jsx)(`button`,{className:`git-dialog-primary`,disabled:_||c===0,type:`submit`,children:`Continue`})]})]})}):null}function l({open:e,branchName:t,busy:n,onBranchNameChange:r,onSetPrefix:i,onClose:o,onSubmit:c}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog branch-dialog`,"aria-label":`Create branch`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,s.jsx)(d,{disabled:n,onClose:o}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(a,{size:18})}),(0,s.jsx)(`h2`,{children:`Work here`}),(0,s.jsx)(`p`,{children:`Create a branch to commit changes, push, and create a PR from this worktree.`}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Branch name`,(0,s.jsx)(`button`,{className:`git-dialog-inline-action`,disabled:n,type:`button`,onClick:i,children:`Set prefix`})]}),(0,s.jsx)(`input`,{autoFocus:!0,disabled:n,value:t,onChange:e=>r(e.target.value)})]}),(0,s.jsx)(`button`,{className:`git-dialog-primary full`,disabled:n||!t.trim(),type:`submit`,children:`Create`})]})}):null}function u({active:e,icon:t,label:n,disabled:r,onSelect:i}){return(0,s.jsxs)(`button`,{"aria-pressed":e,className:e?`active`:``,disabled:r,type:`button`,onClick:i,children:[t,(0,s.jsx)(`span`,{children:n}),e&&(0,s.jsx)(`span`,{className:`git-dialog-check`,children:`✓`})]})}function d({disabled:e,onClose:t}){return(0,s.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,onClick:t,children:(0,s.jsx)(i,{size:16})})}export{l as BranchDialog,c as CommitDialog};
|