@yeaft/webchat-agent 0.1.36 → 0.1.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.
package/claude.js CHANGED
@@ -254,6 +254,7 @@ async function processClaudeOutput(conversationId, claudeQuery, state) {
254
254
  console.log(`Claude session ID: ${state.claudeSessionId}`);
255
255
  console.log(`Model: ${state.model}`);
256
256
  console.log(`Available tools: ${state.tools.length}`);
257
+ console.log(`Tools: ${state.tools.join(', ')}`);
257
258
  console.log(`Available slash commands: ${state.slashCommands.join(', ')}`);
258
259
 
259
260
  // 通知服务器更新 claudeSessionId(用于历史会话恢复)
package/conversation.js CHANGED
@@ -144,6 +144,23 @@ export async function createConversation(msg) {
144
144
  disallowedTools: disallowedTools || null
145
145
  });
146
146
 
147
+ // 立即发送 agent 级别的 MCP servers 列表(从 ~/.claude.json 读取的)
148
+ // 让前端在 Claude CLI init 之前就能显示 MCP 配置入口
149
+ // Claude CLI init 后会用实际 tools 列表覆盖更新
150
+ if (ctx.mcpServers.length > 0) {
151
+ const effectiveDisallowed = disallowedTools || ctx.CONFIG.disallowedTools || [];
152
+ const serversWithState = ctx.mcpServers.map(s => ({
153
+ name: s.name,
154
+ enabled: !effectiveDisallowed.some(d => d === `mcp__${s.name}`),
155
+ source: s.source
156
+ }));
157
+ ctx.sendToServer({
158
+ type: 'conversation_mcp_update',
159
+ conversationId,
160
+ servers: serversWithState
161
+ });
162
+ }
163
+
147
164
  sendConversationList();
148
165
  }
149
166
 
@@ -208,6 +225,21 @@ export async function resumeConversation(msg) {
208
225
  username
209
226
  });
210
227
 
228
+ // 立即发送 agent 级别的 MCP servers 列表
229
+ if (ctx.mcpServers.length > 0) {
230
+ const effectiveDisallowed = disallowedTools || ctx.CONFIG.disallowedTools || [];
231
+ const serversWithState = ctx.mcpServers.map(s => ({
232
+ name: s.name,
233
+ enabled: !effectiveDisallowed.some(d => d === `mcp__${s.name}`),
234
+ source: s.source
235
+ }));
236
+ ctx.sendToServer({
237
+ type: 'conversation_mcp_update',
238
+ conversationId,
239
+ servers: serversWithState
240
+ });
241
+ }
242
+
211
243
  sendConversationList();
212
244
  }
213
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",