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.
Files changed (113) hide show
  1. codex_flow/__init__.py +28 -0
  2. codex_flow/__main__.py +9 -0
  3. codex_flow/cli.py +242 -0
  4. codex_flow/data/LICENSE +21 -0
  5. codex_flow/data/README.en.md +303 -0
  6. codex_flow/data/README.md +305 -0
  7. codex_flow/data/VERSION +1 -0
  8. codex_flow/data/apps/chatgpt-mcp/README.md +86 -0
  9. codex_flow/data/apps/chatgpt-mcp/__init__.py +1 -0
  10. codex_flow/data/apps/chatgpt-mcp/adapter.py +458 -0
  11. codex_flow/data/apps/chatgpt-mcp/server.py +358 -0
  12. codex_flow/data/apps/chatgpt-mcp/widget.html +927 -0
  13. codex_flow/data/apps/macos-overlay/README.en.md +121 -0
  14. codex_flow/data/apps/macos-overlay/README.md +123 -0
  15. codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayRuntimeState.swift +126 -0
  16. codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayScreenGeometry.swift +82 -0
  17. codex_flow/data/apps/macos-overlay/Sources/Controllers/OverlayWindowController.swift +1052 -0
  18. codex_flow/data/apps/macos-overlay/Sources/Localization.swift +197 -0
  19. codex_flow/data/apps/macos-overlay/Sources/Models/TelemetryData.swift +1557 -0
  20. codex_flow/data/apps/macos-overlay/Sources/Services/AccountSnapshotService.swift +1101 -0
  21. codex_flow/data/apps/macos-overlay/Sources/Services/FlowPilotInstanceLock.swift +153 -0
  22. codex_flow/data/apps/macos-overlay/Sources/Services/IPCServer.swift +298 -0
  23. codex_flow/data/apps/macos-overlay/Sources/Services/TelemetryQueryEngine.swift +800 -0
  24. codex_flow/data/apps/macos-overlay/Sources/Services/TelemetryWatcher.swift +135 -0
  25. codex_flow/data/apps/macos-overlay/Sources/Services/UpdateService.swift +610 -0
  26. codex_flow/data/apps/macos-overlay/Sources/Views/AccountView.swift +610 -0
  27. codex_flow/data/apps/macos-overlay/Sources/Views/AnalyticsView.swift +566 -0
  28. codex_flow/data/apps/macos-overlay/Sources/Views/AutostartView.swift +293 -0
  29. codex_flow/data/apps/macos-overlay/Sources/Views/BubbleView.swift +317 -0
  30. codex_flow/data/apps/macos-overlay/Sources/Views/HistoryView.swift +1124 -0
  31. codex_flow/data/apps/macos-overlay/Sources/Views/HoverRevealText.swift +165 -0
  32. codex_flow/data/apps/macos-overlay/Sources/Views/InspectorSkillsToolsView.swift +121 -0
  33. codex_flow/data/apps/macos-overlay/Sources/Views/LogoView.swift +182 -0
  34. codex_flow/data/apps/macos-overlay/Sources/Views/SleekSwitch.swift +117 -0
  35. codex_flow/data/apps/macos-overlay/Sources/Views/StrategyModeView.swift +561 -0
  36. codex_flow/data/apps/macos-overlay/Sources/Views/SummaryView.swift +1273 -0
  37. codex_flow/data/apps/macos-overlay/Sources/Views/UpdateView.swift +352 -0
  38. codex_flow/data/apps/macos-overlay/Sources/main.swift +340 -0
  39. codex_flow/data/apps/macos-overlay/Tests/OverlayScreenGeometryTests.swift +163 -0
  40. codex_flow/data/apps/macos-overlay/Tests/TelemetryPhase1ContractTests.swift +357 -0
  41. codex_flow/data/apps/macos-overlay/Tests/TelemetryQueryEngineConcurrencyTests.swift +221 -0
  42. codex_flow/data/apps/macos-overlay/Tests/TelemetryQuotaSelectionTests.swift +158 -0
  43. codex_flow/data/apps/macos-overlay/Tests/TelemetryWorkerTokenTests.swift +122 -0
  44. codex_flow/data/apps/macos-overlay/build.sh +75 -0
  45. codex_flow/data/benchmark/corpus.json +103 -0
  46. codex_flow/data/benchmark/manifest.example.json +41 -0
  47. codex_flow/data/benchmark/manifest.schema.json +137 -0
  48. codex_flow/data/benchmark/prices/gpt-5.6-2026-08-30.json +5 -0
  49. codex_flow/data/benchmark/profiles.json +90 -0
  50. codex_flow/data/benchmark/schema.json +77 -0
  51. codex_flow/data/benchmark/tasks.json +50 -0
  52. codex_flow/data/completions/codex-flow.bash +34 -0
  53. codex_flow/data/completions/codex-flow.zsh +52 -0
  54. codex_flow/data/glama.json +6 -0
  55. codex_flow/data/install-release.ps1 +126 -0
  56. codex_flow/data/install-release.sh +155 -0
  57. codex_flow/data/install.ps1 +349 -0
  58. codex_flow/data/install.sh +362 -0
  59. codex_flow/data/policy/benchmark.toml +49 -0
  60. codex_flow/data/policy/defaults.toml +70 -0
  61. codex_flow/data/scripts/analyze-benchmark.py +510 -0
  62. codex_flow/data/scripts/benchmark-local.py +171 -0
  63. codex_flow/data/scripts/check-recommendation.py +277 -0
  64. codex_flow/data/scripts/doctor.py +449 -0
  65. codex_flow/data/scripts/generate-release-manifest.py +74 -0
  66. codex_flow/data/scripts/localization.py +192 -0
  67. codex_flow/data/scripts/manage-hooks.py +448 -0
  68. codex_flow/data/scripts/manage-instructions.py +389 -0
  69. codex_flow/data/scripts/manage-shell.py +151 -0
  70. codex_flow/data/scripts/materialize-corpus.py +193 -0
  71. codex_flow/data/scripts/menu.py +646 -0
  72. codex_flow/data/scripts/migrations/0001_update_settings.py +80 -0
  73. codex_flow/data/scripts/package-release.py +132 -0
  74. codex_flow/data/scripts/render-benchmark-report.py +292 -0
  75. codex_flow/data/scripts/run-benchmark.py +829 -0
  76. codex_flow/data/scripts/strategies/__init__.py +28 -0
  77. codex_flow/data/scripts/strategies/balanced.py +115 -0
  78. codex_flow/data/scripts/strategies/base.py +363 -0
  79. codex_flow/data/scripts/strategies/efficient.py +158 -0
  80. codex_flow/data/scripts/strategies/lifecycle_runtime.py +590 -0
  81. codex_flow/data/scripts/strategies/quality.py +209 -0
  82. codex_flow/data/scripts/strategies/speed.py +108 -0
  83. codex_flow/data/scripts/strategies/task_budget_runtime.py +644 -0
  84. codex_flow/data/scripts/strategies/task_phase_runtime.py +341 -0
  85. codex_flow/data/scripts/strategies/work_unit_runtime.py +421 -0
  86. codex_flow/data/scripts/strategy_runtime.py +1091 -0
  87. codex_flow/data/scripts/telemetry.py +400 -0
  88. codex_flow/data/scripts/telemetry_core/__init__.py +192 -0
  89. codex_flow/data/scripts/telemetry_core/app_server.py +1192 -0
  90. codex_flow/data/scripts/telemetry_core/collector.py +1247 -0
  91. codex_flow/data/scripts/telemetry_core/common.py +421 -0
  92. codex_flow/data/scripts/telemetry_core/latency.py +593 -0
  93. codex_flow/data/scripts/telemetry_core/query.py +427 -0
  94. codex_flow/data/scripts/telemetry_core/quota_ledger.py +598 -0
  95. codex_flow/data/scripts/telemetry_core/render.py +460 -0
  96. codex_flow/data/scripts/telemetry_core/repair.py +223 -0
  97. codex_flow/data/scripts/ui.py +266 -0
  98. codex_flow/data/scripts/update-homebrew-formula.py +146 -0
  99. codex_flow/data/scripts/update_runtime_config.py +134 -0
  100. codex_flow/data/scripts/updater.py +1718 -0
  101. codex_flow/data/smithery.yaml +18 -0
  102. codex_flow/data/templates/agents/worker-explorer.toml +24 -0
  103. codex_flow/data/templates/agents/worker-implementer.toml +49 -0
  104. codex_flow/data/templates/agents/worker-reviewer.toml +25 -0
  105. codex_flow/data/templates/flow-pilot-instructions.md +35 -0
  106. codex_flow/data/templates/skills/flow-pilot/SKILL.md +577 -0
  107. codex_flow/mcp.py +35 -0
  108. codex_flow-2.1.13.dist-info/METADATA +342 -0
  109. codex_flow-2.1.13.dist-info/RECORD +113 -0
  110. codex_flow-2.1.13.dist-info/WHEEL +5 -0
  111. codex_flow-2.1.13.dist-info/entry_points.txt +3 -0
  112. codex_flow-2.1.13.dist-info/licenses/LICENSE +21 -0
  113. codex_flow-2.1.13.dist-info/top_level.txt +1 -0
