sweetspot-remote-agent 1.8.4 → 1.8.5

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.
Files changed (2) hide show
  1. package/mcp-server.js +9 -4
  2. package/package.json +1 -1
package/mcp-server.js CHANGED
@@ -367,10 +367,15 @@ async function executeAction(msg) {
367
367
  case "sysinfo": { return { action, success: true, info: getSystemInfo() }; }
368
368
  case "applescript": {
369
369
  const { execSync } = await import("child_process");
370
- const output = execSync(`osascript -e '${msg.script.replace(/'/g, "'\\''")}'`, {
371
- timeout: 15000, encoding: "utf-8", maxBuffer: 1024 * 1024,
372
- });
373
- return { action, success: true, output: output || "(실행 완료)" };
370
+ const { writeFileSync, unlinkSync } = await import("fs");
371
+ const tmpFile = `/tmp/sweetspot_${Date.now()}.applescript`;
372
+ writeFileSync(tmpFile, msg.script, "utf-8");
373
+ try {
374
+ const output = execSync(`osascript '${tmpFile}'`, { timeout: 15000, encoding: "utf-8", maxBuffer: 1024 * 1024 });
375
+ return { action, success: true, output: output || "(실행 완료)" };
376
+ } finally {
377
+ try { unlinkSync(tmpFile); } catch {}
378
+ }
374
379
  }
375
380
  case "list_files": {
376
381
  const { execSync } = await import("child_process");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sweetspot-remote-agent",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "Sweetspot 원격 제어 MCP 서버 — 스크린샷, 마우스/키보드, 앱 제어, 파일 탐색, 셸 실행",
5
5
  "type": "module",
6
6
  "main": "mcp-server.js",