@pentoshi/clai 3.5.1 → 3.7.2

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 (369) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/compaction-summary.d.ts +17 -0
  3. package/dist/agent/compaction-summary.js +64 -0
  4. package/dist/agent/compaction-summary.js.map +1 -0
  5. package/dist/agent/confirm-port.d.ts +3 -1
  6. package/dist/agent/confirm-port.js +5 -1
  7. package/dist/agent/confirm-port.js.map +1 -1
  8. package/dist/agent/context-manager.js +53 -24
  9. package/dist/agent/context-manager.js.map +1 -1
  10. package/dist/agent/events.d.ts +6 -0
  11. package/dist/agent/evidence-governor.d.ts +37 -0
  12. package/dist/agent/evidence-governor.js +70 -0
  13. package/dist/agent/evidence-governor.js.map +1 -0
  14. package/dist/agent/loop-guard.d.ts +29 -9
  15. package/dist/agent/loop-guard.js +117 -26
  16. package/dist/agent/loop-guard.js.map +1 -1
  17. package/dist/agent/must-continue.d.ts +56 -0
  18. package/dist/agent/must-continue.js +240 -0
  19. package/dist/agent/must-continue.js.map +1 -0
  20. package/dist/agent/outcomes.d.ts +101 -0
  21. package/dist/agent/outcomes.js +359 -0
  22. package/dist/agent/outcomes.js.map +1 -0
  23. package/dist/agent/plan-decision.d.ts +33 -0
  24. package/dist/agent/plan-decision.js +104 -0
  25. package/dist/agent/plan-decision.js.map +1 -0
  26. package/dist/agent/plan-tool.d.ts +34 -0
  27. package/dist/agent/plan-tool.js +594 -76
  28. package/dist/agent/plan-tool.js.map +1 -1
  29. package/dist/agent/project-root.d.ts +33 -0
  30. package/dist/agent/project-root.js +161 -0
  31. package/dist/agent/project-root.js.map +1 -0
  32. package/dist/agent/prompt-composer.d.ts +21 -0
  33. package/dist/agent/prompt-composer.js +46 -0
  34. package/dist/agent/prompt-composer.js.map +1 -0
  35. package/dist/agent/runner.d.ts +11 -1
  36. package/dist/agent/runner.js +1915 -886
  37. package/dist/agent/runner.js.map +1 -1
  38. package/dist/agent/scope-context.d.ts +3 -0
  39. package/dist/agent/scope-context.js +24 -0
  40. package/dist/agent/scope-context.js.map +1 -0
  41. package/dist/agent/scratch-write.d.ts +4 -0
  42. package/dist/agent/scratch-write.js +54 -0
  43. package/dist/agent/scratch-write.js.map +1 -0
  44. package/dist/agent/session-policy.d.ts +7 -0
  45. package/dist/agent/session-policy.js +61 -0
  46. package/dist/agent/session-policy.js.map +1 -1
  47. package/dist/agent/session-state.d.ts +41 -0
  48. package/dist/agent/session-state.js +107 -0
  49. package/dist/agent/session-state.js.map +1 -0
  50. package/dist/agent/step-budget.d.ts +14 -0
  51. package/dist/agent/step-budget.js +26 -0
  52. package/dist/agent/step-budget.js.map +1 -0
  53. package/dist/agent/task-analyzer.d.ts +12 -3
  54. package/dist/agent/task-analyzer.js +263 -23
  55. package/dist/agent/task-analyzer.js.map +1 -1
  56. package/dist/agent/task-evidence.d.ts +173 -0
  57. package/dist/agent/task-evidence.js +802 -0
  58. package/dist/agent/task-evidence.js.map +1 -0
  59. package/dist/agent/task-plan.d.ts +57 -0
  60. package/dist/agent/task-plan.js +147 -1
  61. package/dist/agent/task-plan.js.map +1 -1
  62. package/dist/agent/tool-call-parser.d.ts +19 -11
  63. package/dist/agent/tool-call-parser.js +96 -71
  64. package/dist/agent/tool-call-parser.js.map +1 -1
  65. package/dist/agent/tool-history.d.ts +34 -0
  66. package/dist/agent/tool-history.js +200 -0
  67. package/dist/agent/tool-history.js.map +1 -0
  68. package/dist/agent/tool-output-formatting.d.ts +13 -1
  69. package/dist/agent/tool-output-formatting.js +75 -22
  70. package/dist/agent/tool-output-formatting.js.map +1 -1
  71. package/dist/agent/turn-outcome.d.ts +11 -0
  72. package/dist/agent/turn-outcome.js +17 -0
  73. package/dist/agent/turn-outcome.js.map +1 -0
  74. package/dist/agent/turn-state.d.ts +11 -0
  75. package/dist/agent/turn-state.js +28 -0
  76. package/dist/agent/turn-state.js.map +1 -0
  77. package/dist/agent/workspace-orient.d.ts +75 -0
  78. package/dist/agent/workspace-orient.js +509 -0
  79. package/dist/agent/workspace-orient.js.map +1 -0
  80. package/dist/app/adapters/agent-event-adapter.d.ts +2 -13
  81. package/dist/app/adapters/agent-event-adapter.js +63 -25
  82. package/dist/app/adapters/agent-event-adapter.js.map +1 -1
  83. package/dist/app/adapters/current-agent-adapter.d.ts +0 -5
  84. package/dist/app/adapters/current-agent-adapter.js +4 -7
  85. package/dist/app/adapters/current-agent-adapter.js.map +1 -1
  86. package/dist/app/adapters/current-jobs-adapter.js +1 -0
  87. package/dist/app/adapters/current-jobs-adapter.js.map +1 -1
  88. package/dist/app/adapters/current-terminal-adapter.d.ts +0 -7
  89. package/dist/app/adapters/current-terminal-adapter.js +0 -7
  90. package/dist/app/adapters/current-terminal-adapter.js.map +1 -1
  91. package/dist/app/adapters/current-updates-adapter.d.ts +0 -5
  92. package/dist/app/adapters/current-updates-adapter.js +0 -5
  93. package/dist/app/adapters/current-updates-adapter.js.map +1 -1
  94. package/dist/app/adapters/in-memory-clipboard-adapter.d.ts +0 -5
  95. package/dist/app/adapters/in-memory-clipboard-adapter.js +0 -5
  96. package/dist/app/adapters/in-memory-clipboard-adapter.js.map +1 -1
  97. package/dist/app/commands/command.d.ts +0 -5
  98. package/dist/app/commands/command.js.map +1 -1
  99. package/dist/app/commands/registry.d.ts +0 -14
  100. package/dist/app/commands/registry.js +0 -20
  101. package/dist/app/commands/registry.js.map +1 -1
  102. package/dist/app/controllers/disposable.d.ts +0 -5
  103. package/dist/app/controllers/disposable.js +0 -5
  104. package/dist/app/controllers/disposable.js.map +1 -1
  105. package/dist/app/controllers/job-controller.d.ts +1 -5
  106. package/dist/app/controllers/job-controller.js +0 -4
  107. package/dist/app/controllers/job-controller.js.map +1 -1
  108. package/dist/app/controllers/plan-controller.d.ts +5 -8
  109. package/dist/app/controllers/plan-controller.js +30 -12
  110. package/dist/app/controllers/plan-controller.js.map +1 -1
  111. package/dist/app/controllers/session-controller.d.ts +17 -32
  112. package/dist/app/controllers/session-controller.js +60 -35
  113. package/dist/app/controllers/session-controller.js.map +1 -1
  114. package/dist/app/controllers/turn-controller.d.ts +2 -6
  115. package/dist/app/controllers/turn-controller.js +8 -8
  116. package/dist/app/controllers/turn-controller.js.map +1 -1
  117. package/dist/app/events/app-event.d.ts +4 -7
  118. package/dist/app/events/app-event.js +0 -6
  119. package/dist/app/events/app-event.js.map +1 -1
  120. package/dist/app/events/event-buffer.d.ts +6 -17
  121. package/dist/app/events/event-buffer.js +27 -24
  122. package/dist/app/events/event-buffer.js.map +1 -1
  123. package/dist/app/events/sequencer.d.ts +0 -9
  124. package/dist/app/events/sequencer.js +0 -4
  125. package/dist/app/events/sequencer.js.map +1 -1
  126. package/dist/app/ports/agent-port.d.ts +13 -3
  127. package/dist/app/ports/clipboard-port.d.ts +0 -5
  128. package/dist/app/ports/confirm-port.d.ts +0 -7
  129. package/dist/app/ports/jobs-port.d.ts +2 -5
  130. package/dist/app/ports/persistence-port.d.ts +0 -4
  131. package/dist/app/ports/secret-port.d.ts +0 -5
  132. package/dist/app/ports/terminal-port.d.ts +0 -6
  133. package/dist/app/ports/updates-port.d.ts +0 -4
  134. package/dist/attachments/service.d.ts +29 -0
  135. package/dist/attachments/service.js +47 -0
  136. package/dist/attachments/service.js.map +1 -0
  137. package/dist/commands/doctor.js +3 -0
  138. package/dist/commands/doctor.js.map +1 -1
  139. package/dist/commands/providers.js +0 -3
  140. package/dist/commands/providers.js.map +1 -1
  141. package/dist/commands/search-providers.d.ts +0 -33
  142. package/dist/commands/search-providers.js +0 -33
  143. package/dist/commands/search-providers.js.map +1 -1
  144. package/dist/commands/update.js +1 -9
  145. package/dist/commands/update.js.map +1 -1
  146. package/dist/index.js +22 -42
  147. package/dist/index.js.map +1 -1
  148. package/dist/llm/adapters/anthropic-tools.d.ts +99 -0
  149. package/dist/llm/adapters/anthropic-tools.js +225 -0
  150. package/dist/llm/adapters/anthropic-tools.js.map +1 -0
  151. package/dist/llm/adapters/gemini-tools.d.ts +54 -0
  152. package/dist/llm/adapters/gemini-tools.js +139 -0
  153. package/dist/llm/adapters/gemini-tools.js.map +1 -0
  154. package/dist/llm/adapters/ollama-tools.d.ts +18 -0
  155. package/dist/llm/adapters/ollama-tools.js +58 -0
  156. package/dist/llm/adapters/ollama-tools.js.map +1 -0
  157. package/dist/llm/adapters/openai-tools.d.ts +39 -0
  158. package/dist/llm/adapters/openai-tools.js +71 -0
  159. package/dist/llm/adapters/openai-tools.js.map +1 -0
  160. package/dist/llm/agentrouter.js +23 -4
  161. package/dist/llm/agentrouter.js.map +1 -1
  162. package/dist/llm/anthropic.js +93 -92
  163. package/dist/llm/anthropic.js.map +1 -1
  164. package/dist/llm/aws-mantle.js +93 -56
  165. package/dist/llm/aws-mantle.js.map +1 -1
  166. package/dist/llm/bynara.js +23 -4
  167. package/dist/llm/bynara.js.map +1 -1
  168. package/dist/llm/capabilities.d.ts +13 -6
  169. package/dist/llm/capabilities.js +113 -13
  170. package/dist/llm/capabilities.js.map +1 -1
  171. package/dist/llm/gemini.js +63 -48
  172. package/dist/llm/gemini.js.map +1 -1
  173. package/dist/llm/groq.js +23 -10
  174. package/dist/llm/groq.js.map +1 -1
  175. package/dist/llm/http.d.ts +22 -34
  176. package/dist/llm/http.js +97 -69
  177. package/dist/llm/http.js.map +1 -1
  178. package/dist/llm/kimchi.js +23 -4
  179. package/dist/llm/kimchi.js.map +1 -1
  180. package/dist/llm/nvidia.js +23 -4
  181. package/dist/llm/nvidia.js.map +1 -1
  182. package/dist/llm/ollama.js +49 -31
  183. package/dist/llm/ollama.js.map +1 -1
  184. package/dist/llm/openai.js +23 -4
  185. package/dist/llm/openai.js.map +1 -1
  186. package/dist/llm/openrouter.js +23 -4
  187. package/dist/llm/openrouter.js.map +1 -1
  188. package/dist/llm/qwen-cloud.js +23 -4
  189. package/dist/llm/qwen-cloud.js.map +1 -1
  190. package/dist/llm/router.d.ts +0 -6
  191. package/dist/llm/router.js +48 -21
  192. package/dist/llm/router.js.map +1 -1
  193. package/dist/llm/tool-protocol.d.ts +67 -0
  194. package/dist/llm/tool-protocol.js +278 -0
  195. package/dist/llm/tool-protocol.js.map +1 -0
  196. package/dist/modes/agent.d.ts +2 -1
  197. package/dist/modes/agent.js +4 -2
  198. package/dist/modes/agent.js.map +1 -1
  199. package/dist/modes/ask.d.ts +0 -18
  200. package/dist/modes/ask.js +71 -66
  201. package/dist/modes/ask.js.map +1 -1
  202. package/dist/os/cwd.d.ts +0 -21
  203. package/dist/os/cwd.js +0 -24
  204. package/dist/os/cwd.js.map +1 -1
  205. package/dist/os/pkgmgr.js +0 -6
  206. package/dist/os/pkgmgr.js.map +1 -1
  207. package/dist/prompts/index.d.ts +17 -21
  208. package/dist/prompts/index.js +131 -259
  209. package/dist/prompts/index.js.map +1 -1
  210. package/dist/prompts/system.agent.md +242 -0
  211. package/dist/prompts/system.ask.md +56 -0
  212. package/dist/repl/prompt-line.js +0 -36
  213. package/dist/repl/prompt-line.js.map +1 -1
  214. package/dist/repl/slash-commands.d.ts +0 -9
  215. package/dist/repl/slash-commands.js +2 -23
  216. package/dist/repl/slash-commands.js.map +1 -1
  217. package/dist/repl.d.ts +5 -0
  218. package/dist/repl.js +176 -55
  219. package/dist/repl.js.map +1 -1
  220. package/dist/safety/classifier.js +17 -9
  221. package/dist/safety/classifier.js.map +1 -1
  222. package/dist/safety/engagement-policy.d.ts +46 -0
  223. package/dist/safety/engagement-policy.js +198 -0
  224. package/dist/safety/engagement-policy.js.map +1 -0
  225. package/dist/store/config.d.ts +7 -0
  226. package/dist/store/config.js +1 -0
  227. package/dist/store/config.js.map +1 -1
  228. package/dist/store/engagement.d.ts +115 -0
  229. package/dist/store/engagement.js +278 -0
  230. package/dist/store/engagement.js.map +1 -0
  231. package/dist/store/logs.d.ts +5 -0
  232. package/dist/store/logs.js +52 -2
  233. package/dist/store/logs.js.map +1 -1
  234. package/dist/store/plan.d.ts +59 -5
  235. package/dist/store/plan.js +182 -8
  236. package/dist/store/plan.js.map +1 -1
  237. package/dist/store/scope.d.ts +4 -1
  238. package/dist/store/scope.js +2 -2
  239. package/dist/store/scope.js.map +1 -1
  240. package/dist/tools/capabilities.d.ts +2 -0
  241. package/dist/tools/capabilities.js +101 -6
  242. package/dist/tools/capabilities.js.map +1 -1
  243. package/dist/tools/command-intent.d.ts +1 -0
  244. package/dist/tools/command-intent.js +31 -0
  245. package/dist/tools/command-intent.js.map +1 -1
  246. package/dist/tools/definitions.d.ts +20 -0
  247. package/dist/tools/definitions.js +578 -0
  248. package/dist/tools/definitions.js.map +1 -0
  249. package/dist/tools/elevated-shell.d.ts +60 -0
  250. package/dist/tools/elevated-shell.js +233 -0
  251. package/dist/tools/elevated-shell.js.map +1 -0
  252. package/dist/tools/file-diff.d.ts +125 -0
  253. package/dist/tools/file-diff.js +495 -0
  254. package/dist/tools/file-diff.js.map +1 -0
  255. package/dist/tools/fs.d.ts +11 -13
  256. package/dist/tools/fs.js +280 -80
  257. package/dist/tools/fs.js.map +1 -1
  258. package/dist/tools/http.d.ts +15 -0
  259. package/dist/tools/http.js +202 -61
  260. package/dist/tools/http.js.map +1 -1
  261. package/dist/tools/jobs.d.ts +71 -10
  262. package/dist/tools/jobs.js +403 -124
  263. package/dist/tools/jobs.js.map +1 -1
  264. package/dist/tools/net-ping-sweep.js +69 -16
  265. package/dist/tools/net-ping-sweep.js.map +1 -1
  266. package/dist/tools/nmap-runner.d.ts +19 -7
  267. package/dist/tools/nmap-runner.js +182 -80
  268. package/dist/tools/nmap-runner.js.map +1 -1
  269. package/dist/tools/pentest-workflows.d.ts +8 -0
  270. package/dist/tools/pentest-workflows.js +71 -0
  271. package/dist/tools/pentest-workflows.js.map +1 -0
  272. package/dist/tools/registry.d.ts +9 -0
  273. package/dist/tools/registry.js +272 -63
  274. package/dist/tools/registry.js.map +1 -1
  275. package/dist/tools/shell.d.ts +3 -0
  276. package/dist/tools/shell.js +35 -13
  277. package/dist/tools/shell.js.map +1 -1
  278. package/dist/tools/tool-types.d.ts +11 -0
  279. package/dist/tools/validate.d.ts +11 -0
  280. package/dist/tools/validate.js +53 -0
  281. package/dist/tools/validate.js.map +1 -1
  282. package/dist/tools/web/search.js +48 -4
  283. package/dist/tools/web/search.js.map +1 -1
  284. package/dist/tui-v2/app/App.js +25 -39
  285. package/dist/tui-v2/app/App.js.map +1 -1
  286. package/dist/tui-v2/app/command-handlers.js +20 -1
  287. package/dist/tui-v2/app/command-handlers.js.map +1 -1
  288. package/dist/tui-v2/app/commands/picker-commands.js +3 -0
  289. package/dist/tui-v2/app/commands/picker-commands.js.map +1 -1
  290. package/dist/tui-v2/app/commands/session-commands.js +5 -0
  291. package/dist/tui-v2/app/commands/session-commands.js.map +1 -1
  292. package/dist/tui-v2/app/plan-lifecycle.d.ts +25 -3
  293. package/dist/tui-v2/app/plan-lifecycle.js +87 -24
  294. package/dist/tui-v2/app/plan-lifecycle.js.map +1 -1
  295. package/dist/tui-v2/bootstrap/patch-opentui-text.d.ts +6 -0
  296. package/dist/tui-v2/bootstrap/patch-opentui-text.js +53 -0
  297. package/dist/tui-v2/bootstrap/patch-opentui-text.js.map +1 -0
  298. package/dist/tui-v2/bootstrap/start-tui-v2.js +7 -0
  299. package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
  300. package/dist/tui-v2/components/jobs/jobs-panel.js +23 -14
  301. package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -1
  302. package/dist/tui-v2/components/modal/confirm-modal.d.ts +1 -1
  303. package/dist/tui-v2/components/modal/confirm-modal.js +18 -7
  304. package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -1
  305. package/dist/tui-v2/components/overlay/overlay-host.js +1 -1
  306. package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -1
  307. package/dist/tui-v2/components/pager/pager.d.ts +6 -0
  308. package/dist/tui-v2/components/pager/pager.js +313 -67
  309. package/dist/tui-v2/components/pager/pager.js.map +1 -1
  310. package/dist/tui-v2/components/status/status-line.d.ts +9 -0
  311. package/dist/tui-v2/components/status/status-line.js +17 -3
  312. package/dist/tui-v2/components/status/status-line.js.map +1 -1
  313. package/dist/tui-v2/components/transcript/assistant-message.js +1 -1
  314. package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -1
  315. package/dist/tui-v2/components/transcript/compacted-row.js +1 -1
  316. package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -1
  317. package/dist/tui-v2/components/transcript/tool-card.d.ts +9 -1
  318. package/dist/tui-v2/components/transcript/tool-card.js +115 -10
  319. package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
  320. package/dist/tui-v2/components/transcript/transcript-row.js +2 -2
  321. package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -1
  322. package/dist/tui-v2/composer/composer-editor.js +16 -0
  323. package/dist/tui-v2/composer/composer-editor.js.map +1 -1
  324. package/dist/tui-v2/controllers/overlay-controller.d.ts +16 -2
  325. package/dist/tui-v2/controllers/overlay-controller.js +92 -12
  326. package/dist/tui-v2/controllers/overlay-controller.js.map +1 -1
  327. package/dist/tui-v2/rendering/artifact-pager-source.d.ts +19 -0
  328. package/dist/tui-v2/rendering/artifact-pager-source.js +103 -0
  329. package/dist/tui-v2/rendering/artifact-pager-source.js.map +1 -0
  330. package/dist/tui-v2/rendering/file-diff-view.d.ts +63 -0
  331. package/dist/tui-v2/rendering/file-diff-view.js +263 -0
  332. package/dist/tui-v2/rendering/file-diff-view.js.map +1 -0
  333. package/dist/tui-v2/rendering/open-tool-output.d.ts +9 -1
  334. package/dist/tui-v2/rendering/open-tool-output.js +65 -12
  335. package/dist/tui-v2/rendering/open-tool-output.js.map +1 -1
  336. package/dist/tui-v2/rendering/pager-chrome.d.ts +12 -0
  337. package/dist/tui-v2/rendering/pager-chrome.js +56 -0
  338. package/dist/tui-v2/rendering/pager-chrome.js.map +1 -0
  339. package/dist/tui-v2/rendering/plan-view.js +1 -1
  340. package/dist/tui-v2/rendering/plan-view.js.map +1 -1
  341. package/dist/tui-v2/rendering/syntax-highlight.d.ts +37 -0
  342. package/dist/tui-v2/rendering/syntax-highlight.js +1303 -0
  343. package/dist/tui-v2/rendering/syntax-highlight.js.map +1 -0
  344. package/dist/tui-v2/rendering/theme.d.ts +28 -0
  345. package/dist/tui-v2/rendering/theme.js +28 -0
  346. package/dist/tui-v2/rendering/theme.js.map +1 -1
  347. package/dist/tui-v2/rendering/tool-presenter.d.ts +11 -1
  348. package/dist/tui-v2/rendering/tool-presenter.js +101 -5
  349. package/dist/tui-v2/rendering/tool-presenter.js.map +1 -1
  350. package/dist/tui-v2/state/transcript-hydrate.js +5 -0
  351. package/dist/tui-v2/state/transcript-hydrate.js.map +1 -1
  352. package/dist/tui-v2/state/transcript-reducer.js +12 -2
  353. package/dist/tui-v2/state/transcript-reducer.js.map +1 -1
  354. package/dist/tui-v2/state/transcript-store.d.ts +7 -0
  355. package/dist/tui-v2/state/transcript-store.js +46 -0
  356. package/dist/tui-v2/state/transcript-store.js.map +1 -1
  357. package/dist/tui-v2/state/transcript-types.d.ts +12 -0
  358. package/dist/tui-v2/state/transcript-types.js +9 -0
  359. package/dist/tui-v2/state/transcript-types.js.map +1 -1
  360. package/dist/types.d.ts +75 -1
  361. package/dist/ui/ansi-box.d.ts +2 -0
  362. package/dist/ui/ansi-box.js +8 -1
  363. package/dist/ui/ansi-box.js.map +1 -1
  364. package/dist/ui/mentions.d.ts +6 -0
  365. package/dist/ui/mentions.js +50 -12
  366. package/dist/ui/mentions.js.map +1 -1
  367. package/dist/ui/plan-pane.js +1 -1
  368. package/dist/ui/plan-pane.js.map +1 -1
  369. package/package.json +16 -11
