@geminilight/mindos 0.1.3 → 0.1.5

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.
@@ -26,19 +26,20 @@ export default function SettingsModal({ open, onClose }: SettingsModalProps) {
26
26
  const [status, setStatus] = useState<'idle' | 'saved' | 'error' | 'load-error'>('idle');
27
27
  const { t, locale, setLocale } = useLocale();
28
28
 
29
- // Appearance state (localStorage-based) — read directly on mount; this component is client-only
30
- const [font, setFont] = useState(() => localStorage.getItem('prose-font') ?? 'lora');
31
- const [contentWidth, setContentWidth] = useState(() => localStorage.getItem('content-width') ?? '780px');
32
- const [dark, setDark] = useState(() => {
33
- const stored = localStorage.getItem('theme');
34
- return stored ? stored === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches;
35
- });
29
+ // Appearance state (localStorage-based)
30
+ const [font, setFont] = useState('lora');
31
+ const [contentWidth, setContentWidth] = useState('780px');
32
+ const [dark, setDark] = useState(true);
36
33
  // Plugin enabled state
37
34
  const [pluginStates, setPluginStates] = useState<Record<string, boolean>>({});
38
35
 
39
36
  useEffect(() => {
40
37
  if (!open) return;
41
38
  apiFetch<SettingsData>('/api/settings').then(setData).catch(() => setStatus('load-error'));
39
+ setFont(localStorage.getItem('prose-font') ?? 'lora');
40
+ setContentWidth(localStorage.getItem('content-width') ?? '780px');
41
+ const stored = localStorage.getItem('theme');
42
+ setDark(stored ? stored === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches);
42
43
  loadDisabledState();
43
44
  const initial: Record<string, boolean> = {};
44
45
  for (const r of getAllRenderers()) initial[r.id] = isRendererEnabled(r.id);
package/bin/cli.js CHANGED
@@ -240,6 +240,7 @@ const systemd = {
240
240
  install() {
241
241
  if (!existsSync(SYSTEMD_DIR)) mkdirSync(SYSTEMD_DIR, { recursive: true });
242
242
  ensureMindosDir();
243
+ const currentPath = process.env.PATH ?? '/usr/local/bin:/usr/bin:/bin';
243
244
  const unit = [
244
245
  '[Unit]',
245
246
  'Description=MindOS app + MCP server',
@@ -251,6 +252,7 @@ const systemd = {
251
252
  'Restart=on-failure',
252
253
  'RestartSec=3',
253
254
  `Environment=HOME=${homedir()}`,
255
+ `Environment=PATH=${currentPath}`,
254
256
  `EnvironmentFile=-${resolve(MINDOS_DIR, 'env')}`,
255
257
  `StandardOutput=append:${LOG_PATH}`,
256
258
  `StandardError=append:${LOG_PATH}`,
@@ -324,6 +326,9 @@ const launchd = {
324
326
  install() {
325
327
  if (!existsSync(LAUNCHD_DIR)) mkdirSync(LAUNCHD_DIR, { recursive: true });
326
328
  ensureMindosDir();
329
+ // Capture current PATH so the daemon can find npm/node even when launched by
330
+ // launchd (which only sets a minimal PATH and doesn't source shell profiles).
331
+ const currentPath = process.env.PATH ?? '/usr/local/bin:/usr/bin:/bin';
327
332
  const plist = `<?xml version="1.0" encoding="UTF-8"?>
328
333
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
329
334
  <plist version="1.0">
@@ -342,15 +347,24 @@ const launchd = {
342
347
  <key>EnvironmentVariables</key>
343
348
  <dict>
344
349
  <key>HOME</key><string>${homedir()}</string>
350
+ <key>PATH</key><string>${currentPath}</string>
345
351
  </dict>
346
352
  </dict>
347
353
  </plist>
348
354
  `;
349
355
  writeFileSync(LAUNCHD_PLIST, plist, 'utf-8');
350
356
  console.log(green(`✔ Wrote ${LAUNCHD_PLIST}`));
357
+ // Bootout first to ensure the new plist (with updated PATH) takes effect.
358
+ // Safe to ignore errors here — service may not be loaded yet.
359
+ try { execSync(`launchctl bootout gui/${launchctlUid()}/${LAUNCHD_LABEL}`, { stdio: 'pipe' }); } catch {}
351
360
  try {
352
- execSync(`launchctl bootstrap gui/${launchctlUid()} ${LAUNCHD_PLIST}`, { stdio: 'inherit' });
353
- } catch { /* already bootstrapped */ }
361
+ execSync(`launchctl bootstrap gui/${launchctlUid()} ${LAUNCHD_PLIST}`, { stdio: 'pipe' });
362
+ } catch (e) {
363
+ const msg = (e.stderr?.toString() ?? e.message ?? '').trim();
364
+ console.error(red(`\n✘ launchctl bootstrap failed: ${msg}`));
365
+ console.error(dim(' Try running: launchctl bootout gui/$(id -u)/com.mindos.app then retry.\n'));
366
+ process.exit(1);
367
+ }
354
368
  console.log(green('✔ Service installed'));
355
369
  },
356
370
 
@@ -826,6 +840,7 @@ ${dim('Shortcut: mindos start --daemon → install + start in one step')}
826
840
  if (daemonRunning) {
827
841
  console.log(cyan('\n Daemon is running — restarting to apply the new version...'));
828
842
  await runGatewayCommand('stop');
843
+ await runGatewayCommand('install'); // regenerate plist/unit with updated PATH and binary
829
844
  await runGatewayCommand('start');
830
845
  const webPort = process.env.MINDOS_WEB_PORT || '3000';
831
846
  console.log(dim(' (Waiting for Web UI to come back up...)'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminilight/mindos",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
5
5
  "keywords": [
6
6
  "mindos",