@justanarthur/modo-ui-ai 0.0.0-stage → 0.3.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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.fluid-functionalism +21 -0
  3. package/README.md +105 -2
  4. package/blocks/conversation/agent-prompt/examples.mdx +44 -0
  5. package/blocks/conversation/agent-prompt/index.tsx +114 -0
  6. package/blocks/conversation/composer/draft.css +25 -0
  7. package/blocks/conversation/composer/draft.tsx +589 -0
  8. package/blocks/conversation/composer/examples.mdx +164 -0
  9. package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
  10. package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
  11. package/blocks/conversation/composer/index.tsx +651 -0
  12. package/blocks/conversation/composer/queued-row.tsx +102 -0
  13. package/blocks/conversation/composer/shared.ts +38 -0
  14. package/blocks/conversation/composer/suggestion-row.tsx +64 -0
  15. package/blocks/conversation/composer/use-composer-files.ts +142 -0
  16. package/blocks/conversation/composer/use-history-nav.ts +60 -0
  17. package/blocks/conversation/composer/use-message-queue.ts +108 -0
  18. package/blocks/conversation/composer/use-region-height.ts +34 -0
  19. package/blocks/conversation/failure-states/examples.mdx +58 -0
  20. package/blocks/conversation/failure-states/index.tsx +274 -0
  21. package/blocks/conversation/transcript/examples.mdx +43 -0
  22. package/blocks/conversation/transcript/index.tsx +206 -0
  23. package/blocks/conversation/transcript-search/examples.mdx +50 -0
  24. package/blocks/conversation/transcript-search/index.tsx +469 -0
  25. package/blocks/dialogs/command-palette/examples.mdx +50 -0
  26. package/blocks/dialogs/command-palette/index.tsx +239 -0
  27. package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
  28. package/blocks/dialogs/hook-dialog/index.tsx +286 -0
  29. package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
  30. package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
  31. package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
  32. package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
  33. package/blocks/panes/artifacts-pane/examples.mdx +23 -0
  34. package/blocks/panes/artifacts-pane/index.tsx +82 -0
  35. package/blocks/panes/changes-pane/examples.mdx +23 -0
  36. package/blocks/panes/changes-pane/index.tsx +248 -0
  37. package/blocks/panes/file-pane/examples.mdx +13 -0
  38. package/blocks/panes/file-pane/index.tsx +102 -0
  39. package/blocks/panes/pr-pane/examples.mdx +13 -0
  40. package/blocks/panes/pr-pane/index.tsx +191 -0
  41. package/blocks/panes/side-pane/examples.mdx +58 -0
  42. package/blocks/panes/side-pane/index.tsx +187 -0
  43. package/blocks/panes/tasks-pane/examples.mdx +23 -0
  44. package/blocks/panes/tasks-pane/index.tsx +127 -0
  45. package/blocks/panes/terminal-pane/examples.mdx +13 -0
  46. package/blocks/panes/terminal-pane/index.tsx +99 -0
  47. package/blocks/panes/usage-pane/examples.mdx +23 -0
  48. package/blocks/panes/usage-pane/index.tsx +78 -0
  49. package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
  50. package/blocks/profiles/profile-onboarding/index.tsx +580 -0
  51. package/blocks/profiles/profile-switcher/examples.mdx +29 -0
  52. package/blocks/profiles/profile-switcher/index.tsx +212 -0
  53. package/blocks/profiles/profile-usage/examples.mdx +41 -0
  54. package/blocks/profiles/profile-usage/index.tsx +141 -0
  55. package/blocks/sessions/inbox/examples.mdx +35 -0
  56. package/blocks/sessions/inbox/index.tsx +372 -0
  57. package/blocks/sessions/session-board/examples.mdx +34 -0
  58. package/blocks/sessions/session-board/index.tsx +570 -0
  59. package/blocks/sessions/session-sidebar/examples.mdx +93 -0
  60. package/blocks/sessions/session-sidebar/index.tsx +497 -0
  61. package/blocks/settings/extensions/examples.mdx +10 -0
  62. package/blocks/settings/extensions/index.tsx +72 -0
  63. package/blocks/settings/hooks/examples.mdx +16 -0
  64. package/blocks/settings/hooks/index.tsx +127 -0
  65. package/blocks/settings/mcp-servers/examples.mdx +26 -0
  66. package/blocks/settings/mcp-servers/index.tsx +204 -0
  67. package/blocks/settings/memory/examples.mdx +22 -0
  68. package/blocks/settings/memory/index.tsx +113 -0
  69. package/blocks/settings/notifications/examples.mdx +8 -0
  70. package/blocks/settings/notifications/index.tsx +63 -0
  71. package/blocks/settings/permission-rules/examples.mdx +37 -0
  72. package/blocks/settings/permission-rules/index.tsx +317 -0
  73. package/blocks/settings/plugin-catalog/examples.mdx +52 -0
  74. package/blocks/settings/plugin-catalog/index.tsx +407 -0
  75. package/blocks/settings/plugins/examples.mdx +10 -0
  76. package/blocks/settings/plugins/index.tsx +72 -0
  77. package/blocks/settings/settings-window/examples.mdx +40 -0
  78. package/blocks/settings/settings-window/index.tsx +188 -0
  79. package/blocks/settings/worktrees/examples.mdx +17 -0
  80. package/blocks/settings/worktrees/index.tsx +145 -0
  81. package/components/conversation/agent-run/examples.mdx +38 -0
  82. package/components/conversation/agent-run/index.tsx +83 -0
  83. package/components/conversation/chapter-nav/examples.mdx +30 -0
  84. package/components/conversation/chapter-nav/index.tsx +123 -0
  85. package/components/conversation/message/examples.mdx +53 -0
  86. package/components/conversation/message/index.tsx +130 -0
  87. package/components/conversation/message/working.tsx +102 -0
  88. package/components/conversation/reasoning/examples.mdx +32 -0
  89. package/components/conversation/reasoning/index.tsx +55 -0
  90. package/components/conversation/recap/examples.mdx +21 -0
  91. package/components/conversation/recap/index.tsx +67 -0
  92. package/components/conversation/todo-list/examples.mdx +32 -0
  93. package/components/conversation/todo-list/index.tsx +106 -0
  94. package/components/conversation/tool-call/examples.mdx +48 -0
  95. package/components/conversation/tool-call/index.tsx +142 -0
  96. package/components/conversation/work-summary/examples.mdx +50 -0
  97. package/components/conversation/work-summary/index.tsx +87 -0
  98. package/components/prompts/permission-request/examples.mdx +32 -0
  99. package/components/prompts/permission-request/index.tsx +74 -0
  100. package/components/prompts/plan-approval/examples.mdx +37 -0
  101. package/components/prompts/plan-approval/index.tsx +76 -0
  102. package/components/prompts/prompt-card/examples.mdx +31 -0
  103. package/components/prompts/prompt-card/index.tsx +82 -0
  104. package/components/prompts/question-prompt/examples.mdx +46 -0
  105. package/components/prompts/question-prompt/index.tsx +118 -0
  106. package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
  107. package/dist/blocks/conversation/agent-prompt/index.js +13 -0
  108. package/dist/blocks/conversation/composer/index.d.ts +4 -0
  109. package/dist/blocks/conversation/composer/index.js +16 -0
  110. package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
  111. package/dist/blocks/conversation/failure-states/index.js +8 -0
  112. package/dist/blocks/conversation/transcript/index.d.ts +50 -0
  113. package/dist/blocks/conversation/transcript/index.js +17 -0
  114. package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
  115. package/dist/blocks/conversation/transcript-search/index.js +11 -0
  116. package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
  117. package/dist/blocks/dialogs/command-palette/index.js +20 -0
  118. package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
  119. package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
  120. package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
  121. package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
  122. package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
  123. package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
  124. package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
  125. package/dist/blocks/panes/artifacts-pane/index.js +9 -0
  126. package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
  127. package/dist/blocks/panes/changes-pane/index.js +9 -0
  128. package/dist/blocks/panes/file-pane/index.d.ts +3 -0
  129. package/dist/blocks/panes/file-pane/index.js +9 -0
  130. package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
  131. package/dist/blocks/panes/pr-pane/index.js +10 -0
  132. package/dist/blocks/panes/side-pane/index.d.ts +5 -0
  133. package/dist/blocks/panes/side-pane/index.js +21 -0
  134. package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
  135. package/dist/blocks/panes/tasks-pane/index.js +10 -0
  136. package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
  137. package/dist/blocks/panes/terminal-pane/index.js +9 -0
  138. package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
  139. package/dist/blocks/panes/usage-pane/index.js +11 -0
  140. package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
  141. package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
  142. package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
  143. package/dist/blocks/profiles/profile-switcher/index.js +12 -0
  144. package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
  145. package/dist/blocks/profiles/profile-usage/index.js +10 -0
  146. package/dist/blocks/sessions/inbox/index.d.ts +2 -0
  147. package/dist/blocks/sessions/inbox/index.js +11 -0
  148. package/dist/blocks/sessions/session-board/index.d.ts +4 -0
  149. package/dist/blocks/sessions/session-board/index.js +27 -0
  150. package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
  151. package/dist/blocks/sessions/session-sidebar/index.js +15 -0
  152. package/dist/blocks/settings/extensions/index.d.ts +2 -0
  153. package/dist/blocks/settings/extensions/index.js +9 -0
  154. package/dist/blocks/settings/hooks/index.d.ts +4 -0
  155. package/dist/blocks/settings/hooks/index.js +9 -0
  156. package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
  157. package/dist/blocks/settings/mcp-servers/index.js +9 -0
  158. package/dist/blocks/settings/memory/index.d.ts +4 -0
  159. package/dist/blocks/settings/memory/index.js +8 -0
  160. package/dist/blocks/settings/notifications/index.d.ts +2 -0
  161. package/dist/blocks/settings/notifications/index.js +8 -0
  162. package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
  163. package/dist/blocks/settings/permission-rules/index.js +10 -0
  164. package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
  165. package/dist/blocks/settings/plugin-catalog/index.js +11 -0
  166. package/dist/blocks/settings/plugins/index.d.ts +4 -0
  167. package/dist/blocks/settings/plugins/index.js +9 -0
  168. package/dist/blocks/settings/settings-window/index.d.ts +4 -0
  169. package/dist/blocks/settings/settings-window/index.js +8 -0
  170. package/dist/blocks/settings/worktrees/index.d.ts +4 -0
  171. package/dist/blocks/settings/worktrees/index.js +9 -0
  172. package/dist/components/conversation/agent-run/index.d.ts +3 -0
  173. package/dist/components/conversation/agent-run/index.js +10 -0
  174. package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
  175. package/dist/components/conversation/chapter-nav/index.js +11 -0
  176. package/dist/components/conversation/message/index.d.ts +2 -0
  177. package/dist/components/conversation/message/index.js +15 -0
  178. package/dist/components/conversation/reasoning/index.d.ts +2 -0
  179. package/dist/components/conversation/reasoning/index.js +8 -0
  180. package/dist/components/conversation/recap/index.d.ts +2 -0
  181. package/dist/components/conversation/recap/index.js +9 -0
  182. package/dist/components/conversation/todo-list/index.d.ts +2 -0
  183. package/dist/components/conversation/todo-list/index.js +9 -0
  184. package/dist/components/conversation/tool-call/index.d.ts +3 -0
  185. package/dist/components/conversation/tool-call/index.js +13 -0
  186. package/dist/components/conversation/work-summary/index.d.ts +2 -0
  187. package/dist/components/conversation/work-summary/index.js +10 -0
  188. package/dist/components/prompts/permission-request/index.d.ts +2 -0
  189. package/dist/components/prompts/permission-request/index.js +9 -0
  190. package/dist/components/prompts/plan-approval/index.d.ts +2 -0
  191. package/dist/components/prompts/plan-approval/index.js +9 -0
  192. package/dist/components/prompts/prompt-card/index.d.ts +3 -0
  193. package/dist/components/prompts/prompt-card/index.js +8 -0
  194. package/dist/components/prompts/question-prompt/index.d.ts +2 -0
  195. package/dist/components/prompts/question-prompt/index.js +9 -0
  196. package/dist/index.d.ts +50 -0
  197. package/dist/index.js +231 -0
  198. package/dist/lib/config-parts.d.ts +2 -0
  199. package/dist/lib/config-parts.js +16 -0
  200. package/dist/lib/icons.d.ts +2 -0
  201. package/dist/lib/icons.js +10 -0
  202. package/dist/lib/pace-bar.d.ts +11 -0
  203. package/dist/lib/pace-bar.js +6 -0
  204. package/dist/lib/pace.d.ts +4 -0
  205. package/dist/lib/pace.js +14 -0
  206. package/dist/lib/pane-parts.d.ts +25 -0
  207. package/dist/lib/pane-parts.js +11 -0
  208. package/dist/lib/row-trigger.d.ts +5 -0
  209. package/dist/lib/row-trigger.js +7 -0
  210. package/dist/lib/settings-parts.d.ts +70 -0
  211. package/dist/lib/settings-parts.js +24 -0
  212. package/dist/lib/side-pane-types.d.ts +2 -0
  213. package/dist/lib/side-pane-types.js +1 -0
  214. package/dist/lib/status-glyph.d.ts +8 -0
  215. package/dist/lib/status-glyph.js +12 -0
  216. package/dist/lib/types.d.ts +3 -0
  217. package/dist/lib/types.js +1 -0
  218. package/dist/shared/chunk-04a497rr.js +21 -0
  219. package/dist/shared/chunk-13yf0mza.d.ts +70 -0
  220. package/dist/shared/chunk-1hzrm8r5.d.ts +51 -0
  221. package/dist/shared/chunk-1qdwg7w5.d.ts +81 -0
  222. package/dist/shared/chunk-1yt061np.d.ts +64 -0
  223. package/dist/shared/chunk-218qabm5.js +250 -0
  224. package/dist/shared/chunk-2fk5aq60.js +313 -0
  225. package/dist/shared/chunk-3ps5h55t.d.ts +30 -0
  226. package/dist/shared/chunk-3yaftgh0.d.ts +28 -0
  227. package/dist/shared/chunk-4zvhpf2x.js +55 -0
  228. package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
  229. package/dist/shared/chunk-58jh3mje.js +46 -0
  230. package/dist/shared/chunk-58qvny6a.d.ts +29 -0
  231. package/dist/shared/chunk-5fhkkn39.js +130 -0
  232. package/dist/shared/chunk-5hw0525a.d.ts +33 -0
  233. package/dist/shared/chunk-5meda998.js +238 -0
  234. package/dist/shared/chunk-5pqksw7z.js +91 -0
  235. package/dist/shared/chunk-6220dy5n.js +70 -0
  236. package/dist/shared/chunk-64bnh22t.d.ts +59 -0
  237. package/dist/shared/chunk-66sh633m.d.ts +60 -0
  238. package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
  239. package/dist/shared/chunk-6kwk9vag.js +558 -0
  240. package/dist/shared/chunk-6rdwkymk.js +177 -0
  241. package/dist/shared/chunk-71j8qzvb.d.ts +57 -0
  242. package/dist/shared/chunk-74bvf3tw.d.ts +21 -0
  243. package/dist/shared/chunk-75zwypyr.d.ts +43 -0
  244. package/dist/shared/chunk-7mfer3tp.js +176 -0
  245. package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
  246. package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
  247. package/dist/shared/chunk-8mecznyr.js +357 -0
  248. package/dist/shared/chunk-8pag6vmd.js +255 -0
  249. package/dist/shared/chunk-94grzz9f.js +187 -0
  250. package/dist/shared/chunk-9kw6m047.d.ts +32 -0
  251. package/dist/shared/chunk-at0jje23.d.ts +110 -0
  252. package/dist/shared/chunk-awd573h9.js +34 -0
  253. package/dist/shared/chunk-b171wjge.d.ts +25 -0
  254. package/dist/shared/chunk-b4dz15em.d.ts +36 -0
  255. package/dist/shared/chunk-b5ccp5de.js +35 -0
  256. package/dist/shared/chunk-bh2b5d1z.js +98 -0
  257. package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
  258. package/dist/shared/chunk-c8wp058j.js +153 -0
  259. package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
  260. package/dist/shared/chunk-dh3qy5fj.js +49 -0
  261. package/dist/shared/chunk-dxzrtvt9.d.ts +283 -0
  262. package/dist/shared/chunk-e46apgve.d.ts +40 -0
  263. package/dist/shared/chunk-ejtknc0w.js +21 -0
  264. package/dist/shared/chunk-eqajdxn8.js +82 -0
  265. package/dist/shared/chunk-fapc805j.js +130 -0
  266. package/dist/shared/chunk-fm1qyrae.d.ts +68 -0
  267. package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
  268. package/dist/shared/chunk-g88hweqh.d.ts +70 -0
  269. package/dist/shared/chunk-gb5ee5dw.d.ts +88 -0
  270. package/dist/shared/chunk-gewnsgza.js +61 -0
  271. package/dist/shared/chunk-hxjgey30.d.ts +36 -0
  272. package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
  273. package/dist/shared/chunk-jpq101w3.js +91 -0
  274. package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
  275. package/dist/shared/chunk-kreypnzp.d.ts +34 -0
  276. package/dist/shared/chunk-mnzw0bav.js +80 -0
  277. package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
  278. package/dist/shared/chunk-n1qq2wp9.js +6 -0
  279. package/dist/shared/chunk-n31qwnj2.js +1544 -0
  280. package/dist/shared/chunk-n4742y54.js +39 -0
  281. package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
  282. package/dist/shared/chunk-njf851p1.js +245 -0
  283. package/dist/shared/chunk-nk4578dr.js +73 -0
  284. package/dist/shared/chunk-nkbgg7bw.d.ts +24 -0
  285. package/dist/shared/chunk-nvh33x9x.js +488 -0
  286. package/dist/shared/chunk-paezqfg1.js +106 -0
  287. package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
  288. package/dist/shared/chunk-qhxz1etk.js +96 -0
  289. package/dist/shared/chunk-qj5ev9ak.js +531 -0
  290. package/dist/shared/chunk-qnwggvjy.js +150 -0
  291. package/dist/shared/chunk-qt31n444.js +178 -0
  292. package/dist/shared/chunk-r5hz78pb.js +129 -0
  293. package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
  294. package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
  295. package/dist/shared/chunk-s3r759ec.js +80 -0
  296. package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
  297. package/dist/shared/chunk-skg3m9m0.js +56 -0
  298. package/dist/shared/chunk-t21t9x7e.js +188 -0
  299. package/dist/shared/chunk-tc75ng2c.js +235 -0
  300. package/dist/shared/chunk-tkx1krwc.js +88 -0
  301. package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
  302. package/dist/shared/chunk-tv9a1sek.js +137 -0
  303. package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
  304. package/dist/shared/chunk-ty2ccknv.d.ts +54 -0
  305. package/dist/shared/chunk-v6yevw62.d.ts +28 -0
  306. package/dist/shared/chunk-v9q38p0x.js +258 -0
  307. package/dist/shared/chunk-vgh4f3sv.js +118 -0
  308. package/dist/shared/chunk-vjht1zn1.js +391 -0
  309. package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
  310. package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
  311. package/dist/shared/chunk-wq9h37gy.js +86 -0
  312. package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
  313. package/dist/shared/chunk-x9jf26yb.js +318 -0
  314. package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
  315. package/dist/shared/chunk-xkchhs2z.js +129 -0
  316. package/dist/shared/chunk-xzfrskd7.js +202 -0
  317. package/dist/shared/chunk-y4cj4y54.js +423 -0
  318. package/dist/shared/chunk-y934at6m.js +7 -0
  319. package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
  320. package/dist/shared/chunk-zfhmbb7n.js +63 -0
  321. package/dist/shared/chunk-zk0t4vq5.js +71 -0
  322. package/dist/shared/chunk-znp9gna7.d.ts +23 -0
  323. package/dist/styles.css +467 -0
  324. package/index.ts +49 -0
  325. package/lib/config-parts.tsx +97 -0
  326. package/lib/icons.tsx +149 -0
  327. package/lib/pace-bar.tsx +24 -0
  328. package/lib/pace.ts +78 -0
  329. package/lib/pane-parts.tsx +76 -0
  330. package/lib/row-trigger.tsx +44 -0
  331. package/lib/settings-parts.tsx +232 -0
  332. package/lib/side-pane-types.ts +75 -0
  333. package/lib/status-glyph.tsx +25 -0
  334. package/lib/types.ts +204 -0
  335. package/mock/demo-reply.tsx +33 -0
  336. package/mock/demo-session.tsx +150 -0
  337. package/mock/mock-config.ts +173 -0
  338. package/mock/mock-extras.ts +288 -0
  339. package/mock/mock-panes.ts +190 -0
  340. package/mock/mock-settings.ts +92 -0
  341. package/mock/mock.ts +548 -0
  342. package/mock/screen-frame.tsx +49 -0
  343. package/package.json +114 -4
