openpond 0.0.67 → 0.0.69
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/chunks/{actions-command-DZ6D7JTO.js → actions-command-6N5XWMR6.js} +4 -3
- package/dist/chunks/{app-layer-MAATABDM.js → app-layer-EXXOWJ5H.js} +7 -6
- package/dist/chunks/app-server-runtime-7FBQBE3C.js +20 -0
- package/dist/chunks/{apps-L23POEUT.js → apps-RZSDOFAG.js} +7 -6
- package/dist/chunks/{chunk-EJURKADM.js → chunk-47EIAYI7.js} +3 -3
- package/dist/chunks/{chunk-K4JEWEJQ.js → chunk-4L3ZJS2T.js} +426 -1
- package/dist/chunks/{chunk-CWCMYSX2.js → chunk-5TKZBMQM.js} +19 -3
- package/dist/chunks/{chunk-Z3SXHGOC.js → chunk-7C4OIFOC.js} +1 -1
- package/dist/chunks/{chunk-RN7MVPC6.js → chunk-BLFIIAWZ.js} +2865 -410
- package/dist/chunks/{chunk-3KLQ52B2.js → chunk-BVY5JYM6.js} +4 -9
- package/dist/chunks/{chunk-DBHSOTYZ.js → chunk-D7BO5Y5J.js} +3 -24
- package/dist/chunks/chunk-DLQQIWN2.js +648 -0
- package/dist/chunks/{chunk-T55IL3GI.js → chunk-DNXBJZAU.js} +1 -1
- package/dist/chunks/{chunk-2N57HMVR.js → chunk-F36ZVO6U.js} +3 -3
- package/dist/chunks/{chunk-42WUHGKD.js → chunk-FEOLMLYU.js} +21 -14
- package/dist/chunks/{chunk-QETF6ILG.js → chunk-FQS2QL5F.js} +359 -841
- package/dist/chunks/{chunk-J2REM7LE.js → chunk-HFPUR4CQ.js} +5 -116
- package/dist/chunks/{chunk-JIEUB6OS.js → chunk-J3YDKJFD.js} +1 -1
- package/dist/chunks/{chunk-JGOP4GCK.js → chunk-JTHL5XJ2.js} +5 -25
- package/dist/chunks/{chunk-BPII37IS.js → chunk-MMRJNSWY.js} +578 -118
- package/dist/chunks/{chunk-DEEQG5MY.js → chunk-NPNIL6SQ.js} +1 -1
- package/dist/chunks/{chunk-7OQFWODA.js → chunk-OOM2PHBE.js} +10377 -8267
- package/dist/chunks/{chunk-J3PSR6F6.js → chunk-QTN6HXOR.js} +3 -3
- package/dist/chunks/{chunk-MHUN6LXO.js → chunk-SFMNGWNO.js} +1 -1
- package/dist/chunks/{chunk-PLDCQVNW.js → chunk-WBAZFKC7.js} +4 -4
- package/dist/chunks/chunk-X7ZG4TSW.js +3063 -0
- package/dist/chunks/{chunk-XIFRFL4T.js → chunk-Y57RTLVV.js} +33 -33
- package/dist/chunks/{chunk-BYAPLT37.js → chunk-YVCYVDNP.js} +4 -2
- package/dist/chunks/{cli-6N2QZCOF.js → cli-HIXVXM72.js} +9 -8
- package/dist/chunks/{core-commands-5TW5I3Z6.js → core-commands-34SVH6ZQ.js} +8 -7
- package/dist/chunks/{desktop-test-JG6XDUTT.js → desktop-test-66DPBNJX.js} +7 -6
- package/dist/chunks/{extension-UUM4ELAF.js → extension-ZMRHCDO3.js} +544 -111
- package/dist/chunks/{help-JFQVVETR.js → help-COHCZEP2.js} +1 -1
- package/dist/chunks/{opchat-3772JCGJ.js → opchat-2PGW2GNN.js} +10 -17
- package/dist/chunks/{organizations-USWBONDO.js → organizations-NZ4OY56V.js} +10 -9
- package/dist/chunks/{profile-2MYIXRUK.js → profile-GEMTRPUG.js} +12 -11
- package/dist/chunks/{project-agent-VDKGFG5V.js → project-agent-NX6YBGWC.js} +11 -10
- package/dist/chunks/{sandbox-command-M5W3VWVP.js → sandbox-command-UEY53OJO.js} +8 -7
- package/dist/chunks/{sandbox-template-25SKARVM.js → sandbox-template-YKYRB645.js} +11 -10
- package/dist/chunks/{src-7RDE5SYD.js → src-IXYDKOBI.js} +4409 -1474
- package/dist/chunks/{src-KYP4COYD.js → src-LKJBD5AM.js} +6 -5
- package/dist/chunks/{teams-bot-BJJISVOG.js → teams-bot-K6KZHZJV.js} +7 -6
- package/dist/chunks/{workspaces-EQTHCFVV.js → workspaces-WXM72UZF.js} +2 -2
- package/dist/cli.js +13 -13
- package/dist/client.d.ts +1 -1
- package/dist/hosted-chat.d.ts +5 -0
- package/dist/index.js +14554 -14173
- package/dist/skills/openpond-refiner-authoring/SKILL.md +29 -0
- package/dist/skills/openpond-refiner-authoring/references/core-boundary.md +5 -0
- package/dist/skills/openpond-refiner-authoring/references/review-profile.md +7 -0
- package/dist/skills/openpond-refiner-authoring/references/validation-and-activation.md +5 -0
- package/dist/web/assets/App-BF9L0JUv.js +171 -0
- package/dist/web/assets/{AppDialog-B8HYaM0m.js → AppDialog-DX-xs3KA.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-CYVj_ITT.js +2 -0
- package/dist/web/assets/AppsView-ByjyGog7.js +1 -0
- package/dist/web/assets/AppsView-CzbB5pXp.css +1 -0
- package/dist/web/assets/BrowserSidebar-BDwtMAZl.js +1 -0
- package/dist/web/assets/CartesianChart-Dv6jJfPR.js +53 -0
- package/dist/web/assets/CollaborationTabs-BfVlyLmR.css +1 -0
- package/dist/web/assets/CollaborationTabs-CC5AIhMh.js +1 -0
- package/dist/web/assets/CommandMenu-Ct0Sx7yP.js +1 -0
- package/dist/web/assets/CommunityView-C_zVE0jg.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-CNn4OywM.js +1 -0
- package/dist/web/assets/GetStartedView-DRFpHDLd.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-BzF-IVXQ.js +1 -0
- package/dist/web/assets/LabSkillSidebar-B9jY4AgE.js +1 -0
- package/dist/web/assets/LabsRoute-CS_orT9s.css +1 -0
- package/dist/web/assets/LabsRoute-Di1Zs4gZ.js +2 -0
- package/dist/web/assets/MainChatThread-8VzlD8Hi.js +2 -0
- package/dist/web/assets/MainPane-StAOFINE.js +6 -0
- package/dist/web/assets/MarkdownText-B8D_ftSJ.js +9 -0
- package/dist/web/assets/{Messages-CWoU5OZ2.js → Messages-TY62tiDp.js} +6 -6
- package/dist/web/assets/NativeSkillSidebar-DjebFRoi.js +1 -0
- package/dist/web/assets/NewExperienceSwitcher-C-bJxHxY.js +1 -0
- package/dist/web/assets/NewProjectDialog-Cx8QcZm7.js +1 -0
- package/dist/web/assets/OutputsPage-Y9HM-SHX.js +1 -0
- package/dist/web/assets/ProjectsPage-BBr58yKT.js +1 -0
- package/dist/web/assets/ProjectsPage-DdG-U9ZW.css +1 -0
- package/dist/web/assets/RightChatPanelStack-DzUbDKwp.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-Dx-1elSI.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-BuXw_W8b.js +1 -0
- package/dist/web/assets/SettingsView-DB_zPHYY.js +6 -0
- package/dist/web/assets/{TeamChatView-Cst9bXqE.js → TeamChatView-Bkyhu40R.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-72oJPCbi.js → TerminalOverlay-CaCkZDzO.js} +3 -3
- package/dist/web/assets/TrainingCreationPanel-Vvi41WNT.js +1 -0
- package/dist/web/assets/TrainingDraftPanel-C2C3hffI.js +1 -0
- package/dist/web/assets/UsageSettingsSection-Csg3diiE.css +1 -0
- package/dist/web/assets/UsageSettingsSection-DpPBd-ra.js +7 -0
- package/dist/web/assets/{MainPane-BfVDe9f7.css → WorkSidebarPanel-Bky_Rqcx.css} +1 -1
- package/dist/web/assets/WorkSidebarPanel-CeWGboTh.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-D_zKOW4K.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-BTz9FISP.js +32 -0
- package/dist/web/assets/WorkspaceGitDialogs-BnBRUYpS.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-CxD40rNT.js → WorkspaceMonacoEditor--GOVrHFp.js} +3 -3
- package/dist/web/assets/activity-DA5DNQwD.js +1 -0
- package/dist/web/assets/arrow-up-right-BRZWXpqJ.js +1 -0
- package/dist/web/assets/chat-file-links-CgFHK89C.js +1 -0
- package/dist/web/assets/chevron-up-DSv2auz_.js +1 -0
- package/dist/web/assets/clipboard-dPd_3lpG.js +1 -0
- package/dist/web/assets/cloud-upload-DOwvN4hp.js +1 -0
- package/dist/web/assets/{cssMode-CJPZShEy.js → cssMode-BM4j9M0D.js} +1 -1
- package/dist/web/assets/desktop-files-BQj1J-ob.js +1 -0
- package/dist/web/assets/figtree-latin-CEHu_veL.woff2 +0 -0
- package/dist/web/assets/folder-open-DavjPCw4.js +1 -0
- package/dist/web/assets/folder-plus-Dyqast6G.js +1 -0
- package/dist/web/assets/git-branch-zKnZdQiX.js +1 -0
- package/dist/web/assets/git-commit-horizontal-s3X0cQlz.js +1 -0
- package/dist/web/assets/{htmlMode-fp60PdLB.js → htmlMode-Nlx7ckXa.js} +1 -1
- package/dist/web/assets/index-5-B6FIuE.js +9 -0
- package/dist/web/assets/index-CQ3CPVHZ.css +1 -0
- package/dist/web/assets/index-CuoGlf-W.js +1 -0
- package/dist/web/assets/info-CVvrNOHr.js +1 -0
- package/dist/web/assets/{jsonMode-9tQDt87U.js → jsonMode-B7monA6g.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-DhOXsUmI.js → lspLanguageFeatures-CcJ9GDtK.js} +1 -1
- package/dist/web/assets/minimize-2-O1DnznGK.js +1 -0
- package/dist/web/assets/{monaco.contribution-BPct5K1-.js → monaco.contribution-2PozfA9g.js} +2 -2
- package/dist/web/assets/{monaco.contribution-D3sQBkAF.js → monaco.contribution-BMAF2bmO.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DRNDpuUQ.js → monaco.contribution-BSJ2jQTi.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BCc7daQX.js → monaco.contribution-QOOCizYq.js} +2 -2
- package/dist/web/assets/play-BpCc5ZbR.js +1 -0
- package/dist/web/assets/{python-CO5ats2F.js → python-BK41iew-.js} +1 -1
- package/dist/web/assets/refresh-cw-Csoy1ev1.js +1 -0
- package/dist/web/assets/save-Dbztj0W7.js +1 -0
- package/dist/web/assets/square-ju7fWa0W.js +1 -0
- package/dist/web/assets/{toggleHighContrast-7mdj7cLQ.js → toggleHighContrast-DrmwDpyz.js} +1 -1
- package/dist/web/assets/{training-BQVNUTZA.css → training-daZlCtKV.css} +1 -1
- package/dist/web/assets/{training-model-data-V8276E5q.js → training-model-data-CKOkpBBL.js} +1 -1
- package/dist/web/assets/{tsMode-qx-y8781.js → tsMode-CFgCMr7d.js} +1 -1
- package/dist/web/assets/upload-C5nhiSMq.js +1 -0
- package/dist/web/assets/useLocalAgentSchedules-LAsobERb.js +1 -0
- package/dist/web/assets/wifi-off-BHxh2UbA.js +1 -0
- package/dist/web/assets/{workers-DC-vdMwa.js → workers-FKb-NyBI.js} +1 -1
- package/dist/web/assets/{yaml-Bu611qJb.js → yaml-C5DbF9S6.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/api/vercel-protection.d.ts +0 -1
- package/dist/chunks/app-server-runtime-CJFOO54B.js +0 -19
- package/dist/chunks/chunk-WYDVQOBL.js +0 -17581
- package/dist/web/assets/AppsView-DIhprTIC.css +0 -1
- package/dist/web/assets/AppsView-DzVZTM0y.js +0 -1
- package/dist/web/assets/BrowserSidebar-BobBdHTm.js +0 -1
- package/dist/web/assets/CommandMenu-pp69WTbf.js +0 -1
- package/dist/web/assets/CommunityView-D1V7y3l5.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-Dv5RKQaG.js +0 -1
- package/dist/web/assets/GetStartedView-DXmHN_BA.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-BDN4AQVt.js +0 -1
- package/dist/web/assets/LabSkillSidebar-DYR_pq0Q.js +0 -1
- package/dist/web/assets/LabsRoute-CFXaPC-i.js +0 -3
- package/dist/web/assets/LabsRoute-DDTgtCul.css +0 -1
- package/dist/web/assets/MainChatThread-C1XrdeAC.js +0 -2
- package/dist/web/assets/MainPane-D8Mu6Nf3.js +0 -6
- package/dist/web/assets/MarkdownText-D5-tAHVZ.js +0 -9
- package/dist/web/assets/NativeSkillSidebar-cKgCM5s9.js +0 -1
- package/dist/web/assets/NewProjectDialog-B4wrkUrZ.js +0 -1
- package/dist/web/assets/OutputsPage-DoJz_FcJ.js +0 -1
- package/dist/web/assets/RightChatPanelStack-goxULcZy.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-DLtJnU9O.js +0 -1
- package/dist/web/assets/SettingsView-M-_wJvH1.js +0 -6
- package/dist/web/assets/TrainingCreationPanel-BK8T_q3X.js +0 -1
- package/dist/web/assets/TrainingDraftPanel-DSZ8e9ve.js +0 -1
- package/dist/web/assets/UsageSettingsSection-Co0UH4EJ.js +0 -59
- package/dist/web/assets/UsageSettingsSection-O8VK0qBL.css +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-OcpOQdEE.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-Cg_VY5XS.js +0 -32
- package/dist/web/assets/WorkspaceGitDialogs-ApPWIEpT.js +0 -1
- package/dist/web/assets/arrow-up-right-DtR75sMi.js +0 -1
- package/dist/web/assets/chevron-up-DH33C_vT.js +0 -1
- package/dist/web/assets/cloud-upload-Cp4pi0X7.js +0 -1
- package/dist/web/assets/folder-open-hEq-0bAV.js +0 -1
- package/dist/web/assets/folder-plus-ClgoqsjW.js +0 -1
- package/dist/web/assets/git-branch-CLBU2IM9.js +0 -1
- package/dist/web/assets/git-commit-horizontal-CpOgDvCh.js +0 -1
- package/dist/web/assets/index-2rbiOiLR.js +0 -179
- package/dist/web/assets/index-BWqDWo3b.js +0 -1
- package/dist/web/assets/index-CHqMtVfF.css +0 -1
- package/dist/web/assets/info-D3L7JgSo.js +0 -1
- package/dist/web/assets/play-DUBpqm-k.js +0 -1
- package/dist/web/assets/refresh-cw-D7OfmCic.js +0 -1
- package/dist/web/assets/save-CJN-WmnU.js +0 -1
- package/dist/web/assets/square-Bx9UTvNe.js +0 -1
- package/dist/web/assets/upload-Bp6EKIYv.js +0 -1
- package/dist/web/assets/useLocalAgentSchedules-CZ1tgG1x.js +0 -1
- package/dist/web/assets/wifi-off-DovWnIF6.js +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{c as P,r as f,j as l,C as ae,P as oe,b1 as N,b2 as S,p as Z,aL as ce,X as ue,b3 as L,b4 as M,b5 as de,aY as q}from"./index-2rbiOiLR.js";const he=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],mn=P("archive",he);const fe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kn=P("arrow-right",fe);const pe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],gn=P("bot",pe);const me=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],wn=P("clipboard",me);const ke=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],vn=P("code-xml",ke);const ge=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],yn=P("file",ge);const we=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],bn=P("minimize-2",we);const ve=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],xn=P("pause",ve);const ye=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],In=P("trash-2",ye);const be=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],jn=P("workflow",be);function Ln({value:e,options:r,disabled:n,compact:t,className:s,icon:i,placement:a="bottom",label:c,tooltip:o,searchable:d=!1,onChange:g}){const[p,v]=f.useState(!1),[m,k]=f.useState(""),h=f.useRef(null),y=r.find(u=>u.value===e)??r[0],w=m.trim().toLowerCase(),j=w?r.filter(u=>[u.label,u.shortLabel,u.description].some(b=>b?.toLowerCase().includes(w))):r;return f.useEffect(()=>{if(!p){k("");return}function u(x){h.current?.contains(x.target)||v(!1)}function b(x){x.key==="Escape"&&v(!1)}return document.addEventListener("pointerdown",u),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",b)}},[p]),l.jsxs("div",{className:`dropdown-select ${s??""} ${t?"compact":""} ${a==="top"?"open-up":""}`,"data-tooltip":o,ref:h,children:[l.jsxs("button",{type:"button",className:`dropdown-trigger ${p?"active":""}`,disabled:n,"aria-label":c,"aria-haspopup":"menu","aria-expanded":p,onClick:()=>v(u=>!u),children:[i,l.jsx("span",{children:y?.shortLabel??y?.label??e}),l.jsx(ae,{size:14})]}),p&&l.jsxs("div",{className:"dropdown-menu",role:"menu",children:[d?l.jsxs("label",{className:"dropdown-search",onClick:u=>u.stopPropagation(),children:[l.jsxs("span",{className:"sr-only",children:["Search ",c]}),l.jsx("input",{autoFocus:!0,placeholder:`Search ${c.toLowerCase()}`,value:m,onChange:u=>k(u.target.value)})]}):null,j.map(u=>l.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":u.value===e,disabled:u.disabled,className:[u.value===e?"selected":"",u.separatorBefore?"separator-before":"",u.icon?"with-icon":""].filter(Boolean).join(" "),onClick:()=>{u.disabled||(g(u.value),k(""),v(!1))},children:[l.jsxs("span",{children:[u.icon==="plus"?l.jsx(oe,{size:13}):null,l.jsx("span",{children:u.label})]}),u.description&&l.jsx("small",{children:u.description})]},u.value)),j.length?null:l.jsx("div",{className:"dropdown-empty",children:"No matches"})]})]})}function K(e,r,n){const t=G(e),[s,i]=f.useState(()=>t.getUrl(r,n));return f.useEffect(()=>{let a=!1;return i(t.getUrl(r,n)),t.loadUrl(r,n).then(c=>{a||i(c)}),()=>{a=!0}},[r,n,t]),s}function G(e){const[,r]=f.useState(0),n=f.useCallback((i,a)=>!e||!i||!a?null:(N.activateConnection(e),N.get(S(e,"workspace-image",i,a))),[e]),t=f.useCallback(async(i,a)=>{if(!e||!i||!a)return null;N.activateConnection(e);const c=S(e,"workspace-image",i,a);return N.load(c,()=>Z.signWorkspaceImageUrl(e,{appId:i,path:a})).finally(()=>r(o=>o+1))},[e]),s=f.useCallback((i,a)=>{t(i,a)},[t]);return f.useMemo(()=>({ensureUrl:s,getUrl:n,loadUrl:t}),[s,n,t])}function xe({open:e,src:r,title:n,onClose:t}){const[s,i]=f.useState(!1);if(f.useEffect(()=>{if(!e)return;const o=d=>{d.key==="Escape"&&t()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,e]),f.useEffect(()=>{i(!1)},[r]),!e||!r)return null;const a=(()=>{const o=n.split("/").pop()?.trim();if(o&&/\.[A-Za-z0-9]+$/.test(o))return o;try{const g=new URL(r,window.location.href).pathname.split("/").pop()?.trim();if(g&&/\.[A-Za-z0-9]+$/.test(g))return g}catch{}return"image.png"})(),c=()=>{const o=document.createElement("a");o.href=r,o.download=a,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove()};return l.jsx("div",{className:"image-lightbox-backdrop",role:"presentation",onMouseDown:o=>{o.target===o.currentTarget&&t()},children:l.jsxs("section",{"aria-label":n?`Image preview: ${n}`:"Image preview","aria-modal":"true",className:"image-lightbox-dialog",role:"dialog",children:[l.jsxs("header",{className:"image-lightbox-header",children:[l.jsx("span",{title:n,children:n}),l.jsxs("div",{className:"image-lightbox-actions",children:[l.jsx("button",{type:"button","aria-label":"Download image",title:"Download",onClick:c,children:l.jsx(ce,{size:16})}),l.jsx("button",{type:"button","aria-label":"Close image preview",title:"Close",onClick:t,children:l.jsx(ue,{size:16})})]})]}),l.jsx("div",{className:"image-lightbox-frame",children:s?l.jsx("div",{className:"image-lightbox-error",children:"Image preview unavailable"}):l.jsx("img",{alt:n||"Image preview",decoding:"async",draggable:!1,src:r,onError:()=>i(!0)})})]})})}const Ie=new Set(["bash","c","cc","cjs","cpp","css","csv","env","gif","go","graphql","h","hpp","html","ico","java","jpeg","jpg","js","json","jsx","lock","lockb","md","mdx","m4v","mjs","mov","mp4","png","py","rs","scss","sh","sql","svg","toml","ts","tsx","txt","webp","webm","yaml","yml","zsh"]),je=new Set(["AGENTS.md","Dockerfile","LICENSE","Makefile","README"]),z=String.raw`[A-Za-z0-9_.@+-]+`,Le=new RegExp(String.raw`^(?:(?:\.{1,2}|~)?[\\/]|[A-Za-z]:[\\/])?(?:${z}[\\/])+${z}(?::\d+(?::\d+)?)?`),Me=new RegExp(String.raw`^${z}(?::\d+(?::\d+)?)?`),Pe=/^(?:workspace|sandbox):file:[^\s<>()]+/;function Mn({projectTargetDetail:e,projectTargetValue:r,workspaceRepoPath:n,workspaceTargetValue:t}){const s=n?.trim();return s||(t!=="local"||!r.startsWith("local:")?null:e.trim()||null)}function Ne(e,r,n={}){if(!Re(e[r-1]))return null;const t=e.slice(r),s=Pe.exec(t),i=s?null:Le.exec(t),a=s||i?null:Me.exec(t),c=Y((s??i??a)?.[0]??"");if(!c)return null;const o=_(c,n);return o?{...o,end:r+c.length}:null}function _(e,r={}){const n=Y(e.trim().replace(/^['"`]+|['"`]+$/g,""));if(!n||/^https?:\/\//i.test(n))return null;const s=Ee(Ue(n)).replace(/:\d+(?::\d+)?$/,"");return $e(s)?{displayPath:n,path:Ce(s,r.workspaceRootPath)}:null}function Ue(e){const r=/^(workspace|sandbox):file:(.*)$/i.exec(e);if(!r)return e;const n=r[1]?.toLowerCase();let t=r[2]??"";return n==="sandbox"&&(t=t.replace(/^\/workspace\/app\//,"").replace(/^\/workspace\//,"")),t}function Ee(e){if(!/^file:\/\//i.test(e))return e;try{return decodeURIComponent(new URL(e).pathname)}catch{return e.replace(/^file:\/\//i,"")}}function Ce(e,r){let n=e.replace(/\\/g,"/").replace(/^\.\/+/,"");const t=r?.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(!t)return n;n.startsWith(`${t}/`)&&(n=n.slice(t.length+1));const s=t.split("/").filter(Boolean).at(-1);return s&&n.startsWith(`${s}/`)&&(n=n.slice(s.length+1)),n}function $e(e){const r=e.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??e;if(je.has(r)||r.startsWith(".")&&r.length>1)return!0;const n=r.includes(".")?r.split(".").at(-1)?.toLowerCase():null;return!!(n&&Ie.has(n))}function Re(e){return!e||/[\s([{<"'`]/.test(e)}function Y(e){return e.replace(/[.,;!?]+$/,"").replace(/[\])}]+$/,"")}function Q(e,r){const n=J(e),[t,s]=f.useState(()=>n.getUrl(r));return f.useEffect(()=>{let i=!1;return s(n.getUrl(r)),n.loadUrl(r).then(a=>{i||s(a)}),()=>{i=!0}},[r,n]),t}function J(e){const[,r]=f.useState(0),n=f.useCallback(s=>!e||!s?null:(N.activateConnection(e),N.get(S(e,"local-image",s))),[e]),t=f.useCallback(async s=>{if(!e||!s)return null;N.activateConnection(e);const i=S(e,"local-image",s);return N.load(i,()=>Z.signLocalImageUrl(e,{path:s})).finally(()=>r(a=>a+1))},[e]);return f.useMemo(()=>({getUrl:n,loadUrl:t}),[n,t])}function R(e){const r=e.replace(/\r\n/g,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`),n=[];let t=[],s=[],i=[],a=!1,c,o=null,d,g=0;function p(){t.length!==0&&(n.push({type:"paragraph",content:t.join(`
|
|
4
|
-
`).trim()}),t=[])}function v(){s.length!==0&&(n.push({type:"blockquote",content:s.join(`
|
|
5
|
-
`)}),s=[])}function m(){i.length!==0&&(n.push({type:"list",ordered:a,start:c,items:i}),i=[],a=!1,c=void 0)}for(let k=0;k<r.length;k+=1){const h=r[k];if(o){if(_e(h,g)){n.push({type:"code",content:o.join(`
|
|
6
|
-
`),language:d}),o=null,d=void 0,g=0;continue}o.push(h);continue}const y=h.match(/^\s*>\s?(.*)$/);if(y){p(),m(),s.push(y[1]??"");continue}v();const w=Oe(h);if(w){p(),m(),o=w.firstLine===void 0?[]:[w.firstLine],d=w.language,g=w.ticks;continue}const j=We(r,k);if(j){p(),m(),n.push({type:"table",headers:j.headers,rows:j.rows}),k=j.endIndex;continue}const u=h.match(/^\s*(#{1,4})(?:\s+|(?=\d+[.)]\s+))(.+)$/);if(u){p(),m();const x=u[1].length;n.push({type:"heading",level:x,content:u[2].trim()});continue}const b=h.match(ee);if(b){p();const x=!!b[2];i.length>0&&x!==a&&m(),a=x;const I=b[2]?Number(b[2]):null;i.length===0&&(c=I??void 0),i.push(Ae(b[3].trim(),I));continue}if(!h.trim()){if(p(),i.length>0&&Fe(r,k+1)===a)continue;m();continue}m(),t.push(h)}return o&&n.push({type:"code",content:o.join(`
|
|
7
|
-
`),language:d}),v(),p(),m(),n}const Se=/^\s*(?:#{1,4}\s*|>\s*|\d+[.)]\s*|[-*]\s*)$/;function Pn(e,r){if(r)return e;const n=e.lastIndexOf(`
|
|
8
|
-
`)+1;return Se.test(e.slice(n))?e.slice(0,n):e}function _e(e,r){const n=e.match(/^\s*(`{2,})\s*(?:[A-Za-z0-9_-]+)?\s*$/);return!!(n&&n[1].length>=r)}function Oe(e){const r=e.match(/^\s*(`{2,})\s*([A-Za-z0-9_-]+)?\s*$/);if(r)return{language:r[2],ticks:r[1].length};const n=e.match(/^\s*(`{2,})\s*([A-Za-z][A-Za-z0-9_-]*)(?:\s+(\S.*)|(\S.*))$/);return n?{language:n[2],firstLine:n[3]??n[4],ticks:n[1].length}:null}const ee=/^\s*(?:([-*])|(\d+)[.)])\s+(.+)$/;function Fe(e,r){let n=r;for(;n<e.length&&!e[n].trim();)n+=1;const t=(e[n]??"").match(ee);return t?!!t[2]:null}function Ae(e,r){const n=/^\[([ xX])]\s*(.*)$/.exec(e);return n?{content:n[2]??"",checked:n[1]?.toLowerCase()==="x",ordinal:r}:{content:e,checked:null,ordinal:r}}function We(e,r){const n=e[r]??"",t=e[r+1]??"";if(!n.includes("|")||!ze(t))return null;const s=H(n);if(s.length===0)return null;const i=[];let a=r+2;for(;a<e.length;){const c=e[a]??"";if(!c.trim()||!c.includes("|"))break;i.push(H(c)),a+=1}return{headers:s,rows:i,endIndex:a-1}}function ze(e){const r=H(e);return r.length>0&&r.every(n=>/^:?-{3,}:?$/.test(n.trim()))}function H(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(n=>n.trim())}const He=new Set([".avif",".gif",".ico",".jpeg",".jpg",".png",".svg",".webp"]);function ne({checked:e,inline:r=!1}){return l.jsx("input",{"aria-label":e?"Checked item":"Unchecked item",checked:e,className:`markdown-checkbox ${r?"inline":""}`,disabled:!0,readOnly:!0,type:"checkbox"})}function U(e,r){const n=[];let t=0,s=0;const i=a=>{a>s&&n.push(e.slice(s,a))};for(;t<e.length;){const a=e[t];if(a==="`"){const h=e.indexOf("`",t+1);if(h>t+1){const y=e.slice(t+1,h),w=r.onOpenFileInSidebar&&Be(y,e,t,h+1)?_(y,{workspaceRootPath:r.workspaceRootPath}):null;i(t),n.push(w?T(w.displayPath,w.path,w.displayPath,r,n.length):l.jsx("code",{children:y},n.length)),t=h+1,s=t;continue}}const c=a==="<"||e.startsWith("!<img",t)?Ke(e,t):null;if(c){const h=B(c.src,r);if(h){i(t),n.push(V(c.alt,h,r,n.length)),t=c.end,s=t;continue}}const o=a==="<"?Ye(e,t):null;if(o){i(t),n.push(C(o.label,o.href,r,n.length)),t=o.end,s=t;continue}const d=a==="<"?Qe(e,t):null;if(d){i(t),n.push(C(d.href,d.href,r,n.length)),t=d.end,s=t;continue}const g=a==="["?Ge(e,t):null;if(g){i(t),n.push(l.jsx(ne,{checked:g.checked,inline:!0},n.length)),t=g.end,s=t;continue}const p=e.startsWith("![",t)?Xe(e,t):null;if(p){const h=B(p.href,r);i(t),n.push(h?V(p.label,h,r,n.length):C(p.label||p.href,p.href,r,n.length)),t=p.end,s=t;continue}const v=a==="["?Ze(e,t):null;if(v){i(t),n.push(C(v.label,v.href,r,n.length)),t=v.end,s=t;continue}const m=Te(e,t);if(m){i(t),n.push(C(m.href,m.href,r,n.length)),t=m.end,s=t;continue}const k=r.onOpenFileInSidebar?Ne(e,t,{workspaceRootPath:r.workspaceRootPath}):null;if(k){i(t),n.push(T(k.displayPath,k.path,k.displayPath,r,n.length)),t=k.end,s=t;continue}if(e.startsWith("**",t)){const h=e.indexOf("**",t+2);if(h>t+2){i(t),n.push(l.jsx("strong",{children:e.slice(t+2,h)},n.length)),t=h+2,s=t;continue}}if(e.startsWith("__",t)){const h=e.indexOf("__",t+2);if(h>t+2){i(t),n.push(l.jsx("strong",{children:e.slice(t+2,h)},n.length)),t=h+2,s=t;continue}}t+=1}return i(e.length),n}function Te(e,r){const n=r>0?e[r-1]:"";if(n&&!/[\s([{<]/.test(n))return null;const t=e.slice(r),s=/^(?:https?:\/\/|www\.)[^\s<>()]+(?:\([^\s<>()]*\)[^\s<>()]*)*/i.exec(t);if(!s)return null;let i=s[0];for(;/[.,;:!?]$/.test(i);)i=i.slice(0,-1);return i?{href:/^www\./i.test(i)?`https://${i}`:i,end:r+i.length}:null}function Be(e,r,n,t){return De(e)?!0:!r.slice(0,n).trim()&&!r.slice(t).trim()}function De(e){return/^(?:workspace|sandbox):file:/i.test(e.trim())}function C(e,r,n,t){const s=se(r),i=B(s,n),a=/^https?:\/\//i.test(s),c=i?.kind==="url"?i.src:i?.src??s,o=n.onOpenFileInSidebar?_(s,{workspaceRootPath:n.workspaceRootPath}):null;return!i&&o?T(e,o.path,o.displayPath,n,t):l.jsx("a",{href:a||i?c:"#",className:i?"markdown-image-link":void 0,onBlur:()=>{i&&n.onPreviewImage(null)},onClick:d=>{if(i){d.preventDefault(),an(i,n),n.onPreviewImage(null);return}if(a&&n.onOpenBrowserLink){d.preventDefault(),n.onOpenBrowserLink(c);return}a||d.preventDefault()},onContextMenu:d=>{d.preventDefault(),n.onPreviewImage(null),n.onOpenLinkMenu(on(c,s,d.clientX,d.clientY))},onFocus:d=>{i&&X(i,n,d.currentTarget)},onMouseEnter:d=>{i&&X(i,n,d.currentTarget)},onMouseLeave:()=>{i&&n.onPreviewImage(null)},rel:a?"noreferrer":void 0,target:a?"_blank":void 0,title:s,children:e},t)}function V(e,r,n,t){return l.jsx(qe,{context:n,image:r,label:e},t)}function qe({context:e,image:r,label:n}){const t=K(e.connection,r.kind==="workspace"?r.appId:null,r.kind==="workspace"?r.path:null),s=Q(e.connection,r.kind==="local"?r.path:null),i=r.kind==="url"?r.src:r.kind==="local"?s:t,a=n.trim()||r.title;return l.jsx("button",{type:"button",className:`markdown-inline-image ${i?"ready":"loading"}`,onClick:()=>{if(r.kind==="url"){e.onOpenImage({src:r.src,title:a});return}if(i){e.onOpenImage({src:i,title:a});return}r.kind!=="local"&&e.onOpenWorkspaceImage({appId:r.appId,path:r.path,title:a})},title:a,children:i?l.jsx("img",{alt:a,decoding:"async",loading:"lazy",src:i}):l.jsx("span",{"aria-hidden":"true"})})}function T(e,r,n,t,s){const i=nn(r,n,t);return i?l.jsx(Ve,{context:t,displayPath:n,image:i,label:e,path:r},s):l.jsx(re,{context:t,displayPath:n,label:e,path:r},s)}function re({context:e,displayPath:r,label:n,path:t}){return l.jsx("a",{href:"#",className:"markdown-file-link",onClick:s=>{s.preventDefault(),e.onOpenFileInSidebar?.(t)},onContextMenu:s=>{s.preventDefault(),e.onPreviewImage(null),e.onOpenLinkMenu(cn(t,r,s.clientX,s.clientY))},title:r,children:n})}function Ve({context:e,displayPath:r,image:n,label:t,path:s}){const i=K(e.connection,n.kind==="workspace"?n.appId:null,n.kind==="workspace"?n.path:null),a=Q(e.connection,n.kind==="local"?n.path:null),c=n.kind==="url"?n.src:n.kind==="local"?a:i,o=n.title||r;return l.jsxs("span",{className:"markdown-file-image-reference",children:[l.jsx(re,{context:e,displayPath:r,label:t,path:s}),l.jsx("button",{type:"button",className:`markdown-file-image-preview ${c?"ready":"loading"}`,onClick:()=>{if(n.kind==="url"){e.onOpenImage({src:n.src,title:o});return}if(c){e.onOpenImage({src:c,title:o});return}n.kind!=="local"&&e.onOpenWorkspaceImage({appId:n.appId,path:n.path,title:o})},title:o,children:c?l.jsx("img",{alt:o,decoding:"async",loading:"lazy",src:c}):l.jsx("span",{"aria-hidden":"true"})})]})}function Xe(e,r){if(!e.startsWith("![",r))return null;const n=r+2,t=e.indexOf("]",n);if(t<n||e[t+1]!=="(")return null;const s=te(e,t+2);return s?{label:e.slice(n,t),href:s.href,end:s.end}:null}function Ze(e,r){const n=e.indexOf("]",r+1);if(n<=r+1||e[n+1]!=="(")return null;const t=te(e,n+2);return t?{label:e.slice(r+1,n),href:t.href,end:t.end}:null}function te(e,r){if(e[r]==="<"){const t=e.indexOf(">",r+1);return t<0||e[t+1]!==")"?null:{href:e.slice(r+1,t),end:t+2}}let n=0;for(let t=r;t<e.length;t+=1){const s=e[t];if(s==="\\"){t+=1;continue}if(s==="("){n+=1;continue}if(s===")"){if(n===0)return{href:e.slice(r,t),end:t+1};n-=1}}return null}function Ke(e,r){const n=e[r]==="!"?r+1:r;if(!/^<img\b/i.test(e.slice(n)))return null;const t=e.indexOf(">",n+4);if(t<0)return null;const s=e.slice(n,t+1),i=A(s,"src");return i?{src:i,alt:A(s,"alt")??A(s,"title")??"",end:t+1}:null}function Ge(e,r){const n=e.slice(r,r+3);return n==="[ ]"?{checked:!1,end:r+3}:n==="[x]"||n==="[X]"?{checked:!0,end:r+3}:null}function Ye(e,r){const n=e.slice(r),t=/^<a\s+[^>]*href\s*=\s*(["'])(.*?)\1[^>]*>(.*?)<\/a>/i.exec(n);return t?{href:t[2]??"",label:Je(t[3]??""),end:r+t[0].length}:null}function Qe(e,r){const n=e.indexOf(">",r+1);if(n<=r+1)return null;const t=e.slice(r+1,n).trim();return en(t)?{href:t,end:n+1}:null}function Je(e){return e.replace(/<[^>]+>/g,"").trim()||e}function A(e,r){const t=new RegExp(`\\s${r}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);return t?.[1]??t?.[2]??t?.[3]??null}function en(e){return/^(https?:\/\/|file:\/\/|(?:workspace|sandbox):file:|\/|\.{1,2}\/)/i.test(e)}function B(e,r){const n=se(e);if(!n)return null;if(/^https?:\/\//i.test(n))try{const a=new URL(n),c=ln(a,r);return c||(sn(a,r.connection)?{kind:"url",src:n,title:L(a.searchParams.get("path")??a.pathname)}:null)}catch{return null}const t=tn(n),s=D(t??n,r.workspaceRootPath);if(s)return{kind:"url",src:s,title:L(t??n)};if(!t||!M(t)||!r.connection)return null;if(O(t))return{kind:"local",path:t,src:r.localImageUrls.getUrl(t),title:L(t)};if(!r.activeWorkspaceAppId)return null;const i=F(t,r.workspaceRootPath);return!i||!M(i)?null:{kind:"workspace",appId:r.activeWorkspaceAppId,path:i,src:r.workspaceImageUrls.getUrl(r.activeWorkspaceAppId,i),title:L(i)}}function nn(e,r,n){const t=D(e,n.workspaceRootPath)??D(r,n.workspaceRootPath);if(t)return{kind:"url",src:t,title:L(r)};if(!M(e)||!n.connection)return null;if(O(e))return{kind:"local",path:e,src:n.localImageUrls.getUrl(e),title:L(e)};if(!n.activeWorkspaceAppId)return null;const s=F(e,n.workspaceRootPath);return!s||!M(s)?null:{kind:"workspace",appId:n.activeWorkspaceAppId,path:s,src:n.workspaceImageUrls.getUrl(n.activeWorkspaceAppId,s),title:L(s)}}function D(e,r){const n=F(e,r),t="apps/web/public/";if(!n?.startsWith(t))return null;const s=n.slice(t.length);return!s||!rn(s)?null:de(s.split("/").map(encodeURIComponent).join("/"))}function rn(e){const r=e.split("?")[0]?.split("#")[0]??e,n=r.lastIndexOf(".");return n<0?!1:He.has(r.slice(n).toLowerCase())}function se(e){return e.trim().replace(/^['"`]+|['"`]+$/g,"")}function tn(e){let r=e.trim();if(!r)return null;if(r.startsWith("file://"))try{return decodeURIComponent(new URL(r).pathname)}catch{return r.replace(/^file:\/\//,"")}if(O(r))return r;const n=r.indexOf("#");n>=0&&(r=r.slice(0,n));const t=r.indexOf("?");return t>=0&&(r=r.slice(0,t)),r}function O(e){return/^file:\/\//i.test(e)||/^\//.test(e)||/^[A-Za-z]:[\\/]/.test(e)}function F(e,r){let n=e.trim().replace(/^['"`]+|['"`]+$/g,"");if(!n)return null;if(n.startsWith("file://"))try{n=decodeURIComponent(new URL(n).pathname)}catch{n=n.replace(/^file:\/\//,"")}if(n=n.replace(/\\/g,"/"),O(n)){const s=r?.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(!s||!n.startsWith(`${s}/`))return null;n=n.slice(s.length+1)}n=n.replace(/^\.\/+/,"");const t=n.split("/").filter(Boolean);return t.length===0||t.some(s=>s==="."||s===".."||s===".git")?null:t.join("/")}function sn(e,r){if(r){const t=new URL(r.serverUrl);if(e.origin===t.origin){if(e.pathname==="/v1/local-image"||/\/v1\/workspaces\/[^/]+\/file-image$/.test(e.pathname))return!1;if(e.pathname==="/v1/assets/workspace-image"||e.pathname==="/v1/assets/chat-attachment-image")return!0}}if(M(e.pathname))return!0;const n=e.searchParams.get("path");return!!(n&&M(n))}function ln(e,r){if(!r.connection)return null;const n=new URL(r.connection.serverUrl);if(e.origin!==n.origin)return null;const t=e.pathname==="/v1/assets/workspace-image"?e.searchParams.get("path"):null;if(t&&M(t))return{kind:"url",src:e.toString(),title:L(t)};const s=e.pathname==="/v1/assets/chat-attachment-image"?e.searchParams.get("storageName"):null;if(s&&M(s))return{kind:"url",src:e.toString(),title:L(s)};const i=/^\/v1\/workspaces\/([^/]+)\/file-image$/.exec(e.pathname),a=i?e.searchParams.get("path"):null;if(!i||!a||!M(a))return null;const c=decodeURIComponent(i[1]),o=F(a,r.workspaceRootPath);return!o||!M(o)?null:{kind:"workspace",appId:c,path:o,src:r.workspaceImageUrls.getUrl(c,o),title:L(o)}}function an(e,r){if(e.kind==="url"){r.onOpenImage(e);return}if(e.kind==="local"){e.src&&r.onOpenImage({src:e.src,title:e.title});return}if(e.src){r.onOpenImage({src:e.src,title:e.title});return}r.onOpenWorkspaceImage({appId:e.appId,path:e.path,title:e.title})}function X(e,r,n){if(e.kind==="url"){r.onPreviewImage($(e,n));return}if(e.kind==="local"){if(e.src){r.onPreviewImage($({src:e.src,title:e.title},n));return}r.localImageUrls.loadUrl(e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage($({src:t,title:e.title},n))});return}if(e.src){r.onPreviewImage($({src:e.src,title:e.title},n));return}r.workspaceImageUrls.loadUrl(e.appId,e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage($({src:t,title:e.title},n))})}function $(e,r){const n=r.getBoundingClientRect(),t=236,s=172,i=12,a=Math.max(i,Math.min(n.left,window.innerWidth-t-i)),c=n.bottom+8,o=c+s<=window.innerHeight-i?c:Math.max(i,n.top-s-8);return{...e,x:a,y:o}}function on(e,r,n,t){return{kind:"browser",browserHref:e,displayHref:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-142-8))}}function cn(e,r,n,t){return{kind:"file",path:e,displayPath:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-72-8))}}async function un(e){const r=e.trim();if(!r)return!1;const n=window.openpond?.files;if(!n)return!1;try{return(await n.reveal({path:r})).ok}catch{return!1}}async function Nn(e,r){const n=e.trim(),t=window.openpond?.files;if(!n||!t?.saveAs)return{ok:!1,canceled:!1,path:null};try{const s=await t.saveAs({path:n,suggestedName:r});return{ok:s.ok,canceled:s.canceled,path:s.path??null}}catch{return{ok:!1,canceled:!1,path:null}}}function Un({activeWorkspaceAppId:e=null,connection:r=null,content:n,finalizedContent:t,mutableContent:s,onOpenBrowserLink:i,onOpenFileInSidebar:a,workspaceRootPath:c=null}){const o=t!==void 0||s!==void 0,d=f.useMemo(()=>o?[]:R(n),[n,o]),g=f.useMemo(()=>o&&t?R(t):[],[t,o]),p=f.useMemo(()=>o&&s?R(s):[],[s,o]),[v,m]=f.useState(null),[k,h]=f.useState(null),[y,w]=f.useState(null),j=J(r),u=G(r),b=f.useCallback(I=>{u.loadUrl(I.appId,I.path).then(E=>{E&&m({src:E,title:I.title})})},[u]),x=f.useMemo(()=>({activeWorkspaceAppId:e,connection:r,onOpenBrowserLink:i,onOpenFileInSidebar:a,onOpenLinkMenu:w,onOpenImage:m,onOpenWorkspaceImage:b,onPreviewImage:h,localImageUrls:j,workspaceImageUrls:u,workspaceRootPath:c}),[e,r,b,j,i,a,u,c]);return f.useEffect(()=>{if(!y)return;const I=()=>w(null),E=le=>{le.key==="Escape"&&I()};return window.addEventListener("click",I),window.addEventListener("keydown",E),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("click",I),window.removeEventListener("keydown",E),window.removeEventListener("scroll",I,!0)}},[y]),l.jsxs("div",{className:"markdown-message",children:[o?l.jsxs(l.Fragment,{children:[l.jsx(W,{blocks:g,context:x,keyPrefix:"finalized",workspaceRootPath:c}),l.jsx(W,{blocks:p,context:x,keyPrefix:"mutable",workspaceRootPath:c})]}):l.jsx(W,{blocks:d,context:x,keyPrefix:"block",workspaceRootPath:c}),k&&l.jsx(hn,{preview:k}),y&&l.jsx(fn,{menu:y,onClose:()=>w(null),onOpenBrowserLink:i,onOpenFileInSidebar:a}),l.jsx(xe,{open:!!v,src:v?.src??null,title:v?.title??"",onClose:()=>m(null)})]})}const W=f.memo(function({blocks:r,context:n,keyPrefix:t,workspaceRootPath:s}){return ie(r,n,s,t)});function ie(e,r,n,t="block"){return e.map((s,i)=>{const a=`${t}-${i}`;if(s.type==="blockquote")return l.jsx("blockquote",{className:"markdown-blockquote",children:ie(R(s.content),r,n,`${a}-quote`)},a);if(s.type==="code"){const c=dn(s.content,n);return c?l.jsx("div",{className:"markdown-file-reference-block",children:c.map((o,d)=>l.jsx("div",{className:"markdown-file-reference-line",children:U(o,r)},d))},a):l.jsx("pre",{className:"markdown-code-block",children:l.jsx("code",{children:s.content})},a)}if(s.type==="list"){const c=s.items.map((o,d)=>l.jsxs("li",{className:o.checked===null?void 0:"markdown-task-list-item",value:s.ordered?o.ordinal??void 0:void 0,children:[o.checked===null?null:l.jsx(ne,{checked:o.checked}),l.jsx("span",{children:U(o.content,r)})]},d));return s.ordered?l.jsx("ol",{className:"markdown-list",start:s.start,children:c},a):l.jsx("ul",{className:"markdown-list",children:c},a)}if(s.type==="heading"){const c=s.level===1?"h1":s.level===2?"h2":s.level===3?"h3":"h4";return l.jsx(c,{className:"markdown-heading",children:U(s.content,r)},a)}return s.type==="table"?l.jsx("div",{className:"markdown-table-wrap",children:l.jsxs("table",{className:"markdown-table",children:[l.jsx("thead",{children:l.jsx("tr",{children:s.headers.map((c,o)=>l.jsx("th",{children:U(c,r)},o))})}),l.jsx("tbody",{children:s.rows.map((c,o)=>l.jsx("tr",{children:s.headers.map((d,g)=>l.jsx("td",{children:U(c[g]??"",r)},g))},o))})]})},a):l.jsx("p",{className:"markdown-paragraph",children:U(s.content,r)},a)})}function dn(e,r){const n=e.split(`
|
|
9
|
-
`),t=[];for(const s of n){const i=s.trim();if(!i)continue;const c=i.replace(/^(?:[-*]|\d+[.)])\s+/,"").trim().replace(/^`+|`+$/g,"").trim();if(!c||!_(c,{workspaceRootPath:r}))return null;t.push(c)}return t.length>0?t:null}function hn({preview:e}){const[r,n]=f.useState(!1);return f.useEffect(()=>{n(!1)},[e.src]),l.jsxs("div",{className:`markdown-image-hover-preview ${r?"unavailable":""}`,style:{left:e.x,top:e.y},children:[r?l.jsx("span",{children:"Preview unavailable"}):l.jsx("img",{alt:"",src:e.src,onError:()=>n(!0)}),l.jsx("span",{children:e.title})]})}function fn({menu:e,onClose:r,onOpenBrowserLink:n,onOpenFileInSidebar:t}){return e.kind==="file"?l.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:s=>s.stopPropagation(),children:[l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{t?.(e.path),r()},children:"Open in sidebar"}),l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{un(e.path),r()},children:"Open externally"}),l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{q(e.displayPath),r()},children:"Copy path"})]}):l.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:s=>s.stopPropagation(),children:[l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in sidebar"}),l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref,{newTab:!0}):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in new tab"}),l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open externally"}),l.jsx("button",{type:"button",role:"menuitem",onClick:()=>{q(e.displayHref),r()},children:"Copy link"})]})}export{mn as A,gn as B,vn as C,Ln as D,yn as F,xe as I,bn as M,xn as P,In as T,jn as W,wn as a,Un as b,kn as c,Mn as d,Pn as e,Q as f,_ as n,un as r,Nn as s,K as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,i as o,a0 as c,X as n}from"./index-2rbiOiLR.js";import{M as d}from"./MarkdownText-D5-tAHVZ.js";function x({expanded:s,skill:a,onClose:i,onResizeStart:r,onToggleExpanded:l}){const t=a.path.split("/").at(-1)??a.path;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar ${s?"expanded":""}`,"aria-label":`Skill source: ${a.name}`,children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize native skill source",onPointerDown:r}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Native skill files",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(o,{size:14}),e.jsx("span",{children:t})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:l,children:s?e.jsx(d,{size:14}):e.jsx(c,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:i,children:e.jsx(n,{size:14})})]})]}),e.jsxs("div",{className:"native-skill-sidebar-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsx("h2",{children:a.name}),e.jsx("p",{children:a.description}),e.jsx("code",{children:a.path})]}),e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${a.name} Markdown source`,children:e.jsx("code",{children:a.body})})]})]})}export{x as NativeSkillSidebar};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,X as N,e as b}from"./index-2rbiOiLR.js";import{F as f}from"./folder-open-hEq-0bAV.js";import{F as P}from"./folder-plus-ClgoqsjW.js";function A({open:d,mode:a="local",name:s,path:r,directory:n,busy:t,onNameChange:c,onPathChange:j,onClose:p,onSubmit:g}){if(!d)return null;const l=a==="cloud",o=a==="existing-local",u=l?b:o?f:P,x=l?"New Cloud Project":o?"Use Existing Folder":"New Local Project",m=l?"Create a hosted project in OpenPond Cloud.":o?"Add an existing local project folder to Projects.":"Create a new local Git project and add it to Projects.",h=t||(o?!r.trim():!s.trim()),C=t?o?"Adding":"Creating":l?"Create Cloud Project":o?"Add project":"Create project";return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog new-project-dialog","aria-label":o?"Add existing project":"Create project",onSubmit:i=>{i.preventDefault(),g()},children:[e.jsx("button",{className:"git-dialog-close",disabled:t,type:"button",onClick:p,children:e.jsx(N,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(u,{size:18})}),e.jsx("h2",{children:x}),e.jsx("p",{children:m}),o?e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Folder path"}),e.jsx("input",{autoFocus:!0,disabled:t,placeholder:"/home/user/project",value:r,onChange:i=>j(i.target.value)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Project name"}),e.jsx("input",{autoFocus:!0,disabled:t,placeholder:"New project",value:s,onChange:i=>c(i.target.value)})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Location"}),e.jsx("strong",{className:"git-dialog-path",children:l?"OpenPond Cloud":n})]})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:h,type:"submit",children:C})]})})}export{A as NewProjectDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,p as W,j as e,aS as A,aL as D,X as B,i as R}from"./index-2rbiOiLR.js";import{s as M,r as z,C as K,F as X}from"./MarkdownText-D5-tAHVZ.js";import{F as q,I as H,P as Y,a as V,b as G}from"./MainPane-D8Mu6Nf3.js";import{F as J}from"./folder-open-hEq-0bAV.js";import"./cloud-upload-Cp4pi0X7.js";import"./arrow-up-right-DtR75sMi.js";import"./square-Bx9UTvNe.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 Nt({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),U=typeof F.contentsBase64=="string"?F.contentsBase64:"";if(!U)throw new Error("The output did not include file data.");const N=new File([dt(U)],n.title,{type:n.contentType}),O=x(n),E=O.type==="text"||O.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":"My files",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{Nt as OutputsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,c3 as xe,c4 as we,c5 as Re,c6 as je,a9 as ye,ad as Pe,ap as Ce,j as i,c7 as Ie,ae as Ae,af as Te,ai as Se,ag as Me,X as Ne,P as Ee,a2 as Fe}from"./index-2rbiOiLR.js";import{F as pe}from"./folder-open-hEq-0bAV.js";import{u as $e,T as De,M as Be}from"./Messages-CWoU5OZ2.js";import{c as Le,u as Oe,s as Ue,d as qe,e as ze,A as He,f as Ke}from"./MainPane-D8Mu6Nf3.js";import"./chevron-up-DH33C_vT.js";import"./MarkdownText-D5-tAHVZ.js";import"./arrow-up-right-DtR75sMi.js";import"./git-branch-CLBU2IM9.js";import"./play-DUBpqm-k.js";import"./refresh-cw-D7OfmCic.js";import"./cloud-upload-Cp4pi0X7.js";import"./square-Bx9UTvNe.js";function Ve({panel:t,runtimeEventStore:L,actionCatalog:R,createImproveActions:j,contextCompaction:y,initialScrollState:m,codexPermissionMode:O,codexReasoningEffort:U,openPondCommandAccessMode:P,connection:C,connectedAppMentions:q,mentionApps:z,codexPersonalSkills:H,profileSkills:K,profileTarget:I,projectTarget:V,providerSettings:W,accountBaseUrl:Q,billingOrganizationSlug:G,billingTeamId:X,showToast:_,workspaceTarget:J,onCodexPermissionModeChange:Y,onCodexReasoningEffortChange:Z,onOpenPondCommandAccessModeChange:A,onModelChange:ee,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:se,onOpenProfileSettings:oe,onOpenSession:ie,onProviderChange:ne,onProviderSetupOpen:re,onPromptChange:ae,onProfileTargetChange:ce,onScrollStateChange:de,onProjectTargetChange:le,onResolveApproval:ue,onShowBrowserPanel:T,onStop:fe,onSubmit:v,onWorkspaceTargetChange:he}){const k=r.useRef(null),[p]=r.useState(()=>new Le),b=r.useRef(m?.stickyToBottom??!0),S=r.useRef(!1),M=Oe(L,t.runtimeSource==="live"?t.sessionId:null),o=r.useMemo(()=>{if(t.runtimeSource==="history"||!t.sessionId)return t;const s=M.events,d=xe(s,[]);return{...t,messages:Pe(p.project(s),t.pendingUserMessage),createImproveRun:ye({events:s}),contextWindowStatus:Re({provider:t.provider,snapshot:je(d,t.sessionId),preferences:y}),goalRuntime:we(d,t.sessionId)}},[p,y,M,t]),l=o.running&&!o.pendingApproval&&Ue(o.messages),h=r.useMemo(()=>o.createImproveRun?{...j,run:o.createImproveRun}:null,[o.createImproveRun,j]),N=r.useMemo(()=>qe(o.messages,{showThinkingIndicator:l}),[o.messages,l]),E=$e(o.messages,o.sessionId??`draft:${o.id}`),g=o.messages.at(-1),x=[o.id,o.sessionId??"draft",N.length,g?.id??"",g?.content?.length??0,g?.timestamp??"",l?"thinking":""].join(":");r.useLayoutEffect(()=>{const s=k.current;!s||S.current||(S.current=!0,s.scrollTop=m?.stickyToBottom?s.scrollHeight:m?.scrollTop??0)},[m]),ze({contentKey:x,onContentChange:s=>{b.current&&(s.scrollTop=s.scrollHeight)},threadRef:k});const F=r.useCallback((s,d)=>{const u=o.sessionId??`side-chat:${o.id}`;Ce({conversationId:u,href:s,explicitFile:d?.explicitFile,newTab:d?.newTab}).then(D=>{D&&T()})},[o.id,o.sessionId,T]),$=r.useCallback(async(s,d)=>{const u=d.action==="answer"?d.text:"Dismiss this question";if(!await v([],null,null,{displayPrompt:u,promptOverride:u,turnMetadata:{userQuestionResolution:d}}))throw new Error("The question response could not be sent.")},[v]);return i.jsxs("section",{className:`right-chat-pane ${o.pendingApproval?"has-approval":""}`,id:`right-chat-panel-${o.id}`,role:"tabpanel","aria-labelledby":`right-chat-tab-${o.id}`,children:[i.jsx("div",{className:"chat-thread right-chat-thread",ref:k,onScroll:s=>{const d=s.currentTarget;b.current=d.scrollHeight-d.scrollTop-d.clientHeight<=72,de({scrollTop:d.scrollTop,stickyToBottom:b.current})},children:N.map(s=>s.type==="thinking"?i.jsx(De,{},s.id):i.jsx(Be,{activeWorkspaceAppId:o.activeWorkspaceAppId,accountBaseUrl:Q,billingOrganizationSlug:G,billingTeamId:X,connection:C,animateInitialContent:s.message.role==="assistant"&&E.has(s.message.id),message:s.message,onOpenBrowserLink:F,onOpenAttachmentInSidebar:te,onOpenFileInSidebar:se,onOpenProfileSettings:oe,onResolveUserQuestion:$,onOpenSession:ie,userAttachmentDisplay:t.provider==="codex"?"compact":"full",workspaceRootPath:o.workspaceRootPath,showFooter:s.showFooter},s.id))}),i.jsxs("div",{className:`composer-stack dock right-chat-composer ${o.pendingApproval?"has-approval":""}`,children:[i.jsx(He,{approval:o.pendingApproval,onResolve:ue}),i.jsx(Ke,{mode:"dock",prompt:t.prompt,mentionApps:z,connectedAppMentions:q,profileSkills:t.provider==="codex"?H:K,profileTarget:t.provider==="codex"?null:I,selectedMentionAppId:null,contextWindowStatus:o.contextWindowStatus,goalRuntime:o.goalRuntime,createImproveRuntime:h,busy:o.running,running:o.running,submissionScopeKey:o.sessionId??o.id,showProjectFooter:!1,connection:C,providerSettings:W,provider:t.provider,model:t.model,projectTarget:V,actionCatalog:R,workspaceTarget:J,codexPermissionMode:O,codexReasoningEffort:U,openPondCommandAccessMode:t.provider==="codex"?P:o.session?.openPondCommandAccessMode??P,onProviderChange:ne,onProviderSetupOpen:re,onProjectTargetChange:le,onWorkspaceTargetChange:he,onModelChange:ee,onCodexPermissionModeChange:Y,onCodexReasoningEffortChange:Z,onOpenPondCommandAccessModeChange:A,onPromptChange:ae,onProfileTargetChange:ce,onMentionAppSelect:void 0,showToast:_,onSubmit:v,onStop:fe})]})]})}function it({panels:t,runtimeEventStore:L,actionCatalog:R=[],createImproveActions:j,contextCompaction:y,busy:m,codexPermissionMode:O,codexReasoningEffort:U,openPondCommandAccessMode:P,connection:C,connectedAppMentions:q,mentionApps:z,codexPersonalSkills:H,profileSkills:K=[],profileLibrary:I={lastUsed:null,profiles:[]},extensionCatalog:V,projectTarget:W,providerSettings:Q,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,showToast:J,workspaceTarget:Y,onAddChat:Z,onActivatePanel:A,onClosePanel:ee,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:se,onOpenPondCommandAccessModeChange:oe,onModelChange:ie,onOpenAttachmentInSidebar:ne,onOpenFileInSidebar:re,onOpenProfileSettings:ae,onOpenSession:ce,onProviderChange:de,onProviderSetupOpen:le,onPromptChange:ue,onProfileTargetChange:T,onScrollStateChange:fe,onProjectTargetChange:v,onResolveApproval:he,onResizeStart:k,onSelectFiles:p,onShowBrowserPanel:b,onStop:S,onSubmit:M,onWorkspaceTargetChange:o}){const[l,h]=r.useState(!1),[N,E]=r.useState(()=>Ie(t)?.id??null),g=r.useRef(null),x=r.useRef(new Map),F=r.useRef(new Set(t.map(e=>e.id))),$=r.useRef(new Map(t.map(e=>[e.id,e.activationVersion]))),s=t.find(e=>e.id===N)??t.at(-1)??null,d=s?.session?.currentProfile??I.lastUsed,u=Ae(I,d),D=u?Te(u,V):K,ge=u?[...R.filter(e=>!Se(e)),...Me(u)]:R;r.useEffect(()=>{const e=F.current,c=$.current;let a=null,f=null;for(const n of t)e.has(n.id)||(a=n),e.has(n.id)&&n.activationVersion>(c.get(n.id)??0)&&(f=n);F.current=new Set(t.map(n=>n.id)),$.current=new Map(t.map(n=>[n.id,n.activationVersion])),E(n=>f?f.id:a?a.id:n&&t.some(B=>B.id===n)?n:t.at(-1)?.id??null)},[t]),r.useEffect(()=>{if(!l)return;function e(a){g.current?.contains(a.target)||h(!1)}function c(a){a.key==="Escape"&&h(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",c),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",c)}},[l]);const w=r.useCallback((e,c=!1)=>{E(e),A(e),c&&window.requestAnimationFrame(()=>x.current.get(e)?.focus())},[A]),me=r.useCallback((e=!1)=>{p(),e&&window.requestAnimationFrame(()=>{document.getElementById("right-sidebar-files-tab")?.focus()})},[p]),ve=r.useCallback((e,c)=>{const a=t.findIndex(be=>be.id===c);if(a<0)return;const f=a+1;let n=null;if(e.key==="ArrowRight"&&(n=(f+1)%(t.length+1)),e.key==="ArrowLeft"&&(n=(f-1+t.length+1)%(t.length+1)),e.key==="Home"&&(n=0),e.key==="End"&&(n=t.length),n===null)return;if(e.preventDefault(),n===0){me(!0);return}const B=t[n-1];B&&w(B.id,!0)},[t,me,w]),ke=r.useCallback(e=>{if(!["ArrowRight","ArrowLeft","Home","End"].includes(e.key)||(e.preventDefault(),e.key==="Home"))return;const c=e.key==="ArrowLeft"||e.key==="End"?t.at(-1):t[0];c&&w(c.id,!0)},[t,w]);return i.jsxs("aside",{className:"workspace-diff-panel right-chat-panel-stack","aria-label":"Side chats",children:[i.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize side chat panel",onPointerDown:k}),i.jsx("div",{className:"workspace-diff-topbar right-chat-topbar",children:i.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",children:[i.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:()=>me(!1),onKeyDown:ke,children:[i.jsx(pe,{size:14}),i.jsx("span",{children:"Files"})]}),t.map(e=>{const c=e.id===s?.id;return i.jsxs("div",{className:`workspace-diff-tab right-chat-tab ${c?"active":""}`,children:[i.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":c,tabIndex:c?0:-1,title:e.title,ref:a=>{a?x.current.set(e.id,a):x.current.delete(e.id)},onClick:()=>w(e.id),onKeyDown:a=>ve(a,e.id),children:[e.running?i.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,i.jsx("span",{children:e.title})]}),i.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:a=>{a.stopPropagation(),ee(e.id)},children:i.jsx(Ne,{size:12})})]},e.id)}),i.jsxs("div",{className:"workspace-diff-add-anchor",ref:g,children:[i.jsx("button",{type:"button",className:`workspace-diff-add-tab ${l?"active":""}`,title:"Add to right sidebar","aria-label":"Add to right sidebar","aria-haspopup":"menu","aria-expanded":l,onClick:()=>h(e=>!e),children:i.jsx(Ee,{size:15})}),l?i.jsxs("div",{className:"workspace-diff-add-menu right-chat-add-popover",role:"menu",children:[i.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),Z()},children:[i.jsx(Fe,{size:13}),i.jsx("span",{children:"New task"})]}),i.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),p()},children:[i.jsx(pe,{size:13}),i.jsx("span",{children:"Files"})]})]}):null]})]})}),i.jsx("div",{className:"right-chat-stack-body panes-1",children:s?i.jsx(Ve,{busy:m,createImproveActions:j,contextCompaction:y,codexPermissionMode:O,codexReasoningEffort:U,openPondCommandAccessMode:P,connection:C,connectedAppMentions:q,actionCatalog:ge,mentionApps:z,codexPersonalSkills:H,profileSkills:D,profileTarget:null,panel:s,runtimeEventStore:L,initialScrollState:{scrollTop:s.scrollTop,stickyToBottom:s.stickyToBottom},projectTarget:W,providerSettings:Q,accountBaseUrl:G,billingOrganizationSlug:X,billingTeamId:_,showToast:J,workspaceTarget:Y,onCodexPermissionModeChange:te,onCodexReasoningEffortChange:se,onOpenPondCommandAccessModeChange:e=>oe(e,s.session),onModelChange:e=>ie(s.id,e),onOpenAttachmentInSidebar:ne,onOpenFileInSidebar:re,onOpenProfileSettings:ae,onOpenSession:ce,onProviderChange:e=>de(s.id,e),onProviderSetupOpen:le,onPromptChange:e=>ue(s.id,e),onProfileTargetChange:e=>T(s.sessionId,e),onScrollStateChange:e=>fe(s.id,e),onProjectTargetChange:v,onResolveApproval:he,onShowBrowserPanel:b,onStop:()=>S(s.sessionId),onSubmit:(e,c,a,f)=>M(s.id,e,c,a,f),onWorkspaceTargetChange:o},s.id):null})]})}export{it as RightChatPanelStack};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,p as $,j as e,aS as oe,c0 as ue,a0 as he,X as me,ba as G,A as xe,ay as _,c1 as fe}from"./index-2rbiOiLR.js";import{u as je,R as X}from"./useLocalAgentSchedules-CZ1tgG1x.js";import{M as pe,c as ye,T as be,P as J}from"./MarkdownText-D5-tAHVZ.js";import{P as Q}from"./play-DUBpqm-k.js";import{R as ve}from"./refresh-cw-D7OfmCic.js";import{S as ge}from"./save-CJN-WmnU.js";const we=3e4;function Ne(s){const[t,n]=i.useState([]),[l,d]=i.useState([]),[j,u]=i.useState(null),[o,a]=i.useState(!1),[r,f]=i.useState(null),[R,v]=i.useState(()=>new Set);async function N(c,p){p&&a(!0);try{const b=await $.hostedSavedWork(c);n(b.definitions),d(b.runs),u(b.webBaseUrl??null),f(null)}catch(b){f(U(b))}finally{p&&a(!1)}}i.useEffect(()=>{if(!s){n([]),d([]),u(null),f(null),a(!1);return}let c=!1;const p=async k=>{if(!c){k&&a(!0);try{const w=await $.hostedSavedWork(s);if(c)return;n(w.definitions),d(w.runs),u(w.webBaseUrl??null),f(null)}catch(w){c||f(U(w))}finally{!c&&k&&a(!1)}}};p(!0);const b=window.setInterval(()=>{p(!1)},we);return()=>{c=!0,window.clearInterval(b)}},[s]);async function y(){s&&await N(s,!0)}async function D(c){s&&(await $.createHostedSavedWork(s,c),await N(s,!1))}async function A(c,p){await x(c,async b=>{await $.updateHostedSavedWork(b,c,p)})}async function S(c){await x(c,async p=>{await $.deleteHostedSavedWork(p,c)})}async function E(c){await x(c,async p=>{await $.runHostedSavedWork(p,c,crypto.randomUUID())})}async function x(c,p){if(!(!s||R.has(c))){g(c,!0);try{await p(s),await N(s,!1)}catch(b){throw f(U(b)),b}finally{g(c,!1)}}}function g(c,p){v(b=>{const k=new Set(b);return p?k.add(c):k.delete(c),k})}return{create:D,definitions:t,error:r,loading:o,pendingScheduleIds:R,refresh:y,remove:S,run:E,runs:l,update:A,webBaseUrl:j}}function U(s){return s instanceof Error?s.message:String(s)}const ee="openpond.scheduled-work.view.v1";function Se(s=se()){try{return s?.getItem(ee)==="list"?"list":"calendar"}catch{return"calendar"}}function ke(s,t=se()){try{t?.setItem(ee,s)}catch{}}function se(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function M(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 te(s){return F(s.replaceAll("_"," "))}function F(s){return s.replace(/^./,t=>t.toUpperCase())}function Re({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:te(s.status)}),e.jsx("small",{children:M(s.createdAt,null)})]}),e.jsx("span",{className:"scheduled-run-trigger",children:s.trigger==="manual"?"Manual":"Scheduled"})]}),t?e.jsx("pre",{children:t}):null]})}function De({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:te(t.status)}),e.jsx("small",{children:M(t.createdAt,null)})]}),e.jsxs("span",{className:"scheduled-run-trigger",children:[F(t.triggerKind)," ",e.jsx(G,{size:11})]}),t.deliveryError?e.jsx("p",{children:t.deliveryError}):null]})}function ne({children:s,detailExpanded:t,label:n,onClose:l,onDetailResizeStart:d,onToggleDetailExpanded:j}){return e.jsxs("aside",{"aria-label":n,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:d,role:"separator"}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Schedule details",children:e.jsxs("button",{"aria-selected":"true",className:"workspace-diff-tab active",role:"tab",type:"button",children:[e.jsx(ue,{size:14}),e.jsx("span",{children:"Schedule"})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{"aria-label":t?"Dock schedule details":"Expand schedule details",className:"diff-icon-button",onClick:j,title:t?"Dock schedule details":"Expand schedule details",type:"button",children:t?e.jsx(pe,{size:14}):e.jsx(he,{size:14})}),e.jsx("button",{"aria-label":"Close schedule details",className:"diff-icon-button",onClick:l,title:"Close schedule details",type:"button",children:e.jsx(me,{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 C({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:t})]})}function O({children:s}){return e.jsx("p",{className:"scheduled-empty",children:s})}function le({label:s}){return e.jsxs("div",{className:"scheduled-loading",role:"status",children:[e.jsx(oe,{className:"scheduled-spin",size:16}),e.jsx("span",{children:s})]})}const Ae=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ce({items:s,onSelect:t,selectedKey:n}){const[l,d]=i.useState(()=>q(new Date)),j=i.useMemo(()=>$e(l),[l]),u=i.useMemo(()=>Me(s),[s]),o=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(l),a=s.filter(r=>!ae(r.nextRunAt));return e.jsxs("div",{className:"scheduled-calendar",children:[e.jsxs("div",{className:"scheduled-calendar-toolbar",children:[e.jsx("strong",{children:o}),e.jsxs("div",{children:[e.jsx("button",{"aria-label":"Previous month",className:"scheduled-icon-button",onClick:()=>d(V(l,-1)),type:"button",children:e.jsx(xe,{size:15})}),e.jsx("button",{className:"scheduled-calendar-today",onClick:()=>d(q(new Date)),type:"button",children:"Today"}),e.jsx("button",{"aria-label":"Next month",className:"scheduled-icon-button",onClick:()=>d(V(l,1)),type:"button",children:e.jsx(ye,{size:15})})]})]}),e.jsxs("div",{className:"scheduled-calendar-grid",role:"grid","aria-label":o,children:[Ae.map(r=>e.jsx("div",{className:"scheduled-calendar-weekday",role:"columnheader",children:r},r)),j.map(r=>{const f=K(r),R=u.get(f)??[],v=r.getMonth()!==l.getMonth(),N=f===K(new Date);return e.jsxs("div",{className:`scheduled-calendar-day${v?" outside":""}${N?" today":""}`,role:"gridcell",children:[e.jsx("span",{className:"scheduled-calendar-day-number",children:r.getDate()}),e.jsx("div",{className:"scheduled-calendar-events",children:R.map(y=>e.jsxs("button",{"aria-current":n===y.key?"true":void 0,className:`scheduled-calendar-event${y.enabled?"":" paused"}`,onClick:()=>t(y.key),title:y.title,type:"button",children:[e.jsx("span",{children:Ee(y.nextRunAt)}),e.jsx("strong",{children:y.title})]},y.key))})]},f)})]}),a.length?e.jsxs("div",{className:"scheduled-calendar-unscheduled",children:[e.jsx("span",{children:"No upcoming run"}),e.jsx("div",{children:a.map(r=>e.jsx("button",{onClick:()=>t(r.key),type:"button",children:r.title},r.key))})]}):null]})}function $e(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 j=new Date(n);return j.setDate(n.getDate()+d),j})}function Me(s){const t=new Map;for(const n of s){const l=ae(n.nextRunAt);if(!l)continue;const d=K(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 ae(s){if(!s)return null;const t=new Date(s);return Number.isNaN(t.getTime())?null:t}function K(s){return`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`}function q(s){return new Date(s.getFullYear(),s.getMonth(),1)}function V(s,t){return new Date(s.getFullYear(),s.getMonth()+t,1)}function Ee(s){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(new Date(s))}function Te({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 ${M(n.nextRunAt,n.timezone)}`:" · No next run"]})]})]})}function Le({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 ${M(l.nextRunAt,l.timeZone)}`:" · No next run"]})]})]})}const ze=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ts({connection:s,detailOpen:t,detailExpanded:n,onDetailOpenChange:l,onDetailResizeStart:d,onToggleDetailExpanded:j}){const u=Ne(s),o=je(s),[a,r]=i.useState("all"),[f,R]=i.useState(Se),[v,N]=i.useState(!1),[y,D]=i.useState(null),A=i.useMemo(()=>Pe(u.definitions),[u.definitions]),S=i.useMemo(()=>Fe(A,a),[a,A]),E=i.useMemo(()=>Ze(o.schedules,a),[a,o.schedules]),x=A.find(h=>I(h.schedule.id)===y)??null,g=o.schedules.find(h=>W(h.id)===y)??null,c=x?u.runs.filter(h=>h.scheduleId===x.schedule.id):[],p=i.useMemo(()=>Ue(E,S),[E,S]),b=i.useMemo(()=>p.map(Oe),[p]);_(u.error,{prefix:"Scheduled Work"}),_(o.error,{prefix:"Local schedules"}),i.useEffect(()=>{y&&!x&&!g&&D(null)},[x,g,y]),i.useEffect(()=>{!t&&y&&D(null)},[t,y]),i.useEffect(()=>()=>l(!1),[l]);function k(h){D(h),l(!0)}function w(){D(null),l(!1)}function P(h){R(h),ke(h)}async function z(){N(!0);try{await Promise.all([u.refresh(),o.refresh()])}finally{N(!1)}}return e.jsxs("section",{"aria-label":"Scheduled work",className:`scheduled-work-view${x||g?" detail-open":""}${n?" 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":"Scheduled view",className:"scheduled-view-tabs",role:"tablist",children:[e.jsx("button",{"aria-selected":f==="calendar",className:f==="calendar"?"active":void 0,onClick:()=>P("calendar"),role:"tab",type:"button",children:"Calendar"}),e.jsx("button",{"aria-selected":f==="list",className:f==="list"?"active":void 0,onClick:()=>P("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||u.loading||o.loading,onClick:()=>{z()},title:"Refresh schedules",type:"button",children:e.jsx(ve,{className:v?"scheduled-spin":void 0,size:16})}),e.jsxs("label",{className:"scheduled-filter",children:[e.jsx(fe,{"aria-hidden":"true",size:16}),e.jsxs("select",{"aria-label":"Schedule filter",onChange:h=>r(h.target.value),value:a,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":u.loading||o.loading,className:"scheduled-list",children:s?(u.loading||o.loading)&&A.length===0&&o.schedules.length===0?e.jsx(le,{label:"Loading schedules"}):u.error&&o.error&&A.length===0&&o.schedules.length===0?e.jsx(O,{children:"Schedules are unavailable. Refresh to try again."}):p.length===0?e.jsx(O,{children:"Create a scheduled task here or ask for one in Work."}):f==="calendar"?e.jsx(Ce,{items:b,onSelect:k,selectedKey:y}):e.jsx("div",{className:"scheduled-list-rows",children:p.map(h=>h.kind==="local"?e.jsx(Te,{cadence:re(h.schedule),onSelect:()=>k(W(h.schedule.id)),schedule:h.schedule,selected:y===W(h.schedule.id)},W(h.schedule.id)):e.jsx(Le,{cadence:_e(h.row.schedule),definition:h.row.definition,onSelect:()=>k(I(h.row.schedule.id)),schedule:h.row.schedule,selected:y===I(h.row.schedule.id)},I(h.row.schedule.id)))}):e.jsx(O,{children:"Connect to OpenPond to view scheduled Work."})})]})}),x?e.jsx(Ie,{onClose:w,onDelete:async()=>{await u.remove(x.schedule.id),w()},onRun:()=>u.run(x.schedule.id),onSave:h=>u.update(x.schedule.id,h),onToggle:()=>u.update(x.schedule.id,{enabled:!x.schedule.enabled}),pending:u.pendingScheduleIds.has(x.schedule.id),row:x,runs:c,detailExpanded:n,onDetailResizeStart:d,onToggleDetailExpanded:j,webBaseUrl:u.webBaseUrl},`${x.schedule.id}:${x.definition.version}:${x.schedule.configurationVersion}`):g?e.jsx(We,{connection:s,onClose:w,onRun:()=>o.run(g),onToggle:()=>o.toggle(g),pending:o.pendingScheduleIds.has(g.id),schedule:g,detailExpanded:n,onDetailResizeStart:d,onToggleDetailExpanded:j},g.id):null]})}function We({connection:s,detailExpanded:t,onClose:n,onDetailResizeStart:l,onRun:d,onToggleDetailExpanded:j,onToggle:u,pending:o,schedule:a}){const r=qe(s,a.id);return _(r.error,{prefix:"Local schedule runs"}),e.jsxs(ne,{detailExpanded:t,label:`${a.scheduleName} details`,onClose:n,onDetailResizeStart:l,onToggleDetailExpanded:j,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:a.enabled?"Active":"Paused"})]}),e.jsx("p",{children:a.scheduleName})]})}),e.jsxs(T,{title:"Task",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(C,{label:"Environment",value:"Local"}),e.jsx(C,{label:"Project",value:a.localProjectName}),e.jsx(C,{label:"Agent",value:a.agentName}),e.jsx(C,{label:"Action",value:a.targetAction})]}),e.jsx("pre",{className:"scheduled-prompt",children:He(a)})]}),e.jsxs(T,{title:"Schedule",children:[e.jsxs("dl",{className:"scheduled-detail-fields",children:[e.jsx(C,{label:"Cadence",value:re(a)}),e.jsx(C,{label:"Expression",value:a.scheduleExpression}),e.jsx(C,{label:"Timezone",value:a.timezone??"Local time"}),e.jsx(C,{label:"Next run",value:M(a.nextRunAt,a.timezone)}),e.jsx(C,{label:"Last run",value:M(a.lastRunAt,a.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:o,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:o,onClick:()=>{u()},type:"button",children:[a.enabled?e.jsx(J,{size:15}):e.jsx(Q,{size:15}),e.jsx("span",{children:a.enabled?"Pause":"Resume"})]})]}),e.jsx(T,{title:"Runs",children:r.loading&&r.runs.length===0?e.jsx(le,{label:"Loading runs"}):r.runs.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:r.runs.map(f=>e.jsx(Re,{run:f},f.id))})})]})}function Ie({detailExpanded:s,onClose:t,onDelete:n,onDetailResizeStart:l,onRun:d,onSave:j,onToggleDetailExpanded:u,onToggle:o,pending:a,row:r,runs:f,webBaseUrl:R}){const v=Ke(r.schedule),[N,y]=i.useState(r.definition.name),[D,A]=i.useState(r.definition.prompt),[S,E]=i.useState(v.kind),[x,g]=i.useState(v.timeZone),[c,p]=i.useState(v.startDate),[b,k]=i.useState(v.localTime),[w,P]=i.useState(v.weekdays?.[0]??"monday"),[z,h]=i.useState(v.dayOfMonth??1),H=f[0]?.conversationId??null,Z=R?Y(R,H):null,de=N!==r.definition.name||D!==r.definition.prompt||S!==v.kind||x!==v.timeZone||c!==v.startDate||b!==v.localTime||w!==(v.weekdays?.[0]??"monday")||z!==(v.dayOfMonth??1);async function ce(m){m.preventDefault(),await j({name:N,prompt:D,recurrence:{version:1,kind:S,timeZone:x,startDate:c,localTime:b,end:{kind:"never"},...S==="weekly"?{weekdays:[w]}:{},...S==="monthly"?{dayOfMonth:z}:{}}})}return e.jsx(ne,{detailExpanded:s,label:`${r.definition.name} details`,onClose:t,onDetailResizeStart:l,onToggleDetailExpanded:u,children:e.jsxs("form",{onSubmit:ce,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:r.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:a,onClick:()=>{n()},title:"Delete schedule",type:"button",children:e.jsx(be,{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:m=>y(m.target.value),required:!0,value:N})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Prompt"}),e.jsx("textarea",{onChange:m=>A(m.target.value),required:!0,value:D})]})]}),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:m=>E(m.target.value),value:S,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"})]})]}),S==="weekly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day"}),e.jsx("select",{onChange:m=>P(m.target.value),value:w,children:ze.map(m=>e.jsx("option",{value:m,children:F(m)},m))})]}):S==="monthly"?e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Day of month"}),e.jsx("input",{max:31,min:1,onChange:m=>h(Number(m.target.value)),type:"number",value:z})]}):null,e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Start date"}),e.jsx("input",{onChange:m=>p(m.target.value),required:!0,type:"date",value:c})]}),e.jsxs("label",{className:"scheduled-field",children:[e.jsx("span",{children:"Time"}),e.jsx("input",{onChange:m=>k(m.target.value),required:!0,type:"time",value:b})]}),e.jsxs("label",{className:"scheduled-field scheduled-field-wide",children:[e.jsx("span",{children:"Timezone"}),e.jsx("input",{onChange:m=>g(m.target.value),required:!0,value:x})]})]}),e.jsxs("p",{className:"scheduled-next-run",children:["Next run: ",M(r.schedule.nextRunAt,v.timeZone)]})]}),e.jsxs("div",{className:"scheduled-detail-actions",children:[de?e.jsxs("button",{disabled:a,type:"submit",children:[e.jsx(ge,{size:15}),e.jsx("span",{children:"Save"})]}):null,e.jsxs("button",{disabled:a,onClick:()=>{d()},type:"button",children:[e.jsx(X,{size:15}),e.jsx("span",{children:"Run now"})]}),e.jsxs("button",{disabled:a,onClick:()=>{o()},type:"button",children:[r.schedule.enabled?e.jsx(J,{size:15}):e.jsx(Q,{size:15}),e.jsx("span",{children:r.schedule.enabled?"Pause":"Resume"})]})]}),e.jsxs("button",{className:"scheduled-open-chat",disabled:a||!Z,onClick:()=>{Z&&B(Z,H)},type:"button",children:[e.jsx("span",{children:"Open hosted chat"}),e.jsx(G,{size:14})]}),e.jsx(T,{title:"Runs",children:f.length===0?e.jsx("p",{className:"scheduled-no-runs",children:"No runs yet."}):e.jsx("div",{className:"scheduled-run-list",children:f.map(m=>e.jsx(De,{onOpen:()=>{R&&B(Y(R,m.conversationId),m.conversationId)},run:m},m.id))})})]})})}function Pe(s){return s.flatMap(t=>t.schedules.map(n=>({definition:t,schedule:n})))}function Fe(s,t){return s.filter(n=>t==="active"?n.schedule.enabled:t==="paused"?!n.schedule.enabled:!0).sort((n,l)=>L(n.schedule.nextRunAt)-L(l.schedule.nextRunAt)||n.definition.name.localeCompare(l.definition.name))}function Ze(s,t){return s.filter(n=>t==="active"?n.enabled:t==="paused"?!n.enabled:!0).sort((n,l)=>L(n.nextRunAt)-L(l.nextRunAt)||n.scheduleName.localeCompare(l.scheduleName))}function Ue(s,t){return[...s.map(n=>({kind:"local",schedule:n})),...t.map(n=>({kind:"hosted",row:n}))].sort((n,l)=>{const d=L(n.kind==="local"?n.schedule.nextRunAt:n.row.schedule.nextRunAt),j=L(l.kind==="local"?l.schedule.nextRunAt:l.row.schedule.nextRunAt);if(d!==j)return d-j;const u=n.kind==="local"?n.schedule.scheduleName:n.row.definition.name,o=l.kind==="local"?l.schedule.scheduleName:l.row.definition.name;return u.localeCompare(o)})}function Oe(s){return s.kind==="local"?{enabled:s.schedule.enabled,key:W(s.schedule.id),nextRunAt:s.schedule.nextRunAt,title:s.schedule.scheduleName}:{enabled:s.row.schedule.enabled,key:I(s.row.schedule.id),nextRunAt:s.row.schedule.nextRunAt,title:s.row.definition.name}}function _e(s){const t=s.recurrence;if(!t)return s.expression??"Manual";const n=ie(t.localTime);return t.kind==="once"?`Once on ${t.startDate} at ${n} · ${t.timeZone}`:t.kind==="weekdays"?`Weekdays at ${n} · ${t.timeZone}`:t.kind==="weekly"?`${t.weekdays?.map(F).join(", ")??"Weekly"} at ${n} · ${t.timeZone}`:t.kind==="monthly"?`Monthly on day ${t.dayOfMonth??1} at ${n} · ${t.timeZone}`:`Daily at ${n} · ${t.timeZone}`}function re(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=ie(`${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 Ke(s){return s.recurrence??{version:1,kind:"daily",timeZone:s.timeZone||Ye(),startDate:Ve(),localTime:"08:00",end:{kind:"never"}}}function He(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 qe(s,t){const[n,l]=i.useState([]),[d,j]=i.useState(!1),[u,o]=i.useState(null);return i.useEffect(()=>{if(!s){l([]),j(!1),o(null);return}let a=!1;return j(!0),$.localAgentScheduleRuns(s,t,{limit:20}).then(r=>{a||(l(r.runs),o(null))}).catch(r=>{a||o(Be(r))}).finally(()=>{a||j(!1)}),()=>{a=!0}},[s,t]),{error:u,loading:d,runs:n}}function W(s){return`local:${s}`}function I(s){return`hosted:${s}`}function Y(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 B(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 ie(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 L(s){if(!s)return Number.MAX_SAFE_INTEGER;const t=new Date(s).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}function Ve(){return new Date().toISOString().slice(0,10)}function Ye(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function Be(s){return s instanceof Error?s.message:String(s)}export{ts as ScheduledWorkPage,Ue as combineScheduleRows,Ze as filterAndSortLocalSchedules,Fe as filterAndSortSchedules,M as formatScheduledRunAt,Y as hostedConversationUrl,re as localScheduleCadence,_e as scheduleCadence,Pe as scheduledRows};
|