@humain/terminal 0.0.17 → 0.1.0

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 (367) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/bun/cli.d.ts +3 -1
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +3 -8
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/bun/runtime-setup.d.ts +2 -0
  7. package/dist/bun/runtime-setup.d.ts.map +1 -0
  8. package/dist/bun/runtime-setup.js +9 -0
  9. package/dist/bun/runtime-setup.js.map +1 -0
  10. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  11. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  12. package/dist/bun/sandbox-env-setup.js +4 -0
  13. package/dist/bun/sandbox-env-setup.js.map +1 -0
  14. package/dist/bundle/chunks/anthropic-messages-XULXUBIG.js +6 -0
  15. package/dist/bundle/chunks/{azure-openai-responses-ZN52D6YC.js → azure-openai-responses-JEG2XOYC.js} +1 -1
  16. package/dist/bundle/chunks/bedrock-converse-stream.js +6 -6
  17. package/dist/bundle/chunks/{chunk-ARF4OE6X.js → chunk-2LC3S3VV.js} +8 -8
  18. package/dist/bundle/chunks/chunk-43O5DDAH.js +31 -0
  19. package/dist/bundle/chunks/{chunk-H2O6VOXT.js → chunk-46DC2JD6.js} +2 -2
  20. package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  21. package/dist/bundle/chunks/{chunk-WJZ4KLGL.js → chunk-E6KP6V7F.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-PSKDLDLZ.js → chunk-HPPQHK3J.js} +3 -3
  23. package/dist/bundle/chunks/chunk-JUPSJTFQ.js +42 -0
  24. package/dist/bundle/chunks/chunk-PL7O7J4J.js +133 -0
  25. package/dist/bundle/chunks/{chunk-PFVS5ZYL.js → chunk-RM336IEI.js} +378 -369
  26. package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
  27. package/dist/bundle/chunks/{extract-2L7ZVN7F.js → extract-TRW5FBY6.js} +2 -2
  28. package/dist/bundle/chunks/github-copilot.js +1 -1
  29. package/dist/bundle/chunks/{google-generative-ai-FF7M7XHT.js → google-generative-ai-OX6VSCA6.js} +1 -1
  30. package/dist/bundle/chunks/{google-vertex-YMUBFRBA.js → google-vertex-GW76GSS2.js} +1 -1
  31. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  32. package/dist/bundle/chunks/{mistral-conversations-O4M7IQML.js → mistral-conversations-WXGXZOFJ.js} +1 -1
  33. package/dist/bundle/chunks/node-AUOGOBCN.js +2 -0
  34. package/dist/bundle/chunks/node-KOIP55YZ.js +16 -0
  35. package/dist/bundle/chunks/openai-codex-responses-NPLWP6ZC.js +10 -0
  36. package/dist/bundle/chunks/{openai-completions-L4AHDQ5D.js → openai-completions-OT2GTJKC.js} +3 -3
  37. package/dist/bundle/chunks/openai-responses-5A6CR7GI.js +2 -0
  38. package/dist/bundle/chunks/{openrouter-images-Y2PCWAQH.js → openrouter-images-YLQ4RJ2F.js} +1 -1
  39. package/dist/bundle/chunks/{pi-messages-57K43J6J.js → pi-messages-OJF77SY3.js} +1 -1
  40. package/dist/bundle/chunks/{undici-D6ABF53Q.js → undici-KA2LJNVT.js} +1 -1
  41. package/dist/bundle/chunks/webapi-RFAXLI2D.js +5 -0
  42. package/dist/bundle/cli.js +1 -1
  43. package/dist/bundle/index.js +1 -1
  44. package/dist/bundle/rpc-entry.js +1 -1
  45. package/dist/cli/config-selector.d.ts.map +1 -1
  46. package/dist/cli/config-selector.js +2 -1
  47. package/dist/cli/config-selector.js.map +1 -1
  48. package/dist/cli/setup.d.ts +2 -0
  49. package/dist/cli/setup.d.ts.map +1 -0
  50. package/dist/cli/setup.js +13 -0
  51. package/dist/cli/setup.js.map +1 -0
  52. package/dist/cli.js +2 -14
  53. package/dist/cli.js.map +1 -1
  54. package/dist/config.d.ts +1 -0
  55. package/dist/config.d.ts.map +1 -1
  56. package/dist/config.js +1 -0
  57. package/dist/config.js.map +1 -1
  58. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  59. package/dist/core/agent-session-runtime.js +15 -7
  60. package/dist/core/agent-session-runtime.js.map +1 -1
  61. package/dist/core/agent-session.d.ts +2 -6
  62. package/dist/core/agent-session.d.ts.map +1 -1
  63. package/dist/core/agent-session.js +14 -6
  64. package/dist/core/agent-session.js.map +1 -1
  65. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  66. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  67. package/dist/core/compaction/branch-summarization.js +2 -1
  68. package/dist/core/compaction/branch-summarization.js.map +1 -1
  69. package/dist/core/extensions/loader.d.ts.map +1 -1
  70. package/dist/core/extensions/loader.js +1 -2
  71. package/dist/core/extensions/loader.js.map +1 -1
  72. package/dist/core/extensions/types.d.ts +8 -2
  73. package/dist/core/extensions/types.d.ts.map +1 -1
  74. package/dist/core/extensions/types.js.map +1 -1
  75. package/dist/core/http-dispatcher.d.ts.map +1 -1
  76. package/dist/core/http-dispatcher.js +2 -0
  77. package/dist/core/http-dispatcher.js.map +1 -1
  78. package/dist/core/keybindings.d.ts +5 -0
  79. package/dist/core/keybindings.d.ts.map +1 -1
  80. package/dist/core/keybindings.js +4 -0
  81. package/dist/core/keybindings.js.map +1 -1
  82. package/dist/core/messages.d.ts +1 -1
  83. package/dist/core/messages.d.ts.map +1 -1
  84. package/dist/core/messages.js.map +1 -1
  85. package/dist/core/model-config.d.ts +15 -0
  86. package/dist/core/model-config.d.ts.map +1 -1
  87. package/dist/core/model-config.js +3 -0
  88. package/dist/core/model-config.js.map +1 -1
  89. package/dist/core/model-runtime.d.ts +1 -0
  90. package/dist/core/model-runtime.d.ts.map +1 -1
  91. package/dist/core/model-runtime.js +5 -2
  92. package/dist/core/model-runtime.js.map +1 -1
  93. package/dist/core/provider-composer.d.ts.map +1 -1
  94. package/dist/core/provider-composer.js +8 -2
  95. package/dist/core/provider-composer.js.map +1 -1
  96. package/dist/core/session-manager.d.ts +3 -2
  97. package/dist/core/session-manager.d.ts.map +1 -1
  98. package/dist/core/session-manager.js +40 -13
  99. package/dist/core/session-manager.js.map +1 -1
  100. package/dist/core/settings-manager.js.map +1 -1
  101. package/dist/core/skills.d.ts +1 -1
  102. package/dist/core/skills.d.ts.map +1 -1
  103. package/dist/core/skills.js +4 -2
  104. package/dist/core/skills.js.map +1 -1
  105. package/dist/core/system-prompt.d.ts.map +1 -1
  106. package/dist/core/system-prompt.js +8 -9
  107. package/dist/core/system-prompt.js.map +1 -1
  108. package/dist/core/tools/bash.d.ts.map +1 -1
  109. package/dist/core/tools/bash.js +3 -120
  110. package/dist/core/tools/bash.js.map +1 -1
  111. package/dist/core/tools/edit.d.ts +1 -12
  112. package/dist/core/tools/edit.d.ts.map +1 -1
  113. package/dist/core/tools/edit.js +5 -163
  114. package/dist/core/tools/edit.js.map +1 -1
  115. package/dist/core/tools/find.d.ts.map +1 -1
  116. package/dist/core/tools/find.js +4 -55
  117. package/dist/core/tools/find.js.map +1 -1
  118. package/dist/core/tools/grep.d.ts.map +1 -1
  119. package/dist/core/tools/grep.js +4 -60
  120. package/dist/core/tools/grep.js.map +1 -1
  121. package/dist/core/tools/ls.d.ts.map +1 -1
  122. package/dist/core/tools/ls.js +4 -49
  123. package/dist/core/tools/ls.js.map +1 -1
  124. package/dist/core/tools/read.d.ts.map +1 -1
  125. package/dist/core/tools/read.js +4 -120
  126. package/dist/core/tools/read.js.map +1 -1
  127. package/dist/core/tools/renderers/bash.d.ts +12 -0
  128. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  129. package/dist/core/tools/renderers/bash.js +133 -0
  130. package/dist/core/tools/renderers/bash.js.map +1 -0
  131. package/dist/core/tools/renderers/edit.d.ts +23 -0
  132. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  133. package/dist/core/tools/renderers/edit.js +167 -0
  134. package/dist/core/tools/renderers/edit.js.map +1 -0
  135. package/dist/core/tools/renderers/find.d.ts +10 -0
  136. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  137. package/dist/core/tools/renderers/find.js +64 -0
  138. package/dist/core/tools/renderers/find.js.map +1 -0
  139. package/dist/core/tools/renderers/grep.d.ts +10 -0
  140. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  141. package/dist/core/tools/renderers/grep.js +69 -0
  142. package/dist/core/tools/renderers/grep.js.map +1 -0
  143. package/dist/core/tools/renderers/index.d.ts +22 -0
  144. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  145. package/dist/core/tools/renderers/index.js +48 -0
  146. package/dist/core/tools/renderers/index.js.map +1 -0
  147. package/dist/core/tools/renderers/ls.d.ts +10 -0
  148. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  149. package/dist/core/tools/renderers/ls.js +58 -0
  150. package/dist/core/tools/renderers/ls.js.map +1 -0
  151. package/dist/core/tools/renderers/read.d.ts +11 -0
  152. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  153. package/dist/core/tools/renderers/read.js +129 -0
  154. package/dist/core/tools/renderers/read.js.map +1 -0
  155. package/dist/core/tools/renderers/write.d.ts +10 -0
  156. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  157. package/dist/core/tools/renderers/write.js +152 -0
  158. package/dist/core/tools/renderers/write.js.map +1 -0
  159. package/dist/core/tools/subagent-worktree.d.ts +1 -0
  160. package/dist/core/tools/subagent-worktree.d.ts.map +1 -1
  161. package/dist/core/tools/subagent-worktree.js +25 -1
  162. package/dist/core/tools/subagent-worktree.js.map +1 -1
  163. package/dist/core/tools/subagent.d.ts.map +1 -1
  164. package/dist/core/tools/subagent.js +5 -2
  165. package/dist/core/tools/subagent.js.map +1 -1
  166. package/dist/core/tools/write.d.ts.map +1 -1
  167. package/dist/core/tools/write.js +5 -145
  168. package/dist/core/tools/write.js.map +1 -1
  169. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +51 -12
  170. package/dist/humain/mcp-adapter/vendor/package.json +2 -2
  171. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  172. package/dist/humain/web-access/vendor/curator-page.js +3 -1
  173. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  174. package/dist/humain/web-access/vendor/curator-server.d.ts +2 -0
  175. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  176. package/dist/humain/web-access/vendor/curator-server.js +4 -2
  177. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  178. package/dist/humain/web-access/vendor/gemini-search.d.ts +2 -2
  179. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  180. package/dist/humain/web-access/vendor/gemini-search.js +11 -4
  181. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  182. package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
  183. package/dist/humain/web-access/vendor/github-extract.js +238 -1
  184. package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
  185. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  186. package/dist/humain/web-access/vendor/index.js +118 -64
  187. package/dist/humain/web-access/vendor/index.js.map +1 -1
  188. package/dist/humain/web-access/vendor/mistral-search.d.ts +4 -0
  189. package/dist/humain/web-access/vendor/mistral-search.d.ts.map +1 -0
  190. package/dist/humain/web-access/vendor/mistral-search.js +274 -0
  191. package/dist/humain/web-access/vendor/mistral-search.js.map +1 -0
  192. package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
  193. package/dist/humain/web-access/vendor/perplexity.js +12 -1
  194. package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
  195. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  196. package/dist/humain/web-access/vendor/utils.js +1 -2
  197. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  198. package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
  199. package/dist/humain/web-access/vendor/xai-search.js +92 -35
  200. package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
  201. package/dist/index.d.ts +1 -1
  202. package/dist/index.d.ts.map +1 -1
  203. package/dist/index.js.map +1 -1
  204. package/dist/main.d.ts.map +1 -1
  205. package/dist/main.js +4 -1
  206. package/dist/main.js.map +1 -1
  207. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  208. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  209. package/dist/modes/interactive/chat-viewport.js +28 -0
  210. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  211. package/dist/modes/interactive/components/assistant-message.d.ts +1 -0
  212. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  213. package/dist/modes/interactive/components/assistant-message.js +18 -10
  214. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  215. package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
  216. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  217. package/dist/modes/interactive/components/custom-editor.js +37 -1
  218. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  219. package/dist/modes/interactive/components/index.d.ts +1 -1
  220. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  221. package/dist/modes/interactive/components/index.js.map +1 -1
  222. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  223. package/dist/modes/interactive/components/model-selector.js +8 -17
  224. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  225. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  226. package/dist/modes/interactive/components/scoped-models-selector.js +21 -23
  227. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  228. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  229. package/dist/modes/interactive/components/settings-selector.js +14 -10
  230. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  231. package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
  232. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  233. package/dist/modes/interactive/components/status-indicator.js +10 -3
  234. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  235. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  236. package/dist/modes/interactive/components/thinking-selector.js +4 -4
  237. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  238. package/dist/modes/interactive/components/tool-execution.d.ts +21 -4
  239. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  240. package/dist/modes/interactive/components/tool-execution.js +34 -32
  241. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  242. package/dist/modes/interactive/components/trust-selector.js +2 -2
  243. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  244. package/dist/modes/interactive/interactive-mode.d.ts +8 -15
  245. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  246. package/dist/modes/interactive/interactive-mode.js +96 -81
  247. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  248. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  249. package/dist/modes/interactive/session-share.js +8 -12
  250. package/dist/modes/interactive/session-share.js.map +1 -1
  251. package/dist/modes/interactive/theme/dark.json +2 -1
  252. package/dist/modes/interactive/theme/light.json +2 -1
  253. package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
  254. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  255. package/dist/modes/interactive/theme/theme-controller.js +5 -0
  256. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  257. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  258. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  259. package/dist/modes/interactive/theme/theme-json.js +130 -0
  260. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  261. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  262. package/dist/modes/interactive/theme/theme.d.ts +14 -5
  263. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  264. package/dist/modes/interactive/theme/theme.js +18 -119
  265. package/dist/modes/interactive/theme/theme.js.map +1 -1
  266. package/dist/modes/interactive/tui-renderer.d.ts +21 -0
  267. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  268. package/dist/modes/interactive/tui-renderer.js +66 -0
  269. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  270. package/dist/utils/exif-orientation.d.ts.map +1 -1
  271. package/dist/utils/exif-orientation.js +2 -3
  272. package/dist/utils/exif-orientation.js.map +1 -1
  273. package/dist/utils/tools-manager.d.ts +1 -0
  274. package/dist/utils/tools-manager.d.ts.map +1 -1
  275. package/dist/utils/tools-manager.js +41 -19
  276. package/dist/utils/tools-manager.js.map +1 -1
  277. package/docs/containerization.md +45 -0
  278. package/docs/development.md +19 -0
  279. package/docs/environment-variables.md +2 -0
  280. package/docs/extensions.md +5 -2
  281. package/docs/keybindings.md +5 -2
  282. package/docs/models.md +4 -1
  283. package/docs/rpc.md +1 -1
  284. package/docs/sdk.md +5 -0
  285. package/docs/settings.md +3 -3
  286. package/docs/skills.md +1 -1
  287. package/docs/terminal-setup.md +15 -0
  288. package/docs/themes.md +8 -6
  289. package/docs/tui.md +19 -0
  290. package/examples/README.md +3 -0
  291. package/examples/extensions/custom-provider-anthropic/package-lock.json +84 -84
  292. package/examples/extensions/custom-provider-anthropic/package.json +17 -17
  293. package/examples/extensions/custom-provider-gitlab-duo/package.json +14 -14
  294. package/examples/extensions/dynamic-resources/dynamic.json +2 -0
  295. package/examples/extensions/gondolin/package-lock.json +8 -8
  296. package/examples/extensions/gondolin/package.json +1 -1
  297. package/examples/extensions/sandbox/package-lock.json +6 -6
  298. package/examples/extensions/sandbox/package.json +2 -2
  299. package/examples/extensions/with-deps/package-lock.json +29 -29
  300. package/examples/extensions/with-deps/package.json +20 -20
  301. package/examples/plugins/pi-example-plugin/README.md +38 -0
  302. package/examples/plugins/pi-example-plugin/package.json +10 -0
  303. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  304. package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  305. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  306. package/npm-shrinkwrap.json +772 -205
  307. package/package.json +31 -24
  308. package/src/humain/web-access/UPSTREAM.md +12 -1
  309. package/src/humain/web-access/upstream.json +4 -4
  310. package/dist/bundle/chunks/anthropic-messages-M4LCS3KH.js +0 -6
  311. package/dist/bundle/chunks/chunk-3VI4HD7D.js +0 -31
  312. package/dist/bundle/chunks/chunk-BOW22LW6.js +0 -42
  313. package/dist/bundle/chunks/chunk-CBHC6EL7.js +0 -133
  314. package/dist/bundle/chunks/chunk-JUUC5AZY.js +0 -2
  315. package/dist/bundle/chunks/node-ZHY4LHC7.js +0 -15
  316. package/dist/bundle/chunks/openai-codex-responses-HRVCDY54.js +0 -8
  317. package/dist/bundle/chunks/openai-responses-4MWLJHIK.js +0 -2
  318. package/dist/bundle/chunks/webapi-AFS5FDJJ.js +0 -5
  319. package/dist/bundle/client.js +0 -2
  320. package/dist/cli/experimental/auth.d.ts +0 -16
  321. package/dist/cli/experimental/auth.d.ts.map +0 -1
  322. package/dist/cli/experimental/auth.js +0 -13
  323. package/dist/cli/experimental/auth.js.map +0 -1
  324. package/dist/cli/experimental/cli.d.ts +0 -6
  325. package/dist/cli/experimental/cli.d.ts.map +0 -1
  326. package/dist/cli/experimental/cli.js +0 -5
  327. package/dist/cli/experimental/cli.js.map +0 -1
  328. package/dist/cli/experimental/command-options.d.ts +0 -17
  329. package/dist/cli/experimental/command-options.d.ts.map +0 -1
  330. package/dist/cli/experimental/command-options.js +0 -35
  331. package/dist/cli/experimental/command-options.js.map +0 -1
  332. package/dist/cli/experimental/command.d.ts +0 -63
  333. package/dist/cli/experimental/command.d.ts.map +0 -1
  334. package/dist/cli/experimental/command.js +0 -127
  335. package/dist/cli/experimental/command.js.map +0 -1
  336. package/dist/cli/experimental/commands/client.d.ts +0 -13
  337. package/dist/cli/experimental/commands/client.d.ts.map +0 -1
  338. package/dist/cli/experimental/commands/client.js +0 -25
  339. package/dist/cli/experimental/commands/client.js.map +0 -1
  340. package/dist/cli/experimental/commands/pi.d.ts +0 -15
  341. package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
  342. package/dist/cli/experimental/commands/pi.js +0 -28
  343. package/dist/cli/experimental/commands/pi.js.map +0 -1
  344. package/dist/cli/experimental/commands/server.d.ts +0 -13
  345. package/dist/cli/experimental/commands/server.d.ts.map +0 -1
  346. package/dist/cli/experimental/commands/server.js +0 -25
  347. package/dist/cli/experimental/commands/server.js.map +0 -1
  348. package/dist/cli/experimental/transport-address.d.ts +0 -10
  349. package/dist/cli/experimental/transport-address.d.ts.map +0 -1
  350. package/dist/cli/experimental/transport-address.js +0 -38
  351. package/dist/cli/experimental/transport-address.js.map +0 -1
  352. package/dist/client/index.d.ts +0 -3
  353. package/dist/client/index.d.ts.map +0 -1
  354. package/dist/client/index.js +0 -3
  355. package/dist/client/index.js.map +0 -1
  356. package/dist/client/remote-session.d.ts +0 -53
  357. package/dist/client/remote-session.d.ts.map +0 -1
  358. package/dist/client/remote-session.js +0 -340
  359. package/dist/client/remote-session.js.map +0 -1
  360. package/dist/client/transcript.d.ts +0 -12
  361. package/dist/client/transcript.d.ts.map +0 -1
  362. package/dist/client/transcript.js +0 -98
  363. package/dist/client/transcript.js.map +0 -1
  364. package/dist/server/create-harness.d.ts +0 -26
  365. package/dist/server/create-harness.d.ts.map +0 -1
  366. package/dist/server/create-harness.js +0 -106
  367. package/dist/server/create-harness.js.map +0 -1
