@nexus-cortex/tui 4.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +2 -0
  3. package/README.md +13 -0
  4. package/bin/cli-full.js +23 -0
  5. package/bin/cortex-ui.js +26 -0
  6. package/bin/ink-ui.js +108 -0
  7. package/bin/launcher-dev.js +266 -0
  8. package/bin/launcher.js +516 -0
  9. package/dist/commands/agent/InteractiveAgentMenu.d.ts +100 -0
  10. package/dist/commands/agent/InteractiveAgentMenu.d.ts.map +1 -0
  11. package/dist/commands/agent/InteractiveAgentMenu.js +909 -0
  12. package/dist/commands/agent/InteractiveAgentMenu.js.map +1 -0
  13. package/dist/commands/agent/index.d.ts +55 -0
  14. package/dist/commands/agent/index.d.ts.map +1 -0
  15. package/dist/commands/agent/index.js +714 -0
  16. package/dist/commands/agent/index.js.map +1 -0
  17. package/dist/commands/chat/interactive.d.ts +13 -0
  18. package/dist/commands/chat/interactive.d.ts.map +1 -0
  19. package/dist/commands/chat/interactive.js +2055 -0
  20. package/dist/commands/chat/interactive.js.map +1 -0
  21. package/dist/commands/system-message/EditorLauncher.d.ts +65 -0
  22. package/dist/commands/system-message/EditorLauncher.d.ts.map +1 -0
  23. package/dist/commands/system-message/EditorLauncher.js +143 -0
  24. package/dist/commands/system-message/EditorLauncher.js.map +1 -0
  25. package/dist/commands/system-message/InlineEditor.d.ts +23 -0
  26. package/dist/commands/system-message/InlineEditor.d.ts.map +1 -0
  27. package/dist/commands/system-message/InlineEditor.js +225 -0
  28. package/dist/commands/system-message/InlineEditor.js.map +1 -0
  29. package/dist/commands/system-message/InteractiveMenu.d.ts +76 -0
  30. package/dist/commands/system-message/InteractiveMenu.d.ts.map +1 -0
  31. package/dist/commands/system-message/InteractiveMenu.js +979 -0
  32. package/dist/commands/system-message/InteractiveMenu.js.map +1 -0
  33. package/dist/commands/system-message/index.d.ts +56 -0
  34. package/dist/commands/system-message/index.d.ts.map +1 -0
  35. package/dist/commands/system-message/index.js +694 -0
  36. package/dist/commands/system-message/index.js.map +1 -0
  37. package/dist/commands/ui/artifacts.d.ts +14 -0
  38. package/dist/commands/ui/artifacts.d.ts.map +1 -0
  39. package/dist/commands/ui/artifacts.js +22 -0
  40. package/dist/commands/ui/artifacts.js.map +1 -0
  41. package/dist/commands/ui/config.d.ts +12 -0
  42. package/dist/commands/ui/config.d.ts.map +1 -0
  43. package/dist/commands/ui/config.js +26 -0
  44. package/dist/commands/ui/config.js.map +1 -0
  45. package/dist/commands/ui/context.d.ts +16 -0
  46. package/dist/commands/ui/context.d.ts.map +1 -0
  47. package/dist/commands/ui/context.js +28 -0
  48. package/dist/commands/ui/context.js.map +1 -0
  49. package/dist/commands/ui/middleware.d.ts +14 -0
  50. package/dist/commands/ui/middleware.d.ts.map +1 -0
  51. package/dist/commands/ui/middleware.js +22 -0
  52. package/dist/commands/ui/middleware.js.map +1 -0
  53. package/dist/commands/ui/models.d.ts +14 -0
  54. package/dist/commands/ui/models.d.ts.map +1 -0
  55. package/dist/commands/ui/models.js +50 -0
  56. package/dist/commands/ui/models.js.map +1 -0
  57. package/dist/commands/ui/permissions.d.ts +14 -0
  58. package/dist/commands/ui/permissions.d.ts.map +1 -0
  59. package/dist/commands/ui/permissions.js +22 -0
  60. package/dist/commands/ui/permissions.js.map +1 -0
  61. package/dist/commands/ui/sessions.d.ts +13 -0
  62. package/dist/commands/ui/sessions.d.ts.map +1 -0
  63. package/dist/commands/ui/sessions.js +45 -0
  64. package/dist/commands/ui/sessions.js.map +1 -0
  65. package/dist/commands/ui/system-messages.d.ts +5 -0
  66. package/dist/commands/ui/system-messages.d.ts.map +1 -0
  67. package/dist/commands/ui/system-messages.js +19 -0
  68. package/dist/commands/ui/system-messages.js.map +1 -0
  69. package/dist/commands/ui/themes.d.ts +12 -0
  70. package/dist/commands/ui/themes.d.ts.map +1 -0
  71. package/dist/commands/ui/themes.js +40 -0
  72. package/dist/commands/ui/themes.js.map +1 -0
  73. package/dist/commands/ui/tmux.d.ts +5 -0
  74. package/dist/commands/ui/tmux.d.ts.map +1 -0
  75. package/dist/commands/ui/tmux.js +19 -0
  76. package/dist/commands/ui/tmux.js.map +1 -0
  77. package/dist/cortex.d.ts +12 -0
  78. package/dist/cortex.d.ts.map +1 -0
  79. package/dist/cortex.js +320 -0
  80. package/dist/cortex.js.map +1 -0
  81. package/dist/index.d.ts +3 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +112 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/ink-ui/CortexApp.d.ts +28 -0
  86. package/dist/ink-ui/CortexApp.d.ts.map +1 -0
  87. package/dist/ink-ui/CortexApp.js +2291 -0
  88. package/dist/ink-ui/CortexApp.js.map +1 -0
  89. package/dist/ink-ui/SimpleInputBuffer.d.ts +63 -0
  90. package/dist/ink-ui/SimpleInputBuffer.d.ts.map +1 -0
  91. package/dist/ink-ui/SimpleInputBuffer.js +369 -0
  92. package/dist/ink-ui/SimpleInputBuffer.js.map +1 -0
  93. package/dist/ink-ui/commands/slashCommands.d.ts +40 -0
  94. package/dist/ink-ui/commands/slashCommands.d.ts.map +1 -0
  95. package/dist/ink-ui/commands/slashCommands.js +111 -0
  96. package/dist/ink-ui/commands/slashCommands.js.map +1 -0
  97. package/dist/ink-ui/commands/types.d.ts +161 -0
  98. package/dist/ink-ui/commands/types.d.ts.map +1 -0
  99. package/dist/ink-ui/commands/types.js +12 -0
  100. package/dist/ink-ui/commands/types.js.map +1 -0
  101. package/dist/ink-ui/components/ApprovalDialog.d.ts +21 -0
  102. package/dist/ink-ui/components/ApprovalDialog.d.ts.map +1 -0
  103. package/dist/ink-ui/components/ApprovalDialog.js +81 -0
  104. package/dist/ink-ui/components/ApprovalDialog.js.map +1 -0
  105. package/dist/ink-ui/components/CommandSuggestions.d.ts +19 -0
  106. package/dist/ink-ui/components/CommandSuggestions.d.ts.map +1 -0
  107. package/dist/ink-ui/components/CommandSuggestions.js +36 -0
  108. package/dist/ink-ui/components/CommandSuggestions.js.map +1 -0
  109. package/dist/ink-ui/components/DiffPreview.d.ts +60 -0
  110. package/dist/ink-ui/components/DiffPreview.d.ts.map +1 -0
  111. package/dist/ink-ui/components/DiffPreview.js +195 -0
  112. package/dist/ink-ui/components/DiffPreview.js.map +1 -0
  113. package/dist/ink-ui/components/DocumentPreview.d.ts +50 -0
  114. package/dist/ink-ui/components/DocumentPreview.d.ts.map +1 -0
  115. package/dist/ink-ui/components/DocumentPreview.js +92 -0
  116. package/dist/ink-ui/components/DocumentPreview.js.map +1 -0
  117. package/dist/ink-ui/components/MarkdownText.d.ts +27 -0
  118. package/dist/ink-ui/components/MarkdownText.d.ts.map +1 -0
  119. package/dist/ink-ui/components/MarkdownText.js +342 -0
  120. package/dist/ink-ui/components/MarkdownText.js.map +1 -0
  121. package/dist/ink-ui/components/MenuRenderer.d.ts +26 -0
  122. package/dist/ink-ui/components/MenuRenderer.d.ts.map +1 -0
  123. package/dist/ink-ui/components/MenuRenderer.js +264 -0
  124. package/dist/ink-ui/components/MenuRenderer.js.map +1 -0
  125. package/dist/ink-ui/components/ModelPickerDialog.d.ts +33 -0
  126. package/dist/ink-ui/components/ModelPickerDialog.d.ts.map +1 -0
  127. package/dist/ink-ui/components/ModelPickerDialog.js +98 -0
  128. package/dist/ink-ui/components/ModelPickerDialog.js.map +1 -0
  129. package/dist/ink-ui/components/StreamDisplay.d.ts +31 -0
  130. package/dist/ink-ui/components/StreamDisplay.d.ts.map +1 -0
  131. package/dist/ink-ui/components/StreamDisplay.js +573 -0
  132. package/dist/ink-ui/components/StreamDisplay.js.map +1 -0
  133. package/dist/ink-ui/components/SubAgentPanel.d.ts +98 -0
  134. package/dist/ink-ui/components/SubAgentPanel.d.ts.map +1 -0
  135. package/dist/ink-ui/components/SubAgentPanel.js +155 -0
  136. package/dist/ink-ui/components/SubAgentPanel.js.map +1 -0
  137. package/dist/ink-ui/components/ThinkingDisplay.d.ts +46 -0
  138. package/dist/ink-ui/components/ThinkingDisplay.d.ts.map +1 -0
  139. package/dist/ink-ui/components/ThinkingDisplay.js +176 -0
  140. package/dist/ink-ui/components/ThinkingDisplay.js.map +1 -0
  141. package/dist/ink-ui/components/ToolCallDisplay.d.ts +51 -0
  142. package/dist/ink-ui/components/ToolCallDisplay.d.ts.map +1 -0
  143. package/dist/ink-ui/components/ToolCallDisplay.js +378 -0
  144. package/dist/ink-ui/components/ToolCallDisplay.js.map +1 -0
  145. package/dist/ink-ui/components/WritePreview.d.ts +42 -0
  146. package/dist/ink-ui/components/WritePreview.d.ts.map +1 -0
  147. package/dist/ink-ui/components/WritePreview.js +100 -0
  148. package/dist/ink-ui/components/WritePreview.js.map +1 -0
  149. package/dist/ink-ui/contexts/KeypressContext.d.ts +32 -0
  150. package/dist/ink-ui/contexts/KeypressContext.d.ts.map +1 -0
  151. package/dist/ink-ui/contexts/KeypressContext.js +529 -0
  152. package/dist/ink-ui/contexts/KeypressContext.js.map +1 -0
  153. package/dist/ink-ui/contexts/SessionContext.d.ts +46 -0
  154. package/dist/ink-ui/contexts/SessionContext.d.ts.map +1 -0
  155. package/dist/ink-ui/contexts/SessionContext.js +162 -0
  156. package/dist/ink-ui/contexts/SessionContext.js.map +1 -0
  157. package/dist/ink-ui/core-stubs.d.ts +270 -0
  158. package/dist/ink-ui/core-stubs.d.ts.map +1 -0
  159. package/dist/ink-ui/core-stubs.js +276 -0
  160. package/dist/ink-ui/core-stubs.js.map +1 -0
  161. package/dist/ink-ui/cortex-types.d.ts +214 -0
  162. package/dist/ink-ui/cortex-types.d.ts.map +1 -0
  163. package/dist/ink-ui/cortex-types.js +52 -0
  164. package/dist/ink-ui/cortex-types.js.map +1 -0
  165. package/dist/ink-ui/hooks/useCortexStream.d.ts +75 -0
  166. package/dist/ink-ui/hooks/useCortexStream.d.ts.map +1 -0
  167. package/dist/ink-ui/hooks/useCortexStream.js +518 -0
  168. package/dist/ink-ui/hooks/useCortexStream.js.map +1 -0
  169. package/dist/ink-ui/hooks/useFocus.d.ts +11 -0
  170. package/dist/ink-ui/hooks/useFocus.d.ts.map +1 -0
  171. package/dist/ink-ui/hooks/useFocus.js +51 -0
  172. package/dist/ink-ui/hooks/useFocus.js.map +1 -0
  173. package/dist/ink-ui/hooks/useHistoryManager.d.ts +23 -0
  174. package/dist/ink-ui/hooks/useHistoryManager.d.ts.map +1 -0
  175. package/dist/ink-ui/hooks/useHistoryManager.js +63 -0
  176. package/dist/ink-ui/hooks/useHistoryManager.js.map +1 -0
  177. package/dist/ink-ui/hooks/useKeypress.d.ts +18 -0
  178. package/dist/ink-ui/hooks/useKeypress.d.ts.map +1 -0
  179. package/dist/ink-ui/hooks/useKeypress.js +27 -0
  180. package/dist/ink-ui/hooks/useKeypress.js.map +1 -0
  181. package/dist/ink-ui/hooks/useReactApprovalHandler.d.ts +74 -0
  182. package/dist/ink-ui/hooks/useReactApprovalHandler.d.ts.map +1 -0
  183. package/dist/ink-ui/hooks/useReactApprovalHandler.js +83 -0
  184. package/dist/ink-ui/hooks/useReactApprovalHandler.js.map +1 -0
  185. package/dist/ink-ui/hooks/useTerminalSize.d.ts +10 -0
  186. package/dist/ink-ui/hooks/useTerminalSize.d.ts.map +1 -0
  187. package/dist/ink-ui/hooks/useTerminalSize.js +28 -0
  188. package/dist/ink-ui/hooks/useTerminalSize.js.map +1 -0
  189. package/dist/ink-ui/semantic-colors.d.ts +8 -0
  190. package/dist/ink-ui/semantic-colors.d.ts.map +1 -0
  191. package/dist/ink-ui/semantic-colors.js +24 -0
  192. package/dist/ink-ui/semantic-colors.js.map +1 -0
  193. package/dist/ink-ui/state/extensions.d.ts +68 -0
  194. package/dist/ink-ui/state/extensions.d.ts.map +1 -0
  195. package/dist/ink-ui/state/extensions.js +97 -0
  196. package/dist/ink-ui/state/extensions.js.map +1 -0
  197. package/dist/ink-ui/themes/ansi-light.d.ts +8 -0
  198. package/dist/ink-ui/themes/ansi-light.d.ts.map +1 -0
  199. package/dist/ink-ui/themes/ansi-light.js +143 -0
  200. package/dist/ink-ui/themes/ansi-light.js.map +1 -0
  201. package/dist/ink-ui/themes/ansi.d.ts +8 -0
  202. package/dist/ink-ui/themes/ansi.d.ts.map +1 -0
  203. package/dist/ink-ui/themes/ansi.js +153 -0
  204. package/dist/ink-ui/themes/ansi.js.map +1 -0
  205. package/dist/ink-ui/themes/atom-one-dark.d.ts +8 -0
  206. package/dist/ink-ui/themes/atom-one-dark.d.ts.map +1 -0
  207. package/dist/ink-ui/themes/atom-one-dark.js +140 -0
  208. package/dist/ink-ui/themes/atom-one-dark.js.map +1 -0
  209. package/dist/ink-ui/themes/ayu-light.d.ts +8 -0
  210. package/dist/ink-ui/themes/ayu-light.d.ts.map +1 -0
  211. package/dist/ink-ui/themes/ayu-light.js +132 -0
  212. package/dist/ink-ui/themes/ayu-light.js.map +1 -0
  213. package/dist/ink-ui/themes/ayu.d.ts +8 -0
  214. package/dist/ink-ui/themes/ayu.d.ts.map +1 -0
  215. package/dist/ink-ui/themes/ayu.js +106 -0
  216. package/dist/ink-ui/themes/ayu.js.map +1 -0
  217. package/dist/ink-ui/themes/color-utils.d.ts +23 -0
  218. package/dist/ink-ui/themes/color-utils.d.ts.map +1 -0
  219. package/dist/ink-ui/themes/color-utils.js +237 -0
  220. package/dist/ink-ui/themes/color-utils.js.map +1 -0
  221. package/dist/ink-ui/themes/default-light.d.ts +8 -0
  222. package/dist/ink-ui/themes/default-light.d.ts.map +1 -0
  223. package/dist/ink-ui/themes/default-light.js +100 -0
  224. package/dist/ink-ui/themes/default-light.js.map +1 -0
  225. package/dist/ink-ui/themes/default.d.ts +8 -0
  226. package/dist/ink-ui/themes/default.d.ts.map +1 -0
  227. package/dist/ink-ui/themes/default.js +143 -0
  228. package/dist/ink-ui/themes/default.js.map +1 -0
  229. package/dist/ink-ui/themes/dracula.d.ts +8 -0
  230. package/dist/ink-ui/themes/dracula.d.ts.map +1 -0
  231. package/dist/ink-ui/themes/dracula.js +117 -0
  232. package/dist/ink-ui/themes/dracula.js.map +1 -0
  233. package/dist/ink-ui/themes/github-dark.d.ts +8 -0
  234. package/dist/ink-ui/themes/github-dark.d.ts.map +1 -0
  235. package/dist/ink-ui/themes/github-dark.js +140 -0
  236. package/dist/ink-ui/themes/github-dark.js.map +1 -0
  237. package/dist/ink-ui/themes/github-light.d.ts +8 -0
  238. package/dist/ink-ui/themes/github-light.d.ts.map +1 -0
  239. package/dist/ink-ui/themes/github-light.js +142 -0
  240. package/dist/ink-ui/themes/github-light.js.map +1 -0
  241. package/dist/ink-ui/themes/googlecode.d.ts +8 -0
  242. package/dist/ink-ui/themes/googlecode.d.ts.map +1 -0
  243. package/dist/ink-ui/themes/googlecode.js +139 -0
  244. package/dist/ink-ui/themes/googlecode.js.map +1 -0
  245. package/dist/ink-ui/themes/no-color.d.ts +8 -0
  246. package/dist/ink-ui/themes/no-color.d.ts.map +1 -0
  247. package/dist/ink-ui/themes/no-color.js +118 -0
  248. package/dist/ink-ui/themes/no-color.js.map +1 -0
  249. package/dist/ink-ui/themes/semantic-tokens.d.ts +40 -0
  250. package/dist/ink-ui/themes/semantic-tokens.d.ts.map +1 -0
  251. package/dist/ink-ui/themes/semantic-tokens.js +100 -0
  252. package/dist/ink-ui/themes/semantic-tokens.js.map +1 -0
  253. package/dist/ink-ui/themes/shades-of-purple.d.ts +12 -0
  254. package/dist/ink-ui/themes/shades-of-purple.d.ts.map +1 -0
  255. package/dist/ink-ui/themes/shades-of-purple.js +306 -0
  256. package/dist/ink-ui/themes/shades-of-purple.js.map +1 -0
  257. package/dist/ink-ui/themes/theme-manager.d.ts +67 -0
  258. package/dist/ink-ui/themes/theme-manager.d.ts.map +1 -0
  259. package/dist/ink-ui/themes/theme-manager.js +263 -0
  260. package/dist/ink-ui/themes/theme-manager.js.map +1 -0
  261. package/dist/ink-ui/themes/theme.d.ts +134 -0
  262. package/dist/ink-ui/themes/theme.d.ts.map +1 -0
  263. package/dist/ink-ui/themes/theme.js +390 -0
  264. package/dist/ink-ui/themes/theme.js.map +1 -0
  265. package/dist/ink-ui/themes/xcode.d.ts +8 -0
  266. package/dist/ink-ui/themes/xcode.d.ts.map +1 -0
  267. package/dist/ink-ui/themes/xcode.js +147 -0
  268. package/dist/ink-ui/themes/xcode.js.map +1 -0
  269. package/dist/ink-ui/types.d.ts +306 -0
  270. package/dist/ink-ui/types.d.ts.map +1 -0
  271. package/dist/ink-ui/types.js +65 -0
  272. package/dist/ink-ui/types.js.map +1 -0
  273. package/dist/ink-ui/utils/input.d.ts +18 -0
  274. package/dist/ink-ui/utils/input.d.ts.map +1 -0
  275. package/dist/ink-ui/utils/input.js +51 -0
  276. package/dist/ink-ui/utils/input.js.map +1 -0
  277. package/dist/ink-ui/utils/mouse.d.ts +33 -0
  278. package/dist/ink-ui/utils/mouse.d.ts.map +1 -0
  279. package/dist/ink-ui/utils/mouse.js +182 -0
  280. package/dist/ink-ui/utils/mouse.js.map +1 -0
  281. package/dist/services/BuiltinCommandLoader.d.ts +21 -0
  282. package/dist/services/BuiltinCommandLoader.d.ts.map +1 -0
  283. package/dist/services/BuiltinCommandLoader.js +182 -0
  284. package/dist/services/BuiltinCommandLoader.js.map +1 -0
  285. package/dist/services/CommandService.d.ts +39 -0
  286. package/dist/services/CommandService.d.ts.map +1 -0
  287. package/dist/services/CommandService.js +49 -0
  288. package/dist/services/CommandService.js.map +1 -0
  289. package/dist/services/FileCommandLoader.d.ts +16 -0
  290. package/dist/services/FileCommandLoader.d.ts.map +1 -0
  291. package/dist/services/FileCommandLoader.js +19 -0
  292. package/dist/services/FileCommandLoader.js.map +1 -0
  293. package/dist/services/McpPromptLoader.d.ts +16 -0
  294. package/dist/services/McpPromptLoader.d.ts.map +1 -0
  295. package/dist/services/McpPromptLoader.js +19 -0
  296. package/dist/services/McpPromptLoader.js.map +1 -0
  297. package/dist/services/index.d.ts +8 -0
  298. package/dist/services/index.d.ts.map +1 -0
  299. package/dist/services/index.js +8 -0
  300. package/dist/services/index.js.map +1 -0
  301. package/dist/ui/ChalkMenuRenderer.d.ts +22 -0
  302. package/dist/ui/ChalkMenuRenderer.d.ts.map +1 -0
  303. package/dist/ui/ChalkMenuRenderer.js +478 -0
  304. package/dist/ui/ChalkMenuRenderer.js.map +1 -0
  305. package/dist/ui/ChalkModelPicker.d.ts +20 -0
  306. package/dist/ui/ChalkModelPicker.d.ts.map +1 -0
  307. package/dist/ui/ChalkModelPicker.js +363 -0
  308. package/dist/ui/ChalkModelPicker.js.map +1 -0
  309. package/dist/ui/ChalkThemePicker.d.ts +20 -0
  310. package/dist/ui/ChalkThemePicker.d.ts.map +1 -0
  311. package/dist/ui/ChalkThemePicker.js +370 -0
  312. package/dist/ui/ChalkThemePicker.js.map +1 -0
  313. package/dist/ui/InkApprovalDialog.d.ts +8 -0
  314. package/dist/ui/InkApprovalDialog.d.ts.map +1 -0
  315. package/dist/ui/InkApprovalDialog.js +25 -0
  316. package/dist/ui/InkApprovalDialog.js.map +1 -0
  317. package/dist/ui/InkCommandPalette.d.ts +43 -0
  318. package/dist/ui/InkCommandPalette.d.ts.map +1 -0
  319. package/dist/ui/InkCommandPalette.js +105 -0
  320. package/dist/ui/InkCommandPalette.js.map +1 -0
  321. package/dist/ui/InkConfigMenu.d.ts +24 -0
  322. package/dist/ui/InkConfigMenu.d.ts.map +1 -0
  323. package/dist/ui/InkConfigMenu.js +259 -0
  324. package/dist/ui/InkConfigMenu.js.map +1 -0
  325. package/dist/ui/InkHelp.d.ts +25 -0
  326. package/dist/ui/InkHelp.d.ts.map +1 -0
  327. package/dist/ui/InkHelp.js +55 -0
  328. package/dist/ui/InkHelp.js.map +1 -0
  329. package/dist/ui/InkMenuPicker.d.ts +19 -0
  330. package/dist/ui/InkMenuPicker.d.ts.map +1 -0
  331. package/dist/ui/InkMenuPicker.js +33 -0
  332. package/dist/ui/InkMenuPicker.js.map +1 -0
  333. package/dist/ui/InkModelPicker.d.ts +23 -0
  334. package/dist/ui/InkModelPicker.d.ts.map +1 -0
  335. package/dist/ui/InkModelPicker.js +53 -0
  336. package/dist/ui/InkModelPicker.js.map +1 -0
  337. package/dist/ui/PersistentInput.d.ts +91 -0
  338. package/dist/ui/PersistentInput.d.ts.map +1 -0
  339. package/dist/ui/PersistentInput.js +283 -0
  340. package/dist/ui/PersistentInput.js.map +1 -0
  341. package/dist/ui/RawInput.d.ts +27 -0
  342. package/dist/ui/RawInput.d.ts.map +1 -0
  343. package/dist/ui/RawInput.js +731 -0
  344. package/dist/ui/RawInput.js.map +1 -0
  345. package/dist/ui/SlashCommandAutocomplete.d.ts +94 -0
  346. package/dist/ui/SlashCommandAutocomplete.d.ts.map +1 -0
  347. package/dist/ui/SlashCommandAutocomplete.js +274 -0
  348. package/dist/ui/SlashCommandAutocomplete.js.map +1 -0
  349. package/dist/ui/SplashScreen.d.ts +76 -0
  350. package/dist/ui/SplashScreen.d.ts.map +1 -0
  351. package/dist/ui/SplashScreen.js +316 -0
  352. package/dist/ui/SplashScreen.js.map +1 -0
  353. package/dist/ui/components/ArtifactDashboard.d.ts +16 -0
  354. package/dist/ui/components/ArtifactDashboard.d.ts.map +1 -0
  355. package/dist/ui/components/ArtifactDashboard.js +102 -0
  356. package/dist/ui/components/ArtifactDashboard.js.map +1 -0
  357. package/dist/ui/components/ChatInput.d.ts +36 -0
  358. package/dist/ui/components/ChatInput.d.ts.map +1 -0
  359. package/dist/ui/components/ChatInput.js +11 -0
  360. package/dist/ui/components/ChatInput.js.map +1 -0
  361. package/dist/ui/components/ConfigWizard.d.ts +17 -0
  362. package/dist/ui/components/ConfigWizard.d.ts.map +1 -0
  363. package/dist/ui/components/ConfigWizard.js +134 -0
  364. package/dist/ui/components/ConfigWizard.js.map +1 -0
  365. package/dist/ui/components/ContextViewer.d.ts +18 -0
  366. package/dist/ui/components/ContextViewer.d.ts.map +1 -0
  367. package/dist/ui/components/ContextViewer.js +85 -0
  368. package/dist/ui/components/ContextViewer.js.map +1 -0
  369. package/dist/ui/components/MiddlewareDashboard.d.ts +16 -0
  370. package/dist/ui/components/MiddlewareDashboard.d.ts.map +1 -0
  371. package/dist/ui/components/MiddlewareDashboard.js +98 -0
  372. package/dist/ui/components/MiddlewareDashboard.js.map +1 -0
  373. package/dist/ui/components/ModelPicker.d.ts +24 -0
  374. package/dist/ui/components/ModelPicker.d.ts.map +1 -0
  375. package/dist/ui/components/ModelPicker.js +96 -0
  376. package/dist/ui/components/ModelPicker.js.map +1 -0
  377. package/dist/ui/components/MultiLineInput.d.ts +27 -0
  378. package/dist/ui/components/MultiLineInput.d.ts.map +1 -0
  379. package/dist/ui/components/MultiLineInput.js +182 -0
  380. package/dist/ui/components/MultiLineInput.js.map +1 -0
  381. package/dist/ui/components/PermissionsBrowser.d.ts +16 -0
  382. package/dist/ui/components/PermissionsBrowser.d.ts.map +1 -0
  383. package/dist/ui/components/PermissionsBrowser.js +110 -0
  384. package/dist/ui/components/PermissionsBrowser.js.map +1 -0
  385. package/dist/ui/components/SessionBrowser.d.ts +19 -0
  386. package/dist/ui/components/SessionBrowser.d.ts.map +1 -0
  387. package/dist/ui/components/SessionBrowser.js +66 -0
  388. package/dist/ui/components/SessionBrowser.js.map +1 -0
  389. package/dist/ui/components/StatusBar.d.ts +32 -0
  390. package/dist/ui/components/StatusBar.d.ts.map +1 -0
  391. package/dist/ui/components/StatusBar.js +27 -0
  392. package/dist/ui/components/StatusBar.js.map +1 -0
  393. package/dist/ui/components/SystemMessageBrowser.d.ts +11 -0
  394. package/dist/ui/components/SystemMessageBrowser.d.ts.map +1 -0
  395. package/dist/ui/components/SystemMessageBrowser.js +106 -0
  396. package/dist/ui/components/SystemMessageBrowser.js.map +1 -0
  397. package/dist/ui/components/ThemePicker.d.ts +11 -0
  398. package/dist/ui/components/ThemePicker.d.ts.map +1 -0
  399. package/dist/ui/components/ThemePicker.js +62 -0
  400. package/dist/ui/components/ThemePicker.js.map +1 -0
  401. package/dist/ui/components/TmuxBrowser.d.ts +11 -0
  402. package/dist/ui/components/TmuxBrowser.d.ts.map +1 -0
  403. package/dist/ui/components/TmuxBrowser.js +85 -0
  404. package/dist/ui/components/TmuxBrowser.js.map +1 -0
  405. package/dist/ui/components/index.d.ts +22 -0
  406. package/dist/ui/components/index.d.ts.map +1 -0
  407. package/dist/ui/components/index.js +21 -0
  408. package/dist/ui/components/index.js.map +1 -0
  409. package/package.json +70 -0