@@ -0,0 +1,357 @@
1
+ "use client";
2
+
3
+ import {
4
+ SCOPES2,
5
+ SCOPE_NOTE2,
6
+ Field2,
7
+ Fieldset2,
8
+ Segmented2
9
+ } from "./chunk-5pqksw7z.js";
10
+ import {
11
+ useIcon2
12
+ } from "./chunk-xkchhs2z.js";
13
+
14
+ // blocks/dialogs/mcp-server-dialog/index.tsx
15
+ import Button from "@justanarthur/modo-ui/components/actions/button";
16
+ import { Spinner } from "@justanarthur/modo-ui/components/feedback/progress";
17
+ import Checkbox from "@justanarthur/modo-ui/components/inputs/checkbox";
18
+ import Input from "@justanarthur/modo-ui/components/inputs/input";
19
+ import KeyValue from "@justanarthur/modo-ui/components/inputs/key-value";
20
+ import Dialog from "@justanarthur/modo-ui/components/overlays/dialog";
21
+ import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
22
+ import { cn } from "@justanarthur/modo-ui/lib/utils";
23
+ import Code from "@justanarthur/modo-ui/primitives/content/code";
24
+ import { useState } from "react";
25
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
26
+ /*!
27
+ * Local addition: the AI app's "Add MCP server" form. A Dialog over the
28
+ * transport (stdio, http, sse), its command and env or its URL and headers,
29
+ * the scope and profiles it applies to, and a connection test whose state
30
+ * comes in through `test`.
31
+ */
32
+ var TRANSPORTS = [
33
+ { value: "stdio", label: "stdio" },
34
+ { value: "http", label: "HTTP" },
35
+ { value: "sse", label: "SSE" }
36
+ ];
37
+ var EMPTY = {
38
+ name: "",
39
+ transport: "stdio",
40
+ command: "",
41
+ args: [],
42
+ env: [],
43
+ url: "",
44
+ headers: [],
45
+ scope: "user",
46
+ profiles: []
47
+ };
48
+ var IDLE = { state: "idle" };
49
+ function errors(server, taken) {
50
+ return {
51
+ name: taken.includes(server.name) ? "A server with this name exists." : undefined,
52
+ url: server.transport !== "stdio" && server.url && !/^https?:\/\/\S+$/.test(server.url) ? "Starts with http:// or https://." : undefined
53
+ };
54
+ }
55
+ function complete(server) {
56
+ if (!server.name)
57
+ return false;
58
+ return server.transport === "stdio" ? Boolean(server.command) : Boolean(server.url);
59
+ }
60
+ function TestResult({ test }) {
61
+ const CircleCheck = useIcon2("circle-check");
62
+ const CircleX = useIcon2("circle-x");
63
+ const head = {
64
+ idle: { icon: null, title: "Not tested yet" },
65
+ testing: { icon: /* @__PURE__ */ jsx(Spinner, {
66
+ className: "size-4"
67
+ }), title: "Connecting…" },
68
+ ok: {
69
+ icon: /* @__PURE__ */ jsx(CircleCheck, {
70
+ size: 16,
71
+ strokeWidth: 1.5,
72
+ className: "text-status-success"
73
+ }),
74
+ title: `Connected · ${test.tools?.length ?? 0} tools`
75
+ },
76
+ failed: {
77
+ icon: /* @__PURE__ */ jsx(CircleX, {
78
+ size: 16,
79
+ strokeWidth: 1.5,
80
+ className: "text-status-error"
81
+ }),
82
+ title: "Could not connect"
83
+ }
84
+ };
85
+ const { icon, title } = head[test.state];
86
+ return /* @__PURE__ */ jsxs("div", {
87
+ "aria-live": "polite",
88
+ className: "flex min-w-0 flex-col gap-[var(--space-2)]",
89
+ children: [
90
+ /* @__PURE__ */ jsxs("span", {
91
+ className: cn("flex items-center gap-[var(--space-2)] text-body", test.state === "idle" ? "text-muted-foreground" : "text-foreground"),
92
+ children: [
93
+ icon,
94
+ title
95
+ ]
96
+ }),
97
+ test.state === "ok" && test.tools && test.tools.length > 0 && /* @__PURE__ */ jsx("span", {
98
+ className: "font-mono text-caption text-muted-foreground",
99
+ children: test.tools.join(", ")
100
+ }),
101
+ test.state === "failed" && test.error && /* @__PURE__ */ jsx(Code, {
102
+ language: "txt",
103
+ children: test.error
104
+ })
105
+ ]
106
+ });
107
+ }
108
+ function McpServerDialogPanel2({
109
+ defaultServer,
110
+ profiles = [],
111
+ taken = [],
112
+ test = IDLE,
113
+ onTest,
114
+ onSave,
115
+ onDelete,
116
+ onCancel,
117
+ className
118
+ }) {
119
+ const [server, setServer] = useState({ ...EMPTY, ...defaultServer });
120
+ const [args, setArgs] = useState(server.args.join(" "));
121
+ const Plug = useIcon2("plug");
122
+ const Trash = useIcon2("trash");
123
+ const editing = Boolean(defaultServer?.name);
124
+ const set = (patch) => setServer({ ...server, ...patch });
125
+ const issues = errors(server, editing ? taken.filter((n) => n !== defaultServer?.name) : taken);
126
+ const valid = complete(server) && !issues.name && !issues.url;
127
+ const stdio = server.transport === "stdio";
128
+ const result = { ...server, args: args.split(/\s+/).filter(Boolean) };
129
+ return /* @__PURE__ */ jsxs("div", {
130
+ className: cn("flex flex-col gap-[var(--space-5)]", className),
131
+ children: [
132
+ /* @__PURE__ */ jsxs("div", {
133
+ className: "flex flex-col gap-[var(--space-1)] pr-[var(--space-6)]",
134
+ children: [
135
+ /* @__PURE__ */ jsx("h2", {
136
+ className: "m-0 text-title text-foreground",
137
+ children: editing ? `Edit ${defaultServer?.name}` : "Add an MCP server"
138
+ }),
139
+ /* @__PURE__ */ jsx("p", {
140
+ className: "m-0 text-body text-muted-foreground",
141
+ children: "Tools the sessions can call. A stdio server runs as a child process; http and sse servers answer on a URL."
142
+ })
143
+ ]
144
+ }),
145
+ /* @__PURE__ */ jsxs("div", {
146
+ className: "grid grid-cols-1 gap-[var(--space-4)] @md:grid-cols-[minmax(0,1fr)_auto]",
147
+ children: [
148
+ /* @__PURE__ */ jsx(Field2, {
149
+ label: "Name",
150
+ error: issues.name,
151
+ hint: "How tools are named: mcp__<name>__<tool>.",
152
+ children: (id) => /* @__PURE__ */ jsx(Input, {
153
+ id,
154
+ variant: "bordered",
155
+ value: server.name,
156
+ placeholder: "postgres",
157
+ invalid: Boolean(issues.name),
158
+ onValueChange: (name) => set({ name: name.trim() })
159
+ })
160
+ }),
161
+ /* @__PURE__ */ jsx(Fieldset2, {
162
+ legend: "Transport",
163
+ children: /* @__PURE__ */ jsx(Segmented2, {
164
+ label: "Transport",
165
+ options: TRANSPORTS,
166
+ value: server.transport,
167
+ onValueChange: (transport) => set({ transport })
168
+ })
169
+ })
170
+ ]
171
+ }),
172
+ stdio ? /* @__PURE__ */ jsxs(Fragment, {
173
+ children: [
174
+ /* @__PURE__ */ jsxs("div", {
175
+ className: "grid grid-cols-1 gap-[var(--space-4)] @md:grid-cols-2",
176
+ children: [
177
+ /* @__PURE__ */ jsx(Field2, {
178
+ label: "Command",
179
+ children: (id) => /* @__PURE__ */ jsx(Input, {
180
+ id,
181
+ variant: "bordered",
182
+ className: "font-mono",
183
+ value: server.command,
184
+ placeholder: "npx",
185
+ onValueChange: (command) => set({ command })
186
+ })
187
+ }),
188
+ /* @__PURE__ */ jsx(Field2, {
189
+ label: "Arguments",
190
+ hint: "Separated by spaces.",
191
+ children: (id) => /* @__PURE__ */ jsx(Input, {
192
+ id,
193
+ variant: "bordered",
194
+ className: "font-mono",
195
+ value: args,
196
+ placeholder: "-y @modelcontextprotocol/server-postgres",
197
+ onValueChange: setArgs
198
+ })
199
+ })
200
+ ]
201
+ }),
202
+ /* @__PURE__ */ jsx(Fieldset2, {
203
+ legend: "Environment",
204
+ hint: "New values are masked, for keys and tokens; the eye shows one.",
205
+ children: /* @__PURE__ */ jsx(KeyValue, {
206
+ label: "Environment variables",
207
+ keyPlaceholder: "NAME",
208
+ valuePlaceholder: "value",
209
+ addLabel: "Add variable",
210
+ secretByDefault: true,
211
+ value: server.env,
212
+ onValueChange: (env) => set({ env })
213
+ })
214
+ })
215
+ ]
216
+ }) : /* @__PURE__ */ jsxs(Fragment, {
217
+ children: [
218
+ /* @__PURE__ */ jsx(Field2, {
219
+ label: "URL",
220
+ error: issues.url,
221
+ children: (id) => /* @__PURE__ */ jsx(Input, {
222
+ id,
223
+ variant: "bordered",
224
+ className: "font-mono",
225
+ value: server.url,
226
+ placeholder: server.transport === "sse" ? "https://mcp.example.com/sse" : "https://mcp.example.com/mcp",
227
+ invalid: Boolean(issues.url),
228
+ onValueChange: (url) => set({ url: url.trim() })
229
+ })
230
+ }),
231
+ /* @__PURE__ */ jsx(Fieldset2, {
232
+ legend: "Headers",
233
+ hint: "New values are masked, for tokens; the eye shows one.",
234
+ children: /* @__PURE__ */ jsx(KeyValue, {
235
+ label: "Request headers",
236
+ keyPlaceholder: "Header",
237
+ addLabel: "Add header",
238
+ secretByDefault: true,
239
+ value: server.headers,
240
+ onValueChange: (headers) => set({ headers })
241
+ })
242
+ })
243
+ ]
244
+ }),
245
+ /* @__PURE__ */ jsx(Fieldset2, {
246
+ legend: "Scope",
247
+ hint: SCOPE_NOTE2[server.scope],
248
+ children: /* @__PURE__ */ jsx(Segmented2, {
249
+ label: "Scope",
250
+ options: SCOPES2,
251
+ value: server.scope,
252
+ onValueChange: (scope) => set({ scope })
253
+ })
254
+ }),
255
+ profiles.length > 0 && /* @__PURE__ */ jsx(Fieldset2, {
256
+ legend: "Profiles",
257
+ hint: "Sessions under the profiles you check load it; none checked means every profile.",
258
+ children: /* @__PURE__ */ jsx("div", {
259
+ className: "-mx-[var(--space-2)]",
260
+ children: /* @__PURE__ */ jsx(Checkbox.Group, {
261
+ "aria-label": "Profiles",
262
+ checkedIndices: new Set(profiles.flatMap((p, i) => server.profiles.includes(p.id) ? [i] : [])),
263
+ onCheckedIndicesChange: (picked) => set({ profiles: profiles.filter((_, i) => picked.has(i)).map((p) => p.id) }),
264
+ children: profiles.map((p) => /* @__PURE__ */ jsx(Checkbox, {
265
+ label: p.name
266
+ }, p.id))
267
+ })
268
+ })
269
+ }),
270
+ /* @__PURE__ */ jsxs("div", {
271
+ className: "flex flex-wrap items-start gap-[var(--space-3)] border-t border-border pt-[var(--space-4)]",
272
+ children: [
273
+ /* @__PURE__ */ jsx("div", {
274
+ className: "min-w-0 flex-1",
275
+ children: /* @__PURE__ */ jsx(TestResult, {
276
+ test
277
+ })
278
+ }),
279
+ /* @__PURE__ */ jsx(Button, {
280
+ variant: "secondary",
281
+ size: "compact",
282
+ leadingIcon: Plug,
283
+ disabled: !valid,
284
+ loading: test.state === "testing",
285
+ onClick: () => onTest?.(result),
286
+ children: "Test connection"
287
+ })
288
+ ]
289
+ }),
290
+ /* @__PURE__ */ jsxs("div", {
291
+ className: "flex items-center gap-[var(--space-2)]",
292
+ children: [
293
+ editing && onDelete && /* @__PURE__ */ jsx(Button, {
294
+ variant: "ghost",
295
+ leadingIcon: Trash,
296
+ className: "text-destructive",
297
+ onClick: () => onDelete(result),
298
+ children: "Delete"
299
+ }),
300
+ /* @__PURE__ */ jsxs("div", {
301
+ className: "ml-auto flex gap-[var(--space-2)]",
302
+ children: [
303
+ onCancel && /* @__PURE__ */ jsx(Button, {
304
+ variant: "ghost",
305
+ onClick: onCancel,
306
+ children: "Cancel"
307
+ }),
308
+ /* @__PURE__ */ jsx(Button, {
309
+ disabled: !valid,
310
+ onClick: () => onSave?.(result),
311
+ children: editing ? "Save" : "Add server"
312
+ })
313
+ ]
314
+ })
315
+ ]
316
+ })
317
+ ]
318
+ });
319
+ }
320
+ var McpServerDialog2 = Object.assign(function McpServerDialog({
321
+ trigger,
322
+ open,
323
+ defaultOpen = false,
324
+ onOpenChange,
325
+ onSave,
326
+ onDelete,
327
+ ...panel
328
+ }) {
329
+ const [isOpen, setOpen] = useControllableState(open, defaultOpen, onOpenChange);
330
+ const close = (handler) => handler && ((server) => {
331
+ handler(server);
332
+ setOpen(false);
333
+ });
334
+ return /* @__PURE__ */ jsxs(Dialog, {
335
+ open: isOpen,
336
+ onOpenChange: setOpen,
337
+ children: [
338
+ trigger && /* @__PURE__ */ jsx(Dialog.Trigger, {
339
+ render: trigger
340
+ }),
341
+ /* @__PURE__ */ jsx(Dialog.Content, {
342
+ width: "lg",
343
+ "aria-label": "MCP server",
344
+ className: "@container",
345
+ children: /* @__PURE__ */ jsx(McpServerDialogPanel2, {
346
+ ...panel,
347
+ onSave: close(onSave),
348
+ onDelete: close(onDelete),
349
+ onCancel: () => setOpen(false)
350
+ })
351
+ })
352
+ ]
353
+ });
354
+ }, { Panel: McpServerDialogPanel2 });
355
+ var mcp_server_dialog_default = McpServerDialog2;
356
+
357
+ export { McpServerDialogPanel2, McpServerDialog2, mcp_server_dialog_default };
@@ -0,0 +1,255 @@
1
+ "use client";
2
+
3
+ import {
4
+ useIcon2
5
+ } from "./chunk-xkchhs2z.js";
6
+ import {
7
+ PaneSection2,
8
+ IconAction2
9
+ } from "./chunk-eqajdxn8.js";
10
+ import {
11
+ RunningGlyph2
12
+ } from "./chunk-ejtknc0w.js";
13
+
14
+ // blocks/panes/pr-pane/index.tsx
15
+ import Button from "@justanarthur/modo-ui/components/actions/button";
16
+ import Accordion from "@justanarthur/modo-ui/components/containers/accordion";
17
+ import Badge from "@justanarthur/modo-ui/components/data-display/badge";
18
+ import Switch from "@justanarthur/modo-ui/components/inputs/switch";
19
+ import Code from "@justanarthur/modo-ui/primitives/content/code";
20
+ import { jsx, jsxs } from "react/jsx-runtime";
21
+ /*!
22
+ * Local addition: the side pane's Pull request — the session's PR with its
23
+ * CI checks, review comments, auto-fix and the merge.
24
+ */
25
+ function CheckGlyph({ status }) {
26
+ const Done = useIcon2("circle-check");
27
+ const Failed = useIcon2("circle-x");
28
+ if (status === "running")
29
+ return /* @__PURE__ */ jsx(RunningGlyph2, {
30
+ size: 14
31
+ });
32
+ if (status === "success")
33
+ return /* @__PURE__ */ jsx(Done, {
34
+ size: 14,
35
+ strokeWidth: 1.5,
36
+ className: "shrink-0 text-status-success"
37
+ });
38
+ return /* @__PURE__ */ jsx(Failed, {
39
+ size: 14,
40
+ strokeWidth: 1.5,
41
+ className: "shrink-0 text-status-error"
42
+ });
43
+ }
44
+ function CheckItem({
45
+ check,
46
+ index,
47
+ onOpenLog,
48
+ onFix
49
+ }) {
50
+ const Fix = useIcon2("wrench");
51
+ const Open = useIcon2("external-link");
52
+ return /* @__PURE__ */ jsxs(Accordion.Item, {
53
+ value: check.name,
54
+ index,
55
+ children: [
56
+ /* @__PURE__ */ jsx(Accordion.Trigger, {
57
+ className: "px-2",
58
+ children: /* @__PURE__ */ jsxs("span", {
59
+ className: "flex min-w-0 items-center gap-2",
60
+ children: [
61
+ /* @__PURE__ */ jsx(CheckGlyph, {
62
+ status: check.status
63
+ }),
64
+ /* @__PURE__ */ jsx("span", {
65
+ className: "shrink-0",
66
+ children: check.name
67
+ }),
68
+ /* @__PURE__ */ jsx("span", {
69
+ className: "min-w-0 flex-1 truncate text-right text-caption weight-normal text-muted-foreground",
70
+ children: check.detail
71
+ })
72
+ ]
73
+ })
74
+ }),
75
+ /* @__PURE__ */ jsx(Accordion.Content, {
76
+ children: /* @__PURE__ */ jsxs("div", {
77
+ className: "flex flex-col gap-2",
78
+ children: [
79
+ /* @__PURE__ */ jsx(Code, {
80
+ language: "plaintext",
81
+ children: check.log
82
+ }),
83
+ /* @__PURE__ */ jsxs("div", {
84
+ className: "flex items-center justify-end gap-1",
85
+ children: [
86
+ /* @__PURE__ */ jsx(Button, {
87
+ variant: "ghost",
88
+ size: "compact",
89
+ trailingIcon: Open,
90
+ onClick: () => onOpenLog?.(check),
91
+ children: "Full log"
92
+ }),
93
+ check.status === "failed" && /* @__PURE__ */ jsx(Button, {
94
+ variant: "secondary",
95
+ size: "compact",
96
+ leadingIcon: Fix,
97
+ onClick: () => onFix?.(check),
98
+ children: "Ask Claude to fix"
99
+ })
100
+ ]
101
+ })
102
+ ]
103
+ })
104
+ })
105
+ ]
106
+ });
107
+ }
108
+ function PullRequestPane2({
109
+ pr,
110
+ defaultAutoFix = true,
111
+ onAutoFixChange,
112
+ onRerun,
113
+ onOpenLog,
114
+ onFix,
115
+ onOpenOnGitHub,
116
+ onMerge
117
+ }) {
118
+ const Open = useIcon2("external-link");
119
+ const Rerun = useIcon2("rotate-ccw");
120
+ const Icon = useIcon2("git-pull-request");
121
+ const passed = pr.checks.filter((c) => c.status === "success").length;
122
+ const failing = pr.checks.filter((c) => c.status === "failed").length;
123
+ return /* @__PURE__ */ jsxs("div", {
124
+ className: "flex flex-col gap-2",
125
+ children: [
126
+ /* @__PURE__ */ jsxs("div", {
127
+ className: "flex flex-col gap-1 px-2 pt-2",
128
+ children: [
129
+ /* @__PURE__ */ jsxs("div", {
130
+ className: "flex items-start gap-2",
131
+ children: [
132
+ /* @__PURE__ */ jsx(Icon, {
133
+ size: 16,
134
+ strokeWidth: 1.5,
135
+ className: "mt-0.5 shrink-0 text-muted-foreground"
136
+ }),
137
+ /* @__PURE__ */ jsx("span", {
138
+ className: "min-w-0 flex-1 text-body weight-medium text-foreground",
139
+ children: pr.title
140
+ })
141
+ ]
142
+ }),
143
+ /* @__PURE__ */ jsxs("div", {
144
+ className: "flex min-w-0 items-center gap-2 pl-6 text-caption text-muted-foreground",
145
+ children: [
146
+ /* @__PURE__ */ jsx(Badge, {
147
+ size: "compact",
148
+ color: "green",
149
+ className: "shrink-0",
150
+ children: "Open"
151
+ }),
152
+ /* @__PURE__ */ jsxs("span", {
153
+ className: "shrink-0 tabular-nums",
154
+ children: [
155
+ "#",
156
+ pr.number
157
+ ]
158
+ }),
159
+ /* @__PURE__ */ jsxs("span", {
160
+ className: "min-w-0 truncate font-mono",
161
+ children: [
162
+ pr.branch,
163
+ " → ",
164
+ pr.base
165
+ ]
166
+ })
167
+ ]
168
+ })
169
+ ]
170
+ }),
171
+ /* @__PURE__ */ jsx(PaneSection2, {
172
+ title: "Checks",
173
+ meta: `${passed} of ${pr.checks.length} passed`,
174
+ actions: /* @__PURE__ */ jsx(IconAction2, {
175
+ icon: Rerun,
176
+ label: "Re-run failed",
177
+ onClick: onRerun
178
+ }),
179
+ children: /* @__PURE__ */ jsx(Accordion.Group, {
180
+ type: "multiple",
181
+ highlight: "trigger",
182
+ defaultValue: pr.checks.filter((c) => c.status === "failed").map((c) => c.name),
183
+ className: "w-full max-w-none",
184
+ children: pr.checks.map((check, i) => /* @__PURE__ */ jsx(CheckItem, {
185
+ check,
186
+ index: i,
187
+ onOpenLog,
188
+ onFix
189
+ }, check.name))
190
+ })
191
+ }),
192
+ /* @__PURE__ */ jsx(PaneSection2, {
193
+ title: "Reviews",
194
+ meta: `${pr.reviews.length} comments`,
195
+ children: /* @__PURE__ */ jsx("ul", {
196
+ className: "m-0 flex list-none flex-col gap-2 p-0 px-2 pb-1",
197
+ children: pr.reviews.map((review) => /* @__PURE__ */ jsxs("li", {
198
+ className: "flex min-w-0 flex-col",
199
+ children: [
200
+ /* @__PURE__ */ jsxs("span", {
201
+ className: "flex min-w-0 gap-2 text-caption text-muted-foreground",
202
+ children: [
203
+ /* @__PURE__ */ jsx("span", {
204
+ className: "shrink-0 weight-medium text-foreground",
205
+ children: review.author
206
+ }),
207
+ /* @__PURE__ */ jsx("span", {
208
+ className: "min-w-0 truncate font-mono",
209
+ children: review.where
210
+ })
211
+ ]
212
+ }),
213
+ /* @__PURE__ */ jsx("span", {
214
+ className: "text-body text-foreground",
215
+ children: review.body
216
+ })
217
+ ]
218
+ }, review.where))
219
+ })
220
+ }),
221
+ /* @__PURE__ */ jsx("div", {
222
+ children: /* @__PURE__ */ jsx(Switch, {
223
+ trackSide: "end",
224
+ label: "Auto-fix",
225
+ description: "Watch CI, fix failures and answer review comments in this session",
226
+ defaultChecked: defaultAutoFix,
227
+ onCheckedChange: onAutoFixChange
228
+ })
229
+ }),
230
+ /* @__PURE__ */ jsxs("div", {
231
+ className: "flex items-center gap-2 px-2 pt-2",
232
+ children: [
233
+ /* @__PURE__ */ jsx("span", {
234
+ className: "min-w-0 flex-1 truncate text-caption text-muted-foreground",
235
+ children: failing > 0 ? `${failing} failing check blocks the merge` : "Ready to merge"
236
+ }),
237
+ /* @__PURE__ */ jsx(Button, {
238
+ variant: "tertiary",
239
+ size: "compact",
240
+ trailingIcon: Open,
241
+ onClick: onOpenOnGitHub,
242
+ children: "GitHub"
243
+ }),
244
+ /* @__PURE__ */ jsx(Button, {
245
+ size: "compact",
246
+ disabled: failing > 0,
247
+ onClick: onMerge,
248
+ children: "Merge"
249
+ })
250
+ ]
251
+ })
252
+ ]
253
+ });
254
+ }
255
+ export { PullRequestPane2 };