@rama_nigg/open-cursor 2.3.13 → 2.3.15
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 +2 -0
- package/dist/cli/discover.js +27 -8
- package/dist/cli/opencode-cursor.js +38 -19
- package/dist/index.js +415 -162
- package/dist/plugin-entry.js +342 -166
- package/package.json +1 -1
- package/src/cli/model-discovery.ts +21 -1
- package/src/client/simple.ts +16 -3
- package/src/models/discovery.ts +13 -3
- package/src/models/sync.ts +153 -0
- package/src/plugin.ts +3 -2
- package/src/streaming/ai-sdk-parts.ts +10 -4
- package/src/streaming/openai-sse.ts +10 -4
package/README.md
CHANGED
|
@@ -195,6 +195,8 @@ flowchart LR
|
|
|
195
195
|
[ ] **Simplify** — Rip out serialisation layers
|
|
196
196
|
[ ] **ACP + MCP** — Structured protocols end-to-end
|
|
197
197
|
|
|
198
|
+
`Future Architecture` - Long-term direction is to replace the current custom proxy and provider-boundary approach with `OpenCode -> Cursor ACP -> MCP`, using official Cursor ACP as the backend so tool ownership stays agent-side and the eventual OpenCode integration can remain small. `Status` - Deferred: this is the preferred path, but it is currently blocked because official Cursor ACP does not yet reliably propagate MCP servers during ACP session setup. `Details` - See [docs/architecture/cursor-acp-mcp-future.md](docs/architecture/cursor-acp-mcp-future.md).
|
|
199
|
+
|
|
198
200
|
## License
|
|
199
201
|
|
|
200
202
|
BSD-3-Clause
|
package/dist/cli/discover.js
CHANGED
|
@@ -107,11 +107,6 @@ function formatErrorForUser(error) {
|
|
|
107
107
|
return output;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// src/cli/discover.ts
|
|
111
|
-
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
112
|
-
import { join } from "path";
|
|
113
|
-
import { homedir } from "os";
|
|
114
|
-
|
|
115
110
|
// src/cli/model-discovery.ts
|
|
116
111
|
import { execFileSync } from "child_process";
|
|
117
112
|
function parseCursorModelsOutput(output) {
|
|
@@ -137,7 +132,9 @@ function parseCursorModelsOutput(output) {
|
|
|
137
132
|
function discoverModelsFromCursorAgent() {
|
|
138
133
|
const raw = execFileSync("cursor-agent", ["models"], {
|
|
139
134
|
encoding: "utf8",
|
|
140
|
-
|
|
135
|
+
killSignal: "SIGTERM",
|
|
136
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
137
|
+
timeout: MODEL_DISCOVERY_TIMEOUT_MS
|
|
141
138
|
});
|
|
142
139
|
const models = parseCursorModelsOutput(raw);
|
|
143
140
|
if (models.length === 0) {
|
|
@@ -148,13 +145,35 @@ function discoverModelsFromCursorAgent() {
|
|
|
148
145
|
function fallbackModels() {
|
|
149
146
|
return [
|
|
150
147
|
{ id: "auto", name: "Auto" },
|
|
151
|
-
{ id: "
|
|
148
|
+
{ id: "composer-1.5", name: "Composer 1.5" },
|
|
149
|
+
{ id: "composer-1", name: "Composer 1" },
|
|
150
|
+
{ id: "opus-4.6-thinking", name: "Claude 4.6 Opus (Thinking)" },
|
|
152
151
|
{ id: "opus-4.6", name: "Claude 4.6 Opus" },
|
|
153
|
-
{ id: "
|
|
152
|
+
{ id: "sonnet-4.6", name: "Claude 4.6 Sonnet" },
|
|
153
|
+
{ id: "sonnet-4.6-thinking", name: "Claude 4.6 Sonnet (Thinking)" },
|
|
154
|
+
{ id: "opus-4.5", name: "Claude 4.5 Opus" },
|
|
155
|
+
{ id: "opus-4.5-thinking", name: "Claude 4.5 Opus (Thinking)" },
|
|
156
|
+
{ id: "sonnet-4.5", name: "Claude 4.5 Sonnet" },
|
|
157
|
+
{ id: "sonnet-4.5-thinking", name: "Claude 4.5 Sonnet (Thinking)" },
|
|
158
|
+
{ id: "gpt-5.4-high", name: "GPT-5.4 High" },
|
|
159
|
+
{ id: "gpt-5.4-medium", name: "GPT-5.4" },
|
|
160
|
+
{ id: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
|
|
161
|
+
{ id: "gpt-5.2", name: "GPT-5.2" },
|
|
162
|
+
{ id: "gemini-3.1-pro", name: "Gemini 3.1 Pro" },
|
|
163
|
+
{ id: "gemini-3-pro", name: "Gemini 3 Pro" },
|
|
164
|
+
{ id: "gemini-3-flash", name: "Gemini 3 Flash" },
|
|
165
|
+
{ id: "grok", name: "Grok" },
|
|
166
|
+
{ id: "kimi-k2.5", name: "Kimi K2.5" }
|
|
154
167
|
];
|
|
155
168
|
}
|
|
169
|
+
var MODEL_DISCOVERY_TIMEOUT_MS = 5000;
|
|
170
|
+
var init_model_discovery = () => {};
|
|
156
171
|
|
|
157
172
|
// src/cli/discover.ts
|
|
173
|
+
init_model_discovery();
|
|
174
|
+
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
175
|
+
import { join } from "path";
|
|
176
|
+
import { homedir } from "os";
|
|
158
177
|
async function main() {
|
|
159
178
|
console.log("Discovering Cursor models...");
|
|
160
179
|
let models = fallbackModels();
|
|
@@ -107,22 +107,6 @@ function formatErrorForUser(error) {
|
|
|
107
107
|
return output;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// src/cli/opencode-cursor.ts
|
|
111
|
-
import { execFileSync as execFileSync2 } from "child_process";
|
|
112
|
-
import {
|
|
113
|
-
copyFileSync,
|
|
114
|
-
existsSync,
|
|
115
|
-
lstatSync,
|
|
116
|
-
mkdirSync,
|
|
117
|
-
readFileSync,
|
|
118
|
-
rmSync,
|
|
119
|
-
symlinkSync,
|
|
120
|
-
writeFileSync
|
|
121
|
-
} from "fs";
|
|
122
|
-
import { homedir } from "os";
|
|
123
|
-
import { basename, dirname, join, resolve } from "path";
|
|
124
|
-
import { fileURLToPath } from "url";
|
|
125
|
-
|
|
126
110
|
// src/cli/model-discovery.ts
|
|
127
111
|
import { execFileSync } from "child_process";
|
|
128
112
|
function parseCursorModelsOutput(output) {
|
|
@@ -148,7 +132,9 @@ function parseCursorModelsOutput(output) {
|
|
|
148
132
|
function discoverModelsFromCursorAgent() {
|
|
149
133
|
const raw = execFileSync("cursor-agent", ["models"], {
|
|
150
134
|
encoding: "utf8",
|
|
151
|
-
|
|
135
|
+
killSignal: "SIGTERM",
|
|
136
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
137
|
+
timeout: MODEL_DISCOVERY_TIMEOUT_MS
|
|
152
138
|
});
|
|
153
139
|
const models = parseCursorModelsOutput(raw);
|
|
154
140
|
if (models.length === 0) {
|
|
@@ -159,13 +145,46 @@ function discoverModelsFromCursorAgent() {
|
|
|
159
145
|
function fallbackModels() {
|
|
160
146
|
return [
|
|
161
147
|
{ id: "auto", name: "Auto" },
|
|
162
|
-
{ id: "
|
|
148
|
+
{ id: "composer-1.5", name: "Composer 1.5" },
|
|
149
|
+
{ id: "composer-1", name: "Composer 1" },
|
|
150
|
+
{ id: "opus-4.6-thinking", name: "Claude 4.6 Opus (Thinking)" },
|
|
163
151
|
{ id: "opus-4.6", name: "Claude 4.6 Opus" },
|
|
164
|
-
{ id: "
|
|
152
|
+
{ id: "sonnet-4.6", name: "Claude 4.6 Sonnet" },
|
|
153
|
+
{ id: "sonnet-4.6-thinking", name: "Claude 4.6 Sonnet (Thinking)" },
|
|
154
|
+
{ id: "opus-4.5", name: "Claude 4.5 Opus" },
|
|
155
|
+
{ id: "opus-4.5-thinking", name: "Claude 4.5 Opus (Thinking)" },
|
|
156
|
+
{ id: "sonnet-4.5", name: "Claude 4.5 Sonnet" },
|
|
157
|
+
{ id: "sonnet-4.5-thinking", name: "Claude 4.5 Sonnet (Thinking)" },
|
|
158
|
+
{ id: "gpt-5.4-high", name: "GPT-5.4 High" },
|
|
159
|
+
{ id: "gpt-5.4-medium", name: "GPT-5.4" },
|
|
160
|
+
{ id: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
|
|
161
|
+
{ id: "gpt-5.2", name: "GPT-5.2" },
|
|
162
|
+
{ id: "gemini-3.1-pro", name: "Gemini 3.1 Pro" },
|
|
163
|
+
{ id: "gemini-3-pro", name: "Gemini 3 Pro" },
|
|
164
|
+
{ id: "gemini-3-flash", name: "Gemini 3 Flash" },
|
|
165
|
+
{ id: "grok", name: "Grok" },
|
|
166
|
+
{ id: "kimi-k2.5", name: "Kimi K2.5" }
|
|
165
167
|
];
|
|
166
168
|
}
|
|
169
|
+
var MODEL_DISCOVERY_TIMEOUT_MS = 5000;
|
|
170
|
+
var init_model_discovery = () => {};
|
|
167
171
|
|
|
168
172
|
// src/cli/opencode-cursor.ts
|
|
173
|
+
init_model_discovery();
|
|
174
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
175
|
+
import {
|
|
176
|
+
copyFileSync,
|
|
177
|
+
existsSync,
|
|
178
|
+
lstatSync,
|
|
179
|
+
mkdirSync,
|
|
180
|
+
readFileSync,
|
|
181
|
+
rmSync,
|
|
182
|
+
symlinkSync,
|
|
183
|
+
writeFileSync
|
|
184
|
+
} from "fs";
|
|
185
|
+
import { homedir } from "os";
|
|
186
|
+
import { basename, dirname, join, resolve } from "path";
|
|
187
|
+
import { fileURLToPath } from "url";
|
|
169
188
|
var BRANDING_HEADER = `
|
|
170
189
|
▄▄▄ ▄▄▄▄ ▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄ ▄▄▄▄
|
|
171
190
|
██ ██ ██ ██ ██▄▄ ███▄██ ▄▄▄ ██ ▀▀ ██ ██ ██ ██ ██▄▄▄ ██ ██ ██ ██
|