opencode-bridge 0.1.3__tar.gz → 0.1.4__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.
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/PKG-INFO +1 -1
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/opencode_bridge/server.py +21 -2
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/pyproject.toml +1 -1
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/.claude-plugin/plugin.json +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/.github/workflows/ci.yml +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/.github/workflows/release.yml +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/.gitignore +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/README.md +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/opencode_bridge/__init__.py +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/opencode_bridge/install.py +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/skills/opencode.md +0 -0
- {opencode_bridge-0.1.3 → opencode_bridge-0.1.4}/uv.lock +0 -0
|
@@ -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,19 @@ Set via:
|
|
|
302
303
|
session = self.sessions[sid]
|
|
303
304
|
session.add_message("user", message)
|
|
304
305
|
|
|
305
|
-
#
|
|
306
|
-
|
|
306
|
+
# For long messages, write to temp file to avoid shell escaping issues
|
|
307
|
+
temp_file = None
|
|
308
|
+
if len(message) > 500:
|
|
309
|
+
temp_file = tempfile.NamedTemporaryFile(
|
|
310
|
+
mode='w', suffix='.txt', delete=False, prefix='opencode_msg_'
|
|
311
|
+
)
|
|
312
|
+
temp_file.write(message)
|
|
313
|
+
temp_file.close()
|
|
314
|
+
args = ["run", "Respond to the message in the attached file."]
|
|
315
|
+
files = (files or []) + [temp_file.name]
|
|
316
|
+
else:
|
|
317
|
+
args = ["run", message]
|
|
318
|
+
|
|
307
319
|
args.extend(["--model", session.model])
|
|
308
320
|
args.extend(["--agent", session.agent])
|
|
309
321
|
|
|
@@ -325,6 +337,13 @@ Set via:
|
|
|
325
337
|
|
|
326
338
|
output, code = await self._run_opencode(*args)
|
|
327
339
|
|
|
340
|
+
# Cleanup temp file
|
|
341
|
+
if temp_file:
|
|
342
|
+
try:
|
|
343
|
+
os.unlink(temp_file.name)
|
|
344
|
+
except OSError:
|
|
345
|
+
pass
|
|
346
|
+
|
|
328
347
|
if code != 0:
|
|
329
348
|
return f"Error: {output}"
|
|
330
349
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|