@pheem49/mint 1.5.5 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/.codex +0 -0
  2. package/.github/FUNDING.yml +2 -0
  3. package/.github/workflows/ci.yml +45 -0
  4. package/.github/workflows/release.yml +79 -0
  5. package/Cargo.lock +5792 -0
  6. package/Cargo.toml +32 -0
  7. package/README.md +387 -353
  8. package/assets/icon.png +0 -0
  9. package/bin/mint +0 -0
  10. package/crates/mint-cli/Cargo.toml +23 -0
  11. package/crates/mint-cli/src/agent.rs +851 -0
  12. package/crates/mint-cli/src/gmail.rs +216 -0
  13. package/crates/mint-cli/src/image.rs +142 -0
  14. package/crates/mint-cli/src/main.rs +2837 -0
  15. package/crates/mint-cli/src/mcp.rs +63 -0
  16. package/crates/mint-cli/src/onboard.rs +1149 -0
  17. package/crates/mint-cli/src/setup.rs +390 -0
  18. package/crates/mint-cli/src/skills.rs +8 -0
  19. package/crates/mint-cli/src/updater.rs +279 -0
  20. package/crates/mint-core/Cargo.toml +22 -0
  21. package/crates/mint-core/src/agent_loop.rs +94 -0
  22. package/crates/mint-core/src/api_server.rs +991 -0
  23. package/crates/mint-core/src/channels.rs +248 -0
  24. package/crates/mint-core/src/chat.rs +895 -0
  25. package/crates/mint-core/src/code_tools.rs +729 -0
  26. package/crates/mint-core/src/config.rs +368 -0
  27. package/crates/mint-core/src/files.rs +159 -0
  28. package/crates/mint-core/src/knowledge.rs +541 -0
  29. package/crates/mint-core/src/lib.rs +84 -0
  30. package/crates/mint-core/src/mcp.rs +273 -0
  31. package/crates/mint-core/src/memory.rs +673 -0
  32. package/crates/mint-core/src/orchestration.rs +2157 -0
  33. package/crates/mint-core/src/pictures.rs +314 -0
  34. package/crates/mint-core/src/plugins.rs +727 -0
  35. package/crates/mint-core/src/safety.rs +416 -0
  36. package/crates/mint-core/src/semantic.rs +254 -0
  37. package/crates/mint-core/src/shell.rs +317 -0
  38. package/crates/mint-core/src/skills.rs +71 -0
  39. package/crates/mint-core/src/symbols.rs +157 -0
  40. package/crates/mint-core/src/tasks.rs +308 -0
  41. package/crates/mint-core/src/tts.rs +92 -0
  42. package/crates/mint-core/src/weather.rs +93 -0
  43. package/crates/mint-core/src/web_search.rs +200 -0
  44. package/crates/mint-core/src/workflows.rs +81 -0
  45. package/crates/mint-core/tests/mcp_stdio.rs +45 -0
  46. package/crates/mint-core/tests/memory_persistence.rs +172 -0
  47. package/crates/mint-core/tests/pictures_storage.rs +14 -0
  48. package/crates/mint-core/tests/task_lifecycle.rs +87 -0
  49. package/package.json +35 -99
  50. package/src/bin/index.js +16 -0
  51. package/src/renderer/index-web.html +17 -0
  52. package/src/renderer/index.html +17 -0
  53. package/src/renderer/public/Live2DCubismCore.js +9 -0
  54. package/src/renderer/public/assets/icon.png +0 -0
  55. package/src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.model3.json +36 -0
  56. package/src/renderer/src/App.tsx +33 -0
  57. package/src/renderer/src/calculator.ts +47 -0
  58. package/src/renderer/src/components/ChatPanel.tsx +1598 -0
  59. package/src/renderer/src/components/DashboardSidebar.tsx +358 -0
  60. package/src/renderer/src/components/Live2DStage.tsx +374 -0
  61. package/src/renderer/src/components/MintDashboard.tsx +950 -0
  62. package/src/renderer/src/components/ModelPanel.tsx +154 -0
  63. package/src/renderer/src/components/PicturesLibrary.tsx +46 -0
  64. package/src/renderer/src/components/ProactiveGlow.tsx +19 -0
  65. package/src/renderer/src/components/ScreenPicker.tsx +579 -0
  66. package/src/renderer/src/components/SettingsWindow.tsx +1467 -0
  67. package/src/renderer/src/components/SpotlightWindow.tsx +280 -0
  68. package/src/renderer/src/components/WidgetWindow.tsx +36 -0
  69. package/src/renderer/src/components/WorkspacePanel.tsx +268 -0
  70. package/src/{UI → renderer/src/css}/settings.css +69 -16
  71. package/src/renderer/src/css/spotlight.css +113 -0
  72. package/src/renderer/src/css/styles.css +3722 -0
  73. package/src/renderer/src/css/widget.css +185 -0
  74. package/src/renderer/src/env.d.ts +116 -0
  75. package/src/renderer/src/index.css +379 -0
  76. package/src/renderer/src/main.tsx +13 -0
  77. package/src/renderer/src/tauri.ts +996 -0
  78. package/src/renderer/src-web/App.tsx +25 -0
  79. package/src/renderer/src-web/calculator.ts +47 -0
  80. package/src/renderer/src-web/components/ChatPanel.tsx +1662 -0
  81. package/src/renderer/src-web/components/DashboardSidebar.tsx +242 -0
  82. package/src/renderer/src-web/components/MintDashboard.tsx +763 -0
  83. package/src/renderer/src-web/components/PicturesLibrary.tsx +73 -0
  84. package/src/renderer/src-web/components/SettingsWindow.tsx +1500 -0
  85. package/src/renderer/src-web/css/settings.css +1100 -0
  86. package/src/{UI → renderer/src-web/css}/spotlight.css +4 -4
  87. package/src/{UI → renderer/src-web/css}/styles.css +1055 -159
  88. package/src/{UI → renderer/src-web/css}/widget.css +2 -2
  89. package/src/renderer/src-web/env.d.ts +107 -0
  90. package/src/renderer/src-web/index.css +379 -0
  91. package/src/renderer/src-web/main.tsx +13 -0
  92. package/src/renderer/src-web/tauri.ts +983 -0
  93. package/tsconfig.json +30 -0
  94. package/vite.config.ts +33 -0
  95. package/vite.config.web.ts +51 -0
  96. package/GUIDE_TH.md +0 -125
  97. package/assets/Agent_Mint.png +0 -0
  98. package/assets/CLI_Screen.png +0 -0
  99. package/assets/Settings.png +0 -0
  100. package/benchmark_ai.js +0 -71
  101. package/install.ps1 +0 -64
  102. package/install.sh +0 -54
  103. package/main.js +0 -139
  104. package/mint-cli-logic.js +0 -3
  105. package/mint-cli.js +0 -410
  106. package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.model3.json +0 -47
  107. package/models/Shiroko_Model/Shiroko//342/232/241/351/253/230/344/272/256/342/232/241/344/275/277/347/224/250/346/225/231/347/250/213/344/270/216/346/263/250/346/204/217/344/272/213/351/241/271.txt +0 -23
  108. package/preload-picker.js +0 -11
  109. package/preload-settings.js +0 -11
  110. package/preload.js +0 -41
  111. package/scripts/install_linux_desktop_entry.js +0 -48
  112. package/src/AI_Brain/Gemini_API.js +0 -813
  113. package/src/AI_Brain/agent_orchestrator.js +0 -73
  114. package/src/AI_Brain/autonomous_brain.js +0 -179
  115. package/src/AI_Brain/behavior_memory.js +0 -135
  116. package/src/AI_Brain/headless_agent.js +0 -143
  117. package/src/AI_Brain/knowledge_base.js +0 -349
  118. package/src/AI_Brain/memory_store.js +0 -662
  119. package/src/AI_Brain/proactive_engine.js +0 -172
  120. package/src/AI_Brain/provider_adapter.js +0 -365
  121. package/src/Automation_Layer/browser_automation.js +0 -149
  122. package/src/Automation_Layer/file_operations.js +0 -286
  123. package/src/Automation_Layer/open_app.js +0 -85
  124. package/src/Automation_Layer/open_website.js +0 -38
  125. package/src/CLI/approval_handler.js +0 -47
  126. package/src/CLI/chat_router.js +0 -247
  127. package/src/CLI/chat_ui.js +0 -1159
  128. package/src/CLI/cli_colors.js +0 -115
  129. package/src/CLI/cli_formatters.js +0 -94
  130. package/src/CLI/code_agent.js +0 -1667
  131. package/src/CLI/code_session_memory.js +0 -62
  132. package/src/CLI/gmail_auth.js +0 -210
  133. package/src/CLI/image_input.js +0 -90
  134. package/src/CLI/intent_detectors.js +0 -181
  135. package/src/CLI/interactive_chat.js +0 -658
  136. package/src/CLI/list_features.js +0 -64
  137. package/src/CLI/onboarding.js +0 -416
  138. package/src/CLI/repo_summarizer.js +0 -282
  139. package/src/CLI/semantic_code_search.js +0 -312
  140. package/src/CLI/skill_manager.js +0 -41
  141. package/src/CLI/slash_command_handler.js +0 -418
  142. package/src/CLI/symbol_indexer.js +0 -231
  143. package/src/CLI/updater.js +0 -230
  144. package/src/CLI/workspace_manager.js +0 -90
  145. package/src/Channels/brave_search_bridge.js +0 -35
  146. package/src/Channels/discord_bridge.js +0 -66
  147. package/src/Channels/google_search_bridge.js +0 -38
  148. package/src/Channels/line_bridge.js +0 -60
  149. package/src/Channels/slack_bridge.js +0 -48
  150. package/src/Channels/telegram_bridge.js +0 -41
  151. package/src/Channels/whatsapp_bridge.js +0 -57
  152. package/src/Command_Parser/parser.js +0 -45
  153. package/src/Plugins/dev_tools.js +0 -41
  154. package/src/Plugins/discord.js +0 -20
  155. package/src/Plugins/docker.js +0 -47
  156. package/src/Plugins/gmail.js +0 -251
  157. package/src/Plugins/google_calendar.js +0 -252
  158. package/src/Plugins/mcp_manager.js +0 -95
  159. package/src/Plugins/notion.js +0 -256
  160. package/src/Plugins/obsidian.js +0 -54
  161. package/src/Plugins/plugin_manager.js +0 -81
  162. package/src/Plugins/spotify.js +0 -173
  163. package/src/Plugins/system_metrics.js +0 -31
  164. package/src/Plugins/system_monitor.js +0 -72
  165. package/src/System/action_executor.js +0 -178
  166. package/src/System/bridge_manager.js +0 -76
  167. package/src/System/chat_history_manager.js +0 -83
  168. package/src/System/config_manager.js +0 -194
  169. package/src/System/custom_workflows.js +0 -163
  170. package/src/System/daemon_manager.js +0 -67
  171. package/src/System/google_tts_urls.js +0 -51
  172. package/src/System/granular_automation.js +0 -157
  173. package/src/System/ipc_handlers.js +0 -332
  174. package/src/System/notifications.js +0 -23
  175. package/src/System/optional_require.js +0 -23
  176. package/src/System/picture_store.js +0 -109
  177. package/src/System/proactive_loop.js +0 -153
  178. package/src/System/safety_manager.js +0 -273
  179. package/src/System/sandbox_runner.js +0 -182
  180. package/src/System/screen_capture.js +0 -175
  181. package/src/System/smart_context.js +0 -227
  182. package/src/System/system_automation.js +0 -162
  183. package/src/System/system_events.js +0 -79
  184. package/src/System/system_info.js +0 -125
  185. package/src/System/task_manager.js +0 -222
  186. package/src/System/tool_registry.js +0 -293
  187. package/src/System/window_manager.js +0 -220
  188. package/src/UI/floating.css +0 -80
  189. package/src/UI/floating.html +0 -17
  190. package/src/UI/floating.js +0 -67
  191. package/src/UI/live2d_manager.js +0 -600
  192. package/src/UI/preload-floating.js +0 -7
  193. package/src/UI/preload-spotlight.js +0 -11
  194. package/src/UI/preload-widget.js +0 -5
  195. package/src/UI/proactive-glow.html +0 -42
  196. package/src/UI/renderer.js +0 -2127
  197. package/src/UI/screenPicker.html +0 -214
  198. package/src/UI/screenPicker.js +0 -262
  199. package/src/UI/settings.html +0 -577
  200. package/src/UI/settings.js +0 -770
  201. package/src/UI/spotlight.html +0 -23
  202. package/src/UI/spotlight.js +0 -185
  203. package/src/UI/widget.html +0 -29
  204. package/src/UI/widget.js +0 -10
  205. /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/72d86db84cfa9730b894c241fd24c0db.png +0 -0
  206. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//345/233/264/350/243/231.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/apron.exp3.json} +0 -0
  207. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/214/253/345/222/252/346/273/244/351/225/234.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/catfilter.exp3.json} +0 -0
  208. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/202/271/344/270/200/344/270/213.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/click.exp3.json} +0 -0
  209. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//345/221/206/347/214/253.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/dazed.exp3.json} +0 -0
  210. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//345/221/206/347/214/253/347/234/274/347/217/240/346/221/207/346/231/203.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/dazedeyes.exp3.json} +0 -0
  211. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/234/274/351/225/234.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/glasses.exp3.json} +0 -0
  212. /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/items_pinned_to_model.json +0 -0
  213. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/277/347/254/224.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/pen.exp3.json} +0 -0
  214. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/215/347/205/247.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/photo.exp3.json} +0 -0
  215. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_00.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_00.png} +0 -0
  216. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_01.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_01.png} +0 -0
  217. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_02.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_02.png} +0 -0
  218. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_03.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_03.png} +0 -0
  219. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.cdi3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.cdi3.json} +0 -0
  220. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.moc3" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.moc3} +0 -0
  221. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.physics3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.physics3.json} +0 -0
  222. /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.vtube.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.vtube.json} +0 -0
