@wrongstack/webui 0.141.0 → 0.148.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/assets/{index-uotGTlIy.js → index-DZfZgZld.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +1 -0
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -62,7 +62,7 @@ _disabled (config.features.skills = false)_`});return}let n=[`🎯 **Skills** ($
|
|
|
62
62
|
Exported ${new Date().toISOString()}${t.session?.provider?` · ${escape(t.session.provider)}/${escape(t.session.model)}`:``} · ${e.length} message${e.length===1?``:`s`}
|
|
63
63
|
</div>
|
|
64
64
|
${i.join(``)}
|
|
65
|
-
</body></html>`,o=new Blob([a],{type:`text/html;charset=utf-8`}),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=`wrongstack-chat-${n}.html`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(s)}function vr(){let e=K(e=>e.paletteOpen),t=K(e=>e.setPaletteOpen),n=K(e=>e.setCurrentView),r=W(e=>e.setTheme),{entries:i}=Gt(),{addMessage:a,clearMessages:o}=U(),s=Y(),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(0),g=(0,V.useRef)(null);(0,V.useEffect)(()=>{e&&(d(``),p(0),requestAnimationFrame(()=>g.current?.focus()))},[e]),(0,V.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),t(!K.getState().paletteOpen);return}e.key===`Escape`&&K.getState().paletteOpen&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let _=(0,V.useMemo)(()=>{let e=[{id:`help`,category:`Command`,label:`Show slash commands`,icon:yt,keywords:[`help`,`commands`,`?`],run:()=>{a({role:`assistant`,content:"Type `/` in the message box to see every slash command."})}},{id:`tools`,category:`Command`,label:`List tools`,icon:vt,keywords:[`tools`,`list`],run:()=>s.listTools()},{id:`memory`,category:`Command`,label:`Show memory`,icon:N,keywords:[`memory`,`remember`,`notes`],run:()=>s.listMemory()},{id:`skills`,category:`Command`,label:`List skills`,icon:le,keywords:[`skills`],run:()=>s.listSkills()},{id:`diag`,category:`Command`,label:`Runtime diagnostics`,icon:re,keywords:[`diag`,`diagnostics`,`debug`],run:()=>s.getDiag()},{id:`stats`,category:`Command`,label:`Session stats (tokens, cache, cost)`,icon:fe,keywords:[`stats`,`tokens`,`cost`,`cache`],run:()=>s.getStats()},{id:`clear`,category:`Session`,label:`Clear context`,hint:`Wipe in-memory context, keep session id`,icon:M,keywords:[`clear`,`reset`,`wipe`],run:()=>{o(),s.client?.clearContext?.()}},{id:`new`,category:`Session`,label:`New session`,hint:`Brand-new on disk + memory`,icon:x,keywords:[`new`,`fresh`,`session`],run:()=>s.client?.newSession?.()},{id:`compact`,category:`Session`,label:`Compact context`,icon:b,keywords:[`compact`,`shrink`,`context`],run:()=>s.client?.compactContext?.()},{id:`repair-context`,category:`Session`,label:`Repair context`,hint:`Remove orphan tool protocol blocks`,icon:vt,keywords:[`repair`,`context`,`tool_use`,`tool_result`],run:()=>s.client?.repairContext?.()},{id:`export`,category:`Session`,label:`Export chat as markdown`,icon:m,keywords:[`export`,`save`,`markdown`,`download`],run:()=>gr()},{id:`export-html`,category:`Session`,label:`Export chat as HTML`,hint:`Self-contained, opens in any browser`,icon:m,keywords:[`export`,`html`,`download`,`archive`],run:()=>_r()},{id:`history`,category:`Command`,label:`Open history`,icon:c,keywords:[`history`,`sessions`],run:()=>n(`history`)},{id:`settings`,category:`Command`,label:`Open settings`,icon:h,keywords:[`settings`,`config`],run:()=>n(`settings`)},{id:`model`,category:`Command`,label:`Change provider/model`,icon:T,keywords:[`model`,`provider`,`change`],run:()=>n(`settings`)},{id:`theme-light`,category:`Theme`,label:`Theme: Light`,icon:w,keywords:[`theme`,`light`,`mode`],run:()=>r(`light`)},{id:`theme-dark`,category:`Theme`,label:`Theme: Dark`,icon:Te,keywords:[`theme`,`dark`,`mode`],run:()=>r(`dark`)},{id:`theme-system`,category:`Theme`,label:`Theme: Follow system`,icon:Ge,keywords:[`theme`,`system`,`auto`],run:()=>r(`system`)},{id:`compact-toggle`,category:`Command`,label:`Toggle compact density`,icon:tt,hint:`Ctrl+Shift+D`,keywords:[`compact`,`dense`,`density`,`size`],run:()=>K.getState().toggleCompactMode()},{id:`sound-toggle`,category:`Command`,label:W.getState().soundOnComplete?`Sound on completion: ON — turn off`:`Sound on completion: OFF — turn on`,icon:W.getState().soundOnComplete?A:l,hint:`Chime when a run finishes`,keywords:[`sound`,`audio`,`chime`,`notify`,`beep`],run:()=>{let e=!W.getState().soundOnComplete;W.getState().setSoundOnComplete(e),e&&ln()}}];for(let t of i.slice(0,10))t.isCurrent||e.push({id:`resume-${t.id}`,category:`Session`,label:`Resume: ${t.title||`(empty)`}`,hint:`${t.provider}/${t.model}`,icon:Re,keywords:[`resume`,t.title,t.id,t.provider,t.model],run:()=>s.resumeSession(t.id)});return e},[i,s,n,r,a,o]),v=(0,V.useMemo)(()=>{let e=u.toLowerCase().trim();return e?_.filter(t=>[t.label,t.hint??``,t.category,...t.keywords??[]].join(` `).toLowerCase().includes(e)):_},[_,u]);if((0,V.useEffect)(()=>{f>=v.length&&p(0)},[v.length,f]),!e)return null;let y=e=>{e&&(t(!1),e.run())};return(0,J.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/60 backdrop-blur-sm flex items-start justify-center pt-[14vh] px-4`,onClick:()=>t(!1),onKeyDown:e=>{e.key===`Escape`&&t(!1)},children:(0,J.jsxs)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`w-full max-w-2xl rounded-xl border bg-popover shadow-2xl overflow-hidden flex flex-col`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b`,children:[(0,J.jsx)(nt,{className:`h-4 w-4 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:g,value:u,onChange:e=>d(e.target.value),placeholder:`Search commands, sessions, settings…`,className:`flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),p(e=>(e+1)%Math.max(1,v.length))):e.key===`ArrowUp`?(e.preventDefault(),p(e=>(e-1+Math.max(1,v.length))%Math.max(1,v.length))):e.key===`Enter`&&(e.preventDefault(),y(v[f]))}}),(0,J.jsx)(`kbd`,{className:`text-[10px] text-muted-foreground border rounded px-1.5 py-0.5`,children:`Esc`})]}),(0,J.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto`,children:v.length===0?(0,J.jsxs)(`div`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:[`No matches for "`,u,`"`]}):yr(v,f,y,p)}),(0,J.jsxs)(`div`,{className:`border-t px-4 py-2 text-[10px] uppercase tracking-wider text-muted-foreground flex items-center gap-3`,children:[(0,J.jsx)(`span`,{children:`↑↓ navigate`}),(0,J.jsx)(`span`,{children:`↵ select`}),(0,J.jsx)(`span`,{children:`Esc dismiss`})]})]})})}function yr(e,t,n,r){let i={};return e.forEach((e,t)=>{i[e.category]||(i[e.category]=[]),i[e.category]?.push({item:e,globalIdx:t})}),(0,J.jsx)(`div`,{className:`p-1`,children:Object.entries(i).map(([e,i])=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`px-3 pt-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),i.map(({item:e,globalIdx:i})=>{let a=e.icon,o=i===t;return(0,J.jsxs)(`button`,{type:`button`,onMouseEnter:()=>r(i),onClick:()=>n(e),className:q(`w-full flex items-center gap-3 px-3 py-2 rounded text-left text-sm transition-colors`,o?`bg-accent text-accent-foreground`:`hover:bg-accent/40`),children:[(0,J.jsx)(a,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,J.jsx)(`div`,{className:`truncate`,children:e.label}),e.hint&&(0,J.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.hint})]}),o&&(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`↵`})]},e.id)})]},e))})}function br({query:e,onPick:t,onClose:n}){let r=Y(),a=W(e=>e.wsUrl),[o,s]=(0,V.useState)([]),[c,l]=(0,V.useState)(0),u=(0,V.useRef)(null),d=(0,V.useRef)(null);return(0,V.useEffect)(()=>{let e=H(a).on(`files.list`,e=>{let t=e.payload;s(t.files??[]),l(0),d.current?.resolve(t.files??[]),d.current=null});return()=>e()},[a]),(0,V.useEffect)(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{r.client.listFiles(e,50)},80),()=>{u.current&&clearTimeout(u.current)}),[e,r.client]),(0,V.useEffect)(()=>{let e=e=>{if(e.key===`ArrowDown`)e.preventDefault(),l(e=>(e+1)%Math.max(1,o.length));else if(e.key===`ArrowUp`)e.preventDefault(),l(e=>(e-1+Math.max(1,o.length))%Math.max(1,o.length));else if(e.key===`Enter`||e.key===`Tab`){if(o.length===0)return;e.preventDefault(),t(B(o[c]))}else e.key===`Escape`&&(e.preventDefault(),n())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[o,c,t,n]),(0,J.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 mb-2 rounded-lg border bg-popover shadow-md p-1 text-sm max-h-72 overflow-auto`,children:[(0,J.jsxs)(`div`,{className:`px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground border-b mb-1 flex items-center justify-between`,children:[(0,J.jsxs)(`span`,{children:[`@ Files `,e&&`· "${e}"`]}),(0,J.jsx)(`span`,{children:`↑/↓ select · ↵ insert · Esc dismiss`})]}),o.length===0?(0,J.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground italic`,children:e?`No files match "${e}"`:`Searching project…`}):o.map((e,n)=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(e),onMouseEnter:()=>l(n),className:q(`w-full text-left px-3 py-1.5 rounded transition-colors flex items-center gap-2 font-mono text-xs`,n===c?`bg-accent text-accent-foreground`:`hover:bg-accent/40`),children:[e.includes(`/`)?(0,J.jsx)(j,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,J.jsx)(i,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,J.jsx)(`span`,{className:`truncate`,children:e})]},e))]})}var xr=[{name:`/abort`,category:`Run`,aliases:[`/stop`],description:`Abort the current run`},{name:`/new`,category:`Session`,description:`Start a brand-new session (fresh on disk and in memory)`},{name:`/clear`,category:`Session`,description:`Wipe current context (keeps session id, disk record stays)`},{name:`/compact`,category:`Session`,description:`Shrink context — elide ancient tool output`},{name:`/repair`,category:`Session`,description:`Repair orphan tool_use/tool_result blocks in context`},{name:`/save`,category:`Session`,description:`Force-flush the session (auto-saved already)`},{name:`/load`,category:`Session`,aliases:[`/resume`],description:`Resume a previous session from disk`},{name:`/prune`,category:`Session`,description:`Delete old sessions (default older than 30 days)`},{name:`/export`,category:`Session`,description:`Download the current chat as markdown`},{name:`/debug`,category:`Inspect`,aliases:[`/context`],description:`Per-section context size breakdown`},{name:`/tools`,category:`Inspect`,description:`List every registered tool the model can call`},{name:`/memory`,category:`Inspect`,description:`Manage memory: show, remember, forget, clear, compact, stats`},{name:`/skill`,category:`Inspect`,aliases:[`/skills`],description:`List active skills`},{name:`/diag`,category:`Inspect`,description:`Runtime diagnostics (provider, tools, features, mode, usage)`},{name:`/stats`,category:`Inspect`,description:`Session stats: tokens, cache hit ratio, cost, elapsed`},{name:`/todos`,category:`Inspect`,description:"List current todos (try `/todos clear` to reset)"},{name:`/codebase-reindex`,category:`Inspect`,aliases:[`/reindex`],description:`Rebuild the codebase symbol index`},{name:`/spawn`,category:`Agent`,description:`Spawn an isolated subagent to handle a task`},{name:`/agents`,category:`Agent`,description:`Show status of spawned subagents`},{name:`/fleet`,category:`Agent`,description:`Inspect and control the agent fleet`},{name:`/director`,category:`Agent`,description:`Promote to director mode at runtime`},{name:`/autonomy`,category:`Agent`,description:`Toggle or query autonomy mode (self-driving agent)`},{name:`/goal`,category:`Agent`,description:`Set, inspect, or clear the autonomous mission`},{name:`/autophase`,category:`Agent`,description:`Autonomous phase-based workflow with subagents`},{name:`/fix`,category:`Agent`,description:`Diagnose and fix a reported error or bug`},{name:`/sdd`,category:`Agent`,description:`AI-driven Specification-Driven Development workflow`},{name:`/btw`,category:`Agent`,description:`Drop a mid-run note without interrupting the agent`},{name:`/collab`,category:`Agent`,description:`Live collaboration helpers (status / invite / history)`},{name:`/settings`,category:`Config`,aliases:[`/model`],description:`Open settings (provider/model/keys)`},{name:`/setmodel`,category:`Config`,description:`Quick-switch the active provider/model`},{name:`/models`,category:`Config`,description:`List available providers and models`},{name:`/mode`,category:`Config`,description:`Switch the active mode (persona/skill set)`},{name:`/yolo`,category:`Config`,description:`Toggle or query YOLO (auto-approve) mode`},{name:`/next`,category:`Config`,description:`Toggle next-task prediction after each turn`},{name:`/enhance`,category:`Config`,description:`Toggle prompt refinement before sending`},{name:`/mcp`,category:`Config`,aliases:[`/mcp-servers`],description:`Manage MCP servers`},{name:`/plugin`,category:`Config`,aliases:[`/plugins`],description:`Manage plugins`},{name:`/statusline`,category:`Config`,aliases:[`/sl`],description:`Customize status bar chips`},{name:`/telegram-setup`,category:`Config`,aliases:[`/tg-setup`],description:`Configure Telegram bot token and chat`},{name:`/init`,category:`Config`,description:`Create or update .wrongstack/AGENTS.md project context`},{name:`/worktree`,category:`Config`,aliases:[`/wt`],description:`Inspect/manage git worktrees for AutoPhase`},{name:`/help`,category:`App`,description:`Show every slash command and what it does`},{name:`/exit`,category:`App`,description:`Exit the current session`}],Sr=[`Run`,`Session`,`Inspect`,`Agent`,`Config`,`App`];function Cr(e){let t=e.toLowerCase();return t===`/`||t===``?xr:xr.filter(e=>e.name.startsWith(t)||(e.aliases?.some(e=>e.startsWith(t))??!1))}function wr(e,t){let n=t-1;for(;n>=0;){let r=B(e[n]);if(r===`@`){let r=n>0?e[n-1]:``;return n===0||/\s/.test(r??``)?{start:n,query:e.slice(n+1,t)}:null}if(/\s/.test(r))return null;n--}return null}function Tr(){let{isLoading:e,setLoading:t,addMessage:n,clearMessages:r}=U(),i=U(e=>e.queue),o=U(e=>e.enqueue),s=U(e=>e.removeQueued),c=U(e=>e.clearQueue),{setCurrentView:l}=K(),u=K(e=>e.pushPrompt),d=K(e=>e.promptHistory),f=Y(),{sendMessage:p,sendAbort:m,client:h}=f,g=G(e=>e.lastInputTokens),_=G(e=>e.maxContext),[v,y]=(0,V.useState)(``),[b,x]=(0,V.useState)(0),[S,C]=(0,V.useState)(-1),[w,T]=(0,V.useState)(null),[E,D]=(0,V.useState)(null),[O,k]=(0,V.useState)(!1),A=(0,V.useRef)(null),j=(0,V.useCallback)(e=>{let i=e.trim(),a=i.indexOf(` `),o=(a===-1?i:i.slice(0,a)).toLowerCase(),s=a===-1?``:i.slice(a+1).trim(),c=o;switch(c){case`/help`:return n({role:`assistant`,content:[`📖 **Slash commands**`,``,...xr.map(e=>`• \`${e.name}\`${e.aliases?.length?` (${e.aliases.map(e=>`\`${e}\``).join(`, `)})`:``} — ${e.description}`)].join(`
|
|
65
|
+
</body></html>`,o=new Blob([a],{type:`text/html;charset=utf-8`}),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=`wrongstack-chat-${n}.html`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(s)}function vr(){let e=K(e=>e.paletteOpen),t=K(e=>e.setPaletteOpen),n=K(e=>e.setCurrentView),r=W(e=>e.setTheme),{entries:i}=Gt(),{addMessage:a,clearMessages:o}=U(),s=Y(),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(0),g=(0,V.useRef)(null);(0,V.useEffect)(()=>{e&&(d(``),p(0),requestAnimationFrame(()=>g.current?.focus()))},[e]),(0,V.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),t(!K.getState().paletteOpen);return}e.key===`Escape`&&K.getState().paletteOpen&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let _=(0,V.useMemo)(()=>{let e=[{id:`help`,category:`Command`,label:`Show slash commands`,icon:yt,keywords:[`help`,`commands`,`?`],run:()=>{a({role:`assistant`,content:"Type `/` in the message box to see every slash command."})}},{id:`tools`,category:`Command`,label:`List tools`,icon:vt,keywords:[`tools`,`list`],run:()=>s.listTools()},{id:`memory`,category:`Command`,label:`Show memory`,icon:N,keywords:[`memory`,`remember`,`notes`],run:()=>s.listMemory()},{id:`skills`,category:`Command`,label:`List skills`,icon:le,keywords:[`skills`],run:()=>s.listSkills()},{id:`diag`,category:`Command`,label:`Runtime diagnostics`,icon:re,keywords:[`diag`,`diagnostics`,`debug`],run:()=>s.getDiag()},{id:`stats`,category:`Command`,label:`Session stats (tokens, cache, cost)`,icon:fe,keywords:[`stats`,`tokens`,`cost`,`cache`],run:()=>s.getStats()},{id:`clear`,category:`Session`,label:`Clear context`,hint:`Wipe in-memory context, keep session id`,icon:M,keywords:[`clear`,`reset`,`wipe`],run:()=>{o(),s.client?.clearContext?.()}},{id:`new`,category:`Session`,label:`New session`,hint:`Brand-new on disk + memory`,icon:x,keywords:[`new`,`fresh`,`session`],run:()=>s.client?.newSession?.()},{id:`compact`,category:`Session`,label:`Compact context`,icon:b,keywords:[`compact`,`shrink`,`context`],run:()=>s.client?.compactContext?.()},{id:`repair-context`,category:`Session`,label:`Repair context`,hint:`Remove orphan tool protocol blocks`,icon:vt,keywords:[`repair`,`context`,`tool_use`,`tool_result`],run:()=>s.client?.repairContext?.()},{id:`export`,category:`Session`,label:`Export chat as markdown`,icon:m,keywords:[`export`,`save`,`markdown`,`download`],run:()=>gr()},{id:`export-html`,category:`Session`,label:`Export chat as HTML`,hint:`Self-contained, opens in any browser`,icon:m,keywords:[`export`,`html`,`download`,`archive`],run:()=>_r()},{id:`history`,category:`Command`,label:`Open history`,icon:c,keywords:[`history`,`sessions`],run:()=>n(`history`)},{id:`settings`,category:`Command`,label:`Open settings`,icon:h,keywords:[`settings`,`config`],run:()=>n(`settings`)},{id:`model`,category:`Command`,label:`Change provider/model`,icon:T,keywords:[`model`,`provider`,`change`],run:()=>n(`settings`)},{id:`theme-light`,category:`Theme`,label:`Theme: Light`,icon:w,keywords:[`theme`,`light`,`mode`],run:()=>r(`light`)},{id:`theme-dark`,category:`Theme`,label:`Theme: Dark`,icon:Te,keywords:[`theme`,`dark`,`mode`],run:()=>r(`dark`)},{id:`theme-system`,category:`Theme`,label:`Theme: Follow system`,icon:Ge,keywords:[`theme`,`system`,`auto`],run:()=>r(`system`)},{id:`compact-toggle`,category:`Command`,label:`Toggle compact density`,icon:tt,hint:`Ctrl+Shift+D`,keywords:[`compact`,`dense`,`density`,`size`],run:()=>K.getState().toggleCompactMode()},{id:`sound-toggle`,category:`Command`,label:W.getState().soundOnComplete?`Sound on completion: ON — turn off`:`Sound on completion: OFF — turn on`,icon:W.getState().soundOnComplete?A:l,hint:`Chime when a run finishes`,keywords:[`sound`,`audio`,`chime`,`notify`,`beep`],run:()=>{let e=!W.getState().soundOnComplete;W.getState().setSoundOnComplete(e),e&&ln()}}];for(let t of i.slice(0,10))t.isCurrent||e.push({id:`resume-${t.id}`,category:`Session`,label:`Resume: ${t.title||`(empty)`}`,hint:`${t.provider}/${t.model}`,icon:Re,keywords:[`resume`,t.title,t.id,t.provider,t.model],run:()=>s.resumeSession(t.id)});return e},[i,s,n,r,a,o]),v=(0,V.useMemo)(()=>{let e=u.toLowerCase().trim();return e?_.filter(t=>[t.label,t.hint??``,t.category,...t.keywords??[]].join(` `).toLowerCase().includes(e)):_},[_,u]);if((0,V.useEffect)(()=>{f>=v.length&&p(0)},[v.length,f]),!e)return null;let y=e=>{e&&(t(!1),e.run())};return(0,J.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/60 backdrop-blur-sm flex items-start justify-center pt-[14vh] px-4`,onClick:()=>t(!1),onKeyDown:e=>{e.key===`Escape`&&t(!1)},children:(0,J.jsxs)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`w-full max-w-2xl rounded-xl border bg-popover shadow-2xl overflow-hidden flex flex-col`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b`,children:[(0,J.jsx)(nt,{className:`h-4 w-4 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:g,value:u,onChange:e=>d(e.target.value),placeholder:`Search commands, sessions, settings…`,className:`flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),p(e=>(e+1)%Math.max(1,v.length))):e.key===`ArrowUp`?(e.preventDefault(),p(e=>(e-1+Math.max(1,v.length))%Math.max(1,v.length))):e.key===`Enter`&&(e.preventDefault(),y(v[f]))}}),(0,J.jsx)(`kbd`,{className:`text-[10px] text-muted-foreground border rounded px-1.5 py-0.5`,children:`Esc`})]}),(0,J.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto`,children:v.length===0?(0,J.jsxs)(`div`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:[`No matches for "`,u,`"`]}):yr(v,f,y,p)}),(0,J.jsxs)(`div`,{className:`border-t px-4 py-2 text-[10px] uppercase tracking-wider text-muted-foreground flex items-center gap-3`,children:[(0,J.jsx)(`span`,{children:`↑↓ navigate`}),(0,J.jsx)(`span`,{children:`↵ select`}),(0,J.jsx)(`span`,{children:`Esc dismiss`})]})]})})}function yr(e,t,n,r){let i={};return e.forEach((e,t)=>{i[e.category]||(i[e.category]=[]),i[e.category]?.push({item:e,globalIdx:t})}),(0,J.jsx)(`div`,{className:`p-1`,children:Object.entries(i).map(([e,i])=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`px-3 pt-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),i.map(({item:e,globalIdx:i})=>{let a=e.icon,o=i===t;return(0,J.jsxs)(`button`,{type:`button`,onMouseEnter:()=>r(i),onClick:()=>n(e),className:q(`w-full flex items-center gap-3 px-3 py-2 rounded text-left text-sm transition-colors`,o?`bg-accent text-accent-foreground`:`hover:bg-accent/40`),children:[(0,J.jsx)(a,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,J.jsx)(`div`,{className:`truncate`,children:e.label}),e.hint&&(0,J.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.hint})]}),o&&(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`↵`})]},e.id)})]},e))})}function br({query:e,onPick:t,onClose:n}){let r=Y(),a=W(e=>e.wsUrl),[o,s]=(0,V.useState)([]),[c,l]=(0,V.useState)(0),u=(0,V.useRef)(null),d=(0,V.useRef)(null);return(0,V.useEffect)(()=>{let e=H(a).on(`files.list`,e=>{let t=e.payload;s(t.files??[]),l(0),d.current?.resolve(t.files??[]),d.current=null});return()=>e()},[a]),(0,V.useEffect)(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{r.client.listFiles(e,50)},80),()=>{u.current&&clearTimeout(u.current)}),[e,r.client]),(0,V.useEffect)(()=>{let e=e=>{if(e.key===`ArrowDown`)e.preventDefault(),l(e=>(e+1)%Math.max(1,o.length));else if(e.key===`ArrowUp`)e.preventDefault(),l(e=>(e-1+Math.max(1,o.length))%Math.max(1,o.length));else if(e.key===`Enter`||e.key===`Tab`){if(o.length===0)return;e.preventDefault(),t(B(o[c]))}else e.key===`Escape`&&(e.preventDefault(),n())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[o,c,t,n]),(0,J.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 mb-2 rounded-lg border bg-popover shadow-md p-1 text-sm max-h-72 overflow-auto`,children:[(0,J.jsxs)(`div`,{className:`px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground border-b mb-1 flex items-center justify-between`,children:[(0,J.jsxs)(`span`,{children:[`@ Files `,e&&`· "${e}"`]}),(0,J.jsx)(`span`,{children:`↑/↓ select · ↵ insert · Esc dismiss`})]}),o.length===0?(0,J.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground italic`,children:e?`No files match "${e}"`:`Searching project…`}):o.map((e,n)=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(e),onMouseEnter:()=>l(n),className:q(`w-full text-left px-3 py-1.5 rounded transition-colors flex items-center gap-2 font-mono text-xs`,n===c?`bg-accent text-accent-foreground`:`hover:bg-accent/40`),children:[e.includes(`/`)?(0,J.jsx)(j,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,J.jsx)(i,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,J.jsx)(`span`,{className:`truncate`,children:e})]},e))]})}var xr=[{name:`/abort`,category:`Run`,aliases:[`/stop`],description:`Abort the current run`},{name:`/dev`,category:`Run`,description:`Run a shell command and see the output (LLM does not see it)`},{name:`/commit`,category:`Run`,aliases:[`/gc`],description:`Generate a conventional commit message (LLM-powered)`},{name:`/gitcheck`,category:`Run`,aliases:[`/gcstatus`],description:`Pre-commit sanity check (branch, diff, lint)`},{name:`/push`,category:`Run`,description:`Push the current branch to remote`},{name:`/new`,category:`Session`,description:`Start a brand-new session (fresh on disk and in memory)`},{name:`/clear`,category:`Session`,description:`Wipe current context (keeps session id, disk record stays)`},{name:`/compact`,category:`Session`,description:`Shrink context — elide ancient tool output`},{name:`/repair`,category:`Session`,description:`Repair orphan tool_use/tool_result blocks in context`},{name:`/save`,category:`Session`,description:`Force-flush the session (auto-saved already)`},{name:`/load`,category:`Session`,aliases:[`/resume`],description:`Resume a previous session from disk`},{name:`/prune`,category:`Session`,description:`Delete old sessions (default older than 30 days)`},{name:`/export`,category:`Session`,description:`Download the current chat as markdown`},{name:`/debug`,category:`Inspect`,aliases:[`/context`],description:`Per-section context size breakdown`},{name:`/tools`,category:`Inspect`,description:`List every registered tool the model can call`},{name:`/memory`,category:`Inspect`,description:`Manage memory: show, remember, forget, clear, compact, stats`},{name:`/skill`,category:`Inspect`,aliases:[`/skills`],description:`List active skills`},{name:`/diag`,category:`Inspect`,description:`Runtime diagnostics (provider, tools, features, mode, usage)`},{name:`/stats`,category:`Inspect`,description:`Session stats: tokens, cache hit ratio, cost, elapsed`},{name:`/todos`,category:`Inspect`,description:"List current todos (try `/todos clear` to reset)"},{name:`/codebase-reindex`,category:`Inspect`,aliases:[`/reindex`],description:`Rebuild the codebase symbol index`},{name:`/security`,category:`Inspect`,description:`Security scanning: /security scan | audit | report`},{name:`/metrics`,category:`Inspect`,description:`Show runtime metrics snapshot (requires --metrics)`},{name:`/health`,category:`Inspect`,description:`Show health check status`},{name:`/spawn`,category:`Agent`,description:`Spawn an isolated subagent to handle a task`},{name:`/agents`,category:`Agent`,description:`Show status of spawned subagents`},{name:`/fleet`,category:`Agent`,description:`Inspect and control the agent fleet`},{name:`/director`,category:`Agent`,description:`Promote to director mode at runtime`},{name:`/autonomy`,category:`Agent`,description:`Toggle or query autonomy mode (self-driving agent)`},{name:`/goal`,category:`Agent`,description:`Set, inspect, or clear the autonomous mission`},{name:`/autophase`,category:`Agent`,description:`Autonomous phase-based workflow with subagents`},{name:`/fix`,category:`Agent`,description:`Diagnose and fix a reported error or bug`},{name:`/sdd`,category:`Agent`,description:`AI-driven Specification-Driven Development workflow`},{name:`/btw`,category:`Agent`,description:`Drop a mid-run note without interrupting the agent`},{name:`/collab`,category:`Agent`,description:`Live collaboration helpers (status / invite / history)`},{name:`/prompts`,category:`Agent`,description:`Manage prompt library: list, view, add, delete, edit, extend`},{name:`/plan`,category:`Agent`,description:`Strategic plan board: show, add, start, done, promote, clear`},{name:`/skill-gen`,category:`Agent`,description:`Generate a new skill from a description (LLM-powered)`},{name:`/skill-install`,category:`Agent`,description:`Install a skill from GitHub (user/repo or URL)`},{name:`/skill-update`,category:`Agent`,description:`Update an installed skill to the latest version`},{name:`/skill-uninstall`,category:`Agent`,description:`Remove an installed skill`},{name:`/settings`,category:`Config`,aliases:[`/model`],description:`Open settings (provider/model/keys)`},{name:`/setmodel`,category:`Config`,description:`Quick-switch the active provider/model`},{name:`/models`,category:`Config`,description:`List available providers and models`},{name:`/mode`,category:`Config`,description:`Switch the active mode (persona/skill set)`},{name:`/yolo`,category:`Config`,description:`Toggle or query YOLO (auto-approve) mode`},{name:`/next`,category:`Config`,description:`Toggle next-task prediction after each turn`},{name:`/enhance`,category:`Config`,description:`Toggle prompt refinement before sending`},{name:`/mcp`,category:`Config`,aliases:[`/mcp-servers`],description:`Manage MCP servers`},{name:`/plugin`,category:`Config`,aliases:[`/plugins`],description:`Manage plugins`},{name:`/statusline`,category:`Config`,aliases:[`/sl`],description:`Customize status bar chips`},{name:`/telegram-setup`,category:`Config`,aliases:[`/tg-setup`],description:`Configure Telegram bot token and chat`},{name:`/init`,category:`Config`,description:`Create or update .wrongstack/AGENTS.md project context`},{name:`/worktree`,category:`Config`,aliases:[`/wt`],description:`Inspect/manage git worktrees for AutoPhase`},{name:`/sync`,category:`Config`,description:`GitHub cloud sync for settings, skills, prompts, memory`},{name:`/help`,category:`App`,description:`Show every slash command and what it does`},{name:`/exit`,category:`App`,description:`Exit the current session`}],Sr=[`Run`,`Session`,`Inspect`,`Agent`,`Config`,`App`];function Cr(e){let t=e.toLowerCase();return t===`/`||t===``?xr:xr.filter(e=>e.name.startsWith(t)||(e.aliases?.some(e=>e.startsWith(t))??!1))}function wr(e,t){let n=t-1;for(;n>=0;){let r=B(e[n]);if(r===`@`){let r=n>0?e[n-1]:``;return n===0||/\s/.test(r??``)?{start:n,query:e.slice(n+1,t)}:null}if(/\s/.test(r))return null;n--}return null}function Tr(){let{isLoading:e,setLoading:t,addMessage:n,clearMessages:r}=U(),i=U(e=>e.queue),o=U(e=>e.enqueue),s=U(e=>e.removeQueued),c=U(e=>e.clearQueue),{setCurrentView:l}=K(),u=K(e=>e.pushPrompt),d=K(e=>e.promptHistory),f=Y(),{sendMessage:p,sendAbort:m,client:h}=f,g=G(e=>e.lastInputTokens),_=G(e=>e.maxContext),[v,y]=(0,V.useState)(``),[b,x]=(0,V.useState)(0),[S,C]=(0,V.useState)(-1),[w,T]=(0,V.useState)(null),[E,D]=(0,V.useState)(null),[O,k]=(0,V.useState)(!1),A=(0,V.useRef)(null),j=(0,V.useCallback)(e=>{let i=e.trim(),a=i.indexOf(` `),o=(a===-1?i:i.slice(0,a)).toLowerCase(),s=a===-1?``:i.slice(a+1).trim(),c=o;switch(c){case`/help`:return n({role:`assistant`,content:[`📖 **Slash commands**`,``,...xr.map(e=>`• \`${e.name}\`${e.aliases?.length?` (${e.aliases.map(e=>`\`${e}\``).join(`, `)})`:``} — ${e.description}`)].join(`
|
|
66
66
|
`)}),!0;case`/clear`:return r(),h?.clearContext?.(),!0;case`/new`:return h?.newSession?.(),!0;case`/compact`:case`/compact!`:return h?.compactContext?.(c===`/compact!`),!0;case`/repair`:return h?.repairContext?.(),!0;case`/debug`:case`/context`:return h?.debugContext?.(),!0;case`/tools`:return f.listTools(),!0;case`/memory`:return f.listMemory(),!0;case`/skill`:case`/skills`:return f.listSkills(),!0;case`/diag`:return f.getDiag(),!0;case`/stats`:return f.getStats(),!0;case`/save`:return f.saveSession(),!0;case`/todos`:{if(s.toLowerCase()===`clear`)return h?.clearTodos?.(),!0;let e=G.getState().todos;if(e.length===0)return n({role:`assistant`,content:`✅ **Todos** — _empty. Ask the agent to plan something and they'll show up here._`}),!0;let t=[`✅ **Todos** (${e.filter(e=>e.status===`completed`).length}/${e.length} done)`,``];for(let n of e){let e=n.status===`completed`?`[x]`:n.status===`in_progress`?`[~]`:`[ ]`,r=n.status===`in_progress`&&n.activeForm?n.activeForm:n.content;t.push(`- ${e} ${r}`)}return t.push(``,"_Use `/todos clear` to wipe the list._"),n({role:`assistant`,content:t.join(`
|
|
67
67
|
`)}),!0}case`/export`:return gr(),n({role:`assistant`,content:`📥 Chat exported to your downloads folder.`}),!0;case`/abort`:case`/stop`:return m(),t(!1),!0;case`/settings`:case`/model`:return l(`settings`),!0;default:return!1}},[n,r,h,m,t,l,f]),M=v.startsWith(`/`)&&!v.includes(` `)?Cr(v):[];(0,V.useEffect)(()=>{b>=M.length&&x(0)},[M.length,b]);let te=(0,V.useCallback)(()=>{let t=A.current;t&&(t.value=``,t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,200)}px`,e||t.focus())},[e]),ne=(0,V.useCallback)(async r=>{if(r.preventDefault(),!v.trim())return;let i=v.trim();if(i.startsWith(`/`)&&j(i)){u(i),y(``),C(-1),te();return}if(y(``),C(-1),te(),u(i),te(),e){o(i);return}try{h?.isConnected?(n({role:`user`,content:i}),t(!0),p(i)):console.error(`WebSocket not connected`)}catch(e){console.error(`Failed to send:`,e),t(!1)}},[v,e,o,h,p,t,n,j,u,te]),N=(0,V.useCallback)(()=>{m(),t(!1)},[m,t]),re=(0,V.useCallback)(()=>{m(),t(!1);let e=U.getState().messages;for(let t=e.length-1;t>=0;t--){let n=B(e[t]);if(n.role===`user`&&n.content){y(n.content),requestAnimationFrame(()=>{let e=A.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`,e.focus(),e.setSelectionRange(n.content.length,n.content.length))});return}}},[m,t]),P=(0,V.useCallback)(e=>{if(M.length===0&&!w&&d.length>0){if(e.key===`ArrowUp`){let t=e.currentTarget,n=t.value.slice(0,t.selectionStart);if(S>=0||n.indexOf(`
|
|
68
68
|
`)===-1){e.preventDefault();let t=Math.min(d.length-1,S+1);C(t);let n=d[t]??``;y(n),requestAnimationFrame(()=>{let e=A.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`,e.setSelectionRange(n.length,n.length))});return}}if(e.key===`ArrowDown`&&S>=0){e.preventDefault();let t=S-1;if(t<0)C(-1),y(``);else{C(t);let e=d[t]??``;y(e),requestAnimationFrame(()=>{let t=A.current;t&&(t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,200)}px`,t.setSelectionRange(e.length,e.length))})}return}}if(M.length>0){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%M.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+M.length)%M.length);return}if(e.key===`Tab`){e.preventDefault();let t=M[b];t&&(y(t.name+` `),x(0));return}if(e.key===`Enter`&&!e.shiftKey){let t=M[b];if(t&&t.name!==v.toLowerCase().trim()){e.preventDefault(),y(``),j(t.name);return}}if(e.key===`Escape`){e.preventDefault(),y(``);return}}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ne(e))},[M,b,w,d,S,v,j,ne]),F=()=>{let e=A.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[E&&(0,J.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 text-amber-700 dark:text-amber-300 px-2.5 py-1.5 text-xs flex items-center justify-between gap-2 animate-message`,children:[(0,J.jsxs)(`span`,{children:[`Pasted`,` `,(0,J.jsx)(`span`,{className:`font-mono tabular-nums`,children:E.chars.toLocaleString()}),` chars (`,(0,J.jsx)(`span`,{className:`font-mono tabular-nums`,children:E.lines}),` lines) — fenced code blocks render best with `,(0,J.jsx)(`span`,{className:`font-mono`,children:"```"}),`.`]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>D(null),className:`text-amber-600/70 hover:text-amber-600 dark:text-amber-300/70 dark:hover:text-amber-300 shrink-0`,title:`Dismiss`,children:`×`})]}),i.length>0&&(0,J.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-2 text-xs`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,J.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:[`Queued (`,i.length,`)`]}),(0,J.jsx)(`button`,{type:`button`,onClick:c,className:`text-muted-foreground hover:text-destructive text-xs`,children:`Clear all`})]}),(0,J.jsx)(`ul`,{className:`space-y-1`,children:i.map((e,t)=>(0,J.jsxs)(`li`,{className:`flex items-start justify-between gap-2 rounded bg-background/60 border px-2 py-1`,children:[(0,J.jsx)(`span`,{className:`truncate flex-1 min-w-0`,children:e}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>s(t),className:`text-muted-foreground hover:text-destructive shrink-0`,title:`Remove from queue`,children:`×`})]},t))})]}),(0,J.jsxs)(`form`,{onSubmit:ne,onDragEnter:e=>{!e.dataTransfer||!Array.from(e.dataTransfer.types).includes(`Files`)||(e.preventDefault(),k(!0))},onDragOver:e=>{!e.dataTransfer||!Array.from(e.dataTransfer.types).includes(`Files`)||(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||k(!1)},onDrop:e=>{if(!e.dataTransfer)return;let t=Array.from(e.dataTransfer.files??[]);if(t.length===0){k(!1);return}e.preventDefault(),k(!1);let n=A.current,r=n?.selectionStart??v.length,i=v.slice(0,r),a=v.slice(r),o=i.length>0&&!/\s$/.test(i)?` `:``,s=t.map(e=>`@${e.name}`),c=s.join(` `),l=a.length===0||!/^\s/.test(a)?` `:``,u=`${o}${c}${l}`;y(i+u+a);let d=i.length+o.length+s.slice(0,-1).join(` `).length+ +(s.length>1),f=t[t.length-1]?.name;requestAnimationFrame(()=>{if(n){let e=i.length+u.length-l.length;n.focus(),n.setSelectionRange(e,e),n.style.height=`auto`,n.style.height=`${Math.min(n.scrollHeight,200)}px`}T({start:d,query:f})})},className:q(`flex items-end gap-2 relative rounded-lg transition-colors`,O&&`ring-2 ring-primary ring-offset-2 ring-offset-background bg-primary/5`),children:[O&&(0,J.jsxs)(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center pointer-events-none rounded-lg bg-primary/10 text-primary text-sm font-medium`,children:[`Drop file`,`(s)`,` to attach as @-mention`]}),(0,J.jsxs)(`div`,{className:`relative flex-1`,children:[w&&(0,J.jsx)(br,{query:w.query,onClose:()=>T(null),onPick:e=>{let t=v.slice(0,w.start),n=v.slice(w.start+1+w.query.length),r=`@${e} `;y(t+r+n),T(null),requestAnimationFrame(()=>{let e=A.current;if(e){let n=t.length+r.length;e.focus(),e.setSelectionRange(n,n),e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`}})}}),!w&&M.length>0&&(()=>{let e={};M.forEach((t,n)=>{e[t.category]||(e[t.category]=[]),e[t.category]?.push({cmd:t,idx:n})});let t=Sr.filter(t=>e[t]?.length);return(0,J.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 mb-2 rounded-lg border bg-popover shadow-md p-1 text-sm max-h-72 overflow-auto`,children:[(0,J.jsx)(`div`,{className:`px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground border-b mb-1`,children:`↑/↓ select · Tab complete · Enter dispatch · Esc dismiss`}),t.map(t=>(0,J.jsxs)(`div`,{className:`mb-1`,children:[(0,J.jsx)(`div`,{className:`px-3 pt-1 pb-0.5 text-[10px] uppercase tracking-wider text-muted-foreground/70 font-semibold`,children:t}),e[t]?.map(({cmd:e,idx:t})=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{y(``),j(e.name)},onMouseEnter:()=>x(t),className:q(`w-full text-left px-3 py-1.5 rounded transition-colors flex items-center gap-3`,t===b?`bg-accent text-accent-foreground`:`hover:bg-accent/40`),children:[(0,J.jsx)(`span`,{className:`font-mono shrink-0`,children:e.name}),e.aliases?.length?(0,J.jsxs)(`span`,{className:`text-xs text-muted-foreground/70 font-mono shrink-0`,children:[`(`,e.aliases.join(`, `),`)`]}):null,(0,J.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`— `,e.description]})]},e.name))]},t))]})})(),(0,J.jsx)(`textarea`,{ref:A,value:v,onChange:e=>{let t=e.target.value;y(t),F(),S>=0&&C(-1),T(wr(t,e.target.selectionStart??t.length))},onSelect:e=>{let t=e.currentTarget;T(wr(t.value,t.selectionStart))},onKeyDown:P,onPaste:e=>{let t=e.clipboardData?.getData(`text`)??``;if(t.length>800){let e=t.split(`
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/wrongstack.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>WrongStack WebUI</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DZfZgZld.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-CHXeWZ2s.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/vendor-XkZLp0g1.css">
|
package/dist/index.js
CHANGED
|
@@ -3063,6 +3063,10 @@ import { expectDefined as expectDefined5 } from "@wrongstack/core";
|
|
|
3063
3063
|
var SLASH_COMMANDS = [
|
|
3064
3064
|
// Run
|
|
3065
3065
|
{ name: "/abort", category: "Run", aliases: ["/stop"], description: "Abort the current run" },
|
|
3066
|
+
{ name: "/dev", category: "Run", description: "Run a shell command and see the output (LLM does not see it)" },
|
|
3067
|
+
{ name: "/commit", category: "Run", aliases: ["/gc"], description: "Generate a conventional commit message (LLM-powered)" },
|
|
3068
|
+
{ name: "/gitcheck", category: "Run", aliases: ["/gcstatus"], description: "Pre-commit sanity check (branch, diff, lint)" },
|
|
3069
|
+
{ name: "/push", category: "Run", description: "Push the current branch to remote" },
|
|
3066
3070
|
// Session
|
|
3067
3071
|
{ name: "/new", category: "Session", description: "Start a brand-new session (fresh on disk and in memory)" },
|
|
3068
3072
|
{ name: "/clear", category: "Session", description: "Wipe current context (keeps session id, disk record stays)" },
|
|
@@ -3081,6 +3085,9 @@ var SLASH_COMMANDS = [
|
|
|
3081
3085
|
{ name: "/stats", category: "Inspect", description: "Session stats: tokens, cache hit ratio, cost, elapsed" },
|
|
3082
3086
|
{ name: "/todos", category: "Inspect", description: "List current todos (try `/todos clear` to reset)" },
|
|
3083
3087
|
{ name: "/codebase-reindex", category: "Inspect", aliases: ["/reindex"], description: "Rebuild the codebase symbol index" },
|
|
3088
|
+
{ name: "/security", category: "Inspect", description: "Security scanning: /security scan | audit | report" },
|
|
3089
|
+
{ name: "/metrics", category: "Inspect", description: "Show runtime metrics snapshot (requires --metrics)" },
|
|
3090
|
+
{ name: "/health", category: "Inspect", description: "Show health check status" },
|
|
3084
3091
|
// Agent
|
|
3085
3092
|
{ name: "/spawn", category: "Agent", description: "Spawn an isolated subagent to handle a task" },
|
|
3086
3093
|
{ name: "/agents", category: "Agent", description: "Show status of spawned subagents" },
|
|
@@ -3093,6 +3100,12 @@ var SLASH_COMMANDS = [
|
|
|
3093
3100
|
{ name: "/sdd", category: "Agent", description: "AI-driven Specification-Driven Development workflow" },
|
|
3094
3101
|
{ name: "/btw", category: "Agent", description: "Drop a mid-run note without interrupting the agent" },
|
|
3095
3102
|
{ name: "/collab", category: "Agent", description: "Live collaboration helpers (status / invite / history)" },
|
|
3103
|
+
{ name: "/prompts", category: "Agent", description: "Manage prompt library: list, view, add, delete, edit, extend" },
|
|
3104
|
+
{ name: "/plan", category: "Agent", description: "Strategic plan board: show, add, start, done, promote, clear" },
|
|
3105
|
+
{ name: "/skill-gen", category: "Agent", description: "Generate a new skill from a description (LLM-powered)" },
|
|
3106
|
+
{ name: "/skill-install", category: "Agent", description: "Install a skill from GitHub (user/repo or URL)" },
|
|
3107
|
+
{ name: "/skill-update", category: "Agent", description: "Update an installed skill to the latest version" },
|
|
3108
|
+
{ name: "/skill-uninstall", category: "Agent", description: "Remove an installed skill" },
|
|
3096
3109
|
// Config
|
|
3097
3110
|
{ name: "/settings", category: "Config", aliases: ["/model"], description: "Open settings (provider/model/keys)" },
|
|
3098
3111
|
{ name: "/setmodel", category: "Config", description: "Quick-switch the active provider/model" },
|
|
@@ -3107,6 +3120,7 @@ var SLASH_COMMANDS = [
|
|
|
3107
3120
|
{ name: "/telegram-setup", category: "Config", aliases: ["/tg-setup"], description: "Configure Telegram bot token and chat" },
|
|
3108
3121
|
{ name: "/init", category: "Config", description: "Create or update .wrongstack/AGENTS.md project context" },
|
|
3109
3122
|
{ name: "/worktree", category: "Config", aliases: ["/wt"], description: "Inspect/manage git worktrees for AutoPhase" },
|
|
3123
|
+
{ name: "/sync", category: "Config", description: "GitHub cloud sync for settings, skills, prompts, memory" },
|
|
3110
3124
|
// App
|
|
3111
3125
|
{ name: "/help", category: "App", description: "Show every slash command and what it does" },
|
|
3112
3126
|
{ name: "/exit", category: "App", description: "Exit the current session" }
|