@rubberduck/cli.
Daemon Protocol Types
DaemonRequest
Discriminated union of all daemon request types.id— Unique request ID for correlationmethod— One of the supported daemon methodsparams— Type-safe parameters for that method
DaemonMethod
DaemonRequestMap
Maps each method to its parameter type.AttachParams
SayParams
SessionsParams
ExtensionUiResponseParams
DaemonResponse
DaemonEvent
Asynchronous events pushed from the daemon.DaemonMessage
Union of responses and events (what the daemon sends over the socket).Pi Event Types
PiEvent
Discriminated union of all Pi agent events.Agent Lifecycle Events
Turn Events
Message Events
Tool Execution Events
Compaction Events
Retry Events
Error Events
UI Request Event
Supporting Types
AgentMessage
ContentBlock
AssistantMessageDelta
Streaming update types:ToolContent
ToolResult
Session & Workspace Types
Session
Workspace
DaemonMetadata
Pi State Types
PiState
Current state of a Pi session.PiSessionStats
Usage statistics for a session.Renderer Types
RendererOptions
EventRenderer
RendererPiEvent
Utility Types
DoctorCheck
Usage Examples
Type-Safe Request
Event Type Narrowing
UI Request Handling
Constants
Path constants exported by the CLI for locating runtime files.APP_SUPPORT
~/Library/Application Support/RubberDuck
Override: Set RUBBER_DUCK_APP_SUPPORT environment variable.
SOCKET_PATH
~/Library/Application Support/RubberDuck/daemon.sock
Fallback: $TMPDIR/duck-<hash>.sock if default path exceeds Unix socket length limit.
METADATA_PATH
~/Library/Application Support/RubberDuck/metadata.json
CONFIG_PATH
~/Library/Application Support/RubberDuck/config.json
LOG_PATH
~/Library/Application Support/RubberDuck/duck-daemon.log
SESSIONS_DIR
~/Library/Application Support/RubberDuck/pi-sessions/
Usage Example
Utility Functions
Helper functions exported by the CLI for workspace and path management.workspaceId
absolutePath— Absolute filesystem path
findGitRoot
.git directory by walking up from startPath.
Parameters:
startPath— Starting directory path
null if not found.
Example:
resolveWorkspacePath
pathArg— Path string (relative, absolute, or undefined for cwd)
- If
pathArgis undefined, useprocess.cwd() - Resolve relative paths against cwd
- Check for
.gitdirectory and return repo root if found - Otherwise return the resolved absolute path
generateId
formatTimestamp
date— Date object