comisai 1.0.24 → 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 (98) hide show
  1. package/node_modules/@comis/agent/package.json +1 -1
  2. package/node_modules/@comis/channels/package.json +1 -1
  3. package/node_modules/@comis/cli/package.json +1 -1
  4. package/node_modules/@comis/core/dist/bootstrap.js +5 -0
  5. package/node_modules/@comis/core/dist/config/env-layer.d.ts +31 -0
  6. package/node_modules/@comis/core/dist/config/env-layer.js +41 -0
  7. package/node_modules/@comis/core/dist/config/layered.d.ts +9 -0
  8. package/node_modules/@comis/core/dist/config/layered.js +11 -0
  9. package/node_modules/@comis/core/package.json +1 -1
  10. package/node_modules/@comis/daemon/dist/daemon.js +3 -0
  11. package/node_modules/@comis/daemon/package.json +1 -1
  12. package/node_modules/@comis/gateway/package.json +1 -1
  13. package/node_modules/@comis/infra/package.json +1 -1
  14. package/node_modules/@comis/memory/package.json +1 -1
  15. package/node_modules/@comis/scheduler/package.json +1 -1
  16. package/node_modules/@comis/shared/package.json +1 -1
  17. package/node_modules/@comis/skills/package.json +1 -1
  18. package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-ru-AhppM.js} +270 -270
  19. package/node_modules/@comis/web/dist/assets/agent-editor-hjwRuFVp.js +2173 -0
  20. package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-6Uotjatr.js} +170 -170
  21. package/node_modules/@comis/web/dist/assets/{approvals-q9VH_IKr.js → approvals-C-K6hN2U.js} +13 -13
  22. package/node_modules/@comis/web/dist/assets/billing-view-CxysXH0p.js +375 -0
  23. package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-BBCKtmne.js} +265 -265
  24. package/node_modules/@comis/web/dist/assets/channel-list-FkfeOLBQ.js +323 -0
  25. package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-BumBaIgO.js} +243 -246
  26. package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-C9BSwHGy.js} +477 -477
  27. package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-BHm00mJD.js} +105 -105
  28. package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-BENY3pWE.js} +136 -136
  29. package/node_modules/@comis/web/dist/assets/decorate-BvWYovGE.js +38 -0
  30. package/node_modules/@comis/web/dist/assets/{delivery-view-OfBZof-m.js → delivery-view-BCnkPsAp.js} +134 -134
  31. package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-C_jQFG2H.js} +82 -82
  32. package/node_modules/@comis/web/dist/assets/directive-BOYXJ-K-.js +1 -0
  33. package/node_modules/@comis/web/dist/assets/{extract-variables-BM5qyK-s.js → extract-variables-B7-Doo7l.js} +39 -39
  34. package/node_modules/@comis/web/dist/assets/{ic-array-editor-B7m6x7-S.js → ic-array-editor-BLoEyeLS.js} +29 -29
  35. package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js} +16 -16
  36. package/node_modules/@comis/web/dist/assets/{ic-budget-segment-bar-BtJ6x5mN.js → ic-budget-segment-bar-zLsMzjDO.js} +20 -20
  37. package/node_modules/@comis/web/dist/assets/ic-chat-message-FdQcZsSQ.js +352 -0
  38. package/node_modules/@comis/web/dist/assets/{ic-confirm-dialog-CCDbB04e.js → ic-confirm-dialog-DGlPbV1T.js} +26 -26
  39. package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CnT1b8xr.js → ic-connection-dot-BgYiK2N4.js} +13 -13
  40. package/node_modules/@comis/web/dist/assets/ic-data-table-CKIvr-ag.js +277 -0
  41. package/node_modules/@comis/web/dist/assets/ic-delivery-row-B3YwjjuM.js +67 -0
  42. package/node_modules/@comis/web/dist/assets/{ic-detail-panel-BF83r-if.js → ic-detail-panel-DiCe4hLr.js} +27 -27
  43. package/node_modules/@comis/web/dist/assets/{ic-empty-state-60l2ePhd.js → ic-empty-state-CM3Wbj2f.js} +19 -19
  44. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-ByRjij68.js +359 -0
  45. package/node_modules/@comis/web/dist/assets/ic-icon-BGNCCPpZ.js +33 -0
  46. package/node_modules/@comis/web/dist/assets/{ic-layer-waterfall-COvEYMg5.js → ic-layer-waterfall-WkaFyu-l.js} +18 -18
  47. package/node_modules/@comis/web/dist/assets/ic-relative-time-B3UAnTqg.js +12 -0
  48. package/node_modules/@comis/web/dist/assets/{ic-search-input-CSOxY9g7.js → ic-search-input-B02AGw1i.js} +22 -22
  49. package/node_modules/@comis/web/dist/assets/{ic-select-Ce-Raudx.js → ic-select-BqfZISjw.js} +29 -29
  50. package/node_modules/@comis/web/dist/assets/ic-tabs-yBjkWKJH.js +95 -0
  51. package/node_modules/@comis/web/dist/assets/ic-tag-CvMVQFRR.js +33 -0
  52. package/node_modules/@comis/web/dist/assets/{ic-time-range-picker-CypCT68y.js → ic-time-range-picker-DXbYeBmY.js} +31 -31
  53. package/node_modules/@comis/web/dist/assets/{ic-tool-call-7MaXSsCW.js → ic-tool-call-DMPHsLyx.js} +51 -51
  54. package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
  55. package/node_modules/@comis/web/dist/assets/index-FLPhHz8p.js +2792 -0
  56. package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-5jyScQis.js} +209 -209
  57. package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-J9oT9PPs.js} +154 -154
  58. package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-DGTCtM8-.js} +259 -259
  59. package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-D5Re9ptG.js} +450 -450
  60. package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-cRLK6ZmG.js} +290 -290
  61. package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-D5vu07MR.js} +371 -371
  62. package/node_modules/@comis/web/dist/assets/observability-types-D0tkwElU.js +1 -0
  63. package/node_modules/@comis/web/dist/assets/{observe-view-C0VBhX4C.js → observe-view-CalNNEmd.js} +399 -399
  64. package/node_modules/@comis/web/dist/assets/pipeline-builder-DUYDGwZf.js +1495 -0
  65. package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-BAO8brOe.js} +124 -124
  66. package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-DectIoQt.js} +65 -65
  67. package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-BHlaBKww.js} +227 -227
  68. package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-BhtpNEHf.js} +298 -298
  69. package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-VafN_8xi.js} +486 -486
  70. package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-QQXMRTlo.js} +389 -389
  71. package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BpZ_8Yih.js} +294 -294
  72. package/node_modules/@comis/web/dist/assets/session-key-parser-Dkqcj2Ss.js +1 -0
  73. package/node_modules/@comis/web/dist/assets/session-list-DfCm8Cec.js +231 -0
  74. package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-C-z477CG.js} +486 -494
  75. package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-BCOGPf6s.js} +329 -329
  76. package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-l-auUraL.js} +74 -74
  77. package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-DlvBixiq.js} +236 -236
  78. package/node_modules/@comis/web/dist/index.html +3 -2
  79. package/node_modules/@comis/web/package.json +1 -1
  80. package/package.json +15 -15
  81. package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +0 -2173
  82. package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +0 -375
  83. package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +0 -323
  84. package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +0 -1
  85. package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +0 -352
  86. package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +0 -277
  87. package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +0 -67
  88. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +0 -359
  89. package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +0 -33
  90. package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +0 -12
  91. package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +0 -95
  92. package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +0 -33
  93. package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +0 -2830
  94. package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +0 -1
  95. package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +0 -1
  96. package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +0 -1496
  97. package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +0 -1
  98. package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +0 -231