@@ -0,0 +1,578 @@
1
+ import { registerWireNamesFor, toSnakeWireName, toWireName, } from "../llm/tool-protocol.js";
2
+ function def(name, description, parameters, flags = {}) {
3
+ // Primary wire keeps camelCase (fs_writeMany); also register snake alias.
4
+ const wireName = registerWireNamesFor(name);
5
+ return {
6
+ name,
7
+ wireName,
8
+ description,
9
+ parameters,
10
+ ...flags,
11
+ };
12
+ }
13
+ const emptyObject = {
14
+ type: "object",
15
+ properties: {},
16
+ additionalProperties: false,
17
+ };
18
+ /** Plan tools dispatched specially in the runner (not in toolRegistry). */
19
+ export const PLAN_TOOL_NAMES = new Set(["plan.create", "task.update"]);
20
+ /** Meta tools with no registry handler (plan + ask-mode handoff). */
21
+ export const NON_REGISTRY_TOOL_NAMES = new Set([
22
+ ...PLAN_TOOL_NAMES,
23
+ "agent.handoff",
24
+ ]);
25
+ export const TOOL_DEFINITIONS = [
26
+ def("fs.read", "Read a file. Use for inspecting source, configs, or outputs. Prefer offset/limit for large files.", {
27
+ type: "object",
28
+ properties: {
29
+ path: {
30
+ type: "string",
31
+ description: "File path (absolute, relative, or ~)",
32
+ },
33
+ offset: {
34
+ type: "integer",
35
+ description: "1-indexed start line for paging",
36
+ },
37
+ limit: { type: "integer", description: "Max lines to return" },
38
+ maxBytes: { type: "integer", description: "Max bytes to read" },
39
+ },
40
+ required: ["path"],
41
+ additionalProperties: false,
42
+ }, { readOnly: true, askMode: true }),
43
+ def("fs.write", "Create or fully overwrite a file with complete content in one call. Prefer this over append for new files.", {
44
+ type: "object",
45
+ properties: {
46
+ path: { type: "string" },
47
+ content: {
48
+ type: "string",
49
+ description: "Full file contents in one call",
50
+ },
51
+ },
52
+ required: ["path", "content"],
53
+ additionalProperties: false,
54
+ }, { mutates: true }),
55
+ def("fs.writeMany", "Write multiple complete files in one call (scaffold). Max 50 files.", {
56
+ type: "object",
57
+ properties: {
58
+ files: {
59
+ type: "array",
60
+ maxItems: 50,
61
+ items: {
62
+ type: "object",
63
+ properties: {
64
+ path: { type: "string" },
65
+ content: { type: "string" },
66
+ },
67
+ required: ["path", "content"],
68
+ additionalProperties: false,
69
+ },
70
+ },
71
+ },
72
+ required: ["files"],
73
+ additionalProperties: false,
74
+ }, { mutates: true }),
75
+ def("fs.list", "List directory entries.", {
76
+ type: "object",
77
+ properties: {
78
+ path: { type: "string" },
79
+ maxEntries: { type: "integer" },
80
+ },
81
+ required: [],
82
+ additionalProperties: false,
83
+ }, { readOnly: true, askMode: true }),
84
+ def("fs.search", "Search file contents by pattern (ripgrep-style).", {
85
+ type: "object",
86
+ properties: {
87
+ pattern: { type: "string" },
88
+ path: { type: "string" },
89
+ },
90
+ required: ["pattern"],
91
+ additionalProperties: false,
92
+ }, { readOnly: true, askMode: true }),
93
+ def("fs.edit", "Surgical in-place edit: replace exact oldText with newText.", {
94
+ type: "object",
95
+ properties: {
96
+ path: { type: "string" },
97
+ oldText: { type: "string" },
98
+ newText: { type: "string" },
99
+ expectedReplacements: { type: "integer" },
100
+ },
101
+ required: ["path", "oldText", "newText"],
102
+ additionalProperties: false,
103
+ }, { mutates: true }),
104
+ def("fs.replaceLines", "Replace a 1-indexed inclusive line range after reading the file. Empty content (or delete:true) deletes that range.", {
105
+ type: "object",
106
+ properties: {
107
+ path: { type: "string" },
108
+ startLine: { type: "integer" },
109
+ endLine: { type: "integer" },
110
+ content: {
111
+ type: "string",
112
+ description: "Replacement text. Empty string deletes the line range (no space hack).",
113
+ },
114
+ delete: {
115
+ type: "boolean",
116
+ description: "If true, delete the range (same as content:\"\")",
117
+ },
118
+ },
119
+ required: ["path", "startLine", "endLine"],
120
+ additionalProperties: false,
121
+ }, { mutates: true }),
122
+ def("fs.append", "Append (or prepend) content. Use after truncation notices with expectedPriorBytes.", {
123
+ type: "object",
124
+ properties: {
125
+ path: { type: "string" },
126
+ content: { type: "string" },
127
+ position: { type: "string", enum: ["start", "end"] },
128
+ expectedPriorBytes: {
129
+ type: "integer",
130
+ description: "From prior write receipt; required after truncation salvage",
131
+ },
132
+ },
133
+ required: ["path", "content"],
134
+ additionalProperties: false,
135
+ }, { mutates: true }),
136
+ def("fs.delete", "Delete a file or directory.", {
137
+ type: "object",
138
+ properties: {
139
+ path: { type: "string" },
140
+ recursive: { type: "boolean" },
141
+ },
142
+ required: ["path"],
143
+ additionalProperties: false,
144
+ }, { mutates: true }),
145
+ def("shell.exec", "Run a shell command and wait for completion. Use shell.start for long-running servers.", {
146
+ type: "object",
147
+ properties: {
148
+ command: { type: "string" },
149
+ cwd: { type: "string" },
150
+ timeoutMs: { type: "integer" },
151
+ },
152
+ required: ["command"],
153
+ additionalProperties: false,
154
+ }, { mutates: true }),
155
+ def("shell.start", "Start a long-running command in the background; returns a job id.", {
156
+ type: "object",
157
+ properties: {
158
+ command: { type: "string" },
159
+ cwd: { type: "string" },
160
+ name: { type: "string" },
161
+ },
162
+ required: ["command"],
163
+ additionalProperties: false,
164
+ }, { mutates: true }),
165
+ def("shell.jobs", "List background jobs.", emptyObject, { readOnly: true }),
166
+ def("shell.tail", "Read recent output from a background job.", {
167
+ type: "object",
168
+ properties: {
169
+ id: { type: "string" },
170
+ bytes: { type: "integer" },
171
+ },
172
+ required: ["id"],
173
+ additionalProperties: false,
174
+ }, { readOnly: true }),
175
+ def("shell.stop", "Stop a background job.", {
176
+ type: "object",
177
+ properties: { id: { type: "string" } },
178
+ required: ["id"],
179
+ additionalProperties: false,
180
+ }, { mutates: true }),
181
+ def("pkg.install", "Install a package via the OS package manager if the binary is missing.", {
182
+ type: "object",
183
+ properties: {
184
+ tool: { type: "string" },
185
+ checkBinary: { type: "string" },
186
+ },
187
+ required: ["tool"],
188
+ additionalProperties: false,
189
+ }, { mutates: true }),
190
+ def("net.scan", "Port/service scan a target with nmap (confirm required for live scans).", {
191
+ type: "object",
192
+ properties: {
193
+ target: { type: "string" },
194
+ ports: { type: "string" },
195
+ profile: {
196
+ type: "object",
197
+ description: "Structured nmap profile",
198
+ },
199
+ flags: {
200
+ type: "string",
201
+ description: "Legacy flags string",
202
+ },
203
+ background: {
204
+ type: "boolean",
205
+ description: "Force durable execution; deep/full profiles are durable automatically",
206
+ },
207
+ },
208
+ required: ["target"],
209
+ additionalProperties: false,
210
+ }, { mutates: true }),
211
+ def("net.context", "Local network context (interfaces, routes summary).", emptyObject, { readOnly: true, askMode: true }),
212
+ def("net.pingSweep", "Discover live hosts on a subnet/CIDR.", {
213
+ type: "object",
214
+ properties: {
215
+ target: { type: "string" },
216
+ method: {
217
+ type: "string",
218
+ enum: ["auto", "nmap", "arp", "native"],
219
+ },
220
+ timeoutMs: { type: "integer" },
221
+ },
222
+ required: ["target"],
223
+ additionalProperties: false,
224
+ }, { readOnly: true }),
225
+ def("http.fetch", "HTTP request (GET/HEAD preferred). Confirm for mutating methods.", {
226
+ type: "object",
227
+ properties: {
228
+ url: { type: "string" },
229
+ method: { type: "string" },
230
+ body: { type: "string" },
231
+ headers: {
232
+ type: "object",
233
+ additionalProperties: { type: "string" },
234
+ },
235
+ maxBytes: { type: "integer" },
236
+ iOwnThis: { type: "boolean" },
237
+ own: { type: "boolean" },
238
+ retries: { type: "integer" },
239
+ },
240
+ required: ["url"],
241
+ additionalProperties: false,
242
+ }, { readOnly: true, askMode: true }),
243
+ def("dns.lookup", "DNS query for a single record type.", {
244
+ type: "object",
245
+ properties: {
246
+ target: { type: "string" },
247
+ record: {
248
+ type: "string",
249
+ description: "A, AAAA, MX, TXT, ...",
250
+ },
251
+ },
252
+ required: ["target"],
253
+ additionalProperties: false,
254
+ }, { readOnly: true, askMode: true }),
255
+ def("whois.lookup", "WHOIS lookup for domain or IP ownership.", {
256
+ type: "object",
257
+ properties: { target: { type: "string" } },
258
+ required: ["target"],
259
+ additionalProperties: false,
260
+ }, { readOnly: true, askMode: true }),
261
+ def("pentest.recon", "Bundled whois/dns/nmap recon. Prefer discrete tools when only one step is needed. Default nmap is top-100; escalate with topPorts, ports, or full for thorough engagements.", {
262
+ type: "object",
263
+ properties: {
264
+ target: { type: "string" },
265
+ whois: { type: "boolean" },
266
+ dns: { type: "boolean" },
267
+ nmap: { type: "boolean" },
268
+ topPorts: {
269
+ type: "integer",
270
+ description: "nmap --top-ports N (default 100)",
271
+ },
272
+ ports: {
273
+ type: "string",
274
+ description: "nmap -p spec, e.g. 1-1000 or 80,443,8080",
275
+ },
276
+ full: {
277
+ type: "boolean",
278
+ description: "If true, scan all TCP ports (-p-)",
279
+ },
280
+ background: {
281
+ type: "boolean",
282
+ description: "Force durable nmap execution; deep/full scans are durable automatically",
283
+ },
284
+ },
285
+ required: ["target"],
286
+ additionalProperties: false,
287
+ }, { mutates: true }),
288
+ def("pentest.webDiscover", "Discover a scoped web surface with bounded concurrent requests to common and supplied paths.", {
289
+ type: "object",
290
+ properties: {
291
+ baseUrl: { type: "string" },
292
+ paths: { type: "array", maxItems: 100, items: { type: "string" } },
293
+ },
294
+ required: ["baseUrl"],
295
+ additionalProperties: false,
296
+ }, { readOnly: true }),
297
+ def("pentest.apiEnumerate", "Fetch and enumerate paths from an authorized OpenAPI/Swagger specification.", {
298
+ type: "object",
299
+ properties: { specUrl: { type: "string" } },
300
+ required: ["specUrl"],
301
+ additionalProperties: false,
302
+ }, { readOnly: true }),
303
+ def("pentest.authCompare", "Compare the same authorized endpoint across named authentication contexts. Credentials are never echoed.", {
304
+ type: "object",
305
+ properties: {
306
+ url: { type: "string" },
307
+ contexts: {
308
+ type: "array",
309
+ minItems: 2,
310
+ maxItems: 10,
311
+ items: {
312
+ type: "object",
313
+ properties: {
314
+ label: { type: "string" },
315
+ headers: { type: "object", additionalProperties: { type: "string" } },
316
+ },
317
+ required: ["label", "headers"],
318
+ additionalProperties: false,
319
+ },
320
+ },
321
+ },
322
+ required: ["url", "contexts"],
323
+ additionalProperties: false,
324
+ }, { readOnly: true }),
325
+ def("pentest.scanStatus", "Incrementally ingest a durable scan checkpoint by job id and byte offset.", {
326
+ type: "object",
327
+ properties: {
328
+ id: { type: "string" },
329
+ offset: { type: "integer" },
330
+ bytes: { type: "integer" },
331
+ stream: { type: "string", enum: ["stdout", "stderr", "combined"] },
332
+ target: { type: "string" },
333
+ },
334
+ required: ["id", "target"],
335
+ additionalProperties: false,
336
+ }, { readOnly: true }),
337
+ def("web.search", "Search the web for current information. Use for volatile facts and research.", {
338
+ type: "object",
339
+ properties: {
340
+ query: { type: "string" },
341
+ maxResults: { type: "integer" },
342
+ fetchTop: {
343
+ type: "integer",
344
+ description: "Fetch top N pages (0-3)",
345
+ },
346
+ },
347
+ required: ["query"],
348
+ additionalProperties: false,
349
+ }, { readOnly: true, askMode: true }),
350
+ def("web.fetch", "Fetch a URL as readable text or metadata for research.", {
351
+ type: "object",
352
+ properties: {
353
+ url: { type: "string" },
354
+ maxBytes: { type: "integer" },
355
+ includeHeaders: { type: "boolean" },
356
+ includeTls: { type: "boolean" },
357
+ includeTiming: { type: "boolean" },
358
+ includeRedirectChain: { type: "boolean" },
359
+ responseMode: {
360
+ type: "string",
361
+ enum: ["readable", "raw"],
362
+ description: "Body formatting: readable (default) or raw. Headers/TLS are separate booleans.",
363
+ },
364
+ redactSensitive: { type: "boolean" },
365
+ },
366
+ required: ["url"],
367
+ additionalProperties: false,
368
+ }, { readOnly: true, askMode: true }),
369
+ def("sysinfo", "OS/environment facts for this machine.", emptyObject, {
370
+ readOnly: true,
371
+ askMode: true,
372
+ }),
373
+ def("tool.check", 'Check whether binaries/tools are available on PATH (and versions). Pass tools as an array, e.g. {"tools":["nmap","ffuf"]}.', {
374
+ type: "object",
375
+ properties: {
376
+ tools: {
377
+ type: "array",
378
+ items: { type: "string" },
379
+ minItems: 1,
380
+ maxItems: 20,
381
+ description: 'Tool names, e.g. ["nmap","ffuf"]',
382
+ },
383
+ },
384
+ required: ["tools"],
385
+ additionalProperties: false,
386
+ }, { readOnly: true, askMode: true }),
387
+ def("tool.batch", "Run multiple read-only tool calls concurrently (max 20).", {
388
+ type: "object",
389
+ properties: {
390
+ calls: {
391
+ type: "array",
392
+ items: {
393
+ type: "object",
394
+ properties: {
395
+ name: { type: "string" },
396
+ args: { type: "object" },
397
+ },
398
+ required: ["name", "args"],
399
+ },
400
+ },
401
+ },
402
+ required: ["calls"],
403
+ additionalProperties: false,
404
+ }, { readOnly: true, askMode: true }),
405
+ def("wordlist.find", "Locate wordlists on disk for fuzzing/directory scans.", {
406
+ type: "object",
407
+ properties: {
408
+ query: { type: "string" },
409
+ expand: { type: "boolean" },
410
+ },
411
+ required: ["query"],
412
+ additionalProperties: false,
413
+ }, { readOnly: true }),
414
+ def("image.ocr", "OCR text from an image file (fallback when vision is unavailable).", {
415
+ type: "object",
416
+ properties: {
417
+ path: { type: "string" },
418
+ lang: { type: "string" },
419
+ maxBytes: { type: "integer" },
420
+ },
421
+ required: ["path"],
422
+ additionalProperties: false,
423
+ }, { readOnly: true, askMode: true }),
424
+ def("pdf.read", "Extract text from a PDF (OCR fallback for scanned pages).", {
425
+ type: "object",
426
+ properties: {
427
+ path: { type: "string" },
428
+ maxPages: { type: "integer" },
429
+ maxBytes: { type: "integer" },
430
+ },
431
+ required: ["path"],
432
+ additionalProperties: false,
433
+ }, { readOnly: true, askMode: true }),
434
+ def("plan.create", "Create or revise a durable multi-step session plan with task checklist.", {
435
+ type: "object",
436
+ properties: {
437
+ goal: { type: "string" },
438
+ detail: { type: "string" },
439
+ tasks: {
440
+ type: "array",
441
+ items: {
442
+ oneOf: [
443
+ { type: "string" },
444
+ {
445
+ type: "object",
446
+ properties: {
447
+ title: { type: "string" },
448
+ task: { type: "string" },
449
+ name: { type: "string" },
450
+ },
451
+ },
452
+ ],
453
+ },
454
+ },
455
+ kind: { type: "string" },
456
+ },
457
+ required: ["goal", "tasks"],
458
+ additionalProperties: true,
459
+ }, { mutates: true }),
460
+ def("task.update", "Update a plan task state. taskId MUST be t1, t2, … from the ACTIVE PLAN context (not a free-form title slug).", {
461
+ type: "object",
462
+ properties: {
463
+ taskId: {
464
+ type: "string",
465
+ description: "Canonical id from plan context: t1, t2, t3, … (aliases accepted if listed)",
466
+ },
467
+ state: {
468
+ type: "string",
469
+ enum: ["pending", "in_progress", "done", "failed", "skipped"],
470
+ },
471
+ note: { type: "string" },
472
+ },
473
+ required: ["taskId", "state"],
474
+ additionalProperties: true,
475
+ }, { mutates: true }),
476
+ def("agent.handoff", "Hand a task that needs agent mode (writes, shell, installs) back to the user. Ask mode cannot execute mutations — use this instead of inventing write tools.", {
477
+ type: "object",
478
+ properties: {
479
+ task: {
480
+ type: "string",
481
+ description: "Exact task restatement for agent mode",
482
+ },
483
+ reason: {
484
+ type: "string",
485
+ description: "Short reason agent mode is required",
486
+ },
487
+ },
488
+ required: ["task", "reason"],
489
+ additionalProperties: false,
490
+ }),
491
+ ];
492
+ const byName = new Map(TOOL_DEFINITIONS.map((d) => [d.name, d]));
493
+ const byWire = new Map();
494
+ for (const d of TOOL_DEFINITIONS) {
495
+ byWire.set(d.wireName, d);
496
+ const snake = toSnakeWireName(d.name);
497
+ if (snake !== d.wireName)
498
+ byWire.set(snake, d);
499
+ }
500
+ export function getToolDefinition(name) {
501
+ return byName.get(name) ?? byWire.get(name);
502
+ }
503
+ export function getToolDefinitions(filter) {
504
+ let defs = TOOL_DEFINITIONS;
505
+ if (filter?.askMode) {
506
+ defs = defs.filter((d) => d.askMode);
507
+ }
508
+ if (filter?.names) {
509
+ const allow = new Set(filter.names);
510
+ defs = defs.filter((d) => allow.has(d.name));
511
+ }
512
+ if (filter?.compact) {
513
+ // Core set for low-TPM models + recon/network essentials (no net.scan
514
+ // mutator — that still needs the full set / confirm UX).
515
+ const core = new Set([
516
+ "fs.read",
517
+ "fs.write",
518
+ "fs.writeMany",
519
+ "fs.list",
520
+ "fs.search",
521
+ "fs.edit",
522
+ "fs.append",
523
+ "fs.delete",
524
+ "shell.exec",
525
+ "shell.start",
526
+ "shell.jobs",
527
+ "shell.tail",
528
+ "shell.stop",
529
+ "web.search",
530
+ "web.fetch",
531
+ "http.fetch",
532
+ "dns.lookup",
533
+ "whois.lookup",
534
+ "net.context",
535
+ "pentest.recon",
536
+ "wordlist.find",
537
+ "sysinfo",
538
+ "tool.check",
539
+ "plan.create",
540
+ "task.update",
541
+ ]);
542
+ defs = defs.filter((d) => core.has(d.name));
543
+ }
544
+ return defs.map((d) => ({ ...d }));
545
+ }
546
+ export function getCompactToolDefinitions() {
547
+ return getToolDefinitions({ compact: true });
548
+ }
549
+ export function wireNameFor(canonical) {
550
+ return byName.get(canonical)?.wireName ?? toWireName(canonical);
551
+ }
552
+ export function canonicalNameFor(wire) {
553
+ return byWire.get(wire)?.name;
554
+ }
555
+ /**
556
+ * Every registry key must have a definition; every definition must have a
557
+ * handler unless it is a plan meta-tool.
558
+ */
559
+ export function assertDefinitionRegistryConsistency(registryKeys) {
560
+ const reg = new Set(registryKeys);
561
+ const defNames = new Set(TOOL_DEFINITIONS.map((d) => d.name));
562
+ const wires = new Set();
563
+ for (const d of TOOL_DEFINITIONS) {
564
+ if (wires.has(d.wireName)) {
565
+ throw new Error(`Duplicate wire name: ${d.wireName}`);
566
+ }
567
+ wires.add(d.wireName);
568
+ if (!NON_REGISTRY_TOOL_NAMES.has(d.name) && !reg.has(d.name)) {
569
+ throw new Error(`Definition "${d.name}" has no toolRegistry handler (and is not a meta tool)`);
570
+ }
571
+ }
572
+ for (const key of registryKeys) {
573
+ if (!defNames.has(key)) {
574
+ throw new Error(`toolRegistry key "${key}" has no ToolDefinition`);
575
+ }
576
+ }
577
+ }
578
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,UAAU,GACX,MAAM,yBAAyB,CAAC;AAEjC,SAAS,GAAG,CACV,IAAY,EACZ,WAAmB,EACnB,UAAwC,EACxC,QAA2E,EAAE;IAE7E,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,WAAW;QACX,UAAU;QACV,GAAG,KAAK;KACT,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE,EAA6B;IACzC,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;AAEvE,qEAA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AE,IAAI,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,YAAsB;IAEtB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAEhC,KAAK,MAAM,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,eAAe,CAAC,CAAC,IAAI,wDAAwD,CAC9E,CAAC;QACJ,CAAC;IACH,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,yBAAyB,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Run elevation-sensitive commands without hijacking the TTY.
3
+ * Used when requestSecret is available (OpenTUI secret modal) so sudo never
4
+ * prints "Password:" on the alternate screen or freezes keyboard/mouse.
5
+ */
6
+ import type { ToolResult } from "../types.js";
7
+ import type { BackgroundSpawnSpec } from "./jobs.js";
8
+ import type { ToolRunOptions } from "./tool-types.js";
9
+ import { spawnArgv } from "./shell.js";
10
+ /** True when the command is a simple leading-sudo form we can re-run with -S. */
11
+ export declare function extractSimpleSudoCommand(command: string): {
12
+ inner: string;
13
+ } | undefined;
14
+ /**
15
+ * Format a password for `sudo -S` stdin.
16
+ * Strips only trailing newlines from the secret modal (passwords may contain spaces).
17
+ */
18
+ export declare function formatSudoStdinPassword(password: string): string;
19
+ export type PreparedElevation = {
20
+ prepared: true;
21
+ spec: BackgroundSpawnSpec;
22
+ } | {
23
+ prepared: false;
24
+ result: ToolResult;
25
+ };
26
+ /**
27
+ * Authenticate before reporting a privileged background job as started, then
28
+ * return a shell:false spawn specification whose secret exists only as stdin.
29
+ */
30
+ export declare function preparePrivilegedBackgroundArgv(command: string, argv: string[], options: {
31
+ signal?: AbortSignal | undefined;
32
+ onOutput?: ToolRunOptions["onOutput"];
33
+ requestSecret?: ToolRunOptions["requestSecret"];
34
+ title?: string | undefined;
35
+ prompt?: string | undefined;
36
+ }, dependencies?: {
37
+ available?: ((command: string) => Promise<boolean>) | undefined;
38
+ runAuth?: (typeof spawnArgv) | undefined;
39
+ isRoot?: (() => boolean) | undefined;
40
+ }): Promise<PreparedElevation>;
41
+ /** Prepare a simple leading-sudo shell command for detached execution. */
42
+ export declare function prepareElevatedBackgroundCommand(shellCommand: string, options: Parameters<typeof preparePrivilegedBackgroundArgv>[2], dependencies?: Parameters<typeof preparePrivilegedBackgroundArgv>[3]): Promise<PreparedElevation | undefined>;
43
+ /**
44
+ * If the command needs a password TTY and we have a secret UI, authenticate
45
+ * via requestSecret + sudo -S. Returns undefined when the normal path should
46
+ * run. Returns a ToolResult when handled (success or clear failure).
47
+ *
48
+ * Important: we pipe the password into the *real* command with `sudo -S`.
49
+ * Caching via `sudo -S -v` then `sudo -n …` fails on macOS/OpenTUI because
50
+ * child processes are detached / non-TTY and the sudo timestamp ticket does
51
+ * not carry over — you get "Administrator access confirmed" then
52
+ * "sudo: a password is required".
53
+ */
54
+ export declare function tryRunElevatedWithoutTty(command: string, options: {
55
+ cwd?: string | undefined;
56
+ timeoutMs?: number | undefined;
57
+ signal?: AbortSignal | undefined;
58
+ onOutput?: ToolRunOptions["onOutput"];
59
+ requestSecret?: ToolRunOptions["requestSecret"];
60
+ }): Promise<ToolResult | undefined>;