opencode-bridge 0.1.3__tar.gz → 0.1.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opencode-bridge
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: MCP server for continuous OpenCode discussion sessions
5
5
  Project-URL: Repository, https://github.com/genomewalker/opencode-bridge
6
6
  Author: Antonio Fernandez-Guerra
@@ -19,6 +19,7 @@ import os
19
19
  import json
20
20
  import asyncio
21
21
  import shutil
22
+ import tempfile
22
23
  from datetime import datetime
23
24
  from pathlib import Path
24
25
  from typing import Optional
@@ -302,8 +303,15 @@ Set via:
302
303
  session = self.sessions[sid]
303
304
  session.add_message("user", message)
304
305
 
305
- # Build command - message must come right after "run" as positional arg
306
- args = ["run", message]
306
+ # Always write message to temp file to avoid shell escaping issues
307
+ temp_file = tempfile.NamedTemporaryFile(
308
+ mode='w', suffix='.md', delete=False, prefix='opencode_msg_'
309
+ )
310
+ temp_file.write(message)
311
+ temp_file.close()
312
+ args = ["run", "Respond to the request in the attached message file."]
313
+ files = (files or []) + [temp_file.name]
314
+
307
315
  args.extend(["--model", session.model])
308
316
  args.extend(["--agent", session.agent])
309
317
 
@@ -325,6 +333,13 @@ Set via:
325
333
 
326
334
  output, code = await self._run_opencode(*args)
327
335
 
336
+ # Cleanup temp file
337
+ if temp_file:
338
+ try:
339
+ os.unlink(temp_file.name)
340
+ except OSError:
341
+ pass
342
+
328
343
  if code != 0:
329
344
  return f"Error: {output}"
330
345
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "opencode-bridge"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "MCP server for continuous OpenCode discussion sessions"
9
9
  readme = "README.md"
10
10
  license = "MIT"
File without changes