pixel-office-openclaw 0.1.7 → 0.1.9

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/package.json +1 -1
  2. package/server.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixel-office-openclaw",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Watch your OpenClaw AI agents work in a pixel-art virtual office",
5
5
  "type": "module",
6
6
  "bin": {
package/server.js CHANGED
@@ -244,7 +244,10 @@ app.post('/api/send', async (req, res) => {
244
244
  // Use env -i with essential vars to get a clean process, avoiding npx inheritance
245
245
  const essential = ['HOME', 'PATH', 'USER', 'SHELL', 'LANG', 'TERM', 'XDG_RUNTIME_DIR', 'DBUS_SESSION_BUS_ADDRESS']
246
246
  const envArgs = essential.filter(k => process.env[k]).map(k => `${k}=${process.env[k]}`)
247
- const cliResult = execFileSync('/usr/bin/env', ['-i', ...envArgs, '/usr/bin/openclaw', 'agent', '--agent', safeAgentId, '--message', safeMessage, '--json'],
247
+ // Find openclaw binary dynamically (works on Linux, Mac, any install location)
248
+ let openclawBin
249
+ try { openclawBin = execFileSync('which', ['openclaw'], { encoding: 'utf-8' }).trim() } catch { openclawBin = 'openclaw' }
250
+ const cliResult = execFileSync('/usr/bin/env', ['-i', ...envArgs, openclawBin, 'agent', '--agent', safeAgentId, '--message', safeMessage, '--json'],
248
251
  { timeout: 120000, encoding: 'utf-8', cwd: homedir(), stdio: ['pipe', 'pipe', 'pipe'] }
249
252
  )
250
253
  console.log(`[bridge] Sent to ${safeAgentId} (CLI OK)`)