@different-ai/opencode-browser 1.0.4 → 1.0.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.
- package/bin/cli.js +43 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -217,7 +217,49 @@ exec "${nodePath}" "${hostScriptPath}" "$@"
|
|
|
217
217
|
const logsDir = join(homedir(), ".opencode-browser", "logs");
|
|
218
218
|
mkdirSync(logsDir, { recursive: true });
|
|
219
219
|
|
|
220
|
-
header("Step 5:
|
|
220
|
+
header("Step 5: Install Background Daemon");
|
|
221
|
+
|
|
222
|
+
if (os === "darwin") {
|
|
223
|
+
const daemonPath = join(PACKAGE_ROOT, "src", "daemon.js");
|
|
224
|
+
|
|
225
|
+
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
226
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
227
|
+
<plist version="1.0">
|
|
228
|
+
<dict>
|
|
229
|
+
<key>Label</key>
|
|
230
|
+
<string>com.opencode.browser-daemon</string>
|
|
231
|
+
<key>ProgramArguments</key>
|
|
232
|
+
<array>
|
|
233
|
+
<string>${nodePath}</string>
|
|
234
|
+
<string>${daemonPath}</string>
|
|
235
|
+
</array>
|
|
236
|
+
<key>RunAtLoad</key>
|
|
237
|
+
<true/>
|
|
238
|
+
<key>KeepAlive</key>
|
|
239
|
+
<true/>
|
|
240
|
+
<key>StandardOutPath</key>
|
|
241
|
+
<string>${logsDir}/daemon.log</string>
|
|
242
|
+
<key>StandardErrorPath</key>
|
|
243
|
+
<string>${logsDir}/daemon.log</string>
|
|
244
|
+
</dict>
|
|
245
|
+
</plist>`;
|
|
246
|
+
|
|
247
|
+
const plistPath = join(homedir(), "Library", "LaunchAgents", "com.opencode.browser-daemon.plist");
|
|
248
|
+
writeFileSync(plistPath, plist);
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
execSync(`launchctl unload "${plistPath}" 2>/dev/null || true`, { stdio: "ignore" });
|
|
252
|
+
execSync(`launchctl load "${plistPath}"`, { stdio: "ignore" });
|
|
253
|
+
success("Daemon installed and started");
|
|
254
|
+
} catch (e) {
|
|
255
|
+
warn("Could not start daemon automatically. Run: launchctl load " + plistPath);
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
warn("On Linux, create a systemd service for the daemon manually.");
|
|
259
|
+
log(`Daemon script: ${join(PACKAGE_ROOT, "src", "daemon.js")}`);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
header("Step 6: Configure OpenCode");
|
|
221
263
|
|
|
222
264
|
const serverPath = join(PACKAGE_ROOT, "src", "server.js");
|
|
223
265
|
const mcpConfig = {
|
package/package.json
CHANGED