lorenz 0.1.5 → 0.1.6
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 +83 -20
- package/RELEASE-MANIFEST.json +6 -1
- package/node_modules/@lorenz/agent-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/agent-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/agent-sdk/dist/module.d.ts +38 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.js +41 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts +30 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js +63 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemon.d.ts +42 -19
- package/node_modules/@lorenz/cli/dist/daemon.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/daemon.js +72 -23
- package/node_modules/@lorenz/cli/dist/daemon.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/daemonLock.d.ts +59 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.js +304 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts +16 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.js +21 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/doctor.d.ts +6 -0
- package/node_modules/@lorenz/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/doctor.js +38 -1
- package/node_modules/@lorenz/cli/dist/doctor.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts +126 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.js +187 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts +42 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.js +67 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/index.d.ts +6 -0
- package/node_modules/@lorenz/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/index.js +4 -0
- package/node_modules/@lorenz/cli/dist/index.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts +42 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.js +2 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/main.d.ts +11 -7
- package/node_modules/@lorenz/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/main.js +58 -8
- package/node_modules/@lorenz/cli/dist/main.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/toolLoader.d.ts +28 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.js +62 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts +24 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.js +34 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts +15 -55
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.js +26 -203
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.js.map +1 -1
- package/node_modules/@lorenz/cli/package.json +1 -0
- package/node_modules/@lorenz/config/dist/index.d.ts +1 -1
- package/node_modules/@lorenz/config/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/index.js +1 -1
- package/node_modules/@lorenz/config/dist/index.js.map +1 -1
- package/node_modules/@lorenz/config/dist/parse.d.ts +17 -0
- package/node_modules/@lorenz/config/dist/parse.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/parse.js +107 -11
- package/node_modules/@lorenz/config/dist/parse.js.map +1 -1
- package/node_modules/@lorenz/config/dist/schemas.d.ts +0 -2
- package/node_modules/@lorenz/config/dist/schemas.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/schemas.js +5 -1
- package/node_modules/@lorenz/config/dist/schemas.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts +55 -21
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js +187 -82
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts +6 -4
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js +9 -6
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.js +5 -6
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts +7 -5
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js +12 -10
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts +11 -10
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js +15 -22
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts +16 -15
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.js +6 -7
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.js.map +1 -1
- package/node_modules/@lorenz/domain/dist/index.d.ts +75 -9
- package/node_modules/@lorenz/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/domain/dist/index.js +40 -0
- package/node_modules/@lorenz/domain/dist/index.js.map +1 -1
- package/node_modules/@lorenz/flags/dist/coerce.d.ts +12 -0
- package/node_modules/@lorenz/flags/dist/coerce.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/coerce.js +44 -0
- package/node_modules/@lorenz/flags/dist/coerce.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/default.d.ts +6 -0
- package/node_modules/@lorenz/flags/dist/default.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/default.js +22 -0
- package/node_modules/@lorenz/flags/dist/default.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/deprecations.d.ts +20 -0
- package/node_modules/@lorenz/flags/dist/deprecations.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/deprecations.js +42 -0
- package/node_modules/@lorenz/flags/dist/deprecations.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/env.d.ts +17 -0
- package/node_modules/@lorenz/flags/dist/env.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/env.js +90 -0
- package/node_modules/@lorenz/flags/dist/env.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/errors.d.ts +22 -0
- package/node_modules/@lorenz/flags/dist/errors.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/errors.js +61 -0
- package/node_modules/@lorenz/flags/dist/errors.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/index.d.ts +8 -0
- package/node_modules/@lorenz/flags/dist/index.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/index.js +11 -0
- package/node_modules/@lorenz/flags/dist/index.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/keys.d.ts +6 -0
- package/node_modules/@lorenz/flags/dist/keys.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/keys.js +15 -0
- package/node_modules/@lorenz/flags/dist/keys.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/layers.d.ts +14 -0
- package/node_modules/@lorenz/flags/dist/layers.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/layers.js +107 -0
- package/node_modules/@lorenz/flags/dist/layers.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/manifest.d.ts +71 -0
- package/node_modules/@lorenz/flags/dist/manifest.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/manifest.js +137 -0
- package/node_modules/@lorenz/flags/dist/manifest.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/resolve.d.ts +8 -0
- package/node_modules/@lorenz/flags/dist/resolve.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/resolve.js +178 -0
- package/node_modules/@lorenz/flags/dist/resolve.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/testing.d.ts +19 -0
- package/node_modules/@lorenz/flags/dist/testing.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/testing.js +68 -0
- package/node_modules/@lorenz/flags/dist/testing.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/types.d.ts +93 -0
- package/node_modules/@lorenz/flags/dist/types.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/types.js +2 -0
- package/node_modules/@lorenz/flags/dist/types.js.map +1 -0
- package/node_modules/@lorenz/flags/package.json +16 -0
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts +16 -3
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.js +105 -17
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/auth.d.ts +88 -0
- package/node_modules/@lorenz/mcp/dist/auth.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/auth.js +53 -0
- package/node_modules/@lorenz/mcp/dist/auth.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/index.d.ts +3 -2
- package/node_modules/@lorenz/mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/index.js +1 -1
- package/node_modules/@lorenz/mcp/dist/index.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/server.d.ts +22 -0
- package/node_modules/@lorenz/mcp/dist/server.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/server.js +85 -12
- package/node_modules/@lorenz/mcp/dist/server.js.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts +157 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.js +621 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.d.ts +38 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.js +176 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/index.d.ts +55 -51
- package/node_modules/@lorenz/orchestrator/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/index.js +285 -45
- package/node_modules/@lorenz/orchestrator/dist/index.js.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts +34 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.js +142 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/state.d.ts +47 -0
- package/node_modules/@lorenz/orchestrator/dist/state.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/state.js +15 -0
- package/node_modules/@lorenz/orchestrator/dist/state.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.d.ts +28 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.js +125 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/package.json +6 -2
- package/node_modules/@lorenz/presenter/dist/index.d.ts +14 -0
- package/node_modules/@lorenz/presenter/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/presenter/dist/index.js +18 -0
- package/node_modules/@lorenz/presenter/dist/index.js.map +1 -1
- package/node_modules/@lorenz/projections/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/projections/dist/index.js +1 -0
- package/node_modules/@lorenz/projections/dist/index.js.map +1 -1
- package/node_modules/@lorenz/runtime/dist/index.d.ts +27 -8
- package/node_modules/@lorenz/runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/runtime/dist/index.js +422 -98
- package/node_modules/@lorenz/runtime/dist/index.js.map +1 -1
- package/node_modules/@lorenz/runtime-events/dist/index.d.ts +14 -0
- package/node_modules/@lorenz/runtime-events/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/ssh/dist/index.d.ts +2 -0
- package/node_modules/@lorenz/ssh/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/ssh/dist/index.js +2 -1
- package/node_modules/@lorenz/ssh/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/module.d.ts +38 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.js +42 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/tracker-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts +37 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.js +38 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts +34 -6
- package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-host-pool/dist/index.js +110 -143
- package/node_modules/@lorenz/worker-host-pool/dist/index.js.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/local.d.ts +74 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.d.ts.map +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.js +112 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.js.map +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/module.d.ts +8 -16
- package/node_modules/@lorenz/worker-sdk/dist/module.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/module.js +15 -35
- package/node_modules/@lorenz/worker-sdk/dist/module.js.map +1 -1
- package/node_modules/@lorenz/workflow/dist/index.d.ts +11 -0
- package/node_modules/@lorenz/workflow/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/workflow/dist/index.js +3 -0
- package/node_modules/@lorenz/workflow/dist/index.js.map +1 -1
- package/package.json +4 -1
|
@@ -4,9 +4,15 @@ import { match } from "ts-pattern";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { httpUrlHost, isRecord, normalizeHttpBindHost } from "@lorenz/domain";
|
|
6
6
|
import { defaultToolRegistry } from "@lorenz/tool-sdk";
|
|
7
|
-
import { createMcpAuthScope, mcpAuthScopeForSettings, validMcpToken } from "./auth.js";
|
|
7
|
+
import { checkRunClaim, createMcpAuthScope, mcpAuthScopeForSettings, resolveRunClaim, validMcpToken, } from "./auth.js";
|
|
8
8
|
import { executeTool, toolSpecs } from "./tools.js";
|
|
9
|
+
const defaultIsRunLive = () => false;
|
|
9
10
|
const mcpPath = "/mcp";
|
|
11
|
+
// The claim middleware stashes the request body it already parsed here, keyed by
|
|
12
|
+
// the underlying `Request`, so `handleMcp` reads it back instead of re-parsing -
|
|
13
|
+
// the JSON is parsed once per request. A WeakMap avoids typing the untyped Hono
|
|
14
|
+
// app's context store and lets the entry be collected with the request.
|
|
15
|
+
const parsedRequestBodies = new WeakMap();
|
|
10
16
|
export async function startMcpServer(settings, options) {
|
|
11
17
|
const app = new Hono();
|
|
12
18
|
const bindHost = normalizeHttpBindHost(options.host);
|
|
@@ -14,7 +20,7 @@ export async function startMcpServer(settings, options) {
|
|
|
14
20
|
(options.port > 0
|
|
15
21
|
? mcpAuthScopeForSettings(settings, bindHost, options.port)
|
|
16
22
|
: createMcpAuthScope());
|
|
17
|
-
mountMcp(app, settings, { authScope, tools: options.tools });
|
|
23
|
+
mountMcp(app, settings, { authScope, tools: options.tools, isRunLive: options.isRunLive });
|
|
18
24
|
app.notFound((c) => c.req.method === "GET"
|
|
19
25
|
? errorResponse(404, "not_found", "Route not found")
|
|
20
26
|
: errorResponse(405, "method_not_allowed", "Method not allowed"));
|
|
@@ -28,18 +34,46 @@ export async function startMcpServer(settings, options) {
|
|
|
28
34
|
export function mountMcp(app, settings, options = {}) {
|
|
29
35
|
const currentSettings = typeof settings === "function" ? settings : () => settings;
|
|
30
36
|
const authScope = options.authScope ?? createMcpAuthScope();
|
|
37
|
+
const isRunLive = options.isRunLive ?? defaultIsRunLive;
|
|
38
|
+
// A mount handed a real `isRunLive` oracle IS the per-run claim-enforcing
|
|
39
|
+
// (co-residence) MCP server: it accepts ONLY Token B and never falls back to
|
|
40
|
+
// the settings-wide Token A path, so a settings-wide token can never authorize
|
|
41
|
+
// a co-resident run's MCP calls. Non-claim mounts (the observability server,
|
|
42
|
+
// the legacy acp/local endpoint) inject no oracle and keep the Token A path.
|
|
43
|
+
const enforcePerRunClaim = options.isRunLive !== undefined;
|
|
31
44
|
app.use(mcpPath, async (c, next) => {
|
|
32
45
|
if (c.req.method !== "POST") {
|
|
33
46
|
await next();
|
|
34
47
|
return;
|
|
35
48
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
const bearer = bearerToken(c.req.header("authorization"));
|
|
50
|
+
// Token B (per-run scoped claim) is the only source of a request's runKey:
|
|
51
|
+
// resolve it server-side from the opaque token and re-check the owner on
|
|
52
|
+
// EVERY request. A self-reported runKey header is never trusted.
|
|
53
|
+
const claim = resolveRunClaim(bearer);
|
|
54
|
+
if (claim) {
|
|
55
|
+
// Parse the body ONCE here for the allowlist re-check and stash a record
|
|
56
|
+
// body for `handleMcp` to reuse (a malformed/non-record body is left
|
|
57
|
+
// unstashed so `handleMcp` re-parses and reports the JSON-RPC parse error).
|
|
58
|
+
const parsedBody = parseRequestBody(await c.req.text());
|
|
59
|
+
if (isRecord(parsedBody))
|
|
60
|
+
parsedRequestBodies.set(c.req.raw, parsedBody);
|
|
61
|
+
const decision = checkRunClaim(claim, { toolName: requestToolName(parsedBody), isRunLive });
|
|
62
|
+
if (!decision.ok)
|
|
63
|
+
return unauthorizedMcpResponse();
|
|
64
|
+
await next();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Claim-enforcing mount: NO Token A fallback. A bearer that is not a live
|
|
68
|
+
// Token B is refused outright (fail closed), closing the settings-wide
|
|
69
|
+
// bypass on the shared per-run server.
|
|
70
|
+
if (enforcePerRunClaim) {
|
|
71
|
+
return unauthorizedMcpResponse();
|
|
72
|
+
}
|
|
73
|
+
// Non-claim mount: the settings-wide Token A path (observability server,
|
|
74
|
+
// legacy acp/local endpoint).
|
|
75
|
+
if (!validMcpToken(bearer, authScope)) {
|
|
76
|
+
return unauthorizedMcpResponse();
|
|
43
77
|
}
|
|
44
78
|
await next();
|
|
45
79
|
});
|
|
@@ -87,14 +121,53 @@ async function handleMcp(settings, c, tools) {
|
|
|
87
121
|
return jsonResponse(response);
|
|
88
122
|
}
|
|
89
123
|
async function requestJson(c) {
|
|
124
|
+
// Reuse the record body the claim middleware already parsed, if present, so the
|
|
125
|
+
// per-request MCP path parses the JSON exactly once.
|
|
126
|
+
const cached = getRequestBody(c);
|
|
127
|
+
if (cached)
|
|
128
|
+
return cached;
|
|
90
129
|
const parsed = JSON.parse(await c.req.text());
|
|
91
130
|
if (!isRecord(parsed))
|
|
92
131
|
throw new Error("request body must be an object");
|
|
93
132
|
return parsed;
|
|
94
133
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
|
|
134
|
+
function getRequestBody(c) {
|
|
135
|
+
return parsedRequestBodies.get(c.req.raw);
|
|
136
|
+
}
|
|
137
|
+
/** Parse a raw JSON body, returning `undefined` for unparseable input. */
|
|
138
|
+
function parseRequestBody(rawBody) {
|
|
139
|
+
try {
|
|
140
|
+
return JSON.parse(rawBody);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function bearerToken(authorization) {
|
|
147
|
+
return /^Bearer\s+(.+)$/.exec(authorization ?? "")?.[1];
|
|
148
|
+
}
|
|
149
|
+
function unauthorizedMcpResponse() {
|
|
150
|
+
return jsonResponse({
|
|
151
|
+
error: {
|
|
152
|
+
code: "unauthorized",
|
|
153
|
+
message: "Missing or invalid MCP bearer token",
|
|
154
|
+
},
|
|
155
|
+
}, 401);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Best-effort `tools/call` name for the per-run allowlist re-check, read from the
|
|
159
|
+
* already-parsed request body. Returns null for non-tool requests or
|
|
160
|
+
* unparseable/non-record bodies; the allowlist only narrows tool calls, so a null
|
|
161
|
+
* name simply skips the allowlist (the rest of the claim still gates the request).
|
|
162
|
+
*/
|
|
163
|
+
function requestToolName(body) {
|
|
164
|
+
if (!isRecord(body) || body.method !== "tools/call")
|
|
165
|
+
return null;
|
|
166
|
+
const params = body.params;
|
|
167
|
+
if (!isRecord(params))
|
|
168
|
+
return null;
|
|
169
|
+
const name = params.name;
|
|
170
|
+
return typeof name === "string" ? name.trim() || null : null;
|
|
98
171
|
}
|
|
99
172
|
export async function mcpResponse(settings, body, tools = defaultToolRegistry) {
|
|
100
173
|
const method = typeof body.method === "string" ? body.method : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAA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B;IAC1C,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { type HydrateStateOptions, type SerializedOrchestratorState } from "./codec.js";
|
|
2
|
+
import { type OrchestratorState } from "./state.js";
|
|
3
|
+
export type ClaimStoreOperation = "eligible_issues" | "claim" | "bind_reservation" | "cancel_reservation" | "refresh_running_issue" | "apply_update" | "finish" | "abandon_claim" | "cleanup_issue";
|
|
4
|
+
export interface ClaimStoreCapabilities {
|
|
5
|
+
crashRecovery: boolean;
|
|
6
|
+
sharedAcrossProcesses: boolean;
|
|
7
|
+
retryDurability: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ClaimStoreStatus {
|
|
10
|
+
kind: string;
|
|
11
|
+
ownerId: string;
|
|
12
|
+
capabilities: ClaimStoreCapabilities;
|
|
13
|
+
hydratedAt: string;
|
|
14
|
+
transactionsApplied: number;
|
|
15
|
+
lastOperation: ClaimStoreOperation | null;
|
|
16
|
+
lastCheckpointAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ClaimStore {
|
|
19
|
+
readonly kind: string;
|
|
20
|
+
readonly ownerId: string;
|
|
21
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
22
|
+
readonly state: OrchestratorState;
|
|
23
|
+
read<T>(run: (state: OrchestratorState) => T): T;
|
|
24
|
+
transaction<T>(operation: ClaimStoreOperation, run: (state: OrchestratorState) => T): T;
|
|
25
|
+
heartbeatOwner(): void;
|
|
26
|
+
status(): ClaimStoreStatus;
|
|
27
|
+
}
|
|
28
|
+
export interface AsyncClaimStore {
|
|
29
|
+
readonly async: true;
|
|
30
|
+
readonly kind: string;
|
|
31
|
+
readonly ownerId: string;
|
|
32
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
33
|
+
readonly state: OrchestratorState;
|
|
34
|
+
read<T>(run: (state: OrchestratorState) => T): Promise<T>;
|
|
35
|
+
transaction<T>(operation: ClaimStoreOperation, run: (state: OrchestratorState) => T): Promise<T>;
|
|
36
|
+
heartbeatOwner(): Promise<void>;
|
|
37
|
+
status(): ClaimStoreStatus;
|
|
38
|
+
}
|
|
39
|
+
export type ClaimStoreLike = ClaimStore | AsyncClaimStore;
|
|
40
|
+
export interface ClaimStoreCheckpoint {
|
|
41
|
+
version: 1;
|
|
42
|
+
ownerId: string;
|
|
43
|
+
writtenAt: string;
|
|
44
|
+
operation: ClaimStoreOperation | "hydrate" | "flush" | "recover_stale_owners";
|
|
45
|
+
state: SerializedOrchestratorState;
|
|
46
|
+
}
|
|
47
|
+
export interface ClaimStoreBackend {
|
|
48
|
+
readonly kind: string;
|
|
49
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
50
|
+
load(): ClaimStoreCheckpoint | null;
|
|
51
|
+
save(checkpoint: ClaimStoreCheckpoint): void;
|
|
52
|
+
withExclusiveTransaction?<T>(run: () => T): T;
|
|
53
|
+
heartbeatOwner?(ownerId: string, at: Date): void;
|
|
54
|
+
ownerIsActive?(ownerId: string, now: Date, staleMs: number): boolean;
|
|
55
|
+
close?(): void;
|
|
56
|
+
}
|
|
57
|
+
export interface AsyncClaimStoreBackend {
|
|
58
|
+
readonly kind: string;
|
|
59
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
60
|
+
load(): Promise<ClaimStoreCheckpoint | null>;
|
|
61
|
+
save(checkpoint: ClaimStoreCheckpoint): Promise<void>;
|
|
62
|
+
withExclusiveTransaction?<T>(run: () => Promise<T>): Promise<T>;
|
|
63
|
+
heartbeatOwner?(ownerId: string, at: Date): Promise<void>;
|
|
64
|
+
ownerIsActive?(ownerId: string, now: Date, staleMs: number): Promise<boolean>;
|
|
65
|
+
close?(): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
export interface InMemoryClaimStoreOptions {
|
|
68
|
+
ownerId?: string | undefined;
|
|
69
|
+
hydratedAt?: Date | undefined;
|
|
70
|
+
}
|
|
71
|
+
export declare class InMemoryClaimStore implements ClaimStore {
|
|
72
|
+
readonly state: OrchestratorState;
|
|
73
|
+
readonly kind = "memory";
|
|
74
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
75
|
+
readonly ownerId: string;
|
|
76
|
+
private readonly hydratedAt;
|
|
77
|
+
private transactionsApplied;
|
|
78
|
+
private lastOperation;
|
|
79
|
+
constructor(state: OrchestratorState, options?: InMemoryClaimStoreOptions);
|
|
80
|
+
read<T>(run: (state: OrchestratorState) => T): T;
|
|
81
|
+
transaction<T>(operation: ClaimStoreOperation, run: (state: OrchestratorState) => T): T;
|
|
82
|
+
heartbeatOwner(): void;
|
|
83
|
+
status(): ClaimStoreStatus;
|
|
84
|
+
}
|
|
85
|
+
export declare class AsyncPersistentClaimStore implements AsyncClaimStore {
|
|
86
|
+
private readonly backend;
|
|
87
|
+
readonly async: true;
|
|
88
|
+
readonly ownerId: string;
|
|
89
|
+
readonly kind: string;
|
|
90
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
91
|
+
readonly state: OrchestratorState;
|
|
92
|
+
private readonly hydratedAt;
|
|
93
|
+
private readonly now;
|
|
94
|
+
private readonly monotonicNow;
|
|
95
|
+
private readonly ownerLeaseStaleMs;
|
|
96
|
+
private readonly hydrateOptions;
|
|
97
|
+
private transactionsApplied;
|
|
98
|
+
private lastOperation;
|
|
99
|
+
private lastCheckpointAt;
|
|
100
|
+
private constructor();
|
|
101
|
+
static create(backend: AsyncClaimStoreBackend, options?: PersistentClaimStoreOptions): Promise<AsyncPersistentClaimStore>;
|
|
102
|
+
read<T>(run: (state: OrchestratorState) => T): Promise<T>;
|
|
103
|
+
transaction<T>(operation: ClaimStoreOperation, run: (state: OrchestratorState) => T): Promise<T>;
|
|
104
|
+
flush(): Promise<void>;
|
|
105
|
+
heartbeatOwner(): Promise<void>;
|
|
106
|
+
close(): Promise<void>;
|
|
107
|
+
status(): ClaimStoreStatus;
|
|
108
|
+
private loadInitial;
|
|
109
|
+
private save;
|
|
110
|
+
private reload;
|
|
111
|
+
private writeOwnerHeartbeat;
|
|
112
|
+
private recoverInactiveOwners;
|
|
113
|
+
private hydrate;
|
|
114
|
+
private recovery;
|
|
115
|
+
private retryEntryFromRunningClaim;
|
|
116
|
+
}
|
|
117
|
+
export interface PersistentClaimStoreOptions {
|
|
118
|
+
ownerId?: string | undefined;
|
|
119
|
+
hydratedAt?: Date | undefined;
|
|
120
|
+
now?: (() => Date) | undefined;
|
|
121
|
+
monotonicNow?: (() => number) | undefined;
|
|
122
|
+
ownerLeaseStaleMs?: number | undefined;
|
|
123
|
+
hydrate?: HydrateStateOptions | (() => HydrateStateOptions) | undefined;
|
|
124
|
+
}
|
|
125
|
+
export declare class PersistentClaimStore implements ClaimStore {
|
|
126
|
+
private readonly backend;
|
|
127
|
+
readonly ownerId: string;
|
|
128
|
+
readonly kind: string;
|
|
129
|
+
readonly capabilities: ClaimStoreCapabilities;
|
|
130
|
+
readonly state: OrchestratorState;
|
|
131
|
+
private readonly hydratedAt;
|
|
132
|
+
private readonly now;
|
|
133
|
+
private readonly monotonicNow;
|
|
134
|
+
private readonly ownerLeaseStaleMs;
|
|
135
|
+
private readonly hydrateOptions;
|
|
136
|
+
private transactionsApplied;
|
|
137
|
+
private lastOperation;
|
|
138
|
+
private lastCheckpointAt;
|
|
139
|
+
constructor(backend: ClaimStoreBackend, options?: PersistentClaimStoreOptions);
|
|
140
|
+
read<T>(run: (state: OrchestratorState) => T): T;
|
|
141
|
+
transaction<T>(operation: ClaimStoreOperation, run: (state: OrchestratorState) => T): T;
|
|
142
|
+
flush(): void;
|
|
143
|
+
heartbeatOwner(): void;
|
|
144
|
+
close(): void;
|
|
145
|
+
status(): ClaimStoreStatus;
|
|
146
|
+
private save;
|
|
147
|
+
private reload;
|
|
148
|
+
private writeOwnerHeartbeat;
|
|
149
|
+
private recoverInactiveOwners;
|
|
150
|
+
private hydrate;
|
|
151
|
+
private recovery;
|
|
152
|
+
private retryEntryFromRunningClaim;
|
|
153
|
+
}
|
|
154
|
+
export declare function isClaimStore(value: unknown): value is ClaimStore;
|
|
155
|
+
export declare function isAsyncClaimStore(value: unknown): value is AsyncClaimStore;
|
|
156
|
+
export declare function isClaimStoreLike(value: unknown): value is ClaimStoreLike;
|
|
157
|
+
//# sourceMappingURL=claimStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimStore.d.ts","sourceRoot":"","sources":["../src/claimStore.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAe,KAAK,iBAAiB,EAA0B,MAAM,YAAY,CAAC;AAEzF,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,OAAO,GACP,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,GACd,QAAQ,GACR,eAAe,GACf,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,sBAAsB,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC1C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ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