@oh-my-pi/pi-coding-agent 17.2.3 → 17.2.5

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 (375) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/dist/{CHANGELOG-c5hpqt9r.md → CHANGELOG-q2w43aw3.md} +92 -0
  3. package/dist/cli.js +3979 -3548
  4. package/dist/{template-8vdv6xb4.js → template-c2hyaytt.js} +8 -26
  5. package/dist/types/advisor/advise-tool.d.ts +6 -0
  6. package/dist/types/advisor/runtime.d.ts +4 -4
  7. package/dist/types/capability/mcp.d.ts +9 -0
  8. package/dist/types/cli/args.d.ts +4 -1
  9. package/dist/types/cli/browser-relay-cli.d.ts +15 -0
  10. package/dist/types/cli/command-help.d.ts +99 -0
  11. package/dist/types/cli/help-extra.d.ts +2 -0
  12. package/dist/types/cli/models-cli.d.ts +1 -1
  13. package/dist/types/cli/thinking-levels.d.ts +5 -0
  14. package/dist/types/cli/update-cli.d.ts +13 -0
  15. package/dist/types/commands/browser-relay.d.ts +38 -0
  16. package/dist/types/commands/commit.d.ts +3 -0
  17. package/dist/types/commands/complete.d.ts +1 -1
  18. package/dist/types/commands/completions.d.ts +6 -0
  19. package/dist/types/commands/grep.d.ts +3 -0
  20. package/dist/types/commands/join.d.ts +4 -0
  21. package/dist/types/commands/launch-help.d.ts +171 -0
  22. package/dist/types/commands/launch.d.ts +5 -1
  23. package/dist/types/commands/models.d.ts +3 -0
  24. package/dist/types/commands/say.d.ts +10 -0
  25. package/dist/types/commands/worktree.d.ts +3 -0
  26. package/dist/types/config/keybindings.d.ts +6 -1
  27. package/dist/types/config/model-discovery.d.ts +2 -2
  28. package/dist/types/config/models-config-schema-bundle.d.ts +3 -0
  29. package/dist/types/config/models-config-schema.d.ts +2 -0
  30. package/dist/types/config/models-config.d.ts +1 -0
  31. package/dist/types/config/service-tier.d.ts +2 -0
  32. package/dist/types/config/settings-schema.d.ts +70 -22
  33. package/dist/types/cursor-bridge-tools.d.ts +1 -1
  34. package/dist/types/cursor.d.ts +7 -4
  35. package/dist/types/discovery/helpers.d.ts +6 -0
  36. package/dist/types/discovery/omp-extension-roots.d.ts +21 -2
  37. package/dist/types/edit/index.d.ts +3 -3
  38. package/dist/types/edit/modes/replace.d.ts +22 -15
  39. package/dist/types/edit/renderer.d.ts +1 -1
  40. package/dist/types/eval/py/kernel.d.ts +3 -1
  41. package/dist/types/eval/py/spawn-options.d.ts +12 -16
  42. package/dist/types/extensibility/extensions/loader.d.ts +6 -2
  43. package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +8 -1
  44. package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
  45. package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +2 -0
  46. package/dist/types/extensibility/plugins/marketplace/registry.d.ts +2 -2
  47. package/dist/types/launch/broker.d.ts +1 -1
  48. package/dist/types/launch/client.d.ts +6 -3
  49. package/dist/types/launch/ensure.d.ts +8 -0
  50. package/dist/types/launch/paths.d.ts +3 -2
  51. package/dist/types/launch/protocol.d.ts +2 -2
  52. package/dist/types/lsp/client.d.ts +2 -0
  53. package/dist/types/lsp/mux/daemon.d.ts +15 -0
  54. package/dist/types/lsp/mux/protocol.d.ts +57 -0
  55. package/dist/types/lsp/mux/server.d.ts +18 -0
  56. package/dist/types/lsp/types.d.ts +22 -2
  57. package/dist/types/main.d.ts +2 -0
  58. package/dist/types/mcp/request-id.d.ts +19 -0
  59. package/dist/types/mcp/types.d.ts +14 -0
  60. package/dist/types/memory-backend/index.d.ts +1 -0
  61. package/dist/types/memory-backend/messages.d.ts +15 -0
  62. package/dist/types/mnemopi/embed-client.d.ts +1 -1
  63. package/dist/types/mnemopi/state.d.ts +0 -23
  64. package/dist/types/modes/components/assistant-message.d.ts +2 -0
  65. package/dist/types/modes/components/custom-editor.d.ts +2 -1
  66. package/dist/types/modes/components/model-browser.d.ts +7 -5
  67. package/dist/types/modes/components/model-picker.d.ts +9 -3
  68. package/dist/types/modes/components/read-tool-group.d.ts +11 -0
  69. package/dist/types/modes/components/stripped-tool-calls-placeholder.d.ts +12 -0
  70. package/dist/types/modes/components/tool-execution.d.ts +2 -0
  71. package/dist/types/modes/controllers/input-controller.d.ts +1 -0
  72. package/dist/types/modes/interactive-mode.d.ts +1 -0
  73. package/dist/types/modes/types.d.ts +2 -1
  74. package/dist/types/modes/workflow.d.ts +2 -1
  75. package/dist/types/registry/agent-lifecycle.d.ts +14 -5
  76. package/dist/types/registry/agent-registry.d.ts +4 -3
  77. package/dist/types/sdk.d.ts +4 -2
  78. package/dist/types/secrets/index.d.ts +7 -9
  79. package/dist/types/session/agent-session-types.d.ts +3 -1
  80. package/dist/types/session/agent-session.d.ts +6 -1
  81. package/dist/types/session/indexed-session-storage.d.ts +1 -0
  82. package/dist/types/session/model-controls.d.ts +0 -1
  83. package/dist/types/session/session-advisors.d.ts +8 -1
  84. package/dist/types/session/session-context.d.ts +2 -1
  85. package/dist/types/session/session-maintenance.d.ts +2 -0
  86. package/dist/types/session/session-manager.d.ts +16 -5
  87. package/dist/types/session/session-stats.d.ts +10 -0
  88. package/dist/types/session/session-storage.d.ts +15 -3
  89. package/dist/types/system-prompt.d.ts +6 -1
  90. package/dist/types/task/index.d.ts +2 -1
  91. package/dist/types/task/spawn-policy.d.ts +5 -0
  92. package/dist/types/thinking.d.ts +1 -7
  93. package/dist/types/tools/ast-grep.d.ts +1 -1
  94. package/dist/types/tools/browser/registry.d.ts +2 -1
  95. package/dist/types/tools/browser/relay/bridge.d.ts +35 -0
  96. package/dist/types/tools/browser/relay/daemon.d.ts +16 -0
  97. package/dist/types/tools/browser/relay/kind.d.ts +19 -0
  98. package/dist/types/tools/browser/relay/protocol.d.ts +97 -0
  99. package/dist/types/tools/browser/relay/server.d.ts +35 -0
  100. package/dist/types/tools/browser/render.d.ts +1 -0
  101. package/dist/types/tools/browser.d.ts +3 -0
  102. package/dist/types/tools/computer/exposure.d.ts +9 -7
  103. package/dist/types/tools/computer/protocol.d.ts +70 -17
  104. package/dist/types/tools/computer/supervisor.d.ts +23 -10
  105. package/dist/types/tools/computer/worker-entry.d.ts +1 -0
  106. package/dist/types/tools/computer/worker.d.ts +42 -7
  107. package/dist/types/tools/computer-renderer.d.ts +7 -5
  108. package/dist/types/tools/computer.d.ts +25 -44
  109. package/dist/types/tools/context.d.ts +3 -0
  110. package/dist/types/tools/default-renderer.d.ts +3 -0
  111. package/dist/types/tools/glob.d.ts +1 -1
  112. package/dist/types/tools/grep.d.ts +1 -1
  113. package/dist/types/tools/render-utils.d.ts +2 -0
  114. package/dist/types/tools/{browser/run-cancellation.d.ts → run-scope.d.ts} +8 -8
  115. package/dist/types/tools/tool-timeouts.d.ts +5 -0
  116. package/dist/types/tools/xdev.d.ts +8 -0
  117. package/dist/types/utils/clipboard.d.ts +2 -2
  118. package/dist/types/web/kagi.d.ts +1 -0
  119. package/dist/types/web/search/index.d.ts +1 -1
  120. package/dist/types/web/search/providers/anthropic.d.ts +1 -0
  121. package/dist/types/web/search/providers/base.d.ts +2 -0
  122. package/dist/types/web/search/providers/brave.d.ts +1 -0
  123. package/dist/types/web/search/providers/browser-page.d.ts +1 -0
  124. package/dist/types/web/search/providers/codex.d.ts +1 -0
  125. package/dist/types/web/search/providers/exa.d.ts +1 -0
  126. package/dist/types/web/search/providers/firecrawl.d.ts +1 -0
  127. package/dist/types/web/search/providers/gemini.d.ts +1 -0
  128. package/dist/types/web/search/providers/jina.d.ts +1 -0
  129. package/dist/types/web/search/providers/kagi.d.ts +1 -0
  130. package/dist/types/web/search/providers/kimi.d.ts +1 -0
  131. package/dist/types/web/search/providers/parallel.d.ts +1 -0
  132. package/dist/types/web/search/providers/perplexity.d.ts +1 -0
  133. package/dist/types/web/search/providers/searxng.d.ts +1 -0
  134. package/dist/types/web/search/providers/tavily.d.ts +1 -0
  135. package/dist/types/web/search/providers/tinyfish.d.ts +1 -0
  136. package/dist/types/web/search/providers/utils.d.ts +6 -9
  137. package/dist/types/web/search/providers/zai.d.ts +1 -0
  138. package/dist/types/web/search/types.d.ts +4 -0
  139. package/package.json +12 -12
  140. package/scripts/legacy-pi-virtual-module.ts +12 -2
  141. package/src/advisor/advise-tool.ts +18 -0
  142. package/src/advisor/runtime.ts +6 -6
  143. package/src/capability/mcp.ts +7 -0
  144. package/src/cli/args.ts +7 -87
  145. package/src/cli/browser-relay-cli.ts +119 -0
  146. package/src/cli/command-help.ts +103 -0
  147. package/src/cli/completion-gen.ts +5 -5
  148. package/src/cli/flag-tables.ts +9 -0
  149. package/src/cli/help-extra.ts +89 -0
  150. package/src/cli/models-cli.ts +13 -16
  151. package/src/cli/setup-cli.ts +13 -21
  152. package/src/cli/thinking-levels.ts +7 -0
  153. package/src/cli/update-cli.ts +26 -7
  154. package/src/cli-commands.ts +170 -33
  155. package/src/cli.ts +17 -5
  156. package/src/collab/host.ts +1 -1
  157. package/src/commands/acp.ts +3 -1
  158. package/src/commands/agents.ts +3 -2
  159. package/src/commands/auth-broker.ts +3 -2
  160. package/src/commands/auth-gateway.ts +3 -2
  161. package/src/commands/bench.ts +2 -3
  162. package/src/commands/browser-relay.ts +53 -0
  163. package/src/commands/cleanse.ts +2 -2
  164. package/src/commands/commit.ts +3 -2
  165. package/src/commands/complete.ts +2 -1
  166. package/src/commands/completions.ts +3 -2
  167. package/src/commands/config.ts +3 -2
  168. package/src/commands/dry-balance.ts +2 -2
  169. package/src/commands/gallery.ts +3 -2
  170. package/src/commands/gc.ts +3 -2
  171. package/src/commands/grep.ts +3 -2
  172. package/src/commands/grievances.ts +3 -2
  173. package/src/commands/install.ts +2 -2
  174. package/src/commands/join.ts +3 -2
  175. package/src/commands/launch-help.ts +116 -0
  176. package/src/commands/launch.ts +7 -191
  177. package/src/commands/models.ts +3 -2
  178. package/src/commands/plugin.ts +3 -2
  179. package/src/commands/read.ts +3 -2
  180. package/src/commands/say.ts +3 -2
  181. package/src/commands/setup.ts +3 -2
  182. package/src/commands/shell.ts +3 -2
  183. package/src/commands/ssh.ts +3 -2
  184. package/src/commands/stats.ts +3 -2
  185. package/src/commands/tiny-models.ts +2 -2
  186. package/src/commands/token.ts +2 -2
  187. package/src/commands/ttsr.ts +2 -2
  188. package/src/commands/update.ts +3 -2
  189. package/src/commands/usage.ts +3 -2
  190. package/src/commands/web-search.ts +3 -2
  191. package/src/commands/worktree.ts +3 -2
  192. package/src/config/keybindings.ts +19 -9
  193. package/src/config/mcp-schema.json +5 -0
  194. package/src/config/model-discovery.ts +30 -13
  195. package/src/config/model-registry.ts +16 -6
  196. package/src/config/models-config-schema-bundle.ts +9 -0
  197. package/src/config/resolve-config-value.ts +2 -1
  198. package/src/config/service-tier.ts +5 -0
  199. package/src/config/settings-schema.ts +73 -21
  200. package/src/cursor-bridge-tools.ts +1 -1
  201. package/src/cursor.ts +10 -14
  202. package/src/discovery/builtin.ts +10 -0
  203. package/src/discovery/helpers.ts +10 -0
  204. package/src/discovery/mcp-json.ts +11 -1
  205. package/src/discovery/omp-extension-roots.ts +79 -20
  206. package/src/discovery/omp-plugins.ts +10 -1
  207. package/src/edit/diff.ts +17 -8
  208. package/src/edit/index.ts +20 -7
  209. package/src/edit/modes/replace.ts +93 -40
  210. package/src/edit/renderer.ts +1 -1
  211. package/src/edit/streaming.ts +14 -17
  212. package/src/eval/py/kernel.ts +2 -1
  213. package/src/eval/py/spawn-options.ts +24 -29
  214. package/src/export/html/template.js +8 -26
  215. package/src/extensibility/extensions/loader.ts +66 -28
  216. package/src/extensibility/extensions/wrapper.ts +1 -0
  217. package/src/extensibility/legacy-pi-ai-shim.ts +22 -1
  218. package/src/extensibility/legacy-pi-coding-agent-shim.ts +7 -6
  219. package/src/extensibility/plugins/legacy-pi-compat.ts +124 -57
  220. package/src/extensibility/plugins/marketplace/registry.ts +4 -8
  221. package/src/extensibility/skills.ts +11 -0
  222. package/src/extensibility/utils.ts +10 -2
  223. package/src/launch/broker.ts +1 -1
  224. package/src/launch/client.ts +32 -13
  225. package/src/launch/ensure.ts +73 -0
  226. package/src/launch/paths.ts +3 -6
  227. package/src/launch/protocol.ts +2 -2
  228. package/src/lsp/client.ts +23 -2
  229. package/src/lsp/index.ts +8 -0
  230. package/src/lsp/mux/daemon.ts +348 -0
  231. package/src/lsp/mux/protocol.ts +96 -0
  232. package/src/lsp/mux/server.ts +797 -0
  233. package/src/lsp/types.ts +28 -2
  234. package/src/main.ts +31 -24
  235. package/src/mcp/config.ts +1 -0
  236. package/src/mcp/oauth-flow.ts +11 -1
  237. package/src/mcp/request-id.ts +24 -0
  238. package/src/mcp/transports/http.ts +4 -2
  239. package/src/mcp/transports/sse.ts +4 -2
  240. package/src/mcp/transports/stdio.ts +4 -2
  241. package/src/mcp/types.ts +15 -0
  242. package/src/memory-backend/index.ts +1 -0
  243. package/src/memory-backend/messages.ts +19 -0
  244. package/src/mnemopi/embed-client.ts +49 -2
  245. package/src/mnemopi/state.ts +57 -23
  246. package/src/modes/components/agent-hub.ts +1 -1
  247. package/src/modes/components/assistant-message.ts +11 -0
  248. package/src/modes/components/chat-transcript-builder.ts +4 -0
  249. package/src/modes/components/custom-editor.ts +10 -1
  250. package/src/modes/components/model-browser.ts +25 -17
  251. package/src/modes/components/model-picker.ts +10 -6
  252. package/src/modes/components/read-tool-group.ts +36 -0
  253. package/src/modes/components/status-line/component.ts +1 -1
  254. package/src/modes/components/stripped-tool-calls-placeholder.ts +35 -0
  255. package/src/modes/components/tool-execution.ts +85 -20
  256. package/src/modes/components/tree-selector.ts +46 -48
  257. package/src/modes/controllers/command-controller.ts +2 -2
  258. package/src/modes/controllers/event-controller.ts +199 -10
  259. package/src/modes/controllers/input-controller.ts +39 -1
  260. package/src/modes/controllers/mcp-command-controller.ts +11 -5
  261. package/src/modes/controllers/selector-controller.ts +47 -6
  262. package/src/modes/interactive-mode.ts +2 -0
  263. package/src/modes/types.ts +6 -1
  264. package/src/modes/utils/hotkeys-markdown.ts +1 -0
  265. package/src/modes/utils/interactive-context-helpers.ts +1 -0
  266. package/src/modes/utils/ui-helpers.ts +6 -10
  267. package/src/modes/workflow.ts +8 -2
  268. package/src/prompts/agents/init.md +1 -1
  269. package/src/prompts/system/plan-mode-active.md +2 -2
  270. package/src/prompts/system/system-prompt.md +26 -52
  271. package/src/prompts/system/workflow-notice.md +3 -3
  272. package/src/prompts/tools/ast-grep.md +1 -1
  273. package/src/prompts/tools/bash.md +1 -1
  274. package/src/prompts/tools/browser.md +1 -0
  275. package/src/prompts/tools/computer.md +21 -21
  276. package/src/prompts/tools/glob.md +1 -1
  277. package/src/prompts/tools/grep.md +1 -1
  278. package/src/prompts/tools/replace.md +5 -4
  279. package/src/prompts/tools/task.md +4 -4
  280. package/src/registry/agent-lifecycle.ts +36 -11
  281. package/src/registry/agent-registry.ts +12 -5
  282. package/src/sdk.ts +102 -35
  283. package/src/secrets/index.ts +16 -18
  284. package/src/session/agent-session-types.ts +3 -1
  285. package/src/session/agent-session.ts +23 -2
  286. package/src/session/agent-storage.ts +6 -4
  287. package/src/session/history-storage.ts +4 -2
  288. package/src/session/indexed-session-storage.ts +9 -0
  289. package/src/session/messages.ts +31 -7
  290. package/src/session/model-controls.ts +0 -1
  291. package/src/session/prewalk.ts +24 -2
  292. package/src/session/session-advisors.ts +21 -3
  293. package/src/session/session-context.ts +16 -12
  294. package/src/session/session-dump-format.ts +1 -1
  295. package/src/session/session-maintenance.ts +41 -4
  296. package/src/session/session-manager.ts +181 -94
  297. package/src/session/session-paths.ts +118 -55
  298. package/src/session/session-stats.ts +48 -3
  299. package/src/session/session-storage.ts +30 -22
  300. package/src/session/session-tools.ts +25 -23
  301. package/src/session/stream-guards.ts +1 -1
  302. package/src/slash-commands/builtin-registry.ts +29 -26
  303. package/src/system-prompt.ts +14 -4
  304. package/src/task/executor.ts +8 -1
  305. package/src/task/index.ts +23 -8
  306. package/src/task/spawn-policy.ts +14 -0
  307. package/src/thinking.ts +2 -8
  308. package/src/tiny/text.ts +12 -0
  309. package/src/tools/ast-grep.ts +10 -4
  310. package/src/tools/browser/cmux/cmux-tab.ts +5 -10
  311. package/src/tools/browser/cmux/rpc.ts +2 -8
  312. package/src/tools/browser/registry.ts +53 -2
  313. package/src/tools/browser/relay/bridge.ts +945 -0
  314. package/src/tools/browser/relay/daemon.ts +117 -0
  315. package/src/tools/browser/relay/extension-assets/background.js.txt +242 -0
  316. package/src/tools/browser/relay/extension-assets/manifest.json.txt +14 -0
  317. package/src/tools/browser/relay/extension-assets/options.html.txt +53 -0
  318. package/src/tools/browser/relay/extension-assets/options.js.txt +23 -0
  319. package/src/tools/browser/relay/kind.ts +41 -0
  320. package/src/tools/browser/relay/protocol.ts +54 -0
  321. package/src/tools/browser/relay/server.ts +141 -0
  322. package/src/tools/browser/render.ts +4 -1
  323. package/src/tools/browser/shared-daemon.ts +7 -58
  324. package/src/tools/browser/tab-supervisor.ts +5 -4
  325. package/src/tools/browser/tab-worker.ts +33 -12
  326. package/src/tools/browser.ts +26 -1
  327. package/src/tools/computer/exposure.ts +11 -35
  328. package/src/tools/computer/protocol.ts +51 -10
  329. package/src/tools/computer/supervisor.ts +227 -124
  330. package/src/tools/computer/worker-entry.ts +11 -6
  331. package/src/tools/computer/worker.ts +695 -81
  332. package/src/tools/computer-renderer.ts +104 -65
  333. package/src/tools/computer.ts +134 -428
  334. package/src/tools/context.ts +3 -0
  335. package/src/tools/default-renderer.ts +19 -4
  336. package/src/tools/glob.ts +9 -2
  337. package/src/tools/grep.ts +12 -6
  338. package/src/tools/index.ts +10 -6
  339. package/src/tools/inspect-image.ts +32 -6
  340. package/src/tools/render-utils.ts +2 -0
  341. package/src/tools/{browser/run-cancellation.ts → run-scope.ts} +11 -11
  342. package/src/tools/tool-timeouts.ts +1 -0
  343. package/src/tools/xdev.ts +29 -2
  344. package/src/utils/clipboard.ts +40 -14
  345. package/src/utils/command-args.ts +26 -28
  346. package/src/utils/tool-choice.ts +0 -13
  347. package/src/web/kagi.ts +2 -1
  348. package/src/web/search/index.ts +18 -2
  349. package/src/web/search/providers/anthropic.ts +7 -2
  350. package/src/web/search/providers/base.ts +2 -0
  351. package/src/web/search/providers/brave.ts +3 -1
  352. package/src/web/search/providers/browser-page.ts +6 -4
  353. package/src/web/search/providers/codex.ts +4 -1
  354. package/src/web/search/providers/duckduckgo.ts +2 -1
  355. package/src/web/search/providers/ecosia.ts +2 -1
  356. package/src/web/search/providers/exa.ts +4 -2
  357. package/src/web/search/providers/firecrawl.ts +3 -1
  358. package/src/web/search/providers/gemini.ts +8 -2
  359. package/src/web/search/providers/google.ts +2 -1
  360. package/src/web/search/providers/jina.ts +12 -2
  361. package/src/web/search/providers/kagi.ts +3 -0
  362. package/src/web/search/providers/kimi.ts +5 -1
  363. package/src/web/search/providers/mojeek.ts +2 -1
  364. package/src/web/search/providers/parallel.ts +5 -1
  365. package/src/web/search/providers/perplexity.ts +6 -3
  366. package/src/web/search/providers/public.ts +1 -1
  367. package/src/web/search/providers/searxng.ts +11 -5
  368. package/src/web/search/providers/startpage.ts +10 -4
  369. package/src/web/search/providers/synthetic.ts +11 -5
  370. package/src/web/search/providers/tavily.ts +3 -1
  371. package/src/web/search/providers/tinyfish.ts +3 -1
  372. package/src/web/search/providers/utils.ts +12 -10
  373. package/src/web/search/providers/xai.ts +2 -2
  374. package/src/web/search/providers/zai.ts +18 -3
  375. package/src/web/search/types.ts +6 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-coding-agent",
