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,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed YAML frontmatter from a SKILL.md file.
|
|
3
|
+
* Keys are lowercased header names; values are always coerced to strings.
|
|
4
|
+
*/
|
|
5
|
+
export type ParsedSkillFrontmatter = Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* A discovered skill on the filesystem.
|
|
8
|
+
*/
|
|
9
|
+
export interface WorkspaceSkill {
|
|
10
|
+
/** Display name (directory name by default). */
|
|
11
|
+
name: string;
|
|
12
|
+
/** One-line description extracted from frontmatter. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Source tag for precedence/debugging, e.g. "bundled", "user", "project". */
|
|
15
|
+
source: string;
|
|
16
|
+
/** Absolute path to the SKILL.md file. */
|
|
17
|
+
filePath: string;
|
|
18
|
+
/** Absolute path to the skill directory (parent of SKILL.md). */
|
|
19
|
+
baseDir: string;
|
|
20
|
+
/** Primary runtime environment hint, e.g. "node", "python". */
|
|
21
|
+
primaryEnv?: string;
|
|
22
|
+
/** Environment variables the skill requires. */
|
|
23
|
+
requiredEnv?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Package-manager install specification for a skill dependency.
|
|
27
|
+
*/
|
|
28
|
+
export interface SkillInstallSpec {
|
|
29
|
+
id?: string;
|
|
30
|
+
kind: "brew" | "node" | "go" | "uv" | "download";
|
|
31
|
+
label?: string;
|
|
32
|
+
bins?: string[];
|
|
33
|
+
os?: string[];
|
|
34
|
+
formula?: string;
|
|
35
|
+
package?: string;
|
|
36
|
+
module?: string;
|
|
37
|
+
url?: string;
|
|
38
|
+
archive?: string;
|
|
39
|
+
extract?: boolean;
|
|
40
|
+
stripComponents?: number;
|
|
41
|
+
targetDir?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Structured metadata from the `openclaw:` block inside SKILL.md frontmatter.
|
|
45
|
+
*/
|
|
46
|
+
export interface SkillMetadata {
|
|
47
|
+
/** If true, always include in prompt regardless of filter. */
|
|
48
|
+
always?: boolean;
|
|
49
|
+
/** Override key for deduplication / user-facing identification. */
|
|
50
|
+
skillKey?: string;
|
|
51
|
+
primaryEnv?: string;
|
|
52
|
+
emoji?: string;
|
|
53
|
+
homepage?: string;
|
|
54
|
+
/** Platform restriction: "win32", "darwin", "linux". */
|
|
55
|
+
os?: string[];
|
|
56
|
+
/** Use-case category for UI grouping. */
|
|
57
|
+
category?: string;
|
|
58
|
+
requires?: {
|
|
59
|
+
bins?: string[];
|
|
60
|
+
anyBins?: string[];
|
|
61
|
+
env?: string[];
|
|
62
|
+
config?: string[];
|
|
63
|
+
};
|
|
64
|
+
install?: SkillInstallSpec[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Controls how a skill may be activated by user commands or model tool calls.
|
|
68
|
+
*/
|
|
69
|
+
export interface SkillInvocationPolicy {
|
|
70
|
+
/** Whether users can directly invoke this skill via slash-command. */
|
|
71
|
+
userInvocable: boolean;
|
|
72
|
+
/** If true, the model cannot trigger this skill autonomously. */
|
|
73
|
+
disableModelInvocation: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A fully resolved skill entry with parsed metadata.
|
|
77
|
+
*/
|
|
78
|
+
export interface SkillEntry {
|
|
79
|
+
skill: WorkspaceSkill;
|
|
80
|
+
frontmatter: ParsedSkillFrontmatter;
|
|
81
|
+
metadata?: SkillMetadata;
|
|
82
|
+
invocation?: SkillInvocationPolicy;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Slash-command dispatch specification for a skill.
|
|
86
|
+
*/
|
|
87
|
+
export interface SkillCommandDispatchSpec {
|
|
88
|
+
kind: "tool";
|
|
89
|
+
toolName: string;
|
|
90
|
+
argMode?: "raw";
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A skill-derived slash-command for IM platforms.
|
|
94
|
+
*/
|
|
95
|
+
export interface SkillCommandSpec {
|
|
96
|
+
name: string;
|
|
97
|
+
skillName: string;
|
|
98
|
+
description: string;
|
|
99
|
+
dispatch?: SkillCommandDispatchSpec;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Serialized skill snapshot for system-prompt embedding.
|
|
103
|
+
*/
|
|
104
|
+
export interface SkillSnapshot {
|
|
105
|
+
prompt: string;
|
|
106
|
+
skills: Array<{
|
|
107
|
+
name: string;
|
|
108
|
+
primaryEnv?: string;
|
|
109
|
+
requiredEnv?: string[];
|
|
110
|
+
}>;
|
|
111
|
+
skillFilter?: string[];
|
|
112
|
+
version?: number;
|
|
113
|
+
}
|
|
114
|
+
export type SkillScanSeverity = "info" | "warn" | "critical";
|
|
115
|
+
export interface SkillScanFinding {
|
|
116
|
+
ruleId: string;
|
|
117
|
+
severity: SkillScanSeverity;
|
|
118
|
+
file: string;
|
|
119
|
+
line: number;
|
|
120
|
+
message: string;
|
|
121
|
+
evidence: string;
|
|
122
|
+
}
|
|
123
|
+
export interface SkillScanSummary {
|
|
124
|
+
scannedFiles: number;
|
|
125
|
+
critical: number;
|
|
126
|
+
warn: number;
|
|
127
|
+
info: number;
|
|
128
|
+
findings: SkillScanFinding[];
|
|
129
|
+
}
|
|
130
|
+
export interface SkillScanOptions {
|
|
131
|
+
includeFiles?: string[];
|
|
132
|
+
maxFiles?: number;
|
|
133
|
+
maxFileBytes?: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Filesystem dependencies injected by the host runtime.
|
|
137
|
+
* Keeps the skill system decoupled from Node.js `fs` / `path`.
|
|
138
|
+
*/
|
|
139
|
+
export interface SkillFsDeps {
|
|
140
|
+
readFileSync(path: string, encoding: "utf-8"): string;
|
|
141
|
+
readFile(path: string, encoding: "utf-8"): Promise<string>;
|
|
142
|
+
existsSync(path: string): boolean;
|
|
143
|
+
statSync(path: string): {
|
|
144
|
+
size: number;
|
|
145
|
+
mtimeMs: number;
|
|
146
|
+
isDirectory(): boolean;
|
|
147
|
+
};
|
|
148
|
+
readdirSync(path: string, opts: {
|
|
149
|
+
withFileTypes: true;
|
|
150
|
+
}): Array<{
|
|
151
|
+
name: string;
|
|
152
|
+
isDirectory(): boolean;
|
|
153
|
+
isSymbolicLink(): boolean;
|
|
154
|
+
}>;
|
|
155
|
+
realpathSync(path: string): string;
|
|
156
|
+
}
|
|
157
|
+
export interface SkillPathDeps {
|
|
158
|
+
join(...segments: string[]): string;
|
|
159
|
+
resolve(...segments: string[]): string;
|
|
160
|
+
extname(p: string): string;
|
|
161
|
+
sep: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Configurable limits for skill discovery to prevent abuse.
|
|
165
|
+
*/
|
|
166
|
+
export interface SkillLoadLimits {
|
|
167
|
+
maxCandidatesPerRoot?: number;
|
|
168
|
+
maxSkillsLoadedPerSource?: number;
|
|
169
|
+
maxSkillsInPrompt?: number;
|
|
170
|
+
maxSkillsPromptChars?: number;
|
|
171
|
+
maxSkillFileBytes?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Search paths for skill discovery, ordered by precedence (low → high).
|
|
175
|
+
*/
|
|
176
|
+
export interface SkillSearchPaths {
|
|
177
|
+
/** Bundled with npm package or app install. */
|
|
178
|
+
bundled?: string;
|
|
179
|
+
/** Extra directories from config. */
|
|
180
|
+
extra?: string[];
|
|
181
|
+
/** Managed skills (installed via CLI). */
|
|
182
|
+
managed?: string;
|
|
183
|
+
/** Personal agent skills: ~/.agents/skills/ */
|
|
184
|
+
personalAgents?: string;
|
|
185
|
+
/** Project agent skills: <workspace>/.agents/skills/ */
|
|
186
|
+
projectAgents?: string;
|
|
187
|
+
/** Workspace-level: <workspace>/skills/ */
|
|
188
|
+
workspace?: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Aggregate deps for the skill loader.
|
|
192
|
+
*/
|
|
193
|
+
export interface SkillLoaderDeps {
|
|
194
|
+
fs: SkillFsDeps;
|
|
195
|
+
path: SkillPathDeps;
|
|
196
|
+
homeDir: string;
|
|
197
|
+
searchPaths: SkillSearchPaths;
|
|
198
|
+
limits?: SkillLoadLimits;
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=skill-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-types.d.ts","sourceRoot":"","sources":["../../src/skills/skill-types.ts"],"names":[],"mappings":"AA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eAAe,CAAC;CAC1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Skill system type definitions — portable, runtime-agnostic.
|
|
3
|
+
// Mirrors openclaw/src/agents/skills/types.ts + security/skill-scanner.ts
|
|
4
|
+
// but decoupled from framework internals.
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=skill-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-types.js","sourceRoot":"","sources":["../../src/skills/skill-types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8DAA8D;AAC9D,0EAA0E;AAC1E,0CAA0C;AAC1C,8EAA8E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PortableTool } from "./portable-tool.js";
|
|
2
|
+
export declare const THINK_TOOL_NAME: "think";
|
|
3
|
+
export interface ThinkToolParams {
|
|
4
|
+
thought: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const THINK_TOOL_SCHEMA: {
|
|
7
|
+
readonly type: "object";
|
|
8
|
+
readonly properties: {
|
|
9
|
+
readonly thought: {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly description: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly required: readonly ["thought"];
|
|
15
|
+
};
|
|
16
|
+
export declare function createThinkTool(): PortableTool<ThinkToolParams>;
|
|
17
|
+
//# sourceMappingURL=think-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"think-tool.d.ts","sourceRoot":"","sources":["../../src/skills/think-tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAE3E,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;CAkBpB,CAAC;AAEX,wBAAgB,eAAe,IAAI,YAAY,CAAC,eAAe,CAAC,CAgC/D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Think Tool — explicit reasoning before complex decisions.
|
|
3
|
+
//
|
|
4
|
+
// The Agent calls `think` to reason step-by-step before deciding
|
|
5
|
+
// which tools to use. The thought is never shown to the user.
|
|
6
|
+
// Pure no-op: zero side effects, zero dependencies.
|
|
7
|
+
// ============================================================
|
|
8
|
+
export const THINK_TOOL_NAME = "think";
|
|
9
|
+
export const THINK_TOOL_SCHEMA = {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
thought: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: [
|
|
15
|
+
"Your internal reasoning about the current situation.",
|
|
16
|
+
"Use this to:",
|
|
17
|
+
"• Analyze what the user really wants (disambiguate vague requests)",
|
|
18
|
+
"• Plan multi-step approaches before executing",
|
|
19
|
+
"• Evaluate which tool(s) to use and why",
|
|
20
|
+
"• Consider edge cases or potential issues",
|
|
21
|
+
"• Reflect on conversation context and user preferences",
|
|
22
|
+
"This content is never shown to the user.",
|
|
23
|
+
].join("\n"),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ["thought"],
|
|
27
|
+
};
|
|
28
|
+
export function createThinkTool() {
|
|
29
|
+
return {
|
|
30
|
+
name: THINK_TOOL_NAME,
|
|
31
|
+
label: "Think",
|
|
32
|
+
shouldDefer: true,
|
|
33
|
+
description: [
|
|
34
|
+
"Use this tool to think and reason about the current situation BEFORE taking action.",
|
|
35
|
+
"Call this tool when you need to:",
|
|
36
|
+
"- Analyze an ambiguous or complex user request before deciding what to do",
|
|
37
|
+
"- Plan a multi-step approach (what tools to call and in what order)",
|
|
38
|
+
"- Identify which steps can run in parallel vs. which must be sequential",
|
|
39
|
+
"- Evaluate tradeoffs between different approaches",
|
|
40
|
+
"- Reflect on user preferences from conversation history",
|
|
41
|
+
"- Process new information that changes your understanding",
|
|
42
|
+
"",
|
|
43
|
+
"This tool has NO side effects — it simply records your reasoning process.",
|
|
44
|
+
"Your thought is NOT shown to the user; it only improves YOUR decision quality.",
|
|
45
|
+
"After thinking, proceed to take the appropriate action.",
|
|
46
|
+
"",
|
|
47
|
+
"When planning multi-step work, be explicit about parallelism:",
|
|
48
|
+
'- Say "这些可以并行生成" or "these can run in parallel" for independent tasks.',
|
|
49
|
+
'- Say "先…然后…" or "step 1 first, then step 2" for sequential dependencies.',
|
|
50
|
+
].join("\n"),
|
|
51
|
+
parameters: THINK_TOOL_SCHEMA,
|
|
52
|
+
execute: async (_toolCallId, _params) => {
|
|
53
|
+
return {
|
|
54
|
+
content: [{ type: "text", text: "Thought recorded. Now proceed with the best action based on your reasoning." }],
|
|
55
|
+
details: { type: "think" },
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=think-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"think-tool.js","sourceRoot":"","sources":["../../src/skills/think-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,EAAE;AACF,iEAAiE;AACjE,8DAA8D;AAC9D,oDAAoD;AACpD,+DAA+D;AAI/D,MAAM,CAAC,MAAM,eAAe,GAAG,OAAgB,CAAC;AAMhD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE;gBACX,sDAAsD;gBACtD,cAAc;gBACd,oEAAoE;gBACpE,+CAA+C;gBAC/C,yCAAyC;gBACzC,2CAA2C;gBAC3C,wDAAwD;gBACxD,0CAA0C;aAC3C,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;IACD,QAAQ,EAAE,CAAC,SAAS,CAAU;CACtB,CAAC;AAEX,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE;YACX,qFAAqF;YACrF,kCAAkC;YAClC,2EAA2E;YAC3E,qEAAqE;YACrE,yEAAyE;YACzE,mDAAmD;YACnD,yDAAyD;YACzD,2DAA2D;YAC3D,EAAE;YACF,2EAA2E;YAC3E,gFAAgF;YAChF,yDAAyD;YACzD,EAAE;YACF,+DAA+D;YAC/D,wEAAwE;YACxE,2EAA2E;SAC5E,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,UAAU,EAAE,iBAAiB;QAE7B,OAAO,EAAE,KAAK,EAAE,WAAmB,EAAE,OAAwB,EAA+B,EAAE;YAC5F,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6EAA6E,EAAE,CAAC;gBAChH,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;aAC3B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { TodoItem } from "../contracts/todo.js";
|
|
2
|
+
import type { PortableTool } from "./portable-tool.js";
|
|
3
|
+
export declare const TODO_TOOL_NAME: "todo";
|
|
4
|
+
export interface TodoToolParams {
|
|
5
|
+
todoList: TodoItem[];
|
|
6
|
+
}
|
|
7
|
+
export declare const TODO_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly todoList: {
|
|
11
|
+
readonly type: "array";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly items: {
|
|
14
|
+
readonly type: "object";
|
|
15
|
+
readonly properties: {
|
|
16
|
+
readonly id: {
|
|
17
|
+
readonly type: "number";
|
|
18
|
+
readonly description: "Unique numeric id (sequential from 1).";
|
|
19
|
+
};
|
|
20
|
+
readonly title: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "Concise action-oriented label (3-7 words). Displayed in UI.";
|
|
23
|
+
};
|
|
24
|
+
readonly status: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly enum: readonly ["not-started", "in-progress", "completed"];
|
|
27
|
+
readonly description: "not-started | in-progress (max 1) | completed";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
readonly required: readonly ["id", "title", "status"];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly required: readonly ["todoList"];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Configuration for todo tool behavior (CC-aligned features).
|
|
38
|
+
*/
|
|
39
|
+
export interface TodoToolOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Unique agent/session identifier for per-agent todo isolation.
|
|
42
|
+
* When provided, different agents have independent todo lists.
|
|
43
|
+
*/
|
|
44
|
+
agentId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether verification nudge is enabled.
|
|
47
|
+
* When all items are completed (≥3 items, none matching /verif/i),
|
|
48
|
+
* the tool signals that a verification sub-agent should be spawned.
|
|
49
|
+
*/
|
|
50
|
+
enableVerificationNudge?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to auto-clear the list when all items are completed.
|
|
53
|
+
* Matches CC behavior: allDone → newTodos = [].
|
|
54
|
+
*/
|
|
55
|
+
autoClearOnComplete?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a stateful todo tool instance.
|
|
59
|
+
*
|
|
60
|
+
* Each call returns a tool with its own session-local list.
|
|
61
|
+
* Multiple instances can exist for different sessions/agents.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createTodoTool(options?: TodoToolOptions): PortableTool<TodoToolParams>;
|
|
64
|
+
//# sourceMappingURL=todo-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo-tool.d.ts","sourceRoot":"","sources":["../../src/skills/todo-tool.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAE3E,eAAO,MAAM,cAAc,EAAG,MAAe,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBnB,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,YAAY,CAAC,cAAc,CAAC,CA4EtF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Todo Tool — session-level structured task management.
|
|
3
|
+
//
|
|
4
|
+
// Allows the agent to create, update, and track multi-step task
|
|
5
|
+
// lists during complex conversations. Each tool invocation
|
|
6
|
+
// replaces the full todo list (same pattern as Copilot's
|
|
7
|
+
// manage_todo_list).
|
|
8
|
+
//
|
|
9
|
+
// Aligned with Claude Code TodoWriteTool:
|
|
10
|
+
// - activeForm field (present-tense text for UI spinners)
|
|
11
|
+
// - oldTodos snapshot returned for diffing
|
|
12
|
+
// - Auto-clear when all items completed
|
|
13
|
+
// - verificationNudgeNeeded signal
|
|
14
|
+
// - Per-agent isolation via agentId option
|
|
15
|
+
//
|
|
16
|
+
// Reference: claude-code-haha/src/tools/TodoWriteTool/TodoWriteTool.ts
|
|
17
|
+
// ============================================================
|
|
18
|
+
import { summarizeTodoList } from "../contracts/todo.js";
|
|
19
|
+
export const TODO_TOOL_NAME = "todo";
|
|
20
|
+
export const TODO_TOOL_SCHEMA = {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
todoList: {
|
|
24
|
+
type: "array",
|
|
25
|
+
description: "Complete array of ALL todo items. Must include both existing and new items. " +
|
|
26
|
+
"Only one item may be in-progress at a time. Mark todos completed " +
|
|
27
|
+
"IMMEDIATELY after finishing — do not batch completions.",
|
|
28
|
+
items: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
id: { type: "number", description: "Unique numeric id (sequential from 1)." },
|
|
32
|
+
title: { type: "string", description: "Concise action-oriented label (3-7 words). Displayed in UI." },
|
|
33
|
+
status: {
|
|
34
|
+
type: "string",
|
|
35
|
+
enum: ["not-started", "in-progress", "completed"],
|
|
36
|
+
description: "not-started | in-progress (max 1) | completed",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["id", "title", "status"],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: ["todoList"],
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Create a stateful todo tool instance.
|
|
47
|
+
*
|
|
48
|
+
* Each call returns a tool with its own session-local list.
|
|
49
|
+
* Multiple instances can exist for different sessions/agents.
|
|
50
|
+
*/
|
|
51
|
+
export function createTodoTool(options) {
|
|
52
|
+
let currentList = [];
|
|
53
|
+
const opts = options ?? {};
|
|
54
|
+
return {
|
|
55
|
+
name: TODO_TOOL_NAME,
|
|
56
|
+
label: "Todo",
|
|
57
|
+
description: "Manage a structured todo list to track progress on multi-step tasks. " +
|
|
58
|
+
"Each call replaces the full list. Use frequently during complex work " +
|
|
59
|
+
"to plan steps and show progress. Mark items in-progress before starting, " +
|
|
60
|
+
"completed immediately after finishing.",
|
|
61
|
+
parameters: TODO_TOOL_SCHEMA,
|
|
62
|
+
searchHint: "manage session task checklist progress tracking",
|
|
63
|
+
maxResultSizeChars: 100_000,
|
|
64
|
+
execute: async (_toolCallId, params) => {
|
|
65
|
+
const items = params.todoList;
|
|
66
|
+
// Validate: at most 1 in-progress
|
|
67
|
+
const inProgress = items.filter((t) => t.status === "in-progress");
|
|
68
|
+
if (inProgress.length > 1) {
|
|
69
|
+
return {
|
|
70
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
71
|
+
warning: `Only 1 item may be in-progress at a time (found ${inProgress.length}).`,
|
|
72
|
+
todoList: currentList,
|
|
73
|
+
}) }],
|
|
74
|
+
details: { type: "todo", warning: "multiple_in_progress" },
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Capture old state for diff (CC-aligned: returns oldTodos)
|
|
78
|
+
const oldTodos = [...currentList];
|
|
79
|
+
// Check if all items are completed
|
|
80
|
+
const allDone = items.length > 0 && items.every((t) => t.status === "completed");
|
|
81
|
+
// Auto-clear when all completed (CC behavior)
|
|
82
|
+
if (allDone && opts.autoClearOnComplete) {
|
|
83
|
+
currentList = [];
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
currentList = items;
|
|
87
|
+
}
|
|
88
|
+
const summary = summarizeTodoList(items);
|
|
89
|
+
// Verification nudge: ≥3 items, all done, none matching /verif/i
|
|
90
|
+
let verificationNudgeNeeded = false;
|
|
91
|
+
if (opts.enableVerificationNudge &&
|
|
92
|
+
allDone &&
|
|
93
|
+
items.length >= 3 &&
|
|
94
|
+
!items.some((t) => /verif/i.test(t.title))) {
|
|
95
|
+
verificationNudgeNeeded = true;
|
|
96
|
+
}
|
|
97
|
+
const result = {
|
|
98
|
+
total: summary.total,
|
|
99
|
+
completed: summary.completed,
|
|
100
|
+
inProgress: summary.inProgress,
|
|
101
|
+
notStarted: summary.notStarted,
|
|
102
|
+
todoList: currentList,
|
|
103
|
+
oldTodos,
|
|
104
|
+
};
|
|
105
|
+
if (verificationNudgeNeeded) {
|
|
106
|
+
result.verificationNudgeNeeded = true;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
110
|
+
details: { type: "todo", ...summary, verificationNudgeNeeded, agentId: opts.agentId },
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=todo-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo-tool.js","sourceRoot":"","sources":["../../src/skills/todo-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wDAAwD;AACxD,EAAE;AACF,gEAAgE;AAChE,2DAA2D;AAC3D,yDAAyD;AACzD,qBAAqB;AACrB,EAAE;AACF,0CAA0C;AAC1C,0DAA0D;AAC1D,2CAA2C;AAC3C,wCAAwC;AACxC,mCAAmC;AACnC,2CAA2C;AAC3C,EAAE;AACF,uEAAuE;AACvE,+DAA+D;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAM9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,OAAgB;YACtB,WAAW,EACT,8EAA8E;gBAC9E,mEAAmE;gBACnE,yDAAyD;YAC3D,KAAK,EAAE;gBACL,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,wCAAwC,EAAE;oBACtF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,6DAA6D,EAAE;oBAC9G,MAAM,EAAE;wBACN,IAAI,EAAE,QAAiB;wBACvB,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,CAAC;wBACjD,WAAW,EAAE,+CAA+C;qBAC7D;iBACF;gBACD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CA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|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const AGENT_TOOL_NAME: "agent";
|
|
3
|
+
/**
|
|
4
|
+
* Built-in agent types (CC-aligned registry).
|
|
5
|
+
* The LLM selects which agent to fork based on the task.
|
|
6
|
+
*/
|
|
7
|
+
export type BuiltInAgentType = "general" | "explore" | "plan" | "code" | "research" | "verify";
|
|
8
|
+
export declare const BUILT_IN_AGENT_TYPES: BuiltInAgentType[];
|
|
9
|
+
export interface AgentToolParams {
|
|
10
|
+
/** Built-in agent type to invoke. */
|
|
11
|
+
agent: BuiltInAgentType;
|
|
12
|
+
/** Detailed task prompt for the sub-agent. */
|
|
13
|
+
prompt: string;
|
|
14
|
+
/** Short description of the task (3-7 words). Used for status display. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Max turns override (default varies by agent type). */
|
|
17
|
+
maxTurns?: number;
|
|
18
|
+
/** Run in background (returns task_id immediately). */
|
|
19
|
+
background?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const AGENT_TOOL_SCHEMA: {
|
|
22
|
+
readonly type: "object";
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly agent: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly enum: readonly ["general", "explore", "plan", "code", "research", "verify"];
|
|
27
|
+
readonly description: string;
|
|
28
|
+
};
|
|
29
|
+
readonly prompt: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly description: string;
|
|
32
|
+
};
|
|
33
|
+
readonly description: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly description: "Short description (3-7 words) for status tracking.";
|
|
36
|
+
};
|
|
37
|
+
readonly maxTurns: {
|
|
38
|
+
readonly type: "number";
|
|
39
|
+
readonly description: "Max turns for the sub-agent. Defaults: general=200, explore=50, plan=80, code=200, research=30, verify=40.";
|
|
40
|
+
};
|
|
41
|
+
readonly background: {
|
|
42
|
+
readonly type: "boolean";
|
|
43
|
+
readonly description: "If true, runs in background and returns a task_id. Poll with task tool. Default: false.";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly required: readonly ["agent", "prompt"];
|
|
47
|
+
readonly additionalProperties: false;
|
|
48
|
+
};
|
|
49
|
+
export interface AgentResult {
|
|
50
|
+
agentId: string;
|
|
51
|
+
status: "completed" | "running" | "failed";
|
|
52
|
+
output?: string;
|
|
53
|
+
error?: string;
|
|
54
|
+
maxTurnsReached?: boolean;
|
|
55
|
+
tokensUsed?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Host-provided fork execution backend (CC-aligned).
|
|
59
|
+
*
|
|
60
|
+
* Key properties of the fork mechanism:
|
|
61
|
+
* 1. Child shares parent's message prefix (prompt cache hit)
|
|
62
|
+
* 2. Child uses byte-identical prefix via placeholder results
|
|
63
|
+
* 3. Child has independent tool context (isolation)
|
|
64
|
+
* 4. Results flow back via in-memory streaming (not DB)
|
|
65
|
+
* 5. Fork depth tracked in-memory (max 4 layers)
|
|
66
|
+
*/
|
|
67
|
+
export interface AgentToolDeps {
|
|
68
|
+
/**
|
|
69
|
+
* Fork and run a sub-agent.
|
|
70
|
+
* The implementation must:
|
|
71
|
+
* - Share parent's rendered system prompt (byte-identical for cache)
|
|
72
|
+
* - Inherit parent's tool pool (filtered by agent definition)
|
|
73
|
+
* - Track fork depth (reject if > MAX_FORK_DEPTH)
|
|
74
|
+
* - Return output via in-memory streaming backflow
|
|
75
|
+
*/
|
|
76
|
+
forkAgent(params: {
|
|
77
|
+
agent: BuiltInAgentType;
|
|
78
|
+
prompt: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
maxTurns?: number;
|
|
81
|
+
background?: boolean;
|
|
82
|
+
abortSignal?: AbortSignal;
|
|
83
|
+
}): Promise<AgentResult>;
|
|
84
|
+
/** Abort signal from the parent turn. */
|
|
85
|
+
abortSignal?: AbortSignal;
|
|
86
|
+
/** Current fork depth (0 = root). Used for depth guard. */
|
|
87
|
+
currentForkDepth?: number;
|
|
88
|
+
}
|
|
89
|
+
/** Maximum fork depth for in-memory agents. */
|
|
90
|
+
export declare const MAX_FORK_DEPTH = 4;
|
|
91
|
+
export declare function createAgentTool(deps: AgentToolDeps): PortableTool<AgentToolParams>;
|
|
92
|
+
//# sourceMappingURL=agent-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/agent-tool.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/F,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,EAElD,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,KAAK,EAAE,gBAAgB,CAAC;IACxB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCpB,CAAC;AAEX,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAO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