@atom8n/n8n-nodes-langchain 2.5.6 → 2.5.8
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/known/nodes.json +32 -0
- package/dist/methods/defined.json +3 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/agents/OpenClawAgent/OpenClawAgent.node.js +62 -0
- package/dist/nodes/agents/OpenClawAgent/OpenClawAgent.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/V1/OpenClawAgentV1.node.js +821 -0
- package/dist/nodes/agents/OpenClawAgent/V1/OpenClawAgentV1.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/V2/OpenClawAgentV2.node.js +2059 -0
- package/dist/nodes/agents/OpenClawAgent/V2/OpenClawAgentV2.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/TelegramChannel.node.js +329 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/TelegramChannel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/telegram-channel.svg +4 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/WhatsAppChannel.node.js +108 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/WhatsAppChannel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/whatsapp-channel.svg +3 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js +228 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/openclaw-mcp-server.svg +9 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.js +97 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/opencode-free-model.svg +1 -0
- package/dist/nodes/agents/OpenClawAgent/openclaw.svg +8 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/OpenClawPlugin.node.js +261 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/OpenClawPlugin.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/openclaw-plugin.svg +3 -0
- package/dist/nodes/llms/LmChat9Router/LmChat9Router.node.js +40 -3
- package/dist/nodes/llms/LmChat9Router/LmChat9Router.node.js.map +1 -1
- package/dist/nodes/llms/LmChatCodexCli/LmChatCodexCli.node.js +456 -0
- package/dist/nodes/llms/LmChatCodexCli/LmChatCodexCli.node.js.map +1 -0
- package/dist/nodes/llms/LmChatCodexCli/codexCli.svg +1 -0
- package/dist/nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.js +46 -6
- package/dist/nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.js.map +1 -1
- package/dist/nodes/llms/LmChatOpenCodeCli/LmChatOpenCodeCli.node.js +443 -0
- package/dist/nodes/llms/LmChatOpenCodeCli/LmChatOpenCodeCli.node.js.map +1 -0
- package/dist/nodes/llms/LmChatOpenCodeCli/openCodeCli.svg +1 -0
- package/dist/types/nodes.json +11 -2
- package/package.json +19 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/llms/LmChatCodexCli/LmChatCodexCli.node.ts"],"sourcesContent":["import { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport { AIMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';\nimport type { ChatResult } from '@langchain/core/outputs';\nimport type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';\nimport type { BindToolsInput } from '@langchain/core/language_models/chat_models';\nimport {\n\tApplicationError,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { N8nLlmTracing } from '../N8nLlmTracing';\nimport { spawn } from 'child_process';\nimport { existsSync, statSync } from 'fs';\n\ninterface CodexCliFields {\n\tmodel: string;\n\tbinaryPath: string;\n\tworkingDirectory: string;\n\tsandboxMode: string;\n}\n\ninterface ParsedToolCall {\n\tid: string;\n\tname: string;\n\targs: Record<string, unknown>;\n}\n\ninterface ParsedJsonlResult {\n\tassistantText: string;\n\terrorMessage: string;\n}\n\nconst TOOL_CALL_SYSTEM_PROMPT = `You have access to the following tools. When you need to call a tool, respond ONLY with a JSON block in this exact format (no other text before or after):\n\n\\`\\`\\`tool_calls\n[{\"id\": \"call_1\", \"name\": \"tool_name\", \"args\": {\"param\": \"value\"}}]\n\\`\\`\\`\n\nWhen you do NOT need to call a tool, respond normally with text. Never mix tool calls and text in the same response.\n\nAvailable tools:\n`;\n\n/**\n * Custom LangChain chat model that wraps the OpenAI Codex CLI binary.\n * Uses `codex exec --json` for non-interactive execution.\n * Supports tool calling by injecting tool schemas into the prompt\n * and parsing structured JSON responses for tool calls.\n */\nclass ChatCodexCLI extends BaseChatModel {\n\tmodel: string;\n\n\tbinaryPath: string;\n\n\tworkingDirectory: string;\n\n\tsandboxMode: string;\n\n\tboundTools: BindToolsInput[] = [];\n\n\tconstructor(fields: CodexCliFields) {\n\t\tsuper({});\n\t\tthis.model = fields.model;\n\t\tthis.binaryPath = fields.binaryPath;\n\t\tthis.workingDirectory = fields.workingDirectory;\n\t\tthis.sandboxMode = fields.sandboxMode;\n\t}\n\n\t_llmType(): string {\n\t\treturn 'codex-cli';\n\t}\n\n\toverride bindTools(tools: BindToolsInput[], kwargs?: Partial<this['ParsedCallOptions']>) {\n\t\tconst clone = new ChatCodexCLI({\n\t\t\tmodel: this.model,\n\t\t\tbinaryPath: this.binaryPath,\n\t\t\tworkingDirectory: this.workingDirectory,\n\t\t\tsandboxMode: this.sandboxMode,\n\t\t});\n\t\tclone.boundTools = tools;\n\t\tclone.callbacks = this.callbacks;\n\t\tif (kwargs) {\n\t\t\treturn (\n\t\t\t\tclone as unknown as {\n\t\t\t\t\tbind: (kwargs: Record<string, unknown>) => ChatCodexCLI;\n\t\t\t\t}\n\t\t\t).bind(kwargs as Record<string, unknown>);\n\t\t}\n\t\treturn clone;\n\t}\n\n\tasync _generate(\n\t\tmessages: BaseMessage[],\n\t\t_options: this['ParsedCallOptions'],\n\t\t_runManager?: CallbackManagerForLLMRun,\n\t): Promise<ChatResult> {\n\t\tconsole.log('[LmChatCodexCli] _generate called', {\n\t\t\tmessageCount: messages.length,\n\t\t\tboundToolCount: this.boundTools.length,\n\t\t\tmodel: this.model,\n\t\t});\n\n\t\t// If tools are bound, inject tool schemas into a system message\n\t\tconst processedMessages = [...messages];\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolDescriptions = this.boundTools\n\t\t\t\t.map((tool) => {\n\t\t\t\t\tconst t = tool as Record<string, unknown>;\n\t\t\t\t\tconst name = (t.name as string) ?? '';\n\t\t\t\t\tconst description = (t.description as string) ?? '';\n\t\t\t\t\tconst schema = t.parameters ?? t.schema ?? {};\n\t\t\t\t\treturn `- ${name}: ${description}\\n Parameters: ${JSON.stringify(schema)}`;\n\t\t\t\t})\n\t\t\t\t.join('\\n\\n');\n\n\t\t\tconst systemPrompt = TOOL_CALL_SYSTEM_PROMPT + toolDescriptions;\n\t\t\tprocessedMessages.unshift(new SystemMessage(systemPrompt));\n\t\t}\n\n\t\t// Build prompt from messages\n\t\tconst prompt = processedMessages\n\t\t\t.map((m) => {\n\t\t\t\tconst content = typeof m.content === 'string' ? m.content : JSON.stringify(m.content);\n\t\t\t\tif (m instanceof SystemMessage) return `[system]: ${content}`;\n\t\t\t\tif (m instanceof HumanMessage) return `[user]: ${content}`;\n\t\t\t\tif (m instanceof AIMessage) return `[assistant]: ${content}`;\n\t\t\t\treturn `[${m._getType()}]: ${content}`;\n\t\t\t})\n\t\t\t.join('\\n\\n');\n\n\t\tconsole.log('[LmChatCodexCli] prompt built, length:', prompt.length);\n\n\t\t// Execute codex CLI\n\t\tconst rawResponse = await this.executeCodexCli(prompt);\n\n\t\tconsole.log('[LmChatCodexCli] raw response received, length:', rawResponse.length);\n\n\t\t// Check for tool calls in response\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolCalls = this.extractToolCalls(rawResponse);\n\t\t\tif (toolCalls.length > 0) {\n\t\t\t\tconsole.log('[LmChatCodexCli] extracted tool calls:', toolCalls.length);\n\t\t\t\tconst aiMessage = new AIMessage({\n\t\t\t\t\tcontent: '',\n\t\t\t\t\ttool_calls: toolCalls.map((tc) => ({\n\t\t\t\t\t\tid: tc.id,\n\t\t\t\t\t\tname: tc.name,\n\t\t\t\t\t\targs: tc.args,\n\t\t\t\t\t\ttype: 'tool_call' as const,\n\t\t\t\t\t})),\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tgenerations: [{ message: aiMessage, text: '' }],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Normal text response\n\t\tconsole.log('[LmChatCodexCli] returning text response');\n\t\tconst aiMessage = new AIMessage({ content: rawResponse });\n\t\treturn {\n\t\t\tgenerations: [{ message: aiMessage, text: rawResponse }],\n\t\t};\n\t}\n\n\tprivate extractToolCalls(text: string): ParsedToolCall[] {\n\t\t// Look for tool_calls JSON block\n\t\tconst toolCallRegex = /```tool_calls\\s*\\n([\\s\\S]*?)\\n```/;\n\t\tconst match = toolCallRegex.exec(text);\n\t\tif (!match) return [];\n\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(match[1]) as Array<{\n\t\t\t\tid?: string;\n\t\t\t\tname: string;\n\t\t\t\targs: Record<string, unknown>;\n\t\t\t}>;\n\t\t\tif (!Array.isArray(parsed)) return [];\n\n\t\t\treturn parsed.map((tc, i) => ({\n\t\t\t\tid: tc.id ?? `call_${i}`,\n\t\t\t\tname: tc.name,\n\t\t\t\targs: tc.args ?? {},\n\t\t\t}));\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\tprivate async executeCodexCli(prompt: string): Promise<string> {\n\t\t// Build args: codex exec --json --skip-git-repo-check --full-auto [--sandbox <mode>] [--model <model>] [--cd <dir>] -\n\t\tconst args = ['exec', '--json', '--skip-git-repo-check', '--full-auto'];\n\n\t\tif (this.sandboxMode) {\n\t\t\targs.push('--sandbox', this.sandboxMode);\n\t\t}\n\n\t\tif (this.model && this.model !== 'auto') {\n\t\t\targs.push('--model', this.model);\n\t\t}\n\n\t\tconst cwd = this.workingDirectory?.trim() || undefined;\n\t\tif (cwd) {\n\t\t\targs.push('--cd', cwd);\n\t\t}\n\n\t\t// Use `-` to read prompt from stdin\n\t\targs.push('-');\n\n\t\tconsole.log('[LmChatCodexCli] spawning codex exec', {\n\t\t\tbinaryPath: this.binaryPath,\n\t\t\targs,\n\t\t\tmodel: this.model,\n\t\t\tcwd,\n\t\t\tsandboxMode: this.sandboxMode,\n\t\t});\n\n\t\treturn await new Promise<string>((resolve, reject) => {\n\t\t\tconst child = spawn(this.binaryPath, args, {\n\t\t\t\t// Codex uses --cd for working directory, so we don't set cwd on spawn\n\t\t\t\tstdio: ['pipe', 'pipe', 'pipe'],\n\t\t\t\tenv: { ...process.env },\n\t\t\t});\n\n\t\t\tlet stdout = '';\n\t\t\tlet stderr = '';\n\n\t\t\tchild.stdout.on('data', (data: Buffer) => {\n\t\t\t\tstdout += data.toString();\n\t\t\t});\n\n\t\t\tchild.stderr.on('data', (data: Buffer) => {\n\t\t\t\tstderr += data.toString();\n\t\t\t});\n\n\t\t\tchild.on('error', (err: Error) => {\n\t\t\t\tconsole.error('[LmChatCodexCli] spawn error:', err.message);\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to spawn codex: ${err.message}. Make sure the Codex CLI is installed (npm install -g @openai/codex) and accessible.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tchild.on('close', (code: number | null) => {\n\t\t\t\tconsole.log('[LmChatCodexCli] codex exec exited', {\n\t\t\t\t\tcode,\n\t\t\t\t\tstdoutLength: stdout.length,\n\t\t\t\t\tstderrLength: stderr.length,\n\t\t\t\t});\n\n\t\t\t\t// Parse the JSONL output — even on non-zero exit code, stdout may contain\n\t\t\t\t// useful JSONL events (e.g. error messages from the Codex API)\n\t\t\t\tconst parseResult = this.parseJsonlOutput(stdout);\n\n\t\t\t\tif (parseResult.assistantText) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t'[LmChatCodexCli] parsed assistant content, length:',\n\t\t\t\t\t\tparseResult.assistantText.length,\n\t\t\t\t\t);\n\t\t\t\t\tresolve(parseResult.assistantText);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// No assistant response — build a meaningful error from available info\n\t\t\t\tif (parseResult.errorMessage) {\n\t\t\t\t\tconsole.error('[LmChatCodexCli] codex returned error:', parseResult.errorMessage);\n\t\t\t\t\treject(new Error(`Codex CLI error: ${parseResult.errorMessage}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (code !== 0) {\n\t\t\t\t\tconst stderrMsg = stderr.trim();\n\t\t\t\t\tconst errorMsg = stderrMsg || `codex exec exited with code ${code}`;\n\t\t\t\t\tconsole.error('[LmChatCodexCli] codex exec failed with code', code, ':', errorMsg);\n\t\t\t\t\treject(new Error(errorMsg));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconsole.error(\n\t\t\t\t\t'[LmChatCodexCli] no assistant response parsed from output, stdout preview:',\n\t\t\t\t\tstdout.substring(0, 500),\n\t\t\t\t);\n\t\t\t\treject(new Error('No assistant response received from codex exec'));\n\t\t\t});\n\n\t\t\tif (child.stdin) {\n\t\t\t\tchild.stdin.write(prompt);\n\t\t\t\tchild.stdin.end();\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Parse JSONL output from `codex exec --json`.\n\t *\n\t * Actual event types from codex exec --json (verified empirically):\n\t * - {\"type\":\"thread.started\",\"thread_id\":\"...\"}\n\t * - {\"type\":\"turn.started\"}\n\t * - {\"type\":\"item.started\",\"item\":{\"type\":\"agent_message\",...}}\n\t * - {\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"...\"}}\n\t * - {\"type\":\"turn.completed\"}\n\t * - {\"type\":\"error\",\"message\":\"...\"}\n\t * - {\"type\":\"turn.failed\",\"error\":{\"message\":\"...\"}}\n\t *\n\t * Returns both assistant text and any error messages found.\n\t */\n\tprivate parseJsonlOutput(output: string): ParsedJsonlResult {\n\t\tconst lines = output.split('\\n').filter((line) => line.trim());\n\t\tconst assistantParts: string[] = [];\n\t\tconst errorParts: string[] = [];\n\n\t\tconsole.log('[LmChatCodexCli] parsing JSONL output, line count:', lines.length);\n\n\t\tfor (const line of lines) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(line) as Record<string, unknown>;\n\t\t\t\tconst eventType = parsed.type as string | undefined;\n\n\t\t\t\tconsole.log(\n\t\t\t\t\t'[LmChatCodexCli] JSONL event:',\n\t\t\t\t\teventType,\n\t\t\t\t\t'| keys:',\n\t\t\t\t\tObject.keys(parsed).join(','),\n\t\t\t\t);\n\n\t\t\t\t// item.completed with agent_message => assistant text\n\t\t\t\tif (eventType === 'item.completed') {\n\t\t\t\t\tconst item = parsed.item as Record<string, unknown> | undefined;\n\t\t\t\t\tif (item?.type === 'agent_message' && typeof item.text === 'string') {\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t'[LmChatCodexCli] found agent_message text, length:',\n\t\t\t\t\t\t\t(item.text as string).length,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassistantParts.push(item.text as string);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Direct message events (fallback for other versions)\n\t\t\t\tif (eventType === 'message' && parsed.role === 'assistant') {\n\t\t\t\t\tconst content = parsed.content;\n\t\t\t\t\tif (Array.isArray(content)) {\n\t\t\t\t\t\tfor (const c of content as Array<Record<string, unknown>>) {\n\t\t\t\t\t\t\tif (c.type === 'text' && typeof c.text === 'string') {\n\t\t\t\t\t\t\t\tassistantParts.push(c.text as string);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (typeof content === 'string') {\n\t\t\t\t\t\tassistantParts.push(content);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Nested assistant message (cursor-agent compatibility)\n\t\t\t\tif (eventType === 'assistant') {\n\t\t\t\t\tconst message = parsed.message as Record<string, unknown> | undefined;\n\t\t\t\t\tif (message?.content) {\n\t\t\t\t\t\tif (Array.isArray(message.content)) {\n\t\t\t\t\t\t\tfor (const c of message.content as Array<Record<string, unknown>>) {\n\t\t\t\t\t\t\t\tif (c.type === 'text' && typeof c.text === 'string') {\n\t\t\t\t\t\t\t\t\tassistantParts.push(c.text as string);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (typeof message.content === 'string') {\n\t\t\t\t\t\t\tassistantParts.push(message.content);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Error events\n\t\t\t\tif (eventType === 'error' && typeof parsed.message === 'string') {\n\t\t\t\t\terrorParts.push(parsed.message);\n\t\t\t\t}\n\n\t\t\t\t// turn.failed with error\n\t\t\t\tif (eventType === 'turn.failed') {\n\t\t\t\t\tconst error = parsed.error as Record<string, unknown> | undefined;\n\t\t\t\t\tif (error && typeof error.message === 'string') {\n\t\t\t\t\t\terrorParts.push(error.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Skip non-JSON lines (e.g. progress output)\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tassistantText: assistantParts.join(''),\n\t\t\terrorMessage: errorParts.join('; '),\n\t\t};\n\t}\n}\n\nexport class LmChatCodexCli implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Codex CLI Chat Model',\n\n\t\tname: 'lmChatCodexCli',\n\t\ticon: 'file:codexCli.svg',\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription:\n\t\t\t'Chat model powered by the OpenAI Codex CLI. Requires codex to be installed locally (npm install -g @openai/codex).',\n\t\tdefaults: {\n\t\t\tname: 'Codex CLI Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\n\t\t\t},\n\t\t\tresources: {},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'The model to use via codex CLI',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Auto (Default)', value: 'auto' },\n\t\t\t\t\t// GPT-5 series (supported by Codex CLI)\n\t\t\t\t\t{ name: 'GPT-5.5', value: 'gpt-5.5' },\n\t\t\t\t\t{ name: 'GPT-5.5 Fast', value: 'gpt-5.5-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4', value: 'gpt-5.4' },\n\t\t\t\t\t{ name: 'GPT-5.4 Fast', value: 'gpt-5.4-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini', value: 'gpt-5.4-mini' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex', value: 'gpt-5.3-codex' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark', value: 'gpt-5.3-codex-spark' },\n\t\t\t\t\t{ name: 'GPT-5.2', value: 'gpt-5.2' },\n\t\t\t\t],\n\t\t\t\tdefault: 'auto',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdescription: 'Additional options to configure',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Binary Path',\n\t\t\t\t\t\tname: 'binaryPath',\n\t\t\t\t\t\tdefault: 'codex',\n\t\t\t\t\t\tdescription: 'Path to the codex binary. Defaults to \"codex\" (must be in PATH).',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Working Directory',\n\t\t\t\t\t\tname: 'workingDirectory',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'Working directory for the codex process. Leave empty to use the default.',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Sandbox Mode',\n\t\t\t\t\t\tname: 'sandboxMode',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdefault: 'read-only',\n\t\t\t\t\t\tdescription: 'Sandbox policy for executing model-generated shell commands',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Read Only',\n\t\t\t\t\t\t\t\tvalue: 'read-only',\n\t\t\t\t\t\t\t\tdescription: 'Only allow read operations (safest)',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Workspace Write',\n\t\t\t\t\t\t\t\tvalue: 'workspace-write',\n\t\t\t\t\t\t\t\tdescription: 'Allow writes within the workspace directory',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Full Access (Dangerous)',\n\t\t\t\t\t\t\t\tvalue: 'danger-full-access',\n\t\t\t\t\t\t\t\tdescription: 'Full filesystem access — use with extreme caution',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst binaryPath = this.getNodeParameter('options.binaryPath', itemIndex, 'codex') as string;\n\t\tconst rawWorkingDirectory = this.getNodeParameter('options.workingDirectory', itemIndex, '', {\n\t\t\trawExpressions: true,\n\t\t}) as string | undefined;\n\t\tconst workingDirectory = this.getNodeParameter('options.workingDirectory', itemIndex, '') as\n\t\t\t| string\n\t\t\t| undefined;\n\t\tconst normalizedWorkingDirectory = (workingDirectory ?? '').trim();\n\t\tconst rawWorkingDirectoryValue = rawWorkingDirectory ?? '';\n\t\tconst isWorkingDirectoryExpression =\n\t\t\trawWorkingDirectoryValue.startsWith('=') ||\n\t\t\trawWorkingDirectoryValue.includes('{{') ||\n\t\t\trawWorkingDirectoryValue.includes('$workspace');\n\n\t\tconst sandboxMode = this.getNodeParameter(\n\t\t\t'options.sandboxMode',\n\t\t\titemIndex,\n\t\t\t'read-only',\n\t\t) as string;\n\n\t\tconsole.log('[LmChatCodexCli] resolved Codex CLI options', {\n\t\t\titemIndex,\n\t\t\tmodelName,\n\t\t\tbinaryPath,\n\t\t\trawWorkingDirectory,\n\t\t\tworkingDirectory: normalizedWorkingDirectory,\n\t\t\tsandboxMode,\n\t\t});\n\n\t\tif (isWorkingDirectoryExpression && !normalizedWorkingDirectory) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Codex CLI working directory expression resolved to an empty value: ${rawWorkingDirectoryValue}`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnormalizedWorkingDirectory.includes('{{') ||\n\t\t\tnormalizedWorkingDirectory.includes('$workspace')\n\t\t) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Codex CLI working directory was not resolved before execution: ${normalizedWorkingDirectory}`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnormalizedWorkingDirectory &&\n\t\t\t(!existsSync(normalizedWorkingDirectory) ||\n\t\t\t\t!statSync(normalizedWorkingDirectory).isDirectory())\n\t\t) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Codex CLI working directory does not exist or is not a directory: ${normalizedWorkingDirectory}`,\n\t\t\t);\n\t\t}\n\n\t\tconsole.log('[LmChatCodexCli] creating ChatCodexCLI instance', {\n\t\t\tmodel: modelName,\n\t\t\tbinaryPath,\n\t\t\tworkingDirectory: normalizedWorkingDirectory,\n\t\t\tsandboxMode,\n\t\t});\n\n\t\tconst model = new ChatCodexCLI({\n\t\t\tmodel: modelName,\n\t\t\tbinaryPath,\n\t\t\tworkingDirectory: normalizedWorkingDirectory,\n\t\t\tsandboxMode,\n\t\t});\n\n\t\tmodel.callbacks = [new N8nLlmTracing(this)];\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA8B;AAE9B,sBAAuD;AAIvD,0BAOO;AAEP,0BAA6C;AAE7C,2BAA8B;AAC9B,2BAAsB;AACtB,gBAAqC;AAoBrC,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBhC,MAAM,qBAAqB,iCAAc;AAAA,EAWxC,YAAY,QAAwB;AACnC,UAAM,CAAC,CAAC;AAHT,sBAA+B,CAAC;AAI/B,SAAK,QAAQ,OAAO;AACpB,SAAK,aAAa,OAAO;AACzB,SAAK,mBAAmB,OAAO;AAC/B,SAAK,cAAc,OAAO;AAAA,EAC3B;AAAA,EAEA,WAAmB;AAClB,WAAO;AAAA,EACR;AAAA,EAES,UAAU,OAAyB,QAA6C;AAC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K;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAEA,YAAQ,IAAI,+CAA+C;AAAA,MAC1D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,IACD,CAAC;AAED,QAAI,gCAAgC,CAAC,4BAA4B;AAChE,YAAM,IAAI;AAAA,QACT,sEAAsE,wBAAwB;AAAA,MAC/F;AAAA,IACD;AAEA,QACC,2BAA2B,SAAS,IAAI,KACxC,2BAA2B,SAAS,YAAY,GAC/C;AACD,YAAM,IAAI;AAAA,QACT,kEAAkE,0BAA0B;AAAA,MAC7F;AAAA,IACD;AAEA,QACC,+BACC,KAAC,sBAAW,0BAA0B,KACtC,KAAC,oBAAS,0BAA0B,EAAE,YAAY,IAClD;AACD,YAAM,IAAI;AAAA,QACT,qEAAqE,0BAA0B;AAAA,MAChG;AAAA,IACD;AAEA,YAAQ,IAAI,mDAAmD;AAAA,MAC9D,OAAO;AAAA,MACP;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,IACD,CAAC;AAED,UAAM,QAAQ,IAAI,aAAa;AAAA,MAC9B,OAAO;AAAA,MACP;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,IACD,CAAC;AAED,UAAM,YAAY,CAAC,IAAI,mCAAc,IAAI,CAAC;AAE1C,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":["aiMessage"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><rect width="512" height="512" rx="80" fill="#0a0a0a"/><rect x="4" y="4" width="504" height="504" rx="76" stroke="#edecec" stroke-opacity=".15" stroke-width="8"/><path d="M256 108c-81.6 0-148 66.4-148 148s66.4 148 148 148 148-66.4 148-148-66.4-148-148-148zm0 24c68.4 0 124 55.6 124 124s-55.6 124-124 124-124-55.6-124-124 55.6-124 124-124z" fill="#10a37f"/><path d="M256 172c-46.4 0-84 37.6-84 84s37.6 84 84 84 84-37.6 84-84-37.6-84-84-84zm0 24c33.1 0 60 26.9 60 60s-26.9 60-60 60-60-26.9-60-60 26.9-60 60-60z" fill="#10a37f"/><circle cx="256" cy="256" r="24" fill="#10a37f"/><path d="M256 108v40M256 364v40M108 256h40M364 256h40M152.8 152.8l28.3 28.3M330.9 330.9l28.3 28.3M152.8 359.2l28.3-28.3M330.9 181.1l28.3-28.3" stroke="#10a37f" stroke-width="12" stroke-linecap="round"/></svg>
|
|
@@ -27,6 +27,7 @@ var import_n8n_workflow = require("n8n-workflow");
|
|
|
27
27
|
var import_sharedFields = require("../../../utils/sharedFields");
|
|
28
28
|
var import_N8nLlmTracing = require("../N8nLlmTracing");
|
|
29
29
|
var import_child_process = require("child_process");
|
|
30
|
+
var import_fs = require("fs");
|
|
30
31
|
const TOOL_CALL_SYSTEM_PROMPT = `You have access to the following tools. When you need to call a tool, respond ONLY with a JSON block in this exact format (no other text before or after):
|
|
31
32
|
|
|
32
33
|
\`\`\`tool_calls
|
|
@@ -126,9 +127,15 @@ class ChatCursorAgentCLI extends import_chat_models.BaseChatModel {
|
|
|
126
127
|
if (this.model && this.model !== "auto") {
|
|
127
128
|
args.push("--model", this.model);
|
|
128
129
|
}
|
|
130
|
+
const cwd = this.workingDirectory?.trim() || void 0;
|
|
131
|
+
console.log("[LmChatCursorAgent] spawning cursor-agent", {
|
|
132
|
+
binaryPath: this.binaryPath,
|
|
133
|
+
model: this.model,
|
|
134
|
+
cwd
|
|
135
|
+
});
|
|
129
136
|
return await new Promise((resolve, reject) => {
|
|
130
137
|
const child = (0, import_child_process.spawn)(this.binaryPath, args, {
|
|
131
|
-
cwd
|
|
138
|
+
cwd,
|
|
132
139
|
stdio: ["pipe", "pipe", "pipe"],
|
|
133
140
|
env: { ...process.env }
|
|
134
141
|
});
|
|
@@ -143,7 +150,7 @@ class ChatCursorAgentCLI extends import_chat_models.BaseChatModel {
|
|
|
143
150
|
child.on("error", (err) => {
|
|
144
151
|
reject(
|
|
145
152
|
new Error(
|
|
146
|
-
`Failed to spawn cursor-agent: ${err.message}. Make sure cursor-agent CLI is installed and accessible
|
|
153
|
+
`Failed to spawn cursor-agent: ${err.message}. Make sure cursor-agent CLI is installed and accessible. Working directory: ${cwd ?? "<default>"}`
|
|
147
154
|
)
|
|
148
155
|
);
|
|
149
156
|
});
|
|
@@ -214,7 +221,7 @@ class LmChatCursorAgent {
|
|
|
214
221
|
displayName: "Model",
|
|
215
222
|
name: "model",
|
|
216
223
|
type: "options",
|
|
217
|
-
description: "The model to use via cursor-agent CLI
|
|
224
|
+
description: "The model to use via cursor-agent CLI",
|
|
218
225
|
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
|
219
226
|
options: [
|
|
220
227
|
{ name: "Auto", value: "auto" },
|
|
@@ -344,11 +351,44 @@ class LmChatCursorAgent {
|
|
|
344
351
|
}
|
|
345
352
|
async supplyData(itemIndex) {
|
|
346
353
|
const modelName = this.getNodeParameter("model", itemIndex);
|
|
347
|
-
const
|
|
354
|
+
const binaryPath = this.getNodeParameter(
|
|
355
|
+
"options.binaryPath",
|
|
356
|
+
itemIndex,
|
|
357
|
+
"cursor-agent"
|
|
358
|
+
);
|
|
359
|
+
const rawWorkingDirectory = this.getNodeParameter("options.workingDirectory", itemIndex, "", {
|
|
360
|
+
rawExpressions: true
|
|
361
|
+
});
|
|
362
|
+
const workingDirectory = this.getNodeParameter("options.workingDirectory", itemIndex, "");
|
|
363
|
+
const normalizedWorkingDirectory = (workingDirectory ?? "").trim();
|
|
364
|
+
const rawWorkingDirectoryValue = rawWorkingDirectory ?? "";
|
|
365
|
+
const isWorkingDirectoryExpression = rawWorkingDirectoryValue.startsWith("=") || rawWorkingDirectoryValue.includes("{{") || rawWorkingDirectoryValue.includes("$workspace");
|
|
366
|
+
console.log("[LmChatCursorAgent] resolved Cursor Agent options", {
|
|
367
|
+
itemIndex,
|
|
368
|
+
modelName,
|
|
369
|
+
binaryPath,
|
|
370
|
+
rawWorkingDirectory,
|
|
371
|
+
workingDirectory: normalizedWorkingDirectory
|
|
372
|
+
});
|
|
373
|
+
if (isWorkingDirectoryExpression && !normalizedWorkingDirectory) {
|
|
374
|
+
throw new import_n8n_workflow.ApplicationError(
|
|
375
|
+
`Cursor Agent working directory expression resolved to an empty value: ${rawWorkingDirectoryValue}`
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
if (normalizedWorkingDirectory.includes("{{") || normalizedWorkingDirectory.includes("$workspace")) {
|
|
379
|
+
throw new import_n8n_workflow.ApplicationError(
|
|
380
|
+
`Cursor Agent working directory was not resolved before execution: ${normalizedWorkingDirectory}`
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
if (normalizedWorkingDirectory && (!(0, import_fs.existsSync)(normalizedWorkingDirectory) || !(0, import_fs.statSync)(normalizedWorkingDirectory).isDirectory())) {
|
|
384
|
+
throw new import_n8n_workflow.ApplicationError(
|
|
385
|
+
`Cursor Agent working directory does not exist or is not a directory: ${normalizedWorkingDirectory}`
|
|
386
|
+
);
|
|
387
|
+
}
|
|
348
388
|
const model = new ChatCursorAgentCLI({
|
|
349
389
|
model: modelName,
|
|
350
|
-
binaryPath
|
|
351
|
-
workingDirectory:
|
|
390
|
+
binaryPath,
|
|
391
|
+
workingDirectory: normalizedWorkingDirectory
|
|
352
392
|
});
|
|
353
393
|
model.callbacks = [new import_N8nLlmTracing.N8nLlmTracing(this)];
|
|
354
394
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.ts"],"sourcesContent":["import { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport { AIMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';\nimport type { ChatResult } from '@langchain/core/outputs';\nimport type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';\nimport type { BindToolsInput } from '@langchain/core/language_models/chat_models';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { N8nLlmTracing } from '../N8nLlmTracing';\nimport { spawn } from 'child_process';\n\ninterface CursorAgentFields {\n\tmodel: string;\n\tbinaryPath: string;\n\tworkingDirectory: string;\n}\n\ninterface ParsedToolCall {\n\tid: string;\n\tname: string;\n\targs: Record<string, unknown>;\n}\n\nconst TOOL_CALL_SYSTEM_PROMPT = `You have access to the following tools. When you need to call a tool, respond ONLY with a JSON block in this exact format (no other text before or after):\n\n\\`\\`\\`tool_calls\n[{\"id\": \"call_1\", \"name\": \"tool_name\", \"args\": {\"param\": \"value\"}}]\n\\`\\`\\`\n\nWhen you do NOT need to call a tool, respond normally with text. Never mix tool calls and text in the same response.\n\nAvailable tools:\n`;\n\n/**\n * Custom LangChain chat model that wraps the cursor-agent CLI binary.\n * Supports tool calling by injecting tool schemas into the prompt\n * and parsing structured JSON responses for tool calls.\n */\nclass ChatCursorAgentCLI extends BaseChatModel {\n\tmodel: string;\n\n\tbinaryPath: string;\n\n\tworkingDirectory: string;\n\n\tboundTools: BindToolsInput[] = [];\n\n\tconstructor(fields: CursorAgentFields) {\n\t\tsuper({});\n\t\tthis.model = fields.model;\n\t\tthis.binaryPath = fields.binaryPath;\n\t\tthis.workingDirectory = fields.workingDirectory;\n\t}\n\n\t_llmType(): string {\n\t\treturn 'cursor-agent-cli';\n\t}\n\n\toverride bindTools(tools: BindToolsInput[], kwargs?: Partial<this['ParsedCallOptions']>) {\n\t\tconst clone = new ChatCursorAgentCLI({\n\t\t\tmodel: this.model,\n\t\t\tbinaryPath: this.binaryPath,\n\t\t\tworkingDirectory: this.workingDirectory,\n\t\t});\n\t\tclone.boundTools = tools;\n\t\tclone.callbacks = this.callbacks;\n\t\tif (kwargs) {\n\t\t\treturn clone.bind(kwargs);\n\t\t}\n\t\treturn clone;\n\t}\n\n\tasync _generate(\n\t\tmessages: BaseMessage[],\n\t\t_options: this['ParsedCallOptions'],\n\t\t_runManager?: CallbackManagerForLLMRun,\n\t): Promise<ChatResult> {\n\t\t// If tools are bound, inject tool schemas into a system message\n\t\tconst processedMessages = [...messages];\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolDescriptions = this.boundTools\n\t\t\t\t.map((tool) => {\n\t\t\t\t\tconst t = tool as Record<string, unknown>;\n\t\t\t\t\tconst name = (t.name as string) ?? '';\n\t\t\t\t\tconst description = (t.description as string) ?? '';\n\t\t\t\t\tconst schema = t.parameters ?? t.schema ?? {};\n\t\t\t\t\treturn `- ${name}: ${description}\\n Parameters: ${JSON.stringify(schema)}`;\n\t\t\t\t})\n\t\t\t\t.join('\\n\\n');\n\n\t\t\tconst systemPrompt = TOOL_CALL_SYSTEM_PROMPT + toolDescriptions;\n\t\t\tprocessedMessages.unshift(new SystemMessage(systemPrompt));\n\t\t}\n\n\t\t// Build prompt from messages\n\t\tconst prompt = processedMessages\n\t\t\t.map((m) => {\n\t\t\t\tconst content = typeof m.content === 'string' ? m.content : JSON.stringify(m.content);\n\t\t\t\tif (m instanceof SystemMessage) return `[system]: ${content}`;\n\t\t\t\tif (m instanceof HumanMessage) return `[user]: ${content}`;\n\t\t\t\tif (m instanceof AIMessage) return `[assistant]: ${content}`;\n\t\t\t\treturn `[${m._getType()}]: ${content}`;\n\t\t\t})\n\t\t\t.join('\\n\\n');\n\n\t\t// Execute cursor-agent CLI\n\t\tconst rawResponse = await this.executeCursorAgent(prompt);\n\n\t\t// Check for tool calls in response\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolCalls = this.extractToolCalls(rawResponse);\n\t\t\tif (toolCalls.length > 0) {\n\t\t\t\tconst aiMessage = new AIMessage({\n\t\t\t\t\tcontent: '',\n\t\t\t\t\ttool_calls: toolCalls.map((tc) => ({\n\t\t\t\t\t\tid: tc.id,\n\t\t\t\t\t\tname: tc.name,\n\t\t\t\t\t\targs: tc.args,\n\t\t\t\t\t\ttype: 'tool_call' as const,\n\t\t\t\t\t})),\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tgenerations: [{ message: aiMessage, text: '' }],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Normal text response\n\t\tconst aiMessage = new AIMessage({ content: rawResponse });\n\t\treturn {\n\t\t\tgenerations: [{ message: aiMessage, text: rawResponse }],\n\t\t};\n\t}\n\n\tprivate extractToolCalls(text: string): ParsedToolCall[] {\n\t\t// Look for tool_calls JSON block\n\t\tconst toolCallRegex = /```tool_calls\\s*\\n([\\s\\S]*?)\\n```/;\n\t\tconst match = toolCallRegex.exec(text);\n\t\tif (!match) return [];\n\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(match[1]) as Array<{\n\t\t\t\tid?: string;\n\t\t\t\tname: string;\n\t\t\t\targs: Record<string, unknown>;\n\t\t\t}>;\n\t\t\tif (!Array.isArray(parsed)) return [];\n\n\t\t\treturn parsed.map((tc, i) => ({\n\t\t\t\tid: tc.id ?? `call_${i}`,\n\t\t\t\tname: tc.name,\n\t\t\t\targs: tc.args ?? {},\n\t\t\t}));\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\tprivate async executeCursorAgent(prompt: string): Promise<string> {\n\t\tconst args = ['-p', '--output-format=stream-json', '--trust'];\n\t\tif (this.model && this.model !== 'auto') {\n\t\t\targs.push('--model', this.model);\n\t\t}\n\n\t\treturn await new Promise<string>((resolve, reject) => {\n\t\t\tconst child = spawn(this.binaryPath, args, {\n\t\t\t\tcwd: this.workingDirectory || undefined,\n\t\t\t\tstdio: ['pipe', 'pipe', 'pipe'],\n\t\t\t\tenv: { ...process.env },\n\t\t\t});\n\n\t\t\tlet stdout = '';\n\t\t\tlet stderr = '';\n\n\t\t\tchild.stdout.on('data', (data: Buffer) => {\n\t\t\t\tstdout += data.toString();\n\t\t\t});\n\n\t\t\tchild.stderr.on('data', (data: Buffer) => {\n\t\t\t\tstderr += data.toString();\n\t\t\t});\n\n\t\t\tchild.on('error', (err: Error) => {\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to spawn cursor-agent: ${err.message}. Make sure cursor-agent CLI is installed and accessible.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tchild.on('close', (code: number | null) => {\n\t\t\t\tif (code !== 0 && !stdout) {\n\t\t\t\t\tconst errorMsg = stderr.trim() || `cursor-agent exited with code ${code}`;\n\t\t\t\t\treject(new Error(errorMsg));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst assistantContent = this.parseStreamJsonOutput(stdout);\n\n\t\t\t\tif (!assistantContent) {\n\t\t\t\t\treject(new Error('No assistant response received from cursor-agent'));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(assistantContent);\n\t\t\t});\n\n\t\t\tif (child.stdin) {\n\t\t\t\tchild.stdin.write(prompt);\n\t\t\t\tchild.stdin.end();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate parseStreamJsonOutput(output: string): string {\n\t\tconst lines = output.split('\\n').filter((line) => line.trim());\n\t\tconst assistantParts: string[] = [];\n\n\t\tfor (const line of lines) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(line) as {\n\t\t\t\t\ttype?: string;\n\t\t\t\t\tmessage?: {\n\t\t\t\t\t\tcontent?: Array<{ type?: string; text?: string }>;\n\t\t\t\t\t};\n\t\t\t\t\ttext?: string;\n\t\t\t\t};\n\n\t\t\t\tif (parsed.type === 'assistant' && parsed.message?.content) {\n\t\t\t\t\tfor (const item of parsed.message.content) {\n\t\t\t\t\t\tif (item.type === 'text' && item.text) {\n\t\t\t\t\t\t\tassistantParts.push(item.text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Skip non-JSON lines\n\t\t\t}\n\t\t}\n\n\t\treturn assistantParts.join('');\n\t}\n}\n\nexport class LmChatCursorAgent implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Cursor Agent CLI Chat Model',\n\n\t\tname: 'lmChatCursorAgent',\n\t\ticon: 'file:cursorAgent.svg',\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription:\n\t\t\t'Chat model powered by the Cursor Agent CLI. Requires cursor-agent to be installed locally.',\n\t\tdefaults: {\n\t\t\tname: 'Cursor Agent CLI Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\n\t\t\t},\n\t\t\tresources: {},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'The model to use via cursor-agent CLI.',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t// Composer models\n\t\t\t\t\t{ name: 'Composer 2 Fast', value: 'composer-2-fast' },\n\t\t\t\t\t{ name: 'Composer 2', value: 'composer-2' },\n\t\t\t\t\t{ name: 'Composer 1.5', value: 'composer-1.5' },\n\t\t\t\t\t// Claude 4.6 models\n\t\t\t\t\t{ name: 'Claude 4.6 Opus High', value: 'claude-4.6-opus-high' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus High Thinking', value: 'claude-4.6-opus-high-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus Max', value: 'claude-4.6-opus-max' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus Max Thinking', value: 'claude-4.6-opus-max-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.6 Sonnet Medium', value: 'claude-4.6-sonnet-medium' },\n\t\t\t\t\t{ name: 'Claude 4.6 Sonnet Medium Thinking', value: 'claude-4.6-sonnet-medium-thinking' },\n\t\t\t\t\t// Claude 4.5 models\n\t\t\t\t\t{ name: 'Claude 4.5 Opus High', value: 'claude-4.5-opus-high' },\n\t\t\t\t\t{ name: 'Claude 4.5 Opus High Thinking', value: 'claude-4.5-opus-high-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.5 Sonnet', value: 'claude-4.5-sonnet' },\n\t\t\t\t\t{ name: 'Claude 4.5 Sonnet Thinking', value: 'claude-4.5-sonnet-thinking' },\n\t\t\t\t\t// Claude 4 models\n\t\t\t\t\t{ name: 'Claude 4 Sonnet', value: 'claude-4-sonnet' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet 1M', value: 'claude-4-sonnet-1m' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet Thinking', value: 'claude-4-sonnet-thinking' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet 1M Thinking', value: 'claude-4-sonnet-1m-thinking' },\n\t\t\t\t\t// Gemini models\n\t\t\t\t\t{ name: 'Gemini 3.1 Pro', value: 'gemini-3.1-pro' },\n\t\t\t\t\t{ name: 'Gemini 3 Flash', value: 'gemini-3-flash' },\n\t\t\t\t\t// GPT-5.4 models\n\t\t\t\t\t{ name: 'GPT-5.4 Low', value: 'gpt-5.4-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Medium', value: 'gpt-5.4-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Medium Fast', value: 'gpt-5.4-medium-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 High', value: 'gpt-5.4-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 High Fast', value: 'gpt-5.4-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 XHigh', value: 'gpt-5.4-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.4 XHigh Fast', value: 'gpt-5.4-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini None', value: 'gpt-5.4-mini-none' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini Low', value: 'gpt-5.4-mini-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini Medium', value: 'gpt-5.4-mini-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini High', value: 'gpt-5.4-mini-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini XHigh', value: 'gpt-5.4-mini-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano None', value: 'gpt-5.4-nano-none' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano Low', value: 'gpt-5.4-nano-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano Medium', value: 'gpt-5.4-nano-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano High', value: 'gpt-5.4-nano-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano XHigh', value: 'gpt-5.4-nano-xhigh' },\n\t\t\t\t\t// GPT-5.3 Codex models\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Low', value: 'gpt-5.3-codex-low' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Low Fast', value: 'gpt-5.3-codex-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex', value: 'gpt-5.3-codex' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Fast', value: 'gpt-5.3-codex-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex High', value: 'gpt-5.3-codex-high' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex High Fast', value: 'gpt-5.3-codex-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex XHigh', value: 'gpt-5.3-codex-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex XHigh Fast', value: 'gpt-5.3-codex-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview Low', value: 'gpt-5.3-codex-spark-preview-low' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview', value: 'gpt-5.3-codex-spark-preview' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview High', value: 'gpt-5.3-codex-spark-preview-high' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview XHigh', value: 'gpt-5.3-codex-spark-preview-xhigh' },\n\t\t\t\t\t// GPT-5.2 models\n\t\t\t\t\t{ name: 'GPT-5.2 Low', value: 'gpt-5.2-low' },\n\t\t\t\t\t{ name: 'GPT-5.2 Low Fast', value: 'gpt-5.2-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2', value: 'gpt-5.2' },\n\t\t\t\t\t{ name: 'GPT-5.2 Fast', value: 'gpt-5.2-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 High', value: 'gpt-5.2-high' },\n\t\t\t\t\t{ name: 'GPT-5.2 High Fast', value: 'gpt-5.2-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 XHigh', value: 'gpt-5.2-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.2 XHigh Fast', value: 'gpt-5.2-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Low', value: 'gpt-5.2-codex-low' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Low Fast', value: 'gpt-5.2-codex-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex', value: 'gpt-5.2-codex' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Fast', value: 'gpt-5.2-codex-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex High', value: 'gpt-5.2-codex-high' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex High Fast', value: 'gpt-5.2-codex-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex XHigh', value: 'gpt-5.2-codex-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex XHigh Fast', value: 'gpt-5.2-codex-xhigh-fast' },\n\t\t\t\t\t// GPT-5.1 models\n\t\t\t\t\t{ name: 'GPT-5.1 Low', value: 'gpt-5.1-low' },\n\t\t\t\t\t{ name: 'GPT-5.1', value: 'gpt-5.1' },\n\t\t\t\t\t{ name: 'GPT-5.1 High', value: 'gpt-5.1-high' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Low', value: 'gpt-5.1-codex-max-low' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Low Fast', value: 'gpt-5.1-codex-max-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Medium', value: 'gpt-5.1-codex-max-medium' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Medium Fast', value: 'gpt-5.1-codex-max-medium-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max High', value: 'gpt-5.1-codex-max-high' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max High Fast', value: 'gpt-5.1-codex-max-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max XHigh', value: 'gpt-5.1-codex-max-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max XHigh Fast', value: 'gpt-5.1-codex-max-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini Low', value: 'gpt-5.1-codex-mini-low' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini', value: 'gpt-5.1-codex-mini' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini High', value: 'gpt-5.1-codex-mini-high' },\n\t\t\t\t\t// GPT-5 models\n\t\t\t\t\t{ name: 'GPT-5 Mini', value: 'gpt-5-mini' },\n\t\t\t\t\t// Grok models\n\t\t\t\t\t{ name: 'Grok 4 20', value: 'grok-4-20' },\n\t\t\t\t\t{ name: 'Grok 4 20 Thinking', value: 'grok-4-20-thinking' },\n\t\t\t\t\t// Kimi models\n\t\t\t\t\t{ name: 'Kimi K2.5', value: 'kimi-k2.5' },\n\t\t\t\t],\n\t\t\t\tdefault: 'auto',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdescription: 'Additional options to configure',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Binary Path',\n\t\t\t\t\t\tname: 'binaryPath',\n\t\t\t\t\t\tdefault: 'cursor-agent',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Path to the cursor-agent binary. Defaults to \"cursor-agent\" (must be in PATH).',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Working Directory',\n\t\t\t\t\t\tname: 'workingDirectory',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Working directory for the cursor-agent process. Leave empty to use the default.',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tbinaryPath?: string;\n\t\t\tworkingDirectory?: string;\n\t\t};\n\n\t\tconst model = new ChatCursorAgentCLI({\n\t\t\tmodel: modelName,\n\t\t\tbinaryPath: options.binaryPath ?? 'cursor-agent',\n\t\t\tworkingDirectory: options.workingDirectory ?? '',\n\t\t});\n\n\t\tmodel.callbacks = [new N8nLlmTracing(this)];\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;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BAA0B,OAAO,yBAAyB;AAAA,YAClE,EAAE,MAAM,sBAAsB,OAAO,qBAAqB;AAAA,YAC1D,EAAE,MAAM,2BAA2B,OAAO,0BAA0B;AAAA;AAAA,YAEpE,EAAE,MAAM,cAAc,OAAO,aAAa;AAAA;AAAA,YAE1C,EAAE,MAAM,aAAa,OAAO,YAAY;AAAA,YACxC,EAAE,MAAM,sBAAsB,OAAO,qBAAqB;AAAA;AAAA,YAE1D,EAAE,MAAM,aAAa,OAAO,YAAY;AAAA,UACzC;AAAA,UACA,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAK9D,UAAM,QAAQ,IAAI,mBAAmB;AAAA,MACpC,OAAO;AAAA,MACP,YAAY,QAAQ,cAAc;AAAA,MAClC,kBAAkB,QAAQ,oBAAoB;AAAA,IAC/C,CAAC;AAED,UAAM,YAAY,CAAC,IAAI,mCAAc,IAAI,CAAC;AAE1C,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":["aiMessage"]}
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.ts"],"sourcesContent":["import { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport { AIMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';\nimport type { ChatResult } from '@langchain/core/outputs';\nimport type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';\nimport type { BindToolsInput } from '@langchain/core/language_models/chat_models';\nimport {\n\tApplicationError,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { N8nLlmTracing } from '../N8nLlmTracing';\nimport { spawn } from 'child_process';\nimport { existsSync, statSync } from 'fs';\n\ninterface CursorAgentFields {\n\tmodel: string;\n\tbinaryPath: string;\n\tworkingDirectory: string;\n}\n\ninterface ParsedToolCall {\n\tid: string;\n\tname: string;\n\targs: Record<string, unknown>;\n}\n\nconst TOOL_CALL_SYSTEM_PROMPT = `You have access to the following tools. When you need to call a tool, respond ONLY with a JSON block in this exact format (no other text before or after):\n\n\\`\\`\\`tool_calls\n[{\"id\": \"call_1\", \"name\": \"tool_name\", \"args\": {\"param\": \"value\"}}]\n\\`\\`\\`\n\nWhen you do NOT need to call a tool, respond normally with text. Never mix tool calls and text in the same response.\n\nAvailable tools:\n`;\n\n/**\n * Custom LangChain chat model that wraps the cursor-agent CLI binary.\n * Supports tool calling by injecting tool schemas into the prompt\n * and parsing structured JSON responses for tool calls.\n */\nclass ChatCursorAgentCLI extends BaseChatModel {\n\tmodel: string;\n\n\tbinaryPath: string;\n\n\tworkingDirectory: string;\n\n\tboundTools: BindToolsInput[] = [];\n\n\tconstructor(fields: CursorAgentFields) {\n\t\tsuper({});\n\t\tthis.model = fields.model;\n\t\tthis.binaryPath = fields.binaryPath;\n\t\tthis.workingDirectory = fields.workingDirectory;\n\t}\n\n\t_llmType(): string {\n\t\treturn 'cursor-agent-cli';\n\t}\n\n\toverride bindTools(tools: BindToolsInput[], kwargs?: Partial<this['ParsedCallOptions']>) {\n\t\tconst clone = new ChatCursorAgentCLI({\n\t\t\tmodel: this.model,\n\t\t\tbinaryPath: this.binaryPath,\n\t\t\tworkingDirectory: this.workingDirectory,\n\t\t});\n\t\tclone.boundTools = tools;\n\t\tclone.callbacks = this.callbacks;\n\t\tif (kwargs) {\n\t\t\treturn (\n\t\t\t\tclone as unknown as {\n\t\t\t\t\tbind: (kwargs: Record<string, unknown>) => ChatCursorAgentCLI;\n\t\t\t\t}\n\t\t\t).bind(kwargs as Record<string, unknown>);\n\t\t}\n\t\treturn clone;\n\t}\n\n\tasync _generate(\n\t\tmessages: BaseMessage[],\n\t\t_options: this['ParsedCallOptions'],\n\t\t_runManager?: CallbackManagerForLLMRun,\n\t): Promise<ChatResult> {\n\t\t// If tools are bound, inject tool schemas into a system message\n\t\tconst processedMessages = [...messages];\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolDescriptions = this.boundTools\n\t\t\t\t.map((tool) => {\n\t\t\t\t\tconst t = tool as Record<string, unknown>;\n\t\t\t\t\tconst name = (t.name as string) ?? '';\n\t\t\t\t\tconst description = (t.description as string) ?? '';\n\t\t\t\t\tconst schema = t.parameters ?? t.schema ?? {};\n\t\t\t\t\treturn `- ${name}: ${description}\\n Parameters: ${JSON.stringify(schema)}`;\n\t\t\t\t})\n\t\t\t\t.join('\\n\\n');\n\n\t\t\tconst systemPrompt = TOOL_CALL_SYSTEM_PROMPT + toolDescriptions;\n\t\t\tprocessedMessages.unshift(new SystemMessage(systemPrompt));\n\t\t}\n\n\t\t// Build prompt from messages\n\t\tconst prompt = processedMessages\n\t\t\t.map((m) => {\n\t\t\t\tconst content = typeof m.content === 'string' ? m.content : JSON.stringify(m.content);\n\t\t\t\tif (m instanceof SystemMessage) return `[system]: ${content}`;\n\t\t\t\tif (m instanceof HumanMessage) return `[user]: ${content}`;\n\t\t\t\tif (m instanceof AIMessage) return `[assistant]: ${content}`;\n\t\t\t\treturn `[${m._getType()}]: ${content}`;\n\t\t\t})\n\t\t\t.join('\\n\\n');\n\n\t\t// Execute cursor-agent CLI\n\t\tconst rawResponse = await this.executeCursorAgent(prompt);\n\n\t\t// Check for tool calls in response\n\t\tif (this.boundTools.length > 0) {\n\t\t\tconst toolCalls = this.extractToolCalls(rawResponse);\n\t\t\tif (toolCalls.length > 0) {\n\t\t\t\tconst aiMessage = new AIMessage({\n\t\t\t\t\tcontent: '',\n\t\t\t\t\ttool_calls: toolCalls.map((tc) => ({\n\t\t\t\t\t\tid: tc.id,\n\t\t\t\t\t\tname: tc.name,\n\t\t\t\t\t\targs: tc.args,\n\t\t\t\t\t\ttype: 'tool_call' as const,\n\t\t\t\t\t})),\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tgenerations: [{ message: aiMessage, text: '' }],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Normal text response\n\t\tconst aiMessage = new AIMessage({ content: rawResponse });\n\t\treturn {\n\t\t\tgenerations: [{ message: aiMessage, text: rawResponse }],\n\t\t};\n\t}\n\n\tprivate extractToolCalls(text: string): ParsedToolCall[] {\n\t\t// Look for tool_calls JSON block\n\t\tconst toolCallRegex = /```tool_calls\\s*\\n([\\s\\S]*?)\\n```/;\n\t\tconst match = toolCallRegex.exec(text);\n\t\tif (!match) return [];\n\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(match[1]) as Array<{\n\t\t\t\tid?: string;\n\t\t\t\tname: string;\n\t\t\t\targs: Record<string, unknown>;\n\t\t\t}>;\n\t\t\tif (!Array.isArray(parsed)) return [];\n\n\t\t\treturn parsed.map((tc, i) => ({\n\t\t\t\tid: tc.id ?? `call_${i}`,\n\t\t\t\tname: tc.name,\n\t\t\t\targs: tc.args ?? {},\n\t\t\t}));\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\tprivate async executeCursorAgent(prompt: string): Promise<string> {\n\t\tconst args = ['-p', '--output-format=stream-json', '--trust'];\n\t\tif (this.model && this.model !== 'auto') {\n\t\t\targs.push('--model', this.model);\n\t\t}\n\t\tconst cwd = this.workingDirectory?.trim() || undefined;\n\n\t\tconsole.log('[LmChatCursorAgent] spawning cursor-agent', {\n\t\t\tbinaryPath: this.binaryPath,\n\t\t\tmodel: this.model,\n\t\t\tcwd,\n\t\t});\n\n\t\treturn await new Promise<string>((resolve, reject) => {\n\t\t\tconst child = spawn(this.binaryPath, args, {\n\t\t\t\tcwd,\n\t\t\t\tstdio: ['pipe', 'pipe', 'pipe'],\n\t\t\t\tenv: { ...process.env },\n\t\t\t});\n\n\t\t\tlet stdout = '';\n\t\t\tlet stderr = '';\n\n\t\t\tchild.stdout.on('data', (data: Buffer) => {\n\t\t\t\tstdout += data.toString();\n\t\t\t});\n\n\t\t\tchild.stderr.on('data', (data: Buffer) => {\n\t\t\t\tstderr += data.toString();\n\t\t\t});\n\n\t\t\tchild.on('error', (err: Error) => {\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to spawn cursor-agent: ${err.message}. Make sure cursor-agent CLI is installed and accessible. Working directory: ${cwd ?? '<default>'}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tchild.on('close', (code: number | null) => {\n\t\t\t\tif (code !== 0 && !stdout) {\n\t\t\t\t\tconst errorMsg = stderr.trim() || `cursor-agent exited with code ${code}`;\n\t\t\t\t\treject(new Error(errorMsg));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst assistantContent = this.parseStreamJsonOutput(stdout);\n\n\t\t\t\tif (!assistantContent) {\n\t\t\t\t\treject(new Error('No assistant response received from cursor-agent'));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(assistantContent);\n\t\t\t});\n\n\t\t\tif (child.stdin) {\n\t\t\t\tchild.stdin.write(prompt);\n\t\t\t\tchild.stdin.end();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate parseStreamJsonOutput(output: string): string {\n\t\tconst lines = output.split('\\n').filter((line) => line.trim());\n\t\tconst assistantParts: string[] = [];\n\n\t\tfor (const line of lines) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(line) as {\n\t\t\t\t\ttype?: string;\n\t\t\t\t\tmessage?: {\n\t\t\t\t\t\tcontent?: Array<{ type?: string; text?: string }>;\n\t\t\t\t\t};\n\t\t\t\t\ttext?: string;\n\t\t\t\t};\n\n\t\t\t\tif (parsed.type === 'assistant' && parsed.message?.content) {\n\t\t\t\t\tfor (const item of parsed.message.content) {\n\t\t\t\t\t\tif (item.type === 'text' && item.text) {\n\t\t\t\t\t\t\tassistantParts.push(item.text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Skip non-JSON lines\n\t\t\t}\n\t\t}\n\n\t\treturn assistantParts.join('');\n\t}\n}\n\nexport class LmChatCursorAgent implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Cursor Agent CLI Chat Model',\n\n\t\tname: 'lmChatCursorAgent',\n\t\ticon: 'file:cursorAgent.svg',\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription:\n\t\t\t'Chat model powered by the Cursor Agent CLI. Requires cursor-agent to be installed locally.',\n\t\tdefaults: {\n\t\t\tname: 'Cursor Agent CLI Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\n\t\t\t},\n\t\t\tresources: {},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'The model to use via cursor-agent CLI',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t// Composer models\n\t\t\t\t\t{ name: 'Composer 2 Fast', value: 'composer-2-fast' },\n\t\t\t\t\t{ name: 'Composer 2', value: 'composer-2' },\n\t\t\t\t\t{ name: 'Composer 1.5', value: 'composer-1.5' },\n\t\t\t\t\t// Claude 4.6 models\n\t\t\t\t\t{ name: 'Claude 4.6 Opus High', value: 'claude-4.6-opus-high' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus High Thinking', value: 'claude-4.6-opus-high-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus Max', value: 'claude-4.6-opus-max' },\n\t\t\t\t\t{ name: 'Claude 4.6 Opus Max Thinking', value: 'claude-4.6-opus-max-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.6 Sonnet Medium', value: 'claude-4.6-sonnet-medium' },\n\t\t\t\t\t{ name: 'Claude 4.6 Sonnet Medium Thinking', value: 'claude-4.6-sonnet-medium-thinking' },\n\t\t\t\t\t// Claude 4.5 models\n\t\t\t\t\t{ name: 'Claude 4.5 Opus High', value: 'claude-4.5-opus-high' },\n\t\t\t\t\t{ name: 'Claude 4.5 Opus High Thinking', value: 'claude-4.5-opus-high-thinking' },\n\t\t\t\t\t{ name: 'Claude 4.5 Sonnet', value: 'claude-4.5-sonnet' },\n\t\t\t\t\t{ name: 'Claude 4.5 Sonnet Thinking', value: 'claude-4.5-sonnet-thinking' },\n\t\t\t\t\t// Claude 4 models\n\t\t\t\t\t{ name: 'Claude 4 Sonnet', value: 'claude-4-sonnet' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet 1M', value: 'claude-4-sonnet-1m' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet Thinking', value: 'claude-4-sonnet-thinking' },\n\t\t\t\t\t{ name: 'Claude 4 Sonnet 1M Thinking', value: 'claude-4-sonnet-1m-thinking' },\n\t\t\t\t\t// Gemini models\n\t\t\t\t\t{ name: 'Gemini 3.1 Pro', value: 'gemini-3.1-pro' },\n\t\t\t\t\t{ name: 'Gemini 3 Flash', value: 'gemini-3-flash' },\n\t\t\t\t\t// GPT-5.4 models\n\t\t\t\t\t{ name: 'GPT-5.4 Low', value: 'gpt-5.4-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Medium', value: 'gpt-5.4-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Medium Fast', value: 'gpt-5.4-medium-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 High', value: 'gpt-5.4-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 High Fast', value: 'gpt-5.4-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 XHigh', value: 'gpt-5.4-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.4 XHigh Fast', value: 'gpt-5.4-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini None', value: 'gpt-5.4-mini-none' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini Low', value: 'gpt-5.4-mini-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini Medium', value: 'gpt-5.4-mini-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini High', value: 'gpt-5.4-mini-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 Mini XHigh', value: 'gpt-5.4-mini-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano None', value: 'gpt-5.4-nano-none' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano Low', value: 'gpt-5.4-nano-low' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano Medium', value: 'gpt-5.4-nano-medium' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano High', value: 'gpt-5.4-nano-high' },\n\t\t\t\t\t{ name: 'GPT-5.4 Nano XHigh', value: 'gpt-5.4-nano-xhigh' },\n\t\t\t\t\t// GPT-5.3 Codex models\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Low', value: 'gpt-5.3-codex-low' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Low Fast', value: 'gpt-5.3-codex-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex', value: 'gpt-5.3-codex' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Fast', value: 'gpt-5.3-codex-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex High', value: 'gpt-5.3-codex-high' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex High Fast', value: 'gpt-5.3-codex-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex XHigh', value: 'gpt-5.3-codex-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex XHigh Fast', value: 'gpt-5.3-codex-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview Low', value: 'gpt-5.3-codex-spark-preview-low' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview', value: 'gpt-5.3-codex-spark-preview' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview High', value: 'gpt-5.3-codex-spark-preview-high' },\n\t\t\t\t\t{ name: 'GPT-5.3 Codex Spark Preview XHigh', value: 'gpt-5.3-codex-spark-preview-xhigh' },\n\t\t\t\t\t// GPT-5.2 models\n\t\t\t\t\t{ name: 'GPT-5.2 Low', value: 'gpt-5.2-low' },\n\t\t\t\t\t{ name: 'GPT-5.2 Low Fast', value: 'gpt-5.2-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2', value: 'gpt-5.2' },\n\t\t\t\t\t{ name: 'GPT-5.2 Fast', value: 'gpt-5.2-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 High', value: 'gpt-5.2-high' },\n\t\t\t\t\t{ name: 'GPT-5.2 High Fast', value: 'gpt-5.2-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 XHigh', value: 'gpt-5.2-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.2 XHigh Fast', value: 'gpt-5.2-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Low', value: 'gpt-5.2-codex-low' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Low Fast', value: 'gpt-5.2-codex-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex', value: 'gpt-5.2-codex' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex Fast', value: 'gpt-5.2-codex-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex High', value: 'gpt-5.2-codex-high' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex High Fast', value: 'gpt-5.2-codex-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex XHigh', value: 'gpt-5.2-codex-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.2 Codex XHigh Fast', value: 'gpt-5.2-codex-xhigh-fast' },\n\t\t\t\t\t// GPT-5.1 models\n\t\t\t\t\t{ name: 'GPT-5.1 Low', value: 'gpt-5.1-low' },\n\t\t\t\t\t{ name: 'GPT-5.1', value: 'gpt-5.1' },\n\t\t\t\t\t{ name: 'GPT-5.1 High', value: 'gpt-5.1-high' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Low', value: 'gpt-5.1-codex-max-low' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Low Fast', value: 'gpt-5.1-codex-max-low-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Medium', value: 'gpt-5.1-codex-max-medium' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max Medium Fast', value: 'gpt-5.1-codex-max-medium-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max High', value: 'gpt-5.1-codex-max-high' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max High Fast', value: 'gpt-5.1-codex-max-high-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max XHigh', value: 'gpt-5.1-codex-max-xhigh' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Max XHigh Fast', value: 'gpt-5.1-codex-max-xhigh-fast' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini Low', value: 'gpt-5.1-codex-mini-low' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini', value: 'gpt-5.1-codex-mini' },\n\t\t\t\t\t{ name: 'GPT-5.1 Codex Mini High', value: 'gpt-5.1-codex-mini-high' },\n\t\t\t\t\t// GPT-5 models\n\t\t\t\t\t{ name: 'GPT-5 Mini', value: 'gpt-5-mini' },\n\t\t\t\t\t// Grok models\n\t\t\t\t\t{ name: 'Grok 4 20', value: 'grok-4-20' },\n\t\t\t\t\t{ name: 'Grok 4 20 Thinking', value: 'grok-4-20-thinking' },\n\t\t\t\t\t// Kimi models\n\t\t\t\t\t{ name: 'Kimi K2.5', value: 'kimi-k2.5' },\n\t\t\t\t],\n\t\t\t\tdefault: 'auto',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdescription: 'Additional options to configure',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Binary Path',\n\t\t\t\t\t\tname: 'binaryPath',\n\t\t\t\t\t\tdefault: 'cursor-agent',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Path to the cursor-agent binary. Defaults to \"cursor-agent\" (must be in PATH).',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Working Directory',\n\t\t\t\t\t\tname: 'workingDirectory',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Working directory for the cursor-agent process. Leave empty to use the default.',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst binaryPath = this.getNodeParameter(\n\t\t\t'options.binaryPath',\n\t\t\titemIndex,\n\t\t\t'cursor-agent',\n\t\t) as string;\n\t\tconst rawWorkingDirectory = this.getNodeParameter('options.workingDirectory', itemIndex, '', {\n\t\t\trawExpressions: true,\n\t\t}) as string | undefined;\n\t\tconst workingDirectory = this.getNodeParameter('options.workingDirectory', itemIndex, '') as\n\t\t\t| string\n\t\t\t| undefined;\n\t\tconst normalizedWorkingDirectory = (workingDirectory ?? '').trim();\n\t\tconst rawWorkingDirectoryValue = rawWorkingDirectory ?? '';\n\t\tconst isWorkingDirectoryExpression =\n\t\t\trawWorkingDirectoryValue.startsWith('=') ||\n\t\t\trawWorkingDirectoryValue.includes('{{') ||\n\t\t\trawWorkingDirectoryValue.includes('$workspace');\n\n\t\tconsole.log('[LmChatCursorAgent] resolved Cursor Agent options', {\n\t\t\titemIndex,\n\t\t\tmodelName,\n\t\t\tbinaryPath,\n\t\t\trawWorkingDirectory,\n\t\t\tworkingDirectory: normalizedWorkingDirectory,\n\t\t});\n\n\t\tif (isWorkingDirectoryExpression && !normalizedWorkingDirectory) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Cursor Agent working directory expression resolved to an empty value: ${rawWorkingDirectoryValue}`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnormalizedWorkingDirectory.includes('{{') ||\n\t\t\tnormalizedWorkingDirectory.includes('$workspace')\n\t\t) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Cursor Agent working directory was not resolved before execution: ${normalizedWorkingDirectory}`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnormalizedWorkingDirectory &&\n\t\t\t(!existsSync(normalizedWorkingDirectory) ||\n\t\t\t\t!statSync(normalizedWorkingDirectory).isDirectory())\n\t\t) {\n\t\t\tthrow new ApplicationError(\n\t\t\t\t`Cursor Agent working directory does not exist or is not a directory: ${normalizedWorkingDirectory}`,\n\t\t\t);\n\t\t}\n\n\t\tconst model = new ChatCursorAgentCLI({\n\t\t\tmodel: modelName,\n\t\t\tbinaryPath,\n\t\t\tworkingDirectory: normalizedWorkingDirectory,\n\t\t});\n\n\t\tmodel.callbacks = [new N8nLlmTracing(this)];\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA8B;AAE9B,sBAAuD;AAIvD,0BAOO;AAEP,0BAA6C;AAE7C,2BAA8B;AAC9B,2BAAsB;AACtB,gBAAqC;AAcrC,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBhC,MAAM,2BAA2B,iCAAc;AAAA,EAS9C,YAAY,QAA2B;AACtC,UAAM,CAAC,CAAC;AAHT,sBAA+B,CAAC;AAI/B,SAAK,QAAQ,OAAO;AACpB,SAAK,aAAa,OAAO;AACzB,SAAK,mBAAmB,OAAO;AAAA,EAChC;AAAA,EAEA,WAAmB;AAClB,WAAO;AAAA,EACR;AAAA,EAES,UAAU,OAAyB,QAA6C;AACxF,UAAM,QAAQ,IAAI,mBAAmB;AAAA,MACpC,OAAO,KAAK;AAAA,MACZ,YAAY,KAAK;AAAA,MACjB,kBAAkB,KAAK;AAAA,IACxB,CAAC;AACD,UAAM,aAAa;AACnB,UAAM,YAAY,KAAK;AACvB,QAAI,QAAQ;AACX,aACC,MAGC,KAAK,MAAiC;AAAA,IACzC;AACA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,UACL,UACA,UACA,aACsB;AAEtB,UAAM,oBAAoB,CAAC,GAAG,QAAQ;AACtC,QAAI,KAAK,WAAW,SAAS,GAAG;AAC/B,YAAM,mBAAmB,KAAK,WAC5B,IAAI,CAAC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