@intutic/mcp-governance-proxy 1.10.0 → 1.10.1
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 +28 -0
- package/dist/anomaly/detectors.d.ts +129 -0
- package/dist/anomaly/detectors.d.ts.map +1 -0
- package/dist/anomaly/detectors.js +368 -0
- package/dist/anomaly/detectors.js.map +1 -0
- package/dist/anomaly/index.d.ts +52 -0
- package/dist/anomaly/index.d.ts.map +1 -0
- package/dist/anomaly/index.js +71 -0
- package/dist/anomaly/index.js.map +1 -0
- package/dist/config.d.ts +107 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +129 -6
- package/dist/config.js.map +1 -1
- package/dist/daemon/healthMonitor.d.ts.map +1 -1
- package/dist/daemon/healthMonitor.js +45 -46
- package/dist/daemon/healthMonitor.js.map +1 -1
- package/dist/daemon/index.d.ts +15 -1
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +78 -9
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/instrumentation.d.ts +20 -0
- package/dist/daemon/instrumentation.d.ts.map +1 -0
- package/dist/daemon/instrumentation.js +61 -0
- package/dist/daemon/instrumentation.js.map +1 -0
- package/dist/daemon/policyCache.d.ts +83 -0
- package/dist/daemon/policyCache.d.ts.map +1 -1
- package/dist/daemon/policyCache.js +280 -11
- package/dist/daemon/policyCache.js.map +1 -1
- package/dist/daemon/statusReporter.d.ts +12 -0
- package/dist/daemon/statusReporter.d.ts.map +1 -0
- package/dist/daemon/statusReporter.js +130 -0
- package/dist/daemon/statusReporter.js.map +1 -0
- package/dist/daemon/telemetryBatcher.d.ts +3 -1
- package/dist/daemon/telemetryBatcher.d.ts.map +1 -1
- package/dist/daemon/telemetryBatcher.js +56 -13
- package/dist/daemon/telemetryBatcher.js.map +1 -1
- package/dist/daemonClient.d.ts +1 -1
- package/dist/daemonClient.d.ts.map +1 -1
- package/dist/daemonClient.js +0 -2
- package/dist/daemonClient.js.map +1 -1
- package/dist/dlp.d.ts +19 -0
- package/dist/dlp.d.ts.map +1 -1
- package/dist/dlp.js +95 -18
- package/dist/dlp.js.map +1 -1
- package/dist/emitter.d.ts +40 -2
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +27 -5
- package/dist/emitter.js.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/injection.d.ts +46 -0
- package/dist/injection.d.ts.map +1 -0
- package/dist/injection.js +147 -0
- package/dist/injection.js.map +1 -0
- package/dist/interceptor.d.ts +131 -1
- package/dist/interceptor.d.ts.map +1 -1
- package/dist/interceptor.js +301 -5
- package/dist/interceptor.js.map +1 -1
- package/dist/policy.d.ts +110 -2
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +206 -5
- package/dist/policy.js.map +1 -1
- package/dist/proxy.d.ts +205 -0
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +572 -65
- package/dist/proxy.js.map +1 -1
- package/dist/remoteBridge.d.ts +51 -0
- package/dist/remoteBridge.d.ts.map +1 -0
- package/dist/remoteBridge.js +182 -0
- package/dist/remoteBridge.js.map +1 -0
- package/dist/session.d.ts +158 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +206 -0
- package/dist/session.js.map +1 -0
- package/dist/sessionScope.d.ts +51 -0
- package/dist/sessionScope.d.ts.map +1 -0
- package/dist/sessionScope.js +94 -0
- package/dist/sessionScope.js.map +1 -0
- package/dist/sessionStore.d.ts +69 -0
- package/dist/sessionStore.d.ts.map +1 -0
- package/dist/sessionStore.js +143 -0
- package/dist/sessionStore.js.map +1 -0
- package/dist/tofu.d.ts +112 -0
- package/dist/tofu.d.ts.map +1 -0
- package/dist/tofu.js +180 -0
- package/dist/tofu.js.map +1 -0
- package/dist/toolPoison.d.ts +32 -0
- package/dist/toolPoison.d.ts.map +1 -0
- package/dist/toolPoison.js +81 -0
- package/dist/toolPoison.js.map +1 -0
- package/dist/valkeyErrors.d.ts +17 -0
- package/dist/valkeyErrors.d.ts.map +1 -0
- package/dist/valkeyErrors.js +24 -0
- package/dist/valkeyErrors.js.map +1 -0
- package/dist/wasm/context.d.ts +57 -0
- package/dist/wasm/context.d.ts.map +1 -0
- package/dist/wasm/context.js +59 -0
- package/dist/wasm/context.js.map +1 -0
- package/dist/wasm/hostImports.d.ts +43 -0
- package/dist/wasm/hostImports.d.ts.map +1 -0
- package/dist/wasm/hostImports.js +158 -0
- package/dist/wasm/hostImports.js.map +1 -0
- package/dist/wasm/loader.d.ts +95 -0
- package/dist/wasm/loader.d.ts.map +1 -0
- package/dist/wasm/loader.js +198 -0
- package/dist/wasm/loader.js.map +1 -0
- package/dist/wasm/referencedFiles.d.ts +115 -0
- package/dist/wasm/referencedFiles.d.ts.map +1 -0
- package/dist/wasm/referencedFiles.js +366 -0
- package/dist/wasm/referencedFiles.js.map +1 -0
- package/dist/wasm/runner.d.ts +91 -0
- package/dist/wasm/runner.d.ts.map +1 -0
- package/dist/wasm/runner.js +308 -0
- package/dist/wasm/runner.js.map +1 -0
- package/dist/wasm/watch.d.ts +5 -0
- package/dist/wasm/watch.d.ts.map +1 -0
- package/dist/wasm/watch.js +54 -0
- package/dist/wasm/watch.js.map +1 -0
- package/dist/wasm/worker.d.ts +39 -0
- package/dist/wasm/worker.d.ts.map +1 -0
- package/dist/wasm/worker.js +245 -0
- package/dist/wasm/worker.js.map +1 -0
- package/package.json +14 -4
package/dist/proxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,aAAa,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CA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AA;YACjB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;gBACvB,UAAU,CAAC,IAAI,EAAE,CAAA;YACnB,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,mCAAmC;QACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;gBACrC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,wBAAwB,CAAC,CAAA;gBAChF,IAAI,CAAC,UAAU,EAAE,CAAA;gBACjB,OAAO,EAAE,CAAA;YACX,CAAC,CAAC,CAAA;YACF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC7B,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,+BAA+B,CAAC,CAAA;gBAC7F,IAAI,CAAC,UAAU,EAAE,CAAA;gBACjB,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* remoteBridge.ts — stdio→HTTP/SSE bridge for the MCP governance proxy.
|
|
3
|
+
*
|
|
4
|
+
* The harness still spawns `@intutic/mcp-governance-proxy` as an ordinary
|
|
5
|
+
* stdio child process — nothing about how a harness launches this proxy
|
|
6
|
+
* changes, no new listener or port is opened, and there is no daemon-
|
|
7
|
+
* lifecycle change. What changes is the UPSTREAM side: instead of spawning a
|
|
8
|
+
* child process and talking to its stdin/stdout (proxy.ts's `runProxy`),
|
|
9
|
+
* this module talks to a remote MCP server over HTTP or SSE using the MCP
|
|
10
|
+
* SDK's client transports (`SSEClientTransport` / `StreamableHTTPClientTransport`),
|
|
11
|
+
* used RAW — never wrapped in the SDK's `Client` class, which would present a
|
|
12
|
+
* filtered view of the protocol rather than every message this proxy's
|
|
13
|
+
* governance pipeline needs to see.
|
|
14
|
+
*
|
|
15
|
+
* Architecture:
|
|
16
|
+
* Harness stdin → [handleHarnessLine, proxy.ts] → transport.send()
|
|
17
|
+
* transport.onmessage → [handleServerLine, proxy.ts] → Harness stdout
|
|
18
|
+
*
|
|
19
|
+
* Both directions delegate to the exact functions `proxy.ts`'s stdio mode
|
|
20
|
+
* uses — `handleHarnessLine` (a free function, parameterized by a `forward`
|
|
21
|
+
* callback) and `handleServerLine` (a public method on `McpGovernanceProxy`,
|
|
22
|
+
* built from the SAME `ProxyConfig` this module receives). TOFU pinning, DLP
|
|
23
|
+
* redaction, tools/list curation, and event emission therefore apply
|
|
24
|
+
* identically regardless of which upstream transport is in play — this
|
|
25
|
+
* module supplies a different upstream and a different `forward`, nothing
|
|
26
|
+
* about the governance pipeline itself is reimplemented.
|
|
27
|
+
*
|
|
28
|
+
* CRITICAL: Never write to process.stdout except for valid JSON-RPC frames —
|
|
29
|
+
* same invariant proxy.ts documents; all logging goes to stderr
|
|
30
|
+
* via stderrLog.ts.
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
import type { ProxyConfig } from './config.js';
|
|
35
|
+
/**
|
|
36
|
+
* Run the proxy in remote bridge mode: connect to `config.remoteUrl` over
|
|
37
|
+
* HTTP or SSE and proxy the harness's stdio traffic through it, applying the
|
|
38
|
+
* identical governance pipeline `runProxy` (proxy.ts) applies to a spawned
|
|
39
|
+
* stdio child process.
|
|
40
|
+
*
|
|
41
|
+
* On connect failure (remote server unreachable, auth rejected, TLS error,
|
|
42
|
+
* etc.) this logs the failure and rethrows — mirroring the existing failure
|
|
43
|
+
* surface for a stdio command that doesn't exist: `runProxy`'s spawned child
|
|
44
|
+
* process emits `error` on ENOENT, logs `real_server_error`, and rejects the
|
|
45
|
+
* promise `run()` returns, which `index.ts`'s `main()` catches as
|
|
46
|
+
* `proxy_fatal` and exits 1. This function rethrows into that SAME catch
|
|
47
|
+
* block rather than calling `process.exit` itself, so both failure modes
|
|
48
|
+
* surface through one place with one log shape.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runRemoteProxy(config: ProxyConfig): Promise<void>;
|
|
51
|
+
//# sourceMappingURL=remoteBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteBridge.d.ts","sourceRoot":"","sources":["../src/remoteBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AA+B9C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAsIvE"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* remoteBridge.ts — stdio→HTTP/SSE bridge for the MCP governance proxy.
|
|
3
|
+
*
|
|
4
|
+
* The harness still spawns `@intutic/mcp-governance-proxy` as an ordinary
|
|
5
|
+
* stdio child process — nothing about how a harness launches this proxy
|
|
6
|
+
* changes, no new listener or port is opened, and there is no daemon-
|
|
7
|
+
* lifecycle change. What changes is the UPSTREAM side: instead of spawning a
|
|
8
|
+
* child process and talking to its stdin/stdout (proxy.ts's `runProxy`),
|
|
9
|
+
* this module talks to a remote MCP server over HTTP or SSE using the MCP
|
|
10
|
+
* SDK's client transports (`SSEClientTransport` / `StreamableHTTPClientTransport`),
|
|
11
|
+
* used RAW — never wrapped in the SDK's `Client` class, which would present a
|
|
12
|
+
* filtered view of the protocol rather than every message this proxy's
|
|
13
|
+
* governance pipeline needs to see.
|
|
14
|
+
*
|
|
15
|
+
* Architecture:
|
|
16
|
+
* Harness stdin → [handleHarnessLine, proxy.ts] → transport.send()
|
|
17
|
+
* transport.onmessage → [handleServerLine, proxy.ts] → Harness stdout
|
|
18
|
+
*
|
|
19
|
+
* Both directions delegate to the exact functions `proxy.ts`'s stdio mode
|
|
20
|
+
* uses — `handleHarnessLine` (a free function, parameterized by a `forward`
|
|
21
|
+
* callback) and `handleServerLine` (a public method on `McpGovernanceProxy`,
|
|
22
|
+
* built from the SAME `ProxyConfig` this module receives). TOFU pinning, DLP
|
|
23
|
+
* redaction, tools/list curation, and event emission therefore apply
|
|
24
|
+
* identically regardless of which upstream transport is in play — this
|
|
25
|
+
* module supplies a different upstream and a different `forward`, nothing
|
|
26
|
+
* about the governance pipeline itself is reimplemented.
|
|
27
|
+
*
|
|
28
|
+
* CRITICAL: Never write to process.stdout except for valid JSON-RPC frames —
|
|
29
|
+
* same invariant proxy.ts documents; all logging goes to stderr
|
|
30
|
+
* via stderrLog.ts.
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
import * as node_readline from 'node:readline';
|
|
35
|
+
import { createStderrLogger as createLogger } from './stderrLog.js';
|
|
36
|
+
import { McpGovernanceProxy, handleHarnessLine } from './proxy.js';
|
|
37
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
38
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
39
|
+
const log = createLogger('mcp-remote-bridge');
|
|
40
|
+
/**
|
|
41
|
+
* Build the raw SDK client transport for `config.remoteUrl` /
|
|
42
|
+
* `config.remoteTransport`. "Raw" is deliberate: this is the `Transport`
|
|
43
|
+
* interface's `start`/`send`/`close`/`onmessage`/`onerror`/`onclose` surface
|
|
44
|
+
* only, never handed to the SDK's `Client` class — `Client` negotiates and
|
|
45
|
+
* filters the protocol on the caller's behalf, which is exactly the
|
|
46
|
+
* transparency this governance proxy cannot give up. Auth headers ride via
|
|
47
|
+
* `requestInit.headers`, which both transports merge into every request they
|
|
48
|
+
* make (including SSE's initial `EventSource` connection, confirmed by
|
|
49
|
+
* reading the installed SDK's `_commonHeaders`/`_startOrAuth` — not merely
|
|
50
|
+
* assumed from the public types).
|
|
51
|
+
*/
|
|
52
|
+
function buildRemoteTransport(config) {
|
|
53
|
+
const url = new URL(config.remoteUrl);
|
|
54
|
+
const hasHeaders = Object.keys(config.remoteHeaders).length > 0;
|
|
55
|
+
const opts = hasHeaders ? { requestInit: { headers: config.remoteHeaders } } : undefined;
|
|
56
|
+
return config.remoteTransport === 'sse'
|
|
57
|
+
? new SSEClientTransport(url, opts)
|
|
58
|
+
: new StreamableHTTPClientTransport(url, opts);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Run the proxy in remote bridge mode: connect to `config.remoteUrl` over
|
|
62
|
+
* HTTP or SSE and proxy the harness's stdio traffic through it, applying the
|
|
63
|
+
* identical governance pipeline `runProxy` (proxy.ts) applies to a spawned
|
|
64
|
+
* stdio child process.
|
|
65
|
+
*
|
|
66
|
+
* On connect failure (remote server unreachable, auth rejected, TLS error,
|
|
67
|
+
* etc.) this logs the failure and rethrows — mirroring the existing failure
|
|
68
|
+
* surface for a stdio command that doesn't exist: `runProxy`'s spawned child
|
|
69
|
+
* process emits `error` on ENOENT, logs `real_server_error`, and rejects the
|
|
70
|
+
* promise `run()` returns, which `index.ts`'s `main()` catches as
|
|
71
|
+
* `proxy_fatal` and exits 1. This function rethrows into that SAME catch
|
|
72
|
+
* block rather than calling `process.exit` itself, so both failure modes
|
|
73
|
+
* surface through one place with one log shape.
|
|
74
|
+
*/
|
|
75
|
+
export async function runRemoteProxy(config) {
|
|
76
|
+
if (config.remoteUrl === undefined) {
|
|
77
|
+
throw new Error('runRemoteProxy called without config.remoteUrl');
|
|
78
|
+
}
|
|
79
|
+
log.info({
|
|
80
|
+
action: 'remote_bridge_start',
|
|
81
|
+
remoteUrl: config.remoteUrl,
|
|
82
|
+
remoteTransport: config.remoteTransport ?? 'http',
|
|
83
|
+
workspaceId: config.workspaceId,
|
|
84
|
+
serverName: config.serverName,
|
|
85
|
+
}, 'Starting MCP governance remote bridge');
|
|
86
|
+
const proxy = new McpGovernanceProxy(config);
|
|
87
|
+
const interceptor = proxy.getInterceptor();
|
|
88
|
+
const session = proxy.getSessionState();
|
|
89
|
+
// Requests whose responses this proxy must inspect on the way back — same
|
|
90
|
+
// role, same shape, as `runProxy`'s own `pending` map.
|
|
91
|
+
const pending = new Map();
|
|
92
|
+
const transport = buildRemoteTransport(config);
|
|
93
|
+
let shuttingDown = false;
|
|
94
|
+
// Callbacks MUST be installed before `transport.start()` — the `Transport`
|
|
95
|
+
// interface's own contract (see shared/transport.ts) is that starting
|
|
96
|
+
// before callbacks are wired can lose messages. `onclose`'s `shutdown` call
|
|
97
|
+
// is wired up below, once `shutdown` exists — the SDK only ever fires
|
|
98
|
+
// `onclose` asynchronously, well after this synchronous setup completes.
|
|
99
|
+
transport.onmessage = (message) => {
|
|
100
|
+
void proxy.handleServerLine(JSON.stringify(message), pending);
|
|
101
|
+
};
|
|
102
|
+
transport.onerror = (err) => {
|
|
103
|
+
log.error({ action: 'remote_transport_error', err: err.message }, 'Remote MCP transport error');
|
|
104
|
+
};
|
|
105
|
+
try {
|
|
106
|
+
await transport.start();
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
log.error({
|
|
110
|
+
action: 'remote_connect_error',
|
|
111
|
+
err: err.message,
|
|
112
|
+
remoteUrl: config.remoteUrl,
|
|
113
|
+
remoteTransport: config.remoteTransport ?? 'http',
|
|
114
|
+
}, 'Failed to connect to remote MCP server');
|
|
115
|
+
// Rethrow — see this function's doc comment: index.ts's existing
|
|
116
|
+
// proxy_fatal/exit(1) catch is the shared failure surface, not a second one.
|
|
117
|
+
throw err;
|
|
118
|
+
}
|
|
119
|
+
proxy.startPolicy();
|
|
120
|
+
// Harness stdin → governance interceptor → remote transport. Delegates to
|
|
121
|
+
// the exact `handleHarnessLine` proxy.ts's stdio mode uses; `forward` here
|
|
122
|
+
// parses the line back to a JSON-RPC message object (transports send
|
|
123
|
+
// structured messages, not raw text) and hands it to `transport.send()`.
|
|
124
|
+
// Created before `shutdown`/`onclose`/signal handlers below are wired up so
|
|
125
|
+
// none of them can ever reference `rl` before it exists.
|
|
126
|
+
const rl = node_readline.createInterface({ input: process.stdin, terminal: false });
|
|
127
|
+
const shutdown = (reason, exitCode = 0) => {
|
|
128
|
+
if (shuttingDown)
|
|
129
|
+
return;
|
|
130
|
+
shuttingDown = true;
|
|
131
|
+
log.info({ action: 'remote_bridge_shutdown', reason }, 'Shutting down MCP governance remote bridge');
|
|
132
|
+
proxy.stopPolicy();
|
|
133
|
+
rl.close();
|
|
134
|
+
transport.close().catch(() => {
|
|
135
|
+
// Already shutting down — a close-of-a-closing-transport error changes nothing.
|
|
136
|
+
});
|
|
137
|
+
process.exit(exitCode);
|
|
138
|
+
};
|
|
139
|
+
transport.onclose = () => {
|
|
140
|
+
if (!shuttingDown) {
|
|
141
|
+
log.error({ action: 'remote_transport_closed_unexpectedly' }, 'Remote MCP server connection closed unexpectedly — shutting down');
|
|
142
|
+
shutdown('remote_closed', 1);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
146
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
147
|
+
rl.on('line', (line) => {
|
|
148
|
+
handleHarnessLine(line, pending, interceptor, (forwardedLine) => {
|
|
149
|
+
let message;
|
|
150
|
+
try {
|
|
151
|
+
message = JSON.parse(forwardedLine);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// handleHarnessLine already parsed this line once to reach `forward`
|
|
155
|
+
// at all, so a re-parse failure here is not expected — fail loud via
|
|
156
|
+
// stderr rather than silently dropping a message the remote server
|
|
157
|
+
// will never see.
|
|
158
|
+
log.error({ action: 'remote_forward_parse_error', line: forwardedLine.slice(0, 100) }, 'Failed to re-parse an already-validated JSON-RPC line before sending to remote server');
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
transport.send(message).catch((err) => {
|
|
162
|
+
log.error({ action: 'remote_send_error', err: err.message }, 'Failed to send message to remote MCP server');
|
|
163
|
+
});
|
|
164
|
+
}, session);
|
|
165
|
+
});
|
|
166
|
+
rl.on('close', () => {
|
|
167
|
+
log.info({ action: 'stdin_closed' }, 'Harness stdin closed — shutting down remote bridge');
|
|
168
|
+
shutdown('stdin_closed');
|
|
169
|
+
});
|
|
170
|
+
// Readiness, for whatever supervises this process: the remote transport is
|
|
171
|
+
// connected, the policy refresh is running and stdin is being read. A
|
|
172
|
+
// harness never waits for this — stdin is buffered, so a message written
|
|
173
|
+
// before this line is still served — but anything that budgets per-request
|
|
174
|
+
// latency (remote-bridge.test.ts's harness) must not charge this process's
|
|
175
|
+
// own boot to its first request: node start-up plus this module graph is
|
|
176
|
+
// ~200 ms idle and seconds on a loaded CI runner, all of it before here.
|
|
177
|
+
log.info({ action: 'remote_bridge_ready' }, 'MCP governance remote bridge ready');
|
|
178
|
+
// Keep the process alive until `shutdown()` calls `process.exit()` — stdin
|
|
179
|
+
// close, a signal, or the remote transport closing unexpectedly.
|
|
180
|
+
await new Promise(() => { });
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=remoteBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteBridge.js","sourceRoot":"","sources":["../src/remoteBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,aAAa,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAuB,MAAM,YAAY,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAIlG,MAAM,GAAG,GAAG,YA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BACnE,kBAAkB;gBAClB,GAAG,CAAC,KAAK,CACP,EAAE,MAAM,EAAE,4BAA4B,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAC3E,uFAAuF,CACxF,CAAA;gBACD,OAAM;YACR,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;gBAC7C,GAAG,CAAC,KAAK,CACP,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAG,GAAa,CAAC,OAAO,EAAE,EAC5D,6CAA6C,CAC9C,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,EAAE,OAAO,CAAC,CAAA;IACb,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QAClB,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,oDAAoD,CAAC,CAAA;QAC1F,QAAQ,CAAC,cAAc,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,2EAA2E;IAC3E,sEAAsE;IACtE,yEAAyE;IACzE,2EAA2E;IAC3E,2EAA2E;IAC3E,yEAAyE;IACzE,yEAAyE;IACzE,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,oCAAoC,CAAC,CAAA;IAEjF,2EAA2E;IAC3E,iEAAiE;IACjE,MAAM,IAAI,OAAO,CAAQ,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* session.ts — SessionState: a proxy process's anomaly session state, shared
|
|
3
|
+
* with its sibling processes through Valkey when one is configured.
|
|
4
|
+
*
|
|
5
|
+
* ## Scope: one harness session, several processes
|
|
6
|
+
*
|
|
7
|
+
* The sync daemon wraps EACH MCP server entry with its own `McpGovernanceProxy`
|
|
8
|
+
* process (`mcpAutoWrite.ts`'s `wrapWithProxy`, in both `per-session` and
|
|
9
|
+
* `daemon` mode), so one harness session runs one proxy per wrapped server.
|
|
10
|
+
* This class holds the tool-call sequence and the per-detector reask counters
|
|
11
|
+
* the anomaly detectors read. Until Wave 5.3 (TD-437) that state was
|
|
12
|
+
* per-process only — a cross-server ping-pong was invisible, a reask budget
|
|
13
|
+
* reset per server and per restart — and the module doc claimed there was
|
|
14
|
+
* "no second instance to share state with", which was never true of the
|
|
15
|
+
* wrapping the daemon writes.
|
|
16
|
+
*
|
|
17
|
+
* Now, when `SessionState` is given a scope (`sessionScope.ts`: the workspace
|
|
18
|
+
* plus the parent harness process) and a store (`sessionStore.ts`: the
|
|
19
|
+
* Rust proxy's Valkey window shape under its own namespace), the sequence,
|
|
20
|
+
* the 60 s call window and the reask counters are read from and written to
|
|
21
|
+
* the shared window, so every sibling sees every sibling's calls. The
|
|
22
|
+
* in-process copy is still kept and is the fallback whenever the store is
|
|
23
|
+
* absent, not connected, slow or failing — never a hard dependency, and
|
|
24
|
+
* exactly today's behaviour in every one of those cases.
|
|
25
|
+
*
|
|
26
|
+
* Per process, deliberately: `toolsList` and `toolContractChanged` describe
|
|
27
|
+
* THIS process's server (TOFU pins per {workspace, server}), and `sessionId`
|
|
28
|
+
* is the random per-process id handed to WASM rules as `session_id`.
|
|
29
|
+
*
|
|
30
|
+
* @module
|
|
31
|
+
*/
|
|
32
|
+
import type { SharedSessionStore } from './sessionStore.js';
|
|
33
|
+
/**
|
|
34
|
+
* Ported from the Rust proxy's `TOOL_SEQUENCE_CAP` (referenced by
|
|
35
|
+
* `anchor_projection`'s doc comment in `detectors.rs`, which states the cap
|
|
36
|
+
* is 60 and that `ANCHOR_FREQ_SLOTS` (256) must exceed it) — same cap, same
|
|
37
|
+
* "oldest evicted first" rolling-window semantics.
|
|
38
|
+
*/
|
|
39
|
+
export declare const TOOL_SEQUENCE_CAP = 60;
|
|
40
|
+
/** The subset of a `tools/list` tool entry the tool-poisoning detector needs. */
|
|
41
|
+
export interface ToolsListEntry {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SessionStateOptions {
|
|
46
|
+
/** The shared-window scope (`sessionScope.ts`); absent = per-process only. */
|
|
47
|
+
scope?: string;
|
|
48
|
+
/** The shared store; absent = per-process only. */
|
|
49
|
+
store?: SharedSessionStore;
|
|
50
|
+
}
|
|
51
|
+
/** What `decide()` evaluates against: the sequence AS IF the candidate were next. */
|
|
52
|
+
export interface SessionWindow {
|
|
53
|
+
prospective: readonly string[];
|
|
54
|
+
callsLast60s: number;
|
|
55
|
+
/** Whether the shared window answered; `false` means the per-process copy was used. */
|
|
56
|
+
shared: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare class SessionState {
|
|
59
|
+
/** The shared-window scope, when this process has one. */
|
|
60
|
+
readonly scope: string | undefined;
|
|
61
|
+
private readonly store;
|
|
62
|
+
/** The most recent write-behind, so tests can await it before reading back. */
|
|
63
|
+
private lastWrite;
|
|
64
|
+
constructor(opts?: SessionStateOptions);
|
|
65
|
+
/**
|
|
66
|
+
* A per-process identifier standing in for `RequestContext.session_id`
|
|
67
|
+
* (Phase 3, `wasm/context.ts`) — this proxy has no wire-level session id
|
|
68
|
+
* of its own (unlike the Rust LLM proxy, which reads one off the inbound
|
|
69
|
+
* request), so a random id generated once at process start is the honest
|
|
70
|
+
* substitute: stable for this process's lifetime, never claiming to be
|
|
71
|
+
* anything the harness itself asserted.
|
|
72
|
+
*/
|
|
73
|
+
readonly sessionId: string;
|
|
74
|
+
private sequence;
|
|
75
|
+
/** Wall-clock time of each entry in `sequence`, same indices, same cap —
|
|
76
|
+
* kept only for `callsInLastMs`; nothing else in this class reads it. */
|
|
77
|
+
private timestamps;
|
|
78
|
+
/**
|
|
79
|
+
* The most recent TOFU check result for this session's server (tofu.ts,
|
|
80
|
+
* evaluated in `proxy.ts`'s response-direction `handleServerLine` — TOFU
|
|
81
|
+
* only ever runs against a `tools/list` RESPONSE, never a `tools/call`
|
|
82
|
+
* request, so this is the honest way to surface it to Phase 3's WASM
|
|
83
|
+
* context, which builds from the request-direction `interceptor.decide`
|
|
84
|
+
* pipeline). `undefined` until at least one `tools/list` response has been
|
|
85
|
+
* checked; a `'skipped'` TOFU outcome (no tools declared) leaves this
|
|
86
|
+
* unchanged rather than resetting it, since "skipped" asserts nothing
|
|
87
|
+
* about whether a mismatch was seen earlier.
|
|
88
|
+
*/
|
|
89
|
+
private toolContractChanged;
|
|
90
|
+
/**
|
|
91
|
+
* Reask attempt counts, keyed by detector id (Phase 2) or `wasm:<ruleId>`
|
|
92
|
+
* (Phase 3 — "a WASM rule's reask counter is independent of an anomaly
|
|
93
|
+
* detector's," per the Phase 3 spec). A lifetime-per-session count, not a
|
|
94
|
+
* consecutive-trip count: `mod.rs`'s own doc says "trips of the same
|
|
95
|
+
* finding in ONE SESSION," not "consecutive trips," and a lifetime count
|
|
96
|
+
* is also the simpler, harder-to-game reading — an agent alternating
|
|
97
|
+
* between tripping and briefly correcting could otherwise reset its way
|
|
98
|
+
* out of ever hardening.
|
|
99
|
+
*/
|
|
100
|
+
private reaskAttempts;
|
|
101
|
+
/**
|
|
102
|
+
* The most recent post-curation `tools/list` response this session saw —
|
|
103
|
+
* Phase 1's wiring already computes this array (allowlist filtering +
|
|
104
|
+
* operator overrides applied); the tool-poisoning detector (Phase 2) reads
|
|
105
|
+
* it from here rather than re-deriving it.
|
|
106
|
+
*/
|
|
107
|
+
private toolsList;
|
|
108
|
+
/**
|
|
109
|
+
* Append a tool name to the rolling window, evicting the oldest past the
|
|
110
|
+
* cap — locally always, and to the shared window as a write-behind when
|
|
111
|
+
* there is one (the tool-call path does not wait on it).
|
|
112
|
+
*/
|
|
113
|
+
recordCall(toolName: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* The window `decide()` evaluates against: the shared sequence plus the
|
|
116
|
+
* candidate when the shared window answers, else the per-process copy.
|
|
117
|
+
* `callsLast60s` excludes the candidate either way, matching what
|
|
118
|
+
* `callsInLastMs()` returns before the call is recorded.
|
|
119
|
+
*/
|
|
120
|
+
loadWindow(toolName: string): Promise<SessionWindow>;
|
|
121
|
+
/**
|
|
122
|
+
* The reask ladder's counter, shared when the store answers. The local map
|
|
123
|
+
* is always bumped too, so a mid-ladder fallback keeps counting from where
|
|
124
|
+
* it was rather than restarting at one.
|
|
125
|
+
*/
|
|
126
|
+
incrReaskAttemptShared(key: string): Promise<number>;
|
|
127
|
+
/** Awaits the most recent write-behind; tests only. */
|
|
128
|
+
flush(): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Calls recorded within the last `windowMs` — Phase 3's `calls_last_60s`
|
|
131
|
+
* context field. Bounded by `TOOL_SEQUENCE_CAP`'s own window like every
|
|
132
|
+
* other read of `sequence`/`timestamps`: a burst that outlasts 60 real
|
|
133
|
+
* calls undercounts, the same honest limit `TOOL_SEQUENCE_CAP` already
|
|
134
|
+
* imposes on every sequence-based detector.
|
|
135
|
+
*/
|
|
136
|
+
callsInLastMs(windowMs?: number): number;
|
|
137
|
+
setToolContractChanged(changed: boolean): void;
|
|
138
|
+
/** `undefined` until at least one `tools/list` response has been TOFU-checked. */
|
|
139
|
+
getToolContractChanged(): boolean | undefined;
|
|
140
|
+
/** The recorded sequence, oldest first. */
|
|
141
|
+
getSequence(): readonly string[];
|
|
142
|
+
/**
|
|
143
|
+
* The sequence AS IF `toolName` were the next call — used to evaluate
|
|
144
|
+
* anomaly detectors BEFORE a decision is made, without mutating state.
|
|
145
|
+
* `interceptor.decide()` calls this to detect (e.g.) a fifth consecutive
|
|
146
|
+
* repeat on the call that WOULD BE the fifth, not the one after it;
|
|
147
|
+
* `recordCall` only actually persists the entry once the call is allowed
|
|
148
|
+
* (see `handleHarnessLine`, proxy.ts).
|
|
149
|
+
*/
|
|
150
|
+
prospectiveSequence(toolName: string): readonly string[];
|
|
151
|
+
/** Increment and return this key's reask attempt count. */
|
|
152
|
+
incrReaskAttempt(key: string): number;
|
|
153
|
+
/** Current reask attempt count for a key, `0` if it has never tripped. */
|
|
154
|
+
getReaskAttempts(key: string): number;
|
|
155
|
+
setToolsList(tools: readonly ToolsListEntry[]): void;
|
|
156
|
+
getToolsList(): readonly ToolsListEntry[];
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAKD,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAC3B;AAED,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,qBAAa,YAAY;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IACtD,+EAA+E;IAC/E,OAAO,CAAC,SAAS,CAAsC;gBAE3C,IAAI,GAAE,mBAAwB;IAK1C;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAA2B;IACrD,OAAO,CAAC,QAAQ,CAAe;IAC/B;8EAC0E;IAC1E,OAAO,CAAC,UAAU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