@nex-ai/nex 0.1.65 → 0.2.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 (529) hide show
  1. package/README.md +236 -231
  2. package/bin/nex-mcp.js +50 -0
  3. package/bin/nex.js +53 -0
  4. package/package.json +9 -36
  5. package/dist/agent/adoption.d.ts +0 -23
  6. package/dist/agent/adoption.js +0 -87
  7. package/dist/agent/adoption.js.map +0 -1
  8. package/dist/agent/gossip.d.ts +0 -17
  9. package/dist/agent/gossip.js +0 -48
  10. package/dist/agent/gossip.js.map +0 -1
  11. package/dist/agent/loop.d.ts +0 -59
  12. package/dist/agent/loop.js +0 -389
  13. package/dist/agent/loop.js.map +0 -1
  14. package/dist/agent/queues.d.ts +0 -16
  15. package/dist/agent/queues.js +0 -44
  16. package/dist/agent/queues.js.map +0 -1
  17. package/dist/agent/session-store.d.ts +0 -21
  18. package/dist/agent/session-store.js +0 -96
  19. package/dist/agent/session-store.js.map +0 -1
  20. package/dist/agent/templates.d.ts +0 -5
  21. package/dist/agent/templates.js +0 -55
  22. package/dist/agent/templates.js.map +0 -1
  23. package/dist/agent/tools.d.ts +0 -25
  24. package/dist/agent/tools.js +0 -238
  25. package/dist/agent/tools.js.map +0 -1
  26. package/dist/agent/types.d.ts +0 -59
  27. package/dist/agent/types.js +0 -5
  28. package/dist/agent/types.js.map +0 -1
  29. package/dist/calendar/scheduler.d.ts +0 -32
  30. package/dist/calendar/scheduler.js +0 -178
  31. package/dist/calendar/scheduler.js.map +0 -1
  32. package/dist/calendar/store.d.ts +0 -15
  33. package/dist/calendar/store.js +0 -50
  34. package/dist/calendar/store.js.map +0 -1
  35. package/dist/calendar/types.d.ts +0 -17
  36. package/dist/calendar/types.js +0 -5
  37. package/dist/calendar/types.js.map +0 -1
  38. package/dist/chat/channel.d.ts +0 -20
  39. package/dist/chat/channel.js +0 -84
  40. package/dist/chat/channel.js.map +0 -1
  41. package/dist/chat/message-store.d.ts +0 -18
  42. package/dist/chat/message-store.js +0 -82
  43. package/dist/chat/message-store.js.map +0 -1
  44. package/dist/chat/router.d.ts +0 -17
  45. package/dist/chat/router.js +0 -65
  46. package/dist/chat/router.js.map +0 -1
  47. package/dist/chat/suggested-responses.d.ts +0 -6
  48. package/dist/chat/suggested-responses.js +0 -99
  49. package/dist/chat/suggested-responses.js.map +0 -1
  50. package/dist/chat/types.d.ts +0 -28
  51. package/dist/chat/types.js +0 -5
  52. package/dist/chat/types.js.map +0 -1
  53. package/dist/cli.d.ts +0 -5
  54. package/dist/cli.js +0 -20
  55. package/dist/cli.js.map +0 -1
  56. package/dist/commands/attribute.d.ts +0 -4
  57. package/dist/commands/attribute.js +0 -75
  58. package/dist/commands/attribute.js.map +0 -1
  59. package/dist/commands/config-cmd.d.ts +0 -4
  60. package/dist/commands/config-cmd.js +0 -53
  61. package/dist/commands/config-cmd.js.map +0 -1
  62. package/dist/commands/context.d.ts +0 -4
  63. package/dist/commands/context.js +0 -167
  64. package/dist/commands/context.js.map +0 -1
  65. package/dist/commands/dispatch.d.ts +0 -44
  66. package/dist/commands/dispatch.js +0 -1544
  67. package/dist/commands/dispatch.js.map +0 -1
  68. package/dist/commands/graph.d.ts +0 -5
  69. package/dist/commands/graph.js +0 -77
  70. package/dist/commands/graph.js.map +0 -1
  71. package/dist/commands/init.d.ts +0 -49
  72. package/dist/commands/init.js +0 -319
  73. package/dist/commands/init.js.map +0 -1
  74. package/dist/commands/insight.d.ts +0 -4
  75. package/dist/commands/insight.js +0 -39
  76. package/dist/commands/insight.js.map +0 -1
  77. package/dist/commands/integrate.d.ts +0 -4
  78. package/dist/commands/integrate.js +0 -361
  79. package/dist/commands/integrate.js.map +0 -1
  80. package/dist/commands/list-job.d.ts +0 -4
  81. package/dist/commands/list-job.js +0 -41
  82. package/dist/commands/list-job.js.map +0 -1
  83. package/dist/commands/list.d.ts +0 -4
  84. package/dist/commands/list.js +0 -148
  85. package/dist/commands/list.js.map +0 -1
  86. package/dist/commands/note.d.ts +0 -4
  87. package/dist/commands/note.js +0 -77
  88. package/dist/commands/note.js.map +0 -1
  89. package/dist/commands/object.d.ts +0 -4
  90. package/dist/commands/object.js +0 -78
  91. package/dist/commands/object.js.map +0 -1
  92. package/dist/commands/parse-input.d.ts +0 -5
  93. package/dist/commands/parse-input.js +0 -37
  94. package/dist/commands/parse-input.js.map +0 -1
  95. package/dist/commands/record.d.ts +0 -4
  96. package/dist/commands/record.js +0 -126
  97. package/dist/commands/record.js.map +0 -1
  98. package/dist/commands/register.d.ts +0 -4
  99. package/dist/commands/register.js +0 -23
  100. package/dist/commands/register.js.map +0 -1
  101. package/dist/commands/relationship.d.ts +0 -4
  102. package/dist/commands/relationship.js +0 -80
  103. package/dist/commands/relationship.js.map +0 -1
  104. package/dist/commands/scan.d.ts +0 -4
  105. package/dist/commands/scan.js +0 -111
  106. package/dist/commands/scan.js.map +0 -1
  107. package/dist/commands/search.d.ts +0 -4
  108. package/dist/commands/search.js +0 -62
  109. package/dist/commands/search.js.map +0 -1
  110. package/dist/commands/session.d.ts +0 -4
  111. package/dist/commands/session.js +0 -31
  112. package/dist/commands/session.js.map +0 -1
  113. package/dist/commands/setup.d.ts +0 -25
  114. package/dist/commands/setup.js +0 -584
  115. package/dist/commands/setup.js.map +0 -1
  116. package/dist/commands/task.d.ts +0 -4
  117. package/dist/commands/task.js +0 -140
  118. package/dist/commands/task.js.map +0 -1
  119. package/dist/commands/workspace.d.ts +0 -8
  120. package/dist/commands/workspace.js +0 -251
  121. package/dist/commands/workspace.js.map +0 -1
  122. package/dist/index.d.ts +0 -9
  123. package/dist/index.js +0 -142
  124. package/dist/index.js.map +0 -1
  125. package/dist/lib/capture-filter.d.ts +0 -9
  126. package/dist/lib/capture-filter.js +0 -14
  127. package/dist/lib/capture-filter.js.map +0 -1
  128. package/dist/lib/client.d.ts +0 -20
  129. package/dist/lib/client.js +0 -160
  130. package/dist/lib/client.js.map +0 -1
  131. package/dist/lib/compounding-worker.d.ts +0 -2
  132. package/dist/lib/compounding-worker.js +0 -21
  133. package/dist/lib/compounding-worker.js.map +0 -1
  134. package/dist/lib/compounding.d.ts +0 -20
  135. package/dist/lib/compounding.js +0 -45
  136. package/dist/lib/compounding.js.map +0 -1
  137. package/dist/lib/config.d.ts +0 -35
  138. package/dist/lib/config.js +0 -96
  139. package/dist/lib/config.js.map +0 -1
  140. package/dist/lib/context-format.d.ts +0 -7
  141. package/dist/lib/context-format.js +0 -21
  142. package/dist/lib/context-format.js.map +0 -1
  143. package/dist/lib/errors.d.ts +0 -18
  144. package/dist/lib/errors.js +0 -30
  145. package/dist/lib/errors.js.map +0 -1
  146. package/dist/lib/file-scanner.d.ts +0 -38
  147. package/dist/lib/file-scanner.js +0 -188
  148. package/dist/lib/file-scanner.js.map +0 -1
  149. package/dist/lib/graph-html.d.ts +0 -59
  150. package/dist/lib/graph-html.js +0 -859
  151. package/dist/lib/graph-html.js.map +0 -1
  152. package/dist/lib/installers.d.ts +0 -80
  153. package/dist/lib/installers.js +0 -602
  154. package/dist/lib/installers.js.map +0 -1
  155. package/dist/lib/integrations.d.ts +0 -23
  156. package/dist/lib/integrations.js +0 -25
  157. package/dist/lib/integrations.js.map +0 -1
  158. package/dist/lib/output.d.ts +0 -7
  159. package/dist/lib/output.js +0 -70
  160. package/dist/lib/output.js.map +0 -1
  161. package/dist/lib/platform-detect.d.ts +0 -23
  162. package/dist/lib/platform-detect.js +0 -359
  163. package/dist/lib/platform-detect.js.map +0 -1
  164. package/dist/lib/project-config.d.ts +0 -53
  165. package/dist/lib/project-config.js +0 -151
  166. package/dist/lib/project-config.js.map +0 -1
  167. package/dist/lib/prompt.d.ts +0 -15
  168. package/dist/lib/prompt.js +0 -213
  169. package/dist/lib/prompt.js.map +0 -1
  170. package/dist/lib/rate-limiter.d.ts +0 -13
  171. package/dist/lib/rate-limiter.js +0 -49
  172. package/dist/lib/rate-limiter.js.map +0 -1
  173. package/dist/lib/recall-filter.d.ts +0 -5
  174. package/dist/lib/recall-filter.js +0 -24
  175. package/dist/lib/recall-filter.js.map +0 -1
  176. package/dist/lib/session-store.d.ts +0 -15
  177. package/dist/lib/session-store.js +0 -62
  178. package/dist/lib/session-store.js.map +0 -1
  179. package/dist/lib/tui.d.ts +0 -57
  180. package/dist/lib/tui.js +0 -247
  181. package/dist/lib/tui.js.map +0 -1
  182. package/dist/lib/workspace-registry.d.ts +0 -47
  183. package/dist/lib/workspace-registry.js +0 -240
  184. package/dist/lib/workspace-registry.js.map +0 -1
  185. package/dist/mcp/channel.d.ts +0 -24
  186. package/dist/mcp/channel.js +0 -198
  187. package/dist/mcp/channel.js.map +0 -1
  188. package/dist/mcp/client.d.ts +0 -20
  189. package/dist/mcp/client.js +0 -131
  190. package/dist/mcp/client.js.map +0 -1
  191. package/dist/mcp/config.d.ts +0 -19
  192. package/dist/mcp/config.js +0 -48
  193. package/dist/mcp/config.js.map +0 -1
  194. package/dist/mcp/context-files.d.ts +0 -9
  195. package/dist/mcp/context-files.js +0 -90
  196. package/dist/mcp/context-files.js.map +0 -1
  197. package/dist/mcp/file-manifest.d.ts +0 -27
  198. package/dist/mcp/file-manifest.js +0 -68
  199. package/dist/mcp/file-manifest.js.map +0 -1
  200. package/dist/mcp/file-scanner.d.ts +0 -17
  201. package/dist/mcp/file-scanner.js +0 -77
  202. package/dist/mcp/file-scanner.js.map +0 -1
  203. package/dist/mcp/index.d.ts +0 -2
  204. package/dist/mcp/index.js +0 -51
  205. package/dist/mcp/index.js.map +0 -1
  206. package/dist/mcp/rate-limiter.d.ts +0 -14
  207. package/dist/mcp/rate-limiter.js +0 -60
  208. package/dist/mcp/rate-limiter.js.map +0 -1
  209. package/dist/mcp/server.d.ts +0 -6
  210. package/dist/mcp/server.js +0 -44
  211. package/dist/mcp/server.js.map +0 -1
  212. package/dist/mcp/session-store.d.ts +0 -16
  213. package/dist/mcp/session-store.js +0 -70
  214. package/dist/mcp/session-store.js.map +0 -1
  215. package/dist/mcp/tools/context.d.ts +0 -3
  216. package/dist/mcp/tools/context.js +0 -65
  217. package/dist/mcp/tools/context.js.map +0 -1
  218. package/dist/mcp/tools/insights.d.ts +0 -3
  219. package/dist/mcp/tools/insights.js +0 -24
  220. package/dist/mcp/tools/insights.js.map +0 -1
  221. package/dist/mcp/tools/integrations.d.ts +0 -3
  222. package/dist/mcp/tools/integrations.js +0 -27
  223. package/dist/mcp/tools/integrations.js.map +0 -1
  224. package/dist/mcp/tools/lists.d.ts +0 -3
  225. package/dist/mcp/tools/lists.js +0 -101
  226. package/dist/mcp/tools/lists.js.map +0 -1
  227. package/dist/mcp/tools/notes.d.ts +0 -3
  228. package/dist/mcp/tools/notes.js +0 -52
  229. package/dist/mcp/tools/notes.js.map +0 -1
  230. package/dist/mcp/tools/notifications.d.ts +0 -3
  231. package/dist/mcp/tools/notifications.js +0 -53
  232. package/dist/mcp/tools/notifications.js.map +0 -1
  233. package/dist/mcp/tools/records.d.ts +0 -3
  234. package/dist/mcp/tools/records.js +0 -74
  235. package/dist/mcp/tools/records.js.map +0 -1
  236. package/dist/mcp/tools/register.d.ts +0 -3
  237. package/dist/mcp/tools/register.js +0 -41
  238. package/dist/mcp/tools/register.js.map +0 -1
  239. package/dist/mcp/tools/relationships.d.ts +0 -3
  240. package/dist/mcp/tools/relationships.js +0 -47
  241. package/dist/mcp/tools/relationships.js.map +0 -1
  242. package/dist/mcp/tools/scan.d.ts +0 -3
  243. package/dist/mcp/tools/scan.js +0 -37
  244. package/dist/mcp/tools/scan.js.map +0 -1
  245. package/dist/mcp/tools/schema.d.ts +0 -3
  246. package/dist/mcp/tools/schema.js +0 -108
  247. package/dist/mcp/tools/schema.js.map +0 -1
  248. package/dist/mcp/tools/search.d.ts +0 -3
  249. package/dist/mcp/tools/search.js +0 -8
  250. package/dist/mcp/tools/search.js.map +0 -1
  251. package/dist/mcp/tools/tasks.d.ts +0 -3
  252. package/dist/mcp/tools/tasks.js +0 -88
  253. package/dist/mcp/tools/tasks.js.map +0 -1
  254. package/dist/mcp/workspace-data-dir.d.ts +0 -2
  255. package/dist/mcp/workspace-data-dir.js +0 -28
  256. package/dist/mcp/workspace-data-dir.js.map +0 -1
  257. package/dist/orchestration/budget.d.ts +0 -32
  258. package/dist/orchestration/budget.js +0 -72
  259. package/dist/orchestration/budget.js.map +0 -1
  260. package/dist/orchestration/executor.d.ts +0 -59
  261. package/dist/orchestration/executor.js +0 -197
  262. package/dist/orchestration/executor.js.map +0 -1
  263. package/dist/orchestration/router.d.ts +0 -30
  264. package/dist/orchestration/router.js +0 -98
  265. package/dist/orchestration/router.js.map +0 -1
  266. package/dist/orchestration/templates.d.ts +0 -11
  267. package/dist/orchestration/templates.js +0 -99
  268. package/dist/orchestration/templates.js.map +0 -1
  269. package/dist/orchestration/types.d.ts +0 -58
  270. package/dist/orchestration/types.js +0 -7
  271. package/dist/orchestration/types.js.map +0 -1
  272. package/dist/plugin/auto-capture.d.ts +0 -11
  273. package/dist/plugin/auto-capture.js +0 -135
  274. package/dist/plugin/auto-capture.js.map +0 -1
  275. package/dist/plugin/auto-recall-worker.d.ts +0 -2
  276. package/dist/plugin/auto-recall-worker.js +0 -74
  277. package/dist/plugin/auto-recall-worker.js.map +0 -1
  278. package/dist/plugin/auto-recall.d.ts +0 -11
  279. package/dist/plugin/auto-recall.js +0 -186
  280. package/dist/plugin/auto-recall.js.map +0 -1
  281. package/dist/plugin/auto-register.d.ts +0 -10
  282. package/dist/plugin/auto-register.js +0 -81
  283. package/dist/plugin/auto-register.js.map +0 -1
  284. package/dist/plugin/auto-scan.d.ts +0 -10
  285. package/dist/plugin/auto-scan.js +0 -54
  286. package/dist/plugin/auto-scan.js.map +0 -1
  287. package/dist/plugin/auto-session-start.d.ts +0 -14
  288. package/dist/plugin/auto-session-start.js +0 -156
  289. package/dist/plugin/auto-session-start.js.map +0 -1
  290. package/dist/plugin/capture-filter.d.ts +0 -21
  291. package/dist/plugin/capture-filter.js +0 -32
  292. package/dist/plugin/capture-filter.js.map +0 -1
  293. package/dist/plugin/config.d.ts +0 -61
  294. package/dist/plugin/config.js +0 -182
  295. package/dist/plugin/config.js.map +0 -1
  296. package/dist/plugin/context-files.d.ts +0 -23
  297. package/dist/plugin/context-files.js +0 -103
  298. package/dist/plugin/context-files.js.map +0 -1
  299. package/dist/plugin/context-format.d.ts +0 -18
  300. package/dist/plugin/context-format.js +0 -34
  301. package/dist/plugin/context-format.js.map +0 -1
  302. package/dist/plugin/file-manifest.d.ts +0 -27
  303. package/dist/plugin/file-manifest.js +0 -68
  304. package/dist/plugin/file-manifest.js.map +0 -1
  305. package/dist/plugin/file-scanner.d.ts +0 -19
  306. package/dist/plugin/file-scanner.js +0 -90
  307. package/dist/plugin/file-scanner.js.map +0 -1
  308. package/dist/plugin/nex-client.d.ts +0 -50
  309. package/dist/plugin/nex-client.js +0 -129
  310. package/dist/plugin/nex-client.js.map +0 -1
  311. package/dist/plugin/rate-limiter.d.ts +0 -26
  312. package/dist/plugin/rate-limiter.js +0 -65
  313. package/dist/plugin/rate-limiter.js.map +0 -1
  314. package/dist/plugin/recall-cache.d.ts +0 -41
  315. package/dist/plugin/recall-cache.js +0 -195
  316. package/dist/plugin/recall-cache.js.map +0 -1
  317. package/dist/plugin/recall-filter.d.ts +0 -13
  318. package/dist/plugin/recall-filter.js +0 -39
  319. package/dist/plugin/recall-filter.js.map +0 -1
  320. package/dist/plugin/session-store.d.ts +0 -23
  321. package/dist/plugin/session-store.js +0 -73
  322. package/dist/plugin/session-store.js.map +0 -1
  323. package/dist/plugin/workspace-data-dir.d.ts +0 -2
  324. package/dist/plugin/workspace-data-dir.js +0 -31
  325. package/dist/plugin/workspace-data-dir.js.map +0 -1
  326. package/dist/tui/agent-colors.d.ts +0 -19
  327. package/dist/tui/agent-colors.js +0 -34
  328. package/dist/tui/agent-colors.js.map +0 -1
  329. package/dist/tui/app.d.ts +0 -14
  330. package/dist/tui/app.js +0 -181
  331. package/dist/tui/app.js.map +0 -1
  332. package/dist/tui/channel-colors.d.ts +0 -16
  333. package/dist/tui/channel-colors.js +0 -43
  334. package/dist/tui/channel-colors.js.map +0 -1
  335. package/dist/tui/components/agent-card.d.ts +0 -11
  336. package/dist/tui/components/agent-card.js +0 -40
  337. package/dist/tui/components/agent-card.js.map +0 -1
  338. package/dist/tui/components/banner.d.ts +0 -44
  339. package/dist/tui/components/banner.js +0 -130
  340. package/dist/tui/components/banner.js.map +0 -1
  341. package/dist/tui/components/channel-colors.d.ts +0 -21
  342. package/dist/tui/components/channel-colors.js +0 -53
  343. package/dist/tui/components/channel-colors.js.map +0 -1
  344. package/dist/tui/components/channel-message.d.ts +0 -53
  345. package/dist/tui/components/channel-message.js +0 -66
  346. package/dist/tui/components/channel-message.js.map +0 -1
  347. package/dist/tui/components/chat-input.d.ts +0 -11
  348. package/dist/tui/components/chat-input.js +0 -19
  349. package/dist/tui/components/chat-input.js.map +0 -1
  350. package/dist/tui/components/data-table.d.ts +0 -11
  351. package/dist/tui/components/data-table.js +0 -47
  352. package/dist/tui/components/data-table.js.map +0 -1
  353. package/dist/tui/components/error-box.d.ts +0 -11
  354. package/dist/tui/components/error-box.js +0 -59
  355. package/dist/tui/components/error-box.js.map +0 -1
  356. package/dist/tui/components/help-screen.d.ts +0 -3
  357. package/dist/tui/components/help-screen.js +0 -63
  358. package/dist/tui/components/help-screen.js.map +0 -1
  359. package/dist/tui/components/index.d.ts +0 -17
  360. package/dist/tui/components/index.js +0 -10
  361. package/dist/tui/components/index.js.map +0 -1
  362. package/dist/tui/components/inline-confirm.d.ts +0 -14
  363. package/dist/tui/components/inline-confirm.js +0 -13
  364. package/dist/tui/components/inline-confirm.js.map +0 -1
  365. package/dist/tui/components/inline-select.d.ts +0 -21
  366. package/dist/tui/components/inline-select.js +0 -20
  367. package/dist/tui/components/inline-select.js.map +0 -1
  368. package/dist/tui/components/markdown.d.ts +0 -6
  369. package/dist/tui/components/markdown.js +0 -179
  370. package/dist/tui/components/markdown.js.map +0 -1
  371. package/dist/tui/components/mention-autocomplete.d.ts +0 -79
  372. package/dist/tui/components/mention-autocomplete.js +0 -250
  373. package/dist/tui/components/mention-autocomplete.js.map +0 -1
  374. package/dist/tui/components/message-list.d.ts +0 -18
  375. package/dist/tui/components/message-list.js +0 -29
  376. package/dist/tui/components/message-list.js.map +0 -1
  377. package/dist/tui/components/picker.d.ts +0 -16
  378. package/dist/tui/components/picker.js +0 -32
  379. package/dist/tui/components/picker.js.map +0 -1
  380. package/dist/tui/components/progress-steps.d.ts +0 -13
  381. package/dist/tui/components/progress-steps.js +0 -21
  382. package/dist/tui/components/progress-steps.js.map +0 -1
  383. package/dist/tui/components/slack/compose.d.ts +0 -27
  384. package/dist/tui/components/slack/compose.js +0 -147
  385. package/dist/tui/components/slack/compose.js.map +0 -1
  386. package/dist/tui/components/slack/layout.d.ts +0 -36
  387. package/dist/tui/components/slack/layout.js +0 -96
  388. package/dist/tui/components/slack/layout.js.map +0 -1
  389. package/dist/tui/components/slack/messages.d.ts +0 -72
  390. package/dist/tui/components/slack/messages.js +0 -177
  391. package/dist/tui/components/slack/messages.js.map +0 -1
  392. package/dist/tui/components/slack/quick-switcher.d.ts +0 -33
  393. package/dist/tui/components/slack/quick-switcher.js +0 -98
  394. package/dist/tui/components/slack/quick-switcher.js.map +0 -1
  395. package/dist/tui/components/slack/sidebar-types.d.ts +0 -65
  396. package/dist/tui/components/slack/sidebar-types.js +0 -7
  397. package/dist/tui/components/slack/sidebar-types.js.map +0 -1
  398. package/dist/tui/components/slack/sidebar.d.ts +0 -46
  399. package/dist/tui/components/slack/sidebar.js +0 -52
  400. package/dist/tui/components/slack/sidebar.js.map +0 -1
  401. package/dist/tui/components/slack/thread-panel.d.ts +0 -45
  402. package/dist/tui/components/slack/thread-panel.js +0 -47
  403. package/dist/tui/components/slack/thread-panel.js.map +0 -1
  404. package/dist/tui/components/slash-autocomplete.d.ts +0 -83
  405. package/dist/tui/components/slash-autocomplete.js +0 -233
  406. package/dist/tui/components/slash-autocomplete.js.map +0 -1
  407. package/dist/tui/components/spinner.d.ts +0 -17
  408. package/dist/tui/components/spinner.js +0 -30
  409. package/dist/tui/components/spinner.js.map +0 -1
  410. package/dist/tui/components/status-bar.d.ts +0 -23
  411. package/dist/tui/components/status-bar.js +0 -55
  412. package/dist/tui/components/status-bar.js.map +0 -1
  413. package/dist/tui/components/success-box.d.ts +0 -7
  414. package/dist/tui/components/success-box.js +0 -10
  415. package/dist/tui/components/success-box.js.map +0 -1
  416. package/dist/tui/components/tool-indicator.d.ts +0 -12
  417. package/dist/tui/components/tool-indicator.js +0 -18
  418. package/dist/tui/components/tool-indicator.js.map +0 -1
  419. package/dist/tui/components/viewport.d.ts +0 -9
  420. package/dist/tui/components/viewport.js +0 -24
  421. package/dist/tui/components/viewport.js.map +0 -1
  422. package/dist/tui/generative/bindings.d.ts +0 -27
  423. package/dist/tui/generative/bindings.js +0 -152
  424. package/dist/tui/generative/bindings.js.map +0 -1
  425. package/dist/tui/generative/registry.d.ts +0 -19
  426. package/dist/tui/generative/registry.js +0 -31
  427. package/dist/tui/generative/registry.js.map +0 -1
  428. package/dist/tui/generative/renderer.d.ts +0 -24
  429. package/dist/tui/generative/renderer.js +0 -160
  430. package/dist/tui/generative/renderer.js.map +0 -1
  431. package/dist/tui/generative/types.d.ts +0 -68
  432. package/dist/tui/generative/types.js +0 -7
  433. package/dist/tui/generative/types.js.map +0 -1
  434. package/dist/tui/hooks/use-cancellable.d.ts +0 -28
  435. package/dist/tui/hooks/use-cancellable.js +0 -51
  436. package/dist/tui/hooks/use-cancellable.js.map +0 -1
  437. package/dist/tui/hooks/use-streaming.d.ts +0 -44
  438. package/dist/tui/hooks/use-streaming.js +0 -105
  439. package/dist/tui/hooks/use-streaming.js.map +0 -1
  440. package/dist/tui/index.d.ts +0 -4
  441. package/dist/tui/index.js +0 -7
  442. package/dist/tui/index.js.map +0 -1
  443. package/dist/tui/keybindings.d.ts +0 -25
  444. package/dist/tui/keybindings.js +0 -277
  445. package/dist/tui/keybindings.js.map +0 -1
  446. package/dist/tui/register-views.d.ts +0 -8
  447. package/dist/tui/register-views.js +0 -122
  448. package/dist/tui/register-views.js.map +0 -1
  449. package/dist/tui/router.d.ts +0 -29
  450. package/dist/tui/router.js +0 -87
  451. package/dist/tui/router.js.map +0 -1
  452. package/dist/tui/services/agent-service.d.ts +0 -58
  453. package/dist/tui/services/agent-service.js +0 -197
  454. package/dist/tui/services/agent-service.js.map +0 -1
  455. package/dist/tui/services/calendar-service.d.ts +0 -31
  456. package/dist/tui/services/calendar-service.js +0 -133
  457. package/dist/tui/services/calendar-service.js.map +0 -1
  458. package/dist/tui/services/chat-service.d.ts +0 -28
  459. package/dist/tui/services/chat-service.js +0 -91
  460. package/dist/tui/services/chat-service.js.map +0 -1
  461. package/dist/tui/services/orchestration-service.d.ts +0 -42
  462. package/dist/tui/services/orchestration-service.js +0 -153
  463. package/dist/tui/services/orchestration-service.js.map +0 -1
  464. package/dist/tui/slash-commands.d.ts +0 -106
  465. package/dist/tui/slash-commands.js +0 -1421
  466. package/dist/tui/slash-commands.js.map +0 -1
  467. package/dist/tui/store.d.ts +0 -96
  468. package/dist/tui/store.js +0 -120
  469. package/dist/tui/store.js.map +0 -1
  470. package/dist/tui/theme.d.ts +0 -40
  471. package/dist/tui/theme.js +0 -39
  472. package/dist/tui/theme.js.map +0 -1
  473. package/dist/tui/tui-context.d.ts +0 -22
  474. package/dist/tui/tui-context.js +0 -17
  475. package/dist/tui/tui-context.js.map +0 -1
  476. package/dist/tui/views/agent-list.d.ts +0 -8
  477. package/dist/tui/views/agent-list.js +0 -11
  478. package/dist/tui/views/agent-list.js.map +0 -1
  479. package/dist/tui/views/ask-chat.d.ts +0 -9
  480. package/dist/tui/views/ask-chat.js +0 -40
  481. package/dist/tui/views/ask-chat.js.map +0 -1
  482. package/dist/tui/views/calendar.d.ts +0 -15
  483. package/dist/tui/views/calendar.js +0 -29
  484. package/dist/tui/views/calendar.js.map +0 -1
  485. package/dist/tui/views/chat.d.ts +0 -18
  486. package/dist/tui/views/chat.js +0 -28
  487. package/dist/tui/views/chat.js.map +0 -1
  488. package/dist/tui/views/generative.d.ts +0 -14
  489. package/dist/tui/views/generative.js +0 -37
  490. package/dist/tui/views/generative.js.map +0 -1
  491. package/dist/tui/views/help.d.ts +0 -6
  492. package/dist/tui/views/help.js +0 -9
  493. package/dist/tui/views/help.js.map +0 -1
  494. package/dist/tui/views/home-screen.d.ts +0 -67
  495. package/dist/tui/views/home-screen.js +0 -192
  496. package/dist/tui/views/home-screen.js.map +0 -1
  497. package/dist/tui/views/home.d.ts +0 -33
  498. package/dist/tui/views/home.js +0 -60
  499. package/dist/tui/views/home.js.map +0 -1
  500. package/dist/tui/views/index.d.ts +0 -20
  501. package/dist/tui/views/index.js +0 -11
  502. package/dist/tui/views/index.js.map +0 -1
  503. package/dist/tui/views/insights.d.ts +0 -19
  504. package/dist/tui/views/insights.js +0 -46
  505. package/dist/tui/views/insights.js.map +0 -1
  506. package/dist/tui/views/orchestration.d.ts +0 -18
  507. package/dist/tui/views/orchestration.js +0 -73
  508. package/dist/tui/views/orchestration.js.map +0 -1
  509. package/dist/tui/views/record-detail.d.ts +0 -10
  510. package/dist/tui/views/record-detail.js +0 -22
  511. package/dist/tui/views/record-detail.js.map +0 -1
  512. package/dist/tui/views/record-list.d.ts +0 -15
  513. package/dist/tui/views/record-list.js +0 -22
  514. package/dist/tui/views/record-list.js.map +0 -1
  515. package/dist/tui/views/slack-channel-header.d.ts +0 -15
  516. package/dist/tui/views/slack-channel-header.js +0 -16
  517. package/dist/tui/views/slack-channel-header.js.map +0 -1
  518. package/dist/tui/views/slack-home.d.ts +0 -21
  519. package/dist/tui/views/slack-home.js +0 -572
  520. package/dist/tui/views/slack-home.js.map +0 -1
  521. package/dist/tui/views/stream.d.ts +0 -16
  522. package/dist/tui/views/stream.js +0 -210
  523. package/dist/tui/views/stream.js.map +0 -1
  524. package/dist/tui/views/task-board.d.ts +0 -21
  525. package/dist/tui/views/task-board.js +0 -33
  526. package/dist/tui/views/task-board.js.map +0 -1
  527. package/dist/tui/views/timeline.d.ts +0 -17
  528. package/dist/tui/views/timeline.js +0 -24
  529. package/dist/tui/views/timeline.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-html.js","sourceRoot":"","sources":["../../src/lib/graph-html.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8DH,MAAM,WAAW,GAA2B;IAC1C,MAAM,EAAE,SAAS,EAAM,WAAW;IAClC,OAAO,EAAE,SAAS,EAAK,WAAW;IAClC,IAAI,EAAE,SAAS,EAAQ,YAAY;IACnC,IAAI,EAAE,SAAS,EAAQ,UAAU;IACjC,OAAO,EAAE,SAAS,EAAK,WAAW;IAClC,WAAW,EAAE,SAAS,EAAE,aAAa;IACrC,IAAI,EAAE,SAAS,EAAQ,cAAc;IACrC,IAAI,EAAE,SAAS,EAAQ,WAAW;IAClC,KAAK,EAAE,SAAS,EAAO,aAAa;IACpC,KAAK,EAAE,SAAS,EAAO,WAAW;IAClC,OAAO,EAAE,SAAS,EAAK,aAAa;IACpC,OAAO,EAAE,SAAS,EAAK,aAAa;IACpC,KAAK,EAAE,SAAS,EAAO,aAAa;IACpC,cAAc,EAAE,SAAS,EAAG,WAAW;IACvC,iBAAiB,EAAE,SAAS,EAAE,WAAW;CAC1C,CAAC;AACF,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG;SACP,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAa;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAe;IAC/C,MAAM,UAAU,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAElE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAE/C,uBAAuB;IACvB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC;QACnD,aAAa,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IACrD,CAAC;IACD,aAAa,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IAEnD,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC;IAErE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCS,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,sBAAsB,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,yBAAyB,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;;EAExK,WAAW;SACV,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,uEAAuE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,YAAY,UAAU,CAAC,CAAC,CAAC,QAAQ,CACrJ;SACA,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;kDAgBqC,iBAAiB,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4uBjE,CAAC;AACT,CAAC"}
