comisai 1.0.23 → 1.0.25

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.
Files changed (106) hide show
  1. package/node_modules/@comis/agent/dist/executor/pi-executor.js +17 -0
  2. package/node_modules/@comis/agent/dist/index.d.ts +2 -1
  3. package/node_modules/@comis/agent/dist/index.js +1 -1
  4. package/node_modules/@comis/agent/dist/model/auth-storage-adapter.d.ts +21 -0
  5. package/node_modules/@comis/agent/dist/model/auth-storage-adapter.js +15 -1
  6. package/node_modules/@comis/agent/dist/model/model-registry-adapter.d.ts +46 -0
  7. package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +108 -0
  8. package/node_modules/@comis/agent/package.json +1 -1
  9. package/node_modules/@comis/channels/package.json +1 -1
  10. package/node_modules/@comis/cli/package.json +1 -1
  11. package/node_modules/@comis/core/dist/bootstrap.js +5 -0
  12. package/node_modules/@comis/core/dist/config/env-layer.d.ts +31 -0
  13. package/node_modules/@comis/core/dist/config/env-layer.js +41 -0
  14. package/node_modules/@comis/core/dist/config/layered.d.ts +9 -0
  15. package/node_modules/@comis/core/dist/config/layered.js +11 -0
  16. package/node_modules/@comis/core/package.json +1 -1
  17. package/node_modules/@comis/daemon/dist/daemon.js +3 -0
  18. package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +15 -3
  19. package/node_modules/@comis/daemon/package.json +1 -1
  20. package/node_modules/@comis/gateway/package.json +1 -1
  21. package/node_modules/@comis/infra/package.json +1 -1
  22. package/node_modules/@comis/memory/package.json +1 -1
  23. package/node_modules/@comis/scheduler/package.json +1 -1
  24. package/node_modules/@comis/shared/package.json +1 -1
  25. package/node_modules/@comis/skills/package.json +1 -1
  26. package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-ru-AhppM.js} +270 -270
  27. package/node_modules/@comis/web/dist/assets/agent-editor-hjwRuFVp.js +2173 -0
  28. package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-6Uotjatr.js} +170 -170
  29. package/node_modules/@comis/web/dist/assets/{approvals-q9VH_IKr.js → approvals-C-K6hN2U.js} +13 -13
  30. package/node_modules/@comis/web/dist/assets/billing-view-CxysXH0p.js +375 -0
  31. package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-BBCKtmne.js} +265 -265
  32. package/node_modules/@comis/web/dist/assets/channel-list-FkfeOLBQ.js +323 -0
  33. package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-BumBaIgO.js} +243 -246
  34. package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-C9BSwHGy.js} +477 -477
  35. package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-BHm00mJD.js} +105 -105
  36. package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-BENY3pWE.js} +136 -136
  37. package/node_modules/@comis/web/dist/assets/decorate-BvWYovGE.js +38 -0
  38. package/node_modules/@comis/web/dist/assets/{delivery-view-OfBZof-m.js → delivery-view-BCnkPsAp.js} +134 -134
  39. package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-C_jQFG2H.js} +82 -82
  40. package/node_modules/@comis/web/dist/assets/directive-BOYXJ-K-.js +1 -0
  41. package/node_modules/@comis/web/dist/assets/{extract-variables-BM5qyK-s.js → extract-variables-B7-Doo7l.js} +39 -39
  42. package/node_modules/@comis/web/dist/assets/{ic-array-editor-B7m6x7-S.js → ic-array-editor-BLoEyeLS.js} +29 -29
  43. package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js} +16 -16
  44. package/node_modules/@comis/web/dist/assets/{ic-budget-segment-bar-BtJ6x5mN.js → ic-budget-segment-bar-zLsMzjDO.js} +20 -20
  45. package/node_modules/@comis/web/dist/assets/ic-chat-message-FdQcZsSQ.js +352 -0
  46. package/node_modules/@comis/web/dist/assets/{ic-confirm-dialog-CCDbB04e.js → ic-confirm-dialog-DGlPbV1T.js} +26 -26
  47. package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CnT1b8xr.js → ic-connection-dot-BgYiK2N4.js} +13 -13
  48. package/node_modules/@comis/web/dist/assets/ic-data-table-CKIvr-ag.js +277 -0
  49. package/node_modules/@comis/web/dist/assets/ic-delivery-row-B3YwjjuM.js +67 -0
  50. package/node_modules/@comis/web/dist/assets/{ic-detail-panel-BF83r-if.js → ic-detail-panel-DiCe4hLr.js} +27 -27
  51. package/node_modules/@comis/web/dist/assets/{ic-empty-state-60l2ePhd.js → ic-empty-state-CM3Wbj2f.js} +19 -19
  52. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-ByRjij68.js +359 -0
  53. package/node_modules/@comis/web/dist/assets/ic-icon-BGNCCPpZ.js +33 -0
  54. package/node_modules/@comis/web/dist/assets/{ic-layer-waterfall-COvEYMg5.js → ic-layer-waterfall-WkaFyu-l.js} +18 -18
  55. package/node_modules/@comis/web/dist/assets/ic-relative-time-B3UAnTqg.js +12 -0
  56. package/node_modules/@comis/web/dist/assets/{ic-search-input-CSOxY9g7.js → ic-search-input-B02AGw1i.js} +22 -22
  57. package/node_modules/@comis/web/dist/assets/{ic-select-Ce-Raudx.js → ic-select-BqfZISjw.js} +29 -29
  58. package/node_modules/@comis/web/dist/assets/ic-tabs-yBjkWKJH.js +95 -0
  59. package/node_modules/@comis/web/dist/assets/ic-tag-CvMVQFRR.js +33 -0
  60. package/node_modules/@comis/web/dist/assets/{ic-time-range-picker-CypCT68y.js → ic-time-range-picker-DXbYeBmY.js} +31 -31
  61. package/node_modules/@comis/web/dist/assets/{ic-tool-call-7MaXSsCW.js → ic-tool-call-DMPHsLyx.js} +51 -51
  62. package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
  63. package/node_modules/@comis/web/dist/assets/index-FLPhHz8p.js +2792 -0
  64. package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-5jyScQis.js} +209 -209
  65. package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-J9oT9PPs.js} +154 -154
  66. package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-DGTCtM8-.js} +259 -259
  67. package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-D5Re9ptG.js} +450 -450
  68. package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-cRLK6ZmG.js} +290 -290
  69. package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-D5vu07MR.js} +371 -371
  70. package/node_modules/@comis/web/dist/assets/observability-types-D0tkwElU.js +1 -0
  71. package/node_modules/@comis/web/dist/assets/{observe-view-C0VBhX4C.js → observe-view-CalNNEmd.js} +399 -399
  72. package/node_modules/@comis/web/dist/assets/pipeline-builder-DUYDGwZf.js +1495 -0
  73. package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-BAO8brOe.js} +124 -124
  74. package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-DectIoQt.js} +65 -65
  75. package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-BHlaBKww.js} +227 -227
  76. package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-BhtpNEHf.js} +298 -298
  77. package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-VafN_8xi.js} +486 -486
  78. package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-QQXMRTlo.js} +389 -389
  79. package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BpZ_8Yih.js} +294 -294
  80. package/node_modules/@comis/web/dist/assets/session-key-parser-Dkqcj2Ss.js +1 -0
  81. package/node_modules/@comis/web/dist/assets/session-list-DfCm8Cec.js +231 -0
  82. package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-C-z477CG.js} +486 -494
  83. package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-BCOGPf6s.js} +329 -329
  84. package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-l-auUraL.js} +74 -74
  85. package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-DlvBixiq.js} +236 -236
  86. package/node_modules/@comis/web/dist/index.html +3 -2
  87. package/node_modules/@comis/web/package.json +1 -1
  88. package/package.json +15 -15
  89. package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +0 -2173
  90. package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +0 -375
  91. package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +0 -323
  92. package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +0 -1
  93. package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +0 -352
  94. package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +0 -277
  95. package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +0 -67
  96. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +0 -359
  97. package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +0 -33
  98. package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +0 -12
  99. package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +0 -95
  100. package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +0 -33
  101. package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +0 -2830
  102. package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +0 -1
  103. package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +0 -1
  104. package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +0 -1496
  105. package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +0 -1
  106. package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +0 -231
