clodds 1.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/LICENSE +21 -0
- package/README.md +468 -0
- package/dist/acp/agreement.d.ts +110 -0
- package/dist/acp/agreement.js +514 -0
- package/dist/acp/agreement.js.map +1 -0
- package/dist/acp/discovery.d.ts +84 -0
- package/dist/acp/discovery.js +332 -0
- package/dist/acp/discovery.js.map +1 -0
- package/dist/acp/escrow.d.ts +139 -0
- package/dist/acp/escrow.js +880 -0
- package/dist/acp/escrow.js.map +1 -0
- package/dist/acp/identity.d.ts +135 -0
- package/dist/acp/identity.js +716 -0
- package/dist/acp/identity.js.map +1 -0
- package/dist/acp/index.d.ts +205 -0
- package/dist/acp/index.js +583 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/persistence.d.ts +59 -0
- package/dist/acp/persistence.js +590 -0
- package/dist/acp/persistence.js.map +1 -0
- package/dist/acp/predictions.d.ts +89 -0
- package/dist/acp/predictions.js +417 -0
- package/dist/acp/predictions.js.map +1 -0
- package/dist/acp/registry.d.ts +143 -0
- package/dist/acp/registry.js +584 -0
- package/dist/acp/registry.js.map +1 -0
- package/dist/agents/handlers/acp.d.ts +12 -0
- package/dist/agents/handlers/acp.js +987 -0
- package/dist/agents/handlers/acp.js.map +1 -0
- package/dist/agents/handlers/agentbets.d.ts +8 -0
- package/dist/agents/handlers/agentbets.js +63 -0
- package/dist/agents/handlers/agentbets.js.map +1 -0
- package/dist/agents/handlers/arbitrage.d.ts +16 -0
- package/dist/agents/handlers/arbitrage.js +187 -0
- package/dist/agents/handlers/arbitrage.js.map +1 -0
- package/dist/agents/handlers/betfair.d.ts +11 -0
- package/dist/agents/handlers/betfair.js +214 -0
- package/dist/agents/handlers/betfair.js.map +1 -0
- package/dist/agents/handlers/binance.d.ts +9 -0
- package/dist/agents/handlers/binance.js +227 -0
- package/dist/agents/handlers/binance.js.map +1 -0
- package/dist/agents/handlers/bittensor.d.ts +10 -0
- package/dist/agents/handlers/bittensor.js +90 -0
- package/dist/agents/handlers/bittensor.js.map +1 -0
- package/dist/agents/handlers/bybit.d.ts +9 -0
- package/dist/agents/handlers/bybit.js +226 -0
- package/dist/agents/handlers/bybit.js.map +1 -0
- package/dist/agents/handlers/credentials.d.ts +8 -0
- package/dist/agents/handlers/credentials.js +103 -0
- package/dist/agents/handlers/credentials.js.map +1 -0
- package/dist/agents/handlers/hyperliquid.d.ts +9 -0
- package/dist/agents/handlers/hyperliquid.js +326 -0
- package/dist/agents/handlers/hyperliquid.js.map +1 -0
- package/dist/agents/handlers/index.d.ts +82 -0
- package/dist/agents/handlers/index.js +143 -0
- package/dist/agents/handlers/index.js.map +1 -0
- package/dist/agents/handlers/kalshi.d.ts +10 -0
- package/dist/agents/handlers/kalshi.js +1377 -0
- package/dist/agents/handlers/kalshi.js.map +1 -0
- package/dist/agents/handlers/manifold.d.ts +9 -0
- package/dist/agents/handlers/manifold.js +1001 -0
- package/dist/agents/handlers/manifold.js.map +1 -0
- package/dist/agents/handlers/markets.d.ts +8 -0
- package/dist/agents/handlers/markets.js +321 -0
- package/dist/agents/handlers/markets.js.map +1 -0
- package/dist/agents/handlers/opinion.d.ts +11 -0
- package/dist/agents/handlers/opinion.js +374 -0
- package/dist/agents/handlers/opinion.js.map +1 -0
- package/dist/agents/handlers/paper-trading.d.ts +8 -0
- package/dist/agents/handlers/paper-trading.js +124 -0
- package/dist/agents/handlers/paper-trading.js.map +1 -0
- package/dist/agents/handlers/polymarket.d.ts +17 -0
- package/dist/agents/handlers/polymarket.js +455 -0
- package/dist/agents/handlers/polymarket.js.map +1 -0
- package/dist/agents/handlers/predictfun.d.ts +9 -0
- package/dist/agents/handlers/predictfun.js +488 -0
- package/dist/agents/handlers/predictfun.js.map +1 -0
- package/dist/agents/handlers/smarkets.d.ts +11 -0
- package/dist/agents/handlers/smarkets.js +205 -0
- package/dist/agents/handlers/smarkets.js.map +1 -0
- package/dist/agents/handlers/solana.d.ts +14 -0
- package/dist/agents/handlers/solana.js +1530 -0
- package/dist/agents/handlers/solana.js.map +1 -0
- package/dist/agents/handlers/types.d.ts +58 -0
- package/dist/agents/handlers/types.js +34 -0
- package/dist/agents/handlers/types.js.map +1 -0
- package/dist/agents/handlers/virtuals.d.ts +11 -0
- package/dist/agents/handlers/virtuals.js +135 -0
- package/dist/agents/handlers/virtuals.js.map +1 -0
- package/dist/agents/handlers/wallets.d.ts +9 -0
- package/dist/agents/handlers/wallets.js +222 -0
- package/dist/agents/handlers/wallets.js.map +1 -0
- package/dist/agents/index.d.ts +79 -0
- package/dist/agents/index.js +16690 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/subagents.d.ts +219 -0
- package/dist/agents/subagents.js +736 -0
- package/dist/agents/subagents.js.map +1 -0
- package/dist/alerts/index.d.ts +110 -0
- package/dist/alerts/index.js +421 -0
- package/dist/alerts/index.js.map +1 -0
- package/dist/alerts/realtime.d.ts +114 -0
- package/dist/alerts/realtime.js +262 -0
- package/dist/alerts/realtime.js.map +1 -0
- package/dist/api/apikeys.d.ts +74 -0
- package/dist/api/apikeys.js +319 -0
- package/dist/api/apikeys.js.map +1 -0
- package/dist/api/compute/code.d.ts +28 -0
- package/dist/api/compute/code.js +257 -0
- package/dist/api/compute/code.js.map +1 -0
- package/dist/api/compute/data.d.ts +72 -0
- package/dist/api/compute/data.js +264 -0
- package/dist/api/compute/data.js.map +1 -0
- package/dist/api/compute/gateway.d.ts +185 -0
- package/dist/api/compute/gateway.js +958 -0
- package/dist/api/compute/gateway.js.map +1 -0
- package/dist/api/compute/index.d.ts +21 -0
- package/dist/api/compute/index.js +46 -0
- package/dist/api/compute/index.js.map +1 -0
- package/dist/api/compute/llm.d.ts +64 -0
- package/dist/api/compute/llm.js +602 -0
- package/dist/api/compute/llm.js.map +1 -0
- package/dist/api/compute/persistence.d.ts +77 -0
- package/dist/api/compute/persistence.js +251 -0
- package/dist/api/compute/persistence.js.map +1 -0
- package/dist/api/compute/storage.d.ts +48 -0
- package/dist/api/compute/storage.js +283 -0
- package/dist/api/compute/storage.js.map +1 -0
- package/dist/api/compute/trade.d.ts +69 -0
- package/dist/api/compute/trade.js +460 -0
- package/dist/api/compute/trade.js.map +1 -0
- package/dist/api/compute/types.d.ts +271 -0
- package/dist/api/compute/types.js +87 -0
- package/dist/api/compute/types.js.map +1 -0
- package/dist/api/compute/web.d.ts +29 -0
- package/dist/api/compute/web.js +255 -0
- package/dist/api/compute/web.js.map +1 -0
- package/dist/api/custody.d.ts +48 -0
- package/dist/api/custody.js +272 -0
- package/dist/api/custody.js.map +1 -0
- package/dist/api/fees.d.ts +91 -0
- package/dist/api/fees.js +155 -0
- package/dist/api/fees.js.map +1 -0
- package/dist/api/gateway.d.ts +40 -0
- package/dist/api/gateway.js +569 -0
- package/dist/api/gateway.js.map +1 -0
- package/dist/api/index.d.ts +29 -0
- package/dist/api/index.js +55 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/jobs.d.ts +59 -0
- package/dist/api/jobs.js +362 -0
- package/dist/api/jobs.js.map +1 -0
- package/dist/api/middleware.d.ts +60 -0
- package/dist/api/middleware.js +315 -0
- package/dist/api/middleware.js.map +1 -0
- package/dist/api/prompt.d.ts +44 -0
- package/dist/api/prompt.js +345 -0
- package/dist/api/prompt.js.map +1 -0
- package/dist/api/sdk.d.ts +258 -0
- package/dist/api/sdk.js +341 -0
- package/dist/api/sdk.js.map +1 -0
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +852 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/types.d.ts +307 -0
- package/dist/api/types.js +64 -0
- package/dist/api/types.js.map +1 -0
- package/dist/arbitrage/index.d.ts +124 -0
- package/dist/arbitrage/index.js +482 -0
- package/dist/arbitrage/index.js.map +1 -0
- package/dist/auth/copilot.d.ts +87 -0
- package/dist/auth/copilot.js +328 -0
- package/dist/auth/copilot.js.map +1 -0
- package/dist/auth/google.d.ts +121 -0
- package/dist/auth/google.js +479 -0
- package/dist/auth/google.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.js +25 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth.d.ts +94 -0
- package/dist/auth/oauth.js +502 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/qwen.d.ts +110 -0
- package/dist/auth/qwen.js +351 -0
- package/dist/auth/qwen.js.map +1 -0
- package/dist/auto-reply/index.d.ts +143 -0
- package/dist/auto-reply/index.js +391 -0
- package/dist/auto-reply/index.js.map +1 -0
- package/dist/automation/cron.d.ts +66 -0
- package/dist/automation/cron.js +226 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/heartbeats.d.ts +63 -0
- package/dist/automation/heartbeats.js +144 -0
- package/dist/automation/heartbeats.js.map +1 -0
- package/dist/automation/index.d.ts +9 -0
- package/dist/automation/index.js +15 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/webhooks.d.ts +60 -0
- package/dist/automation/webhooks.js +225 -0
- package/dist/automation/webhooks.js.map +1 -0
- package/dist/bankr/client.d.ts +86 -0
- package/dist/bankr/client.js +177 -0
- package/dist/bankr/client.js.map +1 -0
- package/dist/bankr/index.d.ts +6 -0
- package/dist/bankr/index.js +23 -0
- package/dist/bankr/index.js.map +1 -0
- package/dist/base/index.d.ts +6 -0
- package/dist/base/index.js +23 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/provider.d.ts +27 -0
- package/dist/base/provider.js +128 -0
- package/dist/base/provider.js.map +1 -0
- package/dist/bin/worker.d.ts +31 -0
- package/dist/bin/worker.js +127 -0
- package/dist/bin/worker.js.map +1 -0
- package/dist/bittensor/chutes.d.ts +14 -0
- package/dist/bittensor/chutes.js +141 -0
- package/dist/bittensor/chutes.js.map +1 -0
- package/dist/bittensor/index.d.ts +7 -0
- package/dist/bittensor/index.js +13 -0
- package/dist/bittensor/index.js.map +1 -0
- package/dist/bittensor/persistence.d.ts +8 -0
- package/dist/bittensor/persistence.js +188 -0
- package/dist/bittensor/persistence.js.map +1 -0
- package/dist/bittensor/plugin.d.ts +30 -0
- package/dist/bittensor/plugin.js +134 -0
- package/dist/bittensor/plugin.js.map +1 -0
- package/dist/bittensor/python-runner.d.ts +7 -0
- package/dist/bittensor/python-runner.js +83 -0
- package/dist/bittensor/python-runner.js.map +1 -0
- package/dist/bittensor/server.d.ts +7 -0
- package/dist/bittensor/server.js +110 -0
- package/dist/bittensor/server.js.map +1 -0
- package/dist/bittensor/service.d.ts +7 -0
- package/dist/bittensor/service.js +291 -0
- package/dist/bittensor/service.js.map +1 -0
- package/dist/bittensor/tool.d.ts +45 -0
- package/dist/bittensor/tool.js +147 -0
- package/dist/bittensor/tool.js.map +1 -0
- package/dist/bittensor/types.d.ts +188 -0
- package/dist/bittensor/types.js +6 -0
- package/dist/bittensor/types.js.map +1 -0
- package/dist/bittensor/wallet.d.ts +18 -0
- package/dist/bittensor/wallet.js +192 -0
- package/dist/bittensor/wallet.js.map +1 -0
- package/dist/bridge/wormhole.d.ts +239 -0
- package/dist/bridge/wormhole.js +404 -0
- package/dist/bridge/wormhole.js.map +1 -0
- package/dist/browser/index.d.ts +67 -0
- package/dist/browser/index.js +458 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/cache/index.d.ts +105 -0
- package/dist/cache/index.js +306 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canvas/index.d.ts +66 -0
- package/dist/canvas/index.js +391 -0
- package/dist/canvas/index.js.map +1 -0
- package/dist/channels/base-adapter.d.ts +126 -0
- package/dist/channels/base-adapter.js +416 -0
- package/dist/channels/base-adapter.js.map +1 -0
- package/dist/channels/bluebubbles/index.d.ts +23 -0
- package/dist/channels/bluebubbles/index.js +182 -0
- package/dist/channels/bluebubbles/index.js.map +1 -0
- package/dist/channels/discord/index.d.ts +25 -0
- package/dist/channels/discord/index.js +419 -0
- package/dist/channels/discord/index.js.map +1 -0
- package/dist/channels/googlechat/index.d.ts +35 -0
- package/dist/channels/googlechat/index.js +223 -0
- package/dist/channels/googlechat/index.js.map +1 -0
- package/dist/channels/imessage/index.d.ts +28 -0
- package/dist/channels/imessage/index.js +340 -0
- package/dist/channels/imessage/index.js.map +1 -0
- package/dist/channels/index.d.ts +58 -0
- package/dist/channels/index.js +382 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/line/index.d.ts +307 -0
- package/dist/channels/line/index.js +760 -0
- package/dist/channels/line/index.js.map +1 -0
- package/dist/channels/matrix/index.d.ts +35 -0
- package/dist/channels/matrix/index.js +328 -0
- package/dist/channels/matrix/index.js.map +1 -0
- package/dist/channels/mattermost/index.d.ts +25 -0
- package/dist/channels/mattermost/index.js +239 -0
- package/dist/channels/mattermost/index.js.map +1 -0
- package/dist/channels/nextcloud-talk/index.d.ts +25 -0
- package/dist/channels/nextcloud-talk/index.js +175 -0
- package/dist/channels/nextcloud-talk/index.js.map +1 -0
- package/dist/channels/nostr/index.d.ts +21 -0
- package/dist/channels/nostr/index.js +278 -0
- package/dist/channels/nostr/index.js.map +1 -0
- package/dist/channels/signal/index.d.ts +33 -0
- package/dist/channels/signal/index.js +333 -0
- package/dist/channels/signal/index.js.map +1 -0
- package/dist/channels/slack/index.d.ts +26 -0
- package/dist/channels/slack/index.js +266 -0
- package/dist/channels/slack/index.js.map +1 -0
- package/dist/channels/teams/index.d.ts +42 -0
- package/dist/channels/teams/index.js +312 -0
- package/dist/channels/teams/index.js.map +1 -0
- package/dist/channels/telegram/index.d.ts +9 -0
- package/dist/channels/telegram/index.js +761 -0
- package/dist/channels/telegram/index.js.map +1 -0
- package/dist/channels/tlon/index.d.ts +25 -0
- package/dist/channels/tlon/index.js +236 -0
- package/dist/channels/tlon/index.js.map +1 -0
- package/dist/channels/twitch/index.d.ts +25 -0
- package/dist/channels/twitch/index.js +182 -0
- package/dist/channels/twitch/index.js.map +1 -0
- package/dist/channels/voice/index.d.ts +31 -0
- package/dist/channels/voice/index.js +208 -0
- package/dist/channels/voice/index.js.map +1 -0
- package/dist/channels/webchat/index.d.ts +29 -0
- package/dist/channels/webchat/index.js +366 -0
- package/dist/channels/webchat/index.js.map +1 -0
- package/dist/channels/whatsapp/index.d.ts +72 -0
- package/dist/channels/whatsapp/index.js +767 -0
- package/dist/channels/whatsapp/index.js.map +1 -0
- package/dist/channels/zalo/index.d.ts +45 -0
- package/dist/channels/zalo/index.js +285 -0
- package/dist/channels/zalo/index.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +23 -0
- package/dist/cli/commands/doctor.js +649 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/gateway.d.ts +6 -0
- package/dist/cli/commands/gateway.js +32 -0
- package/dist/cli/commands/gateway.js.map +1 -0
- package/dist/cli/commands/index.d.ts +31 -0
- package/dist/cli/commands/index.js +3743 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +4 -0
- package/dist/cli/commands/onboard.js +334 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/repl.d.ts +11 -0
- package/dist/cli/commands/repl.js +185 -0
- package/dist/cli/commands/repl.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +29 -0
- package/dist/cli/commands/skills.js +297 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.js +449 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/secure.d.ts +14 -0
- package/dist/cli/secure.js +626 -0
- package/dist/cli/secure.js.map +1 -0
- package/dist/commands/index.d.ts +61 -0
- package/dist/commands/index.js +290 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/registry.d.ts +69 -0
- package/dist/commands/registry.js +3142 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/config/index.d.ts +465 -0
- package/dist/config/index.js +1451 -0
- package/dist/config/index.js.map +1 -0
- package/dist/credentials/index.d.ts +51 -0
- package/dist/credentials/index.js +270 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/cron/index.d.ts +151 -0
- package/dist/cron/index.js +1283 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/types.d.ts +102 -0
- package/dist/cron/types.js +6 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/index.js +159 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/db/index.d.ts +825 -0
- package/dist/db/index.js +3382 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +70 -0
- package/dist/db/migrations.js +1373 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/docker/index.d.ts +188 -0
- package/dist/docker/index.js +571 -0
- package/dist/docker/index.js.map +1 -0
- package/dist/doctor/index.d.ts +47 -0
- package/dist/doctor/index.js +379 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/embeddings/index.d.ts +65 -0
- package/dist/embeddings/index.js +399 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/evm/contracts.d.ts +112 -0
- package/dist/evm/contracts.js +332 -0
- package/dist/evm/contracts.js.map +1 -0
- package/dist/evm/index.d.ts +21 -0
- package/dist/evm/index.js +45 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/evm/multichain.d.ts +87 -0
- package/dist/evm/multichain.js +308 -0
- package/dist/evm/multichain.js.map +1 -0
- package/dist/evm/odos.d.ts +62 -0
- package/dist/evm/odos.js +261 -0
- package/dist/evm/odos.js.map +1 -0
- package/dist/evm/oneinch.d.ts +55 -0
- package/dist/evm/oneinch.js +324 -0
- package/dist/evm/oneinch.js.map +1 -0
- package/dist/evm/transfers.d.ts +83 -0
- package/dist/evm/transfers.js +393 -0
- package/dist/evm/transfers.js.map +1 -0
- package/dist/evm/uniswap.d.ts +56 -0
- package/dist/evm/uniswap.js +307 -0
- package/dist/evm/uniswap.js.map +1 -0
- package/dist/evm/virtuals.d.ts +220 -0
- package/dist/evm/virtuals.js +735 -0
- package/dist/evm/virtuals.js.map +1 -0
- package/dist/evm/wallet.d.ts +96 -0
- package/dist/evm/wallet.js +258 -0
- package/dist/evm/wallet.js.map +1 -0
- package/dist/exchanges/binance-futures/index.d.ts +83 -0
- package/dist/exchanges/binance-futures/index.js +394 -0
- package/dist/exchanges/binance-futures/index.js.map +1 -0
- package/dist/exchanges/bybit/index.d.ts +78 -0
- package/dist/exchanges/bybit/index.js +379 -0
- package/dist/exchanges/bybit/index.js.map +1 -0
- package/dist/exchanges/hyperliquid/index.d.ts +594 -0
- package/dist/exchanges/hyperliquid/index.js +1101 -0
- package/dist/exchanges/hyperliquid/index.js.map +1 -0
- package/dist/exchanges/mexc/index.d.ts +80 -0
- package/dist/exchanges/mexc/index.js +389 -0
- package/dist/exchanges/mexc/index.js.map +1 -0
- package/dist/exchanges/opinion/index.d.ts +128 -0
- package/dist/exchanges/opinion/index.js +443 -0
- package/dist/exchanges/opinion/index.js.map +1 -0
- package/dist/exchanges/predictfun/index.d.ts +107 -0
- package/dist/exchanges/predictfun/index.js +398 -0
- package/dist/exchanges/predictfun/index.js.map +1 -0
- package/dist/execution/auto-redeem.d.ts +55 -0
- package/dist/execution/auto-redeem.js +324 -0
- package/dist/execution/auto-redeem.js.map +1 -0
- package/dist/execution/bracket-orders.d.ts +84 -0
- package/dist/execution/bracket-orders.js +387 -0
- package/dist/execution/bracket-orders.js.map +1 -0
- package/dist/execution/circuit-breaker.d.ts +87 -0
- package/dist/execution/circuit-breaker.js +274 -0
- package/dist/execution/circuit-breaker.js.map +1 -0
- package/dist/execution/dca-persistence.d.ts +47 -0
- package/dist/execution/dca-persistence.js +159 -0
- package/dist/execution/dca-persistence.js.map +1 -0
- package/dist/execution/dca.d.ts +60 -0
- package/dist/execution/dca.js +273 -0
- package/dist/execution/dca.js.map +1 -0
- package/dist/execution/futures.d.ts +162 -0
- package/dist/execution/futures.js +1336 -0
- package/dist/execution/futures.js.map +1 -0
- package/dist/execution/index.d.ts +346 -0
- package/dist/execution/index.js +2532 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/mev-protection.d.ts +150 -0
- package/dist/execution/mev-protection.js +377 -0
- package/dist/execution/mev-protection.js.map +1 -0
- package/dist/execution/order-persistence.d.ts +81 -0
- package/dist/execution/order-persistence.js +350 -0
- package/dist/execution/order-persistence.js.map +1 -0
- package/dist/execution/position-manager.d.ts +142 -0
- package/dist/execution/position-manager.js +404 -0
- package/dist/execution/position-manager.js.map +1 -0
- package/dist/execution/smart-router.d.ts +90 -0
- package/dist/execution/smart-router.js +323 -0
- package/dist/execution/smart-router.js.map +1 -0
- package/dist/execution/trigger-orders.d.ts +81 -0
- package/dist/execution/trigger-orders.js +266 -0
- package/dist/execution/trigger-orders.js.map +1 -0
- package/dist/execution/twap.d.ts +87 -0
- package/dist/execution/twap.js +405 -0
- package/dist/execution/twap.js.map +1 -0
- package/dist/extensions/copilot-proxy/index.d.ts +49 -0
- package/dist/extensions/copilot-proxy/index.js +204 -0
- package/dist/extensions/copilot-proxy/index.js.map +1 -0
- package/dist/extensions/diagnostics-otel/index.d.ts +54 -0
- package/dist/extensions/diagnostics-otel/index.js +290 -0
- package/dist/extensions/diagnostics-otel/index.js.map +1 -0
- package/dist/extensions/google-auth/index.d.ts +71 -0
- package/dist/extensions/google-auth/index.js +350 -0
- package/dist/extensions/google-auth/index.js.map +1 -0
- package/dist/extensions/index.d.ts +11 -0
- package/dist/extensions/index.js +29 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llm-task/index.d.ts +80 -0
- package/dist/extensions/llm-task/index.js +248 -0
- package/dist/extensions/llm-task/index.js.map +1 -0
- package/dist/extensions/lobster/index.d.ts +69 -0
- package/dist/extensions/lobster/index.js +178 -0
- package/dist/extensions/lobster/index.js.map +1 -0
- package/dist/extensions/memory-lancedb/index.d.ts +62 -0
- package/dist/extensions/memory-lancedb/index.js +343 -0
- package/dist/extensions/memory-lancedb/index.js.map +1 -0
- package/dist/extensions/open-prose/index.d.ts +82 -0
- package/dist/extensions/open-prose/index.js +565 -0
- package/dist/extensions/open-prose/index.js.map +1 -0
- package/dist/extensions/qwen-portal/index.d.ts +48 -0
- package/dist/extensions/qwen-portal/index.js +161 -0
- package/dist/extensions/qwen-portal/index.js.map +1 -0
- package/dist/extensions/task-runner/index.d.ts +121 -0
- package/dist/extensions/task-runner/index.js +640 -0
- package/dist/extensions/task-runner/index.js.map +1 -0
- package/dist/farcaster/client.d.ts +101 -0
- package/dist/farcaster/client.js +282 -0
- package/dist/farcaster/client.js.map +1 -0
- package/dist/farcaster/index.d.ts +4 -0
- package/dist/farcaster/index.js +21 -0
- package/dist/farcaster/index.js.map +1 -0
- package/dist/feeds/acled/index.d.ts +86 -0
- package/dist/feeds/acled/index.js +215 -0
- package/dist/feeds/acled/index.js.map +1 -0
- package/dist/feeds/agentbets/index.d.ts +17 -0
- package/dist/feeds/agentbets/index.js +137 -0
- package/dist/feeds/agentbets/index.js.map +1 -0
- package/dist/feeds/betfair/index.d.ts +132 -0
- package/dist/feeds/betfair/index.js +640 -0
- package/dist/feeds/betfair/index.js.map +1 -0
- package/dist/feeds/crypto/index.d.ts +101 -0
- package/dist/feeds/crypto/index.js +506 -0
- package/dist/feeds/crypto/index.js.map +1 -0
- package/dist/feeds/crypto/whale-tracker.d.ts +138 -0
- package/dist/feeds/crypto/whale-tracker.js +685 -0
- package/dist/feeds/crypto/whale-tracker.js.map +1 -0
- package/dist/feeds/descriptors.d.ts +14 -0
- package/dist/feeds/descriptors.js +582 -0
- package/dist/feeds/descriptors.js.map +1 -0
- package/dist/feeds/drift/index.d.ts +23 -0
- package/dist/feeds/drift/index.js +182 -0
- package/dist/feeds/drift/index.js.map +1 -0
- package/dist/feeds/drift/trading.d.ts +75 -0
- package/dist/feeds/drift/trading.js +457 -0
- package/dist/feeds/drift/trading.js.map +1 -0
- package/dist/feeds/external/index.d.ts +48 -0
- package/dist/feeds/external/index.js +575 -0
- package/dist/feeds/external/index.js.map +1 -0
- package/dist/feeds/fred/index.d.ts +134 -0
- package/dist/feeds/fred/index.js +263 -0
- package/dist/feeds/fred/index.js.map +1 -0
- package/dist/feeds/freshness.d.ts +79 -0
- package/dist/feeds/freshness.js +259 -0
- package/dist/feeds/freshness.js.map +1 -0
- package/dist/feeds/hedgehog/index.d.ts +24 -0
- package/dist/feeds/hedgehog/index.js +589 -0
- package/dist/feeds/hedgehog/index.js.map +1 -0
- package/dist/feeds/hedgehog/types.d.ts +215 -0
- package/dist/feeds/hedgehog/types.js +7 -0
- package/dist/feeds/hedgehog/types.js.map +1 -0
- package/dist/feeds/index.d.ts +38 -0
- package/dist/feeds/index.js +469 -0
- package/dist/feeds/index.js.map +1 -0
- package/dist/feeds/kalshi/index.d.ts +116 -0
- package/dist/feeds/kalshi/index.js +970 -0
- package/dist/feeds/kalshi/index.js.map +1 -0
- package/dist/feeds/manifold/index.d.ts +15 -0
- package/dist/feeds/manifold/index.js +269 -0
- package/dist/feeds/manifold/index.js.map +1 -0
- package/dist/feeds/metaculus/index.d.ts +22 -0
- package/dist/feeds/metaculus/index.js +149 -0
- package/dist/feeds/metaculus/index.js.map +1 -0
- package/dist/feeds/news/index.d.ts +20 -0
- package/dist/feeds/news/index.js +308 -0
- package/dist/feeds/news/index.js.map +1 -0
- package/dist/feeds/opinion/index.d.ts +31 -0
- package/dist/feeds/opinion/index.js +389 -0
- package/dist/feeds/opinion/index.js.map +1 -0
- package/dist/feeds/polymarket/index.d.ts +21 -0
- package/dist/feeds/polymarket/index.js +501 -0
- package/dist/feeds/polymarket/index.js.map +1 -0
- package/dist/feeds/polymarket/rtds.d.ts +40 -0
- package/dist/feeds/polymarket/rtds.js +159 -0
- package/dist/feeds/polymarket/rtds.js.map +1 -0
- package/dist/feeds/polymarket/user-ws.d.ts +64 -0
- package/dist/feeds/polymarket/user-ws.js +230 -0
- package/dist/feeds/polymarket/user-ws.js.map +1 -0
- package/dist/feeds/polymarket/whale-tracker.d.ts +152 -0
- package/dist/feeds/polymarket/whale-tracker.js +709 -0
- package/dist/feeds/polymarket/whale-tracker.js.map +1 -0
- package/dist/feeds/predictfun/index.d.ts +24 -0
- package/dist/feeds/predictfun/index.js +234 -0
- package/dist/feeds/predictfun/index.js.map +1 -0
- package/dist/feeds/predictit/index.d.ts +14 -0
- package/dist/feeds/predictit/index.js +88 -0
- package/dist/feeds/predictit/index.js.map +1 -0
- package/dist/feeds/registry.d.ts +148 -0
- package/dist/feeds/registry.js +197 -0
- package/dist/feeds/registry.js.map +1 -0
- package/dist/feeds/smarkets/index.d.ts +76 -0
- package/dist/feeds/smarkets/index.js +415 -0
- package/dist/feeds/smarkets/index.js.map +1 -0
- package/dist/feeds/virtuals/index.d.ts +92 -0
- package/dist/feeds/virtuals/index.js +341 -0
- package/dist/feeds/virtuals/index.js.map +1 -0
- package/dist/feeds/weather-nws/index.d.ts +73 -0
- package/dist/feeds/weather-nws/index.js +162 -0
- package/dist/feeds/weather-nws/index.js.map +1 -0
- package/dist/feeds/weather-openmeteo/index.d.ts +80 -0
- package/dist/feeds/weather-openmeteo/index.js +197 -0
- package/dist/feeds/weather-openmeteo/index.js.map +1 -0
- package/dist/gateway/alerts-routes.d.ts +15 -0
- package/dist/gateway/alerts-routes.js +188 -0
- package/dist/gateway/alerts-routes.js.map +1 -0
- package/dist/gateway/alt-data-routes.d.ts +15 -0
- package/dist/gateway/alt-data-routes.js +67 -0
- package/dist/gateway/alt-data-routes.js.map +1 -0
- package/dist/gateway/api-routes.d.ts +39 -0
- package/dist/gateway/api-routes.js +1028 -0
- package/dist/gateway/api-routes.js.map +1 -0
- package/dist/gateway/audit-routes.d.ts +8 -0
- package/dist/gateway/audit-routes.js +61 -0
- package/dist/gateway/audit-routes.js.map +1 -0
- package/dist/gateway/bracket-routes.d.ts +12 -0
- package/dist/gateway/bracket-routes.js +122 -0
- package/dist/gateway/bracket-routes.js.map +1 -0
- package/dist/gateway/control-ui.d.ts +45 -0
- package/dist/gateway/control-ui.js +301 -0
- package/dist/gateway/control-ui.js.map +1 -0
- package/dist/gateway/copy-trading-routes.d.ts +12 -0
- package/dist/gateway/copy-trading-routes.js +159 -0
- package/dist/gateway/copy-trading-routes.js.map +1 -0
- package/dist/gateway/cron-routes.d.ts +14 -0
- package/dist/gateway/cron-routes.js +132 -0
- package/dist/gateway/cron-routes.js.map +1 -0
- package/dist/gateway/dca-routes.d.ts +8 -0
- package/dist/gateway/dca-routes.js +179 -0
- package/dist/gateway/dca-routes.js.map +1 -0
- package/dist/gateway/embeddings-routes.d.ts +12 -0
- package/dist/gateway/embeddings-routes.js +102 -0
- package/dist/gateway/embeddings-routes.js.map +1 -0
- package/dist/gateway/feeds-routes.d.ts +34 -0
- package/dist/gateway/feeds-routes.js +167 -0
- package/dist/gateway/feeds-routes.js.map +1 -0
- package/dist/gateway/index.d.ts +100 -0
- package/dist/gateway/index.js +2321 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/monitoring-routes.d.ts +12 -0
- package/dist/gateway/monitoring-routes.js +73 -0
- package/dist/gateway/monitoring-routes.js.map +1 -0
- package/dist/gateway/opportunity-routes.d.ts +12 -0
- package/dist/gateway/opportunity-routes.js +238 -0
- package/dist/gateway/opportunity-routes.js.map +1 -0
- package/dist/gateway/payments-routes.d.ts +14 -0
- package/dist/gateway/payments-routes.js +82 -0
- package/dist/gateway/payments-routes.js.map +1 -0
- package/dist/gateway/percolator-routes.d.ts +16 -0
- package/dist/gateway/percolator-routes.js +139 -0
- package/dist/gateway/percolator-routes.js.map +1 -0
- package/dist/gateway/queue-routes.d.ts +12 -0
- package/dist/gateway/queue-routes.js +47 -0
- package/dist/gateway/queue-routes.js.map +1 -0
- package/dist/gateway/risk-routes.d.ts +12 -0
- package/dist/gateway/risk-routes.js +119 -0
- package/dist/gateway/risk-routes.js.map +1 -0
- package/dist/gateway/routing-routes.d.ts +12 -0
- package/dist/gateway/routing-routes.js +86 -0
- package/dist/gateway/routing-routes.js.map +1 -0
- package/dist/gateway/server.d.ts +215 -0
- package/dist/gateway/server.js +2287 -0
- package/dist/gateway/server.js.map +1 -0
- package/dist/gateway/shield-routes.d.ts +8 -0
- package/dist/gateway/shield-routes.js +88 -0
- package/dist/gateway/shield-routes.js.map +1 -0
- package/dist/gateway/signal-bus.d.ts +51 -0
- package/dist/gateway/signal-bus.js +64 -0
- package/dist/gateway/signal-bus.js.map +1 -0
- package/dist/gateway/trigger-routes.d.ts +12 -0
- package/dist/gateway/trigger-routes.js +127 -0
- package/dist/gateway/trigger-routes.js.map +1 -0
- package/dist/gateway/twap-routes.d.ts +12 -0
- package/dist/gateway/twap-routes.js +142 -0
- package/dist/gateway/twap-routes.js.map +1 -0
- package/dist/gateway/webhooks-routes.d.ts +31 -0
- package/dist/gateway/webhooks-routes.js +107 -0
- package/dist/gateway/webhooks-routes.js.map +1 -0
- package/dist/gateway/whale-routes.d.ts +12 -0
- package/dist/gateway/whale-routes.js +204 -0
- package/dist/gateway/whale-routes.js.map +1 -0
- package/dist/history/index.d.ts +81 -0
- package/dist/history/index.js +362 -0
- package/dist/history/index.js.map +1 -0
- package/dist/hooks/index.d.ts +279 -0
- package/dist/hooks/index.js +739 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.d.ts +65 -0
- package/dist/i18n/index.js +183 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/identity/erc8004.d.ts +104 -0
- package/dist/identity/erc8004.js +493 -0
- package/dist/identity/erc8004.js.map +1 -0
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/index.d.ts +133 -0
- package/dist/infra/index.js +481 -0
- package/dist/infra/index.js.map +1 -0
- package/dist/infra/retry.d.ts +132 -0
- package/dist/infra/retry.js +450 -0
- package/dist/infra/retry.js.map +1 -0
- package/dist/ledger/anchor.d.ts +45 -0
- package/dist/ledger/anchor.js +271 -0
- package/dist/ledger/anchor.js.map +1 -0
- package/dist/ledger/hash.d.ts +26 -0
- package/dist/ledger/hash.js +69 -0
- package/dist/ledger/hash.js.map +1 -0
- package/dist/ledger/hooks.d.ts +107 -0
- package/dist/ledger/hooks.js +314 -0
- package/dist/ledger/hooks.js.map +1 -0
- package/dist/ledger/index.d.ts +67 -0
- package/dist/ledger/index.js +221 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/storage.d.ts +57 -0
- package/dist/ledger/storage.js +368 -0
- package/dist/ledger/storage.js.map +1 -0
- package/dist/ledger/types.d.ts +138 -0
- package/dist/ledger/types.js +16 -0
- package/dist/ledger/types.js.map +1 -0
- package/dist/link-understanding/index.d.ts +61 -0
- package/dist/link-understanding/index.js +320 -0
- package/dist/link-understanding/index.js.map +1 -0
- package/dist/logging/index.d.ts +50 -0
- package/dist/logging/index.js +255 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/macos/index.d.ts +143 -0
- package/dist/macos/index.js +587 -0
- package/dist/macos/index.js.map +1 -0
- package/dist/markdown/index.d.ts +43 -0
- package/dist/markdown/index.js +305 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/market-index/index.d.ts +51 -0
- package/dist/market-index/index.js +553 -0
- package/dist/market-index/index.js.map +1 -0
- package/dist/mcp/index.d.ts +263 -0
- package/dist/mcp/index.js +940 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/installer.d.ts +11 -0
- package/dist/mcp/installer.js +128 -0
- package/dist/mcp/installer.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +172 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/media/index.d.ts +119 -0
- package/dist/media/index.js +740 -0
- package/dist/media/index.js.map +1 -0
- package/dist/memory/context.d.ts +189 -0
- package/dist/memory/context.js +541 -0
- package/dist/memory/context.js.map +1 -0
- package/dist/memory/index.d.ts +74 -0
- package/dist/memory/index.js +352 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/summarizer.d.ts +10 -0
- package/dist/memory/summarizer.js +51 -0
- package/dist/memory/summarizer.js.map +1 -0
- package/dist/memory/tokenizer.d.ts +4 -0
- package/dist/memory/tokenizer.js +61 -0
- package/dist/memory/tokenizer.js.map +1 -0
- package/dist/messages/unified.d.ts +7 -0
- package/dist/messages/unified.js +77 -0
- package/dist/messages/unified.js.map +1 -0
- package/dist/ml-pipeline/collector.d.ts +23 -0
- package/dist/ml-pipeline/collector.js +176 -0
- package/dist/ml-pipeline/collector.js.map +1 -0
- package/dist/ml-pipeline/index.d.ts +21 -0
- package/dist/ml-pipeline/index.js +72 -0
- package/dist/ml-pipeline/index.js.map +1 -0
- package/dist/ml-pipeline/trainer.d.ts +32 -0
- package/dist/ml-pipeline/trainer.js +228 -0
- package/dist/ml-pipeline/trainer.js.map +1 -0
- package/dist/ml-pipeline/types.d.ts +51 -0
- package/dist/ml-pipeline/types.js +23 -0
- package/dist/ml-pipeline/types.js.map +1 -0
- package/dist/models/adaptive.d.ts +11 -0
- package/dist/models/adaptive.js +64 -0
- package/dist/models/adaptive.js.map +1 -0
- package/dist/models/failover.d.ts +51 -0
- package/dist/models/failover.js +151 -0
- package/dist/models/failover.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +13 -0
- package/dist/models/index.js.map +1 -0
- package/dist/monitoring/alerts.d.ts +185 -0
- package/dist/monitoring/alerts.js +565 -0
- package/dist/monitoring/alerts.js.map +1 -0
- package/dist/monitoring/health.d.ts +151 -0
- package/dist/monitoring/health.js +423 -0
- package/dist/monitoring/health.js.map +1 -0
- package/dist/monitoring/index.d.ts +25 -0
- package/dist/monitoring/index.js +258 -0
- package/dist/monitoring/index.js.map +1 -0
- package/dist/monitoring/metrics.d.ts +147 -0
- package/dist/monitoring/metrics.js +519 -0
- package/dist/monitoring/metrics.js.map +1 -0
- package/dist/nodes/index.d.ts +81 -0
- package/dist/nodes/index.js +475 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/opportunity/analytics.d.ts +221 -0
- package/dist/opportunity/analytics.js +678 -0
- package/dist/opportunity/analytics.js.map +1 -0
- package/dist/opportunity/combinatorial.d.ts +147 -0
- package/dist/opportunity/combinatorial.js +765 -0
- package/dist/opportunity/combinatorial.js.map +1 -0
- package/dist/opportunity/correlation.d.ts +107 -0
- package/dist/opportunity/correlation.js +410 -0
- package/dist/opportunity/correlation.js.map +1 -0
- package/dist/opportunity/executor.d.ts +108 -0
- package/dist/opportunity/executor.js +356 -0
- package/dist/opportunity/executor.js.map +1 -0
- package/dist/opportunity/index.d.ts +285 -0
- package/dist/opportunity/index.js +839 -0
- package/dist/opportunity/index.js.map +1 -0
- package/dist/opportunity/links.d.ts +87 -0
- package/dist/opportunity/links.js +344 -0
- package/dist/opportunity/links.js.map +1 -0
- package/dist/opportunity/matching.d.ts +101 -0
- package/dist/opportunity/matching.js +551 -0
- package/dist/opportunity/matching.js.map +1 -0
- package/dist/opportunity/outcomes.d.ts +74 -0
- package/dist/opportunity/outcomes.js +321 -0
- package/dist/opportunity/outcomes.js.map +1 -0
- package/dist/opportunity/risk.d.ts +128 -0
- package/dist/opportunity/risk.js +381 -0
- package/dist/opportunity/risk.js.map +1 -0
- package/dist/opportunity/scoring.d.ts +151 -0
- package/dist/opportunity/scoring.js +421 -0
- package/dist/opportunity/scoring.js.map +1 -0
- package/dist/pairing/index.d.ts +108 -0
- package/dist/pairing/index.js +431 -0
- package/dist/pairing/index.js.map +1 -0
- package/dist/payments/index.d.ts +12 -0
- package/dist/payments/index.js +34 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/x402/evm.d.ts +53 -0
- package/dist/payments/x402/evm.js +282 -0
- package/dist/payments/x402/evm.js.map +1 -0
- package/dist/payments/x402/index.d.ts +158 -0
- package/dist/payments/x402/index.js +531 -0
- package/dist/payments/x402/index.js.map +1 -0
- package/dist/payments/x402/solana.d.ts +51 -0
- package/dist/payments/x402/solana.js +397 -0
- package/dist/payments/x402/solana.js.map +1 -0
- package/dist/percolator/accounts.d.ts +21 -0
- package/dist/percolator/accounts.js +76 -0
- package/dist/percolator/accounts.js.map +1 -0
- package/dist/percolator/encode.d.ts +14 -0
- package/dist/percolator/encode.js +90 -0
- package/dist/percolator/encode.js.map +1 -0
- package/dist/percolator/execution.d.ts +29 -0
- package/dist/percolator/execution.js +239 -0
- package/dist/percolator/execution.js.map +1 -0
- package/dist/percolator/feed.d.ts +15 -0
- package/dist/percolator/feed.js +160 -0
- package/dist/percolator/feed.js.map +1 -0
- package/dist/percolator/index.d.ts +20 -0
- package/dist/percolator/index.js +24 -0
- package/dist/percolator/index.js.map +1 -0
- package/dist/percolator/instructions.d.ts +29 -0
- package/dist/percolator/instructions.js +52 -0
- package/dist/percolator/instructions.js.map +1 -0
- package/dist/percolator/keeper.d.ts +11 -0
- package/dist/percolator/keeper.js +83 -0
- package/dist/percolator/keeper.js.map +1 -0
- package/dist/percolator/pda.d.ts +15 -0
- package/dist/percolator/pda.js +26 -0
- package/dist/percolator/pda.js.map +1 -0
- package/dist/percolator/slab.d.ts +122 -0
- package/dist/percolator/slab.js +325 -0
- package/dist/percolator/slab.js.map +1 -0
- package/dist/percolator/tx.d.ts +27 -0
- package/dist/percolator/tx.js +77 -0
- package/dist/percolator/tx.js.map +1 -0
- package/dist/percolator/types.d.ts +51 -0
- package/dist/percolator/types.js +9 -0
- package/dist/percolator/types.js.map +1 -0
- package/dist/permissions/index.d.ts +262 -0
- package/dist/permissions/index.js +929 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/plugins/index.d.ts +158 -0
- package/dist/plugins/index.js +444 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/portfolio/index.d.ts +170 -0
- package/dist/portfolio/index.js +970 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/presence/index.d.ts +34 -0
- package/dist/presence/index.js +124 -0
- package/dist/presence/index.js.map +1 -0
- package/dist/process/index.d.ts +82 -0
- package/dist/process/index.js +402 -0
- package/dist/process/index.js.map +1 -0
- package/dist/providers/discovery.d.ts +209 -0
- package/dist/providers/discovery.js +751 -0
- package/dist/providers/discovery.js.map +1 -0
- package/dist/providers/health.d.ts +27 -0
- package/dist/providers/health.js +80 -0
- package/dist/providers/health.js.map +1 -0
- package/dist/providers/index.d.ts +154 -0
- package/dist/providers/index.js +897 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/queue/index.d.ts +36 -0
- package/dist/queue/index.js +146 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/jobs/index.d.ts +11 -0
- package/dist/queue/jobs/index.js +32 -0
- package/dist/queue/jobs/index.js.map +1 -0
- package/dist/queue/jobs/producer.d.ts +43 -0
- package/dist/queue/jobs/producer.js +233 -0
- package/dist/queue/jobs/producer.js.map +1 -0
- package/dist/queue/jobs/types.d.ts +128 -0
- package/dist/queue/jobs/types.js +14 -0
- package/dist/queue/jobs/types.js.map +1 -0
- package/dist/queue/jobs/worker.d.ts +22 -0
- package/dist/queue/jobs/worker.js +220 -0
- package/dist/queue/jobs/worker.js.map +1 -0
- package/dist/remote/index.d.ts +136 -0
- package/dist/remote/index.js +456 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/risk/circuit-breaker.d.ts +99 -0
- package/dist/risk/circuit-breaker.js +300 -0
- package/dist/risk/circuit-breaker.js.map +1 -0
- package/dist/risk/dashboard.d.ts +69 -0
- package/dist/risk/dashboard.js +127 -0
- package/dist/risk/dashboard.js.map +1 -0
- package/dist/risk/engine.d.ts +128 -0
- package/dist/risk/engine.js +311 -0
- package/dist/risk/engine.js.map +1 -0
- package/dist/risk/index.d.ts +10 -0
- package/dist/risk/index.js +38 -0
- package/dist/risk/index.js.map +1 -0
- package/dist/risk/stress.d.ts +70 -0
- package/dist/risk/stress.js +215 -0
- package/dist/risk/stress.js.map +1 -0
- package/dist/risk/var.d.ts +72 -0
- package/dist/risk/var.js +173 -0
- package/dist/risk/var.js.map +1 -0
- package/dist/risk/volatility.d.ts +61 -0
- package/dist/risk/volatility.js +132 -0
- package/dist/risk/volatility.js.map +1 -0
- package/dist/routing/index.d.ts +116 -0
- package/dist/routing/index.js +371 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/search/index.d.ts +30 -0
- package/dist/search/index.js +129 -0
- package/dist/search/index.js.map +1 -0
- package/dist/security/address-checker.d.ts +6 -0
- package/dist/security/address-checker.js +213 -0
- package/dist/security/address-checker.js.map +1 -0
- package/dist/security/code-scanner.d.ts +3 -0
- package/dist/security/code-scanner.js +190 -0
- package/dist/security/code-scanner.js.map +1 -0
- package/dist/security/index.d.ts +176 -0
- package/dist/security/index.js +498 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/sanitizer.d.ts +2 -0
- package/dist/security/sanitizer.js +135 -0
- package/dist/security/sanitizer.js.map +1 -0
- package/dist/security/scam-db.d.ts +5 -0
- package/dist/security/scam-db.js +116 -0
- package/dist/security/scam-db.js.map +1 -0
- package/dist/security/shield.d.ts +12 -0
- package/dist/security/shield.js +80 -0
- package/dist/security/shield.js.map +1 -0
- package/dist/security/tx-validator.d.ts +5 -0
- package/dist/security/tx-validator.js +115 -0
- package/dist/security/tx-validator.js.map +1 -0
- package/dist/security/types.d.ts +84 -0
- package/dist/security/types.js +6 -0
- package/dist/security/types.js.map +1 -0
- package/dist/services/alt-data/feeds/fear-greed.d.ts +14 -0
- package/dist/services/alt-data/feeds/fear-greed.js +81 -0
- package/dist/services/alt-data/feeds/fear-greed.js.map +1 -0
- package/dist/services/alt-data/feeds/funding-rates.d.ts +13 -0
- package/dist/services/alt-data/feeds/funding-rates.js +90 -0
- package/dist/services/alt-data/feeds/funding-rates.js.map +1 -0
- package/dist/services/alt-data/feeds/reddit.d.ts +13 -0
- package/dist/services/alt-data/feeds/reddit.js +112 -0
- package/dist/services/alt-data/feeds/reddit.js.map +1 -0
- package/dist/services/alt-data/index.d.ts +31 -0
- package/dist/services/alt-data/index.js +278 -0
- package/dist/services/alt-data/index.js.map +1 -0
- package/dist/services/alt-data/market-matcher.d.ts +29 -0
- package/dist/services/alt-data/market-matcher.js +157 -0
- package/dist/services/alt-data/market-matcher.js.map +1 -0
- package/dist/services/alt-data/sentiment.d.ts +11 -0
- package/dist/services/alt-data/sentiment.js +277 -0
- package/dist/services/alt-data/sentiment.js.map +1 -0
- package/dist/services/alt-data/types.d.ts +86 -0
- package/dist/services/alt-data/types.js +9 -0
- package/dist/services/alt-data/types.js.map +1 -0
- package/dist/services/feature-engineering/accessor.d.ts +19 -0
- package/dist/services/feature-engineering/accessor.js +31 -0
- package/dist/services/feature-engineering/accessor.js.map +1 -0
- package/dist/services/feature-engineering/index.d.ts +15 -0
- package/dist/services/feature-engineering/index.js +345 -0
- package/dist/services/feature-engineering/index.js.map +1 -0
- package/dist/services/feature-engineering/indicators.d.ts +90 -0
- package/dist/services/feature-engineering/indicators.js +254 -0
- package/dist/services/feature-engineering/indicators.js.map +1 -0
- package/dist/services/feature-engineering/rolling-window.d.ts +89 -0
- package/dist/services/feature-engineering/rolling-window.js +173 -0
- package/dist/services/feature-engineering/rolling-window.js.map +1 -0
- package/dist/services/feature-engineering/thresholds.d.ts +137 -0
- package/dist/services/feature-engineering/thresholds.js +280 -0
- package/dist/services/feature-engineering/thresholds.js.map +1 -0
- package/dist/services/feature-engineering/types.d.ts +138 -0
- package/dist/services/feature-engineering/types.js +6 -0
- package/dist/services/feature-engineering/types.js.map +1 -0
- package/dist/services/tick-recorder/index.d.ts +12 -0
- package/dist/services/tick-recorder/index.js +200 -0
- package/dist/services/tick-recorder/index.js.map +1 -0
- package/dist/services/tick-recorder/queries.d.ts +46 -0
- package/dist/services/tick-recorder/queries.js +291 -0
- package/dist/services/tick-recorder/queries.js.map +1 -0
- package/dist/services/tick-recorder/schema.d.ts +27 -0
- package/dist/services/tick-recorder/schema.js +185 -0
- package/dist/services/tick-recorder/schema.js.map +1 -0
- package/dist/services/tick-recorder/timescale.d.ts +27 -0
- package/dist/services/tick-recorder/timescale.js +105 -0
- package/dist/services/tick-recorder/timescale.js.map +1 -0
- package/dist/services/tick-recorder/types.d.ts +113 -0
- package/dist/services/tick-recorder/types.js +7 -0
- package/dist/services/tick-recorder/types.js.map +1 -0
- package/dist/services/tick-streamer/index.d.ts +12 -0
- package/dist/services/tick-streamer/index.js +317 -0
- package/dist/services/tick-streamer/index.js.map +1 -0
- package/dist/services/tick-streamer/types.d.ts +134 -0
- package/dist/services/tick-streamer/types.js +6 -0
- package/dist/services/tick-streamer/types.js.map +1 -0
- package/dist/session/index.d.ts +147 -0
- package/dist/session/index.js +429 -0
- package/dist/session/index.js.map +1 -0
- package/dist/sessions/index.d.ts +69 -0
- package/dist/sessions/index.js +447 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/signal-router/index.d.ts +2 -0
- package/dist/signal-router/index.js +6 -0
- package/dist/signal-router/index.js.map +1 -0
- package/dist/signal-router/router.d.ts +25 -0
- package/dist/signal-router/router.js +391 -0
- package/dist/signal-router/router.js.map +1 -0
- package/dist/signal-router/types.d.ts +64 -0
- package/dist/signal-router/types.js +9 -0
- package/dist/signal-router/types.js.map +1 -0
- package/dist/skills/bundled/acp/index.d.ts +25 -0
- package/dist/skills/bundled/acp/index.js +472 -0
- package/dist/skills/bundled/acp/index.js.map +1 -0
- package/dist/skills/bundled/agentbets/index.d.ts +15 -0
- package/dist/skills/bundled/agentbets/index.js +168 -0
- package/dist/skills/bundled/agentbets/index.js.map +1 -0
- package/dist/skills/bundled/ai-strategy/index.d.ts +21 -0
- package/dist/skills/bundled/ai-strategy/index.js +647 -0
- package/dist/skills/bundled/ai-strategy/index.js.map +1 -0
- package/dist/skills/bundled/alerts/index.d.ts +20 -0
- package/dist/skills/bundled/alerts/index.js +249 -0
- package/dist/skills/bundled/alerts/index.js.map +1 -0
- package/dist/skills/bundled/analytics/index.d.ts +17 -0
- package/dist/skills/bundled/analytics/index.js +112 -0
- package/dist/skills/bundled/analytics/index.js.map +1 -0
- package/dist/skills/bundled/arbitrage/index.d.ts +24 -0
- package/dist/skills/bundled/arbitrage/index.js +253 -0
- package/dist/skills/bundled/arbitrage/index.js.map +1 -0
- package/dist/skills/bundled/auto-reply/index.d.ts +18 -0
- package/dist/skills/bundled/auto-reply/index.js +215 -0
- package/dist/skills/bundled/auto-reply/index.js.map +1 -0
- package/dist/skills/bundled/automation/index.d.ts +19 -0
- package/dist/skills/bundled/automation/index.js +160 -0
- package/dist/skills/bundled/automation/index.js.map +1 -0
- package/dist/skills/bundled/backtest/index.d.ts +18 -0
- package/dist/skills/bundled/backtest/index.js +250 -0
- package/dist/skills/bundled/backtest/index.js.map +1 -0
- package/dist/skills/bundled/bags/index.d.ts +49 -0
- package/dist/skills/bundled/bags/index.js +1069 -0
- package/dist/skills/bundled/bags/index.js.map +1 -0
- package/dist/skills/bundled/bankr/index.d.ts +161 -0
- package/dist/skills/bundled/bankr/index.js +271 -0
- package/dist/skills/bundled/bankr/index.js.map +1 -0
- package/dist/skills/bundled/betfair/index.d.ts +24 -0
- package/dist/skills/bundled/betfair/index.js +511 -0
- package/dist/skills/bundled/betfair/index.js.map +1 -0
- package/dist/skills/bundled/binance-futures/index.d.ts +15 -0
- package/dist/skills/bundled/binance-futures/index.js +485 -0
- package/dist/skills/bundled/binance-futures/index.js.map +1 -0
- package/dist/skills/bundled/botchan/index.d.ts +130 -0
- package/dist/skills/bundled/botchan/index.js +427 -0
- package/dist/skills/bundled/botchan/index.js.map +1 -0
- package/dist/skills/bundled/bridge/index.d.ts +17 -0
- package/dist/skills/bundled/bridge/index.js +297 -0
- package/dist/skills/bundled/bridge/index.js.map +1 -0
- package/dist/skills/bundled/bybit-futures/index.d.ts +15 -0
- package/dist/skills/bundled/bybit-futures/index.js +380 -0
- package/dist/skills/bundled/bybit-futures/index.js.map +1 -0
- package/dist/skills/bundled/clanker/index.d.ts +236 -0
- package/dist/skills/bundled/clanker/index.js +759 -0
- package/dist/skills/bundled/clanker/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading/index.d.ts +20 -0
- package/dist/skills/bundled/copy-trading/index.js +213 -0
- package/dist/skills/bundled/copy-trading/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading-solana/index.d.ts +21 -0
- package/dist/skills/bundled/copy-trading-solana/index.js +421 -0
- package/dist/skills/bundled/copy-trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/credentials/index.d.ts +17 -0
- package/dist/skills/bundled/credentials/index.js +137 -0
- package/dist/skills/bundled/credentials/index.js.map +1 -0
- package/dist/skills/bundled/crypto-hft/index.d.ts +26 -0
- package/dist/skills/bundled/crypto-hft/index.js +361 -0
- package/dist/skills/bundled/crypto-hft/index.js.map +1 -0
- package/dist/skills/bundled/dca/index.d.ts +26 -0
- package/dist/skills/bundled/dca/index.js +1342 -0
- package/dist/skills/bundled/dca/index.js.map +1 -0
- package/dist/skills/bundled/divergence/index.d.ts +19 -0
- package/dist/skills/bundled/divergence/index.js +272 -0
- package/dist/skills/bundled/divergence/index.js.map +1 -0
- package/dist/skills/bundled/doctor/index.d.ts +18 -0
- package/dist/skills/bundled/doctor/index.js +78 -0
- package/dist/skills/bundled/doctor/index.js.map +1 -0
- package/dist/skills/bundled/drift/index.d.ts +13 -0
- package/dist/skills/bundled/drift/index.js +378 -0
- package/dist/skills/bundled/drift/index.js.map +1 -0
- package/dist/skills/bundled/drift-sdk/index.d.ts +17 -0
- package/dist/skills/bundled/drift-sdk/index.js +501 -0
- package/dist/skills/bundled/drift-sdk/index.js.map +1 -0
- package/dist/skills/bundled/edge/index.d.ts +16 -0
- package/dist/skills/bundled/edge/index.js +91 -0
- package/dist/skills/bundled/edge/index.js.map +1 -0
- package/dist/skills/bundled/embeddings/index.d.ts +19 -0
- package/dist/skills/bundled/embeddings/index.js +215 -0
- package/dist/skills/bundled/embeddings/index.js.map +1 -0
- package/dist/skills/bundled/endaoment/index.d.ts +105 -0
- package/dist/skills/bundled/endaoment/index.js +285 -0
- package/dist/skills/bundled/endaoment/index.js.map +1 -0
- package/dist/skills/bundled/ens/index.d.ts +151 -0
- package/dist/skills/bundled/ens/index.js +278 -0
- package/dist/skills/bundled/ens/index.js.map +1 -0
- package/dist/skills/bundled/erc8004/index.d.ts +123 -0
- package/dist/skills/bundled/erc8004/index.js +301 -0
- package/dist/skills/bundled/erc8004/index.js.map +1 -0
- package/dist/skills/bundled/execution/index.d.ts +18 -0
- package/dist/skills/bundled/execution/index.js +358 -0
- package/dist/skills/bundled/execution/index.js.map +1 -0
- package/dist/skills/bundled/farcaster/index.d.ts +121 -0
- package/dist/skills/bundled/farcaster/index.js +314 -0
- package/dist/skills/bundled/farcaster/index.js.map +1 -0
- package/dist/skills/bundled/features/index.d.ts +17 -0
- package/dist/skills/bundled/features/index.js +305 -0
- package/dist/skills/bundled/features/index.js.map +1 -0
- package/dist/skills/bundled/feeds/index.d.ts +26 -0
- package/dist/skills/bundled/feeds/index.js +462 -0
- package/dist/skills/bundled/feeds/index.js.map +1 -0
- package/dist/skills/bundled/harden/index.d.ts +55 -0
- package/dist/skills/bundled/harden/index.js +510 -0
- package/dist/skills/bundled/harden/index.js.map +1 -0
- package/dist/skills/bundled/history/index.d.ts +21 -0
- package/dist/skills/bundled/history/index.js +195 -0
- package/dist/skills/bundled/history/index.js.map +1 -0
- package/dist/skills/bundled/hyperliquid/index.d.ts +19 -0
- package/dist/skills/bundled/hyperliquid/index.js +1280 -0
- package/dist/skills/bundled/hyperliquid/index.js.map +1 -0
- package/dist/skills/bundled/identity/index.d.ts +17 -0
- package/dist/skills/bundled/identity/index.js +223 -0
- package/dist/skills/bundled/identity/index.js.map +1 -0
- package/dist/skills/bundled/integrations/index.d.ts +17 -0
- package/dist/skills/bundled/integrations/index.js +138 -0
- package/dist/skills/bundled/integrations/index.js.map +1 -0
- package/dist/skills/bundled/jupiter/index.d.ts +41 -0
- package/dist/skills/bundled/jupiter/index.js +872 -0
- package/dist/skills/bundled/jupiter/index.js.map +1 -0
- package/dist/skills/bundled/kamino/index.d.ts +33 -0
- package/dist/skills/bundled/kamino/index.js +578 -0
- package/dist/skills/bundled/kamino/index.js.map +1 -0
- package/dist/skills/bundled/ledger/index.d.ts +14 -0
- package/dist/skills/bundled/ledger/index.js +186 -0
- package/dist/skills/bundled/ledger/index.js.map +1 -0
- package/dist/skills/bundled/market-index/index.d.ts +18 -0
- package/dist/skills/bundled/market-index/index.js +182 -0
- package/dist/skills/bundled/market-index/index.js.map +1 -0
- package/dist/skills/bundled/markets/index.d.ts +16 -0
- package/dist/skills/bundled/markets/index.js +95 -0
- package/dist/skills/bundled/markets/index.js.map +1 -0
- package/dist/skills/bundled/mcp/index.d.ts +19 -0
- package/dist/skills/bundled/mcp/index.js +212 -0
- package/dist/skills/bundled/mcp/index.js.map +1 -0
- package/dist/skills/bundled/memory/index.d.ts +20 -0
- package/dist/skills/bundled/memory/index.js +210 -0
- package/dist/skills/bundled/memory/index.js.map +1 -0
- package/dist/skills/bundled/metaculus/index.d.ts +17 -0
- package/dist/skills/bundled/metaculus/index.js +168 -0
- package/dist/skills/bundled/metaculus/index.js.map +1 -0
- package/dist/skills/bundled/meteora/index.d.ts +39 -0
- package/dist/skills/bundled/meteora/index.js +837 -0
- package/dist/skills/bundled/meteora/index.js.map +1 -0
- package/dist/skills/bundled/meteora-dbc/index.d.ts +33 -0
- package/dist/skills/bundled/meteora-dbc/index.js +993 -0
- package/dist/skills/bundled/meteora-dbc/index.js.map +1 -0
- package/dist/skills/bundled/metrics/index.d.ts +18 -0
- package/dist/skills/bundled/metrics/index.js +91 -0
- package/dist/skills/bundled/metrics/index.js.map +1 -0
- package/dist/skills/bundled/mev/index.d.ts +17 -0
- package/dist/skills/bundled/mev/index.js +108 -0
- package/dist/skills/bundled/mev/index.js.map +1 -0
- package/dist/skills/bundled/mexc-futures/index.d.ts +16 -0
- package/dist/skills/bundled/mexc-futures/index.js +389 -0
- package/dist/skills/bundled/mexc-futures/index.js.map +1 -0
- package/dist/skills/bundled/mm/index.d.ts +18 -0
- package/dist/skills/bundled/mm/index.js +315 -0
- package/dist/skills/bundled/mm/index.js.map +1 -0
- package/dist/skills/bundled/monitoring/index.d.ts +18 -0
- package/dist/skills/bundled/monitoring/index.js +146 -0
- package/dist/skills/bundled/monitoring/index.js.map +1 -0
- package/dist/skills/bundled/news/index.d.ts +17 -0
- package/dist/skills/bundled/news/index.js +161 -0
- package/dist/skills/bundled/news/index.js.map +1 -0
- package/dist/skills/bundled/onchainkit/index.d.ts +92 -0
- package/dist/skills/bundled/onchainkit/index.js +429 -0
- package/dist/skills/bundled/onchainkit/index.js.map +1 -0
- package/dist/skills/bundled/opinion/index.d.ts +12 -0
- package/dist/skills/bundled/opinion/index.js +429 -0
- package/dist/skills/bundled/opinion/index.js.map +1 -0
- package/dist/skills/bundled/opportunity/index.d.ts +25 -0
- package/dist/skills/bundled/opportunity/index.js +289 -0
- package/dist/skills/bundled/opportunity/index.js.map +1 -0
- package/dist/skills/bundled/orca/index.d.ts +12 -0
- package/dist/skills/bundled/orca/index.js +663 -0
- package/dist/skills/bundled/orca/index.js.map +1 -0
- package/dist/skills/bundled/pairing/index.d.ts +24 -0
- package/dist/skills/bundled/pairing/index.js +228 -0
- package/dist/skills/bundled/pairing/index.js.map +1 -0
- package/dist/skills/bundled/percolator/index.d.ts +20 -0
- package/dist/skills/bundled/percolator/index.js +229 -0
- package/dist/skills/bundled/percolator/index.js.map +1 -0
- package/dist/skills/bundled/permissions/index.d.ts +21 -0
- package/dist/skills/bundled/permissions/index.js +204 -0
- package/dist/skills/bundled/permissions/index.js.map +1 -0
- package/dist/skills/bundled/plugins/index.d.ts +20 -0
- package/dist/skills/bundled/plugins/index.js +209 -0
- package/dist/skills/bundled/plugins/index.js.map +1 -0
- package/dist/skills/bundled/portfolio/index.d.ts +20 -0
- package/dist/skills/bundled/portfolio/index.js +367 -0
- package/dist/skills/bundled/portfolio/index.js.map +1 -0
- package/dist/skills/bundled/portfolio-sync/index.d.ts +17 -0
- package/dist/skills/bundled/portfolio-sync/index.js +116 -0
- package/dist/skills/bundled/portfolio-sync/index.js.map +1 -0
- package/dist/skills/bundled/positions/index.d.ts +18 -0
- package/dist/skills/bundled/positions/index.js +161 -0
- package/dist/skills/bundled/positions/index.js.map +1 -0
- package/dist/skills/bundled/predictfun/index.d.ts +13 -0
- package/dist/skills/bundled/predictfun/index.js +612 -0
- package/dist/skills/bundled/predictfun/index.js.map +1 -0
- package/dist/skills/bundled/predictit/index.d.ts +16 -0
- package/dist/skills/bundled/predictit/index.js +138 -0
- package/dist/skills/bundled/predictit/index.js.map +1 -0
- package/dist/skills/bundled/presence/index.d.ts +18 -0
- package/dist/skills/bundled/presence/index.js +151 -0
- package/dist/skills/bundled/presence/index.js.map +1 -0
- package/dist/skills/bundled/processes/index.d.ts +17 -0
- package/dist/skills/bundled/processes/index.js +121 -0
- package/dist/skills/bundled/processes/index.js.map +1 -0
- package/dist/skills/bundled/pump-swarm/index.d.ts +16 -0
- package/dist/skills/bundled/pump-swarm/index.js +2235 -0
- package/dist/skills/bundled/pump-swarm/index.js.map +1 -0
- package/dist/skills/bundled/pumpfun/index.d.ts +47 -0
- package/dist/skills/bundled/pumpfun/index.js +1400 -0
- package/dist/skills/bundled/pumpfun/index.js.map +1 -0
- package/dist/skills/bundled/qmd/index.d.ts +18 -0
- package/dist/skills/bundled/qmd/index.js +116 -0
- package/dist/skills/bundled/qmd/index.js.map +1 -0
- package/dist/skills/bundled/qrcoin/index.d.ts +92 -0
- package/dist/skills/bundled/qrcoin/index.js +328 -0
- package/dist/skills/bundled/qrcoin/index.js.map +1 -0
- package/dist/skills/bundled/raydium/index.d.ts +35 -0
- package/dist/skills/bundled/raydium/index.js +695 -0
- package/dist/skills/bundled/raydium/index.js.map +1 -0
- package/dist/skills/bundled/remote/index.d.ts +19 -0
- package/dist/skills/bundled/remote/index.js +186 -0
- package/dist/skills/bundled/remote/index.js.map +1 -0
- package/dist/skills/bundled/research/index.d.ts +17 -0
- package/dist/skills/bundled/research/index.js +185 -0
- package/dist/skills/bundled/research/index.js.map +1 -0
- package/dist/skills/bundled/risk/index.d.ts +31 -0
- package/dist/skills/bundled/risk/index.js +379 -0
- package/dist/skills/bundled/risk/index.js.map +1 -0
- package/dist/skills/bundled/router/index.d.ts +17 -0
- package/dist/skills/bundled/router/index.js +160 -0
- package/dist/skills/bundled/router/index.js.map +1 -0
- package/dist/skills/bundled/routing/index.d.ts +23 -0
- package/dist/skills/bundled/routing/index.js +257 -0
- package/dist/skills/bundled/routing/index.js.map +1 -0
- package/dist/skills/bundled/sandbox/index.d.ts +18 -0
- package/dist/skills/bundled/sandbox/index.js +119 -0
- package/dist/skills/bundled/sandbox/index.js.map +1 -0
- package/dist/skills/bundled/search-config/index.d.ts +18 -0
- package/dist/skills/bundled/search-config/index.js +170 -0
- package/dist/skills/bundled/search-config/index.js.map +1 -0
- package/dist/skills/bundled/sessions/index.d.ts +29 -0
- package/dist/skills/bundled/sessions/index.js +193 -0
- package/dist/skills/bundled/sessions/index.js.map +1 -0
- package/dist/skills/bundled/shield/index.d.ts +22 -0
- package/dist/skills/bundled/shield/index.js +245 -0
- package/dist/skills/bundled/shield/index.js.map +1 -0
- package/dist/skills/bundled/signals/index.d.ts +24 -0
- package/dist/skills/bundled/signals/index.js +776 -0
- package/dist/skills/bundled/signals/index.js.map +1 -0
- package/dist/skills/bundled/sizing/index.d.ts +16 -0
- package/dist/skills/bundled/sizing/index.js +168 -0
- package/dist/skills/bundled/sizing/index.js.map +1 -0
- package/dist/skills/bundled/slippage/index.d.ts +16 -0
- package/dist/skills/bundled/slippage/index.js +111 -0
- package/dist/skills/bundled/slippage/index.js.map +1 -0
- package/dist/skills/bundled/smarkets/index.d.ts +23 -0
- package/dist/skills/bundled/smarkets/index.js +473 -0
- package/dist/skills/bundled/smarkets/index.js.map +1 -0
- package/dist/skills/bundled/strategy/index.d.ts +18 -0
- package/dist/skills/bundled/strategy/index.js +168 -0
- package/dist/skills/bundled/strategy/index.js.map +1 -0
- package/dist/skills/bundled/streaming/index.d.ts +19 -0
- package/dist/skills/bundled/streaming/index.js +147 -0
- package/dist/skills/bundled/streaming/index.js.map +1 -0
- package/dist/skills/bundled/tailscale/index.d.ts +18 -0
- package/dist/skills/bundled/tailscale/index.js +173 -0
- package/dist/skills/bundled/tailscale/index.js.map +1 -0
- package/dist/skills/bundled/ticks/index.d.ts +17 -0
- package/dist/skills/bundled/ticks/index.js +287 -0
- package/dist/skills/bundled/ticks/index.js.map +1 -0
- package/dist/skills/bundled/token-security/index.d.ts +19 -0
- package/dist/skills/bundled/token-security/index.js +138 -0
- package/dist/skills/bundled/token-security/index.js.map +1 -0
- package/dist/skills/bundled/trading-evm/index.d.ts +19 -0
- package/dist/skills/bundled/trading-evm/index.js +302 -0
- package/dist/skills/bundled/trading-evm/index.js.map +1 -0
- package/dist/skills/bundled/trading-futures/index.d.ts +14 -0
- package/dist/skills/bundled/trading-futures/index.js +874 -0
- package/dist/skills/bundled/trading-futures/index.js.map +1 -0
- package/dist/skills/bundled/trading-kalshi/index.d.ts +36 -0
- package/dist/skills/bundled/trading-kalshi/index.js +1199 -0
- package/dist/skills/bundled/trading-kalshi/index.js.map +1 -0
- package/dist/skills/bundled/trading-manifold/index.d.ts +23 -0
- package/dist/skills/bundled/trading-manifold/index.js +391 -0
- package/dist/skills/bundled/trading-manifold/index.js.map +1 -0
- package/dist/skills/bundled/trading-polymarket/index.d.ts +27 -0
- package/dist/skills/bundled/trading-polymarket/index.js +1321 -0
- package/dist/skills/bundled/trading-polymarket/index.js.map +1 -0
- package/dist/skills/bundled/trading-solana/index.d.ts +19 -0
- package/dist/skills/bundled/trading-solana/index.js +383 -0
- package/dist/skills/bundled/trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/trading-system/index.d.ts +22 -0
- package/dist/skills/bundled/trading-system/index.js +355 -0
- package/dist/skills/bundled/trading-system/index.js.map +1 -0
- package/dist/skills/bundled/triggers/index.d.ts +18 -0
- package/dist/skills/bundled/triggers/index.js +172 -0
- package/dist/skills/bundled/triggers/index.js.map +1 -0
- package/dist/skills/bundled/tts/index.d.ts +16 -0
- package/dist/skills/bundled/tts/index.js +150 -0
- package/dist/skills/bundled/tts/index.js.map +1 -0
- package/dist/skills/bundled/tweet-ideas/index.d.ts +20 -0
- package/dist/skills/bundled/tweet-ideas/index.js +470 -0
- package/dist/skills/bundled/tweet-ideas/index.js.map +1 -0
- package/dist/skills/bundled/usage/index.d.ts +17 -0
- package/dist/skills/bundled/usage/index.js +145 -0
- package/dist/skills/bundled/usage/index.js.map +1 -0
- package/dist/skills/bundled/veil/index.d.ts +79 -0
- package/dist/skills/bundled/veil/index.js +322 -0
- package/dist/skills/bundled/veil/index.js.map +1 -0
- package/dist/skills/bundled/verify/index.d.ts +20 -0
- package/dist/skills/bundled/verify/index.js +157 -0
- package/dist/skills/bundled/verify/index.js.map +1 -0
- package/dist/skills/bundled/virtuals/index.d.ts +20 -0
- package/dist/skills/bundled/virtuals/index.js +255 -0
- package/dist/skills/bundled/virtuals/index.js.map +1 -0
- package/dist/skills/bundled/voice/index.d.ts +18 -0
- package/dist/skills/bundled/voice/index.js +190 -0
- package/dist/skills/bundled/voice/index.js.map +1 -0
- package/dist/skills/bundled/weather/index.d.ts +20 -0
- package/dist/skills/bundled/weather/index.js +475 -0
- package/dist/skills/bundled/weather/index.js.map +1 -0
- package/dist/skills/bundled/webhooks/index.d.ts +18 -0
- package/dist/skills/bundled/webhooks/index.js +136 -0
- package/dist/skills/bundled/webhooks/index.js.map +1 -0
- package/dist/skills/bundled/whale-tracking/index.d.ts +18 -0
- package/dist/skills/bundled/whale-tracking/index.js +441 -0
- package/dist/skills/bundled/whale-tracking/index.js.map +1 -0
- package/dist/skills/bundled/yoink/index.d.ts +78 -0
- package/dist/skills/bundled/yoink/index.js +236 -0
- package/dist/skills/bundled/yoink/index.js.map +1 -0
- package/dist/skills/executor.d.ts +117 -0
- package/dist/skills/executor.js +469 -0
- package/dist/skills/executor.js.map +1 -0
- package/dist/skills/frontmatter.d.ts +69 -0
- package/dist/skills/frontmatter.js +187 -0
- package/dist/skills/frontmatter.js.map +1 -0
- package/dist/skills/index.d.ts +150 -0
- package/dist/skills/index.js +531 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +48 -0
- package/dist/skills/loader.js +594 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/registry.d.ts +94 -0
- package/dist/skills/registry.js +308 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/solana/copytrade.d.ts +116 -0
- package/dist/solana/copytrade.js +493 -0
- package/dist/solana/copytrade.js.map +1 -0
- package/dist/solana/drift.d.ts +154 -0
- package/dist/solana/drift.js +599 -0
- package/dist/solana/drift.js.map +1 -0
- package/dist/solana/jupiter.d.ts +283 -0
- package/dist/solana/jupiter.js +553 -0
- package/dist/solana/jupiter.js.map +1 -0
- package/dist/solana/kamino.d.ts +206 -0
- package/dist/solana/kamino.js +546 -0
- package/dist/solana/kamino.js.map +1 -0
- package/dist/solana/meteora-dbc.d.ts +430 -0
- package/dist/solana/meteora-dbc.js +1105 -0
- package/dist/solana/meteora-dbc.js.map +1 -0
- package/dist/solana/meteora.d.ts +232 -0
- package/dist/solana/meteora.js +682 -0
- package/dist/solana/meteora.js.map +1 -0
- package/dist/solana/orca.d.ts +163 -0
- package/dist/solana/orca.js +378 -0
- package/dist/solana/orca.js.map +1 -0
- package/dist/solana/pools.d.ts +26 -0
- package/dist/solana/pools.js +96 -0
- package/dist/solana/pools.js.map +1 -0
- package/dist/solana/pump-swarm.d.ts +349 -0
- package/dist/solana/pump-swarm.js +1663 -0
- package/dist/solana/pump-swarm.js.map +1 -0
- package/dist/solana/pumpapi.d.ts +196 -0
- package/dist/solana/pumpapi.js +462 -0
- package/dist/solana/pumpapi.js.map +1 -0
- package/dist/solana/raydium.d.ts +170 -0
- package/dist/solana/raydium.js +673 -0
- package/dist/solana/raydium.js.map +1 -0
- package/dist/solana/swarm-ai-builder.d.ts +97 -0
- package/dist/solana/swarm-ai-builder.js +571 -0
- package/dist/solana/swarm-ai-builder.js.map +1 -0
- package/dist/solana/swarm-arbitrage.d.ts +111 -0
- package/dist/solana/swarm-arbitrage.js +437 -0
- package/dist/solana/swarm-arbitrage.js.map +1 -0
- package/dist/solana/swarm-builders.d.ts +71 -0
- package/dist/solana/swarm-builders.js +402 -0
- package/dist/solana/swarm-builders.js.map +1 -0
- package/dist/solana/swarm-copytrade.d.ts +103 -0
- package/dist/solana/swarm-copytrade.js +420 -0
- package/dist/solana/swarm-copytrade.js.map +1 -0
- package/dist/solana/swarm-presets.d.ts +49 -0
- package/dist/solana/swarm-presets.js +282 -0
- package/dist/solana/swarm-presets.js.map +1 -0
- package/dist/solana/swarm-signals.d.ts +128 -0
- package/dist/solana/swarm-signals.js +529 -0
- package/dist/solana/swarm-signals.js.map +1 -0
- package/dist/solana/swarm-strategies.d.ts +230 -0
- package/dist/solana/swarm-strategies.js +611 -0
- package/dist/solana/swarm-strategies.js.map +1 -0
- package/dist/solana/tokenlist.d.ts +10 -0
- package/dist/solana/tokenlist.js +54 -0
- package/dist/solana/tokenlist.js.map +1 -0
- package/dist/solana/wallet.d.ts +12 -0
- package/dist/solana/wallet.js +90 -0
- package/dist/solana/wallet.js.map +1 -0
- package/dist/strategies/crypto-hft/index.d.ts +46 -0
- package/dist/strategies/crypto-hft/index.js +469 -0
- package/dist/strategies/crypto-hft/index.js.map +1 -0
- package/dist/strategies/crypto-hft/market-scanner.d.ts +26 -0
- package/dist/strategies/crypto-hft/market-scanner.js +177 -0
- package/dist/strategies/crypto-hft/market-scanner.js.map +1 -0
- package/dist/strategies/crypto-hft/orderbook.d.ts +37 -0
- package/dist/strategies/crypto-hft/orderbook.js +184 -0
- package/dist/strategies/crypto-hft/orderbook.js.map +1 -0
- package/dist/strategies/crypto-hft/positions.d.ts +49 -0
- package/dist/strategies/crypto-hft/positions.js +376 -0
- package/dist/strategies/crypto-hft/positions.js.map +1 -0
- package/dist/strategies/crypto-hft/presets.d.ts +11 -0
- package/dist/strategies/crypto-hft/presets.js +164 -0
- package/dist/strategies/crypto-hft/presets.js.map +1 -0
- package/dist/strategies/crypto-hft/strategies.d.ts +96 -0
- package/dist/strategies/crypto-hft/strategies.js +330 -0
- package/dist/strategies/crypto-hft/strategies.js.map +1 -0
- package/dist/strategies/crypto-hft/types.d.ts +196 -0
- package/dist/strategies/crypto-hft/types.js +32 -0
- package/dist/strategies/crypto-hft/types.js.map +1 -0
- package/dist/strategies/hft-divergence/detector.d.ts +29 -0
- package/dist/strategies/hft-divergence/detector.js +182 -0
- package/dist/strategies/hft-divergence/detector.js.map +1 -0
- package/dist/strategies/hft-divergence/index.d.ts +12 -0
- package/dist/strategies/hft-divergence/index.js +19 -0
- package/dist/strategies/hft-divergence/index.js.map +1 -0
- package/dist/strategies/hft-divergence/market-rotator.d.ts +17 -0
- package/dist/strategies/hft-divergence/market-rotator.js +128 -0
- package/dist/strategies/hft-divergence/market-rotator.js.map +1 -0
- package/dist/strategies/hft-divergence/position-manager.d.ts +35 -0
- package/dist/strategies/hft-divergence/position-manager.js +188 -0
- package/dist/strategies/hft-divergence/position-manager.js.map +1 -0
- package/dist/strategies/hft-divergence/strategy.d.ts +31 -0
- package/dist/strategies/hft-divergence/strategy.js +295 -0
- package/dist/strategies/hft-divergence/strategy.js.map +1 -0
- package/dist/strategies/hft-divergence/types.d.ts +114 -0
- package/dist/strategies/hft-divergence/types.js +10 -0
- package/dist/strategies/hft-divergence/types.js.map +1 -0
- package/dist/streaming/index.d.ts +70 -0
- package/dist/streaming/index.js +296 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/tailscale/index.d.ts +139 -0
- package/dist/tailscale/index.js +345 -0
- package/dist/tailscale/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.js +535 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/terminal/index.d.ts +121 -0
- package/dist/terminal/index.js +548 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/token-security/index.d.ts +36 -0
- package/dist/token-security/index.js +253 -0
- package/dist/token-security/index.js.map +1 -0
- package/dist/tools/browser.d.ts +128 -0
- package/dist/tools/browser.js +459 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/canvas.d.ts +93 -0
- package/dist/tools/canvas.js +349 -0
- package/dist/tools/canvas.js.map +1 -0
- package/dist/tools/docker.d.ts +59 -0
- package/dist/tools/docker.js +191 -0
- package/dist/tools/docker.js.map +1 -0
- package/dist/tools/email.d.ts +25 -0
- package/dist/tools/email.js +131 -0
- package/dist/tools/email.js.map +1 -0
- package/dist/tools/exec.d.ts +81 -0
- package/dist/tools/exec.js +373 -0
- package/dist/tools/exec.js.map +1 -0
- package/dist/tools/files.d.ts +46 -0
- package/dist/tools/files.js +185 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/git.d.ts +29 -0
- package/dist/tools/git.js +105 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/image.d.ts +57 -0
- package/dist/tools/image.js +308 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/index.d.ts +39 -0
- package/dist/tools/index.js +46 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/message.d.ts +99 -0
- package/dist/tools/message.js +200 -0
- package/dist/tools/message.js.map +1 -0
- package/dist/tools/nodes.d.ts +134 -0
- package/dist/tools/nodes.js +357 -0
- package/dist/tools/nodes.js.map +1 -0
- package/dist/tools/sessions.d.ts +60 -0
- package/dist/tools/sessions.js +119 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/shell-history.d.ts +17 -0
- package/dist/tools/shell-history.js +118 -0
- package/dist/tools/shell-history.js.map +1 -0
- package/dist/tools/sms.d.ts +18 -0
- package/dist/tools/sms.js +66 -0
- package/dist/tools/sms.js.map +1 -0
- package/dist/tools/sql.d.ts +19 -0
- package/dist/tools/sql.js +91 -0
- package/dist/tools/sql.js.map +1 -0
- package/dist/tools/transcription.d.ts +13 -0
- package/dist/tools/transcription.js +99 -0
- package/dist/tools/transcription.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +69 -0
- package/dist/tools/web-fetch.js +251 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +58 -0
- package/dist/tools/web-search.js +204 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/webhooks.d.ts +74 -0
- package/dist/tools/webhooks.js +165 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/trading/accounts.d.ts +167 -0
- package/dist/trading/accounts.js +394 -0
- package/dist/trading/accounts.js.map +1 -0
- package/dist/trading/adapters/index.d.ts +27 -0
- package/dist/trading/adapters/index.js +165 -0
- package/dist/trading/adapters/index.js.map +1 -0
- package/dist/trading/backtest.d.ts +161 -0
- package/dist/trading/backtest.js +665 -0
- package/dist/trading/backtest.js.map +1 -0
- package/dist/trading/bots/index.d.ts +196 -0
- package/dist/trading/bots/index.js +688 -0
- package/dist/trading/bots/index.js.map +1 -0
- package/dist/trading/bridge.d.ts +33 -0
- package/dist/trading/bridge.js +121 -0
- package/dist/trading/bridge.js.map +1 -0
- package/dist/trading/builder.d.ts +102 -0
- package/dist/trading/builder.js +430 -0
- package/dist/trading/builder.js.map +1 -0
- package/dist/trading/copy-trading.d.ts +125 -0
- package/dist/trading/copy-trading.js +611 -0
- package/dist/trading/copy-trading.js.map +1 -0
- package/dist/trading/devtools.d.ts +172 -0
- package/dist/trading/devtools.js +425 -0
- package/dist/trading/devtools.js.map +1 -0
- package/dist/trading/futures/index.d.ts +981 -0
- package/dist/trading/futures/index.js +4011 -0
- package/dist/trading/futures/index.js.map +1 -0
- package/dist/trading/index.d.ts +102 -0
- package/dist/trading/index.js +310 -0
- package/dist/trading/index.js.map +1 -0
- package/dist/trading/kelly.d.ts +137 -0
- package/dist/trading/kelly.js +328 -0
- package/dist/trading/kelly.js.map +1 -0
- package/dist/trading/logger.d.ts +163 -0
- package/dist/trading/logger.js +424 -0
- package/dist/trading/logger.js.map +1 -0
- package/dist/trading/market-making/engine.d.ts +44 -0
- package/dist/trading/market-making/engine.js +165 -0
- package/dist/trading/market-making/engine.js.map +1 -0
- package/dist/trading/market-making/index.d.ts +10 -0
- package/dist/trading/market-making/index.js +29 -0
- package/dist/trading/market-making/index.js.map +1 -0
- package/dist/trading/market-making/strategy.d.ts +25 -0
- package/dist/trading/market-making/strategy.js +250 -0
- package/dist/trading/market-making/strategy.js.map +1 -0
- package/dist/trading/market-making/types.d.ts +92 -0
- package/dist/trading/market-making/types.js +6 -0
- package/dist/trading/market-making/types.js.map +1 -0
- package/dist/trading/ml-signals.d.ts +175 -0
- package/dist/trading/ml-signals.js +548 -0
- package/dist/trading/ml-signals.js.map +1 -0
- package/dist/trading/orchestrator.d.ts +59 -0
- package/dist/trading/orchestrator.js +199 -0
- package/dist/trading/orchestrator.js.map +1 -0
- package/dist/trading/position-bridge.d.ts +41 -0
- package/dist/trading/position-bridge.js +178 -0
- package/dist/trading/position-bridge.js.map +1 -0
- package/dist/trading/resilience.d.ts +81 -0
- package/dist/trading/resilience.js +257 -0
- package/dist/trading/resilience.js.map +1 -0
- package/dist/trading/risk.d.ts +18 -0
- package/dist/trading/risk.js +91 -0
- package/dist/trading/risk.js.map +1 -0
- package/dist/trading/safety.d.ts +114 -0
- package/dist/trading/safety.js +372 -0
- package/dist/trading/safety.js.map +1 -0
- package/dist/trading/secrets.d.ts +48 -0
- package/dist/trading/secrets.js +243 -0
- package/dist/trading/secrets.js.map +1 -0
- package/dist/trading/state.d.ts +88 -0
- package/dist/trading/state.js +221 -0
- package/dist/trading/state.js.map +1 -0
- package/dist/trading/stream.d.ts +121 -0
- package/dist/trading/stream.js +396 -0
- package/dist/trading/stream.js.map +1 -0
- package/dist/trading/tracking.d.ts +136 -0
- package/dist/trading/tracking.js +512 -0
- package/dist/trading/tracking.js.map +1 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +64 -0
- package/dist/tts/index.js.map +1 -0
- package/dist/tui/index.d.ts +159 -0
- package/dist/tui/index.js +580 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/types.d.ts +1373 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/usage/index.d.ts +57 -0
- package/dist/usage/index.js +191 -0
- package/dist/usage/index.js.map +1 -0
- package/dist/utils/attachments.d.ts +12 -0
- package/dist/utils/attachments.js +104 -0
- package/dist/utils/attachments.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.js +474 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/http.d.ts +22 -0
- package/dist/utils/http.js +191 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/utils/id.d.ts +21 -0
- package/dist/utils/id.js +41 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/json-utils.d.ts +201 -0
- package/dist/utils/json-utils.js +151 -0
- package/dist/utils/json-utils.js.map +1 -0
- package/dist/utils/kalshi-auth.d.ts +10 -0
- package/dist/utils/kalshi-auth.js +48 -0
- package/dist/utils/kalshi-auth.js.map +1 -0
- package/dist/utils/kelly.d.ts +153 -0
- package/dist/utils/kelly.js +322 -0
- package/dist/utils/kelly.js.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +26 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/opinion-auth.d.ts +17 -0
- package/dist/utils/opinion-auth.js +25 -0
- package/dist/utils/opinion-auth.js.map +1 -0
- package/dist/utils/polymarket-auth.d.ts +11 -0
- package/dist/utils/polymarket-auth.js +32 -0
- package/dist/utils/polymarket-auth.js.map +1 -0
- package/dist/utils/polymarket-order-signer.d.ts +118 -0
- package/dist/utils/polymarket-order-signer.js +329 -0
- package/dist/utils/polymarket-order-signer.js.map +1 -0
- package/dist/utils/polymarket-setup.d.ts +70 -0
- package/dist/utils/polymarket-setup.js +288 -0
- package/dist/utils/polymarket-setup.js.map +1 -0
- package/dist/utils/production.d.ts +112 -0
- package/dist/utils/production.js +294 -0
- package/dist/utils/production.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +77 -0
- package/dist/utils/rate-limiter.js +271 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/webhook-security.d.ts +63 -0
- package/dist/utils/webhook-security.js +183 -0
- package/dist/utils/webhook-security.js.map +1 -0
- package/dist/voice/index.d.ts +125 -0
- package/dist/voice/index.js +557 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/weather/edge.d.ts +70 -0
- package/dist/weather/edge.js +281 -0
- package/dist/weather/edge.js.map +1 -0
- package/dist/weather/index.d.ts +6 -0
- package/dist/weather/index.js +23 -0
- package/dist/weather/index.js.map +1 -0
- package/dist/weather/markets.d.ts +84 -0
- package/dist/weather/markets.js +320 -0
- package/dist/weather/markets.js.map +1 -0
- package/dist/weather/noaa.d.ts +113 -0
- package/dist/weather/noaa.js +287 -0
- package/dist/weather/noaa.js.map +1 -0
- package/dist/web/index.d.ts +112 -0
- package/dist/web/index.js +639 -0
- package/dist/web/index.js.map +1 -0
- package/dist/wizard/index.d.ts +27 -0
- package/dist/wizard/index.js +186 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/workspace/index.d.ts +73 -0
- package/dist/workspace/index.js +403 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +168 -0
|
@@ -0,0 +1,1283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cron Service - Clawdbot-style scheduled tasks
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - One-shot and recurring jobs
|
|
7
|
+
* - Cron expressions
|
|
8
|
+
* - Agent wakeups
|
|
9
|
+
* - Alert checking
|
|
10
|
+
* - Market monitoring
|
|
11
|
+
*/
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.createCronService = createCronService;
|
|
47
|
+
exports.createCronManager = createCronManager;
|
|
48
|
+
const eventemitter3_1 = require("eventemitter3");
|
|
49
|
+
const crypto_1 = require("crypto");
|
|
50
|
+
const id_1 = require("../utils/id");
|
|
51
|
+
const child_process_1 = require("child_process");
|
|
52
|
+
const path_1 = require("path");
|
|
53
|
+
const kalshi_auth_1 = require("../utils/kalshi-auth");
|
|
54
|
+
const logger_1 = require("../utils/logger");
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// HELPERS
|
|
57
|
+
// =============================================================================
|
|
58
|
+
/** Parse simple cron expression to next run time */
|
|
59
|
+
function getNextCronTime(expr, _tz) {
|
|
60
|
+
// Simple cron parser - supports: minute hour dayOfMonth month dayOfWeek
|
|
61
|
+
// Format: "0 9 * * *" = 9 AM daily
|
|
62
|
+
const parts = expr.trim().split(/\s+/);
|
|
63
|
+
if (parts.length < 5) {
|
|
64
|
+
// Invalid, return next minute
|
|
65
|
+
const now = new Date();
|
|
66
|
+
now.setSeconds(0);
|
|
67
|
+
now.setMilliseconds(0);
|
|
68
|
+
now.setMinutes(now.getMinutes() + 1);
|
|
69
|
+
return now.getTime();
|
|
70
|
+
}
|
|
71
|
+
const [minute, hour, _dayOfMonth, _month, _dayOfWeek] = parts;
|
|
72
|
+
const now = new Date();
|
|
73
|
+
const next = new Date(now);
|
|
74
|
+
// Set to specific minute/hour if specified
|
|
75
|
+
if (minute !== '*') {
|
|
76
|
+
next.setMinutes(parseInt(minute, 10));
|
|
77
|
+
}
|
|
78
|
+
if (hour !== '*') {
|
|
79
|
+
next.setHours(parseInt(hour, 10));
|
|
80
|
+
}
|
|
81
|
+
next.setSeconds(0);
|
|
82
|
+
next.setMilliseconds(0);
|
|
83
|
+
// If time already passed today, move to tomorrow
|
|
84
|
+
if (next.getTime() <= now.getTime()) {
|
|
85
|
+
next.setDate(next.getDate() + 1);
|
|
86
|
+
}
|
|
87
|
+
return next.getTime();
|
|
88
|
+
}
|
|
89
|
+
/** Calculate next run time for a schedule */
|
|
90
|
+
function calculateNextRun(schedule, lastRunMs) {
|
|
91
|
+
const now = Date.now();
|
|
92
|
+
switch (schedule.kind) {
|
|
93
|
+
case 'at':
|
|
94
|
+
return schedule.atMs > now ? schedule.atMs : -1; // -1 = already passed
|
|
95
|
+
case 'every': {
|
|
96
|
+
const anchor = schedule.anchorMs || now;
|
|
97
|
+
const elapsed = now - anchor;
|
|
98
|
+
const intervals = Math.floor(elapsed / schedule.everyMs);
|
|
99
|
+
return anchor + (intervals + 1) * schedule.everyMs;
|
|
100
|
+
}
|
|
101
|
+
case 'cron':
|
|
102
|
+
return getNextCronTime(schedule.expr, schedule.tz);
|
|
103
|
+
default:
|
|
104
|
+
return -1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function createCronService(deps) {
|
|
108
|
+
const emitter = new eventemitter3_1.EventEmitter();
|
|
109
|
+
const jobs = new Map();
|
|
110
|
+
const timers = new Map();
|
|
111
|
+
let running = false;
|
|
112
|
+
let tickInterval = null;
|
|
113
|
+
const digestSentOn = new Map();
|
|
114
|
+
const alertDefaults = {
|
|
115
|
+
priceChangeThresholdPct: deps.config?.alerts?.priceChange?.threshold ?? 5,
|
|
116
|
+
priceChangeWindowSecs: deps.config?.alerts?.priceChange?.windowSecs ?? 600,
|
|
117
|
+
volumeSpikeMultiplier: deps.config?.alerts?.volumeSpike?.multiplier ?? 3,
|
|
118
|
+
};
|
|
119
|
+
/** Generate unique job ID */
|
|
120
|
+
function generateId() {
|
|
121
|
+
return (0, id_1.generateId)('cron');
|
|
122
|
+
}
|
|
123
|
+
function persistJob(job) {
|
|
124
|
+
job.updatedAtMs = Date.now();
|
|
125
|
+
deps.db.upsertCronJob({
|
|
126
|
+
id: job.id,
|
|
127
|
+
data: JSON.stringify(job),
|
|
128
|
+
enabled: job.enabled,
|
|
129
|
+
createdAtMs: job.createdAtMs,
|
|
130
|
+
updatedAtMs: job.updatedAtMs,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function loadPersistedJobs() {
|
|
134
|
+
const records = deps.db.listCronJobs();
|
|
135
|
+
if (records.length === 0)
|
|
136
|
+
return;
|
|
137
|
+
for (const record of records) {
|
|
138
|
+
try {
|
|
139
|
+
const parsed = JSON.parse(record.data);
|
|
140
|
+
if (!parsed || typeof parsed !== 'object' || !parsed.id)
|
|
141
|
+
continue;
|
|
142
|
+
const job = {
|
|
143
|
+
...parsed,
|
|
144
|
+
enabled: record.enabled,
|
|
145
|
+
createdAtMs: record.createdAtMs ?? parsed.createdAtMs ?? Date.now(),
|
|
146
|
+
updatedAtMs: record.updatedAtMs ?? parsed.updatedAtMs ?? Date.now(),
|
|
147
|
+
state: parsed.state || {},
|
|
148
|
+
};
|
|
149
|
+
jobs.set(job.id, job);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
logger_1.logger.warn({ error, jobId: record.id }, 'Failed to parse persisted cron job');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function formatCents(price) {
|
|
157
|
+
return `${(price * 100).toFixed(1)}¢`;
|
|
158
|
+
}
|
|
159
|
+
function getPrimaryOutcome(market) {
|
|
160
|
+
if (!market?.outcomes?.length)
|
|
161
|
+
return null;
|
|
162
|
+
const yesOutcome = market.outcomes.find((o) => o.name?.toLowerCase() === 'yes');
|
|
163
|
+
const outcome = yesOutcome || market.outcomes[0];
|
|
164
|
+
if (!outcome || typeof outcome.price !== 'number')
|
|
165
|
+
return null;
|
|
166
|
+
return {
|
|
167
|
+
name: outcome.name,
|
|
168
|
+
price: outcome.price,
|
|
169
|
+
previousPrice: outcome.previousPrice,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function normalizeThresholdPct(value) {
|
|
173
|
+
if (!Number.isFinite(value))
|
|
174
|
+
return alertDefaults.priceChangeThresholdPct;
|
|
175
|
+
return value <= 1 ? value * 100 : value;
|
|
176
|
+
}
|
|
177
|
+
function resolveAlertRecipient(userId) {
|
|
178
|
+
const latest = deps.db.getLatestSessionForUser(userId);
|
|
179
|
+
if (latest) {
|
|
180
|
+
return { platform: latest.channel, chatId: latest.chatId };
|
|
181
|
+
}
|
|
182
|
+
const user = deps.db.getUser(userId);
|
|
183
|
+
if (!user)
|
|
184
|
+
return null;
|
|
185
|
+
return { platform: user.platform, chatId: user.platformUserId };
|
|
186
|
+
}
|
|
187
|
+
function buildPolymarketEnv(creds) {
|
|
188
|
+
return {
|
|
189
|
+
...process.env,
|
|
190
|
+
PRIVATE_KEY: creds.privateKey,
|
|
191
|
+
POLY_FUNDER_ADDRESS: creds.funderAddress,
|
|
192
|
+
POLY_API_KEY: creds.apiKey,
|
|
193
|
+
POLY_API_SECRET: creds.apiSecret,
|
|
194
|
+
POLY_API_PASSPHRASE: creds.apiPassphrase,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function buildKalshiEnv(creds) {
|
|
198
|
+
const env = { ...process.env };
|
|
199
|
+
if (creds.apiKeyId && creds.privateKeyPem) {
|
|
200
|
+
env.KALSHI_API_KEY_ID = creds.apiKeyId;
|
|
201
|
+
env.KALSHI_PRIVATE_KEY = creds.privateKeyPem;
|
|
202
|
+
}
|
|
203
|
+
if (creds.email && creds.password) {
|
|
204
|
+
env.KALSHI_EMAIL = creds.email;
|
|
205
|
+
env.KALSHI_PASSWORD = creds.password;
|
|
206
|
+
}
|
|
207
|
+
return env;
|
|
208
|
+
}
|
|
209
|
+
/** Execute a job based on its payload */
|
|
210
|
+
async function executeJob(job) {
|
|
211
|
+
const { payload } = job;
|
|
212
|
+
switch (payload.kind) {
|
|
213
|
+
case 'alertScan':
|
|
214
|
+
await checkAllAlerts();
|
|
215
|
+
break;
|
|
216
|
+
case 'alert':
|
|
217
|
+
await checkSingleAlert(payload.alertId);
|
|
218
|
+
break;
|
|
219
|
+
case 'marketCheck':
|
|
220
|
+
await checkMarket(payload.marketId, payload.platform);
|
|
221
|
+
break;
|
|
222
|
+
case 'portfolioSync':
|
|
223
|
+
await syncAllPortfolios();
|
|
224
|
+
break;
|
|
225
|
+
case 'dailyDigest':
|
|
226
|
+
await runDailyDigest();
|
|
227
|
+
break;
|
|
228
|
+
case 'stopLossScan':
|
|
229
|
+
await scanStopLosses();
|
|
230
|
+
break;
|
|
231
|
+
case 'agentTurn':
|
|
232
|
+
if (deps.executeAgentTurn) {
|
|
233
|
+
await deps.executeAgentTurn(payload.message, {
|
|
234
|
+
model: payload.model,
|
|
235
|
+
thinking: payload.thinking,
|
|
236
|
+
channel: payload.channel,
|
|
237
|
+
to: payload.to,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
break;
|
|
241
|
+
case 'systemEvent':
|
|
242
|
+
logger_1.logger.info({ event: payload.text }, 'System event triggered');
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Check all active alerts */
|
|
247
|
+
async function checkAllAlerts() {
|
|
248
|
+
const activeAlerts = deps.db.getActiveAlerts();
|
|
249
|
+
for (const alert of activeAlerts) {
|
|
250
|
+
try {
|
|
251
|
+
await checkSingleAlert(alert.id);
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
logger_1.logger.error({ alertId: alert.id, error }, 'Error checking alert');
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/** Check a single alert */
|
|
259
|
+
async function checkSingleAlert(alertId) {
|
|
260
|
+
const alerts = deps.db.getActiveAlerts();
|
|
261
|
+
const alert = alerts.find((a) => a.id === alertId);
|
|
262
|
+
if (!alert || !alert.marketId || !alert.platform)
|
|
263
|
+
return;
|
|
264
|
+
const market = await deps.feeds.getMarket(alert.marketId, alert.platform);
|
|
265
|
+
if (!market)
|
|
266
|
+
return;
|
|
267
|
+
const outcome = getPrimaryOutcome(market);
|
|
268
|
+
if (!outcome)
|
|
269
|
+
return;
|
|
270
|
+
const currentPrice = outcome.price;
|
|
271
|
+
const windowSecs = alert.condition.timeWindowSecs ?? alertDefaults.priceChangeWindowSecs;
|
|
272
|
+
const previousMarket = deps.db.getCachedMarket(alert.platform, alert.marketId, windowSecs * 1000);
|
|
273
|
+
const previousOutcome = previousMarket ? getPrimaryOutcome(previousMarket) : null;
|
|
274
|
+
const previousPrice = previousOutcome?.price ?? outcome.previousPrice;
|
|
275
|
+
const currentVolume = market.volume24h ?? 0;
|
|
276
|
+
const previousVolume = previousMarket?.volume24h ?? 0;
|
|
277
|
+
let triggered = false;
|
|
278
|
+
let message = '';
|
|
279
|
+
switch (alert.condition.type) {
|
|
280
|
+
case 'price_above':
|
|
281
|
+
if (currentPrice >= alert.condition.threshold) {
|
|
282
|
+
triggered = true;
|
|
283
|
+
message = `📈 Price Alert: ${market.question}\nPrice is now ${(currentPrice * 100).toFixed(1)}¢ (above ${(alert.condition.threshold * 100).toFixed(1)}¢)`;
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
case 'price_below':
|
|
287
|
+
if (currentPrice <= alert.condition.threshold) {
|
|
288
|
+
triggered = true;
|
|
289
|
+
message = `📉 Price Alert: ${market.question}\nPrice is now ${(currentPrice * 100).toFixed(1)}¢ (below ${(alert.condition.threshold * 100).toFixed(1)}¢)`;
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
case 'price_change_pct': {
|
|
293
|
+
if (previousPrice === undefined || previousPrice <= 0)
|
|
294
|
+
break;
|
|
295
|
+
const thresholdPct = normalizeThresholdPct(alert.condition.threshold);
|
|
296
|
+
const changePct = ((currentPrice - previousPrice) / previousPrice) * 100;
|
|
297
|
+
const direction = alert.condition.direction ?? 'any';
|
|
298
|
+
const directionMatch = direction === 'any'
|
|
299
|
+
? Math.abs(changePct) >= thresholdPct
|
|
300
|
+
: direction === 'up'
|
|
301
|
+
? changePct >= thresholdPct
|
|
302
|
+
: changePct <= -thresholdPct;
|
|
303
|
+
if (directionMatch) {
|
|
304
|
+
triggered = true;
|
|
305
|
+
const arrow = changePct >= 0 ? '📈' : '📉';
|
|
306
|
+
message =
|
|
307
|
+
`${arrow} Price Change Alert: ${market.question}\n` +
|
|
308
|
+
`Price moved ${changePct >= 0 ? '+' : ''}${changePct.toFixed(2)}% ` +
|
|
309
|
+
`(${formatCents(previousPrice)} → ${formatCents(currentPrice)})`;
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case 'volume_spike': {
|
|
314
|
+
const multiplier = Number.isFinite(alert.condition.threshold)
|
|
315
|
+
? alert.condition.threshold
|
|
316
|
+
: alertDefaults.volumeSpikeMultiplier;
|
|
317
|
+
if (previousVolume > 0 && currentVolume / previousVolume >= multiplier) {
|
|
318
|
+
triggered = true;
|
|
319
|
+
const ratio = currentVolume / previousVolume;
|
|
320
|
+
message =
|
|
321
|
+
`📊 Volume Spike: ${market.question}\n` +
|
|
322
|
+
`24h volume is ${ratio.toFixed(2)}x (${currentVolume.toLocaleString()} vs ${previousVolume.toLocaleString()})`;
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
deps.db.cacheMarket(market);
|
|
328
|
+
if (triggered) {
|
|
329
|
+
deps.db.triggerAlert(alert.id);
|
|
330
|
+
const target = alert.channel && alert.chatId
|
|
331
|
+
? { platform: alert.channel, chatId: alert.chatId }
|
|
332
|
+
: resolveAlertRecipient(alert.userId);
|
|
333
|
+
if (target) {
|
|
334
|
+
await deps.sendMessage({
|
|
335
|
+
platform: target.platform,
|
|
336
|
+
chatId: target.chatId,
|
|
337
|
+
text: message,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
logger_1.logger.info({ alertId: alert.id }, 'Alert triggered');
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/** Check a specific market */
|
|
344
|
+
async function checkMarket(marketId, platform) {
|
|
345
|
+
const market = await deps.feeds.getMarket(marketId, platform);
|
|
346
|
+
if (market) {
|
|
347
|
+
logger_1.logger.debug({ marketId, platform, price: market.outcomes[0]?.price }, 'Market checked');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function parseDigestTime(raw) {
|
|
351
|
+
if (!raw)
|
|
352
|
+
return { hour: 9, minute: 0 };
|
|
353
|
+
const parts = raw.split(':').map((p) => p.trim()).filter(Boolean);
|
|
354
|
+
const hour = Number.parseInt(parts[0] ?? '', 10);
|
|
355
|
+
const minute = Number.parseInt(parts[1] ?? '0', 10);
|
|
356
|
+
if (!Number.isFinite(hour) || hour < 0 || hour > 23)
|
|
357
|
+
return null;
|
|
358
|
+
if (!Number.isFinite(minute) || minute < 0 || minute > 59)
|
|
359
|
+
return null;
|
|
360
|
+
return { hour, minute };
|
|
361
|
+
}
|
|
362
|
+
function shouldSendDigest(user, now, windowMinutes) {
|
|
363
|
+
if (!user.settings?.digestEnabled)
|
|
364
|
+
return false;
|
|
365
|
+
const time = parseDigestTime(user.settings.digestTime);
|
|
366
|
+
if (!time)
|
|
367
|
+
return false;
|
|
368
|
+
const today = now.toISOString().slice(0, 10);
|
|
369
|
+
if (digestSentOn.get(user.id) === today)
|
|
370
|
+
return false;
|
|
371
|
+
if (now.getHours() !== time.hour)
|
|
372
|
+
return false;
|
|
373
|
+
const minute = now.getMinutes();
|
|
374
|
+
return minute >= time.minute && minute < time.minute + windowMinutes;
|
|
375
|
+
}
|
|
376
|
+
function buildPosition(params) {
|
|
377
|
+
const value = params.shares * params.currentPrice;
|
|
378
|
+
const pnl = params.shares * (params.currentPrice - params.avgPrice);
|
|
379
|
+
const pnlPct = params.avgPrice > 0 ? ((params.currentPrice - params.avgPrice) / params.avgPrice) * 100 : 0;
|
|
380
|
+
return {
|
|
381
|
+
id: (0, crypto_1.randomUUID)(),
|
|
382
|
+
platform: params.platform,
|
|
383
|
+
marketId: params.marketId,
|
|
384
|
+
marketQuestion: params.marketQuestion,
|
|
385
|
+
outcome: params.outcome,
|
|
386
|
+
outcomeId: params.outcomeId,
|
|
387
|
+
side: (params.side === 'YES' || params.side === 'NO' ? params.side : params.side.toUpperCase() === 'LONG' ? 'YES' : 'NO'),
|
|
388
|
+
shares: params.shares,
|
|
389
|
+
avgPrice: params.avgPrice,
|
|
390
|
+
currentPrice: params.currentPrice,
|
|
391
|
+
pnl,
|
|
392
|
+
pnlPct,
|
|
393
|
+
value,
|
|
394
|
+
openedAt: new Date(),
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function normalizeSide(outcome) {
|
|
398
|
+
return outcome && outcome.toString().toUpperCase().includes('NO') ? 'NO' : 'YES';
|
|
399
|
+
}
|
|
400
|
+
function toNumber(value) {
|
|
401
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
402
|
+
return value;
|
|
403
|
+
if (value === null || value === undefined)
|
|
404
|
+
return null;
|
|
405
|
+
const parsed = Number.parseFloat(String(value));
|
|
406
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
407
|
+
}
|
|
408
|
+
function normalizeKalshiPrice(value) {
|
|
409
|
+
const num = toNumber(value);
|
|
410
|
+
if (num === null)
|
|
411
|
+
return null;
|
|
412
|
+
return num > 1 ? num / 100 : num;
|
|
413
|
+
}
|
|
414
|
+
async function runDailyDigest() {
|
|
415
|
+
const users = deps.db.listUsers();
|
|
416
|
+
if (users.length === 0)
|
|
417
|
+
return;
|
|
418
|
+
const now = new Date();
|
|
419
|
+
const windowMinutes = 5;
|
|
420
|
+
for (const user of users) {
|
|
421
|
+
if (!shouldSendDigest(user, now, windowMinutes))
|
|
422
|
+
continue;
|
|
423
|
+
const positions = deps.db.getPositions(user.id);
|
|
424
|
+
const alerts = deps.db.getAlerts(user.id).filter((a) => a.enabled && !a.triggered);
|
|
425
|
+
const news = deps.feeds.getRecentNews(5);
|
|
426
|
+
const lines = [];
|
|
427
|
+
lines.push(`📬 Daily Digest — ${now.toLocaleDateString()}`);
|
|
428
|
+
if (positions.length > 0) {
|
|
429
|
+
const totalValue = positions.reduce((sum, p) => sum + p.value, 0);
|
|
430
|
+
const totalPnl = positions.reduce((sum, p) => sum + p.pnl, 0);
|
|
431
|
+
lines.push(`Portfolio: $${totalValue.toFixed(2)} (${totalPnl >= 0 ? '+' : ''}$${totalPnl.toFixed(2)})`);
|
|
432
|
+
const topPositions = [...positions]
|
|
433
|
+
.sort((a, b) => Math.abs(b.pnl) - Math.abs(a.pnl))
|
|
434
|
+
.slice(0, 3);
|
|
435
|
+
for (const pos of topPositions) {
|
|
436
|
+
lines.push(`• ${pos.marketQuestion.slice(0, 60)} — ${pos.side} ${formatCents(pos.currentPrice)} ` +
|
|
437
|
+
`(${pos.pnl >= 0 ? '+' : ''}$${pos.pnl.toFixed(2)})`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
lines.push('Portfolio: no tracked positions yet.');
|
|
442
|
+
}
|
|
443
|
+
if (alerts.length > 0) {
|
|
444
|
+
lines.push(`Active alerts: ${alerts.length}`);
|
|
445
|
+
}
|
|
446
|
+
if (news.length > 0) {
|
|
447
|
+
lines.push('', 'Top news:');
|
|
448
|
+
for (const item of news.slice(0, 3)) {
|
|
449
|
+
lines.push(`• ${item.title} (${item.source})`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const target = resolveAlertRecipient(user.id);
|
|
453
|
+
if (!target)
|
|
454
|
+
continue;
|
|
455
|
+
await deps.sendMessage({
|
|
456
|
+
platform: target.platform,
|
|
457
|
+
chatId: target.chatId,
|
|
458
|
+
text: lines.join('\n'),
|
|
459
|
+
});
|
|
460
|
+
digestSentOn.set(user.id, now.toISOString().slice(0, 10));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
async function fetchPolymarketPositions(userId, creds) {
|
|
464
|
+
const address = creds.funderAddress;
|
|
465
|
+
if (!address)
|
|
466
|
+
return [];
|
|
467
|
+
const response = await fetch(`https://data-api.polymarket.com/positions?user=${address}`);
|
|
468
|
+
if (!response.ok) {
|
|
469
|
+
throw new Error(`Polymarket positions fetch failed: ${response.status}`);
|
|
470
|
+
}
|
|
471
|
+
const data = await response.json();
|
|
472
|
+
const positions = [];
|
|
473
|
+
for (const item of data || []) {
|
|
474
|
+
const marketId = item.conditionId ||
|
|
475
|
+
item.condition_id ||
|
|
476
|
+
item.marketId ||
|
|
477
|
+
item.market_id ||
|
|
478
|
+
item.market;
|
|
479
|
+
if (!marketId)
|
|
480
|
+
continue;
|
|
481
|
+
const outcome = item.outcome || 'YES';
|
|
482
|
+
const side = normalizeSide(outcome);
|
|
483
|
+
const shares = toNumber(item.size ?? item.shares ?? item.balance) ?? 0;
|
|
484
|
+
if (shares <= 0)
|
|
485
|
+
continue;
|
|
486
|
+
const avgPrice = toNumber(item.avgPrice ?? item.avg_price ?? item.entryPrice ?? item.entry_price) ?? 0;
|
|
487
|
+
const currentPrice = toNumber(item.currentPrice ?? item.current_price ?? item.price) ?? avgPrice;
|
|
488
|
+
const outcomeId = item.tokenId || item.token_id || `${marketId}-${side}`;
|
|
489
|
+
const marketQuestion = item.title ||
|
|
490
|
+
item.market ||
|
|
491
|
+
item.question ||
|
|
492
|
+
marketId;
|
|
493
|
+
positions.push(buildPosition({
|
|
494
|
+
platform: 'polymarket',
|
|
495
|
+
marketId,
|
|
496
|
+
marketQuestion,
|
|
497
|
+
outcome,
|
|
498
|
+
outcomeId,
|
|
499
|
+
side,
|
|
500
|
+
shares,
|
|
501
|
+
avgPrice: avgPrice > 0 ? avgPrice : currentPrice,
|
|
502
|
+
currentPrice,
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
await deps.credentials?.markSuccess(userId, 'polymarket');
|
|
506
|
+
return positions;
|
|
507
|
+
}
|
|
508
|
+
async function fetchKalshiPositions(userId, creds) {
|
|
509
|
+
const KALSHI_API_BASE = 'https://api.elections.kalshi.com/trade-api/v2';
|
|
510
|
+
let headers;
|
|
511
|
+
if (creds.apiKeyId && creds.privateKeyPem) {
|
|
512
|
+
headers = (0, kalshi_auth_1.buildKalshiHeadersForUrl)({ apiKeyId: creds.apiKeyId, privateKeyPem: creds.privateKeyPem }, 'GET', `${KALSHI_API_BASE}/portfolio/positions`);
|
|
513
|
+
}
|
|
514
|
+
else if (creds.email && creds.password) {
|
|
515
|
+
const loginRes = await fetch(`${KALSHI_API_BASE}/login`, {
|
|
516
|
+
method: 'POST',
|
|
517
|
+
headers: { 'Content-Type': 'application/json' },
|
|
518
|
+
body: JSON.stringify({ email: creds.email, password: creds.password }),
|
|
519
|
+
});
|
|
520
|
+
if (!loginRes.ok) {
|
|
521
|
+
throw new Error(`Kalshi login failed: ${loginRes.status}`);
|
|
522
|
+
}
|
|
523
|
+
const loginData = await loginRes.json();
|
|
524
|
+
headers = { Authorization: `Bearer ${loginData.token}` };
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
return [];
|
|
528
|
+
}
|
|
529
|
+
const posRes = await fetch(`${KALSHI_API_BASE}/portfolio/positions`, { headers });
|
|
530
|
+
if (!posRes.ok) {
|
|
531
|
+
throw new Error(`Kalshi positions fetch failed: ${posRes.status}`);
|
|
532
|
+
}
|
|
533
|
+
const posData = await posRes.json();
|
|
534
|
+
const marketCache = new Map();
|
|
535
|
+
const positions = [];
|
|
536
|
+
for (const entry of posData.market_positions || []) {
|
|
537
|
+
const ticker = entry.ticker;
|
|
538
|
+
if (!ticker)
|
|
539
|
+
continue;
|
|
540
|
+
const rawPosition = toNumber(entry.position ?? entry.shares ?? entry.count) ?? 0;
|
|
541
|
+
if (rawPosition === 0)
|
|
542
|
+
continue;
|
|
543
|
+
const side = rawPosition >= 0 ? 'YES' : 'NO';
|
|
544
|
+
const shares = Math.abs(rawPosition);
|
|
545
|
+
let market = marketCache.get(ticker);
|
|
546
|
+
if (!market) {
|
|
547
|
+
const marketRes = await fetch(`${KALSHI_API_BASE}/markets/${ticker}`, { headers });
|
|
548
|
+
if (marketRes.ok) {
|
|
549
|
+
const marketJson = await marketRes.json();
|
|
550
|
+
market = (marketJson.market || marketJson);
|
|
551
|
+
marketCache.set(ticker, market);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
const marketQuestion = market?.title || entry.market || ticker;
|
|
555
|
+
const yesPrice = normalizeKalshiPrice(market?.yes_bid ?? market?.yes_ask ?? market?.yes_price ?? market?.last_price) ?? 0.5;
|
|
556
|
+
const currentPrice = side === 'YES' ? yesPrice : Math.max(0, 1 - yesPrice);
|
|
557
|
+
let avgPrice = normalizeKalshiPrice(entry.avg_price ?? entry.average_price ?? entry.avg_entry_price) ??
|
|
558
|
+
null;
|
|
559
|
+
if (avgPrice === null) {
|
|
560
|
+
const totalTraded = toNumber(entry.total_traded ?? entry.cost_basis);
|
|
561
|
+
if (totalTraded && shares > 0) {
|
|
562
|
+
avgPrice = normalizeKalshiPrice(totalTraded / shares);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
avgPrice = avgPrice ?? currentPrice;
|
|
566
|
+
positions.push(buildPosition({
|
|
567
|
+
platform: 'kalshi',
|
|
568
|
+
marketId: ticker,
|
|
569
|
+
marketQuestion,
|
|
570
|
+
outcome: side,
|
|
571
|
+
outcomeId: `${ticker}-${side}`,
|
|
572
|
+
side,
|
|
573
|
+
shares,
|
|
574
|
+
avgPrice,
|
|
575
|
+
currentPrice,
|
|
576
|
+
}));
|
|
577
|
+
}
|
|
578
|
+
await deps.credentials?.markSuccess(userId, 'kalshi');
|
|
579
|
+
return positions;
|
|
580
|
+
}
|
|
581
|
+
async function fetchManifoldPositions(userId, creds) {
|
|
582
|
+
if (!creds.apiKey)
|
|
583
|
+
return [];
|
|
584
|
+
const headers = { Authorization: `Key ${creds.apiKey}` };
|
|
585
|
+
const meRes = await fetch('https://api.manifold.markets/v0/me', { headers });
|
|
586
|
+
if (!meRes.ok) {
|
|
587
|
+
throw new Error(`Manifold /me failed: ${meRes.status}`);
|
|
588
|
+
}
|
|
589
|
+
const meData = await meRes.json();
|
|
590
|
+
if (!meData.id)
|
|
591
|
+
return [];
|
|
592
|
+
const betsRes = await fetch(`https://api.manifold.markets/v0/bets?userId=${meData.id}&limit=1000`, { headers });
|
|
593
|
+
if (!betsRes.ok) {
|
|
594
|
+
throw new Error(`Manifold bets fetch failed: ${betsRes.status}`);
|
|
595
|
+
}
|
|
596
|
+
const bets = await betsRes.json();
|
|
597
|
+
const byMarket = new Map();
|
|
598
|
+
for (const bet of bets || []) {
|
|
599
|
+
if (bet.isSold || bet.isCancelled)
|
|
600
|
+
continue;
|
|
601
|
+
const marketId = bet.contractId;
|
|
602
|
+
if (!marketId)
|
|
603
|
+
continue;
|
|
604
|
+
const entry = byMarket.get(marketId) || {
|
|
605
|
+
question: bet.contractQuestion,
|
|
606
|
+
yesShares: 0,
|
|
607
|
+
noShares: 0,
|
|
608
|
+
yesInvested: 0,
|
|
609
|
+
noInvested: 0,
|
|
610
|
+
};
|
|
611
|
+
const shares = toNumber(bet.shares) ?? 0;
|
|
612
|
+
const amount = toNumber(bet.amount) ?? 0;
|
|
613
|
+
if (bet.outcome === 'YES') {
|
|
614
|
+
entry.yesShares += shares;
|
|
615
|
+
entry.yesInvested += amount;
|
|
616
|
+
}
|
|
617
|
+
else if (bet.outcome === 'NO') {
|
|
618
|
+
entry.noShares += shares;
|
|
619
|
+
entry.noInvested += amount;
|
|
620
|
+
}
|
|
621
|
+
if (!entry.question && bet.contractQuestion) {
|
|
622
|
+
entry.question = bet.contractQuestion;
|
|
623
|
+
}
|
|
624
|
+
byMarket.set(marketId, entry);
|
|
625
|
+
}
|
|
626
|
+
const marketCache = new Map();
|
|
627
|
+
const positions = [];
|
|
628
|
+
for (const [marketId, entry] of byMarket.entries()) {
|
|
629
|
+
if (entry.yesShares <= 0 && entry.noShares <= 0)
|
|
630
|
+
continue;
|
|
631
|
+
let market = marketCache.get(marketId);
|
|
632
|
+
if (!market) {
|
|
633
|
+
const marketRes = await fetch(`https://api.manifold.markets/v0/market/${marketId}`);
|
|
634
|
+
if (marketRes.ok) {
|
|
635
|
+
market = await marketRes.json();
|
|
636
|
+
marketCache.set(marketId, market);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
const question = market?.question || entry.question || marketId;
|
|
640
|
+
const prob = toNumber(market?.probability) ?? 0.5;
|
|
641
|
+
if (entry.yesShares > 0) {
|
|
642
|
+
const avg = entry.yesShares > 0 ? entry.yesInvested / entry.yesShares : prob;
|
|
643
|
+
positions.push(buildPosition({
|
|
644
|
+
platform: 'manifold',
|
|
645
|
+
marketId,
|
|
646
|
+
marketQuestion: question,
|
|
647
|
+
outcome: 'YES',
|
|
648
|
+
outcomeId: `${marketId}-YES`,
|
|
649
|
+
side: 'YES',
|
|
650
|
+
shares: entry.yesShares,
|
|
651
|
+
avgPrice: avg,
|
|
652
|
+
currentPrice: prob,
|
|
653
|
+
}));
|
|
654
|
+
}
|
|
655
|
+
if (entry.noShares > 0) {
|
|
656
|
+
const noPrice = Math.max(0, 1 - prob);
|
|
657
|
+
const avg = entry.noShares > 0 ? entry.noInvested / entry.noShares : noPrice;
|
|
658
|
+
positions.push(buildPosition({
|
|
659
|
+
platform: 'manifold',
|
|
660
|
+
marketId,
|
|
661
|
+
marketQuestion: question,
|
|
662
|
+
outcome: 'NO',
|
|
663
|
+
outcomeId: `${marketId}-NO`,
|
|
664
|
+
side: 'NO',
|
|
665
|
+
shares: entry.noShares,
|
|
666
|
+
avgPrice: avg,
|
|
667
|
+
currentPrice: noPrice,
|
|
668
|
+
}));
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
await deps.credentials?.markSuccess(userId, 'manifold');
|
|
672
|
+
return positions;
|
|
673
|
+
}
|
|
674
|
+
async function syncAllPortfolios() {
|
|
675
|
+
const credentials = deps.credentials;
|
|
676
|
+
if (!credentials) {
|
|
677
|
+
logger_1.logger.warn('Portfolio sync skipped: credentials manager not configured');
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
const credentialUsers = deps.db.query('SELECT DISTINCT user_id FROM trading_credentials WHERE enabled = 1');
|
|
681
|
+
const userIds = credentialUsers.map((row) => row.user_id);
|
|
682
|
+
if (userIds.length === 0)
|
|
683
|
+
return;
|
|
684
|
+
for (const userId of userIds) {
|
|
685
|
+
const user = deps.db.getUser(userId);
|
|
686
|
+
if (!user)
|
|
687
|
+
continue;
|
|
688
|
+
const platforms = await credentials.listUserPlatforms(userId);
|
|
689
|
+
if (platforms.length === 0)
|
|
690
|
+
continue;
|
|
691
|
+
for (const platform of platforms) {
|
|
692
|
+
try {
|
|
693
|
+
let positions = null;
|
|
694
|
+
if (platform === 'polymarket') {
|
|
695
|
+
const creds = await credentials.getCredentials(userId, 'polymarket');
|
|
696
|
+
if (creds)
|
|
697
|
+
positions = await fetchPolymarketPositions(userId, creds);
|
|
698
|
+
}
|
|
699
|
+
else if (platform === 'kalshi') {
|
|
700
|
+
const creds = await credentials.getCredentials(userId, 'kalshi');
|
|
701
|
+
if (creds)
|
|
702
|
+
positions = await fetchKalshiPositions(userId, creds);
|
|
703
|
+
}
|
|
704
|
+
else if (platform === 'manifold') {
|
|
705
|
+
const creds = await credentials.getCredentials(userId, 'manifold');
|
|
706
|
+
if (creds)
|
|
707
|
+
positions = await fetchManifoldPositions(userId, creds);
|
|
708
|
+
}
|
|
709
|
+
else if (platform === 'hyperliquid') {
|
|
710
|
+
const creds = await credentials.getCredentials(userId, 'hyperliquid');
|
|
711
|
+
if (creds) {
|
|
712
|
+
const hl = await Promise.resolve().then(() => __importStar(require('../exchanges/hyperliquid/index')));
|
|
713
|
+
const state = await hl.getUserState(creds.walletAddress);
|
|
714
|
+
positions = state.assetPositions
|
|
715
|
+
.filter((ap) => parseFloat(ap.position.szi) !== 0)
|
|
716
|
+
.map((ap) => {
|
|
717
|
+
const p = ap.position;
|
|
718
|
+
const shares = Math.abs(parseFloat(p.szi));
|
|
719
|
+
const entryPrice = parseFloat(p.entryPx);
|
|
720
|
+
const uPnl = parseFloat(p.unrealizedPnl);
|
|
721
|
+
const isLong = parseFloat(p.szi) > 0;
|
|
722
|
+
const currentPrice = shares > 0 ? entryPrice + uPnl / shares : entryPrice;
|
|
723
|
+
return buildPosition({
|
|
724
|
+
platform: 'hyperliquid',
|
|
725
|
+
marketId: p.coin,
|
|
726
|
+
marketQuestion: `${p.coin} Perp`,
|
|
727
|
+
outcome: isLong ? 'Long' : 'Short',
|
|
728
|
+
outcomeId: `hl_${p.coin}_${isLong ? 'long' : 'short'}`,
|
|
729
|
+
side: isLong ? 'LONG' : 'SHORT',
|
|
730
|
+
shares,
|
|
731
|
+
avgPrice: entryPrice,
|
|
732
|
+
currentPrice,
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
else if (platform === 'binance') {
|
|
738
|
+
const creds = await credentials.getCredentials(userId, 'binance');
|
|
739
|
+
if (creds) {
|
|
740
|
+
const bin = await Promise.resolve().then(() => __importStar(require('../exchanges/binance-futures/index')));
|
|
741
|
+
const rawPositions = await bin.getPositions(creds);
|
|
742
|
+
positions = rawPositions
|
|
743
|
+
.filter((p) => p.positionAmt !== 0)
|
|
744
|
+
.map((p) => {
|
|
745
|
+
const isLong = p.positionAmt > 0;
|
|
746
|
+
return buildPosition({
|
|
747
|
+
platform: 'binance',
|
|
748
|
+
marketId: p.symbol,
|
|
749
|
+
marketQuestion: `${p.symbol} Perp`,
|
|
750
|
+
outcome: isLong ? 'Long' : 'Short',
|
|
751
|
+
outcomeId: `binance_${p.symbol}_${p.positionSide}`,
|
|
752
|
+
side: isLong ? 'LONG' : 'SHORT',
|
|
753
|
+
shares: Math.abs(p.positionAmt),
|
|
754
|
+
avgPrice: p.entryPrice,
|
|
755
|
+
currentPrice: p.markPrice,
|
|
756
|
+
});
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
else if (platform === 'bybit') {
|
|
761
|
+
const creds = await credentials.getCredentials(userId, 'bybit');
|
|
762
|
+
if (creds) {
|
|
763
|
+
const bb = await Promise.resolve().then(() => __importStar(require('../exchanges/bybit/index')));
|
|
764
|
+
const rawPositions = await bb.getPositions(creds);
|
|
765
|
+
positions = rawPositions
|
|
766
|
+
.filter((p) => p.size !== 0)
|
|
767
|
+
.map((p) => {
|
|
768
|
+
const isLong = p.side === 'Buy';
|
|
769
|
+
return buildPosition({
|
|
770
|
+
platform: 'bybit',
|
|
771
|
+
marketId: p.symbol,
|
|
772
|
+
marketQuestion: `${p.symbol} Perp`,
|
|
773
|
+
outcome: isLong ? 'Long' : 'Short',
|
|
774
|
+
outcomeId: `bybit_${p.symbol}_${p.side}`,
|
|
775
|
+
side: isLong ? 'LONG' : 'SHORT',
|
|
776
|
+
shares: p.size,
|
|
777
|
+
avgPrice: p.entryPrice,
|
|
778
|
+
currentPrice: p.markPrice,
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
else if (platform === 'mexc') {
|
|
784
|
+
const creds = await credentials.getCredentials(userId, 'mexc');
|
|
785
|
+
if (creds) {
|
|
786
|
+
const mx = await Promise.resolve().then(() => __importStar(require('../exchanges/mexc/index')));
|
|
787
|
+
const rawPositions = await mx.getPositions(creds);
|
|
788
|
+
positions = rawPositions
|
|
789
|
+
.filter((p) => p.holdVol !== 0)
|
|
790
|
+
.map((p) => {
|
|
791
|
+
const isLong = p.positionType === 1;
|
|
792
|
+
return buildPosition({
|
|
793
|
+
platform: 'mexc',
|
|
794
|
+
marketId: p.symbol,
|
|
795
|
+
marketQuestion: `${p.symbol} Perp`,
|
|
796
|
+
outcome: isLong ? 'Long' : 'Short',
|
|
797
|
+
outcomeId: `mexc_${p.symbol}_${isLong ? 'long' : 'short'}`,
|
|
798
|
+
side: isLong ? 'LONG' : 'SHORT',
|
|
799
|
+
shares: p.holdVol,
|
|
800
|
+
avgPrice: p.openAvgPrice,
|
|
801
|
+
currentPrice: p.markPrice,
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
if (!positions)
|
|
807
|
+
continue;
|
|
808
|
+
const existing = deps.db.getPositions(userId).filter((p) => p.platform === platform);
|
|
809
|
+
const currentIds = new Set(positions.map((p) => p.outcomeId));
|
|
810
|
+
for (const position of positions) {
|
|
811
|
+
deps.db.upsertPosition(userId, position);
|
|
812
|
+
}
|
|
813
|
+
for (const position of existing) {
|
|
814
|
+
if (!currentIds.has(position.outcomeId)) {
|
|
815
|
+
deps.db.deletePosition(position.id);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
logger_1.logger.info({ userId, platform, positions: positions.length, removed: Math.max(0, existing.length - currentIds.size) }, 'Portfolio sync complete');
|
|
819
|
+
}
|
|
820
|
+
catch (error) {
|
|
821
|
+
logger_1.logger.warn({ error, userId, platform }, 'Portfolio sync failed');
|
|
822
|
+
await credentials.markFailure(userId, platform);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
// Create portfolio snapshot after syncing all platforms for this user
|
|
826
|
+
try {
|
|
827
|
+
const allPositions = deps.db.getPositions(userId);
|
|
828
|
+
if (allPositions.length > 0) {
|
|
829
|
+
const totalValue = allPositions.reduce((sum, p) => sum + p.value, 0);
|
|
830
|
+
const totalCostBasis = allPositions.reduce((sum, p) => sum + (p.shares * p.avgPrice), 0);
|
|
831
|
+
const totalPnl = totalValue - totalCostBasis;
|
|
832
|
+
const totalPnlPct = totalCostBasis > 0 ? (totalPnl / totalCostBasis) * 100 : 0;
|
|
833
|
+
const byPlatform = {};
|
|
834
|
+
for (const p of allPositions) {
|
|
835
|
+
const entry = byPlatform[p.platform] || { value: 0, pnl: 0 };
|
|
836
|
+
entry.value += p.value;
|
|
837
|
+
entry.pnl += p.value - (p.shares * p.avgPrice);
|
|
838
|
+
byPlatform[p.platform] = entry;
|
|
839
|
+
}
|
|
840
|
+
deps.db.createPortfolioSnapshot({
|
|
841
|
+
userId,
|
|
842
|
+
totalValue,
|
|
843
|
+
totalPnl,
|
|
844
|
+
totalPnlPct,
|
|
845
|
+
totalCostBasis,
|
|
846
|
+
positionsCount: allPositions.length,
|
|
847
|
+
byPlatform,
|
|
848
|
+
});
|
|
849
|
+
logger_1.logger.debug({ userId, totalValue, positionsCount: allPositions.length }, 'Portfolio snapshot created');
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
catch (error) {
|
|
853
|
+
logger_1.logger.warn({ error, userId }, 'Failed to create portfolio snapshot');
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
// Clean up old snapshots (>90 days)
|
|
857
|
+
try {
|
|
858
|
+
const cutoffMs = Date.now() - 90 * 24 * 60 * 60 * 1000;
|
|
859
|
+
deps.db.deletePortfolioSnapshotsBefore(cutoffMs);
|
|
860
|
+
}
|
|
861
|
+
catch (error) {
|
|
862
|
+
logger_1.logger.warn({ error }, 'Failed to clean up old portfolio snapshots');
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function normalizeStopLossPct(value) {
|
|
866
|
+
if (value === undefined || value === null)
|
|
867
|
+
return null;
|
|
868
|
+
if (!Number.isFinite(value))
|
|
869
|
+
return null;
|
|
870
|
+
if (value <= 0)
|
|
871
|
+
return null;
|
|
872
|
+
return value > 1 ? value / 100 : value;
|
|
873
|
+
}
|
|
874
|
+
async function executeStopLoss(user, position) {
|
|
875
|
+
if (!deps.credentials) {
|
|
876
|
+
return { status: 'skipped', error: 'Credentials manager not configured' };
|
|
877
|
+
}
|
|
878
|
+
if (!Number.isFinite(position.shares) || position.shares <= 0) {
|
|
879
|
+
return { status: 'skipped', error: 'No position size' };
|
|
880
|
+
}
|
|
881
|
+
const dryRun = deps.config?.trading?.dryRun !== false;
|
|
882
|
+
if (dryRun) {
|
|
883
|
+
return { status: 'dry-run' };
|
|
884
|
+
}
|
|
885
|
+
const platform = position.platform;
|
|
886
|
+
if (platform === 'polymarket') {
|
|
887
|
+
const creds = await deps.credentials.getCredentials(user.id, 'polymarket');
|
|
888
|
+
if (!creds)
|
|
889
|
+
return { status: 'skipped', error: 'Missing Polymarket credentials' };
|
|
890
|
+
const tradingDir = (0, path_1.join)(__dirname, '..', '..', 'trading');
|
|
891
|
+
const tokenId = position.outcomeId;
|
|
892
|
+
const size = position.shares;
|
|
893
|
+
const cmd = `cd ${tradingDir} && python3 polymarket.py market_sell ${tokenId} ${size}`;
|
|
894
|
+
try {
|
|
895
|
+
const output = (0, child_process_1.execSync)(cmd, { timeout: 30000, encoding: 'utf-8', env: buildPolymarketEnv(creds) });
|
|
896
|
+
await deps.credentials.markSuccess(user.id, 'polymarket');
|
|
897
|
+
return { status: 'executed', output: output.trim() };
|
|
898
|
+
}
|
|
899
|
+
catch (err) {
|
|
900
|
+
const error = err;
|
|
901
|
+
await deps.credentials.markFailure(user.id, 'polymarket');
|
|
902
|
+
return { status: 'failed', error: error.stderr || error.message };
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (platform === 'kalshi') {
|
|
906
|
+
const creds = await deps.credentials.getCredentials(user.id, 'kalshi');
|
|
907
|
+
if (!creds)
|
|
908
|
+
return { status: 'skipped', error: 'Missing Kalshi credentials' };
|
|
909
|
+
const tradingDir = (0, path_1.join)(__dirname, '..', '..', 'trading');
|
|
910
|
+
const ticker = position.marketId;
|
|
911
|
+
const side = position.side.toLowerCase();
|
|
912
|
+
const count = Math.round(position.shares);
|
|
913
|
+
const cmd = `cd ${tradingDir} && python3 kalshi.py market_order ${ticker} ${side} sell ${count}`;
|
|
914
|
+
try {
|
|
915
|
+
const output = (0, child_process_1.execSync)(cmd, { timeout: 30000, encoding: 'utf-8', env: buildKalshiEnv(creds) });
|
|
916
|
+
await deps.credentials.markSuccess(user.id, 'kalshi');
|
|
917
|
+
return { status: 'executed', output: output.trim() };
|
|
918
|
+
}
|
|
919
|
+
catch (err) {
|
|
920
|
+
const error = err;
|
|
921
|
+
await deps.credentials.markFailure(user.id, 'kalshi');
|
|
922
|
+
return { status: 'failed', error: error.stderr || error.message };
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
if (platform === 'manifold') {
|
|
926
|
+
const creds = await deps.credentials.getCredentials(user.id, 'manifold');
|
|
927
|
+
if (!creds)
|
|
928
|
+
return { status: 'skipped', error: 'Missing Manifold credentials' };
|
|
929
|
+
const apiKey = creds.apiKey;
|
|
930
|
+
const body = {
|
|
931
|
+
contractId: position.marketId,
|
|
932
|
+
outcome: position.side,
|
|
933
|
+
shares: position.shares,
|
|
934
|
+
};
|
|
935
|
+
try {
|
|
936
|
+
const response = await fetch(`https://api.manifold.markets/v0/market/${position.marketId}/sell`, {
|
|
937
|
+
method: 'POST',
|
|
938
|
+
headers: {
|
|
939
|
+
'Content-Type': 'application/json',
|
|
940
|
+
'Authorization': `Key ${apiKey}`,
|
|
941
|
+
},
|
|
942
|
+
body: JSON.stringify(body),
|
|
943
|
+
});
|
|
944
|
+
if (!response.ok) {
|
|
945
|
+
const errorText = await response.text();
|
|
946
|
+
await deps.credentials.markFailure(user.id, 'manifold');
|
|
947
|
+
return { status: 'failed', error: errorText };
|
|
948
|
+
}
|
|
949
|
+
await deps.credentials.markSuccess(user.id, 'manifold');
|
|
950
|
+
const result = await response.json();
|
|
951
|
+
return { status: 'executed', output: JSON.stringify(result) };
|
|
952
|
+
}
|
|
953
|
+
catch (err) {
|
|
954
|
+
const error = err;
|
|
955
|
+
await deps.credentials.markFailure(user.id, 'manifold');
|
|
956
|
+
return { status: 'failed', error: error.message };
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return { status: 'skipped', error: `Unsupported platform: ${platform}` };
|
|
960
|
+
}
|
|
961
|
+
async function scanStopLosses() {
|
|
962
|
+
const users = deps.db.listUsers();
|
|
963
|
+
if (users.length === 0)
|
|
964
|
+
return;
|
|
965
|
+
const cooldownMs = deps.config?.trading?.stopLossCooldownMs ?? 10 * 60 * 1000;
|
|
966
|
+
const now = Date.now();
|
|
967
|
+
for (const user of users) {
|
|
968
|
+
const stopLossPct = normalizeStopLossPct(user.settings.stopLossPct);
|
|
969
|
+
if (!stopLossPct)
|
|
970
|
+
continue;
|
|
971
|
+
const positions = deps.db.getPositions(user.id);
|
|
972
|
+
if (positions.length === 0)
|
|
973
|
+
continue;
|
|
974
|
+
for (const position of positions) {
|
|
975
|
+
if (!position.avgPrice || !position.currentPrice)
|
|
976
|
+
continue;
|
|
977
|
+
const threshold = position.avgPrice * (1 - stopLossPct);
|
|
978
|
+
if (position.currentPrice > threshold)
|
|
979
|
+
continue;
|
|
980
|
+
const existing = deps.db.getStopLossTrigger(user.id, position.platform, position.outcomeId);
|
|
981
|
+
if (existing?.cooldownUntil && existing.cooldownUntil.getTime() > now) {
|
|
982
|
+
continue;
|
|
983
|
+
}
|
|
984
|
+
const result = await executeStopLoss(user, position);
|
|
985
|
+
const cooldownUntil = new Date(now + cooldownMs);
|
|
986
|
+
deps.db.upsertStopLossTrigger({
|
|
987
|
+
userId: user.id,
|
|
988
|
+
platform: position.platform,
|
|
989
|
+
outcomeId: position.outcomeId,
|
|
990
|
+
marketId: position.marketId,
|
|
991
|
+
status: result.status,
|
|
992
|
+
triggeredAt: new Date(now),
|
|
993
|
+
lastPrice: position.currentPrice,
|
|
994
|
+
lastError: result.error,
|
|
995
|
+
cooldownUntil,
|
|
996
|
+
});
|
|
997
|
+
const target = resolveAlertRecipient(user.id);
|
|
998
|
+
if (target) {
|
|
999
|
+
const lines = [
|
|
1000
|
+
'🛑 Stop-loss triggered',
|
|
1001
|
+
`${position.marketQuestion || position.marketId} (${position.platform})`,
|
|
1002
|
+
`Side: ${position.side}`,
|
|
1003
|
+
`Price: ${position.currentPrice.toFixed(4)} (avg ${position.avgPrice.toFixed(4)})`,
|
|
1004
|
+
`Threshold: ${threshold.toFixed(4)} (${Math.round(stopLossPct * 100)}%)`,
|
|
1005
|
+
result.status === 'executed' ? `Sold ${position.shares} shares.` : `Status: ${result.status}`,
|
|
1006
|
+
];
|
|
1007
|
+
if (result.error) {
|
|
1008
|
+
lines.push(`Error: ${result.error}`);
|
|
1009
|
+
}
|
|
1010
|
+
if (result.status === 'dry-run') {
|
|
1011
|
+
lines.push('Dry run enabled - no trade executed.');
|
|
1012
|
+
}
|
|
1013
|
+
await deps.sendMessage({
|
|
1014
|
+
platform: target.platform,
|
|
1015
|
+
chatId: target.chatId,
|
|
1016
|
+
text: lines.join('\n'),
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
/** Schedule a job's next execution */
|
|
1023
|
+
function scheduleJob(job) {
|
|
1024
|
+
// Clear existing timer
|
|
1025
|
+
const existing = timers.get(job.id);
|
|
1026
|
+
if (existing) {
|
|
1027
|
+
clearTimeout(existing);
|
|
1028
|
+
timers.delete(job.id);
|
|
1029
|
+
}
|
|
1030
|
+
if (!job.enabled || !running)
|
|
1031
|
+
return;
|
|
1032
|
+
const nextRun = calculateNextRun(job.schedule, job.state.lastRunAtMs);
|
|
1033
|
+
if (nextRun < 0) {
|
|
1034
|
+
if (job.deleteAfterRun) {
|
|
1035
|
+
jobs.delete(job.id);
|
|
1036
|
+
}
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
job.state.nextRunAtMs = nextRun;
|
|
1040
|
+
const delay = Math.max(0, nextRun - Date.now());
|
|
1041
|
+
const timer = setTimeout(async () => {
|
|
1042
|
+
timers.delete(job.id);
|
|
1043
|
+
await executeJobInternal(job);
|
|
1044
|
+
}, delay);
|
|
1045
|
+
timers.set(job.id, timer);
|
|
1046
|
+
emitter.emit('event', { type: 'job:scheduled', job });
|
|
1047
|
+
logger_1.logger.debug({ jobId: job.id, name: job.name, nextRun: new Date(nextRun) }, 'Job scheduled');
|
|
1048
|
+
persistJob(job);
|
|
1049
|
+
}
|
|
1050
|
+
/** Execute a job */
|
|
1051
|
+
async function executeJobInternal(job) {
|
|
1052
|
+
if (!job.enabled) {
|
|
1053
|
+
emitter.emit('event', { type: 'job:skipped', job, reason: 'disabled' });
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
job.state.runningAtMs = Date.now();
|
|
1057
|
+
emitter.emit('event', { type: 'job:started', job });
|
|
1058
|
+
logger_1.logger.info({ jobId: job.id, name: job.name }, 'Running cron job');
|
|
1059
|
+
const startTime = Date.now();
|
|
1060
|
+
try {
|
|
1061
|
+
await executeJob(job);
|
|
1062
|
+
const durationMs = Date.now() - startTime;
|
|
1063
|
+
job.state.lastRunAtMs = startTime;
|
|
1064
|
+
job.state.lastStatus = 'ok';
|
|
1065
|
+
job.state.lastDurationMs = durationMs;
|
|
1066
|
+
job.state.lastError = undefined;
|
|
1067
|
+
job.state.runningAtMs = undefined;
|
|
1068
|
+
emitter.emit('event', { type: 'job:completed', job, durationMs });
|
|
1069
|
+
logger_1.logger.info({ jobId: job.id, name: job.name, durationMs }, 'Cron job completed');
|
|
1070
|
+
persistJob(job);
|
|
1071
|
+
if (job.deleteAfterRun && job.schedule.kind === 'at') {
|
|
1072
|
+
jobs.delete(job.id);
|
|
1073
|
+
}
|
|
1074
|
+
else {
|
|
1075
|
+
scheduleJob(job);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
catch (error) {
|
|
1079
|
+
const durationMs = Date.now() - startTime;
|
|
1080
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
1081
|
+
job.state.lastRunAtMs = startTime;
|
|
1082
|
+
job.state.lastStatus = 'error';
|
|
1083
|
+
job.state.lastError = errorMsg;
|
|
1084
|
+
job.state.lastDurationMs = durationMs;
|
|
1085
|
+
job.state.runningAtMs = undefined;
|
|
1086
|
+
emitter.emit('event', { type: 'job:failed', job, error: errorMsg });
|
|
1087
|
+
logger_1.logger.error({ jobId: job.id, name: job.name, error: errorMsg }, 'Cron job failed');
|
|
1088
|
+
persistJob(job);
|
|
1089
|
+
if (job.schedule.kind !== 'at') {
|
|
1090
|
+
scheduleJob(job);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
// =========================================================================
|
|
1095
|
+
// PUBLIC API
|
|
1096
|
+
// =========================================================================
|
|
1097
|
+
emitter.start = async () => {
|
|
1098
|
+
if (running)
|
|
1099
|
+
return;
|
|
1100
|
+
running = true;
|
|
1101
|
+
logger_1.logger.info('Starting cron service');
|
|
1102
|
+
const cronConfig = deps.config?.cron ?? {};
|
|
1103
|
+
if (cronConfig.enabled === false) {
|
|
1104
|
+
logger_1.logger.info('Cron service disabled by configuration');
|
|
1105
|
+
running = false;
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
const alertScanIntervalMs = cronConfig.alertScanIntervalMs ?? 30000;
|
|
1109
|
+
const digestIntervalMs = cronConfig.digestIntervalMs ?? 5 * 60 * 1000;
|
|
1110
|
+
const portfolioSyncIntervalMs = cronConfig.portfolioSyncIntervalMs ?? 60 * 60 * 1000;
|
|
1111
|
+
const stopLossIntervalMs = cronConfig.stopLossIntervalMs ?? 2 * 60 * 1000;
|
|
1112
|
+
if (jobs.size === 0) {
|
|
1113
|
+
loadPersistedJobs();
|
|
1114
|
+
}
|
|
1115
|
+
// Add default alert scan job if none exists
|
|
1116
|
+
if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'alertScan')) {
|
|
1117
|
+
emitter.add({
|
|
1118
|
+
name: 'Alert Scanner',
|
|
1119
|
+
description: 'Check all price alerts every 30 seconds',
|
|
1120
|
+
enabled: true,
|
|
1121
|
+
schedule: { kind: 'every', everyMs: alertScanIntervalMs },
|
|
1122
|
+
sessionTarget: 'main',
|
|
1123
|
+
wakeMode: 'now',
|
|
1124
|
+
payload: { kind: 'alertScan' },
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'portfolioSync')) {
|
|
1128
|
+
emitter.add({
|
|
1129
|
+
name: 'Portfolio Sync',
|
|
1130
|
+
description: 'Sync portfolio positions from linked trading accounts',
|
|
1131
|
+
enabled: true,
|
|
1132
|
+
schedule: { kind: 'every', everyMs: portfolioSyncIntervalMs },
|
|
1133
|
+
sessionTarget: 'main',
|
|
1134
|
+
wakeMode: 'now',
|
|
1135
|
+
payload: { kind: 'portfolioSync' },
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'dailyDigest')) {
|
|
1139
|
+
emitter.add({
|
|
1140
|
+
name: 'Daily Digest',
|
|
1141
|
+
description: 'Send daily digest messages to users who enabled it',
|
|
1142
|
+
enabled: true,
|
|
1143
|
+
schedule: { kind: 'every', everyMs: digestIntervalMs },
|
|
1144
|
+
sessionTarget: 'main',
|
|
1145
|
+
wakeMode: 'now',
|
|
1146
|
+
payload: { kind: 'dailyDigest' },
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
if (stopLossIntervalMs > 0 &&
|
|
1150
|
+
!Array.from(jobs.values()).some((j) => j.payload.kind === 'stopLossScan')) {
|
|
1151
|
+
emitter.add({
|
|
1152
|
+
name: 'Stop-Loss Scanner',
|
|
1153
|
+
description: 'Monitor positions and execute stop-loss orders',
|
|
1154
|
+
enabled: true,
|
|
1155
|
+
schedule: { kind: 'every', everyMs: stopLossIntervalMs },
|
|
1156
|
+
sessionTarget: 'main',
|
|
1157
|
+
wakeMode: 'now',
|
|
1158
|
+
payload: { kind: 'stopLossScan' },
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
// Schedule all enabled jobs
|
|
1162
|
+
for (const job of jobs.values()) {
|
|
1163
|
+
scheduleJob(job);
|
|
1164
|
+
}
|
|
1165
|
+
// Tick every minute to catch any drift
|
|
1166
|
+
tickInterval = setInterval(() => {
|
|
1167
|
+
const now = Date.now();
|
|
1168
|
+
for (const job of jobs.values()) {
|
|
1169
|
+
if (job.enabled && job.state.nextRunAtMs && job.state.nextRunAtMs <= now && !job.state.runningAtMs) {
|
|
1170
|
+
scheduleJob(job);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}, 60000);
|
|
1174
|
+
logger_1.logger.info('Cron service started');
|
|
1175
|
+
};
|
|
1176
|
+
emitter.stop = () => {
|
|
1177
|
+
if (!running)
|
|
1178
|
+
return;
|
|
1179
|
+
running = false;
|
|
1180
|
+
for (const timer of timers.values()) {
|
|
1181
|
+
clearTimeout(timer);
|
|
1182
|
+
}
|
|
1183
|
+
timers.clear();
|
|
1184
|
+
if (tickInterval) {
|
|
1185
|
+
clearInterval(tickInterval);
|
|
1186
|
+
tickInterval = null;
|
|
1187
|
+
}
|
|
1188
|
+
logger_1.logger.info('Cron service stopped');
|
|
1189
|
+
};
|
|
1190
|
+
emitter.status = () => {
|
|
1191
|
+
let nextJobAt;
|
|
1192
|
+
for (const job of jobs.values()) {
|
|
1193
|
+
if (job.enabled && job.state.nextRunAtMs) {
|
|
1194
|
+
if (!nextJobAt || job.state.nextRunAtMs < nextJobAt) {
|
|
1195
|
+
nextJobAt = job.state.nextRunAtMs;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
return { running, jobCount: jobs.size, nextJobAt };
|
|
1200
|
+
};
|
|
1201
|
+
emitter.list = (opts) => {
|
|
1202
|
+
const all = Array.from(jobs.values());
|
|
1203
|
+
return opts?.includeDisabled ? all : all.filter((j) => j.enabled);
|
|
1204
|
+
};
|
|
1205
|
+
emitter.get = (id) => jobs.get(id);
|
|
1206
|
+
emitter.add = (input) => {
|
|
1207
|
+
const now = Date.now();
|
|
1208
|
+
const job = {
|
|
1209
|
+
id: generateId(),
|
|
1210
|
+
...input,
|
|
1211
|
+
createdAtMs: now,
|
|
1212
|
+
updatedAtMs: now,
|
|
1213
|
+
state: input.state || {},
|
|
1214
|
+
};
|
|
1215
|
+
jobs.set(job.id, job);
|
|
1216
|
+
logger_1.logger.info({ jobId: job.id, name: job.name }, 'Cron job added');
|
|
1217
|
+
if (running && job.enabled) {
|
|
1218
|
+
scheduleJob(job);
|
|
1219
|
+
}
|
|
1220
|
+
persistJob(job);
|
|
1221
|
+
return job;
|
|
1222
|
+
};
|
|
1223
|
+
emitter.update = (id, patch) => {
|
|
1224
|
+
const job = jobs.get(id);
|
|
1225
|
+
if (!job)
|
|
1226
|
+
return null;
|
|
1227
|
+
const updated = {
|
|
1228
|
+
...job,
|
|
1229
|
+
...patch,
|
|
1230
|
+
id: job.id,
|
|
1231
|
+
createdAtMs: job.createdAtMs,
|
|
1232
|
+
updatedAtMs: Date.now(),
|
|
1233
|
+
state: { ...job.state, ...patch.state },
|
|
1234
|
+
};
|
|
1235
|
+
jobs.set(id, updated);
|
|
1236
|
+
logger_1.logger.info({ jobId: id, name: updated.name }, 'Cron job updated');
|
|
1237
|
+
if (running) {
|
|
1238
|
+
scheduleJob(updated);
|
|
1239
|
+
}
|
|
1240
|
+
persistJob(updated);
|
|
1241
|
+
return updated;
|
|
1242
|
+
};
|
|
1243
|
+
emitter.remove = (id) => {
|
|
1244
|
+
const job = jobs.get(id);
|
|
1245
|
+
if (!job)
|
|
1246
|
+
return false;
|
|
1247
|
+
const timer = timers.get(id);
|
|
1248
|
+
if (timer) {
|
|
1249
|
+
clearTimeout(timer);
|
|
1250
|
+
timers.delete(id);
|
|
1251
|
+
}
|
|
1252
|
+
jobs.delete(id);
|
|
1253
|
+
deps.db.deleteCronJob(id);
|
|
1254
|
+
logger_1.logger.info({ jobId: id, name: job.name }, 'Cron job removed');
|
|
1255
|
+
return true;
|
|
1256
|
+
};
|
|
1257
|
+
emitter.run = async (id, mode = 'due') => {
|
|
1258
|
+
const job = jobs.get(id);
|
|
1259
|
+
if (!job)
|
|
1260
|
+
return false;
|
|
1261
|
+
if (mode === 'due') {
|
|
1262
|
+
const nextRun = calculateNextRun(job.schedule, job.state.lastRunAtMs);
|
|
1263
|
+
if (nextRun > Date.now()) {
|
|
1264
|
+
return false;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
await executeJobInternal(job);
|
|
1268
|
+
return true;
|
|
1269
|
+
};
|
|
1270
|
+
return emitter;
|
|
1271
|
+
}
|
|
1272
|
+
function createCronManager(db, feeds, sendMessage) {
|
|
1273
|
+
const service = createCronService({ db, feeds, sendMessage });
|
|
1274
|
+
return {
|
|
1275
|
+
start() {
|
|
1276
|
+
service.start();
|
|
1277
|
+
},
|
|
1278
|
+
stop() {
|
|
1279
|
+
service.stop();
|
|
1280
|
+
},
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
//# sourceMappingURL=index.js.map
|