@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.
- package/.codex +0 -0
- package/.github/FUNDING.yml +2 -0
- package/.github/workflows/ci.yml +45 -0
- package/.github/workflows/release.yml +79 -0
- package/Cargo.lock +5792 -0
- package/Cargo.toml +32 -0
- package/README.md +387 -353
- package/assets/icon.png +0 -0
- package/bin/mint +0 -0
- package/crates/mint-cli/Cargo.toml +23 -0
- package/crates/mint-cli/src/agent.rs +851 -0
- package/crates/mint-cli/src/gmail.rs +216 -0
- package/crates/mint-cli/src/image.rs +142 -0
- package/crates/mint-cli/src/main.rs +2837 -0
- package/crates/mint-cli/src/mcp.rs +63 -0
- package/crates/mint-cli/src/onboard.rs +1149 -0
- package/crates/mint-cli/src/setup.rs +390 -0
- package/crates/mint-cli/src/skills.rs +8 -0
- package/crates/mint-cli/src/updater.rs +279 -0
- package/crates/mint-core/Cargo.toml +22 -0
- package/crates/mint-core/src/agent_loop.rs +94 -0
- package/crates/mint-core/src/api_server.rs +991 -0
- package/crates/mint-core/src/channels.rs +248 -0
- package/crates/mint-core/src/chat.rs +895 -0
- package/crates/mint-core/src/code_tools.rs +729 -0
- package/crates/mint-core/src/config.rs +368 -0
- package/crates/mint-core/src/files.rs +159 -0
- package/crates/mint-core/src/knowledge.rs +541 -0
- package/crates/mint-core/src/lib.rs +84 -0
- package/crates/mint-core/src/mcp.rs +273 -0
- package/crates/mint-core/src/memory.rs +673 -0
- package/crates/mint-core/src/orchestration.rs +2157 -0
- package/crates/mint-core/src/pictures.rs +314 -0
- package/crates/mint-core/src/plugins.rs +727 -0
- package/crates/mint-core/src/safety.rs +416 -0
- package/crates/mint-core/src/semantic.rs +254 -0
- package/crates/mint-core/src/shell.rs +317 -0
- package/crates/mint-core/src/skills.rs +71 -0
- package/crates/mint-core/src/symbols.rs +157 -0
- package/crates/mint-core/src/tasks.rs +308 -0
- package/crates/mint-core/src/tts.rs +92 -0
- package/crates/mint-core/src/weather.rs +93 -0
- package/crates/mint-core/src/web_search.rs +200 -0
- package/crates/mint-core/src/workflows.rs +81 -0
- package/crates/mint-core/tests/mcp_stdio.rs +45 -0
- package/crates/mint-core/tests/memory_persistence.rs +172 -0
- package/crates/mint-core/tests/pictures_storage.rs +14 -0
- package/crates/mint-core/tests/task_lifecycle.rs +87 -0
- package/package.json +35 -99
- package/src/bin/index.js +16 -0
- package/src/renderer/index-web.html +17 -0
- package/src/renderer/index.html +17 -0
- package/src/renderer/public/Live2DCubismCore.js +9 -0
- package/src/renderer/public/assets/icon.png +0 -0
- package/src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.model3.json +36 -0
- package/src/renderer/src/App.tsx +33 -0
- package/src/renderer/src/calculator.ts +47 -0
- package/src/renderer/src/components/ChatPanel.tsx +1598 -0
- package/src/renderer/src/components/DashboardSidebar.tsx +358 -0
- package/src/renderer/src/components/Live2DStage.tsx +374 -0
- package/src/renderer/src/components/MintDashboard.tsx +950 -0
- package/src/renderer/src/components/ModelPanel.tsx +154 -0
- package/src/renderer/src/components/PicturesLibrary.tsx +46 -0
- package/src/renderer/src/components/ProactiveGlow.tsx +19 -0
- package/src/renderer/src/components/ScreenPicker.tsx +579 -0
- package/src/renderer/src/components/SettingsWindow.tsx +1467 -0
- package/src/renderer/src/components/SpotlightWindow.tsx +280 -0
- package/src/renderer/src/components/WidgetWindow.tsx +36 -0
- package/src/renderer/src/components/WorkspacePanel.tsx +268 -0
- package/src/{UI → renderer/src/css}/settings.css +69 -16
- package/src/renderer/src/css/spotlight.css +113 -0
- package/src/renderer/src/css/styles.css +3722 -0
- package/src/renderer/src/css/widget.css +185 -0
- package/src/renderer/src/env.d.ts +116 -0
- package/src/renderer/src/index.css +379 -0
- package/src/renderer/src/main.tsx +13 -0
- package/src/renderer/src/tauri.ts +996 -0
- package/src/renderer/src-web/App.tsx +25 -0
- package/src/renderer/src-web/calculator.ts +47 -0
- package/src/renderer/src-web/components/ChatPanel.tsx +1662 -0
- package/src/renderer/src-web/components/DashboardSidebar.tsx +242 -0
- package/src/renderer/src-web/components/MintDashboard.tsx +763 -0
- package/src/renderer/src-web/components/PicturesLibrary.tsx +73 -0
- package/src/renderer/src-web/components/SettingsWindow.tsx +1500 -0
- package/src/renderer/src-web/css/settings.css +1100 -0
- package/src/{UI → renderer/src-web/css}/spotlight.css +4 -4
- package/src/{UI → renderer/src-web/css}/styles.css +1055 -159
- package/src/{UI → renderer/src-web/css}/widget.css +2 -2
- package/src/renderer/src-web/env.d.ts +107 -0
- package/src/renderer/src-web/index.css +379 -0
- package/src/renderer/src-web/main.tsx +13 -0
- package/src/renderer/src-web/tauri.ts +983 -0
- package/tsconfig.json +30 -0
- package/vite.config.ts +33 -0
- package/vite.config.web.ts +51 -0
- package/GUIDE_TH.md +0 -125
- package/assets/Agent_Mint.png +0 -0
- package/assets/CLI_Screen.png +0 -0
- package/assets/Settings.png +0 -0
- package/benchmark_ai.js +0 -71
- package/install.ps1 +0 -64
- package/install.sh +0 -54
- package/main.js +0 -139
- package/mint-cli-logic.js +0 -3
- package/mint-cli.js +0 -410
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.model3.json +0 -47
- 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
- package/preload-picker.js +0 -11
- package/preload-settings.js +0 -11
- package/preload.js +0 -41
- package/scripts/install_linux_desktop_entry.js +0 -48
- package/src/AI_Brain/Gemini_API.js +0 -813
- package/src/AI_Brain/agent_orchestrator.js +0 -73
- package/src/AI_Brain/autonomous_brain.js +0 -179
- package/src/AI_Brain/behavior_memory.js +0 -135
- package/src/AI_Brain/headless_agent.js +0 -143
- package/src/AI_Brain/knowledge_base.js +0 -349
- package/src/AI_Brain/memory_store.js +0 -662
- package/src/AI_Brain/proactive_engine.js +0 -172
- package/src/AI_Brain/provider_adapter.js +0 -365
- package/src/Automation_Layer/browser_automation.js +0 -149
- package/src/Automation_Layer/file_operations.js +0 -286
- package/src/Automation_Layer/open_app.js +0 -85
- package/src/Automation_Layer/open_website.js +0 -38
- package/src/CLI/approval_handler.js +0 -47
- package/src/CLI/chat_router.js +0 -247
- package/src/CLI/chat_ui.js +0 -1159
- package/src/CLI/cli_colors.js +0 -115
- package/src/CLI/cli_formatters.js +0 -94
- package/src/CLI/code_agent.js +0 -1667
- package/src/CLI/code_session_memory.js +0 -62
- package/src/CLI/gmail_auth.js +0 -210
- package/src/CLI/image_input.js +0 -90
- package/src/CLI/intent_detectors.js +0 -181
- package/src/CLI/interactive_chat.js +0 -658
- package/src/CLI/list_features.js +0 -64
- package/src/CLI/onboarding.js +0 -416
- package/src/CLI/repo_summarizer.js +0 -282
- package/src/CLI/semantic_code_search.js +0 -312
- package/src/CLI/skill_manager.js +0 -41
- package/src/CLI/slash_command_handler.js +0 -418
- package/src/CLI/symbol_indexer.js +0 -231
- package/src/CLI/updater.js +0 -230
- package/src/CLI/workspace_manager.js +0 -90
- package/src/Channels/brave_search_bridge.js +0 -35
- package/src/Channels/discord_bridge.js +0 -66
- package/src/Channels/google_search_bridge.js +0 -38
- package/src/Channels/line_bridge.js +0 -60
- package/src/Channels/slack_bridge.js +0 -48
- package/src/Channels/telegram_bridge.js +0 -41
- package/src/Channels/whatsapp_bridge.js +0 -57
- package/src/Command_Parser/parser.js +0 -45
- package/src/Plugins/dev_tools.js +0 -41
- package/src/Plugins/discord.js +0 -20
- package/src/Plugins/docker.js +0 -47
- package/src/Plugins/gmail.js +0 -251
- package/src/Plugins/google_calendar.js +0 -252
- package/src/Plugins/mcp_manager.js +0 -95
- package/src/Plugins/notion.js +0 -256
- package/src/Plugins/obsidian.js +0 -54
- package/src/Plugins/plugin_manager.js +0 -81
- package/src/Plugins/spotify.js +0 -173
- package/src/Plugins/system_metrics.js +0 -31
- package/src/Plugins/system_monitor.js +0 -72
- package/src/System/action_executor.js +0 -178
- package/src/System/bridge_manager.js +0 -76
- package/src/System/chat_history_manager.js +0 -83
- package/src/System/config_manager.js +0 -194
- package/src/System/custom_workflows.js +0 -163
- package/src/System/daemon_manager.js +0 -67
- package/src/System/google_tts_urls.js +0 -51
- package/src/System/granular_automation.js +0 -157
- package/src/System/ipc_handlers.js +0 -332
- package/src/System/notifications.js +0 -23
- package/src/System/optional_require.js +0 -23
- package/src/System/picture_store.js +0 -109
- package/src/System/proactive_loop.js +0 -153
- package/src/System/safety_manager.js +0 -273
- package/src/System/sandbox_runner.js +0 -182
- package/src/System/screen_capture.js +0 -175
- package/src/System/smart_context.js +0 -227
- package/src/System/system_automation.js +0 -162
- package/src/System/system_events.js +0 -79
- package/src/System/system_info.js +0 -125
- package/src/System/task_manager.js +0 -222
- package/src/System/tool_registry.js +0 -293
- package/src/System/window_manager.js +0 -220
- package/src/UI/floating.css +0 -80
- package/src/UI/floating.html +0 -17
- package/src/UI/floating.js +0 -67
- package/src/UI/live2d_manager.js +0 -600
- package/src/UI/preload-floating.js +0 -7
- package/src/UI/preload-spotlight.js +0 -11
- package/src/UI/preload-widget.js +0 -5
- package/src/UI/proactive-glow.html +0 -42
- package/src/UI/renderer.js +0 -2127
- package/src/UI/screenPicker.html +0 -214
- package/src/UI/screenPicker.js +0 -262
- package/src/UI/settings.html +0 -577
- package/src/UI/settings.js +0 -770
- package/src/UI/spotlight.html +0 -23
- package/src/UI/spotlight.js +0 -185
- package/src/UI/widget.html +0 -29
- package/src/UI/widget.js +0 -10
- /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/72d86db84cfa9730b894c241fd24c0db.png +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/items_pinned_to_model.json +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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,242 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
export type DashboardView = 'chat' | 'pictures' | 'model'
|
|
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
|
+
sending: boolean
|
|
15
|
+
chatSessions: ChatSessionItem[]
|
|
16
|
+
activeConversationId: string
|
|
17
|
+
onToggleSidebar: () => void
|
|
18
|
+
onClearHistory: (action: 'New chat' | 'Clear history') => void
|
|
19
|
+
onSelectConversation: (id: string) => void
|
|
20
|
+
onDeleteConversation: (id: string) => void
|
|
21
|
+
onRenameConversation?: (id: string, newTitle: string) => void
|
|
22
|
+
onSetView: (view: DashboardView) => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function DashboardSidebar({
|
|
26
|
+
view,
|
|
27
|
+
sidebarCollapsed,
|
|
28
|
+
sending,
|
|
29
|
+
chatSessions,
|
|
30
|
+
activeConversationId,
|
|
31
|
+
onToggleSidebar,
|
|
32
|
+
onClearHistory,
|
|
33
|
+
onSelectConversation,
|
|
34
|
+
onDeleteConversation,
|
|
35
|
+
onRenameConversation,
|
|
36
|
+
onSetView,
|
|
37
|
+
}: DashboardSidebarProps) {
|
|
38
|
+
const [editingSessionId, setEditingSessionId] = useState<string | null>(null)
|
|
39
|
+
const [editTitleValue, setEditTitleValue] = useState('')
|
|
40
|
+
|
|
41
|
+
const handleSaveRename = (id: string) => {
|
|
42
|
+
if (editTitleValue.trim() && editTitleValue.trim() !== chatSessions.find(s => s.id === id)?.title) {
|
|
43
|
+
onRenameConversation?.(id, editTitleValue.trim())
|
|
44
|
+
}
|
|
45
|
+
setEditingSessionId(null)
|
|
46
|
+
}
|
|
47
|
+
const conversationSessions = chatSessions.filter((session) => session.kind !== 'cli' && session.id !== 'conversation-default')
|
|
48
|
+
const cliSession = chatSessions.find((session) => session.kind === 'cli' || session.id === 'cli') ?? {
|
|
49
|
+
id: 'cli',
|
|
50
|
+
title: 'cli',
|
|
51
|
+
kind: 'cli',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<aside className="workspace-sidebar">
|
|
56
|
+
<div
|
|
57
|
+
className="sidebar-brand clickable"
|
|
58
|
+
onClick={onToggleSidebar}
|
|
59
|
+
title={sidebarCollapsed ? "ขยายแถบด้านข้าง" : "ยุบแถบด้านข้าง"}
|
|
60
|
+
role="button"
|
|
61
|
+
tabIndex={0}
|
|
62
|
+
onKeyDown={(event) => {
|
|
63
|
+
if (event.key === 'Enter' || event.key === ' ') onToggleSidebar()
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<img src="./assets/icon.png" alt="Agent Mint Logo" className="sidebar-logo" />
|
|
67
|
+
<span className="sidebar-brand-name">Agent Mint</span>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<button className="sidebar-new-chat" onClick={() => onClearHistory('New chat')}>
|
|
71
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
72
|
+
<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">
|
|
73
|
+
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
74
|
+
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
75
|
+
</svg>
|
|
76
|
+
</span>
|
|
77
|
+
<span>New Chat</span>
|
|
78
|
+
</button>
|
|
79
|
+
|
|
80
|
+
<button className={`sidebar-top-action ${view === 'chat' ? 'is-active' : ''}`} onClick={() => onSetView('chat')}>
|
|
81
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
82
|
+
<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">
|
|
83
|
+
<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>
|
|
84
|
+
</svg>
|
|
85
|
+
</span>
|
|
86
|
+
<span>Chat</span>
|
|
87
|
+
</button>
|
|
88
|
+
<button className={`sidebar-top-action ${view === 'pictures' ? 'is-active' : ''}`} onClick={() => onSetView('pictures')}>
|
|
89
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
90
|
+
<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">
|
|
91
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
92
|
+
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
|
93
|
+
<polyline points="21 15 16 10 5 21"></polyline>
|
|
94
|
+
</svg>
|
|
95
|
+
</span>
|
|
96
|
+
<span>Pictures</span>
|
|
97
|
+
</button>
|
|
98
|
+
|
|
99
|
+
<div className="sidebar-section">
|
|
100
|
+
<div className="sidebar-section-title">Conversation CLI</div>
|
|
101
|
+
<div className="sidebar-chat-list sidebar-cli-list">
|
|
102
|
+
<button
|
|
103
|
+
className={`sidebar-project sidebar-chat-item ${cliSession.id === activeConversationId ? 'active' : ''}`}
|
|
104
|
+
onClick={() => onSelectConversation(cliSession.id)}
|
|
105
|
+
title={cliSession.title}
|
|
106
|
+
>
|
|
107
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
108
|
+
<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">
|
|
109
|
+
<path d="M4 17l6-6-6-6"></path>
|
|
110
|
+
<path d="M12 19h8"></path>
|
|
111
|
+
</svg>
|
|
112
|
+
</span>
|
|
113
|
+
<span className="sidebar-chat-title">{cliSession.title || 'cli'}</span>
|
|
114
|
+
{cliSession.id === activeConversationId && (
|
|
115
|
+
<span className="mint-status-pill" data-state={sending ? "thinking" : "idle"}>
|
|
116
|
+
<span className="mint-status-dot" />
|
|
117
|
+
<span className="mint-status-label">{sending ? "Thinking" : "Idle"}</span>
|
|
118
|
+
</span>
|
|
119
|
+
)}
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
<div className="sidebar-section-title sidebar-subsection-title">Conversations</div>
|
|
123
|
+
<div className="sidebar-chat-list">
|
|
124
|
+
{conversationSessions.map((session) => (
|
|
125
|
+
<button
|
|
126
|
+
key={session.id}
|
|
127
|
+
className={`sidebar-project sidebar-chat-item ${session.id === activeConversationId ? 'active' : ''}`}
|
|
128
|
+
onClick={() => onSelectConversation(session.id)}
|
|
129
|
+
title={session.title}
|
|
130
|
+
>
|
|
131
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
132
|
+
<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">
|
|
133
|
+
<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>
|
|
134
|
+
</svg>
|
|
135
|
+
</span>
|
|
136
|
+
{editingSessionId === session.id ? (
|
|
137
|
+
<input
|
|
138
|
+
type="text"
|
|
139
|
+
className="sidebar-chat-rename-input"
|
|
140
|
+
value={editTitleValue}
|
|
141
|
+
onChange={(e) => setEditTitleValue(e.target.value)}
|
|
142
|
+
onBlur={() => handleSaveRename(session.id)}
|
|
143
|
+
onKeyDown={(e) => {
|
|
144
|
+
if (e.key === 'Enter') {
|
|
145
|
+
handleSaveRename(session.id)
|
|
146
|
+
} else if (e.key === 'Escape') {
|
|
147
|
+
setEditingSessionId(null)
|
|
148
|
+
}
|
|
149
|
+
}}
|
|
150
|
+
autoFocus
|
|
151
|
+
onClick={(e) => e.stopPropagation()}
|
|
152
|
+
/>
|
|
153
|
+
) : (
|
|
154
|
+
<span className="sidebar-chat-title">{session.title || 'New chat'}</span>
|
|
155
|
+
)}
|
|
156
|
+
{session.id === activeConversationId && (
|
|
157
|
+
<span className="mint-status-pill" data-state={sending ? "thinking" : "idle"}>
|
|
158
|
+
<span className="mint-status-dot" />
|
|
159
|
+
<span className="mint-status-label">{sending ? "Thinking" : "Idle"}</span>
|
|
160
|
+
</span>
|
|
161
|
+
)}
|
|
162
|
+
{editingSessionId !== session.id && (
|
|
163
|
+
<>
|
|
164
|
+
<span
|
|
165
|
+
className="sidebar-chat-edit"
|
|
166
|
+
role="button"
|
|
167
|
+
tabIndex={0}
|
|
168
|
+
title="Rename conversation"
|
|
169
|
+
onClick={(event) => {
|
|
170
|
+
event.stopPropagation()
|
|
171
|
+
setEditingSessionId(session.id)
|
|
172
|
+
setEditTitleValue(session.title || '')
|
|
173
|
+
}}
|
|
174
|
+
onKeyDown={(event) => {
|
|
175
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
176
|
+
event.preventDefault()
|
|
177
|
+
event.stopPropagation()
|
|
178
|
+
setEditingSessionId(session.id)
|
|
179
|
+
setEditTitleValue(session.title || '')
|
|
180
|
+
}
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
<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">
|
|
184
|
+
<path d="M12 20h9"></path>
|
|
185
|
+
<path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
|
|
186
|
+
</svg>
|
|
187
|
+
</span>
|
|
188
|
+
<span
|
|
189
|
+
className="sidebar-chat-delete"
|
|
190
|
+
role="button"
|
|
191
|
+
tabIndex={0}
|
|
192
|
+
title="Delete conversation"
|
|
193
|
+
onClick={(event) => {
|
|
194
|
+
event.stopPropagation()
|
|
195
|
+
onDeleteConversation(session.id)
|
|
196
|
+
}}
|
|
197
|
+
onKeyDown={(event) => {
|
|
198
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
199
|
+
event.preventDefault()
|
|
200
|
+
event.stopPropagation()
|
|
201
|
+
onDeleteConversation(session.id)
|
|
202
|
+
}
|
|
203
|
+
}}
|
|
204
|
+
>
|
|
205
|
+
<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">
|
|
206
|
+
<polyline points="3 6 5 6 21 6"></polyline>
|
|
207
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"></path>
|
|
208
|
+
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
209
|
+
</svg>
|
|
210
|
+
</span>
|
|
211
|
+
</>
|
|
212
|
+
)}
|
|
213
|
+
</button>
|
|
214
|
+
))}
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div className="sidebar-bottom-actions">
|
|
219
|
+
<button className="clear-btn" onClick={() => onClearHistory('Clear history')}>
|
|
220
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
221
|
+
<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">
|
|
222
|
+
<polyline points="3 6 5 6 21 6"></polyline>
|
|
223
|
+
<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>
|
|
224
|
+
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
225
|
+
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
226
|
+
</svg>
|
|
227
|
+
</span>
|
|
228
|
+
<span>Clear Messages</span>
|
|
229
|
+
</button>
|
|
230
|
+
<button className="settings-btn" onClick={() => window.api.openSettings()}>
|
|
231
|
+
<span aria-hidden="true" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
232
|
+
<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">
|
|
233
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
234
|
+
<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>
|
|
235
|
+
</svg>
|
|
236
|
+
</span>
|
|
237
|
+
<span>Settings</span>
|
|
238
|
+
</button>
|
|
239
|
+
</div>
|
|
240
|
+
</aside>
|
|
241
|
+
)
|
|
242
|
+
}
|