@phuetz/code-buddy 1.1.0 → 1.2.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/README.md +160 -165
- package/dist/agent/autonomous/agentic-coding-contract.d.ts +6 -6
- package/dist/agent/codebuddy-agent.d.ts +1 -1
- package/dist/agent/codebuddy-agent.js +69 -14
- package/dist/agent/execution/agent-executor.js +122 -12
- package/dist/agent/execution/tool-dependency-graph.js +7 -0
- package/dist/agent/execution/tool-hooks.d.ts +6 -0
- package/dist/agent/execution/tool-hooks.js +13 -5
- package/dist/agent/execution/tool-selection-strategy.d.ts +11 -2
- package/dist/agent/execution/tool-selection-strategy.js +67 -10
- package/dist/agent/extended-thinking.d.ts +8 -0
- package/dist/agent/extended-thinking.js +27 -0
- package/dist/agent/hermes-browser-backends.js +151 -11
- package/dist/agent/hermes-claw-migrate.d.ts +59 -0
- package/dist/agent/hermes-claw-migrate.js +427 -26
- package/dist/agent/hermes-parity-manifest.js +78 -71
- package/dist/agent/hermes-runtime-lifecycle.d.ts +67 -0
- package/dist/agent/hermes-runtime-lifecycle.js +468 -0
- package/dist/agent/middleware/index.d.ts +1 -0
- package/dist/agent/middleware/index.js +1 -0
- package/dist/agent/middleware/visual-validation-middleware.d.ts +17 -0
- package/dist/agent/middleware/visual-validation-middleware.js +67 -0
- package/dist/agent/model-benchmark.d.ts +77 -0
- package/dist/agent/model-benchmark.js +309 -0
- package/dist/agent/model-tier.d.ts +14 -0
- package/dist/agent/model-tier.js +71 -0
- package/dist/agent/multi-agent/agents/orchestrator-agent.js +17 -6
- package/dist/agent/multi-agent/multi-agent-system.js +3 -1
- package/dist/agent/multi-agent/session-fleet-bridge.d.ts +2 -0
- package/dist/agent/multi-agent/session-fleet-bridge.js +9 -1
- package/dist/agent/multi-agent/session-tools.js +22 -5
- package/dist/agent/reasoning/mcts.js +20 -6
- package/dist/agent/session-end-flush.d.ts +6 -1
- package/dist/agent/session-end-flush.js +20 -4
- package/dist/agent/streaming/streaming-handler.d.ts +7 -0
- package/dist/agent/streaming/streaming-handler.js +8 -1
- package/dist/agent/tool-executor.js +1 -0
- package/dist/agent/tool-handler.d.ts +5 -0
- package/dist/agent/tool-handler.js +130 -4
- package/dist/browser-automation/browser-operator-executor.js +15 -0
- package/dist/browser-automation/browser-use-runner.d.ts +96 -0
- package/dist/browser-automation/browser-use-runner.js +492 -0
- package/dist/browser-automation/camofox-runner.d.ts +107 -0
- package/dist/browser-automation/camofox-runner.js +287 -0
- package/dist/channels/dingtalk/index.js +3 -0
- package/dist/channels/discord/client.d.ts +9 -0
- package/dist/channels/discord/client.js +12 -0
- package/dist/channels/feishu/index.d.ts +167 -1
- package/dist/channels/feishu/index.js +432 -7
- package/dist/channels/gateway-lifecycle.d.ts +132 -0
- package/dist/channels/gateway-lifecycle.js +219 -0
- package/dist/channels/google-chat/index.d.ts +5 -1
- package/dist/channels/google-chat/index.js +5 -1
- package/dist/channels/imessage/index.d.ts +14 -0
- package/dist/channels/imessage/index.js +64 -17
- package/dist/channels/index.d.ts +4 -0
- package/dist/channels/index.js +4 -0
- package/dist/channels/irc/index.d.ts +73 -3
- package/dist/channels/irc/index.js +446 -11
- package/dist/channels/line/index.js +3 -0
- package/dist/channels/mattermost/index.d.ts +51 -4
- package/dist/channels/mattermost/index.js +303 -20
- package/dist/channels/nextcloud-talk/index.d.ts +89 -8
- package/dist/channels/nextcloud-talk/index.js +367 -16
- package/dist/channels/nostr/index.d.ts +121 -1
- package/dist/channels/nostr/index.js +396 -8
- package/dist/channels/ntfy/index.js +3 -0
- package/dist/channels/qq/index.js +3 -0
- package/dist/channels/slash-parity.d.ts +117 -0
- package/dist/channels/slash-parity.js +185 -0
- package/dist/channels/synology-chat/index.js +3 -0
- package/dist/channels/teams/index.d.ts +3 -0
- package/dist/channels/teams/index.js +3 -0
- package/dist/channels/telegram/client.d.ts +9 -0
- package/dist/channels/telegram/client.js +12 -0
- package/dist/channels/twilio-voice/index.js +3 -0
- package/dist/channels/webchat/index.d.ts +7 -1
- package/dist/channels/webchat/index.js +7 -1
- package/dist/channels/wecom/index.js +3 -0
- package/dist/channels/weixin/index.js +3 -0
- package/dist/channels/zalo/index.js +3 -0
- package/dist/cli/config-loader.js +1 -1
- package/dist/codebuddy/client.d.ts +30 -1
- package/dist/codebuddy/client.js +167 -20
- package/dist/codebuddy/providers/provider-chatgpt-responses.d.ts +5 -0
- package/dist/codebuddy/providers/provider-chatgpt-responses.js +1 -0
- package/dist/codebuddy/providers/provider-gemini-native.js +1 -1
- package/dist/codebuddy/providers/provider-openai-compat.d.ts +5 -0
- package/dist/codebuddy/providers/provider-openai-compat.js +82 -2
- package/dist/codebuddy/tool-definitions/computer-control-tools.js +32 -2
- package/dist/codebuddy/tool-definitions/core-tools.js +3 -3
- package/dist/codebuddy/tool-definitions/index.d.ts +2 -1
- package/dist/codebuddy/tool-definitions/index.js +2 -1
- package/dist/codebuddy/tool-definitions/multimodal-tools.d.ts +1 -0
- package/dist/codebuddy/tool-definitions/multimodal-tools.js +44 -1
- package/dist/codebuddy/tool-definitions/windows-tools.d.ts +2 -0
- package/dist/codebuddy/tool-definitions/windows-tools.js +34 -0
- package/dist/codebuddy/tools.d.ts +1 -1
- package/dist/codebuddy/tools.js +27 -24
- package/dist/commands/cli/hermes-commands.js +108 -0
- package/dist/commands/cli/native-engine-commands.js +102 -3
- package/dist/commands/cli/utility-commands.js +45 -0
- package/dist/commands/enhanced-command-handler.js +1 -1
- package/dist/commands/goal-cli.d.ts +30 -0
- package/dist/commands/goal-cli.js +210 -27
- package/dist/commands/handlers/goal-handler.d.ts +9 -2
- package/dist/commands/handlers/goal-handler.js +36 -9
- package/dist/commands/handlers/infra-handlers.js +36 -0
- package/dist/commands/handlers/memory-handlers.js +96 -1
- package/dist/commands/headless-slash.d.ts +2 -0
- package/dist/commands/headless-slash.js +12 -0
- package/dist/commands/llm-provider-resolution.d.ts +5 -3
- package/dist/commands/llm-provider-resolution.js +87 -33
- package/dist/commands/ollama.d.ts +25 -0
- package/dist/commands/ollama.js +100 -0
- package/dist/commands/provider.d.ts +5 -0
- package/dist/commands/provider.js +106 -55
- package/dist/commands/spec-next.js +2 -1
- package/dist/commands/spec-plan.js +5 -16
- package/dist/commands/tunnel.d.ts +2 -0
- package/dist/commands/tunnel.js +48 -0
- package/dist/config/config-resolver.d.ts +2 -1
- package/dist/config/config-resolver.js +54 -41
- package/dist/config/constants.d.ts +28 -0
- package/dist/config/constants.js +7 -0
- package/dist/config/env-schema.js +756 -0
- package/dist/config/model-tools.js +4 -4
- package/dist/config/toml-config.d.ts +16 -0
- package/dist/config/toml-config.js +3 -0
- package/dist/context/context-manager-v2.js +1 -0
- package/dist/daemon/autonomous-daemon.d.ts +1 -1
- package/dist/daemon/autonomous-daemon.js +3 -3
- package/dist/daemon/autonomous-loop.js +11 -2
- package/dist/daemon/colab-goal.js +9 -1
- package/dist/daemon/cron-agent-bridge.d.ts +12 -3
- package/dist/daemon/cron-agent-bridge.js +25 -9
- package/dist/desktop/codebuddy-engine-adapter.d.ts +32 -0
- package/dist/desktop/codebuddy-engine-adapter.js +257 -80
- package/dist/desktop/engine-adapter.d.ts +14 -0
- package/dist/desktop-automation/automation-manager.js +16 -0
- package/dist/desktop-automation/omniparser-runner.d.ts +63 -0
- package/dist/desktop-automation/omniparser-runner.js +115 -0
- package/dist/desktop-automation/smart-snapshot.d.ts +11 -0
- package/dist/desktop-automation/smart-snapshot.js +72 -5
- package/dist/doctor/index.js +40 -23
- package/dist/events/types.d.ts +11 -0
- package/dist/fleet/colab-store.js +14 -2
- package/dist/fleet/peer-session-bridge.js +50 -12
- package/dist/fleet/peer-tool-bridge.js +14 -0
- package/dist/goals/goal-decomposer.d.ts +27 -0
- package/dist/goals/goal-decomposer.js +293 -0
- package/dist/goals/goal-judge-client.d.ts +15 -0
- package/dist/goals/goal-judge-client.js +45 -0
- package/dist/goals/goal-judge.d.ts +2 -0
- package/dist/goals/goal-judge.js +35 -6
- package/dist/goals/goal-loop.d.ts +14 -0
- package/dist/goals/goal-loop.js +47 -2
- package/dist/goals/goal-manager.d.ts +6 -0
- package/dist/goals/goal-manager.js +67 -14
- package/dist/goals/goal-state.d.ts +13 -0
- package/dist/goals/goal-state.js +83 -13
- package/dist/goals/goal-store.d.ts +3 -0
- package/dist/goals/goal-store.js +31 -15
- package/dist/hooks/user-hooks.js +17 -3
- package/dist/index.js +464 -25
- package/dist/input/text-to-speech.d.ts +2 -6
- package/dist/input/text-to-speech.js +2 -27
- package/dist/integrations/screenpipe/screenpipe-client.d.ts +10 -0
- package/dist/integrations/screenpipe/screenpipe-client.js +12 -2
- package/dist/integrations/tailscale.d.ts +13 -0
- package/dist/integrations/tailscale.js +87 -34
- package/dist/knowledge/workspace-indexer.js +53 -9
- package/dist/mcp/client.js +1 -0
- package/dist/mcp/mcp-desktop-tools.d.ts +23 -0
- package/dist/mcp/mcp-desktop-tools.js +158 -0
- package/dist/mcp/mcp-server.js +2 -0
- package/dist/memory/enhanced-memory.d.ts +10 -0
- package/dist/memory/enhanced-memory.js +33 -2
- package/dist/memory/index.d.ts +3 -1
- package/dist/memory/index.js +4 -1
- package/dist/memory/memory-auto-proposer.d.ts +23 -0
- package/dist/memory/memory-auto-proposer.js +308 -0
- package/dist/memory/memory-candidate-queue.d.ts +92 -0
- package/dist/memory/memory-candidate-queue.js +261 -0
- package/dist/memory/persistent-memory.d.ts +45 -2
- package/dist/memory/persistent-memory.js +236 -40
- package/dist/ml/bayesian-qualifier.d.ts +1 -1
- package/dist/ml/bayesian-qualifier.js +35 -2
- package/dist/openclaw/gateway-bridge.js +5 -0
- package/dist/plugins/marketplace.d.ts +1 -0
- package/dist/plugins/marketplace.js +7 -0
- package/dist/prompts/execution-discipline.d.ts +14 -0
- package/dist/prompts/execution-discipline.js +29 -0
- package/dist/prompts/variation-injector.js +9 -2
- package/dist/protocols/acp/acp-agentic-runner.d.ts +7 -6
- package/dist/protocols/acp/acp-agentic-runner.js +115 -18
- package/dist/protocols/acp/acp-session-store.d.ts +23 -0
- package/dist/protocols/acp/acp-session-store.js +77 -0
- package/dist/protocols/acp/acp-stdio-server.d.ts +7 -0
- package/dist/protocols/acp/acp-stdio-server.js +71 -16
- package/dist/providers/active-llm-registry.d.ts +37 -0
- package/dist/providers/active-llm-registry.js +186 -0
- package/dist/providers/auxiliary-provider.d.ts +25 -0
- package/dist/providers/auxiliary-provider.js +192 -0
- package/dist/providers/codex-oauth.d.ts +1 -1
- package/dist/providers/codex-oauth.js +27 -4
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +4 -0
- package/dist/providers/provider-catalog.d.ts +70 -0
- package/dist/providers/provider-catalog.js +738 -0
- package/dist/providers/provider-fallback.d.ts +35 -0
- package/dist/providers/provider-fallback.js +171 -0
- package/dist/providers/xai-oauth.d.ts +128 -0
- package/dist/providers/xai-oauth.js +735 -0
- package/dist/scheduler/cron-scheduler.d.ts +15 -3
- package/dist/scheduler/cron-scheduler.js +53 -7
- package/dist/scheduler/script-runner.d.ts +2 -0
- package/dist/scheduler/script-runner.js +19 -4
- package/dist/scheduler/watchdog-handlers.js +7 -20
- package/dist/search/usearch-index.js +7 -2
- package/dist/security/tool-policy/tool-groups.js +2 -0
- package/dist/server/index.js +17 -2
- package/dist/server/routes/mobile.d.ts +12 -4
- package/dist/server/routes/mobile.js +116 -1
- package/dist/server/tls-config.d.ts +35 -0
- package/dist/server/tls-config.js +142 -0
- package/dist/server/tunnel-manager.d.ts +20 -0
- package/dist/server/tunnel-manager.js +58 -0
- package/dist/server/websocket/fleet-bridge.js +5 -0
- package/dist/services/prompt-builder.d.ts +1 -0
- package/dist/services/prompt-builder.js +49 -8
- package/dist/shared/engine-types.d.ts +15 -1
- package/dist/sidecar/sidecar-bridge.d.ts +1 -0
- package/dist/sidecar/sidecar-bridge.js +21 -10
- package/dist/spec/spec-store.js +8 -1
- package/dist/talk-mode/providers/audioreader-tts.d.ts +1 -1
- package/dist/talk-mode/providers/audioreader-tts.js +8 -8
- package/dist/templates/project-scaffolding.js +3 -2
- package/dist/themes/theme-schema.d.ts +10 -10
- package/dist/tools/application-profiles.js +38 -0
- package/dist/tools/bash/bash-tool.d.ts +1 -0
- package/dist/tools/bash/bash-tool.js +16 -2
- package/dist/tools/bash/command-validator.js +3 -0
- package/dist/tools/bash/rtk-rewrite.d.ts +16 -0
- package/dist/tools/bash/rtk-rewrite.js +100 -0
- package/dist/tools/bash/streaming-executor.js +14 -1
- package/dist/tools/computer-control-tool.d.ts +16 -1
- package/dist/tools/computer-control-tool.js +317 -5
- package/dist/tools/document-generator.d.ts +14 -0
- package/dist/tools/document-generator.js +79 -0
- package/dist/tools/execute-code-rpc-invoker.d.ts +26 -2
- package/dist/tools/execute-code-rpc-invoker.js +46 -5
- package/dist/tools/metadata.js +28 -0
- package/dist/tools/office-macro-tool.d.ts +10 -0
- package/dist/tools/office-macro-tool.js +93 -0
- package/dist/tools/registry/index.d.ts +2 -1
- package/dist/tools/registry/index.js +2 -1
- package/dist/tools/registry/memory-tools.d.ts +20 -0
- package/dist/tools/registry/memory-tools.js +225 -3
- package/dist/tools/registry/multimodal-tools.js +2 -2
- package/dist/tools/registry/vision-tools.d.ts +33 -0
- package/dist/tools/registry/vision-tools.js +308 -6
- package/dist/tools/registry/windows-tools.d.ts +2 -0
- package/dist/tools/registry/windows-tools.js +47 -0
- package/dist/tools/route-peer-tool.js +14 -0
- package/dist/tools/screenshot-tool.js +14 -2
- package/dist/tools/text-to-speech-tool.d.ts +1 -1
- package/dist/tools/text-to-speech-tool.js +2 -12
- package/dist/tools/tool-selector.js +3 -59
- package/dist/utils/config-validation/schema.d.ts +40 -7
- package/dist/utils/config-validation/schema.js +130 -1
- package/dist/utils/cost-tracker.js +21 -1
- package/dist/utils/disk-guard.d.ts +180 -0
- package/dist/utils/disk-guard.js +404 -0
- package/dist/utils/interactive-setup.js +35 -2
- package/dist/utils/model-utils.js +11 -2
- package/dist/utils/output-sanitizer.js +11 -0
- package/dist/utils/provider-detector.d.ts +8 -7
- package/dist/utils/provider-detector.js +19 -77
- package/dist/utils/settings-manager.d.ts +7 -0
- package/dist/utils/token-display.d.ts +3 -3
- package/dist/utils/token-display.js +22 -4
- package/dist/wizard/onboarding.d.ts +39 -0
- package/dist/wizard/onboarding.js +433 -21
- package/dist/wizard/provider-onboarding.d.ts +8 -23
- package/dist/wizard/provider-onboarding.js +39 -158
- package/package.json +4 -2
- package/dist/plugins/provider-onboarding.d.ts +0 -23
- package/dist/plugins/provider-onboarding.js +0 -116
- package/dist/utils/kokoro-tts.d.ts +0 -8
- package/dist/utils/kokoro-tts.js +0 -67
|
@@ -67,6 +67,33 @@ export class ExtendedThinkingManager {
|
|
|
67
67
|
this.alwaysEnabled = value;
|
|
68
68
|
logger.info(`Extended thinking always-enabled: ${value}`);
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Apply a UI/settings thinking level — `off | minimal | low | medium | high | xhigh`.
|
|
72
|
+
* `off` (or any unknown level) disables thinking; any other level enables it with a
|
|
73
|
+
* scaled token budget. This is the runtime entry point for hot-swapping the level from
|
|
74
|
+
* the Cowork ReasoningLevelPicker; the OpenAI-compat / Grok / Ollama providers read
|
|
75
|
+
* {@link getThinkingConfig} fresh per request, so the change takes effect next turn.
|
|
76
|
+
*/
|
|
77
|
+
applyThinkingLevel(level) {
|
|
78
|
+
const budgets = {
|
|
79
|
+
minimal: 1024,
|
|
80
|
+
low: 2048,
|
|
81
|
+
medium: 4096,
|
|
82
|
+
high: 8192,
|
|
83
|
+
xhigh: 16384,
|
|
84
|
+
};
|
|
85
|
+
const budget = budgets[level];
|
|
86
|
+
if (budget === undefined) {
|
|
87
|
+
this.enabled = false;
|
|
88
|
+
this.alwaysEnabled = false;
|
|
89
|
+
logger.info(`Extended thinking disabled (level=${level})`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.maxThinkingTokens = budget;
|
|
93
|
+
this.enabled = false; // the configured level drives state via alwaysEnabled
|
|
94
|
+
this.alwaysEnabled = true;
|
|
95
|
+
logger.info(`Extended thinking level=${level} (budget: ${budget} tokens)`);
|
|
96
|
+
}
|
|
70
97
|
/**
|
|
71
98
|
* Get the thinking configuration to merge into API request parameters.
|
|
72
99
|
* Returns an object with a `thinking` key when enabled, or an empty object when disabled.
|
|
@@ -10,6 +10,8 @@ import { spawnSync } from 'child_process';
|
|
|
10
10
|
import { mkdir, mkdtemp, stat } from 'fs/promises';
|
|
11
11
|
import { tmpdir } from 'os';
|
|
12
12
|
import { isAbsolute, join, resolve } from 'path';
|
|
13
|
+
import { executeBrowserUseAction } from '../browser-automation/browser-use-runner.js';
|
|
14
|
+
import { closeCamofox, launchCamofox } from '../browser-automation/camofox-runner.js';
|
|
13
15
|
const require = createRequire(import.meta.url);
|
|
14
16
|
function presentEnvKeys(env, keys) {
|
|
15
17
|
return keys.filter((key) => Boolean(env[key]?.trim()));
|
|
@@ -143,15 +145,17 @@ function browserUseBackend(env) {
|
|
|
143
145
|
label: 'Browser Use gateway',
|
|
144
146
|
officialSurface: 'Browser Use managed browser mode',
|
|
145
147
|
status: configured ? 'configured' : 'missing',
|
|
146
|
-
installed:
|
|
148
|
+
installed: true,
|
|
147
149
|
configured,
|
|
148
|
-
runnable:
|
|
150
|
+
runnable: configured,
|
|
149
151
|
command: null,
|
|
150
152
|
version: null,
|
|
151
153
|
credentialSources,
|
|
152
|
-
smokeCommand: null,
|
|
153
|
-
notes: ['
|
|
154
|
-
remediation:
|
|
154
|
+
smokeCommand: configured ? 'buddy hermes browser-smoke browser-use --json' : null,
|
|
155
|
+
notes: ['Browser Use runner routes actions through the Browser Use API or Nous Tool Gateway (src/browser-automation/browser-use-runner.ts).'],
|
|
156
|
+
remediation: configured
|
|
157
|
+
? []
|
|
158
|
+
: ['Set BROWSER_USE_API_KEY or CODEBUDDY_NOUS_TOOL_GATEWAY_URL to enable the Browser Use backend.'],
|
|
155
159
|
};
|
|
156
160
|
}
|
|
157
161
|
function firecrawlBackend(env) {
|
|
@@ -184,13 +188,13 @@ function camofoxBackend(env) {
|
|
|
184
188
|
status: installed ? 'available' : 'missing',
|
|
185
189
|
installed,
|
|
186
190
|
configured: installed,
|
|
187
|
-
runnable:
|
|
191
|
+
runnable: installed,
|
|
188
192
|
command: installed ? (camofox.ok ? 'camofox' : 'camoufox') : null,
|
|
189
193
|
version: installed ? firstLine(camoufox.output) : null,
|
|
190
194
|
credentialSources: [],
|
|
191
|
-
smokeCommand: null,
|
|
192
|
-
notes: ['
|
|
193
|
-
remediation: installed ? [
|
|
195
|
+
smokeCommand: installed ? 'buddy hermes browser-smoke camofox --json' : null,
|
|
196
|
+
notes: ['Camofox runner launches the anti-detect Firefox Playwright server and connects via firefox.connect() (src/browser-automation/camofox-runner.ts).'],
|
|
197
|
+
remediation: installed ? [] : ['Install Camofox/Camoufox only if this backend is required.'],
|
|
194
198
|
};
|
|
195
199
|
}
|
|
196
200
|
function recordingBackend() {
|
|
@@ -271,13 +275,13 @@ function browserRouteGateReason(backend) {
|
|
|
271
275
|
return 'Browserbase is configured but excluded from auto browser routing; use the explicit smoke runner for managed sessions.';
|
|
272
276
|
}
|
|
273
277
|
if (backend.id === 'browser-use' && backend.configured) {
|
|
274
|
-
return
|
|
278
|
+
return null; // Browser Use runner is wired — eligible for auto-routing.
|
|
275
279
|
}
|
|
276
280
|
if (backend.id === 'firecrawl' && backend.configured) {
|
|
277
281
|
return 'Firecrawl is configured but excluded from auto browser routing because it is an extraction backend, not an interactive browser session.';
|
|
278
282
|
}
|
|
279
283
|
if (backend.id === 'camofox' && backend.installed) {
|
|
280
|
-
return
|
|
284
|
+
return null; // Camofox runner is wired — eligible for auto-routing.
|
|
281
285
|
}
|
|
282
286
|
return null;
|
|
283
287
|
}
|
|
@@ -538,6 +542,136 @@ async function runBrowserbaseSmoke(now, env) {
|
|
|
538
542
|
}
|
|
539
543
|
}
|
|
540
544
|
}
|
|
545
|
+
async function runBrowserUseSmoke(now, env) {
|
|
546
|
+
const started = now();
|
|
547
|
+
const startedAtMs = Date.now();
|
|
548
|
+
const apiKey = env.BROWSER_USE_API_KEY?.trim();
|
|
549
|
+
const gatewayUrl = env.CODEBUDDY_NOUS_TOOL_GATEWAY_URL?.trim();
|
|
550
|
+
if (!apiKey && !gatewayUrl) {
|
|
551
|
+
return {
|
|
552
|
+
backendId: 'browser-use',
|
|
553
|
+
command: null,
|
|
554
|
+
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
555
|
+
finishedAt: now().toISOString(),
|
|
556
|
+
label: 'Browser Use gateway',
|
|
557
|
+
ok: false,
|
|
558
|
+
output: 'BROWSER_USE_API_KEY or CODEBUDDY_NOUS_TOOL_GATEWAY_URL is required for browser-use smoke.',
|
|
559
|
+
startedAt: started.toISOString(),
|
|
560
|
+
status: 'not-runnable',
|
|
561
|
+
stdout: '',
|
|
562
|
+
stderr: 'BROWSER_USE_API_KEY or CODEBUDDY_NOUS_TOOL_GATEWAY_URL is required for browser-use smoke.',
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
const result = await executeBrowserUseAction('Open the page and report the title or main heading.', 'https://example.com', {
|
|
566
|
+
apiKey,
|
|
567
|
+
gatewayUrl,
|
|
568
|
+
timeout: 60_000,
|
|
569
|
+
});
|
|
570
|
+
const output = result.content ?? (result.screenshot ? 'Browser Use returned screenshot data.' : '');
|
|
571
|
+
return {
|
|
572
|
+
backendId: 'browser-use',
|
|
573
|
+
command: null,
|
|
574
|
+
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
575
|
+
finishedAt: now().toISOString(),
|
|
576
|
+
label: 'Browser Use gateway',
|
|
577
|
+
ok: result.ok,
|
|
578
|
+
output: result.ok ? output : result.error ?? 'Browser Use smoke failed.',
|
|
579
|
+
startedAt: started.toISOString(),
|
|
580
|
+
status: result.ok ? 'passed' : 'failed',
|
|
581
|
+
stdout: result.ok ? output : '',
|
|
582
|
+
stderr: result.ok ? '' : result.error ?? 'Browser Use smoke failed.',
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
async function runCamofoxSmoke(now, env) {
|
|
586
|
+
const started = now();
|
|
587
|
+
const startedAtMs = Date.now();
|
|
588
|
+
const binaryPath = env.CODEBUDDY_CAMOFOX_BINARY?.trim() || undefined;
|
|
589
|
+
const pythonPath = env.CODEBUDDY_CAMOFOX_PYTHON?.trim() || undefined;
|
|
590
|
+
// Camoufox is Firefox: launch its Playwright server and connect via
|
|
591
|
+
// firefox.connect() — NOT chromium.connectOverCDP(). The launch step returns
|
|
592
|
+
// a Playwright-server wsEndpoint; the connect below proves the repo's pinned
|
|
593
|
+
// Playwright can actually drive it (this is where the version-lock, if any,
|
|
594
|
+
// surfaces honestly rather than being faked as success on the endpoint alone).
|
|
595
|
+
const result = await launchCamofox({
|
|
596
|
+
binaryPath,
|
|
597
|
+
pythonPath,
|
|
598
|
+
headless: true,
|
|
599
|
+
timeout: 30_000,
|
|
600
|
+
});
|
|
601
|
+
if (!result.ok) {
|
|
602
|
+
const message = result.error ?? 'Camofox smoke failed.';
|
|
603
|
+
return {
|
|
604
|
+
backendId: 'camofox',
|
|
605
|
+
command: binaryPath ?? pythonPath ?? null,
|
|
606
|
+
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
607
|
+
finishedAt: now().toISOString(),
|
|
608
|
+
label: 'Camofox / Camoufox',
|
|
609
|
+
ok: false,
|
|
610
|
+
output: message,
|
|
611
|
+
startedAt: started.toISOString(),
|
|
612
|
+
status: /not (found|importable)|No module named/i.test(message) ? 'not-runnable' : 'failed',
|
|
613
|
+
stdout: '',
|
|
614
|
+
stderr: message,
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
const wsEndpoint = result.wsEndpoint;
|
|
618
|
+
let browser = null;
|
|
619
|
+
let context = null;
|
|
620
|
+
try {
|
|
621
|
+
const playwright = await import('playwright');
|
|
622
|
+
browser = await playwright.firefox.connect(wsEndpoint);
|
|
623
|
+
context = await browser.newContext();
|
|
624
|
+
const page = await context.newPage();
|
|
625
|
+
await page.goto('data:text/html,<title>OK-HERMES-CAMOFOX</title><h1>OK-HERMES-CAMOFOX</h1>', {
|
|
626
|
+
waitUntil: 'domcontentloaded',
|
|
627
|
+
});
|
|
628
|
+
const title = await page.title();
|
|
629
|
+
const heading = await page.locator('h1').textContent();
|
|
630
|
+
const ok = title === 'OK-HERMES-CAMOFOX' && heading === 'OK-HERMES-CAMOFOX';
|
|
631
|
+
const output = `title=${title}; heading=${heading ?? ''}; pid=${result.pid ?? 'unknown'}`;
|
|
632
|
+
return {
|
|
633
|
+
backendId: 'camofox',
|
|
634
|
+
command: binaryPath ?? pythonPath ?? null,
|
|
635
|
+
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
636
|
+
finishedAt: now().toISOString(),
|
|
637
|
+
label: 'Camofox / Camoufox',
|
|
638
|
+
ok,
|
|
639
|
+
output,
|
|
640
|
+
startedAt: started.toISOString(),
|
|
641
|
+
status: ok ? 'passed' : 'failed',
|
|
642
|
+
stdout: ok ? output : '',
|
|
643
|
+
stderr: ok ? '' : 'Unexpected Camofox page content.',
|
|
644
|
+
// Never expose the host:port wsEndpoint in the result.
|
|
645
|
+
session: { url: 'camoufox-firefox-server' },
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
catch (error) {
|
|
649
|
+
// A Playwright version-guard mismatch (server driver vs repo client) lands
|
|
650
|
+
// here. Report it honestly as a failure with the connect error message —
|
|
651
|
+
// do not fall back to a fake success.
|
|
652
|
+
const message = errorMessage(error);
|
|
653
|
+
return {
|
|
654
|
+
backendId: 'camofox',
|
|
655
|
+
command: binaryPath ?? pythonPath ?? null,
|
|
656
|
+
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
657
|
+
finishedAt: now().toISOString(),
|
|
658
|
+
label: 'Camofox / Camoufox',
|
|
659
|
+
ok: false,
|
|
660
|
+
output: message,
|
|
661
|
+
startedAt: started.toISOString(),
|
|
662
|
+
status: 'failed',
|
|
663
|
+
stdout: '',
|
|
664
|
+
stderr: message,
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
finally {
|
|
668
|
+
await context?.close().catch(() => undefined);
|
|
669
|
+
await browser?.close().catch(() => undefined);
|
|
670
|
+
if (result.pid) {
|
|
671
|
+
await closeCamofox(result.pid).catch(() => undefined);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
541
675
|
async function runLocalPlaywrightSmoke(now, options = {}) {
|
|
542
676
|
const started = now();
|
|
543
677
|
const startedAtMs = Date.now();
|
|
@@ -700,6 +834,12 @@ export async function runHermesBrowserBackendSmoke(options) {
|
|
|
700
834
|
if (backend.id === 'browserbase') {
|
|
701
835
|
return runBrowserbaseSmoke(now, env);
|
|
702
836
|
}
|
|
837
|
+
if (backend.id === 'browser-use') {
|
|
838
|
+
return runBrowserUseSmoke(now, env);
|
|
839
|
+
}
|
|
840
|
+
if (backend.id === 'camofox') {
|
|
841
|
+
return runCamofoxSmoke(now, env);
|
|
842
|
+
}
|
|
703
843
|
if (!backend.runnable) {
|
|
704
844
|
return blockedSmokeResult(backend.id, 'not-runnable', `${backend.label} is not runnable on this host.`, {
|
|
705
845
|
backend,
|
|
@@ -100,6 +100,65 @@ export interface ClawAgentBehaviorSettings {
|
|
|
100
100
|
* are mapped; everything else stays archived for manual review.
|
|
101
101
|
*/
|
|
102
102
|
export declare function mapClawAgentBehavior(cfg: Record<string, unknown>): ClawAgentBehaviorSettings;
|
|
103
|
+
/**
|
|
104
|
+
* Cron job entry as translated from an OpenClaw `cronJobs` array element into
|
|
105
|
+
* the shape consumed by CronScheduler.addJob().
|
|
106
|
+
*/
|
|
107
|
+
export interface ClawCronJobEntry {
|
|
108
|
+
name: string;
|
|
109
|
+
schedule: string;
|
|
110
|
+
task: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Map OpenClaw cron config to a list of CronJob-compatible entries.
|
|
114
|
+
*
|
|
115
|
+
* OpenClaw stores cron jobs as an array of `{ schedule, task, label? }` objects
|
|
116
|
+
* or — in 2026.6.x — under `scheduler.jobs`. Only entries with both a valid
|
|
117
|
+
* 5-field cron expression and a non-empty task string are mapped. Everything
|
|
118
|
+
* else is silently dropped (will remain in the archived raw slice if one
|
|
119
|
+
* exists).
|
|
120
|
+
*/
|
|
121
|
+
export declare function mapClawCronJobs(cfg: Record<string, unknown>): ClawCronJobEntry[];
|
|
122
|
+
/**
|
|
123
|
+
* Map OpenClaw command allowlist into a flat string array of allowed command
|
|
124
|
+
* basenames / patterns, consumable by Code Buddy's command validator.
|
|
125
|
+
*
|
|
126
|
+
* OpenClaw stores these as a flat string array under `commandAllowlist`,
|
|
127
|
+
* `allowlist`, or `allowedCommands`. Items that look like credentials or paths
|
|
128
|
+
* outside of simple command names are filtered out.
|
|
129
|
+
*/
|
|
130
|
+
export declare function mapClawCommandAllowlist(cfg: Record<string, unknown>): string[];
|
|
131
|
+
/**
|
|
132
|
+
* Map OpenClaw memory backend config to a Code Buddy memory provider name.
|
|
133
|
+
*
|
|
134
|
+
* Only well-known provider names are accepted; unknown strings are left
|
|
135
|
+
* unmapped (will stay in the archive). Credentials (API keys, URLs) in the
|
|
136
|
+
* memory backend config are never imported.
|
|
137
|
+
*/
|
|
138
|
+
export declare function mapClawMemoryBackend(cfg: Record<string, unknown>): string | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Map OpenClaw exec timeout to a numeric millisecond value for Code Buddy's
|
|
141
|
+
* `execTimeout` setting.
|
|
142
|
+
*
|
|
143
|
+
* OpenClaw stores this as seconds (integer) or milliseconds (large integer).
|
|
144
|
+
* Values ≤ 0 are ignored. Values that look like seconds (≤ 3600) are
|
|
145
|
+
* multiplied by 1000. Clamped to a maximum of 3600000 ms (1 hour).
|
|
146
|
+
*/
|
|
147
|
+
export declare function mapClawExecTimeout(cfg: Record<string, unknown>): number | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Vision config fields that Code Buddy consumes.
|
|
150
|
+
*/
|
|
151
|
+
export interface ClawVisionSettings {
|
|
152
|
+
visionEnabled?: boolean;
|
|
153
|
+
visionModel?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Map OpenClaw vision settings to Code Buddy's vision config keys.
|
|
157
|
+
*
|
|
158
|
+
* Only the `enabled` boolean and `model` string are imported. Provider
|
|
159
|
+
* credentials, endpoint URLs, and other complex fields are left archived.
|
|
160
|
+
*/
|
|
161
|
+
export declare function mapClawVisionSettings(cfg: Record<string, unknown>): ClawVisionSettings;
|
|
103
162
|
/** Build the migration plan (read-only; no writes). */
|
|
104
163
|
export declare function buildClawMigrationPlan(opts?: ClawMigrationOptions): ClawMigrationEntry[];
|
|
105
164
|
/**
|