package/dist/cortex.js ADDED
@@ -0,0 +1,320 @@
1
+ #!/usr/bin/env node
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Cortex - Ink-based Terminal UI for Nexus Cortex
5
+ *
6
+ * A modern, React-based terminal interface with:
7
+ * - Multi-line input that grows
8
+ * - Status bar showing current state
9
+ * - Streaming response display
10
+ * - Mouse support (future)
11
+ */
12
+ import React, { useState, useEffect, useCallback } from 'react';
13
+ import { render, Box, Text, Static, useApp, useInput } from 'ink';
14
+ import { OrchestratorClient } from '@nexus-cortex/cli/dist/orchestrator/OrchestratorClient.js';
15
+ import { ChatInput } from './ui/components/ChatInput.js';
16
+ import { ThemeManager } from '@nexus-cortex/cli/dist/themes/ThemeManager.js';
17
+ // Get theme
18
+ const theme = ThemeManager.getExtendedTheme();
19
+ // Header component
20
+ const Header = ({ model }) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { children: theme.dimmed('─'.repeat(60)) }), _jsxs(Text, { children: [theme.colors.primary(' Cortex'), theme.dimmed(' │ '), theme.colors.highlight(model)] }), _jsx(Text, { children: theme.dimmed('─'.repeat(60)) }), _jsx(Text, { children: theme.dimmed(' Tab: thinking │ Shift+Tab: auto-approve │ /help │ ESC: abort') }), _jsx(Text, { children: theme.dimmed('─'.repeat(60)) })] }));
21
+ // Message component
22
+ const MessageItem = ({ message }) => {
23
+ const isUser = message.role === 'user';
24
+ const prefix = isUser ? theme.colors.info('> ') : theme.colors.success('◆ ');
25
+ return (_jsx(Box, { flexDirection: "column", marginY: 0, children: _jsxs(Text, { children: [prefix, isUser ? theme.text(message.content) : message.content] }) }));
26
+ };
27
+ // Streaming content component
28
+ const StreamingContent = ({ content }) => {
29
+ if (!content)
30
+ return null;
31
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [theme.colors.success('◆ '), content] }), _jsxs(Text, { children: [theme.colors.info('●'), " ", theme.dimmed('streaming...')] })] }));
32
+ };
33
+ // Error display
34
+ const ErrorDisplay = ({ error }) => (_jsx(Box, { marginY: 1, children: _jsxs(Text, { children: [theme.colors.error('✗ Error: '), error] }) }));
35
+ // Main App
36
+ const CortexApp = () => {
37
+ const { exit } = useApp();
38
+ const [state, setState] = useState({
39
+ messages: [],
40
+ streaming: false,
41
+ streamingContent: '',
42
+ autoApprove: false,
43
+ showThinking: false,
44
+ debug: process.env.DEBUG === 'true',
45
+ model: process.env.DEFAULT_MODEL_ID || 'default',
46
+ error: null,
47
+ });
48
+ const [client, setClient] = useState(null);
49
+ const [initialized, setInitialized] = useState(false);
50
+ // Initialize client
51
+ useEffect(() => {
52
+ const init = async () => {
53
+ try {
54
+ const mode = process.env.CORTEX_MODE || 'direct';
55
+ const serverUrl = process.env.CORTEX_SERVER_URL;
56
+ const orchestratorClient = new OrchestratorClient({
57
+ mode: mode,
58
+ serverUrl,
59
+ defaultModelId: state.model,
60
+ projectPath: process.cwd(),
61
+ debug: state.debug,
62
+ });
63
+ await orchestratorClient.initialize();
64
+ setClient(orchestratorClient);
65
+ setInitialized(true);
66
+ }
67
+ catch (err) {
68
+ setState(s => ({
69
+ ...s,
70
+ error: err instanceof Error ? err.message : 'Failed to initialize',
71
+ }));
72
+ }
73
+ };
74
+ init();
75
+ }, []);
76
+ // Handle keyboard shortcuts
77
+ useInput((input, key) => {
78
+ // Tab - toggle thinking
79
+ if (key.tab && !key.shift) {
80
+ setState(s => ({ ...s, showThinking: !s.showThinking }));
81
+ return;
82
+ }
83
+ // Shift+Tab - toggle auto-approve
84
+ if (key.tab && key.shift) {
85
+ setState(s => ({ ...s, autoApprove: !s.autoApprove }));
86
+ return;
87
+ }
88
+ // Escape - abort streaming (future: implement abort)
89
+ if (key.escape && state.streaming) {
90
+ // TODO: Implement abort
91
+ return;
92
+ }
93
+ // Ctrl+C - exit
94
+ if (key.ctrl && input === 'c') {
95
+ exit();
96
+ return;
97
+ }
98
+ });
99
+ // Use ref for streaming state to avoid stale closure
100
+ const streamingRef = React.useRef(state.streaming);
101
+ streamingRef.current = state.streaming;
102
+ // Handle message submission
103
+ const handleSubmit = useCallback(async (text) => {
104
+ if (!client || streamingRef.current)
105
+ return;
106
+ const trimmed = text.trim();
107
+ if (!trimmed)
108
+ return;
109
+ // Handle slash commands
110
+ if (trimmed.startsWith('/')) {
111
+ const cmd = trimmed.slice(1).toLowerCase();
112
+ if (cmd === 'exit' || cmd === 'quit' || cmd === 'q') {
113
+ exit();
114
+ return;
115
+ }
116
+ if (cmd === 'clear') {
117
+ setState(s => ({ ...s, messages: [], error: null }));
118
+ return;
119
+ }
120
+ if (cmd === 'help') {
121
+ setState(s => ({
122
+ ...s,
123
+ messages: [
124
+ ...s.messages,
125
+ {
126
+ id: `help-${Date.now()}`,
127
+ role: 'system',
128
+ content: `Commands:
129
+ /help - Show this help
130
+ /clear - Clear messages
131
+ /exit - Exit Cortex
132
+ /model - Show current model
133
+ /yolo - Toggle auto-approve
134
+ /debug - Toggle debug logging
135
+
136
+ Shortcuts:
137
+ Tab - Toggle thinking display
138
+ Shift+Tab - Toggle auto-approve
139
+ Ctrl+C - Exit`,
140
+ timestamp: new Date(),
141
+ },
142
+ ],
143
+ }));
144
+ return;
145
+ }
146
+ if (cmd === 'model') {
147
+ setState(s => ({
148
+ ...s,
149
+ messages: [
150
+ ...s.messages,
151
+ {
152
+ id: `model-${Date.now()}`,
153
+ role: 'system',
154
+ content: `Current model: ${s.model}`,
155
+ timestamp: new Date(),
156
+ },
157
+ ],
158
+ }));
159
+ return;
160
+ }
161
+ if (cmd === 'yolo') {
162
+ setState(s => ({
163
+ ...s,
164
+ autoApprove: !s.autoApprove,
165
+ messages: [
166
+ ...s.messages,
167
+ {
168
+ id: `yolo-${Date.now()}`,
169
+ role: 'system',
170
+ content: `Auto-approve: ${!s.autoApprove ? 'ON' : 'OFF'}`,
171
+ timestamp: new Date(),
172
+ },
173
+ ],
174
+ }));
175
+ return;
176
+ }
177
+ if (cmd === 'debug') {
178
+ setState(s => ({
179
+ ...s,
180
+ debug: !s.debug,
181
+ messages: [
182
+ ...s.messages,
183
+ {
184
+ id: `debug-${Date.now()}`,
185
+ role: 'system',
186
+ content: `Debug: ${!s.debug ? 'ON' : 'OFF'}`,
187
+ timestamp: new Date(),
188
+ },
189
+ ],
190
+ }));
191
+ return;
192
+ }
193
+ // Unknown command
194
+ setState(s => ({
195
+ ...s,
196
+ error: `Unknown command: ${cmd}`,
197
+ }));
198
+ return;
199
+ }
200
+ // Add user message
201
+ const userMessage = {
202
+ id: `user-${Date.now()}`,
203
+ role: 'user',
204
+ content: trimmed,
205
+ timestamp: new Date(),
206
+ };
207
+ setState(s => ({
208
+ ...s,
209
+ messages: [...s.messages, userMessage],
210
+ streaming: true,
211
+ streamingContent: '',
212
+ error: null,
213
+ }));
214
+ try {
215
+ // Send message and collect response using streaming
216
+ let fullResponse = '';
217
+ let currentToolInfo = '';
218
+ // Use the async generator streamMessage API
219
+ for await (const chunk of client.streamMessage(trimmed, {})) {
220
+ // Debug: log all chunk types
221
+ if (state.debug) {
222
+ console.log('[Cortex] Chunk:', chunk.type, 'delta:', chunk.delta?.substring(0, 50) || '(none)');
223
+ }
224
+ // Handle text deltas (main content type)
225
+ if (chunk.type === 'text_delta' && chunk.delta) {
226
+ fullResponse += chunk.delta;
227
+ setState(s => ({
228
+ ...s,
229
+ streamingContent: fullResponse + currentToolInfo,
230
+ }));
231
+ }
232
+ // Handle thinking deltas (Gemini, Claude extended thinking)
233
+ else if (chunk.type === 'thinking_delta' && chunk.delta && state.showThinking) {
234
+ // Show thinking with a prefix
235
+ fullResponse += chunk.delta;
236
+ setState(s => ({
237
+ ...s,
238
+ streamingContent: fullResponse + currentToolInfo,
239
+ }));
240
+ }
241
+ // Handle content_block_delta with reasoning flag (Claude/Grok native thinking)
242
+ else if (chunk.type === 'content_block_delta') {
243
+ const data = chunk.data;
244
+ if (data?.reasoning === true && state.showThinking && chunk.delta) {
245
+ fullResponse += chunk.delta;
246
+ setState(s => ({
247
+ ...s,
248
+ streamingContent: fullResponse + currentToolInfo,
249
+ }));
250
+ }
251
+ else if (!data?.reasoning && chunk.delta) {
252
+ // Regular content block delta
253
+ fullResponse += chunk.delta;
254
+ setState(s => ({
255
+ ...s,
256
+ streamingContent: fullResponse + currentToolInfo,
257
+ }));
258
+ }
259
+ }
260
+ // Handle tool use blocks
261
+ else if (chunk.type === 'tool_use_complete') {
262
+ const toolData = chunk.data;
263
+ const toolName = toolData?.name || 'tool';
264
+ currentToolInfo = `\n Using: ${toolName}...`;
265
+ setState(s => ({
266
+ ...s,
267
+ streamingContent: fullResponse + currentToolInfo,
268
+ }));
269
+ }
270
+ // Handle tool results
271
+ else if (chunk.type === 'tool_result') {
272
+ const resultData = chunk.data;
273
+ const isError = resultData?.is_error;
274
+ currentToolInfo = isError ? '\n[ERROR] Tool error' : '\n✓ Tool completed';
275
+ setState(s => ({
276
+ ...s,
277
+ streamingContent: fullResponse + currentToolInfo,
278
+ }));
279
+ // Clear tool info after a moment (it will be replaced by next text)
280
+ currentToolInfo = '';
281
+ }
282
+ }
283
+ // Add assistant message (without tool info)
284
+ const assistantMessage = {
285
+ id: `assistant-${Date.now()}`,
286
+ role: 'assistant',
287
+ content: fullResponse,
288
+ timestamp: new Date(),
289
+ };
290
+ setState(s => ({
291
+ ...s,
292
+ messages: [...s.messages, assistantMessage],
293
+ streaming: false,
294
+ streamingContent: '',
295
+ }));
296
+ }
297
+ catch (err) {
298
+ setState(s => ({
299
+ ...s,
300
+ streaming: false,
301
+ streamingContent: '',
302
+ error: err instanceof Error ? err.message : 'Request failed',
303
+ }));
304
+ }
305
+ }, [client, exit]);
306
+ // Loading state
307
+ if (!initialized) {
308
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Header, { model: state.model }), _jsxs(Text, { children: [theme.colors.info('●'), " ", theme.dimmed('Initializing...')] })] }));
309
+ }
310
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Header, { model: state.model }), _jsx(Static, { items: state.messages, children: (message) => _jsx(MessageItem, { message: message }, message.id) }), state.streaming && _jsx(StreamingContent, { content: state.streamingContent }), state.error && _jsx(ErrorDisplay, { error: state.error }), _jsx(Box, { marginTop: 1, children: _jsx(ChatInput, { onSubmit: handleSubmit, model: state.model, autoApprove: state.autoApprove, showThinking: state.showThinking, debug: state.debug, streaming: state.streaming, focus: !state.streaming, theme: {
311
+ primary: theme.colors.primary,
312
+ dimmed: theme.dimmed,
313
+ success: theme.colors.success,
314
+ warning: theme.colors.warning,
315
+ info: theme.colors.info,
316
+ } }) })] }));
317
+ };
318
+ // Render the app
319
+ render(_jsx(CortexApp, {}));
320
+ //# sourceMappingURL=cortex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cortex.js","sourceRoot":"","sources":["../src/cortex.tsx"],"names":[],"mappings":";;AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAqB7E,YAAY;AACZ,MAAM,KAAK,GAAG,YAAY,CAAC,gBAAgB,EAAE,CAAC;AAE9C,mBAAmB;AACnB,MAAM,MAAM,GAAgC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACzD,MAAC,GAAG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AAG,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @nexus-cortex/tui — the full interactive Commander CLI (what `fuzzycortex-cli`
4
+ * launches, via bin/cli-full.js → this dist/index.js, exactly as the pre-split
5
+ * cli index.ts did).
6
+ *
7
+ * - default `chat` command → the CHALK interactiveChat REPL (CHIP_ART /about splash)
8
+ * - `ui …` → the interactive terminal browsers (Ink/chalk)
9
+ * - any other subcommand → delegated to the headless @nexus-cortex/cli Commander
10
+ * (autoresearch, models, sessions, message, mcp, config, …)
11
+ */
12
+ import { Command } from 'commander';
13
+ import { spawnSync } from 'child_process';
14
+ import { createRequire } from 'module';
15
+ import { interactiveChat } from './commands/chat/interactive.js';
16
+ import { uiSessions } from './commands/ui/sessions.js';
17
+ import { uiModels } from './commands/ui/models.js';
18
+ import { uiThemes } from './commands/ui/themes.js';
19
+ import { uiConfig } from './commands/ui/config.js';
20
+ import { uiPermissions } from './commands/ui/permissions.js';
21
+ import { uiArtifacts } from './commands/ui/artifacts.js';
22
+ import { uiMiddleware } from './commands/ui/middleware.js';
23
+ import { uiContext } from './commands/ui/context.js';
24
+ import { tmuxBrowser } from './commands/ui/tmux.js';
25
+ import { systemMessageBrowser } from './commands/ui/system-messages.js';
26
+ // Headless subcommands live in @nexus-cortex/cli — delegate them there verbatim.
27
+ const HEADLESS = new Set([
28
+ 'message', 'models', 'session', 'sessions', 'mcp', 'config', 'permissions',
29
+ 'context', 'tools', 'middleware', 'artifact', 'cache', 'system-messages', 'tmux',
30
+ 'server', 'autoresearch', 'history', 'stats', 'limits', 'debug', 'helper',
31
+ 'mentorship', 'retry', 'dashboard', 'templates', 'sandbox',
32
+ ]);
33
+ const argv = process.argv.slice(2);
34
+ const firstPositional = argv.find((a) => !a.startsWith('-'));
35
+ if (firstPositional && HEADLESS.has(firstPositional)) {
36
+ const require = createRequire(import.meta.url);
37
+ const cliEntry = require.resolve('@nexus-cortex/cli/dist/index.js');
38
+ const r = spawnSync(process.execPath, [cliEntry, ...argv], { stdio: 'inherit' });
39
+ process.exit(r.status ?? 0);
40
+ }
41
+ const program = new Command();
42
+ program
43
+ .name('cortex')
44
+ .description('Nexus Cortex - Multi-provider LLM CLI (interactive)')
45
+ .version('4.0.0');
46
+ program
47
+ .option('--server <url>', 'Server URL', 'http://localhost:4000')
48
+ .option('--debug', 'Enable debug logging')
49
+ .option('--json', 'Output JSON format')
50
+ .option('--no-color', 'Disable colored output');
51
+ // Chat command (default) — the CHALK interactive REPL
52
+ program
53
+ .command('chat', { isDefault: true })
54
+ .description('Start interactive chat (default command)')
55
+ .option('-m, --model <id>', 'Model ID to use')
56
+ .option('--system <message>', 'System message')
57
+ .option('--max-tokens <number>', 'Maximum tokens', parseInt)
58
+ .option('--temperature <number>', 'Temperature (0-2)', parseFloat)
59
+ .action(async (options) => {
60
+ const g = program.opts();
61
+ await interactiveChat({
62
+ serverUrl: g.server,
63
+ model: options.model,
64
+ system: options.system,
65
+ maxTokens: options.maxTokens,
66
+ temperature: options.temperature,
67
+ });
68
+ });
69
+ // UI commands (interactive terminal browsers)
70
+ const ui = program.command('ui').description('Interactive terminal UIs');
71
+ ui.command('sessions').description('Browse sessions interactively').action(async () => {
72
+ const g = program.opts();
73
+ await uiSessions({ serverUrl: g.server, json: g.json });
74
+ });
75
+ ui.command('models').description('Browse and select models interactively').option('--current <model>', 'Current model ID').action(async (o) => {
76
+ const g = program.opts();
77
+ await uiModels({ serverUrl: g.server, json: g.json, current: o.current });
78
+ });
79
+ ui.command('themes').description('Browse and select themes interactively').action(async () => {
80
+ const g = program.opts();
81
+ await uiThemes({ json: g.json });
82
+ });
83
+ ui.command('config').description('Interactive configuration wizard').action(async () => {
84
+ const g = program.opts();
85
+ await uiConfig({ json: g.json });
86
+ });
87
+ ui.command('permissions').description('Browse permissions, policies, and tool access').action(async () => {
88
+ const g = program.opts();
89
+ await uiPermissions({ serverUrl: g.server, json: g.json });
90
+ });
91
+ ui.command('artifacts').description('View and manage running artifacts').action(async () => {
92
+ const g = program.opts();
93
+ await uiArtifacts({ serverUrl: g.server, json: g.json });
94
+ });
95
+ ui.command('middleware').description('View and configure middleware systems').action(async () => {
96
+ const g = program.opts();
97
+ await uiMiddleware({ serverUrl: g.server, json: g.json });
98
+ });
99
+ ui.command('context').description('View context budget and compaction history').option('--session-id <id>', 'Session ID to view context for').action(async (o) => {
100
+ const g = program.opts();
101
+ await uiContext({ sessionId: o.sessionId, serverUrl: g.server, json: g.json });
102
+ });
103
+ ui.command('tmux').description('Browse and manage tmux sessions').action(async () => {
104
+ const g = program.opts();
105
+ await tmuxBrowser({ serverUrl: g.server });
106
+ });
107
+ ui.command('system-messages').description('Browse available system messages').action(async () => {
108
+ const g = program.opts();
109
+ await systemMessageBrowser({ serverUrl: g.server });
110
+ });
111
+ program.parse();
112
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,E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,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3G,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iCAAiC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;IAClF,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAAC,MAAM,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;IAC9F,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAAC,MAAM,oBAAoB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Nexus Cortex - Main Application Component
3
+ *
4
+ * This is the entry point for the Ink-based UI, adapted from Gemini CLI
5
+ * but wired to our @nexus-cortex/core orchestrator.
6
+ *
7
+ * Architecture:
8
+ * - CortexApp (this file) - Application shell and state management
9
+ * - useCortexStream - Bridge hook to orchestrator
10
+ * - Gemini UI components - Rendering (DiffRenderer, InputPrompt, etc.)
11
+ */
12
+ import React from 'react';
13
+ /**
14
+ * App configuration passed from entry point
15
+ */
16
+ export interface CortexAppProps {
17
+ modelId?: string;
18
+ debug?: boolean;
19
+ projectPath?: string;
20
+ autoApprove?: boolean;
21
+ initialPrompt?: string;
22
+ }
23
+ /**
24
+ * Main Cortex Application
25
+ */
26
+ export declare const CortexApp: React.FC<CortexAppProps>;
27
+ export default CortexApp;
28
+ //# sourceMappingURL=CortexApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CortexApp.d.ts","sourceRoot":"","sources":["../../src/ink-ui/CortexApp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAMN,MAAM,OAAO,CAAC;AA2Df;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA62CD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkvD9C,CAAC;AAEF,eAAe,SAAS,CAAC"}