@pheem49/mint 1.14.0 → 1.15.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/CLAUDE.md +1 -1
- package/Cargo.lock +291 -11
- package/Cargo.toml +1 -1
- package/README.md +71 -9
- package/ROADMAP.md +30 -0
- package/Release_Note.md +579 -465
- package/crates/mint-cli/Cargo.toml +3 -1
- package/crates/mint-cli/src/agent/approval_prompts.rs +16 -3
- package/crates/mint-cli/src/agent/live_status.rs +367 -118
- package/crates/mint-cli/src/agent/markdown_render.rs +601 -61
- package/crates/mint-cli/src/agent.rs +452 -215
- package/crates/mint-cli/src/commands/agent.rs +16 -21
- package/crates/mint-cli/src/commands/eval.rs +9 -5
- package/crates/mint-cli/src/commands/git.rs +204 -0
- package/crates/mint-cli/src/commands/integrations.rs +28 -0
- package/crates/mint-cli/src/commands/knowledge.rs +1 -0
- package/crates/mint-cli/src/commands/mod.rs +37 -2
- package/crates/mint-cli/src/commands/tailnet_web.rs +235 -0
- package/crates/mint-cli/src/image.rs +26 -3
- package/crates/mint-cli/src/interactive/chat_tui.rs +4742 -0
- package/crates/mint-cli/src/interactive/command_ui.rs +477 -0
- package/crates/mint-cli/src/interactive/format.rs +8 -0
- package/crates/mint-cli/src/interactive/input_box.rs +38 -2
- package/crates/mint-cli/src/interactive/picker.rs +180 -37
- package/crates/mint-cli/src/interactive/resume_picker.rs +686 -0
- package/crates/mint-cli/src/interactive/slash_commands.rs +868 -450
- package/crates/mint-cli/src/interactive/thought_viewer.rs +286 -0
- package/crates/mint-cli/src/interactive.rs +400 -136
- package/crates/mint-cli/src/main.rs +84 -23
- package/crates/mint-cli/src/markdown.rs +12 -5
- package/crates/mint-cli/src/onboard.rs +32 -30
- package/crates/mint-cli/src/plugins_cli.rs +8 -5
- package/crates/mint-cli/src/setup.rs +10 -8
- package/crates/mint-cli/src/terminal_theme.rs +187 -0
- package/crates/mint-cli/src/updater.rs +56 -21
- package/crates/mint-core/src/agent/agent_loop.rs +1 -0
- package/crates/mint-core/src/agent/chat.rs +843 -177
- package/crates/mint-core/src/agent/code_tools.rs +83 -2
- package/crates/mint-core/src/agent/memory.rs +658 -20
- package/crates/mint-core/src/agent/skills.rs +1 -1
- package/crates/mint-core/src/api_server/routes/chat.rs +31 -5
- package/crates/mint-core/src/api_server/routes/linked_folders.rs +118 -3
- package/crates/mint-core/src/api_server/routes/misc.rs +10 -14
- package/crates/mint-core/src/api_server/routes/sessions.rs +44 -0
- package/crates/mint-core/src/api_server.rs +22 -3
- package/crates/mint-core/src/avatar_bridge.rs +2 -0
- package/crates/mint-core/src/browser/cdp.rs +74 -83
- package/crates/mint-core/src/browser/evidence.rs +260 -0
- package/crates/mint-core/src/browser/input.rs +1 -1
- package/crates/mint-core/src/browser/interact.rs +98 -124
- package/crates/mint-core/src/browser/lifecycle.rs +75 -4
- package/crates/mint-core/src/browser/mod.rs +16 -2
- package/crates/mint-core/src/browser/navigate.rs +27 -19
- package/crates/mint-core/src/browser/observe.js +40 -0
- package/crates/mint-core/src/browser/session.rs +1558 -0
- package/crates/mint-core/src/git/branches.rs +348 -0
- package/crates/mint-core/src/git/checkpoint.rs +40 -0
- package/crates/mint-core/src/git/diff.rs +206 -0
- package/crates/mint-core/src/git/mod.rs +10 -2
- package/crates/mint-core/src/integrations/channels.rs +1 -0
- package/crates/mint-core/src/lib.rs +22 -14
- package/crates/mint-core/src/live_sync.rs +28 -9
- package/crates/mint-core/src/media/auto_shorts.rs +1 -0
- package/crates/mint-core/src/media/gemini_live.rs +12 -1
- package/crates/mint-core/src/media/mic_transcribe.rs +1 -0
- package/crates/mint-core/src/media/subtitle.rs +1 -0
- package/crates/mint-core/src/orchestration/context_render.rs +1 -0
- package/crates/mint-core/src/orchestration/memory_skill.rs +6 -1
- package/crates/mint-core/src/orchestration/mod.rs +1024 -271
- package/crates/mint-core/src/orchestration/tools/browser.rs +16 -139
- package/crates/mint-core/src/orchestration/tools/misc.rs +2 -1
- package/crates/mint-core/src/orchestration/tools/web.rs +1 -1
- package/crates/mint-core/src/prompts/agent.rs +58 -29
- package/crates/mint-core/src/prompts/chat.rs +1 -1
- package/crates/mint-core/src/prompts/persona.rs +1 -1
- package/crates/mint-core/src/prompts/tool_catalog.rs +93 -25
- package/crates/mint-core/src/search/linked_folders/index.rs +732 -0
- package/crates/mint-core/src/search/linked_folders.rs +391 -130
- package/crates/mint-core/src/slash/mod.rs +470 -22
- package/crates/mint-core/src/slash/model_fetcher.rs +12 -3
- package/crates/mint-core/src/slash/models.rs +66 -10
- package/crates/mint-core/src/system/config.rs +230 -0
- package/crates/mint-core/src/system/workspace.rs +228 -0
- package/crates/mint-core/src/system.rs +1 -0
- package/crates/mint-core/tests/memory_persistence.rs +39 -0
- package/mint-presentation-demo.mp4 +0 -0
- package/out/web/assets/CliSessionsView-BxUVWEEL.js +1 -0
- package/out/web/assets/CliSessionsView-CBDTXuQv.css +1 -0
- package/out/web/assets/CodeReviewPage-DkMgfcos.css +1 -0
- package/out/web/assets/CodeReviewPage-jKlmLJwT.js +3 -0
- package/out/web/assets/CommandPalette-DnwPA5hy.js +1 -0
- package/out/web/assets/ImageStudioPanel-BR1XFwhR.js +1 -0
- package/out/web/assets/ImageStudioPanel-D0lnhQV5.css +1 -0
- package/out/web/assets/LinkedFoldersView-bi-CWQ-I.js +1 -0
- package/out/web/assets/McpRegistryPicker-D5tEFnyq.js +1 -0
- package/out/web/assets/McpServersView-BGG1dhFM.js +1 -0
- package/out/web/assets/MintDashboard-BIglDEWX.js +20 -0
- package/out/web/assets/MintDashboard-DSMywSgs.css +1 -0
- package/out/web/assets/ModelPanel-CbJ1PFoZ.js +1 -0
- package/out/web/assets/PicturesLibrary-CQP0fLP1.css +1 -0
- package/out/web/assets/PicturesLibrary-DoYN7T1p.js +1 -0
- package/out/web/assets/PluginsView-CU1HWXGk.js +1 -0
- package/out/web/assets/ScheduledTasksView-Bnl36y2N.js +1 -0
- package/out/web/assets/SettingsWindow-DhWLAn9T.css +1 -0
- package/out/web/assets/SettingsWindow-Dw8L01pw.js +2 -0
- package/out/web/assets/SkillsView-cnl8aY5p.js +2 -0
- package/out/web/assets/ToolSurfacePage-CgsQw6l5.css +1 -0
- package/out/web/assets/ToolSurfacePage-Cz2VJAPZ.js +37 -0
- package/out/web/assets/VeoStudioPanel-D4JnERWR.js +4 -0
- package/out/web/assets/VeoStudioPanel-DOj7_WR3.css +1 -0
- package/out/web/assets/WorkspacePanel-CbJ1PFoZ.js +1 -0
- package/out/web/assets/{abnfDiagram-VCTEODGH-DAOBA7ZG.js → abnfDiagram-VCTEODGH-ByMyfanq.js} +1 -1
- package/out/web/assets/{architecture-7GRP2DOG-CgSwQOPQ.js → architecture-7GRP2DOG-CLq2kEOB.js} +1 -1
- package/out/web/assets/{architectureDiagram-5GKGNRK7-CYp3yupP.js → architectureDiagram-5GKGNRK7-6PoVSmNG.js} +1 -1
- package/out/web/assets/{blockDiagram-NRAW4CY4-CyWybDWr.js → blockDiagram-NRAW4CY4-cKw9mAKi.js} +1 -1
- package/out/web/assets/{c4Diagram-UCG6FXSJ-BvY3U709.js → c4Diagram-UCG6FXSJ-Cqy8N5Ge.js} +1 -1
- package/out/web/assets/{chunk-75Z2AOVW-TLXCoZYv.js → chunk-75Z2AOVW-3qybijF5.js} +1 -1
- package/out/web/assets/chunk-CKBBP62Z-cIrXq6jN.js +2 -0
- package/out/web/assets/{chunk-CLGD4ZFX-xjsKtNS7.js → chunk-CLGD4ZFX-CndDQkww.js} +1 -1
- package/out/web/assets/chunk-DSNCTWBM-Cc4NxvgD.js +2 -0
- package/out/web/assets/chunk-DU6HZSFF-drzh6GsU.js +128 -0
- package/out/web/assets/{chunk-F27PBJKO-BFpgF55A.js → chunk-F27PBJKO-FiY35l4v.js} +1 -1
- package/out/web/assets/{chunk-G27WJ6UU-DfF7qW-C.js → chunk-G27WJ6UU-Bjt9Il4A.js} +1 -1
- package/out/web/assets/{chunk-GMAD6QVW-C-558kh_.js → chunk-GMAD6QVW-Bppi3Ctd.js} +1 -1
- package/out/web/assets/{chunk-JQ64N6SF-wJmeGKAw.js → chunk-JQ64N6SF-DGg5kcEV.js} +1 -1
- package/out/web/assets/{chunk-LCL6LL3I-C1wHD8Ie.js → chunk-LCL6LL3I-CCYcjd7p.js} +1 -1
- package/out/web/assets/{chunk-OBVCFTLP-BsRTPBqs.js → chunk-OBVCFTLP-DJeNil5M.js} +1 -1
- package/out/web/assets/{chunk-P2QGCYS3-HZIiM7Ni.js → chunk-P2QGCYS3-lRzkRjBB.js} +1 -1
- package/out/web/assets/{chunk-POPQ4Y6H-Dk9wvVb0.js → chunk-POPQ4Y6H-DouASMBW.js} +1 -1
- package/out/web/assets/{chunk-PWAF6VOD-BmjYLNbq.js → chunk-PWAF6VOD-DMmD1vVf.js} +1 -1
- package/out/web/assets/{chunk-R7TYR2AO-CaHIf-lK.js → chunk-R7TYR2AO-CYLA5UC5.js} +1 -1
- package/out/web/assets/{chunk-RHFEMEQ7-_T561hOU.js → chunk-RHFEMEQ7-BiXwEcUT.js} +1 -1
- package/out/web/assets/{chunk-SVP7TREG-CM-GGYoY.js → chunk-SVP7TREG-BV-zPslF.js} +1 -1
- package/out/web/assets/{chunk-TEH6E4GO-K2A8Vg2C.js → chunk-TEH6E4GO-B2RGEohZ.js} +1 -1
- package/out/web/assets/classDiagram-DTDB5LWJ-Dq0smRWk.js +1 -0
- package/out/web/assets/classDiagram-v2-JRS7N3AN-Dq0smRWk.js +1 -0
- package/out/web/assets/config-C-ZFtipU.css +1 -0
- package/out/web/assets/config-eEDngJXO.js +1 -0
- package/out/web/assets/core-hQ2VA9Ti.js +1 -0
- package/out/web/assets/{cynefin-OW5HDTMX-ClzaB6cc.js → cynefin-OW5HDTMX-Cas4csHM.js} +1 -1
- package/out/web/assets/{cynefinDiagram-5FMLGOSQ-D_JzZBzf.js → cynefinDiagram-5FMLGOSQ-Bbpj66Y3.js} +1 -1
- package/out/web/assets/{dagre-3AP2YEHR-BDuUeMHj.js → dagre-3AP2YEHR-B0-2RDEd.js} +1 -1
- package/out/web/assets/{diagram-S7CK7UJ4-DgtcfE8P.js → diagram-S7CK7UJ4-BdzEjUyH.js} +1 -1
- package/out/web/assets/{diagram-UQ7AKVKN-DTLoEYti.js → diagram-UQ7AKVKN-CJDwyPxF.js} +1 -1
- package/out/web/assets/{diagram-VSXAHHWV-ChGl9pXz.js → diagram-VSXAHHWV-BxaG1r_B.js} +1 -1
- package/out/web/assets/{diagram-VX7I27RA-Be8DWz0S.js → diagram-VX7I27RA-BMmUqm8f.js} +1 -1
- package/out/web/assets/{diagram-Z3DM3KII-BMXjRTOF.js → diagram-Z3DM3KII-CFtd03eE.js} +1 -1
- package/out/web/assets/dist-js-Bf2bhoku.js +1 -0
- package/out/web/assets/{ebnfDiagram-PWID7BFC-8Q9pl1CJ.js → ebnfDiagram-PWID7BFC-DwAen1hO.js} +1 -1
- package/out/web/assets/{erDiagram-SSCWMZ5O-DjH8Lnkn.js → erDiagram-SSCWMZ5O-BCZSHACj.js} +1 -1
- package/out/web/assets/event-ChBVpRy0.js +1 -0
- package/out/web/assets/{eventmodeling-NTZA5JFV-BKUH_DOp.js → eventmodeling-NTZA5JFV-XHStE4E_.js} +1 -1
- package/out/web/assets/fira-code-latin-600-normal-BmSSHshu.woff +0 -0
- package/out/web/assets/fira-code-latin-600-normal-CvYZpPHg.woff2 +0 -0
- package/out/web/assets/fira-code-symbols2-600-normal-Dvq6IQE5.woff +0 -0
- package/out/web/assets/flowDiagram-A5DVABFB-BLg7nEcd.js +1 -0
- package/out/web/assets/{ganttDiagram-EL5Y4UJY-D7fZKJNM.js → ganttDiagram-EL5Y4UJY-BAEu1Cql.js} +1 -1
- package/out/web/assets/{gitGraph-4MIJSDKK-BypWaaBU.js → gitGraph-4MIJSDKK-r32Vyper.js} +1 -1
- package/out/web/assets/{gitGraphDiagram-WWUBYQGX-DWiw_3bq.js → gitGraphDiagram-WWUBYQGX-z9o9qt6V.js} +1 -1
- package/out/web/assets/index-Btsf4L8M.css +1 -0
- package/out/web/assets/index-D8D9MeRA.js +11 -0
- package/out/web/assets/{info-A6RAGUB7-KkAUxT4j.js → info-A6RAGUB7-BvLaC2cw.js} +1 -1
- package/out/web/assets/{infoDiagram-RXCK75RN-BNb6E48y.js → infoDiagram-RXCK75RN-Be6WAXXw.js} +1 -1
- package/out/web/assets/{ishikawaDiagram-5VMMS53U-Caa-JoAK.js → ishikawaDiagram-5VMMS53U-DZjoHJHC.js} +1 -1
- package/out/web/assets/{journeyDiagram-EYS64GPL-DOrmFGz6.js → journeyDiagram-EYS64GPL-CtVkjkGm.js} +1 -1
- package/out/web/assets/{kanban-definition-3QL26DDD-BOWCYcK0.js → kanban-definition-3QL26DDD-CW5FMv1w.js} +1 -1
- package/out/web/assets/lucide-react-Ip3L6Jtn.js +1 -0
- package/out/web/assets/markdown-BSeeUbJH.js +38 -0
- package/out/web/assets/{mermaid-parser.core-BQqjCkS_.js → mermaid-parser.core-aUgCqsZ5.js} +3 -3
- package/out/web/assets/mermaid.core-D57sEiSL.js +11 -0
- package/out/web/assets/{mindmap-definition-FBJOCRG2-jTceWpr0.js → mindmap-definition-FBJOCRG2-DAmSpM3a.js} +1 -1
- package/out/web/assets/modelManager-tMVmJVAW.js +2 -0
- package/out/web/assets/oauthManager-9jxicDWJ.js +1 -0
- package/out/web/assets/{packet-AYTQ26CC-CJ5RXgol.js → packet-AYTQ26CC-DJ27iIoJ.js} +1 -1
- package/out/web/assets/{pegDiagram-XKGWAZYB-y8wMtd0y.js → pegDiagram-XKGWAZYB-Bj3ii-gS.js} +1 -1
- package/out/web/assets/{pie-WAS4IAKB-72fTBbl4.js → pie-WAS4IAKB-DG5mCUbc.js} +1 -1
- package/out/web/assets/{pieDiagram-E7YTZNPT-e0O02qWq.js → pieDiagram-E7YTZNPT-BrJLPnDA.js} +1 -1
- 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-700-normal-Cb5ilR-c.woff +0 -0
- package/out/web/assets/prompt-thai-700-normal-Cg4aQ0Nn.woff2 +0 -0
- package/out/web/assets/{quadrantDiagram-AXDQQJYC-C9phYLom.js → quadrantDiagram-AXDQQJYC-3x_TmF3j.js} +1 -1
- package/out/web/assets/{radar-RG4KPBEZ-BAU2hzUT.js → radar-RG4KPBEZ-CrXaTTuV.js} +1 -1
- package/out/web/assets/{railroad-74A4TZTK-B0bCAVHC.js → railroad-74A4TZTK-BpqMH9BE.js} +1 -1
- package/out/web/assets/{railroad-abnf-HS5TGJTU-WhxO7ndE.js → railroad-abnf-HS5TGJTU-DHI0uLlV.js} +1 -1
- package/out/web/assets/{railroad-ebnf-LZEXJU2U-BkA0m7-F.js → railroad-ebnf-LZEXJU2U-CQCb316y.js} +1 -1
- package/out/web/assets/{railroad-peg-WCYAUIDC-BsVpHIaj.js → railroad-peg-WCYAUIDC-Ph1giKkH.js} +1 -1
- package/out/web/assets/{railroadDiagram-O6MQD6OU-CyOLN65Q.js → railroadDiagram-O6MQD6OU-BRq6wIxx.js} +1 -1
- package/out/web/assets/{requirementDiagram-EFPCY7ZU-DQXJ7Dud.js → requirementDiagram-EFPCY7ZU-DIJj6G1g.js} +1 -1
- package/out/web/assets/{sankeyDiagram-P5KCCOFB-B2XLyIIc.js → sankeyDiagram-P5KCCOFB-DZajSryq.js} +1 -1
- package/out/web/assets/{sequenceDiagram-WJ2MYXX4-DGQY4wwm.js → sequenceDiagram-WJ2MYXX4-DxJCWyZS.js} +1 -1
- package/out/web/assets/{stateDiagram-HBIQ2CUA-DHZpDwNy.js → stateDiagram-HBIQ2CUA-k6voi8Vf.js} +1 -1
- package/out/web/assets/stateDiagram-v2-4QOOHH4V-DeEc0lGZ.js +1 -0
- package/out/web/assets/studio-B1mk40wD.js +1 -0
- package/out/web/assets/{swimlanes-XN3QIQJK-Bn_jcZz-.js → swimlanes-XN3QIQJK-igYhTjXB.js} +1 -1
- package/out/web/assets/swimlanesDiagram-VK2B7HYN-DpVik9v7.js +8 -0
- package/out/web/assets/{timeline-definition-24CTP7MA-CdTERuJZ.js → timeline-definition-24CTP7MA-Dke2p93p.js} +1 -1
- package/out/web/assets/{treeView-Q6P3EWNA-TKBKQG6R.js → treeView-Q6P3EWNA-hNELnXUs.js} +1 -1
- package/out/web/assets/{treemap-WGGIJYW6-BP7gQoiC.js → treemap-WGGIJYW6-D2B6wDsx.js} +1 -1
- package/out/web/assets/{vennDiagram-4TSXK5OY-BHUmxDuK.js → vennDiagram-4TSXK5OY-CDkW7rUP.js} +1 -1
- package/out/web/assets/{wardley-WFR3VGLG-9bct5AAN.js → wardley-WFR3VGLG-BECdXETi.js} +1 -1
- package/out/web/assets/{wardleyDiagram-VM6X3IG4-BfJwDDso.js → wardleyDiagram-VM6X3IG4-B5BycpQ4.js} +1 -1
- package/out/web/assets/window-5qYXKoW7.js +1 -0
- package/out/web/assets/{xychartDiagram-S5SC5T6Z-Dqd9Mvpo.js → xychartDiagram-S5SC5T6Z-CtJS3b--.js} +1 -1
- package/out/web/index-web.html +3 -4
- package/out/web/index.html +3 -4
- package/package.json +17 -6
- package/skills-lock.json +36 -0
- package/slash-commands.json +9 -0
- package/src/renderer/index-web.html +1 -0
- package/src/renderer/index.html +1 -0
- package/src/renderer/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/src/renderer/shared/agentProgress.ts +168 -3
- package/src/renderer/shared/components/AgentActivityDrawer.tsx +6 -6
- package/src/renderer/shared/components/AgentActivityTable.tsx +192 -132
- package/src/renderer/shared/components/ArtifactPreviewPanel.tsx +4 -4
- package/src/renderer/shared/components/AuthGate.tsx +4 -9
- package/src/renderer/shared/components/CalculationCard.tsx +41 -15
- package/src/renderer/shared/components/ChatMessageItem.tsx +20 -21
- package/src/renderer/shared/components/ChatPanel.tsx +432 -193
- package/src/renderer/shared/components/ChunkErrorBoundary.tsx +198 -49
- package/src/renderer/shared/components/CliSessionsView.tsx +495 -0
- package/src/renderer/shared/components/CodeReviewPage.tsx +565 -0
- package/src/renderer/shared/components/CommandPalette.tsx +8 -8
- package/src/renderer/shared/components/DashboardSidebar.tsx +862 -125
- package/src/renderer/shared/components/DesktopTitlebar.tsx +345 -0
- package/src/renderer/shared/components/DiffReviewModal.tsx +3 -3
- package/src/renderer/shared/components/GitBranchSelector.tsx +442 -0
- package/src/renderer/shared/components/ImageGenCard.tsx +31 -12
- package/src/renderer/shared/components/ImageSearchCard.tsx +59 -38
- package/src/renderer/shared/components/ImageStudioPanel.tsx +40 -41
- package/src/renderer/shared/components/InlineThoughtNote.tsx +27 -0
- package/src/renderer/shared/components/LinkedFoldersView.tsx +365 -46
- package/src/renderer/shared/components/McpRegistryPicker.tsx +1 -1
- package/src/renderer/shared/components/McpServersView.tsx +24 -22
- package/src/renderer/shared/components/MermaidCard.tsx +14 -8
- package/src/renderer/shared/components/MintDashboard.tsx +1141 -508
- package/src/renderer/shared/components/ModelSelectorPopover.tsx +535 -214
- package/src/renderer/shared/components/PlanChecklistWidget.tsx +1 -1
- package/src/renderer/shared/components/PluginsView.tsx +1 -1
- package/src/renderer/shared/components/RewindModal.tsx +6 -6
- package/src/renderer/shared/components/RunSummaryDashboard.tsx +3 -3
- package/src/renderer/shared/components/ScheduledTasksView.tsx +4 -4
- package/src/renderer/shared/components/ScreenCaptureDialog.css +221 -0
- package/src/renderer/shared/components/ScreenCaptureDialog.tsx +199 -0
- package/src/renderer/shared/components/Settings/AgentsTab.tsx +34 -39
- package/src/renderer/shared/components/Settings/AudioTab.tsx +8 -8
- package/src/renderer/shared/components/Settings/AutomationTab.tsx +8 -58
- package/src/renderer/shared/components/Settings/AvatarCropModal.tsx +368 -0
- package/src/renderer/shared/components/Settings/GeneralTab.tsx +335 -81
- package/src/renderer/shared/components/Settings/MemoryTab.tsx +3 -3
- package/src/renderer/shared/components/Settings/PluginsTab.tsx +20 -12
- package/src/renderer/shared/components/Settings/ProfileTab.tsx +29 -5
- package/src/renderer/shared/components/Settings/SearchableModelCombobox.tsx +411 -0
- package/src/renderer/shared/components/Settings/ThemeTab.tsx +401 -158
- package/src/renderer/shared/components/SkillsView.tsx +41 -16
- package/src/renderer/shared/components/SlashSuggestions.tsx +3 -2
- package/src/renderer/shared/components/SourcesBlock.tsx +44 -32
- package/src/renderer/shared/components/StockCard.tsx +58 -24
- package/src/renderer/shared/components/SubagentDagView.tsx +4 -4
- package/src/renderer/shared/components/TerminalDock.tsx +241 -0
- package/src/renderer/shared/components/ThinkingBlock.tsx +14 -8
- package/src/renderer/shared/components/ToolSurfacePage.tsx +520 -0
- package/src/renderer/shared/components/UiFeatureCard.tsx +267 -0
- package/src/renderer/shared/components/UiGridCard.tsx +188 -0
- package/src/renderer/shared/components/UiMockupWidget.tsx +149 -0
- package/src/renderer/shared/components/VeoStudioPanel.tsx +13 -29
- package/src/renderer/shared/components/WeatherCard.tsx +3 -3
- package/src/renderer/shared/components/WorkspaceContextPopover.tsx +133 -0
- package/src/renderer/shared/components/WorkspaceSelector.tsx +149 -0
- package/src/renderer/shared/constants/config.ts +28 -3
- package/src/renderer/shared/constants/models.ts +189 -2
- package/src/renderer/shared/conversation/coordinator.test.ts +27 -0
- package/src/renderer/shared/conversation/coordinator.ts +82 -0
- package/src/renderer/shared/conversation/syncView.test.ts +46 -0
- package/src/renderer/shared/conversation/syncView.ts +43 -0
- package/src/renderer/shared/conversation/useConversationCoordinator.ts +106 -0
- package/src/renderer/shared/css/agent-observability.css +35 -3
- package/src/renderer/shared/css/auth-gate.css +2 -2
- package/src/renderer/shared/css/chat-ui-cards.css +495 -0
- package/src/renderer/shared/css/code-review.css +823 -0
- package/src/renderer/shared/css/code-sessions.css +452 -0
- package/src/renderer/shared/css/file-changes.css +132 -0
- package/src/renderer/shared/css/image-studio.css +16 -16
- package/src/renderer/shared/css/management-views.css +277 -27
- package/src/renderer/shared/css/model-selector.css +442 -42
- package/src/renderer/shared/css/settings/agents.css +1 -1
- package/src/renderer/shared/css/settings/automation.css +13 -13
- package/src/renderer/shared/css/settings/general.css +526 -5
- package/src/renderer/shared/css/settings/plugins.css +5 -5
- package/src/renderer/shared/css/settings/profile.css +331 -1
- package/src/renderer/shared/css/settings/theme.css +651 -3
- package/src/renderer/shared/css/veo-studio.css +16 -15
- package/src/renderer/shared/fonts.ts +19 -37
- package/src/renderer/shared/platform.test.ts +34 -0
- package/src/renderer/shared/platform.ts +173 -6
- package/src/renderer/shared/theme/themeManager.ts +144 -0
- package/src/renderer/shared/theme/themes.ts +116 -0
- package/src/renderer/shared/theme/tokens.css +318 -0
- package/src/renderer/shared/types.ts +82 -1
- package/src/renderer/shared/utils/agentActivity.ts +126 -5
- package/src/renderer/shared/utils/cardJson.test.ts +35 -0
- package/src/renderer/shared/utils/cardJson.ts +30 -0
- package/src/renderer/shared/utils/fileIcons.ts +1 -1
- package/src/renderer/shared/utils/markdown.tsx +329 -80
- package/src/renderer/shared/utils/markdown.webImages.test.tsx +40 -0
- package/src/renderer/shared/utils/providers.ts +8 -3
- package/src/renderer/shared/utils/screenCapture.ts +43 -0
- package/src/renderer/shared/utils/slashCommandProcessor.ts +4 -1
- package/src/renderer/shared/utils/ui.ts +4 -64
- package/src/renderer/src/App.tsx +7 -0
- package/src/renderer/src/components/BrowserShell.tsx +108 -0
- package/src/renderer/src/components/BrowserSuggestionsPopup.tsx +91 -0
- package/src/renderer/src/components/Live2DStage.tsx +32 -9
- package/src/renderer/src/components/MintDashboard.tsx +4 -2
- package/src/renderer/src/components/ModelPanel.tsx +2 -1
- package/src/renderer/src/components/PicturesLibrary.tsx +3 -2
- package/src/renderer/src/components/ScreenPicker.css +190 -0
- package/src/renderer/src/components/ScreenPicker.tsx +185 -540
- package/src/renderer/src/components/SettingsWindow.tsx +40 -2
- package/src/renderer/src/components/SpotlightWindow.tsx +1 -0
- package/src/renderer/src/components/WidgetWindow.tsx +27 -3
- package/src/renderer/src/components/WorkspacePanel.tsx +61 -43
- package/src/renderer/src/components/browser-shell.css +185 -0
- package/src/renderer/src/components/browser-suggestions-popup.css +55 -0
- package/src/renderer/src/components/liveTranslateFrames.test.ts +23 -0
- package/src/renderer/src/components/liveTranslateFrames.ts +34 -0
- package/src/renderer/src/css/app-shell.css +394 -113
- package/src/renderer/src/css/chat.css +1926 -380
- package/src/renderer/src/css/dashboard.css +11 -0
- package/src/renderer/src/css/desktop-tools.css +730 -0
- package/src/renderer/src/css/misc.css +19 -22
- package/src/renderer/src/css/model.css +49 -48
- package/src/renderer/src/css/pictures.css +144 -136
- package/src/renderer/src/css/settings/base.css +357 -123
- package/src/renderer/src/css/sidebar-workspace.css +930 -291
- package/src/renderer/src/css/spotlight.css +15 -26
- package/src/renderer/src/css/tool-surfaces.css +728 -0
- package/src/renderer/src/css/widget.css +35 -7
- package/src/renderer/src/env.d.ts +3 -0
- package/src/renderer/src/hooks/useProviderModels.ts +2 -9
- package/src/renderer/src/index.css +53 -46
- package/src/renderer/src/main.tsx +11 -0
- package/src/renderer/src/tauri.ts +201 -30
- package/src/renderer/src-web/App.tsx +40 -0
- package/src/renderer/src-web/components/MintDashboard.tsx +4 -2
- package/src/renderer/src-web/components/PicturesLibrary.tsx +3 -2
- package/src/renderer/src-web/components/PullToRefresh.tsx +107 -0
- package/src/renderer/src-web/components/SettingsWindow.tsx +28 -2
- package/src/renderer/src-web/css/app-shell.css +174 -96
- package/src/renderer/src-web/css/chat.css +1519 -316
- package/src/renderer/src-web/css/dashboard.css +11 -0
- package/src/renderer/src-web/css/misc.css +17 -17
- package/src/renderer/src-web/css/mobile.css +678 -0
- package/src/renderer/src-web/css/model.css +46 -46
- package/src/renderer/src-web/css/pictures.css +81 -34
- package/src/renderer/src-web/css/pull-to-refresh.css +54 -0
- package/src/renderer/src-web/css/settings/base.css +316 -100
- package/src/renderer/src-web/css/settings/mobile.css +320 -0
- package/src/renderer/src-web/css/sidebar-workspace.css +545 -100
- package/src/renderer/src-web/css/spotlight.css +9 -26
- package/src/renderer/src-web/css/widget.css +0 -5
- package/src/renderer/src-web/env.d.ts +3 -0
- package/src/renderer/src-web/hooks/useProviderModels.ts +2 -9
- package/src/renderer/src-web/index.css +53 -96
- package/src/renderer/src-web/main.tsx +11 -0
- package/src/renderer/src-web/tauri.ts +200 -30
- package/vite.config.web.ts +1 -0
- package/out/web/assets/MintDashboard-DWSqucgb.js +0 -57
- package/out/web/assets/SettingsWindow-DFM2aj5B.js +0 -2
- package/out/web/assets/chunk-CKBBP62Z-nr1uKPj9.js +0 -2
- package/out/web/assets/chunk-DSNCTWBM-Dtj8Rqsd.js +0 -2
- package/out/web/assets/chunk-DU6HZSFF-2tv5K1wT.js +0 -128
- package/out/web/assets/classDiagram-DTDB5LWJ-BdSFArgw.js +0 -1
- package/out/web/assets/classDiagram-v2-JRS7N3AN-BdSFArgw.js +0 -1
- package/out/web/assets/core-DImejIUG.js +0 -1
- package/out/web/assets/dist-js-BxuKEVWM.js +0 -1
- package/out/web/assets/event-BNl8Zahw.js +0 -1
- package/out/web/assets/fira-code-cyrillic-400-normal-UC0NFL4U.woff2 +0 -0
- package/out/web/assets/fira-code-cyrillic-400-normal-dc1q3VD7.woff +0 -0
- package/out/web/assets/fira-code-cyrillic-500-normal-Bu7VCL72.woff +0 -0
- package/out/web/assets/fira-code-cyrillic-500-normal-CX35h3Mg.woff2 +0 -0
- package/out/web/assets/fira-code-cyrillic-ext-400-normal-Buh61xzB.woff +0 -0
- package/out/web/assets/fira-code-cyrillic-ext-400-normal-txZ9Fk_1.woff2 +0 -0
- package/out/web/assets/fira-code-cyrillic-ext-500-normal-CYRspHgm.woff2 +0 -0
- package/out/web/assets/fira-code-cyrillic-ext-500-normal-CwtLmSFD.woff +0 -0
- package/out/web/assets/fira-code-greek-400-normal-B2Gh_Y8s.woff2 +0 -0
- package/out/web/assets/fira-code-greek-400-normal-DobhaxvF.woff +0 -0
- package/out/web/assets/fira-code-greek-500-normal-CVO0IRNt.woff2 +0 -0
- package/out/web/assets/fira-code-greek-500-normal-DEXIWiey.woff +0 -0
- package/out/web/assets/fira-code-greek-ext-400-normal-DR7mBgIM.woff2 +0 -0
- package/out/web/assets/fira-code-greek-ext-400-normal-DSPUheWg.woff +0 -0
- package/out/web/assets/fira-code-greek-ext-500-normal-BO3iq16n.woff2 +0 -0
- package/out/web/assets/fira-code-greek-ext-500-normal-CMiNLXER.woff +0 -0
- package/out/web/assets/fira-code-latin-ext-400-normal-DG73JjOf.woff +0 -0
- package/out/web/assets/fira-code-latin-ext-400-normal-KSMg0QLl.woff2 +0 -0
- package/out/web/assets/fira-code-latin-ext-500-normal-CaANqXjI.woff +0 -0
- package/out/web/assets/fira-code-latin-ext-500-normal-Crd9e_oI.woff2 +0 -0
- package/out/web/assets/flowDiagram-A5DVABFB-BpnHUSU7.js +0 -1
- package/out/web/assets/index-CVRg270z.css +0 -1
- package/out/web/assets/index-DxZQr9yD.js +0 -10
- package/out/web/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/out/web/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/out/web/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/out/web/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/out/web/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- package/out/web/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- package/out/web/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/out/web/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/out/web/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/out/web/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/out/web/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- package/out/web/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- package/out/web/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/out/web/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/out/web/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/out/web/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/out/web/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- package/out/web/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- package/out/web/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/out/web/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/out/web/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/out/web/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/out/web/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- package/out/web/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- package/out/web/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/out/web/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/out/web/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/out/web/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/out/web/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/out/web/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/out/web/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/out/web/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/out/web/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/out/web/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/out/web/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- package/out/web/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- package/out/web/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/out/web/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/out/web/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/out/web/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/out/web/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- package/out/web/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- package/out/web/assets/kanit-latin-400-normal-BUlsQXH3.woff2 +0 -0
- package/out/web/assets/kanit-latin-400-normal-HVZWrfev.woff +0 -0
- package/out/web/assets/kanit-latin-500-normal-CX_4XcKi.woff2 +0 -0
- package/out/web/assets/kanit-latin-500-normal-qBha86O4.woff +0 -0
- package/out/web/assets/kanit-latin-600-normal-0lS78yAd.woff2 +0 -0
- package/out/web/assets/kanit-latin-600-normal-DlacpeTg.woff +0 -0
- package/out/web/assets/kanit-latin-ext-400-normal-B2xPf58u.woff2 +0 -0
- package/out/web/assets/kanit-latin-ext-400-normal-CHvNKHHD.woff +0 -0
- package/out/web/assets/kanit-latin-ext-500-normal-BFdWrG22.woff +0 -0
- package/out/web/assets/kanit-latin-ext-500-normal-EHs3suD6.woff2 +0 -0
- package/out/web/assets/kanit-latin-ext-600-normal-BBDzoLaj.woff +0 -0
- package/out/web/assets/kanit-latin-ext-600-normal-DAX3wtuq.woff2 +0 -0
- package/out/web/assets/kanit-thai-400-normal-D2nliXKa.woff +0 -0
- package/out/web/assets/kanit-thai-400-normal-D80Pglro.woff2 +0 -0
- package/out/web/assets/kanit-thai-500-normal-BB8gri04.woff2 +0 -0
- package/out/web/assets/kanit-thai-500-normal-Iy_w0a80.woff +0 -0
- package/out/web/assets/kanit-thai-600-normal-Bj6oiaDc.woff2 +0 -0
- package/out/web/assets/kanit-thai-600-normal-wbTlPO7I.woff +0 -0
- package/out/web/assets/kanit-vietnamese-400-normal-DRI8YWyb.woff2 +0 -0
- package/out/web/assets/kanit-vietnamese-400-normal-dow6Bnto.woff +0 -0
- package/out/web/assets/kanit-vietnamese-500-normal-BzTrpCM3.woff2 +0 -0
- package/out/web/assets/kanit-vietnamese-500-normal-T1ndT7MF.woff +0 -0
- package/out/web/assets/kanit-vietnamese-600-normal-Bi7fw3I4.woff2 +0 -0
- package/out/web/assets/kanit-vietnamese-600-normal-DXCRAa_8.woff +0 -0
- package/out/web/assets/mali-latin-400-normal-ByPcZ8Gx.woff +0 -0
- package/out/web/assets/mali-latin-400-normal-Cuc6Ykl8.woff2 +0 -0
- package/out/web/assets/mali-latin-500-normal-B01M-LP6.woff2 +0 -0
- package/out/web/assets/mali-latin-500-normal-Thgqw_9f.woff +0 -0
- package/out/web/assets/mali-latin-600-normal-B9TiUNpT.woff2 +0 -0
- package/out/web/assets/mali-latin-600-normal-CycpQCwU.woff +0 -0
- package/out/web/assets/mali-latin-ext-400-normal-DUVdJQO4.woff +0 -0
- package/out/web/assets/mali-latin-ext-400-normal-iCG1ALuJ.woff2 +0 -0
- package/out/web/assets/mali-latin-ext-500-normal-BfJE4UMZ.woff2 +0 -0
- package/out/web/assets/mali-latin-ext-500-normal-FoLEyOKS.woff +0 -0
- package/out/web/assets/mali-latin-ext-600-normal-BTvIfiCp.woff2 +0 -0
- package/out/web/assets/mali-latin-ext-600-normal-DAQcLVmD.woff +0 -0
- package/out/web/assets/mali-thai-400-normal-BO7A3bLZ.woff2 +0 -0
- package/out/web/assets/mali-thai-400-normal-CX9VrjTn.woff +0 -0
- package/out/web/assets/mali-thai-500-normal-Cph2qha9.woff +0 -0
- package/out/web/assets/mali-thai-500-normal-D89rMT77.woff2 +0 -0
- package/out/web/assets/mali-thai-600-normal-DPgXT6rZ.woff +0 -0
- package/out/web/assets/mali-thai-600-normal-DlTx3OsB.woff2 +0 -0
- package/out/web/assets/mali-vietnamese-400-normal-DUKxzXaz.woff2 +0 -0
- package/out/web/assets/mali-vietnamese-400-normal-gFDLvsOK.woff +0 -0
- package/out/web/assets/mali-vietnamese-500-normal--OY07q2c.woff +0 -0
- package/out/web/assets/mali-vietnamese-500-normal-KDrNRwfW.woff2 +0 -0
- package/out/web/assets/mali-vietnamese-600-normal-CtTMUU7T.woff +0 -0
- package/out/web/assets/mali-vietnamese-600-normal-DFlJr66u.woff2 +0 -0
- package/out/web/assets/mermaid.core-DYGGlqOf.js +0 -11
- package/out/web/assets/mitr-latin-400-normal-Cb18vPmZ.woff +0 -0
- package/out/web/assets/mitr-latin-400-normal-CwbkLQ4a.woff2 +0 -0
- package/out/web/assets/mitr-latin-500-normal-B4JOhzAi.woff +0 -0
- package/out/web/assets/mitr-latin-500-normal-BmClOow2.woff2 +0 -0
- package/out/web/assets/mitr-latin-ext-400-normal-B3CPG7Yo.woff2 +0 -0
- package/out/web/assets/mitr-latin-ext-400-normal-DTx65hiC.woff +0 -0
- package/out/web/assets/mitr-latin-ext-500-normal-B_Diajz1.woff2 +0 -0
- package/out/web/assets/mitr-latin-ext-500-normal-DYOsVaVT.woff +0 -0
- package/out/web/assets/mitr-thai-400-normal-CS4Do6aM.woff +0 -0
- package/out/web/assets/mitr-thai-400-normal-CXWaAdVj.woff2 +0 -0
- package/out/web/assets/mitr-thai-500-normal-CVdBrEVH.woff2 +0 -0
- package/out/web/assets/mitr-thai-500-normal-CW_B5D-i.woff +0 -0
- package/out/web/assets/mitr-vietnamese-400-normal-CPMGWyoC.woff2 +0 -0
- package/out/web/assets/mitr-vietnamese-400-normal-Z6XhIpdY.woff +0 -0
- package/out/web/assets/mitr-vietnamese-500-normal-CDrv0585.woff2 +0 -0
- package/out/web/assets/mitr-vietnamese-500-normal-CMQWyq-Z.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-400-normal-BaWBrqFP.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-latin-400-normal-Dh_FJjOB.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-500-normal-BC04jsmm.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-500-normal-fyBKClF1.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-latin-600-normal-CemcjnVR.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-latin-600-normal-Dbc-dNO6.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-400-normal-B-1H0YkH.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-400-normal-nBP59pVw.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-500-normal-B-ZWb8SZ.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-500-normal-CrEHO7C8.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-600-normal-PkMZo0xa.woff +0 -0
- package/out/web/assets/noto-sans-thai-latin-ext-600-normal-maHHBsez.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-thai-400-normal-BEOmKAI1.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-thai-400-normal-Dxb_unuU.woff +0 -0
- package/out/web/assets/noto-sans-thai-thai-500-normal-BOGXO2tw.woff +0 -0
- package/out/web/assets/noto-sans-thai-thai-500-normal-CU_X86GQ.woff2 +0 -0
- package/out/web/assets/noto-sans-thai-thai-600-normal-CmgB8_JK.woff +0 -0
- package/out/web/assets/noto-sans-thai-thai-600-normal-Cs73sVjl.woff2 +0 -0
- package/out/web/assets/oauthManager-DNiwM8Rn.js +0 -2
- package/out/web/assets/oauthManager-DuamS1Av.css +0 -1
- package/out/web/assets/outfit-latin-300-normal-AWLfuCom.woff +0 -0
- package/out/web/assets/outfit-latin-300-normal-CRYTwY6m.woff2 +0 -0
- package/out/web/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
- package/out/web/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
- package/out/web/assets/outfit-latin-500-normal-ClnHRwRh.woff +0 -0
- package/out/web/assets/outfit-latin-500-normal-DKnIMDSk.woff2 +0 -0
- package/out/web/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
- package/out/web/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
- package/out/web/assets/outfit-latin-ext-300-normal-BYS6Dpvq.woff2 +0 -0
- package/out/web/assets/outfit-latin-ext-300-normal-CMIMshEd.woff +0 -0
- package/out/web/assets/outfit-latin-ext-400-normal-5tcqmc2S.woff2 +0 -0
- package/out/web/assets/outfit-latin-ext-400-normal-DHm7mdGe.woff +0 -0
- package/out/web/assets/outfit-latin-ext-500-normal-DrCvqoFD.woff +0 -0
- package/out/web/assets/outfit-latin-ext-500-normal-zeox_O30.woff2 +0 -0
- package/out/web/assets/outfit-latin-ext-600-normal-B85nYjL1.woff2 +0 -0
- package/out/web/assets/outfit-latin-ext-600-normal-CWJcPgd7.woff +0 -0
- package/out/web/assets/preload-helper-D0uHx7FM.js +0 -1
- package/out/web/assets/prompt-latin-ext-400-normal-1pHbN9uy.woff +0 -0
- package/out/web/assets/prompt-latin-ext-400-normal-DdSafGZ9.woff2 +0 -0
- package/out/web/assets/prompt-latin-ext-500-normal--EZ1um7s.woff2 +0 -0
- package/out/web/assets/prompt-latin-ext-500-normal-D-lI1EVT.woff +0 -0
- package/out/web/assets/prompt-latin-ext-600-normal-C8b50x67.woff +0 -0
- package/out/web/assets/prompt-latin-ext-600-normal-Cg9L7iJU.woff2 +0 -0
- package/out/web/assets/prompt-vietnamese-400-normal-BCPzsgPT.woff2 +0 -0
- package/out/web/assets/prompt-vietnamese-400-normal-D4pLyeNK.woff +0 -0
- package/out/web/assets/prompt-vietnamese-500-normal-DmzxmPwa.woff2 +0 -0
- package/out/web/assets/prompt-vietnamese-500-normal-w_sS_j2F.woff +0 -0
- package/out/web/assets/prompt-vietnamese-600-normal-1dyohtNh.woff +0 -0
- package/out/web/assets/prompt-vietnamese-600-normal-7QWjJBsF.woff2 +0 -0
- package/out/web/assets/sarabun-latin-400-normal-DmguIS-7.woff +0 -0
- package/out/web/assets/sarabun-latin-400-normal-URPBxl-K.woff2 +0 -0
- package/out/web/assets/sarabun-latin-500-normal-BjUTcdxu.woff2 +0 -0
- package/out/web/assets/sarabun-latin-500-normal-CJexTAnl.woff +0 -0
- package/out/web/assets/sarabun-latin-600-normal-9FonlkKx.woff +0 -0
- package/out/web/assets/sarabun-latin-600-normal-DMD3TROr.woff2 +0 -0
- package/out/web/assets/sarabun-latin-ext-400-normal-BbP7GpLL.woff2 +0 -0
- package/out/web/assets/sarabun-latin-ext-400-normal-BsmTn0SS.woff +0 -0
- package/out/web/assets/sarabun-latin-ext-500-normal-Cot16Bd2.woff +0 -0
- package/out/web/assets/sarabun-latin-ext-500-normal-DE1LysqI.woff2 +0 -0
- package/out/web/assets/sarabun-latin-ext-600-normal-0tXu9x_i.woff +0 -0
- package/out/web/assets/sarabun-latin-ext-600-normal-BRxjKUQ6.woff2 +0 -0
- package/out/web/assets/sarabun-thai-400-normal-C2DaJlKK.woff2 +0 -0
- package/out/web/assets/sarabun-thai-400-normal-CH-UbWgg.woff +0 -0
- package/out/web/assets/sarabun-thai-500-normal-BVssjame.woff2 +0 -0
- package/out/web/assets/sarabun-thai-500-normal-C3iDLEzi.woff +0 -0
- package/out/web/assets/sarabun-thai-600-normal-3dIAQ-_s.woff2 +0 -0
- package/out/web/assets/sarabun-thai-600-normal-DWKeTe6a.woff +0 -0
- package/out/web/assets/sarabun-vietnamese-400-normal-DPfkSCMy.woff +0 -0
- package/out/web/assets/sarabun-vietnamese-400-normal-igdrzAGY.woff2 +0 -0
- package/out/web/assets/sarabun-vietnamese-500-normal-CpRVvGRU.woff +0 -0
- package/out/web/assets/sarabun-vietnamese-500-normal-Dpe7Br9m.woff2 +0 -0
- package/out/web/assets/sarabun-vietnamese-600-normal-BMbOgAW-.woff +0 -0
- package/out/web/assets/sarabun-vietnamese-600-normal-DkxrOlLB.woff2 +0 -0
- package/out/web/assets/stateDiagram-v2-4QOOHH4V-s6P9g2_b.js +0 -1
- package/out/web/assets/swimlanesDiagram-VK2B7HYN-CV9fOLrV.js +0 -8
- package/out/web/assets/tauri-CNrHQ2Gb.js +0 -3
- package/out/web/assets/window-DkIhgI7B.js +0 -1
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
//! Coordinate input is authorized by target-local screenshot evidence, not a
|
|
2
|
+
//! whole-page hash. Backend node IDs survive reads but not node replacement.
|
|
3
|
+
use super::{cdp::cdp_call_raw, session::evaluate};
|
|
4
|
+
use crate::MintConfig;
|
|
5
|
+
use base64::Engine;
|
|
6
|
+
use image::RgbaImage;
|
|
7
|
+
use serde_json::{Value, json};
|
|
8
|
+
use std::time::{Duration, Instant};
|
|
9
|
+
|
|
10
|
+
pub(super) struct ScreenshotEvidence {
|
|
11
|
+
tab: String,
|
|
12
|
+
captured: Instant,
|
|
13
|
+
marker: Value,
|
|
14
|
+
image: RgbaImage,
|
|
15
|
+
snapshot_before: Value,
|
|
16
|
+
snapshot_after: Value,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async fn marker(config: &MintConfig) -> Result<Value, String> {
|
|
20
|
+
evaluate(config,"[location.href,globalThis.__mintScreenshotDocument ||= (crypto.randomUUID?.() || String(performance.timeOrigin)+Math.random()),scrollX,scrollY,innerWidth,innerHeight,devicePixelRatio]".into()).await
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fn snapshot(config: &MintConfig) -> Result<Value, String> {
|
|
24
|
+
Ok(cdp_call_raw(config,"DOMSnapshot.captureSnapshot",json!({"computedStyles":["pointer-events"],"includePaintOrder":true,"includeDOMRects":true})).await?["result"].clone())
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
pub(super) async fn capture(
|
|
28
|
+
config: &MintConfig,
|
|
29
|
+
tab: &str,
|
|
30
|
+
) -> Result<(String, ScreenshotEvidence), String> {
|
|
31
|
+
capture_at(config, tab, None).await
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// At initial capture the coordinate is unknown. Retain both layout epochs so
|
|
35
|
+
/// validation can check the eventual target without requiring distant DOM to
|
|
36
|
+
/// remain unchanged. A coordinate-aware recapture retries target movement once.
|
|
37
|
+
async fn capture_at(
|
|
38
|
+
config: &MintConfig,
|
|
39
|
+
tab: &str,
|
|
40
|
+
coordinate: Option<(f64, f64)>,
|
|
41
|
+
) -> Result<(String, ScreenshotEvidence), String> {
|
|
42
|
+
// Hide only Mint's two cosmetic surfaces, including their shadows. Restore
|
|
43
|
+
// the stylesheet even if capture fails; never hide website content.
|
|
44
|
+
let token = format!("mint-evidence-{}", uuid::Uuid::new_v4());
|
|
45
|
+
evaluate(config,format!("(() => {{const s=document.createElement('style'); s.id={}; s.textContent='#mint-cursor-overlay,#mint-browser-aura{{display:none!important}}';document.documentElement.appendChild(s);return true;}})()",json!(token))).await?;
|
|
46
|
+
let result = async {
|
|
47
|
+
for _ in 0..2 {
|
|
48
|
+
let before_marker = marker(config).await?;
|
|
49
|
+
let before = snapshot(config).await?;
|
|
50
|
+
let captured = Instant::now();
|
|
51
|
+
let data = super::screenshot(config).await?;
|
|
52
|
+
let after = snapshot(config).await?;
|
|
53
|
+
if before_marker != marker(config).await? {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
let bytes = base64::engine::general_purpose::STANDARD
|
|
57
|
+
.decode(&data)
|
|
58
|
+
.map_err(|e| e.to_string())?;
|
|
59
|
+
let image = image::load_from_memory(&bytes)
|
|
60
|
+
.map_err(|e| e.to_string())?
|
|
61
|
+
.to_rgba8();
|
|
62
|
+
let evidence = ScreenshotEvidence {
|
|
63
|
+
tab: tab.into(),
|
|
64
|
+
captured,
|
|
65
|
+
marker: before_marker,
|
|
66
|
+
image,
|
|
67
|
+
snapshot_before: before,
|
|
68
|
+
snapshot_after: after,
|
|
69
|
+
};
|
|
70
|
+
if coordinate.is_some_and(|(x, y)| target(&evidence, x, y).is_err()) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
return Ok((data, evidence));
|
|
74
|
+
}
|
|
75
|
+
Err("screenshot_stale: target or viewport changed during capture; capture again".into())
|
|
76
|
+
}
|
|
77
|
+
.await;
|
|
78
|
+
let _ = evaluate(
|
|
79
|
+
config,
|
|
80
|
+
format!("document.getElementById({})?.remove()", json!(token)),
|
|
81
|
+
)
|
|
82
|
+
.await;
|
|
83
|
+
result
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#[derive(Debug, PartialEq)]
|
|
87
|
+
struct Target {
|
|
88
|
+
backend: i64,
|
|
89
|
+
bounds: Value,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
fn ancestor(nodes: &Value, ancestor: usize, mut child: usize) -> bool {
|
|
93
|
+
loop {
|
|
94
|
+
if ancestor == child {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
let Some(parent) = nodes["parentIndex"][child].as_i64().filter(|p| *p >= 0) else {
|
|
98
|
+
return false;
|
|
99
|
+
};
|
|
100
|
+
child = parent as usize;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
fn target(evidence: &ScreenshotEvidence, x: f64, y: f64) -> Result<Target, String> {
|
|
105
|
+
let before = target_in_snapshot(&evidence.snapshot_before, &evidence.marker, x, y)?;
|
|
106
|
+
let after = target_in_snapshot(&evidence.snapshot_after, &evidence.marker, x, y)?;
|
|
107
|
+
if before != after {
|
|
108
|
+
return Err("screenshot_stale: target changed around image capture".into());
|
|
109
|
+
}
|
|
110
|
+
Ok(before)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
fn target_in_snapshot(snapshot: &Value, marker: &Value, x: f64, y: f64) -> Result<Target, String> {
|
|
114
|
+
let stale = || {
|
|
115
|
+
"screenshot_stale: ambiguous coordinate target; capture again or use an element".to_string()
|
|
116
|
+
};
|
|
117
|
+
let document = &snapshot["documents"][0];
|
|
118
|
+
let nodes = &document["nodes"];
|
|
119
|
+
let layout = &document["layout"];
|
|
120
|
+
let indices = layout["nodeIndex"].as_array().ok_or_else(stale)?;
|
|
121
|
+
let sx = marker[2].as_f64().ok_or_else(stale)?;
|
|
122
|
+
let sy = marker[3].as_f64().ok_or_else(stale)?;
|
|
123
|
+
let mut candidates = Vec::new();
|
|
124
|
+
for (i, index) in indices.iter().enumerate() {
|
|
125
|
+
let Some(node) = index.as_u64().map(|n| n as usize) else {
|
|
126
|
+
continue;
|
|
127
|
+
};
|
|
128
|
+
if nodes["nodeType"][node] != 1 {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
let b = &layout["bounds"][i];
|
|
132
|
+
let Some(rect) = b.as_array().filter(|r| r.len() == 4) else {
|
|
133
|
+
continue;
|
|
134
|
+
};
|
|
135
|
+
let r: Vec<f64> = rect.iter().filter_map(Value::as_f64).collect();
|
|
136
|
+
if r.len() != 4
|
|
137
|
+
|| x + sx < r[0]
|
|
138
|
+
|| y + sy < r[1]
|
|
139
|
+
|| x + sx >= r[0] + r[2]
|
|
140
|
+
|| y + sy >= r[1] + r[3]
|
|
141
|
+
{
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
let style = layout["styles"][i][0].as_u64().map(|v| v as usize);
|
|
145
|
+
if style.is_some_and(|v| snapshot["strings"][v] == "none") {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
let paint = layout["paintOrders"][i].as_i64().ok_or_else(stale)?;
|
|
149
|
+
candidates.push((paint, node, i));
|
|
150
|
+
}
|
|
151
|
+
let top = candidates.iter().map(|v| v.0).max().ok_or_else(stale)?;
|
|
152
|
+
let mut chosen: Option<(usize, usize)> = None;
|
|
153
|
+
for (_, node, i) in candidates.into_iter().filter(|v| v.0 == top) {
|
|
154
|
+
if let Some((previous, _)) = chosen {
|
|
155
|
+
if ancestor(nodes, node, previous) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if !ancestor(nodes, previous, node) {
|
|
159
|
+
return Err(stale());
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
chosen = Some((node, i));
|
|
163
|
+
}
|
|
164
|
+
let (node, i) = chosen.ok_or_else(stale)?;
|
|
165
|
+
Ok(Target {
|
|
166
|
+
backend: nodes["backendNodeId"][node].as_i64().ok_or_else(stale)?,
|
|
167
|
+
bounds: layout["bounds"][i].clone(),
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fn pixels_match(old: &ScreenshotEvidence, new: &ScreenshotEvidence, x: f64, y: f64) -> bool {
|
|
172
|
+
if old.image.dimensions() != new.image.dimensions() {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
let scale_x = old.image.width() as f64 / old.marker[4].as_f64().unwrap_or(1.0);
|
|
176
|
+
let scale_y = old.image.height() as f64 / old.marker[5].as_f64().unwrap_or(1.0);
|
|
177
|
+
let cx = (x * scale_x).round() as i64;
|
|
178
|
+
let cy = (y * scale_y).round() as i64;
|
|
179
|
+
for py in (cy - 32).max(0)..(cy + 32).min(old.image.height() as i64) {
|
|
180
|
+
for px in (cx - 32).max(0)..(cx + 32).min(old.image.width() as i64) {
|
|
181
|
+
if old.image.get_pixel(px as u32, py as u32)
|
|
182
|
+
!= new.image.get_pixel(px as u32, py as u32)
|
|
183
|
+
{
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
true
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
pub(super) async fn validate(
|
|
192
|
+
config: &MintConfig,
|
|
193
|
+
evidence: &ScreenshotEvidence,
|
|
194
|
+
tab: &str,
|
|
195
|
+
args: &Value,
|
|
196
|
+
) -> Result<(), String> {
|
|
197
|
+
if evidence.tab != tab || evidence.captured.elapsed() >= Duration::from_secs(30) {
|
|
198
|
+
return Err("screenshot_stale: screenshot expired or tab changed".into());
|
|
199
|
+
}
|
|
200
|
+
let x = args["x"].as_f64().ok_or("x required")?;
|
|
201
|
+
let y = args["y"].as_f64().ok_or("y required")?;
|
|
202
|
+
if !x.is_finite()
|
|
203
|
+
|| !y.is_finite()
|
|
204
|
+
|| x < 0.0
|
|
205
|
+
|| y < 0.0
|
|
206
|
+
|| x >= evidence.marker[4].as_f64().unwrap_or(0.0)
|
|
207
|
+
|| y >= evidence.marker[5].as_f64().unwrap_or(0.0)
|
|
208
|
+
{
|
|
209
|
+
return Err("screenshot_stale: coordinate outside viewport".into());
|
|
210
|
+
}
|
|
211
|
+
let original = target(evidence, x, y)?;
|
|
212
|
+
let (_, current) = capture_at(config, tab, Some((x, y))).await?;
|
|
213
|
+
if evidence.marker != current.marker
|
|
214
|
+
|| original != target(¤t, x, y)?
|
|
215
|
+
|| !pixels_match(evidence, ¤t, x, y)
|
|
216
|
+
{
|
|
217
|
+
return Err("screenshot_stale: target identity, geometry, or pixels changed".into());
|
|
218
|
+
}
|
|
219
|
+
// DOM location lookup uses main-document coordinates, while screenshots
|
|
220
|
+
// and Input.dispatchMouseEvent use viewport coordinates.
|
|
221
|
+
let document_x = x + current.marker[2]
|
|
222
|
+
.as_f64()
|
|
223
|
+
.ok_or("screenshot_stale: missing scroll geometry")?;
|
|
224
|
+
let document_y = y + current.marker[3]
|
|
225
|
+
.as_f64()
|
|
226
|
+
.ok_or("screenshot_stale: missing scroll geometry")?;
|
|
227
|
+
let hit=cdp_call_raw(config,"DOM.getNodeForLocation",json!({"x":document_x.floor() as i64,"y":document_y.floor() as i64,"includeUserAgentShadowDOM":false,"ignorePointerEventsNone":false})).await?;
|
|
228
|
+
if hit["result"]["backendNodeId"].as_i64() != Some(original.backend) {
|
|
229
|
+
return Err("screenshot_stale: target is obstructed".into());
|
|
230
|
+
}
|
|
231
|
+
Ok(())
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
pub(super) async fn input(
|
|
235
|
+
config: &MintConfig,
|
|
236
|
+
evidence: &ScreenshotEvidence,
|
|
237
|
+
tab: &str,
|
|
238
|
+
action: &str,
|
|
239
|
+
args: &Value,
|
|
240
|
+
) -> Result<String, String> {
|
|
241
|
+
let x = args["x"].as_f64().ok_or("x required")?;
|
|
242
|
+
let y = args["y"].as_f64().ok_or("y required")?;
|
|
243
|
+
super::mouse_move(config, x, y).await?;
|
|
244
|
+
tokio::time::sleep(Duration::from_millis(60)).await;
|
|
245
|
+
validate(config, evidence, tab, args).await?;
|
|
246
|
+
if action == "browser_mouse_move" {
|
|
247
|
+
return Ok("mouse moved".into());
|
|
248
|
+
}
|
|
249
|
+
let button = match args["button"].as_str() {
|
|
250
|
+
Some("right") => "right",
|
|
251
|
+
Some("middle") => "middle",
|
|
252
|
+
_ => "left",
|
|
253
|
+
};
|
|
254
|
+
// No second move or cosmetic animation between the final check and press.
|
|
255
|
+
for kind in ["mousePressed", "mouseReleased"] {
|
|
256
|
+
cdp_call_raw(config,"Input.dispatchMouseEvent",json!({"type":kind,"x":x,"y":y,"button":button,"buttons":if kind=="mousePressed" {match button {"right"=>2,"middle"=>4,_=>1}} else {0},"clickCount":1})).await?;
|
|
257
|
+
}
|
|
258
|
+
super::navigate::wait_for_page_load(config).await;
|
|
259
|
+
Ok(format!("clicked at ({x:.0},{y:.0}) with {button} button"))
|
|
260
|
+
}
|
|
@@ -157,7 +157,7 @@ pub async fn mouse_click(
|
|
|
157
157
|
pub async fn type_text_native(config: &MintConfig, text: &str) -> Result<String, String> {
|
|
158
158
|
log_action(
|
|
159
159
|
"TYPE",
|
|
160
|
-
&format!("Native typing:
|
|
160
|
+
&format!("Native typing: {} characters", text.chars().count()),
|
|
161
161
|
);
|
|
162
162
|
ensure_page_open(config).await?;
|
|
163
163
|
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
use crate::MintConfig;
|
|
6
6
|
use serde_json::{Value, json};
|
|
7
7
|
|
|
8
|
-
use super::cdp::{
|
|
8
|
+
use super::cdp::{cdp_call_raw, response_error};
|
|
9
9
|
use super::input::{mouse_click, type_text_native};
|
|
10
10
|
use super::lifecycle::ensure_page_open;
|
|
11
11
|
use super::logging::log_action;
|
|
12
|
-
use super::navigate::wait_for_page_load;
|
|
13
12
|
use super::overlay::inject_overlay;
|
|
14
13
|
|
|
15
14
|
/// Click a CSS selector element using native CDP mouse events.
|
|
@@ -32,90 +31,8 @@ pub async fn click(config: &MintConfig, selector: &str) -> Result<String, String
|
|
|
32
31
|
// Ensure overlay exists before doing any visual interaction
|
|
33
32
|
inject_overlay(config).await;
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let expression = format!(
|
|
39
|
-
r#"(() => {{
|
|
40
|
-
{find_expr}
|
|
41
|
-
if (!el) return null;
|
|
42
|
-
const r = el.getBoundingClientRect();
|
|
43
|
-
return JSON.stringify({{ x: r.left + r.width / 2, y: r.top + r.height / 2 }});
|
|
44
|
-
}})()"#
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
let coord_result = cdp_call_raw(
|
|
48
|
-
config,
|
|
49
|
-
"Runtime.evaluate",
|
|
50
|
-
json!({ "expression": expression, "returnByValue": true }),
|
|
51
|
-
)
|
|
52
|
-
.await;
|
|
53
|
-
|
|
54
|
-
if let Ok(response) = coord_result {
|
|
55
|
-
let val = &response["result"]["result"];
|
|
56
|
-
if let Some(val_str) = val["value"].as_str() {
|
|
57
|
-
if let Ok(parsed) = serde_json::from_str::<Value>(val_str) {
|
|
58
|
-
if let (Some(x), Some(y)) = (parsed["x"].as_f64(), parsed["y"].as_f64()) {
|
|
59
|
-
log_action(
|
|
60
|
-
"CLICK",
|
|
61
|
-
&format!("Coordinates ({x:.0},{y:.0}) for '{selector}'"),
|
|
62
|
-
);
|
|
63
|
-
let result = mouse_click(config, x, y, "left").await?;
|
|
64
|
-
log_action(
|
|
65
|
-
"CLICK_SUCCESS",
|
|
66
|
-
&format!("Clicked '{selector}' at ({x:.0},{y:.0})"),
|
|
67
|
-
);
|
|
68
|
-
return Ok(result);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Fallback: JS .click() directly
|
|
75
|
-
let click_expr = format!(
|
|
76
|
-
r#"(() => {{
|
|
77
|
-
{find_expr}
|
|
78
|
-
if (!el) return 'not-found';
|
|
79
|
-
el.scrollIntoView({{behavior:'instant',block:'center'}});
|
|
80
|
-
el.click();
|
|
81
|
-
return 'clicked';
|
|
82
|
-
}})()"#
|
|
83
|
-
);
|
|
84
|
-
match cdp_call(
|
|
85
|
-
config,
|
|
86
|
-
"Runtime.evaluate",
|
|
87
|
-
json!({ "expression": click_expr, "returnByValue": true }),
|
|
88
|
-
)
|
|
89
|
-
.await
|
|
90
|
-
{
|
|
91
|
-
Ok(response) => match response["result"]["result"]["value"].as_str() {
|
|
92
|
-
Some("clicked") => {
|
|
93
|
-
log_action(
|
|
94
|
-
"CLICK_SUCCESS",
|
|
95
|
-
&format!("JS-fallback clicked '{selector}'"),
|
|
96
|
-
);
|
|
97
|
-
// The coordinate-based path already waits inside
|
|
98
|
-
// `mouse_click`; this JS `.click()` fallback bypasses that,
|
|
99
|
-
// so it needs its own wait — see `wait_for_page_load`'s doc.
|
|
100
|
-
wait_for_page_load(config).await;
|
|
101
|
-
Ok("clicked".into())
|
|
102
|
-
}
|
|
103
|
-
Some("not-found") => {
|
|
104
|
-
let err = format!("element not found for selector: {selector}");
|
|
105
|
-
log_action("CLICK_ERROR", &err);
|
|
106
|
-
Err(err)
|
|
107
|
-
}
|
|
108
|
-
_ => {
|
|
109
|
-
let err = response_error(&response);
|
|
110
|
-
log_action("CLICK_ERROR", &err);
|
|
111
|
-
Err(err)
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
Err(e) => {
|
|
115
|
-
log_action("CLICK_ERROR", &format!("Websocket error: {e}"));
|
|
116
|
-
Err(e)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
34
|
+
let (x, y) = get_element_coordinates(config, selector).await?;
|
|
35
|
+
mouse_click(config, x, y, "left").await
|
|
119
36
|
}
|
|
120
37
|
|
|
121
38
|
/// Type text into a CSS selector element using native CDP keyboard events.
|
|
@@ -132,16 +49,61 @@ pub async fn type_text(config: &MintConfig, selector: &str, text: &str) -> Resul
|
|
|
132
49
|
log_action("TYPE", &format!("Typing into '{selector}'"));
|
|
133
50
|
ensure_page_open(config).await?;
|
|
134
51
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// focus, so if the click silently failed to find the element, the old
|
|
138
|
-
// behavior would type into the wrong field (or nowhere) with no error
|
|
139
|
-
// surfaced back to the agent to recover from.
|
|
140
|
-
click(config, selector).await?;
|
|
141
|
-
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
|
|
52
|
+
edit_text(config, selector, text, false).await
|
|
53
|
+
}
|
|
142
54
|
|
|
143
|
-
|
|
144
|
-
|
|
55
|
+
/// Pin one DOM node for the entire edit; never resolve a replacement selector.
|
|
56
|
+
pub(super) async fn edit_text(
|
|
57
|
+
config: &MintConfig,
|
|
58
|
+
selector: &str,
|
|
59
|
+
text: &str,
|
|
60
|
+
replace: bool,
|
|
61
|
+
) -> Result<String, String> {
|
|
62
|
+
let token = uuid::Uuid::new_v4().to_string();
|
|
63
|
+
let find = selector_to_js_find(selector);
|
|
64
|
+
eval(config, format!("(() => {{ {find} if (!el || !el.isConnected) throw new Error('stale_reference'); if (el.readOnly || !(el.tagName === 'TEXTAREA' || (el.tagName === 'INPUT' && ['text','search','url','tel','password','email','number'].includes(el.type)))) throw new Error('unsupported_edit_target'); (globalThis.__mintEditable ||= new Map()).set({},el); return true; }})()",json!(token))).await?;
|
|
65
|
+
let pinned = format!("mint-edit={token}");
|
|
66
|
+
let find = selector_to_js_find(&pinned);
|
|
67
|
+
let check = format!(
|
|
68
|
+
"{find} if (!el || !el.isConnected) throw new Error('stale_reference'); if (el.disabled || el.readOnly || el.getAttribute('aria-disabled') === 'true' || !(el.tagName === 'TEXTAREA' || (el.tagName === 'INPUT' && ['text','search','url','tel','password','email','number'].includes(el.type)))) throw new Error('focus_changed: original target is no longer editable'); if (el.getRootNode().activeElement !== el) throw new Error('focus_changed');"
|
|
69
|
+
);
|
|
70
|
+
let result = async {
|
|
71
|
+
click(config, &pinned).await?;
|
|
72
|
+
let previous = eval(config,format!("(() => {{ {check} {} return el.value; }})()",if replace {""} else {"if (typeof el.selectionStart === 'number') el.setSelectionRange(el.value.length,el.value.length);"})).await?;
|
|
73
|
+
if replace {
|
|
74
|
+
let platform = eval(config,"navigator.platform".into()).await?;
|
|
75
|
+
let modifiers = if platform.as_str().unwrap_or("").contains("Mac") {4} else {2};
|
|
76
|
+
for kind in ["keyDown", "keyUp"] {
|
|
77
|
+
cdp_call_raw(config,"Input.dispatchKeyEvent",json!({"type":kind,"key":"a","code":"KeyA","windowsVirtualKeyCode":65,"nativeVirtualKeyCode":65,"modifiers":modifiers})).await?;
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
super::key_press(config,"End").await?;
|
|
81
|
+
}
|
|
82
|
+
// Key handlers may redirect focus or replace the node. Stop before text input.
|
|
83
|
+
eval(config,format!("(() => {{ {check} return true; }})()")).await?;
|
|
84
|
+
if replace && text.is_empty() { super::key_press(config,"Backspace").await?; }
|
|
85
|
+
else { type_text_native(config,text).await?; }
|
|
86
|
+
let value = eval(config,format!("(() => {{ {find} if (!el?.isConnected) throw new Error('stale_reference'); return el.value; }})()")).await?;
|
|
87
|
+
let expected = if replace {text.to_owned()} else {format!("{}{text}",previous.as_str().ok_or("unsupported_edit_target")?)};
|
|
88
|
+
if value.as_str() != Some(expected.as_str()) {return Err("field_value_mismatch".into());}
|
|
89
|
+
Ok("value_verified".into())
|
|
90
|
+
}.await;
|
|
91
|
+
let _ = eval(
|
|
92
|
+
config,
|
|
93
|
+
format!("globalThis.__mintEditable?.delete({})", json!(token)),
|
|
94
|
+
)
|
|
95
|
+
.await;
|
|
96
|
+
result
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async fn eval(config: &MintConfig, expression: String) -> Result<Value, String> {
|
|
100
|
+
Ok(cdp_call_raw(
|
|
101
|
+
config,
|
|
102
|
+
"Runtime.evaluate",
|
|
103
|
+
json!({"expression":expression,"returnByValue":true}),
|
|
104
|
+
)
|
|
105
|
+
.await?["result"]["result"]["value"]
|
|
106
|
+
.clone())
|
|
145
107
|
}
|
|
146
108
|
|
|
147
109
|
/// Get the viewport-relative center (x, y) of an element by CSS selector.
|
|
@@ -154,9 +116,16 @@ pub async fn get_element_coordinates(
|
|
|
154
116
|
let expression = format!(
|
|
155
117
|
r#"(() => {{
|
|
156
118
|
{find_expr}
|
|
157
|
-
if (!el)
|
|
158
|
-
|
|
159
|
-
|
|
119
|
+
if (!el || !el.isConnected) throw new Error('element_not_found_or_stale');
|
|
120
|
+
el.scrollIntoView({{behavior:'instant',block:'center',inline:'center'}});
|
|
121
|
+
const r = el.getBoundingClientRect(), style = getComputedStyle(el);
|
|
122
|
+
if (!r.width || !r.height || style.visibility === 'hidden' || style.display === 'none') throw new Error('element_not_visible');
|
|
123
|
+
if (el.disabled || el.getAttribute('aria-disabled') === 'true') throw new Error('element_disabled');
|
|
124
|
+
const x = r.left + r.width / 2, y = r.top + r.height / 2;
|
|
125
|
+
let hit = document.elementFromPoint(x,y);
|
|
126
|
+
while (hit && hit.shadowRoot) {{ const deeper = hit.shadowRoot.elementFromPoint(x,y); if (!deeper || deeper === hit) break; hit = deeper; }}
|
|
127
|
+
if (hit !== el && !el.contains(hit)) throw new Error('element_obstructed');
|
|
128
|
+
return JSON.stringify({{ x, y }});
|
|
160
129
|
}})()"#
|
|
161
130
|
);
|
|
162
131
|
match cdp_call_raw(
|
|
@@ -186,40 +155,45 @@ pub async fn get_element_coordinates(
|
|
|
186
155
|
|
|
187
156
|
/// Convert a selector (CSS / text= / contains= / xpath=) into a JS let statement:
|
|
188
157
|
/// `let el = <expression>;`
|
|
189
|
-
fn selector_to_js_find(selector: &str) -> String {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
let
|
|
158
|
+
pub(super) fn selector_to_js_find(selector: &str) -> String {
|
|
159
|
+
let quoted = |s: &str| serde_json::to_string(s).expect("string serialization");
|
|
160
|
+
if selector == "mint-focus=" {
|
|
161
|
+
"let el=document.activeElement; while (el?.shadowRoot?.activeElement) el=el.shadowRoot.activeElement;".into()
|
|
162
|
+
} else if let Some(point) = selector.strip_prefix("mint-point=") {
|
|
163
|
+
let (x, y) = point.split_once(',').unwrap_or(("0", "0"));
|
|
164
|
+
let x = x.parse::<f64>().unwrap_or(0.0);
|
|
165
|
+
let y = y.parse::<f64>().unwrap_or(0.0);
|
|
166
|
+
format!(
|
|
167
|
+
"let el=document.elementFromPoint({x},{y}); while(el?.shadowRoot) {{const hit=el.shadowRoot.elementFromPoint({x},{y});if (!hit || hit===el) break;el=hit;}}"
|
|
168
|
+
)
|
|
169
|
+
} else if selector == "mint-attempt=" {
|
|
170
|
+
"const el = globalThis.__mintAttemptTarget;".into()
|
|
171
|
+
} else if let Some(token) = selector.strip_prefix("mint-edit=") {
|
|
193
172
|
format!(
|
|
194
|
-
"const el =
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
173
|
+
"const el = globalThis.__mintEditable?.get({});",
|
|
174
|
+
quoted(token)
|
|
175
|
+
)
|
|
176
|
+
} else if let Some(reference) = selector.strip_prefix("mint-ref=") {
|
|
177
|
+
format!(
|
|
178
|
+
"const el = globalThis.__mintObservation?.elements.get({});",
|
|
179
|
+
quoted(reference)
|
|
180
|
+
)
|
|
181
|
+
} else if let Some(text) = selector.strip_prefix("text=") {
|
|
182
|
+
format!(
|
|
183
|
+
"const el = Array.from(document.querySelectorAll('*')).find(e => e.childElementCount === 0 && e.textContent.trim() === {});",
|
|
184
|
+
quoted(text)
|
|
198
185
|
)
|
|
199
186
|
} else if let Some(text) = selector.strip_prefix("contains=") {
|
|
200
|
-
// Partial text match
|
|
201
|
-
let escaped = text.replace('\\', "\\\\").replace('`', "\\`");
|
|
202
187
|
format!(
|
|
203
|
-
"const el = Array.from(document.querySelectorAll('*')).find(
|
|
204
|
-
|
|
205
|
-
|| Array.from(document.querySelectorAll('*')).find(\
|
|
206
|
-
e => e.textContent.includes(`{escaped}`));"
|
|
188
|
+
"const el = Array.from(document.querySelectorAll('*')).find(e => e.childElementCount === 0 && e.textContent.includes({}));",
|
|
189
|
+
quoted(text)
|
|
207
190
|
)
|
|
208
191
|
} else if let Some(xpath) = selector.strip_prefix("xpath=") {
|
|
209
|
-
let escaped = xpath.replace('\\', "\\\\").replace('"', "\\\"");
|
|
210
192
|
format!(
|
|
211
|
-
"const el = document.evaluate(
|
|
212
|
-
|
|
193
|
+
"const el = document.evaluate({}, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;",
|
|
194
|
+
quoted(xpath)
|
|
213
195
|
)
|
|
214
196
|
} else {
|
|
215
|
-
|
|
216
|
-
let escaped = selector.replace('\\', "\\\\").replace('`', "\\`");
|
|
217
|
-
format!(
|
|
218
|
-
"let el; try {{ el = document.querySelector(`{escaped}`); }} \
|
|
219
|
-
catch(e) {{ \
|
|
220
|
-
el = Array.from(document.querySelectorAll('*')).find(\
|
|
221
|
-
e => e.textContent.trim() === `{escaped}`); \
|
|
222
|
-
}}"
|
|
223
|
-
)
|
|
197
|
+
format!("const el = document.querySelector({});", quoted(selector))
|
|
224
198
|
}
|
|
225
199
|
}
|
|
@@ -15,7 +15,38 @@ pub async fn is_browser_running(config: &MintConfig) -> bool {
|
|
|
15
15
|
fetch_pages_endpoint(endpoint).await.is_ok()
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
pub
|
|
18
|
+
pub(crate) const BROWSER_TOOLS: &[&str] = &[
|
|
19
|
+
"browser_open",
|
|
20
|
+
"browser_click",
|
|
21
|
+
"browser_type",
|
|
22
|
+
"browser_read",
|
|
23
|
+
"browser_mouse_move",
|
|
24
|
+
"browser_mouse_click",
|
|
25
|
+
"browser_key_press",
|
|
26
|
+
"browser_screenshot",
|
|
27
|
+
"browser_tabs",
|
|
28
|
+
"browser_observe",
|
|
29
|
+
"browser_fill",
|
|
30
|
+
"browser_select",
|
|
31
|
+
"browser_scroll",
|
|
32
|
+
"browser_wait",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
pub fn enable_browser_tools(config: &mut MintConfig) -> bool {
|
|
36
|
+
let mut changed = false;
|
|
37
|
+
for tool in BROWSER_TOOLS {
|
|
38
|
+
if config.disabled_tools.contains(&tool.to_string()) {
|
|
39
|
+
config.disabled_tools.retain(|x| x != *tool);
|
|
40
|
+
changed = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
changed
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
pub async fn spawn_automation_browser_with_url(
|
|
47
|
+
config: &MintConfig,
|
|
48
|
+
initial_url: Option<&str>,
|
|
49
|
+
) -> Result<(), String> {
|
|
19
50
|
let endpoint = config
|
|
20
51
|
.extra
|
|
21
52
|
.get("browserDebugUrl")
|
|
@@ -23,9 +54,23 @@ pub async fn spawn_automation_browser(config: &MintConfig) -> Result<(), String>
|
|
|
23
54
|
.unwrap_or("http://127.0.0.1:9222/json/list");
|
|
24
55
|
|
|
25
56
|
if fetch_pages_endpoint(endpoint).await.is_ok() {
|
|
57
|
+
if let Some(url) = initial_url {
|
|
58
|
+
let trimmed = url.trim();
|
|
59
|
+
if !trimmed.is_empty() {
|
|
60
|
+
ensure_page_open(config).await?;
|
|
61
|
+
super::navigate::navigate(config, trimmed).await?;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
26
64
|
return Ok(());
|
|
27
65
|
}
|
|
28
66
|
|
|
67
|
+
let debug_url = reqwest::Url::parse(endpoint).map_err(|e| e.to_string())?;
|
|
68
|
+
if !matches!(
|
|
69
|
+
debug_url.host_str(),
|
|
70
|
+
Some("localhost" | "127.0.0.1" | "[::1]" | "::1")
|
|
71
|
+
) {
|
|
72
|
+
return Err("Configured remote browser is unavailable; start it at the configured endpoint before using Mint Auto".into());
|
|
73
|
+
}
|
|
29
74
|
let browser_name = config
|
|
30
75
|
.extra
|
|
31
76
|
.get("automationBrowser")
|
|
@@ -38,13 +83,26 @@ pub async fn spawn_automation_browser(config: &MintConfig) -> Result<(), String>
|
|
|
38
83
|
.join("automation-profile");
|
|
39
84
|
let profile_arg = format!("--user-data-dir={}", profile_dir.to_string_lossy());
|
|
40
85
|
|
|
41
|
-
let args = [
|
|
42
|
-
|
|
86
|
+
let mut args = vec![
|
|
87
|
+
format!(
|
|
88
|
+
"--remote-debugging-port={}",
|
|
89
|
+
reqwest::Url::parse(endpoint)
|
|
90
|
+
.map_err(|e| e.to_string())?
|
|
91
|
+
.port_or_known_default()
|
|
92
|
+
.ok_or("Missing debugging port")?
|
|
93
|
+
),
|
|
43
94
|
"--no-first-run".to_owned(),
|
|
44
95
|
"--no-default-browser-check".to_owned(),
|
|
45
96
|
profile_arg,
|
|
46
97
|
];
|
|
47
98
|
|
|
99
|
+
if let Some(url) = initial_url {
|
|
100
|
+
let trimmed = url.trim();
|
|
101
|
+
if !trimmed.is_empty() {
|
|
102
|
+
args.push(trimmed.to_owned());
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
48
106
|
let mut spawned = false;
|
|
49
107
|
let executables: Vec<&str> = if cfg!(target_os = "windows") {
|
|
50
108
|
vec!["chrome.exe", "chromium.exe", "msedge.exe"]
|
|
@@ -92,7 +150,13 @@ pub async fn spawn_automation_browser(config: &MintConfig) -> Result<(), String>
|
|
|
92
150
|
}
|
|
93
151
|
}
|
|
94
152
|
|
|
95
|
-
Err(
|
|
153
|
+
Err(format!(
|
|
154
|
+
"Browser spawned but debugging endpoint {endpoint} did not become available."
|
|
155
|
+
))
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
pub async fn spawn_automation_browser(config: &MintConfig) -> Result<(), String> {
|
|
159
|
+
spawn_automation_browser_with_url(config, None).await
|
|
96
160
|
}
|
|
97
161
|
|
|
98
162
|
pub async fn ensure_page_open(config: &MintConfig) -> Result<(), String> {
|
|
@@ -106,6 +170,13 @@ pub async fn ensure_page_open(config: &MintConfig) -> Result<(), String> {
|
|
|
106
170
|
.unwrap_or("http://127.0.0.1:9222/json/list");
|
|
107
171
|
|
|
108
172
|
let pages = fetch_pages_endpoint(endpoint).await?;
|
|
173
|
+
if let Some(id) = super::selected_tab() {
|
|
174
|
+
return if pages.iter().any(|p| p["type"] == "page" && p["id"] == id) {
|
|
175
|
+
Ok(())
|
|
176
|
+
} else {
|
|
177
|
+
Err("tab_unavailable".into())
|
|
178
|
+
};
|
|
179
|
+
}
|
|
109
180
|
let has_page = pages.iter().any(|p| p["type"] == "page");
|
|
110
181
|
if !has_page {
|
|
111
182
|
let base_url = endpoint.replace("/json/list", "/json/new");
|