其他工具
本页涵盖未在其他章节详述的工具。
AskUserQuestionTool — 向用户提问
当 AI 需要用户确认或额外信息时使用:
typescript
const inputSchema = z.strictObject({
questions: z.array(z.object({
question: z.string(),
header: z.string(), // 短标签(chip/tag)
options: z.array(z.object({
label: z.string(),
description: z.string(),
preview: z.string().optional(),
})).min(2).max(4),
multiSelect: z.boolean().default(false),
})).min(1).max(4),
answers: z.record(z.string(), z.string()).optional(),
annotations: z.record(z.string(), z.object({
preview: z.string().optional(),
notes: z.string().optional(),
})).optional(),
metadata: z.object({
source: z.string().optional(),
}).optional(),
})
// 无权限要求,最安全的工具
// isReadOnly() = true, isDestructive() = falseTodoWriteTool — 待办事项管理
typescript
const TodoItemSchema = z.object({
content: z.string().min(1),
status: z.enum(['pending', 'in_progress', 'completed']),
activeForm: z.string().min(1),
})
const inputSchema = z.strictObject({
todos: z.array(TodoItemSchema).describe('更新后的待办列表'),
})
// 直接修改 AppState 中的 todos 列表
// StatusLine 显示待办进度NotebookEditTool — Jupyter Notebook 编辑
typescript
const inputSchema = z.strictObject({
notebook_path: z.string(),
cell_id: z.string().optional(), // 要编辑的 cell ID
new_source: z.string(), // 新的 cell 内容
cell_type: z.enum(['code', 'markdown']).optional(),
edit_mode: z.enum(['replace', 'insert', 'delete']).optional(),
})
// Feature-gated: feature('NOTEBOOK') 等相关 flag
// 直接操作 .ipynb JSON 结构SleepTool — 延迟执行
typescript
const inputSchema = z.object({
duration_ms: z.number().describe('延迟毫秒数'),
reason: z.string().optional(),
})
// Feature-gated: feature('PROACTIVE') || feature('KAIROS')
// 用于等待外部进程完成LSPTool — 语言服务器操作
typescript
const inputSchema = z.strictObject({
operation: z.enum([
'goToDefinition', // 跳转到定义
'findReferences', // 查找引用
'hover', // 悬停信息
'documentSymbol', // 文档符号
'workspaceSymbol', // 工作区符号
'goToImplementation', // 跳转到实现
'prepareCallHierarchy', // 调用层次
'incomingCalls', // 传入调用
'outgoingCalls', // 传出调用
]),
filePath: z.string(),
line: z.number().int().positive(), // 1-based
character: z.number().int().positive(), // 1-based
})SyntheticOutputTool — 合成输出
用于内部 UI 渲染,不直接暴露给 AI:
typescript
// 生成不经过 AI 的工具结果
// 用于 Hook 摘要、系统消息等BriefTool — 简要模式
KAIROS feature-gated 的简要模式工具。
ConfigTool — 配置操作
typescript
const inputSchema = z.strictObject({
setting: z.string().describe('配置项 key,如 "theme", "model"'),
value: z.union([z.string(), z.boolean(), z.number()]).optional()
.describe('新值。省略则获取当前值'),
})RemoteTriggerTool — 远程触发
在 Bridge 模式下触发远程操作:
typescript
const inputSchema = z.strictObject({
action: z.enum(['list', 'get', 'create', 'update', 'run']),
trigger_id: z.string().regex(/^[\w-]+$/).optional()
.describe('get/update/run 时必填'),
body: z.record(z.string(), z.unknown()).optional()
.describe('create/update 时的 JSON body'),
})Worktree 工具
| 工具 | 用途 |
|---|---|
| EnterWorktreeTool | 创建或切换到 Git worktree,隔离文件系统 |
| ExitWorktreeTool | 退出 worktree,合并或放弃更改 |
| EnterPlanModeTool | 进入计划模式(只规划不执行) |
| ExitPlanModeTool | 退出计划模式 |
Team 工具
| 工具 | 用途 |
|---|---|
| TeamCreateTool | 创建新团队 |
| TeamDeleteTool | 删除团队 |
| SendMessageTool | 发送消息给队友 Agent |
| ScheduleCronTool | 创建定时任务 |