@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.
Files changed (2) hide show
  1. package/README.md +60 -38
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,52 +1,74 @@
1
- # TiCloud Oncall Plugin
1
+ # @shiyuhang0/ticloud-oncall
2
2
 
3
- 这是一个接入 opencode 的本地 plugin 项目,用于内部 oncall 场景。
3
+ TiDB Cloud oncall plugin for [opencode](https://opencode.ai).
4
4
 
5
- 当前版本提供:
5
+ ## Features
6
6
 
7
- - `ticloud` 主协调 agent
8
- - `clinic_cluster_query` 集群元数据查询 tool
9
- - `loki_log_query` Loki 直连日志查询 tool
10
- - 复用 opencode 内置 `explore` subagent 做本地代码搜索
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
- - 当需要代码证据时,用户应提供 `REPO_ROOTS`
15
- - `explore` 只应搜索从 `REPO_ROOTS` 缩小出的候选 repo,不应盲搜整个 workspace
16
+ `opencode.json` 中配置 plugin,opencode 启动时会自动安装,无需手动 `npm install`:
16
17
 
17
- ## Setup
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
- 1. 安装依赖:`npm install`
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
- - 只走 Loki 直连 API
27
- - 先 `labels`,再 `label_values`,最后 `query_range`
28
- - 先宽搜,再窄搜
29
- - 单次查询时间范围必须在 30 天内
37
+ 结合代码搜索:
30
38
 
31
- ## opencode config
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
- ```json
34
- {
35
- "plugin": [["./dist/src/index.js", {
36
- "CLINIC_API_KEY": "<your-clinic-api-key>",
37
- "CLINIC_ENV": "prod", // optional,defauts to "prod"
38
- "REPO_ROOTS": [
39
- "/Users/you/github/tidb-cloud",
40
- "/Users/you/github/platform-services"
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
- - quickstart:`docs/guides/quickstart.md`
49
- - 架构与亮点:`docs/architecture/overview-and-highlights.md`
50
- - 设计说明:`docs/architecture/ticloud-oncall-plugin-design.md`
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shiyuhang0/ticloud-oncall",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "TiDB Cloud oncall plugin for opencode",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",