openpond 0.2.44 → 0.2.46
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/RELEASE.md +16 -13
- package/dist/app-server.d.ts +20954 -11829
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-I3NI75P2.js +2 -0
- package/dist/chunks/{app-layer-7SPLENWD.js → app-layer-B3SMVO4B.js} +1 -1
- package/dist/chunks/app-server-runtime-FL2CHQU2.js +2 -0
- package/dist/chunks/apps-OA2VX34V.js +2 -0
- package/dist/chunks/{chunk-PEYA2Q7Q.js → chunk-33AO3P6X.js} +3 -3
- package/dist/chunks/chunk-4UTIEH5H.js +16 -0
- package/dist/chunks/chunk-4VKNBADF.js +2 -0
- package/dist/chunks/{chunk-ANVOHBUV.js → chunk-5OGRWWEH.js} +1 -1
- package/dist/chunks/chunk-5ZZM3TUN.js +24 -0
- package/dist/chunks/chunk-6JBWHR6T.js +5 -0
- package/dist/chunks/{chunk-DXAZUJPA.js → chunk-6SJZXZNA.js} +1 -1
- package/dist/chunks/chunk-6WLJWRMF.js +2 -0
- package/dist/chunks/chunk-BKMGBIBT.js +2 -0
- package/dist/chunks/chunk-BQNK2NMB.js +21 -0
- package/dist/chunks/chunk-BUFQKDAW.js +2 -0
- package/dist/chunks/chunk-D6E7JBBQ.js +19 -0
- package/dist/chunks/chunk-D6MQTNJ3.js +9 -0
- package/dist/chunks/chunk-DNXKIIV7.js +3 -0
- package/dist/chunks/{chunk-OI2N2636.js → chunk-EWS7MXTM.js} +1 -1
- package/dist/chunks/chunk-F2AG46CV.js +2 -0
- package/dist/chunks/{chunk-CR6CDOKS.js → chunk-F5DUN73H.js} +2 -2
- package/dist/chunks/chunk-FKCWOASO.js +49 -0
- package/dist/chunks/chunk-FOEUDMME.js +2678 -0
- package/dist/chunks/chunk-H6W55CQG.js +2 -0
- package/dist/chunks/chunk-HK3WGUKK.js +17 -0
- package/dist/chunks/{chunk-ZEVARU6J.js → chunk-HO5L2FUU.js} +1 -1
- package/dist/chunks/chunk-HP2D3W2B.js +42 -0
- package/dist/chunks/chunk-ICZEOMPO.js +2 -0
- package/dist/chunks/{chunk-X2B4MN6W.js → chunk-IV7F74JJ.js} +1 -1
- package/dist/chunks/chunk-JBHAU7PH.js +2409 -0
- package/dist/chunks/chunk-JO7GRBOG.js +2 -0
- package/dist/chunks/{chunk-KPDWQCF6.js → chunk-KE5RH6JA.js} +1 -1
- package/dist/chunks/chunk-KUKOZJIR.js +2 -0
- package/dist/chunks/chunk-L4BYPZ4U.js +22 -0
- package/dist/chunks/{chunk-2CXJK2M3.js → chunk-LL4QP2IM.js} +1 -1
- package/dist/chunks/{chunk-Z2BYC6TP.js → chunk-LZSY5IM3.js} +1 -1
- package/dist/chunks/chunk-M7PBDRKC.js +2 -0
- package/dist/chunks/{chunk-OJVIH7J6.js → chunk-MCRA6ZGJ.js} +1 -1
- package/dist/chunks/chunk-NPOHW5OU.js +2 -0
- package/dist/chunks/{chunk-KIGN4FI6.js → chunk-OGXSE57Z.js} +1 -1
- package/dist/chunks/{chunk-HZP5U2AA.js → chunk-P653BXMY.js} +1 -1
- package/dist/chunks/{chunk-YF6IDYTS.js → chunk-PGKEDR3S.js} +1 -1
- package/dist/chunks/chunk-PMZH2TKS.js +4 -0
- package/dist/chunks/chunk-TYWBEJOA.js +3 -0
- package/dist/chunks/chunk-USWZ3KUC.js +2 -0
- package/dist/chunks/chunk-UWO34HP6.js +33 -0
- package/dist/chunks/{chunk-Z6ZR5O3J.js → chunk-VW7D3DRM.js} +2 -2
- package/dist/chunks/chunk-W4IL6TWB.js +186 -0
- package/dist/chunks/chunk-WVNN3RB2.js +2 -0
- package/dist/chunks/{chunk-RAWEO7SJ.js → chunk-WWABOVRW.js} +2 -2
- package/dist/chunks/{chunk-B3O2GAQH.js → chunk-XLDW5NN3.js} +1 -1
- package/dist/chunks/chunk-YSYXIJ46.js +8 -0
- package/dist/chunks/{chunk-V62BHD5G.js → chunk-ZC57DX6D.js} +1 -1
- package/dist/chunks/{chunk-W5NQ2DI7.js → chunk-ZJY2L43W.js} +3 -3
- package/dist/chunks/cli-5QR7QNQJ.js +2 -0
- package/dist/chunks/{configuration-command-LDPUCHVH.js → configuration-command-MVZS625X.js} +1 -1
- package/dist/chunks/connected-evidence-7LHUZ2UI.js +2 -0
- package/dist/chunks/{continual-MHMPLLUZ.js → continual-K5JNHNQH.js} +3 -3
- package/dist/chunks/core-commands-J2SJM5I5.js +2 -0
- package/dist/chunks/datasets-KDN2EXHE.js +2 -0
- package/dist/chunks/desktop-test-WIOEKMPR.js +3 -0
- package/dist/chunks/dist-3MTJ7VM6.js +2 -0
- package/dist/chunks/{dist-ELWB75PL.js → dist-JBE7DPFZ.js} +1 -1
- package/dist/chunks/evaluation-coordination-NGYHL7HG.js +2 -0
- package/dist/chunks/experiment-improvements-2M7GRGWS.js +2 -0
- package/dist/chunks/experiments-B6CRZ3GI.js +2 -0
- package/dist/chunks/{extension-JEUZZJ5X.js → extension-RZTMK3ON.js} +1 -1
- package/dist/chunks/{help-4F4QGL4C.js → help-EISFHH2F.js} +1 -1
- package/dist/chunks/hosted-experiment-improvement-6CHH65DX.js +3 -0
- package/dist/chunks/hosted-harness-runtime-PAYMAXH7.js +2 -0
- package/dist/chunks/hosted-profile-candidate-HYEISIAC.js +3 -0
- package/dist/chunks/hosted-profile-compiler-KQREWJA5.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-LV6YXOG7.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-A62UYFEP.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-OR4OLYEX.js +3 -0
- package/dist/chunks/human-review-J6JGNRBR.js +2 -0
- package/dist/chunks/import-YHSX6SBZ.js +4 -0
- package/dist/chunks/learning-REL6GGNA.js +2 -0
- package/dist/chunks/opchat-CUZUU2WM.js +3 -0
- package/dist/chunks/organizations-VT27V4B2.js +2 -0
- package/dist/chunks/{profile-ESULTWDN.js → profile-N2E5ASHQ.js} +1 -1
- package/dist/chunks/project-agent-XMXOBJSC.js +2 -0
- package/dist/chunks/sandbox-command-NC665ZZ5.js +2 -0
- package/dist/chunks/{sandbox-template-7WHGNVM6.js → sandbox-template-OTP6S3RU.js} +1 -1
- package/dist/chunks/src-TNWF3IC5.js +329 -0
- package/dist/chunks/{src-A3OVZOSV.js → src-WM35IF4W.js} +5 -5
- package/dist/chunks/taskset-COAPMTT3.js +2 -0
- package/dist/chunks/{teams-bot-YMCDLBGT.js → teams-bot-ACWJ7PJP.js} +1 -1
- package/dist/chunks/training-4JUK7YQV.js +2 -0
- package/dist/chunks/{workspaces-ZZ7R5BUL.js → workspaces-WTPFRJMS.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-CdDQ-lXE.css +1 -0
- package/dist/web/assets/App-D2f8_mGk.js +235 -0
- package/dist/web/assets/{AppDialog-CV3ddujB.js → AppDialog-CaxeNfsu.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-dhbGOO_K.js → AppTerminalPanel-dtK0ZPer.js} +2 -2
- package/dist/web/assets/{AppsView-Bxa-9BF2.js → AppsView-DwK1UBJP.js} +1 -1
- package/dist/web/assets/BrowserSidebar-Cj9VnkgU.js +1 -0
- package/dist/web/assets/{CartesianChart-BOxN-Su1.js → CartesianChart-Drfk6jTn.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-DTmJvNJx.js → CollaborationTabs-Czh2noeb.js} +1 -1
- package/dist/web/assets/{CommandMenu-DggN2ygj.js → CommandMenu-D-M-xomh.js} +1 -1
- package/dist/web/assets/CommunityView-BrdxUI5Z.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-CJ8nkYJf.js +1 -0
- package/dist/web/assets/GetStartedView-u7Jw7YA1.js +1 -0
- package/dist/web/assets/HostedModelLearningReview-D0a2nwse.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-CQQGyjxi.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-Cxlc4sSC.js +1 -0
- package/dist/web/assets/LabSkillSidebar-BnJkDb0c.js +1 -0
- package/dist/web/assets/LabsRoute-ACN76d2j.css +1 -0
- package/dist/web/assets/LabsRoute-hHwZNbqN.js +99 -0
- package/dist/web/assets/MainChatThread-r_TYiTnW.js +2 -0
- package/dist/web/assets/MainPane-DJcd4tPk.js +19 -0
- package/dist/web/assets/MainPane-DOWsSew1.css +1 -0
- package/dist/web/assets/{MarkdownText-BhzHRq1J.js → MarkdownText-BxPHz4je.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-LU-PhEhW.js → NativeSkillSidebar-CCHK6kMG.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Bi_gpHLG.js → NewExperienceSwitcher-CuKWTDZj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-B8pWvSkq.js → NewProjectDialog-CS6sw2oD.js} +1 -1
- package/dist/web/assets/OutputsPage-JDM5bfLJ.js +1 -0
- package/dist/web/assets/{ProjectsPage-Ca8_iEWu.js → ProjectsPage-B3zTBHOA.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-L8S3yj1u.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-6pygznxX.js → RightSidebarHomePanel-BWJQKFUp.js} +1 -1
- package/dist/web/assets/ScheduledWorkPage-qX12p4B0.js +1 -0
- package/dist/web/assets/SettingsView-0KMs-r2I.js +9 -0
- package/dist/web/assets/SettingsView-CVsuQeCZ.css +1 -0
- package/dist/web/assets/{TeamChatView-BGLCPTen.js → TeamChatView-DakXCNQE.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-DHkS2cVJ.js → TerminalOverlay-DaonK5C0.js} +12 -12
- package/dist/web/assets/{TrainingCreationPanel-Dneamjzh.js → TrainingCreationPanel-CUvSsSwp.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-Cfh59jLZ.js → TrainingDraftPanel-DNivtVwd.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-C9l1KY-O.js → UsageSettingsSection-rbmuoPoE.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DrYt9xzv.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-CThoTqe4.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-DeODKxvW.js +32 -0
- package/dist/web/assets/{WorkspaceGitDialogs-mE3Og6Zo.js → WorkspaceGitDialogs-CBarJYF-.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-DPZ0n0G9.js → WorkspaceMonacoEditor-Hmu5m_sO.js} +3 -3
- package/dist/web/assets/{arrow-up-right-DU2KsZD-.js → arrow-up-right-BV2IHfb9.js} +1 -1
- package/dist/web/assets/chunk-YTGRET2L-PKzEfYnf.js +1 -0
- package/dist/web/assets/{clipboard-g2b4_k81.js → clipboard-DDIvAWKp.js} +1 -1
- package/dist/web/assets/{cloud-upload-P2bDOPsQ.js → cloud-upload-Dv6kFnfC.js} +1 -1
- package/dist/web/assets/{cssMode-CPbPVAUt.js → cssMode-BK0jFqWW.js} +1 -1
- package/dist/web/assets/{folder-open-BmsONNsr.js → folder-open-B9ixJQJX.js} +1 -1
- package/dist/web/assets/{folder-plus-B18NgUxy.js → folder-plus-DqSKvtNB.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-enxGCV_e.js → git-commit-horizontal-C1lQvfxe.js} +1 -1
- package/dist/web/assets/{htmlMode-DiV88uQv.js → htmlMode-CCV301b6.js} +1 -1
- package/dist/web/assets/index-1cMIFBxZ.css +1 -0
- package/dist/web/assets/{index-vfpCN9zy.js → index-DIaKfM8a.js} +2 -2
- package/dist/web/assets/{info-DmuSBIYe.js → info-BEvaynAD.js} +1 -1
- package/dist/web/assets/{jsonMode-BaeOjuKU.js → jsonMode-Co4pyN4F.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-D8To0CQA.js → lspLanguageFeatures-CSU0G5da.js} +1 -1
- package/dist/web/assets/{minimize-2-C2xnEzCe.js → minimize-2-DT8t8wwP.js} +1 -1
- package/dist/web/assets/{monaco.contribution-JW3MxX6k.js → monaco.contribution-CBwGIQY1.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DgTFvG2Q.js → monaco.contribution-Cr0AaHCD.js} +2 -2
- package/dist/web/assets/{monaco.contribution-bytkwn0O.js → monaco.contribution-DSBAb_PC.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DbrACt99.js → monaco.contribution-DUZrs1D-.js} +2 -2
- package/dist/web/assets/{monitor-mtHVW7gU.js → monitor-DGqnfsK9.js} +1 -1
- package/dist/web/assets/play-C1XWyKh6.js +1 -0
- package/dist/web/assets/{python-DAPe0Urm.js → python-Z1foxLdf.js} +1 -1
- package/dist/web/assets/{save-B2eVAjW6.js → save-CX2kF74j.js} +1 -1
- package/dist/web/assets/{square-16bX2k2i.js → square-DMkXeYeV.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-Ce0YhEQg.js → toggleHighContrast-CRMVp779.js} +1 -1
- package/dist/web/assets/{tsMode-CnvMmHz6.js → tsMode-Czu8YAqh.js} +1 -1
- package/dist/web/assets/{upload-COPbAaD-.js → upload-giKOPnl1.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-C-Wjm5HK.js → useLocalAgentSchedules-BHxWmOeC.js} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BfVbncMB.js → useSessionTurnCache-CUYFsu_W.js} +1 -1
- package/dist/web/assets/{wifi-off-C9iLbCC-.js → wifi-off-DbDXaV1N.js} +1 -1
- package/dist/web/assets/{workers-BXh_u8Fr.js → workers-Cno4XklJ.js} +1 -1
- package/dist/web/assets/{yaml-CRSr9x6_.js → yaml-C28t_C6h.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +99 -0
- package/package.json +4 -3
- package/dist/chunks/actions-command-5IEZEP6W.js +0 -2
- package/dist/chunks/app-server-runtime-NQ2BYPGK.js +0 -2
- package/dist/chunks/apps-XQ7PHJTD.js +0 -2
- package/dist/chunks/chunk-36RCXSEJ.js +0 -2
- package/dist/chunks/chunk-3QC2DDQ5.js +0 -2
- package/dist/chunks/chunk-3XDFNA7W.js +0 -2
- package/dist/chunks/chunk-4S4WH65X.js +0 -3
- package/dist/chunks/chunk-4TMC5F2P.js +0 -5
- package/dist/chunks/chunk-65BW2QXY.js +0 -2
- package/dist/chunks/chunk-65QCNUGE.js +0 -659
- package/dist/chunks/chunk-6XF4GI35.js +0 -2
- package/dist/chunks/chunk-ALZRXBEC.js +0 -33
- package/dist/chunks/chunk-ARJUNUH6.js +0 -5
- package/dist/chunks/chunk-CEEZ7Y2J.js +0 -2
- package/dist/chunks/chunk-DZVVGU6K.js +0 -8
- package/dist/chunks/chunk-HY2Q7EDK.js +0 -4
- package/dist/chunks/chunk-IT4AT6LB.js +0 -42
- package/dist/chunks/chunk-KRC2S5QF.js +0 -5
- package/dist/chunks/chunk-L6HCBIAU.js +0 -2
- package/dist/chunks/chunk-LNEOLOK2.js +0 -13
- package/dist/chunks/chunk-MTJNKRXL.js +0 -22
- package/dist/chunks/chunk-NM2GYDPA.js +0 -19
- package/dist/chunks/chunk-OMM4ZO7E.js +0 -2182
- package/dist/chunks/chunk-OQPFFKU6.js +0 -2
- package/dist/chunks/chunk-QID62K65.js +0 -2400
- package/dist/chunks/chunk-YOOPTMQK.js +0 -3
- package/dist/chunks/cli-OJU6NQSA.js +0 -2
- package/dist/chunks/core-commands-UZL5RF2M.js +0 -2
- package/dist/chunks/datasets-42AZHVSV.js +0 -13
- package/dist/chunks/desktop-test-DI76HKS7.js +0 -3
- package/dist/chunks/dist-6YP37XI5.js +0 -2
- package/dist/chunks/experiments-Z3S35BYN.js +0 -2
- package/dist/chunks/hosted-harness-runtime-VZNYNQ6T.js +0 -2
- package/dist/chunks/hosted-profile-compiler-JXLPR7SX.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-Q54YXXIM.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-7WESM3ZH.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-QP24PYBL.js +0 -3
- package/dist/chunks/opchat-UFWWVJL6.js +0 -3
- package/dist/chunks/organizations-SBBIOF6O.js +0 -2
- package/dist/chunks/project-agent-IBHUQ3JX.js +0 -2
- package/dist/chunks/sandbox-command-PAJAIMWM.js +0 -2
- package/dist/chunks/src-5MJSO3UD.js +0 -326
- package/dist/chunks/taskset-BZYQT65N.js +0 -2
- package/dist/chunks/training-7PST5HZU.js +0 -2
- package/dist/web/assets/App-6AQXN2SM.js +0 -226
- package/dist/web/assets/App-7h_oHCFd.css +0 -1
- package/dist/web/assets/BrowserSidebar-BLwL2FOG.js +0 -1
- package/dist/web/assets/CommunityView-CuDrYOIf.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-BrduENlL.js +0 -1
- package/dist/web/assets/GetStartedView-Db1IEWzv.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-kofNdPAe.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-6ij3nwWD.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-C7Maqcit.js +0 -1
- package/dist/web/assets/LabSkillSidebar-Bz0U-Nmw.js +0 -1
- package/dist/web/assets/LabsRoute-Ch1N-e2S.js +0 -52
- package/dist/web/assets/LabsRoute-Dw6-12kt.css +0 -1
- package/dist/web/assets/MainChatThread-BJbhZOvs.js +0 -2
- package/dist/web/assets/MainPane-Cs2Kng_k.js +0 -19
- package/dist/web/assets/OutputsPage-BkGI0kHp.js +0 -1
- package/dist/web/assets/RightChatPanelStack-DjEdxsq8.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-BSiOxxAH.js +0 -1
- package/dist/web/assets/SettingsView-1XN7KLBl.js +0 -9
- package/dist/web/assets/SettingsView-C7av3zwv.css +0 -1
- package/dist/web/assets/WorkSidebarPanel-CEnO-Txp.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-BiuQBflC.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-Dr-E0c1j.js +0 -32
- package/dist/web/assets/index-B9VSiz_z.css +0 -1
- package/dist/web/assets/refresh-cw-Dvm_Pq3U.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-vfpCN9zy.js";import{w as W,bf as A,b8 as D,X as B,m as R}from"./App-6AQXN2SM.js";import{s as M,b as z,C as K,F as X}from"./MarkdownText-BhzHRq1J.js";import{F as q,I as H,b as Y,d as V,e as G}from"./MainPane-Cs2Kng_k.js";import{F as J}from"./folder-open-BmsONNsr.js";import"./cloud-upload-P2bDOPsQ.js";import"./arrow-up-right-DU2KsZD-.js";import"./square-16bX2k2i.js";import"./refresh-cw-Dvm_Pq3U.js";const Q="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Z="application/vnd.openxmlformats-officedocument.presentationml.presentation",tt="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";function x(t){const s=t.contentType.toLowerCase(),o=t.title.toLowerCase();return s===Q||o.endsWith(".docx")?{label:"Document",type:"document"}:s==="application/pdf"||o.endsWith(".pdf")?{label:"PDF",type:"pdf"}:s===Z||o.endsWith(".pptx")?{label:"Presentation",type:"presentation"}:s===tt||s==="text/csv"||s==="text/tab-separated-values"||o.endsWith(".xlsx")||o.endsWith(".csv")||o.endsWith(".tsv")?{label:"Table",type:"table"}:s==="text/html"||o.endsWith(".html")?{label:"HTML",type:"html"}:s==="application/json"||s==="text/markdown"||s==="text/plain"?{label:"Text",type:"text"}:s.startsWith("image/")?{label:"Image",type:"image"}:s.startsWith("audio/")?{label:"Audio",type:"audio"}:s.startsWith("video/")?{label:"Video",type:"video"}:{label:"File",type:"file"}}function et(t){return[...t].sort((s,o)=>P(o.createdAt)-P(s.createdAt)||o.revision-s.revision)}function P(t){const s=new Date(t).getTime();return Number.isNaN(s)?0:s}const st=15e3,f=new Map;function nt(t){const s=i.useMemo(()=>t?_(t):null,[t]),o=s?L(s):null,[a,r]=i.useState(o??[]),[j,h]=i.useState(!!t&&!o),[b,d]=i.useState(null);return i.useEffect(()=>{let p=!1;if(!t||!s){r([]),h(!1),d(null);return}const m=L(s);return r(m??[]),h(!m),d(null),ot(t).then(l=>{p||r(l)}).catch(l=>{p||d(rt(l))}).finally(()=>{p||h(!1)}),()=>{p=!0}},[s,t]),{error:b,loading:j,outputs:a}}function L(t){const s=f.get(t);return s&&s.refreshedAt>0?s.outputs:null}function ot(t){const s=_(t),o=f.get(s);if(o?.request)return o.request;if(o&&o.refreshedAt>0&&Date.now()-o.refreshedAt<st)return Promise.resolve(o.outputs);const a=W.workOutputs(t).then(r=>et(r.outputs)).then(r=>(f.set(s,{outputs:r,refreshedAt:Date.now(),request:null}),r)).catch(r=>{throw o?f.set(s,{...o,request:null}):f.delete(s),r});return f.set(s,{outputs:o?.outputs??[],refreshedAt:o?.refreshedAt??0,request:a}),a}function _(t){return`${t.serverUrl}\0${t.token}`}function rt(t){return t instanceof Error?t.message:"Could not load Work outputs."}const v="all",at=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function Tt({connection:t,onViewChat:s}){const{error:o,loading:a,outputs:r}=nt(t),[j,h]=i.useState(v),[b,d]=i.useState(null),[p,m]=i.useState(null),[l,T]=i.useState(null);i.useEffect(()=>()=>{l?.objectUrl&&URL.revokeObjectURL(l.objectUrl)},[l?.objectUrl]);const k=i.useMemo(()=>Array.from(new Set(r.map(n=>x(n).label))).sort((n,u)=>n.localeCompare(u)),[r]),y=k.includes(j)?j:v,w=i.useMemo(()=>y===v?r:r.filter(n=>x(n).label===y),[y,r]);async function I(n){if(!t)return;const u=S(n);m(u),d(null);try{const c=await W.workspaceTool(t,n.sourceTaskId,{action:"work_output_read",source:"ui_button",args:{outputId:n.id,revision:n.revision}});if(!c.ok)throw new Error(c.output);const F=pt(c.data),O=typeof F.contentsBase64=="string"?F.contentsBase64:"";if(!O)throw new Error("The output did not include file data.");const N=new File([dt(O)],n.title,{type:n.contentType}),U=x(n),E=U.type==="text"||U.type==="html";l?.objectUrl&&URL.revokeObjectURL(l.objectUrl),T({file:N,objectUrl:E?null:URL.createObjectURL(N),output:n,text:E?await N.text():null})}catch(c){d(ft(c))}finally{m(null)}}async function C(n){if(n.location.kind!=="local")return;const u=await M(n.location.path,n.title);!u.ok&&!u.canceled&&d("Could not save a copy of the Work output.")}return e.jsxs("section",{"aria-label":"Outputs",className:`outputs-view${l?" detail-open":""}`,children:[e.jsx("div",{className:"outputs-scroll",children:e.jsxs("div",{className:"outputs-content",children:[r.length>0?e.jsx("header",{className:"outputs-header",children:e.jsx("label",{className:"outputs-filter",children:e.jsxs("select",{"aria-label":"Filter files by file type",onChange:n=>h(n.target.value),value:y,children:[e.jsx("option",{value:v,children:"All file types"}),k.map(n=>e.jsx("option",{value:n,children:n},n))]})})}):null,o||b?e.jsx("p",{className:"outputs-error",children:b??o}):null,t?a&&r.length===0?e.jsxs("div",{className:"outputs-loading",role:"status",children:[e.jsx(A,{className:"outputs-spin",size:16}),e.jsx("span",{children:"Loading files"})]}):r.length===0?e.jsx(g,{children:"Files created in Work will appear here."}):w.length===0?e.jsx(g,{children:"No files match this file type."}):e.jsx("div",{className:"outputs-grid","data-testid":"desktop-output-cards",children:w.map(n=>{const u=x(n),c=S(n);return e.jsxs("article",{className:"output-card",children:[e.jsxs("button",{"aria-label":`Preview ${n.title}`,className:"output-card-main",disabled:p===c,onClick:()=>{I(n)},type:"button",children:[e.jsx("span",{className:"output-card-icon",children:e.jsx($,{type:u.type})}),e.jsxs("span",{className:"output-card-copy",children:[e.jsx("strong",{children:n.title}),e.jsxs("small",{children:[u.label," · ",ut(n.sizeBytes)]}),e.jsxs("small",{children:["Revision ",n.revision," ·"," ",e.jsx("time",{dateTime:n.createdAt,children:ct(n.createdAt)})]})]}),p===c?e.jsx(A,{className:"outputs-spin",size:15}):null]}),e.jsxs("div",{className:"output-card-actions",children:[n.location.kind==="local"?e.jsx("button",{"aria-label":`Download ${n.title}`,className:"output-download-button",onClick:()=>{C(n)},title:"Download",type:"button",children:e.jsx(D,{"aria-hidden":"true",size:14})}):null,e.jsx("button",{onClick:()=>s(n.sourceTaskId),type:"button",children:"View chat"})]})]},c)})}):e.jsx(g,{children:"Connect to the local OpenPond server to view outputs."})]})}),l?e.jsx(lt,{onClose:()=>T(null),onSave:()=>{C(l.output)},onViewChat:()=>s(l.output.sourceTaskId),preview:l}):null]})}function lt({onClose:t,onSave:s,onViewChat:o,preview:a}){const r=x(a.output);return e.jsxs("aside",{"aria-label":`${a.output.title} preview`,className:"output-detail",children:[e.jsxs("header",{className:"output-detail-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:a.output.title}),e.jsxs("p",{children:[r.label," · Revision ",a.output.revision]})]}),e.jsx("button",{"aria-label":"Close output preview",onClick:t,type:"button",children:e.jsx(B,{size:16})})]}),e.jsx("div",{className:"output-preview-surface",children:a.text!==null?r.type==="html"?e.jsx("iframe",{sandbox:"",srcDoc:a.text,title:a.output.title}):e.jsx("pre",{children:a.text}):r.type==="image"&&a.objectUrl?e.jsx("img",{alt:a.output.title,src:a.objectUrl}):r.type==="pdf"&&a.objectUrl?e.jsx("iframe",{src:a.objectUrl,title:a.output.title}):r.type==="audio"&&a.objectUrl?e.jsx("audio",{controls:!0,src:a.objectUrl}):r.type==="video"&&a.objectUrl?e.jsx("video",{controls:!0,src:a.objectUrl}):e.jsxs("div",{className:"output-native-preview",children:[e.jsx($,{type:r.type}),e.jsx("p",{children:"This file type uses its native application for detailed review."})]})}),e.jsxs("div",{className:"output-detail-actions",children:[a.output.location.kind==="local"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{z(a.output.location.kind==="local"?a.output.location.path:"")},type:"button",children:[e.jsx(J,{size:14}),"Reveal"]}),e.jsx("button",{"aria-label":`Download ${a.output.title}`,className:"output-download-button",onClick:s,title:"Download",type:"button",children:e.jsx(D,{"aria-hidden":"true",size:14})})]}):null,e.jsx("button",{onClick:o,type:"button",children:"View chat"})]})]})}function $({type:t}){const s=it(t);return e.jsx(s,{"aria-hidden":"true",size:18})}function it(t){return t==="audio"?q:t==="html"||t==="text"?K:t==="image"?H:t==="presentation"?Y:t==="table"?V:t==="video"?G:t==="file"?X:R}function g({children:t}){return e.jsx("p",{className:"outputs-empty",children:t})}function S(t){return`${t.sourceTaskId}:${t.id}:${t.revision}`}function ut(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:`${(t/1e6).toFixed(1)} MB`}function ct(t){const s=new Date(t);return Number.isNaN(s.getTime())?"Unknown date":at.format(s)}function dt(t){const s=window.atob(t),o=new ArrayBuffer(s.length),a=new Uint8Array(o);for(let r=0;r<s.length;r+=1)a[r]=s.charCodeAt(r);return o}function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function ft(t){return t instanceof Error?t.message:"Could not load Work outputs."}export{Tt as OutputsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as n}from"./index-vfpCN9zy.js";import{F as ve}from"./folder-open-BmsONNsr.js";import{em as we,en as Re,eo as Ie,ep as ye,a9 as Ce,aB as je,aO as Pe,eq as Te,aC as Ae,aD as Se,aH as Me,aE as Ee,X as Ne,P as Fe,aT as Be}from"./App-6AQXN2SM.js";import{u as De,a as $e}from"./useSessionTurnCache-BfVbncMB.js";import{f as Le,u as Oe,s as qe,g as He,l as Ue,h as ze,T as Ke,M as Ve,i as We,A as Qe,j as Ge}from"./MainPane-Cs2Kng_k.js";import"./cloud-upload-P2bDOPsQ.js";import"./arrow-up-right-DU2KsZD-.js";import"./MarkdownText-BhzHRq1J.js";import"./square-16bX2k2i.js";import"./refresh-cw-Dvm_Pq3U.js";function Xe({panel:s,runtimeEventStore:L,actionCatalog:C,createImproveActions:j,contextCompaction:P,steerActiveResponses:O,initialScrollState:g,codexPermissionMode:q,codexReasoningEffort:H,openPondCommandAccessMode:T,connection:b,connectedAppMentions:U,mentionApps:z,codexPersonalSkills:K,profileSkills:V,profileTarget:A,projectTarget:W,providerSettings:Q,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,showToast:J,workspaceTarget:Y,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onModelChange:se,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ne,onOpenProfileSettings:ie,onOpenSession:oe,onProviderChange:ae,onProviderSetupOpen:re,onPromptChange:ce,onProfileTargetChange:de,onScrollStateChange:le,onProjectTargetChange:ue,onResolveApproval:he,onShowBrowserPanel:M,onStop:me,onSubmit:x,onWorkspaceTargetChange:fe}){const w=a.useRef(null),[v]=a.useState(()=>new Le),R=a.useRef(g?.stickyToBottom??!0),E=a.useRef(!1),I=Oe(L,s.runtimeSource==="live"?s.sessionId:null),t=a.useMemo(()=>{if(s.runtimeSource==="history"||!s.sessionId)return s;const i=I.events,l=we(i,[]);return{...s,messages:je(v.project(i),s.pendingUserMessage),createImproveRun:Ce({events:i}),contextWindowStatus:Ie({provider:s.provider,snapshot:ye(l,s.sessionId),preferences:P}),goalRuntime:Re(l,s.sessionId)}},[v,P,I,s]),u=t.running&&!t.pendingApproval&&qe(t.messages),f=a.useMemo(()=>t.createImproveRun?{...j,run:t.createImproveRun}:null,[t.createImproveRun,j]),N=a.useMemo(()=>He(t.messages,{showThinkingIndicator:u}),[t.messages,u]),F=De(t.messages,t.sessionId??`draft:${t.id}`),p=t.messages.at(-1),y=a.useMemo(()=>Ue(t.messages),[t.messages]),B=$e({connection:b,latestTurnId:p?.turnId??null,sessionId:t.sessionId,turnRunning:t.running}),D=[t.id,t.sessionId??"draft",N.length,p?.id??"",p?.content?.length??0,p?.timestamp??"",u?"thinking":""].join(":");a.useLayoutEffect(()=>{const i=w.current;!i||E.current||(E.current=!0,i.scrollTop=g?.stickyToBottom?i.scrollHeight:g?.scrollTop??0)},[g]),ze({contentKey:D,onContentChange:i=>{R.current&&(i.scrollTop=i.scrollHeight)},threadRef:w});const c=a.useCallback((i,l)=>{const k=t.sessionId??`side-chat:${t.id}`;Pe({conversationId:k,href:i,explicitFile:l?.explicitFile,newTab:l?.newTab}).then(h=>{h&&M()})},[t.id,t.sessionId,M]),pe=a.useCallback(async(i,l)=>{const k=l.action==="answer"?l.text:"Dismiss this question";if(!await x([],null,null,{displayPrompt:k,promptOverride:k,turnMetadata:{userQuestionResolution:l}}))throw new Error("The question response could not be sent.")},[x]);return n.jsxs("section",{className:`right-chat-pane ${t.pendingApproval?"has-approval":""}`,id:`right-chat-panel-${t.id}`,role:"tabpanel","aria-labelledby":`right-chat-tab-${t.id}`,children:[n.jsx("div",{className:"chat-thread right-chat-thread",ref:w,onScroll:i=>{const l=i.currentTarget;R.current=l.scrollHeight-l.scrollTop-l.clientHeight<=72,le({scrollTop:l.scrollTop,stickyToBottom:R.current})},children:N.map(i=>i.type==="thinking"?n.jsx(Ke,{},i.id):n.jsx(Ve,{activeWorkspaceAppId:t.activeWorkspaceAppId,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,connection:b,animateInitialContent:i.message.role==="assistant"&&F.has(i.message.id),kvCacheSummary:We(i.message,y)&&i.message.turnId?B.get(i.message.turnId)??null:null,message:i.message,onOpenBrowserLink:c,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:ne,onOpenProfileSettings:ie,onResolveUserQuestion:pe,onOpenSession:oe,userAttachmentDisplay:s.provider==="codex"?"compact":"full",workspaceRootPath:t.workspaceRootPath,showFooter:i.showFooter},i.id))}),n.jsxs("div",{className:`composer-stack dock right-chat-composer ${t.pendingApproval?"has-approval":""}`,children:[n.jsx(Qe,{approval:t.pendingApproval,onResolve:he}),n.jsx(Ge,{mode:"dock",prompt:s.prompt,mentionApps:z,connectedAppMentions:U,profileSkills:s.provider==="codex"?K:V,profileTarget:s.provider==="codex"?null:A,selectedMentionAppId:null,contextWindowStatus:t.contextWindowStatus,goalRuntime:t.goalRuntime,createImproveRuntime:f,busy:t.running,running:t.running,steerActiveResponses:O,taskSessionId:s.runtimeSource==="live"?s.sessionId:null,taskEvents:I.events,submissionScopeKey:t.sessionId??t.id,showProjectFooter:!1,connection:b,providerSettings:Q,provider:s.provider,model:s.model,projectTarget:W,actionCatalog:C,workspaceTarget:Y,codexPermissionMode:q,codexReasoningEffort:H,openPondCommandAccessMode:s.provider==="codex"?T:t.session?.openPondCommandAccessMode??T,onProviderChange:ae,onProviderSetupOpen:re,onProjectTargetChange:ue,onWorkspaceTargetChange:fe,onModelChange:se,onCodexPermissionModeChange:Z,onCodexReasoningEffortChange:ee,onOpenPondCommandAccessModeChange:S,onPromptChange:ce,onProfileTargetChange:de,onMentionAppSelect:void 0,showToast:J,onSubmit:x,onStop:me})]})]})}function as({panels:s,runtimeEventStore:L,actionCatalog:C=[],createImproveActions:j,contextCompaction:P,steerActiveResponses:O,busy:g,codexPermissionMode:q,codexReasoningEffort:H,openPondCommandAccessMode:T,connection:b,connectedAppMentions:U,mentionApps:z,codexPersonalSkills:K,profileSkills:V=[],profileLibrary:A={lastUsed:null,profiles:[]},extensionCatalog:W,projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:Z,onAddChat:ee,onActivatePanel:S,onClosePanel:se,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ne,onOpenPondCommandAccessModeChange:ie,onModelChange:oe,onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onProviderChange:le,onProviderSetupOpen:ue,onPromptChange:he,onProfileTargetChange:M,onScrollStateChange:me,onProjectTargetChange:x,onResolveApproval:fe,onResizeStart:w,onSelectFiles:v,onShowBrowserPanel:R,onStop:E,onSubmit:I,onWorkspaceTargetChange:t}){const[u,f]=a.useState(!1),[N,F]=a.useState(()=>Te(s)?.id??null),p=a.useRef(null),y=a.useRef(new Map),B=a.useRef(new Set(s.map(e=>e.id))),D=a.useRef(new Map(s.map(e=>[e.id,e.activationVersion]))),c=s.find(e=>e.id===N)??s.at(-1)??null,pe=c?.session?.currentProfile??A.lastUsed,i=Ae(A,pe),l=i?Se(i,W):V,k=i?[...C.filter(e=>!Me(e)),...Ee(i)]:C;a.useEffect(()=>{const e=B.current,d=D.current;let r=null,m=null;for(const o of s)e.has(o.id)||(r=o),e.has(o.id)&&o.activationVersion>(d.get(o.id)??0)&&(m=o);B.current=new Set(s.map(o=>o.id)),D.current=new Map(s.map(o=>[o.id,o.activationVersion])),F(o=>m?m.id:r?r.id:o&&s.some($=>$.id===o)?o:s.at(-1)?.id??null)},[s]),a.useEffect(()=>{if(!u)return;function e(r){p.current?.contains(r.target)||f(!1)}function d(r){r.key==="Escape"&&f(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",d)}},[u]);const h=a.useCallback((e,d=!1)=>{F(e),S(e),d&&window.requestAnimationFrame(()=>y.current.get(e)?.focus())},[S]),ge=a.useCallback((e=!1)=>{v(),e&&window.requestAnimationFrame(()=>{document.getElementById("right-sidebar-files-tab")?.focus()})},[v]),ke=a.useCallback((e,d)=>{const r=s.findIndex(xe=>xe.id===d);if(r<0)return;const m=r+1;let o=null;if(e.key==="ArrowRight"&&(o=(m+1)%(s.length+1)),e.key==="ArrowLeft"&&(o=(m-1+s.length+1)%(s.length+1)),e.key==="Home"&&(o=0),e.key==="End"&&(o=s.length),o===null)return;if(e.preventDefault(),o===0){ge(!0);return}const $=s[o-1];$&&h($.id,!0)},[s,ge,h]),be=a.useCallback(e=>{if(!["ArrowRight","ArrowLeft","Home","End"].includes(e.key)||(e.preventDefault(),e.key==="Home"))return;const d=e.key==="ArrowLeft"||e.key==="End"?s.at(-1):s[0];d&&h(d.id,!0)},[s,h]);return n.jsxs("aside",{className:"workspace-diff-panel right-chat-panel-stack","aria-label":"Side chats",children:[n.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize side chat panel",onPointerDown:w}),n.jsx("div",{className:"workspace-diff-topbar right-chat-topbar",children:n.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:[n.jsxs("button",{type:"button",className:"workspace-diff-tab",role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":!1,tabIndex:-1,onClick:()=>ge(!1),onKeyDown:be,children:[n.jsx(ve,{size:14}),n.jsx("span",{children:"Files"})]}),s.map(e=>{const d=e.id===c?.id;return n.jsxs("div",{className:`workspace-diff-tab right-chat-tab ${d?"active":""}`,children:[n.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":d,tabIndex:d?0:-1,title:e.title,ref:r=>{r?y.current.set(e.id,r):y.current.delete(e.id)},onClick:()=>h(e.id),onKeyDown:r=>ke(r,e.id),children:[e.running?n.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,n.jsx("span",{children:e.title})]}),n.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:r=>{r.stopPropagation(),se(e.id)},children:n.jsx(Ne,{size:12})})]},e.id)}),n.jsxs("div",{className:"workspace-diff-add-anchor",ref:p,children:[n.jsx("button",{type:"button",className:`workspace-diff-add-tab ${u?"active":""}`,title:"Add to right sidebar","aria-label":"Add to right sidebar","aria-haspopup":"menu","aria-expanded":u,onClick:()=>f(e=>!e),children:n.jsx(Fe,{size:15})}),u?n.jsxs("div",{className:"workspace-diff-add-menu right-chat-add-popover",role:"menu",children:[n.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{f(!1),ee()},children:[n.jsx(Be,{size:13}),n.jsx("span",{children:"New task"})]}),n.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{f(!1),v()},children:[n.jsx(ve,{size:13}),n.jsx("span",{children:"Files"})]})]}):null]})]})}),n.jsx("div",{className:"right-chat-stack-body panes-1",children:c?n.jsx(Xe,{busy:g,createImproveActions:j,contextCompaction:P,steerActiveResponses:O,codexPermissionMode:q,codexReasoningEffort:H,openPondCommandAccessMode:T,connection:b,connectedAppMentions:U,actionCatalog:k,mentionApps:z,codexPersonalSkills:K,profileSkills:l,profileTarget:null,panel:c,runtimeEventStore:L,initialScrollState:{scrollTop:c.scrollTop,stickyToBottom:c.stickyToBottom},projectTarget:Q,providerSettings:G,accountBaseUrl:X,billingOrganizationSlug:_,billingTeamId:J,showToast:Y,workspaceTarget:Z,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:ne,onOpenPondCommandAccessModeChange:e=>ie(e,c.session),onModelChange:e=>oe(c.id,e),onOpenAttachmentInSidebar:ae,onOpenFileInSidebar:re,onOpenProfileSettings:ce,onOpenSession:de,onProviderChange:e=>le(c.id,e),onProviderSetupOpen:ue,onPromptChange:e=>he(c.id,e),onProfileTargetChange:e=>M(c.sessionId,e),onScrollStateChange:e=>me(c.id,e),onProjectTargetChange:x,onResolveApproval:fe,onShowBrowserPanel:R,onStop:()=>E(c.sessionId),onSubmit:(e,d,r,m)=>I(c.id,e,d,r,m),onWorkspaceTargetChange:t},c.id):null})]})}export{as as RightChatPanelStack};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./index-vfpCN9zy.js";import{w as E,x as Re,bf as Ce,ej as Ae,bC as Te,X as $e,ax as xe,g as De,M as ee,v as Ee,aY as U,ao as Me}from"./App-6AQXN2SM.js";import{R as X,u as Ie}from"./useLocalAgentSchedules-C-Wjm5HK.js";import{a as We,P as le,T as pe}from"./MarkdownText-BhzHRq1J.js";import{P as ae,R as Pe}from"./refresh-cw-Dvm_Pq3U.js";import{S as ze}from"./save-B2eVAjW6.js";import{M as Le}from"./minimize-2-C2xnEzCe.js";import{r as Fe,c as Oe,a as Ze}from"./MainPane-Cs2Kng_k.js";import"./cloud-upload-P2bDOPsQ.js";import"./arrow-up-right-DU2KsZD-.js";import"./square-16bX2k2i.js";import"./folder-open-BmsONNsr.js";const _e=3e4;function He(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(null),[j,r]=o.useState(!1),[a,c]=o.useState(null),[k,w]=o.useState(()=>new Set);async function h(m,f){f&&r(!0);try{const u=await E.hostedSavedWork(m);n(u.definitions),d(u.runs),p(u.webBaseUrl??null),c(null)}catch(u){c(se(u))}finally{f&&r(!1)}}o.useEffect(()=>{if(!s){n([]),d([]),p(null),c(null),r(!1);return}let m=!1;const f=async A=>{if(!m){A&&r(!0);try{const g=await E.hostedSavedWork(s);if(m)return;n(g.definitions),d(g.runs),p(g.webBaseUrl??null),c(null)}catch(g){m||c(se(g))}finally{!m&&A&&r(!1)}}};f(!0);const u=window.setInterval(()=>{f(!1)},_e);return()=>{m=!0,window.clearInterval(u)}},[s]);async function b(){s&&await h(s,!0)}async function R(m){s&&(await E.createHostedSavedWork(s,m),await h(s,!1))}async function $(m,f){await C(m,async u=>{await E.updateHostedSavedWork(u,m,f)})}async function y(m){await C(m,async f=>{await E.deleteHostedSavedWork(f,m)})}async function P(m){await C(m,async f=>{await E.runHostedSavedWork(f,m,crypto.randomUUID())})}async function C(m,f){if(!(!s||k.has(m))){N(m,!0);try{await f(s),await h(s,!1)}catch(u){throw c(se(u)),u}finally{N(m,!1)}}}function N(m,f){w(u=>{const A=new Set(u);return f?A.add(m):A.delete(m),A})}return{create:R,definitions:t,error:a,loading:j,pendingScheduleIds:k,refresh:b,remove:y,run:P,runs:l,update:$,webBaseUrl:x}}function se(s){return s instanceof Error?s.message:String(s)}const Ue=3e4;function Ke(s){const[t,n]=o.useState([]),[l,d]=o.useState([]),[x,p]=o.useState(!1),[j,r]=o.useState(null),[a,c]=o.useState(()=>new Set),k=o.useCallback(async h=>{if(s){h&&p(!0);try{const b=await E.chatWorkflows(s);n(b.workflows),d(b.runs),r(null)}catch(b){r(b instanceof Error?b.message:String(b))}finally{h&&p(!1)}}},[s]);o.useEffect(()=>{if(!s){n([]),d([]),r(null),p(!1);return}k(!0);const h=window.setInterval(()=>{k(!1)},Ue);return()=>window.clearInterval(h)},[s,k]);async function w(h,b){if(!a.has(h)){c(R=>new Set(R).add(h));try{await b(),await k(!1)}catch(R){throw r(R instanceof Error?R.message:String(R)),R}finally{c(R=>{const $=new Set(R);return $.delete(h),$})}}}return{workflows:t,runs:l,loading:x,error:j,pendingIds:a,refresh:()=>k(!0),update:(h,b)=>w(h,()=>E.updateChatWorkflow(s,h,b)),remove:h=>w(h,()=>E.deleteChatWorkflow(s,h)),run:h=>w(h,()=>E.runChatWorkflow(s,h))}}const je="openpond.scheduled-work.view.v1";function oe(s=we()){try{return s?.getItem(je)==="list"?"list":"calendar"}catch{return"calendar"}}function Ve(s,t=we()){try{t?.setItem(je,s)}catch{}}function we(){if(typeof window>"u")return null;try{return Re}catch{return null}}function W(s,t){if(!s)return"None";const n=new Date(s);if(!Number.isFinite(n.getTime()))return"None";try{return n.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",...t?{timeZone:t,timeZoneName:"short"}:{}})}catch{return n.toLocaleString()}}function be(s){return B(s.replaceAll("_"," "))}function B(s){return s.replace(/^./,t=>t.toUpperCase())}function ve(s){const[t="0",n="00"]=s.split(":");return new Date(2020,0,1,Number(t),Number(n)).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ye({run:s}){const t=s.error||s.stderr||s.stdout;return e.jsxs("details",{className:"scheduled-run-row",children:[e.jsxs("summary",{children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(s.status)}),e.jsx("small",{children:W(s.createdAt,null)})]}),e.jsx("span",{className:"scheduled-run-trigger",children:s.trigger==="manual"?"Manual":"Scheduled"})]}),t?e.jsx("pre",{children:t}):null]})}function Be({onOpen:s,run:t}){return e.jsxs("button",{className:"scheduled-run-row hosted",onClick:s,type:"button",children:[e.jsxs("span",{children:[e.jsx("strong",{children:be(t.status)}),e.jsx("small",{children:W(t.createdAt,null)})]}),e.jsxs("span",{className:"scheduled-run-trigger",children:[B(t.triggerKind)," ",e.jsx(xe,{size:11})]}),t.deliveryError?e.jsx("p",{children:t.deliveryError}):null]})}function Q({children:s,detailExpanded:t,kind:n="schedule",label:l,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:p}){return e.jsxs("aside",{"aria-label":l,className:`workspace-diff-panel scheduled-detail${t?" expanded":""}`,children:[t?null:e.jsx("div",{"aria-label":"Resize schedule details","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:x,role:"separator"}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":`${n==="workflow"?"Workflow":"Schedule"} details`,children:e.jsxs("button",{"aria-selected":"true",className:"workspace-diff-tab active",role:"tab",type:"button",children:[e.jsx(Ae,{size:14}),e.jsx("span",{children:n==="workflow"?"Workflow":"Schedule"})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{"aria-label":t?`Dock ${n} details`:`Expand ${n} details`,className:"diff-icon-button",onClick:p,title:t?`Dock ${n} details`:`Expand ${n} details`,type:"button",children:t?e.jsx(Le,{size:14}):e.jsx(Te,{size:14})}),e.jsx("button",{"aria-label":`Close ${n} details`,className:"diff-icon-button",onClick:d,title:`Close ${n} details`,type:"button",children:e.jsx($e,{size:14})})]})]}),e.jsx("div",{className:"scheduled-detail-body",children:s})]})}function T({children:s,title:t}){return e.jsxs("section",{className:"scheduled-detail-section",children:[e.jsx("div",{className:"scheduled-detail-section-heading",children:e.jsx("h3",{children:t})}),s]})}function I({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:t})]})}function te({children:s}){return e.jsx("p",{className:"scheduled-empty",children:s})}function ke({label:s}){return e.jsxs("div",{className:"scheduled-loading",role:"status",children:[e.jsx(Ce,{className:"scheduled-spin",size:16}),e.jsx("span",{children:s})]})}const qe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ge({items:s,onSelect:t,selectedKey:n}){const[l,d]=o.useState(()=>de(new Date)),x=o.useMemo(()=>Je(l),[l]),p=o.useMemo(()=>Xe(s),[s]),j=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(l),r=s.filter(a=>!ge(a.nextRunAt));return e.jsxs("div",{className:"scheduled-calendar",children:[e.jsxs("div",{className:"scheduled-calendar-toolbar",children:[e.jsx("strong",{children:j}),e.jsxs("div",{children:[e.jsx("button",{"aria-label":"Previous month",className:"scheduled-icon-button",onClick:()=>d(ce(l,-1)),type:"button",children:e.jsx(De,{size:15})}),e.jsx("button",{className:"scheduled-calendar-today",onClick:()=>d(de(new Date)),type:"button",children:"Today"}),e.jsx("button",{"aria-label":"Next month",className:"scheduled-icon-button",onClick:()=>d(ce(l,1)),type:"button",children:e.jsx(We,{size:15})})]})]}),e.jsxs("div",{className:"scheduled-calendar-grid",role:"grid","aria-label":j,children:[qe.map(a=>e.jsx("div",{className:"scheduled-calendar-weekday",role:"columnheader",children:a},a)),x.map(a=>{const c=ne(a),k=p.get(c)??[],w=a.getMonth()!==l.getMonth(),h=c===ne(new Date);return e.jsxs("div",{className:`scheduled-calendar-day${w?" outside":""}${h?" today":""}`,role:"gridcell",children:[e.jsx("span",{className:"scheduled-calendar-day-number",children:a.getDate()}),e.jsx("div",{className:"scheduled-calendar-events",children:k.map(b=>e.jsxs("button",{"aria-current":n===b.key?"true":void 0,className:`scheduled-calendar-event${b.enabled?"":" paused"}`,onClick:()=>t(b.key),title:b.title,type:"button",children:[e.jsx("span",{children:Qe(b.nextRunAt)}),e.jsx("strong",{children:b.title})]},b.key))})]},c)})]}),r.length?e.jsxs("div",{className:"scheduled-calendar-unscheduled",children:[e.jsx("span",{children:"No upcoming run"}),e.jsx("div",{children:r.map(a=>e.jsx("button",{onClick:()=>t(a.key),type:"button",children:a.title},a.key))})]}):null]})}function Je(s){const t=new Date(s.getFullYear(),s.getMonth(),1),n=new Date(t);return n.setDate(t.getDate()-t.getDay()),Array.from({length:42},(l,d)=>{const x=new Date(n);return x.setDate(n.getDate()+d),x})}function Xe(s){const t=new Map;for(const n of s){const l=ge(n.nextRunAt);if(!l)continue;const d=ne(l);t.set(d,[...t.get(d)??[],n])}for(const n of t.values())n.sort((l,d)=>l.nextRunAt.localeCompare(d.nextRunAt));return t}function ge(s){if(!s)return null;const t=new Date(s);return Number.isNaN(t.getTime())?null:t}function ne(s){return`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`}function de(s){return new Date(s.getFullYear(),s.getMonth(),1)}function ce(s,t){return new Date(s.getFullYear(),s.getMonth()+t,1)}function Qe(s){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(new Date(s))}function es({entry:s,onSelect:t,selected:n}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:"scheduled-status-dot"}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:s.workflow.label})}),e.jsx("span",{children:s.workflow.description}),e.jsxs("small",{children:["On demand · Source ",s.binding.sourceRevision.slice(0,10)]})]})]})}function ss({cadence:s,onSelect:t,schedule:n,selected:l}){return e.jsxs("button",{"aria-current":l?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${n.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsx("span",{className:"scheduled-list-title",children:e.jsx("strong",{children:n.scheduleName})}),e.jsx("span",{children:n.localProjectName}),e.jsxs("small",{children:[s,n.nextRunAt?` · Next ${W(n.nextRunAt,n.timezone)}`:" · No next run"]})]})]})}function ts({cadence:s,definition:t,onSelect:n,schedule:l,selected:d}){return e.jsxs("button",{"aria-current":d?"true":void 0,className:"scheduled-list-row",onClick:n,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:t.name}),e.jsx("small",{className:"scheduled-environment-badge hosted",children:"Hosted"})]}),e.jsx("span",{children:t.prompt}),e.jsxs("small",{children:[s,l.nextRunAt?` · Next ${W(l.nextRunAt,l.timeZone)}`:" · No next run"]})]})]})}function ns({cadence:s,onSelect:t,selected:n,workflow:l}){return e.jsxs("button",{"aria-current":n?"true":void 0,className:"scheduled-list-row",onClick:t,type:"button",children:[e.jsx("span",{className:`scheduled-status-dot ${l.enabled?"active":"paused"}`}),e.jsxs("span",{className:"scheduled-list-copy",children:[e.jsxs("span",{className:"scheduled-list-title",children:[e.jsx("strong",{children:l.name}),e.jsx("small",{className:"scheduled-environment-badge",children:"Chat"})]}),e.jsx("span",{children:l.prompt}),e.jsxs("small",{children:["Runs in ",l.sessionTitle," · ",s,l.nextRunAt?` · Next ${W(l.nextRunAt,l.recurrence.timeZone)}`:" · No next run"]})]})]})}function ls(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>{const d=n.nextRunAt?new Date(n.nextRunAt).getTime():Number.POSITIVE_INFINITY,x=l.nextRunAt?new Date(l.nextRunAt).getTime():Number.POSITIVE_INFINITY;return d-x||n.name.localeCompare(l.name)})}function re(s){const t=ve(s.localTime);return s.kind==="once"?`Once on ${s.startDate} at ${t} · ${s.timeZone}`:s.kind==="weekdays"?`Weekdays at ${t} · ${s.timeZone}`:s.kind==="weekly"?`${s.weekdays?.map(B).join(", ")??"Weekly"} at ${t} · ${s.timeZone}`:s.kind==="monthly"?`Monthly on day ${s.dayOfMonth??1} at ${t} · ${s.timeZone}`:`Daily at ${t} · ${s.timeZone}`}function as({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onToggle:x,onToggleDetailExpanded:p,pending:j,runs:r,workflow:a}){return e.jsxs(Q,{detailExpanded:s,label:`${a.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Workflow details"}),e.jsx("span",{children:a.enabled?"Active":"Paused"})]}),e.jsx("p",{children:a.name})]})}),e.jsx(T,{title:"Prompt",children:e.jsx("pre",{className:"scheduled-prompt",children:a.prompt})}),e.jsx(T,{title:"Profile source",children:a.profileRef&&a.profileWorkflowId?e.jsxs("p",{children:[a.profileRef.profileId," · workflows/",a.profileWorkflowId,"/PROMPT.md"]}):e.jsx("p",{className:"scheduled-detail-error",children:a.profileMigrationError??"Profile package is unresolved."})}),e.jsxs(T,{title:"Delivery",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Runs in",value:a.sessionTitle}),e.jsx(I,{label:"Cadence",value:re(a.recurrence)}),e.jsx(I,{label:"Next run",value:W(a.nextRunAt,a.recurrence.timeZone)}),e.jsx(I,{label:"Last run",value:W(a.lastRunAt,a.recurrence.timeZone)})]}),a.lastError?e.jsx("p",{className:"scheduled-detail-error",children:a.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{x()},type:"button",children:[a.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.enabled?"Pause":"Resume"})]}),e.jsxs("button",{disabled:j,onClick:()=>{n()},type:"button",children:[e.jsx(pe,{size:15}),e.jsx("span",{children:"Delete"})]})]}),e.jsx(T,{title:"Runs",children:r.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:r.map(c=>e.jsxs("div",{className:"scheduled-run-row",children:[e.jsx("span",{children:B(c.status)}),e.jsx("small",{children:W(c.createdAt,a.recurrence.timeZone)}),c.error?e.jsx("p",{children:c.error}):null]},c.id))})})]})}async function rs(s){const t=s.catalog.workflows.find(d=>d.workflow.id===s.workflowId);if(!t)throw new Error("Selected Profile workflow is unavailable.");const n=s.client??E,l=await n.createSession(s.connection,{experience:"work",provider:"openpond",...s.workspaceTarget==="local"?{metadata:{workspaceTarget:"local"}}:{},currentProfile:s.catalog.profileRef,profileWorkflowBinding:t.binding,title:t.workflow.label});return s.onSessionCreated?.(l.id),await n.sendTurn(s.connection,l.id,{prompt:s.prompt?.trim()||t.workflow.label,workflowInput:s.value,...s.attachments?.length?{attachments:s.attachments}:{},approvalPolicy:"on-request",sandbox:"workspace-write",codexPermissionMode:"default"}),l.id}function is({catalog:s,connection:t,detailExpanded:n,entry:l,onClose:d,onDetailResizeStart:x,onOpenSession:p,onToggleDetailExpanded:j}){const[r,a]=o.useState(""),[c,k]=o.useState([]),[w,h]=o.useState("{}"),[b,R]=o.useState(s.profileRef.source==="local"?"local":"hosted"),[$,y]=o.useState(!1),[P,C]=o.useState(null),N=l.workflow;async function m(f){if(f.preventDefault(),!$){y(!0),C(null);try{const u=JSON.parse(w);if(c.length>ee.maxAttachments)throw new Error(`Choose at most ${ee.maxAttachments} files.`);const A=await Promise.all(c.map(async g=>{if(g.size>ee.maxAttachmentBytes)throw new Error(`${g.name} exceeds the attachment size limit.`);return Fe({id:Ze(),file:g,name:g.name,mediaType:g.type||"application/octet-stream",sizeBytes:g.size,kind:Oe(g)})}));await rs({connection:t,catalog:s,workflowId:N.id,value:u,prompt:r,attachments:A,workspaceTarget:b,onSessionCreated:p})}catch(u){C(u instanceof Error?u.message:String(u))}finally{y(!1)}}}return e.jsxs(Q,{detailExpanded:n,kind:"workflow",label:`${N.label} details`,onClose:d,onDetailResizeStart:x,onToggleDetailExpanded:j,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsx("div",{className:"scheduled-detail-title-row",children:e.jsx("h2",{children:"Workflow details"})}),e.jsx("p",{children:N.label})]})}),e.jsx(T,{title:"Description",children:e.jsx("p",{children:N.description})}),e.jsxs(T,{title:"Source",children:[e.jsxs("p",{children:["workflows/",N.id,"/",N.invocation.kind==="instructions"?"PROMPT.md":"ACTION.json"]}),e.jsxs("p",{children:["Revision ",l.binding.sourceRevision.slice(0,12)," · Release ",l.binding.harnessRelease.contentHash.slice(0,12)]})]}),N.skillPaths.length>0?e.jsx(T,{title:"Skills",children:e.jsx("p",{children:N.skillPaths.join(", ")})}):null,N.invocation.kind==="instructions"?e.jsx(T,{title:"Instructions",children:e.jsx("pre",{className:"scheduled-prompt",children:N.invocation.instructions})}):null,e.jsx(T,{title:"Start a run",children:e.jsxs("form",{className:"scheduled-profile-workflow-form",onSubmit:f=>{m(f)},children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-prompt",children:"Instructions for this run"}),e.jsx("textarea",{id:"scheduled-profile-workflow-prompt",onChange:f=>a(f.target.value),value:r}),e.jsx("label",{htmlFor:"scheduled-profile-workflow-files",children:"Files for this run"}),e.jsx("input",{id:"scheduled-profile-workflow-files",type:"file",multiple:!0,onChange:f=>k(Array.from(f.target.files??[]))}),c.length>0?e.jsx("small",{children:c.map(f=>f.name).join(", ")}):null,e.jsx("label",{htmlFor:"scheduled-profile-workflow-target",children:"Run in"}),e.jsxs("select",{id:"scheduled-profile-workflow-target",value:b,onChange:f=>R(f.target.value),children:[e.jsx("option",{value:"local",children:"Desktop local workspace"}),e.jsx("option",{value:"hosted",children:"Hosted Work"})]}),N.invocation.kind==="agent_action"?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"scheduled-profile-workflow-input",children:"Input JSON"}),e.jsx("textarea",{id:"scheduled-profile-workflow-input",onChange:f=>h(f.target.value),value:w})]}):null,P?e.jsx("p",{className:"scheduled-detail-error",role:"alert",children:P}):null,e.jsx("div",{className:"scheduled-detail-actions",children:e.jsxs("button",{disabled:$,type:"submit",children:[e.jsx(X,{size:15}),e.jsx("span",{children:$?"Starting…":"Run now"})]})})]})})]})}function os(s){return s.flatMap(t=>t.schedules.map(n=>({definition:t,schedule:n})))}function ds(s,t){return s.filter(n=>t==="active"?n.schedule.enabled:t==="paused"?!n.schedule.enabled:!0).sort((n,l)=>O(n.schedule.nextRunAt)-O(l.schedule.nextRunAt)||n.definition.name.localeCompare(l.definition.name))}function cs(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>O(n.nextRunAt)-O(l.nextRunAt)||n.scheduleName.localeCompare(l.scheduleName))}function us(s,t,n){return[...s.map(l=>({kind:"chat",workflow:l})),...t.map(l=>({kind:"local",schedule:l})),...n.map(l=>({kind:"hosted",row:l}))].sort((l,d)=>{const x=O(ue(l)),p=O(ue(d));if(x!==p)return x-p;const j=he(l),r=he(d);return j.localeCompare(r)})}function hs(s){return s.kind==="chat"?{enabled:s.workflow.enabled,key:V(s.workflow.id),nextRunAt:s.workflow.nextRunAt,title:s.workflow.name}:s.kind==="local"?{enabled:s.schedule.enabled,key:K(s.schedule.id),nextRunAt:s.schedule.nextRunAt,title:s.schedule.scheduleName}:{enabled:s.row.schedule.enabled,key:Y(s.row.schedule.id),nextRunAt:s.row.schedule.nextRunAt,title:s.row.definition.name}}function fs(s){const t=s.recurrence;return t?re(t):s.expression??"Manual"}function ue(s){return s.kind==="chat"?s.workflow.nextRunAt:s.kind==="local"?s.schedule.nextRunAt:s.row.schedule.nextRunAt}function he(s){return s.kind==="chat"?s.workflow.name:s.kind==="local"?s.schedule.scheduleName:s.row.definition.name}function ye(s){const t=s.timezone?` · ${s.timezone}`:"";if(s.scheduleType==="rate")return`Every ${s.scheduleExpression}${t}`;const n=s.scheduleExpression.trim().split(/\s+/);if(n.length===5&&/^\d+$/.test(n[0])&&/^\d+$/.test(n[1])){const l=ve(`${n[1].padStart(2,"0")}:${n[0].padStart(2,"0")}`);if(n[2]==="*"&&n[3]==="*"&&n[4]==="*")return`Daily at ${l}${t}`;if(n[2]==="*"&&n[3]==="*"&&n[4]==="MON-FRI")return`Weekdays at ${l}${t}`}return`Cron ${s.scheduleExpression}${t}`}function K(s){return`local:${s}`}function V(s){return`chat:${s}`}function H(s){return`profile:${s}`}function Y(s){return`hosted:${s}`}function O(s){if(!s)return Number.MAX_SAFE_INTEGER;const t=new Date(s).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}const ms=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Ws({connection:s,selectedProfileKey:t,onOpenSession:n,detailOpen:l,detailExpanded:d,onDetailOpenChange:x,onDetailResizeStart:p,onToggleDetailExpanded:j}){const r=He(s),a=Ke(s),c=Ie(s),[k,w]=o.useState(null),[h,b]=o.useState(!1),[R,$]=o.useState(null),[y,P]=o.useState("all"),[C,N]=o.useState(oe);Ee(()=>N(oe()));const[m,f]=o.useState(!1),[u,A]=o.useState(null),g=o.useMemo(()=>os(r.definitions),[r.definitions]),q=o.useMemo(()=>ds(g,y),[y,g]),L=o.useMemo(()=>cs(c.schedules,y),[y,c.schedules]),G=o.useMemo(()=>ls(a.workflows,y),[a.workflows,y]),S=g.find(i=>Y(i.schedule.id)===u)??null,M=c.schedules.find(i=>K(i.id)===u)??null,D=a.workflows.find(i=>V(i.id)===u)??null,z=k?.workflows.find(i=>H(i.workflow.id)===u)??null,v=S?r.runs.filter(i=>i.scheduleId===S.schedule.id):[],J=o.useMemo(()=>us(G,L,q),[G,L,q]),Ne=o.useMemo(()=>[...J.map(hs),...k?.workflows.map(i=>({enabled:!0,key:H(i.workflow.id),nextRunAt:null,title:i.workflow.label}))??[]],[J,k]);U(r.error,{prefix:"Workflows"}),U(c.error,{prefix:"Local schedules"}),U(a.error,{prefix:"Chat workflows"}),U(R,{prefix:"Profile workflows"}),o.useEffect(()=>{if(!s||!t){w(null),$(null);return}let i=!0;return b(!0),E.profileWorkflows(s).then(_=>{i&&(w(_),$(null))}).catch(_=>{i&&$(_ instanceof Error?_.message:String(_))}).finally(()=>{i&&b(!1)}),()=>{i=!1}},[s,t]),o.useEffect(()=>{u&&!S&&!M&&!D&&!z&&!h&&A(null)},[h,D,S,M,z,u]),o.useEffect(()=>{!l&&u&&A(null)},[l,u]),o.useEffect(()=>()=>x(!1),[x]);function Z(i){A(i),x(!0)}function F(){A(null),x(!1)}function ie(i){N(i),Ve(i)}async function Se(){f(!0);try{await Promise.all([r.refresh(),c.refresh(),a.refresh(),s&&t?E.profileWorkflows(s).then(w):Promise.resolve()])}finally{f(!1)}}return e.jsxs("section",{"aria-label":"Workflows",className:`scheduled-work-view${S||M||D||z?" detail-open":""}${d?" detail-expanded":""}`,children:[e.jsx("div",{className:"scheduled-work-scroll",children:e.jsxs("div",{className:"scheduled-work-content",children:[e.jsxs("header",{className:"scheduled-work-header",children:[e.jsxs("div",{"aria-label":"Workflow view",className:"scheduled-view-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":C==="calendar",className:C==="calendar"?"active":void 0,onClick:()=>ie("calendar"),role:"tab",type:"button",children:"Calendar"}),e.jsx("button",{"aria-selected":C==="list",className:C==="list"?"active":void 0,onClick:()=>ie("list"),role:"tab",type:"button",children:"List"})]}),e.jsxs("div",{className:"scheduled-work-header-actions",children:[e.jsx("button",{"aria-label":"Refresh schedules",className:"scheduled-icon-button",disabled:!s||r.loading||c.loading||a.loading||h,onClick:()=>{Se()},title:"Refresh schedules",type:"button",children:e.jsx(Pe,{className:m?"scheduled-spin":void 0,size:16})}),e.jsxs("label",{className:"scheduled-filter",children:[e.jsx(Me,{"aria-hidden":"true",size:16}),e.jsxs("select",{"aria-label":"Schedule filter",onChange:i=>P(i.target.value),value:y,children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"paused",children:"Paused"}),e.jsx("option",{value:"all",children:"All"})]})]})]})]}),e.jsx("section",{"aria-busy":r.loading||c.loading||a.loading||h,className:"scheduled-list",children:s?(r.loading||c.loading||a.loading||h)&&g.length===0&&c.schedules.length===0&&a.workflows.length===0&&!k?.workflows.length?e.jsx(ke,{label:"Loading schedules"}):r.error&&c.error&&g.length===0&&c.schedules.length===0?e.jsx(te,{children:"Schedules are unavailable. Refresh to try again."}):J.length===0&&!k?.workflows.length?e.jsx(te,{children:"Create a scheduled task here or ask for one in Work."}):C==="calendar"?e.jsx(Ge,{items:Ne,onSelect:Z,selectedKey:u}):e.jsxs("div",{className:"scheduled-list-rows",children:[k?.workflows.map(i=>e.jsx(es,{entry:i,onSelect:()=>Z(H(i.workflow.id)),selected:u===H(i.workflow.id)},H(i.workflow.id))),J.map(i=>i.kind==="chat"?e.jsx(ns,{cadence:re(i.workflow.recurrence),onSelect:()=>Z(V(i.workflow.id)),selected:u===V(i.workflow.id),workflow:i.workflow},V(i.workflow.id)):i.kind==="local"?e.jsx(ss,{cadence:ye(i.schedule),onSelect:()=>Z(K(i.schedule.id)),schedule:i.schedule,selected:u===K(i.schedule.id)},K(i.schedule.id)):e.jsx(ts,{cadence:fs(i.row.schedule),definition:i.row.definition,onSelect:()=>Z(Y(i.row.schedule.id)),schedule:i.row.schedule,selected:u===Y(i.row.schedule.id)},Y(i.row.schedule.id)))]}):e.jsx(te,{children:"Connect to OpenPond to view scheduled Work."})})]})}),z&&k&&s?e.jsx(is,{catalog:k,connection:s,detailExpanded:d,entry:z,onClose:F,onDetailResizeStart:p,onOpenSession:n,onToggleDetailExpanded:j},z.workflow.id):S?e.jsx(ps,{onClose:F,onDelete:async()=>{await r.remove(S.schedule.id),F()},onRun:()=>r.run(S.schedule.id),onSave:i=>r.update(S.schedule.id,i),onToggle:()=>r.update(S.schedule.id,{enabled:!S.schedule.enabled}),pending:r.pendingScheduleIds.has(S.schedule.id),row:S,runs:v,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j,webBaseUrl:r.webBaseUrl},`${S.schedule.id}:${S.definition.version}:${S.schedule.configurationVersion}`):D?e.jsx(as,{detailExpanded:d,onClose:F,onDelete:async()=>{await a.remove(D.id),F()},onDetailResizeStart:p,onRun:()=>a.run(D.id),onToggle:()=>a.update(D.id,{enabled:!D.enabled}),onToggleDetailExpanded:j,pending:a.pendingIds.has(D.id),runs:a.runs.filter(i=>i.workflowId===D.id),workflow:D},D.id):M?e.jsx(xs,{connection:s,onClose:F,onRun:()=>c.run(M),onToggle:()=>c.toggle(M),pending:c.pendingScheduleIds.has(M.id),schedule:M,detailExpanded:d,onDetailResizeStart:p,onToggleDetailExpanded:j},M.id):null]})}function xs({connection:s,detailExpanded:t,onClose:n,onDetailResizeStart:l,onRun:d,onToggleDetailExpanded:x,onToggle:p,pending:j,schedule:r}){const a=bs(s,r.id);return U(a.error,{prefix:"Local schedule runs"}),e.jsxs(Q,{detailExpanded:t,label:`${r.scheduleName} details`,onClose:n,onDetailResizeStart:l,onToggleDetailExpanded:x,children:[e.jsx("div",{className:"scheduled-detail-header",children:e.jsxs("div",{children:[e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:r.enabled?"Active":"Paused"})]}),e.jsx("p",{children:r.scheduleName})]})}),e.jsxs(T,{title:"Task",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Environment",value:"Local"}),e.jsx(I,{label:"Project",value:r.localProjectName}),e.jsx(I,{label:"Agent",value:r.agentName}),e.jsx(I,{label:"Action",value:r.targetAction})]}),e.jsx("pre",{className:"scheduled-prompt",children:ws(r)})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(I,{label:"Cadence",value:ye(r)}),e.jsx(I,{label:"Expression",value:r.scheduleExpression}),e.jsx(I,{label:"Timezone",value:r.timezone??"Local time"}),e.jsx(I,{label:"Next run",value:W(r.nextRunAt,r.timezone)}),e.jsx(I,{label:"Last run",value:W(r.lastRunAt,r.timezone)})]}),r.lastError?e.jsx("p",{className:"scheduled-detail-error",children:r.lastError}):null]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[e.jsxs("button",{disabled:j,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:j,onClick:()=>{p()},type:"button",children:[r.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:r.enabled?"Pause":"Resume"})]})]}),e.jsx(T,{title:"Runs",children:a.loading&&a.runs.length===0?e.jsx(ke,{label:"Loading runs"}):a.runs.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:a.runs.map(c=>e.jsx(Ye,{run:c},c.id))})})]})}function ps({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onSave:x,onToggleDetailExpanded:p,onToggle:j,pending:r,row:a,runs:c,webBaseUrl:k}){const w=js(a.schedule),[h,b]=o.useState(a.definition.name),[R,$]=o.useState(a.definition.prompt),[y,P]=o.useState(w.kind),[C,N]=o.useState(w.timeZone),[m,f]=o.useState(w.startDate),[u,A]=o.useState(w.localTime),[g,q]=o.useState(w.weekdays?.[0]??"monday"),[L,G]=o.useState(w.dayOfMonth??1),S=c[0]?.conversationId??null,M=k?fe(k,S):null,D=h!==a.definition.name||R!==a.definition.prompt||y!==w.kind||C!==w.timeZone||m!==w.startDate||u!==w.localTime||g!==(w.weekdays?.[0]??"monday")||L!==(w.dayOfMonth??1);async function z(v){v.preventDefault(),await x({name:h,prompt:R,recurrence:{version:1,kind:y,timeZone:C,startDate:m,localTime:u,end:{kind:"never"},...y==="weekly"?{weekdays:[g]}:{},...y==="monthly"?{dayOfMonth:L}:{}}})}return e.jsx(Q,{detailExpanded:s,label:`${a.definition.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:p,children:e.jsxs("form",{onSubmit:z,children:[e.jsxs("div",{className:"scheduled-detail-header",children:[e.jsx("div",{children:e.jsxs("div",{className:"scheduled-detail-title-row",children:[e.jsx("h2",{children:"Schedule details"}),e.jsx("span",{children:a.schedule.enabled?"Active":"Paused"})]})}),e.jsx("div",{className:"scheduled-detail-header-controls",children:e.jsx("button",{"aria-label":"Delete schedule",className:"scheduled-icon-button",disabled:r,onClick:()=>{n()},title:"Delete schedule",type:"button",children:e.jsx(pe,{size:16})})})]}),e.jsxs(T,{title:"Task",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Name"}),e.jsx("input",{maxLength:180,onChange:v=>b(v.target.value),required:!0,value:h})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Prompt"}),e.jsx("textarea",{onChange:v=>$(v.target.value),required:!0,value:R})]})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("div",{className:"scheduled-field-grid",children:[e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Repeat"}),e.jsxs("select",{onChange:v=>P(v.target.value),value:y,children:[e.jsx("option",{value:"once",children:"Once"}),e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekdays",children:"Weekdays"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]}),y==="weekly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day"}),e.jsx("select",{onChange:v=>q(v.target.value),value:g,children:ms.map(v=>e.jsx("option",{value:v,children:B(v)},v))})]}):y==="monthly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day of month"}),e.jsx("input",{max:31,min:1,onChange:v=>G(Number(v.target.value)),type:"number",value:L})]}):null,e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Start date"}),e.jsx("input",{onChange:v=>f(v.target.value),required:!0,type:"date",value:m})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Time"}),e.jsx("input",{onChange:v=>A(v.target.value),required:!0,type:"time",value:u})]}),e.jsxs("label",{className:"scheduled-field scheduled-field-wide",children:[e.jsx("span",{children:"Timezone"}),e.jsx("input",{onChange:v=>N(v.target.value),required:!0,value:C})]})]}),e.jsxs("p",{className:"scheduled-next-run",children:["Next run: ",W(a.schedule.nextRunAt,w.timeZone)]})]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[D?e.jsxs("button",{disabled:r,type:"submit",children:[e.jsx(ze,{size:15}),e.jsx("span",{children:"Save"})]}):null,e.jsxs("button",{disabled:r,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:r,onClick:()=>{j()},type:"button",children:[a.schedule.enabled?e.jsx(le,{size:15}):e.jsx(ae,{size:15}),e.jsx("span",{children:a.schedule.enabled?"Pause":"Resume"})]})]}),e.jsxs("button",{className:"scheduled-open-chat",disabled:r||!M,onClick:()=>{M&&me(M,S)},type:"button",children:[e.jsx("span",{children:"Open hosted chat"}),e.jsx(xe,{size:14})]}),e.jsx(T,{title:"Runs",children:c.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:c.map(v=>e.jsx(Be,{onOpen:()=>{k&&me(fe(k,v.conversationId),v.conversationId)},run:v},v.id))})})]})})}function js(s){return s.recurrence??{version:1,kind:"daily",timeZone:s.timeZone||ks(),startDate:vs(),localTime:"08:00",end:{kind:"never"}}}function ws(s){const t=s.input.prompt;return typeof t=="string"&&t.trim()?t.trim():Object.keys(s.input).length>0?JSON.stringify(s.input,null,2):"No task input configured."}function bs(s,t){const[n,l]=o.useState([]),[d,x]=o.useState(!1),[p,j]=o.useState(null);return o.useEffect(()=>{if(!s){l([]),x(!1),j(null);return}let r=!1;return x(!0),E.localAgentScheduleRuns(s,t,{limit:20}).then(a=>{r||(l(a.runs),j(null))}).catch(a=>{r||j(gs(a))}).finally(()=>{r||x(!1)}),()=>{r=!0}},[s,t]),{error:p,loading:d,runs:n}}function fe(s,t){const n=new URL(s);return n.pathname=t?`/sandboxes/work/${encodeURIComponent(t)}`:"/sandboxes/work",n.search="",n.hash="",n.toString()}async function me(s,t){const n=window.openpond?.browser;n?.openExternal&&(await n.openExternal({conversationId:t??"hosted-scheduled-work",url:s})).ok||window.open(s,"_blank","noopener,noreferrer")}function vs(){return new Date().toISOString().slice(0,10)}function ks(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function gs(s){return s instanceof Error?s.message:String(s)}export{Ws as ScheduledWorkPage,W as formatScheduledRunAt,fe as hostedConversationUrl};
|