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
|
cd0c2bdbfb
|
feat(core): 重构 Plan 模式工具,新增 allowedWritePaths 路径限制
Plan 工具重构:
- 移除 plan_mode_respond 工具
- 新增 ask_user_question 工具:向用户提问并获取回复
- 新增 enter_plan_mode 工具:进入计划模式
- 新增 exit_plan_mode 工具:退出计划模式
allowedWritePaths 功能:
- AgentFilePermission 新增 allowedWritePaths 字段
- permission-merger 添加 isPathInAllowedWritePaths 检查函数
- executor 在写入操作时检查路径限制
|
2025-12-16 13:49:45 +08:00 |
|
kurihada
|
9376887995
|
refactor(core): 统一配置系统,移除 config.json
- 移除 config.json,所有配置统一从 agents.json 和 providers.json 读取
- config-loader.ts 从全局目录 ~/.ai-terminal-assistant/ 加载配置
- loadConfig() 从 agentRegistry.getGlobalConfig() 获取 defaults.model
- 添加 loadVisionConfig() 支持 Vision 模型配置
- Tavily API Key 仅从环境变量读取
- UI AgentDefaultsEditor 添加 Vision 模型配置界面
- 更新相关测试
|
2025-12-16 00:33:29 +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
|
527692ec03
|
refactor(storage): 采用 OpenCode 风格三层存储结构
重构消息存储系统,从"每条消息一个文件"改为分层存储:
- Session → Message → Parts 三层结构
- 12 种 Part 类型(TextPart, ToolPart, ReasoningPart 等)
- ToolPart 状态机(pending → running → completed/error)
- 通用 Storage API(read/write/list/remove)
新增文件:
- parts.ts: Part 类型定义(Zod schema)
- message.ts: MessageInfo 类型定义
- id.ts: ID 生成器
- storage/: 分层存储实现
删除旧文件:
- storage.ts, types.ts, migration.ts
存储路径:
~/.local/share/ai-assist/
├── session/{projectId}/{sessionId}.json
├── message/{sessionId}/{messageId}.json
├── part/{messageId}/{partId}.json
└── todo/{sessionId}.json
|
2025-12-15 11:16:10 +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 |
|