@lawtedwu/climax-vault 0.1.0 → 0.3.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/README.md +25 -37
- package/dist/index.js +34 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,66 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Climax Racing Team 2026 GTWCA 赛季文件库 CLI(zero-token 客户端)。
|
|
4
4
|
|
|
5
|
-
数据通过私有 Cloudflare Worker 提供,需要团队 token 才能访问。
|
|
6
|
-
|
|
7
5
|
## 使用方式
|
|
8
6
|
|
|
9
7
|
把下面这段 prompt 粘进 Claude / Coze / Cursor(**替换 `<TOKEN>` 为你的团队 token**):
|
|
10
8
|
|
|
11
9
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
全部赛季文档,然后回答我的问题。
|
|
15
|
-
```
|
|
10
|
+
我是 Climax Racing Team 的成员,需要查询 2026 GTWCA 赛季资料。
|
|
11
|
+
我们的 token 是 <TOKEN>。
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
先跑 `CLIMAX_TOKEN=<TOKEN> npx -y @lawtedwu/climax-vault@latest help` 摸清
|
|
14
|
+
有哪些命令,然后根据我的问题调用对应命令拉数据来回答。
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
CLIMAX_TOKEN=<TOKEN> npx @lawtedwu/climax-vault@latest tires # 轮胎数据
|
|
24
|
-
CLIMAX_TOKEN=<TOKEN> npx @lawtedwu/climax-vault@latest team # 车队成员
|
|
25
|
-
CLIMAX_TOKEN=<TOKEN> npx @lawtedwu/climax-vault@latest search "pit" # 全文搜索
|
|
16
|
+
回答规则:
|
|
17
|
+
- 涉及具体数字(进站时间、罚则金额、圈数)必须引用规章原文条款号
|
|
18
|
+
- 不确定的内容用 `search` 命令交叉验证
|
|
19
|
+
- 用中文回答,关键术语保留英文原文
|
|
26
20
|
```
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
之后直接提问:
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
- "下一场比赛几点开始?"
|
|
25
|
+
- "8 号车的两位车手是谁?"
|
|
26
|
+
- "最低进站时间是几秒?"
|
|
27
|
+
- "Silver Cup 车队有额外罚则吗?"
|
|
28
|
+
|
|
29
|
+
agent 会自动用 `event sepang` / `regulations` / `search` 等命令拉取所需数据。
|
|
31
30
|
|
|
32
31
|
## Commands
|
|
33
32
|
|
|
34
33
|
| Command | Description |
|
|
35
34
|
|---------|-------------|
|
|
36
35
|
| `help` | 显示帮助 |
|
|
37
|
-
| `dump` | 输出全部文档(给 agent 完整 context) |
|
|
38
36
|
| `list` | 列出 vault 中所有文件 |
|
|
39
|
-
| `regulations` |
|
|
37
|
+
| `regulations` | 赛事规章(积分/罚则/进站/排位/旗语) |
|
|
40
38
|
| `event <name>` | 分站信息(sepang/mandalika/shanghai/fuji/okayama/beijing) |
|
|
41
39
|
| `tires` | Pirelli 手册 + 规格索引 |
|
|
42
40
|
| `team` | 车队成员 + 联系方式 |
|
|
43
41
|
| `search <term>` | 全文搜索 |
|
|
44
42
|
| `file <path>` | 读取指定文件 |
|
|
43
|
+
| `dump` | 输出全部文档(极少需要,仅在问题非常宽泛时使用) |
|
|
45
44
|
|
|
46
|
-
##
|
|
45
|
+
## 直接命令行调用
|
|
47
46
|
|
|
47
|
+
```bash
|
|
48
|
+
CLIMAX_TOKEN=<TOKEN> npx -y @lawtedwu/climax-vault@latest event sepang
|
|
49
|
+
CLIMAX_TOKEN=<TOKEN> npx -y @lawtedwu/climax-vault@latest regulations
|
|
50
|
+
CLIMAX_TOKEN=<TOKEN> npx -y @lawtedwu/climax-vault@latest search "pit stop"
|
|
48
51
|
```
|
|
49
|
-
Coze / Claude / Cursor
|
|
50
|
-
│
|
|
51
|
-
│ paste prompt with token
|
|
52
|
-
▼
|
|
53
|
-
npx @lawtedwu/climax-vault
|
|
54
|
-
│
|
|
55
|
-
│ HTTPS + Bearer token
|
|
56
|
-
▼
|
|
57
|
-
climax-vault.lawtedwu.workers.dev (Cloudflare Worker)
|
|
58
|
-
│
|
|
59
|
-
│ embedded vault data
|
|
60
|
-
▼
|
|
61
|
-
Markdown content → stdout → agent reads it
|
|
62
|
-
```
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **任何 agent 可用**:只要能跑 npx 命令就行
|
|
53
|
+
## Architecture
|
|
54
|
+
|
|
55
|
+
零 token 设计:CLI 不消耗任何 AI API,推理由用户自己的 Coze/Claude 完成。数据托管在 Cloudflare Worker,token 鉴权。
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const WORKER_URL = process.env.CLIMAX_WORKER_URL ?? "https://climax-vault.
|
|
2
|
+
const WORKER_URL = process.env.CLIMAX_WORKER_URL ?? "https://climax-vault.lawted.tech";
|
|
3
3
|
function getToken(args) {
|
|
4
4
|
const flagIdx = args.findIndex(a => a === "--token" || a.startsWith("--token="));
|
|
5
5
|
if (flagIdx !== -1) {
|
|
@@ -46,39 +46,47 @@ async function fetchWorker(path, token) {
|
|
|
46
46
|
}
|
|
47
47
|
function printHelp() {
|
|
48
48
|
console.log(`
|
|
49
|
-
climax-vault — Climax Racing Team 2026 GTWCA Document Vault
|
|
49
|
+
climax-vault — Climax Racing Team 2026 GTWCA Document Vault
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
This CLI gives an AI agent access to Climax Racing's 2026 season documents
|
|
52
|
+
(regulations, timetables, tire specs, team roster). Call the most specific
|
|
53
|
+
command for the user's question — only use 'dump' as a last resort.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
You need a team token. Get it from your team manager (Arna Fong 方琨).
|
|
55
|
+
USAGE
|
|
56
|
+
CLIMAX_TOKEN=<token> npx @lawtedwu/climax-vault <command> [args]
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
Or via flag: npx @lawtedwu/climax-vault dump --token=xxx
|
|
58
|
+
COMMANDS (prefer specific commands over 'dump')
|
|
61
59
|
|
|
62
|
-
COMMANDS
|
|
63
|
-
help Show this help message
|
|
64
|
-
dump Output ALL documents (for full agent context)
|
|
65
60
|
list List all available files in the vault
|
|
66
|
-
regulations Sporting regulations
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
regulations Sporting regulations — rules, penalties, points, pit stop,
|
|
62
|
+
qualifying, flags, driver categories (80 pages → markdown)
|
|
63
|
+
event <name> Per-round info: timetable, circuit, cars, hotel, flights
|
|
64
|
+
<name> ∈ {sepang, mandalika, shanghai, fuji, okayama, beijing}
|
|
65
|
+
or round shortcuts r1..r12
|
|
66
|
+
tires Pirelli tire data: P_Book + 10 spec sheets (sizes, pressures)
|
|
67
|
+
team Team roster + contacts (drivers, engineers, mechanics)
|
|
68
|
+
search <term> Full-text search across all documents (use to verify facts
|
|
69
|
+
or find specific clauses by keyword)
|
|
70
|
+
file <path> Fetch one specific file (use after 'list' to drill down)
|
|
71
|
+
dump Output ALL documents (~112 KB, only when question is broad)
|
|
72
|
+
help Show this help
|
|
73
|
+
|
|
74
|
+
DECISION RULES FOR AGENTS
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
- User asks about timing/schedule → 'event <name>'
|
|
77
|
+
- User asks about a rule/penalty/points → 'regulations' or 'search <keyword>'
|
|
78
|
+
- User asks about tires → 'tires'
|
|
79
|
+
- User asks about people / contacts → 'team' or 'event <name>' (logistics)
|
|
80
|
+
- Specific number or clause needed → 'search <keyword>' to find context
|
|
81
|
+
- Broad / open-ended question → 'dump' (last resort)
|
|
76
82
|
|
|
77
|
-
|
|
83
|
+
EXAMPLES (with token set as env var)
|
|
78
84
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
npx @lawtedwu/climax-vault list
|
|
86
|
+
npx @lawtedwu/climax-vault regulations
|
|
87
|
+
npx @lawtedwu/climax-vault event sepang
|
|
88
|
+
npx @lawtedwu/climax-vault search "pit stop"
|
|
89
|
+
npx @lawtedwu/climax-vault search "Silver Cup"
|
|
82
90
|
`);
|
|
83
91
|
}
|
|
84
92
|
const EVENT_ALIASES = {
|
package/package.json
CHANGED