qlogicagent 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.js +1 -0
- package/dist/cli.js +9 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +5 -16
- package/dist/orchestration.js +118 -0
- package/dist/{agent → types/agent}/agent.d.ts +0 -1
- package/dist/{agent → types/agent}/tool-loop.d.ts +0 -1
- package/dist/{agent → types/agent}/types.d.ts +0 -1
- package/dist/{cli → types/cli}/main.d.ts +0 -1
- package/dist/{cli → types/cli}/stdio-server.d.ts +0 -1
- package/dist/{config → types/config}/config.d.ts +0 -1
- package/dist/{contracts → types/contracts}/hooks.d.ts +0 -1
- package/dist/{contracts/index.js → types/contracts/index.d.ts} +0 -1
- package/dist/{contracts → types/contracts}/planner.d.ts +0 -1
- package/dist/{contracts → types/contracts}/skill-candidate.d.ts +0 -1
- package/dist/{contracts → types/contracts}/todo.d.ts +0 -1
- package/dist/{index.d.ts → types/index.d.ts} +0 -1
- package/dist/{llm → types/llm}/builtin-providers.d.ts +0 -1
- package/dist/{llm → types/llm}/index.d.ts +0 -1
- package/dist/{llm → types/llm}/llm-client.d.ts +0 -1
- package/dist/{llm → types/llm}/model-catalog.d.ts +0 -1
- package/dist/{llm → types/llm}/provider-def.d.ts +0 -1
- package/dist/{llm → types/llm}/provider-registry.d.ts +0 -1
- package/dist/{llm → types/llm}/transport.d.ts +0 -1
- package/dist/{llm → types/llm}/transports/anthropic-messages.d.ts +0 -1
- package/dist/{llm → types/llm}/transports/openai-chat.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/agent-registry.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/approval-aware-tool-plan.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/context-compression.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/conversation-repair.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/curator-scheduler.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/embedded-failover-policy.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/error-classification.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/failover-classification.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/failover-error.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/fork-subagent.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/index.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/memory-flush-policy.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/memory-provider.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/parallel-tool-calls.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/prompt-cache-strategy.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/reactive-compact.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/retry-loop.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/skill-candidate.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/skill-consolidation.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/skill-improvement.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/skill-similarity.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/streaming-tool-executor.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/team-orchestration.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/team-tool-loop-wiring.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/tool-choice-policy.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/tool-loop-state.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/tool-schema.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/transcript-repair.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/turn-loop-guard.d.ts +0 -1
- package/dist/{orchestration → types/orchestration}/web-browser-policy.d.ts +0 -1
- package/dist/{runtime → types/runtime}/context-compression.d.ts +0 -1
- package/dist/{runtime → types/runtime}/hook-registry.d.ts +0 -1
- package/dist/{runtime → types/runtime}/memory-hooks.d.ts +0 -1
- package/dist/{runtime → types/runtime}/tool-eligibility.d.ts +0 -1
- package/dist/{skills → types/skills}/index.d.ts +0 -1
- package/dist/{skills → types/skills}/memory-extractor.d.ts +0 -1
- package/dist/{skills → types/skills}/memory-query-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/memory-store.d.ts +0 -1
- package/dist/{skills → types/skills}/memory-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/portable-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/qmemory-adapter.d.ts +0 -1
- package/dist/{skills → types/skills}/skill-frontmatter.d.ts +0 -1
- package/dist/{skills → types/skills}/skill-guard.d.ts +0 -1
- package/dist/{skills → types/skills}/skill-loader.d.ts +0 -1
- package/dist/{skills → types/skills}/skill-source.d.ts +0 -1
- package/dist/{skills → types/skills}/skill-types.d.ts +0 -1
- package/dist/{skills → types/skills}/think-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/todo-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/agent-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/apply-patch-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/ask-user-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/brief-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/browser-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/checkpoint-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/config-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/cron-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/edit-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/exec-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/image-generate-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/instructions-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/lsp-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/mcp-client-types.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/mcp-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/memory-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/monitor-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/music-generate-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/notify-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/patch-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/pdf-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/plan-mode-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/read-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/repl-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/search-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/send-message-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/skill-list-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/skill-manage-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/skill-view-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/sleep-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/structured-output-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/task-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/team-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/tool-search-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/tts-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/video-edit-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/video-generate-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/video-merge-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/video-upscale-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/web-fetch-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/web-search-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/worktree-tool.d.ts +0 -1
- package/dist/{skills → types/skills}/tools/write-tool.d.ts +0 -1
- package/package.json +56 -42
- package/dist/agent/agent.d.ts.map +0 -1
- package/dist/agent/agent.js +0 -114
- package/dist/agent/agent.js.map +0 -1
- package/dist/agent/tool-loop.d.ts.map +0 -1
- package/dist/agent/tool-loop.js +0 -576
- package/dist/agent/tool-loop.js.map +0 -1
- package/dist/agent/types.d.ts.map +0 -1
- package/dist/agent/types.js +0 -15
- package/dist/agent/types.js.map +0 -1
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -24
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/stdio-server.d.ts.map +0 -1
- package/dist/cli/stdio-server.js +0 -464
- package/dist/cli/stdio-server.js.map +0 -1
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/config.js +0 -22
- package/dist/config/config.js.map +0 -1
- package/dist/contracts/hooks.d.ts.map +0 -1
- package/dist/contracts/hooks.js +0 -8
- package/dist/contracts/hooks.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -11
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/planner.d.ts.map +0 -1
- package/dist/contracts/planner.js +0 -3
- package/dist/contracts/planner.js.map +0 -1
- package/dist/contracts/skill-candidate.d.ts.map +0 -1
- package/dist/contracts/skill-candidate.js +0 -196
- package/dist/contracts/skill-candidate.js.map +0 -1
- package/dist/contracts/todo.d.ts.map +0 -1
- package/dist/contracts/todo.js +0 -10
- package/dist/contracts/todo.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/llm/builtin-providers.d.ts.map +0 -1
- package/dist/llm/builtin-providers.js +0 -532
- package/dist/llm/builtin-providers.js.map +0 -1
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js +0 -15
- package/dist/llm/index.js.map +0 -1
- package/dist/llm/llm-client.d.ts.map +0 -1
- package/dist/llm/llm-client.js +0 -68
- package/dist/llm/llm-client.js.map +0 -1
- package/dist/llm/model-catalog.d.ts.map +0 -1
- package/dist/llm/model-catalog.js +0 -192
- package/dist/llm/model-catalog.js.map +0 -1
- package/dist/llm/provider-def.d.ts.map +0 -1
- package/dist/llm/provider-def.js +0 -13
- package/dist/llm/provider-def.js.map +0 -1
- package/dist/llm/provider-registry.d.ts.map +0 -1
- package/dist/llm/provider-registry.js +0 -148
- package/dist/llm/provider-registry.js.map +0 -1
- package/dist/llm/transport.d.ts.map +0 -1
- package/dist/llm/transport.js +0 -28
- package/dist/llm/transport.js.map +0 -1
- package/dist/llm/transports/anthropic-messages.d.ts.map +0 -1
- package/dist/llm/transports/anthropic-messages.js +0 -294
- package/dist/llm/transports/anthropic-messages.js.map +0 -1
- package/dist/llm/transports/openai-chat.d.ts.map +0 -1
- package/dist/llm/transports/openai-chat.js +0 -166
- package/dist/llm/transports/openai-chat.js.map +0 -1
- package/dist/orchestration/agent-registry.d.ts.map +0 -1
- package/dist/orchestration/agent-registry.js +0 -117
- package/dist/orchestration/agent-registry.js.map +0 -1
- package/dist/orchestration/approval-aware-tool-plan.d.ts.map +0 -1
- package/dist/orchestration/approval-aware-tool-plan.js +0 -88
- package/dist/orchestration/approval-aware-tool-plan.js.map +0 -1
- package/dist/orchestration/context-compression.d.ts.map +0 -1
- package/dist/orchestration/context-compression.js +0 -584
- package/dist/orchestration/context-compression.js.map +0 -1
- package/dist/orchestration/conversation-repair.d.ts.map +0 -1
- package/dist/orchestration/conversation-repair.js +0 -430
- package/dist/orchestration/conversation-repair.js.map +0 -1
- package/dist/orchestration/curator-scheduler.d.ts.map +0 -1
- package/dist/orchestration/curator-scheduler.js +0 -136
- package/dist/orchestration/curator-scheduler.js.map +0 -1
- package/dist/orchestration/embedded-failover-policy.d.ts.map +0 -1
- package/dist/orchestration/embedded-failover-policy.js +0 -169
- package/dist/orchestration/embedded-failover-policy.js.map +0 -1
- package/dist/orchestration/error-classification.d.ts.map +0 -1
- package/dist/orchestration/error-classification.js +0 -78
- package/dist/orchestration/error-classification.js.map +0 -1
- package/dist/orchestration/failover-classification.d.ts.map +0 -1
- package/dist/orchestration/failover-classification.js +0 -382
- package/dist/orchestration/failover-classification.js.map +0 -1
- package/dist/orchestration/failover-error.d.ts.map +0 -1
- package/dist/orchestration/failover-error.js +0 -199
- package/dist/orchestration/failover-error.js.map +0 -1
- package/dist/orchestration/fork-subagent.d.ts.map +0 -1
- package/dist/orchestration/fork-subagent.js +0 -99
- package/dist/orchestration/fork-subagent.js.map +0 -1
- package/dist/orchestration/index.d.ts.map +0 -1
- package/dist/orchestration/index.js +0 -268
- package/dist/orchestration/index.js.map +0 -1
- package/dist/orchestration/memory-flush-policy.d.ts.map +0 -1
- package/dist/orchestration/memory-flush-policy.js +0 -86
- package/dist/orchestration/memory-flush-policy.js.map +0 -1
- package/dist/orchestration/memory-provider.d.ts.map +0 -1
- package/dist/orchestration/memory-provider.js +0 -3
- package/dist/orchestration/memory-provider.js.map +0 -1
- package/dist/orchestration/parallel-tool-calls.d.ts.map +0 -1
- package/dist/orchestration/parallel-tool-calls.js +0 -60
- package/dist/orchestration/parallel-tool-calls.js.map +0 -1
- package/dist/orchestration/prompt-cache-strategy.d.ts.map +0 -1
- package/dist/orchestration/prompt-cache-strategy.js +0 -229
- package/dist/orchestration/prompt-cache-strategy.js.map +0 -1
- package/dist/orchestration/reactive-compact.d.ts.map +0 -1
- package/dist/orchestration/reactive-compact.js +0 -79
- package/dist/orchestration/reactive-compact.js.map +0 -1
- package/dist/orchestration/retry-loop.d.ts.map +0 -1
- package/dist/orchestration/retry-loop.js +0 -25
- package/dist/orchestration/retry-loop.js.map +0 -1
- package/dist/orchestration/skill-candidate.d.ts.map +0 -1
- package/dist/orchestration/skill-candidate.js +0 -142
- package/dist/orchestration/skill-candidate.js.map +0 -1
- package/dist/orchestration/skill-consolidation.d.ts.map +0 -1
- package/dist/orchestration/skill-consolidation.js +0 -221
- package/dist/orchestration/skill-consolidation.js.map +0 -1
- package/dist/orchestration/skill-improvement.d.ts.map +0 -1
- package/dist/orchestration/skill-improvement.js +0 -67
- package/dist/orchestration/skill-improvement.js.map +0 -1
- package/dist/orchestration/skill-similarity.d.ts.map +0 -1
- package/dist/orchestration/skill-similarity.js +0 -132
- package/dist/orchestration/skill-similarity.js.map +0 -1
- package/dist/orchestration/streaming-tool-executor.d.ts.map +0 -1
- package/dist/orchestration/streaming-tool-executor.js +0 -97
- package/dist/orchestration/streaming-tool-executor.js.map +0 -1
- package/dist/orchestration/team-orchestration.d.ts.map +0 -1
- package/dist/orchestration/team-orchestration.js +0 -370
- package/dist/orchestration/team-orchestration.js.map +0 -1
- package/dist/orchestration/team-tool-loop-wiring.d.ts.map +0 -1
- package/dist/orchestration/team-tool-loop-wiring.js +0 -148
- package/dist/orchestration/team-tool-loop-wiring.js.map +0 -1
- package/dist/orchestration/tool-choice-policy.d.ts.map +0 -1
- package/dist/orchestration/tool-choice-policy.js +0 -165
- package/dist/orchestration/tool-choice-policy.js.map +0 -1
- package/dist/orchestration/tool-loop-state.d.ts.map +0 -1
- package/dist/orchestration/tool-loop-state.js +0 -134
- package/dist/orchestration/tool-loop-state.js.map +0 -1
- package/dist/orchestration/tool-schema.d.ts.map +0 -1
- package/dist/orchestration/tool-schema.js +0 -298
- package/dist/orchestration/tool-schema.js.map +0 -1
- package/dist/orchestration/transcript-repair.d.ts.map +0 -1
- package/dist/orchestration/transcript-repair.js +0 -427
- package/dist/orchestration/transcript-repair.js.map +0 -1
- package/dist/orchestration/turn-loop-guard.d.ts.map +0 -1
- package/dist/orchestration/turn-loop-guard.js +0 -93
- package/dist/orchestration/turn-loop-guard.js.map +0 -1
- package/dist/orchestration/web-browser-policy.d.ts.map +0 -1
- package/dist/orchestration/web-browser-policy.js +0 -40
- package/dist/orchestration/web-browser-policy.js.map +0 -1
- package/dist/runtime/context-compression.d.ts.map +0 -1
- package/dist/runtime/context-compression.js +0 -275
- package/dist/runtime/context-compression.js.map +0 -1
- package/dist/runtime/hook-registry.d.ts.map +0 -1
- package/dist/runtime/hook-registry.js +0 -54
- package/dist/runtime/hook-registry.js.map +0 -1
- package/dist/runtime/memory-hooks.d.ts.map +0 -1
- package/dist/runtime/memory-hooks.js +0 -66
- package/dist/runtime/memory-hooks.js.map +0 -1
- package/dist/runtime/tool-eligibility.d.ts.map +0 -1
- package/dist/runtime/tool-eligibility.js +0 -112
- package/dist/runtime/tool-eligibility.js.map +0 -1
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -83
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/memory-extractor.d.ts.map +0 -1
- package/dist/skills/memory-extractor.js +0 -174
- package/dist/skills/memory-extractor.js.map +0 -1
- package/dist/skills/memory-query-tool.d.ts.map +0 -1
- package/dist/skills/memory-query-tool.js +0 -128
- package/dist/skills/memory-query-tool.js.map +0 -1
- package/dist/skills/memory-store.d.ts.map +0 -1
- package/dist/skills/memory-store.js +0 -229
- package/dist/skills/memory-store.js.map +0 -1
- package/dist/skills/memory-tool.d.ts.map +0 -1
- package/dist/skills/memory-tool.js +0 -193
- package/dist/skills/memory-tool.js.map +0 -1
- package/dist/skills/portable-tool.d.ts.map +0 -1
- package/dist/skills/portable-tool.js +0 -15
- package/dist/skills/portable-tool.js.map +0 -1
- package/dist/skills/qmemory-adapter.d.ts.map +0 -1
- package/dist/skills/qmemory-adapter.js +0 -166
- package/dist/skills/qmemory-adapter.js.map +0 -1
- package/dist/skills/skill-frontmatter.d.ts.map +0 -1
- package/dist/skills/skill-frontmatter.js +0 -345
- package/dist/skills/skill-frontmatter.js.map +0 -1
- package/dist/skills/skill-guard.d.ts.map +0 -1
- package/dist/skills/skill-guard.js +0 -230
- package/dist/skills/skill-guard.js.map +0 -1
- package/dist/skills/skill-loader.d.ts.map +0 -1
- package/dist/skills/skill-loader.js +0 -304
- package/dist/skills/skill-loader.js.map +0 -1
- package/dist/skills/skill-source.d.ts.map +0 -1
- package/dist/skills/skill-source.js +0 -127
- package/dist/skills/skill-source.js.map +0 -1
- package/dist/skills/skill-types.d.ts.map +0 -1
- package/dist/skills/skill-types.js +0 -7
- package/dist/skills/skill-types.js.map +0 -1
- package/dist/skills/think-tool.d.ts.map +0 -1
- package/dist/skills/think-tool.js +0 -60
- package/dist/skills/think-tool.js.map +0 -1
- package/dist/skills/todo-tool.d.ts.map +0 -1
- package/dist/skills/todo-tool.js +0 -115
- package/dist/skills/todo-tool.js.map +0 -1
- package/dist/skills/tools/agent-tool.d.ts.map +0 -1
- package/dist/skills/tools/agent-tool.js +0 -143
- package/dist/skills/tools/agent-tool.js.map +0 -1
- package/dist/skills/tools/apply-patch-tool.d.ts.map +0 -1
- package/dist/skills/tools/apply-patch-tool.js +0 -185
- package/dist/skills/tools/apply-patch-tool.js.map +0 -1
- package/dist/skills/tools/ask-user-tool.d.ts.map +0 -1
- package/dist/skills/tools/ask-user-tool.js +0 -122
- package/dist/skills/tools/ask-user-tool.js.map +0 -1
- package/dist/skills/tools/brief-tool.d.ts.map +0 -1
- package/dist/skills/tools/brief-tool.js +0 -96
- package/dist/skills/tools/brief-tool.js.map +0 -1
- package/dist/skills/tools/browser-tool.d.ts.map +0 -1
- package/dist/skills/tools/browser-tool.js +0 -156
- package/dist/skills/tools/browser-tool.js.map +0 -1
- package/dist/skills/tools/checkpoint-tool.d.ts.map +0 -1
- package/dist/skills/tools/checkpoint-tool.js +0 -103
- package/dist/skills/tools/checkpoint-tool.js.map +0 -1
- package/dist/skills/tools/config-tool.d.ts.map +0 -1
- package/dist/skills/tools/config-tool.js +0 -144
- package/dist/skills/tools/config-tool.js.map +0 -1
- package/dist/skills/tools/cron-tool.d.ts.map +0 -1
- package/dist/skills/tools/cron-tool.js +0 -176
- package/dist/skills/tools/cron-tool.js.map +0 -1
- package/dist/skills/tools/edit-tool.d.ts.map +0 -1
- package/dist/skills/tools/edit-tool.js +0 -71
- package/dist/skills/tools/edit-tool.js.map +0 -1
- package/dist/skills/tools/exec-tool.d.ts.map +0 -1
- package/dist/skills/tools/exec-tool.js +0 -134
- package/dist/skills/tools/exec-tool.js.map +0 -1
- package/dist/skills/tools/image-generate-tool.d.ts.map +0 -1
- package/dist/skills/tools/image-generate-tool.js +0 -68
- package/dist/skills/tools/image-generate-tool.js.map +0 -1
- package/dist/skills/tools/instructions-tool.d.ts.map +0 -1
- package/dist/skills/tools/instructions-tool.js +0 -188
- package/dist/skills/tools/instructions-tool.js.map +0 -1
- package/dist/skills/tools/lsp-tool.d.ts.map +0 -1
- package/dist/skills/tools/lsp-tool.js +0 -228
- package/dist/skills/tools/lsp-tool.js.map +0 -1
- package/dist/skills/tools/mcp-client-types.d.ts.map +0 -1
- package/dist/skills/tools/mcp-client-types.js +0 -54
- package/dist/skills/tools/mcp-client-types.js.map +0 -1
- package/dist/skills/tools/mcp-tool.d.ts.map +0 -1
- package/dist/skills/tools/mcp-tool.js +0 -504
- package/dist/skills/tools/mcp-tool.js.map +0 -1
- package/dist/skills/tools/memory-tool.d.ts.map +0 -1
- package/dist/skills/tools/memory-tool.js +0 -89
- package/dist/skills/tools/memory-tool.js.map +0 -1
- package/dist/skills/tools/monitor-tool.d.ts.map +0 -1
- package/dist/skills/tools/monitor-tool.js +0 -132
- package/dist/skills/tools/monitor-tool.js.map +0 -1
- package/dist/skills/tools/music-generate-tool.d.ts.map +0 -1
- package/dist/skills/tools/music-generate-tool.js +0 -63
- package/dist/skills/tools/music-generate-tool.js.map +0 -1
- package/dist/skills/tools/notify-tool.d.ts.map +0 -1
- package/dist/skills/tools/notify-tool.js +0 -63
- package/dist/skills/tools/notify-tool.js.map +0 -1
- package/dist/skills/tools/patch-tool.d.ts.map +0 -1
- package/dist/skills/tools/patch-tool.js +0 -506
- package/dist/skills/tools/patch-tool.js.map +0 -1
- package/dist/skills/tools/pdf-tool.d.ts.map +0 -1
- package/dist/skills/tools/pdf-tool.js +0 -89
- package/dist/skills/tools/pdf-tool.js.map +0 -1
- package/dist/skills/tools/plan-mode-tool.d.ts.map +0 -1
- package/dist/skills/tools/plan-mode-tool.js +0 -123
- package/dist/skills/tools/plan-mode-tool.js.map +0 -1
- package/dist/skills/tools/read-tool.d.ts.map +0 -1
- package/dist/skills/tools/read-tool.js +0 -85
- package/dist/skills/tools/read-tool.js.map +0 -1
- package/dist/skills/tools/repl-tool.d.ts.map +0 -1
- package/dist/skills/tools/repl-tool.js +0 -70
- package/dist/skills/tools/repl-tool.js.map +0 -1
- package/dist/skills/tools/search-tool.d.ts.map +0 -1
- package/dist/skills/tools/search-tool.js +0 -226
- package/dist/skills/tools/search-tool.js.map +0 -1
- package/dist/skills/tools/send-message-tool.d.ts.map +0 -1
- package/dist/skills/tools/send-message-tool.js +0 -77
- package/dist/skills/tools/send-message-tool.js.map +0 -1
- package/dist/skills/tools/skill-list-tool.d.ts.map +0 -1
- package/dist/skills/tools/skill-list-tool.js +0 -55
- package/dist/skills/tools/skill-list-tool.js.map +0 -1
- package/dist/skills/tools/skill-manage-tool.d.ts.map +0 -1
- package/dist/skills/tools/skill-manage-tool.js +0 -154
- package/dist/skills/tools/skill-manage-tool.js.map +0 -1
- package/dist/skills/tools/skill-view-tool.d.ts.map +0 -1
- package/dist/skills/tools/skill-view-tool.js +0 -73
- package/dist/skills/tools/skill-view-tool.js.map +0 -1
- package/dist/skills/tools/sleep-tool.d.ts.map +0 -1
- package/dist/skills/tools/sleep-tool.js +0 -82
- package/dist/skills/tools/sleep-tool.js.map +0 -1
- package/dist/skills/tools/structured-output-tool.d.ts.map +0 -1
- package/dist/skills/tools/structured-output-tool.js +0 -177
- package/dist/skills/tools/structured-output-tool.js.map +0 -1
- package/dist/skills/tools/task-tool.d.ts.map +0 -1
- package/dist/skills/tools/task-tool.js +0 -162
- package/dist/skills/tools/task-tool.js.map +0 -1
- package/dist/skills/tools/team-tool.d.ts.map +0 -1
- package/dist/skills/tools/team-tool.js +0 -106
- package/dist/skills/tools/team-tool.js.map +0 -1
- package/dist/skills/tools/tool-search-tool.d.ts.map +0 -1
- package/dist/skills/tools/tool-search-tool.js +0 -111
- package/dist/skills/tools/tool-search-tool.js.map +0 -1
- package/dist/skills/tools/tts-tool.d.ts.map +0 -1
- package/dist/skills/tools/tts-tool.js +0 -46
- package/dist/skills/tools/tts-tool.js.map +0 -1
- package/dist/skills/tools/video-edit-tool.d.ts.map +0 -1
- package/dist/skills/tools/video-edit-tool.js +0 -75
- package/dist/skills/tools/video-edit-tool.js.map +0 -1
- package/dist/skills/tools/video-generate-tool.d.ts.map +0 -1
- package/dist/skills/tools/video-generate-tool.js +0 -67
- package/dist/skills/tools/video-generate-tool.js.map +0 -1
- package/dist/skills/tools/video-merge-tool.d.ts.map +0 -1
- package/dist/skills/tools/video-merge-tool.js +0 -93
- package/dist/skills/tools/video-merge-tool.js.map +0 -1
- package/dist/skills/tools/video-upscale-tool.d.ts.map +0 -1
- package/dist/skills/tools/video-upscale-tool.js +0 -53
- package/dist/skills/tools/video-upscale-tool.js.map +0 -1
- package/dist/skills/tools/web-fetch-tool.d.ts.map +0 -1
- package/dist/skills/tools/web-fetch-tool.js +0 -93
- package/dist/skills/tools/web-fetch-tool.js.map +0 -1
- package/dist/skills/tools/web-search-tool.d.ts.map +0 -1
- package/dist/skills/tools/web-search-tool.js +0 -87
- package/dist/skills/tools/web-search-tool.js.map +0 -1
- package/dist/skills/tools/worktree-tool.d.ts.map +0 -1
- package/dist/skills/tools/worktree-tool.js +0 -148
- package/dist/skills/tools/worktree-tool.js.map +0 -1
- package/dist/skills/tools/write-tool.d.ts.map +0 -1
- package/dist/skills/tools/write-tool.js +0 -82
- package/dist/skills/tools/write-tool.js.map +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Cron Tool — scheduled task management (CRUD).
|
|
3
|
-
// Reference: hermes-agent-main/tools/cronjob_tools.py
|
|
4
|
-
// Category: system
|
|
5
|
-
// ============================================================
|
|
6
|
-
export const CRON_TOOL_NAME = "cron";
|
|
7
|
-
export const CRON_TOOL_SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
action: {
|
|
11
|
-
type: "string",
|
|
12
|
-
enum: ["create", "list", "get", "update", "delete", "pause", "resume", "trigger"],
|
|
13
|
-
description: "CRUD action: create/list/get/update/delete/pause/resume/trigger.",
|
|
14
|
-
},
|
|
15
|
-
jobId: {
|
|
16
|
-
type: "string",
|
|
17
|
-
description: "Job ID. Required for get/update/delete/pause/resume/trigger.",
|
|
18
|
-
},
|
|
19
|
-
prompt: {
|
|
20
|
-
type: "string",
|
|
21
|
-
description: "Task prompt to execute on schedule. Required for create.",
|
|
22
|
-
},
|
|
23
|
-
schedule: {
|
|
24
|
-
type: "string",
|
|
25
|
-
description: "Schedule expression. Supports:\n" +
|
|
26
|
-
"- Cron: '0 9 * * *' (every day at 9am)\n" +
|
|
27
|
-
"- Shorthand: '5m' (every 5 min), '1h' (hourly), '1d' (daily)\n" +
|
|
28
|
-
"Required for create.",
|
|
29
|
-
},
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Human-readable job name.",
|
|
33
|
-
},
|
|
34
|
-
repeat: {
|
|
35
|
-
type: "number",
|
|
36
|
-
description: "Number of times to repeat (null = infinite). Default: null.",
|
|
37
|
-
},
|
|
38
|
-
allowedTools: {
|
|
39
|
-
type: "array",
|
|
40
|
-
items: { type: "string" },
|
|
41
|
-
description: "Tools the scheduled task is allowed to use.",
|
|
42
|
-
},
|
|
43
|
-
enabled: {
|
|
44
|
-
type: "boolean",
|
|
45
|
-
description: "Whether the job is enabled (for update).",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
required: ["action"],
|
|
49
|
-
};
|
|
50
|
-
export const MAX_CRON_JOBS = 50;
|
|
51
|
-
export function createCronTool(deps) {
|
|
52
|
-
return {
|
|
53
|
-
name: CRON_TOOL_NAME,
|
|
54
|
-
label: "Cron",
|
|
55
|
-
description: "Manage scheduled tasks. Create recurring jobs with cron expressions or shorthand " +
|
|
56
|
-
"('5m', '1h', '0 9 * * *'). Jobs persist locally and survive restarts. " +
|
|
57
|
-
"Actions: create, list, get, update, delete, pause, resume, trigger (run now).",
|
|
58
|
-
parameters: CRON_TOOL_SCHEMA,
|
|
59
|
-
execute: async (_toolCallId, params) => {
|
|
60
|
-
switch (params.action) {
|
|
61
|
-
case "create": {
|
|
62
|
-
if (!params.prompt) {
|
|
63
|
-
return { content: [{ type: "text", text: "Error: prompt is required for create." }], details: { type: "cron", error: "missing_prompt" } };
|
|
64
|
-
}
|
|
65
|
-
if (!params.schedule) {
|
|
66
|
-
return { content: [{ type: "text", text: "Error: schedule is required for create." }], details: { type: "cron", error: "missing_schedule" } };
|
|
67
|
-
}
|
|
68
|
-
if (deps.validateSchedule) {
|
|
69
|
-
const err = deps.validateSchedule(params.schedule);
|
|
70
|
-
if (err)
|
|
71
|
-
return { content: [{ type: "text", text: `Error: invalid schedule — ${err}` }], details: { type: "cron", error: "invalid_schedule" } };
|
|
72
|
-
}
|
|
73
|
-
// Check max jobs limit
|
|
74
|
-
const existing = await deps.listJobs();
|
|
75
|
-
if (existing.jobs && existing.jobs.length >= MAX_CRON_JOBS) {
|
|
76
|
-
return { content: [{ type: "text", text: `Error: maximum ${MAX_CRON_JOBS} jobs reached. Delete unused jobs first.` }], details: { type: "cron", error: "max_jobs_reached" } };
|
|
77
|
-
}
|
|
78
|
-
const r = await deps.createJob({ prompt: params.prompt, schedule: params.schedule, name: params.name, repeat: params.repeat, allowedTools: params.allowedTools });
|
|
79
|
-
if (!r.success)
|
|
80
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
81
|
-
return { content: [{ type: "text", text: formatJob(r.job) }], details: { type: "cron", action: "create", jobId: r.job.id } };
|
|
82
|
-
}
|
|
83
|
-
case "list": {
|
|
84
|
-
const r = await deps.listJobs();
|
|
85
|
-
if (!r.jobs || r.jobs.length === 0) {
|
|
86
|
-
return { content: [{ type: "text", text: "No scheduled jobs." }], details: { type: "cron", action: "list", count: 0 } };
|
|
87
|
-
}
|
|
88
|
-
const lines = [`Scheduled jobs (${r.jobs.length}):`, ""];
|
|
89
|
-
for (const j of r.jobs) {
|
|
90
|
-
lines.push(`- **${j.name || j.id}** [${j.state}] ${j.scheduleDisplay} — next: ${j.nextRunAt || "N/A"}`);
|
|
91
|
-
}
|
|
92
|
-
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "cron", action: "list", count: r.jobs.length } };
|
|
93
|
-
}
|
|
94
|
-
case "get": {
|
|
95
|
-
if (!params.jobId)
|
|
96
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
97
|
-
const r = await deps.getJob(params.jobId);
|
|
98
|
-
if (!r.success)
|
|
99
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
100
|
-
return { content: [{ type: "text", text: formatJob(r.job) }], details: { type: "cron", action: "get", jobId: params.jobId } };
|
|
101
|
-
}
|
|
102
|
-
case "update": {
|
|
103
|
-
if (!params.jobId)
|
|
104
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
105
|
-
const updates = {};
|
|
106
|
-
if (params.prompt !== undefined)
|
|
107
|
-
updates.prompt = params.prompt;
|
|
108
|
-
if (params.schedule !== undefined)
|
|
109
|
-
updates.schedule = params.schedule;
|
|
110
|
-
if (params.name !== undefined)
|
|
111
|
-
updates.name = params.name;
|
|
112
|
-
if (params.enabled !== undefined)
|
|
113
|
-
updates.enabled = params.enabled;
|
|
114
|
-
if (params.repeat !== undefined)
|
|
115
|
-
updates.repeat = params.repeat;
|
|
116
|
-
if (params.allowedTools !== undefined)
|
|
117
|
-
updates.allowedTools = params.allowedTools;
|
|
118
|
-
const r = await deps.updateJob(params.jobId, updates);
|
|
119
|
-
if (!r.success)
|
|
120
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
121
|
-
return { content: [{ type: "text", text: `Job updated.\n${formatJob(r.job)}` }], details: { type: "cron", action: "update", jobId: params.jobId } };
|
|
122
|
-
}
|
|
123
|
-
case "delete": {
|
|
124
|
-
if (!params.jobId)
|
|
125
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
126
|
-
const r = await deps.deleteJob(params.jobId);
|
|
127
|
-
if (!r.success)
|
|
128
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
129
|
-
return { content: [{ type: "text", text: `Job ${params.jobId} deleted.` }], details: { type: "cron", action: "delete", jobId: params.jobId } };
|
|
130
|
-
}
|
|
131
|
-
case "pause": {
|
|
132
|
-
if (!params.jobId)
|
|
133
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
134
|
-
const r = await deps.pauseJob(params.jobId);
|
|
135
|
-
if (!r.success)
|
|
136
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
137
|
-
return { content: [{ type: "text", text: `Job ${params.jobId} paused.` }], details: { type: "cron", action: "pause", jobId: params.jobId } };
|
|
138
|
-
}
|
|
139
|
-
case "resume": {
|
|
140
|
-
if (!params.jobId)
|
|
141
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
142
|
-
const r = await deps.resumeJob(params.jobId);
|
|
143
|
-
if (!r.success)
|
|
144
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
145
|
-
return { content: [{ type: "text", text: `Job ${params.jobId} resumed.` }], details: { type: "cron", action: "resume", jobId: params.jobId } };
|
|
146
|
-
}
|
|
147
|
-
case "trigger": {
|
|
148
|
-
if (!params.jobId)
|
|
149
|
-
return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
|
|
150
|
-
const r = await deps.triggerJob(params.jobId);
|
|
151
|
-
if (!r.success)
|
|
152
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
|
|
153
|
-
return { content: [{ type: "text", text: `Job ${params.jobId} triggered (running now).` }], details: { type: "cron", action: "trigger", jobId: params.jobId } };
|
|
154
|
-
}
|
|
155
|
-
default:
|
|
156
|
-
return { content: [{ type: "text", text: `Error: unknown action "${params.action}".` }], details: { type: "cron", error: "unknown_action" } };
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
function formatJob(job) {
|
|
162
|
-
const lines = [
|
|
163
|
-
`Job: ${job.name || job.id}`,
|
|
164
|
-
`ID: ${job.id}`,
|
|
165
|
-
`Schedule: ${job.scheduleDisplay} (${job.schedule})`,
|
|
166
|
-
`State: ${job.state}`,
|
|
167
|
-
`Repeat: ${job.repeat.times === null ? "infinite" : `${job.repeat.completed}/${job.repeat.times}`}`,
|
|
168
|
-
];
|
|
169
|
-
if (job.nextRunAt)
|
|
170
|
-
lines.push(`Next run: ${job.nextRunAt}`);
|
|
171
|
-
if (job.lastRunAt)
|
|
172
|
-
lines.push(`Last run: ${job.lastRunAt} (${job.lastStatus || "unknown"})`);
|
|
173
|
-
lines.push(`Prompt: ${job.prompt.slice(0, 100)}${job.prompt.length > 100 ? "..." : ""}`);
|
|
174
|
-
return lines.join("\n");
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=cron-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cron-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/cron-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,sDAAsD;AACtD,mBAAmB;AACnB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAsB9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAiB;YACvB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KA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AG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/edit-tool.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,cAAc,EAAG,MAAe,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CAiBnB,CAAC;AAEX,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,0BAA0B;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,2CAA2C;IAC3C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,2BAA2B,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC3D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAuD/E"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// File Edit Tool — surgical text replacement in files.
|
|
3
|
-
// Category: coding
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const EDIT_TOOL_NAME = "edit";
|
|
6
|
-
export const EDIT_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
path: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Path to the file to edit (relative or absolute).",
|
|
12
|
-
},
|
|
13
|
-
oldText: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Exact text to find and replace (must match exactly, including whitespace).",
|
|
16
|
-
},
|
|
17
|
-
newText: {
|
|
18
|
-
type: "string",
|
|
19
|
-
description: "New text to replace the old text with.",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
required: ["path", "oldText", "newText"],
|
|
23
|
-
};
|
|
24
|
-
export function createEditTool(deps) {
|
|
25
|
-
return {
|
|
26
|
-
name: EDIT_TOOL_NAME,
|
|
27
|
-
label: "Edit File",
|
|
28
|
-
description: "Edit a file by replacing exact text. The oldText must match exactly (including whitespace). " +
|
|
29
|
-
"Use this for precise, surgical edits. For multiple edits, call this tool multiple times.",
|
|
30
|
-
parameters: EDIT_TOOL_SCHEMA,
|
|
31
|
-
execute: async (_toolCallId, params) => {
|
|
32
|
-
const resolved = deps.resolvePath(params.path);
|
|
33
|
-
// Concurrent modification check
|
|
34
|
-
if (deps.checkConcurrentModification) {
|
|
35
|
-
const conflict = deps.checkConcurrentModification(resolved);
|
|
36
|
-
if (conflict) {
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: "text", text: `Concurrent modification detected: ${conflict}. Re-read the file first.` }],
|
|
39
|
-
details: { type: "edit", path: resolved, success: false, reason: "concurrent_modification" },
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const content = await deps.readFile(resolved);
|
|
44
|
-
const index = content.indexOf(params.oldText);
|
|
45
|
-
if (index === -1) {
|
|
46
|
-
return {
|
|
47
|
-
content: [{ type: "text", text: `Error: oldText not found in ${resolved}. Ensure it matches exactly.` }],
|
|
48
|
-
details: { type: "edit", path: resolved, success: false, reason: "not_found" },
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
// Check for multiple matches
|
|
52
|
-
const secondIndex = content.indexOf(params.oldText, index + 1);
|
|
53
|
-
if (secondIndex !== -1) {
|
|
54
|
-
return {
|
|
55
|
-
content: [{ type: "text", text: `Error: oldText matches multiple locations in ${resolved}. Include more context to make the match unique.` }],
|
|
56
|
-
details: { type: "edit", path: resolved, success: false, reason: "ambiguous" },
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const newContent = content.slice(0, index) + params.newText + content.slice(index + params.oldText.length);
|
|
60
|
-
await deps.writeFile(resolved, newContent);
|
|
61
|
-
// Compute first changed line
|
|
62
|
-
const preLines = content.slice(0, index).split("\n");
|
|
63
|
-
const firstChangedLine = preLines.length;
|
|
64
|
-
return {
|
|
65
|
-
content: [{ type: "text", text: `Edited ${resolved} (line ${firstChangedLine})` }],
|
|
66
|
-
details: { type: "edit", path: resolved, success: true, firstChangedLine },
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=edit-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/edit-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,uDAAuD;AACvD,mBAAmB;AACnB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAQ9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,kDAAkD;SAChE;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,4EAA4E;SAC1F;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,wCAAwC;SACtD;KACF;IACD,QAAQ,EAAE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AC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAEjG;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAEtE;;;;;OAKG;IACH,aAAa,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7F;;;;OAIG;IACH,iBAAiB,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1E;AAWD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAgG/E"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Exec Tool — execute shell commands in a sandbox/host env.
|
|
3
|
-
// Reference: claude-code-haha/src/tools/BashTool/BashTool.tsx
|
|
4
|
-
// Category: system
|
|
5
|
-
// ============================================================
|
|
6
|
-
export const EXEC_TOOL_NAME = "exec";
|
|
7
|
-
export const EXEC_TOOL_SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
command: {
|
|
11
|
-
type: "string",
|
|
12
|
-
description: "Shell command to execute. On Windows uses PowerShell, on Unix uses bash.",
|
|
13
|
-
},
|
|
14
|
-
description: {
|
|
15
|
-
type: "string",
|
|
16
|
-
description: "Brief human-readable description of what this command does (e.g. \"Install dependencies\", " +
|
|
17
|
-
"\"Run unit tests\"). Used for UI display. For simple commands keep it 5-10 words; " +
|
|
18
|
-
"for complex piped/flagged commands add enough context to clarify intent.",
|
|
19
|
-
},
|
|
20
|
-
workdir: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "Working directory for the command.",
|
|
23
|
-
},
|
|
24
|
-
timeout: {
|
|
25
|
-
type: "number",
|
|
26
|
-
description: "Timeout in seconds (default: 120). Only applies to foreground commands.",
|
|
27
|
-
},
|
|
28
|
-
background: {
|
|
29
|
-
type: "boolean",
|
|
30
|
-
description: "If true, start the command in the background and return immediately " +
|
|
31
|
-
"with a process ID. Use getOutput to check on it later. " +
|
|
32
|
-
"Good for dev servers, watchers, long builds. Default: false.",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
required: ["command"],
|
|
36
|
-
};
|
|
37
|
-
const DEFAULT_TIMEOUT = 120;
|
|
38
|
-
const MAX_OUTPUT_CHARS = 50_000;
|
|
39
|
-
function truncateOutput(text, limit) {
|
|
40
|
-
if (text.length <= limit)
|
|
41
|
-
return text;
|
|
42
|
-
const half = Math.floor(limit / 2) - 50;
|
|
43
|
-
return `${text.slice(0, half)}\n\n... [truncated ${text.length - limit} chars] ...\n\n${text.slice(-half)}`;
|
|
44
|
-
}
|
|
45
|
-
export function createExecTool(deps) {
|
|
46
|
-
return {
|
|
47
|
-
name: EXEC_TOOL_NAME,
|
|
48
|
-
label: "Execute Command",
|
|
49
|
-
description: "Execute a shell command. Supports foreground (blocking, returns output) " +
|
|
50
|
-
"and background (non-blocking, returns pid) modes. " +
|
|
51
|
-
"On Windows uses PowerShell, on Unix uses bash. " +
|
|
52
|
-
"Output is truncated if too long.",
|
|
53
|
-
parameters: EXEC_TOOL_SCHEMA,
|
|
54
|
-
execute: async (_toolCallId, params) => {
|
|
55
|
-
// ── Validate command (skill-guard) ──────────────────
|
|
56
|
-
if (deps.validateCommand) {
|
|
57
|
-
const blocked = await deps.validateCommand(params.command);
|
|
58
|
-
if (blocked) {
|
|
59
|
-
return {
|
|
60
|
-
content: [{ type: "text", text: `Command blocked: ${blocked}` }],
|
|
61
|
-
details: { type: "exec", error: "blocked_by_guard", reason: blocked },
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// ── Background mode ─────────────────────────────────
|
|
66
|
-
if (params.background) {
|
|
67
|
-
if (!deps.execBackground) {
|
|
68
|
-
return {
|
|
69
|
-
content: [{ type: "text", text: "Background execution is not supported by the current host." }],
|
|
70
|
-
details: { type: "exec", error: "background_not_supported" },
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
const bgResult = await deps.execBackground(params.command, {
|
|
74
|
-
workdir: params.workdir,
|
|
75
|
-
});
|
|
76
|
-
const text = bgResult.started
|
|
77
|
-
? `Background process started (pid: ${bgResult.pid}).${bgResult.hint ? ` ${bgResult.hint}` : ""}\nUse getOutput with this pid to check on it later.`
|
|
78
|
-
: `Failed to start background process.`;
|
|
79
|
-
return {
|
|
80
|
-
content: [{ type: "text", text }],
|
|
81
|
-
details: {
|
|
82
|
-
type: "exec_background",
|
|
83
|
-
pid: bgResult.pid,
|
|
84
|
-
started: bgResult.started,
|
|
85
|
-
description: params.description,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
// ── Foreground mode ─────────────────────────────────
|
|
90
|
-
const timeout = params.timeout ?? DEFAULT_TIMEOUT;
|
|
91
|
-
const result = await deps.exec(params.command, {
|
|
92
|
-
workdir: params.workdir,
|
|
93
|
-
timeout,
|
|
94
|
-
});
|
|
95
|
-
const fullOutput = (result.stdout || "") + (result.stderr || "");
|
|
96
|
-
const parts = [];
|
|
97
|
-
// Large output persistence
|
|
98
|
-
let persistedUri;
|
|
99
|
-
if (fullOutput.length > MAX_OUTPUT_CHARS && deps.persistOutput) {
|
|
100
|
-
persistedUri = await deps.persistOutput(fullOutput, { command: params.command, exitCode: result.exitCode });
|
|
101
|
-
}
|
|
102
|
-
if (result.stdout) {
|
|
103
|
-
parts.push(persistedUri
|
|
104
|
-
? truncateOutput(result.stdout, MAX_OUTPUT_CHARS / 2)
|
|
105
|
-
: truncateOutput(result.stdout, MAX_OUTPUT_CHARS));
|
|
106
|
-
}
|
|
107
|
-
if (result.stderr)
|
|
108
|
-
parts.push(`[stderr]\n${truncateOutput(result.stderr, MAX_OUTPUT_CHARS / 4)}`);
|
|
109
|
-
if (result.timedOut)
|
|
110
|
-
parts.push(`[timed out after ${timeout}s]`);
|
|
111
|
-
if (persistedUri)
|
|
112
|
-
parts.push(`[full output persisted: ${persistedUri}]`);
|
|
113
|
-
// Semantic exit code interpretation
|
|
114
|
-
if (result.exitCode !== 0 && deps.interpretExitCode) {
|
|
115
|
-
const hint = deps.interpretExitCode(result.exitCode, result.stderr || "");
|
|
116
|
-
if (hint)
|
|
117
|
-
parts.push(`[exit ${result.exitCode}: ${hint}]`);
|
|
118
|
-
}
|
|
119
|
-
if (parts.length === 0)
|
|
120
|
-
parts.push(`(exit code ${result.exitCode}, no output)`);
|
|
121
|
-
return {
|
|
122
|
-
content: [{ type: "text", text: parts.join("\n") }],
|
|
123
|
-
details: {
|
|
124
|
-
type: "exec",
|
|
125
|
-
exitCode: result.exitCode,
|
|
126
|
-
timedOut: result.timedOut ?? false,
|
|
127
|
-
description: params.description,
|
|
128
|
-
persistedUri,
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=exec-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/exec-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,8DAA8D;AAC9D,mBAAmB;AACnB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAU9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,0EAA0E;SAC7E;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,6FAA6F;gB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nB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC7B,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAClC;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,YAAY,CAAC,uBAAuB,CAAC,CAmCvC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Image Generate Tool — generate images via backend adapter.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const IMAGE_GENERATE_TOOL_NAME = "image_generate";
|
|
6
|
-
export const IMAGE_GENERATE_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
prompt: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Image generation prompt. Enrich vague requests with style, lighting, composition, color, mood details.",
|
|
12
|
-
},
|
|
13
|
-
purpose: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Intended use: 'social-media', 'short-video-cover', 'phone-wallpaper', 'avatar', 'poster', etc.",
|
|
16
|
-
},
|
|
17
|
-
style: {
|
|
18
|
-
type: "string",
|
|
19
|
-
description: "Visual art style: 'photorealistic', 'anime', 'watercolor', 'oil-painting', '3d-render', etc.",
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Dimensions: e.g. '1024x1792' (portrait), '1792x1024' (landscape), '1024x1024' (square). Default: '1024x1024'.",
|
|
24
|
-
},
|
|
25
|
-
image_url: {
|
|
26
|
-
type: "string",
|
|
27
|
-
description: "Reference image URL for image-to-image generation (img2img). Character reference sheet or style transfer.",
|
|
28
|
-
},
|
|
29
|
-
n: {
|
|
30
|
-
type: "number",
|
|
31
|
-
description: "Number of images to generate (1-4). Default: 1.",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
required: ["prompt"],
|
|
35
|
-
};
|
|
36
|
-
export function createImageGenerateTool(deps) {
|
|
37
|
-
return {
|
|
38
|
-
name: IMAGE_GENERATE_TOOL_NAME,
|
|
39
|
-
label: "Image Generate",
|
|
40
|
-
description: "Generate images from a text prompt. You MUST enrich vague prompts with details about style, lighting, " +
|
|
41
|
-
"composition, color, and mood before calling. Supports img2img via image_url reference. " +
|
|
42
|
-
"All generated images are saved locally and can be viewed immediately.",
|
|
43
|
-
parameters: IMAGE_GENERATE_TOOL_SCHEMA,
|
|
44
|
-
execute: async (_toolCallId, params) => {
|
|
45
|
-
const result = await deps.generateImage({
|
|
46
|
-
prompt: params.prompt,
|
|
47
|
-
purpose: params.purpose,
|
|
48
|
-
style: params.style,
|
|
49
|
-
size: params.size,
|
|
50
|
-
imageUrl: params.image_url,
|
|
51
|
-
n: params.n,
|
|
52
|
-
});
|
|
53
|
-
const count = result.mediaUrls.length;
|
|
54
|
-
const text = `Generated ${count} image${count > 1 ? "s" : ""}${result.model ? ` (model: ${result.model})` : ""}`;
|
|
55
|
-
return {
|
|
56
|
-
content: [{ type: "text", text }],
|
|
57
|
-
details: {
|
|
58
|
-
type: "image_generate",
|
|
59
|
-
model: result.model,
|
|
60
|
-
size: result.size,
|
|
61
|
-
durationMs: result.durationMs,
|
|
62
|
-
mediaUrls: result.mediaUrls,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=image-generate-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-generate-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/image-generate-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,kBAAkB;AAClB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAyB,CAAC;AAWlE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,wGAAwG;SAC3G;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,gGAAgG;SACnG;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,8FAA8F;SACjG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,+GAA+G;SAClH;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,2GAA2G;SAC9G;QACD,CAAC,EAAE;YACD,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,iDAAiD;SAC/D;KACF;IACD,QAAQ,EAAE,CAAC,QAAQ,CAAU;CACrB,CAAC;AAyBX,MAAM,UAAU,uBAAuB,CACrC,IAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,wGAAwG;YACxG,yFAAyF;YACzF,uEAAuE;QACzE,UAAU,EAAE,0BAA0B;QAEtC,OAAO,EAAE,KAAK,EAAE,WAAmB,EAAE,MAA+B,EAA+B,EA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