@noelclaw/mcp 2.2.3 → 2.2.4
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/llm.js +20 -1
- package/package.json +1 -1
package/dist/llm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callLLM = callLLM;
|
|
4
|
+
const wallet_js_1 = require("./wallet.js");
|
|
4
5
|
const ANTHROPIC_URL = "https://api.anthropic.com/v1/messages";
|
|
5
6
|
const BANKR_URL = "https://llm.bankr.bot/v1/chat/completions";
|
|
6
7
|
const CONVEX_SITE = process.env.NOELCLAW_CONVEX_URL ?? "https://api.noelclaw.com";
|
|
@@ -22,9 +23,27 @@ async function callViaConvex(systemPrompt, userPrompt, history, timeoutMs) {
|
|
|
22
23
|
const fullQuestion = systemPrompt
|
|
23
24
|
? `[System: ${systemPrompt}]\n\n${userPrompt}`
|
|
24
25
|
: userPrompt;
|
|
26
|
+
const headers = { "Content-Type": "application/json" };
|
|
27
|
+
const apiKey = process.env.NOELCLAW_API_KEY;
|
|
28
|
+
const sessionToken = process.env.NOELCLAW_SESSION_TOKEN;
|
|
29
|
+
if (apiKey) {
|
|
30
|
+
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
31
|
+
}
|
|
32
|
+
else if (sessionToken) {
|
|
33
|
+
headers["Authorization"] = `Bearer ${sessionToken}`;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
try {
|
|
37
|
+
const { address, signature, timestamp } = await (0, wallet_js_1.signRequest)("ask_noel");
|
|
38
|
+
headers["X-Wallet-Address"] = address;
|
|
39
|
+
headers["X-Wallet-Signature"] = signature;
|
|
40
|
+
headers["X-Wallet-Timestamp"] = timestamp;
|
|
41
|
+
}
|
|
42
|
+
catch { /* proceed without wallet auth */ }
|
|
43
|
+
}
|
|
25
44
|
const res = await fetch(`${CONVEX_SITE}/mcp/chat`, {
|
|
26
45
|
method: "POST",
|
|
27
|
-
headers
|
|
46
|
+
headers,
|
|
28
47
|
body: JSON.stringify({ question: fullQuestion, messages: history }),
|
|
29
48
|
signal: AbortSignal.timeout(timeoutMs),
|
|
30
49
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noelclaw/mcp",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Noelclaw as an MCP skill — persistent memory, multi-agent coordination, scenario simulation, DeFi execution, and Sentinel-gated playbooks.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|