codexmate 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +2 -2
  2. package/README.vi.md +2 -2
  3. package/README.zh.md +2 -2
  4. package/cli/desktop-release.js +73 -0
  5. package/cli/update.js +27 -15
  6. package/cli.js +9 -3
  7. package/lib/model-test.js +126 -21
  8. package/package.json +4 -1
  9. package/plugins/prompt-templates/overview.mjs +1 -7
  10. package/web-ui/app.js +5 -0
  11. package/web-ui/modules/app.methods.install.mjs +38 -2
  12. package/web-ui/modules/app.methods.provider-cache.mjs +3 -0
  13. package/web-ui/modules/i18n/locales/en.mjs +1945 -2011
  14. package/web-ui/modules/i18n/locales/expand.mjs +18 -0
  15. package/web-ui/modules/i18n/locales/ja.mjs +1946 -2012
  16. package/web-ui/modules/i18n/locales/keys.mjs +1945 -0
  17. package/web-ui/modules/i18n/locales/vi.mjs +1945 -1980
  18. package/web-ui/modules/i18n/locales/zh-tw.mjs +1945 -2009
  19. package/web-ui/modules/i18n/locales/zh.mjs +1944 -2009
  20. package/web-ui/modules/i18n.mjs +3 -2
  21. package/web-ui/modules/model-test.mjs +114 -26
  22. package/web-ui/partials/index/layout-header.html +73 -71
  23. package/web-ui/partials/index/modals-basic.html +22 -9
  24. package/web-ui/partials/index/panel-plugins.html +23 -35
  25. package/web-ui/partials/index/plugin-file-sharing.html +4 -4
  26. package/web-ui/partials/index/routing-model-test.html +29 -9
  27. package/web-ui/res/web-ui-render.precompiled.js +1 -14467
  28. package/web-ui/styles/layout-shell.css +155 -209
  29. package/web-ui/styles/navigation-panels.css +8 -9
  30. package/web-ui/styles/plugins-panel.css +78 -132
  31. package/web-ui/styles/responsive.css +7 -7
  32. package/web-ui/styles/routing.css +8 -0
  33. package/web-ui/styles/settings-panel.css +16 -14
  34. package/web-ui/styles/sub-tabs.css +13 -0
  35. package/web-ui/styles/theme-dark-tokens.css +4 -0
  36. package/web-ui/styles/theme-dark.css +5 -13
  37. package/web-ui/styles/theme-ocean-tokens.css +3 -0
  38. package/web-ui/styles/theme-ocean.css +3 -12
  39. package/web-ui/styles/theme-violet-tokens.css +3 -0
  40. package/web-ui/styles/theme-violet.css +14 -38
@@ -1,14 +1,27 @@
1
1
  <div v-if="showAppUpdateModal" class="modal-overlay" @click.self="closeAppUpdateModal">
2
2
  <div class="modal app-update-modal" role="dialog" aria-modal="true" aria-labelledby="app-update-title" aria-describedby="app-update-versions app-update-hint">
3
3
  <div id="app-update-title" class="modal-title">{{ t('side.update.available') }}</div>
4
- <div id="app-update-versions" class="form-group confirm-dialog-message">{{ t('side.update.metaVersions', { current: normalizePackageVersion(appVersion), latest: normalizePackageVersion(appLatestVersion) }) }}</div>
5
- <div class="docs-command-box">
6
- <input id="app-update-command" class="install-command" type="text" :value="appUpdateCommand()" readonly :aria-label="t('common.command')" @focus="$event.target.select()">
7
- <button type="button" class="btn-mini docs-copy-btn" @click="copyInstallCommand(appUpdateCommand())">{{ t('common.copy') }}</button>
8
- </div>
9
- <p id="app-update-hint" class="form-hint">{{ t('side.update.commandHint') }}</p>
4
+ <div id="app-update-versions" class="form-group confirm-dialog-message">{{ appLatestVersion ? t('side.update.metaVersions', { current: normalizePackageVersion(appVersion), latest: normalizePackageVersion(appLatestVersion) }) : t('side.update.currentOnly', { current: normalizePackageVersion(appVersion) }) }}</div>
5
+ <template v-if="appUpdateAction === 'download'">
6
+ <p id="app-update-hint" class="form-hint">{{ appVersionStatusLoading ? t('side.update.checking') : appVersionStatusError || (appUpdateAsset ? appUpdateAsset.name : t(isAppUpdateAvailable() ? 'side.update.assetUnavailable' : 'side.update.upToDate')) }}</p>
7
+ <p v-if="appUpdateDownloadStatus" class="form-hint" role="status">{{ t('side.update.download.' + appUpdateDownloadStatus) }}</p>
8
+ </template>
9
+ <template v-else>
10
+ <div class="docs-command-box">
11
+ <input id="app-update-command" class="install-command" type="text" :value="appUpdateCommand()" readonly :aria-label="t('common.command')" @focus="$event.target.select()">
12
+ <button type="button" class="btn-mini docs-copy-btn" @click="copyInstallCommand(appUpdateCommand())">{{ t('common.copy') }}</button>
13
+ </div>
14
+ <p id="app-update-hint" class="form-hint">{{ t('side.update.commandHint') }}</p>
15
+ </template>
10
16
  <div class="btn-group">
