@velum-labs/routekit-tool-cursor 0.16.4 → 0.16.6

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/dist/launch.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ToolLaunchContext } from "@velum-labs/routekit-tools";
2
2
  /** Base URL for Cursor's "Override OpenAI Base URL" setting. */
3
3
  export declare function cursorByokBaseUrl(gatewayUrl: string): string;
4
- export declare function cursorInstructions(gatewayUrl: string, model: string, apiKey?: string): string;
4
+ export declare function cursorInstructions(gatewayUrl: string, model: string, apiKey?: string, reasoning?: ToolLaunchContext["spec"]["reasoning"]): string;
5
5
  /**
6
6
  * Print the endpoint Cursor must be pointed at, then return.
7
7
  *
package/dist/launch.js CHANGED
@@ -1,21 +1,28 @@
1
- import { cursorModelName } from "@velum-labs/routekit-contracts";
1
+ import { cursorModelName, EFFORT_QUALIFIED_MODEL_CODEC, effortQualifiedClientModel } from "@velum-labs/routekit-contracts";
2
2
  import { normalizeApiBaseUrl } from "@velum-labs/routekit-runtime";
3
3
  import { scaffoldCursorSubagents } from "./subagents.js";
4
4
  /** Base URL for Cursor's "Override OpenAI Base URL" setting. */
5
5
  export function cursorByokBaseUrl(gatewayUrl) {
6
6
  return `${normalizeApiBaseUrl(gatewayUrl)}/cursor`;
7
7
  }
8
- export function cursorInstructions(gatewayUrl, model, apiKey) {
8
+ export function cursorInstructions(gatewayUrl, model, apiKey, reasoning) {
9
9
  // Cursor routes BYOK by model-name prefix (`claude-*` → Anthropic,
10
10
  // `gemini-*` → Google). The gateway's /v1/cursor mirror namespaces every
11
11
  // id under `routekit/` so the pasted name always uses the OpenAI key +
12
- // base-URL override.
12
+ // base-URL override. Effort selections use the same `<base>:<effort>`
13
+ // spelling advertised by `/v1/cursor/models`.
14
+ const modelName = effortQualifiedClientModel(cursorModelName(model), reasoning, EFFORT_QUALIFIED_MODEL_CODEC);
13
15
  return [
14
16
  "In Cursor Settings -> Models, enable Override OpenAI Base URL and set:",
15
17
  ` Override OpenAI Base URL : ${cursorByokBaseUrl(gatewayUrl)}`,
16
- ` Model name : ${cursorModelName(model)}`,
18
+ ` Model name : ${modelName}`,
17
19
  ` OpenAI API Key : ${apiKey ?? "routekit-local"}`,
18
- "Names are namespaced under routekit/ so Cursor does not route them to Anthropic/Google keys."
20
+ "Names are namespaced under routekit/ so Cursor does not route them to Anthropic/Google keys.",
21
+ ...(reasoning?.mode === "effort"
22
+ ? [
23
+ `Effort "${reasoning.effort}" is encoded in the model name; select this exact id in Cursor.`
24
+ ]
25
+ : [])
19
26
  ].join("\n");
20
27
  }
21
28
  /**
@@ -30,7 +37,7 @@ export async function launchCursor(ctx) {
30
37
  if (profiles.length > 0) {
31
38
  scaffoldCursorSubagents(ctx.spec.cwd ?? process.cwd(), profiles, ctx.log);
32
39
  }
33
- ctx.log(cursorInstructions(ctx.spec.publicUrl ?? ctx.spec.gatewayUrl, ctx.spec.defaultModel, ctx.spec.auth?.token));
40
+ ctx.log(cursorInstructions(ctx.spec.publicUrl ?? ctx.spec.gatewayUrl, ctx.spec.defaultModel, ctx.spec.auth?.token, ctx.spec.reasoning));
34
41
  ctx.log("The gateway keeps serving this endpoint; Cursor connects on its own.");
35
42
  return 0;
36
43
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import { cursorInstructions } from "../launch.js";
4
+ test("Cursor setup instructions encode selected effort in the model name", () => {
5
+ assert.match(cursorInstructions("http://127.0.0.1:8080", "openai/gpt-5.5"), /Model name\s+: routekit\/openai\/gpt-5\.5\n/);
6
+ assert.match(cursorInstructions("http://127.0.0.1:8080", "openai/gpt-5.5", "token", {
7
+ mode: "effort",
8
+ effort: "high"
9
+ }), /Model name\s+: routekit\/openai\/gpt-5\.5:high\n/);
10
+ assert.match(cursorInstructions("http://127.0.0.1:8080", "openai/gpt-5.5", "token", {
11
+ mode: "effort",
12
+ effort: "high"
13
+ }), /Effort "high" is encoded in the model name/);
14
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@velum-labs/routekit-tool-cursor",
3
3
  "private": false,
4
- "version": "0.16.4",
4
+ "version": "0.16.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/velum-labs/routekit.git",
@@ -28,10 +28,10 @@
28
28
  "dependencies": {
29
29
  "@zed-industries/agent-client-protocol": "0.4.5",
30
30
  "zod": "4.4.3",
31
- "@velum-labs/routekit-contracts": "0.16.4",
32
- "@velum-labs/routekit-harness-core": "0.16.4",
33
- "@velum-labs/routekit-runtime": "0.16.4",
34
- "@velum-labs/routekit-tools": "0.16.4"
31
+ "@velum-labs/routekit-contracts": "0.16.6",
32
+ "@velum-labs/routekit-harness-core": "0.16.6",
33
+ "@velum-labs/routekit-runtime": "0.16.6",
34
+ "@velum-labs/routekit-tools": "0.16.6"
35
35
  },
36
36
  "keywords": [
37
37
  "llm",