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.
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/bootstrap.js +5 -0
- package/node_modules/@comis/core/dist/config/env-layer.d.ts +31 -0
- package/node_modules/@comis/core/dist/config/env-layer.js +41 -0
- package/node_modules/@comis/core/dist/config/layered.d.ts +9 -0
- package/node_modules/@comis/core/dist/config/layered.js +11 -0
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/daemon.js +3 -0
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/package.json +1 -1
- package/node_modules/@comis/memory/package.json +1 -1
- package/node_modules/@comis/scheduler/package.json +1 -1
- package/node_modules/@comis/shared/package.json +1 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-ru-AhppM.js} +270 -270
- package/node_modules/@comis/web/dist/assets/agent-editor-hjwRuFVp.js +2173 -0
- package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-6Uotjatr.js} +170 -170
- package/node_modules/@comis/web/dist/assets/{approvals-q9VH_IKr.js → approvals-C-K6hN2U.js} +13 -13
- package/node_modules/@comis/web/dist/assets/billing-view-CxysXH0p.js +375 -0
- package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-BBCKtmne.js} +265 -265
- package/node_modules/@comis/web/dist/assets/channel-list-FkfeOLBQ.js +323 -0
- package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-BumBaIgO.js} +243 -246
- package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-C9BSwHGy.js} +477 -477
- package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-BHm00mJD.js} +105 -105
- package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-BENY3pWE.js} +136 -136
- package/node_modules/@comis/web/dist/assets/decorate-BvWYovGE.js +38 -0
- package/node_modules/@comis/web/dist/assets/{delivery-view-OfBZof-m.js → delivery-view-BCnkPsAp.js} +134 -134
- package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-C_jQFG2H.js} +82 -82
- package/node_modules/@comis/web/dist/assets/directive-BOYXJ-K-.js +1 -0
- package/node_modules/@comis/web/dist/assets/{extract-variables-BM5qyK-s.js → extract-variables-B7-Doo7l.js} +39 -39
- package/node_modules/@comis/web/dist/assets/{ic-array-editor-B7m6x7-S.js → ic-array-editor-BLoEyeLS.js} +29 -29
- package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js} +16 -16
- package/node_modules/@comis/web/dist/assets/{ic-budget-segment-bar-BtJ6x5mN.js → ic-budget-segment-bar-zLsMzjDO.js} +20 -20
- package/node_modules/@comis/web/dist/assets/ic-chat-message-FdQcZsSQ.js +352 -0
- package/node_modules/@comis/web/dist/assets/{ic-confirm-dialog-CCDbB04e.js → ic-confirm-dialog-DGlPbV1T.js} +26 -26
- package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CnT1b8xr.js → ic-connection-dot-BgYiK2N4.js} +13 -13
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKIvr-ag.js +277 -0
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-B3YwjjuM.js +67 -0
- package/node_modules/@comis/web/dist/assets/{ic-detail-panel-BF83r-if.js → ic-detail-panel-DiCe4hLr.js} +27 -27
- package/node_modules/@comis/web/dist/assets/{ic-empty-state-60l2ePhd.js → ic-empty-state-CM3Wbj2f.js} +19 -19
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-ByRjij68.js +359 -0
- package/node_modules/@comis/web/dist/assets/ic-icon-BGNCCPpZ.js +33 -0
- package/node_modules/@comis/web/dist/assets/{ic-layer-waterfall-COvEYMg5.js → ic-layer-waterfall-WkaFyu-l.js} +18 -18
- package/node_modules/@comis/web/dist/assets/ic-relative-time-B3UAnTqg.js +12 -0
- package/node_modules/@comis/web/dist/assets/{ic-search-input-CSOxY9g7.js → ic-search-input-B02AGw1i.js} +22 -22
- package/node_modules/@comis/web/dist/assets/{ic-select-Ce-Raudx.js → ic-select-BqfZISjw.js} +29 -29
- package/node_modules/@comis/web/dist/assets/ic-tabs-yBjkWKJH.js +95 -0
- package/node_modules/@comis/web/dist/assets/ic-tag-CvMVQFRR.js +33 -0
- package/node_modules/@comis/web/dist/assets/{ic-time-range-picker-CypCT68y.js → ic-time-range-picker-DXbYeBmY.js} +31 -31
- package/node_modules/@comis/web/dist/assets/{ic-tool-call-7MaXSsCW.js → ic-tool-call-DMPHsLyx.js} +51 -51
- package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
- package/node_modules/@comis/web/dist/assets/index-FLPhHz8p.js +2792 -0
- package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-5jyScQis.js} +209 -209
- package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-J9oT9PPs.js} +154 -154
- package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-DGTCtM8-.js} +259 -259
- package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-D5Re9ptG.js} +450 -450
- package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-cRLK6ZmG.js} +290 -290
- package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-D5vu07MR.js} +371 -371
- package/node_modules/@comis/web/dist/assets/observability-types-D0tkwElU.js +1 -0
- package/node_modules/@comis/web/dist/assets/{observe-view-C0VBhX4C.js → observe-view-CalNNEmd.js} +399 -399
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DUYDGwZf.js +1495 -0
- package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-BAO8brOe.js} +124 -124
- package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-DectIoQt.js} +65 -65
- package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-BHlaBKww.js} +227 -227
- package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-BhtpNEHf.js} +298 -298
- package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-VafN_8xi.js} +486 -486
- package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-QQXMRTlo.js} +389 -389
- package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BpZ_8Yih.js} +294 -294
- package/node_modules/@comis/web/dist/assets/session-key-parser-Dkqcj2Ss.js +1 -0
- package/node_modules/@comis/web/dist/assets/session-list-DfCm8Cec.js +231 -0
- package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-C-z477CG.js} +486 -494
- package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-BCOGPf6s.js} +329 -329
- package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-l-auUraL.js} +74 -74
- package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-DlvBixiq.js} +236 -236
- package/node_modules/@comis/web/dist/index.html +3 -2
- package/node_modules/@comis/web/package.json +1 -1
- package/package.json +15 -15
- package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +0 -2173
- package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +0 -375
- package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +0 -323
- package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +0 -1
- package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +0 -352
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +0 -277
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +0 -67
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +0 -359
- package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +0 -33
- package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +0 -12
- package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +0 -95
- package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +0 -33
- package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +0 -2830
- package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +0 -1
- package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +0 -1
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +0 -1496
- package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +0 -1
- package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +0 -231
|
@@ -0,0 +1,231 @@
|
|
|
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}from"./index-FLPhHz8p.js";import"./ic-tag-CvMVQFRR.js";import"./ic-confirm-dialog-DGlPbV1T.js";import"./ic-relative-time-B3UAnTqg.js";import"./ic-data-table-CKIvr-ag.js";import"./ic-search-input-B02AGw1i.js";import"./ic-empty-state-CM3Wbj2f.js";import{n as f,r as p,t as m}from"./session-key-parser-Dkqcj2Ss.js";function h(e){if(e>=1e3){let t=e/1e3;return t>=100?`${Math.round(t)}K`:`${t.toFixed(1)}K`}return String(e)}var g={active:`#22c55e`,idle:`#eab308`,expired:`#6b7280`},_=[{key:`key`,label:`Session`,sortable:!0,render:(e,n)=>{let r=String(e??``),i=p(r);return t`<span title=${r}>
|
|
2
|
+
<strong style="font-size: var(--ic-text-sm);">${i?f(i):r.length>15?r.slice(0,12)+`...`:r}</strong>
|
|
3
|
+
<span style="font-size: var(--ic-text-xs); color: var(--ic-text-dim); margin-left: 4px;">${i?.channelId??n.channelType}</span>
|
|
4
|
+
</span>`}},{key:`createdAt`,label:`Status`,sortable:!1,render:(e,n)=>{let r=m(n.lastActiveAt);return t`<span style="display: inline-flex; align-items: center; gap: 6px;">
|
|
5
|
+
<span style="display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: ${g[r]??g.expired};"></span>
|
|
6
|
+
<span style="font-size: var(--ic-text-xs); text-transform: capitalize;">${r}</span>
|
|
7
|
+
</span>`}},{key:`agentId`,label:`Agent`,sortable:!0},{key:`channelType`,label:`Channel`,sortable:!0,render:e=>{let n=String(e??``);return t`<ic-tag variant=${n}>${n}</ic-tag>`}},{key:`messageCount`,label:`Messages`,sortable:!0},{key:`totalTokens`,label:`Tokens`,sortable:!0,render:e=>h(Number(e??0))},{key:`lastActiveAt`,label:`Age`,sortable:!0,render:e=>t`<ic-relative-time .timestamp=${Number(e??0)}></ic-relative-time>`}],v=class extends r{constructor(...e){super(...e),this.sessions=[],this.selectable=!1}static{this.styles=[o,n`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
`]}_handleRowClick(e){this.dispatchEvent(new CustomEvent(`session-click`,{detail:e.detail,bubbles:!0}))}_handleSelectionChange(e){this.dispatchEvent(new CustomEvent(`selection-change`,{detail:e.detail,bubbles:!0}))}render(){return t`
|
|
12
|
+
<ic-data-table
|
|
13
|
+
.columns=${_}
|
|
14
|
+
.rows=${this.sessions}
|
|
15
|
+
.pageSize=${25}
|
|
16
|
+
?selectable=${this.selectable}
|
|
17
|
+
emptyMessage="No sessions found"
|
|
18
|
+
@row-click=${this._handleRowClick}
|
|
19
|
+
@selection-change=${this._handleSelectionChange}
|
|
20
|
+
></ic-data-table>
|
|
21
|
+
`}};c([s({attribute:!1})],v.prototype,`sessions`,void 0),c([s({type:Boolean})],v.prototype,`selectable`,void 0),v=c([e(`ic-session-list`)],v);var y=class extends r{constructor(...e){super(...e),this.apiClient=null,this.rpcClient=null,this.eventDispatcher=null,this._sse=null,this._reloadDebounce=null,this._sessions=[],this._filteredSessions=[],this._loading=!1,this._error=``,this._searchQuery=``,this._agentFilter=``,this._channelFilter=``,this._statusFilter=``,this._selectedKeys=[],this._showConfirm=!1,this._confirmAction=``,this._configuredAgentIds=[],this._searchDebounceTimer=null,this._searchResultKeys=null}static{this.styles=[o,i,n`
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.page-header {
|
|
27
|
+
margin-bottom: var(--ic-space-lg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.page-title {
|
|
31
|
+
font-size: var(--ic-text-xl);
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
color: var(--ic-text);
|
|
34
|
+
margin: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.filter-bar {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: var(--ic-space-md);
|
|
41
|
+
margin-bottom: var(--ic-space-md);
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.filter-bar ic-search-input {
|
|
46
|
+
flex: 1;
|
|
47
|
+
min-width: 12rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.filter-select {
|
|
51
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
52
|
+
background: var(--ic-surface-2);
|
|
53
|
+
border: 1px solid var(--ic-border);
|
|
54
|
+
border-radius: var(--ic-radius-md);
|
|
55
|
+
color: var(--ic-text);
|
|
56
|
+
font-family: inherit;
|
|
57
|
+
font-size: var(--ic-text-sm);
|
|
58
|
+
min-width: 8rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.filter-select:focus {
|
|
62
|
+
outline: none;
|
|
63
|
+
border-color: var(--ic-accent);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bulk-bar {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: var(--ic-space-md);
|
|
70
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
71
|
+
background: var(--ic-surface-2);
|
|
72
|
+
border: 1px solid var(--ic-border);
|
|
73
|
+
border-radius: var(--ic-radius-md);
|
|
74
|
+
margin-bottom: var(--ic-space-md);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.bulk-count {
|
|
78
|
+
font-size: var(--ic-text-sm);
|
|
79
|
+
color: var(--ic-text-muted);
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.bulk-actions {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: var(--ic-space-sm);
|
|
86
|
+
margin-left: auto;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.btn {
|
|
90
|
+
padding: var(--ic-space-xs) var(--ic-space-md);
|
|
91
|
+
border-radius: var(--ic-radius-md);
|
|
92
|
+
font-size: var(--ic-text-sm);
|
|
93
|
+
font-family: inherit;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
transition: background var(--ic-transition), border-color var(--ic-transition);
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.btn-ghost {
|
|
100
|
+
background: transparent;
|
|
101
|
+
border: 1px solid var(--ic-border);
|
|
102
|
+
color: var(--ic-text-muted);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.btn-ghost:hover {
|
|
106
|
+
border-color: var(--ic-text-dim);
|
|
107
|
+
color: var(--ic-text);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.btn-danger {
|
|
111
|
+
background: transparent;
|
|
112
|
+
border: 1px solid var(--ic-error);
|
|
113
|
+
color: var(--ic-error);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.btn-danger:hover {
|
|
117
|
+
background: var(--ic-error);
|
|
118
|
+
color: #fff;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.error-container {
|
|
122
|
+
padding: var(--ic-space-lg);
|
|
123
|
+
text-align: center;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.error-message {
|
|
127
|
+
color: var(--ic-error);
|
|
128
|
+
font-size: var(--ic-text-sm);
|
|
129
|
+
margin-bottom: var(--ic-space-md);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.retry-btn {
|
|
133
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
134
|
+
background: var(--ic-accent);
|
|
135
|
+
border: none;
|
|
136
|
+
border-radius: var(--ic-radius-md);
|
|
137
|
+
color: #fff;
|
|
138
|
+
font-size: var(--ic-text-sm);
|
|
139
|
+
font-family: inherit;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.retry-btn:hover {
|
|
144
|
+
background: var(--ic-accent-hover);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.loading-container {
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
padding: var(--ic-space-2xl);
|
|
151
|
+
}
|
|
152
|
+
`]}connectedCallback(){super.connectedCallback(),this._initSse()}updated(e){e.has(`apiClient`)&&this.apiClient&&(this._loadSessions(),this._loadConfiguredAgents()),e.has(`eventDispatcher`)&&this.eventDispatcher&&!this._sse&&this._initSse()}disconnectedCallback(){super.disconnectedCallback(),this._reloadDebounce!==null&&(clearTimeout(this._reloadDebounce),this._reloadDebounce=null)}_initSse(){!this.eventDispatcher||this._sse||(this._sse=new d(this,this.eventDispatcher,{"session:created":()=>{this._scheduleReload()},"session:expired":()=>{this._scheduleReload()}}))}_scheduleReload(e=300){this._reloadDebounce!==null&&clearTimeout(this._reloadDebounce),this._reloadDebounce=setTimeout(()=>{this._reloadDebounce=null,this._loadSessions()},e)}async _loadSessions(){if(this.apiClient){this._loading=!0,this._error=``;try{this._sessions=await this.apiClient.listSessions(),this._applyFilters()}catch{this._error=`Failed to load sessions. Please try again.`}finally{this._loading=!1}}}_applyFilters(){let e=this._sessions;if(this._searchQuery)if(this._searchResultKeys)e=e.filter(e=>this._searchResultKeys.has(e.key));else{let t=this._searchQuery.toLowerCase();e=e.filter(e=>e.key.toLowerCase().includes(t)||e.agentId.toLowerCase().includes(t)||e.channelType.toLowerCase().includes(t))}this._agentFilter&&(e=e.filter(e=>e.agentId===this._agentFilter)),this._channelFilter&&(e=e.filter(e=>e.channelType===this._channelFilter)),this._statusFilter&&(e=e.filter(e=>m(e.lastActiveAt)===this._statusFilter)),this._filteredSessions=e}_getUniqueAgents(){return[...new Set([...this._configuredAgentIds,...this._sessions.map(e=>e.agentId)])].sort()}async _loadConfiguredAgents(){if(this.apiClient)try{let e=await this.apiClient.getAgents();this._configuredAgentIds=e.map(e=>e.id)}catch{}}_getUniqueChannels(){return[...new Set(this._sessions.map(e=>e.channelType))].sort()}_handleSearch(e){if(this._searchQuery=e.detail,this._searchDebounceTimer!==null&&(clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=null),!this._searchQuery){this._searchResultKeys=null,this._applyFilters();return}this.rpcClient?this._searchDebounceTimer=setTimeout(()=>{this._performRpcSearch(this._searchQuery)},300):(this._searchResultKeys=null,this._applyFilters())}async _performRpcSearch(e){if(this.rpcClient){try{let t=await this.rpcClient.call(`session.search`,{query:e,limit:50});this._searchResultKeys=new Set(t.map(e=>e.sessionKey))}catch{this._searchResultKeys=null}this._applyFilters()}}_handleAgentFilter(e){this._agentFilter=e.target.value,this._applyFilters()}_handleChannelFilter(e){this._channelFilter=e.target.value,this._applyFilters()}_handleStatusFilter(e){this._statusFilter=e.target.value,this._applyFilters()}_handleSessionClick(e){let t=e.detail;window.location.hash=`#/sessions/${t.key}`}_handleSelectionChange(e){this._selectedKeys=e.detail}_showBulkConfirm(e){this._confirmAction=e,this._showConfirm=!0}_handleConfirmCancel(){this._showConfirm=!1,this._confirmAction=``}async _handleConfirm(){if(this._showConfirm=!1,this.apiClient)try{this._confirmAction===`reset`?(await this.apiClient.resetSessionsBulk(this._selectedKeys),u.show(`${this._selectedKeys.length} sessions reset`,`success`)):this._confirmAction===`delete`&&(await this.apiClient.deleteSessionsBulk(this._selectedKeys),u.show(`${this._selectedKeys.length} sessions deleted`,`success`)),this._selectedKeys=[],this._confirmAction=``,await this._loadSessions()}catch{u.show(`Operation failed. Please try again.`,`error`)}}async _handleBulkExport(){if(!(!this.apiClient||this._selectedKeys.length===0))try{let e=await this.apiClient.exportSessionsBulk(this._selectedKeys),t=new Blob([e],{type:`application/jsonl`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`sessions-export-${Date.now()}.jsonl`,r.click(),URL.revokeObjectURL(n),u.show(`${this._selectedKeys.length} sessions exported`,`success`)}catch{u.show(`Export failed. Please try again.`,`error`)}}_renderAgentSelect(){let e=this._getUniqueAgents();return t`<select class="filter-select" .value=${this._agentFilter} @change=${this._handleAgentFilter} aria-label="Filter by agent">
|
|
153
|
+
<option value="">All Agents</option>
|
|
154
|
+
${e.map(e=>t`<option .value=${e}>${e}</option>`)}
|
|
155
|
+
</select>`}_renderChannelSelect(){let e=this._getUniqueChannels();return t`<select class="filter-select" .value=${this._channelFilter} @change=${this._handleChannelFilter} aria-label="Filter by channel">
|
|
156
|
+
<option value="">All Channels</option>
|
|
157
|
+
${e.map(e=>t`<option .value=${e}>${e}</option>`)}
|
|
158
|
+
</select>`}_renderStatusSelect(){return t`<select class="filter-select" .value=${this._statusFilter} @change=${this._handleStatusFilter} aria-label="Filter by status">
|
|
159
|
+
<option value="">All Statuses</option>
|
|
160
|
+
<option value="active">Active</option>
|
|
161
|
+
<option value="idle">Idle</option>
|
|
162
|
+
<option value="expired">Expired</option>
|
|
163
|
+
</select>`}_renderFilterBar(){return t`
|
|
164
|
+
<div class="filter-bar">
|
|
165
|
+
<ic-search-input
|
|
166
|
+
placeholder="Search sessions..."
|
|
167
|
+
.value=${this._searchQuery}
|
|
168
|
+
@search=${this._handleSearch}
|
|
169
|
+
></ic-search-input>
|
|
170
|
+
${this._renderAgentSelect()}
|
|
171
|
+
${this._renderChannelSelect()}
|
|
172
|
+
${this._renderStatusSelect()}
|
|
173
|
+
</div>
|
|
174
|
+
`}_renderBulkBar(){return this._selectedKeys.length===0?l:t`
|
|
175
|
+
<div class="bulk-bar">
|
|
176
|
+
<span class="bulk-count">${this._selectedKeys.length} selected</span>
|
|
177
|
+
<div class="bulk-actions">
|
|
178
|
+
<button class="btn btn-ghost" @click=${()=>this._showBulkConfirm(`reset`)}>
|
|
179
|
+
Reset Selected
|
|
180
|
+
</button>
|
|
181
|
+
<button class="btn btn-ghost" @click=${this._handleBulkExport}>
|
|
182
|
+
Export Selected
|
|
183
|
+
</button>
|
|
184
|
+
<button class="btn btn-danger" @click=${()=>this._showBulkConfirm(`delete`)}>
|
|
185
|
+
Delete Selected
|
|
186
|
+
</button>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
`}_getConfirmProps(){return this._confirmAction===`delete`?{title:`Delete Sessions`,message:`Are you sure you want to delete ${this._selectedKeys.length} sessions? This action cannot be undone.`,variant:`danger`,label:`Delete`}:{title:`Reset Sessions`,message:`Are you sure you want to reset ${this._selectedKeys.length} sessions? All conversation history will be cleared.`,variant:`default`,label:`Reset`}}render(){if(this._loading)return t`
|
|
190
|
+
<div class="page-header"><h1 class="page-title">Sessions</h1></div>
|
|
191
|
+
<ic-skeleton-view variant="list"></ic-skeleton-view>
|
|
192
|
+
`;if(this._error)return t`
|
|
193
|
+
<div class="page-header"><h1 class="page-title">Sessions</h1></div>
|
|
194
|
+
<div class="error-container">
|
|
195
|
+
<div class="error-message">${this._error}</div>
|
|
196
|
+
<button class="retry-btn" @click=${()=>this._loadSessions()}>Retry</button>
|
|
197
|
+
</div>
|
|
198
|
+
`;if(this._sessions.length===0)return t`
|
|
199
|
+
<div class="page-header"><h1 class="page-title">Sessions</h1></div>
|
|
200
|
+
<ic-empty-state
|
|
201
|
+
icon="message-circle"
|
|
202
|
+
message="No active sessions"
|
|
203
|
+
description="Sessions appear when agents receive messages."
|
|
204
|
+
>
|
|
205
|
+
<button class="retry-btn" @click=${()=>{window.location.hash=`#/chat`}}>Go to Chat</button>
|
|
206
|
+
</ic-empty-state>
|
|
207
|
+
`;let e=this._getConfirmProps();return t`
|
|
208
|
+
<div class="page-header" role="region" aria-label="Sessions">
|
|
209
|
+
<h1 class="page-title">Sessions</h1>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
${this._renderFilterBar()}
|
|
213
|
+
${this._renderBulkBar()}
|
|
214
|
+
|
|
215
|
+
<ic-session-list
|
|
216
|
+
.sessions=${this._filteredSessions}
|
|
217
|
+
selectable
|
|
218
|
+
@session-click=${this._handleSessionClick}
|
|
219
|
+
@selection-change=${this._handleSelectionChange}
|
|
220
|
+
></ic-session-list>
|
|
221
|
+
|
|
222
|
+
<ic-confirm-dialog
|
|
223
|
+
?open=${this._showConfirm}
|
|
224
|
+
title=${e.title}
|
|
225
|
+
message=${e.message}
|
|
226
|
+
variant=${e.variant}
|
|
227
|
+
confirmLabel=${e.label}
|
|
228
|
+
@confirm=${this._handleConfirm}
|
|
229
|
+
@cancel=${this._handleConfirmCancel}
|
|
230
|
+
></ic-confirm-dialog>
|
|
231
|
+
`}};c([s({attribute:!1})],y.prototype,`apiClient`,void 0),c([s({attribute:!1})],y.prototype,`rpcClient`,void 0),c([s({attribute:!1})],y.prototype,`eventDispatcher`,void 0),c([a()],y.prototype,`_sessions`,void 0),c([a()],y.prototype,`_filteredSessions`,void 0),c([a()],y.prototype,`_loading`,void 0),c([a()],y.prototype,`_error`,void 0),c([a()],y.prototype,`_searchQuery`,void 0),c([a()],y.prototype,`_agentFilter`,void 0),c([a()],y.prototype,`_channelFilter`,void 0),c([a()],y.prototype,`_statusFilter`,void 0),c([a()],y.prototype,`_selectedKeys`,void 0),c([a()],y.prototype,`_showConfirm`,void 0),c([a()],y.prototype,`_confirmAction`,void 0),c([a()],y.prototype,`_configuredAgentIds`,void 0),y=c([e(`ic-session-list-view`)],y);export{y as IcSessionListView};
|