11
- <button type="button" class="btn btn-cancel" @click="closeAppUpdateModal">{{ t('common.close') }}</button>
17
+ <template v-if="appUpdateAction === 'download'">
18
+ <button v-if="appUpdateDownloadStatus === 'unavailable' || (!appUpdateAsset && (isAppUpdateAvailable() || appVersionStatusError || appVersionStatusLoading))"
19
+ id="app-update-primary" type="button" class="btn" :disabled="appVersionStatusLoading" @click="retryAppUpdateDownloadCheck">{{ t('side.update.retry') }}</button>
20
+ <button v-else-if="appUpdateAsset && hasNativeAppUpdateDownload()" id="app-update-primary" type="button" class="btn"
21
+ :disabled="appUpdateDownloadPending" @click="downloadAppUpdate">{{ t(appUpdateDownloadPending ? 'side.update.downloading' : 'side.update.downloadPackage') }}</button>
22
+ <a v-else-if="appUpdateAsset" id="app-update-primary" class="btn" :href="appUpdateAsset.url" target="_blank" rel="noopener noreferrer">{{ t('side.update.downloadPackage') }}</a>
23
+ </template>
24
+ <button id="app-update-close" type="button" class="btn btn-cancel" @click="closeAppUpdateModal">{{ t('common.close') }}</button>
12
25
  </div>
13
26
  </div>
14
27
  </div>
@@ -150,9 +163,9 @@
150
163
  </div>
151
164
 
152
165
  <!-- 项目功能公告模态框 -->
153
- <div v-if="showProviderCacheAnnouncementModal" class="modal-overlay project-announcement-overlay" @click.self="closeProviderCacheAnnouncementModal">
166
+ <div v-if="showProviderCacheAnnouncementModal" class="modal-overlay project-announcement-overlay" @click.self="closeProviderCacheAnnouncementModal" @keydown.esc.stop.prevent="closeProviderCacheAnnouncementModal">
154
167
  <div class="modal provider-cache-announcement-modal project-announcement-modal" role="dialog" aria-modal="true" aria-labelledby="provider-cache-announcement-title">
155
- <button type="button" class="project-announcement-close" :aria-label="t('announcement.project.closeAria')" @click="closeProviderCacheAnnouncementModal">×</button>
168
+ <button type="button" class="project-announcement-close" ref="sideAnnouncementClose" :aria-label="t('announcement.project.closeAria')" @click="closeProviderCacheAnnouncementModal">×</button>
156
169
  <div class="project-announcement-header">
157
170
  <div class="project-announcement-eyebrow">{{ t('announcement.project.eyebrow') }}</div>
158
171
  <div class="modal-title project-announcement-title" id="provider-cache-announcement-title">{{ t('announcement.project.title') }}</div>
@@ -4,15 +4,9 @@
4
4
  id="panel-plugins"
5
5
  role="tabpanel"
6
6
  aria-labelledby="tab-plugins">
7
- <div :class="['plugins-layout', { 'plugins-layout-single': !pluginsSidebarVisible }]">
8
- <aside v-if="pluginsSidebarVisible" class="plugins-sidebar" :aria-label="t('plugins.sidebar.ariaList')">
9
- <div class="selector-header plugins-sidebar-header">
10
- <div>
11
- <span class="selector-title">{{ t('plugins.sidebar.title') }}</span>
12
- </div>
13
- </div>
14
-
15
- <div class="plugins-list" role="list">
7
+ <div class="plugins-layout">
8
+ <nav v-if="pluginsSidebarVisible" class="plugins-sidebar" :aria-label="t('plugins.sidebar.ariaList')">
9
+ <div class="plugins-list">
16
10
  <button
