comisai 1.0.16 → 1.0.17

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 (90) 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/dist/wizard/non-interactive.js +1 -0
  4. package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.js +4 -0
  5. package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.js +9 -0
  6. package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +2 -0
  7. package/node_modules/@comis/cli/dist/wizard/steps/12-finish.js +5 -2
  8. package/node_modules/@comis/cli/dist/wizard/types.d.ts +1 -0
  9. package/node_modules/@comis/cli/package.json +1 -1
  10. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +17 -2
  11. package/node_modules/@comis/core/dist/config/schema-gateway.js +11 -0
  12. package/node_modules/@comis/core/dist/config/schema.d.ts +60 -57
  13. package/node_modules/@comis/core/package.json +1 -1
  14. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +34 -6
  15. package/node_modules/@comis/daemon/package.json +1 -1
  16. package/node_modules/@comis/gateway/package.json +1 -1
  17. package/node_modules/@comis/infra/package.json +1 -1
  18. package/node_modules/@comis/memory/package.json +1 -1
  19. package/node_modules/@comis/scheduler/package.json +1 -1
  20. package/node_modules/@comis/shared/package.json +1 -1
  21. package/node_modules/@comis/skills/package.json +1 -1
  22. package/node_modules/@comis/web/dist/android-chrome-192x192.png +0 -0
  23. package/node_modules/@comis/web/dist/android-chrome-512x512.png +0 -0
  24. package/node_modules/@comis/web/dist/apple-touch-icon.png +0 -0
  25. package/node_modules/@comis/web/dist/assets/agent-detail-BG9MGWWj.js +615 -0
  26. package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +2173 -0
  27. package/node_modules/@comis/web/dist/assets/agent-list-LHCJ4rw2.js +504 -0
  28. package/node_modules/@comis/web/dist/assets/approvals-q9VH_IKr.js +54 -0
  29. package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +375 -0
  30. package/node_modules/@comis/web/dist/assets/channel-detail-CaInesJM.js +681 -0
  31. package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +323 -0
  32. package/node_modules/@comis/web/dist/assets/chat-console-CNmzl0JW.js +943 -0
  33. package/node_modules/@comis/web/dist/assets/config-editor-DX4ITw6y.js +1374 -0
  34. package/node_modules/@comis/web/dist/assets/context-dag-browser-BwiaF5tf.js +393 -0
  35. package/node_modules/@comis/web/dist/assets/context-engine-BZ5Am6hA.js +393 -0
  36. package/node_modules/@comis/web/dist/assets/delivery-view-OfBZof-m.js +392 -0
  37. package/node_modules/@comis/web/dist/assets/diagnostics-view-YFwCxgr2.js +231 -0
  38. package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +1 -0
  39. package/node_modules/@comis/web/dist/assets/extract-variables-BM5qyK-s.js +149 -0
  40. package/node_modules/@comis/web/dist/assets/ic-array-editor-B7m6x7-S.js +118 -0
  41. package/node_modules/@comis/web/dist/assets/ic-breadcrumb-CUMpp3BL.js +75 -0
  42. package/node_modules/@comis/web/dist/assets/ic-budget-segment-bar-BtJ6x5mN.js +64 -0
  43. package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +352 -0
  44. package/node_modules/@comis/web/dist/assets/ic-confirm-dialog-CCDbB04e.js +110 -0
  45. package/node_modules/@comis/web/dist/assets/ic-connection-dot-CnT1b8xr.js +54 -0
  46. package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +277 -0
  47. package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +67 -0
  48. package/node_modules/@comis/web/dist/assets/ic-detail-panel-BF83r-if.js +116 -0
  49. package/node_modules/@comis/web/dist/assets/ic-empty-state-60l2ePhd.js +52 -0
  50. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +359 -0
  51. package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +33 -0
  52. package/node_modules/@comis/web/dist/assets/ic-layer-waterfall-COvEYMg5.js +69 -0
  53. package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +12 -0
  54. package/node_modules/@comis/web/dist/assets/ic-search-input-CSOxY9g7.js +92 -0
  55. package/node_modules/@comis/web/dist/assets/ic-select-Ce-Raudx.js +127 -0
  56. package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +95 -0
  57. package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +33 -0
  58. package/node_modules/@comis/web/dist/assets/ic-time-range-picker-CypCT68y.js +93 -0
  59. package/node_modules/@comis/web/dist/assets/ic-tool-call-7MaXSsCW.js +146 -0
  60. package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +2830 -0
  61. package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +1 -0
  62. package/node_modules/@comis/web/dist/assets/mcp-management-BNZPnpDn.js +582 -0
  63. package/node_modules/@comis/web/dist/assets/media-config-BBvTYxOX.js +314 -0
  64. package/node_modules/@comis/web/dist/assets/media-test-BkK3RCRK.js +496 -0
  65. package/node_modules/@comis/web/dist/assets/memory-inspector-1hDGCGat.js +1139 -0
  66. package/node_modules/@comis/web/dist/assets/message-center-CXefwsUu.js +785 -0
  67. package/node_modules/@comis/web/dist/assets/models-C1qcU_j3.js +894 -0
  68. package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +1 -0
  69. package/node_modules/@comis/web/dist/assets/observe-view-C0VBhX4C.js +814 -0
  70. package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +1496 -0
  71. package/node_modules/@comis/web/dist/assets/pipeline-history-DkfOQ6SW.js +317 -0
  72. package/node_modules/@comis/web/dist/assets/pipeline-history-detail-hyHgD0ai.js +287 -0
  73. package/node_modules/@comis/web/dist/assets/pipeline-list-BPW8hV-q.js +518 -0
  74. package/node_modules/@comis/web/dist/assets/pipeline-monitor-Bip16T7e.js +972 -0
  75. package/node_modules/@comis/web/dist/assets/scheduler-BGgwKd06.js +1182 -0
  76. package/node_modules/@comis/web/dist/assets/security-D15st4xx.js +1224 -0
  77. package/node_modules/@comis/web/dist/assets/session-detail-SGEYNJ0M.js +632 -0
  78. package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +1 -0
  79. package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +231 -0
  80. package/node_modules/@comis/web/dist/assets/setup-wizard-nT0tz9QP.js +853 -0
  81. package/node_modules/@comis/web/dist/assets/skills-D8yVfSUy.js +1051 -0
  82. package/node_modules/@comis/web/dist/assets/subagents-HHXMeHYo.js +193 -0
  83. package/node_modules/@comis/web/dist/assets/workspace-manager-BQlr10iH.js +785 -0
  84. package/node_modules/@comis/web/dist/comis-logo.png +0 -0
  85. package/node_modules/@comis/web/dist/favicon-16x16.png +0 -0
  86. package/node_modules/@comis/web/dist/favicon-32x32.png +0 -0
  87. package/node_modules/@comis/web/dist/favicon.ico +0 -0
  88. package/node_modules/@comis/web/dist/index.html +17 -0
  89. package/node_modules/@comis/web/package.json +29 -0
  90. package/package.json +15 -13
