coding-tool-x 3.3.0 → 3.3.1
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/dist/web/assets/{Analytics-C1ksHds9.js → Analytics-BskCbia_.js} +1 -1
- package/dist/web/assets/{ConfigTemplates-DPalVYLW.js → ConfigTemplates-B4X3rgfY.js} +1 -1
- package/dist/web/assets/{Home-gWHWIqGE.js → Home-DHYMMKOU.js} +1 -1
- package/dist/web/assets/{PluginManager-BVmCjtCx.js → PluginManager-D_LoULGH.js} +1 -1
- package/dist/web/assets/{ProjectList-BkLjuHNf.js → ProjectList-DiV4Qwa1.js} +1 -1
- package/dist/web/assets/{SessionList-D0TRger4.js → SessionList-B24o0wiX.js} +1 -1
- package/dist/web/assets/{SkillManager-CWz7fdXo.js → SkillManager-B9Rnuaig.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-D0S_Mc6X.js → WorkspaceManager-BkL2l5J9.js} +1 -1
- package/dist/web/assets/index-ZttxvTKw.js +2 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/src/server/api/opencode-channels.js +28 -1
- package/src/server/proxy-server.js +0 -8
- package/dist/web/assets/index-_Wng07JI.js +0 -2
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>CC-TOOL - ClaudeCode增强工作助手</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-ZttxvTKw.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/markdown-C9MYpaSi.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-DET08QYg.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendors-DMjSfzlv.js">
|
package/package.json
CHANGED
|
@@ -131,6 +131,32 @@ module.exports = (config) => {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* POST /api/opencode/channels/probe-models
|
|
136
|
+
* 用临时配置(新建渠道时)获取模型列表,无需 channelId
|
|
137
|
+
*/
|
|
138
|
+
router.post('/probe-models', async (req, res) => {
|
|
139
|
+
try {
|
|
140
|
+
const { baseUrl, apiKey, gatewaySourceType } = req.body;
|
|
141
|
+
if (!baseUrl) {
|
|
142
|
+
return res.status(400).json({ error: 'baseUrl is required' });
|
|
143
|
+
}
|
|
144
|
+
const tempChannel = { baseUrl, apiKey: apiKey || '', gatewaySourceType: gatewaySourceType || 'codex' };
|
|
145
|
+
const gst = resolveGatewaySourceType(tempChannel);
|
|
146
|
+
const listResult = await fetchModelsFromProvider(tempChannel, gst, { useV1ModelsEndpoint: true, forceRefresh: true });
|
|
147
|
+
const listedModels = Array.isArray(listResult.models) ? uniqueModels(listResult.models) : [];
|
|
148
|
+
res.json({
|
|
149
|
+
models: listedModels,
|
|
150
|
+
supported: listedModels.length > 0,
|
|
151
|
+
error: listedModels.length > 0 ? null : (listResult.error || '未返回可用模型列表'),
|
|
152
|
+
errorHint: listedModels.length > 0 ? null : (listResult.errorHint || '请手动填写模型名称')
|
|
153
|
+
});
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error('[OpenCode Channels API] Error probing models:', error);
|
|
156
|
+
res.status(500).json({ error: 'Failed to probe models' });
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
134
160
|
/**
|
|
135
161
|
* GET /api/opencode/channels/:channelId/models
|
|
136
162
|
* 获取渠道可用模型列表
|
|
@@ -145,9 +171,10 @@ module.exports = (config) => {
|
|
|
145
171
|
return res.status(404).json({ error: 'Channel not found' });
|
|
146
172
|
}
|
|
147
173
|
|
|
174
|
+
const forceRefresh = req.query.forceRefresh === 'true';
|
|
148
175
|
const gatewaySourceType = resolveGatewaySourceType(channel);
|
|
149
176
|
const preferredModels = collectChannelPreferredModels(channel);
|
|
150
|
-
const listResult = await fetchModelsFromProvider(channel, gatewaySourceType);
|
|
177
|
+
const listResult = await fetchModelsFromProvider(channel, gatewaySourceType, { useV1ModelsEndpoint: true, forceRefresh });
|
|
151
178
|
const listedModels = Array.isArray(listResult.models) ? uniqueModels(listResult.models) : [];
|
|
152
179
|
const shouldProbeByDefault = !!listResult.disabledByConfig;
|
|
153
180
|
let result;
|
|
@@ -328,14 +328,6 @@ async function startProxyServer(options = {}) {
|
|
|
328
328
|
second: '2-digit'
|
|
329
329
|
});
|
|
330
330
|
const requestSnapshot = serializeFullClaudeRequest(req);
|
|
331
|
-
broadcastLog({
|
|
332
|
-
type: 'action',
|
|
333
|
-
action: 'claude_request_received',
|
|
334
|
-
time,
|
|
335
|
-
channel: channel.name,
|
|
336
|
-
source: 'claude',
|
|
337
|
-
requestSummary: buildClaudeRequestSummary(req, sessionId)
|
|
338
|
-
});
|
|
339
331
|
persistClaudeRequestSnapshot({
|
|
340
332
|
timestamp: Date.now(),
|
|
341
333
|
source: 'claude',
|