kurihada
|
2abea47386
|
refactor(core): 移除不再需要的文件系统工具
删除以下工具及相关文件:
- copy_file: 复制文件
- create_directory: 创建目录
- delete_file: 删除文件
- move_file: 移动文件
- search_files: 搜索文件
清理范围:
- 工具实现文件 (5个)
- 工具描述文件 (5个)
- 单元测试文件 (6个)
- Agent presets 中的引用
- Checkpoint 系统中的触发类型
- Hook 系统中的相关处理
|
2025-12-17 12:00:46 +08:00 |
|
kurihada
|
30f35a6562
|
refactor(core): 重命名 grep_content 工具为 grep
- 重命名 grep_content.ts 为 grep.ts
- 更新工具名称从 grep_content 改为 grep
- 更新所有引用该工具的代码和测试文件
- 更新描述文件名称
|
2025-12-16 15:03:33 +08:00 |
|
kurihada
|
58f1bc8718
|
feat(core): 实现动态提示词模板系统
- 新增 prompt-template 模块,支持运行时变量替换
- 支持 ${variable}、${obj.prop}、${cond ? "a" : "b"} 语法
- AgentInfo 新增 promptTemplate 字段标记动态模板
- Plan Agent 提示词改用模板语法,支持动态工具名和计划文件路径
- AgentExecutor.buildSystemPrompt 集成模板渲染
- 新增 27 个单元测试验证模板功能
|
2025-12-16 14:15:10 +08:00 |
|
kurihada
|
a32c83480d
|
feat(core): 新增 glob 工具,支持文件模式匹配
- 新增 glob 工具,支持 **/*.ts 等 glob 模式匹配文件
- 结果按修改时间排序,限制返回 100 个结果
- 自动忽略 node_modules、.git 等目录
- 更新 Plan Agent 提示词使用 glob 替代 search_files
- 在 Plan Agent 工具列表中启用 glob
|
2025-12-16 14:01:42 +08:00 |
|
kurihada
|
f7b934a69e
|
refactor(core): 简化 Agent 提示词系统,移除 provider 动态加载
- 直接在 build.ts 和 plan.ts 中定义 prompt 字段
- 简化 system-prompt.ts,移除 provider/forProvider/plan 函数
- 简化 agent.ts 中的 resolveSystemPrompt 方法
- 删除不再需要的提示词文件 (anthropic/beast/gemini/qwen/plan.txt)
- 更新 package.json build 脚本,移除复制 prompts 目录
|
2025-12-16 13:48:56 +08:00 |
|
kurihada
|
6817aebfc4
|
refactor(core): 简化 Plan Agent bash 权限规则,移除 deny 改用 ask
|
2025-12-16 11:42:48 +08:00 |
|
kurihada
|
70394ed06c
|
fix(core): 修复 Plan Agent 通过 heredoc 绕过写入限制的安全漏洞
- 重排 bash 权限规则顺序,deny 规则置于 allow 规则之前
- 添加 heredoc 重定向检测规则 (* << *)
- 新增 checkRedirectInRawCommand 预检函数,在 tree-sitter 解析前检测重定向
- 禁用 Plan Agent 的 tool_search 工具,防止动态发现写入工具
- 添加更多危险命令: ln, install, truncate, dd, tee
|
2025-12-16 11:23:02 +08:00 |
|
kurihada
|
f3995d158c
|
feat(core): 实现动态系统提示词加载
- 创建 SystemPrompt 模块,根据模型类型动态加载对应的提示词
- 从 OpenCode 拷贝提示词文件 (anthropic/beast/gemini/qwen/plan.txt)
- 修改 Build/Plan Agent 预设,移除内联 prompt
- Agent 类新增 resolveSystemPrompt 方法处理提示词加载逻辑
- 构建脚本自动复制 prompts 目录到 dist
|
2025-12-15 23:05:08 +08:00 |
|
kurihada
|
013e9a2712
|
feat(core): 移除内置 Agent 的 maxSteps 限制,默认使用 Build 模式
- 移除 build/plan/general/explore 的 maxSteps 配置
- 内置 Agent 不再限制步数(与 OpenCode 保持一致)
- 用户自定义 Agent 仍可按需配置 maxSteps
- 新建 Agent 默认使用 Build 模式
|
2025-12-15 22:27:42 +08:00 |
|
kurihada
|
df811395f8
|
feat(core): 增强 General 和 Explore Agent 预设
General Agent:
- 添加详细的 prompt 引导子代理行为
- 禁用 todo_read/todo_write(避免与父 Agent 冲突)
- 增加 maxSteps 到 20
Explore Agent:
- 支持 thoroughness 参数 (quick/medium/thorough)
- 启用只读 bash 命令(ls, tree, find, git log 等)
- 禁用写入工具和 Todo 工具
- bash 默认策略改为 deny(比 Plan 更严格)
- 添加详细的探索深度指导 prompt
Plan Agent:
- 添加 web: 'ask' 权限配置
|
2025-12-15 22:01:53 +08:00 |
|
kurihada
|
35d87a04fb
|
feat(core): 增强 Plan Agent 支持细粒度 bash 权限和模式切换
- Plan Agent 细粒度 bash 权限:允许只读命令 (ls, grep, git log 等),
禁止危险操作 (rm, mv, git commit 等)
- 新增 plan_mode_respond 工具:结构化输出计划、进度和探索状态
- Agent.switchMode() 方法:支持 Build ↔ Plan 模式切换保留对话历史
- WebSocket mode_switch 消息:支持运行时动态切换模式
- 更新 Plan Agent prompt 引导使用 plan_mode_respond 工具
|
2025-12-15 20:51:57 +08:00 |
|
kurihada
|
5e32375f0e
|
feat: 重构为 Monorepo 架构并实现 HTTP Server
架构变更:
- 采用 pnpm workspaces 实现 Monorepo 结构
- 将现有代码迁移到 packages/core
- 新增 packages/server HTTP 服务层
Server 功能:
- REST API: 会话管理、工具管理、配置管理
- WebSocket: 实时双向通信支持
- SSE: 服务端事件推送
- Hono + Bun 作为运行时
API 端点:
- GET/POST /api/sessions - 会话 CRUD
- GET/POST /api/sessions/:id/messages - 消息管理
- GET /api/sessions/:id/events - SSE 事件流
- WS /api/ws/:sessionId - WebSocket 连接
- GET/POST /api/tools - 工具管理
- GET/PUT /api/config - 配置管理
|
2025-12-12 10:42:20 +08:00 |
|