Files
makeCAD/docs/vibemake/web-assistant.md
T
likang 2cdf535fd1
CI / Select checks (push) Has been cancelled
CI / Format and repository checks (push) Has been cancelled
CI / Compile RISC-V (manual) (push) Has been cancelled
Docker / image (push) Has been cancelled
Generated files / Regenerate and commit (push) Has been cancelled
Lists / Design format changes merge cleanly (push) Has been cancelled
Lists / Lists are sorted one item per line (push) Has been cancelled
Packaging lint / lint (push) Has been cancelled
Pages / build (push) Has been cancelled
CI / Dependency advisories (push) Has been cancelled
CI / Quick compile (push) Has been cancelled
CI / Native Linux Clippy (push) Has been cancelled
CI / Build tests (push) Has been cancelled
CI / Native Linux tests (push) Has been cancelled
CI / GPU path tests (1/4) (push) Has been cancelled
CI / GPU path tests (2/4) (push) Has been cancelled
CI / GPU path tests (3/4) (push) Has been cancelled
CI / GPU path tests (4/4) (push) Has been cancelled
CI / Action matrix (1/16) (push) Has been cancelled
CI / Action matrix (10/16) (push) Has been cancelled
CI / Action matrix (11/16) (push) Has been cancelled
CI / Action matrix (12/16) (push) Has been cancelled
CI / Action matrix (13/16) (push) Has been cancelled
CI / Action matrix (14/16) (push) Has been cancelled
CI / Action matrix (15/16) (push) Has been cancelled
CI / Action matrix (16/16) (push) Has been cancelled
CI / Action matrix (2/16) (push) Has been cancelled
CI / Action matrix (3/16) (push) Has been cancelled
CI / Action matrix (4/16) (push) Has been cancelled
CI / Action matrix (5/16) (push) Has been cancelled
CI / Action matrix (6/16) (push) Has been cancelled
CI / Action matrix (7/16) (push) Has been cancelled
CI / Action matrix (8/16) (push) Has been cancelled
CI / Action matrix (9/16) (push) Has been cancelled
CI / Action matrix determinism (push) Has been cancelled
CI / Property tests (many cases) (push) Has been cancelled
CI / Doc tests (push) Has been cancelled
CI / Reference tests (push) Has been cancelled
CI / Windows D3D12 FXC shaders (push) Has been cancelled
CI / Windows app startup (push) Has been cancelled
CI / ci (push) Has been cancelled
CI / Compile WebAssembly (push) Has been cancelled
CI / Nightly alert (push) Has been cancelled
Pages / deploy (push) Has been cancelled
修改ai助手
2026-11-09 18:53:36 +08:00

7.9 KiB
Raw Blame History

VibeMake CAD Web 助手

使用方式

  1. 在桌面浏览器登录 VibeMake,打开一个 CAD 云项目。
  2. 点击顶部右侧的助手图标,或使用原版助手快捷键。
  3. 在“首选项 → 助手”添加智能体,选择 OpenAI 兼容或 Anthropic 兼容协议,填写名称、服务地址和模型名称。没有模型列表也可以手动填写模型。
  4. 按服务要求填写 API Key,点击测试连接。测试会调用一次模型,并请求一个不修改工程的工具。测试可能产生模型服务费用。
  5. 使用“每次询问”模式开始对话。读取工程可直接执行;修改工程需先批准。也可在原版权限设置中选择“自动允许模型编辑”或“全部”。
  6. 检查修改结果,需要时撤销;确认后使用正常云保存。助手不会自动把模型修改保存到云端。

服务地址填写 API 基址,例如服务文档定义的 /v1,不要填写单个 /chat/completions 或 /messages 请求地址。界面沿用原版服务预设,也支持自定义地址;预设仅帮助填写,不能视为已经通过浏览器认证。“兼容协议”表示请求形状,不能保证任意服务支持浏览器、图片或全部工具。修改协议或服务预设时,旧密钥不会随之发送到新地址。

“已安装”和“自定义命令”保留原版位置,当前置灰并说明需要助手服务或本地连接程序。独立系统窗口入口同样说明 Web 限制;左右停靠、调整宽度、最小化和新建对话继续使用原版交互。

The composer has an Upload attachment button beside Attach view, Attach selection and Pick context. The existing + menu also offers a file picker and clipboard pictures; clipboard access requires browser permission. Files can also be dropped onto the assistant. Supported images are PNG, JPG/JPEG, GIF, WebP, BMP and TIF/TIFF. Hosted CAD AI converts GIF/WebP/BMP/TIFF to PNG; animated images use the first frame when converted. Supported UTF-8 text files are SVG source, TXT, MD/Markdown, JSON, CSV/TSV, YAML/YML, TOML, XML, LOG, INI and CFG. A message accepts up to eight files, each image up to 40 MiB and each text file up to 256 KiB. Images are resized to a longest edge of at most 2048 pixels; backend limits may reduce them further. Attachments are sent with the next message. PDF, Office documents, CAD files, audio, video and local path references are unavailable as web chat attachments; use File import for CAD files.

