billion-context 0.1.43 → 0.1.44
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 +47 -0
- package/README.zh-CN.md +15 -0
- package/dist/index.js +1477 -503
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +159 -0
- package/dist/mcp.js.map +1 -0
- package/package.json +1 -1
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { createRequire as __biliCreateRequire } from 'node:module';
|
|
2
|
+
const require = __biliCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/mcp.ts
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
var VERSION = (() => {
|
|
9
|
+
try {
|
|
10
|
+
const here = fileURLToPath(import.meta.url);
|
|
11
|
+
const pkg = path.join(path.dirname(here), "..", "package.json");
|
|
12
|
+
return JSON.parse(fs.readFileSync(pkg, "utf8")).version ?? "dev";
|
|
13
|
+
} catch {
|
|
14
|
+
return "dev";
|
|
15
|
+
}
|
|
16
|
+
})();
|
|
17
|
+
var PROXY_ORIGIN = process.env.BILI_MCP_PROXY ?? "http://127.0.0.1:8787";
|
|
18
|
+
var CONVERSATION_FROM_ENV = process.env.CLAUDE_CODE_SESSION_ID?.trim() || process.env.BILI_CONVERSATION_ID?.trim() || void 0;
|
|
19
|
+
var IDENTITY_BINDING = Boolean(process.env.CLAUDE_CODE_SESSION_ID?.trim());
|
|
20
|
+
var manifestTools = [];
|
|
21
|
+
var conversationId = CONVERSATION_FROM_ENV;
|
|
22
|
+
var registered = false;
|
|
23
|
+
var initialized = false;
|
|
24
|
+
function send(msg) {
|
|
25
|
+
process.stdout.write(JSON.stringify(msg) + "\n");
|
|
26
|
+
}
|
|
27
|
+
function sendResult(id, result) {
|
|
28
|
+
if (id === null) return;
|
|
29
|
+
send({ jsonrpc: "2.0", id, result });
|
|
30
|
+
}
|
|
31
|
+
function sendError(id, code, message) {
|
|
32
|
+
if (id === null) return;
|
|
33
|
+
send({ jsonrpc: "2.0", id, error: { code, message } });
|
|
34
|
+
}
|
|
35
|
+
async function fetchManifest() {
|
|
36
|
+
const res = await fetch(`${PROXY_ORIGIN}/__bili/plugin/manifest`);
|
|
37
|
+
if (!res.ok) throw new Error(`manifest fetch failed: ${res.status}`);
|
|
38
|
+
const data = await res.json();
|
|
39
|
+
const anthropic = data.tools?.anthropic ?? [];
|
|
40
|
+
manifestTools = anthropic.map((t) => ({ name: t.name, description: t.description, inputSchema: t.input_schema }));
|
|
41
|
+
if (manifestTools.length === 0) throw new Error("manifest served no anthropic tools");
|
|
42
|
+
}
|
|
43
|
+
async function forwardTool(tool, args) {
|
|
44
|
+
const res = await fetch(`${PROXY_ORIGIN}/__bili/plugin/tool`, {
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: { "content-type": "application/json" },
|
|
47
|
+
body: JSON.stringify({ conversationId, tool, args })
|
|
48
|
+
});
|
|
49
|
+
const data = await res.json();
|
|
50
|
+
if (!res.ok || !data.ok) throw new Error(data.error ?? `tool forward failed: ${res.status}`);
|
|
51
|
+
return data.result ?? "";
|
|
52
|
+
}
|
|
53
|
+
var ERR_TOOL = -32602;
|
|
54
|
+
async function handleMessage(msg) {
|
|
55
|
+
const { id = null, method } = msg;
|
|
56
|
+
const params = typeof msg.params === "object" && msg.params !== null ? msg.params : {};
|
|
57
|
+
switch (method) {
|
|
58
|
+
case "initialize": {
|
|
59
|
+
const fromMeta = params._meta?.ui?.sessionId?.trim();
|
|
60
|
+
if (fromMeta) conversationId ??= fromMeta;
|
|
61
|
+
initialized = true;
|
|
62
|
+
if (conversationId && !registered) {
|
|
63
|
+
const registerFetch = fetch(`${PROXY_ORIGIN}/__bili/plugin/register`, {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers: { "content-type": "application/json" },
|
|
66
|
+
body: JSON.stringify({ conversationId, agent: "mcp", identity: IDENTITY_BINDING })
|
|
67
|
+
});
|
|
68
|
+
registered = true;
|
|
69
|
+
if (IDENTITY_BINDING) {
|
|
70
|
+
void registerFetch.catch(() => {
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
await registerFetch.catch(() => {
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
sendResult(id, {
|
|
78
|
+
protocolVersion: "2025-06-18",
|
|
79
|
+
serverInfo: { name: "bili", version: VERSION },
|
|
80
|
+
capabilities: { tools: {} }
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
case "notifications/initialized":
|
|
85
|
+
return;
|
|
86
|
+
case "tools/list": {
|
|
87
|
+
if (!initialized) {
|
|
88
|
+
sendError(id, -32002, "server not initialized");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
sendResult(id, { tools: manifestTools });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
case "tools/call": {
|
|
95
|
+
const tool = typeof params.name === "string" ? params.name : "";
|
|
96
|
+
const args = params.arguments && typeof params.arguments === "object" ? params.arguments : {};
|
|
97
|
+
if (!tool) {
|
|
98
|
+
sendError(id, ERR_TOOL, "params.name is required");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!conversationId) {
|
|
102
|
+
sendError(id, ERR_TOOL, "no conversation id (set BILI_CONVERSATION_ID or connect via Claude Code MCP session meta)");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const text = await forwardTool(tool, args);
|
|
107
|
+
sendResult(id, { content: [{ type: "text", text }], isError: false });
|
|
108
|
+
} catch (err) {
|
|
109
|
+
sendResult(id, { content: [{ type: "text", text: `bili tool error: ${err instanceof Error ? err.message : String(err)}` }], isError: true });
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
case "ping":
|
|
114
|
+
sendResult(id, {});
|
|
115
|
+
return;
|
|
116
|
+
default:
|
|
117
|
+
if (method?.startsWith("notifications/")) return;
|
|
118
|
+
sendError(id, -32601, `method not found: ${method ?? "(none)"}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function mcpMain() {
|
|
122
|
+
try {
|
|
123
|
+
await fetchManifest();
|
|
124
|
+
} catch (err) {
|
|
125
|
+
console.error(`bili-mcp: ${err instanceof Error ? err.message : String(err)} (proxy at ${PROXY_ORIGIN})`);
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
let buf = "";
|
|
129
|
+
process.stdin.setEncoding("utf8");
|
|
130
|
+
process.stdin.on("data", (chunk) => {
|
|
131
|
+
buf += chunk;
|
|
132
|
+
let nl;
|
|
133
|
+
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
134
|
+
const line = buf.slice(0, nl).trim();
|
|
135
|
+
buf = buf.slice(nl + 1);
|
|
136
|
+
if (!line) continue;
|
|
137
|
+
let parsed;
|
|
138
|
+
try {
|
|
139
|
+
parsed = JSON.parse(line);
|
|
140
|
+
} catch {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (parsed && typeof parsed === "object") {
|
|
144
|
+
void handleMessage(parsed);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
process.stdin.on("end", () => process.exit(0));
|
|
149
|
+
}
|
|
150
|
+
function runMcpStdio() {
|
|
151
|
+
void mcpMain();
|
|
152
|
+
}
|
|
153
|
+
if (process.argv[1] && /(?:^|[\\/])mcp\.(?:ts|js)$/.test(process.argv[1])) {
|
|
154
|
+
void mcpMain();
|
|
155
|
+
}
|
|
156
|
+
export {
|
|
157
|
+
runMcpStdio
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["// MCP stdio thin shell for launcher mode (#162): a single \"bili\" MCP server\n// the hosts load via --mcp-config / -c mcp_servers.bili. It fetches the\n// proxy's plugin manifest (single source of truth — zero schema drift),\n// exposes the 4 ACP tools over stdio JSON-RPC, and forwards executes to\n// POST /__bili/plugin/tool. Claude Code passes its session id via the MCP\n// initialize request's _meta.ui.sessionId (documented SessionStart context);\n// we also accept BILI_CONVERSATION_ID env (codex spawn-time registration).\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst VERSION = (() => {\n try {\n const here = fileURLToPath(import.meta.url);\n const pkg = path.join(path.dirname(here), \"..\", \"package.json\");\n return (JSON.parse(fs.readFileSync(pkg, \"utf8\")).version as string) ?? \"dev\";\n } catch {\n return \"dev\";\n }\n})();\ntype JsonRpcId = string | number | null;\n\ntype McpToolDef = {\n name: string;\n description?: string;\n inputSchema: unknown;\n};\n// Claude Code passes the session id as an env var to MCP children (verified\n// against claude 2.1.227: CLAUDE_CODE_SESSION_ID) — and puts the SAME id on\n// every model request (x-claude-code-session-id), so binding is by identity.\n// BILI_CONVERSATION_ID (launcher-spawned hosts like codex) has no matching\n// request id — binding is headless (next NEW session).\nconst PROXY_ORIGIN = process.env.BILI_MCP_PROXY ?? \"http://127.0.0.1:8787\";\nconst CONVERSATION_FROM_ENV = process.env.CLAUDE_CODE_SESSION_ID?.trim() || process.env.BILI_CONVERSATION_ID?.trim() || undefined;\nconst IDENTITY_BINDING = Boolean(process.env.CLAUDE_CODE_SESSION_ID?.trim());\nlet manifestTools: McpToolDef[] = [];\nlet conversationId = CONVERSATION_FROM_ENV;\nlet registered = false;\nlet initialized = false;\nfunction send(msg: unknown): void {\n process.stdout.write(JSON.stringify(msg) + \"\\n\");\n}\n\nfunction sendResult(id: JsonRpcId, result: unknown): void {\n if (id === null) return; // notification — no response expected\n send({ jsonrpc: \"2.0\", id, result });\n}\n\nfunction sendError(id: JsonRpcId, code: number, message: string): void {\n if (id === null) return;\n send({ jsonrpc: \"2.0\", id, error: { code, message } });\n}\n\nasync function fetchManifest(): Promise<void> {\n const res = await fetch(`${PROXY_ORIGIN}/__bili/plugin/manifest`);\n if (!res.ok) throw new Error(`manifest fetch failed: ${res.status}`);\n const data = (await res.json()) as { tools?: Record<string, { name: string; description?: string; input_schema?: unknown }[]> };\n // Anthropic wire shape is the canonical MCP-compatible schema source.\n const anthropic = data.tools?.anthropic ?? [];\n manifestTools = anthropic.map((t) => ({ name: t.name, description: t.description, inputSchema: t.input_schema }));\n if (manifestTools.length === 0) throw new Error(\"manifest served no anthropic tools\");\n}\n\nasync function forwardTool(tool: string, args: unknown): Promise<string> {\n const res = await fetch(`${PROXY_ORIGIN}/__bili/plugin/tool`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ conversationId, tool, args }),\n });\n const data = (await res.json()) as { ok?: boolean; result?: string; error?: string };\n if (!res.ok || !data.ok) throw new Error(data.error ?? `tool forward failed: ${res.status}`);\n return data.result ?? \"\";\n}\n\nconst ERR_TOOL = -32602;\n\nasync function handleMessage(msg: {\n id?: JsonRpcId;\n method?: string;\n params?: {\n _meta?: { ui?: { sessionId?: string } };\n [k: string]: unknown;\n };\n}): Promise<void> {\n const { id = null, method } = msg;\n const params = typeof msg.params === \"object\" && msg.params !== null ? msg.params : {};\n switch (method) {\n case \"initialize\": {\n // Session id arrives as an env var on the child process (claude)\n // or is injected at spawn time (launcher hosts). The MCP spec\n // guarantees the host waits for this response before calling\n // tools, and claude -p fires its first model request around the\n // same time — registering here is still the earliest we can be.\n // Identity-mode registrations bind on any later request, so the\n // race only matters for headless mode.\n const fromMeta = params._meta?.ui?.sessionId?.trim();\n if (fromMeta) conversationId ??= fromMeta;\n initialized = true;\n if (conversationId && !registered) {\n const registerFetch = fetch(`${PROXY_ORIGIN}/__bili/plugin/register`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ conversationId, agent: \"mcp\", identity: IDENTITY_BINDING }),\n });\n registered = true; // issue-once: a repeated initialize must not re-register\n if (IDENTITY_BINDING) {\n // Identity-mode binding survives any arrival order —\n // respond immediately so pipelined hosts are not stuck\n // behind the register round-trip.\n void registerFetch.catch(() => {});\n } else {\n // Headless binding is order-sensitive: the register MUST\n // land before the host's first model request, and hosts\n // that pipeline tools/list would otherwise race past it.\n await registerFetch.catch(() => {});\n }\n }\n sendResult(id, {\n protocolVersion: \"2025-06-18\",\n serverInfo: { name: \"bili\", version: VERSION },\n capabilities: { tools: {} },\n });\n return;\n }\n case \"notifications/initialized\":\n return;\n case \"tools/list\": {\n if (!initialized) {\n sendError(id, -32002, \"server not initialized\");\n return;\n }\n sendResult(id, { tools: manifestTools });\n return;\n }\n case \"tools/call\": {\n const tool = typeof params.name === \"string\" ? params.name : \"\";\n const args = params.arguments && typeof params.arguments === \"object\" ? params.arguments : {};\n if (!tool) {\n sendError(id, ERR_TOOL, \"params.name is required\");\n return;\n }\n if (!conversationId) {\n sendError(id, ERR_TOOL, \"no conversation id (set BILI_CONVERSATION_ID or connect via Claude Code MCP session meta)\");\n return;\n }\n try {\n const text = await forwardTool(tool, args);\n sendResult(id, { content: [{ type: \"text\", text }], isError: false });\n } catch (err) {\n // Tool-level failures are results (isError), not JSON-RPC\n // errors, so the host surfaces them to the model.\n sendResult(id, { content: [{ type: \"text\", text: `bili tool error: ${err instanceof Error ? err.message : String(err)}` }], isError: true });\n }\n return;\n }\n case \"ping\":\n sendResult(id, {});\n return;\n default:\n if (method?.startsWith(\"notifications/\")) return;\n sendError(id, -32601, `method not found: ${method ?? \"(none)\"}`);\n }\n}\nasync function mcpMain(): Promise<void> {\n try {\n await fetchManifest();\n } catch (err) {\n console.error(`bili-mcp: ${err instanceof Error ? err.message : String(err)} (proxy at ${PROXY_ORIGIN})`);\n process.exit(1);\n }\n let buf = \"\";\n process.stdin.setEncoding(\"utf8\");\n process.stdin.on(\"data\", (chunk: string) => {\n buf += chunk;\n let nl: number;\n while ((nl = buf.indexOf(\"\\n\")) >= 0) {\n const line = buf.slice(0, nl).trim();\n buf = buf.slice(nl + 1);\n if (!line) continue;\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n continue;\n }\n if (parsed && typeof parsed === \"object\") {\n void handleMessage(parsed as Parameters<typeof handleMessage>[0]);\n }\n }\n });\n process.stdin.on(\"end\", () => process.exit(0));\n}\n\n/** CLI entry (`bili mcp`): the stdio loop keeps the process alive. */\nexport function runMcpStdio(): void {\n void mcpMain();\n}\n\n// Direct entry (dist/mcp.js spawned by the injected MCP config, or the ts\n// source under tsx in tests): run only when invoked as the script itself,\n// never when imported by the CLI.\nif (process.argv[1] && /(?:^|[\\\\/])mcp\\.(?:ts|js)$/.test(process.argv[1])) {\n void mcpMain();\n}\n"],"mappings":";;;;AAQA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,IAAM,WAAW,MAAM;AACnB,MAAI;AACA,UAAM,OAAO,cAAc,YAAY,GAAG;AAC1C,UAAM,MAAM,KAAK,KAAK,KAAK,QAAQ,IAAI,GAAG,MAAM,cAAc;AAC9D,WAAQ,KAAK,MAAM,GAAG,aAAa,KAAK,MAAM,CAAC,EAAE,WAAsB;AAAA,EAC3E,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ,GAAG;AAaH,IAAM,eAAe,QAAQ,IAAI,kBAAkB;AACnD,IAAM,wBAAwB,QAAQ,IAAI,wBAAwB,KAAK,KAAK,QAAQ,IAAI,sBAAsB,KAAK,KAAK;AACxH,IAAM,mBAAmB,QAAQ,QAAQ,IAAI,wBAAwB,KAAK,CAAC;AAC3E,IAAI,gBAA8B,CAAC;AACnC,IAAI,iBAAiB;AACrB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,SAAS,KAAK,KAAoB;AAC9B,UAAQ,OAAO,MAAM,KAAK,UAAU,GAAG,IAAI,IAAI;AACnD;AAEA,SAAS,WAAW,IAAe,QAAuB;AACtD,MAAI,OAAO,KAAM;AACjB,OAAK,EAAE,SAAS,OAAO,IAAI,OAAO,CAAC;AACvC;AAEA,SAA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[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "Universal context-compression proxy for AI coding agents. Sits between any agent and its model API, rewriting Anthropic/OpenAI streams with acp-kernel compression. Any agent that can set a base URL (Claude Code, Codex, Cursor, Aider) works out of the box.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|