How notcorwin/surfwax works
Surf Wax is a Chrome Side Panel browser agent: users configure a model, describe a browser task, and review streamed responses and recorded tool results. The runtime coordinates model requests, conversation context and browser execution; users can also manage conversations and persistent user scripts. README capabilities are included, but some subsystem links are documented rather than visible in the sampled code, so those use README evidence.
Main entry points: useSidePanelRuntime.ts Conversation runtime · logging.ts Canonical event log · executor.ts Browser executor · App.tsx Side Panel
Components 24
Side Panel experience
- Side Panel
src/sidepanel/App.tsx - Chat and threads
src/components/chat/thread.tsx - Conversation search
src/components/chat/thread-list.tsx - Model settings
src/options/OptionsApp.tsx - User script manager
src/userscripts/ScriptsApp.tsx
Session runtime
- Session configuration
src/sidepanel/useSidePanelSession.ts - Conversation runtime
src/sidepanel/useSidePanelRuntime.ts - Run coordination
src/agent/coordinator.ts - Conversation store
src/sidepanel/conversation-store.ts
Agent and models
- Agent runner
src/agent/runner.ts - Chat transport
src/agent/transport.ts - Model routing
src/agent/model.ts - Model catalog and limits
src/agent/model-limits.ts - Context compaction
src/agent/compaction.ts
Browser automation
- Browser executor
src/chrome/executor.ts - Page inspection and actions
src/chrome/automation.ts - Background jobs
src/chrome/jobs.ts - Interaction guard
src/chrome/interaction-guard.ts
Local data and settings
- Canonical event log
src/logging.ts - Conversation projections
src/conversations.ts - Model configuration
src/sidepanel/config.ts - User script persistence
src/userscripts/persistence.ts
Other components
- User
- Configured model service
Connections 27
- User → Side Panel: opens and prompts
README.md - User → Model settings: configures model
README.md - User → User script manager: manages scripts
README.md - Side Panel → Chat and threads: renders
src/sidepanel/App.tsx - Side Panel → Conversation search: renders
src/sidepanel/App.tsx - Chat and threads → Conversation runtime: submits turns
- Conversation search → Conversation store: selects threads
- Model settings → Model configuration: saves settings
src/options/OptionsApp.tsx - Session configuration → Model configuration: loads settings
src/sidepanel/useSidePanelSession.ts - Conversation runtime → Conversation store: creates transport
src/sidepanel/useSidePanelRuntime.ts - Conversation runtime → Agent runner: creates agent
src/sidepanel/useSidePanelRuntime.ts - Conversation runtime → Model routing: creates model
src/sidepanel/useSidePanelRuntime.ts - Conversation runtime → Context compaction: summarizes context
src/sidepanel/useSidePanelRuntime.ts - Conversation runtime → Browser executor: runs browser work
src/sidepanel/useSidePanelRuntime.ts - Conversation runtime → Run coordination: coordinates runs
src/sidepanel/useSidePanelRuntime.ts - Agent runner → Chat transport: streams turns
- Model routing → Model catalog and limits: resolves limits
src/agent/model-limits.ts - Model routing → Configured model service: sends model requests
README.md - Context compaction → Canonical event log: reads and appends
src/agent/compaction.ts - Conversation store → Canonical event log: records events
- Conversation projections → Canonical event log: reads events
src/conversations.ts - Browser executor → Page inspection and actions: dispatches actions
- Browser executor → Background jobs: manages jobs
- Browser executor → Interaction guard: protects interaction
- User script manager → User script persistence: manages scripts
src/userscripts/ScriptsApp.tsx - User script persistence → Canonical event log: records changes
src/userscripts/persistence.ts - Canonical event log → Conversation projections: projects history
src/conversations.ts