codex_flow/__init__.py ADDED
@@ -0,0 +1,28 @@
1
+ """Intelligent, Efficient, Adaptive Multi-Agent Strategy Orchestration for Codex."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ __author__ = "Parsifal <zmw@izmw.me>"
9
+
10
+ try:
11
+ if sys.version_info >= (3, 8):
12
+ from importlib.metadata import PackageNotFoundError, version
13
+ else:
14
+ from importlib_metadata import PackageNotFoundError, version # type: ignore
15
+
16
+ __version__ = version("codex-flow")
17
+ except Exception:
18
+ # Fallback to local VERSION file if present
19
+ _pkg_dir = Path(__file__).resolve().parent
20
+ _candidates = [
21
+ _pkg_dir / "data" / "VERSION",
22
+ _pkg_dir.parents[1] / "VERSION",
23
+ ]
24
+ __version__ = "unknown"
25
+ for _c in _candidates:
26
+ if _c.exists():
27
+ __version__ = _c.read_text(encoding="utf-8").strip().lstrip("v")
28
+ break
codex_flow/__main__.py ADDED
@@ -0,0 +1,9 @@
1
+ """Executable entry point for python -m codex_flow."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from codex_flow.cli import main
7
+
8
+ if __name__ == "__main__":
9
+ sys.exit(main())
codex_flow/cli.py ADDED
@@ -0,0 +1,242 @@
1
+ """Unified cross-platform CLI dispatcher for codex-flow."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import platform
7
+ import subprocess
8
+ import sys
9
+ from pathlib import Path
10
+ from typing import List, Optional
11
+
12
+ CODEX_HOME = Path(os.environ.get("CODEX_HOME", Path.home() / ".codex"))
13
+ STATE_DIR = CODEX_HOME / "codex-flow"
14
+ SOURCE_FILE = STATE_DIR / "source"
15
+ POLICY_FILE = CODEX_HOME / "codex-flow.toml"
16
+
17
+
18
+ def get_resource_root() -> Path:
19
+ """Resolve the directory containing runtime scripts and assets."""
20
+ # 1. Check if bundled data directory inside the package exists
21
+ bundled = Path(__file__).resolve().parent / "data"
22
+ if (bundled / "VERSION").exists() and (bundled / "scripts").exists():
23
+ return bundled
24
+
25
+ # 2. Check if running from a git checkout / source tree
26
+ for parent in Path(__file__).resolve().parents:
27
+ if (parent / "VERSION").exists() and (parent / "scripts").exists():
28
+ return parent
29
+
30
+ # 3. Check installed state source file
31
+ if SOURCE_FILE.exists():
32
+ try:
33
+ target = Path(SOURCE_FILE.read_text(encoding="utf-8").strip())
34
+ if target.is_dir():
35
+ return target
36
+ except OSError:
37
+ pass
38
+
39
+ return bundled
40
+
41
+
42
+ def find_script(name: str, root: Path) -> Optional[Path]:
43
+ """Find a script in resource root or state dir."""
44
+ candidates = [
45
+ root / "scripts" / name,
46
+ root / name,
47
+ STATE_DIR / name,
48
+ ]
49
+ for c in candidates:
50
+ try:
51
+ if c.is_file():
52
+ return c
53
+ except OSError:
54
+ continue
55
+ return None
56
+
57
+
58
+ def run_python_script(script_path: Path, args: List[str], env: Optional[dict] = None) -> int:
59
+ """Run a python script using current interpreter and appropriate environment."""
60
+ run_env = os.environ.copy()
61
+ if env:
62
+ run_env.update(env)
63
+
64
+ # Ensure script's directory and its parent are in PYTHONPATH for internal imports
65
+ script_dir = str(script_path.parent)
66
+ parent_dir = str(script_path.parents[1]) if len(script_path.parents) > 1 else script_dir
67
+ existing_pp = run_env.get("PYTHONPATH", "")
68
+ new_pp = f"{script_dir}{os.pathsep}{parent_dir}"
69
+ run_env["PYTHONPATH"] = f"{new_pp}{os.pathsep}{existing_pp}" if existing_pp else new_pp
70
+
71
+ cmd = [sys.executable, str(script_path), *args]
72
+ try:
73
+ proc = subprocess.run(cmd, env=run_env)
74
+ return proc.returncode
75
+ except KeyboardInterrupt:
76
+ return 130
77
+
78
+
79
+ def handle_install(root: Path, args: List[str]) -> int:
80
+ """Execute installation bootstrap."""
81
+ is_windows = platform.system() == "Windows"
82
+
83
+ # Prefer install-release scripts for full multi-platform + prebuilt FlowPilot support
84
+ if is_windows:
85
+ installer = root / "install-release.ps1"
86
+ if not installer.exists():
87
+ installer = root / "install.ps1"
88
+ if not installer.exists():
89
+ print("Error: install.ps1 not found in codex-flow package", file=sys.stderr)
90
+ return 1
91
+ cmd = ["powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", str(installer), *args]
92
+ else:
93
+ installer = root / "install-release.sh"
94
+ if not installer.exists():
95
+ installer = root / "install.sh"
96
+ if not installer.exists():
97
+ print("Error: install.sh not found in codex-flow package", file=sys.stderr)
98
+ return 1
99
+ cmd = ["bash", str(installer), *args]
100
+
101
+ try:
102
+ proc = subprocess.run(cmd)
103
+ return proc.returncode
104
+ except KeyboardInterrupt:
105
+ return 130
106
+
107
+
108
+ def handle_overlay(root: Path, args: List[str]) -> int:
109
+ """Execute native FlowPilot macOS overlay."""
110
+ if platform.system() != "Darwin":
111
+ print("FlowPilot native overlay widget is only available on macOS.", file=sys.stderr)
112
+ return 1
113
+
114
+ candidates = [
115
+ STATE_DIR / "bin" / "FlowPilot",
116
+ STATE_DIR / "bin" / "codex-flow-overlay",
117
+ root / "apps" / "macos-overlay" / "bin" / "FlowPilot",
118
+ root / "apps" / "macos-overlay" / "bin" / "codex-flow-overlay",
119
+ ]
120
+ overlay_bin = None
121
+ for c in candidates:
122
+ if c.is_file() and os.access(c, os.X_OK):
123
+ overlay_bin = c
124
+ break
125
+
126
+ if not overlay_bin:
127
+ print(
128
+ "FlowPilot native overlay is not built or installed yet. Run: codex-flow install",
129
+ file=sys.stderr,
130
+ )
131
+ return 1
132
+
133
+ sub = args[0] if args else "toggle"
134
+ if sub in ("start", "restart"):
135
+ logs_dir = STATE_DIR / "logs"
136
+ logs_dir.mkdir(parents=True, exist_ok=True)
137
+ start_log = logs_dir / "flowpilot-start.log"
138
+ with open(start_log, "a", encoding="utf-8") as lf:
139
+ proc = subprocess.Popen([str(overlay_bin), "start"], stdout=lf, stderr=lf)
140
+ print("๐Ÿš€ Launched FlowPilot in background.")
141
+ return 0
142
+ else:
143
+ proc = subprocess.run([str(overlay_bin), *args])
144
+ return proc.returncode
145
+
146
+
147
+ def main(argv: Optional[List[str]] = None) -> int:
148
+ """Main CLI entry point."""
149
+ if argv is None:
150
+ argv = sys.argv[1:]
151
+
152
+ root = get_resource_root()
153
+
154
+ if not argv:
155
+ if sys.stdin.isatty() and sys.stdout.isatty() and os.environ.get("TERM") != "dumb":
156
+ menu = find_script("menu.py", root)
157
+ if menu:
158
+ return run_python_script(menu, [])
159
+ argv = ["help"]
160
+
161
+ cmd = argv[0]
162
+ rest = argv[1:]
163
+
164
+ if cmd in ("install", "init"):
165
+ return handle_install(root, rest)
166
+
167
+ if cmd in ("status", "help", "-h", "--help"):
168
+ ui = find_script("ui.py", root)
169
+ if not ui:
170
+ print("Error: ui.py helper not found; reinstall codex-flow", file=sys.stderr)
171
+ return 1
172
+ sub = "status" if cmd == "status" else "help"
173
+ return run_python_script(ui, [sub, *rest])
174
+
175
+ if cmd == "language":
176
+ ui = find_script("ui.py", root)
177
+ if not ui:
178
+ print("Error: ui.py helper not found; reinstall codex-flow", file=sys.stderr)
179
+ return 1
180
+ return run_python_script(ui, ["language", *rest])
181
+
182
+ if cmd == "strategy":
183
+ strat = find_script("strategy_runtime.py", root)
184
+ if not strat:
185
+ print("Error: strategy_runtime.py not found; reinstall codex-flow", file=sys.stderr)
186
+ return 1
187
+ return run_python_script(strat, ["--policy", str(POLICY_FILE), *rest])
188
+
189
+ if cmd in ("usage", "telemetry"):
190
+ tel = find_script("telemetry.py", root)
191
+ if not tel:
192
+ print("Error: telemetry.py not found; reinstall codex-flow", file=sys.stderr)
193
+ return 1
194
+ sub_args = rest if rest else ["last"]
195
+ return run_python_script(tel, sub_args)
196
+
197
+ if cmd == "doctor":
198
+ doc = find_script("doctor.py", root)
199
+ if not doc:
200
+ print("Error: doctor.py not found; reinstall codex-flow", file=sys.stderr)
201
+ return 1
202
+ return run_python_script(doc, rest)
203
+
204
+ if cmd == "update":
205
+ upd = find_script("updater.py", root)
206
+ if not upd:
207
+ print("Error: updater.py not found; reinstall codex-flow", file=sys.stderr)
208
+ return 1
209
+ return run_python_script(upd, rest)
210
+
211
+ if cmd == "rollback":
212
+ upd = find_script("updater.py", root)
213
+ if not upd:
214
+ print("Error: updater.py not found; reinstall codex-flow", file=sys.stderr)
215
+ return 1
216
+ return run_python_script(upd, ["rollback", *rest])
217
+
218
+ if cmd == "overlay":
219
+ return handle_overlay(root, rest)
220
+
221
+ if cmd == "benchmark":
222
+ bench = find_script("run-benchmark.py", root)
223
+ if bench:
224
+ return run_python_script(bench, rest)
225
+
226
+ if cmd == "benchmark-local":
227
+ bench = find_script("benchmark-local.py", root)
228
+ if bench:
229
+ return run_python_script(bench, rest)
230
+
231
+ if cmd == "benchmark-analyze":
232
+ bench = find_script("analyze-benchmark.py", root)
233
+ if bench:
234
+ return run_python_script(bench, rest)
235
+
236
+ print(f"codex-flow: unknown command: {cmd}", file=sys.stderr)
237
+ print("Run 'codex-flow help' for available commands.", file=sys.stderr)
238
+ return 1
239
+
240
+
241
+ if __name__ == "__main__":
242
+ sys.exit(main())
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 codex-flow contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,303 @@
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
+ **Intelligent, Efficient, Adaptive Multi-Agent Strategy Orchestration for Codex**
10
+
11
+ [![Version](https://img.shields.io/badge/version-2.1.13-blue.svg?style=flat-square)](VERSION)
12
+ [![Homebrew](https://img.shields.io/badge/Homebrew-ParsifalC%2Ftap-orange.svg?style=flat-square&logo=homebrew)](https://github.com/ParsifalC/homebrew-tap)
13
+ [![PyPI](https://img.shields.io/pypi/v/codex-flow.svg?style=flat-square&logo=pypi)](https://pypi.org/project/codex-flow/)
14
+ [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-brightgreen.svg?style=flat-square)](#-quick-start)
15
+ [![SwiftUI](https://img.shields.io/badge/UI-SwiftUI%20%2B%20AppKit-orange.svg?style=flat-square)](docs/overlay.en.md)
16
+ [![Telemetry](https://img.shields.io/badge/telemetry-deterministic%200--cost-purple.svg?style=flat-square)](docs/telemetry.en.md)
17
+ [![Smithery](https://img.shields.io/badge/Smithery-FlowPilot-black.svg?style=flat-square)](https://smithery.ai)
18
+ [![Glama](https://img.shields.io/badge/Glama-MCP-5046e6.svg?style=flat-square)](https://glama.ai/mcp/servers)
19
+ [![LinuxDo](https://img.shields.io/badge/LinuxDo-Public%20Beta-5046e6.svg?style=flat-square)](https://linux.do)
20
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](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
+ [**็ฎ€ไฝ“ไธญๆ–‡**](README.md) ยท [**Strategy Runtime**](docs/strategy-runtime.md) ยท [**Configuration**](docs/configuration.en.md) ยท [**Telemetry**](docs/telemetry.en.md) ยท [**Native Overlay**](docs/overlay.en.md) ยท [**Benchmarks**](docs/benchmark.en.md)
29
+
30
+ <br />
31
+
32
+ > ๐Ÿ“ข **Community Beta**: `codex-flow` is currently in public beta on [**LINUX DO**](https://linux.do). Feedback, suggestions, and discussions are welcome!
33
+
34
+ <br />
35
+
36
+ > **โ€œ Spend expensive Parent capability on high-value decisions; let efficient Workers reason deeper through execution, and concentrate premium capability on critical Implementer / Reviewer roles instead of upgrading every Worker indiscriminately. โ€**
37
+
38
+ </div>
39
+
40
+ ---
41
+
42
+ ## โœจ Key Highlights
43
+
44
+ <table>
45
+ <tr>
46
+ <td width="50%" valign="top">
47
+ <h3>๐Ÿง  Multi-Strategy Runtime</h3>
48
+ <p>Built-in <code>efficient</code>, <code>balanced</code>, <code>quality</code>, and <code>speed</code> strategies compile TaskProfile โ†’ WorkerBudget โ†’ ExecutionPlan v7 through one deterministic runtime.</p>
49
+ </td>
50
+ <td width="50%" valign="top">
51
+ <h3>โš™๏ธ Dynamic Worker Budgeting</h3>
52
+ <p>Fan-out is no longer fixed at one or two Workers. Runtime derives Explorer / Implementer / Reviewer counts from uncertainty, proven workstream isolation, quota, strategy budget, and hard thread ceilings.</p>
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td width="50%" valign="top">
57
+ <h3>๐Ÿง  Worker-First Reasoning</h3>
58
+ <p>Fresh installs keep Parent mostly at <code>high</code> while Worker roles start at <code>xhigh</code>. Delegated roles run at least one effort tier above Parent whenever the supported effort ladder permits it.</p>
59
+ </td>
60
+ <td width="50%" valign="top">
61
+ <h3>๐Ÿ† Quality Intent</h3>
62
+ <p><code>quality</code> supports per-task <code>normal / strong / absolute</code> intent. Ordinary Explorers remain <code>latest-efficient</code>; strong/absolute intent can promote high-value Implementer / Reviewer roles to <code>latest-capable</code>. Explorers move to Parent-class capability only when technical risk itself is critical.</p>
63
+ </td>
64
+ </tr>
65
+ </table>
66
+
67
+ ---
68
+
69
+ ## ๐Ÿงฉ Built-In Strategies
70
+
71
+ | Strategy | Optimization Goal | Demanding-task Worker tendency |
72
+ | :--- | :--- | :--- |
73
+ | **`efficient`** | Reduce expensive Parent use and wasted total work | Up to roughly 2 Explorers / 2 Implementers, low speculation, quota-aware collapse |
74
+ | **`balanced`** | Balance quality, quota, and latency | Up to roughly 3 Explorers / 3 Implementers with moderate safe parallelism |
75
+ | **`quality`** | Maximize correctness and verification confidence | Normal complex work prefers efficient Workers + `max` reasoning; `strong/absolute` promotes only key Implementer / Reviewer roles while Explorers remain efficient by default |
76
+ | **`speed`** | Minimize wall-clock latency | Budget allows up to 8 Implementers; actual count follows proven writable workstreams and runtime ceiling |
77
+
78
+ `quality_intent` is **per-task semantic intent**, not persistent policy and not an alias for `risk`; only the `quality` strategy consumes it:
79
+
80
+ ```text
81
+ normal โ†’ ordinary quality target; prefer latest-efficient Workers with deep reasoning
82
+ strong โ†’ explicit quality-over-cost preference; Parent-class Implementer / Reviewer capability is allowed
83
+ absolute โ†’ explicit highest-quality preference; correctness > quota / latency inside hard safety ceilings while Explorers remain latest-efficient by default
84
+ ```
85
+
86
+ The persistent default remains:
87
+
88
+ ```text
89
+ strategy = efficient
90
+ routing = adaptive
91
+ ```
92
+
93
+ However, v1.7 fresh-install resource policy is intentionally more Worker-centric than the earlier architecture. Existing customized reasoning settings are preserved losslessly across update/reinstall.
94
+
95
+ ---
96
+
97
+ ## ๐Ÿš€ Quick Start
98
+
99
+ ### Prerequisites
100
+
101
+ > ๐Ÿ’ก **Note**: The Codex CLI is **only required for initial installation checks and one-time hook authorization**. Once initial setup is complete, you can use the **Codex Desktop App exclusively** for daily workflows without ever touching the CLI.
102
+
103
+ Ensure the Codex CLI is installed for initial bootstrap:
104
+ ```bash
105
+ # via npm
106
+ npm install -g @openai/codex
107
+
108
+ # or via macOS Homebrew
109
+ brew install codex
110
+ ```
111
+
112
+ ### Quick Installation
113
+
114
+ #### Option 1: PyPI Installation (Recommended across Windows / macOS / Linux)
115
+
116
+ ```bash
117
+ # Recommended using pipx (isolated environment)
118
+ pipx install codex-flow
119
+
120
+ # Or using standard pip
121
+ pip install codex-flow
122
+
123
+ # Initialize configuration and environment
124
+ codex-flow install
125
+ ```
126
+
127
+ #### Option 2: Homebrew (macOS & Linux)
128
+
129
+ ```bash
130
+ brew install ParsifalC/tap/codex-flow
131
+ codex-flow install
132
+ ```
133
+
134
+ #### Option 3: Automated Bootstrap Script
135
+
136
+ Fresh installs use the matching GitHub Release artifact directly; cloning the repository is not required.
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
+ The bootstrap detects OS/CPU, resolves the Latest Stable Release, downloads the matching artifact, verifies SHA-256, installs it under `~/.codex/codex-flow/versions/<version>`, and runs health checks. Windows automatically selects the x86_64 or ARM64 ZIP. macOS uses the prebuilt FlowPilot binary from the Release and starts the floating widget automatically without running `build.sh` locally.
149
+
150
+ > โš ๏ธ **Final step**:
151
+ > 1. **One-time authorization**: Launch `codex` in your terminal once, type `/hooks` in the conversation prompt, and approve FlowPilot telemetry (required only once for permanent trust).
152
+ > 2. **Restart Codex Desktop**: Fully quit and relaunch your Codex Desktop App. FlowPilot is already running on macOS; you can now perform all daily tasks directly in the Codex Desktop App.
153
+
154
+ The installer also adds a marked FlowPilot entry block to the effective global `AGENTS.md`. This tells the active agent to load the installed skill and record the strategy gate receipt before repository technical work, so you do not need to name the skill. Start a new task after installation or fully reload Codex so the updated instructions are available. A disabled global switch or a consumed one-shot bypass allows ordinary execution for that task. This prompt entry depends on the active host following its instructions; it is not a 100% enforcement boundary, and lifecycle hooks remain telemetry-only.
155
+
156
+ ---
157
+
158
+ ## ๐ŸŽฎ Basic Usage
159
+
160
+ ### 1. Inspect or change strategy
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. Per-task natural-language overrides
171
+
172
+ ```text
173
+ ๐Ÿ‘‰ Strategy : "quality first" / "minimize Plan quota" / "finish as fast as possible"
174
+ ๐Ÿ‘‰ Strong quality : "quality first; use stronger models when useful" โ†’ quality_intent=strong
175
+ ๐Ÿ‘‰ Max quality : "cost is secondary; use the strongest models and independent verification" โ†’ quality_intent=absolute
176
+ ๐Ÿ‘‰ Adaptive : "follow default strategy" / "handle adaptively"
177
+ ๐Ÿ‘‰ Delegate : "use subagents" / "assign to workers"
178
+ ๐Ÿ‘‰ Direct : "do not use subagents" / "complete directly"
179
+ ```
180
+
181
+ Strategy and routing are orthogonal. For example:
182
+
183
+ ```text
184
+ quality + direct
185
+ ```
186
+
187
+ uses quality-oriented capability/reasoning policy while keeping execution in Parent for that task.
188
+
189
+ ### 3. Compile a deterministic ExecutionPlan
190
+
191
+ ```bash
192
+ codex-flow strategy plan \
193
+ --profile quality \
194
+ --quality-intent strong \
195
+ --complexity complex \
196
+ --uncertainty high \
197
+ --parallelism high
198
+ ```
199
+
200
+ The Plan exposes `quality_intent`, the selected `worker_budget`, and separate role-scoped resources:
201
+
202
+ ```text
203
+ explorer_capability_policy / explorer_model / explorer_reasoning
204
+ implementer_capability_policy / implementer_model / implementer_reasoning
205
+ reviewer_capability_policy / reviewer_model / reviewer_reasoning
206
+ ```
207
+
208
+ It also includes concrete `exploration_workers`, `implementation_workers`, `reviewer_workers`, and `planned_worker_count`.
209
+
210
+ ### 4. Interactive console
211
+
212
+ ```bash
213
+ codex-flow
214
+ ```
215
+
216
+ The latest console also integrates Overlay build/start management, effective policy, Benchmark, and telemetry entry points:
217
+
218
+ ```text
219
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
220
+ โ”‚ ๐Ÿš€ codex-flow Console (v2.1.13) โ”‚
221
+ โ”‚ FlowPilot orchestration ยท deterministic telemetry ยท validation โ”‚
222
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
223
+ [1] ๐ŸชŸ macOS native floating widget (overlay widget)
224
+ [2] ๐Ÿ“Š Latest task card (usage last)
225
+ [3] ๐Ÿ“œ Task history (usage list)
226
+ [4] ๐Ÿ“ˆ Project aggregate statistics (usage stats)
227
+ [5] ๐ŸŽฏ Effective policy (status)
228
+ [6] ๐Ÿฉบ Diagnostics (doctor)
229
+ [7] โšก Local quick Benchmark (benchmark-local quick)
230
+ [8] ๐Ÿ”„ Check and pull updates (update)
231
+ [0] ๐Ÿšช Exit
232
+ ```
233
+
234
+ The Overlay submenu can start the widget directly, build and start it, build only, orโ€”when runningโ€”rebuild/restart, toggle expansion, and push the latest data. Users no longer need to run `build.sh` manually first.
235
+
236
+ ### 5. Essential commands
237
+
238
+ ```bash
239
+ codex-flow usage last
240
+ codex-flow usage list --today
241
+ codex-flow usage stats -d 30
242
+ codex-flow doctor
243
+ codex-flow update
244
+ ```
245
+
246
+ ### 6. MCP Clients & Registry Integration (Claude Desktop / Cursor / Smithery / Glama)
247
+
248
+ `codex-flow` bundles a standard Model Context Protocol (MCP) server for feeding deterministic FlowPilot telemetry into any MCP-compatible client:
249
+
250
+ * **Claude Desktop / Cursor (`stdio` mode)**:
251
+ Add to your `claude_desktop_config.json` or Cursor MCP settings:
252
+ ```json
253
+ {
254
+ "mcpServers": {
255
+ "flowpilot": {
256
+ "command": "codex-flow-mcp",
257
+ "args": ["--stdio"]
258
+ }
259
+ }
260
+ }
261
+ ```
262
+ * **Smithery.ai**: Configured via `smithery.yaml` in the repo root for one-click discovery and agent mounting.
263
+ * **Glama**: Authenticated via `glama.json` in the repo root and indexed in the Glama MCP registry.
264
+
265
+ ---
266
+
267
+ ## ๐ŸชŸ FlowPilot Native macOS Widget
268
+
269
+ A **100% native SwiftUI + AppKit** frosted-glass dashboard for task lifecycle and quota observability.
270
+
271
+ <div align="center">
272
+ <img src="docs/assets/promo/flowpilot_promo_poster.png" alt="FlowPilot Native Widget Showcase" width="100%" style="border-radius: 12px; margin: 16px 0;" />
273
+ </div>
274
+
275
+ - **๐ŸŸข Micro Capsule**: edge docking with task state and latest usage.
276
+ - **โšก๏ธ Live Inspector**: time, token, cost, quota, and Agent topology.
277
+ - **๐Ÿ“œ Task History**: cross-project timeline and drill-down.
278
+ - **๐Ÿ“Š Analytics**: 7d/30d cache efficiency, Worker offload, and model/project distribution.
279
+
280
+ ```bash
281
+ codex-flow overlay start
282
+ codex-flow overlay toggle
283
+ ```
284
+
285
+ ---
286
+
287
+ ## ๐Ÿ“š Deep-Dive Documentation
288
+
289
+ | Module | Document | Description |
290
+ | :--- | :--- | :--- |
291
+ | **๐Ÿง  Strategy Runtime** | [docs/strategy-runtime.md](docs/strategy-runtime.md) | TaskProfile, Quality Intent, WorkerBudget, Strategy Registry, ExecutionPlan v7, role-scoped resources |
292
+ | **โš™๏ธ Configuration** | [docs/configuration.en.md](docs/configuration.en.md) | Policy schema v4, Worker-first reasoning, routing, runtime ceilings |
293
+ | **๐Ÿ“ˆ Telemetry & Quota** | [docs/telemetry.en.md](docs/telemetry.en.md) | Hook lifecycle, token attribution, quota sampling |
294
+ | **๐ŸชŸ Native Overlay** | [docs/overlay.en.md](docs/overlay.en.md) | Gestures, IPC, SwiftUI architecture |
295
+ | **๐Ÿงช Local Benchmarks** | [docs/benchmark.en.md](docs/benchmark.en.md) | Keyless validation and multi-strategy comparisons |
296
+ | **โ˜๏ธ Actions CI** | [docs/benchmark-actions.en.md](docs/benchmark-actions.en.md) | GitHub Actions benchmark workflow |
297
+ | **๐ŸŒ Localization** | [docs/localization.en.md](docs/localization.en.md) | English / Chinese localization coverage |
298
+
299
+ ---
300
+
301
+ ## ๐Ÿ“„ License
302
+
303
+ This project is licensed under the [MIT License](LICENSE).