我想通过TypeScript SDK,把iflow-cli纳入我的项目当中。但无法连接。提示如下:
[2025-11-26 19:05:55.440] [info] [ (main)] [CLIAgentManager] Initiating iFlow CLI agent start sequence for agent: iflow-cli
[2025-11-26 19:05:55.442] [info] [ (main)] [iFlowClientHandler] 检查iFlow CLI是否已在运行…
[2025-11-26 19:05:55.449] [info] [ (main)] [iFlowClientHandler] 检测iflow命令是否存在…
[2025-11-26 19:05:58.927] [info] [ (main)] [iFlowClientHandler] iflow命令检测成功,版本信息: 0.3.27
[2025-11-26 19:05:58.930] [info] [ (main)] [iFlowClientHandler] 检查iFlow认证状态…
[2025-11-26 19:05:58.932] [info] [ (main)] [iFlowClientHandler] 检查iFlow认证状态…
[2025-11-26 19:09:09.301] [info] [ (main)] [iFlowClientHandler] iFlow认证状态检查结果: {
exitCode: 0,
output: “I can see this is the ThinkTank project, an Electron-based desktop AI assistant application that integrates Google Gemini. The project uses React, TypeScript, and various AI/multimodal libraries. The package.json shows it’s using Electron 37.10.2 with Vite for building, and has dependencies for AI features (Google Generative AI, transformers), document processing (docx, PDF), and UI components (Material UI).\n” +
‘\n’ +
“Is there something specific you’d like me to help you with in this project?\n”,
error: “[ERROR] [ImportProcessor] Failed to import mui/material:: ENOENT: no such file or directory, access ‘E:\0temp\gemini-desktop-app\mui\material:’\n” +
“[ERROR] [ImportProcessor] Failed to import emotion/react:: ENOENT: no such file or directory, access ‘E:\0temp\gemini-desktop-app\emotion\react:’\n” +
“[ERROR] [ImportProcessor] Failed to import google/generative-ai:: ENOENT: no such file or directory, access ‘E:\0temp\gemini-desktop-app\google\generative-ai:’\n” +
“[ERROR] [ImportProcessor] Failed to import xenova/transformers:: ENOENT: no such file or directory, access ‘E:\0temp\gemini-desktop-app\xenova\transformers:’\n” +
“Error during discovery for server ‘‘chrome-devtools’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘desktop-commander’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘fetch’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘12306-mcp’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘docx-edit-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘excel-edit-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘playwright’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘context7’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘mcp-mermaid’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘zonos-tts-mcp’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘markmap’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘qrcode-mcp’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘markmap’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘bilibili-mcp-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘chrome-devtools’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘mindmap-mcp-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘rss-reader-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘ebook-mcp’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘zonos-tts-mcp’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘context7’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘docx-edit-server’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘n8n-workflow-builder’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘fetch’’: e.code?.toLowerCase is not a function\n” +
“Error during discovery for server ‘‘excel-edit-server’’: e.code?.toLowerCase is not a function\n” +
‘\n’ +
‘\n’ +
‘{\n’ +
’ “session-id”: “session-1d1196f0-aa60-4bc6-ac29-47d4c033127b”,\n’ +
’ “conversation-id”: “8429c4d1-3045-4cc6-90cf-d2bf62c793a0”,\n’ +
’ “assistantRounds”: 4,\n’ +
’ “executionTimeMs”: 55878,\n’ +
’ “tokenUsage”: {\n’ +
’ “input”: 46685,\n’ +
’ “output”: 106,\n’ +
’ “total”: 46791\n’ +
’ }\n’ +
‘}\n’ +
‘</Execution Info>\n’
}
[2025-11-26 19:09:09.313] [info] [ (main)] [iFlowClientHandler] iFlow认证状态检查成功
[2025-11-26 19:09:09.317] [info] [ (main)] [iFlowClientHandler] 检查iFlow进程是否可以启动…
[2025-11-26 19:09:18.194] [info] [ (main)] [iFlowClientHandler] iFlow启动测试成功
[2025-11-26 19:09:18.198] [info] [ (main)] [iFlowClientHandler] 正在连接到iFlow ACP服务器 (使用IFlowClient SDK)…
[2025-11-26 19:09:18.201] [info] [ (main)] [iFlowClientHandler] 连接选项: {
url: ‘ws://localhost:8090/acp’,
autoStartProcess: true,
processStartPort: 8090,
cwd: ‘E:\0\zggbh\第012课’,
timeout: 120000,
logLevel: ‘INFO’
}
[2025-11-26 19:09:18.216] [info] [ (main)] [iFlowClientHandler] 尝试连接到iFlow ACP服务…
[2025-11-26 19:09:18.220] [warn] [ (main)] [iFlowClientHandler] IFlowClient 不支持 .on() 方法,可能使用了不同的事件系统
[2025-11-26 19:09:18.222] [warn] [ (main)] [iFlowClientHandler] IFlowClient 方法列表: [
‘constructor’,
‘connect’,
‘loadSession’,
‘disconnect’,
‘sendMessage’,
‘interrupt’,
‘receiveMessages’,
‘approveToolCall’,
‘rejectToolCall’,
‘handleMessages’,
‘processProtocolMessage’
]
[2025-11-26 19:09:18.229] [info] [ (main)] [iFlowClientHandler] 开始连接到iFlow服务器…
[2025-11-26 19:09:18.293] [info] [ (main)] [2025-11-26 19:09:18] INFO: Connecting to ws://localhost:8090/acp
[2025-11-26 19:09:18.336] [info] [ (main)] [2025-11-26 19:09:18] INFO: iFlow not running, starting process…
[2025-11-26 19:09:18.765] [error] [ (main)] [2025-11-26 19:09:18] ERROR: iFlow not installed
[2025-11-26 19:09:18.769] [info] [ (main)] [2025-11-26 19:09:18] INFO: Disconnected from iFlow
[2025-11-26 19:09:18.773] [error] [ (main)] Failed to connect to iFlow CLI: ConnectionError: Failed to connect: class d extends l {
constructor(e, t2) {
super(e, t2), this.name = “IFlowNotInstalledError”;
}
}
at B. (E:\0temp\gemini-desktop-app.vite\build\main-B2SsNOug.js:442019:40)
at Generator.next ()
at r2 (E:\0temp\gemini-desktop-app.vite\build\main-B2SsNOug.js:441270:14)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[2025-11-26 19:09:18.776] [error] [ (main)] Error details: {
message: ‘Failed to connect: class d extends l {\n’ +
’ constructor(e, t2) {\n’ +
’ super(e, t2), this.name = “IFlowNotInstalledError”;\n’ +
’ }\n’ +
‘}’,
name: ‘ConnectionError’,
stack: ‘ConnectionError: Failed to connect: class d extends l {\n’ +
’ constructor(e, t2) {\n’ +
’ super(e, t2), this.name = “IFlowNotInstalledError”;\n’ +
’ }\n’ +
‘}\n’ +
’ at B. (E:\0temp\gemini-desktop-app\.vite\build\main-B2SsNOug.js:442019:40)\n’ +
’ at Generator.next ()\n’ +
’ at r2 (E:\0temp\gemini-desktop-app\.vite\build\main-B2SsNOug.js:441270:14)\n’ +
’ at process.processTicksAndRejections (node:internal/process/task_queues:105:5)’
}
[2025-11-26 19:09:18.778] [info] [ (main)] [CLIAgentManager] iFlow连接失败,结果: {
success: false,
message: ‘连接失败: Failed to connect: class d extends l {\n’ +
’ constructor(e, t2) {\n’ +
’ super(e, t2), this.name = “IFlowNotInstalledError”;\n’ +
’ }\n’ +
‘}’
}
[2025-11-26 19:09:18.780] [info] [ (main)] [2025-11-26 19:09:18] INFO: Disconnected from iFlow
不知道原因出在哪里?
是不是用户的认证需要处理?
如果在命令行启动iflow-cli,会有登录提示,登录后才能使用。
是不是需要在环境变量配置API key?
请给一些提示。