@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
package/dist/tools/metadata.js
CHANGED
|
@@ -368,6 +368,13 @@ export const TOOL_METADATA = [
|
|
|
368
368
|
priority: 6,
|
|
369
369
|
description: 'Control desktop applications with app profiles, Excel automation, mouse, keyboard, windows, dialogs, form fields, dropdowns, lists, buttons, links, radios, tabs, menus, tree items, sliders, checkboxes, and assertions'
|
|
370
370
|
},
|
|
371
|
+
{
|
|
372
|
+
name: 'office_macro_execute',
|
|
373
|
+
category: 'system',
|
|
374
|
+
keywords: ['office', 'excel', 'word', 'powerpoint', 'vba', 'macro', 'powershell', 'com', 'windows', 'automation'],
|
|
375
|
+
priority: 4,
|
|
376
|
+
description: 'Execute VBA or PowerShell macros in Microsoft Office apps (Excel/Word/PowerPoint) via COM — Windows only. Dangerous: runs arbitrary code, requires confirmation. Not exposed to fleet peers.'
|
|
377
|
+
},
|
|
371
378
|
// Planning
|
|
372
379
|
{
|
|
373
380
|
name: 'create_todo_list',
|
|
@@ -682,6 +689,13 @@ export const TOOL_METADATA = [
|
|
|
682
689
|
priority: 6,
|
|
683
690
|
description: 'Capture one local webcam frame and record a vision percept'
|
|
684
691
|
},
|
|
692
|
+
{
|
|
693
|
+
name: 'camera_analyze',
|
|
694
|
+
category: 'media',
|
|
695
|
+
keywords: ['camera', 'webcam', 'see', 'vision', 'describe', 'look', 'photo', 'companion', 'eyes', 'analyze', 'what do you see'],
|
|
696
|
+
priority: 7,
|
|
697
|
+
description: 'Capture a local webcam frame and describe it with a local multimodal vision model'
|
|
698
|
+
},
|
|
685
699
|
{
|
|
686
700
|
name: 'audio',
|
|
687
701
|
category: 'media',
|
|
@@ -940,6 +954,20 @@ export const TOOL_METADATA = [
|
|
|
940
954
|
priority: 5,
|
|
941
955
|
description: 'Store persistent memory entries'
|
|
942
956
|
},
|
|
957
|
+
{
|
|
958
|
+
name: 'replace_memory',
|
|
959
|
+
category: 'utility',
|
|
960
|
+
keywords: ['memory', 'replace', 'rewrite', 'update', 'persist', 'preference'],
|
|
961
|
+
priority: 5,
|
|
962
|
+
description: 'Replace an existing persistent memory entry under the memory char budget'
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: 'memory_propose',
|
|
966
|
+
category: 'utility',
|
|
967
|
+
keywords: ['memory', 'candidate', 'propose', 'review', 'long-term', 'persist'],
|
|
968
|
+
priority: 5,
|
|
969
|
+
description: 'Propose a review-gated long-term memory candidate without silently writing prompt-injected memory'
|
|
970
|
+
},
|
|
943
971
|
{
|
|
944
972
|
name: 'recall',
|
|
945
973
|
category: 'utility',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolResult } from '../types/index.js';
|
|
2
|
+
export interface OfficeMacroToolInput {
|
|
3
|
+
application: 'Excel' | 'Word' | 'PowerPoint';
|
|
4
|
+
macroCode: string;
|
|
5
|
+
type: 'vba' | 'powershell';
|
|
6
|
+
runHeadless?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class OfficeMacroTool {
|
|
9
|
+
execute(input: OfficeMacroToolInput): Promise<ToolResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { exec } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
const execAsync = promisify(exec);
|
|
7
|
+
export class OfficeMacroTool {
|
|
8
|
+
async execute(input) {
|
|
9
|
+
if (process.platform !== 'win32') {
|
|
10
|
+
return {
|
|
11
|
+
success: false,
|
|
12
|
+
error: 'Office Macro Tool is only supported on Windows (win32 platform).',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const { application, macroCode, type, runHeadless = false } = input;
|
|
17
|
+
const appName = `"${application}.Application"`;
|
|
18
|
+
let psScript = '';
|
|
19
|
+
if (type === 'powershell') {
|
|
20
|
+
psScript = `
|
|
21
|
+
$ErrorActionPreference = "Stop"
|
|
22
|
+
$app = New-Object -ComObject ${appName}
|
|
23
|
+
$app.Visible = $${!runHeadless}
|
|
24
|
+
try {
|
|
25
|
+
${macroCode.split(/\r?\n/).map((l) => ' ' + l).join('\n')}
|
|
26
|
+
} finally {
|
|
27
|
+
# We do not automatically quit here to allow user interaction unless specified in the script
|
|
28
|
+
}
|
|
29
|
+
`.trim();
|
|
30
|
+
}
|
|
31
|
+
else if (type === 'vba') {
|
|
32
|
+
// Wrapper to inject VBA code into the application and run it
|
|
33
|
+
// This usually requires 'Trust access to the VBA project object model' in Office settings.
|
|
34
|
+
psScript = `
|
|
35
|
+
$ErrorActionPreference = "Stop"
|
|
36
|
+
$app = New-Object -ComObject ${appName}
|
|
37
|
+
$app.Visible = $${!runHeadless}
|
|
38
|
+
try {
|
|
39
|
+
$workbook = $null
|
|
40
|
+
if ("${application}" -eq "Excel") {
|
|
41
|
+
$workbook = $app.Workbooks.Add()
|
|
42
|
+
} elseif ("${application}" -eq "Word") {
|
|
43
|
+
$workbook = $app.Documents.Add()
|
|
44
|
+
} elseif ("${application}" -eq "PowerPoint") {
|
|
45
|
+
$workbook = $app.Presentations.Add()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if ($workbook -ne $null) {
|
|
49
|
+
$vbext_ct_StdModule = 1
|
|
50
|
+
$module = $workbook.VBProject.VBComponents.Add($vbext_ct_StdModule)
|
|
51
|
+
$module.CodeModule.AddFromString(@"
|
|
52
|
+
${macroCode}
|
|
53
|
+
"@)
|
|
54
|
+
|
|
55
|
+
# We try to run the first parameterless macro found or a specific name if we can infer it.
|
|
56
|
+
# But commonly, for VBA injection, the user script should define a 'Sub Main()' and we run it.
|
|
57
|
+
$app.Run("Main")
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
Write-Error $_.Exception.Message
|
|
61
|
+
} finally {
|
|
62
|
+
# If headless, we quit
|
|
63
|
+
if (${runHeadless ? '$true' : '$false'}) {
|
|
64
|
+
$app.Quit()
|
|
65
|
+
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($app) | Out-Null
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`.trim();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return { success: false, error: `Unsupported macro type: ${type}` };
|
|
72
|
+
}
|
|
73
|
+
// Save to a temporary file
|
|
74
|
+
const tempDir = os.tmpdir();
|
|
75
|
+
const psFilePath = path.join(tempDir, `office_macro_${Date.now()}.ps1`);
|
|
76
|
+
await fs.writeFile(psFilePath, psScript, 'utf8');
|
|
77
|
+
// Execute via Powershell
|
|
78
|
+
const { stdout, stderr } = await execAsync(`powershell.exe -ExecutionPolicy Bypass -File "${psFilePath}"`, {
|
|
79
|
+
timeout: 60000, // 60 seconds max
|
|
80
|
+
});
|
|
81
|
+
// Cleanup
|
|
82
|
+
await fs.unlink(psFilePath).catch(() => { });
|
|
83
|
+
if (stderr) {
|
|
84
|
+
return { success: false, error: stderr.trim() };
|
|
85
|
+
}
|
|
86
|
+
return { success: true, output: stdout.trim() || 'Macro executed successfully.' };
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=office-macro-tool.js.map
|
|
@@ -40,7 +40,7 @@ export { RelationshipContextTool, createRelationshipIntelligenceTools, } from '.
|
|
|
40
40
|
export { InternetScoutPlanTool, InternetScoutRunTool, createInternetScoutTools, } from './internet-scout-tools.js';
|
|
41
41
|
export { LeadScoutEnrichmentPlanTool, LeadScoutLessonCandidatesTool, LeadScoutPlanTool, LeadScoutRunTool, createLeadScoutTools, } from './lead-scout-tools.js';
|
|
42
42
|
export { BrowserOperatorTool, createBrowserOperatorTools } from './browser-operator-tools.js';
|
|
43
|
-
export { RememberTool, RecallTool, ForgetTool, createMemoryTools, } from './memory-tools.js';
|
|
43
|
+
export { RememberTool, ReplaceMemoryTool, MemoryProposeTool, RecallTool, ForgetTool, createMemoryTools, } from './memory-tools.js';
|
|
44
44
|
export { TodoAttentionTool, RestoreContextTool, createAttentionTools, } from './attention-tools.js';
|
|
45
45
|
export { LessonsAddTool, LessonsGraphTool, LessonsSearchTool, LessonsListTool, TaskVerifyTool, createLessonsTools, } from './lessons-tools.js';
|
|
46
46
|
export { UserModelObserveTool, UserModelRecallTool, createUserModelTools, } from './user-model-tools.js';
|
|
@@ -91,3 +91,4 @@ import type { ITool } from './types.js';
|
|
|
91
91
|
*/
|
|
92
92
|
export declare function registerBuiltinTools(registry: FormalToolRegistry): number;
|
|
93
93
|
import { FormalToolRegistry } from './tool-registry.js';
|
|
94
|
+
export * from "./windows-tools.js";
|
|
@@ -66,7 +66,7 @@ export { LeadScoutEnrichmentPlanTool, LeadScoutLessonCandidatesTool, LeadScoutPl
|
|
|
66
66
|
// Tool Adapters - Browser Operator (live-web session proposal)
|
|
67
67
|
export { BrowserOperatorTool, createBrowserOperatorTools } from './browser-operator-tools.js';
|
|
68
68
|
// Tool Adapters - Persistent Memory (remember, recall, forget)
|
|
69
|
-
export { RememberTool, RecallTool, ForgetTool, createMemoryTools, } from './memory-tools.js';
|
|
69
|
+
export { RememberTool, ReplaceMemoryTool, MemoryProposeTool, RecallTool, ForgetTool, createMemoryTools, } from './memory-tools.js';
|
|
70
70
|
// Tool Adapters - Attention (Todo + RestoreContext)
|
|
71
71
|
export { TodoAttentionTool, RestoreContextTool, createAttentionTools, } from './attention-tools.js';
|
|
72
72
|
// Tool Adapters - Lessons (self-improvement loop + verification contract)
|
|
@@ -369,4 +369,5 @@ import { createGuiTools } from './gui-tools.js';
|
|
|
369
369
|
import { createSessionTools } from './session-tools.js';
|
|
370
370
|
import { createAliasTools } from './tool-aliases.js';
|
|
371
371
|
import { createGitNexusTools } from './gitnexus-tools.js';
|
|
372
|
+
export * from "./windows-tools.js";
|
|
372
373
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Tools for the agent to autonomously manage its persistent memory (CLAUDE.md style).
|
|
5
5
|
* - remember: Store information in project or user memory
|
|
6
|
+
* - replace_memory: Replace an existing memory entry under Hermes-style bounds
|
|
7
|
+
* - memory_propose: Queue a long-term memory candidate for human review
|
|
6
8
|
* - recall: Explicitly retrieve a memory by key
|
|
7
9
|
* - forget: Remove a memory entry
|
|
8
10
|
*/
|
|
@@ -17,6 +19,24 @@ export declare class RememberTool implements ITool {
|
|
|
17
19
|
getMetadata(): IToolMetadata;
|
|
18
20
|
isAvailable(): boolean;
|
|
19
21
|
}
|
|
22
|
+
export declare class ReplaceMemoryTool implements ITool {
|
|
23
|
+
readonly name = "replace_memory";
|
|
24
|
+
readonly description = "Replace an existing persistent memory entry. Use when a stored fact is obsolete or too verbose and must be rewritten under the memory char budget.";
|
|
25
|
+
execute(input: Record<string, unknown>): Promise<ToolResult>;
|
|
26
|
+
getSchema(): ToolSchema;
|
|
27
|
+
validate(input: unknown): IValidationResult;
|
|
28
|
+
getMetadata(): IToolMetadata;
|
|
29
|
+
isAvailable(): boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare class MemoryProposeTool implements ITool {
|
|
32
|
+
readonly name = "memory_propose";
|
|
33
|
+
readonly description = "Propose a long-term memory candidate for human review. Use this instead of remember when the fact is inferred, ambiguous, or should not be silently injected into future prompts.";
|
|
34
|
+
execute(input: Record<string, unknown>): Promise<ToolResult>;
|
|
35
|
+
getSchema(): ToolSchema;
|
|
36
|
+
validate(input: unknown): IValidationResult;
|
|
37
|
+
getMetadata(): IToolMetadata;
|
|
38
|
+
isAvailable(): boolean;
|
|
39
|
+
}
|
|
20
40
|
export declare class RecallTool implements ITool {
|
|
21
41
|
readonly name = "recall";
|
|
22
42
|
readonly description = "Explicitly retrieve a specific memory entry by its key. Use this if the information is not currently in your system prompt.";
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Tools for the agent to autonomously manage its persistent memory (CLAUDE.md style).
|
|
5
5
|
* - remember: Store information in project or user memory
|
|
6
|
+
* - replace_memory: Replace an existing memory entry under Hermes-style bounds
|
|
7
|
+
* - memory_propose: Queue a long-term memory candidate for human review
|
|
6
8
|
* - recall: Explicitly retrieve a memory by key
|
|
7
9
|
* - forget: Remove a memory entry
|
|
8
10
|
*/
|
|
9
11
|
import { getMemoryManager } from '../../memory/persistent-memory.js';
|
|
12
|
+
import { getMemoryCandidateQueue } from '../../memory/memory-candidate-queue.js';
|
|
10
13
|
import { executeHermesLifecycleHook } from '../../hooks/hermes-lifecycle-hooks.js';
|
|
11
14
|
// ============================================================================
|
|
12
15
|
// remember
|
|
@@ -45,10 +48,10 @@ export class RememberTool {
|
|
|
45
48
|
? hookResult.updatedInput.category
|
|
46
49
|
: category;
|
|
47
50
|
}
|
|
48
|
-
await mm.remember(key, value, { scope, category });
|
|
51
|
+
const result = await mm.remember(key, value, { scope, category });
|
|
49
52
|
return {
|
|
50
53
|
success: true,
|
|
51
|
-
output:
|
|
54
|
+
output: `${result.message} Usage: ${result.usage.used}/${result.usage.limit} chars (${result.usage.percent}%).`,
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
57
|
catch (err) {
|
|
@@ -80,7 +83,7 @@ export class RememberTool {
|
|
|
80
83
|
},
|
|
81
84
|
category: {
|
|
82
85
|
type: 'string',
|
|
83
|
-
enum: ['project', 'preferences', 'decisions', 'patterns', 'custom'],
|
|
86
|
+
enum: ['project', 'preferences', 'decisions', 'patterns', 'context', 'custom'],
|
|
84
87
|
description: 'The type of information being stored',
|
|
85
88
|
},
|
|
86
89
|
},
|
|
@@ -118,6 +121,223 @@ export class RememberTool {
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
// ============================================================================
|
|
124
|
+
// replace_memory
|
|
125
|
+
// ============================================================================
|
|
126
|
+
export class ReplaceMemoryTool {
|
|
127
|
+
name = 'replace_memory';
|
|
128
|
+
description = 'Replace an existing persistent memory entry. Use when a stored fact is obsolete or too verbose and must be rewritten under the memory char budget.';
|
|
129
|
+
async execute(input) {
|
|
130
|
+
const mm = getMemoryManager();
|
|
131
|
+
let key = input.key;
|
|
132
|
+
let value = input.value;
|
|
133
|
+
let scope = input.scope ?? 'project';
|
|
134
|
+
let category = input.category;
|
|
135
|
+
try {
|
|
136
|
+
const hookResult = await executeHermesLifecycleHook(process.cwd(), 'before_memory_write', {
|
|
137
|
+
toolName: this.name,
|
|
138
|
+
toolInput: { key, value, scope, category },
|
|
139
|
+
memoryKey: key,
|
|
140
|
+
memoryValue: value,
|
|
141
|
+
memoryScope: scope,
|
|
142
|
+
memoryCategory: category,
|
|
143
|
+
});
|
|
144
|
+
if (!hookResult.allowed) {
|
|
145
|
+
return {
|
|
146
|
+
success: false,
|
|
147
|
+
error: hookResult.feedback ?? 'Memory replacement blocked by BeforeMemoryWrite hook.',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (hookResult.updatedInput) {
|
|
151
|
+
key = typeof hookResult.updatedInput.key === 'string' ? hookResult.updatedInput.key : key;
|
|
152
|
+
value = typeof hookResult.updatedInput.value === 'string' ? hookResult.updatedInput.value : value;
|
|
153
|
+
scope = hookResult.updatedInput.scope === 'user' || hookResult.updatedInput.scope === 'project'
|
|
154
|
+
? hookResult.updatedInput.scope
|
|
155
|
+
: scope;
|
|
156
|
+
category = typeof hookResult.updatedInput.category === 'string'
|
|
157
|
+
? hookResult.updatedInput.category
|
|
158
|
+
: category;
|
|
159
|
+
}
|
|
160
|
+
const result = await mm.replace(key, value, { scope, category });
|
|
161
|
+
if (result.status === 'missing') {
|
|
162
|
+
return {
|
|
163
|
+
success: true,
|
|
164
|
+
output: result.message,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
success: true,
|
|
169
|
+
output: `${result.message} Usage: ${result.usage.used}/${result.usage.limit} chars (${result.usage.percent}%).`,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
return {
|
|
174
|
+
success: false,
|
|
175
|
+
error: `Failed to replace memory: ${err instanceof Error ? err.message : String(err)}`,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
getSchema() {
|
|
180
|
+
return {
|
|
181
|
+
name: this.name,
|
|
182
|
+
description: this.description,
|
|
183
|
+
parameters: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
properties: {
|
|
186
|
+
key: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
description: 'Existing memory key to replace',
|
|
189
|
+
},
|
|
190
|
+
value: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
description: 'New concise memory value',
|
|
193
|
+
},
|
|
194
|
+
scope: {
|
|
195
|
+
type: 'string',
|
|
196
|
+
enum: ['project', 'user'],
|
|
197
|
+
description: 'Memory scope to replace in (default: project)',
|
|
198
|
+
},
|
|
199
|
+
category: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
enum: ['project', 'preferences', 'decisions', 'patterns', 'context', 'custom'],
|
|
202
|
+
description: 'Optional replacement category',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ['key', 'value'],
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
validate(input) {
|
|
210
|
+
if (typeof input !== 'object' || input === null) {
|
|
211
|
+
return { valid: false, errors: ['Input must be an object'] };
|
|
212
|
+
}
|
|
213
|
+
const data = input;
|
|
214
|
+
if (typeof data.key !== 'string' || !data.key.trim()) {
|
|
215
|
+
return { valid: false, errors: ['key must be a non-empty string'] };
|
|
216
|
+
}
|
|
217
|
+
if (typeof data.value !== 'string' || !data.value.trim()) {
|
|
218
|
+
return { valid: false, errors: ['value must be a non-empty string'] };
|
|
219
|
+
}
|
|
220
|
+
return { valid: true };
|
|
221
|
+
}
|
|
222
|
+
getMetadata() {
|
|
223
|
+
return {
|
|
224
|
+
name: this.name,
|
|
225
|
+
description: this.description,
|
|
226
|
+
category: 'utility',
|
|
227
|
+
keywords: ['memory', 'replace', 'rewrite', 'update', 'persist', 'preference'],
|
|
228
|
+
priority: 5,
|
|
229
|
+
requiresConfirmation: false,
|
|
230
|
+
modifiesFiles: true,
|
|
231
|
+
makesNetworkRequests: false,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
isAvailable() {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
// ============================================================================
|
|
239
|
+
// memory_propose
|
|
240
|
+
// ============================================================================
|
|
241
|
+
export class MemoryProposeTool {
|
|
242
|
+
name = 'memory_propose';
|
|
243
|
+
description = 'Propose a long-term memory candidate for human review. Use this instead of remember when the fact is inferred, ambiguous, or should not be silently injected into future prompts.';
|
|
244
|
+
async execute(input) {
|
|
245
|
+
const key = input.key;
|
|
246
|
+
const value = input.value;
|
|
247
|
+
const scope = input.scope ?? 'project';
|
|
248
|
+
const category = input.category ?? 'context';
|
|
249
|
+
const confidence = typeof input.confidence === 'number' ? input.confidence : undefined;
|
|
250
|
+
const rationale = typeof input.rationale === 'string' ? input.rationale : undefined;
|
|
251
|
+
try {
|
|
252
|
+
const { candidate, deduped } = getMemoryCandidateQueue(process.cwd()).propose({
|
|
253
|
+
key,
|
|
254
|
+
value,
|
|
255
|
+
scope,
|
|
256
|
+
category,
|
|
257
|
+
source: 'self_observed',
|
|
258
|
+
...(confidence !== undefined ? { confidence } : {}),
|
|
259
|
+
...(rationale ? { rationale } : {}),
|
|
260
|
+
});
|
|
261
|
+
return {
|
|
262
|
+
success: true,
|
|
263
|
+
output: `${deduped ? 'Matched existing pending' : 'Proposed'} memory candidate ${candidate.id} (${candidate.scope}/${candidate.category}). Approve with: /memory accept ${candidate.id}`,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
catch (err) {
|
|
267
|
+
return {
|
|
268
|
+
success: false,
|
|
269
|
+
error: `memory_propose failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
getSchema() {
|
|
274
|
+
return {
|
|
275
|
+
name: this.name,
|
|
276
|
+
description: this.description,
|
|
277
|
+
parameters: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
key: {
|
|
281
|
+
type: 'string',
|
|
282
|
+
description: 'Short kebab-case key for the memory candidate',
|
|
283
|
+
},
|
|
284
|
+
value: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
description: 'Concise candidate memory value',
|
|
287
|
+
},
|
|
288
|
+
scope: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
enum: ['project', 'user'],
|
|
291
|
+
description: 'Candidate scope (default: project)',
|
|
292
|
+
},
|
|
293
|
+
category: {
|
|
294
|
+
type: 'string',
|
|
295
|
+
enum: ['project', 'preferences', 'decisions', 'patterns', 'context', 'custom'],
|
|
296
|
+
description: 'Candidate category',
|
|
297
|
+
},
|
|
298
|
+
confidence: {
|
|
299
|
+
type: 'number',
|
|
300
|
+
description: 'Confidence from 0 to 1',
|
|
301
|
+
},
|
|
302
|
+
rationale: {
|
|
303
|
+
type: 'string',
|
|
304
|
+
description: 'Short evidence note for reviewer',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
required: ['key', 'value'],
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
validate(input) {
|
|
312
|
+
if (typeof input !== 'object' || input === null) {
|
|
313
|
+
return { valid: false, errors: ['Input must be an object'] };
|
|
314
|
+
}
|
|
315
|
+
const data = input;
|
|
316
|
+
if (typeof data.key !== 'string' || !data.key.trim()) {
|
|
317
|
+
return { valid: false, errors: ['key must be a non-empty string'] };
|
|
318
|
+
}
|
|
319
|
+
if (typeof data.value !== 'string' || !data.value.trim()) {
|
|
320
|
+
return { valid: false, errors: ['value must be a non-empty string'] };
|
|
321
|
+
}
|
|
322
|
+
return { valid: true };
|
|
323
|
+
}
|
|
324
|
+
getMetadata() {
|
|
325
|
+
return {
|
|
326
|
+
name: this.name,
|
|
327
|
+
description: this.description,
|
|
328
|
+
category: 'utility',
|
|
329
|
+
keywords: ['memory', 'candidate', 'propose', 'review', 'long-term', 'persist'],
|
|
330
|
+
priority: 5,
|
|
331
|
+
requiresConfirmation: false,
|
|
332
|
+
modifiesFiles: true,
|
|
333
|
+
makesNetworkRequests: false,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
isAvailable() {
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
// ============================================================================
|
|
121
341
|
// recall
|
|
122
342
|
// ============================================================================
|
|
123
343
|
export class RecallTool {
|
|
@@ -267,6 +487,8 @@ export class ForgetTool {
|
|
|
267
487
|
export function createMemoryTools() {
|
|
268
488
|
return [
|
|
269
489
|
new RememberTool(),
|
|
490
|
+
new ReplaceMemoryTool(),
|
|
491
|
+
new MemoryProposeTool(),
|
|
270
492
|
new RecallTool(),
|
|
271
493
|
new ForgetTool(),
|
|
272
494
|
];
|
|
@@ -221,7 +221,7 @@ export class TextToSpeechTool {
|
|
|
221
221
|
},
|
|
222
222
|
provider: {
|
|
223
223
|
type: 'string',
|
|
224
|
-
enum: ['auto', 'system', 'edge-tts', 'espeak', 'say', '
|
|
224
|
+
enum: ['auto', 'system', 'edge-tts', 'espeak', 'say', 'audioreader'],
|
|
225
225
|
description: 'TTS provider. auto detects a local provider; system uses Windows SAPI.',
|
|
226
226
|
},
|
|
227
227
|
voice: {
|
|
@@ -1104,7 +1104,7 @@ function optionalProvider(value) {
|
|
|
1104
1104
|
if (typeof value !== 'string' || !value.trim())
|
|
1105
1105
|
return undefined;
|
|
1106
1106
|
const provider = value.trim();
|
|
1107
|
-
if (['auto', 'system', 'edge-tts', 'espeak', 'say', '
|
|
1107
|
+
if (['auto', 'system', 'edge-tts', 'espeak', 'say', 'audioreader'].includes(provider)) {
|
|
1108
1108
|
return provider;
|
|
1109
1109
|
}
|
|
1110
1110
|
throw new Error(`Unsupported text_to_speech provider: ${provider}`);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { ToolResult } from '../../types/index.js';
|
|
7
7
|
import type { ITool, ToolSchema, IToolMetadata, IValidationResult, IToolExecutionContext } from './types.js';
|
|
8
8
|
import { type VisionAnalysisOptions } from '../vision/vision-analysis.js';
|
|
9
|
+
import { captureCameraSnapshot } from '../../companion/camera.js';
|
|
9
10
|
export declare class VisionAnalyzeTool implements ITool {
|
|
10
11
|
private readonly options;
|
|
11
12
|
readonly name = "vision_analyze";
|
|
@@ -29,6 +30,7 @@ export declare class BrowserVisionTool implements ITool {
|
|
|
29
30
|
getMetadata(): IToolMetadata;
|
|
30
31
|
isAvailable(): boolean;
|
|
31
32
|
dispose(): Promise<void>;
|
|
33
|
+
private captureScreenshotWithRetry;
|
|
32
34
|
}
|
|
33
35
|
export declare class OcrExtractTool implements ITool {
|
|
34
36
|
readonly name = "ocr_extract";
|
|
@@ -57,4 +59,35 @@ export declare class CameraSnapshotTool implements ITool {
|
|
|
57
59
|
getMetadata(): IToolMetadata;
|
|
58
60
|
isAvailable(): boolean;
|
|
59
61
|
}
|
|
62
|
+
export interface CameraAnalyzeRuntime {
|
|
63
|
+
/** Injected for tests; defaults to global fetch. */
|
|
64
|
+
fetch?: typeof fetch;
|
|
65
|
+
/** Injected for tests; defaults to companion captureCameraSnapshot. */
|
|
66
|
+
captureSnapshot?: typeof captureCameraSnapshot;
|
|
67
|
+
/** Injected for tests; defaults to process.env. */
|
|
68
|
+
env?: NodeJS.ProcessEnv;
|
|
69
|
+
}
|
|
70
|
+
export declare class CameraAnalyzeTool implements ITool {
|
|
71
|
+
private readonly options;
|
|
72
|
+
private readonly runtime;
|
|
73
|
+
readonly name = "camera_analyze";
|
|
74
|
+
readonly description = "Capture one local webcam frame and return a natural-language description from a local multimodal vision model (default Ollama gemma4:12b). Requires ffmpeg, OS camera permission, and a reachable local vision model.";
|
|
75
|
+
constructor(options?: VisionAnalysisOptions, runtime?: CameraAnalyzeRuntime);
|
|
76
|
+
execute(input: Record<string, unknown>, context?: IToolExecutionContext): Promise<ToolResult>;
|
|
77
|
+
private describeImage;
|
|
78
|
+
getSchema(): ToolSchema;
|
|
79
|
+
validate(input: unknown): IValidationResult;
|
|
80
|
+
getMetadata(): IToolMetadata;
|
|
81
|
+
isAvailable(): boolean;
|
|
82
|
+
}
|
|
60
83
|
export declare function createVisionTools(options?: VisionAnalysisOptions): ITool[];
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the Ollama OpenAI-compatible chat endpoint, honoring OLLAMA_HOST.
|
|
86
|
+
* OLLAMA_HOST is typically `host:port` with no scheme and no /v1 path.
|
|
87
|
+
*/
|
|
88
|
+
export declare function resolveOllamaChatEndpoint(env: NodeJS.ProcessEnv): string;
|
|
89
|
+
/**
|
|
90
|
+
* Extract assistant text from an OpenAI-compatible chat completion. The
|
|
91
|
+
* `content` field may be a plain string or an array of typed parts.
|
|
92
|
+
*/
|
|
93
|
+
export declare function extractCompletionText(response: unknown): string | undefined;
|