4
- "version": "17.2.3",
4
+ "version": "17.2.5",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -52,17 +52,17 @@
52
52
  "@agentclientprotocol/sdk": "1.2.1",
53
53
  "@babel/parser": "^7.29.7",
54
54
  "@mozilla/readability": "^0.6.0",
55
- "@oh-my-pi/hashline": "17.2.3",
56
- "@oh-my-pi/omp-stats": "17.2.3",
57
- "@oh-my-pi/pi-agent-core": "17.2.3",
58
- "@oh-my-pi/pi-ai": "17.2.3",
59
- "@oh-my-pi/pi-catalog": "17.2.3",
60
- "@oh-my-pi/pi-mnemopi": "17.2.3",
61
- "@oh-my-pi/pi-natives": "17.2.3",
62
- "@oh-my-pi/pi-tui": "17.2.3",
63
- "@oh-my-pi/pi-utils": "17.2.3",
64
- "@oh-my-pi/pi-wire": "17.2.3",
65
- "@oh-my-pi/snapcompact": "17.2.3",
55
+ "@oh-my-pi/hashline": "17.2.5",
56
+ "@oh-my-pi/omp-stats": "17.2.5",
57
+ "@oh-my-pi/pi-agent-core": "17.2.5",
58
+ "@oh-my-pi/pi-ai": "17.2.5",
59
+ "@oh-my-pi/pi-catalog": "17.2.5",
60
+ "@oh-my-pi/pi-mnemopi": "17.2.5",
61
+ "@oh-my-pi/pi-natives": "17.2.5",
62
+ "@oh-my-pi/pi-tui": "17.2.5",
63
+ "@oh-my-pi/pi-utils": "17.2.5",
64
+ "@oh-my-pi/pi-wire": "17.2.5",
65
+ "@oh-my-pi/snapcompact": "17.2.5",
66
66
  "@opentelemetry/api": "^1.9.1",
