indusagi-coding-agent 0.1.46 → 0.1.47

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 (432) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/command-line/args.js +1 -1
  3. package/dist/command-line/args.js.map +1 -1
  4. package/dist/command-line/login-handler.d.ts.map +1 -1
  5. package/dist/command-line/login-handler.js +3 -1
  6. package/dist/command-line/login-handler.js.map +1 -1
  7. package/dist/command-line/session-picker.d.ts.map +1 -1
  8. package/dist/command-line/session-picker.js +26 -48
  9. package/dist/command-line/session-picker.js.map +1 -1
  10. package/dist/config.js +1 -1
  11. package/dist/config.js.map +1 -1
  12. package/dist/helpers/open-auth-url.d.ts +2 -0
  13. package/dist/helpers/open-auth-url.d.ts.map +1 -0
  14. package/dist/helpers/open-auth-url.js +54 -0
  15. package/dist/helpers/open-auth-url.js.map +1 -0
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/interfaces/index.d.ts +1 -1
  21. package/dist/interfaces/index.d.ts.map +1 -1
  22. package/dist/interfaces/index.js +1 -1
  23. package/dist/interfaces/index.js.map +1 -1
  24. package/dist/interfaces/react-ink/adapters/command-router.d.ts +17 -0
  25. package/dist/interfaces/react-ink/adapters/command-router.d.ts.map +1 -0
  26. package/dist/interfaces/react-ink/adapters/command-router.js +646 -0
  27. package/dist/interfaces/react-ink/adapters/command-router.js.map +1 -0
  28. package/dist/interfaces/react-ink/adapters/session-events.d.ts +5 -0
  29. package/dist/interfaces/react-ink/adapters/session-events.d.ts.map +1 -0
  30. package/dist/interfaces/react-ink/adapters/session-events.js +69 -0
  31. package/dist/interfaces/react-ink/adapters/session-events.js.map +1 -0
  32. package/dist/interfaces/react-ink/adapters/session-history.d.ts +8 -0
  33. package/dist/interfaces/react-ink/adapters/session-history.d.ts.map +1 -0
  34. package/dist/interfaces/react-ink/adapters/session-history.js +69 -0
  35. package/dist/interfaces/react-ink/adapters/session-history.js.map +1 -0
  36. package/dist/interfaces/react-ink/adapters/tool-state.d.ts +4 -0
  37. package/dist/interfaces/react-ink/adapters/tool-state.d.ts.map +1 -0
  38. package/dist/interfaces/react-ink/adapters/tool-state.js +67 -0
  39. package/dist/interfaces/react-ink/adapters/tool-state.js.map +1 -0
  40. package/dist/interfaces/react-ink/components/AppShell.d.ts +16 -0
  41. package/dist/interfaces/react-ink/components/AppShell.d.ts.map +1 -0
  42. package/dist/interfaces/react-ink/components/AppShell.js +599 -0
  43. package/dist/interfaces/react-ink/components/AppShell.js.map +1 -0
  44. package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts +9 -0
  45. package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts.map +1 -0
  46. package/dist/interfaces/react-ink/components/ChangelogBlock.js +58 -0
  47. package/dist/interfaces/react-ink/components/ChangelogBlock.js.map +1 -0
  48. package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts +9 -0
  49. package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts.map +1 -0
  50. package/dist/interfaces/react-ink/components/DisplayBlockView.js +11 -0
  51. package/dist/interfaces/react-ink/components/DisplayBlockView.js.map +1 -0
  52. package/dist/interfaces/react-ink/components/Footer.d.ts +11 -0
  53. package/dist/interfaces/react-ink/components/Footer.d.ts.map +1 -0
  54. package/dist/interfaces/react-ink/components/Footer.js +18 -0
  55. package/dist/interfaces/react-ink/components/Footer.js.map +1 -0
  56. package/dist/interfaces/react-ink/components/Header.d.ts +13 -0
  57. package/dist/interfaces/react-ink/components/Header.d.ts.map +1 -0
  58. package/dist/interfaces/react-ink/components/Header.js +22 -0
  59. package/dist/interfaces/react-ink/components/Header.js.map +1 -0
  60. package/dist/interfaces/react-ink/components/MessageList.d.ts +14 -0
  61. package/dist/interfaces/react-ink/components/MessageList.d.ts.map +1 -0
  62. package/dist/interfaces/react-ink/components/MessageList.js +43 -0
  63. package/dist/interfaces/react-ink/components/MessageList.js.map +1 -0
  64. package/dist/interfaces/react-ink/components/MessageRow.d.ts +13 -0
  65. package/dist/interfaces/react-ink/components/MessageRow.d.ts.map +1 -0
  66. package/dist/interfaces/react-ink/components/MessageRow.js +35 -0
  67. package/dist/interfaces/react-ink/components/MessageRow.js.map +1 -0
  68. package/dist/interfaces/react-ink/components/PromptInput.d.ts +21 -0
  69. package/dist/interfaces/react-ink/components/PromptInput.d.ts.map +1 -0
  70. package/dist/interfaces/react-ink/components/PromptInput.js +231 -0
  71. package/dist/interfaces/react-ink/components/PromptInput.js.map +1 -0
  72. package/dist/interfaces/react-ink/components/StatusLine.d.ts +10 -0
  73. package/dist/interfaces/react-ink/components/StatusLine.d.ts.map +1 -0
  74. package/dist/interfaces/react-ink/components/StatusLine.js +39 -0
  75. package/dist/interfaces/react-ink/components/StatusLine.js.map +1 -0
  76. package/dist/interfaces/react-ink/components/TaskPanel.d.ts +10 -0
  77. package/dist/interfaces/react-ink/components/TaskPanel.d.ts.map +1 -0
  78. package/dist/interfaces/react-ink/components/TaskPanel.js +23 -0
  79. package/dist/interfaces/react-ink/components/TaskPanel.js.map +1 -0
  80. package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts +18 -0
  81. package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts.map +1 -0
  82. package/dist/interfaces/react-ink/components/ToolEventBlock.js +61 -0
  83. package/dist/interfaces/react-ink/components/ToolEventBlock.js.map +1 -0
  84. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts +9 -0
  85. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts.map +1 -0
  86. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js +6 -0
  87. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js.map +1 -0
  88. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts +15 -0
  89. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts.map +1 -0
  90. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js +10 -0
  91. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js.map +1 -0
  92. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts +10 -0
  93. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts.map +1 -0
  94. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js +64 -0
  95. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js.map +1 -0
  96. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts +10 -0
  97. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts.map +1 -0
  98. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js +24 -0
  99. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js.map +1 -0
  100. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts +10 -0
  101. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +1 -0
  102. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js +95 -0
  103. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js.map +1 -0
  104. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts +17 -0
  105. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts.map +1 -0
  106. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js +66 -0
  107. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js.map +1 -0
  108. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts +11 -0
  109. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts.map +1 -0
  110. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js +10 -0
  111. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js.map +1 -0
  112. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts +15 -0
  113. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts.map +1 -0
  114. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js +79 -0
  115. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js.map +1 -0
  116. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts +10 -0
  117. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +1 -0
  118. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js +99 -0
  119. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js.map +1 -0
  120. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts +8 -0
  121. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts.map +1 -0
  122. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js +7 -0
  123. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js.map +1 -0
  124. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts +9 -0
  125. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts.map +1 -0
  126. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js +7 -0
  127. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js.map +1 -0
  128. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts +9 -0
  129. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts.map +1 -0
  130. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js +7 -0
  131. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js.map +1 -0
  132. package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts +12 -0
  133. package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts.map +1 -0
  134. package/dist/interfaces/react-ink/components/messages/AssistantMessage.js +20 -0
  135. package/dist/interfaces/react-ink/components/messages/AssistantMessage.js.map +1 -0
  136. package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts +9 -0
  137. package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts.map +1 -0
  138. package/dist/interfaces/react-ink/components/messages/BashMessage.js +11 -0
  139. package/dist/interfaces/react-ink/components/messages/BashMessage.js.map +1 -0
  140. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts +9 -0
  141. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts.map +1 -0
  142. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js +6 -0
  143. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js.map +1 -0
  144. package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts +9 -0
  145. package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts.map +1 -0
  146. package/dist/interfaces/react-ink/components/messages/CompactionMessage.js +6 -0
  147. package/dist/interfaces/react-ink/components/messages/CompactionMessage.js.map +1 -0
  148. package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts +10 -0
  149. package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts.map +1 -0
  150. package/dist/interfaces/react-ink/components/messages/CustomMessage.js +9 -0
  151. package/dist/interfaces/react-ink/components/messages/CustomMessage.js.map +1 -0
  152. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts +8 -0
  153. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts.map +1 -0
  154. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js +10 -0
  155. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js.map +1 -0
  156. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts +9 -0
  157. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts.map +1 -0
  158. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js +8 -0
  159. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js.map +1 -0
  160. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts +12 -0
  161. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts.map +1 -0
  162. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js +8 -0
  163. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js.map +1 -0
  164. package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts +10 -0
  165. package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts.map +1 -0
  166. package/dist/interfaces/react-ink/components/messages/UserMessage.js +7 -0
  167. package/dist/interfaces/react-ink/components/messages/UserMessage.js.map +1 -0
  168. package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts +8 -0
  169. package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts.map +1 -0
  170. package/dist/interfaces/react-ink/hooks/use-agent-session.js +29 -0
  171. package/dist/interfaces/react-ink/hooks/use-agent-session.js.map +1 -0
  172. package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts +14 -0
  173. package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts.map +1 -0
  174. package/dist/interfaces/react-ink/hooks/use-app-keybindings.js +54 -0
  175. package/dist/interfaces/react-ink/hooks/use-app-keybindings.js.map +1 -0
  176. package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts +7 -0
  177. package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts.map +1 -0
  178. package/dist/interfaces/react-ink/hooks/use-footer-data.js +17 -0
  179. package/dist/interfaces/react-ink/hooks/use-footer-data.js.map +1 -0
  180. package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts +15 -0
  181. package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts.map +1 -0
  182. package/dist/interfaces/react-ink/hooks/use-prompt-submit.js +53 -0
  183. package/dist/interfaces/react-ink/hooks/use-prompt-submit.js.map +1 -0
  184. package/dist/interfaces/react-ink/hooks/use-session-history.d.ts +8 -0
  185. package/dist/interfaces/react-ink/hooks/use-session-history.d.ts.map +1 -0
  186. package/dist/interfaces/react-ink/hooks/use-session-history.js +8 -0
  187. package/dist/interfaces/react-ink/hooks/use-session-history.js.map +1 -0
  188. package/dist/interfaces/react-ink/index.d.ts +12 -0
  189. package/dist/interfaces/react-ink/index.d.ts.map +1 -0
  190. package/dist/interfaces/react-ink/index.js +12 -0
  191. package/dist/interfaces/react-ink/index.js.map +1 -0
  192. package/dist/interfaces/react-ink/interactive-mode.d.ts +23 -0
  193. package/dist/interfaces/react-ink/interactive-mode.d.ts.map +1 -0
  194. package/dist/interfaces/react-ink/interactive-mode.js +50 -0
  195. package/dist/interfaces/react-ink/interactive-mode.js.map +1 -0
  196. package/dist/interfaces/react-ink/render-root.d.ts +18 -0
  197. package/dist/interfaces/react-ink/render-root.d.ts.map +1 -0
  198. package/dist/interfaces/react-ink/render-root.js +6 -0
  199. package/dist/interfaces/react-ink/render-root.js.map +1 -0
  200. package/dist/interfaces/react-ink/state/reducer.d.ts +51 -0
  201. package/dist/interfaces/react-ink/state/reducer.d.ts.map +1 -0
  202. package/dist/interfaces/react-ink/state/reducer.js +122 -0
  203. package/dist/interfaces/react-ink/state/reducer.js.map +1 -0
  204. package/dist/interfaces/react-ink/state/store.d.ts +4 -0
  205. package/dist/interfaces/react-ink/state/store.d.ts.map +1 -0
  206. package/dist/interfaces/react-ink/state/store.js +5 -0
  207. package/dist/interfaces/react-ink/state/store.js.map +1 -0
  208. package/dist/interfaces/react-ink/state/ui-state.d.ts +5 -0
  209. package/dist/interfaces/react-ink/state/ui-state.d.ts.map +1 -0
  210. package/dist/interfaces/react-ink/state/ui-state.js +20 -0
  211. package/dist/interfaces/react-ink/state/ui-state.js.map +1 -0
  212. package/dist/interfaces/react-ink/theme-adapter.d.ts +10 -0
  213. package/dist/interfaces/react-ink/theme-adapter.d.ts.map +1 -0
  214. package/dist/interfaces/react-ink/theme-adapter.js +54 -0
  215. package/dist/interfaces/react-ink/theme-adapter.js.map +1 -0
  216. package/dist/interfaces/react-ink/types.d.ts +140 -0
  217. package/dist/interfaces/react-ink/types.d.ts.map +1 -0
  218. package/dist/interfaces/react-ink/types.js +2 -0
  219. package/dist/interfaces/react-ink/types.js.map +1 -0
  220. package/dist/interfaces/react-ink/utils/changelog.d.ts +7 -0
  221. package/dist/interfaces/react-ink/utils/changelog.d.ts.map +1 -0
  222. package/dist/interfaces/react-ink/utils/changelog.js +40 -0
  223. package/dist/interfaces/react-ink/utils/changelog.js.map +1 -0
  224. package/dist/interfaces/react-ink/utils/message-groups.d.ts +26 -0
  225. package/dist/interfaces/react-ink/utils/message-groups.d.ts.map +1 -0
  226. package/dist/interfaces/react-ink/utils/message-groups.js +230 -0
  227. package/dist/interfaces/react-ink/utils/message-groups.js.map +1 -0
  228. package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts +20 -0
  229. package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts.map +1 -0
  230. package/dist/interfaces/react-ink/utils/prompt-autocomplete.js +46 -0
  231. package/dist/interfaces/react-ink/utils/prompt-autocomplete.js.map +1 -0
  232. package/dist/interfaces/react-ink/utils/selection-dialog.d.ts +3 -0
  233. package/dist/interfaces/react-ink/utils/selection-dialog.d.ts.map +1 -0
  234. package/dist/interfaces/react-ink/utils/selection-dialog.js +18 -0
  235. package/dist/interfaces/react-ink/utils/selection-dialog.js.map +1 -0
  236. package/dist/interfaces/react-ink/utils/session-actions.d.ts +8 -0
  237. package/dist/interfaces/react-ink/utils/session-actions.d.ts.map +1 -0
  238. package/dist/interfaces/react-ink/utils/session-actions.js +56 -0
  239. package/dist/interfaces/react-ink/utils/session-actions.js.map +1 -0
  240. package/dist/interfaces/react-ink/utils/slash-commands.d.ts +10 -0
  241. package/dist/interfaces/react-ink/utils/slash-commands.d.ts.map +1 -0
  242. package/dist/interfaces/react-ink/utils/slash-commands.js +111 -0
  243. package/dist/interfaces/react-ink/utils/slash-commands.js.map +1 -0
  244. package/dist/interfaces/react-ink/utils/tool-display.d.ts +22 -0
  245. package/dist/interfaces/react-ink/utils/tool-display.d.ts.map +1 -0
  246. package/dist/interfaces/react-ink/utils/tool-display.js +349 -0
  247. package/dist/interfaces/react-ink/utils/tool-display.js.map +1 -0
  248. package/dist/interfaces/service-api/rpc-mode.js +1 -1
  249. package/dist/interfaces/service-api/rpc-mode.js.map +1 -1
  250. package/dist/interfaces/theme/theme.d.ts.map +1 -0
  251. package/dist/interfaces/{terminal-ui/theme → theme}/theme.js +1 -1
  252. package/dist/interfaces/theme/theme.js.map +1 -0
  253. package/dist/main.js +1 -1
  254. package/dist/main.js.map +1 -1
  255. package/dist/runtime/agent-session.js +1 -1
  256. package/dist/runtime/agent-session.js.map +1 -1
  257. package/dist/runtime/html-export/index.js +1 -1
  258. package/dist/runtime/html-export/index.js.map +1 -1
  259. package/dist/runtime/html-export/index.ts +1 -2
  260. package/dist/runtime/html-export/tool-renderer.d.ts +1 -1
  261. package/dist/runtime/html-export/tool-renderer.d.ts.map +1 -1
  262. package/dist/runtime/html-export/tool-renderer.ts +1 -1
  263. package/dist/runtime/plugins/runner.js +1 -1
  264. package/dist/runtime/plugins/runner.js.map +1 -1
  265. package/dist/runtime/plugins/types.d.ts +1 -1
  266. package/dist/runtime/plugins/types.d.ts.map +1 -1
  267. package/dist/runtime/resource-loader.d.ts +1 -1
  268. package/dist/runtime/resource-loader.d.ts.map +1 -1
  269. package/dist/runtime/resource-loader.js +1 -1
  270. package/dist/runtime/resource-loader.js.map +1 -1
  271. package/dist/runtime/system-prompt.js +1 -1
  272. package/dist/runtime/system-prompt.js.map +1 -1
  273. package/dist/runtime/tooling/composio-compat.d.ts +169 -0
  274. package/dist/runtime/tooling/composio-compat.d.ts.map +1 -0
  275. package/dist/runtime/tooling/composio-compat.js +163 -0
  276. package/dist/runtime/tooling/composio-compat.js.map +1 -0
  277. package/dist/runtime/tooling/index.d.ts +12 -25
  278. package/dist/runtime/tooling/index.d.ts.map +1 -1
  279. package/dist/runtime/tooling/index.js +3 -3
  280. package/dist/runtime/tooling/index.js.map +1 -1
  281. package/guides/INDUSVX_OBSERVE_FULL_INTEGRATION_REPORT.md +2 -2
  282. package/package.json +9 -5
  283. package/dist/interfaces/induscode-ui-delegate.d.ts +0 -3
  284. package/dist/interfaces/induscode-ui-delegate.d.ts.map +0 -1
  285. package/dist/interfaces/induscode-ui-delegate.js +0 -148
  286. package/dist/interfaces/induscode-ui-delegate.js.map +0 -1
  287. package/dist/interfaces/terminal-ui/components/armin.d.ts +0 -19
  288. package/dist/interfaces/terminal-ui/components/armin.d.ts.map +0 -1
  289. package/dist/interfaces/terminal-ui/components/armin.js +0 -280
  290. package/dist/interfaces/terminal-ui/components/armin.js.map +0 -1
  291. package/dist/interfaces/terminal-ui/components/assistant-message.d.ts +0 -13
  292. package/dist/interfaces/terminal-ui/components/assistant-message.d.ts.map +0 -1
  293. package/dist/interfaces/terminal-ui/components/assistant-message.js +0 -95
  294. package/dist/interfaces/terminal-ui/components/assistant-message.js.map +0 -1
  295. package/dist/interfaces/terminal-ui/components/bash-execution.d.ts +0 -24
  296. package/dist/interfaces/terminal-ui/components/bash-execution.d.ts.map +0 -1
  297. package/dist/interfaces/terminal-ui/components/bash-execution.js +0 -135
  298. package/dist/interfaces/terminal-ui/components/bash-execution.js.map +0 -1
  299. package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts +0 -14
  300. package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts.map +0 -1
  301. package/dist/interfaces/terminal-ui/components/bordered-loader.js +0 -78
  302. package/dist/interfaces/terminal-ui/components/bordered-loader.js.map +0 -1
  303. package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts +0 -16
  304. package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts.map +0 -1
  305. package/dist/interfaces/terminal-ui/components/branch-summary-message.js +0 -55
  306. package/dist/interfaces/terminal-ui/components/branch-summary-message.js.map +0 -1
  307. package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts +0 -16
  308. package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts.map +0 -1
  309. package/dist/interfaces/terminal-ui/components/compaction-summary-message.js +0 -60
  310. package/dist/interfaces/terminal-ui/components/compaction-summary-message.js.map +0 -1
  311. package/dist/interfaces/terminal-ui/components/config-selector.d.ts +0 -71
  312. package/dist/interfaces/terminal-ui/components/config-selector.d.ts.map +0 -1
  313. package/dist/interfaces/terminal-ui/components/config-selector.js +0 -459
  314. package/dist/interfaces/terminal-ui/components/config-selector.js.map +0 -1
  315. package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts +0 -10
  316. package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts.map +0 -1
  317. package/dist/interfaces/terminal-ui/components/countdown-timer.js +0 -42
  318. package/dist/interfaces/terminal-ui/components/countdown-timer.js.map +0 -1
  319. package/dist/interfaces/terminal-ui/components/custom-editor.d.ts +0 -17
  320. package/dist/interfaces/terminal-ui/components/custom-editor.d.ts.map +0 -1
  321. package/dist/interfaces/terminal-ui/components/custom-editor.js +0 -72
  322. package/dist/interfaces/terminal-ui/components/custom-editor.js.map +0 -1
  323. package/dist/interfaces/terminal-ui/components/custom-message.d.ts +0 -19
  324. package/dist/interfaces/terminal-ui/components/custom-message.d.ts.map +0 -1
  325. package/dist/interfaces/terminal-ui/components/custom-message.js +0 -71
  326. package/dist/interfaces/terminal-ui/components/custom-message.js.map +0 -1
  327. package/dist/interfaces/terminal-ui/components/diff.d.ts +0 -9
  328. package/dist/interfaces/terminal-ui/components/diff.d.ts.map +0 -1
  329. package/dist/interfaces/terminal-ui/components/diff.js +0 -126
  330. package/dist/interfaces/terminal-ui/components/diff.js.map +0 -1
  331. package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts +0 -20
  332. package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts.map +0 -1
  333. package/dist/interfaces/terminal-ui/components/dynamic-border.js +0 -40
  334. package/dist/interfaces/terminal-ui/components/dynamic-border.js.map +0 -1
  335. package/dist/interfaces/terminal-ui/components/extension-editor.d.ts +0 -13
  336. package/dist/interfaces/terminal-ui/components/extension-editor.d.ts.map +0 -1
  337. package/dist/interfaces/terminal-ui/components/extension-editor.js +0 -94
  338. package/dist/interfaces/terminal-ui/components/extension-editor.js.map +0 -1
  339. package/dist/interfaces/terminal-ui/components/extension-input.d.ts +0 -18
  340. package/dist/interfaces/terminal-ui/components/extension-input.d.ts.map +0 -1
  341. package/dist/interfaces/terminal-ui/components/extension-input.js +0 -72
  342. package/dist/interfaces/terminal-ui/components/extension-input.js.map +0 -1
  343. package/dist/interfaces/terminal-ui/components/extension-selector.d.ts +0 -19
  344. package/dist/interfaces/terminal-ui/components/extension-selector.d.ts.map +0 -1
  345. package/dist/interfaces/terminal-ui/components/extension-selector.js +0 -93
  346. package/dist/interfaces/terminal-ui/components/extension-selector.js.map +0 -1
  347. package/dist/interfaces/terminal-ui/components/footer.d.ts +0 -17
  348. package/dist/interfaces/terminal-ui/components/footer.d.ts.map +0 -1
  349. package/dist/interfaces/terminal-ui/components/footer.js +0 -160
  350. package/dist/interfaces/terminal-ui/components/footer.js.map +0 -1
  351. package/dist/interfaces/terminal-ui/components/index.d.ts +0 -80
  352. package/dist/interfaces/terminal-ui/components/index.d.ts.map +0 -1
  353. package/dist/interfaces/terminal-ui/components/index.js +0 -74
  354. package/dist/interfaces/terminal-ui/components/index.js.map +0 -1
  355. package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts +0 -23
  356. package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts.map +0 -1
  357. package/dist/interfaces/terminal-ui/components/keybinding-hints.js +0 -54
  358. package/dist/interfaces/terminal-ui/components/keybinding-hints.js.map +0 -1
  359. package/dist/interfaces/terminal-ui/components/login-dialog.d.ts +0 -29
  360. package/dist/interfaces/terminal-ui/components/login-dialog.d.ts.map +0 -1
  361. package/dist/interfaces/terminal-ui/components/login-dialog.js +0 -143
  362. package/dist/interfaces/terminal-ui/components/login-dialog.js.map +0 -1
  363. package/dist/interfaces/terminal-ui/components/model-selector.d.ts +0 -43
  364. package/dist/interfaces/terminal-ui/components/model-selector.d.ts.map +0 -1
  365. package/dist/interfaces/terminal-ui/components/model-selector.js +0 -201
  366. package/dist/interfaces/terminal-ui/components/model-selector.js.map +0 -1
  367. package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts +0 -75
  368. package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts.map +0 -1
  369. package/dist/interfaces/terminal-ui/components/oauth-selector.js +0 -374
  370. package/dist/interfaces/terminal-ui/components/oauth-selector.js.map +0 -1
  371. package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts +0 -39
  372. package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts.map +0 -1
  373. package/dist/interfaces/terminal-ui/components/scoped-models-selector.js +0 -242
  374. package/dist/interfaces/terminal-ui/components/scoped-models-selector.js.map +0 -1
  375. package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts +0 -21
  376. package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts.map +0 -1
  377. package/dist/interfaces/terminal-ui/components/session-selector-search.js +0 -135
  378. package/dist/interfaces/terminal-ui/components/session-selector-search.js.map +0 -1
  379. package/dist/interfaces/terminal-ui/components/session-selector.d.ts +0 -85
  380. package/dist/interfaces/terminal-ui/components/session-selector.d.ts.map +0 -1
  381. package/dist/interfaces/terminal-ui/components/session-selector.js +0 -688
  382. package/dist/interfaces/terminal-ui/components/session-selector.js.map +0 -1
  383. package/dist/interfaces/terminal-ui/components/settings-selector.d.ts +0 -49
  384. package/dist/interfaces/terminal-ui/components/settings-selector.d.ts.map +0 -1
  385. package/dist/interfaces/terminal-ui/components/settings-selector.js +0 -159
  386. package/dist/interfaces/terminal-ui/components/settings-selector.js.map +0 -1
  387. package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts +0 -10
  388. package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts.map +0 -1
  389. package/dist/interfaces/terminal-ui/components/show-images-selector.js +0 -32
  390. package/dist/interfaces/terminal-ui/components/show-images-selector.js.map +0 -1
  391. package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts +0 -17
  392. package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts.map +0 -1
  393. package/dist/interfaces/terminal-ui/components/skill-invocation-message.js +0 -55
  394. package/dist/interfaces/terminal-ui/components/skill-invocation-message.js.map +0 -1
  395. package/dist/interfaces/terminal-ui/components/theme-selector.d.ts +0 -11
  396. package/dist/interfaces/terminal-ui/components/theme-selector.d.ts.map +0 -1
  397. package/dist/interfaces/terminal-ui/components/theme-selector.js +0 -39
  398. package/dist/interfaces/terminal-ui/components/theme-selector.js.map +0 -1
  399. package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts +0 -11
  400. package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts.map +0 -1
  401. package/dist/interfaces/terminal-ui/components/thinking-selector.js +0 -45
  402. package/dist/interfaces/terminal-ui/components/thinking-selector.js.map +0 -1
  403. package/dist/interfaces/terminal-ui/components/tool-execution.d.ts +0 -72
  404. package/dist/interfaces/terminal-ui/components/tool-execution.d.ts.map +0 -1
  405. package/dist/interfaces/terminal-ui/components/tool-execution.js +0 -1162
  406. package/dist/interfaces/terminal-ui/components/tool-execution.js.map +0 -1
  407. package/dist/interfaces/terminal-ui/components/tree-selector.d.ts +0 -62
  408. package/dist/interfaces/terminal-ui/components/tree-selector.d.ts.map +0 -1
  409. package/dist/interfaces/terminal-ui/components/tree-selector.js +0 -886
  410. package/dist/interfaces/terminal-ui/components/tree-selector.js.map +0 -1
  411. package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts +0 -24
  412. package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts.map +0 -1
  413. package/dist/interfaces/terminal-ui/components/user-message-selector.js +0 -99
  414. package/dist/interfaces/terminal-ui/components/user-message-selector.js.map +0 -1
  415. package/dist/interfaces/terminal-ui/components/user-message.d.ts +0 -193
  416. package/dist/interfaces/terminal-ui/components/user-message.d.ts.map +0 -1
  417. package/dist/interfaces/terminal-ui/components/user-message.js +0 -201
  418. package/dist/interfaces/terminal-ui/components/user-message.js.map +0 -1
  419. package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts +0 -12
  420. package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts.map +0 -1
  421. package/dist/interfaces/terminal-ui/components/visual-truncate.js +0 -25
  422. package/dist/interfaces/terminal-ui/components/visual-truncate.js.map +0 -1
  423. package/dist/interfaces/terminal-ui/interactive-mode.d.ts +0 -1941
  424. package/dist/interfaces/terminal-ui/interactive-mode.d.ts.map +0 -1
  425. package/dist/interfaces/terminal-ui/interactive-mode.js +0 -5940
  426. package/dist/interfaces/terminal-ui/interactive-mode.js.map +0 -1
  427. package/dist/interfaces/terminal-ui/theme/theme.d.ts.map +0 -1
  428. package/dist/interfaces/terminal-ui/theme/theme.js.map +0 -1
  429. /package/dist/interfaces/{terminal-ui/theme → theme}/dark.json +0 -0
  430. /package/dist/interfaces/{terminal-ui/theme → theme}/light.json +0 -0
  431. /package/dist/interfaces/{terminal-ui/theme → theme}/theme-schema.json +0 -0
  432. /package/dist/interfaces/{terminal-ui/theme → theme}/theme.d.ts +0 -0