17
11
  v-for="plugin in pluginsCatalog"
18
12
  :key="'plugin-' + plugin.id"
@@ -22,14 +16,10 @@
22
16
  :aria-current="pluginsActiveId === plugin.id ? 'page' : null"
23
17
  :disabled="loading || !!initError || pluginsLoading"
24
18
  @click="selectPlugin(plugin.id)">
25
- <div class="plugins-item-main">
26
- <div class="plugins-item-title">{{ plugin.title }}</div>
27
- <div class="plugins-item-meta">{{ plugin.description }}</div>
28
- </div>
29
- <span :class="['pill', plugin.tone]">{{ plugin.statusLabel }}</span>
19
+ <span class="plugins-item-title">{{ plugin.title }}</span>
30
20
  </button>
31
21
  </div>
32
- </aside>
22
+ </nav>
33
23
 
34
24
  <section class="plugins-main" :aria-label="t('plugins.main.ariaWorkspace')">
35
25
  <div v-if="pluginsLoading" class="skills-empty-state">{{ t('common.loading') }}</div>
@@ -39,9 +29,7 @@
39
29
  </div>
40
30
  <div v-else-if="pluginsActiveId === 'prompt-templates'" class="plugins-panel">
41
31
  <div class="plugins-panel-head">
42
- <div>
43
- <div class="plugins-panel-title">{{ t('plugins.promptTemplates.title') }}</div>
44
- </div>
32
+ <h2 class="sr-only">{{ t('plugins.promptTemplates.title') }}</h2>
45
33
  <div v-if="!pluginsSidebarVisible" class="settings-tab-actions">
46
34
  <button type="button" class="btn-tool btn-tool-compact" @click="loadPluginsOverview({ forceRefresh: true, silent: false })" :disabled="loading || !!initError || pluginsLoading">
47
35
  {{ pluginsLoading ? t('plugins.refreshing') : t('plugins.refresh') }}
@@ -55,21 +43,22 @@
55
43
  role="tab"
56
44
  :aria-selected="promptTemplatesMode === 'compose'"
57
45
  :class="['mode-pill', { active: promptTemplatesMode === 'compose' }]"
58
- @click="promptTemplatesMode = 'compose'; if(typeof saveNavState==='function')saveNavState()"><svg style="width:12px;height:12px;vertical-align:-1px;margin-right:4px" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 4h12v12H4z"/><path d="M8 8h4M8 11h2"/></svg>{{ t('plugins.promptTemplates.mode.compose') }}</button>
46
+ @click="promptTemplatesMode = 'compose'; if(typeof saveNavState==='function')saveNavState()">{{ t('plugins.promptTemplates.mode.compose') }}</button>
59
47
  <button
60
48
  type="button"
61
49
  role="tab"
62
50
  :aria-selected="promptTemplatesMode !== 'compose'"
63
51
  :class="['mode-pill', { active: promptTemplatesMode !== 'compose' }]"
64
- @click="promptTemplatesMode = 'manage'; if(typeof saveNavState==='function')saveNavState()"><svg style="width:12px;height:12px;vertical-align:-1px;margin-right:4px" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 5h14M3 10h10M3 15h12"/></svg>{{ t('plugins.promptTemplates.mode.manage') }}</button>
52
+ @click="promptTemplatesMode = 'manage'; if(typeof saveNavState==='function')saveNavState()">{{ t('plugins.promptTemplates.mode.manage') }}</button>
65
53
  </div>
66
54
 
67
55
  <div v-if="promptTemplatesMode === 'compose'" class="prompt-compose">
68
56
  <div class="prompt-compose-workspace">
69
57
  <div class="prompt-compose-main">
70
58
  <div class="prompt-compose-form">
71
- <label class="form-label">{{ t('plugins.promptTemplates.compose.selectTemplate') }}</label>
59
+ <label class="form-label" for="prompt-compose-template">{{ t('plugins.promptTemplates.compose.selectTemplate') }}</label>
72
60
  <select
