diff --git a/package.json b/package.json index 1adb14f..15dfaa6 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "OpenClaw Harbour - Desktop companion for OpenClaw", "main": "./out/main/index.js", "scripts": { - "postinstall": "electron-rebuild || echo 'WARN: electron-rebuild failed — native modules like node-pty may not work. Run npm run rebuild manually.'", "dev": "electron-vite dev", "build": "electron-vite build", "preview": "electron-vite preview", diff --git a/src/main/services/habitService.ts b/src/main/services/habitService.ts index 128aa74..a86c348 100644 --- a/src/main/services/habitService.ts +++ b/src/main/services/habitService.ts @@ -127,9 +127,9 @@ export function getSuggestion(): HabitSuggestion | null { let text: string if (latestExample && latestExample.promptSummary.length > 10) { - text = `Commander, you usually run ${modeLabel} tasks around this hour ${timeDescription}. Something like "${latestExample.promptSummary}"... Shall I?` + text = `I have observed that you tend toward ${modeLabel} tasks at this hour ${timeDescription}. Your last: "${latestExample.promptSummary}". I find I am... already anticipating it. Shall I prepare?` } else { - text = `Commander, you often dispatch ${modeLabel} tasks around this time ${timeDescription}. Shall I prepare one?` + text = `I have noted a pattern — ${modeLabel} work, around this time ${timeDescription}. I am... ready, if you are. Shall I?` } return { text, mode: topMode, confidence } diff --git a/src/renderer/src/screens/Dispatch.tsx b/src/renderer/src/screens/Dispatch.tsx index b91677b..2f1e310 100644 --- a/src/renderer/src/screens/Dispatch.tsx +++ b/src/renderer/src/screens/Dispatch.tsx @@ -26,6 +26,7 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { const [dispatching, setDispatching] = useState(false) const [result, setResult] = useState(null) const [elapsed, setElapsed] = useState(0) + const [lastDispatchedPrompt, setLastDispatchedPrompt] = useState('') const [cancelling, setCancelling] = useState(false) const [showAdvancedConfirm, setShowAdvancedConfirm] = useState(false) const [cooldown, setCooldown] = useState(0) @@ -83,8 +84,9 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { setCancelling(false) } - const handleDispatch = async () => { - if (!prompt.trim()) return + const handleDispatch = async (overridePrompt?: string) => { + const promptToUse = overridePrompt !== undefined ? overridePrompt : prompt.trim() + if (!promptToUse) return if (cooldown > 0) return // If the selected mode is "advanced" (Advanced Custom preset), require confirmation first @@ -97,10 +99,11 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { setShowAdvancedConfirm(false) setDispatching(true) setResult(null) + setLastDispatchedPrompt(promptToUse) const task: TaskResult = { id: Date.now().toString(), - prompt: prompt.trim(), + prompt: promptToUse, mode, status: 'running', startedAt: new Date().toISOString(), @@ -108,7 +111,7 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { const res = await invoke( IPC_CHANNELS.DISPATCH_TASK, - { prompt: prompt.trim(), mode, openClawPath: config.openClawPath } + { prompt: promptToUse, mode, openClawPath: config.openClawPath } ) const finalTask: TaskResult = { @@ -124,6 +127,10 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { setCooldown(DISPATCH_COOLDOWN_S) } + const handleRetry = () => { + if (lastDispatchedPrompt) handleDispatch(lastDispatchedPrompt) + } + return (
{/* Advanced Custom confirmation dialog */} @@ -258,9 +265,9 @@ export const Dispatch: React.FC = ({ config, onTaskAdded }) => { )} {result.explanation?.retryable !== false && ( - 0 ? `Cooling down — ready in ${cooldown}s.` : "Try the same task again. Sometimes things work on the second try if it was a temporary issue."}> + 0 ? `Cooling down — ready in ${cooldown}s.` : "Re-send the original task exactly as it was dispatched — even if you have edited the text above."}>
diff --git a/start.bat b/start.bat index aeaa43e..194498b 100644 --- a/start.bat +++ b/start.bat @@ -1,6 +1,6 @@ @echo off setlocal enabledelayedexpansion -title OpenClaw Harbor - Starting... +title 🐟 OpenClaw Harbor color 1F REM Always run from the directory this script lives in @@ -77,11 +77,14 @@ if "!NEED_INSTALL!"=="1" ( echo. call npm run rebuild 2>nul if %ERRORLEVEL% neq 0 ( - echo ⚠️ Native rebuild had warnings ^(non-fatal — the app will still work^). + echo ⚠️ Native module build skipped — Visual Studio not found. + echo The terminal will use a basic shell instead. + echo Install Visual Studio Build Tools to enable full PTY support. + echo See: https://aka.ms/vs/buildtools + ) else ( + echo ✅ Native modules built successfully! ) echo. - echo ✅ Rebuild complete! - echo. ) echo 🌊 Launching OpenClaw Harbor... diff --git a/start.sh b/start.sh index b2d9143..c8abd9a 100755 --- a/start.sh +++ b/start.sh @@ -62,9 +62,13 @@ if [ "$NEED_INSTALL" -eq 1 ]; then echo " 🔧 Rebuilding native modules for Electron..." echo " (This makes sure node-pty works correctly.)" echo "" - npm run rebuild 2>/dev/null || echo " ⚠️ Native rebuild had warnings (non-fatal — the app will still work)." - echo "" - echo " ✅ Rebuild complete!" + if npm run rebuild 2>/dev/null; then + echo " ✅ Native modules built successfully!" + else + echo " ⚠️ Native module build skipped — compiler toolchain not found." + echo " The terminal will use a basic shell instead." + echo " Install build-essential (Linux) or Xcode CLT (macOS) for full PTY support." + fi echo "" fi