@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.
- package/Cargo.lock +1012 -69
- package/Cargo.toml +5 -2
- package/LICENSE +21 -654
- package/README.md +92 -817
- package/Release_Note.md +53 -560
- package/apps/mint-companion/src-tauri/Cargo.toml +20 -0
- package/apps/mint-companion/src-tauri/build.rs +3 -0
- package/apps/mint-companion/src-tauri/src/main.rs +468 -0
- package/apps/mint-companion/tsconfig.json +20 -0
- package/apps/mint-companion/vite.config.ts +3 -0
- package/components.json +19 -0
- package/crates/mint-cli/Cargo.toml +6 -0
- package/crates/mint-cli/src/agent/live_status.rs +187 -39
- package/crates/mint-cli/src/agent.rs +323 -95
- package/crates/mint-cli/src/commands/agent.rs +69 -55
- package/crates/mint-cli/src/commands/integrations.rs +7 -0
- package/crates/mint-cli/src/commands/knowledge.rs +12 -32
- package/crates/mint-cli/src/commands/mod.rs +44 -0
- package/crates/mint-cli/src/image.rs +31 -33
- package/crates/mint-cli/src/interactive/chat_tui.rs +3594 -483
- package/crates/mint-cli/src/interactive/input_box.rs +56 -6
- package/crates/mint-cli/src/interactive/slash_commands.rs +208 -56
- package/crates/mint-cli/src/interactive/tool_activity.rs +328 -0
- package/crates/mint-cli/src/interactive.rs +64 -40
- package/crates/mint-cli/src/main.rs +13 -7
- package/crates/mint-cli/src/mcp.rs +5 -0
- package/crates/mint-cli/src/mod_host.rs +6 -0
- package/crates/mint-cli/src/mods_cli.rs +62 -0
- package/crates/mint-cli/src/mods_ui.rs +187 -0
- package/crates/mint-cli/src/onboard.rs +5 -31
- package/crates/mint-cli/src/terminal_theme.rs +3 -1
- package/crates/mint-cli/src/updater.rs +56 -2
- package/crates/mint-cli/tests/library_intake.rs +77 -0
- package/crates/mint-cli/tests/mods_testing.rs +133 -0
- package/crates/mint-companion-protocol/Cargo.toml +10 -0
- package/crates/mint-companion-protocol/src/lib.rs +163 -0
- package/crates/mint-core/Cargo.toml +6 -3
- package/crates/mint-core/build.rs +26 -0
- package/crates/mint-core/src/agent/chat.rs +167 -39
- package/crates/mint-core/src/agent/code_tools.rs +15 -0
- package/crates/mint-core/src/agent/memory/sources.rs +240 -0
- package/crates/mint-core/src/agent/memory.rs +147 -13
- package/crates/mint-core/src/agent/skill_inventory.rs +325 -0
- package/crates/mint-core/src/agent/skills.rs +437 -90
- package/crates/mint-core/src/agent.rs +1 -0
- package/crates/mint-core/src/api_server/routes/background_jobs.rs +310 -0
- package/crates/mint-core/src/api_server/routes/chat.rs +216 -199
- package/crates/mint-core/src/api_server/routes/html_preview.rs +77 -0
- package/crates/mint-core/src/api_server/routes/library.rs +97 -0
- package/crates/mint-core/src/api_server/routes/media_gen.rs +10 -57
- package/crates/mint-core/src/api_server/routes/misc.rs +104 -107
- package/crates/mint-core/src/api_server/routes/mod.rs +6 -0
- package/crates/mint-core/src/api_server/routes/mods.rs +31 -0
- package/crates/mint-core/src/api_server/routes/sessions.rs +41 -0
- package/crates/mint-core/src/api_server/routes/skills_subagents.rs +12 -42
- package/crates/mint-core/src/api_server/routes/slash.rs +50 -1
- package/crates/mint-core/src/api_server/routes/sources.rs +101 -0
- package/crates/mint-core/src/api_server.rs +118 -9
- package/crates/mint-core/src/avatar_bridge.rs +11 -2
- package/crates/mint-core/src/browser/session.rs +52 -0
- package/crates/mint-core/src/companion.rs +716 -0
- package/crates/mint-core/src/cron/scheduler.rs +34 -2
- package/crates/mint-core/src/integrations/channels.rs +87 -345
- package/crates/mint-core/src/integrations/mcp.rs +397 -50
- package/crates/mint-core/src/integrations/mcp_calls.rs +823 -0
- package/crates/mint-core/src/integrations/mcp_catalog.rs +267 -0
- package/crates/mint-core/src/integrations/mcp_device.rs +319 -0
- package/crates/mint-core/src/integrations/mcp_result.rs +356 -0
- package/crates/mint-core/src/integrations/webhooks.rs +539 -0
- package/crates/mint-core/src/integrations.rs +2 -0
- package/crates/mint-core/src/lib.rs +85 -26
- package/crates/mint-core/src/media/gemini_live.rs +134 -14
- package/crates/mint-core/src/media/image_models.rs +3 -27
- package/crates/mint-core/src/media/image_workflow.rs +216 -0
- package/crates/mint-core/src/media/library/intake.rs +144 -0
- package/crates/mint-core/src/media/library/migration.rs +56 -0
- package/crates/mint-core/src/media/library/removal.rs +55 -0
- package/crates/mint-core/src/media/library/tests.rs +730 -0
- package/crates/mint-core/src/media/library/thumbnails.rs +72 -0
- package/crates/mint-core/src/media/library.rs +545 -0
- package/crates/mint-core/src/media/model_catalog.rs +375 -0
- package/crates/mint-core/src/media/pictures.rs +79 -222
- package/crates/mint-core/src/media/video_models.rs +3 -22
- package/crates/mint-core/src/media.rs +3 -0
- package/crates/mint-core/src/mods/manager.rs +1124 -0
- package/crates/mint-core/src/mods/mod.rs +569 -0
- package/crates/mint-core/src/mods/operations.rs +204 -0
- package/crates/mint-core/src/mods/session.rs +146 -0
- package/crates/mint-core/src/mods/slash.rs +59 -0
- package/crates/mint-core/src/mods/telemetry.rs +306 -0
- package/crates/mint-core/src/orchestration/approvals.rs +344 -0
- package/crates/mint-core/src/orchestration/context_render.rs +104 -0
- package/crates/mint-core/src/orchestration/mcp_review.rs +153 -0
- package/crates/mint-core/src/orchestration/memory_skill.rs +104 -32
- package/crates/mint-core/src/orchestration/mod.rs +2139 -244
- package/crates/mint-core/src/orchestration/mod_authoring_regressions.rs +209 -0
- package/crates/mint-core/src/orchestration/progress_clock.rs +80 -0
- package/crates/mint-core/src/orchestration/repeated_failures.rs +116 -0
- package/crates/mint-core/src/orchestration/review_regressions.rs +449 -0
- package/crates/mint-core/src/orchestration/run_control.rs +196 -0
- package/crates/mint-core/src/orchestration/tools/files.rs +161 -14
- package/crates/mint-core/src/orchestration/tools/media.rs +37 -41
- package/crates/mint-core/src/orchestration/tools/misc.rs +3 -2
- package/crates/mint-core/src/orchestration/tools/mod.rs +2 -0
- package/crates/mint-core/src/orchestration/tools/mods.rs +161 -0
- package/crates/mint-core/src/orchestration/tools/plugins_mcp.rs +303 -71
- package/crates/mint-core/src/orchestration/tools/shell.rs +95 -2
- package/crates/mint-core/src/orchestration/workspace_helpers.rs +4 -1
- package/crates/mint-core/src/prompts/agent.rs +17 -2
- package/crates/mint-core/src/prompts/tool_catalog.rs +28 -2
- package/crates/mint-core/src/search/knowledge.rs +7 -1
- package/crates/mint-core/src/search/linked_folders/index.rs +177 -13
- package/crates/mint-core/src/search/linked_folders.rs +83 -2
- package/crates/mint-core/src/slash/catalog.rs +1 -1
- package/crates/mint-core/src/slash/mod.rs +174 -11
- package/crates/mint-core/src/slash/mods.rs +155 -0
- package/crates/mint-core/src/system/bg_shell.rs +1129 -95
- package/crates/mint-core/src/system/config.rs +5 -10
- package/crates/mint-core/src/system/html_preview.rs +398 -0
- package/crates/mint-core/src/system/mint_web.rs +164 -0
- package/crates/mint-core/src/system/release_notes.rs +18 -0
- package/crates/mint-core/src/system/shell.rs +21 -6
- package/crates/mint-core/src/system/workspace.rs +72 -8
- package/crates/mint-core/src/system/workspace_history.rs +604 -0
- package/crates/mint-core/src/system.rs +4 -0
- package/crates/mint-core/tests/background_retention.rs +34 -0
- package/crates/mint-core/tests/background_shutdown.rs +24 -0
- package/crates/mint-core/tests/library_http.rs +209 -0
- package/crates/mint-core/tests/mcp_contract.rs +283 -0
- package/crates/mint-core/tests/mcp_stdio.rs +11 -10
- package/crates/mint-core/tests/media_model_catalog_http.rs +403 -0
- package/crates/mint-core/tests/mods_http.rs +215 -0
- package/crates/mint-core/tests/terminal_shutdown.rs +109 -0
- package/crates/mint-mod-runtime/Cargo.toml +18 -0
- package/crates/mint-mod-runtime/src/lib.rs +507 -0
- package/crates/mint-mod-runtime/src/sdk.js +56 -0
- package/crates/mint-mod-runtime/src/test_sdk.js +32 -0
- package/crates/mint-mod-runtime/src/testing.rs +94 -0
- package/crates/mint-mod-runtime/tests/runtime.rs +156 -0
- package/docs/mods/AUTHORING.md +61 -0
- package/docs/mods/README.md +139 -0
- package/docs/mods/TESTING.md +56 -0
- package/docs/mods/mint-mods.d.ts +66 -0
- package/examples/device-mcp/README.md +22 -0
- package/examples/device-mcp/contract.md +49 -0
- package/examples/device-mcp/mock-device.mjs +66 -0
- package/examples/device-mcp/server.mjs +48 -0
- package/examples/device-mcp/server.test.mjs +78 -0
- package/examples/mods/task-checklist/README.md +1 -0
- package/examples/mods/task-checklist/main.ts +17 -0
- package/examples/mods/task-checklist/manifest.json +1 -0
- package/examples/mods/task-checklist/tests/checklist.test.ts +15 -0
- package/examples/mods/token-meter/README.md +1 -0
- package/examples/mods/token-meter/main.ts +8 -0
- package/examples/mods/token-meter/manifest.json +1 -0
- package/examples/mods/tool-guard/README.md +1 -0
- package/examples/mods/tool-guard/main.ts +9 -0
- package/examples/mods/tool-guard/manifest.json +1 -0
- package/out/web/assets/CliSessionsView-CtzUJpK_.css +1 -0
- package/out/web/assets/CliSessionsView-D7hw0Mgj.js +1 -0
- package/out/web/assets/CodeReviewPage-C7bEOJfd.js +4 -0
- package/out/web/assets/CodeReviewPage-Dte9uLiL.css +1 -0
- package/out/web/assets/CommandPalette-0RrF-AOT.js +1 -0
- package/out/web/assets/ImageStudioPanel-CdxkAf_r.js +1 -0
- package/out/web/assets/LibraryPage--Qfisp6D.js +2 -0
- package/out/web/assets/LibraryPage-DAxUTAg7.css +1 -0
- package/out/web/assets/LinkedFoldersView-2nfZbDgN.js +1 -0
- package/out/web/assets/McpRegistryPicker-h9uS8_wT.js +1 -0
- package/out/web/assets/McpServersView-slfQJzNB.js +1 -0
- package/out/web/assets/MintDashboard-BSR5XpXh.js +25 -0
- package/out/web/assets/MintDashboard-CWUcCGhd.css +1 -0
- package/out/web/assets/PluginsView-l7LSm503.js +1 -0
- package/out/web/assets/ScheduledTasksView-CttmLbq1.js +1 -0
- package/out/web/assets/SettingsWindow-BCMLYvEV.js +4 -0
- package/out/web/assets/SettingsWindow-DcMVmU9u.css +1 -0
- package/out/web/assets/SkillsView-rNs1qr_U.js +2 -0
- package/out/web/assets/ToolSurfacePage-B9DzEPWN.js +37 -0
- package/out/web/assets/ToolSurfacePage-CTfgggF2.css +1 -0
- package/out/web/assets/VeoStudioPanel-DiJs_Cg2.js +4 -0
- package/out/web/assets/WorkspaceSelector-B2xIp04D.js +1 -0
- package/out/web/assets/WorkspaceSelector-Ca8uJOsS.css +1 -0
- package/out/web/assets/{abnfDiagram-VCTEODGH-ByMyfanq.js → abnfDiagram-VCTEODGH-CD0CjoGl.js} +1 -1
- package/out/web/assets/{architecture-7GRP2DOG-CLq2kEOB.js → architecture-7GRP2DOG-RKV83OeZ.js} +1 -1
- package/out/web/assets/{architectureDiagram-5GKGNRK7-6PoVSmNG.js → architectureDiagram-5GKGNRK7-nN_HAFct.js} +1 -1
- package/out/web/assets/{blockDiagram-NRAW4CY4-cKw9mAKi.js → blockDiagram-NRAW4CY4-BrrqzHW5.js} +1 -1
- package/out/web/assets/{c4Diagram-UCG6FXSJ-Cqy8N5Ge.js → c4Diagram-UCG6FXSJ-DTdV8_zE.js} +1 -1
- package/out/web/assets/{chunk-75Z2AOVW-3qybijF5.js → chunk-75Z2AOVW-_M0z5olV.js} +1 -1
- package/out/web/assets/chunk-CKBBP62Z-BpQEgeHF.js +2 -0
- package/out/web/assets/{chunk-CLGD4ZFX-CndDQkww.js → chunk-CLGD4ZFX-D54yGvGS.js} +1 -1
- package/out/web/assets/{chunk-DSNCTWBM-Cc4NxvgD.js → chunk-DSNCTWBM-C-gvT2ru.js} +1 -1
- package/out/web/assets/{chunk-DU6HZSFF-drzh6GsU.js → chunk-DU6HZSFF-CnFngIhW.js} +1 -1
- package/out/web/assets/{chunk-F27PBJKO-FiY35l4v.js → chunk-F27PBJKO-BqtWrnEO.js} +1 -1
- package/out/web/assets/{chunk-G27WJ6UU-Bjt9Il4A.js → chunk-G27WJ6UU-Ckoq5mi2.js} +1 -1
- package/out/web/assets/{chunk-GMAD6QVW-Bppi3Ctd.js → chunk-GMAD6QVW-BuhEcgHq.js} +1 -1
- package/out/web/assets/{chunk-JQ64N6SF-DGg5kcEV.js → chunk-JQ64N6SF-CF8T7GiZ.js} +1 -1
- package/out/web/assets/{chunk-LCL6LL3I-CCYcjd7p.js → chunk-LCL6LL3I-BhXV9zyH.js} +1 -1
- package/out/web/assets/{chunk-OBVCFTLP-DJeNil5M.js → chunk-OBVCFTLP-CRIkunUB.js} +1 -1
- package/out/web/assets/{chunk-P2QGCYS3-lRzkRjBB.js → chunk-P2QGCYS3-UFEU6BxZ.js} +1 -1
- package/out/web/assets/{chunk-POPQ4Y6H-DouASMBW.js → chunk-POPQ4Y6H-CQcrNbjr.js} +1 -1
- package/out/web/assets/{chunk-PWAF6VOD-DMmD1vVf.js → chunk-PWAF6VOD-Cc2uVDsG.js} +1 -1
- package/out/web/assets/{chunk-R7TYR2AO-CYLA5UC5.js → chunk-R7TYR2AO-DiCxzdAY.js} +1 -1
- package/out/web/assets/{chunk-RHFEMEQ7-BiXwEcUT.js → chunk-RHFEMEQ7-b7hnPmrR.js} +1 -1
- package/out/web/assets/{chunk-SVP7TREG-BV-zPslF.js → chunk-SVP7TREG-Bu_yYb-V.js} +1 -1
- package/out/web/assets/{chunk-TEH6E4GO-B2RGEohZ.js → chunk-TEH6E4GO-G4Cdlyrt.js} +1 -1
- package/out/web/assets/classDiagram-DTDB5LWJ-RnC2mYO4.js +1 -0
- package/out/web/assets/classDiagram-v2-JRS7N3AN-RnC2mYO4.js +1 -0
- package/out/web/assets/config-CnvCChUM.js +2 -0
- package/out/web/assets/config-DM6oIVO3.css +1 -0
- package/out/web/assets/core-DsKkQ7ig.js +1 -0
- package/out/web/assets/{cynefin-OW5HDTMX-Cas4csHM.js → cynefin-OW5HDTMX-CnzQfOGp.js} +1 -1
- package/out/web/assets/{cynefinDiagram-5FMLGOSQ-Bbpj66Y3.js → cynefinDiagram-5FMLGOSQ-DVtQnfpm.js} +1 -1
- package/out/web/assets/{dagre-3AP2YEHR-B0-2RDEd.js → dagre-3AP2YEHR-DG76_k5_.js} +1 -1
- package/out/web/assets/{diagram-S7CK7UJ4-BdzEjUyH.js → diagram-S7CK7UJ4-CaouUoze.js} +1 -1
- package/out/web/assets/{diagram-UQ7AKVKN-CJDwyPxF.js → diagram-UQ7AKVKN-B4bEc26B.js} +1 -1
- package/out/web/assets/{diagram-VSXAHHWV-BxaG1r_B.js → diagram-VSXAHHWV-BJ86Ov2Y.js} +1 -1
- package/out/web/assets/{diagram-VX7I27RA-BMmUqm8f.js → diagram-VX7I27RA-7hH5IPYf.js} +1 -1
- package/out/web/assets/{diagram-Z3DM3KII-CFtd03eE.js → diagram-Z3DM3KII-CCM4clo8.js} +1 -1
- package/out/web/assets/dist-js-BkYNznHX.js +1 -0
- package/out/web/assets/{ebnfDiagram-PWID7BFC-DwAen1hO.js → ebnfDiagram-PWID7BFC-Da7WAM3k.js} +1 -1
- package/out/web/assets/{erDiagram-SSCWMZ5O-BCZSHACj.js → erDiagram-SSCWMZ5O-CzzmnZWT.js} +1 -1
- package/out/web/assets/{event-ChBVpRy0.js → event-Cdt7Byyj.js} +1 -1
- package/out/web/assets/{eventmodeling-NTZA5JFV-XHStE4E_.js → eventmodeling-NTZA5JFV-xcfsA0XD.js} +1 -1
- package/out/web/assets/flowDiagram-A5DVABFB-JdtH1673.js +1 -0
- package/out/web/assets/{ganttDiagram-EL5Y4UJY-BAEu1Cql.js → ganttDiagram-EL5Y4UJY-B3ClFGmL.js} +1 -1
- package/out/web/assets/{gitGraph-4MIJSDKK-r32Vyper.js → gitGraph-4MIJSDKK-BZ_y_cDU.js} +1 -1
- package/out/web/assets/{gitGraphDiagram-WWUBYQGX-z9o9qt6V.js → gitGraphDiagram-WWUBYQGX-drhRSYm3.js} +1 -1
- package/out/web/assets/index-BZ9xgmMP.css +1 -0
- package/out/web/assets/index-Ca8cCS4h.js +168 -0
- package/out/web/assets/{info-A6RAGUB7-BvLaC2cw.js → info-A6RAGUB7-B7I3K0F1.js} +1 -1
- package/out/web/assets/{infoDiagram-RXCK75RN-Be6WAXXw.js → infoDiagram-RXCK75RN-deX_1MPh.js} +1 -1
- package/out/web/assets/{ishikawaDiagram-5VMMS53U-DZjoHJHC.js → ishikawaDiagram-5VMMS53U-s38yo28y.js} +1 -1
- package/out/web/assets/{journeyDiagram-EYS64GPL-CtVkjkGm.js → journeyDiagram-EYS64GPL-CZn2kB8b.js} +1 -1
- package/out/web/assets/jsx-runtime-DN4NhQUK.js +1 -0
- package/out/web/assets/{kanban-definition-3QL26DDD-CW5FMv1w.js → kanban-definition-3QL26DDD-DodjgySL.js} +1 -1
- package/out/web/assets/markdown-CMhYIcWB.js +39 -0
- package/out/web/assets/{mermaid-parser.core-aUgCqsZ5.js → mermaid-parser.core-Whu2rlJC.js} +3 -3
- package/out/web/assets/{mermaid.core-D57sEiSL.js → mermaid.core-CKyPo8VH.js} +4 -4
- package/out/web/assets/{mindmap-definition-FBJOCRG2-DAmSpM3a.js → mindmap-definition-FBJOCRG2-260WBDxZ.js} +1 -1
- package/out/web/assets/modelManager-CUaGWMWu.js +2 -0
- package/out/web/assets/{oauthManager-9jxicDWJ.js → oauthManager-DlNhXJr6.js} +1 -1
- package/out/web/assets/{packet-AYTQ26CC-DJ27iIoJ.js → packet-AYTQ26CC-CEeIRKRG.js} +1 -1
- package/out/web/assets/{pegDiagram-XKGWAZYB-Bj3ii-gS.js → pegDiagram-XKGWAZYB-BYadI-KO.js} +1 -1
- package/out/web/assets/{pie-WAS4IAKB-DG5mCUbc.js → pie-WAS4IAKB-D8uf4dh5.js} +1 -1
- package/out/web/assets/{pieDiagram-E7YTZNPT-BrJLPnDA.js → pieDiagram-E7YTZNPT-CjSDy4hO.js} +1 -1
- package/out/web/assets/{quadrantDiagram-AXDQQJYC-3x_TmF3j.js → quadrantDiagram-AXDQQJYC-B8D3gU5d.js} +1 -1
- package/out/web/assets/{radar-RG4KPBEZ-CrXaTTuV.js → radar-RG4KPBEZ-DZJxnokY.js} +1 -1
- package/out/web/assets/{railroad-74A4TZTK-BpqMH9BE.js → railroad-74A4TZTK-DBysUiUi.js} +1 -1
- package/out/web/assets/{railroad-abnf-HS5TGJTU-DHI0uLlV.js → railroad-abnf-HS5TGJTU-CHWxoJYg.js} +1 -1
- package/out/web/assets/{railroad-ebnf-LZEXJU2U-CQCb316y.js → railroad-ebnf-LZEXJU2U-DDv7X6bY.js} +1 -1
- package/out/web/assets/{railroad-peg-WCYAUIDC-Ph1giKkH.js → railroad-peg-WCYAUIDC-DpfcYYNJ.js} +1 -1
- package/out/web/assets/{railroadDiagram-O6MQD6OU-BRq6wIxx.js → railroadDiagram-O6MQD6OU-CYtyv0t3.js} +1 -1
- package/out/web/assets/{requirementDiagram-EFPCY7ZU-DIJj6G1g.js → requirementDiagram-EFPCY7ZU-D2X-Ewik.js} +1 -1
- package/out/web/assets/{sankeyDiagram-P5KCCOFB-DZajSryq.js → sankeyDiagram-P5KCCOFB-Bn2x6C4Y.js} +1 -1
- package/out/web/assets/{sequenceDiagram-WJ2MYXX4-DxJCWyZS.js → sequenceDiagram-WJ2MYXX4-BvFLKtPd.js} +1 -1
- package/out/web/assets/{stateDiagram-HBIQ2CUA-k6voi8Vf.js → stateDiagram-HBIQ2CUA-Bx0GWeaY.js} +1 -1
- package/out/web/assets/stateDiagram-v2-4QOOHH4V--hol1yg_.js +1 -0
- package/out/web/assets/{swimlanes-XN3QIQJK-igYhTjXB.js → swimlanes-XN3QIQJK-CCma0T7L.js} +1 -1
- package/out/web/assets/swimlanesDiagram-VK2B7HYN-BkohoVsU.js +8 -0
- package/out/web/assets/{timeline-definition-24CTP7MA-Dke2p93p.js → timeline-definition-24CTP7MA-iCRhhJ7C.js} +1 -1
- package/out/web/assets/{treeView-Q6P3EWNA-hNELnXUs.js → treeView-Q6P3EWNA-DZ-y08qp.js} +1 -1
- package/out/web/assets/{treemap-WGGIJYW6-D2B6wDsx.js → treemap-WGGIJYW6-De0CxzMx.js} +1 -1
- package/out/web/assets/{vennDiagram-4TSXK5OY-CDkW7rUP.js → vennDiagram-4TSXK5OY-w_7aZ6xe.js} +1 -1
- package/out/web/assets/{wardley-WFR3VGLG-BECdXETi.js → wardley-WFR3VGLG-DT0y0xJ4.js} +1 -1
- package/out/web/assets/{wardleyDiagram-VM6X3IG4-B5BycpQ4.js → wardleyDiagram-VM6X3IG4-DAdXELbQ.js} +1 -1
- package/out/web/assets/window-BJCVtyET.js +1 -0
- package/out/web/assets/{xychartDiagram-S5SC5T6Z-CtJS3b--.js → xychartDiagram-S5SC5T6Z-IZIXf3Vo.js} +1 -1
- package/out/web/index-web.html +3 -2
- package/out/web/index.html +3 -2
- package/package.json +71 -22
- package/shared-modules/.github/workflows/ci.yml +120 -0
- package/shared-modules/.github/workflows/update.yaml +28 -0
- package/slash-commands.json +7 -2
- package/src/bin/auto-build.js +66 -0
- package/src/bin/desktop.js +113 -0
- package/src/bin/desktop.test.js +113 -0
- package/src/bin/index.js +18 -25
- package/src/bin/index.test.js +89 -0
- package/src/bin/measure-effects.mjs +53 -0
- package/src/bin/package.test.js +28 -0
- package/src/bin/release-notes.test.js +84 -0
- package/src/bin/styles.test.js +20 -0
- package/src/bin/web.js +5 -0
- package/src/bin/web.test.js +39 -0
- package/src/renderer/index.html +0 -2
- package/src/renderer/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/src/renderer/shared/agentProgress.ts +33 -0
- package/src/renderer/shared/components/AgentActivityDrawer.tsx +3 -2
- package/src/renderer/shared/components/AgentActivityTable.tsx +1 -1
- package/src/renderer/shared/components/ApprovalCard.test.tsx +24 -0
- package/src/renderer/shared/components/ApprovalCard.tsx +10 -3
- package/src/renderer/shared/components/ArtifactPreviewPanel.tsx +88 -37
- package/src/renderer/shared/components/AuthGate.tsx +75 -39
- package/src/renderer/shared/components/BackgroundTerminals.tsx +181 -0
- package/src/renderer/shared/components/ChatCodeBlock.tsx +8 -4
- package/src/renderer/shared/components/ChatMessageItem.test.tsx +68 -0
- package/src/renderer/shared/components/ChatMessageItem.tsx +36 -16
- package/src/renderer/shared/components/ChatPanel.test.tsx +21 -0
- package/src/renderer/shared/components/ChatPanel.tsx +294 -272
- package/src/renderer/shared/components/ChunkErrorBoundary.tsx +4 -102
- package/src/renderer/shared/components/CliSessionsView.test.tsx +125 -0
- package/src/renderer/shared/components/CliSessionsView.tsx +61 -13
- package/src/renderer/shared/components/CodeReviewPage.tsx +111 -8
- package/src/renderer/shared/components/CollapsiblePasteInput.tsx +90 -0
- package/src/renderer/shared/components/ContextCompactionStatus.tsx +17 -0
- package/src/renderer/shared/components/DashboardSidebar.tsx +15 -128
- package/src/renderer/shared/components/DesktopTitlebar.tsx +45 -19
- package/src/renderer/shared/components/ErrorNotice.tsx +29 -0
- package/src/renderer/shared/components/FormattedMessage.tsx +11 -0
- package/src/renderer/shared/components/GeminiLiveOverlay.css +86 -0
- package/src/renderer/shared/components/GeminiLiveOverlay.test.tsx +24 -0
- package/src/renderer/shared/components/GeminiLiveOverlay.tsx +85 -101
- package/src/renderer/shared/components/GlideSelect.css +138 -0
- package/src/renderer/shared/components/GlideSelect.d.ts +31 -0
- package/src/renderer/shared/components/GlideSelect.jsx +266 -0
- package/src/renderer/shared/components/ImageSearchCard.tsx +46 -56
- package/src/renderer/shared/components/ImageStudioPanel.tsx +9 -8
- package/src/renderer/shared/components/LibraryItemCard.tsx +72 -0
- package/src/renderer/shared/components/LibraryPage.tsx +165 -0
- package/src/renderer/shared/components/LibraryPreview.tsx +59 -0
- package/src/renderer/shared/components/McpServersView.tsx +27 -8
- package/src/renderer/shared/components/McpToolAllowlist.tsx +2 -4
- package/src/renderer/shared/components/McpToolResults.tsx +99 -0
- package/src/renderer/shared/components/MintDashboard.tsx +308 -770
- package/src/renderer/shared/components/ModSessionControls.tsx +8 -0
- package/src/renderer/shared/components/ModUi.test.tsx +65 -0
- package/src/renderer/shared/components/ModUi.tsx +26 -0
- package/src/renderer/shared/components/ModelSelectorPopover.tsx +14 -7
- package/src/renderer/shared/components/ModsPanel.tsx +156 -0
- package/src/renderer/shared/components/ProgressActivity.tsx +17 -0
- package/src/renderer/shared/components/ReviewHistory.tsx +42 -0
- package/src/renderer/shared/components/RewindModal.tsx +5 -12
- package/src/renderer/shared/components/RunSummaryDashboard.tsx +6 -12
- package/src/renderer/shared/components/ScheduledTasksView.tsx +7 -6
- package/src/renderer/shared/components/SelectField.test.tsx +27 -0
- package/src/renderer/shared/components/SelectField.tsx +38 -0
- package/src/renderer/shared/components/SessionSources.tsx +48 -0
- package/src/renderer/shared/components/SessionSourcesPopover.tsx +61 -0
- package/src/renderer/shared/components/Settings/AgentsTab.tsx +7 -6
- package/src/renderer/shared/components/Settings/AudioTab.tsx +8 -7
- package/src/renderer/shared/components/Settings/AutomationTab.tsx +2 -2
- package/src/renderer/shared/components/Settings/GeneralTab.tsx +33 -32
- package/src/renderer/shared/components/Settings/MemoryTab.test.tsx +37 -0
- package/src/renderer/shared/components/Settings/MemoryTab.tsx +71 -31
- package/src/renderer/shared/components/Settings/NotificationsTab.test.tsx +15 -0
- package/src/renderer/shared/components/Settings/NotificationsTab.tsx +84 -0
- package/src/renderer/shared/components/Settings/ThemeTab.tsx +19 -11
- package/src/renderer/shared/components/SlashChoicePanel.tsx +88 -0
- package/src/renderer/shared/components/SlashSuggestions.test.tsx +33 -0
- package/src/renderer/shared/components/SlashSuggestions.tsx +38 -10
- package/src/renderer/shared/components/SourcesBlock.tsx +12 -20
- package/src/renderer/shared/components/ToolSurfacePage.test.tsx +32 -0
- package/src/renderer/shared/components/ToolSurfacePage.tsx +59 -11
- package/src/renderer/shared/components/ToolsPanelToggle.tsx +13 -0
- package/src/renderer/shared/components/VeoStudioPanel.tsx +9 -8
- package/src/renderer/shared/components/ViewedImages.tsx +36 -0
- package/src/renderer/shared/components/VirtualChatHistory.tsx +82 -0
- package/src/renderer/shared/components/VoicePill.css +85 -0
- package/src/renderer/shared/components/VoicePill.d.ts +12 -0
- package/src/renderer/shared/components/VoicePill.jsx +190 -0
- package/src/renderer/shared/components/VoicePill.test.tsx +22 -0
- package/src/renderer/shared/components/WorkspaceContextPopover.tsx +20 -15
- package/src/renderer/shared/components/WorkspacePaneResizer.tsx +92 -0
- package/src/renderer/shared/components/WorkspacePreviewActions.test.tsx +44 -0
- package/src/renderer/shared/components/WorkspacePreviewActions.tsx +19 -0
- package/src/renderer/shared/components/WorkspaceSelector.tsx +13 -8
- package/src/renderer/shared/components/background-terminals.css +292 -0
- package/src/renderer/shared/components/ui/README.md +52 -0
- package/src/renderer/shared/components/ui/button.tsx +37 -0
- package/src/renderer/shared/components/ui/demo.tsx +26 -0
- package/src/renderer/shared/components/ui/error-recovery.css +35 -0
- package/src/renderer/shared/components/ui/error-recovery.tsx +35 -0
- package/src/renderer/shared/components/ui/voice-powered-orb.css +6 -0
- package/src/renderer/shared/components/ui/voice-powered-orb.tsx +374 -0
- package/src/renderer/shared/components/workspace-selector.css +248 -0
- package/src/renderer/shared/constants/config.ts +30 -1
- package/src/renderer/shared/constants/slashCommands.ts +1 -1
- package/src/renderer/shared/conversation/lifecycle.test.ts +362 -0
- package/src/renderer/shared/conversation/lifecycle.ts +418 -0
- package/src/renderer/shared/conversation/projectNavigation.test.ts +105 -0
- package/src/renderer/shared/conversation/projectNavigation.ts +39 -0
- package/src/renderer/shared/conversation/sourcesTransport.ts +27 -0
- package/src/renderer/shared/conversation/syncView.test.ts +1 -34
- package/src/renderer/shared/conversation/syncView.ts +0 -37
- package/src/renderer/shared/conversation/transport.test.ts +163 -0
- package/src/renderer/shared/conversation/transport.ts +159 -0
- package/src/renderer/shared/conversation/useConversationCoordinator.ts +30 -72
- package/src/renderer/shared/css/agent-observability.css +20 -21
- package/src/renderer/shared/css/auth-gate.css +112 -13
- package/src/renderer/shared/css/code-review.css +33 -0
- package/src/renderer/shared/css/code-sessions.css +27 -0
- package/src/renderer/shared/css/collapsed-paste.css +35 -0
- package/src/renderer/shared/css/effects.css +15 -0
- package/src/renderer/shared/css/error-notice.css +60 -0
- package/src/renderer/shared/css/library.css +476 -0
- package/src/renderer/shared/css/management-views.css +138 -0
- package/src/renderer/shared/css/mcp-results.css +11 -0
- package/src/renderer/shared/css/model-selector.css +163 -105
- package/src/renderer/shared/css/mods.css +77 -0
- package/src/renderer/shared/css/notification-notice.css +28 -0
- package/src/renderer/shared/css/session-sources-popover.css +9 -0
- package/src/renderer/shared/css/session-sources.css +23 -0
- package/src/renderer/shared/css/settings/memory.css +154 -0
- package/src/renderer/shared/css/settings/notifications.css +11 -0
- package/src/renderer/shared/css/settings/theme.css +5 -0
- package/src/renderer/shared/css/slash-choice.css +95 -0
- package/src/renderer/shared/css/slash-suggestions.css +68 -0
- package/src/renderer/shared/css/sources-block.css +91 -0
- package/src/renderer/shared/css/thinking-status.css +46 -0
- package/src/renderer/shared/css/tools-panel.css +7 -0
- package/src/renderer/shared/css/ui-tailwind.css +19 -0
- package/src/renderer/shared/css/viewed-images.css +15 -0
- package/src/renderer/shared/fonts.css +46 -0
- package/src/renderer/shared/fonts.ts +3 -12
- package/src/renderer/shared/lib/utils.ts +6 -0
- package/src/renderer/shared/library/controller.test.ts +61 -0
- package/src/renderer/shared/library/controller.ts +57 -0
- package/src/renderer/shared/library/transport.test.ts +26 -0
- package/src/renderer/shared/library/transport.ts +60 -0
- package/src/renderer/shared/library/useLibraryFile.ts +38 -0
- package/src/renderer/shared/mods.ts +58 -0
- package/src/renderer/shared/platform.test.ts +57 -1
- package/src/renderer/shared/platform.ts +46 -1
- package/src/renderer/shared/theme/themeManager.test.ts +43 -0
- package/src/renderer/shared/theme/themeManager.ts +17 -4
- package/src/renderer/shared/types.ts +56 -2
- package/src/renderer/shared/utils/agentActivity.test.ts +75 -0
- package/src/renderer/shared/utils/agentActivity.ts +42 -3
- package/src/renderer/shared/utils/approval.tsx +7 -0
- package/src/renderer/shared/utils/artifactBrowser.test.ts +80 -0
- package/src/renderer/shared/utils/artifactBrowser.ts +41 -0
- package/src/renderer/shared/utils/contextCompaction.test.tsx +48 -0
- package/src/renderer/shared/utils/contextCompaction.ts +21 -0
- package/src/renderer/shared/utils/effectVisibility.ts +9 -0
- package/src/renderer/shared/utils/markdown.tsx +3 -3
- package/src/renderer/shared/utils/mcpResults.test.tsx +91 -0
- package/src/renderer/shared/utils/modViewport.ts +7 -0
- package/src/renderer/shared/utils/nativeRecordingSession.test.ts +61 -0
- package/src/renderer/shared/utils/nativeRecordingSession.ts +46 -0
- package/src/renderer/shared/utils/notificationSettings.test.ts +14 -0
- package/src/renderer/shared/utils/notificationSettings.ts +23 -0
- package/src/renderer/shared/utils/notifications.test.ts +51 -0
- package/src/renderer/shared/utils/notifications.ts +54 -0
- package/src/renderer/shared/utils/pastedText.test.ts +20 -0
- package/src/renderer/shared/utils/pastedText.ts +13 -0
- package/src/renderer/shared/utils/progressCache.test.ts +32 -0
- package/src/renderer/shared/utils/sessionSources.test.ts +31 -0
- package/src/renderer/shared/utils/sessionSources.ts +34 -0
- package/src/renderer/shared/utils/slashCommandProcessor.ts +1 -1
- package/src/renderer/shared/utils/sourceAttachments.ts +28 -0
- package/src/renderer/shared/utils/speech.ts +51 -9
- package/src/renderer/shared/utils/syntaxHighlight.test.tsx +22 -0
- package/src/renderer/shared/utils/syntaxHighlight.tsx +26 -0
- package/src/renderer/shared/utils/useGeminiLiveVoice.ts +49 -5
- package/src/renderer/shared/utils/useLatestCallback.ts +9 -0
- package/src/renderer/shared/utils/useNativeVoiceInput.ts +80 -72
- package/src/renderer/shared/utils/useSessionSources.ts +33 -0
- package/src/renderer/shared/utils/viewedImages.ts +26 -0
- package/src/renderer/shared/utils/workspacePane.test.ts +33 -0
- package/src/renderer/shared/utils/workspacePane.ts +20 -0
- package/src/renderer/shared/utils/workspacePreview.test.ts +24 -0
- package/src/renderer/shared/utils/workspacePreview.ts +16 -0
- package/src/renderer/shared/utils/workspaceSnapshot.test.ts +49 -0
- package/src/renderer/shared/utils/workspaceSnapshot.ts +26 -0
- package/src/renderer/shared/utils/workspaces.ts +10 -0
- package/src/renderer/shared/workspaceUndo.ts +88 -0
- package/src/renderer/src/App.tsx +9 -1
- package/src/renderer/src/components/LiveTranslateControls.tsx +65 -0
- package/src/renderer/src/components/PicturesLibrary.tsx +2 -288
- package/src/renderer/src/components/ScreenPicker.css +67 -30
- package/src/renderer/src/components/ScreenPicker.tsx +201 -60
- package/src/renderer/src/components/SettingsWindow.tsx +10 -5
- package/src/renderer/src/components/WorkspacePanel.tsx +222 -32
- package/src/renderer/src/components/browser-shell.css +1 -1
- package/src/renderer/src/components/browser-suggestions-popup.css +1 -1
- package/src/renderer/src/components/liveTranslateFrames.test.ts +26 -5
- package/src/renderer/src/components/liveTranslateFrames.ts +18 -7
- package/src/renderer/src/components/liveTranslateLanguage.ts +6 -0
- package/src/renderer/src/css/app-shell.css +52 -137
- package/src/renderer/src/css/chat.css +21 -495
- package/src/renderer/src/css/desktop-tools.css +199 -1
- package/src/renderer/src/css/misc.css +0 -52
- package/src/renderer/src/css/pictures.css +2 -415
- package/src/renderer/src/css/settings/base.css +50 -47
- package/src/renderer/src/css/sidebar-workspace.css +151 -94
- package/src/renderer/src/css/tool-surfaces.css +65 -9
- package/src/renderer/src/css/widget.css +1 -1
- package/src/renderer/src/env.d.ts +1 -9
- package/src/renderer/src/index.css +1 -1
- package/src/renderer/src/main.tsx +2 -1
- package/src/renderer/src/proactiveSuggestions.ts +29 -0
- package/src/renderer/src/tauri.ts +122 -330
- package/src/renderer/src/voiceInput.ts +2 -1
- package/src/renderer/src-web/components/PicturesLibrary.tsx +2 -285
- package/src/renderer/src-web/components/PullToRefresh.tsx +1 -1
- package/src/renderer/src-web/components/SettingsWindow.tsx +10 -5
- package/src/renderer/src-web/css/app-shell.css +24 -121
- package/src/renderer/src-web/css/chat.css +21 -495
- package/src/renderer/src-web/css/misc.css +0 -52
- package/src/renderer/src-web/css/mobile.css +15 -14
- package/src/renderer/src-web/css/pictures.css +2 -462
- package/src/renderer/src-web/css/settings/base.css +50 -47
- package/src/renderer/src-web/css/sidebar-workspace.css +9 -95
- package/src/renderer/src-web/css/widget.css +1 -1
- package/src/renderer/src-web/env.d.ts +1 -12
- package/src/renderer/src-web/index.css +1 -1
- package/src/renderer/src-web/main.tsx +2 -1
- package/src/renderer/src-web/proactiveSuggestions.ts +3 -0
- package/src/renderer/src-web/tauri.ts +129 -354
- package/src/renderer/tests/backgroundTerminals.browser.html +81 -0
- package/src/renderer/tests/chatPanelFixture.ts +23 -0
- package/src/renderer/tests/chatPerformance.browser.html +71 -0
- package/src/renderer/tests/cliSessions.browser.html +82 -0
- package/src/renderer/tests/collapsedPaste.browser.html +70 -0
- package/src/renderer/tests/composerMenus.browser.html +116 -0
- package/src/renderer/tests/contextCompaction.browser.html +17 -0
- package/src/renderer/tests/conversationLifecycle.browser.html +70 -0
- package/src/renderer/tests/effectsPerformance.browser.html +13 -0
- package/src/renderer/tests/errorRecovery.browser.html +21 -0
- package/src/renderer/tests/glideSelect.browser.html +71 -0
- package/src/renderer/tests/glideSelect.preview.html +27 -0
- package/src/renderer/tests/library.browser.html +1 -0
- package/src/renderer/tests/library.browser.tsx +78 -0
- package/src/renderer/tests/liveOrb.browser.html +49 -0
- package/src/renderer/tests/liveVoice.browser.html +29 -0
- package/src/renderer/tests/modInput.browser.html +22 -0
- package/src/renderer/tests/sessionSources.browser.html +1 -0
- package/src/renderer/tests/sessionSources.browser.tsx +107 -0
- package/src/renderer/tests/skills.browser.html +24 -0
- package/src/renderer/tests/toolsPanel.browser.html +1 -0
- package/src/renderer/tests/toolsPanel.browser.tsx +113 -0
- package/src/renderer/tests/viewedImages.browser.html +1 -0
- package/src/renderer/tests/viewedImages.browser.tsx +93 -0
- package/src/renderer/tests/voicePill.browser.html +80 -0
- package/src/renderer/tests/voicePill.preview.html +34 -0
- package/src/renderer/tests/webSources.browser.html +1 -0
- package/src/renderer/tests/webSources.browser.tsx +98 -0
- package/src/renderer/tests/workspaceUndo.browser.html +92 -0
- package/src-tauri/Cargo.toml +40 -0
- package/src-tauri/build.rs +3 -0
- package/src-tauri/src/app/lifecycle.rs +277 -0
- package/src-tauri/src/app/mod.rs +4 -0
- package/src-tauri/src/app/shortcuts.rs +40 -0
- package/src-tauri/src/app/tray.rs +52 -0
- package/src-tauri/src/background/events.rs +70 -0
- package/src-tauri/src/background/headless.rs +230 -0
- package/src-tauri/src/background/mod.rs +4 -0
- package/src-tauri/src/background/proactive.rs +262 -0
- package/src-tauri/src/commands/approvals.rs +20 -0
- package/src-tauri/src/commands/auth.rs +127 -0
- package/src-tauri/src/commands/conversation.rs +642 -0
- package/src-tauri/src/commands/integrations.rs +157 -0
- package/src-tauri/src/commands/media.rs +179 -0
- package/src-tauri/src/commands/mod.rs +11 -0
- package/src-tauri/src/commands/mods.rs +6 -0
- package/src-tauri/src/commands/settings.rs +141 -0
- package/src-tauri/src/commands/voice.rs +153 -0
- package/src-tauri/src/commands/workspace.rs +501 -0
- package/src-tauri/src/lib.rs +10 -0
- package/src-tauri/src/main.rs +3 -0
- package/src-tauri/src/native/actions.rs +206 -0
- package/src-tauri/src/native/browser.rs +252 -0
- package/src-tauri/src/native/capture.rs +695 -0
- package/src-tauri/src/native/discord_rpc.rs +99 -0
- package/src-tauri/src/native/integrations.rs +126 -0
- package/src-tauri/src/native/mod.rs +12 -0
- package/src-tauri/src/native/notifications.rs +51 -0
- package/src-tauri/src/native/plugins.rs +14 -0
- package/src-tauri/src/native/system.rs +250 -0
- package/src-tauri/src/native/terminal.rs +201 -0
- package/src-tauri/src/native/updater.rs +148 -0
- package/src-tauri/src/native/windows.rs +143 -0
- package/tsconfig.json +2 -0
- package/vite.config.ts +4 -1
- package/vite.config.web.ts +4 -0
- package/.cargo/config.toml +0 -13
- package/.claude/settings.local.json +0 -182
- package/.codex +0 -0
- package/CLAUDE.md +0 -102
- package/ROADMAP.md +0 -30
- package/mint-presentation-demo.mp4 +0 -0
- package/out/web/Live2DCubismCore.js +0 -9
- package/out/web/assets/CliSessionsView-BxUVWEEL.js +0 -1
- package/out/web/assets/CliSessionsView-CBDTXuQv.css +0 -1
- package/out/web/assets/CodeReviewPage-DkMgfcos.css +0 -1
- package/out/web/assets/CodeReviewPage-jKlmLJwT.js +0 -3
- package/out/web/assets/CommandPalette-DnwPA5hy.js +0 -1
- package/out/web/assets/ImageStudioPanel-BR1XFwhR.js +0 -1
- package/out/web/assets/LinkedFoldersView-bi-CWQ-I.js +0 -1
- package/out/web/assets/McpRegistryPicker-D5tEFnyq.js +0 -1
- package/out/web/assets/McpServersView-BGG1dhFM.js +0 -1
- package/out/web/assets/MintDashboard-BIglDEWX.js +0 -20
- package/out/web/assets/MintDashboard-DSMywSgs.css +0 -1
- package/out/web/assets/ModelPanel-CbJ1PFoZ.js +0 -1
- package/out/web/assets/PicturesLibrary-CQP0fLP1.css +0 -1
- package/out/web/assets/PicturesLibrary-DoYN7T1p.js +0 -1
- package/out/web/assets/PluginsView-CU1HWXGk.js +0 -1
- package/out/web/assets/ScheduledTasksView-Bnl36y2N.js +0 -1
- package/out/web/assets/SettingsWindow-DhWLAn9T.css +0 -1
- package/out/web/assets/SettingsWindow-Dw8L01pw.js +0 -2
- package/out/web/assets/SkillsView-cnl8aY5p.js +0 -2
- package/out/web/assets/ToolSurfacePage-CgsQw6l5.css +0 -1
- package/out/web/assets/ToolSurfacePage-Cz2VJAPZ.js +0 -37
- package/out/web/assets/VeoStudioPanel-D4JnERWR.js +0 -4
- package/out/web/assets/chunk-CKBBP62Z-cIrXq6jN.js +0 -2
- package/out/web/assets/classDiagram-DTDB5LWJ-Dq0smRWk.js +0 -1
- package/out/web/assets/classDiagram-v2-JRS7N3AN-Dq0smRWk.js +0 -1
- package/out/web/assets/config-C-ZFtipU.css +0 -1
- package/out/web/assets/config-eEDngJXO.js +0 -1
- package/out/web/assets/core-hQ2VA9Ti.js +0 -1
- package/out/web/assets/dist-js-Bf2bhoku.js +0 -1
- package/out/web/assets/flowDiagram-A5DVABFB-BLg7nEcd.js +0 -1
- package/out/web/assets/index-Btsf4L8M.css +0 -1
- package/out/web/assets/index-D8D9MeRA.js +0 -11
- package/out/web/assets/lucide-react-Ip3L6Jtn.js +0 -1
- package/out/web/assets/markdown-BSeeUbJH.js +0 -38
- package/out/web/assets/modelManager-tMVmJVAW.js +0 -2
- package/out/web/assets/prompt-latin-400-normal-BQ9zjSN8.woff2 +0 -0
- package/out/web/assets/prompt-latin-400-normal-CxU4ec_r.woff +0 -0
- package/out/web/assets/prompt-latin-500-normal-B1edBDQ9.woff +0 -0
- package/out/web/assets/prompt-latin-500-normal-CxzxEHZc.woff2 +0 -0
- package/out/web/assets/prompt-latin-600-normal-CSDDLorv.woff +0 -0
- package/out/web/assets/prompt-latin-600-normal-hKZWXsc1.woff2 +0 -0
- package/out/web/assets/prompt-latin-700-normal-BfbftDSq.woff +0 -0
- package/out/web/assets/prompt-latin-700-normal-I2gc831J.woff2 +0 -0
- package/out/web/assets/prompt-thai-400-normal-BrkKv8cO.woff2 +0 -0
- package/out/web/assets/prompt-thai-400-normal-DJypnfr3.woff +0 -0
- package/out/web/assets/prompt-thai-500-normal-C18pDUoL.woff2 +0 -0
- package/out/web/assets/prompt-thai-500-normal-D7YNqUJD.woff +0 -0
- package/out/web/assets/prompt-thai-600-normal-CYPViXds.woff +0 -0
- package/out/web/assets/prompt-thai-600-normal-MrdfU7zR.woff2 +0 -0
- package/out/web/assets/prompt-thai-700-normal-Cb5ilR-c.woff +0 -0
- package/out/web/assets/prompt-thai-700-normal-Cg4aQ0Nn.woff2 +0 -0
- package/out/web/assets/stateDiagram-v2-4QOOHH4V-DeEc0lGZ.js +0 -1
- package/out/web/assets/swimlanesDiagram-VK2B7HYN-DpVik9v7.js +0 -8
- package/out/web/assets/window-5qYXKoW7.js +0 -1
- package/skills-lock.json +0 -77
- package/src/renderer/public/Live2DCubismCore.js +0 -9
- package/src/renderer/src/companionWidget.ts +0 -95
- package/src/renderer/src/components/Live2DStage.tsx +0 -412
- package/src/renderer/src/components/ModelPanel.tsx +0 -155
- package/src/renderer/src/css/model.css +0 -628
- package/src/renderer/src-web/companionWidget.ts +0 -37
- package/src/renderer/src-web/components/ModelPanel.tsx +0 -12
- package/src/renderer/src-web/css/model.css +0 -628
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
use serde::{Deserialize, Serialize};
|
|
2
|
+
use std::collections::BTreeMap;
|
|
3
|
+
|
|
4
|
+
pub const VERSION: u32 = 1;
|
|
5
|
+
|
|
6
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
7
|
+
#[serde(rename_all = "camelCase")]
|
|
8
|
+
pub struct HostDescriptor {
|
|
9
|
+
pub version: u32,
|
|
10
|
+
pub host_id: String,
|
|
11
|
+
pub name: String,
|
|
12
|
+
pub endpoint: String,
|
|
13
|
+
pub token: String,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pub fn hosts_dir() -> Option<std::path::PathBuf> {
|
|
17
|
+
dirs::config_dir().map(|p| p.join("mint/companion/hosts"))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
|
|
21
|
+
#[serde(rename_all = "snake_case")]
|
|
22
|
+
pub enum Status {
|
|
23
|
+
Queued,
|
|
24
|
+
#[default]
|
|
25
|
+
Thinking,
|
|
26
|
+
Working,
|
|
27
|
+
Responding,
|
|
28
|
+
Waiting,
|
|
29
|
+
Completed,
|
|
30
|
+
Failed,
|
|
31
|
+
Interrupted,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
35
|
+
#[serde(rename_all = "camelCase")]
|
|
36
|
+
pub struct Session {
|
|
37
|
+
pub chat_id: String,
|
|
38
|
+
pub title: String,
|
|
39
|
+
pub workspace: Option<String>,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
43
|
+
#[serde(rename_all = "camelCase")]
|
|
44
|
+
pub struct Turn {
|
|
45
|
+
pub chat_id: String,
|
|
46
|
+
pub turn_id: i64,
|
|
47
|
+
pub seq: u64,
|
|
48
|
+
pub status: Status,
|
|
49
|
+
pub tool: Option<String>,
|
|
50
|
+
pub text: String,
|
|
51
|
+
#[serde(default)]
|
|
52
|
+
pub prompt: String,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
56
|
+
#[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)]
|
|
57
|
+
pub enum Command {
|
|
58
|
+
ListSessions,
|
|
59
|
+
Subscribe {
|
|
60
|
+
#[serde(rename = "chatId")]
|
|
61
|
+
chat_id: String,
|
|
62
|
+
},
|
|
63
|
+
SendChat {
|
|
64
|
+
#[serde(rename = "chatId")]
|
|
65
|
+
chat_id: String,
|
|
66
|
+
#[serde(rename = "requestId")]
|
|
67
|
+
request_id: String,
|
|
68
|
+
message: String,
|
|
69
|
+
},
|
|
70
|
+
Interact {
|
|
71
|
+
#[serde(rename = "chatId")]
|
|
72
|
+
chat_id: String,
|
|
73
|
+
#[serde(rename = "requestId")]
|
|
74
|
+
request_id: String,
|
|
75
|
+
area: String,
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
80
|
+
#[serde(tag = "type", rename_all = "snake_case")]
|
|
81
|
+
pub enum Event {
|
|
82
|
+
Snapshot {
|
|
83
|
+
#[serde(rename = "hostId")]
|
|
84
|
+
host_id: String,
|
|
85
|
+
version: u32,
|
|
86
|
+
sessions: Vec<Session>,
|
|
87
|
+
turns: Vec<Turn>,
|
|
88
|
+
},
|
|
89
|
+
Update {
|
|
90
|
+
#[serde(rename = "hostId")]
|
|
91
|
+
host_id: String,
|
|
92
|
+
turn: Turn,
|
|
93
|
+
},
|
|
94
|
+
Accepted {
|
|
95
|
+
#[serde(rename = "requestId")]
|
|
96
|
+
request_id: String,
|
|
97
|
+
#[serde(rename = "turnId")]
|
|
98
|
+
turn_id: Option<i64>,
|
|
99
|
+
},
|
|
100
|
+
Error {
|
|
101
|
+
#[serde(rename = "requestId")]
|
|
102
|
+
request_id: Option<String>,
|
|
103
|
+
message: String,
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#[derive(Default)]
|
|
108
|
+
pub struct TurnBook(pub BTreeMap<(String, i64), Turn>);
|
|
109
|
+
|
|
110
|
+
impl TurnBook {
|
|
111
|
+
pub fn apply(&mut self, turn: Turn) -> bool {
|
|
112
|
+
let key = (turn.chat_id.clone(), turn.turn_id);
|
|
113
|
+
if self.0.get(&key).is_some_and(|old| old.seq >= turn.seq) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
self.0.insert(key, turn);
|
|
117
|
+
true
|
|
118
|
+
}
|
|
119
|
+
pub fn session(&self, chat_id: &str) -> Vec<Turn> {
|
|
120
|
+
self.0
|
|
121
|
+
.values()
|
|
122
|
+
.filter(|t| t.chat_id == chat_id)
|
|
123
|
+
.cloned()
|
|
124
|
+
.collect()
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
#[cfg(test)]
|
|
129
|
+
mod tests {
|
|
130
|
+
use super::*;
|
|
131
|
+
fn turn(chat: &str, id: i64, seq: u64, status: Status) -> Turn {
|
|
132
|
+
Turn {
|
|
133
|
+
chat_id: chat.into(),
|
|
134
|
+
turn_id: id,
|
|
135
|
+
seq,
|
|
136
|
+
status,
|
|
137
|
+
tool: None,
|
|
138
|
+
text: String::new(),
|
|
139
|
+
prompt: String::new(),
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
#[test]
|
|
143
|
+
fn snapshots_keep_concurrent_sessions_separate() {
|
|
144
|
+
let mut book = TurnBook::default();
|
|
145
|
+
book.apply(turn("one", 1, 1, Status::Working));
|
|
146
|
+
book.apply(turn("two", 2, 2, Status::Responding));
|
|
147
|
+
assert_eq!(book.session("one").len(), 1);
|
|
148
|
+
assert_eq!(book.session("one")[0].status, Status::Working);
|
|
149
|
+
}
|
|
150
|
+
#[test]
|
|
151
|
+
fn late_updates_cannot_overwrite_completed_turns() {
|
|
152
|
+
let mut book = TurnBook::default();
|
|
153
|
+
assert!(book.apply(turn("one", 1, 3, Status::Completed)));
|
|
154
|
+
assert!(!book.apply(turn("one", 1, 2, Status::Thinking)));
|
|
155
|
+
assert_eq!(book.session("one")[0].status, Status::Completed);
|
|
156
|
+
}
|
|
157
|
+
#[test]
|
|
158
|
+
fn clients_cannot_inject_tools_or_system_instructions() {
|
|
159
|
+
let wire =
|
|
160
|
+
r#"{"type":"send_chat","chatId":"one","requestId":"req","message":"hi","tools":[{}]}"#;
|
|
161
|
+
assert!(serde_json::from_str::<Command>(wire).is_err());
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -21,6 +21,10 @@ hmac.workspace = true
|
|
|
21
21
|
hound = "3"
|
|
22
22
|
ignore.workspace = true
|
|
23
23
|
image.workspace = true
|
|
24
|
+
mint-companion-protocol = { path = "../mint-companion-protocol" }
|
|
25
|
+
mint-mod-runtime = { path = "../mint-mod-runtime" }
|
|
26
|
+
jsonschema = { version = "0.58.6", default-features = false }
|
|
27
|
+
libc = "0.2"
|
|
24
28
|
quick-xml.workspace = true
|
|
25
29
|
regex.workspace = true
|
|
26
30
|
reqwest.workspace = true
|
|
@@ -34,11 +38,10 @@ similar.workspace = true
|
|
|
34
38
|
srtlib.workspace = true
|
|
35
39
|
thiserror.workspace = true
|
|
36
40
|
tokio.workspace = true
|
|
41
|
+
tokio-util = { version = "0.7", features = ["rt"] }
|
|
37
42
|
tokio-tungstenite.workspace = true
|
|
43
|
+
trash = "5.2"
|
|
38
44
|
tree-sitter.workspace = true
|
|
39
45
|
tree-sitter-rust.workspace = true
|
|
40
46
|
tree-sitter-typescript.workspace = true
|
|
41
47
|
uuid.workspace = true
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use std::{env, fs, path::PathBuf};
|
|
2
|
+
|
|
3
|
+
fn main() {
|
|
4
|
+
let manifest = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
|
|
5
|
+
let root = manifest.join("../..");
|
|
6
|
+
let notes = root.join("Release_Note.md");
|
|
7
|
+
let bundle =
|
|
8
|
+
env::var("MINT_BUNDLE_RELEASE_NOTES").as_deref() == Ok("1") || !root.join(".git").exists();
|
|
9
|
+
|
|
10
|
+
println!("cargo:rerun-if-changed=build.rs");
|
|
11
|
+
println!("cargo:rerun-if-env-changed=MINT_BUNDLE_RELEASE_NOTES");
|
|
12
|
+
if bundle {
|
|
13
|
+
println!("cargo:rerun-if-changed={}", notes.display());
|
|
14
|
+
}
|
|
15
|
+
println!(
|
|
16
|
+
"cargo:rustc-env=MINT_LIVE_RELEASE_NOTES={}",
|
|
17
|
+
if bundle { "0" } else { "1" }
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Keep the snapshot in OUT_DIR: a dev notes edit must not invalidate Rust's
|
|
21
|
+
// include_str dependency. Shipping builds explicitly track the source file.
|
|
22
|
+
let snapshot =
|
|
23
|
+
fs::read(¬es).expect("Release_Note.md is required when creating the snapshot");
|
|
24
|
+
let output = PathBuf::from(env::var_os("OUT_DIR").unwrap()).join("release-notes.md");
|
|
25
|
+
fs::write(output, snapshot).expect("write the release notes snapshot");
|
|
26
|
+
}
|
|
@@ -343,6 +343,43 @@ const MAX_DOCUMENT_CONTEXT_CHARS: usize = 400_000;
|
|
|
343
343
|
static COUNTER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
|
|
344
344
|
|
|
345
345
|
impl ChatRequest {
|
|
346
|
+
pub(crate) fn with_stored_document_context(
|
|
347
|
+
&self,
|
|
348
|
+
_config: &crate::MintConfig,
|
|
349
|
+
path: &std::path::Path,
|
|
350
|
+
) -> Result<ChatRequest, String> {
|
|
351
|
+
let Some(document) = &self.document_attachment else {
|
|
352
|
+
return Ok(self.clone());
|
|
353
|
+
};
|
|
354
|
+
let extracted =
|
|
355
|
+
crate::knowledge::extract_managed_document_text(path).map_err(|e| e.to_string())?;
|
|
356
|
+
self.with_document_text(document, extracted)
|
|
357
|
+
}
|
|
358
|
+
fn with_document_text(
|
|
359
|
+
&self,
|
|
360
|
+
document: &DocumentAttachment,
|
|
361
|
+
extracted: String,
|
|
362
|
+
) -> Result<ChatRequest, String> {
|
|
363
|
+
let mut context: String = extracted.chars().take(MAX_DOCUMENT_CONTEXT_CHARS).collect();
|
|
364
|
+
if extracted.chars().count() > MAX_DOCUMENT_CONTEXT_CHARS {
|
|
365
|
+
context.push_str("\n\n[Document text truncated because it is long.]");
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
let filename = document.filename.trim();
|
|
369
|
+
let filename = if filename.is_empty() {
|
|
370
|
+
"attached document"
|
|
371
|
+
} else {
|
|
372
|
+
filename
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
let mut enriched = self.clone();
|
|
376
|
+
enriched.document_attachment = None;
|
|
377
|
+
enriched.message = format!(
|
|
378
|
+
"{}\n\nAttached document: {filename}\nUse the extracted document text below when answering. If the user asks for a summary, summarize this document.\n\n--- Extracted document text ---\n{context}\n--- End extracted document text ---",
|
|
379
|
+
self.message
|
|
380
|
+
);
|
|
381
|
+
Ok(enriched)
|
|
382
|
+
}
|
|
346
383
|
pub fn with_document_context(&self, config: &crate::MintConfig) -> Result<ChatRequest, String> {
|
|
347
384
|
let Some(document) = &self.document_attachment else {
|
|
348
385
|
return Ok(self.clone());
|
|
@@ -404,25 +441,7 @@ impl ChatRequest {
|
|
|
404
441
|
let _ = std::fs::remove_file(&path);
|
|
405
442
|
let extracted = extracted?;
|
|
406
443
|
|
|
407
|
-
|
|
408
|
-
if extracted.chars().count() > MAX_DOCUMENT_CONTEXT_CHARS {
|
|
409
|
-
context.push_str("\n\n[Document text truncated because it is long.]");
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
let filename = document.filename.trim();
|
|
413
|
-
let filename = if filename.is_empty() {
|
|
414
|
-
"attached document"
|
|
415
|
-
} else {
|
|
416
|
-
filename
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
let mut enriched = self.clone();
|
|
420
|
-
enriched.document_attachment = None;
|
|
421
|
-
enriched.message = format!(
|
|
422
|
-
"{}\n\nAttached document: {filename}\nUse the extracted document text below when answering. If the user asks for a summary, summarize this document.\n\n--- Extracted document text ---\n{context}\n--- End extracted document text ---",
|
|
423
|
-
self.message
|
|
424
|
-
);
|
|
425
|
-
Ok(enriched)
|
|
444
|
+
self.with_document_text(document, extracted)
|
|
426
445
|
}
|
|
427
446
|
}
|
|
428
447
|
|
|
@@ -970,6 +989,15 @@ async fn send_openai_style_request(
|
|
|
970
989
|
Ok(response.json().await?)
|
|
971
990
|
}
|
|
972
991
|
|
|
992
|
+
// Preserve malformed arguments so the executor can reject them. Replacing them
|
|
993
|
+
// with {} would silently turn a requested directory into the workspace root.
|
|
994
|
+
fn decode_tool_arguments(arguments: &Value) -> Value {
|
|
995
|
+
match arguments.as_str() {
|
|
996
|
+
Some(raw) => serde_json::from_str(raw).unwrap_or_else(|_| arguments.clone()),
|
|
997
|
+
None => arguments.clone(),
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
973
1001
|
/// Parses an OpenAI Chat Completions-shaped response (`choices[0].message`),
|
|
974
1002
|
/// extracting both plain text and any native `tool_calls`. Shared by OpenAI,
|
|
975
1003
|
/// custom OpenAI-compatible providers, and (for its response shape only) reused
|
|
@@ -999,10 +1027,7 @@ fn parse_openai_style_reply(model: String, response: &Value) -> Result<ProviderR
|
|
|
999
1027
|
.iter()
|
|
1000
1028
|
.filter_map(|call| {
|
|
1001
1029
|
let name = call["function"]["name"].as_str()?.to_string();
|
|
1002
|
-
let input = call["function"]["arguments"]
|
|
1003
|
-
.as_str()
|
|
1004
|
-
.and_then(|raw| serde_json::from_str(raw).ok())
|
|
1005
|
-
.unwrap_or_else(|| json!({}));
|
|
1030
|
+
let input = decode_tool_arguments(&call["function"]["arguments"]);
|
|
1006
1031
|
Some(ToolCall {
|
|
1007
1032
|
id: call["id"].as_str().unwrap_or_default().to_string(),
|
|
1008
1033
|
name,
|
|
@@ -1064,11 +1089,10 @@ async fn call_ollama(
|
|
|
1064
1089
|
let native = request.messages.is_some()
|
|
1065
1090
|
&& config.tool_calling_mode() == crate::config::ToolCallingMode::Native;
|
|
1066
1091
|
let mut body = if native {
|
|
1067
|
-
let messages = request.messages.as_deref().unwrap_or(&[]);
|
|
1068
1092
|
let mut payload = json!({
|
|
1069
1093
|
"model": model,
|
|
1070
1094
|
"stream": false,
|
|
1071
|
-
"messages":
|
|
1095
|
+
"messages": ollama_request_messages(request),
|
|
1072
1096
|
});
|
|
1073
1097
|
if let Some(tools) = &request.tools {
|
|
1074
1098
|
payload["tools"] = json!(
|
|
@@ -1127,6 +1151,19 @@ async fn call_ollama(
|
|
|
1127
1151
|
/// Unlike OpenAI, Ollama expects tool-call `arguments` as a JSON object (not a
|
|
1128
1152
|
/// stringified JSON blob) and doesn't require a `tool_call_id` on tool-result
|
|
1129
1153
|
/// messages.
|
|
1154
|
+
fn ollama_request_messages(request: &ChatRequest) -> Vec<Value> {
|
|
1155
|
+
let history = request.messages.as_deref().unwrap_or(&[]);
|
|
1156
|
+
let mut result = ollama_native_messages(history);
|
|
1157
|
+
if !request.system_instruction.is_empty() && !history.iter().any(|m| m.role == ChatRole::System)
|
|
1158
|
+
{
|
|
1159
|
+
result.insert(
|
|
1160
|
+
0,
|
|
1161
|
+
json!({"role":"system","content":request.system_instruction}),
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
result
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1130
1167
|
fn ollama_native_messages(messages: &[ChatMessage]) -> Vec<Value> {
|
|
1131
1168
|
let mut result = Vec::new();
|
|
1132
1169
|
for message in messages {
|
|
@@ -1228,11 +1265,7 @@ fn parse_ollama_reply(model: String, response: &Value) -> Result<ProviderReply,
|
|
|
1228
1265
|
.filter_map(|(index, call)| {
|
|
1229
1266
|
let name = call["function"]["name"].as_str()?.to_string();
|
|
1230
1267
|
let arguments = &call["function"]["arguments"];
|
|
1231
|
-
let input =
|
|
1232
|
-
serde_json::from_str(raw).unwrap_or_else(|_| json!({}))
|
|
1233
|
-
} else {
|
|
1234
|
-
arguments.clone()
|
|
1235
|
-
};
|
|
1268
|
+
let input = decode_tool_arguments(arguments);
|
|
1236
1269
|
let id = call["id"]
|
|
1237
1270
|
.as_str()
|
|
1238
1271
|
.map(str::to_owned)
|
|
@@ -1498,6 +1531,19 @@ fn anthropic_content_block(block: &ContentBlock) -> Result<Value, ChatError> {
|
|
|
1498
1531
|
/// `tool_use` content blocks (Anthropic may return a `tool_use` block before,
|
|
1499
1532
|
/// after, or interleaved with text — unlike the old code, this does not assume
|
|
1500
1533
|
/// the first block is text).
|
|
1534
|
+
// Anthropic reports uncached, cache-read and cache-created input separately.
|
|
1535
|
+
fn anthropic_input_tokens(usage: &Value) -> Option<u32> {
|
|
1536
|
+
[
|
|
1537
|
+
"input_tokens",
|
|
1538
|
+
"cache_read_input_tokens",
|
|
1539
|
+
"cache_creation_input_tokens",
|
|
1540
|
+
]
|
|
1541
|
+
.into_iter()
|
|
1542
|
+
.filter_map(|key| usage[key].as_u64())
|
|
1543
|
+
.reduce(u64::saturating_add)
|
|
1544
|
+
.map(|n| n.min(u32::MAX as u64) as u32)
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1501
1547
|
fn parse_anthropic_reply(model: String, response: &Value) -> Result<ProviderReply, ChatError> {
|
|
1502
1548
|
let blocks = response["content"].as_array().cloned().unwrap_or_default();
|
|
1503
1549
|
let mut text = String::new();
|
|
@@ -1544,7 +1590,7 @@ fn parse_anthropic_reply(model: String, response: &Value) -> Result<ProviderRepl
|
|
|
1544
1590
|
thought: Some(th.clone()),
|
|
1545
1591
|
tool_calls: None,
|
|
1546
1592
|
stop_reason: response["stop_reason"].as_str().map(str::to_owned),
|
|
1547
|
-
input_tokens: response["usage"]
|
|
1593
|
+
input_tokens: anthropic_input_tokens(&response["usage"]),
|
|
1548
1594
|
output_tokens: response["usage"]["output_tokens"]
|
|
1549
1595
|
.as_u64()
|
|
1550
1596
|
.map(|n| n as u32),
|
|
@@ -1558,7 +1604,7 @@ fn parse_anthropic_reply(model: String, response: &Value) -> Result<ProviderRepl
|
|
|
1558
1604
|
thought,
|
|
1559
1605
|
tool_calls: (!tool_calls.is_empty()).then_some(tool_calls),
|
|
1560
1606
|
stop_reason: response["stop_reason"].as_str().map(str::to_owned),
|
|
1561
|
-
input_tokens: response["usage"]
|
|
1607
|
+
input_tokens: anthropic_input_tokens(&response["usage"]),
|
|
1562
1608
|
output_tokens: response["usage"]["output_tokens"]
|
|
1563
1609
|
.as_u64()
|
|
1564
1610
|
.map(|n| n as u32),
|
|
@@ -1692,7 +1738,7 @@ fn ollama_stream_payload(
|
|
|
1692
1738
|
let mut value = json!({
|
|
1693
1739
|
"model": model,
|
|
1694
1740
|
"stream": true,
|
|
1695
|
-
"messages":
|
|
1741
|
+
"messages": ollama_request_messages(request),
|
|
1696
1742
|
});
|
|
1697
1743
|
if let Some(tools) = &request.tools {
|
|
1698
1744
|
value["tools"] = json!(
|
|
@@ -2137,9 +2183,7 @@ impl StreamReplyAccumulator {
|
|
|
2137
2183
|
{
|
|
2138
2184
|
match value["type"].as_str() {
|
|
2139
2185
|
Some("message_start") => {
|
|
2140
|
-
self.input_tokens = value["message"]["usage"]
|
|
2141
|
-
.as_u64()
|
|
2142
|
-
.map(|n| n as u32);
|
|
2186
|
+
self.input_tokens = anthropic_input_tokens(&value["message"]["usage"]);
|
|
2143
2187
|
}
|
|
2144
2188
|
Some("content_block_start") => {
|
|
2145
2189
|
let block_index = value["index"].as_u64().unwrap_or(0) as usize;
|
|
@@ -2214,9 +2258,9 @@ impl StreamReplyAccumulator {
|
|
|
2214
2258
|
.into_iter()
|
|
2215
2259
|
.filter(|tool| !tool.name.is_empty())
|
|
2216
2260
|
.map(|tool| {
|
|
2217
|
-
let input = tool
|
|
2218
|
-
|
|
2219
|
-
|
|
2261
|
+
let input = tool
|
|
2262
|
+
.input
|
|
2263
|
+
.unwrap_or_else(|| decode_tool_arguments(&Value::String(tool.arguments)));
|
|
2220
2264
|
ToolCall {
|
|
2221
2265
|
id: tool.id,
|
|
2222
2266
|
name: tool.name,
|
|
@@ -2995,6 +3039,38 @@ mod tests {
|
|
|
2995
3039
|
assert!(parse_stream_value(StreamFormat::Anthropic, "data: [DONE]").is_none());
|
|
2996
3040
|
}
|
|
2997
3041
|
|
|
3042
|
+
#[test]
|
|
3043
|
+
fn malformed_tool_arguments_survive_provider_parsing_for_rejection() {
|
|
3044
|
+
let malformed = r#"{"path":"~/Downloads/YOUTUBE_DL""#;
|
|
3045
|
+
let function = json!({"name": "list_files", "arguments": malformed});
|
|
3046
|
+
let openai = parse_openai_style_reply(
|
|
3047
|
+
"test".into(),
|
|
3048
|
+
&json!({
|
|
3049
|
+
"choices": [{"message": {"tool_calls": [{"id": "call_1", "function": function}]}}]
|
|
3050
|
+
}),
|
|
3051
|
+
)
|
|
3052
|
+
.unwrap();
|
|
3053
|
+
let ollama = parse_ollama_reply(
|
|
3054
|
+
"test".into(),
|
|
3055
|
+
&json!({
|
|
3056
|
+
"message": {"tool_calls": [{"function": function}]}
|
|
3057
|
+
}),
|
|
3058
|
+
)
|
|
3059
|
+
.unwrap();
|
|
3060
|
+
let mut accumulator = StreamReplyAccumulator::default();
|
|
3061
|
+
accumulator.consume_openai(&json!({
|
|
3062
|
+
"choices": [{"delta": {"tool_calls": [{"index": 0, "id": "call_1", "function": function}]}}]
|
|
3063
|
+
}), &mut |_| {});
|
|
3064
|
+
let streamed = accumulator.finish("test".into()).unwrap();
|
|
3065
|
+
for reply in [openai, ollama, streamed] {
|
|
3066
|
+
let calls = reply.tool_calls.unwrap();
|
|
3067
|
+
assert_eq!(calls.len(), 1);
|
|
3068
|
+
assert_eq!(calls[0].input, Value::String(malformed.into()));
|
|
3069
|
+
}
|
|
3070
|
+
assert_eq!(decode_tool_arguments(&json!("{}")), json!({}));
|
|
3071
|
+
assert_eq!(decode_tool_arguments(&Value::Null), Value::Null);
|
|
3072
|
+
}
|
|
3073
|
+
|
|
2998
3074
|
#[test]
|
|
2999
3075
|
fn accumulates_openai_reasoning_tools_and_usage() {
|
|
3000
3076
|
let mut accumulator = StreamReplyAccumulator::default();
|
|
@@ -3168,6 +3244,32 @@ mod tests {
|
|
|
3168
3244
|
assert_eq!(payload["system"][0]["cache_control"]["type"], "ephemeral");
|
|
3169
3245
|
}
|
|
3170
3246
|
|
|
3247
|
+
#[test]
|
|
3248
|
+
fn review_anthropic_tool_results_preserve_failure_and_success_flags() {
|
|
3249
|
+
for (text, is_error) in [
|
|
3250
|
+
("User denied MCP tool call", true),
|
|
3251
|
+
("MCP call was not approved; user feedback", true),
|
|
3252
|
+
("Error: literal diagnostic label", false),
|
|
3253
|
+
] {
|
|
3254
|
+
let request = native_request(
|
|
3255
|
+
vec![ChatMessage {
|
|
3256
|
+
role: ChatRole::Tool,
|
|
3257
|
+
content: vec![ContentBlock::ToolResult {
|
|
3258
|
+
tool_use_id: "mcp-call".into(),
|
|
3259
|
+
content: text.into(),
|
|
3260
|
+
is_error,
|
|
3261
|
+
}],
|
|
3262
|
+
}],
|
|
3263
|
+
None,
|
|
3264
|
+
);
|
|
3265
|
+
let payload =
|
|
3266
|
+
anthropic_chat_payload(&MintConfig::default(), "claude-x", &request, false)
|
|
3267
|
+
.unwrap();
|
|
3268
|
+
assert_eq!(payload["messages"][0]["content"][0]["is_error"], is_error);
|
|
3269
|
+
assert_eq!(payload["messages"][0]["content"][0]["content"], text);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3171
3273
|
#[test]
|
|
3172
3274
|
fn anthropic_payload_omits_the_cache_breakpoint_for_an_empty_system_prompt() {
|
|
3173
3275
|
let mut request = native_request(vec![ChatMessage::text(ChatRole::User, "hi")], None);
|
|
@@ -3758,6 +3860,32 @@ mod tests {
|
|
|
3758
3860
|
(Some(80), Some(40))
|
|
3759
3861
|
);
|
|
3760
3862
|
}
|
|
3863
|
+
#[test]
|
|
3864
|
+
fn anthropic_cached_prompt_tokens_count_toward_context_in_json_and_streams() {
|
|
3865
|
+
let usage = json!({"input_tokens":100,"cache_read_input_tokens":98_000,"cache_creation_input_tokens":1_000,"output_tokens":400,"cache_creation":{"ephemeral_5m_input_tokens":1_000}});
|
|
3866
|
+
let reply = parse_anthropic_reply(
|
|
3867
|
+
"claude-test".into(),
|
|
3868
|
+
&json!({"content":[{"type":"text","text":"Ready"}],"usage":usage}),
|
|
3869
|
+
)
|
|
3870
|
+
.unwrap();
|
|
3871
|
+
assert_eq!(reply.input_tokens, Some(99_100));
|
|
3872
|
+
let mut stream = StreamReplyAccumulator::default();
|
|
3873
|
+
stream.consume_anthropic(
|
|
3874
|
+
&json!({"type":"message_start","message":{"usage":usage}}),
|
|
3875
|
+
&mut |_| {},
|
|
3876
|
+
);
|
|
3877
|
+
stream.consume_anthropic(
|
|
3878
|
+
&json!({"type":"content_block_delta","delta":{"type":"text_delta","text":"Ready"}}),
|
|
3879
|
+
&mut |_| {},
|
|
3880
|
+
);
|
|
3881
|
+
stream.consume_anthropic(
|
|
3882
|
+
&json!({"type":"message_delta","usage":{"output_tokens":400}}),
|
|
3883
|
+
&mut |_| {},
|
|
3884
|
+
);
|
|
3885
|
+
let reply = stream.finish("claude-test".into()).unwrap();
|
|
3886
|
+
assert_eq!(reply.input_tokens, Some(99_100));
|
|
3887
|
+
assert_eq!(reply.output_tokens, Some(400));
|
|
3888
|
+
}
|
|
3761
3889
|
|
|
3762
3890
|
#[test]
|
|
3763
3891
|
fn missing_usage_data_yields_no_token_counts() {
|
|
@@ -543,6 +543,15 @@ pub fn apply_code_edits(
|
|
|
543
543
|
}
|
|
544
544
|
let mut applied = Vec::new();
|
|
545
545
|
for (edit, preview) in edits.iter().zip(prepared) {
|
|
546
|
+
let pending = crate::system::workspace_history::begin_edit(&root, &preview.path).map_err(
|
|
547
|
+
|message| CodeInspectionError::Write {
|
|
548
|
+
path: preview.path.clone(),
|
|
549
|
+
source: std::io::Error::other(message),
|
|
550
|
+
},
|
|
551
|
+
)?;
|
|
552
|
+
if sha256(&read_optional_content(&preview.path)?) != preview.before_sha256 {
|
|
553
|
+
return Err(CodeInspectionError::StaleProposal(preview.path.clone()));
|
|
554
|
+
}
|
|
546
555
|
if let Some(parent) = preview.path.parent() {
|
|
547
556
|
fs::create_dir_all(parent).map_err(|source| CodeInspectionError::Write {
|
|
548
557
|
path: parent.to_path_buf(),
|
|
@@ -550,6 +559,12 @@ pub fn apply_code_edits(
|
|
|
550
559
|
})?;
|
|
551
560
|
}
|
|
552
561
|
write_atomic(&preview.path, &edit.content)?;
|
|
562
|
+
pending
|
|
563
|
+
.commit()
|
|
564
|
+
.map_err(|message| CodeInspectionError::Write {
|
|
565
|
+
path: preview.path.clone(),
|
|
566
|
+
source: std::io::Error::other(message),
|
|
567
|
+
})?;
|
|
553
568
|
applied.push(AppliedCodeEdit {
|
|
554
569
|
path: preview.path,
|
|
555
570
|
created: !preview.existed,
|