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.
@@ -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-_Wng07JI.js"></script>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-tool-x",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Vibe Coding 增强工作助手 - 智能会话管理、动态渠道切换、全局搜索、实时监控",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -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',