Add Campfire support

Merged
NI
4mo ago
+5778-236

Summary

Adds first-class support for Campfire, a collaborative pi-based harness:

  • cmux hooks campfire installs/uninstalls the hook extension. Current Campfire ships a native built-in bridge (zero setup); the installed extension serves older versions and defers to the native bridge so nothing double-fires
  • records the host role only (CAMPFIRE_SESSION_ROLE) — a joiner is an ephemeral view whose argv carries the invite URL, a capability token that is never persisted or replayed
  • tags launches kind=campfire with a normalized bun-compiled argv, so restore runs campfire --session <id> instead of mis-resuming as plain pi
  • surfaces join requests, capability asks, and MCP approvals as notifications with notification_type signals (Needs Input while a dialog blocks the driver)
  • sanitizer preserves --relay and pi config flags; drops prompts, session selectors, --join-as, and invite URLs; env replay keeps CAMPFIRE_* roots, never secrets
  • Vault and Task Manager detect campfire processes; sessions under ~/.campfire/agent/sessions

Verification

  • ./scripts/reload.sh --tag campfire-support
  • xcodebuild test -project cmux.xcodeproj -scheme cmux-unit -destination 'platform=macOS' -derivedDataPath /tmp/cmux-campfire-support -only-testing:cmuxTests/CampfireSupportTests
  • swift test --package-path Packages/CMUXAgentLaunch
  • python3 tests/test_campfire_extension_install.py
  • ./scripts/check-pbxproj.sh && ./scripts/lint-pbxproj-test-wiring.sh
  • Live end-to-end against the tagged build: status, notifications, watcher pill, joiner presence, and quit→relaunch restore

Localization

New cli.hooks.campfire.* strings across all 20 locales (modeled on cli.hooks.omp.*); en and ja audited. Docs: agent-hooks.md, vault.md, feed.md, session-restore page.

Summary by CodeRabbit

  • New Features

    • Added support for the Campfire agent, including install/uninstall hooks, session restore, launch normalization, and collaboration notifications.
    • Campfire sessions now have localized hook messages and improved resume behavior.
  • Bug Fixes

    • Improved handling of Campfire launch arguments and environment data to better preserve valid session state while avoiding unsafe or stale values.
    • Added safeguards so Campfire hook installation won’t overwrite unrelated files.
  • Documentation

    • Updated agent-hook, feed, vault, and session-restore docs to include Campfire support.

[!NOTE]
Medium Risk
Touches session restore, launch argv/env replay, and explicit handling of invite capability tokens; mitigated by host-only persistence, sanitizer drops, and new tests.

Overview
Adds Campfire as a supported agent alongside Pi/OMP: cmux hooks campfire installs a managed TypeScript extension under ~/.campfire/agent/extensions, registers the agent in the hook catalog, and wires install/uninstall into hooks setup.

The extension forwards host-only session lifecycle to cmux hooks campfire (joiners and native Campfire cmux bridges are skipped) and pushes collaborative observer events (join requests, capability asks, relay errors) into cmux notifications via new payload fields and summarizeCampfireObserverNotification.

Restore and launch capture treat Campfire as its own kind: resume uses campfire --session, argv sanitization drops invite URLs and joiner flags while keeping --relay, launch trust recognizes script hosts, and AgentLaunchEnvironmentPolicy replays CAMPFIRE_* roots but strips Pi-managed env for kind=campfire. Vault gains builtInCampfire, richer detect rules (alternateProcessNames / alternateArgvContainsAny), host-role gating for restorable snapshots, and CampfireLaunchArgumentNormalizer for bun/node entrypoints.

Supporting changes include Task Manager agent definition, CLI help/docs strings, a CI install test, and localized strings for hook UX and notification copy.

Reviewed by Cursor Bugbot for commit 653c5d9b3342e434d04c5251453ca601a161e52b. Bugbot is set up for automated code reviews on this repo. Configure here.