Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(onboarding): make Stay Awake step cross-platform, not macOS-only

devrahulbanjara6bdfe142c33f
diff --git a/src/main/index.ts b/src/main/index.ts
index 737d9c8d..cf284325 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -3971,9 +3971,11 @@ ipcMain.handle('app:setNotifications', (_evt, val) => writeConfig({ notification
// ─── IPC: onboarding reliability — open Settings deep-link + login-item toggle ─
/** Open a System Settings deep-link (or https URL) in the OS default handler.
* Restricted to Settings panes / https so the renderer can't shell arbitrary
- * schemes. Used by the onboarding "Permissions & reliability" step. */
+ * schemes. macOS uses `x-apple.systempreferences:`, Windows uses `ms-settings:`
+ * (Linux has no universal settings URI, so the renderer never sends one there).
+ * Used by the onboarding "Permissions & reliability" step. */
ipcMain.handle('app:openExternal', async (_evt, url: unknown) => {
- if (typeof url !== 'string' || !/^(x-apple\.systempreferences:|https:\/\/)/.test(url)) {
+ if (typeof url !== 'string' || !/^(x-apple\.systempreferences:|ms-settings:|https:\/\/)/.test(url)) {
return { ok: false, error: 'blocked url' };
}
await shell.openExternal(url);
diff --git a/src/renderer/src/components/OnboardingWizard.tsx b/src/renderer/src/components/OnboardingWizard.tsx
index 3679026d..cfbc77e4 100644
--- a/src/renderer/src/components/OnboardingWizard.tsx
+++ b/src/renderer/src/components/OnboardingWizard.tsx
@@ -152,6 +152,18 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
};
const openSettings = (url: string) => { void window.cth.openExternal(url); };
+ // Power-settings deep-link differs per OS (macOS/Windows have one, Linux
+ // doesn't have a universal settings URI across desktop environments) —
+ // drive the copy and the button off the actual platform instead of
+ // hardcoding one OS's instructions.
+ const platform = window.cth.platform;
+ const stayAwakeOs: 'mac' | 'windows' | 'linux' =
+ platform === 'darwin' ? 'mac' : platform === 'win32' ? 'windows' : 'linux';
+ const stayAwakeUrl =
+ stayAwakeOs === 'mac' ? 'x-apple.systempreferences:com.apple.preference.battery' :
+ stayAwakeOs === 'windows' ? 'ms-settings:powersleep' :
+ null;
+
// Default-suggest a sensible harness home on first render.
//
// This used to read `window.process.env.HOME`, which is ALWAYS undefined here:
@@ -650,7 +662,7 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
onChange={() => setShareStats(!shareStats)}
/>
- {/* LEVER 4 "— instruction-only: macOS won't let the app flip Energy, so we deep-link the pane. */}
+ {/* LEVER 4 "— instruction-only: the OS won't let the app flip its sleep setting itself, so we deep-link the pane where one exists (macOS/Windows) and fall back to text-only guidance on Linux. */}
<div style={{
display: 'flex', gap: 10, alignItems: 'flex-start', padding: 10,
background: 'var(--cth-lemon-light)',
@@ -669,15 +681,17 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
{t('onboarding.permissions.stayAwake')}
</div>
<div style={{ fontSize: 12, lineHeight: '16px', color: 'var(--cth-ink-700)' }}>
- {t('onboarding.permissions.stayAwakeDesc')}
+ {t(`onboarding.permissions.stayAwakeDesc${stayAwakeOs === 'mac' ? 'Mac' : stayAwakeOs === 'windows' ? 'Windows' : 'Linux'}`)}
</div>
</div>
- <PixelButton variant="secondary" size="sm"
- onClick={() => openSettings('x-apple.systempreferences:com.apple.preference.battery')}>
- <span style={{ display: 'inline-flex', gap: 6, alignItems: 'center' }}>
- <Icon name="arrow-right" /> {t('onboarding.permissions.openBattery')}
- </span>
- </PixelButton>
+ {stayAwakeUrl && (
+ <PixelButton variant="secondary" size="sm"
+ onClick={() => openSettings(stayAwakeUrl)}>
+ <span style={{ display: 'inline-flex', gap: 6, alignItems: 'center' }}>
+ <Icon name="arrow-right" /> {t(`onboarding.permissions.openBattery${stayAwakeOs === 'mac' ? 'Mac' : 'Windows'}`)}
+ </span>
+ </PixelButton>
+ )}
</div>
</div>
</>
diff --git a/src/renderer/src/i18n/locales/ar.json b/src/renderer/src/i18n/locales/ar.json
index bf96cca6..3504b2a3 100644
--- a/src/renderer/src/i18n/locales/ar.json
+++ b/src/renderer/src/i18n/locales/ar.json
@@ -682,18 +682,21 @@
"autoNote": "الخيار الافتراضي الصحيح لتجربة \"غرفة التحكّم\"؛ وفخّ على مستودعات الإنتاج. تجاوِزه لكل وكيل في نافذة إضافة وكيل.",
"reliabilityHead": "أبقِ كل شيء يعمل وأنت غائب",
"reliabilityDescPlain": "يواصل وكلاؤك العمل وفق جدول وفي طرفيات حيّة، حتى حين تبتعد. تُبقيك هذه الإعدادات على اطّلاع وتُبقي كل شيء يعمل.",
- "reliabilityDesc": "يواصل وكلاؤك العمل وفق جدول وفي طرفيات حيّة. وإن نام جهاز Mac تمامًا توقّفت تلك المؤقّتات ثم لحقت بما فاتها لحظة عودتك — لا يضيع شيء، لكنه قد يتأخّر.",
+ "reliabilityDesc": "يواصل وكلاؤك العمل وفق جدول وفي طرفيات حيّة. وإن نام جهازك تمامًا توقّفت تلك المؤقّتات ثم لحقت بما فاتها لحظة عودتك — لا يضيع شيء، لكنه قد يتأخّر.",
"keepAwake": "واصِل العمل أثناء غيابك",
- "keepAwakeDesc": "إبقاء قوي على الاستيقاظ: يمنع جهاز Mac من النوم ما دام وكيل نشطًا، لتعمل الجداول والطرفيات في وقتها حتى حين تبتعد. يستهلك بطارية أكثر — الأفضل عند التوصيل بالكهرباء. معطّل افتراضيًا.",
+ "keepAwakeDesc": "إبقاء قوي على الاستيقاظ: يمنع جهازك من النوم ما دام وكيل نشطًا، لتعمل الجداول والطرفيات في وقتها حتى حين تبتعد. يستهلك بطارية أكثر — الأفضل عند التوصيل بالكهرباء. معطّل افتراضيًا.",
"notifications": "إشعارات سطح المكتب",
- "notificationsDesc": "تصلك تنبيهات حين يحتاجك وكيل أو تحتاج طرفية إلى إنعاش — حتى وأنت بعيد. يطلب macOS الإذن عند أول إشعار.",
+ "notificationsDesc": "تصلك تنبيهات حين يحتاجك وكيل أو تحتاج طرفية إلى إنعاش — حتى وأنت بعيد. قد يطلب نظامك الإذن عند أول إشعار.",
"openAtLogin": "الفتح عند تسجيل الدخول",
"openAtLoginDesc": "أعِد تشغيل المنصّة بعد إقلاع الجهاز لتستأنف المهام المجدولة وحدها. بلا سؤال — يسري فورًا.",
"shareStats": "شارك إحصاءات استخدام مجهولة",
"shareStatsDesc": "حفنة من الأحداث المجهولة (فتح التطبيق، إنشاء وكيل، استخدام ميزة) تساعد على تحسين Munder Difflin — لا موجّهات ولا شيفرة ولا مسارات ملفات ولا مخرجات وكلاء أبدًا. القائمة الكاملة في TELEMETRY.md؛ ويمكن تغييرها في أي وقت من الإعدادات.",
"stayAwake": "ابقَ مستيقظًا عند التوصيل بالكهرباء (يدويًا)",
- "stayAwakeDesc": "لا يسمح لك macOS بضبط هذا إلا بنفسك. من البطارية ← خيارات، فعّل \"منع النوم التلقائي عند إطفاء الشاشة\" (عند التوصيل بمحوّل الطاقة) لتستمر المؤقّتات في العمل والشاشة نائمة. وبدون إعداد يمنع النوم يظل جهاز Mac ينام فعلًا — يبقى العمل سليمًا ويلحق بما فاته عند الاستيقاظ.",
- "openBattery": "افتح إعدادات البطارية",
+ "stayAwakeDescMac": "لا يسمح لك macOS بضبط هذا إلا بنفسك. من البطارية ← خيارات، فعّل \"منع النوم التلقائي عند إطفاء الشاشة\" (عند التوصيل بمحوّل الطاقة) لتستمر المؤقّتات في العمل والشاشة نائمة. وبدون إعداد يمنع النوم يظل جهاز Mac ينام فعلًا — يبقى العمل سليمًا ويلحق بما فاته عند الاستيقاظ.",
+ "stayAwakeDescWindows": "لا يسمح لك Windows بضبط هذا إلا بنفسك. من الإعدادات ← النظام ← الطاقة والبطارية ← الشاشة والسكون، اضبط \"وضع الجهاز في وضع السكون\" على أبدًا (أو زِد المدة) لتستمر المؤقّتات في العمل. وبدون إعداد يمنع النوم يظل جهاز Windows ينام فعلًا — يبقى العمل سليمًا ويلحق بما فاته عند الاستيقاظ.",
+ "stayAwakeDescLinux": "لا تسمح لك بيئة سطح المكتب بضبط هذا إلا بنفسك. ابحث عن لوحة إعدادات الطاقة (مثل إعدادات GNOME ← الطاقة، أو إعدادات النظام في KDE ← إدارة الطاقة) وعطّل النوم/التعليق التلقائي أثناء التوصيل بالكهرباء. وبدون إعداد يمنع النوم يظل جهازك ينام فعلًا — يبقى العمل سليمًا ويلحق بما فاته عند الاستيقاظ.",
+ "openBatteryMac": "افتح إعدادات البطارية",
+ "openBatteryWindows": "افتح إعدادات الطاقة",
"setItUp": "أعِدّه",
"next": "التالي"
},
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index b6e4d772..fbeb6fad 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -682,18 +682,21 @@
"autoNote": "The right default for the \"control room\" experience; a foot-gun on production repos. Override per agent in the Add Agent dialog.",
"reliabilityHead": "KEEP THINGS RUNNING WHILE YOU'RE AWAY",
"reliabilityDescPlain": "Your agents keep working on a schedule and in live terminals, even when you step away. These settings keep you in the loop and keep things running.",
- "reliabilityDesc": "Your agents keep working on a schedule and in live terminals. If your Mac fully sleeps those timers pause and catch up the moment you're back — nothing is lost, it may just run late.",
+ "reliabilityDesc": "Your agents keep working on a schedule and in live terminals. If your computer fully sleeps those timers pause and catch up the moment you're back — nothing is lost, it may just run late.",
"keepAwake": "KEEP WORKING WHILE AWAY",
- "keepAwakeDesc": "Strong keep-alive: stops your Mac from sleeping while an agent is live, so schedules and terminals fire on time even when you step away. Uses more battery — best on power. Off by default.",
+ "keepAwakeDesc": "Strong keep-alive: stops your computer from sleeping while an agent is live, so schedules and terminals fire on time even when you step away. Uses more battery — best on power. Off by default.",
"notifications": "DESKTOP NOTIFICATIONS",
- "notificationsDesc": "Get pinged when an agent needs you or a terminal needs reviving — even while you're away. macOS asks permission the first time one fires.",
+ "notificationsDesc": "Get pinged when an agent needs you or a terminal needs reviving — even while you're away. Your system may ask permission the first time one fires.",
"openAtLogin": "OPEN AT LOGIN",
"openAtLoginDesc": "Relaunch the harness after a reboot so scheduled missions resume on their own. No prompt — applies immediately.",
"shareStats": "SHARE ANONYMOUS USAGE STATS",
"shareStatsDesc": "A handful of anonymous events (app opened, agent spawned, feature used) that help improve Munder Difflin — never prompts, code, file paths, or agent output. Full list in TELEMETRY.md; change anytime in Settings.",
"stayAwake": "STAY AWAKE ON POWER (MANUAL)",
- "stayAwakeDesc": "macOS only lets you set this one yourself. In Battery → Options, turn on \"Prevent automatic sleeping when the display is off\" (on power adapter) so timers keep firing with the display asleep. Without a sleep-preventing setting the Mac still truly sleeps — work survives and catches up on wake.",
- "openBattery": "open Battery settings",
+ "stayAwakeDescMac": "macOS only lets you set this one yourself. In Battery → Options, turn on \"Prevent automatic sleeping when the display is off\" (on power adapter) so timers keep firing with the display asleep. Without a sleep-preventing setting the Mac still truly sleeps — work survives and catches up on wake.",
+ "stayAwakeDescWindows": "Windows only lets you set this one yourself. In Settings → System → Power & battery → Screen, blank & sleep, set \"On battery power, put my device to sleep\" and \"When plugged in\" to Never (or increase them) so timers keep firing. Without a sleep-preventing setting Windows still truly sleeps — work survives and catches up on wake.",
+ "stayAwakeDescLinux": "Your desktop environment only lets you set this one yourself. Look for a Power Settings panel (e.g. GNOME Settings → Power, or KDE System Settings → Power Management) and disable automatic sleep/suspend while on power. Without a sleep-preventing setting your machine still truly sleeps — work survives and catches up on wake.",
+ "openBatteryMac": "open Battery settings",
+ "openBatteryWindows": "open Power settings",
"setItUp": "set it up",
"next": "next"
},
diff --git a/src/renderer/src/i18n/locales/zh-CN.json b/src/renderer/src/i18n/locales/zh-CN.json
index a15423d8..8adfefee 100644
--- a/src/renderer/src/i18n/locales/zh-CN.json
+++ b/src/renderer/src/i18n/locales/zh-CN.json
@@ -682,18 +682,21 @@
"autoNote": "「控制室」体验的正确默认值;在生产仓库上是个坑。可在添加智能体对话框中按智能体覆盖。",
"reliabilityHead": "你离开时保持一切运转",
"reliabilityDescPlain": "即使你离开,你的智能体也会按计划在实时终端中继续工作。这些设置让你保持知情,并让一切继续运转。",
- "reliabilityDesc": "你的智能体会按计划在实时终端中继续工作。如果你的 Mac 完全休眠,这些定时器会暂停,等你回来再补上——什么都不会丢,只是可能跑得晚一些。",
+ "reliabilityDesc": "你的智能体会按计划在实时终端中继续工作。如果你的电脑完全休眠,这些定时器会暂停,等你回来再补上——什么都不会丢,只是可能跑得晚一些。",
"keepAwake": "离开时保持工作",
- "keepAwakeDesc": "强保活:有智能体活跃时阻止 Mac 休眠,这样即使你离开,计划和终端也能准时触发。更耗电——最好接电源。默认关闭。",
+ "keepAwakeDesc": "强保活:有智能体活跃时阻止电脑休眠,这样即使你离开,计划和终端也能准时触发。更耗电——最好接电源。默认关闭。",
"notifications": "桌面通知",
- "notificationsDesc": "智能体需要你或终端需要抢救时提醒你——即使你不在。第一次触发时 macOS 会请求权限。",
+ "notificationsDesc": "智能体需要你或终端需要抢救时提醒你——即使你不在。第一次触发时你的系统可能会请求权限。",
"openAtLogin": "开机启动",
"openAtLoginDesc": "重启后自动重新启动 harness,让计划任务自行恢复。无提示——立即生效。",
"shareStats": "共享匿名使用统计",
"shareStatsDesc": "少量匿名事件(打开应用、生成智能体、使用功能),用于改进 Munder Difflin——绝不包含提示词、代码、文件路径或智能体输出。完整清单见 TELEMETRY.md;可随时在设置中更改。",
"stayAwake": "接电源时保持唤醒(手动)",
- "stayAwakeDesc": "macOS 只允许你自己设置这一项。在「电池」→「选项」中,开启「防止显示器关闭时自动进入睡眠」(接电源适配器时),这样显示器休眠时定时器也能继续触发。没有防休眠设置的话 Mac 仍会真正休眠——工作会保存并在唤醒后补上。",
- "openBattery": "打开电池设置",
+ "stayAwakeDescMac": "macOS 只允许你自己设置这一项。在「电池」→「选项」中,开启「防止显示器关闭时自动进入睡眠」(接电源适配器时),这样显示器休眠时定时器也能继续触发。没有防休眠设置的话 Mac 仍会真正休眠——工作会保存并在唤醒后补上。",
+ "stayAwakeDescWindows": "Windows 只允许你自己设置这一项。在「设置」→「系统」→「电源和电池」→「屏幕和睡眠」中,将「使用电源时,使设备进入睡眠状态」设为「从不」(或延长时间),这样定时器也能继续触发。没有防休眠设置的话 Windows 仍会真正休眠——工作会保存并在唤醒后补上。",
+ "stayAwakeDescLinux": "你的桌面环境只允许你自己设置这一项。请查找电源设置面板(例如 GNOME 设置 →「电源」,或 KDE 系统设置 →「电源管理」),并在接电源时关闭自动休眠/挂起。没有防休眠设置的话系统仍会真正休眠——工作会保存并在唤醒后补上。",
+ "openBatteryMac": "打开电池设置",
+ "openBatteryWindows": "打开电源设置",
"setItUp": "开始设置",
"next": "下一步"
},