orient-cli 0.3.0 → 0.3.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 (1134) hide show
  1. package/dist/integrations/notebooklm/notebooklm-extension.js +3 -8
  2. package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
  3. package/dist/integrations/playwright/playwright-extension.js +4 -14
  4. package/dist/integrations/playwright/playwright-extension.js.map +1 -1
  5. package/dist/integrations/web-search/bridge.js +12 -23
  6. package/dist/integrations/web-search/bridge.js.map +1 -1
  7. package/dist/integrations/web-search/web-search-extension.js +0 -3
  8. package/dist/integrations/web-search/web-search-extension.js.map +1 -1
  9. package/dist/orient/orient-extension.js +6 -14
  10. package/dist/orient/orient-extension.js.map +1 -1
  11. package/package.json +3 -10
  12. package/scripts/postinstall.mjs +40 -1
  13. package/vendor/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -0
  14. package/vendor/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -0
  15. package/vendor/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -0
  16. package/vendor/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -0
  17. package/vendor/@orient-cli/coding-agent/dist/cli/args.js.map +1 -0
  18. package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -0
  19. package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -0
  20. package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -0
  21. package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -0
  22. package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +18 -0
  23. package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -0
  24. package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -0
  25. package/vendor/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -0
  26. package/vendor/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -0
  27. package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -0
  28. package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -0
  29. package/vendor/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -0
  30. package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli.js +0 -0
  31. package/vendor/@orient-cli/coding-agent/dist/cli.js.map +1 -0
  32. package/vendor/@orient-cli/coding-agent/dist/config.d.ts.map +1 -0
  33. package/vendor/@orient-cli/coding-agent/dist/config.js +251 -0
  34. package/vendor/@orient-cli/coding-agent/dist/config.js.map +1 -0
  35. package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -0
  36. package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +231 -0
  37. package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -0
  38. package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -0
  39. package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -0
  40. package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts +617 -0
  41. package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -0
  42. package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js +2477 -0
  43. package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -0
  44. package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +136 -0
  45. package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -0
  46. package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js +418 -0
  47. package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -0
  48. package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -0
  49. package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -0
  50. package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  51. package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
  52. package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
  53. package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -0
  54. package/vendor/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -0
  55. package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
  56. package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -0
  57. package/vendor/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -0
  58. package/vendor/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -0
  59. package/vendor/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -0
  60. package/vendor/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -0
  61. package/vendor/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -0
  62. package/vendor/@orient-cli/coding-agent/dist/core/exec.js.map +1 -0
  63. package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  64. package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
  65. package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -0
  66. package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -0
  67. package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  68. package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
  69. package/vendor/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -0
  70. package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
  71. package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -0
  72. package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
  73. package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js +695 -0
  74. package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -0
  75. package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -0
  76. package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -0
  77. package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
  78. package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -0
  79. package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
  80. package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js +313 -0
  81. package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -0
  82. package/vendor/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -0
  83. package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts +293 -0
  84. package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -0
  85. package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js +247 -0
  86. package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -0
  87. package/vendor/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -0
  88. package/vendor/@orient-cli/coding-agent/dist/core/messages.js.map +1 -0
  89. package/vendor/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -0
  90. package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js +612 -0
  91. package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -0
  92. package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -0
  93. package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -0
  94. package/vendor/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -0
  95. package/vendor/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -0
  96. package/vendor/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -0
  97. package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js +1823 -0
  98. package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -0
  99. package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
  100. package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -0
  101. package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
  102. package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -0
  103. package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -0
  104. package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js +681 -0
  105. package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -0
  106. package/vendor/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -0
  107. package/vendor/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -0
  108. package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -0
  109. package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js +37 -0
  110. package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -0
  111. package/vendor/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -0
  112. package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js +1101 -0
  113. package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -0
  114. package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -0
  115. package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js +699 -0
  116. package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -0
  117. package/vendor/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -0
  118. package/vendor/@orient-cli/coding-agent/dist/core/skills.js.map +1 -0
  119. package/vendor/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -0
  120. package/vendor/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -0
  121. package/vendor/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -0
  122. package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -0
  123. package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -0
  124. package/vendor/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -0
  125. package/vendor/@orient-cli/coding-agent/dist/core/timings.js.map +1 -0
  126. package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -0
  127. package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js +355 -0
  128. package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -0
  129. package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
  130. package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -0
  131. package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -0
  132. package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -0
  133. package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  134. package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -0
  135. package/vendor/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -0
  136. package/vendor/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -0
  137. package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -0
  138. package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -0
  139. package/vendor/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -0
  140. package/vendor/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -0
  141. package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -0
  142. package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -0
  143. package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
  144. package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -0
  145. package/vendor/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -0
  146. package/vendor/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -0
  147. package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -0
  148. package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -0
  149. package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  150. package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  151. package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
  152. package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -0
  153. package/vendor/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -0
  154. package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js +215 -0
  155. package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -0
  156. package/vendor/@orient-cli/coding-agent/dist/index.d.ts.map +1 -0
  157. package/vendor/@orient-cli/coding-agent/dist/main.d.ts.map +1 -0
  158. package/vendor/@orient-cli/coding-agent/dist/main.js.map +1 -0
  159. package/vendor/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -0
  160. package/vendor/@orient-cli/coding-agent/dist/migrations.js.map +1 -0
  161. package/vendor/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -0
  162. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  163. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +102 -0
  164. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
  165. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  166. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +170 -0
  167. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
  168. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  169. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +48 -0
  170. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  171. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  172. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +42 -0
  173. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  174. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  175. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +43 -0
  176. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  177. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  178. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +470 -0
  179. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
  180. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  181. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +28 -0
  182. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  183. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  184. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +63 -0
  185. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
  186. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  187. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +74 -0
  188. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
  189. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
  190. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
  191. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  192. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +20 -0
  193. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  194. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  195. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +106 -0
  196. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
  197. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  198. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +55 -0
  199. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
  200. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  201. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +71 -0
  202. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
  203. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
  204. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +199 -0
  205. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
  206. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
  207. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -0
  208. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  209. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  210. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  211. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +139 -0
  212. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
  213. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  214. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +263 -0
  215. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
  216. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  217. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +92 -0
  218. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  219. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -0
  220. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -0
  221. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  222. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +271 -0
  223. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  224. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  225. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  226. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  227. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +823 -0
  228. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
  229. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  230. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +299 -0
  231. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
  232. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  233. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +38 -0
  234. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  235. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  236. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +45 -0
  237. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  238. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  239. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +48 -0
  240. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
  241. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  242. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +50 -0
  243. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  244. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  245. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +261 -0
  246. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
  247. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  248. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +1070 -0
  249. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
  250. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  251. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +110 -0
  252. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  253. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  254. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
  255. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  256. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  257. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +359 -0
  258. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  259. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +4081 -0
  260. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
  261. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  262. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +973 -0
  263. package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
  264. package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -0
  265. package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -0
  266. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
  267. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
  268. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  269. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +401 -0
  270. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
  271. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  272. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
  273. package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  274. package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -0
  275. package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -0
  276. package/vendor/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -0
  277. package/vendor/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -0
  278. package/vendor/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -0
  279. package/vendor/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -0
  280. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
  281. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -0
  282. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
  283. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -0
  284. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -0
  285. package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -0
  286. package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -0
  287. package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -0
  288. package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
  289. package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -0
  290. package/vendor/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -0
  291. package/vendor/@orient-cli/coding-agent/dist/utils/git.js.map +1 -0
  292. package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -0
  293. package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -0
  294. package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -0
  295. package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -0
  296. package/vendor/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -0
  297. package/vendor/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -0
  298. package/vendor/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -0
  299. package/vendor/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -0
  300. package/vendor/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -0
  301. package/vendor/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -0
  302. package/vendor/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -0
  303. package/vendor/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -0
  304. package/vendor/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -0
  305. package/vendor/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -0
  306. package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
  307. package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -0
  308. package/node_modules/@orient-cli/agent-core/README.md +0 -456
  309. package/node_modules/@orient-cli/ai/README.md +0 -1315
  310. package/node_modules/@orient-cli/coding-agent/README.md +0 -618
  311. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +0 -1
  312. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js.map +0 -1
  313. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +0 -1
  314. package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts.map +0 -1
  315. package/node_modules/@orient-cli/coding-agent/dist/cli/args.js.map +0 -1
  316. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +0 -1
  317. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js.map +0 -1
  318. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +0 -1
  319. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js.map +0 -1
  320. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +0 -18
  321. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +0 -1
  322. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js.map +0 -1
  323. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +0 -1
  324. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js.map +0 -1
  325. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +0 -1
  326. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js.map +0 -1
  327. package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts.map +0 -1
  328. package/node_modules/@orient-cli/coding-agent/dist/cli.js.map +0 -1
  329. package/node_modules/@orient-cli/coding-agent/dist/config.d.ts.map +0 -1
  330. package/node_modules/@orient-cli/coding-agent/dist/config.js +0 -229
  331. package/node_modules/@orient-cli/coding-agent/dist/config.js.map +0 -1
  332. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +0 -1
  333. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +0 -236
  334. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +0 -1
  335. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +0 -1
  336. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +0 -1
  337. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts +0 -585
  338. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +0 -1
  339. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js +0 -2497
  340. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js.map +0 -1
  341. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +0 -132
  342. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +0 -1
  343. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js +0 -422
  344. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js.map +0 -1
  345. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +0 -1
  346. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js.map +0 -1
  347. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +0 -1
  348. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +0 -1
  349. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +0 -1
  350. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +0 -1
  351. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +0 -1
  352. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +0 -1
  353. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +0 -1
  354. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +0 -1
  355. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +0 -1
  356. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +0 -1
  357. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js.map +0 -1
  358. package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts.map +0 -1
  359. package/node_modules/@orient-cli/coding-agent/dist/core/exec.js.map +0 -1
  360. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
  361. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +0 -1
  362. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +0 -1
  363. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js.map +0 -1
  364. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.css +0 -1001
  365. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.html +0 -55
  366. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.js +0 -1690
  367. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +0 -1
  368. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +0 -1
  369. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +0 -1213
  370. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +0 -6
  371. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +0 -1
  372. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +0 -1
  373. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +0 -1
  374. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +0 -1
  375. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js +0 -701
  376. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +0 -1
  377. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +0 -1
  378. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js.map +0 -1
  379. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +0 -1
  380. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +0 -1
  381. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +0 -1
  382. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js +0 -314
  383. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +0 -1
  384. package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts.map +0 -1
  385. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts +0 -293
  386. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +0 -1
  387. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js +0 -248
  388. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js.map +0 -1
  389. package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts.map +0 -1
  390. package/node_modules/@orient-cli/coding-agent/dist/core/messages.js.map +0 -1
  391. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +0 -1
  392. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js +0 -612
  393. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js.map +0 -1
  394. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +0 -1
  395. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js.map +0 -1
  396. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +0 -1
  397. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js.map +0 -1
  398. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +0 -1
  399. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js +0 -1829
  400. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js.map +0 -1
  401. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +0 -1
  402. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +0 -1
  403. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +0 -1
  404. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +0 -1
  405. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +0 -1
  406. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js +0 -720
  407. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js.map +0 -1
  408. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +0 -1
  409. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js.map +0 -1
  410. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +0 -1
  411. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js +0 -38
  412. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js.map +0 -1
  413. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +0 -1
  414. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js +0 -1105
  415. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js.map +0 -1
  416. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +0 -1
  417. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js +0 -708
  418. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js.map +0 -1
  419. package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts.map +0 -1
  420. package/node_modules/@orient-cli/coding-agent/dist/core/skills.js.map +0 -1
  421. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +0 -1
  422. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +0 -1
  423. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js.map +0 -1
  424. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +0 -1
  425. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js.map +0 -1
  426. package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts.map +0 -1
  427. package/node_modules/@orient-cli/coding-agent/dist/core/timings.js.map +0 -1
  428. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +0 -1
  429. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js +0 -352
  430. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js.map +0 -1
  431. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +0 -1
  432. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +0 -1
  433. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +0 -1
  434. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js.map +0 -1
  435. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
  436. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +0 -1
  437. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +0 -1
  438. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js.map +0 -1
  439. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +0 -1
  440. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js.map +0 -1
  441. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +0 -1
  442. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js.map +0 -1
  443. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +0 -1
  444. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js.map +0 -1
  445. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +0 -1
  446. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +0 -1
  447. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +0 -1
  448. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js.map +0 -1
  449. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +0 -1
  450. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +0 -1
  451. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
  452. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +0 -1
  453. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +0 -1
  454. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +0 -1
  455. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +0 -1
  456. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js +0 -216
  457. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js.map +0 -1
  458. package/node_modules/@orient-cli/coding-agent/dist/index.d.ts.map +0 -1
  459. package/node_modules/@orient-cli/coding-agent/dist/main.d.ts.map +0 -1
  460. package/node_modules/@orient-cli/coding-agent/dist/main.js.map +0 -1
  461. package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts.map +0 -1
  462. package/node_modules/@orient-cli/coding-agent/dist/migrations.js.map +0 -1
  463. package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts.map +0 -1
  464. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
  465. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +0 -107
  466. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +0 -1
  467. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
  468. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +0 -175
  469. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +0 -1
  470. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
  471. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +0 -51
  472. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +0 -1
  473. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
  474. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +0 -44
  475. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
  476. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
  477. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +0 -45
  478. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
  479. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
  480. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +0 -479
  481. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +0 -1
  482. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
  483. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +0 -33
  484. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +0 -1
  485. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
  486. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +0 -70
  487. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +0 -1
  488. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
  489. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +0 -79
  490. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +0 -1
  491. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +0 -1
  492. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +0 -1
  493. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
  494. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +0 -21
  495. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +0 -1
  496. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
  497. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +0 -111
  498. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +0 -1
  499. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
  500. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +0 -61
  501. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +0 -1
  502. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
  503. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +0 -78
  504. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +0 -1
  505. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +0 -1
  506. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +0 -201
  507. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +0 -1
  508. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +0 -1
  509. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +0 -1
  510. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
  511. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
  512. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
  513. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +0 -145
  514. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +0 -1
  515. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
  516. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +0 -275
  517. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +0 -1
  518. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
  519. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +0 -97
  520. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +0 -1
  521. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +0 -1
  522. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +0 -1
  523. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
  524. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +0 -275
  525. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
  526. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
  527. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +0 -1
  528. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
  529. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +0 -848
  530. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +0 -1
  531. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
  532. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +0 -301
  533. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +0 -1
  534. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
  535. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +0 -39
  536. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +0 -1
  537. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
  538. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +0 -47
  539. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
  540. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
  541. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +0 -50
  542. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +0 -1
  543. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
  544. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +0 -51
  545. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +0 -1
  546. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
  547. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +0 -274
  548. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +0 -1
  549. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
  550. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +0 -1084
  551. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +0 -1
  552. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
  553. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +0 -113
  554. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +0 -1
  555. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +0 -1
  556. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +0 -1
  557. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
  558. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +0 -1
  559. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +0 -345
  560. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
  561. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +0 -4106
  562. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +0 -1
  563. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/dark.json +0 -85
  564. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/light.json +0 -84
  565. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
  566. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +0 -1
  567. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +0 -979
  568. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +0 -1
  569. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +0 -1
  570. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js.map +0 -1
  571. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +0 -1
  572. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +0 -1
  573. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +0 -1
  574. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +0 -402
  575. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +0 -1
  576. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
  577. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +0 -1
  578. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +0 -1
  579. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +0 -1
  580. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js.map +0 -1
  581. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +0 -1
  582. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js.map +0 -1
  583. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +0 -1
  584. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js.map +0 -1
  585. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +0 -1
  586. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +0 -1
  587. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +0 -1
  588. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +0 -1
  589. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +0 -1
  590. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js.map +0 -1
  591. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +0 -1
  592. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +0 -1
  593. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +0 -1
  594. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +0 -1
  595. package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts.map +0 -1
  596. package/node_modules/@orient-cli/coding-agent/dist/utils/git.js.map +0 -1
  597. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +0 -1
  598. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js.map +0 -1
  599. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +0 -1
  600. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js.map +0 -1
  601. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +0 -1
  602. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js.map +0 -1
  603. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +0 -1
  604. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js.map +0 -1
  605. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +0 -1
  606. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js.map +0 -1
  607. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +0 -1
  608. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js.map +0 -1
  609. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +0 -1
  610. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js.map +0 -1
  611. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +0 -1
  612. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +0 -1
  613. package/node_modules/@orient-cli/tui/README.md +0 -767
  614. package/node_modules/mime-db/HISTORY.md +0 -541
  615. package/node_modules/mime-db/LICENSE +0 -23
  616. package/node_modules/mime-db/README.md +0 -109
  617. package/node_modules/mime-db/db.json +0 -9342
  618. package/node_modules/mime-db/index.js +0 -12
  619. package/node_modules/mime-db/package.json +0 -56
  620. package/node_modules/mime-types/HISTORY.md +0 -428
  621. package/node_modules/mime-types/LICENSE +0 -23
  622. package/node_modules/mime-types/README.md +0 -126
  623. package/node_modules/mime-types/index.js +0 -211
  624. package/node_modules/mime-types/mimeScore.js +0 -57
  625. package/node_modules/mime-types/package.json +0 -49
  626. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.d.ts +0 -0
  627. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.d.ts.map +0 -0
  628. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.js +0 -0
  629. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.js.map +0 -0
  630. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.d.ts +0 -0
  631. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.d.ts.map +0 -0
  632. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.js +0 -0
  633. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.js.map +0 -0
  634. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.d.ts +0 -0
  635. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.d.ts.map +0 -0
  636. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.js +0 -0
  637. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.js.map +0 -0
  638. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.d.ts +0 -0
  639. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.d.ts.map +0 -0
  640. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.js +0 -0
  641. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.js.map +0 -0
  642. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.d.ts +0 -0
  643. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.d.ts.map +0 -0
  644. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.js +0 -0
  645. /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.js.map +0 -0
  646. /package/{node_modules → vendor}/@orient-cli/agent-core/package.json +0 -0
  647. /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.d.ts +0 -0
  648. /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.d.ts.map +0 -0
  649. /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.js +0 -0
  650. /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.js.map +0 -0
  651. /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.d.ts +0 -0
  652. /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.d.ts.map +0 -0
  653. /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.js +0 -0
  654. /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.js.map +0 -0
  655. /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.d.ts +0 -0
  656. /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.d.ts.map +0 -0
  657. /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.js +0 -0
  658. /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.js.map +0 -0
  659. /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.d.ts +0 -0
  660. /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.d.ts.map +0 -0
  661. /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.js +0 -0
  662. /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.js.map +0 -0
  663. /package/{node_modules → vendor}/@orient-cli/ai/dist/index.d.ts +0 -0
  664. /package/{node_modules → vendor}/@orient-cli/ai/dist/index.d.ts.map +0 -0
  665. /package/{node_modules → vendor}/@orient-cli/ai/dist/index.js +0 -0
  666. /package/{node_modules → vendor}/@orient-cli/ai/dist/index.js.map +0 -0
  667. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.d.ts +0 -0
  668. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.d.ts.map +0 -0
  669. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.d.ts +0 -0
  670. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.d.ts.map +0 -0
  671. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.js +0 -0
  672. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.js.map +0 -0
  673. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.js +0 -0
  674. /package/{node_modules → vendor}/@orient-cli/ai/dist/models.js.map +0 -0
  675. /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.d.ts +0 -0
  676. /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.d.ts.map +0 -0
  677. /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.js +0 -0
  678. /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.js.map +0 -0
  679. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts +0 -0
  680. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts.map +0 -0
  681. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.js +0 -0
  682. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.js.map +0 -0
  683. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.d.ts +0 -0
  684. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.d.ts.map +0 -0
  685. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.js +0 -0
  686. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.js.map +0 -0
  687. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts +0 -0
  688. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts.map +0 -0
  689. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.js +0 -0
  690. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.js.map +0 -0
  691. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.d.ts +0 -0
  692. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.d.ts.map +0 -0
  693. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.js +0 -0
  694. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.js.map +0 -0
  695. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts +0 -0
  696. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts.map +0 -0
  697. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.js +0 -0
  698. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.js.map +0 -0
  699. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts +0 -0
  700. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts.map +0 -0
  701. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.js +0 -0
  702. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.js.map +0 -0
  703. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.d.ts +0 -0
  704. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.d.ts.map +0 -0
  705. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.js +0 -0
  706. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.js.map +0 -0
  707. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.d.ts +0 -0
  708. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.d.ts.map +0 -0
  709. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.js +0 -0
  710. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.js.map +0 -0
  711. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.d.ts +0 -0
  712. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.d.ts.map +0 -0
  713. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.js +0 -0
  714. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.js.map +0 -0
  715. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.d.ts +0 -0
  716. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.d.ts.map +0 -0
  717. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.js +0 -0
  718. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.js.map +0 -0
  719. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts +0 -0
  720. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts.map +0 -0
  721. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.js +0 -0
  722. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.js.map +0 -0
  723. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.d.ts +0 -0
  724. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.d.ts.map +0 -0
  725. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.js +0 -0
  726. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.js.map +0 -0
  727. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts +0 -0
  728. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts.map +0 -0
  729. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.js +0 -0
  730. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.js.map +0 -0
  731. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.d.ts +0 -0
  732. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.d.ts.map +0 -0
  733. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.js +0 -0
  734. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.js.map +0 -0
  735. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.d.ts +0 -0
  736. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.d.ts.map +0 -0
  737. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.js +0 -0
  738. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.js.map +0 -0
  739. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.d.ts +0 -0
  740. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.d.ts.map +0 -0
  741. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.js +0 -0
  742. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.js.map +0 -0
  743. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.d.ts +0 -0
  744. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.d.ts.map +0 -0
  745. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.js +0 -0
  746. /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.js.map +0 -0
  747. /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.d.ts +0 -0
  748. /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.d.ts.map +0 -0
  749. /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.js +0 -0
  750. /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.js.map +0 -0
  751. /package/{node_modules → vendor}/@orient-cli/ai/dist/types.d.ts +0 -0
  752. /package/{node_modules → vendor}/@orient-cli/ai/dist/types.d.ts.map +0 -0
  753. /package/{node_modules → vendor}/@orient-cli/ai/dist/types.js +0 -0
  754. /package/{node_modules → vendor}/@orient-cli/ai/dist/types.js.map +0 -0
  755. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.d.ts +0 -0
  756. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.d.ts.map +0 -0
  757. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.js +0 -0
  758. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.js.map +0 -0
  759. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.d.ts +0 -0
  760. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.d.ts.map +0 -0
  761. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.js +0 -0
  762. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.js.map +0 -0
  763. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.d.ts +0 -0
  764. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.d.ts.map +0 -0
  765. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.js +0 -0
  766. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.js.map +0 -0
  767. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts +0 -0
  768. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts.map +0 -0
  769. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.js +0 -0
  770. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.js.map +0 -0
  771. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts +0 -0
  772. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts.map +0 -0
  773. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.js +0 -0
  774. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.js.map +0 -0
  775. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts +0 -0
  776. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts.map +0 -0
  777. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.js +0 -0
  778. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.js.map +0 -0
  779. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts +0 -0
  780. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts.map +0 -0
  781. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js +0 -0
  782. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js.map +0 -0
  783. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.d.ts +0 -0
  784. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.d.ts.map +0 -0
  785. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.js +0 -0
  786. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.js.map +0 -0
  787. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts +0 -0
  788. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts.map +0 -0
  789. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.js +0 -0
  790. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.js.map +0 -0
  791. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts +0 -0
  792. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts.map +0 -0
  793. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.js +0 -0
  794. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.js.map +0 -0
  795. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.d.ts +0 -0
  796. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.d.ts.map +0 -0
  797. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.js +0 -0
  798. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.js.map +0 -0
  799. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.d.ts +0 -0
  800. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.d.ts.map +0 -0
  801. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.js +0 -0
  802. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.js.map +0 -0
  803. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.d.ts +0 -0
  804. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.d.ts.map +0 -0
  805. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.js +0 -0
  806. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.js.map +0 -0
  807. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts +0 -0
  808. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts.map +0 -0
  809. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.js +0 -0
  810. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.js.map +0 -0
  811. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.d.ts +0 -0
  812. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.d.ts.map +0 -0
  813. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.js +0 -0
  814. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.js.map +0 -0
  815. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.d.ts +0 -0
  816. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.d.ts.map +0 -0
  817. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.js +0 -0
  818. /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.js.map +0 -0
  819. /package/{node_modules → vendor}/@orient-cli/ai/package.json +0 -0
  820. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/cli.d.ts +0 -0
  821. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/cli.js +0 -0
  822. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts +0 -0
  823. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.js +0 -0
  824. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.js.map +0 -0
  825. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/args.d.ts +0 -0
  826. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/args.js +0 -0
  827. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/config-selector.d.ts +0 -0
  828. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/config-selector.js +0 -0
  829. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/file-processor.d.ts +0 -0
  830. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/file-processor.js +0 -0
  831. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/initial-message.js +0 -0
  832. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/list-models.d.ts +0 -0
  833. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/list-models.js +0 -0
  834. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/session-picker.d.ts +0 -0
  835. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/session-picker.js +0 -0
  836. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli.d.ts +0 -0
  837. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/config.d.ts +0 -0
  838. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts +0 -0
  839. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts +0 -0
  840. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-services.js +0 -0
  841. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/bash-executor.d.ts +0 -0
  842. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/bash-executor.js +0 -0
  843. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts +0 -0
  844. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js +0 -0
  845. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts +0 -0
  846. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/compaction.js +0 -0
  847. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.d.ts +0 -0
  848. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.js +0 -0
  849. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.js.map +0 -0
  850. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts +0 -0
  851. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/utils.js +0 -0
  852. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.d.ts +0 -0
  853. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.js +0 -0
  854. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.js.map +0 -0
  855. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.d.ts +0 -0
  856. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.js +0 -0
  857. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.js.map +0 -0
  858. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/event-bus.d.ts +0 -0
  859. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/event-bus.js +0 -0
  860. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/exec.d.ts +0 -0
  861. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/exec.js +0 -0
  862. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts +0 -0
  863. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js +0 -0
  864. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/index.d.ts +0 -0
  865. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/index.js +0 -0
  866. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts +0 -0
  867. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js +0 -0
  868. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.d.ts +0 -0
  869. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.js +0 -0
  870. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.js.map +0 -0
  871. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts +0 -0
  872. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/loader.js +0 -0
  873. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts +0 -0
  874. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/types.d.ts +0 -0
  875. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/types.js +0 -0
  876. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts +0 -0
  877. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/wrapper.js +0 -0
  878. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts +0 -0
  879. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.d.ts +0 -0
  880. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.js +0 -0
  881. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.js.map +0 -0
  882. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/messages.d.ts +0 -0
  883. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/messages.js +0 -0
  884. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-registry.d.ts +0 -0
  885. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-resolver.d.ts +0 -0
  886. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-resolver.js +0 -0
  887. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/output-guard.d.ts +0 -0
  888. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/output-guard.js +0 -0
  889. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/package-manager.d.ts +0 -0
  890. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts +0 -0
  891. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/prompt-templates.js +0 -0
  892. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts +0 -0
  893. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resolve-config-value.js +0 -0
  894. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resource-loader.d.ts +0 -0
  895. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/sdk.d.ts +0 -0
  896. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/sdk.js +0 -0
  897. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/session-cwd.d.ts +0 -0
  898. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/session-manager.d.ts +0 -0
  899. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/settings-manager.d.ts +0 -0
  900. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/skills.d.ts +0 -0
  901. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/skills.js +0 -0
  902. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.d.ts +0 -0
  903. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.js +0 -0
  904. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.js.map +0 -0
  905. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/source-info.d.ts +0 -0
  906. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/source-info.js +0 -0
  907. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/system-prompt.d.ts +0 -0
  908. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/system-prompt.js +0 -0
  909. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/timings.d.ts +0 -0
  910. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/timings.js +0 -0
  911. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/bash.d.ts +0 -0
  912. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts +0 -0
  913. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit-diff.js +0 -0
  914. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit.d.ts +0 -0
  915. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit.js +0 -0
  916. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts +0 -0
  917. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js +0 -0
  918. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/find.d.ts +0 -0
  919. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/find.js +0 -0
  920. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/grep.d.ts +0 -0
  921. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/grep.js +0 -0
  922. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/index.d.ts +0 -0
  923. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/index.js +0 -0
  924. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/ls.d.ts +0 -0
  925. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/ls.js +0 -0
  926. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts +0 -0
  927. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/path-utils.js +0 -0
  928. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/read.d.ts +0 -0
  929. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/read.js +0 -0
  930. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts +0 -0
  931. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/render-utils.js +0 -0
  932. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts +0 -0
  933. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js +0 -0
  934. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts +0 -0
  935. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/truncate.js +0 -0
  936. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/write.d.ts +0 -0
  937. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.d.ts +0 -0
  938. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.js +0 -0
  939. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.js.map +0 -0
  940. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/main.d.ts +0 -0
  941. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/main.js +0 -0
  942. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/migrations.d.ts +0 -0
  943. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/migrations.js +0 -0
  944. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.d.ts +0 -0
  945. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.js +0 -0
  946. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.js.map +0 -0
  947. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts +0 -0
  948. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts +0 -0
  949. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +0 -0
  950. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +0 -0
  951. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -0
  952. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts +0 -0
  953. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +0 -0
  954. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts +0 -0
  955. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts +0 -0
  956. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts +0 -0
  957. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js +0 -0
  958. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +0 -0
  959. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts +0 -0
  960. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts +0 -0
  961. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts +0 -0
  962. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts +0 -0
  963. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts +0 -0
  964. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/index.js +0 -0
  965. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +0 -0
  966. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js +0 -0
  967. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts +0 -0
  968. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts +0 -0
  969. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +0 -0
  970. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts +0 -0
  971. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js +0 -0
  972. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -0
  973. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +0 -0
  974. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js +0 -0
  975. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts +0 -0
  976. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts +0 -0
  977. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +0 -0
  978. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -0
  979. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts +0 -0
  980. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +0 -0
  981. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -0
  982. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts +0 -0
  983. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +0 -0
  984. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts +0 -0
  985. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js +0 -0
  986. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +0 -0
  987. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js +0 -0
  988. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts +0 -0
  989. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/print-mode.d.ts +0 -0
  990. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/print-mode.js +0 -0
  991. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts +0 -0
  992. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js +0 -0
  993. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts +0 -0
  994. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts +0 -0
  995. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js +0 -0
  996. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts +0 -0
  997. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js +0 -0
  998. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js.map +0 -0
  999. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/package-manager-cli.d.ts +0 -0
  1000. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/package-manager-cli.js +0 -0
  1001. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/changelog.d.ts +0 -0
  1002. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/changelog.js +0 -0
  1003. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/child-process.d.ts +0 -0
  1004. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/child-process.js +0 -0
  1005. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts +0 -0
  1006. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-image.js +0 -0
  1007. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts +0 -0
  1008. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-native.js +0 -0
  1009. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard.d.ts +0 -0
  1010. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard.js +0 -0
  1011. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts +0 -0
  1012. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/exif-orientation.js +0 -0
  1013. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts +0 -0
  1014. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/frontmatter.js +0 -0
  1015. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/git.d.ts +0 -0
  1016. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/git.js +0 -0
  1017. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-convert.d.ts +0 -0
  1018. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-convert.js +0 -0
  1019. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-resize.d.ts +0 -0
  1020. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-resize.js +0 -0
  1021. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/mime.d.ts +0 -0
  1022. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/mime.js +0 -0
  1023. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/paths.d.ts +0 -0
  1024. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/paths.js +0 -0
  1025. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/photon.d.ts +0 -0
  1026. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/photon.js +0 -0
  1027. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/shell.d.ts +0 -0
  1028. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/shell.js +0 -0
  1029. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/sleep.d.ts +0 -0
  1030. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/sleep.js +0 -0
  1031. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts +0 -0
  1032. /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/tools-manager.js +0 -0
  1033. /package/{node_modules → vendor}/@orient-cli/coding-agent/package.json +0 -0
  1034. /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.d.ts +0 -0
  1035. /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.d.ts.map +0 -0
  1036. /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.js +0 -0
  1037. /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.js.map +0 -0
  1038. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.d.ts +0 -0
  1039. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.d.ts.map +0 -0
  1040. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.js +0 -0
  1041. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.js.map +0 -0
  1042. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.d.ts +0 -0
  1043. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.d.ts.map +0 -0
  1044. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.js +0 -0
  1045. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.js.map +0 -0
  1046. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.d.ts +0 -0
  1047. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.d.ts.map +0 -0
  1048. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.js +0 -0
  1049. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.js.map +0 -0
  1050. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.d.ts +0 -0
  1051. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.d.ts.map +0 -0
  1052. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.js +0 -0
  1053. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.js.map +0 -0
  1054. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.d.ts +0 -0
  1055. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.d.ts.map +0 -0
  1056. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.js +0 -0
  1057. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.js.map +0 -0
  1058. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.d.ts +0 -0
  1059. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.d.ts.map +0 -0
  1060. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.js +0 -0
  1061. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.js.map +0 -0
  1062. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.d.ts +0 -0
  1063. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.d.ts.map +0 -0
  1064. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.js +0 -0
  1065. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.js.map +0 -0
  1066. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.d.ts +0 -0
  1067. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.d.ts.map +0 -0
  1068. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.js +0 -0
  1069. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.js.map +0 -0
  1070. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.d.ts +0 -0
  1071. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.d.ts.map +0 -0
  1072. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.js +0 -0
  1073. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.js.map +0 -0
  1074. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.d.ts +0 -0
  1075. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.d.ts.map +0 -0
  1076. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.js +0 -0
  1077. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.js.map +0 -0
  1078. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.d.ts +0 -0
  1079. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.d.ts.map +0 -0
  1080. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.js +0 -0
  1081. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.js.map +0 -0
  1082. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.d.ts +0 -0
  1083. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.d.ts.map +0 -0
  1084. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.js +0 -0
  1085. /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.js.map +0 -0
  1086. /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.d.ts +0 -0
  1087. /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.d.ts.map +0 -0
  1088. /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.js +0 -0
  1089. /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.js.map +0 -0
  1090. /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.d.ts +0 -0
  1091. /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.d.ts.map +0 -0
  1092. /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.js +0 -0
  1093. /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.js.map +0 -0
  1094. /package/{node_modules → vendor}/@orient-cli/tui/dist/index.d.ts +0 -0
  1095. /package/{node_modules → vendor}/@orient-cli/tui/dist/index.d.ts.map +0 -0
  1096. /package/{node_modules → vendor}/@orient-cli/tui/dist/index.js +0 -0
  1097. /package/{node_modules → vendor}/@orient-cli/tui/dist/index.js.map +0 -0
  1098. /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.d.ts +0 -0
  1099. /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.d.ts.map +0 -0
  1100. /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.js +0 -0
  1101. /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.js.map +0 -0
  1102. /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.d.ts +0 -0
  1103. /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.d.ts.map +0 -0
  1104. /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.js +0 -0
  1105. /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.js.map +0 -0
  1106. /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.d.ts +0 -0
  1107. /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.d.ts.map +0 -0
  1108. /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.js +0 -0
  1109. /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.js.map +0 -0
  1110. /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.d.ts +0 -0
  1111. /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.d.ts.map +0 -0
  1112. /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.js +0 -0
  1113. /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.js.map +0 -0
  1114. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.d.ts +0 -0
  1115. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.d.ts.map +0 -0
  1116. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.js +0 -0
  1117. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.js.map +0 -0
  1118. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.d.ts +0 -0
  1119. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.d.ts.map +0 -0
  1120. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.js +0 -0
  1121. /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.js.map +0 -0
  1122. /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.d.ts +0 -0
  1123. /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.d.ts.map +0 -0
  1124. /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.js +0 -0
  1125. /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.js.map +0 -0
  1126. /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.d.ts +0 -0
  1127. /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.d.ts.map +0 -0
  1128. /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.js +0 -0
  1129. /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.js.map +0 -0
  1130. /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.d.ts +0 -0
  1131. /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.d.ts.map +0 -0
  1132. /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.js +0 -0
  1133. /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.js.map +0 -0
  1134. /package/{node_modules → vendor}/@orient-cli/tui/package.json +0 -0
