comisai 1.0.24 → 1.0.26
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/dist/bootstrap/sections/tool-descriptions.js +130 -10
- package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +1 -1
- package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +9 -2
- package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +8 -0
- package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +2 -0
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +29 -0
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +242 -2
- package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.d.ts +210 -0
- package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.js +566 -0
- package/node_modules/@comis/agent/dist/context-engine/context-engine.js +8 -6
- package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.d.ts +51 -30
- package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.js +109 -36
- package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +5 -1
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +22 -20
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +2 -0
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +111 -15
- package/node_modules/@comis/agent/dist/executor/executor-response-filter.d.ts +20 -17
- package/node_modules/@comis/agent/dist/executor/executor-response-filter.js +132 -52
- package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +16 -3
- package/node_modules/@comis/agent/dist/executor/model-retry.d.ts +14 -0
- package/node_modules/@comis/agent/dist/executor/model-retry.js +72 -1
- package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +3 -0
- package/node_modules/@comis/agent/dist/executor/pi-executor.js +68 -9
- package/node_modules/@comis/agent/dist/executor/post-batch-continuation.d.ts +82 -0
- package/node_modules/@comis/agent/dist/executor/post-batch-continuation.js +200 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +1 -9
- package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +37 -2
- package/node_modules/@comis/agent/dist/executor/tool-deferral.js +45 -3
- package/node_modules/@comis/agent/dist/executor/tool-parallelism.js +0 -1
- package/node_modules/@comis/agent/dist/executor/types.d.ts +11 -2
- package/node_modules/@comis/agent/dist/index.d.ts +3 -1
- package/node_modules/@comis/agent/dist/index.js +2 -0
- package/node_modules/@comis/agent/dist/model/last-known-model.d.ts +36 -0
- package/node_modules/@comis/agent/dist/model/last-known-model.js +49 -0
- package/node_modules/@comis/agent/dist/model/model-registry-adapter.d.ts +16 -4
- package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +65 -21
- package/node_modules/@comis/agent/dist/planner/types.d.ts +0 -2
- package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +10 -0
- package/node_modules/@comis/agent/dist/session/comis-session-manager.js +5 -0
- package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +7 -0
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/dist/client/rpc-client.js +6 -1
- package/node_modules/@comis/cli/dist/commands/doctor.js +5 -3
- package/node_modules/@comis/cli/dist/commands/health.js +5 -2
- package/node_modules/@comis/cli/dist/wizard/json-output.js +7 -3
- package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.js +130 -0
- 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/immutable-keys.d.ts +2 -2
- package/node_modules/@comis/core/dist/config/immutable-keys.js +8 -3
- 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/dist/config/managed-sections.d.ts +43 -4
- package/node_modules/@comis/core/dist/config/managed-sections.js +100 -6
- package/node_modules/@comis/core/dist/config/schema-agent.d.ts +39 -0
- package/node_modules/@comis/core/dist/config/schema-agent.js +14 -0
- package/node_modules/@comis/core/dist/config/schema.d.ts +4 -0
- package/node_modules/@comis/core/dist/config/schema.js +14 -0
- package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +1 -1
- package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +17 -2
- package/node_modules/@comis/core/dist/exports/config.d.ts +2 -2
- package/node_modules/@comis/core/dist/exports/config.js +1 -1
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/daemon.d.ts +22 -0
- package/node_modules/@comis/daemon/dist/daemon.js +45 -0
- package/node_modules/@comis/daemon/dist/rpc/agent-handlers.d.ts +5 -2
- package/node_modules/@comis/daemon/dist/rpc/agent-handlers.js +80 -1
- package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.d.ts +67 -0
- package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.js +139 -0
- package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +3 -0
- package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +29 -5
- package/node_modules/@comis/daemon/dist/rpc/probe-provider-auth.d.ts +30 -0
- package/node_modules/@comis/daemon/dist/rpc/probe-provider-auth.js +59 -0
- package/node_modules/@comis/daemon/dist/rpc/provider-handlers.d.ts +37 -0
- package/node_modules/@comis/daemon/dist/rpc/provider-handlers.js +330 -0
- package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.js +18 -1
- package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.d.ts +4 -0
- package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.js +30 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +3 -1
- package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +28 -2
- package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +1 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +7 -4
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/dist/index.d.ts +1 -0
- package/node_modules/@comis/infra/dist/index.js +2 -0
- package/node_modules/@comis/infra/dist/runtime/is-docker.d.ts +1 -0
- package/node_modules/@comis/infra/dist/runtime/is-docker.js +25 -0
- 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/dist/bridge/tool-metadata-registry.js +1 -3
- package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +24 -1
- package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +53 -7
- package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +218 -24
- package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +4 -1
- package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +16 -1
- package/node_modules/@comis/skills/dist/builtin/platform/index.d.ts +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/index.js +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/providers-manage-tool.d.ts +56 -0
- package/node_modules/@comis/skills/dist/builtin/platform/providers-manage-tool.js +203 -0
- package/node_modules/@comis/skills/dist/index.d.ts +1 -1
- package/node_modules/@comis/skills/dist/index.js +2 -2
- package/node_modules/@comis/skills/dist/policy/tool-policy.js +0 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-DqL6Artv.js} +270 -270
- package/node_modules/@comis/web/dist/assets/agent-editor-CNM_h94Y.js +2173 -0
- package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-Dbh-xD_F.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-C1DmtyzK.js +375 -0
- package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-CtCH22N1.js} +265 -265
- package/node_modules/@comis/web/dist/assets/channel-list-C7xXn-60.js +323 -0
- package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-C51pjFwk.js} +243 -246
- package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-BLArYRB7.js} +477 -477
- package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-fuyMinNI.js} +105 -105
- package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-Bngf2bH0.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-C80hucxX.js} +134 -134
- package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-Cl4VbHZ6.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-ByFUoMm6.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-C4nDHgY2.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-Bh5kq-yY.js} +51 -51
- package/node_modules/@comis/web/dist/assets/index-BBkuC-EU.js +2792 -0
- package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
- package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-DB-phOo7.js} +209 -209
- package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-CRqZ1ZUH.js} +154 -154
- package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-C9vE20Oy.js} +259 -259
- package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-CeqfnxMZ.js} +450 -450
- package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-Daup7Mof.js} +290 -290
- package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-DLYnEU8E.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-BTSt_PO5.js} +399 -399
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DknfzyLt.js +1495 -0
- package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-JnHZdeU_.js} +124 -124
- package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-Dg4knsEb.js} +65 -65
- package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-AEnibjsp.js} +227 -227
- package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-DG7RbIOO.js} +298 -298
- package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-uL1fYKAT.js} +486 -486
- package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-C3DywRLH.js} +389 -389
- package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BtqCNWXV.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-CJXWa2XT.js +231 -0
- package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-ywn7oJvu.js} +486 -494
- package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-DX0KYnWD.js} +329 -329
- package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-B8p5YJEB.js} +74 -74
- package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-CgzNIrw1.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/skills/dist/builtin/platform/agents-list-tool.d.ts +0 -19
- package/node_modules/@comis/skills/dist/builtin/platform/agents-list-tool.js +0 -39
- 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
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${this.label?d`<div class="editor-label">${this.label}</div>`:p}
|
|
3
|
-
${this.items.length>0?d`
|
|
4
|
-
<div class="item-list">
|
|
5
|
-
${this.items.map((e,t)=>d`
|
|
6
|
-
<div class="item-row">
|
|
7
|
-
<span class="item-text">${e}</span>
|
|
8
|
-
<button
|
|
9
|
-
class="remove-btn"
|
|
10
|
-
aria-label="Remove ${e}"
|
|
11
|
-
@click=${()=>this._removeItem(t)}
|
|
12
|
-
>\u2715</button>
|
|
13
|
-
</div>
|
|
14
|
-
`)}
|
|
15
|
-
</div>
|
|
16
|
-
`:p}
|
|
17
|
-
<div class="add-row">
|
|
18
|
-
<input
|
|
19
|
-
class="add-input"
|
|
20
|
-
type="text"
|
|
21
|
-
placeholder=${this.placeholder}
|
|
22
|
-
.value=${this._inputValue}
|
|
23
|
-
@input=${e=>{this._inputValue=e.target.value}}
|
|
24
|
-
@keydown=${this._onKeyDown}
|
|
25
|
-
/>
|
|
26
|
-
<button class="add-btn" @click=${()=>this._addItem()}>Add</button>
|
|
27
|
-
</div>
|
|
28
|
-
`}};i.styles=[m,u,v`
|
|
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";var u=class extends r{constructor(...e){super(...e),this.label=``,this.items=[],this.placeholder=`Add item...`,this._inputValue=``}static{this.styles=[o,i,n`
|
|
29
2
|
:host {
|
|
30
3
|
display: block;
|
|
31
4
|
}
|
|
@@ -115,4 +88,31 @@ import{s as m,f as u,i as v,n as l,r as b,a as h,A as p,b as d,t as f}from"./ind
|
|
|
115
88
|
.add-btn:hover {
|
|
116
89
|
opacity: 0.9;
|
|
117
90
|
}
|
|
118
|
-
`]
|
|
91
|
+
`]}_addItem(){let e=this._inputValue.trim();if(!e)return;let t=[...this.items,e];this._inputValue=``,this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,composed:!0}))}_removeItem(e){let t=this.items.filter((t,n)=>n!==e);this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,composed:!0}))}_onKeyDown(e){e.key===`Enter`&&(e.preventDefault(),this._addItem())}render(){return t`
|
|
92
|
+
${this.label?t`<div class="editor-label">${this.label}</div>`:l}
|
|
93
|
+
${this.items.length>0?t`
|
|
94
|
+
<div class="item-list">
|
|
95
|
+
${this.items.map((e,n)=>t`
|
|
96
|
+
<div class="item-row">
|
|
97
|
+
<span class="item-text">${e}</span>
|
|
98
|
+
<button
|
|
99
|
+
class="remove-btn"
|
|
100
|
+
aria-label="Remove ${e}"
|
|
101
|
+
@click=${()=>this._removeItem(n)}
|
|
102
|
+
>\u2715</button>
|
|
103
|
+
</div>
|
|
104
|
+
`)}
|
|
105
|
+
</div>
|
|
106
|
+
`:l}
|
|
107
|
+
<div class="add-row">
|
|
108
|
+
<input
|
|
109
|
+
class="add-input"
|
|
110
|
+
type="text"
|
|
111
|
+
placeholder=${this.placeholder}
|
|
112
|
+
.value=${this._inputValue}
|
|
113
|
+
@input=${e=>{this._inputValue=e.target.value}}
|
|
114
|
+
@keydown=${this._onKeyDown}
|
|
115
|
+
/>
|
|
116
|
+
<button class="add-btn" @click=${()=>this._addItem()}>Add</button>
|
|
117
|
+
</div>
|
|
118
|
+
`}};c([s()],u.prototype,`label`,void 0),c([s({type:Array})],u.prototype,`items`,void 0),c([s()],u.prototype,`placeholder`,void 0),c([a()],u.prototype,`_inputValue`,void 0),u=c([e(`ic-array-editor`)],u);
|
package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js}
RENAMED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<nav aria-label="Breadcrumb">
|
|
3
|
-
<ol>
|
|
4
|
-
${r.map((e,a)=>{const s=a===r.length-1;return i`
|
|
5
|
-
<li>
|
|
6
|
-
${a>0?i`<span class="separator" aria-hidden="true">/</span>`:""}
|
|
7
|
-
${s?i`<span class="current" aria-current="page">${e.label}</span>`:e.route?i`<button
|
|
8
|
-
class="link"
|
|
9
|
-
@click=${()=>this._onNavigate(e.route)}
|
|
10
|
-
>${e.label}</button>`:i`<span class="label">${e.label}</span>`}
|
|
11
|
-
</li>
|
|
12
|
-
`})}
|
|
13
|
-
</ol>
|
|
14
|
-
</nav>
|
|
15
|
-
`}};n.styles=[p,v`
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";var s=class extends r{constructor(...e){super(...e),this.items=[]}static{this.styles=[i,n`
|
|
16
2
|
:host {
|
|
17
3
|
display: block;
|
|
18
4
|
font-size: var(--ic-text-sm);
|
|
@@ -72,4 +58,18 @@ import{s as p,i as v,n as d,a as h,b as i,t as u}from"./index-CEcM1R_C.js";var f
|
|
|
72
58
|
overflow: hidden;
|
|
73
59
|
text-overflow: ellipsis;
|
|
74
60
|
}
|
|
75
|
-
`]
|
|
61
|
+
`]}_onNavigate(e){this.dispatchEvent(new CustomEvent(`navigate`,{detail:e}))}render(){let e=this.items;return t`
|
|
62
|
+
<nav aria-label="Breadcrumb">
|
|
63
|
+
<ol>
|
|
64
|
+
${e.map((n,r)=>{let i=r===e.length-1;return t`
|
|
65
|
+
<li>
|
|
66
|
+
${r>0?t`<span class="separator" aria-hidden="true">/</span>`:``}
|
|
67
|
+
${i?t`<span class="current" aria-current="page">${n.label}</span>`:n.route?t`<button
|
|
68
|
+
class="link"
|
|
69
|
+
@click=${()=>this._onNavigate(n.route)}
|
|
70
|
+
>${n.label}</button>`:t`<span class="label">${n.label}</span>`}
|
|
71
|
+
</li>
|
|
72
|
+
`})}
|
|
73
|
+
</ol>
|
|
74
|
+
</nav>
|
|
75
|
+
`}};o([a({type:Array})],s.prototype,`items`,void 0),s=o([e(`ic-breadcrumb`)],s);
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<div class="bar" role="img" aria-label="Token budget breakdown">
|
|
3
|
-
${this.segments.map(e=>{const i=e.tokens/t*100;return n`
|
|
4
|
-
<div
|
|
5
|
-
class="segment"
|
|
6
|
-
style="width: ${i}%; background: ${e.color};"
|
|
7
|
-
title="${e.label}: ${e.tokens.toLocaleString()} tokens (${i.toFixed(1)}%)"
|
|
8
|
-
></div>
|
|
9
|
-
`})}
|
|
10
|
-
</div>
|
|
11
|
-
<div class="legend">
|
|
12
|
-
${this.segments.map(e=>n`
|
|
13
|
-
<span class="legend-item">
|
|
14
|
-
<span class="legend-dot" style="background: ${e.color};"></span>
|
|
15
|
-
${e.label}
|
|
16
|
-
</span>
|
|
17
|
-
`)}
|
|
18
|
-
</div>
|
|
19
|
-
`}};a.styles=[c,m`
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";var s=class extends r{constructor(...e){super(...e),this.segments=[],this.total=0}static{this.styles=[i,n`
|
|
20
2
|
:host {
|
|
21
3
|
display: block;
|
|
22
4
|
}
|
|
@@ -61,4 +43,22 @@ import{s as c,i as m,n as p,a as g,b as n,t as h}from"./index-CEcM1R_C.js";var u
|
|
|
61
43
|
color: var(--ic-text-dim);
|
|
62
44
|
font-style: italic;
|
|
63
45
|
}
|
|
64
|
-
`]
|
|
46
|
+
`]}_getTotal(){return this.total>0?this.total:this.segments.reduce((e,t)=>e+t.tokens,0)}render(){let e=this._getTotal();return e===0||this.segments.length===0?t`<div class="empty">No budget data</div>`:t`
|
|
47
|
+
<div class="bar" role="img" aria-label="Token budget breakdown">
|
|
48
|
+
${this.segments.map(n=>{let r=n.tokens/e*100;return t`
|
|
49
|
+
<div
|
|
50
|
+
class="segment"
|
|
51
|
+
style="width: ${r}%; background: ${n.color};"
|
|
52
|
+
title="${n.label}: ${n.tokens.toLocaleString()} tokens (${r.toFixed(1)}%)"
|
|
53
|
+
></div>
|
|
54
|
+
`})}
|
|
55
|
+
</div>
|
|
56
|
+
<div class="legend">
|
|
57
|
+
${this.segments.map(e=>t`
|
|
58
|
+
<span class="legend-item">
|
|
59
|
+
<span class="legend-dot" style="background: ${e.color};"></span>
|
|
60
|
+
${e.label}
|
|
61
|
+
</span>
|
|
62
|
+
`)}
|
|
63
|
+
</div>
|
|
64
|
+
`}};o([a({attribute:!1})],s.prototype,`segments`,void 0),o([a({type:Number})],s.prototype,`total`,void 0),s=o([e(`ic-budget-segment-bar`)],s);
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import{c as e,d as t,f as n,h as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./decorate-BvWYovGE.js";import{a as d}from"./index-BBkuC-EU.js";import"./ic-icon-BGNCCPpZ.js";import{n as f,r as p,t as m}from"./directive-BOYXJ-K-.js";var h=class extends f{constructor(e){if(super(e),this.it=u,e.type!==p.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===u||e==null)return this._t=void 0,this.it=e;if(e===t)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};h.directiveName=`unsafeHTML`,h.resultType=1;var g=m(h),_=new Set(`const.let.var.function.return.if.else.for.while.import.export.from.true.false.null.undefined.class.new.this.async.await.throw.try.catch.switch.case.break.continue.default.typeof.instanceof.void.delete.in.of.yield.static.extends.implements.interface.type.enum.abstract.readonly`.split(`.`));function v(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function y(e,t){if(!t)return v(e);let n=t.toLowerCase(),r=v(e);return r=r.replace(/\/\*[\s\S]*?\*\//g,e=>`<span class="hl-comment">${e}</span>`),r=r.replace(/\/\/[^\n]*/g,e=>e.includes(`hl-comment`)?e:`<span class="hl-comment">${e}</span>`),(n===`yaml`||n===`yml`||n===`bash`||n===`sh`||n===`python`||n===`py`)&&(r=r.replace(/(?:^|(?<=\n))(\s*#[^\n]*)/g,e=>`<span class="hl-comment">${e}</span>`)),r=r.replace(/(?<!<span class=")("(?:[^&]|&(?!quot;))*?")/g,e=>e.includes(`hl-`)?e:`<span class="hl-string">${e}</span>`),r=r.replace(/(?<![=\w])('[^'\\]*(?:\\.[^'\\]*)*')/g,e=>e.includes(`hl-`)?e:`<span class="hl-string">${e}</span>`),r=r.replace(/\b(\d+(?:\.\d+)?)\b/g,e=>e.includes(`hl-`)?e:`<span class="hl-number">${e}</span>`),(n===`json`||n===`yaml`||n===`yml`)&&(r=r.replace(/(?:^|(?<=\n))(\s*)("[\w.-]+")(\s*:)/gm,(e,t,n,r)=>`${t}<span class="hl-property">${n}</span>${r}`),(n===`yaml`||n===`yml`)&&(r=r.replace(/(?:^|(?<=\n))(\s*)([\w.-]+)(\s*:)/gm,(e,t,n,r)=>n.includes(`hl-`)?e:`${t}<span class="hl-property">${n}</span>${r}`))),(n===`javascript`||n===`js`||n===`typescript`||n===`ts`||n===`jsx`||n===`tsx`)&&(r=r.replace(/\b([a-z]+)\b/g,e=>_.has(e)?`<span class="hl-keyword">${e}</span>`:e)),r}var b=class extends i{constructor(...e){super(...e),this.code=``,this.language=``,this.copyable=!0,this._copied=!1,this._copyTimer=null}static{this.styles=[s,a,r`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
background: var(--ic-bg);
|
|
8
|
+
border: 1px solid var(--ic-border);
|
|
9
|
+
border-radius: var(--ic-radius-md);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.header {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
background: var(--ic-surface-2);
|
|
18
|
+
padding: var(--ic-space-xs) var(--ic-space-md);
|
|
19
|
+
border-bottom: 1px solid var(--ic-border);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.language-label {
|
|
23
|
+
font-size: var(--ic-text-xs);
|
|
24
|
+
color: var(--ic-text-dim);
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
letter-spacing: 0.04em;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.copy-btn {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 4px;
|
|
34
|
+
background: none;
|
|
35
|
+
border: none;
|
|
36
|
+
color: var(--ic-text-dim);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
padding: 2px 4px;
|
|
39
|
+
border-radius: var(--ic-radius-sm);
|
|
40
|
+
font-size: var(--ic-text-xs);
|
|
41
|
+
font-family: inherit;
|
|
42
|
+
transition: color var(--ic-transition);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.copy-btn:hover {
|
|
46
|
+
color: var(--ic-text);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.code-area {
|
|
50
|
+
max-height: 24rem;
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
overflow-x: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
pre {
|
|
56
|
+
margin: 0;
|
|
57
|
+
padding: var(--ic-space-md);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
code {
|
|
61
|
+
font-family: var(--ic-font-mono);
|
|
62
|
+
font-size: var(--ic-text-sm);
|
|
63
|
+
line-height: 1.6;
|
|
64
|
+
color: var(--ic-text);
|
|
65
|
+
white-space: pre;
|
|
66
|
+
tab-size: 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Syntax highlighting colors */
|
|
70
|
+
.hl-string { color: #a5d6ff; }
|
|
71
|
+
.hl-number { color: #79c0ff; }
|
|
72
|
+
.hl-keyword { color: #ff7b72; }
|
|
73
|
+
.hl-comment { color: var(--ic-text-dim); font-style: italic; }
|
|
74
|
+
.hl-property { color: #7ee787; }
|
|
75
|
+
`]}disconnectedCallback(){super.disconnectedCallback(),this._copyTimer!==null&&(clearTimeout(this._copyTimer),this._copyTimer=null)}async _handleCopy(){try{await navigator.clipboard.writeText(this.code),this._copied=!0,this._copyTimer!==null&&clearTimeout(this._copyTimer),this._copyTimer=setTimeout(()=>{this._copied=!1,this._copyTimer=null},2e3)}catch{}}_renderHeader(){return!this.language&&!this.copyable?u:n`
|
|
76
|
+
<div class="header">
|
|
77
|
+
<span class="language-label">${this.language||``}</span>
|
|
78
|
+
${this.copyable?n`
|
|
79
|
+
<button
|
|
80
|
+
class="copy-btn"
|
|
81
|
+
@click=${this._handleCopy}
|
|
82
|
+
aria-label="Copy code"
|
|
83
|
+
>
|
|
84
|
+
${this._copied?n`<span>Copied!</span>`:n`<ic-icon name="copy" size="14px"></ic-icon><span>Copy</span>`}
|
|
85
|
+
</button>
|
|
86
|
+
`:u}
|
|
87
|
+
</div>
|
|
88
|
+
`}render(){let e=y(this.code,this.language);return n`
|
|
89
|
+
<div class="container" role="region" aria-label="Code block">
|
|
90
|
+
${this._renderHeader()}
|
|
91
|
+
<div class="code-area">
|
|
92
|
+
<pre><code .innerHTML=${e}></code></pre>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
`}};l([c()],b.prototype,`code`,void 0),l([c()],b.prototype,`language`,void 0),l([c({type:Boolean})],b.prototype,`copyable`,void 0),l([o()],b.prototype,`_copied`,void 0),b=l([e(`ic-code-block`)],b);function x(e){let t=e;return t=t.replace(/<\/?(?:script|iframe|object|embed|form)\b[^>]*>/gi,``),t=t.replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,``),t=t.replace(/javascript\s*:/gi,``),t}function S(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function C(e){if(e.length<2)return e.join(`
|
|
96
|
+
`);let t=e.filter(e=>e.trim()!==``);if(t.length<2||!/^\s*\|[\s-:|]+\|\s*$/.test(t[1]))return e.join(`
|
|
97
|
+
`);let n=e=>e.replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`).map(e=>e.trim()),r=n(t[0]),i=t.slice(2),a=`<table><thead><tr>`;for(let e of r)a+=`<th>${e}</th>`;a+=`</tr></thead><tbody>`;for(let e of i){let t=n(e);a+=`<tr>`;for(let e of t)a+=`<td>${e}</td>`;a+=`</tr>`}return a+=`</tbody></table>`,a}function w(e,t){try{let{url:n,type:r,fileName:i}=JSON.parse(e),a=S(t&&n.startsWith(`/media/`)?`${n}${n.includes(`?`)?`&`:`?`}token=${encodeURIComponent(t)}`:n),o=S(i);switch(r){case`image`:return`<img src="${a}" alt="${o}" style="max-width:100%;border-radius:8px;margin:4px 0" loading="lazy" />`;case`audio`:return`<audio controls src="${a}" style="width:100%;margin:4px 0"></audio>`;case`video`:return`<video controls src="${a}" style="max-width:100%;border-radius:8px;margin:4px 0"></video>`;default:return`<a href="${a}" download="${o}" target="_blank" rel="noopener" class="md-link">${o}</a>`}}catch{return``}}function T(e,t=``){let n=x(e),r=[];n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,n)=>{let i=S(n.replace(/\n$/,``)),a=`\x00CODE_BLOCK_${r.length}\x00`;return r.push(`<ic-code-block language="${S(t)}" code="${i}"></ic-code-block>`),a}),n=n.replace(/`([^`]+)`/g,(e,t)=>`<code class="inline-code">${S(t)}</code>`);let i=n.split(`
|
|
98
|
+
`),a=[],o=0;for(;o<i.length;){let e=i[o];if(e.includes(`\0CODE_BLOCK_`)){let t=e.match(/\x00CODE_BLOCK_(\d+)\x00/);if(t){a.push(r[parseInt(t[1],10)]),o++;continue}}if(/^\s*\|/.test(e)){let t=[e];for(o++;o<i.length&&/^\s*\|/.test(i[o]);)t.push(i[o]),o++;a.push(C(t));continue}let t=e.match(/^(#{1,4})\s+(.+)$/);if(t){let e=Math.min(t[1].length+2,6);a.push(`<h${e}>${E(t[2])}</h${e}>`),o++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;o<i.length&&/^\s*[-*]\s+/.test(i[o]);)e.push(E(i[o].replace(/^\s*[-*]\s+/,``))),o++;a.push(`<ul>${e.map(e=>`<li>${e}</li>`).join(``)}</ul>`);continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;o<i.length&&/^\s*\d+\.\s+/.test(i[o]);)e.push(E(i[o].replace(/^\s*\d+\.\s+/,``))),o++;a.push(`<ol>${e.map(e=>`<li>${e}</li>`).join(``)}</ol>`);continue}if(e.trim()===``){a.push(`<br><br>`),o++;continue}a.push(E(e)),o++}let s=a.join(`
|
|
99
|
+
`);return s=s.replace(/<!-- attachment:(.*?) -->/g,(e,n)=>w(n,t)),s}function E(e){let t=e;return t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>`<a href="${S(n)}" target="_blank" rel="noopener noreferrer" class="md-link">${t}</a>`),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/__(.+?)__/g,`<strong>$1</strong>`),t=t.replace(/(?<!\w)\*([^*]+)\*(?!\w)/g,`<em>$1</em>`),t=t.replace(/(?<!\w)_([^_]+)_(?!\w)/g,`<em>$1</em>`),t}var D=class extends i{constructor(...e){super(...e),this.role=`user`,this.content=``,this.timestamp=0,this.messageId=``,this.showActions=!0,this.mediaToken=``}static{this.styles=[s,r`
|
|
100
|
+
:host {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.wrapper {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
max-width: min(80%, 640px);
|
|
108
|
+
width: fit-content;
|
|
109
|
+
position: relative;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Role-specific alignment */
|
|
113
|
+
.wrapper--user {
|
|
114
|
+
align-self: flex-end;
|
|
115
|
+
margin-left: auto;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wrapper--assistant {
|
|
119
|
+
align-self: flex-start;
|
|
120
|
+
margin-right: auto;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.wrapper--error {
|
|
124
|
+
align-self: flex-start;
|
|
125
|
+
margin-right: auto;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.wrapper--system {
|
|
129
|
+
align-self: center;
|
|
130
|
+
max-width: 100%;
|
|
131
|
+
text-align: center;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Bubble styles */
|
|
135
|
+
.bubble {
|
|
136
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
137
|
+
border-radius: var(--ic-radius-xl);
|
|
138
|
+
font-size: var(--ic-text-sm);
|
|
139
|
+
line-height: 1.6;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.bubble--user {
|
|
143
|
+
background: var(--ic-accent);
|
|
144
|
+
color: white;
|
|
145
|
+
border-radius: var(--ic-radius-lg);
|
|
146
|
+
border-bottom-right-radius: 4px;
|
|
147
|
+
white-space: pre-wrap;
|
|
148
|
+
word-break: break-word;
|
|
149
|
+
padding: 6px 12px;
|
|
150
|
+
line-height: 1.4;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.bubble--assistant {
|
|
154
|
+
background: var(--ic-surface);
|
|
155
|
+
color: var(--ic-text);
|
|
156
|
+
border-bottom-left-radius: 4px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.bubble--error {
|
|
160
|
+
background: color-mix(in srgb, var(--ic-error) 15%, transparent);
|
|
161
|
+
border: 1px solid var(--ic-error);
|
|
162
|
+
color: var(--ic-text);
|
|
163
|
+
border-bottom-left-radius: 4px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.bubble--system {
|
|
167
|
+
color: var(--ic-text-dim);
|
|
168
|
+
font-size: var(--ic-text-xs);
|
|
169
|
+
font-style: italic;
|
|
170
|
+
padding: var(--ic-space-xs);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Timestamp */
|
|
174
|
+
.timestamp {
|
|
175
|
+
font-size: var(--ic-text-xs);
|
|
176
|
+
color: var(--ic-text-dim);
|
|
177
|
+
margin-top: 2px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.wrapper--user .timestamp {
|
|
181
|
+
text-align: right;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Markdown inline styles */
|
|
185
|
+
.bubble--assistant code.inline-code,
|
|
186
|
+
.bubble--error code.inline-code {
|
|
187
|
+
background: var(--ic-surface-2);
|
|
188
|
+
padding: 0.125em 0.375em;
|
|
189
|
+
border-radius: var(--ic-radius-sm);
|
|
190
|
+
font-family: var(--ic-font-mono);
|
|
191
|
+
font-size: 0.9em;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.bubble--assistant strong,
|
|
195
|
+
.bubble--error strong {
|
|
196
|
+
font-weight: 600;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.bubble--assistant a.md-link,
|
|
200
|
+
.bubble--error a.md-link {
|
|
201
|
+
color: var(--ic-accent);
|
|
202
|
+
text-decoration: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.bubble--assistant a.md-link:hover,
|
|
206
|
+
.bubble--error a.md-link:hover {
|
|
207
|
+
text-decoration: underline;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.bubble--assistant h3,
|
|
211
|
+
.bubble--assistant h4,
|
|
212
|
+
.bubble--assistant h5,
|
|
213
|
+
.bubble--assistant h6,
|
|
214
|
+
.bubble--error h3,
|
|
215
|
+
.bubble--error h4,
|
|
216
|
+
.bubble--error h5,
|
|
217
|
+
.bubble--error h6 {
|
|
218
|
+
margin: var(--ic-space-sm) 0;
|
|
219
|
+
font-weight: 600;
|
|
220
|
+
line-height: 1.3;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.bubble--assistant h3,
|
|
224
|
+
.bubble--error h3 { font-size: 1.1em; }
|
|
225
|
+
.bubble--assistant h4,
|
|
226
|
+
.bubble--error h4 { font-size: 1.05em; }
|
|
227
|
+
|
|
228
|
+
.bubble--assistant ul,
|
|
229
|
+
.bubble--error ul {
|
|
230
|
+
list-style: disc;
|
|
231
|
+
padding-left: 1.5em;
|
|
232
|
+
margin: var(--ic-space-xs) 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.bubble--assistant ol,
|
|
236
|
+
.bubble--error ol {
|
|
237
|
+
list-style: decimal;
|
|
238
|
+
padding-left: 1.5em;
|
|
239
|
+
margin: var(--ic-space-xs) 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.bubble--assistant table,
|
|
243
|
+
.bubble--error table {
|
|
244
|
+
border-collapse: collapse;
|
|
245
|
+
border: 1px solid var(--ic-border);
|
|
246
|
+
margin: var(--ic-space-xs) 0;
|
|
247
|
+
width: 100%;
|
|
248
|
+
font-size: var(--ic-text-xs);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.bubble--assistant th,
|
|
252
|
+
.bubble--assistant td,
|
|
253
|
+
.bubble--error th,
|
|
254
|
+
.bubble--error td {
|
|
255
|
+
padding: var(--ic-space-xs) var(--ic-space-sm);
|
|
256
|
+
border: 1px solid var(--ic-border);
|
|
257
|
+
text-align: left;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.bubble--assistant th,
|
|
261
|
+
.bubble--error th {
|
|
262
|
+
background: var(--ic-surface-2);
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Inline attachment media */
|
|
267
|
+
.bubble--assistant img {
|
|
268
|
+
max-width: 100%;
|
|
269
|
+
border-radius: var(--ic-radius-lg);
|
|
270
|
+
margin: var(--ic-space-xs) 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.bubble--assistant audio,
|
|
274
|
+
.bubble--assistant video {
|
|
275
|
+
max-width: 100%;
|
|
276
|
+
margin: var(--ic-space-xs) 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* Code blocks inside messages */
|
|
280
|
+
.bubble--assistant ic-code-block,
|
|
281
|
+
.bubble--error ic-code-block {
|
|
282
|
+
margin: var(--ic-space-xs) 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Message action buttons */
|
|
286
|
+
.message-actions {
|
|
287
|
+
position: absolute;
|
|
288
|
+
top: -0.5rem;
|
|
289
|
+
display: flex;
|
|
290
|
+
gap: 2px;
|
|
291
|
+
background: var(--ic-surface-2);
|
|
292
|
+
border: 1px solid var(--ic-border);
|
|
293
|
+
border-radius: var(--ic-radius-sm);
|
|
294
|
+
padding: 2px;
|
|
295
|
+
box-shadow: var(--ic-shadow-sm);
|
|
296
|
+
opacity: 0;
|
|
297
|
+
transition: opacity var(--ic-transition);
|
|
298
|
+
pointer-events: none;
|
|
299
|
+
z-index: 1;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.wrapper--user .message-actions {
|
|
303
|
+
right: 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.wrapper--assistant .message-actions,
|
|
307
|
+
.wrapper--error .message-actions {
|
|
308
|
+
left: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.wrapper:hover .message-actions {
|
|
312
|
+
opacity: 1;
|
|
313
|
+
pointer-events: auto;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.action-btn {
|
|
317
|
+
background: transparent;
|
|
318
|
+
border: none;
|
|
319
|
+
color: var(--ic-text-dim);
|
|
320
|
+
cursor: pointer;
|
|
321
|
+
padding: 4px;
|
|
322
|
+
border-radius: var(--ic-radius-sm);
|
|
323
|
+
display: inline-flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
transition: color var(--ic-transition);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.action-btn:hover {
|
|
330
|
+
color: var(--ic-text);
|
|
331
|
+
}
|
|
332
|
+
`]}_handleCopy(){navigator.clipboard.writeText(this.content).then(()=>{d.show(`Copied to clipboard`,`success`)}).catch(()=>{})}_handleRetry(){this.dispatchEvent(new CustomEvent(`retry`,{detail:{messageId:this.messageId},bubbles:!0,composed:!0}))}_handleDelete(){this.dispatchEvent(new CustomEvent(`delete`,{detail:{messageId:this.messageId},bubbles:!0,composed:!0}))}_formatTime(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}_renderContent(){return this.role===`user`?this.content:g(T(this.content,this.mediaToken))}_renderActions(){return!this.showActions||this.role===`system`?u:n`
|
|
333
|
+
<div class="message-actions">
|
|
334
|
+
<button class="action-btn" aria-label="Copy message" @click=${this._handleCopy}>
|
|
335
|
+
<ic-icon name="copy" size="14px"></ic-icon>
|
|
336
|
+
</button>
|
|
337
|
+
${this.role===`assistant`?n`
|
|
338
|
+
<button class="action-btn" aria-label="Retry message" @click=${this._handleRetry}>
|
|
339
|
+
<ic-icon name="retry" size="14px"></ic-icon>
|
|
340
|
+
</button>
|
|
341
|
+
`:u}
|
|
342
|
+
<button class="action-btn" aria-label="Delete message" @click=${this._handleDelete}>
|
|
343
|
+
<ic-icon name="trash" size="14px"></ic-icon>
|
|
344
|
+
</button>
|
|
345
|
+
</div>
|
|
346
|
+
`}render(){let e=`wrapper wrapper--${this.role}`,t=`bubble bubble--${this.role}`;return n`
|
|
347
|
+
<div class=${e} role="article" aria-label="${this.role} message">
|
|
348
|
+
${this._renderActions()}
|
|
349
|
+
<div class=${t}>${this._renderContent()}</div>
|
|
350
|
+
${this.timestamp>0?n`<span class="timestamp">${this._formatTime(this.timestamp)}</span>`:u}
|
|
351
|
+
</div>
|
|
352
|
+
`}};l([c()],D.prototype,`role`,void 0),l([c()],D.prototype,`content`,void 0),l([c({type:Number})],D.prototype,`timestamp`,void 0),l([c()],D.prototype,`messageId`,void 0),l([c({type:Boolean})],D.prototype,`showActions`,void 0),l([c()],D.prototype,`mediaToken`,void 0),D=l([e(`ic-chat-message`)],D);export{g as n,T as t};
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<div
|
|
3
|
-
class="backdrop"
|
|
4
|
-
@click=${this._onBackdropClick}
|
|
5
|
-
@keydown=${this._onKeyDown}
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
class="dialog"
|
|
9
|
-
role="dialog"
|
|
10
|
-
aria-modal="true"
|
|
11
|
-
aria-labelledby="dialog-title"
|
|
12
|
-
>
|
|
13
|
-
<h2 class="title" id="dialog-title">${this.title}</h2>
|
|
14
|
-
<p class="message">${this.message}</p>
|
|
15
|
-
<div class="buttons">
|
|
16
|
-
<button class="cancel-btn" @click=${this._fireCancel}>
|
|
17
|
-
${this.cancelLabel}
|
|
18
|
-
</button>
|
|
19
|
-
<button class=${t} @click=${this._fireConfirm}>
|
|
20
|
-
${this.confirmLabel}
|
|
21
|
-
</button>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
`}};r.styles=[d,f,p`
|
|
1
|
+
import{c as e,f as t,h as n,l as r,n as i,r as a,s as o,t as s,u as c}from"./decorate-BvWYovGE.js";var l=class extends r{constructor(...e){super(...e),this.open=!1,this.title=`Confirm`,this.message=``,this.confirmLabel=`Confirm`,this.cancelLabel=`Cancel`,this.variant=`default`}static{this.styles=[a,i,n`
|
|
26
2
|
:host {
|
|
27
3
|
display: contents;
|
|
28
4
|
}
|
|
@@ -107,4 +83,28 @@ import{s as d,f,i as p,n,a as v,A as b,b as h,t as u}from"./index-CEcM1R_C.js";v
|
|
|
107
83
|
background: #dc2626;
|
|
108
84
|
border-color: #dc2626;
|
|
109
85
|
}
|
|
110
|
-
`]
|
|
86
|
+
`]}updated(e){e.has(`open`)&&this.open&&this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`.cancel-btn`))?.focus()})}_onBackdropClick(e){e.target.classList.contains(`backdrop`)&&this._fireCancel()}_onKeyDown(e){if(e.key===`Escape`&&(e.preventDefault(),this._fireCancel()),e.key===`Tab`){let t=this.shadowRoot?.querySelectorAll(`button:not([disabled])`);if(!t||t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===this?this.shadowRoot?.activeElement===n&&(e.preventDefault(),r.focus()):e.shiftKey||this.shadowRoot?.activeElement===r&&(e.preventDefault(),n.focus())}}_fireConfirm(){this.dispatchEvent(new CustomEvent(`confirm`))}_fireCancel(){this.dispatchEvent(new CustomEvent(`cancel`))}render(){if(!this.open)return c;let e=this.variant===`danger`?`confirm-btn confirm-btn--danger`:`confirm-btn`;return t`
|
|
87
|
+
<div
|
|
88
|
+
class="backdrop"
|
|
89
|
+
@click=${this._onBackdropClick}
|
|
90
|
+
@keydown=${this._onKeyDown}
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
class="dialog"
|
|
94
|
+
role="dialog"
|
|
95
|
+
aria-modal="true"
|
|
96
|
+
aria-labelledby="dialog-title"
|
|
97
|
+
>
|
|
98
|
+
<h2 class="title" id="dialog-title">${this.title}</h2>
|
|
99
|
+
<p class="message">${this.message}</p>
|
|
100
|
+
<div class="buttons">
|
|
101
|
+
<button class="cancel-btn" @click=${this._fireCancel}>
|
|
102
|
+
${this.cancelLabel}
|
|
103
|
+
</button>
|
|
104
|
+
<button class=${e} @click=${this._fireConfirm}>
|
|
105
|
+
${this.confirmLabel}
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
`}};s([o({type:Boolean,reflect:!0})],l.prototype,`open`,void 0),s([o()],l.prototype,`title`,void 0),s([o()],l.prototype,`message`,void 0),s([o()],l.prototype,`confirmLabel`,void 0),s([o()],l.prototype,`cancelLabel`,void 0),s([o()],l.prototype,`variant`,void 0),l=s([e(`ic-confirm-dialog`)],l);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<span
|
|
3
|
-
class="dot ${e.pulse?"dot--pulse":""}"
|
|
4
|
-
style="width: ${this.size}; height: ${this.size}; background-color: ${e.color};"
|
|
5
|
-
role="status"
|
|
6
|
-
aria-label="Connection status: ${e.label}"
|
|
7
|
-
></span>
|
|
8
|
-
<span class="status-icon" aria-hidden="true">
|
|
9
|
-
<ic-icon name=${e.icon} size="12px" color=${e.color}></ic-icon>
|
|
10
|
-
</span>
|
|
11
|
-
${this.showLabel?c`<span class="label">${e.label}</span>`:c``}
|
|
12
|
-
`}};t.styles=[u,d`
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";import{t as s}from"./index-BBkuC-EU.js";import"./ic-icon-BGNCCPpZ.js";var c=class extends r{constructor(...e){super(...e),this.status=`disconnected`,this.size=`8px`,this.showLabel=!0}static{this.styles=[i,n`
|
|
13
2
|
:host {
|
|
14
3
|
display: inline-flex;
|
|
15
4
|
align-items: center;
|
|
@@ -51,4 +40,15 @@ import{s as u,i as d,n as p,a as h,g as f,b as c,t as b}from"./index-CEcM1R_C.js
|
|
|
51
40
|
color: var(--ic-text-dim);
|
|
52
41
|
font-size: var(--ic-text-xs);
|
|
53
42
|
}
|
|
54
|
-
`]
|
|
43
|
+
`]}render(){let e=s(this.status);return t`
|
|
44
|
+
<span
|
|
45
|
+
class="dot ${e.pulse?`dot--pulse`:``}"
|
|
46
|
+
style="width: ${this.size}; height: ${this.size}; background-color: ${e.color};"
|
|
47
|
+
role="status"
|
|
48
|
+
aria-label="Connection status: ${e.label}"
|
|
49
|
+
></span>
|
|
50
|
+
<span class="status-icon" aria-hidden="true">
|
|
51
|
+
<ic-icon name=${e.icon} size="12px" color=${e.color}></ic-icon>
|
|
52
|
+
</span>
|
|
53
|
+
${this.showLabel?t`<span class="label">${e.label}</span>`:t``}
|
|
54
|
+
`}};o([a()],c.prototype,`status`,void 0),o([a()],c.prototype,`size`,void 0),o([a({type:Boolean})],c.prototype,`showLabel`,void 0),c=o([e(`ic-connection-dot`)],c);
|