@pentoshi/clai 4.12.1 → 4.13.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 (483) hide show
  1. package/CODE_OF_CONDUCT.md +132 -0
  2. package/CONTRIBUTING.md +102 -0
  3. package/PROVIDERS.md +149 -0
  4. package/README.md +217 -464
  5. package/SECURITY.md +33 -0
  6. package/dist/agent/compaction/summary-execution.js +2 -2
  7. package/dist/agent/compaction/summary-execution.js.map +1 -1
  8. package/dist/agent/compaction-summary.d.ts +5 -2
  9. package/dist/agent/compaction-summary.js +10 -4
  10. package/dist/agent/compaction-summary.js.map +1 -1
  11. package/dist/agent/context/compact-with-summary.d.ts +1 -0
  12. package/dist/agent/context/compact-with-summary.js +25 -3
  13. package/dist/agent/context/compact-with-summary.js.map +1 -1
  14. package/dist/agent/context/compaction-recent-history.d.ts +12 -0
  15. package/dist/agent/context/compaction-recent-history.js +114 -0
  16. package/dist/agent/context/compaction-recent-history.js.map +1 -0
  17. package/dist/agent/context/user-credentials.d.ts +1 -0
  18. package/dist/agent/context/user-credentials.js +3 -0
  19. package/dist/agent/context/user-credentials.js.map +1 -1
  20. package/dist/agent/context-manager.js +2 -1
  21. package/dist/agent/context-manager.js.map +1 -1
  22. package/dist/agent/evidence/task-classification.js +2 -5
  23. package/dist/agent/evidence/task-classification.js.map +1 -1
  24. package/dist/agent/loop-guard.js +1 -5
  25. package/dist/agent/loop-guard.js.map +1 -1
  26. package/dist/agent/outcomes.js +9 -1
  27. package/dist/agent/outcomes.js.map +1 -1
  28. package/dist/agent/parser/arg-formatting.js +3 -16
  29. package/dist/agent/parser/arg-formatting.js.map +1 -1
  30. package/dist/agent/parser/bare-recognition.js +12 -6
  31. package/dist/agent/parser/bare-recognition.js.map +1 -1
  32. package/dist/agent/parser/xml-protocol.js +0 -2
  33. package/dist/agent/parser/xml-protocol.js.map +1 -1
  34. package/dist/agent/plan-implement-compact.js +2 -1
  35. package/dist/agent/plan-implement-compact.js.map +1 -1
  36. package/dist/agent/request-budget.d.ts +1 -0
  37. package/dist/agent/request-budget.js +6 -1
  38. package/dist/agent/request-budget.js.map +1 -1
  39. package/dist/agent/runner.js +2 -2
  40. package/dist/agent/runner.js.map +1 -1
  41. package/dist/agent/session-policy.d.ts +1 -0
  42. package/dist/agent/session-policy.js +1 -4
  43. package/dist/agent/session-policy.js.map +1 -1
  44. package/dist/agent/subagents/manager.d.ts +5 -1
  45. package/dist/agent/subagents/manager.js +95 -15
  46. package/dist/agent/subagents/manager.js.map +1 -1
  47. package/dist/agent/subagents/read-only-tools.js +44 -20
  48. package/dist/agent/subagents/read-only-tools.js.map +1 -1
  49. package/dist/agent/subagents/tools.d.ts +8 -1
  50. package/dist/agent/subagents/tools.js +21 -13
  51. package/dist/agent/subagents/tools.js.map +1 -1
  52. package/dist/agent/subagents/types.d.ts +7 -0
  53. package/dist/agent/subagents/worker.js +48 -7
  54. package/dist/agent/subagents/worker.js.map +1 -1
  55. package/dist/agent/task-evidence.js +2 -11
  56. package/dist/agent/task-evidence.js.map +1 -1
  57. package/dist/agent/tool-output-formatting.js +8 -2
  58. package/dist/agent/tool-output-formatting.js.map +1 -1
  59. package/dist/agent/turn/automatic-compaction-execution.js +1 -0
  60. package/dist/agent/turn/automatic-compaction-execution.js.map +1 -1
  61. package/dist/agent/turn/compaction-coordinator.js +4 -4
  62. package/dist/agent/turn/compaction-coordinator.js.map +1 -1
  63. package/dist/agent/turn/compaction-replay-selection.js +1 -0
  64. package/dist/agent/turn/compaction-replay-selection.js.map +1 -1
  65. package/dist/agent/turn/loop/run-rounds.js +11 -3
  66. package/dist/agent/turn/loop/run-rounds.js.map +1 -1
  67. package/dist/agent/turn/prompt-sections.js +4 -9
  68. package/dist/agent/turn/prompt-sections.js.map +1 -1
  69. package/dist/agent/turn/setup/turn-messages.js +2 -1
  70. package/dist/agent/turn/setup/turn-messages.js.map +1 -1
  71. package/dist/agent/turn/subagent-inbox.d.ts +5 -5
  72. package/dist/agent/turn/subagent-inbox.js +90 -11
  73. package/dist/agent/turn/subagent-inbox.js.map +1 -1
  74. package/dist/agent/turn/system-sections.d.ts +1 -0
  75. package/dist/agent/turn/system-sections.js +1 -1
  76. package/dist/agent/turn/system-sections.js.map +1 -1
  77. package/dist/agent/turn/task-autostart.js +2 -0
  78. package/dist/agent/turn/task-autostart.js.map +1 -1
  79. package/dist/agent/turn/tool-execution/single-tool.js +1 -3
  80. package/dist/agent/turn/tool-execution/single-tool.js.map +1 -1
  81. package/dist/agent/turn/tool-result-recorder.js +5 -0
  82. package/dist/agent/turn/tool-result-recorder.js.map +1 -1
  83. package/dist/agent/turn/tool-routing.d.ts +1 -1
  84. package/dist/agent/turn/tool-routing.js +11 -11
  85. package/dist/agent/turn/tool-routing.js.map +1 -1
  86. package/dist/agent/workspace-orient.js +2 -2
  87. package/dist/agent/workspace-orient.js.map +1 -1
  88. package/dist/app/adapters/agent-event-adapter.js +5 -0
  89. package/dist/app/adapters/agent-event-adapter.js.map +1 -1
  90. package/dist/app/adapters/current-store-adapter.js +2 -2
  91. package/dist/app/adapters/current-store-adapter.js.map +1 -1
  92. package/dist/app/commands/catalog.js +2 -0
  93. package/dist/app/commands/catalog.js.map +1 -1
  94. package/dist/app/commands/registry.js +1 -1
  95. package/dist/app/commands/registry.js.map +1 -1
  96. package/dist/app/controllers/session-compact-helper.js +1 -0
  97. package/dist/app/controllers/session-compact-helper.js.map +1 -1
  98. package/dist/app/controllers/session-controller.d.ts +8 -0
  99. package/dist/app/controllers/session-controller.js +58 -10
  100. package/dist/app/controllers/session-controller.js.map +1 -1
  101. package/dist/app/controllers/session-naming.d.ts +4 -5
  102. package/dist/app/controllers/session-naming.js +38 -80
  103. package/dist/app/controllers/session-naming.js.map +1 -1
  104. package/dist/app/controllers/session-prompt-history.d.ts +4 -0
  105. package/dist/app/controllers/session-prompt-history.js +33 -0
  106. package/dist/app/controllers/session-prompt-history.js.map +1 -0
  107. package/dist/app/controllers/session-prompt-queue.d.ts +1 -0
  108. package/dist/app/controllers/session-prompt-queue.js +1 -1
  109. package/dist/app/controllers/session-prompt-queue.js.map +1 -1
  110. package/dist/app/events/artifact-output.d.ts +1 -0
  111. package/dist/app/events/artifact-output.js +32 -0
  112. package/dist/app/events/artifact-output.js.map +1 -0
  113. package/dist/app/events/event-buffer.d.ts +13 -1
  114. package/dist/app/events/event-buffer.js +92 -4
  115. package/dist/app/events/event-buffer.js.map +1 -1
  116. package/dist/app/operation-review.js +1 -1
  117. package/dist/app/operation-review.js.map +1 -1
  118. package/dist/app/ports/persistence-port.d.ts +2 -1
  119. package/dist/classic/app/ClassicApp.js +33 -2
  120. package/dist/classic/app/ClassicApp.js.map +1 -1
  121. package/dist/classic/app/action-handlers.js +0 -2
  122. package/dist/classic/app/action-handlers.js.map +1 -1
  123. package/dist/classic/app/app-wiring.d.ts +1 -2
  124. package/dist/classic/app/app-wiring.js +1 -8
  125. package/dist/classic/app/app-wiring.js.map +1 -1
  126. package/dist/classic/app/wiring-interactions.d.ts +0 -2
  127. package/dist/classic/app/wiring-interactions.js +5 -13
  128. package/dist/classic/app/wiring-interactions.js.map +1 -1
  129. package/dist/classic/app/wiring-types.d.ts +2 -2
  130. package/dist/classic/blocks/batch-lines.js +10 -8
  131. package/dist/classic/blocks/batch-lines.js.map +1 -1
  132. package/dist/classic/blocks/block-context.d.ts +1 -0
  133. package/dist/classic/blocks/block-context.js.map +1 -1
  134. package/dist/classic/blocks/tool-lines.js +20 -39
  135. package/dist/classic/blocks/tool-lines.js.map +1 -1
  136. package/dist/classic/bootstrap/renderer-handle.d.ts +5 -1
  137. package/dist/classic/bootstrap/renderer-handle.js.map +1 -1
  138. package/dist/classic/bootstrap/start-classic.js +12 -12
  139. package/dist/classic/bootstrap/start-classic.js.map +1 -1
  140. package/dist/classic/chrome/context-limit-editor.d.ts +7 -0
  141. package/dist/classic/chrome/context-limit-editor.js +5 -0
  142. package/dist/classic/chrome/context-limit-editor.js.map +1 -1
  143. package/dist/classic/chrome/status-rows.d.ts +4 -0
  144. package/dist/classic/chrome/status-rows.js +11 -0
  145. package/dist/classic/chrome/status-rows.js.map +1 -1
  146. package/dist/classic/feed/feed-blocks.d.ts +1 -1
  147. package/dist/classic/feed/feed-blocks.js +13 -6
  148. package/dist/classic/feed/feed-blocks.js.map +1 -1
  149. package/dist/classic/panels/keys-panel.js +12 -3
  150. package/dist/classic/panels/keys-panel.js.map +1 -1
  151. package/dist/classic/panels/pager-panel.js +0 -6
  152. package/dist/classic/panels/pager-panel.js.map +1 -1
  153. package/dist/classic/panels/pager-source-controller.d.ts +34 -0
  154. package/dist/classic/panels/pager-source-controller.js +209 -0
  155. package/dist/classic/panels/pager-source-controller.js.map +1 -0
  156. package/dist/classic/panels/panel-controller.d.ts +1 -5
  157. package/dist/classic/panels/panel-controller.js +19 -88
  158. package/dist/classic/panels/panel-controller.js.map +1 -1
  159. package/dist/classic/panels/panel-effect.d.ts +0 -4
  160. package/dist/classic/panels/panel-effect.js.map +1 -1
  161. package/dist/classic/panels/panel-effects.js +0 -6
  162. package/dist/classic/panels/panel-effects.js.map +1 -1
  163. package/dist/classic/panels/panel-types.d.ts +0 -2
  164. package/dist/classic/panels/picker-panel.js +1 -1
  165. package/dist/classic/panels/picker-panel.js.map +1 -1
  166. package/dist/commands/providers.d.ts +1 -0
  167. package/dist/commands/providers.js +1 -0
  168. package/dist/commands/providers.js.map +1 -1
  169. package/dist/commands/qoder.d.ts +8 -0
  170. package/dist/commands/qoder.js +85 -0
  171. package/dist/commands/qoder.js.map +1 -0
  172. package/dist/index.js +19 -15
  173. package/dist/index.js.map +1 -1
  174. package/dist/interactive-session/transport-node-pty.js +3 -5
  175. package/dist/interactive-session/transport-node-pty.js.map +1 -1
  176. package/dist/llm/capability/state.d.ts +1 -1
  177. package/dist/llm/capability/tool-dialect.js +1 -0
  178. package/dist/llm/capability/tool-dialect.js.map +1 -1
  179. package/dist/llm/capability/vision-patterns.js +1 -0
  180. package/dist/llm/capability/vision-patterns.js.map +1 -1
  181. package/dist/llm/context-windows.js +2 -3
  182. package/dist/llm/context-windows.js.map +1 -1
  183. package/dist/llm/provider-identity.js +5 -0
  184. package/dist/llm/provider-identity.js.map +1 -1
  185. package/dist/llm/provider-info-text.js +25 -0
  186. package/dist/llm/provider-info-text.js.map +1 -1
  187. package/dist/llm/qoder/qoder-accounts.d.ts +9 -0
  188. package/dist/llm/qoder/qoder-accounts.js +53 -0
  189. package/dist/llm/qoder/qoder-accounts.js.map +1 -0
  190. package/dist/llm/qoder/qoder-auth.d.ts +59 -0
  191. package/dist/llm/qoder/qoder-auth.js +203 -0
  192. package/dist/llm/qoder/qoder-auth.js.map +1 -0
  193. package/dist/llm/qoder/qoder-credential.d.ts +31 -0
  194. package/dist/llm/qoder/qoder-credential.js +82 -0
  195. package/dist/llm/qoder/qoder-credential.js.map +1 -0
  196. package/dist/llm/qoder/qoder-login.d.ts +28 -0
  197. package/dist/llm/qoder/qoder-login.js +153 -0
  198. package/dist/llm/qoder/qoder-login.js.map +1 -0
  199. package/dist/llm/qoder/qoder-refresh.d.ts +4 -0
  200. package/dist/llm/qoder/qoder-refresh.js +165 -0
  201. package/dist/llm/qoder/qoder-refresh.js.map +1 -0
  202. package/dist/llm/qoder/qoder-signer.d.ts +66 -0
  203. package/dist/llm/qoder/qoder-signer.js +119 -0
  204. package/dist/llm/qoder/qoder-signer.js.map +1 -0
  205. package/dist/llm/qoder/qoder.d.ts +20 -0
  206. package/dist/llm/qoder/qoder.js +441 -0
  207. package/dist/llm/qoder/qoder.js.map +1 -0
  208. package/dist/llm/qoder/signer-glue.generated.d.ts +1 -0
  209. package/dist/llm/qoder/signer-glue.generated.js +4 -0
  210. package/dist/llm/qoder/signer-glue.generated.js.map +1 -0
  211. package/dist/llm/qoder/signer-wasm.generated.d.ts +3 -0
  212. package/dist/llm/qoder/signer-wasm.generated.js +6 -0
  213. package/dist/llm/qoder/signer-wasm.generated.js.map +1 -0
  214. package/dist/llm/reasoning-capability.js +1 -0
  215. package/dist/llm/reasoning-capability.js.map +1 -1
  216. package/dist/llm/routing/attempt-complete.js +4 -2
  217. package/dist/llm/routing/attempt-complete.js.map +1 -1
  218. package/dist/llm/routing/attempt-request.d.ts +2 -1
  219. package/dist/llm/routing/attempt-request.js +35 -1
  220. package/dist/llm/routing/attempt-request.js.map +1 -1
  221. package/dist/llm/routing/attempt-stream.js +4 -2
  222. package/dist/llm/routing/attempt-stream.js.map +1 -1
  223. package/dist/llm/routing/provider-selection.js +3 -0
  224. package/dist/llm/routing/provider-selection.js.map +1 -1
  225. package/dist/llm/tool-protocol.js +6 -0
  226. package/dist/llm/tool-protocol.js.map +1 -1
  227. package/dist/llm/wire/reasoning-payload.d.ts +1 -1
  228. package/dist/llm/wire/reasoning-payload.js +6 -0
  229. package/dist/llm/wire/reasoning-payload.js.map +1 -1
  230. package/dist/modes/ask.js +26 -10
  231. package/dist/modes/ask.js.map +1 -1
  232. package/dist/noninteractive/stream-blocks.d.ts +2 -4
  233. package/dist/noninteractive/stream-blocks.js +5 -5
  234. package/dist/noninteractive/stream-blocks.js.map +1 -1
  235. package/dist/noninteractive/stream-renderer.js +1 -1
  236. package/dist/noninteractive/stream-renderer.js.map +1 -1
  237. package/dist/prompts/embedded.js +2 -2
  238. package/dist/prompts/embedded.js.map +1 -1
  239. package/dist/prompts/index.d.ts +3 -1
  240. package/dist/prompts/index.js +25 -9
  241. package/dist/prompts/index.js.map +1 -1
  242. package/dist/prompts/system.agent.md +11 -11
  243. package/dist/prompts/system.ask.md +5 -3
  244. package/dist/safety/shell-command-words.d.ts +11 -0
  245. package/dist/safety/shell-command-words.js +193 -0
  246. package/dist/safety/shell-command-words.js.map +1 -0
  247. package/dist/safety/shell-filesystem-effects.js +46 -40
  248. package/dist/safety/shell-filesystem-effects.js.map +1 -1
  249. package/dist/safety/tool-classification.js +0 -14
  250. package/dist/safety/tool-classification.js.map +1 -1
  251. package/dist/session-runtime/binding.js +4 -1
  252. package/dist/session-runtime/binding.js.map +1 -1
  253. package/dist/session-runtime/client.js +111 -7
  254. package/dist/session-runtime/client.js.map +1 -1
  255. package/dist/session-runtime/discovery.d.ts +1 -1
  256. package/dist/session-runtime/discovery.js +2 -2
  257. package/dist/session-runtime/discovery.js.map +1 -1
  258. package/dist/session-runtime/host.d.ts +10 -2
  259. package/dist/session-runtime/host.js +206 -83
  260. package/dist/session-runtime/host.js.map +1 -1
  261. package/dist/session-runtime/input-commands.d.ts +2 -0
  262. package/dist/session-runtime/input-commands.js +11 -0
  263. package/dist/session-runtime/input-commands.js.map +1 -0
  264. package/dist/session-runtime/input-stream.d.ts +15 -0
  265. package/dist/session-runtime/input-stream.js +128 -0
  266. package/dist/session-runtime/input-stream.js.map +1 -0
  267. package/dist/session-runtime/types.d.ts +9 -0
  268. package/dist/store/config.js +1 -0
  269. package/dist/store/config.js.map +1 -1
  270. package/dist/store/history/freshness.d.ts +9 -0
  271. package/dist/store/history/freshness.js +29 -0
  272. package/dist/store/history/freshness.js.map +1 -0
  273. package/dist/store/history/jsonl-backend.js +2 -16
  274. package/dist/store/history/jsonl-backend.js.map +1 -1
  275. package/dist/store/history/lifecycle.js +6 -2
  276. package/dist/store/history/lifecycle.js.map +1 -1
  277. package/dist/store/history/recovery.d.ts +1 -3
  278. package/dist/store/history/recovery.js +72 -111
  279. package/dist/store/history/recovery.js.map +1 -1
  280. package/dist/store/history/session-queries.js +5 -5
  281. package/dist/store/history/session-queries.js.map +1 -1
  282. package/dist/store/history-index.d.ts +5 -0
  283. package/dist/store/history-index.js +41 -9
  284. package/dist/store/history-index.js.map +1 -1
  285. package/dist/store/history.d.ts +7 -2
  286. package/dist/store/history.js +13 -7
  287. package/dist/store/history.js.map +1 -1
  288. package/dist/store/rtk-usage.d.ts +2 -0
  289. package/dist/store/rtk-usage.js +44 -0
  290. package/dist/store/rtk-usage.js.map +1 -0
  291. package/dist/store/session-prompts-format.d.ts +2 -0
  292. package/dist/store/session-prompts-format.js +29 -0
  293. package/dist/store/session-prompts-format.js.map +1 -0
  294. package/dist/store/session-prompts.d.ts +40 -0
  295. package/dist/store/session-prompts.js +213 -0
  296. package/dist/store/session-prompts.js.map +1 -0
  297. package/dist/store/subagents.d.ts +5 -1
  298. package/dist/store/subagents.js +64 -4
  299. package/dist/store/subagents.js.map +1 -1
  300. package/dist/tools/call-normalization.js +0 -3
  301. package/dist/tools/call-normalization.js.map +1 -1
  302. package/dist/tools/definitions/aggregate.js +0 -4
  303. package/dist/tools/definitions/aggregate.js.map +1 -1
  304. package/dist/tools/definitions/define.js +0 -3
  305. package/dist/tools/definitions/define.js.map +1 -1
  306. package/dist/tools/definitions/files.js +3 -111
  307. package/dist/tools/definitions/files.js.map +1 -1
  308. package/dist/tools/definitions/fs-read.d.ts +3 -0
  309. package/dist/tools/definitions/fs-read.js +43 -0
  310. package/dist/tools/definitions/fs-read.js.map +1 -0
  311. package/dist/tools/definitions/selection.js +0 -45
  312. package/dist/tools/definitions/selection.js.map +1 -1
  313. package/dist/tools/fs/read-budget.d.ts +8 -0
  314. package/dist/tools/fs/read-budget.js +30 -0
  315. package/dist/tools/fs/read-budget.js.map +1 -0
  316. package/dist/tools/fs/read-input.d.ts +16 -0
  317. package/dist/tools/fs/read-input.js +73 -0
  318. package/dist/tools/fs/read-input.js.map +1 -0
  319. package/dist/tools/fs/read-many.d.ts +6 -0
  320. package/dist/tools/fs/read-many.js +50 -0
  321. package/dist/tools/fs/read-many.js.map +1 -0
  322. package/dist/tools/fs/read-sections.d.ts +11 -0
  323. package/dist/tools/fs/read-sections.js +71 -0
  324. package/dist/tools/fs/read-sections.js.map +1 -0
  325. package/dist/tools/fs/read-window.d.ts +1 -1
  326. package/dist/tools/fs/read-window.js +57 -25
  327. package/dist/tools/fs/read-window.js.map +1 -1
  328. package/dist/tools/fs/read.d.ts +0 -4
  329. package/dist/tools/fs/read.js +34 -17
  330. package/dist/tools/fs/read.js.map +1 -1
  331. package/dist/tools/fs.d.ts +2 -2
  332. package/dist/tools/fs.js +1 -2
  333. package/dist/tools/fs.js.map +1 -1
  334. package/dist/tools/handlers/files-1.js +11 -35
  335. package/dist/tools/handlers/files-1.js.map +1 -1
  336. package/dist/tools/handlers/files-2.js.map +1 -1
  337. package/dist/tools/handlers/shell-1.js +8 -2
  338. package/dist/tools/handlers/shell-1.js.map +1 -1
  339. package/dist/tools/jobs/types.d.ts +3 -0
  340. package/dist/tools/jobs.js +8 -1
  341. package/dist/tools/jobs.js.map +1 -1
  342. package/dist/tools/read-only-shell.d.ts +2 -0
  343. package/dist/tools/read-only-shell.js +65 -0
  344. package/dist/tools/read-only-shell.js.map +1 -0
  345. package/dist/tools/registry.js +0 -9
  346. package/dist/tools/registry.js.map +1 -1
  347. package/dist/tools/retired-tools.js +1 -1
  348. package/dist/tools/retired-tools.js.map +1 -1
  349. package/dist/tools/rtk/rewrite.d.ts +3 -2
  350. package/dist/tools/rtk/rewrite.js +4 -5
  351. package/dist/tools/rtk/rewrite.js.map +1 -1
  352. package/dist/tools/shell/exec-attempt.js +1 -0
  353. package/dist/tools/shell/exec-attempt.js.map +1 -1
  354. package/dist/tools/shell/spawn-argv.js +1 -1
  355. package/dist/tools/shell/spawn-argv.js.map +1 -1
  356. package/dist/tools/shell.d.ts +1 -0
  357. package/dist/tools/shell.js.map +1 -1
  358. package/dist/tui-v2/bootstrap/start-tui-v2.js +0 -2
  359. package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
  360. package/dist/tui-v2/components/modal/keys-modal.js +42 -6
  361. package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
  362. package/dist/tui-v2/components/pager/pager.js +36 -58
  363. package/dist/tui-v2/components/pager/pager.js.map +1 -1
  364. package/dist/tui-v2/components/transcript/tool-card.js +21 -19
  365. package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
  366. package/dist/tui-v2/components/transcript/transcript-view.js +24 -21
  367. package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
  368. package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +1 -0
  369. package/dist/tui-v2/components/transcript/use-transcript-selection.js +12 -1
  370. package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -1
  371. package/dist/types.d.ts +16 -1
  372. package/dist/types.js +1 -0
  373. package/dist/types.js.map +1 -1
  374. package/dist/ui/mentions/expand.js +1 -1
  375. package/dist/ui-core/actions/action-id.d.ts +1 -1
  376. package/dist/ui-core/actions/action-id.js +0 -2
  377. package/dist/ui-core/actions/action-id.js.map +1 -1
  378. package/dist/ui-core/actions/format-shortcuts.js +0 -2
  379. package/dist/ui-core/actions/format-shortcuts.js.map +1 -1
  380. package/dist/ui-core/actions/keymap.js +0 -6
  381. package/dist/ui-core/actions/keymap.js.map +1 -1
  382. package/dist/ui-core/bootstrap/composition-root.d.ts +0 -3
  383. package/dist/ui-core/bootstrap/composition-root.js +0 -8
  384. package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
  385. package/dist/ui-core/bootstrap/session-resume.d.ts +5 -0
  386. package/dist/ui-core/bootstrap/session-resume.js +13 -35
  387. package/dist/ui-core/bootstrap/session-resume.js.map +1 -1
  388. package/dist/ui-core/commands/command-handlers.js +3 -1
  389. package/dist/ui-core/commands/command-handlers.js.map +1 -1
  390. package/dist/ui-core/commands/config-commands.js +5 -1
  391. package/dist/ui-core/commands/config-commands.js.map +1 -1
  392. package/dist/ui-core/commands/key-commands.js +50 -30
  393. package/dist/ui-core/commands/key-commands.js.map +1 -1
  394. package/dist/ui-core/commands/keys/auth-picker.d.ts +3 -0
  395. package/dist/ui-core/commands/keys/auth-picker.js +29 -0
  396. package/dist/ui-core/commands/keys/auth-picker.js.map +1 -0
  397. package/dist/ui-core/commands/keys/qoder.d.ts +4 -0
  398. package/dist/ui-core/commands/keys/qoder.js +194 -0
  399. package/dist/ui-core/commands/keys/qoder.js.map +1 -0
  400. package/dist/ui-core/commands/picker-commands.js +19 -1
  401. package/dist/ui-core/commands/picker-commands.js.map +1 -1
  402. package/dist/ui-core/commands/prompt-commands.d.ts +2 -0
  403. package/dist/ui-core/commands/prompt-commands.js +10 -0
  404. package/dist/ui-core/commands/prompt-commands.js.map +1 -0
  405. package/dist/ui-core/commands/rtk-commands.js +35 -16
  406. package/dist/ui-core/commands/rtk-commands.js.map +1 -1
  407. package/dist/ui-core/commands/session-commands.js +13 -5
  408. package/dist/ui-core/commands/session-commands.js.map +1 -1
  409. package/dist/ui-core/controllers/overlay-controller.d.ts +7 -0
  410. package/dist/ui-core/controllers/overlay-controller.js +6 -0
  411. package/dist/ui-core/controllers/overlay-controller.js.map +1 -1
  412. package/dist/ui-core/rendering/batch-sections.d.ts +1 -1
  413. package/dist/ui-core/rendering/batch-sections.js +18 -4
  414. package/dist/ui-core/rendering/batch-sections.js.map +1 -1
  415. package/dist/ui-core/rendering/duration.js +1 -1
  416. package/dist/ui-core/rendering/duration.js.map +1 -1
  417. package/dist/ui-core/rendering/open-tool-output.js +4 -1
  418. package/dist/ui-core/rendering/open-tool-output.js.map +1 -1
  419. package/dist/ui-core/rendering/pager-source.js +3 -0
  420. package/dist/ui-core/rendering/pager-source.js.map +1 -1
  421. package/dist/ui-core/rendering/pager-text.js +3 -0
  422. package/dist/ui-core/rendering/pager-text.js.map +1 -1
  423. package/dist/ui-core/rendering/pager-view-policy.js +4 -2
  424. package/dist/ui-core/rendering/pager-view-policy.js.map +1 -1
  425. package/dist/ui-core/rendering/session-prompts-pager-source.d.ts +3 -0
  426. package/dist/ui-core/rendering/session-prompts-pager-source.js +40 -0
  427. package/dist/ui-core/rendering/session-prompts-pager-source.js.map +1 -0
  428. package/dist/ui-core/rendering/subagent-source.d.ts +1 -1
  429. package/dist/ui-core/rendering/subagent-source.js +37 -1
  430. package/dist/ui-core/rendering/subagent-source.js.map +1 -1
  431. package/dist/ui-core/rendering/text-width.d.ts +1 -0
  432. package/dist/ui-core/rendering/text-width.js +31 -0
  433. package/dist/ui-core/rendering/text-width.js.map +1 -1
  434. package/dist/ui-core/rendering/tool-presenter.d.ts +9 -4
  435. package/dist/ui-core/rendering/tool-presenter.js +43 -91
  436. package/dist/ui-core/rendering/tool-presenter.js.map +1 -1
  437. package/dist/ui-core/state/transcript-store.js +7 -2
  438. package/dist/ui-core/state/transcript-store.js.map +1 -1
  439. package/dist/ui-core/state/transcript-types.d.ts +1 -1
  440. package/dist/ui-core/state/transcript-types.js +4 -2
  441. package/dist/ui-core/state/transcript-types.js.map +1 -1
  442. package/dist/version.generated.d.ts +2 -2
  443. package/dist/version.generated.js +2 -2
  444. package/package.json +8 -3
  445. package/dist/agent/turn/pentest-tools.d.ts +0 -3
  446. package/dist/agent/turn/pentest-tools.js +0 -17
  447. package/dist/agent/turn/pentest-tools.js.map +0 -1
  448. package/dist/classic/bootstrap/suspend-port.d.ts +0 -14
  449. package/dist/classic/bootstrap/suspend-port.js +0 -29
  450. package/dist/classic/bootstrap/suspend-port.js.map +0 -1
  451. package/dist/tools/capabilities.d.ts +0 -12
  452. package/dist/tools/capabilities.js +0 -225
  453. package/dist/tools/capabilities.js.map +0 -1
  454. package/dist/tools/definitions/network.d.ts +0 -2
  455. package/dist/tools/definitions/network.js +0 -17
  456. package/dist/tools/definitions/network.js.map +0 -1
  457. package/dist/tools/definitions/orchestration.d.ts +0 -2
  458. package/dist/tools/definitions/orchestration.js +0 -27
  459. package/dist/tools/definitions/orchestration.js.map +0 -1
  460. package/dist/tools/fs/search.d.ts +0 -32
  461. package/dist/tools/fs/search.js +0 -431
  462. package/dist/tools/fs/search.js.map +0 -1
  463. package/dist/tools/handlers/network-3.d.ts +0 -2
  464. package/dist/tools/handlers/network-3.js +0 -13
  465. package/dist/tools/handlers/network-3.js.map +0 -1
  466. package/dist/tools/handlers/orchestration-2.d.ts +0 -2
  467. package/dist/tools/handlers/orchestration-2.js +0 -16
  468. package/dist/tools/handlers/orchestration-2.js.map +0 -1
  469. package/dist/tools/net-ping-sweep.d.ts +0 -18
  470. package/dist/tools/net-ping-sweep.js +0 -274
  471. package/dist/tools/net-ping-sweep.js.map +0 -1
  472. package/dist/tools/wordlists.d.ts +0 -6
  473. package/dist/tools/wordlists.js +0 -390
  474. package/dist/tools/wordlists.js.map +0 -1
  475. package/dist/tui-v2/bootstrap/pager-export.d.ts +0 -7
  476. package/dist/tui-v2/bootstrap/pager-export.js +0 -19
  477. package/dist/tui-v2/bootstrap/pager-export.js.map +0 -1
  478. package/dist/ui-core/ports/pager-export-port.d.ts +0 -16
  479. package/dist/ui-core/ports/pager-export-port.js +0 -68
  480. package/dist/ui-core/ports/pager-export-port.js.map +0 -1
  481. package/dist/ui-core/rendering/fs-search-summary.d.ts +0 -11
  482. package/dist/ui-core/rendering/fs-search-summary.js +0 -65
  483. package/dist/ui-core/rendering/fs-search-summary.js.map +0 -1
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ **[pentoshi007](https://github.com/pentoshi007)**.
64
+
65
+ All complaints will be reviewed and investigated promptly and fairly. All
66
+ community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,102 @@
1
+ # Contributing to clai
2
+
3
+ Contributions can improve the CLI, providers, tools, terminal interfaces, tests, or documentation. Keep a change focused, explain its effect on users, and include validation appropriate to the work.
4
+
5
+ Use [Issues](https://github.com/pentoshi007/clai/issues) for reproducible bugs and feature requests, and [Discussions](https://github.com/pentoshi007/clai/discussions) for questions. Follow the [Code of Conduct](CODE_OF_CONDUCT.md). Report vulnerabilities through the process in [SECURITY.md](SECURITY.md).
6
+
7
+ ## Source setup
8
+
9
+ Install Node.js 22 or later and npm. Bun is needed for OpenTUI development, native UI checks, and compiled release binaries; the [CI workflow](.github/workflows/ci.yml) specifies the version used for conformance checks. Classic development can run through Node and `tsx`.
10
+
11
+ Fork the repository, then clone your fork and install the locked dependencies:
12
+
13
+ ```sh
14
+ git clone https://github.com/<your-username>/clai.git
15
+ cd clai
16
+ git remote add upstream https://github.com/pentoshi007/clai.git
17
+ git switch -c docs/session-guide
18
+ npm ci
19
+ npm run dev
20
+ ```
21
+
22
+ `npm run dev` prefers Bun when available. Use `npm run dev -- --classic` for Classic, or `npm run dev:node -- --classic` to run it explicitly through Node.
23
+
24
+ The tests use fixtures, isolated storage, and a mocked browser launcher; provider credentials are not required and standard suites do not open sign-in tabs. Browser-launcher unit tests use injected process stubs to cover macOS, Linux, and Windows commands. For manual provider testing, configure a test account or export the relevant environment variables as described in [PROVIDERS.md](PROVIDERS.md).
25
+
26
+ ## Development commands
27
+
28
+ | Command | Purpose |
29
+ | --- | --- |
30
+ | `npm run dev` | Run the source entrypoint, preferring Bun. |
31
+ | `npm run dev:bun` | Run source through Bun explicitly. |
32
+ | `npm run dev:node` | Run source through Node and `tsx`. |
33
+ | `npm run typecheck` | Check TypeScript without emitting files. |
34
+ | `npm run build` | Embed prompts and compile JavaScript to `dist/`. |
35
+ | `npm start` | Run the built entrypoint. |
36
+ | `npm run test:deterministic` | Run Vitest with the canonical locale and timezone. |
37
+ | `npm run test:host -- test/environment` | Check environment behavior under the host's locale and timezone. |
38
+ | `npm run test:classic:pty` | Run the provider-independent POSIX terminal smoke test; requires Python 3. |
39
+ | `npm run test:bun` | Run native OpenTUI, buffered PTY input, and parity checks through Bun. |
40
+ | `npm run test:bun:session` | Verify complete UTF-8 input delivery through Bun's real PTY buffer. |
41
+ | `npm run embed-prompts:check` | Check that embedded prompts match their source Markdown. |
42
+ | `npm run release:verify` | Validate dependency pins, lockfile, and release metadata. |
43
+ | `npm run compile` | Build native release binaries through Bun. |
44
+ | `npm run doctor` | Inspect available tools and provider configuration. |
45
+
46
+ To run a focused test:
47
+
48
+ ```sh
49
+ npm run test:deterministic -- test/session-runtime/host.integration.test.ts
50
+ ```
51
+
52
+ For dependency changes, update `package.json` and `package-lock.json` together and run `npm run release:verify`. Preserve the repository's exact dependency pins.
53
+
54
+ ## Architecture and boundaries
55
+
56
+ | Location | Responsibility |
57
+ | --- | --- |
58
+ | `src/index.ts` | CLI options, subcommands, and startup. |
59
+ | `src/agent/` | Agent turns, plans, compaction, and subagents. |
60
+ | `src/llm/` | Provider protocols, credentials, streaming, routing, and usage. |
61
+ | `src/app/`, `src/ui-core/` | Shared controllers, commands, state, actions, and renderer ports. |
62
+ | `src/classic/` | React and Ink UI and its terminal lifecycle. |
63
+ | `src/tui-v2/` | OpenTUI components and native terminal integration. |
64
+ | `src/noninteractive/` | One-shot output and stdout/stderr policy. |
65
+ | `src/session-runtime/` | Durable agent hosts, shared attachments, discovery, and reattachment. |
66
+ | `src/interactive-session/` | Conversation-owned terminal sessions and transports. |
67
+ | `src/store/` | Configuration, history, prompt journals, plans, and retained subagent state. |
68
+ | `src/tools/`, `src/safety/` | Tool implementation, classification, permissions, and engagement policy. |
69
+ | `src/mcp/`, `src/skills/` | MCP integration and Agent Skills. |
70
+ | `src/prompts/` | Runtime system prompts and their generated embedded representation. |
71
+ | `test/`, `scripts/`, `.github/workflows/` | Regression tests, tooling, and CI/release workflows. |
72
+ | `bin/`, `install/`, `manifests/` | npm launchers, platform installers, and distribution templates. |
73
+
74
+ Keep `src/app/` and `src/ui-core/` renderer-neutral: do not import Ink, OpenTUI, renderer-specific components, or write directly to the terminal there. Put terminal access in bootstrap or port modules so both interfaces share session, command, transcript, safety, and persistence behavior. Classic source files are subject to a 400-line architecture guard.
75
+
76
+ Use strict TypeScript, explicit `.js` extensions for relative ESM imports, and focused modules that follow the surrounding style. Handle failures explicitly. Changes to persistence, compaction, or attachment behavior must preserve conversation records and avoid starting duplicate agent writers.
77
+
78
+ Distribution manifests under `manifests/` are templates. The release workflow generates published metadata; placeholder hashes in those templates are not installation artifacts.
79
+
80
+ ## Validation and pull requests
81
+
82
+ For behavior changes, add or update meaningful regression coverage and run the focused tests first. Run the relevant typecheck, build, deterministic suite, terminal checks, and release validation before submitting. UI changes should cover both renderers; process and privilege changes need the platform coverage defined in CI. Run native performance checks without competing build or full-suite workloads.
83
+
84
+ For documentation-only changes, check examples against current CLI help, validate links and formatting, and check any issue-template YAML. A full local application suite is unnecessary unless the change affects code, runtime prompts, or generated artifacts.
85
+
86
+ CI currently covers Node 22 and 24 on Linux, Bun OpenTUI conformance, Classic on macOS, and process/privilege behavior on macOS and Windows. The [workflow](.github/workflows/ci.yml) is the source of truth for required checks. All relevant remote checks must pass.
87
+
88
+ Open a pull request against `main` with:
89
+
90
+ - The concrete problem and resulting behavior, including an example when useful.
91
+ - Validation performed and any remaining limitations.
92
+ - Related issues and documentation updates where applicable.
93
+
94
+ Use descriptive commit messages; Conventional Commit prefixes such as `fix:`, `feat:`, and `docs:` are suitable. Keep generated build outputs, credentials, local history, investigation reports, and temporary files out of commits.
95
+
96
+ ## Reporting bugs and requesting features
97
+
98
+ The [bug report form](https://github.com/pentoshi007/clai/issues/new?template=bug_report.yml) asks for the clai version, OS, installation method, UI, and reproduction steps. Include Node or Bun versions when running through those runtimes, plus the provider/model when relevant. For attachment bugs, describe the SSH or terminal setup and which sessions were attached.
99
+
100
+ Provide the smallest reproduction and expected versus actual behavior. Review logs, screenshots, prompts, and configuration before sharing them; remove credentials and private project data.
101
+
102
+ The [feature request form](https://github.com/pentoshi007/clai/issues/new?template=feature_request.yml) asks for the problem, proposed behavior, and alternatives. Explain the workflow the change would improve.
package/PROVIDERS.md ADDED
@@ -0,0 +1,149 @@
1
+ # Provider setup
2
+
3
+ clai connects to hosted models through API credentials or account sign-in, and to local models through Ollama. This guide documents clai's configuration. Access, pricing, rate limits, and model availability are controlled by each provider and account.
4
+
5
+ Use `/provider` to switch providers, `/model` to select a model, `/models` to browse catalogs, and `/info <provider>` for the integration's setup details. Account-visible catalogs are used where supported, with cached or bundled choices when discovery is unavailable. A model appearing in a catalog does not guarantee your account can use it.
6
+
7
+ ## Account sign-in
8
+
9
+ | Integration | Command | Supported setup |
10
+ | --- | --- | --- |
11
+ | ChatGPT (Codex) | `clai auth chatgpt` | Browser or headless sign-in; `--import` reuses an existing Codex CLI login. The stored provider ID is `codex`. |
12
+ | GitHub Copilot | `clai auth copilot` | Browser/device sign-in or supported local credential import. |
13
+ | Cline | `clai auth cline` | Account sign-in or supported local credential import. |
14
+ | Kiro | `clai auth kiro` | Social login, AWS Builder ID, or IAM Identity Center; supported local sign-ins can be imported. |
15
+ | OmniRush | `clai auth omnirush` | Device-code sign-in; `--import` reuses an existing OmniRush CLI login. |
16
+ | Qoder | `clai auth qoder` | Browser or headless sign-in, Qoder CLI import, or personal access token via `--pat`. |
17
+ | Freebuff | `clai auth freebuff` | Browser/headless sign-in or token import; generation requires separate server admission. See [Freebuff](#freebuff). |
18
+
19
+ Authentication stores a credential; `clai use <provider>` selects the default provider:
20
+
21
+ ```sh
22
+ clai auth qoder --headless
23
+ clai use qoder
24
+ clai
25
+ ```
26
+
27
+ Use `clai auth <provider> --help` to inspect the flags. The flow and import sources depend on the integration; an upstream CLI is only needed for imports or features that explicitly invoke it.
28
+
29
+ ### ChatGPT
30
+
31
+ ```sh
32
+ clai auth chatgpt --headless
33
+ clai use chatgpt
34
+ ```
35
+
36
+ `/model` uses the account-visible catalog where available, including model context limits and supported reasoning levels. `/usage` shows subscription limits, reset times, and credits when the account reports them. These account allowances are separate from session token totals. OpenAI API credentials use the separate `openai` integration.
37
+
38
+ ### Qoder
39
+
40
+ ```sh
41
+ clai auth qoder --import
42
+ clai use qoder
43
+ ```
44
+
45
+ `--import` reuses a Qoder CLI sign-in. `clai auth qoder --pat` prompts for a personal access token with hidden input. Browser and headless methods are also available.
46
+
47
+ Select reasoning with `/effort`, for example `/effort xhigh`. clai sends Qoder's native thinking controls using the selected effort and renders streamed reasoning when the model provides it. Model capabilities and account limits still determine what is available.
48
+
49
+ ### Freebuff
50
+
51
+ Freebuff sign-in and model discovery are supported. Generation first requests a server session with a zero wallet-spend limit. Admission can be refused because of server compatibility, account restrictions, concurrent-session limits, quota, or model availability; successful sign-in and a visible model catalog do not establish inference access.
52
+
53
+ If generation is refused, follow the provider's message, use a supported Freebuff client, or choose another clai provider. Freebuff is excluded from automatic cross-provider fallback. clai does not automatically approve wallet-spend consent.
54
+
55
+ `clai auth freebuff --import` checks `FREEBUFF_API_KEY`, `CODEBUFF_API_KEY`, and supported upstream credentials, including `~/.config/manicode/credentials.json`. `FREEBUFF_CONFIG_DIR` can select the upstream configuration directory.
56
+
57
+ ### OmniRush lifecycle uploads
58
+
59
+ For OmniRush sessions, clai can invoke the installed, signed-in OmniRush CLI after turns and at session close. The uploaded workspace is generated from lifecycle metadata: session ID, sequence, phase, status, and timestamp. It does not include project source, prompts, or the tool-output transcript.
60
+
61
+ Disable this feature with `CLAI_OMNIRUSH_SESSION_UPLOAD=0`. It is also disabled by private mode and `--no-history`. `OMNIRUSH_CLI_PATH` selects a custom executable. A missing CLI or login failure produces a notice without failing the agent turn.
62
+
63
+ ## API credentials
64
+
65
+ `clai set <provider>` prompts for a key with hidden input. To import an existing environment variable:
66
+
67
+ ```sh
68
+ clai set gemini --from-env GEMINI_API_KEY
69
+ clai use gemini
70
+ ```
71
+
72
+ An environment credential is also used directly when no stored credentials take precedence. The table lists canonical provider IDs and recognized environment variables; it avoids pinning model names or prices that can change independently of clai.
73
+
74
+ | Integration | Provider ID | Environment variable |
75
+ | --- | --- | --- |
76
+ | Keyless Free | `free` | None required; optional `FREE_API_KEY`. |
77
+ | Anthropic | `anthropic` | `ANTHROPIC_API_KEY` |
78
+ | DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` |
79
+ | Google Gemini | `gemini` | `GEMINI_API_KEY` |
80
+ | GLM / Zhipu | `glm` | `GLM_API_KEY`, `ZHIPU_API_KEY`, or `ZAI_API_KEY` |
81
+ | Kimi / Moonshot | `kimi` | `KIMI_API_KEY` or `MOONSHOT_API_KEY` |
82
+ | MiniMax | `minimax` | `MINIMAX_API_KEY` |
83
+ | Xiaomi MiMo | `mimo` | `MIMO_API_KEY` |
84
+ | NVIDIA NIM | `nvidia` | `NVIDIA_API_KEY` |
85
+ | OpenAI | `openai` | `OPENAI_API_KEY` |
86
+ | OpenRouter | `openrouter` | `OPENROUTER_API_KEY` |
87
+ | Qwen Cloud / DashScope | `qwen-cloud` | `DASHSCOPE_API_KEY` |
88
+ | AgentRouter | `agentrouter` | `AGENTROUTER_API_KEY` |
89
+ | AWS Mantle | `aws-mantle` | `ANTHROPIC_API_KEY` for this integration's configured endpoint. |
90
+ | Bynara | `bynara` | `BYNARA_API_KEY` |
91
+ | ExpLabs | `explabs` | `EXPLABS_API_KEY` |
92
+ | Fireworks | `fireworks` | `FIREWORKS_API_KEY` |
93
+ | Hetzner | `hetzner` | `HETZNER_API_KEY` |
94
+ | Lightning AI | `lightning` | `LIGHTNING_API_KEY` |
95
+ | Merge Gateway | `merge-gateway` | `MERGE_GATEWAY_API_KEY` |
96
+ | Meta Model API | `meta` | `MODEL_API_KEY` |
97
+ | Modal | `modal` | Both `MODAL_PROXY_TOKEN_ID` and `MODAL_PROXY_TOKEN_SECRET`. |
98
+ | OrcaRouter | `orcarouter` | `ORCAROUTER_API_KEY` |
99
+ | Token Harbor | `tokenharbor` | `TOKENHARBOR_API_KEY` |
100
+ | TokenRouter | `tokenrouter` | `TOKENROUTER_API_KEY` |
101
+ | Vercel AI Gateway | `vercel` | `AI_GATEWAY_API_KEY` |
102
+
103
+ For model choice, use `/model` or `clai model <name>`. Use the `/provider` picker's custom-provider option to add an OpenAI-compatible endpoint.
104
+
105
+ ### Local and configurable endpoints
106
+
107
+ Ollama uses `OLLAMA_HOST` or an explicitly saved URL:
108
+
109
+ ```sh
110
+ clai set ollama --url http://localhost:11434
111
+ clai use ollama
112
+ clai model <downloaded-model>
113
+ ```
114
+
115
+ Modal needs the URL of your deployed endpoint in addition to its credentials:
116
+
117
+ ```sh
118
+ clai set modal --url https://your-deployment.example.com --from-env MODAL_CREDENTIAL
119
+ ```
120
+
121
+ Here, `MODAL_CREDENTIAL` contains `token-id:token-secret`. Alternatively, supply both native Modal environment variables and configure the endpoint URL separately. `MODAL_BASE_URL` is also supported. Lightning, TokenRouter, and Token Harbor support configured endpoints and the corresponding `LIGHTNING_BASE_URL`, `TOKENROUTER_BASE_URL`, and `TOKENHARBOR_BASE_URL` variables.
122
+
123
+ ## Credential management and fallback
124
+
125
+ - Repeating `clai set <provider>` adds credentials, up to 10 per provider. `--stdin` reads a credential from standard input; `--skip-ping` saves it without provider validation.
126
+ - `/set` opens the key editor. Select an active key or disable a key without deleting it; disabled keys are skipped during rotation.
127
+ - `clai keys` and `/keys` display masked credentials. `clai unset <provider>` removes stored credentials; environment credentials remain available while set in the launching environment.
128
+ - Applicable authentication, quota, rate-limit, and server failures can rotate credentials. The most recently successful credential is preferred.
129
+ - Cross-provider fallback is opt-in through `/fallback on`. `/freeonly on` restricts fallback by clai's configured provider categories; this filter does not determine a model's price or account bill.
130
+
131
+ Saved credentials are retained in the plaintext recovery file `~/.clai/keys.json`, with restricted POSIX permissions, and are also written to the OS keyring when available. See [configuration and privacy](README.md#configuration-and-privacy).
132
+
133
+ ## Web search
134
+
135
+ Web search is configured independently from the model provider.
136
+
137
+ | Search backend | Environment variable |
138
+ | --- | --- |
139
+ | DuckDuckGo | None required; initial default. |
140
+ | Brave | `BRAVE_SEARCH_API_KEY` |
141
+ | Tavily | `TAVILY_API_KEY` |
142
+ | Exa | `EXA_API_KEY` |
143
+
144
+ ```sh
145
+ clai set tavily --from-env TAVILY_API_KEY
146
+ clai search-provider tavily
147
+ ```
148
+
149
+ In the interactive console, `/search` opens the search picker; `/search <provider>` switches directly and `/search-provider` is an alias.