@wrongstack/webui 1.0.13 → 1.0.15
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/{AgentRosterView-BuAsY8eB.js → AgentRosterView-DMxOg0xX.js} +1 -1
- package/dist/assets/{AnalyticsDashboard-iIkpKNGk.js → AnalyticsDashboard-DGQk1vSi.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-CgKWvpxv.js → AudienceMemoryPanel-CyfpggCK.js} +1 -1
- package/dist/assets/{ChangesView-Cd3Tl17b.js → ChangesView-C8x8tmpi.js} +1 -1
- package/dist/assets/{ChimeraReviewsView-CWo6AV3H.js → ChimeraReviewsView-DencEMIY.js} +1 -1
- package/dist/assets/{ChronicleDashboard-D8HEQ32t.js → ChronicleDashboard-CvDPqZKE.js} +1 -1
- package/dist/assets/{CodeEditor-BmnUVoHj.js → CodeEditor-s0lHP0DZ.js} +1 -1
- package/dist/assets/{CodeMap-CYr1LK2u.js → CodeMap-6mmDO9gJ.js} +1 -1
- package/dist/assets/{CronJobsPanel-B9X-N_ft.js → CronJobsPanel-LoDmuRHl.js} +1 -1
- package/dist/assets/{DebugDashboard-KEZZY9pu.js → DebugDashboard-BP1Mia-L.js} +1 -1
- package/dist/assets/{DesignGalleryView-DWDsOUD3.js → DesignGalleryView-taDxRN63.js} +1 -1
- package/dist/assets/{GoalView-CmRWtduc.js → GoalView-CcLxMYXe.js} +1 -1
- package/dist/assets/{KanbanView-BVHyGhDq.js → KanbanView-C-K6OBw8.js} +1 -1
- package/dist/assets/{MailboxDetailView-COFzilLE.js → MailboxDetailView-N00dLbpr.js} +1 -1
- package/dist/assets/{MemoryDrawer-m9ZlZ_xi.js → MemoryDrawer-CuFQypU-.js} +1 -1
- package/dist/assets/{MemoryManager-Bb_RMZhJ.js → MemoryManager-Bmz62aEV.js} +1 -1
- package/dist/assets/{ProcessMonitor-Btj6_6aw.js → ProcessMonitor-CkAtUjrR.js} +1 -1
- package/dist/assets/{ProviderTestView-CVKjGm2z.js → ProviderTestView-Dy7EQEI9.js} +1 -1
- package/dist/assets/{QueuePanel-CSlu_Hat.js → QueuePanel-DE9ySxkR.js} +1 -1
- package/dist/assets/{RepositoryHistoryView-CIsxftEC.js → RepositoryHistoryView-D0ynYRgu.js} +1 -1
- package/dist/assets/{RequirementIntakeView-Dah2aHco.js → RequirementIntakeView-CPRtncuJ.js} +1 -1
- package/dist/assets/{SageTabs-GuriCwuB.js → SageTabs-Dwbux3im.js} +2 -2
- package/dist/assets/{SddHub-C7IlzHtw.js → SddHub-CoRKeq7Q.js} +1 -1
- package/dist/assets/{SessionInspectView-_qPDgZXH.js → SessionInspectView-Bak1hK82.js} +1 -1
- package/dist/assets/{SessionList-nn7wHkrG.js → SessionList-xXaygO5X.js} +1 -1
- package/dist/assets/{SessionsDashboard-BjevWtcd.js → SessionsDashboard-CaSXukNy.js} +1 -1
- package/dist/assets/{SetupScreen-DCupHAif.js → SetupScreen-BSEF1air.js} +1 -1
- package/dist/assets/{SkillDetailView-EaPGctff.js → SkillDetailView-OdtAJM43.js} +1 -1
- package/dist/assets/{TechStackView-DXoJPVZf.js → TechStackView-BUIbnU2F.js} +1 -1
- package/dist/assets/{TerminalPanel-DxAt_S44.js → TerminalPanel-CfoKklMj.js} +1 -1
- package/dist/assets/{index-B70B52lT.js → index-3TGBKeBP.js} +5 -5
- package/dist/assets/{stores-DxKcenvb.js → stores-RkHrTaRO.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/index.js +36 -36
- package/package.json +9 -9
|
@@ -4,4 +4,4 @@ import{Dt as e,K as t,Nt as n,wt as r,zt as i}from"./config-store-BAUadwHd.js";i
|
|
|
4
4
|
…`),{text:a,truncated:i}}function re(e){return e.length===0?``:[`[File reference contract]`,`Before answering or modifying anything related to these references, use the available file-reading tools to read each complete project file:`,...e.map(e=>`- ${JSON.stringify(e)}`),`If a read is paginated or chunked, continue on the same path until EOF. Do not treat an inline preview as the complete file.`].join(`
|
|
5
5
|
`)}function ie(e,t){if(e.length===0)return``;let n=[],r=new Set;for(let i of e){if(i.kind===`file`){let e=t?.[i.path];if(e){let t=O(i.path),a=t?`\`\`\`${t}`:"```",o=k(e),s=o.truncated?`preview; complete read required`:`entire file`;n.push(`${a}\n// ${i.path} (${s})\n${o.text}\n\`\`\``),o.truncated&&r.add(i.path)}else n.push(`@${i.path}`),r.add(i.path);continue}let e=O(i.path),a=e?`\`\`\`${e}`:"```",o=`// ${i.path}:${i.startLine}-${i.endLine}`,s=k(i.kind===`snippet`?i.content:i.preview);n.push(`${a}\n${o}\n${s.text}\n\`\`\``),s.truncated&&r.add(i.path)}let i=re([...r]);return[...n,i].filter(Boolean).join(`
|
|
6
6
|
|
|
7
|
-
`)}var ae=s()((e,t)=>({refs:[],addRef:n=>{let r=t();if(n.kind===`file`&&r.refs.find(e=>e.kind===`file`&&e.path===n.path))return;let i={...n,id:ne()};e({refs:[...r.refs,i]})},removeRef:t=>{e(e=>({refs:e.refs.filter(e=>e.id!==t)}))},clearRefs:()=>e({refs:[]})})),oe=s()(e=>({info:null,setInfo:t=>e({info:t}),clear:()=>e({info:null})})),A=s()((e,t)=>({result:null,loading:!1,currentSeq:0,setResult:t=>e(e=>t.reqSeq===e.currentSeq?{result:t,loading:!1}:{}),setLoading:()=>e({loading:!0,result:null}),clear:()=>e({result:null,loading:!1}),nextSeq:()=>{let n=t().currentSeq+1;return e({currentSeq:n}),n}})),j=s()(e=>({phases:[],activePhaseId:null,overallPercent:0,autonomous:!1,title:null,goal:null,status:`idle`,multiBoard:!1,lastEvent:null,lastError:null,graphs:[],progress:null,setState:t=>e(e=>({phases:t.phases??e.phases,activePhaseId:t.activePhaseId===void 0?e.activePhaseId:t.activePhaseId,overallPercent:t.overallPercent??e.overallPercent,autonomous:t.autonomous??e.autonomous,title:t.title===void 0?e.title:t.title,goal:t.goal===void 0?e.goal:t.goal,status:t.status??e.status,multiBoard:t.multiBoard??e.multiBoard,lastEvent:t.lastEvent===void 0?e.lastEvent:t.lastEvent,lastError:t.lastError===void 0?e.lastError:t.lastError,graphs:t.graphs??e.graphs,progress:t.progress===void 0?e.progress:t.progress})),clear:()=>e({phases:[],activePhaseId:null,overallPercent:0,autonomous:!1,title:null,goal:null,status:`idle`,multiBoard:!1,lastEvent:null,lastError:null,graphs:[],progress:null}),hydrateFromServer:e=>{e({type:`goal.list`}),e({type:`goal.state`})}}));function M(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!(typeof t.iteration!=`number`||!Number.isFinite(t.iteration)||t.task!==void 0&&typeof t.task!=`string`||t.status!==void 0&&typeof t.status!=`string`||t.progress!==void 0&&(typeof t.progress!=`number`||!Number.isFinite(t.progress))||t.progressNote!==void 0&&typeof t.progressNote!=`string`||t.timestamp!==void 0&&typeof t.timestamp!=`string`)}function N(e){return!e||typeof e.goal!=`string`||!e.goal.trim()?null:{goal:e.goal,refinedGoal:typeof e.refinedGoal==`string`?e.refinedGoal:void 0,goalState:[`active`,`paused`,`completed`,`failed`,`abandoned`].includes(e.goalState)?e.goalState:`active`,iterations:typeof e.iterations==`number`?e.iterations:0,progress:typeof e.progress==`number`?e.progress:0,progressNote:typeof e.progressNote==`string`?e.progressNote:void 0,progressTrend:e.progressTrend===`accelerating`?`up`:e.progressTrend===`stalling`?`down`:e.progressTrend===`steady`?`stable`:void 0,deliverables:Array.isArray(e.deliverables)?e.deliverables.map((e,t)=>typeof e==`string`?{id:`d${t}`,text:e,status:/^\[[x✓]\]|✅|\(done\)/i.test(e)?`done`:`pending`}:e):void 0,journal:Array.isArray(e.journal)?e.journal.filter(M):void 0,lastTask:typeof e.lastTask==`string`?e.lastTask:void 0,lastStatus:typeof e.lastStatus==`string`?e.lastStatus:void 0}}var P=s()(e=>({goal:null,setGoal:t=>e({goal:N(t)}),clear:()=>e({goal:null}),appendJournalEntry:t=>e(e=>e.goal?{goal:{...e.goal,iterations:Math.max(e.goal.iterations,t.iteration),lastTask:t.task??e.goal.lastTask,lastStatus:t.status??e.goal.lastStatus,journal:[t,...e.goal.journal??[]].slice(0,200)}}:e),refresh:()=>{try{t()?.send?.({type:`goal-state.get`})}catch{}}}));function F(e,t){return e.presence?.some(e=>e.active)===!0||e.tags?.some(e=>e.startsWith(`session:`)&&t.includes(e.slice(8)))===!0}var I=3e5,L=s()((e,t)=>({boards:[],boardTotal:0,activeBoardTotal:0,orphanedBoardTotal:0,activeBoardId:null,activeBoard:null,loading:!1,lastOutboundAction:null,error:null,queueHealth:null,supervisorSnapshot:null,workbench:null,verificationActivity:{},boardHistory:[],fetchBoardHistory:e=>{t().sendKanban(`kanban.board.history`,{boardId:e})},setLoading:t=>e({loading:t}),sendKanban:(t,n)=>(e({loading:!0,lastOutboundAction:t}),t),transitionTask:(t,n,r,i)=>{let a=`kanban.task.transition`;return e({loading:!0,lastOutboundAction:a}),a},dispatchTask:(t,n,r)=>{let i=`kanban.task.dispatch`;return e({loading:!0,lastOutboundAction:i}),i},moveTask:(t,n,r)=>{let i=`kanban.task.move`;return e({loading:!0,lastOutboundAction:i}),i},removeTask:(t,n)=>{let r=`kanban.task.remove`;return e({loading:!0,lastOutboundAction:r}),r},setActiveBoardId:t=>e({activeBoardId:t,queueHealth:null,supervisorSnapshot:null,verificationActivity:{}}),setError:t=>e({error:t}),setQueueHealth:t=>e({queueHealth:t}),handleResult:(n,r)=>{if(!r.success){e({loading:!1,error:r.error??`Kanban request failed`});return}let i=r.data;if((n===`kanban.supervisor.status`||n===`kanban.supervisor.audit`)&&i){e({supervisorSnapshot:i,loading:!1,error:null});return}if(n===`kanban.health`&&r.data){e({queueHealth:r.data,loading:!1,error:null});return}if(n===`kanban.workbench`&&r.data){e({workbench:r.data,loading:!1,error:null});return}if(n===`kanban.list`){let t=H(i)?i:null,n=t?t.items:Array.isArray(i)?i:[];e({boards:n,boardTotal:t?.total??n.length,activeBoardTotal:t?.activeTotal??n.filter(e=>U(e)).length,orphanedBoardTotal:t?.orphanedTotal??n.filter(e=>!U(e)).length,loading:!1,error:null});return}if(n===`kanban.delete`){let n=t().activeBoardId,r=i,a=r?.removed===!0,o=r?.boardId??n;e(e=>{let t=a?e.boards.find(e=>e.id===o):void 0,n=t?U(t):void 0;return{boards:a?e.boards.filter(e=>e.id!==o):e.boards,boardTotal:a?Math.max(0,e.boardTotal-1):e.boardTotal,activeBoardTotal:n===!0?Math.max(0,e.activeBoardTotal-1):e.activeBoardTotal,orphanedBoardTotal:n===!1?Math.max(0,e.orphanedBoardTotal-1):e.orphanedBoardTotal,activeBoardId:a&&e.activeBoardId===o?null:e.activeBoardId,activeBoard:a&&e.activeBoard?.id===o?null:e.activeBoard,loading:!1,error:null}});return}if(n===`kanban.task.remove`){let t=i;e(e=>{let n=R(t?.board)?t.board:null;if(n&&e.activeBoardId===n.id)return{boards:K(e.boards,G(n)),activeBoard:n,loading:!1,error:null};let r=t?.boardId,i=t?.taskId,a=t?.removed===!0&&i&&e.activeBoard&&(!r||e.activeBoard.id===r)?{...e.activeBoard,tasks:e.activeBoard.tasks.filter(e=>e.id!==i)}:e.activeBoard;return{activeBoard:a,boards:a?K(e.boards,G(a)):e.boards,loading:!1,error:null}});return}if(n===`kanban.board.history`){Array.isArray(i)&&e({boardHistory:i});return}if(n===`kanban.task.verification_started`){let t=i;if(t?.boardId&&t.taskId){let n=`${t.boardId}:${t.taskId}`;e(e=>{let t=Date.now(),r=Object.fromEntries(Object.entries(e.verificationActivity).filter(([,e])=>t-e.startedAt<I));return r[n]={startedAt:t},{verificationActivity:r,loading:!1,error:null}})}return}if(n===`kanban.task.verification_completed`&&B(i)){let t=`${i.boardId}:${i.task.id}`;e(e=>{let n={...e.verificationActivity};if(delete n[t],e.activeBoard&&e.activeBoard.id===i.boardId){let t=q(e.activeBoard,i.task);return{verificationActivity:n,boards:K(e.boards,G(t)),activeBoard:t,loading:!1,error:null}}return{verificationActivity:n,loading:!1,error:null}});return}if(V(i)){let t=i.board;e(e=>({boards:K(e.boards,G(t)),activeBoard:e.activeBoardId===t.id?t:e.activeBoard,loading:!1,error:null}));return}if(B(i)){e(e=>{if(e.activeBoard&&e.activeBoard.id===i.boardId){let t=q(e.activeBoard,i.task);return{boards:K(e.boards,G(t)),activeBoard:t,loading:!1,error:null}}return{loading:!1,error:null}});return}if(R(i)){let t=G(i);if(n!==`kanban.create`&&n!==`kanban.duplicate`&&n!==`kanban.generate`){e(e=>({boards:K(e.boards,t),activeBoard:e.activeBoardId===i.id?i:e.activeBoard,loading:!1,error:null}));return}e(e=>({boards:K(e.boards,t),activeBoardId:i.id,activeBoard:i,loading:!1,error:null}));return}if(z(i)){e(e=>({...e.activeBoard?(()=>{let t=q(e.activeBoard,i);return{activeBoard:t,boards:K(e.boards,G(t))}})():{activeBoard:e.activeBoard},loading:!1,error:null}));return}if(Array.isArray(i)&&i.every(W)){e(e=>({...e.activeBoard?(()=>{let t={...e.activeBoard,columns:i};return{activeBoard:t,boards:K(e.boards,G(t))}})():{activeBoard:e.activeBoard},loading:!1,error:null}));return}e({loading:!1,error:null})}}));function R(e){return!!e&&typeof e==`object`&&Array.isArray(e.columns)&&Array.isArray(e.tasks)}function z(e){return!!e&&typeof e==`object`&&typeof e.title==`string`}function B(e){return!!e&&typeof e==`object`&&typeof e.boardId==`string`&&z(e.task)}function V(e){return!!e&&typeof e==`object`&&R(e.board)}function H(e){return!!e&&typeof e==`object`&&Array.isArray(e.items)&&typeof e.total==`number`}function U(e){return F(e,[])}function W(e){return!!e&&typeof e==`object`&&typeof e.id==`string`}function G(e){return{id:e.id,title:e.title,description:e.description,tags:e.tags,presence:e.presence,createdAt:e.createdAt,updatedAt:e.updatedAt,columnCount:e.columns.length,taskCount:e.tasks.length,completedTaskCount:e.tasks.filter(e=>e.status===`completed`).length}}function K(e,t){return[t,...e.filter(e=>e.id!==t.id)].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function q(e,t){let n=e.tasks.some(e=>e.id===t.id)?e.tasks.map(e=>e.id===t.id?t:e):[...e.tasks,t];return{...e,tasks:n}}function se(e){switch(e){case`tui`:return`tui`;case`cli`:case`repl`:return`repl`;case`webui`:return`webui`;default:return`webui`}}function ce(e){let t={tui:0,webui:0,repl:0},n=0,r=0,i={toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0};for(let a of e){t[se(a.clientType)]+=1;for(let e of a.agents)n+=1,(e.status===`running`||e.status===`streaming`)&&(r+=1),i.toolCalls+=e.toolCalls??0,i.costUsd+=e.costUsd??0,i.tokensIn+=e.tokensIn??0,i.tokensOut+=e.tokensOut??0}return{clientCounts:t,totalAgents:n,activeAgents:r,aggregate:i}}function le(e){if(e!==void 0)return Number.isFinite(e)?Math.max(0,Math.min(100,Math.round(e))):0}function ue(e){return e.map(e=>({...e,agents:e.agents.map(e=>({...e,ctxPct:le(e.ctxPct)}))}))}var de=0,J=s()(e=>({clientCounts:{tui:0,webui:0,repl:0},mailActivity:[],totalMessages:0,openMessages:0,unreadMessages:0,totalAgents:0,activeAgents:0,currentSession:{},liveSessions:[],aggregate:{toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0},lastUpdated:Date.now(),setClientCounts:t=>e({clientCounts:t,lastUpdated:Date.now()}),setLiveSessions:t=>{let n=ue(t),r=J.getState().liveSessions;if(r.length===n.length){let e=!0;for(let t=0;t<n.length;t++){let i=n[t],a=r[t];if(i.sessionId!==a.sessionId||i.status!==a.status||i.agentCount!==a.agentCount||i.startedAt!==a.startedAt||i.lastHeartbeatAt!==a.lastHeartbeatAt){e=!1;break}let o=i.agents??[],s=a.agents??[];if(o.length!==s.length){e=!1;break}for(let t=0;t<o.length;t++)if(o[t].id!==s[t].id||o[t].name!==s[t].name||o[t].status!==s[t].status||o[t].currentTool!==s[t].currentTool||o[t].iterations!==s[t].iterations||o[t].toolCalls!==s[t].toolCalls||o[t].ctxPct!==s[t].ctxPct||o[t].tokensIn!==s[t].tokensIn||o[t].tokensOut!==s[t].tokensOut||o[t].costUsd!==s[t].costUsd||o[t].recentTools?.[0]?.id!==s[t].recentTools?.[0]?.id||o[t].recentMail?.[0]?.id!==s[t].recentMail?.[0]?.id||o[t].activity?.reads!==s[t].activity?.reads||o[t].activity?.writes!==s[t].activity?.writes||o[t].activity?.edits!==s[t].activity?.edits||o[t].activity?.terminalCalls!==s[t].activity?.terminalCalls||o[t].activity?.mailReceived!==s[t].activity?.mailReceived||o[t].activity?.mailSent!==s[t].activity?.mailSent||o[t].activity?.linesAdded!==s[t].activity?.linesAdded||o[t].activity?.linesRemoved!==s[t].activity?.linesRemoved){e=!1;break}if(!e)break}if(e)return}e({liveSessions:n,...ce(n),lastUpdated:Date.now()})},addMailActivity:t=>e(e=>({mailActivity:[{...t,seq:t.seq??++de},...e.mailActivity].slice(0,50),lastUpdated:Date.now()})),setMailStats:(t,n,r)=>e({totalMessages:t,openMessages:n,unreadMessages:r,lastUpdated:Date.now()}),setAgentStats:(t,n)=>e({totalAgents:t,activeAgents:n,lastUpdated:Date.now()}),setCurrentSession:t=>e({currentSession:{...J.getState().currentSession,...t},lastUpdated:Date.now()}),clear:()=>e({clientCounts:{tui:0,webui:0,repl:0},mailActivity:[],totalMessages:0,openMessages:0,unreadMessages:0,totalAgents:0,activeAgents:0,currentSession:{},liveSessions:[],aggregate:{toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0},lastUpdated:Date.now()})})),fe=[3e4,6e4,12e4,3e5,6e5],Y=12e4,pe=s()(a(e=>({viewMode:`office`,showHud:!0,showLegend:!0,showMinimap:!0,showControls:!0,animateEdges:!0,showFeed:!0,background:`dots`,waitThresholdMs:Y,setViewMode:t=>e({viewMode:t}),setShowHud:t=>e({showHud:t}),setShowLegend:t=>e({showLegend:t}),setShowMinimap:t=>e({showMinimap:t}),setShowControls:t=>e({showControls:t}),setAnimateEdges:t=>e({animateEdges:t}),setShowFeed:t=>e({showFeed:t}),setBackground:t=>e({background:t}),setWaitThresholdMs:t=>e({waitThresholdMs:Number.isFinite(t)&&t>0?Math.round(t):Y})}),{name:`wrongstack-officemap`}));function X(e){return`${e.providerId}${e.meterId}`}function me(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.providerId==`string`&&typeof t.meterId==`string`&&Array.isArray(t.windows)&&typeof t.capturedAt==`number`}var he=s(e=>({meters:{},apply:t=>e(e=>{let n={...e.meters};for(let e of t){if(!me(e))continue;let t=n[X(e)];n[X(e)]={...e,...e.planLabel===void 0&&t?.planLabel!==void 0?{planLabel:t.planLabel}:{},...e.meterLabel===void 0&&t?.meterLabel!==void 0?{meterLabel:t.meterLabel}:{}}}return{meters:n}}),clear:()=>e({meters:{}})}));function ge(e){let t;for(let n of Object.values(e))for(let e of n.windows){if(!t||e.usedPercent>t.window.usedPercent){t={snapshot:n,window:e};continue}if(e.usedPercent===t.window.usedPercent){let r=e.resetsAt,i=t.window.resetsAt;r!==void 0&&(i===void 0||r<i)&&(t={snapshot:n,window:e})}}return t}function _e(e){if(e.label)return e.label;let t=e.windowMinutes;return t!==void 0&&Number.isFinite(t)&&t>0?t%1440==0?`${t/1440}d`:t%60==0?`${t/60}h`:`${t}m`:e.id}function ve(e,t=Date.now()){if(e?.resetsAt===void 0)return;let n=e.resetsAt*1e3-t;if(n<=0)return;let r=Math.floor(n/6e4);if(r<1)return`${Math.max(1,Math.round(n/1e3))}s`;let i=Math.floor(r/1440),a=Math.floor(r%1440/60),o=r%60;return i>0?a>0?`${i}d ${a}h`:`${i}d`:a>0?o>0?`${a}h ${o}m`:`${a}h`:`${o}m`}var Z=e=>`${e.providerId}\u0000${e.model}`,ye=s(e=>({entries:{},audit:[],summary:null,loading:!1,error:null,update:t=>e(e=>{let n={...e.entries},r=Z(t);if(t.state===`healthy`)delete n[r];else{let e=n[r],i=Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0));n[r]={...e,...i}}return{entries:n}}),hydrate:t=>e({entries:Object.fromEntries(t.filter(e=>e.state!==`healthy`).map(e=>[Z(e),e]))}),applySnapshot:t=>{let n=t.statuses;if(!Array.isArray(n)){e({error:`Invalid snapshot from server`,loading:!1});return}let r={};for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=typeof t.providerId==`string`?t.providerId:``,i=typeof t.model==`string`?t.model:``;if(!n||!i)continue;let a=t.state;(a===`healthy`||a===`degraded`||a===`blocked`)&&(r[`${n}\u0000${i}`]={providerId:n,model:i,state:a,reason:(typeof t.lastErrorKind==`string`?t.lastErrorKind:``)||a,updatedAt:typeof t.lastFailureAt==`number`?t.lastFailureAt:Date.now(),...typeof t.stateExpiresAt==`number`?{stateExpiresAt:t.stateExpiresAt}:{},...typeof t.consecutiveFailures==`number`?{consecutiveFailures:t.consecutiveFailures}:{},...typeof t.totalFailures==`number`?{totalFailures:t.totalFailures}:{},...typeof t.rateLimitHits==`number`?{rateLimitHits:t.rateLimitHits}:{},...typeof t.lastErrorMessage==`string`?{lastErrorMessage:t.lastErrorMessage}:{},...typeof t.lastErrorKind==`string`?{lastErrorKind:t.lastErrorKind}:{},...typeof t.lastErrorStatus==`number`?{lastErrorStatus:t.lastErrorStatus}:{},...Array.isArray(t.recentErrors)?{recentErrors:t.recentErrors.slice(0,20)}:{},...typeof t.lastSessionId==`string`?{lastSessionId:t.lastSessionId}:{},...typeof t.lastAgentId==`string`?{lastAgentId:t.lastAgentId}:{},...typeof t.lastFailureAt==`number`?{lastFailureAt:t.lastFailureAt}:{}})}let i=t;e({entries:r,summary:{totalPairs:typeof i.totalPairs==`number`?i.totalPairs:0,healthy:typeof i.healthy==`number`?i.healthy:0,degraded:typeof i.degraded==`number`?i.degraded:0,blocked:typeof i.blocked==`number`?i.blocked:0,totalFailures:typeof i.totalFailures==`number`?i.totalFailures:0,totalRateLimits:typeof i.totalRateLimits==`number`?i.totalRateLimits:0},error:null,loading:!1})},setAudit:t=>e({audit:t}),setLoading:t=>e({loading:t}),setError:t=>e({error:t,loading:!1}),removeEntry:(t,n)=>e(e=>{let r={...e.entries};return delete r[Z({providerId:t,model:n})],{entries:r}}),clear:()=>e({entries:{},audit:[],summary:null,error:null})})),be=s()(e=>({snapshot:null,boards:[],lifecycleResult:null,destroying:!1,setSnapshot:t=>e({snapshot:t}),setBoards:t=>e({boards:t}),setLifecycleResult:t=>e({lifecycleResult:t}),setDestroying:t=>e({destroying:t})})),xe=s()(e=>({snapshot:null,agentText:``,error:null,startedRunId:null,setSnapshot:t=>{if(t.discarded||t.phase===`idle`&&!t.sessionId){e({snapshot:null,agentText:``,error:null});return}e({snapshot:t,error:null,...t.lastAgentText?{agentText:t.lastAgentText}:{}})},setAgentText:t=>e({agentText:t}),setError:t=>e({error:t}),setStartedRunId:t=>e({startedRunId:t}),reset:()=>e({snapshot:null,agentText:``,error:null,startedRunId:null})})),Se=f(e=>({sideEffects:[],loading:!1,setSideEffects:t=>e({sideEffects:t,loading:!1}),setLoading:t=>e({loading:t}),clear:()=>e({sideEffects:[],loading:!1})})),Ce=s()(e=>({specs:[],detail:null,expandedSpecId:null,setSpecs:t=>e({specs:t}),setDetail:t=>e({detail:t}),setExpanded:t=>e({expandedSpecId:t,detail:null})})),we=new Set([`idle`,`queued`,`discovering`,`inventorying`,`enriching`,`researching`,`synthesizing`,`completed`,`failed`,`cancelled`]);function Q(e){return we.has(e)?e:void 0}var $={snapshot:null,stale:!1,loading:!1,error:null,activeJob:null,lastWorkspaceId:null,reportId:null},Te=s()(e=>({...$,setSnapshot:(t,n=!1)=>e(e=>({snapshot:t,stale:n,loading:!1,error:null,activeJob:e.activeJob?{...e.activeJob,status:`completed`,error:null}:null})),setLoading:t=>e({loading:t}),setError:t=>e({error:t,loading:!1}),jobStarted:(t,n)=>e({activeJob:{id:t,kind:n,status:`queued`,progress:null,error:null},error:null,loading:!0}),jobProgress:(t,n)=>e(e=>{if(e.activeJob?.id!==t)return e;let r=Q(n.phase);return r?{activeJob:{...e.activeJob,status:r,progress:n},loading:!0}:e}),jobFailed:(t,n)=>e(e=>e.activeJob?.id===t?{activeJob:{...e.activeJob,status:`failed`,error:n},error:n,loading:!1}:e),jobCancelled:t=>e(e=>({activeJob:e.activeJob?.id===t?{...e.activeJob,status:`cancelled`,error:null}:e.activeJob,loading:!1})),workspaceCompleted:t=>e({lastWorkspaceId:t}),reportReady:t=>e({reportId:t}),clear:()=>e($)})),Ee=s()(e=>({worktrees:[],baseBranch:``,activity:[],orphans:[],canClean:!1,cleanResult:null,mergeResult:null,diffByDir:{},setSnapshot:(t,n)=>e({worktrees:t,baseBranch:n}),pushEvent:t=>e(e=>({activity:[...e.activity,t].slice(-40)})),setOrphans:(t,n,r)=>e({orphans:t,canClean:n,cleanBlockedReason:r}),setCleanResult:t=>e({cleanResult:t}),setMergeResult:t=>e({mergeResult:t}),setDiff:(t,n)=>e(e=>({diffByDir:{...e.diffByDir,[t]:n}}))}));export{D as C,f as D,te as E,u as O,ae as S,C as T,P as _,xe as a,oe as b,ve as c,he as d,fe as f,F as g,L as h,Se as i,_e as l,J as m,Te as n,be as o,pe as p,Ce as r,ye as s,Ee as t,ge as u,j as v,x as w,ie as x,A as y};
|
|
7
|
+
`)}var ae=s()((e,t)=>({refs:[],addRef:n=>{let r=t();if(n.kind===`file`&&r.refs.find(e=>e.kind===`file`&&e.path===n.path))return;let i={...n,id:ne()};e({refs:[...r.refs,i]})},removeRef:t=>{e(e=>({refs:e.refs.filter(e=>e.id!==t)}))},clearRefs:()=>e({refs:[]})})),oe=s()(e=>({info:null,setInfo:t=>e({info:t}),clear:()=>e({info:null})})),A=s()((e,t)=>({result:null,loading:!1,currentSeq:0,setResult:t=>e(e=>t.reqSeq===e.currentSeq?{result:t,loading:!1}:{}),setLoading:()=>e({loading:!0,result:null}),clear:()=>e({result:null,loading:!1}),nextSeq:()=>{let n=t().currentSeq+1;return e({currentSeq:n}),n}})),j=s()(e=>({phases:[],activePhaseId:null,overallPercent:0,autonomous:!1,title:null,goal:null,status:`idle`,multiBoard:!1,lastEvent:null,lastError:null,graphs:[],progress:null,setState:t=>e(e=>({phases:t.phases??e.phases,activePhaseId:t.activePhaseId===void 0?e.activePhaseId:t.activePhaseId,overallPercent:t.overallPercent??e.overallPercent,autonomous:t.autonomous??e.autonomous,title:t.title===void 0?e.title:t.title,goal:t.goal===void 0?e.goal:t.goal,status:t.status??e.status,multiBoard:t.multiBoard??e.multiBoard,lastEvent:t.lastEvent===void 0?e.lastEvent:t.lastEvent,lastError:t.lastError===void 0?e.lastError:t.lastError,graphs:t.graphs??e.graphs,progress:t.progress===void 0?e.progress:t.progress})),clear:()=>e({phases:[],activePhaseId:null,overallPercent:0,autonomous:!1,title:null,goal:null,status:`idle`,multiBoard:!1,lastEvent:null,lastError:null,graphs:[],progress:null}),hydrateFromServer:e=>{e({type:`goal.list`}),e({type:`goal.state`})}}));function M(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!(typeof t.iteration!=`number`||!Number.isFinite(t.iteration)||t.task!==void 0&&typeof t.task!=`string`||t.status!==void 0&&typeof t.status!=`string`||t.progress!==void 0&&(typeof t.progress!=`number`||!Number.isFinite(t.progress))||t.progressNote!==void 0&&typeof t.progressNote!=`string`||t.timestamp!==void 0&&typeof t.timestamp!=`string`)}function N(e){return!e||typeof e.goal!=`string`||!e.goal.trim()?null:{goal:e.goal,refinedGoal:typeof e.refinedGoal==`string`?e.refinedGoal:void 0,goalState:[`active`,`paused`,`completed`,`failed`,`abandoned`].includes(e.goalState)?e.goalState:`active`,iterations:typeof e.iterations==`number`?e.iterations:0,progress:typeof e.progress==`number`?e.progress:0,progressNote:typeof e.progressNote==`string`?e.progressNote:void 0,progressTrend:e.progressTrend===`accelerating`?`up`:e.progressTrend===`stalling`?`down`:e.progressTrend===`steady`?`stable`:void 0,deliverables:Array.isArray(e.deliverables)?e.deliverables.map((e,t)=>typeof e==`string`?{id:`d${t}`,text:e,status:/^\[[x✓]\]|✅|\(done\)/i.test(e)?`done`:`pending`}:e):void 0,journal:Array.isArray(e.journal)?e.journal.filter(M):void 0,lastTask:typeof e.lastTask==`string`?e.lastTask:void 0,lastStatus:typeof e.lastStatus==`string`?e.lastStatus:void 0}}var P=s()(e=>({goal:null,setGoal:t=>e({goal:N(t)}),clear:()=>e({goal:null}),appendJournalEntry:t=>e(e=>e.goal?{goal:{...e.goal,iterations:Math.max(e.goal.iterations,t.iteration),lastTask:t.task??e.goal.lastTask,lastStatus:t.status??e.goal.lastStatus,journal:[t,...e.goal.journal??[]].slice(0,200)}}:e),refresh:()=>{try{t()?.send?.({type:`goal-state.get`})}catch{}}}));function F(e,t){return e.presence?.some(e=>e.active)===!0||e.tags?.some(e=>e.startsWith(`session:`)&&t.includes(e.slice(8)))===!0}var I=3e5,L=s()((e,t)=>({boards:[],boardTotal:0,activeBoardTotal:0,orphanedBoardTotal:0,activeBoardId:null,activeBoard:null,loading:!1,lastOutboundAction:null,error:null,queueHealth:null,supervisorSnapshot:null,workbench:null,verificationActivity:{},boardHistory:[],fetchBoardHistory:e=>{t().sendKanban(`kanban.board.history`,{boardId:e})},setLoading:t=>e({loading:t}),sendKanban:(t,n)=>(e({loading:!0,lastOutboundAction:t}),t),transitionTask:(t,n,r,i)=>{let a=`kanban.task.transition`;return e({loading:!0,lastOutboundAction:a}),a},dispatchTask:(t,n,r)=>{let i=`kanban.task.dispatch`;return e({loading:!0,lastOutboundAction:i}),i},moveTask:(t,n,r)=>{let i=`kanban.task.move`;return e({loading:!0,lastOutboundAction:i}),i},removeTask:(t,n)=>{let r=`kanban.task.remove`;return e({loading:!0,lastOutboundAction:r}),r},setActiveBoardId:t=>e({activeBoardId:t,queueHealth:null,supervisorSnapshot:null,verificationActivity:{}}),setError:t=>e({error:t}),setQueueHealth:t=>e({queueHealth:t}),handleResult:(n,r)=>{if(!r.success){e({loading:!1,error:r.error??`Kanban request failed`});return}let i=r.data;if((n===`kanban.supervisor.status`||n===`kanban.supervisor.audit`)&&i){e({supervisorSnapshot:i,loading:!1,error:null});return}if(n===`kanban.health`&&r.data){e({queueHealth:r.data,loading:!1,error:null});return}if(n===`kanban.workbench`&&r.data){e({workbench:r.data,loading:!1,error:null});return}if(n===`kanban.list`){let t=H(i)?i:null,n=t?t.items:Array.isArray(i)?i:[];e({boards:n,boardTotal:t?.total??n.length,activeBoardTotal:t?.activeTotal??n.filter(e=>U(e)).length,orphanedBoardTotal:t?.orphanedTotal??n.filter(e=>!U(e)).length,loading:!1,error:null});return}if(n===`kanban.delete`){let n=t().activeBoardId,r=i,a=r?.removed===!0,o=r?.boardId??n;e(e=>{let t=a?e.boards.find(e=>e.id===o):void 0,n=t?U(t):void 0;return{boards:a?e.boards.filter(e=>e.id!==o):e.boards,boardTotal:a?Math.max(0,e.boardTotal-1):e.boardTotal,activeBoardTotal:n===!0?Math.max(0,e.activeBoardTotal-1):e.activeBoardTotal,orphanedBoardTotal:n===!1?Math.max(0,e.orphanedBoardTotal-1):e.orphanedBoardTotal,activeBoardId:a&&e.activeBoardId===o?null:e.activeBoardId,activeBoard:a&&e.activeBoard?.id===o?null:e.activeBoard,loading:!1,error:null}});return}if(n===`kanban.task.remove`){let t=i;e(e=>{let n=R(t?.board)?t.board:null;if(n&&e.activeBoardId===n.id)return{boards:K(e.boards,G(n)),activeBoard:n,loading:!1,error:null};let r=t?.boardId,i=t?.taskId,a=t?.removed===!0&&i&&e.activeBoard&&(!r||e.activeBoard.id===r)?{...e.activeBoard,tasks:e.activeBoard.tasks.filter(e=>e.id!==i)}:e.activeBoard;return{activeBoard:a,boards:a?K(e.boards,G(a)):e.boards,loading:!1,error:null}});return}if(n===`kanban.board.history`){Array.isArray(i)&&e({boardHistory:i});return}if(n===`kanban.task.verification_started`){let t=i;if(t?.boardId&&t.taskId){let n=`${t.boardId}:${t.taskId}`;e(e=>{let t=Date.now(),r=Object.fromEntries(Object.entries(e.verificationActivity).filter(([,e])=>t-e.startedAt<I));return r[n]={startedAt:t},{verificationActivity:r,loading:!1,error:null}})}return}if(n===`kanban.task.verification_completed`&&B(i)){let t=`${i.boardId}:${i.task.id}`;e(e=>{let n={...e.verificationActivity};if(delete n[t],e.activeBoard&&e.activeBoard.id===i.boardId){let t=q(e.activeBoard,i.task);return{verificationActivity:n,boards:K(e.boards,G(t)),activeBoard:t,loading:!1,error:null}}return{verificationActivity:n,loading:!1,error:null}});return}if(V(i)){let t=i.board;e(e=>({boards:K(e.boards,G(t)),activeBoard:e.activeBoardId===t.id?t:e.activeBoard,loading:!1,error:null}));return}if(B(i)){e(e=>{if(e.activeBoard&&e.activeBoard.id===i.boardId){let t=q(e.activeBoard,i.task);return{boards:K(e.boards,G(t)),activeBoard:t,loading:!1,error:null}}return{loading:!1,error:null}});return}if(R(i)){let t=G(i);if(n!==`kanban.create`&&n!==`kanban.duplicate`&&n!==`kanban.generate`){e(e=>({boards:K(e.boards,t),activeBoard:e.activeBoardId===i.id?i:e.activeBoard,loading:!1,error:null}));return}e(e=>({boards:K(e.boards,t),activeBoardId:i.id,activeBoard:i,loading:!1,error:null}));return}if(z(i)){e(e=>({...e.activeBoard?(()=>{let t=q(e.activeBoard,i);return{activeBoard:t,boards:K(e.boards,G(t))}})():{activeBoard:e.activeBoard},loading:!1,error:null}));return}if(Array.isArray(i)&&i.every(W)){e(e=>({...e.activeBoard?(()=>{let t={...e.activeBoard,columns:i};return{activeBoard:t,boards:K(e.boards,G(t))}})():{activeBoard:e.activeBoard},loading:!1,error:null}));return}e({loading:!1,error:null})}}));function R(e){return!!e&&typeof e==`object`&&Array.isArray(e.columns)&&Array.isArray(e.tasks)}function z(e){return!!e&&typeof e==`object`&&typeof e.title==`string`}function B(e){return!!e&&typeof e==`object`&&typeof e.boardId==`string`&&z(e.task)}function V(e){return!!e&&typeof e==`object`&&R(e.board)}function H(e){return!!e&&typeof e==`object`&&Array.isArray(e.items)&&typeof e.total==`number`}function U(e){return F(e,[])}function W(e){return!!e&&typeof e==`object`&&typeof e.id==`string`}function G(e){return{id:e.id,title:e.title,description:e.description,tags:e.tags,presence:e.presence,createdAt:e.createdAt,updatedAt:e.updatedAt,columnCount:e.columns.length,taskCount:e.tasks.length,completedTaskCount:e.tasks.filter(e=>e.status===`completed`).length}}function K(e,t){return[t,...e.filter(e=>e.id!==t.id)].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function q(e,t){let n=e.tasks.some(e=>e.id===t.id)?e.tasks.map(e=>e.id===t.id?t:e):[...e.tasks,t];return{...e,tasks:n}}function se(e){switch(e){case`tui`:return`tui`;case`cli`:case`repl`:return`repl`;case`webui`:return`webui`;default:return`webui`}}function ce(e){let t={tui:0,webui:0,repl:0},n=0,r=0,i={toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0};for(let a of e){t[se(a.clientType)]+=1;for(let e of a.agents)n+=1,(e.status===`running`||e.status===`streaming`)&&(r+=1),i.toolCalls+=e.toolCalls??0,i.costUsd+=e.costUsd??0,i.tokensIn+=e.tokensIn??0,i.tokensOut+=e.tokensOut??0}return{clientCounts:t,totalAgents:n,activeAgents:r,aggregate:i}}function le(e){if(e!==void 0)return Number.isFinite(e)?Math.max(0,Math.min(100,Math.round(e))):0}function ue(e){return e.map(e=>({...e,agents:e.agents.map(e=>({...e,ctxPct:le(e.ctxPct)}))}))}var de=0,J=s()(e=>({clientCounts:{tui:0,webui:0,repl:0},mailActivity:[],totalMessages:0,openMessages:0,unreadMessages:0,totalAgents:0,activeAgents:0,currentSession:{},liveSessions:[],aggregate:{toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0},lastUpdated:Date.now(),setClientCounts:t=>e({clientCounts:t,lastUpdated:Date.now()}),setLiveSessions:t=>{let n=ue(t),r=J.getState().liveSessions;if(r.length===n.length){let e=!0;for(let t=0;t<n.length;t++){let i=n[t],a=r[t];if(i.sessionId!==a.sessionId||i.status!==a.status||i.agentCount!==a.agentCount||i.startedAt!==a.startedAt||i.lastHeartbeatAt!==a.lastHeartbeatAt){e=!1;break}let o=i.agents??[],s=a.agents??[];if(o.length!==s.length){e=!1;break}for(let t=0;t<o.length;t++)if(o[t].id!==s[t].id||o[t].name!==s[t].name||o[t].status!==s[t].status||o[t].currentTool!==s[t].currentTool||o[t].iterations!==s[t].iterations||o[t].toolCalls!==s[t].toolCalls||o[t].ctxPct!==s[t].ctxPct||o[t].tokensIn!==s[t].tokensIn||o[t].tokensOut!==s[t].tokensOut||o[t].costUsd!==s[t].costUsd||o[t].recentTools?.[0]?.id!==s[t].recentTools?.[0]?.id||o[t].recentMail?.[0]?.id!==s[t].recentMail?.[0]?.id||o[t].activity?.reads!==s[t].activity?.reads||o[t].activity?.writes!==s[t].activity?.writes||o[t].activity?.edits!==s[t].activity?.edits||o[t].activity?.terminalCalls!==s[t].activity?.terminalCalls||o[t].activity?.mailReceived!==s[t].activity?.mailReceived||o[t].activity?.mailSent!==s[t].activity?.mailSent||o[t].activity?.linesAdded!==s[t].activity?.linesAdded||o[t].activity?.linesRemoved!==s[t].activity?.linesRemoved){e=!1;break}if(!e)break}if(e)return}e({liveSessions:n,...ce(n),lastUpdated:Date.now()})},addMailActivity:t=>e(e=>({mailActivity:[{...t,seq:t.seq??++de},...e.mailActivity].slice(0,50),lastUpdated:Date.now()})),setMailStats:(t,n,r)=>e({totalMessages:t,openMessages:n,unreadMessages:r,lastUpdated:Date.now()}),setAgentStats:(t,n)=>e({totalAgents:t,activeAgents:n,lastUpdated:Date.now()}),setCurrentSession:t=>e({currentSession:{...J.getState().currentSession,...t},lastUpdated:Date.now()}),clear:()=>e({clientCounts:{tui:0,webui:0,repl:0},mailActivity:[],totalMessages:0,openMessages:0,unreadMessages:0,totalAgents:0,activeAgents:0,currentSession:{},liveSessions:[],aggregate:{toolCalls:0,costUsd:0,tokensIn:0,tokensOut:0},lastUpdated:Date.now()})})),fe=[3e4,6e4,12e4,3e5,6e5],Y=12e4,pe=s()(a(e=>({viewMode:`office`,showHud:!0,showLegend:!0,showMinimap:!0,showControls:!0,animateEdges:!0,showFeed:!0,background:`dots`,waitThresholdMs:Y,setViewMode:t=>e({viewMode:t}),setShowHud:t=>e({showHud:t}),setShowLegend:t=>e({showLegend:t}),setShowMinimap:t=>e({showMinimap:t}),setShowControls:t=>e({showControls:t}),setAnimateEdges:t=>e({animateEdges:t}),setShowFeed:t=>e({showFeed:t}),setBackground:t=>e({background:t}),setWaitThresholdMs:t=>e({waitThresholdMs:Number.isFinite(t)&&t>0?Math.round(t):Y})}),{name:`wrongstack-officemap`}));function X(e){return`${e.providerId}\u0000${e.meterId}`}function me(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.providerId==`string`&&typeof t.meterId==`string`&&Array.isArray(t.windows)&&typeof t.capturedAt==`number`}var he=s(e=>({meters:{},apply:t=>e(e=>{let n={...e.meters};for(let e of t){if(!me(e))continue;let t=n[X(e)];n[X(e)]={...e,...e.planLabel===void 0&&t?.planLabel!==void 0?{planLabel:t.planLabel}:{},...e.meterLabel===void 0&&t?.meterLabel!==void 0?{meterLabel:t.meterLabel}:{}}}return{meters:n}}),clear:()=>e({meters:{}})}));function ge(e){let t;for(let n of Object.values(e))for(let e of n.windows){if(!t||e.usedPercent>t.window.usedPercent){t={snapshot:n,window:e};continue}if(e.usedPercent===t.window.usedPercent){let r=e.resetsAt,i=t.window.resetsAt;r!==void 0&&(i===void 0||r<i)&&(t={snapshot:n,window:e})}}return t}function _e(e){if(e.label)return e.label;let t=e.windowMinutes;return t!==void 0&&Number.isFinite(t)&&t>0?t%1440==0?`${t/1440}d`:t%60==0?`${t/60}h`:`${t}m`:e.id}function ve(e,t=Date.now()){if(e?.resetsAt===void 0)return;let n=e.resetsAt*1e3-t;if(n<=0)return;let r=Math.floor(n/6e4);if(r<1)return`${Math.max(1,Math.round(n/1e3))}s`;let i=Math.floor(r/1440),a=Math.floor(r%1440/60),o=r%60;return i>0?a>0?`${i}d ${a}h`:`${i}d`:a>0?o>0?`${a}h ${o}m`:`${a}h`:`${o}m`}var Z=e=>`${e.providerId}\u0000${e.model}`,ye=s(e=>({entries:{},audit:[],summary:null,loading:!1,error:null,update:t=>e(e=>{let n={...e.entries},r=Z(t);if(t.state===`healthy`)delete n[r];else{let e=n[r],i=Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0));n[r]={...e,...i}}return{entries:n}}),hydrate:t=>e({entries:Object.fromEntries(t.filter(e=>e.state!==`healthy`).map(e=>[Z(e),e]))}),applySnapshot:t=>{let n=t.statuses;if(!Array.isArray(n)){e({error:`Invalid snapshot from server`,loading:!1});return}let r={};for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=typeof t.providerId==`string`?t.providerId:``,i=typeof t.model==`string`?t.model:``;if(!n||!i)continue;let a=t.state;(a===`healthy`||a===`degraded`||a===`blocked`)&&(r[`${n}\u0000${i}`]={providerId:n,model:i,state:a,reason:(typeof t.lastErrorKind==`string`?t.lastErrorKind:``)||a,updatedAt:typeof t.lastFailureAt==`number`?t.lastFailureAt:Date.now(),...typeof t.stateExpiresAt==`number`?{stateExpiresAt:t.stateExpiresAt}:{},...typeof t.consecutiveFailures==`number`?{consecutiveFailures:t.consecutiveFailures}:{},...typeof t.totalFailures==`number`?{totalFailures:t.totalFailures}:{},...typeof t.rateLimitHits==`number`?{rateLimitHits:t.rateLimitHits}:{},...typeof t.lastErrorMessage==`string`?{lastErrorMessage:t.lastErrorMessage}:{},...typeof t.lastErrorKind==`string`?{lastErrorKind:t.lastErrorKind}:{},...typeof t.lastErrorStatus==`number`?{lastErrorStatus:t.lastErrorStatus}:{},...Array.isArray(t.recentErrors)?{recentErrors:t.recentErrors.slice(0,20)}:{},...typeof t.lastSessionId==`string`?{lastSessionId:t.lastSessionId}:{},...typeof t.lastAgentId==`string`?{lastAgentId:t.lastAgentId}:{},...typeof t.lastFailureAt==`number`?{lastFailureAt:t.lastFailureAt}:{}})}let i=t;e({entries:r,summary:{totalPairs:typeof i.totalPairs==`number`?i.totalPairs:0,healthy:typeof i.healthy==`number`?i.healthy:0,degraded:typeof i.degraded==`number`?i.degraded:0,blocked:typeof i.blocked==`number`?i.blocked:0,totalFailures:typeof i.totalFailures==`number`?i.totalFailures:0,totalRateLimits:typeof i.totalRateLimits==`number`?i.totalRateLimits:0},error:null,loading:!1})},setAudit:t=>e({audit:t}),setLoading:t=>e({loading:t}),setError:t=>e({error:t,loading:!1}),removeEntry:(t,n)=>e(e=>{let r={...e.entries};return delete r[Z({providerId:t,model:n})],{entries:r}}),clear:()=>e({entries:{},audit:[],summary:null,error:null})})),be=s()(e=>({snapshot:null,boards:[],lifecycleResult:null,destroying:!1,setSnapshot:t=>e({snapshot:t}),setBoards:t=>e({boards:t}),setLifecycleResult:t=>e({lifecycleResult:t}),setDestroying:t=>e({destroying:t})})),xe=s()(e=>({snapshot:null,agentText:``,error:null,startedRunId:null,setSnapshot:t=>{if(t.discarded||t.phase===`idle`&&!t.sessionId){e({snapshot:null,agentText:``,error:null});return}e({snapshot:t,error:null,...t.lastAgentText?{agentText:t.lastAgentText}:{}})},setAgentText:t=>e({agentText:t}),setError:t=>e({error:t}),setStartedRunId:t=>e({startedRunId:t}),reset:()=>e({snapshot:null,agentText:``,error:null,startedRunId:null})})),Se=f(e=>({sideEffects:[],loading:!1,setSideEffects:t=>e({sideEffects:t,loading:!1}),setLoading:t=>e({loading:t}),clear:()=>e({sideEffects:[],loading:!1})})),Ce=s()(e=>({specs:[],detail:null,expandedSpecId:null,setSpecs:t=>e({specs:t}),setDetail:t=>e({detail:t}),setExpanded:t=>e({expandedSpecId:t,detail:null})})),we=new Set([`idle`,`queued`,`discovering`,`inventorying`,`enriching`,`researching`,`synthesizing`,`completed`,`failed`,`cancelled`]);function Q(e){return we.has(e)?e:void 0}var $={snapshot:null,stale:!1,loading:!1,error:null,activeJob:null,lastWorkspaceId:null,reportId:null},Te=s()(e=>({...$,setSnapshot:(t,n=!1)=>e(e=>({snapshot:t,stale:n,loading:!1,error:null,activeJob:e.activeJob?{...e.activeJob,status:`completed`,error:null}:null})),setLoading:t=>e({loading:t}),setError:t=>e({error:t,loading:!1}),jobStarted:(t,n)=>e({activeJob:{id:t,kind:n,status:`queued`,progress:null,error:null},error:null,loading:!0}),jobProgress:(t,n)=>e(e=>{if(e.activeJob?.id!==t)return e;let r=Q(n.phase);return r?{activeJob:{...e.activeJob,status:r,progress:n},loading:!0}:e}),jobFailed:(t,n)=>e(e=>e.activeJob?.id===t?{activeJob:{...e.activeJob,status:`failed`,error:n},error:n,loading:!1}:e),jobCancelled:t=>e(e=>({activeJob:e.activeJob?.id===t?{...e.activeJob,status:`cancelled`,error:null}:e.activeJob,loading:!1})),workspaceCompleted:t=>e({lastWorkspaceId:t}),reportReady:t=>e({reportId:t}),clear:()=>e($)})),Ee=s()(e=>({worktrees:[],baseBranch:``,activity:[],orphans:[],canClean:!1,cleanResult:null,mergeResult:null,diffByDir:{},setSnapshot:(t,n)=>e({worktrees:t,baseBranch:n}),pushEvent:t=>e(e=>({activity:[...e.activity,t].slice(-40)})),setOrphans:(t,n,r)=>e({orphans:t,canClean:n,cleanBlockedReason:r}),setCleanResult:t=>e({cleanResult:t}),setMergeResult:t=>e({mergeResult:t}),setDiff:(t,n)=>e(e=>({diffByDir:{...e.diffByDir,[t]:n}}))}));export{D as C,f as D,te as E,u as O,ae as S,C as T,P as _,xe as a,oe as b,ve as c,he as d,fe as f,F as g,L as h,Se as i,_e as l,J as m,Te as n,be as o,pe as p,Ce as r,ye as s,Ee as t,ge as u,j as v,x as w,ie as x,A as y};
|
package/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
12
12
|
<meta name="apple-mobile-web-app-title" content="WrongStack" />
|
|
13
13
|
<title>WrongStack WebUI</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-3TGBKeBP.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/react-core-wiHys0m2.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/xyflow-BqDBClm9.js">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/chat-store-DNRce6sE.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/codemap-activity-store-Ha7XbGgq.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/mailbox-store-C49LeBj8.js">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/stores-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/stores-RkHrTaRO.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/dialog-C7EIBM_2.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/button-9ewV4TF3.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/input-ag1CrUiS.js">
|
package/dist/index.js
CHANGED
|
@@ -131112,12 +131112,12 @@ function ContextWindowEditor({
|
|
|
131112
131112
|
}
|
|
131113
131113
|
|
|
131114
131114
|
// src/components/ProviderWaitingRoom.tsx
|
|
131115
|
+
init_i18n();
|
|
131115
131116
|
import { AlertTriangle as AlertTriangle37, CheckCircle2 as CheckCircle229, Clock3 as Clock311, RefreshCw as RefreshCw36, RotateCcw as RotateCcw20, Trash2 as Trash227 } from "lucide-react";
|
|
131116
131117
|
import { useCallback as useCallback82, useEffect as useEffect132, useMemo as useMemo83, useState as useState143 } from "react";
|
|
131117
131118
|
init_ws_client();
|
|
131118
131119
|
init_stores();
|
|
131119
131120
|
init_local_prefs();
|
|
131120
|
-
init_i18n();
|
|
131121
131121
|
import { jsx as jsx267, jsxs as jsxs255 } from "react/jsx-runtime";
|
|
131122
131122
|
function remaining(expiresAt, now) {
|
|
131123
131123
|
if (!expiresAt) return "reset time unknown";
|
|
@@ -131197,41 +131197,41 @@ function ProviderWaitingRoom() {
|
|
|
131197
131197
|
const degraded = visible.length - blocked;
|
|
131198
131198
|
const _selected = selectedKey ? entriesByKey[selectedKey] : null;
|
|
131199
131199
|
return /* @__PURE__ */ jsxs255("div", { className: "mx-auto mb-2 max-w-6xl rounded-lg border border-warning/25 bg-warning/5 text-xs", children: [
|
|
131200
|
-
/* @__PURE__ */ jsxs255(
|
|
131201
|
-
|
|
131202
|
-
|
|
131203
|
-
|
|
131204
|
-
|
|
131205
|
-
|
|
131206
|
-
|
|
131207
|
-
|
|
131208
|
-
|
|
131209
|
-
|
|
131210
|
-
|
|
131211
|
-
|
|
131212
|
-
|
|
131213
|
-
|
|
131214
|
-
|
|
131215
|
-
|
|
131216
|
-
|
|
131217
|
-
|
|
131218
|
-
|
|
131219
|
-
"
|
|
131220
|
-
|
|
131221
|
-
|
|
131222
|
-
|
|
131223
|
-
|
|
131224
|
-
|
|
131225
|
-
|
|
131226
|
-
|
|
131227
|
-
|
|
131228
|
-
|
|
131229
|
-
|
|
131230
|
-
),
|
|
131231
|
-
/* @__PURE__ */ jsx267(
|
|
131232
|
-
|
|
131233
|
-
|
|
131234
|
-
),
|
|
131200
|
+
/* @__PURE__ */ jsxs255("div", { className: "flex w-full items-center gap-2 px-3 py-2 hover:bg-warning/5", children: [
|
|
131201
|
+
/* @__PURE__ */ jsxs255(
|
|
131202
|
+
"button",
|
|
131203
|
+
{
|
|
131204
|
+
type: "button",
|
|
131205
|
+
className: "flex flex-1 items-center gap-2 text-left",
|
|
131206
|
+
onClick: () => setExpanded((value) => !value),
|
|
131207
|
+
"aria-expanded": expanded,
|
|
131208
|
+
children: [
|
|
131209
|
+
/* @__PURE__ */ jsx267(AlertTriangle37, { className: "h-3.5 w-3.5 text-warning" }),
|
|
131210
|
+
/* @__PURE__ */ jsx267("span", { className: "font-medium text-foreground", children: t("activity:providerWait.providerModelAvailability") }),
|
|
131211
|
+
/* @__PURE__ */ jsxs255("span", { className: "text-muted-foreground", children: [
|
|
131212
|
+
blocked,
|
|
131213
|
+
" blocked \xB7 ",
|
|
131214
|
+
degraded,
|
|
131215
|
+
" degraded \xB7 ",
|
|
131216
|
+
activeRules.length,
|
|
131217
|
+
" scheduled"
|
|
131218
|
+
] }),
|
|
131219
|
+
/* @__PURE__ */ jsx267("span", { className: "ml-auto text-muted-foreground", children: expanded ? "Hide" : "Details" })
|
|
131220
|
+
]
|
|
131221
|
+
}
|
|
131222
|
+
),
|
|
131223
|
+
/* @__PURE__ */ jsx267(
|
|
131224
|
+
"button",
|
|
131225
|
+
{
|
|
131226
|
+
type: "button",
|
|
131227
|
+
className: "inline-flex items-center gap-1 text-muted-foreground transition-colors hover:text-foreground",
|
|
131228
|
+
onClick: refresh,
|
|
131229
|
+
title: t("activity:providerWait.refreshStatus"),
|
|
131230
|
+
"aria-label": t("activity:providerWait.refreshStatus"),
|
|
131231
|
+
children: /* @__PURE__ */ jsx267(RefreshCw36, { className: "h-3 w-3" })
|
|
131232
|
+
}
|
|
131233
|
+
)
|
|
131234
|
+
] }),
|
|
131235
131235
|
expanded && /* @__PURE__ */ jsxs255("div", { className: "border-t border-warning/15 px-3 py-2", children: [
|
|
131236
131236
|
visible.map((entry) => {
|
|
131237
131237
|
const key2 = `${entry.providerId}\0${entry.model}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/webui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Browser-based WebUI for WrongStack — React + Vite frontend. The WebSocket backend lives in the separate @wrongstack/webui-server package (extracted in PR #018b to remove the CLI -> @wrongstack/webui/server cross-package edge).",
|
|
6
6
|
"keywords": [
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
"@radix-ui/react-tabs": "^1.1.21",
|
|
88
88
|
"@tanstack/react-virtual": "^3.14.12",
|
|
89
89
|
"@uiw/react-textarea-code-editor": "^3.1.1",
|
|
90
|
-
"@wrongstack/core": "1.0.
|
|
91
|
-
"@wrongstack/kanban": "1.0.
|
|
92
|
-
"@wrongstack/plugins": "1.0.
|
|
93
|
-
"@wrongstack/providers": "1.0.
|
|
94
|
-
"@wrongstack/tools": "1.0.
|
|
95
|
-
"@wrongstack/webui-protocol": "1.0.
|
|
90
|
+
"@wrongstack/core": "1.0.15",
|
|
91
|
+
"@wrongstack/kanban": "1.0.15",
|
|
92
|
+
"@wrongstack/plugins": "1.0.15",
|
|
93
|
+
"@wrongstack/providers": "1.0.15",
|
|
94
|
+
"@wrongstack/tools": "1.0.15",
|
|
95
|
+
"@wrongstack/webui-protocol": "1.0.15",
|
|
96
96
|
"@xterm/addon-fit": "^0.11.0",
|
|
97
97
|
"@xterm/xterm": "^6.0.0",
|
|
98
98
|
"@xyflow/react": "^12.11.6",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"@types/ws": "^8.18.1",
|
|
129
129
|
"@vitejs/plugin-react": "^6.1.1",
|
|
130
130
|
"@vitest/coverage-v8": "^5.0.0",
|
|
131
|
-
"@wrongstack/sdd": "1.0.
|
|
132
|
-
"@wrongstack/webui-server": "1.0.
|
|
131
|
+
"@wrongstack/sdd": "1.0.15",
|
|
132
|
+
"@wrongstack/webui-server": "1.0.15",
|
|
133
133
|
"jsdom": "^30.0.1",
|
|
134
134
|
"tailwindcss": "^4.3.3",
|
|
135
135
|
"typescript": "^7.0.2",
|