openpond 0.2.62 → 0.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/app-server.d.ts +1053 -63
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-DYRBDJRU.js → acp-H3MJCPHX.js} +1 -1
- package/dist/chunks/{acp-agent-UTLP7C3I.js → acp-agent-DWA7272M.js} +1 -1
- package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
- package/dist/chunks/{app-layer-N2H3RBEN.js → app-layer-K7H2WJ56.js} +1 -1
- package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
- package/dist/chunks/app-server-evaluations-XGMGS67X.js +2 -0
- package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
- package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
- package/dist/chunks/apps-QKAHJGQ4.js +2 -0
- package/dist/chunks/chunk-25XXZS3E.js +2 -0
- package/dist/chunks/chunk-27JGS3KB.js +12 -0
- package/dist/chunks/{chunk-7JBB4PXS.js → chunk-2HAWOMZK.js} +1 -1
- package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
- package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
- package/dist/chunks/{chunk-GEKORCMN.js → chunk-42V4NV2F.js} +1 -1
- package/dist/chunks/{chunk-VAJSRUAB.js → chunk-4FNCBA3Y.js} +1 -1
- package/dist/chunks/{chunk-F7D4BMTO.js → chunk-4L6DU6Z2.js} +1 -1
- package/dist/chunks/{chunk-SZKFNKWO.js → chunk-4SZ3HKHU.js} +1 -1
- package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
- package/dist/chunks/chunk-5FU5RLML.js +2 -0
- package/dist/chunks/{chunk-6SH4B7DV.js → chunk-5MHYGMJG.js} +1 -1
- package/dist/chunks/{chunk-MEK7DLX3.js → chunk-6EBCS57F.js} +1 -1
- package/dist/chunks/chunk-6RS4NAOY.js +2 -0
- package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
- package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
- package/dist/chunks/{chunk-P74RR2GB.js → chunk-7WYL2IDD.js} +1 -1
- package/dist/chunks/chunk-7YLXGILH.js +2 -0
- package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
- package/dist/chunks/{chunk-NWOK6NLE.js → chunk-AH26AQN7.js} +1 -1
- package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
- package/dist/chunks/chunk-B5R53U74.js +2 -0
- package/dist/chunks/{chunk-NKZNPTLA.js → chunk-BPZOABMC.js} +1 -1
- package/dist/chunks/{chunk-2IIBCCOK.js → chunk-BSPFY3Y5.js} +1 -1
- package/dist/chunks/{chunk-5OSM75X5.js → chunk-BU27SLZP.js} +2 -2
- package/dist/chunks/chunk-C2AXMKK4.js +2 -0
- package/dist/chunks/{chunk-AMO5DVKM.js → chunk-C2LAEGOW.js} +2 -2
- package/dist/chunks/{chunk-GNCEZ3UP.js → chunk-CZ5R4JXZ.js} +1 -1
- package/dist/chunks/{chunk-JIFUGA3U.js → chunk-DABBHWSF.js} +1 -1
- package/dist/chunks/{chunk-VK4TPZTA.js → chunk-DLANLLKH.js} +1 -1
- package/dist/chunks/{chunk-WGLVSGFA.js → chunk-DQI5TE6A.js} +2 -2
- package/dist/chunks/chunk-DTTFUANI.js +12 -0
- package/dist/chunks/{chunk-4TM75R7V.js → chunk-DUL6DXOI.js} +1 -1
- package/dist/chunks/{chunk-TGEGXTPR.js → chunk-ELX7VRSU.js} +1 -1
- package/dist/chunks/chunk-ERL2M773.js +3 -0
- package/dist/chunks/{chunk-4PZWGNX4.js → chunk-ERT32RZA.js} +4 -4
- package/dist/chunks/{chunk-RTJCELRR.js → chunk-EZRUWIP6.js} +1 -1
- package/dist/chunks/{chunk-LJDBR3RN.js → chunk-F6UQ6PPK.js} +1 -1
- package/dist/chunks/chunk-F7QTIHXX.js +2 -0
- package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
- package/dist/chunks/{chunk-FFWOTZQM.js → chunk-FVRII5XO.js} +1 -1
- package/dist/chunks/{chunk-C7M2WBWZ.js → chunk-FYYYECHE.js} +51 -49
- package/dist/chunks/chunk-G32BO6M5.js +4 -0
- package/dist/chunks/{chunk-NBE74GLF.js → chunk-G6OR5NB6.js} +1 -1
- package/dist/chunks/{chunk-GQGLPKU4.js → chunk-GGJUWIGR.js} +1 -1
- package/dist/chunks/{chunk-VSQXDS6H.js → chunk-GPL2Z65R.js} +1 -1
- package/dist/chunks/{chunk-INO67SEN.js → chunk-GS6ZUSIN.js} +2 -2
- package/dist/chunks/{chunk-47AXSBPV.js → chunk-GVARQXYI.js} +1 -1
- package/dist/chunks/chunk-GXCUH2VV.js +17 -0
- package/dist/chunks/{chunk-OCC43RSJ.js → chunk-GXZCMO6S.js} +1 -1
- package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
- package/dist/chunks/{chunk-HBLN4OLY.js → chunk-HUCBKXTU.js} +1 -1
- package/dist/chunks/{chunk-M5IX6VUA.js → chunk-IHB5GTOJ.js} +2 -2
- package/dist/chunks/{chunk-J3B2GM4A.js → chunk-IWWXIUAQ.js} +1 -1
- package/dist/chunks/chunk-J572ANHX.js +13 -0
- package/dist/chunks/{chunk-AKZPMKWP.js → chunk-J7ZTPXRQ.js} +1 -1
- package/dist/chunks/{chunk-CJUVHE4U.js → chunk-JORRZ4BB.js} +1 -1
- package/dist/chunks/chunk-JSQRLLN6.js +2 -0
- package/dist/chunks/chunk-KCOTDUGW.js +2 -0
- package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
- package/dist/chunks/{chunk-LRRBYIGH.js → chunk-LK2K3SPM.js} +2 -2
- package/dist/chunks/{chunk-557XSPVS.js → chunk-LKKMLBOH.js} +1 -1
- package/dist/chunks/{chunk-U456UP3N.js → chunk-LSZJ5M3X.js} +1 -1
- package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
- package/dist/chunks/{chunk-Y2KPHVZK.js → chunk-M3SCON53.js} +1 -1
- package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
- package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
- package/dist/chunks/{chunk-4RZBGKT7.js → chunk-N33D7KCW.js} +1 -1
- package/dist/chunks/chunk-N42HT64M.js +2 -0
- package/dist/chunks/{chunk-SD64CLJX.js → chunk-N4VHLJBZ.js} +1 -1
- package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
- package/dist/chunks/chunk-NG2L6D7G.js +2 -0
- package/dist/chunks/{chunk-GV3LFSMI.js → chunk-NLYZ5K7U.js} +1 -1
- package/dist/chunks/{chunk-F4TJ7WQV.js → chunk-NT7N6KLE.js} +1 -1
- package/dist/chunks/{chunk-PAE3PQEC.js → chunk-NZTCH6K5.js} +1 -1
- package/dist/chunks/{chunk-BEI4YULC.js → chunk-OG33QAG6.js} +1 -1
- package/dist/chunks/chunk-OTUBJV6C.js +6 -0
- package/dist/chunks/{chunk-RH43WLBX.js → chunk-PBTXLQAU.js} +1 -1
- package/dist/chunks/{chunk-3R4MSE2S.js → chunk-QJ6KUVAR.js} +1 -1
- package/dist/chunks/{chunk-7JXZNCBC.js → chunk-QU4UE73E.js} +1 -1
- package/dist/chunks/{chunk-WQMXEZVE.js → chunk-R6VJDOQM.js} +3 -3
- package/dist/chunks/{chunk-FUSCTBJI.js → chunk-R6WMY6AH.js} +1 -1
- package/dist/chunks/{chunk-EIX2V2KU.js → chunk-RDSVU6F6.js} +1 -1
- package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
- package/dist/chunks/{chunk-GW5SE3FM.js → chunk-RZUCVF2Q.js} +1 -1
- package/dist/chunks/{chunk-UC3FXTDL.js → chunk-SFKZITAG.js} +5 -5
- package/dist/chunks/{chunk-5A6ER3M2.js → chunk-SHJY5RLU.js} +1 -1
- package/dist/chunks/chunk-SI5W5LBV.js +2 -0
- package/dist/chunks/chunk-SO42ZB5K.js +2 -0
- package/dist/chunks/{chunk-2UDAKLJ4.js → chunk-TCOTXCV6.js} +1 -1
- package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
- package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
- package/dist/chunks/{chunk-X4ZT22SG.js → chunk-UPWJSNL5.js} +1 -1
- package/dist/chunks/chunk-URNMC46H.js +157 -0
- package/dist/chunks/{chunk-NLQ2UPN2.js → chunk-V7KR74NO.js} +1 -1
- package/dist/chunks/{chunk-HXZXDDKW.js → chunk-VHXDWAEH.js} +1 -1
- package/dist/chunks/{chunk-NE4ESZPT.js → chunk-W2TICQ62.js} +1 -1
- package/dist/chunks/chunk-WP2L2NY2.js +2 -0
- package/dist/chunks/chunk-WSOUMXH3.js +24 -0
- package/dist/chunks/chunk-WWQNMC7C.js +6 -0
- package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
- package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
- package/dist/chunks/{chunk-ZXT7V64X.js → chunk-XOB6FKQV.js} +1 -1
- package/dist/chunks/chunk-Y766IN7Y.js +2 -0
- package/dist/chunks/chunk-YCZZ62C2.js +2 -0
- package/dist/chunks/chunk-YM4PSVFW.js +4 -0
- package/dist/chunks/chunk-YNQWJWIC.js +10 -0
- package/dist/chunks/{chunk-GSWBNJGZ.js → chunk-Z3BWCFLV.js} +1 -1
- package/dist/chunks/{chunk-GOIKLFXK.js → chunk-ZG6353RM.js} +1 -1
- package/dist/chunks/{chunk-T6C5BNXK.js → chunk-ZPTKR3GB.js} +1 -1
- package/dist/chunks/{chunk-MNXNZDDW.js → chunk-ZYVHOVKL.js} +1 -1
- package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
- package/dist/chunks/cli-PSXMIJTF.js +2 -0
- package/dist/chunks/{configuration-command-BU2RPG33.js → configuration-command-XYKMXIWF.js} +1 -1
- package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
- package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
- package/dist/chunks/{connected-starting-assets-V5QXRK5Q.js → connected-starting-assets-JONPTII6.js} +1 -1
- package/dist/chunks/{continual-FLW6DAJK.js → continual-Z7MO2PF6.js} +1 -1
- package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
- package/dist/chunks/datasets-2PC2HP7N.js +2 -0
- package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
- package/dist/chunks/dist-47AYOIH6.js +2 -0
- package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
- package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
- package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
- package/dist/chunks/experiments-SZQYR6MH.js +2 -0
- package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
- package/dist/chunks/{help-PXUUREHZ.js → help-7HXFWIKS.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
- package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
- package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
- package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
- package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
- package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +3 -0
- package/dist/chunks/{hosted-tasksets-X2YCFYEJ.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
- package/dist/chunks/human-review-M26UKGJL.js +2 -0
- package/dist/chunks/{import-JWZSZCE4.js → import-6SI4BEKS.js} +2 -2
- package/dist/chunks/learning-HM3NWOV5.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
- package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
- package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
- package/dist/chunks/opchat-AG4CWVY4.js +3 -0
- package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
- package/dist/chunks/organizations-KDKX77XZ.js +2 -0
- package/dist/chunks/{profile-ELE2D7HU.js → profile-O5HL5DTQ.js} +1 -1
- package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
- package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
- package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
- package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
- package/dist/chunks/{runtime-776NUSE7.js → runtime-XBA744HJ.js} +2 -2
- package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
- package/dist/chunks/{sandbox-template-WP6YCGBK.js → sandbox-template-27U3FQN7.js} +1 -1
- package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
- package/dist/chunks/{send-turn-RPB65PME.js → send-turn-FIPWOXWV.js} +1 -1
- package/dist/chunks/src-BLWX6DRG.js +424 -0
- package/dist/chunks/{src-2R4CMCJ5.js → src-PU7QTFO5.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
- package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-R62D2HD6.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
- package/dist/chunks/{store-conversation-serving-25O7BAR2.js → store-conversation-serving-K324SQTO.js} +1 -1
- package/dist/chunks/{store-create-improve-T5E2GUKK.js → store-create-improve-3LQMIYAP.js} +1 -1
- package/dist/chunks/{store-datasets-5Y4U5L3R.js → store-datasets-3KSX7RSO.js} +1 -1
- package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
- package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
- package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
- package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
- package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
- package/dist/chunks/{store-local-experiments-LOH4F4TF.js → store-local-experiments-QTVHJAEP.js} +1 -1
- package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
- package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
- package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
- package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
- package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
- package/dist/chunks/{store-preference-comparison-RNIFLJRW.js → store-preference-comparison-DWV5XSMY.js} +1 -1
- package/dist/chunks/{store-schedules-DVQ2PP4F.js → store-schedules-2KUY4T6M.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-LXWFFYCZ.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-4HH7LX6N.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
- package/dist/chunks/{store-subagents-JLW4GD4Q.js → store-subagents-UGVEFA6M.js} +1 -1
- package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
- package/dist/chunks/{store-task-inventory-NJXRXFLC.js → store-task-inventory-GEQIZELY.js} +1 -1
- package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
- package/dist/chunks/{store-training-VRLU6NFX.js → store-training-CQV7PL3V.js} +1 -1
- package/dist/chunks/{store-training-jobs-3ZHG4LGI.js → store-training-jobs-XKN6K66J.js} +18 -10
- package/dist/chunks/{store-training-models-KWQD5PRP.js → store-training-models-Q7DTTR4S.js} +1 -1
- package/dist/chunks/{store-usage-ZRS3ILF2.js → store-usage-XGAX7NLB.js} +1 -1
- package/dist/chunks/{taskset-QDMCQQDJ.js → taskset-ARKJQKYQ.js} +1 -1
- package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
- package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
- package/dist/chunks/{teams-bot-GF272RGC.js → teams-bot-UTQAJA6H.js} +1 -1
- package/dist/chunks/training-3IWW4256.js +2 -0
- package/dist/chunks/{training-DF5UEPY3.js → training-RVIESURJ.js} +1 -1
- package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
- package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
- package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
- package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
- package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
- package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
- package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
- package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
- package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
- package/dist/chunks/{web-search-5RUXYIOF.js → web-search-7FBUBZ66.js} +1 -1
- package/dist/chunks/{workspaces-JRY2IE7H.js → workspaces-G3CMY7ZA.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox/url.d.ts +3 -1
- package/dist/skills/LICENSE +21 -0
- package/dist/skills/manifest.json +168 -0
- package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
- package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
- package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
- package/dist/skills/openpond-cli/SKILL.md +11 -7
- package/dist/skills/openpond-cli/references/experiments-and-training.md +1 -1
- package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
- package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
- package/dist/web/assets/App-DY2R8Z6r.js +53 -0
- package/dist/web/assets/{AppDialog-BurL61qE.js → AppDialog-8Y0FYalT.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
- package/dist/web/assets/{AppToastContext-DZLErwj0.js → AppToastContext-BiQbbVxq.js} +1 -1
- package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
- package/dist/web/assets/{AttachmentTypeIcon-CpMSfHCK.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
- package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
- package/dist/web/assets/{CartesianChart-CEbM980A.js → CartesianChart-J4ChOjvG.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
- package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
- package/dist/web/assets/{CollaborationTabs-DrKJmJZK.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
- package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
- package/dist/web/assets/{CommunityView-BzpIq1lD.js → CommunityView-Okydjpqm.js} +1 -1
- package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
- package/dist/web/assets/{ComposerCreateImproveStrip-ChplO9YP.js → ComposerCreateImproveStrip-CSngc8-V.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-DRHgc7j_.js → ConversationImportsSettings-DS73kyfj.js} +1 -1
- package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
- package/dist/web/assets/{GetStartedView-CaBk_mX6.js → GetStartedView-DGFPQ1We.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-JtFLyU3F.js → GettingStartedDialog-DFBYQdHz.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-hhcjDifK.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-CY8198Y1.js → HostedModelLearningSettings-CHaTHwC8.js} +1 -1
- package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
- package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
- package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-HibUEEko.js → LabSkillSidebar-BwtlThO7.js} +1 -1
- package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
- package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
- package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
- package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
- package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
- package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
- package/dist/web/assets/{NewProjectDialog-t9Imnb__.js → NewProjectDialog-CjrjgkTN.js} +1 -1
- package/dist/web/assets/{OutputsPage-CeGq_F1S.js → OutputsPage-jzx93QQ3.js} +1 -1
- package/dist/web/assets/{PageChrome-VHME5V8j.js → PageChrome-C1M13qG2.js} +1 -1
- package/dist/web/assets/{ProjectsPage-2TMZoEPB.js → ProjectsPage-DZrjlMp2.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
- package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
- package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
- package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
- package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
- package/dist/web/assets/{TerminalOverlay-DlhRpi-X.js → TerminalOverlay-d7A2F9Lx.js} +2 -2
- package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-BhhZPPuY.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
- package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
- package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-DTZslBeW.js → UsageSettingsSection-FhYymrfc.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
- package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-D_RUXhTi.js → WorkspaceGitDialogs-NRIMXnkS.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BJxaiDrj.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
- package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
- package/dist/web/assets/{WorkspacePresentationPreview-A28Poeca.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
- package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
- package/dist/web/assets/bot-6OhUEmkE.js +1 -0
- package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
- package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
- package/dist/web/assets/{chevron-down-dYn0pd4Q.js → chevron-down-jmVA1BIf.js} +1 -1
- package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
- package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
- package/dist/web/assets/{chunk-ZFYI4P6C-BmsNtSkR.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
- package/dist/web/assets/{chunk-BYNVSWIQ-DWh9SmdB.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DTTLbrYt.js → client-choice-storage-BdQ_YDuk.js} +1 -1
- package/dist/web/assets/{cloud-upload-CRMPCFnq.js → cloud-upload-Ck1ufAr8.js} +1 -1
- package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
- package/dist/web/assets/{copy-DR4ielPn.js → copy-CPkbMfXt.js} +1 -1
- package/dist/web/assets/{createLucideIcon-DmttVQ_a.js → createLucideIcon-CXQny8HU.js} +1 -1
- package/dist/web/assets/{cssMode-d-2GuNvW.js → cssMode-CYxYl_om.js} +1 -1
- package/dist/web/assets/{external-link-B4rPiZEp.js → external-link-CDKOLG_v.js} +1 -1
- package/dist/web/assets/{folder-open-BrIUcUk_.js → folder-open-CEtOb_lK.js} +1 -1
- package/dist/web/assets/{folder-plus-DwImGEt-.js → folder-plus-CVMYZs3e.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-Ds1mkrlW.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
- package/dist/web/assets/{htmlMode-s15GR0Fn.js → htmlMode-DoY4V_j0.js} +1 -1
- package/dist/web/assets/icons-D7jkCa2d.js +1 -0
- package/dist/web/assets/{image-CY-sHbfQ.js → image-B-PjDSwU.js} +1 -1
- package/dist/web/assets/{index-DYrLeSyY.js → index-D9WbJMSq.js} +2 -2
- package/dist/web/assets/index-g7UqJhnX.css +1 -0
- package/dist/web/assets/{info-aSvM8YlJ.js → info-CCnw-K3b.js} +1 -1
- package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
- package/dist/web/assets/{jsonMode-vos9H2hz.js → jsonMode-CeOpZdPj.js} +1 -1
- package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-pQmEaoMt.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
- package/dist/web/assets/{maximize-2-DgF6ZVOM.js → maximize-2-BZX38cpr.js} +1 -1
- package/dist/web/assets/message-square-CvgSecgD.js +1 -0
- package/dist/web/assets/{monaco.contribution-BPwsKvRB.js → monaco.contribution-CF2JDhi4.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CJlccVX3.js → monaco.contribution-cbDqt48m.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BbMpa0_-.js → monaco.contribution-m2ze2EsL.js} +2 -2
- package/dist/web/assets/{monaco.contribution-pWurLXbm.js → monaco.contribution-yeyow_-Q.js} +2 -2
- package/dist/web/assets/{monitor-DlEV241C.js → monitor-By0s4hxb.js} +1 -1
- package/dist/web/assets/{paperclip-fnRZSIRc.js → paperclip-BJ2QgJLa.js} +1 -1
- package/dist/web/assets/{pdf-CT3zVKCE.js → pdf-C4x-1jjP.js} +1 -1
- package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
- package/dist/web/assets/play-D_SuGDBM.js +1 -0
- package/dist/web/assets/plus-yw95Iaj8.js +1 -0
- package/dist/web/assets/{presentation-Bb8ecExR.js → presentation-I86G1Gd9.js} +1 -1
- package/dist/web/assets/{python-DXA1xp0A.js → python-CqFTPj8r.js} +1 -1
- package/dist/web/assets/{refresh-cw-B53QjxMO.js → refresh-cw-Dga35Eay.js} +1 -1
- package/dist/web/assets/requests-BCbaFiqV.js +1 -0
- package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
- package/dist/web/assets/{save-V1Q4Fcqa.js → save-BLKjYtzR.js} +1 -1
- package/dist/web/assets/settings-D7C-Auyi.js +21 -0
- package/dist/web/assets/{settings-lists-CtH1A57b.js → settings-lists-DMKA1lCN.js} +5 -5
- package/dist/web/assets/square-BY5lG2Ol.js +1 -0
- package/dist/web/assets/{square-terminal-Dmgkm5zY.js → square-terminal-B-n7vUex.js} +1 -1
- package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
- package/dist/web/assets/{toggleHighContrast-B-BD2K2Q.js → toggleHighContrast-BhmBE5XE.js} +1 -1
- package/dist/web/assets/training-QrdkRQZQ.js +2 -0
- package/dist/web/assets/{training-model-data-14942K_Z.js → training-model-data-DB-jg6L_.js} +12 -12
- package/dist/web/assets/{tsMode-DdgIcxK3.js → tsMode-BSWEII2p.js} +1 -1
- package/dist/web/assets/{upload-82Y6RjLi.js → upload-C4MPhQn8.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BgHXNpq_.js → useAccountSettings-9oqWdRLs.js} +1 -1
- package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
- package/dist/web/assets/{useLocalAgentSchedules-CsKv22Hs.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
- package/dist/web/assets/{useQuery-CPC2wsWm.js → useQuery-BD0Uexmh.js} +1 -1
- package/dist/web/assets/{wifi-off-DXOoDN9l.js → wifi-off-Cloe0WuQ.js} +1 -1
- package/dist/web/assets/{workers-Clf4hKt5.js → workers-BXagz5eg.js} +1 -1
- package/dist/web/assets/x-Dqpel42h.js +1 -0
- package/dist/web/assets/{yaml-I1tf8Uxx.js → yaml-sBdvVbCc.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +22 -4
- package/package.json +5 -2
- package/dist/chunks/actions-command-6LF4Z4WK.js +0 -2
- package/dist/chunks/app-server-connected-apps-3T546FE7.js +0 -2
- package/dist/chunks/app-server-evaluations-TXD747QA.js +0 -2
- package/dist/chunks/app-server-harness-services-BBCDV5P3.js +0 -2
- package/dist/chunks/app-server-runtime-VEJPDAFP.js +0 -2
- package/dist/chunks/apps-CTT2XYRR.js +0 -2
- package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
- package/dist/chunks/chunk-4U2FNXQW.js +0 -2
- package/dist/chunks/chunk-547AUVKN.js +0 -2
- package/dist/chunks/chunk-557YG77L.js +0 -2
- package/dist/chunks/chunk-7KTARW23.js +0 -2
- package/dist/chunks/chunk-B42QQUZY.js +0 -2
- package/dist/chunks/chunk-EWOTDVDJ.js +0 -4
- package/dist/chunks/chunk-GAQLXFOT.js +0 -2
- package/dist/chunks/chunk-GLDYJM7O.js +0 -1
- package/dist/chunks/chunk-HKV7RX5E.js +0 -2
- package/dist/chunks/chunk-IWK3RTLR.js +0 -2
- package/dist/chunks/chunk-JX6OX6XE.js +0 -12
- package/dist/chunks/chunk-JY3YSI54.js +0 -2
- package/dist/chunks/chunk-LILXHGIA.js +0 -2
- package/dist/chunks/chunk-LJPO3TEL.js +0 -17
- package/dist/chunks/chunk-MNFW5WLD.js +0 -6
- package/dist/chunks/chunk-N5GPINVP.js +0 -2
- package/dist/chunks/chunk-N663LL27.js +0 -2
- package/dist/chunks/chunk-NOSBNHGC.js +0 -18
- package/dist/chunks/chunk-NR5VASQB.js +0 -2
- package/dist/chunks/chunk-O3MHHGC5.js +0 -151
- package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
- package/dist/chunks/chunk-PGO4FRHU.js +0 -10
- package/dist/chunks/chunk-QAVQJZCM.js +0 -2
- package/dist/chunks/chunk-RBDUMASL.js +0 -2
- package/dist/chunks/chunk-TM4VEMNN.js +0 -2
- package/dist/chunks/chunk-TUCKED4T.js +0 -4
- package/dist/chunks/chunk-TVTFEGTU.js +0 -2
- package/dist/chunks/chunk-TW3SRBLU.js +0 -22
- package/dist/chunks/chunk-UT6F6AIB.js +0 -12
- package/dist/chunks/chunk-VE6ZIGUQ.js +0 -2
- package/dist/chunks/chunk-VI32G77S.js +0 -2
- package/dist/chunks/chunk-VWRTE64Y.js +0 -2
- package/dist/chunks/chunk-XSB3T4JZ.js +0 -5
- package/dist/chunks/chunk-XWDFXM3S.js +0 -2
- package/dist/chunks/chunk-ZQHPGEYT.js +0 -2
- package/dist/chunks/cli-GCSO2OAI.js +0 -2
- package/dist/chunks/connected-app-executor-UDE7U4KG.js +0 -2
- package/dist/chunks/connected-evidence-GXIY2L7C.js +0 -2
- package/dist/chunks/core-commands-NJ6TGND4.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-IUXUQK3L.js +0 -4
- package/dist/chunks/datasets-AH56DKLZ.js +0 -2
- package/dist/chunks/desktop-test-PYUTEOWO.js +0 -3
- package/dist/chunks/dist-5267UT3V.js +0 -2
- package/dist/chunks/evaluation-coordination-3AUICOC5.js +0 -2
- package/dist/chunks/experiment-improvements-YS7GGPDW.js +0 -2
- package/dist/chunks/experiments-EJZK7FPT.js +0 -2
- package/dist/chunks/experiments-signal-NKUIJCIY.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +0 -2
- package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +0 -2
- package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +0 -3
- package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +0 -2
- package/dist/chunks/hosted-profile-candidate-DKEMVIYG.js +0 -3
- package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-ERCXAPZD.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-Q3AIIIB6.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +0 -3
- package/dist/chunks/human-review-5WM6MSON.js +0 -2
- package/dist/chunks/learning-KVLTMRLD.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +0 -2
- package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +0 -2
- package/dist/chunks/model-projects-H22KENI4.js +0 -2
- package/dist/chunks/opchat-3S6TSDZO.js +0 -3
- package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +0 -2
- package/dist/chunks/organizations-62YNTZTO.js +0 -2
- package/dist/chunks/project-action-payload-32F4X2BB.js +0 -2
- package/dist/chunks/project-agent-O4REKO6T.js +0 -2
- package/dist/chunks/published-experiment-source-DAOTJLIN.js +0 -2
- package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +0 -2
- package/dist/chunks/sandbox-command-UQ26NDIX.js +0 -2
- package/dist/chunks/saved-work-PG52WCRQ.js +0 -2
- package/dist/chunks/src-AU6LG7E6.js +0 -421
- package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +0 -2
- package/dist/chunks/store-chat-resources-T4LR7K25.js +0 -2
- package/dist/chunks/store-evaluation-results-WUVJWCFU.js +0 -7
- package/dist/chunks/store-harness-workspaces-IFEFY5CK.js +0 -2
- package/dist/chunks/store-human-review-ZQNLZRGG.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +0 -2
- package/dist/chunks/store-model-batch-review-QO4VVKWC.js +0 -2
- package/dist/chunks/store-model-configuration-C3HSOFD5.js +0 -3
- package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +0 -2
- package/dist/chunks/store-task-inbox-DL5RYFPO.js +0 -33
- package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +0 -9
- package/dist/chunks/taskset-packages-CBLJFWDQ.js +0 -2
- package/dist/chunks/training-error-L5V5IBX3.js +0 -2
- package/dist/chunks/training-hosted-I2NDBYGS.js +0 -2
- package/dist/chunks/training-hosted-report-4F25RZZ4.js +0 -2
- package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
- package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
- package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
- package/dist/web/assets/App-DHJVXTI2.js +0 -54
- package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +0 -2
- package/dist/web/assets/AppsView-ttlr9ckQ.js +0 -1
- package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +0 -1
- package/dist/web/assets/ChatTimelineEntry-BITv20Ze.js +0 -1
- package/dist/web/assets/CommandMenu-6oj8FUr6.js +0 -1
- package/dist/web/assets/ComposerAttachments-6en7m_ov.js +0 -2
- package/dist/web/assets/FilePagePreview-CW4J_1u7.js +0 -2
- package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +0 -1
- package/dist/web/assets/LabsRoute-B61l1b8P.js +0 -101
- package/dist/web/assets/MainChatThread-egKi0gLk.js +0 -2
- package/dist/web/assets/MainPane-2dj6Dg4l.js +0 -95
- package/dist/web/assets/MainPane-BwHw3UYp.css +0 -1
- package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +0 -2
- package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +0 -1
- package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +0 -1
- package/dist/web/assets/SettingsView-D2bu3tK_.js +0 -5
- package/dist/web/assets/TeamChatView-CN17AsgA.js +0 -1
- package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +0 -1
- package/dist/web/assets/TrainingMetricWorkbench-DBy8F1xp.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +0 -11
- package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +0 -35
- package/dist/web/assets/app-models-BviS9b7U.js +0 -1
- package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
- package/dist/web/assets/chat-resources-3SvnVeKv.js +0 -1
- package/dist/web/assets/chevron-right-sFx2xRvT.js +0 -1
- package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
- package/dist/web/assets/icons-CK5-nxVC.js +0 -1
- package/dist/web/assets/index-Dezj4Z2p.css +0 -1
- package/dist/web/assets/loader-circle-cyf35w3i.js +0 -1
- package/dist/web/assets/play-wI_3FLr4.js +0 -1
- package/dist/web/assets/plus-DoJe4fLj.js +0 -1
- package/dist/web/assets/settings-BKmRueaw.js +0 -21
- package/dist/web/assets/square-BqSK-hv9.js +0 -1
- package/dist/web/assets/submit-issue-command-DRgUboVW.js +0 -3
- package/dist/web/assets/training-managed-adapter-BXNwgd3P.js +0 -1
- package/dist/web/assets/useAgentInventory-B-LNn3up.js +0 -1
- package/dist/web/assets/x-IPhrr4ju.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePagePreview-Qc4B0vue.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-D9WbJMSq.js","assets/index-g7UqJhnX.css","assets/icons-D7jkCa2d.js","assets/App-DY2R8Z6r.js","assets/useQuery-BD0Uexmh.js","assets/schemas-lO3MoWQr.js","assets/common-BMjyKlX-.js","assets/settings-D7C-Auyi.js","assets/client-choice-storage-BdQ_YDuk.js","assets/api-client-Dgz-fOMl.js","assets/app-models-CUA9XB9U.js","assets/requests-BCbaFiqV.js","assets/create-pipeline-CyUZrbbO.js","assets/profile-ref-DSNkG6Ol.js","assets/chunk-H3JZ3P5T-B0SCoPw4.js","assets/work-outputs-CK0nHe4g.js","assets/contracts-BLiqJxBv.js","assets/training-QrdkRQZQ.js","assets/chunk-ONGOAEY6-C__DQmRT.js","assets/reward-checks-Bcq9ETCA.js","assets/intake-contracts-BW0Y0C2R.js","assets/chat-resources-CI8KFVO5.js","assets/ponder-desktop-Dm7tOkKo.js","assets/submit-issue-command-B7Hrt2tU.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-ZyYiYBBd.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/createLucideIcon-CXQny8HU.js","assets/bot-6OhUEmkE.js","assets/chevron-down-jmVA1BIf.js","assets/chevron-right-BYmDQ7ti.js","assets/copy-CPkbMfXt.js","assets/external-link-CDKOLG_v.js","assets/loader-circle-CPaJeTDy.js","assets/maximize-2-BZX38cpr.js","assets/message-square-CvgSecgD.js","assets/plus-yw95Iaj8.js","assets/refresh-cw-Dga35Eay.js","assets/square-terminal-B-n7vUex.js","assets/x-Dqpel42h.js","assets/AppToastContext-BiQbbVxq.js","assets/models-route-Bl_TmMl6.js","assets/NativeSetupTerminal-CPDChcMi.js","assets/AppDialog-8Y0FYalT.js","assets/PageChrome-C1M13qG2.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-BZ0BbnHv.js","assets/WorkspaceMonacoEditor-CvDGjKAL.js","assets/WorkspaceMonacoEditor-C5uazxST.css","assets/WorkspacePresentationPreview-DJrjrvT0.js","assets/WorkspaceFileLocation-LrEWj4UK.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-D9WbJMSq.js";import{t as a}from"./useQuery-BD0Uexmh.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-BdQ_YDuk.js";import{n as m}from"./app-models-CUA9XB9U.js";import{n as h}from"./create-pipeline-CyUZrbbO.js";import{t as g}from"./query-scope-BRpcgljO.js";import"./icons-D7jkCa2d.js";import{t as _}from"./createLucideIcon-CXQny8HU.js";import{A as v,B as ee,E as te,F as ne,L as y,M as re,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-DB-jg6L_.js";import{t as be}from"./chevron-up-CstyLXH3.js";import{t as w}from"./folder-open-CEtOb_lK.js";import{t as xe}from"./info-CCnw-K3b.js";import{t as Se}from"./loader-circle-CPaJeTDy.js";import{t as Ce}from"./maximize-2-BZX38cpr.js";import{t as we}from"./message-square-CvgSecgD.js";import{t as Te}from"./plus-yw95Iaj8.js";import{t as T}from"./refresh-cw-Dga35Eay.js";import{t as Ee}from"./save-BLKjYtzR.js";import{t as De}from"./x-Dqpel42h.js";import{n as E,r as Oe}from"./AppToastContext-BiQbbVxq.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-DY2R8Z6r.js";import{n as I,t as L}from"./WorkspaceFileLocation-LrEWj4UK.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=_(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),nt=_(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),rt=_(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),it=_(`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=_(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),ot=_(`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=_(`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=_(`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=h(n?.metadata)??h(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??[],h=(0,R.useMemo)(()=>i.filter(e=>e.status===`active`),[i]),g=(0,R.useMemo)(()=>zt(n),[n]),_=(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]),v=(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]),ee=(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]),te=(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)(()=>{_()},[_]),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 _(),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)})]}),g?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:`Receipt`}),(0,z.jsxs)(`dd`,{children:[Gt(g.id),` / `,qt(g.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 v(),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 te(e.leaseId),children:c===`remove:${e.leaseId}`?(0,z.jsx)(Se,{className:`spinning`,size:14}):(0,z.jsx)(ne,{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.`}),h.length>0?(0,z.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:h.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 ee(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:h,onToggleWordWrap:g}){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:g,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:h,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)(ee,{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:h,tabOrder:g=[],filesTabOpen:_=!0,onCloseFilesTab:v,overviewTabs:ee=[],outputsLabel:te=`Training`,activeOverviewId:ne,onNewOverview:re,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`})},[ne,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=[...ee.map(e=>(0,z.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`outputs`&&ne===e?`active`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`outputs`&&ne===e,tabIndex:p===`outputs`&&ne===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?te:`New tab`})]}),(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":e===-2?`Close Agents`:e===-1?`Close ${te}`:`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,_?(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`})]}),v?(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":`Close files tab`,onClick:v,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(g.map((e,t)=>[e,t]));return E.sort((e,t)=>(Oe.get(String(e.key))??g.length)-(Oe.get(String(t.key))??g.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,h]}),(0,z.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:be,children:[(0,z.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${!re&&(e||o)?`active`:``}`,title:`Add`,"aria-label":re?`New tab`:`Add to right sidebar`,onClick:re??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)(y,{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:h,onCopyGitApply:g,onEditorCheck:_,onEditorRedo:v,onEditorSave:ee,onEditorUndo:te,onRefresh:ne,onToggleCollapsed:y,onToggleEditorControlsVisible:re,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:h,onClose:()=>ie(!1),onCopyGitApply:g,onRefresh:ne,onToggleCollapsed:y,onToggleEditorControlsVisible:re,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:ee,children:(0,z.jsx)(Ee,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Undo`,"aria-label":`Undo`,onClick:te,children:(0,z.jsx)(ct,{size:14})}),(0,z.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Redo`,"aria-label":`Redo`,onClick:v,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:_,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,h]=(0,R.useState)(r.readVersion),_=(0,R.useRef)(null),v=a({queryKey:[`open-file-version`,g(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(_.current?.stamp===o)return{exists:!0,revision:_.current.revision??null};let c=await de(e,n,r.path);return _.current={stamp:o,revision:c.readVersion},{exists:!0,revision:c.readVersion??null}},refetchInterval:5e3,refetchOnWindowFocus:!0}),ee=v.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||(h(i),e&&(n||s)&&await ee(),t||f(!0))})().catch(()=>{t||f(!0)}),()=>{t=!0}},[ee,e,r.content,r.contentEncoding,r.readVersion,n,s]),(0,R.useEffect)(()=>{m===void 0&&!r.content&&v.data&&h(v.data.revision)},[m,r.content,v.data]);let te=d&&m!==void 0&&!v.isError&&v.data?.exists&&m!==v.data.revision;async function ne(){if(e&&(n||s)&&!l&&(!i||window.confirm(`Discard unsaved edits and refresh this file from disk?`))){u(!0);try{let t=await v.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),h(i.readVersion??t.data?.revision)}v.refetch()}catch(e){p.current&&c?.(e instanceof Error?e.message:`Could not refresh file.`,`error`)}finally{p.current&&u(!1)}}}return!te&&!l?null:(0,z.jsxs)(`button`,{type:`button`,className:`workspace-file-refresh`,disabled:l||!e||!n&&!s,onClick:()=>void ne(),"aria-label":`Reload updated file`,title:te?`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-Qc4B0vue.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]))),Y=(0,R.lazy)(()=>i(()=>import(`./WorkspacePdfPreview-BZ0BbnHv.js`),__vite__mapDeps([54,1,2,3,44,53])));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
|
+
|
|
4
|
+
[file truncated]`,hn=(0,R.lazy)(()=>i(()=>import(`./WorkspaceMonacoEditor-CvDGjKAL.js`).then(e=>e.t),__vite__mapDeps([55,1,2,3,56]))),gn=(0,R.lazy)(()=>i(()=>import(`./WorkspacePresentationPreview-DJrjrvT0.js`),__vite__mapDeps([57,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,58,59,60]))),_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:h,onSave:g,renderMarkdown:_,saveError:v,saving:ee=!1,splitView:te=!1,wordDiffs:ne=!1,wordWrap:y,workspaceName:re,workspaceRootPath:b}){Oe(a,{prefix:`File preview`}),Oe(v,{prefix:`Save failed`});let x=o.contentEncoding===`base64`?o.content??``:n??o.content??``,ie=(0,R.useMemo)(()=>x.split(`
|
|
5
|
+
`).slice(0,800),[x]),ae=cn(o.path),oe=n!=null||o.content!=null,S=x.endsWith(mn),se=_&&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:re,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?te?(0,z.jsx)(wn,{collapsed:e,file:o,hideWhiteSpace:s,onSelectBreadcrumbPath:p,wordDiffs:ne,wordWrap:y,headerActions:c,workspaceName:re,workspaceRootPath:b}):(0,z.jsx)(Cn,{collapsed:e,file:o,hideWhiteSpace:s,wordWrap:y,workspaceName:re,workspaceRootPath:b,onSelectBreadcrumbPath:p,headerActions:c}):(0,z.jsxs)(`div`,{className:`workspace-file-preview ${y?`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:re,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:[ee?(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:h,onSave:()=>g?.(),ref:i,value:x,wordWrap:y})}):(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
|
+
`)){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:h=!1,sideChatTabs:g,sourceSwitcher:_,tabRequest:v,renderOutputs:ee,outputsLabel:te,additionalTabs:ne,viewState:y,onRefresh:re,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:h,sideChatTabs:g??[],sourceSwitcher:_??null,tabRequest:v??null,additionalTabs:ne,renderOutputs:ee??null,outputsLabel:te,viewState:y??null,onRefresh:re,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:h,openFileRequest:g,readOnly:_,sideChatTabs:ee,sourceSwitcher:ne,tabRequest:y,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||y?.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)(y?.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??m.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&&g&&S(g.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=>y?.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,y?.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)(()=>{_||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,_,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)(()=>{g&&cn.current!==g.id&&(g.file||hn)&&(cn.current=g.id,g.file?Qn(g.file,g.imageUrl,g.source,g):Zn(g.path,{source:g.source}))},[hn,g]),(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(_||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,_,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(y){if(y.tab===`files`&&hr(),y.tab===`outputs`){if(y.overview===`agents`)D(e=>e.includes(-2)?e:[...e,-2]),O(-2),k(e=>e.includes(`overview--2`)?e:[...e,`overview--2`]);else if(y.overview===`experiments`)D(e=>e.includes(-1)?e:[...e,-1]),O(-1),k(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]);else if(y.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(y.tab)}},[y]),(0,R.useEffect)(()=>{!_n&&A===`goal`&&j(`files`)},[A,_n]),(0,R.useEffect)(()=>{!pn&&A===`summary`&&j(`files`)},[A,pn]);let Z=A===`file`||h&&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(_&&(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,_,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(re(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(h?`files`:a),h&&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}),h||Ye(e=>e.includes(a)?e:[...e,a]),L(a),j(h?`files`:`file`),!X&&r&&e&&Le(a)&&Xt(a),N(!1),P(!1),qe(``))}function Qn(e,t,n=!1,i){if(re(e.path)&&e.content!=null&&!n&&r){v(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&&!h&&!F.includes(a))return;s||(Yn(h?`files`:a),h&&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),h||Ye(e=>e.includes(a)?e:[...e,a]),L(a),j(h?`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
|
+
|
|
8
|
+
[file truncated]`))return;let o=q.current+1;q.current=o,J.current?.abort(Error(`lsp_diagnostics_superseded`));let s=new AbortController;J.current=s,Lt(t);try{let i=await M.workspaceLspTouch(r,e,{path:t,content:a,waitForDiagnostics:n.waitForDiagnostics??!0},{signal:s.signal});if(o!==q.current)return;Nt(e=>({...e,[i.path]:i.diagnostics})),H(e=>({...e,[i.path]:i.servers}))}catch(e){if(s.signal.aborted||o!==q.current)return;let n=e instanceof Error?e.message:String(e);Nt(e=>({...e,[t]:[]})),H(e=>({...e,[t]:[{id:`lsp`,root:``,status:`error`,message:n}]}))}finally{J.current===s&&(J.current=null),!s.signal.aborted&&o===q.current&&Lt(e=>e===t?null:e)}},[e,r,On,kn,Ct,B,X]),rr=(0,R.useCallback)(async t=>{if(X||!r||!e)throw Error(`Workspace LSP is unavailable.`);return M.workspaceLspAction(r,e,t)},[e,r,X]),ir=(0,R.useCallback)(async t=>{if(!r||!e&&!Y||dn.current===t)return;let n=Ct[t];if(!n||n.content===n.savedContent)return;let i=n.content,a=Date.now();dn.current=t,W(t),Kt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n});try{let n=X?await _e(r,Y,t,i):await M.saveWorkspaceFile(r,e,{path:t,content:i});ht(e=>({...e,[n.path]:n})),wt(e=>{let n=e[t];return n?{...e,[t]:{content:n.content,savedContent:i,savedAt:a}}:e}),G.languageServers!==`off`&&G.checkOnSave&&await nr(t,{content:i,waitForDiagnostics:!0}),X?await vn({silent:!0}):await C({silent:!0})}catch(e){Kt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}finally{dn.current===t&&(dn.current=null),W(e=>e===t?null:e)}},[G.checkOnSave,G.languageServers,e,r,Ct,C,nr,vn,Y,X]),ar=I?er(I):null,or=!!(I&&yt.has(I)),sr=I?Ct[I]?.content??ar?.content??null:null,cr=!(!ar?.patch||nt),lr=!(_||or||A!==`file`||cr||!I||sr==null||Le(I)||Ve(I)||ar?.contentEncoding===`base64`||it&&Ne(I)||sr.endsWith(`
|
|
9
|
+
|
|
10
|
+
[file truncated]`));(0,R.useEffect)(()=>{if(G.languageServers===`off`||!G.diagnosticsWhileEditing||!I||!lr||sr==null)return;let e=window.setTimeout(()=>{nr(I,{content:sr,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(e)},[G.diagnosticsWhileEditing,G.languageServers,nr,sr,lr,I]),(0,R.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&A===`file`&&I&&(e.preventDefault(),Kn.has(I)&&ir(I))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[A,Kn,ir,I]);let ur=(0,R.useCallback)(()=>{I&&(fn.current?fn.current.save():ir(I))},[ir,I]),dr=(0,R.useCallback)(()=>{fn.current?.undo()},[]),fr=(0,R.useCallback)(()=>{fn.current?.redo()},[]),pr=(0,R.useCallback)(()=>{I&&G.languageServers!==`off`&&nr(I,{content:sr??void 0,waitForDiagnostics:!0})},[G.languageServers,nr,sr,I]);function mr(e,t){if(t.stopPropagation(),(!Kn.has(e)||window.confirm(`Discard unsaved changes to ${e}?`))&&(Kn.has(e)&&(wt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),Kt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})),gt.current.close(e),vt(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n}),Ye(t=>t.filter(t=>t!==e)),k(t=>t.filter(t=>t!==e)),yt.has(e)&&ht(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),St(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),bt(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}),I===e)){let t=Bn.findIndex(t=>t.path===e),n=Bn[t+1]??Bn[t-1]??null;L(n?.path??null),!n&&A===`file`&&(b?Xn():j(`files`))}}function hr(){Yn(`files`),De(!0),j(`files`),N(!1),P(!1)}function gr(e){Et(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function _r(e){Yn(`files`),De(!0),e&&Et(t=>{let n=new Set(t);for(let t of Gn(e))n.add(t);return n}),j(`files`),N(!1),P(!1)}function vr(){let e=`git apply <<'PATCH'\n${jn.map(e=>e.patch).filter(Boolean).join(`
|
|
11
|
+
`)}\nPATCH`;navigator.clipboard?.writeText(e)}let yr=jn.length>0,br=Fn.length>0,xr=F.length>0,Sr=_n||pn||yr||br||xr,Q=A===`outputs`&&b?`outputs`:A===`goal`&&_n?`goal`:A===`summary`&&pn?`summary`:A===`file`&&I?`file`:b&&!Ee?`outputs`:`files`;(0,R.useEffect)(()=>{if(Q!==`outputs`||E.length)return;let e=Re.current++;D([e]),O(e),k(t=>[...t,`overview-${e}`]),j(`outputs`)},[E.length,Q]);let Cr=Q===`files`?`No files to show`:`No local changes`,wr=n===`local_project`&&!l&&!u,Tr=X?kt:s,Er=X?V:u,Dr=Un({changedFiles:Cn?.filesChanged??jn.length,checkpointStatus:Tn,dirty:!!Cn?.dirty,error:Er,loading:Tr,preservedReadback:xn,sandboxMode:X,sourcePending:X&&!Y}),Or=Tr?`Loading workspace files`:Er?`Workspace files are unavailable`:X&&!Y?xe?.emptyMessage??`No sandbox filesystem is available.`:wr?`Loading workspace files`:l?Cr:`No local files to show`,kr=I?xt[I]??null:null,Ar=!kr&&!X&&I&&Le(I)?I:null,jr=Yt?xt[Yt]??null:null,Mr=!jr&&!X&&Yt&&Le(Yt)?Yt:null,Nr=te(r,e,Ar),Pr=te(r,e,Mr),Fr=kr??Nr,Ir=jr??Pr,Lr=Q===`file`||h&&Q===`files`?I:null,Rr=!!(Lr&&Ne(Lr)),zr=I?Mt[I]??[]:[],Br=I?Pt[I]??null:null,Vr=!!(I&&Ft===I),Hr=ot&&lr,Ur=!_&&!or&&!X&&G.languageServers!==`off`,Wr=(0,R.useMemo)(()=>Pn({activeDiagnostics:zr,activeServers:Br,editorDiagnosticsChecking:Vr,editorLspEnabled:Ur,showEditorCommandBar:Hr}),[zr,Br,Vr,Ur,Hr]),Gr=(0,R.useCallback)(async e=>{if(!r)throw Error(`OpenPond server connection is unavailable.`);await M.runSubagentLifecycleAction(r,e.runId,{action:e.action,reason:`User requested from Goal details.`}),await C({silent:!0})},[r,C]),$=X?`sandbox`:n===`local_project`?`local`:null,Kr=(0,R.useMemo)(()=>{let e=new Map;if(!$)return e;for(let n of Ce)n.workspaceKind===$&&n.workspaceId===(t??($===`local`?S(n.path):null))&&e.set(n.path,n);return e},[Ce,$,t]),qr=(0,R.useCallback)(e=>{try{return Kr.get($e(e))?.status??null}catch{return null}},[Kr]),Jr=(0,R.useCallback)((e,n)=>{let r=t??($===`local`?S(e):null);if(!$||!r||!Te)return;let i;try{i=$e(e)}catch{return}let a=Kr.get(i),o=new Date().toISOString();Te(a??{id:et({workspaceKind:$,workspaceId:r,path:i}),workspaceKind:$,workspaceId:r,workspaceName:c??`Local files`,path:i,status:`pinned`,order:null,sourceSessionId:we,available:!0,createdAt:o,updatedAt:o},n)},[Te,Kr,we,$,t,c]),Yr=!!($&&Te&&(t||$===`local`&&F.some(e=>S(e)))),Xr=I&&Yr&&!or?(0,z.jsx)(Qt,{currentStatus:qr(I),onSetStatus:e=>Jr(I,e)}):null,Zr=I?(0,z.jsxs)(`div`,{className:`workspace-active-file-preview`,children:[(0,z.jsx)(on,{file:er(I),connection:r,workspaceId:e,sandboxId:Object.hasOwn(_t,I)?_t[I]:X?Y:null,dirty:Kn.has(I),onReload:(e,t)=>{ht(t=>({...t,[I]:{...e,path:I}})),wt(e=>{let t={...e};return delete t[I],t}),t&&St(e=>({...e,[I]:t})),Ht(null),!Ve(I)&&!Le(I)&&rt(!0)}},`${mn}:${_t[I]??`local`}:${I}`),(0,z.jsx)(Sn,{diagnostics:Ur?Mt[I]??[]:[],draftContent:Ct[I]?.content,editorRef:fn,editable:lr&&!Fr,error:Vt,file:er(I),collapsed:Qe,hideWhiteSpace:dt,headerActions:Xr,imageSrc:Fr,loading:Rt===I,loadFullFiles:nt,saveError:Gt[I]??null,saving:qt===I,onOpenImage:()=>{Fr&&Xt(I)},onDraftContentChange:e=>tr(I,e),onLspAction:Ur?rr:void 0,onSave:()=>void ir(I),onSelectBreadcrumbPath:_r,renderMarkdown:it,splitView:pt,wordDiffs:ct,wordWrap:Xe,workspaceName:c,workspaceRootPath:wn})]}):null,Qr=(Q===`file`||h&&Q===`files`)&&I&&!Ve(I)&&!Le(I)&&ar?.contentEncoding!==`base64`?(0,z.jsx)(rn,{inline:!0,canSaveActiveFile:!(_||or||!I||!Kn.has(I)||qt===I),canCheckActiveFile:Ur,collapsed:Qe,editorControlsVisible:ot,editorDiagnosticStatus:Wr,editorDiagnosticsChecking:Vr,hideWhiteSpace:dt,loadFullFiles:nt,menuOpen:He,renderMarkdown:it,showEditorCommandBar:Hr,showRenderMarkdownToggle:Rr,splitView:pt,wordDiffs:ct,wordWrap:Xe,onCopyGitApply:vr,onEditorCheck:pr,onEditorRedo:fr,onEditorSave:ur,onEditorUndo:dr,onRefresh:()=>void(X?vn():C()),onToggleCollapsed:()=>tt(e=>!e),onToggleEditorControlsVisible:$n,onToggleHideWhiteSpace:()=>ft(e=>!e),onToggleLoadFullFiles:()=>rt(e=>!e),onToggleMenu:e=>Ue(t=>e??!t),onToggleRenderMarkdown:()=>at(e=>!e),onToggleSplitView:()=>mt(e=>!e),onToggleWordDiffs:()=>ut(e=>!e),onToggleWordWrap:()=>Ze(e=>!e)}):null;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`aside`,{className:`workspace-diff-panel ${Q===`outputs`?`workspace-diff-overview`:``} ${d?`expanded`:``}`,id:`right-sidebar-files-panel`,role:`tabpanel`,"aria-label":`Workspace diffs`,children:[!d&&(0,z.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize diff panel`,onPointerDown:fe}),(0,z.jsx)(nn,{addMenuOpen:We,expanded:d,filteredFiles:qn,openFiles:Bn,dirtyFilePaths:Kn,goalDetailsAvailable:_n,searchOpen:Ge,searchQuery:Ke,selectedPath:I,sideChatTabs:ee,summaryAvailable:pn,onSelectOutputs:b?()=>{D(e=>e.includes(-1)?e:[...e,-1]),O(-1),k(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]),j(`outputs`),N(!1),P(!1)}:void 0,sourceStatus:Dr,sourceSwitcher:ne,visibleTab:Q,additionalTabs:oe,toolbarActions:Qr,tabOrder:Be,filesTabOpen:Ee,onCloseFilesTab:b?()=>{De(!1),k(e=>e.filter(e=>e!==`files`)),A===`files`&&Xn()}:void 0,overviewTabs:b?E:[],outputsLabel:ie,activeOverviewId:Me,onNewOverview:b?()=>{let e=Re.current++;D(t=>[...t,e]),k(t=>[...t,`overview-${e}`]),O(e),j(`outputs`),N(!1),P(!1)}:void 0,onSelectOverview:e=>{O(e),j(`outputs`)},onCloseOverview:e=>{let t=E.filter(t=>t!==e);if(D(t),k(t=>t.filter(t=>t!==`overview-${e}`)),e===Me&&A===`outputs`){if(t.length)O(t[t.length-1]);else if(b){let e=Re.current++;D([e]),O(e),j(`outputs`),k(t=>[...t,`overview-${e}`])}else if(Bn.length&&I)j(`file`);else if(Ee)j(`files`);else{let e=Re.current++;D([e]),k(t=>[...t,`overview-${e}`]),O(e)}}},getFileBookmarkStatus:Yr?qr:void 0,onCloseFileTab:mr,onCloseSideChat:ve,onCloseSearch:()=>P(!1),onOpenFile:Zn,onOpenBrowser:me?()=>{N(!1),P(!1),me()}:void 0,onOpenSearch:()=>{N(!1),P(!0)},onOpenSideChat:ye?()=>{N(!1),P(!1),ye()}:void 0,onSearchQueryChange:qe,onSetFileBookmarkStatus:Yr?Jr:void 0,onSelectFile:e=>{L(e),j(`file`)},onSelectFiles:hr,onSelectGoal:()=>j(`goal`),onSelectSummary:()=>{j(`summary`),N(!1),P(!1)},onSelectSideChat:be,onToggleAddMenu:()=>{N(e=>!e),P(!1)},onToggleExpanded:pe}),Bt&&(0,z.jsx)(Ae,{error:Bt}),b?E.map(e=>(0,z.jsx)(`div`,{className:`workspace-diff-tool-view`,hidden:Q!==`outputs`||Me!==e,inert:Q!==`outputs`||Me!==e,children:b(()=>{P(!0),N(!1)},e)},e)):null,Q===`outputs`&&b?null:Q===`goal`&&_n?(0,z.jsx)(lt,{createRuntime:w?.createRuntime??null,goalRuntime:w?.goalRuntime??null,subagentRuntime:w?.subagentRuntime??null,onRunSubagentLifecycleAction:r?Gr:void 0}):Q===`summary`&&pn?Se?(0,z.jsx)(Jt,{summary:Se}):(0,z.jsx)(It,{sandboxId:Y,connection:r}):Sr?(0,z.jsxs)(z.Fragment,{children:[Q===`files`&&(h?(0,z.jsxs)(`div`,{className:`workspace-diff-files-preview-layout`,children:[(0,z.jsx)(en,{diff:Cn,expandedFolderPaths:Tt,rootPath:f,repoFiles:Fn,selectedPath:I,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Zn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:gr}),Zr??(0,z.jsx)(`div`,{className:`workspace-diff-files-preview-empty`,children:`Select a file to review its changes.`})]}):(0,z.jsx)(en,{diff:Cn,expandedFolderPaths:Tt,rootPath:f,repoFiles:Fn,selectedPath:I,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Zn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:gr})),Q===`file`&&I&&Zr]}):(0,z.jsx)(`div`,{className:`workspace-diff-empty`,children:(0,z.jsx)(`span`,{children:Or})})]}),(0,z.jsx)(x,{open:!!Ir,src:Ir,title:Yt??``,onClose:()=>Xt(null)})]})}export{Fn as n,rt as r,Bn as t};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-D9WbJMSq.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-lO3MoWQr.js";import"./icons-D7jkCa2d.js";import{t as f}from"./createLucideIcon-CXQny8HU.js";import{t as p}from"./chevron-down-jmVA1BIf.js";import{t as m}from"./external-link-CDKOLG_v.js";import{t as h}from"./git-commit-horizontal-DDyhPjxS.js";import{t as g}from"./info-CCnw-K3b.js";import{t as _}from"./monitor-By0s4hxb.js";import{t as v}from"./play-D_SuGDBM.js";import{t as y}from"./refresh-cw-Dga35Eay.js";import{t as b}from"./square-BY5lG2Ol.js";import{t as x}from"./square-terminal-B-n7vUex.js";import{t as S}from"./upload-C4MPhQn8.js";import{t as C}from"./x-Dqpel42h.js";import{r as w}from"./AppToastContext-BiQbbVxq.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-DY2R8Z6r.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
|
+
|
|
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
|
+
`+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+`
|
|
5
|
+
`,u+=e.repeat(`-`,i.indent+d+3+p.pos)+`^
|
|
6
|
+
`;for(let a=1;a<=i.linesAfter&&!(l+a>=s.length);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+`
|
|
7
|
+
`}return u.replace(/\n$/,``)}return W=r,W}var G,de;function K(){if(de)return G;de=1;let e=U(),t=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],n=[`scalar`,`sequence`,`mapping`];function r(e){let t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(i,a){if(a||={},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e(`Unknown option "`+n+`" is met in definition of "`+i+`" YAML type.`)}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(e){return e},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=r(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e(`Unknown kind "`+this.kind+`" is specified for "`+i+`" YAML type.`)}return G=i,G}var fe,q;function J(){if(q)return fe;q=1;let e=U(),t=K();function n(e,t){let n=[];return e[t].forEach(function(e){let t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function r(){let e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function t(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(let e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(t);return e}function i(e){return this.extend(e)}return i.prototype.extend=function(a){let o=[],s=[];if(a instanceof t)s.push(a);else if(Array.isArray(a))s=s.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(o=o.concat(a.implicit)),a.explicit&&(s=s.concat(a.explicit));else throw new e(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);o.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(n.loadKind&&n.loadKind!==`scalar`)throw new e(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(n.multi)throw new e(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),s.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});let c=Object.create(i.prototype);return c.implicit=(this.implicit||[]).concat(o),c.explicit=(this.explicit||[]).concat(s),c.compiledImplicit=n(c,`implicit`),c.compiledExplicit=n(c,`explicit`),c.compiledTypeMap=r(c.compiledImplicit,c.compiledExplicit),c},fe=i,fe}var pe,me;function he(){return me||(me=1,pe=new(K())(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}})),pe}var ge,Y;function _e(){return Y||(Y=1,ge=new(K())(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}})),ge}var ve,X;function ye(){return X||(X=1,ve=new(K())(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}})),ve}var be,xe;function Se(){return xe||(xe=1,be=new(J())({explicit:[he(),_e(),ye()]})),be}var Ce,we;function Te(){if(we)return Ce;we=1;let e=K();function t(e){if(e===null)return!0;let t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function n(){return null}function r(e){return e===null}return Ce=new e(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`}),Ce}var Ee,De;function Oe(){if(De)return Ee;De=1;let e=K();function t(e){if(e===null)return!1;let t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function n(e){return e===`true`||e===`True`||e===`TRUE`}function r(e){return Object.prototype.toString.call(e)===`[object Boolean]`}return Ee=new e(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{lowercase:function(e){return e?`true`:`false`},uppercase:function(e){return e?`TRUE`:`FALSE`},camelcase:function(e){return e?`True`:`False`}},defaultStyle:`lowercase`}),Ee}var ke,Ae;function je(){if(Ae)return ke;Ae=1;let e=V(),t=K();function n(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function r(e){return e>=48&&e<=55}function i(e){return e>=48&&e<=57}function a(e){if(e===null)return!1;let t=e.length,a=0,s=!1;if(!t)return!1;let c=e[a];if((c===`-`||c===`+`)&&(c=e[++a]),c===`0`){if(a+1===t)return!0;if(c=e[++a],c===`b`){for(a++;a<t;a++){if(c=e[a],c!==`0`&&c!==`1`)return!1;s=!0}return s&&isFinite(o(e))}if(c===`x`){for(a++;a<t;a++){if(!n(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}if(c===`o`){for(a++;a<t;a++){if(!r(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}}for(;a<t;a++){if(!i(e.charCodeAt(a)))return!1;s=!0}return s?isFinite(o(e)):!1}function o(e){let t=e,n=1,r=t[0];if((r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function s(e){return o(e)}function c(t){return Object.prototype.toString.call(t)===`[object Number]`&&t%1==0&&!e.isNegativeZero(t)}return ke=new t(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:a,construct:s,predicate:c,represent:{binary:function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},octal:function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)}},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),ke}var Me,Ne;function Pe(){if(Ne)return Me;Ne=1;let e=V(),t=K(),n=RegExp(`^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),r=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function i(e){return e===null||!n.test(e)?!1:isFinite(parseFloat(e,10))?!0:r.test(e)}function a(e){let t=e.toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}let o=/^[-+]?[0-9]+e/;function s(t,n){if(isNaN(t))switch(n){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(t===1/0)switch(n){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(t===-1/0)switch(n){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(e.isNegativeZero(t))return`-0.0`;let r=t.toString(10);return o.test(r)?r.replace(`e`,`.e`):r}function c(t){return Object.prototype.toString.call(t)===`[object Number]`&&(t%1!=0||e.isNegativeZero(t))}return Me=new t(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:i,construct:a,predicate:c,represent:s,defaultStyle:`lowercase`}),Me}var Fe,Ie;function Le(){return Ie||(Ie=1,Fe=Se().extend({implicit:[Te(),Oe(),je(),Pe()]})),Fe}var Z,Re;function ze(){return Re||(Re=1,Z=Le()),Z}var Be,Ve;function He(){if(Ve)return Be;Ve=1;let e=K(),t=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),n=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function r(e){return e===null?!1:t.exec(e)!==null||n.exec(e)!==null}function i(e){let r=0,i=null,a=t.exec(e);if(a===null&&(a=n.exec(e)),a===null)throw Error(`Date resolve error`);let o=+a[1],s=a[2]-1,c=+a[3];if(!a[4])return new Date(Date.UTC(o,s,c));let l=+a[4],u=+a[5],d=+a[6];if(a[7]){for(r=a[7].slice(0,3);r.length<3;)r+=`0`;r=+r}if(a[9]){let e=+a[10],t=+(a[11]||0);i=(e*60+t)*6e4,a[9]===`-`&&(i=-i)}let f=new Date(Date.UTC(o,s,c,l,u,d,r));return i&&f.setTime(f.getTime()-i),f}function a(e){return e.toISOString()}return Be=new e(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:r,construct:i,instanceOf:Date,represent:a}),Be}var Ue,We;function Ge(){if(We)return Ue;We=1;let e=K();function t(e){return e===`<<`||e===null}return Ue=new e(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:t}),Ue}var Ke,qe;function Je(){if(qe)return Ke;qe=1;let e=K();function t(e){if(e===null)return!1;let t=0,n=e.length;for(let r=0;r<n;r++){let n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`.indexOf(e.charAt(r));if(!(n>64)){if(n<0)return!1;t+=6}}return t%8==0}function n(e){let t=e.replace(/[\r\n=]/g,``),n=t.length,r=0,i=[];for(let e=0;e<n;e++)e%4==0&&e&&(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)),r=r<<6|`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
9
|
+
\r`.indexOf(t.charAt(e));let a=n%4*6;return a===0?(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)):a===18?(i.push(r>>10&255),i.push(r>>2&255)):a===12&&i.push(r>>4&255),new Uint8Array(i)}function r(e){let t=``,n=0,r=e.length,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
10
|
+
\r`;for(let a=0;a<r;a++)a%3==0&&a&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[a];let a=r%3;return a===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):a===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):a===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}function i(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}return Ke=new e(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:t,construct:n,predicate:i,represent:r}),Ke}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;let e=K(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(e===null)return!0;let r=[],i=e;for(let e=0,a=i.length;e<a;e+=1){let a=i[e],o=!1;if(n.call(a)!==`[object Object]`)return!1;let s;for(s in a)if(t.call(a,s)){if(!o)o=!0;else return!1}if(!o)return!1;if(r.indexOf(s)===-1)r.push(s);else return!1}return!0}function i(e){return e===null?[]:e}return Ye=new e(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:r,construct:i}),Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;let e=K(),t=Object.prototype.toString;function n(e){if(e===null)return!0;let n=e,r=Array(n.length);for(let e=0,i=n.length;e<i;e+=1){let i=n[e];if(t.call(i)!==`[object Object]`)return!1;let a=Object.keys(i);if(a.length!==1)return!1;r[e]=[a[0],i[a[0]]]}return!0}function r(e){if(e===null)return[];let t=e,n=Array(t.length);for(let e=0,r=t.length;e<r;e+=1){let r=t[e],i=Object.keys(r);n[e]=[i[0],r[i[0]]]}return n}return Qe=new e(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:n,construct:r}),Qe}var tt,nt;function rt(){if(nt)return tt;nt=1;let e=K(),t=Object.prototype.hasOwnProperty;function n(e){if(e===null)return!0;let n=e;for(let e in n)if(t.call(n,e)&&n[e]!==null)return!1;return!0}function r(e){return e===null?{}:e}return tt=new e(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:n,construct:r}),tt}var it,at;function ot(){return at||(at=1,it=ze().extend({implicit:[He(),Ge()],explicit:[Je(),Ze(),et(),rt()]})),it}var st;function ct(){if(st)return R;st=1;let e=V(),t=U(),n=ue(),r=ot(),i=Object.prototype.hasOwnProperty,a=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,c=/^(?:!|!!|![0-9A-Za-z-]+!)$/,l=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function u(e){return Object.prototype.toString.call(e)}function d(e){return e===10||e===13}function f(e){return e===9||e===32}function p(e){return e===9||e===32||e===10||e===13}function m(e){return e===44||e===91||e===93||e===123||e===125}function h(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function g(e){return e===120?2:e===117?4:e===85?8:0}function _(e){return e>=48&&e<=57?e-48:-1}function v(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
|
|
11
|
+
`;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`
`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}function y(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function b(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}let x=Array(256),S=Array(256);for(let e=0;e<256;e++)x[e]=+!!v(e),S[e]=v(e);function C(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||r,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.maxDepth=typeof t.maxDepth==`number`?t.maxDepth:100,this.maxTotalMergeKeys=typeof t.maxTotalMergeKeys==`number`?t.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function w(e,r){let i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=n(i),new t(r,i)}function T(e,t){throw w(e,t)}function E(e,t){e.onWarning&&e.onWarning.call(null,w(e,t))}function D(e,t,n){let r=e.anchorMapTransactions;if(r.length!==0){let n=r[r.length-1];i.call(n,t)||(n[t]={existed:i.call(e.anchorMap,t),value:e.anchorMap[t]})}e.anchorMap[t]=n}function ee(e){e.anchorMapTransactions.push(Object.create(null))}function te(e){let t=e.anchorMapTransactions.pop(),n=e.anchorMapTransactions;if(n.length===0)return;let r=n[n.length-1],a=Object.keys(t);for(let e=0,n=a.length;e<n;e+=1){let n=a[e];i.call(r,n)||(r[n]=t[n])}}function O(e){let t=e.anchorMapTransactions.pop(),n=Object.keys(t);for(let r=n.length-1;r>=0;--r){let i=t[n[r]];i.existed?e.anchorMap[n[r]]=i.value:delete e.anchorMap[n[r]]}}function k(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function ne(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.tag=t.tag,e.anchor=t.anchor,e.kind=t.kind,e.result=t.result}let A={YAML:function(e,t,n){e.version!==null&&T(e,`duplication of %YAML directive`),n.length!==1&&T(e,`YAML directive accepts exactly one argument`);let r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);r===null&&T(e,`ill-formed argument of the YAML directive`);let i=parseInt(r[1],10),a=parseInt(r[2],10);i!==1&&T(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&E(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){let r;n.length!==2&&T(e,`TAG directive accepts exactly two arguments`);let a=n[0];r=n[1],c.test(a)||T(e,`ill-formed tag handle (first argument) of the TAG directive`),i.call(e.tagMap,a)&&T(e,`there is a previously declared suffix for "`+a+`" tag handle`),l.test(r)||T(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{r=decodeURIComponent(r)}catch{T(e,`tag prefix is malformed: `+r)}e.tagMap[a]=r}};function j(e,t,n,r){if(t<n){let i=e.input.slice(t,n);if(r)for(let t=0,n=i.length;t<n;t+=1){let n=i.charCodeAt(t);n===9||n>=32&&n<=1114111||T(e,`expected valid JSON character`)}else a.test(i)&&T(e,`the stream contains non-printable characters`);e.result+=i}}function M(t,n,r,a){e.isObject(r)||T(t,`cannot merge mappings; the provided source object is unacceptable`);let o=Object.keys(r);for(let e=0,s=o.length;e<s;e+=1){let s=o[e];t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&T(t,`merge keys exceeded maxTotalMergeKeys (`+t.maxTotalMergeKeys+`)`),i.call(n,s)||(b(n,s,r[s]),a[s]=!0)}}function N(e,t,n,r,a,o,s,c,l){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let t=0,n=a.length;t<n;t+=1)Array.isArray(a[t])&&T(e,`nested arrays are not supported inside keys`),typeof a==`object`&&u(a[t])===`[object Object]`&&(a[t]=`[object Object]`)}if(typeof a==`object`&&u(a)===`[object Object]`&&(a=`[object Object]`),a=String(a),t===null&&(t={}),r===`tag:yaml.org,2002:merge`){if(Array.isArray(o))for(let r=0,i=o.length;r<i;r+=1)M(e,t,o[r],n);else M(e,t,o,n)}else!e.json&&!i.call(n,a)&&i.call(t,a)&&(e.line=s||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,T(e,`duplicated mapping key`)),b(t,a,o),delete n[a];return t}function P(e){let t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):T(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function F(e,t,n){let r=0,i=e.input.charCodeAt(e.position);for(;i!==0;){for(;f(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(d(i))for(P(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&E(e,`deficient indentation`),r}function re(e){let t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||p(n)))}function ie(t,n){n===1?t.result+=` `:n>1&&(t.result+=e.repeat(`
|
|
12
|
+
`,n-1))}function ae(e,t,n){let r,i,a,o,s,c,l=e.kind,u=e.result,h=e.input.charCodeAt(e.position);if(p(h)||m(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let t=e.input.charCodeAt(e.position+1);if(p(t)||n&&m(t))return!1}for(e.kind=`scalar`,e.result=``,r=i=e.position,a=!1;h!==0;){if(h===58){let t=e.input.charCodeAt(e.position+1);if(p(t)||n&&m(t))break}else if(h===35){if(p(e.input.charCodeAt(e.position-1)))break}else if(e.position===e.lineStart&&re(e)||n&&m(h))break;else if(d(h)){if(o=e.line,s=e.lineStart,c=e.lineIndent,F(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=i,e.line=o,e.lineStart=s,e.lineIndent=c;break}a&&=(j(e,r,i,!1),ie(e,e.line-o),r=i=e.position,!1),f(h)||(i=e.position+1),h=e.input.charCodeAt(++e.position)}return j(e,r,i,!1),e.result?!0:(e.kind=l,e.result=u,!1)}function I(e,t){let n,r,i=e.input.charCodeAt(e.position);if(i!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39){if(j(e,n,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)n=e.position,e.position++,r=e.position;else return!0}else d(i)?(j(e,n,r,!0),ie(e,F(e,!1,t)),n=r=e.position):e.position===e.lineStart&&re(e)?T(e,`unexpected end of the document within a single quoted scalar`):(e.position++,f(i)||(r=e.position));T(e,`unexpected end of the stream within a single quoted scalar`)}function oe(e,t){let n,r,i,a=e.input.charCodeAt(e.position);if(a!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===34)return j(e,n,e.position,!0),e.position++,!0;else if(a===92){if(j(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),d(a))F(e,!1,t);else if(a<256&&x[a])e.result+=S[a],e.position++;else if((i=g(a))>0){let t=i,n=0;for(;t>0;t--)a=e.input.charCodeAt(++e.position),(i=h(a))>=0?n=(n<<4)+i:T(e,`expected hexadecimal character`);e.result+=y(n),e.position++}else T(e,`unknown escape sequence`);n=r=e.position}else d(a)?(j(e,n,r,!0),ie(e,F(e,!1,t)),n=r=e.position):e.position===e.lineStart&&re(e)?T(e,`unexpected end of the document within a double quoted scalar`):(e.position++,f(a)||(r=e.position));T(e,`unexpected end of the stream within a double quoted scalar`)}function se(e,t){let n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)l=93,f=!1,s=[];else if(v===123)l=125,f=!0,s={};else return!1;for(e.anchor!==null&&D(e,e.anchor,s),v=e.input.charCodeAt(++e.position);v!==0;){if(F(e,!0,t),v=e.input.charCodeAt(e.position),v===l)return e.position++,e.tag=o,e.anchor=c,e.kind=f?`mapping`:`sequence`,e.result=s,!0;n?v===44&&T(e,`expected the node content, but found ','`):T(e,`missed comma between flow collection entries`),g=h=_=null,u=d=!1,v===63&&p(e.input.charCodeAt(e.position+1))&&(u=d=!0,e.position++,F(e,!0,t)),r=e.line,i=e.lineStart,a=e.position,G(e,t,1,!1,!0),g=e.tag,h=e.result,F(e,!0,t),v=e.input.charCodeAt(e.position),(d||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),F(e,!0,t),G(e,t,1,!1,!0),_=e.result),f?N(e,s,m,g,h,_,r,i,a):u?s.push(N(e,null,m,g,h,_,r,i,a)):s.push(h),F(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}T(e,`unexpected end of the stream within a flow collection`)}function L(t,n){let r,i=1,a=!1,o=!1,s=n,c=0,l=!1,u,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind=`scalar`,t.result=``;p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)i===1?i=p===43?3:2:T(t,`repeat of a chomping mode identifier`);else if((u=_(p))>=0)u===0?T(t,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?T(t,`repeat of an indentation width identifier`):(s=n+u-1,o=!0);else break;if(f(p)){do p=t.input.charCodeAt(++t.position);while(f(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!d(p)&&p!==0)}for(;p!==0;){for(P(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!o||t.lineIndent<s)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>s&&(s=t.lineIndent),d(p)){c++;continue}if(!o&&s===0&&T(t,`missing indentation for block scalar`),t.lineIndent<s){i===3?t.result+=e.repeat(`
|
|
13
|
+
`,a?1+c:c):i===1&&a&&(t.result+=`
|
|
14
|
+
`);break}r?f(p)?(l=!0,t.result+=e.repeat(`
|
|
15
|
+
`,a?1+c:c)):l?(l=!1,t.result+=e.repeat(`
|
|
16
|
+
`,c+1)):c===0?a&&(t.result+=` `):t.result+=e.repeat(`
|
|
17
|
+
`,c):t.result+=e.repeat(`
|
|
18
|
+
`,a?1+c:c),a=!0,o=!0,c=0;let n=t.position;for(;!d(p)&&p!==0;)p=t.input.charCodeAt(++t.position);j(t,n,t.position,!1)}return!0}function z(e,t){let n=e.tag,r=e.anchor,i=[],a=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&D(e,e.anchor,i);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,T(e,`tab characters must not be used in indentation`)),o===45&&p(e.input.charCodeAt(e.position+1)));){if(a=!0,e.position++,F(e,!0,-1)&&e.lineIndent<=t){i.push(null),o=e.input.charCodeAt(e.position);continue}let n=e.line;if(G(e,t,3,!1,!0),i.push(e.result),F(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&o!==0)T(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=r,e.kind=`sequence`,e.result=i,!0):!1}function B(e,t,n){let r,i,a,o,s=e.tag,c=e.anchor,l={},u=Object.create(null),d=null,m=null,h=null,g=!1,_=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&D(e,e.anchor,l);let v=e.input.charCodeAt(e.position);for(;v!==0;){!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,T(e,`tab characters must not be used in indentation`));let y=e.input.charCodeAt(e.position+1),b=e.line;if((v===63||v===58)&&p(y))v===63?(g&&(N(e,l,u,d,m,null,i,a,o),d=m=h=null),_=!0,g=!0,r=!0):g?(g=!1,r=!0):T(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=y;else{if(i=e.line,a=e.lineStart,o=e.position,!G(e,n,2,!1,!0))break;if(e.line===b){for(v=e.input.charCodeAt(e.position);f(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),p(v)||T(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(N(e,l,u,d,m,null,i,a,o),d=m=h=null),_=!0,g=!1,r=!1,d=e.tag,m=e.result;else if(_)T(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=s,e.anchor=c,!0}else if(_)T(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=s,e.anchor=c,!0}if((e.line===b||e.lineIndent>t)&&(g&&(i=e.line,a=e.lineStart,o=e.position),G(e,t,4,!0,r)&&(g?m=e.result:h=e.result),g||(N(e,l,u,d,m,h,i,a,o),d=m=h=null),F(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===b||e.lineIndent>t)&&v!==0)T(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&N(e,l,u,d,m,null,i,a,o),_&&(e.tag=s,e.anchor=c,e.kind=`mapping`,e.result=l),_}function ce(e){let t=!1,n=!1,r,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;e.tag!==null&&T(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(t=!0,o=e.input.charCodeAt(++e.position)):o===33?(n=!0,r=`!!`,o=e.input.charCodeAt(++e.position)):r=`!`;let u=e.position;if(t){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(u,e.position),o=e.input.charCodeAt(++e.position)):T(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!p(o);)o===33&&(n?T(e,`tag suffix cannot contain exclamation marks`):(r=e.input.slice(u-1,e.position+1),c.test(r)||T(e,`named tag handle cannot contain such characters`),n=!0,u=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(u,e.position),s.test(a)&&T(e,`tag suffix cannot contain flow indicator characters`)}a&&!l.test(a)&&T(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{T(e,`tag name is malformed: `+a)}return t?e.tag=a:i.call(e.tagMap,r)?e.tag=e.tagMap[r]+a:r===`!`?e.tag=`!`+a:r===`!!`?e.tag=`tag:yaml.org,2002:`+a:T(e,`undeclared tag handle "`+r+`"`),!0}function H(e){let t=e.input.charCodeAt(e.position);if(t!==38)return!1;e.anchor!==null&&T(e,`duplication of an anchor property`),t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!p(t)&&!m(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&T(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(n,e.position),!0}function W(e){let t=e.input.charCodeAt(e.position);if(t!==42)return!1;t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!p(t)&&!m(t);)t=e.input.charCodeAt(++e.position);e.position===n&&T(e,`name of an alias node must contain at least one character`);let r=e.input.slice(n,e.position);return i.call(e.anchorMap,r)||T(e,`unidentified alias "`+r+`"`),e.result=e.anchorMap[r],F(e,!0,-1),!0}function le(e,t,n,r){let i=k(e);return ee(e),ne(e,t),e.tag=null,e.anchor=null,e.kind=null,e.result=null,B(e,n,r)&&e.kind===`mapping`?(te(e),!0):(O(e),ne(e,i),!1)}function G(e,t,n,r,a){let o,s,c=1,l=!1,u=!1,d=null,f,p,m;e.depth>=e.maxDepth&&T(e,`nesting exceeded maxDepth (`+e.maxDepth+`)`),e.depth+=1,e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;let h=o=s=n===4||n===3;if(r&&F(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;;){let n=e.input.charCodeAt(e.position),r=k(e);if(l&&(n===33&&e.tag!==null||n===38&&e.anchor!==null)||!ce(e)&&!H(e))break;d===null&&(d=r),F(e,!0,-1)?(l=!0,s=h,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1}if(s&&=l||a,c===1||n===4){if(p=n===1||n===2?t:t+1,m=e.position-e.lineStart,c===1){if(s&&(z(e,m)||B(e,m,p))||se(e,p))u=!0;else{let t=e.input.charCodeAt(e.position);d!==null&&h&&!s&&t!==124&&t!==62&&le(e,d,d.position-d.lineStart,p)||o&&L(e,p)||I(e,p)||oe(e,p)?u=!0:W(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&T(e,`alias node should not have any properties`)):ae(e,p,n===1)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&D(e,e.anchor,e.result)}}else c===0&&(u=s&&z(e,m))}if(e.tag===null)e.anchor!==null&&D(e,e.anchor,e.result);else if(e.tag===`?`){e.result!==null&&e.kind!==`scalar`&&T(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`);for(let t=0,n=e.implicitTypes.length;t<n;t+=1)if(f=e.implicitTypes[t],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&D(e,e.anchor,e.result);break}}else if(e.tag!==`!`){if(i.call(e.typeMap[e.kind||`fallback`],e.tag))f=e.typeMap[e.kind||`fallback`][e.tag];else{f=null;let t=e.typeMap.multi[e.kind||`fallback`];for(let n=0,r=t.length;n<r;n+=1)if(e.tag.slice(0,t[n].tag.length)===t[n].tag){f=t[n];break}}f||T(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&f.kind!==e.kind&&T(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+f.kind+`", not "`+e.kind+`"`),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),e.anchor!==null&&D(e,e.anchor,e.result)):T(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),--e.depth,e.tag!==null||e.anchor!==null||u}function de(e){let t=e.position,n=!1,r;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(r=e.input.charCodeAt(e.position))!==0&&(F(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||r!==37));){n=!0,r=e.input.charCodeAt(++e.position);let t=e.position;for(;r!==0&&!p(r);)r=e.input.charCodeAt(++e.position);let a=e.input.slice(t,e.position),o=[];for(a.length<1&&T(e,`directive name must not be less than one character in length`);r!==0;){for(;f(r);)r=e.input.charCodeAt(++e.position);if(r===35){do r=e.input.charCodeAt(++e.position);while(r!==0&&!d(r));break}if(d(r))break;for(t=e.position;r!==0&&!p(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}r!==0&&P(e),i.call(A,a)?A[a](e,a,o):E(e,`unknown document directive "`+a+`"`)}F(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,F(e,!0,-1)):n&&T(e,`directives end mark is expected`),G(e,e.lineIndent-1,4,!1,!0),F(e,!0,-1),e.checkLineBreaks&&o.test(e.input.slice(t,e.position))&&E(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&re(e)?e.input.charCodeAt(e.position)===46&&(e.position+=3,F(e,!0,-1)):e.position<e.length-1&&T(e,`end of the stream or a document separator is expected`)}function K(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
19
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let n=new C(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,T(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)de(n);return n.documents}function fe(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);let r=K(e,n);if(typeof t!=`function`)return r;for(let e=0,n=r.length;e<n;e+=1)t(r[e])}function q(e,n){let r=K(e,n);if(r.length!==0){if(r.length===1)return r[0];throw new t(`expected a single document in the stream, but found more`)}}return R.loadAll=fe,R.load=q,R}var lt={},ut;function dt(){if(ut)return lt;ut=1;let e=V(),t=U(),n=ot(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=65279,o={};o[0]=`\\0`,o[7]=`\\a`,o[8]=`\\b`,o[9]=`\\t`,o[10]=`\\n`,o[11]=`\\v`,o[12]=`\\f`,o[13]=`\\r`,o[27]=`\\e`,o[34]=`\\"`,o[92]=`\\\\`,o[133]=`\\N`,o[160]=`\\_`,o[8232]=`\\L`,o[8233]=`\\P`;let s=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],c=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function l(e,t){if(t===null)return{};let n={},r=Object.keys(t);for(let a=0,o=r.length;a<o;a+=1){let o=r[a],s=String(t[o]);o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2));let c=e.compiledTypeMap.fallback[o];c&&i.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s}return n}function u(n){let r,i,a=n.toString(16).toUpperCase();if(n<=255)r=`x`,i=2;else if(n<=65535)r=`u`,i=4;else if(n<=4294967295)r=`U`,i=8;else throw new t(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+r+e.repeat(`0`,i-a.length)+a}function d(t){this.schema=t.schema||n,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=e.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=l(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType===`"`?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer==`function`?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function f(t,n){let r=e.repeat(` `,n),i=0,a=``,o=t.length;for(;i<o;){let e,n=t.indexOf(`
|
|
20
|
+
`,i);n===-1?(e=t.slice(i),i=o):(e=t.slice(i,n+1),i=n+1),e.length&&e!==`
|
|
21
|
+
`&&(a+=r),a+=e}return a}function p(t,n){return`
|
|
22
|
+
`+e.repeat(` `,t.indent*n)}function m(e,t){for(let n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}function h(e){return e===32||e===9}function g(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==a||e>=65536&&e<=1114111}function _(e){return g(e)&&e!==a&&e!==13&&e!==10}function v(e,t,n){let r=_(e),i=r&&!h(e);return(n?r:r&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125)&&e!==35&&!(t===58&&!i)||_(t)&&!h(t)&&e===35||t===58&&i}function y(e){return g(e)&&e!==a&&!h(e)&&e!==45&&e!==63&&e!==58&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125&&e!==35&&e!==38&&e!==42&&e!==33&&e!==124&&e!==61&&e!==62&&e!==39&&e!==34&&e!==37&&e!==64&&e!==96}function b(e){return!h(e)&&e!==58}function x(e,t){let n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function S(e){return/^\n* /.test(e)}function C(e,t,n,r,i,a,o,s){let c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=y(x(e,0))&&b(x(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=x(e,c),!g(l))return 5;h&&=v(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=x(e,c),l===10)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!g(l))return 5;h&&=v(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?1:a===2?5:2:n>9&&S(e)?5:o?a===2?5:2:f?4:3}function w(e,n,r,i,a){e.dump=(function(){if(n.length===0)return e.quotingType===2?`""`:`''`;if(!e.noCompatMode&&(s.indexOf(n)!==-1||c.test(n)))return e.quotingType===2?`"`+n+`"`:`'`+n+`'`;let o=e.indent*Math.max(1,r),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),u=i||e.flowLevel>-1&&r>=e.flowLevel;function d(t){return m(e,t)}switch(C(n,u,e.indent,l,d,e.quotingType,e.forceQuotes&&!i,a)){case 1:return n;case 2:return`'`+n.replace(/'/g,`''`)+`'`;case 3:return`|`+T(n,e.indent)+E(f(n,o));case 4:return`>`+T(n,e.indent)+E(f(D(n,l),o));case 5:return`"`+te(n)+`"`;default:throw new t(`impossible error: invalid scalar style`)}})()}function T(e,t){let n=S(e)?String(t):``,r=e[e.length-1]===`
|
|
23
|
+
`;return n+(r&&(e[e.length-2]===`
|
|
24
|
+
`||e===`
|
|
25
|
+
`)?`+`:r?``:`-`)+`
|
|
26
|
+
`}function E(e){return e[e.length-1]===`
|
|
27
|
+
`?e.slice(0,-1):e}function D(e,t){let n=/(\n+)([^\n]*)/g,r=(function(){let r=e.indexOf(`
|
|
28
|
+
`);return r=r===-1?e.length:r,n.lastIndex=r,ee(e.slice(0,r),t)})(),i=e[0]===`
|
|
29
|
+
`||e[0]===` `,a,o;for(;o=n.exec(e);){let e=o[1],n=o[2];a=n[0]===` `,r+=e+(!i&&!a&&n!==``?`
|
|
30
|
+
`:``)+ee(n,t),i=a}return r}function ee(e,t){if(e===``||e[0]===` `)return e;let n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;for(;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
|
|
31
|
+
`+e.slice(i,a),i=a+1),o=s;return c+=`
|
|
32
|
+
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
|
33
|
+
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}function te(e){let t=``,n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=x(e,r);let i=o[n];!i&&g(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||u(n)}return t}function O(e,t,n){let r=``,i=e.tag;for(let i=0,a=n.length;i<a;i+=1){let a=n[i];e.replacer&&(a=e.replacer.call(n,String(i),a)),(M(e,t,a,!1,!1)||a===void 0&&M(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump)}e.tag=i,e.dump=`[`+r+`]`}function k(e,t,n,r){let i=``,a=e.tag;for(let a=0,o=n.length;a<o;a+=1){let o=n[a];e.replacer&&(o=e.replacer.call(n,String(a),o)),(M(e,t+1,o,!0,!0,!1,!0)||o===void 0&&M(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=p(e,t)),e.dump&&e.dump.charCodeAt(0)===10?i+=`-`:i+=`- `,i+=e.dump)}e.tag=a,e.dump=i||`[]`}function ne(e,t,n){let r=``,i=e.tag,a=Object.keys(n);for(let i=0,o=a.length;i<o;i+=1){let o=``;r!==``&&(o+=`, `),e.condenseFlow&&(o+=`"`);let s=a[i],c=n[s];e.replacer&&(c=e.replacer.call(n,s,c)),M(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+=`? `),o+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),M(e,t,c,!1,!1)&&(o+=e.dump,r+=o))}e.tag=i,e.dump=`{`+r+`}`}function A(e,n,r,i){let a=``,o=e.tag,s=Object.keys(r);if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys==`function`)s.sort(e.sortKeys);else if(e.sortKeys)throw new t(`sortKeys must be a boolean or a function`);for(let t=0,o=s.length;t<o;t+=1){let o=``;(!i||a!==``)&&(o+=p(e,n));let c=s[t],l=r[c];if(e.replacer&&(l=e.replacer.call(r,c,l)),!M(e,n+1,c,!0,!0,!0))continue;let u=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024;u&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`?`:o+=`? `),o+=e.dump,u&&(o+=p(e,n)),M(e,n+1,l,!0,u)&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`:`:o+=`: `,o+=e.dump,a+=o)}e.tag=o,e.dump=a||`{}`}function j(e,n,a){let o=a?e.explicitTypes:e.implicitTypes;for(let s=0,c=o.length;s<c;s+=1){let c=o[s];if((c.instanceOf||c.predicate)&&(!c.instanceOf||typeof n==`object`&&n instanceof c.instanceOf)&&(!c.predicate||c.predicate(n))){if(e.tag=a?c.multi&&c.representName?c.representName(n):c.tag:`?`,c.represent){let a=e.styleMap[c.tag]||c.defaultStyle,o;if(r.call(c.represent)===`[object Function]`)o=c.represent(n,a);else if(i.call(c.represent,a))o=c.represent[a](n,a);else throw new t(`!<`+c.tag+`> tag resolver accepts not "`+a+`" style`);e.dump=o}return!0}}return!1}function M(e,n,i,a,o,s,c){e.tag=null,e.dump=i,j(e,i,!1)||j(e,i,!0);let l=r.call(e.dump),u=a;a&&=e.flowLevel<0||e.flowLevel>n;let d=l===`[object Object]`||l===`[object Array]`,f,p;if(d&&(f=e.duplicates.indexOf(i),p=f!==-1),(e.tag!==null&&e.tag!==`?`||p||e.indent!==2&&n>0)&&(o=!1),p&&e.usedDuplicates[f])e.dump=`*ref_`+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),l===`[object Object]`)a&&Object.keys(e.dump).length!==0?(A(e,n,e.dump,o),p&&(e.dump=`&ref_`+f+e.dump)):(ne(e,n,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(l===`[object Array]`)a&&e.dump.length!==0?(e.noArrayIndent&&!c&&n>0?k(e,n-1,e.dump,o):k(e,n,e.dump,o),p&&(e.dump=`&ref_`+f+e.dump)):(O(e,n,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(l===`[object String]`)e.tag!==`?`&&w(e,e.dump,n,s,u);else if(l===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new t(`unacceptable kind of an object to dump `+l)}if(e.tag!==null&&e.tag!==`?`){let t=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`);t=e.tag[0]===`!`?`!`+t:t.slice(0,18)===`tag:yaml.org,2002:`?`!!`+t.slice(18):`!<`+t+`>`,e.dump=t+` `+e.dump}}return!0}function N(e,t){let n=[],r=[];P(e,n,r);let i=r.length;for(let e=0;e<i;e+=1)t.duplicates.push(n[r[e]]);t.usedDuplicates=Array(i)}function P(e,t,n){if(typeof e==`object`&&e){let r=t.indexOf(e);if(r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(let r=0,i=e.length;r<i;r+=1)P(e[r],t,n);else{let r=Object.keys(e);for(let i=0,a=r.length;i<a;i+=1)P(e[r[i]],t,n)}}}function F(e,t){t||={};let n=new d(t);n.noRefs||N(e,n);let r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),M(n,0,r,!0,!0)?n.dump+`
|
|
34
|
+
`:``}return lt.dump=F,lt}var ft;function pt(){if(ft)return L;ft=1;let e=ct(),t=dt();function n(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}return L.Type=K(),L.Schema=J(),L.FAILSAFE_SCHEMA=Se(),L.JSON_SCHEMA=Le(),L.CORE_SCHEMA=ze(),L.DEFAULT_SCHEMA=ot(),L.load=e.load,L.loadAll=e.loadAll,L.dump=t.dump,L.YAMLException=U(),L.types={binary:Je(),float:Pe(),map:ye(),null:Te(),pairs:et(),set:rt(),timestamp:He(),bool:Oe(),int:je(),merge:Ge(),omap:Ze(),seq:_e(),str:he()},L.safeLoad=n(`safeLoad`,`load`),L.safeLoadAll=n(`safeLoadAll`,`loadAll`),L.safeDump=n(`safeDump`,`dump`),L}var{Type:mt,Schema:ht,FAILSAFE_SCHEMA:gt,JSON_SCHEMA:_t,CORE_SCHEMA:vt,DEFAULT_SCHEMA:yt,load:bt,loadAll:xt,dump:St,YAMLException:Ct,types:wt,safeLoad:Tt,safeLoadAll:Et,safeDump:Dt}=se(pt()),Ot=3e3,kt=9999,At=`openpond.yaml`,jt=[`google`,`github`,`x`],Mt=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),Nt=r(u().trim().min(1).max(1e3)).max(50),Pt=u().trim().min(1).max(4096).refine(nn,{message:`path must be a relative workspace path`}),Ft=u().trim().min(1).max(500).refine(e=>!e.includes(`\0`)&&!/\s/.test(e),`image ref must be a single OCI reference`),It=u().trim().regex(/^sha256:[0-9a-f]{64}$/i),Lt=u().trim().min(1).max(500).refine(e=>e.startsWith(`/`)&&!e.includes(`\0`),`workspaceRoot must be an absolute guest path`),Rt=o({ref:Ft,digest:It.optional(),registrySecretRef:u().trim().min(1).max(500).optional(),platform:i(`linux/amd64`).optional(),workspaceRoot:Lt.optional()}).strict(),zt=o({context:Pt.default(`.`),path:Pt.default(`Dockerfile`),target:u().trim().min(1).max(191).optional(),buildArgs:a(u().max(191),u().max(500)).optional(),registrySecretRefs:r(u().trim().min(1).max(500)).max(10).optional(),platform:i(`linux/amd64`).optional(),workspaceRoot:Lt.optional()}).strict(),Bt=o({base:u().trim().min(1).max(120).optional(),snapshot:u().trim().min(1).max(191).optional(),image:Rt.optional(),dockerfile:zt.optional()}).strict().superRefine((e,t)=>{[e.base,e.snapshot,e.image,e.dockerfile].filter(Boolean).length!==1&&t.addIssue({code:I.custom,message:`runtime must declare exactly one of base, snapshot, image, or dockerfile`})}),Vt=o({cpu:c().positive().max(8).optional(),memoryGb:c().positive().max(32).optional(),diskGb:c().positive().max(100).optional()}).strict(),Ht=o({provider:l(jt),scopes:r(u().trim().min(1).max(200)).max(100).default([]),capabilities:r(u().trim().min(1).max(200)).max(100).default([])}).strict(),Ut=o({models:r(u().trim().min(1).max(200)).max(100).default([]),scopes:r(u().trim().min(1).max(200)).max(100).default([])}).strict(),Wt=o({opchat:Ut.optional()}).catchall(a(u(),d())).default({}),Gt=o({name:u().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:u().trim().min(1).max(256).optional(),storageGb:c().int().positive().max(100).optional(),deleteOnSandboxDelete:s().optional()}).strict(),Kt=o({port:c().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`preview port is reserved`}),protocol:i(`http`).default(`http`),label:u().trim().min(1).max(80).optional(),access:l([`private`,`public`]).default(`private`),path:u().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`preview path must start with /`}).default(`/`)}).strict(),qt=o({command:u().trim().min(1).max(1e3),cwd:Pt.optional(),timeoutSeconds:c().int().positive().max(86400).optional(),requiresStart:s().default(!1),ports:r(Kt).max(20).default([]),artifactPaths:r(Pt).max(100).default([])}).strict(),Jt=qt.extend({name:u().trim().min(1).max(80)}).strict(),Yt=o({name:u().trim().min(1).max(80).optional(),service:u().trim().min(1).max(80).optional(),port:c().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`app MCP port is reserved`}),path:u().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`app MCP path must start with /`}).default(`/mcp`)}).strict(),Xt=o({name:u().trim().min(1).max(80).optional(),port:c().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`validation probe port is reserved`}),path:u().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`validation probe path must start with /`}).default(`/`),expectedStatus:c().int().min(100).max(599).default(200)}).strict(),Zt=a(u(),d()).refine(e=>e.type===`object`,`input schema must be a JSON schema object`),Qt=o({name:u().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:s().default(!1),secret:s().default(!0),description:u().trim().max(500).optional()}).strict(),$t=u().trim().min(1).max(120),en=o({name:u().trim().min(1).max(120),description:u().trim().max(500).optional(),cron:u().trim().min(1).max(500).optional(),rate:u().trim().min(1).max(500).optional(),once:$t.optional(),scheduleType:l([`rate`,`cron`,`once`]).optional(),scheduleExpression:u().trim().min(1).max(500).optional(),timezone:u().trim().min(1).max(100).optional(),enabled:s().default(!0),startAt:$t.optional(),endAt:$t.optional(),maxRuns:c().int().positive().nullable().optional(),runtimePolicy:l([`run_and_stop`,`run_and_archive`,`run_and_delete`,`use_existing_running`]).default(`run_and_stop`),action:u().trim().min(1).max(120).optional(),actionName:u().trim().min(1).max(120).optional(),command:u().trim().min(1).max(2e3).optional(),target:o({kind:l([`start`,`action`,`service`,`command`]).optional(),name:u().trim().min(1).max(120).optional(),actionName:u().trim().min(1).max(120).optional(),command:u().trim().min(1).max(2e3).optional(),requiresStart:s().optional()}).strict().optional(),requiresStart:s().optional(),budget:o({maxUsd:u().trim().min(1).max(40).optional()}).strict().optional(),resources:Vt.optional(),quotas:a(u(),d()).optional(),lifecycle:a(u(),d()).optional(),retentionPolicy:a(u(),d()).optional(),env:r(o({name:u().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:u().optional(),secretRef:u().optional()}).strict()).max(100).optional(),integrationLeases:r(a(u(),d())).max(20).optional(),metadata:a(u(),d()).optional()}).strict().superRefine((e,t)=>{[e.cron,e.rate,e.once,e.scheduleExpression].filter(e=>typeof e==`string`&&e.trim()).length!==1&&t.addIssue({code:I.custom,path:[`scheduleExpression`],message:`schedule must declare exactly one of cron, rate, once, or scheduleExpression`}),e.scheduleExpression&&!e.scheduleType&&t.addIssue({code:I.custom,path:[`scheduleType`],message:`scheduleType is required with scheduleExpression`});let n=e.command??e.target?.command??null,r=e.target?.name??null,i=e.actionName??e.action??e.target?.actionName??(e.target?.kind===`action`?r:null),a=e.target?.kind??(n?`command`:`action`);a===`action`&&!i&&t.addIssue({code:I.custom,path:[`action`],message:`schedule action target is required`}),a===`service`&&!r&&t.addIssue({code:I.custom,path:[`target`,`name`],message:`schedule service target name is required`}),a===`command`&&!n&&t.addIssue({code:I.custom,path:[`command`],message:`schedule command target is required`})});o({schemaVersion:i(1),name:u().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:u().trim().min(1).max(40),useCase:u().trim().min(1).max(80),description:u().trim().min(1).max(500),runtime:Bt,resources:Vt.optional(),setup:o({commands:Nt.default([])}).strict().default({commands:[]}),validation:o({commands:Nt.min(1),probes:r(Xt).max(20).default([])}).strict(),start:qt,actions:r(Jt).max(20).default([]),services:r(Jt).max(20).default([]),schedules:r(en).max(20).default([]),mcp:o({endpoints:r(Yt).max(10).default([])}).strict().default({endpoints:[]}),volumes:r(Gt).max(5).default([]),integrations:o({requiredLeases:r(Ht).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:Wt,inputs:o({schema:Zt.default({type:`object`}),env:r(Qt).max(100).default([])}).strict().default({schema:{type:`object`},env:[]}),artifacts:o({paths:r(Pt).max(100).default([])}).strict().default({paths:[]}),network:o({egress:l([`restricted`,`allow`,`block`]).default(`restricted`)}).strict().default({egress:`restricted`})}).strict().superRefine((e,t)=>{an(e,t),rn(t,e.volumes.flatMap(e=>e.name?[e.name]:[]),`volume names must be unique`,`volumes`),on(e,t),sn(e,t),cn(e,t),ln(e,t)}),o({path:u(),message:u(),code:u()});function tn(e){return[{kind:`start`,name:`start`,...e.start,artifactPaths:dn(e.start,e)},...e.actions.map(t=>({kind:`action`,name:t.name,command:t.command,cwd:t.cwd,timeoutSeconds:t.timeoutSeconds,requiresStart:t.requiresStart,ports:t.ports,artifactPaths:dn(t,e)})),...e.services.map(t=>({kind:`service`,name:t.name,command:t.command,cwd:t.cwd,timeoutSeconds:t.timeoutSeconds,requiresStart:t.requiresStart,ports:t.ports,artifactPaths:dn(t,e)}))]}function nn(e){return!e.includes(`\0`)&&!e.startsWith(`/`)&&!e.split(/[\\/]+/).some(e=>e===`..`||e===``)}function rn(e,t,n,r){let i=new Set;for(let a of t){if(i.has(a)){e.addIssue({code:I.custom,path:[r],message:n});return}i.add(a)}}function an(e,t){rn(t,[`start`,...e.actions.map(e=>e.name),...e.services.map(e=>e.name)],`start, action, and service names must be unique`,`actions`)}function on(e,t){let n=un(e.inputs.schema.properties),r=new Set(e.volumes.map(e=>e.name).filter(e=>!!e));for(let[e,i]of Object.entries(n)){let n=un(i),a=un(n[`x-openpond-upload`]??n.xOpenPondUpload),o=typeof a.targetPath==`string`&&a.targetPath.trim()?a.targetPath.trim():typeof a.path==`string`&&a.path.trim()?a.path.trim():``;if(!o)continue;let s=o.replace(/^workspace\//,``).replace(/^\/+/,``).replace(/\/+$/,``);if(!nn(s)){t.addIssue({code:I.custom,path:[`inputs`,`schema`,`properties`,e,`x-openpond-upload`,`targetPath`],message:`upload target must be a relative workspace path`});continue}let c=s.split(`/`);c[0]===`volumes`&&(!c[1]||!r.has(c[1]))&&t.addIssue({code:I.custom,path:[`inputs`,`schema`,`properties`,e,`x-openpond-upload`,`targetPath`],message:`upload target references an undeclared volume`})}}function sn(e,t){rn(t,e.inputs.env.map(e=>e.name),`env input names must be unique`,`inputs`)}function cn(e,t){let n=new Map(e.services.map(e=>[e.name,new Set(e.ports.map(e=>e.port))])),r=new Set([...e.start.ports.map(e=>e.port),...e.services.flatMap(e=>e.ports.map(e=>e.port))]);for(let[i,a]of e.mcp.endpoints.entries())if(a.service){let e=n.get(a.service);if(!e){t.addIssue({code:I.custom,path:[`mcp`,`endpoints`,i,`service`],message:`app MCP service does not exist: ${a.service}`});continue}e.has(a.port)||t.addIssue({code:I.custom,path:[`mcp`,`endpoints`,i,`port`],message:`app MCP port ${a.port} is not declared on service ${a.service}`})}else r.has(a.port)||t.addIssue({code:I.custom,path:[`mcp`,`endpoints`,i,`port`],message:`app MCP port ${a.port} is not declared on start or services`})}function ln(e,t){let n=new Set(e.actions.map(e=>e.name)),r=new Set(e.services.map(e=>e.name));for(let[i,a]of e.schedules.entries()){let e=a.command??a.target?.command??null;if(a.target?.kind===`command`||e)continue;let o=a.actionName??a.action??a.target?.actionName??(a.target?.kind===`action`?a.target?.name:null);if(o&&!n.has(o)&&t.addIssue({code:I.custom,path:[`schedules`,i,`action`],message:`schedule action target does not exist: ${o}`}),a.target?.kind===`service`){let e=a.target.name??``;e&&!r.has(e)&&t.addIssue({code:I.custom,path:[`schedules`,i,`target`,`name`],message:`schedule service target does not exist: ${e}`})}}}function un(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function dn(e,t){return e.artifactPaths.length>0?e.artifactPaths:t.artifacts.paths}var fn=f(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),Q=e(t(),1);function pn(e){let t=Fn(Fn(e?.data).preview);return(typeof t.url==`string`?t.url.trim():``)||null}function mn(){let e=window.open(``,`_blank`);return e?(e.document.write(`<!doctype html><html data-theme="${A()}"><head><title>Opening sandbox preview</title><style>${E}</style></head><body style="margin:0;background:var(--surface-page);color:var(--text-primary);font:14px system-ui,sans-serif;display:grid;place-items:center;height:100vh;">Opening sandbox preview...</body></html>`),e.document.close(),e):null}function hn(e,t){t?e?(e.opener=null,e.location.href=t):window.open(t,`_blank`,`noopener,noreferrer`):e?.close()}function gn(e){let t=vn(e),n=yn(Fn(e?.resources)),r=Fn(Fn(e?.inputs).schema),i=Fn(r.properties),a=new Set(Nn(r.required)),o=[],s=[];for(let[e,t]of Object.entries(i)){let n=Fn(t),r=Fn(n[`x-openpond-upload`]??n.xOpenPondUpload),i=typeof n.type==`string`?n.type:`string`,c=Fn(n.items),l=Dn(n,r),u=n.format===`file`||r.enabled===!0||i===`array`&&c.format===`file`,d=typeof n.title==`string`&&n.title.trim()?n.title.trim():Pn(e);u?s.push({name:e,label:d,required:a.has(e),multiple:i===`array`||r.multiple===!0,accept:On(r,n),targetPath:kn(r,e),targetNames:l}):(i===`string`||i===`number`||i===`integer`||i===`boolean`)&&o.push({name:e,label:d,required:a.has(e),type:i,defaultValue:typeof n.default==`string`||typeof n.default==`number`||typeof n.default==`boolean`?String(n.default):``,targetNames:l})}return{entrypoints:t,scalarInputs:o,fileInputs:s,envInputs:xn(e),resources:n,volumes:bn(e,s),schedules:Sn(e)}}function _n(e,t){let n=t.trim();return e.filter(e=>!e.targetNames||e.targetNames.length===0||e.targetNames.includes(n))}function vn(e){return e?tn(e).flatMap(e=>{if(e.kind===`action`)return[];let t=e.name.trim(),n=e.command.trim(),r=jn(e.timeoutSeconds),i=e.ports.flatMap(e=>{let t=jn(e.port);return t?[{port:t,label:typeof e.label==`string`&&e.label.trim()?e.label.trim():`web`,access:e.access===`public`?`public`:`private`,path:typeof e.path==`string`&&e.path.trim()?e.path.trim():`/`}]:[]});return t&&n?[{name:t,command:n,timeoutSeconds:r,ports:i}]:[]}):[]}function yn(e){return{cpu:An(e.cpu)??1,memoryGb:An(e.memoryGb)??1,diskGb:An(e.diskGb)??8}}function bn(e,t){let n=Array.isArray(e?.volumes)?e.volumes:[];if(n.length>0)return n.map((e,t)=>{let n=t===0?`volume`:`volume-${t+1}`,r=typeof e.name==`string`&&e.name.trim()?e.name.trim():n;return{name:r,mountPath:typeof e.mountPath==`string`&&e.mountPath.trim()?e.mountPath.trim():`/workspace/volumes/${r}`,...jn(e.storageGb)?{storageGb:jn(e.storageGb)??void 0}:{},deleteOnSandboxDelete:e.deleteOnSandboxDelete===!0}});let r=t.find(e=>e.targetPath.startsWith(`volumes/`));if(!r)return[];let[,i=`volume`]=r.targetPath.split(`/`);return[{name:i,mountPath:`/workspace/volumes/${i}`,storageGb:8,deleteOnSandboxDelete:!1}]}function xn(e){return(Array.isArray(e?.inputs.env)?e.inputs.env:[]).flatMap(e=>{let t=typeof e.name==`string`?e.name.trim():``;return t?[{name:t,required:e.required===!0,secret:e.secret!==!1,description:typeof e.description==`string`?e.description.trim():``}]:[]})}function Sn(e){return e?.schedules?.length?e.schedules.flatMap(t=>{let n=typeof t.name==`string`?t.name.trim():``,r=Cn(t);if(!n||!r.scheduleExpression)return[];try{return[{name:n,...typeof t.description==`string`&&t.description.trim()?{description:t.description.trim()}:{},enabled:!1,...r,...typeof t.timezone==`string`&&t.timezone.trim()?{timezone:t.timezone.trim()}:{},...typeof t.startAt==`string`&&t.startAt.trim()?{startAt:t.startAt.trim()}:{},...typeof t.endAt==`string`&&t.endAt.trim()?{endAt:t.endAt.trim()}:{},...typeof t.maxRuns==`number`&&Number.isInteger(t.maxRuns)&&t.maxRuns>0?{maxRuns:t.maxRuns}:{},runtimePolicy:t.runtimePolicy,target:wn(e,t),...t.budget?{budget:t.budget}:{},...t.resources?{resources:t.resources}:{},...t.quotas?{quotas:t.quotas}:{},...t.lifecycle?{lifecycle:t.lifecycle}:{},...t.retentionPolicy?{retentionPolicy:t.retentionPolicy}:{},...t.env?{env:t.env}:{},...t.integrationLeases?{integrationLeases:t.integrationLeases}:{},metadata:{...Fn(t.metadata),manifestScheduleName:n,source:`openpond-app-sandbox-template-start`}}]}catch{return[]}}):[]}function Cn(e){return e.scheduleExpression?{scheduleType:e.scheduleType??`cron`,scheduleExpression:e.scheduleExpression}:e.rate?{scheduleType:`rate`,scheduleExpression:/^rate\(/i.test(e.rate)?e.rate:`rate(${e.rate})`}:e.once?{scheduleType:`once`,scheduleExpression:/^at\(/i.test(e.once)?e.once:`at(${e.once})`}:{scheduleType:`cron`,scheduleExpression:e.cron??``}}function wn(e,t){let n=t.command??t.target?.command??null;if(n)return{kind:`command`,command:n,requiresStart:t.requiresStart??t.target?.requiresStart??!1};let r=t.target?.kind??`action`;if(r===`start`)return{kind:`command`,command:e.start.command,requiresStart:t.requiresStart??t.target?.requiresStart??e.start.requiresStart??!1};if(r===`service`){let n=t.target?.name??``,r=e.services.find(e=>e.name===n);if(!r)throw Error(`schedule_service_target_missing`);return{kind:`command`,command:r.command,requiresStart:t.requiresStart??t.target?.requiresStart??r.requiresStart??!1}}let i=t.actionName??t.action??t.target?.actionName??(t.target?.kind===`action`?t.target?.name:void 0),a=e.actions.find(e=>e.name===i);if(!a)throw Error(`schedule_action_target_missing`);return{kind:`command`,command:a.command,requiresStart:t.requiresStart??t.target?.requiresStart??a.requiresStart??!1}}function Tn(e,t){return e.flatMap(e=>{let n=(t[e.name]??``).trim();return n?[{name:e.name,secretRef:n}]:[]})}function En(e,t){let n={};for(let r of e){let e=t[r.name]??``;if(e.trim()||r.required){if(r.type===`boolean`)n[r.name]=e===`true`;else if(r.type===`number`||r.type===`integer`){let t=Number(e);Number.isFinite(t)&&(n[r.name]=r.type===`integer`?Math.trunc(t):t)}else n[r.name]=e}}return n}function Dn(e,t){let n=Nn(e[`x-openpond-targets`]??e.xOpenPondTargets??t.targets??t.actions).map(e=>e.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:null}function On(e,t){return typeof e.accept==`string`?e.accept.trim():Array.isArray(e.accept)?e.accept.filter(e=>typeof e==`string`).join(`,`):typeof t.accept==`string`?t.accept.trim():``}function kn(e,t){return(typeof e.targetPath==`string`&&e.targetPath.trim()?e.targetPath.trim():typeof e.path==`string`&&e.path.trim()?e.path.trim():`uploads/${t}`).replace(/^\/+/,``).replace(/^workspace\//,``).replace(/\/+$/,``)}function An(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:null}function jn(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function Mn(e,t){return[t,...e.slice(1)]}function Nn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Pn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Fn(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var $=n();function In({busy:e,defaultRepoUrl:t,projectName:n,commitBeforeCreate:r,templateManifest:i,uploadBeforeCreate:a,onClose:o,onSubmit:s}){let c=(0,Q.useMemo)(()=>gn(i),[i]),l=c.entrypoints[0]??null,[u,d]=(0,Q.useState)(t),[f,p]=(0,Q.useState)(l?.name??``),[h,g]=(0,Q.useState)(l?.command??``),[_,v]=(0,Q.useState)(l?.timeoutSeconds?String(l.timeoutSeconds):``),[y,b]=(0,Q.useState)(`Update ${n}`),[x,S]=(0,Q.useState)(`0.05`),[w,T]=(0,Q.useState)(()=>Object.fromEntries(c.scalarInputs.map(e=>[e.name,e.defaultValue]))),[E,D]=(0,Q.useState)(()=>Object.fromEntries(c.envInputs.map(e=>[e.name,``]))),[ee,te]=(0,Q.useState)({}),O=c.volumes[0]??null,[k,ne]=(0,Q.useState)(c.volumes.length>0||c.fileInputs.length>0),[A,M]=(0,Q.useState)(O?.name??`volume`),[N,P]=(0,Q.useState)(O?.mountPath??`/workspace/volumes/volume`),[F,re]=(0,Q.useState)(String(O?.storageGb??8)),[ie,ae]=(0,Q.useState)(!(O?.deleteOnSandboxDelete??!1)),[I,oe]=(0,Q.useState)(c.schedules),se=c.entrypoints.find(e=>e.name===f)??l,L=se?.ports??[],R=L[0]??null,[z,B]=(0,Q.useState)(!!R),[V,ce]=(0,Q.useState)(R?String(R.port):``),H=Number(V),U=Number(x),W=Number(F),le=Number(_),ue=!_.trim()||Number.isInteger(le)&&le>0&&le<=86400,G=!z||Number.isInteger(H)&&H>=3e3&&H<=9999&&L.some(e=>e.port===H),de=Number.isFinite(U)&&U>0,K=!k||Number.isInteger(W)&&W>0,fe=I.every(e=>!e.enabled||!!e.scheduleExpression.trim()),q=_n(c.scalarInputs,f),J=_n(c.fileInputs,f),pe=c.envInputs.every(e=>!e.required||!!(E[e.name]??``).trim()),me=c.envInputs.filter(e=>e.required&&!(E[e.name]??``).trim()),he=(a||!!u.trim())&&!!h.trim()&&de&&ue&&K&&q.every(e=>!e.required||!!(w[e.name]??``).trim())&&J.every(e=>!e.required||(ee[e.name]?.length??0)>0)&&pe&&fe&&G;function ge(e){p(e);let t=c.entrypoints.find(t=>t.name===e);if(!t)return;g(t.command),v(t.timeoutSeconds?String(t.timeoutSeconds):``);let n=t.ports[0]??null;ce(n?String(n.port):``),B(!!n)}function Y(e,t){T(n=>({...n,[e]:t}))}function _e(e,t){D(n=>({...n,[e]:t}))}function ve(e,t){let n=Array.from(t.target.files??[]);te(t=>({...t,[e.name]:e.multiple?n:n.slice(0,1)}))}function X(e,t){oe(n=>n.map((n,r)=>r===e?{...n,...t}:n))}function ye(t){t.preventDefault(),he&&!e&&s({repoUrl:u.trim(),command:h.trim(),entrypointName:f,commitMessage:y.trim(),budgetUsd:x.trim(),params:En(q,w),env:Tn(c.envInputs,E),timeoutSeconds:_.trim()&&Number.isInteger(le)?le:se?.timeoutSeconds??null,uploads:J.flatMap(e=>{let t=ee[e.name]??[];return t.length>0?[{inputName:e.name,label:e.label,targetPath:e.targetPath,multiple:e.multiple,files:t}]:[]}),resources:c.resources,volumes:k?Mn(c.volumes,{...A.trim()?{name:A.trim()}:{},...N.trim()?{mountPath:N.trim()}:{},...Number.isInteger(W)&&W>0?{storageGb:W}:{},deleteOnSandboxDelete:!ie}):[],schedules:I.filter(e=>e.enabled),openPreview:z,previewPort:z?H:null,previewLabel:L.find(e=>e.port===H)?.label??`web`,previewAccess:L.find(e=>e.port===H)?.access??`private`})}return(0,$.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,$.jsxs)(`form`,{className:`git-dialog run-once-dialog sandbox-start-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Start sandbox`,onSubmit:ye,children:[(0,$.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,title:`Close`,"aria-label":`Close`,onClick:o,children:(0,$.jsx)(C,{size:15})}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-heading`,children:[(0,$.jsx)(`div`,{className:`git-dialog-icon`,children:(0,$.jsx)(j,{size:18})}),(0,$.jsx)(`h2`,{children:`Start sandbox`}),(0,$.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,$.jsx)(`span`,{children:`Project`}),(0,$.jsx)(`strong`,{children:n})]})]}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-body`,children:[a?null:(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Repository`}),(0,$.jsx)(`input`,{disabled:e,value:u,onChange:e=>d(e.target.value)})]}),r?(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Commit message`}),(0,$.jsx)(`input`,{disabled:e,value:y,onChange:e=>b(e.target.value)})]}):null,c.entrypoints.length>0?(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Run target`}),(0,$.jsx)(`select`,{disabled:e,value:f,onChange:e=>ge(e.target.value),children:c.entrypoints.map(e=>(0,$.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}):null,(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Shell command`}),(0,$.jsx)(`input`,{disabled:e,value:h,onChange:e=>g(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Timeout seconds`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`numeric`,value:_,onChange:e=>v(e.target.value)})]}),q.map(t=>t.type===`boolean`?(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:(w[t.name]??``)===`true`,disabled:e,type:`checkbox`,onChange:e=>Y(t.name,e.target.checked?`true`:`false`)}),(0,$.jsx)(`span`,{}),t.label]},t.name):(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{disabled:e,inputMode:t.type===`number`||t.type===`integer`?`decimal`:void 0,value:w[t.name]??``,onChange:e=>Y(t.name,e.target.value)})]},t.name)),J.map(t=>(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{accept:t.accept||void 0,disabled:e,multiple:t.multiple,type:`file`,onChange:e=>ve(t,e)})]},t.name)),c.envInputs.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-env-section`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Environment`}),me.length>0?(0,$.jsxs)(`p`,{className:`sandbox-start-env-warning`,role:`status`,children:[`Required sandbox secret ref missing: `,me.map(e=>e.name).join(`, `)]}):null,c.envInputs.map(t=>{let n=E[t.name]??``,r=t.required&&!n.trim(),i=`sandbox-env-${t.name}-description`;return(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsxs)(`span`,{children:[t.name,t.required?` *`:``]}),(0,$.jsx)(`input`,{"aria-describedby":i,"aria-invalid":r,disabled:e,placeholder:`openpond://secret/...`,value:n,onChange:e=>_e(t.name,e.target.value)}),(0,$.jsx)(`small`,{id:i,children:r?`Add a sandbox secret ref before starting.`:t.description||`Sandbox secret ref only.`})]},t.name)})]}):null,J.length>0||c.volumes.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:k,disabled:e,type:`checkbox`,onChange:e=>ne(e.target.checked)}),(0,$.jsx)(`span`,{}),`Mount volume`]}),k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`run-once-dialog-grid`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Volume`}),(0,$.jsx)(`input`,{disabled:e,value:A,onChange:e=>M(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Storage GiB`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`numeric`,value:F,onChange:e=>re(e.target.value)})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Mount path`}),(0,$.jsx)(`input`,{disabled:e,value:N,onChange:e=>P(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:ie,disabled:e,type:`checkbox`,onChange:e=>ae(e.target.checked)}),(0,$.jsx)(`span`,{}),`Keep volume`]})]}):null]}):null,I.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-schedules`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Schedules`}),I.map((t,n)=>(0,$.jsxs)(`div`,{className:`sandbox-start-schedule-row`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:t.enabled,disabled:e,type:`checkbox`,onChange:e=>X(n,{enabled:e.target.checked})}),(0,$.jsx)(`span`,{}),t.name]}),(0,$.jsxs)(`div`,{className:`run-once-dialog-grid`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Type`}),(0,$.jsxs)(`select`,{disabled:e||!t.enabled,value:t.scheduleType,onChange:e=>X(n,{scheduleType:e.target.value}),children:[(0,$.jsx)(`option`,{value:`rate`,children:`Rate`}),(0,$.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,$.jsx)(`option`,{value:`once`,children:`Once`})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Max runs`}),(0,$.jsx)(`input`,{disabled:e||!t.enabled,inputMode:`numeric`,value:t.maxRuns??``,onChange:e=>{let t=Number(e.target.value);X(n,{maxRuns:Number.isInteger(t)&&t>0?t:null})}})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Expression`}),(0,$.jsx)(`input`,{disabled:e||!t.enabled,value:t.scheduleExpression,onChange:e=>X(n,{scheduleExpression:e.target.value})})]})]},t.name))]}):null,(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Budget`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`decimal`,value:x,onChange:e=>S(e.target.value)})]}),L.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:z,disabled:e,type:`checkbox`,onChange:e=>B(e.target.checked)}),(0,$.jsx)(`span`,{}),`Open preview`]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Preview port`}),(0,$.jsx)(`select`,{disabled:e||!z,value:V,onChange:e=>ce(e.target.value),children:L.map(e=>(0,$.jsx)(`option`,{value:e.port,children:e.label?`${e.label} (${e.port})`:e.port},e.port))})]})]}):null]}),(0,$.jsxs)(`div`,{className:`git-dialog-footer sandbox-start-dialog-footer`,children:[(0,$.jsx)(`button`,{className:`git-dialog-secondary`,disabled:e,type:`button`,onClick:o,children:`Cancel`}),(0,$.jsxs)(`button`,{className:`git-dialog-primary`,disabled:e||!he,title:pe?void 0:`Required sandbox secret refs are missing.`,type:`submit`,children:[(0,$.jsx)(m,{size:14}),`Start`]})]})]})})}function Ln({busy:e,projectName:t,templateManifest:n,onClose:r,onSubmit:i}){let a=(0,Q.useMemo)(()=>gn(n),[n]),o=(0,Q.useMemo)(()=>n?tn(n).filter(e=>e.kind===`action`):[],[n]),s=o[0]??null,[c,l]=(0,Q.useState)(`sandbox`),[u,d]=(0,Q.useState)(s?.name??``),[f,p]=(0,Q.useState)(()=>Object.fromEntries(a.scalarInputs.map(e=>[e.name,e.defaultValue]))),[m,h]=(0,Q.useState)(()=>Object.fromEntries(a.envInputs.map(e=>[e.name,``]))),[g,_]=(0,Q.useState)({}),y=_n(a.scalarInputs,u),b=_n(a.fileInputs,u),x=c===`sandbox`?a.envInputs:[],S=y.every(e=>!e.required||!!(f[e.name]??``).trim()),w=b.every(e=>!e.required||(g[e.name]?.length??0)>0),T=x.every(e=>!e.required||!!(m[e.name]??``).trim()),E=x.filter(e=>e.required&&!(m[e.name]??``).trim()),D=!!u&&S&&w&&T;function ee(e,t){p(n=>({...n,[e]:t}))}function te(e,t){h(n=>({...n,[e]:t}))}function O(e,t,n){let r=Array.from(n.target.files??[]);_(n=>({...n,[e]:t?r:r.slice(0,1)}))}function k(t){t.preventDefault(),D&&!e&&i({mode:c,target:u,params:En(y,f),env:c===`sandbox`?Tn(x,m):[],uploads:b.flatMap(e=>{let t=g[e.name]??[];return t.length>0?[{inputName:e.name,label:e.label,targetPath:e.targetPath,multiple:e.multiple,files:t}]:[]})})}return(0,$.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,$.jsxs)(`form`,{className:`git-dialog run-once-dialog sandbox-start-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Run sandbox action`,onSubmit:k,children:[(0,$.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,title:`Close`,"aria-label":`Close`,onClick:r,children:(0,$.jsx)(C,{size:15})}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-heading`,children:[(0,$.jsx)(`div`,{className:`git-dialog-icon`,children:(0,$.jsx)(v,{size:18})}),(0,$.jsx)(`h2`,{children:`Run action`}),(0,$.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,$.jsx)(`span`,{children:`Project`}),(0,$.jsx)(`strong`,{children:t})]})]}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-body`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Action`}),(0,$.jsx)(`select`,{disabled:e||o.length===0,value:u,onChange:e=>d(e.target.value),children:o.map(e=>(0,$.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Run on`}),(0,$.jsxs)(`select`,{disabled:e,value:c,onChange:e=>l(e.target.value===`local`?`local`:`sandbox`),children:[(0,$.jsx)(`option`,{value:`sandbox`,children:`Hosted sandbox (start/update)`}),(0,$.jsx)(`option`,{value:`local`,children:`Local machine`})]})]}),y.map(t=>t.type===`boolean`?(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:(f[t.name]??``)===`true`,disabled:e,type:`checkbox`,onChange:e=>ee(t.name,e.target.checked?`true`:`false`)}),(0,$.jsx)(`span`,{}),t.label]},t.name):(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{disabled:e,inputMode:t.type===`number`||t.type===`integer`?`decimal`:void 0,value:f[t.name]??``,onChange:e=>ee(t.name,e.target.value)})]},t.name)),b.map(t=>(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{accept:t.accept||void 0,disabled:e,multiple:t.multiple,type:`file`,onChange:e=>O(t.name,t.multiple,e)})]},t.name)),x.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-env-section`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Environment`}),E.length>0?(0,$.jsxs)(`p`,{className:`sandbox-start-env-warning`,role:`status`,children:[`Required sandbox secret ref missing: `,E.map(e=>e.name).join(`, `)]}):null,x.map(t=>{let n=m[t.name]??``,r=t.required&&!n.trim(),i=`sandbox-action-env-${t.name}-description`;return(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsxs)(`span`,{children:[t.name,t.required?` *`:``]}),(0,$.jsx)(`input`,{"aria-describedby":i,"aria-invalid":r,disabled:e,placeholder:`openpond://secret/...`,value:n,onChange:e=>te(t.name,e.target.value)}),(0,$.jsx)(`small`,{id:i,children:r?`Add a sandbox secret ref before running.`:t.description||`Sandbox secret ref only.`})]},t.name)})]}):null]}),(0,$.jsxs)(`div`,{className:`git-dialog-footer sandbox-start-dialog-footer`,children:[(0,$.jsx)(`button`,{className:`git-dialog-secondary`,disabled:e,type:`button`,onClick:r,children:`Cancel`}),(0,$.jsxs)(`button`,{className:`git-dialog-primary`,disabled:e||!D,title:T?void 0:`Required sandbox secret refs are missing.`,type:`submit`,children:[(0,$.jsx)(v,{size:14}),`Run`]})]})]})})}function Rn(e,t){let n=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`agent`;return t===`cron`?`name: ${n}\nversion: 0.1.0\nuseCase: scheduled_report\nstart:\n command: pnpm report\nschedules:\n - name: daily-report\n command: pnpm report\n cron: \"0 9 * * *\"`:t===`background`?`name: ${n}\nversion: 0.1.0\nuseCase: background_worker\nstart:\n command: pnpm worker\nservices:\n - name: worker\n command: pnpm worker`:t===`resources`?`name: ${n}\nversion: 0.1.0\nuseCase: resource_profile\nresources:\n cpu: 1\n memoryGb: 2\n diskGb: 16\nstart:\n command: pnpm start`:`name: ${n}\nversion: 0.1.0\nuseCase: action\nstart:\n command: pnpm start\nactions:\n - name: hello\n command: pnpm hello`}function zn(e,t){return t||(e===`missing_config`?`${At} missing`:e===`needs_project`?`Local config is ready`:e===`needs_sync`?`Project needs manifest sync`:e===`needs_agent`?`Project is synced`:e===`ready`?`Agent is ready`:`Setup unavailable`)}function Bn(e){return e?.source===`openpond`?`OpenPond Git`:e?.source===`github`?`GitHub`:e?.source===`local_git`?`Local Git`:e?.source===`local_folder`?`Local folder`:`Workspace`}function Vn(e){let t=$n($n(e.data).remote);return(typeof t.remoteUrl==`string`?t.remoteUrl.trim():``)||null}function Hn(e){let t=$n($n(e.data).sandbox);return(typeof t.id==`string`?t.id.trim():``)||null}function Un(e){return e?typeof e.metadata?.name==`string`&&e.metadata.name.trim()?e.metadata.name.trim():e.projectId?`Project sandbox ${tr(e.id)}`:e.agentId?`Agent sandbox ${tr(e.id)}`:`Sandbox ${tr(e.id)}`:null}function Wn(e,t){return{sourceSandboxId:t,name:e.name,...e.description?{description:e.description}:{},scheduleType:e.scheduleType,scheduleExpression:e.scheduleExpression,enabled:!0,...e.timezone?{timezone:e.timezone}:{},...e.startAt?{startAt:e.startAt}:{},...e.endAt?{endAt:e.endAt}:{},...e.maxRuns===void 0?{}:{maxRuns:e.maxRuns},...e.runtimePolicy?{runtimePolicy:e.runtimePolicy}:{},target:e.target,...e.budget?{budget:e.budget}:{},...e.resources?{resources:e.resources}:{},...e.quotas?{quotas:e.quotas}:{},...e.lifecycle?{lifecycle:e.lifecycle}:{},...e.retentionPolicy?{retentionPolicy:e.retentionPolicy}:{},...e.env?{env:e.env}:{},...e.integrationLeases?{integrationLeases:e.integrationLeases}:{},metadata:e.metadata??{},managementSource:`openpond.yaml`,manifestPath:At}}function Gn(e){let t=e?.gitOwner?.trim()??``,n=e?.gitRepo?.trim()??``,r=e?.gitHost?.trim()??``;if(!t||!n||!r)return null;let i=n.endsWith(`.git`)?n:`${n}.git`;return/^https?:\/\//i.test(r)?`${r.replace(/\/+$/,``)}/${t}/${i}`:`https://${r.replace(/\/+$/,``)}/${t}/${i}`}function Kn(e,t){let n=t.trim();if(e===`github_repo`){let[e,t]=n.replace(/^https:\/\/github\.com\//i,``).replace(/^git@github\.com:/i,``).replace(/\.git$/i,``).split(`/`).filter(Boolean);return{gitHost:`github.com`,gitOwner:e??null,gitRepo:t??null,internalRepoPath:null,templateRepoUrl:null}}return e===`internal_repo`?{gitHost:`openpond.ai`,gitOwner:null,gitRepo:n.split(`/`).filter(Boolean).at(-1)??null,internalRepoPath:n||null,templateRepoUrl:null}:e===`template`?{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:n||null}:{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:null}}function qn(e,t){let n=e.trim().replace(/^\/+/,``).replace(/^workspace\//,``).replace(/\/+$/,``),r=t.trim().replace(/[/\\]+/g,`-`).replace(/[^A-Za-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)||`upload`;return`${n||`uploads`}/${r}`}function Jn(e,t){return`OPENPOND_REPLAY_PARAMS_BASE64='${Qn({input:t})}' ${e}`}function Yn(e,t,n){return[`cd`,Xn(e),`&&`,`openpond`,`sandbox-template`,t,`--file`,At,`--target`,Xn(n)].join(` `)}function Xn(e){return`'${e.replace(/'/g,`'\\''`)}'`}function Zn(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let[,e=``]=(typeof r.result==`string`?r.result:``).split(`,`,2);t(e)},r.onerror=()=>n(r.error??Error(`Failed to read file`)),r.readAsDataURL(e)})}function Qn(e){let t=JSON.stringify(e),n=new TextEncoder().encode(t),r=``;for(let e of n)r+=String.fromCharCode(e);return window.btoa(r)}function $n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function er(e){return e instanceof Error?e.message:String(e)}function tr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}async function nr(e){e&&(await e(`sandbox_preserve_source`),await e(`sandbox_stop`))}function rr(e){return{...e.teamId?{teamId:e.teamId}:{},...e.projectId?{projectId:e.projectId}:{},runtime:{runtimeId:e.runtimeId},visibility:`team`,budget:{maxUsd:`0.05`},quotas:{idleTimeoutSeconds:900,maxSpendUsd:`0.05`},metadata:{source:`openpond-app-environment-menu-sandbox-resume`,resumeSandboxId:e.id,previousState:e.state}}}function ir({canCreateSandboxProject:e,canInitGit:t,defaultSandboxRepoUrl:n,gitWorkspace:r,hasRemote:i,isProjectWorkspace:a,isSandboxWorkspace:o,managed:s,onOpenCommitDialog:c,onRunTerminalCommand:l,onWorkspaceToolAction:u,projectSandboxTemplate:d,projectSandboxTemplateValid:f,sandboxTemplateActionTargetCount:p,sandboxTemplateServiceTargets:m,sandboxResumeTarget:g,selectedApp:_,selectedProject:C,setSandboxCreateDialogOpen:w,setSandboxRunActionDialogOpen:T,workspaceBusyValue:E,workspaceReady:D,workspaceState:ee}){let te=[{icon:(0,$.jsx)(F,{size:14}),label:`Initialize Git`,disabled:s||!t||E||!D||!u,onSelect:()=>u?.(`git_init`)},{icon:(0,$.jsx)(h,{size:14}),label:`Commit changes`,disabled:s||!r||E||!D||!ee?.dirty||!c,onSelect:()=>c?.(`commit`)},{icon:(0,$.jsx)(S,{size:14}),label:`Push branch`,disabled:s||!r||E||!D||!i||!u,onSelect:()=>u?.(`git_push`)},{icon:(0,$.jsx)(y,{size:14}),label:`Fetch remote`,disabled:s||!r||E||!D||!i||!u,onSelect:()=>u?.(`git_fetch`)},{icon:(0,$.jsx)(re,{size:14}),label:`Create PR`,disabled:!0,onSelect:()=>void 0}],O=[...d?[]:[{icon:(0,$.jsx)(j,{size:14}),label:`Create sandbox template`,disabled:s||E||!D||!u,onSelect:()=>u?.(`create_sandbox_template_scaffold`)}],{icon:(0,$.jsx)(ie,{size:14}),label:`Validate ${At}`,disabled:s||E||!D||!u,onSelect:()=>u?.(`validate_sandbox_template`)},{icon:(0,$.jsx)(fn,{size:14}),label:`Build template`,disabled:s||E||!D||!u,onSelect:()=>u?.(`build_sandbox_template`)},{icon:(0,$.jsx)(v,{size:14}),label:`Run start locally`,disabled:s||E||!D||!u,onSelect:()=>u?.(`run_sandbox_template`,{mode:`local`,target:`start`})},{icon:(0,$.jsx)(v,{size:14}),label:`Run action`,disabled:s||E||!D||!f||p===0,onSelect:()=>T(!0)},...m.map(e=>({icon:(0,$.jsx)(x,{size:14}),label:`Dev ${e.name} locally`,disabled:s||E||!D||!f||!C?.sandboxTemplate?.rootPath||!l,onSelect:()=>l?.(Yn(C?.sandboxTemplate?.rootPath??``,`dev`,e.name))})),{icon:(0,$.jsx)(j,{size:14}),label:`Start sandbox`,disabled:s||E||!D||!e,onSelect:()=>w(!0)}],k=[{icon:(0,$.jsx)(y,{size:14}),label:`Sandbox status`,disabled:E||!u,onSelect:()=>u?.(`sandbox_status`)},{icon:(0,$.jsx)(v,{size:14}),label:`Resume sandbox`,disabled:E||!u||!g?.runtimeId||g.state===`running`||g.state===`creating`,onSelect:()=>g?.runtimeId?u?.(`sandbox_create`,rr(g)):void 0},{icon:(0,$.jsx)(ae,{size:14}),label:`Sandbox logs`,disabled:E||!u,onSelect:()=>u?.(`sandbox_logs`)},{icon:(0,$.jsx)(ie,{size:14}),label:`Receipts`,disabled:E||!u,onSelect:()=>u?.(`sandbox_receipts`)},{icon:(0,$.jsx)(P,{size:14}),label:`Export patch`,disabled:E||!u,onSelect:()=>u?.(`sandbox_git_export_patch`)},{icon:(0,$.jsx)(S,{size:14}),label:`Apply locally`,disabled:E||!u,onSelect:()=>u?.(`sandbox_git_apply_patch_local`)},{icon:(0,$.jsx)(b,{size:14}),label:`Checkpoint and stop`,disabled:E||!u,onSelect:()=>nr(u)}];return{gitActionItems:te,sandboxActionItems:o?k:a?O:[{icon:(0,$.jsx)(j,{size:14}),label:n?`Create sandbox from repo`:`Create sandbox`,disabled:E||!u,onSelect:()=>u?.(`sandbox_create`,{...n?{repo:n}:{},visibility:`team`,budget:{maxUsd:`0.05`},quotas:{maxSpendUsd:`0.05`},metadata:{source:`openpond-app-environment-menu-sandbox`,..._?.name?{appName:_.name}:{}}})},{icon:(0,$.jsx)(y,{size:14}),label:`List templates`,disabled:E||!u,onSelect:()=>u?.(`sandbox_templates`)}]}}function ar({busy:e,error:t,projectName:n,onClose:r,onSubmit:i}){let[a,o]=(0,Q.useState)(`action`),[s,c]=(0,Q.useState)(At),l=n.trim()||`local-agent`;return(0,$.jsxs)(lr,{title:`Add Agent config`,busy:e,error:t,onClose:r,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Template preset`}),(0,$.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),disabled:e,children:[(0,$.jsx)(`option`,{value:`action`,children:`Action`}),(0,$.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,$.jsx)(`option`,{value:`background`,children:`Background worker`}),(0,$.jsx)(`option`,{value:`resources`,children:`Resource profile`})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Manifest path`}),(0,$.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),disabled:e})]}),(0,$.jsx)(`pre`,{children:Rn(l,a)}),(0,$.jsx)(ur,{busy:e,actionLabel:`Write config`,canSubmit:!!s.trim(),onClose:r,onSubmit:()=>i({name:l,preset:a,manifestPath:s.trim()})})]})}function or({busy:e,defaultBranch:t,defaultTeamId:n,error:r,projectName:i,sourceIdentity:a,onClose:o,onSubmit:s}){let c=n,[l,u]=(0,Q.useState)(i),[d,f]=(0,Q.useState)(/github\.com[:/]/i.test(a)?`github_repo`:`manual`),[p,m]=(0,Q.useState)(a),[h,g]=(0,Q.useState)(t||`main`),[_,v]=(0,Q.useState)(!0);return(0,$.jsxs)(lr,{title:`Connect Project`,busy:e,error:r,onClose:o,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Project name`}),(0,$.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),disabled:e})]}),(0,$.jsxs)(`div`,{className:`agent-setup-two-col`,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Source type`}),(0,$.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),disabled:e,children:[(0,$.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,$.jsx)(`option`,{value:`github_repo`,children:`GitHub repo`}),(0,$.jsx)(`option`,{value:`internal_repo`,children:`Internal repo`}),(0,$.jsx)(`option`,{value:`template`,children:`Template`})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Default branch`}),(0,$.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),disabled:e})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Source identity`}),(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),disabled:e})]}),(0,$.jsxs)(`label`,{className:`agent-setup-check`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked),disabled:e}),(0,$.jsx)(`span`,{children:`Sync now`})]}),(0,$.jsx)(ur,{busy:e,actionLabel:_?`Connect and sync`:`Connect Project`,canSubmit:!!(l.trim()&&c),onClose:o,onSubmit:()=>s({teamId:c,projectName:l.trim(),sourceType:d,sourceIdentity:p.trim(),defaultBranch:h.trim(),syncNow:_})})]})}function sr({busy:e,defaultName:t,error:n,onClose:r,onSubmit:i}){let[a,o]=(0,Q.useState)(t),[s,c]=(0,Q.useState)(!0);return(0,$.jsxs)(lr,{title:`Create Agent`,busy:e,error:n,onClose:r,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Agent name`}),(0,$.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),disabled:e})]}),(0,$.jsx)(`div`,{className:`agent-setup-summary`,children:`Entire manifest · Manual trigger · Package defaults`}),(0,$.jsxs)(`label`,{className:`agent-setup-check`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),disabled:e}),(0,$.jsx)(`span`,{children:`Create and test run`})]}),(0,$.jsx)(ur,{busy:e,actionLabel:`Create Agent`,canSubmit:!!a.trim(),onClose:r,onSubmit:()=>i({agentName:a.trim(),createTestRun:s})})]})}function cr({actionLabel:e,busy:t,error:n,summary:r,title:i,onClose:a,onSubmit:o}){return(0,$.jsxs)(lr,{title:i,busy:t,error:n,onClose:a,children:[(0,$.jsx)(`div`,{className:`agent-setup-summary`,children:r}),(0,$.jsx)(ur,{busy:t,actionLabel:e,canSubmit:!0,onClose:a,onSubmit:o})]})}function lr({busy:e,children:t,error:n,title:r,onClose:i}){return w(n),(0,$.jsx)(`div`,{className:`agent-setup-dialog-backdrop`,role:`presentation`,onMouseDown:i,children:(0,$.jsxs)(`section`,{className:`agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":r,onMouseDown:e=>e.stopPropagation(),children:[(0,$.jsxs)(`header`,{children:[(0,$.jsx)(`h3`,{children:r}),(0,$.jsx)(`button`,{type:`button`,disabled:e,onClick:i,children:`Close`})]}),(0,$.jsx)(`div`,{className:`agent-setup-fields`,children:t})]})})}function ur({actionLabel:e,busy:t,canSubmit:n,onClose:r,onSubmit:i}){return(0,$.jsxs)(`div`,{className:`agent-setup-dialog-actions`,children:[(0,$.jsx)(`button`,{type:`button`,disabled:t,onClick:r,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,disabled:t||!n,onClick:i,children:t?`Working`:e})]})}function dr(e){return e.split(`
|
|
35
|
+
`).filter(e=>e.trim()).length}function fr(e){return e.status===`loading`?`Checking sandbox changes`:e.status===`error`?`Sandbox status unavailable`:e.status===`ready`?e.changedFiles===0?`Sandbox clean`:`${e.changedFiles} sandbox changed ${e.changedFiles===1?`file`:`files`}`:`Sandbox changes unknown`}function pr(e){return e>0&&e%3600==0?`${e/3600} hr`:e>0&&e%60==0?`${e/60} min`:`${e} sec`}function mr(e){let t=e?.trim();if(!t)return null;if(t.startsWith(`$`))return t;let n=Number(t);if(!Number.isFinite(n))return`$${t}`;if(n===0)return`$0`;let r=n>=1?2:4;return`$${n.toFixed(r).replace(/0+$/,``).replace(/\.$/,``)}`}function hr(e){return e.receipts.slice().sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))[0]??null}function gr(e){let t=hr(e);if(t){let n=mr(t.totalUsd);if(t.reason===`idle_timeout`)return n?`stopped by idle timeout · charged ${n}`:`stopped by idle timeout`;if(t.reason===`budget_exhausted`)return n?`budget exhausted · charged ${n}`:`budget exhausted`;if(e.state!==`running`)return n?`receipt ${t.status} · charged ${n}`:`receipt ${t.status}`}if(e.reservation.status===`reserved`){let t=mr(e.reservation.reservedUsd);return t?`reservation active ${t}`:`reservation active`}if(e.reservation.status===`captured`){let t=mr(e.reservation.capturedUsd);return t?`captured ${t}`:`captured`}return e.reservation.status===`released`?`reservation released`:null}function _r(e){if(!e)return`Loading sandbox policy`;let t=typeof e.quotas?.idleTimeoutSeconds==`number`&&e.quotas.idleTimeoutSeconds>0?e.quotas.idleTimeoutSeconds:null,n=mr(e.quotas?.maxSpendUsd??e.budget.maxUsd),r=[t?`Auto-stop after ${pr(t)} idle`:`Auto-stop policy unavailable`];n&&r.push(`cap ${n}`);let i=gr(e);return i&&r.push(i),r.join(` · `)}function vr({mode:e,busy:t,workspaceState:n,workspaceId:r,workspaceKind:i,selectedApp:a,selectedProject:o,workspaceBusy:s,defaultTeamId:c,workspaceDiff:l,managedWorkspace:u,showDiffControls:d,diffPanelOpen:f,onToggleDiffPanel:m,onRunTerminalCommand:h,onWorkspaceToolAction:v,onOpenCommitDialog:y,onWorkspaceBranchChange:b,onWorkspaceBranchCreate:x,connection:S,onBootstrap:C,onOpenSandboxWorkspace:w}){let[E,A]=(0,Q.useState)(!1),[P,F]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(``),[ae,I]=(0,Q.useState)(!1),[oe,se]=(0,Q.useState)(!1),[L,R]=(0,Q.useState)(null),[z,B]=(0,Q.useState)(!1),[V,ce]=(0,Q.useState)(!1),[H,U]=(0,Q.useState)(null),[W,le]=(0,Q.useState)([]),[ue,G]=(0,Q.useState)([]),[de,K]=(0,Q.useState)([]),[fe,q]=(0,Q.useState)({status:`idle`,changedFiles:0,error:null}),[J,pe]=(0,Q.useState)(null),me=(0,Q.useRef)(null),he=(0,Q.useRef)(null),ge=!!n?.initialized,Y=!!s,_e=!!u,ve=i===`local_project`||!!o,X=i===`sandbox`||i===`sandbox_template`,ye=X&&r?.trim()||null,be=X?0:l?.additions??0,xe=X?0:l?.deletions??0,Se=X?fe.changedFiles:l?.filesChanged??n?.changedFilesCount??0,Ce=Se>0,we=X?fr(fe):Ce?`${Se} changed ${Se===1?`file`:`files`}`:`No changes`,Te=X?_r(J):``,Ee=n?.source!==`local_folder`,De=ve&&n?.source===`local_folder`,Oe=!!n?.remoteUrl,ke=n?.remoteUrl?.trim()??``,Ae=Gn(a??null),je=!!o?.sandboxTemplate?.detected,Me=!!(o?.sandboxTemplate?.valid&&o.sandboxTemplate.normalizedManifest),Ne=o?.sandboxTemplate?.normalizedManifest??null,Pe=Ne?tn(Ne):[],Fe=Pe.filter(e=>e.kind===`action`),Ie=Pe.filter(e=>e.kind===`service`),Le=!!o?.linkedOpenPondApp?.appId,Z=N({localProject:o,organizations:W,projects:ue,agents:de,defaultTeamId:c}),Re=O(W,c),ze=ve&&je&&!Le,Be=ve&&je&&Me&&(ze||!!ke),Ve=n?Array.from(new Set([n.currentBranch,...n.branches].filter(e=>!!e))):[],He=n?.initialized?n.currentBranch??Ve[0]??`No branch`:`Not synced`,Ue=Bn(n),We=(0,Q.useMemo)(()=>{let e=re.trim().toLowerCase();return e?Ve.filter(t=>t.toLowerCase().includes(e)):Ve},[Ve,re]);(0,Q.useEffect)(()=>{if(!E)return;function e(e){me.current?.contains(e.target)||A(!1)}function t(e){e.key===`Escape`&&A(!1)}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[E]),(0,Q.useEffect)(()=>{E&&P&&he.current?.focus()},[P,E]),(0,Q.useEffect)(()=>{if(!S||!E||!ve)return;let e=!1;return ce(!0),U(null),k.organizations(S).then(async t=>{if(e)return;let n=t.organizations.map(T).filter(e=>!!e).filter(e=>e.status===`active`);le(n);let r=O(n,c);if(!r)return;let[i,a]=await Promise.all([k.listSandboxProjects(S,{teamId:r.teamId}),k.listSandboxAgents(S,{teamId:r.teamId})]);e||(G(i.projects),K(a.agents))}).catch(t=>{e||U(er(t))}).finally(()=>{e||ce(!1)}),()=>{e=!0}},[S,c,ve,E]),(0,Q.useEffect)(()=>{if(!E||!X||!S||!ye){q({status:`idle`,changedFiles:0,error:null});return}let e=!1;return q(e=>({status:`loading`,changedFiles:e.changedFiles,error:null})),k.sandboxGitStatus(S,ye).then(t=>{e||q({status:`ready`,changedFiles:dr(t.status?.porcelain??``),error:null})}).catch(t=>{e||q({status:`error`,changedFiles:0,error:er(t)})}),()=>{e=!0}},[S,X,E,ye]),(0,Q.useEffect)(()=>{if(!E||!X||!S||!ye){pe(null);return}let e=!1;return k.sandbox(S,ye).then(t=>{e||pe(t.sandbox)}).catch(()=>{e||pe(null)}),()=>{e=!0}},[S,X,E,ye]);async function Ge(e){if(!v)return;let t=e.openPreview?mn():null,r=e.repoUrl||ke;if(ze){if(Oe&&!window.confirm(`Replace the current origin remote with a new OpenPond repo before starting the sandbox?`)){hn(t,null);return}let i=await v(`publish_openpond_repo`,{replaceOrigin:Oe,...n?.dirty?{commitDirty:!0,commitMessage:e.commitMessage}:{}});if(!i?.ok){hn(t,null);return}r=Vn(i)??r}else if(Ee&&Oe&&(n?.dirty&&!(await v(`git_commit`,{message:e.commitMessage,includeUnstaged:!0,runChecks:!1}))?.ok||!(await v(`git_push`,{runChecks:!1}))?.ok)){hn(t,null);return}if(!r){hn(t,null);return}let i=await v(`sandbox_create`,{repo:r,visibility:`team`,resources:e.resources,budget:{maxUsd:e.budgetUsd},quotas:{idleTimeoutSeconds:900,maxSpendUsd:e.budgetUsd},...e.env.length>0?{env:e.env}:{},...e.volumes.length>0?{volumes:e.volumes}:{},metadata:{source:`openpond-app-local-sandbox-template-start`,...e.entrypointName?{entrypointName:e.entrypointName}:{},...o?.id?{localProjectId:o.id}:{},...o?.name?{projectName:o.name}:{},...Ne?{templateName:Ne.name,templateVersion:Ne.version,templateUseCase:Ne.useCase,templateTargets:Pe.map(e=>({name:e.name,kind:e.kind}))}:{}},...e.openPreview&&e.previewPort?{previewPort:e.previewPort,previewLabel:e.previewLabel,previewAccess:e.previewAccess,previewAutoStart:!0}:{}}),a=pn(i);if(e.openPreview&&hn(t,a),!i?.ok)return;let s=Hn(i);for(let e of Ne?.setup.commands??[])if(!(await v(`sandbox_exec`,{command:e,timeoutSeconds:900}))?.ok)return;let c={};for(let t of e.uploads){let e=[];for(let n of t.files){let r=qn(t.targetPath,n.name);if(!(await v(`sandbox_upload_file`,{path:r,contentsBase64:await Zn(n)}))?.ok)return;e.push(r)}c[t.inputName]=t.multiple?e:e[0]??``}if((await v(`sandbox_exec`,{command:Jn(e.command,{...e.params,...c}),timeoutSeconds:e.timeoutSeconds??900}))?.ok){if(s){for(let t of e.schedules)if(!(await v(`sandbox_schedule_create`,Wn(t,s)))?.ok)return}I(!1)}}async function Ke(e){if(!v)return;let t={},n=[];for(let r of e.uploads){let e=[];for(let t of r.files){let i=qn(r.targetPath,t.name),a=await Zn(t);n.push({path:i,contentsBase64:a}),e.push(i)}t[r.inputName]=r.multiple?e:e[0]??``}se(!1),await v(`run_sandbox_template`,{mode:e.mode,target:e.target,params:{...e.params,...t},...e.env.length>0?{env:e.env}:{},...n.length>0?{uploads:n}:{}})}async function qe(e=Re?.teamId){if(!S||!e)return;let[t,n]=await Promise.all([k.listSandboxProjects(S,{teamId:e}),k.listSandboxAgents(S,{teamId:e})]);G(t.projects),K(n.agents)}async function Je(e){if(v&&o){B(!0),U(null);try{if(!(await v(`create_sandbox_template_scaffold`,{manifestOnly:!0,manifestContent:Rn(e.name,e.preset),name:e.name,preset:e.preset,manifestPath:e.manifestPath}))?.ok)return;R(null)}catch(e){U(er(e))}finally{B(!1)}}}async function Ye(e){if(!S||!o||!C)return;let t=e.teamId;B(!0),U(null);try{let n=Kn(e.sourceType,e.sourceIdentity),r=(await k.upsertSandboxProject(S,{teamId:t,name:e.projectName,sourceType:e.sourceType,normalizedSourceIdentity:e.sourceIdentity||e.projectName,defaultBranch:e.defaultBranch||null,gitProvider:e.sourceType===`github_repo`?`github`:null,gitHost:n.gitHost,gitOwner:n.gitOwner,gitRepo:n.gitRepo,internalRepoPath:n.internalRepoPath,templateRepoUrl:n.templateRepoUrl,sourceConfig:{sourceType:e.sourceType,sourceValue:e.sourceIdentity||e.projectName},metadata:{source:`openpond-app-local-project-agent-setup`}})).project;e.syncNow&&(r=(await k.syncSandboxProject(S,r.id,{teamId:t})).project),C((await k.updateLocalProjectAgentSetup(S,o.id,{linkedSandboxProject:{teamId:t,projectId:r.id,projectSlug:r.slug,projectName:r.name,sourceRepoUrl:e.sourceIdentity||null,defaultBranch:r.defaultBranch,lastUploadedCommit:null,lastUploadTransport:null,manifestPath:r.sandboxManifestPath,manifestHash:r.sandboxManifestHash,syncedAt:r.sandboxManifestSyncedAt,linkedAt:new Date().toISOString()}})).bootstrap),G(e=>[r,...e.filter(e=>e.id!==r.id)]),R(null)}catch(e){U(er(e))}finally{B(!1)}}async function Xe(){if(!S||!o||!Z.project||!C)return;let e=Z.project;B(!0),U(null);try{let t=(await k.syncSandboxProject(S,e.id,{teamId:e.teamId})).project;C((await k.updateLocalProjectAgentSetup(S,o.id,{linkedSandboxProject:{teamId:t.teamId,projectId:t.id,projectSlug:t.slug,projectName:t.name,sourceRepoUrl:n?.remoteUrl??o.linkedSandboxProject?.sourceRepoUrl??null,defaultBranch:t.defaultBranch,lastUploadedCommit:o.linkedSandboxProject?.lastUploadedCommit??null,lastUploadTransport:o.linkedSandboxProject?.lastUploadTransport??null,manifestPath:t.sandboxManifestPath,manifestHash:t.sandboxManifestHash,syncedAt:t.sandboxManifestSyncedAt,linkedAt:o.linkedSandboxProject?.linkedAt??new Date().toISOString()}})).bootstrap),G(e=>[t,...e.filter(e=>e.id!==t.id)]),R(null)}catch(e){U(er(e))}finally{B(!1)}}async function Ze(e){if(!S||!o||!Z.project||!C)return;let t=Z.project;B(!0),U(null);try{let n=(await k.upsertSandboxAgent(S,{teamId:t.teamId,projectId:t.id,name:e.agentName,selectedEntrypoint:{scope:`entire_manifest`,name:null},triggerType:`manual`,backgroundTaskPolicy:{},defaultWorkflowMode:`attempt`,defaultResourcePolicy:{},metadata:{source:`openpond-app-local-project-agent-setup`}})).agent,r=null,i=null;if(e.createTestRun){let e=await k.runSandboxAgent(S,n.id,{teamId:t.teamId,triggerType:`manual`,metadata:{source:`openpond-app-local-project-agent-setup`}});r=e.sandbox??null,i=r?.id??e.run.sandboxId??null}C((await k.updateLocalProjectAgentSetup(S,o.id,{preferredSandboxAgentId:n.id})).bootstrap),K(e=>[n,...e.filter(e=>e.id!==n.id)]),R(null),i&&await w?.({sandboxId:i,name:Un(r)??`${n.name} sandbox`})}catch(e){U(er(e))}finally{B(!1)}}async function Qe(){if(S&&Z.agent){B(!0),U(null);try{let e=await k.runSandboxAgent(S,Z.agent.id,{teamId:Z.agent.teamId,triggerType:`manual`,metadata:{source:`openpond-app-local-project-agent-setup`}});await qe(Z.agent.teamId),R(null);let t=e.sandbox?.id??e.run.sandboxId;t&&await w?.({sandboxId:t,name:Un(e.sandbox??null)??`${Z.agent.name} sandbox`})}catch(e){U(er(e))}finally{B(!1)}}}let{gitActionItems:$e,sandboxActionItems:et}=ir({busy:t,canCreateSandboxProject:Be,canInitGit:De,defaultSandboxRepoUrl:Ae??``,gitWorkspace:Ee,hasRemote:Oe,isProjectWorkspace:ve,isSandboxWorkspace:X,managed:_e,onOpenCommitDialog:y,onRunTerminalCommand:h,onWorkspaceToolAction:v,projectSandboxTemplate:je,projectSandboxTemplateValid:Me,sandboxTemplateActionTargetCount:Fe.length,sandboxTemplateServiceTargets:Ie,sandboxResumeTarget:J?{id:J.id,runtimeId:J.runtimeId??null,teamId:J.teamId??null,projectId:J.projectId??null,state:J.state??null}:null,selectedApp:a,selectedProject:o,setSandboxCreateDialogOpen:I,setSandboxRunActionDialogOpen:se,workspaceBusyValue:Y,workspaceReady:ge,workspaceState:n});if(!n)return null;function tt(e){A(!1),e.onSelect()}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`workspace-environment-menu ${e===`dock`?`open-up`:``} ${e===`topbar`?`topbar`:``}`,ref:me,children:[(0,$.jsx)(`button`,{type:`button`,className:`environment-info-button ${e===`topbar`?`titlebar-icon`:`composer-icon`} ${E?`active`:``}`,title:`Environment`,"data-tooltip":`Environment`,"aria-label":`Environment`,"aria-haspopup":`menu`,"aria-expanded":E,onClick:()=>A(e=>!e),children:(0,$.jsx)(g,{size:16})}),E&&(0,$.jsxs)(`div`,{className:`environment-popover`,role:`menu`,"aria-label":`Environment`,children:[(0,$.jsx)(`div`,{className:`environment-popover-header`,children:(0,$.jsx)(`span`,{children:`Environment`})}),ve&&o?(0,$.jsxs)(`button`,{type:`button`,className:`environment-row`,disabled:V||!Z.canAct||z,title:V?`Loading Agent setup state`:Z.reason??`Set up this project as an Agent`,onClick:()=>{!V&&Z.canAct&&(Z.state===`missing_config`&&R(`config`),Z.state===`needs_project`&&R(`connect`),Z.state===`needs_sync`&&R(`sync`),Z.state===`needs_agent`&&R(`agent`),Z.state===`ready`&&R(`run`),A(!1))},children:[(0,$.jsx)(j,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Agent setup`}),(0,$.jsx)(`small`,{children:V?`Loading setup state`:zn(Z.state,Z.reason)})]}),(0,$.jsx)(`span`,{className:`environment-row-action`,children:z?`Working`:V?`Loading`:Z.actionLabel})]}):null,(0,$.jsxs)(`button`,{type:`button`,className:`environment-row ${f?`active`:``}`,disabled:!d||!m,onClick:()=>{A(!1),m?.()},children:[(0,$.jsx)(te,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Changes`}),(0,$.jsx)(`small`,{children:we})]}),!X&&(Ce||l)&&(0,$.jsxs)(`span`,{className:`environment-change-counts`,children:[(0,$.jsxs)(`span`,{className:`diff-addition`,children:[`+`,be]}),(0,$.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,xe]})]})]}),(0,$.jsxs)(`div`,{className:`environment-row static`,children:[(0,$.jsx)(_,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:Ue}),(0,$.jsx)(`small`,{children:n.repoPath||n.workspacePath})]})]}),X?(0,$.jsxs)(`div`,{className:`environment-row static`,title:Te,children:[(0,$.jsx)(ee,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Idle cleanup`}),(0,$.jsx)(`small`,{children:Te})]})]}):null,(0,$.jsxs)(`button`,{type:`button`,className:`environment-row ${P?`active`:``}`,disabled:_e||!Ee||t||Y||!n.initialized,"aria-expanded":P,onClick:()=>F(e=>!e),children:[(0,$.jsx)(M,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:He}),(0,$.jsx)(`small`,{children:_e?`Managed workspace`:Ee?`Branch`:`Git not initialized`})]}),(0,$.jsx)(p,{size:13})]}),P&&(0,$.jsxs)(`div`,{className:`environment-branch-panel`,children:[(0,$.jsxs)(`label`,{className:`environment-branch-search`,children:[(0,$.jsx)(D,{size:13}),(0,$.jsx)(`input`,{ref:he,value:re,placeholder:`Search branches`,onChange:e=>ie(e.target.value)})]}),(0,$.jsxs)(`div`,{className:`environment-branch-list`,children:[We.map(e=>{let r=e===n.currentBranch,i=t||n.dirty&&!r;return(0,$.jsxs)(`button`,{type:`button`,className:r?`selected`:``,disabled:i,role:`menuitemradio`,"aria-checked":r,title:i&&!r?`Commit or discard local changes before switching branches.`:e,onClick:()=>{A(!1),r||b?.(e)},children:[(0,$.jsx)(M,{size:13}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:e}),r&&n.dirty&&(0,$.jsxs)(`small`,{children:[`Uncommitted: `,n.changedFilesCount,` `,n.changedFilesCount===1?`file`:`files`]})]}),r&&(0,$.jsx)(ne,{size:14})]},e)}),We.length===0&&(0,$.jsx)(`div`,{className:`environment-branch-empty`,children:`No branches found`})]}),(0,$.jsxs)(`button`,{type:`button`,className:`environment-branch-create`,disabled:t||!n.initialized||!x,onClick:()=>{A(!1),x?.()},children:[(0,$.jsx)(M,{size:14}),(0,$.jsx)(`span`,{children:`Create branch`})]})]}),(0,$.jsx)(`div`,{className:`environment-section-title`,children:`Git`}),$e.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`environment-action`,disabled:e.disabled,onClick:()=>tt(e),children:[e.icon,(0,$.jsx)(`span`,{children:e.label})]},e.label)),(0,$.jsx)(`div`,{className:`environment-section-title`,children:`Sandbox`}),et.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`environment-action`,disabled:e.disabled,onClick:()=>tt(e),children:[e.icon,(0,$.jsx)(`span`,{children:e.label})]},e.label))]})]}),ae&&(0,$.jsx)(In,{busy:Y,commitBeforeCreate:(ze||Ee&&Oe)&&!!n?.dirty,defaultRepoUrl:ke,projectName:o?.name??`sandbox template`,templateManifest:o?.sandboxTemplate?.normalizedManifest??null,uploadBeforeCreate:ze,onClose:()=>{Y||I(!1)},onSubmit:e=>void Ge(e)}),oe&&(0,$.jsx)(Ln,{busy:Y,projectName:o?.name??`sandbox template`,templateManifest:o?.sandboxTemplate?.normalizedManifest??null,onClose:()=>{Y||se(!1)},onSubmit:e=>void Ke(e)}),L===`config`&&o?(0,$.jsx)(ar,{busy:z,error:H,projectName:o.name,onClose:()=>!z&&R(null),onSubmit:e=>void Je(e)}):null,L===`connect`&&o&&Re?(0,$.jsx)(or,{busy:z,error:H,defaultTeamId:Re.teamId,projectName:o.name,sourceIdentity:n?.remoteUrl??``,defaultBranch:n?.currentBranch??`main`,onClose:()=>!z&&R(null),onSubmit:e=>void Ye(e)}):null,L===`sync`&&Z.project?(0,$.jsx)(cr,{busy:z,error:H,title:`Sync Project`,actionLabel:`Sync Project`,summary:`${Z.project.name} · ${Z.project.sandboxManifestPath??`openpond.yaml`}`,onClose:()=>!z&&R(null),onSubmit:()=>void Xe()}):null,L===`agent`&&Z.project?(0,$.jsx)(sr,{busy:z,error:H,defaultName:`${o?.name??Z.project.name} Agent`,onClose:()=>!z&&R(null),onSubmit:e=>void Ze(e)}):null,L===`run`&&Z.agent?(0,$.jsx)(cr,{busy:z,error:H,title:`Run Agent`,actionLabel:`Run Agent`,summary:Z.agent.name,onClose:()=>!z&&R(null),onSubmit:()=>void Qe()}):null]})}export{vr as WorkspaceEnvironmentMenu};
|
package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./index-
|
|
1
|
+
import{m as e}from"./index-D9WbJMSq.js";import"./icons-D7jkCa2d.js";import{t}from"./chevron-right-BYmDQ7ti.js";import{K as n,z as r}from"./App-DY2R8Z6r.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-D9WbJMSq.js";import"./icons-D7jkCa2d.js";import{t}from"./cloud-upload-Ck1ufAr8.js";import{t as n}from"./git-commit-horizontal-DDyhPjxS.js";import{t as r}from"./upload-C4MPhQn8.js";import{t as i}from"./x-Dqpel42h.js";import{nn as a,tn as o}from"./App-DY2R8Z6r.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};
|