@@ -7,7 +7,7 @@ import * as fs from "node:fs";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import * as TuiLayouts from "@earendil-works/pi-tui";
10
- import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
10
+ import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
11
11
  import chalk from "chalk";
12
12
  import { spawn } from "child_process";
13
13
  import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
@@ -26,19 +26,20 @@ import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../cor
26
26
  import { SessionManager, sessionEntryToContextMessages } from "../../core/session-manager.js";
27
27
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
28
28
  import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
29
+ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
29
30
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
30
31
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
31
32
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
32
33
  import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
33
34
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
34
35
  import { parseGitUrl } from "../../utils/git.js";
35
- import { openBrowser } from "../../utils/open-browser.js";
36
36
  import { getCwdRelativePath } from "../../utils/paths.js";
37
37
  import { getPiUserAgent } from "../../utils/pi-user-agent.js";
38
38
  import { killTrackedDetachedChildren } from "../../utils/shell.js";
39
39
  import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
40
40
  import { ensureTool } from "../../utils/tools-manager.js";
41
41
  import { checkForNewPiVersion } from "../../utils/version-check.js";
42
+ import { createChatViewport } from "./chat-viewport.js";
42
43
  import { ArminComponent } from "./components/armin.js";
43
44
  import { AssistantMessageComponent } from "./components/assistant-message.js";