数据与凭据

  • 浏览器直接请求该模型服务,不经过 VibeMake 模型代理,也不发送 VibeMake token 或 Cookie。
  • 对话会按需包含当前工程摘要、选择与工具查询结果。视图截图和图片/文本文件由用户主动附加;不默认上传完整 .sc。
  • CAD 文件继续使用文件菜单导入,不能在聊天中绕过工程绑定和导入确认。
  • 对话仅在当前页面会话内存在;刷新后清空。普通智能体配置、默认项、权限和授权记录按账号保存。
  • API Key 默认仅存在当前页面内存,刷新后需重新填写。勾选“在本浏览器记住”才保存到账号独立的 IndexedDB。
  • 取消记住、删除密钥或清除本账号已记住密钥,会删除持久化副本。浏览器存储失败时提示“未记住”,当前页面仍可使用内存中的密钥。
  • 浏览器存储不是系统钥匙串;同源脚本可访问。更换服务地址时必须重新填写密钥,不自动传递旧密钥。
  • 退出或换账号清空内存中的凭据和任务;主动记住的凭据仍属于原账号。多个设备或浏览器不会同步密钥。

权限和取消

设置 规则
每次询问(初始值) 读取直接执行,修改先审批
自动允许模型编辑 普通建模修改直接执行,其他原版需确认操作继续询问
全部 当前 Web 平台允许的工具自动执行

单智能体覆盖和“允许一次 / 始终允许 / 拒绝”沿用原版。所有模式都禁止助手替换当前云项目、访问本机文件、执行终端、退出账号或绕过平台锁定。用户在轮次中修改模型会使旧审批失效,需要基于最新模型继续。

停止会取消网络和尚未执行的工具,已经完成的修改保留并可撤销。正在运行的同步几何计算不能保证立即中断。登录失效、宿主锁定、项目释放和上下文切换同样取消未完成任务。工具失败、拒绝或参数无效时,以失败状态保留工具记录并将错误反馈给模型,供其解释或修正;后续工具仍逐项通过相同审批和工程检查。

连接排错

现象 检查方法
401 / 403 检查模型服务自己的 Key、权限和配额;这不会退出 VibeMake
429 模型服务限流或额度限制,稍后重试并检查服务控制台
网络失败 检查服务地址、HTTPS、网络、服务状态、浏览器本机网络权限与跨域配置;不能只凭浏览器的通用错误断定是 CORS
CORS 拒绝 模型服务必须允许当前网站源、所需请求方法和请求头;前端不能绕过服务端拒绝
跳转失败 带 Key 的请求不自动跟随重定向,请填写最终 API 基址
请求超时 检查服务状态,或调整智能体请求超时;停止可取消请求与响应读取
响应无效 检查所选协议、服务基址及非流式 JSON 兼容性;超出 16 MiB 的响应会被拒绝
仅支持聊天 模型能回答但未通过工具调用探针;不会标记为可操作 CAD,需更换支持工具调用的模型
模型列表失败 可以手动输入模型名称,再测试真实模型请求
密钥未记住 检查浏览器 IndexedDB、隐私模式、配额和网站存储权限;不等于密钥无效
助手要求引擎更新 主站和独立引擎版本不匹配,需发布含助手能力的新引擎

默认允许 HTTPS;本机地址遵循已有严格 loopback 规则。HTTP localhost 能否从线上网站访问仍由浏览器安全策略决定,不能保证所有浏览器可用。

实现位置

  • crates/ui-egui/src/agent_chat/:原版 UI、共享协议、权限、轮次和文档检查。
  • apps/solidcraft-web/src/agent.rs:Fetch、AbortController、模型探针、双协议回合及浏览器附件。
  • apps/solidcraft-web/src/agent_tools.rs:无子进程的 MCP 工具适配;只派发尚未执行的控制请求。
  • apps/solidcraft-web/src/agent_storage.rs:账号配置、内存密钥和可选 IndexedDB。
  • apps/solidcraft-web/src/platform.rs:能力声明、上下文、锁定与生命周期。
  • VibeMake 的 js/cad/app.js:应用栏入口、账号/工程上下文同步与取消。

自动化验证

生产代码没有新增模型代理。vibemake/tests/cad/assistant-model.mjs 仅为自动化测试提供可控的本机模型接口,不能部署成公共服务。

在 VibeMake 仓库启动测试 API,再使用已构建的 SMLib 引擎启动站点:

node tests/cad/mock-server.mjs
PORT=8094 API_TARGET=http://127.0.0.1:8092 node scripts/server.mjs

另一个终端:

VM_CAD_BASE_URL=http://localhost:8094 \
VM_CAD_ARTIFACT_DIR=/absolute/path/to/artifacts \
npm run test:cad:assistant

npm run test:cad:browser 还会执行已有 CAD 集成回归和助手用例。真实 HTTPS 部署、实际模型服务及不同浏览器的兼容范围必须另外实测;本机可控接口通过不能当作商业模型服务已认证。

最新一轮前端还原、最终构建、46 项 CAD 浏览器回归(含 26 项助手专项)及截图,参见 前端还原验收记录。此前的 38 项浏览器回归、完整 CI 的失败及未验收边界保留在 上一轮 Web 助手验收记录。

下一阶段服务接口和原版事件映射,参见 后端接入交接。该文档描述待实现服务,不代表当前已接入后端。