@react-grab/opencode 0.0.83 → 0.0.85
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 +6 -6
- package/dist/cli.cjs +6596 -58
- package/dist/cli.js +6589 -57
- package/dist/client.cjs +3 -3
- package/dist/client.global.js +3 -3
- package/dist/client.js +3 -3
- package/dist/server.cjs +22 -13
- package/dist/server.js +22 -13
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @react-grab/opencode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
OpenCode agent provider for React Grab. Requires running a local server that interfaces with the OpenCode CLI.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -58,7 +58,7 @@ if (process.env.NODE_ENV === "development") {
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
> **Note:** You must have [
|
|
61
|
+
> **Note:** You must have [OpenCode](https://opencode.ai) installed (`npm i -g opencode-ai@latest`).
|
|
62
62
|
|
|
63
63
|
## Client Usage
|
|
64
64
|
|
|
@@ -109,12 +109,12 @@ attachAgent();
|
|
|
109
109
|
|
|
110
110
|
## Options
|
|
111
111
|
|
|
112
|
-
You can configure the
|
|
112
|
+
You can configure the OpenCode agent provider:
|
|
113
113
|
|
|
114
114
|
```typescript
|
|
115
|
-
import {
|
|
115
|
+
import { createOpenCodeAgentProvider } from "@react-grab/opencode/client";
|
|
116
116
|
|
|
117
|
-
const provider =
|
|
117
|
+
const provider = createOpenCodeAgentProvider({
|
|
118
118
|
serverUrl: "http://localhost:6567", // Custom server URL
|
|
119
119
|
getOptions: () => ({
|
|
120
120
|
model: "claude-sonnet-4-20250514", // AI model to use
|
|
@@ -138,5 +138,5 @@ const provider = createOpencodeAgentProvider({
|
|
|
138
138
|
|
|
139
139
|
1. **React Grab** sends the selected element context to the server via HTTP POST
|
|
140
140
|
2. **Server** receives the request and spawns the `opencode` CLI process
|
|
141
|
-
3. **
|
|
141
|
+
3. **OpenCode** processes the request and streams JSON responses to stdout
|
|
142
142
|
4. **Server** relays status updates to the client via Server-Sent Events (SSE)
|