comisai 1.0.15 → 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.
- package/node_modules/@comis/agent/dist/bootstrap/types.d.ts +1 -1
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +12 -11
- package/node_modules/@comis/agent/dist/context-engine/constants.d.ts +11 -0
- package/node_modules/@comis/agent/dist/context-engine/constants.js +11 -0
- package/node_modules/@comis/agent/dist/context-engine/index.d.ts +1 -1
- package/node_modules/@comis/agent/dist/context-engine/index.js +1 -1
- package/node_modules/@comis/agent/dist/context-engine/llm-compaction.js +32 -18
- package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.d.ts +2 -0
- package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.js +36 -0
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +12 -0
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +117 -27
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +1 -0
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +16 -4
- package/node_modules/@comis/agent/dist/executor/executor-stream-setup.js +17 -1
- package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +27 -1
- package/node_modules/@comis/agent/dist/executor/session-snapshot-cleanup.js +3 -1
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.d.ts +2 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.js +2 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.d.ts +9 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +65 -3
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/stub-filter-injector.d.ts +28 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/stub-filter-injector.js +63 -0
- package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +18 -1
- package/node_modules/@comis/agent/dist/executor/tool-deferral.js +275 -133
- package/node_modules/@comis/agent/dist/executor/ttl-guard.d.ts +6 -0
- package/node_modules/@comis/agent/dist/executor/ttl-guard.js +8 -0
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/dist/shared/typing-controller.d.ts +7 -0
- package/node_modules/@comis/channels/dist/shared/typing-controller.js +33 -0
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/dist/commands/daemon.js +116 -28
- package/node_modules/@comis/cli/dist/wizard/non-interactive.js +1 -0
- package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.js +4 -0
- package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.js +9 -0
- package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +2 -0
- package/node_modules/@comis/cli/dist/wizard/steps/12-finish.js +5 -2
- package/node_modules/@comis/cli/dist/wizard/types.d.ts +1 -0
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/config/schema-agent.d.ts +10 -0
- package/node_modules/@comis/core/dist/config/schema-agent.js +8 -0
- package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +17 -2
- package/node_modules/@comis/core/dist/config/schema-gateway.js +11 -0
- package/node_modules/@comis/core/dist/config/schema-skills.d.ts +16 -2
- package/node_modules/@comis/core/dist/config/schema-skills.js +9 -2
- package/node_modules/@comis/core/dist/config/schema.d.ts +66 -60
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +34 -6
- 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/dist/builtin/platform/gateway-tool.d.ts +1 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/android-chrome-192x192.png +0 -0
- package/node_modules/@comis/web/dist/android-chrome-512x512.png +0 -0
- package/node_modules/@comis/web/dist/apple-touch-icon.png +0 -0
- package/node_modules/@comis/web/dist/assets/agent-detail-BG9MGWWj.js +615 -0
- package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +2173 -0
- package/node_modules/@comis/web/dist/assets/agent-list-LHCJ4rw2.js +504 -0
- package/node_modules/@comis/web/dist/assets/approvals-q9VH_IKr.js +54 -0
- package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +375 -0
- package/node_modules/@comis/web/dist/assets/channel-detail-CaInesJM.js +681 -0
- package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +323 -0
- package/node_modules/@comis/web/dist/assets/chat-console-CNmzl0JW.js +943 -0
- package/node_modules/@comis/web/dist/assets/config-editor-DX4ITw6y.js +1374 -0
- package/node_modules/@comis/web/dist/assets/context-dag-browser-BwiaF5tf.js +393 -0
- package/node_modules/@comis/web/dist/assets/context-engine-BZ5Am6hA.js +393 -0
- package/node_modules/@comis/web/dist/assets/delivery-view-OfBZof-m.js +392 -0
- package/node_modules/@comis/web/dist/assets/diagnostics-view-YFwCxgr2.js +231 -0
- package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +1 -0
- package/node_modules/@comis/web/dist/assets/extract-variables-BM5qyK-s.js +149 -0
- package/node_modules/@comis/web/dist/assets/ic-array-editor-B7m6x7-S.js +118 -0
- package/node_modules/@comis/web/dist/assets/ic-breadcrumb-CUMpp3BL.js +75 -0
- package/node_modules/@comis/web/dist/assets/ic-budget-segment-bar-BtJ6x5mN.js +64 -0
- package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +352 -0
- package/node_modules/@comis/web/dist/assets/ic-confirm-dialog-CCDbB04e.js +110 -0
- package/node_modules/@comis/web/dist/assets/ic-connection-dot-CnT1b8xr.js +54 -0
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +277 -0
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +67 -0
- package/node_modules/@comis/web/dist/assets/ic-detail-panel-BF83r-if.js +116 -0
- package/node_modules/@comis/web/dist/assets/ic-empty-state-60l2ePhd.js +52 -0
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +359 -0
- package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +33 -0
- package/node_modules/@comis/web/dist/assets/ic-layer-waterfall-COvEYMg5.js +69 -0
- package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +12 -0
- package/node_modules/@comis/web/dist/assets/ic-search-input-CSOxY9g7.js +92 -0
- package/node_modules/@comis/web/dist/assets/ic-select-Ce-Raudx.js +127 -0
- package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +95 -0
- package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +33 -0
- package/node_modules/@comis/web/dist/assets/ic-time-range-picker-CypCT68y.js +93 -0
- package/node_modules/@comis/web/dist/assets/ic-tool-call-7MaXSsCW.js +146 -0
- package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +2830 -0
- package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +1 -0
- package/node_modules/@comis/web/dist/assets/mcp-management-BNZPnpDn.js +582 -0
- package/node_modules/@comis/web/dist/assets/media-config-BBvTYxOX.js +314 -0
- package/node_modules/@comis/web/dist/assets/media-test-BkK3RCRK.js +496 -0
- package/node_modules/@comis/web/dist/assets/memory-inspector-1hDGCGat.js +1139 -0
- package/node_modules/@comis/web/dist/assets/message-center-CXefwsUu.js +785 -0
- package/node_modules/@comis/web/dist/assets/models-C1qcU_j3.js +894 -0
- package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +1 -0
- package/node_modules/@comis/web/dist/assets/observe-view-C0VBhX4C.js +814 -0
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +1496 -0
- package/node_modules/@comis/web/dist/assets/pipeline-history-DkfOQ6SW.js +317 -0
- package/node_modules/@comis/web/dist/assets/pipeline-history-detail-hyHgD0ai.js +287 -0
- package/node_modules/@comis/web/dist/assets/pipeline-list-BPW8hV-q.js +518 -0
- package/node_modules/@comis/web/dist/assets/pipeline-monitor-Bip16T7e.js +972 -0
- package/node_modules/@comis/web/dist/assets/scheduler-BGgwKd06.js +1182 -0
- package/node_modules/@comis/web/dist/assets/security-D15st4xx.js +1224 -0
- package/node_modules/@comis/web/dist/assets/session-detail-SGEYNJ0M.js +632 -0
- package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +1 -0
- package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +231 -0
- package/node_modules/@comis/web/dist/assets/setup-wizard-nT0tz9QP.js +853 -0
- package/node_modules/@comis/web/dist/assets/skills-D8yVfSUy.js +1051 -0
- package/node_modules/@comis/web/dist/assets/subagents-HHXMeHYo.js +193 -0
- package/node_modules/@comis/web/dist/assets/workspace-manager-BQlr10iH.js +785 -0
- package/node_modules/@comis/web/dist/comis-logo.png +0 -0
- package/node_modules/@comis/web/dist/favicon-16x16.png +0 -0
- package/node_modules/@comis/web/dist/favicon-32x32.png +0 -0
- package/node_modules/@comis/web/dist/favicon.ico +0 -0
- package/node_modules/@comis/web/dist/index.html +17 -0
- package/node_modules/@comis/web/package.json +29 -0
- package/package.json +15 -13
|
@@ -0,0 +1,894 @@
|
|
|
1
|
+
import{s as f,f as b,i as _,n as u,a as g,A as c,b as a,t as y,S as x,I as h,r as l}from"./index-CEcM1R_C.js";import"./ic-tabs-B7QtM_v8.js";import"./ic-empty-state-60l2ePhd.js";import"./ic-tag-CPPUnDLF.js";import"./ic-icon-xeGTVhVG.js";import"./ic-connection-dot-CnT1b8xr.js";import"./ic-search-input-CSOxY9g7.js";var P=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=(e,t,i,s)=>{for(var r=s>1?void 0:s?w(t,i):t,n=e.length-1,p;n>=0;n--)(p=e[n])&&(r=(s?p(t,i,r):p(r))||r);return s&&r&&P(t,i,r),r};let v=class extends g{constructor(){super(...arguments),this.name="",this.type="",this.baseUrl="",this.enabled=!1,this.testResult=null,this.testing=!1}_onTest(){this.dispatchEvent(new CustomEvent("test-connection"))}_onEdit(){this.dispatchEvent(new CustomEvent("edit-provider"))}_onToggle(e){const t=e.target.checked;this.dispatchEvent(new CustomEvent("toggle-provider",{detail:t}))}_renderTestResult(){if(!this.testResult)return c;const e=this.testResult;return a`
|
|
2
|
+
<div class="test-result">
|
|
3
|
+
<div class="test-result-line">
|
|
4
|
+
<ic-icon
|
|
5
|
+
name=${e.status==="ok"?"check":"x"}
|
|
6
|
+
size="12px"
|
|
7
|
+
color=${e.status==="ok"?"var(--ic-success)":"var(--ic-error)"}
|
|
8
|
+
></ic-icon>
|
|
9
|
+
<span>${e.status==="ok"?"Connection OK":`Status: ${e.status}`}</span>
|
|
10
|
+
</div>
|
|
11
|
+
${e.modelsAvailable!=null?a`<div class="test-result-line">Models available: ${e.modelsAvailable}</div>`:c}
|
|
12
|
+
${e.validatedModels!=null?a`<div class="test-result-line">Validated: ${e.validatedModels}</div>`:c}
|
|
13
|
+
</div>
|
|
14
|
+
`}render(){return a`
|
|
15
|
+
<div class="card">
|
|
16
|
+
<div class="header">
|
|
17
|
+
<span class="name">${this.name}</span>
|
|
18
|
+
<ic-tag variant="info">${this.type}</ic-tag>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="url-row">${this.baseUrl||"Default"}</div>
|
|
21
|
+
<div class="status-row">
|
|
22
|
+
<ic-connection-dot
|
|
23
|
+
status=${this.enabled?"connected":"disconnected"}
|
|
24
|
+
size="6px"
|
|
25
|
+
></ic-connection-dot>
|
|
26
|
+
<span>${this.enabled?"Enabled":"Disabled"}</span>
|
|
27
|
+
<input
|
|
28
|
+
type="checkbox"
|
|
29
|
+
.checked=${this.enabled}
|
|
30
|
+
@change=${this._onToggle}
|
|
31
|
+
aria-label="Toggle ${this.name}"
|
|
32
|
+
style="margin-left: auto; accent-color: var(--ic-accent); cursor: pointer;"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
${this._renderTestResult()}
|
|
36
|
+
<div class="actions">
|
|
37
|
+
<button
|
|
38
|
+
class="btn btn-test"
|
|
39
|
+
@click=${this._onTest}
|
|
40
|
+
?disabled=${this.testing}
|
|
41
|
+
aria-label="Test connection for ${this.name}"
|
|
42
|
+
>
|
|
43
|
+
${this.testing?a`<span class="spinner-inline"></span>`:"Test"}
|
|
44
|
+
</button>
|
|
45
|
+
<button
|
|
46
|
+
class="btn btn-edit"
|
|
47
|
+
@click=${this._onEdit}
|
|
48
|
+
aria-label="Edit ${this.name}"
|
|
49
|
+
>
|
|
50
|
+
Edit
|
|
51
|
+
</button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
`}};v.styles=[f,b,_`
|
|
55
|
+
:host {
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card {
|
|
60
|
+
background: var(--ic-surface);
|
|
61
|
+
border: 1px solid var(--ic-border);
|
|
62
|
+
border-radius: var(--ic-radius-md);
|
|
63
|
+
padding: var(--ic-space-md);
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: var(--ic-space-sm);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.header {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
gap: var(--ic-space-sm);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.name {
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
font-size: var(--ic-text-sm);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.url-row {
|
|
82
|
+
font-family: var(--ic-font-mono, ui-monospace, monospace);
|
|
83
|
+
font-size: var(--ic-text-xs);
|
|
84
|
+
color: var(--ic-text-dim);
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
text-overflow: ellipsis;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.status-row {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: var(--ic-space-xs);
|
|
94
|
+
font-size: var(--ic-text-xs);
|
|
95
|
+
color: var(--ic-text-dim);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.test-result {
|
|
99
|
+
font-size: var(--ic-text-xs);
|
|
100
|
+
color: var(--ic-text-muted);
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
gap: 2px;
|
|
104
|
+
padding: var(--ic-space-xs) 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.test-result-line {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: var(--ic-space-xs);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.actions {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: var(--ic-space-sm);
|
|
117
|
+
margin-top: var(--ic-space-xs);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.btn {
|
|
121
|
+
padding: 0.375rem 0.75rem;
|
|
122
|
+
border-radius: var(--ic-radius-md);
|
|
123
|
+
font-size: var(--ic-text-xs);
|
|
124
|
+
font-family: inherit;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
border: none;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.btn-test {
|
|
131
|
+
background: var(--ic-accent);
|
|
132
|
+
color: white;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.btn-test:hover:not(:disabled) {
|
|
136
|
+
opacity: 0.9;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.btn-test:disabled {
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.btn-edit {
|
|
145
|
+
background: var(--ic-surface-2);
|
|
146
|
+
border: 1px solid var(--ic-border);
|
|
147
|
+
color: var(--ic-text-muted);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.btn-edit:hover {
|
|
151
|
+
background: var(--ic-border);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.spinner-inline {
|
|
155
|
+
display: inline-block;
|
|
156
|
+
width: 12px;
|
|
157
|
+
height: 12px;
|
|
158
|
+
border: 2px solid var(--ic-border);
|
|
159
|
+
border-top-color: white;
|
|
160
|
+
border-radius: 50%;
|
|
161
|
+
animation: spin 0.8s linear infinite;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@keyframes spin {
|
|
165
|
+
to {
|
|
166
|
+
transform: rotate(360deg);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
171
|
+
.spinner-inline {
|
|
172
|
+
animation: none;
|
|
173
|
+
opacity: 0.7;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
`];m([u()],v.prototype,"name",2);m([u()],v.prototype,"type",2);m([u()],v.prototype,"baseUrl",2);m([u({type:Boolean})],v.prototype,"enabled",2);m([u({attribute:!1})],v.prototype,"testResult",2);m([u({type:Boolean})],v.prototype,"testing",2);v=m([y("ic-provider-card")],v);var A=Object.defineProperty,k=Object.getOwnPropertyDescriptor,d=(e,t,i,s)=>{for(var r=s>1?void 0:s?k(t,i):t,n=e.length-1,p;n>=0;n--)(p=e[n])&&(r=(s?p(t,i,r):p(r))||r);return s&&r&&A(t,i,r),r};const C=[{id:"providers",label:"Providers"},{id:"models",label:"Catalog"},{id:"aliases",label:"Aliases"},{id:"defaults",label:"Defaults"}];let o=class extends g{constructor(){super(...arguments),this.apiClient=null,this.rpcClient=null,this.eventDispatcher=null,this._sse=null,this._reloadDebounce=null,this._loadState="loading",this._error="",this._activeTab="providers",this._providers={},this._models=[],this._aliases=[],this._defaultProvider="",this._defaultModel="",this._providerTestResults=new Map,this._testingProviders=new Set,this._editingProvider=null,this._editForm={name:"",type:"",baseUrl:"",apiKeyName:""},this._editingAlias=null,this._aliasForm={alias:"",provider:"",modelId:""},this._modelsSearchQuery="",this._modelsProviderFilter="",this._agents=[],this._rpcStatusUnsub=null}connectedCallback(){super.connectedCallback(),this._initSse()}disconnectedCallback(){super.disconnectedCallback(),this._rpcStatusUnsub?.(),this._rpcStatusUnsub=null,this._reloadDebounce!==null&&(clearTimeout(this._reloadDebounce),this._reloadDebounce=null)}updated(e){e.has("eventDispatcher")&&this.eventDispatcher&&!this._sse&&this._initSse(),e.has("rpcClient")&&this.rpcClient&&(this._rpcStatusUnsub?.(),this._rpcStatusUnsub=null,this.rpcClient.status==="connected"?this._loadData():this._rpcStatusUnsub=this.rpcClient.onStatusChange(t=>{t==="connected"&&(this._rpcStatusUnsub?.(),this._rpcStatusUnsub=null,this._loadData())}))}_scheduleReload(e=300){this._reloadDebounce!==null&&clearTimeout(this._reloadDebounce),this._reloadDebounce=setTimeout(()=>{this._reloadDebounce=null,this._loadData()},e)}_initSse(){!this.eventDispatcher||this._sse||(this._sse=new x(this,this.eventDispatcher,{"model:catalog_loaded":()=>{this._scheduleReload()}}))}async _loadData(){if(this.rpcClient){this._loadState="loading",this._error="";try{const e=await this.rpcClient.call("config.read");this._providers=e.config.providers?.entries??{},this._aliases=e.config.models?.aliases??[],this._defaultProvider=e.config.models?.defaultProvider??"",this._defaultModel=e.config.models?.defaultModel??"",this._loadState="loaded",this.rpcClient.call("models.list").then(t=>{t.models&&t.models.length>0?this._models=t.models:t.providers&&t.providers.length>0&&(this._models=t.providers.flatMap(i=>(i.models??[]).map(s=>{const r=typeof s=="object"&&s!==null,n=r?s.modelId:s;return{provider:i.name,modelId:n,displayName:n,contextWindow:r?s.contextWindow:0,maxTokens:r?s.maxTokens:0,input:!0,reasoning:!1,validated:!1}})))}).catch(()=>{}),(async()=>{try{const i=((await this.rpcClient.call("agents.list")).agents??[]).slice(0,20),s=await Promise.allSettled(i.map(r=>this.rpcClient.call("agents.get",{agentId:r})));this._agents=s.filter(r=>r.status==="fulfilled"&&r.value.agentId!=null).map(r=>({id:r.value.agentId,provider:r.value.config.provider??"",model:r.value.config.model??""}))}catch{this._agents=[]}})()}catch(e){this._error=e instanceof Error?e.message:"Failed to load model configuration",this._loadState="error"}}}async _patchConfig(e,t){if(!this.rpcClient)return!1;try{const i=e.indexOf("."),s=i>0?e.slice(0,i):e,r=i>0?e.slice(i+1):void 0;return await this.rpcClient.call("config.patch",{section:s,key:r,value:t}),h.show("Configuration updated","success"),!0}catch(i){const s=i instanceof Error?i.message:"Failed to update configuration";return h.show(s,"error"),!1}}async _testProvider(e){if(!this.rpcClient)return;const t=new Set(this._testingProviders);t.add(e),this._testingProviders=t;try{const i=await this.rpcClient.call("models.test",{provider:e}),s=new Map(this._providerTestResults);s.set(e,i),this._providerTestResults=s,h.show(`Provider "${e}" test: ${i.status}`,i.status==="ok"?"success":"warning")}catch(i){const s=i instanceof Error?i.message:"Test failed",r=new Map(this._providerTestResults);r.set(e,{status:"error"}),this._providerTestResults=r,h.show(`Provider "${e}" test failed: ${s}`,"error")}finally{const i=new Set(this._testingProviders);i.delete(e),this._testingProviders=i}}async _toggleProvider(e,t){await this._patchConfig(`providers.entries.${e}.enabled`,t)&&(this._providers={...this._providers,[e]:{...this._providers[e],enabled:t}})}_startEditProvider(e){const t=this._providers[e];this._editingProvider=e,this._editForm={name:e,type:t?.type??"",baseUrl:t?.baseUrl??"",apiKeyName:t?.apiKeyName??""}}_startAddProvider(){this._editingProvider="",this._editForm={name:"",type:"",baseUrl:"",apiKeyName:""}}_cancelEditProvider(){this._editingProvider=null}async _saveProvider(){const{name:e,type:t,baseUrl:i,apiKeyName:s}=this._editForm;if(!e.trim()||!t.trim())return;const r={type:t.trim(),name:e.trim(),baseUrl:i.trim(),apiKeyName:s.trim(),enabled:this._providers[e]?.enabled??!0,timeoutMs:this._providers[e]?.timeoutMs??12e4,maxRetries:this._providers[e]?.maxRetries??2};await this._patchConfig(`providers.entries.${e.trim()}`,r)&&(this._providers={...this._providers,[e.trim()]:r},this._editingProvider=null)}async _deleteProvider(){if(!this._editingProvider)return;const e=this._editingProvider,t={...this._providers};delete t[e],await this._patchConfig("providers.entries",t)&&(this._providers=t,this._editingProvider=null)}_renderProviderEditor(){if(this._editingProvider===null)return c;const e=this._editingProvider==="";return a`
|
|
177
|
+
<div class="editor-form">
|
|
178
|
+
<div class="editor-title">${e?"Add Provider":`Edit: ${this._editingProvider}`}</div>
|
|
179
|
+
<div class="form-field">
|
|
180
|
+
<label class="form-label">Provider Name</label>
|
|
181
|
+
<input
|
|
182
|
+
class="form-input"
|
|
183
|
+
type="text"
|
|
184
|
+
.value=${this._editForm.name}
|
|
185
|
+
?disabled=${!e}
|
|
186
|
+
@input=${t=>{this._editForm={...this._editForm,name:t.target.value}}}
|
|
187
|
+
placeholder="e.g., anthropic"
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="form-field">
|
|
191
|
+
<label class="form-label">Type</label>
|
|
192
|
+
<input
|
|
193
|
+
class="form-input"
|
|
194
|
+
type="text"
|
|
195
|
+
.value=${this._editForm.type}
|
|
196
|
+
@input=${t=>{this._editForm={...this._editForm,type:t.target.value}}}
|
|
197
|
+
placeholder="anthropic, openai, ollama, etc."
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
<div class="form-field">
|
|
201
|
+
<label class="form-label">Base URL (optional)</label>
|
|
202
|
+
<input
|
|
203
|
+
class="form-input"
|
|
204
|
+
type="text"
|
|
205
|
+
.value=${this._editForm.baseUrl}
|
|
206
|
+
@input=${t=>{this._editForm={...this._editForm,baseUrl:t.target.value}}}
|
|
207
|
+
placeholder="Leave empty for default"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="form-field">
|
|
211
|
+
<label class="form-label">API Key Name (SecretManager ref)</label>
|
|
212
|
+
<input
|
|
213
|
+
class="form-input"
|
|
214
|
+
type="text"
|
|
215
|
+
.value=${this._editForm.apiKeyName}
|
|
216
|
+
@input=${t=>{this._editForm={...this._editForm,apiKeyName:t.target.value}}}
|
|
217
|
+
placeholder="e.g., ANTHROPIC_API_KEY"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
<div class="form-actions">
|
|
221
|
+
<button class="btn btn-primary" @click=${()=>this._saveProvider()}>Save</button>
|
|
222
|
+
${e?c:a`<button class="btn btn-danger" @click=${()=>this._deleteProvider()}>Delete</button>`}
|
|
223
|
+
<button class="btn btn-secondary" @click=${()=>this._cancelEditProvider()}>Cancel</button>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
`}_renderProvidersTab(){const e=Object.entries(this._providers);return e.length===0&&this._editingProvider===null?a`
|
|
227
|
+
<ic-empty-state
|
|
228
|
+
icon="models"
|
|
229
|
+
message="No providers configured"
|
|
230
|
+
description="Add a provider to connect to LLM services."
|
|
231
|
+
></ic-empty-state>
|
|
232
|
+
<button class="btn-add" @click=${()=>this._startAddProvider()}>Add Provider</button>
|
|
233
|
+
`:a`
|
|
234
|
+
<div class="provider-grid">
|
|
235
|
+
${e.map(([t,i])=>a`
|
|
236
|
+
<ic-provider-card
|
|
237
|
+
.name=${t}
|
|
238
|
+
.type=${i.type}
|
|
239
|
+
.baseUrl=${i.baseUrl}
|
|
240
|
+
.enabled=${i.enabled}
|
|
241
|
+
.testResult=${this._providerTestResults.get(t)??null}
|
|
242
|
+
.testing=${this._testingProviders.has(t)}
|
|
243
|
+
@test-connection=${()=>this._testProvider(t)}
|
|
244
|
+
@edit-provider=${()=>this._startEditProvider(t)}
|
|
245
|
+
@toggle-provider=${s=>this._toggleProvider(t,s.detail)}
|
|
246
|
+
></ic-provider-card>
|
|
247
|
+
`)}
|
|
248
|
+
</div>
|
|
249
|
+
${this._renderProviderEditor()}
|
|
250
|
+
${this._editingProvider===null?a`<button class="btn-add" @click=${()=>this._startAddProvider()}>Add Provider</button>`:c}
|
|
251
|
+
`}_renderProviderFilterSelect(){const e=this._getProviderNames();return a`
|
|
252
|
+
<select
|
|
253
|
+
class="filter-select"
|
|
254
|
+
.value=${this._modelsProviderFilter}
|
|
255
|
+
@change=${t=>{this._modelsProviderFilter=t.target.value}}
|
|
256
|
+
>
|
|
257
|
+
<option value="">All providers</option>
|
|
258
|
+
${e.map(t=>a`<option value=${t} ?selected=${t===this._modelsProviderFilter}>${t}</option>`)}
|
|
259
|
+
</select>
|
|
260
|
+
`}_renderModelsTab(){if(this._models.length===0)return a`
|
|
261
|
+
<ic-empty-state
|
|
262
|
+
icon="models"
|
|
263
|
+
message="No models discovered"
|
|
264
|
+
description="Configure providers and run a scan to discover available models."
|
|
265
|
+
></ic-empty-state>
|
|
266
|
+
`;let e=[...this._models];if(this._modelsProviderFilter&&(e=e.filter(i=>i.provider===this._modelsProviderFilter)),this._modelsSearchQuery){const i=this._modelsSearchQuery.toLowerCase();e=e.filter(s=>s.modelId.toLowerCase().includes(i)||s.displayName.toLowerCase().includes(i)||s.provider.toLowerCase().includes(i))}const t=e.sort((i,s)=>{const r=i.provider.localeCompare(s.provider);return r!==0?r:i.modelId.localeCompare(s.modelId)});return a`
|
|
267
|
+
<div class="filter-bar">
|
|
268
|
+
<ic-search-input
|
|
269
|
+
placeholder="Search models..."
|
|
270
|
+
.value=${this._modelsSearchQuery}
|
|
271
|
+
@search=${i=>{this._modelsSearchQuery=i.detail}}
|
|
272
|
+
></ic-search-input>
|
|
273
|
+
${this._renderProviderFilterSelect()}
|
|
274
|
+
<span class="filter-count">${e.length} of ${this._models.length} models</span>
|
|
275
|
+
</div>
|
|
276
|
+
${t.length===0?a`<ic-empty-state icon="models" message="No models match your filter" description="Try adjusting your search or provider filter."></ic-empty-state>`:a`
|
|
277
|
+
<table class="models-table">
|
|
278
|
+
<thead>
|
|
279
|
+
<tr>
|
|
280
|
+
<th>Model ID</th>
|
|
281
|
+
<th>Provider</th>
|
|
282
|
+
<th>Context Window</th>
|
|
283
|
+
<th>Max Tokens</th>
|
|
284
|
+
<th></th>
|
|
285
|
+
</tr>
|
|
286
|
+
</thead>
|
|
287
|
+
<tbody>
|
|
288
|
+
${t.map(i=>a`
|
|
289
|
+
<tr>
|
|
290
|
+
<td class="mono">${i.modelId}</td>
|
|
291
|
+
<td><ic-tag variant="info">${i.provider}</ic-tag></td>
|
|
292
|
+
<td>${i.contextWindow.toLocaleString()}</td>
|
|
293
|
+
<td>${i.maxTokens.toLocaleString()}</td>
|
|
294
|
+
<td>
|
|
295
|
+
${i.validated?a`<ic-icon name="check" size="16px" class="validated-icon" label="Validated"></ic-icon>`:c}
|
|
296
|
+
</td>
|
|
297
|
+
</tr>
|
|
298
|
+
`)}
|
|
299
|
+
</tbody>
|
|
300
|
+
</table>
|
|
301
|
+
`}
|
|
302
|
+
`}_startEditAlias(e){const t=this._aliases[e];this._editingAlias=e,this._aliasForm={alias:t.alias,provider:t.provider,modelId:t.modelId}}_startAddAlias(){this._editingAlias=-1,this._aliasForm={alias:"",provider:"",modelId:""}}_cancelEditAlias(){this._editingAlias=null,this._aliasForm={alias:"",provider:"",modelId:""}}async _saveAlias(){const{alias:e,provider:t,modelId:i}=this._aliasForm;if(!e.trim()||!t.trim()||!i.trim())return;const s={alias:e.trim(),provider:t.trim(),modelId:i.trim()};let r;if(this._editingAlias===-1)r=[...this._aliases,s];else if(this._editingAlias!==null)r=this._aliases.map((p,$)=>$===this._editingAlias?s:p);else return;await this._patchConfig("models.aliases",r)&&(this._aliases=r,this._editingAlias=null,this._aliasForm={alias:"",provider:"",modelId:""})}async _deleteAlias(e){const t=this._aliases.filter((s,r)=>r!==e);await this._patchConfig("models.aliases",t)&&(this._aliases=t,h.show("Alias removed","success"))}_renderAliasForm(){return this._editingAlias===null?c:a`
|
|
303
|
+
<div class="alias-form">
|
|
304
|
+
<div class="form-field">
|
|
305
|
+
<label class="form-label">Alias</label>
|
|
306
|
+
<input
|
|
307
|
+
class="form-input"
|
|
308
|
+
type="text"
|
|
309
|
+
.value=${this._aliasForm.alias}
|
|
310
|
+
@input=${e=>{this._aliasForm={...this._aliasForm,alias:e.target.value}}}
|
|
311
|
+
placeholder="e.g., claude"
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
<div class="form-field">
|
|
315
|
+
<label class="form-label">Provider</label>
|
|
316
|
+
<input
|
|
317
|
+
class="form-input"
|
|
318
|
+
type="text"
|
|
319
|
+
.value=${this._aliasForm.provider}
|
|
320
|
+
@input=${e=>{this._aliasForm={...this._aliasForm,provider:e.target.value}}}
|
|
321
|
+
placeholder="e.g., anthropic"
|
|
322
|
+
/>
|
|
323
|
+
</div>
|
|
324
|
+
<div class="form-field">
|
|
325
|
+
<label class="form-label">Model ID</label>
|
|
326
|
+
<input
|
|
327
|
+
class="form-input"
|
|
328
|
+
type="text"
|
|
329
|
+
.value=${this._aliasForm.modelId}
|
|
330
|
+
@input=${e=>{this._aliasForm={...this._aliasForm,modelId:e.target.value}}}
|
|
331
|
+
placeholder="e.g., claude-sonnet-4-5-20250929"
|
|
332
|
+
/>
|
|
333
|
+
</div>
|
|
334
|
+
<div class="form-actions">
|
|
335
|
+
<button class="btn btn-primary" @click=${()=>this._saveAlias()}>
|
|
336
|
+
${this._editingAlias===-1?"Add Alias":"Save"}
|
|
337
|
+
</button>
|
|
338
|
+
<button class="btn btn-secondary" @click=${()=>this._cancelEditAlias()}>Cancel</button>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
`}_renderAliasesTab(){return this._aliases.length===0&&this._editingAlias===null?a`
|
|
342
|
+
<ic-empty-state
|
|
343
|
+
icon="models"
|
|
344
|
+
message="No aliases configured"
|
|
345
|
+
description="Create aliases to reference models by short names."
|
|
346
|
+
></ic-empty-state>
|
|
347
|
+
<button class="btn-add" @click=${()=>this._startAddAlias()}>Add Alias</button>
|
|
348
|
+
`:a`
|
|
349
|
+
${this._aliases.length>0?a`
|
|
350
|
+
<table class="alias-table">
|
|
351
|
+
<thead>
|
|
352
|
+
<tr>
|
|
353
|
+
<th>Alias</th>
|
|
354
|
+
<th>Provider</th>
|
|
355
|
+
<th>Model ID</th>
|
|
356
|
+
<th>Actions</th>
|
|
357
|
+
</tr>
|
|
358
|
+
</thead>
|
|
359
|
+
<tbody>
|
|
360
|
+
${this._aliases.map((e,t)=>a`
|
|
361
|
+
<tr>
|
|
362
|
+
<td class="mono">${e.alias}</td>
|
|
363
|
+
<td><ic-tag variant="info">${e.provider}</ic-tag></td>
|
|
364
|
+
<td class="mono">${e.modelId}</td>
|
|
365
|
+
<td>
|
|
366
|
+
<div class="alias-actions">
|
|
367
|
+
<button
|
|
368
|
+
class="btn btn-secondary"
|
|
369
|
+
@click=${()=>this._startEditAlias(t)}
|
|
370
|
+
aria-label="Edit alias ${e.alias}"
|
|
371
|
+
>Edit</button>
|
|
372
|
+
<button
|
|
373
|
+
class="btn btn-danger"
|
|
374
|
+
@click=${()=>this._deleteAlias(t)}
|
|
375
|
+
aria-label="Delete alias ${e.alias}"
|
|
376
|
+
>Delete</button>
|
|
377
|
+
</div>
|
|
378
|
+
</td>
|
|
379
|
+
</tr>
|
|
380
|
+
`)}
|
|
381
|
+
</tbody>
|
|
382
|
+
</table>
|
|
383
|
+
`:c}
|
|
384
|
+
${this._renderAliasForm()}
|
|
385
|
+
${this._editingAlias===null?a`<button class="btn-add" @click=${()=>this._startAddAlias()}>Add Alias</button>`:c}
|
|
386
|
+
`}async _patchModelDefaults(e,t){const i=await this._patchConfig("models",{defaultProvider:e,defaultModel:t,aliases:this._aliases});return i&&(this._defaultProvider=e,this._defaultModel=t),i}async _updateDefaultProvider(e){const t=e!==this._defaultProvider?"":this._defaultModel;await this._patchModelDefaults(e,t)}async _updateDefaultModel(e){let t=this._defaultProvider;if(e){const i=this._models.find(s=>s.modelId===e);i&&i.provider!==t&&(t=i.provider)}await this._patchModelDefaults(t,e)}_getProviderNames(){const e=Object.keys(this._providers),t=[...new Set(this._models.map(i=>i.provider))];return[...new Set([...e,...t])].sort()}_renderDefaultProviderOptions(){const e=this._getProviderNames();return a`
|
|
387
|
+
<option value="">-- Select provider --</option>
|
|
388
|
+
${e.map(t=>a`<option value=${t} ?selected=${t===this._defaultProvider}>${t}</option>`)}
|
|
389
|
+
`}_renderDefaultModelOptions(){const t=[...this._defaultProvider?this._models.filter(i=>i.provider===this._defaultProvider):this._models].sort((i,s)=>i.modelId.localeCompare(s.modelId));return this._defaultProvider?a`
|
|
390
|
+
<option value="">-- Select model --</option>
|
|
391
|
+
${t.map(i=>a`<option value=${i.modelId} ?selected=${i.modelId===this._defaultModel}>${i.modelId}</option>`)}
|
|
392
|
+
`:a`
|
|
393
|
+
<option value="">-- Select model --</option>
|
|
394
|
+
${t.map(i=>a`<option value=${i.modelId} ?selected=${i.modelId===this._defaultModel}>${i.provider}/${i.modelId}</option>`)}
|
|
395
|
+
`}async _updateAgentOverride(e,t,i){if(this.rpcClient)try{await this.rpcClient.call("agents.update",{agentId:e,config:{provider:t||void 0,model:i||void 0}}),this._agents=this._agents.map(s=>s.id===e?{...s,provider:t,model:i}:s),h.show("Agent model override updated","success")}catch(s){const r=s instanceof Error?s.message:"Failed to update agent override";h.show(r,"error")}}_renderAgentOverrideProviderOptions(e){const t=this._getProviderNames();return a`
|
|
396
|
+
<option value="">-- Inherit default --</option>
|
|
397
|
+
${t.map(i=>a`<option value=${i} ?selected=${i===e.provider}>${i}</option>`)}
|
|
398
|
+
`}_renderAgentOverrideModelOptions(e){const i=[...e.provider?this._models.filter(r=>r.provider===e.provider):this._models].sort((r,n)=>r.modelId.localeCompare(n.modelId)),s=!e.model;return e.provider?a`
|
|
399
|
+
<option value="" ?selected=${s}>-- Select model --</option>
|
|
400
|
+
${i.map(r=>a`<option value=${r.modelId} ?selected=${r.modelId===e.model}>${r.modelId}</option>`)}
|
|
401
|
+
`:a`
|
|
402
|
+
<option value="" ?selected=${s}>-- Inherit default --</option>
|
|
403
|
+
${i.map(r=>a`<option value=${r.modelId} ?selected=${r.modelId===e.model}>${r.provider}/${r.modelId}</option>`)}
|
|
404
|
+
`}_renderPerAgentOverrides(){return this._agents.length===0?a`
|
|
405
|
+
<ic-empty-state
|
|
406
|
+
icon="models"
|
|
407
|
+
message="No agents configured"
|
|
408
|
+
description="Configure agents to set per-agent model overrides."
|
|
409
|
+
></ic-empty-state>
|
|
410
|
+
`:a`
|
|
411
|
+
<table class="overrides-table">
|
|
412
|
+
<thead>
|
|
413
|
+
<tr>
|
|
414
|
+
<th>Agent</th>
|
|
415
|
+
<th>Provider</th>
|
|
416
|
+
<th>Model</th>
|
|
417
|
+
</tr>
|
|
418
|
+
</thead>
|
|
419
|
+
<tbody>
|
|
420
|
+
${this._agents.map(e=>a`
|
|
421
|
+
<tr>
|
|
422
|
+
<td class="mono">${e.id}</td>
|
|
423
|
+
<td>
|
|
424
|
+
<select
|
|
425
|
+
class="override-select"
|
|
426
|
+
.value=${e.provider}
|
|
427
|
+
@change=${t=>{const i=t.target.value;this._updateAgentOverride(e.id,i,"")}}
|
|
428
|
+
>
|
|
429
|
+
${this._renderAgentOverrideProviderOptions(e)}
|
|
430
|
+
</select>
|
|
431
|
+
</td>
|
|
432
|
+
<td>
|
|
433
|
+
<select
|
|
434
|
+
class="override-select"
|
|
435
|
+
.value=${e.model}
|
|
436
|
+
@change=${t=>{const i=t.target.value;this._updateAgentOverride(e.id,e.provider,i)}}
|
|
437
|
+
>
|
|
438
|
+
${this._renderAgentOverrideModelOptions(e)}
|
|
439
|
+
</select>
|
|
440
|
+
</td>
|
|
441
|
+
</tr>
|
|
442
|
+
`)}
|
|
443
|
+
</tbody>
|
|
444
|
+
</table>
|
|
445
|
+
`}_renderDefaultsTab(){return a`
|
|
446
|
+
<div class="defaults-section">
|
|
447
|
+
<div class="form-field">
|
|
448
|
+
<label class="form-label">Default Provider</label>
|
|
449
|
+
<select
|
|
450
|
+
class="defaults-select"
|
|
451
|
+
.value=${this._defaultProvider}
|
|
452
|
+
@change=${e=>{this._updateDefaultProvider(e.target.value)}}
|
|
453
|
+
>
|
|
454
|
+
${this._renderDefaultProviderOptions()}
|
|
455
|
+
</select>
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
<div class="form-field">
|
|
459
|
+
<label class="form-label">Default Model</label>
|
|
460
|
+
<select
|
|
461
|
+
class="defaults-select"
|
|
462
|
+
.value=${this._defaultModel}
|
|
463
|
+
@change=${e=>{this._updateDefaultModel(e.target.value)}}
|
|
464
|
+
>
|
|
465
|
+
${this._renderDefaultModelOptions()}
|
|
466
|
+
</select>
|
|
467
|
+
</div>
|
|
468
|
+
|
|
469
|
+
<div class="defaults-summary">
|
|
470
|
+
Current default:
|
|
471
|
+
<ic-tag variant="accent">${this._defaultProvider||"none"}</ic-tag>
|
|
472
|
+
/
|
|
473
|
+
<ic-tag variant="info">${this._defaultModel||"none"}</ic-tag>
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
<div class="defaults-resolved">
|
|
477
|
+
${this._defaultProvider&&this._defaultModel?a`<span>Resolved: <code class="mono">${this._defaultProvider}/${this._defaultModel}</code></span>`:a`<span style="color: var(--ic-warning)">Select both a provider and model to set defaults</span>`}
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
<hr class="overrides-divider" />
|
|
481
|
+
<div class="overrides-heading">Per-Agent Overrides</div>
|
|
482
|
+
${this._renderPerAgentOverrides()}
|
|
483
|
+
</div>
|
|
484
|
+
`}_renderTabContent(){switch(this._activeTab){case"providers":return this._renderProvidersTab();case"models":return this._renderModelsTab();case"aliases":return this._renderAliasesTab();case"defaults":return this._renderDefaultsTab();default:return c}}render(){return this._loadState==="loading"?a`<ic-skeleton-view variant="list"></ic-skeleton-view>`:this._loadState==="error"?a`
|
|
485
|
+
<div class="error-container">
|
|
486
|
+
<span class="error-message">${this._error}</span>
|
|
487
|
+
<button class="retry-btn" @click=${()=>this._loadData()}>Retry</button>
|
|
488
|
+
</div>
|
|
489
|
+
`:a`
|
|
490
|
+
<div class="view-header">
|
|
491
|
+
<div class="view-title">Models & Providers</div>
|
|
492
|
+
</div>
|
|
493
|
+
<ic-tabs
|
|
494
|
+
.tabs=${C}
|
|
495
|
+
.activeTab=${this._activeTab}
|
|
496
|
+
@tab-change=${e=>{this._activeTab=e.detail}}
|
|
497
|
+
></ic-tabs>
|
|
498
|
+
<div style="margin-top: var(--ic-space-md);">
|
|
499
|
+
${this._renderTabContent()}
|
|
500
|
+
</div>
|
|
501
|
+
`}};o.styles=[f,b,_`
|
|
502
|
+
:host {
|
|
503
|
+
display: block;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.view-header {
|
|
507
|
+
margin-bottom: var(--ic-space-lg);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.view-title {
|
|
511
|
+
font-size: 1.125rem;
|
|
512
|
+
font-weight: 600;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* Loading & error states */
|
|
516
|
+
.state-container {
|
|
517
|
+
display: flex;
|
|
518
|
+
align-items: center;
|
|
519
|
+
justify-content: center;
|
|
520
|
+
padding: 3rem;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.error-container {
|
|
524
|
+
display: flex;
|
|
525
|
+
flex-direction: column;
|
|
526
|
+
align-items: center;
|
|
527
|
+
gap: 0.75rem;
|
|
528
|
+
padding: 3rem;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.error-message {
|
|
532
|
+
color: var(--ic-error);
|
|
533
|
+
font-size: var(--ic-text-sm);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.retry-btn {
|
|
537
|
+
padding: 0.5rem 1rem;
|
|
538
|
+
background: var(--ic-surface-2);
|
|
539
|
+
border: 1px solid var(--ic-border);
|
|
540
|
+
border-radius: var(--ic-radius-md);
|
|
541
|
+
color: var(--ic-text-muted);
|
|
542
|
+
font-size: var(--ic-text-sm);
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
font-family: inherit;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.retry-btn:hover {
|
|
548
|
+
background: var(--ic-border);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/* Provider grid */
|
|
552
|
+
.provider-grid {
|
|
553
|
+
display: grid;
|
|
554
|
+
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
|
555
|
+
gap: var(--ic-space-md);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/* Provider editor form */
|
|
559
|
+
.editor-form {
|
|
560
|
+
background: var(--ic-surface);
|
|
561
|
+
border: 1px solid var(--ic-border);
|
|
562
|
+
border-radius: var(--ic-radius-md);
|
|
563
|
+
padding: var(--ic-space-md);
|
|
564
|
+
display: flex;
|
|
565
|
+
flex-direction: column;
|
|
566
|
+
gap: var(--ic-space-sm);
|
|
567
|
+
max-width: 32rem;
|
|
568
|
+
margin-top: var(--ic-space-lg);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.editor-title {
|
|
572
|
+
font-size: var(--ic-text-sm);
|
|
573
|
+
font-weight: 600;
|
|
574
|
+
color: var(--ic-text-muted);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.form-field {
|
|
578
|
+
display: flex;
|
|
579
|
+
flex-direction: column;
|
|
580
|
+
gap: var(--ic-space-xs);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.form-label {
|
|
584
|
+
font-size: var(--ic-text-sm);
|
|
585
|
+
font-weight: 500;
|
|
586
|
+
color: var(--ic-text-muted);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.form-input {
|
|
590
|
+
padding: 0.5rem 0.75rem;
|
|
591
|
+
background: var(--ic-surface-2);
|
|
592
|
+
border: 1px solid var(--ic-border);
|
|
593
|
+
border-radius: var(--ic-radius-md);
|
|
594
|
+
color: var(--ic-text);
|
|
595
|
+
font-family: inherit;
|
|
596
|
+
font-size: var(--ic-text-sm);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.form-input:focus {
|
|
600
|
+
outline: none;
|
|
601
|
+
border-color: var(--ic-accent);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.form-input:disabled {
|
|
605
|
+
opacity: 0.6;
|
|
606
|
+
cursor: not-allowed;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.form-actions {
|
|
610
|
+
display: flex;
|
|
611
|
+
gap: var(--ic-space-sm);
|
|
612
|
+
margin-top: var(--ic-space-xs);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.btn {
|
|
616
|
+
padding: 0.375rem 0.75rem;
|
|
617
|
+
border-radius: var(--ic-radius-md);
|
|
618
|
+
font-size: var(--ic-text-xs);
|
|
619
|
+
font-family: inherit;
|
|
620
|
+
cursor: pointer;
|
|
621
|
+
border: none;
|
|
622
|
+
white-space: nowrap;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.btn-primary {
|
|
626
|
+
background: var(--ic-accent);
|
|
627
|
+
color: white;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.btn-primary:hover {
|
|
631
|
+
opacity: 0.9;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.btn-secondary {
|
|
635
|
+
background: var(--ic-surface-2);
|
|
636
|
+
border: 1px solid var(--ic-border);
|
|
637
|
+
color: var(--ic-text-muted);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.btn-secondary:hover {
|
|
641
|
+
background: var(--ic-border);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.btn-danger {
|
|
645
|
+
background: var(--ic-error);
|
|
646
|
+
color: white;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.btn-danger:hover {
|
|
650
|
+
opacity: 0.9;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.btn-add {
|
|
654
|
+
padding: 0.5rem 1rem;
|
|
655
|
+
background: var(--ic-accent);
|
|
656
|
+
color: white;
|
|
657
|
+
border: none;
|
|
658
|
+
border-radius: var(--ic-radius-md);
|
|
659
|
+
font-size: var(--ic-text-sm);
|
|
660
|
+
cursor: pointer;
|
|
661
|
+
margin-top: var(--ic-space-md);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.btn-add:hover {
|
|
665
|
+
opacity: 0.9;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* Models table */
|
|
669
|
+
.models-table {
|
|
670
|
+
width: 100%;
|
|
671
|
+
border-collapse: collapse;
|
|
672
|
+
font-size: var(--ic-text-sm);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.models-table th {
|
|
676
|
+
text-align: left;
|
|
677
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
678
|
+
color: var(--ic-text-muted);
|
|
679
|
+
font-weight: 600;
|
|
680
|
+
font-size: var(--ic-text-xs);
|
|
681
|
+
text-transform: uppercase;
|
|
682
|
+
letter-spacing: 0.05em;
|
|
683
|
+
border-bottom: 1px solid var(--ic-border);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.models-table td {
|
|
687
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
688
|
+
border-bottom: 1px solid var(--ic-border);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.models-table tr:nth-child(even) {
|
|
692
|
+
background: var(--ic-surface);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.models-table tr:nth-child(odd) {
|
|
696
|
+
background: var(--ic-surface-2);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.validated-icon {
|
|
700
|
+
color: var(--ic-success);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/* Aliases table */
|
|
704
|
+
.alias-table {
|
|
705
|
+
width: 100%;
|
|
706
|
+
border-collapse: collapse;
|
|
707
|
+
font-size: var(--ic-text-sm);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.alias-table th {
|
|
711
|
+
text-align: left;
|
|
712
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
713
|
+
color: var(--ic-text-muted);
|
|
714
|
+
font-weight: 600;
|
|
715
|
+
font-size: var(--ic-text-xs);
|
|
716
|
+
text-transform: uppercase;
|
|
717
|
+
letter-spacing: 0.05em;
|
|
718
|
+
border-bottom: 1px solid var(--ic-border);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.alias-table td {
|
|
722
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
723
|
+
border-bottom: 1px solid var(--ic-border);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.alias-table tr:nth-child(even) {
|
|
727
|
+
background: var(--ic-surface);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.alias-table tr:nth-child(odd) {
|
|
731
|
+
background: var(--ic-surface-2);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.alias-actions {
|
|
735
|
+
display: flex;
|
|
736
|
+
gap: var(--ic-space-xs);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.alias-form {
|
|
740
|
+
display: flex;
|
|
741
|
+
gap: var(--ic-space-sm);
|
|
742
|
+
align-items: flex-end;
|
|
743
|
+
flex-wrap: wrap;
|
|
744
|
+
margin-top: var(--ic-space-md);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.alias-form .form-field {
|
|
748
|
+
flex: 1;
|
|
749
|
+
min-width: 8rem;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/* Defaults section */
|
|
753
|
+
.defaults-section {
|
|
754
|
+
max-width: 48rem;
|
|
755
|
+
display: flex;
|
|
756
|
+
flex-direction: column;
|
|
757
|
+
gap: var(--ic-space-lg);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.defaults-select {
|
|
761
|
+
padding: 0.5rem 0.75rem;
|
|
762
|
+
background: var(--ic-surface-2);
|
|
763
|
+
border: 1px solid var(--ic-border);
|
|
764
|
+
border-radius: var(--ic-radius-md);
|
|
765
|
+
color: var(--ic-text);
|
|
766
|
+
font-family: inherit;
|
|
767
|
+
font-size: var(--ic-text-sm);
|
|
768
|
+
max-width: 20rem;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.defaults-select:focus {
|
|
772
|
+
outline: none;
|
|
773
|
+
border-color: var(--ic-accent);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.defaults-summary {
|
|
777
|
+
display: flex;
|
|
778
|
+
align-items: center;
|
|
779
|
+
gap: var(--ic-space-sm);
|
|
780
|
+
font-size: var(--ic-text-sm);
|
|
781
|
+
color: var(--ic-text-muted);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.mono {
|
|
785
|
+
font-family: var(--ic-font-mono, ui-monospace, monospace);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/* Filter bar for Available Models tab */
|
|
789
|
+
.filter-bar {
|
|
790
|
+
display: flex;
|
|
791
|
+
align-items: center;
|
|
792
|
+
gap: var(--ic-space-md);
|
|
793
|
+
margin-bottom: var(--ic-space-md);
|
|
794
|
+
flex-wrap: wrap;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.filter-bar ic-search-input {
|
|
798
|
+
flex: 1;
|
|
799
|
+
min-width: 12rem;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.filter-select {
|
|
803
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
804
|
+
background: var(--ic-surface-2);
|
|
805
|
+
border: 1px solid var(--ic-border);
|
|
806
|
+
border-radius: var(--ic-radius-md);
|
|
807
|
+
color: var(--ic-text);
|
|
808
|
+
font-family: inherit;
|
|
809
|
+
font-size: var(--ic-text-sm);
|
|
810
|
+
min-width: 8rem;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.filter-select:focus {
|
|
814
|
+
outline: none;
|
|
815
|
+
border-color: var(--ic-accent);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.filter-count {
|
|
819
|
+
font-size: var(--ic-text-xs);
|
|
820
|
+
color: var(--ic-text-muted);
|
|
821
|
+
white-space: nowrap;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/* Defaults resolved indicator */
|
|
825
|
+
.defaults-resolved {
|
|
826
|
+
font-size: var(--ic-text-sm);
|
|
827
|
+
color: var(--ic-text-muted);
|
|
828
|
+
padding: var(--ic-space-sm) 0;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.defaults-resolved code {
|
|
832
|
+
color: var(--ic-accent);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/* Per-agent overrides */
|
|
836
|
+
.overrides-divider {
|
|
837
|
+
border: none;
|
|
838
|
+
border-top: 1px solid var(--ic-border);
|
|
839
|
+
margin: var(--ic-space-lg) 0;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.overrides-heading {
|
|
843
|
+
font-size: var(--ic-text-sm);
|
|
844
|
+
font-weight: 600;
|
|
845
|
+
color: var(--ic-text-muted);
|
|
846
|
+
margin-bottom: var(--ic-space-md);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.overrides-table {
|
|
850
|
+
width: 100%;
|
|
851
|
+
border-collapse: collapse;
|
|
852
|
+
font-size: var(--ic-text-sm);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.overrides-table th {
|
|
856
|
+
text-align: left;
|
|
857
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
858
|
+
color: var(--ic-text-muted);
|
|
859
|
+
font-weight: 600;
|
|
860
|
+
font-size: var(--ic-text-xs);
|
|
861
|
+
text-transform: uppercase;
|
|
862
|
+
letter-spacing: 0.05em;
|
|
863
|
+
border-bottom: 1px solid var(--ic-border);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.overrides-table td {
|
|
867
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
868
|
+
border-bottom: 1px solid var(--ic-border);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.overrides-table tr:nth-child(even) {
|
|
872
|
+
background: var(--ic-surface);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.overrides-table tr:nth-child(odd) {
|
|
876
|
+
background: var(--ic-surface-2);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
.override-select {
|
|
880
|
+
padding: 0.375rem 0.5rem;
|
|
881
|
+
background: var(--ic-surface-2);
|
|
882
|
+
border: 1px solid var(--ic-border);
|
|
883
|
+
border-radius: var(--ic-radius-md);
|
|
884
|
+
color: var(--ic-text);
|
|
885
|
+
font-family: inherit;
|
|
886
|
+
font-size: var(--ic-text-xs);
|
|
887
|
+
max-width: 14rem;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.override-select:focus {
|
|
891
|
+
outline: none;
|
|
892
|
+
border-color: var(--ic-accent);
|
|
893
|
+
}
|
|
894
|
+
`];d([u({attribute:!1})],o.prototype,"apiClient",2);d([u({attribute:!1})],o.prototype,"rpcClient",2);d([u({attribute:!1})],o.prototype,"eventDispatcher",2);d([l()],o.prototype,"_loadState",2);d([l()],o.prototype,"_error",2);d([l()],o.prototype,"_activeTab",2);d([l()],o.prototype,"_providers",2);d([l()],o.prototype,"_models",2);d([l()],o.prototype,"_aliases",2);d([l()],o.prototype,"_defaultProvider",2);d([l()],o.prototype,"_defaultModel",2);d([l()],o.prototype,"_providerTestResults",2);d([l()],o.prototype,"_testingProviders",2);d([l()],o.prototype,"_editingProvider",2);d([l()],o.prototype,"_editForm",2);d([l()],o.prototype,"_editingAlias",2);d([l()],o.prototype,"_aliasForm",2);d([l()],o.prototype,"_modelsSearchQuery",2);d([l()],o.prototype,"_modelsProviderFilter",2);d([l()],o.prototype,"_agents",2);o=d([y("ic-models-view")],o);export{o as IcModelsView};
|