@0xmaxma/claude-gateway 1.2.17 → 1.2.18

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.
@@ -39,8 +39,8 @@ export class BrowserModule implements ToolModule {
39
39
 
40
40
  if (name === 'browser_screenshot' && !result.isError) {
41
41
  // getpod-browser returns {type:"image", data: base64, mimeType:"image/jpeg"}.
42
- // Decode and save so callers can attach the file path directly.
43
- // For API sessions, save to the session media dir so files are HTTP-accessible.
42
+ // Always return the absolute file path callers use api_reply(files=[path])
43
+ // and the gateway converts the path to an attachment URL in the response.
44
44
  const block = result.content[0] as Record<string, string> | undefined;
45
45
  const b64 = block?.['data'] ?? '';
46
46
  const mime = block?.['mimeType'] ?? 'image/jpeg';
@@ -54,19 +54,6 @@ export class BrowserModule implements ToolModule {
54
54
  const filename = `browser_shot_${sid}_${Date.now()}.${ext}`;
55
55
  filePath = path.join(mediaDir, filename);
56
56
  fs.writeFileSync(filePath, Buffer.from(b64, 'base64'));
57
- const apiUrl = process.env.GATEWAY_API_URL;
58
- const agentId = process.env.GATEWAY_AGENT_ID;
59
- if (apiUrl && agentId) {
60
- // mediaDir is <agentBase>/media/<subdir>; parent is the agent's media root
61
- const agentMediaRoot = path.dirname(mediaDir);
62
- const relPath = path.relative(agentMediaRoot, filePath)
63
- .split(path.sep)
64
- .map(encodeURIComponent)
65
- .join('/');
66
- return {
67
- content: [{ type: 'text', text: `${apiUrl}/v1/agents/${encodeURIComponent(agentId)}/media/${relPath}` }],
68
- };
69
- }
70
57
  return { content: [{ type: 'text', text: filePath }] };
71
58
  }
72
59
  filePath = path.join('/tmp', `browser_shot_${sid}.${ext}`);
@@ -53,16 +53,15 @@ If `browser_navigate` or `browser_navigate_tab` returns error like `tab "t99" no
53
53
 
54
54
  ### Step 5 — Screenshot and confirm
55
55
 
56
- Call `mcp__gateway__browser_screenshot` → `result` is either an HTTP URL or an absolute file path.
56
+ Call `mcp__gateway__browser_screenshot` → `result` is an **absolute file path**.
57
57
 
58
58
  Detect channel: `api_reply` tool available = API session; `telegram_reply` tool available = Telegram session.
59
59
 
60
- | Channel | Condition | Action |
61
- |---------|-----------|--------|
62
- | API | result starts with `http` | `api_reply(text=result)` |
63
- | API | result is a file path | `api_reply(attachments=[result])` |
64
- | Telegram | | `telegram_reply(files=[result])` |
65
- | Other | — | include path in text response |
60
+ | Channel | Action |
61
+ |---------|--------|
62
+ | API | `api_reply(files=[result])` — caller receives it as an attachment with a URL |
63
+ | Telegram | `telegram_reply(files=[result])` |
64
+ | Other | include path in text response |
66
65
 
67
66
  ## Multi-tab Management
68
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmaxma/claude-gateway",
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
4
4
  "description": "Multi-agent gateway for Claude",
5
5
  "repository": {
6
6
  "type": "git",