@inkeep/open-knowledge 0.48.0 → 0.49.0-beta.1
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/{acp-harness-probe-ctlLmc6O.mjs → acp-harness-probe-D-srkjjf.mjs} +2 -2
- package/dist/build-BcDJ6qQ2.mjs +1 -0
- package/dist/{build-DYQrG4v7.mjs → build-CJW5ggp6.mjs} +1 -1
- package/dist/cli.mjs +35 -35
- package/dist/constants-XFun_cA1.mjs +2 -0
- package/dist/git-handle-CtdWfsLv.mjs +1 -0
- package/dist/{git-handle-D6plgfL-.mjs → git-handle-DyGrpFVy.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-D7RfHtp_.mjs → init-Cy5aJiTB.mjs} +17 -17
- package/dist/init-D3XERiKn.mjs +1 -0
- package/dist/{launch-json-removal-DphNv7be.mjs → launch-json-removal-CW3uB0l0.mjs} +2 -2
- package/dist/{loader-BtbydYPt.mjs → loader-BUu0YikQ.mjs} +2 -2
- package/dist/loader-qtUfrHA1.mjs +1 -0
- package/dist/md-manager-C54e9m9K.mjs +2 -0
- package/dist/{open-browser-ifD987S6.mjs → open-browser-gBhxldMU.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-CAWFRCJt.mjs → preview-JtgY3qRY.mjs} +2 -2
- package/dist/preview-OSbvhHSx.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-C3ip7dNC.js → ActivityModeContent-DugGu3NA.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Wi29jCni.js → AgentDiffPane-asB2Nbqm.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-FT8wNbjk.js → AgentThreadClientBinder-DNvb1Kvi.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-C0FXh0Oi.js → ChangedOutsideBadge-DycTpAUu.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-Bou_Ebnm.js +3 -0
- package/dist/public/assets/{DocumentContext-CP7yqH5z.js → DocumentContext-CzZ4OdU4.js} +10 -10
- package/dist/public/assets/{EditorModeToggle-NV902SqC.js → EditorModeToggle-DrbJcY1C.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-B3txwN8d.js → EnableSyncConfirmDialog-C1eajSLe.js} +1 -1
- package/dist/public/assets/FeedbackForm-7G6WGcZE.js +1 -0
- package/dist/public/assets/{GraphPanel-z_BpNtFU.js → GraphPanel-CD7b7bEO.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-JqA7a0sU.js → ImportSkillDialog-BIyM8tU6.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-SRropTDk.js → LintConfigEditor-BOxPN8wG.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CZGC-82V.js +2 -0
- package/dist/public/assets/ManagedArtifactProperties-D2sfHJwe.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-BiF_k0VW.js → McpConsentDialogBody-BCWXnE1x.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DkkZ1470.js → MermaidDocEditor-CxNHwiB7.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CtlgCQX3.js → ReportBugDialogBody-UQSprqDe.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DOmoubBM.js → SchemaConfigEditor-CMFsCzPt.js} +1 -1
- package/dist/public/assets/{SessionsHost-CFGRv_pY.js → SessionsHost-5ibUPOXw.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-D_1DunuR.js → SettingsDialogBody-CzGlOteP.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-DYf_N6bq.js → ShareBranchSwitchDialog-B8RBBcyE.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-ayJ6qYFK.js → ShareReceiveDialog-CWWtfyfF.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-OcYPcuBz.js → ShareReceiveMissDialog-Dm7bnxRL.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DBJEqMg4.js → SkillEditBanner-9ueqFia8.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-FJ-Hk1Uz.js → SkillOriginInline-BXnRlN9C.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DvoPtfHF.js → SkillToolbarControls-CKVlfuBj.js} +1 -1
- package/dist/public/assets/SourceEditor-CLl_3ALr.js +1 -0
- package/dist/public/assets/{TerminalPanel-DN4Eag17.js → TerminalPanel-BqsEcNCi.js} +3 -3
- package/dist/public/assets/{TerminalWindowApp-CPjZ5xvY.js → TerminalWindowApp-Dci42DLF.js} +1 -1
- package/dist/public/assets/{TextDocEditor-gUC9Hdas.js → TextDocEditor-C7j8Ms92.js} +1 -1
- package/dist/public/assets/{ThreadView-CPLWVyZk.js → ThreadView-vHwbnBSm.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CH9Paxeb.js → TimelineDiffPane-B0IXHUIO.js} +1 -1
- package/dist/public/assets/{agent-diff-store-c2pI-IqS.js → agent-diff-store-CxW7fKUi.js} +1 -1
- package/dist/public/assets/{agent-visibility-p6xMSDdk.js → agent-visibility-BxHoyzki.js} +1 -1
- package/dist/public/assets/auth-state-cache-DSNx4fxm.js +11 -0
- package/dist/public/assets/client-version-CAHqhVGQ.js +1 -0
- package/dist/public/assets/{comment-chips-GFaq2hJN.js → comment-chips-BPl64kni.js} +1 -1
- package/dist/public/assets/{config-context-JFJadbOg.js → config-context-3DA5oQRi.js} +1 -1
- package/dist/public/assets/{config-provider-GgI7K6tF.js → config-provider-BTrHDE5x.js} +2 -2
- package/dist/public/assets/{dist-D0lKV18u2.js → dist-P5PuqHtu2.js} +113 -113
- package/dist/public/assets/{doc-paths-BuYvs-Sl.js → doc-paths-BUecntHC.js} +1 -1
- package/dist/public/assets/{documents-events-CZXYlWJs.js → documents-events-KbhMdUCf.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-VPm5Cnie.js → file-tree-adapter-CqEuXZ5y.js} +1 -1
- package/dist/public/assets/file-tree-utils-BsQPHRxA.js +1 -0
- package/dist/public/assets/{folder-config-api-CkzVN79U.js → folder-config-api-CM5ZFHjG.js} +1 -1
- package/dist/public/assets/{follow-file-Dlt39wWC.js → follow-file-DPssEILs.js} +1 -1
- package/dist/public/assets/{globals-i3eL0jPG.js → globals-CiUwipyS.js} +1 -1
- package/dist/public/assets/{index-CUE-YCY2.js → index-BqVIdejq.js} +14 -14
- package/dist/public/assets/{lint-config-client-CKLyoxWn.js → lint-config-client-Ctx6XxuK.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BJyF5XvC.js → markdownlint-rule-browser-D9sFjZMg.js} +1 -1
- package/dist/public/assets/navigation-targets-BTpBtlo2.js +1 -0
- package/dist/public/assets/{open-managed-artifact-tab-CRB-rvl-.js → open-managed-artifact-tab-DJGfoyLt.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-yAE2j52e.js → pending-receive-nav-store-BTsDlNNa.js} +1 -1
- package/dist/public/assets/{prop-types-C-VFVfev.js → prop-types-CC3zyaqH.js} +1 -1
- package/dist/public/assets/{receive-store-C3RyDFMU.js → receive-store-Dc_eiYW6.js} +1 -1
- package/dist/public/assets/{selection-context-BN5sWQOX.js → selection-context-BSXn0gOl.js} +1 -1
- package/dist/public/assets/{skill-actions-gJbOdqsR.js → skill-actions-BTird1AW.js} +2 -2
- package/dist/public/assets/{skill-scope-DwDLnOOD.js → skill-scope-DEvpbPXx.js} +1 -1
- package/dist/public/assets/{skills-api-BBaU5yMj.js → skills-api-BpuwZVN9.js} +1 -1
- package/dist/public/assets/{src-BFaead-K.js → src-DC-8XMb-.js} +1 -1
- package/dist/public/assets/{tag-pill-input-T8jCzKA4.js → tag-pill-input-D_VrZ0_G.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-ur7EfH9N.js → target-navigation-intent-BhYFP54I.js} +1 -1
- package/dist/public/assets/{telemetry-impl-DcyIvKPm.js → telemetry-impl-DcjXfmjq.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DZzEawLj.js → telemetry-startup-0kgnX8ZI.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CIEJD8Ca.js → terminal-launch-events-BBTNOGCs.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-D3CzWhx2.js → terminal-telemetry-L6O0yS3Y.js} +1 -1
- package/dist/public/assets/typing-burst-detector-BR1q4MiH.js +8 -0
- package/dist/public/assets/{uninstall-Baseq7_l.js → uninstall-CiLtWDdT.js} +1 -1
- package/dist/public/assets/{use-activity-panel-jx8Sg0rQ.js → use-activity-panel-vGGrH8Ik.js} +1 -1
- package/dist/public/assets/{use-collab-url-oYOwLAYB.js → use-collab-url-ktBqBALq.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-DEdN-vX3.js → use-live-xterm-theme-Bz9dSt4p.js} +1 -1
- package/dist/public/assets/{use-open-skill-BH3vfRE3.js → use-open-skill-Cy2nIWNm.js} +1 -1
- package/dist/public/assets/{use-settings-route-B1Atzr9C.js → use-settings-route-B10M97I7.js} +1 -1
- package/dist/public/assets/{use-skill-directory-DTKROB4o.js → use-skill-directory-BZm1mPzb.js} +1 -1
- package/dist/public/assets/{use-skill-origin-LsbeWa_R.js → use-skill-origin-BmEyp0Uh.js} +1 -1
- package/dist/public/assets/{use-skills-CtCsB6PZ.js → use-skills-0q5Zcw-J.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BArDTeSK.js → use-terminal-enabled-C7jiJZI5.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CdswgYxP.js → use-timeline-entry-diff-Bdliw93H.js} +2 -2
- package/dist/public/assets/{use-workspace-3mjuTrTC.js → use-workspace-BVw2SUvV.js} +1 -1
- package/dist/public/index.html +44 -44
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-Bk6eqKiY.mjs → repair-launch-json-BlmQ4LvZ.mjs} +2 -2
- package/dist/{repair-mcp-configs-fC8b4vo_.mjs → repair-mcp-configs-CRNWg0xP.mjs} +2 -2
- package/dist/repair-skills-D0WSZUFt.mjs +1 -0
- package/dist/{repair-skills-Cm70zKLA.mjs → repair-skills-Qa8asXi-.mjs} +2 -2
- package/dist/server-lock-BoNixvAi.mjs +1 -0
- package/dist/{server-lock-DQJq-D9V.mjs → server-lock-DsDrc4RU.mjs} +2 -2
- package/dist/{skill-teardown-BQ0YQ9rO.mjs → skill-teardown-lrVGmvNz.mjs} +2 -2
- package/dist/src-B-TXZyjI.mjs +1 -0
- package/dist/{src-DRhXUMyd.mjs → src-PPz3BSLC.mjs} +6 -6
- package/dist/src-YfpQ2LX0.mjs +2030 -0
- package/dist/{src-y-VpYk60.mjs → src-azBs1EPY.mjs} +89 -89
- package/dist/{start-DKwEh9gC.mjs → start-DwZQwCGs.mjs} +3 -3
- package/dist/start-pnh29Vpw.mjs +1 -0
- package/dist/{write-project-skill-DQTCLDNM.mjs → write-project-skill-g7odZSI2.mjs} +4 -4
- package/dist/{yazl-BafwB467.mjs → yazl-DZr4PyKA.mjs} +1 -1
- package/dist/yazl-jVENrf5i.mjs +1 -0
- package/package.json +5 -5
- package/dist/build-DcqN8tua.mjs +0 -1
- package/dist/constants-Bc6SmMHz.mjs +0 -2
- package/dist/git-handle-qS6DQPrF.mjs +0 -1
- package/dist/init-BNMJDizk.mjs +0 -1
- package/dist/loader-C5LD3Ds_.mjs +0 -1
- package/dist/md-manager-CpKO8i9i.mjs +0 -2
- package/dist/preview-CyyocNeQ.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-BQoCzCdy.js +0 -3
- package/dist/public/assets/FeedbackForm-DVcz7TWB.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-B0bIS4IP.js +0 -2
- package/dist/public/assets/ManagedArtifactProperties-d28y4KXb.js +0 -1
- package/dist/public/assets/SourceEditor-CeQc0tTS.js +0 -1
- package/dist/public/assets/auth-state-cache-khzbb5gf.js +0 -11
- package/dist/public/assets/client-version-1hLDBtWZ.js +0 -1
- package/dist/public/assets/file-tree-utils-DEJGOhLm.js +0 -1
- package/dist/public/assets/navigation-targets-kcw1-114.js +0 -1
- package/dist/public/assets/typing-burst-detector-CG82yzgN.js +0 -8
- package/dist/repair-skills-DT7FGT3w.mjs +0 -1
- package/dist/server-lock-CQ1oOrnO.mjs +0 -1
- package/dist/src-BTCvmkZK.mjs +0 -2030
- package/dist/src-BuZeH4bR.mjs +0 -1
- package/dist/start-DCnM5DfI.mjs +0 -1
- package/dist/yazl-vwTkB7U0.mjs +0 -1
package/dist/parse-worker.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./md-manager-
|
|
1
|
+
import{t as e}from"./md-manager-C54e9m9K.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
|
|
2
2
|
//# sourceMappingURL=parse-worker.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jr as e}from"./src-YfpQ2LX0.mjs";import"./constants-XFun_cA1.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-JtgY3qRY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-JtgY3qRY.mjs";export{t as formatPreviewBlock,e as previewContent};
|
package/dist/public/assets/{ActivityModeContent-C3ip7dNC.js → ActivityModeContent-DugGu3NA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-CP7yqH5z.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-DwFomKjP.js";import{c as v}from"./Mermaid-DT9lZOmy.js";import{r as y}from"./CopyButton-DfXJBl0I.js";import{i as b}from"./prop-types-C-VFVfev.js";import{t as x}from"./loader-circle-B0OUuKph.js";import{t as S}from"./undo-2-bYFSgQwb.js";import{n as C}from"./dist-DmEZHXvB.js";import{t as w}from"./dist-CpRBr-Ct.js";import{c as T}from"./navigation-targets-kcw1-114.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-c2pI-IqS.js";import{t as j}from"./timeline-diff-store-sC1fl4YV.js";import{n as M}from"./use-activity-panel-jx8Sg0rQ.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===C?de=t[60]:(de=C({id:`a4FRQv`}),t[59]=C,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return w._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return w._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let w=S,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),C.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);C.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-CzZ4OdU4.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-DwFomKjP.js";import{c as v}from"./Mermaid-DT9lZOmy.js";import{r as y}from"./CopyButton-DfXJBl0I.js";import{i as b}from"./prop-types-CC3zyaqH.js";import{t as x}from"./loader-circle-B0OUuKph.js";import{t as S}from"./undo-2-bYFSgQwb.js";import{n as C}from"./dist-DmEZHXvB.js";import{t as w}from"./dist-CpRBr-Ct.js";import{c as T}from"./navigation-targets-BTpBtlo2.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-CxW7fKUi.js";import{t as j}from"./timeline-diff-store-sC1fl4YV.js";import{n as M}from"./use-activity-panel-vGGrH8Ik.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===C?de=t[60]:(de=C({id:`a4FRQv`}),t[59]=C,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return w._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return w._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let w=S,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),C.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);C.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-DZrMHlZH.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-RQ5o7P7w.js";import{i as te,n as ne,t as re}from"./tooltip-x7BNUa3s.js";import{n as s,t as c}from"./toggle-group-DAYvcc1F.js";import{t as l}from"./loader-circle-B0OUuKph.js";import{n as u,t as d}from"./panel-right-open-Cc56I_GE.js";import{t as ie}from"./x-B3zGPHCO.js";import{t as ae}from"./overlay-layers-CBGNHxJK.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-RQ5o7P7w.js";import{i as te,n as ne,t as re}from"./tooltip-x7BNUa3s.js";import{n as s,t as c}from"./toggle-group-DAYvcc1F.js";import{t as l}from"./loader-circle-B0OUuKph.js";import{n as u,t as d}from"./panel-right-open-Cc56I_GE.js";import{t as ie}from"./x-B3zGPHCO.js";import{t as ae}from"./overlay-layers-CBGNHxJK.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-CxW7fKUi.js";import{t as f}from"./lru-string-cache-jJ5hyYK1.js";import{t as le}from"./use-activity-panel-vGGrH8Ik.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-Bdliw93H.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-DZrMHlZH.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||ae())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ie,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(s,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(s,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(d,{className:`size-4`}):(0,m.jsx)(u,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-ktBqBALq.js";import{i,r as a}from"./thread-client-BVh92ozO.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
|
package/dist/public/assets/{ChangedOutsideBadge-C0FXh0Oi.js → ChangedOutsideBadge-DycTpAUu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Qn as n}from"./DocumentContext-CP7yqH5z.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{n as c}from"./use-workspace-3mjuTrTC.js";import{t as l}from"./button-RQ5o7P7w.js";import{i as u,n as d,t as f}from"./tooltip-x7BNUa3s.js";import{a as p,c as ee,i as te,n as ne,o as re,r as m,s as h}from"./dialog-DwFomKjP.js";import{m as g,o as _}from"./agent-visibility-p6xMSDdk.js";import{ha as v}from"./dist-D0lKV18u2.js";import{t as y}from"./createLucideIcon-BbgVV4EV.js";import{t as b}from"./folder-DxrU2PLH.js";import{t as x}from"./loader-circle-B0OUuKph.js";var S=t(),C=e(r(),1),w=o(),T=3100,E=3;function D(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??E;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var O={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},k=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function A(e,t={}){let n=t.rng??Math.random,r=t.colors??k,i=O[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var j=1.8,M=90,N=16,ie=380,P=.025,F=.1,I=.18,L=400,R=9.2736,ae=18.1799,z=14.5244,oe={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function se(e,t){let{halfWidth:n,apexLift:r}=oe[t];return`M${e-n} ${z+.3} Q${e} ${z-r}, ${e+n} ${z+.3}`}function ce(e){let t=1.5,n=.3;return`M${e-t} ${z-n} Q${e} ${z+1.4}, ${e+t} ${z-n}`}var le=15,ue=15;function de(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function fe(e){let t=(0,w.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,l=n===void 0?48:n,u=i===void 0?!0:i,d=a===void 0?`default`:a,f=o===void 0?0:o,p=(0,C.useRef)(null),ee=(0,C.useRef)(null),te=(0,C.useRef)(null),ne;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ne={x:0,y:0},t[0]=ne):ne=t[0];let re=(0,C.useRef)(ne),[m,h]=(0,C.useState)(0),[g,_]=(0,C.useState)(0),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[1]=v):v=t[1];let[y,b]=(0,C.useState)(v),x=(0,C.useRef)(0),E=(0,C.useRef)(void 0),O=d===`sleeping`,k;t[2]!==m||t[3]!==O?(k=function(){if(O)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=x.current===0?1/0:e-x.current;x.current=e;let n=D(m,t);h(n),_(ge),b(A(n)),clearTimeout(E.current),E.current=setTimeout(()=>{h(0),b([])},T)},t[2]=m,t[3]=O,t[4]=k):k=t[4];let oe=k,le,ue;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>()=>clearTimeout(E.current),ue=[],t[5]=le,t[6]=ue):(le=t[5],ue=t[6]),(0,C.useEffect)(le,ue);let de,fe;t[7]!==f||t[8]!==O?(de=()=>{f===0||O||(h(3),_(he),b(A(3)),clearTimeout(E.current),E.current=setTimeout(()=>{h(0),b([])},T))},fe=[f,O],t[7]=f,t[8]=O,t[9]=de,t[10]=fe):(de=t[9],fe=t[10]),(0,C.useEffect)(de,fe);let _e,ve;t[11]!==O||t[12]!==u?(_e=()=>{if(!u||O||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(d))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function d(){s=0;let l=ee.current,u=p.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),ne=f.left+f.width/2,m=f.top+f.height*.48,h=e-ne,g=t-m,_=Math.hypot(h,g),v=Math.max(-1,Math.min(1,h/ie)),y=-Math.max(-1,Math.min(1,g/ie))*N,b=v*N,x=0,S=0;if(_>=1){let e=Math.min(_/M,1)*j;x=h/_*e,S=g/_*e}let C=Math.abs(y-r)<.01&&Math.abs(b-i)<.01&&Math.abs(x-a)<.01&&Math.abs(S-o)<.01;if(!d&&C)return;c(),r+=(y-r)*F,i+=(b-i)*F,u.style.transform=`perspective(${L}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(x-a)*I,o+=(S-o)*I;let w=i*P,T=-r*P,E=a+w,D=o+T;re.current.x=E,re.current.y=D,te.current?.setAttribute(`transform`,`translate(${E.toFixed(3)} ${D.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,p.current&&(p.current.style.transform=``),re.current={x:0,y:0},te.current?.removeAttribute(`transform`)}},ve=[u,O],t[11]=O,t[12]=u,t[13]=_e,t[14]=ve):(_e=t[13],ve=t[14]),(0,C.useEffect)(_e,ve);let B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=te.current;if(!e)return;let{x:t,y:n}=re.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=B):B=t[15],(0,C.useLayoutEffect)(B);let V=m>0,H=V?m:1,ye=V?`ok-blob-clicked-${m}`:null,U;t[16]===r?U=t[17]:(U=s(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=U);let be=O?`cursor-default`:`cursor-pointer`,xe=`body-${g}`,Se=O&&`ok-blob-sleeping`,W;t[18]!==ye||t[19]!==Se?(W=s(`ok-blob-group`,Se,ye),t[18]=ye,t[19]=Se,t[20]=W):W=t[20];let Ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,S.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[21]=Ce):Ce=t[21];let we=(V||O)&&`ok-blob-eye-hidden`,G;t[22]===we?G=t[23]:(G=s(`ok-blob-eye`,we),t[22]=we,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,S.jsx)(`ellipse`,{cx:R,cy:z,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let Te=(V||O)&&`ok-blob-eye-hidden`,q;t[26]===Te?q=t[27]:(q=s(`ok-blob-eye ok-blob-eye-right`,Te),t[26]=Te,t[27]=q);let J;t[28]===q?J=t[29]:(J=(0,S.jsx)(`ellipse`,{cx:ae,cy:z,rx:1.2722,ry:1.9083,className:q}),t[28]=q,t[29]=J);let Y;t[30]===H?Y=t[31]:(Y=se(R,H),t[30]=H,t[31]=Y);let Ee=(!V||O)&&`ok-blob-eye-hidden`,X;t[32]===Ee?X=t[33]:(X=s(`ok-blob-happy-eye`,Ee),t[32]=Ee,t[33]=X);let Z;t[34]!==Y||t[35]!==X?(Z=(0,S.jsx)(`path`,{d:Y,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:X}),t[34]=Y,t[35]=X,t[36]=Z):Z=t[36];let Q;t[37]===H?Q=t[38]:(Q=se(ae,H),t[37]=H,t[38]=Q);let De=(!V||O)&&`ok-blob-eye-hidden`,Oe;t[39]===De?Oe=t[40]:(Oe=s(`ok-blob-happy-eye`,De),t[39]=De,t[40]=Oe);let ke;t[41]!==Q||t[42]!==Oe?(ke=(0,S.jsx)(`path`,{d:Q,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Oe}),t[41]=Q,t[42]=Oe,t[43]=ke):ke=t[43];let Ae;t[44]===O?Ae=t[45]:(Ae=O?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`path`,{d:ce(R),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,S.jsx)(`path`,{d:ce(ae),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=O,t[45]=Ae);let $;t[46]!==K||t[47]!==J||t[48]!==Z||t[49]!==ke||t[50]!==Ae?($=(0,S.jsxs)(`g`,{ref:te,children:[K,J,Z,ke,Ae]}),t[46]=K,t[47]=J,t[48]=Z,t[49]=ke,t[50]=Ae,t[51]=$):$=t[51];let je;t[52]!==xe||t[53]!==W||t[54]!==$?(je=(0,S.jsxs)(`g`,{className:W,children:[Ce,$]},xe),t[52]=xe,t[53]=W,t[54]=$,t[55]=je):je=t[55];let Me;t[56]===O?Me=t[57]:(Me=O?(0,S.jsxs)(`g`,{children:[(0,S.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,S.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=O,t[57]=Me);let Ne;t[58]!==g||t[59]!==y?(Ne=y.length>0&&(0,S.jsx)(`g`,{children:y.map(pe)},`firework-${g}`),t[58]=g,t[59]=y,t[60]=Ne):Ne=t[60];let Pe;t[61]!==oe||t[62]!==l||t[63]!==be||t[64]!==je||t[65]!==Me||t[66]!==Ne?(Pe=(0,S.jsxs)(`svg`,{ref:ee,width:l,height:l,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:be,"aria-hidden":`true`,onClick:oe,onMouseDown:me,children:[je,Me,Ne]}),t[61]=oe,t[62]=l,t[63]=be,t[64]=je,t[65]=Me,t[66]=Ne,t[67]=Pe):Pe=t[67];let Fe;return t[68]!==U||t[69]!==Pe?(Fe=(0,S.jsx)(`span`,{ref:p,className:U,children:Pe}),t[68]=U,t[69]=Pe,t[70]=Fe):Fe=t[70],Fe}function pe(e){return(0,S.jsx)(`circle`,{cx:le+e.originDx,cy:ue+e.originDy,r:e.size,className:`ok-blob-firework`,style:de(e)},e.id)}function me(e){return e.preventDefault()}function he(e){return e+1}function ge(e){return e+1}var _e=y(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),ve=y(`file-plus`,[[`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`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),B=[...new Set(g.flatMap(e=>e.schemes))];function V(e,t){let n=t.now?.()??Date.now(),r={};for(let t of g){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function H(e){return V({},e)}async function ye(e){let t=e.schemes??B,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var U=Object.fromEntries(B.map(e=>[e,{installed:!1}]));async function be(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return U}if(!t.ok)return U;let n;try{n=await t.json()}catch{return U}if(typeof n!=`object`||!n||Array.isArray(n))return U;let r=n,i={};for(let e of B)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function xe(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Se(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=H({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=V(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!xe(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function W(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ce(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ye({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>be({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function we(){let e=(0,w.c)(5),[t,n]=(0,C.useState)(G),r=(0,C.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Se(Ce());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,C.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function G(){return H({isElectronHost:W(),now:Date.now})}var K=(0,C.createContext)(null);function Te(e){let t=(0,w.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,S.jsx)(K,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function q(){return(0,C.use)(K)}function J(e){let t=(0,w.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:g}=e,{_}=a(),v;t[0]!==_||t[1]!==n?(v=n??_({id:`L3CEC1`}),t[0]=_,t[1]=n,t[2]=v):v=t[2];let y=v,b;t[3]!==_||t[4]!==d?(b=d??_({id:`cnGeoo`}),t[3]=_,t[4]=d,t[5]=b):b=t[5];let C=b,T;t[6]!==_||t[7]!==d||t[8]!==f?(T=f??d??_({id:`s3caR3`}),t[6]=_,t[7]=d,t[8]=f,t[9]=T):T=t[9];let E=T,D;t[10]!==_||t[11]!==s||t[12]!==y?(D=s??_({id:`77SdEP`,values:{itemName:y}}),t[10]=_,t[11]=s,t[12]=y,t[13]=D):D=t[13];let O;t[14]===D?O=t[15]:(O=(0,S.jsx)(ee,{children:D}),t[14]=D,t[15]=O);let k;t[16]!==_||t[17]!==c||t[18]!==y?(k=c??_({id:`16D5Zj`,values:{itemName:y}}),t[16]=_,t[17]=c,t[18]=y,t[19]=k):k=t[19];let A;t[20]===k?A=t[21]:(A=(0,S.jsx)(p,{className:`whitespace-pre-wrap`,children:k}),t[20]=k,t[21]=A);let j;t[22]===u?j=t[23]:(j=u?(0,S.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=j);let M;t[24]!==O||t[25]!==A||t[26]!==j?(M=(0,S.jsxs)(h,{children:[O,A,j]}),t[24]=O,t[25]=A,t[26]=j,t[27]=M):M=t[27];let N;t[28]===g?N=t[29]:(N=g?(0,S.jsx)(ne,{children:g}):null,t[28]=g,t[29]=N);let ie;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,S.jsx)(i,{id:`dEgA5A`}),t[30]=ie):ie=t[30];let P;t[31]===r?P=t[32]:(P=(0,S.jsx)(m,{asChild:!0,children:(0,S.jsx)(l,{variant:`outline`,disabled:r,children:ie})}),t[31]=r,t[32]=P);let F;t[33]!==C||t[34]!==E||t[35]!==r?(F=r?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(x,{className:`size-4 animate-spin`}),` `,E]}):C,t[33]=C,t[34]=E,t[35]=r,t[36]=F):F=t[36];let I;t[37]!==r||t[38]!==o||t[39]!==F?(I=(0,S.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:F}),t[37]=r,t[38]=o,t[39]=F,t[40]=I):I=t[40];let L;t[41]!==P||t[42]!==I?(L=(0,S.jsxs)(re,{children:[P,I]}),t[41]=P,t[42]=I,t[43]=L):L=t[43];let R;return t[44]!==N||t[45]!==L||t[46]!==M?(R=(0,S.jsxs)(te,{children:[M,N,L]}),t[44]=N,t[45]=L,t[46]=M,t[47]=R):R=t[47],R}function Y(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:v[e]??e}function Ee(e){return e===`claude`?`claude-code`:e}function X(e){let t=(0,w.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,S.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,S.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,S.jsx)(fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,S.jsx)(b,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=Ee(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,S.jsx)(_,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function Z(e){let t=(0,w.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let p;t[8]===i?p=t[9]:(p=e=>(0,S.jsxs)(f,{children:[(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,S.jsx)(X,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Y(e)})})}),(0,S.jsx)(d,{children:Y(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,S.jsxs)(f,{children:[(0,S.jsx)(u,{asChild:!0,children:(0,S.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,S.jsx)(d,{children:l.map(Y).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,S.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Q(e){let t=(0,w.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,S.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,S.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}export{Te as a,ve as c,J as i,_e as l,X as n,q as o,Z as r,we as s,Q as t,fe as u};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Qn as n}from"./DocumentContext-CzZ4OdU4.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{n as c}from"./use-workspace-BVw2SUvV.js";import{t as l}from"./button-RQ5o7P7w.js";import{i as u,n as d,t as f}from"./tooltip-x7BNUa3s.js";import{a as p,c as ee,i as te,n as ne,o as re,r as m,s as h}from"./dialog-DwFomKjP.js";import{m as g,o as _}from"./agent-visibility-BxHoyzki.js";import{ga as v}from"./dist-P5PuqHtu2.js";import{t as y}from"./createLucideIcon-BbgVV4EV.js";import{t as b}from"./folder-DxrU2PLH.js";import{t as x}from"./loader-circle-B0OUuKph.js";var S=t(),C=e(r(),1),w=o(),T=3100,E=3;function D(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??E;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var O={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},k=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function A(e,t={}){let n=t.rng??Math.random,r=t.colors??k,i=O[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var j=1.8,M=90,N=16,ie=380,P=.025,F=.1,I=.18,L=400,R=9.2736,ae=18.1799,z=14.5244,oe={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function se(e,t){let{halfWidth:n,apexLift:r}=oe[t];return`M${e-n} ${z+.3} Q${e} ${z-r}, ${e+n} ${z+.3}`}function ce(e){let t=1.5,n=.3;return`M${e-t} ${z-n} Q${e} ${z+1.4}, ${e+t} ${z-n}`}var le=15,ue=15;function de(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function fe(e){let t=(0,w.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,l=n===void 0?48:n,u=i===void 0?!0:i,d=a===void 0?`default`:a,f=o===void 0?0:o,p=(0,C.useRef)(null),ee=(0,C.useRef)(null),te=(0,C.useRef)(null),ne;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ne={x:0,y:0},t[0]=ne):ne=t[0];let re=(0,C.useRef)(ne),[m,h]=(0,C.useState)(0),[g,_]=(0,C.useState)(0),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[1]=v):v=t[1];let[y,b]=(0,C.useState)(v),x=(0,C.useRef)(0),E=(0,C.useRef)(void 0),O=d===`sleeping`,k;t[2]!==m||t[3]!==O?(k=function(){if(O)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=x.current===0?1/0:e-x.current;x.current=e;let n=D(m,t);h(n),_(ge),b(A(n)),clearTimeout(E.current),E.current=setTimeout(()=>{h(0),b([])},T)},t[2]=m,t[3]=O,t[4]=k):k=t[4];let oe=k,le,ue;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>()=>clearTimeout(E.current),ue=[],t[5]=le,t[6]=ue):(le=t[5],ue=t[6]),(0,C.useEffect)(le,ue);let de,fe;t[7]!==f||t[8]!==O?(de=()=>{f===0||O||(h(3),_(he),b(A(3)),clearTimeout(E.current),E.current=setTimeout(()=>{h(0),b([])},T))},fe=[f,O],t[7]=f,t[8]=O,t[9]=de,t[10]=fe):(de=t[9],fe=t[10]),(0,C.useEffect)(de,fe);let _e,ve;t[11]!==O||t[12]!==u?(_e=()=>{if(!u||O||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(d))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function d(){s=0;let l=ee.current,u=p.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),ne=f.left+f.width/2,m=f.top+f.height*.48,h=e-ne,g=t-m,_=Math.hypot(h,g),v=Math.max(-1,Math.min(1,h/ie)),y=-Math.max(-1,Math.min(1,g/ie))*N,b=v*N,x=0,S=0;if(_>=1){let e=Math.min(_/M,1)*j;x=h/_*e,S=g/_*e}let C=Math.abs(y-r)<.01&&Math.abs(b-i)<.01&&Math.abs(x-a)<.01&&Math.abs(S-o)<.01;if(!d&&C)return;c(),r+=(y-r)*F,i+=(b-i)*F,u.style.transform=`perspective(${L}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(x-a)*I,o+=(S-o)*I;let w=i*P,T=-r*P,E=a+w,D=o+T;re.current.x=E,re.current.y=D,te.current?.setAttribute(`transform`,`translate(${E.toFixed(3)} ${D.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,p.current&&(p.current.style.transform=``),re.current={x:0,y:0},te.current?.removeAttribute(`transform`)}},ve=[u,O],t[11]=O,t[12]=u,t[13]=_e,t[14]=ve):(_e=t[13],ve=t[14]),(0,C.useEffect)(_e,ve);let B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=te.current;if(!e)return;let{x:t,y:n}=re.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=B):B=t[15],(0,C.useLayoutEffect)(B);let V=m>0,H=V?m:1,ye=V?`ok-blob-clicked-${m}`:null,U;t[16]===r?U=t[17]:(U=s(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=U);let be=O?`cursor-default`:`cursor-pointer`,xe=`body-${g}`,Se=O&&`ok-blob-sleeping`,W;t[18]!==ye||t[19]!==Se?(W=s(`ok-blob-group`,Se,ye),t[18]=ye,t[19]=Se,t[20]=W):W=t[20];let Ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,S.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[21]=Ce):Ce=t[21];let we=(V||O)&&`ok-blob-eye-hidden`,G;t[22]===we?G=t[23]:(G=s(`ok-blob-eye`,we),t[22]=we,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,S.jsx)(`ellipse`,{cx:R,cy:z,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let Te=(V||O)&&`ok-blob-eye-hidden`,q;t[26]===Te?q=t[27]:(q=s(`ok-blob-eye ok-blob-eye-right`,Te),t[26]=Te,t[27]=q);let J;t[28]===q?J=t[29]:(J=(0,S.jsx)(`ellipse`,{cx:ae,cy:z,rx:1.2722,ry:1.9083,className:q}),t[28]=q,t[29]=J);let Y;t[30]===H?Y=t[31]:(Y=se(R,H),t[30]=H,t[31]=Y);let Ee=(!V||O)&&`ok-blob-eye-hidden`,X;t[32]===Ee?X=t[33]:(X=s(`ok-blob-happy-eye`,Ee),t[32]=Ee,t[33]=X);let Z;t[34]!==Y||t[35]!==X?(Z=(0,S.jsx)(`path`,{d:Y,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:X}),t[34]=Y,t[35]=X,t[36]=Z):Z=t[36];let Q;t[37]===H?Q=t[38]:(Q=se(ae,H),t[37]=H,t[38]=Q);let De=(!V||O)&&`ok-blob-eye-hidden`,Oe;t[39]===De?Oe=t[40]:(Oe=s(`ok-blob-happy-eye`,De),t[39]=De,t[40]=Oe);let ke;t[41]!==Q||t[42]!==Oe?(ke=(0,S.jsx)(`path`,{d:Q,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Oe}),t[41]=Q,t[42]=Oe,t[43]=ke):ke=t[43];let Ae;t[44]===O?Ae=t[45]:(Ae=O?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`path`,{d:ce(R),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,S.jsx)(`path`,{d:ce(ae),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=O,t[45]=Ae);let $;t[46]!==K||t[47]!==J||t[48]!==Z||t[49]!==ke||t[50]!==Ae?($=(0,S.jsxs)(`g`,{ref:te,children:[K,J,Z,ke,Ae]}),t[46]=K,t[47]=J,t[48]=Z,t[49]=ke,t[50]=Ae,t[51]=$):$=t[51];let je;t[52]!==xe||t[53]!==W||t[54]!==$?(je=(0,S.jsxs)(`g`,{className:W,children:[Ce,$]},xe),t[52]=xe,t[53]=W,t[54]=$,t[55]=je):je=t[55];let Me;t[56]===O?Me=t[57]:(Me=O?(0,S.jsxs)(`g`,{children:[(0,S.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,S.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=O,t[57]=Me);let Ne;t[58]!==g||t[59]!==y?(Ne=y.length>0&&(0,S.jsx)(`g`,{children:y.map(pe)},`firework-${g}`),t[58]=g,t[59]=y,t[60]=Ne):Ne=t[60];let Pe;t[61]!==oe||t[62]!==l||t[63]!==be||t[64]!==je||t[65]!==Me||t[66]!==Ne?(Pe=(0,S.jsxs)(`svg`,{ref:ee,width:l,height:l,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:be,"aria-hidden":`true`,onClick:oe,onMouseDown:me,children:[je,Me,Ne]}),t[61]=oe,t[62]=l,t[63]=be,t[64]=je,t[65]=Me,t[66]=Ne,t[67]=Pe):Pe=t[67];let Fe;return t[68]!==U||t[69]!==Pe?(Fe=(0,S.jsx)(`span`,{ref:p,className:U,children:Pe}),t[68]=U,t[69]=Pe,t[70]=Fe):Fe=t[70],Fe}function pe(e){return(0,S.jsx)(`circle`,{cx:le+e.originDx,cy:ue+e.originDy,r:e.size,className:`ok-blob-firework`,style:de(e)},e.id)}function me(e){return e.preventDefault()}function he(e){return e+1}function ge(e){return e+1}var _e=y(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),ve=y(`file-plus`,[[`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`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),B=[...new Set(g.flatMap(e=>e.schemes))];function V(e,t){let n=t.now?.()??Date.now(),r={};for(let t of g){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function H(e){return V({},e)}async function ye(e){let t=e.schemes??B,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var U=Object.fromEntries(B.map(e=>[e,{installed:!1}]));async function be(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return U}if(!t.ok)return U;let n;try{n=await t.json()}catch{return U}if(typeof n!=`object`||!n||Array.isArray(n))return U;let r=n,i={};for(let e of B)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function xe(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Se(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=H({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=V(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!xe(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function W(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ce(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ye({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>be({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function we(){let e=(0,w.c)(5),[t,n]=(0,C.useState)(G),r=(0,C.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Se(Ce());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,C.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function G(){return H({isElectronHost:W(),now:Date.now})}var K=(0,C.createContext)(null);function Te(e){let t=(0,w.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,S.jsx)(K,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function q(){return(0,C.use)(K)}function J(e){let t=(0,w.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:g}=e,{_}=a(),v;t[0]!==_||t[1]!==n?(v=n??_({id:`L3CEC1`}),t[0]=_,t[1]=n,t[2]=v):v=t[2];let y=v,b;t[3]!==_||t[4]!==d?(b=d??_({id:`cnGeoo`}),t[3]=_,t[4]=d,t[5]=b):b=t[5];let C=b,T;t[6]!==_||t[7]!==d||t[8]!==f?(T=f??d??_({id:`s3caR3`}),t[6]=_,t[7]=d,t[8]=f,t[9]=T):T=t[9];let E=T,D;t[10]!==_||t[11]!==s||t[12]!==y?(D=s??_({id:`77SdEP`,values:{itemName:y}}),t[10]=_,t[11]=s,t[12]=y,t[13]=D):D=t[13];let O;t[14]===D?O=t[15]:(O=(0,S.jsx)(ee,{children:D}),t[14]=D,t[15]=O);let k;t[16]!==_||t[17]!==c||t[18]!==y?(k=c??_({id:`16D5Zj`,values:{itemName:y}}),t[16]=_,t[17]=c,t[18]=y,t[19]=k):k=t[19];let A;t[20]===k?A=t[21]:(A=(0,S.jsx)(p,{className:`whitespace-pre-wrap`,children:k}),t[20]=k,t[21]=A);let j;t[22]===u?j=t[23]:(j=u?(0,S.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=j);let M;t[24]!==O||t[25]!==A||t[26]!==j?(M=(0,S.jsxs)(h,{children:[O,A,j]}),t[24]=O,t[25]=A,t[26]=j,t[27]=M):M=t[27];let N;t[28]===g?N=t[29]:(N=g?(0,S.jsx)(ne,{children:g}):null,t[28]=g,t[29]=N);let ie;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,S.jsx)(i,{id:`dEgA5A`}),t[30]=ie):ie=t[30];let P;t[31]===r?P=t[32]:(P=(0,S.jsx)(m,{asChild:!0,children:(0,S.jsx)(l,{variant:`outline`,disabled:r,children:ie})}),t[31]=r,t[32]=P);let F;t[33]!==C||t[34]!==E||t[35]!==r?(F=r?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(x,{className:`size-4 animate-spin`}),` `,E]}):C,t[33]=C,t[34]=E,t[35]=r,t[36]=F):F=t[36];let I;t[37]!==r||t[38]!==o||t[39]!==F?(I=(0,S.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:F}),t[37]=r,t[38]=o,t[39]=F,t[40]=I):I=t[40];let L;t[41]!==P||t[42]!==I?(L=(0,S.jsxs)(re,{children:[P,I]}),t[41]=P,t[42]=I,t[43]=L):L=t[43];let R;return t[44]!==N||t[45]!==L||t[46]!==M?(R=(0,S.jsxs)(te,{children:[M,N,L]}),t[44]=N,t[45]=L,t[46]=M,t[47]=R):R=t[47],R}function Y(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:v[e]??e}function Ee(e){return e===`claude`?`claude-code`:e}function X(e){let t=(0,w.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,S.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,S.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,S.jsx)(fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,S.jsx)(b,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=Ee(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,S.jsx)(_,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function Z(e){let t=(0,w.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let p;t[8]===i?p=t[9]:(p=e=>(0,S.jsxs)(f,{children:[(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,S.jsx)(X,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Y(e)})})}),(0,S.jsx)(d,{children:Y(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,S.jsxs)(f,{children:[(0,S.jsx)(u,{asChild:!0,children:(0,S.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,S.jsx)(d,{children:l.map(Y).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,S.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Q(e){let t=(0,w.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,S.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,S.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}export{Te as a,ve as c,J as i,_e as l,X as n,q as o,Z as r,we as s,Q as t,fe as u};
|