61
+ id="prompt-compose-template"
73
62
  class="form-select prompt-compose-template-select"
74
63
  :value="promptComposerSelectedTemplateId"
75
64
  @change="selectPromptComposerTemplate($event.target.value)"
@@ -119,7 +108,7 @@
119
108
  <div>
120
109
  <div class="prompt-vars-title">{{ t('plugins.promptTemplates.compose.outputTitle') }}</div>
121
110
  </div>
122
- <button type="button" class="btn-mini" @click="copyPromptComposerRendered" :disabled="pluginsLoading || !promptComposerRendered">{{ t('plugins.promptTemplates.compose.copy') }}</button>
111
+ <button type="button" class="btn-mini btn-confirm-mini" @click="copyPromptComposerRendered" :disabled="pluginsLoading || !promptComposerRendered">{{ t('plugins.promptTemplates.compose.copy') }}</button>
123
112
  </div>
124
113
  <textarea class="form-input prompt-preview-textarea" :value="promptComposerRendered" rows="10" readonly spellcheck="false" :aria-label="t('plugins.promptTemplates.compose.outputAria')"></textarea>
125
114
  </div>
@@ -135,7 +124,7 @@
135
124
  v-model.trim="promptTemplatesKeyword"
136
125
  :aria-label="t('plugins.promptTemplates.manage.searchAria')"
137
126
  :placeholder="t('plugins.promptTemplates.manage.searchPlaceholder')">
138
- <button type="button" class="btn-mini" @click="createPromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.manage.create') }}</button>
127
+ <button type="button" class="btn-mini btn-confirm-mini" @click="createPromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.manage.create') }}</button>
139
128
  <button type="button" class="btn-mini" @click="exportPromptTemplates" :disabled="pluginsLoading || !promptTemplatesList.length">{{ t('plugins.promptTemplates.manage.export') }}</button>
140
129
  <button type="button" class="btn-mini" @click="triggerPromptTemplatesImport" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.manage.import') }}</button>
141
130
  </div>
@@ -158,7 +147,7 @@
158
147
  <span class="mono">{{ tpl.updatedLabel }}</span>
159
148
  </div>
160
149
  </div>
161
- <span :class="['pill', tpl.isBuiltin ? 'configured' : 'source']">{{ tpl.isBuiltin ? t('plugins.promptTemplates.manage.builtin') : t('plugins.promptTemplates.manage.custom') }}</span>
150
+ <span v-if="tpl.isBuiltin" class="prompt-template-origin">{{ t('plugins.promptTemplates.manage.builtin') }}</span>
162
151
  </button>
163
152
  </div>
164
153
  </div>
@@ -200,7 +189,7 @@
200
189
  <div v-if="!promptTemplateDraft.isBuiltin" class="prompt-editor-actions">
201
190
  <button type="button" class="btn-mini" @click="duplicatePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.duplicate') }}</button>
202
191
  <button type="button" class="btn-mini delete" @click="deletePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.delete') }}</button>
203
- <button type="button" class="btn-mini" @click="savePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.save') }}</button>
192
+ <button type="button" class="btn-mini btn-confirm-mini" @click="savePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.save') }}</button>
204
193
  </div>
205
194
  </div>
206
195
  <div v-if="promptTemplateDraft.isBuiltin" class="plugins-panel-note">
@@ -211,8 +200,9 @@
211
200
  </div>
212
201
 
213
202
  <div class="prompt-editor-body">
214
- <label class="form-label">{{ t('plugins.promptTemplates.editor.templateLabel') }}</label>
203
+ <label class="form-label" for="prompt-template-source">{{ t('plugins.promptTemplates.editor.templateLabel') }}</label>
215
204
  <textarea
205
+ id="prompt-template-source"
216
206
  class="form-input prompt-editor-textarea"
217
207
  v-model="promptTemplateDraftRaw.template"
218
208
  :disabled="promptTemplateDraft.isBuiltin"
@@ -255,14 +245,11 @@
255
245
  </div>
256
246
  </div>
257
247
  </div>
