craftagents:// URL protocol, allowing external applications and automation tools to navigate to specific views, create sessions, and trigger actions.
URL Protocol
All deep links use the custom protocol:The workspace ID is optional. If omitted, the link uses the currently focused window.
URL Formats
Deep links support two primary formats:Compound Routes (Hierarchical Navigation)
Action Routes
Navigation Examples
Session Management
Settings Navigation
Source Management
Actions
Actions trigger specific operations within the application.Create New Chat
Create a new chat session with optional pre-filled input:Pre-fill the chat input with this text
Set the session name (otherwise auto-generated)
If
true and input is provided, immediately send the messageSession Actions
Workspace Targeting
Explicitly target a specific workspace by prefixing the route:Window Management
Control how links open using query parameters:focused- Open in a new focused windowfull- Open in a new full-screen window
Sidebar Control
Open links with a specific right sidebar state:Right sidebar route (e.g.,
files/path/to/file, history)Implementation Details
Deep link handling is implemented inapps/electron/src/main/deep-link.ts.
URL Parsing
TheparseDeepLink() function parses URLs into structured targets:
DeepLinkTarget Interface
DeepLinkTarget Interface
Navigation Flow
- Parse URL - Extract target workspace, route, and parameters
- Resolve Window - Get or create target window
- Wait for Ready - Ensure renderer is loaded (100ms delay after
did-finish-load) - Send IPC - Dispatch navigation via
IPC_CHANNELS.DEEP_LINK_NAVIGATE
Protocol Registration
The protocol is registered at app launch in the Electron main process:Use Cases
Task Automation
Trigger agent sessions from task runners:IDE Integration
Create VS Code extension commands:Browser Extensions
Navigate from web pages:OAuth Callbacks
Deep links with theauth-callback host are reserved for OAuth flows:
Auth callback URLs return
null from parseDeepLink() and are handled by a separate OAuth handler.Related Files
Deep Link Handler
View the full implementation
IPC Channels
See IPC channel definitions