@pheem49/mint 1.5.2 → 1.5.4

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 (40) hide show
  1. package/GUIDE_TH.md +23 -11
  2. package/README.md +148 -66
  3. package/assets/Agent_Mint.png +0 -0
  4. package/assets/Settings.png +0 -0
  5. package/install.ps1 +64 -0
  6. package/install.sh +54 -0
  7. package/main.js +12 -0
  8. package/package.json +5 -3
  9. package/preload.js +4 -0
  10. package/scripts/install_linux_desktop_entry.js +48 -0
  11. package/src/AI_Brain/Gemini_API.js +231 -498
  12. package/src/AI_Brain/autonomous_brain.js +46 -19
  13. package/src/AI_Brain/headless_agent.js +21 -2
  14. package/src/AI_Brain/provider_adapter.js +358 -0
  15. package/src/Automation_Layer/file_operations.js +17 -5
  16. package/src/CLI/approval_handler.js +5 -0
  17. package/src/CLI/chat_router.js +7 -0
  18. package/src/CLI/chat_ui.js +397 -76
  19. package/src/CLI/cli_colors.js +86 -3
  20. package/src/CLI/cli_formatters.js +6 -1
  21. package/src/CLI/code_agent.js +706 -273
  22. package/src/CLI/interactive_chat.js +311 -149
  23. package/src/CLI/slash_command_handler.js +2 -2
  24. package/src/CLI/updater.js +21 -1
  25. package/src/System/config_manager.js +5 -1
  26. package/src/System/ipc_handlers.js +95 -1
  27. package/src/System/picture_store.js +109 -0
  28. package/src/System/smart_context.js +227 -0
  29. package/src/System/task_manager.js +127 -0
  30. package/src/System/tool_registry.js +13 -0
  31. package/src/System/window_manager.js +16 -8
  32. package/src/UI/live2d_manager.js +42 -8
  33. package/src/UI/preload-spotlight.js +1 -0
  34. package/src/UI/renderer.js +837 -63
  35. package/src/UI/settings.css +160 -96
  36. package/src/UI/settings.html +9 -0
  37. package/src/UI/settings.js +35 -2
  38. package/src/UI/spotlight.js +13 -9
  39. package/src/UI/styles.css +1592 -165
  40. package/privacy.txt +0 -1