@@ -1,688 +0,0 @@
1
- import { spawnSync } from "node:child_process";
2
- import { existsSync } from "node:fs";
3
- import { unlink } from "node:fs/promises";
4
- import * as os from "node:os";
5
- import { Container, getEditorKeybindings, Input, matchesKey, Spacer, Text, truncateToWidth, visibleWidth, } from "indusagi/tui";
6
- import { theme } from "../theme/theme.js";
7
- import { DynamicBorder } from "./dynamic-border.js";
8
- import { keyHint } from "./keybinding-hints.js";
9
- import { filterAndSortSessions } from "./session-selector-search.js";
10
- function shortenPath(path) {
11
- const home = os.homedir();
12
- if (!path)
13
- return path;
14
- if (path.startsWith(home)) {
15
- return `~${path.slice(home.length)}`;
16
- }
17
- return path;
18
- }
19
- function formatSessionDate(date) {
20
- const now = new Date();
21
- const diffMs = now.getTime() - date.getTime();
22
- const diffMins = Math.floor(diffMs / 60000);
23
- const diffHours = Math.floor(diffMs / 3600000);
24
- const diffDays = Math.floor(diffMs / 86400000);
25
- if (diffMins < 1)
26
- return "just now";
27
- if (diffMins < 60)
28
- return `${diffMins} minute${diffMins !== 1 ? "s" : ""} ago`;
29
- if (diffHours < 24)
30
- return `${diffHours} hour${diffHours !== 1 ? "s" : ""} ago`;
31
- if (diffDays === 1)
32
- return "1 day ago";
33
- if (diffDays < 7)
34
- return `${diffDays} days ago`;
35
- return date.toLocaleDateString();
36
- }
37
- function buildSessionMetadata(session, showCwd) {
38
- const parts = [formatSessionDate(session.modified), `${session.messageCount} message${session.messageCount !== 1 ? "s" : ""}`];
39
- if (showCwd && session.cwd) {
40
- parts.push(shortenPath(session.cwd));
41
- }
42
- return ` ${parts.join(" · ")}`;
43
- }
44
- function renderSessionPrimaryLine(session, selected, confirmingDelete, width) {
45
- const displayText = (session.name ?? session.firstMessage).replace(/\n/g, " ").trim();
46
- const cursor = selected ? theme.fg("accent", "› ") : " ";
47
- const truncated = truncateToWidth(displayText, width - 2, "...");
48
- const colorKey = confirmingDelete ? "error" : session.name ? "warning" : null;
49
- let rendered = colorKey ? theme.fg(colorKey, truncated) : truncated;
50
- if (selected) {
51
- rendered = theme.bold(rendered);
52
- }
53
- return cursor + rendered;
54
- }
55
- function renderSessionMetadataLine(session, confirmingDelete, showCwd, width) {
56
- return theme.fg(confirmingDelete ? "error" : "dim", truncateToWidth(buildSessionMetadata(session, showCwd), width, ""));
57
- }
58
- function renderSessionPathLine(session, confirmingDelete, width) {
59
- return theme.fg(confirmingDelete ? "error" : "muted", truncateToWidth(` ${shortenPath(session.path)}`, width, "…"));
60
- }
61
- class SessionSelectorHeader {
62
- constructor(scope, sortMode, requestRender) {
63
- this.loading = false;
64
- this.loadProgress = null;
65
- this.showPath = false;
66
- this.confirmingDeletePath = null;
67
- this.statusMessage = null;
68
- this.statusTimeout = null;
69
- this.showRenameHint = false;
70
- this.scope = scope;
71
- this.sortMode = sortMode;
72
- this.requestRender = requestRender;
73
- }
74
- setScope(scope) {
75
- this.scope = scope;
76
- }
77
- setSortMode(sortMode) {
78
- this.sortMode = sortMode;
79
- }
80
- setLoading(loading) {
81
- this.loading = loading;
82
- // Progress is scoped to the current load; clear whenever the loading state is set
83
- this.loadProgress = null;
84
- }
85
- setProgress(loaded, total) {
86
- this.loadProgress = { loaded, total };
87
- }
88
- setShowPath(showPath) {
89
- this.showPath = showPath;
90
- }
91
- setShowRenameHint(show) {
92
- this.showRenameHint = show;
93
- }
94
- setConfirmingDeletePath(path) {
95
- this.confirmingDeletePath = path;
96
- }
97
- clearStatusTimeout() {
98
- if (!this.statusTimeout)
99
- return;
100
- clearTimeout(this.statusTimeout);
101
- this.statusTimeout = null;
102
- }
103
- setStatusMessage(msg, autoHideMs) {
104
- this.clearStatusTimeout();
105
- this.statusMessage = msg;
106
- if (!msg || !autoHideMs)
107
- return;
108
- this.statusTimeout = setTimeout(() => {
109
- this.statusMessage = null;
110
- this.statusTimeout = null;
111
- this.requestRender();
112
- }, autoHideMs);
113
- }
114
- invalidate() { }
115
- render(width) {
116
- const title = this.scope === "current" ? "Resume Session (Current Folder)" : "Resume Session (All)";
117
- const leftText = theme.bold(title);
118
- const sortLabel = this.sortMode === "recent" ? "Recent" : "Fuzzy";
119
- const sortText = theme.fg("muted", "Sort: ") + theme.fg("accent", sortLabel);
120
- let scopeText;
121
- if (this.loading) {
122
- const progressText = this.loadProgress ? `${this.loadProgress.loaded}/${this.loadProgress.total}` : "...";
123
- scopeText = `${theme.fg("muted", "○ Current Folder | ")}${theme.fg("accent", `Loading ${progressText}`)}`;
124
- }
125
- else if (this.scope === "current") {
126
- scopeText = `${theme.fg("accent", "◉ Current Folder")}${theme.fg("muted", " | ○ All")}`;
127
- }
128
- else {
129
- scopeText = `${theme.fg("muted", "○ Current Folder | ")}${theme.fg("accent", "◉ All")}`;
130
- }
131
- const rightText = truncateToWidth(`${scopeText} ${sortText}`, width, "");
132
- const availableLeft = Math.max(0, width - visibleWidth(rightText) - 1);
133
- const left = truncateToWidth(leftText, availableLeft, "");
134
- const spacing = Math.max(0, width - visibleWidth(left) - visibleWidth(rightText));
135
- // Build hint lines - changes based on state (all branches truncate to width)
136
- let hintLine1;
137
- let hintLine2;
138
- if (this.confirmingDeletePath !== null) {
139
- const confirmHint = "Delete session? [Enter] confirm · [Esc/Ctrl+C] cancel";
140
- hintLine1 = theme.fg("error", truncateToWidth(confirmHint, width, "…"));
141
- hintLine2 = "";
142
- }
143
- else if (this.statusMessage) {
144
- const color = this.statusMessage.type === "error" ? "error" : "accent";
145
- hintLine1 = theme.fg(color, truncateToWidth(this.statusMessage.message, width, "…"));
146
- hintLine2 = "";
147
- }
148
- else {
149
- const pathState = this.showPath ? "(on)" : "(off)";
150
- const sep = theme.fg("muted", " · ");
151
- const hint1 = keyHint("tab", "scope") + sep + theme.fg("muted", 're:<pattern> regex · "phrase" exact');
152
- const hint2Parts = [
153
- keyHint("toggleSessionSort", "sort"),
154
- keyHint("deleteSession", "delete"),
155
- keyHint("toggleSessionPath", `path ${pathState}`),
156
- ];
157
- if (this.showRenameHint) {
158
- hint2Parts.push(keyHint("renameSession", "rename"));
159
- }
160
- const hint2 = hint2Parts.join(sep);
161
- hintLine1 = truncateToWidth(hint1, width, "…");
162
- hintLine2 = truncateToWidth(hint2, width, "…");
163
- }
164
- return [`${left}${" ".repeat(spacing)}${rightText}`, hintLine1, hintLine2];
165
- }
166
- }
167
- /**
168
- * Custom session list component with multi-line items and search
169
- */
170
- class SessionList {
171
- getSelectedSessionPath() {
172
- const selected = this.filteredSessions[this.selectedIndex];
173
- return selected?.path;
174
- }
175
- get focused() {
176
- return this._focused;
177
- }
178
- set focused(value) {
179
- this._focused = value;
180
- this.searchInput.focused = value;
181
- }
182
- constructor(sessions, showCwd, sortMode, currentSessionFilePath) {
183
- this.allSessions = [];
184
- this.filteredSessions = [];
185
- this.selectedIndex = 0;
186
- this.showCwd = false;
187
- this.sortMode = "relevance";
188
- this.showPath = false;
189
- this.confirmingDeletePath = null;
190
- this.onExit = () => { };
191
- this.maxVisible = 5; // Max sessions visible (each session: message + metadata + optional path + blank)
192
- // Focusable implementation - propagate to searchInput for IME cursor positioning
193
- this._focused = false;
194
- this.allSessions = sessions;
195
- this.filteredSessions = sessions;
196
- this.searchInput = new Input();
197
- this.showCwd = showCwd;
198
- this.sortMode = sortMode;
199
- this.currentSessionFilePath = currentSessionFilePath;
200
- // Handle Enter in search input - select current item
201
- this.searchInput.onSubmit = () => {
202
- if (this.filteredSessions[this.selectedIndex]) {
203
- const selected = this.filteredSessions[this.selectedIndex];
204
- if (this.onSelect) {
205
- this.onSelect(selected.path);
206
- }
207
- }
208
- };
209
- }
210
- setSortMode(sortMode) {
211
- this.sortMode = sortMode;
212
- this.filterSessions(this.searchInput.getValue());
213
- }
214
- setSessions(sessions, showCwd) {
215
- this.allSessions = sessions;
216
- this.showCwd = showCwd;
217
- this.filterSessions(this.searchInput.getValue());
218
- }
219
- filterSessions(query) {
220
- this.filteredSessions = filterAndSortSessions(this.allSessions, query, this.sortMode);
221
- this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredSessions.length - 1));
222
- }
223
- setConfirmingDeletePath(path) {
224
- this.confirmingDeletePath = path;
225
- this.onDeleteConfirmationChange?.(path);
226
- }
227
- startDeleteConfirmationForSelectedSession() {
228
- const selected = this.filteredSessions[this.selectedIndex];
229
- if (!selected)
230
- return;
231
- // Prevent deleting current session
232
- if (this.currentSessionFilePath && selected.path === this.currentSessionFilePath) {
233
- this.onError?.("Cannot delete the currently active session");
234
- return;
235
- }
236
- this.setConfirmingDeletePath(selected.path);
237
- }
238
- invalidate() { }
239
- render(width) {
240
- const lines = [];
241
- // Render search input
242
- lines.push(...this.searchInput.render(width));
243
- lines.push(""); // Blank line after search
244
- if (this.filteredSessions.length === 0) {
245
- if (this.showCwd) {
246
- // "All" scope - no sessions anywhere that match filter
247
- lines.push(theme.fg("muted", truncateToWidth(" No sessions found", width, "…")));
248
- }
249
- else {
250
- // "Current folder" scope - hint to try "all"
251
- lines.push(theme.fg("muted", truncateToWidth(" No sessions in current folder. Press Tab to view all.", width, "…")));
252
- }
253
- return lines;
254
- }
255
- // Calculate visible range with scrolling
256
- const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.filteredSessions.length - this.maxVisible));
257
- const endIndex = Math.min(startIndex + this.maxVisible, this.filteredSessions.length);
258
- // Render visible sessions (message + metadata + optional path + blank line)
259
- for (let i = startIndex; i < endIndex; i++) {
260
- const session = this.filteredSessions[i];
261
- const isSelected = i === this.selectedIndex;
262
- const isConfirmingDelete = session.path === this.confirmingDeletePath;
263
- lines.push(renderSessionPrimaryLine(session, isSelected, isConfirmingDelete, width));
264
- lines.push(renderSessionMetadataLine(session, isConfirmingDelete, this.showCwd, width));
265
- if (this.showPath) {
266
- lines.push(renderSessionPathLine(session, isConfirmingDelete, width));
267
- }
268
- lines.push("");
269
- }
270
- // Add scroll indicator if needed
271
- if (startIndex > 0 || endIndex < this.filteredSessions.length) {
272
- const scrollText = ` (${this.selectedIndex + 1}/${this.filteredSessions.length})`;
273
- const scrollInfo = theme.fg("muted", truncateToWidth(scrollText, width, ""));
274
- lines.push(scrollInfo);
275
- }
276
- return lines;
277
- }
278
- handleInput(keyData) {
279
- const kb = getEditorKeybindings();
280
- // Handle delete confirmation state first - intercept all keys
281
- if (this.confirmingDeletePath !== null) {
282
- if (kb.matches(keyData, "selectConfirm")) {
283
- const pathToDelete = this.confirmingDeletePath;
284
- this.setConfirmingDeletePath(null);
285
- void this.onDeleteSession?.(pathToDelete);
286
- return;
287
- }
288
- // Allow both Escape and Ctrl+C to cancel (consistent with indusagi UX)
289
- if (kb.matches(keyData, "selectCancel") || matchesKey(keyData, "ctrl+c")) {
290
- this.setConfirmingDeletePath(null);
291
- return;
292
- }
293
- // Ignore all other keys while confirming
294
- return;
295
- }
296
- if (kb.matches(keyData, "tab")) {
297
- if (this.onToggleScope) {
298
- this.onToggleScope();
299
- }
300
- return;
301
- }
302
- if (kb.matches(keyData, "toggleSessionSort")) {
303
- this.onToggleSort?.();
304
- return;
305
- }
306
- // Ctrl+P: toggle path display
307
- if (kb.matches(keyData, "toggleSessionPath")) {
308
- this.showPath = !this.showPath;
309
- this.onTogglePath?.(this.showPath);
310
- return;
311
- }
312
- // Ctrl+D: initiate delete confirmation (useful on terminals that don't distinguish Ctrl+Backspace from Backspace)
313
- if (kb.matches(keyData, "deleteSession")) {
314
- this.startDeleteConfirmationForSelectedSession();
315
- return;
316
- }
317
- // Ctrl+R: rename selected session
318
- if (matchesKey(keyData, "ctrl+r")) {
319
- const selected = this.filteredSessions[this.selectedIndex];
320
- if (selected) {
321
- this.onRenameSession?.(selected.path);
322
- }
323
- return;
324
- }
325
- // Ctrl+Backspace: non-invasive convenience alias for delete
326
- // Only triggers deletion when the query is empty; otherwise it is forwarded to the input
327
- if (kb.matches(keyData, "deleteSessionNoninvasive")) {
328
- if (this.searchInput.getValue().length > 0) {
329
- this.searchInput.handleInput(keyData);
330
- this.filterSessions(this.searchInput.getValue());
331
- return;
332
- }
333
- this.startDeleteConfirmationForSelectedSession();
334
- return;
335
- }
336
- // Up arrow
337
- if (kb.matches(keyData, "selectUp")) {
338
- this.selectedIndex = Math.max(0, this.selectedIndex - 1);
339
- }
340
- // Down arrow
341
- else if (kb.matches(keyData, "selectDown")) {
342
- this.selectedIndex = Math.min(this.filteredSessions.length - 1, this.selectedIndex + 1);
343
- }
344
- // Page up - jump up by maxVisible items
345
- else if (kb.matches(keyData, "selectPageUp")) {
346
- this.selectedIndex = Math.max(0, this.selectedIndex - this.maxVisible);
347
- }
348
- // Page down - jump down by maxVisible items
349
- else if (kb.matches(keyData, "selectPageDown")) {
350
- this.selectedIndex = Math.min(this.filteredSessions.length - 1, this.selectedIndex + this.maxVisible);
351
- }
352
- // Enter
353
- else if (kb.matches(keyData, "selectConfirm")) {
354
- const selected = this.filteredSessions[this.selectedIndex];
355
- if (selected && this.onSelect) {
356
- this.onSelect(selected.path);
357
- }
358
- }
359
- // Escape - cancel
360
- else if (kb.matches(keyData, "selectCancel")) {
361
- if (this.onCancel) {
362
- this.onCancel();
363
- }
364
- }
365
- // Pass everything else to search input
366
- else {
367
- this.searchInput.handleInput(keyData);
368
- this.filterSessions(this.searchInput.getValue());
369
- }
370
- }
371
- }
372
- /**
373
- * Delete a session file, trying the `trash` CLI first, then falling back to unlink
374
- */
375
- async function deleteSessionFile(sessionPath) {
376
- // Try `trash` first (if installed)
377
- const trashArgs = sessionPath.startsWith("-") ? ["--", sessionPath] : [sessionPath];
378
- const trashResult = spawnSync("trash", trashArgs, { encoding: "utf-8" });
379
- const getTrashErrorHint = () => {
380
- const parts = [];
381
- if (trashResult.error) {
382
- parts.push(trashResult.error.message);
383
- }
384
- const stderr = trashResult.stderr?.trim();
385
- if (stderr) {
386
- parts.push(stderr.split("\n")[0] ?? stderr);
387
- }
388
- if (parts.length === 0)
389
- return null;
390
- return `trash: ${parts.join(" · ").slice(0, 200)}`;
391
- };
392
- // If trash reports success, or the file is gone afterwards, treat it as successful
393
- if (trashResult.status === 0 || !existsSync(sessionPath)) {
394
- return { ok: true, method: "trash" };
395
- }
396
- // Fallback to permanent deletion
397
- try {
398
- await unlink(sessionPath);
399
- return { ok: true, method: "unlink" };
400
- }
401
- catch (err) {
402
- const unlinkError = err instanceof Error ? err.message : String(err);
403
- const trashErrorHint = getTrashErrorHint();
404
- const error = trashErrorHint ? `${unlinkError} (${trashErrorHint})` : unlinkError;
405
- return { ok: false, method: "unlink", error };
406
- }
407
- }
408
- /**
409
- * Component that renders a session selector
410
- */
411
- export class SessionSelectorComponent extends Container {
412
- handleInput(data) {
413
- if (this.mode === "rename") {
414
- const kb = getEditorKeybindings();
415
- if (kb.matches(data, "selectCancel") || matchesKey(data, "ctrl+c")) {
416
- this.exitRenameMode();
417
- return;
418
- }
419
- this.renameInput.handleInput(data);
420
- return;
421
- }
422
- this.sessionList.handleInput(data);
423
- }
424
- get focused() {
425
- return this._focused;
426
- }
427
- set focused(value) {
428
- this._focused = value;
429
- this.sessionList.focused = value;
430
- this.renameInput.focused = value;
431
- if (value && this.mode === "rename") {
432
- this.renameInput.focused = true;
433
- }
434
- }
435
- buildBaseLayout(content, options) {
436
- this.clear();
437
- this.addChild(new Spacer(1));
438
- this.addChild(new DynamicBorder((s) => theme.fg("accent", s)));
439
- this.addChild(new Spacer(1));
440
- if (options?.showHeader ?? true) {
441
- this.addChild(this.header);
442
- this.addChild(new Spacer(1));
443
- }
444
- this.addChild(content);
445
- this.addChild(new Spacer(1));
446
- this.addChild(new DynamicBorder((s) => theme.fg("accent", s)));
447
- }
448
- constructor(currentSessionsLoader, allSessionsLoader, onSelect, onCancel, onExit, requestRender, options, currentSessionFilePath) {
449
- super();
450
- this.canRename = true;
451
- this.scope = "current";
452
- this.sortMode = "relevance";
453
- this.currentSessions = null;
454
- this.allSessions = null;
455
- this.currentLoading = false;
456
- this.allLoading = false;
457
- this.allLoadSeq = 0;
458
- this.mode = "list";
459
- this.renameInput = new Input();
460
- this.renameTargetPath = null;
461
- // Focusable implementation - propagate to sessionList for IME cursor positioning
462
- this._focused = false;
463
- this.currentSessionsLoader = currentSessionsLoader;
464
- this.allSessionsLoader = allSessionsLoader;
465
- this.onCancel = onCancel;
466
- this.requestRender = requestRender;
467
- this.header = new SessionSelectorHeader(this.scope, this.sortMode, this.requestRender);
468
- const renameSession = options?.renameSession;
469
- this.renameSession = renameSession;
470
- this.canRename = !!renameSession;
471
- this.header.setShowRenameHint(options?.showRenameHint ?? this.canRename);
472
- // Create session list (starts empty, will be populated after load)
473
- this.sessionList = new SessionList([], false, this.sortMode, currentSessionFilePath);
474
- this.buildBaseLayout(this.sessionList);
475
- this.renameInput.onSubmit = (value) => {
476
- void this.confirmRename(value);
477
- };
478
- // Ensure header status timeouts are cleared when leaving the selector
479
- const clearStatusMessage = () => this.header.setStatusMessage(null);
480
- this.sessionList.onSelect = (sessionPath) => {
481
- clearStatusMessage();
482
- onSelect(sessionPath);
483
- };
484
- this.sessionList.onCancel = () => {
485
- clearStatusMessage();
486
- onCancel();
487
- };
488
- this.sessionList.onExit = () => {
489
- clearStatusMessage();
490
- onExit();
491
- };
492
- this.sessionList.onToggleScope = () => this.toggleScope();
493
- this.sessionList.onToggleSort = () => this.toggleSortMode();
494
- this.sessionList.onRenameSession = (sessionPath) => {
495
- if (!renameSession)
496
- return;
497
- if (this.scope === "current" && this.currentLoading)
498
- return;
499
- if (this.scope === "all" && this.allLoading)
500
- return;
501
- const sessions = this.scope === "all" ? (this.allSessions ?? []) : (this.currentSessions ?? []);
502
- const session = sessions.find((s) => s.path === sessionPath);
503
- this.enterRenameMode(sessionPath, session?.name);
504
- };
505
- // Sync list events to header
506
- this.sessionList.onTogglePath = (showPath) => {
507
- this.header.setShowPath(showPath);
508
- this.requestRender();
509
- };
510
- this.sessionList.onDeleteConfirmationChange = (path) => {
511
- this.header.setConfirmingDeletePath(path);
512
- this.requestRender();
513
- };
514
- this.sessionList.onError = (msg) => {
515
- this.header.setStatusMessage({ type: "error", message: msg }, 3000);
516
- this.requestRender();
517
- };
518
- // Handle session deletion
519
- this.sessionList.onDeleteSession = async (sessionPath) => {
520
- const result = await deleteSessionFile(sessionPath);
521
- if (result.ok) {
522
- if (this.currentSessions) {
523
- this.currentSessions = this.currentSessions.filter((s) => s.path !== sessionPath);
524
- }
525
- if (this.allSessions) {
526
- this.allSessions = this.allSessions.filter((s) => s.path !== sessionPath);
527
- }
528
- const sessions = this.scope === "all" ? (this.allSessions ?? []) : (this.currentSessions ?? []);
529
- const showCwd = this.scope === "all";
530
- this.sessionList.setSessions(sessions, showCwd);
531
- const msg = result.method === "trash" ? "Session moved to trash" : "Session deleted";
532
- this.header.setStatusMessage({ type: "info", message: msg }, 2000);
533
- await this.refreshSessionsAfterMutation();
534
- }
535
- else {
536
- const errorMessage = result.error ?? "Unknown error";
537
- this.header.setStatusMessage({ type: "error", message: `Failed to delete: ${errorMessage}` }, 3000);
538
- }
539
- this.requestRender();
540
- };
541
- // Start loading current sessions immediately
542
- this.loadCurrentSessions();
543
- }
544
- loadCurrentSessions() {
545
- void this.loadScope("current", "initial");
546
- }
547
- enterRenameMode(sessionPath, currentName) {
548
- this.mode = "rename";
549
- this.renameTargetPath = sessionPath;
550
- this.renameInput.setValue(currentName ?? "");
551
- this.renameInput.focused = true;
552
- const panel = new Container();
553
- panel.addChild(new Text(theme.bold("Rename Session"), 1, 0));
554
- panel.addChild(new Spacer(1));
555
- panel.addChild(this.renameInput);
556
- panel.addChild(new Spacer(1));
557
- panel.addChild(new Text(theme.fg("muted", "Enter to save · Esc/Ctrl+C to cancel"), 1, 0));
558
- this.buildBaseLayout(panel, { showHeader: false });
559
- this.requestRender();
560
- }
561
- exitRenameMode() {
562
- this.mode = "list";
563
- this.renameTargetPath = null;
564
- this.buildBaseLayout(this.sessionList);
565
- this.requestRender();
566
- }
567
- async confirmRename(value) {
568
- const next = value.trim();
569
- if (!next)
570
- return;
571
- const target = this.renameTargetPath;
572
- if (!target) {
573
- this.exitRenameMode();
574
- return;
575
- }
576
- // Find current name for callback
577
- const renameSession = this.renameSession;
578
- if (!renameSession) {
579
- this.exitRenameMode();
580
- return;
581
- }
582
- try {
583
- await renameSession(target, next);
584
- await this.refreshSessionsAfterMutation();
585
- }
586
- finally {
587
- this.exitRenameMode();
588
- }
589
- }
590
- async loadScope(scope, reason) {
591
- const showCwd = scope === "all";
592
- // Mark loading
593
- if (scope === "current") {
594
- this.currentLoading = true;
595
- }
596
- else {
597
- this.allLoading = true;
598
- }
599
- const seq = scope === "all" ? ++this.allLoadSeq : undefined;
600
- this.header.setScope(scope);
601
- this.header.setLoading(true);
602
- this.requestRender();
603
- const onProgress = (loaded, total) => {
604
- if (scope !== this.scope)
605
- return;
606
- if (seq !== undefined && seq !== this.allLoadSeq)
607
- return;
608
- this.header.setProgress(loaded, total);
609
- this.requestRender();
610
- };
611
- try {
612
- const sessions = await (scope === "current"
613
- ? this.currentSessionsLoader(onProgress)
614
- : this.allSessionsLoader(onProgress));
615
- if (scope === "current") {
616
- this.currentSessions = sessions;
617
- this.currentLoading = false;
618
- }
619
- else {
620
- this.allSessions = sessions;
621
- this.allLoading = false;
622
- }
623
- if (scope !== this.scope)
624
- return;
625
- if (seq !== undefined && seq !== this.allLoadSeq)
626
- return;
627
- this.header.setLoading(false);
628
- this.sessionList.setSessions(sessions, showCwd);
629
- this.requestRender();
630
- if (scope === "all" && sessions.length === 0 && (this.currentSessions?.length ?? 0) === 0) {
631
- this.onCancel();
632
- }
633
- }
634
- catch (err) {
635
- if (scope === "current") {
636
- this.currentLoading = false;
637
- }
638
- else {
639
- this.allLoading = false;
640
- }
641
- if (scope !== this.scope)
642
- return;
643
- if (seq !== undefined && seq !== this.allLoadSeq)
644
- return;
645
- const message = err instanceof Error ? err.message : String(err);
646
- this.header.setLoading(false);
647
- this.header.setStatusMessage({ type: "error", message: `Failed to load sessions: ${message}` }, 4000);
648
- if (reason === "initial") {
649
- this.sessionList.setSessions([], showCwd);
650
- }
651
- this.requestRender();
652
- }
653
- }
654
- toggleSortMode() {
655
- this.sortMode = this.sortMode === "recent" ? "relevance" : "recent";
656
- this.header.setSortMode(this.sortMode);
657
- this.sessionList.setSortMode(this.sortMode);
658
- this.requestRender();
659
- }
660
- async refreshSessionsAfterMutation() {
661
- await this.loadScope(this.scope, "refresh");
662
- }
663
- toggleScope() {
664
- if (this.scope === "current") {
665
- this.scope = "all";
666
- this.header.setScope(this.scope);
667
- if (this.allSessions !== null) {
668
- this.header.setLoading(false);
669
- this.sessionList.setSessions(this.allSessions, true);
670
- this.requestRender();
671
- return;
672
- }
673
- if (!this.allLoading) {
674
- void this.loadScope("all", "toggle");
675
- }
676
- return;
677
- }
678
- this.scope = "current";
679
- this.header.setScope(this.scope);
680
- this.header.setLoading(this.currentLoading);
681
- this.sessionList.setSessions(this.currentSessions ?? [], false);
682
- this.requestRender();
683
- }
684
- getSessionList() {
685
- return this.sessionList;
686
- }
687
- }
688
- //# sourceMappingURL=session-selector.js.map