cli-jaw 2.2.2 → 2.2.3
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 +13 -9
- package/README.ko.md +5 -5
- package/README.md +7 -6
- package/README.zh-CN.md +5 -5
- package/dist/bin/commands/goal.js +14 -1
- package/dist/bin/commands/goal.js.map +1 -1
- package/dist/src/agent/agy-bootstrap.js +104 -0
- package/dist/src/agent/agy-bootstrap.js.map +1 -0
- package/dist/src/agent/agy-capabilities.js +103 -0
- package/dist/src/agent/agy-capabilities.js.map +1 -0
- package/dist/src/agent/agy-transcript-watcher.js +11 -0
- package/dist/src/agent/agy-transcript-watcher.js.map +1 -1
- package/dist/src/agent/args.js +32 -13
- package/dist/src/agent/args.js.map +1 -1
- package/dist/src/agent/events/claude.js +8 -4
- package/dist/src/agent/events/claude.js.map +1 -1
- package/dist/src/agent/events/helpers.js +13 -0
- package/dist/src/agent/events/helpers.js.map +1 -1
- package/dist/src/agent/events/index.js +24 -4
- package/dist/src/agent/events/index.js.map +1 -1
- package/dist/src/agent/lifecycle-handler.js +25 -4
- package/dist/src/agent/lifecycle-handler.js.map +1 -1
- package/dist/src/agent/spawn/queue.js +11 -5
- package/dist/src/agent/spawn/queue.js.map +1 -1
- package/dist/src/agent/spawn.js +49 -13
- package/dist/src/agent/spawn.js.map +1 -1
- package/dist/src/browser/web-ai/ax-snapshot.js +131 -8
- package/dist/src/browser/web-ai/ax-snapshot.js.map +1 -1
- package/dist/src/browser/web-ai/candidate-reconcile.js +61 -0
- package/dist/src/browser/web-ai/candidate-reconcile.js.map +1 -0
- package/dist/src/browser/web-ai/capability-probe.js +92 -0
- package/dist/src/browser/web-ai/capability-probe.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-archive.js +90 -0
- package/dist/src/browser/web-ai/chatgpt-archive.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-attachments.js +70 -3
- package/dist/src/browser/web-ai/chatgpt-attachments.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-composer.js +97 -11
- package/dist/src/browser/web-ai/chatgpt-composer.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-deep-research-report.js +63 -0
- package/dist/src/browser/web-ai/chatgpt-deep-research-report.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-deep-research.js +76 -13
- package/dist/src/browser/web-ai/chatgpt-deep-research.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-files.js +328 -0
- package/dist/src/browser/web-ai/chatgpt-files.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-images.js +281 -0
- package/dist/src/browser/web-ai/chatgpt-images.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-model.js +35 -14
- package/dist/src/browser/web-ai/chatgpt-model.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-multi-turn.js +28 -4
- package/dist/src/browser/web-ai/chatgpt-multi-turn.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-project-sources.js +191 -0
- package/dist/src/browser/web-ai/chatgpt-project-sources.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-response-dom.js +64 -0
- package/dist/src/browser/web-ai/chatgpt-response-dom.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-response-observer.js +170 -0
- package/dist/src/browser/web-ai/chatgpt-response-observer.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt-response.js +99 -60
- package/dist/src/browser/web-ai/chatgpt-response.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-tools.js +48 -1
- package/dist/src/browser/web-ai/chatgpt-tools.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-upload-surface.js +202 -0
- package/dist/src/browser/web-ai/chatgpt-upload-surface.js.map +1 -0
- package/dist/src/browser/web-ai/chatgpt.js +93 -12
- package/dist/src/browser/web-ai/chatgpt.js.map +1 -1
- package/dist/src/browser/web-ai/code-artifact.js +32 -10
- package/dist/src/browser/web-ai/code-artifact.js.map +1 -1
- package/dist/src/browser/web-ai/code-mode.js +40 -4
- package/dist/src/browser/web-ai/code-mode.js.map +1 -1
- package/dist/src/browser/web-ai/contract-audit.js +7 -22
- package/dist/src/browser/web-ai/contract-audit.js.map +1 -1
- package/dist/src/browser/web-ai/control-summary.js +43 -0
- package/dist/src/browser/web-ai/control-summary.js.map +1 -0
- package/dist/src/browser/web-ai/copy-markdown.js +10 -0
- package/dist/src/browser/web-ai/copy-markdown.js.map +1 -1
- package/dist/src/browser/web-ai/diagnostics.js +7 -0
- package/dist/src/browser/web-ai/diagnostics.js.map +1 -1
- package/dist/src/browser/web-ai/errors.js +17 -0
- package/dist/src/browser/web-ai/errors.js.map +1 -1
- package/dist/src/browser/web-ai/gemini-capabilities.js +46 -0
- package/dist/src/browser/web-ai/gemini-capabilities.js.map +1 -0
- package/dist/src/browser/web-ai/gemini-live.js +6 -0
- package/dist/src/browser/web-ai/gemini-live.js.map +1 -1
- package/dist/src/browser/web-ai/gemini-model.js +41 -0
- package/dist/src/browser/web-ai/gemini-model.js.map +1 -1
- package/dist/src/browser/web-ai/grok-capabilities.js +41 -0
- package/dist/src/browser/web-ai/grok-capabilities.js.map +1 -0
- package/dist/src/browser/web-ai/grok-live.js +5 -0
- package/dist/src/browser/web-ai/grok-live.js.map +1 -1
- package/dist/src/browser/web-ai/grok-model.js +38 -0
- package/dist/src/browser/web-ai/grok-model.js.map +1 -1
- package/dist/src/browser/web-ai/index.js +10 -0
- package/dist/src/browser/web-ai/index.js.map +1 -1
- package/dist/src/browser/web-ai/navigation-ready.js +123 -0
- package/dist/src/browser/web-ai/navigation-ready.js.map +1 -0
- package/dist/src/browser/web-ai/observation-bundle.js +26 -1
- package/dist/src/browser/web-ai/observation-bundle.js.map +1 -1
- package/dist/src/browser/web-ai/provider-adapter.js.map +1 -1
- package/dist/src/browser/web-ai/session-artifacts.js +156 -0
- package/dist/src/browser/web-ai/session-artifacts.js.map +1 -0
- package/dist/src/browser/web-ai/session-doctor.js +101 -0
- package/dist/src/browser/web-ai/session-doctor.js.map +1 -0
- package/dist/src/browser/web-ai/session-store.js +94 -17
- package/dist/src/browser/web-ai/session-store.js.map +1 -1
- package/dist/src/browser/web-ai/session.js +73 -0
- package/dist/src/browser/web-ai/session.js.map +1 -1
- package/dist/src/browser/web-ai/tab-inspect.js +143 -0
- package/dist/src/browser/web-ai/tab-inspect.js.map +1 -0
- package/dist/src/browser/web-ai/tab-lease-store.js +114 -4
- package/dist/src/browser/web-ai/tab-lease-store.js.map +1 -1
- package/dist/src/browser/web-ai/tier-timeout.js +58 -0
- package/dist/src/browser/web-ai/tier-timeout.js.map +1 -0
- package/dist/src/browser/web-ai/vendor-editor-contract.js +6 -3
- package/dist/src/browser/web-ai/vendor-editor-contract.js.map +1 -1
- package/dist/src/browser/web-ai/watcher-lock.js +125 -0
- package/dist/src/browser/web-ai/watcher-lock.js.map +1 -0
- package/dist/src/browser/web-ai/watcher.js +23 -4
- package/dist/src/browser/web-ai/watcher.js.map +1 -1
- package/dist/src/cli/handlers-workflows.js +14 -3
- package/dist/src/cli/handlers-workflows.js.map +1 -1
- package/dist/src/core/cli-detection.js +2 -3
- package/dist/src/core/cli-detection.js.map +1 -1
- package/dist/src/core/settings-merge.js +2 -2
- package/dist/src/core/settings-merge.js.map +1 -1
- package/dist/src/goal/heartbeat.js +13 -7
- package/dist/src/goal/heartbeat.js.map +1 -1
- package/dist/src/goal/pause-gate.js +22 -0
- package/dist/src/goal/pause-gate.js.map +1 -0
- package/dist/src/goal/store.js +5 -0
- package/dist/src/goal/store.js.map +1 -1
- package/dist/src/manager/lifecycle.js +2 -1
- package/dist/src/manager/lifecycle.js.map +1 -1
- package/dist/src/manager/preview-origin-proxy.js +36 -6
- package/dist/src/manager/preview-origin-proxy.js.map +1 -1
- package/dist/src/manager/proxy.js +25 -4
- package/dist/src/manager/proxy.js.map +1 -1
- package/dist/src/manager/registry.js +36 -3
- package/dist/src/manager/registry.js.map +1 -1
- package/dist/src/manager/routes/runtime-monitor.js +2 -0
- package/dist/src/manager/routes/runtime-monitor.js.map +1 -1
- package/dist/src/manager/routes/telegram-hub.js +120 -0
- package/dist/src/manager/routes/telegram-hub.js.map +1 -0
- package/dist/src/manager/server.js +4 -0
- package/dist/src/manager/server.js.map +1 -1
- package/dist/src/manager/telegram-hub/hub-bot.js +409 -0
- package/dist/src/manager/telegram-hub/hub-bot.js.map +1 -0
- package/dist/src/manager/telegram-hub/routing-store.js +24 -0
- package/dist/src/manager/telegram-hub/routing-store.js.map +1 -0
- package/dist/src/manager/telegram-hub/types.js +5 -0
- package/dist/src/manager/telegram-hub/types.js.map +1 -0
- package/dist/src/messaging/thread-target.js +21 -0
- package/dist/src/messaging/thread-target.js.map +1 -0
- package/dist/src/orchestrator/gateway.js +10 -7
- package/dist/src/orchestrator/gateway.js.map +1 -1
- package/dist/src/orchestrator/pipeline.js +19 -0
- package/dist/src/orchestrator/pipeline.js.map +1 -1
- package/dist/src/orchestrator/worker-registry.js.map +1 -1
- package/dist/src/routes/command.js +58 -2
- package/dist/src/routes/command.js.map +1 -1
- package/dist/src/routes/goal.js +6 -3
- package/dist/src/routes/goal.js.map +1 -1
- package/dist/src/routes/messaging.js +7 -2
- package/dist/src/routes/messaging.js.map +1 -1
- package/dist/src/routes/orchestrate.js +2 -0
- package/dist/src/routes/orchestrate.js.map +1 -1
- package/dist/src/telegram/bot.js +59 -4
- package/dist/src/telegram/bot.js.map +1 -1
- package/dist/src/telegram/forwarder.js +4 -1
- package/dist/src/telegram/forwarder.js.map +1 -1
- package/dist/src/telegram/hub-callback.js +21 -0
- package/dist/src/telegram/hub-callback.js.map +1 -0
- package/dist/src/telegram/rich-message.js +20 -0
- package/dist/src/telegram/rich-message.js.map +1 -0
- package/dist/src/telegram/telegram-file.js +4 -3
- package/dist/src/telegram/telegram-file.js.map +1 -1
- package/dist/src/workflows/status.js +14 -4
- package/dist/src/workflows/status.js.map +1 -1
- package/package.json +5 -5
- package/public/dist/assets/{Agent-wJtedbz4.js → Agent-Ci12HWhE.js} +1 -1
- package/public/dist/assets/{Heartbeat-CjgQ-0p8.js → Heartbeat-D-Rfp094.js} +1 -1
- package/public/dist/assets/{Memory-6o-wyhAT.js → Memory-VH4ZJCMW.js} +1 -1
- package/public/dist/assets/ModelProvider-_tUCghOF.js +1 -0
- package/public/dist/assets/TelegramHub-CuJoPPib.js +1 -0
- package/public/dist/assets/{agent-meta-g8UDRdWA.js → agent-meta-DqBTGRRQ.js} +1 -1
- package/public/dist/assets/{app-CLrfEHAk.js → app-DaORcAyD.js} +4 -4
- package/public/dist/assets/bgtask-badge-B3HLOZae.js +1 -0
- package/public/dist/assets/{bgtask-badge-xWbw-l-0.js → bgtask-badge-BtUXEe1T.js} +1 -1
- package/public/dist/assets/constants-DkJ3E63Y.js +1 -0
- package/public/dist/assets/{employees-C5GPj3d3.js → employees-CZSyvJbx.js} +1 -1
- package/public/dist/assets/manager-D3waO_XX.css +1 -0
- package/public/dist/assets/manager-DB5qTw1A.js +13 -0
- package/public/dist/assets/memory-BEruUlfu.js +1 -0
- package/public/dist/assets/{memory-CcnjBuo-.js → memory-cWI_Htbn.js} +1 -1
- package/public/dist/assets/message-history-DU1V9ZAW.js +142 -0
- package/public/dist/assets/message-history-tjkyOp_K.js +1 -0
- package/public/dist/assets/{render-C2g_qvCg.js → render-Bp8eyqCf.js} +1 -1
- package/public/dist/assets/settings-B-GgyJZI.js +1 -0
- package/public/dist/assets/{settings-DxClXVD0.js → settings-DLkP7qRV.js} +1 -1
- package/public/dist/assets/{settings-core-CSUV4-QG.js → settings-core-B5XRRNcX.js} +1 -1
- package/public/dist/assets/settings-core-Cw1av-Ox.js +1 -0
- package/public/dist/assets/{sidebar-CJz_SnMW.js → sidebar-CsogFOse.js} +3 -3
- package/public/dist/assets/skills-CLcoop6W.js +1 -0
- package/public/dist/assets/{skills-PKg2h1N4.js → skills-Dmf4v9rj.js} +1 -1
- package/public/dist/assets/slash-commands-DY6-hzq6.js +1 -0
- package/public/dist/assets/{slash-commands-FMOOfedZ.js → slash-commands-vcf7FuPD.js} +1 -1
- package/public/dist/assets/{trace-drawer-BoU1ucw7.js → trace-drawer-DuQQ0SNq.js} +1 -1
- package/public/dist/assets/{ui-BX-IfLze.js → ui-BKYuBdZE.js} +1 -1
- package/public/dist/assets/ui-CqlGwgUo.js +1 -0
- package/public/dist/index.html +1 -1
- package/public/dist/manager/index.html +2 -2
- package/public/js/constants.ts +2 -3
- package/public/js/features/process-block.ts +61 -9
- package/public/manager/src/code/code-composer.css +1 -0
- package/public/manager/src/code/code.css +7 -2
- package/public/manager/src/dashboard-settings/DashboardSettingsSidebar.tsx +6 -2
- package/public/manager/src/dashboard-settings/DashboardSettingsWorkspace.tsx +91 -2
- package/public/manager/src/goal-status/GoalPabcdStatusPanel.tsx +9 -1
- package/public/manager/src/goal-status/goal-pabcd-status-client.ts +9 -0
- package/public/manager/src/settings/SettingsShell.tsx +1 -0
- package/public/manager/src/settings/SettingsSidebar.tsx +1 -0
- package/public/manager/src/settings/pages/TelegramHub.tsx +179 -0
- package/public/manager/src/settings/pages/components/PerCliRow.tsx +23 -13
- package/public/manager/src/settings/pages/components/agent/agent-meta.ts +3 -1
- package/public/manager/src/settings/types.ts +1 -0
- package/public/manager/src/settings-shell.css +11 -0
- package/public/sw.js +1 -1
- package/scripts/bundle-sidecar.sh +6 -1
- package/public/dist/assets/ModelProvider-CNu6WOjM.js +0 -1
- package/public/dist/assets/bgtask-badge-4OjtCvDq.js +0 -1
- package/public/dist/assets/constants-CCiCctGV.js +0 -1
- package/public/dist/assets/manager-Ceg2x8D0.js +0 -13
- package/public/dist/assets/manager-CwAlpgV7.css +0 -1
- package/public/dist/assets/memory-B1beDKbo.js +0 -1
- package/public/dist/assets/message-history-BSWJwi__.js +0 -142
- package/public/dist/assets/message-history-CzaziSe8.js +0 -1
- package/public/dist/assets/settings-Dst1mUjn.js +0 -1
- package/public/dist/assets/settings-core-BW5mtFPE.js +0 -1
- package/public/dist/assets/skills-B2io6S_4.js +0 -1
- package/public/dist/assets/slash-commands-D1IS00Eg.js +0 -1
- package/public/dist/assets/ui-C-al0etg.js +0 -1
- /package/public/dist/assets/{TerminalPanel-B7WRXPsE.js → TerminalPanel-DSCJeGjp.js} +0 -0
|
@@ -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-Bp8eyqCf.js";import{F as ee,L as te,R as ne,_ as re,d as ie,u,v as d}from"./message-history-DU1V9ZAW.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-BKYuBdZE.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-CZSyvJbx.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-CqlGwgUo.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-CqlGwgUo.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-Cw1av-Ox.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-C-al0etg.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-B1beDKbo.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])).catch(()=>{}),r(()=>import(`./bgtask-badge-4OjtCvDq.js`).then(e=>e.refreshBgtaskBadge()),__vite__mapDeps([0])).catch(()=>{})}),void 0)}function Wt(){te(`replay_gap`),Bt=r(()=>import(`./ui-C-al0etg.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-C-al0etg.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-C5GPj3d3.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])))}else if(t.type===`bgtask_update`)r(()=>import(`./bgtask-badge-4OjtCvDq.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-C5GPj3d3.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-B1beDKbo.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-CzaziSe8.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-C5GPj3d3.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-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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./skills-Dmf4v9rj.js";export{e as loadSkills};
|
|
@@ -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-Bp8eyqCf.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{a as e}from"./slash-commands-vcf7FuPD.js";export{e as loadCommands};
|
|
@@ -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-Bp8eyqCf.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>
|
|
@@ -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-Bp8eyqCf.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>
|
|
@@ -1,2 +1,2 @@
|
|
|
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{t}from"./preload-helper-DFYRRz9w.js";import{E as n,S as r,t as i,v as a,w as o}from"./render-
|
|
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-Bp8eyqCf.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-DU1V9ZAW.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){A();let n=K();if(n||(n=x(`agent`,``),e.currentAgentDiv=n,e.currentProcessBlock=null),v(n),!e.currentProcessBlock){let t=n.querySelector(`.agent-body`);t&&(e.currentProcessBlock=S(n)),!e.currentProcessBlock&&t&&(c(n),e.currentProcessBlock=f(t))}if(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}),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}),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}),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}),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)),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-B-GgyJZI.js`).then(e=>e.loadSettings()),__vite__mapDeps([0])),e===`agents`&&t(()=>import(`./employees-CZSyvJbx.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])),e===`skills`&&t(()=>import(`./skills-CLcoop6W.js`).then(e=>e.loadSkills()),__vite__mapDeps([0]))}function Ce(){let e=document.getElementById(`tabSettings`)?.classList.contains(`active`);t(()=>import(`./settings-B-GgyJZI.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,d as t,o as n}from"./message-history-DU1V9ZAW.js";import{r}from"./ui-BKYuBdZE.js";export{r as cleanupToolActivity,n as loadMessages,e as reconcileChatBottomAfterRestore,t as updateQueueBadge};
|
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-DaORcAyD.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-DB5qTw1A.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-D3waO_XX.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="manager-root"></div>
|
package/public/js/constants.ts
CHANGED
|
@@ -19,9 +19,8 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
19
19
|
agy: {
|
|
20
20
|
label: 'Antigravity',
|
|
21
21
|
efforts: [],
|
|
22
|
-
effortNote: '
|
|
23
|
-
|
|
24
|
-
models: [],
|
|
22
|
+
effortNote: 'AGY has no separate effort flag',
|
|
23
|
+
models: ['gemini-3.5-flash'],
|
|
25
24
|
},
|
|
26
25
|
'ai-e': {
|
|
27
26
|
label: 'AI-E',
|
|
@@ -290,7 +290,7 @@ function renderStep(step: ProcessStep): string {
|
|
|
290
290
|
<span class="process-step-chevron">${ICONS.chevronRight}</span>
|
|
291
291
|
</button>
|
|
292
292
|
<div class="process-step-details collapsed" id="${detailId}">
|
|
293
|
-
<pre class="process-step-full" data-detail-lazy="true"></pre>
|
|
293
|
+
<pre class="process-step-full" data-detail-lazy="true"${(step.detailLength || 0) > 0 ? ' data-had-detail="true"' : ''}></pre>
|
|
294
294
|
</div>
|
|
295
295
|
</div>`;
|
|
296
296
|
}
|
|
@@ -347,7 +347,13 @@ function toggleStepDetails(toggle: HTMLElement): void {
|
|
|
347
347
|
const expanding = details.classList.contains('collapsed');
|
|
348
348
|
if (expanding && pre?.dataset['detailLazy'] === 'true') {
|
|
349
349
|
const detail = getStoredProcessStepDetail((wrapper as HTMLElement).dataset['stepId'] || '');
|
|
350
|
-
|
|
350
|
+
const resolved = detail || processStepMetaStore.get((wrapper as HTMLElement).dataset['stepId'] || '')?.preview || '';
|
|
351
|
+
// If the step HAD detail (data-had-detail, set at render from detailLength) but
|
|
352
|
+
// both stores were released on recycle, show a hint instead of a blank <pre>.
|
|
353
|
+
// Steps that never had detail keep the empty box (nothing to show — no misleading).
|
|
354
|
+
pre.textContent = resolved || (pre.dataset['hadDetail'] === 'true'
|
|
355
|
+
? '(detail released to save memory — scroll this message back into view to reload)'
|
|
356
|
+
: '');
|
|
351
357
|
delete pre.dataset['detailLazy'];
|
|
352
358
|
} else if (!expanding && pre && pre.textContent && pre.textContent.length > PROCESS_DETAIL_COLLAPSE_CLEAR_CHARS) {
|
|
353
359
|
pre.textContent = '';
|
|
@@ -388,14 +394,24 @@ export function bindProcessBlockInteractions(root: HTMLElement): void {
|
|
|
388
394
|
if (expandTrigger) {
|
|
389
395
|
event.preventDefault();
|
|
390
396
|
const block = expandTrigger.closest('.process-block') as HTMLElement | null;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
397
|
+
if (!block) return;
|
|
398
|
+
let pb = blockStatesByElement.get(block);
|
|
399
|
+
if (!pb) {
|
|
400
|
+
// Hydrated / virtual-scroll-recycled block: its live ProcessBlockState was
|
|
401
|
+
// GC'd, so it is absent from blockStatesByElement. Reconstruct the full step
|
|
402
|
+
// list from the persistent dataset.processStepIds + meta store (the elided
|
|
403
|
+
// middle rows are NOT in the DOM) and register it so repeat clicks cache-hit.
|
|
404
|
+
const steps = reconstructStepsFromBlock(block);
|
|
405
|
+
if (steps.length === 0) return;
|
|
406
|
+
pb = { element: block, steps, collapsed: block.classList.contains('collapsed') };
|
|
407
|
+
blockStatesByElement.set(block, pb);
|
|
398
408
|
}
|
|
409
|
+
const state = pb;
|
|
410
|
+
withProcessBlockLayoutMutation(block, () => {
|
|
411
|
+
state.expandedSteps = true;
|
|
412
|
+
const inner = state.element.querySelector('.process-steps-inner');
|
|
413
|
+
if (inner) inner.innerHTML = renderSteps(state.steps, true);
|
|
414
|
+
});
|
|
399
415
|
return;
|
|
400
416
|
}
|
|
401
417
|
|
|
@@ -587,3 +603,39 @@ export function releaseProcessBlockDetails(rootOrState: HTMLElement | ProcessBlo
|
|
|
587
603
|
export function processStepMetaFromStore(stepId: string): StoredProcessStepMeta | null {
|
|
588
604
|
return processStepMetaStore.get(stepId) || null;
|
|
589
605
|
}
|
|
606
|
+
|
|
607
|
+
/** Rebuild the FULL step list for a block whose live ProcessBlockState was GC'd
|
|
608
|
+
* (hydrated from history / recycled by virtual-scroll, hence absent from the
|
|
609
|
+
* blockStatesByElement WeakMap). The elided middle steps of a long block are NOT
|
|
610
|
+
* in the DOM, so recover from the persistent id list (dataset.processStepIds) +
|
|
611
|
+
* meta store rather than scanning .process-step rows. Returns [] if the meta store
|
|
612
|
+
* was released (caller then no-ops, preserving prior behavior). */
|
|
613
|
+
export function reconstructStepsFromBlock(block: HTMLElement): ProcessStep[] {
|
|
614
|
+
const ids = (block.dataset['processStepIds'] || '').split(/\s+/).filter(Boolean);
|
|
615
|
+
const steps: ProcessStep[] = [];
|
|
616
|
+
for (const id of ids) {
|
|
617
|
+
const meta = processStepMetaStore.get(id);
|
|
618
|
+
if (!meta) continue;
|
|
619
|
+
steps.push({
|
|
620
|
+
id: meta.id,
|
|
621
|
+
type: meta.type,
|
|
622
|
+
icon: meta.icon,
|
|
623
|
+
rawIcon: meta.rawIcon,
|
|
624
|
+
label: meta.label,
|
|
625
|
+
isEmployee: meta.isEmployee,
|
|
626
|
+
detail: getStoredProcessStepDetail(id) || meta.preview || '',
|
|
627
|
+
detailPreview: meta.preview,
|
|
628
|
+
detailLength: meta.detailLength,
|
|
629
|
+
detailTruncated: meta.detailTruncated,
|
|
630
|
+
stepRef: meta.stepRef,
|
|
631
|
+
traceRunId: meta.traceRunId,
|
|
632
|
+
traceSeq: meta.traceSeq,
|
|
633
|
+
detailAvailable: meta.detailAvailable,
|
|
634
|
+
detailBytes: meta.detailBytes,
|
|
635
|
+
rawRetentionStatus: meta.rawRetentionStatus,
|
|
636
|
+
status: meta.status,
|
|
637
|
+
startTime: meta.startTime,
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
return steps;
|
|
641
|
+
}
|
|
@@ -280,6 +280,9 @@
|
|
|
280
280
|
.code-canvas {
|
|
281
281
|
display: flex;
|
|
282
282
|
height: 100%;
|
|
283
|
+
min-width: 0;
|
|
284
|
+
min-height: 0;
|
|
285
|
+
overflow: hidden;
|
|
283
286
|
background: var(--bg-base);
|
|
284
287
|
}
|
|
285
288
|
.code-canvas-sidebar {
|
|
@@ -290,11 +293,13 @@
|
|
|
290
293
|
background: var(--bg-panel);
|
|
291
294
|
}
|
|
292
295
|
.code-canvas-main {
|
|
293
|
-
flex: 1;
|
|
296
|
+
flex: 1 1 0;
|
|
294
297
|
display: flex;
|
|
295
298
|
flex-direction: column;
|
|
296
299
|
min-width: 0;
|
|
297
300
|
min-height: 0;
|
|
301
|
+
height: 100%;
|
|
302
|
+
overflow: hidden;
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
/* Session header (title + context meter + plan) */
|
|
@@ -372,7 +377,7 @@
|
|
|
372
377
|
|
|
373
378
|
/* Transcript */
|
|
374
379
|
.code-transcript {
|
|
375
|
-
flex: 1;
|
|
380
|
+
flex: 1 1 0;
|
|
376
381
|
min-height: 0;
|
|
377
382
|
overflow-y: auto;
|
|
378
383
|
padding: 16px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DashboardLocale } from '../types';
|
|
2
2
|
|
|
3
|
-
type DashboardSettingsSection = 'display' | 'activity' | 'developer' | 'embedding';
|
|
3
|
+
type DashboardSettingsSection = 'display' | 'activity' | 'developer' | 'embedding' | 'telegramHub';
|
|
4
4
|
|
|
5
5
|
type DashboardSettingsSidebarProps = {
|
|
6
6
|
activeSection: DashboardSettingsSection;
|
|
@@ -18,6 +18,7 @@ const COPY = {
|
|
|
18
18
|
activity: { label: '미리보기와 활동', hint: '제목 출처와 기본값' },
|
|
19
19
|
developer: { label: '개발 도구', hint: 'Git diff 기본값' },
|
|
20
20
|
embedding: { label: '임베딩 검색', hint: 'Provider와 벡터 인덱스' },
|
|
21
|
+
telegramHub: { label: 'Telegram Hub', hint: '포럼 토픽 라우팅' },
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
en: {
|
|
@@ -29,6 +30,7 @@ const COPY = {
|
|
|
29
30
|
activity: { label: 'Preview & activity', hint: 'Title source and defaults' },
|
|
30
31
|
developer: { label: 'Developer tools', hint: 'Git diff defaults' },
|
|
31
32
|
embedding: { label: 'Embedding search', hint: 'Provider and vector index' },
|
|
33
|
+
telegramHub: { label: 'Telegram Hub', hint: 'Forum topic routing' },
|
|
32
34
|
},
|
|
33
35
|
},
|
|
34
36
|
zh: {
|
|
@@ -40,6 +42,7 @@ const COPY = {
|
|
|
40
42
|
activity: { label: '预览与活动', hint: '标题来源与默认值' },
|
|
41
43
|
developer: { label: '开发工具', hint: 'Git diff 默认值' },
|
|
42
44
|
embedding: { label: '嵌入搜索', hint: 'Provider 与向量索引' },
|
|
45
|
+
telegramHub: { label: 'Telegram Hub', hint: '论坛主题路由' },
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
ja: {
|
|
@@ -51,11 +54,12 @@ const COPY = {
|
|
|
51
54
|
activity: { label: 'プレビューとアクティビティ', hint: 'タイトルの取得元と既定値' },
|
|
52
55
|
developer: { label: '開発ツール', hint: 'Git diff の既定値' },
|
|
53
56
|
embedding: { label: 'エンベディング検索', hint: 'Provider とベクトルインデックス' },
|
|
57
|
+
telegramHub: { label: 'Telegram Hub', hint: 'フォーラムトピックルーティング' },
|
|
54
58
|
},
|
|
55
59
|
},
|
|
56
60
|
} as const;
|
|
57
61
|
|
|
58
|
-
const SECTION_IDS: DashboardSettingsSection[] = ['display', 'activity', 'developer', 'embedding'];
|
|
62
|
+
const SECTION_IDS: DashboardSettingsSection[] = ['display', 'activity', 'developer', 'embedding', 'telegramHub'];
|
|
59
63
|
|
|
60
64
|
export function DashboardSettingsSidebar(props: DashboardSettingsSidebarProps) {
|
|
61
65
|
const copy = COPY[props.locale] || COPY.ko;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { Suspense, lazy, useEffect, type ReactNode } from 'react';
|
|
1
|
+
import { Suspense, lazy, useCallback, useEffect, useRef, useState, useSyncExternalStore, type ReactNode } from 'react';
|
|
2
2
|
import { formatShortcut, MANAGER_SHORTCUT_ACTIONS } from '../manager-shortcuts';
|
|
3
3
|
import { DashboardDeveloperSettingsSection } from './DashboardDeveloperSettingsSection';
|
|
4
4
|
|
|
5
5
|
const LazyEmbedding = lazy(() => import('./DashboardEmbeddingSection').then(m => ({ default: m.DashboardEmbeddingSection })));
|
|
6
|
+
const LazyTelegramHub = lazy(() => import('../settings/pages/TelegramHub'));
|
|
6
7
|
import { HelpTopicButton } from '../help/HelpTopicButton';
|
|
7
8
|
import type { HelpTopicId } from '../help/helpContent';
|
|
8
9
|
import type { DashboardLocale, DashboardRegistryUi, DashboardShortcutAction } from '../types';
|
|
9
10
|
import type { DashboardActivityTitleSupport } from './activity-title-support';
|
|
11
|
+
import { SaveBar } from '../settings/components/SaveBar';
|
|
12
|
+
import { createDirtyStore } from '../settings/dirty-store';
|
|
13
|
+
import { createSettingsClient } from '../settings/settings-client';
|
|
14
|
+
import type { DirtyStore, SaveHandler } from '../settings/types';
|
|
10
15
|
|
|
11
16
|
type DashboardSettingsWorkspaceProps = {
|
|
12
|
-
activeSection: 'display' | 'activity' | 'developer' | 'embedding';
|
|
17
|
+
activeSection: 'display' | 'activity' | 'developer' | 'embedding' | 'telegramHub';
|
|
13
18
|
ui: DashboardRegistryUi;
|
|
14
19
|
titleSupport: DashboardActivityTitleSupport;
|
|
15
20
|
onUiPatch: (patch: Partial<DashboardRegistryUi>) => void;
|
|
@@ -465,6 +470,88 @@ function TitleSupportSummary({ support, locale }: { support: DashboardActivityTi
|
|
|
465
470
|
);
|
|
466
471
|
}
|
|
467
472
|
|
|
473
|
+
function useDirtyStore(): DirtyStore {
|
|
474
|
+
const ref = useRef<DirtyStore | null>(null);
|
|
475
|
+
if (ref.current === null) ref.current = createDirtyStore();
|
|
476
|
+
return ref.current;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function useDirtyFlag(store: DirtyStore): boolean {
|
|
480
|
+
return useSyncExternalStore(
|
|
481
|
+
useCallback((listener) => store.subscribe(listener), [store]),
|
|
482
|
+
useCallback(() => store.isDirty(), [store]),
|
|
483
|
+
useCallback(() => false, []),
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function usePendingCount(store: DirtyStore): number {
|
|
488
|
+
return useSyncExternalStore(
|
|
489
|
+
useCallback((listener) => store.subscribe(listener), [store]),
|
|
490
|
+
useCallback(() => store.pending.size, [store]),
|
|
491
|
+
useCallback(() => 0, []),
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function DashboardTelegramHubSection() {
|
|
496
|
+
const dirty = useDirtyStore();
|
|
497
|
+
const isDirty = useDirtyFlag(dirty);
|
|
498
|
+
const pendingCount = usePendingCount(dirty);
|
|
499
|
+
const client = useRef(createSettingsClient(0));
|
|
500
|
+
const saveHandlerRef = useRef<SaveHandler | null>(null);
|
|
501
|
+
const [saving, setSaving] = useState(false);
|
|
502
|
+
const [saveError, setSaveError] = useState<string | null>(null);
|
|
503
|
+
|
|
504
|
+
const registerSave = useCallback((handler: SaveHandler | null) => {
|
|
505
|
+
saveHandlerRef.current = handler;
|
|
506
|
+
}, []);
|
|
507
|
+
|
|
508
|
+
const onDiscard = useCallback(() => {
|
|
509
|
+
if (saving) return;
|
|
510
|
+
dirty.clear();
|
|
511
|
+
setSaveError(null);
|
|
512
|
+
}, [dirty, saving]);
|
|
513
|
+
|
|
514
|
+
const onSave = useCallback(async () => {
|
|
515
|
+
if (saving) return;
|
|
516
|
+
const handler = saveHandlerRef.current;
|
|
517
|
+
setSaveError(null);
|
|
518
|
+
if (!handler) {
|
|
519
|
+
dirty.clear();
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
setSaving(true);
|
|
523
|
+
try {
|
|
524
|
+
await handler();
|
|
525
|
+
} catch (err) {
|
|
526
|
+
setSaveError(err instanceof Error ? err.message : String(err));
|
|
527
|
+
} finally {
|
|
528
|
+
setSaving(false);
|
|
529
|
+
}
|
|
530
|
+
}, [dirty, saving]);
|
|
531
|
+
|
|
532
|
+
return (
|
|
533
|
+
<section className="dashboard-settings-section">
|
|
534
|
+
<Suspense fallback={<div className="settings-loading">Loading Telegram hub...</div>}>
|
|
535
|
+
<LazyTelegramHub
|
|
536
|
+
port={0}
|
|
537
|
+
instanceUrl=""
|
|
538
|
+
client={client.current}
|
|
539
|
+
dirty={dirty}
|
|
540
|
+
registerSave={registerSave}
|
|
541
|
+
/>
|
|
542
|
+
</Suspense>
|
|
543
|
+
<SaveBar
|
|
544
|
+
isDirty={isDirty}
|
|
545
|
+
saving={saving}
|
|
546
|
+
pendingCount={pendingCount}
|
|
547
|
+
error={saveError}
|
|
548
|
+
onDiscard={onDiscard}
|
|
549
|
+
onSave={() => void onSave()}
|
|
550
|
+
/>
|
|
551
|
+
</section>
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
468
555
|
export function DashboardSettingsWorkspace(props: DashboardSettingsWorkspaceProps) {
|
|
469
556
|
const locale = normalizeDashboardLocale(props.ui.locale);
|
|
470
557
|
const copy = COPY[locale];
|
|
@@ -573,6 +660,8 @@ export function DashboardSettingsWorkspace(props: DashboardSettingsWorkspaceProp
|
|
|
573
660
|
</section>
|
|
574
661
|
) : props.activeSection === 'developer' ? (
|
|
575
662
|
<DashboardDeveloperSettingsSection locale={locale} ui={props.ui} onUiPatch={props.onUiPatch} />
|
|
663
|
+
) : props.activeSection === 'telegramHub' ? (
|
|
664
|
+
<DashboardTelegramHubSection />
|
|
576
665
|
) : (
|
|
577
666
|
<section className="dashboard-settings-section">
|
|
578
667
|
<header>
|