Outsrc CLI upgrade
Detect and apply upgrades for the global outsrc package (and related products via outsrc updates) on the owner’s machine. Widget yes required before any upgrade.
Baseline: Exchange templates expect outsrc@0.2.1+ (streams, doctor update_available/version, outsrc updates, finished-run usage tokens, model cache). If installed is older, treat upgrade as high priority before promising those features.
When
- Handshake (default): on the first Outsrc CLI call in a conversation with the owner (doctor, list_targets, send, inbox, or
updates --json), fold in a cheap pending-update read — do not burn tokens on a separate Grok Bot poll routine. - Owner asks “is outsrc outdated?” / “upgrade outsrc”
- Setup doctor reports update available
- Before relying on a 0.2.1+ feature the installed CLI lacks
No token polling
Do not create or run a Grok Bot routine that periodically checks for CLI updates. Studio may cron outsrc updates refresh (writes ~/.outsrc/updates.json without calling models). The bot only reads that signal (or doctor) when it already talks to the CLI / owner asks.
Prefer updates + doctor (0.2.1+)
outsrc updates --json(or--caller outsrc-bot --json): print last check; list unread pending (product, installed, latest). After the owner has seen them (or declines),outsrc updates ack <id>…or--allso they don’t repeat.outsrc updates refresh: token-free version probe (vendor--version/ npm registry). Never installs. Use when the owner asks for a fresh check or Studio cron hasn’t run.outsrc doctor --caller outsrc-bot --json: includesupdate_available(true only when installed outsrc is behind npm) andversion: {status, installed, latest}(status: current | outdated | ahead | unknown). Doctor never upgrades. Registry timeout →unknown,update_availablefalse, exit unaffected. Doctor may also summarizeupdatesfor other products.- npm fallback only if doctor/updates unavailable (ancient install):
npm outdated -g outsrc --jsonornpm view outsrc versionvs installed.
Steps (upgrade path)
- Machine. ListMachines → connected desktop where outsrc is installed.
- Installed. Confirm
outsrcon PATH /npm list -g outsrc --depth=0. If missing → getting-started install, not upgrade. - Pending? Handshake read above.
- Report. Current vs latest; pending or not. Do not upgrade yet.
- Widget. If pending: Upgrade to now | Not now | Skip. Note: global npm on this machine; may interrupt in-flight CLIs; re-run doctor after.
- Upgrade (only on Yes).
npm install -g outsrc@latest(never npx). Confirm version +outsrc doctor. - After. Surface doctor/plugin warnings once; no engine pin without separate owner yes. Ack updates so the same notice doesn’t repeat every handshake.
Notes
- Caller for mailbox tools stays
outsrc-bot; upgrade does not change caller. - After upgrade to 0.2.1+, mention once:
outsrc streams/watch,outsrc usage,outsrc models refresh, and doctor/updatesare available.