codex-flow 2.1.13__py3-none-any.whl
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.
- codex_flow/__init__.py +28 -0
- codex_flow/__main__.py +9 -0
- codex_flow/cli.py +242 -0
- codex_flow/data/LICENSE +21 -0
- codex_flow/data/README.en.md +303 -0
- codex_flow/data/README.md +305 -0
- codex_flow/data/VERSION +1 -0
- codex_flow/data/apps/chatgpt-mcp/README.md +86 -0
- codex_flow/data/apps/chatgpt-mcp/__init__.py +1 -0
- codex_flow/data/apps/chatgpt-mcp/adapter.py +458 -0
- codex_flow/data/apps/chatgpt-mcp/server.py +358 -0
- codex_flow/data/apps/chatgpt-mcp/widget.html +927 -0
- codex_flow/data/apps/macos-overlay/README.en.md +121 -0
- codex_flow/data/apps/macos-overlay/README.md +123 -0
- codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayRuntimeState.swift +126 -0
- codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayScreenGeometry.swift +82 -0
- codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayWindowController.swift +1052 -0
- codex_flow/data/apps/macos-overlay/Sources/Localization.swift +197 -0
- codex_flow/data/apps/macos-overlay/Sources/Models/TelemetryData.swift +1557 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/AccountSnapshotService.swift +1101 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/FlowPilotInstanceLock.swift +153 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/IPCServer.swift +298 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/TelemetryQueryEngine.swift +800 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/TelemetryWatcher.swift +135 -0
- codex_flow/data/apps/macos-overlay/Sources/Services/UpdateService.swift +610 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/AccountView.swift +610 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/AnalyticsView.swift +566 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/AutostartView.swift +293 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/BubbleView.swift +317 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/HistoryView.swift +1124 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/HoverRevealText.swift +165 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/InspectorSkillsToolsView.swift +121 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/LogoView.swift +182 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/SleekSwitch.swift +117 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/StrategyModeView.swift +561 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/SummaryView.swift +1273 -0
- codex_flow/data/apps/macos-overlay/Sources/Views/UpdateView.swift +352 -0
- codex_flow/data/apps/macos-overlay/Sources/main.swift +340 -0
- codex_flow/data/apps/macos-overlay/Tests/OverlayScreenGeometryTests.swift +163 -0
- codex_flow/data/apps/macos-overlay/Tests/TelemetryPhase1ContractTests.swift +357 -0
- codex_flow/data/apps/macos-overlay/Tests/TelemetryQueryEngineConcurrencyTests.swift +221 -0
- codex_flow/data/apps/macos-overlay/Tests/TelemetryQuotaSelectionTests.swift +158 -0
- codex_flow/data/apps/macos-overlay/Tests/TelemetryWorkerTokenTests.swift +122 -0
- codex_flow/data/apps/macos-overlay/build.sh +75 -0
- codex_flow/data/benchmark/corpus.json +103 -0
- codex_flow/data/benchmark/manifest.example.json +41 -0
- codex_flow/data/benchmark/manifest.schema.json +137 -0
- codex_flow/data/benchmark/prices/gpt-5.6-2026-08-30.json +5 -0
- codex_flow/data/benchmark/profiles.json +90 -0
- codex_flow/data/benchmark/schema.json +77 -0
- codex_flow/data/benchmark/tasks.json +50 -0
- codex_flow/data/completions/codex-flow.bash +34 -0
- codex_flow/data/completions/codex-flow.zsh +52 -0
- codex_flow/data/glama.json +6 -0
- codex_flow/data/install-release.ps1 +126 -0
- codex_flow/data/install-release.sh +155 -0
- codex_flow/data/install.ps1 +349 -0
- codex_flow/data/install.sh +362 -0
- codex_flow/data/policy/benchmark.toml +49 -0
- codex_flow/data/policy/defaults.toml +70 -0
- codex_flow/data/scripts/analyze-benchmark.py +510 -0
- codex_flow/data/scripts/benchmark-local.py +171 -0
- codex_flow/data/scripts/check-recommendation.py +277 -0
- codex_flow/data/scripts/doctor.py +449 -0
- codex_flow/data/scripts/generate-release-manifest.py +74 -0
- codex_flow/data/scripts/localization.py +192 -0
- codex_flow/data/scripts/manage-hooks.py +448 -0
- codex_flow/data/scripts/manage-instructions.py +389 -0
- codex_flow/data/scripts/manage-shell.py +151 -0
- codex_flow/data/scripts/materialize-corpus.py +193 -0
- codex_flow/data/scripts/menu.py +646 -0
- codex_flow/data/scripts/migrations/0001_update_settings.py +80 -0
- codex_flow/data/scripts/package-release.py +132 -0
- codex_flow/data/scripts/render-benchmark-report.py +292 -0
- codex_flow/data/scripts/run-benchmark.py +829 -0
- codex_flow/data/scripts/strategies/__init__.py +28 -0
- codex_flow/data/scripts/strategies/balanced.py +115 -0
- codex_flow/data/scripts/strategies/base.py +363 -0
- codex_flow/data/scripts/strategies/efficient.py +158 -0
- codex_flow/data/scripts/strategies/lifecycle_runtime.py +590 -0
- codex_flow/data/scripts/strategies/quality.py +209 -0
- codex_flow/data/scripts/strategies/speed.py +108 -0
- codex_flow/data/scripts/strategies/task_budget_runtime.py +644 -0
- codex_flow/data/scripts/strategies/task_phase_runtime.py +341 -0
- codex_flow/data/scripts/strategies/work_unit_runtime.py +421 -0
- codex_flow/data/scripts/strategy_runtime.py +1091 -0
- codex_flow/data/scripts/telemetry.py +400 -0
- codex_flow/data/scripts/telemetry_core/__init__.py +192 -0
- codex_flow/data/scripts/telemetry_core/app_server.py +1192 -0
- codex_flow/data/scripts/telemetry_core/collector.py +1247 -0
- codex_flow/data/scripts/telemetry_core/common.py +421 -0
- codex_flow/data/scripts/telemetry_core/latency.py +593 -0
- codex_flow/data/scripts/telemetry_core/query.py +427 -0
- codex_flow/data/scripts/telemetry_core/quota_ledger.py +598 -0
- codex_flow/data/scripts/telemetry_core/render.py +460 -0
- codex_flow/data/scripts/telemetry_core/repair.py +223 -0
- codex_flow/data/scripts/ui.py +266 -0
- codex_flow/data/scripts/update-homebrew-formula.py +146 -0
- codex_flow/data/scripts/update_runtime_config.py +134 -0
- codex_flow/data/scripts/updater.py +1718 -0
- codex_flow/data/smithery.yaml +18 -0
- codex_flow/data/templates/agents/worker-explorer.toml +24 -0
- codex_flow/data/templates/agents/worker-implementer.toml +49 -0
- codex_flow/data/templates/agents/worker-reviewer.toml +25 -0
- codex_flow/data/templates/flow-pilot-instructions.md +35 -0
- codex_flow/data/templates/skills/flow-pilot/SKILL.md +577 -0
- codex_flow/mcp.py +35 -0
- codex_flow-2.1.13.dist-info/METADATA +342 -0
- codex_flow-2.1.13.dist-info/RECORD +113 -0
- codex_flow-2.1.13.dist-info/WHEEL +5 -0
- codex_flow-2.1.13.dist-info/entry_points.txt +3 -0
- codex_flow-2.1.13.dist-info/licenses/LICENSE +21 -0
- codex_flow-2.1.13.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://github.com/ParsifalC/codex-flow">
|
|
4
|
+
<img src="docs/assets/logo.png" alt="FlowPilot Logo" width="130" height="130" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
# FlowPilot · codex-flow
|
|
8
|
+
|
|
9
|
+
**智能、高效、自适应的 Codex 多 Agent 策略编排引擎**
|
|
10
|
+
|
|
11
|
+
[](VERSION)
|
|
12
|
+
[](https://github.com/ParsifalC/homebrew-tap)
|
|
13
|
+
[](https://pypi.org/project/codex-flow/)
|
|
14
|
+
[](#-快速安装)
|
|
15
|
+
[](docs/overlay.md)
|
|
16
|
+
[](docs/telemetry.md)
|
|
17
|
+
[](https://smithery.ai)
|
|
18
|
+
[](https://glama.ai/mcp/servers)
|
|
19
|
+
[](https://linux.do)
|
|
20
|
+
[](LICENSE)
|
|
21
|
+
|
|
22
|
+
<br />
|
|
23
|
+
|
|
24
|
+
<img src="docs/assets/promo/flowpilot_promo_banner.png" alt="codex-flow Banner" width="100%" style="border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);" />
|
|
25
|
+
|
|
26
|
+
<br /><br />
|
|
27
|
+
|
|
28
|
+
[**English Documentation**](README.en.md) · [**多策略运行时**](docs/strategy-runtime.md) · [**深入配置**](docs/configuration.md) · [**遥测机制**](docs/telemetry.md) · [**原生悬浮窗**](docs/overlay.md) · [**基准评测**](docs/benchmark.md)
|
|
29
|
+
|
|
30
|
+
<br />
|
|
31
|
+
|
|
32
|
+
> 📢 **社区公测**:`codex-flow` 现已正式在 [**LINUX DO**](https://linux.do) 开启公测,欢迎各位佬友前往体验、讨论与反馈!
|
|
33
|
+
|
|
34
|
+
<br />
|
|
35
|
+
|
|
36
|
+
> **“ 让昂贵的 Parent 做高价值判断,让高性价比 Worker 用更深推理承担探索、实现、验证与调试循环;当用户明确要求最高质量时,把高级 capability 精确投放到关键 Implementer / Reviewer,而不是无差别升级所有 Worker。”**
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ✨ 核心亮点
|
|
43
|
+
|
|
44
|
+
<table>
|
|
45
|
+
<tr>
|
|
46
|
+
<td width="50%" valign="top">
|
|
47
|
+
<h3>🧠 多策略运行时 (FlowPilot)</h3>
|
|
48
|
+
<p>FlowPilot 从单一分发策略升级为统一 Strategy Runtime。内置 <code>efficient</code> / <code>balanced</code> / <code>quality</code> / <code>speed</code>,统一通过 TaskProfile → WorkerBudget → ExecutionPlan v7 驱动执行。</p>
|
|
49
|
+
</td>
|
|
50
|
+
<td width="50%" valign="top">
|
|
51
|
+
<h3>⚙️ 动态 Worker Budget</h3>
|
|
52
|
+
<p>Worker 数不再写死为 1~2 个。Runtime 根据不确定性、工作流隔离、Quota 与线程上限动态计算 Explorer / Implementer / Reviewer,并且可写并发始终要求真实隔离证据。</p>
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td width="50%" valign="top">
|
|
57
|
+
<h3>🧠 Worker-first Reasoning</h3>
|
|
58
|
+
<p>默认 Parent 以 <code>high</code> 为主,便宜的 Worker 以 <code>xhigh</code> 起步;委派时各 Worker role reasoning 至少比 Parent 高一档,Parent 已为 <code>max</code> 时除外。</p>
|
|
59
|
+
</td>
|
|
60
|
+
<td width="50%" valign="top">
|
|
61
|
+
<h3>🏆 Quality Intent</h3>
|
|
62
|
+
<p><code>quality</code> 支持 <code>normal / strong / absolute</code> 三档当前任务质量意图。普通 Explorer 继续优先 <code>latest-efficient</code>;强质量意图可把关键 Implementer / Reviewer 升级到 <code>latest-capable</code>。只有技术风险本身达到 critical 时,Explorer 才会升级到 Parent 级 capability。</p>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</table>
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 🧩 四种内置策略
|
|
70
|
+
|
|
71
|
+
| Strategy | 优化目标 | 高需求任务的 Worker 倾向 |
|
|
72
|
+
| :--- | :--- | :--- |
|
|
73
|
+
| **`efficient`** | 减少昂贵 Parent 消耗与无效总成本 | 最多约 2 Explorer / 2 Implementer,低 speculation,Quota 紧张会自动收敛 |
|
|
74
|
+
| **`balanced`** | 平衡质量、额度与耗时 | 最多约 3 Explorer / 3 Implementer,适度安全并行 |
|
|
75
|
+
| **`quality`** | 最大化正确性与验证置信度 | 普通 complex 优先 Luna + `max` reasoning;`strong/absolute` 只把关键 Implementer / Reviewer 升级到 Parent 级 capability,Explorer 默认保持高性价比 |
|
|
76
|
+
| **`speed`** | 最小化 wall-clock latency | 最多 8 个 Implementer budget;实际数量由已证明 writable workstreams 与 Runtime ceiling 决定 |
|
|
77
|
+
|
|
78
|
+
`quality_intent` 是**当前任务语义**,不是持久化配置,也不是 `risk` 的别名;并且只有 `quality` strategy 会消费它:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
normal → 普通质量目标,优先 latest-efficient Worker + 深 reasoning
|
|
82
|
+
strong → 明确质量优先,允许关键 Implementer / Reviewer 使用 latest-capable
|
|
83
|
+
absolute → 明确最高质量优先,在安全 ceiling 内 correctness > quota / latency;Explorer 仍默认 latest-efficient
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
默认配置仍是:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
strategy = efficient
|
|
90
|
+
routing = adaptive
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
但 v1.7 的 fresh-install 资源策略已经从“Parent 与 Worker 相近 reasoning”调整为 **Parent 高价值决策 + Worker 深推理执行**。已有用户的自定义 reasoning 配置在 update/reinstall 时会无损保留。
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 🚀 快速安装
|
|
98
|
+
|
|
99
|
+
### 前置要求 (Prerequisites)
|
|
100
|
+
|
|
101
|
+
> 💡 **特别说明**:Codex CLI **仅用于首次安装的环境校验与一次性 Hook 授权**。初始化完成后,**日常使用完全使用 Codex 桌面端 APP 即可**,无需在终端中启动或使用 CLI。
|
|
102
|
+
|
|
103
|
+
确保环境拥有 Codex CLI(用于首次安装与授权):
|
|
104
|
+
```bash
|
|
105
|
+
# npm 全局安装
|
|
106
|
+
npm install -g @openai/codex
|
|
107
|
+
|
|
108
|
+
# 或 macOS Homebrew 安装
|
|
109
|
+
brew install codex
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 快速安装
|
|
113
|
+
|
|
114
|
+
#### 方式一:PyPI 安装(全平台推荐,支持 Windows / macOS / Linux)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# 推荐使用 pipx(独立隔离环境)
|
|
118
|
+
pipx install codex-flow
|
|
119
|
+
|
|
120
|
+
# 或使用标准 pip
|
|
121
|
+
pip install codex-flow
|
|
122
|
+
|
|
123
|
+
# 初始化配置与环境
|
|
124
|
+
codex-flow install
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### 方式二:Homebrew 安装(macOS / Linux)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
brew install ParsifalC/tap/codex-flow
|
|
131
|
+
codex-flow install
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### 方式三:一键发布安装脚本
|
|
135
|
+
|
|
136
|
+
首次安装统一使用 GitHub Release 中与你的系统和 CPU 架构匹配的正式 artifact,不需要 clone 仓库。
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# macOS / Linux
|
|
140
|
+
curl -fsSL https://raw.githubusercontent.com/ParsifalC/codex-flow/main/install-release.sh | bash
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
# Windows PowerShell
|
|
145
|
+
irm https://raw.githubusercontent.com/ParsifalC/codex-flow/main/install-release.ps1 | iex
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
安装器会自动识别 OS / CPU、解析 Latest Stable Release、下载对应 artifact、校验 SHA-256、安装到 `~/.codex/codex-flow/versions/<version>`,并运行健康检查。Windows 自动选择 x86_64 / ARM64 ZIP;macOS 直接使用 Release 中已经预编译好的 FlowPilot,**安装完成后悬浮按钮会自动启动**,不会在本机执行 `build.sh`。
|
|
149
|
+
|
|
150
|
+
> ⚠️ **最后一步**:
|
|
151
|
+
> 1. **首次一次性授权**:在终端启动一次 `codex`,在对话框中输入 `/hooks` 批准 FlowPilot telemetry(仅需做一次,完成永久信任)。
|
|
152
|
+
> 2. **重启 Codex 桌面端**:完全退出 Codex 桌面应用后重新打开。FlowPilot 悬浮窗已在 macOS 桌面自动运行,后续所有日常工作**直接在 Codex 桌面端使用即可**,无需再打开终端。
|
|
153
|
+
|
|
154
|
+
安装器还会把带有明确标记的 FlowPilot 入口写入生效的全局 `AGENTS.md`。入口会要求当前 Agent 在仓库技术工作前读取已安装 skill 并取得策略门禁 receipt,因此不需要在提示中点名 skill。安装后请开始新任务或完整重新加载 Codex,确保新的指令生效。全局开关关闭或本任务的一次性 bypass 已消费时,该任务按普通流程执行。这个提示入口依赖当前宿主遵循指令,不是 100% 的强制边界;生命周期 hooks 仍只用于遥测。
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 🎮 基本使用
|
|
159
|
+
|
|
160
|
+
### 1. 查看 / 切换默认策略
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
codex-flow strategy show
|
|
164
|
+
codex-flow strategy profiles
|
|
165
|
+
codex-flow strategy set quality
|
|
166
|
+
codex-flow strategy set efficient
|
|
167
|
+
codex-flow strategy routing adaptive
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 2. 对话内自然语言覆盖
|
|
171
|
+
|
|
172
|
+
当前任务可以临时覆盖持久配置:
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
👉 策略覆盖:"质量优先" / "尽量少用 Plan 额度" / "尽快完成"
|
|
176
|
+
👉 强质量:"质量优先,必要时使用更强模型" → quality_intent=strong
|
|
177
|
+
👉 最高质量:"成本不重要,用最强模型和独立验证" → quality_intent=absolute
|
|
178
|
+
👉 自动路由:"按默认策略实现" / "自适应处理"
|
|
179
|
+
👉 强制委派:"delegate" / "使用子 agent 实现" / "交给 worker 处理"
|
|
180
|
+
👉 单兵直出:"direct" / "不要使用子 agent,直接完成" / "这次直接做"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Strategy 与 Routing 正交,例如:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
quality + direct
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
表示使用 quality 的能力/推理目标,但当前任务不使用子 Agent。
|
|
190
|
+
|
|
191
|
+
### 3. 查看确定性的 ExecutionPlan
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
codex-flow strategy plan \
|
|
195
|
+
--profile quality \
|
|
196
|
+
--quality-intent strong \
|
|
197
|
+
--complexity complex \
|
|
198
|
+
--uncertainty high \
|
|
199
|
+
--parallelism high
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Plan 会输出 `quality_intent`、Strategy 的 `worker_budget`,以及 Runtime 实际编译出的三组角色资源:
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
explorer_capability_policy / explorer_model / explorer_reasoning
|
|
206
|
+
implementer_capability_policy / implementer_model / implementer_reasoning
|
|
207
|
+
reviewer_capability_policy / reviewer_model / reviewer_reasoning
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
同时包含 `exploration_workers`、`implementation_workers`、`reviewer_workers` 和 `planned_worker_count`。
|
|
211
|
+
|
|
212
|
+
### 4. 交互式控制台
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
codex-flow
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
最新控制台同时集成了 Overlay 构建/启动入口、策略状态、Benchmark 与遥测:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
╭────────────────────────────────────────────────────────────────────╮
|
|
222
|
+
│ 🚀 codex-flow 控制台 (v2.1.13) │
|
|
223
|
+
│ FlowPilot 智能编排 · 确定性任务遥测 · 本地 Benchmark 验证 │
|
|
224
|
+
╰────────────────────────────────────────────────────────────────────╯
|
|
225
|
+
[1] 🪟 macOS 原生悬浮窗 (overlay widget)
|
|
226
|
+
[2] 📊 查看最新任务卡片 (usage last)
|
|
227
|
+
[3] 📜 浏览历史任务列表 (usage list)
|
|
228
|
+
[4] 📈 项目聚合统计分析 (usage stats)
|
|
229
|
+
[5] 🎯 查看生效策略配置 (status)
|
|
230
|
+
[6] 🩺 运行系统诊断检查 (doctor)
|
|
231
|
+
[7] ⚡ 本地快速 Benchmark (benchmark-local quick)
|
|
232
|
+
[8] 🔄 检查与拉取更新 (update)
|
|
233
|
+
[0] 🚪 退出
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Overlay 子菜单支持直接启动、编译并启动、仅编译,以及运行时的重编译/重启、展开切换和数据推送,不再要求用户手动先执行 `build.sh`。
|
|
237
|
+
|
|
238
|
+
### 5. 常用 CLI
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
codex-flow usage last
|
|
242
|
+
codex-flow usage list --today
|
|
243
|
+
codex-flow usage stats -d 30
|
|
244
|
+
codex-flow doctor
|
|
245
|
+
codex-flow update
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### 6. MCP 客户端与平台集成 (Claude Desktop / Cursor / Smithery / Glama)
|
|
249
|
+
|
|
250
|
+
`codex-flow` 内置标准的 Model Context Protocol (MCP) 服务端,支持将 FlowPilot 确定性遥测注入任意支持 MCP 的宿主:
|
|
251
|
+
|
|
252
|
+
* **Claude Desktop / Cursor (`stdio` 模式)**:
|
|
253
|
+
在 `claude_desktop_config.json` 中配置:
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"mcpServers": {
|
|
257
|
+
"flowpilot": {
|
|
258
|
+
"command": "codex-flow-mcp",
|
|
259
|
+
"args": ["--stdio"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
* **Smithery.ai**:配置文件见根目录 `smithery.yaml`,已支持一键发现与客户端挂载。
|
|
265
|
+
* **Glama**:认证元数据见根目录 `glama.json`,已入驻 Glama MCP 注册目录。
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 🪟 FlowPilot macOS 原生悬浮窗
|
|
270
|
+
|
|
271
|
+
专为 macOS 深度定制的 **100% 纯原生毛玻璃效能看板**,打通任务生命周期与 Quota 监控。
|
|
272
|
+
|
|
273
|
+
<div align="center">
|
|
274
|
+
<img src="docs/assets/promo/flowpilot_promo_poster.png" alt="FlowPilot Native Widget Showcase" width="100%" style="border-radius: 12px; margin: 16px 0;" />
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
- **🟢 灵动微胶囊 (Capsule)**:闲置时边缘半收起,呼吸光环显示任务状态与最新消耗。
|
|
278
|
+
- **⚡️ 实时巡检 (Inspector)**:耗时 / Tokens / 费用、Quota 水位与 Agent 拓扑。
|
|
279
|
+
- **📜 历史回溯 (History)**:跨项目任务时间线与详情回溯。
|
|
280
|
+
- **📊 效能看板 (Analytics)**:7d/30d 缓存命中率、Worker 算力卸载比与模型/仓库分布。
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
codex-flow overlay start
|
|
284
|
+
codex-flow overlay toggle
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## 📚 深入文档
|
|
290
|
+
|
|
291
|
+
| 模块 | 文档入口 | 核心内容 |
|
|
292
|
+
| :--- | :--- | :--- |
|
|
293
|
+
| **🧠 多策略运行时** | [docs/strategy-runtime.md](docs/strategy-runtime.md) | TaskProfile、Quality Intent、WorkerBudget、Strategy Registry、ExecutionPlan v7、role-scoped resources |
|
|
294
|
+
| **⚙️ 策略与配置** | [docs/configuration.md](docs/configuration.md) | policy schema v4、Worker-first reasoning、路由、Runtime ceiling |
|
|
295
|
+
| **📈 确定性遥测** | [docs/telemetry.md](docs/telemetry.md) | Hook 生命周期、Token 差值归因、账户 Quota |
|
|
296
|
+
| **🪟 原生悬浮窗** | [docs/overlay.md](docs/overlay.md) | 交互、IPC 与 SwiftUI 架构 |
|
|
297
|
+
| **🧪 本地基准测试** | [docs/benchmark.md](docs/benchmark.md) | 本地无 Key 评测与多策略对比 |
|
|
298
|
+
| **☁️ Actions 评测** | [docs/benchmark-actions.md](docs/benchmark-actions.md) | GitHub Actions Benchmark |
|
|
299
|
+
| **🌐 多语言支持** | [docs/localization.md](docs/localization.md) | 中英双语与本地化范围 |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 📄 开源协议
|
|
304
|
+
|
|
305
|
+
本项目采用 [MIT License](LICENSE) 开源协议。
|
codex_flow/data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.1.13
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# codex-flow MCP 服务
|
|
2
|
+
|
|
3
|
+
这是一个读取本地 FlowPilot telemetry 的 MCP 服务。服务入口是仓库根目录下的
|
|
4
|
+
`bin/codex-flow-mcp`,MCP HTTP endpoint 是 `/mcp`,健康检查 endpoint 是
|
|
5
|
+
`/healthz`。
|
|
6
|
+
|
|
7
|
+
## 手动启动与健康检查
|
|
8
|
+
|
|
9
|
+
在仓库根目录执行:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
./bin/codex-flow-mcp --host 127.0.0.1 --port 8787
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
另开终端检查服务:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curl -fsS http://127.0.0.1:8787/healthz
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
wrapper 会定位当前仓库根目录并执行 `apps/chatgpt-mcp/server.py`,命令行参数会
|
|
22
|
+
原样传给服务,因此也可以使用其他 `--host` 或 `--port`。服务读取
|
|
23
|
+
`CODEX_HOME` 下的 telemetry 状态;不设置时由服务按代码使用默认的 Codex home。
|
|
24
|
+
|
|
25
|
+
实现只使用 Python 标准库,不需要 `npm install`。当前实现尽量兼容 Python 3.7;
|
|
26
|
+
如果运行环境中的 `server.py` 明确要求更高版本,应以该文件的实际报错为准。
|
|
27
|
+
|
|
28
|
+
## 接入 Codex CLI
|
|
29
|
+
|
|
30
|
+
把下面的 MCP server 配置加入 Codex CLI 的 `~/.codex/config.toml`(或你的
|
|
31
|
+
`CODEX_HOME/config.toml`)后,重启或重新加载 Codex CLI。示例只展示 URL,不会由
|
|
32
|
+
本项目自动修改用户配置:
|
|
33
|
+
|
|
34
|
+
```toml
|
|
35
|
+
[mcp_servers.codex_flow]
|
|
36
|
+
url = "http://127.0.0.1:8787/mcp"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
该地址只适用于与服务运行在同一台机器上的本地 Codex CLI。服务必须保持运行,
|
|
40
|
+
并且 CLI 使用与 telemetry 相同的 `CODEX_HOME` 才能读到对应数据。
|
|
41
|
+
|
|
42
|
+
## 接入 ChatGPT App
|
|
43
|
+
|
|
44
|
+
ChatGPT App 的云端不能直接访问本机的 `localhost` 或 `127.0.0.1`。先在本机
|
|
45
|
+
启动服务,再使用一个 Secure MCP Tunnel 将本地 `/mcp` 暴露为稳定、可从公网通过
|
|
46
|
+
HTTPS 访问的 endpoint,例如:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
https://your-stable-tunnel.example/mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
在 ChatGPT App 的 MCP server 设置中填写该 HTTPS URL。Tunnel 必须持续运行,且
|
|
53
|
+
应保持稳定的地址和必要的访问控制;本项目不提供 tunnel,也不会替用户配置
|
|
54
|
+
ChatGPT 或本地 Codex。
|
|
55
|
+
|
|
56
|
+
在会话中调用 `flowpilot_get_telemetry` 后,若客户端展示该服务的 UI resource,
|
|
57
|
+
使用 UI 中的 `Pin` 进入 PiP。`Refresh` 重新读取当前 telemetry resource,
|
|
58
|
+
实际调用 `flowpilot_get_telemetry` 的 `target = "last"`;`Details / expand` 请求
|
|
59
|
+
客户端的 expanded/fullscreen 展示并打开详情面板,客户端不支持时仍显示可用的
|
|
60
|
+
详情面板。这里的 PiP 是 ChatGPT 会话内的展示能力,不是
|
|
61
|
+
能够覆盖其他应用的系统级悬浮窗;不能据此承诺跨应用显示或由计划任务直接推送
|
|
62
|
+
系统级 PiP。
|
|
63
|
+
|
|
64
|
+
## 限制
|
|
65
|
+
|
|
66
|
+
- 本地服务是手动启动的 HTTP 进程;本项目不会把它加入现有安装器,也不会自动
|
|
67
|
+
修改用户的 `~/.codex` 或 MCP 配置。
|
|
68
|
+
- ChatGPT App 的接入依赖外部 Secure MCP Tunnel、HTTPS 可达性和对应的认证策略;
|
|
69
|
+
本地 loopback 地址本身不能作为 ChatGPT 云端 endpoint。
|
|
70
|
+
- UI 展示依赖 `CODEX_HOME` 中已有的 telemetry 数据(包括最近一次运行的
|
|
71
|
+
`codex-flow/telemetry/last.json`);本服务不会生成虚假的任务数据,也不负责
|
|
72
|
+
计划任务或主动推送。
|
|
73
|
+
|
|
74
|
+
## 协议 smoke 测试
|
|
75
|
+
|
|
76
|
+
从仓库根目录运行:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
tests/chatgpt-mcp.sh
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
测试会创建临时 `CODEX_HOME` 和代表性的 `last.json`,在临时 loopback 端口启动
|
|
83
|
+
服务,并验证 `/healthz`、MCP `initialize`、`tools/list`、
|
|
84
|
+
`tools/call(flowpilot_get_telemetry)`、`resources/list`、`resources/read`,以及
|
|
85
|
+
未知方法和未知工具的 JSON-RPC 错误。测试不会连接真实 ChatGPT,也不会读写用户
|
|
86
|
+
真实的 `~/.codex`;结束时会清理临时服务和目录。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Local FlowPilot telemetry MCP adapter package."""
|