@sellable/install 0.1.810 → 0.1.813
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/container/Dockerfile +7 -7
- package/container/README.md +1 -1
- package/lib/sellable-agent/external-runtime-builder.mjs +1 -1
- package/lib/sellable-agent/fly-admin-image/Dockerfile +1 -2
- package/lib/sellable-agent/fly-admin-image/admin-runtime.mjs +1 -48
- package/lib/sellable-agent/fly-customer-image/Dockerfile +3 -3
- package/lib/sellable-agent/fly-customer-image/claude-code-runs-api.d.mts +16 -39
- package/lib/sellable-agent/fly-customer-image/claude-code-runs-api.mjs +75 -240
- package/lib/sellable-agent/fly-customer-image/customer-runtime.mjs +70 -22
- package/lib/sellable-agent/fly-customer-image/endpoint-model-selection.d.mts +1 -0
- package/lib/sellable-agent/fly-customer-image/endpoint-model-selection.mjs +11 -15
- package/lib/sellable-agent/fly-customer-image/runs-api-connections.d.mts +1 -25
- package/lib/sellable-agent/fly-customer-image/runs-api-connections.mjs +9 -237
- package/lib/sellable-agent/fly-customer-image/runs-api-health-check.mjs +12 -153
- package/lib/sellable-agent/fly-runtime-identity.mjs +5 -2
- package/lib/sellable-agent/host-bootstrap.mjs +2 -2
- package/lib/sellable-agent/host-worker.mjs +2 -2
- package/lib/sellable-agent/profile-materializer.mjs +2 -2
- package/lib/sellable-agent/provisioning-adapter.mjs +2 -2
- package/package.json +1 -1
- package/lib/sellable-agent/fly-customer-image/claude-code-mcp-session.d.mts +0 -1
- package/lib/sellable-agent/fly-customer-image/claude-code-mcp-session.mjs +0 -53
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Claude Code's only MCP server for a tool-lane run. It starts the profile's
|
|
2
|
-
// own `sellable` server (the context proxy, with exactly its configured
|
|
3
|
-
// environment) and adds this run's endpoint session to every tools/list and
|
|
4
|
-
// tools/call. The proxy then loads the run's signed turn descriptor, lists
|
|
5
|
-
// only the run's allowed tools and stamps the run identity on each call; the
|
|
6
|
-
// backend checks it again. Nothing in this file grants anything.
|
|
7
|
-
import { spawn } from "node:child_process";
|
|
8
|
-
import { readFileSync } from "node:fs";
|
|
9
|
-
import { createInterface } from "node:readline";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
|
-
|
|
12
|
-
export function tagEndpointSession(line, sessionId) {
|
|
13
|
-
let message;
|
|
14
|
-
try {
|
|
15
|
-
message = JSON.parse(line);
|
|
16
|
-
} catch {
|
|
17
|
-
return line;
|
|
18
|
-
}
|
|
19
|
-
if (
|
|
20
|
-
!message ||
|
|
21
|
-
typeof message !== "object" ||
|
|
22
|
-
!["tools/list", "tools/call"].includes(message.method)
|
|
23
|
-
)
|
|
24
|
-
return line;
|
|
25
|
-
const params =
|
|
26
|
-
message.params && typeof message.params === "object" ? message.params : {};
|
|
27
|
-
// The proxy accepts exactly this shape and nothing else in _meta.
|
|
28
|
-
return JSON.stringify({
|
|
29
|
-
...message,
|
|
30
|
-
params: { ...params, _meta: { sellableEndpoint: { sessionId } } },
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function main(specPath) {
|
|
35
|
-
const spec = JSON.parse(readFileSync(specPath, "utf8"));
|
|
36
|
-
if (!/^sellable_endpoint_[a-f0-9]{32}$/.test(spec.sessionId ?? ""))
|
|
37
|
-
throw new Error("claude_runs_mcp_session_rejected");
|
|
38
|
-
const child = spawn(spec.command, spec.args, {
|
|
39
|
-
stdio: ["pipe", "inherit", "ignore"],
|
|
40
|
-
env: spec.env,
|
|
41
|
-
});
|
|
42
|
-
child.once("exit", (code) => process.exit(code ?? 1));
|
|
43
|
-
child.stdin.on("error", () => {});
|
|
44
|
-
const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
45
|
-
lines.on("line", (line) =>
|
|
46
|
-
child.stdin.write(`${tagEndpointSession(line, spec.sessionId)}\n`)
|
|
47
|
-
);
|
|
48
|
-
lines.on("close", () => child.stdin.end());
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
52
|
-
main(process.argv[2]);
|
|
53
|
-
}
|