@jun133/athlete 0.0.4 → 0.0.6
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 +149 -91
- package/dist/cli.js +26562 -19473
- package/dist/cli.js.map +1 -1
- package/package.json +6 -1
- package/scripts/postinstall-playwright.mjs +1 -1
- package/spec/README.md +49 -41
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260/README.md +29 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//344/270/273/345/276/252/347/216/257/344/270/216/350/260/203/345/272/246.md +60 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//344/273/223/345/272/223/347/272/246/346/235/237//345/274/200/345/217/221/350/247/204/345/210/231.md +14 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//344/273/223/345/272/223/347/272/246/346/235/237//346/234/254/345/234/260/345/221/275/344/273/244/344/270/216/346/265/201/347/250/213.md +20 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//344/273/223/345/272/223/347/272/246/346/235/237//346/265/213/350/257/225/347/255/226/347/225/245.md +48 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//344/273/243/347/240/201/345/234/260/345/233/276//347/233/256/345/275/225/345/210/260/344/273/243/347/240/201/346/230/240/345/260/204.md +51 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227/Telegram/347/247/201/350/201/212.md +31 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//344/272/244/344/272/222/347/273/210/347/253/257.md +26 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//345/221/275/344/273/244/350/241/214/344/272/247/345/223/201/351/235/242.md +27 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//345/244/232/346/231/272/350/203/275/344/275/223/350/260/203/345/272/246.md +79 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//345/256/277/344/270/273/350/277/220/350/241/214/350/276/271/347/225/214.md +74 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//345/267/245/344/275/234/345/214/272/344/270/216/345/271/266/350/241/214/351/232/224/347/246/273.md +55 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//345/276/256/344/277/241/347/247/201/350/201/212.md +33 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//346/211/251/345/261/225/346/234/272/345/210/266.md +179 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//346/216/247/345/210/266/351/235/242/350/264/246/346/234/254.md +32 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//345/205/263/351/224/256/346/250/241/345/235/227//351/205/215/347/275/256/347/263/273/347/273/237.md +31 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//346/200/273/344/275/223/346/236/266/346/236/204.md +115 -0
- package/spec//346/212/200/346/234/257/345/256/236/347/216/260//347/212/266/346/200/201/344/270/216/347/234/237/347/233/270/346/272/220.md +129 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205/README.md +27 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//344/272/247/345/223/201/345/256/232/344/275/215.md +78 -0
- package/spec/{principles/P06- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/06-}/344/270/212/344/270/213/346/226/207/350/246/201/350/203/275/345/216/213/347/274/251.md +2 -2
- package/spec/{principles/P08- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/08-}/346/205/242/346/223/215/344/275/234/346/224/276/345/220/216/345/217/260.md +1 -1
- package/spec/{principles/P13-session → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/13-session}/346/230/257/344/273/273/345/212/241/347/216/260/345/234/272.md +3 -3
- package/spec/{principles/P15-provider → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/15-provider}/345/277/205/351/241/273/345/217/257/346/233/277/346/215/242.md +3 -1
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/17-/346/211/251/345/261/225/351/235/240/344/272/213/344/273/266/347/224/237/351/225/277.md +71 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/18-/344/270/273/345/276/252/347/216/257/345/222/214/346/226/207/344/273/266/351/203/275/344/270/215/350/203/275/351/225/277/350/203/226.md +37 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/20-/345/244/226/351/203/250/344/272/213/345/256/236/345/277/205/351/241/273/347/273/221/345/256/232/350/257/201/346/215/256.md +48 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/21-/346/262/241/351/252/214/350/277/207/345/260/261/344/270/215/350/203/275/346/224/266/345/217/243.md +46 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/22-/351/230/266/346/256/265/346/216/250/350/277/233/345/277/205/351/241/273/346/234/211/346/234/272/345/231/250/347/212/266/346/200/201.md +40 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/23-/346/226/207/346/234/254/351/223/276/350/267/257/345/277/205/351/241/273/347/250/263/345/256/232/345/217/257/350/257/273.md +38 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/24-/351/224/231/350/257/257/345/205/274/345/256/271/344/270/215/350/203/275/351/253/230/344/272/216/346/255/243/347/241/256/346/200/247.md +38 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/25-/346/226/260/351/241/271/347/233/256/344/270/215/344/270/272/346/227/247/346/256/213/344/275/231/344/277/235/346/264/273.md +66 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/README.md +37 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//347/263/273/347/273/237/345/205/250/346/231/257.md +57 -0
- package/spec//347/224/250/346/210/267/345/256/241/351/230/205//351/241/271/347/233/256/350/214/203/345/233/264.md +59 -0
- package/spec/adr/ADR-0001-/345/215/225/346/250/241/345/274/217/345/205/250/346/235/203/351/231/220.md +0 -16
- package/spec/adr/ADR-0002-/345/215/225agent/350/265/267/346/255/245/345/271/266/351/242/204/347/225/231/345/244/232agent/350/276/271/347/225/214.md +0 -19
- package/spec/adr/ADR-0003-openai-compatible/344/274/230/345/205/210.md +0 -16
- package/spec/architecture//346/200/273/344/275/223/346/236/266/346/236/204.md +0 -111
- package/spec/architecture//347/212/266/346/200/201/344/270/216/347/234/237/347/233/270/346/272/220.md +0 -117
- package/spec/architecture//350/277/220/350/241/214/346/227/266/345/276/252/347/216/257.md +0 -82
- package/spec/implementation/README.md +0 -17
- package/spec/implementation//346/250/241/345/235/227/347/272/247/345/274/200/345/217/221/344/273/273/345/212/241/345/215/225.md +0 -55
- package/spec/implementation//347/233/256/345/275/225/347/273/223/346/236/204/345/210/260/344/273/243/347/240/201/346/226/207/344/273/266/346/230/240/345/260/204/350/241/250.md +0 -101
- package/spec/interfaces/InteractionShell.md +0 -85
- package/spec/interfaces/ProviderAdapter.md +0 -23
- package/spec/interfaces/README.md +0 -17
- package/spec/interfaces/RuntimeLoop.md +0 -28
- package/spec/interfaces/SessionStore.md +0 -22
- package/spec/interfaces/ToolRegistry.md +0 -21
- package/spec/modules/config-system.md +0 -51
- package/spec/modules/interactive-terminal.md +0 -112
- package/spec/modules/lightweight-context-runtime.md +0 -63
- package/spec/modules/provider-adapter.md +0 -20
- package/spec/modules/runtime-metrics.md +0 -132
- package/spec/modules/runtime-rules.md +0 -33
- package/spec/modules/session-resume-compact.md +0 -49
- package/spec/modules/task-state.md +0 -34
- package/spec/modules/telegram-private-chat.md +0 -291
- package/spec/modules/tool-registry.md +0 -79
- package/spec/modules/weixin-private-chat.md +0 -291
- package/spec/modules/workspace-isolation.md +0 -24
- package/spec/modules//346/211/251/345/261/225/346/234/272/345/210/266.md +0 -105
- package/spec/overview/v0/350/214/203/345/233/264.md +0 -54
- package/spec/overview//344/272/247/345/223/201/345/256/232/344/271/211.md +0 -59
- package/spec/principles/P17-/346/211/251/345/261/225/351/235/240/344/272/213/344/273/266/347/224/237/351/225/277.md +0 -32
- package/spec/principles/P18-/344/270/273/345/276/252/347/216/257/345/222/214/346/226/207/344/273/266/351/203/275/344/270/215/350/203/275/351/225/277/350/203/226.md +0 -36
- package/spec/principles/README.md +0 -39
- package/spec/repo//345/274/200/345/217/221/350/247/204/345/210/231.md +0 -39
- package/spec/repo//346/234/254/345/234/260/345/221/275/344/273/244/344/270/216/346/265/201/347/250/213.md +0 -32
- package/spec/testing/fail-first-/347/254/254/344/270/200/346/211/271/346/265/213/350/257/225/345/210/227/350/241/250.md +0 -11
- package/spec/testing/fixtures-/350/247/204/350/214/203.md +0 -20
- package/spec/testing//346/265/213/350/257/225/347/255/226/347/225/245.md +0 -97
- /package/spec/{principles/P01- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/01-}/344/270/200/344/270/252/345/276/252/347/216/257/344/270/200/344/270/252/346/231/272/350/203/275/344/275/223.md" +0 -0
- /package/spec/{principles/P02- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/02-}/345/212/240/344/270/200/344/270/252/345/267/245/345/205/267/345/217/252/345/212/240/344/270/200/344/270/252/345/244/204/347/220/206/345/231/250.md" +0 -0
- /package/spec/{principles/P03- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/03-}/345/205/210/350/256/241/345/210/222/345/206/215/345/212/250/346/211/213.md" +0 -0
- /package/spec/{principles/P04- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/04-}/345/244/247/344/273/273/345/212/241/346/213/206/347/273/231/345/255/220/346/231/272/350/203/275/344/275/223.md" +0 -0
- /package/spec/{principles/P05- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/05-}/347/237/245/350/257/206/346/214/211/351/234/200/345/212/240/350/275/275.md" +0 -0
- /package/spec/{principles/P07- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/07-}/344/273/273/345/212/241/345/233/276/350/246/201/350/220/275/347/233/230.md" +0 -0
- /package/spec/{principles/P09- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/09-}/344/273/273/345/212/241/345/244/252/345/244/247/345/260/261/345/210/206/347/273/231/351/230/237/345/217/213.md" +0 -0
- /package/spec/{principles/P10- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/10-}/351/230/237/345/217/213/344/271/213/351/227/264/350/246/201/346/234/211/347/273/237/344/270/200/345/215/217/350/256/256.md" +0 -0
- /package/spec/{principles/P11- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/11-}/351/230/237/345/217/213/350/207/252/345/267/261/350/256/244/351/242/206/344/273/273/345/212/241.md" +0 -0
- /package/spec/{principles/P12- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/12-}/345/267/245/344/275/234/345/214/272/345/222/214/344/273/273/345/212/241/350/246/201/351/232/224/347/246/273.md" +0 -0
- /package/spec/{principles/P14- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/14-}/346/211/247/350/241/214/347/272/246/346/235/237/344/270/215/346/230/257/345/256/211/345/205/250/347/255/226/347/225/245.md" +0 -0
- /package/spec/{principles/P16- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/16-}/351/205/215/347/275/256/345/217/252/350/203/275/346/234/211/344/270/200/344/270/252/345/205/245/345/217/243.md" +0 -0
- /package/spec/{principles/P19- → /347/224/250/346/210/267/345/256/241/351/230/205//345/256/252/346/263/225/345/216/237/345/210/231/19-}/345/205/210/345/206/231/345/244/261/350/264/245/346/265/213/350/257/225/345/206/215/345/206/231/345/256/236/347/216/260.md" +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# config system
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
配置系统负责统一读取 Athlete 的运行参数,并把项目级默认值、用户配置和环境变量合并成最终 runtime config。
|
|
6
|
-
|
|
7
|
-
## 当前范围
|
|
8
|
-
|
|
9
|
-
- API key / base URL / model
|
|
10
|
-
- mode
|
|
11
|
-
- paths
|
|
12
|
-
- MCP 总开关与 server 配置
|
|
13
|
-
- Playwright MCP repo 级默认值
|
|
14
|
-
- context / continuation / read limits 等运行阈值
|
|
15
|
-
|
|
16
|
-
## 当前规则
|
|
17
|
-
|
|
18
|
-
1. 配置入口统一。
|
|
19
|
-
2. 业务模块不直接散读环境变量。
|
|
20
|
-
3. 用户能从 runtime config 理解当前行为从哪来。
|
|
21
|
-
4. 项目级默认值允许放在 `.athlete/.env`,但仍由统一配置入口解析。
|
|
22
|
-
|
|
23
|
-
## Playwright MCP 当前事实
|
|
24
|
-
|
|
25
|
-
当前支持的 repo 级 Playwright MCP 环境变量:
|
|
26
|
-
|
|
27
|
-
- `ATHLETE_MCP_ENABLED`
|
|
28
|
-
- `ATHLETE_MCP_PLAYWRIGHT_ENABLED`
|
|
29
|
-
- `ATHLETE_MCP_PLAYWRIGHT_BROWSER`
|
|
30
|
-
- `ATHLETE_MCP_PLAYWRIGHT_HEADLESS`
|
|
31
|
-
- `ATHLETE_MCP_PLAYWRIGHT_OUTPUT_MODE`
|
|
32
|
-
- `ATHLETE_MCP_PLAYWRIGHT_SAVE_SESSION`
|
|
33
|
-
|
|
34
|
-
当前仓库默认行为:
|
|
35
|
-
|
|
36
|
-
- Playwright MCP 在项目级 `.athlete/.env` 中默认启用
|
|
37
|
-
- 默认浏览器为 `chrome`
|
|
38
|
-
- 默认不是 headless
|
|
39
|
-
- 默认 output mode 为 `file`
|
|
40
|
-
- 默认 save session 为开启
|
|
41
|
-
|
|
42
|
-
## 路径约定
|
|
43
|
-
|
|
44
|
-
当前 Playwright MCP 状态目录:
|
|
45
|
-
|
|
46
|
-
- `.athlete/playwright-mcp/config.json`
|
|
47
|
-
- `.athlete/playwright-mcp/profile/`
|
|
48
|
-
- `.athlete/playwright-mcp/output/`
|
|
49
|
-
- `.athlete/playwright-mcp/legacy-root-artifacts/`
|
|
50
|
-
|
|
51
|
-
这些路径由配置系统和 `src/mcp/playwright/` 统一导出,不允许在调用侧随意拼接。
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# interactive terminal
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
交互终端是 Athlete 的表现层外壳,不是控制面真相源。
|
|
6
|
-
|
|
7
|
-
## 当前真实能力
|
|
8
|
-
|
|
9
|
-
### 当前分层
|
|
10
|
-
|
|
11
|
-
- `src/interaction/`: 共享交互控制层
|
|
12
|
-
- `src/shell/cli/`: CLI shell 适配层
|
|
13
|
-
- `src/ui/`: CLI 文本格式化、runtime summary 和兼容导出
|
|
14
|
-
|
|
15
|
-
### 共享交互控制层职责
|
|
16
|
-
|
|
17
|
-
- 驱动交互 session loop
|
|
18
|
-
- 处理普通输入和 multiline 分支
|
|
19
|
-
- 处理本地命令路由
|
|
20
|
-
- 管理 turn in-flight 状态与 abort controller 生命周期
|
|
21
|
-
- 接线 `runManagedAgentTurn`
|
|
22
|
-
- 维护当前 session 的内存态,并在 turn 完成后接收最新 session
|
|
23
|
-
|
|
24
|
-
### 当前 CLI shell 职责
|
|
25
|
-
|
|
26
|
-
- 提供 persistent input / multiline input
|
|
27
|
-
- 绑定终端 interrupt
|
|
28
|
-
- 展示 assistant 流式输出
|
|
29
|
-
- 展示 tool 调用和状态消息
|
|
30
|
-
- 展示 banner、launch hints、dim/warn/plain/stderr 风格
|
|
31
|
-
- 展示当前 session 的 runtime summary
|
|
32
|
-
|
|
33
|
-
## 规则
|
|
34
|
-
|
|
35
|
-
1. UI 不能反向定义 task、protocol、worktree、checkpoint、runtimeStats 等控制面事实。
|
|
36
|
-
2. spinner、stream renderer、本地命令格式化都只属于表现层。
|
|
37
|
-
3. Athlete 可以替换 UI,但不能因此破坏 runtime kernel。
|
|
38
|
-
4. `/runtime`、`/stats`、`/仪表盘` 只是 `SessionRecord.runtimeStats` 的只读 summary 视图。
|
|
39
|
-
5. UI 可以读取并展示真相源,但不能绕过真相源另造状态。
|
|
40
|
-
6. 交互 session loop 不能直接绑死 `readline`、`process.stdin/stdout`、`chalk` 这类 CLI 细节。
|
|
41
|
-
7. shell 只能提供输入、输出和 turn 展示适配,不能自己发明 task / protocol / runtime 真相。
|
|
42
|
-
## 当前本地命令入口
|
|
43
|
-
|
|
44
|
-
- `/session`
|
|
45
|
-
- `/config`
|
|
46
|
-
- `/todos`
|
|
47
|
-
- `/tasks`
|
|
48
|
-
- `/team`
|
|
49
|
-
- `/background`
|
|
50
|
-
- `/worktrees`
|
|
51
|
-
- `/inbox`
|
|
52
|
-
- `/runtime`
|
|
53
|
-
- `/stats`
|
|
54
|
-
- `/仪表盘`
|
|
55
|
-
- `/reset`
|
|
56
|
-
|
|
57
|
-
## Runtime Summary 展示范围
|
|
58
|
-
|
|
59
|
-
当前交互态最小 runtime summary 包含:
|
|
60
|
-
|
|
61
|
-
- session health
|
|
62
|
-
- model request count
|
|
63
|
-
- model wait total
|
|
64
|
-
- tool call count
|
|
65
|
-
- tool duration total
|
|
66
|
-
- yield / continuation / recovery / compression count
|
|
67
|
-
- externalized result count / bytes
|
|
68
|
-
- top tools
|
|
69
|
-
|
|
70
|
-
## Reset Boundary
|
|
71
|
-
|
|
72
|
-
- `/reset` 是显式 destructive local command,不是普通的窗口关闭动作。
|
|
73
|
-
- `/reset` 清空当前项目 `.athlete/` 下的运行时状态,但保留 `.athlete/.env` 和 `.athlete/.env.example`。
|
|
74
|
-
- `/reset` 还会删除当前项目相关的持久化 session,因此 `resume` 不应恢复已经 reset 掉的运行时。
|
|
75
|
-
- `/reset` 会尽量先通过正式 worktree / process 清理路径收尾,再删除状态目录。
|
|
76
|
-
- reset 行为必须落在 runtime / project state 层,UI 只能触发它,不能自己维护一套平行 reset 状态。
|
|
77
|
-
|
|
78
|
-
## 当前边界
|
|
79
|
-
|
|
80
|
-
### 共享边界
|
|
81
|
-
|
|
82
|
-
- `InteractiveSessionDriver`: 共享交互控制器
|
|
83
|
-
- `InteractionShell`: 壳适配接口
|
|
84
|
-
- `ShellInputPort`: 普通输入 / multiline 输入 / interrupt 订阅
|
|
85
|
-
- `ShellOutputPort`: info / warn / plain / dim / interrupt 等展示输出
|
|
86
|
-
- `InteractionTurnDisplay`: turn 期间的流式展示适配
|
|
87
|
-
|
|
88
|
-
### 当前 CLI 接线
|
|
89
|
-
|
|
90
|
-
- `src/ui/interactive.ts`: CLI 入口薄壳,只负责组装 shell、打印 intro、启动 driver
|
|
91
|
-
- `src/shell/cli/readlineInput.ts`: CLI 输入适配
|
|
92
|
-
- `src/shell/cli/output.ts`: `chalk` + stdio 输出适配
|
|
93
|
-
- `src/shell/cli/turnDisplay.ts`: spinner + stream renderer 适配
|
|
94
|
-
- `src/interaction/localCommands.ts`: 共享本地命令语义
|
|
95
|
-
|
|
96
|
-
## 当前展示边界
|
|
97
|
-
|
|
98
|
-
交互终端当前只负责把这些状态展示清楚:
|
|
99
|
-
|
|
100
|
-
- task board
|
|
101
|
-
- teammate 状态
|
|
102
|
-
- background 状态
|
|
103
|
-
- skill load 状态
|
|
104
|
-
- runtime summary
|
|
105
|
-
|
|
106
|
-
但它不负责发明这些状态。
|
|
107
|
-
|
|
108
|
-
## 未来方向
|
|
109
|
-
|
|
110
|
-
- 桌面壳应直接实现 `InteractionShell` 契约,而不是复用 CLI 的 `readline` / stdio 细节。
|
|
111
|
-
- 桌面壳可以自己提供输入框、停止按钮、流式消息区和状态面板。
|
|
112
|
-
- 只要继续复用 `InteractiveSessionDriver`,桌面壳与 CLI 壳就应共享同一套本地命令、turn 驱动和中断语义。
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# lightweight context runtime
|
|
2
|
-
|
|
3
|
-
## 目标
|
|
4
|
-
|
|
5
|
-
这一层负责让 Athlete 在长任务里继续跑,但不要把 prompt 和 session 越跑越重。
|
|
6
|
-
|
|
7
|
-
## 运行时约定
|
|
8
|
-
|
|
9
|
-
1. system prompt 按两层正式组装:
|
|
10
|
-
- `Static operating layer`
|
|
11
|
-
- `Dynamic runtime layer`
|
|
12
|
-
2. 静态层放稳定规则、模式规则、身份规则、项目说明。
|
|
13
|
-
3. 动态层放 cwd / root / date / taskState / todo / verification / task board / team / worktree / protocol / background / skill runtime。
|
|
14
|
-
4. 压缩后的会话总结不再直接拼回静态层,而是追加为 `Compressed conversation memory`。
|
|
15
|
-
|
|
16
|
-
## 大 tool result 外置化
|
|
17
|
-
|
|
18
|
-
1. 当 tool output 超过约 `12,000` chars 或 `16 KB` 时,进入外置化路径。
|
|
19
|
-
2. 原始 output 落盘到项目 state root 下:
|
|
20
|
-
- `.athlete/tool-results/<sessionId>/<timestamp>-<tool>-<hash>.json|txt`
|
|
21
|
-
3. session 里保留的 tool message 只存轻量引用:
|
|
22
|
-
- `externalized: true`
|
|
23
|
-
- `storagePath`
|
|
24
|
-
- `summary`
|
|
25
|
-
- `preview`
|
|
26
|
-
- `byteLength`
|
|
27
|
-
- `charLength`
|
|
28
|
-
4. 小结果继续走原来的 inline message 路径,不做无差别外置化。
|
|
29
|
-
5. 当 agent 读取 `.athlete/tool-results/...` 中的 artifact 文件时,`read_file` 默认返回紧凑摘要视图;只有显式 line range 读取才继续走原始逐行查看路径。
|
|
30
|
-
|
|
31
|
-
## 闭环要求
|
|
32
|
-
|
|
33
|
-
1. continuation 继续使用 session 中的轻量 tool message,而不是重新塞回原始大正文。
|
|
34
|
-
2. contextBuilder 在压缩历史时继续保留 `storagePath` 和预览信息。
|
|
35
|
-
3. recovery 的 context shrink 也要保住结构化引用,不能把它打回不可追踪的大字符串。
|
|
36
|
-
4. session 保存和加载后,外置化引用仍然可以恢复到落盘文件。
|
|
37
|
-
5. 已通过 streaming delta 发出的 assistant 文本不会在 finalize 阶段再次整段重放。
|
|
38
|
-
|
|
39
|
-
## 验证方式
|
|
40
|
-
|
|
41
|
-
1. fail-first 测试:
|
|
42
|
-
- `tests/runtime-lightweight-context.test.ts`
|
|
43
|
-
2. 核心回归:
|
|
44
|
-
- `npm run test:build`
|
|
45
|
-
- `npm run test:core`
|
|
46
|
-
3. 真实 API:
|
|
47
|
-
- `npm run verify:runtime-context-api`
|
|
48
|
-
## Checkpoint Runtime Contract
|
|
49
|
-
|
|
50
|
-
- `SessionRecord` now persists a structured `checkpoint` inside the existing session truth source.
|
|
51
|
-
- `checkpoint` is a runtime summary, not a transcript dump. It carries:
|
|
52
|
-
- objective
|
|
53
|
-
- completedSteps
|
|
54
|
-
- currentStep
|
|
55
|
-
- nextStep
|
|
56
|
-
- recentToolBatch
|
|
57
|
-
- flow phase (`active / continuation / resume / recovery`)
|
|
58
|
-
- priorityArtifacts (externalized tool-result refs, previews, pending paths)
|
|
59
|
-
- continuation, reload/resume, and dynamic prompt rendering must all consume the same checkpoint instead of inventing separate recovery hints.
|
|
60
|
-
- objective changes reset checkpoint progress so old work does not pollute the new task.
|
|
61
|
-
- externalized tool results remain the preferred recoverable context, and checkpoint keeps the references lightweight.
|
|
62
|
-
- fail-first test for this layer: `tests/runtime-checkpoint-resume.test.ts`
|
|
63
|
-
- real API verification entry for this layer: `npm run verify:runtime-checkpoint-api`
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# provider adapter
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
provider adapter 负责把 Athlete 的请求发送到具体模型服务。
|
|
6
|
-
|
|
7
|
-
## 当前策略
|
|
8
|
-
|
|
9
|
-
- 优先 OpenAI-compatible
|
|
10
|
-
- 运行时对网络错误、超时、上下文过长有恢复策略
|
|
11
|
-
|
|
12
|
-
## 规则
|
|
13
|
-
|
|
14
|
-
1. provider 能换,主循环不跟着重写。
|
|
15
|
-
2. provider 问题先在 adapter 层处理,不外溢到任务语义层。
|
|
16
|
-
3. 模型 fallback 属于运行时策略,不属于业务模块。
|
|
17
|
-
|
|
18
|
-
## 下一阶段要求
|
|
19
|
-
|
|
20
|
-
总指挥层不依赖某一家 provider 特性。
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# runtime metrics
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
这一层开始,Athlete 的 session 会持久化结构化 `runtimeStats`,
|
|
6
|
-
作为正式运行态仪表盘的真相源。
|
|
7
|
-
|
|
8
|
-
它回答的是:
|
|
9
|
-
|
|
10
|
-
- 这次 session 一共发了多少次 provider request
|
|
11
|
-
- 模型等待总耗时是多少
|
|
12
|
-
- tool 一共调用了多少次、各自累计耗时多少
|
|
13
|
-
- yield / continuation / recovery / compression 各发生了多少次
|
|
14
|
-
- 有多少 tool result 被 externalize,以及累计字节数是多少
|
|
15
|
-
- provider usage 是 available、partial 还是 unavailable
|
|
16
|
-
|
|
17
|
-
## 真相源位置
|
|
18
|
-
|
|
19
|
-
- `SessionRecord.runtimeStats`
|
|
20
|
-
- 仍然持久化在既有 session JSON 文件里
|
|
21
|
-
- 不新建平行 JSON 真相源
|
|
22
|
-
|
|
23
|
-
## 当前结构
|
|
24
|
-
|
|
25
|
-
`runtimeStats` 当前包含:
|
|
26
|
-
|
|
27
|
-
- `version`
|
|
28
|
-
- `model.requestCount`
|
|
29
|
-
- `model.waitDurationMsTotal`
|
|
30
|
-
- `model.usage.requestsWithUsage`
|
|
31
|
-
- `model.usage.requestsWithoutUsage`
|
|
32
|
-
- `model.usage.inputTokensTotal`
|
|
33
|
-
- `model.usage.outputTokensTotal`
|
|
34
|
-
- `model.usage.totalTokensTotal`
|
|
35
|
-
- `model.usage.reasoningTokensTotal`
|
|
36
|
-
- `tools.callCount`
|
|
37
|
-
- `tools.durationMsTotal`
|
|
38
|
-
- `tools.byName`
|
|
39
|
-
- `events.continuationCount`
|
|
40
|
-
- `events.yieldCount`
|
|
41
|
-
- `events.recoveryCount`
|
|
42
|
-
- `events.compressionCount`
|
|
43
|
-
- `externalizedToolResults.count`
|
|
44
|
-
- `externalizedToolResults.byteLengthTotal`
|
|
45
|
-
- `updatedAt`
|
|
46
|
-
|
|
47
|
-
## 来源
|
|
48
|
-
|
|
49
|
-
### model request
|
|
50
|
-
|
|
51
|
-
- 来源:`src/agent/api.ts`
|
|
52
|
-
- 统计粒度:真实 provider request attempt
|
|
53
|
-
- 包括 streaming、non-streaming fallback、retry、retry fallback
|
|
54
|
-
|
|
55
|
-
### tool execution
|
|
56
|
-
|
|
57
|
-
- 来源:`src/agent/runTurn.ts`
|
|
58
|
-
- 统计粒度:真实 runtime tool execution
|
|
59
|
-
- `tools.byName` 记录每个 tool 的调用次数、累计耗时、成功次数、失败次数
|
|
60
|
-
|
|
61
|
-
### yield / continuation / recovery
|
|
62
|
-
|
|
63
|
-
- 来源:`src/agent/turnPersistence.ts`
|
|
64
|
-
- continuation 包括:
|
|
65
|
-
- managed continuation 的内部续跑输入
|
|
66
|
-
- 用户显式 `continue` / `resume` 这类恢复输入
|
|
67
|
-
|
|
68
|
-
### compression
|
|
69
|
-
|
|
70
|
-
- 来源:`src/agent/runTurn.ts`
|
|
71
|
-
- 当 `buildRequestContext(...)` 返回 `compressed = true` 时记一次
|
|
72
|
-
|
|
73
|
-
### externalized tool results
|
|
74
|
-
|
|
75
|
-
- 来源:`src/agent/runTurn.ts` + `src/agent/toolResultStorage.ts`
|
|
76
|
-
- 只在 tool result 实际被 externalize 时累计
|
|
77
|
-
|
|
78
|
-
## 用户入口
|
|
79
|
-
|
|
80
|
-
当前最小仪表盘入口:
|
|
81
|
-
|
|
82
|
-
- `/runtime`
|
|
83
|
-
- `/stats`
|
|
84
|
-
- `/仪表盘`
|
|
85
|
-
|
|
86
|
-
这些命令只读取并格式化当前 session summary,
|
|
87
|
-
不发明新的运行态事实。
|
|
88
|
-
|
|
89
|
-
## 当前 summary 最少包含
|
|
90
|
-
|
|
91
|
-
- model request 次数
|
|
92
|
-
- model wait 总耗时
|
|
93
|
-
- tool call 次数
|
|
94
|
-
- tool 总耗时
|
|
95
|
-
- yields / continuations / recoveries / compressions
|
|
96
|
-
- externalized result count / bytes
|
|
97
|
-
- top tools
|
|
98
|
-
- slowest step
|
|
99
|
-
- usage availability
|
|
100
|
-
- session health
|
|
101
|
-
|
|
102
|
-
## usage 规则
|
|
103
|
-
|
|
104
|
-
- 只有 provider 明确返回 usage 时才记录 usage
|
|
105
|
-
- 如果 provider 没返回 usage,summary 必须显示 `unavailable` 或 `partial`
|
|
106
|
-
- 不根据字符数、消息数、模型名去估算 token
|
|
107
|
-
|
|
108
|
-
## 健康状态
|
|
109
|
-
|
|
110
|
-
当前 summary 会给出:
|
|
111
|
-
|
|
112
|
-
- `healthy`
|
|
113
|
-
- `warning`
|
|
114
|
-
- `recovering`
|
|
115
|
-
|
|
116
|
-
它来自 checkpoint phase、verification state、recovery 事件等正式状态的推导视图,
|
|
117
|
-
不是另一份单独持久化的状态。
|
|
118
|
-
|
|
119
|
-
## 真实验证
|
|
120
|
-
|
|
121
|
-
当前真实 API 验证入口:
|
|
122
|
-
|
|
123
|
-
- `npm run verify:runtime-observability-api`
|
|
124
|
-
|
|
125
|
-
它至少要确认:
|
|
126
|
-
|
|
127
|
-
- `runtimeStats` 已写进 session
|
|
128
|
-
- reload session 后 `runtimeStats` 仍然存在
|
|
129
|
-
- 真实 model request 被统计
|
|
130
|
-
- 真实 tool call 被统计
|
|
131
|
-
- 用户可读的 runtime summary 路径可用
|
|
132
|
-
- lightweight context 与 checkpoint runtime 没被打坏
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# runtime rules
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
运行时规则是 Athlete 的机器约束层。
|
|
6
|
-
|
|
7
|
-
## 当前包含
|
|
8
|
-
|
|
9
|
-
- 计划先行
|
|
10
|
-
- inbox 注入
|
|
11
|
-
- verification 状态机
|
|
12
|
-
- finalize / closeout gating
|
|
13
|
-
- continuation / compression
|
|
14
|
-
- tool error recovery
|
|
15
|
-
|
|
16
|
-
## 不该放进来的东西
|
|
17
|
-
|
|
18
|
-
- 具体任务拆分算法
|
|
19
|
-
- 具体 skill 内容
|
|
20
|
-
- 某个单一工具的内部实现
|
|
21
|
-
|
|
22
|
-
## 当前与收口直接相关的规则
|
|
23
|
-
|
|
24
|
-
- 变更型动作默认要求先 `todo_write`
|
|
25
|
-
- 文件改动和 mutating shell 会把 session 推进到 verification required
|
|
26
|
-
- 轻量交付物允许用定向 `read_file` / auto-readback 完成轻量验证
|
|
27
|
-
- continuation 后仍然读取持久化的 `pendingPaths`,不会因为 slice 切换就忘记“还有哪些输出待验”
|
|
28
|
-
- 当收口条件已满足时,task board closeout 工具会被隐藏,避免 `task_list` / `task_get` / `task_update` 无意义循环
|
|
29
|
-
- 当 todo 已全部完成时,runtime 不再继续鼓励补写 `todo_write`
|
|
30
|
-
|
|
31
|
-
## 下一阶段要求
|
|
32
|
-
|
|
33
|
-
总指挥层可以提出“下一步做什么”,但运行时规则仍决定“现在允不允许这样做”。
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# session / resume / compact
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
这一层负责保护 Athlete 的“长任务可继续”能力。
|
|
6
|
-
|
|
7
|
-
## 当前能力
|
|
8
|
-
|
|
9
|
-
- session 持久化
|
|
10
|
-
- resume 继续最近任务现场
|
|
11
|
-
- request context 压缩
|
|
12
|
-
- continuation 自动续跑
|
|
13
|
-
- todo / taskState / verificationState 跨 slice 持续生效
|
|
14
|
-
|
|
15
|
-
## 当前边界
|
|
16
|
-
|
|
17
|
-
Athlete 当前的记忆重点是:
|
|
18
|
-
|
|
19
|
-
- 当前项目
|
|
20
|
-
- 当前任务
|
|
21
|
-
- 当前 turn 相关状态
|
|
22
|
-
- 当前待验证输出 `pendingPaths`
|
|
23
|
-
- 最近一次 verification 结果
|
|
24
|
-
|
|
25
|
-
它不是跨项目的人格记忆。
|
|
26
|
-
|
|
27
|
-
## 当前实现约束
|
|
28
|
-
|
|
29
|
-
- continuation 会复用已有 session,而不是重新发明 todo / verification 状态。
|
|
30
|
-
- compact 只压缩请求上下文,不抹掉任务板、todo、verification 这些真相源。
|
|
31
|
-
- 收口判断可以依赖持久化的 `verificationState.pendingPaths`,不能只看当前 slice 的临时 `changedPaths`。
|
|
32
|
-
|
|
33
|
-
## Resume / Reset Contract
|
|
34
|
-
|
|
35
|
-
- `resume` 的语义是继续现有任务现场。
|
|
36
|
-
- `quit` 只是退出当前聊天窗口,不主动清空项目运行时状态。
|
|
37
|
-
- 显式 `reset` 会清空当前项目 `.athlete/` 下的运行时状态,并删除当前项目相关的持久化 session。
|
|
38
|
-
- 一旦 `reset` 成功,`resume` 不应恢复已经 reset 掉的运行时。
|
|
39
|
-
- 如果 objective 明确变化,checkpoint 进度必须重置,避免旧任务进度污染新任务。
|
|
40
|
-
- externalized tool-result references 和 verification pending paths 仍然是优先的可恢复锚点,但 reset 会主动销毁这一层锚点。
|
|
41
|
-
|
|
42
|
-
## 下一阶段要求
|
|
43
|
-
|
|
44
|
-
未来可以增加更强的恢复能力,但必须遵守:
|
|
45
|
-
|
|
46
|
-
1. 项目事实优先于抽象记忆。
|
|
47
|
-
2. 记忆是辅助,不是第二真相源。
|
|
48
|
-
3. 不能破坏现有 continuation / compact / resume 的稳定边界。
|
|
49
|
-
4. destructive reset 必须保持显式、可理解、不可与普通 quit 混淆。
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# task state
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
任务状态是 Athlete 控制面的核心。
|
|
6
|
-
|
|
7
|
-
## 当前字段重点
|
|
8
|
-
|
|
9
|
-
- `status`
|
|
10
|
-
- `blockedBy`
|
|
11
|
-
- `blocks`
|
|
12
|
-
- `assignee`
|
|
13
|
-
- `owner`
|
|
14
|
-
- `checklist`
|
|
15
|
-
- `worktree`
|
|
16
|
-
|
|
17
|
-
## 当前规则
|
|
18
|
-
|
|
19
|
-
1. `assignee` 表示应该谁做。
|
|
20
|
-
2. `owner` 表示现在谁正在做。
|
|
21
|
-
3. 被阻塞任务不能启动。
|
|
22
|
-
4. 已完成任务不能随意重开。
|
|
23
|
-
|
|
24
|
-
## 下一阶段演进方向
|
|
25
|
-
|
|
26
|
-
任务系统要支持总指挥层,优先考虑增加:
|
|
27
|
-
|
|
28
|
-
- 优先级
|
|
29
|
-
- 父子任务
|
|
30
|
-
- 重试次数
|
|
31
|
-
- 产物引用
|
|
32
|
-
- review / verify 要求
|
|
33
|
-
|
|
34
|
-
这些演进必须建立在现有持久化任务板上,而不是另起一套任务宇宙。
|