258
- <div v-else-if="pluginsActiveId === 'text-tools'" class="plugins-panel">
259
- <div class="plugins-panel-head">
260
- <div>
261
- <div class="plugins-panel-title">{{ t('plugins.textTools.title') }}</div>
262
- </div>
248
+ <div v-else-if="pluginsActiveId === 'text-tools'" class="plugins-panel plugins-panel-text-tools">
249
+ <div v-if="textToolsList.length === 1" class="plugins-panel-head">
250
+ <h2 class="plugins-panel-title">{{ textToolsList[0].label }}</h2>
263
251
  </div>
264
-
265
- <div class="prompt-templates-modebar" role="tablist" :aria-label="t('plugins.textTools.tools.aria')">
252
+ <div v-else-if="textToolsList.length > 1" class="prompt-templates-modebar" role="tablist" :aria-label="t('plugins.textTools.title')">
266
253
  <button
267
254
  v-for="tool in textToolsList"
268
255
  :key="'text-tool-' + tool.id"
@@ -277,8 +264,9 @@
277
264
  <div class="prompt-compose-workspace">
278
265
  <div class="prompt-compose-main">
279
266
  <div class="prompt-compose-form">
280
- <label class="form-label">{{ t('plugins.textTools.compress.inputLabel') }}</label>
267
+ <label class="form-label" for="plugin-text-input">{{ t('plugins.textTools.compress.inputLabel') }}</label>
281
268
  <textarea
269
+ id="plugin-text-input"
282
270
  class="form-input prompt-editor-textarea"
283
271
  v-model="textToolsInput"
284
272
  rows="10"
@@ -292,7 +280,7 @@
292
280
  <div>
293
281
  <div class="prompt-vars-title">{{ t('plugins.textTools.compress.outputTitle') }}</div>
294
282
  </div>
295
- <button type="button" class="btn-mini" @click="copyTextToolsOutput" :disabled="!textToolsOutput">{{ t('plugins.textTools.compress.copy') }}</button>
283
+ <button type="button" class="btn-mini btn-confirm-mini" @click="copyTextToolsOutput" :disabled="!textToolsOutput">{{ t('plugins.textTools.compress.copy') }}</button>
296
284
  </div>
297
285
  <textarea class="form-input prompt-preview-textarea" :value="textToolsOutput" rows="10" readonly spellcheck="false" :aria-label="t('plugins.textTools.compress.outputAria')"></textarea>
298
286
  </div>
@@ -1,6 +1,6 @@
1
1
  <div v-else-if="pluginsActiveId === 'file-sharing'" class="plugins-panel" id="plugin-file-sharing">
2
2
  <div class="plugins-panel-head">
3
- <div class="plugins-panel-title">{{ t('plugins.fileSharing.title') }}</div>
3
+ <h2 class="sr-only">{{ t('plugins.fileSharing.title') }}</h2>
4
4
  <div class="file-sharing-actions">
5
5
  <button type="button" class="btn-mini" :disabled="fileSharingBusy" @click="$refs.fileSharingFiles.click()">{{ t('plugins.fileSharing.chooseFiles') }}</button>
6
6
  <button type="button" class="btn-mini" :disabled="fileSharingBusy" @click="$refs.fileSharingFolder.click()">{{ t('plugins.fileSharing.chooseFolder') }}</button>
@@ -16,7 +16,7 @@
16
16
  <li v-for="(file, index) in fileSharingPending.entries" :key="index" dir="auto">{{ file.name }}</li>
17
17
  </ul>
18
18
  <div class="file-sharing-actions">
19
- <button type="button" class="btn-mini" id="upload-file-sharing" :disabled="fileSharingBusy" @click="uploadFileSharingItems">{{ t('plugins.fileSharing.upload') }}</button>
19
+ <button type="button" class="btn-mini btn-confirm-mini" id="upload-file-sharing" :disabled="fileSharingBusy" @click="uploadFileSharingItems">{{ t('plugins.fileSharing.upload') }}</button>
20
20
  <button type="button" class="btn-mini" id="cancel-file-sharing" :disabled="fileSharingBusy" @click="fileSharingPending = null">{{ t('common.cancel') }}</button>
21
21
  </div>
22
22
  </div>
@@ -24,14 +24,14 @@
24
24
  <p v-else-if="!fileSharingBatches.length" class="skills-empty-state">{{ t('plugins.fileSharing.empty') }}</p>
25
25
  <ul v-if="fileSharingBatches.length" class="file-sharing-items file-sharing-batches">
