Skip to content

Releases

v0.1.0 — 首个公开版本

Choose a tag to compare

@GeKaixing GeKaixing released this 11 Sep 07:01

Control-Agent v0.1.0 — 首个公开版本

Control-Agent logo

用 TypeScript 从零实现的终端编码代理,零框架依赖(运行时仅 tsx + Node 内置模块)。

核心能力

  • 双循环调度内核:外层循环处理一轮轮用户请求,内层循环处理「模型 ↔ 工具」多轮往返(src/agent/agent.ts)
  • 一个内核、三入口:CLI / Electron 桌面端 / 微信 bot 共用同一个 Agent 类
  • 会话树上下文管理:树状会话节点 + 分支切换,transformContext 三步后处理(清孤儿 → 压旧轮 → 迟滞裁剪,prompt cache 亲和)
  • 模型适配器:OpenAI / Anthropic / Gemini 三协议收敛为同一 StreamFn,8 个厂商预设,缺 key 降级 mock
  • 内置工具集:read / write / edit / bash / glob / grep / memory / ask-user
  • 纯视觉 Computer Use:screenshot(感知端)+ computer(执行端,click / type / hotkey / scroll / drag / focus),Windows(PowerShell + user32 P/Invoke)与 macOS(screencapture + JXA/CGEvent)双后端,零 npm 依赖
  • 内部浏览器面板:结构化 DOM 级浏览器控制(多标签、抓包/拦截、登录态持久),不弹外部窗口
  • Connector 插件运行时:自研 Loader → Registry → Runtime,支持 manifest.enabledBy 门控,对外暴露 MCP server
  • 桌面客户端:Electron,审批门带 write/edit diff 预览、浏览器面板、手机投屏面板

设计哲学

「五支柱」(Model / Context / Tool / Permission / Environment)——harness 里的每段逻辑都过一遍「消失之问」:模型变强后自己能做对的事,让给模型。

环境要求

  • Node.js ≥ 22
  • Windows 需 --disable-gpu --no-sandbox 启动桌面端