@chankov/agent-fleet 0.0.11 → 1.0.1

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 (771) hide show
  1. package/.pi/agents/model-profiles.yaml +2 -2
  2. package/.pi/extensions/agent-fleet-update-check/README.md +4 -4
  3. package/.pi/extensions/btw/README.md +26 -25
  4. package/.pi/extensions/btw/index.ts +80 -83
  5. package/.pi/extensions/pi-voice-stt/README.md +4 -3
  6. package/.pi/extensions/pi-voice-stt/config.ts +1 -1
  7. package/.pi/harnesses/agent-hub/README.md +118 -57
  8. package/.pi/harnesses/agent-hub/backend-policy.js +25 -4
  9. package/.pi/harnesses/agent-hub/footer.ts +4 -0
  10. package/.pi/harnesses/agent-hub/helpers.ts +18 -0
  11. package/.pi/harnesses/agent-hub/hub-state-audit.js +55 -0
  12. package/.pi/harnesses/agent-hub/index.ts +657 -425
  13. package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +10 -1
  14. package/.pi/harnesses/agent-hub/package.json +1 -1
  15. package/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  16. package/.pi/harnesses/agent-hub/posture.ts +103 -0
  17. package/.pi/harnesses/agent-hub/run-budget.js +61 -0
  18. package/.pi/harnesses/ask-user-remote/README.md +37 -3
  19. package/.pi/harnesses/ask-user-remote/index.ts +173 -17
  20. package/.pi/harnesses/coms/package.json +1 -1
  21. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  22. package/.pi/harnesses/lib/fleet-dashboard-ops.ts +155 -0
  23. package/.pi/harnesses/lib/fleet-dashboard-view.ts +140 -0
  24. package/.pi/harnesses/lib/fleet-detail-view.ts +43 -0
  25. package/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  26. package/.pi/harnesses/lib/fleet-panel.ts +34 -0
  27. package/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  28. package/.pi/harnesses/lib/fleet-selection.ts +24 -0
  29. package/.pi/harnesses/package-lock.json +2011 -0
  30. package/.pi/harnesses/package.json +1 -0
  31. package/.versions/0.0.11/.pi/extensions/agent-fleet-update-check/README.md +4 -4
  32. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/README.md +4 -3
  33. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/config.ts +1 -1
  34. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-session-bridge.ts +10 -1
  35. package/.versions/0.0.11/.pi/harnesses/ask-user-remote/README.md +37 -3
  36. package/.versions/0.0.11/.pi/harnesses/ask-user-remote/index.ts +173 -17
  37. package/.versions/0.0.11/.pi/harnesses/package-lock.json +2011 -0
  38. package/.versions/0.0.11/.pi/harnesses/package.json +1 -0
  39. package/.versions/0.0.11/docs/ARCHITECTURE.md +6 -8
  40. package/.versions/0.0.11/docs/agent-fleet-setup.md +17 -43
  41. package/.versions/0.0.11/docs/claude-code-coms-bridge.md +20 -2
  42. package/.versions/0.0.11/docs/coms-hermes-bridge.md +1 -1
  43. package/.versions/0.0.11/docs/getting-started.md +26 -237
  44. package/.versions/0.0.11/docs/npm-install.md +60 -478
  45. package/.versions/0.0.11/docs/pi-extensions.md +4 -4
  46. package/.versions/0.0.11/docs/pi-setup.md +37 -551
  47. package/.versions/0.0.11/hermes/README.md +1 -1
  48. package/.versions/0.0.11/install-manifest.json +375 -1247
  49. package/.versions/0.0.11/justfile +13 -6
  50. package/.versions/0.0.11/manifest-meta.json +543 -134
  51. package/.versions/0.0.11/scripts/lib/fleet-command.ts +8 -0
  52. package/.versions/0.0.11/scripts/lib/monitor-env.ts +18 -6
  53. package/.versions/0.0.11/skills/designing-agents/SKILL.md +1 -1
  54. package/.versions/0.0.11/skills/designing-agents/pi-harness-authoring.md +1 -1
  55. package/.versions/1.0.0/.pi/agents/dispatch-policy.yaml +32 -0
  56. package/.versions/1.0.0/.pi/agents/model-profiles.yaml +27 -0
  57. package/.versions/1.0.0/.pi/agents/peers.yaml +142 -0
  58. package/.versions/1.0.0/.pi/agents/teams.yaml +41 -0
  59. package/.versions/1.0.0/.pi/damage-control-rules.yaml +297 -0
  60. package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  61. package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  62. package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  63. package/.versions/1.0.0/.pi/extensions/btw/README.md +120 -0
  64. package/.versions/1.0.0/.pi/extensions/btw/index.ts +914 -0
  65. package/.versions/1.0.0/.pi/extensions/btw/package.json +6 -0
  66. package/.versions/1.0.0/.pi/extensions/btw/state.js +179 -0
  67. package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  68. package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  69. package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  70. package/.versions/1.0.0/.pi/extensions/compact-and-continue/README.md +42 -0
  71. package/.versions/1.0.0/.pi/extensions/compact-and-continue/index.ts +120 -0
  72. package/.versions/1.0.0/.pi/extensions/compact-and-continue/package.json +6 -0
  73. package/.versions/1.0.0/.pi/extensions/mcp-bridge/README.md +46 -0
  74. package/.versions/1.0.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  75. package/.versions/1.0.0/.pi/extensions/mcp-bridge/package.json +6 -0
  76. package/.versions/1.0.0/.pi/extensions/package-lock.json +1143 -0
  77. package/.versions/1.0.0/.pi/extensions/package.json +9 -0
  78. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/README.md +205 -0
  79. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/config.ts +198 -0
  80. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  81. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
  82. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/package.json +6 -0
  83. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  84. package/.versions/1.0.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  85. package/.versions/1.0.0/.pi/harnesses/agent-hub/README.md +1056 -0
  86. package/.versions/1.0.0/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  87. package/.versions/1.0.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
  88. package/.versions/1.0.0/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  89. package/.versions/1.0.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  90. package/.versions/1.0.0/.pi/harnesses/agent-hub/context-window.js +106 -0
  91. package/.versions/1.0.0/.pi/harnesses/agent-hub/delegate.ts +435 -0
  92. package/.versions/1.0.0/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  93. package/.versions/1.0.0/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
  94. package/.versions/1.0.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  95. package/.versions/1.0.0/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  96. package/.versions/1.0.0/.pi/harnesses/agent-hub/footer.ts +35 -0
  97. package/.versions/1.0.0/.pi/harnesses/agent-hub/helpers.ts +266 -0
  98. package/.versions/1.0.0/.pi/harnesses/agent-hub/index.ts +9279 -0
  99. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  100. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  101. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  102. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  103. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  104. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  105. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  106. package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  107. package/.versions/1.0.0/.pi/harnesses/agent-hub/package.json +7 -0
  108. package/.versions/1.0.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  109. package/.versions/1.0.0/.pi/harnesses/agent-hub/posture.ts +103 -0
  110. package/.versions/1.0.0/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  111. package/.versions/1.0.0/.pi/harnesses/agent-hub/research-retention.js +34 -0
  112. package/.versions/1.0.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  113. package/.versions/1.0.0/.pi/harnesses/agent-hub/return-contract.js +293 -0
  114. package/.versions/1.0.0/.pi/harnesses/agent-hub/return-extract.js +75 -0
  115. package/.versions/1.0.0/.pi/harnesses/agent-hub/review-findings.js +102 -0
  116. package/.versions/1.0.0/.pi/harnesses/agent-hub/run-budget.js +479 -0
  117. package/.versions/1.0.0/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  118. package/.versions/1.0.0/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  119. package/.versions/1.0.0/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  120. package/.versions/1.0.0/.pi/harnesses/agent-hub/session-health.js +110 -0
  121. package/.versions/1.0.0/.pi/harnesses/agent-hub/spawn.ts +354 -0
  122. package/.versions/1.0.0/.pi/harnesses/agent-hub/version.ts +42 -0
  123. package/.versions/1.0.0/.pi/harnesses/ask-user-remote/README.md +53 -0
  124. package/.versions/1.0.0/.pi/harnesses/ask-user-remote/index.ts +477 -0
  125. package/.versions/1.0.0/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  126. package/.versions/1.0.0/.pi/harnesses/coms/README.md +100 -0
  127. package/.versions/1.0.0/.pi/harnesses/coms/index.ts +1767 -0
  128. package/.versions/1.0.0/.pi/harnesses/coms/package.json +7 -0
  129. package/.versions/1.0.0/.pi/harnesses/coms/version.ts +42 -0
  130. package/.versions/1.0.0/.pi/harnesses/damage-control-continue/README.md +124 -0
  131. package/.versions/1.0.0/.pi/harnesses/damage-control-continue/index.ts +536 -0
  132. package/.versions/1.0.0/.pi/harnesses/damage-control-continue/package.json +7 -0
  133. package/.versions/1.0.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
  134. package/.versions/1.0.0/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  135. package/.versions/1.0.0/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  136. package/.versions/1.0.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +118 -0
  137. package/.versions/1.0.0/.pi/harnesses/lib/fleet-dashboard-view.ts +140 -0
  138. package/.versions/1.0.0/.pi/harnesses/lib/fleet-detail-view.ts +43 -0
  139. package/.versions/1.0.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  140. package/.versions/1.0.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
  141. package/.versions/1.0.0/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  142. package/.versions/1.0.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
  143. package/.versions/1.0.0/.pi/harnesses/lib/herdr-client.ts +472 -0
  144. package/.versions/1.0.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
  145. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  146. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  147. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  148. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  149. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  150. package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  151. package/.versions/1.0.0/.pi/harnesses/lib/spawned-peers.js +190 -0
  152. package/.versions/1.0.0/.pi/harnesses/package-lock.json +2046 -0
  153. package/.versions/1.0.0/.pi/harnesses/package.json +10 -0
  154. package/.versions/1.0.0/.pi/prompts/af-build.md +24 -0
  155. package/{.claude/commands/code-simplify.md → .versions/1.0.0/.pi/prompts/af-code-simplify.md} +3 -3
  156. package/{.claude/commands/plan.md → .versions/1.0.0/.pi/prompts/af-plan.md} +1 -1
  157. package/.versions/{0.0.11/.claude/commands/review.md → 1.0.0/.pi/prompts/af-review.md} +3 -3
  158. package/.versions/1.0.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  159. package/.versions/1.0.0/.pi/prompts/af-ship.md +17 -0
  160. package/.versions/{0.0.11/.claude/commands/spec.md → 1.0.0/.pi/prompts/af-spec.md} +1 -1
  161. package/.versions/{0.0.11/.claude/commands/test.md → 1.0.0/.pi/prompts/af-test.md} +2 -2
  162. package/.versions/1.0.0/.pi/skills/bowser/SKILL.md +145 -0
  163. package/.versions/1.0.0/.version +1 -0
  164. package/.versions/1.0.0/agents/architect.md +24 -0
  165. package/.versions/1.0.0/agents/bowser.md +27 -0
  166. package/.versions/1.0.0/agents/builder.md +54 -0
  167. package/.versions/1.0.0/agents/code-reviewer.md +208 -0
  168. package/.versions/1.0.0/agents/deep-researcher.md +32 -0
  169. package/.versions/1.0.0/agents/documenter.md +18 -0
  170. package/.versions/1.0.0/agents/orchestrator.md +72 -0
  171. package/.versions/1.0.0/agents/plan-reviewer.md +83 -0
  172. package/.versions/1.0.0/agents/planner.md +70 -0
  173. package/.versions/1.0.0/agents/releaser.md +24 -0
  174. package/.versions/1.0.0/agents/researcher.md +28 -0
  175. package/.versions/1.0.0/agents/security-auditor.md +167 -0
  176. package/.versions/1.0.0/agents/test-engineer.md +153 -0
  177. package/.versions/1.0.0/agents/web-debugger.md +43 -0
  178. package/.versions/1.0.0/agents/web-performance-auditor.md +193 -0
  179. package/.versions/1.0.0/codex/CONDUCTOR.md +148 -0
  180. package/.versions/1.0.0/docs/ARCHITECTURE.md +337 -0
  181. package/.versions/1.0.0/docs/agent-fleet-setup.md +437 -0
  182. package/.versions/1.0.0/docs/claude-code-coms-bridge.md +128 -0
  183. package/.versions/1.0.0/docs/codex-remote-conductor.md +170 -0
  184. package/.versions/1.0.0/docs/coms-hermes-bridge.md +189 -0
  185. package/.versions/1.0.0/docs/getting-started.md +98 -0
  186. package/.versions/1.0.0/docs/npm-install.md +292 -0
  187. package/.versions/1.0.0/docs/pi-extensions.md +412 -0
  188. package/.versions/1.0.0/docs/pi-setup.md +74 -0
  189. package/.versions/1.0.0/docs/skill-anatomy.md +150 -0
  190. package/.versions/1.0.0/hermes/README.md +347 -0
  191. package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  192. package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  193. package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  194. package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  195. package/.versions/1.0.0/hermes/gates/gate-o-capability.md +8 -0
  196. package/.versions/1.0.0/hermes/gates/gate-o-validator-fixtures.json +1 -0
  197. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  198. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  199. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  200. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  201. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  202. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  203. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  204. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  205. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  206. package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  207. package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  208. package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  209. package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  210. package/.versions/1.0.0/hermes/skills/hub-conductor/SKILL.md +84 -0
  211. package/.versions/1.0.0/hermes/skills/hub-liaison/SKILL.md +84 -0
  212. package/.versions/1.0.0/hermes/skills/hub-watchdog/SKILL.md +76 -0
  213. package/.versions/1.0.0/hermes/skills/hub-watchdog/manifest.json +1 -0
  214. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  215. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  216. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  217. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  218. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  219. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  220. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  221. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  222. package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  223. package/.versions/1.0.0/hermes/watchdog-tests/__init__.py +0 -0
  224. package/.versions/1.0.0/hooks/coms-stop-hook.mjs +84 -0
  225. package/.versions/1.0.0/install-manifest.json +2745 -0
  226. package/.versions/1.0.0/justfile +272 -0
  227. package/.versions/1.0.0/manifest-meta.json +882 -0
  228. package/.versions/1.0.0/references/accessibility-checklist.md +160 -0
  229. package/.versions/1.0.0/references/definition-of-done.md +67 -0
  230. package/.versions/1.0.0/references/fleet-coordination-patterns.md +151 -0
  231. package/.versions/1.0.0/references/observability-checklist.md +91 -0
  232. package/.versions/1.0.0/references/orchestration-patterns.md +370 -0
  233. package/.versions/1.0.0/references/performance-checklist.md +153 -0
  234. package/.versions/1.0.0/references/prompting-patterns.md +380 -0
  235. package/.versions/1.0.0/references/security-checklist.md +179 -0
  236. package/.versions/1.0.0/references/testing-patterns.md +236 -0
  237. package/.versions/1.0.0/scripts/codex-conductor.ts +41 -0
  238. package/.versions/1.0.0/scripts/codex-remote-control.ts +167 -0
  239. package/.versions/1.0.0/scripts/coms-claude-bridge.ts +411 -0
  240. package/.versions/1.0.0/scripts/coms-cli.ts +484 -0
  241. package/.versions/1.0.0/scripts/coms-hermes-bridge.ts +413 -0
  242. package/.versions/1.0.0/scripts/fleet.ts +185 -0
  243. package/.versions/1.0.0/scripts/hermes-monitor-capability-runner.ts +25 -0
  244. package/.versions/1.0.0/scripts/hermes-monitor-scenario.ts +474 -0
  245. package/.versions/1.0.0/scripts/hermes-watchdog-capability-probe.ts +45 -0
  246. package/.versions/1.0.0/scripts/install-hermes-plugin.sh +180 -0
  247. package/.versions/1.0.0/scripts/lib/claude-bridge-core.ts +210 -0
  248. package/.versions/1.0.0/scripts/lib/codex-conductor.ts +88 -0
  249. package/.versions/1.0.0/scripts/lib/codex-remote-control.ts +480 -0
  250. package/.versions/1.0.0/scripts/lib/coms-envelope.ts +582 -0
  251. package/.versions/1.0.0/scripts/lib/fake-herdr-server.ts +88 -0
  252. package/.versions/1.0.0/scripts/lib/fleet-command.ts +266 -0
  253. package/.versions/1.0.0/scripts/lib/herdr-layout.ts +281 -0
  254. package/.versions/1.0.0/scripts/lib/hermes-bridge-core.ts +241 -0
  255. package/.versions/1.0.0/scripts/lib/hermes-monitor-events.ts +1 -0
  256. package/.versions/1.0.0/scripts/lib/hermes-monitor-herdr.ts +2 -0
  257. package/.versions/1.0.0/scripts/lib/hermes-monitor-model.ts +3 -0
  258. package/.versions/1.0.0/scripts/lib/hermes-monitor-registry.ts +2 -0
  259. package/.versions/1.0.0/scripts/lib/hermes-monitor-socket.ts +2 -0
  260. package/.versions/1.0.0/scripts/lib/hermes-monitor-store.ts +2 -0
  261. package/.versions/1.0.0/scripts/lib/monitor-env.ts +146 -0
  262. package/.versions/1.0.0/scripts/lib/peer-launch.ts +318 -0
  263. package/.versions/1.0.0/scripts/lib/persona-banner.ts +62 -0
  264. package/.versions/1.0.0/scripts/lib/spawn-stagger.ts +101 -0
  265. package/.versions/1.0.0/scripts/lib/team-project.ts +213 -0
  266. package/.versions/1.0.0/scripts/lib/team-snapshot.ts +147 -0
  267. package/.versions/1.0.0/scripts/peer-banner.ts +40 -0
  268. package/.versions/1.0.0/scripts/peer-launch.ts +259 -0
  269. package/.versions/1.0.0/scripts/team-snapshot.ts +237 -0
  270. package/.versions/1.0.0/scripts/team-up.ts +406 -0
  271. package/.versions/1.0.0/skills/_internal/grilling.md +11 -0
  272. package/.versions/1.0.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
  273. package/.versions/1.0.0/skills/code-review-and-quality/SKILL.md +381 -0
  274. package/.versions/1.0.0/skills/compound-learning/SKILL.md +137 -0
  275. package/.versions/1.0.0/skills/context-engineering/SKILL.md +291 -0
  276. package/.versions/1.0.0/skills/deprecation-and-migration/SKILL.md +206 -0
  277. package/.versions/1.0.0/skills/designing-agents/SKILL.md +394 -0
  278. package/.versions/1.0.0/skills/designing-agents/pi-harness-authoring.md +222 -0
  279. package/.versions/1.0.0/skills/frontend-ui-engineering/SKILL.md +328 -0
  280. package/.versions/1.0.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  281. package/.versions/1.0.0/skills/idea-refine/SKILL.md +182 -0
  282. package/.versions/1.0.0/skills/idea-refine/examples.md +238 -0
  283. package/.versions/1.0.0/skills/idea-refine/frameworks.md +99 -0
  284. package/.versions/1.0.0/skills/idea-refine/refinement-criteria.md +113 -0
  285. package/.versions/1.0.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  286. package/.versions/1.0.0/skills/incremental-implementation/SKILL.md +287 -0
  287. package/.versions/1.0.0/skills/interview-me/SKILL.md +226 -0
  288. package/.versions/1.0.0/skills/orchestration-verification/SKILL.md +181 -0
  289. package/.versions/1.0.0/skills/peer-coms/SKILL.md +90 -0
  290. package/.versions/1.0.0/skills/performance-optimization/SKILL.md +350 -0
  291. package/.versions/1.0.0/skills/planning-and-task-breakdown/SKILL.md +254 -0
  292. package/.versions/1.0.0/skills/security-and-hardening/SKILL.md +461 -0
  293. package/.versions/1.0.0/skills/spec-driven-development/SKILL.md +257 -0
  294. package/.versions/1.0.0/skills/using-agent-skills/SKILL.md +199 -0
  295. package/.versions/1.0.0/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  296. package/.versions/1.0.0/vendor/agent-skills-upstream/LICENSE +21 -0
  297. package/.versions/1.0.0/vendor/agent-skills-upstream/README.md +11 -0
  298. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  299. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  300. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  301. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  302. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  303. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  304. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  305. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  306. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  307. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  308. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  309. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  310. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  311. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  312. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  313. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  314. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  315. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  316. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  317. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  318. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  319. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  320. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  321. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  322. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  323. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  324. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  325. package/.versions/1.0.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  326. package/.versions/1.0.1/.pi/agents/dispatch-policy.yaml +32 -0
  327. package/.versions/1.0.1/.pi/agents/model-profiles.yaml +27 -0
  328. package/.versions/1.0.1/.pi/agents/peers.yaml +142 -0
  329. package/.versions/1.0.1/.pi/agents/teams.yaml +41 -0
  330. package/.versions/1.0.1/.pi/damage-control-rules.yaml +297 -0
  331. package/.versions/1.0.1/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  332. package/.versions/1.0.1/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  333. package/.versions/1.0.1/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  334. package/.versions/1.0.1/.pi/extensions/btw/README.md +120 -0
  335. package/.versions/1.0.1/.pi/extensions/btw/index.ts +914 -0
  336. package/.versions/1.0.1/.pi/extensions/btw/package.json +6 -0
  337. package/.versions/1.0.1/.pi/extensions/btw/state.js +179 -0
  338. package/.versions/1.0.1/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  339. package/.versions/1.0.1/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  340. package/.versions/1.0.1/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  341. package/.versions/1.0.1/.pi/extensions/compact-and-continue/README.md +42 -0
  342. package/.versions/1.0.1/.pi/extensions/compact-and-continue/index.ts +120 -0
  343. package/.versions/1.0.1/.pi/extensions/compact-and-continue/package.json +6 -0
  344. package/.versions/1.0.1/.pi/extensions/mcp-bridge/README.md +46 -0
  345. package/.versions/1.0.1/.pi/extensions/mcp-bridge/index.ts +206 -0
  346. package/.versions/1.0.1/.pi/extensions/mcp-bridge/package.json +6 -0
  347. package/.versions/1.0.1/.pi/extensions/package-lock.json +1143 -0
  348. package/.versions/1.0.1/.pi/extensions/package.json +9 -0
  349. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/README.md +205 -0
  350. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/config.ts +198 -0
  351. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  352. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/index.ts +248 -0
  353. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/package.json +6 -0
  354. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  355. package/.versions/1.0.1/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  356. package/.versions/1.0.1/.pi/harnesses/agent-hub/README.md +1065 -0
  357. package/.versions/1.0.1/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  358. package/.versions/1.0.1/.pi/harnesses/agent-hub/artifacts.js +146 -0
  359. package/.versions/1.0.1/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  360. package/.versions/1.0.1/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  361. package/.versions/1.0.1/.pi/harnesses/agent-hub/context-window.js +106 -0
  362. package/.versions/1.0.1/.pi/harnesses/agent-hub/delegate.ts +435 -0
  363. package/.versions/1.0.1/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  364. package/.versions/1.0.1/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
  365. package/.versions/1.0.1/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  366. package/.versions/1.0.1/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  367. package/.versions/1.0.1/.pi/harnesses/agent-hub/footer.ts +35 -0
  368. package/.versions/1.0.1/.pi/harnesses/agent-hub/helpers.ts +266 -0
  369. package/.versions/1.0.1/.pi/harnesses/agent-hub/hub-state-audit.js +55 -0
  370. package/.versions/1.0.1/.pi/harnesses/agent-hub/index.ts +9343 -0
  371. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  372. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  373. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  374. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  375. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  376. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  377. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  378. package/.versions/1.0.1/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  379. package/.versions/1.0.1/.pi/harnesses/agent-hub/package.json +7 -0
  380. package/.versions/1.0.1/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  381. package/.versions/1.0.1/.pi/harnesses/agent-hub/posture.ts +103 -0
  382. package/.versions/1.0.1/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  383. package/.versions/1.0.1/.pi/harnesses/agent-hub/research-retention.js +34 -0
  384. package/.versions/1.0.1/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  385. package/.versions/1.0.1/.pi/harnesses/agent-hub/return-contract.js +293 -0
  386. package/.versions/1.0.1/.pi/harnesses/agent-hub/return-extract.js +75 -0
  387. package/.versions/1.0.1/.pi/harnesses/agent-hub/review-findings.js +102 -0
  388. package/.versions/1.0.1/.pi/harnesses/agent-hub/run-budget.js +540 -0
  389. package/.versions/1.0.1/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  390. package/.versions/1.0.1/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  391. package/.versions/1.0.1/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  392. package/.versions/1.0.1/.pi/harnesses/agent-hub/session-health.js +110 -0
  393. package/.versions/1.0.1/.pi/harnesses/agent-hub/spawn.ts +354 -0
  394. package/.versions/1.0.1/.pi/harnesses/agent-hub/version.ts +42 -0
  395. package/.versions/1.0.1/.pi/harnesses/ask-user-remote/README.md +53 -0
  396. package/.versions/1.0.1/.pi/harnesses/ask-user-remote/index.ts +477 -0
  397. package/.versions/1.0.1/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  398. package/.versions/1.0.1/.pi/harnesses/coms/README.md +100 -0
  399. package/.versions/1.0.1/.pi/harnesses/coms/index.ts +1767 -0
  400. package/.versions/1.0.1/.pi/harnesses/coms/package.json +7 -0
  401. package/.versions/1.0.1/.pi/harnesses/coms/version.ts +42 -0
  402. package/.versions/1.0.1/.pi/harnesses/damage-control-continue/README.md +124 -0
  403. package/.versions/1.0.1/.pi/harnesses/damage-control-continue/index.ts +536 -0
  404. package/.versions/1.0.1/.pi/harnesses/damage-control-continue/package.json +7 -0
  405. package/.versions/1.0.1/.pi/harnesses/damage-control-continue/version.ts +42 -0
  406. package/.versions/1.0.1/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  407. package/.versions/1.0.1/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  408. package/.versions/1.0.1/.pi/harnesses/lib/fleet-dashboard-ops.ts +155 -0
  409. package/.versions/1.0.1/.pi/harnesses/lib/fleet-dashboard-view.ts +140 -0
  410. package/.versions/1.0.1/.pi/harnesses/lib/fleet-detail-view.ts +43 -0
  411. package/.versions/1.0.1/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  412. package/.versions/1.0.1/.pi/harnesses/lib/fleet-panel.ts +34 -0
  413. package/.versions/1.0.1/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  414. package/.versions/1.0.1/.pi/harnesses/lib/fleet-selection.ts +24 -0
  415. package/.versions/1.0.1/.pi/harnesses/lib/herdr-client.ts +472 -0
  416. package/.versions/1.0.1/.pi/harnesses/lib/herdr-presence.ts +399 -0
  417. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  418. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  419. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  420. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  421. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  422. package/.versions/1.0.1/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  423. package/.versions/1.0.1/.pi/harnesses/lib/spawned-peers.js +190 -0
  424. package/.versions/1.0.1/.pi/harnesses/package-lock.json +2046 -0
  425. package/.versions/1.0.1/.pi/harnesses/package.json +10 -0
  426. package/.versions/1.0.1/.pi/prompts/af-build.md +24 -0
  427. package/.versions/{0.0.11/.claude/commands/code-simplify.md → 1.0.1/.pi/prompts/af-code-simplify.md} +3 -3
  428. package/.versions/{0.0.11/.claude/commands/plan.md → 1.0.1/.pi/prompts/af-plan.md} +1 -1
  429. package/{.claude/commands/review.md → .versions/1.0.1/.pi/prompts/af-review.md} +3 -3
  430. package/.versions/1.0.1/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  431. package/.versions/1.0.1/.pi/prompts/af-ship.md +17 -0
  432. package/{.claude/commands/spec.md → .versions/1.0.1/.pi/prompts/af-spec.md} +1 -1
  433. package/{.claude/commands/test.md → .versions/1.0.1/.pi/prompts/af-test.md} +2 -2
  434. package/.versions/1.0.1/.pi/skills/bowser/SKILL.md +145 -0
  435. package/.versions/1.0.1/.version +1 -0
  436. package/.versions/1.0.1/agents/architect.md +24 -0
  437. package/.versions/1.0.1/agents/bowser.md +27 -0
  438. package/.versions/1.0.1/agents/builder.md +54 -0
  439. package/.versions/1.0.1/agents/code-reviewer.md +208 -0
  440. package/.versions/1.0.1/agents/deep-researcher.md +32 -0
  441. package/.versions/1.0.1/agents/documenter.md +18 -0
  442. package/.versions/1.0.1/agents/orchestrator.md +72 -0
  443. package/.versions/1.0.1/agents/plan-reviewer.md +83 -0
  444. package/.versions/1.0.1/agents/planner.md +70 -0
  445. package/.versions/1.0.1/agents/releaser.md +24 -0
  446. package/.versions/1.0.1/agents/researcher.md +28 -0
  447. package/.versions/1.0.1/agents/security-auditor.md +167 -0
  448. package/.versions/1.0.1/agents/test-engineer.md +153 -0
  449. package/.versions/1.0.1/agents/web-debugger.md +43 -0
  450. package/.versions/1.0.1/agents/web-performance-auditor.md +193 -0
  451. package/.versions/1.0.1/codex/CONDUCTOR.md +148 -0
  452. package/.versions/1.0.1/docs/ARCHITECTURE.md +337 -0
  453. package/.versions/1.0.1/docs/agent-fleet-setup.md +437 -0
  454. package/.versions/1.0.1/docs/claude-code-coms-bridge.md +128 -0
  455. package/.versions/1.0.1/docs/codex-remote-conductor.md +170 -0
  456. package/.versions/1.0.1/docs/coms-hermes-bridge.md +189 -0
  457. package/.versions/1.0.1/docs/getting-started.md +98 -0
  458. package/.versions/1.0.1/docs/npm-install.md +292 -0
  459. package/.versions/1.0.1/docs/pi-extensions.md +412 -0
  460. package/.versions/1.0.1/docs/pi-setup.md +74 -0
  461. package/.versions/1.0.1/docs/skill-anatomy.md +150 -0
  462. package/.versions/1.0.1/hermes/README.md +347 -0
  463. package/.versions/1.0.1/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  464. package/.versions/1.0.1/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  465. package/.versions/1.0.1/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  466. package/.versions/1.0.1/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  467. package/.versions/1.0.1/hermes/gates/gate-o-capability.md +8 -0
  468. package/.versions/1.0.1/hermes/gates/gate-o-validator-fixtures.json +1 -0
  469. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  470. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  471. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  472. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  473. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  474. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  475. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  476. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  477. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  478. package/.versions/1.0.1/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  479. package/.versions/1.0.1/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  480. package/.versions/1.0.1/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  481. package/.versions/1.0.1/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  482. package/.versions/1.0.1/hermes/skills/hub-conductor/SKILL.md +84 -0
  483. package/.versions/1.0.1/hermes/skills/hub-liaison/SKILL.md +84 -0
  484. package/.versions/1.0.1/hermes/skills/hub-watchdog/SKILL.md +76 -0
  485. package/.versions/1.0.1/hermes/skills/hub-watchdog/manifest.json +1 -0
  486. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  487. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  488. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  489. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  490. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  491. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  492. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  493. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  494. package/.versions/1.0.1/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  495. package/.versions/1.0.1/hermes/watchdog-tests/__init__.py +0 -0
  496. package/.versions/1.0.1/hooks/coms-stop-hook.mjs +84 -0
  497. package/.versions/1.0.1/install-manifest.json +2745 -0
  498. package/.versions/1.0.1/justfile +272 -0
  499. package/.versions/1.0.1/manifest-meta.json +882 -0
  500. package/.versions/1.0.1/references/accessibility-checklist.md +160 -0
  501. package/.versions/1.0.1/references/definition-of-done.md +67 -0
  502. package/.versions/1.0.1/references/fleet-coordination-patterns.md +151 -0
  503. package/.versions/1.0.1/references/observability-checklist.md +91 -0
  504. package/.versions/1.0.1/references/orchestration-patterns.md +370 -0
  505. package/.versions/1.0.1/references/performance-checklist.md +153 -0
  506. package/.versions/1.0.1/references/prompting-patterns.md +380 -0
  507. package/.versions/1.0.1/references/security-checklist.md +179 -0
  508. package/.versions/1.0.1/references/testing-patterns.md +236 -0
  509. package/.versions/1.0.1/scripts/codex-conductor.ts +41 -0
  510. package/.versions/1.0.1/scripts/codex-remote-control.ts +167 -0
  511. package/.versions/1.0.1/scripts/coms-claude-bridge.ts +411 -0
  512. package/.versions/1.0.1/scripts/coms-cli.ts +484 -0
  513. package/.versions/1.0.1/scripts/coms-hermes-bridge.ts +413 -0
  514. package/.versions/1.0.1/scripts/fleet.ts +185 -0
  515. package/.versions/1.0.1/scripts/hermes-monitor-capability-runner.ts +25 -0
  516. package/.versions/1.0.1/scripts/hermes-monitor-scenario.ts +474 -0
  517. package/.versions/1.0.1/scripts/hermes-watchdog-capability-probe.ts +45 -0
  518. package/.versions/1.0.1/scripts/install-hermes-plugin.sh +180 -0
  519. package/.versions/1.0.1/scripts/lib/claude-bridge-core.ts +210 -0
  520. package/.versions/1.0.1/scripts/lib/codex-conductor.ts +88 -0
  521. package/.versions/1.0.1/scripts/lib/codex-remote-control.ts +480 -0
  522. package/.versions/1.0.1/scripts/lib/coms-envelope.ts +582 -0
  523. package/.versions/1.0.1/scripts/lib/fake-herdr-server.ts +88 -0
  524. package/.versions/1.0.1/scripts/lib/fleet-command.ts +266 -0
  525. package/.versions/1.0.1/scripts/lib/herdr-layout.ts +281 -0
  526. package/.versions/1.0.1/scripts/lib/hermes-bridge-core.ts +241 -0
  527. package/.versions/1.0.1/scripts/lib/hermes-monitor-events.ts +1 -0
  528. package/.versions/1.0.1/scripts/lib/hermes-monitor-herdr.ts +2 -0
  529. package/.versions/1.0.1/scripts/lib/hermes-monitor-model.ts +3 -0
  530. package/.versions/1.0.1/scripts/lib/hermes-monitor-registry.ts +2 -0
  531. package/.versions/1.0.1/scripts/lib/hermes-monitor-socket.ts +2 -0
  532. package/.versions/1.0.1/scripts/lib/hermes-monitor-store.ts +2 -0
  533. package/.versions/1.0.1/scripts/lib/monitor-env.ts +146 -0
  534. package/.versions/1.0.1/scripts/lib/peer-launch.ts +318 -0
  535. package/.versions/1.0.1/scripts/lib/persona-banner.ts +62 -0
  536. package/.versions/1.0.1/scripts/lib/spawn-stagger.ts +101 -0
  537. package/.versions/1.0.1/scripts/lib/team-project.ts +213 -0
  538. package/.versions/1.0.1/scripts/lib/team-snapshot.ts +147 -0
  539. package/.versions/1.0.1/scripts/peer-banner.ts +40 -0
  540. package/.versions/1.0.1/scripts/peer-launch.ts +259 -0
  541. package/.versions/1.0.1/scripts/team-snapshot.ts +237 -0
  542. package/.versions/1.0.1/scripts/team-up.ts +406 -0
  543. package/.versions/1.0.1/skills/_internal/grilling.md +11 -0
  544. package/.versions/1.0.1/skills/browser-testing-with-devtools/SKILL.md +351 -0
  545. package/.versions/1.0.1/skills/code-review-and-quality/SKILL.md +381 -0
  546. package/.versions/1.0.1/skills/compound-learning/SKILL.md +137 -0
  547. package/.versions/1.0.1/skills/context-engineering/SKILL.md +291 -0
  548. package/.versions/1.0.1/skills/deprecation-and-migration/SKILL.md +206 -0
  549. package/.versions/1.0.1/skills/designing-agents/SKILL.md +394 -0
  550. package/.versions/1.0.1/skills/designing-agents/pi-harness-authoring.md +222 -0
  551. package/.versions/1.0.1/skills/frontend-ui-engineering/SKILL.md +328 -0
  552. package/.versions/1.0.1/skills/git-workflow-and-versioning/SKILL.md +316 -0
  553. package/.versions/1.0.1/skills/idea-refine/SKILL.md +182 -0
  554. package/.versions/1.0.1/skills/idea-refine/examples.md +238 -0
  555. package/.versions/1.0.1/skills/idea-refine/frameworks.md +99 -0
  556. package/.versions/1.0.1/skills/idea-refine/refinement-criteria.md +113 -0
  557. package/.versions/1.0.1/skills/idea-refine/scripts/idea-refine.sh +15 -0
  558. package/.versions/1.0.1/skills/incremental-implementation/SKILL.md +287 -0
  559. package/.versions/1.0.1/skills/interview-me/SKILL.md +226 -0
  560. package/.versions/1.0.1/skills/orchestration-verification/SKILL.md +181 -0
  561. package/.versions/1.0.1/skills/peer-coms/SKILL.md +90 -0
  562. package/.versions/1.0.1/skills/performance-optimization/SKILL.md +350 -0
  563. package/.versions/1.0.1/skills/planning-and-task-breakdown/SKILL.md +254 -0
  564. package/.versions/1.0.1/skills/security-and-hardening/SKILL.md +461 -0
  565. package/.versions/1.0.1/skills/spec-driven-development/SKILL.md +257 -0
  566. package/.versions/1.0.1/skills/using-agent-skills/SKILL.md +199 -0
  567. package/.versions/1.0.1/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  568. package/.versions/1.0.1/vendor/agent-skills-upstream/LICENSE +21 -0
  569. package/.versions/1.0.1/vendor/agent-skills-upstream/README.md +11 -0
  570. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  571. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  572. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  573. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  574. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  575. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  576. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  577. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  578. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  579. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  580. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  581. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  582. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  583. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  584. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  585. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  586. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  587. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  588. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  589. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  590. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  591. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  592. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  593. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  594. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  595. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  596. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  597. package/.versions/1.0.1/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  598. package/CHANGELOG.md +148 -0
  599. package/README.md +117 -79
  600. package/agents/code-reviewer.md +1 -1
  601. package/agents/deep-researcher.md +1 -1
  602. package/agents/orchestrator.md +1 -1
  603. package/agents/plan-reviewer.md +1 -1
  604. package/agents/planner.md +1 -1
  605. package/agents/security-auditor.md +1 -1
  606. package/agents/test-engineer.md +1 -1
  607. package/bin/catalog/harness-runtime-closure.json +38 -0
  608. package/bin/cli.js +289 -359
  609. package/bin/force-patch-changesets.js +18 -2
  610. package/bin/lib/apply.js +86 -32
  611. package/bin/lib/desired.js +87 -0
  612. package/bin/lib/detect-agent.js +22 -38
  613. package/bin/lib/doctor.js +283 -33
  614. package/bin/lib/features.js +78 -0
  615. package/bin/lib/manifest.js +127 -48
  616. package/bin/lib/overrides.js +35 -0
  617. package/bin/lib/personas.js +37 -0
  618. package/bin/lib/plan.js +18 -9
  619. package/bin/lib/purge.js +11 -0
  620. package/bin/lib/reconcile.js +68 -0
  621. package/bin/lib/scan.js +24 -0
  622. package/bin/lib/state.js +25 -1
  623. package/bin/lib/stt-wizard.js +33 -0
  624. package/bin/lib/transaction.js +149 -0
  625. package/bin/lib/tui.js +71 -0
  626. package/bin/lib/verify.js +9 -26
  627. package/bin/snapshot-version.js +3 -6
  628. package/docs/ARCHITECTURE.md +55 -21
  629. package/docs/MIGRATION-agent-fleet.md +222 -0
  630. package/docs/agent-fleet-setup.md +124 -64
  631. package/docs/claude-code-coms-bridge.md +21 -2
  632. package/docs/coms-hermes-bridge.md +1 -1
  633. package/docs/getting-started.md +61 -217
  634. package/docs/npm-install.md +207 -429
  635. package/docs/pi-extensions.md +85 -41
  636. package/docs/pi-setup.md +48 -545
  637. package/hermes/README.md +1 -1
  638. package/install-manifest.json +385 -1255
  639. package/justfile +45 -27
  640. package/manifest-meta.json +544 -134
  641. package/node_modules/pi-ask-user/README.md +43 -5
  642. package/node_modules/pi-ask-user/index.ts +630 -75
  643. package/node_modules/pi-ask-user/package.json +1 -1
  644. package/package.json +5 -11
  645. package/scripts/coms-claude-bridge.ts +10 -0
  646. package/scripts/fleet.ts +107 -90
  647. package/scripts/lib/claude-bridge-core.ts +45 -0
  648. package/scripts/lib/fleet-command.ts +170 -15
  649. package/scripts/lib/monitor-env.ts +18 -6
  650. package/scripts/lib/peer-launch.ts +6 -2
  651. package/scripts/lib/team-project.ts +24 -4
  652. package/scripts/team-up.ts +57 -11
  653. package/skills/designing-agents/SKILL.md +1 -1
  654. package/skills/designing-agents/pi-harness-authoring.md +3 -3
  655. package/.claude/commands/build.md +0 -44
  656. package/.claude/commands/design-agent.md +0 -14
  657. package/.claude/commands/doctor-agent-fleet.md +0 -22
  658. package/.claude/commands/orchestrate.md +0 -112
  659. package/.claude/commands/prime.md +0 -22
  660. package/.claude/commands/set-hermes-telegram.md +0 -15
  661. package/.claude/commands/set-hermes-watchdog.md +0 -6
  662. package/.claude/commands/setup-agent-fleet.md +0 -17
  663. package/.claude/commands/ship.md +0 -72
  664. package/.claude/commands/webperf.md +0 -32
  665. package/.claude/orchestrate-teams.yaml +0 -24
  666. package/.opencode/commands/af-build.md +0 -17
  667. package/.opencode/commands/af-code-simplify.md +0 -16
  668. package/.opencode/commands/af-compound.md +0 -16
  669. package/.opencode/commands/af-design-agent.md +0 -15
  670. package/.opencode/commands/af-doctor-agent-fleet.md +0 -22
  671. package/.opencode/commands/af-orchestrate.md +0 -112
  672. package/.opencode/commands/af-plan.md +0 -16
  673. package/.opencode/commands/af-prime.md +0 -22
  674. package/.opencode/commands/af-review.md +0 -15
  675. package/.opencode/commands/af-set-hermes-watchdog.md +0 -6
  676. package/.opencode/commands/af-setup-agent-fleet.md +0 -17
  677. package/.opencode/commands/af-ship.md +0 -16
  678. package/.opencode/commands/af-spec.md +0 -16
  679. package/.opencode/commands/af-test.md +0 -21
  680. package/.opencode/commands/af-webperf.md +0 -32
  681. package/.opencode/orchestrate-teams.yaml +0 -24
  682. package/.pi/prompts/af-doctor-agent-fleet.md +0 -22
  683. package/.pi/prompts/af-setup-agent-fleet.md +0 -19
  684. package/.versions/0.0.1/.opencode/commands/af-doctor-agent-fleet.md +0 -15
  685. package/.versions/0.0.1/.opencode/commands/af-setup-agent-fleet.md +0 -15
  686. package/.versions/0.0.1/skills/guided-workspace-setup/SKILL.md +0 -506
  687. package/.versions/0.0.10/.opencode/commands/af-doctor-agent-fleet.md +0 -22
  688. package/.versions/0.0.10/.opencode/commands/af-setup-agent-fleet.md +0 -17
  689. package/.versions/0.0.10/.pi/prompts/af-doctor-agent-fleet.md +0 -22
  690. package/.versions/0.0.10/.pi/prompts/af-setup-agent-fleet.md +0 -19
  691. package/.versions/0.0.10/skills/guided-workspace-setup/SKILL.md +0 -226
  692. package/.versions/0.0.11/.claude/commands/build.md +0 -44
  693. package/.versions/0.0.11/.claude/commands/design-agent.md +0 -14
  694. package/.versions/0.0.11/.claude/commands/doctor-agent-fleet.md +0 -22
  695. package/.versions/0.0.11/.claude/commands/orchestrate.md +0 -112
  696. package/.versions/0.0.11/.claude/commands/prime.md +0 -22
  697. package/.versions/0.0.11/.claude/commands/set-hermes-telegram.md +0 -15
  698. package/.versions/0.0.11/.claude/commands/set-hermes-watchdog.md +0 -6
  699. package/.versions/0.0.11/.claude/commands/setup-agent-fleet.md +0 -17
  700. package/.versions/0.0.11/.claude/commands/ship.md +0 -72
  701. package/.versions/0.0.11/.claude/commands/webperf.md +0 -32
  702. package/.versions/0.0.11/.claude/orchestrate-teams.yaml +0 -24
  703. package/.versions/0.0.11/.opencode/commands/af-build.md +0 -17
  704. package/.versions/0.0.11/.opencode/commands/af-code-simplify.md +0 -16
  705. package/.versions/0.0.11/.opencode/commands/af-compound.md +0 -16
  706. package/.versions/0.0.11/.opencode/commands/af-design-agent.md +0 -15
  707. package/.versions/0.0.11/.opencode/commands/af-doctor-agent-fleet.md +0 -22
  708. package/.versions/0.0.11/.opencode/commands/af-orchestrate.md +0 -112
  709. package/.versions/0.0.11/.opencode/commands/af-plan.md +0 -16
  710. package/.versions/0.0.11/.opencode/commands/af-prime.md +0 -22
  711. package/.versions/0.0.11/.opencode/commands/af-review.md +0 -15
  712. package/.versions/0.0.11/.opencode/commands/af-set-hermes-watchdog.md +0 -6
  713. package/.versions/0.0.11/.opencode/commands/af-setup-agent-fleet.md +0 -17
  714. package/.versions/0.0.11/.opencode/commands/af-ship.md +0 -16
  715. package/.versions/0.0.11/.opencode/commands/af-spec.md +0 -16
  716. package/.versions/0.0.11/.opencode/commands/af-test.md +0 -21
  717. package/.versions/0.0.11/.opencode/commands/af-webperf.md +0 -32
  718. package/.versions/0.0.11/.opencode/orchestrate-teams.yaml +0 -24
  719. package/.versions/0.0.11/.pi/prompts/af-doctor-agent-fleet.md +0 -22
  720. package/.versions/0.0.11/.pi/prompts/af-setup-agent-fleet.md +0 -19
  721. package/.versions/0.0.11/docs/opencode-setup.md +0 -281
  722. package/.versions/0.0.11/hooks/SIMPLIFY-IGNORE.md +0 -90
  723. package/.versions/0.0.11/hooks/hooks.json +0 -14
  724. package/.versions/0.0.11/hooks/session-start.sh +0 -74
  725. package/.versions/0.0.11/hooks/simplify-ignore.sh +0 -302
  726. package/.versions/0.0.11/skills/guided-workspace-setup/SKILL.md +0 -226
  727. package/.versions/0.0.4/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  728. package/.versions/0.0.4/.opencode/commands/af-setup-agent-fleet.md +0 -15
  729. package/.versions/0.0.4/skills/guided-workspace-setup/SKILL.md +0 -535
  730. package/.versions/0.0.4/skills/guided-workspace-setup/companion-manifest.json +0 -33
  731. package/.versions/0.0.5/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  732. package/.versions/0.0.5/.opencode/commands/af-setup-agent-fleet.md +0 -15
  733. package/.versions/0.0.5/skills/guided-workspace-setup/SKILL.md +0 -542
  734. package/.versions/0.0.5/skills/guided-workspace-setup/companion-manifest.json +0 -35
  735. package/.versions/0.0.6/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  736. package/.versions/0.0.6/.opencode/commands/af-setup-agent-fleet.md +0 -15
  737. package/.versions/0.0.6/.pi/prompts/af-doctor-agent-fleet.md +0 -15
  738. package/.versions/0.0.6/.pi/prompts/af-setup-agent-fleet.md +0 -27
  739. package/.versions/0.0.6/skills/guided-workspace-setup/SKILL.md +0 -544
  740. package/.versions/0.0.6/skills/guided-workspace-setup/companion-manifest.json +0 -35
  741. package/.versions/0.0.7/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  742. package/.versions/0.0.7/.opencode/commands/af-setup-agent-fleet.md +0 -15
  743. package/.versions/0.0.7/.pi/prompts/af-doctor-agent-fleet.md +0 -15
  744. package/.versions/0.0.7/.pi/prompts/af-setup-agent-fleet.md +0 -27
  745. package/.versions/0.0.7/skills/guided-workspace-setup/SKILL.md +0 -544
  746. package/.versions/0.0.7/skills/guided-workspace-setup/companion-manifest.json +0 -35
  747. package/.versions/0.0.8/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  748. package/.versions/0.0.8/.opencode/commands/af-setup-agent-fleet.md +0 -15
  749. package/.versions/0.0.8/.pi/prompts/af-doctor-agent-fleet.md +0 -15
  750. package/.versions/0.0.8/.pi/prompts/af-setup-agent-fleet.md +0 -27
  751. package/.versions/0.0.8/skills/guided-workspace-setup/SKILL.md +0 -544
  752. package/.versions/0.0.8/skills/guided-workspace-setup/companion-manifest.json +0 -36
  753. package/.versions/0.0.9/.opencode/commands/af-doctor-agent-fleet.md +0 -17
  754. package/.versions/0.0.9/.opencode/commands/af-setup-agent-fleet.md +0 -15
  755. package/.versions/0.0.9/.pi/prompts/af-doctor-agent-fleet.md +0 -15
  756. package/.versions/0.0.9/.pi/prompts/af-setup-agent-fleet.md +0 -27
  757. package/.versions/0.0.9/skills/guided-workspace-setup/SKILL.md +0 -544
  758. package/bin/lib/bootstrap.js +0 -323
  759. package/bin/lib/transform-persona.js +0 -180
  760. package/docs/opencode-setup.md +0 -281
  761. package/hooks/SIMPLIFY-IGNORE.md +0 -90
  762. package/hooks/hooks.json +0 -14
  763. package/hooks/session-start.sh +0 -74
  764. package/hooks/simplify-ignore.sh +0 -302
  765. package/skills/guided-workspace-setup/SKILL.md +0 -226
  766. /package/.versions/0.0.10/{skills/guided-workspace-setup/companion-manifest.json → bin/catalog/harness-runtime-closure.json} +0 -0
  767. /package/.versions/0.0.11/{skills/guided-workspace-setup/companion-manifest.json → bin/catalog/harness-runtime-closure.json} +0 -0
  768. /package/{.opencode/commands → .versions/1.0.0/.pi/prompts}/af-set-hermes-telegram.md +0 -0
  769. /package/.versions/{0.0.9/skills/guided-workspace-setup/companion-manifest.json → 1.0.0/bin/catalog/harness-runtime-closure.json} +0 -0
  770. /package/.versions/{0.0.11/.opencode/commands → 1.0.1/.pi/prompts}/af-set-hermes-telegram.md +0 -0
  771. /package/{skills/guided-workspace-setup/companion-manifest.json → .versions/1.0.1/bin/catalog/harness-runtime-closure.json} +0 -0