26
26
  <li v-for="batch in fileSharingBatches" :key="batch.id">
27
- <div class="file-sharing-row">
27
+ <div class="file-sharing-row file-sharing-batch-head">
28
28
  <strong dir="auto">{{ batch.folder || t('plugins.fileSharing.files', { count: batch.files.length }) }}</strong>
29
29
  <button type="button" class="btn-mini file-sharing-icon file-sharing-remove" :aria-label="t('plugins.fileSharing.remove')" :title="t('plugins.fileSharing.remove')" :disabled="fileSharingBusy" @click="removeFileSharingBatch(batch.id)">
30
30
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6m5 4v6m4-6v6"/></svg>
31
31
  </button>
32
32
  </div>
33
33
  <ul class="file-sharing-items">
34
- <li v-for="(file, index) in batch.files" :key="index" class="file-sharing-row">
34
+ <li v-for="(file, index) in batch.files" :key="index" class="file-sharing-row file-sharing-file">
35
35
  <span dir="auto">{{ file.name }}</span>
36
36
  <span class="file-sharing-size">{{ t('plugins.fileSharing.bytes', { size: file.size }) }}</span>
37
37
  <a class="btn-mini file-sharing-icon" :aria-label="t('plugins.fileSharing.download')" :title="t('plugins.fileSharing.download')" :href="fileSharingDownloadUrl(batch.id, index)" download referrerpolicy="no-referrer">
@@ -1,40 +1,60 @@
1
1
  <div class="routing-test">
2
- <form novalidate @submit.prevent="runModelTest" :aria-busy="modelTestRunning">
2
+ <form novalidate @submit.prevent="runModelTest" :aria-busy="modelTestRunning || modelTestDiscovering">
3
3
  <fieldset :disabled="modelTestRunning || modelTestLoading">
4
4
  <legend class="routing-test-legend">{{ t('modelTest.selection') }}</legend>
5
5
  <div class="routing-test-heading">
6
6
  <div class="segmented-control" role="group" :aria-label="t('modelTest.source')">
7
- <button v-for="target in ['codex', 'pi']" :key="target" type="button" :class="['segment', { active: modelTestTarget === target }]" :aria-pressed="modelTestTarget === target" @click="setModelTestTarget(target)">{{ target === 'codex' ? 'Codex' : 'Pi' }}</button>
7
+ <button v-for="target in ['codex', 'pi']" :key="target" type="button" :class="['segment', { active: modelTestTarget === target }]" :aria-pressed="modelTestTarget === target" :disabled="modelTestDiscovering" @click="setModelTestTarget(target)">{{ target === 'codex' ? 'Codex' : 'Pi' }}</button>
8
8
  </div>
9
- <button type="button" class="btn-tool routing-icon-btn" :disabled="modelTestLoading || modelTestRunning" :aria-label="t('routing.refresh')" :title="t('routing.refresh')" @click="loadModelTestCatalog">
9
+ <button type="button" class="btn-tool routing-icon-btn" :disabled="modelTestLoading || modelTestRunning || modelTestDiscovering" :aria-label="t('routing.refresh')" :title="t('routing.refresh')" @click="loadModelTestCatalog">
10
10
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" focusable="false"><path d="M20 7v5h-5M4 17v-5h5M6 7a7 7 0 0 1 12-1l2 3M4 15l2 3a7 7 0 0 0 12-1"/></svg>
11
11
  </button>
12
12
  </div>
13
13
  <div class="routing-form-head">
14
14
  <label class="routing-field"><span class="form-label">{{ t('routing.provider') }}</span>
15
- <select class="model-select" v-model="modelTestProvider" @change="selectModelTestProvider">
15
+ <select class="model-select" :disabled="modelTestDiscovering" v-model="modelTestProvider" @change="selectModelTestProvider">
16
16
  <option value="" disabled>{{ t('routing.selectProvider') }}</option>
17
17
  <option v-for="provider in modelTestProviders()" :key="provider.name" :value="provider.name">{{ provider.name }}</option>
18
18
  </select>
19
19
  </label>
20
20
  <label class="routing-field"><span class="form-label">{{ t('routing.model') }}</span>
21
- <select class="model-select" v-model="modelTestModel">
21
+ <select class="model-select" :disabled="modelTestDiscovering" v-model="modelTestModel" @change="saveModelTestSelection">
22
22
  <option value="" disabled>{{ t('modelTest.selectModel') }}</option>
