cli-jaw 2.2.3 → 2.2.4-preview.20260703203439
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/README.ja.md +1 -4
- package/README.ko.md +1 -4
- package/README.md +4 -7
- package/README.zh-CN.md +1 -4
- package/dist/bin/commands/bgtask.js +3 -1
- package/dist/bin/commands/bgtask.js.map +1 -1
- package/dist/bin/commands/chat.js +2 -2
- package/dist/bin/commands/chat.js.map +1 -1
- package/dist/bin/commands/dispatch.js +10 -3
- package/dist/bin/commands/dispatch.js.map +1 -1
- package/dist/bin/commands/tui/fullscreen-mode.js +44 -11
- package/dist/bin/commands/tui/fullscreen-mode.js.map +1 -1
- package/dist/bin/commands/tui/ws-handler.js +15 -1
- package/dist/bin/commands/tui/ws-handler.js.map +1 -1
- package/dist/scripts/fresh-install-smoke.js +1 -1
- package/dist/scripts/fresh-install-smoke.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/src/agent/agy-bootstrap.js +104 -17
- package/dist/src/agent/agy-bootstrap.js.map +1 -1
- package/dist/src/agent/agy-runtime.js +104 -0
- package/dist/src/agent/agy-runtime.js.map +1 -1
- package/dist/src/agent/agy-transcript-watcher.js +14 -0
- package/dist/src/agent/agy-transcript-watcher.js.map +1 -1
- package/dist/src/agent/args.js +16 -83
- package/dist/src/agent/args.js.map +1 -1
- package/dist/src/agent/error-classifier.js +1 -3
- package/dist/src/agent/error-classifier.js.map +1 -1
- package/dist/src/agent/events/claude.js +60 -3
- package/dist/src/agent/events/claude.js.map +1 -1
- package/dist/src/agent/events/helpers.js +1 -1
- package/dist/src/agent/events/helpers.js.map +1 -1
- package/dist/src/agent/events/index.js +27 -27
- package/dist/src/agent/events/index.js.map +1 -1
- package/dist/src/agent/events/summary.js +0 -21
- package/dist/src/agent/events/summary.js.map +1 -1
- package/dist/src/agent/events/tool-labels.js +0 -28
- package/dist/src/agent/events/tool-labels.js.map +1 -1
- package/dist/src/agent/jwc-event-mapper.js +3 -3
- package/dist/src/agent/jwc-event-mapper.js.map +1 -1
- package/dist/src/agent/jwc-runtime.js +5 -1
- package/dist/src/agent/jwc-runtime.js.map +1 -1
- package/dist/src/agent/kiro-runtime.js +40 -14
- package/dist/src/agent/kiro-runtime.js.map +1 -1
- package/dist/src/agent/lifecycle-handler.js +2 -77
- package/dist/src/agent/lifecycle-handler.js.map +1 -1
- package/dist/src/agent/prompt-context.js +38 -0
- package/dist/src/agent/prompt-context.js.map +1 -0
- package/dist/src/agent/resume-classifier.js +0 -4
- package/dist/src/agent/resume-classifier.js.map +1 -1
- package/dist/src/agent/spawn/resume.js +0 -18
- package/dist/src/agent/spawn/resume.js.map +1 -1
- package/dist/src/agent/spawn-env.js +0 -28
- package/dist/src/agent/spawn-env.js.map +1 -1
- package/dist/src/agent/spawn.js +81 -76
- package/dist/src/agent/spawn.js.map +1 -1
- package/dist/src/bgtask/presets.js +13 -1
- package/dist/src/bgtask/presets.js.map +1 -1
- package/dist/src/cli/employee-handler.js +10 -10
- package/dist/src/cli/employee-handler.js.map +1 -1
- package/dist/src/cli/handlers-completions.js +29 -10
- package/dist/src/cli/handlers-completions.js.map +1 -1
- package/dist/src/cli/handlers-runtime.js +3 -2
- package/dist/src/cli/handlers-runtime.js.map +1 -1
- package/dist/src/cli/opencodex-models.js +118 -0
- package/dist/src/cli/opencodex-models.js.map +1 -0
- package/dist/src/cli/readiness.js +2 -8
- package/dist/src/cli/readiness.js.map +1 -1
- package/dist/src/cli/registry-live.js +21 -1
- package/dist/src/cli/registry-live.js.map +1 -1
- package/dist/src/cli/registry.js +10 -21
- package/dist/src/cli/registry.js.map +1 -1
- package/dist/src/cli/tui/jawcode-bridge.js +15 -13
- package/dist/src/cli/tui/jawcode-bridge.js.map +1 -1
- package/dist/src/cli/tui/jawcode-render.js +26 -0
- package/dist/src/cli/tui/jawcode-render.js.map +1 -1
- package/dist/src/cli/tui/render/frame.js +158 -16
- package/dist/src/cli/tui/render/frame.js.map +1 -1
- package/dist/src/cli/tui/transcript.js +79 -3
- package/dist/src/cli/tui/transcript.js.map +1 -1
- package/dist/src/core/cli-detect.js +1 -1
- package/dist/src/core/cli-detect.js.map +1 -1
- package/dist/src/core/employees.js +12 -7
- package/dist/src/core/employees.js.map +1 -1
- package/dist/src/core/event-bus.js +13 -0
- package/dist/src/core/event-bus.js.map +1 -1
- package/dist/src/goal/heartbeat.js +8 -0
- package/dist/src/goal/heartbeat.js.map +1 -1
- package/dist/src/manager/load-timing.js +29 -0
- package/dist/src/manager/load-timing.js.map +1 -0
- package/dist/src/manager/observability.js.map +1 -1
- package/dist/src/manager/server.js +67 -6
- package/dist/src/manager/server.js.map +1 -1
- package/dist/src/memory/bootstrap.js +43 -1
- package/dist/src/memory/bootstrap.js.map +1 -1
- package/dist/src/orchestrator/distribute.js +5 -1
- package/dist/src/orchestrator/distribute.js.map +1 -1
- package/dist/src/orchestrator/state-machine.js +20 -0
- package/dist/src/orchestrator/state-machine.js.map +1 -1
- package/dist/src/orchestrator/worker-registry.js +2 -1
- package/dist/src/orchestrator/worker-registry.js.map +1 -1
- package/dist/src/prompt/templates/a1-system.md +61 -11
- package/dist/src/prompt/templates/employee.md +13 -0
- package/dist/src/prompt/templates/orchestration.md +14 -0
- package/dist/src/prompt/templates/worker-context.md +4 -4
- package/dist/src/routes/employees.js +8 -8
- package/dist/src/routes/employees.js.map +1 -1
- package/dist/src/routes/events.js +57 -19
- package/dist/src/routes/events.js.map +1 -1
- package/dist/src/routes/orchestrate.js +42 -17
- package/dist/src/routes/orchestrate.js.map +1 -1
- package/dist/src/routes/quota-agy-reverse.js +0 -24
- package/dist/src/routes/quota-agy-reverse.js.map +1 -1
- package/dist/src/routes/quota.js +0 -145
- package/dist/src/routes/quota.js.map +1 -1
- package/dist/src/routes/settings.js +2 -7
- package/dist/src/routes/settings.js.map +1 -1
- package/dist/src/shared/tool-log-sanitize.js +6 -0
- package/dist/src/shared/tool-log-sanitize.js.map +1 -1
- package/dist/src/telegram/forwarder.js +53 -5
- package/dist/src/telegram/forwarder.js.map +1 -1
- package/dist/src/trace/store.js +82 -0
- package/dist/src/trace/store.js.map +1 -1
- package/dist/src/types/cli-engine.js +0 -1
- package/dist/src/types/cli-engine.js.map +1 -1
- package/dist/src/types/cli-events.js +1 -1
- package/dist/src/types/cli-events.js.map +1 -1
- package/package.json +2 -2
- package/public/dist/assets/Agent-CHCXjXSN.js +1 -0
- package/public/dist/assets/CodeCanvas-BzhNLZVF.js +3 -0
- package/public/dist/assets/DocPanel-6Z_RELzd.js +1 -0
- package/public/dist/assets/{DocPanel-D3FYBhMp.css → DocPanel-DZKPTOm8.css} +1 -1
- package/public/dist/assets/FolderPanel-DdlzWAuK.js +3 -0
- package/public/dist/assets/{Heartbeat-D-Rfp094.js → Heartbeat-BblY8Z4a.js} +1 -1
- package/public/dist/assets/MarkdownRenderer-BivJ4hJm.js +1 -0
- package/public/dist/assets/MarkdownRenderer-Cl0oEICj.js +15 -0
- package/public/dist/assets/{Memory-VH4ZJCMW.js → Memory-BWcfxzCz.js} +1 -1
- package/public/dist/assets/ModelProvider-D4LBX7K2.js +1 -0
- package/public/dist/assets/agent-meta-FyI15KAa.js +1 -0
- package/public/dist/assets/{app-DaORcAyD.js → app-DszWzakT.js} +4 -4
- package/public/dist/assets/bgtask-badge-DZEQ5fMl.js +1 -0
- package/public/dist/assets/{bgtask-badge-BtUXEe1T.js → bgtask-badge-b7pj_Dbh.js} +1 -1
- package/public/dist/assets/constants-EMUBd5RQ.js +1 -0
- package/public/dist/assets/{employees-CZSyvJbx.js → employees-DbgFV33i.js} +1 -1
- package/public/dist/assets/{manager-DB5qTw1A.js → manager-CdNOlCyS.js} +4 -4
- package/public/dist/assets/{manager-D3waO_XX.css → manager-rHNwUB4e.css} +1 -1
- package/public/dist/assets/memory-BT-rs3ag.js +1 -0
- package/public/dist/assets/{memory-cWI_Htbn.js → memory-QobGT0Kv.js} +1 -1
- package/public/dist/assets/message-history-BY1UNJAO.js +1 -0
- package/public/dist/assets/message-history-BmP5JKio.js +142 -0
- package/public/dist/assets/{render-Bp8eyqCf.js → render-C3r-9_-J.js} +2 -2
- package/public/dist/assets/settings-CJm8ZSJs.js +1 -0
- package/public/dist/assets/{settings-DLkP7qRV.js → settings-D70uFh8l.js} +1 -1
- package/public/dist/assets/{settings-core-B5XRRNcX.js → settings-core-B2lw2bgO.js} +1 -1
- package/public/dist/assets/settings-core-gdS0lo1b.js +1 -0
- package/public/dist/assets/{sidebar-CsogFOse.js → sidebar-BqWm2XWP.js} +3 -3
- package/public/dist/assets/{skills-Dmf4v9rj.js → skills-CdNOfXlk.js} +1 -1
- package/public/dist/assets/skills-DG_CbTEf.js +1 -0
- package/public/dist/assets/{slash-commands-vcf7FuPD.js → slash-commands-4Ntm5N7h.js} +1 -1
- package/public/dist/assets/slash-commands-B9kOEhJ_.js +1 -0
- package/public/dist/assets/{trace-drawer-DuQQ0SNq.js → trace-drawer-DqAwwHHQ.js} +1 -1
- package/public/dist/assets/ui-Anw2S64o.js +1 -0
- package/public/dist/assets/ui-DsK6r0Xv.js +2 -0
- package/public/dist/index.html +1 -1
- package/public/dist/manager/index.html +2 -2
- package/public/js/constants.ts +7 -7
- package/public/js/features/employees.ts +0 -3
- package/public/js/features/process-block-dom.ts +6 -1
- package/public/js/features/process-block.ts +59 -3
- package/public/js/render/file-links.ts +1 -1
- package/public/js/ui.ts +9 -1
- package/public/js/virtual-scroll.ts +23 -0
- package/public/js/ws.ts +7 -2
- package/public/manager/src/SidebarRailRouter.tsx +15 -10
- package/public/manager/src/code/CodeCanvas.tsx +3 -1
- package/public/manager/src/code/CodeTranscript.tsx +5 -4
- package/public/manager/src/code/CodeWorkbench.tsx +2 -1
- package/public/manager/src/doc-panel/DocPanel.tsx +52 -5
- package/public/manager/src/doc-panel/doc-panel.css +10 -0
- package/public/manager/src/folder-panel/FolderPanel.tsx +14 -16
- package/public/manager/src/folder-panel/use-folder-git-status.ts +15 -0
- package/public/manager/src/folder-panel/use-folder-preview-sync.ts +37 -0
- package/public/manager/src/folder-panel/use-folder-visible-refresh.ts +19 -6
- package/public/manager/src/manager-notes.css +23 -0
- package/public/manager/src/notes/rendering/MarkdownRenderer.tsx +80 -2
- package/public/manager/src/settings/pages/Agent.tsx +30 -8
- package/public/manager/src/settings/pages/ModelProvider.tsx +22 -4
- package/public/manager/src/settings/pages/components/agent/AgentEmployeesSection.tsx +5 -1
- package/public/manager/src/settings/pages/components/agent/FlushAgentSection.tsx +5 -3
- package/public/manager/src/settings/pages/components/agent/RuntimeEmployeeRow.tsx +6 -4
- package/public/manager/src/settings/pages/components/agent/RuntimeHeader.tsx +4 -2
- package/public/manager/src/settings/pages/components/agent/agent-meta.ts +45 -9
- package/public/manager/src/settings/pages/components/agent/runtime-employees-helpers.ts +7 -2
- package/scripts/capture-agy-quota-fixture.mjs +138 -0
- package/scripts/fresh-install-smoke.ts +1 -1
- package/dist/src/agent/events/gemini.js +0 -100
- package/dist/src/agent/events/gemini.js.map +0 -1
- package/public/dist/assets/Agent-Ci12HWhE.js +0 -1
- package/public/dist/assets/CodeCanvas-d1gh0-lY.js +0 -3
- package/public/dist/assets/DocPanel-C6XQ7W6A.js +0 -1
- package/public/dist/assets/FolderPanel-DIFAqajZ.js +0 -3
- package/public/dist/assets/MarkdownRenderer-DXKUEE2a.js +0 -1
- package/public/dist/assets/MarkdownRenderer-DcIxpNcX.js +0 -15
- package/public/dist/assets/ModelProvider-_tUCghOF.js +0 -1
- package/public/dist/assets/agent-meta-DqBTGRRQ.js +0 -1
- package/public/dist/assets/bgtask-badge-B3HLOZae.js +0 -1
- package/public/dist/assets/constants-DkJ3E63Y.js +0 -1
- package/public/dist/assets/memory-BEruUlfu.js +0 -1
- package/public/dist/assets/message-history-DU1V9ZAW.js +0 -142
- package/public/dist/assets/message-history-tjkyOp_K.js +0 -1
- package/public/dist/assets/settings-B-GgyJZI.js +0 -1
- package/public/dist/assets/settings-core-Cw1av-Ox.js +0 -1
- package/public/dist/assets/skills-CLcoop6W.js +0 -1
- package/public/dist/assets/slash-commands-DY6-hzq6.js +0 -1
- package/public/dist/assets/ui-BKYuBdZE.js +0 -2
- package/public/dist/assets/ui-CqlGwgUo.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL.js";import{t as r}from"./preload-helper-DFYRRz9w.js";import{O as i,T as a,b as o,j as s,n as c,x as l}from"./render-
|
|
2
|
+
import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL.js";import{t as r}from"./preload-helper-DFYRRz9w.js";import{O as i,T as a,b as o,j as s,n as c,x as l}from"./render-C3r-9_-J.js";import{F as ee,L as te,R as ne,_ as re,d as ie,u,v as d}from"./message-history-BmP5JKio.js";import{a as ae,d as oe,i as se,l as f,n as ce,r as le,s as ue,t as de,u as fe}from"./ui-DsK6r0Xv.js";var p=null,m=0,h=[],g=2e3,pe=3e4,me=1.5,_=null,he=4e4,ge=1e4,_e=0,ve=!1,ye=null;function be(){ye||=setInterval(()=>{!p||!v||!ve||Date.now()-_e<=he||(console.warn(`[sse] stalled channel (no ping in`,he,`ms) — forcing reconnect`),p.close(),p=null,v=!1,y?.(),b(xe))},ge)}var xe=``,v=!1,Se=!1,Ce=!1,we=!1,Te=!1,Ee=null,y=null,De=null;function Oe(e){Ee=e}function ke(e){y=e}function Ae(e){De=e}function je(e,t,n){let r={topic:e,event:t,handler:n};return h.push(r),()=>{let e=h.indexOf(r);e>=0&&h.splice(e,1)}}function Me(e,t,n){for(let r of h)if((r.topic===`*`||r.topic===e)&&(r.event===null||r.event===t))try{r.handler(n)}catch(e){console.warn(`[sse] handler error:`,e.message)}}function Ne(){Se||_||(_=setTimeout(()=>{_=null,b(xe)},g),g=Math.min(g*me,pe))}function b(e){xe=e,Se=!1,_&&=(clearTimeout(_),null),p&&p.close();let t=`${n}/api/events?lang=${encodeURIComponent(e)}`+(m?`&lastEventId=${m}`:``);we=!1,Te=!1,p=new EventSource(t),be(),p.onopen=()=>{g=2e3,v=!0,Ce=!0,we=!0,_e=Date.now(),Ee?.()},p.onerror=()=>{if(p?.close(),p=null,!we&&!Ce&&De){Te||(Te=!0,De());return}v&&(v=!1,y?.()),Ne()},p.onmessage=e=>{m=parseInt(e.lastEventId||`0`,10)||m;let t;try{t=JSON.parse(e.data)}catch{console.warn(`[sse] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.topic!=`string`||typeof t.event!=`string`){console.warn(`[sse] invalid message shape:`,t);return}if(_e=Date.now(),t.topic===`system`&&t.event===`ping`){ve=!0;return}Me(t.topic,t.event,t)}}var Pe=3e3,x=new Map,S=[],C=(e,t)=>`${e}:${t}`;function w(e=[]){let t=document.getElementById(`pendingQueue`);if(t){if(S=e.slice(),!e.length){ze(new Set),t.classList.remove(`visible`),t.innerHTML=``;return}t.classList.add(`visible`),t.innerHTML=`
|
|
3
3
|
<div class="pending-queue-header">
|
|
4
4
|
<span class="pending-queue-title">${l.hourglass} <span data-i18n="queue.pendingTitle">${a(s(`queue.pendingTitle`))}</span> <span class="pending-queue-count">${e.length}</span></span>
|
|
5
5
|
</div>
|
|
@@ -12,7 +12,7 @@ import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL
|
|
|
12
12
|
<button class="pending-row-btn pending-row-copy" data-pending-action="copy" title="${i}" aria-label="${i}"><span class="pending-btn-content">${l.copy}</span></button>
|
|
13
13
|
<button class="pending-row-btn pending-row-steer" data-pending-action="steer" data-i18n-title="queue.steer" title="${o}" aria-label="${o}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content"><span class="pending-steer-arrow" aria-hidden="true">↳</span><span class="pending-steer-label">${o}</span></span></button>
|
|
14
14
|
<button class="pending-row-btn pending-row-delete" data-pending-action="delete" data-i18n-title="queue.delete" title="${c}" aria-label="${c}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content">${l.trash}</span></button>
|
|
15
|
-
</div>`}function T(e,t){let n=document.querySelector(`.pending-row[data-pending-id="${CSS.escape(e)}"]`);return n?n.querySelector(`[data-pending-action="${t}"]`):null}function Ie(e,t){let n=T(e,t);if(!n)return;n.classList.add(`armed`),n.setAttribute(`title`,s(`queue.cancelArm`));let r=n.querySelector(`.pending-arm-fill`);r&&(r.style.animation=`none`,r.offsetWidth,r.style.animation=``)}function Le(e,t){let n=T(e,t);n&&(n.classList.remove(`armed`),n.setAttribute(`title`,s(t===`steer`?`queue.steer`:`queue.delete`)))}function Re(){for(let e of x.values()){let t=T(e.id,e.action);t&&(t.classList.add(`armed`),t.setAttribute(`title`,s(`queue.cancelArm`)))}}function ze(e){for(let[t,n]of x)e.has(n.id)||(clearTimeout(n.timerId),x.delete(t))}function Be(e,n){let r=C(e,n),i=setTimeout(()=>He(e,n),Pe);x.set(r,{id:e,action:n,timerId:i}),Ie(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`POST`,{}).catch(()=>{})}function Ve(e,n){let r=C(e,n),i=x.get(r);i&&(clearTimeout(i.timerId),x.delete(r),Le(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`DELETE`,{}).catch(()=>{}))}async function He(e,n){x.delete(C(e,n));let r=n===`steer`?`/api/orchestrate/queue/${encodeURIComponent(e)}/steer`:`/api/orchestrate/queue/${encodeURIComponent(e)}`,i=n===`steer`?`POST`:`DELETE`;if(n===`steer`&&u(`running`),await t(r,i,{})==null){S=S.filter(t=>t.id!==e),w(S),n===`steer`&&U(`steer-fire-miss`).catch(()=>{});return}S=S.filter(t=>t.id!==e),w(S)}function Ue(e,t){if(x.has(C(e,t))){Ve(e,t);return}Be(e,t)}function We(){let e=document.getElementById(`pendingQueue`);e&&e.addEventListener(`click`,async e=>{let t=e.target?.closest(`[data-pending-action]`);if(!t)return;let n=t.closest(`.pending-row`)?.dataset.pendingId;if(!n)return;let r=t.dataset.pendingAction;if(r===`copy`){let e=S.find(e=>e.id===n);if(e?.prompt&&(await o(e.prompt)).ok){let e=t.querySelector(`.pending-btn-content`);e&&(e.innerHTML=l.checkSimple,setTimeout(()=>{e.innerHTML=l.copy},600))}return}Ue(n,r===`steer`?`steer`:`delete`)})}var Ge=800,E=64,Ke=`CLI-JAW`,D=!1,O=0,k=Ke,A=null,j=``,M=!1,N=0;function qe(){return navigator}function Je(){return document.visibilityState!==`visible`||!document.hasFocus()}function Ye(e){return e-N<Ge}function Xe(){if(A)return A;let e=document.querySelector(`link[rel~="icon"]`);if(e)return A=e,j=e.href||e.getAttribute(`href`)||``,e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.appendChild(t),A=t,M=!0,t}function Ze(e){let t=document.createElement(`canvas`);t.width=E,t.height=E;let n=t.getContext(`2d`);return n?(n.clearRect(0,0,E,E),n.font=`44px "Apple Color Emoji", "Segoe UI Emoji", sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(`🦈`,28,36),n.beginPath(),n.arc(50,15,e>1?12:9,0,Math.PI*2),n.fillStyle=`#ff335f`,n.fill(),n.lineWidth=4,n.strokeStyle=`#ffffff`,n.stroke(),e>1&&(n.fillStyle=`#ffffff`,n.font=`bold 15px sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(String(Math.min(e,9)),50,16)),t.toDataURL(`image/png`)):j}async function Qe(e){let t=qe();if(typeof t.setAppBadge==`function`)try{await t.setAppBadge(e)}catch{}}async function $e(){let e=qe();if(typeof e.clearAppBadge==`function`)try{await e.clearAppBadge()}catch{}}function et(){document.title=`(${O}) ${k}`;let e=Xe();e&&(e.href=Ze(O)),Qe(O)}function tt(){document.title=k}function nt(){if(A){if(M){A.remove(),A=null,M=!1;return}A.href=j}}function rt(){D||(D=!0,k=document.title||Ke,Xe(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&at()}),window.addEventListener(`focus`,()=>at()))}function it(){if(!D||!Je())return;let e=Date.now();Ye(e)||(N=e,O+=1,et())}function at(){!D||O===0||(O=0,N=0,tt(),nt(),$e())}function ot(e,t){return!e||!t?!0:e===`all`||e===t}var P=[`I`,`P`,`A`,`B`,`C`],F=null;function st(e,t,n){let r=P.indexOf(n);if(r<0)return;let i=e.getBoundingClientRect(),a=t.offsetWidth||36,o=document.getElementById(`dot-${n}`);if(!o)return;let s=P[r+1],c=s?document.getElementById(`dot-${s}`):null;if(c){let e=o.getBoundingClientRect(),n=c.getBoundingClientRect(),r=(e.right+n.left)/2;t.style.left=r-i.left-a/2+`px`}else{let e=o.getBoundingClientRect();t.style.left=e.left-i.left+e.width/2-a/2+`px`}}var I={},ct=8,lt=64,L=null,R=0,z=[],B=new Map;function ut(e){return e!==null&&z.includes(e)}function dt(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):null}function ft(e,t){if(!(!e||t==null))for(t>(B.get(e)||0)&&B.set(e,t);B.size>lt;){let e=null;for(let t of B.keys())if(t!==L){e=t;break}if(!e)break;B.delete(e)}}function pt(e){let t=new Map;for(let n of e?.toolLog||[]){let e=typeof n?.traceRunId==`string`&&n.traceRunId?n.traceRunId:null,r=dt(n?.traceSeq);!e||r==null||r>(t.get(e)||0)&&t.set(e,r)}return t}function mt(e,t,n){return!n||!e||t==null?!1:t<=(B.get(e)||0)}function ht(e){let t=e??L;L=null,R=0,t&&!z.includes(t)&&(z.push(t),z.length>ct&&z.shift())}function gt(e){!e||e===L||(L=e,R=0)}function _t(e){if(e?.running){typeof e.traceRunId==`string`&&e.traceRunId&&(L=e.traceRunId),R=typeof e.textLen==`number`?e.textLen:(e.text||``).length;for(let[t,n]of pt(e))ft(t,n)}}var vt=``,V=0,H=null,yt=0,bt=!1,xt=0,St=750,Ct=750;async function wt(e={}){let t=await(await fetch(`${n}/api/orchestrate/snapshot`)).json();vt=String(t.orc.scope||``),Rt(t.orc.state),jt(t.orc.ctx||null),At(t.heartbeat||{pending:0,deferredPending:0}),kt(t.workers),ie(t.runtime.queuePending),ce(t.queued||[]),w(t.queued||[]),e.hydrateRun&&(ue(t.activeRun),_t(t.activeRun)),It(),t.runtime.busy?u(`running`):f()||u(`idle`),r(()=>import(`./employees-
|
|
15
|
+
</div>`}function T(e,t){let n=document.querySelector(`.pending-row[data-pending-id="${CSS.escape(e)}"]`);return n?n.querySelector(`[data-pending-action="${t}"]`):null}function Ie(e,t){let n=T(e,t);if(!n)return;n.classList.add(`armed`),n.setAttribute(`title`,s(`queue.cancelArm`));let r=n.querySelector(`.pending-arm-fill`);r&&(r.style.animation=`none`,r.offsetWidth,r.style.animation=``)}function Le(e,t){let n=T(e,t);n&&(n.classList.remove(`armed`),n.setAttribute(`title`,s(t===`steer`?`queue.steer`:`queue.delete`)))}function Re(){for(let e of x.values()){let t=T(e.id,e.action);t&&(t.classList.add(`armed`),t.setAttribute(`title`,s(`queue.cancelArm`)))}}function ze(e){for(let[t,n]of x)e.has(n.id)||(clearTimeout(n.timerId),x.delete(t))}function Be(e,n){let r=C(e,n),i=setTimeout(()=>He(e,n),Pe);x.set(r,{id:e,action:n,timerId:i}),Ie(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`POST`,{}).catch(()=>{})}function Ve(e,n){let r=C(e,n),i=x.get(r);i&&(clearTimeout(i.timerId),x.delete(r),Le(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`DELETE`,{}).catch(()=>{}))}async function He(e,n){x.delete(C(e,n));let r=n===`steer`?`/api/orchestrate/queue/${encodeURIComponent(e)}/steer`:`/api/orchestrate/queue/${encodeURIComponent(e)}`,i=n===`steer`?`POST`:`DELETE`;if(n===`steer`&&u(`running`),await t(r,i,{})==null){S=S.filter(t=>t.id!==e),w(S),n===`steer`&&U(`steer-fire-miss`).catch(()=>{});return}S=S.filter(t=>t.id!==e),w(S)}function Ue(e,t){if(x.has(C(e,t))){Ve(e,t);return}Be(e,t)}function We(){let e=document.getElementById(`pendingQueue`);e&&e.addEventListener(`click`,async e=>{let t=e.target?.closest(`[data-pending-action]`);if(!t)return;let n=t.closest(`.pending-row`)?.dataset.pendingId;if(!n)return;let r=t.dataset.pendingAction;if(r===`copy`){let e=S.find(e=>e.id===n);if(e?.prompt&&(await o(e.prompt)).ok){let e=t.querySelector(`.pending-btn-content`);e&&(e.innerHTML=l.checkSimple,setTimeout(()=>{e.innerHTML=l.copy},600))}return}Ue(n,r===`steer`?`steer`:`delete`)})}var Ge=800,E=64,Ke=`CLI-JAW`,D=!1,O=0,k=Ke,A=null,j=``,M=!1,N=0;function qe(){return navigator}function Je(){return document.visibilityState!==`visible`||!document.hasFocus()}function Ye(e){return e-N<Ge}function Xe(){if(A)return A;let e=document.querySelector(`link[rel~="icon"]`);if(e)return A=e,j=e.href||e.getAttribute(`href`)||``,e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.appendChild(t),A=t,M=!0,t}function Ze(e){let t=document.createElement(`canvas`);t.width=E,t.height=E;let n=t.getContext(`2d`);return n?(n.clearRect(0,0,E,E),n.font=`44px "Apple Color Emoji", "Segoe UI Emoji", sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(`🦈`,28,36),n.beginPath(),n.arc(50,15,e>1?12:9,0,Math.PI*2),n.fillStyle=`#ff335f`,n.fill(),n.lineWidth=4,n.strokeStyle=`#ffffff`,n.stroke(),e>1&&(n.fillStyle=`#ffffff`,n.font=`bold 15px sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(String(Math.min(e,9)),50,16)),t.toDataURL(`image/png`)):j}async function Qe(e){let t=qe();if(typeof t.setAppBadge==`function`)try{await t.setAppBadge(e)}catch{}}async function $e(){let e=qe();if(typeof e.clearAppBadge==`function`)try{await e.clearAppBadge()}catch{}}function et(){document.title=`(${O}) ${k}`;let e=Xe();e&&(e.href=Ze(O)),Qe(O)}function tt(){document.title=k}function nt(){if(A){if(M){A.remove(),A=null,M=!1;return}A.href=j}}function rt(){D||(D=!0,k=document.title||Ke,Xe(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&at()}),window.addEventListener(`focus`,()=>at()))}function it(){if(!D||!Je())return;let e=Date.now();Ye(e)||(N=e,O+=1,et())}function at(){!D||O===0||(O=0,N=0,tt(),nt(),$e())}function ot(e,t){return!e||!t?!0:e===`all`||e===t}var P=[`I`,`P`,`A`,`B`,`C`],F=null;function st(e,t,n){let r=P.indexOf(n);if(r<0)return;let i=e.getBoundingClientRect(),a=t.offsetWidth||36,o=document.getElementById(`dot-${n}`);if(!o)return;let s=P[r+1],c=s?document.getElementById(`dot-${s}`):null;if(c){let e=o.getBoundingClientRect(),n=c.getBoundingClientRect(),r=(e.right+n.left)/2;t.style.left=r-i.left-a/2+`px`}else{let e=o.getBoundingClientRect();t.style.left=e.left-i.left+e.width/2-a/2+`px`}}var I={},ct=8,lt=64,L=null,R=0,z=[],B=new Map;function ut(e){return e!==null&&z.includes(e)}function dt(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):null}function ft(e,t){if(!(!e||t==null))for(t>(B.get(e)||0)&&B.set(e,t);B.size>lt;){let e=null;for(let t of B.keys())if(t!==L){e=t;break}if(!e)break;B.delete(e)}}function pt(e){let t=new Map;for(let n of e?.toolLog||[]){let e=typeof n?.traceRunId==`string`&&n.traceRunId?n.traceRunId:null,r=dt(n?.traceSeq);!e||r==null||r>(t.get(e)||0)&&t.set(e,r)}return t}function mt(e,t,n){return!n||!e||t==null?!1:t<=(B.get(e)||0)}function ht(e){let t=e??L;L=null,R=0,t&&!z.includes(t)&&(z.push(t),z.length>ct&&z.shift())}function gt(e){!e||e===L||(L=e,R=0)}function _t(e){if(e?.running){typeof e.traceRunId==`string`&&e.traceRunId&&(L=e.traceRunId),R=typeof e.textLen==`number`?e.textLen:(e.text||``).length;for(let[t,n]of pt(e))ft(t,n)}}var vt=``,V=0,H=null,yt=0,bt=!1,xt=0,St=750,Ct=750;async function wt(e={}){let t=await(await fetch(`${n}/api/orchestrate/snapshot`)).json();vt=String(t.orc.scope||``),Rt(t.orc.state),jt(t.orc.ctx||null),At(t.heartbeat||{pending:0,deferredPending:0}),kt(t.workers),ie(t.runtime.queuePending),ce(t.queued||[]),w(t.queued||[]),e.hydrateRun&&(ue(t.activeRun),_t(t.activeRun)),It(),t.runtime.busy?u(`running`):f()||u(`idle`),r(()=>import(`./employees-DbgFV33i.js`).then(e=>{typeof e.renderEmployees==`function`&&e.renderEmployees()}),__vite__mapDeps([0]))}function U(e=`manual`,t={}){let n=Date.now();return t.hydrateRun?wt(t):H||(n-yt<St?Promise.resolve():(yt=n,H=wt(t).catch(t=>{throw console.warn(`[ws] orchestrate snapshot sync failed (${e})`,t),t}).finally(()=>{H=null}),H))}function Tt(e){return e===`iframe-visible`||e===`pageshow`||e===`discard`||e===`visibilitychange`}function Et(e){te(e),r(()=>import(`./ui-Anw2S64o.js`).then(async t=>{if(Tt(e)&&V>0)try{await t.loadMessages(),V=Date.now()}catch(t){console.warn(`[ws] restore loadMessages failed (${e})`,t)}await U(e,{hydrateRun:!0})}),__vite__mapDeps([0])).catch(()=>{}).finally(()=>{ee(e)})}function W(e){let t=Date.now();!Tt(e)&&t-xt<Ct||(xt=t,Et(e))}function Dt(e){let t=Array.isArray(e.changedKeys)?e.changedKeys:[];t.includes(`workingDir`)||t.includes(`projectDirs`)?r(()=>import(`./ui-Anw2S64o.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.warn(`[ws] settings scope loadMessages failed`,e)}await U(`settings_change`).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`settings_change`))}),__vite__mapDeps([0])):U(`settings_change`).catch(()=>{}),r(()=>import(`./settings-core-gdS0lo1b.js`).then(t=>t.refreshHeaderFromSettingsChange(e)),__vite__mapDeps([0])).catch(()=>{})}function Ot(){bt||(bt=!0,window.addEventListener(`focus`,()=>{W(`focus`)}),window.addEventListener(`pageshow`,e=>{e.persisted&&W(`pageshow`)}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&W(`visibilitychange`)}),document.addEventListener(`resume`,()=>{W(`resume`)}),`wasDiscarded`in document&&document.wasDiscarded&&W(`discard`),window.addEventListener(`message`,e=>{e.data?.type===`jaw-preview-visibility`&&e.data.visible&&W(`iframe-visible`)}))}function kt(e){for(let e of Object.keys(I))delete I[e];for(let t of e)t.state===`running`&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``})}function At(t){let n={pending:Number(t?.pending||0),deferredPending:Number(t?.deferredPending||0),...t?.reason?{reason:t.reason}:{},...t?.policy?{policy:t.policy}:{},...t?.jobId?{jobId:t.jobId}:{},...t?.jobName?{jobName:t.jobName}:{}};e.heartbeatRuntime=n;let r=document.getElementById(`pabcHeartbeatStatus`);if(r)if(n.reason===`pabcd_active`&&n.deferredPending>0){let e=n.jobName?`: ${n.jobName}`:``;r.textContent=`heartbeat deferred (${n.deferredPending})${e}`,r.hidden=!1}else r.textContent=``,r.hidden=!0}function jt(t){e.orcTaskAnchor=String(t?.taskAnchor||``).trim(),e.orcResolvedSelection=t?.resolvedSelection||null;let n=document.getElementById(`pabcTaskAnchor`);n&&(e.orcTaskAnchor?(n.textContent=`anchor: ${e.orcResolvedSelection?.index?`${e.orcResolvedSelection.index}. `:``}${e.orcTaskAnchor}`,n.hidden=!1):(n.textContent=``,n.hidden=!0),Pt(t?.interview||null))}var G=(()=>{try{return localStorage.getItem(`jaw:interviewCollapsed`)===`1`}catch{return!1}})();function Mt(e){G=e;try{localStorage.setItem(`jaw:interviewCollapsed`,e?`1`:`0`)}catch{}let t=document.getElementById(`interviewPanel`);if(!t)return;t.classList.toggle(`collapsed`,e);let n=t.querySelector(`.iv-toggle`);n&&n.setAttribute(`aria-expanded`,String(!e))}function Nt(e){let t=e=>{switch(e){case`max`:return 1;case`xhigh`:return .8;case`high`:return .6;case`medium`:return .4;default:return .2}},n=e=>{switch(e){case`max`:return`#2196f3`;case`xhigh`:return`#4caf50`;case`high`:return`#8bc34a`;case`medium`:return`#ff9800`;default:return`#f44336`}},r=[t(e.goal),t(e.constraint),t(e.success),t(e.ontology)],i=1-r.reduce((e,t)=>e+t,0)/r.length,a=Object.values(e).every(e=>e===`max`)||i<=.2?`🟢 Ready`:i<=.4?`🟡 Almost`:`🔴 Needs work`,o=(e,r)=>{let i=t(r);return`<div style="display:flex;align-items:center;gap:6px;font-size:12px">
|
|
16
16
|
<span style="width:70px;color:var(--text-secondary)">${e}</span>
|
|
17
17
|
<div style="flex:1;height:5px;background:var(--bg-tertiary);border-radius:3px">
|
|
18
18
|
<div style="width:${i*100}%;height:100%;background:${n(r)};border-radius:3px;transition:width .3s"></div>
|
|
@@ -46,4 +46,4 @@ import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL
|
|
|
46
46
|
</div>`};n.innerHTML=`<div style="font-size:11px;font-weight:600;margin-bottom:4px;color:var(--text-secondary)">Build Budget</div>
|
|
47
47
|
${r(`Workers`,e.spent.workerDispatches,e.maxWorkerDispatches)}
|
|
48
48
|
${r(`Self-heal`,e.spent.selfHealRetries,e.maxSelfHealRetries)}
|
|
49
|
-
${r(`Verify`,e.spent.verificationRounds,e.maxVerificationRounds)}`}async function It(){try{let t=await fetch(`${n}/api/goal`);if(!t.ok)return;let r=await t.json();r.goal?e.activeGoal={id:r.goal.id,objective:r.goal.objective,status:r.goal.status,createdAt:r.goal.createdAt,updatedAt:r.goal.updatedAt,lastCheckpointSummary:r.goal.lastCheckpoint?.summary,nextAction:r.goal.lastCheckpoint?.nextAction}:e.activeGoal=null,Lt()}catch{}}function Lt(){let t=document.getElementById(`goalCockpit`);if(!t)return;let n=e.activeGoal;if(!n||n.status===`complete`||n.status===`cancelled`){t.hidden=!0,t.innerHTML=``;return}t.hidden=!1,t.replaceChildren();let r=n.status===`paused`?`paused`:n.status===`blocked`?`blocked`:`active`,i=document.createElement(`span`);i.className=`goal-objective`,i.title=n.objective,i.textContent=n.objective;let a=document.createElement(`span`);if(a.className=`goal-status goal-status--${r}`,a.textContent=n.status,t.append(i,a),n.nextAction){let e=document.createElement(`span`);e.className=`goal-next`,e.textContent=n.nextAction,t.append(e)}}function Rt(t,n){let r=new Set([`IDLE`,`I`,`P`,`A`,`B`,`C`,`D`]).has(t)?t:`IDLE`;if(e.orcState=r,r===`IDLE`||r===`D`)document.body.removeAttribute(`data-orc-state`),document.body.style.removeProperty(`--orc-glow`);else{document.body.setAttribute(`data-orc-state`,r);let e=`--orc-glow-${r}`,t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();document.body.style.setProperty(`--orc-glow`,t)}document.body.classList.add(`orc-pulse`),setTimeout(()=>document.body.classList.remove(`orc-pulse`),700);let i=document.getElementById(`orcStateBadge`);i&&(i.textContent={IDLE:``,I:`INTERVIEW`,P:`PLAN`,A:`AUDIT`,B:`BUILD`,C:`CHECK`,D:`DONE`}[r],i.style.display=r===`IDLE`?`none`:`inline-block`);let a=document.getElementById(`pabcRoadmap`),o=document.getElementById(`sharkRunner`),s=document.getElementById(`pabcBrand`);if(a&&o){if(!a.dataset.resizeObserved){a.dataset.resizeObserved=`1`,new ResizeObserver(()=>{F&&o.classList.contains(`running`)&&st(a,o,F)}).observe(a);let e=0;window.addEventListener(`resize`,()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{F&&o.classList.contains(`running`)&&st(a,o,F)})})}if(r===`IDLE`)a.classList.remove(`visible`,`shimmer-out`),o.classList.remove(`running`),F=null;else if(r===`D`){P.forEach(e=>{let t=document.getElementById(`dot-${e}`);t&&(t.className=`pabc-dot done`,t.setAttribute(`data-phase`,e))});for(let e=0;e<P.length;e++){let t=document.getElementById(`pabc-conn-${e}`);t&&(t.className=`pabc-connector done`)}o.classList.remove(`running`),F=null,a.classList.add(`shimmer-out`),setTimeout(()=>a.classList.remove(`visible`,`shimmer-out`),1e3)}else{a.classList.remove(`shimmer-out`),a.classList.add(`visible`),o.classList.add(`running`);let e=P.indexOf(r);P.forEach((t,n)=>{let r=document.getElementById(`dot-${t}`);r&&(r.className=`pabc-dot ${n<e?`done`:n===e?`active`:`future`}`,r.setAttribute(`data-phase`,t))});for(let t=0;t<P.length;t++){let n=document.getElementById(`pabc-conn-${t}`);n&&(n.className=`pabc-connector ${t<e?`done`:``}`)}F=r,requestAnimationFrame(()=>st(a,o,r))}s&&n&&(s.textContent=n)}}var zt=!1,Bt=Promise.resolve(),Vt=0;function K(){Ot(),zt||(zt=!0,Zt()),Yt(),b(i())}var Ht=K;function Ut(e){console.log(`[${e}] connected`),X=2e3,Kt();let t=Date.now()-V<1e4;Bt=r(()=>import(`./ui-CqlGwgUo.js`).then(async n=>{if(n.cleanupToolActivity(),!t)try{await n.loadMessages(),V=Date.now()}catch(t){console.error(`[${e}] loadMessages failed`,t)}await U(`reconnect`,{hydrateRun:!0}).catch(()=>{}).finally(()=>n.reconcileChatBottomAfterRestore(`reconnect`)),r(()=>import(`./memory-BEruUlfu.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])).catch(()=>{}),r(()=>import(`./bgtask-badge-B3HLOZae.js`).then(e=>e.refreshBgtaskBadge()),__vite__mapDeps([0])).catch(()=>{})}),void 0)}function Wt(){te(`replay_gap`),Bt=r(()=>import(`./ui-CqlGwgUo.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.error(`[sse] replay gap loadMessages failed`,e)}await U(`replay_gap`,{hydrateRun:!0}).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`replay_gap`))}),__vite__mapDeps([0]))}var Gt=8e3,q=null;function Kt(){q!==null&&(window.clearTimeout(q),q=null)}function qt(){console.log(`[channel] disconnected`),r(()=>import(`./ui-CqlGwgUo.js`).then(e=>e.cleanupToolActivity()),__vite__mapDeps([0])),q===null&&(q=window.setTimeout(()=>{q=null,u(`idle`),d(`${l.exec} ${s(`ws.disconnected`)}`,`tool-activity`)},Gt))}var J=null,Y=!1,X=2e3,Jt=3e4;function Yt(){if(J){Y=!0;try{J.close()}catch{}J=null}}function Xt(){if(J)return;console.warn(`[channel] /api/events unavailable — falling back to legacy WebSocket`);let e=`ws://${location.host}`,t=new WebSocket(`${e}${n}/?lang=${i()}`);J=t,Y=!1,t.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{console.warn(`[ws] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.type!=`string`){console.warn(`[ws] invalid message shape:`,t);return}Qt(t)};let r=!1;t.onopen=()=>{r=!0,X=2e3,Ut(`ws`)},t.onclose=()=>{if(J===t&&(J=null),Y){Y=!1;return}if(r){qt(),setTimeout(K,2e3);return}X=Math.min(X*2,Jt),setTimeout(K,X)}}function Zt(){je(`*`,null,e=>{Qt({...e,type:e.event})}),Oe(()=>Ut(`sse`)),ke(()=>qt()),Ae(()=>Xt())}function Qt(t){if(t.type===`agent_status`){if(!t.running&&f())return;t.running&&f()&&se(),t.running===void 0?u(t.status||`idle`):u(t.running?`running`:`idle`),t.agentId&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``},r(()=>import(`./employees-CZSyvJbx.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])))}else if(t.type===`bgtask_update`)r(()=>import(`./bgtask-badge-B3HLOZae.js`).then(e=>e.applyBgtaskUpdate(t)),__vite__mapDeps([0])).catch(()=>{});else if(t.type===`queue_update`)ie(t.pending||0),Array.isArray(t.queued)&&w(t.queued),U(`queue_update`).catch(()=>{});else if(t.type===`agent_tool`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null,n=dt(t.traceSeq);if(ut(e)||mt(e,n,t.sseReplay===!0))return;t.isEmployee!==!0&>(e);let r=t.toolType===`thinking`?`thinking`:t.toolType===`search`?`search`:t.toolType===`subagent`?`subagent`:`tool`;oe({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,type:r,icon:t.icon||l.tool,rawIcon:t.rawIcon||t.icon||``,label:t.label||``,isEmployee:t.isEmployee===!0,detail:t.detail||``,stepRef:t.stepRef||``,traceRunId:t.traceRunId||``,traceSeq:t.traceSeq,detailAvailable:t.detailAvailable,detailBytes:t.detailBytes,rawRetentionStatus:t.rawRetentionStatus,status:t.status||`running`,startTime:Date.now()}),ft(e,n)}else if(t.type===`agent_output`||t.type===`agent_chunk`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(ut(e))return;gt(e);let n=t.text||``;if(e&&typeof t.textLen==`number`){if(t.textLen<=R){t.sseReplay!==!0&&t.textLen<R&&(console.warn(`[ws] live agent_output behind applied cursor — resync (${t.textLen} < ${R})`),R=t.textLen);return}let e=t.textLen-R;e<n.length&&(n=n.slice(-e)),R=t.textLen}de(n)}else if(t.type===`agent_retry`){let e=Number(t.delay??0),n=t.reason,r=a(String(n||`429`));d(s(e>0?`ws.retry`:`ws.retryNow`,{cli:a(t.cli||``),reason:r,delay:e}),`tool-activity`)}else if(t.type===`agent_fallback`)d(s(`ws.fallback`,{from:a(t.from||``),to:a(t.to||``)}),`tool-activity`);else if(t.type===`agent_smoke`)d(`${l.warning} ${a(t.cli||`agent`)}: smoke response detected — auto-continuing`,`tool-activity`);else if(t.type===`goal_done`)e.activeGoal=null,Lt(),d(`🎯 Goal completed${t.source===`ai_output`?` (detected from AI output)`:``}`,`tool-activity`);else if(t.type===`goal_cancel`)e.activeGoal=null,Lt(),d(`🎯 Goal cancelled`,`tool-activity`);else if(t.type===`schedule_wakeup`)d(`⏰ Wakeup scheduled in ${t.delaySeconds}s — ${a(String(t.reason||``))}`,`tool-activity`);else if(t.type===`goal_continuation_limit`)d(`⚠️ Goal continuation limit reached (${t.attempts} attempts)`,`tool-activity`);else if(t.type===`goal_continuation`)d(`🎯 Active goal — auto-continuing`,`tool-activity`);else if(t.type===`agent_done`){if(!(t.steered||f())){let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(ut(e)||e&&L&&e!==L)return;ht(e),ae(t.text||``,t.toolLog),it()}}else if(t.type===`orchestrate_done`)ht(null),ae(t.text||``),it();else if(t.type===`clear`){c(),le(),ne().clear();let e=document.getElementById(`chatMessages`);e&&(e.innerHTML=``),r(()=>import(`./idb-cache-DQM-odDV.js`).then(e=>e.clearCache()),[]).catch(()=>{})}else if(t.type===`session_reset`)d(`${l.refresh} Session reset — history preserved`,`tool-activity`);else if(t.type===`agent_added`||t.type===`agent_updated`||t.type===`agent_deleted`)r(()=>import(`./employees-CZSyvJbx.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0]));else if(t.type===`heartbeat_pending`){let e={pending:t.pending||0,deferredPending:t.deferredPending||0};t.reason!==void 0&&(e.reason=t.reason),t.policy!==void 0&&(e.policy=t.policy),t.jobId!==void 0&&(e.jobId=t.jobId),t.jobName!==void 0&&(e.jobName=t.jobName),At(e)}else if(t.type===`orc_state`)$t(t);else if(t.type===`memory_status`)r(()=>import(`./memory-BEruUlfu.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0]));else if(t.type===`steer_started`)fe(),ht(null),ae(``),u(`steering`);else if(t.type===`new_message`&&(t.source===`telegram`||t.source===`discord`||t.source===`bgtask`||t.fromQueue===!0)){let e=t.role===`assistant`?`agent`:t.role||`user`,n=t.content||``,i=t.cli;r(()=>import(`./message-history-tjkyOp_K.js`).then(t=>{if(t.historyReloadInFlight()){t.loadMessages().then(()=>t.loadMessages()).catch(e=>console.warn(`[ws] new_message reload after in-flight failed`,e));return}re(e,n,i)}),__vite__mapDeps([0]))}else t.type===`system_notice`?d(`ℹ️ ${a(t.text||``)}`,`tool-activity`):t.type===`replay_gap`?Wt():t.type===`worker_stalled`?d(`⚠️ Worker stalled: ${a(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`worker_disconnected`?d(`🔌 Worker disconnected: ${a(t.agentId||``)} (exit ${a(String(t.exitCode??`?`))})`,`tool-activity`):t.type===`worker_timeout`?d(`⏱️ Worker timed out: ${a(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`alert_escalation`?d(a(t.message||``),`tool-activity`):t.type===`schedule_wakeup_failed`?d(`⚠️ Wakeup failed — ${a(String(t.reason||``))}: ${a(t.error||``)}`,`tool-activity`):t.type===`goal_continuation_failed`?d(`⚠️ Goal continuation failed: ${a(t.error||``)}`,`tool-activity`):t.type===`settings_change`?Dt(t):(t.type===`session_switched`||t.type===`session_created`)&&window.location.reload()}function $t(e){let t=++Vt;Bt.then(()=>{t===Vt&&ot(e.scope,vt)&&(Rt(typeof e.state==`string`?e.state:`IDLE`,e.title),jt({taskAnchor:e.taskAnchor||null,resolvedSelection:e.resolvedSelection||null,interview:e.interview||null}),Ft(e.buildBudget||null,typeof e.state==`string`?e.state:`IDLE`))})}function en(e){return I[e]||null}var tn=`sidebarState`,Z=900,nn=768;function rn(){return window.innerWidth<=nn}function an(){document.body.classList.remove(`left-expanded`,`right-expanded`)}function on(e){let t=`${e}-expanded`,n=e===`left`?`right-expanded`:`left-expanded`,r=!document.body.classList.contains(t);document.body.classList.remove(n),document.body.classList.toggle(t,r)}function sn(){let e={};try{e=JSON.parse(localStorage.getItem(tn)||`{}`)}catch{}e.left&&document.body.classList.add(`left-collapsed`),e.right&&document.body.classList.add(`right-collapsed`);let t=rn();document.getElementById(`toggleLeft`)?.addEventListener(`click`,cn),document.getElementById(`toggleRight`)?.addEventListener(`click`,ln),window.addEventListener(`resize`,()=>{let e=rn();if(window.innerWidth>Z){an();let e={};try{e=JSON.parse(localStorage.getItem(tn)||`{}`)}catch{}document.body.classList.toggle(`left-collapsed`,!!e.left),document.body.classList.toggle(`right-collapsed`,!!e.right)}else document.body.classList.remove(`left-collapsed`,`right-collapsed`),e!==t&&an();t=e,$()}),window.innerWidth<=Z&&(document.body.classList.remove(`left-collapsed`,`right-collapsed`),rn()&&an()),$()}function Q(){return window.innerWidth<=Z}function cn(){Q()?on(`left`):document.body.classList.toggle(`left-collapsed`),fn(),$()}function ln(){Q()?on(`right`):document.body.classList.toggle(`right-collapsed`),dn()&&document.getElementById(`tabAgents`)?.classList.contains(`active`)&&r(()=>import(`./employees-CZSyvJbx.js`).then(e=>e.loadEmployees(!0)),__vite__mapDeps([0])),fn(),$()}function un(){return Q()?document.body.classList.contains(`left-expanded`):!document.body.classList.contains(`left-collapsed`)}function dn(){return Q()?document.body.classList.contains(`right-expanded`):!document.body.classList.contains(`right-collapsed`)}function $(){let e=document.getElementById(`toggleLeft`),t=document.getElementById(`toggleRight`);e&&(e.innerHTML=un()?l.chevronLeft:l.chevronRight),t&&(t.innerHTML=dn()?l.chevronRight:l.chevronLeft)}function fn(){localStorage.setItem(tn,JSON.stringify({left:document.body.classList.contains(`left-collapsed`),right:document.body.classList.contains(`right-collapsed`)}))}export{K as a,U as c,We as d,ln as i,at as l,dn as n,en as o,cn as r,Ht as s,sn as t,rt as u};
|
|
49
|
+
${r(`Verify`,e.spent.verificationRounds,e.maxVerificationRounds)}`}async function It(){try{let t=await fetch(`${n}/api/goal`);if(!t.ok)return;let r=await t.json();r.goal?e.activeGoal={id:r.goal.id,objective:r.goal.objective,status:r.goal.status,createdAt:r.goal.createdAt,updatedAt:r.goal.updatedAt,lastCheckpointSummary:r.goal.lastCheckpoint?.summary,nextAction:r.goal.lastCheckpoint?.nextAction}:e.activeGoal=null,Lt()}catch{}}function Lt(){let t=document.getElementById(`goalCockpit`);if(!t)return;let n=e.activeGoal;if(!n||n.status===`complete`||n.status===`cancelled`){t.hidden=!0,t.innerHTML=``;return}t.hidden=!1,t.replaceChildren();let r=n.status===`paused`?`paused`:n.status===`blocked`?`blocked`:`active`,i=document.createElement(`span`);i.className=`goal-objective`,i.title=n.objective,i.textContent=n.objective;let a=document.createElement(`span`);if(a.className=`goal-status goal-status--${r}`,a.textContent=n.status,t.append(i,a),n.nextAction){let e=document.createElement(`span`);e.className=`goal-next`,e.textContent=n.nextAction,t.append(e)}}function Rt(t,n){let r=new Set([`IDLE`,`I`,`P`,`A`,`B`,`C`,`D`]).has(t)?t:`IDLE`;if(e.orcState=r,r===`IDLE`||r===`D`)document.body.removeAttribute(`data-orc-state`),document.body.style.removeProperty(`--orc-glow`);else{document.body.setAttribute(`data-orc-state`,r);let e=`--orc-glow-${r}`,t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();document.body.style.setProperty(`--orc-glow`,t)}document.body.classList.add(`orc-pulse`),setTimeout(()=>document.body.classList.remove(`orc-pulse`),700);let i=document.getElementById(`orcStateBadge`);i&&(i.textContent={IDLE:``,I:`INTERVIEW`,P:`PLAN`,A:`AUDIT`,B:`BUILD`,C:`CHECK`,D:`DONE`}[r],i.style.display=r===`IDLE`?`none`:`inline-block`);let a=document.getElementById(`pabcRoadmap`),o=document.getElementById(`sharkRunner`),s=document.getElementById(`pabcBrand`);if(a&&o){if(!a.dataset.resizeObserved){a.dataset.resizeObserved=`1`,new ResizeObserver(()=>{F&&o.classList.contains(`running`)&&st(a,o,F)}).observe(a);let e=0;window.addEventListener(`resize`,()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{F&&o.classList.contains(`running`)&&st(a,o,F)})})}if(r===`IDLE`)a.classList.remove(`visible`,`shimmer-out`),o.classList.remove(`running`),F=null;else if(r===`D`){P.forEach(e=>{let t=document.getElementById(`dot-${e}`);t&&(t.className=`pabc-dot done`,t.setAttribute(`data-phase`,e))});for(let e=0;e<P.length;e++){let t=document.getElementById(`pabc-conn-${e}`);t&&(t.className=`pabc-connector done`)}o.classList.remove(`running`),F=null,a.classList.add(`shimmer-out`),setTimeout(()=>a.classList.remove(`visible`,`shimmer-out`),1e3)}else{a.classList.remove(`shimmer-out`),a.classList.add(`visible`),o.classList.add(`running`);let e=P.indexOf(r);P.forEach((t,n)=>{let r=document.getElementById(`dot-${t}`);r&&(r.className=`pabc-dot ${n<e?`done`:n===e?`active`:`future`}`,r.setAttribute(`data-phase`,t))});for(let t=0;t<P.length;t++){let n=document.getElementById(`pabc-conn-${t}`);n&&(n.className=`pabc-connector ${t<e?`done`:``}`)}F=r,requestAnimationFrame(()=>st(a,o,r))}s&&n&&(s.textContent=n)}}var zt=!1,Bt=Promise.resolve(),Vt=0;function K(){Ot(),zt||(zt=!0,Zt()),Yt(),b(i())}var Ht=K;function Ut(e){console.log(`[${e}] connected`),X=2e3,Kt();let t=Date.now()-V<1e4;Bt=r(()=>import(`./ui-Anw2S64o.js`).then(async n=>{if(n.cleanupToolActivity(),!t)try{await n.loadMessages(),V=Date.now()}catch(t){console.error(`[${e}] loadMessages failed`,t)}await U(`reconnect`,{hydrateRun:!0}).catch(()=>{}).finally(()=>n.reconcileChatBottomAfterRestore(`reconnect`)),r(()=>import(`./memory-BT-rs3ag.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])).catch(()=>{}),r(()=>import(`./bgtask-badge-DZEQ5fMl.js`).then(e=>e.refreshBgtaskBadge()),__vite__mapDeps([0])).catch(()=>{})}),void 0)}function Wt(){te(`replay_gap`),Bt=r(()=>import(`./ui-Anw2S64o.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.error(`[sse] replay gap loadMessages failed`,e)}await U(`replay_gap`,{hydrateRun:!0}).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`replay_gap`))}),__vite__mapDeps([0]))}var Gt=8e3,q=null;function Kt(){q!==null&&(window.clearTimeout(q),q=null)}function qt(){console.log(`[channel] disconnected`),r(()=>import(`./ui-Anw2S64o.js`).then(e=>e.cleanupToolActivity()),__vite__mapDeps([0])),q===null&&(q=window.setTimeout(()=>{q=null,u(`idle`),d(`${l.exec} ${s(`ws.disconnected`)}`,`tool-activity`)},Gt))}var J=null,Y=!1,X=2e3,Jt=3e4;function Yt(){if(J){Y=!0;try{J.close()}catch{}J=null}}function Xt(){if(J)return;console.warn(`[channel] /api/events unavailable — falling back to legacy WebSocket`);let e=`ws://${location.host}`,t=new WebSocket(`${e}${n}/?lang=${i()}`);J=t,Y=!1,t.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{console.warn(`[ws] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.type!=`string`){console.warn(`[ws] invalid message shape:`,t);return}Qt(t)};let r=!1;t.onopen=()=>{r=!0,X=2e3,Ut(`ws`)},t.onclose=()=>{if(J===t&&(J=null),Y){Y=!1;return}if(r){qt(),setTimeout(K,2e3);return}X=Math.min(X*2,Jt),setTimeout(K,X)}}function Zt(){je(`*`,null,e=>{Qt({...e,type:e.event})}),Oe(()=>Ut(`sse`)),ke(()=>qt()),Ae(()=>Xt())}function Qt(t){if(t.type===`agent_status`){if(!t.running&&f())return;t.running&&f()&&se(),t.running===void 0?u(t.status||`idle`):u(t.running?`running`:`idle`),t.agentId&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``},r(()=>import(`./employees-DbgFV33i.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])))}else if(t.type===`bgtask_update`)r(()=>import(`./bgtask-badge-DZEQ5fMl.js`).then(e=>e.applyBgtaskUpdate(t)),__vite__mapDeps([0])).catch(()=>{});else if(t.type===`queue_update`)ie(t.pending||0),Array.isArray(t.queued)&&w(t.queued),U(`queue_update`).catch(()=>{});else if(t.type===`agent_tool`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null,n=dt(t.traceSeq);if(ut(e)||mt(e,n,t.sseReplay===!0))return;t.isEmployee!==!0&>(e);let r=t.toolType===`thinking`?`thinking`:t.toolType===`search`?`search`:t.toolType===`subagent`?`subagent`:`tool`;oe({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,type:r,icon:t.icon||l.tool,rawIcon:t.rawIcon||t.icon||``,label:t.label||``,isEmployee:t.isEmployee===!0,detail:t.detail||``,stepRef:t.stepRef||``,traceRunId:t.traceRunId||``,traceSeq:t.traceSeq,detailAvailable:t.detailAvailable,detailBytes:t.detailBytes,rawRetentionStatus:t.rawRetentionStatus,status:t.status||`running`,startTime:typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:Date.now()},typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:void 0),ft(e,n)}else if(t.type===`agent_output`||t.type===`agent_chunk`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(ut(e))return;gt(e);let n=t.text||``;if(e&&typeof t.textLen==`number`){if(t.textLen<=R){t.sseReplay!==!0&&t.textLen<R&&(console.warn(`[ws] live agent_output behind applied cursor — resync (${t.textLen} < ${R})`),R=t.textLen);return}let e=t.textLen-R;e<n.length&&(n=n.slice(-e)),R=t.textLen}de(n)}else if(t.type===`agent_retry`){let e=Number(t.delay??0),n=t.reason,r=a(String(n||`429`));d(s(e>0?`ws.retry`:`ws.retryNow`,{cli:a(t.cli||``),reason:r,delay:e}),`tool-activity`)}else if(t.type===`agent_fallback`)d(s(`ws.fallback`,{from:a(t.from||``),to:a(t.to||``)}),`tool-activity`);else if(t.type===`agent_smoke`)d(`${l.warning} ${a(t.cli||`agent`)}: smoke response detected — auto-continuing`,`tool-activity`);else if(t.type===`goal_done`)e.activeGoal=null,Lt(),d(`🎯 Goal completed${t.source===`ai_output`?` (detected from AI output)`:``}`,`tool-activity`);else if(t.type===`goal_cancel`)e.activeGoal=null,Lt(),d(`🎯 Goal cancelled`,`tool-activity`);else if(t.type===`schedule_wakeup`)d(`⏰ Wakeup scheduled in ${t.delaySeconds}s — ${a(String(t.reason||``))}`,`tool-activity`);else if(t.type===`goal_continuation_limit`)d(`⚠️ Goal continuation limit reached (${t.attempts} attempts)`,`tool-activity`);else if(t.type===`goal_continuation`)d(`🎯 Active goal — auto-continuing`,`tool-activity`);else if(t.type===`agent_done`){if(!(t.steered||f())){let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(ut(e)||e&&L&&e!==L)return;ht(e),ae(t.text||``,t.toolLog),it()}}else if(t.type===`orchestrate_done`)ht(null),ae(t.text||``),it();else if(t.type===`clear`){c(),le(),ne().clear();let e=document.getElementById(`chatMessages`);e&&(e.innerHTML=``),r(()=>import(`./idb-cache-DQM-odDV.js`).then(e=>e.clearCache()),[]).catch(()=>{})}else if(t.type===`session_reset`)d(`${l.refresh} Session reset — history preserved`,`tool-activity`);else if(t.type===`agent_added`||t.type===`agent_updated`||t.type===`agent_deleted`)r(()=>import(`./employees-DbgFV33i.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0]));else if(t.type===`heartbeat_pending`){let e={pending:t.pending||0,deferredPending:t.deferredPending||0};t.reason!==void 0&&(e.reason=t.reason),t.policy!==void 0&&(e.policy=t.policy),t.jobId!==void 0&&(e.jobId=t.jobId),t.jobName!==void 0&&(e.jobName=t.jobName),At(e)}else if(t.type===`orc_state`)$t(t);else if(t.type===`memory_status`)r(()=>import(`./memory-BT-rs3ag.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0]));else if(t.type===`steer_started`)fe(),ht(null),ae(``),u(`steering`);else if(t.type===`new_message`&&(t.source===`telegram`||t.source===`discord`||t.source===`bgtask`||t.fromQueue===!0)){let e=t.role===`assistant`?`agent`:t.role||`user`,n=t.content||``,i=t.cli;r(()=>import(`./message-history-BY1UNJAO.js`).then(t=>{if(t.historyReloadInFlight()){t.loadMessages().then(()=>t.loadMessages()).catch(e=>console.warn(`[ws] new_message reload after in-flight failed`,e));return}re(e,n,i)}),__vite__mapDeps([0]))}else t.type===`system_notice`?d(`ℹ️ ${a(t.text||``)}`,`tool-activity`):t.type===`replay_gap`?Wt():t.type===`worker_stalled`?d(`⚠️ Worker stalled: ${a(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`worker_disconnected`?d(`🔌 Worker disconnected: ${a(t.agentId||``)} (exit ${a(String(t.exitCode??`?`))})`,`tool-activity`):t.type===`worker_timeout`?d(`⏱️ Worker timed out: ${a(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`alert_escalation`?d(a(t.message||``),`tool-activity`):t.type===`schedule_wakeup_failed`?d(`⚠️ Wakeup failed — ${a(String(t.reason||``))}: ${a(t.error||``)}`,`tool-activity`):t.type===`goal_continuation_failed`?d(`⚠️ Goal continuation failed: ${a(t.error||``)}`,`tool-activity`):t.type===`settings_change`?Dt(t):(t.type===`session_switched`||t.type===`session_created`)&&window.location.reload()}function $t(e){let t=++Vt;Bt.then(()=>{t===Vt&&ot(e.scope,vt)&&(Rt(typeof e.state==`string`?e.state:`IDLE`,e.title),jt({taskAnchor:e.taskAnchor||null,resolvedSelection:e.resolvedSelection||null,interview:e.interview||null}),Ft(e.buildBudget||null,typeof e.state==`string`?e.state:`IDLE`))})}function en(e){return I[e]||null}var tn=`sidebarState`,Z=900,nn=768;function rn(){return window.innerWidth<=nn}function an(){document.body.classList.remove(`left-expanded`,`right-expanded`)}function on(e){let t=`${e}-expanded`,n=e===`left`?`right-expanded`:`left-expanded`,r=!document.body.classList.contains(t);document.body.classList.remove(n),document.body.classList.toggle(t,r)}function sn(){let e={};try{e=JSON.parse(localStorage.getItem(tn)||`{}`)}catch{}e.left&&document.body.classList.add(`left-collapsed`),e.right&&document.body.classList.add(`right-collapsed`);let t=rn();document.getElementById(`toggleLeft`)?.addEventListener(`click`,cn),document.getElementById(`toggleRight`)?.addEventListener(`click`,ln),window.addEventListener(`resize`,()=>{let e=rn();if(window.innerWidth>Z){an();let e={};try{e=JSON.parse(localStorage.getItem(tn)||`{}`)}catch{}document.body.classList.toggle(`left-collapsed`,!!e.left),document.body.classList.toggle(`right-collapsed`,!!e.right)}else document.body.classList.remove(`left-collapsed`,`right-collapsed`),e!==t&&an();t=e,$()}),window.innerWidth<=Z&&(document.body.classList.remove(`left-collapsed`,`right-collapsed`),rn()&&an()),$()}function Q(){return window.innerWidth<=Z}function cn(){Q()?on(`left`):document.body.classList.toggle(`left-collapsed`),fn(),$()}function ln(){Q()?on(`right`):document.body.classList.toggle(`right-collapsed`),dn()&&document.getElementById(`tabAgents`)?.classList.contains(`active`)&&r(()=>import(`./employees-DbgFV33i.js`).then(e=>e.loadEmployees(!0)),__vite__mapDeps([0])),fn(),$()}function un(){return Q()?document.body.classList.contains(`left-expanded`):!document.body.classList.contains(`left-collapsed`)}function dn(){return Q()?document.body.classList.contains(`right-expanded`):!document.body.classList.contains(`right-collapsed`)}function $(){let e=document.getElementById(`toggleLeft`),t=document.getElementById(`toggleRight`);e&&(e.innerHTML=un()?l.chevronLeft:l.chevronRight),t&&(t.innerHTML=dn()?l.chevronRight:l.chevronLeft)}function fn(){localStorage.setItem(tn,JSON.stringify({left:document.body.classList.contains(`left-collapsed`),right:document.body.classList.contains(`right-collapsed`)}))}export{K as a,U as c,We as d,ln as i,at as l,dn as n,en as o,cn as r,Ht as s,sn as t,rt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./state-DxpgDKMO.js";import{i as t}from"./api-tVoG39dL.js";import{D as n,T as r,j as i,w as a,x as o}from"./render-
|
|
1
|
+
import{t as e}from"./state-DxpgDKMO.js";import{i as t}from"./api-tVoG39dL.js";import{D as n,T as r,j as i,w as a,x as o}from"./render-C3r-9_-J.js";var s=[`productivity`,`communication`,`devtools`,`ai-media`,`utility`,`smarthome`,`automation`];function c(e,t){return t?[e.id,e.name,e.description,e.category,e.requires?.env?.join(` `),e.requires?.bins?.join(` `),e.install].filter(Boolean).join(` `).toLowerCase().includes(t):!0}async function l(){try{e.allSkills=await(await n(`/api/skills`)).json(),u()}catch{let e=document.getElementById(`skillsList`);e&&(e.innerHTML=`<div style="color:var(--text-dim);font-size:11px">${i(`skill.loadFail`)}</div>`)}}function u(){let t=document.getElementById(`skillsList`),n=document.getElementById(`skillsCount`);if(!t||!n)return;let l=e.allSkills,u=l;e.currentSkillFilter===`installed`?u=l.filter(e=>e.enabled):e.currentSkillFilter===`other`?u=l.filter(e=>!s.includes(e.category||``)):e.currentSkillFilter!==`all`&&(u=l.filter(t=>t.category===e.currentSkillFilter));let d=e.currentSkillSearch.trim().toLowerCase();u=u.filter(e=>c(e,d));let f=l.filter(e=>e.enabled).length;if(n.textContent=d?i(`skill.countFiltered`,{shown:u.length,active:f,total:l.length}):i(`skill.count`,{active:f,total:l.length}),!u.length){t.innerHTML=`<div class="skill-empty">${r(i(`skill.search.empty`))}</div>`;return}t.innerHTML=u.map(e=>{let t=[];return e.requires?.env&&t.push(`${o.key} `+e.requires.env.map(e=>r(e)).join(`, `)),e.requires?.bins&&t.push(`${o.settings} `+e.requires.bins.map(e=>r(e)).join(`, `)),e.install&&t.push(r(e.install)),`
|
|
2
2
|
<div class="skill-card ${e.enabled?`enabled`:``}">
|
|
3
3
|
<div class="skill-card-header">
|
|
4
4
|
<span class="skill-emoji">${e.emoji?a(e.emoji):o.tool}</span>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./skills-CdNOfXlk.js";export{e as loadSkills};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./api-tVoG39dL.js";import{T as t,j as n}from"./render-
|
|
1
|
+
import{n as e}from"./api-tVoG39dL.js";import{T as t,j as n}from"./render-C3r-9_-J.js";import{t as r}from"./locale-GY3-GGWm.js";var i={activeCli:o(`activeCli`,2,1,2,2,1,3),model:o(`model`,2,1,1,2,1,2),effort:o(`effort`,2,1,1),permissions:o(`permissions`,2,1,1),flushAgent:o(`flushAgent`,2,1,1,2,1,3),employees:o(`employees`,3,3,2,4,1,2),skills:o(`skills`,2,1,1,4,1,3),activeChannel:o(`activeChannel`,2,1,1),telegram:{...o(`telegram`,2,1,2,8),docLinks:[{url:`https://t.me/BotFather`,labelKey:`help.telegram.link.botfather`},{url:`https://core.telegram.org/bots/tutorial`,labelKey:`help.telegram.link.docs`}]},discord:{...o(`discord`,2,1,2,9),docLinks:[{url:`https://discord.com/developers/applications`,labelKey:`help.discord.link.portal`},{url:`https://discord.com/developers/docs/getting-started`,labelKey:`help.discord.link.docs`}]},fallbackOrder:o(`fallbackOrder`,2,1,1,2,1,3),mcp:o(`mcp`,2,1,1,4,1,5),memory:o(`memory`,2,1,2,4,1,2),stt:o(`stt`,2,1,1),promptTemplates:o(`promptTemplates`,2,1,1),chatInput:o(`chatInput`,3,2,2),orchestration:o(`orchestration`,3,2,2,8,1,8),attachments:o(`attachments`,3,2,2),diagrams:o(`diagrams`,3,2,2),keyboardShortcuts:o(`keyboardShortcuts`,3,2,2,3,2,3),session:o(`session`,3,1,2,8,1,9),cliTools:o(`cliTools`,3,1,2,6,1,9),agentControl:o(`agentControl`,3,1,2,6,1,6),goals:o(`goals`,3,1,2,10,1,25)};function a(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(i,e)}function o(e,t,n,r,i=2,a=1,o=0){return{titleKey:`help.${e}.title`,introKey:`help.${e}.intro`,effectKey:`help.${e}.effect`,useWhenKeys:s(`help.${e}.use`,t),howToKeys:s(`help.${e}.howTo`,i),exampleKeys:s(`help.${e}.example`,a),avoidWhenKeys:s(`help.${e}.avoid`,n),relatedKeys:s(`help.${e}.related`,r),...o>0?{subcmdKeys:s(`help.${e}.subcmd`,o)}:{}}}function s(e,t){return Array.from({length:t},(t,n)=>`${e}.${n+1}`)}var c=!1,l=null,u=null,d=null,f=null,p=null,m=!1;function h(){c||(c=!0,document.addEventListener(`click`,v),document.addEventListener(`keydown`,y,!0))}function g(e,t=null,n=[e]){if(!i[e]){console.warn(`[help-dialog] unknown topic:`,e);return}b(),p=t,x(e,T(n,e)),l?.classList.add(`open`),l?.setAttribute(`aria-hidden`,`false`),m=!0,requestAnimationFrame(()=>f?.focus())}function _(){if(!m)return;l?.classList.remove(`open`),l?.setAttribute(`aria-hidden`,`true`),m=!1;let e=p;p=null,e?.focus()}function v(e){let t=e.target?.closest(`[data-help-topic]`);if(!t)return;let n=t.getAttribute(`data-help-topic`);if(!a(n)){console.warn(`[help-dialog] invalid topic:`,n);return}e.preventDefault(),g(n,t,w(t.getAttribute(`data-help-topics`),n))}function y(e){!m||e.key!==`Escape`||(e.preventDefault(),e.stopImmediatePropagation(),_())}function b(){if(l&&u&&d&&f)return;l=document.createElement(`div`),l.id=`helpDialog`,l.className=`modal-overlay help-dialog-overlay`,l.setAttribute(`role`,`presentation`),l.setAttribute(`aria-hidden`,`true`),l.addEventListener(`click`,e=>{e.target===l&&_()});let e=document.createElement(`div`);e.className=`modal-box help-dialog-box`,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`aria-labelledby`,`helpDialogTitle`),e.addEventListener(`click`,e=>e.stopPropagation());let t=document.createElement(`div`);t.className=`modal-header help-dialog-header`,u=document.createElement(`span`),u.id=`helpDialogTitle`,f=document.createElement(`button`),f.type=`button`,f.className=`btn-modal-close help-dialog-close`,f.setAttribute(`aria-label`,n(`help.close`)),f.textContent=`x`,f.addEventListener(`click`,()=>_()),d=document.createElement(`div`),d.className=`help-dialog-body`;let r=document.createElement(`div`);r.className=`modal-footer help-dialog-footer`;let i=document.createElement(`button`);i.type=`button`,i.className=`btn-save help-dialog-done`,i.textContent=n(`help.close`),i.addEventListener(`click`,()=>_()),t.append(u,f),r.append(i),e.append(t,d,r),l.append(e),document.body.append(l)}function x(e,t=[e]){if(!u||!d||!f)return;let r=i[e];u.textContent=n(r.titleKey),f.setAttribute(`aria-label`,n(`help.close`)),d.replaceChildren();let a=document.createElement(`div`);if(a.className=`help-dialog-content`,S(a,r),t.length<=1){d.append(a);return}let o=document.createElement(`div`);o.className=`help-dialog-layout`,o.append(C(t,e),a),d.append(o)}function S(e,t){t.docLinks?.length&&E(e,t.docLinks),D(e,n(`help.section.what`),n(t.introKey)),D(e,n(`help.section.effect`),n(t.effectKey),`help-effect-text`),O(e,n(`help.section.useWhen`),t.useWhenKeys),A(e,n(`help.section.howTo`),t.howToKeys),O(e,n(`help.section.example`),t.exampleKeys,!1,`help-example-list`),t.avoidWhenKeys?.length&&O(e,n(`help.section.avoidWhen`),t.avoidWhenKeys),t.subcmdKeys?.length&&j(e,n(`help.section.commands`),t.subcmdKeys),t.relatedKeys?.length&&O(e,n(`help.section.related`),t.relatedKeys,!0)}function C(e,t){let r=document.createElement(`nav`);r.className=`help-dialog-nav`,r.setAttribute(`aria-label`,n(`help.section.related`));for(let a of e){let o=i[a],s=document.createElement(`button`);s.type=`button`,s.className=`help-dialog-nav-item`,s.textContent=n(o.titleKey),a===t&&(s.classList.add(`active`),s.setAttribute(`aria-current`,`page`)),s.addEventListener(`click`,()=>x(a,e)),r.append(s)}return r}function w(e,t){return T(e?.split(/[\s,]+/).filter(Boolean)??[],t)}function T(e,t){let n=[];for(let t of e)a(t)&&!n.includes(t)&&n.push(t);return n.includes(t)||n.unshift(t),n}function E(e,t){let r=document.createElement(`section`);r.className=`help-dialog-section help-doc-links`;let i=document.createElement(`nav`);i.className=`help-doc-links-nav`;for(let e of t){let t=document.createElement(`a`);t.href=e.url,t.target=`_blank`,t.rel=`noopener noreferrer`,t.className=`help-doc-link`,t.textContent=n(e.labelKey);let r=document.createElement(`span`);r.className=`help-doc-link-icon`,r.textContent=`↗`,t.append(r),i.append(t)}r.append(i),e.append(r)}function D(e,t,n,r){let i=k(t),a=document.createElement(`p`);r&&(a.className=r),a.textContent=n,i.append(a),e.append(i)}function O(e,t,r,i=!1,a){let o=k(t),s=document.createElement(`ul`);s.className=a??(i?`help-related-list`:`help-dialog-list`);for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),s.append(t)}o.append(s),e.append(o)}function k(e){let t=document.createElement(`section`);t.className=`help-dialog-section`;let n=document.createElement(`h3`);return n.textContent=e,t.append(n),t}function A(e,t,r){let i=k(t),a=document.createElement(`ol`);a.className=`help-dialog-list help-howto-list`;for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),a.append(t)}i.append(a),e.append(i)}function j(e,t,r){let i=k(t),a=document.createElement(`dl`);a.className=`help-subcmd-list`;for(let e of r){let t=n(e),r=t.indexOf(` — `),i=r>=0?t.slice(0,r):t,o=r>=0?t.slice(r+3):``,s=document.createElement(`dt`);s.className=`help-subcmd-cmd`;let c=document.createElement(`code`);c.textContent=i,s.append(c);let l=document.createElement(`dd`);l.className=`help-subcmd-desc`,l.textContent=o,a.append(s,l)}i.append(a),e.append(i)}var M={mcp:`mcp`,memory:`memory`,model:`model`,effort:`effort`,cli:`activeCli`,skill:`skills`,employee:`employees`,orchestrate:`orchestration`,pabcd:`orchestration`,flush:`flushAgent`,fallback:`fallbackOrder`,prompt:`promptTemplates`,browser:`mcp`,status:`activeCli`,steer:`chatInput`,clear:`session`,compact:`session`,reset:`session`,purge:`session`,new:`session`,switch:`session`,sw:`session`,sessions:`session`,ss:`session`,version:`cliTools`,project:`cliTools`,proj:`cliTools`,ide:`cliTools`,file:`cliTools`,forward:`agentControl`,thought:`agentControl`,goal:`goals`,goalplan:`goals`,gd:`goals`,plan:`goals`,interview:`goals`,deliberate:`goals`,planaudit:`goals`,review:`goals`,search:`mcp`,team:`goals`,task:`goals`,help:`keyboardShortcuts`,h:`keyboardShortcuts`,commands:`keyboardShortcuts`,cmd:`keyboardShortcuts`,fork:`session`,quit:`session`,q:`session`,exit:`session`,telegram:`telegram`,discord:`discord`,stt:`stt`,attachments:`attachments`,diagrams:`diagrams`};function N(e){let t=e.replace(/^\//,``).trim().split(/\s+/);if(t.length<2||t[t.length-1].toLowerCase()!==`info`)return!1;let n=M[t[0].toLowerCase()];return n?(g(n),!0):!1}var P=[],F=[],I=-1,L=!1,R=null;function z(e){let t=String(e||``).slice(1).trim().split(/\s+/)[0]||``;return t.includes(`/`)||t.includes(`\\`)}var B=()=>document.getElementById(`cmdDropdown`),V=()=>document.getElementById(`chatInput`);function H(e){let t=String(e||``).toLowerCase();return P.filter(e=>`/${e.name}`.startsWith(t))}function U(e){let t=e.workflow?.workflowArgs||[];return t.length?t.map(e=>e.required?`<${e.name}>`:`[${e.name}]`).join(` `):e.args||``}function W(e){let n=e.workflow;return n?`<span class="cmd-meta">
|
|
2
2
|
<span class="cmd-chip">${t(n.phase)}</span>
|
|
3
3
|
<span class="cmd-chip cmd-risk-${t(n.risk)}">${t(n.risk)}</span>
|
|
4
4
|
<span class="cmd-chip">${t(n.output)}</span>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./slash-commands-4Ntm5N7h.js";export{e as loadCommands};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./api-tVoG39dL.js";import{T as t}from"./render-
|
|
1
|
+
import{n as e}from"./api-tVoG39dL.js";import{T as t}from"./render-C3r-9_-J.js";import{r as n}from"./provider-icons-BXm8sy5x.js";var r=80,i=``,a=0,o=0,s=!1,c=0,l=null;function u(e){return e.eventType||e.event_type||`event`}function d(e,t=i){return e===c&&t===i}function f(e){return!e||!Number.isInteger(e)||e<1?0:Math.floor((e-1)/r)*r}function p(){let e=document.getElementById(`traceDrawerOverlay`);return e||(e=document.createElement(`div`),e.id=`traceDrawerOverlay`,e.className=`trace-drawer-overlay`,e.innerHTML=`<aside class="trace-drawer" role="dialog" aria-modal="true" aria-labelledby="traceDrawerTitle">
|
|
2
2
|
<header class="trace-drawer-header">
|
|
3
3
|
<div><p class="trace-drawer-kicker">Raw trace</p><h2 id="traceDrawerTitle">Trace</h2></div>
|
|
4
4
|
<button class="trace-drawer-close" type="button" aria-label="Close trace drawer">×</button>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,d as t,o as n}from"./message-history-BmP5JKio.js";import{r}from"./ui-DsK6r0Xv.js";export{r as cleanupToolActivity,n as loadMessages,e as reconcileChatBottomAfterRestore,t as updateQueueBadge};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./state-DxpgDKMO.js";import{t}from"./preload-helper-DFYRRz9w.js";import{E as n,S as r,t as i,v as a,w as o}from"./render-C3r-9_-J.js";import{B as s,C as c,D as l,E as u,G as d,H as f,I as p,J as m,K as h,O as g,R as _,S as v,U as y,V as ee,W as b,X as te,_ as x,b as S,f as C,g as w,h as ne,l as re,m as T,p as ie,q as E,u as D,v as ae,w as O,x as k,y as A,z as j}from"./message-history-BmP5JKio.js";import{o as oe}from"./idb-cache-DTKWSF12.js";var se=2e3,ce=80;function M(e){return{chunks:[],fullText:``,textDirty:!1,element:e,pendingRAF:null,isFinalized:!1,lastRenderTime:0}}function le(e,t=``){let n=M(e);return t?(n.chunks=[t],n.fullText=t,n.textDirty=!1,n.element.innerHTML=i(t,!0)+`<span class="stream-cursor" aria-hidden="true"></span>`):n.element.innerHTML=`<span class="stream-cursor" aria-hidden="true"></span>`,n}function N(e){return e.textDirty&&=(e.fullText=e.chunks.join(``),!1),e.fullText}function P(e,t){e.chunks.push(t),e.textDirty=!0,!e.pendingRAF&&!e.isFinalized&&(e.pendingRAF=requestAnimationFrame(()=>{if(e.pendingRAF=null,e.isFinalized)return;let t=performance.now(),n=N(e);n.length<se||t-e.lastRenderTime>ce?(e.element.innerHTML=i(n,!0)+`<span class="stream-cursor" aria-hidden="true"></span>`,e.lastRenderTime=t):e.pendingRAF=requestAnimationFrame(()=>{e.pendingRAF=null,!e.isFinalized&&(e.element.innerHTML=i(N(e),!0)+`<span class="stream-cursor" aria-hidden="true"></span>`,e.lastRenderTime=performance.now())})}))}function F(e,t=!1){e.isFinalized=!0,e.pendingRAF&&=(cancelAnimationFrame(e.pendingRAF),null);let n=N(e);return t||(e.element.innerHTML=i(n)),n}function I(e){return typeof e.traceSeq==`number`&&Number.isFinite(e.traceSeq)&&e.traceSeq>0}function L(e,t){return!!t.traceRunId&&!!e.traceRunId&&t.traceRunId===e.traceRunId&&I(t)&&I(e)&&t.traceSeq===e.traceSeq&&t.type===e.type&&t.label===e.label&&!!t.isEmployee==!!e.isEmployee}function R(e,t){return t.stepRef&&e.stepRef===t.stepRef?!0:L(e,t)}function z(e,t,n={}){return[...e].reverse().filter(e=>n.includeDone||e.status===`running`).find(e=>R(e,t))??null}function B(e,t){let n=e.filter(e=>e.status===`running`&&!e.stepRef&&e.label===t.label&&e.type===t.type&&!!e.isEmployee==!!t.isEmployee);return n.length===1?n[0]:null}function V(e,t){let n=[...e].reverse().filter(e=>e.status===`running`);return z(n,t)||B(n,t)}function H(){e.currentProcessBlock&&d(e.currentProcessBlock),e.currentAgentDiv instanceof HTMLElement&&d(e.currentAgentDiv),l(),m(),e.currentAgentDiv=null,e.currentProcessBlock=null,q=null}var U=0;function W(){U=Date.now()}function ue(){U=0}function de(){return Date.now()-U<8e3}function G(e){for(let t of document.querySelectorAll(`.msg-user`))if(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)return!0;return!1}function K(){let t=e.currentAgentDiv&&e.currentAgentDiv.isConnected?e.currentAgentDiv:null;return t?G(t)?(e.currentAgentDiv=null,e.currentProcessBlock=null,q=null,null):t:null}function fe(){let e=Array.from(document.querySelectorAll(`.msg-agent`)).at(-1)??null;return!e||G(e)?null:e}function pe(t,n){A();let i=K();if(i||(i=x(`agent`,``),e.currentAgentDiv=i,e.currentProcessBlock=null),v(i),!e.currentProcessBlock){let t=i.querySelector(`.agent-body`);t&&(e.currentProcessBlock=S(i)),!e.currentProcessBlock&&t&&(c(i),e.currentProcessBlock=f(t))}if(n&&e.currentProcessBlock&&!e.currentProcessBlock.startedAt&&(e.currentProcessBlock.startedAt=n),e.currentProcessBlock){let n=t.rawIcon||t.icon,i=t.status||r(t.icon)||`running`;if(i===`done`||i===`error`){let r=V(e.currentProcessBlock.steps,t);if(r){t.icon=o(t.icon);let a=t.type===`thinking`?E(r.id,t.detail):b(r.id,t.detail);h(e.currentProcessBlock,r.id,{...r,...t,id:r.id,rawIcon:n,detail:a,detailPreview:a,label:t.label||r.label,status:i,startTime:r.startTime}),p();return}if(t.stepRef&&(i===`done`||i===`error`)){let r=[...e.currentProcessBlock.steps].reverse().find(e=>e.stepRef===t.stepRef&&(e.status===`done`||e.status===`error`));if(r){t.icon=o(t.icon);let a=t.type===`thinking`?E(r.id,t.detail):b(r.id,t.detail);h(e.currentProcessBlock,r.id,{...r,...t,id:r.id,rawIcon:n,status:i,detail:a,detailPreview:a,startTime:r.startTime}),p();return}}}if(t.stepRef&&i===`running`){let r=[...e.currentProcessBlock.steps].reverse().find(e=>e.stepRef===t.stepRef&&e.status===`running`);if(r){t.rawIcon=n,t.icon=o(t.icon);let i=E(r.id,t.detail);h(e.currentProcessBlock,r.id,{...r,...t,id:r.id,rawIcon:n,status:`running`,detail:i,detailPreview:i,label:t.label||r.label,startTime:r.startTime}),p();return}}let a=z(e.currentProcessBlock.steps,t,{includeDone:!0});if(a){t.rawIcon=n,t.icon=o(t.icon);let r=t.detail||``,s=y(a.id)||a.detail||a.detailPreview||``,c=r.length>=s.length?r:s,l=E(a.id,c),u=(a.status===`done`||a.status===`error`)&&i===`running`?a.status:i;h(e.currentProcessBlock,a.id,{...a,...t,id:a.id,rawIcon:n,status:u,detail:l,detailPreview:l,label:t.label||a.label,startTime:a.startTime}),p();return}if(t.detail){let n=[...e.currentProcessBlock.steps].reverse().find(e=>e.status===`running`&&e.label===t.label&&e.type===t.type&&!!e.isEmployee==!!t.isEmployee&&!e.detail);if(n){h(e.currentProcessBlock,n.id,t),p();return}}t.rawIcon=n,t.icon=o(t.icon),j(e.currentProcessBlock,t)}p()}var q=null,J=`data-active-run-hydrated`;function Y(e){document.querySelectorAll(`[${J}="true"]`).forEach(t=>{e&&t===e||t.remove()})}function me(e){let t=K()??fe();Y(t);let n=t||x(`agent`,``,e||null);return n.setAttribute(J,`true`),n}function he(e,t){let n=y(e.id)||e.detail||e.detailPreview||``,r=t.detail||t.detailPreview||``;return r.length>=n.length?r:n}function X(e){return e.stepRef?!0:!!e.traceRunId&&typeof e.traceSeq==`number`&&Number.isFinite(e.traceSeq)&&e.traceSeq>0}function ge(e,t){let n=e.steps.filter(e=>!X(e)),r=0,i=!0;for(let a of t){let t=e.steps.find(e=>R(e,a))??null;if(!t&&!X(a)&&i){let e=n[r]??null;e?e.type===a.type&&!!e.isEmployee==!!a.isEmployee?(t=e,r++):i=!1:r++}if(!t){let n=e.steps.filter(e=>e.label===a.label&&e.type===a.type&&!!e.isEmployee==!!a.isEmployee);t=n.length===1?n[0]:null}if(!t){if(j(e,a),!X(a)&&i){let t=e.steps[e.steps.length-1];t&&n.push(t)}continue}let o=E(t.id,he(t,a));h(e,t.id,{...t,...a,id:t.id,detail:o,detailPreview:o,label:a.label||t.label})}}function _e(e=[]){document.querySelectorAll(`[data-queued-overlay="true"]`).forEach(e=>e.remove())}var Z=``;function ve(e){let t=Array.isArray(e.toolLog)?e.toolLog:[],n=t.map(e=>`${e.stepRef||``}~${e.traceRunId||``}~${e.traceSeq??``}~${e.status||``}~${e.label||``}~${(e.detail||``).length}`).join(`|`);return`${e.traceRunId||``}:${e.cli||``}:${(e.text||``).length}:${t.length}:${n}`}function Q(t){if(!t?.running){Z=``,Y();return}let n=ve(t);if(n===Z&&K())return;l(),A(),e.currentAgentDiv=me(t.cli||null);let r=e.currentAgentDiv.querySelector(`.agent-body`),i=T(t.toolLog||[]);v(e.currentAgentDiv),e.currentProcessBlock=S(e.currentAgentDiv),r&&i.length?(e.currentProcessBlock||=(c(e.currentAgentDiv),f(r)),t.startedAt&&(e.currentProcessBlock.startedAt=t.startedAt),ge(e.currentProcessBlock,w(i,t.startedAt))):e.currentProcessBlock=S(e.currentAgentDiv);let a=e.currentAgentDiv.querySelector(`.msg-content`);a&&(q=le(a,t.text||``)),Z=n}function ye(t){if(!t)return;A(),K()||(e.currentAgentDiv=x(`agent`,``),q=null);let n=e.currentAgentDiv?.querySelector(`.msg-content`);n&&(q||=M(n),P(q,t)),p()}var $=0;function be(e){e.querySelectorAll(`.mermaid-pending`).forEach(e=>{delete e.dataset.mermaidQueued,delete e.dataset.mermaidQueuedAt})}function xe(t,r){let o=Date.now();if(!e.currentAgentDiv&&o-$<500)return;Z=``,l(),A(),e.currentAgentDiv&&v(e.currentAgentDiv);let c=O(e.currentProcessBlock??e.currentAgentDiv,!0),u=T(ie(Array.isArray(r)?r:[],c)),f=ne(u),p=!!e.currentProcessBlock||!!(e.currentAgentDiv&&k(e.currentAgentDiv));e.currentProcessBlock&&=(ee(e.currentProcessBlock),null);let m=u.length>0;if(t||m){(!e.currentAgentDiv||!e.currentAgentDiv.isConnected)&&(e.currentAgentDiv=x(`agent`,``)),e.currentAgentDiv.removeAttribute(J);let r=e.currentAgentDiv?.querySelector(`.msg-content`),o=q?F(q,!0):``,c=t||o;if(q=null,r&&(r.innerHTML=i(c)),m&&e.currentAgentDiv&&!p&&!k(e.currentAgentDiv)){let t=e.currentAgentDiv.querySelector(`.msg-content`);t&&t.insertAdjacentHTML(`beforebegin`,s(w(u),!0))}e.currentAgentDiv&&v(e.currentAgentDiv),r&&r.setAttribute(`data-raw`,n(c)),r&&g(r);let l=_(),h=!!(l.active&&e.currentAgentDiv&&e.currentAgentDiv.isConnected);if(r&&!h&&a(r,{immediate:!0}),h){let t=e.currentAgentDiv;be(t),t.querySelectorAll(`.diagram-widget`).forEach(e=>{let t=e.dataset.widgetHtml;if(!t)return;let n=document.createElement(`div`);n.className=`diagram-widget-pending`,n.dataset.diagramHtml=t,e.replaceWith(n)}),f?(l.appendItem(C({role:`assistant`,content:c,cli:null,tool_log:f},l.count)),d(t),l.scrollToBottom()):(t.dataset.turnIndex=String(l.count),t.dataset.messageId||(t.dataset.messageId=te()),l.appendLiveItem(t)),t.remove()}c&&oe({role:`assistant`,content:c,tool_log:f,timestamp:Date.now()}).catch(()=>{})}q=null,e.currentAgentDiv=null,$=Date.now(),D(`idle`),re()}function Se(e,n){document.querySelectorAll(`.tab-btn`).forEach(e=>{e.classList.remove(`active`),e.setAttribute(`aria-selected`,`false`)}),document.querySelectorAll(`.tab-content`).forEach(e=>e.classList.remove(`active`)),document.getElementById({agents:`tabAgents`,settings:`tabSettings`,skills:`tabSkills`}[e])?.classList.add(`active`),n&&(n.classList.add(`active`),n.setAttribute(`aria-selected`,`true`)),e===`settings`&&t(()=>import(`./settings-CJm8ZSJs.js`).then(e=>e.loadSettings()),__vite__mapDeps([0])),e===`agents`&&t(()=>import(`./employees-DbgFV33i.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])),e===`skills`&&t(()=>import(`./skills-DG_CbTEf.js`).then(e=>e.loadSkills()),__vite__mapDeps([0]))}function Ce(){let e=document.getElementById(`tabSettings`)?.classList.contains(`active`);t(()=>import(`./settings-CJm8ZSJs.js`).then(t=>e?t.savePerCli():t.updateSettings()),__vite__mapDeps([0]))}function we(){u({onStatus:ae})}export{xe as a,we as c,pe as d,Se as f,ue as i,de as l,_e as n,Ce as o,H as r,Q as s,ye as t,W as u};
|
package/public/dist/index.html
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap"
|
|
32
32
|
rel="stylesheet">
|
|
33
33
|
<!-- Vite handles module bundling in dev (HMR) and production (build) -->
|
|
34
|
-
<script type="module" crossorigin src="/dist/assets/app-
|
|
34
|
+
<script type="module" crossorigin src="/dist/assets/app-DszWzakT.js"></script>
|
|
35
35
|
<link rel="stylesheet" crossorigin href="/dist/assets/vendor-render-Bjnw0wQ6.css">
|
|
36
36
|
<link rel="stylesheet" crossorigin href="/dist/assets/app-BPsa7jSJ.css">
|
|
37
37
|
</head>
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<link rel="icon" type="image/png" href="/dist/assets/icon-192-CwXPIYF5.png">
|
|
7
7
|
<title>Jaw Manager</title>
|
|
8
8
|
<script src="/manager/theme-boot.js"></script>
|
|
9
|
-
<script type="module" crossorigin src="/dist/assets/manager-
|
|
9
|
+
<script type="module" crossorigin src="/dist/assets/manager-CdNOlCyS.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/dist/assets/vendor-render-Bjnw0wQ6.css">
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/dist/assets/manager-
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/dist/assets/manager-rHNwUB4e.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="manager-root"></div>
|
package/public/js/constants.ts
CHANGED
|
@@ -29,14 +29,14 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
29
29
|
efforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
30
30
|
models: [
|
|
31
31
|
'opus', 'sonnet', 'haiku',
|
|
32
|
-
'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini',
|
|
32
|
+
'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.3-codex-spark',
|
|
33
33
|
'gemini-3-flash-preview',
|
|
34
34
|
'grok-build', 'grok-composer-2.5-fast',
|
|
35
35
|
'gpt-5-mini',
|
|
36
36
|
],
|
|
37
37
|
modelsByProvider: {
|
|
38
38
|
claude: ['claude-fable-5', 'claude-opus-4-8', 'opus', 'sonnet', 'haiku'],
|
|
39
|
-
codex: ['gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini'],
|
|
39
|
+
codex: ['gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.3-codex-spark'],
|
|
40
40
|
gemini: ['gemini-3-flash-preview'],
|
|
41
41
|
grok: ['grok-build', 'grok-composer-2.5-fast'],
|
|
42
42
|
copilot: ['gpt-5-mini'],
|
|
@@ -48,7 +48,7 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
48
48
|
gemini: [],
|
|
49
49
|
grok: [],
|
|
50
50
|
copilot: ['low', 'medium', 'high'],
|
|
51
|
-
kiro: [],
|
|
51
|
+
kiro: ['low', 'medium', 'high', 'xhigh'],
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
claude: {
|
|
@@ -93,12 +93,12 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
93
93
|
codex: {
|
|
94
94
|
label: 'Codex',
|
|
95
95
|
efforts: ['low', 'medium', 'high', 'xhigh'],
|
|
96
|
-
models: ['gpt-5.5', 'gpt-5.4', 'gpt-5.
|
|
96
|
+
models: ['gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.3-codex-spark'],
|
|
97
97
|
},
|
|
98
98
|
'codex-app': {
|
|
99
99
|
label: 'Codex App',
|
|
100
100
|
efforts: ['low', 'medium', 'high', 'xhigh'],
|
|
101
|
-
models: ['gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.3-codex
|
|
101
|
+
models: ['gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.3-codex-spark'],
|
|
102
102
|
},
|
|
103
103
|
cursor: {
|
|
104
104
|
label: 'Cursor',
|
|
@@ -120,8 +120,8 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
120
120
|
},
|
|
121
121
|
'kiro-code': {
|
|
122
122
|
label: 'Kiro',
|
|
123
|
-
efforts: [],
|
|
124
|
-
effortNote: 'Kiro CLI
|
|
123
|
+
efforts: ['low', 'medium', 'high', 'xhigh'],
|
|
124
|
+
effortNote: 'Kiro CLI forwards --effort; cli-jaw maps xhigh to Kiro max on the wire',
|
|
125
125
|
models: [
|
|
126
126
|
'auto',
|
|
127
127
|
'claude-fable-5',
|
|
@@ -57,9 +57,6 @@ function getDefaultEmployeeModel(cli: string, models: string[]): string {
|
|
|
57
57
|
if (models.includes('claude-opus-4-8')) return 'claude-opus-4-8';
|
|
58
58
|
if (models.includes('opus')) return 'opus';
|
|
59
59
|
}
|
|
60
|
-
if (cli === 'codex' || cli === 'codex-app') {
|
|
61
|
-
if (models.includes('gpt-5.5')) return 'gpt-5.5';
|
|
62
|
-
}
|
|
63
60
|
return models[0] || 'default';
|
|
64
61
|
}
|
|
65
62
|
|
|
@@ -2,6 +2,7 @@ import { ICONS } from '../icons.js';
|
|
|
2
2
|
import {
|
|
3
3
|
getStoredProcessStepDetail,
|
|
4
4
|
processStepMetaFromStore,
|
|
5
|
+
registerProcessBlockState,
|
|
5
6
|
releaseProcessBlockDetails,
|
|
6
7
|
type ProcessBlockState,
|
|
7
8
|
type ProcessStep,
|
|
@@ -98,7 +99,11 @@ export function currentProcessBlockFromDom(agentMsg: HTMLElement): ProcessBlockS
|
|
|
98
99
|
const steps = Array.from(block.querySelectorAll<HTMLElement>('.process-step'))
|
|
99
100
|
.map(processStepFromDom)
|
|
100
101
|
.filter((step): step is ProcessStep => Boolean(step));
|
|
101
|
-
|
|
102
|
+
const state: ProcessBlockState = { element: block, steps, collapsed: block.classList.contains('collapsed') };
|
|
103
|
+
// Register so the click handler can sync pb.collapsed / drive the ticker for
|
|
104
|
+
// hydrated live blocks too (WP3 — DOM-reconstructed states were unregistered).
|
|
105
|
+
registerProcessBlockState(state);
|
|
106
|
+
return state;
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
function processStepToToolLog(step: ProcessStep, finalize = false): ToolLogEntry {
|
|
@@ -34,6 +34,10 @@ export interface ProcessBlockState {
|
|
|
34
34
|
* set by the "show N hidden steps" expander so a live long turn stays fully
|
|
35
35
|
* reachable (devlog 260620 Phase 4). Persists across new live steps. */
|
|
36
36
|
expandedSteps?: boolean;
|
|
37
|
+
/** Authoritative run-start (server startedAt) for the elapsed timer — steps carry
|
|
38
|
+
* client-arrival startTime, which resets to ~0 on live updates (WP3 zero-seconds
|
|
39
|
+
* bug). When set, elapsed derives from this instead of steps[0].startTime. */
|
|
40
|
+
startedAt?: number;
|
|
37
41
|
_durationEl?: HTMLElement | null;
|
|
38
42
|
}
|
|
39
43
|
let _tickerHandle: ReturnType<typeof setInterval> | null = null;
|
|
@@ -66,12 +70,44 @@ export interface StoredProcessStepMeta {
|
|
|
66
70
|
const processDetailStore = new Map<string, { detail: string; originalLength: number; truncated: boolean }>();
|
|
67
71
|
const processStepMetaStore = new Map<string, StoredProcessStepMeta>();
|
|
68
72
|
|
|
73
|
+
// Phase 30 (virtual-scroll/process-block measurement): observe the memory-policy
|
|
74
|
+
// hot paths without changing behavior. releaseProcessBlockDetails frees detail/meta
|
|
75
|
+
// when a block is recycled/collapsed; reconstructStepsFromBlock rebuilds an elided
|
|
76
|
+
// block from the persistent id list + meta store. These write-only counters make
|
|
77
|
+
// long-session/huge-block activity observable (no behavior change).
|
|
78
|
+
let releaseDetailsCalls = 0;
|
|
79
|
+
let releaseDetailsIdsCleared = 0;
|
|
80
|
+
let reconstructCalls = 0;
|
|
81
|
+
let reconstructStepsBuilt = 0;
|
|
82
|
+
|
|
83
|
+
export function getProcessBlockMetrics(): {
|
|
84
|
+
releaseDetailsCalls: number;
|
|
85
|
+
releaseDetailsIdsCleared: number;
|
|
86
|
+
reconstructCalls: number;
|
|
87
|
+
reconstructStepsBuilt: number;
|
|
88
|
+
} {
|
|
89
|
+
return { releaseDetailsCalls, releaseDetailsIdsCleared, reconstructCalls, reconstructStepsBuilt };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function resetProcessBlockMetrics(): void {
|
|
93
|
+
releaseDetailsCalls = 0;
|
|
94
|
+
releaseDetailsIdsCleared = 0;
|
|
95
|
+
reconstructCalls = 0;
|
|
96
|
+
reconstructStepsBuilt = 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function blockElapsedOrigin(pb: ProcessBlockState): number | null {
|
|
100
|
+
return pb.startedAt ?? pb.steps[0]?.startTime ?? null;
|
|
101
|
+
}
|
|
102
|
+
|
|
69
103
|
function tickDuration(): void {
|
|
70
104
|
const pb = _tickerBlock;
|
|
71
105
|
if (!pb || pb.collapsed || pb.steps.length === 0) { stopBlockTicker(); return; }
|
|
72
106
|
const el = pb._durationEl ?? (pb._durationEl = pb.element.querySelector('.process-duration') as HTMLElement | null);
|
|
73
107
|
if (!el) return;
|
|
74
|
-
const
|
|
108
|
+
const origin = blockElapsedOrigin(pb);
|
|
109
|
+
if (origin === null) return;
|
|
110
|
+
const elapsed = Math.round((Date.now() - origin) / 1000);
|
|
75
111
|
el.textContent = elapsed > 0 ? `${elapsed}s` : '';
|
|
76
112
|
}
|
|
77
113
|
function ensureTicker(pb: ProcessBlockState): void {
|
|
@@ -433,6 +469,14 @@ export function bindProcessBlockInteractions(root: HTMLElement): void {
|
|
|
433
469
|
summary.setAttribute('aria-expanded', expanding ? 'true' : 'false');
|
|
434
470
|
const chevron = summary.querySelector('.process-chevron');
|
|
435
471
|
if (chevron) chevron.innerHTML = expanding ? ICONS.chevronDown : ICONS.chevronRight;
|
|
472
|
+
// Keep the live state in sync with the DOM toggle so the elapsed
|
|
473
|
+
// ticker starts on expand / stops on collapse (WP3: it previously
|
|
474
|
+
// gated on a pb.collapsed that never changed).
|
|
475
|
+
const pb = blockStatesByElement.get(block as HTMLElement);
|
|
476
|
+
if (pb) {
|
|
477
|
+
pb.collapsed = !expanding;
|
|
478
|
+
updateSummary(pb);
|
|
479
|
+
}
|
|
436
480
|
});
|
|
437
481
|
}
|
|
438
482
|
});
|
|
@@ -469,8 +513,9 @@ function updateSummary(pb: ProcessBlockState): void {
|
|
|
469
513
|
dot.classList.toggle('done', !anyRunning || pb.collapsed);
|
|
470
514
|
}
|
|
471
515
|
|
|
472
|
-
const
|
|
473
|
-
|
|
516
|
+
const elapsedOrigin = blockElapsedOrigin(pb);
|
|
517
|
+
const elapsed = elapsedOrigin !== null
|
|
518
|
+
? Math.round((Date.now() - elapsedOrigin) / 1000)
|
|
474
519
|
: 0;
|
|
475
520
|
const dur = pb._durationEl ?? (pb._durationEl = pb.element.querySelector('.process-duration') as HTMLElement | null);
|
|
476
521
|
if (dur) dur.textContent = elapsed > 0 ? `${elapsed}s` : '';
|
|
@@ -479,6 +524,13 @@ function updateSummary(pb: ProcessBlockState): void {
|
|
|
479
524
|
else if (_tickerBlock === pb) stopBlockTicker();
|
|
480
525
|
}
|
|
481
526
|
|
|
527
|
+
/** Register a block state reconstructed outside createProcessBlock (e.g. from DOM by
|
|
528
|
+
* currentProcessBlockFromDom) so the delegated click handler can sync pb.collapsed
|
|
529
|
+
* and drive the elapsed ticker for hydrated/restored live blocks (WP3). */
|
|
530
|
+
export function registerProcessBlockState(state: ProcessBlockState): void {
|
|
531
|
+
blockStatesByElement.set(state.element, state);
|
|
532
|
+
}
|
|
533
|
+
|
|
482
534
|
export function createProcessBlock(parentEl: HTMLElement): ProcessBlockState {
|
|
483
535
|
const host = document.createElement('div');
|
|
484
536
|
host.innerHTML = blockShell('', true);
|
|
@@ -575,6 +627,7 @@ export function collapseBlock(pb: ProcessBlockState): void {
|
|
|
575
627
|
|
|
576
628
|
export function releaseProcessBlockDetails(rootOrState: HTMLElement | ProcessBlockState | null | undefined): void {
|
|
577
629
|
if (!rootOrState) return;
|
|
630
|
+
releaseDetailsCalls++;
|
|
578
631
|
const ids = new Set<string>();
|
|
579
632
|
if ('steps' in rootOrState) {
|
|
580
633
|
rootOrState.steps.forEach(step => ids.add(step.id));
|
|
@@ -598,6 +651,7 @@ export function releaseProcessBlockDetails(rootOrState: HTMLElement | ProcessBlo
|
|
|
598
651
|
processDetailStore.delete(id);
|
|
599
652
|
processStepMetaStore.delete(id);
|
|
600
653
|
});
|
|
654
|
+
releaseDetailsIdsCleared += ids.size;
|
|
601
655
|
}
|
|
602
656
|
|
|
603
657
|
export function processStepMetaFromStore(stepId: string): StoredProcessStepMeta | null {
|
|
@@ -611,6 +665,7 @@ export function processStepMetaFromStore(stepId: string): StoredProcessStepMeta
|
|
|
611
665
|
* meta store rather than scanning .process-step rows. Returns [] if the meta store
|
|
612
666
|
* was released (caller then no-ops, preserving prior behavior). */
|
|
613
667
|
export function reconstructStepsFromBlock(block: HTMLElement): ProcessStep[] {
|
|
668
|
+
reconstructCalls++;
|
|
614
669
|
const ids = (block.dataset['processStepIds'] || '').split(/\s+/).filter(Boolean);
|
|
615
670
|
const steps: ProcessStep[] = [];
|
|
616
671
|
for (const id of ids) {
|
|
@@ -637,5 +692,6 @@ export function reconstructStepsFromBlock(block: HTMLElement): ProcessStep[] {
|
|
|
637
692
|
startTime: meta.startTime,
|
|
638
693
|
});
|
|
639
694
|
}
|
|
695
|
+
reconstructStepsBuilt += steps.length;
|
|
640
696
|
return steps;
|
|
641
697
|
}
|
|
@@ -15,7 +15,7 @@ const REL_NOTE_PATH_RE_G = /(?:^|[\s([{"'`])([A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+
|
|
|
15
15
|
const TRAILING_PUNCT_RE = /[.,!?:;]+$/;
|
|
16
16
|
const LOCAL_FILE_HREF_RE = /^(?:~\/|\/(?:Users|home|tmp|var|opt|private)\/)/;
|
|
17
17
|
// Mirrors DocPanel EXT_LANG keys exactly (drift guarded by tests/unit/preview-doc-links.test.ts).
|
|
18
|
-
const DOC_PANEL_CODE_RE = /\.(ts|tsx|js|jsx|py|rs|go|java|cpp|c|css|html|xml|json|yaml|yml|sh|bash|sql)$/i;
|
|
18
|
+
const DOC_PANEL_CODE_RE = /\.(ts|tsx|js|jsx|py|rs|go|java|cpp|c|css|html|htm|xml|json|yaml|yml|sh|bash|sql)$/i;
|
|
19
19
|
const DOC_PANEL_MARKDOWN_RE = /\.(md|mdx)$/i;
|
|
20
20
|
|
|
21
21
|
let notesRootCache: string | null | undefined;
|
package/public/js/ui.ts
CHANGED
|
@@ -116,7 +116,7 @@ export function showLiveToolActivity(label: string): void {
|
|
|
116
116
|
scrollToBottom();
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
export function showProcessStep(step: ProcessStep): void {
|
|
119
|
+
export function showProcessStep(step: ProcessStep, runStartedAt?: number): void {
|
|
120
120
|
removeSkeleton();
|
|
121
121
|
let agentDiv = currentAgentDivForActiveRun();
|
|
122
122
|
if (!agentDiv) {
|
|
@@ -135,6 +135,9 @@ export function showProcessStep(step: ProcessStep): void {
|
|
|
135
135
|
state.currentProcessBlock = createProcessBlock(body);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
+
if (runStartedAt && state.currentProcessBlock && !state.currentProcessBlock.startedAt) {
|
|
139
|
+
state.currentProcessBlock.startedAt = runStartedAt;
|
|
140
|
+
}
|
|
138
141
|
if (state.currentProcessBlock) {
|
|
139
142
|
const rawIcon = step.rawIcon || step.icon;
|
|
140
143
|
// Completion detection: prefer semantic status field, fall back to emoji check
|
|
@@ -156,6 +159,7 @@ export function showProcessStep(step: ProcessStep): void {
|
|
|
156
159
|
detailPreview,
|
|
157
160
|
label: step.label || match.label,
|
|
158
161
|
status: resolvedStatus,
|
|
162
|
+
startTime: match.startTime,
|
|
159
163
|
});
|
|
160
164
|
scrollToBottom();
|
|
161
165
|
return;
|
|
@@ -176,6 +180,7 @@ export function showProcessStep(step: ProcessStep): void {
|
|
|
176
180
|
status: resolvedStatus,
|
|
177
181
|
detail: detailPreview,
|
|
178
182
|
detailPreview,
|
|
183
|
+
startTime: existingDone.startTime,
|
|
179
184
|
});
|
|
180
185
|
scrollToBottom();
|
|
181
186
|
return;
|
|
@@ -198,6 +203,7 @@ export function showProcessStep(step: ProcessStep): void {
|
|
|
198
203
|
detail: detailPreview,
|
|
199
204
|
detailPreview,
|
|
200
205
|
label: step.label || existingRunning.label,
|
|
206
|
+
startTime: existingRunning.startTime,
|
|
201
207
|
});
|
|
202
208
|
scrollToBottom();
|
|
203
209
|
return;
|
|
@@ -223,6 +229,7 @@ export function showProcessStep(step: ProcessStep): void {
|
|
|
223
229
|
detail: detailPreview,
|
|
224
230
|
detailPreview,
|
|
225
231
|
label: step.label || identityMatch.label,
|
|
232
|
+
startTime: identityMatch.startTime,
|
|
226
233
|
});
|
|
227
234
|
scrollToBottom();
|
|
228
235
|
return;
|
|
@@ -386,6 +393,7 @@ export function hydrateActiveRun(snapshot?: ActiveRunSnapshot | null): void {
|
|
|
386
393
|
removeAgentToolBlocks(state.currentAgentDiv);
|
|
387
394
|
state.currentProcessBlock = createProcessBlock(body);
|
|
388
395
|
}
|
|
396
|
+
if (snapshot.startedAt) state.currentProcessBlock.startedAt = snapshot.startedAt;
|
|
389
397
|
mergeHydratedProcessSteps(state.currentProcessBlock, toProcessSteps(snapshotToolLog, snapshot.startedAt));
|
|
390
398
|
} else {
|
|
391
399
|
state.currentProcessBlock = currentProcessBlockFromDom(state.currentAgentDiv);
|
|
@@ -111,6 +111,29 @@ export class VirtualScroll {
|
|
|
111
111
|
get active(): boolean { return this._active; }
|
|
112
112
|
get count(): number { return this.items.length; }
|
|
113
113
|
|
|
114
|
+
/** Phase 30 measurement: snapshot of virtualization state for long-session /
|
|
115
|
+
* huge-block observation. Pure read — no layout side effects. */
|
|
116
|
+
metrics(): {
|
|
117
|
+
virtualItemCount: number;
|
|
118
|
+
mountedRowCount: number;
|
|
119
|
+
firstVisibleIdx: number | null;
|
|
120
|
+
lastVisibleIdx: number | null;
|
|
121
|
+
firstVisibleId: string | null;
|
|
122
|
+
lastVisibleId: string | null;
|
|
123
|
+
} {
|
|
124
|
+
const idxs = [...this.mounted.keys()].sort((a, b) => a - b);
|
|
125
|
+
const first = idxs[0];
|
|
126
|
+
const last = idxs[idxs.length - 1];
|
|
127
|
+
return {
|
|
128
|
+
virtualItemCount: this.items.length,
|
|
129
|
+
mountedRowCount: this.mounted.size,
|
|
130
|
+
firstVisibleIdx: first ?? null,
|
|
131
|
+
lastVisibleIdx: last ?? null,
|
|
132
|
+
firstVisibleId: first !== undefined ? (this.items[first]?.id ?? null) : null,
|
|
133
|
+
lastVisibleId: last !== undefined ? (this.items[last]?.id ?? null) : null,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
114
137
|
private measureGap(): number {
|
|
115
138
|
if (this.itemGap > 0) return this.itemGap;
|
|
116
139
|
const probe = document.createElement('div');
|
package/public/js/ws.ts
CHANGED
|
@@ -68,6 +68,8 @@ interface WsMessage {
|
|
|
68
68
|
detailAvailable?: boolean;
|
|
69
69
|
detailBytes?: number;
|
|
70
70
|
rawRetentionStatus?: string;
|
|
71
|
+
/** Server run-start (ms) riding on agent_tool — authoritative elapsed origin. */
|
|
72
|
+
startedAt?: number;
|
|
71
73
|
text?: string;
|
|
72
74
|
toolLog?: { icon: string; label: string; detail?: string; toolType?: string; stepRef?: string; isEmployee?: boolean; traceRunId?: string; traceSeq?: number; detailAvailable?: boolean; detailBytes?: number; rawRetentionStatus?: string }[];
|
|
73
75
|
from?: string;
|
|
@@ -964,8 +966,11 @@ function handleServerEvent(msg: WsMessage): void {
|
|
|
964
966
|
detailBytes: msg.detailBytes,
|
|
965
967
|
rawRetentionStatus: msg.rawRetentionStatus,
|
|
966
968
|
status: (msg.status as 'running' | 'done' | 'error') || 'running',
|
|
967
|
-
|
|
968
|
-
|
|
969
|
+
// Server run start beats client arrival time: the elapsed-timer origin
|
|
970
|
+
// falls back to steps[0].startTime when pb.startedAt is lost on DOM
|
|
971
|
+
// reconstruct, and an arrival-time origin resets it to ~0 (WP4b).
|
|
972
|
+
startTime: typeof msg.startedAt === 'number' && msg.startedAt > 0 ? msg.startedAt : Date.now(),
|
|
973
|
+
}, typeof msg.startedAt === 'number' && msg.startedAt > 0 ? msg.startedAt : undefined);
|
|
969
974
|
rememberAppliedToolSeq(toolRunId, toolSeq);
|
|
970
975
|
} else if (msg.type === 'agent_output' || msg.type === 'agent_chunk') {
|
|
971
976
|
if (isRecentSteer()) return;
|