openpond 0.2.53 → 0.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +1514 -100
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-WTFZA7LF.js +2 -0
- package/dist/chunks/{app-layer-I7MZYVLL.js → app-layer-Y2UERCPY.js} +1 -1
- package/dist/chunks/app-server-runtime-2RM3N4I6.js +2 -0
- package/dist/chunks/apps-KDNWYO3G.js +2 -0
- package/dist/chunks/chunk-2DFR7PJ4.js +2460 -0
- package/dist/chunks/chunk-4CRM2ADK.js +2 -0
- package/dist/chunks/{chunk-7ZG3IT7C.js → chunk-4WEUCGJ3.js} +6 -6
- package/dist/chunks/chunk-55G6B54U.js +6 -0
- package/dist/chunks/chunk-73G5UYBB.js +12 -0
- package/dist/chunks/{chunk-DALJMSJG.js → chunk-ARQEJOEK.js} +24 -24
- package/dist/chunks/chunk-B7QDZPNX.js +2 -0
- package/dist/chunks/chunk-BFKYRQMA.js +2 -0
- package/dist/chunks/{chunk-AH22RHPS.js → chunk-BQAF5P7K.js} +2 -2
- package/dist/chunks/{chunk-YJ4PNAST.js → chunk-BTI4N7YO.js} +1 -1
- package/dist/chunks/chunk-C6D4WAYN.js +6 -0
- package/dist/chunks/chunk-CGBI2VYJ.js +2 -0
- package/dist/chunks/chunk-DLVPSCTB.js +2 -0
- package/dist/chunks/{chunk-UJ5EFSEC.js → chunk-G6JMQGX7.js} +1 -1
- package/dist/chunks/chunk-GGIG3XU7.js +3 -0
- package/dist/chunks/chunk-IODUCRBA.js +58 -0
- package/dist/chunks/chunk-JIMU3KDA.js +24 -0
- package/dist/chunks/chunk-JUJSA7KI.js +22 -0
- package/dist/chunks/chunk-K5SBVO3B.js +195 -0
- package/dist/chunks/chunk-KD3QVRIJ.js +21 -0
- package/dist/chunks/chunk-KGNCKIFP.js +3 -0
- package/dist/chunks/chunk-L4235TRQ.js +140 -0
- package/dist/chunks/{chunk-N5QNXMIS.js → chunk-MH3LHSGX.js} +1 -1
- package/dist/chunks/chunk-MVF3F5QS.js +2 -0
- package/dist/chunks/{chunk-N3DEA6PG.js → chunk-NNIRIUSY.js} +1 -1
- package/dist/chunks/{chunk-WITSXYEW.js → chunk-NOTXPD2T.js} +1 -1
- package/dist/chunks/{chunk-T5LE6R5S.js → chunk-OSIO7PLX.js} +1 -1
- package/dist/chunks/chunk-OULAKUIN.js +2 -0
- package/dist/chunks/chunk-OWNLDB2O.js +2 -0
- package/dist/chunks/{chunk-NAZ26IZL.js → chunk-Q7AXHFZV.js} +1 -1
- package/dist/chunks/chunk-QDHMP5FS.js +2 -0
- package/dist/chunks/chunk-QKD5OMDI.js +2 -0
- package/dist/chunks/{chunk-YD55Z5H3.js → chunk-QRAKXZOC.js} +10 -10
- package/dist/chunks/{chunk-JDLAHVAJ.js → chunk-R27YGT77.js} +1 -1
- package/dist/chunks/chunk-R2BSIRYL.js +3 -0
- package/dist/chunks/chunk-SHQOIROR.js +42 -0
- package/dist/chunks/chunk-STDMBJOQ.js +9 -0
- package/dist/chunks/chunk-T4QGDQHP.js +4 -0
- package/dist/chunks/{chunk-R3XFY7VL.js → chunk-TERVLCRG.js} +1 -1
- package/dist/chunks/{chunk-PA7XP42P.js → chunk-U2YMBCX7.js} +1 -1
- package/dist/chunks/{chunk-GXSTZBM6.js → chunk-UA5DA5I2.js} +1 -1
- package/dist/chunks/chunk-VJEZPDBS.js +5 -0
- package/dist/chunks/chunk-WDFLCNRC.js +8 -0
- package/dist/chunks/chunk-WZYRAR7X.js +16 -0
- package/dist/chunks/chunk-YDT7L3VZ.js +24 -0
- package/dist/chunks/chunk-YR5ID2SS.js +2 -0
- package/dist/chunks/chunk-YUPBAWBJ.js +554 -0
- package/dist/chunks/cli-465VC2WP.js +2 -0
- package/dist/chunks/{configuration-command-MATM4XR5.js → configuration-command-LAAP2EXT.js} +1 -1
- package/dist/chunks/connected-evidence-XM626247.js +2 -0
- package/dist/chunks/{continual-PKK2BOTB.js → continual-TTGJ6YTR.js} +1 -1
- package/dist/chunks/core-commands-W7EK552V.js +2 -0
- package/dist/chunks/datasets-QJWYTTQL.js +2 -0
- package/dist/chunks/desktop-test-3B2D34NF.js +3 -0
- package/dist/chunks/dist-FAJX2UBW.js +2 -0
- package/dist/chunks/{dist-4HV2W6V4.js → dist-HUAE2KFZ.js} +1 -1
- package/dist/chunks/{chunk-6VF3Q6QJ.js → dist-SKYG5LZO.js} +2 -4
- package/dist/chunks/evaluation-coordination-2MONR4AX.js +2 -0
- package/dist/chunks/experiment-improvements-WVQ5FK46.js +2 -0
- package/dist/chunks/experiments-S5UQ32QB.js +2 -0
- package/dist/chunks/extension-DWMY6D2R.js +4 -0
- package/dist/chunks/{help-WLKSACLZ.js → help-A72QDRNG.js} +1 -1
- package/dist/chunks/hosted-experiment-improvement-2OWOQLHC.js +3 -0
- package/dist/chunks/hosted-harness-runtime-TGFMAV7W.js +2 -0
- package/dist/chunks/hosted-profile-candidate-WQSI6HZO.js +3 -0
- package/dist/chunks/hosted-profile-compiler-Z2A4TEA6.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-FKGARUEE.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-QOY2JKV4.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-WVP6CALP.js +3 -0
- package/dist/chunks/human-review-TGHQKXFZ.js +2 -0
- package/dist/chunks/{import-V3HUGRHR.js → import-4UE5XNSG.js} +1 -1
- package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +2 -0
- package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +2 -0
- package/dist/chunks/learning-R2XBMMEM.js +2 -0
- package/dist/chunks/opchat-WULL6CUP.js +3 -0
- package/dist/chunks/organizations-I37HISVX.js +2 -0
- package/dist/chunks/profile-NOZ6TVXL.js +3 -0
- package/dist/chunks/project-agent-T6XKC54C.js +2 -0
- package/dist/chunks/sandbox-command-STB47FRY.js +2 -0
- package/dist/chunks/{sandbox-template-BBGGPJMI.js → sandbox-template-LKGBDVJ4.js} +1 -1
- package/dist/chunks/sql-execution-process-source-B4HQM6ZV.js +2 -0
- package/dist/chunks/src-T3KWWCAH.js +322 -0
- package/dist/chunks/{src-CR6UZYTX.js → src-ZWJ5IO7A.js} +1 -1
- package/dist/chunks/{taskset-LUG3ZU6J.js → taskset-RNYDR4GS.js} +1 -1
- package/dist/chunks/{teams-bot-7I4BAUVO.js → teams-bot-H7XT23XB.js} +1 -1
- package/dist/chunks/{training-XHE6FVII.js → training-M6FAPRSJ.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-CLFfy_Av.js +154 -0
- package/dist/web/assets/App-CTlAPuCY.css +1 -0
- package/dist/web/assets/{AppDialog-BdusXgU0.js → AppDialog-CPHTPqrx.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-C4uRpnBz.js → AppTerminalPanel-BVj5Tj93.js} +2 -2
- package/dist/web/assets/AppsView-O69zEBY3.js +1 -0
- package/dist/web/assets/{BrowserSidebar-Bl7V6YO2.js → BrowserSidebar-Pr_Kpe8p.js} +1 -1
- package/dist/web/assets/{CartesianChart-BstFbsdn.js → CartesianChart-JPqo6YOf.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-B8YAf0c1.js → CollaborationTabs-CAJcQFn2.js} +1 -1
- package/dist/web/assets/{CommandMenu-DZct7zUJ.js → CommandMenu-B-w53n9A.js} +1 -1
- package/dist/web/assets/{CommunityView-CR0-W-uG.js → CommunityView-DbZKK8_P.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DR-Qo7b4.js → ComposerCreateImproveStrip-3_083PF4.js} +1 -1
- package/dist/web/assets/{GetStartedView-xqQoMMei.js → GetStartedView-D7JGm_6c.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-DwgMfZ7_.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-De3i9wF4.js → HostedModelLearningSettings-JRfQadRl.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DAY1MmqP.js → LabModelVersionDetailPage-BUYflJY_.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-DLnIgnry.js → LabSkillSidebar-BBiqk7Rf.js} +1 -1
- package/dist/web/assets/LabsRoute-Ci6vUnSd.js +99 -0
- package/dist/web/assets/MainChatThread-BQK3oI2N.js +2 -0
- package/dist/web/assets/MainPane-D3ojiN-p.js +18 -0
- package/dist/web/assets/{MarkdownText-gJMuefaJ.js → MarkdownText-DOdOVFXL.js} +25 -25
- package/dist/web/assets/{NativeSkillSidebar-Dlxb8iOC.js → NativeSkillSidebar-CRI_ri8z.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DM-cqJ-K.js → NewExperienceSwitcher-DhYtfE68.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cu1q75gq.js → NewProjectDialog-D8sy1gOz.js} +1 -1
- package/dist/web/assets/{OutputsPage-DiXMkasl.js → OutputsPage-CbWgrhXA.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DqiBHiCB.js → ProjectsPage-DLB67lyA.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-ozSKnDyX.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-CeSFJM5s.js → RightSidebarHomePanel-CKs3OwhD.js} +1 -1
- package/dist/web/assets/ScheduledWorkPage-Cafv_QnR.js +1 -0
- package/dist/web/assets/SettingsView-T1vYDPjh.js +5 -0
- package/dist/web/assets/{TeamChatView-DM0adMtj.js → TeamChatView-vIrmXOY_.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CFlH51DD.js → TerminalOverlay-CAmF__Dq.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-CgIBVGha.js → TrainingCreationPanel-D75K0yk5.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-Bbo3RRie.js → TrainingDraftPanel-D7XZePAk.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CSRjJUSa.js → UsageSettingsSection-CYTmp7PG.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-CODMjVHY.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-DQGoIjH9.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-c1pHDskn.js +63 -0
- package/dist/web/assets/{WorkspaceGitDialogs-Dgmg-6XG.js → WorkspaceGitDialogs-DrVtapQQ.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BR4qxMgU.js → WorkspaceMonacoEditor-BCKzvSj2.js} +3 -3
- package/dist/web/assets/arrow-up-right-CP4hZdrJ.js +1 -0
- package/dist/web/assets/chunk-NOJECMB7-Bhcms-w5.js +1 -0
- package/dist/web/assets/{clipboard-BZzZ82Bk.js → clipboard-BgrXorn-.js} +1 -1
- package/dist/web/assets/{cloud-upload-CJPYPVl8.js → cloud-upload-B_zYztb6.js} +1 -1
- package/dist/web/assets/{cssMode-WC4Rg1l-.js → cssMode-DanjGgA8.js} +1 -1
- package/dist/web/assets/{folder-open-sLZJxLQy.js → folder-open-CdVKbtGq.js} +1 -1
- package/dist/web/assets/folder-plus-Cc5KElB6.js +1 -0
- package/dist/web/assets/{git-commit-horizontal-Cotm7KEC.js → git-commit-horizontal-CjGIIgRi.js} +1 -1
- package/dist/web/assets/{htmlMode-C6oZGeaB.js → htmlMode-DRGDF_UL.js} +1 -1
- package/dist/web/assets/index-B5re-RJy.css +1 -0
- package/dist/web/assets/{index-BxWTVKtn.js → index-BE-wXZ5R.js} +2 -2
- package/dist/web/assets/info-BLj0RvhA.js +1 -0
- package/dist/web/assets/{jsonMode-BET4LQIn.js → jsonMode-CCu0j2GD.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-BPxA_-Kg.js → lspLanguageFeatures-s_Lhm7P6.js} +1 -1
- package/dist/web/assets/minimize-2-Cyg_zD9z.js +1 -0
- package/dist/web/assets/{monaco.contribution-DXzyQfVi.js → monaco.contribution-CAzXvYkn.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DFzEyaHi.js → monaco.contribution-CY7mRgOB.js} +2 -2
- package/dist/web/assets/{monaco.contribution-7AUuf2NS.js → monaco.contribution-aUeLcBEg.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BH6kkO4b.js → monaco.contribution-mUPNK9ra.js} +2 -2
- package/dist/web/assets/monitor-DZvOs_wC.js +1 -0
- package/dist/web/assets/play-BJPzemuY.js +1 -0
- package/dist/web/assets/{python-PzBkTjWx.js → python-B_qnnVaG.js} +1 -1
- package/dist/web/assets/{save-DpezrtH2.js → save-BDy9tA3E.js} +1 -1
- package/dist/web/assets/square-Cb2c5td4.js +1 -0
- package/dist/web/assets/{toggleHighContrast-Cto-fOXm.js → toggleHighContrast-MhO1JLyR.js} +1 -1
- package/dist/web/assets/{tsMode-BYA4LNc6.js → tsMode-DfBXJb9V.js} +1 -1
- package/dist/web/assets/{upload-C5YFNgtS.js → upload-D56kThRh.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CnyTsqlf.js → useLocalAgentSchedules-DMnGfswi.js} +1 -1
- package/dist/web/assets/useProviderSettings-Bv5B9eNk.js +5 -0
- package/dist/web/assets/{useSessionTurnCache-DICuJSJW.js → useSessionTurnCache-ClAY8gze.js} +1 -1
- package/dist/web/assets/{wifi-off-nzHj7JXp.js → wifi-off-C9lWJmVm.js} +1 -1
- package/dist/web/assets/{workers-Dboaw6f_.js → workers-BYzrH8by.js} +1 -1
- package/dist/web/assets/{yaml-uuY5JmO8.js → yaml-D3T8UkT3.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/chunks/actions-command-DSO6YOEE.js +0 -2
- package/dist/chunks/app-server-runtime-KZP2LB5X.js +0 -2
- package/dist/chunks/apps-TM74FFQB.js +0 -2
- package/dist/chunks/chunk-2JO2KWT3.js +0 -5
- package/dist/chunks/chunk-2SPZYBDN.js +0 -16
- package/dist/chunks/chunk-3LX6RU3C.js +0 -3
- package/dist/chunks/chunk-4SHKI3BH.js +0 -2
- package/dist/chunks/chunk-4TZHH5FC.js +0 -2409
- package/dist/chunks/chunk-5TNDPNS3.js +0 -2
- package/dist/chunks/chunk-6JAN4RMN.js +0 -42
- package/dist/chunks/chunk-7QEE4PBI.js +0 -8
- package/dist/chunks/chunk-AFUDIT36.js +0 -2
- package/dist/chunks/chunk-BX4J2VDU.js +0 -2
- package/dist/chunks/chunk-EMKZVP7Z.js +0 -2
- package/dist/chunks/chunk-FPUUZQUP.js +0 -6
- package/dist/chunks/chunk-GCOUYYHG.js +0 -5
- package/dist/chunks/chunk-GS2NKNKG.js +0 -4
- package/dist/chunks/chunk-H2VT22JK.js +0 -2
- package/dist/chunks/chunk-HA7EFTPF.js +0 -23
- package/dist/chunks/chunk-IKWDL3RB.js +0 -17
- package/dist/chunks/chunk-L3KS6MOV.js +0 -2
- package/dist/chunks/chunk-NHFGEVVH.js +0 -518
- package/dist/chunks/chunk-NNF6KCHD.js +0 -3
- package/dist/chunks/chunk-PJM2G7SG.js +0 -21
- package/dist/chunks/chunk-PQHTZ5CP.js +0 -2
- package/dist/chunks/chunk-PYABBF53.js +0 -53
- package/dist/chunks/chunk-QRWPEW3Z.js +0 -24
- package/dist/chunks/chunk-QXVIIM4T.js +0 -2
- package/dist/chunks/chunk-SDEDAHV6.js +0 -160
- package/dist/chunks/chunk-TGIB24K4.js +0 -22
- package/dist/chunks/chunk-USKE34VR.js +0 -9
- package/dist/chunks/chunk-WV2APYWG.js +0 -2
- package/dist/chunks/chunk-XGE2XI6M.js +0 -191
- package/dist/chunks/chunk-XM26DGML.js +0 -3
- package/dist/chunks/chunk-YIB3J4RC.js +0 -2
- package/dist/chunks/chunk-YL6VFJ4P.js +0 -2
- package/dist/chunks/chunk-Z3D4C7BG.js +0 -12
- package/dist/chunks/cli-JVB345H2.js +0 -2
- package/dist/chunks/connected-evidence-YDPGNHLP.js +0 -2
- package/dist/chunks/core-commands-MTV4EKXY.js +0 -2
- package/dist/chunks/datasets-CP3IT47T.js +0 -2
- package/dist/chunks/desktop-test-IAZC5MAH.js +0 -3
- package/dist/chunks/dist-SAABJU5F.js +0 -2
- package/dist/chunks/evaluation-coordination-EPHLZXYM.js +0 -2
- package/dist/chunks/experiment-improvements-6JTOPA74.js +0 -2
- package/dist/chunks/experiments-XHPFGECH.js +0 -2
- package/dist/chunks/extension-GX7DLW2X.js +0 -4
- package/dist/chunks/hosted-experiment-improvement-HAB3UE6A.js +0 -3
- package/dist/chunks/hosted-harness-runtime-YM23QNDK.js +0 -2
- package/dist/chunks/hosted-profile-candidate-EOBGKQAS.js +0 -3
- package/dist/chunks/hosted-profile-compiler-OZAOZ2ES.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-RJ6XJZCS.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-SJIDXPHI.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-26EI5LJR.js +0 -3
- package/dist/chunks/human-review-AAVMISBF.js +0 -2
- package/dist/chunks/learning-FNBEIAY6.js +0 -2
- package/dist/chunks/opchat-QK43DXTY.js +0 -3
- package/dist/chunks/organizations-SRPAWKC7.js +0 -2
- package/dist/chunks/profile-C6CQNVYE.js +0 -3
- package/dist/chunks/project-agent-GZV5HNYI.js +0 -2
- package/dist/chunks/sandbox-command-4TJXQTKT.js +0 -2
- package/dist/chunks/src-P3VYLFLI.js +0 -329
- package/dist/web/assets/App-CO2F717V.css +0 -1
- package/dist/web/assets/App-CuhaCsfb.js +0 -235
- package/dist/web/assets/AppsView-BS1czXUP.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-CHxxf_Lu.js +0 -1
- package/dist/web/assets/LabsRoute-CXJRJMhr.js +0 -99
- package/dist/web/assets/MainChatThread-BwAla81W.js +0 -2
- package/dist/web/assets/MainPane-CakOBCHw.js +0 -19
- package/dist/web/assets/RightChatPanelStack-VaOOmxwd.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-D1jRQxFs.js +0 -1
- package/dist/web/assets/SettingsView-RA9OXgcu.js +0 -5
- package/dist/web/assets/WorkSidebarPanel-DwlEMEoG.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-pGVezNMw.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-Byjngd9V.js +0 -32
- package/dist/web/assets/arrow-up-right-H0pvnH2s.js +0 -1
- package/dist/web/assets/chunk-UHVJOMWN-BqXRe639.js +0 -1
- package/dist/web/assets/folder-plus-C84wrpt_.js +0 -1
- package/dist/web/assets/index-dSmk3FLJ.css +0 -1
- package/dist/web/assets/info-Dc81lEfw.js +0 -1
- package/dist/web/assets/minimize-2-Bs7MVN3C.js +0 -1
- package/dist/web/assets/monitor-DXL019Wf.js +0 -1
- package/dist/web/assets/play-CXkxUZeU.js +0 -1
- package/dist/web/assets/square-oy7f5Ce6.js +0 -1
- package/dist/web/assets/useProviderSettings-B_KeQjE5.js +0 -5
- /package/dist/chunks/{chunk-OGPHXXCD.js → chunk-BT5YNE5U.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as t,r as o}from"./index-
|
|
1
|
+
import{j as t,r as o}from"./index-BE-wXZ5R.js";/* empty css */import{fl as X,X as R,aA as le,fm as re,fn as Y,ax as G,aD as de,b5 as E,D as T,R as ce,ba as me,bc as ue,fo as ge,fp as he,fq as fe,bj as xe,fr as ve,fs as Ce}from"./App-CLFfy_Av.js";import{R as L,m as U}from"./MainPane-D3ojiN-p.js";import{T as ye,M as N}from"./MarkdownText-DOdOVFXL.js";import"./cloud-upload-B_zYztb6.js";import"./arrow-up-right-CP4hZdrJ.js";import"./square-Cb2c5td4.js";import"./folder-open-CdVKbtGq.js";import"./play-BJPzemuY.js";function be(e,l){const s=new Set(Array.from(e.matchAll(/(?:^|\s)@([a-zA-Z0-9_-]+)/g),n=>(n[1]??"").toLowerCase()));return l.filter(n=>{const d=n.handle?.toLowerCase(),r=n.name.toLowerCase().replace(/[^a-z0-9_-]+/g,"-");return d&&s.has(d)||s.has(r)}).map(n=>n.userId)}function je(e){return t.jsxs("div",{className:"team-chat-composer-reply",role:"status",children:[t.jsx(L,{size:15,"aria-hidden":"true"}),t.jsxs("button",{type:"button",className:"team-chat-composer-reply-target","aria-label":`Jump to message from ${e.authorLabel}`,onClick:e.onJump,children:[t.jsxs("strong",{children:["Replying to ",e.authorLabel]}),t.jsx("span",{children:X(e.target)})]}),t.jsx("button",{type:"button",className:"team-chat-icon-button","aria-label":"Cancel reply","data-tooltip":"Cancel reply",onClick:e.onCancel,children:t.jsx(R,{size:14})})]})}function we(e){return t.jsxs("button",{type:"button",className:"team-chat-message-reply-quote","aria-label":`Jump to replied message from ${e.authorLabel}`,onClick:e.onJump,children:[t.jsx("strong",{children:e.authorLabel}),t.jsx("span",{children:X(e.target)})]})}function Te(e){const l=o.useRef(null);if(o.useEffect(()=>{if(!e.menu)return;l.current?.focus();const n=()=>e.onClose(),d=r=>{r.key==="Escape"&&n()};return window.addEventListener("click",n),window.addEventListener("blur",n),window.addEventListener("keydown",d),window.addEventListener("scroll",n,!0),()=>{window.removeEventListener("click",n),window.removeEventListener("blur",n),window.removeEventListener("keydown",d),window.removeEventListener("scroll",n,!0)}},[e.menu,e.onClose]),!e.menu||typeof document>"u")return null;const s=t.jsx("div",{className:"team-chat-message-context-menu",role:"menu","aria-label":"Message actions",style:{left:e.menu.x,top:e.menu.y},onClick:n=>n.stopPropagation(),children:t.jsxs("button",{ref:l,type:"button",role:"menuitem",onClick:()=>{e.onReply(e.menu.message),e.onClose()},children:[t.jsx(L,{size:14}),"Reply"]})});return le.createPortal(s,document.body)}function Me(e){const d=e.clientX||e.fallbackX,r=e.clientY||e.fallbackY;return{x:Math.max(8,Math.min(d,e.viewportWidth-150-8)),y:Math.max(8,Math.min(r,e.viewportHeight-42-8))}}function V(e){return`team-chat-message-${encodeURIComponent(e)}`}function Re(e){const[l,s]=o.useState(!1),[n,d]=o.useState(e.message.body),r=e.message.refs.find(a=>a.refType==="hosted_ai_thread"),m=e.message.refs.find(a=>a.refType==="agent_run"),C=typeof r?.preview.status=="string"?r.preview.status:null,h=typeof e.message.metadata.deliveryStatus=="string"?e.message.metadata.deliveryStatus:null,b=typeof e.message.metadata.uploadProgress=="string"?e.message.metadata.uploadProgress:null,c=!e.message.deletedAt&&!h,g=re(e.message,e.messagesById),y=g?Y(g,e.membersById):null;return t.jsxs("article",{id:V(e.message.id),className:`team-chat-message${e.own?" own":""}`,tabIndex:-1,onContextMenu:a=>{if(!c)return;a.preventDefault();const x=a.currentTarget.getBoundingClientRect();e.onOpenReplyMenu(e.message,{clientX:a.clientX,clientY:a.clientY,fallbackX:x.right-12,fallbackY:x.top+24})},children:[t.jsx(Ie,{member:e.author}),t.jsxs("div",{className:"team-chat-message-content",children:[t.jsxs("header",{children:[t.jsx("strong",{children:e.author?.name??"Team member"}),t.jsx("time",{children:Se(e.message.createdAt)}),e.message.editedAt?t.jsx("span",{children:"edited"}):null,h==="sending"?t.jsx("span",{children:"sending"}):null,h==="sending"&&b?t.jsxs("span",{children:["uploaded ",b]}):null,h==="failed"?t.jsx("span",{className:"failed",children:"not sent"}):null,h==="failed"?t.jsxs("div",{className:"team-chat-message-actions visible",children:[t.jsx("button",{type:"button","data-tooltip":"Retry message","aria-label":"Retry message",onClick:()=>{e.onRetry(e.message)},children:t.jsx(G,{size:13})}),t.jsx("button",{type:"button","data-tooltip":"Remove failed message","aria-label":"Remove failed message",onClick:()=>e.onDismissFailed(e.message),children:t.jsx(R,{size:13})})]}):c||e.own&&!e.message.deletedAt?t.jsxs("div",{className:"team-chat-message-actions",children:[c?t.jsx("button",{type:"button","data-tooltip":"Reply","aria-label":"Reply to message",onClick:()=>e.onReply(e.message),children:t.jsx(L,{size:13})}):null,e.own&&!r?t.jsx("button",{type:"button","data-tooltip":"Edit message","aria-label":"Edit message",onClick:()=>s(!0),children:t.jsx(de,{size:13})}):null,e.own?t.jsx("button",{type:"button","data-tooltip":"Delete message","aria-label":"Delete message",onClick:()=>{e.onDelete(e.message)},children:t.jsx(ye,{size:13})}):null]}):null]}),g&&y?t.jsx(we,{authorLabel:y,target:g,onJump:()=>e.onJumpToMessage(g.id)}):null,l?t.jsxs("form",{className:"team-chat-message-edit",onSubmit:a=>{a.preventDefault(),e.onEdit(e.message,n).then(x=>{x&&s(!1)})},children:[t.jsx("textarea",{autoFocus:!0,value:n,onChange:a=>d(a.currentTarget.value),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),s(!1),d(e.message.body))}}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>s(!1),children:"Cancel"}),t.jsx("button",{type:"submit",disabled:!n.trim(),children:"Save"})]})]}):t.jsx("div",{className:e.message.deletedAt?"deleted":"",children:e.message.deletedAt?"Message deleted":e.message.body}),!e.message.deletedAt&&e.message.attachments.length>0?t.jsx(Ae,{message:e.message,connection:e.connection}):null,r?t.jsxs("button",{type:"button",className:"team-chat-thread-link",onClick:()=>{e.onOpenAiThread(r.refId)},children:[t.jsx(E,{size:14}),t.jsx("span",{children:"Thread"}),C&&C!=="completed"?t.jsx("small",{children:K(C)}):null,t.jsx("span",{"aria-hidden":"true",children:"›"})]}):null,m?t.jsxs("button",{type:"button",className:"team-chat-thread-link",onClick:()=>{e.onOpenAgentConversation(m.refId)},children:[t.jsx(T,{size:14}),t.jsx("span",{children:"Agent run"}),t.jsx("small",{children:K(String(m.preview.status??"queued"))}),t.jsx("span",{"aria-hidden":"true",children:"›"})]}):null]})]})}function Ae(e){const l=new Map(Array.isArray(e.message.metadata.localAttachmentPreviews)?e.message.metadata.localAttachmentPreviews.flatMap(s=>{if(!s||typeof s!="object")return[];const n=s;return typeof n.id=="string"&&typeof n.url=="string"?[[n.id,n.url]]:[]}):[]);return t.jsx("div",{className:"team-chat-message-images",children:e.message.attachments.map(s=>t.jsx(Pe,{attachmentId:s.id,alt:s.name,teamId:e.message.teamId,connection:e.connection,localUrl:l.get(s.clientAttachmentId)??null},s.id))})}function Pe(e){const[l,s]=o.useState(e.localUrl),[n,d]=o.useState(!1),r=o.useRef(0);async function m(){if(!e.connection||e.localUrl){e.localUrl||d(!0);return}d(!1);try{const C=await ce.teamChatAttachmentDownload(e.connection,e.teamId,e.attachmentId);s(C.url)}catch{s(null),d(!0)}}return o.useEffect(()=>{s(e.localUrl),d(!1),r.current=0,e.localUrl||m()},[e.attachmentId,e.connection,e.localUrl,e.teamId]),l?t.jsx("a",{href:l,target:"_blank",rel:"noreferrer","aria-label":`Open ${e.alt}`,children:t.jsx("img",{src:l,alt:e.alt,loading:"lazy",onError:()=>{if(!e.localUrl&&r.current<1){r.current+=1,m();return}s(null),d(!0)}})}):n?t.jsx("button",{type:"button",className:"team-chat-message-image-retry","aria-label":`Retry ${e.alt}`,"data-tooltip":"Retry image",onClick:()=>{r.current=0,e.localUrl?(d(!1),s(e.localUrl)):m()},children:t.jsx(G,{size:18})}):t.jsx("div",{className:"team-chat-message-image-loading",role:"status","aria-label":`Loading ${e.alt}`})}function K(e){return e==="pending"?"Starting":e==="running"?"Responding":e==="failed"?"Failed":e==="interrupted"?"Interrupted":e==="cancelled"?"Cancelled":e}function Ie({member:e}){if(e?.image)return t.jsx("img",{className:"team-chat-avatar",src:e.image,alt:""});const l=(e?.name??"T").split(/\s+/).slice(0,2).map(s=>s[0]?.toUpperCase()??"").join("");return t.jsx("span",{className:"team-chat-avatar fallback",children:l})}function Se(e){const l=new Date(e);return Number.isFinite(l.getTime())?l.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):""}const D={value:"none",label:"No project",detail:"Team conversation",options:[],busy:!1},z={value:"local",label:"Local",detail:"Local execution",options:[],action:{value:"local",label:"Local",detail:"Local execution",disabled:!1},busy:!1},Q=new Set(["codex","openai","xai","openrouter","deepseek","zai","moonshot","together","groq","custom-openai-compatible"]);function ke(e,l){return!l||e===l?e:e?`${l}
|
|
2
2
|
|
|
3
|
-
${e}`:l}function _e(){return t.jsx("section",{className:"team-chat-view team-chat-pro-view","aria-label":"Team Chat",children:t.jsxs("div",{className:"team-chat-pro-content",children:[t.jsx("span",{className:"team-chat-pro-icon","aria-hidden":"true",children:t.jsx(N,{size:22})}),t.jsx("h1",{children:"Team Chat"}),t.jsx("p",{children:"Team Chat is available with Pro mode."}),t.jsx("small",{children:"Create or join a Pro team to chat with teammates, coordinate work, and share agents."})]})})}function Fe(e){me(e.error);const[l,s]=o.useState(""),[n,d]=o.useState(!1),[r,m]=o.useState(null),[C,h]=o.useState(null),[b,c]=o.useState(0),g=o.useRef(null),y=o.useRef(!0),a=o.useRef(e.detail?.thread.id??null);a.current=e.detail?.thread.id??null;const{confirmAction:x,confirmDialog:O,resolveConfirmDialog:A}=ue(),P=o.useMemo(()=>new Map(e.members.map(i=>[i.userId,i])),[e.members]),q=o.useMemo(()=>new Map((e.detail?.messages??[]).map(i=>[i.id,i])),[e.detail?.messages]),Z=e.detail?.thread.id??null,B=r?.threadId===Z?q.get(r.message.id)??r.message:null,M=B?.deletedAt?null:B,j=M?ge(M):null,$=j?X(j,P):null,p=e.detail?he(e.detail.thread,e.currentUserId):"Team",I=Q.has(e.provider)?e.provider:"codex",_=I===e.provider?e.model:"gpt-5.6-sol",ee=o.useMemo(()=>fe({hostedActions:e.agents,profile:e.profile,teamId:e.teamId}),[e.agents,e.profile,e.teamId]),te=e.detail?.messages.at(-1)?.sequence??0;o.useEffect(()=>{if(!y.current)return;const i=g.current;i&&(i.scrollTop=i.scrollHeight)},[te,e.detail?.thread.id]);const F=o.useCallback(i=>{i.deletedAt||i.id.startsWith("pending:")||typeof i.metadata.deliveryStatus=="string"||(m({threadId:i.threadId,message:i}),d(!1),h(null),c(f=>f+1))},[]),ne=o.useCallback(()=>h(null),[]),ae=o.useCallback((i,f)=>{const v=Me({...f,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});h({message:i,...v})},[]),W=o.useCallback(i=>{const f=document.getElementById(V(i));f&&(f.scrollIntoView({behavior:"smooth",block:"center"}),f.focus({preventScroll:!0}))},[]);async function se(i=[],f=null){if(i.some(u=>u.kind!=="image"||!["image/png","image/jpeg","image/webp","image/gif"].includes(u.mediaType)))return e.showToast("Team chat supports PNG, JPEG, WebP, and GIF images.","error"),!1;let v=f;if(M&&v)return e.showToast("Remove the agent action before replying to a message.","error"),!1;if(ve(v)){const u=Ce(v);if(!u)throw new Error("The selected profile agent is missing its profile id.");if(!await x({title:`Publish ${v.label??v.name??"agent"} to Team?`,body:`This will upload the committed agent source to ${e.teamName??"this Team"}, create its hosted runtime, and then send your message.`,confirmLabel:"Publish and send",tone:"default"}))return!1;v=await e.onPublishProfileAgent(u)}const S=v?.approvalPolicy?.risk;let H=null;if(v?.approvalPolicy?.required&&S&&S!=="read"){const u=S==="destructive";if(!await x({title:u?"Approve destructive action?":"Approve external write?",body:`${v.label??v.name??"This agent action"} will use the workspace connection to ${u?"perform a destructive operation":"write external data"}. Approve this run only?`,confirmLabel:u?"Approve destructive action":"Approve write",tone:u?"danger":"default"}))return!1;H=crypto.randomUUID()}const k=l,oe=e.detail?.thread.id??null,w=M,J=()=>{a.current===oe&&(s(u=>ke(u,k)),w&&m(u=>u??{threadId:w.threadId,message:w}))};s(""),w&&m(null);try{const u=await e.onSendMessage({body:k,useModel:n,providerId:I,modelId:_,mentionUserIds:be(k,e.members),attachments:i,replyToMessage:w,selectedActionKey:v?.id??null,approvalId:H});return u?n&&d(!1):J(),u}catch(u){throw J(),u}}return t.jsxs("section",{className:"team-chat-view",children:[t.jsxs("div",{className:"team-chat-main conversation-surface-main",children:[t.jsxs("div",{className:"team-chat-messages conversation-message-scroll",role:"log","aria-live":"polite","aria-relevant":"additions text","aria-busy":e.loading,"aria-label":p,tabIndex:0,ref:g,onScroll:i=>{const f=i.currentTarget;y.current=f.scrollHeight-f.scrollTop-f.clientHeight<72},children:[e.detail?.hasMoreBefore?t.jsx("button",{type:"button",className:"team-chat-load-older",disabled:e.loading,onClick:()=>{e.onLoadMoreMessages()},children:e.loading?"Loading...":"Load older messages"}):null,e.loading&&!e.detail?t.jsx("div",{className:"team-chat-empty",children:"Loading messages..."}):e.detail?.messages.length?e.detail.messages.map(i=>t.jsx(Re,{message:i,author:i.authorUserId?P.get(i.authorUserId)??null:null,own:i.authorUserId===e.currentUserId,onOpenAiThread:e.onOpenAiThread,onOpenAgentConversation:e.onOpenAgentConversation,onEdit:e.onEditMessage,onDelete:e.onDeleteMessage,onRetry:e.onRetryMessage,onDismissFailed:e.onDismissFailedMessage,membersById:P,messagesById:q,onReply:F,onOpenReplyMenu:ae,onJumpToMessage:W,connection:e.connection},i.id)):t.jsx("div",{className:"team-chat-empty",children:"No messages yet"})]}),t.jsxs("div",{className:"team-chat-composer-shell conversation-composer-shell",children:[j&&$?t.jsx(je,{authorLabel:$,target:j,onCancel:()=>m(null),onJump:()=>W(j.id)}):null,t.jsx(U,{mode:"dock",surface:"team",teamUseModel:n,teamUseModelLocked:!!j,teamMentionMembers:e.members.filter(i=>i.userId!==e.currentUserId),actionCatalog:ee,onTeamUseModelChange:d,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy,running:!1,focusRequestId:b,submissionScopeKey:`team:${e.detail?.thread.id??"none"}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:I,model:_,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(i,f)=>se(i??[],f??null),onStop:()=>!1})]})]}),t.jsx(Te,{menu:C,onClose:ne,onReply:F}),t.jsx(xe,{state:O,onResolve:A})]})}function We(e){const[l,s]=o.useState(""),n=e.agentConversation,d=o.useRef(null),r=o.useRef(null),m=o.useRef(null),C=n.messages.at(-1)?.sequence??0,h=["pending","queued","running"].includes(n.run.status);o.useEffect(()=>{const c=d.current;c&&(c.scrollTop=c.scrollHeight)},[C,n.run.status]),o.useEffect(()=>{r.current?.focus();const c=g=>{g.key==="Escape"&&(g.preventDefault(),e.onCloseAgentConversation())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e.onCloseAgentConversation]);async function b(c){const g=m.current??crypto.randomUUID();m.current=g;const y=await e.onSendAgentTurn({body:c??l,clientRequestId:g});return y&&(m.current=null,s("")),y}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":`${n.agent.name} run`,children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize agent run panel",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(T,{size:15}),t.jsx("strong",{children:n.agent.name}),t.jsx("span",{children:n.run.status})]}),t.jsx("button",{ref:r,type:"button",className:"team-chat-icon-button","aria-label":"Close agent run",onClick:e.onCloseAgentConversation,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:d,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(c=>t.jsxs("article",{className:`team-ai-message ${c.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[c.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:c.role==="user"?"Team member":n.agent.name})]}),t.jsx(E,{connection:e.connection,content:c.body})]},c.id)),n.messages.length===0?t.jsx("div",{className:"team-chat-empty",children:"The agent run is starting."}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(U,{mode:"dock",surface:"team",teamUseModel:!1,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy||h,running:h,submissionScopeKey:`team-agent:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:e.provider,model:e.model,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:c=>{m.current=null,s(c)},showToast:e.showToast,onSubmit:async(c,g,y,a)=>b(a?.promptOverride),onStop:()=>!1})})]})}function He(e){const[l,s]=o.useState(""),n=e.aiThread,d=new Map(e.members.map(a=>[a.userId,a])),r=n.turns.at(-1)??null,m=o.useRef(null),C=n.messages.at(-1)?.sequence??0,h=o.useRef(null),b=Q.has(e.provider)?e.provider:"codex",c=b===e.provider?e.model:"gpt-5.6-sol",g=!!(n.activeTurn&&(n.activeTurn.status==="pending"||n.activeTurn.status==="running"));o.useEffect(()=>{const a=m.current;a&&(a.scrollTop=a.scrollHeight)},[C,n.activeTurn?.partialBody]),o.useEffect(()=>{h.current?.focus();const a=x=>{x.key==="Escape"&&(x.preventDefault(),e.onCloseAiThread())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e.onCloseAiThread]);async function y(a){const x=await e.onSendAiTurn({body:a??l,providerId:b,modelId:c});return x&&s(""),x}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":"AI thread",children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-label":"Resize AI thread panel","aria-orientation":"vertical",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(N,{size:15}),t.jsx("strong",{children:"AI thread"}),t.jsxs("span",{children:[n.messages.length," messages"]})]}),t.jsx("button",{ref:h,type:"button",className:"team-chat-icon-button","data-tooltip":"Close thread","aria-label":"Close thread",onClick:e.onCloseAiThread,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:m,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(a=>t.jsxs("article",{className:`team-ai-message ${a.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[a.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:a.role==="assistant"?"Model":a.createdByUserId?d.get(a.createdByUserId)?.name??"Team member":"Team member"})]}),t.jsx(E,{connection:e.connection,content:a.body})]},a.id)),n.activeTurn?.partialBody?t.jsxs("article",{className:"team-ai-message assistant streaming",children:[t.jsxs("div",{className:"team-ai-message-author",children:[t.jsx(T,{size:14}),t.jsx("strong",{children:"Model"}),t.jsx("span",{children:n.activeTurn.status})]}),t.jsx(E,{connection:e.connection,content:n.activeTurn.partialBody})]}):n.activeTurn?t.jsx("div",{className:"team-ai-running",children:n.activeTurn.status==="pending"?"Starting model...":"Model is responding..."}):r&&["failed","interrupted","cancelled"].includes(r.status)?t.jsx("div",{className:`team-ai-turn-state ${r.status}`,children:r.status==="failed"?"Model response failed":r.status==="interrupted"?"Model response was interrupted":"Model response was cancelled"}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(U,{mode:"dock",surface:"team",teamUseModel:!0,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:g,running:g,submissionScopeKey:`team-ai:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:b,model:c,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(a,x,O,A)=>y(A?.promptOverride),onStop:e.onStopAiTurn})})]})}export{We as TeamAgentConversationPanel,He as TeamAiThreadPanel,_e as TeamChatProView,Fe as TeamChatView,ke as restoreFailedTeamChatPrompt};
|
|
3
|
+
${e}`:l}function _e(){return t.jsx("section",{className:"team-chat-view team-chat-pro-view","aria-label":"Team Chat",children:t.jsxs("div",{className:"team-chat-pro-content",children:[t.jsx("span",{className:"team-chat-pro-icon","aria-hidden":"true",children:t.jsx(E,{size:22})}),t.jsx("h1",{children:"Team Chat"}),t.jsx("p",{children:"Team Chat is available with Pro mode."}),t.jsx("small",{children:"Create or join a Pro team to chat with teammates, coordinate work, and share agents."})]})})}function Fe(e){me(e.error);const[l,s]=o.useState(""),[n,d]=o.useState(!1),[r,m]=o.useState(null),[C,h]=o.useState(null),[b,c]=o.useState(0),g=o.useRef(null),y=o.useRef(!0),a=o.useRef(e.detail?.thread.id??null);a.current=e.detail?.thread.id??null;const{confirmAction:x,confirmDialog:O,resolveConfirmDialog:A}=ue(),P=o.useMemo(()=>new Map(e.members.map(i=>[i.userId,i])),[e.members]),q=o.useMemo(()=>new Map((e.detail?.messages??[]).map(i=>[i.id,i])),[e.detail?.messages]),Z=e.detail?.thread.id??null,$=r?.threadId===Z?q.get(r.message.id)??r.message:null,M=$?.deletedAt?null:$,j=M?ge(M):null,B=j?Y(j,P):null,p=e.detail?he(e.detail.thread,e.currentUserId):"Team",I=Q.has(e.provider)?e.provider:"codex",_=I===e.provider?e.model:"gpt-5.6-sol",ee=o.useMemo(()=>fe({hostedActions:e.agents,profile:e.profile,teamId:e.teamId}),[e.agents,e.profile,e.teamId]),te=e.detail?.messages.at(-1)?.sequence??0;o.useEffect(()=>{if(!y.current)return;const i=g.current;i&&(i.scrollTop=i.scrollHeight)},[te,e.detail?.thread.id]);const F=o.useCallback(i=>{i.deletedAt||i.id.startsWith("pending:")||typeof i.metadata.deliveryStatus=="string"||(m({threadId:i.threadId,message:i}),d(!1),h(null),c(f=>f+1))},[]),ne=o.useCallback(()=>h(null),[]),ae=o.useCallback((i,f)=>{const v=Me({...f,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});h({message:i,...v})},[]),W=o.useCallback(i=>{const f=document.getElementById(V(i));f&&(f.scrollIntoView({behavior:"smooth",block:"center"}),f.focus({preventScroll:!0}))},[]);async function se(i=[],f=null){if(i.some(u=>u.kind!=="image"||!["image/png","image/jpeg","image/webp","image/gif"].includes(u.mediaType)))return e.showToast("Team chat supports PNG, JPEG, WebP, and GIF images.","error"),!1;let v=f;if(M&&v)return e.showToast("Remove the agent action before replying to a message.","error"),!1;if(ve(v)){const u=Ce(v);if(!u)throw new Error("The selected profile agent is missing its profile id.");if(!await x({title:`Publish ${v.label??v.name??"agent"} to Team?`,body:`This will upload the committed agent source to ${e.teamName??"this Team"}, create its hosted runtime, and then send your message.`,confirmLabel:"Publish and send",tone:"default"}))return!1;v=await e.onPublishProfileAgent(u)}const S=v?.approvalPolicy?.risk;let J=null;if(v?.approvalPolicy?.required&&S&&S!=="read"){const u=S==="destructive";if(!await x({title:u?"Approve destructive action?":"Approve external write?",body:`${v.label??v.name??"This agent action"} will use the workspace connection to ${u?"perform a destructive operation":"write external data"}. Approve this run only?`,confirmLabel:u?"Approve destructive action":"Approve write",tone:u?"danger":"default"}))return!1;J=crypto.randomUUID()}const k=l,oe=e.detail?.thread.id??null,w=M,H=()=>{a.current===oe&&(s(u=>ke(u,k)),w&&m(u=>u??{threadId:w.threadId,message:w}))};s(""),w&&m(null);try{const u=await e.onSendMessage({body:k,useModel:n,providerId:I,modelId:_,mentionUserIds:be(k,e.members),attachments:i,replyToMessage:w,selectedActionKey:v?.id??null,approvalId:J});return u?n&&d(!1):H(),u}catch(u){throw H(),u}}return t.jsxs("section",{className:"team-chat-view",children:[t.jsxs("div",{className:"team-chat-main conversation-surface-main",children:[t.jsxs("div",{className:"team-chat-messages conversation-message-scroll",role:"log","aria-live":"polite","aria-relevant":"additions text","aria-busy":e.loading,"aria-label":p,tabIndex:0,ref:g,onScroll:i=>{const f=i.currentTarget;y.current=f.scrollHeight-f.scrollTop-f.clientHeight<72},children:[e.detail?.hasMoreBefore?t.jsx("button",{type:"button",className:"team-chat-load-older",disabled:e.loading,onClick:()=>{e.onLoadMoreMessages()},children:e.loading?"Loading...":"Load older messages"}):null,e.loading&&!e.detail?t.jsx("div",{className:"team-chat-empty",children:"Loading messages..."}):e.detail?.messages.length?e.detail.messages.map(i=>t.jsx(Re,{message:i,author:i.authorUserId?P.get(i.authorUserId)??null:null,own:i.authorUserId===e.currentUserId,onOpenAiThread:e.onOpenAiThread,onOpenAgentConversation:e.onOpenAgentConversation,onEdit:e.onEditMessage,onDelete:e.onDeleteMessage,onRetry:e.onRetryMessage,onDismissFailed:e.onDismissFailedMessage,membersById:P,messagesById:q,onReply:F,onOpenReplyMenu:ae,onJumpToMessage:W,connection:e.connection},i.id)):t.jsx("div",{className:"team-chat-empty",children:"No messages yet"})]}),t.jsxs("div",{className:"team-chat-composer-shell conversation-composer-shell",children:[j&&B?t.jsx(je,{authorLabel:B,target:j,onCancel:()=>m(null),onJump:()=>W(j.id)}):null,t.jsx(U,{mode:"dock",surface:"team",teamUseModel:n,teamUseModelLocked:!!j,teamMentionMembers:e.members.filter(i=>i.userId!==e.currentUserId),actionCatalog:ee,onTeamUseModelChange:d,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy,running:!1,focusRequestId:b,submissionScopeKey:`team:${e.detail?.thread.id??"none"}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:I,model:_,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(i,f)=>se(i??[],f??null),onStop:()=>!1})]})]}),t.jsx(Te,{menu:C,onClose:ne,onReply:F}),t.jsx(xe,{state:O,onResolve:A})]})}function We(e){const[l,s]=o.useState(""),n=e.agentConversation,d=o.useRef(null),r=o.useRef(null),m=o.useRef(null),C=n.messages.at(-1)?.sequence??0,h=["pending","queued","running"].includes(n.run.status);o.useEffect(()=>{const c=d.current;c&&(c.scrollTop=c.scrollHeight)},[C,n.run.status]),o.useEffect(()=>{r.current?.focus();const c=g=>{g.key==="Escape"&&(g.preventDefault(),e.onCloseAgentConversation())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e.onCloseAgentConversation]);async function b(c){const g=m.current??crypto.randomUUID();m.current=g;const y=await e.onSendAgentTurn({body:c??l,clientRequestId:g});return y&&(m.current=null,s("")),y}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":`${n.agent.name} run`,children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize agent run panel",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(T,{size:15}),t.jsx("strong",{children:n.agent.name}),t.jsx("span",{children:n.run.status})]}),t.jsx("button",{ref:r,type:"button",className:"team-chat-icon-button","aria-label":"Close agent run",onClick:e.onCloseAgentConversation,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:d,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(c=>t.jsxs("article",{className:`team-ai-message ${c.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[c.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:c.role==="user"?"Team member":n.agent.name})]}),t.jsx(N,{connection:e.connection,content:c.body})]},c.id)),n.messages.length===0?t.jsx("div",{className:"team-chat-empty",children:"The agent run is starting."}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(U,{mode:"dock",surface:"team",teamUseModel:!1,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy||h,running:h,submissionScopeKey:`team-agent:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:e.provider,model:e.model,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:c=>{m.current=null,s(c)},showToast:e.showToast,onSubmit:async(c,g,y,a)=>b(a?.promptOverride),onStop:()=>!1})})]})}function Je(e){const[l,s]=o.useState(""),n=e.aiThread,d=new Map(e.members.map(a=>[a.userId,a])),r=n.turns.at(-1)??null,m=o.useRef(null),C=n.messages.at(-1)?.sequence??0,h=o.useRef(null),b=Q.has(e.provider)?e.provider:"codex",c=b===e.provider?e.model:"gpt-5.6-sol",g=!!(n.activeTurn&&(n.activeTurn.status==="pending"||n.activeTurn.status==="running"));o.useEffect(()=>{const a=m.current;a&&(a.scrollTop=a.scrollHeight)},[C,n.activeTurn?.partialBody]),o.useEffect(()=>{h.current?.focus();const a=x=>{x.key==="Escape"&&(x.preventDefault(),e.onCloseAiThread())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e.onCloseAiThread]);async function y(a){const x=await e.onSendAiTurn({body:a??l,providerId:b,modelId:c});return x&&s(""),x}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":"AI thread",children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-label":"Resize AI thread panel","aria-orientation":"vertical",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(E,{size:15}),t.jsx("strong",{children:"AI thread"}),t.jsxs("span",{children:[n.messages.length," messages"]})]}),t.jsx("button",{ref:h,type:"button",className:"team-chat-icon-button","data-tooltip":"Close thread","aria-label":"Close thread",onClick:e.onCloseAiThread,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:m,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(a=>t.jsxs("article",{className:`team-ai-message ${a.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[a.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:a.role==="assistant"?"Model":a.createdByUserId?d.get(a.createdByUserId)?.name??"Team member":"Team member"})]}),t.jsx(N,{connection:e.connection,content:a.body})]},a.id)),n.activeTurn?.partialBody?t.jsxs("article",{className:"team-ai-message assistant streaming",children:[t.jsxs("div",{className:"team-ai-message-author",children:[t.jsx(T,{size:14}),t.jsx("strong",{children:"Model"}),t.jsx("span",{children:n.activeTurn.status})]}),t.jsx(N,{connection:e.connection,content:n.activeTurn.partialBody})]}):n.activeTurn?t.jsx("div",{className:"team-ai-running",children:n.activeTurn.status==="pending"?"Starting model...":"Model is responding..."}):r&&["failed","interrupted","cancelled"].includes(r.status)?t.jsx("div",{className:`team-ai-turn-state ${r.status}`,children:r.status==="failed"?"Model response failed":r.status==="interrupted"?"Model response was interrupted":"Model response was cancelled"}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(U,{mode:"dock",surface:"team",teamUseModel:!0,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:g,running:g,submissionScopeKey:`team-ai:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:b,model:c,projectTarget:D,workspaceTarget:z,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(a,x,O,A)=>y(A?.promptOverride),onStop:e.onStopAiTurn})})]})}export{We as TeamAgentConversationPanel,Je as TeamAiThreadPanel,_e as TeamChatProView,Fe as TeamChatView,ke as restoreFailedTeamChatPrompt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as O,j as X}from"./index-BxWTVKtn.js";import{a$ as Zr,bE as cs,bF as Qr,bG as ds,bH as en,bI as tn,bJ as sn,X as rn,P as us,C as nn}from"./App-CuhaCsfb.js";var on=2,an=1,ln=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,d=r-h-t;return{cols:Math.max(on,Math.floor(d/e.css.cell.width)),rows:Math.max(an,Math.floor(a/e.css.cell.height))}}};var lr=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,cn=(e,t)=>{for(var i in t)lr(e,i,{get:t[i],enumerable:!0})},J=(e,t,i,s)=>{for(var r=s>1?void 0:s?hn(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&lr(t,i,r),r},E=(e,t)=>(i,s)=>t(i,s,e),_s="Terminal input",gi={get:()=>_s,set:e=>_s=e},fs="Too much output to announce, navigate to rows manually to read",vi={get:()=>fs,set:e=>fs=e};function dn(e){return e.replace(/\r?\n/g,"\r")}function un(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function _n(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function fn(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");hr(r,t,i,s)}}function hr(e,t,i,s){e=dn(e),e=un(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function cr(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function ps(e,t,i,s,r){cr(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Ge(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Qt(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var pn=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let l=e.charCodeAt(n);56320<=l&&l<=57343?t[s++]=(o-55296)*1024+l-56320+65536:(t[s++]=o,t[s++]=l);continue}o!==65279&&(t[s++]=o)}return s}},gn=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,l,h=0,a=0;if(this.interim[0]){let u=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,g;for(;(g=this.interim[++_]&63)&&_<4;)f<<=6,f|=g;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=k-_;for(;a<M;){if(a>=i)return 0;if(g=e[a++],(g&192)!==128){a--,u=!0;break}else this.interim[_++]=g,f<<=6,f|=g&63}u||(k===2?f<128?a--:t[s++]=f:k===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let d=i-4,c=a;for(;c<i;){for(;c<d&&!((r=e[c])&128)&&!((n=e[c+1])&128)&&!((o=e[c+2])&128)&&!((l=e[c+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=l,c+=4;if(r=e[c++],r<128)t[s++]=r;else if((r&224)===192){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(h=(r&31)<<6|n&63,h<128){c--;continue}t[s++]=h}else if((r&240)===224){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(l=e[c++],(l&192)!==128){c--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|l&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},dr="",Je=" ",Lt=class ur{constructor(){this.fg=0,this.bg=0,this.extended=new Yt}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new ur;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Yt=class _r{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new _r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Re=class fr extends Lt{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Yt,this.combinedData=""}static fromCharData(t){let i=new fr;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ge(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},gs="di$target",mi="di$dependencies",si=new Map;function vn(e){return e[mi]||[]}function ue(e){if(si.has(e))return si.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");mn(t,i,r)};return t._id=e,si.set(e,t),t}function mn(e,t,i){t[gs]===t?t[mi].push({id:e,index:i}):(t[mi]=[{id:e,index:i}],t[gs]=t)}var me=ue("BufferService"),pr=ue("CoreMouseService"),at=ue("CoreService"),Sn=ue("CharsetService"),Qi=ue("InstantiationService"),gr=ue("LogService"),Se=ue("OptionsService"),vr=ue("OscLinkService"),wn=ue("UnicodeService"),Pt=ue("DecorationService"),Si=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Re,o=i.getTrimmedLength(),l=-1,h=-1,a=!1;for(let d=0;d<o;d++)if(!(h===-1&&!i.hasContent(d))){if(i.loadCell(d,n),n.hasExtendedAttrs()&&n.extended.urlId)if(h===-1){h=d,l=n.extended.urlId;continue}else a=n.extended.urlId!==l;else h!==-1&&(a=!0);if(a||h!==-1&&d===o-1){let c=this._oscLinkService.getLinkData(l)?.uri;if(c){let u={start:{x:h+1,y:e},end:{x:d+(!a&&d===o-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let _=new URL(c);["http:","https:"].includes(_.protocol)||(f=!0)}catch{f=!0}f||s.push({text:c,range:u,activate:(_,g)=>r?r.activate(_,g,u):bn(_,g),hover:(_,g)=>r?.hover?.(_,g,u),leave:(_,g)=>r?.leave?.(_,g,u)})}a=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=d,l=n.extended.urlId):(h=-1,l=-1)}}t(s)}};Si=J([E(0,me),E(1,Se),E(2,vr)],Si);function bn(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{r as O,j as X}from"./index-BE-wXZ5R.js";import{ba as Zr,bP as cs,bQ as Qr,bR as ds,bS as en,bT as tn,bU as sn,X as rn,p as us,C as nn}from"./App-CLFfy_Av.js";var on=2,an=1,ln=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,d=r-h-t;return{cols:Math.max(on,Math.floor(d/e.css.cell.width)),rows:Math.max(an,Math.floor(a/e.css.cell.height))}}};var lr=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,cn=(e,t)=>{for(var i in t)lr(e,i,{get:t[i],enumerable:!0})},J=(e,t,i,s)=>{for(var r=s>1?void 0:s?hn(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&lr(t,i,r),r},E=(e,t)=>(i,s)=>t(i,s,e),_s="Terminal input",gi={get:()=>_s,set:e=>_s=e},fs="Too much output to announce, navigate to rows manually to read",vi={get:()=>fs,set:e=>fs=e};function dn(e){return e.replace(/\r?\n/g,"\r")}function un(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function _n(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function fn(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");hr(r,t,i,s)}}function hr(e,t,i,s){e=dn(e),e=un(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function cr(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function ps(e,t,i,s,r){cr(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Ge(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Qt(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var pn=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let l=e.charCodeAt(n);56320<=l&&l<=57343?t[s++]=(o-55296)*1024+l-56320+65536:(t[s++]=o,t[s++]=l);continue}o!==65279&&(t[s++]=o)}return s}},gn=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,l,h=0,a=0;if(this.interim[0]){let u=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,g;for(;(g=this.interim[++_]&63)&&_<4;)f<<=6,f|=g;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=k-_;for(;a<M;){if(a>=i)return 0;if(g=e[a++],(g&192)!==128){a--,u=!0;break}else this.interim[_++]=g,f<<=6,f|=g&63}u||(k===2?f<128?a--:t[s++]=f:k===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let d=i-4,c=a;for(;c<i;){for(;c<d&&!((r=e[c])&128)&&!((n=e[c+1])&128)&&!((o=e[c+2])&128)&&!((l=e[c+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=l,c+=4;if(r=e[c++],r<128)t[s++]=r;else if((r&224)===192){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(h=(r&31)<<6|n&63,h<128){c--;continue}t[s++]=h}else if((r&240)===224){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(l=e[c++],(l&192)!==128){c--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|l&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},dr="",Je=" ",Lt=class ur{constructor(){this.fg=0,this.bg=0,this.extended=new Yt}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new ur;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Yt=class _r{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new _r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Re=class fr extends Lt{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Yt,this.combinedData=""}static fromCharData(t){let i=new fr;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ge(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},gs="di$target",mi="di$dependencies",si=new Map;function vn(e){return e[mi]||[]}function ue(e){if(si.has(e))return si.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");mn(t,i,r)};return t._id=e,si.set(e,t),t}function mn(e,t,i){t[gs]===t?t[mi].push({id:e,index:i}):(t[mi]=[{id:e,index:i}],t[gs]=t)}var me=ue("BufferService"),pr=ue("CoreMouseService"),at=ue("CoreService"),Sn=ue("CharsetService"),Qi=ue("InstantiationService"),gr=ue("LogService"),Se=ue("OptionsService"),vr=ue("OscLinkService"),wn=ue("UnicodeService"),Pt=ue("DecorationService"),Si=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Re,o=i.getTrimmedLength(),l=-1,h=-1,a=!1;for(let d=0;d<o;d++)if(!(h===-1&&!i.hasContent(d))){if(i.loadCell(d,n),n.hasExtendedAttrs()&&n.extended.urlId)if(h===-1){h=d,l=n.extended.urlId;continue}else a=n.extended.urlId!==l;else h!==-1&&(a=!0);if(a||h!==-1&&d===o-1){let c=this._oscLinkService.getLinkData(l)?.uri;if(c){let u={start:{x:h+1,y:e},end:{x:d+(!a&&d===o-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let _=new URL(c);["http:","https:"].includes(_.protocol)||(f=!0)}catch{f=!0}f||s.push({text:c,range:u,activate:(_,g)=>r?r.activate(_,g,u):bn(_,g),hover:(_,g)=>r?.hover?.(_,g,u),leave:(_,g)=>r?.leave?.(_,g,u)})}a=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=d,l=n.extended.urlId):(h=-1,l=-1)}}t(s)}};Si=J([E(0,me),E(1,Se),E(2,vr)],Si);function bn(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var ei=ue("CharSizeService"),Ue=ue("CoreBrowserService"),es=ue("MouseService"),qe=ue("RenderService"),yn=ue("SelectionService"),mr=ue("CharacterJoinerService"),_t=ue("ThemeService"),Sr=ue("LinkProviderService"),Cn=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?vs.isErrorNoTelemetry(e)?new vs(e.message+`
|
|
4
4
|
|
package/dist/web/assets/{TrainingCreationPanel-CgIBVGha.js → TrainingCreationPanel-D75K0yk5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as e}from"./index-
|
|
1
|
+
import{r as h,j as e}from"./index-BE-wXZ5R.js";import{bw as f,aC as b,G as d,t as x,X as j}from"./App-CLFfy_Av.js";/* empty css */function N({creation:s,training:r,compact:i=!1,onOpenTraining:t}){const[o,g]=h.useState(""),[c,u]=h.useState(""),n=s.state,a=!!r.busyAction;return h.useEffect(()=>{g(""),u("")},[s.id,n]),e.jsxs("section",{className:i?`composer-create-strip ${w(n)} training-create-strip`:"training-approval","aria-label":"Training task status",children:[i?e.jsxs("div",{className:"composer-create-strip-heading",children:[n==="planning"||n==="materializing"||n==="validating"?e.jsx(f,{className:"composer-create-spin",size:15}):n==="failed"?e.jsx(b,{size:15}):e.jsx(d,{size:15}),e.jsx("span",{children:v(n)}),e.jsx("small",{children:"training"})]}):null,n==="awaiting_disclosure_approval"?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:"Review selected evidence with the authoring model?"}),e.jsxs("p",{children:["Approve sends excerpts from ",s.request.sourceIds.length," explicitly selected source",s.request.sourceIds.length===1?"":"s"," to ",s.request.analysisModel?.providerId,"/",s.request.analysisModel?.modelId," so it can propose a Taskset and grader. This does not start training."]}),e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Approve evidence"})]}),e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Decline"})]}),i&&t?e.jsxs("button",{disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]}):null]})]}):n==="awaiting_materialization_approval"&&s.proposal?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:s.proposal.name}),e.jsx("p",{children:s.proposal.objective}),e.jsxs("div",{className:"training-creation-plan-facts",children:[e.jsx("span",{children:s.proposal.taskKind.replaceAll("_"," ")}),e.jsxs("span",{children:[s.proposal.proposedGraders.length," grader",s.proposal.proposedGraders.length===1?"":"s"]}),e.jsx("span",{children:s.proposal.proposedMethod.replaceAll("_"," ")})]}),s.request.mode==="customize"?e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:c,onChange:l=>u(l.target.value),placeholder:"Revise tasks, graders, fixtures, or policy"}),e.jsx("button",{className:i?void 0:"training-button secondary",disabled:!c.trim()||a,onClick:async()=>{const l=c;u(""),await r.actions.chatCreation(s.id,l)},children:"Revise"})]}):null,e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.materialize(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Materialize Taskset"})]}),t?e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Review details"})]}):null,e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.materialize(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Cancel"})]})]})]}):n==="awaiting_questions"?e.jsx("div",{className:i?"composer-create-question":"training-creation-content",children:(()=>{const l=s.blockingQuestions.find(p=>!p.answer);return l?e.jsxs(e.Fragment,{children:[e.jsx("p",{children:l.prompt}),e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:o,onChange:p=>g(p.target.value)}),e.jsx("button",{className:i?void 0:"training-button",disabled:!o.trim()||a,onClick:()=>{r.actions.answerQuestions(s.id,{[l.id]:o})},children:"Continue"})]})]}):null})()}):e.jsxs("div",{className:i?"composer-create-status-body":"training-creation-content",children:[e.jsx("p",{children:m(s)}),i&&t?e.jsx("div",{className:"composer-create-actions",children:e.jsxs("button",{onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]})}):null]})]})}function T({creation:s}){return e.jsxs("section",{className:"chat-create-receipt","aria-label":"Training status",children:[e.jsxs("div",{className:"chat-create-receipt-heading",children:[e.jsx(d,{size:14}),e.jsx("span",{children:v(s.state)}),e.jsx("small",{children:"training"})]}),e.jsx("p",{children:s.request.objective??m(s)}),e.jsxs("div",{className:"chat-create-receipt-facts",children:[e.jsxs("span",{children:[s.request.sourceIds.length," selected source",s.request.sourceIds.length===1?"":"s"]}),e.jsx("span",{children:s.request.mode==="customize"?"guided plan":"fast draft"})]})]})}function v(s){return s==="awaiting_disclosure_approval"?"Training evidence review":s==="awaiting_materialization_approval"?"Training plan ready":s==="awaiting_questions"?"Training question":s==="materializing"?"Materializing Taskset":s==="ready"?"Taskset ready":s==="failed"?"Training plan failed":s==="cancelled"?"Training plan cancelled":"Preparing training plan"}function m(s){return s.blockedReason?s.blockedReason:s.state==="ready"?"The reviewed Taskset was materialized. Training still requires a separate approval.":s.state==="cancelled"?"Taskset creation was cancelled.":s.state==="planning"?"The authoring model is proposing tasks, graders, fixtures, and policy boundaries.":`Task Creator is ${s.state.replaceAll("_"," ")}.`}function w(s){return s==="ready"?"success":s==="failed"||s==="cancelled"?"danger":s==="awaiting_disclosure_approval"||s==="awaiting_materialization_approval"||s==="awaiting_questions"?"warning":"info"}export{N as TrainingCreationPanel,T as TrainingStatusReceipt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-BE-wXZ5R.js";import{bv as p,bV as j}from"./App-CLFfy_Av.js";import{M as x}from"./minimize-2-Cyg_zD9z.js";/* empty css */function k({training:r,sessionId:t,expanded:i,onOpenTraining:d,onResizeStart:o,onToggleExpanded:l}){const n=r.payload?.sources.filter(e=>e.sessionId===t)??[],c=new Set(n.map(e=>e.id)),a=r.payload?.creations.find(e=>e.request.sourceIds.some(h=>c.has(h)))??null;return s.jsxs("aside",{className:`workspace-diff-panel training-draft-panel ${i?"expanded":""}`,"aria-label":"Training task draft",children:[i?null:s.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize task draft",onPointerDown:o}),s.jsxs("div",{className:"workspace-diff-topbar",children:[s.jsx("div",{className:"workspace-diff-tabs",children:s.jsxs("button",{type:"button",className:"workspace-diff-tab active",children:[s.jsx(p,{size:14}),s.jsx("span",{children:"Task draft"})]})}),s.jsx("div",{className:"workspace-diff-toolbar-actions",children:s.jsx("button",{className:"diff-icon-button",type:"button",onClick:l,"aria-label":i?"Dock task draft":"Expand task draft",children:i?s.jsx(x,{size:14}):s.jsx(j,{size:14})})})]}),s.jsxs("div",{className:"training-draft-body",children:[s.jsx("span",{className:"training-eyebrow",children:"Selected chat"}),s.jsx("h2",{children:n[0]?.title??"Not added to training"}),s.jsxs("dl",{className:"training-definition",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Sources"}),s.jsx("dd",{children:n.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{children:a?.state.replaceAll("_"," ")??"No draft"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Method"}),s.jsx("dd",{children:a?.proposal?.proposedMethod??"Pending"})]})]}),a?.proposal?s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:a.proposal.name}),s.jsx("p",{children:a.proposal.objective})]}):s.jsxs("p",{children:["Add this chat with the sidebar action or run ",s.jsx("code",{children:"/train"}),"."]}),a?.blockedReason?s.jsx("p",{className:"training-draft-warning",children:a.blockedReason}):null,s.jsx("button",{className:"training-button secondary",type:"button",onClick:d,children:"Open Training"})]})]})}export{k as TrainingDraftPanel};
|
package/dist/web/assets/{UsageSettingsSection-CSRjJUSa.js → UsageSettingsSection-CYTmp7PG.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as f,j as l}from"./index-
|
|
1
|
+
import{r as f,j as l}from"./index-BE-wXZ5R.js";import{aA as ia,bw as kt,bM as la,ba as oa,R as Te}from"./App-CLFfy_Av.js";import{A as sa}from"./arrow-up-right-CP4hZdrJ.js";import{w as ca,c as me,s as ua,i as le,a as _e,u as jt,r as Fe,b as ze,S as da,d as oe,e as ma,p as At,f as fa,g as va,h as ha,j as pa,k as ga,l as ue,m as ya,n as nt,o as ba,q as xa,t as ka,v as ja,x as Aa,y as je,z as $e,A as Le,B as Pa,C as Pt,R as Sa,D as Ia,E as z,F as Ta,G as wa,H as ne,I as Oa,J,K as Q,L as St,M as It,N as Tt,O as Ca,P as Na,Q as rt,T as Ma,U as it,V as Ea,W as pe,X as Ue,Y as Da,Z as wt,_ as $a,$ as La,a0 as Ba,a1 as We,a2 as $,a3 as Ot,a4 as Ra,a5 as qa,a6 as Ka,a7 as _a,a8 as Fa,a9 as za,aa as Ct,ab as Ua,ac as Wa,ad as Ha,ae as lt,af as Nt,ag as Ga,ah as Va,ai as Ya,aj as Xa,ak as Za,al as Ja,am as Qa,an as en,ao as ot,ap as tn,aq as an,ar as nn,as as rn,at as ln,au as on,av as sn}from"./CartesianChart-JPqo6YOf.js";const Mt=Math.cos,ge=Math.sin,R=Math.sqrt,ye=Math.PI,Ae=2*ye,He={draw(e,t){const a=R(t/ye);e.moveTo(a,0),e.arc(0,0,a,0,Ae)}},cn={draw(e,t){const a=R(t/5)/2;e.moveTo(-3*a,-a),e.lineTo(-a,-a),e.lineTo(-a,-3*a),e.lineTo(a,-3*a),e.lineTo(a,-a),e.lineTo(3*a,-a),e.lineTo(3*a,a),e.lineTo(a,a),e.lineTo(a,3*a),e.lineTo(-a,3*a),e.lineTo(-a,a),e.lineTo(-3*a,a),e.closePath()}},Et=R(1/3),un=Et*2,dn={draw(e,t){const a=R(t/un),n=a*Et;e.moveTo(0,-a),e.lineTo(n,0),e.lineTo(0,a),e.lineTo(-n,0),e.closePath()}},mn={draw(e,t){const a=R(t),n=-a/2;e.rect(n,n,a,a)}},fn=.8908130915292852,Dt=ge(ye/10)/ge(7*ye/10),vn=ge(Ae/10)*Dt,hn=-Mt(Ae/10)*Dt,pn={draw(e,t){const a=R(t*fn),n=vn*a,r=hn*a;e.moveTo(0,-a),e.lineTo(n,r);for(let i=1;i<5;++i){const o=Ae*i/5,u=Mt(o),d=ge(o);e.lineTo(d*a,-u*a),e.lineTo(u*n-d*r,d*n+u*r)}e.closePath()}},we=R(3),gn={draw(e,t){const a=-R(t/(we*3));e.moveTo(0,a*2),e.lineTo(-we*a,-a),e.lineTo(we*a,-a),e.closePath()}},N=-.5,M=R(3)/2,Be=1/R(12),yn=(Be/2+1)*3,bn={draw(e,t){const a=R(t/yn),n=a/2,r=a*Be,i=n,o=a*Be+a,u=-i,d=o;e.moveTo(n,r),e.lineTo(i,o),e.lineTo(u,d),e.lineTo(N*n-M*r,M*n+N*r),e.lineTo(N*i-M*o,M*i+N*o),e.lineTo(N*u-M*d,M*u+N*d),e.lineTo(N*n+M*r,N*r-M*n),e.lineTo(N*i+M*o,N*o-M*i),e.lineTo(N*u+M*d,N*d-M*u),e.closePath()}};function xn(e,t){let a=null,n=ca(r);e=typeof e=="function"?e:me(e||He),t=typeof t=="function"?t:me(t===void 0?64:+t);function r(){let i;if(a||(a=i=n()),e.apply(this,arguments).draw(a,+t.apply(this,arguments)),i)return a=null,i+""||null}return r.type=function(i){return arguments.length?(e=typeof i=="function"?i:me(i),r):e},r.size=function(i){return arguments.length?(t=typeof i=="function"?i:me(+i),r):t},r.context=function(i){return arguments.length?(a=i??null,r):a},r}var kn=["type","size","sizeType"];function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Re.apply(null,arguments)}function st(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function ct(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?st(Object(a),!0).forEach(function(n){jn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):st(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function jn(e,t,a){return(t=An(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function An(e){var t=Pn(e,"string");return typeof t=="symbol"?t:t+""}function Pn(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sn(e,t){if(e==null)return{};var a,n,r=In(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function In(e,t){if(e==null)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;a[n]=e[n]}return a}var $t={symbolCircle:He,symbolCross:cn,symbolDiamond:dn,symbolSquare:mn,symbolStar:pn,symbolTriangle:gn,symbolWye:bn},Tn=Math.PI/180,wn=e=>{var t="symbol".concat(jt(e));return $t[t]||He},On=(e,t,a)=>{if(t==="area")return e;switch(a){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Tn;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Cn=(e,t)=>{$t["symbol".concat(jt(e))]=t},Lt=e=>{var t=e.type,a=t===void 0?"circle":t,n=e.size,r=n===void 0?64:n,i=e.sizeType,o=i===void 0?"area":i,u=Sn(e,kn),d=ct(ct({},u),{},{type:a,size:r,sizeType:o}),s="circle";typeof a=="string"&&(s=a);var c=()=>{var b=wn(s),p=xn().type(b).size(On(r,o,s)),x=p();if(x!==null)return x},m=d.className,v=d.cx,y=d.cy,h=ua(d);return le(v)&&le(y)&&le(r)?f.createElement("path",Re({},h,{className:_e("recharts-symbols",m),transform:"translate(".concat(v,", ").concat(y,")"),d:c()})):null};Lt.registerSymbol=Cn;function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},be.apply(null,arguments)}function ut(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function Bt(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(a),!0).forEach(function(n){Nn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ut(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function Nn(e,t,a){return(t=Mn(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Mn(e){var t=En(e,"string");return typeof t=="symbol"?t:t+""}function En(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E=32,Dn={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function $n(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Ln(e){var t=e.data,a=e.iconType,n=e.inactiveColor,r=E/2,i=E/6,o=E/3,u=t.inactive?n:t.color,d=a??t.type;if(d==="none")return null;if(d==="plainline")return f.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:$n(t.payload),x1:0,y1:r,x2:E,y2:r,className:"recharts-legend-icon"});if(d==="line")return f.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(r,"h").concat(o,`
|
|
2
2
|
A`).concat(i,",").concat(i,",0,1,1,").concat(2*o,",").concat(r,`
|
|
3
3
|
H`).concat(E,"M").concat(2*o,",").concat(r,`
|
|
4
4
|
A`).concat(i,",").concat(i,",0,1,1,").concat(o,",").concat(r),className:"recharts-legend-icon"});if(d==="rect")return f.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(E/8,"h").concat(E,"v").concat(E*3/4,"h").concat(-E,"z"),className:"recharts-legend-icon"});if(f.isValidElement(t.legendIcon)){var s=Bt({},t);return delete s.legendIcon,f.cloneElement(t.legendIcon,s)}return f.createElement(Lt,{fill:u,cx:r,cy:r,size:E,sizeType:"diameter",type:d})}function Bn(e){var t=e.payload,a=e.iconSize,n=e.layout,r=e.formatter,i=e.inactiveColor,o=e.iconType,u=e.labelStyle,d={x:0,y:0,width:E,height:E},s={display:n==="horizontal"?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,v)=>{var y=m.formatter||r,h=_e({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?Bt({},u):{};b.color=m.inactive?i:b.color||m.color;var p=y?y(m.value,m,v):m.value;return f.createElement("li",be({className:h,style:s,key:"legend-item-".concat(v)},ze(e,m,v)),f.createElement(da,{width:a,height:a,viewBox:d,style:c,"aria-label":m.value==null?"legend icon":"".concat(m.value," legend icon")},f.createElement(Ln,{data:m,iconType:o,inactiveColor:i})),f.createElement("span",{className:"recharts-legend-item-text",style:b},p))})}var Rn=e=>{var t=Fe(e,Dn),a=t.payload,n=t.layout,r=t.align;if(!a||!a.length)return null;var i={padding:0,margin:0,textAlign:n==="horizontal"?r:"left"};return f.createElement("ul",{className:"recharts-default-legend",style:i},f.createElement(Bn,be({},t,{payload:a})))};function qn(){return oe(ma)}var Kn=["contextPayload"];function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},qe.apply(null,arguments)}function _n(e,t){return Wn(e)||Un(e,t)||zn(e,t)||Fn()}function Fn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h,j as e}from"./index-BE-wXZ5R.js";import{ce as I,bH as f,s as a,n as w,bI as k,o as x,bJ as b,bK as j,_ as A,bV as pe,G as $,av as fe,bM as D,R as U}from"./App-CLFfy_Av.js";import{M as xe,r as V,s as he,T as ke}from"./MarkdownText-DOdOVFXL.js";import{F as q}from"./folder-open-CdVKbtGq.js";import{M as ve}from"./minimize-2-Cyg_zD9z.js";import{P as K}from"./MainPane-D3ojiN-p.js";import"./cloud-upload-B_zYztb6.js";import"./arrow-up-right-CP4hZdrJ.js";import"./square-Cb2c5td4.js";import"./play-BJPzemuY.js";const _=x({id:a().trim().min(1).max(200),title:a().trim().min(1).max(240),sourceTaskId:a().trim().min(1).max(200),sourceTurnId:a().trim().min(1).max(200),revision:w().int().positive().default(1),createdAt:a().datetime()}),C=x({kind:A(["structural","visual","test","user_review"]),status:A(["passed","failed","not_run"]),label:a().trim().min(1).max(240),detail:a().trim().max(4e3).nullable().optional(),ref:a().trim().max(4096).nullable().optional()}),J=x({kind:k("local"),path:a().trim().min(1).max(4096),deviceId:a().trim().min(1).max(200)}),Q=x({kind:k("managed"),fileId:a().trim().min(1).max(200),downloadPath:a().trim().min(1).max(4096)}),be=x({kind:k("external"),provider:a().trim().min(1).max(120),resourceId:a().trim().min(1).max(500),url:a().url().nullable()}),X=_.extend({kind:k("file"),contentType:a().trim().min(1).max(200),sizeBytes:w().int().nonnegative(),sha256:a().regex(/^[a-f0-9]{64}$/),location:I("kind",[J,Q,be]),validation:f(C).max(32).default([])}),je=_.extend({kind:k("source_change"),projectId:a().trim().min(1).max(200),ref:a().trim().min(1).max(500),url:a().url().nullable(),validation:f(C).max(32).default([])}),ye=_.extend({kind:k("deployment"),deploymentId:a().trim().min(1).max(200),url:a().url(),validation:f(C).max(32).default([])}),ge=_.extend({kind:k("external_resource"),provider:a().trim().min(1).max(120),resourceId:a().trim().min(1).max(500),url:a().url(),contentType:a().trim().min(1).max(200).nullable(),validation:f(C).max(32).default([])}),Y=x({id:a().trim().min(1).max(191),label:a().trim().min(1).max(160).nullable(),description:a().trim().max(1e3).nullable(),inputSchema:b(a(),j()).nullable(),outputSchema:b(a(),j()).nullable(),schedulePolicy:b(a(),j()).nullable()}),Z=x({base:a().trim().min(1).max(200),resources:b(a(),j()),modelPolicy:b(a(),j()).nullable(),setup:b(a(),j()).nullable()}),we=x({id:a().trim().min(1).max(200),kind:A(["sdk_validation","sdk_eval"]),status:A(["passed","failed"]),summary:a().trim().min(1).max(2e3),artifactPath:a().trim().min(1).max(4096),artifactSha256:a().regex(/^[a-f0-9]{64}$/)}),Re=x({path:a().trim().min(1).max(4096),sizeBytes:w().int().nonnegative(),sha256:a().regex(/^[a-f0-9]{64}$/),contentsBase64:a()});x({schema:k("openpond.agent-package.v1"),agentId:a().trim().min(1).max(191),versionId:a().trim().min(1).max(200),digest:a().regex(/^[a-f0-9]{64}$/),title:a().trim().min(1).max(240),source:x({files:f(Re).min(1).max(1e3),totalSizeBytes:w().int().nonnegative()}),manifest:b(a(),j()),actions:f(Y).min(1).max(256),runtimeRequirements:Z,receipts:f(we).min(2).max(64)});const _e=_.extend({kind:k("agent_package"),agentId:a().trim().min(1).max(191),versionId:a().trim().min(1).max(200),digest:a().regex(/^[a-f0-9]{64}$/),packageFileId:a().trim().min(1).max(200),manifestFileId:a().trim().min(1).max(200),actions:f(Y).min(1).max(256),runtimeRequirements:Z,validationReceiptIds:f(a().trim().min(1).max(200)).min(1).max(32),evalReceiptIds:f(a().trim().min(1).max(200)).min(1).max(32),sourceFileCount:w().int().positive(),sourceSizeBytes:w().int().nonnegative(),location:I("kind",[J,Q]),validation:f(C).max(32).default([])}),Ce=I("kind",[X,je,ye,ge,_e]);x({outputs:f(X)});function He({chatMessages:i,connection:r,contextWindowStatus:c,expanded:s,runtimeEvents:d,sessionId:u,showToast:m,onResizeStart:ee,onToggleExpanded:te,onUseOutput:ie,onHandoffOutput:ne,onReviseOutput:ae,onAgentPackageInstalled:se}){const[R,re]=h.useState("outputs"),[y,g]=h.useState(null),[o,S]=h.useState(null),[O,F]=h.useState(""),[oe,le]=h.useState({}),P=h.useMemo(()=>Oe(d),[d]),E=h.useMemo(()=>Ne(P),[P]),L=h.useMemo(()=>Ae(i),[i]),M=h.useMemo(()=>Se(i),[i]),T=h.useMemo(()=>$e(i),[i]);h.useEffect(()=>()=>{o?.objectUrl&&URL.revokeObjectURL(o.objectUrl)},[o?.objectUrl]);async function N(t){if(!r||!u||t.kind!=="file")return null;g(p(t));try{const n=await U.workspaceTool(r,u,{action:"work_output_read",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);const l=Be(n.data),v=typeof l.contentsBase64=="string"?l.contentsBase64:"";if(!v)throw new Error("The output did not include file data.");return new File([ze(v)],t.title,{type:t.contentType})}catch(n){return m(n instanceof Error?n.message:"Could not load the output.","error"),null}finally{g(null)}}async function ce(t){const n=await N(t);if(!n)return;o?.objectUrl&&URL.revokeObjectURL(o.objectUrl);const l=t.kind==="file"&&(t.contentType.startsWith("text/")||t.contentType==="application/json");F(""),S({output:t,file:n,text:l?await n.text():null,objectUrl:l?null:URL.createObjectURL(n)})}async function de(t){const n=await N(t);n&&(ie(n),m("Added the output to the task as input.","success"))}async function W(t,n){const l=n.kind==="file"?await N(n):null;n.kind==="file"&&!l||await ne(t,n,l)}async function ue(t){if(!(!r||!u)&&window.confirm(`Delete ${t.title} revision ${t.revision} from this device?`)){g(p(t));try{const n=await U.workspaceTool(r,u,{action:"work_output_delete",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);o?.output.id===t.id&&S(null),m("Work output deleted.","success")}catch(n){m(n instanceof Error?n.message:"Could not delete the output.","error")}finally{g(null)}}}async function me(t){if(!r||!u||!window.confirm(`Add ${t.title} version ${t.versionId} to your active Agents profile?`))return;const n=async l=>U.workspaceTool(r,u,{action:"work_agent_package_install",source:"ui_button",args:{outputId:t.id,revision:t.revision,overwrite:l}});g(p(t));try{let l;try{l=await n(!1)}catch(v){if(!(v instanceof Error?v.message:"Agent installation failed.").includes("already exists")||!window.confirm(`${t.agentId} already exists. Replace its active checkout with this immutable version?`))throw v;l=await n(!0)}if(!l.ok)throw new Error(l.output);await se?.(),m(`${t.title} was added to Agents. Its package remains available in this Work task.`,"success")}catch(l){m(l instanceof Error?l.message:"Could not add the Agent package.","error")}finally{g(null)}}return e.jsxs("aside",{className:`workspace-diff-panel work-sidebar-panel ${s?"expanded":""}`,"aria-label":"Work details",children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize Work details",onPointerDown:ee}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Work details",children:[["outputs","Outputs"],["activity","Activity"],["context","Context"]].map(([t,n])=>e.jsx("button",{type:"button",className:`workspace-diff-tab ${R===t?"active":""}`,role:"tab","aria-selected":R===t,onClick:()=>re(t),children:n},t))}),e.jsx("div",{className:"workspace-diff-toolbar-actions",children:e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:te,children:s?e.jsx(ve,{size:14}):e.jsx(pe,{size:14})})})]}),e.jsxs("div",{className:"work-sidebar-body",children:[R==="outputs"?o?e.jsxs("div",{className:"work-output-preview",children:[e.jsxs("header",{children:[e.jsx("button",{type:"button",onClick:()=>{o.objectUrl&&URL.revokeObjectURL(o.objectUrl),S(null)},children:"Outputs"}),e.jsxs("strong",{children:[o.output.title," · revision ",o.output.revision]})]}),o.text!==null?e.jsx(xe,{content:o.text}):o.output.kind==="file"&&o.output.contentType.startsWith("image/")&&o.objectUrl?e.jsx("img",{src:o.objectUrl,alt:o.output.title}):o.output.kind==="file"&&o.output.contentType==="application/pdf"&&o.objectUrl?e.jsx("iframe",{src:o.objectUrl,title:o.output.title}):o.output.kind==="file"&&o.output.contentType.startsWith("audio/")&&o.objectUrl?e.jsx("audio",{controls:!0,src:o.objectUrl}):o.output.kind==="file"&&o.output.contentType.startsWith("video/")&&o.objectUrl?e.jsx("video",{controls:!0,src:o.objectUrl}):e.jsx("p",{children:"This file type uses its native application for detailed review."}),e.jsxs("section",{className:"work-output-annotation",children:[e.jsx("label",{htmlFor:"work-output-revision-note",children:"Revision note"}),e.jsx("textarea",{id:"work-output-revision-note",value:O,onChange:t=>F(t.target.value),placeholder:"Describe the exact change to make in the next revision."}),e.jsx("button",{type:"button",disabled:!O.trim(),onClick:()=>{ae(o.output,o.file,O.trim()),m(`Prepared revision ${o.output.revision+1}.`,"success")},children:"Revise this version"})]})]}):E.length>0?e.jsx("div",{className:"work-output-list",children:E.map(t=>{const n=t.revisions.find(l=>l.revision===oe[t.id])??t.revisions[0];return e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx($,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:n.title}),t.revisions.length>1?e.jsxs("label",{className:"work-output-version",children:[e.jsx("span",{children:"Version"}),e.jsx("select",{value:n.revision,onChange:l=>le(v=>({...v,[t.id]:Number(l.target.value)})),children:t.revisions.map(l=>e.jsxs("option",{value:l.revision,children:["Revision ",l.revision]},p(l)))})]}):e.jsxs("small",{children:["Revision ",n.revision]}),e.jsx("small",{children:Ue(n)})]})]}),n.validation.length>0?e.jsxs("div",{className:"work-output-validation",children:[e.jsx(fe,{size:13}),e.jsxs("span",{children:[n.validation.filter(l=>l.status==="passed").length," ","checks passed"]})]}):null,e.jsxs("div",{className:"work-output-actions",children:[n.kind==="file"&&n.location.kind==="local"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>{V(G(n))},children:[e.jsx(q,{size:13}),"Reveal"]}),e.jsx("button",{type:"button",onClick:async()=>{const l=await he(G(n),n.title);l.ok?m("Saved a copy of the Work output.","success"):l.canceled||m("Could not save a copy of the Work output.","error")},children:"Save as"})]}):null,n.kind==="file"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:y===p(n),onClick:()=>{ce(n)},children:"Preview"}),e.jsxs("button",{type:"button",disabled:y===p(n),onClick:()=>{de(n)},children:[e.jsx(K,{size:13}),"Use as input"]})]}):n.kind==="agent_package"?e.jsx("button",{type:"button",disabled:y===p(n),onClick:()=>{me(n)},children:"Add to Agents"}):"url"in n&&n.url?e.jsx("button",{type:"button",onClick:()=>window.open(n.url,"_blank","noopener,noreferrer"),children:"Open"}):null,n.kind==="file"&&n.location.kind==="local"?e.jsxs("button",{type:"button",className:"danger",disabled:y===p(n),onClick:()=>{ue(n)},children:[e.jsx(ke,{size:13}),"Delete"]}):null,e.jsx("button",{type:"button",disabled:y===p(n),onClick:()=>{W("chat",n)},children:"Continue in Chat"}),e.jsx("button",{type:"button",disabled:y===p(n),onClick:()=>{W("work",n)},children:"Continue in repository Work"})]})]},t.id)})}):M.length>0?e.jsx("div",{className:"work-output-list",children:M.map(t=>e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx($,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:B(t.sizeBytes)})]})]}),e.jsx("div",{className:"work-output-actions",children:e.jsxs("button",{type:"button",onClick:()=>{V(t.path)},children:[e.jsx(q,{size:13}),"Reveal"]})})]},t.path))}):e.jsx(H,{icon:$,title:"No saved outputs yet",detail:"Finished files and connected results will appear here."}):null,R==="activity"?L.length>0?e.jsx("div",{className:"work-activity-list",children:L.map(t=>e.jsxs("details",{className:`work-activity-row ${t.state??""}`,children:[e.jsxs("summary",{children:[e.jsx(D,{size:14}),e.jsx("span",{children:t.label}),e.jsx("small",{children:t.state??"completed"})]}),e.jsx("p",{children:t.content}),t.detail?e.jsx("pre",{children:t.detail}):null]},t.id))}):e.jsx(H,{icon:D,title:"No activity yet",detail:"Commands, tool receipts, and checks appear while Work runs."}):null,R==="context"?e.jsxs("div",{className:"work-context",children:[e.jsxs("section",{children:[e.jsx("h3",{children:"Model context"}),e.jsx("p",{children:c.summary}),e.jsx("small",{children:c.tokensLabel})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Task inputs and sources"}),T.length>0?e.jsx("ul",{children:T.map(t=>e.jsxs("li",{children:[e.jsx(K,{size:13}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:t.detail})]})]},t.key))}):e.jsx("p",{children:"No attached files or cited sources yet."})]})]}):null]})]})}function Ae(i){return i.flatMap(r=>r.activities??[]).filter(r=>r.kind!=="reasoning").reverse()}function Se(i){const r=new Map;for(const c of i)for(const s of c.activities??[])for(const d of s.artifacts??[])!d.path||d.sizeBytes===null||r.set(d.path,{path:d.path,title:d.title,sizeBytes:d.sizeBytes});return[...r.values()].sort((c,s)=>s.path.localeCompare(c.path))}function Oe(i){const r=new Map,c=new Set;for(const s of i){const d=z(s.data);if(s.action==="work_output_delete"&&s.status==="completed"){for(const u of d){const m=p(u);c.add(m),r.delete(m)}continue}if(s.action!=="work_output_read")for(const u of d){const m=p(u);c.has(m)||r.set(m,u)}}return[...r.values()].sort((s,d)=>d.createdAt.localeCompare(s.createdAt)||d.revision-s.revision)}function p(i){return`${i.id}:${i.revision}`}function Ne(i){const r=new Map;for(const c of i){const s=r.get(c.id)??[];s.push(c),r.set(c.id,s)}return[...r.entries()].map(([c,s])=>({id:c,revisions:s.sort((d,u)=>u.revision-d.revision||u.createdAt.localeCompare(d.createdAt))})).sort((c,s)=>s.revisions[0].createdAt.localeCompare(c.revisions[0].createdAt))}function z(i,r=[],c=new Set,s=0){if(s>8||i==null)return r;const d=Ce.safeParse(i);if(d.success){const u=`${d.data.id}:${d.data.revision}`;return c.has(u)||(c.add(u),r.push(d.data)),r}if(Array.isArray(i)){for(const u of i)z(u,r,c,s+1);return r}if(typeof i=="object")for(const u of Object.values(i))z(u,r,c,s+1);return r}function $e(i){const r=new Map;for(const c of i){for(const s of c.attachments??[])r.set(`attachment:${s.id}`,{key:`attachment:${s.id}`,title:s.name,detail:`${s.mediaType} · ${B(s.sizeBytes)}`});for(const s of c.sources??[])r.set(`source:${s.id}`,{key:`source:${s.id}`,title:s.title,detail:s.sourceName??Ie(s.url)})}return[...r.values()]}function H({icon:i,title:r,detail:c}){return e.jsxs("div",{className:"work-sidebar-empty",children:[e.jsx(i,{size:22}),e.jsx("strong",{children:r}),e.jsx("p",{children:c})]})}function Ue(i){return i.kind==="deployment"?"Deployment":i.kind==="source_change"?"Source change":i.kind==="external_resource"?i.provider:i.kind==="agent_package"?`${i.actions.length} action${i.actions.length===1?"":"s"}`:i.location.kind==="local"?B(i.sizeBytes):i.location.kind==="managed"?"Managed file":i.location.provider}function B(i){return i<1024?`${i} B`:i<1024*1024?`${Math.round(i/1024)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function ze(i){const r=window.atob(i),c=new ArrayBuffer(r.length),s=new Uint8Array(c);for(let d=0;d<r.length;d+=1)s[d]=r.charCodeAt(d);return c}function G(i){return i.kind==="file"&&i.location.kind==="local"?i.location.path:""}function Ie(i){try{return new URL(i).hostname||i}catch{return i}}function Be(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}export{He as WorkSidebarPanel,Se as visibleChatFileArtifacts,Ae as visibleWorkActivities,Oe as workOutputsFromEvents};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-BCKzvSj2.js","assets/index-BE-wXZ5R.js","assets/index-B5re-RJy.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as l,_ as ka}from"./index-BE-wXZ5R.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-DOdOVFXL.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bH as Pa,e as ge,G as ot,aH as qs,aC as fn,ba as Pe,R as z,bZ as Pt,by as At,bw as Ue,ax as is,b_ as Aa,b3 as La,b$ as Da,b4 as _a,F as Ta,E as pn,t as Ma,X as Xs,p as za,b5 as Ia,aF as Wa,aG as Ba,bV as Oa,c0 as Ua,av as Zs,c1 as Ha,bm as Va,c2 as rs,c3 as Ka,c4 as ls,c5 as Ga,q as qa,T as hn,Q as Xa,c6 as ts,c7 as Za,c8 as os,bF as Re,c9 as Qa,ca as Qs,cb as Ya,cc as Ja,cd as ei}from"./App-CLFfy_Av.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-CdVKbtGq.js";import{I as Ys}from"./info-BLj0RvhA.js";import{M as ci}from"./minimize-2-Cyg_zD9z.js";import{S as di}from"./save-BDy9tA3E.js";import{C as ui}from"./clipboard-BgrXorn-.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Pa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Pi({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Ai,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Ai({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Pe(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Pe(o,{prefix:"Sandbox"}),Pe(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=Pt(v.provider),D=$?At($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=Pt(t.provider);return s?At(s):null}function re(t){const s=Pt(t),n=s?At(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=Pt(t);return(n?At(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Aa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function A(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",A),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",A)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const A=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=A.indexOf(O);if(_<0||A.length===0)return;w.preventDefault();const Lt=Ha(_,A.length,w.key),Ae=A[Lt];if(!Ae)return;Ae.focus(),Ae.click();const ct=Ae.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
|
|
3
|
+
|
|
4
|
+
[file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-BCKzvSj2.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Pe(u,{prefix:"File preview"}),Pe(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
|
|
5
|
+
`).slice(0,800),[E]),q=fs(c.path),X=n!=null||c.content!=null,B=E.endsWith(br),Q=I&&X&&rs(c.path),ne=X&&Ka(c.path)&&Nr(E);return x?e.jsxs("div",{className:"workspace-file-preview",children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),p]}),e.jsx("div",{className:"workspace-file-image-stage",children:e.jsx("button",{type:"button",className:"workspace-file-image-button","aria-label":`Open image preview for ${c.path}`,onClick:S,children:e.jsx("img",{alt:c.path,decoding:"async",src:x})})})]}):!b&&c.patch||!X&&c.patch?W?e.jsx(Sr,{collapsed:t,file:c,hideWhiteSpace:d,onSelectBreadcrumbPath:k,wordDiffs:v,wordWrap:$,headerActions:p,workspaceName:D,workspaceRootPath:M}):e.jsx(yr,{collapsed:t,file:c,hideWhiteSpace:d,wordWrap:$,workspaceName:D,workspaceRootPath:M,onSelectBreadcrumbPath:k,headerActions:p}):e.jsxs("div",{className:`workspace-file-preview ${$?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[H?e.jsx("span",{className:"workspace-file-save-state",children:"Saving"}):null,p]})]}),X?Q?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(Na,{content:E})}):ne?e.jsx(mr,{path:c.path,contentBase64:E}):a&&!B?e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"workspace-diff-code-empty",children:"Loading editor"}),children:e.jsx(gr,{diagnostics:s,filePath:c.path,onChange:Y=>N?.(Y),onLspAction:F,onSave:()=>T?.(),ref:i,value:E,wordWrap:$})}):e.jsx("div",{className:"workspace-file-code",children:se.map((Y,oe)=>e.jsxs("div",{className:"workspace-file-code-row",children:[e.jsx("span",{children:oe+1}),e.jsx("code",{children:e.jsx(Rt,{language:q,text:Y||" "})})]},`${oe}-${Y}`))}):e.jsx("div",{className:"workspace-diff-code-empty",children:o?"Loading file content":"No file content available."})]})}function yr({collapsed:t=!1,file:s,hideWhiteSpace:n=!1,wordWrap:a,workspaceName:i,workspaceRootPath:u,onSelectBreadcrumbPath:c,headerActions:d}){const p=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),x=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview ${a?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:i??null,workspaceRootPath:u,onSelectPath:c}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),d]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} diff`,className:"workspace-diff-code",emptyMessage:"No patch available.",rows:p,renderRow:(o,b)=>o.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer",role:"row",children:o.label},`${o.label}-${b}`):e.jsxs("div",{className:`workspace-diff-code-row ${o.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number",role:"cell",children:o.newLine||o.oldLine}),e.jsx("code",{role:"cell",children:e.jsx(Rt,{language:x,text:o.newContent||o.oldContent||" "})})]},`${o.oldLine}-${o.newLine}-${b}`),wordWrap:a})]})}function Sr({collapsed:t,file:s,hideWhiteSpace:n,wordDiffs:a,wordWrap:i,workspaceName:u,workspaceRootPath:c,onSelectBreadcrumbPath:d,headerActions:p}){const x=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),o=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview split ${i?"wrap":""} ${a?"word-diffs":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:u,workspaceRootPath:c,onSelectPath:d}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[p,e.jsx(Ca,{size:14})]})]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} split diff`,className:"workspace-split-code",emptyMessage:"No patch available.",rows:x,renderRow:(b,S)=>b.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer split",role:"row",children:b.label},`${b.label}-${S}`):e.jsxs("div",{className:`workspace-split-row ${b.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number old",role:"cell",children:b.oldLine}),e.jsx("code",{className:"old",role:"cell",children:e.jsx(Rt,{language:o,text:b.oldContent||" "})}),e.jsx("span",{className:"workspace-diff-line-number new",role:"cell",children:b.newLine}),e.jsx("code",{className:"new",role:"cell",children:e.jsx(Rt,{language:o,text:b.newContent||" "})})]},`${b.oldLine}-${b.newLine}-${S}`),wordWrap:i})]})}function Nr(t){return t.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(t)}function kn({ariaLabel:t,className:s,emptyMessage:n,rows:a,renderRow:i,wordWrap:u}){const c=!u&&a.length>vr,{endIndex:d,offsetTop:p,scrollRef:x,startIndex:o,totalHeight:b}=Cr(a.length,c);return a.length===0?e.jsx("div",{className:s,role:"table","aria-label":t,children:e.jsx("div",{className:"workspace-diff-code-empty",children:n})}):c?e.jsx("div",{className:`${s} virtualized`,ref:x,role:"table","aria-label":t,"aria-rowcount":a.length,children:e.jsx("div",{className:"workspace-diff-virtual-spacer",style:{height:b},children:e.jsx("div",{className:"workspace-diff-virtual-window",style:{transform:`translateY(${p}px)`},children:a.slice(o,d).map((S,k)=>i(S,o+k))})})}):e.jsx("div",{className:s,role:"table","aria-label":t,children:a.map(i)})}function Cr(t,s){const n=l.useRef(null),[a,i]=l.useState({height:Fe*an,scrollTop:0}),u=l.useCallback(()=>{const x=n.current;x&&i({height:x.clientHeight||Fe*an,scrollTop:x.scrollTop})},[]);if(l.useEffect(()=>{if(!s)return;const x=n.current;if(!x)return;u();let o=0;const b=()=>{if(typeof window>"u"){u();return}window.cancelAnimationFrame(o),o=window.requestAnimationFrame(u)};x.addEventListener("scroll",b,{passive:!0});const S=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>b());return S?.observe(x),()=>{x.removeEventListener("scroll",b),S?.disconnect(),typeof window<"u"&&window.cancelAnimationFrame(o)}},[s,u]),!s)return{endIndex:t,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:t*Fe};const c=Math.ceil(a.height/Fe),d=Math.max(0,Math.floor(a.scrollTop/Fe)-rn);return{endIndex:Math.min(t,d+c+rn*2),offsetTop:d*Fe,scrollRef:n,startIndex:d,totalHeight:t*Fe}}function wn(t,s){if(!t.trim())return[];const n=[];let a=0,i=0,u=null,c=null,d=!1,p=[];function x(){n.push(...Rr(p)),p=[]}function o(){d&&(x(),u=a,c=i,d=!1)}for(const b of t.split(`
|
|
6
|
+
`)){const S=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(b);if(S){o();const F=Number(S[1]),T=Number(S[2]);if(u!==null&&c!==null){const I=Math.max(F-u,T-c,0);I>0&&n.push({kind:"spacer",label:yn(I)})}a=F,i=T,d=!0;continue}if(b.startsWith("diff --git")||b.startsWith("index ")||b.startsWith("--- ")||b.startsWith("+++ ")||!d||b.startsWith("\\ No newline"))continue;const k=b.slice(1)||" ";if(s&&!k.trim())continue;if(b.startsWith("+")){x(),n.push({kind:"addition",oldLine:"",newLine:String(i||""),oldContent:"",newContent:k}),i+=1;continue}if(b.startsWith("-")){x(),n.push({kind:"deletion",oldLine:String(a||""),newLine:"",oldContent:k,newContent:""}),a+=1;continue}const N=b.startsWith(" ")?b.slice(1)||" ":b||" ";s&&!N.trim()||(p.push({kind:"context",oldLine:String(a||""),newLine:String(i||""),oldContent:N,newContent:N}),a+=1,i+=1)}return o(),n}function Rr(t){if(t.length<jr)return t;const s=t.length-ns*2;return s<=0?t:[...t.slice(0,ns),{kind:"spacer",label:yn(s)},...t.slice(-ns)]}function yn(t){return`${t} unmodified ${t===1?"line":"lines"}`}const Ft=`
|
|
7
|
+
|
|
8
|
+
[file truncated]`,$r="openpond.sandboxSourceReadback.v1";async function Fr(t,s,n,a=[]){let i;try{i=await z.sandboxDownloadFile(t,s,n,{maxBytes:256*1024})}catch(c){const d=c instanceof Error?c.message:String(c);if(!Er(d))throw c;const p=Lr(a,s,n);if(p)return p;const x=!!ps(a,s)?.artifact,o=await z.sandbox(t,s).catch(()=>null);throw new Error(Pr(n,o?.sandbox??null,d,{hasReadbackArtifact:x}))}const u=i.file.isBinary?i.file.contentsBase64||null:`${i.contents}${i.file.truncated?Ft:""}`;return{path:i.file.path,status:"",additions:0,deletions:0,patch:"",content:u}}function Er(t){return t.includes("sandbox_not_ready")&&t.includes("placement_stale")||t.includes("sandbox_not_running")}function Pr(t,s,n="sandbox_not_ready:placement_stale",a={}){const i=s?Dr(s):null,u=t||"this file";if(a.hasReadbackArtifact)return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint has a saved readback artifact, but ${u} was not captured as text. Resume the sandbox to inspect it. ${n}`;if(!i)return`Sandbox file content is unavailable because the stopped runtime placement is stale. Resume the sandbox to inspect ${u}. ${n}`;const c=i.preservedSha?i.preservedSha.slice(0,12):null,d=i.sourceRef?` (${i.sourceRef})`:"";return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint is saved${c?` at ${c}`:""}${d}, but this Desktop app cannot read file bodies from preserved source refs yet. Resume the sandbox to inspect ${u}.`}function Ar(t,s){if(!s)return null;const n=ps(t,s);if(!n)return null;const a=Nn(n.artifact),i=new Map;for(const d of hs(a))i.set(d.path,d);for(const d of Cn(n.artifact)){const p=Sn(n.artifact,d.path);p&&i.set(d.path,p)}const u=[...i.values()].sort((d,p)=>d.path.localeCompare(p.path)),c=[...new Set(u.map(d=>d.path))].sort((d,p)=>d.localeCompare(p));return{appId:s,repoPath:"",initialized:!0,dirty:!1,filesChanged:u.length,additions:u.reduce((d,p)=>d+p.additions,0),deletions:u.reduce((d,p)=>d+p.deletions,0),repoFiles:c,files:u,error:null,updatedAt:He(le(n.artifact)?.createdAt)??n.event.timestamp}}function Lr(t,s,n){if(!s)return null;const a=ps(t,s);return a?Sn(a.artifact,n):null}function ps(t,s){for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=le(a.data),u=le(i?.sourcePreservation),c=le(u?.sourceReadbackArtifact);if(c&&c.schemaVersion===$r&&c.sandboxId===s)return{artifact:c,event:a}}return null}function Sn(t,s){const n=hs(Nn(t)).find(u=>u.path===s),a=Cn(t).find(u=>u.path===s);if(!n&&!a)return null;const i=typeof a?.content=="string"?`${a.content}${a.truncated?Ft:""}`:null;return{path:a?.path??n?.path??s,status:n?.status??"M",additions:n?.additions??0,deletions:n?.deletions??0,patch:n?.patch??"",content:i}}function Nn(t){const s=le(t.patch);return typeof s?.text=="string"?s.text:""}function Cn(t){return(Array.isArray(t.files)?t.files:[]).map(n=>{const a=le(n),i=He(a?.path);return i?{path:i,...typeof a?.content=="string"?{content:a.content}:{},...a?.truncated===!0?{truncated:!0}:{}}:null}).filter(n=>!!n)}function Dr(t){const s=le(t.metadata)??{},n=le(s.sourcePreservation)??le(s.sourcePreserve),a=le(s.sourceChangeDetection),i=He(n?.preservedSha)??He(a?.preservedSha)??null,u=He(n?.sourceRef)??He(a?.sourceRef)??(typeof t.repoRef=="string"?t.repoRef:null);return!i&&!u?null:{preservedSha:i,sourceRef:u}}function le(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function He(t){return typeof t=="string"&&t.trim()?t.trim():null}async function _r(t,s,n,a){const i=await z.sandboxUploadFile(t,s,{path:n,contents:a});return await z.preserveSandboxSource(t,s,{message:"Auto-preserve source after right sidebar save"}),{path:i.file.path,status:"M",additions:0,deletions:0,patch:"",content:a}}function Tr(t){return t.filter(s=>s.type==="file").map(s=>s.path).sort((s,n)=>s.localeCompare(n))}function Mr(t,s){const n=new Map;for(const a of hs(t?.diff??""))n.set(a.path,a);for(const a of zr(s?.porcelain??""))n.has(a.path)||n.set(a.path,a);return[...n.values()].sort((a,i)=>a.path.localeCompare(i.path))}function hs(t){const s=[];let n=null;const a=()=>{n&&(s.push({path:n.path,status:n.status,additions:n.additions,deletions:n.deletions,patch:n.patchLines.join(`
|
|
9
|
+
`),content:null}),n=null)};for(const i of t.split(`
|
|
10
|
+
`)){if(i.startsWith("diff --git ")){a(),n={path:Wr(i)??"changed-file",status:"M",additions:0,deletions:0,patchLines:[i]};continue}if(n){if(n.patchLines.push(i),i.startsWith("+++ ")){const u=ln(i.slice(4));u&&(n.path=u);continue}if(i.startsWith("--- ")){const u=ln(i.slice(4));u&&n.path==="changed-file"&&(n.path=u);continue}i.startsWith("new file mode ")&&(n.status="A"),i.startsWith("deleted file mode ")&&(n.status="D"),i.startsWith("rename to ")&&(n.status="R",n.path=i.slice(10).trim()||n.path),i.startsWith("+")&&!i.startsWith("+++")&&(n.additions+=1),i.startsWith("-")&&!i.startsWith("---")&&(n.deletions+=1)}}return a(),s}function zr(t){const s=[];for(const n of t.split(`
|
|
11
|
+
`)){if(!n.trim())continue;const a=Ir(n);a&&s.push({path:a,status:n.slice(0,2).trim()||"M",additions:0,deletions:0,patch:"",content:null})}return s}function Ir(t){const s=t.slice(3).trim();return s?s.split(" -> ").pop()?.trim()||s:null}function Wr(t){const s=/^diff --git a\/(.+) b\/(.+)$/.exec(t.trim());return s?.[2]??s?.[1]??null}function ln(t){const s=t.trim();return!s||s==="/dev/null"?null:s.startsWith("a/")||s.startsWith("b/")?s.slice(2):s}const Rn="openpond.workspace.editorControlsVisible";function on(){try{return hn.getItem(Rn)==="true"}catch{return!1}}function Br(t){try{hn.setItem(Rn,String(t))}catch{}}function Or({activeDiagnostics:t,activeServers:s,editorDiagnosticsChecking:n,editorLspEnabled:a,showEditorCommandBar:i}){if(!i)return null;if(!a)return{label:"LSP off",severity:"unavailable"};if(n)return{label:"Checking",severity:"info"};const u=t.filter(x=>x.severity==="error").length;if(u>0)return{label:`${u} error${u===1?"":"s"}`,severity:"error"};const c=t.filter(x=>x.severity==="warning").length;if(c>0)return{label:`${c} warning${c===1?"":"s"}`,severity:"warning"};const d=t.length;if(d>0)return{label:`${d} note${d===1?"":"s"}`,severity:"info"};if(!s)return null;const p=s.find(x=>x.status!=="connected");return p?{label:p.id==="none"?"No LSP":`${p.id} unavailable`,severity:"unavailable"}:{label:"No issues",severity:"none"}}const cn=3e3,Ur=2e3,dn=[],Hr=[];function Vr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k=!1,openFileRequest:N,readOnly:F=!1,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y=[],sidebarFileSourceSessionId:oe=null,onSetSidebarFileStatus:w}){return e.jsx(Zr,{appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i??[],diff:u,editorPreferences:c??null,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S??null,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T??[],sourceSwitcher:I??null,tabRequest:K??null,viewState:H??null,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B??null,sandboxFileSource:Q??null,trainingSummary:ne??null,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w})}function Kr(t,s,n,a){return t&&s?.content!=null?{...t,content:s.content}:s&&!t&&as(s)?s:t&&as(t)?t:s&&as(s)?s:t??s??n??os(a)}function as(t){return!!(t.patch||t.content!=null)}function Gr({changedFiles:t,checkpointStatus:s,dirty:n,error:a,loading:i,preservedReadback:u,sandboxMode:c,sourcePending:d}){if(d)return{label:"sandbox pending",tone:"loading"};if(i)return{label:"refreshing",tone:"loading"};if(c&&u&&s)return s;if(a)return{label:"status unavailable",tone:"error"};if(c&&s?.tone==="error"||c&&s&&!n&&t===0)return s;if(n||t>0){const p=Math.max(1,t),x=p===1?"change":"changes";return{label:c?`${p} unpreserved ${x}`:`${p} local ${x}`,tone:"dirty"}}return{label:c?"sandbox clean":"local clean",tone:"clean"}}function qr(t,s){if(!s)return null;for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:null,u=i?.sourcePreservation&&typeof i.sourcePreservation=="object"&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(u?.attempted===!0&&u.sandboxId===s)return u.ok!==!0?{label:"checkpoint failed",tone:"error"}:u.preserved===!0?{label:"checkpoint saved",tone:"clean"}:{label:"checkpoint clean",tone:"clean"}}return null}function Xr(t){const s=t.split("/").filter(Boolean);return s.map((n,a)=>s.slice(0,a+1).join("/"))}function Zr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w}){const O=H??ei(),[A,_]=l.useState(O.activeTab),[Lt,Ae]=l.useState(!1),[ct,ce]=l.useState(!1),[$n,ae]=l.useState(!1),[Dt,_t]=l.useState(""),[J,Ve]=l.useState(()=>[...O.openFilePaths]),[j,je]=l.useState(O.selectedPath),[ms,Fn]=l.useState(!1),[xs,En]=l.useState(!1),[Le,Pn]=l.useState(!1),[Tt,An]=l.useState(!0),[bs,gs]=l.useState(on);Xa(()=>gs(on()));const[js,Ln]=l.useState(!1),[vs,Dn]=l.useState(!1),[ks,_n]=l.useState(!1),[ie,De]=l.useState({}),[dt,ut]=l.useState(()=>new Set),[ws,ft]=l.useState({}),[fe,Ke]=l.useState({}),[ys,Mt]=l.useState(()=>new Set),[Ge,qe]=l.useState(null),[Tn,zt]=l.useState(!1),[Ss,Xe]=l.useState(null),[Ns,It]=l.useState({}),[Mn,Wt]=l.useState({}),[zn,Bt]=l.useState(null),[In,ve]=l.useState(null),[Cs,Ot]=l.useState(null),[Wn,ke]=l.useState(null);Pe(o,{prefix:"Workspace"}),Pe(Ss,{prefix:"Sandbox files"});const[Ut,pt]=l.useState(null),[Bn,Ze]=l.useState({}),[ht,Ht]=l.useState(null),[_e,mt]=l.useState(null),[xt,bt]=l.useState(null),ee=c??Ja.editor,Rs=l.useRef(ie),Vt=l.useRef(ts(O)),Kt=l.useRef(ts(O)),$s=l.useRef(null),Gt=l.useRef(W),de=l.useRef(!1),Qe=l.useRef(null),Ye=l.useRef(0),pe=l.useRef(null),Je=l.useRef(null),P=Q?.sandboxId?.trim()||null,C=!!Q,Te=!!ne||C&&!!P,gt=C?`sandbox:${P??"pending"}`:`workspace:${t??"none"}`,Fs=C?!!P:!!t,Es=l.useRef(gt),he=!!(B?.createRuntime||B?.goalRuntime||B?.subagentRuntime),Me=l.useCallback(async(r={})=>{if(C){if(!a){qe(null),Xe("OpenPond App server is not connected.");return}if(!P){qe(null),Xe(null);return}r.silent||zt(!0);try{const[m,f,g]=await Promise.allSettled([z.sandboxFiles(a,P,{recursive:!0,maxEntries:Ur}),z.sandboxGitStatus(a,P),z.sandboxGitDiff(a,P,{})]);if(m.status==="rejected")throw m.reason;const y=Tr(m.value.files),h=f.status==="fulfilled"?f.value.status:null,R=g.status==="fulfilled"?g.value.diff:null,L=Mr(R,h),it=L.reduce((Jt,es)=>Jt+es.additions,0),va=L.reduce((Jt,es)=>Jt+es.deletions,0);qe({appId:P,repoPath:"",initialized:!0,dirty:h?!h.clean:L.length>0,filesChanged:L.length,additions:it,deletions:va,repoFiles:y,files:L,error:null,updatedAt:new Date().toISOString()}),Xe(null)}catch(m){qe(null),Xe(m instanceof Error?m.message:String(m))}finally{r.silent||zt(!1)}}},[a,P,C]),Ps=l.useMemo(()=>Ar(i,P),[i,P]),As=!!(Ge&&((Ge.files?.length??0)>0||(Ge.repoFiles?.length??0)>0)),On=C&&!As&&!!Ps,me=C?As?Ge:Ps??Ge:u,et=me?.repoPath??null,Un=l.useMemo(()=>qr(i,P),[i,P]),ze=me?.files??dn,Ls=me?.files??dn,we=l.useMemo(()=>new Map(Ls.map(r=>[r.path,r])),[Ls]),ye=l.useMemo(()=>new Map(ze.map(r=>[r.path,r])),[ze]),Ie=me?.repoFiles??(ze.length>0?ze.map(r=>r.path):Hr),We=l.useMemo(()=>ze.filter(r=>!Za(r,Ie)),[Ie,ze]),Se=l.useMemo(()=>xt&&!Ie.includes(xt)?[xt,...Ie]:Ie,[Ie,xt]),Ds=l.useMemo(()=>J.map(r=>we.get(r)??ie[r]??ye.get(r)??os(r)),[we,ye,ie,J]),jt=l.useMemo(()=>{const r={};for(const m of J){if(Re(m))continue;const f=we.get(m)??ie[m]??ye.get(m)??os(m);f.content!=null&&(r[m]=f.content)}return r},[we,ye,ie,J]),Be=l.useMemo(()=>{const r=new Set;for(const[m,f]of Object.entries(fe))f.content!==f.savedContent&&r.add(m);return r},[fe]),Hn=l.useMemo(()=>{const r=Dt.trim().toLowerCase(),m=Se;return r?m.filter(f=>f.toLowerCase().includes(r)):m},[Se,Dt]),qt=l.useMemo(()=>({activeTab:A,openFilePaths:J,selectedPath:j}),[A,J,j]);l.useEffect(()=>{Rs.current=ie},[ie]),l.useEffect(()=>{Qe.current=ht},[ht]),l.useEffect(()=>{Ke(r=>{let m=!1;const f={...r},g=new Set(J),y=u?.updatedAt?Date.parse(u.updatedAt):null;for(const[h,R]of Object.entries(f))g.has(h)||R.content!==R.savedContent||(delete f[h],m=!0);for(const[h,R]of Object.entries(jt)){const L=f[h];if(!L){f[h]={content:R,savedContent:R},m=!0;continue}if(L.content===L.savedContent&&L.savedContent!==R){if(L.savedAt&&(y===null||y<L.savedAt))continue;f[h]={content:R,savedContent:R},m=!0}}return m?f:r})},[u?.updatedAt,jt,J]),l.useEffect(()=>{Gt.current=W},[W]),l.useEffect(()=>{if(!H)return;const r=Qa(H,et);Qs(Vt.current,r)||(Vt.current=r,Kt.current=r,_(r.activeTab),Ve(r.openFilePaths),je(r.selectedPath))},[H,et]),l.useEffect(()=>{if(dt.size>0||Qs(Kt.current,qt))return;const r=ts(qt);Kt.current=r,Vt.current=r,E?.(r)},[qt,E,dt]),l.useEffect(()=>{F||C||!a||!t||!x||u||o||de.current||(de.current=!0,Promise.resolve(Gt.current({silent:!0})).catch(()=>{}).finally(()=>{de.current=!1}))},[t,a,u,F,C,o,x]),l.useEffect(()=>(Es.current!==gt&&(Es.current=gt,pe.current?.abort(new Error("lsp_diagnostics_source_changed")),pe.current=null,Ve([]),je(null),De({}),ut(new Set),ft({}),Ke({}),Mt(new Set),qe(null),Xe(null),zt(!1),It({}),Wt({}),Bt(null),ve(null),ke(null),pt(null),Ze({}),Ht(null),mt(null),bt(null)),()=>{pe.current?.abort(new Error("lsp_diagnostics_unmounted")),pe.current=null}),[gt]),l.useEffect(()=>{if(!(!N||$s.current===N.id)&&!(!N.file&&!Fs)){if($s.current=N.id,N.file){Vn(N.file,N.imageUrl,N.source);return}vt(N.path,{source:N.source})}},[Fs,N]),l.useEffect(()=>{if(!C||(Me(),!a||!P))return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Me({silent:!0})}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[a,Me,P,C]),l.useEffect(()=>{if(F||C||!a||!t||!x)return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Gt.current({silent:!0})}catch{}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[t,a,F,C,x]),l.useEffect(()=>{if(C||!a||!t||n==="local_project"){bt(null);return}let r=!1;return z.workspaceTemplateConfig(a,t).then(m=>{r||bt(m.exists?m.configPath??Ya:null)}).catch(()=>{r||bt(null)}),()=>{r=!0}},[t,a,C,n]),l.useEffect(()=>{!j||Se.includes(j)||J.includes(j)||je(We[0]?.path??null)},[We,J,Se,j]),l.useEffect(()=>{B?.active&&he&&_("goal")},[B?.active,he]),l.useEffect(()=>{K&&_(K.tab)},[K]),l.useEffect(()=>{!he&&A==="goal"&&_("files")},[A,he]),l.useEffect(()=>{!Te&&A==="summary"&&_("files")},[A,Te]);const G=A==="file"||k&&A==="files"?j:null;l.useEffect(()=>{if(!a||!G)return;if(Re(G)){ke(null),ve(h=>h===G?null:h);return}const r=Ut?.path===G,m=tt(G);if(F&&(m?.content!=null||m?.patch)){ke(null),ve(h=>h===G?null:h);return}if(!r&&(m?.content!=null||m?.patch&&!Le)){ke(null),ve(h=>h===G?null:h);return}let f=!1;const g=Rs.current[G];return g?.content==null&&(Le||!g?.patch)&&ve(G),ke(null),(C?P?Fr(a,P,G,i):Promise.reject(new Error(Q?.emptyMessage??"No sandbox filesystem is available.")):t?z.workspaceFile(a,t,G):Promise.reject(new Error("Workspace files are unavailable."))).then(h=>{f||De(R=>{const L=R[h.path];return L?.content===h.content&&L.patch===h.patch&&L.status===h.status?R:{...R,[h.path]:h}})}).catch(h=>{f||ke(h instanceof Error?h.message:String(h))}).finally(()=>{f||(ve(h=>h===G?null:h),pt(h=>h&&h.id===Ut?.id&&h.path===G?null:h))}),()=>{f=!0}},[A,t,a,Ut,Le,F,i,Q?.emptyMessage,P,C,G]);function vt(r,m){Ot(null);const f=C?P:t;if(Ks(r)&&!m?.source&&a&&f){Ra(a,f,r,C?"sandbox":"local").then(M).catch(y=>Ot(y instanceof Error?y.message:"Could not open HTML preview."));return}const g=ls(r,et);g&&(ut(y=>{if(!y.has(g))return y;const h=new Set(y);return h.delete(g),h}),De(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),ft(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),pt({id:Date.now(),path:g}),k||Ve(y=>y.includes(g)?y:[...y,g]),je(g),_(k?"files":"file"),!C&&a&&t&&Re(g)&&mt(g),ce(!1),ae(!1),_t(""))}function Vn(r,m,f=!1){if(Ks(r.path)&&r.content!=null&&!f&&a){$a(a,r.path,r.content).then(M).catch(h=>Ot(h instanceof Error?h.message:"Could not open HTML preview."));return}const g=ls(r.path,et);if(!g)return;const y={...r,path:g};De(h=>({...h,[g]:y})),ut(h=>{const R=new Set(h);return R.add(g),R}),ft(h=>{if(!m){if(!(g in h))return h;const R={...h};return delete R[g],R}return h[g]===m?h:{...h,[g]:m}}),pt(null),ke(null),ve(null),k||Ve(h=>h.includes(g)?h:[...h,g]),je(g),_(k?"files":"file"),ce(!1),ae(!1),_t("")}const Kn=l.useCallback(()=>{gs(r=>{const m=!r;return Br(m),m})},[]),tt=r=>Kr(we.get(r),ie[r],ye.get(r),r),Gn=l.useCallback((r,m)=>{Ke(f=>{const g=f[r],y=g?.savedContent??jt[r]??tt(r).content??"";return{...f,[r]:{content:m,savedContent:y,savedAt:g?.savedAt}}}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})},[we,ye,ie,jt]),Oe=l.useCallback(async(r,m={})=>{if(C||!a||!t||Re(r))return;const f=tt(r),g=m.content??fe[r]?.content??f.content??void 0;if(g?.endsWith(Ft))return;const y=Ye.current+1;Ye.current=y,pe.current?.abort(new Error("lsp_diagnostics_superseded"));const h=new AbortController;pe.current=h,Bt(r);try{const R=await z.workspaceLspTouch(a,t,{path:r,content:g,waitForDiagnostics:m.waitForDiagnostics??!0},{signal:h.signal});if(y!==Ye.current)return;It(L=>({...L,[R.path]:R.diagnostics})),Wt(L=>({...L,[R.path]:R.servers}))}catch(R){if(h.signal.aborted||y!==Ye.current)return;const L=R instanceof Error?R.message:String(R);It(it=>({...it,[r]:[]})),Wt(it=>({...it,[r]:[{id:"lsp",root:"",status:"error",message:L}]}))}finally{if(pe.current===h&&(pe.current=null),h.signal.aborted)return;y===Ye.current&&Bt(R=>R===r?null:R)}},[t,a,we,ye,fe,ie,C]),qn=l.useCallback(async r=>{if(C||!a||!t)throw new Error("Workspace LSP is unavailable.");return z.workspaceLspAction(a,t,r)},[t,a,C]),st=l.useCallback(async r=>{if(!a||!t&&!P||Qe.current===r)return;const m=fe[r];if(!m||m.content===m.savedContent)return;const f=m.content,g=Date.now();Qe.current=r,Ht(r),Ze(y=>{if(!(r in y))return y;const h={...y};return delete h[r],h});try{const y=C?await _r(a,P,r,f):await z.saveWorkspaceFile(a,t,{path:r,content:f});De(h=>({...h,[y.path]:y})),Ke(h=>{const R=h[r];return R?{...h,[r]:{content:R.content,savedContent:f,savedAt:g}}:h}),ee.languageServers!=="off"&&ee.checkOnSave&&await Oe(r,{content:f,waitForDiagnostics:!0}),C?await Me({silent:!0}):await W({silent:!0})}catch(y){Ze(h=>({...h,[r]:y instanceof Error?y.message:String(y)}))}finally{Qe.current===r&&(Qe.current=null),Ht(y=>y===r?null:y)}},[ee.checkOnSave,ee.languageServers,t,a,fe,W,Oe,Me,P,C]),_s=j?tt(j):null,nt=!!(j&&dt.has(j)),Ne=j?fe[j]?.content??_s?.content??null:null,Xn=!!(_s?.patch&&!Le),Xt=!!(!F&&!nt&&A==="file"&&!Xn&&j&&Ne!=null&&!Re(j)&&!(Tt&&rs(j))&&!Ne.endsWith(Ft));l.useEffect(()=>{if(ee.languageServers==="off"||!ee.diagnosticsWhileEditing||!j||!Xt||Ne==null)return;const r=window.setTimeout(()=>{Oe(j,{content:Ne,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(r)},[ee.diagnosticsWhileEditing,ee.languageServers,Oe,Ne,Xt,j]),l.useEffect(()=>{function r(m){!(m.ctrlKey||m.metaKey)||m.key.toLowerCase()!=="s"||A!=="file"||!j||(m.preventDefault(),Be.has(j)&&st(j))}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[A,Be,st,j]);const Zn=l.useCallback(()=>{j&&(Je.current?Je.current.save():st(j))},[st,j]),Qn=l.useCallback(()=>{Je.current?.undo()},[]),Yn=l.useCallback(()=>{Je.current?.redo()},[]),Jn=l.useCallback(()=>{j&&ee.languageServers!=="off"&&Oe(j,{content:Ne??void 0,waitForDiagnostics:!0})},[ee.languageServers,Oe,Ne,j]);function ea(r,m){if(m.stopPropagation(),!(Be.has(r)&&!window.confirm(`Discard unsaved changes to ${r}?`))&&(Be.has(r)&&(Ke(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})),Ve(f=>f.filter(g=>g!==r)),dt.has(r)&&De(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ft(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ut(f=>{if(!f.has(r))return f;const g=new Set(f);return g.delete(r),g}),j===r)){const f=Ds.find(g=>g.path!==r)??null;je(f?.path??We[0]?.path??null),f||_("files")}}function ta(){_("files"),ce(!1),ae(!1)}function Ts(r){Mt(m=>{const f=new Set(m);return f.has(r)?f.delete(r):f.add(r),f})}function sa(r){r&&Mt(m=>{const f=new Set(m);for(const g of Xr(r))f.add(g);return f}),_("files"),ce(!1),ae(!1)}function na(){const m=`git apply <<'PATCH'
|
|
12
|
+
${We.map(f=>f.patch).filter(Boolean).join(`
|
|
13
|
+
`)}
|
|
14
|
+
PATCH`;navigator.clipboard?.writeText(m)}const aa=We.length>0,ia=Se.length>0,ra=J.length>0,la=he||Te||aa||ia||ra,xe=A==="goal"&&he?"goal":A==="summary"&&Te?"summary":A==="file"&&j?"file":"files",oa=xe==="files"?"No files to show":"No local changes",ca=n==="local_project"&&!x&&!o,Ms=C?Tn:d,zs=C?Ss:o,da=Gr({changedFiles:me?.filesChanged??We.length,checkpointStatus:Un,dirty:!!me?.dirty,error:zs,loading:Ms,preservedReadback:On,sandboxMode:C,sourcePending:C&&!P}),ua=Ms?"Loading workspace files":zs?"Workspace files are unavailable":C&&!P?Q?.emptyMessage??"No sandbox filesystem is available.":ca?"Loading workspace files":x?oa:"No local files to show",Is=j?ws[j]??null:null,fa=!Is&&!C&&j&&Re(j)?j:null,Ws=_e?ws[_e]??null:null,pa=!Ws&&!C&&_e&&Re(_e)?_e:null,ha=Gs(a,t,fa),ma=Gs(a,t,pa),Zt=Is??ha,Bs=Ws??ma,Os=xe==="file"||k&&xe==="files"?j:null,xa=!!(Os&&rs(Os)),Us=j?Ns[j]??[]:[],Hs=j?Mn[j]??null:null,Qt=!!(j&&zn===j),Yt=bs&&Xt,at=!F&&!nt&&!C&&ee.languageServers!=="off",ba=l.useMemo(()=>Or({activeDiagnostics:Us,activeServers:Hs,editorDiagnosticsChecking:Qt,editorLspEnabled:at,showEditorCommandBar:Yt}),[Us,Hs,Qt,at,Yt]),ga=l.useCallback(async r=>{if(!a)throw new Error("OpenPond server connection is unavailable.");await z.runSubagentLifecycleAction(a,r.runId,{action:r.action,reason:"User requested from Goal details."}),await W({silent:!0})},[a,W]),be=C?"sandbox":n==="local_project"?"local":null,kt=l.useMemo(()=>{const r=new Map;if(!be||!s)return r;for(const m of Y)m.workspaceKind!==be||m.workspaceId!==s||r.set(m.path,m);return r},[Y,be,s]),wt=l.useCallback(r=>{try{return kt.get(cs(r))?.status??null}catch{return null}},[kt]),yt=l.useCallback((r,m)=>{if(!be||!s||!p||!w)return;let f;try{f=cs(r)}catch{return}const g=kt.get(f),y=new Date().toISOString(),h=g??{id:hi({workspaceKind:be,workspaceId:s,path:f}),workspaceKind:be,workspaceId:s,workspaceName:p,path:f,status:"pinned",order:null,sourceSessionId:oe,available:!0,createdAt:y,updatedAt:y};w(h,m)},[w,kt,oe,be,s,p]),Ce=!!(be&&s&&p&&w),ja=j&&Ce&&!nt?e.jsx(us,{currentStatus:wt(j),onSetStatus:r=>yt(j,r)}):null,Vs=j?e.jsx(wr,{diagnostics:at?Ns[j]??[]:[],draftContent:fe[j]?.content,editorRef:Je,editable:!F&&!nt&&!Zt,error:Wn,file:tt(j),collapsed:xs,hideWhiteSpace:vs,headerActions:ja,imageSrc:Zt,loading:In===j,loadFullFiles:Le,saveError:Bn[j]??null,saving:ht===j,onOpenImage:()=>{Zt&&mt(j)},onDraftContentChange:r=>Gn(j,r),onLspAction:at?qn:void 0,onSave:()=>{st(j)},onSelectBreadcrumbPath:sa,renderMarkdown:Tt,splitView:ks,wordDiffs:js,wordWrap:ms,workspaceName:p,workspaceRootPath:et}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{className:`workspace-diff-panel ${b?"expanded":""}`,id:"right-sidebar-files-panel",role:"tabpanel","aria-label":"Workspace diffs",children:[!b&&e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize diff panel",onPointerDown:v}),e.jsx(cr,{addMenuOpen:ct,expanded:b,filteredFiles:Hn,openFiles:Ds,dirtyFilePaths:Be,goalDetailsAvailable:he,searchOpen:$n,searchQuery:Dt,selectedPath:j,sideChatTabs:T,summaryAvailable:Te,sourceStatus:da,sourceSwitcher:I,visibleTab:xe,getFileBookmarkStatus:Ce?wt:void 0,onCloseFileTab:ea,onCloseSideChat:se,onCloseSearch:()=>ae(!1),onOpenFile:vt,onOpenBrowser:D?()=>{ce(!1),ae(!1),D()}:void 0,onOpenSearch:()=>{ce(!1),ae(!0)},onOpenSideChat:q?()=>{ce(!1),ae(!1),q()}:void 0,onSearchQueryChange:_t,onSetFileBookmarkStatus:Ce?yt:void 0,onSelectFile:r=>{je(r),_("file")},onSelectFiles:ta,onSelectGoal:()=>_("goal"),onSelectSummary:()=>{_("summary"),ce(!1),ae(!1)},onSelectSideChat:X,onToggleAddMenu:()=>{ce(r=>!r),ae(!1)},onToggleExpanded:$}),Cs&&e.jsx("div",{className:"workspace-diff-empty",role:"alert",children:Cs}),xe==="goal"&&he?e.jsx(Pi,{createRuntime:B?.createRuntime??null,goalRuntime:B?.goalRuntime??null,subagentRuntime:B?.subagentRuntime??null,onRunSubagentLifecycleAction:a?ga:void 0}):xe==="summary"&&Te?ne?e.jsx(ir,{summary:ne}):e.jsx(Qi,{sandboxId:P,connection:a}):la?e.jsxs(e.Fragment,{children:[e.jsx(dr,{canSaveActiveFile:!!(!F&&!nt&&j&&Be.has(j)&&ht!==j),canCheckActiveFile:at,collapsed:xs,editorControlsVisible:bs,editorDiagnosticStatus:ba,editorDiagnosticsChecking:Qt,hideWhiteSpace:vs,loadFullFiles:Le,menuOpen:Lt,renderMarkdown:Tt,showEditorCommandBar:Yt,showRenderMarkdownToggle:xa,splitView:ks,wordDiffs:js,wordWrap:ms,onCopyGitApply:na,onEditorCheck:Jn,onEditorRedo:Yn,onEditorSave:Zn,onEditorUndo:Qn,onRefresh:()=>{C?Me():W()},onToggleCollapsed:()=>En(r=>!r),onToggleEditorControlsVisible:Kn,onToggleHideWhiteSpace:()=>Dn(r=>!r),onToggleLoadFullFiles:()=>Pn(r=>!r),onToggleMenu:r=>Ae(m=>r??!m),onToggleRenderMarkdown:()=>An(r=>!r),onToggleSplitView:()=>_n(r=>!r),onToggleWordDiffs:()=>Ln(r=>!r),onToggleWordWrap:()=>Fn(r=>!r)}),xe==="files"&&(k?e.jsxs("div",{className:"workspace-diff-files-preview-layout",children:[e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts}),Vs??e.jsx("div",{className:"workspace-diff-files-preview-empty",children:"Select a file to review its changes."})]}):e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts})),xe==="file"&&j&&Vs]}):e.jsx("div",{className:"workspace-diff-empty",children:e.jsx("span",{children:ua})})]}),e.jsx(Fa,{open:!!Bs,src:Bs,title:_e??"",onClose:()=>mt(null)})]})}const rl=Object.freeze(Object.defineProperty({__proto__:null,WorkspaceDiffPanel:Vr},Symbol.toStringTag,{value:"Module"}));export{vi as C,Vr as W,rl as a};
|