@askmesh/mcp 0.7.0 → 0.7.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.
|
@@ -62,11 +62,11 @@ export class AutoResponder {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
catch {
|
|
66
|
-
console.error('[AskMesh] MCP sampling
|
|
65
|
+
catch (err) {
|
|
66
|
+
console.error('[AskMesh] MCP sampling failed:', err instanceof Error ? err.message : err);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
// Strategy 2: Anthropic API fallback (optional
|
|
69
|
+
// Strategy 2: Anthropic API fallback (optional)
|
|
70
70
|
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
71
71
|
if (apiKey) {
|
|
72
72
|
try {
|
|
@@ -82,8 +82,23 @@ export class AutoResponder {
|
|
|
82
82
|
console.error('[AskMesh] Anthropic API failed:', err);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
// Strategy 3:
|
|
86
|
-
|
|
85
|
+
// Strategy 3: Notify Claude Code and revert to pending
|
|
86
|
+
// Revert status so the message can be answered manually
|
|
87
|
+
try {
|
|
88
|
+
await this.client.updateThreadStatus(request.id, 'pending');
|
|
89
|
+
}
|
|
90
|
+
catch { }
|
|
91
|
+
// Send logging notification to Claude Code
|
|
92
|
+
if (this.mcpServer) {
|
|
93
|
+
try {
|
|
94
|
+
await this.mcpServer.sendLoggingMessage({
|
|
95
|
+
level: 'warning',
|
|
96
|
+
data: `📩 AskMesh — @${request.fromUsername} asks: "${request.question.slice(0, 200)}" → Use askmesh(action:"pending") to see and reply.`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch { }
|
|
100
|
+
}
|
|
101
|
+
console.error(`[AskMesh] Question #${request.id} from @${request.fromUsername} — auto-response failed, use askmesh(action:"pending") to respond`);
|
|
87
102
|
}
|
|
88
103
|
async callAnthropicAPI(apiKey, request, context) {
|
|
89
104
|
const model = process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-20250514';
|
|
@@ -84,7 +84,7 @@ export declare class AskMeshClient {
|
|
|
84
84
|
createdAt: string;
|
|
85
85
|
}>;
|
|
86
86
|
}>;
|
|
87
|
-
updateThreadStatus(requestId: number, status: 'in_progress' | 'delegated'): Promise<{
|
|
87
|
+
updateThreadStatus(requestId: number, status: 'pending' | 'in_progress' | 'delegated'): Promise<{
|
|
88
88
|
id: number;
|
|
89
89
|
status: string;
|
|
90
90
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const client = new AskMeshClient(URL, TOKEN);
|
|
|
15
15
|
const autoResponder = new AutoResponder(client);
|
|
16
16
|
const server = new McpServer({
|
|
17
17
|
name: 'askmesh',
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.7.0',
|
|
19
19
|
});
|
|
20
20
|
// Single unified tool
|
|
21
21
|
registerAskMesh(server, client);
|