44
45
  import { BashExecutionComponent } from "./components/bash-execution.js";
@@ -76,6 +77,14 @@ import { getModelSearchText } from "./model-search.js";
76
77
  import { shareSession } from "./session-share.js";
77
78
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
78
79
  import { InteractiveThemeController } from "./theme/theme-controller.js";
80
+ import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
81
+ export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
82
+ function isWorkingStatusEditor(editor) {
83
+ return ("embedWorkingStatus" in editor &&
84
+ editor.embedWorkingStatus === true &&
85
+ "setWorkingStatusIndicator" in editor &&
86
+ typeof editor.setWorkingStatusIndicator === "function");
87
+ }
79
88
  function isExpandable(obj) {
80
89
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
81
90
  }
@@ -175,61 +184,6 @@ function formatLoginProviderCompletionDescription(provider) {
175
184
  const authTypes = provider.authTypes.map(formatAuthSelectorProviderType).join("/");
176
185
  return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
177
186
  }
178
- /** Composition root for selecting the interactive terminal renderer. */
179
- export function createInteractiveTui(options) {
180
- const terminal = options.terminal ?? new ProcessTerminal();
181
- if (options.tuiMode === "fullscreen") {
182
- const styleSearchMatch = (text) => theme.bg("searchMatchBg", theme.fg("searchMatchText", text));
183
- return new TuiAltScreen(terminal, options.showHardwareCursor, options.logDirectory, {
184
- searchMatchStyle: (text) => theme.underline(styleSearchMatch(text)),
185
- searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
186
- openUrl: openBrowser,
187
- onRightClickPaste: options.onRightClickPaste,
188
- copyOnSelect: options.fullscreenCopyOnSelect,
189
- copySelection: async (text) => {
190
- try {
191
- await copyToClipboard(text);
192
- return true;
193
- }
194
- catch {
195
- return false;
196
- }
197
- },
198
- });
199
- }
200
- return new TuiMainScreen(terminal, options.showHardwareCursor, options.logDirectory);
201
- }
202
- /** Stable reference for components while InteractiveMode replaces the active renderer. */
203
- export function createInteractiveTuiReference(getTui) {
204
- return new Proxy({}, {
205
- get: (_target, property) => {
206
- const tui = getTui();
207
- const value = Reflect.get(tui, property, tui);
208
- if (typeof value !== "function")
209
- return value;
210
- let methodTui = tui;
211
- let method = value;
212
- return (...args) => {
213
- const currentTui = getTui();
214
- if (currentTui !== methodTui) {
215
- const currentMethod = Reflect.get(currentTui, property, currentTui);
216
- if (typeof currentMethod !== "function") {
217
- throw new TypeError(`TUI property ${String(property)} is not callable`);
218
- }
219
- methodTui = currentTui;
220
- method = currentMethod;
221
- }
222
- return Reflect.apply(method, methodTui, args);
223
- };
224
- },
225
- set: (_target, property, value) => {
226
- const tui = getTui();
227
- return Reflect.set(tui, property, value, tui);
228
- },
229
- has: (_target, property) => Reflect.has(getTui(), property),
230
- getPrototypeOf: () => Reflect.getPrototypeOf(getTui()),
231
- });
232
- }
233
187
  export class InteractiveMode {
234
188
  // Convenience accessors
235
189
  get session() {
@@ -249,11 +203,12 @@ export class InteractiveMode {
249
203
  this.isInitialized = false;
250
204
  this.pendingUserInputs = [];
251
205
  this.activeStatusIndicator = undefined;
206
+ this.activeWorkingIndicatorEmbedded = false;
252
207
  this.idleStatus = new IdleStatus();
253
208
  this.workingMessage = undefined;
254
209
  this.workingVisible = true;
255
210
  this.workingIndicatorOptions = undefined;
256
- this.defaultWorkingMessage = "Working...";
211
+ this.defaultWorkingMessage = "Working";
257
212
  this.defaultHiddenThinkingLabel = "Thinking...";
258
213
  this.hiddenThinkingLabel = this.defaultHiddenThinkingLabel;
259
214
  this.lastSigintTime = 0;
@@ -355,6 +310,7 @@ export class InteractiveMode {
355
310
  this.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
356
311
  paddingX: editorPaddingX,
357
312
  autocompleteMaxVisible,
313
+ embedWorkingStatus: true,
358
314
  });
359
315
  this.editor = this.defaultEditor;
360
316
  this.editorContainer = new Container();
@@ -626,25 +582,20 @@ export class InteractiveMode {
626
582
  }
627
583
  // Keep one component tree and remount it when changing renderers.
628
584
  this.renderWidgets(); // Initialize with default spacer
629
- this.transcriptScrollView = new TuiLayouts.ScrollView(this.documentContainer, {
630
- follow: "end",
631
- primary: true,
632
- overscroll: "chain",
585
+ const viewport = createChatViewport({
586
+ document: this.documentContainer,
587
+ pendingMessages: this.pendingMessagesContainer,
588
+ status: this.statusContainer,
589
+ widgetsAbove: this.widgetContainerAbove,
590
+ editor: this.editorContainer,
591
+ widgetsBelow: this.widgetContainerBelow,
592
+ footer: this.footerContainer,
633
593
  scrollbar: this.settingsManager.getFullscreenScrollbar(),
634
- scrollbarStyle: (text) => theme.bg("scrollbarThumb", text),
594
+ scrollbarTrackStyle: (text) => theme.fg("scrollbarTrack", text),
595
+ scrollbarThumbStyle: (text) => theme.fg("scrollbarThumb", text),
635
596
  });
636
- const dock = new TuiLayouts.VStack([
637
- { component: this.pendingMessagesContainer, shrink: 1, minSize: 0 },
638
- { component: this.statusContainer, shrink: 1, minSize: 0 },
639
- { component: this.widgetContainerAbove, shrink: 1, minSize: 0 },
640
- { component: this.editorContainer, shrink: 1, minSize: 3 },
641
- { component: this.widgetContainerBelow, shrink: 1, minSize: 0 },
642
- { component: this.footerContainer, shrink: 1, minSize: 1 },
643
- ]);
644
- this.fullscreenLayoutRoot = new TuiLayouts.VStack([
645
- { component: this.transcriptScrollView, basis: 0, grow: 1, shrink: 1, minSize: 1 },
646
- { component: dock, basis: "auto", grow: 0, shrink: 1, minSize: 1 },
647
- ]);
597
+ this.transcriptScrollView = viewport.transcript;
598
+ this.fullscreenLayoutRoot = viewport.root;
648
599
  this.mountInteractiveTui(this.renderer, [
649
600
  this.documentContainer,
650
601
  this.pendingMessagesContainer,
@@ -697,7 +648,7 @@ export class InteractiveMode {
697
648
  hint("app.tools.expand", "more"),
698
649
  ].join(theme.fg("muted", " · "));
699
650
  const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
700
- const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
651
+ const onboarding = theme.fg("dim", `${APP_NAME} can explain its own features and look up its docs. Ask it how to use or extend ${APP_NAME}.`);
701
652
  this.builtInHeader = new ExpandableText(() => `${logo}\n${compactInstructions}\n${compactOnboarding}\n\n${onboarding}`, () => `${logo}\n${expandedInstructions}\n\n${onboarding}`, this.getStartupExpansionState(), 1, 0);
702
653
  // Setup UI layout
703
654
  this.headerContainer.addChild(new Spacer(1));
@@ -1556,8 +1507,12 @@ export class InteractiveMode {
1556
1507
  /**
1557
1508
  * Get a registered tool definition by name (for custom rendering).
1558
1509
  */
1510
+ /**
1511
+ * Extension-registered definition, falling back to the built-in one. The renderer components take
1512
+ * whatever this returns, so they never reach into the tool registry themselves.
1513
+ */
1559
1514
  getRegisteredToolDefinition(toolName) {
1560
- return this.session.getToolDefinition(toolName);
1515
+ return withBuiltInRenderers(toolName, this.session.getToolDefinition(toolName));
1561
1516
  }
1562
1517
  getMarkdownTransformers() {
1563
1518
  return [this.mermaidMarkdownTransformer, ...this.session.extensionRunner.getMarkdownTransformers()];
@@ -1627,26 +1582,48 @@ export class InteractiveMode {
1627
1582
  this.footerDataProvider.setExtensionStatus(key, text);
1628
1583
  this.ui.requestRender();
1629
1584
  }
1585
+ setEditorWorkingStatusIndicator(indicator) {
1586
+ this.defaultEditor.setWorkingStatusIndicator(undefined);
1587
+ if (!isWorkingStatusEditor(this.editor))
1588
+ return false;
1589
+ this.editor.setWorkingStatusIndicator(indicator);
1590
+ return true;
1591
+ }
1630
1592
  showStatusIndicator(indicator) {
1631
1593
  this.activeStatusIndicator?.dispose();
1632
1594
  this.activeStatusIndicator = indicator;
1595
+ this.activeWorkingIndicatorEmbedded = false;
1633
1596
  this.statusContainer.clear();
1597
+ this.setEditorWorkingStatusIndicator(undefined);
1598
+ if (indicator instanceof WorkingStatusIndicator && this.setEditorWorkingStatusIndicator(indicator)) {
1599
+ this.activeWorkingIndicatorEmbedded = true;
1600
+ return;
1601
+ }
1634
1602
  this.statusContainer.addChild(indicator);
1635
1603
  }
1636
1604
  clearStatusIndicator(kind) {
1637
1605
  if (kind && this.activeStatusIndicator?.kind !== kind) {
1638
1606
  return;
1639
1607
  }
1640
- const hadActiveStatusIndicator = this.activeStatusIndicator !== undefined;
1641
- this.activeStatusIndicator?.dispose();
1608
+ const clearedIndicator = this.activeStatusIndicator;
1609
+ const clearedIndicatorWasEmbedded = clearedIndicator?.kind === "working" && this.activeWorkingIndicatorEmbedded;
1610
+ clearedIndicator?.dispose();
1642
1611
  this.activeStatusIndicator = undefined;
1612
+ this.activeWorkingIndicatorEmbedded = false;
1643
1613
  this.statusContainer.clear();
1644
- if (hadActiveStatusIndicator && this.options.tuiMode === "regular" && this.ui.getClearOnShrink()) {
1614
+ this.setEditorWorkingStatusIndicator(undefined);
1615
+ if (clearedIndicator &&
1616
+ !clearedIndicatorWasEmbedded &&
1617
+ this.options.tuiMode === "regular" &&
1618
+ this.ui.getClearOnShrink()) {
1645
1619
  this.statusContainer.addChild(this.idleStatus);
1646
1620
  }
1647
1621
  }
1648
1622
  showWorkingStatusIndicator() {
1649
- this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
1623
+ const colorFn = isWorkingStatusEditor(this.editor)
1624
+ ? (text) => (this.editor.borderColor ?? theme.getThinkingBorderColor(this.session.thinkingLevel || "off"))(text)
1625
+ : undefined;
1626
+ this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions, colorFn));
1650
1627
  }
1651
1628
  setWorkingVisible(visible) {
1652
1629
  this.workingVisible = visible;
@@ -2118,6 +2095,13 @@ export class InteractiveMode {
2118
2095
  this.editor = this.defaultEditor;
2119
2096
  }
2120
2097
  this.editorContainer.addChild(this.editor);
2098
+ if (this.activeStatusIndicator instanceof WorkingStatusIndicator) {
2099
+ this.statusContainer.clear();
2100
+ this.activeWorkingIndicatorEmbedded = this.setEditorWorkingStatusIndicator(this.activeStatusIndicator);
2101
+ if (!this.activeWorkingIndicatorEmbedded) {
2102
+ this.statusContainer.addChild(this.activeStatusIndicator);
2103
+ }
2104
+ }
2121
2105
  this.ui.setFocus(this.editor);
2122
2106
  this.ui.requestRender();
2123
2107
  }
@@ -2659,6 +2643,7 @@ export class InteractiveMode {
2659
2643
  for (const [, component] of this.pendingTools.entries()) {
2660
2644
  component.setArgsComplete();
2661
2645
  }
2646
+ this.maybeShowAssistantDiagnostics(this.streamingMessage);
2662
2647
  this.maybeShowCacheMissNotice(this.streamingMessage);
2663
2648
  }
2664
2649
  this.streamingComponent = undefined;
@@ -3022,6 +3007,7 @@ export class InteractiveMode {
3022
3007
  }
3023
3008
  }
3024
3009
  if (message.stopReason !== "aborted" && message.stopReason !== "error") {
3010
+ this.maybeShowAssistantDiagnostics(message);
3025
3011
  const miss = cacheMisses.get(message);
3026
3012
  if (miss)
3027
3013
  this.addCacheMissNotice(miss);
@@ -3078,6 +3064,32 @@ export class InteractiveMode {
3078
3064
  this.chatContainer.addChild(new Spacer(1));
3079
3065
  this.chatContainer.addChild(new Text(theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3080
3066
  }
3067
+ maybeShowAssistantDiagnostics(message) {
3068
+ if (!this.settingsManager.getShowCacheMissNotices())
3069
+ return;
3070
+ for (const diagnostic of message.diagnostics ?? []) {
3071
+ if (diagnostic.type !== "anthropic_input_transformations")
3072
+ continue;
3073
+ const transformations = diagnostic.details?.transformations;
3074
+ if (!Array.isArray(transformations))
3075
+ continue;
3076
+ const dropped = transformations.flatMap((transformation) => {
3077
+ if (typeof transformation !== "object" || transformation === null)
3078
+ return [];
3079
+ const details = transformation;
3080
+ if (details.type !== "thinking_dropped")
3081
+ return [];
3082
+ const reason = typeof details.reason === "string" ? details.reason : "unknown reason";
3083
+ const location = typeof details.path === "string" ? ` at ${details.path}` : "";
3084
+ return [`${reason}${location}`];
3085
+ });
3086
+ if (dropped.length === 0)
3087
+ continue;
3088
+ const noun = dropped.length === 1 ? "thinking block" : `${dropped.length} thinking blocks`;
3089
+ this.chatContainer.addChild(new Spacer(1));
3090
+ this.chatContainer.addChild(new Text(theme.fg("warning", `Anthropic dropped ${noun}: ${dropped.join("; ")}`), 1, 0));
3091
+ }
3092
+ }
3081
3093
  /**
3082
3094
  * Show a transcript notice when a completed assistant message paid for a
3083
3095
  * significant cache miss. Only states observable facts: the miss itself,
@@ -3369,6 +3381,9 @@ export class InteractiveMode {
3369
3381
  const level = this.session.thinkingLevel || "off";
3370
3382
  this.editor.borderColor = theme.getThinkingBorderColor(level);
3371
3383
  }
3384
+ if (this.activeStatusIndicator?.kind === "working") {
3385
+ this.activeStatusIndicator.invalidate();
3386
+ }
3372
3387
  this.ui.requestRender();
3373
3388
  }
3374
3389
  cycleThinkingLevel() {