@jun133/athlete 0.0.5 → 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 +151 -98
- package/dist/cli.js +24213 -20514
- package/dist/cli.js.map +1 -1
- package/package.json +3 -1
- package/scripts/postinstall-playwright.mjs +10 -10
- 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 +5 -5
- 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 +5 -5
- 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 +12 -12
- 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/{principles/P18- → /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 -37
- package/spec/{principles/P20- → /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 -48
- package/spec/{principles/P21- → /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 -46
- package/spec/{principles/P22- → /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 -40
- package/spec/{principles/P23- → /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 -38
- package/spec/{principles/P24- → /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 -37
- 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 -115
- package/spec/architecture//347/212/266/346/200/201/344/270/216/347/234/237/347/233/270/346/272/220.md +0 -120
- package/spec/architecture//350/277/220/350/241/214/346/227/266/345/276/252/347/216/257.md +0 -139
- 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 -176
- package/spec/interfaces/InteractionShell.md +0 -93
- 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 -77
- package/spec/modules/interactive-terminal.md +0 -139
- package/spec/modules/lightweight-context-runtime.md +0 -80
- package/spec/modules/provider-adapter.md +0 -45
- package/spec/modules/runtime-metrics.md +0 -162
- package/spec/modules/runtime-rules.md +0 -65
- package/spec/modules/session-resume-compact.md +0 -55
- package/spec/modules/task-state.md +0 -41
- package/spec/modules/telegram-private-chat.md +0 -291
- package/spec/modules/tool-registry.md +0 -137
- 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 -141
- package/spec/overview/v0/350/214/203/345/233/264.md +0 -55
- package/spec/overview//344/272/247/345/223/201/345/256/232/344/271/211.md +0 -61
- 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/README.md +0 -47
- 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 -108
- /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,176 +0,0 @@
|
|
|
1
|
-
# 目录结构到代码文件映射表
|
|
2
|
-
|
|
3
|
-
## 当前主要目录
|
|
4
|
-
|
|
5
|
-
- `src/agent/`: 主循环与稳定 façade
|
|
6
|
-
- `src/agent/provider.ts`: provider capability profile、request body 组装、provider fallback / recovery model 选择
|
|
7
|
-
- `src/agent/checkpoint/`: checkpoint 归一化、推导、resume 输入、prompt block
|
|
8
|
-
- `src/agent/context/`: request context 组装与压缩
|
|
9
|
-
- `src/agent/session/`: session message / todo / task state / session store 真相整理
|
|
10
|
-
- `src/agent/toolResults/`: tool result preview、transport 压缩、externalize 落盘
|
|
11
|
-
- `src/agent/turn/`: managed turn、closeout、finalize、tool execution、loop / recovery 辅助
|
|
12
|
-
- `src/agent/verification/`: verification state 与 lightweight / auto-readback signals
|
|
13
|
-
- `src/agent/acceptance/signals.ts`: acceptance signal 归一化
|
|
14
|
-
- `src/agent/runtimeMetrics/`: runtime metrics 累积与 runtime summary
|
|
15
|
-
- `src/tools/`: 模型可见工具与 handler
|
|
16
|
-
- `src/tools/governance.ts`: 工具治理 metadata、fail-closed 默认、result signal 校验
|
|
17
|
-
- `src/tools/routing.ts`: 文档 / spreadsheet 专用工具路由 hint
|
|
18
|
-
- `src/skills/`: skill schema、discovery、matching、loading、workflow guard
|
|
19
|
-
- `src/mcp/`: MCP 总接入层
|
|
20
|
-
- `src/mcp/playwright/`: Playwright MCP 配置、路径、artifact、调用归一化
|
|
21
|
-
- `src/context/`: repo root、state root、AGENTS、skills、ignore 发现
|
|
22
|
-
- `src/config/`: 配置读取、环境变量、runtime config、app paths
|
|
23
|
-
- `src/tasks/`: 持久化 task 真相源
|
|
24
|
-
- `src/team/`: teammate、消息、协议、policy
|
|
25
|
-
- `src/background/`: 后台任务
|
|
26
|
-
- `src/worktrees/`: 目录隔离
|
|
27
|
-
- `src/orchestrator/`: lead 编排、任务图、lifecycle 派生、route / dispatch
|
|
28
|
-
- `src/subagent/`: 一次性子智能体
|
|
29
|
-
- `src/interaction/`: 共享交互控制层与 shell 契约
|
|
30
|
-
- `src/interaction/exitGuard.ts`: 交互退出前的后台进程检查与 kill-or-continue 语义
|
|
31
|
-
- `src/shell/cli/`: CLI shell 输入、输出、turn 展示、intro
|
|
32
|
-
- `src/ui/`: CLI 文本格式化、runtime summary 和兼容导出
|
|
33
|
-
- `src/telegram/`: Telegram 私聊通道、delivery、附件、CLI、process lock
|
|
34
|
-
- `src/weixin/`: Weixin 私聊通道、OpeniLink client、delivery、context_token、CLI、process lock
|
|
35
|
-
|
|
36
|
-
## 当前 lightweight context 对应代码
|
|
37
|
-
|
|
38
|
-
- `src/agent/promptSections.ts`: prompt facade,对外保留 static / dynamic layer 入口
|
|
39
|
-
- `src/agent/prompt/static.ts`: 静态 operating contract 分块
|
|
40
|
-
- `src/agent/prompt/dynamic.ts`: 动态 runtime 摘要与空状态瘦身
|
|
41
|
-
- `src/agent/prompt/format.ts`: prompt block 渲染与 memory append
|
|
42
|
-
- `src/agent/prompt/structured.ts`: 结构化字段/摘要 section 到 prompt block 的统一渲染
|
|
43
|
-
- `src/agent/prompt/metrics.ts`: prompt layer char / block metrics
|
|
44
|
-
- `src/agent/prompt/requestDiagnostics.ts`: request-time prompt/context diagnostics
|
|
45
|
-
- `src/agent/prompt/types.ts`: prompt layer 类型
|
|
46
|
-
- `src/agent/context.ts`: context / tool-results cluster 入口
|
|
47
|
-
- `src/agent/context/builder.ts`: 使用轻量 payload 的请求上下文构建
|
|
48
|
-
- `src/agent/toolResults/storage.ts`: externalized tool result 落盘
|
|
49
|
-
- `src/agent/toolResults/preview.ts`: tool payload 预览与 transport 压缩
|
|
50
|
-
- `src/tools/files/toolResultArtifact.ts`: `.athlete/tool-results/...` 的紧凑 artifact read
|
|
51
|
-
|
|
52
|
-
## 当前 checkpoint / continuation 对应代码
|
|
53
|
-
|
|
54
|
-
- `src/agent/checkpoint.ts`: checkpoint 对外导出面
|
|
55
|
-
- `src/agent/checkpoint/base.ts`: checkpoint 默认结构与从 session 派生
|
|
56
|
-
- `src/agent/checkpoint/state.ts`: checkpoint 归一化与生命周期更新
|
|
57
|
-
- `src/agent/checkpoint/transitions.ts`: checkpoint 上的 yield / recovery / pause / finalize 等转移落盘
|
|
58
|
-
- `src/agent/checkpoint/derivation.ts`: completedSteps / nextStep / artifact 推导
|
|
59
|
-
- `src/agent/checkpoint/prompt.ts`: checkpoint 恢复输入与 prompt block
|
|
60
|
-
- `src/agent/turn.ts`: turn cluster 入口
|
|
61
|
-
- `src/agent/turn/persistence.ts`: turn 开始、yield、recovery、tool batch 的 session 持久化接线
|
|
62
|
-
- `src/agent/turn/managed.ts`: continuation 输入通过 checkpoint 生成
|
|
63
|
-
|
|
64
|
-
## 当前 runtime transition 对应代码
|
|
65
|
-
|
|
66
|
-
- `src/agent/runtimeTransition.ts`: runtime transition 对外导出面
|
|
67
|
-
- `src/agent/runtimeTransition/flow.ts`: transition 归一化、checkpoint flow 派生、phase 计算
|
|
68
|
-
- `src/agent/runtimeTransition/builders.ts`: continue / recover / yield / pause / finalize 的结构化 reason builder
|
|
69
|
-
- `src/agent/runtimeTransition/shared.ts`: transition 归一化共享辅助
|
|
70
|
-
|
|
71
|
-
## 当前 runtime metrics / 仪表盘 对应代码
|
|
72
|
-
|
|
73
|
-
- `src/agent/runtimeMetrics.ts`: runtime metrics 对外导出面
|
|
74
|
-
- `src/agent/runtimeMetrics/state.ts`: `runtimeStats` 归一化与事件累积
|
|
75
|
-
- `src/agent/runtimeMetrics/summary.ts`: session runtime summary 生成
|
|
76
|
-
- `src/agent/runtimeMetrics/diagnostics.ts`: durable truth / derived diagnostics 拆分与解释生成
|
|
77
|
-
- `src/agent/api.ts`: provider request timing 与 provider usage 采集
|
|
78
|
-
- `src/agent/provider.ts`: provider-specific request body / fallback / recovery policy 下沉
|
|
79
|
-
- `src/agent/runTurn.ts`: tool execution、compression、recovery 等运行事件统计接线
|
|
80
|
-
- `src/ui/runtimeSummary.ts`: 交互态 runtime summary 文本格式化
|
|
81
|
-
- `src/ui/runtimeSummaryData.ts`: `/runtime` 命令的 request-time prompt diagnostics 组装
|
|
82
|
-
- `src/interaction/localCommands.ts`: 共享本地命令语义与 `/runtime` / `/stats` / `/仪表盘` 路由
|
|
83
|
-
- `src/ui/localCommands.ts`: CLI 默认输出适配与薄导出
|
|
84
|
-
|
|
85
|
-
## 当前 session / task-state 对应代码
|
|
86
|
-
|
|
87
|
-
- `src/agent/session.ts`: session cluster 入口
|
|
88
|
-
- `src/agent/session/messages.ts`: stored message / chat message 归一化
|
|
89
|
-
- `src/agent/session/store.ts`: session 落盘与恢复
|
|
90
|
-
- `src/agent/session/taskState.ts`: session task-state 提取与 internal reminder
|
|
91
|
-
- `src/agent/session/taskStateHistory.ts`: 从消息历史派生活跃文件、计划动作、完成动作、blocker
|
|
92
|
-
- `src/agent/session/todos.ts`: todo 真相提取、格式化与 normalize
|
|
93
|
-
|
|
94
|
-
## 当前交互 shell 对应代码
|
|
95
|
-
|
|
96
|
-
- `src/interaction/sessionDriver.ts`: 共享交互 session loop、multiline、interrupt、turn 生命周期
|
|
97
|
-
- `src/interaction/exitGuard.ts`: 交互退出时列出 background job / teammate worker,并执行 kill-or-continue 分支
|
|
98
|
-
- `src/interaction/shell.ts`: `InteractionShell` / `ShellInputPort` / `ShellOutputPort` / `InteractionTurnDisplay`
|
|
99
|
-
- `src/shell/cli/readlineInput.ts`: CLI 输入适配
|
|
100
|
-
- `src/shell/cli/output.ts`: CLI 文本输出适配
|
|
101
|
-
- `src/shell/cli/turnDisplay.ts`: CLI spinner + stream renderer 适配
|
|
102
|
-
- `src/shell/cli/intro.ts`: CLI banner 与 launch hints
|
|
103
|
-
- `src/shell/cli/shell.ts`: CLI shell 组装
|
|
104
|
-
- `src/ui/interactive.ts`: CLI 入口薄壳,组装 shell 并启动共享 driver
|
|
105
|
-
|
|
106
|
-
## 当前 Playwright MCP 对应代码
|
|
107
|
-
|
|
108
|
-
- `src/mcp/config.ts`: MCP 配置归一化
|
|
109
|
-
- `src/mcp/playwright/config.ts`: Playwright MCP 配置归一化与 server args
|
|
110
|
-
- `src/mcp/playwright/paths.ts`: `.athlete/playwright-mcp/` 路径约定
|
|
111
|
-
- `src/mcp/playwright/artifacts.ts`: artifact 目录准备、迁移、生成配置
|
|
112
|
-
- `src/mcp/playwright/invoke.ts`: relative filename 归一化
|
|
113
|
-
- `src/mcp/stdioClient.ts`: 真实 stdio MCP client
|
|
114
|
-
- `src/mcp/toolAdapter.ts`: MCP tool 适配进 Athlete registry,并补充治理所需 origin 信息
|
|
115
|
-
- `src/tools/runtimeRegistry.ts`: runtime registry 组装 built-in tools 与 MCP tools,并保留 blocked diagnostics
|
|
116
|
-
- `src/tools/registry.ts`: fail-closed tool registry、entries / blocked 暴露面与 result governance 校验
|
|
117
|
-
|
|
118
|
-
## 当前 closeout / verification 对应代码
|
|
119
|
-
|
|
120
|
-
- `src/agent/turn.ts`: closeout / finalize cluster 入口
|
|
121
|
-
- `src/agent/turn/finalize.ts`: tool-less turn 的最终收口与 verification / pause 行为
|
|
122
|
-
- `src/agent/turn/closeout.ts`: closeout 阶段的工具过滤与 stale todo 容忍规则
|
|
123
|
-
- `src/agent/verification.ts`: verification cluster 入口
|
|
124
|
-
- `src/agent/verification/state.ts`: verification 真相源
|
|
125
|
-
- `src/agent/verification/signals.ts`: lightweight verification signals 与 auto-readback
|
|
126
|
-
- `src/agent/acceptance/signals.ts`: `http_endpoint_verified` / `web_page_verified` / `document_read_completed` / `structured_artifact_valid`
|
|
127
|
-
- `src/cli/support.ts`: one-shot closeout report 生成
|
|
128
|
-
- `src/cli.ts`: one-shot terminal closeout JSON 输出
|
|
129
|
-
- `src/agent/runTurn.ts`: 调度这些规则,但不持有它们的内部实现细节
|
|
130
|
-
|
|
131
|
-
## 当前 turn / loop 辅助代码
|
|
132
|
-
|
|
133
|
-
- `src/agent/turn.ts`: turn / loop helper cluster 入口
|
|
134
|
-
- `src/agent/turn/recovery.ts`: API 重试、content-policy redaction、context shrink
|
|
135
|
-
- `src/agent/turn/planGate.ts`: mutating tool 的 todo 前置约束
|
|
136
|
-
- `src/agent/turn/loopGuard.ts`: 重复工具调用保护
|
|
137
|
-
- `src/agent/turn/toolExecutor.ts`: tool 执行与 recovery hint
|
|
138
|
-
- `src/agent/turn/toolless.ts`: 缺 skill / finalize 收口分发
|
|
139
|
-
- `src/agent/turn/state.ts`: request 内 turn 状态 prompt block 与进度提示
|
|
140
|
-
|
|
141
|
-
## 当前任务编排 / lifecycle 对应代码
|
|
142
|
-
|
|
143
|
-
- `src/orchestrator/prepareLeadTurn.ts`: lead slice 开始前的 orchestrator 入口
|
|
144
|
-
- `src/orchestrator/analyze.ts`: objective / complexity / handoff 意图判断
|
|
145
|
-
- `src/orchestrator/taskPlanning.ts`: 最小任务图落盘
|
|
146
|
-
- `src/orchestrator/taskLifecycle.ts`: 从 task / team / background / worktree 真相源派生 task lifecycle
|
|
147
|
-
- `src/orchestrator/taskLifecycleShared.ts`: lifecycle 构造与 handoff 共享辅助
|
|
148
|
-
- `src/orchestrator/progress.ts`: 读取 durable truth 并构造 progress snapshot
|
|
149
|
-
- `src/orchestrator/route.ts`: 只消费 lifecycle 后的 ready / active / blocked 事实做 route
|
|
150
|
-
- `src/orchestrator/dispatch.ts`: 派工落盘与 fail-closed handoff 检查
|
|
151
|
-
- `src/tools/tasks/claimTaskTool.ts`: teammate claim + worktree fail-closed 入口
|
|
152
|
-
|
|
153
|
-
## 当前文档 / 验证位置
|
|
154
|
-
|
|
155
|
-
- `skills/web-research/SKILL.md`
|
|
156
|
-
- `skills/browser-automation/SKILL.md`
|
|
157
|
-
- `spec/modules/lightweight-context-runtime.md`
|
|
158
|
-
- `spec/modules/session-resume-compact.md`
|
|
159
|
-
- `spec/modules/runtime-metrics.md`
|
|
160
|
-
- `tests/playwright-mcp.test.ts`
|
|
161
|
-
- `tests/browser-tool-priority.test.ts`
|
|
162
|
-
- `tests/playwright-workflow-guard.test.ts`
|
|
163
|
-
- `tests/browser-workflow-abstraction.test.ts`
|
|
164
|
-
- `tests/agent-closeout.test.ts`
|
|
165
|
-
- `tests/interaction-shell.test.ts`
|
|
166
|
-
- `tests/provider-capability.test.ts`
|
|
167
|
-
- `tests/document-workflow-abstraction.test.ts`
|
|
168
|
-
- `tests/acceptance-signal.test.ts`
|
|
169
|
-
- `tests/one-shot-cli-result-contract.test.ts`
|
|
170
|
-
- `tests/runtime-lightweight-context.test.ts`
|
|
171
|
-
- `tests/runtime-checkpoint-resume.test.ts`
|
|
172
|
-
- `tests/runtime-observability.test.ts`
|
|
173
|
-
- `scripts/verify-runtime-lightweight-context-api.mjs`
|
|
174
|
-
- `scripts/verify-runtime-checkpoint-api.mjs`
|
|
175
|
-
- `scripts/verify-runtime-observability-api.mjs`
|
|
176
|
-
- `validation/`
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# InteractionShell
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
`InteractionShell` 是共享交互控制层和具体外壳之间的正式边界。
|
|
6
|
-
|
|
7
|
-
它让 Athlete 的交互 session loop 可以复用同一个大脑,同时替换 CLI、桌面等不同壳。
|
|
8
|
-
|
|
9
|
-
## 当前真实能力
|
|
10
|
-
|
|
11
|
-
### 参与者
|
|
12
|
-
|
|
13
|
-
- `InteractiveSessionDriver`: 共享交互控制器
|
|
14
|
-
- `InteractionShell`: 壳总接口
|
|
15
|
-
- `ShellInputPort`: 输入端口
|
|
16
|
-
- `ShellOutputPort`: 输出端口
|
|
17
|
-
- `InteractionTurnDisplay`: turn 展示端口
|
|
18
|
-
|
|
19
|
-
### 当前契约语义
|
|
20
|
-
|
|
21
|
-
#### `ShellInputPort`
|
|
22
|
-
|
|
23
|
-
负责:
|
|
24
|
-
|
|
25
|
-
- 读取普通输入
|
|
26
|
-
- 读取 multiline 输入
|
|
27
|
-
- 绑定 interrupt 事件
|
|
28
|
-
- 为共享 driver 提供退出确认时所需的普通输入
|
|
29
|
-
|
|
30
|
-
不负责:
|
|
31
|
-
|
|
32
|
-
- 决定 task / runtime 真相
|
|
33
|
-
- 自己执行 agent turn
|
|
34
|
-
|
|
35
|
-
#### `ShellOutputPort`
|
|
36
|
-
|
|
37
|
-
负责:
|
|
38
|
-
|
|
39
|
-
- 输出 `plain / info / warn / error / dim / heading / tool / interrupt`
|
|
40
|
-
- 保持壳自己的展示风格
|
|
41
|
-
|
|
42
|
-
不负责:
|
|
43
|
-
|
|
44
|
-
- 修改 session 真相
|
|
45
|
-
- 决定本地命令语义
|
|
46
|
-
|
|
47
|
-
#### `InteractionTurnDisplay`
|
|
48
|
-
|
|
49
|
-
负责:
|
|
50
|
-
|
|
51
|
-
- 接收 turn 生命周期内的 `AgentCallbacks`
|
|
52
|
-
- 展示流式 assistant / reasoning / tool 状态
|
|
53
|
-
- 在 turn 结束或中断时 flush / dispose
|
|
54
|
-
|
|
55
|
-
#### `InteractionShell`
|
|
56
|
-
|
|
57
|
-
负责把上面三部分组装给共享 driver 使用。
|
|
58
|
-
|
|
59
|
-
共享 driver 可以基于这套输入/输出契约实现:
|
|
60
|
-
|
|
61
|
-
- 普通命令输入
|
|
62
|
-
- multiline 输入
|
|
63
|
-
- interrupt
|
|
64
|
-
- quit 前二次确认
|
|
65
|
-
|
|
66
|
-
## 当前 CLI 实现
|
|
67
|
-
|
|
68
|
-
- `src/shell/cli/readlineInput.ts`
|
|
69
|
-
- `src/shell/cli/output.ts`
|
|
70
|
-
- `src/shell/cli/turnDisplay.ts`
|
|
71
|
-
- `src/shell/cli/shell.ts`
|
|
72
|
-
|
|
73
|
-
CLI 当前通过这些适配器接入:
|
|
74
|
-
|
|
75
|
-
- `readline`
|
|
76
|
-
- `process.stdin` / `process.stdout`
|
|
77
|
-
- `chalk`
|
|
78
|
-
- spinner / stream renderer
|
|
79
|
-
|
|
80
|
-
这些都必须留在 CLI shell 内,不进入共享 driver。
|
|
81
|
-
|
|
82
|
-
## 规则
|
|
83
|
-
|
|
84
|
-
1. `InteractiveSessionDriver` 不能依赖 `readline`、stdio、`chalk`。
|
|
85
|
-
2. shell 只能提供输入、输出和 turn 展示适配,不能把控制面状态偷搬到壳里。
|
|
86
|
-
3. 本地命令的语义应落在共享交互层,shell 只负责把结果显示出来。
|
|
87
|
-
4. interrupt 的来源可以因壳不同而不同,但共享 driver 的 abort 语义必须一致。
|
|
88
|
-
|
|
89
|
-
## 未来方向
|
|
90
|
-
|
|
91
|
-
- 桌面壳可以实现自己的 `ShellInputPort`,例如输入框提交、多行编辑器、停止按钮。
|
|
92
|
-
- 桌面壳可以实现自己的 `ShellOutputPort` / `InteractionTurnDisplay`,例如富文本消息区和状态面板。
|
|
93
|
-
- 未来如果出现 web / mobile 壳,也应优先复用这组契约,而不是复制一套 session loop。
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# ProviderAdapter
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
ProviderAdapter 把 Athlete 的请求发送到具体模型服务,并返回统一结果。
|
|
6
|
-
|
|
7
|
-
## 最小职责
|
|
8
|
-
|
|
9
|
-
- 接收消息数组
|
|
10
|
-
- 接收模型名
|
|
11
|
-
- 接收工具定义
|
|
12
|
-
- 返回 assistant 文本、reasoning、tool calls
|
|
13
|
-
- 对常见 provider 错误提供可恢复语义
|
|
14
|
-
|
|
15
|
-
## 不负责
|
|
16
|
-
|
|
17
|
-
- 任务拆分
|
|
18
|
-
- 控制面状态判断
|
|
19
|
-
- 工具执行
|
|
20
|
-
|
|
21
|
-
## 稳定边界
|
|
22
|
-
|
|
23
|
-
只要 adapter 还能提供统一输出,底层 provider 可以继续替换。
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# 接口契约
|
|
2
|
-
|
|
3
|
-
这一组文档不追求把所有 TypeScript 细节抄一遍。
|
|
4
|
-
|
|
5
|
-
它们只说明 Athlete 内核最关键的抽象边界:
|
|
6
|
-
|
|
7
|
-
- provider adapter
|
|
8
|
-
- runtime loop
|
|
9
|
-
- session store
|
|
10
|
-
- tool registry
|
|
11
|
-
- interaction shell
|
|
12
|
-
|
|
13
|
-
## 使用规则
|
|
14
|
-
|
|
15
|
-
1. 接口文档写稳定边界,不写瞬时实现细节。
|
|
16
|
-
2. 新能力优先问“该落在哪个接口”,再问“该落在哪个文件”。
|
|
17
|
-
3. 如果某个改动让接口职责明显变混,优先拆接口。
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# RuntimeLoop
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
RuntimeLoop 负责驱动一个 turn,直到:
|
|
6
|
-
|
|
7
|
-
- 完成
|
|
8
|
-
- 暂停
|
|
9
|
-
- yield
|
|
10
|
-
- 报错
|
|
11
|
-
|
|
12
|
-
## 最小职责
|
|
13
|
-
|
|
14
|
-
- 组装请求上下文
|
|
15
|
-
- 读运行时状态
|
|
16
|
-
- 调模型
|
|
17
|
-
- 执行工具
|
|
18
|
-
- 处理 continuation / compact / verification
|
|
19
|
-
|
|
20
|
-
## 不负责
|
|
21
|
-
|
|
22
|
-
- 保存长期任务真相
|
|
23
|
-
- 发明新工具
|
|
24
|
-
- 实现具体业务流程
|
|
25
|
-
|
|
26
|
-
## 下一阶段要求
|
|
27
|
-
|
|
28
|
-
总指挥层可以成为 loop 的上游决策来源,但不能把 RuntimeLoop 变成一个巨大的业务文件。
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# SessionStore
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
SessionStore 负责保存和恢复任务现场。
|
|
6
|
-
|
|
7
|
-
## 最小职责
|
|
8
|
-
|
|
9
|
-
- 创建 session
|
|
10
|
-
- 追加消息
|
|
11
|
-
- 保存 todo / verification / taskState
|
|
12
|
-
- 加载既有 session
|
|
13
|
-
|
|
14
|
-
## 不负责
|
|
15
|
-
|
|
16
|
-
- 任务板真相
|
|
17
|
-
- teammate roster
|
|
18
|
-
- worktree 生命周期
|
|
19
|
-
|
|
20
|
-
## 关键要求
|
|
21
|
-
|
|
22
|
-
session 恢复不能破坏 Athlete 的耐跑能力。
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# ToolRegistry
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
ToolRegistry 负责统一管理模型可见工具。
|
|
6
|
-
|
|
7
|
-
## 最小职责
|
|
8
|
-
|
|
9
|
-
- 返回工具定义
|
|
10
|
-
- 按名称执行工具
|
|
11
|
-
- 根据 mode / runtime 过滤工具集
|
|
12
|
-
|
|
13
|
-
## 不负责
|
|
14
|
-
|
|
15
|
-
- provider 请求
|
|
16
|
-
- session 存储
|
|
17
|
-
- 任务真相维护
|
|
18
|
-
|
|
19
|
-
## 关键要求
|
|
20
|
-
|
|
21
|
-
无论未来 tools、skills、MCP 怎么扩,模型看到的动作入口都要保持统一。
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# config system
|
|
2
|
-
|
|
3
|
-
## 作用
|
|
4
|
-
|
|
5
|
-
配置系统负责统一读取 Athlete 的运行参数,并把项目级默认值、用户配置和环境变量合并成最终 runtime config。
|
|
6
|
-
|
|
7
|
-
## 当前范围
|
|
8
|
-
|
|
9
|
-
- provider / 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
|
-
## provider 当前事实
|
|
24
|
-
|
|
25
|
-
当前统一入口会解析:
|
|
26
|
-
|
|
27
|
-
- `ATHLETE_PROVIDER`
|
|
28
|
-
- `ATHLETE_API_KEY`
|
|
29
|
-
- `ATHLETE_BASE_URL`
|
|
30
|
-
- `ATHLETE_MODEL`
|
|
31
|
-
|
|
32
|
-
代码默认值与模板示例仍以 DeepSeek 系列为起点,但这只是默认配置/示例,不是 runtime kernel 绑定。
|
|
33
|
-
项目本地 `.athlete/.env` 可以把有效 provider / base URL / model 覆盖到别的 OpenAI-compatible 服务。
|
|
34
|
-
|
|
35
|
-
## Playwright MCP 当前事实
|
|
36
|
-
|
|
37
|
-
当前支持的 repo 级 Playwright MCP 环境变量:
|
|
38
|
-
|
|
39
|
-
- `ATHLETE_MCP_ENABLED`
|
|
40
|
-
- `ATHLETE_MCP_PLAYWRIGHT_ENABLED`
|
|
41
|
-
- `ATHLETE_MCP_PLAYWRIGHT_BROWSER`
|
|
42
|
-
- `ATHLETE_MCP_PLAYWRIGHT_HEADLESS`
|
|
43
|
-
- `ATHLETE_MCP_PLAYWRIGHT_OUTPUT_MODE`
|
|
44
|
-
- `ATHLETE_MCP_PLAYWRIGHT_SAVE_SESSION`
|
|
45
|
-
|
|
46
|
-
当前代码默认值:
|
|
47
|
-
|
|
48
|
-
- 代码默认值是关闭
|
|
49
|
-
- 默认浏览器为 `chromium`
|
|
50
|
-
- 默认不是 headless
|
|
51
|
-
- 默认 output mode 为 `stdout`
|
|
52
|
-
- 默认 save session 为开启
|
|
53
|
-
|
|
54
|
-
当前项目模板行为:
|
|
55
|
-
|
|
56
|
-
- `src/config/init.ts` 生成的 `.athlete/.env` / `.athlete/.env.example` 会给出一组 repo 级 Playwright MCP 示例开关
|
|
57
|
-
- 项目本地真实 `.athlete/.env` 可以进一步覆盖这些有效值
|
|
58
|
-
|
|
59
|
-
## 路径约定
|
|
60
|
-
|
|
61
|
-
当前 Playwright MCP 状态目录:
|
|
62
|
-
|
|
63
|
-
- `.athlete/playwright-mcp/config.json`
|
|
64
|
-
- `.athlete/playwright-mcp/profile/`
|
|
65
|
-
- `.athlete/playwright-mcp/output/`
|
|
66
|
-
- `.athlete/playwright-mcp/legacy-root-artifacts/`
|
|
67
|
-
|
|
68
|
-
这些路径由配置系统和 `src/mcp/playwright/` 统一导出,不允许在调用侧随意拼接。
|
|
69
|
-
|
|
70
|
-
## 当前代码落点
|
|
71
|
-
|
|
72
|
-
- `src/config/store.ts`
|
|
73
|
-
- runtime config 合并入口
|
|
74
|
-
- `src/config/init.ts`
|
|
75
|
-
- `.athlete/.env` / `.athlete/.env.example` 模板
|
|
76
|
-
- `src/agent/provider.ts`
|
|
77
|
-
- provider capability profile 消费 config 中的 provider/model
|
|
@@ -1,139 +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
|
-
- 在 `quit / q / exit` 时检查当前项目仍在运行的后台进程,并做退出确认
|
|
21
|
-
- 管理 turn in-flight 状态与 abort controller 生命周期
|
|
22
|
-
- 接线 `runManagedAgentTurn`
|
|
23
|
-
- 维护当前 session 的内存态,并在 turn 完成后接收最新 session
|
|
24
|
-
|
|
25
|
-
### 当前 CLI shell 职责
|
|
26
|
-
|
|
27
|
-
- 提供 persistent input / multiline input
|
|
28
|
-
- 绑定终端 interrupt
|
|
29
|
-
- 展示 assistant 流式输出
|
|
30
|
-
- 展示 tool 调用和状态消息
|
|
31
|
-
- 展示 banner、launch hints、dim/warn/plain/stderr 风格
|
|
32
|
-
- 展示当前 session 的 runtime summary
|
|
33
|
-
|
|
34
|
-
## 规则
|
|
35
|
-
|
|
36
|
-
1. UI 不能反向定义 task、protocol、worktree、checkpoint、runtimeStats 等控制面事实。
|
|
37
|
-
2. spinner、stream renderer、本地命令格式化都只属于表现层。
|
|
38
|
-
3. Athlete 可以替换 UI,但不能因此破坏 runtime kernel。
|
|
39
|
-
4. `/runtime`、`/stats`、`/仪表盘` 只是 `SessionRecord.runtimeStats` 的只读 summary 视图。
|
|
40
|
-
5. UI 可以读取并展示真相源,但不能绕过真相源另造状态。
|
|
41
|
-
6. 交互 session loop 不能直接绑死 `readline`、`process.stdin/stdout`、`chalk` 这类 CLI 细节。
|
|
42
|
-
7. shell 只能提供输入、输出和 turn 展示适配,不能自己发明 task / protocol / runtime 真相。
|
|
43
|
-
|
|
44
|
-
## Quit Boundary
|
|
45
|
-
|
|
46
|
-
- `quit / q / exit` 不是“无条件立刻退出”。
|
|
47
|
-
- 共享交互层会先检查当前项目仍在运行的后台进程:
|
|
48
|
-
- `background job`
|
|
49
|
-
- `teammate worker`
|
|
50
|
-
- 如果没有运行中的后台进程:
|
|
51
|
-
- 直接退出会话
|
|
52
|
-
- 如果有运行中的后台进程:
|
|
53
|
-
- 先把它们列出来
|
|
54
|
-
- 只允许两个结果:
|
|
55
|
-
- 确认退出:杀掉全部后台进程,再退出
|
|
56
|
-
- 取消退出:保持当前 CLI 和后台进程继续运行
|
|
57
|
-
- kill 失败时必须 fail-closed:
|
|
58
|
-
- 不退出
|
|
59
|
-
- 明确告诉用户哪些 PID 还活着
|
|
60
|
-
|
|
61
|
-
这个规则属于共享交互控制层,不属于单个 shell 外壳。
|
|
62
|
-
## 当前本地命令入口
|
|
63
|
-
|
|
64
|
-
- `/session`
|
|
65
|
-
- `/config`
|
|
66
|
-
- `/todos`
|
|
67
|
-
- `/tasks`
|
|
68
|
-
- `/team`
|
|
69
|
-
- `/background`
|
|
70
|
-
- `/worktrees`
|
|
71
|
-
- `/inbox`
|
|
72
|
-
- `/runtime`
|
|
73
|
-
- `/stats`
|
|
74
|
-
- `/仪表盘`
|
|
75
|
-
- `/reset`
|
|
76
|
-
|
|
77
|
-
## Runtime Summary 展示范围
|
|
78
|
-
|
|
79
|
-
当前交互态最小 runtime summary 包含:
|
|
80
|
-
|
|
81
|
-
- session health
|
|
82
|
-
- model request count
|
|
83
|
-
- model wait total
|
|
84
|
-
- tool call count
|
|
85
|
-
- tool duration total
|
|
86
|
-
- yield / continuation / recovery / compression count
|
|
87
|
-
- externalized result count / bytes
|
|
88
|
-
- top tools
|
|
89
|
-
|
|
90
|
-
## Reset Boundary
|
|
91
|
-
|
|
92
|
-
- `/reset` 是显式 destructive local command,不是普通的窗口关闭动作。
|
|
93
|
-
- `/reset` 清空当前项目 `.athlete/` 下的运行时状态,但保留 `.athlete/.env` 和 `.athlete/.env.example`。
|
|
94
|
-
- `/reset` 还会删除当前项目相关的持久化 session,因此 `resume` 不应恢复已经 reset 掉的运行时。
|
|
95
|
-
- `/reset` 会尽量先通过正式 worktree / process 清理路径收尾,再删除状态目录。
|
|
96
|
-
- reset 行为必须落在 runtime / project state 层,UI 只能触发它,不能自己维护一套平行 reset 状态。
|
|
97
|
-
|
|
98
|
-
## 当前边界
|
|
99
|
-
|
|
100
|
-
### 共享边界
|
|
101
|
-
|
|
102
|
-
- `InteractiveSessionDriver`: 共享交互控制器
|
|
103
|
-
- `InteractionShell`: 壳适配接口
|
|
104
|
-
- `ShellInputPort`: 普通输入 / multiline 输入 / interrupt 订阅
|
|
105
|
-
- `ShellOutputPort`: info / warn / plain / dim / interrupt 等展示输出
|
|
106
|
-
- `InteractionTurnDisplay`: turn 期间的流式展示适配
|
|
107
|
-
|
|
108
|
-
### 当前 CLI 接线
|
|
109
|
-
|
|
110
|
-
- `src/ui/interactive.ts`: CLI 入口薄壳,只负责组装 shell、打印 intro、启动 driver
|
|
111
|
-
- `src/shell/cli/readlineInput.ts`: CLI 输入适配
|
|
112
|
-
- `src/shell/cli/output.ts`: `chalk` + stdio 输出适配
|
|
113
|
-
- `src/shell/cli/turnDisplay.ts`: spinner + stream renderer 适配
|
|
114
|
-
- `src/interaction/localCommands.ts`: 共享本地命令语义
|
|
115
|
-
- `src/interaction/exitGuard.ts`: 退出前后台进程检查与 kill-or-continue 语义
|
|
116
|
-
|
|
117
|
-
## 当前展示边界
|
|
118
|
-
|
|
119
|
-
交互终端当前只负责把这些状态展示清楚:
|
|
120
|
-
|
|
121
|
-
- task board
|
|
122
|
-
- teammate 状态
|
|
123
|
-
- background 状态
|
|
124
|
-
- skill load 状态
|
|
125
|
-
- runtime summary
|
|
126
|
-
|
|
127
|
-
但它不负责发明这些状态。
|
|
128
|
-
|
|
129
|
-
交互终端当前还负责把退出确认展示清楚:
|
|
130
|
-
|
|
131
|
-
- 哪些后台进程仍在运行
|
|
132
|
-
- 用户当前是在“继续运行”还是“kill 后退出”的分支
|
|
133
|
-
- kill 失败时哪些 PID 仍未退出
|
|
134
|
-
|
|
135
|
-
## 未来方向
|
|
136
|
-
|
|
137
|
-
- 桌面壳应直接实现 `InteractionShell` 契约,而不是复用 CLI 的 `readline` / stdio 细节。
|
|
138
|
-
- 桌面壳可以自己提供输入框、停止按钮、流式消息区和状态面板。
|
|
139
|
-
- 只要继续复用 `InteractiveSessionDriver`,桌面壳与 CLI 壳就应共享同一套本地命令、turn 驱动和中断语义。
|
|
@@ -1,80 +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. 静态层只放高层 operating contract:
|
|
13
|
-
- identity / role contract
|
|
14
|
-
- work loop contract
|
|
15
|
-
- tool-use contract
|
|
16
|
-
- communication / output contract
|
|
17
|
-
- external content boundary
|
|
18
|
-
- project instructions
|
|
19
|
-
3. 动态层放 cwd / root / date / taskState / todo / verification / checkpoint / task board / team / worktree / protocol / background / skill runtime 的紧凑摘要。
|
|
20
|
-
4. 动态层应省略空状态和低价值 `No ...` 噪音,但要保留 checkpoint、verification pending paths、externalized tool refs 这些恢复锚点。
|
|
21
|
-
5. 压缩后的会话总结不再直接拼回静态层,而是追加为 `Compressed conversation memory`。
|
|
22
|
-
6. request context 构建可以派生 prompt diagnostics,用于诊断但不落盘:
|
|
23
|
-
- static / dynamic / memory chars
|
|
24
|
-
- static / dynamic / memory block counts
|
|
25
|
-
- block hotspot
|
|
26
|
-
- total prompt chars
|
|
27
|
-
- initial / final estimated request chars
|
|
28
|
-
- 当前这次 compression 是否由 prompt 膨胀触发
|
|
29
|
-
这些都只是派生观测,不是新的持久化真相源。
|
|
30
|
-
|
|
31
|
-
## 大 tool result 外置化
|
|
32
|
-
|
|
33
|
-
1. 当 tool output 超过约 `12,000` chars 或 `16 KB` 时,进入外置化路径。
|
|
34
|
-
2. 原始 output 落盘到项目 state root 下:
|
|
35
|
-
- `.athlete/tool-results/<sessionId>/<timestamp>-<tool>-<hash>.json|txt`
|
|
36
|
-
3. session 里保留的 tool message 只存轻量引用:
|
|
37
|
-
- `externalized: true`
|
|
38
|
-
- `storagePath`
|
|
39
|
-
- `summary`
|
|
40
|
-
- `preview`
|
|
41
|
-
- `byteLength`
|
|
42
|
-
- `charLength`
|
|
43
|
-
4. 小结果继续走原来的 inline message 路径,不做无差别外置化。
|
|
44
|
-
5. 当 agent 读取 `.athlete/tool-results/...` 中的 artifact 文件时,`read_file` 默认返回紧凑摘要视图;只有显式 line range 读取才继续走原始逐行查看路径。
|
|
45
|
-
|
|
46
|
-
## 闭环要求
|
|
47
|
-
|
|
48
|
-
1. continuation 继续使用 session 中的轻量 tool message,而不是重新塞回原始大正文。
|
|
49
|
-
2. contextBuilder 在压缩历史时继续保留 `storagePath` 和预览信息。
|
|
50
|
-
3. contextBuilder 产出的 prompt diagnostics 必须只存在于当次 request 构建结果里,不能写回 session。
|
|
51
|
-
4. recovery 的 context shrink 也要保住结构化引用,不能把它打回不可追踪的大字符串。
|
|
52
|
-
5. session 保存和加载后,外置化引用仍然可以恢复到落盘文件。
|
|
53
|
-
6. 已通过 streaming delta 发出的 assistant 文本不会在 finalize 阶段再次整段重放。
|
|
54
|
-
|
|
55
|
-
## 验证方式
|
|
56
|
-
|
|
57
|
-
1. fail-first 测试:
|
|
58
|
-
- `tests/runtime-lightweight-context.test.ts`
|
|
59
|
-
2. 核心回归:
|
|
60
|
-
- `npm run test:build`
|
|
61
|
-
- `npm run test:core`
|
|
62
|
-
3. 真实 API:
|
|
63
|
-
- `npm run verify:runtime-context-api`
|
|
64
|
-
## Checkpoint Runtime Contract
|
|
65
|
-
|
|
66
|
-
- `SessionRecord` now persists a structured `checkpoint` inside the existing session truth source.
|
|
67
|
-
- `checkpoint` is a runtime summary, not a transcript dump. It carries:
|
|
68
|
-
- objective
|
|
69
|
-
- completedSteps
|
|
70
|
-
- currentStep
|
|
71
|
-
- nextStep
|
|
72
|
-
- recentToolBatch
|
|
73
|
-
- flow phase (`active / continuation / resume / recovery`)
|
|
74
|
-
- priorityArtifacts (externalized tool-result refs, previews, pending paths)
|
|
75
|
-
- continuation, reload/resume, and dynamic prompt rendering must all consume the same checkpoint instead of inventing separate recovery hints.
|
|
76
|
-
- objective changes reset checkpoint progress so old work does not pollute the new task.
|
|
77
|
-
- externalized tool results remain the preferred recoverable context, and checkpoint keeps the references lightweight.
|
|
78
|
-
- verification 文案必须与 runtime 能力一致:targeted verification、lightweight readback、auto-readback 都是合法路径,不把所有改动都描述成必须全量 build/test。
|
|
79
|
-
- fail-first test for this layer: `tests/runtime-checkpoint-resume.test.ts`
|
|
80
|
-
- real API verification entry for this layer: `npm run verify:runtime-checkpoint-api`
|