@ai-sdk/harness-cursor 1.0.5 → 1.0.7

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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @ai-sdk/harness-cursor
2
2
 
3
+ ## 1.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 8961fde: feat(harness): allow changing `model` between turns via call options
8
+ - Updated dependencies [8961fde]
9
+ - Updated dependencies [eb59f2a]
10
+ - @ai-sdk/harness-acp@1.0.32
11
+ - @ai-sdk/harness@1.0.94
12
+ - @ai-sdk/provider-utils@5.0.34
13
+
14
+ ## 1.0.6
15
+
16
+ ### Patch Changes
17
+
18
+ - 7608210: feat(harness): add `model` parameter to `HarnessAgent` instead of having each harness adapter support it on their own constructor functions
19
+ - Updated dependencies [cc9f6ce]
20
+ - Updated dependencies [7608210]
21
+ - Updated dependencies [6f8a2d7]
22
+ - Updated dependencies [f7bd978]
23
+ - Updated dependencies [14d4fc0]
24
+ - Updated dependencies [90192f1]
25
+ - @ai-sdk/harness@1.0.93
26
+ - @ai-sdk/harness-acp@1.0.31
27
+ - @ai-sdk/provider-utils@5.0.33
28
+
3
29
  ## 1.0.5
4
30
 
5
31
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ type CursorHarnessSettings = {
19
19
  readonly credentialForwarding?: HarnessV1CredentialForwarding;
20
20
  /**
21
21
  * Cursor model id selected through ACP. Unset preserves Cursor's default.
22
+ *
23
+ * @deprecated Use `model` on `HarnessAgent` instead.
22
24
  */
23
25
  readonly model?: string;
24
26
  /**
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { tool } from "@ai-sdk/provider-utils";
7
7
  import { z } from "zod/v4";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "1.0.5" : "0.0.0-test";
10
+ var VERSION = true ? "1.0.7" : "0.0.0-test";
11
11
 
12
12
  // src/cursor-harness.ts
13
13
  var CURSOR_CLIENT_APP = `ai-sdk/harness-cursor/${VERSION}`;
@@ -337,6 +337,13 @@ function createCursor(settings = {}) {
337
337
  },
338
338
  executable: "agent",
339
339
  args: ["--disable-auto-update", "acp"],
340
+ modelMapping: {
341
+ type: "session-config-option",
342
+ path: "model"
343
+ },
344
+ clientCapabilities: {
345
+ _meta: { parameterizedModelPicker: true }
346
+ },
340
347
  credentialEnv: ["CURSOR_API_KEY"],
341
348
  credentialBrokering: ({ env, sandboxEnv }) => {
342
349
  if (!env.CURSOR_API_KEY || !sandboxEnv?.CURSOR_API_KEY) return [];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cursor-harness.ts","../src/version.ts","../src/index.ts"],"sourcesContent":["import {\n commonTool,\n type HarnessV1,\n type HarnessV1BuiltinTool,\n type HarnessV1CredentialForwarding,\n type HarnessV1PortEndpoint,\n} from '@ai-sdk/harness';\nimport { createACP, type ACPAuthenticationMode } from '@ai-sdk/harness-acp';\nimport { tool } from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\nimport { VERSION } from './version';\n\nconst CURSOR_CLIENT_APP = `ai-sdk/harness-cursor/${VERSION}`;\n\nexport type CursorHarnessSettings = {\n /**\n * Declares the provider authentication configured in Cursor, or supplies an\n * isolated environment for Cursor CLI authentication. The adapter cannot\n * change provider routing and warns for explicit routing modes.\n */\n readonly auth?: ACPAuthenticationMode;\n /**\n * Customizes each credential value before it is forwarded into a sandbox\n * process. This does not restrict which credentials the harness adapter can\n * discover, read, or otherwise access in the host process.\n */\n readonly credentialForwarding?: HarnessV1CredentialForwarding;\n /**\n * Cursor model id selected through ACP. Unset preserves Cursor's default.\n */\n readonly model?: string;\n /**\n * Overrides the sandbox port used by the ACP bridge.\n */\n readonly port?: number;\n /**\n * Override the host endpoint used to connect to the sandbox bridge. Required\n * together with `port` when using a basic sandbox session.\n */\n readonly portEndpoint?: HarnessV1PortEndpoint;\n /**\n * Maximum milliseconds to wait for the ACP bridge to start.\n */\n readonly startupTimeoutMs?: number;\n /**\n * MCP server definitions keyed by server name. Each definition uses the\n * underlying runtime's native MCP server configuration format.\n */\n readonly mcpServers?: Record<string, unknown>;\n /**\n * Creates the authentication token used by the sandbox bridge. Defaults to\n * a random 32-byte hexadecimal token.\n */\n readonly mintBridgeToken?: (sandboxId: string) => string;\n};\n\n/*\n * Tool variants, display titles, ACP kinds, and raw input projections were\n * captured from the official Cursor CLI 2026.08.11-e8db854 ACP implementation.\n * `mcpToolCall` is dynamic and `truncatedToolCall` is a transport sentinel, so\n * neither is exposed as a built-in.\n */\nconst CURSOR_BUILTIN_TOOLS = {\n bash: {\n ...commonTool('bash', {\n nativeName: 'shellToolCall',\n toolUseKind: 'bash',\n inputSchema: z.looseObject({ command: z.string() }),\n }),\n title: 'Terminal',\n },\n delete: {\n ...tool({\n title: 'Delete',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'deleteToolCall',\n toolUseKind: 'edit',\n },\n glob: {\n ...commonTool('glob', {\n nativeName: 'globToolCall',\n toolUseKind: 'readonly',\n inputSchema: z.looseObject({ pattern: z.string() }),\n }),\n title: 'Find',\n },\n grep: {\n ...commonTool('grep', {\n nativeName: 'grepToolCall',\n toolUseKind: 'readonly',\n inputSchema: z.looseObject({\n pattern: z.string(),\n path: z.string().optional(),\n }),\n }),\n title: 'grep',\n },\n read: {\n ...tool({\n title: 'Read',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'readToolCall',\n toolUseKind: 'readonly',\n },\n updateTodos: {\n ...tool({\n title: 'Update TODOs',\n inputSchema: z.looseObject({\n _toolName: z.literal('updateTodos'),\n todos: z\n .array(\n z.looseObject({\n id: z.string(),\n content: z.string(),\n status: z.string(),\n }),\n )\n .optional(),\n }),\n }),\n nativeName: 'updateTodosToolCall',\n },\n readTodos: {\n ...tool({\n title: 'Read TODOs',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'readTodosToolCall',\n toolUseKind: 'readonly',\n },\n edit: {\n ...tool({\n title: 'Edit',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'editToolCall',\n toolUseKind: 'edit',\n },\n ls: {\n ...tool({\n title: 'List',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'lsToolCall',\n toolUseKind: 'readonly',\n },\n readLints: {\n ...tool({\n title: 'Read Lints',\n inputSchema: z.looseObject({ paths: z.array(z.string()) }),\n }),\n nativeName: 'readLintsToolCall',\n toolUseKind: 'readonly',\n },\n semanticSearch: {\n ...tool({\n title: 'Codebase Search',\n inputSchema: z.looseObject({ query: z.string() }),\n }),\n nativeName: 'semSearchToolCall',\n toolUseKind: 'readonly',\n },\n createPlan: {\n ...tool({\n title: 'Create Plan',\n inputSchema: z.looseObject({\n _toolName: z.literal('createPlan'),\n name: z.string().optional(),\n plan: z.string().optional(),\n }),\n }),\n nativeName: 'createPlanToolCall',\n },\n webSearch: {\n ...tool({\n title: 'Web Search',\n inputSchema: z.looseObject({ searchTerm: z.string() }),\n }),\n nativeName: 'webSearchToolCall',\n toolUseKind: 'readonly',\n },\n task: {\n ...tool({\n title: 'Task',\n inputSchema: z.looseObject({\n _toolName: z.literal('task'),\n prompt: z.string().optional(),\n description: z.string().optional(),\n subagentType: z.unknown().optional(),\n }),\n }),\n nativeName: 'taskToolCall',\n },\n listMcpResources: {\n ...tool({\n title: 'List MCP Resources',\n inputSchema: z.looseObject({ server: z.string().optional() }),\n }),\n nativeName: 'listMcpResourcesToolCall',\n toolUseKind: 'readonly',\n },\n readMcpResource: {\n ...tool({\n title: 'Fetch MCP Resource',\n inputSchema: z.looseObject({\n server: z.string().optional(),\n uri: z.string().optional(),\n downloadPath: z.string().optional(),\n }),\n }),\n nativeName: 'readMcpResourceToolCall',\n toolUseKind: 'readonly',\n },\n applyAgentDiff: {\n ...tool({\n title: 'Apply Agent Diff',\n inputSchema: z.looseObject({ path: z.string().optional() }),\n }),\n nativeName: 'applyAgentDiffToolCall',\n toolUseKind: 'edit',\n },\n askQuestion: {\n ...tool({\n inputSchema: z.looseObject({\n _toolName: z.literal('askQuestion'),\n title: z.string().optional(),\n questions: z\n .array(\n z.looseObject({\n id: z.string(),\n prompt: z.string(),\n options: z.array(\n z.looseObject({ id: z.string(), label: z.string() }),\n ),\n allowMultiple: z.boolean().optional(),\n }),\n )\n .optional(),\n }),\n }),\n nativeName: 'askQuestionToolCall',\n toolUseKind: 'readonly',\n },\n fetch: {\n ...tool({\n title: 'Fetch',\n inputSchema: z.looseObject({ url: z.string() }),\n }),\n nativeName: 'fetchToolCall',\n toolUseKind: 'readonly',\n },\n switchMode: {\n ...tool({\n title: 'Switch Mode',\n inputSchema: z.looseObject({\n targetModeId: z.string(),\n explanation: z.string().optional(),\n }),\n }),\n nativeName: 'switchModeToolCall',\n },\n generateImage: {\n ...tool({\n title: 'Generate Image',\n inputSchema: z.looseObject({\n _toolName: z.literal('generateImage'),\n description: z.string().optional(),\n filename: z.string().optional(),\n }),\n }),\n nativeName: 'generateImageToolCall',\n },\n recordScreen: {\n ...tool({\n title: 'Record Screen',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'recordScreenToolCall',\n },\n computerUse: {\n ...tool({\n title: 'Computer Use',\n inputSchema: z.looseObject({\n action: z.string().optional(),\n coordinate: z.unknown().optional(),\n text: z.string().optional(),\n }),\n }),\n nativeName: 'computerUseToolCall',\n toolUseKind: 'bash',\n },\n writeShellStdin: {\n ...tool({\n title: 'Write to stdin',\n inputSchema: z.looseObject({\n shellId: z.number().optional(),\n chars: z.string().optional(),\n }),\n }),\n nativeName: 'writeShellStdinToolCall',\n toolUseKind: 'bash',\n },\n reflect: {\n ...tool({\n title: 'Reflect',\n inputSchema: z.looseObject({ reflection: z.string().optional() }),\n }),\n nativeName: 'reflectToolCall',\n toolUseKind: 'readonly',\n },\n setupVmEnvironment: {\n ...tool({\n title: 'Setup VM Environment',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'setupVmEnvironmentToolCall',\n toolUseKind: 'bash',\n },\n replaceEnv: {\n ...tool({\n title: 'Replace Environment',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'replaceEnvToolCall',\n toolUseKind: 'bash',\n },\n startGrindExecution: {\n ...tool({\n title: 'Start Grind Execution',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'startGrindExecutionToolCall',\n toolUseKind: 'bash',\n },\n startGrindPlanning: {\n ...tool({\n title: 'Start Grind Planning',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'startGrindPlanningToolCall',\n toolUseKind: 'readonly',\n },\n webFetch: {\n ...tool({\n title: 'Web Fetch',\n inputSchema: z.looseObject({ url: z.string() }),\n }),\n nativeName: 'webFetchToolCall',\n toolUseKind: 'readonly',\n },\n reportBugfixResults: {\n ...tool({\n title: 'Report Bugfix Results',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'reportBugfixResultsToolCall',\n },\n} as const satisfies Record<string, HarnessV1BuiltinTool<any, any>>;\n\nexport function createCursor(\n settings: CursorHarnessSettings = {},\n): HarnessV1<typeof CURSOR_BUILTIN_TOOLS> {\n const clientAppSegments = CURSOR_CLIENT_APP.split('/');\n const clientAppVersion = clientAppSegments.pop()!;\n\n if (settings.auth === 'direct' || settings.auth === 'ai-gateway') {\n warnCursorAuthenticationConfiguration({ auth: settings.auth });\n }\n\n return createACP({\n auth: typeof settings.auth === 'string' ? undefined : settings.auth,\n credentialForwarding: settings.credentialForwarding,\n modelId: settings.model,\n port: settings.port,\n portEndpoint: settings.portEndpoint,\n startupTimeoutMs: settings.startupTimeoutMs,\n mcpServers: settings.mcpServers,\n isMcpToolCall: toolCall => {\n const rawInput = toolCall.rawInput;\n return (\n isRecord(rawInput) &&\n typeof rawInput.providerIdentifier === 'string' &&\n typeof rawInput.toolName === 'string' &&\n isRecord(rawInput.args)\n );\n },\n mintBridgeToken: settings.mintBridgeToken,\n version: 'v1',\n harnessId: 'cursor',\n builtinTools: CURSOR_BUILTIN_TOOLS,\n clientApp: {\n name: clientAppSegments.join('/'),\n version: clientAppVersion,\n },\n source: {\n type: 'install-command',\n command: 'curl https://cursor.com/install -fsS | bash',\n },\n executable: 'agent',\n args: ['--disable-auto-update', 'acp'],\n credentialEnv: ['CURSOR_API_KEY'],\n credentialBrokering: ({ env, sandboxEnv }) => {\n if (!env.CURSOR_API_KEY || !sandboxEnv?.CURSOR_API_KEY) return [];\n return [\n {\n match: {\n host: 'api2.cursor.sh',\n path: { exact: '/auth/exchange_user_api_key' },\n method: ['POST'],\n headers: [\n {\n key: { exact: 'Authorization' },\n value: {\n exact: `Bearer ${sandboxEnv.CURSOR_API_KEY}`,\n },\n },\n ],\n },\n transform: {\n headers: {\n Authorization: `Bearer ${env.CURSOR_API_KEY}`,\n },\n },\n },\n ];\n },\n });\n}\n\nfunction warnCursorAuthenticationConfiguration({\n auth,\n}: {\n auth: Exclude<ACPAuthenticationMode, 'auto'>;\n}): void {\n const detail =\n auth === 'ai-gateway'\n ? \"Configure an AI Gateway API key as Cursor's OpenAI API key and set Override OpenAI Base URL to https://ai-gateway.vercel.sh/cursor/v1.\"\n : 'Configure Cursor to use its direct model-provider routing.';\n console.warn(\n `[cursor] auth: ${JSON.stringify(auth)} cannot configure Cursor provider authentication. ${detail} CURSOR_API_KEY is still required for Cursor CLI authentication.`,\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n","declare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n","import { createCursor } from './cursor-harness';\n\n/**\n * Default Cursor harness instance. Equivalent to `createCursor()`.\n */\nexport const cursor = createCursor();\n\nexport { createCursor } from './cursor-harness';\nexport type { CursorHarnessSettings } from './cursor-harness';\nexport { VERSION } from './version';\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAKK;AACP,SAAS,iBAA6C;AACtD,SAAS,YAAY;AACrB,SAAS,SAAS;;;AC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kD;AAClE,SAAO,SAAS,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC3E;;;AE1bO,IAAM,SAAS,aAAa;","names":[]}
1
+ {"version":3,"sources":["../src/cursor-harness.ts","../src/version.ts","../src/index.ts"],"sourcesContent":["import {\n commonTool,\n type HarnessV1,\n type HarnessV1BuiltinTool,\n type HarnessV1CredentialForwarding,\n type HarnessV1PortEndpoint,\n} from '@ai-sdk/harness';\nimport { createACP, type ACPAuthenticationMode } from '@ai-sdk/harness-acp';\nimport { tool } from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\nimport { VERSION } from './version';\n\nconst CURSOR_CLIENT_APP = `ai-sdk/harness-cursor/${VERSION}`;\n\nexport type CursorHarnessSettings = {\n /**\n * Declares the provider authentication configured in Cursor, or supplies an\n * isolated environment for Cursor CLI authentication. The adapter cannot\n * change provider routing and warns for explicit routing modes.\n */\n readonly auth?: ACPAuthenticationMode;\n /**\n * Customizes each credential value before it is forwarded into a sandbox\n * process. This does not restrict which credentials the harness adapter can\n * discover, read, or otherwise access in the host process.\n */\n readonly credentialForwarding?: HarnessV1CredentialForwarding;\n /**\n * Cursor model id selected through ACP. Unset preserves Cursor's default.\n *\n * @deprecated Use `model` on `HarnessAgent` instead.\n */\n readonly model?: string;\n /**\n * Overrides the sandbox port used by the ACP bridge.\n */\n readonly port?: number;\n /**\n * Override the host endpoint used to connect to the sandbox bridge. Required\n * together with `port` when using a basic sandbox session.\n */\n readonly portEndpoint?: HarnessV1PortEndpoint;\n /**\n * Maximum milliseconds to wait for the ACP bridge to start.\n */\n readonly startupTimeoutMs?: number;\n /**\n * MCP server definitions keyed by server name. Each definition uses the\n * underlying runtime's native MCP server configuration format.\n */\n readonly mcpServers?: Record<string, unknown>;\n /**\n * Creates the authentication token used by the sandbox bridge. Defaults to\n * a random 32-byte hexadecimal token.\n */\n readonly mintBridgeToken?: (sandboxId: string) => string;\n};\n\n/*\n * Tool variants, display titles, ACP kinds, and raw input projections were\n * captured from the official Cursor CLI 2026.08.11-e8db854 ACP implementation.\n * `mcpToolCall` is dynamic and `truncatedToolCall` is a transport sentinel, so\n * neither is exposed as a built-in.\n */\nconst CURSOR_BUILTIN_TOOLS = {\n bash: {\n ...commonTool('bash', {\n nativeName: 'shellToolCall',\n toolUseKind: 'bash',\n inputSchema: z.looseObject({ command: z.string() }),\n }),\n title: 'Terminal',\n },\n delete: {\n ...tool({\n title: 'Delete',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'deleteToolCall',\n toolUseKind: 'edit',\n },\n glob: {\n ...commonTool('glob', {\n nativeName: 'globToolCall',\n toolUseKind: 'readonly',\n inputSchema: z.looseObject({ pattern: z.string() }),\n }),\n title: 'Find',\n },\n grep: {\n ...commonTool('grep', {\n nativeName: 'grepToolCall',\n toolUseKind: 'readonly',\n inputSchema: z.looseObject({\n pattern: z.string(),\n path: z.string().optional(),\n }),\n }),\n title: 'grep',\n },\n read: {\n ...tool({\n title: 'Read',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'readToolCall',\n toolUseKind: 'readonly',\n },\n updateTodos: {\n ...tool({\n title: 'Update TODOs',\n inputSchema: z.looseObject({\n _toolName: z.literal('updateTodos'),\n todos: z\n .array(\n z.looseObject({\n id: z.string(),\n content: z.string(),\n status: z.string(),\n }),\n )\n .optional(),\n }),\n }),\n nativeName: 'updateTodosToolCall',\n },\n readTodos: {\n ...tool({\n title: 'Read TODOs',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'readTodosToolCall',\n toolUseKind: 'readonly',\n },\n edit: {\n ...tool({\n title: 'Edit',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'editToolCall',\n toolUseKind: 'edit',\n },\n ls: {\n ...tool({\n title: 'List',\n inputSchema: z.looseObject({ path: z.string() }),\n }),\n nativeName: 'lsToolCall',\n toolUseKind: 'readonly',\n },\n readLints: {\n ...tool({\n title: 'Read Lints',\n inputSchema: z.looseObject({ paths: z.array(z.string()) }),\n }),\n nativeName: 'readLintsToolCall',\n toolUseKind: 'readonly',\n },\n semanticSearch: {\n ...tool({\n title: 'Codebase Search',\n inputSchema: z.looseObject({ query: z.string() }),\n }),\n nativeName: 'semSearchToolCall',\n toolUseKind: 'readonly',\n },\n createPlan: {\n ...tool({\n title: 'Create Plan',\n inputSchema: z.looseObject({\n _toolName: z.literal('createPlan'),\n name: z.string().optional(),\n plan: z.string().optional(),\n }),\n }),\n nativeName: 'createPlanToolCall',\n },\n webSearch: {\n ...tool({\n title: 'Web Search',\n inputSchema: z.looseObject({ searchTerm: z.string() }),\n }),\n nativeName: 'webSearchToolCall',\n toolUseKind: 'readonly',\n },\n task: {\n ...tool({\n title: 'Task',\n inputSchema: z.looseObject({\n _toolName: z.literal('task'),\n prompt: z.string().optional(),\n description: z.string().optional(),\n subagentType: z.unknown().optional(),\n }),\n }),\n nativeName: 'taskToolCall',\n },\n listMcpResources: {\n ...tool({\n title: 'List MCP Resources',\n inputSchema: z.looseObject({ server: z.string().optional() }),\n }),\n nativeName: 'listMcpResourcesToolCall',\n toolUseKind: 'readonly',\n },\n readMcpResource: {\n ...tool({\n title: 'Fetch MCP Resource',\n inputSchema: z.looseObject({\n server: z.string().optional(),\n uri: z.string().optional(),\n downloadPath: z.string().optional(),\n }),\n }),\n nativeName: 'readMcpResourceToolCall',\n toolUseKind: 'readonly',\n },\n applyAgentDiff: {\n ...tool({\n title: 'Apply Agent Diff',\n inputSchema: z.looseObject({ path: z.string().optional() }),\n }),\n nativeName: 'applyAgentDiffToolCall',\n toolUseKind: 'edit',\n },\n askQuestion: {\n ...tool({\n inputSchema: z.looseObject({\n _toolName: z.literal('askQuestion'),\n title: z.string().optional(),\n questions: z\n .array(\n z.looseObject({\n id: z.string(),\n prompt: z.string(),\n options: z.array(\n z.looseObject({ id: z.string(), label: z.string() }),\n ),\n allowMultiple: z.boolean().optional(),\n }),\n )\n .optional(),\n }),\n }),\n nativeName: 'askQuestionToolCall',\n toolUseKind: 'readonly',\n },\n fetch: {\n ...tool({\n title: 'Fetch',\n inputSchema: z.looseObject({ url: z.string() }),\n }),\n nativeName: 'fetchToolCall',\n toolUseKind: 'readonly',\n },\n switchMode: {\n ...tool({\n title: 'Switch Mode',\n inputSchema: z.looseObject({\n targetModeId: z.string(),\n explanation: z.string().optional(),\n }),\n }),\n nativeName: 'switchModeToolCall',\n },\n generateImage: {\n ...tool({\n title: 'Generate Image',\n inputSchema: z.looseObject({\n _toolName: z.literal('generateImage'),\n description: z.string().optional(),\n filename: z.string().optional(),\n }),\n }),\n nativeName: 'generateImageToolCall',\n },\n recordScreen: {\n ...tool({\n title: 'Record Screen',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'recordScreenToolCall',\n },\n computerUse: {\n ...tool({\n title: 'Computer Use',\n inputSchema: z.looseObject({\n action: z.string().optional(),\n coordinate: z.unknown().optional(),\n text: z.string().optional(),\n }),\n }),\n nativeName: 'computerUseToolCall',\n toolUseKind: 'bash',\n },\n writeShellStdin: {\n ...tool({\n title: 'Write to stdin',\n inputSchema: z.looseObject({\n shellId: z.number().optional(),\n chars: z.string().optional(),\n }),\n }),\n nativeName: 'writeShellStdinToolCall',\n toolUseKind: 'bash',\n },\n reflect: {\n ...tool({\n title: 'Reflect',\n inputSchema: z.looseObject({ reflection: z.string().optional() }),\n }),\n nativeName: 'reflectToolCall',\n toolUseKind: 'readonly',\n },\n setupVmEnvironment: {\n ...tool({\n title: 'Setup VM Environment',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'setupVmEnvironmentToolCall',\n toolUseKind: 'bash',\n },\n replaceEnv: {\n ...tool({\n title: 'Replace Environment',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'replaceEnvToolCall',\n toolUseKind: 'bash',\n },\n startGrindExecution: {\n ...tool({\n title: 'Start Grind Execution',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'startGrindExecutionToolCall',\n toolUseKind: 'bash',\n },\n startGrindPlanning: {\n ...tool({\n title: 'Start Grind Planning',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'startGrindPlanningToolCall',\n toolUseKind: 'readonly',\n },\n webFetch: {\n ...tool({\n title: 'Web Fetch',\n inputSchema: z.looseObject({ url: z.string() }),\n }),\n nativeName: 'webFetchToolCall',\n toolUseKind: 'readonly',\n },\n reportBugfixResults: {\n ...tool({\n title: 'Report Bugfix Results',\n inputSchema: z.looseObject({}),\n }),\n nativeName: 'reportBugfixResultsToolCall',\n },\n} as const satisfies Record<string, HarnessV1BuiltinTool<any, any>>;\n\nexport function createCursor(\n settings: CursorHarnessSettings = {},\n): HarnessV1<typeof CURSOR_BUILTIN_TOOLS> {\n const clientAppSegments = CURSOR_CLIENT_APP.split('/');\n const clientAppVersion = clientAppSegments.pop()!;\n\n if (settings.auth === 'direct' || settings.auth === 'ai-gateway') {\n warnCursorAuthenticationConfiguration({ auth: settings.auth });\n }\n\n return createACP({\n auth: typeof settings.auth === 'string' ? undefined : settings.auth,\n credentialForwarding: settings.credentialForwarding,\n modelId: settings.model,\n port: settings.port,\n portEndpoint: settings.portEndpoint,\n startupTimeoutMs: settings.startupTimeoutMs,\n mcpServers: settings.mcpServers,\n isMcpToolCall: toolCall => {\n const rawInput = toolCall.rawInput;\n return (\n isRecord(rawInput) &&\n typeof rawInput.providerIdentifier === 'string' &&\n typeof rawInput.toolName === 'string' &&\n isRecord(rawInput.args)\n );\n },\n mintBridgeToken: settings.mintBridgeToken,\n version: 'v1',\n harnessId: 'cursor',\n builtinTools: CURSOR_BUILTIN_TOOLS,\n clientApp: {\n name: clientAppSegments.join('/'),\n version: clientAppVersion,\n },\n source: {\n type: 'install-command',\n command: 'curl https://cursor.com/install -fsS | bash',\n },\n executable: 'agent',\n args: ['--disable-auto-update', 'acp'],\n modelMapping: {\n type: 'session-config-option',\n path: 'model',\n },\n clientCapabilities: {\n _meta: { parameterizedModelPicker: true },\n },\n credentialEnv: ['CURSOR_API_KEY'],\n credentialBrokering: ({ env, sandboxEnv }) => {\n if (!env.CURSOR_API_KEY || !sandboxEnv?.CURSOR_API_KEY) return [];\n return [\n {\n match: {\n host: 'api2.cursor.sh',\n path: { exact: '/auth/exchange_user_api_key' },\n method: ['POST'],\n headers: [\n {\n key: { exact: 'Authorization' },\n value: {\n exact: `Bearer ${sandboxEnv.CURSOR_API_KEY}`,\n },\n },\n ],\n },\n transform: {\n headers: {\n Authorization: `Bearer ${env.CURSOR_API_KEY}`,\n },\n },\n },\n ];\n },\n });\n}\n\nfunction warnCursorAuthenticationConfiguration({\n auth,\n}: {\n auth: Exclude<ACPAuthenticationMode, 'auto'>;\n}): void {\n const detail =\n auth === 'ai-gateway'\n ? \"Configure an AI Gateway API key as Cursor's OpenAI API key and set Override OpenAI Base URL to https://ai-gateway.vercel.sh/cursor/v1.\"\n : 'Configure Cursor to use its direct model-provider routing.';\n console.warn(\n `[cursor] auth: ${JSON.stringify(auth)} cannot configure Cursor provider authentication. ${detail} CURSOR_API_KEY is still required for Cursor CLI authentication.`,\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n","declare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n","import { createCursor } from './cursor-harness';\n\n/**\n * Default Cursor harness instance. Equivalent to `createCursor()`.\n */\nexport const cursor = createCursor();\n\nexport { createCursor } from './cursor-harness';\nexport type { CursorHarnessSettings } from './cursor-harness';\nexport { VERSION } from './version';\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAKK;AACP,SAAS,iBAA6C;AACtD,SAAS,YAAY;AACrB,SAAS,SAAS;;;ACRX,IAAM,UACX,OACI,UACA;;;ADQN,IAAM,oBAAoB,yBAAyB,OAAO;AAoD1D,IAAM,uBAAuB;AAAA,EAC3B,MAAM;AAAA,IACJ,GAAG,WAAW,QAAQ;AAAA,MACpB,YAAY;AAAA,MACZ,aAA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UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC3E;;;AEncO,IAAM,SAAS,aAAa;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/harness-cursor",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -26,9 +26,9 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@ai-sdk/harness": "1.0.92",
30
- "@ai-sdk/harness-acp": "1.0.30",
31
- "@ai-sdk/provider-utils": "5.0.32"
29
+ "@ai-sdk/harness": "1.0.94",
30
+ "@ai-sdk/harness-acp": "1.0.32",
31
+ "@ai-sdk/provider-utils": "5.0.34"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "zod": "^3.25.76 || ^4.1.8"
@@ -27,6 +27,8 @@ export type CursorHarnessSettings = {
27
27
  readonly credentialForwarding?: HarnessV1CredentialForwarding;
28
28
  /**
29
29
  * Cursor model id selected through ACP. Unset preserves Cursor's default.
30
+ *
31
+ * @deprecated Use `model` on `HarnessAgent` instead.
30
32
  */
31
33
  readonly model?: string;
32
34
  /**
@@ -400,6 +402,13 @@ export function createCursor(
400
402
  },
401
403
  executable: 'agent',
402
404
  args: ['--disable-auto-update', 'acp'],
405
+ modelMapping: {
406
+ type: 'session-config-option',
407
+ path: 'model',
408
+ },
409
+ clientCapabilities: {
410
+ _meta: { parameterizedModelPicker: true },
411
+ },
403
412
  credentialEnv: ['CURSOR_API_KEY'],
404
413
  credentialBrokering: ({ env, sandboxEnv }) => {
405
414
  if (!env.CURSOR_API_KEY || !sandboxEnv?.CURSOR_API_KEY) return [];