|
|
8 months ago | |
|---|---|---|
| .. | ||
| README.md | 4b6def5f31 ContextProxy fix - constructor should not be async | 10 months ago |
| api.ts | 8def83192d Add IPC types to roo-code.d.ts (#3568) | 8 months ago |
| interface.ts | 8def83192d Add IPC types to roo-code.d.ts (#3568) | 8 months ago |
| ipc.ts | 8def83192d Add IPC types to roo-code.d.ts (#3568) | 8 months ago |
| log.ts | a73fce9027 Allow processes to access the Roo Code API via a unix socket (#2232) | 9 months ago |
| roo-code.d.ts | 8def83192d Add IPC types to roo-code.d.ts (#3568) | 8 months ago |
| types.ts | 8def83192d Add IPC types to roo-code.d.ts (#3568) | 8 months ago |
The Roo Code extension exposes an API that can be used by other extensions. To use this API in your extension:
src/extension-api/roo-code.d.ts to your extension's source directory.roo-code.d.ts in your extension's compilation.Get access to the API with the following code:
const extension = vscode.extensions.getExtension<RooCodeAPI>("rooveterinaryinc.roo-cline")
if (!extension?.isActive) {
throw new Error("Extension is not activated")
}
const api = extension.exports
if (!api) {
throw new Error("API is not available")
}
// Start a new task with an initial message.
await api.startNewTask("Hello, Roo Code API! Let's make a new project...")
// Start a new task with an initial message and images.
await api.startNewTask("Use this design language", ["data:image/webp;base64,..."])
// Send a message to the current task.
await api.sendMessage("Can you fix the @problems?")
// Simulate pressing the primary button in the chat interface (e.g. 'Save' or 'Proceed While Running').
await api.pressPrimaryButton()
// Simulate pressing the secondary button in the chat interface (e.g. 'Reject').
await api.pressSecondaryButton()
NOTE: To ensure that the rooveterinaryinc.roo-cline extension is activated before your extension, add it to the extensionDependencies in your package.json:
"extensionDependencies": ["rooveterinaryinc.roo-cline"]
For detailed information on the available methods and their usage, refer to the roo-code.d.ts file.