@@ -1,80 +0,0 @@
1
- /**
2
- * Platform-specific installers for Nex MCP server, hooks, plugins, agents, and workflows.
3
- *
4
- * Installation hierarchy (per platform):
5
- * 1. Hooks (event-driven scripts)
6
- * 2. Custom tools/plugins (OpenCode plugin, OpenClaw plugin)
7
- * 3. Custom agents/modes (VS Code agent, Kilo Code mode)
8
- * 4. Workflows/slash commands (Windsurf workflows)
9
- * 5. Rules (instruction files)
10
- * 6. MCP (tool protocol)
11
- */
12
- import type { Platform } from "./platform-detect.js";
13
- export declare function installMcpServer(platform: Platform, apiKey: string): {
14
- installed: boolean;
15
- configPath: string;
16
- };
17
- export declare function installClaudeCodePlugin(): {
18
- installed: boolean;
19
- hooksAdded: string[];
20
- commandsCopied: string[];
21
- };
22
- /**
23
- * Install hook scripts for platforms that support event-driven hooks.
24
- * Each platform has its own adapter scripts in dist/plugin/adapters/.
25
- */
26
- export declare function installHooks(platform: Platform): {
27
- installed: boolean;
28
- hooksAdded: string[];
29
- };
30
- /**
31
- * Install OpenCode plugin template to .opencode/plugins/nex.ts.
32
- */
33
- export declare function installOpenCodePlugin(): {
34
- installed: boolean;
35
- pluginPath: string;
36
- };
37
- /**
38
- * Install OpenClaw plugin via CLI.
39
- */
40
- export declare function installOpenClawPlugin(apiKey: string): {
41
- installed: boolean;
42
- message: string;
43
- };
44
- /**
45
- * Install VS Code custom agent (.github/agents/nex.agent.md).
46
- */
47
- export declare function installVSCodeAgent(): {
48
- installed: boolean;
49
- agentPath: string;
50
- };
51
- /**
52
- * Install Kilo Code custom mode (.kilocodemodes YAML).
53
- */
54
- export declare function installKiloCodeMode(): {
55
- installed: boolean;
56
- modePath: string;
57
- };
58
- /**
59
- * Install Continue.dev context provider template.
60
- */
61
- export declare function installContinueProvider(): {
62
- installed: boolean;
63
- providerPath: string;
64
- };
65
- /**
66
- * Install Windsurf workflow files (slash commands).
67
- */
68
- export declare function installWindsurfWorkflows(): {
69
- installed: boolean;
70
- workflowCount: number;
71
- };
72
- export declare function installRulesFile(platform: Platform): {
73
- installed: boolean;
74
- rulesPath: string;
75
- };
76
- /**
77
- * Persist API key to the canonical config file (~/.nex/config.json).
78
- * Name kept as syncApiKeyToMcpConfig for backward compatibility with callers.
79
- */
80
- export declare function syncApiKeyToMcpConfig(apiKey: string): void;
@@ -1,602 +0,0 @@
1
- /**
2
- * Platform-specific installers for Nex MCP server, hooks, plugins, agents, and workflows.
3
- *
4
- * Installation hierarchy (per platform):
5
- * 1. Hooks (event-driven scripts)
6
- * 2. Custom tools/plugins (OpenCode plugin, OpenClaw plugin)
7
- * 3. Custom agents/modes (VS Code agent, Kilo Code mode)
8
- * 4. Workflows/slash commands (Windsurf workflows)
9
- * 5. Rules (instruction files)
10
- * 6. MCP (tool protocol)
11
- */
12
- import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, unlinkSync, copyFileSync } from "node:fs";
13
- import { join, dirname } from "node:path";
14
- import { homedir } from "node:os";
15
- import { fileURLToPath } from "node:url";
16
- import { execFileSync } from "node:child_process";
17
- const __filename = fileURLToPath(import.meta.url);
18
- const __dirname = dirname(__filename);
19
- const MCP_SERVER_ENTRY = {
20
- command: "nex-mcp",
21
- env: {},
22
- };
23
- // ── Shared helpers ──────────────────────────────────────────────────────
24
- function readJsonFile(path) {
25
- try {
26
- const raw = readFileSync(path, "utf-8");
27
- return JSON.parse(raw);
28
- }
29
- catch {
30
- return {};
31
- }
32
- }
33
- function writeJsonFile(path, data) {
34
- mkdirSync(dirname(path), { recursive: true });
35
- writeFileSync(path, JSON.stringify(data, null, 2) + "\n", "utf-8");
36
- }
37
- /**
38
- * Resolve bundled plugin paths.
39
- * From dist/lib/installers.js:
40
- * __dirname = <pkg>/dist/lib/
41
- * dist/plugin/ = __dirname/../plugin/
42
- * plugin-commands/ = __dirname/../../plugin-commands/
43
- * platform-plugins/ = __dirname/../../platform-plugins/
44
- * platform-rules/ = __dirname/../../platform-rules/
45
- */
46
- function getPluginDistDir() {
47
- return join(__dirname, "..", "plugin");
48
- }
49
- function getPluginCommandsDir() {
50
- return join(__dirname, "..", "..", "plugin-commands");
51
- }
52
- function getPluginRulesDir() {
53
- return join(__dirname, "..", "..", "platform-rules");
54
- }
55
- function getPlatformPluginsDir() {
56
- return join(__dirname, "..", "..", "platform-plugins");
57
- }
58
- // ── 1. Generic MCP Installer ───────────────────────────────────────────
59
- export function installMcpServer(platform, apiKey) {
60
- if (!platform.configPath) {
61
- return { installed: false, configPath: "" };
62
- }
63
- const entry = {
64
- ...MCP_SERVER_ENTRY,
65
- env: { NEX_API_KEY: apiKey },
66
- };
67
- if (platform.configFormat === "zed") {
68
- return installZedMcp(platform.configPath, entry);
69
- }
70
- if (platform.configFormat === "continue") {
71
- return installContinueMcp(platform.configPath, apiKey);
72
- }
73
- if (platform.configFormat === "codex") {
74
- return installCodexMcp(platform.configPath, apiKey);
75
- }
76
- // Standard JSON format (Cursor, Claude Desktop, VS Code, Windsurf, Cline, Kilo Code, OpenCode)
77
- const config = readJsonFile(platform.configPath);
78
- if (!config.mcpServers || typeof config.mcpServers !== "object") {
79
- config.mcpServers = {};
80
- }
81
- config.mcpServers.nex = entry;
82
- writeJsonFile(platform.configPath, config);
83
- return { installed: true, configPath: platform.configPath };
84
- }
85
- function installZedMcp(configPath, entry) {
86
- const config = readJsonFile(configPath);
87
- if (!config.context_servers || typeof config.context_servers !== "object") {
88
- config.context_servers = {};
89
- }
90
- config.context_servers.nex = {
91
- command: { path: entry.command, env: entry.env },
92
- };
93
- writeJsonFile(configPath, config);
94
- return { installed: true, configPath };
95
- }
96
- function installContinueMcp(configPath, apiKey) {
97
- const mcpPath = configPath.replace("config.yaml", "mcp.json");
98
- const config = readJsonFile(mcpPath);
99
- if (!config.mcpServers || typeof config.mcpServers !== "object") {
100
- config.mcpServers = {};
101
- }
102
- config.mcpServers.nex = {
103
- ...MCP_SERVER_ENTRY,
104
- env: { NEX_API_KEY: apiKey },
105
- };
106
- writeJsonFile(mcpPath, config);
107
- return { installed: true, configPath: mcpPath };
108
- }
109
- function installCodexMcp(configPath, apiKey) {
110
- let content = "";
111
- try {
112
- content = readFileSync(configPath, "utf-8");
113
- }
114
- catch {
115
- // File doesn't exist — will create
116
- }
117
- const nexBlock = [
118
- `[mcp_servers.nex]`,
119
- `command = "nex-mcp"`,
120
- ``,
121
- `[mcp_servers.nex.env]`,
122
- `NEX_API_KEY = "${apiKey}"`,
123
- ].join("\n");
124
- if (content.includes("[mcp_servers.nex]")) {
125
- // Remove existing nex section(s) and re-add
126
- const lines = content.split("\n");
127
- const filtered = [];
128
- let inNexSection = false;
129
- for (const line of lines) {
130
- const trimmed = line.trimStart();
131
- if (trimmed.startsWith("[")) {
132
- if (trimmed.startsWith("[mcp_servers.nex]") || trimmed.startsWith("[mcp_servers.nex.")) {
133
- inNexSection = true;
134
- continue;
135
- }
136
- else {
137
- inNexSection = false;
138
- }
139
- }
140
- if (!inNexSection) {
141
- filtered.push(line);
142
- }
143
- }
144
- // Remove trailing blank lines before appending
145
- while (filtered.length > 0 && filtered[filtered.length - 1].trim() === "") {
146
- filtered.pop();
147
- }
148
- content = filtered.join("\n") + "\n\n" + nexBlock + "\n";
149
- }
150
- else {
151
- // Append to file
152
- const separator = content && !content.endsWith("\n\n")
153
- ? (content.endsWith("\n") ? "\n" : "\n\n")
154
- : "";
155
- content = content + separator + nexBlock + "\n";
156
- }
157
- mkdirSync(dirname(configPath), { recursive: true });
158
- writeFileSync(configPath, content, "utf-8");
159
- return { installed: true, configPath };
160
- }
161
- export function installClaudeCodePlugin() {
162
- const home = homedir();
163
- const claudeDir = join(home, ".claude");
164
- const settingsPath = join(claudeDir, "settings.json");
165
- const distDir = getPluginDistDir();
166
- // Verify bundled plugin exists
167
- if (!existsSync(join(distDir, "auto-recall.js"))) {
168
- return { installed: false, hooksAdded: [], commandsCopied: [] };
169
- }
170
- // 1. Read existing settings.json
171
- let settings = {};
172
- try {
173
- const raw = readFileSync(settingsPath, "utf-8");
174
- settings = JSON.parse(raw);
175
- }
176
- catch {
177
- // Start fresh
178
- }
179
- if (!settings.hooks) {
180
- settings.hooks = {};
181
- }
182
- const hooksAdded = [];
183
- // 2. Add hooks (idempotent — remove stale nex hooks, then add fresh ones)
184
- const hookDefs = [
185
- {
186
- event: "SessionStart",
187
- script: join(distDir, "auto-session-start.js"),
188
- timeout: 120000,
189
- statusMessage: "Loading knowledge context...",
190
- },
191
- {
192
- event: "UserPromptSubmit",
193
- script: join(distDir, "auto-recall.js"),
194
- timeout: 12000,
195
- statusMessage: "Recalling relevant memories...",
196
- },
197
- {
198
- event: "Stop",
199
- script: join(distDir, "auto-capture.js"),
200
- timeout: 10000,
201
- async: true,
202
- },
203
- ];
204
- for (const def of hookDefs) {
205
- if (!settings.hooks[def.event]) {
206
- settings.hooks[def.event] = [];
207
- }
208
- const groups = settings.hooks[def.event];
209
- // Remove any existing nex hook entries (handles path updates on upgrade)
210
- const filtered = groups.filter((g) => !g.hooks.some((h) => h.command.includes("auto-recall") || h.command.includes("auto-capture") || h.command.includes("auto-session-start")));
211
- const hookEntry = {
212
- type: "command",
213
- command: `node ${def.script}`,
214
- timeout: def.timeout,
215
- };
216
- if (def.statusMessage)
217
- hookEntry.statusMessage = def.statusMessage;
218
- if (def.async)
219
- hookEntry.async = true;
220
- filtered.push({ matcher: "", hooks: [hookEntry] });
221
- settings.hooks[def.event] = filtered;
222
- hooksAdded.push(def.event);
223
- }
224
- // 3. Write settings.json
225
- mkdirSync(claudeDir, { recursive: true });
226
- writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
227
- // 4. Copy slash commands (copy, not symlink — survives npm updates)
228
- const commandsCopied = [];
229
- const commandsDir = join(claudeDir, "commands");
230
- const sourceCommandsDir = getPluginCommandsDir();
231
- if (existsSync(sourceCommandsDir)) {
232
- mkdirSync(commandsDir, { recursive: true });
233
- try {
234
- const entries = readdirSync(sourceCommandsDir);
235
- for (const entry of entries) {
236
- if (!entry.endsWith(".md"))
237
- continue;
238
- const target = join(commandsDir, entry);
239
- const source = join(sourceCommandsDir, entry);
240
- try {
241
- unlinkSync(target);
242
- }
243
- catch { /* File didn't exist */ }
244
- try {
245
- copyFileSync(source, target);
246
- commandsCopied.push(entry);
247
- }
248
- catch { /* Copy failed — non-critical */ }
249
- }
250
- }
251
- catch { /* Commands dir read failed — non-critical */ }
252
- }
253
- return { installed: true, hooksAdded, commandsCopied };
254
- }
255
- // ── 3. Hook Installers (Cursor, Windsurf, Cline) ──────────────────────
256
- /**
257
- * Install hook scripts for platforms that support event-driven hooks.
258
- * Each platform has its own adapter scripts in dist/plugin/adapters/.
259
- */
260
- export function installHooks(platform) {
261
- // Claude Code handled separately via installClaudeCodePlugin
262
- if (platform.id === "claude-code") {
263
- return { installed: false, hooksAdded: [] };
264
- }
265
- const adapterDir = join(getPluginDistDir(), "adapters");
266
- if (!existsSync(adapterDir)) {
267
- return { installed: false, hooksAdded: [] };
268
- }
269
- if (platform.id === "cursor")
270
- return installCursorHooks(adapterDir, platform);
271
- if (platform.id === "windsurf")
272
- return installWindsurfHooks(adapterDir, platform);
273
- if (platform.id === "cline")
274
- return installClineHooks(adapterDir, platform);
275
- return { installed: false, hooksAdded: [] };
276
- }
277
- function installCursorHooks(adapterDir, platform) {
278
- const hookConfigPath = platform.hookConfigPath;
279
- if (!hookConfigPath)
280
- return { installed: false, hooksAdded: [] };
281
- const config = readJsonFile(hookConfigPath);
282
- if (!config.hooks || typeof config.hooks !== "object") {
283
- config.hooks = {};
284
- }
285
- const hooks = config.hooks;
286
- const hooksAdded = [];
287
- const cursorHookDefs = [
288
- { event: "sessionStart", script: "cursor-session-start.js", timeout: 120000 },
289
- { event: "userPromptSubmit", script: "cursor-recall.js", timeout: 10000 },
290
- { event: "stop", script: "cursor-stop.js", timeout: 10000 },
291
- ];
292
- for (const def of cursorHookDefs) {
293
- const scriptPath = join(adapterDir, def.script);
294
- if (!existsSync(scriptPath))
295
- continue;
296
- if (!hooks[def.event])
297
- hooks[def.event] = [];
298
- // Remove existing nex hooks
299
- hooks[def.event] = hooks[def.event].filter((h) => !String(h.command ?? "").includes("nex"));
300
- hooks[def.event].push({
301
- type: "command",
302
- command: `node ${scriptPath}`,
303
- timeout: def.timeout,
304
- });
305
- hooksAdded.push(def.event);
306
- }
307
- writeJsonFile(hookConfigPath, config);
308
- return { installed: true, hooksAdded };
309
- }
310
- function installWindsurfHooks(adapterDir, platform) {
311
- const hookConfigPath = platform.hookConfigPath;
312
- if (!hookConfigPath)
313
- return { installed: false, hooksAdded: [] };
314
- const config = readJsonFile(hookConfigPath);
315
- if (!config.hooks || typeof config.hooks !== "object") {
316
- config.hooks = {};
317
- }
318
- const hooks = config.hooks;
319
- const hooksAdded = [];
320
- const windsurfHookDefs = [
321
- { event: "pre_user_prompt", script: "windsurf-recall.js", timeout: 10000 },
322
- { event: "post_cascade_response", script: "windsurf-capture.js", timeout: 10000 },
323
- ];
324
- for (const def of windsurfHookDefs) {
325
- const scriptPath = join(adapterDir, def.script);
326
- if (!existsSync(scriptPath))
327
- continue;
328
- if (!hooks[def.event])
329
- hooks[def.event] = [];
330
- hooks[def.event] = hooks[def.event].filter((h) => !String(h.command ?? "").includes("nex"));
331
- hooks[def.event].push({
332
- type: "command",
333
- command: `node ${scriptPath}`,
334
- timeout: def.timeout,
335
- });
336
- hooksAdded.push(def.event);
337
- }
338
- writeJsonFile(hookConfigPath, config);
339
- return { installed: true, hooksAdded };
340
- }
341
- function installClineHooks(adapterDir, platform) {
342
- // Cline uses executable files in .clinerules/hooks/
343
- const hookDir = platform.hookConfigPath;
344
- if (!hookDir)
345
- return { installed: false, hooksAdded: [] };
346
- mkdirSync(hookDir, { recursive: true });
347
- const hooksAdded = [];
348
- const clineHookDefs = [
349
- { event: "UserPromptSubmit", script: "cline-recall.js" },
350
- { event: "TaskStart", script: "cline-task-start.js" },
351
- { event: "TaskComplete", script: "cline-capture.js" },
352
- ];
353
- for (const def of clineHookDefs) {
354
- const scriptPath = join(adapterDir, def.script);
355
- if (!existsSync(scriptPath))
356
- continue;
357
- // Write a shell wrapper that invokes node with the adapter script
358
- const wrapperPath = join(hookDir, `nex-${def.event.toLowerCase()}`);
359
- const wrapper = `#!/usr/bin/env sh\nexec node "${scriptPath}" "$@"\n`;
360
- writeFileSync(wrapperPath, wrapper, { mode: 0o755 });
361
- hooksAdded.push(def.event);
362
- }
363
- return { installed: true, hooksAdded };
364
- }
365
- // ── 4. Custom Tool/Plugin Installers ───────────────────────────────────
366
- /**
367
- * Install OpenCode plugin template to .opencode/plugins/nex.ts.
368
- */
369
- export function installOpenCodePlugin() {
370
- const templatePath = join(getPlatformPluginsDir(), "opencode-plugin.ts");
371
- if (!existsSync(templatePath)) {
372
- return { installed: false, pluginPath: "" };
373
- }
374
- const targetDir = join(process.cwd(), ".opencode", "plugins");
375
- const targetPath = join(targetDir, "nex.ts");
376
- mkdirSync(targetDir, { recursive: true });
377
- copyFileSync(templatePath, targetPath);
378
- return { installed: true, pluginPath: targetPath };
379
- }
380
- /**
381
- * Install OpenClaw plugin via CLI.
382
- */
383
- export function installOpenClawPlugin(apiKey) {
384
- // Check if openclaw CLI is available
385
- let hasOpenClaw = false;
386
- try {
387
- execFileSync("which", ["openclaw"], { stdio: "ignore" });
388
- hasOpenClaw = true;
389
- }
390
- catch { /* not installed */ }
391
- if (!hasOpenClaw) {
392
- return {
393
- installed: false,
394
- message: "Install OpenClaw to enable: https://docs.openclaw.ai/install",
395
- };
396
- }
397
- // Check if plugin already installed
398
- const configPath = join(homedir(), ".openclaw", "openclaw.json");
399
- const config = readJsonFile(configPath);
400
- const plugins = (config.plugins ?? {});
401
- const entries = (plugins.entries ?? {});
402
- if (!entries.nex) {
403
- // Install the plugin
404
- try {
405
- execFileSync("openclaw", ["plugins", "install", "@nex-ai/openclaw-plugin"], {
406
- stdio: "ignore",
407
- timeout: 30_000,
408
- });
409
- }
410
- catch {
411
- return { installed: false, message: "Failed to install OpenClaw plugin" };
412
- }
413
- }
414
- // Configure API key
415
- const freshConfig = readJsonFile(configPath);
416
- const freshPlugins = (freshConfig.plugins ?? {});
417
- const freshEntries = (freshPlugins.entries ?? {});
418
- if (!freshEntries.nex)
419
- freshEntries.nex = {};
420
- if (!freshEntries.nex.config)
421
- freshEntries.nex.config = {};
422
- freshEntries.nex.config.apiKey = apiKey;
423
- freshEntries.nex.enabled = true;
424
- freshPlugins.entries = freshEntries;
425
- freshConfig.plugins = freshPlugins;
426
- writeJsonFile(configPath, freshConfig);
427
- return { installed: true, message: "OpenClaw plugin installed and configured" };
428
- }
429
- // ── 5. Custom Agent/Mode Installers ────────────────────────────────────
430
- /**
431
- * Install VS Code custom agent (.github/agents/nex.agent.md).
432
- */
433
- export function installVSCodeAgent() {
434
- const templatePath = join(getPlatformPluginsDir(), "vscode-agent.md");
435
- if (!existsSync(templatePath)) {
436
- return { installed: false, agentPath: "" };
437
- }
438
- const targetDir = join(process.cwd(), ".github", "agents");
439
- const targetPath = join(targetDir, "nex.agent.md");
440
- mkdirSync(targetDir, { recursive: true });
441
- copyFileSync(templatePath, targetPath);
442
- return { installed: true, agentPath: targetPath };
443
- }
444
- /**
445
- * Install Kilo Code custom mode (.kilocodemodes YAML).
446
- */
447
- export function installKiloCodeMode() {
448
- const templatePath = join(getPlatformPluginsDir(), "kilocode-modes.yaml");
449
- if (!existsSync(templatePath)) {
450
- return { installed: false, modePath: "" };
451
- }
452
- const targetPath = join(process.cwd(), ".kilocodemodes");
453
- // Read existing modes file if present
454
- let existing = "";
455
- try {
456
- existing = readFileSync(targetPath, "utf-8");
457
- }
458
- catch { /* doesn't exist */ }
459
- // If already has nex-crm mode, skip
460
- if (existing.includes("nex-crm")) {
461
- return { installed: true, modePath: targetPath };
462
- }
463
- const template = readFileSync(templatePath, "utf-8");
464
- if (existing) {
465
- // Append to existing customModes
466
- // Remove the "customModes:" header from template since it already exists
467
- const modesContent = template.replace(/^customModes:\s*\n/, "");
468
- writeFileSync(targetPath, existing.trimEnd() + "\n" + modesContent, "utf-8");
469
- }
470
- else {
471
- writeFileSync(targetPath, template, "utf-8");
472
- }
473
- return { installed: true, modePath: targetPath };
474
- }
475
- /**
476
- * Install Continue.dev context provider template.
477
- */
478
- export function installContinueProvider() {
479
- const templatePath = join(getPlatformPluginsDir(), "continue-provider.ts");
480
- if (!existsSync(templatePath)) {
481
- return { installed: false, providerPath: "" };
482
- }
483
- const continueBase = existsSync(join(process.cwd(), ".continue"))
484
- ? join(process.cwd(), ".continue")
485
- : join(homedir(), ".continue");
486
- const targetDir = join(continueBase, ".plugins");
487
- const targetPath = join(targetDir, "nex-provider.ts");
488
- mkdirSync(targetDir, { recursive: true });
489
- copyFileSync(templatePath, targetPath);
490
- return { installed: true, providerPath: targetPath };
491
- }
492
- // ── 6. Workflow Installers ─────────────────────────────────────────────
493
- /**
494
- * Install Windsurf workflow files (slash commands).
495
- */
496
- export function installWindsurfWorkflows() {
497
- const sourceDir = join(getPlatformPluginsDir(), "windsurf-workflows");
498
- if (!existsSync(sourceDir)) {
499
- return { installed: false, workflowCount: 0 };
500
- }
501
- const targetDir = join(process.cwd(), ".windsurf", "workflows");
502
- mkdirSync(targetDir, { recursive: true });
503
- let count = 0;
504
- try {
505
- const entries = readdirSync(sourceDir);
506
- for (const entry of entries) {
507
- if (!entry.endsWith(".md"))
508
- continue;
509
- copyFileSync(join(sourceDir, entry), join(targetDir, entry));
510
- count++;
511
- }
512
- }
513
- catch { /* non-critical */ }
514
- return { installed: count > 0, workflowCount: count };
515
- }
516
- // ── 7. Rules File Installer ────────────────────────────────────────────
517
- const NEX_RULES_MARKER_START = "# --- Nex Context & Memory ---";
518
- const NEX_RULES_MARKER_END = "# --- End Nex ---";
519
- /**
520
- * Map platform ID to its rules template filename.
521
- */
522
- const RULES_TEMPLATE_MAP = {
523
- cursor: "cursor-rules.md",
524
- vscode: "vscode-instructions.md",
525
- windsurf: "windsurf-rules.md",
526
- cline: "cline-rules.md",
527
- continue: "continue-rules.md",
528
- zed: "zed-rules.md",
529
- kilocode: "kilocode-rules.md",
530
- opencode: "opencode-agents.md",
531
- aider: "aider-conventions.md",
532
- codex: "codex-agents.md",
533
- };
534
- /**
535
- * Platforms where rules are APPENDED to an existing file (with markers)
536
- * rather than written as a standalone file.
537
- */
538
- const APPEND_PLATFORMS = new Set(["zed", "opencode", "aider", "codex"]);
539
- export function installRulesFile(platform) {
540
- const rulesPath = platform.rulesPath;
541
- if (!rulesPath) {
542
- return { installed: false, rulesPath: "" };
543
- }
544
- const templateName = RULES_TEMPLATE_MAP[platform.id];
545
- if (!templateName) {
546
- return { installed: false, rulesPath: "" };
547
- }
548
- const templatePath = join(getPluginRulesDir(), templateName);
549
- if (!existsSync(templatePath)) {
550
- return { installed: false, rulesPath: "" };
551
- }
552
- const template = readFileSync(templatePath, "utf-8");
553
- if (APPEND_PLATFORMS.has(platform.id)) {
554
- // Append mode: add/replace section in existing file
555
- let existing = "";
556
- try {
557
- existing = readFileSync(rulesPath, "utf-8");
558
- }
559
- catch {
560
- // File doesn't exist — will create
561
- }
562
- // Check if nex section already exists
563
- const startIdx = existing.indexOf(NEX_RULES_MARKER_START);
564
- const endIdx = existing.indexOf(NEX_RULES_MARKER_END);
565
- if (startIdx !== -1 && endIdx !== -1) {
566
- // Replace existing section
567
- const before = existing.slice(0, startIdx);
568
- const after = existing.slice(endIdx + NEX_RULES_MARKER_END.length);
569
- const updated = before + template.trim() + after;
570
- mkdirSync(dirname(rulesPath), { recursive: true });
571
- writeFileSync(rulesPath, updated, "utf-8");
572
- }
573
- else if (existing.includes("nex_ask") || existing.includes("Nex Context")) {
574
- // Already has nex content without markers — skip to avoid duplicates
575
- return { installed: true, rulesPath };
576
- }
577
- else {
578
- // Append to end
579
- const separator = existing && !existing.endsWith("\n\n") ? "\n\n" : "";
580
- mkdirSync(dirname(rulesPath), { recursive: true });
581
- writeFileSync(rulesPath, existing + separator + template.trim() + "\n", "utf-8");
582
- }
583
- }
584
- else {
585
- // Standalone mode: write the file directly
586
- mkdirSync(dirname(rulesPath), { recursive: true });
587
- writeFileSync(rulesPath, template, "utf-8");
588
- }
589
- return { installed: true, rulesPath };
590
- }
591
- // ── 8. Sync API key to ~/.nex/config.json ──────────────────────────────
592
- /**
593
- * Persist API key to the canonical config file (~/.nex/config.json).
594
- * Name kept as syncApiKeyToMcpConfig for backward compatibility with callers.
595
- */
596
- export function syncApiKeyToMcpConfig(apiKey) {
597
- const configPath = join(homedir(), ".nex", "config.json");
598
- const config = readJsonFile(configPath);
599
- config.api_key = apiKey;
600
- writeJsonFile(configPath, config);
601
- }
602
- //# sourceMappingURL=installers.js.map