67
67
  "@opentelemetry/api-logs": "^0.220.0",
68
68
  "@opentelemetry/context-async-hooks": "^2.9.0",
@@ -142,7 +142,13 @@ export async function collectBundledPiEntries(): Promise<BundledPiEntry[]> {
142
142
 
143
143
  const sourceDir = path.join(packageRoot, pattern.sourcePrefix);
144
144
  try {
145
- const glob = new Bun.Glob(`*${pattern.sourceSuffix}`);
145
+ // Recursive on purpose: Node matches `*` in an `exports` pattern across
146
+ // `/`, so `./slash-commands/*` genuinely serves
147
+ // `slash-commands/helpers/active-oauth-account`. Enumerating only the
148
+ // top level left every nested key out of the compiled registry, where
149
+ // it fell through to `Bun.resolveSync` and died under bunfs — so such
150
+ // an import worked from source and failed inside a binary.
151
+ const glob = new Bun.Glob(`**/*${pattern.sourceSuffix}`);
146
152
  const matches: string[] = [];
147
153
  for await (const match of glob.scan({ cwd: sourceDir, onlyFiles: true })) {
148
154
  matches.push(match);
@@ -151,7 +157,11 @@ export async function collectBundledPiEntries(): Promise<BundledPiEntry[]> {
151
157
  for (const match of matches) {
152
158
  if (!match.endsWith(pattern.sourceSuffix)) continue;
153
159
  const basename = match.slice(0, match.length - pattern.sourceSuffix.length);
154
- if (!isSafeWildcardBasename(basename) || basename.includes("/")) continue;
160
+ const segments = basename.split("/");
161
+ // Every directory on the way has to be importable too: a private or
162
+ // hidden folder is no more exported than a private file.
163
+ if (segments.some(segment => segment.startsWith(".") || segment.startsWith("_"))) continue;
164
+ if (!isSafeWildcardBasename(segments.at(-1) ?? "")) continue;
155
165
  const subpath = `${pattern.exportPrefix}${basename}${pattern.exportSuffix}`;
156
166
  const key = `${manifest.name}/${subpath}`;
157
167
  addEntry(key, bindingForSubpath(pkg.identifier, subpath), key);
@@ -180,12 +180,23 @@ export class AdviseTool implements AgentTool<typeof adviseSchema, AdviseDetails>
180
180
  * escalation: nit → concern → blocker), so an advisor cannot bypass dedupe
181
181
  * by retagging the same text at a lower or equal severity. */
182
182
  #deliveredNoteSeverities = new Map<string, number>();
183
+ #inProgressUpdate = false;
183
184
 
184
185
  constructor(private readonly onAdvice: (note: string, severity?: AdviseDetails["severity"]) => void) {}
185
186
 
187
+ /**
188
+ * Mark whether the next advisor prompt reviews an in-progress primary turn.
189
+ * Non-blockers are withheld until a completed update so partial work does
190
+ * not interrupt the primary before it can finish its planned steps.
191
+ */
192
+ beginUpdate(inProgress: boolean): void {
193
+ this.#inProgressUpdate = inProgress;
194
+ }
195
+
186
196
  /** Clear delivered-note memory when the advisor starts a fresh conversation. */
187
197
  resetDeliveredNotes(): void {
188
198
  this.#deliveredNoteSeverities.clear();
199
+ this.#inProgressUpdate = false;
189
200
  }
190
201
 
191
202
  async execute(
@@ -195,6 +206,13 @@ export class AdviseTool implements AgentTool<typeof adviseSchema, AdviseDetails>
195
206
  _onUpdate?: AgentToolUpdateCallback<AdviseDetails>,
196
207
  _context?: AgentToolContext,
197
208
  ): Promise<AgentToolResult<AdviseDetails>> {
209
+ if (this.#inProgressUpdate && args.severity !== "blocker") {
210
+ return {
211
+ content: [{ type: "text", text: "Recorded." }],
212
+ details: { note: args.note, severity: args.severity },
213
+ useless: true,
214
+ };
215
+ }
198
216
  const key = advisorNoteDedupeKey(args.note);
199
217
  const rank = advisorSeverityRank(args.severity);
200
218
  const previousRank = this.#deliveredNoteSeverities.get(key) ?? 0;
@@ -51,11 +51,11 @@ export interface AdvisorRuntimeHost {
51
51
  maintainContext?(incomingTokens: number, signal: AbortSignal): Promise<boolean>;
52
52
  /**
53
53
  * Called immediately before each `agent.prompt(batch)` cycle. Lets the host
54
- * clear per-update advisor state currently the one-advise-per-update gate
55
- * in {@link AdvisorEmissionGuard}, which the host owns because it is the
56
- * one that routes `advise()` results back to the primary.
54
+ * clear per-update advisor state and apply the in-progress delivery policy.
55
+ * The host owns these gates because it routes `advise()` results back to the
56
+ * primary.
57
57
  */
58
- beginAdvisorUpdate?(): void;
58
+ beginAdvisorUpdate?(inProgress: boolean): void;
59
59
  /**
60
60
  * Called with the error of every failed advisor turn, before the retry sleep
61
61
  * or the dropped-after-3 path. Lets the host apply credential-level remedies
@@ -909,8 +909,8 @@ export class AdvisorRuntime {
909
909
  const contextWasFresh = resetContext || recoveringOverflow || messageSnapshot === 0;
910
910
  try {
911
911
  // Reset the host's per-update advisor state (one-advise-per-update
912
- // gate) before each model cycle so the new batch starts fresh.
913
- this.host.beginAdvisorUpdate?.();
912
+ // gate) and pass through whether this batch reviews partial work.
913
+ this.host.beginAdvisorUpdate?.(wip);
914
914
  const prompt = this.agent.prompt(batch);
915
915
  this.#promptInFlight = prompt;
916
916
  try {
@@ -4,6 +4,8 @@
4
4
  * Canonical shape for MCP server configurations, regardless of source format.
5
5
  * All providers translate their native format to this shape.
6
6
  */
7
+
8
+ import type { MCPRequestIdFormat } from "../mcp/types";
7
9
  import { defineCapability } from ".";
8
10
  import type { SourceMeta } from "./types";
9
11
 
@@ -17,6 +19,8 @@ export interface MCPServer {
17
19
  enabled?: boolean;
18
20
  /** Connection timeout in milliseconds */
19
21
  timeout?: number;
22
+ /** Encoding for outgoing JSON-RPC request ids (default: `"number"`) */
23
+ requestIdFormat?: MCPRequestIdFormat;
20
24
  /** Command to run (for stdio transport) */
21
25
  command?: string;
22
26
  /** Command arguments */
@@ -56,6 +60,9 @@ export interface MCPServer {
56
60
  /** Compare the transport inputs that determine which MCP endpoint gets connected. */
57
61
  function isSameMCPConnection(left: MCPServer, right: MCPServer): boolean {
58
62
  if (!Bun.deepEquals(left.auth, right.auth) || !Bun.deepEquals(left.oauth, right.oauth)) return false;
63
+ // Normalize against the allocator's own default so an explicit "number" is
64
+ // equivalent to leaving the option unset, not a distinct connection.
65
+ if ((left.requestIdFormat ?? "number") !== (right.requestIdFormat ?? "number")) return false;
59
66
 
60
67
  const leftTransport = left.transport ?? (left.command ? "stdio" : left.url ? "http" : "stdio");
61
68
  const rightTransport = right.transport ?? (right.command ? "stdio" : right.url ? "http" : "stdio");
package/src/cli/args.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * CLI argument parsing and help display
3
3
  */
4
- import { APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils";
4
+ import { $env, APP_NAME, logger } from "@oh-my-pi/pi-utils";
5
5
  import chalk from "chalk";
6
+ import type { ServiceTierOpenAISettingValue } from "../config/service-tier";
6
7
  import { CLI_THINKING_LEVELS, type ConfiguredThinkingLevel, parseCliThinkingLevel } from "../thinking";
7
8
  import { BUILTIN_TOOL_NAMES, HIDDEN_TOOL_NAMES, normalizeToolNames } from "../tools/builtin-names";
8
9
  import {
@@ -13,8 +14,11 @@ import {
13
14
  STRING_SETTERS,
14
15
  STRING_VALUE_FLAGS,
15
16
  } from "./flag-tables";
17
+ import { getExtraHelpText } from "./help-extra";
16
18
  import { CliUsageError } from "./usage-error";
17
19
 
20
+ export { getExtraHelpText };
21
+
18
22
  export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui";
19
23
 
20
24
  export interface Args {
@@ -40,6 +44,7 @@ export interface Args {
40
44
  systemPrompt?: string;
41
45
  appendSystemPrompt?: string;
42
46
  thinking?: ConfiguredThinkingLevel;
47
+ serviceTier?: ServiceTierOpenAISettingValue;
43
48
  hideThinking?: boolean;
44
49
  advisor?: boolean;
45
50
  continue?: boolean;
@@ -145,6 +150,7 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
145
150
  fileArgs: [],
146
151
  unknownFlags: new Map(),
147
152
  unrecognizedFlags: [],
153
+ sessionDir: $env.PI_CODING_AGENT_SESSION_DIR || undefined,
148
154
  };
149
155
 
150
156
  // `--` ends option parsing (POSIX end-of-options). Everything after it is
@@ -330,92 +336,6 @@ export function reportCliUsageError(
330
336
  return true;
331
337
  }
332
338
 
333
- export function getExtraHelpText(): string {
334
- return `${chalk.bold("Environment Variables:")}
335
- ${chalk.dim("# Core Providers")}
336
- ANTHROPIC_API_KEY - Anthropic Claude models
337
- ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth (takes precedence over API key)
338
- CLAUDE_CODE_USE_FOUNDRY - Enable Anthropic Foundry mode (uses Foundry endpoint + mTLS)
339
- FOUNDRY_BASE_URL - Anthropic Foundry base URL (e.g., https://<foundry-host>)
340
- ANTHROPIC_FOUNDRY_API_KEY - Anthropic token used as Authorization: Bearer <token> in Foundry mode
341
- ANTHROPIC_CUSTOM_HEADERS - Extra headers for Foundry or any custom ANTHROPIC_BASE_URL gateway (e.g., "user-id: USERNAME")
342
- CLAUDE_CODE_CLIENT_CERT - Client certificate (PEM path or inline PEM) for mTLS
343
- CLAUDE_CODE_CLIENT_KEY - Client private key (PEM path or inline PEM) for mTLS
344
- NODE_EXTRA_CA_CERTS - CA bundle path (or inline PEM) for server certificate validation
345
- OPENAI_API_KEY - OpenAI GPT models
346
- GEMINI_API_KEY - Google Gemini models
347
- COPILOT_GITHUB_TOKEN - GitHub Copilot
348
-
349
- ${chalk.dim("# Additional LLM Providers")}
350
- AZURE_OPENAI_API_KEY - Azure OpenAI models
351
- GROQ_API_KEY - Groq models
352
- CEREBRAS_API_KEY - Cerebras models
353
- XAI_API_KEY - xAI Grok models
354
- OPENROUTER_API_KEY - OpenRouter aggregated models
355
- KILO_API_KEY - Kilo Gateway models
356
- MISTRAL_API_KEY - Mistral models
357
- ZAI_API_KEY - z.ai models (ZhipuAI/GLM)
358
- UMANS_AI_CODING_PLAN_API_KEY - Umans AI Coding Plan models
359
- UMANS_WEBSEARCH_PROVIDER - Umans gateway web search backend (native or exa)
360
- MINIMAX_API_KEY - MiniMax models
361
- OPENCODE_API_KEY - OpenCode Zen/OpenCode Go models
362
- CURSOR_ACCESS_TOKEN - Cursor AI models
363
- AI_GATEWAY_API_KEY - Vercel AI Gateway
364
- WAFER_SERVERLESS_API_KEY - Wafer Serverless (pay-as-you-go)
365
-
366
- ${chalk.dim("# Cloud Providers")}
367
- AWS_PROFILE - AWS Bedrock (or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)
368
- GOOGLE_CLOUD_PROJECT - Google Vertex AI (requires GOOGLE_CLOUD_LOCATION)
369
- GOOGLE_APPLICATION_CREDENTIALS - Service account for Vertex AI
370
-
371
- ${chalk.dim("# Search & Tools")}
372
- EXA_API_KEY - Exa web search
373
- BRAVE_API_KEY - Brave web search
374
- PERPLEXITY_API_KEY - Perplexity web search API key (optional; anonymous fallback)
375
- PERPLEXITY_COOKIES - Perplexity web search (session cookie)
376
- TAVILY_API_KEY - Tavily web search
377
- TINYFISH_API_KEY - TinyFish web search
378
- FIRECRAWL_API_KEY - Firecrawl web search
379
- ANTHROPIC_SEARCH_API_KEY - Anthropic web search (override; isolates search from main ANTHROPIC_API_KEY)
380
- ANTHROPIC_SEARCH_BASE_URL - Anthropic web search base URL (override; pairs with ANTHROPIC_SEARCH_API_KEY)
381
-
382
- ${chalk.dim("# Configuration")}
383
- OMP_PROFILE - Named profile for isolated agent state (same as --profile)
384
- Use \`omp --profile <name> --alias <command>\` to create a shell shortcut for a profile
385
- PI_CODING_AGENT_DIR - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
386
- PI_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
387
- PI_SMOL_MODEL - Override smol/fast model (see --smol)
388
- PI_SLOW_MODEL - Override slow/reasoning model (see --slow)
389
- PI_PLAN_MODEL - Override planning model (see --plan)
390
- PI_NO_PTY - Disable PTY-based interactive bash execution
391
- For complete environment variable reference, see:
392
- ${chalk.dim("docs/environment-variables.md")}
393
- ${chalk.bold("Available Tools (default-enabled unless noted):")}
394
- read - Read file contents
395
- bash - Execute bash commands
396
- edit - Edit files with find/replace
397
- write - Write files (creates/overwrites)
398
- grep - Search file contents
399
- glob - Find files by glob pattern
400
- lsp - Language server protocol (code intelligence)
401
- python - Execute Python code (requires: ${APP_NAME} setup python)
402
- notebook - Edit Jupyter notebooks
403
- inspect_image - Analyze images with a vision model
404
- browser - Browser automation (Puppeteer)
405
- computer - Native host desktop capture and input (disabled by default)
406
- task - Launch sub-agents for parallel tasks
407
- todo - Manage todo/task lists
408
- web_search - Search the web
409
- ask - Ask user questions (interactive mode only)
410
-
411
- ${chalk.bold("Plugin Options:")}
412
- --plugin-dir <path> Load plugin from directory (repeatable)
413
-
414
- ${chalk.bold("Useful Commands:")}
415
- omp agents unpack - Export bundled subagents to ~/.omp/agent/agents (default)
416
- omp agents unpack --project - Export bundled subagents to ./.omp/agents`;
417
- }
418
-
419
339
  export function printHelp(): void {
420
340
  process.stdout.write(
421
341
  `${chalk.bold(APP_NAME)} - AI coding assistant\n\n` +
@@ -0,0 +1,119 @@
1
+ /**
2
+ * `omp browser-relay` implementation: serve the local CDP relay and install
3
+ * its Chrome extension. Standalone CLI command — console output here is
4
+ * intentional user-facing output.
5
+ */
6
+ import * as path from "node:path";
7
+ import { getBrowserRelayDir } from "@oh-my-pi/pi-utils";
8
+ import { probeRelayServer } from "../tools/browser/relay/daemon";
9
+ import backgroundJs from "../tools/browser/relay/extension-assets/background.js.txt" with { type: "text" };
10
+ import manifestJson from "../tools/browser/relay/extension-assets/manifest.json.txt" with { type: "text" };
11
+ import optionsHtml from "../tools/browser/relay/extension-assets/options.html.txt" with { type: "text" };
12
+ import optionsJs from "../tools/browser/relay/extension-assets/options.js.txt" with { type: "text" };
13
+ import { DEFAULT_RELAY_URL } from "../tools/browser/relay/kind";
14
+ import { type RelayServer, startRelayServer } from "../tools/browser/relay/server";
15
+
16
+ export const BROWSER_RELAY_ACTIONS = ["serve", "install"] as const;
17
+ export type BrowserRelayAction = (typeof BROWSER_RELAY_ACTIONS)[number];
18
+
19
+ export interface BrowserRelayCommandArgs {
20
+ action: BrowserRelayAction;
21
+ port: number;
22
+ token?: string;
23
+ /** Install target directory; defaults to ~/.omp/browser-relay/extension. */
24
+ dir?: string;
25
+ /** Gather tabs the agent actively drives into an 'omp' Chrome tab group (default true). */
26
+ group?: boolean;
27
+ verbose?: boolean;
28
+ }
29
+
30
+ const EXTENSION_FILES: Record<string, string> = {
31
+ "background.js": backgroundJs,
32
+ "manifest.json": manifestJson,
33
+ "options.html": optionsHtml,
34
+ "options.js": optionsJs,
35
+ };
36
+
37
+ /** Default port of the relay endpoint (kept in sync with DEFAULT_RELAY_URL). */
38
+ export const DEFAULT_RELAY_PORT = Number(new URL(DEFAULT_RELAY_URL).port);
39
+
40
+ export async function runBrowserRelayCommand(args: BrowserRelayCommandArgs): Promise<void> {
41
+ if (args.action === "install") {
42
+ await runInstall(args.dir);
43
+ return;
44
+ }
45
+ await runServe(args);
46
+ }
47
+
48
+ async function runInstall(dirOverride: string | undefined): Promise<void> {
49
+ const dir = dirOverride ? path.resolve(dirOverride) : path.join(getBrowserRelayDir(), "extension");
50
+ for (const name in EXTENSION_FILES) {
51
+ await Bun.write(path.join(dir, name), EXTENSION_FILES[name]!);
52
+ }
53
+ console.log(`Installed the OMP Browser Relay extension to ${dir}`);
54
+ console.log("");
55
+ console.log("Finish setup in Chrome:");
56
+ console.log(" 1. Open chrome://extensions and enable Developer mode.");
57
+ console.log(` 2. Click "Load unpacked" and select: ${dir}`);
58
+ console.log(" 3. Enable the mode: omp config set browser.relay true");
59
+ console.log("");
60
+ console.log("omp starts the relay automatically when the browser tool needs it;");
61
+ console.log("run `omp browser-relay` yourself only for --token or --no-group.");
62
+ console.log("The extension badge shows 'on' once it reaches a relay.");
63
+ }
64
+
65
+ async function runServe(args: BrowserRelayCommandArgs): Promise<void> {
66
+ const log = args.verbose
67
+ ? (message: string, data?: Record<string, unknown>) => {
68
+ console.error(`[relay] ${message}${data ? ` ${JSON.stringify(data)}` : ""}`);
69
+ }
70
+ : undefined;
71
+ let relay: RelayServer;
72
+ try {
73
+ relay = startRelayServer({ port: args.port, token: args.token, group: args.group !== false, log });
74
+ } catch (err) {
75
+ // The port is machine-global while relays can be started by any project's
76
+ // broker (or by hand): losing the bind to a live relay is success.
77
+ if (err instanceof Error && "code" in err && err.code === "EADDRINUSE") {
78
+ if (await probeRelayServer(`http://127.0.0.1:${args.port}`)) {
79
+ console.log(`omp browser relay already running on http://127.0.0.1:${args.port}; nothing to do.`);
80
+ return;
81
+ }
82
+ console.error(`Port ${args.port} is in use by something that is not an omp browser relay.`);
83
+ process.exit(1);
84
+ }
85
+ throw err;
86
+ }
87
+
88
+ console.log(`omp browser relay listening on http://127.0.0.1:${args.port}`);
89
+ console.log(` extension endpoint ws://127.0.0.1:${args.port}/ext${args.token ? "?token=***" : ""}`);
90
+ if (args.port === DEFAULT_RELAY_PORT) {
91
+ console.log(" enable with omp config set browser.relay true");
92
+ } else {
93
+ console.log(
94
+ ` enable with omp config set browser.relay true && omp config set browser.relayUrl http://127.0.0.1:${args.port}`,
95
+ );
96
+ }
97
+ console.log("Waiting for the OMP Browser Relay extension to connect (omp browser-relay install)...");
98
+
99
+ let announced = false;
100
+ const readiness = setInterval(() => {
101
+ if (relay.bridge.ready && !announced) {
102
+ announced = true;
103
+ console.log("Extension connected. The omp browser tool can now drive your tabs.");
104
+ } else if (!relay.bridge.ready && announced) {
105
+ announced = false;
106
+ console.log("Extension disconnected; waiting for it to reconnect...");
107
+ }
108
+ }, 500);
109
+
110
+ const shutdown = () => {
111
+ clearInterval(readiness);
112
+ relay.stop();
113
+ process.exit(0);
114
+ };
115
+ process.on("SIGINT", shutdown);
116
+ process.on("SIGTERM", shutdown);
117
+ // Serve runs until SIGINT/SIGTERM; keep the process alive.
118
+ await new Promise<never>(() => {});
119
+ }
@@ -0,0 +1,103 @@
1
+ import type { CommandMetadata } from "@oh-my-pi/pi-utils/cli";
2
+
3
+ export const acpHelp = {
4
+ description: "Run Oh My Pi as an ACP (Agent Client Protocol) server over stdio",
5
+ } satisfies CommandMetadata;
6
+
7
+ export const agentsHelp = { description: "Manage bundled task agents" } satisfies CommandMetadata;
8
+
9
+ export const authBrokerHelp = {
10
+ description: "Manage the omp auth-broker (credential vault)",
11
+ } satisfies CommandMetadata;
12
+
13
+ export const authGatewayHelp = {
14
+ description: "Run an auth-gateway forward proxy backed by the configured broker",
15
+ } satisfies CommandMetadata;
16
+
17
+ export const benchHelp = {
18
+ description: "Benchmark models with the same prompt: time-to-first-token and generation throughput (tokens/s)",
19
+ } satisfies CommandMetadata;
20
+
21
+ export const browserRelayHelp = {
22
+ description: "Run the local CDP relay that lets the browser tool drive your own Chrome tabs",
23
+ } satisfies CommandMetadata;
24
+
25
+ export const cleanseHelp = {
26
+ description: "Detect and fix project diagnostics with weighted parallel subagents",
27
+ } satisfies CommandMetadata;
28
+
29
+ export const commitHelp = { description: "Generate a commit message and update changelogs" } satisfies CommandMetadata;
30
+
31
+ export const completionsHelp = {
32
+ description: "Print a shell completion script (bash, zsh, or fish)",
33
+ } satisfies CommandMetadata;
34
+
35
+ export const completeHelp = { hidden: true } satisfies CommandMetadata;
36
+
37
+ export const configHelp = { description: "Manage configuration settings" } satisfies CommandMetadata;
38
+
39
+ export const dryBalanceHelp = {
40
+ description: "Dry-run OAuth account balancing across random session ids",
41
+ } satisfies CommandMetadata;
42
+
43
+ export const galleryHelp = {
44
+ description: "Preview tool renderers across streaming, in-progress, success, and failure states",
45
+ } satisfies CommandMetadata;
46
+
47
+ export const gcHelp = { description: "Run storage garbage collection" } satisfies CommandMetadata;
48
+
49
+ export const grepHelp = { description: "Test grep tool" } satisfies CommandMetadata;
50
+
51
+ export const grievancesHelp = {
52
+ description: "View, clean, or push reported tool issues (auto-QA grievances)",
53
+ } satisfies CommandMetadata;
54
+
55
+ export const installHelp = {
56
+ description: "Install or link an extension package (alias of `plugin install`/`plugin link`)",
57
+ } satisfies CommandMetadata;
58
+
59
+ export const joinHelp = { description: "Join a shared collab session (same as /join)" } satisfies CommandMetadata;
60
+
61
+ export const modelsHelp = { description: "List, search, and refresh available models" } satisfies CommandMetadata;
62
+
63
+ export const pluginHelp = { description: "Manage plugins (install, uninstall, list, etc.)" } satisfies CommandMetadata;
64
+
65
+ export const readHelp = {
66
+ description: "Show what the read tool will return for a path, URL, or internal URI",
67
+ } satisfies CommandMetadata;
68
+
69
+ export const sayHelp = {
70
+ description: "Synthesize text with the local TTS engine and play it through the speakers",
71
+ } satisfies CommandMetadata;
72
+
73
+ export const searchHelp = { description: "Test web search providers" } satisfies CommandMetadata;
74
+
75
+ export const setupHelp = {
76
+ description: "Run onboarding setup or install dependencies for optional features",
77
+ } satisfies CommandMetadata;
78
+
79
+ export const shellHelp = { description: "Interactive shell console" } satisfies CommandMetadata;
80
+
81
+ export const sshHelp = { description: "Manage SSH host configurations" } satisfies CommandMetadata;
82
+
83
+ export const statsHelp = { description: "View usage statistics" } satisfies CommandMetadata;
84
+
85
+ export const tinyModelsHelp = {
86
+ description: "Download tiny local models (session titles + memory)",
87
+ } satisfies CommandMetadata;
88
+
89
+ export const tokenHelp = { description: "Get the API key or OAuth token for a provider" } satisfies CommandMetadata;
90
+
91
+ export const ttsrHelp = {
92
+ description: "Inspect and test Time-Traveling Stream Rules (TTSR)",
93
+ } satisfies CommandMetadata;
94
+
95
+ export const updateHelp = { description: "Check for and install updates" } satisfies CommandMetadata;
96
+
97
+ export const usageHelp = {
98
+ description: "Show provider usage limits for every authenticated account",
99
+ } satisfies CommandMetadata;
100
+
101
+ export const worktreeHelp = {
102
+ description: "List or clear agent-managed git worktrees (~/.omp/wt)",
103
+ } satisfies CommandMetadata;
@@ -14,7 +14,7 @@
14
14
  * — see `commands/complete.ts`. The flag→source mapping below is the only manual
15
15
  * knob and is keyed by flag name so it stays stable as flags are added.
16
16
  */
17
- import type { ArgDescriptor, CliConfig, CommandCtor, FlagDescriptor } from "@oh-my-pi/pi-utils/cli";
17
+ import type { ArgDescriptor, CliConfig, CommandMetadata, FlagDescriptor } from "@oh-my-pi/pi-utils/cli";
18
18
  import { BUILTIN_TOOL_NAMES } from "../tools/builtin-names";
19
19
 
20
20
  export type Shell = "bash" | "zsh" | "fish";
@@ -88,9 +88,9 @@ function argValue(desc: ArgDescriptor): ValueSource {
88
88
  return { kind: "file" };
89
89
  }
90
90
 
91
- function buildFlags(Cmd: CommandCtor): CompletionFlag[] {
91
+ function buildFlags(command: CommandMetadata): CompletionFlag[] {
92
92
  const out: CompletionFlag[] = [];
93
- const flags = Cmd.flags ?? {};
93
+ const flags = command.flags ?? {};
94
94
  for (const name in flags) {
95
95
  const desc = flags[name];
96
96
  out.push({
@@ -104,9 +104,9 @@ function buildFlags(Cmd: CommandCtor): CompletionFlag[] {
104
104
  return out;
105
105
  }
106
106
 
107
- function buildArgs(Cmd: CommandCtor): CompletionArg[] {
107
+ function buildArgs(command: CommandMetadata): CompletionArg[] {
108
108
  const out: CompletionArg[] = [];
109
- const args = Cmd.args ?? {};
109
+ const args = command.args ?? {};
110
110
  for (const name in args) {
111
111
  const desc = args[name];
112
112
  out.push({ name, description: desc.description ?? "", value: argValue(desc) });
@@ -30,6 +30,7 @@
30
30
  * real implementations at the dispatch site.
31
31
  */
32
32
 
33
+ import { isServiceTierOpenAISettingValue, SERVICE_TIER_OPENAI_VALUES } from "../config/service-tier";
33
34
  import type { ConfiguredThinkingLevel } from "../thinking";
34
35
  import type { Args } from "./args";
35
36
  import { CliUsageError } from "./usage-error";
@@ -152,6 +153,14 @@ export const STRING_SETTERS: Record<string, StringSetter> = {
152
153
  "--max-time": (result, value) => {
153
154
  result.maxTime = parseMaxTimeSeconds(value);
154
155
  },
156
+ "--service-tier": (result, value) => {
157
+ if (!isServiceTierOpenAISettingValue(value)) {
158
+ throw new CliUsageError(
159
+ `Invalid --service-tier value: ${JSON.stringify(value)}. Expected one of: ${SERVICE_TIER_OPENAI_VALUES.join(", ")}.`,
160
+ );
161
+ }
162
+ result.serviceTier = value;
163
+ },
155
164
  "--api-key": (result, value) => {
156
165
  result.apiKey = value;
157
166
  },
@@ -0,0 +1,89 @@
1
+ import "@oh-my-pi/pi-utils/env";
2
+ import { APP_NAME, CONFIG_DIR_NAME } from "@oh-my-pi/pi-utils/dirs";
3
+ import chalk from "chalk";
4
+
5
+ export function getExtraHelpText(): string {
6
+ return `${chalk.bold("Environment Variables:")}
7
+ ${chalk.dim("# Core Providers")}
8
+ ANTHROPIC_API_KEY - Anthropic Claude models
9
+ ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth (takes precedence over API key)
10
+ CLAUDE_CODE_USE_FOUNDRY - Enable Anthropic Foundry mode (uses Foundry endpoint + mTLS)
11
+ FOUNDRY_BASE_URL - Anthropic Foundry base URL (e.g., https://<foundry-host>)
12
+ ANTHROPIC_FOUNDRY_API_KEY - Anthropic token used as Authorization: Bearer <token> in Foundry mode
13
+ ANTHROPIC_CUSTOM_HEADERS - Extra headers for Foundry or any custom ANTHROPIC_BASE_URL gateway (e.g., "user-id: USERNAME")
14
+ CLAUDE_CODE_CLIENT_CERT - Client certificate (PEM path or inline PEM) for mTLS
15
+ CLAUDE_CODE_CLIENT_KEY - Client private key (PEM path or inline PEM) for mTLS
16
+ NODE_EXTRA_CA_CERTS - CA bundle path (or inline PEM) for server certificate validation
17
+ OPENAI_API_KEY - OpenAI GPT models
18
+ GEMINI_API_KEY - Google Gemini models
19
+ COPILOT_GITHUB_TOKEN - GitHub Copilot
20
+
21
+ ${chalk.dim("# Additional LLM Providers")}
22
+ AZURE_OPENAI_API_KEY - Azure OpenAI models
23
+ GROQ_API_KEY - Groq models
24
+ CEREBRAS_API_KEY - Cerebras models
25
+ XAI_API_KEY - xAI Grok models
26
+ OPENROUTER_API_KEY - OpenRouter aggregated models
27
+ KILO_API_KEY - Kilo Gateway models
28
+ MISTRAL_API_KEY - Mistral models
29
+ ZAI_API_KEY - z.ai models (ZhipuAI/GLM)
30
+ UMANS_AI_CODING_PLAN_API_KEY - Umans AI Coding Plan models
31
+ UMANS_WEBSEARCH_PROVIDER - Umans gateway web search backend (native or exa)
32
+ MINIMAX_API_KEY - MiniMax models
33
+ OPENCODE_API_KEY - OpenCode Zen/OpenCode Go models
34
+ CURSOR_ACCESS_TOKEN - Cursor AI models
35
+ AI_GATEWAY_API_KEY - Vercel AI Gateway
36
+ WAFER_SERVERLESS_API_KEY - Wafer Serverless (pay-as-you-go)
37
+
38
+ ${chalk.dim("# Cloud Providers")}
39
+ AWS_PROFILE - AWS Bedrock (or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)
40
+ GOOGLE_CLOUD_PROJECT - Google Vertex AI (requires GOOGLE_CLOUD_LOCATION)
41
+ GOOGLE_APPLICATION_CREDENTIALS - Service account for Vertex AI
42
+
43
+ ${chalk.dim("# Search & Tools")}
44
+ EXA_API_KEY - Exa web search
45
+ BRAVE_API_KEY - Brave web search
46
+ PERPLEXITY_API_KEY - Perplexity web search API key (optional; anonymous fallback)
47
+ PERPLEXITY_COOKIES - Perplexity web search (session cookie)
48
+ TAVILY_API_KEY - Tavily web search
49
+ TINYFISH_API_KEY - TinyFish web search
50
+ FIRECRAWL_API_KEY - Firecrawl web search
51
+ ANTHROPIC_SEARCH_API_KEY - Anthropic web search (override; isolates search from main ANTHROPIC_API_KEY)
52
+ ANTHROPIC_SEARCH_BASE_URL - Anthropic web search base URL (override; pairs with ANTHROPIC_SEARCH_API_KEY)
53
+
54
+ ${chalk.dim("# Configuration")}
55
+ OMP_PROFILE - Named profile for isolated agent state (same as --profile)
56
+ Use \`omp --profile <name> --alias <command>\` to create a shell shortcut for a profile
57
+ PI_CODING_AGENT_DIR - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
58
+ PI_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
59
+ PI_SMOL_MODEL - Override smol/fast model (see --smol)
60
+ PI_SLOW_MODEL - Override slow/reasoning model (see --slow)
61
+ PI_PLAN_MODEL - Override planning model (see --plan)
62
+ PI_NO_PTY - Disable PTY-based interactive bash execution
63
+ For complete environment variable reference, see:
64
+ ${chalk.dim("docs/environment-variables.md")}
65
+ ${chalk.bold("Available Tools (default-enabled unless noted):")}
66
+ read - Read file contents
67
+ bash - Execute bash commands
68
+ edit - Edit files with find/replace
69
+ write - Write files (creates/overwrites)
70
+ grep - Search file contents
71
+ glob - Find files by glob pattern
72
+ lsp - Language server protocol (code intelligence)
73
+ python - Execute Python code (requires: ${APP_NAME} setup python)
74
+ notebook - Edit Jupyter notebooks
75
+ inspect_image - Analyze images with a vision model
76
+ browser - Browser automation (Puppeteer)
77
+ computer - Native host desktop capture and input (disabled by default)
78
+ task - Launch sub-agents for parallel tasks
79
+ todo - Manage todo/task lists
80
+ web_search - Search the web
81
+ ask - Ask user questions (interactive mode only)
82
+
83
+ ${chalk.bold("Plugin Options:")}
84
+ --plugin-dir <path> Load plugin from directory (repeatable)
85
+
86
+ ${chalk.bold("Useful Commands:")}
87
+ omp agents unpack - Export bundled subagents to ~/.omp/agent/agents (default)
88
+ omp agents unpack --project - Export bundled subagents to ./.omp/agents`;
89
+ }