codexmate 0.0.36 → 0.0.38

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.
@@ -1,337 +0,0 @@
1
- <!-- Provider 配置模式(Codex) -->
2
- <div
3
- v-show="mainTab === 'config' && isProviderConfigMode"
4
- class="mode-content mode-cards"
5
- id="panel-config-provider"
6
- role="tabpanel"
7
- :aria-labelledby="forceCompactLayout ? 'tab-config' : ('side-tab-config-' + configMode)">
8
- <div v-if="forceCompactLayout && !sessionStandalone" class="segmented-control">
9
- <button type="button" :class="['segment', { active: configMode === 'codex' }]" @click="switchConfigMode('codex')">{{ t('tab.config.codex') }}</button>
10
- <button type="button" :class="['segment', { active: configMode === 'claude' }]" @click="switchConfigMode('claude')">{{ t('tab.config.claude') }}</button>
11
- <button type="button" :class="['segment', { active: configMode === 'openclaw' }]" @click="switchConfigMode('openclaw')">{{ t('tab.config.openclaw') }}</button>
12
- </div>
13
- <template v-if="isCodexConfigMode && shouldShowCliInstallPlaceholder('codex')">
14
- <div class="selector-section">
15
- <div class="empty-state">
16
- <div class="empty-state-title">{{ t('cli.missing.title', { name: 'Codex' }) }}</div>
17
- <div class="empty-state-subtitle">{{ t('cli.missing.subtitle', { name: 'Codex' }) }}</div>
18
- <div class="docs-command-row">
19
- <div class="docs-command-box" role="group" :aria-label="t('cli.missing.commandAria', { name: 'Codex' })">
20
- <code class="install-command">{{ getInstallCommand('codex', 'install') }}</code>
21
- <button
22
- type="button"
23
- class="btn-mini docs-copy-btn"
24
- :disabled="!getInstallCommand('codex', 'install')"
25
- @click="copyInstallCommand(getInstallCommand('codex', 'install'))">{{ t('common.copy') }}</button>
26
- </div>
27
- </div>
28
- <button type="button" class="btn-tool btn-tool-compact" @click="mainTab = 'docs'; setInstallCommandAction('install')">{{ t('cli.missing.openDocs') }}</button>
29
- </div>
30
- </div>
31
- </template>
32
- <template v-else>
33
- <!-- 添加提供商按钮 -->
34
- <button class="btn-add" @click="showAddModal = true" v-if="!loading && !initError">
35
- <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
36
- <path d="M10 4v12M4 10h12"/>
37
- </svg>
38
- {{ t('config.addProvider') }}
39
- </button>
40
-
41
- <!-- 服务预设 -->
42
- <div class="selector-section" v-if="isCodexConfigMode && codexProviderTemplates.length">
43
- <div class="selector-header">
44
- <span class="selector-title">{{ t('config.providerTemplate.title') }}</span>
45
- </div>
46
- <div class="btn-group" style="flex-wrap: wrap; gap: 8px; margin-top: 0;">
47
- <button
48
- v-for="tpl in codexProviderTemplates"
49
- :key="tpl.name"
50
- type="button"
51
- class="btn-mini"
52
- @click="newProvider.name = tpl.name;
53
- newProvider.url = tpl.url;
54
- newProvider._suggestedModel = tpl.model || '';
55
- newProvider.useTransform = !!tpl.useTransform;
56
- showAddModal = true">
57
- {{ tpl.label }}
58
- </button>
59
- </div>
60
- </div>
61
-
62
- <!-- 模型选择器 -->
63
- <div class="selector-section">
64
- <div class="selector-header">
65
- <span class="selector-title">{{ t('config.models') }}</span>
66
- <div class="selector-actions">
67
- <button class="btn-icon" @click="showModelModal = true" :aria-label="t('modal.modelAdd.title')" :title="t('modal.modelAdd.title')" v-if="modelsSource === 'legacy'">+</button>
68
- <button class="btn-icon" @click="showModelListModal = true" :aria-label="t('modal.modelManage.title')" :title="t('modal.modelManage.title')" v-if="modelsSource === 'legacy'">≡</button>
69
- </div>
70
- </div>
71
- <select
72
- v-if="codexModelsLoading || modelsSource === 'remote'"
73
- class="model-select"
74
- v-model="currentModel"
75
- @change="onModelChange"
76
- :disabled="codexModelsLoading"
77
- >
78
- <option v-if="codexModelsLoading" value="">{{ t('config.modelLoading') }}</option>
79
- <option v-else v-for="model in codexModelOptions" :key="model" :value="model">{{ model }}</option>
80
- </select>
81
- <input
82
- v-if="!codexModelsLoading && (modelsSource !== 'remote' || !modelsHasCurrent)"
83
- class="model-input"
84
- v-model="currentModel"
85
- @blur="onModelChange"
86
- @keyup.enter="onModelChange"
87
- :placeholder="activeProviderModelPlaceholder"
88
- :list="codexModelHasList ? 'codex-model-options' : null"
89
- >
90
- <datalist v-if="codexModelHasList" id="codex-model-options">
91
- <option v-for="model in codexModelOptions" :key="model" :value="model"></option>
92
- </datalist>
93
- <div class="config-template-hint" v-if="modelsSource === 'unlimited'">
94
- {{ t('config.models.unlimited') }}
95
- </div>
96
- <div class="config-template-hint" v-if="modelsSource === 'error'">
97
- {{ t('config.models.error') }}
98
- </div>
99
- <div class="config-template-hint" v-if="modelsSource === 'remote' && !modelsHasCurrent">
100
- {{ isCodexConfigMode ? t('config.models.notInList.codex') : t('config.models.notInList.other') }}
101
- </div>
102
- <div class="config-template-hint" v-if="isCodexConfigMode">
103
- {{ t('config.template.editFirst') }}
104
- </div>
105
- <div class="config-template-hint" v-else-if="activeProviderBridgeHint">
106
- {{ t('config.template.bridgeCodexOnly', { hint: activeProviderBridgeHint }) }}
107
- </div>
108
- <button class="btn-tool btn-template-editor" v-if="isCodexConfigMode" @click="openConfigTemplateEditor" :disabled="loading || !!initError">
109
- {{ t('config.template.openEditor') }}
110
- </button>
111
- </div>
112
-
113
- <template v-if="isCodexConfigMode">
114
- <div class="selector-section">
115
- <div class="selector-header">
116
- <span class="selector-title">{{ t('config.serviceTier') }}</span>
117
- </div>
118
- <select class="model-select" v-model="serviceTier" @change="onServiceTierChange">
119
- <option value="fast">{{ t('config.serviceTier.fast') }}</option>
120
- <option value="standard">{{ t('config.serviceTier.standard') }}</option>
121
- </select>
122
- <div class="config-template-hint">
123
- {{ t('config.serviceTier.hint', { field: 'service_tier' }) }}
124
- </div>
125
- </div>
126
-
127
- <div class="selector-section">
128
- <div class="selector-header">
129
- <span class="selector-title">{{ t('config.reasoningEffort') }}</span>
130
- </div>
131
- <select class="model-select" v-model="modelReasoningEffort" @change="onReasoningEffortChange">
132
- <option value="high">high</option>
133
- <option value="medium">{{ t('config.reasoningEffort.medium') }}</option>
134
- <option value="low">low</option>
135
- <option value="xhigh">xhigh</option>
136
- </select>
137
- <div class="config-template-hint">
138
- {{ t('config.reasoningEffort.hint') }}
139
- </div>
140
- </div>
141
-
142
- <div class="selector-section">
143
- <div class="selector-header">
144
- <span class="selector-title">{{ t('config.contextBudget') }}</span>
145
- <div class="selector-actions">
146
- <button
147
- class="btn-tool btn-tool-compact"
148
- @click="resetCodexContextBudgetDefaults"
149
- :disabled="loading || !!initError || codexApplying">
150
- {{ t('config.reset') }}
151
- </button>
152
- </div>
153
- </div>
154
- <div class="codex-config-grid">
155
- <div class="form-group codex-config-field">
156
- <label class="form-label" for="codex-model-context-window">model_context_window</label>
157
- <input
158
- id="codex-model-context-window"
159
- v-model="modelContextWindowInput"
160
- class="form-input"
161
- inputmode="numeric"
162
- autocomplete="off"
163
- :placeholder="t('config.example', { value: 190000 })"
164
- @focus="editingCodexBudgetField = 'modelContextWindowInput'"
165
- @input="sanitizePositiveIntegerDraft('modelContextWindowInput')"
166
- @blur="onModelContextWindowBlur"
167
- @keydown.enter.prevent="onModelContextWindowBlur">
168
- <div class="form-hint">{{ t('config.contextWindow.hint') }}</div>
169
- </div>
170
- <div class="form-group codex-config-field">
171
- <label class="form-label" for="codex-model-auto-compact-token-limit">model_auto_compact_token_limit</label>
172
- <input
173
- id="codex-model-auto-compact-token-limit"
174
- v-model="modelAutoCompactTokenLimitInput"
175
- class="form-input"
176
- inputmode="numeric"
177
- autocomplete="off"
178
- :placeholder="t('config.example', { value: 185000 })"
179
- @focus="editingCodexBudgetField = 'modelAutoCompactTokenLimitInput'"
180
- @input="sanitizePositiveIntegerDraft('modelAutoCompactTokenLimitInput')"
181
- @blur="onModelAutoCompactTokenLimitBlur"
182
- @keydown.enter.prevent="onModelAutoCompactTokenLimitBlur">
183
- <div class="form-hint">{{ t('config.autoCompact.hint') }}</div>
184
- </div>
185
- </div>
186
- </div>
187
-
188
- <div class="selector-section">
189
- <div class="selector-header">
190
- <span class="selector-title">AGENTS.md</span>
191
- </div>
192
- <button class="btn-tool" @click="openAgentsEditor" :disabled="loading || !!initError || agentsLoading">
193
- {{ agentsLoading ? t('config.modelLoading') : t('config.agents.open') }}
194
- </button>
195
- </div>
196
-
197
- <div class="selector-section">
198
- <div class="selector-header">
199
- <span class="selector-title">{{ t('config.health.title') }}</span>
200
- </div>
201
- <button class="btn-tool" @click="runHealthCheck" :disabled="healthCheckLoading || loading || !!initError">
202
- {{ healthCheckLoading ? t('config.health.running') : t('config.health.run') }}
203
- </button>
204
- <div class="config-template-hint">{{ t('config.health.hint') }}</div>
205
- <div v-if="healthCheckLoading && healthCheckBatchTotal" class="config-template-hint">
206
- {{ t('config.health.progress', { done: healthCheckBatchDone, total: healthCheckBatchTotal, failed: healthCheckBatchFailed }) }}
207
- </div>
208
- <div v-if="healthCheckResult && !healthCheckLoading" class="config-template-hint">
209
- {{ healthCheckResult.ok ? t('config.health.ok') : t('config.health.fail') }} · {{ t('config.health.issues', { count: (healthCheckResult.issues || []).length }) }}
210
- </div>
211
- <button v-if="healthCheckResult && !healthCheckLoading" type="button" class="btn-mini" @click="showHealthCheckModal = true">
212
- {{ t('common.detail') }}
213
- </button>
214
- <div v-if="healthCheckResult && !healthCheckLoading && (healthCheckResult.issues || []).length">
215
- <div v-for="(issue, index) in healthCheckResult.issues" :key="issue.code || ('issue-' + index)" class="config-template-hint">
216
- {{ issue.message || issue.code || '' }}<span v-if="issue.suggestion"> · {{ issue.suggestion }}</span>
217
- </div>
218
- </div>
219
- </div>
220
-
221
- </template>
222
-
223
- <div v-if="!loading && !initError" class="card-list">
224
- <div v-for="provider in displayProvidersList" :key="provider.name"
225
- :class="['card', { active: displayCurrentProvider === provider.name }]"
226
- @click="switchProvider(provider.name)"
227
- @keydown.enter.self.prevent="switchProvider(provider.name)"
228
- @keydown.space.self.prevent="switchProvider(provider.name)"
229
- tabindex="0"
230
- role="button"
231
- :aria-current="displayCurrentProvider === provider.name ? 'true' : null">
232
- <div class="card-leading">
233
- <div class="card-icon">{{ provider.name.charAt(0).toUpperCase() }}<span v-if="isTransformProvider(provider)" class="card-icon-dot" title="通过内建转换适配"></span></div>
234
- <div class="card-content">
235
- <div class="card-title">
236
- <span>{{ provider.name }}</span>
237
- <span v-if="provider.readOnly" class="provider-readonly-badge">{{ t('config.badge.system') }}</span>
238
- </div>
239
- <div v-if="provider.name !== 'local'" class="card-subtitle card-subtitle-model">
240
- {{ activeProviderModel(provider.name) || t('config.model.unset') }}
241
- </div>
242
- <div v-if="provider.name !== 'local'" class="card-subtitle card-subtitle-url">
243
- {{ displayProviderUrl(provider) || t('config.url.unset') }}
244
- </div>
245
- </div>
246
- </div>
247
- <div class="card-trailing">
248
- <span v-if="speedResults[provider.name]" :class="['latency', speedResults[provider.name].ok ? 'ok' : 'error']">
249
- {{ formatLatency(speedResults[provider.name]) }}
250
- </span>
251
- <span :class="['pill', providerPillConfigured(provider) ? 'configured' : 'empty']">
252
- {{ providerPillText(provider) }}
253
- </span>
254
- <div class="card-actions" @click.stop>
255
- <button
256
- class="card-action-btn"
257
- :class="{ loading: speedLoading[provider.name] }"
258
- :disabled="!!speedLoading[provider.name]"
259
- @click="runSpeedTest(provider.name, { silent: true })"
260
- :aria-label="t('config.availabilityTestAria', { name: provider.name })"
261
- :title="t('config.availabilityTest')"
262
- >
263
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
264
- <path d="M13 2L3 14h7l-1 8 12-14h-7l1-6z"/>
265
- </svg>
266
- </button>
267
- <button
268
- v-if="!provider.readOnly"
269
- class="card-action-btn"
270
- :class="{ loading: providerShareLoading[provider.name], disabled: !shouldAllowProviderShare(provider) }"
271
- :disabled="providerShareLoading[provider.name] || !shouldAllowProviderShare(provider)"
272
- @click="copyProviderShareCommand(provider)"
273
- :title="shouldAllowProviderShare(provider) ? t('config.shareCommand') : t('config.shareDisabled')"
274
- :aria-label="t('config.shareCommand.aria')">
275
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
276
- <path d="M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7"/>
277
- <path d="M16 6l-4-4-4 4"/>
278
- <path d="M12 2v14"/>
279
- </svg>
280
- </button>
281
- <button
282
- v-if="!provider.readOnly"
283
- class="card-action-btn"
284
- :class="{ disabled: !shouldShowProviderEdit(provider) }"
285
- :disabled="!shouldShowProviderEdit(provider)"
286
- @click="openEditModal(provider)"
287
- :aria-label="t('config.provider.edit.aria', { name: provider.name })"
288
- :title="shouldShowProviderEdit(provider) ? t('common.edit') : t('common.notEditable')">
289
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
290
- <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
291
- <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
292
- </svg>
293
- </button>
294
- <button
295
- v-if="!provider.readOnly"
296
- class="card-action-btn"
297
- @click="openCloneProviderModal(provider)"
298
- :aria-label="t('config.provider.clone.aria', { name: provider.name })"
299
- :title="t('config.provider.clone')">
300
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
301
- <rect x="9" y="9" width="13" height="13" rx="2"/>
302
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
303
- </svg>
304
- </button>
305
- <button
306
- v-if="!provider.readOnly"
307
- class="card-action-btn delete"
308
- :class="{ disabled: !shouldShowProviderDelete(provider) }"
309
- :disabled="!shouldShowProviderDelete(provider)"
310
- @click="deleteProvider(provider.name)"
311
- :aria-label="t('config.provider.delete.aria', { name: provider.name })"
312
- :title="shouldShowProviderDelete(provider) ? t('common.delete') : t('common.notDeletable')">
313
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
314
- <path d="M3 6h18"/>
315
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
316
- </svg>
317
- </button>
318
- </div>
319
- </div>
320
- </div>
321
- </div>
322
-
323
- <div v-if="displayCurrentProvider === 'local'" class="local-bridge-panel" style="margin-top:12px;padding:12px;background:var(--card-bg);border-radius:8px;border:1px solid var(--border-color)">
324
- <div style="font-size:13px;font-weight:600;margin-bottom:8px;color:var(--text-secondary)">轮询池 — 勾选参与负载均衡的提供商</div>
325
- <div v-if="localBridgeCandidateProviders().length === 0" style="font-size:12px;color:var(--text-muted)">暂无可用上游 provider,请先添加直连 provider</div>
326
- <label v-for="cp in localBridgeCandidateProviders()" :key="cp.name"
327
- style="display:flex;align-items:center;gap:8px;padding:6px 0;cursor:pointer;font-size:13px">
328
- <input type="checkbox"
329
- :checked="!isLocalBridgeExcluded(cp.name)"
330
- @change="toggleLocalBridgeExcluded(cp.name)"
331
- style="accent-color:var(--accent-color)" />
332
- <span>{{ cp.name }}</span>
333
- </label>
334
- </div>
335
-
336
- </template>
337
- </div>