@@ -0,0 +1,2792 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-console-BumBaIgO.js","assets/decorate-BvWYovGE.js","assets/ic-chat-message-FdQcZsSQ.js","assets/directive-BOYXJ-K-.js","assets/ic-icon-BGNCCPpZ.js","assets/ic-budget-segment-bar-zLsMzjDO.js","assets/ic-relative-time-B3UAnTqg.js","assets/ic-tag-CvMVQFRR.js","assets/ic-tool-call-DMPHsLyx.js","assets/ic-empty-state-CM3Wbj2f.js","assets/ic-search-input-B02AGw1i.js","assets/session-key-parser-Dkqcj2Ss.js","assets/memory-inspector-D5Re9ptG.js","assets/ic-data-table-CKIvr-ag.js","assets/ic-confirm-dialog-DGlPbV1T.js","assets/ic-detail-panel-DiCe4hLr.js","assets/agent-list-6Uotjatr.js","assets/agent-detail-ru-AhppM.js","assets/ic-breadcrumb-DqN6G3gc.js","assets/agent-editor-hjwRuFVp.js","assets/ic-array-editor-BLoEyeLS.js","assets/workspace-manager-DlvBixiq.js","assets/skills-BCOGPf6s.js","assets/ic-tabs-yBjkWKJH.js","assets/mcp-management-5jyScQis.js","assets/models-D5vu07MR.js","assets/ic-connection-dot-BgYiK2N4.js","assets/channel-list-FkfeOLBQ.js","assets/channel-detail-BBCKtmne.js","assets/message-center-cRLK6ZmG.js","assets/scheduler-VafN_8xi.js","assets/session-list-DfCm8Cec.js","assets/session-detail-BpZ_8Yih.js","assets/ic-layer-waterfall-WkaFyu-l.js","assets/observe-view-CalNNEmd.js","assets/observability-types-D0tkwElU.js","assets/ic-delivery-row-B3YwjjuM.js","assets/context-engine-BENY3pWE.js","assets/billing-view-CxysXH0p.js","assets/ic-time-range-picker-DXbYeBmY.js","assets/delivery-view-BCnkPsAp.js","assets/diagnostics-view-C_jQFG2H.js","assets/subagents-l-auUraL.js","assets/security-QQXMRTlo.js","assets/ic-select-BqfZISjw.js","assets/approvals-C-K6hN2U.js","assets/config-editor-C9BSwHGy.js","assets/setup-wizard-C-z477CG.js","assets/pipeline-list-BHlaBKww.js","assets/extract-variables-B7-Doo7l.js","assets/pipeline-builder-DUYDGwZf.js","assets/ic-graph-canvas-ByRjij68.js","assets/pipeline-monitor-BhtpNEHf.js","assets/pipeline-history-BAO8brOe.js","assets/pipeline-history-detail-DectIoQt.js","assets/context-dag-browser-BHm00mJD.js","assets/media-test-DGTCtM8-.js","assets/media-config-J9oT9PPs.js"])))=>i.map(i=>d[i]);
2
+ import{c as e,f as t,h as n,i as r,l as i,m as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./decorate-BvWYovGE.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function f(e,t,n){let r={Authorization:`Bearer ${t}`,"Content-Type":`application/json`};async function i(t,n){let i=`${e}${t}`,a=await fetch(i,{...n,headers:{...r,...n?.headers}});if(!a.ok){let e=await a.text(),t=(e.length>200?e.slice(0,200)+`...`:e).replace(/https?:\/\/[^\s"')]+/g,`[URL]`).replace(/[A-Za-z0-9_-]{20,}/g,`[REDACTED]`);throw Error(`Request failed (${a.status}): ${t}`)}return a.json()}async function a(t,n){let i=`${e}${t}`,a=await fetch(i,{...n,headers:{...r,...n?.headers}});if(!a.ok){let e=await a.text(),t=(e.length>200?e.slice(0,200)+`...`:e).replace(/https?:\/\/[^\s"')]+/g,`[URL]`).replace(/[A-Za-z0-9_-]{20,}/g,`[REDACTED]`);throw Error(`Request failed (${a.status}): ${t}`)}return a.text()}return{async getAgents(){let e=await i(`/api/agents`),t=e.agents??e.routing?.agents??[];return Array.isArray(t)?t:Object.entries(e).map(([e,t])=>({id:e,provider:t.provider??`unknown`,model:t.model??`unknown`,status:`active`}))},async getChannels(){let e=await i(`/api/channels`),t=e.channels??[];return Array.isArray(t)?t:Object.entries(e).map(([e,t])=>({type:t.type??e,name:e,enabled:t.enabled??!1,status:t.enabled?`healthy`:`disconnected`}))},async getActivity(e=50){return(await i(`/api/activity?limit=${e}`)).entries??[]},async searchMemory(e,t=10){return(await i(`/api/memory/search?q=${encodeURIComponent(e)}&limit=${t}`)).results??[]},async getMemoryStats(){return i(`/api/memory/stats`)},async chat(e,t,n){return i(`/api/chat`,{method:`POST`,body:JSON.stringify({message:e,agentId:t,sessionKey:n})})},async getChatHistory(){return(await i(`/api/chat/history`)).messages??[]},async health(){return(await fetch(`${e}/api/health`)).json()},subscribeEvents(n){let r=`${e}/api/events?token=${encodeURIComponent(t)}`,i=new EventSource(r);i.onmessage=e=>{try{n(`message`,JSON.parse(e.data))}catch{n(`message`,e.data)}};for(let e of[`message:received`,`message:sent`,`message:streaming`,`session:created`,`session:expired`,`audit:event`,`skill:executed`,`scheduler:job_completed`,`scheduler:heartbeat_check`,`system:error`,`ping`])i.addEventListener(e,(t=>{try{n(e,t.data?JSON.parse(t.data):{})}catch{n(e,t.data)}}));return i.onerror=()=>{n(`error`,{message:`SSE connection error`})},()=>{i.close()}},async browseMemory(e){if(n)return n(`memory.browse`,e);let t=new URLSearchParams;e.offset!==void 0&&t.set(`offset`,String(e.offset)),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.type&&t.set(`type`,e.type),e.trust&&t.set(`trust`,e.trust),e.agentId&&t.set(`agentId`,e.agentId),e.from!==void 0&&t.set(`from`,String(e.from)),e.to!==void 0&&t.set(`to`,String(e.to));let r=t.toString();return i(`/api/memory/browse${r?`?${r}`:``}`)},async deleteMemory(e){if(n){await n(`memory.delete`,{id:e});return}await i(`/api/memory/${encodeURIComponent(e)}`,{method:`DELETE`})},async deleteMemoryBulk(e){return n?n(`memory.delete`,{ids:e}):i(`/api/memory/bulk-delete`,{method:`POST`,body:JSON.stringify({ids:e})})},async exportMemory(e){return n?n(`memory.export`,e?{ids:e}:{}):a(`/api/memory/export`,{method:`POST`,body:JSON.stringify({ids:e})})},async listSessions(e){if(n)return((await n(`session.list`,e??{})).sessions??[]).map(e=>{let t=String(e.sessionKey??e.key??``),n=`unknown`,r=t.split(`:`);return r[0]===`agent`&&r.length>=3&&(n=r[1]??`unknown`),{key:t,agentId:String(e.agentId??n),channelType:String(e.kind??e.channelType??`unknown`),messageCount:Number(e.messageCount??0),totalTokens:Number(e.totalTokens??0),inputTokens:Number(e.inputTokens??0),outputTokens:Number(e.outputTokens??0),toolCalls:Number(e.toolCalls??0),compactions:Number(e.compactions??0),resetCount:Number(e.resetCount??0),createdAt:Number(e.createdAt??Date.now()),lastActiveAt:Number(e.updatedAt??e.lastActiveAt??Date.now())}});let t=new URLSearchParams;e?.agentId&&t.set(`agentId`,e.agentId),e?.channelType&&t.set(`channelType`,e.channelType),e?.search&&t.set(`search`,e.search);let r=t.toString();return i(`/api/sessions${r?`?${r}`:``}`)},async getSessionDetail(e){return n?n(`session.history`,{session_key:e}):i(`/api/sessions/${encodeURIComponent(e)}`)},async resetSession(e){if(n){await n(`session.reset`,{session_key:e});return}await i(`/api/sessions/${encodeURIComponent(e)}/reset`,{method:`POST`})},async compactSession(e){if(n){await n(`session.compact`,{session_key:e});return}await i(`/api/sessions/${encodeURIComponent(e)}/compact`,{method:`POST`})},async deleteSession(e){if(n){await n(`session.delete`,{session_key:e});return}await i(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})},async exportSession(e){return n?n(`session.export`,{session_key:e}):a(`/api/sessions/${encodeURIComponent(e)}/export`)},async resetSessionsBulk(e){return n?n(`session.reset`,{keys:e}):i(`/api/sessions/bulk-reset`,{method:`POST`,body:JSON.stringify({keys:e})})},async exportSessionsBulk(e){return n?n(`session.export`,{keys:e}):a(`/api/sessions/bulk-export`,{method:`POST`,body:JSON.stringify({keys:e})})},async deleteSessionsBulk(e){return n?n(`session.delete`,{keys:e}):i(`/api/sessions/bulk-delete`,{method:`POST`,body:JSON.stringify({keys:e})})}}}var p=[{pattern:`dashboard`,view:`ic-dashboard`},{pattern:`agents`,view:`ic-agent-list`},{pattern:`agents/:id`,view:`ic-agent-detail`},{pattern:`agents/:id/edit`,view:`ic-agent-editor`},{pattern:`agents/:id/workspace`,view:`ic-workspace-manager`},{pattern:`channels`,view:`ic-channel-list`},{pattern:`channels/:type`,view:`ic-channel-detail`},{pattern:`messages`,view:`ic-message-center`},{pattern:`messages/:type`,view:`ic-message-center`},{pattern:`skills`,view:`ic-skills-view`},{pattern:`mcp`,view:`ic-mcp-management`},{pattern:`chat`,view:`ic-chat-console`},{pattern:`chat/:sessionKey`,view:`ic-chat-console`},{pattern:`memory`,view:`ic-memory-inspector`},{pattern:`sessions`,view:`ic-session-list-view`},{pattern:`sessions/:key`,view:`ic-session-detail`},{pattern:`scheduler`,view:`ic-scheduler-view`},{pattern:`scheduler/:jobId`,view:`ic-scheduler-view`},{pattern:`models`,view:`ic-models-view`},{pattern:`observe/overview`,view:`ic-observe-dashboard`},{pattern:`observe/context`,view:`ic-context-engine-view`},{pattern:`observe/billing`,view:`ic-billing-view`},{pattern:`observe/delivery`,view:`ic-delivery-view`},{pattern:`observe/diagnostics`,view:`ic-diagnostics-view`},{pattern:`context`,view:`ic-context-dag-browser`},{pattern:`subagents`,view:`ic-subagents-view`},{pattern:`media`,view:`ic-media-test-view`},{pattern:`media/config`,view:`ic-media-config-view`},{pattern:`security`,view:`ic-security-view`},{pattern:`approvals`,view:`ic-approvals-view`},{pattern:`config`,view:`ic-config-editor`},{pattern:`setup`,view:`ic-setup-wizard`},{pattern:`pipelines`,view:`ic-pipeline-list`},{pattern:`pipelines/new`,view:`ic-pipeline-builder`},{pattern:`pipelines/history`,view:`ic-pipeline-history`},{pattern:`pipelines/history/:graphId`,view:`ic-pipeline-history-detail`},{pattern:`pipelines/:graphId`,view:`ic-pipeline-monitor`},{pattern:`pipelines/:graphId/edit`,view:`ic-pipeline-builder`}];function m(){return p.map(e=>{let t=e.pattern.split(`/`);return{pattern:e.pattern,view:e.view,segments:t,segmentCount:t.length}}).sort((e,t)=>t.segmentCount-e.segmentCount)}var h={view:`ic-dashboard`,route:`dashboard`,params:{},query:{}};function g(e,t){let n=e.split(`/`);for(let e of t){if(n.length!==e.segmentCount)continue;let t={},r=!0;for(let i=0;i<e.segments.length;i++){let a=e.segments[i],o=n[i];if(a.startsWith(`:`))t[a.slice(1)]=o;else if(a!==o){r=!1;break}}if(r)return{view:e.view,route:e.pattern,params:t,query:{}}}return null}var _=[{from:`observe`,to:`observe/overview`}];function v(e,t=`dashboard`){let n=m();function r(){let e=window.location.hash.replace(/^#\/?/,``);if(!e)return{...h};let t=e.indexOf(`?`),r=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):``,a={};if(i)for(let e of i.split(`&`)){let t=e.indexOf(`=`);if(t>=0){let n=decodeURIComponent(e.slice(0,t)),r=decodeURIComponent(e.slice(t+1));n&&(a[n]=r)}else e&&(a[decodeURIComponent(e)]=``)}for(let e of _)if(r===e.from){let t=i?`#/${e.to}?${i}`:`#/${e.to}`;history.replaceState(null,``,t);let r=g(e.to,n);return r?{...r,query:a}:{...h,query:a}}let o=g(r,n);return o?{...o,query:a}:{...h,query:a}}function i(){e(r())}return{navigate(e){window.location.hash=`#/${e}`},current(){return r()},start(){window.addEventListener(`hashchange`,i),i()},stop(){window.removeEventListener(`hashchange`,i)},setQuery(e){let t=r(),n={...t.query,...e},i=Object.entries(n).filter(([,e])=>e!==``).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`),a=i?`#/${t.route}?${i}`:`#/${t.route}`;history.replaceState(null,``,a)}}}var y=3e4,ee=3e4,te=1e4,ne=1e3,re=3e4,ie=10;function b(){let e=null,t=`disconnected`,n=1,r=0,i=null,a=null,o=null,s=``,c=``,l=!1,u=new Map,d=new Set,f=new Set;function p(e){if(t!==e){t=e;for(let t of d)t(e)}}function m(){a!==null&&(clearInterval(a),a=null),o!==null&&(clearTimeout(o),o=null)}function h(){i!==null&&(clearTimeout(i),i=null)}function g(e){for(let[t,n]of u)clearTimeout(n.timer),n.reject(Error(e)),u.delete(t)}function _(){m(),a=setInterval(()=>{if(e===null||e.readyState!==globalThis.WebSocket.OPEN)return;let t=n++;e.send(JSON.stringify({jsonrpc:`2.0`,method:`system.ping`,id:t})),o=setTimeout(()=>{u.delete(t),e!==null&&e.close()},te),u.set(t,{resolve:()=>{o!==null&&(clearTimeout(o),o=null)},reject:()=>{o!==null&&(clearTimeout(o),o=null)},timer:setTimeout(()=>{u.delete(t)},y)})},ee)}function v(){if(l)return;if(r>=ie){p(`disconnected`);return}p(`reconnecting`);let e=Math.min(ne*2**r,re);r++,i=setTimeout(()=>{b(s,c)},e)}function b(t,n){let i=`${t}?token=${encodeURIComponent(n)}`;e=new globalThis.WebSocket(i),e.onopen=()=>{r=0,p(`connected`),_()},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!(t.method===`heartbeat`&&t.id==null)){if(t.method&&t.id==null){console.debug(`[rpc] notification received:`,t.method);for(let e of f)try{e(t.method,t.params)}catch(e){console.warn(`[rpc] notification handler error:`,e)}return}if(t.id!=null){let e=u.get(t.id);e&&(clearTimeout(e.timer),u.delete(t.id),t.error?e.reject(Error(`RPC error (${t.error.code}): ${t.error.message}`)):e.resolve(t.result))}}},e.onclose=t=>{if(m(),e=null,t.code>=4e3&&t.code<5e3){g(`Connection rejected: `+(t.reason||`auth error`)),p(`disconnected`);return}l||v()},e.onerror=()=>{}}return{get status(){return t},connect(e,t){l=!1,s=e,c=t,r=0,b(e,t)},disconnect(){l=!0,h(),m(),g(`Client disconnected`),p(`disconnected`),e!==null&&(e.close(),e=null)},call(t,r){return new Promise((i,a)=>{if(e===null||e.readyState!==globalThis.WebSocket.OPEN){a(Error(`Not connected`));return}let o=n++,s=setTimeout(()=>{u.delete(o),a(Error(`RPC request timed out after ${y}ms`))},y);u.set(o,{resolve:i,reject:a,timer:s});let c=JSON.stringify({jsonrpc:`2.0`,method:t,...r===void 0?{}:{params:r},id:o});try{e.send(c)}catch(e){clearTimeout(s),u.delete(o),a(Error(`Send failed: `+(e instanceof Error?e.message:String(e))))}})},onStatusChange(e){return d.add(e),()=>{d.delete(e)}},onNotification(e){return f.add(e),()=>{f.delete(e)}}}}function ae(){let e={connectionStatus:`disconnected`,pendingApprovals:0,errorCount:0,agentCount:0,channelCount:0,sessionCount:0,systemHealth:null,activeAgents:[],activeChannels:[]},t=new Set;function n(){for(let e of t)e()}return{get connectionStatus(){return e.connectionStatus},get pendingApprovals(){return e.pendingApprovals},get errorCount(){return e.errorCount},get agentCount(){return e.agentCount},get channelCount(){return e.channelCount},get sessionCount(){return e.sessionCount},get systemHealth(){return e.systemHealth},get activeAgents(){return e.activeAgents},get activeChannels(){return e.activeChannels},subscribe(e){return t.add(e),()=>{t.delete(e)}},getSnapshot(){return Object.freeze({...e})},update(t){e={...e,...t},n()}}}var oe=`message:received.message:sent.message:streaming.session:created.session:expired.audit:event.skill:executed.skill:rejected.observability:metrics.observability:token_usage.scheduler:job_started.scheduler:job_completed.scheduler:heartbeat_check.scheduler:heartbeat_alert.scheduler:heartbeat_delivered.scheduler:task_extracted.system:error.approval:requested.approval:resolved.graph:started.graph:node_updated.graph:completed.config:patched.diagnostic:channel_health.diagnostic:billing_snapshot.skill:loaded.skill:registry_reset.model:catalog_loaded.observability:reset.channel:registered.channel:deregistered.agent:hot_added.agent:hot_removed.security:injection_detected.security:injection_rate_exceeded.security:memory_tainted.security:warn.secret:accessed.secret:modified.model:fallback_attempt.model:fallback_exhausted.model:auth_cooldown.provider:degraded.provider:recovered.session:sub_agent_spawned.session:sub_agent_completed.session:sub_agent_archived.session:sub_agent_spawn_rejected.session:sub_agent_spawn_started.session:sub_agent_spawn_queued.session:sub_agent_lifecycle_ended.ping`.split(`.`);function se(){let e=null,t=!1,n=new Map;function r(e){if(!e)return{};try{return JSON.parse(e)}catch{return e}}function i(e,t){let r=n.get(e);if(r)for(let e of r)e(t);document.dispatchEvent(new CustomEvent(e,{detail:t}))}return{get connected(){return t},start(n,a){e!==null&&e.close();let o=`${n}/api/events?token=${encodeURIComponent(a)}`;e=new EventSource(o),e.onopen=()=>{t=!0},e.onerror=()=>{t=!1};for(let t of oe)e.addEventListener(t,(e=>{i(t,r(e.data))}));e.onmessage=e=>{i(`message`,r(e.data))}},stop(){e!==null&&(e.close(),e=null),t=!1,n.clear()},addEventListener(e,t){return n.has(e)||n.set(e,new Set),n.get(e).add(t),()=>{let r=n.get(e);r&&(r.delete(t),r.size===0&&n.delete(e))}}}}var ce=class{constructor(e,t,n,r=3e4){this._timer=null,this._host=e,this._rpcClient=t,this._onData=n,this._intervalMs=r,this._host.addController(this)}hostConnected(){this._poll(),this._timer=setInterval(()=>this._poll(),this._intervalMs)}hostDisconnected(){this._timer!==null&&(clearInterval(this._timer),this._timer=null)}async _poll(){try{let[e,t,n]=await Promise.all([this._rpcClient.call(`agent.list`),this._rpcClient.call(`channel.list`),this._rpcClient.call(`session.list`,{})]);this._onData({agents:e.agents.length,channels:t.channels.length,sessions:n.total,agentIds:e.agents,sessionEntries:n.sessions?.slice(0,20)??[]}),this._host.requestUpdate()}catch{}}},x=[{id:`home`,label:`Home`,items:[{route:`dashboard`,label:`Dashboard`,icon:`▣`}]},{id:`operate`,label:`Operate`,items:[{route:`agents`,label:`Agents`,icon:`⬤`,badge:`agentCount`},{route:`channels`,label:`Channels`,icon:`◎`,badge:`channelCount`},{route:`messages`,label:`Messages`,icon:`○`},{route:`chat`,label:`Chat`,icon:`▬`},{route:`sessions`,label:`Sessions`,icon:`◷`,badge:`sessionCount`},{route:`subagents`,label:`Sub-Agents`,icon:`◔`},{route:`pipelines`,label:`Pipelines`,icon:`◈`}]},{id:`observe`,label:`Observe`,items:[{route:`observe`,label:`Overview`,icon:`△`,badge:`errorCount`},{route:`observe/context`,label:`Context Engine`,icon:`◥`},{route:`context`,label:`Context DAG`,icon:`◖`},{route:`observe/billing`,label:`Billing`,icon:`◇`},{route:`observe/delivery`,label:`Delivery`,icon:`▷`},{route:`observe/diagnostics`,label:`Diagnostics`,icon:`□`}]},{id:`configure`,label:`Configure`,items:[{route:`skills`,label:`Skills`,icon:`⚒`},{route:`mcp`,label:`MCP Servers`,icon:`⚖`},{route:`models`,label:`Models`,icon:`⌸`},{route:`memory`,label:`Memory`,icon:`◉`},{route:`scheduler`,label:`Scheduler`,icon:`▨`},{route:`security`,label:`Security`,icon:`☖`},{route:`media`,label:`Media`,icon:`▶`},{route:`approvals`,label:`Approvals`,icon:`✓`,badge:`pendingApprovals`},{route:`config`,label:`Config`,icon:`⚙`}]}],le={route:`setup`,label:`Setup`,icon:`▶`},S=`ic_sidebar_collapsed`,C=class extends i{constructor(...e){super(...e),this.currentRoute=`dashboard`,this.pendingApprovals=0,this.errorCount=0,this.agentCount=0,this.channelCount=0,this.sessionCount=0,this.open=!1,this._collapsed=!1}static{this.styles=[c,o,n`
3
+ :host {
4
+ display: block;
5
+ }
6
+
7
+ .sidebar {
8
+ display: flex;
9
+ flex-direction: column;
10
+ width: 240px;
11
+ height: 100vh;
12
+ background: var(--ic-surface);
13
+ border-right: 1px solid var(--ic-border);
14
+ position: sticky;
15
+ top: 0;
16
+ transition: width var(--ic-transition);
17
+ overflow: hidden;
18
+ }
19
+
20
+ .sidebar.collapsed {
21
+ width: 64px;
22
+ }
23
+
24
+ nav {
25
+ flex: 1;
26
+ display: flex;
27
+ flex-direction: column;
28
+ padding: var(--ic-space-sm) 0;
29
+ overflow-y: auto;
30
+ }
31
+
32
+ .section-header {
33
+ display: flex;
34
+ align-items: center;
35
+ padding: 6px 16px 4px;
36
+ font-size: 11px;
37
+ font-weight: 600;
38
+ text-transform: uppercase;
39
+ letter-spacing: 0.05em;
40
+ color: var(--ic-text-dim);
41
+ user-select: none;
42
+ margin-top: 4px;
43
+ }
44
+
45
+ .section-header:first-of-type {
46
+ margin-top: 0;
47
+ }
48
+
49
+ .collapsed .section-header {
50
+ justify-content: center;
51
+ padding: 6px 0;
52
+ }
53
+
54
+ .collapsed .section-label {
55
+ display: none;
56
+ }
57
+
58
+ .collapsed .section-header::after {
59
+ content: "";
60
+ display: block;
61
+ width: 16px;
62
+ height: 1px;
63
+ background: var(--ic-border);
64
+ }
65
+
66
+ .nav-item {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: var(--ic-space-sm);
70
+ padding: var(--ic-space-sm) var(--ic-space-md);
71
+ background: none;
72
+ border: none;
73
+ border-left: 3px solid transparent;
74
+ color: var(--ic-text-muted);
75
+ cursor: pointer;
76
+ font-family: inherit;
77
+ font-size: var(--ic-text-sm);
78
+ width: 100%;
79
+ text-align: left;
80
+ transition: color var(--ic-transition), background var(--ic-transition),
81
+ border-color var(--ic-transition);
82
+ white-space: nowrap;
83
+ }
84
+
85
+ .nav-item:hover {
86
+ color: var(--ic-text);
87
+ background: var(--ic-surface-2);
88
+ }
89
+
90
+ .nav-item[aria-current="page"] {
91
+ color: var(--ic-accent);
92
+ background: rgba(59, 130, 246, 0.1);
93
+ border-left-color: var(--ic-accent);
94
+ }
95
+
96
+ .nav-icon {
97
+ display: inline-flex;
98
+ align-items: center;
99
+ justify-content: center;
100
+ width: 20px;
101
+ height: 20px;
102
+ font-size: 14px;
103
+ flex-shrink: 0;
104
+ }
105
+
106
+ .nav-label {
107
+ flex: 1;
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ }
111
+
112
+ .collapsed .nav-label {
113
+ display: none;
114
+ }
115
+
116
+ .badge {
117
+ display: inline-flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ min-width: 18px;
121
+ height: 18px;
122
+ padding: 0 5px;
123
+ border-radius: 9px;
124
+ font-size: 11px;
125
+ font-weight: 600;
126
+ color: white;
127
+ background: var(--ic-error);
128
+ flex-shrink: 0;
129
+ }
130
+
131
+ .collapsed .badge {
132
+ display: none;
133
+ }
134
+
135
+ .divider {
136
+ height: 1px;
137
+ background: var(--ic-border);
138
+ margin: var(--ic-space-sm) var(--ic-space-md);
139
+ }
140
+
141
+ .sidebar-footer {
142
+ padding: var(--ic-space-sm);
143
+ border-top: 1px solid var(--ic-border);
144
+ }
145
+
146
+ .collapse-btn {
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ width: 100%;
151
+ padding: var(--ic-space-sm);
152
+ background: none;
153
+ border: none;
154
+ color: var(--ic-text-dim);
155
+ cursor: pointer;
156
+ font-family: inherit;
157
+ font-size: var(--ic-text-sm);
158
+ transition: color var(--ic-transition);
159
+ }
160
+
161
+ .collapse-btn:hover {
162
+ color: var(--ic-text);
163
+ }
164
+
165
+ .logout-btn {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: var(--ic-space-sm);
169
+ width: 100%;
170
+ padding: var(--ic-space-sm) var(--ic-space-md);
171
+ background: none;
172
+ border: none;
173
+ border-left: 3px solid transparent;
174
+ color: var(--ic-text-dim);
175
+ cursor: pointer;
176
+ font-family: inherit;
177
+ font-size: var(--ic-text-sm);
178
+ text-align: left;
179
+ transition: color var(--ic-transition);
180
+ }
181
+
182
+ .logout-btn:hover {
183
+ color: var(--ic-error);
184
+ }
185
+
186
+ .collapsed .logout-label {
187
+ display: none;
188
+ }
189
+
190
+ /* Mobile overlay */
191
+ .overlay {
192
+ display: none;
193
+ }
194
+
195
+ @media (max-width: 767px) {
196
+ .sidebar {
197
+ position: fixed;
198
+ z-index: 50;
199
+ left: 0;
200
+ top: 0;
201
+ transform: translateX(-100%);
202
+ transition: transform var(--ic-transition-slow);
203
+ }
204
+
205
+ :host([open]) .sidebar {
206
+ transform: translateX(0);
207
+ width: 240px;
208
+ }
209
+
210
+ :host([open]) .sidebar.collapsed {
211
+ width: 240px;
212
+ }
213
+
214
+ :host([open]) .collapsed .nav-label,
215
+ :host([open]) .collapsed .badge,
216
+ :host([open]) .collapsed .logout-label,
217
+ :host([open]) .collapsed .section-label {
218
+ display: inline;
219
+ }
220
+
221
+ :host([open]) .collapsed .section-header::after {
222
+ display: none;
223
+ }
224
+
225
+ :host([open]) .overlay {
226
+ display: block;
227
+ position: fixed;
228
+ inset: 0;
229
+ background: rgba(0, 0, 0, 0.5);
230
+ z-index: 49;
231
+ }
232
+ }
233
+
234
+ @media (min-width: 768px) and (max-width: 1023px) {
235
+ .sidebar:not(.collapsed) {
236
+ width: 64px;
237
+ }
238
+
239
+ .sidebar:not(.collapsed) .nav-label,
240
+ .sidebar:not(.collapsed) .badge,
241
+ .sidebar:not(.collapsed) .logout-label,
242
+ .sidebar:not(.collapsed) .section-label {
243
+ display: none;
244
+ }
245
+
246
+ .sidebar:not(.collapsed) .section-header {
247
+ justify-content: center;
248
+ padding: 6px 0;
249
+ }
250
+
251
+ .sidebar:not(.collapsed) .section-header::after {
252
+ content: "";
253
+ display: block;
254
+ width: 16px;
255
+ height: 1px;
256
+ background: var(--ic-border);
257
+ }
258
+ }
259
+ `]}connectedCallback(){super.connectedCallback();try{let e=localStorage.getItem(S);e!==null&&(this._collapsed=JSON.parse(e))}catch{}}_isActive(e){if(this.currentRoute===e)return!0;if(!this.currentRoute.startsWith(e+`/`))return!1;for(let t of x)for(let n of t.items)if(n.route.length>e.length&&(this.currentRoute===n.route||this.currentRoute.startsWith(n.route+`/`)))return!1;return!0}_navigate(e){this.dispatchEvent(new CustomEvent(`navigate`,{detail:e}))}_logout(){this.dispatchEvent(new CustomEvent(`logout`))}_toggleCollapse(){this._collapsed=!this._collapsed;try{localStorage.setItem(S,JSON.stringify(this._collapsed))}catch{}}_closeOverlay(){this.dispatchEvent(new CustomEvent(`close`))}_getBadgeValue(e){switch(e.badge){case`pendingApprovals`:return this.pendingApprovals;case`errorCount`:return this.errorCount;case`agentCount`:return this.agentCount;case`channelCount`:return this.channelCount;case`sessionCount`:return this.sessionCount;default:return 0}}_renderNavItem(e){let n=this._isActive(e.route),r=this._getBadgeValue(e);return t`
260
+ <button
261
+ class="nav-item"
262
+ aria-current=${n?`page`:d}
263
+ @click=${()=>this._navigate(e.route)}
264
+ >
265
+ <span class="nav-icon">${e.icon}</span>
266
+ <span class="nav-label">${e.label}</span>
267
+ ${r>0?t`<span class="badge">${r}</span>`:d}
268
+ </button>
269
+ `}render(){return t`
270
+ <div class="overlay" @click=${this._closeOverlay}></div>
271
+ <div class="sidebar ${this._collapsed?`collapsed`:``}">
272
+ <nav role="navigation" aria-label="Main navigation">
273
+ ${x.map(e=>t`
274
+ <div class="section-header">
275
+ <span class="section-label">${e.label}</span>
276
+ </div>
277
+ ${e.items.map(e=>this._renderNavItem(e))}
278
+ `)}
279
+ <div class="divider"></div>
280
+ ${this._renderNavItem(le)}
281
+ </nav>
282
+ <div class="sidebar-footer">
283
+ <button
284
+ class="logout-btn"
285
+ @click=${this._logout}
286
+ aria-label="Logout"
287
+ >
288
+ <span class="nav-icon">\u2BBB</span>
289
+ <span class="logout-label">Logout</span>
290
+ </button>
291
+ <button
292
+ class="collapse-btn"
293
+ @click=${this._toggleCollapse}
294
+ aria-label=${this._collapsed?`Expand sidebar`:`Collapse sidebar`}
295
+ >
296
+ ${this._collapsed?`»`:`«`}
297
+ </button>
298
+ </div>
299
+ </div>
300
+ `}};u([l()],C.prototype,`currentRoute`,void 0),u([l({type:Number})],C.prototype,`pendingApprovals`,void 0),u([l({type:Number})],C.prototype,`errorCount`,void 0),u([l({type:Number})],C.prototype,`agentCount`,void 0),u([l({type:Number})],C.prototype,`channelCount`,void 0),u([l({type:Number})],C.prototype,`sessionCount`,void 0),u([l({type:Boolean,reflect:!0})],C.prototype,`open`,void 0),u([s()],C.prototype,`_collapsed`,void 0),C=u([e(`ic-sidebar`)],C);var w=class extends i{constructor(...e){super(...e),this.connectionStatus=`disconnected`,this.notificationCount=0,this.sidebarCollapsed=!1,this.tokenId=``,this._menuOpen=!1,this._boundCloseMenu=this._closeMenuOnOutsideClick.bind(this)}static{this.styles=[c,o,n`
301
+ :host {
302
+ display: block;
303
+ }
304
+
305
+ .topbar {
306
+ display: flex;
307
+ align-items: center;
308
+ height: 48px;
309
+ padding: 0 var(--ic-space-md);
310
+ background: var(--ic-surface);
311
+ border-bottom: 1px solid var(--ic-border);
312
+ }
313
+
314
+ .hamburger {
315
+ display: none;
316
+ align-items: center;
317
+ justify-content: center;
318
+ width: 32px;
319
+ height: 32px;
320
+ padding: 0;
321
+ margin-right: var(--ic-space-sm);
322
+ background: none;
323
+ border: none;
324
+ color: var(--ic-text-muted);
325
+ cursor: pointer;
326
+ font-size: 18px;
327
+ }
328
+
329
+ .hamburger:hover {
330
+ color: var(--ic-text);
331
+ }
332
+
333
+ @media (max-width: 767px) {
334
+ .hamburger {
335
+ display: flex;
336
+ }
337
+ }
338
+
339
+ .brand {
340
+ font-size: 1.125rem;
341
+ font-weight: 700;
342
+ color: var(--ic-text);
343
+ display: flex;
344
+ align-items: center;
345
+ gap: var(--ic-space-xs);
346
+ }
347
+
348
+ .brand-icon {
349
+ width: 80px;
350
+ height: 32px;
351
+ object-fit: contain;
352
+ }
353
+
354
+ .spacer {
355
+ flex: 1;
356
+ }
357
+
358
+ .status-area {
359
+ display: flex;
360
+ align-items: center;
361
+ gap: var(--ic-space-md);
362
+ }
363
+
364
+ /* Connection status */
365
+ .connection {
366
+ display: flex;
367
+ align-items: center;
368
+ gap: var(--ic-space-xs);
369
+ }
370
+
371
+ .connection-dot {
372
+ width: 8px;
373
+ height: 8px;
374
+ border-radius: 50%;
375
+ flex-shrink: 0;
376
+ }
377
+
378
+ .connection-dot.connected {
379
+ background: var(--ic-success);
380
+ }
381
+
382
+ .connection-dot.reconnecting {
383
+ background: var(--ic-warning);
384
+ animation: pulse 1.5s ease-in-out infinite;
385
+ }
386
+
387
+ .connection-dot.disconnected {
388
+ background: var(--ic-error);
389
+ }
390
+
391
+ @keyframes pulse {
392
+ 0%, 100% { opacity: 1; }
393
+ 50% { opacity: 0.4; }
394
+ }
395
+
396
+ .connection-text {
397
+ font-size: var(--ic-text-xs);
398
+ color: var(--ic-text-dim);
399
+ }
400
+
401
+ /* Notification bell */
402
+ .bell-btn {
403
+ position: relative;
404
+ display: flex;
405
+ align-items: center;
406
+ justify-content: center;
407
+ width: 32px;
408
+ height: 32px;
409
+ padding: 0;
410
+ background: none;
411
+ border: none;
412
+ color: var(--ic-text-muted);
413
+ cursor: pointer;
414
+ font-size: 16px;
415
+ }
416
+
417
+ .bell-btn:hover {
418
+ color: var(--ic-text);
419
+ }
420
+
421
+ .bell-badge {
422
+ position: absolute;
423
+ top: 2px;
424
+ right: 2px;
425
+ min-width: 14px;
426
+ height: 14px;
427
+ padding: 0 3px;
428
+ border-radius: 7px;
429
+ font-size: 10px;
430
+ font-weight: 600;
431
+ color: white;
432
+ background: var(--ic-error);
433
+ display: flex;
434
+ align-items: center;
435
+ justify-content: center;
436
+ }
437
+
438
+ /* User menu */
439
+ .user-menu {
440
+ position: relative;
441
+ }
442
+
443
+ .avatar-btn {
444
+ display: flex;
445
+ align-items: center;
446
+ justify-content: center;
447
+ width: 32px;
448
+ height: 32px;
449
+ padding: 0;
450
+ border-radius: 50%;
451
+ background: var(--ic-surface-2);
452
+ border: 1px solid var(--ic-border);
453
+ color: var(--ic-text-muted);
454
+ cursor: pointer;
455
+ font-family: inherit;
456
+ font-size: var(--ic-text-xs);
457
+ font-weight: 600;
458
+ }
459
+
460
+ .avatar-btn:hover {
461
+ border-color: var(--ic-accent);
462
+ color: var(--ic-text);
463
+ }
464
+
465
+ .dropdown {
466
+ position: absolute;
467
+ top: 100%;
468
+ right: 0;
469
+ margin-top: var(--ic-space-xs);
470
+ min-width: 180px;
471
+ background: var(--ic-surface);
472
+ border: 1px solid var(--ic-border);
473
+ border-radius: var(--ic-radius-md);
474
+ box-shadow: var(--ic-shadow-lg);
475
+ z-index: 100;
476
+ padding: var(--ic-space-sm) 0;
477
+ }
478
+
479
+ .dropdown-info {
480
+ padding: var(--ic-space-sm) var(--ic-space-md);
481
+ font-size: var(--ic-text-xs);
482
+ color: var(--ic-text-dim);
483
+ white-space: nowrap;
484
+ overflow: hidden;
485
+ text-overflow: ellipsis;
486
+ }
487
+
488
+ .dropdown-divider {
489
+ height: 1px;
490
+ background: var(--ic-border);
491
+ margin: var(--ic-space-xs) 0;
492
+ }
493
+
494
+ .dropdown-action {
495
+ display: block;
496
+ width: 100%;
497
+ padding: var(--ic-space-sm) var(--ic-space-md);
498
+ background: none;
499
+ border: none;
500
+ color: var(--ic-text-muted);
501
+ cursor: pointer;
502
+ font-family: inherit;
503
+ font-size: var(--ic-text-sm);
504
+ text-align: left;
505
+ }
506
+
507
+ .dropdown-action:hover {
508
+ background: var(--ic-surface-2);
509
+ color: var(--ic-error);
510
+ }
511
+ `]}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this._boundCloseMenu)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`click`,this._boundCloseMenu)}_closeMenuOnOutsideClick(e){let t=e.composedPath();this._menuOpen&&!t.includes(this)&&(this._menuOpen=!1)}_toggleSidebar(){this.dispatchEvent(new CustomEvent(`toggle-sidebar`))}_toggleMenu(){this._menuOpen=!this._menuOpen}_logout(){this._menuOpen=!1,this.dispatchEvent(new CustomEvent(`logout`))}_getAvatarText(){return this.tokenId&&this.tokenId.length>=2?this.tokenId.slice(0,2).toUpperCase():`OP`}_getStatusText(){switch(this.connectionStatus){case`connected`:return`Connected`;case`reconnecting`:return`Reconnecting`;case`disconnected`:return`Disconnected`;default:return`Unknown`}}render(){return t`
512
+ <div class="topbar">
513
+ <button
514
+ class="hamburger"
515
+ @click=${this._toggleSidebar}
516
+ aria-label="Toggle navigation"
517
+ >
518
+ \u2630
519
+ </button>
520
+ <div class="brand">
521
+ <img class="brand-icon" src="${`/app/`}comis-logo.png" alt="Comis" />
522
+ </div>
523
+ <div class="spacer"></div>
524
+ <aside role="complementary" aria-label="System status">
525
+ <div class="status-area">
526
+ <div class="connection" aria-live="polite">
527
+ <span class="connection-dot ${this.connectionStatus}"></span>
528
+ <span class="connection-text">${this._getStatusText()}</span>
529
+ </div>
530
+ <button
531
+ class="bell-btn"
532
+ aria-label="Notifications${this.notificationCount>0?`, ${this.notificationCount} pending`:``}"
533
+ >
534
+ \u{1F514}
535
+ ${this.notificationCount>0?t`<span class="bell-badge">${this.notificationCount}</span>`:d}
536
+ </button>
537
+ <div class="user-menu">
538
+ <button
539
+ class="avatar-btn"
540
+ @click=${this._toggleMenu}
541
+ aria-label="User menu"
542
+ aria-expanded=${this._menuOpen}
543
+ >
544
+ ${this._getAvatarText()}
545
+ </button>
546
+ ${this._menuOpen?t`
547
+ <div class="dropdown">
548
+ <div class="dropdown-info">
549
+ ${this.tokenId?`${this.tokenId.slice(0,6)}${`*`.repeat(Math.min(8,Math.max(0,this.tokenId.length-10)))}${this.tokenId.length>10?this.tokenId.slice(-4):``}`:`Operator`}
550
+ </div>
551
+ <div class="dropdown-divider"></div>
552
+ <button
553
+ class="dropdown-action"
554
+ @click=${this._logout}
555
+ >
556
+ Logout
557
+ </button>
558
+ </div>
559
+ `:d}
560
+ </div>
561
+ </div>
562
+ </aside>
563
+ </div>
564
+ `}};u([l()],w.prototype,`connectionStatus`,void 0),u([l({type:Number})],w.prototype,`notificationCount`,void 0),u([l({type:Boolean})],w.prototype,`sidebarCollapsed`,void 0),u([l()],w.prototype,`tokenId`,void 0),u([s()],w.prototype,`_menuOpen`,void 0),w=u([e(`ic-topbar`)],w);var ue=[{id:`v-dashboard`,label:`Dashboard`,category:`view`,icon:`home`,action:`dashboard`},{id:`v-agents`,label:`Agents`,category:`view`,icon:`users`,action:`agents`},{id:`v-sessions`,label:`Sessions`,category:`view`,icon:`message-circle`,action:`sessions`},{id:`v-channels`,label:`Channels`,category:`view`,icon:`radio`,action:`channels`},{id:`v-chat`,label:`Chat Console`,category:`view`,icon:`message-square`,action:`chat`},{id:`v-memory`,label:`Memory Inspector`,category:`view`,icon:`database`,action:`memory`},{id:`v-skills`,label:`Skills`,category:`view`,icon:`zap`,action:`skills`},{id:`v-models`,label:`Models`,category:`view`,icon:`cpu`,action:`models`},{id:`v-scheduler`,label:`Scheduler`,category:`view`,icon:`clock`,action:`scheduler`},{id:`v-pipelines`,label:`Pipelines`,category:`view`,icon:`git-branch`,action:`pipelines`},{id:`v-observe`,label:`Observability`,category:`view`,icon:`bar-chart-2`,action:`observe/overview`},{id:`v-billing`,label:`Billing`,category:`view`,icon:`dollar-sign`,action:`observe/billing`},{id:`v-delivery`,label:`Delivery`,category:`view`,icon:`send`,action:`observe/delivery`},{id:`v-diagnostics`,label:`Diagnostics`,category:`view`,icon:`activity`,action:`observe/diagnostics`},{id:`v-context`,label:`Context Engine`,category:`view`,icon:`layers`,action:`observe/context`},{id:`v-security`,label:`Security`,category:`view`,icon:`shield`,action:`security`},{id:`v-config`,label:`Settings`,category:`view`,icon:`settings`,action:`config`},{id:`v-setup`,label:`Setup Wizard`,category:`view`,icon:`compass`,action:`setup`}],de=[{id:`c-refresh`,label:`Refresh Data`,category:`command`,icon:`refresh-cw`,action:`refresh`},{id:`c-sidebar`,label:`Toggle Sidebar`,category:`command`,icon:`sidebar`,action:`toggle-sidebar`},{id:`c-logout`,label:`Logout`,category:`command`,icon:`log-out`,action:`logout`},{id:`c-shortcuts`,label:`Show Keyboard Shortcuts`,category:`command`,icon:`help-circle`,action:`show-shortcuts`}],fe=[`view`,`agent`,`session`,`command`],pe={view:`Views`,agent:`Agents`,session:`Sessions`,command:`Commands`},T=class extends i{constructor(...e){super(...e),this.open=!1,this.agents=[],this.sessions=[],this._query=``,this._activeIndex=-1,this._results=[]}static{this.styles=[c,o,r,n`
565
+ :host {
566
+ display: block;
567
+ }
568
+
569
+ .backdrop {
570
+ position: fixed;
571
+ inset: 0;
572
+ background: rgba(0, 0, 0, 0.5);
573
+ z-index: 100;
574
+ display: flex;
575
+ align-items: flex-start;
576
+ justify-content: center;
577
+ padding-top: 15vh;
578
+ }
579
+
580
+ .palette {
581
+ background: var(--ic-surface, #111827);
582
+ border: 1px solid var(--ic-border, #374151);
583
+ border-radius: var(--ic-radius-lg, 0.75rem);
584
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
585
+ max-width: 640px;
586
+ width: 90%;
587
+ max-height: 400px;
588
+ display: flex;
589
+ flex-direction: column;
590
+ overflow: hidden;
591
+ }
592
+
593
+ .search-input {
594
+ width: 100%;
595
+ padding: var(--ic-space-md, 0.75rem) var(--ic-space-lg, 1rem);
596
+ background: transparent;
597
+ border: none;
598
+ border-bottom: 1px solid var(--ic-border, #374151);
599
+ color: var(--ic-text, #f3f4f6);
600
+ font-size: 1rem;
601
+ font-family: inherit;
602
+ outline: none;
603
+ box-sizing: border-box;
604
+ }
605
+
606
+ .search-input::placeholder {
607
+ color: var(--ic-text-dim, #6b7280);
608
+ }
609
+
610
+ .results {
611
+ overflow-y: auto;
612
+ flex: 1;
613
+ padding: var(--ic-space-xs, 0.25rem) 0;
614
+ }
615
+
616
+ .category-header {
617
+ padding: var(--ic-space-xs, 0.25rem) var(--ic-space-md, 0.75rem);
618
+ font-size: 0.6875rem;
619
+ font-weight: 600;
620
+ text-transform: uppercase;
621
+ letter-spacing: 0.05em;
622
+ color: var(--ic-text-dim, #6b7280);
623
+ margin-top: var(--ic-space-xs, 0.25rem);
624
+ }
625
+
626
+ .result-item {
627
+ display: flex;
628
+ align-items: center;
629
+ gap: var(--ic-space-sm, 0.5rem);
630
+ padding: var(--ic-space-sm, 0.5rem) var(--ic-space-md, 0.75rem);
631
+ cursor: pointer;
632
+ color: var(--ic-text, #f3f4f6);
633
+ font-size: var(--ic-text-sm, 0.875rem);
634
+ transition: background 0.1s;
635
+ }
636
+
637
+ .result-item:hover,
638
+ .result-item[aria-selected="true"] {
639
+ background: var(--ic-accent, #3b82f6);
640
+ color: #fff;
641
+ }
642
+
643
+ .result-icon {
644
+ width: 16px;
645
+ height: 16px;
646
+ flex-shrink: 0;
647
+ opacity: 0.7;
648
+ }
649
+
650
+ .result-label {
651
+ flex: 1;
652
+ min-width: 0;
653
+ overflow: hidden;
654
+ text-overflow: ellipsis;
655
+ white-space: nowrap;
656
+ }
657
+
658
+ .result-shortcut {
659
+ font-size: 0.6875rem;
660
+ color: var(--ic-text-dim, #6b7280);
661
+ font-family: var(--ic-font-mono, monospace);
662
+ flex-shrink: 0;
663
+ }
664
+
665
+ .result-item[aria-selected="true"] .result-shortcut {
666
+ color: rgba(255, 255, 255, 0.7);
667
+ }
668
+
669
+ .no-results {
670
+ padding: var(--ic-space-lg, 1rem);
671
+ text-align: center;
672
+ color: var(--ic-text-dim, #6b7280);
673
+ font-size: var(--ic-text-sm, 0.875rem);
674
+ }
675
+
676
+ .footer {
677
+ border-top: 1px solid var(--ic-border, #374151);
678
+ padding: var(--ic-space-xs, 0.25rem) var(--ic-space-md, 0.75rem);
679
+ display: flex;
680
+ gap: var(--ic-space-md, 0.75rem);
681
+ font-size: 0.6875rem;
682
+ color: var(--ic-text-dim, #6b7280);
683
+ }
684
+
685
+ .footer kbd {
686
+ background: var(--ic-surface-2, #1f2937);
687
+ border: 1px solid var(--ic-border, #374151);
688
+ border-radius: 3px;
689
+ padding: 1px 4px;
690
+ font-size: 0.625rem;
691
+ font-family: inherit;
692
+ }
693
+ `]}updated(e){e.has(`open`)&&this.open&&(this._query=``,this._activeIndex=-1,this._results=this._filterResults(``),this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`.search-input`))?.focus()}))}_getAllItems(){let e=[...ue];for(let t of this.agents)e.push({id:`a-${t.id}`,label:t.name??t.id,category:`agent`,icon:`user`,action:`agents/${t.id}`});for(let t of this.sessions.slice(0,20))e.push({id:`s-${t.key}`,label:`${t.agentId}: ${t.key}`,category:`session`,icon:`message-circle`,action:`sessions/${t.key}`});return e.push(...de),e}_filterResults(e){let t=this._getAllItems();if(!e)return t.filter(e=>e.category===`view`||e.category===`command`).slice(0,20);let n=e.toLowerCase();return t.filter(e=>e.label.toLowerCase().includes(n)).slice(0,20)}_getGroupedResults(){let e=new Map;for(let t of this._results){let n=e.get(t.category);n||(n=[],e.set(t.category,n)),n.push(t)}return fe.filter(t=>e.has(t)).map(t=>({category:t,items:e.get(t)}))}_handleInput(e){this._query=e.target.value,this._results=this._filterResults(this._query),this._activeIndex=this._results.length>0?0:-1}_handleKeydown(e){switch(e.key){case`ArrowDown`:e.preventDefault(),this._results.length>0&&(this._activeIndex=Math.min(this._activeIndex+1,this._results.length-1),this._scrollActiveIntoView());break;case`ArrowUp`:e.preventDefault(),this._results.length>0&&(this._activeIndex=Math.max(this._activeIndex-1,0),this._scrollActiveIntoView());break;case`Enter`:e.preventDefault(),this._activeIndex>=0&&this._activeIndex<this._results.length&&this._executeItem(this._results[this._activeIndex]);break;case`Escape`:e.preventDefault(),this._close();break}}_scrollActiveIntoView(){this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`#result-${this._activeIndex}`))?.scrollIntoView({block:`nearest`})})}_executeItem(e){e.category===`command`?this.dispatchEvent(new CustomEvent(`command`,{detail:e.action,bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`navigate`,{detail:e.action,bubbles:!0,composed:!0})),this._close()}_close(){this._query=``,this._activeIndex=-1,this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))}_handleBackdropClick(e){e.target.classList.contains(`backdrop`)&&this._close()}render(){if(!this.open)return d;let e=this._getGroupedResults(),n=0;return t`
694
+ <div class="backdrop" @click=${this._handleBackdropClick}>
695
+ <div class="palette" role="dialog" aria-label="Command palette">
696
+ <input
697
+ class="search-input"
698
+ type="text"
699
+ placeholder="Search views, agents, sessions, commands..."
700
+ role="combobox"
701
+ aria-expanded="true"
702
+ aria-controls="palette-results"
703
+ aria-activedescendant=${this._activeIndex>=0?`result-${this._activeIndex}`:``}
704
+ aria-autocomplete="list"
705
+ .value=${this._query}
706
+ @input=${this._handleInput}
707
+ @keydown=${this._handleKeydown}
708
+ />
709
+ <div class="results" id="palette-results" role="listbox" aria-label="Search results">
710
+ ${this._results.length===0?t`<div class="no-results">No results found</div>`:e.map(e=>t`
711
+ <div class="category-header">${pe[e.category]??e.category}</div>
712
+ ${e.items.map(e=>{let r=n++;return t`
713
+ <div
714
+ id="result-${r}"
715
+ class="result-item"
716
+ role="option"
717
+ aria-selected=${r===this._activeIndex?`true`:`false`}
718
+ @click=${()=>this._executeItem(e)}
719
+ @pointerenter=${()=>{this._activeIndex=r}}
720
+ >
721
+ <ic-icon class="result-icon" name=${e.icon} size="16px"></ic-icon>
722
+ <span class="result-label">${e.label}</span>
723
+ ${e.shortcut?t`<span class="result-shortcut">${e.shortcut}</span>`:d}
724
+ </div>
725
+ `})}
726
+ `)}
727
+ </div>
728
+ <div class="footer">
729
+ <span><kbd>&uarr;</kbd><kbd>&darr;</kbd> Navigate</span>
730
+ <span><kbd>Enter</kbd> Select</span>
731
+ <span><kbd>Esc</kbd> Close</span>
732
+ </div>
733
+ </div>
734
+ </div>
735
+ `}};u([l({type:Boolean})],T.prototype,`open`,void 0),u([l({attribute:!1})],T.prototype,`agents`,void 0),u([l({attribute:!1})],T.prototype,`sessions`,void 0),u([s()],T.prototype,`_query`,void 0),u([s()],T.prototype,`_activeIndex`,void 0),u([s()],T.prototype,`_results`,void 0),T=u([e(`ic-command-palette`)],T);var me={sm:`16px`,md:`24px`,lg:`48px`},E=class extends i{constructor(...e){super(...e),this.mode=`spinner`,this.size=`md`,this.lines=3}static{this.styles=[c,n`
736
+ :host {
737
+ display: block;
738
+ }
739
+
740
+ /* --- Spinner --- */
741
+ .spinner {
742
+ border: 2px solid var(--ic-border);
743
+ border-top-color: var(--ic-accent);
744
+ border-radius: 50%;
745
+ animation: spin 0.8s linear infinite;
746
+ }
747
+
748
+ @keyframes spin {
749
+ to {
750
+ transform: rotate(360deg);
751
+ }
752
+ }
753
+
754
+ @media (prefers-reduced-motion: reduce) {
755
+ .spinner {
756
+ animation: none;
757
+ border-top-color: var(--ic-accent);
758
+ opacity: 0.7;
759
+ }
760
+ }
761
+
762
+ /* --- Skeleton --- */
763
+ .skeleton-container {
764
+ display: flex;
765
+ flex-direction: column;
766
+ gap: var(--ic-space-sm);
767
+ }
768
+
769
+ .skeleton-line {
770
+ height: 12px;
771
+ background: var(--ic-surface-2);
772
+ border-radius: var(--ic-radius-sm);
773
+ position: relative;
774
+ overflow: hidden;
775
+ }
776
+
777
+ .skeleton-line::after {
778
+ content: "";
779
+ position: absolute;
780
+ top: 0;
781
+ left: 0;
782
+ right: 0;
783
+ bottom: 0;
784
+ background: linear-gradient(
785
+ 90deg,
786
+ transparent,
787
+ rgba(255, 255, 255, 0.05),
788
+ transparent
789
+ );
790
+ animation: shimmer 1.5s ease-in-out infinite;
791
+ }
792
+
793
+ @keyframes shimmer {
794
+ 0% {
795
+ transform: translateX(-100%);
796
+ }
797
+ 100% {
798
+ transform: translateX(100%);
799
+ }
800
+ }
801
+
802
+ @media (prefers-reduced-motion: reduce) {
803
+ .skeleton-line::after {
804
+ animation: none;
805
+ display: none;
806
+ }
807
+ }
808
+ `]}render(){return this.mode===`skeleton`?this._renderSkeleton():this._renderSpinner()}_renderSpinner(){let e=me[this.size]??me.md;return t`
809
+ <div
810
+ class="spinner"
811
+ style="width: ${e}; height: ${e};"
812
+ role="status"
813
+ aria-label="Loading"
814
+ ></div>
815
+ `}_renderSkeleton(){let e=[`100%`,`80%`,`60%`];return t`
816
+ <div
817
+ class="skeleton-container"
818
+ role="status"
819
+ aria-label="Loading"
820
+ >
821
+ ${Array.from({length:this.lines},(e,t)=>t).map(n=>t`<div
822
+ class="skeleton-line"
823
+ style="width: ${e[n%e.length]};"
824
+ ></div>`)}
825
+ </div>
826
+ `}};u([l()],E.prototype,`mode`,void 0),u([l()],E.prototype,`size`,void 0),u([l({type:Number})],E.prototype,`lines`,void 0),E=u([e(`ic-loading`)],E);var D=class extends i{constructor(...e){super(...e),this.variant=`dashboard`,this._showSkeleton=!1,this._delayTimer=null}static{this.styles=[c,n`
827
+ :host {
828
+ display: block;
829
+ }
830
+
831
+ .skeleton-container {
832
+ padding: var(--ic-space-md, 0.75rem) 0;
833
+ }
834
+
835
+ .skeleton-hidden {
836
+ visibility: hidden;
837
+ }
838
+
839
+ /* Dashboard variant */
840
+ .skeleton-stats {
841
+ display: grid;
842
+ grid-template-columns: repeat(3, 1fr);
843
+ gap: var(--ic-space-md);
844
+ margin-bottom: var(--ic-space-lg);
845
+ }
846
+
847
+ @media (max-width: 639px) {
848
+ .skeleton-stats {
849
+ grid-template-columns: 1fr;
850
+ }
851
+ }
852
+
853
+ .skeleton-stat-card {
854
+ background: var(--ic-surface, #111827);
855
+ border: 1px solid var(--ic-border, #374151);
856
+ border-radius: var(--ic-radius-md);
857
+ padding: var(--ic-space-md) var(--ic-space-lg);
858
+ height: 80px;
859
+ }
860
+
861
+ .skeleton-content-block {
862
+ background: var(--ic-surface, #111827);
863
+ border: 1px solid var(--ic-border, #374151);
864
+ border-radius: var(--ic-radius-lg);
865
+ padding: var(--ic-space-lg);
866
+ }
867
+
868
+ /* List variant */
869
+ .skeleton-search {
870
+ height: 40px;
871
+ background: var(--ic-surface, #111827);
872
+ border: 1px solid var(--ic-border, #374151);
873
+ border-radius: var(--ic-radius-md);
874
+ margin-bottom: var(--ic-space-md);
875
+ max-width: 320px;
876
+ }
877
+
878
+ .skeleton-row {
879
+ display: flex;
880
+ gap: var(--ic-space-md);
881
+ padding: var(--ic-space-sm) var(--ic-space-md);
882
+ border-bottom: 1px solid var(--ic-border, #374151);
883
+ }
884
+
885
+ .skeleton-row-cell {
886
+ flex: 1;
887
+ }
888
+
889
+ /* Detail variant */
890
+ .skeleton-detail-header {
891
+ margin-bottom: var(--ic-space-lg);
892
+ }
893
+
894
+ .skeleton-two-col {
895
+ display: grid;
896
+ grid-template-columns: 1fr 1fr;
897
+ gap: var(--ic-space-lg);
898
+ }
899
+
900
+ @media (max-width: 767px) {
901
+ .skeleton-two-col {
902
+ grid-template-columns: 1fr;
903
+ }
904
+ }
905
+
906
+ .skeleton-block {
907
+ background: var(--ic-surface, #111827);
908
+ border: 1px solid var(--ic-border, #374151);
909
+ border-radius: var(--ic-radius-lg);
910
+ padding: var(--ic-space-lg);
911
+ min-height: 150px;
912
+ }
913
+
914
+ /* Editor variant */
915
+ .skeleton-editor-block {
916
+ background: var(--ic-surface, #111827);
917
+ border: 1px solid var(--ic-border, #374151);
918
+ border-radius: var(--ic-radius-lg);
919
+ padding: var(--ic-space-lg);
920
+ min-height: 300px;
921
+ }
922
+ `]}connectedCallback(){super.connectedCallback(),this._delayTimer=setTimeout(()=>{this._showSkeleton=!0},150)}disconnectedCallback(){super.disconnectedCallback(),this._delayTimer&&=(clearTimeout(this._delayTimer),null)}_renderDashboard(){return t`
923
+ <div class="skeleton-stats">
924
+ <div class="skeleton-stat-card"><ic-loading mode="skeleton" lines="2"></ic-loading></div>
925
+ <div class="skeleton-stat-card"><ic-loading mode="skeleton" lines="2"></ic-loading></div>
926
+ <div class="skeleton-stat-card"><ic-loading mode="skeleton" lines="2"></ic-loading></div>
927
+ </div>
928
+ <div class="skeleton-content-block"><ic-loading mode="skeleton" lines="6"></ic-loading></div>
929
+ `}_renderList(){return t`
930
+ <div class="skeleton-search"></div>
931
+ <div class="skeleton-content-block">
932
+ ${Array.from({length:8},()=>t`
933
+ <div class="skeleton-row">
934
+ <div class="skeleton-row-cell"><ic-loading mode="skeleton" lines="1"></ic-loading></div>
935
+ <div class="skeleton-row-cell"><ic-loading mode="skeleton" lines="1"></ic-loading></div>
936
+ <div class="skeleton-row-cell"><ic-loading mode="skeleton" lines="1"></ic-loading></div>
937
+ </div>
938
+ `)}
939
+ </div>
940
+ `}_renderDetail(){return t`
941
+ <div class="skeleton-detail-header">
942
+ <ic-loading mode="skeleton" lines="2"></ic-loading>
943
+ </div>
944
+ <div class="skeleton-two-col">
945
+ <div class="skeleton-block"><ic-loading mode="skeleton" lines="5"></ic-loading></div>
946
+ <div class="skeleton-block"><ic-loading mode="skeleton" lines="5"></ic-loading></div>
947
+ </div>
948
+ `}_renderTable(){return t`
949
+ <div class="skeleton-content-block">
950
+ <ic-loading mode="skeleton" lines="1"></ic-loading>
951
+ ${Array.from({length:8},()=>t`
952
+ <div class="skeleton-row">
953
+ <div class="skeleton-row-cell"><ic-loading mode="skeleton" lines="1"></ic-loading></div>
954
+ <div class="skeleton-row-cell"><ic-loading mode="skeleton" lines="1"></ic-loading></div>
955
+ </div>
956
+ `)}
957
+ </div>
958
+ `}_renderEditor(){return t`
959
+ <div class="skeleton-detail-header">
960
+ <ic-loading mode="skeleton" lines="1"></ic-loading>
961
+ </div>
962
+ <div class="skeleton-editor-block"><ic-loading mode="skeleton" lines="8"></ic-loading></div>
963
+ `}render(){return t`
964
+ <div class=${this._showSkeleton?`skeleton-container`:`skeleton-container skeleton-hidden`} role="status" aria-label="Loading content">
965
+ ${(()=>{switch(this.variant){case`dashboard`:return this._renderDashboard();case`list`:return this._renderList();case`detail`:return this._renderDetail();case`table`:return this._renderTable();case`editor`:return this._renderEditor()}})()}
966
+ </div>
967
+ `}};u([l()],D.prototype,`variant`,void 0),u([s()],D.prototype,`_showSkeleton`,void 0),D=u([e(`ic-skeleton-view`)],D);var O,k={success:`var(--ic-success)`,error:`var(--ic-error)`,warning:`var(--ic-warning)`,info:`var(--ic-info)`},he=5,ge=0,A=class extends i{static{O=this}constructor(...e){super(...e),this._toasts=[],this._timers=new Map}static{this.styles=[c,n`
968
+ :host {
969
+ position: fixed;
970
+ bottom: var(--ic-space-lg);
971
+ right: var(--ic-space-lg);
972
+ z-index: 10000;
973
+ display: flex;
974
+ flex-direction: column;
975
+ gap: var(--ic-space-sm);
976
+ pointer-events: none;
977
+ }
978
+
979
+ .toast {
980
+ display: flex;
981
+ align-items: center;
982
+ gap: var(--ic-space-sm);
983
+ background: var(--ic-surface);
984
+ border: 1px solid var(--ic-border);
985
+ border-radius: var(--ic-radius-md);
986
+ padding: var(--ic-space-sm) var(--ic-space-md);
987
+ min-width: 16rem;
988
+ max-width: 24rem;
989
+ box-shadow: var(--ic-shadow-lg);
990
+ pointer-events: auto;
991
+ animation: toast-enter var(--ic-transition-slow) ease forwards;
992
+ }
993
+
994
+ .toast--exiting {
995
+ animation: toast-exit var(--ic-transition) ease forwards;
996
+ }
997
+
998
+ @keyframes toast-enter {
999
+ from {
1000
+ opacity: 0;
1001
+ transform: translateX(1rem);
1002
+ }
1003
+ to {
1004
+ opacity: 1;
1005
+ transform: translateX(0);
1006
+ }
1007
+ }
1008
+
1009
+ @keyframes toast-exit {
1010
+ from {
1011
+ opacity: 1;
1012
+ }
1013
+ to {
1014
+ opacity: 0;
1015
+ }
1016
+ }
1017
+
1018
+ @media (prefers-reduced-motion: reduce) {
1019
+ .toast,
1020
+ .toast--exiting {
1021
+ animation: none;
1022
+ }
1023
+ }
1024
+
1025
+ .toast__border {
1026
+ width: 4px;
1027
+ align-self: stretch;
1028
+ border-radius: 2px;
1029
+ flex-shrink: 0;
1030
+ }
1031
+
1032
+ .toast__message {
1033
+ flex: 1;
1034
+ font-size: var(--ic-text-sm);
1035
+ color: var(--ic-text);
1036
+ }
1037
+
1038
+ .toast__close {
1039
+ background: none;
1040
+ border: none;
1041
+ color: var(--ic-text-dim);
1042
+ cursor: pointer;
1043
+ padding: var(--ic-space-xs);
1044
+ font-size: var(--ic-text-sm);
1045
+ line-height: 1;
1046
+ flex-shrink: 0;
1047
+ border-radius: var(--ic-radius-sm);
1048
+ transition: color var(--ic-transition);
1049
+ }
1050
+
1051
+ .toast__close:hover {
1052
+ color: var(--ic-text);
1053
+ }
1054
+ `]}static{this._instance=null}connectedCallback(){super.connectedCallback(),O._instance=this,this._onDocumentToast=this._onDocumentToast.bind(this),document.addEventListener(`ic-toast`,this._onDocumentToast)}disconnectedCallback(){super.disconnectedCallback(),O._instance===this&&(O._instance=null),document.removeEventListener(`ic-toast`,this._onDocumentToast);for(let e of this._timers.values())clearTimeout(e);this._timers.clear()}static show(e,t=`info`,n=4e3){O._instance&&O._instance._addToast(e,t,n)}_onDocumentToast(e){let{message:t,variant:n=`info`,duration:r=4e3}=e.detail;this._addToast(t,n,r)}_addToast(e,t,n){let r=++ge,i={id:r,message:e,variant:t,duration:n},a=[...this._toasts,i];for(;a.length>he;){let e=a[0];this._clearTimer(e.id),a=a.slice(1)}this._toasts=a;let o=setTimeout(()=>{this._removeToast(r)},n);this._timers.set(r,o)}_removeToast(e){this._clearTimer(e),this._toasts=this._toasts.filter(t=>t.id!==e)}_clearTimer(e){let t=this._timers.get(e);t!==void 0&&(clearTimeout(t),this._timers.delete(e))}render(){return t`
1055
+ <div role="alert" aria-live="polite">
1056
+ ${this._toasts.map(e=>{let n=k[e.variant]??k.info;return t`
1057
+ <div class="toast" data-variant=${e.variant}>
1058
+ <div class="toast__border" style="background: ${n}"></div>
1059
+ <span class="toast__message">${e.message}</span>
1060
+ <button
1061
+ class="toast__close"
1062
+ aria-label="Close notification"
1063
+ @click=${()=>this._removeToast(e.id)}
1064
+ >\u2715</button>
1065
+ </div>
1066
+ `})}
1067
+ </div>
1068
+ `}};u([s()],A.prototype,`_toasts`,void 0),A=O=u([e(`ic-toast`)],A);var j=class{constructor(e,t,n){this._unsubs=[],this._host=e,this._eventDispatcher=t,this._events=n,this._host.addController(this)}hostConnected(){for(let[e,t]of Object.entries(this._events)){let n=this._eventDispatcher.addEventListener(e,t);this._unsubs.push(n)}}hostDisconnected(){for(let e of this._unsubs)e();this._unsubs=[]}},M=class extends i{constructor(...e){super(...e),this.data=[],this.width=80,this.height=24,this.color=`var(--ic-accent)`}static{this.styles=[c,n`
1069
+ :host {
1070
+ display: inline-block;
1071
+ }
1072
+
1073
+ svg {
1074
+ display: block;
1075
+ width: 100%;
1076
+ height: 100%;
1077
+ }
1078
+ `]}_buildPoints(){let{data:e,width:t,height:n}=this;if(e.length===0)return``;if(e.length===1)return`${t/2},${n/2}`;let r=Math.max(...e),i=r-Math.min(...e),a=t/(e.length-1);return e.map((e,t)=>`${t*a},${i===0?n/2:1+(r-e)/i*(n-2)}`).join(` `)}render(){if(this.data.length===0)return t``;let e=this._buildPoints();if(this.data.length===1){let[n,r]=e.split(`,`).map(Number);return t`
1079
+ <svg
1080
+ viewBox="0 0 ${this.width} ${this.height}"
1081
+ preserveAspectRatio="none"
1082
+ >
1083
+ ${a`<circle cx=${n} cy=${r} r="2" fill=${this.color} />`}
1084
+ </svg>
1085
+ `}return t`
1086
+ <svg
1087
+ viewBox="0 0 ${this.width} ${this.height}"
1088
+ preserveAspectRatio="none"
1089
+ >
1090
+ ${a`<polyline
1091
+ points=${e}
1092
+ fill="none"
1093
+ stroke=${this.color}
1094
+ stroke-width="1.5"
1095
+ stroke-linecap="round"
1096
+ stroke-linejoin="round"
1097
+ />`}
1098
+ </svg>
1099
+ `}};u([l({attribute:!1})],M.prototype,`data`,void 0),u([l({type:Number})],M.prototype,`width`,void 0),u([l({type:Number})],M.prototype,`height`,void 0),u([l()],M.prototype,`color`,void 0),M=u([e(`ic-sparkline`)],M);var N=class extends i{constructor(...e){super(...e),this.label=``,this.value=``,this.trend=``,this.trendValue=``,this.threshold=`normal`,this.sparklineData=[],this.delta=``,this.deltaDirection=`flat`}static{this.styles=[c,o,n`
1100
+ :host {
1101
+ display: block;
1102
+ min-width: 8rem;
1103
+ flex: 1;
1104
+ }
1105
+
1106
+ .card {
1107
+ background: var(--ic-surface);
1108
+ border: 1px solid var(--ic-border);
1109
+ border-radius: var(--ic-radius-md);
1110
+ padding: var(--ic-space-md) var(--ic-space-lg);
1111
+ }
1112
+
1113
+ .value-row {
1114
+ display: flex;
1115
+ align-items: baseline;
1116
+ gap: var(--ic-space-sm);
1117
+ }
1118
+
1119
+ .value {
1120
+ font-size: var(--ic-text-2xl);
1121
+ font-weight: 700;
1122
+ color: var(--ic-text);
1123
+ line-height: 1.2;
1124
+ }
1125
+
1126
+ .trend {
1127
+ display: inline-flex;
1128
+ align-items: center;
1129
+ gap: 2px;
1130
+ font-size: var(--ic-text-xs);
1131
+ }
1132
+
1133
+ .trend--up {
1134
+ color: var(--ic-success);
1135
+ }
1136
+
1137
+ .trend--down {
1138
+ color: var(--ic-error);
1139
+ }
1140
+
1141
+ .trend--flat {
1142
+ color: var(--ic-text-dim);
1143
+ }
1144
+
1145
+ .label {
1146
+ font-size: var(--ic-text-xs);
1147
+ color: var(--ic-text-dim);
1148
+ text-transform: uppercase;
1149
+ letter-spacing: 0.05em;
1150
+ margin-top: var(--ic-space-xs);
1151
+ }
1152
+
1153
+ .card--warning {
1154
+ border-left: 3px solid var(--ic-warning);
1155
+ }
1156
+
1157
+ .card--critical {
1158
+ border-left: 3px solid var(--ic-error);
1159
+ }
1160
+
1161
+ .threshold-icon {
1162
+ font-size: var(--ic-text-sm);
1163
+ flex-shrink: 0;
1164
+ }
1165
+
1166
+ .threshold-icon--warning {
1167
+ color: var(--ic-warning);
1168
+ }
1169
+
1170
+ .threshold-icon--critical {
1171
+ color: var(--ic-error);
1172
+ }
1173
+
1174
+ /* Delta indicator */
1175
+ .delta {
1176
+ display: inline-flex;
1177
+ align-items: center;
1178
+ gap: 2px;
1179
+ font-size: var(--ic-text-xs);
1180
+ margin-left: auto;
1181
+ }
1182
+
1183
+ .delta--up {
1184
+ color: var(--ic-success);
1185
+ }
1186
+
1187
+ .delta--down {
1188
+ color: var(--ic-error);
1189
+ }
1190
+
1191
+ .delta--flat {
1192
+ color: var(--ic-text-dim);
1193
+ }
1194
+
1195
+ /* Sparkline area */
1196
+ .sparkline-area {
1197
+ margin-top: var(--ic-space-xs);
1198
+ width: 100%;
1199
+ height: 24px;
1200
+ }
1201
+ `]}_renderTrend(){if(!this.trend)return d;let e={up:`↑`,down:`↓`,flat:`—`}[this.trend]??``;return t`<span class=${`trend trend--${this.trend}`}>${e}${this.trendValue?` ${this.trendValue}`:``}</span>`}_renderDelta(){if(!this.delta)return d;let e={up:`↑`,down:`↓`,flat:`—`}[this.deltaDirection]??``;return t`<span class=${`delta delta--${this.deltaDirection}`}>${e} ${this.delta}</span>`}_renderThresholdIcon(){return this.threshold===`warning`?t`<span class="threshold-icon threshold-icon--warning" aria-hidden="true">\u26A0</span>`:this.threshold===`critical`?t`<span class="threshold-icon threshold-icon--critical" aria-hidden="true">\u26D4</span>`:d}_renderSparkline(){return this.sparklineData.length===0?d:t`
1202
+ <div class="sparkline-area">
1203
+ <ic-sparkline
1204
+ .data=${this.sparklineData}
1205
+ height=${24}
1206
+ color="var(--ic-accent)"
1207
+ ></ic-sparkline>
1208
+ </div>
1209
+ `}render(){let e=this.threshold===`normal`?`card`:`card card--${this.threshold}`,n=this.delta?`, ${this.deltaDirection} ${this.delta}`:``;return t`
1210
+ <div class=${e} role="group" aria-label=${this.threshold===`normal`?`${this.label}: ${this.value}${n}`:`${this.label}: ${this.value}${n} (${this.threshold})`}>
1211
+ <div class="value-row">
1212
+ ${this._renderThresholdIcon()}
1213
+ <span class="value">${this.value}</span>
1214
+ ${this._renderTrend()}
1215
+ ${this._renderDelta()}
1216
+ </div>
1217
+ ${this._renderSparkline()}
1218
+ <div class="label">${this.label}</div>
1219
+ </div>
1220
+ `}};u([l()],N.prototype,`label`,void 0),u([l()],N.prototype,`value`,void 0),u([l()],N.prototype,`trend`,void 0),u([l()],N.prototype,`trendValue`,void 0),u([l()],N.prototype,`threshold`,void 0),u([l({attribute:!1})],N.prototype,`sparklineData`,void 0),u([l()],N.prototype,`delta`,void 0),u([l()],N.prototype,`deltaDirection`,void 0),N=u([e(`ic-stat-card`)],N);var P=class extends i{constructor(...e){super(...e),this.value=0,this.label=``,this.showPercent=!0,this.thresholds={green:80,yellow:90}}static{this.styles=[c,n`
1221
+ :host {
1222
+ display: block;
1223
+ }
1224
+
1225
+ .label {
1226
+ font-size: var(--ic-text-xs);
1227
+ color: var(--ic-text-dim);
1228
+ margin-bottom: var(--ic-space-xs);
1229
+ }
1230
+
1231
+ .bar-container {
1232
+ display: flex;
1233
+ align-items: center;
1234
+ gap: var(--ic-space-sm);
1235
+ }
1236
+
1237
+ .track {
1238
+ flex: 1;
1239
+ height: 6px;
1240
+ background: var(--ic-surface-alt, #1f2937);
1241
+ border-radius: 3px;
1242
+ overflow: hidden;
1243
+ }
1244
+
1245
+ .fill {
1246
+ height: 100%;
1247
+ border-radius: 3px;
1248
+ transition: width 0.3s ease;
1249
+ }
1250
+
1251
+ .percent {
1252
+ font-size: var(--ic-text-xs);
1253
+ color: var(--ic-text-dim);
1254
+ font-family: var(--ic-font-mono, ui-monospace, monospace);
1255
+ min-width: 2.5em;
1256
+ text-align: right;
1257
+ }
1258
+ `]}_getColor(){let{value:e,thresholds:t}=this;return e<t.green?`var(--ic-success)`:e<t.yellow?`var(--ic-warning)`:`var(--ic-error)`}render(){let e=Math.min(this.value,100),n=this._getColor();return t`
1259
+ ${this.label?t`<div class="label">${this.label}</div>`:d}
1260
+ <div
1261
+ class="bar-container"
1262
+ role="progressbar"
1263
+ aria-valuenow=${this.value}
1264
+ aria-valuemin=${0}
1265
+ aria-valuemax=${100}
1266
+ >
1267
+ <div class="track">
1268
+ <div
1269
+ class="fill"
1270
+ style="width: ${e}%; background-color: ${n};"
1271
+ ></div>
1272
+ </div>
1273
+ ${this.showPercent?t`<span class="percent">${Math.round(this.value)}%</span>`:d}
1274
+ </div>
1275
+ `}};u([l({type:Number})],P.prototype,`value`,void 0),u([l()],P.prototype,`label`,void 0),u([l({type:Boolean})],P.prototype,`showPercent`,void 0),u([l({attribute:!1})],P.prototype,`thresholds`,void 0),P=u([e(`ic-progress-bar`)],P);var F=class extends i{constructor(...e){super(...e),this.value=0,this.label=``,this.trend=0,this.size=`md`}static{this.styles=[c,n`
1276
+ :host {
1277
+ display: inline-block;
1278
+ text-align: center;
1279
+ }
1280
+
1281
+ :host([size="sm"]) {
1282
+ --gauge-size: 60px;
1283
+ }
1284
+
1285
+ :host,
1286
+ :host([size="md"]) {
1287
+ --gauge-size: 100px;
1288
+ }
1289
+
1290
+ :host([size="lg"]) {
1291
+ --gauge-size: 140px;
1292
+ }
1293
+
1294
+ .gauge-svg {
1295
+ width: var(--gauge-size);
1296
+ height: var(--gauge-size);
1297
+ }
1298
+
1299
+ .value-text {
1300
+ font-weight: 700;
1301
+ fill: var(--ic-text, #f9fafb);
1302
+ }
1303
+
1304
+ .trend-up {
1305
+ fill: var(--ic-success);
1306
+ }
1307
+
1308
+ .trend-down {
1309
+ fill: var(--ic-error);
1310
+ }
1311
+
1312
+ .trend-flat {
1313
+ fill: var(--ic-text-dim);
1314
+ }
1315
+
1316
+ .label {
1317
+ display: block;
1318
+ font-size: var(--ic-text-xs);
1319
+ color: var(--ic-text-dim);
1320
+ margin-top: var(--ic-space-xs);
1321
+ }
1322
+ `]}_getClampedValue(){return Math.max(0,Math.min(100,this.value))}_getArcColor(){let e=this._getClampedValue();return e<60?`var(--ic-success)`:e<=80?`var(--ic-warning)`:`var(--ic-error)`}_getTrendChar(){return this.trend>0?`↑`:this.trend<0?`↓`:`—`}_getTrendClass(){return this.trend>0?`trend-up`:this.trend<0?`trend-down`:`trend-flat`}render(){let e=this._getClampedValue(),n=2*Math.PI*42,r=n-e/100*n;return t`
1323
+ <svg
1324
+ class="gauge-svg"
1325
+ viewBox="0 0 100 100"
1326
+ preserveAspectRatio="xMidYMid meet"
1327
+ >
1328
+ <!-- Background circle -->
1329
+ ${a`
1330
+ <circle
1331
+ cx=${50}
1332
+ cy=${50}
1333
+ r=${42}
1334
+ fill="none"
1335
+ stroke="var(--ic-surface-2, #1f2937)"
1336
+ stroke-width="8"
1337
+ />
1338
+ `}
1339
+ <!-- Value arc -->
1340
+ ${a`
1341
+ <circle
1342
+ cx=${50}
1343
+ cy=${50}
1344
+ r=${42}
1345
+ fill="none"
1346
+ stroke=${this._getArcColor()}
1347
+ stroke-width="8"
1348
+ stroke-linecap="round"
1349
+ stroke-dasharray=${n}
1350
+ stroke-dashoffset=${r}
1351
+ transform="rotate(-90 ${50} ${50})"
1352
+ class="value-arc"
1353
+ />
1354
+ `}
1355
+ <!-- Percentage text -->
1356
+ ${a`
1357
+ <text
1358
+ x=${50}
1359
+ y=${48}
1360
+ text-anchor="middle"
1361
+ dominant-baseline="central"
1362
+ font-size="18"
1363
+ class="value-text"
1364
+ >${e}%</text>
1365
+ `}
1366
+ <!-- Trend indicator -->
1367
+ ${a`
1368
+ <text
1369
+ x=${50}
1370
+ y=${66}
1371
+ text-anchor="middle"
1372
+ dominant-baseline="central"
1373
+ font-size="12"
1374
+ class=${this._getTrendClass()}
1375
+ >${this._getTrendChar()}</text>
1376
+ `}
1377
+ </svg>
1378
+ ${this.label?t`<span class="label">${this.label}</span>`:``}
1379
+ `}};u([l({type:Number})],F.prototype,`value`,void 0),u([l()],F.prototype,`label`,void 0),u([l({type:Number})],F.prototype,`trend`,void 0),u([l({reflect:!0})],F.prototype,`size`,void 0),F=u([e(`ic-metric-gauge`)],F);var I={active:`var(--ic-success)`,idle:`var(--ic-warning)`,suspended:`var(--ic-text-dim)`,error:`var(--ic-error)`,unknown:`var(--ic-text-dim)`},_e=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`}),L=class extends i{constructor(...e){super(...e),this.name=``,this.provider=``,this.model=``,this.status=`unknown`,this.agentId=``,this.messagesToday=0,this.tokenUsageToday=0,this.costToday=0,this.budgetUtilization=0,this.suspended=!1}static{this.styles=[c,o,n`
1380
+ :host {
1381
+ display: block;
1382
+ }
1383
+
1384
+ .card {
1385
+ background: var(--ic-surface);
1386
+ border: 1px solid var(--ic-border);
1387
+ border-radius: 0.75rem;
1388
+ padding: 1.25rem;
1389
+ transition: border-color 0.15s;
1390
+ cursor: pointer;
1391
+ display: flex;
1392
+ flex-direction: column;
1393
+ }
1394
+
1395
+ .card:hover {
1396
+ border-color: var(--ic-border-hover, #374151);
1397
+ }
1398
+
1399
+ .card:focus-visible {
1400
+ outline: 2px solid var(--ic-accent);
1401
+ outline-offset: 2px;
1402
+ }
1403
+
1404
+ .card--suspended {
1405
+ opacity: 0.65;
1406
+ }
1407
+
1408
+ .card-header {
1409
+ display: flex;
1410
+ align-items: center;
1411
+ justify-content: space-between;
1412
+ margin-bottom: 0.75rem;
1413
+ }
1414
+
1415
+ .agent-name {
1416
+ font-size: 1rem;
1417
+ font-weight: 600;
1418
+ color: var(--ic-text);
1419
+ }
1420
+
1421
+ .status-badge {
1422
+ display: flex;
1423
+ align-items: center;
1424
+ gap: 0.375rem;
1425
+ padding: 0.25rem 0.625rem;
1426
+ border-radius: 9999px;
1427
+ font-size: 0.75rem;
1428
+ font-weight: 500;
1429
+ text-transform: capitalize;
1430
+ }
1431
+
1432
+ .status-dot {
1433
+ width: 0.375rem;
1434
+ height: 0.375rem;
1435
+ border-radius: 50%;
1436
+ }
1437
+
1438
+ .card-details {
1439
+ display: flex;
1440
+ flex-direction: column;
1441
+ gap: 0.375rem;
1442
+ flex: 1;
1443
+ }
1444
+
1445
+ .detail-row {
1446
+ display: flex;
1447
+ align-items: center;
1448
+ justify-content: space-between;
1449
+ font-size: 0.8125rem;
1450
+ }
1451
+
1452
+ .detail-label {
1453
+ color: var(--ic-text-dim);
1454
+ }
1455
+
1456
+ .detail-value {
1457
+ color: var(--ic-text-muted);
1458
+ font-family: ui-monospace, monospace;
1459
+ font-size: 0.75rem;
1460
+ }
1461
+
1462
+ .budget-bar {
1463
+ display: flex;
1464
+ align-items: center;
1465
+ gap: 0.5rem;
1466
+ }
1467
+
1468
+ .budget-track {
1469
+ flex: 1;
1470
+ height: 4px;
1471
+ background: var(--ic-surface-2, #1f2937);
1472
+ border-radius: 2px;
1473
+ overflow: hidden;
1474
+ min-width: 40px;
1475
+ }
1476
+
1477
+ .budget-fill {
1478
+ height: 100%;
1479
+ border-radius: 2px;
1480
+ transition: width 0.3s;
1481
+ }
1482
+
1483
+ .budget-pct {
1484
+ font-family: ui-monospace, monospace;
1485
+ font-size: 0.75rem;
1486
+ color: var(--ic-text-muted);
1487
+ min-width: 2.5rem;
1488
+ text-align: right;
1489
+ }
1490
+
1491
+ .card-actions {
1492
+ display: flex;
1493
+ gap: 0.5rem;
1494
+ margin-top: 0.75rem;
1495
+ padding-top: 0.75rem;
1496
+ border-top: 1px solid var(--ic-border);
1497
+ }
1498
+
1499
+ .action-btn {
1500
+ flex: 1;
1501
+ display: inline-flex;
1502
+ align-items: center;
1503
+ justify-content: center;
1504
+ padding: 0.375rem 0.5rem;
1505
+ background: transparent;
1506
+ border: 1px solid var(--ic-border);
1507
+ border-radius: 0.375rem;
1508
+ color: var(--ic-text-dim);
1509
+ font-size: 0.75rem;
1510
+ font-family: inherit;
1511
+ cursor: pointer;
1512
+ transition: background 0.15s, color 0.15s, border-color 0.15s;
1513
+ }
1514
+
1515
+ .action-btn:hover {
1516
+ background: var(--ic-surface-2, #1f2937);
1517
+ color: var(--ic-text);
1518
+ border-color: var(--ic-text-dim);
1519
+ }
1520
+
1521
+ .action-btn--danger:hover {
1522
+ color: var(--ic-error, #f87171);
1523
+ border-color: var(--ic-error, #f87171);
1524
+ }
1525
+ `]}_formatTokens(e){if(e>=1e6){let t=e/1e6;return t%1==0?`${t}M`:`${t.toFixed(1)}M`}if(e>=1e3){let t=e/1e3;return t%1==0?`${t}K`:`${t.toFixed(1)}K`}return String(e)}_budgetColor(e){return e>=90?`var(--ic-error)`:e>=70?`var(--ic-warning)`:`var(--ic-success)`}_handleClick(){this.dispatchEvent(new CustomEvent(`navigate`,{detail:`agents/${this.agentId||this.name}`,bubbles:!0,composed:!0}))}_handleKeydown(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._handleClick())}_handleAction(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(`agent-action`,{detail:{action:e,agentId:this.agentId||this.name},bubbles:!0,composed:!0}))}render(){let e=this.suspended?`suspended`:this.status,n=I[e]??I.unknown,r=e===`active`?`1a`:`0d`,i=this.messagesToday>0||this.tokenUsageToday>0,a=new Intl.NumberFormat(`en-US`),o=this.costToday>0,s=this.budgetUtilization>0,c=Math.min(100,Math.max(0,this.budgetUtilization));return t`
1526
+ <div
1527
+ class="card ${this.suspended?`card--suspended`:``}"
1528
+ role="link"
1529
+ tabindex="0"
1530
+ @click=${this._handleClick}
1531
+ @keydown=${this._handleKeydown}
1532
+ >
1533
+ <div class="card-header">
1534
+ <span class="agent-name">${this.name||`Unnamed Agent`}</span>
1535
+ <span
1536
+ class="status-badge"
1537
+ style="background: ${n}${r}; color: ${n}"
1538
+ >
1539
+ <span class="status-dot" style="background: ${n}"></span>
1540
+ ${e}
1541
+ </span>
1542
+ </div>
1543
+
1544
+ <div class="card-details">
1545
+ <div class="detail-row">
1546
+ <span class="detail-label">Provider</span>
1547
+ <span class="detail-value">${this.provider||`---`}</span>
1548
+ </div>
1549
+ <div class="detail-row">
1550
+ <span class="detail-label">Model</span>
1551
+ <span class="detail-value">${this.model||`---`}</span>
1552
+ </div>
1553
+ ${i?t`
1554
+ <div class="detail-row">
1555
+ <span class="detail-label">Messages</span>
1556
+ <span class="detail-value">${a.format(this.messagesToday)}</span>
1557
+ </div>
1558
+ <div class="detail-row">
1559
+ <span class="detail-label">Tokens</span>
1560
+ <span class="detail-value">${this._formatTokens(this.tokenUsageToday)}</span>
1561
+ </div>
1562
+ `:``}
1563
+ ${o?t`
1564
+ <div class="detail-row">
1565
+ <span class="detail-label">Cost Today</span>
1566
+ <span class="detail-value">${_e.format(this.costToday)}</span>
1567
+ </div>
1568
+ `:d}
1569
+ ${s?t`
1570
+ <div class="detail-row">
1571
+ <span class="detail-label">Budget</span>
1572
+ <div class="budget-bar">
1573
+ <div class="budget-track">
1574
+ <div
1575
+ class="budget-fill"
1576
+ style="width: ${c}%; background: ${this._budgetColor(c)}"
1577
+ ></div>
1578
+ </div>
1579
+ <span class="budget-pct">${c}%</span>
1580
+ </div>
1581
+ </div>
1582
+ `:d}
1583
+ </div>
1584
+
1585
+ <div class="card-actions">
1586
+ <button
1587
+ class="action-btn"
1588
+ aria-label="Configure ${this.name||`agent`}"
1589
+ @click=${e=>this._handleAction(`configure`,e)}
1590
+ >Configure</button>
1591
+ ${this.suspended?t`<button
1592
+ class="action-btn"
1593
+ aria-label="Resume ${this.name||`agent`}"
1594
+ @click=${e=>this._handleAction(`resume`,e)}
1595
+ >Resume</button>`:t`<button
1596
+ class="action-btn"
1597
+ aria-label="Suspend ${this.name||`agent`}"
1598
+ @click=${e=>this._handleAction(`suspend`,e)}
1599
+ >Suspend</button>`}
1600
+ <button
1601
+ class="action-btn action-btn--danger"
1602
+ aria-label="Delete ${this.name||`agent`}"
1603
+ @click=${e=>this._handleAction(`delete`,e)}
1604
+ >Delete</button>
1605
+ </div>
1606
+ </div>
1607
+ `}};u([l({type:String})],L.prototype,`name`,void 0),u([l({type:String})],L.prototype,`provider`,void 0),u([l({type:String})],L.prototype,`model`,void 0),u([l({type:String})],L.prototype,`status`,void 0),u([l({type:String})],L.prototype,`agentId`,void 0),u([l({type:Number})],L.prototype,`messagesToday`,void 0),u([l({type:Number})],L.prototype,`tokenUsageToday`,void 0),u([l({type:Number})],L.prototype,`costToday`,void 0),u([l({type:Number})],L.prototype,`budgetUtilization`,void 0),u([l({type:Boolean})],L.prototype,`suspended`,void 0),L=u([e(`ic-agent-card`)],L);var R={healthy:{color:`var(--ic-success)`,label:`Healthy`,severity:`green`,pulse:!1,icon:`check-circle`},idle:{color:`var(--ic-success)`,label:`Idle`,severity:`green`,pulse:!1,icon:`pause-circle`},stale:{color:`var(--ic-warning)`,label:`Stale`,severity:`yellow`,pulse:!1,icon:`clock`},"startup-grace":{color:`var(--ic-warning)`,label:`Starting`,severity:`yellow`,pulse:!0,icon:`loader`},stuck:{color:`var(--ic-error)`,label:`Stuck`,severity:`red`,pulse:!1,icon:`alert-triangle`},errored:{color:`var(--ic-error)`,label:`Error`,severity:`red`,pulse:!1,icon:`x-circle`},disconnected:{color:`var(--ic-text-dim)`,label:`Disconnected`,severity:`gray`,pulse:!1,icon:`wifi-off`},unknown:{color:`var(--ic-text-dim)`,label:`Unknown`,severity:`gray`,pulse:!1,icon:`help-circle`}},ve=new Set(Object.keys(R)),ye={connected:`healthy`,running:`healthy`,error:`errored`,stopped:`disconnected`,reconnecting:`healthy`};function z(e){let t=e.toLowerCase().trim();return ve.has(t)?t:ye[t]??`unknown`}function B(e){return R[z(e)]}function V(e){return e===`healthy`||e===`idle`}var be={telegram:`M20.3 3.5L2.6 10.3c-1.2.5-1.2 1.2-.2 1.5l4.5 1.4 1.7 5.3c.2.6.1.8.7.8.4 0 .7-.2.9-.4l2.2-2.1 4.5 3.3c.8.5 1.4.2 1.6-.8l2.9-13.6c.3-1.3-.5-1.9-1.6-1.2zM8.4 13l8.7-5.4c.4-.3.8-.1.5.2l-7.1 6.4-.3 3.1-1.8-4.3z`,discord:`M19.5 5.6A16 16 0 0015.5 4a12 12 0 00-.5 1.1 15 15 0 00-6 0A12 12 0 008.5 4 16 16 0 004.5 5.6 17 17 0 002 18.6a16 16 0 005 2.5c.4-.6.8-1.2 1.1-1.8a10 10 0 01-1.7-1l.4-.3a11.5 11.5 0 0010.4 0l.4.3c-.5.4-1.1.7-1.7 1 .3.6.7 1.2 1.1 1.8a16 16 0 005-2.5A17 17 0 0019.5 5.6zM8.3 16c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.9 1 1.8 2.1S9.4 16 8.3 16zm7.4 0c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.9 1 1.8 2.1S16.8 16 15.7 16z`,slack:`M5.1 15c0 1-.8 1.8-1.8 1.8S1.5 16 1.5 15s.8-1.8 1.8-1.8h1.8V15zm.9 0c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8v4.5c0 1-.8 1.8-1.8 1.8S6 20.5 6 19.5V15zM9 5.1c-1 0-1.8-.8-1.8-1.8S8 1.5 9 1.5s1.8.8 1.8 1.8v1.8H9zm0 .9c1 0 1.8.8 1.8 1.8S10 9.6 9 9.6H4.5c-1 0-1.8-.8-1.8-1.8S3.5 6 4.5 6H9zm9.9 1.8c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8-.8 1.8-1.8 1.8h-1.8V7.8zm-.9 0c0 1-.8 1.8-1.8 1.8S14.4 8.8 14.4 7.8V3.3c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8v4.5zM15 18.9c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8-1.8-.8-1.8-1.8v-1.8H15zm0-.9c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h4.5c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8H15z`,whatsapp:`M17.5 14.4c-.3-.1-1.6-.8-1.9-.9-.3-.1-.5-.1-.7.1-.2.3-.7.9-.9 1.1-.2.2-.3.2-.6.1-.3-.1-1.2-.4-2.3-1.4-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6l.4-.5c.1-.2.2-.3.2-.5.1-.2 0-.3 0-.5s-.7-1.6-.9-2.2c-.3-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.3-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.2 5 4.5.7.3 1.3.5 1.7.6.7.2 1.3.2 1.8.1.6-.1 1.6-.7 1.9-1.3.2-.6.2-1.2.2-1.3-.1-.1-.3-.2-.6-.3zM12 2C6.5 2 2 6.5 2 12c0 1.8.5 3.5 1.3 4.9L2 22l5.2-1.4c1.4.8 3 1.2 4.8 1.2 5.5 0 10-4.5 10-10S17.5 2 12 2z`,line:`M22 10.8c0-4.8-4.8-8.7-10.8-8.7S.4 6 .4 10.8c0 4.3 3.8 7.9 9 8.6.3.1.8.2.9.5.1.3.1.6 0 .9l-.1.9c0 .3-.2 1.1.9.6s6.2-3.7 8.5-6.3c1.6-1.6 2.4-3.4 2.4-5.2zM7.5 13.3H5.7c-.3 0-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.1h1.3c.3 0 .5.2.5.5s-.2.5-.5.5zm1.9-.5c0 .3-.2.5-.5.5s-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.6zm5 0c0 .2-.1.4-.3.4l-.2.1-2.5-3.4v3c0 .3-.2.5-.5.5s-.5-.2-.5-.5V9.2c0-.2.1-.4.3-.4h.1l2.6 3.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.6zm3.5.5h-1.8c-.3 0-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.1h1.3c.3 0 .5.2.5.5s-.2.5-.5.5z`,signal:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 3c3.9 0 7 3.1 7 7s-3.1 7-7 7-7-3.1-7-7 3.1-7 7-7zm0 3a4 4 0 100 8 4 4 0 000-8zm0 2.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z`,imessage:`M12 2C6.5 2 2 5.8 2 10.5c0 2.7 1.5 5.1 3.8 6.7-.2 1-.6 2.5-1.8 3.8 2.1-.3 3.8-1.1 4.8-1.8.9.2 2 .3 3.2.3 5.5 0 10-3.8 10-8.5S17.5 2 12 2z`,irc:`M4 4h16v12H5.2L4 17.2V4zm2 2v8h12V6H6zm2 2h8v1H8V8zm0 3h6v1H8v-1z`},xe={telegram:`var(--ic-telegram)`,discord:`var(--ic-discord)`,slack:`var(--ic-slack)`,whatsapp:`var(--ic-whatsapp)`,line:`var(--ic-line)`,signal:`var(--ic-signal)`,imessage:`var(--ic-imessage)`,irc:`var(--ic-irc)`},Se=`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z`,H=class extends i{constructor(...e){super(...e),this.platform=``,this.size=`20px`}static{this.styles=[c,n`
1608
+ :host {
1609
+ display: inline-flex;
1610
+ align-items: center;
1611
+ }
1612
+
1613
+ svg {
1614
+ display: block;
1615
+ }
1616
+ `]}render(){let e=this.platform.toLowerCase(),n=be[e]??Se,r=xe[e]??`var(--ic-text-dim)`;return t`
1617
+ <svg
1618
+ width=${this.size}
1619
+ height=${this.size}
1620
+ viewBox="0 0 24 24"
1621
+ fill=${r}
1622
+ aria-hidden="true"
1623
+ >
1624
+ ${a`<path d=${n} />`}
1625
+ </svg>
1626
+ `}};u([l()],H.prototype,`platform`,void 0),u([l()],H.prototype,`size`,void 0),H=u([e(`ic-platform-icon`)],H);var U=class extends i{constructor(...e){super(...e),this.channelType=``,this.name=``,this.status=`disconnected`,this.enabled=!1,this.uptime=0,this.channelId=``}static{this.styles=[c,o,n`
1627
+ :host {
1628
+ display: inline-block;
1629
+ }
1630
+
1631
+ .badge {
1632
+ display: inline-flex;
1633
+ align-items: center;
1634
+ gap: 0.5rem;
1635
+ padding: 0.5rem 0.875rem;
1636
+ background: var(--ic-surface);
1637
+ border: 1px solid var(--ic-border);
1638
+ border-radius: 0.5rem;
1639
+ font-size: 0.8125rem;
1640
+ transition: border-color 0.15s;
1641
+ cursor: pointer;
1642
+ }
1643
+
1644
+ .badge:hover {
1645
+ border-color: var(--ic-border-hover, #374151);
1646
+ }
1647
+
1648
+ .badge:focus-visible {
1649
+ outline: 2px solid var(--ic-accent);
1650
+ outline-offset: 2px;
1651
+ }
1652
+
1653
+ .channel-name {
1654
+ color: var(--ic-text-muted);
1655
+ font-weight: 500;
1656
+ text-transform: capitalize;
1657
+ }
1658
+
1659
+ .status-dot {
1660
+ width: 0.5rem;
1661
+ height: 0.5rem;
1662
+ border-radius: 50%;
1663
+ margin-left: 0.25rem;
1664
+ }
1665
+
1666
+ .status-dot.pulse {
1667
+ animation: pulse 2s ease-in-out infinite;
1668
+ }
1669
+
1670
+ @keyframes pulse {
1671
+ 0%, 100% { opacity: 1; }
1672
+ 50% { opacity: 0.4; }
1673
+ }
1674
+
1675
+ @media (prefers-reduced-motion: reduce) {
1676
+ .status-dot.pulse { animation: none; }
1677
+ }
1678
+
1679
+ .uptime {
1680
+ font-size: var(--ic-text-xs);
1681
+ color: var(--ic-text-dim);
1682
+ }
1683
+
1684
+ .disabled-label {
1685
+ font-size: 0.6875rem;
1686
+ color: var(--ic-text-dim);
1687
+ margin-left: 0.125rem;
1688
+ }
1689
+ `]}_formatUptime(e){if(e<60)return`0m`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h`:`${r}m`}_handleClick(){this.dispatchEvent(new CustomEvent(`navigate`,{detail:`channels/${this.channelId||this.channelType}`,bubbles:!0,composed:!0}))}_handleKeydown(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._handleClick())}render(){let e=B(this.status),n=this.name||this.channelType,r=this.uptime>0&&V(z(this.status));return t`
1690
+ <div
1691
+ class="badge"
1692
+ role="link"
1693
+ tabindex="0"
1694
+ @click=${this._handleClick}
1695
+ @keydown=${this._handleKeydown}
1696
+ >
1697
+ <ic-platform-icon .platform=${this.channelType} size="16px"></ic-platform-icon>
1698
+ <span class="channel-name">${n}</span>
1699
+ <span class="status-dot ${e.pulse?`pulse`:``}" style="background: ${e.color}"></span>
1700
+ <span class="status-label" style="font-size: 0.6875rem; color: ${e.color};">${e.label}</span>
1701
+ ${r?t`<span class="uptime">${this._formatUptime(this.uptime)}</span>`:``}
1702
+ ${this.enabled?``:t`<span class="disabled-label">(off)</span>`}
1703
+ </div>
1704
+ `}};u([l({type:String})],U.prototype,`channelType`,void 0),u([l({type:String})],U.prototype,`name`,void 0),u([l({type:String})],U.prototype,`status`,void 0),u([l({type:Boolean})],U.prototype,`enabled`,void 0),u([l({type:Number})],U.prototype,`uptime`,void 0),u([l({type:String})],U.prototype,`channelId`,void 0),U=u([e(`ic-channel-badge`)],U);var W=class extends i{constructor(...e){super(...e),this.options=[],this.selected=new Set}static{this.styles=[c,o,n`
1705
+ :host {
1706
+ display: block;
1707
+ }
1708
+
1709
+ .chips {
1710
+ display: flex;
1711
+ flex-wrap: wrap;
1712
+ gap: var(--ic-space-xs);
1713
+ }
1714
+
1715
+ .chip {
1716
+ border-radius: 9999px;
1717
+ padding: 0.25rem 0.75rem;
1718
+ font-size: var(--ic-text-xs);
1719
+ cursor: pointer;
1720
+ transition: all 0.15s;
1721
+ font-family: inherit;
1722
+ line-height: 1.5;
1723
+ }
1724
+
1725
+ .chip--unselected {
1726
+ background: transparent;
1727
+ color: var(--ic-text-dim);
1728
+ border: 1px solid var(--ic-border);
1729
+ }
1730
+
1731
+ .chip--unselected:hover {
1732
+ border-color: var(--ic-text-dim);
1733
+ }
1734
+ `]}_toggleChip(e){let t=new Set(this.selected);t.has(e)?t.delete(e):t.add(e),this.selected=t,this.dispatchEvent(new CustomEvent(`filter-change`,{detail:{selected:t},bubbles:!0,composed:!0}))}_toggleAll(){let e=this.options.every(e=>this.selected.has(e.value))?new Set:new Set(this.options.map(e=>e.value));this.selected=e,this.dispatchEvent(new CustomEvent(`filter-change`,{detail:{selected:e},bubbles:!0,composed:!0}))}_renderChip(e,n,r,i){if(n){let n=i??`var(--ic-accent)`;return t`
1735
+ <button
1736
+ class="chip"
1737
+ style="background: ${n}33; color: ${n}; border: 1px solid ${n};"
1738
+ @click=${r}
1739
+ >
1740
+ ${e}
1741
+ </button>
1742
+ `}return t`
1743
+ <button class="chip chip--unselected" @click=${r}>
1744
+ ${e}
1745
+ </button>
1746
+ `}render(){let e=this.options.length>0&&this.options.every(e=>this.selected.has(e.value));return t`
1747
+ <div class="chips">
1748
+ ${this._renderChip(`All`,e,()=>this._toggleAll())}
1749
+ ${this.options.map(e=>this._renderChip(e.label,this.selected.has(e.value),()=>this._toggleChip(e.value),e.color))}
1750
+ </div>
1751
+ `}};u([l({attribute:!1})],W.prototype,`options`,void 0),u([l({attribute:!1})],W.prototype,`selected`,void 0),W=u([e(`ic-filter-chips`)],W);var G={"message:received":{label:`MSG IN`,color:`#3b82f6`},"message:sent":{label:`MSG OUT`,color:`#22c55e`},"message:streaming":{label:`STREAM`,color:`#8b5cf6`},"session:created":{label:`SESSION`,color:`#06b6d4`},"session:expired":{label:`EXPIRED`,color:`#6b7280`},"audit:event":{label:`AUDIT`,color:`#f59e0b`},"skill:loaded":{label:`SKILL`,color:`#10b981`},"skill:executed":{label:`SKILL RUN`,color:`#10b981`},"skill:rejected":{label:`REJECTED`,color:`#ef4444`},"scheduler:job_started":{label:`JOB START`,color:`#8b5cf6`},"scheduler:job_completed":{label:`JOB DONE`,color:`#22c55e`},"scheduler:heartbeat_check":{label:`HEARTBEAT`,color:`#06b6d4`},"scheduler:task_extracted":{label:`TASK`,color:`#f59e0b`},"system:error":{label:`ERROR`,color:`#ef4444`}},Ce=Object.entries(G).map(([e,t])=>({value:e,label:t.label,color:t.color}));function we(e){let t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function Te(e,t){if(e===`message:received`||e===`message:sent`){let e=t.channelType??t.channelId??``,n=t.text??``,r=n.length>60?n.slice(0,57)+`...`:n;return e?`[${e}] ${r}`:r}if(e===`system:error`)return(t.message??t.error??`Unknown error`).slice(0,80);if(e===`skill:executed`||e===`skill:loaded`)return t.skillName??t.name??`unknown skill`;if(e===`scheduler:job_completed`||e===`scheduler:job_started`)return t.taskId??t.jobId??``;if(e===`audit:event`)return t.action??t.type??`audit event`;let n=Object.keys(t).slice(0,2);return n.length===0?``:n.map(e=>`${e}: ${String(t[e]).slice(0,30)}`).join(`, `)}var K=class extends i{constructor(...e){super(...e),this.entries=[],this.sseSubscribe=null,this._liveEntries=[],this._activeFilters=new Set,this._paused=!1,this._pauseBuffer=[],this._unsubscribe=null,this._nextLiveId=1e5}static{this.styles=[c,o,n`
1752
+ :host {
1753
+ display: block;
1754
+ }
1755
+
1756
+ .feed-container {
1757
+ background: var(--ic-surface);
1758
+ border: 1px solid var(--ic-border);
1759
+ border-radius: 0.75rem;
1760
+ overflow: hidden;
1761
+ }
1762
+
1763
+ .feed-header {
1764
+ display: flex;
1765
+ align-items: center;
1766
+ justify-content: space-between;
1767
+ padding: 0.875rem 1.25rem;
1768
+ border-bottom: 1px solid var(--ic-border);
1769
+ }
1770
+
1771
+ .feed-title {
1772
+ font-size: 0.875rem;
1773
+ font-weight: 600;
1774
+ color: var(--ic-text);
1775
+ }
1776
+
1777
+ .header-controls {
1778
+ display: flex;
1779
+ align-items: center;
1780
+ gap: 0.5rem;
1781
+ }
1782
+
1783
+ .live-indicator {
1784
+ display: flex;
1785
+ align-items: center;
1786
+ gap: 0.375rem;
1787
+ font-size: 0.75rem;
1788
+ color: var(--ic-success);
1789
+ }
1790
+
1791
+ .live-dot {
1792
+ width: 0.375rem;
1793
+ height: 0.375rem;
1794
+ border-radius: 50%;
1795
+ background: var(--ic-success);
1796
+ animation: pulse 2s infinite;
1797
+ }
1798
+
1799
+ @keyframes pulse {
1800
+ 0%,
1801
+ 100% {
1802
+ opacity: 1;
1803
+ }
1804
+ 50% {
1805
+ opacity: 0.4;
1806
+ }
1807
+ }
1808
+
1809
+ .paused-indicator {
1810
+ display: flex;
1811
+ align-items: center;
1812
+ gap: 0.375rem;
1813
+ font-size: 0.75rem;
1814
+ color: var(--ic-warning);
1815
+ }
1816
+
1817
+ .paused-dot {
1818
+ width: 0.375rem;
1819
+ height: 0.375rem;
1820
+ border-radius: 50%;
1821
+ background: var(--ic-warning);
1822
+ }
1823
+
1824
+ .pause-btn {
1825
+ background: transparent;
1826
+ border: 1px solid var(--ic-border);
1827
+ border-radius: var(--ic-radius-sm, 0.25rem);
1828
+ padding: 0.125rem 0.5rem;
1829
+ font-size: var(--ic-text-xs);
1830
+ color: var(--ic-text-dim);
1831
+ cursor: pointer;
1832
+ font-family: inherit;
1833
+ }
1834
+
1835
+ .pause-btn:hover {
1836
+ border-color: var(--ic-text-dim);
1837
+ color: var(--ic-text);
1838
+ }
1839
+
1840
+ .feed-filters {
1841
+ padding: 0.5rem 1.25rem;
1842
+ border-bottom: 1px solid var(--ic-border);
1843
+ }
1844
+
1845
+ .feed-list {
1846
+ max-height: 28rem;
1847
+ overflow-y: auto;
1848
+ }
1849
+
1850
+ .feed-item {
1851
+ display: flex;
1852
+ align-items: flex-start;
1853
+ gap: 0.75rem;
1854
+ padding: 0.625rem 1.25rem;
1855
+ border-bottom: 1px solid var(--ic-border);
1856
+ font-size: 0.8125rem;
1857
+ }
1858
+
1859
+ .feed-item:last-child {
1860
+ border-bottom: none;
1861
+ }
1862
+
1863
+ .event-badge {
1864
+ padding: 0.125rem 0.5rem;
1865
+ border-radius: 0.25rem;
1866
+ font-size: 0.625rem;
1867
+ font-weight: 600;
1868
+ letter-spacing: 0.025em;
1869
+ white-space: nowrap;
1870
+ flex-shrink: 0;
1871
+ }
1872
+
1873
+ .event-summary {
1874
+ color: var(--ic-text-muted);
1875
+ flex: 1;
1876
+ overflow: hidden;
1877
+ text-overflow: ellipsis;
1878
+ white-space: nowrap;
1879
+ }
1880
+
1881
+ .event-time {
1882
+ color: var(--ic-text-dim);
1883
+ font-size: 0.75rem;
1884
+ white-space: nowrap;
1885
+ flex-shrink: 0;
1886
+ }
1887
+
1888
+ .empty-state {
1889
+ padding: 2rem 1.25rem;
1890
+ text-align: center;
1891
+ color: var(--ic-text-dim);
1892
+ font-size: 0.875rem;
1893
+ }
1894
+ `]}connectedCallback(){super.connectedCallback(),this._startSse()}disconnectedCallback(){super.disconnectedCallback(),this._stopSse()}updated(e){e.has(`sseSubscribe`)&&(this._stopSse(),this._startSse())}_startSse(){this.sseSubscribe&&(this._unsubscribe=this.sseSubscribe((e,t)=>{if(e===`ping`||e===`error`)return;let n={id:this._nextLiveId++,event:e,payload:t??{},timestamp:Date.now()};this._paused?this._pauseBuffer=[n,...this._pauseBuffer].slice(0,200):this._liveEntries=[n,...this._liveEntries].slice(0,200)}))}_stopSse(){this._unsubscribe?.(),this._unsubscribe=null}_mergedEntries(){let e=[...this.entries].reverse(),t=[...this._liveEntries,...e],n=new Set,r=[];for(let e of t)if(!n.has(e.id)&&(n.add(e.id),r.push(e),r.length>=200))break;return r}_onFilterChange(e){this._activeFilters=e.detail.selected}_togglePause(){this._paused?(this._liveEntries=[...this._pauseBuffer,...this._liveEntries].slice(0,200),this._pauseBuffer=[],this._paused=!1):this._paused=!0}render(){let e=this._mergedEntries(),n=this._activeFilters.size===0?e:e.filter(e=>this._activeFilters.has(e.event)),r=this._unsubscribe!==null;return t`
1895
+ <div class="feed-container" aria-label="Activity feed">
1896
+ <div class="feed-header">
1897
+ <span class="feed-title">Recent Activity</span>
1898
+ <div class="header-controls">
1899
+ ${r?this._paused?t`
1900
+ <span class="paused-indicator">
1901
+ <span class="paused-dot"></span>
1902
+ Paused
1903
+ </span>
1904
+ `:t`
1905
+ <span class="live-indicator">
1906
+ <span class="live-dot"></span>
1907
+ Live
1908
+ </span>
1909
+ `:d}
1910
+ ${r?t`
1911
+ <button
1912
+ class="pause-btn"
1913
+ @click=${this._togglePause}
1914
+ aria-label=${this._paused?`Resume live feed`:`Pause live feed`}
1915
+ >
1916
+ ${this._paused?`Resume (${this._pauseBuffer.length})`:`Pause`}
1917
+ </button>
1918
+ `:d}
1919
+ </div>
1920
+ </div>
1921
+
1922
+ <div class="feed-filters">
1923
+ <ic-filter-chips
1924
+ .options=${Ce}
1925
+ .selected=${this._activeFilters}
1926
+ @filter-change=${this._onFilterChange}
1927
+ ></ic-filter-chips>
1928
+ </div>
1929
+
1930
+ <div class="feed-list" aria-live="polite">
1931
+ ${n.length===0?t`
1932
+ <div class="empty-state">No activity yet</div>
1933
+ `:n.map(e=>{let n=G[e.event]??{label:e.event.toUpperCase(),color:`#6b7280`},r=Te(e.event,e.payload);return t`
1934
+ <div class="feed-item">
1935
+ <span
1936
+ class="event-badge"
1937
+ style="background: ${n.color}1a; color: ${n.color}"
1938
+ >
1939
+ ${n.label}
1940
+ </span>
1941
+ <span class="event-summary">${r}</span>
1942
+ <span class="event-time">${we(e.timestamp)}</span>
1943
+ </div>
1944
+ `})}
1945
+ </div>
1946
+ </div>
1947
+ `}};u([l({attribute:!1})],K.prototype,`entries`,void 0),u([l({attribute:!1})],K.prototype,`sseSubscribe`,void 0),u([s()],K.prototype,`_liveEntries`,void 0),u([s()],K.prototype,`_activeFilters`,void 0),u([s()],K.prototype,`_paused`,void 0),u([s()],K.prototype,`_pauseBuffer`,void 0),K=u([e(`ic-activity-feed`)],K);var Ee=6e4,q={agents:`agents`,sessions:`sessions`,messages:`observe/delivery`,tokens:`observe/billing`,cost:`observe/billing`,errors:`observe/diagnostics`,health:`observe/overview`,context:`observe/context`,channels:`channels`,activity:`observe/delivery`};function De(e){if(e<0)return`0m`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=[];return t>0&&i.push(`${t}d`),(n>0||t>0)&&i.push(`${n}h`),i.push(`${r}m`),i.join(` `)}function J(e){return new Intl.NumberFormat(`en-US`).format(e)}function Oe(e){if(e>=1e6){let t=e/1e6;return t%1==0?`${t}M`:`${t.toFixed(1)}M`}if(e>=1e3){let t=e/1e3;return t%1==0?`${t}K`:`${t.toFixed(1)}K`}return String(e)}var ke=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`});function Ae(e,t,n){return e<t?`var(--ic-success)`:e<n?`var(--ic-warning)`:`var(--ic-error)`}function je(e,t,n){return e<t?``:e<n?`(Warning)`:`(Critical)`}var Y=class extends i{constructor(...e){super(...e),this.apiClient=null,this.rpcClient=null,this.eventDispatcher=null,this._loadState=`loading`,this._error=``,this._agents=[],this._channels=[],this._activity=[],this._systemHealth=null,this._deliveryStats=null,this._messagesToday=0,this._tokenUsageToday=0,this._sessionCount=0,this._errorCount=0,this._totalCost=0,this._prevMessages=0,this._prevTokens=0,this._prevCost=0,this._mcpStatus=`---`,this._contextSummary=null,this._tokenSparklineData=[],this._costSparklineData=[],this._agentBilling=new Map,this._sse=null,this._rpcRefreshInterval=null,this._reloadDebounce=null}static{this.styles=[c,o,n`
1948
+ :host {
1949
+ display: block;
1950
+ }
1951
+
1952
+ .dashboard-grid {
1953
+ display: grid;
1954
+ grid-template-columns: 1fr;
1955
+ gap: 1.5rem;
1956
+ }
1957
+
1958
+ /* Stats row -- 3-column grid (responsive) */
1959
+ .stats-row {
1960
+ display: grid;
1961
+ grid-template-columns: repeat(3, 1fr);
1962
+ gap: var(--ic-space-md);
1963
+ }
1964
+
1965
+ @media (max-width: 1023px) {
1966
+ .stats-row {
1967
+ grid-template-columns: repeat(2, 1fr);
1968
+ }
1969
+ }
1970
+
1971
+ @media (max-width: 639px) {
1972
+ .stats-row {
1973
+ grid-template-columns: 1fr;
1974
+ }
1975
+ }
1976
+
1977
+ /* Clickable stat card link wrappers */
1978
+ .stat-card-link {
1979
+ cursor: pointer;
1980
+ border-radius: var(--ic-radius-md);
1981
+ transition: transform 0.1s;
1982
+ }
1983
+
1984
+ .stat-card-link:hover {
1985
+ transform: translateY(-1px);
1986
+ }
1987
+
1988
+ .stat-card-link:focus-visible {
1989
+ outline: 2px solid var(--ic-accent);
1990
+ outline-offset: 2px;
1991
+ }
1992
+
1993
+ /* Info cards row */
1994
+ .info-cards-row {
1995
+ display: grid;
1996
+ grid-template-columns: 1fr 1fr;
1997
+ gap: var(--ic-space-lg);
1998
+ }
1999
+
2000
+ @media (max-width: 767px) {
2001
+ .info-cards-row {
2002
+ grid-template-columns: 1fr;
2003
+ }
2004
+ }
2005
+
2006
+ .info-card {
2007
+ background: var(--ic-surface);
2008
+ border: 1px solid var(--ic-border);
2009
+ border-radius: var(--ic-radius-lg);
2010
+ padding: var(--ic-space-lg);
2011
+ }
2012
+
2013
+ .info-card--link {
2014
+ cursor: pointer;
2015
+ transition: border-color 0.15s;
2016
+ }
2017
+
2018
+ .info-card--link:hover {
2019
+ border-color: var(--ic-border-hover, #374151);
2020
+ }
2021
+
2022
+ .info-card--link:focus-visible {
2023
+ outline: 2px solid var(--ic-accent);
2024
+ outline-offset: 2px;
2025
+ }
2026
+
2027
+ .info-card-title {
2028
+ font-size: var(--ic-text-sm);
2029
+ font-weight: 600;
2030
+ color: var(--ic-text);
2031
+ margin-bottom: var(--ic-space-md);
2032
+ }
2033
+
2034
+ .info-row {
2035
+ display: flex;
2036
+ justify-content: space-between;
2037
+ align-items: center;
2038
+ padding: var(--ic-space-xs) 0;
2039
+ font-size: var(--ic-text-sm);
2040
+ }
2041
+
2042
+ .info-label {
2043
+ color: var(--ic-text-dim);
2044
+ }
2045
+
2046
+ .info-value {
2047
+ color: var(--ic-text);
2048
+ font-family: var(--ic-font-mono, ui-monospace, monospace);
2049
+ }
2050
+
2051
+ /* Context engine summary grid */
2052
+ .context-summary-grid {
2053
+ display: grid;
2054
+ grid-template-columns: 1fr 1fr;
2055
+ gap: var(--ic-space-md);
2056
+ align-items: start;
2057
+ }
2058
+
2059
+ .context-metric {
2060
+ display: flex;
2061
+ flex-direction: column;
2062
+ align-items: center;
2063
+ gap: var(--ic-space-xs);
2064
+ }
2065
+
2066
+ .context-metric-label {
2067
+ font-size: var(--ic-text-xs);
2068
+ color: var(--ic-text-dim);
2069
+ }
2070
+
2071
+ .context-metric-value {
2072
+ font-size: var(--ic-text-lg);
2073
+ font-weight: 600;
2074
+ color: var(--ic-text);
2075
+ font-family: var(--ic-font-mono, ui-monospace, monospace);
2076
+ }
2077
+
2078
+ /* Sparklines row */
2079
+ .sparklines-row {
2080
+ display: grid;
2081
+ grid-template-columns: 1fr 1fr;
2082
+ gap: var(--ic-space-lg);
2083
+ }
2084
+
2085
+ @media (max-width: 639px) {
2086
+ .sparklines-row {
2087
+ grid-template-columns: 1fr;
2088
+ }
2089
+ }
2090
+
2091
+ .sparkline-card {
2092
+ background: var(--ic-surface);
2093
+ border: 1px solid var(--ic-border);
2094
+ border-radius: var(--ic-radius-lg);
2095
+ padding: var(--ic-space-md) var(--ic-space-lg);
2096
+ cursor: pointer;
2097
+ transition: border-color 0.15s;
2098
+ }
2099
+
2100
+ .sparkline-card:hover {
2101
+ border-color: var(--ic-border-hover, #374151);
2102
+ }
2103
+
2104
+ .sparkline-card:focus-visible {
2105
+ outline: 2px solid var(--ic-accent);
2106
+ outline-offset: 2px;
2107
+ }
2108
+
2109
+ .sparkline-header {
2110
+ display: flex;
2111
+ align-items: center;
2112
+ justify-content: space-between;
2113
+ gap: var(--ic-space-md);
2114
+ }
2115
+
2116
+ .sparkline-title {
2117
+ font-size: var(--ic-text-sm);
2118
+ font-weight: 600;
2119
+ color: var(--ic-text-dim);
2120
+ }
2121
+
2122
+ /* Section styles */
2123
+ .section {
2124
+ display: flex;
2125
+ flex-direction: column;
2126
+ gap: 1rem;
2127
+ }
2128
+
2129
+ .section-title {
2130
+ font-size: 0.875rem;
2131
+ font-weight: 600;
2132
+ color: var(--ic-text-dim);
2133
+ text-transform: uppercase;
2134
+ letter-spacing: 0.05em;
2135
+ }
2136
+
2137
+ .section-title--link {
2138
+ cursor: pointer;
2139
+ }
2140
+
2141
+ .section-title--link:hover {
2142
+ color: var(--ic-accent);
2143
+ }
2144
+
2145
+ .section-title--link:focus-visible {
2146
+ outline: 2px solid var(--ic-accent);
2147
+ outline-offset: 2px;
2148
+ }
2149
+
2150
+ .agents-grid {
2151
+ display: grid;
2152
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
2153
+ gap: 0.75rem;
2154
+ }
2155
+
2156
+ .agent-card-wrapper {
2157
+ position: relative;
2158
+ }
2159
+
2160
+ .agent-cost-badge {
2161
+ position: absolute;
2162
+ top: 0.5rem;
2163
+ right: 0.5rem;
2164
+ padding: 0.125rem 0.5rem;
2165
+ background: var(--ic-accent);
2166
+ color: #fff;
2167
+ font-size: 0.6875rem;
2168
+ font-weight: 600;
2169
+ border-radius: 9999px;
2170
+ font-family: var(--ic-font-mono, ui-monospace, monospace);
2171
+ pointer-events: none;
2172
+ }
2173
+
2174
+ .channels-row {
2175
+ display: flex;
2176
+ flex-wrap: wrap;
2177
+ gap: 0.5rem;
2178
+ }
2179
+
2180
+ /* Loading & error states */
2181
+ .state-container {
2182
+ display: flex;
2183
+ align-items: center;
2184
+ justify-content: center;
2185
+ padding: 3rem;
2186
+ color: var(--ic-text-dim);
2187
+ font-size: 0.875rem;
2188
+ }
2189
+
2190
+ .error-container {
2191
+ display: flex;
2192
+ flex-direction: column;
2193
+ align-items: center;
2194
+ gap: 0.75rem;
2195
+ padding: 3rem;
2196
+ }
2197
+
2198
+ .error-message {
2199
+ color: var(--ic-error);
2200
+ font-size: 0.875rem;
2201
+ }
2202
+
2203
+ .retry-btn {
2204
+ padding: 0.5rem 1rem;
2205
+ background: var(--ic-surface);
2206
+ border: 1px solid var(--ic-border);
2207
+ border-radius: 0.375rem;
2208
+ color: var(--ic-text);
2209
+ font-size: 0.8125rem;
2210
+ cursor: pointer;
2211
+ font-family: inherit;
2212
+ }
2213
+
2214
+ .retry-btn:hover {
2215
+ background: var(--ic-surface-alt, #374151);
2216
+ }
2217
+
2218
+ .loading-spinner {
2219
+ width: 1.5rem;
2220
+ height: 1.5rem;
2221
+ border: 2px solid var(--ic-border);
2222
+ border-top-color: var(--ic-accent);
2223
+ border-radius: 50%;
2224
+ animation: spin 0.8s linear infinite;
2225
+ }
2226
+
2227
+ @keyframes spin {
2228
+ to {
2229
+ transform: rotate(360deg);
2230
+ }
2231
+ }
2232
+
2233
+ .empty-text {
2234
+ color: var(--ic-text-dim);
2235
+ font-size: 0.8125rem;
2236
+ }
2237
+
2238
+ .stat-value-placeholder {
2239
+ color: var(--ic-text-dim);
2240
+ }
2241
+
2242
+ .no-data-placeholder {
2243
+ color: var(--ic-text-dim);
2244
+ font-size: var(--ic-text-sm);
2245
+ padding: var(--ic-space-md) 0;
2246
+ }
2247
+ `]}connectedCallback(){super.connectedCallback(),this._initSse()}disconnectedCallback(){super.disconnectedCallback(),this._reloadDebounce!==null&&(clearTimeout(this._reloadDebounce),this._reloadDebounce=null),this._stopRpcRefresh()}updated(e){e.has(`apiClient`)&&this.apiClient&&this._loadData(),e.has(`rpcClient`)&&(this._stopRpcRefresh(),this._startRpcRefresh(),this._loadRpcData()),e.has(`eventDispatcher`)&&this.eventDispatcher&&!this._sse&&this._initSse()}_navigate(e){this.dispatchEvent(new CustomEvent(`navigate`,{detail:e,bubbles:!0,composed:!0}))}_makeKeyHandler(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this._navigate(e))}}_scheduleReload(e=300){this._reloadDebounce!==null&&clearTimeout(this._reloadDebounce),this._reloadDebounce=setTimeout(()=>{this._reloadDebounce=null,this._loadData()},e)}_initSse(){!this.eventDispatcher||this._sse||(this._sse=new j(this,this.eventDispatcher,{"message:received":()=>{this._messagesToday++},"message:sent":()=>{this._messagesToday++},"session:created":()=>{this._sessionCount++},"system:error":()=>{this._errorCount++},"observability:token_usage":()=>{this._scheduleReload()},"diagnostic:channel_health":()=>{this._scheduleReload(500)},"diagnostic:billing_snapshot":()=>{this._scheduleReload()},"agent:hot_added":()=>{this._scheduleReload()},"agent:hot_removed":()=>{this._scheduleReload()},"channel:registered":()=>{this._scheduleReload()},"channel:deregistered":()=>{this._scheduleReload()},"observability:metrics":()=>{this._scheduleReload(500)}}))}_startRpcRefresh(){this._rpcRefreshInterval===null&&(this._rpcRefreshInterval=setInterval(()=>{this._loadRpcData()},Ee))}_stopRpcRefresh(){this._rpcRefreshInterval!==null&&(clearInterval(this._rpcRefreshInterval),this._rpcRefreshInterval=null)}async _loadRpcData(){if(!this.rpcClient||this.rpcClient.status!==`connected`)return;let e=this.rpcClient,[t,n,r,i,a,o,s,c]=await Promise.allSettled([e.call(`gateway.status`),e.call(`obs.delivery.stats`),e.call(`obs.billing.total`,{sinceMs:864e5}),e.call(`obs.billing.total`,{sinceMs:1728e5}),e.call(`session.list`,{}),e.call(`mcp.list`),e.call(`obs.context.pipeline`,{limit:50}),e.call(`obs.billing.usage24h`)]);if(t.status===`fulfilled`&&(this._systemHealth=t.value),n.status===`fulfilled`){let e=n.value,t=Number(e.total??e.totalDelivered??0),r=Number(e.successes??0),i=Number(e.failures??e.failed??0),a=Number(e.avgLatencyMs??0);this._deliveryStats={successRate:t>0?r/t*100:0,avgLatencyMs:a,totalDelivered:t,failed:i},this._messagesToday=t,this._errorCount=i}if(r.status===`fulfilled`){let e=Number(r.value.totalTokens??0),t=Number(r.value.totalCost??0);if(this._tokenUsageToday=e,this._totalCost=t,i.status===`fulfilled`){let n=Number(i.value.totalTokens??0),r=Number(i.value.totalCost??0);this._prevTokens=Math.max(0,n-e),this._prevCost=Math.max(0,r-t)}this._prevMessages=0}if(a.status===`fulfilled`&&(this._sessionCount=Number(a.value.total??0)),o.status===`fulfilled`){let e=o.value;if(!e.servers||e.total===0)this._mcpStatus=`N/A`;else{let t=e.servers.filter(e=>e.status===`connected`).length;this._mcpStatus=`${t}/${e.total}`}}if(s.status===`fulfilled`){let e=s.value;if(e&&e.length>0){let t=e.filter(e=>e.cacheHitTokens>0).length,n=e.reduce((e,t)=>e+t.budgetUtilization,0)/e.length,r=e.reduce((e,t)=>e+t.tokensEvicted,0);this._contextSummary={cacheHitRate:Math.round(t/e.length*100),budgetUtilization:Math.round(n),totalEvictions:r,reReads:e.length-t}}else this._contextSummary=null}c.status===`fulfilled`&&Array.isArray(c.value)&&(this._tokenSparklineData=c.value.map(e=>e.tokens)),await Promise.allSettled([this._loadCostSparkline(),this._loadAgentBilling()])}async _loadCostSparkline(){if(!this.rpcClient)return;let e=Array.from({length:7},(e,t)=>this.rpcClient.call(`obs.billing.total`,{sinceMs:864e5*(t+1)})),t=(await Promise.allSettled(e)).map(e=>e.status===`fulfilled`?Number(e.value.totalCost??0):0),n=t.map((e,n)=>n===0?e:Math.max(0,e-t[n-1]));this._costSparklineData=n.reverse()}async _loadSparklineData(){!this.rpcClient||this.rpcClient.status!==`connected`||await Promise.allSettled([(async()=>{let e=await this.rpcClient.call(`obs.billing.usage24h`);this._tokenSparklineData=e.map(e=>e.tokens)})(),this._loadCostSparkline()])}async _loadAgentBilling(){if(!this.rpcClient||this._agents.length===0)return;let e=await Promise.allSettled(this._agents.slice(0,20).map(e=>this.rpcClient.call(`obs.billing.byAgent`,{agentId:e.id}))),t=new Map;e.forEach((e,n)=>{e.status===`fulfilled`&&t.set(this._agents[n].id,{cost:e.value.totalCost??0,tokens:e.value.totalTokens??0})}),this._agentBilling=t}async _loadData(){if(this.apiClient){this._loadState=`loading`,this._error=``;try{let[e,t,n]=await Promise.all([this.apiClient.getAgents().catch(()=>[]),this.apiClient.getChannels().catch(()=>[]),this.apiClient.getActivity(50).catch(()=>[])]);this._agents=e,this._channels=t,this._activity=n,this._loadState=`loaded`,this._loadRpcData()}catch(e){this._error=e instanceof Error?e.message:`Failed to load dashboard data`,this._loadState=`error`}}}_computeDelta(e,t){if(t<=0)return e>0?{trend:`up`,trendValue:`+100%`}:{trend:`flat`,trendValue:``};let n=Math.round((e-t)/t*100);return n>0?{trend:`up`,trendValue:`+${n}%`}:n<0?{trend:`down`,trendValue:`${n}%`}:{trend:`flat`,trendValue:``}}_getSseSubscriber(){return this.apiClient?this.apiClient.subscribeEvents.bind(this.apiClient):null}_renderSystemHealth(){if(!this._systemHealth)return t`
2248
+ <div class="info-card info-card--link" role="link" tabindex="0"
2249
+ @click=${()=>this._navigate(q.health)}
2250
+ @keydown=${this._makeKeyHandler(q.health)}
2251
+ aria-label="View system overview"
2252
+ >
2253
+ <div class="info-card-title">System Health</div>
2254
+ <div class="info-row">
2255
+ <span class="info-label">Loading...</span>
2256
+ <span class="info-value">---</span>
2257
+ </div>
2258
+ </div>
2259
+ `;let e=this._systemHealth,n=e.memoryUsage??0,r=Math.round(n/1024/1024),i=e.eventLoopDelay??0,a=Ae(i,50,100),o=e.uptime??0,s=e.nodeVersion??`---`;return t`
2260
+ <div class="info-card info-card--link" role="link" tabindex="0"
2261
+ @click=${()=>this._navigate(q.health)}
2262
+ @keydown=${this._makeKeyHandler(q.health)}
2263
+ aria-label="View system overview"
2264
+ >
2265
+ <div class="info-card-title">System Health</div>
2266
+ <div class="info-row">
2267
+ <span class="info-label">Uptime</span>
2268
+ <span class="info-value">${De(o)}</span>
2269
+ </div>
2270
+ <div class="info-row">
2271
+ <span class="info-label">Memory (RSS)</span>
2272
+ <span class="info-value">${r} MB</span>
2273
+ </div>
2274
+ <div class="info-row">
2275
+ <span class="info-label">Event Loop Delay</span>
2276
+ <span class="info-value" style="color: ${a}">
2277
+ ${i.toFixed(1)}ms ${je(i,50,100)}
2278
+ </span>
2279
+ </div>
2280
+ <div class="info-row">
2281
+ <span class="info-label">Node.js</span>
2282
+ <span class="info-value">${s}</span>
2283
+ </div>
2284
+ <div class="info-row">
2285
+ <span class="info-label">MCP Servers</span>
2286
+ <span class="info-value">${this._mcpStatus}</span>
2287
+ </div>
2288
+ ${e.cpuUsage==null?d:t`
2289
+ <div class="info-row">
2290
+ <span class="info-label">CPU</span>
2291
+ <div style="flex: 1; max-width: 60%; margin-left: auto;">
2292
+ <ic-progress-bar
2293
+ .value=${Math.round(e.cpuUsage)}
2294
+ .showPercent=${!0}
2295
+ .thresholds=${{green:70,yellow:90}}
2296
+ ></ic-progress-bar>
2297
+ </div>
2298
+ </div>
2299
+ `}
2300
+ </div>
2301
+ `}_renderContextSummary(){if(!this._contextSummary)return t`
2302
+ <div class="info-card info-card--link" role="link" tabindex="0"
2303
+ @click=${()=>this._navigate(q.context)}
2304
+ @keydown=${this._makeKeyHandler(q.context)}
2305
+ aria-label="View context engine"
2306
+ >
2307
+ <div class="info-card-title">Context Engine</div>
2308
+ <div class="no-data-placeholder">No pipeline data</div>
2309
+ </div>
2310
+ `;let e=this._contextSummary;return t`
2311
+ <div class="info-card info-card--link" role="link" tabindex="0"
2312
+ @click=${()=>this._navigate(q.context)}
2313
+ @keydown=${this._makeKeyHandler(q.context)}
2314
+ aria-label="View context engine"
2315
+ >
2316
+ <div class="info-card-title">Context Engine</div>
2317
+ <div class="context-summary-grid">
2318
+ <div class="context-metric">
2319
+ <span class="context-metric-value">${e.cacheHitRate}%</span>
2320
+ <span class="context-metric-label">Cache Hit Rate</span>
2321
+ </div>
2322
+ <div class="context-metric">
2323
+ <ic-metric-gauge
2324
+ .value=${e.budgetUtilization}
2325
+ label="Budget Used"
2326
+ size="sm"
2327
+ ></ic-metric-gauge>
2328
+ </div>
2329
+ <div class="context-metric">
2330
+ <span class="context-metric-value">${J(e.reReads)}</span>
2331
+ <span class="context-metric-label">Re-reads</span>
2332
+ </div>
2333
+ <div class="context-metric">
2334
+ <span class="context-metric-value">${J(e.totalEvictions)}</span>
2335
+ <span class="context-metric-label">Evictions</span>
2336
+ </div>
2337
+ </div>
2338
+ </div>
2339
+ `}render(){if(this._loadState===`loading`)return t`<ic-skeleton-view variant="dashboard"></ic-skeleton-view>`;if(this._loadState===`error`)return t`
2340
+ <div class="error-container">
2341
+ <span class="error-message">${this._error}</span>
2342
+ <button class="retry-btn" @click=${()=>this._loadData()}>Retry</button>
2343
+ </div>
2344
+ `;let e=this._agents.filter(e=>e.status===`active`).length,n=this.rpcClient!=null,r=this._computeDelta(this._messagesToday,this._prevMessages),i=this._computeDelta(this._tokenUsageToday,this._prevTokens),a=this._computeDelta(this._totalCost,this._prevCost);return t`
2345
+ <div class="dashboard-grid" role="region" aria-label="Dashboard">
2346
+ <!-- Stats row: 6 stat cards with click-to-navigate -->
2347
+ <div class="stats-row" aria-live="polite">
2348
+ <div class="stat-card-link" role="link" tabindex="0"
2349
+ @click=${()=>this._navigate(q.agents)}
2350
+ @keydown=${this._makeKeyHandler(q.agents)}
2351
+ aria-label="View all agents"
2352
+ >
2353
+ <ic-stat-card
2354
+ label="Active Agents"
2355
+ .value=${`${e}/${this._agents.length}`}
2356
+ ></ic-stat-card>
2357
+ </div>
2358
+ <div class="stat-card-link" role="link" tabindex="0"
2359
+ @click=${()=>this._navigate(q.sessions)}
2360
+ @keydown=${this._makeKeyHandler(q.sessions)}
2361
+ aria-label="View all sessions"
2362
+ >
2363
+ <ic-stat-card
2364
+ label="Sessions"
2365
+ .value=${n?J(this._sessionCount):`---`}
2366
+ ></ic-stat-card>
2367
+ </div>
2368
+ <div class="stat-card-link" role="link" tabindex="0"
2369
+ @click=${()=>this._navigate(q.messages)}
2370
+ @keydown=${this._makeKeyHandler(q.messages)}
2371
+ aria-label="View message delivery"
2372
+ >
2373
+ <ic-stat-card
2374
+ label="Messages Today"
2375
+ .value=${n?J(this._messagesToday):`---`}
2376
+ .trend=${n?r.trend:``}
2377
+ .trendValue=${n?r.trendValue:``}
2378
+ ></ic-stat-card>
2379
+ </div>
2380
+ <div class="stat-card-link" role="link" tabindex="0"
2381
+ @click=${()=>this._navigate(q.tokens)}
2382
+ @keydown=${this._makeKeyHandler(q.tokens)}
2383
+ aria-label="View token billing"
2384
+ >
2385
+ <ic-stat-card
2386
+ label="Tokens Today"
2387
+ .value=${n?Oe(this._tokenUsageToday):`---`}
2388
+ .trend=${n?i.trend:``}
2389
+ .trendValue=${n?i.trendValue:``}
2390
+ ></ic-stat-card>
2391
+ </div>
2392
+ <div class="stat-card-link" role="link" tabindex="0"
2393
+ @click=${()=>this._navigate(q.cost)}
2394
+ @keydown=${this._makeKeyHandler(q.cost)}
2395
+ aria-label="View cost billing"
2396
+ >
2397
+ <ic-stat-card
2398
+ label="Cost Today"
2399
+ .value=${n?ke.format(this._totalCost):`---`}
2400
+ .trend=${n?a.trend:``}
2401
+ .trendValue=${n?a.trendValue:``}
2402
+ ></ic-stat-card>
2403
+ </div>
2404
+ <div class="stat-card-link" role="link" tabindex="0"
2405
+ @click=${()=>this._navigate(q.errors)}
2406
+ @keydown=${this._makeKeyHandler(q.errors)}
2407
+ aria-label="View error diagnostics"
2408
+ >
2409
+ <ic-stat-card
2410
+ label="Errors"
2411
+ .value=${n?J(this._errorCount):`---`}
2412
+ .threshold=${this._errorCount>10?`critical`:this._errorCount>3?`warning`:`normal`}
2413
+ ></ic-stat-card>
2414
+ </div>
2415
+ </div>
2416
+
2417
+ <!-- Info cards row: System Health + Context Engine Summary (clickable) -->
2418
+ <div class="info-cards-row">
2419
+ ${this._renderSystemHealth()}
2420
+ ${this._renderContextSummary()}
2421
+ </div>
2422
+
2423
+ <!-- Sparklines row -->
2424
+ <div class="sparklines-row">
2425
+ <div class="sparkline-card" role="link" tabindex="0"
2426
+ @click=${()=>this._navigate(q.tokens)}
2427
+ @keydown=${this._makeKeyHandler(q.tokens)}
2428
+ aria-label="View token usage details"
2429
+ >
2430
+ <div class="sparkline-header">
2431
+ <span class="sparkline-title">Token Usage (24h)</span>
2432
+ <ic-sparkline
2433
+ .data=${this._tokenSparklineData}
2434
+ width=${120}
2435
+ height=${32}
2436
+ color="var(--ic-accent)"
2437
+ ></ic-sparkline>
2438
+ </div>
2439
+ </div>
2440
+ <div class="sparkline-card" role="link" tabindex="0"
2441
+ @click=${()=>this._navigate(q.cost)}
2442
+ @keydown=${this._makeKeyHandler(q.cost)}
2443
+ aria-label="View cost trend details"
2444
+ >
2445
+ <div class="sparkline-header">
2446
+ <span class="sparkline-title">Cost Trend (7d)</span>
2447
+ <ic-sparkline
2448
+ .data=${this._costSparklineData}
2449
+ width=${120}
2450
+ height=${32}
2451
+ color="var(--ic-success)"
2452
+ ></ic-sparkline>
2453
+ </div>
2454
+ </div>
2455
+ </div>
2456
+
2457
+ <!-- Agents section -->
2458
+ <div class="section">
2459
+ <span class="section-title section-title--link"
2460
+ role="link" tabindex="0"
2461
+ @click=${()=>this._navigate(q.agents)}
2462
+ @keydown=${this._makeKeyHandler(q.agents)}
2463
+ >Agents</span>
2464
+ <div class="agents-grid">
2465
+ ${this._agents.length===0?t`<div class="empty-text">No agents configured</div>`:this._agents.map(e=>{let n=this._agentBilling.get(e.id);return t`
2466
+ <div class="agent-card-wrapper">
2467
+ <ic-agent-card
2468
+ .name=${e.name??e.id}
2469
+ .provider=${e.provider}
2470
+ .model=${e.model}
2471
+ .status=${e.status}
2472
+ .agentId=${e.id}
2473
+ .messagesToday=${e.messagesToday??0}
2474
+ .tokenUsageToday=${e.tokenUsageToday??0}
2475
+ ></ic-agent-card>
2476
+ ${n?t`<div class="agent-cost-badge">${ke.format(n.cost)}</div>`:d}
2477
+ </div>
2478
+ `})}
2479
+ </div>
2480
+ </div>
2481
+
2482
+ <!-- Channels section -->
2483
+ <div class="section">
2484
+ <span class="section-title section-title--link"
2485
+ role="link" tabindex="0"
2486
+ @click=${()=>this._navigate(q.channels)}
2487
+ @keydown=${this._makeKeyHandler(q.channels)}
2488
+ >Channels</span>
2489
+ <div class="channels-row">
2490
+ ${this._channels.length===0?t`<div class="empty-text">No channels configured</div>`:this._channels.map(e=>t`
2491
+ <ic-channel-badge
2492
+ .channelType=${e.type}
2493
+ .name=${e.name}
2494
+ .status=${e.status}
2495
+ .enabled=${e.enabled}
2496
+ .uptime=${e.uptime}
2497
+ ></ic-channel-badge>
2498
+ `)}
2499
+ </div>
2500
+ </div>
2501
+
2502
+ <!-- Activity section -->
2503
+ <div class="section">
2504
+ <ic-activity-feed
2505
+ .entries=${this._activity}
2506
+ .sseSubscribe=${this._getSseSubscriber()}
2507
+ ></ic-activity-feed>
2508
+ </div>
2509
+ </div>
2510
+ `}};u([l({attribute:!1})],Y.prototype,`apiClient`,void 0),u([l({attribute:!1})],Y.prototype,`rpcClient`,void 0),u([l({attribute:!1})],Y.prototype,`eventDispatcher`,void 0),u([s()],Y.prototype,`_loadState`,void 0),u([s()],Y.prototype,`_error`,void 0),u([s()],Y.prototype,`_agents`,void 0),u([s()],Y.prototype,`_channels`,void 0),u([s()],Y.prototype,`_activity`,void 0),u([s()],Y.prototype,`_systemHealth`,void 0),u([s()],Y.prototype,`_deliveryStats`,void 0),u([s()],Y.prototype,`_messagesToday`,void 0),u([s()],Y.prototype,`_tokenUsageToday`,void 0),u([s()],Y.prototype,`_sessionCount`,void 0),u([s()],Y.prototype,`_errorCount`,void 0),u([s()],Y.prototype,`_totalCost`,void 0),u([s()],Y.prototype,`_prevMessages`,void 0),u([s()],Y.prototype,`_prevTokens`,void 0),u([s()],Y.prototype,`_prevCost`,void 0),u([s()],Y.prototype,`_mcpStatus`,void 0),u([s()],Y.prototype,`_contextSummary`,void 0),u([s()],Y.prototype,`_tokenSparklineData`,void 0),u([s()],Y.prototype,`_costSparklineData`,void 0),u([s()],Y.prototype,`_agentBilling`,void 0),Y=u([e(`ic-dashboard`)],Y);var Me=`modulepreload`,Ne=function(e){return`/app/`+e},X={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Ne(t,n),t in X)return;X[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Me,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Pe={"ic-chat-console":()=>Z(()=>import(`./chat-console-BumBaIgO.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),"ic-memory-inspector":()=>Z(()=>import(`./memory-inspector-D5Re9ptG.js`),__vite__mapDeps([12,1,13,6,7,14,10,15])),"ic-agent-list":()=>Z(()=>import(`./agent-list-6Uotjatr.js`),__vite__mapDeps([16,1,13,7,4,14,9,10])),"ic-agent-detail":()=>Z(()=>import(`./agent-detail-ru-AhppM.js`),__vite__mapDeps([17,1,6,7,14,18])),"ic-agent-editor":()=>Z(()=>import(`./agent-editor-hjwRuFVp.js`),__vite__mapDeps([19,1,7,20,18])),"ic-workspace-manager":()=>Z(()=>import(`./workspace-manager-DlvBixiq.js`),__vite__mapDeps([21,1,6,7,14,9,4,18])),"ic-skills-view":()=>Z(()=>import(`./skills-BCOGPf6s.js`),__vite__mapDeps([22,1,7,14,9,4,10,23])),"ic-mcp-management":()=>Z(()=>import(`./mcp-management-5jyScQis.js`),__vite__mapDeps([24,1,6,7,14,9,4])),"ic-models-view":()=>Z(()=>import(`./models-D5vu07MR.js`),__vite__mapDeps([25,1,7,26,4,9,10,23])),"ic-channel-list":()=>Z(()=>import(`./channel-list-FkfeOLBQ.js`),__vite__mapDeps([27,1,14,9,4])),"ic-channel-detail":()=>Z(()=>import(`./channel-detail-BBCKtmne.js`),__vite__mapDeps([28,1,6,7,26,4,9,18,23])),"ic-message-center":()=>Z(()=>import(`./message-center-cRLK6ZmG.js`),__vite__mapDeps([29,1,6,14,9,4,18])),"ic-scheduler-view":()=>Z(()=>import(`./scheduler-VafN_8xi.js`),__vite__mapDeps([30,1,6,7,4,9,23])),"ic-session-list-view":()=>Z(()=>import(`./session-list-DfCm8Cec.js`),__vite__mapDeps([31,1,13,6,7,14,9,4,10,11])),"ic-session-detail":()=>Z(()=>import(`./session-detail-BpZ_8Yih.js`),__vite__mapDeps([32,1,2,3,4,5,33,6,7,8,14,9,18,11])),"ic-observe-dashboard":()=>Z(()=>import(`./observe-view-CalNNEmd.js`),__vite__mapDeps([34,1,35,6,7,36,9,4,23])),"ic-context-engine-view":()=>Z(()=>import(`./context-engine-BENY3pWE.js`),__vite__mapDeps([37,1,5,33,6,9,4])),"ic-billing-view":()=>Z(()=>import(`./billing-view-CxysXH0p.js`),__vite__mapDeps([38,1,39,9,4])),"ic-delivery-view":()=>Z(()=>import(`./delivery-view-BCnkPsAp.js`),__vite__mapDeps([40,1,6,39,36,7,9,4,15])),"ic-diagnostics-view":()=>Z(()=>import(`./diagnostics-view-C_jQFG2H.js`),__vite__mapDeps([41,1,35,6,7,39,9,4])),"ic-subagents-view":()=>Z(()=>import(`./subagents-l-auUraL.js`),__vite__mapDeps([42,1,6,7,14,9,4])),"ic-security-view":()=>Z(()=>import(`./security-QQXMRTlo.js`),__vite__mapDeps([43,1,6,7,26,4,9,20,44,23])),"ic-approvals-view":()=>Z(()=>import(`./approvals-C-K6hN2U.js`),__vite__mapDeps([45,1])),"ic-config-editor":()=>Z(()=>import(`./config-editor-C9BSwHGy.js`),__vite__mapDeps([46,1,6,7,14,9,4,20,44,23])),"ic-setup-wizard":()=>Z(()=>import(`./setup-wizard-C-z477CG.js`),__vite__mapDeps([47,1,4])),"ic-pipeline-list":()=>Z(()=>import(`./pipeline-list-BHlaBKww.js`),__vite__mapDeps([48,1,4,14,9,49,18])),"ic-pipeline-builder":()=>Z(()=>import(`./pipeline-builder-DUYDGwZf.js`),__vite__mapDeps([50,1,51,3,14,49,18])),"ic-pipeline-monitor":()=>Z(()=>import(`./pipeline-monitor-BhtpNEHf.js`),__vite__mapDeps([52,1,51,3,14,18])),"ic-pipeline-history":()=>Z(()=>import(`./pipeline-history-BAO8brOe.js`),__vite__mapDeps([53,1,4,14,9,18])),"ic-pipeline-history-detail":()=>Z(()=>import(`./pipeline-history-detail-DectIoQt.js`),__vite__mapDeps([54,1,2,3,4,14,18])),"ic-context-dag-browser":()=>Z(()=>import(`./context-dag-browser-BHm00mJD.js`),__vite__mapDeps([55,1,6,7,9,4,10,15])),"ic-media-test-view":()=>Z(()=>import(`./media-test-DGTCtM8-.js`),__vite__mapDeps([56,1,9,4,23])),"ic-media-config-view":()=>Z(()=>import(`./media-config-J9oT9PPs.js`),__vite__mapDeps([57,1]))},Q=`comis_token`,$=class extends i{constructor(...e){super(...e),this._authenticated=!1,this._authError=``,this._currentView=`ic-dashboard`,this._currentRoute=`dashboard`,this._routeParams={},this._connectionStatus=`disconnected`,this._pendingApprovals=0,this._errorCount=0,this._agentCount=0,this._channelCount=0,this._sessionCount=0,this._sidebarOpen=!1,this._viewLoading=!1,this._commandPaletteOpen=!1,this._shortcutsHelpOpen=!1,this._agentList=[],this._sessionList=[],this._loadedViews=new Set,this._pendingGotoKey=null,this._apiClient=null,this._router=null,this._rpcClient=null,this._globalState=null,this._eventDispatcher=null,this._stateUnsubscribe=null,this._approvalUnsub=null,this._approvalResolvedUnsub=null,this._errorUnsub=null,this._pollingController=null,this._token=``,this._boundKeyHandler=this._handleGlobalKeydown.bind(this),this._gotoWaiting=!1}static{this.styles=n`
2511
+ :host {
2512
+ display: block;
2513
+ min-height: 100vh;
2514
+ background: var(--ic-bg, #030712);
2515
+ color: var(--ic-text, #f3f4f6);
2516
+ font-family: var(--ic-font-sans, ui-sans-serif, system-ui, sans-serif);
2517
+ }
2518
+
2519
+ .auth-container {
2520
+ display: flex;
2521
+ flex-direction: column;
2522
+ align-items: center;
2523
+ justify-content: center;
2524
+ min-height: 100vh;
2525
+ padding: 1rem;
2526
+ }
2527
+
2528
+ .auth-card {
2529
+ background: var(--ic-surface, #111827);
2530
+ border: 1px solid var(--ic-border, #374151);
2531
+ border-radius: var(--ic-radius-lg, 0.75rem);
2532
+ padding: 2rem;
2533
+ max-width: 24rem;
2534
+ width: 100%;
2535
+ }
2536
+
2537
+ .auth-title {
2538
+ font-size: 1.5rem;
2539
+ font-weight: 700;
2540
+ margin-bottom: 0.25rem;
2541
+ }
2542
+
2543
+ .auth-subtitle {
2544
+ color: var(--ic-text-muted, #9ca3af);
2545
+ margin-bottom: 1.5rem;
2546
+ font-size: 0.875rem;
2547
+ }
2548
+
2549
+ .auth-input {
2550
+ width: 100%;
2551
+ padding: 0.625rem 0.75rem;
2552
+ background: var(--ic-surface-2, #1f2937);
2553
+ border: 1px solid #4b5563;
2554
+ border-radius: var(--ic-radius-md, 0.5rem);
2555
+ color: var(--ic-text, #f3f4f6);
2556
+ font-size: 0.875rem;
2557
+ outline: none;
2558
+ box-sizing: border-box;
2559
+ }
2560
+
2561
+ .auth-input:focus {
2562
+ border-color: var(--ic-accent, #3b82f6);
2563
+ }
2564
+
2565
+ .auth-input::placeholder {
2566
+ color: var(--ic-text-dim, #6b7280);
2567
+ }
2568
+
2569
+ .auth-btn {
2570
+ width: 100%;
2571
+ padding: 0.625rem;
2572
+ margin-top: 1rem;
2573
+ background: var(--ic-accent, #3b82f6);
2574
+ color: white;
2575
+ border: none;
2576
+ border-radius: var(--ic-radius-md, 0.5rem);
2577
+ font-size: 0.875rem;
2578
+ font-weight: 500;
2579
+ cursor: pointer;
2580
+ }
2581
+
2582
+ .auth-btn:hover {
2583
+ background: var(--ic-accent-hover, #2563eb);
2584
+ }
2585
+
2586
+ .auth-error {
2587
+ color: var(--ic-error, #f87171);
2588
+ font-size: 0.75rem;
2589
+ margin-top: 0.5rem;
2590
+ }
2591
+
2592
+ /* Shell layout: sidebar + main area */
2593
+ .shell {
2594
+ display: flex;
2595
+ min-height: 100vh;
2596
+ }
2597
+
2598
+ .shell-main {
2599
+ flex: 1;
2600
+ display: flex;
2601
+ flex-direction: column;
2602
+ min-width: 0;
2603
+ }
2604
+
2605
+ .content {
2606
+ flex: 1;
2607
+ padding: var(--ic-space-lg, 1.5rem);
2608
+ max-width: 1440px;
2609
+ width: 100%;
2610
+ margin: 0 auto;
2611
+ box-sizing: border-box;
2612
+ overflow-y: auto;
2613
+ }
2614
+
2615
+ /* Placeholder for unimplemented views */
2616
+ .placeholder {
2617
+ display: flex;
2618
+ flex-direction: column;
2619
+ align-items: center;
2620
+ justify-content: center;
2621
+ min-height: 300px;
2622
+ color: var(--ic-text-dim, #6b7280);
2623
+ font-size: 1rem;
2624
+ }
2625
+
2626
+ .placeholder-title {
2627
+ font-size: 1.25rem;
2628
+ font-weight: 600;
2629
+ margin-bottom: 0.5rem;
2630
+ color: var(--ic-text-muted, #9ca3af);
2631
+ }
2632
+
2633
+ /* Keyboard shortcuts help overlay */
2634
+ .shortcuts-backdrop {
2635
+ position: fixed;
2636
+ inset: 0;
2637
+ background: rgba(0, 0, 0, 0.5);
2638
+ z-index: 99;
2639
+ display: flex;
2640
+ align-items: center;
2641
+ justify-content: center;
2642
+ }
2643
+
2644
+ .shortcuts-panel {
2645
+ background: var(--ic-surface, #111827);
2646
+ border: 1px solid var(--ic-border, #374151);
2647
+ border-radius: var(--ic-radius-lg, 0.75rem);
2648
+ padding: 1.5rem;
2649
+ max-width: 400px;
2650
+ width: 90%;
2651
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
2652
+ }
2653
+
2654
+ .shortcuts-title {
2655
+ font-size: 1.125rem;
2656
+ font-weight: 600;
2657
+ margin-bottom: 1rem;
2658
+ }
2659
+
2660
+ .shortcuts-table {
2661
+ width: 100%;
2662
+ border-collapse: collapse;
2663
+ }
2664
+
2665
+ .shortcuts-table td {
2666
+ padding: 0.375rem 0;
2667
+ font-size: 0.875rem;
2668
+ }
2669
+
2670
+ .shortcuts-table td:first-child {
2671
+ color: var(--ic-text-dim, #6b7280);
2672
+ padding-right: 1rem;
2673
+ white-space: nowrap;
2674
+ }
2675
+
2676
+ .shortcuts-table kbd {
2677
+ background: var(--ic-surface-2, #1f2937);
2678
+ border: 1px solid var(--ic-border, #374151);
2679
+ border-radius: 3px;
2680
+ padding: 2px 6px;
2681
+ font-size: 0.75rem;
2682
+ font-family: inherit;
2683
+ }
2684
+ `}connectedCallback(){super.connectedCallback();let e=sessionStorage.getItem(Q);e&&this._initWithToken(e),document.addEventListener(`keydown`,this._boundKeyHandler)}disconnectedCallback(){super.disconnectedCallback(),this._cleanup(),document.removeEventListener(`keydown`,this._boundKeyHandler),this._pendingGotoKey&&=(clearTimeout(this._pendingGotoKey),null)}_isInputTarget(e){let t=e.target?.tagName;return!!(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.target?.isContentEditable)}_handleGlobalKeydown(e){if((e.ctrlKey||e.metaKey)&&e.key===`k`){e.preventDefault(),this._commandPaletteOpen=!this._commandPaletteOpen;return}if(e.key===`Escape`){if(this._commandPaletteOpen){this._commandPaletteOpen=!1;return}if(this._shortcutsHelpOpen){this._shortcutsHelpOpen=!1;return}this.dispatchEvent(new CustomEvent(`close-overlay`,{bubbles:!0,composed:!0})),this._sidebarOpen&&=!1;return}if(!this._isInputTarget(e)&&!this._commandPaletteOpen){if(e.key===`?`&&!e.ctrlKey&&!e.metaKey&&!e.altKey){this._shortcutsHelpOpen=!this._shortcutsHelpOpen;return}if(this._gotoWaiting){switch(this._gotoWaiting=!1,this._pendingGotoKey&&=(clearTimeout(this._pendingGotoKey),null),e.key.toLowerCase()){case`d`:this._router?.navigate(`dashboard`);return;case`a`:this._router?.navigate(`agents`);return;case`c`:this._router?.navigate(`chat`);return;case`s`:this._router?.navigate(`sessions`);return;case`o`:this._router?.navigate(`observe/overview`);return}return}e.key===`g`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(this._gotoWaiting=!0,this._pendingGotoKey=setTimeout(()=>{this._gotoWaiting=!1,this._pendingGotoKey=null},500))}}_handleCommand(e){switch(e){case`refresh`:window.location.reload();break;case`toggle-sidebar`:this._sidebarOpen=!this._sidebarOpen;break;case`logout`:this._handleLogout();break;case`show-shortcuts`:this._shortcutsHelpOpen=!0;break}}_initWithToken(e){this._token=e;let t=`${window.location.protocol}//${window.location.host}`;this._apiClient=f(t,e),this._apiClient.getAgents().then(()=>{sessionStorage.setItem(Q,e),this._authenticated=!0,this._authError=``,this._rpcClient=b();let n=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`;this._rpcClient.connect(n,e);let r=this._rpcClient;this._apiClient=f(t,e,(e,t)=>r.call(e,t)),this._globalState=ae(),this._rpcClient.onStatusChange(e=>{this._globalState?.update({connectionStatus:e})}),this._eventDispatcher=se(),this._eventDispatcher.start(t,e),this._approvalUnsub=this._eventDispatcher.addEventListener(`approval:requested`,()=>{let e=this._globalState.getSnapshot();this._globalState.update({pendingApprovals:e.pendingApprovals+1})}),this._approvalResolvedUnsub=this._eventDispatcher.addEventListener(`approval:resolved`,()=>{let e=this._globalState.getSnapshot();this._globalState.update({pendingApprovals:Math.max(0,e.pendingApprovals-1)})}),this._errorUnsub=this._eventDispatcher.addEventListener(`system:error`,()=>{let e=this._globalState.getSnapshot();this._globalState.update({errorCount:(e.errorCount??0)+1})}),this._stateUnsubscribe=this._globalState.subscribe(()=>{let e=this._globalState.getSnapshot();this._connectionStatus=e.connectionStatus,this._pendingApprovals=e.pendingApprovals,this._errorCount=e.errorCount,this._agentCount=e.agentCount,this._channelCount=e.channelCount,this._sessionCount=e.sessionCount}),this._pollingController=new ce(this,this._rpcClient,e=>{this._agentCount=e.agents,this._channelCount=e.channels,this._sessionCount=e.sessions,this._agentList=e.agentIds.map(e=>({id:e})),this._sessionList=e.sessionEntries.map(e=>({key:e.sessionKey,agentId:e.agentId}))},3e4),this._pollingController.hostConnected(),this._router=v(e=>{this._currentView=e.view,this._currentRoute=e.route,this._routeParams=e.params}),this._router.start()}).catch(()=>{this._authError=`Invalid token or server unreachable`,sessionStorage.removeItem(Q)})}_handleLogin(e){e.preventDefault();let t=e.target.querySelector(`input`).value.trim();if(!t){this._authError=`Please enter a token`;return}this._initWithToken(t)}_handleLogout(){sessionStorage.removeItem(Q),this._authenticated=!1,this._cleanup(),this._apiClient=null,this._token=``}_cleanup(){this._pollingController&&=(this._pollingController.hostDisconnected(),null),this._rpcClient?.disconnect(),this._rpcClient=null,this._eventDispatcher?.stop(),this._eventDispatcher=null,this._stateUnsubscribe?.(),this._stateUnsubscribe=null,this._approvalUnsub?.(),this._approvalUnsub=null,this._approvalResolvedUnsub?.(),this._approvalResolvedUnsub=null,this._errorUnsub?.(),this._errorUnsub=null,this._globalState=null,this._router?.stop(),this._router=null}_renderAuth(){return t`
2685
+ <div class="auth-container">
2686
+ <div class="auth-card">
2687
+ <div class="auth-title">Comis</div>
2688
+ <div class="auth-subtitle">Enter your gateway token to continue</div>
2689
+ <form @submit=${this._handleLogin}>
2690
+ <input
2691
+ class="auth-input"
2692
+ type="password"
2693
+ placeholder="Gateway bearer token"
2694
+ autocomplete="off"
2695
+ />
2696
+ ${this._authError?t`<div class="auth-error">${this._authError}</div>`:d}
2697
+ <button class="auth-btn" type="submit">Connect</button>
2698
+ </form>
2699
+ </div>
2700
+ </div>
2701
+ `}_renderApp(){return t`
2702
+ <div class="shell">
2703
+ <ic-sidebar
2704
+ .currentRoute=${this._currentRoute}
2705
+ .pendingApprovals=${this._pendingApprovals}
2706
+ .errorCount=${this._errorCount}
2707
+ .agentCount=${this._agentCount}
2708
+ .channelCount=${this._channelCount}
2709
+ .sessionCount=${this._sessionCount}
2710
+ ?open=${this._sidebarOpen}
2711
+ @navigate=${e=>{this._router?.navigate(e.detail),this._sidebarOpen=!1}}
2712
+ @logout=${()=>this._handleLogout()}
2713
+ @close=${()=>{this._sidebarOpen=!1}}
2714
+ ></ic-sidebar>
2715
+ <div class="shell-main">
2716
+ <ic-topbar
2717
+ .connectionStatus=${this._connectionStatus}
2718
+ .notificationCount=${this._pendingApprovals}
2719
+ .tokenId=${this._token}
2720
+ @toggle-sidebar=${()=>{this._sidebarOpen=!this._sidebarOpen}}
2721
+ @logout=${()=>this._handleLogout()}
2722
+ ></ic-topbar>
2723
+ <main class="content" role="main" aria-label="Main content" @navigate=${e=>{this._router?.navigate(e.detail)}}>
2724
+ ${this._renderView()}
2725
+ </main>
2726
+ </div>
2727
+ </div>
2728
+ ${this._commandPaletteOpen?t`
2729
+ <ic-command-palette
2730
+ ?open=${this._commandPaletteOpen}
2731
+ .agents=${this._agentList}
2732
+ .sessions=${this._sessionList}
2733
+ @navigate=${e=>{this._router?.navigate(e.detail),this._commandPaletteOpen=!1}}
2734
+ @close=${()=>{this._commandPaletteOpen=!1}}
2735
+ @command=${e=>this._handleCommand(e.detail)}
2736
+ ></ic-command-palette>
2737
+ `:d}
2738
+ ${this._shortcutsHelpOpen?this._renderShortcutsHelp():d}
2739
+ <ic-toast></ic-toast>
2740
+ `}_renderShortcutsHelp(){return t`
2741
+ <div class="shortcuts-backdrop" @click=${e=>{e.target.classList.contains(`shortcuts-backdrop`)&&(this._shortcutsHelpOpen=!1)}}>
2742
+ <div class="shortcuts-panel" role="dialog" aria-label="Keyboard shortcuts">
2743
+ <div class="shortcuts-title">Keyboard Shortcuts</div>
2744
+ <table class="shortcuts-table">
2745
+ <tbody>
2746
+ <tr><td><kbd>Ctrl</kbd>+<kbd>K</kbd></td><td>Command Palette</td></tr>
2747
+ <tr><td><kbd>Esc</kbd></td><td>Close Overlay</td></tr>
2748
+ <tr><td><kbd>?</kbd></td><td>Toggle This Help</td></tr>
2749
+ <tr><td><kbd>G</kbd> then <kbd>D</kbd></td><td>Go to Dashboard</td></tr>
2750
+ <tr><td><kbd>G</kbd> then <kbd>A</kbd></td><td>Go to Agents</td></tr>
2751
+ <tr><td><kbd>G</kbd> then <kbd>C</kbd></td><td>Go to Chat</td></tr>
2752
+ <tr><td><kbd>G</kbd> then <kbd>S</kbd></td><td>Go to Sessions</td></tr>
2753
+ <tr><td><kbd>G</kbd> then <kbd>O</kbd></td><td>Go to Observability</td></tr>
2754
+ </tbody>
2755
+ </table>
2756
+ </div>
2757
+ </div>
2758
+ `}async _loadViewIfNeeded(e){if(this._loadedViews.has(e))return;let t=Pe[e];if(t){this._viewLoading=!0;try{await t(),this._loadedViews.add(e)}finally{this._viewLoading=!1}}}_getSkeletonVariant(){switch(this._currentView){case`ic-dashboard`:return`dashboard`;case`ic-agent-detail`:case`ic-session-detail`:case`ic-channel-detail`:case`ic-chat-console`:case`ic-message-center`:return`detail`;case`ic-config-editor`:case`ic-pipeline-builder`:case`ic-workspace-manager`:return`editor`;case`ic-billing-view`:case`ic-delivery-view`:case`ic-diagnostics-view`:case`ic-observe-dashboard`:case`ic-context-engine-view`:case`ic-memory-inspector`:case`ic-media-test-view`:case`ic-media-config-view`:return`table`;default:return`list`}}_renderView(){if(!this._loadedViews.has(this._currentView)&&Pe[this._currentView])return this._loadViewIfNeeded(this._currentView),t`<ic-skeleton-view variant=${this._getSkeletonVariant()}></ic-skeleton-view>`;switch(this._currentView){case`ic-dashboard`:return t`<ic-dashboard .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-dashboard>`;case`ic-chat-console`:return t`<ic-chat-console
2759
+ .apiClient=${this._apiClient}
2760
+ .rpcClient=${this._rpcClient}
2761
+ .eventDispatcher=${this._eventDispatcher}
2762
+ .sessionKey=${this._routeParams.sessionKey??``}
2763
+ .authToken=${this._token}
2764
+ ></ic-chat-console>`;case`ic-memory-inspector`:return t`<ic-memory-inspector .apiClient=${this._apiClient} .rpcClient=${this._rpcClient}></ic-memory-inspector>`;case`ic-agent-list`:return t`<ic-agent-list .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-agent-list>`;case`ic-agent-detail`:return t`<ic-agent-detail .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher} .agentId=${this._routeParams.id??``}></ic-agent-detail>`;case`ic-agent-editor`:return t`<ic-agent-editor .rpcClient=${this._rpcClient} .agentId=${this._routeParams.id??``}></ic-agent-editor>`;case`ic-workspace-manager`:return t`<ic-workspace-manager
2765
+ .rpcClient=${this._rpcClient}
2766
+ .agentId=${this._routeParams.id??``}
2767
+ ></ic-workspace-manager>`;case`ic-skills-view`:return t`<ic-skills-view .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-skills-view>`;case`ic-mcp-management`:return t`<ic-mcp-management .rpcClient=${this._rpcClient} .apiClient=${this._apiClient} .eventDispatcher=${this._eventDispatcher}></ic-mcp-management>`;case`ic-models-view`:return t`<ic-models-view .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-models-view>`;case`ic-channel-list`:return t`<ic-channel-list
2768
+ .apiClient=${this._apiClient}
2769
+ .rpcClient=${this._rpcClient}
2770
+ .eventDispatcher=${this._eventDispatcher}
2771
+ @navigate=${e=>{this._router?.navigate(e.detail)}}
2772
+ ></ic-channel-list>`;case`ic-channel-detail`:return t`<ic-channel-detail
2773
+ .apiClient=${this._apiClient}
2774
+ .rpcClient=${this._rpcClient}
2775
+ .eventDispatcher=${this._eventDispatcher}
2776
+ .channelType=${this._routeParams.type??``}
2777
+ @navigate=${e=>{this._router?.navigate(e.detail)}}
2778
+ ></ic-channel-detail>`;case`ic-message-center`:return t`<ic-message-center
2779
+ .rpcClient=${this._rpcClient}
2780
+ .eventDispatcher=${this._eventDispatcher}
2781
+ .channelType=${this._routeParams.type??``}
2782
+ @navigate=${e=>{this._router?.navigate(e.detail)}}
2783
+ ></ic-message-center>`;case`ic-scheduler-view`:return t`<ic-scheduler-view
2784
+ .rpcClient=${this._rpcClient}
2785
+ .eventDispatcher=${this._eventDispatcher}
2786
+ .routeParams=${this._routeParams}
2787
+ ></ic-scheduler-view>`;case`ic-session-list-view`:return t`<ic-session-list-view .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-session-list-view>`;case`ic-session-detail`:return t`<ic-session-detail .apiClient=${this._apiClient} .rpcClient=${this._rpcClient} .sessionKey=${this._routeParams.key??``}></ic-session-detail>`;case`ic-subagents-view`:return t`<ic-subagents-view .rpcClient=${this._rpcClient} .apiClient=${this._apiClient} .eventDispatcher=${this._eventDispatcher}></ic-subagents-view>`;case`ic-security-view`:return t`<ic-security-view .rpcClient=${this._rpcClient} .apiClient=${this._apiClient} .eventDispatcher=${this._eventDispatcher}></ic-security-view>`;case`ic-approvals-view`:return t`<ic-approvals-view .rpcClient=${this._rpcClient} .apiClient=${this._apiClient}></ic-approvals-view>`;case`ic-config-editor`:return t`<ic-config-editor .rpcClient=${this._rpcClient}></ic-config-editor>`;case`ic-setup-wizard`:return t`<ic-setup-wizard .rpcClient=${this._rpcClient}></ic-setup-wizard>`;case`ic-observe-dashboard`:return t`<ic-observe-view .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher} .initialTab=${`overview`}></ic-observe-view>`;case`ic-context-engine-view`:return t`<ic-context-engine-view .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-context-engine-view>`;case`ic-context-dag-browser`:return t`<ic-context-dag-browser .rpcClient=${this._rpcClient}></ic-context-dag-browser>`;case`ic-media-test-view`:return t`<ic-media-test-view .rpcClient=${this._rpcClient} .apiClient=${this._apiClient}></ic-media-test-view>`;case`ic-media-config-view`:return t`<ic-media-config-view .rpcClient=${this._rpcClient}></ic-media-config-view>`;case`ic-billing-view`:return t`<ic-billing-view .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-billing-view>`;case`ic-delivery-view`:return t`<ic-delivery-view .rpcClient=${this._rpcClient}></ic-delivery-view>`;case`ic-diagnostics-view`:return t`<ic-diagnostics-view .rpcClient=${this._rpcClient} .eventDispatcher=${this._eventDispatcher}></ic-diagnostics-view>`;case`ic-pipeline-list`:return t`<ic-pipeline-list .rpcClient=${this._rpcClient}></ic-pipeline-list>`;case`ic-pipeline-builder`:return t`<ic-pipeline-builder .rpcClient=${this._rpcClient} .graphId=${this._routeParams.graphId??``}></ic-pipeline-builder>`;case`ic-pipeline-monitor`:return t`<ic-pipeline-monitor .rpcClient=${this._rpcClient} .graphId=${this._routeParams.graphId??``} .eventDispatcher=${this._eventDispatcher}></ic-pipeline-monitor>`;case`ic-pipeline-history`:return t`<ic-pipeline-history .rpcClient=${this._rpcClient}></ic-pipeline-history>`;case`ic-pipeline-history-detail`:return t`<ic-pipeline-history-detail .rpcClient=${this._rpcClient} .graphId=${this._routeParams.graphId??``}></ic-pipeline-history-detail>`;default:return this._renderPlaceholder()}}_renderPlaceholder(){return t`
2788
+ <div class="placeholder">
2789
+ <div class="placeholder-title">${this._currentView.replace(/^ic-/,``).replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}</div>
2790
+ <div>Coming soon</div>
2791
+ </div>
2792
+ `}render(){return this._authenticated?this._renderApp():this._renderAuth()}};u([s()],$.prototype,`_authenticated`,void 0),u([s()],$.prototype,`_authError`,void 0),u([s()],$.prototype,`_currentView`,void 0),u([s()],$.prototype,`_currentRoute`,void 0),u([s()],$.prototype,`_routeParams`,void 0),u([s()],$.prototype,`_connectionStatus`,void 0),u([s()],$.prototype,`_pendingApprovals`,void 0),u([s()],$.prototype,`_errorCount`,void 0),u([s()],$.prototype,`_agentCount`,void 0),u([s()],$.prototype,`_channelCount`,void 0),u([s()],$.prototype,`_sessionCount`,void 0),u([s()],$.prototype,`_sidebarOpen`,void 0),u([s()],$.prototype,`_viewLoading`,void 0),u([s()],$.prototype,`_commandPaletteOpen`,void 0),u([s()],$.prototype,`_shortcutsHelpOpen`,void 0),u([s()],$.prototype,`_agentList`,void 0),u([s()],$.prototype,`_sessionList`,void 0),u([s()],$.prototype,`_token`,void 0),$=u([e(`ic-app`)],$);export{A as a,j as i,z as n,V as r,B as t};