@@ -11,6 +11,7 @@ import { Type, type TUnsafe } from "@sinclair/typebox";
11
11
  import {
12
12
  Container,
13
13
  type Component,
14
+ CURSOR_MARKER,
14
15
  decodeKittyPrintable,
15
16
  Editor,
16
17
  type EditorTheme,
@@ -22,13 +23,14 @@ import {
22
23
  type MarkdownTheme,
23
24
  matchesKey,
24
25
  type OverlayHandle,
26
+ type OverlayOptions,
25
27
  Spacer,
26
28
  Text,
27
29
  type TUI,
28
30
  truncateToWidth,
29
31
  wrapTextWithAnsi,
30
32
  } from "@earendil-works/pi-tui";
31
- import { renderSingleSelectRows } from "./single-select-layout";
33
+ import { renderSingleSelectRows, type QuestionOption } from "./single-select-layout";
32
34
 
33
35
  import { createRequire } from "node:module";
34
36
  const _require = createRequire(import.meta.url);
@@ -85,6 +87,7 @@ function safeMarkdownTheme(): MarkdownTheme | undefined {
85
87
  type AskOptionInput = QuestionOption | string;
86
88
 
87
89
  type AskDisplayMode = "overlay" | "inline";
90
+ type AskSingleSelectLayout = "auto" | "list";
88
91
 
89
92
  interface AskParams {
90
93
  question: string;
@@ -94,6 +97,7 @@ interface AskParams {
94
97
  allowFreeform?: boolean;
95
98
  allowComment?: boolean;
96
99
  displayMode?: AskDisplayMode;
100
+ singleSelectLayout?: AskSingleSelectLayout;
97
101
  overlayToggleKey?: string | null;
98
102
  commentToggleKey?: string | null;
99
103
  timeout?: number;
@@ -120,18 +124,28 @@ interface AskToolDetails {
120
124
 
121
125
  type AskUIResult = AskResponse;
122
126
 
123
- function normalizeOptions(options: AskOptionInput[]): QuestionOption[] {
124
- return options
125
- .map((option) => {
126
- if (typeof option === "string") {
127
- return { title: option };
128
- }
129
- if (option && typeof option === "object" && typeof option.title === "string") {
130
- return { title: option.title, description: option.description };
127
+ // Key aliases models fall back to when a schema-mangling proxy (Google
128
+ // function calling, Codex-style backends, cmux) strips the option shape and
129
+ // the model has to guess. See issue #22.
130
+ const OPTION_TITLE_KEYS = ["title", "label", "text", "value", "name", "option"] as const;
131
+
132
+ function coerceOption(option: unknown): QuestionOption | null {
133
+ if (typeof option === "string" || typeof option === "number" || typeof option === "boolean") {
134
+ const title = String(option).trim();
135
+ return title ? { title } : null;
136
+ }
137
+ if (option && typeof option === "object") {
138
+ const record = option as Record<string, unknown>;
139
+ for (const key of OPTION_TITLE_KEYS) {
140
+ const value = record[key];
141
+ if (typeof value === "string" && value.trim()) {
142
+ const description =
143
+ typeof record.description === "string" && record.description.trim() ? record.description : undefined;
144
+ return description ? { title: value.trim(), description } : { title: value.trim() };
131
145
  }
132
- return null;
133
- })
134
- .filter((option): option is QuestionOption => option !== null);
146
+ }
147
+ }
148
+ return null;
135
149
  }
136
150
 
137
151
  function formatOptionsForMessage(options: QuestionOption[]): string {
@@ -148,6 +162,24 @@ function normalizeOptionalComment(text: string | null | undefined): string | und
148
162
  return trimmed ? trimmed : undefined;
149
163
  }
150
164
 
165
+ function parseBooleanPreference(value: string | undefined): boolean | undefined {
166
+ if (value === undefined) return undefined;
167
+ switch (value.trim().toLowerCase()) {
168
+ case "1":
169
+ case "true":
170
+ case "yes":
171
+ case "on":
172
+ return true;
173
+ case "0":
174
+ case "false":
175
+ case "no":
176
+ case "off":
177
+ return false;
178
+ default:
179
+ return undefined;
180
+ }
181
+ }
182
+
151
183
  function createFreeformResponse(text: string | null | undefined): AskResponse | null {
152
184
  const trimmed = text?.trim();
153
185
  return trimmed ? { kind: "freeform", text: trimmed } : null;
@@ -339,6 +371,7 @@ function resolveShortcut(
339
371
  type AskMode = "select" | "freeform" | "comment";
340
372
 
341
373
  const ASK_OVERLAY_MAX_HEIGHT_RATIO = 0.85;
374
+ const ASK_OVERLAY_MIN_RENDER_LINES = 8;
342
375
  const ASK_OVERLAY_WIDTH = "92%";
343
376
  const ASK_OVERLAY_MIN_WIDTH = 40;
344
377
  const SINGLE_SELECT_SPLIT_PANE_MIN_WIDTH = 84;
@@ -349,11 +382,27 @@ const FREEFORM_SENTINEL = "\u270f\ufe0f Type custom response...";
349
382
  const COMMENT_TOGGLE_LABEL = "Add extra context after selection";
350
383
  const DEFAULT_OVERLAY_TOGGLE_KEY = "alt+o";
351
384
  const DEFAULT_COMMENT_TOGGLE_KEY = "ctrl+g";
385
+ const CONTEXT_TOGGLE_KEYS = [Key.ctrl("e"), Key.ctrl("x"), Key.ctrl("y")];
386
+ const INLINE_CONTEXT_MAX_ROWS = 3;
352
387
 
353
388
  // Vim-style aliases for navigating option lists. ctrl+j/k are safe in the
354
389
  // searchable single-select because they don't collide with fuzzy-search input.
355
390
  const VIM_SELECT_UP_KEY = Key.ctrl("k");
356
391
  const VIM_SELECT_DOWN_KEY = Key.ctrl("j");
392
+ const PROMPT_SCROLL_PAGE_UP_KEY = Key.pageUp;
393
+ const PROMPT_SCROLL_PAGE_DOWN_KEY = Key.pageDown;
394
+ const PROMPT_SCROLL_HOME_KEY = Key.home;
395
+ const PROMPT_SCROLL_END_KEY = Key.end;
396
+ const PROMPT_SCROLL_HALF_PAGE_UP_KEY = Key.ctrl("u");
397
+ const PROMPT_SCROLL_HALF_PAGE_DOWN_KEY = Key.ctrl("d");
398
+
399
+ function getOverlayMaxRenderLinesForRows(rows: number): number {
400
+ const normalizedRows = Number.isFinite(rows) ? Math.max(1, Math.floor(rows)) : 24;
401
+ const availableRows = Math.max(1, normalizedRows - 2);
402
+ const ratioRows = Math.max(1, Math.floor(normalizedRows * ASK_OVERLAY_MAX_HEIGHT_RATIO));
403
+ const minimumRows = Math.min(ASK_OVERLAY_MIN_RENDER_LINES, availableRows);
404
+ return Math.min(availableRows, Math.max(minimumRows, ratioRows));
405
+ }
357
406
 
358
407
  function matchesSelectUp(data: string, keybindings: KeybindingsManager): boolean {
359
408
  return (
@@ -374,7 +423,7 @@ function matchesSelectDown(data: string, keybindings: KeybindingsManager): boole
374
423
  function buildCustomUIOptions(
375
424
  displayMode: AskDisplayMode,
376
425
  onHandle?: (handle: OverlayHandle) => void,
377
- ) {
426
+ ): { overlay?: boolean; overlayOptions?: OverlayOptions; onHandle?: (handle: OverlayHandle) => void } | undefined {
378
427
  switch (displayMode) {
379
428
  case "inline":
380
429
  return undefined;
@@ -418,6 +467,7 @@ class MultiSelectList implements Component {
418
467
  private selectedIndex = 0;
419
468
  private checked = new Set<number>();
420
469
  private commentEnabled = false;
470
+ private maxVisibleRows = 10;
421
471
  private cachedWidth?: number;
422
472
  private cachedLines?: string[];
423
473
 
@@ -445,6 +495,14 @@ class MultiSelectList implements Component {
445
495
  return this.commentEnabled;
446
496
  }
447
497
 
498
+ setMaxVisibleRows(rows: number): void {
499
+ const next = Math.max(1, Math.floor(rows));
500
+ if (next !== this.maxVisibleRows) {
501
+ this.maxVisibleRows = next;
502
+ this.invalidate();
503
+ }
504
+ }
505
+
448
506
  invalidate(): void {
449
507
  this.cachedWidth = undefined;
450
508
  this.cachedLines = undefined;
@@ -567,7 +625,6 @@ class MultiSelectList implements Component {
567
625
 
568
626
  const theme = this.theme;
569
627
  const count = this.getItemCount();
570
- const maxVisible = Math.min(count, 10);
571
628
 
572
629
  if (count === 0) {
573
630
  this.cachedLines = [theme.fg("warning", "No options")];
@@ -575,21 +632,20 @@ class MultiSelectList implements Component {
575
632
  return this.cachedLines;
576
633
  }
577
634
 
578
- const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), count - maxVisible));
579
- const endIndex = Math.min(startIndex + maxVisible, count);
580
-
581
- const lines: string[] = [];
635
+ const blocks: string[][] = [];
582
636
 
583
- for (let i = startIndex; i < endIndex; i++) {
637
+ for (let i = 0; i < count; i++) {
584
638
  const isSelected = i === this.selectedIndex;
585
639
  const prefix = isSelected ? theme.fg("accent", "→") : " ";
640
+ const block: string[] = [];
586
641
 
587
642
  if (this.isCommentToggleRow(i)) {
588
643
  const checkbox = this.commentEnabled ? theme.fg("success", "[✓]") : theme.fg("dim", "[ ]");
589
644
  const label = isSelected
590
645
  ? theme.fg("accent", theme.bold(COMMENT_TOGGLE_LABEL))
591
646
  : theme.fg("text", theme.bold(COMMENT_TOGGLE_LABEL));
592
- lines.push(truncateToWidth(`${prefix} ${checkbox} ${label}`, width, ""));
647
+ block.push(truncateToWidth(`${prefix} ${checkbox} ${label}`, width, ""));
648
+ blocks.push(block);
593
649
  continue;
594
650
  }
595
651
 
@@ -597,12 +653,12 @@ class MultiSelectList implements Component {
597
653
  const label = theme.fg("text", theme.bold("Type something."));
598
654
  const desc = theme.fg("muted", "Enter a custom response");
599
655
  const line = `${prefix} ${label} ${theme.fg("dim", "—")} ${desc}`;
600
- lines.push(truncateToWidth(line, width, ""));
656
+ block.push(truncateToWidth(line, width, ""));
657
+ blocks.push(block);
601
658
  continue;
602
659
  }
603
660
 
604
- const option = this.options[i];
605
- if (!option) continue;
661
+ const option = this.options[i]!;
606
662
 
607
663
  const checkbox = this.checked.has(i) ? theme.fg("success", "[✓]") : theme.fg("dim", "[ ]");
608
664
  const num = theme.fg("dim", `${i + 1}.`);
@@ -611,20 +667,61 @@ class MultiSelectList implements Component {
611
667
  : theme.fg("text", theme.bold(option.title));
612
668
 
613
669
  const firstLine = `${prefix} ${num} ${checkbox} ${title}`;
614
- lines.push(truncateToWidth(firstLine, width, ""));
670
+ block.push(truncateToWidth(firstLine, width, ""));
615
671
 
616
672
  if (option.description) {
617
673
  const indent = " ";
618
674
  const wrapWidth = Math.max(10, width - indent.length);
619
675
  const wrapped = wrapTextWithAnsi(option.description, wrapWidth);
620
676
  for (const w of wrapped) {
621
- lines.push(truncateToWidth(indent + theme.fg("muted", w), width, ""));
677
+ block.push(truncateToWidth(indent + theme.fg("muted", w), width, ""));
622
678
  }
623
679
  }
680
+
681
+ blocks.push(block);
624
682
  }
625
683
 
626
- if (startIndex > 0 || endIndex < count) {
627
- lines.push(theme.fg("dim", truncateToWidth(` (${this.selectedIndex + 1}/${count})`, width, "")));
684
+ const maxRows = this.maxVisibleRows;
685
+ const totalRows = blocks.reduce((sum, block) => sum + block.length, 0);
686
+ let lines: string[];
687
+
688
+ if (totalRows <= maxRows) {
689
+ lines = blocks.flat();
690
+ } else {
691
+ const availableRows = maxRows > 1 ? maxRows - 1 : 1;
692
+ const selectedBlock = blocks[this.selectedIndex] ?? blocks[0] ?? [];
693
+
694
+ if (selectedBlock.length >= availableRows) {
695
+ lines = selectedBlock.slice(0, availableRows);
696
+ } else {
697
+ let startIndex = this.selectedIndex;
698
+ let endIndex = this.selectedIndex + 1;
699
+ let usedRows = selectedBlock.length;
700
+
701
+ while (true) {
702
+ const nextBlock = blocks[endIndex];
703
+ if (nextBlock && usedRows + nextBlock.length <= availableRows) {
704
+ usedRows += nextBlock.length;
705
+ endIndex += 1;
706
+ continue;
707
+ }
708
+
709
+ const previousBlock = blocks[startIndex - 1];
710
+ if (previousBlock && usedRows + previousBlock.length <= availableRows) {
711
+ startIndex -= 1;
712
+ usedRows += previousBlock.length;
713
+ continue;
714
+ }
715
+
716
+ break;
717
+ }
718
+
719
+ lines = blocks.slice(startIndex, endIndex).flat();
720
+ }
721
+
722
+ if (maxRows > 1) {
723
+ lines.push(theme.fg("dim", truncateToWidth(` (${this.selectedIndex + 1}/${count})`, width, "")));
724
+ }
628
725
  }
629
726
 
630
727
  this.cachedWidth = width;
@@ -638,6 +735,7 @@ class WrappedSingleSelectList implements Component {
638
735
  private allowFreeform: boolean;
639
736
  private allowComment: boolean;
640
737
  private theme: Theme;
738
+ private singleSelectLayout: AskSingleSelectLayout;
641
739
  private keybindings: KeybindingsManager;
642
740
  private commentToggle: ResolvedShortcut;
643
741
  private selectedIndex = 0;
@@ -656,6 +754,7 @@ class WrappedSingleSelectList implements Component {
656
754
  allowFreeform: boolean,
657
755
  allowComment: boolean,
658
756
  theme: Theme,
757
+ singleSelectLayout: AskSingleSelectLayout,
659
758
  keybindings: KeybindingsManager,
660
759
  commentToggle: ResolvedShortcut,
661
760
  ) {
@@ -663,6 +762,7 @@ class WrappedSingleSelectList implements Component {
663
762
  this.allowFreeform = allowFreeform;
664
763
  this.allowComment = allowComment;
665
764
  this.theme = theme;
765
+ this.singleSelectLayout = singleSelectLayout;
666
766
  this.keybindings = keybindings;
667
767
  this.commentToggle = commentToggle;
668
768
  }
@@ -760,6 +860,7 @@ class WrappedSingleSelectList implements Component {
760
860
  }
761
861
 
762
862
  private getSplitPaneWidths(width: number): { left: number; right: number } | null {
863
+ if (this.singleSelectLayout === "list") return null;
763
864
  if (width < SINGLE_SELECT_SPLIT_PANE_MIN_WIDTH) return null;
764
865
 
765
866
  const availableWidth = width - SINGLE_SELECT_SPLIT_PANE_SEPARATOR.length;
@@ -988,6 +1089,7 @@ class AskComponent extends Container {
988
1089
  private allowFreeform: boolean;
989
1090
  private allowComment: boolean;
990
1091
  private displayMode: AskDisplayMode;
1092
+ private singleSelectLayout: AskSingleSelectLayout;
991
1093
  private tui: TUI;
992
1094
  private theme: Theme;
993
1095
  private keybindings: KeybindingsManager;
@@ -998,6 +1100,11 @@ class AskComponent extends Container {
998
1100
  private pendingSelections: string[] = [];
999
1101
  private freeformDraft = "";
1000
1102
  private commentDraft = "";
1103
+ private promptScrollOffset = 0;
1104
+ private promptMaxScrollOffset = 0;
1105
+ private promptViewportRows = 0;
1106
+ private contextIsCollapsible = false;
1107
+ private contextExpanded = false;
1001
1108
 
1002
1109
  // Static layout components
1003
1110
  private titleText: Text;
@@ -1031,6 +1138,7 @@ class AskComponent extends Container {
1031
1138
  allowFreeform: boolean,
1032
1139
  allowComment: boolean,
1033
1140
  displayMode: AskDisplayMode,
1141
+ singleSelectLayout: AskSingleSelectLayout,
1034
1142
  tui: TUI,
1035
1143
  theme: Theme,
1036
1144
  keybindings: KeybindingsManager,
@@ -1046,6 +1154,7 @@ class AskComponent extends Container {
1046
1154
  this.allowFreeform = allowFreeform;
1047
1155
  this.allowComment = allowComment;
1048
1156
  this.displayMode = displayMode;
1157
+ this.singleSelectLayout = singleSelectLayout;
1049
1158
  this.tui = tui;
1050
1159
  this.theme = theme;
1051
1160
  this.keybindings = keybindings;
@@ -1107,43 +1216,374 @@ class AskComponent extends Container {
1107
1216
  override render(width: number): string[] {
1108
1217
  const innerWidth = Math.max(1, width - BOX_BORDER_OVERHEAD);
1109
1218
 
1219
+ if (this.displayMode === "overlay") {
1220
+ return this.renderOverlayLayout(width, innerWidth);
1221
+ }
1222
+
1110
1223
  if (this.mode === "select" && !this.allowMultiple) {
1111
- const overlayMaxHeight = Math.max(12, Math.floor(this.tui.terminal.rows * ASK_OVERLAY_MAX_HEIGHT_RATIO));
1112
- const staticLines = this.countStaticLines(innerWidth);
1113
- const availableOptionRows = Math.max(4, overlayMaxHeight - staticLines);
1114
- this.ensureSingleSelectList().setMaxVisibleRows(availableOptionRows);
1224
+ this.ensureSingleSelectList().setMaxVisibleRows(12);
1115
1225
  }
1116
1226
 
1117
- // Render children at the inner width (excluding side border characters)
1118
- const rawLines = super.render(innerWidth);
1227
+ return this.renderInlineLayout(width, innerWidth);
1228
+ }
1119
1229
 
1120
- // First and last lines are the top/bottom box borders — pass through at full width.
1121
- // All inner lines get wrapped with side borders.
1122
- const borderColor = (s: string) => this.theme.fg("accent", s);
1123
- const titleColor = (s: string) => this.theme.fg("dim", this.theme.bold(s));
1124
- return rawLines.map((line, index) => {
1125
- if (index === 0 || index === rawLines.length - 1) {
1126
- // Box top/bottom borders already rendered at innerWidth — re-render at full width
1127
- if (index === 0) return new BoxBorderTop(borderColor, "ask_user", titleColor).render(width)[0];
1128
- return new BoxBorderBottom(borderColor, `v${ASK_USER_VERSION}`, (s: string) => this.theme.fg("dim", s)).render(width)[0];
1230
+ private renderInlineLayout(width: number, innerWidth: number): string[] {
1231
+ const fullContextLines = this.buildFullContextLines(innerWidth);
1232
+ this.setContextIsCollapsible(fullContextLines.length > INLINE_CONTEXT_MAX_ROWS);
1233
+ if (this.contextExpanded) {
1234
+ return this.renderOverlayLayout(width, innerWidth);
1235
+ }
1236
+ const bodyLines = [
1237
+ ...this.buildPromptLines(innerWidth, fullContextLines),
1238
+ "",
1239
+ ...this.modeContainer.render(innerWidth),
1240
+ "",
1241
+ ...this.helpText.render(innerWidth),
1242
+ ];
1243
+ return this.frameBodyLines(bodyLines, width, innerWidth);
1244
+ }
1245
+
1246
+ private getOverlayMaxRenderLines(): number {
1247
+ const rows = Number.isFinite(this.tui.terminal.rows) ? Math.floor(this.tui.terminal.rows) : 24;
1248
+ return getOverlayMaxRenderLinesForRows(rows);
1249
+ }
1250
+
1251
+ private renderOverlayLayout(width: number, innerWidth: number): string[] {
1252
+ const maxLines = this.getOverlayMaxRenderLines();
1253
+ if (maxLines <= 1) return [this.renderTopBorder(width)];
1254
+ if (maxLines === 2) return [this.renderTopBorder(width), this.renderBottomBorder(width)];
1255
+
1256
+ const bodyCapacity = Math.max(0, maxLines - 2);
1257
+ let helpFullLines = this.helpText.render(innerWidth);
1258
+ const questionLines = this.buildQuestionLines(innerWidth);
1259
+ const fullContextLines = this.buildFullContextLines(innerWidth);
1260
+ const shouldCollapse = this.displayMode === "inline"
1261
+ ? this.contextIsCollapsible
1262
+ : this.mode === "select"
1263
+ ? this.shouldCollapseContextForOverlay(
1264
+ questionLines.length,
1265
+ fullContextLines.length,
1266
+ bodyCapacity,
1267
+ helpFullLines.length,
1268
+ )
1269
+ : this.contextIsCollapsible;
1270
+ this.setContextIsCollapsible(shouldCollapse);
1271
+ helpFullLines = this.helpText.render(innerWidth);
1272
+ const promptLines = this.buildPromptLines(innerWidth, fullContextLines);
1273
+ const helpBudget = this.getOverlayHelpBudget(bodyCapacity, helpFullLines.length);
1274
+ const contentRows = Math.max(0, bodyCapacity - helpBudget);
1275
+
1276
+ let promptBudget = 0;
1277
+ let modeBudget = 0;
1278
+ let separatorRows = 0;
1279
+
1280
+ if (this.mode === "select") {
1281
+ separatorRows = contentRows >= 4 ? 1 : 0;
1282
+ const promptAndModeRows = Math.max(0, contentRows - separatorRows);
1283
+ promptBudget = promptAndModeRows;
1284
+
1285
+ if (promptAndModeRows > 0) {
1286
+ const promptMinRows = promptLines.length > 0 ? 1 : 0;
1287
+ const maximumModeRows = Math.max(0, promptAndModeRows - promptMinRows);
1288
+ const modeMinRows = Math.min(this.getMinimumModeRows(), maximumModeRows);
1289
+ modeBudget = Math.min(this.getPreferredModeRows(), maximumModeRows);
1290
+ modeBudget = Math.max(modeMinRows, modeBudget);
1291
+ promptBudget = promptAndModeRows - modeBudget;
1292
+
1293
+ const usefulPromptTarget = this.contextIsCollapsible && !this.contextExpanded ? 3 : 2;
1294
+ const usefulPromptRows = Math.min(
1295
+ promptLines.length,
1296
+ promptAndModeRows >= modeMinRows + usefulPromptTarget ? usefulPromptTarget : promptMinRows,
1297
+ );
1298
+ if (promptBudget < usefulPromptRows && modeBudget > modeMinRows) {
1299
+ const shiftedRows = Math.min(usefulPromptRows - promptBudget, modeBudget - modeMinRows);
1300
+ modeBudget -= shiftedRows;
1301
+ promptBudget += shiftedRows;
1302
+ }
1129
1303
  }
1130
- const padded = truncateToWidth(line, innerWidth, "", true);
1131
- return `${borderColor(BOX_BORDER_LEFT)}${padded}${borderColor(BOX_BORDER_RIGHT)}`;
1132
- });
1304
+ } else {
1305
+ modeBudget = Math.min(this.getPreferredModeRows(), contentRows);
1306
+ modeBudget = Math.max(Math.min(this.getMinimumModeRows(), contentRows), modeBudget);
1307
+ promptBudget = Math.max(0, contentRows - modeBudget);
1308
+ if (promptBudget > 0 && modeBudget > 0) {
1309
+ separatorRows = 1;
1310
+ promptBudget = Math.max(0, promptBudget - separatorRows);
1311
+ }
1312
+ }
1313
+
1314
+ const modeLines = this.renderModeLines(innerWidth, modeBudget);
1315
+ if (modeLines.length < modeBudget) {
1316
+ promptBudget += modeBudget - modeLines.length;
1317
+ }
1318
+
1319
+ const promptPaneLines = this.renderPromptPane(promptLines, promptBudget, innerWidth);
1320
+ const helpLines = this.limitLines(helpFullLines, helpBudget, innerWidth, false);
1321
+ const bodyLines = [
1322
+ ...promptPaneLines,
1323
+ ...(separatorRows > 0 && promptPaneLines.length > 0 && modeLines.length > 0 ? [""] : []),
1324
+ ...modeLines,
1325
+ ...helpLines,
1326
+ ];
1327
+
1328
+ return this.frameBodyLines(bodyLines.slice(0, bodyCapacity), width, innerWidth);
1329
+ }
1330
+
1331
+ private buildQuestionLines(width: number): string[] {
1332
+ return this.questionText.render(width);
1333
+ }
1334
+
1335
+ private buildFullContextLines(width: number): string[] {
1336
+ if (!this.contextComponent) return [];
1337
+ return this.contextComponent.render(width);
1338
+ }
1339
+
1340
+ private setContextIsCollapsible(value: boolean): void {
1341
+ if (this.contextIsCollapsible === value) return;
1342
+ this.contextIsCollapsible = value;
1343
+ if (!value) this.contextExpanded = false;
1344
+ this.updateHelpText();
1345
+ }
1346
+
1347
+ private getContextToggleKey(): string {
1348
+ const reserved = new Set(
1349
+ [this.shortcuts.overlayToggle, this.shortcuts.commentToggle]
1350
+ .filter((shortcut) => !shortcut.disabled)
1351
+ .map((shortcut) => shortcut.spec),
1352
+ );
1353
+ return CONTEXT_TOGGLE_KEYS.find((key) => !reserved.has(key)) ?? CONTEXT_TOGGLE_KEYS[0]!;
1354
+ }
1355
+
1356
+ private buildContextDisplayLines(fullContextLines: string[], width: number): string[] {
1357
+ if (fullContextLines.length === 0) return [];
1358
+ if (!this.contextIsCollapsible || this.contextExpanded) return fullContextLines;
1359
+ const label = `Context (${fullContextLines.length} lines) — ${this.getContextToggleKey()} expand`;
1360
+ return [truncateToWidth(this.theme.fg("dim", label), width, "")];
1361
+ }
1362
+
1363
+ private buildPromptLines(width: number, fullContextLines: string[]): string[] {
1364
+ const questionLines = this.buildQuestionLines(width);
1365
+ const contextLines = this.buildContextDisplayLines(fullContextLines, width);
1366
+ const contextSeparator = this.contextIsCollapsible && !this.contextExpanded ? [] : [""];
1367
+ return [
1368
+ ...questionLines,
1369
+ ...(contextLines.length > 0 ? [...contextSeparator, ...contextLines] : []),
1370
+ ];
1133
1371
  }
1134
1372
 
1135
- private countWrappedLines(text: string, width: number): number {
1136
- return Math.max(1, wrapTextWithAnsi(text, Math.max(10, width - 2)).length);
1373
+ private shouldCollapseContextForOverlay(
1374
+ questionRows: number,
1375
+ contextRows: number,
1376
+ bodyCapacity: number,
1377
+ helpRows: number,
1378
+ ): boolean {
1379
+ if (contextRows === 0) return false;
1380
+ const helpBudget = this.getOverlayHelpBudget(bodyCapacity, helpRows);
1381
+ const contentRows = Math.max(0, bodyCapacity - helpBudget);
1382
+ const separatorRows = contentRows >= 4 ? 1 : 0;
1383
+ const promptCapacity = Math.max(
1384
+ 0,
1385
+ contentRows - separatorRows - this.getMinimumModeRows(),
1386
+ );
1387
+ return questionRows + 1 + contextRows > promptCapacity;
1137
1388
  }
1138
1389
 
1139
- private countStaticLines(width: number): number {
1140
- const titleLines = 1;
1141
- const questionLines = this.countWrappedLines(this.question, width);
1142
- const contextLines = this.context ? 1 + this.countWrappedLines(this.context, width) : 0;
1143
- const helpLines = 1;
1144
- const borderLines = 2;
1145
- const spacerLines = this.context ? 6 : 5;
1146
- return borderLines + spacerLines + titleLines + questionLines + contextLines + helpLines;
1390
+ private getOverlayHelpBudget(bodyCapacity: number, renderedHelpRows: number): number {
1391
+ if (renderedHelpRows <= 0 || bodyCapacity <= 0) return 0;
1392
+ if (bodyCapacity >= 12) return Math.min(2, renderedHelpRows);
1393
+ return 1;
1394
+ }
1395
+
1396
+ private getMinimumModeRows(): number {
1397
+ if (this.mode === "freeform") return 5;
1398
+ if (this.mode === "comment") return 6;
1399
+ return 3;
1400
+ }
1401
+
1402
+ private getPreferredModeRows(): number {
1403
+ if (this.mode === "freeform") return 10;
1404
+ if (this.mode === "comment") return 11;
1405
+ return 8;
1406
+ }
1407
+
1408
+ private renderModeLines(width: number, budget: number): string[] {
1409
+ const safeBudget = Math.max(0, Math.floor(budget));
1410
+ if (safeBudget <= 0) return [];
1411
+
1412
+ if (this.mode === "select") {
1413
+ if (this.allowMultiple) {
1414
+ this.ensureMultiSelectList().setMaxVisibleRows(Math.max(1, safeBudget));
1415
+ } else {
1416
+ this.ensureSingleSelectList().setMaxVisibleRows(Math.max(1, safeBudget));
1417
+ }
1418
+ return this.limitLines(this.modeContainer.render(width), safeBudget, width, true);
1419
+ }
1420
+
1421
+ return this.renderEditorModeLines(width, safeBudget);
1422
+ }
1423
+
1424
+ private renderEditorModeLines(width: number, budget: number): string[] {
1425
+ const headerLines = this.buildEditorModeHeaderLines(width);
1426
+ const minimumEditorRows = Math.min(3, budget);
1427
+ const headerBudget = Math.max(0, budget - minimumEditorRows);
1428
+ const visibleHeaderLines = this.limitLines(headerLines, headerBudget, width, true);
1429
+ const editorBudget = Math.max(0, budget - visibleHeaderLines.length);
1430
+
1431
+ return [
1432
+ ...visibleHeaderLines,
1433
+ ...this.limitEditorLines(this.ensureEditor().render(width), editorBudget, width),
1434
+ ];
1435
+ }
1436
+
1437
+ private buildEditorModeHeaderLines(width: number): string[] {
1438
+ if (this.mode === "comment") {
1439
+ const selectedLabel = this.pendingSelections.length === 1 ? "Selected option:" : "Selected options:";
1440
+ return [
1441
+ ...new Text(this.theme.fg("accent", this.theme.bold(selectedLabel)), 1, 0).render(width),
1442
+ ...new Text(this.theme.fg("text", this.pendingSelections.join(", ")), 1, 0).render(width),
1443
+ "",
1444
+ ];
1445
+ }
1446
+
1447
+ return [
1448
+ ...new Text(this.theme.fg("accent", this.theme.bold("Custom response")), 1, 0).render(width),
1449
+ "",
1450
+ ];
1451
+ }
1452
+
1453
+ private limitEditorLines(lines: string[], budget: number, width: number): string[] {
1454
+ const safeBudget = Math.max(0, Math.floor(budget));
1455
+ if (safeBudget <= 0) return [];
1456
+ if (lines.length <= safeBudget) {
1457
+ return lines.map((line) => truncateToWidth(line, width, "", true));
1458
+ }
1459
+ if (safeBudget === 1) return [this.theme.fg("dim", "…")];
1460
+
1461
+ const topBorder = truncateToWidth(lines[0] ?? "", width, "", true);
1462
+ const bottomBorder = truncateToWidth(lines[lines.length - 1] ?? "", width, "", true);
1463
+ if (safeBudget === 2) return [topBorder, bottomBorder];
1464
+
1465
+ const contentLines = lines.slice(1, -1);
1466
+ const contentBudget = safeBudget - 2;
1467
+ // Locate the cursor row: prefer the zero-width CURSOR_MARKER the editor
1468
+ // emits while focused (the same mechanism pi-tui core uses for hardware
1469
+ // cursor placement), falling back to the inverse-video fake cursor.
1470
+ const cursorLineIndex = contentLines.findIndex(
1471
+ (line) => line.includes(CURSOR_MARKER) || line.includes("\x1b[7m"),
1472
+ );
1473
+ const maxStart = Math.max(0, contentLines.length - contentBudget);
1474
+ const start = cursorLineIndex >= 0
1475
+ ? Math.max(0, Math.min(cursorLineIndex - contentBudget + 1, maxStart))
1476
+ : maxStart;
1477
+ const visibleContentLines = contentLines.slice(start, start + contentBudget);
1478
+ const markedContentLines = this.applyPromptOverflowMarkers(
1479
+ visibleContentLines,
1480
+ width,
1481
+ start > 0,
1482
+ start + contentBudget < contentLines.length,
1483
+ );
1484
+
1485
+ return [topBorder, ...markedContentLines, bottomBorder];
1486
+ }
1487
+
1488
+ private renderPromptPane(promptLines: string[], budget: number, width: number): string[] {
1489
+ const viewportRows = Math.max(0, Math.floor(budget));
1490
+ this.promptViewportRows = viewportRows;
1491
+
1492
+ if (viewportRows <= 0 || promptLines.length === 0) {
1493
+ this.promptMaxScrollOffset = 0;
1494
+ this.promptScrollOffset = 0;
1495
+ return [];
1496
+ }
1497
+
1498
+ this.promptMaxScrollOffset = Math.max(0, promptLines.length - viewportRows);
1499
+ this.promptScrollOffset = Math.max(0, Math.min(this.promptScrollOffset, this.promptMaxScrollOffset));
1500
+
1501
+ const visibleLines = promptLines.slice(this.promptScrollOffset, this.promptScrollOffset + viewportRows);
1502
+ const hasHiddenAbove = this.promptScrollOffset > 0;
1503
+ const hasHiddenBelow = this.promptScrollOffset + viewportRows < promptLines.length;
1504
+ return this.applyPromptOverflowMarkers(visibleLines, width, hasHiddenAbove, hasHiddenBelow);
1505
+ }
1506
+
1507
+ private applyPromptOverflowMarkers(
1508
+ lines: string[],
1509
+ width: number,
1510
+ hasHiddenAbove: boolean,
1511
+ hasHiddenBelow: boolean,
1512
+ ): string[] {
1513
+ if (lines.length === 0) return lines;
1514
+
1515
+ const marked = [...lines];
1516
+ if (hasHiddenAbove && hasHiddenBelow && marked.length === 1) {
1517
+ marked[0] = this.addPromptOverflowMarker(marked[0] ?? "", "↕", width);
1518
+ return marked;
1519
+ }
1520
+
1521
+ if (hasHiddenAbove) {
1522
+ marked[0] = this.addPromptOverflowMarker(marked[0] ?? "", "↑", width);
1523
+ }
1524
+ if (hasHiddenBelow) {
1525
+ const lastIndex = marked.length - 1;
1526
+ marked[lastIndex] = this.addPromptOverflowMarker(marked[lastIndex] ?? "", "↓", width);
1527
+ }
1528
+ return marked;
1529
+ }
1530
+
1531
+ private addPromptOverflowMarker(line: string, marker: string, width: number): string {
1532
+ return truncateToWidth(`${this.theme.fg("dim", marker)} ${line}`, width, "", true);
1533
+ }
1534
+
1535
+ private limitLines(lines: string[], budget: number, width: number, showOverflowMarker: boolean): string[] {
1536
+ const safeBudget = Math.max(0, Math.floor(budget));
1537
+ if (safeBudget <= 0) return [];
1538
+ if (lines.length <= safeBudget) {
1539
+ return lines.map((line) => truncateToWidth(line, width, "", true));
1540
+ }
1541
+ if (!showOverflowMarker) {
1542
+ return lines.slice(0, safeBudget).map((line) => truncateToWidth(line, width, "", true));
1543
+ }
1544
+ if (safeBudget === 1) return [this.theme.fg("dim", "…")];
1545
+ return [
1546
+ ...lines.slice(0, safeBudget - 1).map((line) => truncateToWidth(line, width, "", true)),
1547
+ this.theme.fg("dim", "…"),
1548
+ ];
1549
+ }
1550
+
1551
+ private renderTopBorder(width: number): string {
1552
+ return new BoxBorderTop(
1553
+ (s: string) => this.theme.fg("accent", s),
1554
+ "ask_user",
1555
+ (s: string) => this.theme.fg("dim", this.theme.bold(s)),
1556
+ ).render(width)[0] ?? "";
1557
+ }
1558
+
1559
+ private renderBottomBorder(width: number): string {
1560
+ return new BoxBorderBottom(
1561
+ (s: string) => this.theme.fg("accent", s),
1562
+ `v${ASK_USER_VERSION}`,
1563
+ (s: string) => this.theme.fg("dim", s),
1564
+ ).render(width)[0] ?? "";
1565
+ }
1566
+
1567
+ private frameBodyLines(bodyLines: string[], width: number, innerWidth: number): string[] {
1568
+ const borderColor = (s: string) => this.theme.fg("accent", s);
1569
+ return [
1570
+ this.renderTopBorder(width),
1571
+ ...bodyLines.map((line) => {
1572
+ const padded = truncateToWidth(line, innerWidth, "", true);
1573
+ return `${borderColor(BOX_BORDER_LEFT)}${padded}${borderColor(BOX_BORDER_RIGHT)}`;
1574
+ }),
1575
+ this.renderBottomBorder(width),
1576
+ ];
1577
+ }
1578
+
1579
+ private frameRawLines(rawLines: string[], width: number, innerWidth: number): string[] {
1580
+ const borderColor = (s: string) => this.theme.fg("accent", s);
1581
+ return rawLines.map((line, index) => {
1582
+ if (index === 0) return this.renderTopBorder(width);
1583
+ if (index === rawLines.length - 1) return this.renderBottomBorder(width);
1584
+ const padded = truncateToWidth(line, innerWidth, "", true);
1585
+ return `${borderColor(BOX_BORDER_LEFT)}${padded}${borderColor(BOX_BORDER_RIGHT)}`;
1586
+ });
1147
1587
  }
1148
1588
 
1149
1589
  private updateStaticText(): void {
@@ -1169,9 +1609,19 @@ class AskComponent extends Container {
1169
1609
  const overlayHint = this.displayMode === "overlay" && !this.shortcuts.overlayToggle.disabled
1170
1610
  ? literalHint(theme, this.shortcuts.overlayToggle.spec, "hide")
1171
1611
  : null;
1612
+ const promptScrollHint = this.displayMode === "overlay" || this.contextExpanded
1613
+ ? literalHint(theme, "PgUp/PgDn", "prompt")
1614
+ : null;
1172
1615
  const commentHint = this.allowComment && !this.shortcuts.commentToggle.disabled
1173
1616
  ? literalHint(theme, this.shortcuts.commentToggle.spec, "toggle context")
1174
1617
  : null;
1618
+ const contextHint = this.contextIsCollapsible
1619
+ ? literalHint(
1620
+ theme,
1621
+ this.getContextToggleKey(),
1622
+ this.contextExpanded ? "collapse context" : "expand context",
1623
+ )
1624
+ : null;
1175
1625
  if (this.mode === "freeform" || this.mode === "comment") {
1176
1626
  const alternateCancelKeys = this.keybindings
1177
1627
  .getKeys("tui.select.cancel")
@@ -1194,6 +1644,8 @@ class AskComponent extends Container {
1194
1644
  literalHint(theme, "↑↓", "navigate"),
1195
1645
  literalHint(theme, "space", "toggle"),
1196
1646
  commentHint,
1647
+ contextHint,
1648
+ promptScrollHint,
1197
1649
  overlayHint,
1198
1650
  keybindingHint(theme, this.keybindings, "tui.select.confirm", "submit"),
1199
1651
  keybindingHint(theme, this.keybindings, "tui.select.cancel", "cancel"),
@@ -1207,9 +1659,11 @@ class AskComponent extends Container {
1207
1659
  .filter((key) => key !== "escape" && key !== "esc");
1208
1660
  const hints = [
1209
1661
  literalHint(theme, "type", "filter"),
1662
+ commentHint,
1663
+ contextHint,
1664
+ promptScrollHint,
1210
1665
  keybindingHint(theme, this.keybindings, "tui.editor.deleteCharBackward", "erase"),
1211
1666
  literalHint(theme, "↑↓", "navigate"),
1212
- commentHint,
1213
1667
  overlayHint,
1214
1668
  keybindingHint(theme, this.keybindings, "tui.select.confirm", "select"),
1215
1669
  literalHint(theme, "esc", "clear/cancel"),
@@ -1231,6 +1685,7 @@ class AskComponent extends Container {
1231
1685
  this.allowFreeform,
1232
1686
  this.allowComment,
1233
1687
  this.theme,
1688
+ this.singleSelectLayout,
1234
1689
  this.keybindings,
1235
1690
  this.shortcuts.commentToggle,
1236
1691
  );
@@ -1380,7 +1835,67 @@ class AskComponent extends Container {
1380
1835
  this.tui.requestRender();
1381
1836
  }
1382
1837
 
1838
+ private toggleContext(): boolean {
1839
+ if (this.mode !== "select" || !this.contextIsCollapsible) return false;
1840
+ this.contextExpanded = !this.contextExpanded;
1841
+ this.promptScrollOffset = 0;
1842
+ this.invalidate();
1843
+ this.tui.requestRender();
1844
+ return true;
1845
+ }
1846
+
1847
+ private setPromptScrollOffset(nextOffset: number): boolean {
1848
+ if (this.displayMode !== "overlay" && !this.contextExpanded) return false;
1849
+ if (this.promptMaxScrollOffset <= 0) return false;
1850
+ const clamped = Math.max(0, Math.min(Math.floor(nextOffset), this.promptMaxScrollOffset));
1851
+ const changed = clamped !== this.promptScrollOffset;
1852
+ this.promptScrollOffset = clamped;
1853
+ return changed;
1854
+ }
1855
+
1856
+ private handlePromptScrollInput(data: string): boolean {
1857
+ if (this.displayMode !== "overlay" && !this.contextExpanded) return false;
1858
+ if (this.promptMaxScrollOffset <= 0) return false;
1859
+ // Prompt scrolling is select-mode only: in freeform/comment modes the
1860
+ // editor owns PageUp/PageDown (tui.editor.pageUp/pageDown) for paging
1861
+ // through long input, so intercepting them here would steal editor keys.
1862
+ if (this.mode !== "select") return false;
1863
+
1864
+ const pageRows = Math.max(1, this.promptViewportRows - 1);
1865
+ const halfPageRows = Math.max(1, Math.floor(this.promptViewportRows / 2));
1866
+ let handled = false;
1867
+
1868
+ if (matchesKey(data, PROMPT_SCROLL_PAGE_UP_KEY)) {
1869
+ handled = true;
1870
+ this.setPromptScrollOffset(this.promptScrollOffset - pageRows);
1871
+ } else if (matchesKey(data, PROMPT_SCROLL_PAGE_DOWN_KEY)) {
1872
+ handled = true;
1873
+ this.setPromptScrollOffset(this.promptScrollOffset + pageRows);
1874
+ } else if (matchesKey(data, PROMPT_SCROLL_HOME_KEY)) {
1875
+ handled = true;
1876
+ this.setPromptScrollOffset(0);
1877
+ } else if (matchesKey(data, PROMPT_SCROLL_END_KEY)) {
1878
+ handled = true;
1879
+ this.setPromptScrollOffset(this.promptMaxScrollOffset);
1880
+ } else if (matchesKey(data, PROMPT_SCROLL_HALF_PAGE_UP_KEY)) {
1881
+ handled = true;
1882
+ this.setPromptScrollOffset(this.promptScrollOffset - halfPageRows);
1883
+ } else if (matchesKey(data, PROMPT_SCROLL_HALF_PAGE_DOWN_KEY)) {
1884
+ handled = true;
1885
+ this.setPromptScrollOffset(this.promptScrollOffset + halfPageRows);
1886
+ }
1887
+
1888
+ return handled;
1889
+ }
1890
+
1383
1891
  handleInput(data: string): void {
1892
+ if (matchesKey(data, this.getContextToggleKey() as any) && this.toggleContext()) {
1893
+ return;
1894
+ }
1895
+ if (this.handlePromptScrollInput(data)) {
1896
+ this.tui.requestRender();
1897
+ return;
1898
+ }
1384
1899
  if (this.mode === "freeform" || this.mode === "comment") {
1385
1900
  if (matchesKey(data, Key.escape)) {
1386
1901
  this.showSelectMode();
@@ -1487,6 +2002,10 @@ export default function(pi: ExtensionAPI) {
1487
2002
  "Ask exactly one focused question per ask_user call.",
1488
2003
  "Do not combine multiple numbered, multipart, or unrelated questions into one ask_user prompt.",
1489
2004
  ],
2005
+ // Block other tool calls in the same assistant turn until the user answers,
2006
+ // so the model can't batch ask_user with bash/edit/write and let those run
2007
+ // (potentially with side effects) before the user sees the prompt.
2008
+ executionMode: "sequential",
1490
2009
  parameters: Type.Object({
1491
2010
  question: Type.String({ description: "The question to ask the user" }),
1492
2011
  context: Type.Optional(
@@ -1496,15 +2015,17 @@ export default function(pi: ExtensionAPI) {
1496
2015
  ),
1497
2016
  options: Type.Optional(
1498
2017
  Type.Array(
1499
- Type.Union([
1500
- Type.String({ description: "Short title for this option" }),
1501
- Type.Object({
1502
- title: Type.String({ description: "Short title for this option" }),
1503
- description: Type.Optional(
1504
- Type.String({ description: "Longer description explaining this option" }),
1505
- ),
1506
- }),
1507
- ]),
2018
+ // Flat object shape: union item schemas get stripped or rejected
2019
+ // by several providers/proxies (Google function calling,
2020
+ // Codex-style backends, cmux), leaving the model to guess the shape
2021
+ // and produce empty options. Plain strings are still accepted at
2022
+ // runtime for older transcripts. See issue #22.
2023
+ Type.Object({
2024
+ title: Type.String({ description: "Short title for this option" }),
2025
+ description: Type.Optional(
2026
+ Type.String({ description: "Longer description explaining this option" }),
2027
+ ),
2028
+ }),
1508
2029
  { description: "List of options for the user to choose from" },
1509
2030
  ),
1510
2031
  ),
@@ -1515,13 +2036,18 @@ export default function(pi: ExtensionAPI) {
1515
2036
  Type.Boolean({ description: "Add a freeform text option. Default: true" }),
1516
2037
  ),
1517
2038
  allowComment: Type.Optional(
1518
- Type.Boolean({ description: "Collect an optional comment after selecting one or more options. Default: false" }),
2039
+ Type.Boolean({ description: "Collect an optional comment after selecting one or more options. Default: PI_ASK_USER_ALLOW_COMMENT env var if set, otherwise false." }),
1519
2040
  ),
1520
2041
  displayMode: Type.Optional(
1521
2042
  StringEnum(["overlay", "inline"] as const, {
1522
2043
  description: "UI rendering mode. 'overlay' shows a centered modal, 'inline' renders in-place. Default: PI_ASK_USER_DISPLAY_MODE env var if set, otherwise 'overlay'. Omit to respect the user's configured preference.",
1523
2044
  }),
1524
2045
  ),
2046
+ singleSelectLayout: Type.Optional(
2047
+ StringEnum(["auto", "list"] as const, {
2048
+ description: "Single-select layout. 'auto' uses a details pane on wide terminals; 'list' always keeps descriptions below options. Default: PI_ASK_USER_SINGLE_SELECT_LAYOUT if set, otherwise 'auto'.",
2049
+ }),
2050
+ ),
1525
2051
  overlayToggleKey: Type.Optional(
1526
2052
  Type.String({
1527
2053
  description:
@@ -1553,16 +2079,23 @@ export default function(pi: ExtensionAPI) {
1553
2079
  options: rawOptions = [],
1554
2080
  allowMultiple = false,
1555
2081
  allowFreeform = true,
1556
- allowComment = false,
2082
+ allowComment: requestedAllowComment,
1557
2083
  displayMode,
2084
+ singleSelectLayout,
1558
2085
  overlayToggleKey,
1559
2086
  commentToggleKey,
1560
2087
  timeout,
1561
2088
  } = params as AskParams;
1562
- const envMode = process.env.PI_ASK_USER_DISPLAY_MODE;
2089
+ const envMode = process.env.PI_ASK_USER_DISPLAY_MODE?.trim().toLowerCase();
1563
2090
  const envDisplayMode: AskDisplayMode | undefined =
1564
2091
  envMode === "overlay" || envMode === "inline" ? envMode : undefined;
1565
2092
  const effectiveDisplayMode: AskDisplayMode = displayMode ?? envDisplayMode ?? "overlay";
2093
+ const envSingleSelectLayout = process.env.PI_ASK_USER_SINGLE_SELECT_LAYOUT?.trim().toLowerCase();
2094
+ const effectiveSingleSelectLayout: AskSingleSelectLayout = singleSelectLayout
2095
+ ?? (envSingleSelectLayout === "list" ? "list" : "auto");
2096
+ const allowComment = requestedAllowComment
2097
+ ?? parseBooleanPreference(process.env.PI_ASK_USER_ALLOW_COMMENT)
2098
+ ?? false;
1566
2099
  const shortcuts: ResolvedAskShortcuts = {
1567
2100
  overlayToggle: resolveShortcut(
1568
2101
  overlayToggleKey,
@@ -1575,9 +2108,25 @@ export default function(pi: ExtensionAPI) {
1575
2108
  DEFAULT_COMMENT_TOGGLE_KEY,
1576
2109
  ),
1577
2110
  };
1578
- const options = normalizeOptions(rawOptions);
2111
+ const options = rawOptions.map(coerceOption).filter((option): option is QuestionOption => option !== null);
1579
2112
  const normalizedContext = context?.trim() || undefined;
1580
2113
 
2114
+ if (rawOptions.length > 0 && options.length === 0) {
2115
+ return {
2116
+ content: [
2117
+ {
2118
+ type: "text",
2119
+ text:
2120
+ `All ${rawOptions.length} option(s) were malformed, so nothing could be shown to the user. `
2121
+ + `Each option must be a plain string or an object like { "title": "Short label", "description": "Optional detail" }. `
2122
+ + `Call ask_user again with corrected options.`,
2123
+ },
2124
+ ],
2125
+ isError: true,
2126
+ details: { error: "Malformed options: no entry had a usable title" },
2127
+ };
2128
+ }
2129
+
1581
2130
  if (!ctx.hasUI || !ctx.ui) {
1582
2131
  const optionText = options.length > 0 ? `\n\nOptions:\n${formatOptionsForMessage(options)}` : "";
1583
2132
  const freeformHint = allowFreeform ? "\n\nYou can also answer freely." : "";
@@ -1597,7 +2146,13 @@ export default function(pi: ExtensionAPI) {
1597
2146
 
1598
2147
  if (options.length === 0) {
1599
2148
  const prompt = normalizedContext ? `${question}\n\nContext:\n${normalizedContext}` : question;
1600
- const answer = await ctx.ui.input(prompt, "Type your answer...", timeout ? { timeout } : undefined);
2149
+ pi.events.emit("herdr:blocked", { active: true, label: "Waiting for user response" });
2150
+ let answer: string | undefined;
2151
+ try {
2152
+ answer = await ctx.ui.input(prompt, "Type your answer...", timeout ? { timeout } : undefined);
2153
+ } finally {
2154
+ pi.events.emit("herdr:blocked", { active: false });
2155
+ }
1601
2156
  const response = createFreeformResponse(answer);
1602
2157
 
1603
2158
  if (!response) {
@@ -1623,6 +2178,7 @@ export default function(pi: ExtensionAPI) {
1623
2178
  let overlayHandle: OverlayHandle | undefined;
1624
2179
  let removeOverlayInputListener: (() => void) | undefined;
1625
2180
  let hasAnnouncedHide = false;
2181
+ pi.events.emit("herdr:blocked", { active: true, label: "Waiting for user response" });
1626
2182
  try {
1627
2183
  const customFactory = (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: AskUIResult | null) => void) => {
1628
2184
  if (signal) {
@@ -1642,6 +2198,7 @@ export default function(pi: ExtensionAPI) {
1642
2198
  allowFreeform,
1643
2199
  allowComment,
1644
2200
  effectiveDisplayMode,
2201
+ effectiveSingleSelectLayout,
1645
2202
  tui,
1646
2203
  theme,
1647
2204
  keybindings,
@@ -1695,6 +2252,7 @@ export default function(pi: ExtensionAPI) {
1695
2252
  };
1696
2253
  } finally {
1697
2254
  removeOverlayInputListener?.();
2255
+ pi.events.emit("herdr:blocked", { active: false });
1698
2256
  }
1699
2257
 
1700
2258
  if (result === null) {
@@ -1728,9 +2286,7 @@ export default function(pi: ExtensionAPI) {
1728
2286
  let text = theme.fg("toolTitle", theme.bold("ask_user "));
1729
2287
  text += theme.fg("muted", question);
1730
2288
  if (rawOptions.length > 0) {
1731
- const labels = rawOptions.map((o: unknown) =>
1732
- typeof o === "string" ? o : (o as QuestionOption)?.title ?? "",
1733
- );
2289
+ const labels = rawOptions.map((o: unknown) => coerceOption(o)?.title ?? "<invalid>");
1734
2290
  text += "\n" + theme.fg("dim", ` ${rawOptions.length} option(s): ${labels.join(", ")}`);
1735
2291
  }
1736
2292
  if (args.allowMultiple) {
@@ -1751,8 +2307,7 @@ export default function(pi: ExtensionAPI) {
1751
2307
 
1752
2308
  if (options.isPartial) {
1753
2309
  const waitingText = result.content
1754
- ?.filter((part: { type?: string; text?: string }) => part?.type === "text")
1755
- .map((part: { text?: string }) => part.text ?? "")
2310
+ ?.map((part) => part.type === "text" ? part.text : "")
1756
2311
  .join("\n")
1757
2312
  .trim() || "Waiting for user input...";
1758
2313
  return new Text(theme.fg("muted", waitingText), 0, 0);