@ackuity/inline-proxy 0.7.6 → 0.7.7

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 CHANGED
@@ -279,4 +279,4 @@ src/
279
279
 
280
280
  ## Logging
281
281
 
282
- All MCP traffic is logged to `proxy_traffic.txt` in the working directory. Status messages are written to stderr with a `[PROXY]` prefix.
282
+ All MCP traffic is logged to `proxy_logs/proxy_traffic.txt` in the working directory. Status messages are written to stderr with a `[PROXY]` prefix.
package/dist/common.js CHANGED
@@ -26,7 +26,8 @@ export class ProxyProcessArguments {
26
26
  }
27
27
  }
28
28
  // --- Traffic logging ---
29
- const logFile = fs.createWriteStream("proxy_traffic.txt", { flags: "a" });
29
+ fs.mkdirSync("proxy_logs", { recursive: true });
30
+ const logFile = fs.createWriteStream("proxy_logs/proxy_traffic.txt", { flags: "a" });
30
31
  export function logTraffic(direction, msg) {
31
32
  const timestamp = new Date().toISOString();
32
33
  const pretty = JSON.stringify(msg, null, 2);
package/dist/main.js CHANGED
@@ -1,6 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import "dotenv/config";
3
- import { logToStderr, ProxyProcessArguments } from "./common.js";
3
+ import { formatError, logToStderr, ProxyProcessArguments } from "./common.js";
4
+ process.on("uncaughtException", (err) => {
5
+ if (err.name === "AbortError")
6
+ return;
7
+ logToStderr(`uncaught exception: ${formatError(err)}`);
8
+ });
9
+ process.on("unhandledRejection", (err) => {
10
+ if (err instanceof Error && err.name === "AbortError")
11
+ return;
12
+ logToStderr(`unhandled rejection: ${formatError(err)}`);
13
+ });
4
14
  import { modes } from "./config.js";
5
15
  import { setToolName } from "./inline_engine.js";
6
16
  const programArgs = new ProxyProcessArguments([
package/dist/mode.js CHANGED
@@ -56,11 +56,15 @@ async function startProxy(agentTransport, serverTransport, onClose) {
56
56
  try {
57
57
  agentTransport.close();
58
58
  }
59
- catch (_) { /* already closed */ }
59
+ catch (_) {
60
+ /* already closed */
61
+ }
60
62
  try {
61
63
  serverTransport.close();
62
64
  }
63
- catch (_) { /* already closed */ }
65
+ catch (_) {
66
+ /* already closed */
67
+ }
64
68
  onClose?.();
65
69
  };
66
70
  agentTransport.onmessage = async (msg) => {
@@ -69,7 +73,9 @@ async function startProxy(agentTransport, serverTransport, onClose) {
69
73
  try {
70
74
  await serverTransport.send(allowed);
71
75
  }
72
- catch (_) { /* server transport closed or aborted */ }
76
+ catch (_) {
77
+ /* server transport closed or aborted */
78
+ }
73
79
  }
74
80
  else {
75
81
  if ("id" in msg && msg.id !== undefined) {
@@ -77,10 +83,15 @@ async function startProxy(agentTransport, serverTransport, onClose) {
77
83
  await agentTransport.send({
78
84
  jsonrpc: "2.0",
79
85
  id: msg.id,
80
- error: { code: -32001, message: "Blocked by security policy" },
86
+ result: {
87
+ content: [{ type: "text", text: "Blocked by security policy" }],
88
+ isError: true,
89
+ },
81
90
  });
82
91
  }
83
- catch (_) { /* client already disconnected */ }
92
+ catch (_) {
93
+ /* client already disconnected */
94
+ }
84
95
  }
85
96
  }
86
97
  };
@@ -90,7 +101,9 @@ async function startProxy(agentTransport, serverTransport, onClose) {
90
101
  try {
91
102
  await agentTransport.send(allowed);
92
103
  }
93
- catch (_) { /* agent transport closed or aborted */ }
104
+ catch (_) {
105
+ /* agent transport closed or aborted */
106
+ }
94
107
  }
95
108
  };
96
109
  agentTransport.onerror = (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ackuity/inline-proxy",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",