@shiyuhang0/ticloud-oncall 0.1.0 → 0.1.2
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/README.md +60 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,52 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @shiyuhang0/ticloud-oncall
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TiDB Cloud oncall plugin for [opencode](https://opencode.ai).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
- `ticloud` 主协调 agent
|
|
8
|
-
- `
|
|
9
|
-
- `
|
|
10
|
-
-
|
|
7
|
+
- `ticloud` — 主协调 agent,自动编排日志分析和元数据查询
|
|
8
|
+
- `log-analyzer` — Loki 日志分析 subagent
|
|
9
|
+
- `metadata-querier` — 集群元数据查询 subagent
|
|
10
|
+
- `clinic_cluster_query` — Clinic 集群元数据查询 tool
|
|
11
|
+
- `loki_log_query` — Loki 直连日志查询 tool
|
|
12
|
+
- 循环检测 — 自动检测重复 tool 调用并中断
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
## Quickstart
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
- `explore` 只应搜索从 `REPO_ROOTS` 缩小出的候选 repo,不应盲搜整个 workspace
|
|
16
|
+
在 `opencode.json` 中配置 plugin,opencode 启动时会自动安装,无需手动 `npm install`:
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"plugin": [
|
|
21
|
+
["@shiyuhang0/ticloud-oncall@0.1.1", {
|
|
22
|
+
"CLINIC_API_KEY": "<your-clinic-api-key>",
|
|
23
|
+
"REPO_ROOTS": [
|
|
24
|
+
"/Users/you/github"
|
|
25
|
+
]
|
|
26
|
+
}]
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
```
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
2. 在 opencode plugin 参数里配置:`CLINIC_API_KEY`、`CLINIC_ENV`、`REPO_ROOTS`
|
|
21
|
-
3. 构建:`npm run build`
|
|
22
|
-
4. 在 opencode 配置中加载 `dist/src/index.js`
|
|
31
|
+
### Use
|
|
23
32
|
|
|
24
|
-
|
|
33
|
+
```text
|
|
34
|
+
Analyze cluster 10004146697249526430 for recent errors.
|
|
35
|
+
```
|
|
25
36
|
|
|
26
|
-
|
|
27
|
-
- 先 `labels`,再 `label_values`,最后 `query_range`
|
|
28
|
-
- 先宽搜,再窄搜
|
|
29
|
-
- 单次查询时间范围必须在 30 天内
|
|
37
|
+
结合代码搜索:
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
```text
|
|
40
|
+
Diagnose issue INC-1234.
|
|
41
|
+
Cluster ID: 10004146697249526430
|
|
42
|
+
Use metadata and logs to narrow candidate repos from REPO_ROOTS.
|
|
43
|
+
```
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
| Key | Required | Default | Description |
|
|
48
|
+
|-----|----------|---------|-------------|
|
|
49
|
+
| `CLINIC_API_KEY` | Yes | — | Clinic API key |
|
|
50
|
+
| `CLINIC_ENV` | No | `prod` | Clinic environment |
|
|
51
|
+
| `REPO_ROOTS` | No | `[]` | Local repo paths for code search |
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install
|
|
57
|
+
npm run build
|
|
58
|
+
npm test
|
|
59
|
+
npm run typecheck
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Publish
|
|
63
|
+
|
|
64
|
+
Bump version in `package.json`, then:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm publish --access public
|
|
44
68
|
```
|
|
45
69
|
|
|
46
|
-
##
|
|
70
|
+
## Docs
|
|
47
71
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- 实现计划:`docs/superpowers/plans/2026-06-03-ticloud-oncall-plugin.md`
|
|
52
|
-
- 使用部署:`docs/guides/ticloud-oncall-plugin-usage.md`
|
|
72
|
+
- [Architecture & Highlights](docs/architecture/overview-and-highlights.md)
|
|
73
|
+
- [Design](docs/architecture/ticloud-oncall-plugin-design.md)
|
|
74
|
+
- [Usage Guide](docs/guides/ticloud-oncall-plugin-usage.md)
|