@rama_nigg/open-cursor 2.3.14 → 2.3.16
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 +88 -22
- package/dist/cli/discover.js +57 -8
- package/dist/cli/mcptool.js +15187 -0
- package/dist/cli/opencode-cursor.js +68 -19
- package/dist/index.js +15944 -626
- package/dist/plugin-entry.js +15833 -586
- package/package.json +7 -5
- package/src/cli/mcptool.ts +133 -0
- package/src/cli/model-discovery.ts +21 -1
- package/src/client/simple.ts +16 -3
- package/src/mcp/client-manager.ts +166 -0
- package/src/mcp/config.ts +98 -0
- package/src/mcp/tool-bridge.ts +131 -0
- package/src/models/discovery.ts +13 -3
- package/src/models/sync.ts +153 -0
- package/src/plugin.ts +127 -9
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
13
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
21
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
4
34
|
var __returnValue = (v) => v;
|
|
5
35
|
function __exportSetter(name, newValue) {
|
|
6
36
|
this[name] = __returnValue.bind(null, newValue);
|
|
@@ -107,22 +137,6 @@ function formatErrorForUser(error) {
|
|
|
107
137
|
return output;
|
|
108
138
|
}
|
|
109
139
|
|
|
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
140
|
// src/cli/model-discovery.ts
|
|
127
141
|
import { execFileSync } from "child_process";
|
|
128
142
|
function parseCursorModelsOutput(output) {
|
|
@@ -148,7 +162,9 @@ function parseCursorModelsOutput(output) {
|
|
|
148
162
|
function discoverModelsFromCursorAgent() {
|
|
149
163
|
const raw = execFileSync("cursor-agent", ["models"], {
|
|
150
164
|
encoding: "utf8",
|
|
151
|
-
|
|
165
|
+
killSignal: "SIGTERM",
|
|
166
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
167
|
+
timeout: MODEL_DISCOVERY_TIMEOUT_MS
|
|
152
168
|
});
|
|
153
169
|
const models = parseCursorModelsOutput(raw);
|
|
154
170
|
if (models.length === 0) {
|
|
@@ -159,13 +175,46 @@ function discoverModelsFromCursorAgent() {
|
|
|
159
175
|
function fallbackModels() {
|
|
160
176
|
return [
|
|
161
177
|
{ id: "auto", name: "Auto" },
|
|
162
|
-
{ id: "
|
|
178
|
+
{ id: "composer-1.5", name: "Composer 1.5" },
|
|
179
|
+
{ id: "composer-1", name: "Composer 1" },
|
|
180
|
+
{ id: "opus-4.6-thinking", name: "Claude 4.6 Opus (Thinking)" },
|
|
163
181
|
{ id: "opus-4.6", name: "Claude 4.6 Opus" },
|
|
164
|
-
{ id: "
|
|
182
|
+
{ id: "sonnet-4.6", name: "Claude 4.6 Sonnet" },
|
|
183
|
+
{ id: "sonnet-4.6-thinking", name: "Claude 4.6 Sonnet (Thinking)" },
|
|
184
|
+
{ id: "opus-4.5", name: "Claude 4.5 Opus" },
|
|
185
|
+
{ id: "opus-4.5-thinking", name: "Claude 4.5 Opus (Thinking)" },
|
|
186
|
+
{ id: "sonnet-4.5", name: "Claude 4.5 Sonnet" },
|
|
187
|
+
{ id: "sonnet-4.5-thinking", name: "Claude 4.5 Sonnet (Thinking)" },
|
|
188
|
+
{ id: "gpt-5.4-high", name: "GPT-5.4 High" },
|
|
189
|
+
{ id: "gpt-5.4-medium", name: "GPT-5.4" },
|
|
190
|
+
{ id: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
|
|
191
|
+
{ id: "gpt-5.2", name: "GPT-5.2" },
|
|
192
|
+
{ id: "gemini-3.1-pro", name: "Gemini 3.1 Pro" },
|
|
193
|
+
{ id: "gemini-3-pro", name: "Gemini 3 Pro" },
|
|
194
|
+
{ id: "gemini-3-flash", name: "Gemini 3 Flash" },
|
|
195
|
+
{ id: "grok", name: "Grok" },
|
|
196
|
+
{ id: "kimi-k2.5", name: "Kimi K2.5" }
|
|
165
197
|
];
|
|
166
198
|
}
|
|
199
|
+
var MODEL_DISCOVERY_TIMEOUT_MS = 5000;
|
|
200
|
+
var init_model_discovery = () => {};
|
|
167
201
|
|
|
168
202
|
// src/cli/opencode-cursor.ts
|
|
203
|
+
init_model_discovery();
|
|
204
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
205
|
+
import {
|
|
206
|
+
copyFileSync,
|
|
207
|
+
existsSync,
|
|
208
|
+
lstatSync,
|
|
209
|
+
mkdirSync,
|
|
210
|
+
readFileSync,
|
|
211
|
+
rmSync,
|
|
212
|
+
symlinkSync,
|
|
213
|
+
writeFileSync
|
|
214
|
+
} from "fs";
|
|
215
|
+
import { homedir } from "os";
|
|
216
|
+
import { basename, dirname, join, resolve } from "path";
|
|
217
|
+
import { fileURLToPath } from "url";
|
|
169
218
|
var BRANDING_HEADER = `
|
|
170
219
|
▄▄▄ ▄▄▄▄ ▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄ ▄▄▄▄
|
|
171
220
|
██ ██ ██ ██ ██▄▄ ███▄██ ▄▄▄ ██ ▀▀ ██ ██ ██ ██ ██▄▄▄ ██ ██ ██ ██
|