23
+ <option v-if="modelTestProvider" :value="null">{{ t('modelTest.allModels') }}</option>
23
24
  <option v-for="model in modelTestModels()" :key="model" :value="model">{{ model }}</option>
24
25
  </select>
25
26
  </label>
26
27
  </div>
27
- <p v-if="!modelTestLoading && !modelTestModels().length" class="routing-hint">{{ t('modelTest.empty') }} <button type="button" class="btn-tool" @click="switchConfigMode(modelTestTarget)">{{ t('routing.openConfig') }}</button></p>
28
+ <p v-if="!modelTestLoading && !modelTestModels().length" class="routing-hint">{{ t('modelTest.empty') }} <button type="button" class="btn-tool" :disabled="modelTestDiscovering" @click="switchConfigMode(modelTestTarget)">{{ t('routing.openConfig') }}</button></p>
28
29
  <label class="routing-field routing-test-prompt"><span class="form-label">{{ t('modelTest.prompt') }}</span>
29
- <textarea class="form-input" v-model="modelTestPrompt" rows="4" maxlength="8000"></textarea>
30
+ <textarea class="form-input" :disabled="modelTestDiscovering" v-model="modelTestPrompt" rows="4" maxlength="8000"></textarea>
30
31
  </label>
31
32
  <div class="routing-test-actions">
32
- <button type="submit" class="btn-tool btn-primary" :disabled="!modelTestPrompt.trim() || !modelTestModels().length">{{ t(modelTestRunning ? 'modelTest.running' : 'modelTest.run') }}</button>
33
+ <button type="submit" class="btn-tool btn-primary" :disabled="modelTestDiscovering || !modelTestPrompt.trim() || !canRunModelTest()">{{ t(modelTestRunning ? 'modelTest.running' : 'modelTest.run') }}</button>
33
34
  </div>
34
35
  </fieldset>
35
36
  </form>
36
37
  <p v-if="modelTestError" class="routing-error" role="alert">{{ modelTestError }}</p>
37
- <div class="routing-test-response" aria-live="polite" :aria-busy="modelTestRunning">
38
+ <p v-if="modelTestDiscovering" class="routing-hint" role="status">{{ t('modelTest.discovering') }}</p>
39
+ <section v-if="modelTestBatch" class="routing-test-response">
40
+ <strong class="routing-test-result-head">{{ modelTestBatch.provider }}</strong>
41
+ <p class="routing-hint" role="status">{{ t('modelTest.progressAll', { done: modelTestBatch.results.length, total: modelTestBatch.total }) }}<template v-if="modelTestBatch.current"> · {{ modelTestBatch.current }}</template></p>
42
+ <p class="routing-test-question">{{ modelTestBatch.prompt }}</p>
43
+ <details v-for="result in modelTestBatch.results" :key="result.model" class="routing-batch-result" :open="!!result.open" @toggle="toggleModelTestResult(result, $event)">
44
+ <summary>
45
+ <strong>{{ result.model }}</strong>
46
+ <span v-if="result.responseModel && result.responseModel !== result.model"> → {{ result.responseModel }}</span>
47
+ <span class="routing-hint"> · {{ t(result.ok ? 'modelTest.completed' : 'modelTest.failed') }} · {{ modelTestDuration(result) }}</span>
48
+ </summary>
49
+ <p v-if="result.open && !result.ok" class="routing-error">{{ result.error }}</p>
50
+ <template v-else-if="result.open && result.rendered">
51
+ <div v-if="result.rendered.html" class="routing-test-answer" v-html="result.rendered.html"></div>
52
+ <p v-else class="routing-test-answer routing-test-plain">{{ result.text }}</p>
53
+ <p v-if="result.incomplete" class="routing-hint">{{ t('modelTest.incomplete') }}</p>
54
+ </template>
55
+ </details>
56
+ </section>
57
+ <div v-else class="routing-test-response" aria-live="polite" :aria-busy="modelTestRunning">
38
58
  <p v-if="modelTestLoading" class="routing-hint" role="status">{{ t('modelTest.loading') }}</p>
39
59
  <template v-else-if="modelTestResult">
40
60
  <div class="routing-test-result-head">