@@ -0,0 +1,323 @@
1
+ import{c as e,f as t,h as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./decorate-BvWYovGE.js";import{a as u,i as d,n as f,r as p,t as m}from"./index-FLPhHz8p.js";import"./ic-confirm-dialog-DGlPbV1T.js";import"./ic-empty-state-CM3Wbj2f.js";var h=class extends r{constructor(...e){super(...e),this.channelType=``,this.name=``,this.status=`disconnected`,this.enabled=!1,this.isStale=!1,this.messageCount=0,this.uptime=0,this.lastActivity=0}static{this.styles=[o,i,n`
2
+ :host {
3
+ display: block;
4
+ min-width: 280px;
5
+ }
6
+
7
+ .card {
8
+ background: var(--ic-surface);
9
+ border: 1px solid var(--ic-border);
10
+ border-radius: 0.75rem;
11
+ padding: 1.25rem;
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: 0.75rem;
15
+ transition: border-color 0.15s;
16
+ }
17
+
18
+ .card:hover {
19
+ border-color: var(--ic-border-hover, #374151);
20
+ }
21
+
22
+ .card-header {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: 0.625rem;
26
+ }
27
+
28
+ .channel-name {
29
+ font-size: 1rem;
30
+ font-weight: 600;
31
+ color: var(--ic-text);
32
+ flex: 1;
33
+ text-transform: capitalize;
34
+ }
35
+
36
+ .status-dot {
37
+ width: 0.5rem;
38
+ height: 0.5rem;
39
+ border-radius: 50%;
40
+ flex-shrink: 0;
41
+ }
42
+
43
+ .status-dot.pulse {
44
+ animation: pulse 2s ease-in-out infinite;
45
+ }
46
+
47
+ @keyframes pulse {
48
+ 0%, 100% { opacity: 1; }
49
+ 50% { opacity: 0.4; }
50
+ }
51
+
52
+ @media (prefers-reduced-motion: reduce) {
53
+ .status-dot.pulse { animation: none; }
54
+ }
55
+
56
+ .metrics {
57
+ display: flex;
58
+ flex-direction: column;
59
+ gap: 0.375rem;
60
+ }
61
+
62
+ .metric-row {
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: space-between;
66
+ font-size: 0.8125rem;
67
+ }
68
+
69
+ .metric-label {
70
+ color: var(--ic-text-dim);
71
+ }
72
+
73
+ .metric-value {
74
+ color: var(--ic-text-muted);
75
+ font-family: ui-monospace, monospace;
76
+ font-size: 0.75rem;
77
+ }
78
+
79
+ .stale-warning {
80
+ display: flex;
81
+ align-items: center;
82
+ gap: 0.375rem;
83
+ padding: 0.375rem 0.625rem;
84
+ background: var(--ic-warning)0d;
85
+ border: 1px solid var(--ic-warning)33;
86
+ border-radius: 0.375rem;
87
+ font-size: 0.75rem;
88
+ color: var(--ic-warning);
89
+ }
90
+
91
+ .card-actions {
92
+ display: flex;
93
+ gap: 0.5rem;
94
+ padding-top: 0.75rem;
95
+ border-top: 1px solid var(--ic-border);
96
+ }
97
+
98
+ .action-btn {
99
+ flex: 1;
100
+ display: inline-flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ padding: 0.375rem 0.5rem;
104
+ background: transparent;
105
+ border: 1px solid var(--ic-border);
106
+ border-radius: 0.375rem;
107
+ color: var(--ic-text-dim);
108
+ font-size: 0.75rem;
109
+ font-family: inherit;
110
+ cursor: pointer;
111
+ transition: background 0.15s, color 0.15s, border-color 0.15s;
112
+ }
113
+
114
+ .action-btn:hover {
115
+ background: var(--ic-surface-2, #1f2937);
116
+ color: var(--ic-text);
117
+ border-color: var(--ic-text-dim);
118
+ }
119
+ `]}_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`}_formatTimeAgo(e){if(e<=0)return`unknown`;let t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`just now`;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`}_getHealthVisual(){return this.isStale?m(`stale`):m(this.status)}_handleAction(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(`channel-action`,{detail:{action:e,channelType:this.channelType},bubbles:!0,composed:!0}))}render(){let e=this.name||this.channelType||`Unknown`,n=this._getHealthVisual(),r=this.uptime>0&&p(f(this.status)),i=new Intl.NumberFormat(`en-US`);return t`
120
+ <div class="card" role="group" aria-label="${e} channel - ${n.label}">
121
+ <div class="card-header">
122
+ <ic-platform-icon .platform=${this.channelType} size="20px"></ic-platform-icon>
123
+ <span class="channel-name">${e}</span>
124
+ <span
125
+ class="status-dot ${n.pulse?`pulse`:``}"
126
+ style="background: ${n.color}"
127
+ role="status"
128
+ aria-label="Status: ${n.label}"
129
+ ></span>
130
+ <span class="status-text" style="font-size: 0.75rem; color: ${n.color};">${n.label}</span>
131
+ </div>
132
+
133
+ <div class="metrics">
134
+ <div class="metric-row">
135
+ <span class="metric-label">Messages</span>
136
+ <span class="metric-value">${i.format(this.messageCount)}</span>
137
+ </div>
138
+ ${r?t`
139
+ <div class="metric-row">
140
+ <span class="metric-label">Uptime</span>
141
+ <span class="metric-value">${this._formatUptime(this.uptime)}</span>
142
+ </div>
143
+ `:l}
144
+ </div>
145
+
146
+ ${this.isStale&&this.lastActivity>0?t`
147
+ <div class="stale-warning">
148
+ Last seen ${this._formatTimeAgo(this.lastActivity)}
149
+ </div>
150
+ `:l}
151
+
152
+ <div class="card-actions">
153
+ ${this.enabled?t`
154
+ <button
155
+ class="action-btn"
156
+ aria-label="Configure ${e}"
157
+ @click=${e=>this._handleAction(`configure`,e)}
158
+ >Configure</button>
159
+ <button
160
+ class="action-btn"
161
+ aria-label="Restart ${e}"
162
+ @click=${e=>this._handleAction(`restart`,e)}
163
+ >Restart</button>
164
+ `:t`
165
+ <button
166
+ class="action-btn"
167
+ aria-label="Enable ${e}"
168
+ @click=${e=>this._handleAction(`enable`,e)}
169
+ >Enable</button>
170
+ `}
171
+ </div>
172
+ </div>
173
+ `}};c([s({type:String})],h.prototype,`channelType`,void 0),c([s({type:String})],h.prototype,`name`,void 0),c([s({type:String})],h.prototype,`status`,void 0),c([s({type:Boolean})],h.prototype,`enabled`,void 0),c([s({type:Boolean})],h.prototype,`isStale`,void 0),c([s({type:Number})],h.prototype,`messageCount`,void 0),c([s({type:Number})],h.prototype,`uptime`,void 0),c([s({type:Number})],h.prototype,`lastActivity`,void 0),h=c([e(`ic-channel-card`)],h);function g(e){if(e<=0)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`:`${r}m`}function _(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}var v=class extends r{constructor(...e){super(...e),this.apiClient=null,this.rpcClient=null,this.eventDispatcher=null,this._sse=null,this._reloadDebounce=null,this._loadState=`loading`,this._error=``,this._channels=[],this._staleTypes=new Set,this._actionPending=new Set,this._confirmDisable=null,this._hasLoaded=!1}static{this.styles=[o,i,n`
174
+ :host {
175
+ display: block;
176
+ }
177
+
178
+ .page-title {
179
+ font-size: 1.5rem;
180
+ font-weight: 700;
181
+ margin: 0 0 var(--ic-space-sm) 0;
182
+ }
183
+
184
+ /* Summary stats row */
185
+ .stats-row {
186
+ display: flex;
187
+ flex-wrap: wrap;
188
+ gap: var(--ic-space-sm, 0.5rem);
189
+ margin-bottom: var(--ic-space-lg, 1.5rem);
190
+ }
191
+
192
+ .stat-badge {
193
+ display: inline-flex;
194
+ align-items: center;
195
+ gap: 0.25rem;
196
+ padding: 0.25rem 0.625rem;
197
+ border-radius: 9999px;
198
+ font-size: 0.75rem;
199
+ font-weight: 500;
200
+ background: var(--ic-surface, #111827);
201
+ border: 1px solid var(--ic-border, #374151);
202
+ color: var(--ic-text-muted, #9ca3af);
203
+ }
204
+
205
+ .stat-badge--connected {
206
+ color: var(--ic-success, #22c55e);
207
+ border-color: color-mix(in srgb, var(--ic-success, #22c55e) 30%, var(--ic-border, #374151));
208
+ }
209
+
210
+ .stat-badge--disconnected {
211
+ color: var(--ic-text-dim, #6b7280);
212
+ }
213
+
214
+ .stat-badge--stale {
215
+ color: var(--ic-warning, #f59e0b);
216
+ border-color: color-mix(in srgb, var(--ic-warning, #f59e0b) 30%, var(--ic-border, #374151));
217
+ }
218
+
219
+ .stat-count {
220
+ font-weight: 700;
221
+ }
222
+
223
+ /* Card grid */
224
+ .card-grid {
225
+ display: grid;
226
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
227
+ gap: var(--ic-space-lg, 1.5rem);
228
+ }
229
+
230
+ /* Error state */
231
+ .error-container {
232
+ padding: var(--ic-space-xl, 2rem);
233
+ text-align: center;
234
+ }
235
+
236
+ .error-message {
237
+ color: var(--ic-error, #f87171);
238
+ margin-bottom: var(--ic-space-md, 1rem);
239
+ }
240
+
241
+ .retry-btn {
242
+ padding: 0.5rem 1rem;
243
+ background: var(--ic-accent, #3b82f6);
244
+ color: white;
245
+ border: none;
246
+ border-radius: var(--ic-radius-md, 0.5rem);
247
+ cursor: pointer;
248
+ font-size: var(--ic-text-sm, 0.875rem);
249
+ }
250
+
251
+ .retry-btn:hover {
252
+ background: var(--ic-accent-hover, #2563eb);
253
+ }
254
+
255
+ /* Loading */
256
+ .loading-container {
257
+ display: flex;
258
+ justify-content: center;
259
+ padding: var(--ic-space-2xl, 3rem);
260
+ }
261
+ `]}connectedCallback(){super.connectedCallback(),this.eventDispatcher&&!this._sse&&(this._sse=new d(this,this.eventDispatcher,{"channel:registered":()=>{this._scheduleReload()},"channel:deregistered":()=>{this._scheduleReload()},"diagnostic:channel_health":()=>{this._scheduleReload(500)}}))}disconnectedCallback(){super.disconnectedCallback(),this._reloadDebounce!==null&&(clearTimeout(this._reloadDebounce),this._reloadDebounce=null)}updated(e){(e.has(`apiClient`)||e.has(`rpcClient`))&&this.apiClient&&!this._hasLoaded&&this._loadData(),e.has(`eventDispatcher`)&&this.eventDispatcher&&!this._sse&&(this._sse=new d(this,this.eventDispatcher,{"channel:registered":()=>{this._scheduleReload()},"channel:deregistered":()=>{this._scheduleReload()},"diagnostic:channel_health":()=>{this._scheduleReload(500)}}))}_scheduleReload(e=300){this._reloadDebounce!==null&&clearTimeout(this._reloadDebounce),this._reloadDebounce=setTimeout(()=>{this._reloadDebounce=null,this._loadData()},e)}async _loadData(){if(this.apiClient){this._loadState=`loading`,this._error=``;try{let e=await this.apiClient.getChannels();this._channels=e.map(e=>({...e,uptime:0,messageCount:0,lastActivity:0})),this._loadState=`loaded`,this._hasLoaded=!0,this.rpcClient&&this.rpcClient.status===`connected`&&Promise.allSettled([this.rpcClient.call(`obs.channels.all`),this.rpcClient.call(`obs.channels.stale`)]).then(([t,n])=>{let r=t.status===`fulfilled`?t.value:null,i=n.status===`fulfilled`?n.value:null,a=new Map((r?.channels??[]).map(e=>[e.channelType,e]));this._channels=e.map(e=>{let t=a.get(e.type);return{...e,uptime:0,messageCount:t?t.messagesSent+t.messagesReceived:0,lastActivity:t?.lastActiveAt??0}}),this._staleTypes=new Set((i?.channels??[]).map(e=>e.channelType))})}catch(e){this._error=e instanceof Error?e.message:`Failed to load channels`,this._loadState=`error`}}}async _handleRestart(e){if(this.rpcClient){this._actionPending=new Set([...this._actionPending,e]);try{await this.rpcClient.call(`channels.restart`,{channel_type:e}),u.show(`${_(e)} restarted`,`success`),await this._loadData()}catch{u.show(`Failed to restart ${e}`,`error`)}finally{let t=new Set(this._actionPending);t.delete(e),this._actionPending=t}}}async _handleEnable(e){if(this.rpcClient){this._actionPending=new Set([...this._actionPending,e]);try{await this.rpcClient.call(`channels.enable`,{channel_type:e}),u.show(`${_(e)} enabled`,`success`),await this._loadData()}catch{u.show(`Failed to enable ${e}`,`error`)}finally{let t=new Set(this._actionPending);t.delete(e),this._actionPending=t}}}async _handleDisable(e){if(this.rpcClient){this._actionPending=new Set([...this._actionPending,e]);try{await this.rpcClient.call(`channels.disable`,{channel_type:e}),u.show(`${_(e)} disabled`,`success`),await this._loadData()}catch{u.show(`Failed to disable ${e}`,`error`)}finally{let t=new Set(this._actionPending);t.delete(e),this._actionPending=t}}}_handleConfigure(e){this.dispatchEvent(new CustomEvent(`navigate`,{detail:`channels/${e}`,bubbles:!1,composed:!1}))}_handleCardAction(e){let{action:t,channelType:n}=e.detail;switch(t){case`configure`:this._handleConfigure(n);break;case`restart`:this._handleRestart(n);break;case`enable`:this._handleEnable(n);break;case`disable`:this._confirmDisable=n;break}}_confirmDisableAction(){this._confirmDisable&&=(this._handleDisable(this._confirmDisable),null)}_cancelDisable(){this._confirmDisable=null}render(){if(this._loadState===`loading`)return t`<ic-skeleton-view variant="list"></ic-skeleton-view>`;if(this._loadState===`error`)return t`
262
+ <div class="error-container">
263
+ <div class="error-message">${this._error}</div>
264
+ <button class="retry-btn" @click=${()=>void this._loadData()}>
265
+ Retry
266
+ </button>
267
+ </div>
268
+ `;if(this._channels.length===0)return t`
269
+ <h1 class="page-title">Channels</h1>
270
+ <ic-empty-state
271
+ icon="radio"
272
+ message="No channels connected"
273
+ description="Connect a chat platform to start receiving messages."
274
+ >
275
+ <button class="retry-btn" @click=${()=>{window.location.hash=`#/config`}}>Open Settings</button>
276
+ </ic-empty-state>
277
+ `;let e=this._channels.filter(e=>e.enabled&&(e.status===`healthy`||e.status===`idle`)).length,n=this._channels.filter(e=>!e.enabled).length,r=this._channels.filter(e=>e.enabled&&this._staleTypes.has(e.type)).length;return t`
278
+ <div role="region" aria-label="Channels">
279
+ <h1 class="page-title">Channels</h1>
280
+
281
+ <div class="stats-row">
282
+ <span class="stat-badge">
283
+ <span class="stat-count">${this._channels.length}</span> Total
284
+ </span>
285
+ <span class="stat-badge stat-badge--connected">
286
+ <span class="stat-count">${e}</span> Connected
287
+ </span>
288
+ <span class="stat-badge stat-badge--disconnected">
289
+ <span class="stat-count">${n}</span> Disabled
290
+ </span>
291
+ ${r>0?t`<span class="stat-badge stat-badge--stale">
292
+ <span class="stat-count">${r}</span> Stale
293
+ </span>`:l}
294
+ </div>
295
+
296
+ <div class="card-grid">
297
+ ${this._channels.map(e=>t`
298
+ <ic-channel-card
299
+ .channelType=${e.type}
300
+ .name=${_(e.type)}
301
+ .status=${e.enabled?e.status:`disconnected`}
302
+ ?enabled=${e.enabled}
303
+ ?isStale=${e.enabled&&this._staleTypes.has(e.type)}
304
+ .messageCount=${e.messageCount}
305
+ .uptime=${e.uptime}
306
+ .lastActivity=${e.lastActivity}
307
+ @channel-action=${e=>this._handleCardAction(e)}
308
+ ></ic-channel-card>
309
+ `)}
310
+ </div>
311
+
312
+ </div>
313
+
314
+ <ic-confirm-dialog
315
+ ?open=${this._confirmDisable!==null}
316
+ title="Disable Channel"
317
+ message="Disable ${this._confirmDisable?_(this._confirmDisable):``}? This will disconnect the channel."
318
+ confirmLabel="Disable"
319
+ variant="danger"
320
+ @confirm=${this._confirmDisableAction}
321
+ @cancel=${this._cancelDisable}
322
+ ></ic-confirm-dialog>
323
+ `}};c([s({attribute:!1})],v.prototype,`apiClient`,void 0),c([s({attribute:!1})],v.prototype,`rpcClient`,void 0),c([s({attribute:!1})],v.prototype,`eventDispatcher`,void 0),c([a()],v.prototype,`_loadState`,void 0),c([a()],v.prototype,`_error`,void 0),c([a()],v.prototype,`_channels`,void 0),c([a()],v.prototype,`_staleTypes`,void 0),c([a()],v.prototype,`_actionPending`,void 0),c([a()],v.prototype,`_confirmDisable`,void 0),v=c([e(`ic-channel-list`)],v);export{v as IcChannelList,g as formatUptime};