@phuetz/code-buddy 1.1.0 → 1.3.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 +211 -163
- package/dist/agent/autonomous/agentic-coding-contract.d.ts +12 -12
- package/dist/agent/base-agent.d.ts +4 -0
- package/dist/agent/base-agent.js +6 -0
- 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/facades/infrastructure-facade.d.ts +9 -2
- package/dist/agent/facades/infrastructure-facade.js +15 -6
- 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/self-improvement/authored-artifact-gate.d.ts +18 -0
- package/dist/agent/self-improvement/authored-artifact-gate.js +42 -0
- package/dist/agent/self-improvement/authored-tool-runtime.d.ts +27 -0
- package/dist/agent/self-improvement/authored-tool-runtime.js +57 -0
- package/dist/agent/self-improvement/authored-tool-store.d.ts +24 -0
- package/dist/agent/self-improvement/authored-tool-store.js +57 -0
- package/dist/agent/self-improvement/llm-tool-proposer.d.ts +41 -0
- package/dist/agent/self-improvement/llm-tool-proposer.js +136 -0
- package/dist/agent/self-improvement/sandbox-scorer.d.ts +17 -0
- package/dist/agent/self-improvement/sandbox-scorer.js +43 -0
- package/dist/agent/self-improvement/self-knowledge.d.ts +8 -0
- package/dist/agent/self-improvement/self-knowledge.js +24 -0
- package/dist/agent/self-improvement/skill-benchmark.d.ts +9 -0
- package/dist/agent/self-improvement/skill-benchmark.js +22 -0
- package/dist/agent/self-improvement/skill-consolidator.d.ts +71 -0
- package/dist/agent/self-improvement/skill-consolidator.js +137 -0
- package/dist/agent/self-improvement/skill-engine.d.ts +42 -0
- package/dist/agent/self-improvement/skill-engine.js +87 -0
- package/dist/agent/self-improvement/skill-gate.d.ts +19 -0
- package/dist/agent/self-improvement/skill-gate.js +62 -0
- package/dist/agent/self-improvement/skill-mutator.d.ts +74 -0
- package/dist/agent/self-improvement/skill-mutator.js +223 -0
- package/dist/agent/self-improvement/skill-proposer.d.ts +40 -0
- package/dist/agent/self-improvement/skill-proposer.js +82 -0
- package/dist/agent/self-improvement/skill-types.d.ts +41 -0
- package/dist/agent/self-improvement/skill-types.js +13 -0
- package/dist/agent/self-improvement/tool-benchmark.d.ts +10 -0
- package/dist/agent/self-improvement/tool-benchmark.js +37 -0
- package/dist/agent/self-improvement/tool-engine.d.ts +54 -0
- package/dist/agent/self-improvement/tool-engine.js +101 -0
- package/dist/agent/self-improvement/tool-gate.d.ts +20 -0
- package/dist/agent/self-improvement/tool-gate.js +78 -0
- package/dist/agent/self-improvement/tool-proposer.d.ts +31 -0
- package/dist/agent/self-improvement/tool-proposer.js +34 -0
- package/dist/agent/self-improvement/tool-skill-mutator.d.ts +40 -0
- package/dist/agent/self-improvement/tool-skill-mutator.js +79 -0
- package/dist/agent/self-improvement/tool-types.d.ts +48 -0
- package/dist/agent/self-improvement/tool-types.js +9 -0
- package/dist/agent/self-improvement/types.d.ts +3 -1
- 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 +133 -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 +7 -1
- 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 +8 -1
- package/dist/codebuddy/tools.js +67 -24
- package/dist/commands/cli/hermes-commands.js +108 -0
- package/dist/commands/cli/improve-command.js +123 -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 +2 -2
- 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/handlers/missing-handlers.d.ts +1 -1
- package/dist/commands/handlers/missing-handlers.js +26 -3
- 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/skills-cli/index.js +123 -0
- package/dist/commands/slash/builtin-commands.js +1 -1
- 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/companion/percepts.js +11 -1
- 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/bootstrap-loader.js +6 -23
- package/dist/context/context-manager-v2.js +1 -0
- package/dist/context/import-directive-parser.d.ts +4 -0
- package/dist/context/import-directive-parser.js +51 -6
- package/dist/context/instruction-excludes.d.ts +30 -1
- package/dist/context/instruction-excludes.js +71 -1
- package/dist/context/jit-context.d.ts +8 -10
- package/dist/context/jit-context.js +28 -106
- package/dist/context/project-context.d.ts +90 -0
- package/dist/context/project-context.js +295 -0
- package/dist/daemon/autonomous-daemon.d.ts +1 -1
- package/dist/daemon/autonomous-daemon.js +3 -3
- package/dist/daemon/autonomous-loop.d.ts +31 -1
- package/dist/daemon/autonomous-loop.js +91 -4
- 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/harness/contract.d.ts +28 -28
- package/dist/hooks/user-hooks.js +17 -3
- package/dist/identity/identity-manager.js +3 -2
- package/dist/index.js +481 -26
- 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-resources.js +2 -3
- 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/sensory/dreaming.d.ts +45 -0
- package/dist/sensory/dreaming.js +114 -0
- package/dist/sensory/heartbeat-scheduler.d.ts +38 -0
- package/dist/sensory/heartbeat-scheduler.js +72 -0
- package/dist/sensory/reactions.d.ts +24 -0
- package/dist/sensory/reactions.js +31 -0
- package/dist/sensory/screen-reaction.d.ts +23 -0
- package/dist/sensory/screen-reaction.js +59 -0
- package/dist/sensory/sensory-bridge.d.ts +23 -0
- package/dist/sensory/sensory-bridge.js +85 -0
- package/dist/sensory/sensory-memory.d.ts +20 -0
- package/dist/sensory/sensory-memory.js +39 -0
- package/dist/sensory/speech-reaction.d.ts +21 -0
- package/dist/sensory/speech-reaction.js +83 -0
- package/dist/sensory/vision-reaction.d.ts +31 -0
- package/dist/sensory/vision-reaction.js +74 -0
- package/dist/server/index.js +106 -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 +11 -0
- package/dist/services/prompt-builder.js +124 -17
- 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/skills/parser.js +3 -0
- package/dist/skills/skill-importer.d.ts +58 -0
- package/dist/skills/skill-importer.js +261 -0
- package/dist/skills/skill-sources.d.ts +20 -0
- package/dist/skills/skill-sources.js +102 -0
- package/dist/skills/types.d.ts +6 -0
- 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/register-tool-handler.d.ts +25 -0
- package/dist/tools/register-tool-handler.js +100 -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/registry.d.ts +6 -0
- package/dist/tools/registry.js +8 -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/init-project.d.ts +7 -0
- package/dist/utils/init-project.js +37 -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 +19 -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
|
@@ -161,6 +161,11 @@ interface BuildRequestBodyOpts {
|
|
|
161
161
|
input: ResponsesInputItem[];
|
|
162
162
|
tools: CodeBuddyTool[];
|
|
163
163
|
reasoningEffort?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Accepted for Provider interface parity, but deliberately not serialized:
|
|
166
|
+
* the ChatGPT Codex backend rejects `max_output_tokens` with 400.
|
|
167
|
+
*/
|
|
168
|
+
maxTokens?: number;
|
|
164
169
|
promptCacheKey?: string;
|
|
165
170
|
/** When true, ask the backend to emit encrypted reasoning blobs so we
|
|
166
171
|
* can re-inject them next turn (preserves chain-of-thought across
|
|
@@ -164,6 +164,7 @@ export class ChatGptResponsesProvider {
|
|
|
164
164
|
input,
|
|
165
165
|
tools,
|
|
166
166
|
reasoningEffort,
|
|
167
|
+
maxTokens: opts.maxTokens,
|
|
167
168
|
promptCacheKey: this.promptCacheKey,
|
|
168
169
|
// Only ask for encrypted reasoning when reasoning effort is set —
|
|
169
170
|
// saves bandwidth on plain Q&A turns.
|
|
@@ -458,6 +459,11 @@ export async function* parseSseStream(body, model, onReasoningItem, idleTimeoutM
|
|
|
458
459
|
const decoder = new TextDecoder();
|
|
459
460
|
let buffer = '';
|
|
460
461
|
let chunkIndex = 0;
|
|
462
|
+
// Monotonic index per function_call so the downstream message-reducer keeps
|
|
463
|
+
// parallel tool calls in separate slots. Hardcoding 0 made every parallel
|
|
464
|
+
// call merge into one — names/call_ids/arguments concatenated — producing a
|
|
465
|
+
// 100+ char call_id the Responses backend rejects (max 64) on the next turn.
|
|
466
|
+
let functionCallIndex = 0;
|
|
461
467
|
const makeChunk = (delta, finishReason) => ({
|
|
462
468
|
id: `chatcmpl-codex-${chunkIndex++}`,
|
|
463
469
|
object: 'chat.completion.chunk',
|
|
@@ -546,7 +552,7 @@ export async function* parseSseStream(body, model, onReasoningItem, idleTimeoutM
|
|
|
546
552
|
if (item.name && item.call_id) {
|
|
547
553
|
yield makeChunk({
|
|
548
554
|
tool_calls: [{
|
|
549
|
-
index:
|
|
555
|
+
index: functionCallIndex++,
|
|
550
556
|
id: item.call_id,
|
|
551
557
|
type: 'function',
|
|
552
558
|
function: {
|
|
@@ -218,7 +218,7 @@ export class GeminiNativeProvider {
|
|
|
218
218
|
// Build generationConfig with optional thinkingConfig for Gemini 3.x
|
|
219
219
|
const generationConfig = {
|
|
220
220
|
temperature: opts?.temperature ?? 0.7,
|
|
221
|
-
maxOutputTokens: this.defaultMaxTokens,
|
|
221
|
+
maxOutputTokens: opts?.maxTokens ?? this.defaultMaxTokens,
|
|
222
222
|
};
|
|
223
223
|
// Add thinkingLevel for Gemini 3.x models (never mix with budget_tokens)
|
|
224
224
|
// Use explicitly passed level, or fall back to the default from settings
|
|
@@ -57,6 +57,10 @@ export declare class OpenAICompatProvider implements Provider {
|
|
|
57
57
|
* Derive a human-readable provider name from the base URL.
|
|
58
58
|
*/
|
|
59
59
|
getProviderName(): string;
|
|
60
|
+
private getOpenRouterProviderRouting;
|
|
61
|
+
private setListProviderOption;
|
|
62
|
+
private readBooleanEnv;
|
|
63
|
+
private readEnv;
|
|
60
64
|
/**
|
|
61
65
|
* Get prompt cache statistics
|
|
62
66
|
*/
|
|
@@ -84,6 +88,7 @@ export declare class OpenAICompatProvider implements Provider {
|
|
|
84
88
|
private isXaiProvider;
|
|
85
89
|
/** Gate legacy search_parameters by provider compatibility. */
|
|
86
90
|
private shouldIncludeSearchParameters;
|
|
91
|
+
private getOllamaReasoningEffort;
|
|
87
92
|
private isAsyncIterableStream;
|
|
88
93
|
private isNonStreamingChatResponse;
|
|
89
94
|
private nonStreamingResponseToChunks;
|
|
@@ -104,6 +104,61 @@ export class OpenAICompatProvider {
|
|
|
104
104
|
return 'Local';
|
|
105
105
|
return 'API';
|
|
106
106
|
}
|
|
107
|
+
getOpenRouterProviderRouting() {
|
|
108
|
+
if (!this.baseURL.toLowerCase().includes('openrouter.ai'))
|
|
109
|
+
return undefined;
|
|
110
|
+
const provider = {};
|
|
111
|
+
this.setListProviderOption(provider, 'only', 'OPENROUTER_PROVIDER_ONLY', 'CODEBUDDY_OPENROUTER_PROVIDER_ONLY');
|
|
112
|
+
this.setListProviderOption(provider, 'ignore', 'OPENROUTER_PROVIDER_IGNORE', 'CODEBUDDY_OPENROUTER_PROVIDER_IGNORE');
|
|
113
|
+
this.setListProviderOption(provider, 'order', 'OPENROUTER_PROVIDER_ORDER', 'CODEBUDDY_OPENROUTER_PROVIDER_ORDER');
|
|
114
|
+
const sort = this.readEnv('OPENROUTER_PROVIDER_SORT', 'CODEBUDDY_OPENROUTER_PROVIDER_SORT')?.toLowerCase();
|
|
115
|
+
if (sort && ['price', 'throughput', 'latency'].includes(sort)) {
|
|
116
|
+
provider.sort = sort;
|
|
117
|
+
}
|
|
118
|
+
const dataCollection = this.readEnv('OPENROUTER_PROVIDER_DATA_COLLECTION', 'CODEBUDDY_OPENROUTER_PROVIDER_DATA_COLLECTION')?.toLowerCase();
|
|
119
|
+
if (dataCollection && ['allow', 'deny'].includes(dataCollection)) {
|
|
120
|
+
provider.data_collection = dataCollection;
|
|
121
|
+
}
|
|
122
|
+
const requireParameters = this.readBooleanEnv('OPENROUTER_PROVIDER_REQUIRE_PARAMETERS', 'CODEBUDDY_OPENROUTER_PROVIDER_REQUIRE_PARAMETERS');
|
|
123
|
+
if (requireParameters !== undefined) {
|
|
124
|
+
provider.require_parameters = requireParameters;
|
|
125
|
+
}
|
|
126
|
+
const allowFallbacks = this.readBooleanEnv('OPENROUTER_PROVIDER_ALLOW_FALLBACKS', 'CODEBUDDY_OPENROUTER_PROVIDER_ALLOW_FALLBACKS');
|
|
127
|
+
if (allowFallbacks !== undefined) {
|
|
128
|
+
provider.allow_fallbacks = allowFallbacks;
|
|
129
|
+
}
|
|
130
|
+
return Object.keys(provider).length > 0 ? provider : undefined;
|
|
131
|
+
}
|
|
132
|
+
setListProviderOption(provider, field, ...keys) {
|
|
133
|
+
const value = this.readEnv(...keys);
|
|
134
|
+
if (!value)
|
|
135
|
+
return;
|
|
136
|
+
const items = value
|
|
137
|
+
.split(',')
|
|
138
|
+
.map((item) => item.trim())
|
|
139
|
+
.filter(Boolean);
|
|
140
|
+
if (items.length > 0) {
|
|
141
|
+
provider[field] = items;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
readBooleanEnv(...keys) {
|
|
145
|
+
const value = this.readEnv(...keys)?.toLowerCase();
|
|
146
|
+
if (!value)
|
|
147
|
+
return undefined;
|
|
148
|
+
if (['1', 'true', 'yes', 'on'].includes(value))
|
|
149
|
+
return true;
|
|
150
|
+
if (['0', 'false', 'no', 'off'].includes(value))
|
|
151
|
+
return false;
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
readEnv(...keys) {
|
|
155
|
+
for (const key of keys) {
|
|
156
|
+
const value = process.env[key]?.trim();
|
|
157
|
+
if (value)
|
|
158
|
+
return value;
|
|
159
|
+
}
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
107
162
|
/**
|
|
108
163
|
* Get prompt cache statistics
|
|
109
164
|
*/
|
|
@@ -270,6 +325,15 @@ export class OpenAICompatProvider {
|
|
|
270
325
|
}
|
|
271
326
|
return true;
|
|
272
327
|
}
|
|
328
|
+
getOllamaReasoningEffort(model) {
|
|
329
|
+
const modelInfo = getModelInfo(model);
|
|
330
|
+
const isOllama = modelInfo.provider === 'ollama' ||
|
|
331
|
+
this.baseURL.includes('localhost:11434') ||
|
|
332
|
+
this.baseURL.includes('127.0.0.1:11434');
|
|
333
|
+
if (!isOllama)
|
|
334
|
+
return undefined;
|
|
335
|
+
return process.env.CODEBUDDY_OLLAMA_REASONING_EFFORT?.trim() || 'none';
|
|
336
|
+
}
|
|
273
337
|
isAsyncIterableStream(value) {
|
|
274
338
|
return !!value
|
|
275
339
|
&& typeof value === 'object'
|
|
@@ -416,8 +480,16 @@ export class OpenAICompatProvider {
|
|
|
416
480
|
tools: useTools ? tools : [],
|
|
417
481
|
tool_choice: useTools ? 'auto' : undefined,
|
|
418
482
|
temperature: opts.temperature ?? 0.7,
|
|
419
|
-
max_tokens: this.defaultMaxTokens,
|
|
483
|
+
max_tokens: opts.maxTokens ?? this.defaultMaxTokens,
|
|
420
484
|
};
|
|
485
|
+
const openRouterProviderRouting = this.getOpenRouterProviderRouting();
|
|
486
|
+
if (openRouterProviderRouting) {
|
|
487
|
+
requestPayload.provider = openRouterProviderRouting;
|
|
488
|
+
}
|
|
489
|
+
const ollamaReasoningEffort = this.getOllamaReasoningEffort(requestPayload.model);
|
|
490
|
+
if (ollamaReasoningEffort) {
|
|
491
|
+
requestPayload.reasoning_effort = ollamaReasoningEffort;
|
|
492
|
+
}
|
|
421
493
|
const searchOpts = opts.searchOptions || searchOptions;
|
|
422
494
|
const searchParameters = searchOpts?.search_parameters;
|
|
423
495
|
if (this.shouldIncludeSearchParameters(searchParameters)) {
|
|
@@ -539,8 +611,16 @@ export class OpenAICompatProvider {
|
|
|
539
611
|
tools: useTools ? tools : [],
|
|
540
612
|
tool_choice: useTools ? 'auto' : undefined,
|
|
541
613
|
temperature: opts.temperature ?? 0.7,
|
|
542
|
-
max_tokens: this.defaultMaxTokens,
|
|
614
|
+
max_tokens: opts.maxTokens ?? this.defaultMaxTokens,
|
|
543
615
|
};
|
|
616
|
+
const openRouterProviderRouting = this.getOpenRouterProviderRouting();
|
|
617
|
+
if (openRouterProviderRouting) {
|
|
618
|
+
requestPayload.provider = openRouterProviderRouting;
|
|
619
|
+
}
|
|
620
|
+
const ollamaReasoningEffort = this.getOllamaReasoningEffort(requestPayload.model);
|
|
621
|
+
if (ollamaReasoningEffort) {
|
|
622
|
+
requestPayload.reasoning_effort = ollamaReasoningEffort;
|
|
623
|
+
}
|
|
544
624
|
const searchOpts = opts.searchOptions || searchOptions;
|
|
545
625
|
const searchParameters = searchOpts?.search_parameters;
|
|
546
626
|
const searchParams = this.shouldIncludeSearchParameters(searchParameters)
|
|
@@ -58,6 +58,13 @@ ACTIONS:
|
|
|
58
58
|
- excel_set_cell: Set an Excel cell value via Windows COM
|
|
59
59
|
- excel_get_cell: Read an Excel cell value via Windows COM
|
|
60
60
|
- excel_save_workbook: Save or Save As an Excel workbook via Windows COM
|
|
61
|
+
- powerpoint_open_presentation: Open or create a PowerPoint presentation via Windows COM
|
|
62
|
+
- powerpoint_add_slide: Add a slide (layoutIndex optional) via Windows COM
|
|
63
|
+
- powerpoint_set_text: Set text of a shape (slideIndex + shapeIndex) via Windows COM
|
|
64
|
+
- powerpoint_save_presentation: Save or Save As a PowerPoint presentation via Windows COM
|
|
65
|
+
- word_open_document: Open or create a Word document via Windows COM
|
|
66
|
+
- word_type_text: Append text (value) to a Word document via Windows COM
|
|
67
|
+
- word_save_document: Save or Save As a Word document via Windows COM
|
|
61
68
|
- use_app_workflow: Execute a short sequence of computer_control steps
|
|
62
69
|
- click_text: Click visible text using OCR fallback
|
|
63
70
|
- click: Click at position or element ref
|
|
@@ -146,6 +153,13 @@ ACTIONS:
|
|
|
146
153
|
'excel_set_cell',
|
|
147
154
|
'excel_get_cell',
|
|
148
155
|
'excel_save_workbook',
|
|
156
|
+
'powerpoint_open_presentation',
|
|
157
|
+
'powerpoint_add_slide',
|
|
158
|
+
'powerpoint_set_text',
|
|
159
|
+
'powerpoint_save_presentation',
|
|
160
|
+
'word_open_document',
|
|
161
|
+
'word_type_text',
|
|
162
|
+
'word_save_document',
|
|
149
163
|
'use_app_workflow',
|
|
150
164
|
'macro',
|
|
151
165
|
'click_text',
|
|
@@ -246,11 +260,23 @@ ACTIONS:
|
|
|
246
260
|
},
|
|
247
261
|
filePath: {
|
|
248
262
|
type: 'string',
|
|
249
|
-
description: 'File/folder path for app launch or Excel workbook
|
|
263
|
+
description: 'File/folder path for app launch or Office document path (Excel workbook, PowerPoint presentation, Word document)',
|
|
250
264
|
},
|
|
251
265
|
saveAsPath: {
|
|
252
266
|
type: 'string',
|
|
253
|
-
description: 'Save-as path for Excel
|
|
267
|
+
description: 'Save-as path for an Office document (Excel/PowerPoint/Word)',
|
|
268
|
+
},
|
|
269
|
+
slideIndex: {
|
|
270
|
+
type: 'number',
|
|
271
|
+
description: 'PowerPoint 1-based slide index for powerpoint_set_text',
|
|
272
|
+
},
|
|
273
|
+
shapeIndex: {
|
|
274
|
+
type: 'number',
|
|
275
|
+
description: 'PowerPoint 1-based shape index on the slide for powerpoint_set_text',
|
|
276
|
+
},
|
|
277
|
+
layoutIndex: {
|
|
278
|
+
type: 'number',
|
|
279
|
+
description: 'PowerPoint slide layout index for powerpoint_add_slide (e.g. 1=title, 2=text); defaults to 1',
|
|
254
280
|
},
|
|
255
281
|
sheetName: {
|
|
256
282
|
type: 'string',
|
|
@@ -428,6 +454,10 @@ ACTIONS:
|
|
|
428
454
|
type: 'boolean',
|
|
429
455
|
description: 'Only include interactive elements in snapshot',
|
|
430
456
|
},
|
|
457
|
+
useOmniParser: {
|
|
458
|
+
type: 'boolean',
|
|
459
|
+
description: 'For snapshot_with_screenshot: route the screenshot through a self-hosted OmniParser v2 server (set OMNIPARSER_API_URL) to overlay numbered bounding boxes and append parsed elements with clickable center coordinates. No-op (original snapshot) when the server is unavailable.',
|
|
460
|
+
},
|
|
431
461
|
steps: {
|
|
432
462
|
type: 'array',
|
|
433
463
|
items: { type: 'object' },
|
|
@@ -12,7 +12,7 @@ export const VIEW_FILE_TOOL = {
|
|
|
12
12
|
type: "function",
|
|
13
13
|
function: {
|
|
14
14
|
name: "view_file",
|
|
15
|
-
description: "View contents of a file or list directory contents",
|
|
15
|
+
description: "View contents of a file or list directory contents. Read/inspect a file before editing it — never guess its contents.",
|
|
16
16
|
parameters: {
|
|
17
17
|
type: "object",
|
|
18
18
|
properties: {
|
|
@@ -94,7 +94,7 @@ export const STR_REPLACE_EDITOR_TOOL = {
|
|
|
94
94
|
type: "function",
|
|
95
95
|
function: {
|
|
96
96
|
name: "str_replace_editor",
|
|
97
|
-
description: "Replace specific text in a file. Use this for single line edits only",
|
|
97
|
+
description: "Replace specific text in a file. Use this for single line edits only. After editing, verify the change with view_file.",
|
|
98
98
|
parameters: {
|
|
99
99
|
type: "object",
|
|
100
100
|
properties: {
|
|
@@ -192,7 +192,7 @@ export const BASH_TOOL = {
|
|
|
192
192
|
type: "function",
|
|
193
193
|
function: {
|
|
194
194
|
name: "bash",
|
|
195
|
-
description: "Execute a bash command",
|
|
195
|
+
description: "Execute a bash command. Prefer it to check facts and state you can verify (git status, test output, file existence, exit codes) rather than assuming.",
|
|
196
196
|
parameters: {
|
|
197
197
|
type: "object",
|
|
198
198
|
properties: {
|
|
@@ -19,7 +19,7 @@ export { FEISHU_DOC_READ_TOOL, FEISHU_DRIVE_LIST_COMMENTS_TOOL, FEISHU_DRIVE_LIS
|
|
|
19
19
|
export { CRONJOB_TOOL, CRON_TOOLS, } from './cron-tools.js';
|
|
20
20
|
export { WEB_SEARCH_TOOL, WEB_FETCH_TOOL, WEB_EXTRACT_TOOL, WEB_TOOLS, } from './web-tools.js';
|
|
21
21
|
export { MULTI_EDIT_TOOL, GIT_TOOL, CODEBASE_MAP_TOOL, CODE_GRAPH_TOOL, SUBAGENT_TOOL, DOCKER_TOOL, KUBERNETES_TOOL, PROCESS_TOOL, JS_REPL_TOOL, REASON_TOOL, PLAN_TOOL, EXECUTE_CODE_TOOL, RUN_SCRIPT_TOOL, ADVANCED_TOOLS, } from './advanced-tools.js';
|
|
22
|
-
export { PDF_TOOL, AUDIO_TOOL, TEXT_TO_SPEECH_TOOL, IMAGE_GENERATE_TOOL, VIDEO_TOOL, VIDEO_ANALYZE_TOOL, VIDEO_GENERATE_TOOL, SCREENSHOT_TOOL, CAMERA_SNAPSHOT_TOOL, CLIPBOARD_TOOL, DOCUMENT_TOOL, OCR_TOOL, VISION_ANALYZE_TOOL, DIAGRAM_TOOL, EXPORT_TOOL, QR_TOOL, ARCHIVE_TOOL, MULTIMODAL_TOOLS, } from './multimodal-tools.js';
|
|
22
|
+
export { PDF_TOOL, AUDIO_TOOL, TEXT_TO_SPEECH_TOOL, IMAGE_GENERATE_TOOL, VIDEO_TOOL, VIDEO_ANALYZE_TOOL, VIDEO_GENERATE_TOOL, SCREENSHOT_TOOL, CAMERA_SNAPSHOT_TOOL, CAMERA_ANALYZE_TOOL, CLIPBOARD_TOOL, DOCUMENT_TOOL, OCR_TOOL, VISION_ANALYZE_TOOL, DIAGRAM_TOOL, EXPORT_TOOL, QR_TOOL, ARCHIVE_TOOL, MULTIMODAL_TOOLS, } from './multimodal-tools.js';
|
|
23
23
|
export { COMPUTER_CONTROL_TOOL, COMPUTER_CONTROL_TOOLS, } from './computer-control-tools.js';
|
|
24
24
|
export { INTERNET_SCOUT_RUN_TOOL, INTERNET_SCOUT_PLAN_TOOL, BROWSER_NAVIGATE_TOOL, BROWSER_CLICK_TOOL, BROWSER_TYPE_TOOL, BROWSER_SCROLL_TOOL, BROWSER_BACK_TOOL, BROWSER_PRESS_TOOL, BROWSER_VISION_TOOL, BROWSER_TOOL, BROWSER_TOOLS, } from './browser-tools.js';
|
|
25
25
|
export { A2UI_TOOL, VISUAL_CANVAS_TOOL, CANVAS_TOOLS, } from './canvas-tools.js';
|
|
@@ -39,3 +39,4 @@ export { GENERATE_DOCUMENT_TOOL, DOCUMENT_GENERATOR_TOOLS, } from './document-to
|
|
|
39
39
|
export { SESSION_TOOLS } from './session-tools.js';
|
|
40
40
|
export { GITNEXUS_ASK_TOOL, GITNEXUS_TOOLS, } from './gitnexus-tools.js';
|
|
41
41
|
export type { CodeBuddyTool as Tool } from './types.js';
|
|
42
|
+
export * from "./windows-tools.js";
|
|
@@ -33,7 +33,7 @@ export { WEB_SEARCH_TOOL, WEB_FETCH_TOOL, WEB_EXTRACT_TOOL, WEB_TOOLS, } from '.
|
|
|
33
33
|
// Advanced tools
|
|
34
34
|
export { MULTI_EDIT_TOOL, GIT_TOOL, CODEBASE_MAP_TOOL, CODE_GRAPH_TOOL, SUBAGENT_TOOL, DOCKER_TOOL, KUBERNETES_TOOL, PROCESS_TOOL, JS_REPL_TOOL, REASON_TOOL, PLAN_TOOL, EXECUTE_CODE_TOOL, RUN_SCRIPT_TOOL, ADVANCED_TOOLS, } from './advanced-tools.js';
|
|
35
35
|
// Multimodal tools
|
|
36
|
-
export { PDF_TOOL, AUDIO_TOOL, TEXT_TO_SPEECH_TOOL, IMAGE_GENERATE_TOOL, VIDEO_TOOL, VIDEO_ANALYZE_TOOL, VIDEO_GENERATE_TOOL, SCREENSHOT_TOOL, CAMERA_SNAPSHOT_TOOL, CLIPBOARD_TOOL, DOCUMENT_TOOL, OCR_TOOL, VISION_ANALYZE_TOOL, DIAGRAM_TOOL, EXPORT_TOOL, QR_TOOL, ARCHIVE_TOOL, MULTIMODAL_TOOLS, } from './multimodal-tools.js';
|
|
36
|
+
export { PDF_TOOL, AUDIO_TOOL, TEXT_TO_SPEECH_TOOL, IMAGE_GENERATE_TOOL, VIDEO_TOOL, VIDEO_ANALYZE_TOOL, VIDEO_GENERATE_TOOL, SCREENSHOT_TOOL, CAMERA_SNAPSHOT_TOOL, CAMERA_ANALYZE_TOOL, CLIPBOARD_TOOL, DOCUMENT_TOOL, OCR_TOOL, VISION_ANALYZE_TOOL, DIAGRAM_TOOL, EXPORT_TOOL, QR_TOOL, ARCHIVE_TOOL, MULTIMODAL_TOOLS, } from './multimodal-tools.js';
|
|
37
37
|
// Computer Control tools (Enterprise-grade)
|
|
38
38
|
export { COMPUTER_CONTROL_TOOL, COMPUTER_CONTROL_TOOLS, } from './computer-control-tools.js';
|
|
39
39
|
// Browser tools (Enterprise-grade CDP automation)
|
|
@@ -70,4 +70,5 @@ export { GENERATE_DOCUMENT_TOOL, DOCUMENT_GENERATOR_TOOLS, } from './document-to
|
|
|
70
70
|
export { SESSION_TOOLS } from './session-tools.js';
|
|
71
71
|
// GitNexus tools
|
|
72
72
|
export { GITNEXUS_ASK_TOOL, GITNEXUS_TOOLS, } from './gitnexus-tools.js';
|
|
73
|
+
export * from "./windows-tools.js";
|
|
73
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -24,6 +24,7 @@ export declare const VIDEO_ANALYZE_TOOL: CodeBuddyTool;
|
|
|
24
24
|
export declare const VIDEO_GENERATE_TOOL: CodeBuddyTool;
|
|
25
25
|
export declare const SCREENSHOT_TOOL: CodeBuddyTool;
|
|
26
26
|
export declare const CAMERA_SNAPSHOT_TOOL: CodeBuddyTool;
|
|
27
|
+
export declare const CAMERA_ANALYZE_TOOL: CodeBuddyTool;
|
|
27
28
|
export declare const CLIPBOARD_TOOL: CodeBuddyTool;
|
|
28
29
|
export declare const DOCUMENT_TOOL: CodeBuddyTool;
|
|
29
30
|
export declare const OCR_TOOL: CodeBuddyTool;
|
|
@@ -96,7 +96,7 @@ export const TEXT_TO_SPEECH_TOOL = {
|
|
|
96
96
|
},
|
|
97
97
|
provider: {
|
|
98
98
|
type: "string",
|
|
99
|
-
enum: ["auto", "system", "edge-tts", "espeak", "say", "
|
|
99
|
+
enum: ["auto", "system", "edge-tts", "espeak", "say", "audioreader"],
|
|
100
100
|
description: "TTS provider. auto detects a local provider; system uses Windows SAPI"
|
|
101
101
|
},
|
|
102
102
|
voice: {
|
|
@@ -351,6 +351,48 @@ export const CAMERA_SNAPSHOT_TOOL = {
|
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
+
// Camera Analyze Tool - Capture a webcam frame AND describe it with a vision model
|
|
355
|
+
export const CAMERA_ANALYZE_TOOL = {
|
|
356
|
+
type: "function",
|
|
357
|
+
function: {
|
|
358
|
+
name: "camera_analyze",
|
|
359
|
+
description: "Capture one local webcam frame and return a natural-language description from a local multimodal vision model (default Ollama gemma4:12b). Use this to actually SEE what the camera shows, not just save a PNG. Requires ffmpeg, OS camera permission, and a reachable local vision model.",
|
|
360
|
+
parameters: {
|
|
361
|
+
type: "object",
|
|
362
|
+
properties: {
|
|
363
|
+
prompt: {
|
|
364
|
+
type: "string",
|
|
365
|
+
description: "What to ask the vision model about the frame. Default \"Describe what you see.\""
|
|
366
|
+
},
|
|
367
|
+
device: {
|
|
368
|
+
type: "string",
|
|
369
|
+
description: "Optional ffmpeg camera device. Linux example: /dev/video0; Windows: video=Integrated Camera; macOS: 0."
|
|
370
|
+
},
|
|
371
|
+
model: {
|
|
372
|
+
type: "string",
|
|
373
|
+
description: "Local multimodal model id served by Ollama. Default gemma4:12b."
|
|
374
|
+
},
|
|
375
|
+
include_ocr: {
|
|
376
|
+
type: "boolean",
|
|
377
|
+
description: "Also attach local OCR text evidence from the captured frame (default: false)."
|
|
378
|
+
},
|
|
379
|
+
ocr_language: {
|
|
380
|
+
type: "string",
|
|
381
|
+
description: "OCR language code when include_ocr is true (default: eng)."
|
|
382
|
+
},
|
|
383
|
+
output_path: {
|
|
384
|
+
type: "string",
|
|
385
|
+
description: "Optional output image path. Defaults to .codebuddy/camera/camera-<timestamp>.png in the active workspace."
|
|
386
|
+
},
|
|
387
|
+
timeout_ms: {
|
|
388
|
+
type: "number",
|
|
389
|
+
description: "Capture timeout in milliseconds (default: 10000)."
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
required: []
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
};
|
|
354
396
|
// Clipboard Tool - System clipboard operations
|
|
355
397
|
export const CLIPBOARD_TOOL = {
|
|
356
398
|
type: "function",
|
|
@@ -799,6 +841,7 @@ export const MULTIMODAL_TOOLS = [
|
|
|
799
841
|
VIDEO_GENERATE_TOOL,
|
|
800
842
|
SCREENSHOT_TOOL,
|
|
801
843
|
CAMERA_SNAPSHOT_TOOL,
|
|
844
|
+
CAMERA_ANALYZE_TOOL,
|
|
802
845
|
CLIPBOARD_TOOL,
|
|
803
846
|
DOCUMENT_TOOL,
|
|
804
847
|
OCR_TOOL,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const WINDOWS_TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
function: {
|
|
5
|
+
name: "office_macro_execute",
|
|
6
|
+
description: "Executes VBA or PowerShell macros directly in Windows Microsoft Office applications (Excel, Word, PowerPoint). This tool is only available on Windows.",
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
application: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "The Microsoft Office application to target",
|
|
13
|
+
enum: ["Excel", "Word", "PowerPoint"],
|
|
14
|
+
},
|
|
15
|
+
macroCode: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "The VBA code or PowerShell code to execute",
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The type of macro code being provided",
|
|
22
|
+
enum: ["vba", "powershell"],
|
|
23
|
+
},
|
|
24
|
+
runHeadless: {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
description: "If true, the application will run invisibly in the background and will be closed after execution.",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ["application", "macroCode", "type"],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
//# sourceMappingURL=windows-tools.js.map
|
|
@@ -19,13 +19,20 @@ export interface PluginToolDefinition {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
export type { CodeBuddyTool, JsonSchemaProperty };
|
|
22
|
-
export { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, REASON_TOOL, EXECUTE_CODE_TOOL, } from "./tool-definitions/index.js";
|
|
22
|
+
export { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, REASON_TOOL, EXECUTE_CODE_TOOL, WINDOWS_TOOLS, } from "./tool-definitions/index.js";
|
|
23
23
|
export declare function getBuiltinToolNames(): string[];
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the tool registry with all built-in tools
|
|
26
26
|
*/
|
|
27
27
|
export declare function initializeToolRegistry(): void;
|
|
28
28
|
export declare function getMCPManager(): MCPManager;
|
|
29
|
+
/**
|
|
30
|
+
* True when the Code Explorer (gitnexus) MCP tools are connected — i.e. at least
|
|
31
|
+
* one `mcp__gitnexus__*` tool is registered. Used to conditionally steer the
|
|
32
|
+
* agent toward Code Explorer for relationship/impact questions. Returns false
|
|
33
|
+
* (no behavior change) whenever Code Explorer is not installed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isCodeExplorerAvailable(): boolean;
|
|
29
36
|
export declare function initializeMCPServers(): Promise<void>;
|
|
30
37
|
export declare function convertMCPToolToCodeBuddyTool(mcpTool: MCPTool): CodeBuddyTool;
|
|
31
38
|
/**
|
package/dist/codebuddy/tools.js
CHANGED
|
@@ -9,14 +9,16 @@ import { loadMCPConfig } from "../mcp/config.js";
|
|
|
9
9
|
import { getToolSelector, selectRelevantTools } from "../tools/tool-selector.js";
|
|
10
10
|
import { logger } from "../utils/logger.js";
|
|
11
11
|
import { getToolRegistry } from "../tools/registry.js";
|
|
12
|
+
import { createRegisterToolTool } from "../tools/register-tool-handler.js";
|
|
13
|
+
import { loadAuthoredTools } from "../agent/self-improvement/tool-skill-mutator.js";
|
|
12
14
|
import { applyToolFilter } from "../utils/tool-filter.js";
|
|
13
15
|
import { TOOL_METADATA } from "../tools/metadata.js";
|
|
14
16
|
import { getPluginMarketplace } from "../plugins/marketplace.js";
|
|
15
17
|
// Import modular tool definitions
|
|
16
|
-
import { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, AGENT_TOOLS, FIRECRAWL_TOOLS, LSP_TOOLS, SECRETS_TOOLS, ADVISOR_TOOLS, ASK_USER_QUESTION_TOOLS, EXIT_PLAN_MODE_TOOLS, CODEBASE_REPLACE_TOOLS, SESSION_TOOLS, GITNEXUS_TOOLS, } from "./tool-definitions/index.js";
|
|
18
|
+
import { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, AGENT_TOOLS, FIRECRAWL_TOOLS, LSP_TOOLS, SECRETS_TOOLS, ADVISOR_TOOLS, ASK_USER_QUESTION_TOOLS, EXIT_PLAN_MODE_TOOLS, CODEBASE_REPLACE_TOOLS, SESSION_TOOLS, GITNEXUS_TOOLS, WINDOWS_TOOLS, } from "./tool-definitions/index.js";
|
|
17
19
|
import { FLEET_TOOLS } from "./fleet-tool-defs.js";
|
|
18
20
|
// Explicit re-exports from tool-definitions (no blanket export *)
|
|
19
|
-
export { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, REASON_TOOL, EXECUTE_CODE_TOOL, } from "./tool-definitions/index.js";
|
|
21
|
+
export { CORE_TOOLS, MORPH_EDIT_TOOL, isMorphEnabled, SEARCH_TOOLS, TODO_TOOLS, KANBAN_TOOLS, MESSAGING_TOOLS, YUANBAO_TOOLS, HOMEASSISTANT_TOOLS, MOA_TOOLS, SPOTIFY_TOOLS, X_SEARCH_TOOLS, FEISHU_TOOLS, CRON_TOOLS, WEB_TOOLS, ADVANCED_TOOLS, MULTIMODAL_TOOLS, COMPUTER_CONTROL_TOOLS, BROWSER_TOOLS, CANVAS_TOOLS, REASON_TOOL, EXECUTE_CODE_TOOL, WINDOWS_TOOLS, } from "./tool-definitions/index.js";
|
|
20
22
|
export function getBuiltinToolNames() {
|
|
21
23
|
const groups = [
|
|
22
24
|
CORE_TOOLS,
|
|
@@ -49,6 +51,7 @@ export function getBuiltinToolNames() {
|
|
|
49
51
|
SESSION_TOOLS,
|
|
50
52
|
FLEET_TOOLS,
|
|
51
53
|
GITNEXUS_TOOLS,
|
|
54
|
+
WINDOWS_TOOLS,
|
|
52
55
|
];
|
|
53
56
|
return Array.from(new Set(groups.flatMap((tools) => tools.map((tool) => tool.function.name))));
|
|
54
57
|
}
|
|
@@ -88,6 +91,18 @@ export function initializeToolRegistry() {
|
|
|
88
91
|
description: 'High-speed file editing with Morph'
|
|
89
92
|
};
|
|
90
93
|
registry.registerTool(MORPH_EDIT_TOOL, morphMetadata, isMorphEnabled);
|
|
94
|
+
// Self-improvement: expose `register_tool` + reload persisted authored tools,
|
|
95
|
+
// only when opted in.
|
|
96
|
+
if (process.env.CODEBUDDY_SELF_IMPROVE === 'true') {
|
|
97
|
+
const schema = createRegisterToolTool().getSchema();
|
|
98
|
+
registry.registerTool({ type: 'function', function: { name: schema.name, description: schema.description, parameters: schema.parameters } }, { name: schema.name, category: 'system', keywords: ['authored', 'self-extension', 'register', 'tool'], priority: 6, description: schema.description });
|
|
99
|
+
try {
|
|
100
|
+
const loaded = loadAuthoredTools();
|
|
101
|
+
if (loaded.length > 0)
|
|
102
|
+
logger.info(`[self-improve] reloaded ${loaded.length} authored tool(s): ${loaded.join(', ')}`);
|
|
103
|
+
}
|
|
104
|
+
catch { /* persisted store optional */ }
|
|
105
|
+
}
|
|
91
106
|
registerGroup(SEARCH_TOOLS);
|
|
92
107
|
registerGroup(TODO_TOOLS);
|
|
93
108
|
registerGroup(KANBAN_TOOLS);
|
|
@@ -118,6 +133,8 @@ export function initializeToolRegistry() {
|
|
|
118
133
|
registerGroup(ASK_USER_QUESTION_TOOLS);
|
|
119
134
|
// ExitPlanMode tool (request approval to leave plan mode)
|
|
120
135
|
registerGroup(EXIT_PLAN_MODE_TOOLS);
|
|
136
|
+
// Windows OS-specific tools (Office VBA, etc.)
|
|
137
|
+
registerGroup(WINDOWS_TOOLS, () => process.platform === 'win32');
|
|
121
138
|
// Codebase replace tools
|
|
122
139
|
registerGroup(CODEBASE_REPLACE_TOOLS);
|
|
123
140
|
// Session tools — multi-agent coordination (Phase E wake of SessionToolExecutor).
|
|
@@ -144,6 +161,20 @@ export function getMCPManager() {
|
|
|
144
161
|
}
|
|
145
162
|
return mcpManager;
|
|
146
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* True when the Code Explorer (gitnexus) MCP tools are connected — i.e. at least
|
|
166
|
+
* one `mcp__gitnexus__*` tool is registered. Used to conditionally steer the
|
|
167
|
+
* agent toward Code Explorer for relationship/impact questions. Returns false
|
|
168
|
+
* (no behavior change) whenever Code Explorer is not installed.
|
|
169
|
+
*/
|
|
170
|
+
export function isCodeExplorerAvailable() {
|
|
171
|
+
try {
|
|
172
|
+
return getMCPManager().getTools().some((t) => t.name.startsWith('mcp__gitnexus__'));
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
147
178
|
export async function initializeMCPServers() {
|
|
148
179
|
const manager = getMCPManager();
|
|
149
180
|
const config = loadMCPConfig();
|
|
@@ -319,29 +350,29 @@ export async function getAllCodeBuddyTools() {
|
|
|
319
350
|
// Ensure registry is initialized with built-in tools
|
|
320
351
|
initializeToolRegistry();
|
|
321
352
|
const manager = getMCPManager();
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
353
|
+
const mcpDisabled = process.env.CODEBUDDY_DISABLE_MCP === 'true' ||
|
|
354
|
+
process.env.CODEBUDDY_DISABLE_MCP === '1';
|
|
355
|
+
if (!mcpDisabled) {
|
|
356
|
+
// Initialize MCP servers if not already done.
|
|
357
|
+
//
|
|
358
|
+
// In interactive mode this stays fire-and-forget: a hung/slow MCP server
|
|
359
|
+
// must never block a turn, and the agent self-heals across turns (a missed
|
|
360
|
+
// server simply shows up on the next round).
|
|
361
|
+
//
|
|
362
|
+
// In headless / one-shot mode (`buddy --print`) there is no "next round" to
|
|
363
|
+
// recover in, and RAG tool selection is cached after the first round — so if
|
|
364
|
+
// the lazy connection loses the race against the first selection, MCP tools
|
|
365
|
+
// are cached out for the entire run. We therefore await initialization here
|
|
366
|
+
// unless MCP has explicitly been disabled for the process.
|
|
367
|
+
const initPromise = manager.ensureServersInitialized().catch((err) => {
|
|
368
|
+
// Log but don't fail - MCP servers are optional
|
|
369
|
+
if (process.env.DEBUG) {
|
|
370
|
+
logger.warn(`MCP initialization warning: ${err.message || String(err)}`);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
if (process.env.CODEBUDDY_HEADLESS === 'true') {
|
|
374
|
+
await initPromise;
|
|
341
375
|
}
|
|
342
|
-
});
|
|
343
|
-
if (process.env.CODEBUDDY_HEADLESS === 'true') {
|
|
344
|
-
await initPromise;
|
|
345
376
|
}
|
|
346
377
|
const registry = getToolRegistry();
|
|
347
378
|
const builtInTools = registry.getEnabledTools();
|
|
@@ -356,6 +387,18 @@ export async function getAllCodeBuddyTools() {
|
|
|
356
387
|
}
|
|
357
388
|
// Apply CLI tool filter (--enabled-tools, --disabled-tools, --allowed-tools)
|
|
358
389
|
allTools = applyToolFilter(allTools);
|
|
390
|
+
// When Code Explorer (gitnexus) is connected, make the built-in graph tools
|
|
391
|
+
// defer to it at the decision point — its graph is broader / more complete.
|
|
392
|
+
// Conditional & non-mutating: returns fresh objects only for code_graph /
|
|
393
|
+
// codebase_map, and only when a gitnexus tool is present (no change otherwise).
|
|
394
|
+
if (allTools.some((t) => t.function.name.startsWith('mcp__gitnexus__'))) {
|
|
395
|
+
const DEFER = ' NOTE: Code Explorer (gitnexus) is available — for code-relationship, blast-radius/impact, ' +
|
|
396
|
+
'dead-code and cycle questions PREFER its MCP tools (`mcp__gitnexus__impact` / `context` / ' +
|
|
397
|
+
'`query` / `find_cycles`); use this built-in only as a fallback if a gitnexus tool errors.';
|
|
398
|
+
allTools = allTools.map((t) => t.function.name === 'code_graph' || t.function.name === 'codebase_map'
|
|
399
|
+
? { ...t, function: { ...t.function, description: (t.function.description ?? '') + DEFER } }
|
|
400
|
+
: t);
|
|
401
|
+
}
|
|
359
402
|
return allTools;
|
|
360
403
|
}
|
|
361
404
|
// ============================================================================
|