@pheem49/mint 1.8.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +55 -3
- package/Cargo.toml +2 -1
- package/Release_Note.md +297 -107
- package/bin/mint +0 -0
- package/crates/mint-cli/Cargo.toml +1 -0
- package/crates/mint-cli/src/actions.rs +233 -0
- package/crates/mint-cli/src/agent.rs +382 -127
- package/crates/mint-cli/src/gmail.rs +22 -2
- package/crates/mint-cli/src/image.rs +8 -8
- package/crates/mint-cli/src/interactive.rs +2888 -0
- package/crates/mint-cli/src/main.rs +391 -2506
- package/crates/mint-cli/src/markdown.rs +294 -0
- package/crates/mint-cli/src/onboard.rs +152 -109
- package/crates/mint-cli/src/setup.rs +143 -143
- package/crates/mint-cli/src/updater.rs +48 -6
- package/crates/mint-core/Cargo.toml +1 -0
- package/crates/mint-core/src/agent_loop.rs +1 -0
- package/crates/mint-core/src/api_server.rs +431 -65
- package/crates/mint-core/src/browser.rs +630 -102
- package/crates/mint-core/src/channels.rs +105 -6
- package/crates/mint-core/src/chat.rs +174 -11
- package/crates/mint-core/src/code_tools.rs +47 -31
- package/crates/mint-core/src/config.rs +302 -17
- package/crates/mint-core/src/image_gen.rs +299 -38
- package/crates/mint-core/src/lib.rs +10 -7
- package/crates/mint-core/src/mcp.rs +119 -6
- package/crates/mint-core/src/memory.rs +6 -1
- package/crates/mint-core/src/orchestration.rs +237 -96
- package/crates/mint-core/src/pictures.rs +67 -5
- package/crates/mint-core/src/semantic.rs +1 -1
- package/crates/mint-core/src/shell.rs +1 -1
- package/crates/mint-core/src/skills.rs +128 -25
- package/crates/mint-core/src/video_gen.rs +235 -0
- package/package.json +8 -2
- package/shared-modules/linux-audio/fluidsynth2-static.json +9 -3
- package/shared-modules/linux-audio/fluidsynth2.json +8 -2
- package/shared-modules/linux-audio/lilv.json +26 -19
- package/shared-modules/linux-audio/lv2.json +0 -1
- package/shared-modules/luajit/luajit.json +2 -2
- package/skills-lock.json +41 -0
- package/src/renderer/index-web.html +1 -1
- package/src/renderer/index.html +1 -1
- package/src/renderer/shared/components/AgentActivityTable.tsx +25 -6
- package/src/renderer/shared/constants/slashCommands.ts +27 -0
- package/src/renderer/shared/platform.ts +3 -0
- package/src/renderer/shared/types.ts +4 -0
- package/src/renderer/shared/utils/approval.tsx +86 -7
- package/src/renderer/shared/utils/fileIcons.ts +135 -0
- package/src/renderer/shared/utils/markdown.tsx +217 -88
- package/src/renderer/shared/utils/slashCommandProcessor.ts +239 -0
- package/src/renderer/src/components/ChatPanel.tsx +486 -69
- package/src/renderer/src/components/DashboardSidebar.tsx +11 -2
- package/src/renderer/src/components/ImageStudioPanel.tsx +87 -4
- package/src/renderer/src/components/MintDashboard.tsx +195 -7
- package/src/renderer/src/components/PicturesLibrary.tsx +156 -15
- package/src/renderer/src/components/Settings/AgentsTab.tsx +21 -2
- package/src/renderer/src/components/Settings/AutomationTab.tsx +316 -18
- package/src/renderer/src/components/Settings/GeneralTab.tsx +795 -413
- package/src/renderer/src/components/Settings/PluginsTab.tsx +304 -70
- package/src/renderer/src/components/Settings/ThemeTab.tsx +6 -1
- package/src/renderer/src/components/SettingsWindow.tsx +106 -3
- package/src/renderer/src/components/VeoStudioPanel.tsx +549 -0
- package/src/renderer/src/components/WorkspacePanel.tsx +7 -125
- package/src/renderer/src/css/image-studio.css +106 -0
- package/src/renderer/src/css/settings.css +158 -0
- package/src/renderer/src/css/styles.css +368 -1
- package/src/renderer/src/css/veo-studio.css +626 -0
- package/src/renderer/src/index.css +1 -0
- package/src/renderer/src/tauri.ts +144 -17
- package/src/renderer/src-web/components/ChatPanel.tsx +385 -93
- package/src/renderer/src-web/components/DashboardSidebar.tsx +16 -1
- package/src/renderer/src-web/components/ImageStudioPanel.tsx +87 -4
- package/src/renderer/src-web/components/MintDashboard.tsx +156 -5
- package/src/renderer/src-web/components/PicturesLibrary.tsx +155 -15
- package/src/renderer/src-web/components/Settings/AgentsTab.tsx +21 -2
- package/src/renderer/src-web/components/Settings/AutomationTab.tsx +316 -18
- package/src/renderer/src-web/components/Settings/GeneralTab.tsx +795 -411
- package/src/renderer/src-web/components/Settings/PluginsTab.tsx +304 -70
- package/src/renderer/src-web/components/Settings/ThemeTab.tsx +6 -1
- package/src/renderer/src-web/components/SettingsWindow.tsx +110 -3
- package/src/renderer/src-web/components/VeoStudioPanel.tsx +549 -0
- package/src/renderer/src-web/css/image-studio.css +106 -0
- package/src/renderer/src-web/css/settings.css +158 -0
- package/src/renderer/src-web/css/styles.css +369 -1
- package/src/renderer/src-web/css/veo-studio.css +650 -0
- package/src/renderer/src-web/index.css +1 -0
- package/src/renderer/src-web/tauri.ts +135 -16
- package/src-tauri/src/desktop.rs +18 -16
- package/src-tauri/src/discord_rpc.rs +1 -1
- package/src-tauri/src/lib.rs +155 -25
- package/src-tauri/src/webhooks.rs +45 -31
- package/src-tauri/src/workflows.rs +1 -0
- package/src-tauri/tauri.conf.json +1 -1
- package/temp_gridgeist/AGENTS.md +8 -0
- package/temp_gridgeist/CHANGELOG.md +130 -0
- package/temp_gridgeist/LICENSE +21 -0
- package/temp_gridgeist/README.md +323 -0
- package/temp_gridgeist/README.th.md +325 -0
- package/temp_gridgeist/skills/gridgeist/SKILL.md +88 -0
- package/temp_gridgeist/skills/gridgeist/agents/openai.yaml +9 -0
- package/temp_gridgeist/skills/gridgeist/assets/gridgeist-small.svg +10 -0
- package/temp_gridgeist/skills/gridgeist/assets/gridgeist.png +0 -0
- package/temp_gridgeist/skills/gridgeist/assets/gridgeist.svg +18 -0
- package/temp_gridgeist/skills/gridgeist/references/design-language.md +88 -0
- package/temp_gridgeist/skills/gridgeist/references/review-checklist.md +128 -0
- package/temp_gridgeist/skills/gridgeist/references/system-contract.md +109 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
use crate::confirm;
|
|
2
|
+
use crate::{DIM, ERROR, MINT, RESET, WARN};
|
|
3
|
+
use anyhow::Result;
|
|
4
|
+
use mint_core::MintConfig;
|
|
5
|
+
use std::fs;
|
|
6
|
+
use std::path::{Path, PathBuf}; // Will be moved to interactive later, or crate::interactive::confirm
|
|
7
|
+
|
|
8
|
+
pub struct ActionStreamFilter {
|
|
9
|
+
buffer: String,
|
|
10
|
+
in_action: bool,
|
|
11
|
+
action_text: String,
|
|
12
|
+
actions: Vec<String>,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl ActionStreamFilter {
|
|
16
|
+
pub fn new() -> Self {
|
|
17
|
+
Self {
|
|
18
|
+
buffer: String::new(),
|
|
19
|
+
in_action: false,
|
|
20
|
+
action_text: String::new(),
|
|
21
|
+
actions: Vec::new(),
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
pub fn process_chunk(&mut self, chunk: &str, mut print_fn: impl FnMut(&str)) {
|
|
26
|
+
for c in chunk.chars() {
|
|
27
|
+
if self.in_action {
|
|
28
|
+
if c == ']' {
|
|
29
|
+
self.in_action = false;
|
|
30
|
+
self.actions.push(self.action_text.clone());
|
|
31
|
+
self.action_text.clear();
|
|
32
|
+
} else {
|
|
33
|
+
self.action_text.push(c);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
self.buffer.push(c);
|
|
37
|
+
let action_prefix = "[ACTION:";
|
|
38
|
+
if action_prefix.starts_with(&self.buffer) {
|
|
39
|
+
if self.buffer == action_prefix {
|
|
40
|
+
self.in_action = true;
|
|
41
|
+
self.buffer.clear();
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
if let Some(pos) = self.buffer.find('[') {
|
|
45
|
+
print_fn(&self.buffer[..pos]);
|
|
46
|
+
let new_buf = self.buffer[pos..].to_string();
|
|
47
|
+
self.buffer = new_buf;
|
|
48
|
+
if !action_prefix.starts_with(&self.buffer) {
|
|
49
|
+
print_fn(&self.buffer);
|
|
50
|
+
self.buffer.clear();
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
print_fn(&self.buffer);
|
|
54
|
+
self.buffer.clear();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
pub fn finalize(&mut self, mut print_fn: impl FnMut(&str)) -> Vec<String> {
|
|
62
|
+
if !self.buffer.is_empty() {
|
|
63
|
+
print_fn(&self.buffer);
|
|
64
|
+
self.buffer.clear();
|
|
65
|
+
}
|
|
66
|
+
if self.in_action {
|
|
67
|
+
print_fn(&format!("[ACTION:{}", self.action_text));
|
|
68
|
+
self.action_text.clear();
|
|
69
|
+
self.in_action = false;
|
|
70
|
+
}
|
|
71
|
+
std::mem::take(&mut self.actions)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
pub fn open_system_handler(target: &str) -> Result<()> {
|
|
76
|
+
#[cfg(target_os = "windows")]
|
|
77
|
+
{
|
|
78
|
+
std::process::Command::new("cmd")
|
|
79
|
+
.args(&["/c", "start", "", target])
|
|
80
|
+
.spawn()?;
|
|
81
|
+
}
|
|
82
|
+
#[cfg(target_os = "macos")]
|
|
83
|
+
{
|
|
84
|
+
std::process::Command::new("open").arg(target).spawn()?;
|
|
85
|
+
}
|
|
86
|
+
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
|
|
87
|
+
{
|
|
88
|
+
std::process::Command::new("xdg-open").arg(target).spawn()?;
|
|
89
|
+
}
|
|
90
|
+
Ok(())
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pub fn launch_desktop_app(name: &str) -> Result<()> {
|
|
94
|
+
#[cfg(target_os = "windows")]
|
|
95
|
+
{
|
|
96
|
+
std::process::Command::new("cmd")
|
|
97
|
+
.args(&["/c", "start", "", name])
|
|
98
|
+
.spawn()?;
|
|
99
|
+
}
|
|
100
|
+
#[cfg(target_os = "macos")]
|
|
101
|
+
{
|
|
102
|
+
std::process::Command::new("open")
|
|
103
|
+
.args(&["-a", name])
|
|
104
|
+
.spawn()?;
|
|
105
|
+
}
|
|
106
|
+
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
|
|
107
|
+
{
|
|
108
|
+
if std::process::Command::new(name)
|
|
109
|
+
.stdin(std::process::Stdio::null())
|
|
110
|
+
.stdout(std::process::Stdio::null())
|
|
111
|
+
.stderr(std::process::Stdio::null())
|
|
112
|
+
.spawn()
|
|
113
|
+
.is_ok()
|
|
114
|
+
{
|
|
115
|
+
return Ok(());
|
|
116
|
+
}
|
|
117
|
+
let lower = name.to_lowercase();
|
|
118
|
+
if std::process::Command::new("gtk-launch")
|
|
119
|
+
.arg(&lower)
|
|
120
|
+
.stdin(std::process::Stdio::null())
|
|
121
|
+
.stdout(std::process::Stdio::null())
|
|
122
|
+
.stderr(std::process::Stdio::null())
|
|
123
|
+
.spawn()
|
|
124
|
+
.is_ok()
|
|
125
|
+
{
|
|
126
|
+
return Ok(());
|
|
127
|
+
}
|
|
128
|
+
std::process::Command::new("xdg-open").arg(name).spawn()?;
|
|
129
|
+
}
|
|
130
|
+
Ok(())
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
pub fn read_file_content(path: &Path) -> Result<()> {
|
|
134
|
+
let content = fs::read_to_string(path)?;
|
|
135
|
+
println!("{}", content);
|
|
136
|
+
Ok(())
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
pub fn read_folder_content(path: &Path) -> Result<()> {
|
|
140
|
+
let entries = fs::read_dir(path)?;
|
|
141
|
+
for entry in entries {
|
|
142
|
+
let entry = entry?;
|
|
143
|
+
let file_name = entry.file_name();
|
|
144
|
+
let file_name_str = file_name.to_string_lossy();
|
|
145
|
+
let metadata = entry.metadata()?;
|
|
146
|
+
if metadata.is_dir() {
|
|
147
|
+
println!("{MINT}{}/{}", file_name_str, RESET);
|
|
148
|
+
} else {
|
|
149
|
+
println!("{}", file_name_str);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
Ok(())
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
pub fn confirm_shell_execution() -> Result<bool> {
|
|
156
|
+
confirm("Approve local shell execution? [y/N]")
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
pub fn print_shell_output(output: &mint_core::ShellOutput) {
|
|
160
|
+
if !output.stdout.is_empty() {
|
|
161
|
+
print!("{}", output.stdout);
|
|
162
|
+
}
|
|
163
|
+
if !output.stderr.is_empty() {
|
|
164
|
+
eprint!("{}", output.stderr);
|
|
165
|
+
}
|
|
166
|
+
if !output.stdout.ends_with('\n') && !output.stderr.ends_with('\n') {
|
|
167
|
+
println!();
|
|
168
|
+
}
|
|
169
|
+
println!(
|
|
170
|
+
"{DIM}[exit: {} | sandboxed: {}]{RESET}\n",
|
|
171
|
+
output
|
|
172
|
+
.status
|
|
173
|
+
.map_or_else(|| "unknown".into(), |status| status.to_string()),
|
|
174
|
+
output.sandboxed
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
pub fn execute_action(action: &str, config: &MintConfig) -> Result<()> {
|
|
179
|
+
let trimmed = action.trim();
|
|
180
|
+
if let Some((cmd, args)) = trimmed.split_once(' ') {
|
|
181
|
+
let cmd = cmd.trim();
|
|
182
|
+
let args = args.trim();
|
|
183
|
+
match cmd {
|
|
184
|
+
"open" => {
|
|
185
|
+
println!("{WARN}System action:{RESET} opening {args}...\n");
|
|
186
|
+
open_system_handler(args)?;
|
|
187
|
+
}
|
|
188
|
+
"open-app" => {
|
|
189
|
+
println!("{WARN}System action:{RESET} launching app {args}...\n");
|
|
190
|
+
launch_desktop_app(args)?;
|
|
191
|
+
}
|
|
192
|
+
"read-file" => {
|
|
193
|
+
println!("{WARN}System action:{RESET} reading file {args}...\n");
|
|
194
|
+
let path = PathBuf::from(args);
|
|
195
|
+
read_file_content(&path)?;
|
|
196
|
+
}
|
|
197
|
+
"read-folder" => {
|
|
198
|
+
println!("{WARN}System action:{RESET} reading folder {args}...\n");
|
|
199
|
+
let path = PathBuf::from(args);
|
|
200
|
+
read_folder_content(&path)?;
|
|
201
|
+
}
|
|
202
|
+
"run-shell" => {
|
|
203
|
+
println!("{WARN}System action:{RESET} run local shell command");
|
|
204
|
+
println!(" {args}");
|
|
205
|
+
if confirm_shell_execution()? {
|
|
206
|
+
let output = mint_core::run_shell_command(
|
|
207
|
+
args,
|
|
208
|
+
&std::env::current_dir()?,
|
|
209
|
+
true,
|
|
210
|
+
config,
|
|
211
|
+
)?;
|
|
212
|
+
print_shell_output(&output);
|
|
213
|
+
} else {
|
|
214
|
+
println!("Shell command cancelled.\n");
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
_ => {
|
|
218
|
+
println!("{ERROR}Unknown system action:{RESET} {cmd} with args {args}\n");
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
match trimmed {
|
|
223
|
+
"read-folder" => {
|
|
224
|
+
println!("{WARN}System action:{RESET} reading folder . ...\n");
|
|
225
|
+
read_folder_content(&PathBuf::from("."))?;
|
|
226
|
+
}
|
|
227
|
+
_ => {
|
|
228
|
+
println!("{ERROR}Invalid action format:{RESET} {trimmed}\n");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
Ok(())
|
|
233
|
+
}
|