@roo-code/types 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,47 @@
1
- # Roo Code Types
1
+ # Roo Code API
2
2
 
3
- TypeScript type definitions for Roo Code. Available on [NPM](https://www.npmjs.com/package/@roo-code/types).
3
+ The Roo Code extension exposes an API that can be used by other extensions.
4
+ To use this API in your extension:
4
5
 
5
- ## Installation
6
+ 1. Install `@roo-code/types` with npm, pnpm, or yarn.
7
+ 2. Import the `RooCodeAPI` type.
8
+ 3. Load the extension API.
6
9
 
7
- ```bash
8
- npm add -D @roo-code/types
9
- pnpm add -D @roo-code/types
10
- yarn add -D @roo-code/types
11
- ```
10
+ ```typescript
11
+ import { RooCodeAPI } from "@roo-code/types"
12
12
 
13
- ## Usage
13
+ const extension = vscode.extensions.getExtension<RooCodeAPI>("RooVeterinaryInc.roo-cline")
14
14
 
15
- Import the types in your TypeScript files:
15
+ if (!extension?.isActive) {
16
+ throw new Error("Extension is not activated")
17
+ }
16
18
 
17
- ```typescript
18
- import type { RooCodeAPI } from "@roo-code/types"
19
+ const api = extension.exports
19
20
 
20
- const settings: RooCodeSettings = {
21
- autoApprovalEnabled: true,
22
- ...
21
+ if (!api) {
22
+ throw new Error("API is not available")
23
23
  }
24
+
25
+ // Start a new task with an initial message.
26
+ await api.startNewTask("Hello, Roo Code API! Let's make a new project...")
27
+
28
+ // Start a new task with an initial message and images.
29
+ await api.startNewTask("Use this design language", ["data:image/webp;base64,..."])
30
+
31
+ // Send a message to the current task.
32
+ await api.sendMessage("Can you fix the @problems?")
33
+
34
+ // Simulate pressing the primary button in the chat interface (e.g. 'Save' or 'Proceed While Running').
35
+ await api.pressPrimaryButton()
36
+
37
+ // Simulate pressing the secondary button in the chat interface (e.g. 'Reject').
38
+ await api.pressSecondaryButton()
39
+ ```
40
+
41
+ **NOTE:** To ensure that the `RooVeterinaryInc.roo-cline` extension is activated before your extension, add it to the `extensionDependencies` in your `package.json`:
42
+
43
+ ```json
44
+ "extensionDependencies": ["RooVeterinaryInc.roo-cline"]
24
45
  ```
46
+
47
+ For detailed information on the available methods and their usage, refer to the `roo-code.d.ts` file.