openclaw-glance-plugin 0.1.29 → 0.1.31
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/package.json +1 -1
- package/skills/glance-watch/SKILL.md +7 -16
- package/skills/glance-watch/references/examples.md +0 -9
- package/skills/glance-watch/references/quote-realtime.md +2 -34
- package/skills/glance-watch/references/symbol-search-and-calendar.md +0 -3
- package/skills/glance-watch/references/troubleshooting.md +1 -1
- package/skills/glance-watch/references/watch-contract.md +44 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: glance-watch
|
|
3
|
-
description: 用于监控A股、港股、比特币等金融市场行情并在条件触发时发送提醒。当用户要求盯盘、监控价格、设置提醒、需要通过邮件/电话/短信/钉钉发起通知、查询A
|
|
3
|
+
description: 用于监控A股、港股、比特币等金融市场行情并在条件触发时发送提醒。当用户要求盯盘、监控价格、设置提醒、需要通过邮件/电话/短信/钉钉发起通知、查询A股港股指数加密标的和行情、交易日历、新闻快讯时使用,例如"帮我盯着比特币"、监控某只股票、涨跌幅提醒、短信通知我、这个月交易日有哪些、有哪些新闻等。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Glance Watch 智能盯盘(主入口)
|
|
@@ -10,16 +10,14 @@ description: 用于监控A股、港股、比特币等金融市场行情并在条
|
|
|
10
10
|
P0(最高)策略能力:
|
|
11
11
|
- 面向 **A股个股、港股个股、A股/港股指数、比特币** 创建/查询/暂停/恢复/删除盯盘策略。
|
|
12
12
|
- 仅用:`watch_create` / `watch_list` / `watch_pause` / `watch_activate` / `watch_remove`。
|
|
13
|
-
- **禁止**:对基金创建盯盘策略(包括场外基金 `xxxxxx.OF`)。
|
|
14
13
|
|
|
15
14
|
P1 行情能力(为策略创建提供上下文):
|
|
16
15
|
- 个股/指数/比特币实时行情:`watch_query_ticker`
|
|
17
|
-
- 基金当日估值:`watch_query_fund_estimates`
|
|
18
16
|
|
|
19
17
|
P2 标的解析能力(创建策略前补齐参数):
|
|
20
18
|
- 先查本地 CSV(`skills/glance-watch/data/*.csv`)做名称/代码映射。
|
|
21
19
|
- 本地不确定再用网关基础信息检索:
|
|
22
|
-
`watch_search_a_stock_basic` / `watch_search_hk_stock_basic` / `watch_search_index_basic`
|
|
20
|
+
`watch_search_a_stock_basic` / `watch_search_hk_stock_basic` / `watch_search_index_basic`
|
|
23
21
|
|
|
24
22
|
P3 辅助能力:
|
|
25
23
|
- 交易日历:`watch_trade_calendar`
|
|
@@ -31,11 +29,9 @@ P3 辅助能力:
|
|
|
31
29
|
- 工具名统一使用下划线形式(如 `watch_query_ticker`),不要写成点号形式(如 `watch.query_ticker`)。
|
|
32
30
|
|
|
33
31
|
- `watch_query_ticker`
|
|
34
|
-
- `watch_query_fund_estimates`
|
|
35
32
|
- `watch_search_a_stock_basic`
|
|
36
33
|
- `watch_search_hk_stock_basic`
|
|
37
34
|
- `watch_search_index_basic`
|
|
38
|
-
- `watch_search_fund_basic`
|
|
39
35
|
- `watch_fin_news`
|
|
40
36
|
- `watch_trade_calendar`
|
|
41
37
|
- `watch_create`
|
|
@@ -56,9 +52,6 @@ P3 辅助能力:
|
|
|
56
52
|
|----------|------------|--------|
|
|
57
53
|
| 现价/涨跌/几块钱(**已有代码**) | `watch_query_ticker` | `market`+`symbol`;`market` 可用 **A股/港股/加密** 等中文别名 |
|
|
58
54
|
| 现价但**只有公司或指数名** | 查询`skills/glance-watch/data/*.csv`或 `watch_search_*_basic` | 从 `data[]` 取 `ts_code` 再 `watch_query_ticker` |
|
|
59
|
-
| 基金**今天估值** | `watch_query_fund_estimates` | `fund_codes`;勿用 `watch_query_ticker` |
|
|
60
|
-
| 基金**档案/是不是这只基** | `watch_search_fund_basic` | `ts_code` 或 `keyword` |
|
|
61
|
-
| 要创建基金盯盘策略 | 不调用 `watch_create` | 明确告知“当前仅支持A股港股的股票/指数或比特币盯盘;基金仅支持估值查询” |
|
|
62
55
|
| **新闻/快讯** | `watch_fin_news` | 必须有关键词 `keyword` 或 `q` |
|
|
63
56
|
| **开不开盘/休市/交易日** | `watch_trade_calendar` | `exchange`(如 SSE/SZSE)+ `start_date`+`end_date`(单日则相同) |
|
|
64
57
|
|
|
@@ -67,8 +60,7 @@ P3 辅助能力:
|
|
|
67
60
|
1. **盯盘策略任务**优先:`watch_create/watch_list/watch_pause/watch_activate/watch_remove`
|
|
68
61
|
2. 创建策略若缺代码或市场:先本地 CSV,再 `watch_search_*_basic`
|
|
69
62
|
3. 代码已明确再查实时价:`watch_query_ticker`
|
|
70
|
-
4.
|
|
71
|
-
5. 再处理辅助任务:`watch_trade_calendar` / `watch_fin_news` / `notify_*`
|
|
63
|
+
4. 再处理辅助任务:`watch_trade_calendar` / `watch_fin_news` / `notify_*`
|
|
72
64
|
|
|
73
65
|
### 创建策略最小必填
|
|
74
66
|
|
|
@@ -77,9 +69,9 @@ P3 辅助能力:
|
|
|
77
69
|
- `operator_type`(固定 `rule`)
|
|
78
70
|
- `operator_parameters.condition`
|
|
79
71
|
- `operator_parameters.variables`
|
|
72
|
+
- `operator_parameters` 详细填写规则见 `references/watch-contract.md` 的「operator_parameters 填写说明」
|
|
80
73
|
|
|
81
74
|
缺任一项先追问,不猜测阈值。
|
|
82
|
-
若 `product_type` 为基金(或代码为 `xxxxxx.OF`),拒绝创建并改为提供基金估值查询方案。
|
|
83
75
|
|
|
84
76
|
### 渠道选择规则(`watch_create`)
|
|
85
77
|
|
|
@@ -107,7 +99,6 @@ P3 辅助能力:
|
|
|
107
99
|
- 把 `channel_configs.*` 传成 JSON 字符串(必须是对象)
|
|
108
100
|
- 用户明确“仅/只用某几个渠道”时,仍强行附加其他渠道
|
|
109
101
|
- 通过 `watch_list` 传 `user_id/use_id` 越权查询
|
|
110
|
-
- 用 `watch_query_ticker` 查**场外基金估值**(应使用 `watch_query_fund_estimates`)
|
|
111
102
|
- 对基金调用 `watch_create`
|
|
112
103
|
|
|
113
104
|
### 联系人 CSV(强约束,适用于 `watch_create` 与 `notify_*`)
|
|
@@ -127,7 +118,7 @@ P3 辅助能力:
|
|
|
127
118
|
|
|
128
119
|
- 盯盘策略(创建/管理):`references/watch-contract.md`
|
|
129
120
|
- 直连通知(短信/电话/邮件/钉钉):`references/channels.md`
|
|
130
|
-
-
|
|
121
|
+
- 实时行情(股/指/加密):`references/quote-realtime.md`
|
|
131
122
|
- 标的检索 + 是否交易日:`references/symbol-search-and-calendar.md`
|
|
132
123
|
- 快讯:`references/news-briefing.md`
|
|
133
124
|
- 示例 payload:`references/examples.md`
|
|
@@ -138,7 +129,7 @@ P3 辅助能力:
|
|
|
138
129
|
| 用户主意图 | 必读文档(最小集合) |
|
|
139
130
|
|---|---|
|
|
140
131
|
| 创建/管理盯盘策略 | `references/watch-contract.md` |
|
|
141
|
-
|
|
|
132
|
+
| 查行情(股/指/加密) | `references/quote-realtime.md` |
|
|
142
133
|
| 名称→代码 / 交易日判断 | `references/symbol-search-and-calendar.md` |
|
|
143
134
|
| 快讯 | `references/news-briefing.md` |
|
|
144
135
|
| 立即发通知 | `references/channels.md` |
|
|
@@ -160,7 +151,7 @@ P3 辅助能力:
|
|
|
160
151
|
|
|
161
152
|
- 用户说「帮我盯 BTC 跌 2% 提醒」 -> `references/watch-contract.md` + `references/channels.md`
|
|
162
153
|
- 用户说「腾讯现在多少钱」 -> `references/quote-realtime.md`(如缺代码再读 `references/symbol-search-and-calendar.md`)
|
|
163
|
-
- 用户说「这只基金今天估值多少」 ->
|
|
154
|
+
- 用户说「这只基金今天估值多少」 -> 明确告知“当前 OpenClaw 暂不提供基金能力”
|
|
164
155
|
- 用户说「今天 A 股开不开盘」 -> `references/symbol-search-and-calendar.md`(`watch_trade_calendar`,SSE/SZSE)
|
|
165
156
|
- 用户说「发短信给我」 -> `references/channels.md`
|
|
166
157
|
- 用户说「有什么央行快讯」 -> `references/news-briefing.md`
|
|
@@ -112,13 +112,6 @@ await watch_query_ticker({ market: 'hk', symbol: '00700', segment: 'stock' })
|
|
|
112
112
|
await watch_query_ticker({ market: 'crypto', symbol: 'BTCUSDT' })
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
### 3.2 基金当日估值(基金不支持创建盯盘)
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
await watch_query_fund_estimates({ fund_codes: '000006.OF' })
|
|
119
|
-
await watch_query_fund_estimates({ fund_codes: ['000006.OF', '110011.OF'] })
|
|
120
|
-
```
|
|
121
|
-
|
|
122
115
|
## 4) 标的检索与是否交易日查询
|
|
123
116
|
|
|
124
117
|
### 4.1 名称 -> 代码
|
|
@@ -127,7 +120,6 @@ await watch_query_fund_estimates({ fund_codes: ['000006.OF', '110011.OF'] })
|
|
|
127
120
|
await watch_search_a_stock_basic({ keyword: '平安银行', limit: 5 })
|
|
128
121
|
await watch_search_hk_stock_basic({ q: '腾讯', limit: 5 })
|
|
129
122
|
await watch_search_index_basic({ keyword: '沪深300', limit: 5 })
|
|
130
|
-
await watch_search_fund_basic({ keyword: '西部利得量化成长', limit: 5 })
|
|
131
123
|
```
|
|
132
124
|
|
|
133
125
|
### 4.2 是否交易日
|
|
@@ -154,6 +146,5 @@ await watch_fin_news({
|
|
|
154
146
|
|
|
155
147
|
## 常见边界提示
|
|
156
148
|
|
|
157
|
-
- 基金(`xxxxxx.OF`)不能用 `watch_create`,只能用 `watch_query_fund_estimates` / `watch_search_fund_basic`。
|
|
158
149
|
- 使用 `call/sms/email/dingtalk` 时,`watch_create` 与 `notify_*` 都要先查联系人 CSV。
|
|
159
150
|
- `operator_type` 固定 `rule`,不要用其他值。
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 实时行情
|
|
2
2
|
|
|
3
3
|
## 适用范围
|
|
4
4
|
|
|
5
5
|
- 股票/指数/加密实时行情:`watch_query_ticker`
|
|
6
|
-
- 基金当日估值:`watch_query_fund_estimates`
|
|
7
|
-
- 注意:基金不支持 `watch_create` 创建盯盘策略
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## 股票/指数/加密实时行情:`watch_query_ticker`
|
|
10
8
|
|
|
11
9
|
必填参数:
|
|
12
10
|
- `market`:`a` / `hk` / `crypto`(支持中文别名)
|
|
@@ -30,33 +28,3 @@ await watch_query_ticker({ market: 'hk', symbol: '00700', segment: 'stock' })
|
|
|
30
28
|
await watch_query_ticker({ market: 'A股', symbol: '600000.SH' })
|
|
31
29
|
await watch_query_ticker({ market: 'crypto', symbol: 'BTCUSDT' })
|
|
32
30
|
```
|
|
33
|
-
|
|
34
|
-
## 2) 基金估值:`watch_query_fund_estimates`
|
|
35
|
-
|
|
36
|
-
参数(二选一):
|
|
37
|
-
- `fund_codes`
|
|
38
|
-
- `fundCodes`
|
|
39
|
-
|
|
40
|
-
值格式:
|
|
41
|
-
- 单只:`"000006.OF"`
|
|
42
|
-
- 多只:`["000006.OF", "110011.OF"]`
|
|
43
|
-
|
|
44
|
-
成功判定:
|
|
45
|
-
- `success === true`
|
|
46
|
-
- `http_status === 200`
|
|
47
|
-
- `data` 为基金代码映射
|
|
48
|
-
|
|
49
|
-
失败处理:
|
|
50
|
-
- 读取 `error` 与 `http_status` 反馈用户
|
|
51
|
-
|
|
52
|
-
示例:
|
|
53
|
-
|
|
54
|
-
```javascript
|
|
55
|
-
await watch_query_fund_estimates({ fund_codes: '000006.OF' })
|
|
56
|
-
await watch_query_fund_estimates({ fund_codes: ['000006.OF', '110011.OF'] })
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 3) 硬边界
|
|
60
|
-
|
|
61
|
-
- 不要用 `watch_query_ticker` 查基金当日估值
|
|
62
|
-
- 不要对基金调用 `watch_create`
|
|
@@ -16,7 +16,6 @@ CSV 映射:
|
|
|
16
16
|
- `stock_hk.csv` -> `product_type=hk_stock`
|
|
17
17
|
- `index_a.csv` -> `product_type=index`
|
|
18
18
|
- `index_hk.csv` -> `product_type=index`
|
|
19
|
-
- 基金 `xxxxxx.OF` -> 仅估值/基础信息,不创建策略
|
|
20
19
|
|
|
21
20
|
### 本地 CSV 匹配算法(执行约束)
|
|
22
21
|
|
|
@@ -34,7 +33,6 @@ CSV 映射:
|
|
|
34
33
|
- `watch_search_a_stock_basic`(A股)
|
|
35
34
|
- `watch_search_hk_stock_basic`(港股)
|
|
36
35
|
- `watch_search_index_basic`(指数)
|
|
37
|
-
- `watch_search_fund_basic`(基金基础信息)
|
|
38
36
|
|
|
39
37
|
统一规则:
|
|
40
38
|
- 名称检索至少给 `keyword` 或 `q`
|
|
@@ -46,7 +44,6 @@ CSV 映射:
|
|
|
46
44
|
await watch_search_a_stock_basic({ keyword: '平安银行', limit: 5 })
|
|
47
45
|
await watch_search_hk_stock_basic({ q: '腾讯' })
|
|
48
46
|
await watch_search_index_basic({ keyword: '沪深300' })
|
|
49
|
-
await watch_search_fund_basic({ ts_code: '000006.OF' })
|
|
50
47
|
```
|
|
51
48
|
|
|
52
49
|
## 3) 交易日查询:`watch_trade_calendar`
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- 若报“未注册的算子类型”,将 `operator_type` 修正为 `rule` 后重试。
|
|
14
14
|
- 若报 `UNSUPPORTED_PRODUCT_TYPE`,说明命中了基金边界(如 `fund` 或 `000006.OF`):
|
|
15
15
|
- 不再重试 `watch_create`
|
|
16
|
-
-
|
|
16
|
+
- 直接告知“当前 OpenClaw 暂不提供基金能力”
|
|
17
17
|
|
|
18
18
|
## 通知失败(`notify_*`)
|
|
19
19
|
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
## 0. 产品边界
|
|
12
12
|
|
|
13
13
|
- 支持盯盘:`stock` / `hk_stock` / `index` / `crypto`
|
|
14
|
-
- 不支持盯盘:基金(`product_type=fund` 或代码形如 `xxxxxx.OF`)
|
|
15
|
-
- 基金相关请改用:`watch_query_fund_estimates` / `watch_search_fund_basic`
|
|
16
14
|
|
|
17
15
|
## 1. `watch_create`
|
|
18
16
|
|
|
@@ -27,6 +25,44 @@
|
|
|
27
25
|
- `channels`(至少 1 个渠道;是否包含 `openclaw` 见下方渠道规则)
|
|
28
26
|
- `channel_configs`
|
|
29
27
|
|
|
28
|
+
### operator_parameters 填写说明
|
|
29
|
+
|
|
30
|
+
字段定义:
|
|
31
|
+
- `operator_parameters.condition`:触发条件表达式(字符串,必填)
|
|
32
|
+
- `operator_parameters.variables`:条件表达式里引用的变量(对象,建议必填)
|
|
33
|
+
- `operator_parameters.message_template`:触发提示文案模板(字符串,建议填写)
|
|
34
|
+
- `operator_parameters.symbols`:多标的策略的别名映射(对象,可选)
|
|
35
|
+
|
|
36
|
+
表达式支持:
|
|
37
|
+
- 比较:`<`, `<=`, `>`, `>=`, `==`, `!=`
|
|
38
|
+
- 逻辑:`and`, `or`
|
|
39
|
+
- 可用行情字段:`price`, `volume`, `change_percent`
|
|
40
|
+
- A股/港股额外可用:`turnover_rate`
|
|
41
|
+
- `crypto` 不要使用 `turnover_rate`
|
|
42
|
+
|
|
43
|
+
字段含义(其中 `volume` / `change_percent` / `turnover_rate` 都是日内指标):
|
|
44
|
+
- `price`:最新成交价。
|
|
45
|
+
- `volume`:当日累计成交量(日内)。
|
|
46
|
+
- `change_percent`:当日涨跌幅(日内,小数表示;如 2% 写 `0.02`,-2% 写 `-0.02`)。
|
|
47
|
+
- `turnover_rate`:当日换手率(日内,小数表示;如 1% 写 `0.01`,仅 A股/港股可用)。
|
|
48
|
+
|
|
49
|
+
填写规则(创建策略时直接套用):
|
|
50
|
+
- `condition` 只引用“行情字段 + variables 里的变量名”,不要写未定义变量。
|
|
51
|
+
- `variables` 键名必须和 `condition` 中引用一致(如 `threshold/tr_threshold/cp_threshold`)。
|
|
52
|
+
- `message_template` 推荐复用 `variables` 里的键位占位:`{product_name} ... {threshold}`。
|
|
53
|
+
- 文案优先放在 `message_template`,渠道内 `content/condition` 仅在用户明确要求时再覆盖。
|
|
54
|
+
|
|
55
|
+
常用模板(按市场):
|
|
56
|
+
- A股/港股个股:
|
|
57
|
+
`condition: "price >= threshold and turnover_rate >= tr_threshold"`
|
|
58
|
+
`variables: { "threshold": 12.5, "tr_threshold": 0.01, "product_name": "平安银行" }`
|
|
59
|
+
- 指数:
|
|
60
|
+
`condition: "price <= threshold"`
|
|
61
|
+
`variables: { "threshold": 3500, "product_name": "沪深300" }`
|
|
62
|
+
- 加密:
|
|
63
|
+
`condition: "price >= threshold and change_percent >= cp_threshold"`
|
|
64
|
+
`variables: { "threshold": 70000, "cp_threshold": 0.02, "product_name": "Bitcoin" }`
|
|
65
|
+
|
|
30
66
|
渠道规则:
|
|
31
67
|
- 用户明确“仅/只用某几个渠道”时:严格按用户指定,可不含 `openclaw`。
|
|
32
68
|
- 用户只说“用某个渠道/某几个渠道”但未强调“仅限”时:默认补 `openclaw`。
|
|
@@ -54,7 +90,8 @@ OpenClaw 路由约束(当 `channels` 包含 `openclaw`):
|
|
|
54
90
|
variables: {
|
|
55
91
|
cp_threshold: -0.02,
|
|
56
92
|
product_name: '比特币'
|
|
57
|
-
}
|
|
93
|
+
},
|
|
94
|
+
message_template: '{product_name} 跌幅达到 {cp_threshold},当前价格 {price}'
|
|
58
95
|
},
|
|
59
96
|
channels: ['openclaw', 'dingtalk', 'sms'],
|
|
60
97
|
channel_configs: {
|
|
@@ -98,7 +135,6 @@ OpenClaw 路由约束(当 `channels` 包含 `openclaw`):
|
|
|
98
135
|
- 顶层放 `condition`
|
|
99
136
|
- `channel_configs.*` 传 JSON 字符串
|
|
100
137
|
- 用户明确“仅/只用某几个渠道”时仍强行附加渠道
|
|
101
|
-
- 基金标的调用 `watch_create`
|
|
102
138
|
|
|
103
139
|
## 联系人 CSV(创建策略场景必遵守)
|
|
104
140
|
|
|
@@ -158,9 +194,10 @@ rg -n '^sms,jinguo\.xie,' ~/.openclaw/workspace/memory/watch-notify-contacts.csv
|
|
|
158
194
|
1. 字段名使用 snake_case:`product_code/product_type/operator_type/operator_parameters/channels/channel_configs`
|
|
159
195
|
2. `operator_type` 固定为 `rule`
|
|
160
196
|
3. `operator_parameters.condition` 与 `operator_parameters.variables` 同时存在
|
|
161
|
-
4. `
|
|
162
|
-
5.
|
|
163
|
-
6.
|
|
197
|
+
4. `message_template` 建议填写,且占位符与变量名一致
|
|
198
|
+
5. `channels` 至少一个,且与 `channel_configs` 对应
|
|
199
|
+
6. 渠道配置必须是对象,不能是 JSON 字符串
|
|
200
|
+
7. 不手动传 `request_id`
|
|
164
201
|
|
|
165
202
|
## 4. 买卖意图与条件方向
|
|
166
203
|
|