@pheem49/mint 1.15.0 → 1.16.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 (644) hide show
  1. package/Cargo.lock +1012 -69
  2. package/Cargo.toml +5 -2
  3. package/LICENSE +21 -654
  4. package/README.md +92 -817
  5. package/Release_Note.md +53 -560
  6. package/apps/mint-companion/src-tauri/Cargo.toml +20 -0
  7. package/apps/mint-companion/src-tauri/build.rs +3 -0
  8. package/apps/mint-companion/src-tauri/src/main.rs +468 -0
  9. package/apps/mint-companion/tsconfig.json +20 -0
  10. package/apps/mint-companion/vite.config.ts +3 -0
  11. package/components.json +19 -0
  12. package/crates/mint-cli/Cargo.toml +6 -0
  13. package/crates/mint-cli/src/agent/live_status.rs +187 -39
  14. package/crates/mint-cli/src/agent.rs +323 -95
  15. package/crates/mint-cli/src/commands/agent.rs +69 -55
  16. package/crates/mint-cli/src/commands/integrations.rs +7 -0
  17. package/crates/mint-cli/src/commands/knowledge.rs +12 -32
  18. package/crates/mint-cli/src/commands/mod.rs +44 -0
  19. package/crates/mint-cli/src/image.rs +31 -33
  20. package/crates/mint-cli/src/interactive/chat_tui.rs +3594 -483
  21. package/crates/mint-cli/src/interactive/input_box.rs +56 -6
  22. package/crates/mint-cli/src/interactive/slash_commands.rs +208 -56
  23. package/crates/mint-cli/src/interactive/tool_activity.rs +328 -0
  24. package/crates/mint-cli/src/interactive.rs +64 -40
  25. package/crates/mint-cli/src/main.rs +13 -7
  26. package/crates/mint-cli/src/mcp.rs +5 -0
  27. package/crates/mint-cli/src/mod_host.rs +6 -0
  28. package/crates/mint-cli/src/mods_cli.rs +62 -0
  29. package/crates/mint-cli/src/mods_ui.rs +187 -0
  30. package/crates/mint-cli/src/onboard.rs +5 -31
  31. package/crates/mint-cli/src/terminal_theme.rs +3 -1
  32. package/crates/mint-cli/src/updater.rs +56 -2
  33. package/crates/mint-cli/tests/library_intake.rs +77 -0
  34. package/crates/mint-cli/tests/mods_testing.rs +133 -0
  35. package/crates/mint-companion-protocol/Cargo.toml +10 -0
  36. package/crates/mint-companion-protocol/src/lib.rs +163 -0
  37. package/crates/mint-core/Cargo.toml +6 -3
  38. package/crates/mint-core/build.rs +26 -0
  39. package/crates/mint-core/src/agent/chat.rs +167 -39
  40. package/crates/mint-core/src/agent/code_tools.rs +15 -0
  41. package/crates/mint-core/src/agent/memory/sources.rs +240 -0
  42. package/crates/mint-core/src/agent/memory.rs +147 -13
  43. package/crates/mint-core/src/agent/skill_inventory.rs +325 -0
  44. package/crates/mint-core/src/agent/skills.rs +437 -90
  45. package/crates/mint-core/src/agent.rs +1 -0
  46. package/crates/mint-core/src/api_server/routes/background_jobs.rs +310 -0
  47. package/crates/mint-core/src/api_server/routes/chat.rs +216 -199
  48. package/crates/mint-core/src/api_server/routes/html_preview.rs +77 -0
  49. package/crates/mint-core/src/api_server/routes/library.rs +97 -0
  50. package/crates/mint-core/src/api_server/routes/media_gen.rs +10 -57
  51. package/crates/mint-core/src/api_server/routes/misc.rs +104 -107
  52. package/crates/mint-core/src/api_server/routes/mod.rs +6 -0
  53. package/crates/mint-core/src/api_server/routes/mods.rs +31 -0
  54. package/crates/mint-core/src/api_server/routes/sessions.rs +41 -0
  55. package/crates/mint-core/src/api_server/routes/skills_subagents.rs +12 -42
  56. package/crates/mint-core/src/api_server/routes/slash.rs +50 -1
  57. package/crates/mint-core/src/api_server/routes/sources.rs +101 -0
  58. package/crates/mint-core/src/api_server.rs +118 -9
  59. package/crates/mint-core/src/avatar_bridge.rs +11 -2
  60. package/crates/mint-core/src/browser/session.rs +52 -0
  61. package/crates/mint-core/src/companion.rs +716 -0
  62. package/crates/mint-core/src/cron/scheduler.rs +34 -2
  63. package/crates/mint-core/src/integrations/channels.rs +87 -345
  64. package/crates/mint-core/src/integrations/mcp.rs +397 -50
  65. package/crates/mint-core/src/integrations/mcp_calls.rs +823 -0
  66. package/crates/mint-core/src/integrations/mcp_catalog.rs +267 -0
  67. package/crates/mint-core/src/integrations/mcp_device.rs +319 -0
  68. package/crates/mint-core/src/integrations/mcp_result.rs +356 -0
  69. package/crates/mint-core/src/integrations/webhooks.rs +539 -0
  70. package/crates/mint-core/src/integrations.rs +2 -0
  71. package/crates/mint-core/src/lib.rs +85 -26
  72. package/crates/mint-core/src/media/gemini_live.rs +134 -14
  73. package/crates/mint-core/src/media/image_models.rs +3 -27
  74. package/crates/mint-core/src/media/image_workflow.rs +216 -0
  75. package/crates/mint-core/src/media/library/intake.rs +144 -0
  76. package/crates/mint-core/src/media/library/migration.rs +56 -0
  77. package/crates/mint-core/src/media/library/removal.rs +55 -0
  78. package/crates/mint-core/src/media/library/tests.rs +730 -0
  79. package/crates/mint-core/src/media/library/thumbnails.rs +72 -0
  80. package/crates/mint-core/src/media/library.rs +545 -0
  81. package/crates/mint-core/src/media/model_catalog.rs +375 -0
  82. package/crates/mint-core/src/media/pictures.rs +79 -222
  83. package/crates/mint-core/src/media/video_models.rs +3 -22
  84. package/crates/mint-core/src/media.rs +3 -0
  85. package/crates/mint-core/src/mods/manager.rs +1124 -0
  86. package/crates/mint-core/src/mods/mod.rs +569 -0
  87. package/crates/mint-core/src/mods/operations.rs +204 -0
  88. package/crates/mint-core/src/mods/session.rs +146 -0
  89. package/crates/mint-core/src/mods/slash.rs +59 -0
  90. package/crates/mint-core/src/mods/telemetry.rs +306 -0
  91. package/crates/mint-core/src/orchestration/approvals.rs +344 -0
  92. package/crates/mint-core/src/orchestration/context_render.rs +104 -0
  93. package/crates/mint-core/src/orchestration/mcp_review.rs +153 -0
  94. package/crates/mint-core/src/orchestration/memory_skill.rs +104 -32
  95. package/crates/mint-core/src/orchestration/mod.rs +2139 -244
  96. package/crates/mint-core/src/orchestration/mod_authoring_regressions.rs +209 -0
  97. package/crates/mint-core/src/orchestration/progress_clock.rs +80 -0
  98. package/crates/mint-core/src/orchestration/repeated_failures.rs +116 -0
  99. package/crates/mint-core/src/orchestration/review_regressions.rs +449 -0
  100. package/crates/mint-core/src/orchestration/run_control.rs +196 -0
  101. package/crates/mint-core/src/orchestration/tools/files.rs +161 -14
  102. package/crates/mint-core/src/orchestration/tools/media.rs +37 -41
  103. package/crates/mint-core/src/orchestration/tools/misc.rs +3 -2
  104. package/crates/mint-core/src/orchestration/tools/mod.rs +2 -0
  105. package/crates/mint-core/src/orchestration/tools/mods.rs +161 -0
  106. package/crates/mint-core/src/orchestration/tools/plugins_mcp.rs +303 -71
  107. package/crates/mint-core/src/orchestration/tools/shell.rs +95 -2
  108. package/crates/mint-core/src/orchestration/workspace_helpers.rs +4 -1
  109. package/crates/mint-core/src/prompts/agent.rs +17 -2
  110. package/crates/mint-core/src/prompts/tool_catalog.rs +28 -2
  111. package/crates/mint-core/src/search/knowledge.rs +7 -1
  112. package/crates/mint-core/src/search/linked_folders/index.rs +177 -13
  113. package/crates/mint-core/src/search/linked_folders.rs +83 -2
  114. package/crates/mint-core/src/slash/catalog.rs +1 -1
  115. package/crates/mint-core/src/slash/mod.rs +174 -11
  116. package/crates/mint-core/src/slash/mods.rs +155 -0
  117. package/crates/mint-core/src/system/bg_shell.rs +1129 -95
  118. package/crates/mint-core/src/system/config.rs +5 -10
  119. package/crates/mint-core/src/system/html_preview.rs +398 -0
  120. package/crates/mint-core/src/system/mint_web.rs +164 -0
  121. package/crates/mint-core/src/system/release_notes.rs +18 -0
  122. package/crates/mint-core/src/system/shell.rs +21 -6
  123. package/crates/mint-core/src/system/workspace.rs +72 -8
  124. package/crates/mint-core/src/system/workspace_history.rs +604 -0
  125. package/crates/mint-core/src/system.rs +4 -0
  126. package/crates/mint-core/tests/background_retention.rs +34 -0
  127. package/crates/mint-core/tests/background_shutdown.rs +24 -0
  128. package/crates/mint-core/tests/library_http.rs +209 -0
  129. package/crates/mint-core/tests/mcp_contract.rs +283 -0
  130. package/crates/mint-core/tests/mcp_stdio.rs +11 -10
  131. package/crates/mint-core/tests/media_model_catalog_http.rs +403 -0
  132. package/crates/mint-core/tests/mods_http.rs +215 -0
  133. package/crates/mint-core/tests/terminal_shutdown.rs +109 -0
  134. package/crates/mint-mod-runtime/Cargo.toml +18 -0
  135. package/crates/mint-mod-runtime/src/lib.rs +507 -0
  136. package/crates/mint-mod-runtime/src/sdk.js +56 -0
  137. package/crates/mint-mod-runtime/src/test_sdk.js +32 -0
  138. package/crates/mint-mod-runtime/src/testing.rs +94 -0
  139. package/crates/mint-mod-runtime/tests/runtime.rs +156 -0
  140. package/docs/mods/AUTHORING.md +61 -0
  141. package/docs/mods/README.md +139 -0
  142. package/docs/mods/TESTING.md +56 -0
  143. package/docs/mods/mint-mods.d.ts +66 -0
  144. package/examples/device-mcp/README.md +22 -0
  145. package/examples/device-mcp/contract.md +49 -0
  146. package/examples/device-mcp/mock-device.mjs +66 -0
  147. package/examples/device-mcp/server.mjs +48 -0
  148. package/examples/device-mcp/server.test.mjs +78 -0
  149. package/examples/mods/task-checklist/README.md +1 -0
  150. package/examples/mods/task-checklist/main.ts +17 -0
  151. package/examples/mods/task-checklist/manifest.json +1 -0
  152. package/examples/mods/task-checklist/tests/checklist.test.ts +15 -0
  153. package/examples/mods/token-meter/README.md +1 -0
  154. package/examples/mods/token-meter/main.ts +8 -0
  155. package/examples/mods/token-meter/manifest.json +1 -0
  156. package/examples/mods/tool-guard/README.md +1 -0
  157. package/examples/mods/tool-guard/main.ts +9 -0
  158. package/examples/mods/tool-guard/manifest.json +1 -0
  159. package/out/web/assets/CliSessionsView-CtzUJpK_.css +1 -0
  160. package/out/web/assets/CliSessionsView-D7hw0Mgj.js +1 -0
  161. package/out/web/assets/CodeReviewPage-C7bEOJfd.js +4 -0
  162. package/out/web/assets/CodeReviewPage-Dte9uLiL.css +1 -0
  163. package/out/web/assets/CommandPalette-0RrF-AOT.js +1 -0
  164. package/out/web/assets/ImageStudioPanel-CdxkAf_r.js +1 -0
  165. package/out/web/assets/LibraryPage--Qfisp6D.js +2 -0
  166. package/out/web/assets/LibraryPage-DAxUTAg7.css +1 -0
  167. package/out/web/assets/LinkedFoldersView-2nfZbDgN.js +1 -0
  168. package/out/web/assets/McpRegistryPicker-h9uS8_wT.js +1 -0
  169. package/out/web/assets/McpServersView-slfQJzNB.js +1 -0
  170. package/out/web/assets/MintDashboard-BSR5XpXh.js +25 -0
  171. package/out/web/assets/MintDashboard-CWUcCGhd.css +1 -0
  172. package/out/web/assets/PluginsView-l7LSm503.js +1 -0
  173. package/out/web/assets/ScheduledTasksView-CttmLbq1.js +1 -0
  174. package/out/web/assets/SettingsWindow-BCMLYvEV.js +4 -0
  175. package/out/web/assets/SettingsWindow-DcMVmU9u.css +1 -0
  176. package/out/web/assets/SkillsView-rNs1qr_U.js +2 -0
  177. package/out/web/assets/ToolSurfacePage-B9DzEPWN.js +37 -0
  178. package/out/web/assets/ToolSurfacePage-CTfgggF2.css +1 -0
  179. package/out/web/assets/VeoStudioPanel-DiJs_Cg2.js +4 -0
  180. package/out/web/assets/WorkspaceSelector-B2xIp04D.js +1 -0
  181. package/out/web/assets/WorkspaceSelector-Ca8uJOsS.css +1 -0
  182. package/out/web/assets/{abnfDiagram-VCTEODGH-ByMyfanq.js → abnfDiagram-VCTEODGH-CD0CjoGl.js} +1 -1
  183. package/out/web/assets/{architecture-7GRP2DOG-CLq2kEOB.js → architecture-7GRP2DOG-RKV83OeZ.js} +1 -1
  184. package/out/web/assets/{architectureDiagram-5GKGNRK7-6PoVSmNG.js → architectureDiagram-5GKGNRK7-nN_HAFct.js} +1 -1
  185. package/out/web/assets/{blockDiagram-NRAW4CY4-cKw9mAKi.js → blockDiagram-NRAW4CY4-BrrqzHW5.js} +1 -1
  186. package/out/web/assets/{c4Diagram-UCG6FXSJ-Cqy8N5Ge.js → c4Diagram-UCG6FXSJ-DTdV8_zE.js} +1 -1
  187. package/out/web/assets/{chunk-75Z2AOVW-3qybijF5.js → chunk-75Z2AOVW-_M0z5olV.js} +1 -1
  188. package/out/web/assets/chunk-CKBBP62Z-BpQEgeHF.js +2 -0
  189. package/out/web/assets/{chunk-CLGD4ZFX-CndDQkww.js → chunk-CLGD4ZFX-D54yGvGS.js} +1 -1
  190. package/out/web/assets/{chunk-DSNCTWBM-Cc4NxvgD.js → chunk-DSNCTWBM-C-gvT2ru.js} +1 -1
  191. package/out/web/assets/{chunk-DU6HZSFF-drzh6GsU.js → chunk-DU6HZSFF-CnFngIhW.js} +1 -1
  192. package/out/web/assets/{chunk-F27PBJKO-FiY35l4v.js → chunk-F27PBJKO-BqtWrnEO.js} +1 -1
  193. package/out/web/assets/{chunk-G27WJ6UU-Bjt9Il4A.js → chunk-G27WJ6UU-Ckoq5mi2.js} +1 -1
  194. package/out/web/assets/{chunk-GMAD6QVW-Bppi3Ctd.js → chunk-GMAD6QVW-BuhEcgHq.js} +1 -1
  195. package/out/web/assets/{chunk-JQ64N6SF-DGg5kcEV.js → chunk-JQ64N6SF-CF8T7GiZ.js} +1 -1
  196. package/out/web/assets/{chunk-LCL6LL3I-CCYcjd7p.js → chunk-LCL6LL3I-BhXV9zyH.js} +1 -1
  197. package/out/web/assets/{chunk-OBVCFTLP-DJeNil5M.js → chunk-OBVCFTLP-CRIkunUB.js} +1 -1
  198. package/out/web/assets/{chunk-P2QGCYS3-lRzkRjBB.js → chunk-P2QGCYS3-UFEU6BxZ.js} +1 -1
  199. package/out/web/assets/{chunk-POPQ4Y6H-DouASMBW.js → chunk-POPQ4Y6H-CQcrNbjr.js} +1 -1
  200. package/out/web/assets/{chunk-PWAF6VOD-DMmD1vVf.js → chunk-PWAF6VOD-Cc2uVDsG.js} +1 -1
  201. package/out/web/assets/{chunk-R7TYR2AO-CYLA5UC5.js → chunk-R7TYR2AO-DiCxzdAY.js} +1 -1
  202. package/out/web/assets/{chunk-RHFEMEQ7-BiXwEcUT.js → chunk-RHFEMEQ7-b7hnPmrR.js} +1 -1
  203. package/out/web/assets/{chunk-SVP7TREG-BV-zPslF.js → chunk-SVP7TREG-Bu_yYb-V.js} +1 -1
  204. package/out/web/assets/{chunk-TEH6E4GO-B2RGEohZ.js → chunk-TEH6E4GO-G4Cdlyrt.js} +1 -1
  205. package/out/web/assets/classDiagram-DTDB5LWJ-RnC2mYO4.js +1 -0
  206. package/out/web/assets/classDiagram-v2-JRS7N3AN-RnC2mYO4.js +1 -0
  207. package/out/web/assets/config-CnvCChUM.js +2 -0
  208. package/out/web/assets/config-DM6oIVO3.css +1 -0
  209. package/out/web/assets/core-DsKkQ7ig.js +1 -0
  210. package/out/web/assets/{cynefin-OW5HDTMX-Cas4csHM.js → cynefin-OW5HDTMX-CnzQfOGp.js} +1 -1
  211. package/out/web/assets/{cynefinDiagram-5FMLGOSQ-Bbpj66Y3.js → cynefinDiagram-5FMLGOSQ-DVtQnfpm.js} +1 -1
  212. package/out/web/assets/{dagre-3AP2YEHR-B0-2RDEd.js → dagre-3AP2YEHR-DG76_k5_.js} +1 -1
  213. package/out/web/assets/{diagram-S7CK7UJ4-BdzEjUyH.js → diagram-S7CK7UJ4-CaouUoze.js} +1 -1
  214. package/out/web/assets/{diagram-UQ7AKVKN-CJDwyPxF.js → diagram-UQ7AKVKN-B4bEc26B.js} +1 -1
  215. package/out/web/assets/{diagram-VSXAHHWV-BxaG1r_B.js → diagram-VSXAHHWV-BJ86Ov2Y.js} +1 -1
  216. package/out/web/assets/{diagram-VX7I27RA-BMmUqm8f.js → diagram-VX7I27RA-7hH5IPYf.js} +1 -1
  217. package/out/web/assets/{diagram-Z3DM3KII-CFtd03eE.js → diagram-Z3DM3KII-CCM4clo8.js} +1 -1
  218. package/out/web/assets/dist-js-BkYNznHX.js +1 -0
  219. package/out/web/assets/{ebnfDiagram-PWID7BFC-DwAen1hO.js → ebnfDiagram-PWID7BFC-Da7WAM3k.js} +1 -1
  220. package/out/web/assets/{erDiagram-SSCWMZ5O-BCZSHACj.js → erDiagram-SSCWMZ5O-CzzmnZWT.js} +1 -1
  221. package/out/web/assets/{event-ChBVpRy0.js → event-Cdt7Byyj.js} +1 -1
  222. package/out/web/assets/{eventmodeling-NTZA5JFV-XHStE4E_.js → eventmodeling-NTZA5JFV-xcfsA0XD.js} +1 -1
  223. package/out/web/assets/flowDiagram-A5DVABFB-JdtH1673.js +1 -0
  224. package/out/web/assets/{ganttDiagram-EL5Y4UJY-BAEu1Cql.js → ganttDiagram-EL5Y4UJY-B3ClFGmL.js} +1 -1
  225. package/out/web/assets/{gitGraph-4MIJSDKK-r32Vyper.js → gitGraph-4MIJSDKK-BZ_y_cDU.js} +1 -1
  226. package/out/web/assets/{gitGraphDiagram-WWUBYQGX-z9o9qt6V.js → gitGraphDiagram-WWUBYQGX-drhRSYm3.js} +1 -1
  227. package/out/web/assets/index-BZ9xgmMP.css +1 -0
  228. package/out/web/assets/index-Ca8cCS4h.js +168 -0
  229. package/out/web/assets/{info-A6RAGUB7-BvLaC2cw.js → info-A6RAGUB7-B7I3K0F1.js} +1 -1
  230. package/out/web/assets/{infoDiagram-RXCK75RN-Be6WAXXw.js → infoDiagram-RXCK75RN-deX_1MPh.js} +1 -1
  231. package/out/web/assets/{ishikawaDiagram-5VMMS53U-DZjoHJHC.js → ishikawaDiagram-5VMMS53U-s38yo28y.js} +1 -1
  232. package/out/web/assets/{journeyDiagram-EYS64GPL-CtVkjkGm.js → journeyDiagram-EYS64GPL-CZn2kB8b.js} +1 -1
  233. package/out/web/assets/jsx-runtime-DN4NhQUK.js +1 -0
  234. package/out/web/assets/{kanban-definition-3QL26DDD-CW5FMv1w.js → kanban-definition-3QL26DDD-DodjgySL.js} +1 -1
  235. package/out/web/assets/markdown-CMhYIcWB.js +39 -0
  236. package/out/web/assets/{mermaid-parser.core-aUgCqsZ5.js → mermaid-parser.core-Whu2rlJC.js} +3 -3
  237. package/out/web/assets/{mermaid.core-D57sEiSL.js → mermaid.core-CKyPo8VH.js} +4 -4
  238. package/out/web/assets/{mindmap-definition-FBJOCRG2-DAmSpM3a.js → mindmap-definition-FBJOCRG2-260WBDxZ.js} +1 -1
  239. package/out/web/assets/modelManager-CUaGWMWu.js +2 -0
  240. package/out/web/assets/{oauthManager-9jxicDWJ.js → oauthManager-DlNhXJr6.js} +1 -1
  241. package/out/web/assets/{packet-AYTQ26CC-DJ27iIoJ.js → packet-AYTQ26CC-CEeIRKRG.js} +1 -1
  242. package/out/web/assets/{pegDiagram-XKGWAZYB-Bj3ii-gS.js → pegDiagram-XKGWAZYB-BYadI-KO.js} +1 -1
  243. package/out/web/assets/{pie-WAS4IAKB-DG5mCUbc.js → pie-WAS4IAKB-D8uf4dh5.js} +1 -1
  244. package/out/web/assets/{pieDiagram-E7YTZNPT-BrJLPnDA.js → pieDiagram-E7YTZNPT-CjSDy4hO.js} +1 -1
  245. package/out/web/assets/{quadrantDiagram-AXDQQJYC-3x_TmF3j.js → quadrantDiagram-AXDQQJYC-B8D3gU5d.js} +1 -1
  246. package/out/web/assets/{radar-RG4KPBEZ-CrXaTTuV.js → radar-RG4KPBEZ-DZJxnokY.js} +1 -1
  247. package/out/web/assets/{railroad-74A4TZTK-BpqMH9BE.js → railroad-74A4TZTK-DBysUiUi.js} +1 -1
  248. package/out/web/assets/{railroad-abnf-HS5TGJTU-DHI0uLlV.js → railroad-abnf-HS5TGJTU-CHWxoJYg.js} +1 -1
  249. package/out/web/assets/{railroad-ebnf-LZEXJU2U-CQCb316y.js → railroad-ebnf-LZEXJU2U-DDv7X6bY.js} +1 -1
  250. package/out/web/assets/{railroad-peg-WCYAUIDC-Ph1giKkH.js → railroad-peg-WCYAUIDC-DpfcYYNJ.js} +1 -1
  251. package/out/web/assets/{railroadDiagram-O6MQD6OU-BRq6wIxx.js → railroadDiagram-O6MQD6OU-CYtyv0t3.js} +1 -1
  252. package/out/web/assets/{requirementDiagram-EFPCY7ZU-DIJj6G1g.js → requirementDiagram-EFPCY7ZU-D2X-Ewik.js} +1 -1
  253. package/out/web/assets/{sankeyDiagram-P5KCCOFB-DZajSryq.js → sankeyDiagram-P5KCCOFB-Bn2x6C4Y.js} +1 -1
  254. package/out/web/assets/{sequenceDiagram-WJ2MYXX4-DxJCWyZS.js → sequenceDiagram-WJ2MYXX4-BvFLKtPd.js} +1 -1
  255. package/out/web/assets/{stateDiagram-HBIQ2CUA-k6voi8Vf.js → stateDiagram-HBIQ2CUA-Bx0GWeaY.js} +1 -1
  256. package/out/web/assets/stateDiagram-v2-4QOOHH4V--hol1yg_.js +1 -0
  257. package/out/web/assets/{swimlanes-XN3QIQJK-igYhTjXB.js → swimlanes-XN3QIQJK-CCma0T7L.js} +1 -1
  258. package/out/web/assets/swimlanesDiagram-VK2B7HYN-BkohoVsU.js +8 -0
  259. package/out/web/assets/{timeline-definition-24CTP7MA-Dke2p93p.js → timeline-definition-24CTP7MA-iCRhhJ7C.js} +1 -1
  260. package/out/web/assets/{treeView-Q6P3EWNA-hNELnXUs.js → treeView-Q6P3EWNA-DZ-y08qp.js} +1 -1
  261. package/out/web/assets/{treemap-WGGIJYW6-D2B6wDsx.js → treemap-WGGIJYW6-De0CxzMx.js} +1 -1
  262. package/out/web/assets/{vennDiagram-4TSXK5OY-CDkW7rUP.js → vennDiagram-4TSXK5OY-w_7aZ6xe.js} +1 -1
  263. package/out/web/assets/{wardley-WFR3VGLG-BECdXETi.js → wardley-WFR3VGLG-DT0y0xJ4.js} +1 -1
  264. package/out/web/assets/{wardleyDiagram-VM6X3IG4-B5BycpQ4.js → wardleyDiagram-VM6X3IG4-DAdXELbQ.js} +1 -1
  265. package/out/web/assets/window-BJCVtyET.js +1 -0
  266. package/out/web/assets/{xychartDiagram-S5SC5T6Z-CtJS3b--.js → xychartDiagram-S5SC5T6Z-IZIXf3Vo.js} +1 -1
  267. package/out/web/index-web.html +3 -2
  268. package/out/web/index.html +3 -2
  269. package/package.json +71 -22
  270. package/shared-modules/.github/workflows/ci.yml +120 -0
  271. package/shared-modules/.github/workflows/update.yaml +28 -0
  272. package/slash-commands.json +7 -2
  273. package/src/bin/auto-build.js +66 -0
  274. package/src/bin/desktop.js +113 -0
  275. package/src/bin/desktop.test.js +113 -0
  276. package/src/bin/index.js +18 -25
  277. package/src/bin/index.test.js +89 -0
  278. package/src/bin/measure-effects.mjs +53 -0
  279. package/src/bin/package.test.js +28 -0
  280. package/src/bin/release-notes.test.js +84 -0
  281. package/src/bin/styles.test.js +20 -0
  282. package/src/bin/web.js +5 -0
  283. package/src/bin/web.test.js +39 -0
  284. package/src/renderer/index.html +0 -2
  285. package/src/renderer/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  286. package/src/renderer/shared/agentProgress.ts +33 -0
  287. package/src/renderer/shared/components/AgentActivityDrawer.tsx +3 -2
  288. package/src/renderer/shared/components/AgentActivityTable.tsx +1 -1
  289. package/src/renderer/shared/components/ApprovalCard.test.tsx +24 -0
  290. package/src/renderer/shared/components/ApprovalCard.tsx +10 -3
  291. package/src/renderer/shared/components/ArtifactPreviewPanel.tsx +88 -37
  292. package/src/renderer/shared/components/AuthGate.tsx +75 -39
  293. package/src/renderer/shared/components/BackgroundTerminals.tsx +181 -0
  294. package/src/renderer/shared/components/ChatCodeBlock.tsx +8 -4
  295. package/src/renderer/shared/components/ChatMessageItem.test.tsx +68 -0
  296. package/src/renderer/shared/components/ChatMessageItem.tsx +36 -16
  297. package/src/renderer/shared/components/ChatPanel.test.tsx +21 -0
  298. package/src/renderer/shared/components/ChatPanel.tsx +294 -272
  299. package/src/renderer/shared/components/ChunkErrorBoundary.tsx +4 -102
  300. package/src/renderer/shared/components/CliSessionsView.test.tsx +125 -0
  301. package/src/renderer/shared/components/CliSessionsView.tsx +61 -13
  302. package/src/renderer/shared/components/CodeReviewPage.tsx +111 -8
  303. package/src/renderer/shared/components/CollapsiblePasteInput.tsx +90 -0
  304. package/src/renderer/shared/components/ContextCompactionStatus.tsx +17 -0
  305. package/src/renderer/shared/components/DashboardSidebar.tsx +15 -128
  306. package/src/renderer/shared/components/DesktopTitlebar.tsx +45 -19
  307. package/src/renderer/shared/components/ErrorNotice.tsx +29 -0
  308. package/src/renderer/shared/components/FormattedMessage.tsx +11 -0
  309. package/src/renderer/shared/components/GeminiLiveOverlay.css +86 -0
  310. package/src/renderer/shared/components/GeminiLiveOverlay.test.tsx +24 -0
  311. package/src/renderer/shared/components/GeminiLiveOverlay.tsx +85 -101
  312. package/src/renderer/shared/components/GlideSelect.css +138 -0
  313. package/src/renderer/shared/components/GlideSelect.d.ts +31 -0
  314. package/src/renderer/shared/components/GlideSelect.jsx +266 -0
  315. package/src/renderer/shared/components/ImageSearchCard.tsx +46 -56
  316. package/src/renderer/shared/components/ImageStudioPanel.tsx +9 -8
  317. package/src/renderer/shared/components/LibraryItemCard.tsx +72 -0
  318. package/src/renderer/shared/components/LibraryPage.tsx +165 -0
  319. package/src/renderer/shared/components/LibraryPreview.tsx +59 -0
  320. package/src/renderer/shared/components/McpServersView.tsx +27 -8
  321. package/src/renderer/shared/components/McpToolAllowlist.tsx +2 -4
  322. package/src/renderer/shared/components/McpToolResults.tsx +99 -0
  323. package/src/renderer/shared/components/MintDashboard.tsx +308 -770
  324. package/src/renderer/shared/components/ModSessionControls.tsx +8 -0
  325. package/src/renderer/shared/components/ModUi.test.tsx +65 -0
  326. package/src/renderer/shared/components/ModUi.tsx +26 -0
  327. package/src/renderer/shared/components/ModelSelectorPopover.tsx +14 -7
  328. package/src/renderer/shared/components/ModsPanel.tsx +156 -0
  329. package/src/renderer/shared/components/ProgressActivity.tsx +17 -0
  330. package/src/renderer/shared/components/ReviewHistory.tsx +42 -0
  331. package/src/renderer/shared/components/RewindModal.tsx +5 -12
  332. package/src/renderer/shared/components/RunSummaryDashboard.tsx +6 -12
  333. package/src/renderer/shared/components/ScheduledTasksView.tsx +7 -6
  334. package/src/renderer/shared/components/SelectField.test.tsx +27 -0
  335. package/src/renderer/shared/components/SelectField.tsx +38 -0
  336. package/src/renderer/shared/components/SessionSources.tsx +48 -0
  337. package/src/renderer/shared/components/SessionSourcesPopover.tsx +61 -0
  338. package/src/renderer/shared/components/Settings/AgentsTab.tsx +7 -6
  339. package/src/renderer/shared/components/Settings/AudioTab.tsx +8 -7
  340. package/src/renderer/shared/components/Settings/AutomationTab.tsx +2 -2
  341. package/src/renderer/shared/components/Settings/GeneralTab.tsx +33 -32
  342. package/src/renderer/shared/components/Settings/MemoryTab.test.tsx +37 -0
  343. package/src/renderer/shared/components/Settings/MemoryTab.tsx +71 -31
  344. package/src/renderer/shared/components/Settings/NotificationsTab.test.tsx +15 -0
  345. package/src/renderer/shared/components/Settings/NotificationsTab.tsx +84 -0
  346. package/src/renderer/shared/components/Settings/ThemeTab.tsx +19 -11
  347. package/src/renderer/shared/components/SlashChoicePanel.tsx +88 -0
  348. package/src/renderer/shared/components/SlashSuggestions.test.tsx +33 -0
  349. package/src/renderer/shared/components/SlashSuggestions.tsx +38 -10
  350. package/src/renderer/shared/components/SourcesBlock.tsx +12 -20
  351. package/src/renderer/shared/components/ToolSurfacePage.test.tsx +32 -0
  352. package/src/renderer/shared/components/ToolSurfacePage.tsx +59 -11
  353. package/src/renderer/shared/components/ToolsPanelToggle.tsx +13 -0
  354. package/src/renderer/shared/components/VeoStudioPanel.tsx +9 -8
  355. package/src/renderer/shared/components/ViewedImages.tsx +36 -0
  356. package/src/renderer/shared/components/VirtualChatHistory.tsx +82 -0
  357. package/src/renderer/shared/components/VoicePill.css +85 -0
  358. package/src/renderer/shared/components/VoicePill.d.ts +12 -0
  359. package/src/renderer/shared/components/VoicePill.jsx +190 -0
  360. package/src/renderer/shared/components/VoicePill.test.tsx +22 -0
  361. package/src/renderer/shared/components/WorkspaceContextPopover.tsx +20 -15
  362. package/src/renderer/shared/components/WorkspacePaneResizer.tsx +92 -0
  363. package/src/renderer/shared/components/WorkspacePreviewActions.test.tsx +44 -0
  364. package/src/renderer/shared/components/WorkspacePreviewActions.tsx +19 -0
  365. package/src/renderer/shared/components/WorkspaceSelector.tsx +13 -8
  366. package/src/renderer/shared/components/background-terminals.css +292 -0
  367. package/src/renderer/shared/components/ui/README.md +52 -0
  368. package/src/renderer/shared/components/ui/button.tsx +37 -0
  369. package/src/renderer/shared/components/ui/demo.tsx +26 -0
  370. package/src/renderer/shared/components/ui/error-recovery.css +35 -0
  371. package/src/renderer/shared/components/ui/error-recovery.tsx +35 -0
  372. package/src/renderer/shared/components/ui/voice-powered-orb.css +6 -0
  373. package/src/renderer/shared/components/ui/voice-powered-orb.tsx +374 -0
  374. package/src/renderer/shared/components/workspace-selector.css +248 -0
  375. package/src/renderer/shared/constants/config.ts +30 -1
  376. package/src/renderer/shared/constants/slashCommands.ts +1 -1
  377. package/src/renderer/shared/conversation/lifecycle.test.ts +362 -0
  378. package/src/renderer/shared/conversation/lifecycle.ts +418 -0
  379. package/src/renderer/shared/conversation/projectNavigation.test.ts +105 -0
  380. package/src/renderer/shared/conversation/projectNavigation.ts +39 -0
  381. package/src/renderer/shared/conversation/sourcesTransport.ts +27 -0
  382. package/src/renderer/shared/conversation/syncView.test.ts +1 -34
  383. package/src/renderer/shared/conversation/syncView.ts +0 -37
  384. package/src/renderer/shared/conversation/transport.test.ts +163 -0
  385. package/src/renderer/shared/conversation/transport.ts +159 -0
  386. package/src/renderer/shared/conversation/useConversationCoordinator.ts +30 -72
  387. package/src/renderer/shared/css/agent-observability.css +20 -21
  388. package/src/renderer/shared/css/auth-gate.css +112 -13
  389. package/src/renderer/shared/css/code-review.css +33 -0
  390. package/src/renderer/shared/css/code-sessions.css +27 -0
  391. package/src/renderer/shared/css/collapsed-paste.css +35 -0
  392. package/src/renderer/shared/css/effects.css +15 -0
  393. package/src/renderer/shared/css/error-notice.css +60 -0
  394. package/src/renderer/shared/css/library.css +476 -0
  395. package/src/renderer/shared/css/management-views.css +138 -0
  396. package/src/renderer/shared/css/mcp-results.css +11 -0
  397. package/src/renderer/shared/css/model-selector.css +163 -105
  398. package/src/renderer/shared/css/mods.css +77 -0
  399. package/src/renderer/shared/css/notification-notice.css +28 -0
  400. package/src/renderer/shared/css/session-sources-popover.css +9 -0
  401. package/src/renderer/shared/css/session-sources.css +23 -0
  402. package/src/renderer/shared/css/settings/memory.css +154 -0
  403. package/src/renderer/shared/css/settings/notifications.css +11 -0
  404. package/src/renderer/shared/css/settings/theme.css +5 -0
  405. package/src/renderer/shared/css/slash-choice.css +95 -0
  406. package/src/renderer/shared/css/slash-suggestions.css +68 -0
  407. package/src/renderer/shared/css/sources-block.css +91 -0
  408. package/src/renderer/shared/css/thinking-status.css +46 -0
  409. package/src/renderer/shared/css/tools-panel.css +7 -0
  410. package/src/renderer/shared/css/ui-tailwind.css +19 -0
  411. package/src/renderer/shared/css/viewed-images.css +15 -0
  412. package/src/renderer/shared/fonts.css +46 -0
  413. package/src/renderer/shared/fonts.ts +3 -12
  414. package/src/renderer/shared/lib/utils.ts +6 -0
  415. package/src/renderer/shared/library/controller.test.ts +61 -0
  416. package/src/renderer/shared/library/controller.ts +57 -0
  417. package/src/renderer/shared/library/transport.test.ts +26 -0
  418. package/src/renderer/shared/library/transport.ts +60 -0
  419. package/src/renderer/shared/library/useLibraryFile.ts +38 -0
  420. package/src/renderer/shared/mods.ts +58 -0
  421. package/src/renderer/shared/platform.test.ts +57 -1
  422. package/src/renderer/shared/platform.ts +46 -1
  423. package/src/renderer/shared/theme/themeManager.test.ts +43 -0
  424. package/src/renderer/shared/theme/themeManager.ts +17 -4
  425. package/src/renderer/shared/types.ts +56 -2
  426. package/src/renderer/shared/utils/agentActivity.test.ts +75 -0
  427. package/src/renderer/shared/utils/agentActivity.ts +42 -3
  428. package/src/renderer/shared/utils/approval.tsx +7 -0
  429. package/src/renderer/shared/utils/artifactBrowser.test.ts +80 -0
  430. package/src/renderer/shared/utils/artifactBrowser.ts +41 -0
  431. package/src/renderer/shared/utils/contextCompaction.test.tsx +48 -0
  432. package/src/renderer/shared/utils/contextCompaction.ts +21 -0
  433. package/src/renderer/shared/utils/effectVisibility.ts +9 -0
  434. package/src/renderer/shared/utils/markdown.tsx +3 -3
  435. package/src/renderer/shared/utils/mcpResults.test.tsx +91 -0
  436. package/src/renderer/shared/utils/modViewport.ts +7 -0
  437. package/src/renderer/shared/utils/nativeRecordingSession.test.ts +61 -0
  438. package/src/renderer/shared/utils/nativeRecordingSession.ts +46 -0
  439. package/src/renderer/shared/utils/notificationSettings.test.ts +14 -0
  440. package/src/renderer/shared/utils/notificationSettings.ts +23 -0
  441. package/src/renderer/shared/utils/notifications.test.ts +51 -0
  442. package/src/renderer/shared/utils/notifications.ts +54 -0
  443. package/src/renderer/shared/utils/pastedText.test.ts +20 -0
  444. package/src/renderer/shared/utils/pastedText.ts +13 -0
  445. package/src/renderer/shared/utils/progressCache.test.ts +32 -0
  446. package/src/renderer/shared/utils/sessionSources.test.ts +31 -0
  447. package/src/renderer/shared/utils/sessionSources.ts +34 -0
  448. package/src/renderer/shared/utils/slashCommandProcessor.ts +1 -1
  449. package/src/renderer/shared/utils/sourceAttachments.ts +28 -0
  450. package/src/renderer/shared/utils/speech.ts +51 -9
  451. package/src/renderer/shared/utils/syntaxHighlight.test.tsx +22 -0
  452. package/src/renderer/shared/utils/syntaxHighlight.tsx +26 -0
  453. package/src/renderer/shared/utils/useGeminiLiveVoice.ts +49 -5
  454. package/src/renderer/shared/utils/useLatestCallback.ts +9 -0
  455. package/src/renderer/shared/utils/useNativeVoiceInput.ts +80 -72
  456. package/src/renderer/shared/utils/useSessionSources.ts +33 -0
  457. package/src/renderer/shared/utils/viewedImages.ts +26 -0
  458. package/src/renderer/shared/utils/workspacePane.test.ts +33 -0
  459. package/src/renderer/shared/utils/workspacePane.ts +20 -0
  460. package/src/renderer/shared/utils/workspacePreview.test.ts +24 -0
  461. package/src/renderer/shared/utils/workspacePreview.ts +16 -0
  462. package/src/renderer/shared/utils/workspaceSnapshot.test.ts +49 -0
  463. package/src/renderer/shared/utils/workspaceSnapshot.ts +26 -0
  464. package/src/renderer/shared/utils/workspaces.ts +10 -0
  465. package/src/renderer/shared/workspaceUndo.ts +88 -0
  466. package/src/renderer/src/App.tsx +9 -1
  467. package/src/renderer/src/components/LiveTranslateControls.tsx +65 -0
  468. package/src/renderer/src/components/PicturesLibrary.tsx +2 -288
  469. package/src/renderer/src/components/ScreenPicker.css +67 -30
  470. package/src/renderer/src/components/ScreenPicker.tsx +201 -60
  471. package/src/renderer/src/components/SettingsWindow.tsx +10 -5
  472. package/src/renderer/src/components/WorkspacePanel.tsx +222 -32
  473. package/src/renderer/src/components/browser-shell.css +1 -1
  474. package/src/renderer/src/components/browser-suggestions-popup.css +1 -1
  475. package/src/renderer/src/components/liveTranslateFrames.test.ts +26 -5
  476. package/src/renderer/src/components/liveTranslateFrames.ts +18 -7
  477. package/src/renderer/src/components/liveTranslateLanguage.ts +6 -0
  478. package/src/renderer/src/css/app-shell.css +52 -137
  479. package/src/renderer/src/css/chat.css +21 -495
  480. package/src/renderer/src/css/desktop-tools.css +199 -1
  481. package/src/renderer/src/css/misc.css +0 -52
  482. package/src/renderer/src/css/pictures.css +2 -415
  483. package/src/renderer/src/css/settings/base.css +50 -47
  484. package/src/renderer/src/css/sidebar-workspace.css +151 -94
  485. package/src/renderer/src/css/tool-surfaces.css +65 -9
  486. package/src/renderer/src/css/widget.css +1 -1
  487. package/src/renderer/src/env.d.ts +1 -9
  488. package/src/renderer/src/index.css +1 -1
  489. package/src/renderer/src/main.tsx +2 -1
  490. package/src/renderer/src/proactiveSuggestions.ts +29 -0
  491. package/src/renderer/src/tauri.ts +122 -330
  492. package/src/renderer/src/voiceInput.ts +2 -1
  493. package/src/renderer/src-web/components/PicturesLibrary.tsx +2 -285
  494. package/src/renderer/src-web/components/PullToRefresh.tsx +1 -1
  495. package/src/renderer/src-web/components/SettingsWindow.tsx +10 -5
  496. package/src/renderer/src-web/css/app-shell.css +24 -121
  497. package/src/renderer/src-web/css/chat.css +21 -495
  498. package/src/renderer/src-web/css/misc.css +0 -52
  499. package/src/renderer/src-web/css/mobile.css +15 -14
  500. package/src/renderer/src-web/css/pictures.css +2 -462
  501. package/src/renderer/src-web/css/settings/base.css +50 -47
  502. package/src/renderer/src-web/css/sidebar-workspace.css +9 -95
  503. package/src/renderer/src-web/css/widget.css +1 -1
  504. package/src/renderer/src-web/env.d.ts +1 -12
  505. package/src/renderer/src-web/index.css +1 -1
  506. package/src/renderer/src-web/main.tsx +2 -1
  507. package/src/renderer/src-web/proactiveSuggestions.ts +3 -0
  508. package/src/renderer/src-web/tauri.ts +129 -354
  509. package/src/renderer/tests/backgroundTerminals.browser.html +81 -0
  510. package/src/renderer/tests/chatPanelFixture.ts +23 -0
  511. package/src/renderer/tests/chatPerformance.browser.html +71 -0
  512. package/src/renderer/tests/cliSessions.browser.html +82 -0
  513. package/src/renderer/tests/collapsedPaste.browser.html +70 -0
  514. package/src/renderer/tests/composerMenus.browser.html +116 -0
  515. package/src/renderer/tests/contextCompaction.browser.html +17 -0
  516. package/src/renderer/tests/conversationLifecycle.browser.html +70 -0
  517. package/src/renderer/tests/effectsPerformance.browser.html +13 -0
  518. package/src/renderer/tests/errorRecovery.browser.html +21 -0
  519. package/src/renderer/tests/glideSelect.browser.html +71 -0
  520. package/src/renderer/tests/glideSelect.preview.html +27 -0
  521. package/src/renderer/tests/library.browser.html +1 -0
  522. package/src/renderer/tests/library.browser.tsx +78 -0
  523. package/src/renderer/tests/liveOrb.browser.html +49 -0
  524. package/src/renderer/tests/liveVoice.browser.html +29 -0
  525. package/src/renderer/tests/modInput.browser.html +22 -0
  526. package/src/renderer/tests/sessionSources.browser.html +1 -0
  527. package/src/renderer/tests/sessionSources.browser.tsx +107 -0
  528. package/src/renderer/tests/skills.browser.html +24 -0
  529. package/src/renderer/tests/toolsPanel.browser.html +1 -0
  530. package/src/renderer/tests/toolsPanel.browser.tsx +113 -0
  531. package/src/renderer/tests/viewedImages.browser.html +1 -0
  532. package/src/renderer/tests/viewedImages.browser.tsx +93 -0
  533. package/src/renderer/tests/voicePill.browser.html +80 -0
  534. package/src/renderer/tests/voicePill.preview.html +34 -0
  535. package/src/renderer/tests/webSources.browser.html +1 -0
  536. package/src/renderer/tests/webSources.browser.tsx +98 -0
  537. package/src/renderer/tests/workspaceUndo.browser.html +92 -0
  538. package/src-tauri/Cargo.toml +40 -0
  539. package/src-tauri/build.rs +3 -0
  540. package/src-tauri/src/app/lifecycle.rs +277 -0
  541. package/src-tauri/src/app/mod.rs +4 -0
  542. package/src-tauri/src/app/shortcuts.rs +40 -0
  543. package/src-tauri/src/app/tray.rs +52 -0
  544. package/src-tauri/src/background/events.rs +70 -0
  545. package/src-tauri/src/background/headless.rs +230 -0
  546. package/src-tauri/src/background/mod.rs +4 -0
  547. package/src-tauri/src/background/proactive.rs +262 -0
  548. package/src-tauri/src/commands/approvals.rs +20 -0
  549. package/src-tauri/src/commands/auth.rs +127 -0
  550. package/src-tauri/src/commands/conversation.rs +642 -0
  551. package/src-tauri/src/commands/integrations.rs +157 -0
  552. package/src-tauri/src/commands/media.rs +179 -0
  553. package/src-tauri/src/commands/mod.rs +11 -0
  554. package/src-tauri/src/commands/mods.rs +6 -0
  555. package/src-tauri/src/commands/settings.rs +141 -0
  556. package/src-tauri/src/commands/voice.rs +153 -0
  557. package/src-tauri/src/commands/workspace.rs +501 -0
  558. package/src-tauri/src/lib.rs +10 -0
  559. package/src-tauri/src/main.rs +3 -0
  560. package/src-tauri/src/native/actions.rs +206 -0
  561. package/src-tauri/src/native/browser.rs +252 -0
  562. package/src-tauri/src/native/capture.rs +695 -0
  563. package/src-tauri/src/native/discord_rpc.rs +99 -0
  564. package/src-tauri/src/native/integrations.rs +126 -0
  565. package/src-tauri/src/native/mod.rs +12 -0
  566. package/src-tauri/src/native/notifications.rs +51 -0
  567. package/src-tauri/src/native/plugins.rs +14 -0
  568. package/src-tauri/src/native/system.rs +250 -0
  569. package/src-tauri/src/native/terminal.rs +201 -0
  570. package/src-tauri/src/native/updater.rs +148 -0
  571. package/src-tauri/src/native/windows.rs +143 -0
  572. package/tsconfig.json +2 -0
  573. package/vite.config.ts +4 -1
  574. package/vite.config.web.ts +4 -0
  575. package/.cargo/config.toml +0 -13
  576. package/.claude/settings.local.json +0 -182
  577. package/.codex +0 -0
  578. package/CLAUDE.md +0 -102
  579. package/ROADMAP.md +0 -30
  580. package/mint-presentation-demo.mp4 +0 -0
  581. package/out/web/Live2DCubismCore.js +0 -9
  582. package/out/web/assets/CliSessionsView-BxUVWEEL.js +0 -1
  583. package/out/web/assets/CliSessionsView-CBDTXuQv.css +0 -1
  584. package/out/web/assets/CodeReviewPage-DkMgfcos.css +0 -1
  585. package/out/web/assets/CodeReviewPage-jKlmLJwT.js +0 -3
  586. package/out/web/assets/CommandPalette-DnwPA5hy.js +0 -1
  587. package/out/web/assets/ImageStudioPanel-BR1XFwhR.js +0 -1
  588. package/out/web/assets/LinkedFoldersView-bi-CWQ-I.js +0 -1
  589. package/out/web/assets/McpRegistryPicker-D5tEFnyq.js +0 -1
  590. package/out/web/assets/McpServersView-BGG1dhFM.js +0 -1
  591. package/out/web/assets/MintDashboard-BIglDEWX.js +0 -20
  592. package/out/web/assets/MintDashboard-DSMywSgs.css +0 -1
  593. package/out/web/assets/ModelPanel-CbJ1PFoZ.js +0 -1
  594. package/out/web/assets/PicturesLibrary-CQP0fLP1.css +0 -1
  595. package/out/web/assets/PicturesLibrary-DoYN7T1p.js +0 -1
  596. package/out/web/assets/PluginsView-CU1HWXGk.js +0 -1
  597. package/out/web/assets/ScheduledTasksView-Bnl36y2N.js +0 -1
  598. package/out/web/assets/SettingsWindow-DhWLAn9T.css +0 -1
  599. package/out/web/assets/SettingsWindow-Dw8L01pw.js +0 -2
  600. package/out/web/assets/SkillsView-cnl8aY5p.js +0 -2
  601. package/out/web/assets/ToolSurfacePage-CgsQw6l5.css +0 -1
  602. package/out/web/assets/ToolSurfacePage-Cz2VJAPZ.js +0 -37
  603. package/out/web/assets/VeoStudioPanel-D4JnERWR.js +0 -4
  604. package/out/web/assets/chunk-CKBBP62Z-cIrXq6jN.js +0 -2
  605. package/out/web/assets/classDiagram-DTDB5LWJ-Dq0smRWk.js +0 -1
  606. package/out/web/assets/classDiagram-v2-JRS7N3AN-Dq0smRWk.js +0 -1
  607. package/out/web/assets/config-C-ZFtipU.css +0 -1
  608. package/out/web/assets/config-eEDngJXO.js +0 -1
  609. package/out/web/assets/core-hQ2VA9Ti.js +0 -1
  610. package/out/web/assets/dist-js-Bf2bhoku.js +0 -1
  611. package/out/web/assets/flowDiagram-A5DVABFB-BLg7nEcd.js +0 -1
  612. package/out/web/assets/index-Btsf4L8M.css +0 -1
  613. package/out/web/assets/index-D8D9MeRA.js +0 -11
  614. package/out/web/assets/lucide-react-Ip3L6Jtn.js +0 -1
  615. package/out/web/assets/markdown-BSeeUbJH.js +0 -38
  616. package/out/web/assets/modelManager-tMVmJVAW.js +0 -2
  617. package/out/web/assets/prompt-latin-400-normal-BQ9zjSN8.woff2 +0 -0
  618. package/out/web/assets/prompt-latin-400-normal-CxU4ec_r.woff +0 -0
  619. package/out/web/assets/prompt-latin-500-normal-B1edBDQ9.woff +0 -0
  620. package/out/web/assets/prompt-latin-500-normal-CxzxEHZc.woff2 +0 -0
  621. package/out/web/assets/prompt-latin-600-normal-CSDDLorv.woff +0 -0
  622. package/out/web/assets/prompt-latin-600-normal-hKZWXsc1.woff2 +0 -0
  623. package/out/web/assets/prompt-latin-700-normal-BfbftDSq.woff +0 -0
  624. package/out/web/assets/prompt-latin-700-normal-I2gc831J.woff2 +0 -0
  625. package/out/web/assets/prompt-thai-400-normal-BrkKv8cO.woff2 +0 -0
  626. package/out/web/assets/prompt-thai-400-normal-DJypnfr3.woff +0 -0
  627. package/out/web/assets/prompt-thai-500-normal-C18pDUoL.woff2 +0 -0
  628. package/out/web/assets/prompt-thai-500-normal-D7YNqUJD.woff +0 -0
  629. package/out/web/assets/prompt-thai-600-normal-CYPViXds.woff +0 -0
  630. package/out/web/assets/prompt-thai-600-normal-MrdfU7zR.woff2 +0 -0
  631. package/out/web/assets/prompt-thai-700-normal-Cb5ilR-c.woff +0 -0
  632. package/out/web/assets/prompt-thai-700-normal-Cg4aQ0Nn.woff2 +0 -0
  633. package/out/web/assets/stateDiagram-v2-4QOOHH4V-DeEc0lGZ.js +0 -1
  634. package/out/web/assets/swimlanesDiagram-VK2B7HYN-DpVik9v7.js +0 -8
  635. package/out/web/assets/window-5qYXKoW7.js +0 -1
  636. package/skills-lock.json +0 -77
  637. package/src/renderer/public/Live2DCubismCore.js +0 -9
  638. package/src/renderer/src/companionWidget.ts +0 -95
  639. package/src/renderer/src/components/Live2DStage.tsx +0 -412
  640. package/src/renderer/src/components/ModelPanel.tsx +0 -155
  641. package/src/renderer/src/css/model.css +0 -628
  642. package/src/renderer/src-web/companionWidget.ts +0 -37
  643. package/src/renderer/src-web/components/ModelPanel.tsx +0 -12
  644. package/src/renderer/src-web/css/model.css +0 -628
