cohvu 2.21.1 → 3.0.0
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/README.md +37 -0
- package/cli.js +15501 -0
- package/package.json +15 -26
- package/dist/__tests__/instruction-file.unit.test.d.ts +0 -1
- package/dist/__tests__/instruction-file.unit.test.js +0 -296
- package/dist/__tests__/instruction-file.unit.test.js.map +0 -1
- package/dist/__tests__/teardown.unit.test.d.ts +0 -1
- package/dist/__tests__/teardown.unit.test.js +0 -196
- package/dist/__tests__/teardown.unit.test.js.map +0 -1
- package/dist/api.d.ts +0 -292
- package/dist/api.js +0 -337
- package/dist/api.js.map +0 -1
- package/dist/auth.d.ts +0 -4
- package/dist/auth.js +0 -96
- package/dist/auth.js.map +0 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -10
- package/dist/constants.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -259
- package/dist/index.js.map +0 -1
- package/dist/instructions.d.ts +0 -33
- package/dist/instructions.js +0 -238
- package/dist/instructions.js.map +0 -1
- package/dist/log.d.ts +0 -6
- package/dist/log.js +0 -51
- package/dist/log.js.map +0 -1
- package/dist/pause.d.ts +0 -3
- package/dist/pause.js +0 -24
- package/dist/pause.js.map +0 -1
- package/dist/platforms.d.ts +0 -22
- package/dist/platforms.js +0 -79
- package/dist/platforms.js.map +0 -1
- package/dist/postinstall.d.ts +0 -2
- package/dist/postinstall.js +0 -11
- package/dist/postinstall.js.map +0 -1
- package/dist/proxy.d.ts +0 -1
- package/dist/proxy.js +0 -371
- package/dist/proxy.js.map +0 -1
- package/dist/setup.d.ts +0 -15
- package/dist/setup.js +0 -295
- package/dist/setup.js.map +0 -1
- package/dist/teardown.d.ts +0 -15
- package/dist/teardown.js +0 -235
- package/dist/teardown.js.map +0 -1
- package/dist/tui/App.d.ts +0 -1
- package/dist/tui/App.js +0 -2245
- package/dist/tui/App.js.map +0 -1
- package/dist/tui/components/Banner.d.ts +0 -4
- package/dist/tui/components/Banner.js +0 -71
- package/dist/tui/components/Banner.js.map +0 -1
- package/dist/tui/components/Divider.d.ts +0 -1
- package/dist/tui/components/Divider.js +0 -8
- package/dist/tui/components/Divider.js.map +0 -1
- package/dist/tui/components/Footer.d.ts +0 -4
- package/dist/tui/components/Footer.js +0 -214
- package/dist/tui/components/Footer.js.map +0 -1
- package/dist/tui/components/Header.d.ts +0 -4
- package/dist/tui/components/Header.js +0 -126
- package/dist/tui/components/Header.js.map +0 -1
- package/dist/tui/components/LockCard.d.ts +0 -17
- package/dist/tui/components/LockCard.js +0 -37
- package/dist/tui/components/LockCard.js.map +0 -1
- package/dist/tui/components/Modal.d.ts +0 -5
- package/dist/tui/components/Modal.js +0 -195
- package/dist/tui/components/Modal.js.map +0 -1
- package/dist/tui/components/TabBar.d.ts +0 -4
- package/dist/tui/components/TabBar.js +0 -17
- package/dist/tui/components/TabBar.js.map +0 -1
- package/dist/tui/components/Toast.d.ts +0 -4
- package/dist/tui/components/Toast.js +0 -9
- package/dist/tui/components/Toast.js.map +0 -1
- package/dist/tui/index.d.ts +0 -1
- package/dist/tui/index.js +0 -20
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/platform-detect.d.ts +0 -2
- package/dist/tui/platform-detect.js +0 -79
- package/dist/tui/platform-detect.js.map +0 -1
- package/dist/tui/state.d.ts +0 -414
- package/dist/tui/state.js +0 -397
- package/dist/tui/state.js.map +0 -1
- package/dist/tui/tabs/BillingTab.d.ts +0 -5
- package/dist/tui/tabs/BillingTab.js +0 -72
- package/dist/tui/tabs/BillingTab.js.map +0 -1
- package/dist/tui/tabs/KeysTab.d.ts +0 -5
- package/dist/tui/tabs/KeysTab.js +0 -87
- package/dist/tui/tabs/KeysTab.js.map +0 -1
- package/dist/tui/tabs/KnowledgeTab.d.ts +0 -5
- package/dist/tui/tabs/KnowledgeTab.js +0 -143
- package/dist/tui/tabs/KnowledgeTab.js.map +0 -1
- package/dist/tui/tabs/ProjectTab.d.ts +0 -5
- package/dist/tui/tabs/ProjectTab.js +0 -34
- package/dist/tui/tabs/ProjectTab.js.map +0 -1
- package/dist/tui/tabs/TeamTab.d.ts +0 -5
- package/dist/tui/tabs/TeamTab.js +0 -57
- package/dist/tui/tabs/TeamTab.js.map +0 -1
- package/dist/tui/tabs/YouTab.d.ts +0 -5
- package/dist/tui/tabs/YouTab.js +0 -25
- package/dist/tui/tabs/YouTab.js.map +0 -1
- package/dist/tui/utils.d.ts +0 -6
- package/dist/tui/utils.js +0 -58
- package/dist/tui/utils.js.map +0 -1
package/dist/proxy.js
DELETED
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
// MCP proxy — thin stateless translator.
|
|
2
|
-
//
|
|
3
|
-
// Agent speaks MCP on stdin. Proxy speaks REST to the backend. No sessions,
|
|
4
|
-
// no state beyond a cached manifest (TTL'd), each tool call is an independent
|
|
5
|
-
// HTTP request.
|
|
6
|
-
//
|
|
7
|
-
// Behaviors worth knowing:
|
|
8
|
-
// - Pause is re-checked on every tool call and list, not just at startup,
|
|
9
|
-
// so `cohvu pause` takes effect mid-session.
|
|
10
|
-
// - The manifest is cached for ~60s and also re-fetched on the first 401/402
|
|
11
|
-
// (permissions may have changed since the editor started).
|
|
12
|
-
// - Error payloads from the backend are parsed to extract `error.message`
|
|
13
|
-
// before being returned to the agent; network errors are translated to a
|
|
14
|
-
// human-readable "server unreachable" message.
|
|
15
|
-
// - Per-editor identity rides on an optional `--agent <name>` CLI arg that
|
|
16
|
-
// platform setup writes into each editor's MCP config. The proxy forwards
|
|
17
|
-
// it as `X-Cohvu-Agent` on every tool call so contribution attribution
|
|
18
|
-
// carries "which of this user's agents acted."
|
|
19
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
20
|
-
import { getApiKey } from "./auth.js";
|
|
21
|
-
import { isPaused } from "./pause.js";
|
|
22
|
-
import { refreshInstructions } from "./setup.js";
|
|
23
|
-
import { DEFAULT_BASE_URL, CLI_VERSION } from "./constants.js";
|
|
24
|
-
import { log } from "./log.js";
|
|
25
|
-
const MANIFEST_TTL_MS = 60_000; // re-fetch at most every minute when cached
|
|
26
|
-
const MANIFEST_FETCH_TIMEOUT_MS = 8_000;
|
|
27
|
-
const TOOL_CALL_TIMEOUT_MS = 60_000;
|
|
28
|
-
/** Extract the `--agent <name>` arg out of process.argv if the platform
|
|
29
|
-
* setup injected it. Falls back to null. Used by every tool call to tell
|
|
30
|
-
* the server which editor initiated the request. */
|
|
31
|
-
function readAgentArg(argv) {
|
|
32
|
-
const idx = argv.indexOf("--agent");
|
|
33
|
-
if (idx === -1 || idx === argv.length - 1)
|
|
34
|
-
return null;
|
|
35
|
-
const value = argv[idx + 1]?.trim();
|
|
36
|
-
return value && value.length > 0 ? value : null;
|
|
37
|
-
}
|
|
38
|
-
/** Best-effort extraction of a user-friendly message from a backend error
|
|
39
|
-
* body. The canonical shape is `{error: {code, message}}`. We surface
|
|
40
|
-
* `message`; on parse failure we fall back to the raw body. */
|
|
41
|
-
function extractBackendErrorMessage(body) {
|
|
42
|
-
try {
|
|
43
|
-
const parsed = JSON.parse(body);
|
|
44
|
-
if (parsed.error?.message)
|
|
45
|
-
return parsed.error.message;
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// not JSON; fall through
|
|
49
|
-
}
|
|
50
|
-
return body || "Unknown error";
|
|
51
|
-
}
|
|
52
|
-
/** Map a fetch-level failure (network error, DNS failure, connection
|
|
53
|
-
* refused) to something the agent can read. */
|
|
54
|
-
function translateNetworkError(err) {
|
|
55
|
-
if (err instanceof Error) {
|
|
56
|
-
const msg = err.message || "";
|
|
57
|
-
if (msg.includes("abort") || msg.includes("timeout") || err.name === "TimeoutError") {
|
|
58
|
-
return "Cohvu server didn't respond in time. Try again in a moment.";
|
|
59
|
-
}
|
|
60
|
-
if (msg.includes("fetch") || msg.includes("ECONNREFUSED") || msg.includes("ENOTFOUND")) {
|
|
61
|
-
return "Cohvu server unreachable. Check your connection and try again.";
|
|
62
|
-
}
|
|
63
|
-
return msg;
|
|
64
|
-
}
|
|
65
|
-
return "Cohvu server unreachable. Check your connection and try again.";
|
|
66
|
-
}
|
|
67
|
-
export async function proxy() {
|
|
68
|
-
const baseUrl = process.env.COHVU_API_URL ?? DEFAULT_BASE_URL;
|
|
69
|
-
const agentName = readAgentArg(process.argv);
|
|
70
|
-
// Catch-all handlers so async faults leave a trail before the process
|
|
71
|
-
// exits. Without these, an unhandled rejection looks to the editor like
|
|
72
|
-
// "MCP server disconnected" with no explanation in our logs.
|
|
73
|
-
process.on("uncaughtException", (err) => {
|
|
74
|
-
log.error("proxy_uncaught_exception", { error: err.message, stack: err.stack });
|
|
75
|
-
});
|
|
76
|
-
process.on("unhandledRejection", (reason) => {
|
|
77
|
-
log.error("proxy_unhandled_rejection", { error: String(reason) });
|
|
78
|
-
});
|
|
79
|
-
// Always refresh editor instruction files — works whether or not we're
|
|
80
|
-
// signed in, so users who upgrade the CLI while paused or signed-out
|
|
81
|
-
// still get up-to-date rules/markdown on their editor's next read.
|
|
82
|
-
refreshInstructions();
|
|
83
|
-
log.info("proxy_start", { version: CLI_VERSION, agent: agentName ?? null });
|
|
84
|
-
const apiKey = getApiKey();
|
|
85
|
-
if (!apiKey) {
|
|
86
|
-
log.info("proxy_unauthenticated");
|
|
87
|
-
await runSimpleResponder({
|
|
88
|
-
initResult: buildInitResult(null, "Cohvu is not connected. Run `cohvu` in your terminal to sign in."),
|
|
89
|
-
toolsListResult: { tools: [] },
|
|
90
|
-
callToolError: {
|
|
91
|
-
code: -32600,
|
|
92
|
-
message: "Cohvu is not connected. Run `cohvu` in your terminal to sign in.",
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const authHeader = `Bearer ${apiKey}`;
|
|
98
|
-
if (isPaused()) {
|
|
99
|
-
log.info("proxy_paused_at_start");
|
|
100
|
-
await runSimpleResponder({
|
|
101
|
-
initResult: buildInitResult(null, "Cohvu is paused. The developer has temporarily disabled Cohvu. Do not attempt to use understand or contribute."),
|
|
102
|
-
toolsListResult: { tools: [] },
|
|
103
|
-
callToolError: { code: -32600, message: "Cohvu is paused." },
|
|
104
|
-
});
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
// Fetch manifest. Total wait across retries is capped around 15s so we
|
|
108
|
-
// respond inside the typical MCP client `initialize` timeout (~30s). If
|
|
109
|
-
// we blow past the cap, we still serve a fallback init response rather
|
|
110
|
-
// than keeping the editor hanging.
|
|
111
|
-
let manifest = null;
|
|
112
|
-
let manifestFetchedAt = 0;
|
|
113
|
-
async function fetchManifest() {
|
|
114
|
-
try {
|
|
115
|
-
const res = await fetch(`${baseUrl}/v1/tools/manifest`, {
|
|
116
|
-
headers: { Authorization: authHeader },
|
|
117
|
-
signal: AbortSignal.timeout(MANIFEST_FETCH_TIMEOUT_MS),
|
|
118
|
-
});
|
|
119
|
-
if (res.ok) {
|
|
120
|
-
const parsed = (await res.json());
|
|
121
|
-
manifestFetchedAt = Date.now();
|
|
122
|
-
return parsed;
|
|
123
|
-
}
|
|
124
|
-
log.warn("manifest_fetch_status", { status: res.status });
|
|
125
|
-
}
|
|
126
|
-
catch (err) {
|
|
127
|
-
log.warn("manifest_fetch_error", { error: String(err) });
|
|
128
|
-
}
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
/** Re-fetch if cache is stale OR we have no manifest OR caller wants
|
|
132
|
-
* a forced refresh (e.g., after a 401/402 suggesting permissions
|
|
133
|
-
* changed server-side). */
|
|
134
|
-
async function ensureManifest(reason, force = false) {
|
|
135
|
-
if (!force && manifest && Date.now() - manifestFetchedAt < MANIFEST_TTL_MS) {
|
|
136
|
-
return manifest;
|
|
137
|
-
}
|
|
138
|
-
const fresh = await fetchManifest();
|
|
139
|
-
if (fresh) {
|
|
140
|
-
manifest = fresh;
|
|
141
|
-
log.debug("manifest_refreshed", { tool_count: fresh.tools.length, reason });
|
|
142
|
-
}
|
|
143
|
-
return manifest;
|
|
144
|
-
}
|
|
145
|
-
// Startup retry loop with a hard cap on total wait. Backoff: 500ms, 1s,
|
|
146
|
-
// 2s, 4s, 7s → ~14.5s total across 5 attempts.
|
|
147
|
-
const startupDelays = [500, 1000, 2000, 4000, 7000];
|
|
148
|
-
for (let i = 0; i < startupDelays.length; i++) {
|
|
149
|
-
manifest = await fetchManifest();
|
|
150
|
-
if (manifest)
|
|
151
|
-
break;
|
|
152
|
-
await new Promise((r) => setTimeout(r, startupDelays[i]));
|
|
153
|
-
}
|
|
154
|
-
if (!manifest) {
|
|
155
|
-
log.error("manifest_unavailable_at_start");
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
log.info("manifest_ready", { tool_count: manifest.tools.length });
|
|
159
|
-
}
|
|
160
|
-
const fallbackInstructions = "Cohvu could not connect to the server. Restart your editor to retry.";
|
|
161
|
-
// Call the backend tool endpoint. Inspects pause state first (so
|
|
162
|
-
// `cohvu pause` mid-session takes effect), parses backend error bodies,
|
|
163
|
-
// translates network failures, and re-fetches the manifest on 401/402
|
|
164
|
-
// so the agent's next tools/list reflects current permissions.
|
|
165
|
-
async function callTool(name, args) {
|
|
166
|
-
// Mid-session pause check — editors don't reconnect on pause, so the
|
|
167
|
-
// in-flight proxy has to honor it at call time.
|
|
168
|
-
if (isPaused()) {
|
|
169
|
-
log.info("tool_call_refused_paused", { tool: name });
|
|
170
|
-
return {
|
|
171
|
-
content: [{ type: "text", text: "Cohvu is paused." }],
|
|
172
|
-
isError: true,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
const start = Date.now();
|
|
176
|
-
let res;
|
|
177
|
-
try {
|
|
178
|
-
res = await fetch(`${baseUrl}/v1/tools/call`, {
|
|
179
|
-
method: "POST",
|
|
180
|
-
headers: {
|
|
181
|
-
"Content-Type": "application/json",
|
|
182
|
-
Authorization: authHeader,
|
|
183
|
-
...(agentName ? { "X-Cohvu-Agent": agentName } : {}),
|
|
184
|
-
},
|
|
185
|
-
body: JSON.stringify({ tool: name, arguments: args }),
|
|
186
|
-
signal: AbortSignal.timeout(TOOL_CALL_TIMEOUT_MS),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
catch (err) {
|
|
190
|
-
const message = translateNetworkError(err);
|
|
191
|
-
log.error("tool_call_network_error", { tool: name, error: String(err) });
|
|
192
|
-
return {
|
|
193
|
-
content: [{ type: "text", text: message }],
|
|
194
|
-
isError: true,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
const durationMs = Date.now() - start;
|
|
198
|
-
if (!res.ok) {
|
|
199
|
-
const body = await res.text().catch(() => "");
|
|
200
|
-
let message = extractBackendErrorMessage(body);
|
|
201
|
-
// Specific status-based UX messages. The agent relays these to the
|
|
202
|
-
// user, so they need to be human-actionable.
|
|
203
|
-
if (res.status === 401) {
|
|
204
|
-
message = "Cohvu session expired. Run `cohvu` in your terminal to sign in again.";
|
|
205
|
-
}
|
|
206
|
-
// Permissions may have changed — invalidate the cached manifest so
|
|
207
|
-
// the agent's next tools/list is accurate.
|
|
208
|
-
if (res.status === 401 || res.status === 402 || res.status === 403) {
|
|
209
|
-
void ensureManifest(`status_${res.status}`, true).catch((err) => {
|
|
210
|
-
log.debug("manifest_refresh_rejected", { error: String(err) });
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
log.warn("tool_call_backend_error", {
|
|
214
|
-
tool: name,
|
|
215
|
-
status: res.status,
|
|
216
|
-
duration_ms: durationMs,
|
|
217
|
-
message,
|
|
218
|
-
});
|
|
219
|
-
return {
|
|
220
|
-
content: [{ type: "text", text: message }],
|
|
221
|
-
isError: true,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
log.debug("tool_call_ok", { tool: name, duration_ms: durationMs });
|
|
225
|
-
return await res.json();
|
|
226
|
-
}
|
|
227
|
-
const transport = new StdioServerTransport();
|
|
228
|
-
transport.onmessage = async (message) => {
|
|
229
|
-
const msg = message;
|
|
230
|
-
if (msg.id === undefined)
|
|
231
|
-
return;
|
|
232
|
-
try {
|
|
233
|
-
switch (msg.method) {
|
|
234
|
-
case "initialize": {
|
|
235
|
-
// Always force-refresh the manifest at the start of every session.
|
|
236
|
-
// Editors that keep the MCP proxy alive across session rebounds
|
|
237
|
-
// would otherwise serve the manifest we captured at process start
|
|
238
|
-
// — which, if the server has since updated instructions or the
|
|
239
|
-
// caller's permissions have changed, would be stale. Cost: one
|
|
240
|
-
// extra HTTP call at handshake. Benefit: every new session sees
|
|
241
|
-
// current instructions and tool descriptions.
|
|
242
|
-
//
|
|
243
|
-
// Also re-run refreshInstructions so any editor-local markdown
|
|
244
|
-
// (CLAUDE.md, .cursorrules, etc.) gets rewritten to match the
|
|
245
|
-
// current CLI's content.
|
|
246
|
-
refreshInstructions();
|
|
247
|
-
const fresh = await ensureManifest("initialize", true);
|
|
248
|
-
const currentInit = buildInitResult(fresh ?? manifest, (fresh ?? manifest) ? (fresh ?? manifest).instructions : fallbackInstructions);
|
|
249
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: currentInit });
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
case "tools/list": {
|
|
253
|
-
// Pause is live — an editor asking for the tool list while the
|
|
254
|
-
// user is paused should see an empty list so the agent doesn't
|
|
255
|
-
// try to call anything and get rejections.
|
|
256
|
-
if (isPaused()) {
|
|
257
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: { tools: [] } });
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
const m = await ensureManifest("tools_list");
|
|
261
|
-
await transport.send({
|
|
262
|
-
jsonrpc: "2.0",
|
|
263
|
-
id: msg.id,
|
|
264
|
-
result: {
|
|
265
|
-
tools: (m ?? manifest)?.tools.map((t) => ({
|
|
266
|
-
name: t.name,
|
|
267
|
-
description: t.description,
|
|
268
|
-
inputSchema: t.inputSchema,
|
|
269
|
-
})) ?? [],
|
|
270
|
-
},
|
|
271
|
-
});
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
case "ping":
|
|
275
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: {} });
|
|
276
|
-
break;
|
|
277
|
-
case "tools/call": {
|
|
278
|
-
// If we never got a manifest, try once more — the backend may
|
|
279
|
-
// have come back online since startup.
|
|
280
|
-
if (!manifest) {
|
|
281
|
-
await ensureManifest("tools_call_no_manifest", true);
|
|
282
|
-
}
|
|
283
|
-
if (!manifest) {
|
|
284
|
-
await transport.send({
|
|
285
|
-
jsonrpc: "2.0",
|
|
286
|
-
id: msg.id,
|
|
287
|
-
error: {
|
|
288
|
-
code: -32603,
|
|
289
|
-
message: "Cohvu could not connect to the server. Restart your editor to retry.",
|
|
290
|
-
},
|
|
291
|
-
});
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
const params = msg.params;
|
|
295
|
-
const result = await callTool(params.name, params.arguments ?? {});
|
|
296
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: result });
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
default:
|
|
300
|
-
log.warn("mcp_unknown_method", { method: msg.method });
|
|
301
|
-
await transport.send({
|
|
302
|
-
jsonrpc: "2.0",
|
|
303
|
-
id: msg.id,
|
|
304
|
-
error: { code: -32601, message: `Method not found: ${msg.method}` },
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
catch (err) {
|
|
309
|
-
log.error("message_handler_error", { method: msg.method, error: String(err) });
|
|
310
|
-
await transport.send({
|
|
311
|
-
jsonrpc: "2.0",
|
|
312
|
-
id: msg.id,
|
|
313
|
-
error: {
|
|
314
|
-
code: -32603,
|
|
315
|
-
message: err instanceof Error ? err.message : "Internal error",
|
|
316
|
-
},
|
|
317
|
-
}).catch((sendErr) => {
|
|
318
|
-
log.debug("error_response_send_failed", { method: msg.method, error: String(sendErr) });
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
transport.onclose = () => {
|
|
323
|
-
log.info("proxy_close");
|
|
324
|
-
process.exit(0);
|
|
325
|
-
};
|
|
326
|
-
await transport.start();
|
|
327
|
-
}
|
|
328
|
-
/** Used by the paused and unauthenticated branches — the proxy still needs
|
|
329
|
-
* to speak valid MCP so the editor doesn't choke; we just return a
|
|
330
|
-
* working server with no tools plus a clear `initialize` message. */
|
|
331
|
-
async function runSimpleResponder(opts) {
|
|
332
|
-
const transport = new StdioServerTransport();
|
|
333
|
-
transport.onmessage = async (message) => {
|
|
334
|
-
const msg = message;
|
|
335
|
-
if (msg.id === undefined)
|
|
336
|
-
return;
|
|
337
|
-
switch (msg.method) {
|
|
338
|
-
case "initialize":
|
|
339
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: opts.initResult });
|
|
340
|
-
break;
|
|
341
|
-
case "tools/list":
|
|
342
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: opts.toolsListResult });
|
|
343
|
-
break;
|
|
344
|
-
case "ping":
|
|
345
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, result: {} });
|
|
346
|
-
break;
|
|
347
|
-
default:
|
|
348
|
-
// Only log as "unknown method" if it's NOT a tools/call — tools/call
|
|
349
|
-
// in the simple responder is the expected path for paused/unauth
|
|
350
|
-
// states and the rejection is deliberate, not an unknown method.
|
|
351
|
-
if (msg.method !== "tools/call") {
|
|
352
|
-
log.warn("mcp_unknown_method", { method: msg.method, state: "simple_responder" });
|
|
353
|
-
}
|
|
354
|
-
await transport.send({ jsonrpc: "2.0", id: msg.id, error: opts.callToolError });
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
transport.onclose = () => {
|
|
358
|
-
log.info("proxy_close");
|
|
359
|
-
process.exit(0);
|
|
360
|
-
};
|
|
361
|
-
await transport.start();
|
|
362
|
-
}
|
|
363
|
-
function buildInitResult(manifest, instructions) {
|
|
364
|
-
return {
|
|
365
|
-
protocolVersion: "2025-03-26",
|
|
366
|
-
capabilities: { tools: {} },
|
|
367
|
-
serverInfo: manifest?.serverInfo ?? { name: "cohvu", version: CLI_VERSION },
|
|
368
|
-
instructions,
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
//# sourceMappingURL=proxy.js.map
|
package/dist/proxy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,gBAAgB;AAChB,EAAE;AACF,2BAA2B;AAC3B,4EAA4E;AAC5E,iDAAiD;AACjD,+EAA+E;AAC/E,+DAA+D;AAC/D,4EAA4E;AAC5E,6EAA6E;AAC7E,mDAAmD;AACnD,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,mDAAmD;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAY/B,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,4CAA4C;AAC5E,MAAM,yBAAyB,GAAG,KAAK,CAAC;AACxC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;qDAEqD;AACrD,SAAS,YAAY,CAAC,IAAc;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACpC,OAAO,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ACD,MAAM,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAc,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,CAAC;IACF,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;QACvB,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IACF,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,eAAe,CAAC,QAAyB,EAAE,YAAoB;IACtE,OAAO;QACL,eAAe,EAAE,YAAY;QAC7B,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3B,UAAU,EAAE,QAAQ,EAAE,UAAU,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE;QAC3E,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/setup.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type StepResult = "ok" | "skipped" | {
|
|
2
|
-
failed: string;
|
|
3
|
-
};
|
|
4
|
-
interface PlatformResult {
|
|
5
|
-
name: string;
|
|
6
|
-
mcp: StepResult | null;
|
|
7
|
-
instructions: StepResult | null;
|
|
8
|
-
permissions: StepResult | null;
|
|
9
|
-
}
|
|
10
|
-
export interface SetupResult {
|
|
11
|
-
platforms: PlatformResult[];
|
|
12
|
-
}
|
|
13
|
-
export declare function runSetup(): Promise<SetupResult>;
|
|
14
|
-
export declare function refreshInstructions(): void;
|
|
15
|
-
export {};
|