openvisio-agent 0.10.0 → 0.10.1
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.mjs +2 -1
- package/package.json +1 -1
- package/src/watch.mjs +16 -4
package/bin/cli.mjs
CHANGED
|
@@ -91,7 +91,8 @@ function mcpReplace(claude, addArgs) {
|
|
|
91
91
|
// background service) to work — an `npx` connect leaves nothing installed. Make
|
|
92
92
|
// the global install part of setup.
|
|
93
93
|
function ensureAgentInstalled() {
|
|
94
|
-
|
|
94
|
+
const current = onPath('openvisio-agent')
|
|
95
|
+
if (current && !current.includes('/_npx/')) return
|
|
95
96
|
info('Installing openvisio-agent globally (so `watch` and the always-on service have a stable command)…')
|
|
96
97
|
spawnSync('npm', ['i', '-g', 'openvisio-agent@latest'], { stdio: 'inherit', shell: process.platform === 'win32' })
|
|
97
98
|
}
|
package/package.json
CHANGED
package/src/watch.mjs
CHANGED
|
@@ -217,9 +217,21 @@ export async function runWatch({ flags }) {
|
|
|
217
217
|
if (!flags.install) {
|
|
218
218
|
const lock = acquireSingleInstance(slug || 'openvisio')
|
|
219
219
|
if (lock.conflict) {
|
|
220
|
-
|
|
220
|
+
const watcherName = slug || 'openvisio'
|
|
221
|
+
const stop = process.platform === 'darwin'
|
|
222
|
+
? `launchctl unload ~/Library/LaunchAgents/io.openvisio.${watcherName}.plist`
|
|
223
|
+
: process.platform === 'win32'
|
|
224
|
+
? 'Stop the existing openvisio-agent process in Task Manager.'
|
|
225
|
+
: `systemctl --user stop openvisio-${watcherName}.service`
|
|
226
|
+
const logs = process.platform === 'darwin'
|
|
227
|
+
? `tail -f ~/.openvisio/${watcherName}.log`
|
|
228
|
+
: `journalctl --user -u openvisio-${watcherName} -f`
|
|
229
|
+
fail(`Another openvisio-agent watcher for "${watcherName}" is already running (pid ${lock.conflict}).\n` +
|
|
221
230
|
` Two watchers for the same agent BOTH reply to every mention — that is what causes duplicate/contradicting messages.\n` +
|
|
222
|
-
`
|
|
231
|
+
` This is usually the auto-restarting background service; killing its PID only makes it restart.\n` +
|
|
232
|
+
` To run in this terminal instead, stop the service first:\n ${stop}\n` +
|
|
233
|
+
` Or keep the service and inspect its log:\n ${logs}\n` +
|
|
234
|
+
` Refusing to start a second watcher.`)
|
|
223
235
|
}
|
|
224
236
|
process.on('exit', () => { try { lock.release && lock.release() } catch { /* noop */ } })
|
|
225
237
|
}
|
|
@@ -321,7 +333,7 @@ function createCodexRunner({ mcpUrl, mcpHeaders, workdir, canCode, maxCycleMs, l
|
|
|
321
333
|
? `mcp_servers={ openvisio-team = { url = ${tomlString(mcpUrl)}${headerEntries ? `, http_headers = { ${headerEntries} }` : ''} } }`
|
|
322
334
|
: ''
|
|
323
335
|
const args = ['exec', '--ignore-user-config', '--skip-git-repo-check', '--ephemeral', '--json', '--color', 'never',
|
|
324
|
-
|
|
336
|
+
...(canCode ? ['--approve-for-me'] : ['--sandbox', 'read-only']),
|
|
325
337
|
...(m ? ['--model', m] : []),
|
|
326
338
|
...(mcpOverride ? ['-c', mcpOverride] : []),
|
|
327
339
|
full]
|
|
@@ -815,7 +827,7 @@ function loop({ host, key, slug, claude, agent, mcpConfig, mcpUrl, workdir, mode
|
|
|
815
827
|
// ── background service install (launchd / systemd) ───────────────────────────
|
|
816
828
|
export function installService({ slug, workdir }) {
|
|
817
829
|
const binPath = onPath('openvisio-agent')
|
|
818
|
-
if (!binPath) {
|
|
830
|
+
if (!binPath || binPath.includes('/_npx/')) {
|
|
819
831
|
info('Installing openvisio-agent globally so the background service has a stable path…')
|
|
820
832
|
spawnSync('npm', ['i', '-g', 'openvisio-agent'], { stdio: 'inherit', shell: process.platform === 'win32' })
|
|
821
833
|
}
|