@@ -1,40 +1,3 @@
1
- export interface SessionIdentity {
2
- chatId: string
3
- generation: number
4
- }
5
-
6
- export function matchesActiveSession(origin: SessionIdentity, active: SessionIdentity): boolean {
7
- return origin.chatId === active.chatId && origin.generation === active.generation
8
- }
9
-
10
- export interface RunIdentity {
11
- chatId: string
12
- sessionGeneration: number
13
- runGeneration: number
14
- }
15
-
16
- export function matchesActiveRun(origin: RunIdentity, active: RunIdentity): boolean {
17
- return origin.chatId === active.chatId
18
- && origin.sessionGeneration === active.sessionGeneration
19
- && origin.runGeneration === active.runGeneration
20
- }
21
-
22
- export function mergeVisibleHistory<T extends { id: number }>(
23
- current: T[], incoming: T[], isCurrentSession: boolean,
24
- ): T[] {
25
- if (!isCurrentSession) return current
26
- const byId = new Map([...current, ...incoming].map((interaction) => [interaction.id, interaction]))
27
- return Array.from(byId.values()).sort((a, b) => a.id - b.id)
28
- }
29
-
30
- export function attachActivityToTurn<T extends { id: number; agentActivity?: A }, A>(
31
- interactions: T[], turnId: number, activity: A,
32
- ): T[] {
33
- return interactions.map((interaction) => interaction.id === turnId
34
- ? { ...interaction, agentActivity: activity }
35
- : interaction)
36
- }
37
-
38
1
  export function visibleInteractionsDuringRun<T extends { id: number }>(
39
2
  interactions: T[], sending: boolean, sendingTurnId: number | null | undefined,
40
3
  ): T[] {
@@ -0,0 +1,163 @@
1
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
2
+ import * as desktop from '../../src/tauri'
3
+ import * as web from '../../src-web/tauri'
4
+ import type { AgentProgress } from '../types'
5
+
6
+ const native = vi.hoisted(() => ({ invoke: vi.fn() }))
7
+ vi.mock('@tauri-apps/api/core', () => ({
8
+ invoke: native.invoke,
9
+ Channel: class { onmessage = (_event: unknown) => {} },
10
+ }))
11
+
12
+ const response = { provider: 'test', model: 'test-model', text: 'สวัสดี' }
13
+ const encoder = new TextEncoder()
14
+ function streamResponse(text: string, byteByByte = false) {
15
+ const bytes = encoder.encode(text)
16
+ const body = new ReadableStream<Uint8Array>({ start(controller) {
17
+ if (byteByByte) for (const byte of bytes) controller.enqueue(Uint8Array.of(byte))
18
+ else controller.enqueue(bytes)
19
+ controller.close()
20
+ } })
21
+ return new Response(body)
22
+ }
23
+ const done = JSON.stringify({ type: 'done', response })
24
+
25
+ beforeEach(() => {
26
+ vi.stubGlobal('window', {
27
+ location: { hostname: 'mint.test', port: '9000', protocol: 'http:' },
28
+ localStorage: { getItem: () => 'owner-token' },
29
+ })
30
+ native.invoke.mockReset()
31
+ })
32
+ afterEach(() => { vi.unstubAllGlobals(); vi.restoreAllMocks() })
33
+
34
+ describe.each([['Desktop', desktop], ['Web', web]] as const)('%s Conversation transport', (_name, adapter) => {
35
+ it('sends plan mode and authenticated conversation context over HTTP', async () => {
36
+ let request: any
37
+ let authorization: string | null = null
38
+ let url = ''
39
+ vi.stubGlobal('fetch', async (input: string, init: RequestInit) => {
40
+ url = input
41
+ request = JSON.parse(init.body as string)
42
+ authorization = new Headers(init.headers).get('Authorization')
43
+ return streamResponse(done + '\n')
44
+ })
45
+ await expect(adapter.streamChatMessage('inspect', () => {}, 'image1 image2', 'audio', 'video',
46
+ 'instructions', undefined, null, '/project', 'chat-1', 'agent-1', true, 'mcp-1')).resolves.toEqual(response)
47
+ expect(request).toEqual({ message: 'inspect [Image #1] [Image #2] [Video #1]',
48
+ systemInstruction: 'instructions', imageDataUri: 'image1 image2', audioDataUri: 'audio', videoDataUri: 'video',
49
+ documentAttachment: null, workspacePath: '/project', chatId: 'chat-1', agentId: 'agent-1', planMode: true, pinnedMcpServer: 'mcp-1' })
50
+ expect(authorization).toBe('Bearer owner-token')
51
+ expect(url).toBe(_name === 'Desktop' ? 'http://mint.test:3000/api/chat-stream' : '/api/chat-stream')
52
+ })
53
+
54
+ it('reads ordered events across split UTF-8 bytes and a final line without newline', async () => {
55
+ const progress: AgentProgress = { type: 'ThinkingDelta', data: { id: 'thought-1', delta: 'คิด', elapsed_ms: 10 } }
56
+ const approval = { RunShell: { command: 'pwd', mode: 'normal', background: false } }
57
+ const res = streamResponse([
58
+ JSON.stringify({ type: 'started', interactionId: 42 }),
59
+ JSON.stringify({ type: 'chunk', chunk: 'สวัสดี' }),
60
+ JSON.stringify({ type: 'progress', progress }),
61
+ JSON.stringify({ type: 'approval-requested', token: 'approval-1', approval }), done,
62
+ ].join('\r\n'), true)
63
+ vi.stubGlobal('fetch', async () => res)
64
+ const events: unknown[] = []
65
+ await expect(adapter.streamChatMessage('hello', chunk => events.push(chunk), undefined, undefined, undefined,
66
+ undefined, event => events.push(event), undefined, undefined, undefined, undefined, undefined, undefined,
67
+ event => events.push(event), id => events.push(id))).resolves.toEqual(response)
68
+ expect(events).toEqual([42, 'สวัสดี', progress, { token: 'approval-1', approval }])
69
+ expect(res.body!.locked).toBe(false)
70
+ })
71
+
72
+ it('propagates callback failures and releases the response stream', async () => {
73
+ const failure = new Error('consumer failed')
74
+ const res = streamResponse(JSON.stringify({ type: 'chunk', chunk: 'hello' }) + '\n' + done + '\n')
75
+ vi.stubGlobal('fetch', async () => res)
76
+ await expect(adapter.streamChatMessage('hello', () => { throw failure })).rejects.toBe(failure)
77
+ expect(res.body!.locked).toBe(false)
78
+ })
79
+
80
+ it('rejects incomplete streams and releases the reader', async () => {
81
+ const res = streamResponse('{"type":"chunk","chunk":"partial"}\n')
82
+ vi.stubGlobal('fetch', async () => res)
83
+ await expect(adapter.streamChatMessage('hello', () => {})).rejects.toThrow('without a final response')
84
+ expect(res.body!.locked).toBe(false)
85
+ })
86
+
87
+ it('preserves HTTP errors returned before streaming starts', async () => {
88
+ vi.stubGlobal('fetch', async () => new Response('{"text":"approval unavailable"}', { status: 403 }))
89
+ await expect(adapter.streamChatMessage('hello', () => {})).rejects.toThrow('approval unavailable')
90
+ })
91
+
92
+ it('keeps valid events after malformed and unknown lines', async () => {
93
+ vi.spyOn(console, 'error').mockImplementation(() => {})
94
+ vi.stubGlobal('fetch', async () => streamResponse('broken json\n{"type":"future"}\n' + done + '\n'))
95
+ await expect(adapter.streamChatMessage('hello', () => {})).resolves.toEqual(response)
96
+ })
97
+
98
+ it('sends plan mode for non-streaming HTTP requests too', async () => {
99
+ let request: any
100
+ vi.stubGlobal('fetch', async (_url: string, init: RequestInit) => {
101
+ request = JSON.parse(init.body as string)
102
+ return Response.json(response)
103
+ })
104
+ // The platform contract should support the same option on both operations.
105
+ await adapter.sendChatMessage('hello', undefined, undefined, undefined, undefined, undefined, 'chat-1', undefined, true)
106
+ expect(request).toMatchObject({ message: 'hello', chatId: 'chat-1', planMode: true })
107
+ })
108
+
109
+ it('preserves IPC ownership, events and the backend attachment receipt', async () => {
110
+ ;(window as any).__TAURI_INTERNALS__ = {}
111
+ let request: any
112
+ let owner: unknown
113
+ const pictures: unknown[] = []
114
+ let attachmentMetadata: unknown
115
+ native.invoke.mockImplementation(async (command: string, args: any) => {
116
+ if (command === 'save_pictures') { pictures.push(args); return }
117
+ request = args.request; owner = args.ownerToken; attachmentMetadata = args.attachmentMetadata
118
+ args.onEvent.onmessage({ type: 'started', interactionId: 7 })
119
+ args.onEvent.onmessage({ type: 'chunk', chunk: 'hello' })
120
+ args.onEvent.onmessage({ type: 'progress', progress: { type: 'ThinkingDelta', data: { id: 'thought-1', delta: 'working', elapsed_ms: 10 } } })
121
+ return response
122
+ })
123
+ const events: unknown[] = []
124
+ await expect(adapter.streamChatMessage('hello', value => events.push(value), 'image1 image2', undefined, 'video1',
125
+ 'system', value => events.push(value), undefined, '/project', 'chat-1', 'agent-1', true, 'mcp-1',
126
+ undefined, id => events.push(id), { requestId: 'submission-1', imageNames: ['one.png', 'two.png'], videoNames: ['clip.mp4'] })).resolves.toEqual(response)
127
+ expect(request).toMatchObject({ planMode: true, chatId: 'chat-1', pinnedMcpServer: 'mcp-1' })
128
+ expect(owner).toBe('owner-token')
129
+ expect(events).toEqual([7, 'hello', { type: 'ThinkingDelta', data: { id: 'thought-1', delta: 'working', elapsed_ms: 10 } }])
130
+ expect(pictures).toEqual([])
131
+ expect(attachmentMetadata).toEqual({ requestId: 'submission-1', imageNames: ['one.png', 'two.png'], videoNames: ['clip.mp4'] })
132
+ })
133
+
134
+ it('defaults to ordinary agent mode and preserves existing media markers', async () => {
135
+ let request: any
136
+ vi.stubGlobal('fetch', async (_url: string, init: RequestInit) => {
137
+ request = JSON.parse(init.body as string)
138
+ return streamResponse(done + '\n')
139
+ })
140
+ await adapter.streamChatMessage('hello [Image #1] [Video #1]', () => {}, 'image', undefined, 'video')
141
+ expect(request).toMatchObject({ message: 'hello [Image #1] [Video #1]', systemInstruction: '', planMode: false })
142
+ })
143
+
144
+ it('preserves non-streaming error responses', async () => {
145
+ vi.stubGlobal('fetch', async () => Response.json({ message: 'access denied' }, { status: 403 }))
146
+ await expect(adapter.sendChatMessage('hello')).resolves.toEqual({ provider: 'error', model: 'error', text: 'access denied' })
147
+ vi.stubGlobal('fetch', async () => Response.json({ unrelated: true }))
148
+ await expect(adapter.sendChatMessage('hello')).resolves.toMatchObject({ provider: 'error', text: expect.stringContaining('invalid chat response') })
149
+ })
150
+
151
+ it('sends authenticated plan mode in non-streaming IPC', async () => {
152
+ ;(window as any).__TAURI_INTERNALS__ = {}
153
+ let captured: any
154
+ native.invoke.mockImplementation(async (command: string, args: any) => {
155
+ expect(command).toBe('send_chat_message')
156
+ captured = args
157
+ return response
158
+ })
159
+ await expect(adapter.sendChatMessage('hello', undefined, undefined, undefined, undefined, undefined,
160
+ 'chat-1', undefined, true)).resolves.toEqual(response)
161
+ expect(captured).toMatchObject({ ownerToken: 'owner-token', request: { chatId: 'chat-1', planMode: true } })
162
+ })
163
+ })
@@ -0,0 +1,159 @@
1
+ import type { MintPlatformApi } from '../platform'
2
+ import type { AgentProgress, ChatResponse, DocumentAttachment, AttachmentMetadata } from '../types'
3
+
4
+ type ConversationOperations = Pick<MintPlatformApi, 'sendChatMessage' | 'streamChatMessage'>
5
+ type TransportEnvironment = {
6
+ isNative(): boolean
7
+ apiBase(): string
8
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>
9
+ ownerToken(): string | null
10
+ }
11
+
12
+ type StreamEvent =
13
+ | { type: 'started'; interactionId: number }
14
+ | { type: 'chunk'; chunk: string }
15
+ | { type: 'progress'; progress: AgentProgress }
16
+ | { type: 'approval-requested'; token: string; approval: any }
17
+ | { type: 'done'; response: ChatResponse }
18
+
19
+ type StreamCallbacks = {
20
+ onChunk(chunk: string): void
21
+ onProgress?: (progress: AgentProgress) => void
22
+ onApprovalRequested?: (payload: { token: string; approval: any }) => void
23
+ onTurnStarted?: (interactionId: number) => void
24
+ }
25
+
26
+ function deliverEvent(event: StreamEvent, callbacks: StreamCallbacks): ChatResponse | undefined {
27
+ switch (event?.type) {
28
+ case 'chunk': callbacks.onChunk(event.chunk); break
29
+ case 'started': callbacks.onTurnStarted?.(event.interactionId); break
30
+ case 'progress': callbacks.onProgress?.(event.progress); break
31
+ case 'approval-requested': callbacks.onApprovalRequested?.({ token: event.token, approval: event.approval }); break
32
+ case 'done': return event.response
33
+ }
34
+ }
35
+
36
+ async function readStream(response: Response, callbacks: StreamCallbacks): Promise<ChatResponse> {
37
+ const reader = response.body?.getReader()
38
+ if (!reader) throw new Error('No response body reader')
39
+ const decoder = new TextDecoder()
40
+ let buffer = ''
41
+ let finalResponse: ChatResponse | undefined
42
+ const consumeLine = (line: string) => {
43
+ if (!line.trim()) return
44
+ let event: StreamEvent
45
+ try {
46
+ event = JSON.parse(line)
47
+ } catch (error) {
48
+ console.error('Failed to parse stream line:', line, error)
49
+ return
50
+ }
51
+ // Consumer failures are transport failures, not malformed JSON.
52
+ const result = deliverEvent(event, callbacks)
53
+ if (result) finalResponse = result
54
+ }
55
+ try {
56
+ while (true) {
57
+ const { value, done } = await reader.read()
58
+ buffer += done ? decoder.decode() : decoder.decode(value, { stream: true })
59
+ const lines = buffer.split('\n')
60
+ buffer = lines.pop() || ''
61
+ for (const line of lines) consumeLine(line)
62
+ if (done) {
63
+ consumeLine(buffer)
64
+ break
65
+ }
66
+ }
67
+ if (finalResponse) return finalResponse
68
+ throw new Error('Stream closed without a final response')
69
+ } catch (error) {
70
+ await reader.cancel(error).catch(() => {})
71
+ throw error
72
+ } finally {
73
+ reader.releaseLock()
74
+ }
75
+ }
76
+
77
+ function withMediaPlaceholders(message: string, imageDataUri?: string | null, videoDataUri?: string | null) {
78
+ for (const [kind, uris] of [['Image', imageDataUri], ['Video', videoDataUri]] as const) {
79
+ if (uris && !message.includes(`[${kind} #1]`)) {
80
+ const markers = uris.split(/\s+/).filter(Boolean).map((_, index) => `[${kind} #${index + 1}]`).join(' ')
81
+ if (markers) message = `${message} ${markers}`
82
+ }
83
+ }
84
+ return message
85
+ }
86
+
87
+ /** Shared wire contract; adapters supply runtime detection, address and authentication. */
88
+ export function createConversationTransport(environment: TransportEnvironment): ConversationOperations {
89
+ const requestBody = (message: string, imageDataUri?: string | null, audioDataUri?: string | null,
90
+ videoDataUri?: string | null, systemInstruction = '', documentAttachment?: DocumentAttachment | null,
91
+ workspacePath?: string | null, chatId?: string | null, agentId?: string | null, planMode = false,
92
+ pinnedMcpServer?: string | null, attachmentMetadata?: AttachmentMetadata) => ({
93
+ ...(attachmentMetadata ? { attachmentMetadata } : {}),
94
+ message: withMediaPlaceholders(message, imageDataUri, videoDataUri), systemInstruction,
95
+ imageDataUri, audioDataUri, videoDataUri, documentAttachment, workspacePath, chatId, agentId, planMode, pinnedMcpServer,
96
+ })
97
+
98
+ const validate = (request: ReturnType<typeof requestBody>) => {
99
+ const body = JSON.stringify(request)
100
+ if (new TextEncoder().encode(body).byteLength > 32 * 1024 * 1024) throw new Error('Attachments exceed the 32 MiB request limit. Send fewer files at once.')
101
+ return body
102
+ }
103
+ const post = (route: string, request: ReturnType<typeof requestBody>) => environment.fetch(`${environment.apiBase()}/${route}`, {
104
+ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: validate(request),
105
+ })
106
+
107
+
108
+ return {
109
+ async sendChatMessage(message, imageDataUri, audioDataUri, videoDataUri, documentAttachment,
110
+ workspacePath, chatId, agentId, planMode, attachmentMetadata) {
111
+ const request = requestBody(message, imageDataUri, audioDataUri, videoDataUri, '', documentAttachment,
112
+ workspacePath, chatId, agentId, planMode, undefined, attachmentMetadata)
113
+ if (!environment.isNative()) {
114
+ try {
115
+ const response = await post('chat', request)
116
+ const data = await response.json().catch(() => null)
117
+ if (!response.ok) return { provider: 'error', model: 'error',
118
+ text: data?.text || data?.message || data?.status || `Local API returned HTTP ${response.status}` }
119
+ if (!data || typeof data.text !== 'string') return {
120
+ provider: 'error', model: 'error', text: 'Local API returned an invalid chat response.',
121
+ }
122
+ return data
123
+ } catch (error) {
124
+ console.error('Failed to send chat message to local server:', error)
125
+ return { provider: 'error', model: 'error', text: `Failed to connect to Local API Server: ${error}` }
126
+ }
127
+ }
128
+ validate(request)
129
+ const { invoke } = await import('@tauri-apps/api/core')
130
+ const response = await invoke<ChatResponse>('send_chat_message', { ownerToken: environment.ownerToken(), request, ...(attachmentMetadata ? { attachmentMetadata } : {}) })
131
+ return response
132
+ },
133
+
134
+ async streamChatMessage(message, onChunk, imageDataUri, audioDataUri, videoDataUri, systemInstruction,
135
+ onProgress, documentAttachment, workspacePath, chatId, agentId, planMode, pinnedMcpServer,
136
+ onApprovalRequested, onTurnStarted, attachmentMetadata) {
137
+ const request = requestBody(message, imageDataUri, audioDataUri, videoDataUri, systemInstruction,
138
+ documentAttachment, workspacePath, chatId, agentId, planMode, pinnedMcpServer, attachmentMetadata)
139
+ const callbacks = { onChunk, onProgress, onApprovalRequested, onTurnStarted }
140
+ if (!environment.isNative()) {
141
+ const response = await post('chat-stream', request)
142
+ if (!response.ok) {
143
+ const data = await response.json().catch(() => null)
144
+ throw new Error(data?.text || data?.message || `HTTP ${response.status}`)
145
+ }
146
+ return readStream(response, callbacks)
147
+ }
148
+ validate(request)
149
+ const { invoke, Channel } = await import('@tauri-apps/api/core')
150
+ const onEvent = new Channel<StreamEvent>()
151
+ onEvent.onmessage = event => { deliverEvent(event, callbacks) }
152
+ // Native approvals arrive via the global tool-approval-requested event bus.
153
+ const response = await invoke<ChatResponse>('stream_chat_message', {
154
+ ownerToken: environment.ownerToken(), request, onEvent, ...(attachmentMetadata ? { attachmentMetadata } : {}),
155
+ })
156
+ return response
157
+ },
158
+ }
159
+ }
@@ -1,86 +1,47 @@
1
- import { useEffect, useMemo, useReducer, useRef } from 'react'
1
+ import { useEffect, useRef, useState, useSyncExternalStore } from 'react'
2
2
  import type { ConversationState } from './coordinator'
3
- import { initialConversationState, transitionConversation } from './coordinator'
4
- import type { AgentProgress, ChatResponse } from '../types'
3
+ import { createConversationLifecycle, type ConversationEffects, type ConversationTransport } from './lifecycle'
4
+ import { conversationPlatform } from '../platform'
5
5
 
6
- interface CoordinatorOptions {
6
+ interface CoordinatorOptions extends ConversationEffects {
7
7
  conversationId: string
8
8
  draftKeyPrefix: string
9
9
  workspaceStorageKey: string
10
+ historyVisible: boolean
10
11
  }
11
12
 
13
+ /** React adapter: persistence and browser signals enter the same lifecycle tests use. */
12
14
  export function useConversationCoordinator(
13
15
  initial: Partial<ConversationState>,
14
16
  options: CoordinatorOptions,
17
+ transport: ConversationTransport = conversationPlatform,
15
18
  ) {
16
- const [conversation, dispatch] = useReducer(transitionConversation, initial, initialConversationState)
17
- const actions = useMemo(() => ({
18
- compose: (message: string) => dispatch({ type: 'compose', message }),
19
- selectWorkspace: (path: string) => dispatch({ type: 'workspace_selected', path }),
20
- attachImage: (image: ConversationState['imageAttachments'][number]) => dispatch({ type: 'image_attached', image }),
21
- removeImage: (index: number) => dispatch({ type: 'image_removed', index }),
22
- attachVideo: (video: ConversationState['videoAttachments'][number]) => dispatch({ type: 'video_attached', video }),
23
- removeVideo: (index: number) => dispatch({ type: 'video_removed', index }),
24
- attachDocument: (document: ConversationState['documentAttachment']) => dispatch({ type: 'document_attached', document }),
25
- startRun: (message: string, imageCount = 0, videoCount = 0) => dispatch({
26
- type: 'run_started', message, imageCount, videoCount,
27
- }),
28
- receiveChunk: (chunk: string) => dispatch({ type: 'chunk_received', chunk }),
29
- receiveProgress: (progress: AgentProgress[]) => dispatch({ type: 'progress_received', progress }),
30
- clearProgress: () => dispatch({ type: 'progress_cleared' }),
31
- clearStream: () => dispatch({ type: 'stream_cleared' }),
32
- requestApproval: (approval: unknown) => dispatch({ type: 'approval_requested', approval }),
33
- finishRun: () => dispatch({ type: 'run_finished' }),
34
- cancelRun: () => dispatch({ type: 'run_cancelled' }),
35
- clearComposer: () => dispatch({ type: 'composer_cleared' }),
36
- switchSession: (draft = '') => dispatch({ type: 'session_switched', draft }),
37
- executeStream: async (
38
- execute: (onChunk: (chunk: string) => void) => Promise<ChatResponse>,
39
- shouldApplyResponse: () => boolean = () => true,
40
- ) => {
41
- // Keep provider streaming internal and reveal only the authoritative
42
- // completed response. This avoids partial Markdown/card layouts and
43
- // keeps Desktop and Web behavior aligned with the CLI.
44
- const response = await execute(() => {})
45
- if (shouldApplyResponse()) {
46
- dispatch({ type: 'chunk_received', chunk: response.text })
47
- dispatch({ type: 'response_received', response })
48
- }
49
- return response
50
- },
51
- executeApproval: async (execute: () => Promise<void>) => {
52
- try {
53
- await execute()
54
- } finally {
55
- dispatch({ type: 'approval_resolved' })
56
- }
57
- },
58
- executeCancellation: async (execute: () => Promise<void>) => {
59
- try {
60
- await execute()
61
- } finally {
62
- dispatch({ type: 'run_cancelled' })
63
- }
19
+ const latest = useRef(options)
20
+ latest.current = options
21
+ const [actions] = useState(() => createConversationLifecycle(options.conversationId, initial, transport, {
22
+ onError: error => latest.current.onError?.(error),
23
+ onApproval: (approval, chatId) => latest.current.onApproval?.(approval, chatId),
24
+ onReply: (response, chatId) => latest.current.onReply?.(response, chatId),
25
+ onActivityPersisted: id => latest.current.onActivityPersisted?.(id),
26
+ onRunCompleted: () => latest.current.onRunCompleted?.(),
27
+ onVisibleRunCompleted: chatId => latest.current.onVisibleRunCompleted?.(chatId),
28
+ }, {
29
+ read: id => window.localStorage.getItem(`${latest.current.draftKeyPrefix}${id}`) || '',
30
+ write: (id, text) => {
31
+ const key = `${latest.current.draftKeyPrefix}${id}`
32
+ if (text) window.localStorage.setItem(key, text)
33
+ else window.localStorage.removeItem(key)
64
34
  },
65
- }), [])
35
+ }))
36
+ const conversation = useSyncExternalStore(actions.subscribe, actions.getSnapshot, actions.getSnapshot)
66
37
 
67
- const loadedConversationRef = useRef(options.conversationId)
68
- useEffect(() => {
69
- if (loadedConversationRef.current === options.conversationId) return
70
- loadedConversationRef.current = options.conversationId
71
- let draft = ''
72
- try {
73
- draft = window.localStorage.getItem(`${options.draftKeyPrefix}${options.conversationId}`) || ''
74
- } catch {
75
- // Draft persistence is best-effort in private browsing modes.
76
- }
77
- actions.switchSession(draft)
78
- }, [actions, options.conversationId, options.draftKeyPrefix])
38
+ useEffect(() => actions.watch({ window, document }, options.historyVisible),
39
+ [actions, options.historyVisible, conversation.conversationId])
79
40
 
80
41
  useEffect(() => {
81
42
  const timer = window.setTimeout(() => {
82
43
  try {
83
- const key = `${options.draftKeyPrefix}${options.conversationId}`
44
+ const key = `${options.draftKeyPrefix}${conversation.conversationId}`
84
45
  if (conversation.message) window.localStorage.setItem(key, conversation.message)
85
46
  else window.localStorage.removeItem(key)
86
47
  } catch {
@@ -88,15 +49,12 @@ export function useConversationCoordinator(
88
49
  }
89
50
  }, 300)
90
51
  return () => window.clearTimeout(timer)
91
- }, [conversation.message, options.conversationId, options.draftKeyPrefix])
52
+ }, [conversation.message, conversation.conversationId, options.draftKeyPrefix])
92
53
 
93
54
  useEffect(() => {
94
55
  try {
95
- if (conversation.workspacePath) {
96
- window.localStorage.setItem(options.workspaceStorageKey, conversation.workspacePath)
97
- } else {
98
- window.localStorage.removeItem(options.workspaceStorageKey)
99
- }
56
+ if (conversation.workspacePath) window.localStorage.setItem(options.workspaceStorageKey, conversation.workspacePath)
57
+ else window.localStorage.removeItem(options.workspaceStorageKey)
100
58
  } catch {
101
59
  // Workspace persistence is best-effort in private browsing modes.
102
60
  }
@@ -5,13 +5,13 @@
5
5
 
6
6
  /* --- Run Summary Dashboard --- */
7
7
  .run-summary-card {
8
- border-radius: var(--radius-lg, 10px);
8
+ border-radius: var(--radius-lg, 12px);
9
9
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
10
10
  background: color-mix(in srgb, var(--surface-bg, #252527) 80%, transparent);
11
11
  backdrop-filter: var(--glass-blur, blur(12px));
12
12
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
13
- padding: 12px 14px;
14
- margin-bottom: 10px;
13
+ padding: 12px;
14
+ margin-bottom: 0;
15
15
  color: var(--text-main, #e8e8ea);
16
16
  min-width: 0;
17
17
  max-width: 100%;
@@ -23,11 +23,10 @@
23
23
  align-items: center;
24
24
  justify-content: space-between;
25
25
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
26
- padding-bottom: 8px;
26
+ padding-bottom: 10px;
27
27
  margin-bottom: 10px;
28
- gap: 8px;
28
+ gap: 10px;
29
29
  min-width: 0;
30
- flex-wrap: wrap;
31
30
  }
32
31
 
33
32
  .run-summary-title,
@@ -36,20 +35,17 @@
36
35
  max-width: 100%;
37
36
  }
38
37
 
39
- .run-summary-title span {
40
- overflow: hidden;
41
- text-overflow: ellipsis;
42
- white-space: nowrap;
43
- }
44
-
45
38
  .run-summary-title {
46
39
  display: flex;
47
40
  align-items: center;
48
- gap: 8px;
49
- font-size: 0.82rem;
50
- font-weight: 600;
41
+ flex: 1 1 auto;
42
+ gap: 9px;
51
43
  color: var(--text-main, #e8e8ea);
52
44
  }
45
+ .run-summary-title > svg { flex: 0 0 auto; color: var(--accent, #10b981); }
46
+ .run-summary-heading { display: grid; gap: 2px; min-width: 0; }
47
+ .run-summary-heading strong { font-size: 0.8rem; font-weight: 650; line-height: 1.25; }
48
+ .run-summary-heading small { overflow: hidden; color: var(--text-muted); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.65rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
53
49
 
54
50
  .run-summary-badge {
55
51
  display: inline-flex;
@@ -59,6 +55,7 @@
59
55
  border-radius: var(--radius-full, 999px);
60
56
  font-size: 0.72rem;
61
57
  font-weight: 600;
58
+ white-space: nowrap;
62
59
  }
63
60
 
64
61
  .run-summary-badge.success {
@@ -81,16 +78,17 @@
81
78
 
82
79
  .run-kpi-grid {
83
80
  display: grid;
84
- grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
81
+ grid-template-columns: repeat(2, minmax(0, 1fr));
85
82
  gap: 8px;
86
83
  min-width: 0;
87
84
  }
85
+ @media (max-width: 360px) { .run-kpi-grid { grid-template-columns: minmax(0, 1fr); } }
88
86
 
89
87
  .run-kpi-box {
90
- background: color-mix(in srgb, var(--input-bg, #2c2c2e) 60%, transparent);
91
- border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
88
+ background: var(--bg-surface-soft, color-mix(in srgb, var(--input-bg, #2c2c2e) 45%, transparent));
89
+ border: 1px solid var(--border-subtle, var(--border));
92
90
  border-radius: var(--radius-md, 8px);
93
- padding: 8px 10px;
91
+ padding: 9px 10px;
94
92
  display: flex;
95
93
  flex-direction: column;
96
94
  gap: 3px;
@@ -107,8 +105,9 @@
107
105
  }
108
106
 
109
107
  .run-kpi-value {
110
- font-size: 0.95rem;
111
- font-weight: 700;
108
+ font-size: 1rem;
109
+ font-variant-numeric: tabular-nums;
110
+ font-weight: 650;
112
111
  color: var(--text-main, #e8e8ea);
113
112
  }
114
113