machine-bridge-mcp 1.2.10 → 1.2.11
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/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -1
- package/browser-extension/manifest.json +2 -2
- package/docs/ARCHITECTURE.md +5 -1
- package/docs/AUDIT.md +12 -0
- package/docs/LOGGING.md +3 -1
- package/docs/OPERATIONS.md +3 -2
- package/docs/RELEASING.md +1 -1
- package/docs/TESTING.md +5 -1
- package/docs/TOOL_REFERENCE.md +4 -4
- package/package.json +6 -2
- package/scripts/check-plan.mjs +3 -0
- package/scripts/check-runner.mjs +75 -0
- package/scripts/coverage-check.mjs +1 -1
- package/scripts/github-backlog.mjs +116 -0
- package/scripts/github-push.mjs +4 -0
- package/scripts/release-acceptance.mjs +29 -13
- package/scripts/run-checks.mjs +11 -21
- package/src/local/bounded-output.mjs +20 -3
- package/src/local/errors.mjs +5 -1
- package/src/local/execution-limits.mjs +6 -1
- package/src/local/process-execution.mjs +94 -14
- package/src/local/process-output-stream.mjs +82 -0
- package/src/local/process-result-projection.mjs +25 -0
- package/src/local/process-sessions.mjs +37 -51
- package/src/local/runtime.mjs +1 -0
- package/src/local/secure-file.mjs +24 -4
- package/src/local/tools.mjs +4 -9
- package/src/shared/result-projection.d.mts +6 -0
- package/src/shared/result-projection.json +4 -0
- package/src/shared/result-projection.mjs +50 -0
- package/src/shared/server-metadata.json +1 -0
- package/src/shared/tool-catalog.json +4 -4
- package/src/worker/errors.ts +18 -4
- package/src/worker/index.ts +1 -1
- package/src/worker/mcp-jsonrpc.ts +4 -2
|
@@ -1230,7 +1230,7 @@
|
|
|
1230
1230
|
{
|
|
1231
1231
|
"name": "run_local_command",
|
|
1232
1232
|
"title": "Run registered local command",
|
|
1233
|
-
"description": "Run an effective manifest or automatic package-script command through its fixed argv, cwd, timeout ceiling, and extra-argument policy.",
|
|
1233
|
+
"description": "Run an effective manifest or automatic package-script command through its fixed argv, cwd, timeout ceiling, and extra-argument policy. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.",
|
|
1234
1234
|
"availability": "direct-exec",
|
|
1235
1235
|
"annotations": {
|
|
1236
1236
|
"readOnlyHint": false,
|
|
@@ -1665,7 +1665,7 @@
|
|
|
1665
1665
|
{
|
|
1666
1666
|
"name": "run_process",
|
|
1667
1667
|
"title": "Run process directly",
|
|
1668
|
-
"description": "Execute an argv array without a command shell. This avoids shell parsing but does not sandbox the executable or code it launches.",
|
|
1668
|
+
"description": "Execute an argv array without a command shell. This avoids shell parsing but does not sandbox the executable or code it launches. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.",
|
|
1669
1669
|
"availability": "direct-exec",
|
|
1670
1670
|
"annotations": {
|
|
1671
1671
|
"readOnlyHint": false,
|
|
@@ -1737,7 +1737,7 @@
|
|
|
1737
1737
|
{
|
|
1738
1738
|
"name": "read_process",
|
|
1739
1739
|
"title": "Read process session",
|
|
1740
|
-
"description": "Read bounded stdout and stderr deltas from a
|
|
1740
|
+
"description": "Read bounded stdout and stderr deltas from a running process session or a recently completed one-shot command continuation, optionally waiting briefly for new output.",
|
|
1741
1741
|
"availability": "direct-exec",
|
|
1742
1742
|
"annotations": {
|
|
1743
1743
|
"readOnlyHint": true,
|
|
@@ -2382,7 +2382,7 @@
|
|
|
2382
2382
|
{
|
|
2383
2383
|
"name": "exec_command",
|
|
2384
2384
|
"title": "Execute shell command",
|
|
2385
|
-
"description": "Execute a shell command with workspace cwd. This is not a sandbox and has the operating-system authority of the local user.",
|
|
2385
|
+
"description": "Execute a shell command with workspace cwd. This is not a sandbox and has the operating-system authority of the local user. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.",
|
|
2386
2386
|
"availability": "shell-exec",
|
|
2387
2387
|
"annotations": {
|
|
2388
2388
|
"readOnlyHint": false,
|
package/src/worker/errors.ts
CHANGED
|
@@ -8,12 +8,14 @@ const WORKER_ERROR_CODES = new Set([
|
|
|
8
8
|
export class WorkerToolError extends Error {
|
|
9
9
|
readonly code: string;
|
|
10
10
|
readonly retryable: boolean;
|
|
11
|
+
readonly details?: Record<string, unknown>;
|
|
11
12
|
|
|
12
|
-
constructor(code: string, message: string, retryable = false) {
|
|
13
|
+
constructor(code: string, message: string, retryable = false, details?: Record<string, unknown>) {
|
|
13
14
|
super(message);
|
|
14
15
|
this.name = "WorkerToolError";
|
|
15
16
|
this.code = normalizeCode(code);
|
|
16
17
|
this.retryable = retryable;
|
|
18
|
+
this.details = details;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -23,11 +25,19 @@ export function daemonToolError(value: unknown): WorkerToolError {
|
|
|
23
25
|
const message = typeof input.message === "string" && input.message
|
|
24
26
|
? input.message.slice(0, 2000)
|
|
25
27
|
: "daemon tool failed";
|
|
26
|
-
return new WorkerToolError(
|
|
28
|
+
return new WorkerToolError(
|
|
29
|
+
code, message, input.retryable === true,
|
|
30
|
+
isRecord(input.details) ? input.details : undefined,
|
|
31
|
+
);
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
export function publicWorkerToolError(error: unknown): { code: string; message: string; retryable: boolean } {
|
|
30
|
-
if (error instanceof WorkerToolError)
|
|
34
|
+
export function publicWorkerToolError(error: unknown): { code: string; message: string; retryable: boolean; details?: Record<string, unknown> } {
|
|
35
|
+
if (error instanceof WorkerToolError) {
|
|
36
|
+
return {
|
|
37
|
+
code: error.code, message: error.message, retryable: error.retryable,
|
|
38
|
+
...(error.details ? { details: error.details } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
31
41
|
return { code: "execution_failed", message: "tool execution failed", retryable: false };
|
|
32
42
|
}
|
|
33
43
|
|
|
@@ -36,6 +46,10 @@ function normalizeCode(value: unknown): string {
|
|
|
36
46
|
return WORKER_ERROR_CODES.has(code) ? code : "execution_failed";
|
|
37
47
|
}
|
|
38
48
|
|
|
49
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
50
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
51
|
+
}
|
|
52
|
+
|
|
39
53
|
function asObject(value: unknown): Record<string, unknown> {
|
|
40
54
|
return value && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : {};
|
|
41
55
|
}
|
package/src/worker/index.ts
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./websocket-protocol.ts";
|
|
35
35
|
|
|
36
36
|
const SERVER_NAME = String(serverMetadata.name);
|
|
37
|
-
const SERVER_VERSION = "1.2.
|
|
37
|
+
const SERVER_VERSION = "1.2.11";
|
|
38
38
|
const MCP_PROTOCOL_VERSION = String(serverMetadata.protocolVersion);
|
|
39
39
|
const MCP_SUPPORTED_PROTOCOL_VERSIONS = serverMetadata.supportedProtocolVersions.map((value) => String(value));
|
|
40
40
|
const DEFAULT_MAX_BODY_BYTES = 8 * 1024 * 1024;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { projectMcpResult } from "../shared/result-projection.mjs";
|
|
1
2
|
const JSONRPC_VERSION = "2.0";
|
|
2
3
|
const MAX_SESSION_INSTRUCTION_BYTES = 3 * 1024 * 1024;
|
|
3
4
|
|
|
@@ -48,11 +49,12 @@ export function textToolResult(value: unknown, isError = false): Record<string,
|
|
|
48
49
|
return result;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
const projection = projectMcpResult(value);
|
|
51
53
|
const result: Record<string, unknown> = {
|
|
52
|
-
content: [{ type: "text", text:
|
|
54
|
+
content: [{ type: "text", text: projection.text }],
|
|
53
55
|
isError,
|
|
54
56
|
};
|
|
55
|
-
if (
|
|
57
|
+
if (projection.structuredContent) result.structuredContent = projection.structuredContent;
|
|
56
58
|
return result;
|
|
57
59
|
}
|
|
58
60
|
|