qlogicagent 0.1.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 +45 -0
- package/dist/agent/agent.d.ts +44 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +114 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/tool-loop.d.ts +65 -0
- package/dist/agent/tool-loop.d.ts.map +1 -0
- package/dist/agent/tool-loop.js +576 -0
- package/dist/agent/tool-loop.js.map +1 -0
- package/dist/agent/types.d.ts +176 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +15 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +24 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/stdio-server.d.ts +46 -0
- package/dist/cli/stdio-server.d.ts.map +1 -0
- package/dist/cli/stdio-server.js +464 -0
- package/dist/cli/stdio-server.js.map +1 -0
- package/dist/config/config.d.ts +18 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +22 -0
- package/dist/config/config.js.map +1 -0
- package/dist/contracts/hooks.d.ts +121 -0
- package/dist/contracts/hooks.d.ts.map +1 -0
- package/dist/contracts/hooks.js +8 -0
- package/dist/contracts/hooks.js.map +1 -0
- package/dist/contracts/index.d.ts +11 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +11 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/planner.d.ts +36 -0
- package/dist/contracts/planner.d.ts.map +1 -0
- package/dist/contracts/planner.js +3 -0
- package/dist/contracts/planner.js.map +1 -0
- package/dist/contracts/skill-candidate.d.ts +64 -0
- package/dist/contracts/skill-candidate.d.ts.map +1 -0
- package/dist/contracts/skill-candidate.js +196 -0
- package/dist/contracts/skill-candidate.js.map +1 -0
- package/dist/contracts/todo.d.ts +15 -0
- package/dist/contracts/todo.d.ts.map +1 -0
- package/dist/contracts/todo.js +10 -0
- package/dist/contracts/todo.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/builtin-providers.d.ts +11 -0
- package/dist/llm/builtin-providers.d.ts.map +1 -0
- package/dist/llm/builtin-providers.js +532 -0
- package/dist/llm/builtin-providers.js.map +1 -0
- package/dist/llm/index.d.ts +16 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +15 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/llm-client.d.ts +44 -0
- package/dist/llm/llm-client.d.ts.map +1 -0
- package/dist/llm/llm-client.js +68 -0
- package/dist/llm/llm-client.js.map +1 -0
- package/dist/llm/model-catalog.d.ts +54 -0
- package/dist/llm/model-catalog.d.ts.map +1 -0
- package/dist/llm/model-catalog.js +192 -0
- package/dist/llm/model-catalog.js.map +1 -0
- package/dist/llm/provider-def.d.ts +60 -0
- package/dist/llm/provider-def.d.ts.map +1 -0
- package/dist/llm/provider-def.js +13 -0
- package/dist/llm/provider-def.js.map +1 -0
- package/dist/llm/provider-registry.d.ts +55 -0
- package/dist/llm/provider-registry.d.ts.map +1 -0
- package/dist/llm/provider-registry.js +148 -0
- package/dist/llm/provider-registry.js.map +1 -0
- package/dist/llm/transport.d.ts +63 -0
- package/dist/llm/transport.d.ts.map +1 -0
- package/dist/llm/transport.js +28 -0
- package/dist/llm/transport.js.map +1 -0
- package/dist/llm/transports/anthropic-messages.d.ts +32 -0
- package/dist/llm/transports/anthropic-messages.d.ts.map +1 -0
- package/dist/llm/transports/anthropic-messages.js +294 -0
- package/dist/llm/transports/anthropic-messages.js.map +1 -0
- package/dist/llm/transports/openai-chat.d.ts +37 -0
- package/dist/llm/transports/openai-chat.d.ts.map +1 -0
- package/dist/llm/transports/openai-chat.js +166 -0
- package/dist/llm/transports/openai-chat.js.map +1 -0
- package/dist/orchestration/agent-registry.d.ts +42 -0
- package/dist/orchestration/agent-registry.d.ts.map +1 -0
- package/dist/orchestration/agent-registry.js +117 -0
- package/dist/orchestration/agent-registry.js.map +1 -0
- package/dist/orchestration/approval-aware-tool-plan.d.ts +33 -0
- package/dist/orchestration/approval-aware-tool-plan.d.ts.map +1 -0
- package/dist/orchestration/approval-aware-tool-plan.js +88 -0
- package/dist/orchestration/approval-aware-tool-plan.js.map +1 -0
- package/dist/orchestration/context-compression.d.ts +221 -0
- package/dist/orchestration/context-compression.d.ts.map +1 -0
- package/dist/orchestration/context-compression.js +584 -0
- package/dist/orchestration/context-compression.js.map +1 -0
- package/dist/orchestration/conversation-repair.d.ts +62 -0
- package/dist/orchestration/conversation-repair.d.ts.map +1 -0
- package/dist/orchestration/conversation-repair.js +430 -0
- package/dist/orchestration/conversation-repair.js.map +1 -0
- package/dist/orchestration/curator-scheduler.d.ts +120 -0
- package/dist/orchestration/curator-scheduler.d.ts.map +1 -0
- package/dist/orchestration/curator-scheduler.js +136 -0
- package/dist/orchestration/curator-scheduler.js.map +1 -0
- package/dist/orchestration/embedded-failover-policy.d.ts +111 -0
- package/dist/orchestration/embedded-failover-policy.d.ts.map +1 -0
- package/dist/orchestration/embedded-failover-policy.js +169 -0
- package/dist/orchestration/embedded-failover-policy.js.map +1 -0
- package/dist/orchestration/error-classification.d.ts +13 -0
- package/dist/orchestration/error-classification.d.ts.map +1 -0
- package/dist/orchestration/error-classification.js +78 -0
- package/dist/orchestration/error-classification.js.map +1 -0
- package/dist/orchestration/failover-classification.d.ts +9 -0
- package/dist/orchestration/failover-classification.d.ts.map +1 -0
- package/dist/orchestration/failover-classification.js +382 -0
- package/dist/orchestration/failover-classification.js.map +1 -0
- package/dist/orchestration/failover-error.d.ts +34 -0
- package/dist/orchestration/failover-error.d.ts.map +1 -0
- package/dist/orchestration/failover-error.js +199 -0
- package/dist/orchestration/failover-error.js.map +1 -0
- package/dist/orchestration/fork-subagent.d.ts +101 -0
- package/dist/orchestration/fork-subagent.d.ts.map +1 -0
- package/dist/orchestration/fork-subagent.js +99 -0
- package/dist/orchestration/fork-subagent.js.map +1 -0
- package/dist/orchestration/index.d.ts +121 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +268 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/memory-flush-policy.d.ts +58 -0
- package/dist/orchestration/memory-flush-policy.d.ts.map +1 -0
- package/dist/orchestration/memory-flush-policy.js +86 -0
- package/dist/orchestration/memory-flush-policy.js.map +1 -0
- package/dist/orchestration/memory-provider.d.ts +15 -0
- package/dist/orchestration/memory-provider.d.ts.map +1 -0
- package/dist/orchestration/memory-provider.js +3 -0
- package/dist/orchestration/memory-provider.js.map +1 -0
- package/dist/orchestration/parallel-tool-calls.d.ts +42 -0
- package/dist/orchestration/parallel-tool-calls.d.ts.map +1 -0
- package/dist/orchestration/parallel-tool-calls.js +60 -0
- package/dist/orchestration/parallel-tool-calls.js.map +1 -0
- package/dist/orchestration/prompt-cache-strategy.d.ts +127 -0
- package/dist/orchestration/prompt-cache-strategy.d.ts.map +1 -0
- package/dist/orchestration/prompt-cache-strategy.js +229 -0
- package/dist/orchestration/prompt-cache-strategy.js.map +1 -0
- package/dist/orchestration/reactive-compact.d.ts +74 -0
- package/dist/orchestration/reactive-compact.d.ts.map +1 -0
- package/dist/orchestration/reactive-compact.js +79 -0
- package/dist/orchestration/reactive-compact.js.map +1 -0
- package/dist/orchestration/retry-loop.d.ts +23 -0
- package/dist/orchestration/retry-loop.d.ts.map +1 -0
- package/dist/orchestration/retry-loop.js +25 -0
- package/dist/orchestration/retry-loop.js.map +1 -0
- package/dist/orchestration/skill-candidate.d.ts +53 -0
- package/dist/orchestration/skill-candidate.d.ts.map +1 -0
- package/dist/orchestration/skill-candidate.js +142 -0
- package/dist/orchestration/skill-candidate.js.map +1 -0
- package/dist/orchestration/skill-consolidation.d.ts +124 -0
- package/dist/orchestration/skill-consolidation.d.ts.map +1 -0
- package/dist/orchestration/skill-consolidation.js +221 -0
- package/dist/orchestration/skill-consolidation.js.map +1 -0
- package/dist/orchestration/skill-improvement.d.ts +60 -0
- package/dist/orchestration/skill-improvement.d.ts.map +1 -0
- package/dist/orchestration/skill-improvement.js +67 -0
- package/dist/orchestration/skill-improvement.js.map +1 -0
- package/dist/orchestration/skill-similarity.d.ts +99 -0
- package/dist/orchestration/skill-similarity.d.ts.map +1 -0
- package/dist/orchestration/skill-similarity.js +132 -0
- package/dist/orchestration/skill-similarity.js.map +1 -0
- package/dist/orchestration/streaming-tool-executor.d.ts +74 -0
- package/dist/orchestration/streaming-tool-executor.d.ts.map +1 -0
- package/dist/orchestration/streaming-tool-executor.js +97 -0
- package/dist/orchestration/streaming-tool-executor.js.map +1 -0
- package/dist/orchestration/team-orchestration.d.ts +196 -0
- package/dist/orchestration/team-orchestration.d.ts.map +1 -0
- package/dist/orchestration/team-orchestration.js +370 -0
- package/dist/orchestration/team-orchestration.js.map +1 -0
- package/dist/orchestration/team-tool-loop-wiring.d.ts +93 -0
- package/dist/orchestration/team-tool-loop-wiring.d.ts.map +1 -0
- package/dist/orchestration/team-tool-loop-wiring.js +148 -0
- package/dist/orchestration/team-tool-loop-wiring.js.map +1 -0
- package/dist/orchestration/tool-choice-policy.d.ts +55 -0
- package/dist/orchestration/tool-choice-policy.d.ts.map +1 -0
- package/dist/orchestration/tool-choice-policy.js +165 -0
- package/dist/orchestration/tool-choice-policy.js.map +1 -0
- package/dist/orchestration/tool-loop-state.d.ts +51 -0
- package/dist/orchestration/tool-loop-state.d.ts.map +1 -0
- package/dist/orchestration/tool-loop-state.js +134 -0
- package/dist/orchestration/tool-loop-state.js.map +1 -0
- package/dist/orchestration/tool-schema.d.ts +40 -0
- package/dist/orchestration/tool-schema.d.ts.map +1 -0
- package/dist/orchestration/tool-schema.js +298 -0
- package/dist/orchestration/tool-schema.js.map +1 -0
- package/dist/orchestration/transcript-repair.d.ts +43 -0
- package/dist/orchestration/transcript-repair.d.ts.map +1 -0
- package/dist/orchestration/transcript-repair.js +427 -0
- package/dist/orchestration/transcript-repair.js.map +1 -0
- package/dist/orchestration/turn-loop-guard.d.ts +87 -0
- package/dist/orchestration/turn-loop-guard.d.ts.map +1 -0
- package/dist/orchestration/turn-loop-guard.js +93 -0
- package/dist/orchestration/turn-loop-guard.js.map +1 -0
- package/dist/orchestration/web-browser-policy.d.ts +18 -0
- package/dist/orchestration/web-browser-policy.d.ts.map +1 -0
- package/dist/orchestration/web-browser-policy.js +40 -0
- package/dist/orchestration/web-browser-policy.js.map +1 -0
- package/dist/runtime/context-compression.d.ts +62 -0
- package/dist/runtime/context-compression.d.ts.map +1 -0
- package/dist/runtime/context-compression.js +275 -0
- package/dist/runtime/context-compression.js.map +1 -0
- package/dist/runtime/hook-registry.d.ts +13 -0
- package/dist/runtime/hook-registry.d.ts.map +1 -0
- package/dist/runtime/hook-registry.js +54 -0
- package/dist/runtime/hook-registry.js.map +1 -0
- package/dist/runtime/memory-hooks.d.ts +24 -0
- package/dist/runtime/memory-hooks.d.ts.map +1 -0
- package/dist/runtime/memory-hooks.js +66 -0
- package/dist/runtime/memory-hooks.js.map +1 -0
- package/dist/runtime/tool-eligibility.d.ts +60 -0
- package/dist/runtime/tool-eligibility.d.ts.map +1 -0
- package/dist/runtime/tool-eligibility.js +112 -0
- package/dist/runtime/tool-eligibility.js.map +1 -0
- package/dist/skills/index.d.ts +109 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +83 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/memory-extractor.d.ts +65 -0
- package/dist/skills/memory-extractor.d.ts.map +1 -0
- package/dist/skills/memory-extractor.js +174 -0
- package/dist/skills/memory-extractor.js.map +1 -0
- package/dist/skills/memory-query-tool.d.ts +44 -0
- package/dist/skills/memory-query-tool.d.ts.map +1 -0
- package/dist/skills/memory-query-tool.js +128 -0
- package/dist/skills/memory-query-tool.js.map +1 -0
- package/dist/skills/memory-store.d.ts +67 -0
- package/dist/skills/memory-store.d.ts.map +1 -0
- package/dist/skills/memory-store.js +229 -0
- package/dist/skills/memory-store.js.map +1 -0
- package/dist/skills/memory-tool.d.ts +68 -0
- package/dist/skills/memory-tool.d.ts.map +1 -0
- package/dist/skills/memory-tool.js +193 -0
- package/dist/skills/memory-tool.js.map +1 -0
- package/dist/skills/portable-tool.d.ts +72 -0
- package/dist/skills/portable-tool.d.ts.map +1 -0
- package/dist/skills/portable-tool.js +15 -0
- package/dist/skills/portable-tool.js.map +1 -0
- package/dist/skills/qmemory-adapter.d.ts +53 -0
- package/dist/skills/qmemory-adapter.d.ts.map +1 -0
- package/dist/skills/qmemory-adapter.js +166 -0
- package/dist/skills/qmemory-adapter.js.map +1 -0
- package/dist/skills/skill-frontmatter.d.ts +20 -0
- package/dist/skills/skill-frontmatter.d.ts.map +1 -0
- package/dist/skills/skill-frontmatter.js +345 -0
- package/dist/skills/skill-frontmatter.js.map +1 -0
- package/dist/skills/skill-guard.d.ts +24 -0
- package/dist/skills/skill-guard.d.ts.map +1 -0
- package/dist/skills/skill-guard.js +230 -0
- package/dist/skills/skill-guard.js.map +1 -0
- package/dist/skills/skill-loader.d.ts +17 -0
- package/dist/skills/skill-loader.d.ts.map +1 -0
- package/dist/skills/skill-loader.js +304 -0
- package/dist/skills/skill-loader.js.map +1 -0
- package/dist/skills/skill-source.d.ts +120 -0
- package/dist/skills/skill-source.d.ts.map +1 -0
- package/dist/skills/skill-source.js +127 -0
- package/dist/skills/skill-source.js.map +1 -0
- package/dist/skills/skill-types.d.ts +200 -0
- package/dist/skills/skill-types.d.ts.map +1 -0
- package/dist/skills/skill-types.js +7 -0
- package/dist/skills/skill-types.js.map +1 -0
- package/dist/skills/think-tool.d.ts +17 -0
- package/dist/skills/think-tool.d.ts.map +1 -0
- package/dist/skills/think-tool.js +60 -0
- package/dist/skills/think-tool.js.map +1 -0
- package/dist/skills/todo-tool.d.ts +64 -0
- package/dist/skills/todo-tool.d.ts.map +1 -0
- package/dist/skills/todo-tool.js +115 -0
- package/dist/skills/todo-tool.js.map +1 -0
- package/dist/skills/tools/agent-tool.d.ts +92 -0
- package/dist/skills/tools/agent-tool.d.ts.map +1 -0
- package/dist/skills/tools/agent-tool.js +143 -0
- package/dist/skills/tools/agent-tool.js.map +1 -0
- package/dist/skills/tools/apply-patch-tool.d.ts +30 -0
- package/dist/skills/tools/apply-patch-tool.d.ts.map +1 -0
- package/dist/skills/tools/apply-patch-tool.js +185 -0
- package/dist/skills/tools/apply-patch-tool.js.map +1 -0
- package/dist/skills/tools/ask-user-tool.d.ts +81 -0
- package/dist/skills/tools/ask-user-tool.d.ts.map +1 -0
- package/dist/skills/tools/ask-user-tool.js +122 -0
- package/dist/skills/tools/ask-user-tool.js.map +1 -0
- package/dist/skills/tools/brief-tool.d.ts +75 -0
- package/dist/skills/tools/brief-tool.d.ts.map +1 -0
- package/dist/skills/tools/brief-tool.js +96 -0
- package/dist/skills/tools/brief-tool.js.map +1 -0
- package/dist/skills/tools/browser-tool.d.ts +115 -0
- package/dist/skills/tools/browser-tool.d.ts.map +1 -0
- package/dist/skills/tools/browser-tool.js +156 -0
- package/dist/skills/tools/browser-tool.js.map +1 -0
- package/dist/skills/tools/checkpoint-tool.d.ts +67 -0
- package/dist/skills/tools/checkpoint-tool.d.ts.map +1 -0
- package/dist/skills/tools/checkpoint-tool.js +103 -0
- package/dist/skills/tools/checkpoint-tool.js.map +1 -0
- package/dist/skills/tools/config-tool.d.ts +64 -0
- package/dist/skills/tools/config-tool.d.ts.map +1 -0
- package/dist/skills/tools/config-tool.js +144 -0
- package/dist/skills/tools/config-tool.js.map +1 -0
- package/dist/skills/tools/cron-tool.d.ts +117 -0
- package/dist/skills/tools/cron-tool.d.ts.map +1 -0
- package/dist/skills/tools/cron-tool.js +176 -0
- package/dist/skills/tools/cron-tool.js.map +1 -0
- package/dist/skills/tools/edit-tool.d.ts +44 -0
- package/dist/skills/tools/edit-tool.d.ts.map +1 -0
- package/dist/skills/tools/edit-tool.js +71 -0
- package/dist/skills/tools/edit-tool.js.map +1 -0
- package/dist/skills/tools/exec-tool.d.ts +103 -0
- package/dist/skills/tools/exec-tool.d.ts.map +1 -0
- package/dist/skills/tools/exec-tool.js +134 -0
- package/dist/skills/tools/exec-tool.js.map +1 -0
- package/dist/skills/tools/image-generate-tool.d.ts +63 -0
- package/dist/skills/tools/image-generate-tool.d.ts.map +1 -0
- package/dist/skills/tools/image-generate-tool.js +68 -0
- package/dist/skills/tools/image-generate-tool.js.map +1 -0
- package/dist/skills/tools/instructions-tool.d.ts +104 -0
- package/dist/skills/tools/instructions-tool.d.ts.map +1 -0
- package/dist/skills/tools/instructions-tool.js +188 -0
- package/dist/skills/tools/instructions-tool.js.map +1 -0
- package/dist/skills/tools/lsp-tool.d.ts +154 -0
- package/dist/skills/tools/lsp-tool.d.ts.map +1 -0
- package/dist/skills/tools/lsp-tool.js +228 -0
- package/dist/skills/tools/lsp-tool.js.map +1 -0
- package/dist/skills/tools/mcp-client-types.d.ts +270 -0
- package/dist/skills/tools/mcp-client-types.d.ts.map +1 -0
- package/dist/skills/tools/mcp-client-types.js +54 -0
- package/dist/skills/tools/mcp-client-types.js.map +1 -0
- package/dist/skills/tools/mcp-tool.d.ts +250 -0
- package/dist/skills/tools/mcp-tool.d.ts.map +1 -0
- package/dist/skills/tools/mcp-tool.js +504 -0
- package/dist/skills/tools/mcp-tool.js.map +1 -0
- package/dist/skills/tools/memory-tool.d.ts +75 -0
- package/dist/skills/tools/memory-tool.d.ts.map +1 -0
- package/dist/skills/tools/memory-tool.js +89 -0
- package/dist/skills/tools/memory-tool.js.map +1 -0
- package/dist/skills/tools/monitor-tool.d.ts +114 -0
- package/dist/skills/tools/monitor-tool.d.ts.map +1 -0
- package/dist/skills/tools/monitor-tool.js +132 -0
- package/dist/skills/tools/monitor-tool.js.map +1 -0
- package/dist/skills/tools/music-generate-tool.d.ts +56 -0
- package/dist/skills/tools/music-generate-tool.d.ts.map +1 -0
- package/dist/skills/tools/music-generate-tool.js +63 -0
- package/dist/skills/tools/music-generate-tool.js.map +1 -0
- package/dist/skills/tools/notify-tool.d.ts +54 -0
- package/dist/skills/tools/notify-tool.d.ts.map +1 -0
- package/dist/skills/tools/notify-tool.js +63 -0
- package/dist/skills/tools/notify-tool.js.map +1 -0
- package/dist/skills/tools/patch-tool.d.ts +46 -0
- package/dist/skills/tools/patch-tool.d.ts.map +1 -0
- package/dist/skills/tools/patch-tool.js +506 -0
- package/dist/skills/tools/patch-tool.js.map +1 -0
- package/dist/skills/tools/pdf-tool.d.ts +67 -0
- package/dist/skills/tools/pdf-tool.d.ts.map +1 -0
- package/dist/skills/tools/pdf-tool.js +89 -0
- package/dist/skills/tools/pdf-tool.js.map +1 -0
- package/dist/skills/tools/plan-mode-tool.d.ts +60 -0
- package/dist/skills/tools/plan-mode-tool.d.ts.map +1 -0
- package/dist/skills/tools/plan-mode-tool.js +123 -0
- package/dist/skills/tools/plan-mode-tool.js.map +1 -0
- package/dist/skills/tools/read-tool.d.ts +52 -0
- package/dist/skills/tools/read-tool.d.ts.map +1 -0
- package/dist/skills/tools/read-tool.js +85 -0
- package/dist/skills/tools/read-tool.js.map +1 -0
- package/dist/skills/tools/repl-tool.d.ts +71 -0
- package/dist/skills/tools/repl-tool.d.ts.map +1 -0
- package/dist/skills/tools/repl-tool.js +70 -0
- package/dist/skills/tools/repl-tool.js.map +1 -0
- package/dist/skills/tools/search-tool.d.ts +113 -0
- package/dist/skills/tools/search-tool.d.ts.map +1 -0
- package/dist/skills/tools/search-tool.js +226 -0
- package/dist/skills/tools/search-tool.js.map +1 -0
- package/dist/skills/tools/send-message-tool.d.ts +52 -0
- package/dist/skills/tools/send-message-tool.d.ts.map +1 -0
- package/dist/skills/tools/send-message-tool.js +77 -0
- package/dist/skills/tools/send-message-tool.js.map +1 -0
- package/dist/skills/tools/skill-list-tool.d.ts +34 -0
- package/dist/skills/tools/skill-list-tool.d.ts.map +1 -0
- package/dist/skills/tools/skill-list-tool.js +55 -0
- package/dist/skills/tools/skill-list-tool.js.map +1 -0
- package/dist/skills/tools/skill-manage-tool.d.ts +74 -0
- package/dist/skills/tools/skill-manage-tool.d.ts.map +1 -0
- package/dist/skills/tools/skill-manage-tool.js +154 -0
- package/dist/skills/tools/skill-manage-tool.js.map +1 -0
- package/dist/skills/tools/skill-view-tool.d.ts +38 -0
- package/dist/skills/tools/skill-view-tool.d.ts.map +1 -0
- package/dist/skills/tools/skill-view-tool.js +73 -0
- package/dist/skills/tools/skill-view-tool.js.map +1 -0
- package/dist/skills/tools/sleep-tool.d.ts +50 -0
- package/dist/skills/tools/sleep-tool.d.ts.map +1 -0
- package/dist/skills/tools/sleep-tool.js +82 -0
- package/dist/skills/tools/sleep-tool.js.map +1 -0
- package/dist/skills/tools/structured-output-tool.d.ts +117 -0
- package/dist/skills/tools/structured-output-tool.d.ts.map +1 -0
- package/dist/skills/tools/structured-output-tool.js +177 -0
- package/dist/skills/tools/structured-output-tool.js.map +1 -0
- package/dist/skills/tools/task-tool.d.ts +105 -0
- package/dist/skills/tools/task-tool.d.ts.map +1 -0
- package/dist/skills/tools/task-tool.js +162 -0
- package/dist/skills/tools/task-tool.js.map +1 -0
- package/dist/skills/tools/team-tool.d.ts +90 -0
- package/dist/skills/tools/team-tool.d.ts.map +1 -0
- package/dist/skills/tools/team-tool.js +106 -0
- package/dist/skills/tools/team-tool.js.map +1 -0
- package/dist/skills/tools/tool-search-tool.d.ts +52 -0
- package/dist/skills/tools/tool-search-tool.d.ts.map +1 -0
- package/dist/skills/tools/tool-search-tool.js +111 -0
- package/dist/skills/tools/tool-search-tool.js.map +1 -0
- package/dist/skills/tools/tts-tool.d.ts +39 -0
- package/dist/skills/tools/tts-tool.d.ts.map +1 -0
- package/dist/skills/tools/tts-tool.js +46 -0
- package/dist/skills/tools/tts-tool.js.map +1 -0
- package/dist/skills/tools/video-edit-tool.d.ts +70 -0
- package/dist/skills/tools/video-edit-tool.d.ts.map +1 -0
- package/dist/skills/tools/video-edit-tool.js +75 -0
- package/dist/skills/tools/video-edit-tool.js.map +1 -0
- package/dist/skills/tools/video-generate-tool.d.ts +63 -0
- package/dist/skills/tools/video-generate-tool.d.ts.map +1 -0
- package/dist/skills/tools/video-generate-tool.js +67 -0
- package/dist/skills/tools/video-generate-tool.js.map +1 -0
- package/dist/skills/tools/video-merge-tool.d.ts +106 -0
- package/dist/skills/tools/video-merge-tool.d.ts.map +1 -0
- package/dist/skills/tools/video-merge-tool.js +93 -0
- package/dist/skills/tools/video-merge-tool.js.map +1 -0
- package/dist/skills/tools/video-upscale-tool.d.ts +46 -0
- package/dist/skills/tools/video-upscale-tool.d.ts.map +1 -0
- package/dist/skills/tools/video-upscale-tool.js +53 -0
- package/dist/skills/tools/video-upscale-tool.js.map +1 -0
- package/dist/skills/tools/web-fetch-tool.d.ts +79 -0
- package/dist/skills/tools/web-fetch-tool.d.ts.map +1 -0
- package/dist/skills/tools/web-fetch-tool.js +93 -0
- package/dist/skills/tools/web-fetch-tool.js.map +1 -0
- package/dist/skills/tools/web-search-tool.d.ts +58 -0
- package/dist/skills/tools/web-search-tool.d.ts.map +1 -0
- package/dist/skills/tools/web-search-tool.js +87 -0
- package/dist/skills/tools/web-search-tool.js.map +1 -0
- package/dist/skills/tools/worktree-tool.d.ts +70 -0
- package/dist/skills/tools/worktree-tool.d.ts.map +1 -0
- package/dist/skills/tools/worktree-tool.js +148 -0
- package/dist/skills/tools/worktree-tool.js.map +1 -0
- package/dist/skills/tools/write-tool.d.ts +46 -0
- package/dist/skills/tools/write-tool.d.ts.map +1 -0
- package/dist/skills/tools/write-tool.js +82 -0
- package/dist/skills/tools/write-tool.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const BRIEF_TOOL_NAME: "send_user_message";
|
|
3
|
+
export type BriefMessageStatus = "normal" | "proactive";
|
|
4
|
+
export interface BriefAttachment {
|
|
5
|
+
/** Absolute or workspace-relative path */
|
|
6
|
+
path: string;
|
|
7
|
+
/** Size in bytes (filled by host) */
|
|
8
|
+
size?: number;
|
|
9
|
+
/** Whether the file is an image */
|
|
10
|
+
isImage?: boolean;
|
|
11
|
+
/** Upload UUID (host may upload for web preview) */
|
|
12
|
+
fileUuid?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BriefToolParams {
|
|
15
|
+
/** Markdown-formatted message to display to the user */
|
|
16
|
+
message: string;
|
|
17
|
+
/** File attachments to include with the message */
|
|
18
|
+
attachments?: string[];
|
|
19
|
+
/** Message status — 'proactive' for unsolicited updates */
|
|
20
|
+
status?: BriefMessageStatus;
|
|
21
|
+
}
|
|
22
|
+
export declare const BRIEF_TOOL_SCHEMA: {
|
|
23
|
+
readonly type: "object";
|
|
24
|
+
readonly properties: {
|
|
25
|
+
readonly message: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: string;
|
|
28
|
+
readonly minLength: 1;
|
|
29
|
+
};
|
|
30
|
+
readonly attachments: {
|
|
31
|
+
readonly type: "array";
|
|
32
|
+
readonly description: "Optional file paths to attach (images, documents, etc.).";
|
|
33
|
+
readonly items: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
};
|
|
36
|
+
readonly maxItems: 10;
|
|
37
|
+
};
|
|
38
|
+
readonly status: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly enum: readonly ["normal", "proactive"];
|
|
41
|
+
readonly description: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly required: readonly ["message"];
|
|
45
|
+
};
|
|
46
|
+
export interface BriefDeliveryResult {
|
|
47
|
+
delivered: boolean;
|
|
48
|
+
attachments?: BriefAttachment[];
|
|
49
|
+
sentAt?: string;
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Host-provided message delivery backend.
|
|
54
|
+
*/
|
|
55
|
+
export interface BriefToolDeps {
|
|
56
|
+
/** Deliver the message to the user's UI */
|
|
57
|
+
deliverMessage(params: {
|
|
58
|
+
message: string;
|
|
59
|
+
attachments?: string[];
|
|
60
|
+
status: BriefMessageStatus;
|
|
61
|
+
}): Promise<BriefDeliveryResult>;
|
|
62
|
+
/** Validate and resolve attachment paths. Returns resolved attachments or error. */
|
|
63
|
+
resolveAttachments?(paths: string[]): Promise<BriefAttachment[] | {
|
|
64
|
+
error: string;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
/** Check if brief mode is active (host determines this) */
|
|
68
|
+
export interface BriefModeConfig {
|
|
69
|
+
/** Whether the agent is in brief/chat mode */
|
|
70
|
+
isBriefMode: boolean;
|
|
71
|
+
/** Whether the user opted in via UI/CLI */
|
|
72
|
+
userOptIn?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export declare function createBriefTool(deps: BriefToolDeps): PortableTool<BriefToolParams>;
|
|
75
|
+
//# sourceMappingURL=brief-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/brief-tool.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAG,mBAA4B,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;CAyBpB,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,cAAc,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,kBAAkB,CAAC;KAC5B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC,oFAAoF;IACpF,kBAAkB,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtF;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC,eAAe,CAAC,CAiElF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Brief Tool — "SendUserMessage" equivalent from Claude Code.
|
|
3
|
+
//
|
|
4
|
+
// In brief/chat mode, agent output is not directly visible to
|
|
5
|
+
// the user. Only messages sent through this tool are displayed.
|
|
6
|
+
// This enables clean separation of internal reasoning vs
|
|
7
|
+
// user-facing communication.
|
|
8
|
+
//
|
|
9
|
+
// Reference: claude-code-haha/src/tools/BriefTool/BriefTool.ts
|
|
10
|
+
// Category: interaction
|
|
11
|
+
// ============================================================
|
|
12
|
+
export const BRIEF_TOOL_NAME = "send_user_message";
|
|
13
|
+
export const BRIEF_TOOL_SCHEMA = {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
message: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "The message to send to the user. Supports Markdown formatting. " +
|
|
19
|
+
"This is the ONLY way to communicate with the user in brief/chat mode.",
|
|
20
|
+
minLength: 1,
|
|
21
|
+
},
|
|
22
|
+
attachments: {
|
|
23
|
+
type: "array",
|
|
24
|
+
description: "Optional file paths to attach (images, documents, etc.).",
|
|
25
|
+
items: { type: "string" },
|
|
26
|
+
maxItems: 10,
|
|
27
|
+
},
|
|
28
|
+
status: {
|
|
29
|
+
type: "string",
|
|
30
|
+
enum: ["normal", "proactive"],
|
|
31
|
+
description: "Message status. Use 'proactive' when providing unsolicited information " +
|
|
32
|
+
"(e.g., monitoring alerts, task completion notifications).",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ["message"],
|
|
36
|
+
};
|
|
37
|
+
export function createBriefTool(deps) {
|
|
38
|
+
return {
|
|
39
|
+
name: BRIEF_TOOL_NAME,
|
|
40
|
+
label: "Send User Message",
|
|
41
|
+
description: "Send a message to the user. In brief/chat mode this is the ONLY way " +
|
|
42
|
+
"your messages are visible. Supports Markdown and file attachments. " +
|
|
43
|
+
"Use 'proactive' status for unsolicited updates (monitoring alerts, " +
|
|
44
|
+
"task completions). Keep messages concise and useful.",
|
|
45
|
+
parameters: BRIEF_TOOL_SCHEMA,
|
|
46
|
+
isConcurrencySafe: true,
|
|
47
|
+
isReadOnly: true,
|
|
48
|
+
searchHint: "send message user brief chat communicate display output",
|
|
49
|
+
execute: async (_toolCallId, params) => {
|
|
50
|
+
if (!params.message || params.message.trim().length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
content: [{ type: "text", text: "Error: message cannot be empty." }],
|
|
53
|
+
details: { type: "brief", error: "empty_message" },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Resolve attachments if provided
|
|
57
|
+
let resolvedAttachments;
|
|
58
|
+
if (params.attachments && params.attachments.length > 0) {
|
|
59
|
+
if (deps.resolveAttachments) {
|
|
60
|
+
const resolved = await deps.resolveAttachments(params.attachments);
|
|
61
|
+
if ("error" in resolved) {
|
|
62
|
+
return {
|
|
63
|
+
content: [{ type: "text", text: `Attachment error: ${resolved.error}` }],
|
|
64
|
+
details: { type: "brief", error: "attachment_resolution_failed" },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
resolvedAttachments = resolved;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const status = params.status || "normal";
|
|
71
|
+
const result = await deps.deliverMessage({
|
|
72
|
+
message: params.message.trim(),
|
|
73
|
+
attachments: params.attachments,
|
|
74
|
+
status,
|
|
75
|
+
});
|
|
76
|
+
if (!result.delivered) {
|
|
77
|
+
return {
|
|
78
|
+
content: [{ type: "text", text: `Message delivery failed: ${result.error || "unknown error"}` }],
|
|
79
|
+
details: { type: "brief", delivered: false, error: result.error },
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// Minimal confirmation — avoids re-echoing message in context (saves tokens)
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: "text", text: "Message delivered to user." }],
|
|
85
|
+
details: {
|
|
86
|
+
type: "brief",
|
|
87
|
+
delivered: true,
|
|
88
|
+
status,
|
|
89
|
+
hasAttachments: (resolvedAttachments?.length ?? 0) > 0,
|
|
90
|
+
sentAt: result.sentAt,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=brief-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/brief-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,8DAA8D;AAC9D,EAAE;AACF,8DAA8D;AAC9D,gEAAgE;AAChE,yDAAyD;AACzD,6BAA6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A6E;YAC7E,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC;gBAC/D,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,IAAI;oBACf,MAAM;oBACN,cAAc,EAAE,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;oBACtD,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const BROWSER_TOOL_NAME: "browser";
|
|
3
|
+
export type BrowserAction = "navigate" | "click" | "type" | "scroll" | "snapshot" | "screenshot" | "console" | "cdp";
|
|
4
|
+
export interface BrowserToolParams {
|
|
5
|
+
/** Browser action to perform */
|
|
6
|
+
action: BrowserAction;
|
|
7
|
+
/** URL for navigate action */
|
|
8
|
+
url?: string;
|
|
9
|
+
/** Element reference (e.g. "@e5") for click/type actions */
|
|
10
|
+
ref?: string;
|
|
11
|
+
/** Text to type */
|
|
12
|
+
text?: string;
|
|
13
|
+
/** Scroll direction */
|
|
14
|
+
direction?: "up" | "down" | "left" | "right";
|
|
15
|
+
/** CDP method name for raw cdp action */
|
|
16
|
+
method?: string;
|
|
17
|
+
/** CDP params object */
|
|
18
|
+
params?: Record<string, unknown>;
|
|
19
|
+
/** JavaScript expression for console eval */
|
|
20
|
+
expression?: string;
|
|
21
|
+
/** Whether to include full accessibility tree */
|
|
22
|
+
full?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const BROWSER_TOOL_SCHEMA: {
|
|
25
|
+
readonly type: "object";
|
|
26
|
+
readonly properties: {
|
|
27
|
+
readonly action: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly enum: readonly ["navigate", "click", "type", "scroll", "snapshot", "screenshot", "console", "cdp"];
|
|
30
|
+
readonly description: string;
|
|
31
|
+
};
|
|
32
|
+
readonly url: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "URL to navigate to. Required for 'navigate' action.";
|
|
35
|
+
};
|
|
36
|
+
readonly ref: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "Element reference like \"@e5\" from a previous snapshot. Required for click/type.";
|
|
39
|
+
};
|
|
40
|
+
readonly text: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly description: "Text to type into the referenced element. Required for 'type' action.";
|
|
43
|
+
};
|
|
44
|
+
readonly direction: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly enum: readonly ["up", "down", "left", "right"];
|
|
47
|
+
readonly description: "Scroll direction. Required for 'scroll' action.";
|
|
48
|
+
};
|
|
49
|
+
readonly method: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly description: "CDP method name (e.g. 'Page.reload'). Required for 'cdp' action.";
|
|
52
|
+
};
|
|
53
|
+
readonly params: {
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly description: "Parameters for the CDP method. Optional for 'cdp' action.";
|
|
56
|
+
};
|
|
57
|
+
readonly expression: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly description: "JavaScript expression to evaluate. Used with 'console' action.";
|
|
60
|
+
};
|
|
61
|
+
readonly full: {
|
|
62
|
+
readonly type: "boolean";
|
|
63
|
+
readonly description: "Include full accessibility tree (default: compact). Used with 'snapshot'.";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly required: readonly ["action"];
|
|
67
|
+
};
|
|
68
|
+
export interface BrowserSnapshot {
|
|
69
|
+
elements: Array<{
|
|
70
|
+
ref: string;
|
|
71
|
+
role: string;
|
|
72
|
+
name: string;
|
|
73
|
+
text?: string;
|
|
74
|
+
}>;
|
|
75
|
+
url: string;
|
|
76
|
+
title: string;
|
|
77
|
+
}
|
|
78
|
+
export interface BrowserScreenshot {
|
|
79
|
+
base64: string;
|
|
80
|
+
mimeType: string;
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Host-provided browser automation backend.
|
|
86
|
+
* The host manages Chrome/Chromium lifecycle and CDP connections.
|
|
87
|
+
*/
|
|
88
|
+
export interface BrowserToolDeps {
|
|
89
|
+
navigate(url: string): Promise<{
|
|
90
|
+
snapshot: BrowserSnapshot;
|
|
91
|
+
}>;
|
|
92
|
+
click(ref: string): Promise<{
|
|
93
|
+
success: boolean;
|
|
94
|
+
error?: string;
|
|
95
|
+
}>;
|
|
96
|
+
type(ref: string, text: string): Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
error?: string;
|
|
99
|
+
}>;
|
|
100
|
+
scroll(direction: "up" | "down" | "left" | "right"): Promise<{
|
|
101
|
+
success: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
snapshot(full?: boolean): Promise<BrowserSnapshot>;
|
|
104
|
+
screenshot(): Promise<BrowserScreenshot>;
|
|
105
|
+
consoleEval(expression?: string): Promise<{
|
|
106
|
+
result?: string;
|
|
107
|
+
messages?: string[];
|
|
108
|
+
errors?: string[];
|
|
109
|
+
}>;
|
|
110
|
+
cdp(method: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
111
|
+
/** Validate URL safety (SSRF prevention). Returns error message if blocked, null if safe. */
|
|
112
|
+
validateUrl(url: string): string | null;
|
|
113
|
+
}
|
|
114
|
+
export declare function createBrowserTool(deps: BrowserToolDeps): PortableTool<BrowserToolParams>;
|
|
115
|
+
//# sourceMappingURL=browser-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/browser-tool.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,iBAAiB,EAAG,SAAkB,CAAC;AAE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
// ============================================================
|
|
2
|
+
// Browser Tool — CDP-based browser automation.
|
|
3
|
+
// Reference: hermes-agent-main/tools/browser_tool.py
|
|
4
|
+
// hermes-agent-main/tools/browser_cdp_tool.py
|
|
5
|
+
// Category: web
|
|
6
|
+
// ============================================================
|
|
7
|
+
export const BROWSER_TOOL_NAME = "browser";
|
|
8
|
+
export const BROWSER_TOOL_SCHEMA = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
action: {
|
|
12
|
+
type: "string",
|
|
13
|
+
enum: ["navigate", "click", "type", "scroll", "snapshot", "screenshot", "console", "cdp"],
|
|
14
|
+
description: "Browser action: navigate (go to URL), click (element by ref), type (text into element), " +
|
|
15
|
+
"scroll (direction), snapshot (accessibility tree), screenshot (visual capture), " +
|
|
16
|
+
"console (eval JS / read logs), cdp (raw CDP command).",
|
|
17
|
+
},
|
|
18
|
+
url: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "URL to navigate to. Required for 'navigate' action.",
|
|
21
|
+
},
|
|
22
|
+
ref: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: 'Element reference like "@e5" from a previous snapshot. Required for click/type.',
|
|
25
|
+
},
|
|
26
|
+
text: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Text to type into the referenced element. Required for 'type' action.",
|
|
29
|
+
},
|
|
30
|
+
direction: {
|
|
31
|
+
type: "string",
|
|
32
|
+
enum: ["up", "down", "left", "right"],
|
|
33
|
+
description: "Scroll direction. Required for 'scroll' action.",
|
|
34
|
+
},
|
|
35
|
+
method: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "CDP method name (e.g. 'Page.reload'). Required for 'cdp' action.",
|
|
38
|
+
},
|
|
39
|
+
params: {
|
|
40
|
+
type: "object",
|
|
41
|
+
description: "Parameters for the CDP method. Optional for 'cdp' action.",
|
|
42
|
+
},
|
|
43
|
+
expression: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "JavaScript expression to evaluate. Used with 'console' action.",
|
|
46
|
+
},
|
|
47
|
+
full: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Include full accessibility tree (default: compact). Used with 'snapshot'.",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ["action"],
|
|
53
|
+
};
|
|
54
|
+
export function createBrowserTool(deps) {
|
|
55
|
+
return {
|
|
56
|
+
name: BROWSER_TOOL_NAME,
|
|
57
|
+
label: "Browser",
|
|
58
|
+
description: "Control a headless browser via Chrome DevTools Protocol. " +
|
|
59
|
+
"Actions: navigate (URL), click/type (element refs from snapshot), " +
|
|
60
|
+
"scroll, snapshot (accessibility tree), screenshot (visual), " +
|
|
61
|
+
"console (JS eval/logs), cdp (raw CDP commands). " +
|
|
62
|
+
"Use snapshot to get element refs before click/type.",
|
|
63
|
+
parameters: BROWSER_TOOL_SCHEMA,
|
|
64
|
+
execute: async (_toolCallId, params) => {
|
|
65
|
+
switch (params.action) {
|
|
66
|
+
case "navigate": {
|
|
67
|
+
if (!params.url) {
|
|
68
|
+
return { content: [{ type: "text", text: "Error: url is required for navigate action." }], details: { type: "browser", error: "missing_url" } };
|
|
69
|
+
}
|
|
70
|
+
const blocked = deps.validateUrl(params.url);
|
|
71
|
+
if (blocked) {
|
|
72
|
+
return { content: [{ type: "text", text: `Blocked: ${blocked}` }], details: { type: "browser", error: "url_blocked" } };
|
|
73
|
+
}
|
|
74
|
+
const nav = await deps.navigate(params.url);
|
|
75
|
+
const lines = [`Navigated to: ${nav.snapshot.url}`, `Title: ${nav.snapshot.title}`, "", `Elements: ${nav.snapshot.elements.length}`];
|
|
76
|
+
if (nav.snapshot.elements.length <= 30) {
|
|
77
|
+
for (const e of nav.snapshot.elements) {
|
|
78
|
+
lines.push(` ${e.ref} [${e.role}] ${e.name}${e.text ? `: "${e.text}"` : ""}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
lines.push("(use snapshot action for full element list)");
|
|
83
|
+
}
|
|
84
|
+
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "browser", action: "navigate", url: params.url } };
|
|
85
|
+
}
|
|
86
|
+
case "click": {
|
|
87
|
+
if (!params.ref) {
|
|
88
|
+
return { content: [{ type: "text", text: "Error: ref is required for click (e.g. '@e5')." }], details: { type: "browser", error: "missing_ref" } };
|
|
89
|
+
}
|
|
90
|
+
const click = await deps.click(params.ref);
|
|
91
|
+
if (!click.success) {
|
|
92
|
+
return { content: [{ type: "text", text: `Click failed: ${click.error || "unknown"}` }], details: { type: "browser", error: "click_failed" } };
|
|
93
|
+
}
|
|
94
|
+
return { content: [{ type: "text", text: `Clicked ${params.ref}` }], details: { type: "browser", action: "click", ref: params.ref } };
|
|
95
|
+
}
|
|
96
|
+
case "type": {
|
|
97
|
+
if (!params.ref || !params.text) {
|
|
98
|
+
return { content: [{ type: "text", text: "Error: ref and text are required for type action." }], details: { type: "browser", error: "missing_params" } };
|
|
99
|
+
}
|
|
100
|
+
const typed = await deps.type(params.ref, params.text);
|
|
101
|
+
if (!typed.success) {
|
|
102
|
+
return { content: [{ type: "text", text: `Type failed: ${typed.error || "unknown"}` }], details: { type: "browser", error: "type_failed" } };
|
|
103
|
+
}
|
|
104
|
+
return { content: [{ type: "text", text: `Typed "${params.text}" into ${params.ref}` }], details: { type: "browser", action: "type", ref: params.ref } };
|
|
105
|
+
}
|
|
106
|
+
case "scroll": {
|
|
107
|
+
if (!params.direction) {
|
|
108
|
+
return { content: [{ type: "text", text: "Error: direction is required for scroll." }], details: { type: "browser", error: "missing_direction" } };
|
|
109
|
+
}
|
|
110
|
+
await deps.scroll(params.direction);
|
|
111
|
+
return { content: [{ type: "text", text: `Scrolled ${params.direction}` }], details: { type: "browser", action: "scroll", direction: params.direction } };
|
|
112
|
+
}
|
|
113
|
+
case "snapshot": {
|
|
114
|
+
const snap = await deps.snapshot(params.full);
|
|
115
|
+
const lines = [`URL: ${snap.url}`, `Title: ${snap.title}`, "", `Accessibility tree (${snap.elements.length} elements):`, ""];
|
|
116
|
+
for (const e of snap.elements) {
|
|
117
|
+
lines.push(`${e.ref} [${e.role}] ${e.name}${e.text ? ` — "${e.text}"` : ""}`);
|
|
118
|
+
}
|
|
119
|
+
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "browser", action: "snapshot", elementCount: snap.elements.length } };
|
|
120
|
+
}
|
|
121
|
+
case "screenshot": {
|
|
122
|
+
const shot = await deps.screenshot();
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: "image", data: shot.base64, mimeType: shot.mimeType }],
|
|
125
|
+
details: { type: "browser", action: "screenshot", width: shot.width, height: shot.height },
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
case "console": {
|
|
129
|
+
const c = await deps.consoleEval(params.expression);
|
|
130
|
+
const lines = [];
|
|
131
|
+
if (c.result !== undefined)
|
|
132
|
+
lines.push(`Result: ${c.result}`);
|
|
133
|
+
if (c.messages?.length) {
|
|
134
|
+
lines.push("Console messages:");
|
|
135
|
+
c.messages.forEach((m) => lines.push(` ${m}`));
|
|
136
|
+
}
|
|
137
|
+
if (c.errors?.length) {
|
|
138
|
+
lines.push("JS errors:");
|
|
139
|
+
c.errors.forEach((e) => lines.push(` ${e}`));
|
|
140
|
+
}
|
|
141
|
+
return { content: [{ type: "text", text: lines.join("\n") || "(no output)" }], details: { type: "browser", action: "console" } };
|
|
142
|
+
}
|
|
143
|
+
case "cdp": {
|
|
144
|
+
if (!params.method) {
|
|
145
|
+
return { content: [{ type: "text", text: "Error: method is required for cdp action." }], details: { type: "browser", error: "missing_method" } };
|
|
146
|
+
}
|
|
147
|
+
const result = await deps.cdp(params.method, params.params);
|
|
148
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], details: { type: "browser", action: "cdp", method: params.method } };
|
|
149
|
+
}
|
|
150
|
+
default:
|
|
151
|
+
return { content: [{ type: "text", text: `Error: unknown action "${params.action}".` }], details: { type: "browser", error: "unknown_action" } };
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=browser-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/browser-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+CAA+C;AAC/C,qDAAqD;AACrD,yDAAyD;AACzD,gBAAgB;AAChB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAkB,CAAC;AAiCpD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAiB;YACvB,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC;YACzF,WAAW,EACT,0FAA0F;gBAC1F,kFAAkF;gBAClF,uDAAuD;SAC1D;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,qDAAqD;SACnE;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,iFAAiF;SAC/F;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,uEAAuE;SACrF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;YACrC,WAAW,EAAE,iDAAiD;SAC/D;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,kEAAkE;SAChF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,2DAA2D;SACzE;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,gEAAgE;SAC9E;QACD,IAAI,EAAE;YACJ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AAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;gBACpJ,CAAC;gBAED;oBACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC;YACrJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const CHECKPOINT_TOOL_NAME: "checkpoint";
|
|
3
|
+
export type CheckpointAction = "create" | "list" | "restore" | "diff";
|
|
4
|
+
export interface CheckpointToolParams {
|
|
5
|
+
action: CheckpointAction;
|
|
6
|
+
/** Checkpoint ID (for restore/diff) */
|
|
7
|
+
checkpointId?: string;
|
|
8
|
+
/** Optional message for create */
|
|
9
|
+
message?: string;
|
|
10
|
+
/** File paths to restore (partial restore). If empty, restores all. */
|
|
11
|
+
paths?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const CHECKPOINT_TOOL_SCHEMA: {
|
|
14
|
+
readonly type: "object";
|
|
15
|
+
readonly properties: {
|
|
16
|
+
readonly action: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly enum: readonly ["create", "list", "restore", "diff"];
|
|
19
|
+
readonly description: string;
|
|
20
|
+
};
|
|
21
|
+
readonly checkpointId: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly description: "Checkpoint ID. Required for restore and diff.";
|
|
24
|
+
};
|
|
25
|
+
readonly message: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: "Optional descriptive message for the checkpoint.";
|
|
28
|
+
};
|
|
29
|
+
readonly paths: {
|
|
30
|
+
readonly type: "array";
|
|
31
|
+
readonly items: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
};
|
|
34
|
+
readonly description: "File paths to restore (partial restore). Omit to restore everything.";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly required: readonly ["action"];
|
|
38
|
+
};
|
|
39
|
+
export interface Checkpoint {
|
|
40
|
+
id: string;
|
|
41
|
+
message: string;
|
|
42
|
+
timestamp: string;
|
|
43
|
+
fileCount: number;
|
|
44
|
+
}
|
|
45
|
+
export interface CheckpointResult {
|
|
46
|
+
success: boolean;
|
|
47
|
+
checkpoint?: Checkpoint;
|
|
48
|
+
checkpoints?: Checkpoint[];
|
|
49
|
+
diff?: string;
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Host-provided checkpoint backend.
|
|
54
|
+
* Uses shadow git repos (isolated from user project) for snapshots.
|
|
55
|
+
*/
|
|
56
|
+
export interface CheckpointToolDeps {
|
|
57
|
+
/** Create a snapshot of the current workspace state */
|
|
58
|
+
createCheckpoint(message?: string): Promise<CheckpointResult>;
|
|
59
|
+
/** List all available checkpoints */
|
|
60
|
+
listCheckpoints(): Promise<CheckpointResult>;
|
|
61
|
+
/** Restore workspace to a checkpoint state (optionally partial) */
|
|
62
|
+
restoreCheckpoint(checkpointId: string, paths?: string[]): Promise<CheckpointResult>;
|
|
63
|
+
/** Show diff between current state and a checkpoint */
|
|
64
|
+
diffCheckpoint(checkpointId: string): Promise<CheckpointResult>;
|
|
65
|
+
}
|
|
66
|
+
export declare function createCheckpointTool(deps: CheckpointToolDeps): PortableTool<CheckpointToolParams>;
|
|
67
|
+
//# sourceMappingURL=checkpoint-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/checkpoint-tool.ts"],"names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