@vpxa/aikit 0.1.69 → 0.1.71

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.
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{a as n,i as r,n as i,t as a}from"./jsx-runtime-CI8Ofr1S.js";import{t as o}from"./useKBClient-BACLDL_U.js";import{t as s}from"./StatusPanel-yRieSRc3.js";import{t as c}from"./SearchPanel-CDSGcT7M.js";import{t as l}from"./CuratedPanel-DGFKz-fJ.js";import{t as u}from"./LogPanel-DGeptKim.js";var d=e(t()),f=a();const p=[`status`,`search`,`curated`,`log`];function m({client:e}){let[t,a]=(0,d.useState)(`status`);return i((e,n)=>{n.tab&&a(p[(p.indexOf(t)+1)%p.length]),e===`1`&&a(`status`),e===`2`&&a(`search`),e===`3`&&a(`curated`),e===`4`&&a(`log`)}),(0,f.jsx)(o,{value:e,children:(0,f.jsxs)(n,{flexDirection:`column`,width:`100%`,children:[(0,f.jsxs)(n,{borderStyle:`single`,paddingX:1,children:[(0,f.jsx)(r,{bold:!0,color:`cyan`,children:`AI Kit Dashboard`}),(0,f.jsx)(r,{children:` │ `}),p.map(e=>(0,f.jsxs)(d.Fragment,{children:[(0,f.jsxs)(r,{color:e===t?`green`:`gray`,bold:e===t,children:[`[`,p.indexOf(e)+1,`] `,e]}),(0,f.jsx)(r,{children:` `})]},e)),(0,f.jsx)(r,{color:`gray`,children:` │ Tab: switch │ Ctrl+C: quit`})]}),(0,f.jsxs)(n,{flexGrow:1,minHeight:10,children:[t===`status`&&(0,f.jsx)(s,{}),t===`search`&&(0,f.jsx)(c,{}),t===`curated`&&(0,f.jsx)(l,{}),t===`log`&&(0,f.jsx)(u,{})]})]})})}export{m as t};
2
+ import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{a as n,i as r,n as i,t as a}from"./jsx-runtime-CI8Ofr1S.js";import{t as o}from"./useKBClient-BACLDL_U.js";import{t as s}from"./StatusPanel-yRieSRc3.js";import{t as c}from"./SearchPanel-CDSGcT7M.js";import{t as l}from"./CuratedPanel-DGFKz-fJ.js";import{t as u}from"./LogPanel-BrBa5xIT.js";var d=e(t()),f=a();const p=[`status`,`search`,`curated`,`log`];function m({client:e}){let[t,a]=(0,d.useState)(`status`);return i((e,n)=>{n.tab&&a(p[(p.indexOf(t)+1)%p.length]),e===`1`&&a(`status`),e===`2`&&a(`search`),e===`3`&&a(`curated`),e===`4`&&a(`log`)}),(0,f.jsx)(o,{value:e,children:(0,f.jsxs)(n,{flexDirection:`column`,width:`100%`,children:[(0,f.jsxs)(n,{borderStyle:`single`,paddingX:1,children:[(0,f.jsx)(r,{bold:!0,color:`cyan`,children:`AI Kit Dashboard`}),(0,f.jsx)(r,{children:` │ `}),p.map(e=>(0,f.jsxs)(d.Fragment,{children:[(0,f.jsxs)(r,{color:e===t?`green`:`gray`,bold:e===t,children:[`[`,p.indexOf(e)+1,`] `,e]}),(0,f.jsx)(r,{children:` `})]},e)),(0,f.jsx)(r,{color:`gray`,children:` │ Tab: switch │ Ctrl+C: quit`})]}),(0,f.jsxs)(n,{flexGrow:1,minHeight:10,children:[t===`status`&&(0,f.jsx)(s,{}),t===`search`&&(0,f.jsx)(c,{}),t===`curated`&&(0,f.jsx)(l,{}),t===`log`&&(0,f.jsx)(u,{})]})]})})}export{m as t};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import{t as e}from"./App-DobfqTPH.js";export{e as App};
2
+ import{t as e}from"./App-Bkz0lpCn.js";export{e as App};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{a as n,i as r,t as i}from"./jsx-runtime-CI8Ofr1S.js";import{homedir as a}from"node:os";import{exec as o,execFile as s}from"node:child_process";import{appendFileSync as c,closeSync as l,constants as u,existsSync as d,mkdirSync as f,openSync as ee,readFileSync as p,readdirSync as m,renameSync as h,statSync as g,unlinkSync as _,writeFileSync as v}from"node:fs";import{basename as te,dirname as y,join as b,resolve as x}from"node:path";import{createHash as S}from"node:crypto";import{fileURLToPath as C}from"node:url";import{promisify as w}from"node:util";import"diff";import{LRUCache as ne}from"lru-cache";import"gpt-tokenizer/model/gpt-4o";import"turndown";var T=e(t());const E={ai:`.ai`,aiContext:`.ai/context`,aiCurated:`.ai/curated`,restorePoints:`.ai/restore-points`,data:`.aikit-data`,state:`.aikit-state`,logs:`.aikit-state/logs`,brainstorm:`.brainstorm`,handoffs:`.handoffs`},D={root:`.aikit-data`,registry:`registry.json`};E.data;function O(){return process.env.AIKIT_GLOBAL_DATA_DIR??x(a(),D.root)}function k(e){let t=x(e);return`${te(t).toLowerCase().replace(/[^a-z0-9-]/g,`-`)||`workspace`}-${S(`sha256`).update(t).digest(`hex`).slice(0,8)}`}function A(){let e=x(O(),D.registry);if(!d(e))return{version:1,workspaces:{}};let t=p(e,`utf-8`);try{return JSON.parse(t)}catch{return{version:1,workspaces:{}}}}function re(e,t=5e3){let n=`${e}.lock`,r=Date.now()+t,i=10;for(;Date.now()<r;)try{let e=ee(n,u.O_CREAT|u.O_EXCL|u.O_WRONLY);return v(e,`${process.pid}\n`),l(e),n}catch(e){if(e.code!==`EEXIST`)throw e;try{let{mtimeMs:e}=g(n);if(Date.now()-e>3e4){_(n);continue}}catch{}let t=new SharedArrayBuffer(4);Atomics.wait(new Int32Array(t),0,0,i),i=Math.min(i*2,200)}throw Error(`Failed to acquire registry lock after ${t}ms`)}function ie(e){try{_(e)}catch{}}function ae(e){let t=O();f(t,{recursive:!0});let n=x(t,D.registry),r=re(n);try{let t=`${n}.tmp`;v(t,JSON.stringify(e,null,2),`utf-8`),h(t,n)}finally{ie(r)}}function oe(e){let t=A(),n=k(e),r=new Date().toISOString();return t.workspaces[n]?t.workspaces[n].lastAccessedAt=r:t.workspaces[n]={partition:n,workspacePath:x(e),registeredAt:r,lastAccessedAt:r},f(j(n),{recursive:!0}),ae(t),t.workspaces[n]}function j(e){return x(O(),e)}function M(){return d(x(O(),D.registry))}function N(e){return M()?x(j(oe(e).partition),`state`):x(e,E.state)}const P={debug:0,info:1,warn:2,error:3},F=[];let I=process.env.AIKIT_LOG_LEVEL??`info`,L=process.env.AIKIT_LOG_FILE_SINK===`true`||process.env.AIKIT_LOG_FILE_SINK!==`false`&&!process.env.VITEST&&process.env.NODE_ENV!==`test`;function R(){return L?process.env.VITEST||process.env.NODE_ENV===`test`?process.env.AIKIT_LOG_FILE_SINK===`true`:!0:!1}let z;function B(){return z||=b(N(process.cwd()),`logs`),z}function V(e){let t=e.toISOString().slice(0,10);return b(B(),`${t}.jsonl`)}let H=0;function U(){let e=Date.now();if(!(e-H<36e5)){H=e;try{let t=B(),n=new Date(e-30*864e5).toISOString().slice(0,10);for(let e of m(t))if(e.endsWith(`.jsonl`)&&e.slice(0,10)<n)try{_(b(t,e))}catch{}}catch{}}}function W(e,t){try{f(B(),{recursive:!0}),c(V(t),`${e}\n`),U()}catch{}}function G(e){function t(t,n,r){if(P[t]<P[I])return;let i=new Date,a={ts:i.toISOString(),level:t,component:e,msg:n,...r},o=JSON.stringify(a);console.error(o);for(let i of F)try{i({level:t,component:e,message:n,data:r})}catch{}R()&&(t===`warn`||t===`error`)&&W(o,i)}return{debug:(e,n)=>t(`debug`,e,n),info:(e,n)=>t(`info`,e,n),warn:(e,n)=>t(`warn`,e,n),error:(e,n)=>t(`error`,e,n)}}b(y(C(import.meta.url)),`..`,`..`,`wasm`),new Set(Object.keys({".ts":`tree-sitter-typescript.wasm`,".tsx":`tree-sitter-typescript.wasm`,".mts":`tree-sitter-typescript.wasm`,".cts":`tree-sitter-typescript.wasm`,".js":`tree-sitter-javascript.wasm`,".jsx":`tree-sitter-javascript.wasm`,".mjs":`tree-sitter-javascript.wasm`,".cjs":`tree-sitter-javascript.wasm`,".py":`tree-sitter-python.wasm`,".go":`tree-sitter-go.wasm`,".rs":`tree-sitter-rust.wasm`,".java":`tree-sitter-java.wasm`,".kt":`tree-sitter-kotlin.wasm`,".kts":`tree-sitter-kotlin.wasm`,".scala":`tree-sitter-scala.wasm`,".sc":`tree-sitter-scala.wasm`,".c":`tree-sitter-c.wasm`,".h":`tree-sitter-c.wasm`,".cpp":`tree-sitter-cpp.wasm`,".cc":`tree-sitter-cpp.wasm`,".cxx":`tree-sitter-cpp.wasm`,".hpp":`tree-sitter-cpp.wasm`,".hxx":`tree-sitter-cpp.wasm`,".cs":`tree-sitter-c_sharp.wasm`,".swift":`tree-sitter-swift.wasm`,".rb":`tree-sitter-ruby.wasm`,".php":`tree-sitter-php.wasm`}));const K=G(`query-executor`),q=y(C(import.meta.url));function se(){let e=b(q,`..`,`queries`);if(d(e))return e;let t=b(q,`..`,`..`,`src`,`queries`);return d(t)?t:e}const J=se(),ce={".ts":`typescript`,".tsx":`typescript`,".mts":`typescript`,".cts":`typescript`,".js":`javascript`,".jsx":`javascript`,".mjs":`javascript`,".cjs":`javascript`,".py":`python`,".go":`go`,".rs":`rust`,".java":`java`};var Y=class{queryCache=new Map;scmCache=new Map;execute(e,t,n,r){let i=this.getOrCompile(t,n,r);return i?i.matches(e).map(e=>X(e)):[]}executeCaptures(e,t,n,r){let i=this.getOrCompile(t,n,r);return i?i.captures(e).map(e=>Z(e)):[]}executeRaw(e,t,n){return t.query(n).matches(e).map(e=>X(e))}getOrCompile(e,t,n){let r=ce[t];if(!r)return null;let i=`${r}:${n}`,a=this.queryCache.get(i);if(a)return a;let o=this.loadScm(r,n);if(!o)return null;try{let t=e.query(o);return this.queryCache.set(i,t),t}catch(e){throw K.warn(`Failed to compile query`,{langDir:r,queryType:n,error:String(e)}),Error(`Failed to compile ${r}/${n}.scm: ${String(e)}`)}}loadScm(e,t){let n=`${e}:${t}`,r=this.scmCache.get(n);if(r!==void 0)return r;let i=b(J,e,`${t}.scm`);try{let e=p(i,`utf-8`);return this.scmCache.set(n,e),e}catch{return K.info(`Query file not found (graceful skip)`,{langDir:e,queryType:t}),null}}dispose(){this.queryCache.clear(),this.scmCache.clear()}static resolveQueryDir(e){return b(J,e)}};function X(e){let t=new Map;for(let n of e.captures)t.set(n.name,Z(n));return{pattern:e.pattern,captures:t}}function Z(e){let{node:t}=e;return{name:e.name,text:t.text,nodeType:t.type,startLine:t.startPosition.row,endLine:t.endPosition.row,startColumn:t.startPosition.column,endColumn:t.endPosition.column,node:t}}new Y,new Y,new Y,new Y,new Y,new Set(`.ts,.tsx,.js,.jsx,.mjs,.cjs,.java,.kt,.kts,.scala,.py,.go,.rs,.rb,.php,.swift,.cs,.c,.cpp,.h,.hpp,.sh,.bash,.ps1,.sql,.graphql,.gql,.proto,.json,.yaml,.yml,.toml,.env,.ini,.cfg,.xml,.pom,.gradle,.tf,.hcl,.lock,.mjs`.split(`,`)),w(o),new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,E.state]),E.restorePoints,new ne({max:200,ttl:1e3*60*30});const Q=[];function le(e){Q.push(e),Q.sort((e,t)=>t.priority-e.priority)}function ue(e){for(let t of e)le(t)}ue([{name:`git`,toolPatterns:[`git`,`git-status`],priority:10,match(e){return e.tool===`git`||e.tool===`git-status`},compress(e){let t=e.text.split(`
2
+ import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{a as n,i as r,t as i}from"./jsx-runtime-CI8Ofr1S.js";import{homedir as a}from"node:os";import{exec as o,execFile as s}from"node:child_process";import{appendFileSync as c,closeSync as l,constants as u,existsSync as d,mkdirSync as f,openSync as ee,readFileSync as p,readdirSync as m,renameSync as h,statSync as g,unlinkSync as _,writeFileSync as v}from"node:fs";import{basename as te,dirname as y,join as b,resolve as x}from"node:path";import{createHash as S}from"node:crypto";import{fileURLToPath as C}from"node:url";import{promisify as w}from"node:util";import"diff";import{LRUCache as ne}from"lru-cache";import"gpt-tokenizer/model/gpt-4o";import"turndown";var T=e(t());const E={ai:`.ai`,aiContext:`.ai/context`,aiCurated:`.ai/curated`,restorePoints:`.ai/restore-points`,data:`.aikit-data`,state:`.aikit-state`,logs:`.aikit-state/logs`,brainstorm:`.brainstorm`,handoffs:`.handoffs`},D={root:`.aikit-data`,registry:`registry.json`};E.data;function O(){return process.env.AIKIT_GLOBAL_DATA_DIR??x(a(),D.root)}function k(e){let t=x(e);return`${te(t).toLowerCase().replace(/[^a-z0-9-]/g,`-`)||`workspace`}-${S(`sha256`).update(t).digest(`hex`).slice(0,8)}`}function A(){let e=x(O(),D.registry);if(!d(e))return{version:1,workspaces:{}};let t=p(e,`utf-8`);try{return JSON.parse(t)}catch{return{version:1,workspaces:{}}}}function re(e,t=5e3){let n=`${e}.lock`,r=Date.now()+t,i=10;for(;Date.now()<r;)try{let e=ee(n,u.O_CREAT|u.O_EXCL|u.O_WRONLY);return v(e,`${process.pid}\n`),l(e),n}catch(e){if(e.code!==`EEXIST`)throw e;try{let{mtimeMs:e}=g(n);if(Date.now()-e>3e4){_(n);continue}}catch{}let t=new SharedArrayBuffer(4);Atomics.wait(new Int32Array(t),0,0,i),i=Math.min(i*2,200)}throw Error(`Failed to acquire registry lock after ${t}ms`)}function ie(e){try{_(e)}catch{}}function ae(e){let t=O();f(t,{recursive:!0});let n=x(t,D.registry),r=re(n);try{let t=`${n}.tmp`;v(t,JSON.stringify(e,null,2),`utf-8`),h(t,n)}finally{ie(r)}}function oe(e){let t=A(),n=k(e),r=new Date().toISOString();return t.workspaces[n]?t.workspaces[n].lastAccessedAt=r:t.workspaces[n]={partition:n,workspacePath:x(e),registeredAt:r,lastAccessedAt:r},f(j(n),{recursive:!0}),ae(t),t.workspaces[n]}function j(e){return x(O(),e)}function se(){return d(x(O(),D.registry))}function M(e){return se()?x(j(oe(e).partition),`state`):x(e,E.state)}const N={debug:0,info:1,warn:2,error:3},P=[];let F=process.env.AIKIT_LOG_LEVEL??`info`,I=process.env.AIKIT_LOG_FILE_SINK===`true`||process.env.AIKIT_LOG_FILE_SINK!==`false`&&!process.env.VITEST&&process.env.NODE_ENV!==`test`;function L(){return I?process.env.VITEST||process.env.NODE_ENV===`test`?process.env.AIKIT_LOG_FILE_SINK===`true`:!0:!1}let R;function z(){return R||=b(M(process.cwd()),`logs`),R}function B(e){let t=e.toISOString().slice(0,10);return b(z(),`${t}.jsonl`)}let V=0;function H(){let e=Date.now();if(!(e-V<36e5)){V=e;try{let t=z(),n=new Date(e-30*864e5).toISOString().slice(0,10);for(let e of m(t))if(e.endsWith(`.jsonl`)&&e.slice(0,10)<n)try{_(b(t,e))}catch{}}catch{}}}function U(e,t){try{f(z(),{recursive:!0}),c(B(t),`${e}\n`),H()}catch{}}function W(e){function t(t,n,r){if(N[t]<N[F])return;let i=new Date,a={ts:i.toISOString(),level:t,component:e,msg:n,...r},o=JSON.stringify(a);console.error(o);for(let i of P)try{i({level:t,component:e,message:n,data:r})}catch{}L()&&(t===`warn`||t===`error`)&&U(o,i)}return{debug:(e,n)=>t(`debug`,e,n),info:(e,n)=>t(`info`,e,n),warn:(e,n)=>t(`warn`,e,n),error:(e,n)=>t(`error`,e,n)}}const G=y(C(import.meta.url));function ce(){let e=[b(G,`..`,`..`,`wasm`),b(G,`..`,`wasm`)];for(let t of e)if(d(b(t,`tree-sitter.wasm`)))return t;return e[0]}ce(),new Set(Object.keys({".ts":`tree-sitter-typescript.wasm`,".tsx":`tree-sitter-typescript.wasm`,".mts":`tree-sitter-typescript.wasm`,".cts":`tree-sitter-typescript.wasm`,".js":`tree-sitter-javascript.wasm`,".jsx":`tree-sitter-javascript.wasm`,".mjs":`tree-sitter-javascript.wasm`,".cjs":`tree-sitter-javascript.wasm`,".py":`tree-sitter-python.wasm`,".go":`tree-sitter-go.wasm`,".rs":`tree-sitter-rust.wasm`,".java":`tree-sitter-java.wasm`,".kt":`tree-sitter-kotlin.wasm`,".kts":`tree-sitter-kotlin.wasm`,".scala":`tree-sitter-scala.wasm`,".sc":`tree-sitter-scala.wasm`,".c":`tree-sitter-c.wasm`,".h":`tree-sitter-c.wasm`,".cpp":`tree-sitter-cpp.wasm`,".cc":`tree-sitter-cpp.wasm`,".cxx":`tree-sitter-cpp.wasm`,".hpp":`tree-sitter-cpp.wasm`,".hxx":`tree-sitter-cpp.wasm`,".cs":`tree-sitter-c_sharp.wasm`,".swift":`tree-sitter-swift.wasm`,".rb":`tree-sitter-ruby.wasm`,".php":`tree-sitter-php.wasm`}));const K=W(`query-executor`),q=y(C(import.meta.url));function le(){let e=b(q,`..`,`queries`);if(d(e))return e;let t=b(q,`..`,`..`,`src`,`queries`);return d(t)?t:e}const J=le(),ue={".ts":`typescript`,".tsx":`typescript`,".mts":`typescript`,".cts":`typescript`,".js":`javascript`,".jsx":`javascript`,".mjs":`javascript`,".cjs":`javascript`,".py":`python`,".go":`go`,".rs":`rust`,".java":`java`};var Y=class{queryCache=new Map;scmCache=new Map;execute(e,t,n,r){let i=this.getOrCompile(t,n,r);return i?i.matches(e).map(e=>X(e)):[]}executeCaptures(e,t,n,r){let i=this.getOrCompile(t,n,r);return i?i.captures(e).map(e=>Z(e)):[]}executeRaw(e,t,n){return t.query(n).matches(e).map(e=>X(e))}getOrCompile(e,t,n){let r=ue[t];if(!r)return null;let i=`${r}:${n}`,a=this.queryCache.get(i);if(a)return a;let o=this.loadScm(r,n);if(!o)return null;try{let t=e.query(o);return this.queryCache.set(i,t),t}catch(e){throw K.warn(`Failed to compile query`,{langDir:r,queryType:n,error:String(e)}),Error(`Failed to compile ${r}/${n}.scm: ${String(e)}`)}}loadScm(e,t){let n=`${e}:${t}`,r=this.scmCache.get(n);if(r!==void 0)return r;let i=b(J,e,`${t}.scm`);try{let e=p(i,`utf-8`);return this.scmCache.set(n,e),e}catch{return K.info(`Query file not found (graceful skip)`,{langDir:e,queryType:t}),null}}dispose(){this.queryCache.clear(),this.scmCache.clear()}static resolveQueryDir(e){return b(J,e)}};function X(e){let t=new Map;for(let n of e.captures)t.set(n.name,Z(n));return{pattern:e.pattern,captures:t}}function Z(e){let{node:t}=e;return{name:e.name,text:t.text,nodeType:t.type,startLine:t.startPosition.row,endLine:t.endPosition.row,startColumn:t.startPosition.column,endColumn:t.endPosition.column,node:t}}new Y,new Y,new Y,new Y,new Y,new Set(`.ts,.tsx,.js,.jsx,.mjs,.cjs,.java,.kt,.kts,.scala,.py,.go,.rs,.rb,.php,.swift,.cs,.c,.cpp,.h,.hpp,.sh,.bash,.ps1,.sql,.graphql,.gql,.proto,.json,.yaml,.yml,.toml,.env,.ini,.cfg,.xml,.pom,.gradle,.tf,.hcl,.lock,.mjs`.split(`,`)),w(o),new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,E.state]),E.restorePoints,new ne({max:200,ttl:1e3*60*30});const Q=[];function de(e){Q.push(e),Q.sort((e,t)=>t.priority-e.priority)}function fe(e){for(let t of e)de(t)}fe([{name:`git`,toolPatterns:[`git`,`git-status`],priority:10,match(e){return e.tool===`git`||e.tool===`git-status`},compress(e){let t=e.text.split(`
3
3
  `),n=[],r=!1,i=0,a=0,o=``;for(let s of t){if(s.startsWith(`diff --git`)||s.startsWith(`---`)||s.startsWith(`+++`)){r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines in ${o}]`),r=!1,i=0,a=0,n.push(s),s.startsWith(`diff --git`)&&(o=s.replace(/^diff --git a\/\S+ b\//,``));continue}if(s.startsWith(`@@`)){r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines]`),r=!0,i=0,a=0,n.push(s);continue}if(e.tool===`git-status`){n.push(s);continue}if(r){s.startsWith(`+`)?i++:s.startsWith(`-`)&&a++;continue}if(s.startsWith(`commit `)||s.startsWith(`Author:`)||s.startsWith(`Date:`)||s.startsWith(`On branch`)||s.match(/^\s*\d+ file/)||s.match(/insertion|deletion/)){n.push(s);continue}if(s.startsWith(`error:`)||s.startsWith(`fatal:`)||s.startsWith(`warning:`)){n.push(s);continue}/^\s{4}\S/.test(s)&&n.push(s)}return r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines in ${o}]`),n.join(`
4
4
  `)}},{name:`npm`,toolPatterns:[`npm`,`pnpm`,`yarn`],priority:10,match(e){return e.tool===`npm`||e.tool===`pnpm`},compress(e){let t=e.text.split(`
5
5
  `),n=[],r=0,i=0,a=[];for(let e of t){if(e.includes(`ERR!`)||e.startsWith(`npm error`)||e.includes(`ERESOLVE`)){a.push(e);continue}if(e.includes(`npm warn`)||e.includes(`WARN`)){r++,r<=3&&n.push(e);continue}if(e.includes(`notice`)){i++;continue}if(!(e.includes(`timing`)||e.includes(`http fetch`)||/^\s*$/.test(e))){if(e.match(/^(added|removed|changed|up to date|audited|found \d+)/)){n.push(e);continue}if(e.match(/^(Packages:|Progress:|Done in|dependencies:)/)){n.push(e);continue}e.match(/^(>|\$)\s/)&&n.push(e)}}return r>3&&n.push(`[${r-3} more warnings]`),i>0&&n.push(`[${i} notices]`),a.length>0&&(n.unshift(`=== ERRORS ===`),n.splice(1,0,...a)),n.join(`
@@ -13,5 +13,5 @@ import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";impor
13
13
  `),n=[],r=0;for(let e of t){if(e.match(/^(NAME|NAMESPACE|LAST SEEN|TYPE)\s+/)){n.push(e);continue}if(e.match(/\b(Warning|Error|Failed|CrashLoopBackOff|OOMKilled|Evicted|Pending)\b/i)){n.push(e);continue}if(e.match(/^\S+\s+\d+\/\d+\s+(Running|Error|CrashLoop|Pending|Completed|Terminating)/)){n.push(e);continue}if(e.match(/^\d+[smhd]\s+.*Normal\s/)){r++;continue}e.match(/^\S+\s+/)&&e.trim().length>0&&n.push(e)}return r>0&&n.push(`[${r} normal events]`),n.join(`
14
14
  `)}},{name:`generic`,toolPatterns:[/.*/],priority:0,match(e){return e.tool===`unknown`||!e.tool},compress(e){let t=e.text.split(`
15
15
  `),n=[],r=``,i=0,a=0;for(let e of t){let t=e.trim();if(t===``){a++,a<=1&&n.push(``);continue}if(a=0,t===r.trim()){i++;continue}i>0&&(n.push(` [repeated ${i} more times]`),i=0),r=e,n.push(e)}return i>0&&n.push(` [repeated ${i} more times]`),n.join(`
16
- `)}}]),new Set([`.git`,E.data,E.state,`.turbo`,`.yarn`,`build`,`coverage`,`dist`,`node_modules`]),w(s),new Set(`if_statement.for_statement.for_in_statement.while_statement.do_statement.switch_case.catch_clause.ternary_expression.if_statement.for_statement.while_statement.except_clause.list_comprehension.if_statement.for_statement.enhanced_for_statement.while_statement.catch_clause.ternary_expression.if_statement.for_statement.select_statement.if_expression.for_expression.while_expression.match_arm`.split(`.`));function de(){return x(N(process.cwd()),`replay.jsonl`)}function fe(e={}){let t=de(),n;try{n=p(t,`utf-8`)}catch{return[]}let r=n.trim().split(`
17
- `).filter(Boolean),i=[];for(let e of r)try{i.push(JSON.parse(e))}catch{}if(e.tool&&(i=i.filter(t=>t.tool===e.tool)),e.source&&(i=i.filter(t=>t.source===e.source)),e.since){let t=e.since;i=i.filter(e=>e.ts>=t)}let a=e.last??20;return i.slice(-a)}w(o),E.data,`script,style,noscript,iframe,svg,nav,footer,header,aside,form,button,input,select,textarea,[role="navigation"],[role="banner"],[role="contentinfo"],[aria-hidden="true"],.sidebar,.nav,.menu,.footer,.header,.ad,.advertisement,.cookie-banner,.popup,.modal`.split(`,`);var $=i();function pe(){let[e,t]=(0,T.useState)([]);return(0,T.useEffect)(()=>{let e=()=>{t(fe({last:30}))};e();let n=setInterval(e,2e3);return()=>clearInterval(n)},[]),(0,$.jsxs)(n,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,$.jsx)(r,{bold:!0,color:`cyan`,children:`Activity Log`}),(0,$.jsx)(r,{children:` `}),e.length===0&&(0,$.jsx)(r,{color:`gray`,children:`No activity recorded yet`}),e.slice().reverse().map((e,t)=>{let n=e.ts.split(`T`)[1]?.split(`.`)[0]??e.ts,i=e.status===`ok`?`green`:`red`;return(0,$.jsxs)(r,{children:[(0,$.jsx)(r,{color:`gray`,children:n}),` `,(0,$.jsx)(r,{color:i,children:e.status===`ok`?`✓`:`✗`}),` `,(0,$.jsx)(r,{bold:!0,children:e.tool}),` `,(0,$.jsxs)(r,{color:`gray`,children:[`(`,e.durationMs,`ms)`]})]},`${e.ts}-${t}`)}),(0,$.jsx)(r,{children:` `}),(0,$.jsx)(r,{color:`gray`,children:`Refreshes every 2s │ Showing last 30`})]})}export{pe as t};
16
+ `)}}]),new Set([`.git`,E.data,E.state,`.turbo`,`.yarn`,`build`,`coverage`,`dist`,`node_modules`]),w(s),new Set(`if_statement.for_statement.for_in_statement.while_statement.do_statement.switch_case.catch_clause.ternary_expression.if_statement.for_statement.while_statement.except_clause.list_comprehension.if_statement.for_statement.enhanced_for_statement.while_statement.catch_clause.ternary_expression.if_statement.for_statement.select_statement.if_expression.for_expression.while_expression.match_arm`.split(`.`));function pe(){return x(M(process.cwd()),`replay.jsonl`)}function me(e={}){let t=pe(),n;try{n=p(t,`utf-8`)}catch{return[]}let r=n.trim().split(`
17
+ `).filter(Boolean),i=[];for(let e of r)try{i.push(JSON.parse(e))}catch{}if(e.tool&&(i=i.filter(t=>t.tool===e.tool)),e.source&&(i=i.filter(t=>t.source===e.source)),e.since){let t=e.since;i=i.filter(e=>e.ts>=t)}let a=e.last??20;return i.slice(-a)}w(o),E.data,`script,style,noscript,iframe,svg,nav,footer,header,aside,form,button,input,select,textarea,[role="navigation"],[role="banner"],[role="contentinfo"],[aria-hidden="true"],.sidebar,.nav,.menu,.footer,.header,.ad,.advertisement,.cookie-banner,.popup,.modal`.split(`,`);var $=i();function he(){let[e,t]=(0,T.useState)([]);return(0,T.useEffect)(()=>{let e=()=>{t(me({last:30}))};e();let n=setInterval(e,2e3);return()=>clearInterval(n)},[]),(0,$.jsxs)(n,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,$.jsx)(r,{bold:!0,color:`cyan`,children:`Activity Log`}),(0,$.jsx)(r,{children:` `}),e.length===0&&(0,$.jsx)(r,{color:`gray`,children:`No activity recorded yet`}),e.slice().reverse().map((e,t)=>{let n=e.ts.split(`T`)[1]?.split(`.`)[0]??e.ts,i=e.status===`ok`?`green`:`red`;return(0,$.jsxs)(r,{children:[(0,$.jsx)(r,{color:`gray`,children:n}),` `,(0,$.jsx)(r,{color:i,children:e.status===`ok`?`✓`:`✗`}),` `,(0,$.jsx)(r,{bold:!0,children:e.tool}),` `,(0,$.jsxs)(r,{color:`gray`,children:[`(`,e.durationMs,`ms)`]})]},`${e.ts}-${t}`)}),(0,$.jsx)(r,{children:` `}),(0,$.jsx)(r,{color:`gray`,children:`Refreshes every 2s │ Showing last 30`})]})}export{he as t};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{r as n}from"./jsx-runtime-CI8Ofr1S.js";import{t as r}from"./App-DobfqTPH.js";var i=e(t());function a(e){n(i.createElement(r,{client:e}))}export{a as launch};
2
+ import{r as e}from"./chunk-DqSKhezp.js";import{t}from"./react-CKRDn6y3.js";import{r as n}from"./jsx-runtime-CI8Ofr1S.js";import{t as r}from"./App-Bkz0lpCn.js";var i=e(t());function a(e){n(i.createElement(r,{client:e}))}export{a as launch};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import{t as e}from"../LogPanel-DGeptKim.js";export{e as LogPanel};
2
+ import{t as e}from"../LogPanel-BrBa5xIT.js";export{e as LogPanel};