@@ -0,0 +1,358 @@
1
+ import { useState } from 'react'
2
+
3
+ export type DashboardView = 'chat' | 'pictures' | 'model' | 'workspeac'
4
+
5
+ interface ChatSessionItem {
6
+ id: string
7
+ title: string
8
+ kind: string
9
+ }
10
+
11
+ interface DashboardSidebarProps {
12
+ view: DashboardView
13
+ sidebarCollapsed: boolean
14
+ modelVisible: boolean
15
+ sending: boolean
16
+ chatSessions: ChatSessionItem[]
17
+ activeConversationId: string
18
+ expressionIndex: number
19
+ accessoryIndex: number
20
+ expressions: string[]
21
+ accessories: string[]
22
+ interactionEnabled: boolean
23
+ showInteractionGuide: boolean
24
+ onToggleSidebar: () => void
25
+ onClearHistory: (action: 'New chat' | 'Clear history') => void
26
+ onSelectConversation: (id: string) => void
27
+ onDeleteConversation: (id: string) => void
28
+ onRenameConversation?: (id: string, newTitle: string) => void
29
+ onSetView: (view: DashboardView) => void
30
+ onToggleModel: () => void
31
+ onSetExpressionIndex: (index: number) => void
32
+ onSetAccessoryIndex: (index: number) => void
33
+ onSetInteractionEnabled: (enabled: boolean) => void
34
+ onSetShowInteractionGuide: (visible: boolean) => void
35
+ onShowToast: (message: string) => void
36
+ }
37
+
38
+ export default function DashboardSidebar({
39
+ view,
40
+ sidebarCollapsed,
41
+ modelVisible,
42
+ sending,
43
+ chatSessions,
44
+ activeConversationId,
45
+ expressionIndex,
46
+ accessoryIndex,
47
+ expressions,
48
+ accessories,
49
+ interactionEnabled,
50
+ showInteractionGuide,
51
+ onToggleSidebar,
52
+ onClearHistory,
53
+ onSelectConversation,
54
+ onDeleteConversation,
55
+ onRenameConversation,
56
+ onSetView,
57
+ onToggleModel,
58
+ onSetExpressionIndex,
59
+ onSetAccessoryIndex,
60
+ onSetInteractionEnabled,
61
+ onSetShowInteractionGuide,
62
+ onShowToast,
63
+ }: DashboardSidebarProps) {
64
+ const [editingSessionId, setEditingSessionId] = useState<string | null>(null)
65
+ const [editTitleValue, setEditTitleValue] = useState('')
66
+
67
+ const handleSaveRename = (id: string) => {
68
+ if (editTitleValue.trim() && editTitleValue.trim() !== chatSessions.find(s => s.id === id)?.title) {
69
+ onRenameConversation?.(id, editTitleValue.trim())
70
+ }
71
+ setEditingSessionId(null)
72
+ }
73
+ const toggleInteractionGuide = () => {
74
+ const next = !showInteractionGuide
75
+ onSetShowInteractionGuide(next)
76
+ onShowToast(next ? 'เปิดการแสดงจุดสัมผัส (Interaction Zones) ⊹' : 'ปิดการแสดงจุดสัมผัส ⊹')
77
+ }
78
+
79
+ const toggleInteraction = () => {
80
+ const next = !interactionEnabled
81
+ onSetInteractionEnabled(next)
82
+ onShowToast(next ? 'เปิดการโต้ตอบกับโมเดล ⦸' : 'ปิดการโต้ตอบกับโมเดล ⦸')
83
+ }
84
+
85
+ const conversationSessions = chatSessions.filter((session) => session.kind !== 'cli' && session.id !== 'conversation-default')
86
+ const cliSession = chatSessions.find((session) => session.kind === 'cli' || session.id === 'cli') ?? {
87
+ id: 'cli',
88
+ title: 'cli',
89
+ kind: 'cli',
90
+ }
91
+
92
+ return (
93
+ <aside className="workspace-sidebar">
94
+ <div
95
+ className="sidebar-brand clickable"
96
+ onClick={onToggleSidebar}
97
+ title={sidebarCollapsed ? "ขยายแถบด้านข้าง" : "ยุบแถบด้านข้าง"}
98
+ role="button"
99
+ tabIndex={0}
100
+ onKeyDown={(event) => {
101
+ if (event.key === 'Enter' || event.key === ' ') onToggleSidebar()
102
+ }}
103
+ >
104
+ <img src="./assets/icon.png" alt="Agent Mint Logo" className="sidebar-logo" />
105
+ <span className="sidebar-brand-name">Agent Mint</span>
106
+ </div>
107
+
108
+ <button className="sidebar-new-chat" onClick={() => onClearHistory('New chat')}>
109
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
110
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
111
+ <line x1="12" y1="5" x2="12" y2="19"></line>
112
+ <line x1="5" y1="12" x2="19" y2="12"></line>
113
+ </svg>
114
+ </span>
115
+ <span>New Chat</span>
116
+ </button>
117
+
118
+ <button className={`sidebar-top-action ${view === 'chat' ? 'is-active' : ''}`} onClick={() => onSetView('chat')}>
119
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
120
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
121
+ <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
122
+ </svg>
123
+ </span>
124
+ <span>Chat</span>
125
+ </button>
126
+ <button className={`sidebar-top-action ${view === 'pictures' ? 'is-active' : ''}`} onClick={() => onSetView('pictures')}>
127
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
128
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
129
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
130
+ <circle cx="8.5" cy="8.5" r="1.5"></circle>
131
+ <polyline points="21 15 16 10 5 21"></polyline>
132
+ </svg>
133
+ </span>
134
+ <span>Pictures</span>
135
+ </button>
136
+ <button className={`sidebar-top-action ${view === 'workspeac' ? 'is-active' : ''}`} onClick={() => onSetView('workspeac')}>
137
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
138
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
139
+ <path d="M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"></path>
140
+ <path d="M3 6v12"></path>
141
+ </svg>
142
+ </span>
143
+ <span>Workspeac</span>
144
+ </button>
145
+ <button className={`sidebar-top-action ${modelVisible ? 'is-active' : ''}`} onClick={onToggleModel}>
146
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
147
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
148
+ <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
149
+ <circle cx="12" cy="7" r="4"></circle>
150
+ </svg>
151
+ </span>
152
+ <span>Live2D Model</span>
153
+ </button>
154
+
155
+ {modelVisible && (
156
+ <div className="sidebar-model-controls">
157
+ <button
158
+ className="change-expression-btn"
159
+ onClick={() => {
160
+ const next = (expressionIndex + 1) % expressions.length
161
+ onSetExpressionIndex(next)
162
+ onSetAccessoryIndex(0)
163
+ onShowToast(`Expression: ${expressions[next]}`)
164
+ }}
165
+ >
166
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
167
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
168
+ <circle cx="12" cy="12" r="10"></circle>
169
+ <path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
170
+ <line x1="9" y1="9" x2="9.01" y2="9"></line>
171
+ <line x1="15" y1="9" x2="15.01" y2="9"></line>
172
+ </svg>
173
+ </span>
174
+ <span>Expression</span>
175
+ </button>
176
+ <button
177
+ className="accessory-cycle-btn"
178
+ onClick={() => {
179
+ const next = (accessoryIndex + 1) % accessories.length
180
+ onSetAccessoryIndex(next)
181
+ onSetExpressionIndex(0)
182
+ onShowToast(`Accessory: ${accessories[next]}`)
183
+ }}
184
+ >
185
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
186
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
187
+ <path d="M12 12c-2-2.67-4-4-6-4a4 4 0 1 0 0 8c2 0 4-1.33 6-4Zm0 0c2 2.67 4 4 6 4a4 4 0 1 0 0-8c-2 0-4 1.33-6 4Z"></path>
188
+ </svg>
189
+ </span>
190
+ <span>Accessory</span>
191
+ </button>
192
+ <button className={`toggle-interaction-btn ${interactionEnabled ? 'active' : ''}`} onClick={toggleInteraction}>
193
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
194
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
195
+ <path d="M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v5m-4 0V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v7m-4 0V5a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v9M4 22V13a3 3 0 0 1 6 0v0M4 22h14a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-2"></path>
196
+ </svg>
197
+ </span>
198
+ <span className="mint-status-label">Interact</span>
199
+ </button>
200
+ <button className={`interaction-guide-btn ${showInteractionGuide ? 'active' : ''}`} onClick={toggleInteractionGuide}>
201
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
202
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
203
+ <circle cx="12" cy="12" r="10"></circle>
204
+ <line x1="22" y1="12" x2="18" y2="12"></line>
205
+ <line x1="6" y1="12" x2="2" y2="12"></line>
206
+ <line x1="12" y1="6" x2="12" y2="2"></line>
207
+ <line x1="12" y1="22" x2="12" y2="18"></line>
208
+ </svg>
209
+ </span>
210
+ <span>Areas</span>
211
+ </button>
212
+ </div>
213
+ )}
214
+
215
+ <div className="sidebar-section">
216
+ <div className="sidebar-section-title">Conversation CLI</div>
217
+ <div className="sidebar-chat-list sidebar-cli-list">
218
+ <button
219
+ className={`sidebar-project sidebar-chat-item ${cliSession.id === activeConversationId ? 'active' : ''}`}
220
+ onClick={() => onSelectConversation(cliSession.id)}
221
+ title={cliSession.title}
222
+ >
223
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
224
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
225
+ <path d="M4 17l6-6-6-6"></path>
226
+ <path d="M12 19h8"></path>
227
+ </svg>
228
+ </span>
229
+ <span className="sidebar-chat-title">{cliSession.title || 'cli'}</span>
230
+ {cliSession.id === activeConversationId && (
231
+ <span className="mint-status-pill" data-state={sending ? "thinking" : "idle"}>
232
+ <span className="mint-status-dot" />
233
+ <span className="mint-status-label">{sending ? "Thinking" : "Idle"}</span>
234
+ </span>
235
+ )}
236
+ </button>
237
+ </div>
238
+ <div className="sidebar-section-title sidebar-subsection-title">Conversations</div>
239
+ <div className="sidebar-chat-list">
240
+ {conversationSessions.map((session) => (
241
+ <button
242
+ key={session.id}
243
+ className={`sidebar-project sidebar-chat-item ${session.id === activeConversationId ? 'active' : ''}`}
244
+ onClick={() => onSelectConversation(session.id)}
245
+ title={session.title}
246
+ >
247
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
248
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
249
+ <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
250
+ </svg>
251
+ </span>
252
+ {editingSessionId === session.id ? (
253
+ <input
254
+ type="text"
255
+ className="sidebar-chat-rename-input"
256
+ value={editTitleValue}
257
+ onChange={(e) => setEditTitleValue(e.target.value)}
258
+ onBlur={() => handleSaveRename(session.id)}
259
+ onKeyDown={(e) => {
260
+ if (e.key === 'Enter') {
261
+ handleSaveRename(session.id)
262
+ } else if (e.key === 'Escape') {
263
+ setEditingSessionId(null)
264
+ }
265
+ }}
266
+ autoFocus
267
+ onClick={(e) => e.stopPropagation()}
268
+ />
269
+ ) : (
270
+ <span className="sidebar-chat-title">{session.title || 'New chat'}</span>
271
+ )}
272
+ {session.id === activeConversationId && (
273
+ <span className="mint-status-pill" data-state={sending ? "thinking" : "idle"}>
274
+ <span className="mint-status-dot" />
275
+ <span className="mint-status-label">{sending ? "Thinking" : "Idle"}</span>
276
+ </span>
277
+ )}
278
+ {editingSessionId !== session.id && (
279
+ <>
280
+ <span
281
+ className="sidebar-chat-edit"
282
+ role="button"
283
+ tabIndex={0}
284
+ title="Rename conversation"
285
+ onClick={(event) => {
286
+ event.stopPropagation()
287
+ setEditingSessionId(session.id)
288
+ setEditTitleValue(session.title || '')
289
+ }}
290
+ onKeyDown={(event) => {
291
+ if (event.key === 'Enter' || event.key === ' ') {
292
+ event.preventDefault()
293
+ event.stopPropagation()
294
+ setEditingSessionId(session.id)
295
+ setEditTitleValue(session.title || '')
296
+ }
297
+ }}
298
+ >
299
+ <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.3" strokeLinecap="round" strokeLinejoin="round">
300
+ <path d="M12 20h9"></path>
301
+ <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
302
+ </svg>
303
+ </span>
304
+ <span
305
+ className="sidebar-chat-delete"
306
+ role="button"
307
+ tabIndex={0}
308
+ title="Delete conversation"
309
+ onClick={(event) => {
310
+ event.stopPropagation()
311
+ onDeleteConversation(session.id)
312
+ }}
313
+ onKeyDown={(event) => {
314
+ if (event.key === 'Enter' || event.key === ' ') {
315
+ event.preventDefault()
316
+ event.stopPropagation()
317
+ onDeleteConversation(session.id)
318
+ }
319
+ }}
320
+ >
321
+ <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.3" strokeLinecap="round" strokeLinejoin="round">
322
+ <polyline points="3 6 5 6 21 6"></polyline>
323
+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"></path>
324
+ <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
325
+ </svg>
326
+ </span>
327
+ </>
328
+ )}
329
+ </button>
330
+ ))}
331
+ </div>
332
+ </div>
333
+
334
+ <div className="sidebar-bottom-actions">
335
+ <button className="clear-btn" onClick={() => onClearHistory('Clear history')}>
336
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
337
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
338
+ <polyline points="3 6 5 6 21 6"></polyline>
339
+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
340
+ <line x1="10" y1="11" x2="10" y2="17"></line>
341
+ <line x1="14" y1="11" x2="14" y2="17"></line>
342
+ </svg>
343
+ </span>
344
+ <span>Clear Messages</span>
345
+ </button>
346
+ <button className="settings-btn" onClick={() => window.api.openSettings()}>
347
+ <span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
348
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
349
+ <circle cx="12" cy="12" r="3"></circle>
350
+ <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
351
+ </svg>
352
+ </span>
353
+ <span>Settings</span>
354
+ </button>
355
+ </div>
356
+ </aside>
357
+ )
358
+ }