|
|
пре 4 недеља | |
|---|---|---|
| .. | ||
| src | 3f4f7c0c41 Better IPC error logging (#9727) | пре 4 недеља |
| README.md | 9a734d0cab Add an API for resuming tasks by ID (#7122) | пре 4 месеци |
| eslint.config.mjs | d87f890556 Move evals into pnpm workspace, switch from SQLite to Postgres (#4278) | пре 7 месеци |
| package.json | 62c3914034 Farewell jest (#4607) | пре 6 месеци |
| tsconfig.json | d87f890556 Move evals into pnpm workspace, switch from SQLite to Postgres (#4278) | пре 7 месеци |
This package provides IPC functionality for Roo Code, allowing external applications to communicate with the extension through a socket-based interface.
The IPC interface supports the following task commands:
Starts a new task with optional configuration and initial message.
Parameters:
configuration: RooCode settings objecttext: Initial task message (string)images: Array of image data URIs (optional)newTab: Whether to open in a new tab (boolean, optional)Cancels a running task.
Parameters:
data: Task ID to cancel (string)Closes a task and performs cleanup.
Parameters:
data: Task ID to close (string)Resumes a task from history.
Parameters:
data: Task ID to resume (string)Error Handling:
import { IpcClient } from "@roo-code/ipc"
const client = new IpcClient("/path/to/socket")
// Resume a task
client.sendCommand({
commandName: "ResumeTask",
data: "task-123",
})
// Start a new task
client.sendCommand({
commandName: "StartNewTask",
data: {
configuration: {
/* RooCode settings */
},
text: "Hello, world!",
images: [],
newTab: false,
},
})
The IPC interface also emits task events that clients can listen to:
TaskStarted: When a task beginsTaskCompleted: When a task finishesTaskAborted: When a task is cancelledMessage: When a task sends a messageThe socket path is typically located in the system's temporary directory and follows the pattern:
/tmp/roo-code-{id}.sock\\.\pipe\roo-code-{id}