irises 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/bin/iris +97 -0
- package/data/agents.example/my-agent/configs/computer_use.yaml +138 -0
- package/data/agents.example/my-agent/configs/llm.yaml +71 -0
- package/data/agents.example/my-agent/configs/mcp.yaml +20 -0
- package/data/agents.example/my-agent/configs/memory.yaml +7 -0
- package/data/agents.example/my-agent/configs/modes.yaml +18 -0
- package/data/agents.example/my-agent/configs/ocr.yaml +9 -0
- package/data/agents.example/my-agent/configs/platform.yaml +49 -0
- package/data/agents.example/my-agent/configs/storage.yaml +10 -0
- package/data/agents.example/my-agent/configs/sub_agents.yaml +53 -0
- package/data/agents.example/my-agent/configs/system.yaml +25 -0
- package/data/agents.example/my-agent/configs/tools.yaml +231 -0
- package/data/agents.yaml.example +28 -0
- package/data/configs.example/computer_use.yaml +196 -0
- package/data/configs.example/llm.yaml +99 -0
- package/data/configs.example/mcp.yaml +20 -0
- package/data/configs.example/memory.yaml +7 -0
- package/data/configs.example/modes.yaml +18 -0
- package/data/configs.example/ocr.yaml +9 -0
- package/data/configs.example/platform.yaml +71 -0
- package/data/configs.example/plugins.yaml +47 -0
- package/data/configs.example/storage.yaml +10 -0
- package/data/configs.example/sub_agents.yaml +53 -0
- package/data/configs.example/summary.yaml +21 -0
- package/data/configs.example/system.yaml +57 -0
- package/data/configs.example/tools.yaml +237 -0
- package/package.json +19 -0
- package/postinstall.mjs +107 -0
package/bin/iris
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Iris npm 启动器
|
|
5
|
+
*
|
|
6
|
+
* 纯 Node.js 脚本,负责查找并执行当前平台对应的预编译 Iris 二进制。
|
|
7
|
+
* 该脚本随 npm 包装器包 (irises) 一起发布,用户通过 npm install -g irises 安装后
|
|
8
|
+
* 即可直接执行 iris 命令。
|
|
9
|
+
*
|
|
10
|
+
* 二进制查找优先级:
|
|
11
|
+
* 1. IRIS_BIN_PATH 环境变量
|
|
12
|
+
* 2. postinstall 缓存的 bin/.iris 硬链接
|
|
13
|
+
* 3. 遍历 node_modules 搜索平台包
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const childProcess = require("child_process")
|
|
17
|
+
const fs = require("fs")
|
|
18
|
+
const path = require("path")
|
|
19
|
+
const os = require("os")
|
|
20
|
+
|
|
21
|
+
function run(target) {
|
|
22
|
+
const result = childProcess.spawnSync(target, process.argv.slice(2), {
|
|
23
|
+
stdio: "inherit",
|
|
24
|
+
})
|
|
25
|
+
if (result.error) {
|
|
26
|
+
console.error(result.error.message)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
|
29
|
+
const code = typeof result.status === "number" ? result.status : 0
|
|
30
|
+
process.exit(code)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 1. 环境变量覆盖
|
|
34
|
+
const envPath = process.env.IRIS_BIN_PATH
|
|
35
|
+
if (envPath) {
|
|
36
|
+
run(envPath)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const scriptPath = fs.realpathSync(__filename)
|
|
40
|
+
const scriptDir = path.dirname(scriptPath)
|
|
41
|
+
|
|
42
|
+
// 2. postinstall 缓存
|
|
43
|
+
const cached = path.join(scriptDir, ".iris")
|
|
44
|
+
if (fs.existsSync(cached)) {
|
|
45
|
+
run(cached)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 3. 平台检测
|
|
49
|
+
const platformMap = {
|
|
50
|
+
darwin: "darwin",
|
|
51
|
+
linux: "linux",
|
|
52
|
+
win32: "windows",
|
|
53
|
+
}
|
|
54
|
+
const archMap = {
|
|
55
|
+
x64: "x64",
|
|
56
|
+
arm64: "arm64",
|
|
57
|
+
arm: "arm",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let platform = platformMap[os.platform()]
|
|
61
|
+
if (!platform) {
|
|
62
|
+
platform = os.platform()
|
|
63
|
+
}
|
|
64
|
+
let arch = archMap[os.arch()]
|
|
65
|
+
if (!arch) {
|
|
66
|
+
arch = os.arch()
|
|
67
|
+
}
|
|
68
|
+
const base = "irises-" + platform + "-" + arch
|
|
69
|
+
const binary = platform === "windows" ? "iris.exe" : "iris"
|
|
70
|
+
|
|
71
|
+
// 4. 搜索 node_modules
|
|
72
|
+
function findBinary(startDir) {
|
|
73
|
+
let current = startDir
|
|
74
|
+
for (;;) {
|
|
75
|
+
const modules = path.join(current, "node_modules")
|
|
76
|
+
if (fs.existsSync(modules)) {
|
|
77
|
+
const candidate = path.join(modules, base, "bin", binary)
|
|
78
|
+
if (fs.existsSync(candidate)) return candidate
|
|
79
|
+
}
|
|
80
|
+
const parent = path.dirname(current)
|
|
81
|
+
if (parent === current) {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
current = parent
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const resolved = findBinary(scriptDir)
|
|
89
|
+
if (!resolved) {
|
|
90
|
+
console.error(
|
|
91
|
+
"未找到当前平台的 Iris 二进制。" +
|
|
92
|
+
" 可尝试手动安装 \"" + base + "\" 包。"
|
|
93
|
+
)
|
|
94
|
+
process.exit(1)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
run(resolved)
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Computer Use 配置
|
|
2
|
+
#
|
|
3
|
+
# 启用后,LLM 可通过一组预定义工具操控浏览器或桌面。
|
|
4
|
+
# 工具包括 get_screenshot、click_at、type_text_at、scroll_document 等,
|
|
5
|
+
# 走普通 function calling 路径,任何支持工具调用的模型均可使用。
|
|
6
|
+
#
|
|
7
|
+
# 依赖:
|
|
8
|
+
# browser 环境需要安装 Playwright
|
|
9
|
+
# npm install playwright
|
|
10
|
+
# laywright install chromium
|
|
11
|
+
# screen 环境无额外依赖(Windows 通过 PowerShell 调用系统 API)
|
|
12
|
+
|
|
13
|
+
# 是否启用(默认关闭)
|
|
14
|
+
enabled: false
|
|
15
|
+
|
|
16
|
+
# 执行环境
|
|
17
|
+
# browser — Playwright 控制 Chromium 浏览器(操作范围限定在浏览器窗口内)
|
|
18
|
+
# screen — 系统级截屏 + 输入模拟(默认全屏,可通过 targetWindow 限定到单个窗口)
|
|
19
|
+
environment: browser
|
|
20
|
+
|
|
21
|
+
# ─── 工具策略 ───
|
|
22
|
+
#
|
|
23
|
+
# 按环境配置要启用或排除的工具。
|
|
24
|
+
# 三个环境层级,运行时自动选择匹配的一个:
|
|
25
|
+
# browser — Playwright 浏览器环境
|
|
26
|
+
# screen — 桌面全屏 / 窗口前台模式
|
|
27
|
+
# background — 桌面窗口后台模式(screen + backgroundMode: true)
|
|
28
|
+
#
|
|
29
|
+
# 每个环境支持两种策略(互斥,include 优先):
|
|
30
|
+
# include: [工具名] — 白名单,仅启用列出的工具
|
|
31
|
+
# exclude: [工具名] — 黑名单,排除列出的工具,其余全部启用
|
|
32
|
+
#
|
|
33
|
+
# 不配置 environmentTools 时使用内置默认策略:
|
|
34
|
+
# browser: 全部启用
|
|
35
|
+
# screen: 排除 go_back, go_forward, search
|
|
36
|
+
# background: 排除 go_back, go_forward, search, drag_and_drop
|
|
37
|
+
#
|
|
38
|
+
# 配置后覆盖对应环境的默认策略。未配置的环境仍使用默认值。
|
|
39
|
+
#
|
|
40
|
+
# 全部 13 个工具:
|
|
41
|
+
# get_screenshot, click_at, hover_at, type_text_at,
|
|
42
|
+
# scroll_document, scroll_at, key_combination, navigate,
|
|
43
|
+
# go_back, go_forward, search, wait_5_seconds, drag_and_drop
|
|
44
|
+
#
|
|
45
|
+
# ── 示例 ──
|
|
46
|
+
#
|
|
47
|
+
# environmentTools:
|
|
48
|
+
# # 浏览器环境:排除拖拽
|
|
49
|
+
# browser:
|
|
50
|
+
# exclude:
|
|
51
|
+
# - drag_and_drop
|
|
52
|
+
#
|
|
53
|
+
# # 桌面环境:使用内置默认排除策略(不配置即可)
|
|
54
|
+
#
|
|
55
|
+
# # 后台模式:白名单,只允许基础操作
|
|
56
|
+
# background:
|
|
57
|
+
# include:
|
|
58
|
+
# - get_screenshot
|
|
59
|
+
# - click_at
|
|
60
|
+
# - type_text_at
|
|
61
|
+
# - scroll_document
|
|
62
|
+
# - key_combination
|
|
63
|
+
# - wait_5_seconds
|
|
64
|
+
|
|
65
|
+
# ─── browser 环境专用 ───
|
|
66
|
+
|
|
67
|
+
# 启动时打开的初始页面
|
|
68
|
+
# initialUrl: https://www.google.com
|
|
69
|
+
|
|
70
|
+
# 搜索引擎首页(search 工具导航的目标)
|
|
71
|
+
# searchEngineUrl: https://www.google.com
|
|
72
|
+
|
|
73
|
+
# 浏览器视口尺寸(像素),仅 browser 环境生效
|
|
74
|
+
# screen 环境下屏幕/窗口尺寸自动检测,无需手动配置
|
|
75
|
+
# Gemini 推荐 1440×900 以获得最佳效果
|
|
76
|
+
screenWidth: 1440
|
|
77
|
+
screenHeight: 900
|
|
78
|
+
|
|
79
|
+
# 是否无头模式(不显示浏览器窗口)
|
|
80
|
+
# 调试时建议关闭,以便观察操作过程
|
|
81
|
+
headless: false
|
|
82
|
+
|
|
83
|
+
# 是否在操作位置显示红色圆圈标记(调试用)
|
|
84
|
+
# highlightMouse: true
|
|
85
|
+
|
|
86
|
+
# ─── screen 环境专用 ───
|
|
87
|
+
#
|
|
88
|
+
# 默认为全屏模式(截取整个桌面,操作范围不受限制)。
|
|
89
|
+
# 如需限定在某个应用窗口内,设置 targetWindow 即可。
|
|
90
|
+
#
|
|
91
|
+
# 目标窗口标题(子串匹配)。设置后:
|
|
92
|
+
# - 截屏只截取该窗口区域
|
|
93
|
+
# - 鼠标坐标自动偏移到窗口位置
|
|
94
|
+
# - 操作前自动将窗口置于前台(后台模式除外)
|
|
95
|
+
# - screenSize 返回窗口尺寸(LLM 的坐标归一化基于窗口尺寸)
|
|
96
|
+
# 不设置则为全屏模式。
|
|
97
|
+
#
|
|
98
|
+
# 示例:
|
|
99
|
+
# targetWindow: "记事本" # 匹配标题包含"记事本"的窗口
|
|
100
|
+
# targetWindow: "Chrome" # 匹配标题包含 Chrome 的窗口
|
|
101
|
+
# targetWindow: "Visual Studio Code"
|
|
102
|
+
# targetWindow:
|
|
103
|
+
#
|
|
104
|
+
# 注意:全屏模式下 AI 的操作范围不受限制,请谨慎使用。
|
|
105
|
+
# 建议将 key_combination 等高风险工具设为 autoApprove: false(在 tools.yaml 中配置)。
|
|
106
|
+
|
|
107
|
+
# 后台操作模式(仅窗口模式下有效,需先设置 targetWindow)。
|
|
108
|
+
# 启用后不需要目标窗口在前台,AI 可以在后台操作窗口。
|
|
109
|
+
# 窗口只需处于显示状态(不最小化),可以被其他窗口遮挡。
|
|
110
|
+
# 如果窗口被最小化,会自动恢复但不激活(不抢焦点)。
|
|
111
|
+
#
|
|
112
|
+
# 实现方式:
|
|
113
|
+
# 截图 → PrintWindow(请求窗口自绘,支持 GPU 加速窗口)
|
|
114
|
+
# 鼠标 → PostMessage(WM_LBUTTONDOWN/UP)
|
|
115
|
+
# 键盘 → PostMessage(WM_KEYDOWN/UP) / WM_CHAR
|
|
116
|
+
#
|
|
117
|
+
# 截图兼容性(PrintWindow):
|
|
118
|
+
# ✓ 原生 Win32 / WPF / WinForms 应用
|
|
119
|
+
# ✓ GPU 加速窗口(Chrome、Electron、游戏等)— 只要窗口处于显示状态
|
|
120
|
+
#
|
|
121
|
+
# 操作兼容性(PostMessage):
|
|
122
|
+
# ✓ 原生 Win32 / WPF / WinForms — 点击、键盘、滚动均正常
|
|
123
|
+
# △ 部分应用可能不响应 PostMessage 的鼠标/键盘消息
|
|
124
|
+
# △ 拖拽操作通过消息模拟,部分应用可能不支持
|
|
125
|
+
#
|
|
126
|
+
# 默认 false(前台模式)。
|
|
127
|
+
# backgroundMode: true
|
|
128
|
+
|
|
129
|
+
# ─── 截图保留策略 ───
|
|
130
|
+
#
|
|
131
|
+
# 发送给 LLM 时,只保留最近 N 轮 Computer Use 工具交互中的截图。
|
|
132
|
+
# 超出的旧轮次截图会被自动剥离,以节省 token。
|
|
133
|
+
# 存储中的完整截图不受影响。
|
|
134
|
+
#
|
|
135
|
+
# 默认 3,与 Gemini 官方示例一致。
|
|
136
|
+
# 设为 0 表示不保留任何截图(仅保留 URL 等文本信息)。
|
|
137
|
+
# 不设置或注释掉则使用默认值 3。
|
|
138
|
+
maxRecentScreenshots: 3
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# LLM 配置(模型池)
|
|
2
|
+
# defaultModel: 启动时默认使用的模型名称
|
|
3
|
+
# models: 可用模型列表,键名就是模型名称
|
|
4
|
+
|
|
5
|
+
# defaultModel 必须指向 models 中的某个模型名称
|
|
6
|
+
# 运行中的 Console TUI 可以通过 /model 指令切换当前使用的模型
|
|
7
|
+
|
|
8
|
+
defaultModel: gemini_flash
|
|
9
|
+
|
|
10
|
+
models:
|
|
11
|
+
gemini_flash:
|
|
12
|
+
# 提供商: gemini | openai-compatible | openai-responses | claude
|
|
13
|
+
provider: gemini
|
|
14
|
+
apiKey: your-api-key-here
|
|
15
|
+
# model 字段填写提供商真实模型 id
|
|
16
|
+
model: gemini-2.0-flash
|
|
17
|
+
# Gemini 要以 /v1beta 结尾;OpenAI 兼容 / OpenAI Responses / Claude 要以 /v1 结尾
|
|
18
|
+
# 在此基础上,程序再补全具体接口后缀
|
|
19
|
+
baseUrl: https://generativelanguage.googleapis.com/v1beta
|
|
20
|
+
# 是否支持图片输入;不填时程序会按模型名自动判断。
|
|
21
|
+
# 如果你使用代理网关、自定义模型别名,建议显式填写。
|
|
22
|
+
supportsVision: true
|
|
23
|
+
|
|
24
|
+
# 模型上下文窗口大小(token 数,用于 TUI 显示占用比例)
|
|
25
|
+
# 常见模型已有内置默认值,通常无需手动设置
|
|
26
|
+
# contextWindow: 1048576
|
|
27
|
+
|
|
28
|
+
# 自定义请求头:会覆盖 provider 内置同名 header
|
|
29
|
+
# headers:
|
|
30
|
+
# x-goog-api-key: your-override-key
|
|
31
|
+
# x-custom-header: hello
|
|
32
|
+
|
|
33
|
+
# 自定义请求体:会深合并到 provider 编码后的最终请求体,支持嵌套参数
|
|
34
|
+
# 例如 Gemini thinking / 输出长度 / 温度等都可以直接这样配置
|
|
35
|
+
# requestBody:
|
|
36
|
+
# generationConfig:
|
|
37
|
+
# maxOutputTokens: 32000
|
|
38
|
+
# temperature: 1
|
|
39
|
+
# topP: 1
|
|
40
|
+
# thinkingConfig:
|
|
41
|
+
# thinkingBudget: 1228
|
|
42
|
+
# includeThoughts: true
|
|
43
|
+
|
|
44
|
+
# gpt4o_mini:
|
|
45
|
+
# provider: openai-compatible
|
|
46
|
+
# apiKey: your-api-key-here
|
|
47
|
+
# model: gpt-4o-mini
|
|
48
|
+
# baseUrl: https://api.openai.com/v1
|
|
49
|
+
# supportsVision: false
|
|
50
|
+
|
|
51
|
+
# gpt4o:
|
|
52
|
+
# provider: openai-responses
|
|
53
|
+
# apiKey: your-api-key-here
|
|
54
|
+
# model: gpt-4o
|
|
55
|
+
# baseUrl: https://api.openai.com/v1
|
|
56
|
+
# supportsVision: true
|
|
57
|
+
|
|
58
|
+
# Claude 示例:
|
|
59
|
+
# models:
|
|
60
|
+
# claude_sonnet:
|
|
61
|
+
# provider: claude
|
|
62
|
+
# apiKey: your-api-key-here
|
|
63
|
+
# model: claude-sonnet-4-6
|
|
64
|
+
# baseUrl: https://api.anthropic.com/v1
|
|
65
|
+
# Gemini 示例:
|
|
66
|
+
# models:
|
|
67
|
+
# gemini_flash:
|
|
68
|
+
# provider: gemini
|
|
69
|
+
# apiKey: your-api-key-here
|
|
70
|
+
# model: gemini-2.0-flash
|
|
71
|
+
# baseUrl: https://generativelanguage.googleapis.com/v1beta
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MCP 服务器配置
|
|
2
|
+
# 连接外部 MCP 服务器,自动将其工具注入 LLM 工具列表
|
|
3
|
+
|
|
4
|
+
# servers:
|
|
5
|
+
# # stdio 传输示例(本地进程)
|
|
6
|
+
# filesystem:
|
|
7
|
+
# transport: stdio
|
|
8
|
+
# command: npx
|
|
9
|
+
# args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
|
|
10
|
+
#
|
|
11
|
+
# # HTTP 传输示例(远程服务器)
|
|
12
|
+
# remote_tools:
|
|
13
|
+
# transport: streamable-http
|
|
14
|
+
# url: https://mcp.example.com/sse
|
|
15
|
+
#
|
|
16
|
+
# # 企微官方文档 MCP(智能表格 + 文档 CRUD,8 个工具)
|
|
17
|
+
# # 在企微管理后台创建智能机器人后,MCP 端点页面可获取 apikey
|
|
18
|
+
# wecom-doc:
|
|
19
|
+
# transport: streamable-http
|
|
20
|
+
# url: "https://qyapi.weixin.qq.com/mcp/robot-doc?apikey=your-mcp-apikey"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 模式配置
|
|
2
|
+
# 不同模式可定义不同的系统提示词和工具策略
|
|
3
|
+
|
|
4
|
+
# code:
|
|
5
|
+
# description: "代码开发模式"
|
|
6
|
+
# systemPrompt: "你是一个专注于代码开发的 AI 助手。"
|
|
7
|
+
# tools:
|
|
8
|
+
# exclude: [memory_add, memory_delete]
|
|
9
|
+
#
|
|
10
|
+
# readonly:
|
|
11
|
+
# description: "只读分析模式"
|
|
12
|
+
# tools:
|
|
13
|
+
# include: [read_file, memory_search, get_current_time]
|
|
14
|
+
#
|
|
15
|
+
# chat:
|
|
16
|
+
# description: "纯聊天模式"
|
|
17
|
+
# tools:
|
|
18
|
+
# include: [get_current_time]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 平台配置
|
|
2
|
+
|
|
3
|
+
# 类型: console | discord | telegram | web | wxwork | lark
|
|
4
|
+
# 支持单平台或多平台同时启动:
|
|
5
|
+
# type: console # 单平台
|
|
6
|
+
# type: [console, web] # 多平台同时启动
|
|
7
|
+
type: console
|
|
8
|
+
|
|
9
|
+
discord:
|
|
10
|
+
token: your-discord-bot-token
|
|
11
|
+
|
|
12
|
+
telegram:
|
|
13
|
+
token: your-telegram-bot-token
|
|
14
|
+
# 是否在流式回复中展示工具执行状态(默认 true)
|
|
15
|
+
# showToolStatus: false
|
|
16
|
+
# 群聊中是否要求 @机器人 后才响应(默认 true)
|
|
17
|
+
# groupMentionRequired: true
|
|
18
|
+
|
|
19
|
+
web:
|
|
20
|
+
port: 8192
|
|
21
|
+
# 127.0.0.1 = 仅本机访问(配合 Nginx 反代使用,推荐)
|
|
22
|
+
# 0.0.0.0 = 允许所有网络接口访问(本地开发/无反代时使用)
|
|
23
|
+
host: 127.0.0.1
|
|
24
|
+
# API 全局认证令牌(可选,未配置时不启用)
|
|
25
|
+
# authToken: your-secret-token-here
|
|
26
|
+
# 管理接口认证令牌(推荐)
|
|
27
|
+
# managementToken: your-management-token-here
|
|
28
|
+
|
|
29
|
+
wxwork:
|
|
30
|
+
# 企业微信智能机器人 Bot ID 和 Secret
|
|
31
|
+
# 在企业微信管理后台 → 应用管理 → 智能机器人 中创建并获取
|
|
32
|
+
# 文档: https://developer.work.weixin.qq.com/document/path/101463
|
|
33
|
+
botId: your-bot-id
|
|
34
|
+
secret: your-bot-secret
|
|
35
|
+
# 是否在流式回复中展示工具执行状态(默认 true)
|
|
36
|
+
# showToolStatus: false
|
|
37
|
+
|
|
38
|
+
lark:
|
|
39
|
+
# 飞书自建应用 App ID 和 App Secret
|
|
40
|
+
# 在飞书开放平台创建自建应用,开启「机器人」能力后获取
|
|
41
|
+
# 文档: https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes
|
|
42
|
+
appId: your-app-id
|
|
43
|
+
appSecret: your-app-secret
|
|
44
|
+
# 是否在流式回复中展示工具执行状态(默认 true)
|
|
45
|
+
# showToolStatus: false
|
|
46
|
+
# 可选:Webhook 模式用的验证 token(WebSocket 模式不需要)
|
|
47
|
+
# verificationToken: your-verification-token
|
|
48
|
+
# 可选:Webhook 模式用的加密 key(WebSocket 模式不需要)
|
|
49
|
+
# encryptKey: your-encrypt-key
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# 子代理配置
|
|
2
|
+
# 定义主 LLM 可委派的子代理类型。
|
|
3
|
+
# 删除或注释掉某个类型即可禁用它,清空所有类型则完全禁用子代理功能。
|
|
4
|
+
|
|
5
|
+
# 字段说明:
|
|
6
|
+
# description - 面向主 LLM 的用途说明(展示在 sub_agent 工具描述中)
|
|
7
|
+
# systemPrompt - 子代理的系统提示词
|
|
8
|
+
# allowedTools - 工具白名单(与 excludedTools 互斥,优先)
|
|
9
|
+
# excludedTools - 工具黑名单
|
|
10
|
+
# modelName - 固定使用的模型名称;不写时跟随当前活动模型
|
|
11
|
+
# parallel - 当前类型的 sub_agent 调用是否按 parallel 工具参与调度(默认 false)
|
|
12
|
+
# 不写就是 false,只有显式写 true 才会参与并行调度
|
|
13
|
+
# maxToolRounds - 最大工具执行轮次
|
|
14
|
+
|
|
15
|
+
types:
|
|
16
|
+
general-purpose:
|
|
17
|
+
description: "执行需要多步工具操作的复杂子任务。适合承接相对独立的子任务。"
|
|
18
|
+
systemPrompt: "你是一个通用子代理,负责独立完成委派给你的子任务。请专注于完成任务并返回清晰的结果。"
|
|
19
|
+
excludedTools:
|
|
20
|
+
- sub_agent
|
|
21
|
+
parallel: false
|
|
22
|
+
# modelName: gemini_flash
|
|
23
|
+
maxToolRounds: 200
|
|
24
|
+
|
|
25
|
+
explore:
|
|
26
|
+
description: "只读搜索和阅读文件、执行查询命令。不做修改,只返回发现的信息。"
|
|
27
|
+
systemPrompt: "你是一个只读探索代理,负责搜索和阅读信息。不要修改任何文件,只返回你发现的内容。"
|
|
28
|
+
allowedTools:
|
|
29
|
+
- read_file
|
|
30
|
+
- search_in_files
|
|
31
|
+
- find_files
|
|
32
|
+
- list_files
|
|
33
|
+
- shell
|
|
34
|
+
parallel: true
|
|
35
|
+
# modelName: gpt4o_mini
|
|
36
|
+
maxToolRounds: 200
|
|
37
|
+
|
|
38
|
+
recall:
|
|
39
|
+
description: "从长期记忆中检索相关信息。当需要回忆用户偏好、历史事实或之前保存的内容时使用。"
|
|
40
|
+
systemPrompt: |
|
|
41
|
+
你是一个记忆召回代理。根据给定的查询,从长期记忆中尽可能全面地检索相关信息。
|
|
42
|
+
|
|
43
|
+
策略:
|
|
44
|
+
1. 先用原始查询搜索
|
|
45
|
+
2. 如果结果不够,提取关键词重新搜索
|
|
46
|
+
3. 尝试相关概念或同义词搜索
|
|
47
|
+
|
|
48
|
+
将所有找到的记忆整理为清晰的摘要返回。如果没有找到任何相关记忆,明确说明。
|
|
49
|
+
allowedTools:
|
|
50
|
+
- memory_search
|
|
51
|
+
parallel: false
|
|
52
|
+
# modelName: recall_model
|
|
53
|
+
maxToolRounds: 3
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 系统配置(Agent: my-agent)
|
|
2
|
+
#
|
|
3
|
+
# 每个 agent 拥有独立的系统配置。
|
|
4
|
+
# 你可以为不同 agent 设置不同的提示词、工具轮次等。
|
|
5
|
+
|
|
6
|
+
# 系统提示词(留空则使用默认)
|
|
7
|
+
systemPrompt: ""
|
|
8
|
+
|
|
9
|
+
# 工具执行最大轮次
|
|
10
|
+
maxToolRounds: 200
|
|
11
|
+
|
|
12
|
+
# 流式输出
|
|
13
|
+
stream: true
|
|
14
|
+
|
|
15
|
+
# LLM 调用报错自动重试(默认开启)
|
|
16
|
+
retryOnError: true
|
|
17
|
+
|
|
18
|
+
# 最大重试次数(默认 3)
|
|
19
|
+
maxRetries: 3
|
|
20
|
+
|
|
21
|
+
# 子代理最大嵌套深度(默认 3)
|
|
22
|
+
# maxAgentDepth: 3
|
|
23
|
+
|
|
24
|
+
# 默认模式(需与 modes.yaml 中定义的名称对应)
|
|
25
|
+
# defaultMode: code
|