@@ -9,12 +9,19 @@ function createWindowManager(projectRoot) {
9
9
  let tray = null;
10
10
 
11
11
  function createMainWindow() {
12
+ const iconPath = path.join(projectRoot, 'assets', 'icon.png');
13
+ const { width: screenWidth, height: screenHeight } = screen.getPrimaryDisplay().workAreaSize;
14
+ const windowWidth = Math.min(1360, Math.max(1180, screenWidth - 40));
15
+ const windowHeight = Math.min(920, Math.max(860, screenHeight - 40));
16
+
12
17
  mainWindow = new BrowserWindow({
13
- width: 1180,
14
- height: 860,
18
+ width: windowWidth,
19
+ height: windowHeight,
15
20
  minWidth: 900,
16
21
  minHeight: 680,
17
- icon: path.join(projectRoot, 'assets', 'icon.png'),
22
+ x: Math.floor((screenWidth - windowWidth) / 2),
23
+ y: Math.floor((screenHeight - windowHeight) / 2),
24
+ icon: nativeImage.createFromPath(iconPath),
18
25
  webPreferences: {
19
26
  preload: path.join(projectRoot, 'preload.js'),
20
27
  nodeIntegration: false,
@@ -75,12 +82,13 @@ function createWindowManager(projectRoot) {
75
82
  return settingsWindow;
76
83
  }
77
84
 
85
+ const iconPath = path.join(projectRoot, 'assets', 'icon.png');
78
86
  settingsWindow = new BrowserWindow({
79
- width: 720,
80
- height: 620,
81
- minWidth: 640,
82
- minHeight: 560,
83
- icon: path.join(projectRoot, 'assets', 'icon.png'),
87
+ width: 1020,
88
+ height: 720,
89
+ minWidth: 860,
90
+ minHeight: 620,
91
+ icon: nativeImage.createFromPath(iconPath),
84
92
  webPreferences: {
85
93
  preload: path.join(projectRoot, 'preload-settings.js'),
86
94
  nodeIntegration: false,
@@ -18,6 +18,9 @@ window.Live2DManager = {
18
18
  cat: { paramId: 'Param54', label: 'Cat Filter' }
19
19
  },
20
20
  pointerTrackingEnabled: true,
21
+ zoomMultiplier: 1,
22
+ interactionZoneOrigin: { x: 0.5, y: 0.58 },
23
+ fitModelToMount: null,
21
24
  pointerTrackingFrame: null,
22
25
  pointerTracking: {
23
26
  targetX: 0,
@@ -135,7 +138,7 @@ window.Live2DManager = {
135
138
  const heightScale = mountHeight / Math.max(modelHeight, 1);
136
139
 
137
140
  // Reduced zoom to 2.0 as requested
138
- const scale = Math.min(widthScale, heightScale) * 1.85;
141
+ const scale = Math.min(widthScale, heightScale) * 1.85 * this.zoomMultiplier;
139
142
 
140
143
  this.model.scale.set(scale);
141
144
  // Adjusted Y offset to 1.0 as requested
@@ -145,6 +148,7 @@ window.Live2DManager = {
145
148
  };
146
149
  this.applyModelFollowOffset();
147
150
  };
151
+ this.fitModelToMount = fitModel;
148
152
 
149
153
  requestAnimationFrame(() => {
150
154
  fitModel();
@@ -214,9 +218,9 @@ window.Live2DManager = {
214
218
  try {
215
219
  const point = this.getPointerViewportPoint(event);
216
220
  if (!point) return null;
217
- const { x, y } = point;
221
+ const { x, y } = this.toInteractionZonePoint(point);
218
222
 
219
- if (this.isPointInZone(x, y, 0.38, 0.40, 0.24, 0.115)) {
223
+ if (this.isPointInZone(x, y, 0.36, 0.375, 0.28, 0.12)) {
220
224
  return {
221
225
  id: 'face',
222
226
  label: 'Cat Ears',
@@ -225,7 +229,7 @@ window.Live2DManager = {
225
229
  };
226
230
  }
227
231
 
228
- if (this.isPointInZone(x, y, 0.34, 0.255, 0.32, 0.15)) {
232
+ if (this.isPointInZone(x, y, 0.34, 0.205, 0.32, 0.155)) {
229
233
  return {
230
234
  id: 'head',
231
235
  label: 'Head Pat',
@@ -234,8 +238,8 @@ window.Live2DManager = {
234
238
  };
235
239
  }
236
240
 
237
- const isLeftHand = this.isPointInZone(x, y, 0.22, 0.68, 0.20, 0.16);
238
- const isRightHand = this.isPointInZone(x, y, 0.61, 0.68, 0.19, 0.16);
241
+ const isLeftHand = this.isPointInZone(x, y, 0.14, 0.70, 0.22, 0.16);
242
+ const isRightHand = this.isPointInZone(x, y, 0.65, 0.69, 0.23, 0.17);
239
243
  if (isLeftHand || isRightHand) {
240
244
  return {
241
245
  id: isLeftHand ? 'left-hand' : 'right-hand',
@@ -245,7 +249,7 @@ window.Live2DManager = {
245
249
  };
246
250
  }
247
251
 
248
- if (this.isPointInZone(x, y, 0.38, 0.77, 0.30, 0.23)) {
252
+ if (this.isPointInZone(x, y, 0.34, 0.74, 0.30, 0.24)) {
249
253
  return {
250
254
  id: 'lower-body',
251
255
  label: 'Careful',
@@ -254,7 +258,7 @@ window.Live2DManager = {
254
258
  };
255
259
  }
256
260
 
257
- if (this.isPointInZone(x, y, 0.37, 0.555, 0.29, 0.14)) {
261
+ if (this.isPointInZone(x, y, 0.36, 0.53, 0.29, 0.145)) {
258
262
  return {
259
263
  id: 'body',
260
264
  label: 'Shoulder Tap',
@@ -293,6 +297,17 @@ window.Live2DManager = {
293
297
  return x >= left && x <= left + width && y >= top && y <= top + height;
294
298
  },
295
299
 
300
+ toInteractionZonePoint(point) {
301
+ const scale = this.zoomMultiplier || 1;
302
+ if (Math.abs(scale - 1) < 0.001) return point;
303
+
304
+ const origin = this.interactionZoneOrigin;
305
+ return {
306
+ x: origin.x + (point.x - origin.x) / scale,
307
+ y: origin.y + (point.y - origin.y) / scale
308
+ };
309
+ },
310
+
296
311
  cycleExpression() {
297
312
  if (!this.model) return;
298
313
  this.expIndex = (this.expIndex + 1) % this.expressionNames.length;
@@ -316,6 +331,25 @@ window.Live2DManager = {
316
331
  this.model.buttonMode = this.interactionEnabled;
317
332
  },
318
333
 
334
+ setPointerTrackingEnabled(isEnabled) {
335
+ this.pointerTrackingEnabled = Boolean(isEnabled);
336
+ if (this.pointerTrackingEnabled) return;
337
+
338
+ this.resetPointerTrackingTarget();
339
+ this.pointerTracking.currentX = 0;
340
+ this.pointerTracking.currentY = 0;
341
+ this.applyModelFollowOffset();
342
+ },
343
+
344
+ setZoomMultiplier(multiplier) {
345
+ const value = Number(multiplier);
346
+ this.zoomMultiplier = this.clamp(Number.isFinite(value) ? value : 1, 0.78, 1.28);
347
+ document.documentElement.style.setProperty('--model-zone-scale', String(this.zoomMultiplier));
348
+ if (typeof this.fitModelToMount === 'function') {
349
+ this.fitModelToMount();
350
+ }
351
+ },
352
+
319
353
  getSavedInteractionEnabled() {
320
354
  try {
321
355
  return localStorage.getItem(this.interactionStorageKey) !== 'false';
@@ -2,6 +2,7 @@ const { contextBridge, ipcRenderer } = require('electron');
2
2
 
3
3
  contextBridge.exposeInMainWorld('spotlightAPI', {
4
4
  submit: (query) => ipcRenderer.send('spotlight-submit', query),
5
+ executeAction: (action) => ipcRenderer.invoke('spotlight-action', action),
5
6
  close: () => ipcRenderer.send('spotlight-close'),
6
7
  hide: () => ipcRenderer.send('spotlight-hide'),
7
8
  resize: (width, height) => ipcRenderer.send('spotlight-resize', width, height),