@inkeep/open-knowledge 0.45.0 → 0.46.0-beta.0
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-pxi823CF.mjs → acp-harness-probe-CxRHExTF.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-CaJonkjd.mjs +2 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{init-CgNWpE2S.mjs → init-BywyN3bZ.mjs} +3 -3
- package/dist/init-CXNuZ1vN.mjs +1 -0
- package/dist/{launch-json-removal-OJNI-717.mjs → launch-json-removal-DUhfwUL4.mjs} +2 -2
- package/dist/loader-CNnz66sA.mjs +1 -0
- package/dist/{loader-EGm-qx5P.mjs → loader-CV5nEQVy.mjs} +2 -2
- package/dist/{preview-BPL7w_cV.mjs → preview-CuTwyBl2.mjs} +2 -2
- package/dist/preview-nhAfQjAn.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CcG8767K.js → ActivityModeContent-B6-70ang.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-D8YoofwF.js → AgentDiffPane-DeWSzAp-.js} +1 -1
- package/dist/public/assets/{BugReportHistory-B0qbbAw0.js → BugReportHistory-DrMLEEP8.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-Bp4PHyEI.js → BugReportHistoryDialog-Cf_ZrCjH.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B4tL-3Ht.js → CodeMirrorPropInput-CUPvWzYm.js} +1 -1
- package/dist/public/assets/{DocumentContext-FCJwmuAo.js → DocumentContext-B-29n_HL.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DcuaOmV8.js → EditorModeToggle-CigjLJ2Z.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CTsdvp_5.js → EnableSyncConfirmDialog-DTG7riiK.js} +1 -1
- package/dist/public/assets/FeedbackForm-BtkuXFGI.js +1 -0
- package/dist/public/assets/{LintConfigEditor-MRWig8E3.js → LintConfigEditor-ylJ89_uD.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DIfvPtzN.js → ManagedArtifactProperties-D3xtiDXY.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DsEY1FOt.js → MermaidDocEditor-R8D5JpPi.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DA4qhX7-.js → PropertyPanel-H098JdnP.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-C2dU04N7.js → RegisteredAgentIcon-DplzDEhh.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CgzQLCKM.js → ReportBugDialogBody-DZFX9Uby.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-BdzkNqsH.js → SchemaConfigEditor-BHuEU14f.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-B4PW-A-w.js → SettingsDialogBody-ZYeLdOBh.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-_26zWSVZ.js → ShareReceiveMissDialog-CIsXJHV5.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-CBKpfxev.js → SkillEditorActions-DesRWfir.js} +1 -1
- package/dist/public/assets/{SourceEditor-BcRIK3Uz.js → SourceEditor-Gg4gFBXn.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-B0kLulV_.js → TerminalSessionsHost-BVUmqdhT.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-CMdYDyv_.js → TerminalWindowApp-BrV49Q8V.js} +1 -1
- package/dist/public/assets/{ThreadView-DQThTEIO.js → ThreadView-DouqkaQt.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CsNp0WRG.js → TimelineDiffPane-DrdY8iSv.js} +1 -1
- package/dist/public/assets/{auth-state-cache-EkXfX8vV.js → auth-state-cache-DOwAr8pE.js} +1 -1
- package/dist/public/assets/{client-version-CVjSHBE0.js → client-version-CWjw2o37.js} +1 -1
- package/dist/public/assets/{config-provider-CvXAYjor.js → config-provider--LBV5X-F.js} +1 -1
- package/dist/public/assets/globals-BtCTpjIr.css +1 -0
- package/dist/public/assets/{index-Dw-K4FA8.js → index-D6QuW6BA.js} +7 -7
- package/dist/public/assets/{pending-receive-nav-store-Da_9JJXI.js → pending-receive-nav-store-B6dtzPFx.js} +1 -1
- package/dist/public/assets/{selection-context-np7NtN5p.js → selection-context-B2HcUOkN.js} +1 -1
- package/dist/public/assets/{skill-actions-BgdyM_G0.js → skill-actions-C5Jj4vq_.js} +1 -1
- package/dist/public/assets/{src-D452d0cv.js → src-CttimVGm.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C8kYleYy.js → telemetry-impl-BFTBY40l.js} +1 -1
- package/dist/public/assets/{telemetry-startup-CEgptpjf.js → telemetry-startup-DI3YRseI.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-rVKisiec.js → typing-burst-detector-ZNMuwopa.js} +1 -1
- package/dist/public/assets/{uninstall-DnE1CJ4K.js → uninstall-940RMTvq.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D5Ud5rAK.js → use-activity-panel-BtuJNY3q.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DLUyAvNx.js → use-terminal-enabled-U4ycZNGm.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-g0StQlEH.js → use-timeline-entry-diff-DIrGiWpg.js} +1 -1
- package/dist/public/index.html +16 -16
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-tGZcW42t.mjs → repair-launch-json-BHjMUArH.mjs} +2 -2
- package/dist/{repair-mcp-configs-DZYAXNdR.mjs → repair-mcp-configs-DaZNyTJh.mjs} +2 -2
- package/dist/{src-BfF1eLC-.mjs → src-SPeh14QP.mjs} +2 -2
- package/dist/{start-HwqGYVb8.mjs → start-5jiM99lZ.mjs} +2 -2
- package/dist/start-CNaLDf-C.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-C5VMTJt2.mjs +0 -2
- package/dist/init-BWMly0Jp.mjs +0 -1
- package/dist/loader-DQQn8OFp.mjs +0 -1
- package/dist/preview-C45NNSLa.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DamXgXPd.js +0 -1
- package/dist/public/assets/globals-B1VH9dVh.css +0 -1
- package/dist/start-DqeJbIko.mjs +0 -1
- /package/dist/public/assets/{globals-DLE5hh7Z.js → globals-Dsi-fA9A.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./init-BywyN3bZ.mjs";export{e as runInit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mr as e,kr as t}from"./src-B0klb50O.mjs";import{P as n}from"./fs-traced-DDm-belY.mjs";import{D as r,T as i}from"./init-
|
|
2
|
-
//# sourceMappingURL=launch-json-removal-
|
|
1
|
+
import{Mr as e,kr as t}from"./src-B0klb50O.mjs";import{P as n}from"./fs-traced-DDm-belY.mjs";import{D as r,T as i}from"./init-BywyN3bZ.mjs";import{t as a}from"./is-object-ByG7RnjH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=e(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=t(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
|
|
2
|
+
//# sourceMappingURL=launch-json-removal-DUhfwUL4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-CV5nEQVy.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./src-jbLmpusB.mjs";import{_ as e}from"./src-B0klb50O.mjs";import{K as t,l as n,o as r,s as i}from"./sleep-DDnWCWup.mjs";import{D as a,O as o}from"./fs-traced-DDm-belY.mjs";import{t as s}from"./constants-
|
|
1
|
+
import"./src-jbLmpusB.mjs";import{_ as e}from"./src-B0klb50O.mjs";import{K as t,l as n,o as r,s as i}from"./sleep-DDnWCWup.mjs";import{D as a,O as o}from"./fs-traced-DDm-belY.mjs";import{t as s}from"./constants-CaJonkjd.mjs";import{t as c}from"./is-object-ByG7RnjH.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";var p=t();async function m(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,p.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function v(t){let i=t??process.cwd(),c=[],u=o(`user`,i),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(i,`.ok`,s),m=g(p);if(m.value!==null){let e=r({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
|
|
2
2
|
|
|
3
3
|
`));f=h(f,m.value),c.push(p)}let v=e.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=m(e.startupCwd);return async o=>{let s=await m(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
4
|
+
//# sourceMappingURL=loader-CV5nEQVy.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Nr as e}from"./src-B0klb50O.mjs";import"./constants-
|
|
1
|
+
import{Nr as e}from"./src-B0klb50O.mjs";import"./constants-CaJonkjd.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-CuTwyBl2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-CuTwyBl2.mjs";export{t as formatPreviewBlock,e as previewContent};
|
package/dist/public/assets/{ActivityModeContent-CcG8767K.js → ActivityModeContent-B6-70ang.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{i as n,r}from"./DocumentContext-FCJwmuAo.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-Gol9BgNB.js";import{i as l,n as u,t as d}from"./tooltip-B4J7VHmA.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-TkFkuYVg.js";import{ft as v}from"./CodeMirrorPropInput-B4tL-3Ht.js";import{n as y}from"./CopyButton-1Q6Wnnjb.js";import{i as b}from"./prop-types-B-j2FcIV.js";import{t as x}from"./loader-circle-Cg5SU7AZ.js";import{i as S,t as C}from"./timeline-diff-store-CYckprSS.js";import{n as w}from"./dist-BLAMau9Z.js";import{t as T}from"./dist-q14fBS3T.js";import{s as E}from"./navigation-targets-o2l61Wug.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-BGQPvDCA.js";import{n as M}from"./use-activity-panel-D5Ud5rAK.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 T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({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),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,P.useEffect)(E,O);let[k,A]=(0,P.useState)(!1),j=D(),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 $;t[57]===v?$=t[58]:($=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=$);let ue;t[59]===C?ue=t[60]:(ue=C({id:`a4FRQv`}),t[59]=C,t[60]=ue);let de;t[61]===ue?de=t[62]:(de=(0,F.jsx)(p,{children:ue}),t[61]=ue,t[62]=de);let fe;t[63]===L?fe=t[64]:(fe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=fe);let pe;t[65]!==de||t[66]!==fe?(pe=(0,F.jsxs)(g,{children:[de,fe]}),t[65]=de,t[66]=fe,t[67]=pe):pe=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]!==pe||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[pe,_e]}),t[76]=pe,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==$||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:$,children:ve}),t[79]=k,t[80]=$,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 T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return T._({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),j()}))},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 A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(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]=A):A=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]!==A||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,I]}),t[53]=A,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 T._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return T._({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)(A,{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)O(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(E({kind:`doc`,target:e,docName:e},f)),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;C();let n=e.bursts.length;k({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 T=S,D;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(D=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),w.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);w.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=D):D=t[19];let A=D,j;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==T||t[25]!==A||t[26]!==g||t[27]!==s||t[28]!==m?(j=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:A,onSetVersion:T,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=T,t[25]=A,t[26]=g,t[27]=s,t[28]=m,t[29]=j):j=t[29],j}export{K as ActivityModeContent};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{i as n,r}from"./DocumentContext-B-29n_HL.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-Gol9BgNB.js";import{i as l,n as u,t as d}from"./tooltip-B4J7VHmA.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-TkFkuYVg.js";import{ft as v}from"./CodeMirrorPropInput-CUPvWzYm.js";import{n as y}from"./CopyButton-1Q6Wnnjb.js";import{i as b}from"./prop-types-B-j2FcIV.js";import{t as x}from"./loader-circle-Cg5SU7AZ.js";import{i as S,t as C}from"./timeline-diff-store-CYckprSS.js";import{n as w}from"./dist-BLAMau9Z.js";import{t as T}from"./dist-q14fBS3T.js";import{s as E}from"./navigation-targets-o2l61Wug.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-BGQPvDCA.js";import{n as M}from"./use-activity-panel-BtuJNY3q.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 T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({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),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,P.useEffect)(E,O);let[k,A]=(0,P.useState)(!1),j=D(),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 $;t[57]===v?$=t[58]:($=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=$);let ue;t[59]===C?ue=t[60]:(ue=C({id:`a4FRQv`}),t[59]=C,t[60]=ue);let de;t[61]===ue?de=t[62]:(de=(0,F.jsx)(p,{children:ue}),t[61]=ue,t[62]=de);let fe;t[63]===L?fe=t[64]:(fe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=fe);let pe;t[65]!==de||t[66]!==fe?(pe=(0,F.jsxs)(g,{children:[de,fe]}),t[65]=de,t[66]=fe,t[67]=pe):pe=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]!==pe||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[pe,_e]}),t[76]=pe,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==$||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:$,children:ve}),t[79]=k,t[80]=$,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 T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return T._({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),j()}))},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 A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(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]=A):A=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]!==A||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,I]}),t[53]=A,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 T._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return T._({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)(A,{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)O(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(E({kind:`doc`,target:e,docName:e},f)),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;C();let n=e.bursts.length;k({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 T=S,D;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(D=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),w.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);w.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=D):D=t[19];let A=D,j;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==T||t[25]!==A||t[26]!==g||t[27]!==s||t[28]!==m?(j=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:A,onSetVersion:T,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=T,t[25]=A,t[26]=g,t[27]=s,t[28]=m,t[29]=j):j=t[29],j}export{K as ActivityModeContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-B03Wzvap.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-Gol9BgNB.js";import{i as te,n as ne,t as re}from"./tooltip-B4J7VHmA.js";import{n as s,t as c}from"./toggle-group-CjXmmTGy.js";import{t as l}from"./loader-circle-Cg5SU7AZ.js";import{n as u,t as d}from"./panel-right-open-B7ziq39V.js";import{t as ie}from"./x-DVkpYo5d.js";import{t as ae}from"./overlay-layers-y-dNUWSd.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-BGQPvDCA.js";import{t as f}from"./lru-string-cache-BZxOuxTi.js";import{t as le}from"./use-activity-panel-
|
|
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-Gol9BgNB.js";import{i as te,n as ne,t as re}from"./tooltip-B4J7VHmA.js";import{n as s,t as c}from"./toggle-group-CjXmmTGy.js";import{t as l}from"./loader-circle-Cg5SU7AZ.js";import{n as u,t as d}from"./panel-right-open-B7ziq39V.js";import{t as ie}from"./x-DVkpYo5d.js";import{t as ae}from"./overlay-layers-y-dNUWSd.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-BGQPvDCA.js";import{t as f}from"./lru-string-cache-BZxOuxTi.js";import{t as le}from"./use-activity-panel-BtuJNY3q.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-DIrGiWpg.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-B03Wzvap.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"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{n as c,r as l,t as u}from"./collapsible-B1mS1n9y.js";import{t as d}from"./chevron-down-Bx9f3tW-.js";import{t as f}from"./folder-open-wLd69QUc.js";import{t as p}from"./loader-circle-Cg5SU7AZ.js";import{t as m}from"./trash-2-BUuL4OCw.js";import{t as h}from"./badge-Dba4cvJR.js";var g=o(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),_=a(),v=e(n(),1),y=t();function b(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function x(){let e=(0,_.c)(13),[t,n]=(0,v.useState)(`loading`),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let[i,a]=(0,v.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={},e[1]=o):o=e[1];let[s,c]=(0,v.useState)(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async function(){let e=window.okDesktop?.bugReport;if(!e){n(`error`);return}try{let t=await e.list();t.ok?(a(t.reports),n(`ready`)):n(`error`)}catch{n(`error`)}},e[2]=l):l=e[2];let u=l,d,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[3]=d,e[4]=f):(d=e[3],f=e[4]),(0,v.useEffect)(d,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(e){c(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},e[5]=p):p=e[5];let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=async function(e){let t=window.okDesktop?.bugReport;if(!t||!e.retryable)return;c(t=>({...t,[e.id]:`retrying`}));let n=await t.send({zipPath:e.zipPath,metadata:{level:e.bundleLevel===`unknown`?`standard`:e.bundleLevel,systemWide:e.systemWide,projectSlug:e.projectSlug}}).catch(C);n&&!n.ok&&n.reason===`email-draft`&&window.okDesktop?.shell.openExternal(n.fallback.mailtoUrl),await u(),m(e.id)},e[6]=h):h=e[6];let g=h,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=async function(e){let t=window.okDesktop?.bugReport;t&&(c(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(S),await u(),m(e.id))},e[7]=y):y=e[7];let b=y,x;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=x):x=e[8];let w=x,T;return e[9]!==s||e[10]!==i||e[11]!==t?(T={status:t,reports:i,pending:s,retry:g,remove:b,reveal:w},e[9]=s,e[10]=i,e[11]=t,e[12]=T):T=e[12],T}function S(){}function C(){return null}function w(e){let t=(0,_.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`primary`,children:(0,y.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`destructive`,children:(0,y.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`warning`,children:(0,y.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`secondary`,children:(0,y.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`gray`,children:(0,y.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`outline`,children:(0,y.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function T(e){let t=(0,_.c)(50),{row:n,pending:a,onRetry:o,onReveal:c,onDelete:l}=e,{_:u}=i(),d=a!==void 0,v;t[0]!==u||t[1]!==n.createdAt?(v=n.createdAt===``?u({id:`wF2wqQ`}):new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[0]=u,t[1]=n.createdAt,t[2]=v):v=t[2];let x=v,S;t[3]===n.state?S=t[4]:(S=(0,y.jsx)(w,{state:n.state}),t[3]=n.state,t[4]=S);let C;t[5]===n.bundleLevel?C=t[6]:(C=n.bundleLevel===`unknown`?null:(0,y.jsx)(h,{variant:`gray`,children:n.bundleLevel}),t[5]=n.bundleLevel,t[6]=C);let T;t[7]===x?T=t[8]:(T=(0,y.jsx)(`span`,{className:`truncate text-1sm text-muted-foreground`,children:x}),t[7]=x,t[8]=T);let E;t[9]!==S||t[10]!==C||t[11]!==T?(E=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[S,C,T]}),t[9]=S,t[10]=C,t[11]=T,t[12]=E):E=t[12];let D;t[13]!==n.lastError||t[14]!==n.reference||t[15]!==n.state||t[16]!==n.zipBytes?(D=(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.state===`sent`&&n.reference!==void 0?(0,y.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,y.jsx)(`span`,{className:`font-mono text-foreground`})}}):n.state===`upload-failed`&&n.lastError!==void 0?(0,y.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason}):(0,y.jsx)(`span`,{children:b(n.zipBytes)})}),t[13]=n.lastError,t[14]=n.reference,t[15]=n.state,t[16]=n.zipBytes,t[17]=D):D=t[17];let O;t[18]!==E||t[19]!==D?(O=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,D]}),t[18]=E,t[19]=D,t[20]=O):O=t[20];let k;t[21]!==d||t[22]!==o||t[23]!==a||t[24]!==n?(k=n.retryable?(0,y.jsxs)(s,{variant:`outline`,size:`xs`,disabled:d,onClick:()=>o(n),children:[a===`retrying`?(0,y.jsx)(p,{className:`animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):(0,y.jsx)(g,{"aria-hidden":`true`}),(0,y.jsx)(r,{id:`6gRgw8`})]}):null,t[21]=d,t[22]=o,t[23]=a,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==u||t[27]!==d||t[28]!==c||t[29]!==n?(A=n.zipExists?(0,y.jsx)(s,{variant:`ghost`,size:`icon-xs`,disabled:d,"aria-label":u({id:`LtSYdi`}),onClick:()=>c(n),children:(0,y.jsx)(f,{"aria-hidden":`true`})}):null,t[26]=u,t[27]=d,t[28]=c,t[29]=n,t[30]=A):A=t[30];let j;t[31]===u?j=t[32]:(j=u({id:`rUWrSE`}),t[31]=u,t[32]=j);let M;t[33]!==l||t[34]!==n?(M=()=>l(n),t[33]=l,t[34]=n,t[35]=M):M=t[35];let N;t[36]===a?N=t[37]:(N=a===`deleting`?(0,y.jsx)(p,{className:`animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):(0,y.jsx)(m,{"aria-hidden":`true`}),t[36]=a,t[37]=N);let P;t[38]!==d||t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,y.jsx)(s,{variant:`ghost`,size:`icon-xs`,disabled:d,"aria-label":j,onClick:M,children:N}),t[38]=d,t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==P||t[44]!==k||t[45]!==A?(F=(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[k,A,P]}),t[43]=P,t[44]=k,t[45]=A,t[46]=F):F=t[46];let I;return t[47]!==F||t[48]!==O?(I=(0,y.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[O,F]}),t[47]=F,t[48]=O,t[49]=I):I=t[49],I}function E(e){let t=(0,_.c)(13),{reports:n,pending:r,retry:i,remove:a,reveal:o}=e,s;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i||t[4]!==o){let e;t[6]!==r||t[7]!==a||t[8]!==i||t[9]!==o?(e=e=>(0,y.jsx)(T,{row:e,pending:r[e.id],onRetry:i,onReveal:o,onDelete:a},e.id),t[6]=r,t[7]=a,t[8]=i,t[9]=o,t[10]=e):e=t[10],s=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];let c;return t[11]===s?c=t[12]:(c=(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:s}),t[11]=s,t[12]=c),c}function D(e){let t=(0,_.c)(9),{onReportABug:n}=e,i=x();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,y.jsx)(p,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,y.jsx)(s,{onClick:n,children:(0,y.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,y.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,y.jsx)(E,{...i}),t[7]=i,t[8]=a),a}function O(){let e=(0,_.c)(14),[t,n]=(0,v.useState)(!1),i=x();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,y.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let o;e[1]===i.reports.length?o=e[2]:(o=(0,y.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,y.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=o);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,y.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==o||e[6]!==p?(m=(0,y.jsx)(l,{asChild:!0,children:(0,y.jsxs)(s,{variant:`ghost`,size:`sm`,className
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{n as c,r as l,t as u}from"./collapsible-B1mS1n9y.js";import{t as d}from"./chevron-down-Bx9f3tW-.js";import{t as f}from"./folder-open-wLd69QUc.js";import{t as p}from"./loader-circle-Cg5SU7AZ.js";import{t as m}from"./trash-2-BUuL4OCw.js";import{t as h}from"./badge-Dba4cvJR.js";var g=o(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),_=a(),v=e(n(),1),y=t();function b(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function x(){let e=(0,_.c)(13),[t,n]=(0,v.useState)(`loading`),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let[i,a]=(0,v.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={},e[1]=o):o=e[1];let[s,c]=(0,v.useState)(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async function(){let e=window.okDesktop?.bugReport;if(!e){n(`error`);return}try{let t=await e.list();t.ok?(a(t.reports),n(`ready`)):n(`error`)}catch{n(`error`)}},e[2]=l):l=e[2];let u=l,d,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[3]=d,e[4]=f):(d=e[3],f=e[4]),(0,v.useEffect)(d,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(e){c(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},e[5]=p):p=e[5];let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=async function(e){let t=window.okDesktop?.bugReport;if(!t||!e.retryable)return;c(t=>({...t,[e.id]:`retrying`}));let n=await t.send({zipPath:e.zipPath,metadata:{level:e.bundleLevel===`unknown`?`standard`:e.bundleLevel,systemWide:e.systemWide,projectSlug:e.projectSlug}}).catch(C);n&&!n.ok&&n.reason===`email-draft`&&window.okDesktop?.shell.openExternal(n.fallback.mailtoUrl),await u(),m(e.id)},e[6]=h):h=e[6];let g=h,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=async function(e){let t=window.okDesktop?.bugReport;t&&(c(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(S),await u(),m(e.id))},e[7]=y):y=e[7];let b=y,x;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=x):x=e[8];let w=x,T;return e[9]!==s||e[10]!==i||e[11]!==t?(T={status:t,reports:i,pending:s,retry:g,remove:b,reveal:w},e[9]=s,e[10]=i,e[11]=t,e[12]=T):T=e[12],T}function S(){}function C(){return null}function w(e){let t=(0,_.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`primary`,children:(0,y.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`destructive`,children:(0,y.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`warning`,children:(0,y.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`secondary`,children:(0,y.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`gray`,children:(0,y.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(h,{variant:`outline`,children:(0,y.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function T(e){let t=(0,_.c)(50),{row:n,pending:a,onRetry:o,onReveal:c,onDelete:l}=e,{_:u}=i(),d=a!==void 0,v;t[0]!==u||t[1]!==n.createdAt?(v=n.createdAt===``?u({id:`wF2wqQ`}):new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[0]=u,t[1]=n.createdAt,t[2]=v):v=t[2];let x=v,S;t[3]===n.state?S=t[4]:(S=(0,y.jsx)(w,{state:n.state}),t[3]=n.state,t[4]=S);let C;t[5]===n.bundleLevel?C=t[6]:(C=n.bundleLevel===`unknown`?null:(0,y.jsx)(h,{variant:`gray`,children:n.bundleLevel}),t[5]=n.bundleLevel,t[6]=C);let T;t[7]===x?T=t[8]:(T=(0,y.jsx)(`span`,{className:`truncate text-1sm text-muted-foreground`,children:x}),t[7]=x,t[8]=T);let E;t[9]!==S||t[10]!==C||t[11]!==T?(E=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[S,C,T]}),t[9]=S,t[10]=C,t[11]=T,t[12]=E):E=t[12];let D;t[13]!==n.lastError||t[14]!==n.reference||t[15]!==n.state||t[16]!==n.zipBytes?(D=(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.state===`sent`&&n.reference!==void 0?(0,y.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,y.jsx)(`span`,{className:`font-mono text-foreground`})}}):n.state===`upload-failed`&&n.lastError!==void 0?(0,y.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason}):(0,y.jsx)(`span`,{children:b(n.zipBytes)})}),t[13]=n.lastError,t[14]=n.reference,t[15]=n.state,t[16]=n.zipBytes,t[17]=D):D=t[17];let O;t[18]!==E||t[19]!==D?(O=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,D]}),t[18]=E,t[19]=D,t[20]=O):O=t[20];let k;t[21]!==d||t[22]!==o||t[23]!==a||t[24]!==n?(k=n.retryable?(0,y.jsxs)(s,{variant:`outline`,size:`xs`,disabled:d,onClick:()=>o(n),children:[a===`retrying`?(0,y.jsx)(p,{className:`animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):(0,y.jsx)(g,{"aria-hidden":`true`}),(0,y.jsx)(r,{id:`6gRgw8`})]}):null,t[21]=d,t[22]=o,t[23]=a,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==u||t[27]!==d||t[28]!==c||t[29]!==n?(A=n.zipExists?(0,y.jsx)(s,{variant:`ghost`,size:`icon-xs`,disabled:d,"aria-label":u({id:`LtSYdi`}),onClick:()=>c(n),children:(0,y.jsx)(f,{"aria-hidden":`true`})}):null,t[26]=u,t[27]=d,t[28]=c,t[29]=n,t[30]=A):A=t[30];let j;t[31]===u?j=t[32]:(j=u({id:`rUWrSE`}),t[31]=u,t[32]=j);let M;t[33]!==l||t[34]!==n?(M=()=>l(n),t[33]=l,t[34]=n,t[35]=M):M=t[35];let N;t[36]===a?N=t[37]:(N=a===`deleting`?(0,y.jsx)(p,{className:`animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):(0,y.jsx)(m,{"aria-hidden":`true`}),t[36]=a,t[37]=N);let P;t[38]!==d||t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,y.jsx)(s,{variant:`ghost`,size:`icon-xs`,disabled:d,"aria-label":j,onClick:M,children:N}),t[38]=d,t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==P||t[44]!==k||t[45]!==A?(F=(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[k,A,P]}),t[43]=P,t[44]=k,t[45]=A,t[46]=F):F=t[46];let I;return t[47]!==F||t[48]!==O?(I=(0,y.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[O,F]}),t[47]=F,t[48]=O,t[49]=I):I=t[49],I}function E(e){let t=(0,_.c)(13),{reports:n,pending:r,retry:i,remove:a,reveal:o}=e,s;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i||t[4]!==o){let e;t[6]!==r||t[7]!==a||t[8]!==i||t[9]!==o?(e=e=>(0,y.jsx)(T,{row:e,pending:r[e.id],onRetry:i,onReveal:o,onDelete:a},e.id),t[6]=r,t[7]=a,t[8]=i,t[9]=o,t[10]=e):e=t[10],s=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];let c;return t[11]===s?c=t[12]:(c=(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:s}),t[11]=s,t[12]=c),c}function D(e){let t=(0,_.c)(9),{onReportABug:n}=e,i=x();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,y.jsx)(p,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,y.jsx)(s,{onClick:n,children:(0,y.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,y.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,y.jsx)(E,{...i}),t[7]=i,t[8]=a),a}function O(){let e=(0,_.c)(14),[t,n]=(0,v.useState)(!1),i=x();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,y.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let o;e[1]===i.reports.length?o=e[2]:(o=(0,y.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,y.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=o);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,y.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==o||e[6]!==p?(m=(0,y.jsx)(l,{asChild:!0,children:(0,y.jsxs)(s,{variant:`ghost`,size:`sm`,className:`-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted`,children:[o,p]})}),e[5]=o,e[6]=p,e[7]=m):m=e[7];let h;e[8]===i?h=e[9]:(h=(0,y.jsx)(c,{className:`pt-2`,children:(0,y.jsx)(E,{...i})}),e[8]=i,e[9]=h);let g;return e[10]!==t||e[11]!==m||e[12]!==h?(g=(0,y.jsxs)(u,{open:t,onOpenChange:n,children:[m,h]}),e[10]=t,e[11]=m,e[12]=h,e[13]=g):g=e[13],g}export{O as n,D as t};
|
package/dist/public/assets/{BugReportHistoryDialog-Bp4PHyEI.js → BugReportHistoryDialog-Cf_ZrCjH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{t as l}from"./BugReportHistory-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{t as l}from"./BugReportHistory-DrMLEEP8.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(s,{children:[h,(0,d.jsx)(r,{children:(0,d.jsx)(t,{id:`nGAFeH`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(l,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(a,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(o,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(c,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
|