@wingman-ai/gateway 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/.wingman/agents/README.md +161 -0
- package/.wingman/agents/coding/agent.md +147 -0
- package/.wingman/agents/coding/implementor.md +56 -0
- package/.wingman/agents/main/agent.md +19 -0
- package/.wingman/agents/researcher/agent.md +62 -0
- package/.wingman/agents/stock-trader/agent.md +223 -0
- package/.wingman/agents/stock-trader/chain-curator.md +24 -0
- package/.wingman/agents/stock-trader/goal-translator.md +42 -0
- package/.wingman/agents/stock-trader/guardrails-veto.md +11 -0
- package/.wingman/agents/stock-trader/path-planner.md +23 -0
- package/.wingman/agents/stock-trader/regime-analyst.md +15 -0
- package/.wingman/agents/stock-trader/risk.md +20 -0
- package/.wingman/agents/stock-trader/selection.md +22 -0
- package/.wingman/agents/stock-trader/strategy-composer.md +38 -0
- package/.wingman/agents/wingman/agent.json +12 -0
- package/bin/wingman +7 -0
- package/dist/agent/config/agentConfig.cjs +95 -0
- package/dist/agent/config/agentConfig.d.ts +187 -0
- package/dist/agent/config/agentConfig.js +52 -0
- package/dist/agent/config/agentLoader.cjs +242 -0
- package/dist/agent/config/agentLoader.d.ts +42 -0
- package/dist/agent/config/agentLoader.js +208 -0
- package/dist/agent/config/mcpClientManager.cjs +168 -0
- package/dist/agent/config/mcpClientManager.d.ts +41 -0
- package/dist/agent/config/mcpClientManager.js +134 -0
- package/dist/agent/config/modelFactory.cjs +175 -0
- package/dist/agent/config/modelFactory.d.ts +33 -0
- package/dist/agent/config/modelFactory.js +141 -0
- package/dist/agent/config/toolRegistry.cjs +111 -0
- package/dist/agent/config/toolRegistry.d.ts +25 -0
- package/dist/agent/config/toolRegistry.js +71 -0
- package/dist/agent/middleware/additional-messages.cjs +60 -0
- package/dist/agent/middleware/additional-messages.d.ts +7 -0
- package/dist/agent/middleware/additional-messages.js +26 -0
- package/dist/agent/middleware/hooks/executor.cjs +137 -0
- package/dist/agent/middleware/hooks/executor.d.ts +52 -0
- package/dist/agent/middleware/hooks/executor.js +103 -0
- package/dist/agent/middleware/hooks/input-builder.cjs +55 -0
- package/dist/agent/middleware/hooks/input-builder.d.ts +15 -0
- package/dist/agent/middleware/hooks/input-builder.js +21 -0
- package/dist/agent/middleware/hooks/matcher.cjs +59 -0
- package/dist/agent/middleware/hooks/matcher.d.ts +27 -0
- package/dist/agent/middleware/hooks/matcher.js +22 -0
- package/dist/agent/middleware/hooks/merger.cjs +54 -0
- package/dist/agent/middleware/hooks/merger.d.ts +18 -0
- package/dist/agent/middleware/hooks/merger.js +20 -0
- package/dist/agent/middleware/hooks/types.cjs +62 -0
- package/dist/agent/middleware/hooks/types.d.ts +82 -0
- package/dist/agent/middleware/hooks/types.js +19 -0
- package/dist/agent/middleware/hooks.cjs +79 -0
- package/dist/agent/middleware/hooks.d.ts +19 -0
- package/dist/agent/middleware/hooks.js +45 -0
- package/dist/agent/middleware/media-compat.cjs +80 -0
- package/dist/agent/middleware/media-compat.d.ts +7 -0
- package/dist/agent/middleware/media-compat.js +46 -0
- package/dist/agent/tests/agentConfig.test.cjs +132 -0
- package/dist/agent/tests/agentConfig.test.d.ts +1 -0
- package/dist/agent/tests/agentConfig.test.js +126 -0
- package/dist/agent/tests/agentLoader.test.cjs +235 -0
- package/dist/agent/tests/agentLoader.test.d.ts +1 -0
- package/dist/agent/tests/agentLoader.test.js +229 -0
- package/dist/agent/tests/modelFactory.test.cjs +114 -0
- package/dist/agent/tests/modelFactory.test.d.ts +1 -0
- package/dist/agent/tests/modelFactory.test.js +108 -0
- package/dist/agent/tests/test-agent-loader.cjs +33 -0
- package/dist/agent/tests/test-agent-loader.d.ts +1 -0
- package/dist/agent/tests/test-agent-loader.js +27 -0
- package/dist/agent/tests/test-subagent-loading.cjs +99 -0
- package/dist/agent/tests/test-subagent-loading.d.ts +1 -0
- package/dist/agent/tests/test-subagent-loading.js +93 -0
- package/dist/agent/tests/toolRegistry.test.cjs +109 -0
- package/dist/agent/tests/toolRegistry.test.d.ts +1 -0
- package/dist/agent/tests/toolRegistry.test.js +103 -0
- package/dist/agent/tools/code_search.cjs +108 -0
- package/dist/agent/tools/code_search.d.ts +24 -0
- package/dist/agent/tools/code_search.js +74 -0
- package/dist/agent/tools/command_execute.cjs +136 -0
- package/dist/agent/tools/command_execute.d.ts +12 -0
- package/dist/agent/tools/command_execute.js +99 -0
- package/dist/agent/tools/git_status.cjs +126 -0
- package/dist/agent/tools/git_status.d.ts +15 -0
- package/dist/agent/tools/git_status.js +92 -0
- package/dist/agent/tools/internet_search.cjs +93 -0
- package/dist/agent/tools/internet_search.d.ts +25 -0
- package/dist/agent/tools/internet_search.js +56 -0
- package/dist/agent/tools/think.cjs +53 -0
- package/dist/agent/tools/think.d.ts +26 -0
- package/dist/agent/tools/think.js +16 -0
- package/dist/agent/tools/web_crawler.cjs +180 -0
- package/dist/agent/tools/web_crawler.d.ts +31 -0
- package/dist/agent/tools/web_crawler.js +143 -0
- package/dist/agent/utils.cjs +54 -0
- package/dist/agent/utils.d.ts +1 -0
- package/dist/agent/utils.js +10 -0
- package/dist/cli/commands/agent.cjs +169 -0
- package/dist/cli/commands/agent.d.ts +15 -0
- package/dist/cli/commands/agent.js +125 -0
- package/dist/cli/commands/gateway.cjs +601 -0
- package/dist/cli/commands/gateway.d.ts +12 -0
- package/dist/cli/commands/gateway.js +567 -0
- package/dist/cli/commands/init.cjs +681 -0
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +634 -0
- package/dist/cli/commands/provider.cjs +208 -0
- package/dist/cli/commands/provider.d.ts +5 -0
- package/dist/cli/commands/provider.js +174 -0
- package/dist/cli/commands/skill.cjs +145 -0
- package/dist/cli/commands/skill.d.ts +10 -0
- package/dist/cli/commands/skill.js +111 -0
- package/dist/cli/config/loader.cjs +143 -0
- package/dist/cli/config/loader.d.ts +14 -0
- package/dist/cli/config/loader.js +109 -0
- package/dist/cli/config/schema.cjs +262 -0
- package/dist/cli/config/schema.d.ts +268 -0
- package/dist/cli/config/schema.js +213 -0
- package/dist/cli/core/agentInvoker.cjs +284 -0
- package/dist/cli/core/agentInvoker.d.ts +77 -0
- package/dist/cli/core/agentInvoker.js +247 -0
- package/dist/cli/core/commandHandler.cjs +257 -0
- package/dist/cli/core/commandHandler.d.ts +62 -0
- package/dist/cli/core/commandHandler.js +223 -0
- package/dist/cli/core/database/bunSqliteAdapter.cjs +87 -0
- package/dist/cli/core/database/bunSqliteAdapter.d.ts +34 -0
- package/dist/cli/core/database/bunSqliteAdapter.js +53 -0
- package/dist/cli/core/loggerBridge.cjs +42 -0
- package/dist/cli/core/loggerBridge.d.ts +8 -0
- package/dist/cli/core/loggerBridge.js +8 -0
- package/dist/cli/core/outputManager.cjs +106 -0
- package/dist/cli/core/outputManager.d.ts +43 -0
- package/dist/cli/core/outputManager.js +72 -0
- package/dist/cli/core/sessionManager.cjs +535 -0
- package/dist/cli/core/sessionManager.d.ts +111 -0
- package/dist/cli/core/sessionManager.js +486 -0
- package/dist/cli/core/streamParser.cjs +328 -0
- package/dist/cli/core/streamParser.d.ts +42 -0
- package/dist/cli/core/streamParser.js +288 -0
- package/dist/cli/index.cjs +211 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +205 -0
- package/dist/cli/services/skillRepository.cjs +178 -0
- package/dist/cli/services/skillRepository.d.ts +35 -0
- package/dist/cli/services/skillRepository.js +144 -0
- package/dist/cli/services/skillService.cjs +336 -0
- package/dist/cli/services/skillService.d.ts +48 -0
- package/dist/cli/services/skillService.js +302 -0
- package/dist/cli/types/gateway.cjs +18 -0
- package/dist/cli/types/gateway.d.ts +18 -0
- package/dist/cli/types/gateway.js +0 -0
- package/dist/cli/types/init.cjs +18 -0
- package/dist/cli/types/init.d.ts +13 -0
- package/dist/cli/types/init.js +0 -0
- package/dist/cli/types/provider.cjs +18 -0
- package/dist/cli/types/provider.d.ts +9 -0
- package/dist/cli/types/provider.js +0 -0
- package/dist/cli/types/skill.cjs +18 -0
- package/dist/cli/types/skill.d.ts +71 -0
- package/dist/cli/types/skill.js +0 -0
- package/dist/cli/types.cjs +18 -0
- package/dist/cli/types.d.ts +175 -0
- package/dist/cli/types.js +0 -0
- package/dist/cli/ui/AgentOutput.cjs +82 -0
- package/dist/cli/ui/AgentOutput.d.ts +8 -0
- package/dist/cli/ui/AgentOutput.js +38 -0
- package/dist/cli/ui/App.cjs +285 -0
- package/dist/cli/ui/App.d.ts +6 -0
- package/dist/cli/ui/App.js +241 -0
- package/dist/cli/ui/ErrorDisplay.cjs +65 -0
- package/dist/cli/ui/ErrorDisplay.d.ts +8 -0
- package/dist/cli/ui/ErrorDisplay.js +21 -0
- package/dist/cli/ui/LogDisplay.cjs +74 -0
- package/dist/cli/ui/LogDisplay.d.ts +13 -0
- package/dist/cli/ui/LogDisplay.js +30 -0
- package/dist/cli/ui/SessionListDisplay.cjs +135 -0
- package/dist/cli/ui/SessionListDisplay.d.ts +9 -0
- package/dist/cli/ui/SessionListDisplay.js +91 -0
- package/dist/cli/ui/blockHelpers.cjs +80 -0
- package/dist/cli/ui/blockHelpers.d.ts +21 -0
- package/dist/cli/ui/blockHelpers.js +40 -0
- package/dist/cli/ui/components/ToolCallDisplay.cjs +207 -0
- package/dist/cli/ui/components/ToolCallDisplay.d.ts +7 -0
- package/dist/cli/ui/components/ToolCallDisplay.js +162 -0
- package/dist/cli/ui/components/ToolResultDisplay.cjs +86 -0
- package/dist/cli/ui/components/ToolResultDisplay.d.ts +8 -0
- package/dist/cli/ui/components/ToolResultDisplay.js +42 -0
- package/dist/cli/ui/toolDisplayHelpers.cjs +112 -0
- package/dist/cli/ui/toolDisplayHelpers.d.ts +3 -0
- package/dist/cli/ui/toolDisplayHelpers.js +72 -0
- package/dist/gateway/adapters/discord.cjs +298 -0
- package/dist/gateway/adapters/discord.d.ts +42 -0
- package/dist/gateway/adapters/discord.js +246 -0
- package/dist/gateway/auth.cjs +94 -0
- package/dist/gateway/auth.d.ts +36 -0
- package/dist/gateway/auth.js +60 -0
- package/dist/gateway/broadcast.cjs +131 -0
- package/dist/gateway/broadcast.d.ts +76 -0
- package/dist/gateway/broadcast.js +97 -0
- package/dist/gateway/client.cjs +282 -0
- package/dist/gateway/client.d.ts +141 -0
- package/dist/gateway/client.js +248 -0
- package/dist/gateway/daemon.cjs +195 -0
- package/dist/gateway/daemon.d.ts +67 -0
- package/dist/gateway/daemon.js +161 -0
- package/dist/gateway/discovery/index.cjs +72 -0
- package/dist/gateway/discovery/index.d.ts +3 -0
- package/dist/gateway/discovery/index.js +3 -0
- package/dist/gateway/discovery/mdns.cjs +221 -0
- package/dist/gateway/discovery/mdns.d.ts +37 -0
- package/dist/gateway/discovery/mdns.js +177 -0
- package/dist/gateway/discovery/tailscale.cjs +140 -0
- package/dist/gateway/discovery/tailscale.d.ts +31 -0
- package/dist/gateway/discovery/tailscale.js +106 -0
- package/dist/gateway/discovery/types.cjs +18 -0
- package/dist/gateway/discovery/types.d.ts +41 -0
- package/dist/gateway/discovery/types.js +0 -0
- package/dist/gateway/env.cjs +45 -0
- package/dist/gateway/env.d.ts +2 -0
- package/dist/gateway/env.js +8 -0
- package/dist/gateway/hooks/loader.cjs +137 -0
- package/dist/gateway/hooks/loader.d.ts +10 -0
- package/dist/gateway/hooks/loader.js +103 -0
- package/dist/gateway/hooks/registry.cjs +128 -0
- package/dist/gateway/hooks/registry.d.ts +13 -0
- package/dist/gateway/hooks/registry.js +94 -0
- package/dist/gateway/hooks/types.cjs +58 -0
- package/dist/gateway/hooks/types.d.ts +50 -0
- package/dist/gateway/hooks/types.js +18 -0
- package/dist/gateway/http/agents.cjs +280 -0
- package/dist/gateway/http/agents.d.ts +2 -0
- package/dist/gateway/http/agents.js +246 -0
- package/dist/gateway/http/fs.cjs +81 -0
- package/dist/gateway/http/fs.d.ts +2 -0
- package/dist/gateway/http/fs.js +47 -0
- package/dist/gateway/http/providers.cjs +120 -0
- package/dist/gateway/http/providers.d.ts +2 -0
- package/dist/gateway/http/providers.js +86 -0
- package/dist/gateway/http/routines.cjs +196 -0
- package/dist/gateway/http/routines.d.ts +20 -0
- package/dist/gateway/http/routines.js +159 -0
- package/dist/gateway/http/sessions.cjs +241 -0
- package/dist/gateway/http/sessions.d.ts +2 -0
- package/dist/gateway/http/sessions.js +207 -0
- package/dist/gateway/http/types.cjs +18 -0
- package/dist/gateway/http/types.d.ts +25 -0
- package/dist/gateway/http/types.js +0 -0
- package/dist/gateway/http/voice.cjs +167 -0
- package/dist/gateway/http/voice.d.ts +2 -0
- package/dist/gateway/http/voice.js +133 -0
- package/dist/gateway/http/webhooks.cjs +353 -0
- package/dist/gateway/http/webhooks.d.ts +22 -0
- package/dist/gateway/http/webhooks.js +313 -0
- package/dist/gateway/index.cjs +119 -0
- package/dist/gateway/index.d.ts +8 -0
- package/dist/gateway/index.js +9 -0
- package/dist/gateway/node.cjs +218 -0
- package/dist/gateway/node.d.ts +112 -0
- package/dist/gateway/node.js +184 -0
- package/dist/gateway/router.cjs +85 -0
- package/dist/gateway/router.d.ts +9 -0
- package/dist/gateway/router.js +51 -0
- package/dist/gateway/rpcClient.cjs +152 -0
- package/dist/gateway/rpcClient.d.ts +24 -0
- package/dist/gateway/rpcClient.js +118 -0
- package/dist/gateway/server.cjs +1175 -0
- package/dist/gateway/server.d.ts +185 -0
- package/dist/gateway/server.js +1138 -0
- package/dist/gateway/transport/http.cjs +153 -0
- package/dist/gateway/transport/http.d.ts +25 -0
- package/dist/gateway/transport/http.js +119 -0
- package/dist/gateway/transport/index.cjs +40 -0
- package/dist/gateway/transport/index.d.ts +3 -0
- package/dist/gateway/transport/index.js +3 -0
- package/dist/gateway/transport/types.cjs +18 -0
- package/dist/gateway/transport/types.d.ts +59 -0
- package/dist/gateway/transport/types.js +0 -0
- package/dist/gateway/transport/websocket.cjs +132 -0
- package/dist/gateway/transport/websocket.d.ts +21 -0
- package/dist/gateway/transport/websocket.js +98 -0
- package/dist/gateway/types.cjs +18 -0
- package/dist/gateway/types.d.ts +215 -0
- package/dist/gateway/types.js +0 -0
- package/dist/gateway/validation.cjs +225 -0
- package/dist/gateway/validation.d.ts +157 -0
- package/dist/gateway/validation.js +158 -0
- package/dist/index.cjs +95 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/logger.cjs +270 -0
- package/dist/logger.d.ts +54 -0
- package/dist/logger.js +215 -0
- package/dist/providers/copilot.cjs +148 -0
- package/dist/providers/copilot.d.ts +3 -0
- package/dist/providers/copilot.js +114 -0
- package/dist/providers/credentials.cjs +154 -0
- package/dist/providers/credentials.d.ts +26 -0
- package/dist/providers/credentials.js +99 -0
- package/dist/providers/oauth.cjs +279 -0
- package/dist/providers/oauth.d.ts +13 -0
- package/dist/providers/oauth.js +245 -0
- package/dist/providers/registry.cjs +138 -0
- package/dist/providers/registry.d.ts +32 -0
- package/dist/providers/registry.js +98 -0
- package/dist/tests/additionalMessageMiddleware.test.cjs +45 -0
- package/dist/tests/additionalMessageMiddleware.test.d.ts +1 -0
- package/dist/tests/additionalMessageMiddleware.test.js +39 -0
- package/dist/tests/agent-config-voice.test.cjs +25 -0
- package/dist/tests/agent-config-voice.test.d.ts +1 -0
- package/dist/tests/agent-config-voice.test.js +19 -0
- package/dist/tests/agentInvokerAttachments.test.cjs +67 -0
- package/dist/tests/agentInvokerAttachments.test.d.ts +1 -0
- package/dist/tests/agentInvokerAttachments.test.js +61 -0
- package/dist/tests/attachments-utils.test.cjs +46 -0
- package/dist/tests/attachments-utils.test.d.ts +1 -0
- package/dist/tests/attachments-utils.test.js +40 -0
- package/dist/tests/bunSqliteAdapter.test.cjs +265 -0
- package/dist/tests/bunSqliteAdapter.test.d.ts +1 -0
- package/dist/tests/bunSqliteAdapter.test.js +259 -0
- package/dist/tests/candleRange.test.cjs +48 -0
- package/dist/tests/candleRange.test.d.ts +1 -0
- package/dist/tests/candleRange.test.js +42 -0
- package/dist/tests/cli-config-loader.test.cjs +364 -0
- package/dist/tests/cli-config-loader.test.d.ts +1 -0
- package/dist/tests/cli-config-loader.test.js +358 -0
- package/dist/tests/cli-init.test.cjs +82 -0
- package/dist/tests/cli-init.test.d.ts +1 -0
- package/dist/tests/cli-init.test.js +76 -0
- package/dist/tests/discord-adapter.test.cjs +55 -0
- package/dist/tests/discord-adapter.test.d.ts +1 -0
- package/dist/tests/discord-adapter.test.js +49 -0
- package/dist/tests/gateway.test.cjs +319 -0
- package/dist/tests/gateway.test.d.ts +1 -0
- package/dist/tests/gateway.test.js +313 -0
- package/dist/tests/hooks-matcher.test.cjs +309 -0
- package/dist/tests/hooks-matcher.test.d.ts +1 -0
- package/dist/tests/hooks-matcher.test.js +303 -0
- package/dist/tests/hooks-merger.test.cjs +528 -0
- package/dist/tests/hooks-merger.test.d.ts +1 -0
- package/dist/tests/hooks-merger.test.js +522 -0
- package/dist/tests/integration/agent-invocation.integration.test.cjs +264 -0
- package/dist/tests/integration/agent-invocation.integration.test.d.ts +1 -0
- package/dist/tests/integration/agent-invocation.integration.test.js +258 -0
- package/dist/tests/integration/finnhub-candles.integration.test.cjs +98 -0
- package/dist/tests/integration/finnhub-candles.integration.test.d.ts +1 -0
- package/dist/tests/integration/finnhub-candles.integration.test.js +92 -0
- package/dist/tests/logger.test.cjs +353 -0
- package/dist/tests/logger.test.d.ts +1 -0
- package/dist/tests/logger.test.js +347 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.cjs +106 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.d.ts +1 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.js +100 -0
- package/dist/tests/routines-api.test.cjs +107 -0
- package/dist/tests/routines-api.test.d.ts +1 -0
- package/dist/tests/routines-api.test.js +101 -0
- package/dist/tests/sessionMessageAttachments.test.cjs +108 -0
- package/dist/tests/sessionMessageAttachments.test.d.ts +1 -0
- package/dist/tests/sessionMessageAttachments.test.js +102 -0
- package/dist/tests/sessionMessageRole.test.cjs +44 -0
- package/dist/tests/sessionMessageRole.test.d.ts +1 -0
- package/dist/tests/sessionMessageRole.test.js +38 -0
- package/dist/tests/sessionStateMessages.test.cjs +72 -0
- package/dist/tests/sessionStateMessages.test.d.ts +1 -0
- package/dist/tests/sessionStateMessages.test.js +66 -0
- package/dist/tests/sessions-api.test.cjs +68 -0
- package/dist/tests/sessions-api.test.d.ts +1 -0
- package/dist/tests/sessions-api.test.js +62 -0
- package/dist/tests/technicalIndicators.test.cjs +82 -0
- package/dist/tests/technicalIndicators.test.d.ts +1 -0
- package/dist/tests/technicalIndicators.test.js +76 -0
- package/dist/tests/toolDisplayHelpers.test.cjs +43 -0
- package/dist/tests/toolDisplayHelpers.test.d.ts +1 -0
- package/dist/tests/toolDisplayHelpers.test.js +37 -0
- package/dist/tests/voice-config.test.cjs +35 -0
- package/dist/tests/voice-config.test.d.ts +1 -0
- package/dist/tests/voice-config.test.js +29 -0
- package/dist/tests/yahooCandles.test.cjs +111 -0
- package/dist/tests/yahooCandles.test.d.ts +1 -0
- package/dist/tests/yahooCandles.test.js +105 -0
- package/dist/tools/finance/candleRange.cjs +71 -0
- package/dist/tools/finance/candleRange.d.ts +21 -0
- package/dist/tools/finance/candleRange.js +28 -0
- package/dist/tools/finance/optionsAnalytics.cjs +222 -0
- package/dist/tools/finance/optionsAnalytics.d.ts +44 -0
- package/dist/tools/finance/optionsAnalytics.js +188 -0
- package/dist/tools/finance/optionsAnalytics.test.cjs +128 -0
- package/dist/tools/finance/optionsAnalytics.test.d.ts +1 -0
- package/dist/tools/finance/optionsAnalytics.test.js +122 -0
- package/dist/tools/finance/technicalIndicators.cjs +111 -0
- package/dist/tools/finance/technicalIndicators.d.ts +15 -0
- package/dist/tools/finance/technicalIndicators.js +68 -0
- package/dist/tools/finance/yahooCandles.cjs +125 -0
- package/dist/tools/finance/yahooCandles.d.ts +41 -0
- package/dist/tools/finance/yahooCandles.js +85 -0
- package/dist/tools/mcp-finance.cjs +649 -0
- package/dist/tools/mcp-finance.d.ts +1 -0
- package/dist/tools/mcp-finance.js +631 -0
- package/dist/types/agents.cjs +18 -0
- package/dist/types/agents.d.ts +11 -0
- package/dist/types/agents.js +0 -0
- package/dist/types/hooks.cjs +18 -0
- package/dist/types/hooks.d.ts +82 -0
- package/dist/types/hooks.js +0 -0
- package/dist/types/mcp.cjs +86 -0
- package/dist/types/mcp.d.ts +107 -0
- package/dist/types/mcp.js +40 -0
- package/dist/types/voice.cjs +103 -0
- package/dist/types/voice.d.ts +117 -0
- package/dist/types/voice.js +51 -0
- package/dist/utils/attachments.cjs +46 -0
- package/dist/utils/attachments.d.ts +7 -0
- package/dist/utils/attachments.js +12 -0
- package/dist/voice/config.cjs +52 -0
- package/dist/voice/config.d.ts +8 -0
- package/dist/voice/config.js +18 -0
- package/dist/webui/assets/index-BA0HaStz.css +1 -0
- package/dist/webui/assets/index-NHgTZsWN.js +112 -0
- package/dist/webui/assets/wingman_icon-DOy91UEF.webp +0 -0
- package/dist/webui/assets/wingman_logo-Cogyt3qm.webp +0 -0
- package/dist/webui/index.html +19 -0
- package/package.json +130 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Task: Translate the user goal into an Aggressiveness Profile.
|
|
2
|
+
|
|
3
|
+
Inputs (from orchestrator context):
|
|
4
|
+
- starting_capital
|
|
5
|
+
- target_capital or profit_target
|
|
6
|
+
- deadline_days
|
|
7
|
+
- options_allowed = true
|
|
8
|
+
- user_risk_attitude: conservative|neutral|risk_on (optional)
|
|
9
|
+
- hard_stop_out_rules (if provided)
|
|
10
|
+
|
|
11
|
+
Rules:
|
|
12
|
+
- Compute required return pace (daily/weekly/monthly) using compound growth.
|
|
13
|
+
- If required returns imply extreme risk, say so plainly.
|
|
14
|
+
- Never recommend breaking guardrails to chase the goal.
|
|
15
|
+
|
|
16
|
+
Output JSON only:
|
|
17
|
+
{
|
|
18
|
+
"goal_state": {
|
|
19
|
+
"starting_capital": 0,
|
|
20
|
+
"target_capital": 0,
|
|
21
|
+
"deadline_days": 0,
|
|
22
|
+
"user_risk_attitude": "conservative|neutral|risk_on",
|
|
23
|
+
"notes": "..."
|
|
24
|
+
},
|
|
25
|
+
"required_return": {
|
|
26
|
+
"daily": 0,
|
|
27
|
+
"weekly": 0,
|
|
28
|
+
"monthly": 0
|
|
29
|
+
},
|
|
30
|
+
"aggressiveness_profile": {
|
|
31
|
+
"level": 1,
|
|
32
|
+
"allowed_strategy_set": ["..."],
|
|
33
|
+
"risk_per_trade_cap_pct": 0,
|
|
34
|
+
"max_total_risk_pct": 0,
|
|
35
|
+
"max_concurrent_positions": 0,
|
|
36
|
+
"trade_frequency_budget": "..."
|
|
37
|
+
},
|
|
38
|
+
"feasibility_notes": [
|
|
39
|
+
"What must be true for this goal to be reachable",
|
|
40
|
+
"Primary failure mode"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Task: Final review of the Decision Packet draft.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- If any guardrail is violated, return VETO and cite the violated rule.
|
|
5
|
+
- If edits are required, return APPROVE_WITH_EDITS and specify edits.
|
|
6
|
+
- If data_health is below threshold, veto to NO TRADE.
|
|
7
|
+
|
|
8
|
+
Output (exactly one of the following):
|
|
9
|
+
- APPROVE
|
|
10
|
+
- APPROVE_WITH_EDITS: <edits>
|
|
11
|
+
- VETO: <violated guardrail>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Task: Propose a staged path-to-goal plan using checkpoints and risk budgets.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Output 3 plans: base / aggressive / extreme.
|
|
5
|
+
- Each plan must specify checkpoints, expected trade frequency, typical max loss per trade, typical structure types, and stop-out rules.
|
|
6
|
+
- Use only provided context; do not call tools.
|
|
7
|
+
|
|
8
|
+
Output JSON only:
|
|
9
|
+
{
|
|
10
|
+
"plans": [
|
|
11
|
+
{
|
|
12
|
+
"name": "base|aggressive|extreme",
|
|
13
|
+
"expected_trade_frequency": "...",
|
|
14
|
+
"typical_max_loss_per_trade_pct": 0,
|
|
15
|
+
"typical_structure_types": ["..."],
|
|
16
|
+
"checkpoints": [
|
|
17
|
+
{"day": 0, "equity": 0},
|
|
18
|
+
{"day": 0, "equity": 0}
|
|
19
|
+
],
|
|
20
|
+
"stop_out": {"equity": 0, "rule": "..."}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Task: Classify market regime and options-friendliness.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Use only the provided context; no tool calls.
|
|
5
|
+
- Separate facts from inferences.
|
|
6
|
+
|
|
7
|
+
Output JSON only:
|
|
8
|
+
{
|
|
9
|
+
"market_regime": {
|
|
10
|
+
"label": "trend|range|high_vol|low_vol|risk_off",
|
|
11
|
+
"volatility_note": "...",
|
|
12
|
+
"options_friendly": true,
|
|
13
|
+
"notes": "..."
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Task: Approve or reject options candidates under the Risk Policy.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Use only the provided context. Do not request more data or call tools.
|
|
5
|
+
- Reject anything that violates max loss caps, liquidity thresholds, or concentration limits.
|
|
6
|
+
- Never approve “size up to catch up” logic.
|
|
7
|
+
|
|
8
|
+
Output JSON only:
|
|
9
|
+
{
|
|
10
|
+
"approved": true,
|
|
11
|
+
"approved_trades": ["..."],
|
|
12
|
+
"rejected_trades": [
|
|
13
|
+
{"symbol": "XYZ", "reason": "..."}
|
|
14
|
+
],
|
|
15
|
+
"portfolio_risk_summary": {
|
|
16
|
+
"total_max_loss_if_all_hit": 0,
|
|
17
|
+
"greeks_concentration_flags": ["..."],
|
|
18
|
+
"liquidity_flags": ["..."]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Task: Produce underlying trade theses with clear invalidation.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Use only the provided context. Do not request more data or call tools.
|
|
5
|
+
- Do not propose options structures; focus on underlying thesis only.
|
|
6
|
+
- Be explicit about uncertainty and data gaps.
|
|
7
|
+
|
|
8
|
+
Output JSON only:
|
|
9
|
+
{
|
|
10
|
+
"trade_theses": [
|
|
11
|
+
{
|
|
12
|
+
"symbol": "XYZ",
|
|
13
|
+
"bias": "bullish|bearish|volatility",
|
|
14
|
+
"thesis": "why now",
|
|
15
|
+
"entry_trigger": "condition",
|
|
16
|
+
"invalidation": "condition",
|
|
17
|
+
"time_horizon": "intraday|swing|multiweek",
|
|
18
|
+
"key_risks": ["..."],
|
|
19
|
+
"do_not_trade_if": ["..."]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Task: For each thesis with a viable option chain, propose 1-3 options structures aligned to the aggressiveness level.
|
|
2
|
+
|
|
3
|
+
Inputs:
|
|
4
|
+
- aggressiveness_profile
|
|
5
|
+
- trade_theses
|
|
6
|
+
- chain_summaries
|
|
7
|
+
- payoff_and_greeks (from options.analyze tool)
|
|
8
|
+
|
|
9
|
+
Rules:
|
|
10
|
+
- Use only provided context; do not call tools.
|
|
11
|
+
- Must be defined-risk unless policy explicitly allows otherwise.
|
|
12
|
+
- Must match aggressiveness level (short DTE only at high levels).
|
|
13
|
+
|
|
14
|
+
Output JSON only:
|
|
15
|
+
{
|
|
16
|
+
"options_candidates": [
|
|
17
|
+
{
|
|
18
|
+
"symbol": "XYZ",
|
|
19
|
+
"structure_type": "long_call|long_put|debit_spread|credit_spread|calendar|straddle|strangle|butterfly",
|
|
20
|
+
"legs": [
|
|
21
|
+
{"type":"call|put", "side":"buy|sell", "expiry":"YYYY-MM-DD", "strike":0, "qty":1}
|
|
22
|
+
],
|
|
23
|
+
"entry_plan": {"order_type":"limit", "logic":"..."},
|
|
24
|
+
"max_loss": {"usd":0, "pct_equity":0},
|
|
25
|
+
"max_profit": {"usd":0, "notes":"capped|uncapped"},
|
|
26
|
+
"breakevens": [0],
|
|
27
|
+
"greeks_snapshot": {"delta":0, "gamma":0, "vega":0, "theta":0},
|
|
28
|
+
"management_plan": {
|
|
29
|
+
"take_profit": "...",
|
|
30
|
+
"stop_out": "...",
|
|
31
|
+
"time_stop": "...",
|
|
32
|
+
"roll_rules": "..."
|
|
33
|
+
},
|
|
34
|
+
"failure_modes": ["..."],
|
|
35
|
+
"do_not_trade_if": ["..."]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wingman",
|
|
3
|
+
"description": "General-purpose coding assistant for this workspace.",
|
|
4
|
+
"systemPrompt": "You are Wingman, a coding assistant for this repository.\nBe direct and concise. Ask clarifying questions when requirements are unclear.\nPrefer minimal diffs and safe changes. Avoid destructive actions unless asked.\nUse tools to inspect the codebase before editing.",
|
|
5
|
+
"tools": [
|
|
6
|
+
"code_search",
|
|
7
|
+
"git_status",
|
|
8
|
+
"command_execute",
|
|
9
|
+
"internet_search",
|
|
10
|
+
"think"
|
|
11
|
+
]
|
|
12
|
+
}
|
package/bin/wingman
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
WingmanDirectory: ()=>WingmanDirectory,
|
|
28
|
+
AgentConfigSchema: ()=>AgentConfigSchema,
|
|
29
|
+
AvailableToolNames: ()=>AvailableToolNames,
|
|
30
|
+
validateAgentConfig: ()=>validateAgentConfig
|
|
31
|
+
});
|
|
32
|
+
const external_zod_namespaceObject = require("zod");
|
|
33
|
+
const types_cjs_namespaceObject = require("../middleware/hooks/types.cjs");
|
|
34
|
+
const mcp_cjs_namespaceObject = require("../../types/mcp.cjs");
|
|
35
|
+
const voice_cjs_namespaceObject = require("../../types/voice.cjs");
|
|
36
|
+
const WingmanDirectory = ".wingman";
|
|
37
|
+
const AvailableToolNames = external_zod_namespaceObject.z["enum"]([
|
|
38
|
+
"internet_search",
|
|
39
|
+
"web_crawler",
|
|
40
|
+
"command_execute",
|
|
41
|
+
"think",
|
|
42
|
+
"code_search",
|
|
43
|
+
"git_status"
|
|
44
|
+
]);
|
|
45
|
+
const BaseAgentConfigSchema = external_zod_namespaceObject.z.object({
|
|
46
|
+
name: external_zod_namespaceObject.z.string().min(1).describe("Unique agent name (e.g., 'data-analyst')"),
|
|
47
|
+
description: external_zod_namespaceObject.z.string().min(1).describe("Action-oriented description of what the agent does (helps root agent decide when to delegate)"),
|
|
48
|
+
systemPrompt: external_zod_namespaceObject.z.string().min(1).describe("Detailed instructions for the agent, including tool usage guidance and output formatting"),
|
|
49
|
+
tools: external_zod_namespaceObject.z.array(AvailableToolNames).optional().describe("List of available tools for this agent. Keep minimal and focused."),
|
|
50
|
+
model: external_zod_namespaceObject.z.string().optional().describe('Model override in format "provider:model-name" (e.g., "anthropic:claude-opus-4-5", "openrouter:openai/gpt-4o", "copilot:gpt-4o")'),
|
|
51
|
+
blockedCommands: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).optional().describe("List of blocked commands for command_execute tool (e.g., ['rm', 'mv'])"),
|
|
52
|
+
allowScriptExecution: external_zod_namespaceObject.z.boolean().optional().default(true).describe("Whether to allow script execution in command_execute tool"),
|
|
53
|
+
commandTimeout: external_zod_namespaceObject.z.number().optional().default(300000).describe("Command execution timeout in milliseconds (default: 300000)"),
|
|
54
|
+
toolHooks: types_cjs_namespaceObject.HooksConfigSchema.optional().describe("Agent-specific tool hooks configuration"),
|
|
55
|
+
mcp: mcp_cjs_namespaceObject.MCPServersConfigSchema.optional().describe("Agent-specific MCP server configurations"),
|
|
56
|
+
mcpUseGlobal: external_zod_namespaceObject.z.boolean().optional().default(false).describe("Whether this agent should also load global MCP servers from wingman.config.json"),
|
|
57
|
+
voice: voice_cjs_namespaceObject.AgentVoiceConfigSchema.optional().describe("Agent-specific voice configuration")
|
|
58
|
+
});
|
|
59
|
+
const AgentConfigSchema = BaseAgentConfigSchema.extend({
|
|
60
|
+
subAgents: external_zod_namespaceObject.z.array(BaseAgentConfigSchema).optional().describe("List of sub-agents that this agent can delegate to (each may include its own model override)")
|
|
61
|
+
});
|
|
62
|
+
function validateAgentConfig(config) {
|
|
63
|
+
try {
|
|
64
|
+
const data = AgentConfigSchema.parse(config);
|
|
65
|
+
return {
|
|
66
|
+
success: true,
|
|
67
|
+
data
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (error instanceof external_zod_namespaceObject.z.ZodError) {
|
|
71
|
+
const messages = error.issues.map((err)=>` - ${err.path.join(".")}: ${err.message}`).join("\n");
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
error: `Invalid agent configuration:\n${messages}`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
error: `Unknown validation error: ${error}`
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.AgentConfigSchema = __webpack_exports__.AgentConfigSchema;
|
|
84
|
+
exports.AvailableToolNames = __webpack_exports__.AvailableToolNames;
|
|
85
|
+
exports.WingmanDirectory = __webpack_exports__.WingmanDirectory;
|
|
86
|
+
exports.validateAgentConfig = __webpack_exports__.validateAgentConfig;
|
|
87
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
88
|
+
"AgentConfigSchema",
|
|
89
|
+
"AvailableToolNames",
|
|
90
|
+
"WingmanDirectory",
|
|
91
|
+
"validateAgentConfig"
|
|
92
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
93
|
+
Object.defineProperty(exports, '__esModule', {
|
|
94
|
+
value: true
|
|
95
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WingmanDirectory = ".wingman";
|
|
3
|
+
/**
|
|
4
|
+
* Available tool names for user-defined agents
|
|
5
|
+
*/
|
|
6
|
+
export declare const AvailableToolNames: z.ZodEnum<{
|
|
7
|
+
internet_search: "internet_search";
|
|
8
|
+
web_crawler: "web_crawler";
|
|
9
|
+
command_execute: "command_execute";
|
|
10
|
+
think: "think";
|
|
11
|
+
code_search: "code_search";
|
|
12
|
+
git_status: "git_status";
|
|
13
|
+
}>;
|
|
14
|
+
export type AvailableToolName = z.infer<typeof AvailableToolNames>;
|
|
15
|
+
export declare const AgentConfigSchema: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
systemPrompt: z.ZodString;
|
|
19
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
20
|
+
internet_search: "internet_search";
|
|
21
|
+
web_crawler: "web_crawler";
|
|
22
|
+
command_execute: "command_execute";
|
|
23
|
+
think: "think";
|
|
24
|
+
code_search: "code_search";
|
|
25
|
+
git_status: "git_status";
|
|
26
|
+
}>>>;
|
|
27
|
+
model: z.ZodOptional<z.ZodString>;
|
|
28
|
+
blockedCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
allowScriptExecution: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
30
|
+
commandTimeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
toolHooks: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
34
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"command">;
|
|
36
|
+
command: z.ZodString;
|
|
37
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
40
|
+
PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
42
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"command">;
|
|
44
|
+
command: z.ZodString;
|
|
45
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
49
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"command">;
|
|
51
|
+
command: z.ZodString;
|
|
52
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
mcp: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
servers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
transport: z.ZodLiteral<"stdio">;
|
|
60
|
+
command: z.ZodString;
|
|
61
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
transport: z.ZodLiteral<"sse">;
|
|
66
|
+
url: z.ZodString;
|
|
67
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
68
|
+
}, z.core.$strip>]>>>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
mcpUseGlobal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
71
|
+
voice: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
provider: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
web_speech: "web_speech";
|
|
74
|
+
elevenlabs: "elevenlabs";
|
|
75
|
+
}>>;
|
|
76
|
+
webSpeech: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
voiceName: z.ZodOptional<z.ZodString>;
|
|
78
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
79
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
elevenlabs: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
stability: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
similarityBoost: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
style: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
speakerBoost: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
outputFormat: z.ZodOptional<z.ZodString>;
|
|
92
|
+
optimizeStreamingLatency: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
subAgents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
description: z.ZodString;
|
|
98
|
+
systemPrompt: z.ZodString;
|
|
99
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
100
|
+
internet_search: "internet_search";
|
|
101
|
+
web_crawler: "web_crawler";
|
|
102
|
+
command_execute: "command_execute";
|
|
103
|
+
think: "think";
|
|
104
|
+
code_search: "code_search";
|
|
105
|
+
git_status: "git_status";
|
|
106
|
+
}>>>;
|
|
107
|
+
model: z.ZodOptional<z.ZodString>;
|
|
108
|
+
blockedCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
109
|
+
allowScriptExecution: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
110
|
+
commandTimeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
111
|
+
toolHooks: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
113
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
114
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"command">;
|
|
116
|
+
command: z.ZodString;
|
|
117
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>>>;
|
|
120
|
+
PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
122
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"command">;
|
|
124
|
+
command: z.ZodString;
|
|
125
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
128
|
+
Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"command">;
|
|
131
|
+
command: z.ZodString;
|
|
132
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
133
|
+
}, z.core.$strip>>;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
mcp: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
servers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
138
|
+
name: z.ZodString;
|
|
139
|
+
transport: z.ZodLiteral<"stdio">;
|
|
140
|
+
command: z.ZodString;
|
|
141
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
transport: z.ZodLiteral<"sse">;
|
|
146
|
+
url: z.ZodString;
|
|
147
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
148
|
+
}, z.core.$strip>]>>>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
mcpUseGlobal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
151
|
+
voice: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
provider: z.ZodOptional<z.ZodEnum<{
|
|
153
|
+
web_speech: "web_speech";
|
|
154
|
+
elevenlabs: "elevenlabs";
|
|
155
|
+
}>>;
|
|
156
|
+
webSpeech: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
voiceName: z.ZodOptional<z.ZodString>;
|
|
158
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
159
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
elevenlabs: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
165
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
stability: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
similarityBoost: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
style: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
speakerBoost: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
outputFormat: z.ZodOptional<z.ZodString>;
|
|
172
|
+
optimizeStreamingLatency: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
}, z.core.$strip>>>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export type WingmanAgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
178
|
+
/**
|
|
179
|
+
* Validate a single agent configuration
|
|
180
|
+
*/
|
|
181
|
+
export declare function validateAgentConfig(config: unknown): {
|
|
182
|
+
success: true;
|
|
183
|
+
data: WingmanAgentConfig;
|
|
184
|
+
} | {
|
|
185
|
+
success: false;
|
|
186
|
+
error: string;
|
|
187
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { HooksConfigSchema } from "../middleware/hooks/types.js";
|
|
3
|
+
import { MCPServersConfigSchema } from "../../types/mcp.js";
|
|
4
|
+
import { AgentVoiceConfigSchema } from "../../types/voice.js";
|
|
5
|
+
const WingmanDirectory = ".wingman";
|
|
6
|
+
const AvailableToolNames = z["enum"]([
|
|
7
|
+
"internet_search",
|
|
8
|
+
"web_crawler",
|
|
9
|
+
"command_execute",
|
|
10
|
+
"think",
|
|
11
|
+
"code_search",
|
|
12
|
+
"git_status"
|
|
13
|
+
]);
|
|
14
|
+
const BaseAgentConfigSchema = z.object({
|
|
15
|
+
name: z.string().min(1).describe("Unique agent name (e.g., 'data-analyst')"),
|
|
16
|
+
description: z.string().min(1).describe("Action-oriented description of what the agent does (helps root agent decide when to delegate)"),
|
|
17
|
+
systemPrompt: z.string().min(1).describe("Detailed instructions for the agent, including tool usage guidance and output formatting"),
|
|
18
|
+
tools: z.array(AvailableToolNames).optional().describe("List of available tools for this agent. Keep minimal and focused."),
|
|
19
|
+
model: z.string().optional().describe('Model override in format "provider:model-name" (e.g., "anthropic:claude-opus-4-5", "openrouter:openai/gpt-4o", "copilot:gpt-4o")'),
|
|
20
|
+
blockedCommands: z.array(z.string()).optional().describe("List of blocked commands for command_execute tool (e.g., ['rm', 'mv'])"),
|
|
21
|
+
allowScriptExecution: z.boolean().optional().default(true).describe("Whether to allow script execution in command_execute tool"),
|
|
22
|
+
commandTimeout: z.number().optional().default(300000).describe("Command execution timeout in milliseconds (default: 300000)"),
|
|
23
|
+
toolHooks: HooksConfigSchema.optional().describe("Agent-specific tool hooks configuration"),
|
|
24
|
+
mcp: MCPServersConfigSchema.optional().describe("Agent-specific MCP server configurations"),
|
|
25
|
+
mcpUseGlobal: z.boolean().optional().default(false).describe("Whether this agent should also load global MCP servers from wingman.config.json"),
|
|
26
|
+
voice: AgentVoiceConfigSchema.optional().describe("Agent-specific voice configuration")
|
|
27
|
+
});
|
|
28
|
+
const AgentConfigSchema = BaseAgentConfigSchema.extend({
|
|
29
|
+
subAgents: z.array(BaseAgentConfigSchema).optional().describe("List of sub-agents that this agent can delegate to (each may include its own model override)")
|
|
30
|
+
});
|
|
31
|
+
function validateAgentConfig(config) {
|
|
32
|
+
try {
|
|
33
|
+
const data = AgentConfigSchema.parse(config);
|
|
34
|
+
return {
|
|
35
|
+
success: true,
|
|
36
|
+
data
|
|
37
|
+
};
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error instanceof z.ZodError) {
|
|
40
|
+
const messages = error.issues.map((err)=>` - ${err.path.join(".")}: ${err.message}`).join("\n");
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
error: `Invalid agent configuration:\n${messages}`
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
success: false,
|
|
48
|
+
error: `Unknown validation error: ${error}`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export { AgentConfigSchema, AvailableToolNames, WingmanDirectory, validateAgentConfig };
|