@@ -1,4106 +0,0 @@
1
- /**
2
- * Interactive mode for the coding agent.
3
- * Handles TUI rendering and user interaction, delegating business logic to AgentSession.
4
- */
5
- import * as crypto from "node:crypto";
6
- import * as fs from "node:fs";
7
- import * as os from "node:os";
8
- import * as path from "node:path";
9
- import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@orient-cli/tui";
10
- import { spawn, spawnSync } from "child_process";
11
- import { APP_NAME, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
12
- import { parseSkillBlock } from "../../core/agent-session.js";
13
- import { FooterDataProvider } from "../../core/footer-data-provider.js";
14
- import { KeybindingsManager } from "../../core/keybindings.js";
15
- import { createCompactionSummaryMessage } from "../../core/messages.js";
16
- import { findExactModelReferenceMatch, resolveModelScope } from "../../core/model-resolver.js";
17
- import { DefaultPackageManager } from "../../core/package-manager.js";
18
- import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
19
- import { SessionManager } from "../../core/session-manager.js";
20
- import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
21
- import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
22
- import { copyToClipboard } from "../../utils/clipboard.js";
23
- import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
24
- import { parseGitUrl } from "../../utils/git.js";
25
- import { ensureTool } from "../../utils/tools-manager.js";
26
- import { AssistantMessageComponent } from "./components/assistant-message.js";
27
- import { BashExecutionComponent } from "./components/bash-execution.js";
28
- import { BorderedLoader } from "./components/bordered-loader.js";
29
- import { BranchSummaryMessageComponent } from "./components/branch-summary-message.js";
30
- import { CompactionSummaryMessageComponent } from "./components/compaction-summary-message.js";
31
- import { CustomEditor } from "./components/custom-editor.js";
32
- import { CustomMessageComponent } from "./components/custom-message.js";
33
- import { DynamicBorder } from "./components/dynamic-border.js";
34
- import { ExtensionEditorComponent } from "./components/extension-editor.js";
35
- import { ExtensionInputComponent } from "./components/extension-input.js";
36
- import { ExtensionSelectorComponent } from "./components/extension-selector.js";
37
- import { FooterComponent } from "./components/footer.js";
38
- import { keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
39
- import { LoginDialogComponent } from "./components/login-dialog.js";
40
- import { ModelSelectorComponent } from "./components/model-selector.js";
41
- import { OAuthSelectorComponent } from "./components/oauth-selector.js";
42
- import { OrientBannerComponent } from "./components/orient-banner.js";
43
- import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
44
- import { SessionSelectorComponent } from "./components/session-selector.js";
45
- import { SettingsSelectorComponent } from "./components/settings-selector.js";
46
- import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
47
- import { ToolExecutionComponent } from "./components/tool-execution.js";
48
- import { TreeSelectorComponent } from "./components/tree-selector.js";
49
- import { UserMessageComponent } from "./components/user-message.js";
50
- import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
51
- import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
52
- function isExpandable(obj) {
53
- return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
54
- }
55
- const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription auth is active. Third-party usage now draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage.";
56
- function isAnthropicSubscriptionAuthKey(apiKey) {
57
- return typeof apiKey === "string" && apiKey.startsWith("sk-ant-oat");
58
- }
59
- export class InteractiveMode {
60
- options;
61
- runtimeHost;
62
- ui;
63
- chatContainer;
64
- pendingMessagesContainer;
65
- statusContainer;
66
- defaultEditor;
67
- editor;
68
- autocompleteProvider;
69
- fdPath;
70
- editorContainer;
71
- footer;
72
- footerDataProvider;
73
- // Stored so the same manager can be injected into custom editors, selectors, and extension UI.
74
- keybindings;
75
- version;
76
- isInitialized = false;
77
- onInputCallback;
78
- loadingAnimation = undefined;
79
- pendingWorkingMessage = undefined;
80
- defaultWorkingMessage = "Working...";
81
- defaultHiddenThinkingLabel = "Thinking...";
82
- hiddenThinkingLabel = this.defaultHiddenThinkingLabel;
83
- lastSigintTime = 0;
84
- lastEscapeTime = 0;
85
- changelogMarkdown = undefined;
86
- startupNoticesShown = false;
87
- anthropicSubscriptionWarningShown = false;
88
- // Status line tracking (for mutating immediately-sequential status updates)
89
- lastStatusSpacer = undefined;
90
- lastStatusText = undefined;
91
- // Streaming message tracking
92
- streamingComponent = undefined;
93
- streamingMessage = undefined;
94
- // Tool execution tracking: toolCallId -> component
95
- pendingTools = new Map();
96
- // Tool output expansion state
97
- toolOutputExpanded = false;
98
- // Thinking block visibility state
99
- hideThinkingBlock = false;
100
- // Skill commands: command name -> skill file path
101
- skillCommands = new Map();
102
- // Agent subscription unsubscribe function
103
- unsubscribe;
104
- // Track if editor is in bash mode (text starts with !)
105
- isBashMode = false;
106
- // Track current bash execution component
107
- bashComponent = undefined;
108
- // Track pending bash components (shown in pending area, moved to chat on submit)
109
- pendingBashComponents = [];
110
- // Auto-compaction state
111
- autoCompactionLoader = undefined;
112
- autoCompactionEscapeHandler;
113
- // Auto-retry state
114
- retryLoader = undefined;
115
- retryEscapeHandler;
116
- // Messages queued while compaction is running
117
- compactionQueuedMessages = [];
118
- // Shutdown state
119
- shutdownRequested = false;
120
- // Extension UI state
121
- extensionSelector = undefined;
122
- extensionInput = undefined;
123
- extensionEditor = undefined;
124
- extensionTerminalInputUnsubscribers = new Set();
125
- // Extension widgets (components rendered above/below the editor)
126
- extensionWidgetsAbove = new Map();
127
- extensionWidgetsBelow = new Map();
128
- widgetContainerAbove;
129
- widgetContainerBelow;
130
- // Custom footer from extension (undefined = use built-in footer)
131
- customFooter = undefined;
132
- // Header container that holds the built-in or custom header
133
- headerContainer;
134
- // Built-in header (logo + keybinding hints + changelog)
135
- builtInHeader = undefined;
136
- // Custom header from extension (undefined = use built-in header)
137
- customHeader = undefined;
138
- // Convenience accessors
139
- get session() {
140
- return this.runtimeHost.session;
141
- }
142
- get agent() {
143
- return this.session.agent;
144
- }
145
- get sessionManager() {
146
- return this.session.sessionManager;
147
- }
148
- get settingsManager() {
149
- return this.session.settingsManager;
150
- }
151
- constructor(runtimeHost, options = {}) {
152
- this.options = options;
153
- this.runtimeHost = runtimeHost;
154
- this.version = VERSION;
155
- this.ui = new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor());
156
- this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
157
- this.headerContainer = new Container();
158
- this.chatContainer = new Container();
159
- this.pendingMessagesContainer = new Container();
160
- this.statusContainer = new Container();
161
- this.widgetContainerAbove = new Container();
162
- this.widgetContainerBelow = new Container();
163
- this.keybindings = KeybindingsManager.create();
164
- setKeybindings(this.keybindings);
165
- const editorPaddingX = this.settingsManager.getEditorPaddingX();
166
- const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
167
- this.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
168
- paddingX: editorPaddingX,
169
- autocompleteMaxVisible,
170
- });
171
- this.editor = this.defaultEditor;
172
- this.editorContainer = new Container();
173
- this.editorContainer.addChild(this.editor);
174
- this.footerDataProvider = new FooterDataProvider(this.sessionManager.getCwd());
175
- this.footer = new FooterComponent(this.session, this.footerDataProvider);
176
- this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
177
- // Load hide thinking block setting
178
- this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
179
- // Register themes from resource loader and initialize
180
- setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
181
- initTheme(this.settingsManager.getTheme(), true);
182
- }
183
- getAutocompleteSourceTag(sourceInfo) {
184
- if (!sourceInfo) {
185
- return undefined;
186
- }
187
- const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
188
- const source = sourceInfo.source.trim();
189
- if (source === "auto" || source === "local" || source === "cli") {
190
- return scopePrefix;
191
- }
192
- if (source.startsWith("npm:")) {
193
- return `${scopePrefix}:${source}`;
194
- }
195
- const gitSource = parseGitUrl(source);
196
- if (gitSource) {
197
- const ref = gitSource.ref ? `@${gitSource.ref}` : "";
198
- return `${scopePrefix}:git:${gitSource.host}/${gitSource.path}${ref}`;
199
- }
200
- return scopePrefix;
201
- }
202
- prefixAutocompleteDescription(description, sourceInfo) {
203
- const sourceTag = this.getAutocompleteSourceTag(sourceInfo);
204
- if (!sourceTag) {
205
- return description;
206
- }
207
- return description ? `[${sourceTag}] ${description}` : `[${sourceTag}]`;
208
- }
209
- getBuiltInCommandConflictDiagnostics(extensionRunner) {
210
- if (!extensionRunner) {
211
- return [];
212
- }
213
- const builtinNames = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));
214
- return extensionRunner
215
- .getRegisteredCommands()
216
- .filter((command) => builtinNames.has(command.name))
217
- .map((command) => ({
218
- type: "warning",
219
- message: command.invocationName === command.name
220
- ? `Extension command '/${command.name}' conflicts with built-in interactive command. Skipping in autocomplete.`
221
- : `Extension command '/${command.name}' conflicts with built-in interactive command. Available as '/${command.invocationName}'.`,
222
- path: command.sourceInfo.path,
223
- }));
224
- }
225
- setupAutocomplete(fdPath) {
226
- // Define commands for autocomplete
227
- const slashCommands = BUILTIN_SLASH_COMMANDS.map((command) => ({
228
- name: command.name,
229
- description: command.description,
230
- }));
231
- const modelCommand = slashCommands.find((command) => command.name === "model");
232
- if (modelCommand) {
233
- modelCommand.getArgumentCompletions = (prefix) => {
234
- // Get available models (scoped or from registry)
235
- const models = this.session.scopedModels.length > 0
236
- ? this.session.scopedModels.map((s) => s.model)
237
- : this.session.modelRegistry.getAvailable();
238
- if (models.length === 0)
239
- return null;
240
- // Create items with provider/id format
241
- const items = models.map((m) => ({
242
- id: m.id,
243
- provider: m.provider,
244
- label: `${m.provider}/${m.id}`,
245
- }));
246
- // Fuzzy filter by model ID + provider (allows "opus anthropic" to match)
247
- const filtered = fuzzyFilter(items, prefix, (item) => `${item.id} ${item.provider}`);
248
- if (filtered.length === 0)
249
- return null;
250
- return filtered.map((item) => ({
251
- value: item.label,
252
- label: item.id,
253
- description: item.provider,
254
- }));
255
- };
256
- }
257
- // Convert prompt templates to SlashCommand format for autocomplete
258
- const templateCommands = this.session.promptTemplates.map((cmd) => ({
259
- name: cmd.name,
260
- description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
261
- }));
262
- // Convert extension commands to SlashCommand format
263
- const builtinCommandNames = new Set(slashCommands.map((c) => c.name));
264
- const extensionCommands = (this.session.extensionRunner?.getRegisteredCommands().filter((cmd) => !builtinCommandNames.has(cmd.name)) ?? []).map((cmd) => ({
265
- name: cmd.invocationName,
266
- description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
267
- getArgumentCompletions: cmd.getArgumentCompletions,
268
- }));
269
- // Build skill commands from session.skills (if enabled)
270
- this.skillCommands.clear();
271
- const skillCommandList = [];
272
- if (this.settingsManager.getEnableSkillCommands()) {
273
- for (const skill of this.session.resourceLoader.getSkills().skills) {
274
- const commandName = `skill:${skill.name}`;
275
- this.skillCommands.set(commandName, skill.filePath);
276
- skillCommandList.push({
277
- name: commandName,
278
- description: this.prefixAutocompleteDescription(skill.description, skill.sourceInfo),
279
- });
280
- }
281
- }
282
- // Setup autocomplete
283
- this.autocompleteProvider = new CombinedAutocompleteProvider([...slashCommands, ...templateCommands, ...extensionCommands, ...skillCommandList], this.sessionManager.getCwd(), fdPath);
284
- this.defaultEditor.setAutocompleteProvider(this.autocompleteProvider);
285
- if (this.editor !== this.defaultEditor) {
286
- this.editor.setAutocompleteProvider?.(this.autocompleteProvider);
287
- }
288
- }
289
- showStartupNoticesIfNeeded() {
290
- if (this.startupNoticesShown) {
291
- return;
292
- }
293
- this.startupNoticesShown = true;
294
- if (!this.changelogMarkdown) {
295
- return;
296
- }
297
- if (this.chatContainer.children.length > 0) {
298
- this.chatContainer.addChild(new Spacer(1));
299
- }
300
- this.chatContainer.addChild(new DynamicBorder());
301
- if (this.settingsManager.getCollapseChangelog()) {
302
- const versionMatch = this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/);
303
- const latestVersion = versionMatch ? versionMatch[1] : this.version;
304
- const condensedText = `Updated to v${latestVersion}. Use ${theme.bold("/changelog")} to view full changelog.`;
305
- this.chatContainer.addChild(new Text(condensedText, 1, 0));
306
- }
307
- else {
308
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
309
- this.chatContainer.addChild(new Spacer(1));
310
- this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
311
- this.chatContainer.addChild(new Spacer(1));
312
- }
313
- this.chatContainer.addChild(new DynamicBorder());
314
- }
315
- async init() {
316
- if (this.isInitialized)
317
- return;
318
- // Load changelog (only show new entries, skip for resumed sessions)
319
- this.changelogMarkdown = this.getChangelogForDisplay();
320
- // Ensure fd and rg are available (downloads if missing, adds to PATH via getBinDir)
321
- // Both are needed: fd for autocomplete, rg for grep tool and bash commands
322
- const [fdPath] = await Promise.all([ensureTool("fd"), ensureTool("rg")]);
323
- this.fdPath = fdPath;
324
- // Add header container as first child
325
- this.ui.addChild(this.headerContainer);
326
- // ORIENT header layout:
327
- //
328
- // The ORIENT compass + wordmark banner ALWAYS renders at the top,
329
- // regardless of quietStartup. It is the product's visual identity.
330
- // In verbose / non-quiet mode, the keybinding hints + version line
331
- // render beneath it. In quiet mode (the default for ORIENT), the
332
- // banner stands alone and the [Skills]/[Extensions]/[Prompts]
333
- // resource listing is also suppressed downstream (see
334
- // renderInitialResourceListing at :1021).
335
- this.headerContainer.addChild(new Spacer(1));
336
- this.headerContainer.addChild(new OrientBannerComponent());
337
- if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
338
- const versionLine = theme.fg("dim", `${APP_NAME} v${this.version}`);
339
- // Build startup instructions using keybinding hint helpers
340
- const hint = (keybinding, description) => keyHint(keybinding, description);
341
- const instructions = [
342
- hint("app.interrupt", "to interrupt"),
343
- hint("app.clear", "to clear"),
344
- rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
345
- hint("app.exit", "to exit (empty)"),
346
- hint("app.suspend", "to suspend"),
347
- keyHint("tui.editor.deleteToLineEnd", "to delete to end"),
348
- hint("app.thinking.cycle", "to cycle thinking level"),
349
- rawKeyHint(`${keyText("app.model.cycleForward")}/${keyText("app.model.cycleBackward")}`, "to cycle models"),
350
- hint("app.model.select", "to select model"),
351
- hint("app.tools.expand", "to expand tools"),
352
- hint("app.thinking.toggle", "to expand thinking"),
353
- hint("app.editor.external", "for external editor"),
354
- rawKeyHint("/", "for commands"),
355
- rawKeyHint("!", "to run bash"),
356
- rawKeyHint("!!", "to run bash (no context)"),
357
- hint("app.message.followUp", "to queue follow-up"),
358
- hint("app.message.dequeue", "to edit all queued messages"),
359
- hint("app.clipboard.pasteImage", "to paste image"),
360
- rawKeyHint("drop files", "to attach"),
361
- ].join("\n");
362
- this.builtInHeader = new Text(`${versionLine}\n${instructions}`, 1, 0);
363
- this.headerContainer.addChild(this.builtInHeader);
364
- }
365
- else {
366
- this.builtInHeader = new Text("", 0, 0);
367
- }
368
- this.headerContainer.addChild(new Spacer(1));
369
- this.ui.addChild(this.chatContainer);
370
- this.ui.addChild(this.pendingMessagesContainer);
371
- this.ui.addChild(this.statusContainer);
372
- this.renderWidgets(); // Initialize with default spacer
373
- this.ui.addChild(this.widgetContainerAbove);
374
- this.ui.addChild(this.editorContainer);
375
- this.ui.addChild(this.widgetContainerBelow);
376
- this.ui.addChild(this.footer);
377
- this.ui.setFocus(this.editor);
378
- this.setupKeyHandlers();
379
- this.setupEditorSubmitHandler();
380
- // Start the UI before initializing extensions so session_start handlers can use interactive dialogs
381
- this.ui.start();
382
- this.isInitialized = true;
383
- // Initialize extensions first so resources are shown before messages
384
- await this.bindCurrentSessionExtensions();
385
- // Render initial messages AFTER showing loaded resources
386
- this.renderInitialMessages();
387
- // Set terminal title
388
- this.updateTerminalTitle();
389
- // Subscribe to agent events
390
- this.subscribeToAgent();
391
- // Set up theme file watcher
392
- onThemeChange(() => {
393
- this.ui.invalidate();
394
- this.updateEditorBorderColor();
395
- this.ui.requestRender();
396
- });
397
- // Set up git branch watcher (uses provider instead of footer)
398
- this.footerDataProvider.onBranchChange(() => {
399
- this.ui.requestRender();
400
- });
401
- // Initialize available provider count for footer display
402
- await this.updateAvailableProviderCount();
403
- }
404
- /**
405
- * Update terminal title with session name and cwd.
406
- */
407
- updateTerminalTitle() {
408
- const cwdBasename = path.basename(this.sessionManager.getCwd());
409
- const sessionName = this.sessionManager.getSessionName();
410
- if (sessionName) {
411
- this.ui.terminal.setTitle(`π - ${sessionName} - ${cwdBasename}`);
412
- }
413
- else {
414
- this.ui.terminal.setTitle(`π - ${cwdBasename}`);
415
- }
416
- }
417
- /**
418
- * Run the interactive mode. This is the main entry point.
419
- * Initializes the UI, shows warnings, processes initial messages, and starts the interactive loop.
420
- */
421
- async run() {
422
- await this.init();
423
- // Start version check asynchronously
424
- this.checkForNewVersion().then((newVersion) => {
425
- if (newVersion) {
426
- this.showNewVersionNotification(newVersion);
427
- }
428
- });
429
- // Start package update check asynchronously
430
- this.checkForPackageUpdates().then((updates) => {
431
- if (updates.length > 0) {
432
- this.showPackageUpdateNotification(updates);
433
- }
434
- });
435
- // Check tmux keyboard setup asynchronously
436
- this.checkTmuxKeyboardSetup().then((warning) => {
437
- if (warning) {
438
- this.showWarning(warning);
439
- }
440
- });
441
- // Show startup warnings
442
- const { migratedProviders, modelFallbackMessage, initialMessage, initialImages, initialMessages } = this.options;
443
- if (migratedProviders && migratedProviders.length > 0) {
444
- this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
445
- }
446
- const modelsJsonError = this.session.modelRegistry.getError();
447
- if (modelsJsonError) {
448
- this.showError(`models.json error: ${modelsJsonError}`);
449
- }
450
- if (modelFallbackMessage) {
451
- this.showWarning(modelFallbackMessage);
452
- }
453
- void this.maybeWarnAboutAnthropicSubscriptionAuth();
454
- // Process initial messages
455
- if (initialMessage) {
456
- try {
457
- await this.session.prompt(initialMessage, { images: initialImages });
458
- }
459
- catch (error) {
460
- const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
461
- this.showError(errorMessage);
462
- }
463
- }
464
- if (initialMessages) {
465
- for (const message of initialMessages) {
466
- try {
467
- await this.session.prompt(message);
468
- }
469
- catch (error) {
470
- const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
471
- this.showError(errorMessage);
472
- }
473
- }
474
- }
475
- // Main interactive loop
476
- while (true) {
477
- const userInput = await this.getUserInput();
478
- try {
479
- await this.session.prompt(userInput);
480
- }
481
- catch (error) {
482
- const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
483
- this.showError(errorMessage);
484
- }
485
- }
486
- }
487
- /**
488
- * Check npm registry for a newer version.
489
- */
490
- async checkForNewVersion() {
491
- if (process.env.PI_SKIP_VERSION_CHECK || process.env.PI_OFFLINE)
492
- return undefined;
493
- try {
494
- const response = await fetch("https://registry.npmjs.org/orient-cli/latest", {
495
- signal: AbortSignal.timeout(10000),
496
- });
497
- if (!response.ok)
498
- return undefined;
499
- const data = (await response.json());
500
- const latestVersion = data.version;
501
- if (latestVersion && latestVersion !== this.version) {
502
- return latestVersion;
503
- }
504
- return undefined;
505
- }
506
- catch {
507
- return undefined;
508
- }
509
- }
510
- async checkForPackageUpdates() {
511
- if (process.env.PI_OFFLINE) {
512
- return [];
513
- }
514
- try {
515
- const packageManager = new DefaultPackageManager({
516
- cwd: this.sessionManager.getCwd(),
517
- agentDir: getAgentDir(),
518
- settingsManager: this.settingsManager,
519
- });
520
- const updates = await packageManager.checkForAvailableUpdates();
521
- return updates.map((update) => update.displayName);
522
- }
523
- catch {
524
- return [];
525
- }
526
- }
527
- async checkTmuxKeyboardSetup() {
528
- if (!process.env.TMUX)
529
- return undefined;
530
- const runTmuxShow = (option) => {
531
- return new Promise((resolve) => {
532
- const proc = spawn("tmux", ["show", "-gv", option], {
533
- stdio: ["ignore", "pipe", "ignore"],
534
- });
535
- let stdout = "";
536
- const timer = setTimeout(() => {
537
- proc.kill();
538
- resolve(undefined);
539
- }, 2000);
540
- proc.stdout?.on("data", (data) => {
541
- stdout += data.toString();
542
- });
543
- proc.on("error", () => {
544
- clearTimeout(timer);
545
- resolve(undefined);
546
- });
547
- proc.on("close", (code) => {
548
- clearTimeout(timer);
549
- resolve(code === 0 ? stdout.trim() : undefined);
550
- });
551
- });
552
- };
553
- const [extendedKeys, extendedKeysFormat] = await Promise.all([
554
- runTmuxShow("extended-keys"),
555
- runTmuxShow("extended-keys-format"),
556
- ]);
557
- // If we couldn't query tmux (timeout, sandbox, etc.), don't warn
558
- if (extendedKeys === undefined)
559
- return undefined;
560
- if (extendedKeys !== "on" && extendedKeys !== "always") {
561
- return "tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.";
562
- }
563
- if (extendedKeysFormat === "xterm") {
564
- return "tmux extended-keys-format is xterm. ORIENT works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.";
565
- }
566
- return undefined;
567
- }
568
- /**
569
- * Get changelog entries to display on startup.
570
- * Only shows new entries since last seen version, skips for resumed sessions.
571
- */
572
- getChangelogForDisplay() {
573
- // Skip changelog for resumed/continued sessions (already have messages)
574
- if (this.session.state.messages.length > 0) {
575
- return undefined;
576
- }
577
- const lastVersion = this.settingsManager.getLastChangelogVersion();
578
- const changelogPath = getChangelogPath();
579
- const entries = parseChangelog(changelogPath);
580
- if (!lastVersion) {
581
- // Fresh install - just record the version, don't show changelog
582
- this.settingsManager.setLastChangelogVersion(VERSION);
583
- return undefined;
584
- }
585
- else {
586
- const newEntries = getNewEntries(entries, lastVersion);
587
- if (newEntries.length > 0) {
588
- this.settingsManager.setLastChangelogVersion(VERSION);
589
- return newEntries.map((e) => e.content).join("\n\n");
590
- }
591
- }
592
- return undefined;
593
- }
594
- getMarkdownThemeWithSettings() {
595
- return {
596
- ...getMarkdownTheme(),
597
- codeBlockIndent: this.settingsManager.getCodeBlockIndent(),
598
- };
599
- }
600
- // =========================================================================
601
- // Extension System
602
- // =========================================================================
603
- formatDisplayPath(p) {
604
- const home = os.homedir();
605
- let result = p;
606
- // Replace home directory with ~
607
- if (result.startsWith(home)) {
608
- result = `~${result.slice(home.length)}`;
609
- }
610
- return result;
611
- }
612
- /**
613
- * Get a short path relative to the package root for display.
614
- */
615
- getShortPath(fullPath, sourceInfo) {
616
- const source = sourceInfo?.source ?? "";
617
- const npmMatch = fullPath.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)\/(.*)/);
618
- if (npmMatch && source.startsWith("npm:")) {
619
- return npmMatch[2];
620
- }
621
- const gitMatch = fullPath.match(/git\/[^/]+\/[^/]+\/(.*)/);
622
- if (gitMatch && source.startsWith("git:")) {
623
- return gitMatch[1];
624
- }
625
- return this.formatDisplayPath(fullPath);
626
- }
627
- getDisplaySourceInfo(sourceInfo) {
628
- const source = sourceInfo?.source ?? "local";
629
- const scope = sourceInfo?.scope ?? "project";
630
- if (source === "local") {
631
- if (scope === "user") {
632
- return { label: "user", color: "muted" };
633
- }
634
- if (scope === "project") {
635
- return { label: "project", color: "muted" };
636
- }
637
- if (scope === "temporary") {
638
- return { label: "path", scopeLabel: "temp", color: "muted" };
639
- }
640
- return { label: "path", color: "muted" };
641
- }
642
- if (source === "cli") {
643
- return { label: "path", scopeLabel: scope === "temporary" ? "temp" : undefined, color: "muted" };
644
- }
645
- const scopeLabel = scope === "user" ? "user" : scope === "project" ? "project" : scope === "temporary" ? "temp" : undefined;
646
- return { label: source, scopeLabel, color: "accent" };
647
- }
648
- getScopeGroup(sourceInfo) {
649
- const source = sourceInfo?.source ?? "local";
650
- const scope = sourceInfo?.scope ?? "project";
651
- if (source === "cli" || scope === "temporary")
652
- return "path";
653
- if (scope === "user")
654
- return "user";
655
- if (scope === "project")
656
- return "project";
657
- return "path";
658
- }
659
- isPackageSource(sourceInfo) {
660
- const source = sourceInfo?.source ?? "";
661
- return source.startsWith("npm:") || source.startsWith("git:");
662
- }
663
- buildScopeGroups(items) {
664
- const groups = {
665
- user: { scope: "user", paths: [], packages: new Map() },
666
- project: { scope: "project", paths: [], packages: new Map() },
667
- path: { scope: "path", paths: [], packages: new Map() },
668
- };
669
- for (const item of items) {
670
- const groupKey = this.getScopeGroup(item.sourceInfo);
671
- const group = groups[groupKey];
672
- const source = item.sourceInfo?.source ?? "local";
673
- if (this.isPackageSource(item.sourceInfo)) {
674
- const list = group.packages.get(source) ?? [];
675
- list.push(item);
676
- group.packages.set(source, list);
677
- }
678
- else {
679
- group.paths.push(item);
680
- }
681
- }
682
- return [groups.project, groups.user, groups.path].filter((group) => group.paths.length > 0 || group.packages.size > 0);
683
- }
684
- formatScopeGroups(groups, options) {
685
- const lines = [];
686
- for (const group of groups) {
687
- lines.push(` ${theme.fg("accent", group.scope)}`);
688
- const sortedPaths = [...group.paths].sort((a, b) => a.path.localeCompare(b.path));
689
- for (const item of sortedPaths) {
690
- lines.push(theme.fg("dim", ` ${options.formatPath(item)}`));
691
- }
692
- const sortedPackages = Array.from(group.packages.entries()).sort(([a], [b]) => a.localeCompare(b));
693
- for (const [source, items] of sortedPackages) {
694
- lines.push(` ${theme.fg("mdLink", source)}`);
695
- const sortedPackagePaths = [...items].sort((a, b) => a.path.localeCompare(b.path));
696
- for (const item of sortedPackagePaths) {
697
- lines.push(theme.fg("dim", ` ${options.formatPackagePath(item, source)}`));
698
- }
699
- }
700
- }
701
- return lines.join("\n");
702
- }
703
- findSourceInfoForPath(p, sourceInfos) {
704
- const exact = sourceInfos.get(p);
705
- if (exact)
706
- return exact;
707
- let current = p;
708
- while (current.includes("/")) {
709
- current = current.substring(0, current.lastIndexOf("/"));
710
- const parent = sourceInfos.get(current);
711
- if (parent)
712
- return parent;
713
- }
714
- return undefined;
715
- }
716
- formatPathWithSource(p, sourceInfo) {
717
- if (sourceInfo) {
718
- const shortPath = this.getShortPath(p, sourceInfo);
719
- const { label, scopeLabel } = this.getDisplaySourceInfo(sourceInfo);
720
- const labelText = scopeLabel ? `${label} (${scopeLabel})` : label;
721
- return `${labelText} ${shortPath}`;
722
- }
723
- return this.formatDisplayPath(p);
724
- }
725
- formatDiagnostics(diagnostics, sourceInfos) {
726
- const lines = [];
727
- // Group collision diagnostics by name
728
- const collisions = new Map();
729
- const otherDiagnostics = [];
730
- for (const d of diagnostics) {
731
- if (d.type === "collision" && d.collision) {
732
- const list = collisions.get(d.collision.name) ?? [];
733
- list.push(d);
734
- collisions.set(d.collision.name, list);
735
- }
736
- else {
737
- otherDiagnostics.push(d);
738
- }
739
- }
740
- // Format collision diagnostics grouped by name
741
- for (const [name, collisionList] of collisions) {
742
- const first = collisionList[0]?.collision;
743
- if (!first)
744
- continue;
745
- lines.push(theme.fg("warning", ` "${name}" collision:`));
746
- lines.push(theme.fg("dim", ` ${theme.fg("success", "✓")} ${this.formatPathWithSource(first.winnerPath, this.findSourceInfoForPath(first.winnerPath, sourceInfos))}`));
747
- for (const d of collisionList) {
748
- if (d.collision) {
749
- lines.push(theme.fg("dim", ` ${theme.fg("warning", "✗")} ${this.formatPathWithSource(d.collision.loserPath, this.findSourceInfoForPath(d.collision.loserPath, sourceInfos))} (skipped)`));
750
- }
751
- }
752
- }
753
- for (const d of otherDiagnostics) {
754
- if (d.path) {
755
- const formattedPath = this.formatPathWithSource(d.path, this.findSourceInfoForPath(d.path, sourceInfos));
756
- lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${formattedPath}`));
757
- lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${d.message}`));
758
- }
759
- else {
760
- lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${d.message}`));
761
- }
762
- }
763
- return lines.join("\n");
764
- }
765
- showLoadedResources(options) {
766
- const showListing = options?.force || this.options.verbose || !this.settingsManager.getQuietStartup();
767
- const showDiagnostics = showListing || options?.showDiagnosticsWhenQuiet === true;
768
- if (!showListing && !showDiagnostics) {
769
- return;
770
- }
771
- const sectionHeader = (name, color = "mdHeading") => theme.fg(color, `[${name}]`);
772
- const skillsResult = this.session.resourceLoader.getSkills();
773
- const promptsResult = this.session.resourceLoader.getPrompts();
774
- const themesResult = this.session.resourceLoader.getThemes();
775
- const extensions = options?.extensions ??
776
- this.session.resourceLoader.getExtensions().extensions.map((extension) => ({
777
- path: extension.path,
778
- sourceInfo: extension.sourceInfo,
779
- }));
780
- const sourceInfos = new Map();
781
- for (const extension of extensions) {
782
- if (extension.sourceInfo) {
783
- sourceInfos.set(extension.path, extension.sourceInfo);
784
- }
785
- }
786
- for (const skill of skillsResult.skills) {
787
- if (skill.sourceInfo) {
788
- sourceInfos.set(skill.filePath, skill.sourceInfo);
789
- }
790
- }
791
- for (const prompt of promptsResult.prompts) {
792
- if (prompt.sourceInfo) {
793
- sourceInfos.set(prompt.filePath, prompt.sourceInfo);
794
- }
795
- }
796
- for (const loadedTheme of themesResult.themes) {
797
- if (loadedTheme.sourcePath && loadedTheme.sourceInfo) {
798
- sourceInfos.set(loadedTheme.sourcePath, loadedTheme.sourceInfo);
799
- }
800
- }
801
- if (showListing) {
802
- const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
803
- if (contextFiles.length > 0) {
804
- this.chatContainer.addChild(new Spacer(1));
805
- const contextList = contextFiles
806
- .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
807
- .join("\n");
808
- this.chatContainer.addChild(new Text(`${sectionHeader("Context")}\n${contextList}`, 0, 0));
809
- this.chatContainer.addChild(new Spacer(1));
810
- }
811
- const skills = skillsResult.skills;
812
- if (skills.length > 0) {
813
- const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
814
- const skillList = this.formatScopeGroups(groups, {
815
- formatPath: (item) => this.formatDisplayPath(item.path),
816
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
817
- });
818
- this.chatContainer.addChild(new Text(`${sectionHeader("Skills")}\n${skillList}`, 0, 0));
819
- this.chatContainer.addChild(new Spacer(1));
820
- }
821
- const templates = this.session.promptTemplates;
822
- if (templates.length > 0) {
823
- const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
824
- const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
825
- const templateList = this.formatScopeGroups(groups, {
826
- formatPath: (item) => {
827
- const template = templateByPath.get(item.path);
828
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
829
- },
830
- formatPackagePath: (item) => {
831
- const template = templateByPath.get(item.path);
832
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
833
- },
834
- });
835
- this.chatContainer.addChild(new Text(`${sectionHeader("Prompts")}\n${templateList}`, 0, 0));
836
- this.chatContainer.addChild(new Spacer(1));
837
- }
838
- if (extensions.length > 0) {
839
- const groups = this.buildScopeGroups(extensions);
840
- const extList = this.formatScopeGroups(groups, {
841
- formatPath: (item) => this.formatDisplayPath(item.path),
842
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
843
- });
844
- this.chatContainer.addChild(new Text(`${sectionHeader("Extensions", "mdHeading")}\n${extList}`, 0, 0));
845
- this.chatContainer.addChild(new Spacer(1));
846
- }
847
- // Show loaded themes (excluding built-in)
848
- const loadedThemes = themesResult.themes;
849
- const customThemes = loadedThemes.filter((t) => t.sourcePath);
850
- if (customThemes.length > 0) {
851
- const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
852
- path: loadedTheme.sourcePath,
853
- sourceInfo: loadedTheme.sourceInfo,
854
- })));
855
- const themeList = this.formatScopeGroups(groups, {
856
- formatPath: (item) => this.formatDisplayPath(item.path),
857
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
858
- });
859
- this.chatContainer.addChild(new Text(`${sectionHeader("Themes")}\n${themeList}`, 0, 0));
860
- this.chatContainer.addChild(new Spacer(1));
861
- }
862
- }
863
- if (showDiagnostics) {
864
- const skillDiagnostics = skillsResult.diagnostics;
865
- if (skillDiagnostics.length > 0) {
866
- const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
867
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
868
- this.chatContainer.addChild(new Spacer(1));
869
- }
870
- const promptDiagnostics = promptsResult.diagnostics;
871
- if (promptDiagnostics.length > 0) {
872
- const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
873
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
874
- this.chatContainer.addChild(new Spacer(1));
875
- }
876
- const extensionDiagnostics = [];
877
- const extensionErrors = this.session.resourceLoader.getExtensions().errors;
878
- if (extensionErrors.length > 0) {
879
- for (const error of extensionErrors) {
880
- extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
881
- }
882
- }
883
- const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
884
- extensionDiagnostics.push(...commandDiagnostics);
885
- extensionDiagnostics.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));
886
- const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
887
- extensionDiagnostics.push(...shortcutDiagnostics);
888
- if (extensionDiagnostics.length > 0) {
889
- const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
890
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
891
- this.chatContainer.addChild(new Spacer(1));
892
- }
893
- const themeDiagnostics = themesResult.diagnostics;
894
- if (themeDiagnostics.length > 0) {
895
- const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
896
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
897
- this.chatContainer.addChild(new Spacer(1));
898
- }
899
- }
900
- }
901
- /**
902
- * Initialize the extension system with TUI-based UI context.
903
- */
904
- async bindCurrentSessionExtensions() {
905
- const uiContext = this.createExtensionUIContext();
906
- await this.session.bindExtensions({
907
- uiContext,
908
- commandContextActions: {
909
- waitForIdle: () => this.session.agent.waitForIdle(),
910
- newSession: async (options) => {
911
- if (this.loadingAnimation) {
912
- this.loadingAnimation.stop();
913
- this.loadingAnimation = undefined;
914
- }
915
- this.statusContainer.clear();
916
- try {
917
- const result = await this.runtimeHost.newSession(options);
918
- if (!result.cancelled) {
919
- await this.handleRuntimeSessionChange();
920
- this.renderCurrentSessionState();
921
- this.ui.requestRender();
922
- }
923
- return result;
924
- }
925
- catch (error) {
926
- return this.handleFatalRuntimeError("Failed to create session", error);
927
- }
928
- },
929
- fork: async (entryId) => {
930
- try {
931
- const result = await this.runtimeHost.fork(entryId);
932
- if (!result.cancelled) {
933
- await this.handleRuntimeSessionChange();
934
- this.renderCurrentSessionState();
935
- this.editor.setText(result.selectedText ?? "");
936
- this.showStatus("Forked to new session");
937
- }
938
- return { cancelled: result.cancelled };
939
- }
940
- catch (error) {
941
- return this.handleFatalRuntimeError("Failed to fork session", error);
942
- }
943
- },
944
- navigateTree: async (targetId, options) => {
945
- const result = await this.session.navigateTree(targetId, {
946
- summarize: options?.summarize,
947
- customInstructions: options?.customInstructions,
948
- replaceInstructions: options?.replaceInstructions,
949
- label: options?.label,
950
- });
951
- if (result.cancelled) {
952
- return { cancelled: true };
953
- }
954
- this.chatContainer.clear();
955
- this.renderInitialMessages();
956
- if (result.editorText && !this.editor.getText().trim()) {
957
- this.editor.setText(result.editorText);
958
- }
959
- this.showStatus("Navigated to selected point");
960
- return { cancelled: false };
961
- },
962
- switchSession: async (sessionPath) => {
963
- await this.handleResumeSession(sessionPath);
964
- return { cancelled: false };
965
- },
966
- reload: async () => {
967
- await this.handleReloadCommand();
968
- },
969
- },
970
- shutdownHandler: () => {
971
- this.shutdownRequested = true;
972
- if (!this.session.isStreaming) {
973
- void this.shutdown();
974
- }
975
- },
976
- onError: (error) => {
977
- this.showExtensionError(error.extensionPath, error.error, error.stack);
978
- },
979
- });
980
- setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
981
- this.setupAutocomplete(this.fdPath);
982
- const extensionRunner = this.session.extensionRunner;
983
- if (!extensionRunner) {
984
- this.showLoadedResources({ extensions: [], force: false });
985
- this.showStartupNoticesIfNeeded();
986
- return;
987
- }
988
- this.setupExtensionShortcuts(extensionRunner);
989
- this.showLoadedResources({ force: false });
990
- this.showStartupNoticesIfNeeded();
991
- }
992
- applyRuntimeSettings() {
993
- this.footer.setSession(this.session);
994
- this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
995
- this.footerDataProvider.setCwd(this.sessionManager.getCwd());
996
- this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
997
- this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
998
- this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
999
- const editorPaddingX = this.settingsManager.getEditorPaddingX();
1000
- const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
1001
- this.defaultEditor.setPaddingX(editorPaddingX);
1002
- this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
1003
- if (this.editor !== this.defaultEditor) {
1004
- this.editor.setPaddingX?.(editorPaddingX);
1005
- this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
1006
- }
1007
- }
1008
- async handleRuntimeSessionChange() {
1009
- this.resetExtensionUI();
1010
- this.unsubscribe?.();
1011
- this.unsubscribe = undefined;
1012
- this.applyRuntimeSettings();
1013
- await this.bindCurrentSessionExtensions();
1014
- this.subscribeToAgent();
1015
- await this.updateAvailableProviderCount();
1016
- this.updateEditorBorderColor();
1017
- this.updateTerminalTitle();
1018
- }
1019
- async handleFatalRuntimeError(prefix, error) {
1020
- const message = error instanceof Error ? error.message : String(error);
1021
- this.showError(`${prefix}: ${message}`);
1022
- stopThemeWatcher();
1023
- this.stop();
1024
- process.exit(1);
1025
- }
1026
- renderCurrentSessionState() {
1027
- this.chatContainer.clear();
1028
- this.pendingMessagesContainer.clear();
1029
- this.compactionQueuedMessages = [];
1030
- this.streamingComponent = undefined;
1031
- this.streamingMessage = undefined;
1032
- this.pendingTools.clear();
1033
- this.renderInitialMessages();
1034
- }
1035
- /**
1036
- * Get a registered tool definition by name (for custom rendering).
1037
- */
1038
- getRegisteredToolDefinition(toolName) {
1039
- return this.session.getToolDefinition(toolName);
1040
- }
1041
- /**
1042
- * Set up keyboard shortcuts registered by extensions.
1043
- */
1044
- setupExtensionShortcuts(extensionRunner) {
1045
- const shortcuts = extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());
1046
- if (shortcuts.size === 0)
1047
- return;
1048
- // Create a context for shortcut handlers
1049
- const createContext = () => ({
1050
- ui: this.createExtensionUIContext(),
1051
- hasUI: true,
1052
- cwd: this.sessionManager.getCwd(),
1053
- sessionManager: this.sessionManager,
1054
- modelRegistry: this.session.modelRegistry,
1055
- model: this.session.model,
1056
- isIdle: () => !this.session.isStreaming,
1057
- signal: this.session.agent.signal,
1058
- abort: () => this.session.abort(),
1059
- hasPendingMessages: () => this.session.pendingMessageCount > 0,
1060
- shutdown: () => {
1061
- this.shutdownRequested = true;
1062
- },
1063
- getContextUsage: () => this.session.getContextUsage(),
1064
- compact: (options) => {
1065
- void (async () => {
1066
- try {
1067
- const result = await this.session.compact(options?.customInstructions);
1068
- options?.onComplete?.(result);
1069
- }
1070
- catch (error) {
1071
- const err = error instanceof Error ? error : new Error(String(error));
1072
- options?.onError?.(err);
1073
- }
1074
- })();
1075
- },
1076
- getSystemPrompt: () => this.session.systemPrompt,
1077
- });
1078
- // Set up the extension shortcut handler on the default editor
1079
- this.defaultEditor.onExtensionShortcut = (data) => {
1080
- for (const [shortcutStr, shortcut] of shortcuts) {
1081
- // Cast to KeyId - extension shortcuts use the same format
1082
- if (matchesKey(data, shortcutStr)) {
1083
- // Run handler async, don't block input
1084
- Promise.resolve(shortcut.handler(createContext())).catch((err) => {
1085
- this.showError(`Shortcut handler error: ${err instanceof Error ? err.message : String(err)}`);
1086
- });
1087
- return true;
1088
- }
1089
- }
1090
- return false;
1091
- };
1092
- }
1093
- /**
1094
- * Set extension status text in the footer.
1095
- */
1096
- setExtensionStatus(key, text) {
1097
- this.footerDataProvider.setExtensionStatus(key, text);
1098
- this.ui.requestRender();
1099
- }
1100
- setHiddenThinkingLabel(label) {
1101
- this.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;
1102
- for (const child of this.chatContainer.children) {
1103
- if (child instanceof AssistantMessageComponent) {
1104
- child.setHiddenThinkingLabel(this.hiddenThinkingLabel);
1105
- }
1106
- }
1107
- if (this.streamingComponent) {
1108
- this.streamingComponent.setHiddenThinkingLabel(this.hiddenThinkingLabel);
1109
- }
1110
- this.ui.requestRender();
1111
- }
1112
- /**
1113
- * Set an extension widget (string array or custom component).
1114
- */
1115
- setExtensionWidget(key, content, options) {
1116
- const placement = options?.placement ?? "aboveEditor";
1117
- const removeExisting = (map) => {
1118
- const existing = map.get(key);
1119
- if (existing?.dispose)
1120
- existing.dispose();
1121
- map.delete(key);
1122
- };
1123
- removeExisting(this.extensionWidgetsAbove);
1124
- removeExisting(this.extensionWidgetsBelow);
1125
- if (content === undefined) {
1126
- this.renderWidgets();
1127
- return;
1128
- }
1129
- let component;
1130
- if (Array.isArray(content)) {
1131
- // Wrap string array in a Container with Text components
1132
- const container = new Container();
1133
- for (const line of content.slice(0, InteractiveMode.MAX_WIDGET_LINES)) {
1134
- container.addChild(new Text(line, 1, 0));
1135
- }
1136
- if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
1137
- container.addChild(new Text(theme.fg("muted", "... (widget truncated)"), 1, 0));
1138
- }
1139
- component = container;
1140
- }
1141
- else {
1142
- // Factory function - create component
1143
- component = content(this.ui, theme);
1144
- }
1145
- const targetMap = placement === "belowEditor" ? this.extensionWidgetsBelow : this.extensionWidgetsAbove;
1146
- targetMap.set(key, component);
1147
- this.renderWidgets();
1148
- }
1149
- clearExtensionWidgets() {
1150
- for (const widget of this.extensionWidgetsAbove.values()) {
1151
- widget.dispose?.();
1152
- }
1153
- for (const widget of this.extensionWidgetsBelow.values()) {
1154
- widget.dispose?.();
1155
- }
1156
- this.extensionWidgetsAbove.clear();
1157
- this.extensionWidgetsBelow.clear();
1158
- this.renderWidgets();
1159
- }
1160
- resetExtensionUI() {
1161
- if (this.extensionSelector) {
1162
- this.hideExtensionSelector();
1163
- }
1164
- if (this.extensionInput) {
1165
- this.hideExtensionInput();
1166
- }
1167
- if (this.extensionEditor) {
1168
- this.hideExtensionEditor();
1169
- }
1170
- this.ui.hideOverlay();
1171
- this.clearExtensionTerminalInputListeners();
1172
- this.setExtensionFooter(undefined);
1173
- this.setExtensionHeader(undefined);
1174
- this.clearExtensionWidgets();
1175
- this.footerDataProvider.clearExtensionStatuses();
1176
- this.footer.invalidate();
1177
- this.setCustomEditorComponent(undefined);
1178
- this.defaultEditor.onExtensionShortcut = undefined;
1179
- this.updateTerminalTitle();
1180
- if (this.loadingAnimation) {
1181
- this.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText("app.interrupt")} to interrupt)`);
1182
- }
1183
- this.setHiddenThinkingLabel();
1184
- }
1185
- // Maximum total widget lines to prevent viewport overflow
1186
- static MAX_WIDGET_LINES = 10;
1187
- /**
1188
- * Render all extension widgets to the widget container.
1189
- */
1190
- renderWidgets() {
1191
- if (!this.widgetContainerAbove || !this.widgetContainerBelow)
1192
- return;
1193
- this.renderWidgetContainer(this.widgetContainerAbove, this.extensionWidgetsAbove, true, true);
1194
- this.renderWidgetContainer(this.widgetContainerBelow, this.extensionWidgetsBelow, false, false);
1195
- this.ui.requestRender();
1196
- }
1197
- renderWidgetContainer(container, widgets, spacerWhenEmpty, leadingSpacer) {
1198
- container.clear();
1199
- if (widgets.size === 0) {
1200
- if (spacerWhenEmpty) {
1201
- container.addChild(new Spacer(1));
1202
- }
1203
- return;
1204
- }
1205
- if (leadingSpacer) {
1206
- container.addChild(new Spacer(1));
1207
- }
1208
- for (const component of widgets.values()) {
1209
- container.addChild(component);
1210
- }
1211
- }
1212
- /**
1213
- * Set a custom footer component, or restore the built-in footer.
1214
- */
1215
- setExtensionFooter(factory) {
1216
- // Dispose existing custom footer
1217
- if (this.customFooter?.dispose) {
1218
- this.customFooter.dispose();
1219
- }
1220
- // Remove current footer from UI
1221
- if (this.customFooter) {
1222
- this.ui.removeChild(this.customFooter);
1223
- }
1224
- else {
1225
- this.ui.removeChild(this.footer);
1226
- }
1227
- if (factory) {
1228
- // Create and add custom footer, passing the data provider
1229
- this.customFooter = factory(this.ui, theme, this.footerDataProvider);
1230
- this.ui.addChild(this.customFooter);
1231
- }
1232
- else {
1233
- // Restore built-in footer
1234
- this.customFooter = undefined;
1235
- this.ui.addChild(this.footer);
1236
- }
1237
- this.ui.requestRender();
1238
- }
1239
- /**
1240
- * Set a custom header component, or restore the built-in header.
1241
- */
1242
- setExtensionHeader(factory) {
1243
- // Header may not be initialized yet if called during early initialization
1244
- if (!this.builtInHeader) {
1245
- return;
1246
- }
1247
- // Dispose existing custom header
1248
- if (this.customHeader?.dispose) {
1249
- this.customHeader.dispose();
1250
- }
1251
- // Find the index of the current header in the header container
1252
- const currentHeader = this.customHeader || this.builtInHeader;
1253
- const index = this.headerContainer.children.indexOf(currentHeader);
1254
- if (factory) {
1255
- // Create and add custom header
1256
- this.customHeader = factory(this.ui, theme);
1257
- if (index !== -1) {
1258
- this.headerContainer.children[index] = this.customHeader;
1259
- }
1260
- else {
1261
- // If not found (e.g. builtInHeader was never added), add at the top
1262
- this.headerContainer.children.unshift(this.customHeader);
1263
- }
1264
- }
1265
- else {
1266
- // Restore built-in header
1267
- this.customHeader = undefined;
1268
- if (index !== -1) {
1269
- this.headerContainer.children[index] = this.builtInHeader;
1270
- }
1271
- }
1272
- this.ui.requestRender();
1273
- }
1274
- addExtensionTerminalInputListener(handler) {
1275
- const unsubscribe = this.ui.addInputListener(handler);
1276
- this.extensionTerminalInputUnsubscribers.add(unsubscribe);
1277
- return () => {
1278
- unsubscribe();
1279
- this.extensionTerminalInputUnsubscribers.delete(unsubscribe);
1280
- };
1281
- }
1282
- clearExtensionTerminalInputListeners() {
1283
- for (const unsubscribe of this.extensionTerminalInputUnsubscribers) {
1284
- unsubscribe();
1285
- }
1286
- this.extensionTerminalInputUnsubscribers.clear();
1287
- }
1288
- /**
1289
- * Create the ExtensionUIContext for extensions.
1290
- */
1291
- createExtensionUIContext() {
1292
- return {
1293
- select: (title, options, opts) => this.showExtensionSelector(title, options, opts),
1294
- confirm: (title, message, opts) => this.showExtensionConfirm(title, message, opts),
1295
- input: (title, placeholder, opts) => this.showExtensionInput(title, placeholder, opts),
1296
- notify: (message, type) => this.showExtensionNotify(message, type),
1297
- onTerminalInput: (handler) => this.addExtensionTerminalInputListener(handler),
1298
- setStatus: (key, text) => this.setExtensionStatus(key, text),
1299
- setWorkingMessage: (message) => {
1300
- if (this.loadingAnimation) {
1301
- if (message) {
1302
- this.loadingAnimation.setMessage(message);
1303
- }
1304
- else {
1305
- this.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText("app.interrupt")} to interrupt)`);
1306
- }
1307
- }
1308
- else {
1309
- // Queue message for when loadingAnimation is created (handles agent_start race)
1310
- this.pendingWorkingMessage = message;
1311
- }
1312
- },
1313
- setHiddenThinkingLabel: (label) => this.setHiddenThinkingLabel(label),
1314
- setWidget: (key, content, options) => this.setExtensionWidget(key, content, options),
1315
- setFooter: (factory) => this.setExtensionFooter(factory),
1316
- setHeader: (factory) => this.setExtensionHeader(factory),
1317
- setTitle: (title) => this.ui.terminal.setTitle(title),
1318
- custom: (factory, options) => this.showExtensionCustom(factory, options),
1319
- pasteToEditor: (text) => this.editor.handleInput(`\x1b[200~${text}\x1b[201~`),
1320
- setEditorText: (text) => this.editor.setText(text),
1321
- getEditorText: () => this.editor.getExpandedText?.() ?? this.editor.getText(),
1322
- editor: (title, prefill) => this.showExtensionEditor(title, prefill),
1323
- setEditorComponent: (factory) => this.setCustomEditorComponent(factory),
1324
- get theme() {
1325
- return theme;
1326
- },
1327
- getAllThemes: () => getAvailableThemesWithPaths(),
1328
- getTheme: (name) => getThemeByName(name),
1329
- setTheme: (themeOrName) => {
1330
- if (themeOrName instanceof Theme) {
1331
- setThemeInstance(themeOrName);
1332
- this.ui.requestRender();
1333
- return { success: true };
1334
- }
1335
- const result = setTheme(themeOrName, true);
1336
- if (result.success) {
1337
- if (this.settingsManager.getTheme() !== themeOrName) {
1338
- this.settingsManager.setTheme(themeOrName);
1339
- }
1340
- this.ui.requestRender();
1341
- }
1342
- return result;
1343
- },
1344
- getToolsExpanded: () => this.toolOutputExpanded,
1345
- setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
1346
- };
1347
- }
1348
- /**
1349
- * Show a selector for extensions.
1350
- */
1351
- showExtensionSelector(title, options, opts) {
1352
- return new Promise((resolve) => {
1353
- if (opts?.signal?.aborted) {
1354
- resolve(undefined);
1355
- return;
1356
- }
1357
- const onAbort = () => {
1358
- this.hideExtensionSelector();
1359
- resolve(undefined);
1360
- };
1361
- opts?.signal?.addEventListener("abort", onAbort, { once: true });
1362
- this.extensionSelector = new ExtensionSelectorComponent(title, options, (option) => {
1363
- opts?.signal?.removeEventListener("abort", onAbort);
1364
- this.hideExtensionSelector();
1365
- resolve(option);
1366
- }, () => {
1367
- opts?.signal?.removeEventListener("abort", onAbort);
1368
- this.hideExtensionSelector();
1369
- resolve(undefined);
1370
- }, { tui: this.ui, timeout: opts?.timeout });
1371
- this.editorContainer.clear();
1372
- this.editorContainer.addChild(this.extensionSelector);
1373
- this.ui.setFocus(this.extensionSelector);
1374
- this.ui.requestRender();
1375
- });
1376
- }
1377
- /**
1378
- * Hide the extension selector.
1379
- */
1380
- hideExtensionSelector() {
1381
- this.extensionSelector?.dispose();
1382
- this.editorContainer.clear();
1383
- this.editorContainer.addChild(this.editor);
1384
- this.extensionSelector = undefined;
1385
- this.ui.setFocus(this.editor);
1386
- this.ui.requestRender();
1387
- }
1388
- /**
1389
- * Show a confirmation dialog for extensions.
1390
- */
1391
- async showExtensionConfirm(title, message, opts) {
1392
- const result = await this.showExtensionSelector(`${title}\n${message}`, ["Yes", "No"], opts);
1393
- return result === "Yes";
1394
- }
1395
- async promptForMissingSessionCwd(error) {
1396
- const confirmed = await this.showExtensionConfirm("Session cwd not found", formatMissingSessionCwdPrompt(error.issue));
1397
- return confirmed ? error.issue.fallbackCwd : undefined;
1398
- }
1399
- /**
1400
- * Show a text input for extensions.
1401
- */
1402
- showExtensionInput(title, placeholder, opts) {
1403
- return new Promise((resolve) => {
1404
- if (opts?.signal?.aborted) {
1405
- resolve(undefined);
1406
- return;
1407
- }
1408
- const onAbort = () => {
1409
- this.hideExtensionInput();
1410
- resolve(undefined);
1411
- };
1412
- opts?.signal?.addEventListener("abort", onAbort, { once: true });
1413
- this.extensionInput = new ExtensionInputComponent(title, placeholder, (value) => {
1414
- opts?.signal?.removeEventListener("abort", onAbort);
1415
- this.hideExtensionInput();
1416
- resolve(value);
1417
- }, () => {
1418
- opts?.signal?.removeEventListener("abort", onAbort);
1419
- this.hideExtensionInput();
1420
- resolve(undefined);
1421
- }, { tui: this.ui, timeout: opts?.timeout });
1422
- this.editorContainer.clear();
1423
- this.editorContainer.addChild(this.extensionInput);
1424
- this.ui.setFocus(this.extensionInput);
1425
- this.ui.requestRender();
1426
- });
1427
- }
1428
- /**
1429
- * Hide the extension input.
1430
- */
1431
- hideExtensionInput() {
1432
- this.extensionInput?.dispose();
1433
- this.editorContainer.clear();
1434
- this.editorContainer.addChild(this.editor);
1435
- this.extensionInput = undefined;
1436
- this.ui.setFocus(this.editor);
1437
- this.ui.requestRender();
1438
- }
1439
- /**
1440
- * Show a multi-line editor for extensions (with Ctrl+G support).
1441
- */
1442
- showExtensionEditor(title, prefill) {
1443
- return new Promise((resolve) => {
1444
- this.extensionEditor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => {
1445
- this.hideExtensionEditor();
1446
- resolve(value);
1447
- }, () => {
1448
- this.hideExtensionEditor();
1449
- resolve(undefined);
1450
- });
1451
- this.editorContainer.clear();
1452
- this.editorContainer.addChild(this.extensionEditor);
1453
- this.ui.setFocus(this.extensionEditor);
1454
- this.ui.requestRender();
1455
- });
1456
- }
1457
- /**
1458
- * Hide the extension editor.
1459
- */
1460
- hideExtensionEditor() {
1461
- this.editorContainer.clear();
1462
- this.editorContainer.addChild(this.editor);
1463
- this.extensionEditor = undefined;
1464
- this.ui.setFocus(this.editor);
1465
- this.ui.requestRender();
1466
- }
1467
- /**
1468
- * Set a custom editor component from an extension.
1469
- * Pass undefined to restore the default editor.
1470
- */
1471
- setCustomEditorComponent(factory) {
1472
- // Save text from current editor before switching
1473
- const currentText = this.editor.getText();
1474
- this.editorContainer.clear();
1475
- if (factory) {
1476
- // Create the custom editor with tui, theme, and keybindings
1477
- const newEditor = factory(this.ui, getEditorTheme(), this.keybindings);
1478
- // Wire up callbacks from the default editor
1479
- newEditor.onSubmit = this.defaultEditor.onSubmit;
1480
- newEditor.onChange = this.defaultEditor.onChange;
1481
- // Copy text from previous editor
1482
- newEditor.setText(currentText);
1483
- // Copy appearance settings if supported
1484
- if (newEditor.borderColor !== undefined) {
1485
- newEditor.borderColor = this.defaultEditor.borderColor;
1486
- }
1487
- if (newEditor.setPaddingX !== undefined) {
1488
- newEditor.setPaddingX(this.defaultEditor.getPaddingX());
1489
- }
1490
- // Set autocomplete if supported
1491
- if (newEditor.setAutocompleteProvider && this.autocompleteProvider) {
1492
- newEditor.setAutocompleteProvider(this.autocompleteProvider);
1493
- }
1494
- // If extending CustomEditor, copy app-level handlers
1495
- // Use duck typing since instanceof fails across jiti module boundaries
1496
- const customEditor = newEditor;
1497
- if ("actionHandlers" in customEditor && customEditor.actionHandlers instanceof Map) {
1498
- if (!customEditor.onEscape) {
1499
- customEditor.onEscape = () => this.defaultEditor.onEscape?.();
1500
- }
1501
- if (!customEditor.onCtrlD) {
1502
- customEditor.onCtrlD = () => this.defaultEditor.onCtrlD?.();
1503
- }
1504
- if (!customEditor.onPasteImage) {
1505
- customEditor.onPasteImage = () => this.defaultEditor.onPasteImage?.();
1506
- }
1507
- if (!customEditor.onExtensionShortcut) {
1508
- customEditor.onExtensionShortcut = (data) => this.defaultEditor.onExtensionShortcut?.(data);
1509
- }
1510
- // Copy action handlers (clear, suspend, model switching, etc.)
1511
- for (const [action, handler] of this.defaultEditor.actionHandlers) {
1512
- customEditor.actionHandlers.set(action, handler);
1513
- }
1514
- }
1515
- this.editor = newEditor;
1516
- }
1517
- else {
1518
- // Restore default editor with text from custom editor
1519
- this.defaultEditor.setText(currentText);
1520
- this.editor = this.defaultEditor;
1521
- }
1522
- this.editorContainer.addChild(this.editor);
1523
- this.ui.setFocus(this.editor);
1524
- this.ui.requestRender();
1525
- }
1526
- /**
1527
- * Show a notification for extensions.
1528
- */
1529
- showExtensionNotify(message, type) {
1530
- if (type === "error") {
1531
- this.showError(message);
1532
- }
1533
- else if (type === "warning") {
1534
- this.showWarning(message);
1535
- }
1536
- else {
1537
- this.showStatus(message);
1538
- }
1539
- }
1540
- /** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
1541
- async showExtensionCustom(factory, options) {
1542
- const savedText = this.editor.getText();
1543
- const isOverlay = options?.overlay ?? false;
1544
- const restoreEditor = () => {
1545
- this.editorContainer.clear();
1546
- this.editorContainer.addChild(this.editor);
1547
- this.editor.setText(savedText);
1548
- this.ui.setFocus(this.editor);
1549
- this.ui.requestRender();
1550
- };
1551
- return new Promise((resolve, reject) => {
1552
- let component;
1553
- let closed = false;
1554
- const close = (result) => {
1555
- if (closed)
1556
- return;
1557
- closed = true;
1558
- if (isOverlay)
1559
- this.ui.hideOverlay();
1560
- else
1561
- restoreEditor();
1562
- // Note: both branches above already call requestRender
1563
- resolve(result);
1564
- try {
1565
- component?.dispose?.();
1566
- }
1567
- catch {
1568
- /* ignore dispose errors */
1569
- }
1570
- };
1571
- Promise.resolve(factory(this.ui, theme, this.keybindings, close))
1572
- .then((c) => {
1573
- if (closed)
1574
- return;
1575
- component = c;
1576
- if (isOverlay) {
1577
- // Resolve overlay options - can be static or dynamic function
1578
- const resolveOptions = () => {
1579
- if (options?.overlayOptions) {
1580
- const opts = typeof options.overlayOptions === "function"
1581
- ? options.overlayOptions()
1582
- : options.overlayOptions;
1583
- return opts;
1584
- }
1585
- // Fallback: use component's width property if available
1586
- const w = component.width;
1587
- return w ? { width: w } : undefined;
1588
- };
1589
- const handle = this.ui.showOverlay(component, resolveOptions());
1590
- // Expose handle to caller for visibility control
1591
- options?.onHandle?.(handle);
1592
- }
1593
- else {
1594
- this.editorContainer.clear();
1595
- this.editorContainer.addChild(component);
1596
- this.ui.setFocus(component);
1597
- this.ui.requestRender();
1598
- }
1599
- })
1600
- .catch((err) => {
1601
- if (closed)
1602
- return;
1603
- if (!isOverlay)
1604
- restoreEditor();
1605
- reject(err);
1606
- });
1607
- });
1608
- }
1609
- /**
1610
- * Show an extension error in the UI.
1611
- */
1612
- showExtensionError(extensionPath, error, stack) {
1613
- const errorMsg = `Extension "${extensionPath}" error: ${error}`;
1614
- const errorText = new Text(theme.fg("error", errorMsg), 1, 0);
1615
- this.chatContainer.addChild(errorText);
1616
- if (stack) {
1617
- // Show stack trace in dim color, indented
1618
- const stackLines = stack
1619
- .split("\n")
1620
- .slice(1) // Skip first line (duplicates error message)
1621
- .map((line) => theme.fg("dim", ` ${line.trim()}`))
1622
- .join("\n");
1623
- if (stackLines) {
1624
- this.chatContainer.addChild(new Text(stackLines, 1, 0));
1625
- }
1626
- }
1627
- this.ui.requestRender();
1628
- }
1629
- // =========================================================================
1630
- // Key Handlers
1631
- // =========================================================================
1632
- setupKeyHandlers() {
1633
- // Set up handlers on defaultEditor - they use this.editor for text access
1634
- // so they work correctly regardless of which editor is active
1635
- this.defaultEditor.onEscape = () => {
1636
- if (this.loadingAnimation) {
1637
- this.restoreQueuedMessagesToEditor({ abort: true });
1638
- }
1639
- else if (this.session.isBashRunning) {
1640
- this.session.abortBash();
1641
- }
1642
- else if (this.isBashMode) {
1643
- this.editor.setText("");
1644
- this.isBashMode = false;
1645
- this.updateEditorBorderColor();
1646
- }
1647
- else if (!this.editor.getText().trim()) {
1648
- // Double-escape with empty editor triggers /tree, /fork, or nothing based on setting
1649
- const action = this.settingsManager.getDoubleEscapeAction();
1650
- if (action !== "none") {
1651
- const now = Date.now();
1652
- if (now - this.lastEscapeTime < 500) {
1653
- if (action === "tree") {
1654
- this.showTreeSelector();
1655
- }
1656
- else {
1657
- this.showUserMessageSelector();
1658
- }
1659
- this.lastEscapeTime = 0;
1660
- }
1661
- else {
1662
- this.lastEscapeTime = now;
1663
- }
1664
- }
1665
- }
1666
- };
1667
- // Register app action handlers
1668
- this.defaultEditor.onAction("app.clear", () => this.handleCtrlC());
1669
- this.defaultEditor.onCtrlD = () => this.handleCtrlD();
1670
- this.defaultEditor.onAction("app.suspend", () => this.handleCtrlZ());
1671
- this.defaultEditor.onAction("app.mode.toggle", () => this.handleModeToggle());
1672
- this.defaultEditor.onAction("app.thinking.cycle", () => this.cycleThinkingLevel());
1673
- this.defaultEditor.onAction("app.model.cycleForward", () => this.cycleModel("forward"));
1674
- this.defaultEditor.onAction("app.model.cycleBackward", () => this.cycleModel("backward"));
1675
- // Global debug handler on TUI (works regardless of focus)
1676
- this.ui.onDebug = () => this.handleDebugCommand();
1677
- this.defaultEditor.onAction("app.model.select", () => this.showModelSelector());
1678
- this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
1679
- this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
1680
- this.defaultEditor.onAction("app.editor.external", () => this.openExternalEditor());
1681
- this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
1682
- this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
1683
- this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
1684
- this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
1685
- this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
1686
- this.defaultEditor.onAction("app.session.resume", () => this.showSessionSelector());
1687
- this.defaultEditor.onChange = (text) => {
1688
- const wasBashMode = this.isBashMode;
1689
- this.isBashMode = text.trimStart().startsWith("!");
1690
- if (wasBashMode !== this.isBashMode) {
1691
- this.updateEditorBorderColor();
1692
- }
1693
- };
1694
- // Handle clipboard image paste (triggered on Ctrl+V)
1695
- this.defaultEditor.onPasteImage = () => {
1696
- this.handleClipboardImagePaste();
1697
- };
1698
- }
1699
- async handleClipboardImagePaste() {
1700
- try {
1701
- const image = await readClipboardImage();
1702
- if (!image) {
1703
- return;
1704
- }
1705
- // Write to temp file
1706
- const tmpDir = os.tmpdir();
1707
- const ext = extensionForImageMimeType(image.mimeType) ?? "png";
1708
- const fileName = `pi-clipboard-${crypto.randomUUID()}.${ext}`;
1709
- const filePath = path.join(tmpDir, fileName);
1710
- fs.writeFileSync(filePath, Buffer.from(image.bytes));
1711
- // Insert file path directly
1712
- this.editor.insertTextAtCursor?.(filePath);
1713
- this.ui.requestRender();
1714
- }
1715
- catch {
1716
- // Silently ignore clipboard errors (may not have permission, etc.)
1717
- }
1718
- }
1719
- setupEditorSubmitHandler() {
1720
- this.defaultEditor.onSubmit = async (text) => {
1721
- text = text.trim();
1722
- if (!text)
1723
- return;
1724
- // Handle commands
1725
- if (text === "/settings") {
1726
- this.showSettingsSelector();
1727
- this.editor.setText("");
1728
- return;
1729
- }
1730
- if (text === "/scoped-models") {
1731
- this.editor.setText("");
1732
- await this.showModelsSelector();
1733
- return;
1734
- }
1735
- if (text === "/model" || text.startsWith("/model ")) {
1736
- const searchTerm = text.startsWith("/model ") ? text.slice(7).trim() : undefined;
1737
- this.editor.setText("");
1738
- await this.handleModelCommand(searchTerm);
1739
- return;
1740
- }
1741
- if (text.startsWith("/export")) {
1742
- await this.handleExportCommand(text);
1743
- this.editor.setText("");
1744
- return;
1745
- }
1746
- if (text.startsWith("/import")) {
1747
- await this.handleImportCommand(text);
1748
- this.editor.setText("");
1749
- return;
1750
- }
1751
- if (text === "/share") {
1752
- await this.handleShareCommand();
1753
- this.editor.setText("");
1754
- return;
1755
- }
1756
- if (text === "/copy") {
1757
- await this.handleCopyCommand();
1758
- this.editor.setText("");
1759
- return;
1760
- }
1761
- if (text === "/name" || text.startsWith("/name ")) {
1762
- this.handleNameCommand(text);
1763
- this.editor.setText("");
1764
- return;
1765
- }
1766
- if (text === "/session") {
1767
- this.handleSessionCommand();
1768
- this.editor.setText("");
1769
- return;
1770
- }
1771
- if (text === "/changelog") {
1772
- this.handleChangelogCommand();
1773
- this.editor.setText("");
1774
- return;
1775
- }
1776
- if (text === "/hotkeys") {
1777
- this.handleHotkeysCommand();
1778
- this.editor.setText("");
1779
- return;
1780
- }
1781
- if (text === "/fork") {
1782
- this.showUserMessageSelector();
1783
- this.editor.setText("");
1784
- return;
1785
- }
1786
- if (text === "/tree") {
1787
- this.showTreeSelector();
1788
- this.editor.setText("");
1789
- return;
1790
- }
1791
- if (text === "/login") {
1792
- this.showOAuthSelector("login");
1793
- this.editor.setText("");
1794
- return;
1795
- }
1796
- if (text === "/logout") {
1797
- this.showOAuthSelector("logout");
1798
- this.editor.setText("");
1799
- return;
1800
- }
1801
- if (text === "/new") {
1802
- this.editor.setText("");
1803
- await this.handleClearCommand();
1804
- return;
1805
- }
1806
- if (text === "/compact" || text.startsWith("/compact ")) {
1807
- const customInstructions = text.startsWith("/compact ") ? text.slice(9).trim() : undefined;
1808
- this.editor.setText("");
1809
- await this.handleCompactCommand(customInstructions);
1810
- return;
1811
- }
1812
- if (text === "/reload") {
1813
- this.editor.setText("");
1814
- await this.handleReloadCommand();
1815
- return;
1816
- }
1817
- if (text === "/debug") {
1818
- this.handleDebugCommand();
1819
- this.editor.setText("");
1820
- return;
1821
- }
1822
- // Pi mascot easter-egg commands removed in the ORIENT rebrand
1823
- // (/arminsayshi, /dementedelves, /daxnuts). They lived here as
1824
- // hidden hotkeys dispatched off raw text. The ORIENT product
1825
- // does not ship them.
1826
- if (text === "/resume") {
1827
- this.showSessionSelector();
1828
- this.editor.setText("");
1829
- return;
1830
- }
1831
- if (text === "/quit") {
1832
- this.editor.setText("");
1833
- await this.shutdown();
1834
- return;
1835
- }
1836
- // Handle bash command (! for normal, !! for excluded from context)
1837
- if (text.startsWith("!")) {
1838
- const isExcluded = text.startsWith("!!");
1839
- const command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();
1840
- if (command) {
1841
- if (this.session.isBashRunning) {
1842
- this.showWarning("A bash command is already running. Press Esc to cancel it first.");
1843
- this.editor.setText(text);
1844
- return;
1845
- }
1846
- this.editor.addToHistory?.(text);
1847
- await this.handleBashCommand(command, isExcluded);
1848
- this.isBashMode = false;
1849
- this.updateEditorBorderColor();
1850
- return;
1851
- }
1852
- }
1853
- // Queue input during compaction (extension commands execute immediately)
1854
- if (this.session.isCompacting) {
1855
- if (this.isExtensionCommand(text)) {
1856
- this.editor.addToHistory?.(text);
1857
- this.editor.setText("");
1858
- await this.session.prompt(text);
1859
- }
1860
- else {
1861
- this.queueCompactionMessage(text, "steer");
1862
- }
1863
- return;
1864
- }
1865
- // If streaming, use prompt() with steer behavior
1866
- // This handles extension commands (execute immediately), prompt template expansion, and queueing
1867
- if (this.session.isStreaming) {
1868
- this.editor.addToHistory?.(text);
1869
- this.editor.setText("");
1870
- await this.session.prompt(text, { streamingBehavior: "steer" });
1871
- this.updatePendingMessagesDisplay();
1872
- this.ui.requestRender();
1873
- return;
1874
- }
1875
- // Normal message submission
1876
- // First, move any pending bash components to chat
1877
- this.flushPendingBashComponents();
1878
- if (this.onInputCallback) {
1879
- this.onInputCallback(text);
1880
- }
1881
- this.editor.addToHistory?.(text);
1882
- };
1883
- }
1884
- subscribeToAgent() {
1885
- this.unsubscribe = this.session.subscribe(async (event) => {
1886
- await this.handleEvent(event);
1887
- });
1888
- }
1889
- async handleEvent(event) {
1890
- if (!this.isInitialized) {
1891
- await this.init();
1892
- }
1893
- this.footer.invalidate();
1894
- switch (event.type) {
1895
- case "agent_start":
1896
- // Restore main escape handler if retry handler is still active
1897
- // (retry success event fires later, but we need main handler now)
1898
- if (this.retryEscapeHandler) {
1899
- this.defaultEditor.onEscape = this.retryEscapeHandler;
1900
- this.retryEscapeHandler = undefined;
1901
- }
1902
- if (this.retryLoader) {
1903
- this.retryLoader.stop();
1904
- this.retryLoader = undefined;
1905
- }
1906
- if (this.loadingAnimation) {
1907
- this.loadingAnimation.stop();
1908
- }
1909
- this.statusContainer.clear();
1910
- this.loadingAnimation = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), this.defaultWorkingMessage);
1911
- this.statusContainer.addChild(this.loadingAnimation);
1912
- // Apply any pending working message queued before loader existed
1913
- if (this.pendingWorkingMessage !== undefined) {
1914
- if (this.pendingWorkingMessage) {
1915
- this.loadingAnimation.setMessage(this.pendingWorkingMessage);
1916
- }
1917
- this.pendingWorkingMessage = undefined;
1918
- }
1919
- this.ui.requestRender();
1920
- break;
1921
- case "queue_update":
1922
- this.updatePendingMessagesDisplay();
1923
- this.ui.requestRender();
1924
- break;
1925
- case "message_start":
1926
- if (event.message.role === "custom") {
1927
- this.addMessageToChat(event.message);
1928
- this.ui.requestRender();
1929
- }
1930
- else if (event.message.role === "user") {
1931
- this.addMessageToChat(event.message);
1932
- this.updatePendingMessagesDisplay();
1933
- this.ui.requestRender();
1934
- }
1935
- else if (event.message.role === "assistant") {
1936
- this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel);
1937
- this.streamingMessage = event.message;
1938
- this.chatContainer.addChild(this.streamingComponent);
1939
- this.streamingComponent.updateContent(this.streamingMessage);
1940
- this.ui.requestRender();
1941
- }
1942
- break;
1943
- case "message_update":
1944
- if (this.streamingComponent && event.message.role === "assistant") {
1945
- this.streamingMessage = event.message;
1946
- this.streamingComponent.updateContent(this.streamingMessage);
1947
- for (const content of this.streamingMessage.content) {
1948
- if (content.type === "toolCall") {
1949
- if (!this.pendingTools.has(content.id)) {
1950
- const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
1951
- showImages: this.settingsManager.getShowImages(),
1952
- }, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
1953
- component.setExpanded(this.toolOutputExpanded);
1954
- this.chatContainer.addChild(component);
1955
- this.pendingTools.set(content.id, component);
1956
- }
1957
- else {
1958
- const component = this.pendingTools.get(content.id);
1959
- if (component) {
1960
- component.updateArgs(content.arguments);
1961
- }
1962
- }
1963
- }
1964
- }
1965
- this.ui.requestRender();
1966
- }
1967
- break;
1968
- case "message_end":
1969
- if (event.message.role === "user")
1970
- break;
1971
- if (this.streamingComponent && event.message.role === "assistant") {
1972
- this.streamingMessage = event.message;
1973
- let errorMessage;
1974
- if (this.streamingMessage.stopReason === "aborted") {
1975
- const retryAttempt = this.session.retryAttempt;
1976
- errorMessage =
1977
- retryAttempt > 0
1978
- ? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? "s" : ""}`
1979
- : "Operation aborted";
1980
- this.streamingMessage.errorMessage = errorMessage;
1981
- }
1982
- this.streamingComponent.updateContent(this.streamingMessage);
1983
- if (this.streamingMessage.stopReason === "aborted" || this.streamingMessage.stopReason === "error") {
1984
- if (!errorMessage) {
1985
- errorMessage = this.streamingMessage.errorMessage || "Error";
1986
- }
1987
- for (const [, component] of this.pendingTools.entries()) {
1988
- component.updateResult({
1989
- content: [{ type: "text", text: errorMessage }],
1990
- isError: true,
1991
- });
1992
- }
1993
- this.pendingTools.clear();
1994
- }
1995
- else {
1996
- // Args are now complete - trigger diff computation for edit tools
1997
- for (const [, component] of this.pendingTools.entries()) {
1998
- component.setArgsComplete();
1999
- }
2000
- }
2001
- this.streamingComponent = undefined;
2002
- this.streamingMessage = undefined;
2003
- this.footer.invalidate();
2004
- }
2005
- this.ui.requestRender();
2006
- break;
2007
- case "tool_execution_start": {
2008
- let component = this.pendingTools.get(event.toolCallId);
2009
- if (!component) {
2010
- component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
2011
- showImages: this.settingsManager.getShowImages(),
2012
- }, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd());
2013
- component.setExpanded(this.toolOutputExpanded);
2014
- this.chatContainer.addChild(component);
2015
- this.pendingTools.set(event.toolCallId, component);
2016
- }
2017
- component.markExecutionStarted();
2018
- this.ui.requestRender();
2019
- break;
2020
- }
2021
- case "tool_execution_update": {
2022
- const component = this.pendingTools.get(event.toolCallId);
2023
- if (component) {
2024
- component.updateResult({ ...event.partialResult, isError: false }, true);
2025
- this.ui.requestRender();
2026
- }
2027
- break;
2028
- }
2029
- case "tool_execution_end": {
2030
- const component = this.pendingTools.get(event.toolCallId);
2031
- if (component) {
2032
- component.updateResult({ ...event.result, isError: event.isError });
2033
- this.pendingTools.delete(event.toolCallId);
2034
- this.ui.requestRender();
2035
- }
2036
- break;
2037
- }
2038
- case "agent_end":
2039
- if (this.loadingAnimation) {
2040
- this.loadingAnimation.stop();
2041
- this.loadingAnimation = undefined;
2042
- this.statusContainer.clear();
2043
- }
2044
- if (this.streamingComponent) {
2045
- this.chatContainer.removeChild(this.streamingComponent);
2046
- this.streamingComponent = undefined;
2047
- this.streamingMessage = undefined;
2048
- }
2049
- this.pendingTools.clear();
2050
- await this.checkShutdownRequested();
2051
- this.ui.requestRender();
2052
- break;
2053
- case "compaction_start": {
2054
- // Keep editor active; submissions are queued during compaction.
2055
- this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;
2056
- this.defaultEditor.onEscape = () => {
2057
- this.session.abortCompaction();
2058
- };
2059
- this.statusContainer.clear();
2060
- const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
2061
- const label = event.reason === "manual"
2062
- ? `Compacting context... ${cancelHint}`
2063
- : `${event.reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
2064
- this.autoCompactionLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), label);
2065
- this.statusContainer.addChild(this.autoCompactionLoader);
2066
- this.ui.requestRender();
2067
- break;
2068
- }
2069
- case "compaction_end": {
2070
- if (this.autoCompactionEscapeHandler) {
2071
- this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;
2072
- this.autoCompactionEscapeHandler = undefined;
2073
- }
2074
- if (this.autoCompactionLoader) {
2075
- this.autoCompactionLoader.stop();
2076
- this.autoCompactionLoader = undefined;
2077
- this.statusContainer.clear();
2078
- }
2079
- if (event.aborted) {
2080
- if (event.reason === "manual") {
2081
- this.showError("Compaction cancelled");
2082
- }
2083
- else {
2084
- this.showStatus("Auto-compaction cancelled");
2085
- }
2086
- }
2087
- else if (event.result) {
2088
- this.chatContainer.clear();
2089
- this.rebuildChatFromMessages();
2090
- this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
2091
- this.footer.invalidate();
2092
- }
2093
- else if (event.errorMessage) {
2094
- if (event.reason === "manual") {
2095
- this.showError(event.errorMessage);
2096
- }
2097
- else {
2098
- this.chatContainer.addChild(new Spacer(1));
2099
- this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
2100
- }
2101
- }
2102
- void this.flushCompactionQueue({ willRetry: event.willRetry });
2103
- this.ui.requestRender();
2104
- break;
2105
- }
2106
- case "auto_retry_start": {
2107
- // Set up escape to abort retry
2108
- this.retryEscapeHandler = this.defaultEditor.onEscape;
2109
- this.defaultEditor.onEscape = () => {
2110
- this.session.abortRetry();
2111
- };
2112
- // Show retry indicator
2113
- this.statusContainer.clear();
2114
- const delaySeconds = Math.round(event.delayMs / 1000);
2115
- this.retryLoader = new Loader(this.ui, (spinner) => theme.fg("warning", spinner), (text) => theme.fg("muted", text), `Retrying (${event.attempt}/${event.maxAttempts}) in ${delaySeconds}s... (${keyText("app.interrupt")} to cancel)`);
2116
- this.statusContainer.addChild(this.retryLoader);
2117
- this.ui.requestRender();
2118
- break;
2119
- }
2120
- case "auto_retry_end": {
2121
- // Restore escape handler
2122
- if (this.retryEscapeHandler) {
2123
- this.defaultEditor.onEscape = this.retryEscapeHandler;
2124
- this.retryEscapeHandler = undefined;
2125
- }
2126
- // Stop loader
2127
- if (this.retryLoader) {
2128
- this.retryLoader.stop();
2129
- this.retryLoader = undefined;
2130
- this.statusContainer.clear();
2131
- }
2132
- // Show error only on final failure (success shows normal response)
2133
- if (!event.success) {
2134
- this.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || "Unknown error"}`);
2135
- }
2136
- this.ui.requestRender();
2137
- break;
2138
- }
2139
- }
2140
- }
2141
- /** Extract text content from a user message */
2142
- getUserMessageText(message) {
2143
- if (message.role !== "user")
2144
- return "";
2145
- const textBlocks = typeof message.content === "string"
2146
- ? [{ type: "text", text: message.content }]
2147
- : message.content.filter((c) => c.type === "text");
2148
- return textBlocks.map((c) => c.text).join("");
2149
- }
2150
- /**
2151
- * Show a status message in the chat.
2152
- *
2153
- * If multiple status messages are emitted back-to-back (without anything else being added to the chat),
2154
- * we update the previous status line instead of appending new ones to avoid log spam.
2155
- */
2156
- showStatus(message) {
2157
- const children = this.chatContainer.children;
2158
- const last = children.length > 0 ? children[children.length - 1] : undefined;
2159
- const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
2160
- if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
2161
- this.lastStatusText.setText(theme.fg("dim", message));
2162
- this.ui.requestRender();
2163
- return;
2164
- }
2165
- const spacer = new Spacer(1);
2166
- const text = new Text(theme.fg("dim", message), 1, 0);
2167
- this.chatContainer.addChild(spacer);
2168
- this.chatContainer.addChild(text);
2169
- this.lastStatusSpacer = spacer;
2170
- this.lastStatusText = text;
2171
- this.ui.requestRender();
2172
- }
2173
- addMessageToChat(message, options) {
2174
- switch (message.role) {
2175
- case "bashExecution": {
2176
- const component = new BashExecutionComponent(message.command, this.ui, message.excludeFromContext);
2177
- if (message.output) {
2178
- component.appendOutput(message.output);
2179
- }
2180
- component.setComplete(message.exitCode, message.cancelled, message.truncated ? { truncated: true } : undefined, message.fullOutputPath);
2181
- this.chatContainer.addChild(component);
2182
- break;
2183
- }
2184
- case "custom": {
2185
- if (message.display) {
2186
- const renderer = this.session.extensionRunner?.getMessageRenderer(message.customType);
2187
- const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings());
2188
- component.setExpanded(this.toolOutputExpanded);
2189
- this.chatContainer.addChild(component);
2190
- }
2191
- break;
2192
- }
2193
- case "compactionSummary": {
2194
- this.chatContainer.addChild(new Spacer(1));
2195
- const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings());
2196
- component.setExpanded(this.toolOutputExpanded);
2197
- this.chatContainer.addChild(component);
2198
- break;
2199
- }
2200
- case "branchSummary": {
2201
- this.chatContainer.addChild(new Spacer(1));
2202
- const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings());
2203
- component.setExpanded(this.toolOutputExpanded);
2204
- this.chatContainer.addChild(component);
2205
- break;
2206
- }
2207
- case "user": {
2208
- const textContent = this.getUserMessageText(message);
2209
- if (textContent) {
2210
- const skillBlock = parseSkillBlock(textContent);
2211
- if (skillBlock) {
2212
- // Render skill block (collapsible)
2213
- this.chatContainer.addChild(new Spacer(1));
2214
- const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings());
2215
- component.setExpanded(this.toolOutputExpanded);
2216
- this.chatContainer.addChild(component);
2217
- // Render user message separately if present
2218
- if (skillBlock.userMessage) {
2219
- const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings());
2220
- this.chatContainer.addChild(userComponent);
2221
- }
2222
- }
2223
- else {
2224
- const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings());
2225
- this.chatContainer.addChild(userComponent);
2226
- }
2227
- if (options?.populateHistory) {
2228
- this.editor.addToHistory?.(textContent);
2229
- }
2230
- }
2231
- break;
2232
- }
2233
- case "assistant": {
2234
- const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel);
2235
- this.chatContainer.addChild(assistantComponent);
2236
- break;
2237
- }
2238
- case "toolResult": {
2239
- // Tool results are rendered inline with tool calls, handled separately
2240
- break;
2241
- }
2242
- default: {
2243
- const _exhaustive = message;
2244
- }
2245
- }
2246
- }
2247
- /**
2248
- * Render session context to chat. Used for initial load and rebuild after compaction.
2249
- * @param sessionContext Session context to render
2250
- * @param options.updateFooter Update footer state
2251
- * @param options.populateHistory Add user messages to editor history
2252
- */
2253
- renderSessionContext(sessionContext, options = {}) {
2254
- this.pendingTools.clear();
2255
- if (options.updateFooter) {
2256
- this.footer.invalidate();
2257
- this.updateEditorBorderColor();
2258
- }
2259
- for (const message of sessionContext.messages) {
2260
- // Assistant messages need special handling for tool calls
2261
- if (message.role === "assistant") {
2262
- this.addMessageToChat(message);
2263
- // Render tool call components
2264
- for (const content of message.content) {
2265
- if (content.type === "toolCall") {
2266
- const component = new ToolExecutionComponent(content.name, content.id, content.arguments, { showImages: this.settingsManager.getShowImages() }, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
2267
- component.setExpanded(this.toolOutputExpanded);
2268
- this.chatContainer.addChild(component);
2269
- if (message.stopReason === "aborted" || message.stopReason === "error") {
2270
- let errorMessage;
2271
- if (message.stopReason === "aborted") {
2272
- const retryAttempt = this.session.retryAttempt;
2273
- errorMessage =
2274
- retryAttempt > 0
2275
- ? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? "s" : ""}`
2276
- : "Operation aborted";
2277
- }
2278
- else {
2279
- errorMessage = message.errorMessage || "Error";
2280
- }
2281
- component.updateResult({ content: [{ type: "text", text: errorMessage }], isError: true });
2282
- }
2283
- else {
2284
- this.pendingTools.set(content.id, component);
2285
- }
2286
- }
2287
- }
2288
- }
2289
- else if (message.role === "toolResult") {
2290
- // Match tool results to pending tool components
2291
- const component = this.pendingTools.get(message.toolCallId);
2292
- if (component) {
2293
- component.updateResult(message);
2294
- this.pendingTools.delete(message.toolCallId);
2295
- }
2296
- }
2297
- else {
2298
- // All other messages use standard rendering
2299
- this.addMessageToChat(message, options);
2300
- }
2301
- }
2302
- this.pendingTools.clear();
2303
- this.ui.requestRender();
2304
- }
2305
- renderInitialMessages() {
2306
- // Get aligned messages and entries from session context
2307
- const context = this.sessionManager.buildSessionContext();
2308
- this.renderSessionContext(context, {
2309
- updateFooter: true,
2310
- populateHistory: true,
2311
- });
2312
- // Show compaction info if session was compacted
2313
- const allEntries = this.sessionManager.getEntries();
2314
- const compactionCount = allEntries.filter((e) => e.type === "compaction").length;
2315
- if (compactionCount > 0) {
2316
- const times = compactionCount === 1 ? "1 time" : `${compactionCount} times`;
2317
- this.showStatus(`Session compacted ${times}`);
2318
- }
2319
- }
2320
- async getUserInput() {
2321
- return new Promise((resolve) => {
2322
- this.onInputCallback = (text) => {
2323
- this.onInputCallback = undefined;
2324
- resolve(text);
2325
- };
2326
- });
2327
- }
2328
- rebuildChatFromMessages() {
2329
- this.chatContainer.clear();
2330
- const context = this.sessionManager.buildSessionContext();
2331
- this.renderSessionContext(context);
2332
- }
2333
- // =========================================================================
2334
- // Key handlers
2335
- // =========================================================================
2336
- handleCtrlC() {
2337
- const now = Date.now();
2338
- if (now - this.lastSigintTime < 500) {
2339
- void this.shutdown();
2340
- }
2341
- else {
2342
- this.clearEditor();
2343
- this.lastSigintTime = now;
2344
- }
2345
- }
2346
- handleCtrlD() {
2347
- // Only called when editor is empty (enforced by CustomEditor)
2348
- void this.shutdown();
2349
- }
2350
- /**
2351
- * Gracefully shutdown the agent.
2352
- * Emits shutdown event to extensions, then exits.
2353
- */
2354
- isShuttingDown = false;
2355
- async shutdown() {
2356
- if (this.isShuttingDown)
2357
- return;
2358
- this.isShuttingDown = true;
2359
- await this.runtimeHost.dispose();
2360
- // Wait for any pending renders to complete
2361
- // requestRender() uses process.nextTick(), so we wait one tick
2362
- await new Promise((resolve) => process.nextTick(resolve));
2363
- // Drain any in-flight Kitty key release events before stopping.
2364
- // This prevents escape sequences from leaking to the parent shell over slow SSH.
2365
- await this.ui.terminal.drainInput(1000);
2366
- this.stop();
2367
- process.exit(0);
2368
- }
2369
- /**
2370
- * Check if shutdown was requested and perform shutdown if so.
2371
- */
2372
- async checkShutdownRequested() {
2373
- if (!this.shutdownRequested)
2374
- return;
2375
- await this.shutdown();
2376
- }
2377
- handleCtrlZ() {
2378
- // Keep the event loop alive while suspended. Without this, stopping the TUI
2379
- // can leave Node with no ref'ed handles, causing the process to exit on fg
2380
- // before the SIGCONT handler gets a chance to restore the terminal.
2381
- const suspendKeepAlive = setInterval(() => { }, 2 ** 30);
2382
- // Ignore SIGINT while suspended so Ctrl+C in the terminal does not
2383
- // kill the backgrounded process. The handler is removed on resume.
2384
- const ignoreSigint = () => { };
2385
- process.on("SIGINT", ignoreSigint);
2386
- // Set up handler to restore TUI when resumed
2387
- process.once("SIGCONT", () => {
2388
- clearInterval(suspendKeepAlive);
2389
- process.removeListener("SIGINT", ignoreSigint);
2390
- this.ui.start();
2391
- this.ui.requestRender(true);
2392
- });
2393
- try {
2394
- // Stop the TUI (restore terminal to normal mode)
2395
- this.ui.stop();
2396
- // Send SIGTSTP to process group (pid=0 means all processes in group)
2397
- process.kill(0, "SIGTSTP");
2398
- }
2399
- catch (error) {
2400
- clearInterval(suspendKeepAlive);
2401
- process.removeListener("SIGINT", ignoreSigint);
2402
- throw error;
2403
- }
2404
- }
2405
- async handleFollowUp() {
2406
- const text = (this.editor.getExpandedText?.() ?? this.editor.getText()).trim();
2407
- if (!text)
2408
- return;
2409
- // Queue input during compaction (extension commands execute immediately)
2410
- if (this.session.isCompacting) {
2411
- if (this.isExtensionCommand(text)) {
2412
- this.editor.addToHistory?.(text);
2413
- this.editor.setText("");
2414
- await this.session.prompt(text);
2415
- }
2416
- else {
2417
- this.queueCompactionMessage(text, "followUp");
2418
- }
2419
- return;
2420
- }
2421
- // Alt+Enter queues a follow-up message (waits until agent finishes)
2422
- // This handles extension commands (execute immediately), prompt template expansion, and queueing
2423
- if (this.session.isStreaming) {
2424
- this.editor.addToHistory?.(text);
2425
- this.editor.setText("");
2426
- await this.session.prompt(text, { streamingBehavior: "followUp" });
2427
- this.updatePendingMessagesDisplay();
2428
- this.ui.requestRender();
2429
- }
2430
- // If not streaming, Alt+Enter acts like regular Enter (trigger onSubmit)
2431
- else if (this.editor.onSubmit) {
2432
- this.editor.onSubmit(text);
2433
- }
2434
- }
2435
- handleDequeue() {
2436
- const restored = this.restoreQueuedMessagesToEditor();
2437
- if (restored === 0) {
2438
- this.showStatus("No queued messages to restore");
2439
- }
2440
- else {
2441
- this.showStatus(`Restored ${restored} queued message${restored > 1 ? "s" : ""} to editor`);
2442
- }
2443
- }
2444
- updateEditorBorderColor() {
2445
- if (this.isBashMode) {
2446
- this.editor.borderColor = theme.getBashModeBorderColor();
2447
- }
2448
- else {
2449
- const level = this.session.thinkingLevel || "off";
2450
- this.editor.borderColor = theme.getThinkingBorderColor(level);
2451
- }
2452
- this.ui.requestRender();
2453
- }
2454
- /**
2455
- * Handle shift+tab — toggle between Plan and Execute sub-modes.
2456
- *
2457
- * This is the ORIENT dual-mode UX borrowed from openclaude
2458
- * (Gitlawb/openclaude) and anomalyco/opencode. Both reference
2459
- * projects bind shift+tab (or a permission-mode cycle) to flip
2460
- * between a read-only "plan" agent state and an edit-capable
2461
- * "execute" state. ORIENT follows the same convention.
2462
- *
2463
- * Semantics (plan-execute mode only):
2464
- * - `idle` → `planning` (first press — starts drafting)
2465
- * - `planning` → `executing` (approves the current plan, like /execute)
2466
- * - `executing` → `planning` (revises — same as /plan.revise)
2467
- *
2468
- * State lives at `.orient-cli/plan-state.json` at the project
2469
- * root, so reading / writing from interactive-mode here stays in
2470
- * sync with the orient extension's /plan /execute commands. The
2471
- * two entry points manipulate the same on-disk source of truth.
2472
- *
2473
- * In ORIENT framework mode, shift+tab is a no-op with a helpful
2474
- * message — phase transitions are explicit (/orient.transition
2475
- * and /orient.<phase>), not shortcut-driven.
2476
- */
2477
- handleModeToggle() {
2478
- const cwd = this.sessionManager.getCwd();
2479
- // CONFIG_DIR_NAME resolves to ".orient-cli" via piConfig/orientConfig.
2480
- const configDir = path.join(cwd, CONFIG_DIR_NAME);
2481
- const modeFile = path.join(configDir, "mode");
2482
- const stateFile = path.join(configDir, "plan-state.json");
2483
- // Read the current product mode. Default is plan-execute.
2484
- let mode = "plan-execute";
2485
- try {
2486
- if (fs.existsSync(modeFile)) {
2487
- const raw = fs.readFileSync(modeFile, "utf-8").trim();
2488
- if (raw === "orient" || raw === "plan-execute")
2489
- mode = raw;
2490
- }
2491
- }
2492
- catch {
2493
- // Fall through — treat unreadable file as plan-execute default.
2494
- }
2495
- if (mode === "orient") {
2496
- this.showStatus("shift+tab is a Plan/Execute shortcut; in ORIENT framework mode, use /orient.<phase> to transition. Switch modes with /orient.mode plan-execute.");
2497
- return;
2498
- }
2499
- let session = {
2500
- state: "idle",
2501
- goal: "",
2502
- updatedAt: new Date().toISOString(),
2503
- steps: [],
2504
- currentStepIndex: -1,
2505
- };
2506
- try {
2507
- if (fs.existsSync(stateFile)) {
2508
- const parsed = JSON.parse(fs.readFileSync(stateFile, "utf-8"));
2509
- if (parsed && typeof parsed === "object")
2510
- session = { ...session, ...parsed };
2511
- }
2512
- }
2513
- catch {
2514
- // Corrupt state file → reset to idle.
2515
- }
2516
- const before = session.state;
2517
- let after;
2518
- switch (session.state) {
2519
- case "planning":
2520
- after = "executing";
2521
- break;
2522
- case "executing":
2523
- after = "planning";
2524
- break;
2525
- default:
2526
- // idle → planning
2527
- after = "planning";
2528
- break;
2529
- }
2530
- session.state = after;
2531
- session.updatedAt = new Date().toISOString();
2532
- try {
2533
- fs.mkdirSync(configDir, { recursive: true });
2534
- fs.writeFileSync(stateFile, JSON.stringify(session, null, 2), "utf-8");
2535
- }
2536
- catch (err) {
2537
- this.showError(`Failed to persist mode toggle: ${err.message}`);
2538
- return;
2539
- }
2540
- // Update the status bar and log a one-line banner in chat.
2541
- // The extension's session_start hook handles the system-reminder
2542
- // injection on the next user turn; here we just change state +
2543
- // surface the change visually so the user sees the flip immediately.
2544
- const statusText = after === "planning" ? "plan" : "execute";
2545
- this.showStatus(`Mode: ${before} → ${after}`);
2546
- this.chatContainer.addChild(new Spacer(1));
2547
- const bannerText = after === "planning"
2548
- ? theme.fg("accent", "▣ Plan mode") +
2549
- theme.fg("muted", " — agent will draft into .orient-cli/plans/current.md without editing any other file. Type /execute or press shift+tab again to approve.")
2550
- : theme.fg("accent", "▶ Execute mode") +
2551
- theme.fg("muted", " — agent will read the plan and walk its steps. Press shift+tab to revise the plan.");
2552
- this.chatContainer.addChild(new Text(bannerText, 1, 0));
2553
- this.ui.requestRender();
2554
- // Track the transition in the footer status namespace so the
2555
- // orient extension's next session_start can read it back. This
2556
- // is the same channel ctx.ui.setStatus() uses from extensions.
2557
- this.footerDataProvider.setExtensionStatus("orient", statusText);
2558
- }
2559
- cycleThinkingLevel() {
2560
- const newLevel = this.session.cycleThinkingLevel();
2561
- if (newLevel === undefined) {
2562
- this.showStatus("Current model does not support thinking");
2563
- }
2564
- else {
2565
- this.footer.invalidate();
2566
- this.updateEditorBorderColor();
2567
- this.showStatus(`Thinking level: ${newLevel}`);
2568
- }
2569
- }
2570
- async cycleModel(direction) {
2571
- try {
2572
- const result = await this.session.cycleModel(direction);
2573
- if (result === undefined) {
2574
- const msg = this.session.scopedModels.length > 0 ? "Only one model in scope" : "Only one model available";
2575
- this.showStatus(msg);
2576
- }
2577
- else {
2578
- this.footer.invalidate();
2579
- this.updateEditorBorderColor();
2580
- const thinkingStr = result.model.reasoning && result.thinkingLevel !== "off" ? ` (thinking: ${result.thinkingLevel})` : "";
2581
- this.showStatus(`Switched to ${result.model.name || result.model.id}${thinkingStr}`);
2582
- void this.maybeWarnAboutAnthropicSubscriptionAuth(result.model);
2583
- }
2584
- }
2585
- catch (error) {
2586
- this.showError(error instanceof Error ? error.message : String(error));
2587
- }
2588
- }
2589
- toggleToolOutputExpansion() {
2590
- this.setToolsExpanded(!this.toolOutputExpanded);
2591
- }
2592
- setToolsExpanded(expanded) {
2593
- this.toolOutputExpanded = expanded;
2594
- for (const child of this.chatContainer.children) {
2595
- if (isExpandable(child)) {
2596
- child.setExpanded(expanded);
2597
- }
2598
- }
2599
- this.ui.requestRender();
2600
- }
2601
- toggleThinkingBlockVisibility() {
2602
- this.hideThinkingBlock = !this.hideThinkingBlock;
2603
- this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
2604
- // Rebuild chat from session messages
2605
- this.chatContainer.clear();
2606
- this.rebuildChatFromMessages();
2607
- // If streaming, re-add the streaming component with updated visibility and re-render
2608
- if (this.streamingComponent && this.streamingMessage) {
2609
- this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock);
2610
- this.streamingComponent.updateContent(this.streamingMessage);
2611
- this.chatContainer.addChild(this.streamingComponent);
2612
- }
2613
- this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
2614
- }
2615
- openExternalEditor() {
2616
- // Determine editor (respect $VISUAL, then $EDITOR)
2617
- const editorCmd = process.env.VISUAL || process.env.EDITOR;
2618
- if (!editorCmd) {
2619
- this.showWarning("No editor configured. Set $VISUAL or $EDITOR environment variable.");
2620
- return;
2621
- }
2622
- const currentText = this.editor.getExpandedText?.() ?? this.editor.getText();
2623
- const tmpFile = path.join(os.tmpdir(), `pi-editor-${Date.now()}.pi.md`);
2624
- try {
2625
- // Write current content to temp file
2626
- fs.writeFileSync(tmpFile, currentText, "utf-8");
2627
- // Stop TUI to release terminal
2628
- this.ui.stop();
2629
- // Split by space to support editor arguments (e.g., "code --wait")
2630
- const [editor, ...editorArgs] = editorCmd.split(" ");
2631
- // Spawn editor synchronously with inherited stdio for interactive editing
2632
- const result = spawnSync(editor, [...editorArgs, tmpFile], {
2633
- stdio: "inherit",
2634
- shell: process.platform === "win32",
2635
- });
2636
- // On successful exit (status 0), replace editor content
2637
- if (result.status === 0) {
2638
- const newContent = fs.readFileSync(tmpFile, "utf-8").replace(/\n$/, "");
2639
- this.editor.setText(newContent);
2640
- }
2641
- // On non-zero exit, keep original text (no action needed)
2642
- }
2643
- finally {
2644
- // Clean up temp file
2645
- try {
2646
- fs.unlinkSync(tmpFile);
2647
- }
2648
- catch {
2649
- // Ignore cleanup errors
2650
- }
2651
- // Restart TUI
2652
- this.ui.start();
2653
- // Force full re-render since external editor uses alternate screen
2654
- this.ui.requestRender(true);
2655
- }
2656
- }
2657
- // =========================================================================
2658
- // UI helpers
2659
- // =========================================================================
2660
- clearEditor() {
2661
- this.editor.setText("");
2662
- this.ui.requestRender();
2663
- }
2664
- showError(errorMessage) {
2665
- this.chatContainer.addChild(new Spacer(1));
2666
- this.chatContainer.addChild(new Text(theme.fg("error", `Error: ${errorMessage}`), 1, 0));
2667
- this.ui.requestRender();
2668
- }
2669
- showWarning(warningMessage) {
2670
- this.chatContainer.addChild(new Spacer(1));
2671
- this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
2672
- this.ui.requestRender();
2673
- }
2674
- showNewVersionNotification(newVersion) {
2675
- const action = theme.fg("accent", getUpdateInstruction("orient-cli"));
2676
- const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
2677
- const changelogUrl = theme.fg("accent", "https://github.com/j-cloud-logic/orient-cli/blob/main/packages/orient/CHANGELOG.md");
2678
- const changelogLine = theme.fg("muted", "Changelog: ") + changelogUrl;
2679
- this.chatContainer.addChild(new Spacer(1));
2680
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2681
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction}\n${changelogLine}`, 1, 0));
2682
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2683
- this.ui.requestRender();
2684
- }
2685
- showPackageUpdateNotification(packages) {
2686
- const action = theme.fg("accent", `${APP_NAME} update`);
2687
- const updateInstruction = theme.fg("muted", "Package updates are available. Run ") + action;
2688
- const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
2689
- this.chatContainer.addChild(new Spacer(1));
2690
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2691
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
2692
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2693
- this.ui.requestRender();
2694
- }
2695
- /**
2696
- * Get all queued messages (read-only).
2697
- * Combines session queue and compaction queue.
2698
- */
2699
- getAllQueuedMessages() {
2700
- return {
2701
- steering: [
2702
- ...this.session.getSteeringMessages(),
2703
- ...this.compactionQueuedMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text),
2704
- ],
2705
- followUp: [
2706
- ...this.session.getFollowUpMessages(),
2707
- ...this.compactionQueuedMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text),
2708
- ],
2709
- };
2710
- }
2711
- /**
2712
- * Clear all queued messages and return their contents.
2713
- * Clears both session queue and compaction queue.
2714
- */
2715
- clearAllQueues() {
2716
- const { steering, followUp } = this.session.clearQueue();
2717
- const compactionSteering = this.compactionQueuedMessages
2718
- .filter((msg) => msg.mode === "steer")
2719
- .map((msg) => msg.text);
2720
- const compactionFollowUp = this.compactionQueuedMessages
2721
- .filter((msg) => msg.mode === "followUp")
2722
- .map((msg) => msg.text);
2723
- this.compactionQueuedMessages = [];
2724
- return {
2725
- steering: [...steering, ...compactionSteering],
2726
- followUp: [...followUp, ...compactionFollowUp],
2727
- };
2728
- }
2729
- updatePendingMessagesDisplay() {
2730
- this.pendingMessagesContainer.clear();
2731
- const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
2732
- if (steeringMessages.length > 0 || followUpMessages.length > 0) {
2733
- this.pendingMessagesContainer.addChild(new Spacer(1));
2734
- for (const message of steeringMessages) {
2735
- const text = theme.fg("dim", `Steering: ${message}`);
2736
- this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
2737
- }
2738
- for (const message of followUpMessages) {
2739
- const text = theme.fg("dim", `Follow-up: ${message}`);
2740
- this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
2741
- }
2742
- const dequeueHint = this.getAppKeyDisplay("app.message.dequeue");
2743
- const hintText = theme.fg("dim", `↳ ${dequeueHint} to edit all queued messages`);
2744
- this.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));
2745
- }
2746
- }
2747
- restoreQueuedMessagesToEditor(options) {
2748
- const { steering, followUp } = this.clearAllQueues();
2749
- const allQueued = [...steering, ...followUp];
2750
- if (allQueued.length === 0) {
2751
- this.updatePendingMessagesDisplay();
2752
- if (options?.abort) {
2753
- this.agent.abort();
2754
- }
2755
- return 0;
2756
- }
2757
- const queuedText = allQueued.join("\n\n");
2758
- const currentText = options?.currentText ?? this.editor.getText();
2759
- const combinedText = [queuedText, currentText].filter((t) => t.trim()).join("\n\n");
2760
- this.editor.setText(combinedText);
2761
- this.updatePendingMessagesDisplay();
2762
- if (options?.abort) {
2763
- this.agent.abort();
2764
- }
2765
- return allQueued.length;
2766
- }
2767
- queueCompactionMessage(text, mode) {
2768
- this.compactionQueuedMessages.push({ text, mode });
2769
- this.editor.addToHistory?.(text);
2770
- this.editor.setText("");
2771
- this.updatePendingMessagesDisplay();
2772
- this.showStatus("Queued message for after compaction");
2773
- }
2774
- isExtensionCommand(text) {
2775
- if (!text.startsWith("/"))
2776
- return false;
2777
- const extensionRunner = this.session.extensionRunner;
2778
- if (!extensionRunner)
2779
- return false;
2780
- const spaceIndex = text.indexOf(" ");
2781
- const commandName = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
2782
- return !!extensionRunner.getCommand(commandName);
2783
- }
2784
- async flushCompactionQueue(options) {
2785
- if (this.compactionQueuedMessages.length === 0) {
2786
- return;
2787
- }
2788
- const queuedMessages = [...this.compactionQueuedMessages];
2789
- this.compactionQueuedMessages = [];
2790
- this.updatePendingMessagesDisplay();
2791
- const restoreQueue = (error) => {
2792
- this.session.clearQueue();
2793
- this.compactionQueuedMessages = queuedMessages;
2794
- this.updatePendingMessagesDisplay();
2795
- this.showError(`Failed to send queued message${queuedMessages.length > 1 ? "s" : ""}: ${error instanceof Error ? error.message : String(error)}`);
2796
- };
2797
- try {
2798
- if (options?.willRetry) {
2799
- // When retry is pending, queue messages for the retry turn
2800
- for (const message of queuedMessages) {
2801
- if (this.isExtensionCommand(message.text)) {
2802
- await this.session.prompt(message.text);
2803
- }
2804
- else if (message.mode === "followUp") {
2805
- await this.session.followUp(message.text);
2806
- }
2807
- else {
2808
- await this.session.steer(message.text);
2809
- }
2810
- }
2811
- this.updatePendingMessagesDisplay();
2812
- return;
2813
- }
2814
- // Find first non-extension-command message to use as prompt
2815
- const firstPromptIndex = queuedMessages.findIndex((message) => !this.isExtensionCommand(message.text));
2816
- if (firstPromptIndex === -1) {
2817
- // All extension commands - execute them all
2818
- for (const message of queuedMessages) {
2819
- await this.session.prompt(message.text);
2820
- }
2821
- return;
2822
- }
2823
- // Execute any extension commands before the first prompt
2824
- const preCommands = queuedMessages.slice(0, firstPromptIndex);
2825
- const firstPrompt = queuedMessages[firstPromptIndex];
2826
- const rest = queuedMessages.slice(firstPromptIndex + 1);
2827
- for (const message of preCommands) {
2828
- await this.session.prompt(message.text);
2829
- }
2830
- // Send first prompt (starts streaming)
2831
- const promptPromise = this.session.prompt(firstPrompt.text).catch((error) => {
2832
- restoreQueue(error);
2833
- });
2834
- // Queue remaining messages
2835
- for (const message of rest) {
2836
- if (this.isExtensionCommand(message.text)) {
2837
- await this.session.prompt(message.text);
2838
- }
2839
- else if (message.mode === "followUp") {
2840
- await this.session.followUp(message.text);
2841
- }
2842
- else {
2843
- await this.session.steer(message.text);
2844
- }
2845
- }
2846
- this.updatePendingMessagesDisplay();
2847
- void promptPromise;
2848
- }
2849
- catch (error) {
2850
- restoreQueue(error);
2851
- }
2852
- }
2853
- /** Move pending bash components from pending area to chat */
2854
- flushPendingBashComponents() {
2855
- for (const component of this.pendingBashComponents) {
2856
- this.pendingMessagesContainer.removeChild(component);
2857
- this.chatContainer.addChild(component);
2858
- }
2859
- this.pendingBashComponents = [];
2860
- }
2861
- // =========================================================================
2862
- // Selectors
2863
- // =========================================================================
2864
- /**
2865
- * Shows a selector component in place of the editor.
2866
- * @param create Factory that receives a `done` callback and returns the component and focus target
2867
- */
2868
- showSelector(create) {
2869
- const done = () => {
2870
- this.editorContainer.clear();
2871
- this.editorContainer.addChild(this.editor);
2872
- this.ui.setFocus(this.editor);
2873
- };
2874
- const { component, focus } = create(done);
2875
- this.editorContainer.clear();
2876
- this.editorContainer.addChild(component);
2877
- this.ui.setFocus(focus);
2878
- this.ui.requestRender();
2879
- }
2880
- showSettingsSelector() {
2881
- this.showSelector((done) => {
2882
- const selector = new SettingsSelectorComponent({
2883
- autoCompact: this.session.autoCompactionEnabled,
2884
- showImages: this.settingsManager.getShowImages(),
2885
- autoResizeImages: this.settingsManager.getImageAutoResize(),
2886
- blockImages: this.settingsManager.getBlockImages(),
2887
- enableSkillCommands: this.settingsManager.getEnableSkillCommands(),
2888
- steeringMode: this.session.steeringMode,
2889
- followUpMode: this.session.followUpMode,
2890
- transport: this.settingsManager.getTransport(),
2891
- thinkingLevel: this.session.thinkingLevel,
2892
- availableThinkingLevels: this.session.getAvailableThinkingLevels(),
2893
- currentTheme: this.settingsManager.getTheme() || "dark",
2894
- availableThemes: getAvailableThemes(),
2895
- hideThinkingBlock: this.hideThinkingBlock,
2896
- collapseChangelog: this.settingsManager.getCollapseChangelog(),
2897
- doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
2898
- treeFilterMode: this.settingsManager.getTreeFilterMode(),
2899
- showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
2900
- editorPaddingX: this.settingsManager.getEditorPaddingX(),
2901
- autocompleteMaxVisible: this.settingsManager.getAutocompleteMaxVisible(),
2902
- quietStartup: this.settingsManager.getQuietStartup(),
2903
- clearOnShrink: this.settingsManager.getClearOnShrink(),
2904
- }, {
2905
- onAutoCompactChange: (enabled) => {
2906
- this.session.setAutoCompactionEnabled(enabled);
2907
- this.footer.setAutoCompactEnabled(enabled);
2908
- },
2909
- onShowImagesChange: (enabled) => {
2910
- this.settingsManager.setShowImages(enabled);
2911
- for (const child of this.chatContainer.children) {
2912
- if (child instanceof ToolExecutionComponent) {
2913
- child.setShowImages(enabled);
2914
- }
2915
- }
2916
- },
2917
- onAutoResizeImagesChange: (enabled) => {
2918
- this.settingsManager.setImageAutoResize(enabled);
2919
- },
2920
- onBlockImagesChange: (blocked) => {
2921
- this.settingsManager.setBlockImages(blocked);
2922
- },
2923
- onEnableSkillCommandsChange: (enabled) => {
2924
- this.settingsManager.setEnableSkillCommands(enabled);
2925
- this.setupAutocomplete(this.fdPath);
2926
- },
2927
- onSteeringModeChange: (mode) => {
2928
- this.session.setSteeringMode(mode);
2929
- },
2930
- onFollowUpModeChange: (mode) => {
2931
- this.session.setFollowUpMode(mode);
2932
- },
2933
- onTransportChange: (transport) => {
2934
- this.settingsManager.setTransport(transport);
2935
- this.session.agent.transport = transport;
2936
- },
2937
- onThinkingLevelChange: (level) => {
2938
- this.session.setThinkingLevel(level);
2939
- this.footer.invalidate();
2940
- this.updateEditorBorderColor();
2941
- },
2942
- onThemeChange: (themeName) => {
2943
- const result = setTheme(themeName, true);
2944
- this.settingsManager.setTheme(themeName);
2945
- this.ui.invalidate();
2946
- if (!result.success) {
2947
- this.showError(`Failed to load theme "${themeName}": ${result.error}\nFell back to dark theme.`);
2948
- }
2949
- },
2950
- onThemePreview: (themeName) => {
2951
- const result = setTheme(themeName, true);
2952
- if (result.success) {
2953
- this.ui.invalidate();
2954
- this.ui.requestRender();
2955
- }
2956
- },
2957
- onHideThinkingBlockChange: (hidden) => {
2958
- this.hideThinkingBlock = hidden;
2959
- this.settingsManager.setHideThinkingBlock(hidden);
2960
- for (const child of this.chatContainer.children) {
2961
- if (child instanceof AssistantMessageComponent) {
2962
- child.setHideThinkingBlock(hidden);
2963
- }
2964
- }
2965
- this.chatContainer.clear();
2966
- this.rebuildChatFromMessages();
2967
- },
2968
- onCollapseChangelogChange: (collapsed) => {
2969
- this.settingsManager.setCollapseChangelog(collapsed);
2970
- },
2971
- onQuietStartupChange: (enabled) => {
2972
- this.settingsManager.setQuietStartup(enabled);
2973
- },
2974
- onDoubleEscapeActionChange: (action) => {
2975
- this.settingsManager.setDoubleEscapeAction(action);
2976
- },
2977
- onTreeFilterModeChange: (mode) => {
2978
- this.settingsManager.setTreeFilterMode(mode);
2979
- },
2980
- onShowHardwareCursorChange: (enabled) => {
2981
- this.settingsManager.setShowHardwareCursor(enabled);
2982
- this.ui.setShowHardwareCursor(enabled);
2983
- },
2984
- onEditorPaddingXChange: (padding) => {
2985
- this.settingsManager.setEditorPaddingX(padding);
2986
- this.defaultEditor.setPaddingX(padding);
2987
- if (this.editor !== this.defaultEditor && this.editor.setPaddingX !== undefined) {
2988
- this.editor.setPaddingX(padding);
2989
- }
2990
- },
2991
- onAutocompleteMaxVisibleChange: (maxVisible) => {
2992
- this.settingsManager.setAutocompleteMaxVisible(maxVisible);
2993
- this.defaultEditor.setAutocompleteMaxVisible(maxVisible);
2994
- if (this.editor !== this.defaultEditor && this.editor.setAutocompleteMaxVisible !== undefined) {
2995
- this.editor.setAutocompleteMaxVisible(maxVisible);
2996
- }
2997
- },
2998
- onClearOnShrinkChange: (enabled) => {
2999
- this.settingsManager.setClearOnShrink(enabled);
3000
- this.ui.setClearOnShrink(enabled);
3001
- },
3002
- onCancel: () => {
3003
- done();
3004
- this.ui.requestRender();
3005
- },
3006
- });
3007
- return { component: selector, focus: selector.getSettingsList() };
3008
- });
3009
- }
3010
- async handleModelCommand(searchTerm) {
3011
- if (!searchTerm) {
3012
- this.showModelSelector();
3013
- return;
3014
- }
3015
- const model = await this.findExactModelMatch(searchTerm);
3016
- if (model) {
3017
- try {
3018
- await this.session.setModel(model);
3019
- this.footer.invalidate();
3020
- this.updateEditorBorderColor();
3021
- this.showStatus(`Model: ${model.id}`);
3022
- void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
3023
- // checkDaxnutsEasterEgg removed in ORIENT rebrand
3024
- }
3025
- catch (error) {
3026
- this.showError(error instanceof Error ? error.message : String(error));
3027
- }
3028
- return;
3029
- }
3030
- this.showModelSelector(searchTerm);
3031
- }
3032
- async findExactModelMatch(searchTerm) {
3033
- const models = await this.getModelCandidates();
3034
- return findExactModelReferenceMatch(searchTerm, models);
3035
- }
3036
- async getModelCandidates() {
3037
- if (this.session.scopedModels.length > 0) {
3038
- return this.session.scopedModels.map((scoped) => scoped.model);
3039
- }
3040
- this.session.modelRegistry.refresh();
3041
- try {
3042
- return await this.session.modelRegistry.getAvailable();
3043
- }
3044
- catch {
3045
- return [];
3046
- }
3047
- }
3048
- /** Update the footer's available provider count from current model candidates */
3049
- async updateAvailableProviderCount() {
3050
- const models = await this.getModelCandidates();
3051
- const uniqueProviders = new Set(models.map((m) => m.provider));
3052
- this.footerDataProvider.setAvailableProviderCount(uniqueProviders.size);
3053
- }
3054
- async maybeWarnAboutAnthropicSubscriptionAuth(model = this.session.model) {
3055
- if (this.anthropicSubscriptionWarningShown) {
3056
- return;
3057
- }
3058
- if (!model || model.provider !== "anthropic") {
3059
- return;
3060
- }
3061
- const storedCredential = this.session.modelRegistry.authStorage.get("anthropic");
3062
- if (storedCredential?.type === "oauth") {
3063
- this.anthropicSubscriptionWarningShown = true;
3064
- this.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING);
3065
- return;
3066
- }
3067
- try {
3068
- const apiKey = await this.session.modelRegistry.getApiKeyForProvider(model.provider);
3069
- if (!isAnthropicSubscriptionAuthKey(apiKey)) {
3070
- return;
3071
- }
3072
- this.anthropicSubscriptionWarningShown = true;
3073
- this.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING);
3074
- }
3075
- catch {
3076
- // Ignore auth lookup failures for warning-only checks.
3077
- }
3078
- }
3079
- showModelSelector(initialSearchInput) {
3080
- this.showSelector((done) => {
3081
- const selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRegistry, this.session.scopedModels, async (model) => {
3082
- try {
3083
- await this.session.setModel(model);
3084
- this.footer.invalidate();
3085
- this.updateEditorBorderColor();
3086
- done();
3087
- this.showStatus(`Model: ${model.id}`);
3088
- void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
3089
- // checkDaxnutsEasterEgg removed in ORIENT rebrand
3090
- }
3091
- catch (error) {
3092
- done();
3093
- this.showError(error instanceof Error ? error.message : String(error));
3094
- }
3095
- }, () => {
3096
- done();
3097
- this.ui.requestRender();
3098
- }, initialSearchInput);
3099
- return { component: selector, focus: selector };
3100
- });
3101
- }
3102
- async showModelsSelector() {
3103
- // Get all available models
3104
- this.session.modelRegistry.refresh();
3105
- const allModels = this.session.modelRegistry.getAvailable();
3106
- if (allModels.length === 0) {
3107
- this.showStatus("No models available");
3108
- return;
3109
- }
3110
- // Check if session has scoped models (from previous session-only changes or CLI --models)
3111
- const sessionScopedModels = this.session.scopedModels;
3112
- const hasSessionScope = sessionScopedModels.length > 0;
3113
- // Build enabled model IDs from session state or settings
3114
- const enabledModelIds = new Set();
3115
- let hasFilter = false;
3116
- if (hasSessionScope) {
3117
- // Use current session's scoped models
3118
- for (const sm of sessionScopedModels) {
3119
- enabledModelIds.add(`${sm.model.provider}/${sm.model.id}`);
3120
- }
3121
- hasFilter = true;
3122
- }
3123
- else {
3124
- // Fall back to settings
3125
- const patterns = this.settingsManager.getEnabledModels();
3126
- if (patterns !== undefined && patterns.length > 0) {
3127
- hasFilter = true;
3128
- const scopedModels = await resolveModelScope(patterns, this.session.modelRegistry);
3129
- for (const sm of scopedModels) {
3130
- enabledModelIds.add(`${sm.model.provider}/${sm.model.id}`);
3131
- }
3132
- }
3133
- }
3134
- // Track current enabled state (session-only until persisted)
3135
- const currentEnabledIds = new Set(enabledModelIds);
3136
- let currentHasFilter = hasFilter;
3137
- // Helper to update session's scoped models (session-only, no persist)
3138
- const updateSessionModels = async (enabledIds) => {
3139
- if (enabledIds.size > 0 && enabledIds.size < allModels.length) {
3140
- const newScopedModels = await resolveModelScope(Array.from(enabledIds), this.session.modelRegistry);
3141
- this.session.setScopedModels(newScopedModels.map((sm) => ({
3142
- model: sm.model,
3143
- thinkingLevel: sm.thinkingLevel,
3144
- })));
3145
- }
3146
- else {
3147
- // All enabled or none enabled = no filter
3148
- this.session.setScopedModels([]);
3149
- }
3150
- await this.updateAvailableProviderCount();
3151
- this.ui.requestRender();
3152
- };
3153
- this.showSelector((done) => {
3154
- const selector = new ScopedModelsSelectorComponent({
3155
- allModels,
3156
- enabledModelIds: currentEnabledIds,
3157
- hasEnabledModelsFilter: currentHasFilter,
3158
- }, {
3159
- onModelToggle: async (modelId, enabled) => {
3160
- if (enabled) {
3161
- currentEnabledIds.add(modelId);
3162
- }
3163
- else {
3164
- currentEnabledIds.delete(modelId);
3165
- }
3166
- currentHasFilter = true;
3167
- await updateSessionModels(currentEnabledIds);
3168
- },
3169
- onEnableAll: async (allModelIds) => {
3170
- currentEnabledIds.clear();
3171
- for (const id of allModelIds) {
3172
- currentEnabledIds.add(id);
3173
- }
3174
- currentHasFilter = false;
3175
- await updateSessionModels(currentEnabledIds);
3176
- },
3177
- onClearAll: async () => {
3178
- currentEnabledIds.clear();
3179
- currentHasFilter = true;
3180
- await updateSessionModels(currentEnabledIds);
3181
- },
3182
- onToggleProvider: async (_provider, modelIds, enabled) => {
3183
- for (const id of modelIds) {
3184
- if (enabled) {
3185
- currentEnabledIds.add(id);
3186
- }
3187
- else {
3188
- currentEnabledIds.delete(id);
3189
- }
3190
- }
3191
- currentHasFilter = true;
3192
- await updateSessionModels(currentEnabledIds);
3193
- },
3194
- onPersist: (enabledIds) => {
3195
- // Persist to settings
3196
- const newPatterns = enabledIds.length === allModels.length
3197
- ? undefined // All enabled = clear filter
3198
- : enabledIds;
3199
- this.settingsManager.setEnabledModels(newPatterns);
3200
- this.showStatus("Model selection saved to settings");
3201
- },
3202
- onCancel: () => {
3203
- done();
3204
- this.ui.requestRender();
3205
- },
3206
- });
3207
- return { component: selector, focus: selector };
3208
- });
3209
- }
3210
- showUserMessageSelector() {
3211
- const userMessages = this.session.getUserMessagesForForking();
3212
- if (userMessages.length === 0) {
3213
- this.showStatus("No messages to fork from");
3214
- return;
3215
- }
3216
- this.showSelector((done) => {
3217
- const selector = new UserMessageSelectorComponent(userMessages.map((m) => ({ id: m.entryId, text: m.text })), async (entryId) => {
3218
- const result = await this.runtimeHost.fork(entryId);
3219
- if (result.cancelled) {
3220
- done();
3221
- this.ui.requestRender();
3222
- return;
3223
- }
3224
- await this.handleRuntimeSessionChange();
3225
- this.renderCurrentSessionState();
3226
- this.editor.setText(result.selectedText ?? "");
3227
- done();
3228
- this.showStatus("Branched to new session");
3229
- }, () => {
3230
- done();
3231
- this.ui.requestRender();
3232
- });
3233
- return { component: selector, focus: selector.getMessageList() };
3234
- });
3235
- }
3236
- showTreeSelector(initialSelectedId) {
3237
- const tree = this.sessionManager.getTree();
3238
- const realLeafId = this.sessionManager.getLeafId();
3239
- const initialFilterMode = this.settingsManager.getTreeFilterMode();
3240
- if (tree.length === 0) {
3241
- this.showStatus("No entries in session");
3242
- return;
3243
- }
3244
- this.showSelector((done) => {
3245
- const selector = new TreeSelectorComponent(tree, realLeafId, this.ui.terminal.rows, async (entryId) => {
3246
- // Selecting the current leaf is a no-op (already there)
3247
- if (entryId === realLeafId) {
3248
- done();
3249
- this.showStatus("Already at this point");
3250
- return;
3251
- }
3252
- // Ask about summarization
3253
- done(); // Close selector first
3254
- // Loop until user makes a complete choice or cancels to tree
3255
- let wantsSummary = false;
3256
- let customInstructions;
3257
- // Check if we should skip the prompt (user preference to always default to no summary)
3258
- if (!this.settingsManager.getBranchSummarySkipPrompt()) {
3259
- while (true) {
3260
- const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
3261
- "No summary",
3262
- "Summarize",
3263
- "Summarize with custom prompt",
3264
- ]);
3265
- if (summaryChoice === undefined) {
3266
- // User pressed escape - re-show tree selector with same selection
3267
- this.showTreeSelector(entryId);
3268
- return;
3269
- }
3270
- wantsSummary = summaryChoice !== "No summary";
3271
- if (summaryChoice === "Summarize with custom prompt") {
3272
- customInstructions = await this.showExtensionEditor("Custom summarization instructions");
3273
- if (customInstructions === undefined) {
3274
- // User cancelled - loop back to summary selector
3275
- continue;
3276
- }
3277
- }
3278
- // User made a complete choice
3279
- break;
3280
- }
3281
- }
3282
- // Set up escape handler and loader if summarizing
3283
- let summaryLoader;
3284
- const originalOnEscape = this.defaultEditor.onEscape;
3285
- if (wantsSummary) {
3286
- this.defaultEditor.onEscape = () => {
3287
- this.session.abortBranchSummary();
3288
- };
3289
- this.chatContainer.addChild(new Spacer(1));
3290
- summaryLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), `Summarizing branch... (${keyText("app.interrupt")} to cancel)`);
3291
- this.statusContainer.addChild(summaryLoader);
3292
- this.ui.requestRender();
3293
- }
3294
- try {
3295
- const result = await this.session.navigateTree(entryId, {
3296
- summarize: wantsSummary,
3297
- customInstructions,
3298
- });
3299
- if (result.aborted) {
3300
- // Summarization aborted - re-show tree selector with same selection
3301
- this.showStatus("Branch summarization cancelled");
3302
- this.showTreeSelector(entryId);
3303
- return;
3304
- }
3305
- if (result.cancelled) {
3306
- this.showStatus("Navigation cancelled");
3307
- return;
3308
- }
3309
- // Update UI
3310
- this.chatContainer.clear();
3311
- this.renderInitialMessages();
3312
- if (result.editorText && !this.editor.getText().trim()) {
3313
- this.editor.setText(result.editorText);
3314
- }
3315
- this.showStatus("Navigated to selected point");
3316
- }
3317
- catch (error) {
3318
- this.showError(error instanceof Error ? error.message : String(error));
3319
- }
3320
- finally {
3321
- if (summaryLoader) {
3322
- summaryLoader.stop();
3323
- this.statusContainer.clear();
3324
- }
3325
- this.defaultEditor.onEscape = originalOnEscape;
3326
- }
3327
- }, () => {
3328
- done();
3329
- this.ui.requestRender();
3330
- }, (entryId, label) => {
3331
- this.sessionManager.appendLabelChange(entryId, label);
3332
- this.ui.requestRender();
3333
- }, initialSelectedId, initialFilterMode);
3334
- return { component: selector, focus: selector };
3335
- });
3336
- }
3337
- showSessionSelector() {
3338
- this.showSelector((done) => {
3339
- const selector = new SessionSelectorComponent((onProgress) => SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionDir(), onProgress), SessionManager.listAll, async (sessionPath) => {
3340
- done();
3341
- await this.handleResumeSession(sessionPath);
3342
- }, () => {
3343
- done();
3344
- this.ui.requestRender();
3345
- }, () => {
3346
- void this.shutdown();
3347
- }, () => this.ui.requestRender(), {
3348
- renameSession: async (sessionFilePath, nextName) => {
3349
- const next = (nextName ?? "").trim();
3350
- if (!next)
3351
- return;
3352
- const mgr = SessionManager.open(sessionFilePath);
3353
- mgr.appendSessionInfo(next);
3354
- },
3355
- showRenameHint: true,
3356
- keybindings: this.keybindings,
3357
- }, this.sessionManager.getSessionFile());
3358
- return { component: selector, focus: selector };
3359
- });
3360
- }
3361
- async handleResumeSession(sessionPath) {
3362
- if (this.loadingAnimation) {
3363
- this.loadingAnimation.stop();
3364
- this.loadingAnimation = undefined;
3365
- }
3366
- this.statusContainer.clear();
3367
- try {
3368
- const result = await this.runtimeHost.switchSession(sessionPath);
3369
- if (result.cancelled) {
3370
- return;
3371
- }
3372
- await this.handleRuntimeSessionChange();
3373
- this.renderCurrentSessionState();
3374
- this.showStatus("Resumed session");
3375
- }
3376
- catch (error) {
3377
- if (error instanceof MissingSessionCwdError) {
3378
- const selectedCwd = await this.promptForMissingSessionCwd(error);
3379
- if (!selectedCwd) {
3380
- this.showStatus("Resume cancelled");
3381
- return;
3382
- }
3383
- const result = await this.runtimeHost.switchSession(sessionPath, selectedCwd);
3384
- if (result.cancelled) {
3385
- return;
3386
- }
3387
- await this.handleRuntimeSessionChange();
3388
- this.renderCurrentSessionState();
3389
- this.showStatus("Resumed session in current cwd");
3390
- return;
3391
- }
3392
- await this.handleFatalRuntimeError("Failed to resume session", error);
3393
- }
3394
- }
3395
- async showOAuthSelector(mode) {
3396
- if (mode === "logout") {
3397
- const providers = this.session.modelRegistry.authStorage.list();
3398
- const loggedInProviders = providers.filter((p) => this.session.modelRegistry.authStorage.get(p)?.type === "oauth");
3399
- if (loggedInProviders.length === 0) {
3400
- this.showStatus("No OAuth providers logged in. Use /login first.");
3401
- return;
3402
- }
3403
- }
3404
- this.showSelector((done) => {
3405
- const selector = new OAuthSelectorComponent(mode, this.session.modelRegistry.authStorage, async (providerId) => {
3406
- done();
3407
- if (mode === "login") {
3408
- await this.showLoginDialog(providerId);
3409
- }
3410
- else {
3411
- // Logout flow
3412
- const providerInfo = this.session.modelRegistry.authStorage
3413
- .getOAuthProviders()
3414
- .find((p) => p.id === providerId);
3415
- const providerName = providerInfo?.name || providerId;
3416
- try {
3417
- this.session.modelRegistry.authStorage.logout(providerId);
3418
- this.session.modelRegistry.refresh();
3419
- await this.updateAvailableProviderCount();
3420
- this.showStatus(`Logged out of ${providerName}`);
3421
- }
3422
- catch (error) {
3423
- this.showError(`Logout failed: ${error instanceof Error ? error.message : String(error)}`);
3424
- }
3425
- }
3426
- }, () => {
3427
- done();
3428
- this.ui.requestRender();
3429
- });
3430
- return { component: selector, focus: selector };
3431
- });
3432
- }
3433
- async showLoginDialog(providerId) {
3434
- const providerInfo = this.session.modelRegistry.authStorage.getOAuthProviders().find((p) => p.id === providerId);
3435
- const providerName = providerInfo?.name || providerId;
3436
- // Providers that use callback servers (can paste redirect URL)
3437
- const usesCallbackServer = providerInfo?.usesCallbackServer ?? false;
3438
- // Create login dialog component
3439
- const dialog = new LoginDialogComponent(this.ui, providerId, (_success, _message) => {
3440
- // Completion handled below
3441
- });
3442
- // Show dialog in editor container
3443
- this.editorContainer.clear();
3444
- this.editorContainer.addChild(dialog);
3445
- this.ui.setFocus(dialog);
3446
- this.ui.requestRender();
3447
- // Promise for manual code input (racing with callback server)
3448
- let manualCodeResolve;
3449
- let manualCodeReject;
3450
- const manualCodePromise = new Promise((resolve, reject) => {
3451
- manualCodeResolve = resolve;
3452
- manualCodeReject = reject;
3453
- });
3454
- // Restore editor helper
3455
- const restoreEditor = () => {
3456
- this.editorContainer.clear();
3457
- this.editorContainer.addChild(this.editor);
3458
- this.ui.setFocus(this.editor);
3459
- this.ui.requestRender();
3460
- };
3461
- try {
3462
- await this.session.modelRegistry.authStorage.login(providerId, {
3463
- onAuth: (info) => {
3464
- dialog.showAuth(info.url, info.instructions);
3465
- if (usesCallbackServer) {
3466
- // Show input for manual paste, racing with callback
3467
- dialog
3468
- .showManualInput("Paste redirect URL below, or complete login in browser:")
3469
- .then((value) => {
3470
- if (value && manualCodeResolve) {
3471
- manualCodeResolve(value);
3472
- manualCodeResolve = undefined;
3473
- }
3474
- })
3475
- .catch(() => {
3476
- if (manualCodeReject) {
3477
- manualCodeReject(new Error("Login cancelled"));
3478
- manualCodeReject = undefined;
3479
- }
3480
- });
3481
- }
3482
- else if (providerId === "github-copilot") {
3483
- // GitHub Copilot polls after onAuth
3484
- dialog.showWaiting("Waiting for browser authentication...");
3485
- }
3486
- // For Anthropic: onPrompt is called immediately after
3487
- },
3488
- onPrompt: async (prompt) => {
3489
- return dialog.showPrompt(prompt.message, prompt.placeholder);
3490
- },
3491
- onProgress: (message) => {
3492
- dialog.showProgress(message);
3493
- },
3494
- onManualCodeInput: () => manualCodePromise,
3495
- signal: dialog.signal,
3496
- });
3497
- // Success
3498
- restoreEditor();
3499
- this.session.modelRegistry.refresh();
3500
- await this.updateAvailableProviderCount();
3501
- this.showStatus(`Logged in to ${providerName}. Credentials saved to ${getAuthPath()}`);
3502
- }
3503
- catch (error) {
3504
- restoreEditor();
3505
- const errorMsg = error instanceof Error ? error.message : String(error);
3506
- if (errorMsg !== "Login cancelled") {
3507
- this.showError(`Failed to login to ${providerName}: ${errorMsg}`);
3508
- }
3509
- }
3510
- }
3511
- // =========================================================================
3512
- // Command handlers
3513
- // =========================================================================
3514
- async handleReloadCommand() {
3515
- if (this.session.isStreaming) {
3516
- this.showWarning("Wait for the current response to finish before reloading.");
3517
- return;
3518
- }
3519
- if (this.session.isCompacting) {
3520
- this.showWarning("Wait for compaction to finish before reloading.");
3521
- return;
3522
- }
3523
- this.resetExtensionUI();
3524
- const loader = new BorderedLoader(this.ui, theme, "Reloading keybindings, extensions, skills, prompts, themes...", {
3525
- cancellable: false,
3526
- });
3527
- const previousEditor = this.editor;
3528
- this.editorContainer.clear();
3529
- this.editorContainer.addChild(loader);
3530
- this.ui.setFocus(loader);
3531
- this.ui.requestRender();
3532
- const dismissLoader = (editor) => {
3533
- loader.dispose();
3534
- this.editorContainer.clear();
3535
- this.editorContainer.addChild(editor);
3536
- this.ui.setFocus(editor);
3537
- this.ui.requestRender();
3538
- };
3539
- try {
3540
- await this.session.reload();
3541
- this.keybindings.reload();
3542
- setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
3543
- this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
3544
- const themeName = this.settingsManager.getTheme();
3545
- const themeResult = themeName ? setTheme(themeName, true) : { success: true };
3546
- if (!themeResult.success) {
3547
- this.showError(`Failed to load theme "${themeName}": ${themeResult.error}\nFell back to dark theme.`);
3548
- }
3549
- const editorPaddingX = this.settingsManager.getEditorPaddingX();
3550
- const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
3551
- this.defaultEditor.setPaddingX(editorPaddingX);
3552
- this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
3553
- if (this.editor !== this.defaultEditor) {
3554
- this.editor.setPaddingX?.(editorPaddingX);
3555
- this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
3556
- }
3557
- this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
3558
- this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
3559
- this.setupAutocomplete(this.fdPath);
3560
- const runner = this.session.extensionRunner;
3561
- if (runner) {
3562
- this.setupExtensionShortcuts(runner);
3563
- }
3564
- this.rebuildChatFromMessages();
3565
- dismissLoader(this.editor);
3566
- this.showLoadedResources({
3567
- force: false,
3568
- showDiagnosticsWhenQuiet: true,
3569
- });
3570
- const modelsJsonError = this.session.modelRegistry.getError();
3571
- if (modelsJsonError) {
3572
- this.showError(`models.json error: ${modelsJsonError}`);
3573
- }
3574
- this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
3575
- }
3576
- catch (error) {
3577
- dismissLoader(previousEditor);
3578
- this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
3579
- }
3580
- }
3581
- async handleExportCommand(text) {
3582
- const parts = text.split(/\s+/);
3583
- const outputPath = parts.length > 1 ? parts[1] : undefined;
3584
- try {
3585
- if (outputPath?.endsWith(".jsonl")) {
3586
- const filePath = this.session.exportToJsonl(outputPath);
3587
- this.showStatus(`Session exported to: ${filePath}`);
3588
- }
3589
- else {
3590
- const filePath = await this.session.exportToHtml(outputPath);
3591
- this.showStatus(`Session exported to: ${filePath}`);
3592
- }
3593
- }
3594
- catch (error) {
3595
- this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
3596
- }
3597
- }
3598
- async handleImportCommand(text) {
3599
- const parts = text.split(/\s+/);
3600
- if (parts.length < 2 || !parts[1]) {
3601
- this.showError("Usage: /import <path.jsonl>");
3602
- return;
3603
- }
3604
- const inputPath = parts[1];
3605
- const confirmed = await this.showExtensionConfirm("Import session", `Replace current session with ${inputPath}?`);
3606
- if (!confirmed) {
3607
- this.showStatus("Import cancelled");
3608
- return;
3609
- }
3610
- try {
3611
- if (this.loadingAnimation) {
3612
- this.loadingAnimation.stop();
3613
- this.loadingAnimation = undefined;
3614
- }
3615
- this.statusContainer.clear();
3616
- const result = await this.runtimeHost.importFromJsonl(inputPath);
3617
- if (result.cancelled) {
3618
- this.showStatus("Import cancelled");
3619
- return;
3620
- }
3621
- await this.handleRuntimeSessionChange();
3622
- this.renderCurrentSessionState();
3623
- this.showStatus(`Session imported from: ${inputPath}`);
3624
- }
3625
- catch (error) {
3626
- if (error instanceof MissingSessionCwdError) {
3627
- const selectedCwd = await this.promptForMissingSessionCwd(error);
3628
- if (!selectedCwd) {
3629
- this.showStatus("Import cancelled");
3630
- return;
3631
- }
3632
- const result = await this.runtimeHost.importFromJsonl(inputPath, selectedCwd);
3633
- if (result.cancelled) {
3634
- this.showStatus("Import cancelled");
3635
- return;
3636
- }
3637
- await this.handleRuntimeSessionChange();
3638
- this.renderCurrentSessionState();
3639
- this.showStatus(`Session imported from: ${inputPath}`);
3640
- return;
3641
- }
3642
- await this.handleFatalRuntimeError("Failed to import session", error);
3643
- }
3644
- }
3645
- async handleShareCommand() {
3646
- // Check if gh is available and logged in
3647
- try {
3648
- const authResult = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
3649
- if (authResult.status !== 0) {
3650
- this.showError("GitHub CLI is not logged in. Run 'gh auth login' first.");
3651
- return;
3652
- }
3653
- }
3654
- catch {
3655
- this.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");
3656
- return;
3657
- }
3658
- // Export to a temp file
3659
- const tmpFile = path.join(os.tmpdir(), "session.html");
3660
- try {
3661
- await this.session.exportToHtml(tmpFile);
3662
- }
3663
- catch (error) {
3664
- this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
3665
- return;
3666
- }
3667
- // Show cancellable loader, replacing the editor
3668
- const loader = new BorderedLoader(this.ui, theme, "Creating gist...");
3669
- this.editorContainer.clear();
3670
- this.editorContainer.addChild(loader);
3671
- this.ui.setFocus(loader);
3672
- this.ui.requestRender();
3673
- const restoreEditor = () => {
3674
- loader.dispose();
3675
- this.editorContainer.clear();
3676
- this.editorContainer.addChild(this.editor);
3677
- this.ui.setFocus(this.editor);
3678
- try {
3679
- fs.unlinkSync(tmpFile);
3680
- }
3681
- catch {
3682
- // Ignore cleanup errors
3683
- }
3684
- };
3685
- // Create a secret gist asynchronously
3686
- let proc = null;
3687
- loader.onAbort = () => {
3688
- proc?.kill();
3689
- restoreEditor();
3690
- this.showStatus("Share cancelled");
3691
- };
3692
- try {
3693
- const result = await new Promise((resolve) => {
3694
- proc = spawn("gh", ["gist", "create", "--public=false", tmpFile]);
3695
- let stdout = "";
3696
- let stderr = "";
3697
- proc.stdout?.on("data", (data) => {
3698
- stdout += data.toString();
3699
- });
3700
- proc.stderr?.on("data", (data) => {
3701
- stderr += data.toString();
3702
- });
3703
- proc.on("close", (code) => resolve({ stdout, stderr, code }));
3704
- });
3705
- if (loader.signal.aborted)
3706
- return;
3707
- restoreEditor();
3708
- if (result.code !== 0) {
3709
- const errorMsg = result.stderr?.trim() || "Unknown error";
3710
- this.showError(`Failed to create gist: ${errorMsg}`);
3711
- return;
3712
- }
3713
- // Extract gist ID from the URL returned by gh
3714
- // gh returns something like: https://gist.github.com/username/GIST_ID
3715
- const gistUrl = result.stdout?.trim();
3716
- const gistId = gistUrl?.split("/").pop();
3717
- if (!gistId) {
3718
- this.showError("Failed to parse gist ID from gh output");
3719
- return;
3720
- }
3721
- // Create the preview URL
3722
- const previewUrl = getShareViewerUrl(gistId);
3723
- this.showStatus(`Share URL: ${previewUrl}\nGist: ${gistUrl}`);
3724
- }
3725
- catch (error) {
3726
- if (!loader.signal.aborted) {
3727
- restoreEditor();
3728
- this.showError(`Failed to create gist: ${error instanceof Error ? error.message : "Unknown error"}`);
3729
- }
3730
- }
3731
- }
3732
- async handleCopyCommand() {
3733
- const text = this.session.getLastAssistantText();
3734
- if (!text) {
3735
- this.showError("No agent messages to copy yet.");
3736
- return;
3737
- }
3738
- try {
3739
- await copyToClipboard(text);
3740
- this.showStatus("Copied last agent message to clipboard");
3741
- }
3742
- catch (error) {
3743
- this.showError(error instanceof Error ? error.message : String(error));
3744
- }
3745
- }
3746
- handleNameCommand(text) {
3747
- const name = text.replace(/^\/name\s*/, "").trim();
3748
- if (!name) {
3749
- const currentName = this.sessionManager.getSessionName();
3750
- if (currentName) {
3751
- this.chatContainer.addChild(new Spacer(1));
3752
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name: ${currentName}`), 1, 0));
3753
- }
3754
- else {
3755
- this.showWarning("Usage: /name <name>");
3756
- }
3757
- this.ui.requestRender();
3758
- return;
3759
- }
3760
- this.sessionManager.appendSessionInfo(name);
3761
- this.updateTerminalTitle();
3762
- this.chatContainer.addChild(new Spacer(1));
3763
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name set: ${name}`), 1, 0));
3764
- this.ui.requestRender();
3765
- }
3766
- handleSessionCommand() {
3767
- const stats = this.session.getSessionStats();
3768
- const sessionName = this.sessionManager.getSessionName();
3769
- let info = `${theme.bold("Session Info")}\n\n`;
3770
- if (sessionName) {
3771
- info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
3772
- }
3773
- info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
3774
- info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
3775
- info += `${theme.bold("Messages")}\n`;
3776
- info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
3777
- info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
3778
- info += `${theme.fg("dim", "Tool Calls:")} ${stats.toolCalls}\n`;
3779
- info += `${theme.fg("dim", "Tool Results:")} ${stats.toolResults}\n`;
3780
- info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n\n`;
3781
- info += `${theme.bold("Tokens")}\n`;
3782
- info += `${theme.fg("dim", "Input:")} ${stats.tokens.input.toLocaleString()}\n`;
3783
- info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
3784
- if (stats.tokens.cacheRead > 0) {
3785
- info += `${theme.fg("dim", "Cache Read:")} ${stats.tokens.cacheRead.toLocaleString()}\n`;
3786
- }
3787
- if (stats.tokens.cacheWrite > 0) {
3788
- info += `${theme.fg("dim", "Cache Write:")} ${stats.tokens.cacheWrite.toLocaleString()}\n`;
3789
- }
3790
- info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
3791
- if (stats.cost > 0) {
3792
- info += `\n${theme.bold("Cost")}\n`;
3793
- info += `${theme.fg("dim", "Total:")} ${stats.cost.toFixed(4)}`;
3794
- }
3795
- this.chatContainer.addChild(new Spacer(1));
3796
- this.chatContainer.addChild(new Text(info, 1, 0));
3797
- this.ui.requestRender();
3798
- }
3799
- handleChangelogCommand() {
3800
- const changelogPath = getChangelogPath();
3801
- const allEntries = parseChangelog(changelogPath);
3802
- const changelogMarkdown = allEntries.length > 0
3803
- ? allEntries
3804
- .reverse()
3805
- .map((e) => e.content)
3806
- .join("\n\n")
3807
- : "No changelog entries found.";
3808
- this.chatContainer.addChild(new Spacer(1));
3809
- this.chatContainer.addChild(new DynamicBorder());
3810
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
3811
- this.chatContainer.addChild(new Spacer(1));
3812
- this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
3813
- this.chatContainer.addChild(new DynamicBorder());
3814
- this.ui.requestRender();
3815
- }
3816
- /**
3817
- * Capitalize keybinding for display (e.g., "ctrl+c" -> "Ctrl+C").
3818
- */
3819
- capitalizeKey(key) {
3820
- return key
3821
- .split("/")
3822
- .map((k) => k
3823
- .split("+")
3824
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
3825
- .join("+"))
3826
- .join("/");
3827
- }
3828
- /**
3829
- * Get capitalized display string for an app keybinding action.
3830
- */
3831
- getAppKeyDisplay(action) {
3832
- return this.capitalizeKey(keyText(action));
3833
- }
3834
- /**
3835
- * Get capitalized display string for an editor keybinding action.
3836
- */
3837
- getEditorKeyDisplay(action) {
3838
- return this.capitalizeKey(keyText(action));
3839
- }
3840
- handleHotkeysCommand() {
3841
- // Navigation keybindings
3842
- const cursorUp = this.getEditorKeyDisplay("tui.editor.cursorUp");
3843
- const cursorDown = this.getEditorKeyDisplay("tui.editor.cursorDown");
3844
- const cursorLeft = this.getEditorKeyDisplay("tui.editor.cursorLeft");
3845
- const cursorRight = this.getEditorKeyDisplay("tui.editor.cursorRight");
3846
- const cursorWordLeft = this.getEditorKeyDisplay("tui.editor.cursorWordLeft");
3847
- const cursorWordRight = this.getEditorKeyDisplay("tui.editor.cursorWordRight");
3848
- const cursorLineStart = this.getEditorKeyDisplay("tui.editor.cursorLineStart");
3849
- const cursorLineEnd = this.getEditorKeyDisplay("tui.editor.cursorLineEnd");
3850
- const jumpForward = this.getEditorKeyDisplay("tui.editor.jumpForward");
3851
- const jumpBackward = this.getEditorKeyDisplay("tui.editor.jumpBackward");
3852
- const pageUp = this.getEditorKeyDisplay("tui.editor.pageUp");
3853
- const pageDown = this.getEditorKeyDisplay("tui.editor.pageDown");
3854
- // Editing keybindings
3855
- const submit = this.getEditorKeyDisplay("tui.input.submit");
3856
- const newLine = this.getEditorKeyDisplay("tui.input.newLine");
3857
- const deleteWordBackward = this.getEditorKeyDisplay("tui.editor.deleteWordBackward");
3858
- const deleteWordForward = this.getEditorKeyDisplay("tui.editor.deleteWordForward");
3859
- const deleteToLineStart = this.getEditorKeyDisplay("tui.editor.deleteToLineStart");
3860
- const deleteToLineEnd = this.getEditorKeyDisplay("tui.editor.deleteToLineEnd");
3861
- const yank = this.getEditorKeyDisplay("tui.editor.yank");
3862
- const yankPop = this.getEditorKeyDisplay("tui.editor.yankPop");
3863
- const undo = this.getEditorKeyDisplay("tui.editor.undo");
3864
- const tab = this.getEditorKeyDisplay("tui.input.tab");
3865
- // App keybindings
3866
- const interrupt = this.getAppKeyDisplay("app.interrupt");
3867
- const clear = this.getAppKeyDisplay("app.clear");
3868
- const exit = this.getAppKeyDisplay("app.exit");
3869
- const suspend = this.getAppKeyDisplay("app.suspend");
3870
- const cycleThinkingLevel = this.getAppKeyDisplay("app.thinking.cycle");
3871
- const cycleModelForward = this.getAppKeyDisplay("app.model.cycleForward");
3872
- const selectModel = this.getAppKeyDisplay("app.model.select");
3873
- const expandTools = this.getAppKeyDisplay("app.tools.expand");
3874
- const toggleThinking = this.getAppKeyDisplay("app.thinking.toggle");
3875
- const externalEditor = this.getAppKeyDisplay("app.editor.external");
3876
- const cycleModelBackward = this.getAppKeyDisplay("app.model.cycleBackward");
3877
- const followUp = this.getAppKeyDisplay("app.message.followUp");
3878
- const dequeue = this.getAppKeyDisplay("app.message.dequeue");
3879
- const pasteImage = this.getAppKeyDisplay("app.clipboard.pasteImage");
3880
- let hotkeys = `
3881
- **Navigation**
3882
- | Key | Action |
3883
- |-----|--------|
3884
- | \`${cursorUp}\` / \`${cursorDown}\` / \`${cursorLeft}\` / \`${cursorRight}\` | Move cursor / browse history (Up when empty) |
3885
- | \`${cursorWordLeft}\` / \`${cursorWordRight}\` | Move by word |
3886
- | \`${cursorLineStart}\` | Start of line |
3887
- | \`${cursorLineEnd}\` | End of line |
3888
- | \`${jumpForward}\` | Jump forward to character |
3889
- | \`${jumpBackward}\` | Jump backward to character |
3890
- | \`${pageUp}\` / \`${pageDown}\` | Scroll by page |
3891
-
3892
- **Editing**
3893
- | Key | Action |
3894
- |-----|--------|
3895
- | \`${submit}\` | Send message |
3896
- | \`${newLine}\` | New line${process.platform === "win32" ? " (Ctrl+Enter on Windows Terminal)" : ""} |
3897
- | \`${deleteWordBackward}\` | Delete word backwards |
3898
- | \`${deleteWordForward}\` | Delete word forwards |
3899
- | \`${deleteToLineStart}\` | Delete to start of line |
3900
- | \`${deleteToLineEnd}\` | Delete to end of line |
3901
- | \`${yank}\` | Paste the most-recently-deleted text |
3902
- | \`${yankPop}\` | Cycle through the deleted text after pasting |
3903
- | \`${undo}\` | Undo |
3904
-
3905
- **Other**
3906
- | Key | Action |
3907
- |-----|--------|
3908
- | \`${tab}\` | Path completion / accept autocomplete |
3909
- | \`${interrupt}\` | Cancel autocomplete / abort streaming |
3910
- | \`${clear}\` | Clear editor (first) / exit (second) |
3911
- | \`${exit}\` | Exit (when editor is empty) |
3912
- | \`${suspend}\` | Suspend to background |
3913
- | \`${cycleThinkingLevel}\` | Cycle thinking level |
3914
- | \`${cycleModelForward}\` / \`${cycleModelBackward}\` | Cycle models |
3915
- | \`${selectModel}\` | Open model selector |
3916
- | \`${expandTools}\` | Toggle tool output expansion |
3917
- | \`${toggleThinking}\` | Toggle thinking block visibility |
3918
- | \`${externalEditor}\` | Edit message in external editor |
3919
- | \`${followUp}\` | Queue follow-up message |
3920
- | \`${dequeue}\` | Restore queued messages |
3921
- | \`${pasteImage}\` | Paste image from clipboard |
3922
- | \`/\` | Slash commands |
3923
- | \`!\` | Run bash command |
3924
- | \`!!\` | Run bash command (excluded from context) |
3925
- `;
3926
- // Add extension-registered shortcuts
3927
- const extensionRunner = this.session.extensionRunner;
3928
- if (extensionRunner) {
3929
- const shortcuts = extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());
3930
- if (shortcuts.size > 0) {
3931
- hotkeys += `
3932
- **Extensions**
3933
- | Key | Action |
3934
- |-----|--------|
3935
- `;
3936
- for (const [key, shortcut] of shortcuts) {
3937
- const description = shortcut.description ?? shortcut.extensionPath;
3938
- const keyDisplay = key.replace(/\b\w/g, (c) => c.toUpperCase());
3939
- hotkeys += `| \`${keyDisplay}\` | ${description} |\n`;
3940
- }
3941
- }
3942
- }
3943
- this.chatContainer.addChild(new Spacer(1));
3944
- this.chatContainer.addChild(new DynamicBorder());
3945
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
3946
- this.chatContainer.addChild(new Spacer(1));
3947
- this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
3948
- this.chatContainer.addChild(new DynamicBorder());
3949
- this.ui.requestRender();
3950
- }
3951
- async handleClearCommand() {
3952
- if (this.loadingAnimation) {
3953
- this.loadingAnimation.stop();
3954
- this.loadingAnimation = undefined;
3955
- }
3956
- this.statusContainer.clear();
3957
- try {
3958
- const result = await this.runtimeHost.newSession();
3959
- if (result.cancelled) {
3960
- return;
3961
- }
3962
- await this.handleRuntimeSessionChange();
3963
- this.renderCurrentSessionState();
3964
- this.chatContainer.addChild(new Spacer(1));
3965
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ New session started")}`, 1, 1));
3966
- this.ui.requestRender();
3967
- }
3968
- catch (error) {
3969
- await this.handleFatalRuntimeError("Failed to create session", error);
3970
- }
3971
- }
3972
- handleDebugCommand() {
3973
- const width = this.ui.terminal.columns;
3974
- const height = this.ui.terminal.rows;
3975
- const allLines = this.ui.render(width);
3976
- const debugLogPath = getDebugLogPath();
3977
- const debugData = [
3978
- `Debug output at ${new Date().toISOString()}`,
3979
- `Terminal: ${width}x${height}`,
3980
- `Total lines: ${allLines.length}`,
3981
- "",
3982
- "=== All rendered lines with visible widths ===",
3983
- ...allLines.map((line, idx) => {
3984
- const vw = visibleWidth(line);
3985
- const escaped = JSON.stringify(line);
3986
- return `[${idx}] (w=${vw}) ${escaped}`;
3987
- }),
3988
- "",
3989
- "=== Agent messages (JSONL) ===",
3990
- ...this.session.messages.map((msg) => JSON.stringify(msg)),
3991
- "",
3992
- ].join("\n");
3993
- fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
3994
- fs.writeFileSync(debugLogPath, debugData);
3995
- this.chatContainer.addChild(new Spacer(1));
3996
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
3997
- this.ui.requestRender();
3998
- }
3999
- // Pi mascot easter-egg handlers removed in the ORIENT rebrand.
4000
- // Previously: handleArminSaysHi, handleDementedDelves, handleDaxnuts,
4001
- // checkDaxnutsEasterEgg. Components and assets also removed — see
4002
- // MIGRATION.md §3 ("Mascot deletion").
4003
- async handleBashCommand(command, excludeFromContext = false) {
4004
- const extensionRunner = this.session.extensionRunner;
4005
- // Emit user_bash event to let extensions intercept
4006
- const eventResult = extensionRunner
4007
- ? await extensionRunner.emitUserBash({
4008
- type: "user_bash",
4009
- command,
4010
- excludeFromContext,
4011
- cwd: this.sessionManager.getCwd(),
4012
- })
4013
- : undefined;
4014
- // If extension returned a full result, use it directly
4015
- if (eventResult?.result) {
4016
- const result = eventResult.result;
4017
- // Create UI component for display
4018
- this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
4019
- if (this.session.isStreaming) {
4020
- this.pendingMessagesContainer.addChild(this.bashComponent);
4021
- this.pendingBashComponents.push(this.bashComponent);
4022
- }
4023
- else {
4024
- this.chatContainer.addChild(this.bashComponent);
4025
- }
4026
- // Show output and complete
4027
- if (result.output) {
4028
- this.bashComponent.appendOutput(result.output);
4029
- }
4030
- this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath);
4031
- // Record the result in session
4032
- this.session.recordBashResult(command, result, { excludeFromContext });
4033
- this.bashComponent = undefined;
4034
- this.ui.requestRender();
4035
- return;
4036
- }
4037
- // Normal execution path (possibly with custom operations)
4038
- const isDeferred = this.session.isStreaming;
4039
- this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
4040
- if (isDeferred) {
4041
- // Show in pending area when agent is streaming
4042
- this.pendingMessagesContainer.addChild(this.bashComponent);
4043
- this.pendingBashComponents.push(this.bashComponent);
4044
- }
4045
- else {
4046
- // Show in chat immediately when agent is idle
4047
- this.chatContainer.addChild(this.bashComponent);
4048
- }
4049
- this.ui.requestRender();
4050
- try {
4051
- const result = await this.session.executeBash(command, (chunk) => {
4052
- if (this.bashComponent) {
4053
- this.bashComponent.appendOutput(chunk);
4054
- this.ui.requestRender();
4055
- }
4056
- }, { excludeFromContext, operations: eventResult?.operations });
4057
- if (this.bashComponent) {
4058
- this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath);
4059
- }
4060
- }
4061
- catch (error) {
4062
- if (this.bashComponent) {
4063
- this.bashComponent.setComplete(undefined, false);
4064
- }
4065
- this.showError(`Bash command failed: ${error instanceof Error ? error.message : "Unknown error"}`);
4066
- }
4067
- this.bashComponent = undefined;
4068
- this.ui.requestRender();
4069
- }
4070
- async handleCompactCommand(customInstructions) {
4071
- const entries = this.sessionManager.getEntries();
4072
- const messageCount = entries.filter((e) => e.type === "message").length;
4073
- if (messageCount < 2) {
4074
- this.showWarning("Nothing to compact (no messages yet)");
4075
- return;
4076
- }
4077
- if (this.loadingAnimation) {
4078
- this.loadingAnimation.stop();
4079
- this.loadingAnimation = undefined;
4080
- }
4081
- this.statusContainer.clear();
4082
- try {
4083
- await this.session.compact(customInstructions);
4084
- }
4085
- catch {
4086
- // Ignore, will be emitted as an event
4087
- }
4088
- }
4089
- stop() {
4090
- if (this.loadingAnimation) {
4091
- this.loadingAnimation.stop();
4092
- this.loadingAnimation = undefined;
4093
- }
4094
- this.clearExtensionTerminalInputListeners();
4095
- this.footer.dispose();
4096
- this.footerDataProvider.dispose();
4097
- if (this.unsubscribe) {
4098
- this.unsubscribe();
4099
- }
4100
- if (this.isInitialized) {
4101
- this.ui.stop();
4102
- this.isInitialized = false;
4103
- }
4104
- }
4105
- }
4106
- //# sourceMappingURL=interactive-mode.js.map