@@ -0,0 +1,317 @@
1
+ import{a as h,I as p,b as a,A as u,s as m,f as b,i as g,n as v,r as c,t as _}from"./index-CEcM1R_C.js";import"./ic-breadcrumb-CUMpp3BL.js";import"./ic-confirm-dialog-CCDbB04e.js";import"./ic-empty-state-60l2ePhd.js";import"./ic-icon-xeGTVhVG.js";var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,n=(e,t,r,o)=>{for(var i=o>1?void 0:o?x(t,r):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(i=(o?d(t,r,i):d(i))||i);return o&&i&&f(t,r,i),i};const w={completed:"#22c55e",failed:"#ef4444"};function $(e){if(!e)return"Never";const t=Date.now()-e;if(t<0)return"just now";const r=Math.floor(t/1e3);if(r<60)return"just now";const o=Math.floor(r/60);if(o<60)return`${o}m ago`;const i=Math.floor(o/60);if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<30?`${l}d ago`:new Date(e).toISOString().slice(0,10)}let s=class extends h{constructor(){super(...arguments),this.rpcClient=null,this._rpcStatusUnsub=null,this._runs=[],this._loading=!0,this._sortField="date",this._sortDir="desc",this._deleteTarget=null}get _breadcrumbs(){return[{label:"Pipelines",route:"pipelines"},{label:"History"}]}disconnectedCallback(){super.disconnectedCallback(),this._rpcStatusUnsub?.(),this._rpcStatusUnsub=null}updated(e){e.has("rpcClient")&&this.rpcClient&&(this._rpcStatusUnsub?.(),this.rpcClient.status==="connected"?this._loadRuns():this._rpcStatusUnsub=this.rpcClient.onStatusChange(t=>{t==="connected"&&(this._rpcStatusUnsub=null,this._loadRuns())}))}async _loadRuns(){this._loading=!0;try{const e=await this.rpcClient?.call("graph.runs",{});this._runs=e?.runs??[]}catch{this._runs=[]}this._loading=!1}get _sorted(){return[...this._runs].sort((e,t)=>{let r=0;switch(this._sortField){case"name":r=e.name.localeCompare(t.name);break;case"status":r=e.status.localeCompare(t.status);break;case"nodeCount":r=e.nodeCount-t.nodeCount;break;case"date":r=e.date.localeCompare(t.date);break}return this._sortDir==="asc"?r:-r})}_handleSort(e){this._sortField===e?this._sortDir=this._sortDir==="asc"?"desc":"asc":(this._sortField=e,this._sortDir=e==="name"?"asc":"desc")}_sortArrow(e){return this._sortField!==e?"":this._sortDir==="asc"?"▲":"▼"}_sortArrowClass(e){return this._sortField===e?"sort-arrow sort-arrow--active":"sort-arrow"}_navigateToDetail(e){window.location.hash=`#/pipelines/history/${e.graphId}`}_handleDeleteClick(e,t){t.stopPropagation(),this._deleteTarget=e}async _confirmDelete(){if(!this._deleteTarget)return;const e=this._deleteTarget;this._deleteTarget=null;try{await this.rpcClient?.call("graph.deleteRun",{graphId:e.graphId}),this._runs=this._runs.filter(t=>t.graphId!==e.graphId),p.show(`Deleted "${e.name}"`,"success")}catch(t){p.show(`Failed to delete: ${t instanceof Error?t.message:"Unknown error"}`,"error")}}_cancelDelete(){this._deleteTarget=null}_renderStatusDot(e){const t=w[e]??"#6b7280",r=e.charAt(0).toUpperCase()+e.slice(1);return a`<span class="status-text">
2
+ <span class="status-dot" style="--dot-color: ${t}"></span>
3
+ ${r}
4
+ </span>`}_dateToRelative(e){const t=new Date(e).getTime();return $(t)}render(){return a`
5
+ <ic-breadcrumb .items=${this._breadcrumbs}
6
+ @navigate=${e=>this.dispatchEvent(new CustomEvent("navigate",{detail:e.detail,bubbles:!0,composed:!0}))}
7
+ ></ic-breadcrumb>
8
+
9
+ <div class="page-header" role="region" aria-label="Pipeline History">
10
+ <h1 class="page-title">Pipeline History</h1>
11
+ </div>
12
+
13
+ ${this._renderContent()}
14
+ ${this._deleteTarget?a`
15
+ <ic-confirm-dialog
16
+ open
17
+ variant="danger"
18
+ title="Delete Run"
19
+ message=${`Delete run "${this._deleteTarget.name}"? This cannot be undone.`}
20
+ confirmLabel="Delete"
21
+ @confirm=${this._confirmDelete}
22
+ @cancel=${this._cancelDelete}
23
+ ></ic-confirm-dialog>
24
+ `:u}
25
+ `}_renderContent(){if(this._loading)return a`<ic-skeleton-view variant="list"></ic-skeleton-view>`;if(this._runs.length===0)return a`
26
+ <ic-empty-state
27
+ icon="git-branch"
28
+ message="No pipeline runs yet"
29
+ description="Run a pipeline to see results here."
30
+ >
31
+ <button
32
+ class="action-btn"
33
+ style="padding: 8px 16px; width: auto; height: auto; border: 1px solid var(--ic-border, #374151); color: var(--ic-text, #f3f4f6);"
34
+ @click=${()=>{window.location.hash="#/pipelines/new"}}
35
+ >
36
+ New Pipeline
37
+ </button>
38
+ </ic-empty-state>
39
+ `;const e=this._sorted;return a`
40
+ ${this._renderTable(e)}
41
+ ${this._renderMobileList(e)}
42
+ `}_renderTable(e){return a`
43
+ <div class="grid-table" role="table">
44
+ <div class="grid-header" role="row">
45
+ <div class="cell" role="columnheader" @click=${()=>this._handleSort("name")}>
46
+ Name
47
+ <span class=${this._sortArrowClass("name")}>${this._sortArrow("name")}</span>
48
+ </div>
49
+ <div class="cell" role="columnheader" @click=${()=>this._handleSort("status")}>
50
+ Status
51
+ <span class=${this._sortArrowClass("status")}>${this._sortArrow("status")}</span>
52
+ </div>
53
+ <div class="cell" role="columnheader" @click=${()=>this._handleSort("nodeCount")}>
54
+ Nodes
55
+ <span class=${this._sortArrowClass("nodeCount")}>${this._sortArrow("nodeCount")}</span>
56
+ </div>
57
+ <div class="cell" role="columnheader" @click=${()=>this._handleSort("date")}>
58
+ Date
59
+ <span class=${this._sortArrowClass("date")}>${this._sortArrow("date")}</span>
60
+ </div>
61
+ <div class="cell actions-header" role="columnheader">Actions</div>
62
+ </div>
63
+ ${e.map(t=>this._renderRow(t))}
64
+ </div>
65
+ `}_renderRow(e){return a`
66
+ <div class="grid-row" role="row" @click=${()=>this._navigateToDetail(e)}>
67
+ <div class="cell" role="cell">
68
+ <span class="run-name">${e.name}</span>
69
+ </div>
70
+ <div class="cell" role="cell">
71
+ ${this._renderStatusDot(e.status)}
72
+ </div>
73
+ <div class="cell" role="cell">${e.nodeCount}</div>
74
+ <div class="cell dim-text" role="cell">${this._dateToRelative(e.date)}</div>
75
+ <div class="cell actions-cell" role="cell">
76
+ <button
77
+ class="action-btn"
78
+ aria-label="View ${e.name}"
79
+ @click=${t=>{t.stopPropagation(),this._navigateToDetail(e)}}
80
+ >
81
+ <ic-icon name="eye" size="16px"></ic-icon>
82
+ </button>
83
+ <button
84
+ class="action-btn action-btn--danger"
85
+ aria-label="Delete ${e.name}"
86
+ @click=${t=>this._handleDeleteClick(e,t)}
87
+ >
88
+ <ic-icon name="trash" size="16px"></ic-icon>
89
+ </button>
90
+ </div>
91
+ </div>
92
+ `}_renderMobileList(e){return a`
93
+ <div class="mobile-list">
94
+ ${e.map(t=>a`
95
+ <div class="mobile-card" @click=${()=>this._navigateToDetail(t)}>
96
+ <div class="card-header">
97
+ <span class="card-label">${t.name}</span>
98
+ ${this._renderStatusDot(t.status)}
99
+ </div>
100
+ <div class="card-meta">
101
+ <span>${t.nodeCount} nodes</span>
102
+ <span>${this._dateToRelative(t.date)}</span>
103
+ </div>
104
+ <div class="card-actions">
105
+ <button
106
+ class="action-btn"
107
+ aria-label="View ${t.name}"
108
+ @click=${r=>{r.stopPropagation(),this._navigateToDetail(t)}}
109
+ >
110
+ <ic-icon name="eye" size="16px"></ic-icon>
111
+ </button>
112
+ <button
113
+ class="action-btn action-btn--danger"
114
+ aria-label="Delete ${t.name}"
115
+ @click=${r=>this._handleDeleteClick(t,r)}
116
+ >
117
+ <ic-icon name="trash" size="16px"></ic-icon>
118
+ </button>
119
+ </div>
120
+ </div>
121
+ `)}
122
+ </div>
123
+ `}};s.styles=[m,b,g`
124
+ :host {
125
+ display: block;
126
+ }
127
+
128
+ .page-header {
129
+ display: flex;
130
+ justify-content: space-between;
131
+ align-items: center;
132
+ margin-bottom: var(--ic-space-lg, 1.5rem);
133
+ }
134
+
135
+ .page-title {
136
+ font-size: var(--ic-text-2xl, 1.5rem);
137
+ font-weight: 700;
138
+ margin: 0;
139
+ }
140
+
141
+ /* Grid-based table -- 5 columns */
142
+ .grid-table {
143
+ display: grid;
144
+ grid-template-columns: minmax(180px, 2fr) 100px 70px 120px auto;
145
+ width: 100%;
146
+ }
147
+
148
+ .grid-header {
149
+ display: contents;
150
+ }
151
+
152
+ .grid-header .cell {
153
+ font-size: var(--ic-text-xs, 0.75rem);
154
+ font-weight: 600;
155
+ text-transform: uppercase;
156
+ letter-spacing: 0.05em;
157
+ color: var(--ic-text-dim, #6b7280);
158
+ padding: var(--ic-space-sm, 0.5rem) var(--ic-space-md, 0.75rem);
159
+ border-bottom: 1px solid var(--ic-border, #374151);
160
+ cursor: pointer;
161
+ user-select: none;
162
+ white-space: nowrap;
163
+ }
164
+
165
+ .grid-header .cell:hover {
166
+ color: var(--ic-text-muted, #9ca3af);
167
+ }
168
+
169
+ .grid-header .cell.actions-header {
170
+ cursor: default;
171
+ text-align: right;
172
+ }
173
+
174
+ .grid-header .cell.actions-header:hover {
175
+ color: var(--ic-text-dim, #6b7280);
176
+ }
177
+
178
+ .sort-arrow {
179
+ display: inline-block;
180
+ margin-left: 4px;
181
+ font-size: 0.625rem;
182
+ opacity: 0.5;
183
+ }
184
+
185
+ .sort-arrow--active {
186
+ opacity: 1;
187
+ color: var(--ic-accent, #3b82f6);
188
+ }
189
+
190
+ .grid-row {
191
+ display: contents;
192
+ cursor: pointer;
193
+ }
194
+
195
+ .grid-row .cell {
196
+ padding: var(--ic-space-sm, 0.5rem) var(--ic-space-md, 0.75rem);
197
+ border-bottom: 1px solid var(--ic-border, #374151);
198
+ font-size: var(--ic-text-sm, 0.875rem);
199
+ display: flex;
200
+ align-items: center;
201
+ transition: background var(--ic-transition, 150ms ease);
202
+ }
203
+
204
+ .grid-row:hover .cell {
205
+ background: var(--ic-surface-2, #1f2937);
206
+ }
207
+
208
+ .grid-row .cell.actions-cell {
209
+ justify-content: flex-end;
210
+ white-space: nowrap;
211
+ }
212
+
213
+ .run-name {
214
+ font-weight: 500;
215
+ color: var(--ic-text, #f3f4f6);
216
+ }
217
+
218
+ /* Status dot */
219
+ .status-dot {
220
+ display: inline-block;
221
+ width: 8px;
222
+ height: 8px;
223
+ border-radius: 50%;
224
+ background: var(--dot-color, #6b7280);
225
+ margin-right: 6px;
226
+ vertical-align: middle;
227
+ flex-shrink: 0;
228
+ }
229
+
230
+ .status-text {
231
+ display: inline-flex;
232
+ align-items: center;
233
+ }
234
+
235
+ /* Action buttons */
236
+ .action-btn {
237
+ display: inline-flex;
238
+ align-items: center;
239
+ justify-content: center;
240
+ width: 32px;
241
+ height: 32px;
242
+ padding: 0;
243
+ background: transparent;
244
+ border: 1px solid transparent;
245
+ border-radius: var(--ic-radius-sm, 0.25rem);
246
+ color: var(--ic-text-dim, #6b7280);
247
+ cursor: pointer;
248
+ transition: background var(--ic-transition, 150ms ease),
249
+ color var(--ic-transition, 150ms ease),
250
+ border-color var(--ic-transition, 150ms ease);
251
+ }
252
+
253
+ .action-btn:hover {
254
+ background: var(--ic-surface-2, #1f2937);
255
+ color: var(--ic-text, #f3f4f6);
256
+ border-color: var(--ic-border, #374151);
257
+ }
258
+
259
+ .action-btn--danger:hover {
260
+ color: var(--ic-error, #f87171);
261
+ border-color: var(--ic-error, #f87171);
262
+ }
263
+
264
+ .dim-text {
265
+ color: var(--ic-text-dim, #6b7280);
266
+ }
267
+
268
+ /* Mobile responsive cards */
269
+ .mobile-list {
270
+ display: none;
271
+ }
272
+
273
+ @media (max-width: 767px) {
274
+ .grid-table {
275
+ display: none;
276
+ }
277
+ .mobile-list {
278
+ display: flex;
279
+ flex-direction: column;
280
+ gap: 8px;
281
+ }
282
+ .mobile-card {
283
+ background: var(--ic-surface, #111827);
284
+ border: 1px solid var(--ic-border, #374151);
285
+ border-radius: var(--ic-radius-md, 0.5rem);
286
+ padding: 12px;
287
+ cursor: pointer;
288
+ transition: border-color var(--ic-transition, 150ms ease);
289
+ }
290
+ .mobile-card:hover {
291
+ border-color: var(--ic-accent, #3b82f6);
292
+ }
293
+ .card-header {
294
+ display: flex;
295
+ justify-content: space-between;
296
+ align-items: center;
297
+ margin-bottom: 8px;
298
+ }
299
+ .card-label {
300
+ font-weight: 600;
301
+ font-size: var(--ic-text-sm, 0.875rem);
302
+ color: var(--ic-text, #f3f4f6);
303
+ }
304
+ .card-meta {
305
+ display: flex;
306
+ gap: 12px;
307
+ font-size: var(--ic-text-xs, 0.75rem);
308
+ color: var(--ic-text-dim, #6b7280);
309
+ margin-bottom: 8px;
310
+ }
311
+ .card-actions {
312
+ display: flex;
313
+ gap: 4px;
314
+ justify-content: flex-end;
315
+ }
316
+ }
317
+ `];n([v({attribute:!1})],s.prototype,"rpcClient",2);n([c()],s.prototype,"_runs",2);n([c()],s.prototype,"_loading",2);n([c()],s.prototype,"_sortField",2);n([c()],s.prototype,"_sortDir",2);n([c()],s.prototype,"_deleteTarget",2);s=n([_("ic-pipeline-history")],s);export{s as IcPipelineHistory};
@@ -0,0 +1,287 @@
1
+ import{a as h,I as p,b as n,A as v,s as g,f as b,i as x,n as f,r as l,t as _}from"./index-CEcM1R_C.js";import{o as m,r as u}from"./ic-chat-message-CFyDJd0z.js";import"./ic-breadcrumb-CUMpp3BL.js";import"./ic-confirm-dialog-CCDbB04e.js";import"./ic-icon-xeGTVhVG.js";import"./directive-DoeGSK_T.js";var y=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,s,a)=>{for(var t=a>1?void 0:a?w(r,s):r,o=e.length-1,d;o>=0;o--)(d=e[o])&&(t=(a?d(r,s,t):d(t))||t);return a&&t&&y(r,s,t),t};const $={completed:"#22c55e",failed:"#ef4444"};function C(e){if(!e)return"Never";const r=Date.now()-e;if(r<0)return"just now";const s=Math.floor(r/1e3);if(s<60)return"just now";const a=Math.floor(s/60);if(a<60)return`${a}m ago`;const t=Math.floor(a/60);if(t<24)return`${t}h ago`;const o=Math.floor(t/24);return o<30?`${o}d ago`:new Date(e).toISOString().slice(0,10)}function D(e){return e.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}let i=class extends h{constructor(){super(...arguments),this.rpcClient=null,this.graphId="",this._rpcStatusUnsub=null,this._detail=null,this._loading=!0,this._error=!1,this._showDeleteConfirm=!1}get _breadcrumbs(){return[{label:"Pipelines",route:"pipelines"},{label:"History",route:"pipelines/history"},{label:this._detail?.name??this.graphId}]}disconnectedCallback(){super.disconnectedCallback(),this._rpcStatusUnsub?.(),this._rpcStatusUnsub=null}updated(e){(e.has("rpcClient")||e.has("graphId"))&&this.rpcClient&&this.graphId&&(this._rpcStatusUnsub?.(),this.rpcClient.status==="connected"?this._loadDetail():this._rpcStatusUnsub=this.rpcClient.onStatusChange(r=>{r==="connected"&&(this._rpcStatusUnsub=null,this._loadDetail())}))}async _loadDetail(){this._loading=!0,this._error=!1;try{const e=await this.rpcClient?.call("graph.runDetail",{graphId:this.graphId});e?this._detail=e:this._error=!0}catch{this._error=!0}this._loading=!1}async _confirmDelete(){this._showDeleteConfirm=!1;try{await this.rpcClient?.call("graph.deleteRun",{graphId:this.graphId}),p.show("Run deleted","success"),window.location.hash="#/pipelines/history"}catch(e){p.show(`Failed to delete: ${e instanceof Error?e.message:"Unknown error"}`,"error")}}render(){return n`
2
+ <ic-breadcrumb .items=${this._breadcrumbs}
3
+ @navigate=${e=>this.dispatchEvent(new CustomEvent("navigate",{detail:e.detail,bubbles:!0,composed:!0}))}
4
+ ></ic-breadcrumb>
5
+
6
+ ${this._renderContent()}
7
+
8
+ <ic-confirm-dialog
9
+ ?open=${this._showDeleteConfirm}
10
+ variant="danger"
11
+ title="Delete Run"
12
+ message=${`Delete run "${this._detail?.name??this.graphId}"? This cannot be undone.`}
13
+ confirmLabel="Delete"
14
+ @confirm=${this._confirmDelete}
15
+ @cancel=${()=>{this._showDeleteConfirm=!1}}
16
+ ></ic-confirm-dialog>
17
+ `}_renderContent(){if(this._loading)return n`<ic-skeleton-view variant="detail"></ic-skeleton-view>`;if(this._error||!this._detail)return n`
18
+ <div class="not-found">
19
+ <p>Run not found.</p>
20
+ <a href="#/pipelines/history">Back to History</a>
21
+ </div>
22
+ `;const e=this._detail,r=new Date(e.date).getTime(),s=$[e.status]??"#6b7280",a=e.status.charAt(0).toUpperCase()+e.status.slice(1);return n`
23
+ <div class="meta-header">
24
+ <div class="meta-info">
25
+ <h2 class="meta-name">${e.name}</h2>
26
+ <div class="meta-details">
27
+ <span class="meta-detail">
28
+ <span class="status-text">
29
+ <span class="status-dot" style="--dot-color: ${s}"></span>
30
+ ${a}
31
+ </span>
32
+ </span>
33
+ <span class="meta-detail">${C(r)}</span>
34
+ <span class="meta-detail">${e.nodes.length} nodes</span>
35
+ </div>
36
+ </div>
37
+ <button
38
+ class="delete-btn"
39
+ @click=${()=>{this._showDeleteConfirm=!0}}
40
+ >
41
+ <ic-icon name="trash" size="14px"></ic-icon>
42
+ Delete Run
43
+ </button>
44
+ </div>
45
+
46
+ <div class="node-accordion">
47
+ ${e.nodes.map((t,o)=>n`
48
+ <details class="node-section" ?open=${o===0}>
49
+ <summary>${D(t.nodeId)}</summary>
50
+ <div class="node-content">
51
+ ${t.output?m(u(t.output)):n`<p class="no-output">No output</p>`}
52
+ ${t.artifacts.length>0?t.artifacts.map(d=>n`
53
+ <details class="artifact-section">
54
+ <summary>${d.filename}</summary>
55
+ <div class="artifact-content">
56
+ ${m(u(d.content))}
57
+ </div>
58
+ </details>
59
+ `):v}
60
+ </div>
61
+ </details>
62
+ `)}
63
+ </div>
64
+ `}};i.styles=[g,b,x`
65
+ :host {
66
+ display: block;
67
+ }
68
+
69
+ /* Metadata header */
70
+ .meta-header {
71
+ display: flex;
72
+ justify-content: space-between;
73
+ align-items: flex-start;
74
+ padding: var(--ic-space-md, 0.75rem) var(--ic-space-lg, 1.5rem);
75
+ background: var(--ic-surface, #111827);
76
+ border: 1px solid var(--ic-border, #374151);
77
+ border-radius: var(--ic-radius-md, 0.5rem);
78
+ margin-bottom: var(--ic-space-lg, 1.5rem);
79
+ }
80
+
81
+ .meta-info {
82
+ display: flex;
83
+ flex-direction: column;
84
+ gap: var(--ic-space-xs, 0.25rem);
85
+ }
86
+
87
+ .meta-name {
88
+ font-size: var(--ic-text-xl, 1.25rem);
89
+ font-weight: 700;
90
+ color: var(--ic-text, #f3f4f6);
91
+ margin: 0;
92
+ }
93
+
94
+ .meta-details {
95
+ display: flex;
96
+ gap: var(--ic-space-lg, 1.5rem);
97
+ font-size: var(--ic-text-sm, 0.875rem);
98
+ color: var(--ic-text-dim, #6b7280);
99
+ }
100
+
101
+ .meta-detail {
102
+ display: inline-flex;
103
+ align-items: center;
104
+ gap: 4px;
105
+ }
106
+
107
+ /* Status dot */
108
+ .status-dot {
109
+ display: inline-block;
110
+ width: 8px;
111
+ height: 8px;
112
+ border-radius: 50%;
113
+ background: var(--dot-color, #6b7280);
114
+ margin-right: 4px;
115
+ vertical-align: middle;
116
+ flex-shrink: 0;
117
+ }
118
+
119
+ .status-text {
120
+ display: inline-flex;
121
+ align-items: center;
122
+ }
123
+
124
+ /* Delete button */
125
+ .delete-btn {
126
+ display: inline-flex;
127
+ align-items: center;
128
+ gap: var(--ic-space-xs, 0.25rem);
129
+ padding: var(--ic-space-sm, 0.5rem) var(--ic-space-md, 0.75rem);
130
+ background: transparent;
131
+ border: 1px solid var(--ic-border, #374151);
132
+ border-radius: var(--ic-radius-sm, 0.25rem);
133
+ color: var(--ic-text-dim, #6b7280);
134
+ font-size: var(--ic-text-sm, 0.875rem);
135
+ font-family: inherit;
136
+ cursor: pointer;
137
+ transition: color var(--ic-transition, 150ms ease),
138
+ border-color var(--ic-transition, 150ms ease);
139
+ }
140
+
141
+ .delete-btn:hover {
142
+ color: var(--ic-error, #f87171);
143
+ border-color: var(--ic-error, #f87171);
144
+ }
145
+
146
+ /* Node accordion */
147
+ .node-accordion {
148
+ display: flex;
149
+ flex-direction: column;
150
+ gap: var(--ic-space-sm, 0.5rem);
151
+ }
152
+
153
+ .node-section {
154
+ border: 1px solid var(--ic-border, #374151);
155
+ border-radius: var(--ic-radius-md, 0.5rem);
156
+ overflow: hidden;
157
+ }
158
+
159
+ .node-section summary {
160
+ padding: var(--ic-space-sm, 0.5rem) var(--ic-space-md, 0.75rem);
161
+ font-weight: 600;
162
+ font-size: var(--ic-text-sm, 0.875rem);
163
+ color: var(--ic-text, #f3f4f6);
164
+ cursor: pointer;
165
+ user-select: none;
166
+ background: var(--ic-surface, #111827);
167
+ border-bottom: 1px solid transparent;
168
+ transition: background var(--ic-transition, 150ms ease);
169
+ }
170
+
171
+ .node-section summary:hover {
172
+ background: var(--ic-surface-2, #1f2937);
173
+ }
174
+
175
+ .node-section[open] summary {
176
+ border-bottom-color: var(--ic-border, #374151);
177
+ }
178
+
179
+ .node-content {
180
+ padding: var(--ic-space-md, 0.75rem) var(--ic-space-lg, 1.5rem);
181
+ border-left: 3px solid var(--ic-accent, #3b82f6);
182
+ margin-left: var(--ic-space-sm, 0.5rem);
183
+ }
184
+
185
+ /* Markdown rendering styles */
186
+ .node-content h3, .node-content h4, .node-content h5, .node-content h6 {
187
+ color: var(--ic-text, #f3f4f6);
188
+ margin-top: var(--ic-space-md, 0.75rem);
189
+ margin-bottom: var(--ic-space-xs, 0.25rem);
190
+ }
191
+
192
+ .node-content p {
193
+ margin: var(--ic-space-xs, 0.25rem) 0;
194
+ line-height: 1.6;
195
+ }
196
+
197
+ .node-content ul, .node-content ol {
198
+ padding-left: var(--ic-space-lg, 1.5rem);
199
+ margin: var(--ic-space-xs, 0.25rem) 0;
200
+ }
201
+
202
+ .node-content li {
203
+ margin: 2px 0;
204
+ }
205
+
206
+ .node-content code.inline-code {
207
+ background: var(--ic-surface-2, #1f2937);
208
+ padding: 1px 4px;
209
+ border-radius: 3px;
210
+ font-size: 0.85em;
211
+ font-family: var(--ic-font-mono, monospace);
212
+ }
213
+
214
+ .node-content table {
215
+ width: 100%;
216
+ border-collapse: collapse;
217
+ margin: var(--ic-space-sm, 0.5rem) 0;
218
+ font-size: var(--ic-text-sm, 0.875rem);
219
+ }
220
+
221
+ .node-content th, .node-content td {
222
+ padding: 4px 8px;
223
+ border: 1px solid var(--ic-border, #374151);
224
+ text-align: left;
225
+ }
226
+
227
+ .node-content th {
228
+ background: var(--ic-surface-2, #1f2937);
229
+ font-weight: 600;
230
+ }
231
+
232
+ .node-content a {
233
+ color: var(--ic-accent, #3b82f6);
234
+ text-decoration: underline;
235
+ }
236
+
237
+ .node-content blockquote {
238
+ border-left: 3px solid var(--ic-border, #374151);
239
+ padding-left: var(--ic-space-md, 0.75rem);
240
+ color: var(--ic-text-dim, #6b7280);
241
+ margin: var(--ic-space-sm, 0.5rem) 0;
242
+ }
243
+
244
+ /* Artifact sub-sections */
245
+ .artifact-section {
246
+ margin-top: var(--ic-space-sm, 0.5rem);
247
+ border: 1px solid var(--ic-border, #374151);
248
+ border-radius: var(--ic-radius-sm, 0.25rem);
249
+ }
250
+
251
+ .artifact-section summary {
252
+ padding: var(--ic-space-xs, 0.25rem) var(--ic-space-sm, 0.5rem);
253
+ font-size: var(--ic-text-xs, 0.75rem);
254
+ font-weight: 500;
255
+ color: var(--ic-text-dim, #6b7280);
256
+ cursor: pointer;
257
+ background: var(--ic-bg, #0d1117);
258
+ }
259
+
260
+ .artifact-section summary:hover {
261
+ color: var(--ic-text-muted, #9ca3af);
262
+ }
263
+
264
+ .artifact-content {
265
+ padding: var(--ic-space-sm, 0.5rem);
266
+ font-size: var(--ic-text-sm, 0.875rem);
267
+ }
268
+
269
+ /* No output placeholder */
270
+ .no-output {
271
+ color: var(--ic-text-dim, #6b7280);
272
+ font-style: italic;
273
+ font-size: var(--ic-text-sm, 0.875rem);
274
+ }
275
+
276
+ /* Not found state */
277
+ .not-found {
278
+ text-align: center;
279
+ padding: var(--ic-space-xl, 2rem);
280
+ color: var(--ic-text-dim, #6b7280);
281
+ }
282
+
283
+ .not-found a {
284
+ color: var(--ic-accent, #3b82f6);
285
+ text-decoration: underline;
286
+ }
287
+ `];c([f({attribute:!1})],i.prototype,"rpcClient",2);c([f({type:String})],i.prototype,"graphId",2);c([l()],i.prototype,"_detail",2);c([l()],i.prototype,"_loading",2);c([l()],i.prototype,"_error",2);c([l()],i.prototype,"_showDeleteConfirm",2);i=c([_("ic-pipeline-history-detail")],i);export{i as IcPipelineHistoryDetail};