-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.json
More file actions
109 lines (99 loc) · 5.77 KB
/
Copy pathconfig.example.json
File metadata and controls
109 lines (99 loc) · 5.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"$comment": "把本文件复制到 ~/.omp/dingtalk.json(或 <项目>/.omp/dingtalk.json)后按需修改。所有字段都有默认值,只需填你要用的部分。",
"enabled": true,
"webhook": {
"$comment": "群通知通道(outbound.mode 为 webhook / both 时使用)。钉钉群 → 群设置 → 智能群助手 → 添加机器人 → 自定义机器人。三种安全设置选一种即可。",
"url": "",
"$comment_url": "填完整的 Webhook 地址,形如 https://oapi.dingtalk.com/robot/send?access_token=你的access_token。留空 = 未配置(doctor 会提示缺什么)。",
"secret": "",
"$comment_secret": "选了「加签」就把 SEC 开头的密钥填这里;选「自定义关键词」则留空 secret,填下面的 keyword。",
"keyword": "",
"$comment_keyword": "例如填「omp」,插件会自动把关键词加进每条消息,避免被钉钉拦截。"
},
"stream": {
"$comment": "入站控制通道。需要在钉钉开放平台创建「企业内部应用」,添加「机器人」能力并选择 Stream 模式后发布,然后把这个机器人加进群。",
"enabled": true,
"clientId": "",
"clientSecret": "",
"robotCode": "",
"$comment_robotCode": "机器人详情页的 robotCode(ding 开头)。出站选 direct / both 时必填,单聊推送要用。"
},
"outbound": {
"$comment": "通知走哪条路。webhook = 群里那个自定义机器人(只能发群,没法私聊);direct = 企业内部应用机器人 1:1 私聊推送;both = 两边都发。",
"mode": "webhook",
"$comment_mode": "想「只收单聊、不打扰群」就改成 direct。",
"$comment_recipient": "单聊推送对象就是 control.allowUserId(白名单里那一个人),没有单独的收件人配置。"
},
"notify": {
"sessionStop": true,
"$comment_sessionStop": "本轮跑完、omp 空闲时通知你,这是最主要的「任务完成」提醒。",
"sessionShutdown": true,
"errors": true,
"approval": true,
"goalUpdated": false,
"turnEnd": {
"enabled": false,
"$comment": "每轮都通知会很吵,默认关闭。开了之后只通知耗时超过 minDurationMs 的轮次。",
"minDurationMs": 60000
},
"toolUse": {
"enabled": false,
"$comment": "工具执行失败时通知。",
"tools": ["bash", "write", "edit"]
},
"atMobiles": [],
"atUserIds": [],
"atAll": false,
"maxTextChars": 1800,
"onlyWhenTakenOver": false,
"$comment_onlyWhenTakenOver": "true = 接管前完全静默:没执行 /dingtalk takeover 之前一条通知都不发(含错误告警和退出通知),接管后才开始发,release 后又停。注意它要求能接管(stream 凭据齐全),否则会永远收不到通知。"
},
"approval": {
"$comment": "远程审批闸门。off = 只通知不拦截;remote = 命中规则的敏感操作会挂起,等你在钉钉里回「同意/拒绝」。",
"mode": "off",
"timeoutMs": 300000,
"onTimeout": "deny",
"$comment_rules": "留空数组则使用内置的危险操作规则(rm -rf / sudo / git push / 敏感文件写入等)。",
"rules": []
},
"question": {
"$comment": "把 omp 的「提问(ask)工具」转发到钉钉:会话里模型问你问题时,不再弹本地对话框,而是推送到钉钉等你在手机上回。仅在接管期间生效(本人在电脑前时照常弹本地框)。",
"enabled": true,
"timeoutMs": 600000,
"$comment_timeoutMs": "多久没回复就告知 omp 自行决定(毫秒,默认 600000 = 10 分钟)。"
},
"control": {
"enabled": true,
"scope": "direct",
"$comment_scope": "direct = 只认单聊,群里 @ 机器人也一律不理(推荐)。group = 只认群聊。all = 两者都认。",
"autoTakeover": false,
"$comment_autoTakeover": "false(推荐)= 会话启动不自动接通入站通道,要手动 /dingtalk takeover;已接管的会话不会因新会话启动而松开。true = 会话一启动就自动接管。",
"requireAt": true,
"$comment_requireAt": "群聊里只有 @ 机器人时才响应,避免群里闲聊误触发。scope 为 direct 时无影响。",
"allowUserId": "",
"$comment_allowUserId": "必填,只填一个人。在单聊里给机器人发 /id 就能拿到自己的 senderStaffId。这个人既能下指令,也是单聊推送的唯一收件人。留空 = 拒绝所有指令(除 /id 本身),这是故意的安全默认。",
"freeText": true,
"freeTextDelivery": "steer",
"$comment_freeTextDelivery": "steer = 打断当前轮次立刻执行;followUp = 等当前轮次跑完再执行。",
"replyToSession": true
},
"robots": {
"$comment": "多机器人模式(可选)。顶层字段就是默认机器人(default),上面的 webhook / stream / control 都属于它。想要多个机器人,就在这里按名字各配一份:它们继承全局设置(notify / approval / question / quiet),只覆盖自己的 webhook / stream / outbound / control。在 omp 里用 /dingtalk takeover <名字> 绑定哪个机器人接管本会话;不同 omp 会话可以分别接管不同的机器人,互不抢占。",
"home": {
"$comment": "例子:第二个机器人,名字叫 home。它有自己的群 Webhook 和 Stream 凭据,control.allowUserId 也可以和 default 不同(不同机器人可以让不同人控制)。",
"webhook": {
"url": "https://oapi.dingtalk.com/robot/send?access_token=另一个access_token",
"secret": ""
},
"stream": {
"enabled": true,
"clientId": "",
"clientSecret": "",
"robotCode": ""
},
"outbound": { "mode": "webhook" },
"control": { "allowUserId": "" }
}
},
"quiet": false
}