ramwisp 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/account.js +5 -1
- package/src/mcp.js +3 -2
package/package.json
CHANGED
package/src/account.js
CHANGED
|
@@ -36,10 +36,14 @@ export function logout() {
|
|
|
36
36
|
if (existsSync(CRED)) rmSync(CRED);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
let client = "cli";
|
|
40
|
+
/** Quem está usando o MCP (vem do clientInfo do initialize: "claude-code", "codex-mcp-client"…). */
|
|
41
|
+
export function setClient(name) { if (name) client = String(name).slice(0, 60); }
|
|
42
|
+
|
|
39
43
|
export async function call(method, path, body, { token = getToken(), timeoutMs = 30_000 } = {}) {
|
|
40
44
|
const r = await fetch(API + path, {
|
|
41
45
|
method,
|
|
42
|
-
headers: { "Content-Type": "application/json", ...(token ? { Authorization: `Bearer ${token}` } : {}) },
|
|
46
|
+
headers: { "Content-Type": "application/json", "X-Wisp-Client": client, ...(token ? { Authorization: `Bearer ${token}` } : {}) },
|
|
43
47
|
body: body === undefined ? undefined : JSON.stringify(body),
|
|
44
48
|
signal: AbortSignal.timeout(timeoutMs),
|
|
45
49
|
});
|
package/src/mcp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Servidor MCP (stdio, JSON-RPC por linha). Sem dependências.
|
|
2
2
|
import { createInterface } from "node:readline";
|
|
3
|
-
import { API, getToken, startLogin } from "./account.js";
|
|
3
|
+
import { API, getToken, setClient, startLogin } from "./account.js";
|
|
4
4
|
import { LoginRequired, killAgent, listAgents, result, spawnAgent, waitAgent } from "./client.js";
|
|
5
5
|
|
|
6
6
|
const PROTOCOLS = ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
7
|
-
const VERSION = "0.1.
|
|
7
|
+
const VERSION = "0.1.3";
|
|
8
8
|
|
|
9
9
|
const INSTRUCTIONS = `wisp roda subagentes Claude Code ou Codex em máquinas efêmeras na nuvem, com a RAM que você pedir,
|
|
10
10
|
sem pesar esta máquina. Cada subagente nasce numa enclave isolada (AWS Nitro): antes de mandar qualquer coisa,
|
|
@@ -99,6 +99,7 @@ export function serve() {
|
|
|
99
99
|
try {
|
|
100
100
|
let res;
|
|
101
101
|
if (method === "initialize") {
|
|
102
|
+
setClient(params?.clientInfo?.name ?? "mcp");
|
|
102
103
|
const v = PROTOCOLS.includes(params?.protocolVersion) ? params.protocolVersion : PROTOCOLS[0];
|
|
103
104
|
res = { protocolVersion: v, capabilities: { tools: {} }, serverInfo: { name: "ramwisp", version: VERSION }, instructions: INSTRUCTIONS };
|
|
104
105
|
} else if (method === "tools/list") {
|