@stablekernel/opencode-cursor 0.7.0 → 0.7.1-next.1
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/CHANGELOG.md +56 -0
- package/README.md +87 -4
- package/dist/{chunk-COE6ZXMP.js → chunk-RDY3H2LE.js} +7 -6
- package/dist/chunk-RDY3H2LE.js.map +1 -0
- package/dist/plugin/index.js +795 -8
- package/dist/plugin/index.js.map +1 -1
- package/dist/provider/index.d.ts +7 -0
- package/dist/provider/index.js +16 -6
- package/dist/provider/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-COE6ZXMP.js.map +0 -1
package/dist/provider/index.d.ts
CHANGED
|
@@ -105,6 +105,13 @@ interface CursorProviderOptions {
|
|
|
105
105
|
* Beats OPENCODE_CURSOR_TRANSPORT. Process-global: last provider to set it wins.
|
|
106
106
|
*/
|
|
107
107
|
transport?: "http1" | "http2-direct" | "sidecar";
|
|
108
|
+
/**
|
|
109
|
+
* `<available_skills>` catalogue text appended to the generated system rule,
|
|
110
|
+
* listing mirrored skills so the Cursor agent can discover and load them on
|
|
111
|
+
* demand. Seeded by the plugin's `config` hook from the resolved skill set.
|
|
112
|
+
* When undefined, no skills section is appended.
|
|
113
|
+
*/
|
|
114
|
+
skillsCatalogue?: string;
|
|
108
115
|
}
|
|
109
116
|
/**
|
|
110
117
|
* Cursor provider for the Vercel AI SDK (V3), backed by the official
|
package/dist/provider/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
setPreferredTransport,
|
|
15
15
|
streamAgentTurn,
|
|
16
16
|
withSessionLock
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-RDY3H2LE.js";
|
|
18
18
|
|
|
19
19
|
// src/provider/index.ts
|
|
20
20
|
import { NoSuchModelError } from "@ai-sdk/provider";
|
|
@@ -146,6 +146,10 @@ function injectSubagentSessionId(parts, sessionId) {
|
|
|
146
146
|
folded["metadata"] = metadata;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
+
function effectiveToolDisplay(configured, tools) {
|
|
150
|
+
if (!Array.isArray(tools) || tools.length === 0) return "reasoning";
|
|
151
|
+
return configured ?? "blocks";
|
|
152
|
+
}
|
|
149
153
|
var FINISH_STOP = {
|
|
150
154
|
unified: "stop",
|
|
151
155
|
raw: void 0
|
|
@@ -1263,11 +1267,14 @@ var CursorLanguageModel = class {
|
|
|
1263
1267
|
record2,
|
|
1264
1268
|
latestUser?.text ?? JSON.stringify(options.prompt)
|
|
1265
1269
|
);
|
|
1270
|
+
const dynamicSkillsCatalogue = typeof providerOptions?.["skillsCatalogue"] === "string" ? providerOptions["skillsCatalogue"] : void 0;
|
|
1271
|
+
const skillsCatalogue = dynamicSkillsCatalogue ?? this.config.skillsCatalogue;
|
|
1266
1272
|
const delivery = resolveSystemDelivery({
|
|
1267
1273
|
mode: this.config.systemPrompt ?? "rules",
|
|
1268
1274
|
settingSources: this.config.settingSources,
|
|
1269
1275
|
cwd: this.config.cwd,
|
|
1270
1276
|
systemText: extractSystemText(options.prompt),
|
|
1277
|
+
skillsCatalogue,
|
|
1271
1278
|
warn: (message) => this.warnOnce(message)
|
|
1272
1279
|
});
|
|
1273
1280
|
const systemMode2 = delivery.mode;
|
|
@@ -1415,15 +1422,17 @@ var CursorLanguageModel = class {
|
|
|
1415
1422
|
const po = options.providerOptions?.[this.provider];
|
|
1416
1423
|
const sessionID = typeof po?.["sessionID"] === "string" ? po["sessionID"] : void 0;
|
|
1417
1424
|
return {
|
|
1418
|
-
stream: cursorEventsToStream(
|
|
1419
|
-
|
|
1420
|
-
|
|
1425
|
+
stream: cursorEventsToStream(
|
|
1426
|
+
this.agentRun(options),
|
|
1427
|
+
effectiveToolDisplay(this.config.toolDisplay, options.tools),
|
|
1428
|
+
{ sessionID }
|
|
1429
|
+
)
|
|
1421
1430
|
};
|
|
1422
1431
|
}
|
|
1423
1432
|
async doGenerate(options) {
|
|
1424
1433
|
const result = await cursorEventsToContent(
|
|
1425
1434
|
this.agentRun(options),
|
|
1426
|
-
this.config.toolDisplay
|
|
1435
|
+
effectiveToolDisplay(this.config.toolDisplay, options.tools)
|
|
1427
1436
|
);
|
|
1428
1437
|
return { ...result, warnings: [] };
|
|
1429
1438
|
}
|
|
@@ -1447,7 +1456,8 @@ function createCursor(options = {}) {
|
|
|
1447
1456
|
...options.agents ? { agents: options.agents } : {},
|
|
1448
1457
|
session: options.session ?? "auto",
|
|
1449
1458
|
toolDisplay: options.toolDisplay ?? "blocks",
|
|
1450
|
-
systemPrompt: options.systemPrompt ?? "rules"
|
|
1459
|
+
systemPrompt: options.systemPrompt ?? "rules",
|
|
1460
|
+
...options.skillsCatalogue ? { skillsCatalogue: options.skillsCatalogue } : {}
|
|
1451
1461
|
};
|
|
1452
1462
|
const notImplemented = (kind, modelId) => {
|
|
1453
1463
|
throw new NoSuchModelError({
|