@wrongstack/webui 0.298.0 → 0.298.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentRosterView-C8j2NuD1.js → AgentRosterView-C26RCdot.js} +4 -4
- package/dist/assets/{AnalyticsDashboard-D2_HYmYw.js → AnalyticsDashboard-CEjjV3bX.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-SzXptIQj.js → AudienceMemoryPanel-CnfZC8x0.js} +2 -2
- package/dist/assets/{ChangesView-D31wr7_h.js → ChangesView-D0BiTbs8.js} +1 -1
- package/dist/assets/ChronicleDashboard-BZ4XOcvf.js +1 -0
- package/dist/assets/CodeEditor-BlqaT56D.js +1 -0
- package/dist/assets/CodeMap-Bj5tjjW5.js +1 -0
- package/dist/assets/{CronJobsPanel-C9shS0P2.js → CronJobsPanel-F6nhZtfg.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-CHud_Ugp.js → DeadCodeScanPanel-C9sLNUUc.js} +1 -1
- package/dist/assets/{DebugDashboard-DmqpGXnx.js → DebugDashboard-D8BLcLjI.js} +1 -1
- package/dist/assets/{DesignGalleryView-CnAHpKa1.js → DesignGalleryView-B8mE5nGy.js} +1 -1
- package/dist/assets/GoalView-DIx7Zr4a.js +1 -0
- package/dist/assets/KanbanView-DshzDwq1.js +3 -0
- package/dist/assets/{MailboxDetailView-CQtHeWVs.js → MailboxDetailView-BJXpXjtm.js} +1 -1
- package/dist/assets/MemoryManager-B-S5oREO.js +1 -0
- package/dist/assets/{ModelPicker-Dt0wCi90.js → ModelPicker-CNHhT2SO.js} +1 -1
- package/dist/assets/OfficeMapPanel-CBN9uG80.js +4 -0
- package/dist/assets/{ProcessMonitor-Dq760Vqm.js → ProcessMonitor-Cc8LsfTh.js} +1 -1
- package/dist/assets/{QueuePanel-ZcJliKcY.js → QueuePanel-B0NXFwEt.js} +1 -1
- package/dist/assets/{RefreshDebugView-SivBV0LN.js → RefreshDebugView-DLst_piS.js} +1 -1
- package/dist/assets/{SageTabs-CGrc4PuM.js → SageTabs-NwMcr4Pq.js} +2 -2
- package/dist/assets/SddHub-CpRHXmjm.js +2 -0
- package/dist/assets/SessionsDashboard-C5dXb0iJ.js +1 -0
- package/dist/assets/SetupScreen-B81fcNgP.js +1 -0
- package/dist/assets/SkillDetailView-BTvgE_MD.js +3 -0
- package/dist/assets/{SpecsView-CzYtHNbj.js → SpecsView-DhuaZcOl.js} +1 -1
- package/dist/assets/TechStackView-BXmfl2qY.js +1 -0
- package/dist/assets/{TerminalPanel-BRSYloOD.js → TerminalPanel-DjruTcb6.js} +1 -1
- package/dist/assets/{Toaster-Bd6ckyrP.js → Toaster-BmyghnqJ.js} +1 -1
- package/dist/assets/{button-Clh96jMK.js → button-BMECp1cg.js} +1 -1
- package/dist/assets/{chat-Du7n7HZ7.js → chat-CRmMDzCb.js} +1 -1
- package/dist/assets/{chat-VkTBQmmx.js → chat-CwnuX7tG.js} +1 -1
- package/dist/assets/{chat-BJzPxfyr.js → chat-DLn1hY01.js} +1 -1
- package/dist/assets/{chat-IRKmQ6we.js → chat-DSEq1Bdz.js} +1 -1
- package/dist/assets/{chat-C7ybebfi.js → chat-DxLD17ER.js} +1 -1
- package/dist/assets/{chat-BRBVFl4h.js → chat-DzPxYALH.js} +1 -1
- package/dist/assets/{chat-Bkom8vQo.js → chat-OunddzYy.js} +1 -1
- package/dist/assets/{chat-store-CWhuSNod.js → chat-store-B2CjP2Zl.js} +2 -2
- package/dist/assets/{codemap-activity-store-C1XWbXeZ.js → codemap-activity-store-Cz0_AHqt.js} +1 -1
- package/dist/assets/codemap-index-store-B-XLZpJu.js +1 -0
- package/dist/assets/{dialog-DYJUM0p1.js → dialog-BJef9ZZo.js} +1 -1
- package/dist/assets/{empty-state-BV-Y8c35.js → empty-state-BGzRrNXI.js} +1 -1
- package/dist/assets/{i18n-DOuSY1L8.js → i18n-2wGPPdl_.js} +2 -2
- package/dist/assets/index-DeA8UyiB.css +1 -0
- package/dist/assets/index-x6-rLl5H.js +132 -0
- package/dist/assets/{input-CW-Yw2Wu.js → input-Bd10nfMj.js} +1 -1
- package/dist/assets/{mailbox-store-_8voaug1.js → mailbox-store-D3omLzBk.js} +1 -1
- package/dist/assets/progress-ring-BEULkQ1r.js +1 -0
- package/dist/assets/{roster-ws-q8Cp6us7.js → roster-ws-BmV_3U6w.js} +1 -1
- package/dist/assets/{session-store-D4JWBP5w.js → session-store-ZMNU48xK.js} +1 -1
- package/dist/assets/{settings-B9EPDhAL.js → settings-BF0lRxlj.js} +1 -1
- package/dist/assets/{settings-DWIDXI2K.js → settings-CP6cwqHD.js} +1 -1
- package/dist/assets/{settings-tyKsHhya.js → settings-D0rWEhMg.js} +1 -1
- package/dist/assets/{settings-r_KOGrbF.js → settings-DFCaP02p.js} +1 -1
- package/dist/assets/{settings-BoXoFVdx.js → settings-DHix1ZPL.js} +1 -1
- package/dist/assets/{settings-BBNOO9wC.js → settings-eEzjNzsC.js} +1 -1
- package/dist/assets/{settings-CkXKHC77.js → settings-kp_aIgcX.js} +1 -1
- package/dist/assets/{shared-DidGznBo.js → shared-CrX8iE-U.js} +1 -1
- package/dist/assets/{stores-CpZiOiOP.js → stores-DyQOSkkD.js} +2 -2
- package/dist/assets/ui-store-di6oY7cy.js +1 -0
- package/dist/assets/{useWebSocket-BTXT0rOW.js → useWebSocket-BVFPigcY.js} +16 -16
- package/dist/assets/{utils-DxDx8yib.js → utils-CwJvjOcH.js} +1 -1
- package/dist/assets/{vendor-BTDGplXK.js → vendor-BTTkQ9Tn.js} +27 -27
- package/dist/assets/{view-navigation-BRtuAwZo.js → view-navigation-BMRzqGbq.js} +1 -1
- package/dist/assets/ws-client-B0-KwuTK.js +1 -0
- package/dist/components/MemoryManager/MemoryInjectorPanel.d.ts +19 -0
- package/dist/components/SettingsPanel/PluginToggleList.d.ts +11 -1
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +1 -0
- package/dist/index.html +22 -22
- package/dist/index.js +7803 -7535
- package/dist/lib/sage-block.d.ts +18 -23
- package/dist/stores/local-prefs.d.ts +2 -2
- package/dist/stores/types.d.ts +2 -1
- package/dist/types/server-message.d.ts +11 -0
- package/package.json +10 -9
- package/dist/assets/ChronicleDashboard-B7P4f1hr.js +0 -1
- package/dist/assets/CodeEditor-BRDwx8Y-.js +0 -1
- package/dist/assets/CodeMap-uabWaeJH.js +0 -1
- package/dist/assets/GoalView-DaptZIKr.js +0 -1
- package/dist/assets/KanbanView-DA5Ulb8C.js +0 -3
- package/dist/assets/MemoryManager-BWuSS0Pg.js +0 -1
- package/dist/assets/OfficeMapPanel-CUNRI3X7.js +0 -4
- package/dist/assets/SddHub-oU47Hv8Y.js +0 -2
- package/dist/assets/SessionsDashboard-Dp-Mr844.js +0 -1
- package/dist/assets/SetupScreen-BWA_dTU0.js +0 -1
- package/dist/assets/SkillDetailView-DmRgd_uu.js +0 -3
- package/dist/assets/TechStackView-p9PKj9pQ.js +0 -1
- package/dist/assets/codemap-index-store-DDT3gP6t.js +0 -1
- package/dist/assets/index-C09Opuro.css +0 -1
- package/dist/assets/index-DxZTscTk.js +0 -132
- package/dist/assets/progress-ring-DPV94fM-.js +0 -1
- package/dist/assets/ui-store-C-oyG_br.js +0 -1
- package/dist/assets/ws-client-DqIqzkfU.js +0 -1
- package/dist/components/MemoryManager/MemoryInjectorTrace.d.ts +0 -3
- package/dist/components/SageMemoryCard.d.ts +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_a as e,
|
|
1
|
+
import{_a as e,va as t}from"./vendor-BTTkQ9Tn.js";import{n}from"./utils-CwJvjOcH.js";function r(e,t){if(e==null){let e=Error(t?`Expected ${t} to be defined`:`Expected value to be defined`);throw e.name=`ExpectDefinedError`,e}return e}function i(e){return e!==`tool_use`&&e!==`tool_call`}var a=/<nextsteps\b[^>]*>\s*\n+/i,o=/^(?:(\d+)[.)]\s*|[-*•]\s*)(.+?)(\s+auto="true")?$/,s=6;function c(e,t=!1,n=!0){return n?d(e,t):u(e)}function l(e,t,n,r){e.push(r?{index:t,text:n,auto:!0}:{index:t,text:n})}function u(e){let t=e.split(`
|
|
2
2
|
`),n=[],r=new Set;for(let e of t){let t=e.trim();if(!t)continue;let i=o.exec(t);if(!i)continue;let a=i[1],c=i[2].trim(),u;if(u=a===void 0?n.length+1:Number.parseInt(a,10),r.has(u))continue;r.add(u);let d=!!i[3]&&n.length===0&&u===1;if(l(n,u,c,d),n.length>=s)break}return{steps:n,texts:n.map(e=>e.text),stripped:e,autoTexts:n.filter(e=>e.auto).map(e=>e.text)}}function d(e,t){let n=a.exec(e);if(!n)return{steps:[],texts:[],stripped:e,autoTexts:[]};let r=n.index+n[0].length,i=e.slice(r),c=i.split(`
|
|
3
3
|
`),u=[],d=new Set;for(let e of c){let t=e.trim();if(!t)continue;let n=o.exec(t);if(!n)break;let r=n[1],i=n[2].trim(),a;if(a=r===void 0?u.length+1:Number.parseInt(r,10),d.has(a))continue;d.add(a);let c=!!n[3]&&u.length===0&&a===1;if(l(u,a,i,c),u.length>=s)break}if(u.length===0||!i.includes(`</nextsteps>`))return{steps:[],texts:[],stripped:e,autoTexts:[]};let p=u.map(e=>e.text),m=u.filter(e=>e.auto).map(e=>e.text),h=n.index,g=n[0].length+f(i,u.length);return{steps:u,texts:p,stripped:(e.slice(0,h)+e.slice(h+g)).replace(/\n{3,}/g,`
|
|
4
4
|
|
|
@@ -14,4 +14,4 @@ import{_a as e,ga as t}from"./vendor-BTDGplXK.js";import{n}from"./utils-DxDx8yib
|
|
|
14
14
|
|
|
15
15
|
… [older streamed text omitted to protect memory] …
|
|
16
16
|
|
|
17
|
-
`+e.slice(e.length-(n-r))}function w(e){if(e===void 0)return 0;try{return JSON.stringify(e).length*2}catch{return S*2}}function T(e,t){let n=C(e.content,t),r=e.toolResult===void 0?void 0:C(e.toolResult,t),i=e.thinkingLog?{...e.thinkingLog,text:C(e.thinkingLog.text,t)}:void 0,a=w(e.toolInput)>t*2?`[tool input omitted from live transcript to protect memory]`:e.toolInput;return n===e.content&&r===e.toolResult&&i?.text===e.thinkingLog?.text&&a===e.toolInput?e:{...e,content:n,...r===void 0?{}:{toolResult:r},...i?{thinkingLog:i}:{},...a===void 0?{}:{toolInput:a}}}function E(e){let t=384+e.content.length*2+(e.toolResult?.length??0)*2+(e.thinkingLog?.text.length??0)*2+w(e.toolInput);for(let n of e.attachments??[])t+=(n.dataUrl?.length??0)*2+192;for(let n of e.sageLines??[])t+=n.length*2;for(let n of e.progressLines??[])t+=n.length*2;return t}function D(e,t={}){let n=Math.max(1,Math.floor(t.maxMessages??h)),r=Math.max(1,Math.floor(t.maxBytes??50331648)),i=Math.max(1,Math.floor(t.maxFieldChars??2097152)),a=[],o=0;for(let t=e.length-1;t>=0&&a.length<n;--t){let n=T(e[t],i),s=E(n);if(s>r&&n.attachments?.some(e=>e.dataUrl)&&(n={...n,attachments:n.attachments.map(e=>({...e,dataUrl:void 0}))},s=E(n)),a.length>0&&o+s>r)break;a.push(n),o+=s}return a.reverse(),a}function O(e){let t=new Map;for(let n of e)n.role===`tool`&&n.toolUseId&&t.set(n.toolUseId,n.id);return t}var k=
|
|
17
|
+
`+e.slice(e.length-(n-r))}function w(e){if(e===void 0)return 0;try{return JSON.stringify(e).length*2}catch{return S*2}}function T(e,t){let n=C(e.content,t),r=e.toolResult===void 0?void 0:C(e.toolResult,t),i=e.thinkingLog?{...e.thinkingLog,text:C(e.thinkingLog.text,t)}:void 0,a=w(e.toolInput)>t*2?`[tool input omitted from live transcript to protect memory]`:e.toolInput;return n===e.content&&r===e.toolResult&&i?.text===e.thinkingLog?.text&&a===e.toolInput?e:{...e,content:n,...r===void 0?{}:{toolResult:r},...i?{thinkingLog:i}:{},...a===void 0?{}:{toolInput:a}}}function E(e){let t=384+e.content.length*2+(e.toolResult?.length??0)*2+(e.thinkingLog?.text.length??0)*2+w(e.toolInput);for(let n of e.attachments??[])t+=(n.dataUrl?.length??0)*2+192;for(let n of e.sageLines??[])t+=n.length*2;for(let n of e.progressLines??[])t+=n.length*2;return t}function D(e,t={}){let n=Math.max(1,Math.floor(t.maxMessages??h)),r=Math.max(1,Math.floor(t.maxBytes??50331648)),i=Math.max(1,Math.floor(t.maxFieldChars??2097152)),a=[],o=0;for(let t=e.length-1;t>=0&&a.length<n;--t){let n=T(e[t],i),s=E(n);if(s>r&&n.attachments?.some(e=>e.dataUrl)&&(n={...n,attachments:n.attachments.map(e=>({...e,dataUrl:void 0}))},s=E(n)),a.length>0&&o+s>r)break;a.push(n),o+=s}return a.reverse(),a}function O(e){let t=new Map;for(let n of e)n.role===`tool`&&n.toolUseId&&t.set(n.toolUseId,n.id);return t}var k=t()(e((e,t)=>({messages:[],currentAssistantMessageId:null,currentToolId:null,isLoading:!1,abortController:null,executions:new Map,toolMessageIdsByUseId:new Map,queue:[],runStart:null,refining:!1,pendingRefinement:null,thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null,boundSessionId:null,addMessage:t=>{let r=`msg_${Date.now()}_${n().slice(0,8)}`,i={...t,id:r,timestamp:t.timestamp??Date.now()};return e(e=>{let n=D([...e.messages,i]),a=O(n),o=e.executions;if(o.size>0){let e=new Map,t=!1;for(let[n,r]of o)a.has(n)?e.set(n,r):t=!0;t&&(o=e)}let s={messages:n,currentAssistantMessageId:t.role===`assistant`?r:e.currentAssistantMessageId,toolMessageIdsByUseId:a};if(i.role===`tool`&&i.toolUseId){let e=new Map(a);e.set(i.toolUseId,r),s.toolMessageIdsByUseId=e}return o!==e.executions&&(s.executions=o),s}),r},setMessages:t=>{let n=D(t);e({messages:n,currentAssistantMessageId:null,currentToolId:null,executions:new Map,toolMessageIdsByUseId:O(n),thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null})},updateMessage:(t,n)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,...n}:e)}))},appendToMessage:(t,n)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,content:C(e.content+n)}:e)}))},finalizeMessage:(t,n)=>{let r=n?.final!==!1;e(e=>({messages:e.messages.map(e=>{if(e.id!==t)return e;if(e.role!==`assistant`)return{...e,content:m(e.content),streaming:!1};let n=c(e.content),i=r&&n.steps.length>0?{steps:n.steps}:void 0;return{...e,content:m(n.stripped),streaming:!1,...i?{nextSteps:i}:{}}})}))},setToolResult:(t,n,r)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,toolResult:C(n),isError:!r,progressLines:void 0}:e)}))},appendToolProgress:(e,n)=>{t().appendToolProgressLines(e,[n])},appendToolProgressLines:(t,n)=>{n.length!==0&&e(e=>({messages:e.messages.map(e=>{if(e.id!==t)return e;let r=e.progressLines??[];return r.push(...n),r.length>30&&r.splice(0,r.length-30),{...e,progressLines:r}})}))},getToolMessageId:e=>t().toolMessageIdsByUseId.get(e),setToolResultByUseId:(e,n,r)=>{let i=t().toolMessageIdsByUseId.get(e);i&&t().setToolResult(i,n,r)},appendToolProgressLinesByUseId:(e,n)=>{let r=t().toolMessageIdsByUseId.get(e);r&&t().appendToolProgressLines(r,n)},setLoading:t=>e({isLoading:t}),setAbortController:t=>e({abortController:t}),clearMessages:()=>e({messages:[],currentAssistantMessageId:null,currentToolId:null,executions:new Map,toolMessageIdsByUseId:new Map,thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null,boundSessionId:null}),setBoundSessionId:t=>e({boundSessionId:t}),setCurrentAssistantMessage:t=>e({currentAssistantMessageId:t}),setCurrentToolId:t=>e({currentToolId:t}),truncateAfter:t=>e(e=>{let n=e.messages.findIndex(e=>e.id===t);if(n===-1)return e;let r=e.messages.slice(0,n+1);return{messages:r,currentAssistantMessageId:null,currentToolId:null,toolMessageIdsByUseId:O(r)}}),addExecution:t=>{e(e=>{let n=new Map(e.executions);return n.set(t.id,t),{executions:n}})},updateExecution:(t,n)=>{e(e=>{let r=new Map(e.executions),i=r.get(t);return i&&r.set(t,{...i,...n}),{executions:r}})},setRefining:t=>e({refining:t}),setPendingRefinement:(t,n,r=`queue`)=>e({pendingRefinement:t===null?null:{text:t,images:n??[],mode:r}}),enqueue:(t,n=`queue`,r,i)=>{let a=Date.now(),o=++v;if(e(e=>({queue:[...e.queue,{text:t,mode:n,addedAt:a,itemId:o,...r?.length?{images:r}:{},...i?{alreadyDispatched:!0}:{}}]})),i){let e=setTimeout(()=>{g.delete(o);let e=null;k.setState(t=>{let n=t.queue.find(e=>e.itemId===o&&e.alreadyDispatched===!0);if(n&&n.bubbleAdded!==!0){let t=n.images??[];e={role:`user`,content:n.text,...t.length>0?{attachments:t.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}}}return{queue:t.queue.filter(e=>!(e.itemId===o&&e.alreadyDispatched===!0))}}),e&&k.getState().addMessage(e)},x);g.set(o,e)}},dequeue:()=>{let{queue:n}=t();if(n.length===0)return null;let[i,...a]=n;return i?.itemId!==void 0&&_(i.itemId),e({queue:a}),r(i)},dequeueDrainable:()=>{let t={popped:null,leadingBubbles:[]};e(e=>{let n=e.queue.findIndex(e=>e.alreadyDispatched!==!0);if(n===-1){for(let n of e.queue)if(n.alreadyDispatched===!0&&n.bubbleAdded!==!0){let e=n.images??[];t.leadingBubbles.push({role:`user`,content:n.text,...e.length>0?{attachments:e.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}})}return t.leadingBubbles.length===0?{}:{queue:e.queue.filter(e=>!(e.alreadyDispatched===!0&&e.bubbleAdded!==!0))}}for(let r=0;r<n;r+=1){let n=e.queue[r];if(n.bubbleAdded===!0)continue;let i=n.images??[];t.leadingBubbles.push({role:`user`,content:n.text,...i.length>0?{attachments:i.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}})}let r=e.queue[n],i=e.queue.map((e,t)=>t<n&&e.bubbleAdded!==!0&&e.alreadyDispatched===!0?{...e,bubbleAdded:!0}:e).slice(0,n).concat(e.queue.map((e,t)=>t<n&&e.bubbleAdded!==!0&&e.alreadyDispatched===!0?{...e,bubbleAdded:!0}:e).slice(n+1));return t.popped=r,{queue:i}});for(let e of t.leadingBubbles)k.getState().addMessage(e);let n=t.popped;return n?.itemId!==void 0&&_(n.itemId),n},removeQueued:t=>e(e=>{let n=e.queue[t];return n?.itemId!==void 0&&_(n.itemId),{queue:e.queue.filter((e,n)=>n!==t)}}),clearQueue:()=>{let t=Array.from(g.values());g.clear();for(let e of t)clearTimeout(e);e({queue:[]})},removeMessage:t=>e(e=>{let n=e.messages.filter(e=>e.id!==t);return{messages:n,toolMessageIdsByUseId:O(n)}}),updateLastUserMessage:t=>e(e=>{let n=e.messages;for(let e=n.length-1;e>=0;e--)if(n[e].role===`user`){let r={...n[e],content:t},i=[...n];return i[e]=r,{messages:i}}return e}),setRunStart:t=>e({runStart:t}),appendThinking:t=>e(e=>({thinkingBuffer:C(e.thinkingBuffer+t),thinkingStartedAt:e.thinkingStartedAt??Date.now(),thinkingLogBuffer:C(e.thinkingLogBuffer+t),thinkingLogStartedAt:e.thinkingLogStartedAt??Date.now()})),clearThinking:()=>e({thinkingBuffer:``,thinkingStartedAt:null}),flushThinkingLog:e=>{let{thinkingLogBuffer:n,thinkingLogStartedAt:r}=t(),i=n.trim();if(!i)return;let a=r??Date.now();t().addMessage({role:`system`,content:``,thinkingLog:{iteration:e,text:i,startedAt:a,durationMs:Math.max(0,Date.now()-a)}}),t().clearThinkingLog()},clearThinkingLog:()=>e({thinkingLogBuffer:``,thinkingLogStartedAt:null})}),{name:`wrongstack-chat`,version:3,partialize:e=>({messages:e.messages.slice(-200).map(e=>e.attachments?.some(e=>e.dataUrl)?{...e,attachments:e.attachments.map(e=>({...e,dataUrl:void 0}))}:e),queue:e.queue.filter(e=>e.alreadyDispatched!==!0).map(e=>e.images?{...e,images:void 0}:e),boundSessionId:e.boundSessionId,thinkingLogBuffer:e.thinkingLogBuffer}),migrate:(e,t)=>{if(t>3)return null;let n=e??{},r=Array.isArray(n.messages)?n.messages:[],i=Array.isArray(n.queue)?n.queue:[];t<3&&(i=i.filter(e=>typeof e==`object`&&!!e&&e.alreadyDispatched!==!0));let a=i.flatMap(e=>{let t=b(e);return t?[t]:[]});return{messages:D(r),queue:a,boundSessionId:typeof n.boundSessionId==`string`?n.boundSessionId:null,thinkingLogBuffer:typeof n.thinkingLogBuffer==`string`?n.thinkingLogBuffer:``}},onRehydrateStorage:()=>(e,t)=>{t||typeof window<`u`&&(window.__wrongstackChatRehydrated=!0)}}));export{r as a,p as i,i as n,c as r,k as t};
|
package/dist/assets/{codemap-activity-store-C1XWbXeZ.js → codemap-activity-store-Cz0_AHqt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_a as e}from"./vendor-BTDGplXK.js";var t=8e3,n=2500,r=30*6e4,i=200,a=500,o={read:`read`,read_file:`read`,write:`write`,write_file:`write`,edit:`edit`,patch:`edit`,apply_patch:`edit`,replace:`edit`,delete:`delete`,delete_file:`delete`,remove:`delete`,grep:`search`,glob:`search`,search:`search`,"codebase-search":`search`,"codebase-index":`index`,remember:`memory`,forget:`memory`,memory_search:`memory`,memory_update:`memory`,memory_delete:`memory`};function s(e,t=``){return e===`rename`?`edit`:e in{read:1,write:1,edit:1,delete:1,search:1}?e:o[t]}function c(e){let t=[];for(let n of[`path`,`file`,`filePath`,`target`]){let r=e[n];typeof r==`string`&&t.push(r)}let n=e.files;if(typeof n==`string`&&t.push(n),Array.isArray(n))for(let e of n)typeof e==`string`&&t.push(e);return[...new Set(t)]}function l(e,t){let n=typeof t.old_string==`string`?t.old_string.trim():``,r=typeof t.new_string==`string`?t.new_string.trim():``;if(n||r)return`${n.replace(/\s+/g,` `).slice(0,42)||`∅`} → ${r.replace(/\s+/g,` `).slice(0,42)||`∅`}`;if(typeof t.patch==`string`){let n=d(t);return`${e} +${n?.added??0} −${n?.removed??0}`}let i=typeof t.content==`string`?t.content:void 0;if(i!==void 0){let t=i.length===0?0:i.split(/\r?\n/).length;return`${e} ${t} line${t===1?``:`s`}`}for(let e of[`query`,`pattern`,`old_string`,`new_string`,`text`,`command`]){let n=t[e];if(typeof n==`string`&&n.trim()){let t=n.trim().replace(/\s+/g,` `).slice(0,96);return e===`query`?`"${t}"`:e===`pattern`?`/${t}/`:e===`command`?`$ ${t}`:t}}return e}function u(e){return e.trim().replace(/\s+/g,` `).slice(0,72)}function d(e){let t=typeof e.old_string==`string`?e.old_string:void 0,n=typeof e.new_string==`string`?e.new_string:void 0;if(t!==void 0||n!==void 0){let e=t?t.split(/\r?\n/).length:0;return{added:n?n.split(/\r?\n/).length:0,removed:e,...t?{before:u(t)}:{},...n?{after:u(n)}:{}}}let r=typeof e.patch==`string`?e.patch:void 0;if(r){let e=r.split(/\r?\n/),t=e.filter(e=>e.startsWith(`+`)&&!e.startsWith(`+++`)),n=e.filter(e=>e.startsWith(`-`)&&!e.startsWith(`---`));return{added:t.length,removed:n.length,...n[0]?{before:u(n[0].slice(1))}:{},...t[0]?{after:u(t[0].slice(1))}:{}}}let i=typeof e.content==`string`?e.content:void 0;if(i!==void 0)return{added:i.length===0?0:i.split(/\r?\n/).length,removed:0,...i?{after:u(i)}:{}}}function f(e){let t=e.status??`observed`;return{...e,id:e.id??`${e.toolUseId??`event`}:${e.filePath}:${e.timestamp}`,status:t,source:e.source??`legacy`,agentName:e.agentName??e.agent,agent:e.agent??e.agentName}}function p(e,t){let n=e.get(t.filePath)??[];if(e.set(t.filePath,[t,...n].slice(0,i)),e.size<=a)return;let r=[...e.entries()].sort((e,t)=>(e[1][0]?.timestamp??0)-(t[1][0]?.timestamp??0))[0]?.[0];r&&e.delete(r)}function m(e){return`${e.sessionId??`unscoped`}:${e.agentId??e.agentName??e.agent??`external`}`}function h(e){let t=new Map;for(let n of e){let e=n.agentId??`external`,r=n.agentName??n.agent??`External process`,i=n.sessionId??`unscoped`,a=m(n),o=t.get(a);o?(o.operations.push(n),o.startedAt=Math.min(o.startedAt,n.timestamp)):t.set(a,{key:a,agentId:e,agentName:r,sessionId:i,operations:[n],startedAt:n.timestamp})}return[...t.values()].sort((e,t)=>e.startedAt-t.startedAt)}function g(e,t,n){let r=String(e.name??`unknown`),i=e.input&&typeof e.input==`object`?e.input:{},a=Date.now(),o=String(e.id??`${r}:${a}`),c=d(i);return(t.length>0?t:[{filePath:`(tool:${r})`,operation:`execute`}]).map((u,d)=>({id:`${o}:${d}`,toolUseId:o,filePath:u.filePath,type:u.operation===`execute`?`execute`:s(u.operation,r)??`edit`,toolName:r,summary:l(r,i),timestamp:a,status:n,source:`tool`,attribution:t.length>0?`exact`:`correlated`,...c?{change:c}:{},sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,traceId:typeof e.traceId==`string`?e.traceId:void 0,agentId:typeof e.agentId==`string`?e.agentId:`leader`,agentName:typeof e.agentName==`string`?e.agentName:`LEADER`,...u.line?{line:u.line}:{},...u.endLine?{endLine:u.endLine}:{}}))}function _(e){let t=e.payload??{};if(e.type===`tool.started`||e.type===`tool.executed`||e.type===`codemap.tool_started`||e.type===`codemap.tool_executed`)return g(t,Array.isArray(t.fileTargets)?t.fileTargets:c(t.input&&typeof t.input==`object`?t.input:{}).map(e=>({filePath:e,operation:o[String(t.name??``)]??`edit`})),e.type===`tool.started`||e.type===`codemap.tool_started`?`active`:`completed`);if(e.type===`provider.response`){let e=t.blocks;if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type!==`tool_use`)continue;let r=String(e.name??``),i=o[r];if(!i)continue;let a=e.input&&typeof e.input==`object`?e.input:{},s=c(a),u=Date.now();s.length===0&&(i===`memory`||i===`search`||i===`index`)&&s.push(`(global)`);for(let e of s)n.push({filePath:e,type:i,toolName:r,summary:l(r,a),timestamp:u})}return n}if(e.type===`tool.progress`){let e=t.event&&typeof t.event==`object`?t.event:void 0;if(e?.type!==`file_changed`||typeof e.path!=`string`)return[];let n=String(e.operation??`edit`);return[{id:`${String(t.id??`progress`)}:${e.path}:${Date.now()}`,toolUseId:typeof t.id==`string`?t.id:void 0,filePath:e.path,type:s(n)??`edit`,toolName:String(t.name??`deterministic-tool`),summary:String(e.text??`tool reported file change`),timestamp:Date.now(),status:`active`,source:`deterministic`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,line:typeof e.line==`number`?e.line:void 0,endLine:typeof e.endLine==`number`?e.endLine:void 0,attribution:`exact`}]}if(e.type===`codemap.file_event`){let e=s(String(t.operation??`edit`))??`edit`;return typeof t.filePath==`string`?[{filePath:t.filePath,type:e,toolName:typeof t.toolName==`string`?t.toolName:String(t.source??`watcher`),summary:`${String(t.source??`external`)} ${String(t.operation??`changed`)}`,timestamp:typeof t.at==`number`?t.at:Date.now(),status:t.phase===`started`?`active`:`observed`,source:t.source??`external`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,toolUseId:typeof t.toolUseId==`string`?t.toolUseId:void 0,line:typeof t.line==`number`?t.line:void 0,endLine:typeof t.endLine==`number`?t.endLine:void 0}]:[]}return e.type===`file.saved`&&typeof t.filePath==`string`?[{filePath:t.filePath,type:`write`,toolName:`save`,summary:``,timestamp:Date.now(),source:`editor`}]:e.type===`memory.event`&&typeof t.event==`string`?[{filePath:`(memory)`,type:`memory`,toolName:`memory.${t.event}`,summary:String(t.memoryId??``),timestamp:Date.now()}]:[]}var v=e((e,i)=>({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0,recordActivity(n){let r=f(n);e(e=>{let n=new Map(e.history),i=new Map(e.pulses);return p(n,r),i.set(r.filePath,Date.now()+t),{history:n,pulses:i,totalCount:e.totalCount+1}})},startActivities(n){if(n.length===0)return;let r=n.map(e=>f({...e,status:`active`}));e(e=>{let n=new Map(e.history),i=new Map(e.pulses),a=new Map(e.activeOperations);for(let e of r)if(p(n,e),i.set(e.filePath,Date.now()+t),e.toolUseId){let t=a.get(e.toolUseId)??[];a.set(e.toolUseId,[...t,e])}return{history:n,pulses:i,activeOperations:a,totalCount:e.totalCount+r.length}})},finishTool(n,r){let i=r.timestamp??Date.now();e(e=>{let a=e.activeOperations.get(n)??[];if(a.length===0)return e;let o=new Map(e.history),s=new Map(e.pulses);for(let e of a){let a=o.get(e.filePath)??[];o.set(e.filePath,a.map(e=>e.toolUseId===n?{...e,status:r.ok?`completed`:`failed`,ok:r.ok,completedAt:i,durationMs:r.durationMs??i-e.timestamp}:e)),s.set(e.filePath,Date.now()+t)}let c=new Map(e.activeOperations);return c.delete(n),{history:o,pulses:s,activeOperations:c}})},recordFileEvent(r){let i=f({...r,attribution:r.attribution??(r.agentId?`exact`:`external`)});e(e=>{let r=(e.history.get(i.filePath)??[]).find(e=>e.source!==`watcher`&&e.source!==`external`&&Math.abs(i.timestamp-e.timestamp)<=n);if(r){let n=new Map(e.history);n.set(i.filePath,(n.get(i.filePath)??[]).map(e=>e.id===r.id?{...e,watcherConfirmed:e.watcherConfirmed||i.source===`watcher`||i.source===`editor`}:e));let a=new Map(e.pulses);return a.set(i.filePath,Date.now()+t),{history:n,pulses:a}}let a=i.toolUseId?e.activeOperations.get(i.toolUseId):void 0;if(a&&a.length>0){let n=a[0],r=f({...i,status:`active`,source:i.source??`deterministic`,sessionId:i.sessionId??n.sessionId,traceId:i.traceId??n.traceId,agentId:i.agentId??n.agentId,agentName:i.agentName??n.agentName,agent:i.agent??n.agent,attribution:`exact`}),o=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);return p(o,r),s.set(r.filePath,Date.now()+t),c.set(i.toolUseId,[...a,r]),{history:o,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let o=[...e.activeOperations.values()].flat().filter(e=>e.filePath.startsWith(`(tool:`)&&Math.abs(i.timestamp-e.timestamp)<=3e5);if(o.length===1){let n=o[0],r=f({...i,id:`${n.toolUseId}:${i.filePath}:${i.timestamp}`,toolUseId:n.toolUseId,toolName:n.toolName,summary:`${n.toolName} → filesystem ${i.type}`,status:`active`,source:`deterministic`,sessionId:n.sessionId,traceId:n.traceId,agentId:n.agentId,agentName:n.agentName,agent:n.agent,watcherConfirmed:!0,attribution:`correlated`}),a=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);if(p(a,r),s.set(r.filePath,Date.now()+t),r.toolUseId){let e=c.get(r.toolUseId)??[];c.set(r.toolUseId,[...e,r])}return{history:a,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let s=new Map(e.history),c=new Map(e.pulses);return p(s,i),c.set(i.filePath,Date.now()+t),{history:s,pulses:c,totalCount:e.totalCount+1}})},resolveActivitySymbol(t,n,r){e(e=>{let i=new Map(e.history);i.set(n,(i.get(n)??[]).map(e=>e.toolUseId===t?{...e,symbol:r}:e));let a=new Map(e.activeOperations),o=a.get(t);return o&&a.set(t,o.map(e=>e.filePath===n?{...e,symbol:r}:e)),{history:i,activeOperations:a}})},getActivityForFile(e){return i().history.get(e)??[]},getActiveForFile(e){return[...i().activeOperations.values()].flat().filter(t=>t.filePath===e)},getActiveOperations(){return[...i().activeOperations.values()].flat()},getAgentPresences(){return h(i().getActiveOperations())},getPulsingFiles(){return i()._sweep(),new Set(i().pulses.keys())},getPulseType(e){if(i()._sweep(),i().pulses.has(e))return i().history.get(e)?.[0]?.type},clear(){e({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0})},_sweep(){let t=Date.now(),n=[...i().pulses].filter(([,e])=>e<t).map(([e])=>e),a=[...i().activeOperations].filter(([,e])=>e.every(e=>t-e.timestamp>r)).map(([e])=>e);n.length===0&&a.length===0||e(e=>{let r=new Map(e.pulses);for(let e of n)r.delete(e);if(a.length===0)return{pulses:r};let i=new Map(e.history),o=new Map(e.activeOperations);for(let e of a){for(let n of o.get(e)??[])i.set(n.filePath,(i.get(n.filePath)??[]).map(n=>n.toolUseId===e?{...n,status:`failed`,ok:!1,completedAt:t,durationMs:t-n.timestamp,summary:`${n.summary||n.toolName} · telemetry timeout`}:n));o.delete(e)}return{pulses:r,history:i,activeOperations:o}})}}));export{v as i,_ as n,h as r,m as t};
|
|
1
|
+
import{va as e}from"./vendor-BTTkQ9Tn.js";var t=8e3,n=2500,r=30*6e4,i=200,a=500,o={read:`read`,read_file:`read`,write:`write`,write_file:`write`,edit:`edit`,patch:`edit`,apply_patch:`edit`,replace:`edit`,delete:`delete`,delete_file:`delete`,remove:`delete`,grep:`search`,glob:`search`,search:`search`,"codebase-search":`search`,"codebase-index":`index`,remember:`memory`,forget:`memory`,memory_search:`memory`,memory_update:`memory`,memory_delete:`memory`};function s(e,t=``){return e===`rename`?`edit`:e in{read:1,write:1,edit:1,delete:1,search:1}?e:o[t]}function c(e){let t=[];for(let n of[`path`,`file`,`filePath`,`target`]){let r=e[n];typeof r==`string`&&t.push(r)}let n=e.files;if(typeof n==`string`&&t.push(n),Array.isArray(n))for(let e of n)typeof e==`string`&&t.push(e);return[...new Set(t)]}function l(e,t){let n=typeof t.old_string==`string`?t.old_string.trim():``,r=typeof t.new_string==`string`?t.new_string.trim():``;if(n||r)return`${n.replace(/\s+/g,` `).slice(0,42)||`∅`} → ${r.replace(/\s+/g,` `).slice(0,42)||`∅`}`;if(typeof t.patch==`string`){let n=d(t);return`${e} +${n?.added??0} −${n?.removed??0}`}let i=typeof t.content==`string`?t.content:void 0;if(i!==void 0){let t=i.length===0?0:i.split(/\r?\n/).length;return`${e} ${t} line${t===1?``:`s`}`}for(let e of[`query`,`pattern`,`old_string`,`new_string`,`text`,`command`]){let n=t[e];if(typeof n==`string`&&n.trim()){let t=n.trim().replace(/\s+/g,` `).slice(0,96);return e===`query`?`"${t}"`:e===`pattern`?`/${t}/`:e===`command`?`$ ${t}`:t}}return e}function u(e){return e.trim().replace(/\s+/g,` `).slice(0,72)}function d(e){let t=typeof e.old_string==`string`?e.old_string:void 0,n=typeof e.new_string==`string`?e.new_string:void 0;if(t!==void 0||n!==void 0){let e=t?t.split(/\r?\n/).length:0;return{added:n?n.split(/\r?\n/).length:0,removed:e,...t?{before:u(t)}:{},...n?{after:u(n)}:{}}}let r=typeof e.patch==`string`?e.patch:void 0;if(r){let e=r.split(/\r?\n/),t=e.filter(e=>e.startsWith(`+`)&&!e.startsWith(`+++`)),n=e.filter(e=>e.startsWith(`-`)&&!e.startsWith(`---`));return{added:t.length,removed:n.length,...n[0]?{before:u(n[0].slice(1))}:{},...t[0]?{after:u(t[0].slice(1))}:{}}}let i=typeof e.content==`string`?e.content:void 0;if(i!==void 0)return{added:i.length===0?0:i.split(/\r?\n/).length,removed:0,...i?{after:u(i)}:{}}}function f(e){let t=e.status??`observed`;return{...e,id:e.id??`${e.toolUseId??`event`}:${e.filePath}:${e.timestamp}`,status:t,source:e.source??`legacy`,agentName:e.agentName??e.agent,agent:e.agent??e.agentName}}function p(e,t){let n=e.get(t.filePath)??[];if(e.set(t.filePath,[t,...n].slice(0,i)),e.size<=a)return;let r=[...e.entries()].sort((e,t)=>(e[1][0]?.timestamp??0)-(t[1][0]?.timestamp??0))[0]?.[0];r&&e.delete(r)}function m(e){return`${e.sessionId??`unscoped`}:${e.agentId??e.agentName??e.agent??`external`}`}function h(e){let t=new Map;for(let n of e){let e=n.agentId??`external`,r=n.agentName??n.agent??`External process`,i=n.sessionId??`unscoped`,a=m(n),o=t.get(a);o?(o.operations.push(n),o.startedAt=Math.min(o.startedAt,n.timestamp)):t.set(a,{key:a,agentId:e,agentName:r,sessionId:i,operations:[n],startedAt:n.timestamp})}return[...t.values()].sort((e,t)=>e.startedAt-t.startedAt)}function g(e,t,n){let r=String(e.name??`unknown`),i=e.input&&typeof e.input==`object`?e.input:{},a=Date.now(),o=String(e.id??`${r}:${a}`),c=d(i);return(t.length>0?t:[{filePath:`(tool:${r})`,operation:`execute`}]).map((u,d)=>({id:`${o}:${d}`,toolUseId:o,filePath:u.filePath,type:u.operation===`execute`?`execute`:s(u.operation,r)??`edit`,toolName:r,summary:l(r,i),timestamp:a,status:n,source:`tool`,attribution:t.length>0?`exact`:`correlated`,...c?{change:c}:{},sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,traceId:typeof e.traceId==`string`?e.traceId:void 0,agentId:typeof e.agentId==`string`?e.agentId:`leader`,agentName:typeof e.agentName==`string`?e.agentName:`LEADER`,...u.line?{line:u.line}:{},...u.endLine?{endLine:u.endLine}:{}}))}function _(e){let t=e.payload??{};if(e.type===`tool.started`||e.type===`tool.executed`||e.type===`codemap.tool_started`||e.type===`codemap.tool_executed`)return g(t,Array.isArray(t.fileTargets)?t.fileTargets:c(t.input&&typeof t.input==`object`?t.input:{}).map(e=>({filePath:e,operation:o[String(t.name??``)]??`edit`})),e.type===`tool.started`||e.type===`codemap.tool_started`?`active`:`completed`);if(e.type===`provider.response`){let e=t.blocks;if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type!==`tool_use`)continue;let r=String(e.name??``),i=o[r];if(!i)continue;let a=e.input&&typeof e.input==`object`?e.input:{},s=c(a),u=Date.now();s.length===0&&(i===`memory`||i===`search`||i===`index`)&&s.push(`(global)`);for(let e of s)n.push({filePath:e,type:i,toolName:r,summary:l(r,a),timestamp:u})}return n}if(e.type===`tool.progress`){let e=t.event&&typeof t.event==`object`?t.event:void 0;if(e?.type!==`file_changed`||typeof e.path!=`string`)return[];let n=String(e.operation??`edit`);return[{id:`${String(t.id??`progress`)}:${e.path}:${Date.now()}`,toolUseId:typeof t.id==`string`?t.id:void 0,filePath:e.path,type:s(n)??`edit`,toolName:String(t.name??`deterministic-tool`),summary:String(e.text??`tool reported file change`),timestamp:Date.now(),status:`active`,source:`deterministic`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,line:typeof e.line==`number`?e.line:void 0,endLine:typeof e.endLine==`number`?e.endLine:void 0,attribution:`exact`}]}if(e.type===`codemap.file_event`){let e=s(String(t.operation??`edit`))??`edit`;return typeof t.filePath==`string`?[{filePath:t.filePath,type:e,toolName:typeof t.toolName==`string`?t.toolName:String(t.source??`watcher`),summary:`${String(t.source??`external`)} ${String(t.operation??`changed`)}`,timestamp:typeof t.at==`number`?t.at:Date.now(),status:t.phase===`started`?`active`:`observed`,source:t.source??`external`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,toolUseId:typeof t.toolUseId==`string`?t.toolUseId:void 0,line:typeof t.line==`number`?t.line:void 0,endLine:typeof t.endLine==`number`?t.endLine:void 0}]:[]}return e.type===`file.saved`&&typeof t.filePath==`string`?[{filePath:t.filePath,type:`write`,toolName:`save`,summary:``,timestamp:Date.now(),source:`editor`}]:e.type===`memory.event`&&typeof t.event==`string`?[{filePath:`(memory)`,type:`memory`,toolName:`memory.${t.event}`,summary:String(t.memoryId??``),timestamp:Date.now()}]:[]}var v=e((e,i)=>({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0,recordActivity(n){let r=f(n);e(e=>{let n=new Map(e.history),i=new Map(e.pulses);return p(n,r),i.set(r.filePath,Date.now()+t),{history:n,pulses:i,totalCount:e.totalCount+1}})},startActivities(n){if(n.length===0)return;let r=n.map(e=>f({...e,status:`active`}));e(e=>{let n=new Map(e.history),i=new Map(e.pulses),a=new Map(e.activeOperations);for(let e of r)if(p(n,e),i.set(e.filePath,Date.now()+t),e.toolUseId){let t=a.get(e.toolUseId)??[];a.set(e.toolUseId,[...t,e])}return{history:n,pulses:i,activeOperations:a,totalCount:e.totalCount+r.length}})},finishTool(n,r){let i=r.timestamp??Date.now();e(e=>{let a=e.activeOperations.get(n)??[];if(a.length===0)return e;let o=new Map(e.history),s=new Map(e.pulses);for(let e of a){let a=o.get(e.filePath)??[];o.set(e.filePath,a.map(e=>e.toolUseId===n?{...e,status:r.ok?`completed`:`failed`,ok:r.ok,completedAt:i,durationMs:r.durationMs??i-e.timestamp}:e)),s.set(e.filePath,Date.now()+t)}let c=new Map(e.activeOperations);return c.delete(n),{history:o,pulses:s,activeOperations:c}})},recordFileEvent(r){let i=f({...r,attribution:r.attribution??(r.agentId?`exact`:`external`)});e(e=>{let r=(e.history.get(i.filePath)??[]).find(e=>e.source!==`watcher`&&e.source!==`external`&&Math.abs(i.timestamp-e.timestamp)<=n);if(r){let n=new Map(e.history);n.set(i.filePath,(n.get(i.filePath)??[]).map(e=>e.id===r.id?{...e,watcherConfirmed:e.watcherConfirmed||i.source===`watcher`||i.source===`editor`}:e));let a=new Map(e.pulses);return a.set(i.filePath,Date.now()+t),{history:n,pulses:a}}let a=i.toolUseId?e.activeOperations.get(i.toolUseId):void 0;if(a&&a.length>0){let n=a[0],r=f({...i,status:`active`,source:i.source??`deterministic`,sessionId:i.sessionId??n.sessionId,traceId:i.traceId??n.traceId,agentId:i.agentId??n.agentId,agentName:i.agentName??n.agentName,agent:i.agent??n.agent,attribution:`exact`}),o=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);return p(o,r),s.set(r.filePath,Date.now()+t),c.set(i.toolUseId,[...a,r]),{history:o,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let o=[...e.activeOperations.values()].flat().filter(e=>e.filePath.startsWith(`(tool:`)&&Math.abs(i.timestamp-e.timestamp)<=3e5);if(o.length===1){let n=o[0],r=f({...i,id:`${n.toolUseId}:${i.filePath}:${i.timestamp}`,toolUseId:n.toolUseId,toolName:n.toolName,summary:`${n.toolName} → filesystem ${i.type}`,status:`active`,source:`deterministic`,sessionId:n.sessionId,traceId:n.traceId,agentId:n.agentId,agentName:n.agentName,agent:n.agent,watcherConfirmed:!0,attribution:`correlated`}),a=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);if(p(a,r),s.set(r.filePath,Date.now()+t),r.toolUseId){let e=c.get(r.toolUseId)??[];c.set(r.toolUseId,[...e,r])}return{history:a,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let s=new Map(e.history),c=new Map(e.pulses);return p(s,i),c.set(i.filePath,Date.now()+t),{history:s,pulses:c,totalCount:e.totalCount+1}})},resolveActivitySymbol(t,n,r){e(e=>{let i=new Map(e.history);i.set(n,(i.get(n)??[]).map(e=>e.toolUseId===t?{...e,symbol:r}:e));let a=new Map(e.activeOperations),o=a.get(t);return o&&a.set(t,o.map(e=>e.filePath===n?{...e,symbol:r}:e)),{history:i,activeOperations:a}})},getActivityForFile(e){return i().history.get(e)??[]},getActiveForFile(e){return[...i().activeOperations.values()].flat().filter(t=>t.filePath===e)},getActiveOperations(){return[...i().activeOperations.values()].flat()},getAgentPresences(){return h(i().getActiveOperations())},getPulsingFiles(){return i()._sweep(),new Set(i().pulses.keys())},getPulseType(e){if(i()._sweep(),i().pulses.has(e))return i().history.get(e)?.[0]?.type},clear(){e({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0})},_sweep(){let t=Date.now(),n=[...i().pulses].filter(([,e])=>e<t).map(([e])=>e),a=[...i().activeOperations].filter(([,e])=>e.every(e=>t-e.timestamp>r)).map(([e])=>e);n.length===0&&a.length===0||e(e=>{let r=new Map(e.pulses);for(let e of n)r.delete(e);if(a.length===0)return{pulses:r};let i=new Map(e.history),o=new Map(e.activeOperations);for(let e of a){for(let n of o.get(e)??[])i.set(n.filePath,(i.get(n.filePath)??[]).map(n=>n.toolUseId===e?{...n,status:`failed`,ok:!1,completedAt:t,durationMs:t-n.timestamp,summary:`${n.summary||n.toolName} · telemetry timeout`}:n));o.delete(e)}return{pulses:r,history:i,activeOperations:o}})}}));export{v as i,_ as n,h as r,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{va as e}from"./vendor-BTTkQ9Tn.js";var t=e(e=>({generation:0,lastUpdatedAt:null,notifyIndexUpdated(t=Date.now()){e(e=>({generation:e.generation+1,lastUpdatedAt:t}))}}));export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{B as t,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{B as t,F as n,I as r,L as i,P as a,R as o,et as s,nt as c,wa as l,z as u}from"./vendor-BTTkQ9Tn.js";import{t as d}from"./utils-CwJvjOcH.js";var f=e(l(),1),p=s(),m=a,h=u,g=f.forwardRef(({className:e,...t},n)=>(0,p.jsx)(o,{ref:n,className:d(`fixed inset-0 z-50 bg-black/65 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));g.displayName=o.displayName;var _=f.forwardRef(({className:e,children:t,showCloseButton:i=!0,...a},o)=>(0,p.jsxs)(h,{children:[(0,p.jsx)(g,{}),(0,p.jsxs)(r,{ref:o,className:d(`fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-1.5rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border/70 bg-card p-5 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:p-6`,e),...a,children:[t,i&&(0,p.jsxs)(n,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,p.jsx)(c,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));_.displayName=r.displayName;var v=({className:e,...t})=>(0,p.jsx)(`div`,{className:d(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});v.displayName=`DialogHeader`;var y=({className:e,...t})=>(0,p.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});y.displayName=`DialogFooter`;var b=f.forwardRef(({className:e,...n},r)=>(0,p.jsx)(t,{ref:r,className:d(`text-lg font-semibold leading-none`,e),...n}));b.displayName=t.displayName;var x=f.forwardRef(({className:e,...t},n)=>(0,p.jsx)(i,{ref:n,className:d(`text-sm text-muted-foreground`,e),...t}));x.displayName=i.displayName;export{v as a,y as i,_ as n,b as o,x as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{et as e}from"./vendor-
|
|
1
|
+
import{et as e}from"./vendor-BTTkQ9Tn.js";import{t}from"./utils-CwJvjOcH.js";var n=e();function r({icon:e,title:r,description:i,action:a,className:o,panel:s=!0}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 min-w-0 flex-1 items-center justify-center p-4`,s&&`bg-[hsl(var(--surface-2)/0.45)]`,o),children:(0,n.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[e&&(0,n.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:e}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`text-base font-semibold text-foreground`,children:r}),i&&(0,n.jsx)(`p`,{className:`mt-1 text-sm`,children:i})]}),a&&(0,n.jsx)(`button`,{type:`button`,onClick:a.onClick,className:`mt-1 rounded-md border border-border/70 bg-card/70 px-4 py-2 text-sm text-foreground shadow-sm transition-colors hover:bg-accent`,children:a.label})]})})}export{r as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-Cv_EIWjY.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-Cv_EIWjY.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-DLn1hY01.js","assets/commandPalette-DpaemFux.js","assets/common-BfVFjVhf.js","assets/settings-DFCaP02p.js","assets/setup-BFcmn89w.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Sa as e,ba as t,xa as n}from"./vendor-BTTkQ9Tn.js";import{a as r,o as i,r as a}from"./ui-store-di6oY7cy.js";import{t as o}from"./activity-Cv_EIWjY.js";import{t as s}from"./chat-DLn1hY01.js";import{t as c}from"./commandPalette-DpaemFux.js";import{t as l}from"./common-BfVFjVhf.js";import{t as u}from"./settings-DFCaP02p.js";import{t as d}from"./setup-BFcmn89w.js";import{t as f}from"./toasts-BL_8kH4B.js";import{s as p}from"./monaco-BLUV5g0U.js";var m=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},h=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function g(){try{return i(a.getState().uiLocale)}catch{return`en`}}e.use(t).use(n((e,t)=>m(Object.assign({"./locales/de/activity.json":()=>p(()=>import(`./activity-CBdzUJQ_.js`),[]),"./locales/de/chat.json":()=>p(()=>import(`./chat-OunddzYy.js`),[]),"./locales/de/commandPalette.json":()=>p(()=>import(`./commandPalette-aaAou3Tl.js`),[]),"./locales/de/common.json":()=>p(()=>import(`./common-C9ikgX7d.js`),[]),"./locales/de/settings.json":()=>p(()=>import(`./settings-eEzjNzsC.js`),[]),"./locales/de/setup.json":()=>p(()=>import(`./setup-DD8rKpQU.js`),[]),"./locales/de/toasts.json":()=>p(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>p(()=>import(`./activity-Cv_EIWjY.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>p(()=>import(`./chat-DLn1hY01.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>p(()=>import(`./commandPalette-DpaemFux.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>p(()=>import(`./common-BfVFjVhf.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>p(()=>import(`./settings-DFCaP02p.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>p(()=>import(`./setup-BFcmn89w.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>p(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>p(()=>import(`./activity-C34aPcFU.js`),[]),"./locales/es/chat.json":()=>p(()=>import(`./chat-CRmMDzCb.js`),[]),"./locales/es/commandPalette.json":()=>p(()=>import(`./commandPalette-Nlxs0V7J.js`),[]),"./locales/es/common.json":()=>p(()=>import(`./common-DMM-xyW3.js`),[]),"./locales/es/settings.json":()=>p(()=>import(`./settings-BF0lRxlj.js`),[]),"./locales/es/setup.json":()=>p(()=>import(`./setup-COxU-AT_.js`),[]),"./locales/es/toasts.json":()=>p(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>p(()=>import(`./activity-CLYyxeC6.js`),[]),"./locales/fr/chat.json":()=>p(()=>import(`./chat-CwnuX7tG.js`),[]),"./locales/fr/commandPalette.json":()=>p(()=>import(`./commandPalette-Dfk74u87.js`),[]),"./locales/fr/common.json":()=>p(()=>import(`./common-D29Zdkxb.js`),[]),"./locales/fr/settings.json":()=>p(()=>import(`./settings-CP6cwqHD.js`),[]),"./locales/fr/setup.json":()=>p(()=>import(`./setup-CMteRkTs.js`),[]),"./locales/fr/toasts.json":()=>p(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>p(()=>import(`./activity-kCY0dGRC.js`),[]),"./locales/it/chat.json":()=>p(()=>import(`./chat-DxLD17ER.js`),[]),"./locales/it/commandPalette.json":()=>p(()=>import(`./commandPalette-CUh_kgfp.js`),[]),"./locales/it/common.json":()=>p(()=>import(`./common-DoUBSHRY.js`),[]),"./locales/it/settings.json":()=>p(()=>import(`./settings-DHix1ZPL.js`),[]),"./locales/it/setup.json":()=>p(()=>import(`./setup-pPW1kVR_.js`),[]),"./locales/it/toasts.json":()=>p(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>p(()=>import(`./activity-Bo6DncWg.js`),[]),"./locales/pt-BR/chat.json":()=>p(()=>import(`./chat-DzPxYALH.js`),[]),"./locales/pt-BR/commandPalette.json":()=>p(()=>import(`./commandPalette-tFxIIhvU.js`),[]),"./locales/pt-BR/common.json":()=>p(()=>import(`./common-vdwxzODB.js`),[]),"./locales/pt-BR/settings.json":()=>p(()=>import(`./settings-D0rWEhMg.js`),[]),"./locales/pt-BR/setup.json":()=>p(()=>import(`./setup-BOYK0I6-.js`),[]),"./locales/pt-BR/toasts.json":()=>p(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>p(()=>import(`./activity-Wr0_Gb8A.js`),[]),"./locales/tr/chat.json":()=>p(()=>import(`./chat-DSEq1Bdz.js`),[]),"./locales/tr/commandPalette.json":()=>p(()=>import(`./commandPalette-CGMq-qlP.js`),[]),"./locales/tr/common.json":()=>p(()=>import(`./common-C5hY-d_0.js`),[]),"./locales/tr/settings.json":()=>p(()=>import(`./settings-kp_aIgcX.js`),[]),"./locales/tr/setup.json":()=>p(()=>import(`./setup-Bd23KLtt.js`),[]),"./locales/tr/toasts.json":()=>p(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:g(),fallbackLng:`en`,supportedLngs:[...r],ns:[...h],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:l,activity:o,chat:s,commandPalette:c,settings:u,setup:d,toasts:f}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function _(e){typeof document<`u`&&(document.documentElement.lang=e)}_(e.language||`en`),a.subscribe((t,n)=>{let r=t.uiLocale;r&&r!==n.uiLocale&&r!==e.language&&e.changeLanguage(r).then(()=>_(r))});function v(){window.wrongstackDesktopHost?.onLocaleChanged?.(t=>{if(!t)return;let n=i(t);if(n===e.language)return;let r=a.getState();r.uiLocale!==n&&r.set({uiLocale:n}),e.changeLanguage(n).then(()=>_(n))})}try{v()}catch{}
|