agenttwin 0.3.21 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +2113 -609
- package/dist/dashboard/assets/dashboard/agent-home.css +7 -7
- package/dist/dashboard/assets/dashboard/bay-morning.webp +0 -0
- package/dist/dashboard/assets/dashboard/golden-gate-afternoon.webp +0 -0
- package/dist/dashboard/assets/dashboard/golden-gate-portrait.webp +0 -0
- package/dist/dashboard/assets/dashboard/moonlit-coast.webp +0 -0
- package/dist/dashboard/assets/next/static/chunks/5663-403316746afad10e.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/{page-9c11295678539a5f.js → page-0e0392368e0a891e.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-4981ea4966b19e3e.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-dd4ac0f5f36e6bfa.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/{page-34574448d210c775.js → page-de0fe6d84be21e6a.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-360cbffc57981f6b.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/{page-07c8054d57c9089b.js → page-3e86fffabfa87d88.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{webpack-40324749d289e4a5.js → webpack-be6e526fd530c797.js} +1 -1
- package/dist/dashboard/assets/next/static/css/{42045de5f39b50ca.css → 37d81e1d2804cc5f.css} +1 -1
- package/dist/dashboard/assets/next/static/css/69ec1bae997c3bb0.css +1 -0
- package/dist/dashboard/assets/next/static/css/ad85402a1595e56e.css +1 -0
- package/dist/dashboard/assets/next/static/css/{4bbe78c2fe206b92.css → da981fb878a02b8c.css} +1 -1
- package/dist/dashboard/assets/next/static/media/bay-morning.82669113.webp +0 -0
- package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.0aa49492.webp +0 -0
- package/dist/dashboard/assets/next/static/media/golden-gate-portrait.89fc667a.webp +0 -0
- package/dist/dashboard/assets/next/static/media/moonlit-coast.09739ef4.webp +0 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/engine.js +6385 -4973
- package/dist/gateway.js +2194 -604
- package/dist/twins/catalog.json +6020 -0
- package/dist/twins/engine/v2/THIRD-PARTY.txt +25 -0
- package/dist/twins/engine/v2/chunks/2CHBP57N.mjs +8 -0
- package/dist/twins/engine/v2/chunks/4CPL6MPF.mjs +30 -0
- package/dist/twins/engine/v2/chunks/OYLYKZGD.mjs +2 -0
- package/dist/twins/engine/v2/chunks/SQSP35HM.mjs +38 -0
- package/dist/twins/engine/v2/chunks/YSJQQVUM.mjs +2 -0
- package/dist/twins/engine/v2/react-dom_client.mjs +272 -0
- package/dist/twins/engine/v2/react-dom_server.mjs +263 -0
- package/dist/twins/engine/v2/react.mjs +2 -0
- package/dist/twins/engine/v2/react_jsx-runtime.mjs +31 -0
- package/dist/twins/engine/v2/volter_world-core.mjs +195 -0
- package/dist/twins/engine/v2/volter_world-core_app-route.mjs +2 -0
- package/dist/twins/engine/v2/volter_world-core_network-policy.mjs +2 -0
- package/dist/twins/engine/v3/THIRD-PARTY.txt +65 -0
- package/dist/twins/engine/v3/chunks/2CHBP57N.mjs +8 -0
- package/dist/twins/engine/v3/chunks/2YSSPA5O.mjs +65 -0
- package/dist/twins/engine/v3/chunks/5PWRY4UK.mjs +154 -0
- package/dist/twins/engine/v3/chunks/7XRKSFFJ.mjs +2 -0
- package/dist/twins/engine/v3/chunks/AWOWH2H5.mjs +2 -0
- package/dist/twins/engine/v3/chunks/C46M5U3Q.mjs +2 -0
- package/dist/twins/engine/v3/chunks/MFH2VZPP.mjs +2 -0
- package/dist/twins/engine/v3/chunks/MWCO5UV3.mjs +2 -0
- package/dist/twins/engine/v3/chunks/N5BL5RDF.mjs +313 -0
- package/dist/twins/engine/v3/chunks/O7HGPMXG.mjs +2 -0
- package/dist/twins/engine/v3/chunks/OYLYKZGD.mjs +2 -0
- package/dist/twins/engine/v3/chunks/PLB7HTON.mjs +8 -0
- package/dist/twins/engine/v3/chunks/TY4LDBVH.mjs +7 -0
- package/dist/twins/engine/v3/chunks/VDIRUSCM.mjs +2 -0
- package/dist/twins/engine/v3/chunks/WGUCFQK6.mjs +2 -0
- package/dist/twins/engine/v3/chunks/WPATONSC.mjs +2 -0
- package/dist/twins/engine/v3/react_jsx-runtime.mjs +2 -0
- package/dist/twins/engine/v3/volter_world-core.mjs +2 -0
- package/dist/twins/engine/v3/volter_world-ui.mjs +559 -0
- package/dist/twins/packs/ahrefs/LICENSE +202 -0
- package/dist/twins/packs/ahrefs/NOTICE +7 -0
- package/dist/twins/packs/ahrefs/index.mjs +2 -0
- package/dist/twins/packs/ai-gateway/LICENSE +202 -0
- package/dist/twins/packs/ai-gateway/NOTICE +7 -0
- package/dist/twins/packs/ai-gateway/index.mjs +14 -0
- package/dist/twins/packs/airtable/LICENSE +202 -0
- package/dist/twins/packs/airtable/NOTICE +7 -0
- package/dist/twins/packs/airtable/index.mjs +2 -0
- package/dist/twins/packs/algolia/LICENSE +202 -0
- package/dist/twins/packs/algolia/NOTICE +7 -0
- package/dist/twins/packs/algolia/index.mjs +2 -0
- package/dist/twins/packs/ambientcg/LICENSE +202 -0
- package/dist/twins/packs/ambientcg/NOTICE +7 -0
- package/dist/twins/packs/ambientcg/index.mjs +2 -0
- package/dist/twins/packs/anthropic/LICENSE +202 -0
- package/dist/twins/packs/anthropic/NOTICE +7 -0
- package/dist/twins/packs/anthropic/index.mjs +18 -0
- package/dist/twins/packs/assemblyai/LICENSE +202 -0
- package/dist/twins/packs/assemblyai/NOTICE +7 -0
- package/dist/twins/packs/assemblyai/index.mjs +11 -0
- package/dist/twins/packs/aws/LICENSE +202 -0
- package/dist/twins/packs/aws/NOTICE +7 -0
- package/dist/twins/packs/aws/index.mjs +2 -0
- package/dist/twins/packs/azure/LICENSE +202 -0
- package/dist/twins/packs/azure/NOTICE +7 -0
- package/dist/twins/packs/azure/index.mjs +38 -0
- package/dist/twins/packs/azureformrecognizer/LICENSE +202 -0
- package/dist/twins/packs/azureformrecognizer/NOTICE +7 -0
- package/dist/twins/packs/azureformrecognizer/index.mjs +3 -0
- package/dist/twins/packs/bitly/LICENSE +202 -0
- package/dist/twins/packs/bitly/NOTICE +7 -0
- package/dist/twins/packs/bitly/index.mjs +2 -0
- package/dist/twins/packs/bluesky/LICENSE +202 -0
- package/dist/twins/packs/bluesky/NOTICE +7 -0
- package/dist/twins/packs/bluesky/index.mjs +30 -0
- package/dist/twins/packs/calcom/LICENSE +202 -0
- package/dist/twins/packs/calcom/NOTICE +7 -0
- package/dist/twins/packs/calcom/index.mjs +2 -0
- package/dist/twins/packs/clerk/LICENSE +202 -0
- package/dist/twins/packs/clerk/NOTICE +7 -0
- package/dist/twins/packs/clerk/index.mjs +5 -0
- package/dist/twins/packs/cloudflare/LICENSE +202 -0
- package/dist/twins/packs/cloudflare/NOTICE +7 -0
- package/dist/twins/packs/cloudflare/index.mjs +79 -0
- package/dist/twins/packs/cohere/LICENSE +202 -0
- package/dist/twins/packs/cohere/NOTICE +7 -0
- package/dist/twins/packs/cohere/index.mjs +2 -0
- package/dist/twins/packs/datadog/LICENSE +202 -0
- package/dist/twins/packs/datadog/NOTICE +7 -0
- package/dist/twins/packs/datadog/index.mjs +3 -0
- package/dist/twins/packs/deepinfra/LICENSE +202 -0
- package/dist/twins/packs/deepinfra/NOTICE +7 -0
- package/dist/twins/packs/deepinfra/index.mjs +13 -0
- package/dist/twins/packs/deepseek/LICENSE +202 -0
- package/dist/twins/packs/deepseek/NOTICE +7 -0
- package/dist/twins/packs/deepseek/index.mjs +12 -0
- package/dist/twins/packs/discord/LICENSE +202 -0
- package/dist/twins/packs/discord/NOTICE +7 -0
- package/dist/twins/packs/discord/index.mjs +2 -0
- package/dist/twins/packs/duckduckgo/LICENSE +202 -0
- package/dist/twins/packs/duckduckgo/NOTICE +7 -0
- package/dist/twins/packs/duckduckgo/index.mjs +532 -0
- package/dist/twins/packs/dynadot/LICENSE +202 -0
- package/dist/twins/packs/dynadot/NOTICE +7 -0
- package/dist/twins/packs/dynadot/index.mjs +2 -0
- package/dist/twins/packs/e2b/LICENSE +202 -0
- package/dist/twins/packs/e2b/NOTICE +7 -0
- package/dist/twins/packs/e2b/index.mjs +2 -0
- package/dist/twins/packs/elevenlabs/LICENSE +202 -0
- package/dist/twins/packs/elevenlabs/NOTICE +7 -0
- package/dist/twins/packs/elevenlabs/index.mjs +4 -0
- package/dist/twins/packs/expo/LICENSE +202 -0
- package/dist/twins/packs/expo/NOTICE +7 -0
- package/dist/twins/packs/expo/index.mjs +2 -0
- package/dist/twins/packs/fal/LICENSE +202 -0
- package/dist/twins/packs/fal/NOTICE +7 -0
- package/dist/twins/packs/fal/index.mjs +2 -0
- package/dist/twins/packs/figma/LICENSE +202 -0
- package/dist/twins/packs/figma/NOTICE +7 -0
- package/dist/twins/packs/figma/index.mjs +2 -0
- package/dist/twins/packs/firecrawl/LICENSE +202 -0
- package/dist/twins/packs/firecrawl/NOTICE +7 -0
- package/dist/twins/packs/firecrawl/index.mjs +9 -0
- package/dist/twins/packs/fireworks/LICENSE +202 -0
- package/dist/twins/packs/fireworks/NOTICE +7 -0
- package/dist/twins/packs/fireworks/index.mjs +13 -0
- package/dist/twins/packs/fly/LICENSE +202 -0
- package/dist/twins/packs/fly/NOTICE +7 -0
- package/dist/twins/packs/fly/index.mjs +2 -0
- package/dist/twins/packs/gcs/LICENSE +202 -0
- package/dist/twins/packs/gcs/NOTICE +7 -0
- package/dist/twins/packs/gcs/index.mjs +8 -0
- package/dist/twins/packs/gemini/LICENSE +202 -0
- package/dist/twins/packs/gemini/NOTICE +7 -0
- package/dist/twins/packs/gemini/index.mjs +7 -0
- package/dist/twins/packs/github/LICENSE +202 -0
- package/dist/twins/packs/github/NOTICE +7 -0
- package/dist/twins/packs/github/index.mjs +75153 -0
- package/dist/twins/packs/googleads/LICENSE +202 -0
- package/dist/twins/packs/googleads/NOTICE +7 -0
- package/dist/twins/packs/googleads/index.mjs +3 -0
- package/dist/twins/packs/googlemaps/LICENSE +202 -0
- package/dist/twins/packs/googlemaps/NOTICE +7 -0
- package/dist/twins/packs/googlemaps/index.mjs +2 -0
- package/dist/twins/packs/googleoauth/LICENSE +202 -0
- package/dist/twins/packs/googleoauth/NOTICE +7 -0
- package/dist/twins/packs/googleoauth/index.mjs +2 -0
- package/dist/twins/packs/hackernews/LICENSE +202 -0
- package/dist/twins/packs/hackernews/NOTICE +7 -0
- package/dist/twins/packs/hackernews/index.mjs +35 -0
- package/dist/twins/packs/huggingface/LICENSE +202 -0
- package/dist/twins/packs/huggingface/NOTICE +7 -0
- package/dist/twins/packs/huggingface/index.mjs +9 -0
- package/dist/twins/packs/inngest/LICENSE +202 -0
- package/dist/twins/packs/inngest/NOTICE +7 -0
- package/dist/twins/packs/inngest/index.mjs +2 -0
- package/dist/twins/packs/instagram/LICENSE +202 -0
- package/dist/twins/packs/instagram/NOTICE +7 -0
- package/dist/twins/packs/instagram/index.mjs +2 -0
- package/dist/twins/packs/jira/LICENSE +202 -0
- package/dist/twins/packs/jira/NOTICE +7 -0
- package/dist/twins/packs/jira/index.mjs +2 -0
- package/dist/twins/packs/langfuse/LICENSE +202 -0
- package/dist/twins/packs/langfuse/NOTICE +7 -0
- package/dist/twins/packs/langfuse/index.mjs +2 -0
- package/dist/twins/packs/linear/LICENSE +202 -0
- package/dist/twins/packs/linear/NOTICE +7 -0
- package/dist/twins/packs/linear/index.mjs +52866 -0
- package/dist/twins/packs/linkedin/LICENSE +202 -0
- package/dist/twins/packs/linkedin/NOTICE +7 -0
- package/dist/twins/packs/linkedin/index.mjs +78 -0
- package/dist/twins/packs/livekit/LICENSE +202 -0
- package/dist/twins/packs/livekit/NOTICE +7 -0
- package/dist/twins/packs/livekit/index.mjs +2 -0
- package/dist/twins/packs/mailgun/LICENSE +202 -0
- package/dist/twins/packs/mailgun/NOTICE +7 -0
- package/dist/twins/packs/mailgun/index.mjs +13 -0
- package/dist/twins/packs/mapbox/LICENSE +202 -0
- package/dist/twins/packs/mapbox/NOTICE +7 -0
- package/dist/twins/packs/mapbox/index.mjs +2 -0
- package/dist/twins/packs/merge/LICENSE +202 -0
- package/dist/twins/packs/merge/NOTICE +7 -0
- package/dist/twins/packs/merge/index.mjs +4 -0
- package/dist/twins/packs/mistral/LICENSE +202 -0
- package/dist/twins/packs/mistral/NOTICE +7 -0
- package/dist/twins/packs/mistral/index.mjs +6 -0
- package/dist/twins/packs/mixpanel/LICENSE +202 -0
- package/dist/twins/packs/mixpanel/NOTICE +8 -0
- package/dist/twins/packs/mixpanel/index.mjs +2 -0
- package/dist/twins/packs/mongodb/LICENSE +202 -0
- package/dist/twins/packs/mongodb/NOTICE +7 -0
- package/dist/twins/packs/mongodb/index.mjs +8 -0
- package/dist/twins/packs/moonshot/LICENSE +202 -0
- package/dist/twins/packs/moonshot/NOTICE +7 -0
- package/dist/twins/packs/moonshot/index.mjs +18 -0
- package/dist/twins/packs/notion/LICENSE +202 -0
- package/dist/twins/packs/notion/NOTICE +7 -0
- package/dist/twins/packs/notion/index.mjs +2 -0
- package/dist/twins/packs/npm-registry/LICENSE +202 -0
- package/dist/twins/packs/npm-registry/NOTICE +7 -0
- package/dist/twins/packs/npm-registry/index.mjs +2 -0
- package/dist/twins/packs/oa-treasury/LICENSE +202 -0
- package/dist/twins/packs/oa-treasury/NOTICE +8 -0
- package/dist/twins/packs/oa-treasury/index.mjs +16 -0
- package/dist/twins/packs/openai/LICENSE +202 -0
- package/dist/twins/packs/openai/NOTICE +7 -0
- package/dist/twins/packs/openai/index.mjs +3473 -0
- package/dist/twins/packs/openrouter/LICENSE +202 -0
- package/dist/twins/packs/openrouter/NOTICE +7 -0
- package/dist/twins/packs/openrouter/index.mjs +2 -0
- package/dist/twins/packs/openweather/LICENSE +202 -0
- package/dist/twins/packs/openweather/NOTICE +7 -0
- package/dist/twins/packs/openweather/index.mjs +2 -0
- package/dist/twins/packs/paypal/LICENSE +202 -0
- package/dist/twins/packs/paypal/NOTICE +7 -0
- package/dist/twins/packs/paypal/index.mjs +51 -0
- package/dist/twins/packs/pinecone/LICENSE +202 -0
- package/dist/twins/packs/pinecone/NOTICE +7 -0
- package/dist/twins/packs/pinecone/index.mjs +2 -0
- package/dist/twins/packs/plain/LICENSE +202 -0
- package/dist/twins/packs/plain/NOTICE +8 -0
- package/dist/twins/packs/plain/index.mjs +18426 -0
- package/dist/twins/packs/planetscale/LICENSE +202 -0
- package/dist/twins/packs/planetscale/NOTICE +7 -0
- package/dist/twins/packs/planetscale/index.mjs +18 -0
- package/dist/twins/packs/polar/LICENSE +202 -0
- package/dist/twins/packs/polar/NOTICE +7 -0
- package/dist/twins/packs/polar/index.mjs +2 -0
- package/dist/twins/packs/polyhaven/LICENSE +202 -0
- package/dist/twins/packs/polyhaven/NOTICE +7 -0
- package/dist/twins/packs/polyhaven/index.mjs +3 -0
- package/dist/twins/packs/postmark/LICENSE +202 -0
- package/dist/twins/packs/postmark/NOTICE +7 -0
- package/dist/twins/packs/postmark/index.mjs +12 -0
- package/dist/twins/packs/reddit/LICENSE +202 -0
- package/dist/twins/packs/reddit/NOTICE +7 -0
- package/dist/twins/packs/reddit/index.mjs +324 -0
- package/dist/twins/packs/redis/LICENSE +202 -0
- package/dist/twins/packs/redis/NOTICE +7 -0
- package/dist/twins/packs/redis/index.mjs +2 -0
- package/dist/twins/packs/replicate/LICENSE +202 -0
- package/dist/twins/packs/replicate/NOTICE +7 -0
- package/dist/twins/packs/replicate/index.mjs +2 -0
- package/dist/twins/packs/resend/LICENSE +202 -0
- package/dist/twins/packs/resend/NOTICE +7 -0
- package/dist/twins/packs/resend/index.mjs +139 -0
- package/dist/twins/packs/runhuman/LICENSE +202 -0
- package/dist/twins/packs/runhuman/NOTICE +7 -0
- package/dist/twins/packs/runhuman/index.mjs +3 -0
- package/dist/twins/packs/scrapecreators/LICENSE +202 -0
- package/dist/twins/packs/scrapecreators/NOTICE +7 -0
- package/dist/twins/packs/scrapecreators/index.mjs +2 -0
- package/dist/twins/packs/segment/LICENSE +202 -0
- package/dist/twins/packs/segment/NOTICE +8 -0
- package/dist/twins/packs/segment/index.mjs +2 -0
- package/dist/twins/packs/sendblue/LICENSE +202 -0
- package/dist/twins/packs/sendblue/NOTICE +7 -0
- package/dist/twins/packs/sendblue/index.mjs +2 -0
- package/dist/twins/packs/sendgrid/LICENSE +202 -0
- package/dist/twins/packs/sendgrid/NOTICE +8 -0
- package/dist/twins/packs/sendgrid/index.mjs +4 -0
- package/dist/twins/packs/sentry/LICENSE +202 -0
- package/dist/twins/packs/sentry/NOTICE +7 -0
- package/dist/twins/packs/sentry/index.mjs +5 -0
- package/dist/twins/packs/sigstore/LICENSE +202 -0
- package/dist/twins/packs/sigstore/NOTICE +7 -0
- package/dist/twins/packs/sigstore/index.mjs +12 -0
- package/dist/twins/packs/slack/LICENSE +202 -0
- package/dist/twins/packs/slack/NOTICE +7 -0
- package/dist/twins/packs/slack/index.mjs +66 -0
- package/dist/twins/packs/smtp/LICENSE +202 -0
- package/dist/twins/packs/smtp/NOTICE +7 -0
- package/dist/twins/packs/smtp/index.mjs +3 -0
- package/dist/twins/packs/snowflake/LICENSE +202 -0
- package/dist/twins/packs/snowflake/NOTICE +8 -0
- package/dist/twins/packs/snowflake/index.mjs +30 -0
- package/dist/twins/packs/stigg/LICENSE +202 -0
- package/dist/twins/packs/stigg/NOTICE +8 -0
- package/dist/twins/packs/stigg/index.mjs +22194 -0
- package/dist/twins/packs/stream/LICENSE +202 -0
- package/dist/twins/packs/stream/NOTICE +7 -0
- package/dist/twins/packs/stream/index.mjs +2 -0
- package/dist/twins/packs/stripe/LICENSE +202 -0
- package/dist/twins/packs/stripe/NOTICE +7 -0
- package/dist/twins/packs/stripe/index.mjs +211 -0
- package/dist/twins/packs/supabase/LICENSE +202 -0
- package/dist/twins/packs/supabase/NOTICE +7 -0
- package/dist/twins/packs/supabase/index.mjs +2 -0
- package/dist/twins/packs/supermemory/LICENSE +202 -0
- package/dist/twins/packs/supermemory/NOTICE +7 -0
- package/dist/twins/packs/supermemory/index.mjs +2 -0
- package/dist/twins/packs/svix/LICENSE +202 -0
- package/dist/twins/packs/svix/NOTICE +7 -0
- package/dist/twins/packs/svix/index.mjs +2 -0
- package/dist/twins/packs/tavily/LICENSE +202 -0
- package/dist/twins/packs/tavily/NOTICE +7 -0
- package/dist/twins/packs/tavily/index.mjs +2 -0
- package/dist/twins/packs/telegram/LICENSE +202 -0
- package/dist/twins/packs/telegram/NOTICE +7 -0
- package/dist/twins/packs/telegram/index.mjs +11 -0
- package/dist/twins/packs/temporal/LICENSE +202 -0
- package/dist/twins/packs/temporal/NOTICE +7 -0
- package/dist/twins/packs/temporal/index.mjs +44 -0
- package/dist/twins/packs/tiktok/LICENSE +202 -0
- package/dist/twins/packs/tiktok/NOTICE +7 -0
- package/dist/twins/packs/tiktok/index.mjs +2 -0
- package/dist/twins/packs/tinybird/LICENSE +202 -0
- package/dist/twins/packs/tinybird/NOTICE +7 -0
- package/dist/twins/packs/tinybird/index.mjs +50 -0
- package/dist/twins/packs/togetherai/LICENSE +202 -0
- package/dist/twins/packs/togetherai/NOTICE +7 -0
- package/dist/twins/packs/togetherai/index.mjs +11 -0
- package/dist/twins/packs/tremendous/LICENSE +202 -0
- package/dist/twins/packs/tremendous/NOTICE +7 -0
- package/dist/twins/packs/tremendous/index.mjs +2 -0
- package/dist/twins/packs/tripo/LICENSE +202 -0
- package/dist/twins/packs/tripo/NOTICE +7 -0
- package/dist/twins/packs/tripo/index.mjs +9 -0
- package/dist/twins/packs/tunnel/LICENSE +202 -0
- package/dist/twins/packs/tunnel/NOTICE +7 -0
- package/dist/twins/packs/tunnel/index.mjs +2 -0
- package/dist/twins/packs/twelvelabs/LICENSE +202 -0
- package/dist/twins/packs/twelvelabs/NOTICE +7 -0
- package/dist/twins/packs/twelvelabs/index.mjs +5 -0
- package/dist/twins/packs/twilio/LICENSE +202 -0
- package/dist/twins/packs/twilio/NOTICE +7 -0
- package/dist/twins/packs/twilio/index.mjs +2 -0
- package/dist/twins/packs/twitch/LICENSE +202 -0
- package/dist/twins/packs/twitch/NOTICE +7 -0
- package/dist/twins/packs/twitch/index.mjs +68 -0
- package/dist/twins/packs/upstash/LICENSE +202 -0
- package/dist/twins/packs/upstash/NOTICE +7 -0
- package/dist/twins/packs/upstash/index.mjs +14 -0
- package/dist/twins/packs/upstashvector/LICENSE +202 -0
- package/dist/twins/packs/upstashvector/NOTICE +7 -0
- package/dist/twins/packs/upstashvector/index.mjs +3 -0
- package/dist/twins/packs/vercel/LICENSE +202 -0
- package/dist/twins/packs/vercel/NOTICE +7 -0
- package/dist/twins/packs/vercel/index.mjs +10 -0
- package/dist/twins/packs/veriff/LICENSE +202 -0
- package/dist/twins/packs/veriff/NOTICE +7 -0
- package/dist/twins/packs/veriff/index.mjs +2 -0
- package/dist/twins/packs/vgauth/LICENSE +202 -0
- package/dist/twins/packs/vgauth/NOTICE +7 -0
- package/dist/twins/packs/vgauth/index.mjs +2 -0
- package/dist/twins/packs/vital/LICENSE +202 -0
- package/dist/twins/packs/vital/NOTICE +7 -0
- package/dist/twins/packs/vital/index.mjs +2 -0
- package/dist/twins/packs/volteridentity/LICENSE +202 -0
- package/dist/twins/packs/volteridentity/NOTICE +7 -0
- package/dist/twins/packs/volteridentity/index.mjs +2 -0
- package/dist/twins/packs/webrisk/LICENSE +202 -0
- package/dist/twins/packs/webrisk/NOTICE +7 -0
- package/dist/twins/packs/webrisk/index.mjs +2 -0
- package/dist/twins/packs/worldlabs/LICENSE +202 -0
- package/dist/twins/packs/worldlabs/NOTICE +7 -0
- package/dist/twins/packs/worldlabs/index.mjs +2 -0
- package/dist/twins/packs/x/LICENSE +202 -0
- package/dist/twins/packs/x/NOTICE +7 -0
- package/dist/twins/packs/x/index.mjs +63 -0
- package/dist/twins/packs/xai/LICENSE +202 -0
- package/dist/twins/packs/xai/NOTICE +7 -0
- package/dist/twins/packs/xai/index.mjs +4 -0
- package/dist/twins/packs/xidentity/LICENSE +202 -0
- package/dist/twins/packs/xidentity/NOTICE +8 -0
- package/dist/twins/packs/xidentity/index.mjs +209 -0
- package/dist/twins/packs/youtube/LICENSE +202 -0
- package/dist/twins/packs/youtube/NOTICE +7 -0
- package/dist/twins/packs/youtube/index.mjs +5 -0
- package/dist/worker.js +442 -18
- package/dist/world-host.js +928 -91
- package/package.json +5 -4
- package/dist/dashboard/assets/dashboard/bay-morning.png +0 -0
- package/dist/dashboard/assets/dashboard/golden-gate-afternoon.png +0 -0
- package/dist/dashboard/assets/dashboard/golden-gate-portrait.png +0 -0
- package/dist/dashboard/assets/dashboard/moonlit-coast.png +0 -0
- package/dist/dashboard/assets/next/static/chunks/2868-424d32cfc8ae81c9.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-f9fca2c08f779fa0.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-bc480c9258e5cc4d.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-f04c0b236abaead3.js +0 -1
- package/dist/dashboard/assets/next/static/css/4af3c8ca0da0f48b.css +0 -1
- package/dist/dashboard/assets/next/static/css/6b8edde77e493a51.css +0 -1
- package/dist/dashboard/assets/next/static/media/bay-morning.1a9f358c.png +0 -0
- package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.3e7cea58.png +0 -0
- package/dist/dashboard/assets/next/static/media/golden-gate-portrait.7941528f.png +0 -0
- package/dist/dashboard/assets/next/static/media/moonlit-coast.bbe901a1.png +0 -0
- /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → 8f121VqXS9LLPMmYd1SRn}/_buildManifest.js +0 -0
- /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → 8f121VqXS9LLPMmYd1SRn}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@agenttwin/twin-cohere
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-cohere 1.0.0 by Volter (https://github.com/volter-ai),
|
|
4
|
+
licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
|
|
7
|
+
fetch factory is included; shared modules are imported from the AgentTwin twin engine.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
|
|
2
|
+
var C=Object.defineProperty;var P=(e,t)=>{for(var a in t)C(e,a,{get:t[a],enumerable:!0})};import{packOf as M,registerPack as x}from"../../engine/v3/volter_world-core.mjs";var o={vendor:"cohere",service:"cohere",body:{json:"always"},ids:{template:"{uuid}"},time:"iso",error:{id:"{id}",message:"{message}"},readOnly:{status:403,message:"This twin was started read-only; writes are refused."},notFound:{status:404,message:"404 page not found"},gap:{status:404,message:"404 page not found"},deleted:{},resources:{_api_key:{idPrefix:"key_",ids:"{prefix}{n}"}},unmodeled:["chat","checkAPIKey","classify","list-connectors","create-connector","get-connector","update-connector","delete-connector","oAuthAuthorize-connector","list-datasets","create-dataset","get-dataset","delete-dataset","get-dataset-usage","detokenize","embed","list-embed-jobs","create-embed-job","get-embed-job","cancel-embed-job","ListFinetunedModels","CreateFinetunedModel","ListEvents","ListTrainingStepMetrics","GetFinetunedModel","UpdateFinetunedModel","DeleteFinetunedModel","generate","list-models","get-model","rerank","summarize","tokenize","create-transcription","ListBatches","CreateBatch","GetBatch","CancelBatch","chatv2","embedv2","parsev2"],doors:[{id:"appCredentials",method:"POST",path:"/_twin/app-credentials",note:"the World application's key, as the runtime issues it"}],auth:{header:"authorization",scheme:"Bearer",gateWhenAbsent:!0,beforeRouting:!0,invalidKeys:[],missing:{status:401,message:"no api key supplied"},invalid:{status:401,message:"invalid api token"},held:{storedAs:"_api_key",hashField:"sha256"}},rateBudget:{windowMs:6e4,ceiling:10,defaultWeight:1,allowance:{perMinute:10,source:"https://docs.cohere.com/docs/rate-limits"},reason:"Rerank trial keys allow 10 requests per minute; use that lower published tier."},vendorBacked:{none:"Rerank computes scores without storing vendor resources; _api_key is World credential bookkeeping."},discovery:{twinOf:"Cohere's API (api.cohere.com): rerank",stores:"API keys (by their SHA-256)",behavior:"a document's relevance is its lexical overlap with the query, labeled in the answer's meta; no model runs"},descriptor:{protocol:"3",transport:"rest",archetype:"crud",bin:"world-cohere",resources:[],specSource:"Cohere's OpenAPI document (spec/openapi.yaml.gz)",description:"Cohere twin \u2014 rerank (v2) by lexical overlap with the query, labeled (no model runs); dashboard API keys.",adoption:{sdks:["@ai-sdk/cohere","cohere-ai"],pypi:["cohere"],envStems:["CO","COHERE"]},hosts:[{host:"api.cohere.com"},{host:"api.cohere.ai"}],endpointEnv:{name:"COHERE_API_URL",templates:{COHERE_API_URL:"${url}/v2/rerank"},note:"The pinned LibreChat CohereReranker reads this full request URL; retain its /v2/rerank suffix."},clientCasesNone:"LibreChat uses axios in @librechat/agents@4.0.1 CohereReranker, not the official cohere-ai SDK; no official SDK behavior is relied on.",credentialDoor:{path:"/_twin/app-credentials",body:{},fill:{COHERE_API_KEY:"api_key"}}}};var l={generatedBy:"scripts/derive-pack.ts",spec:"openapi.yaml.gz",format:"openapi",version:"1.0",resources:[{name:"ApiMeta",schema:"ApiMeta",fields:[{name:"api_version",type:"object",nullable:!1},{name:"billed_units",type:"object",nullable:!1},{name:"cached_tokens",type:"number",nullable:!1},{name:"tokens",type:"object",nullable:!1},{name:"warnings",type:"array",nullable:!1}],stateCandidates:[],expandable:[]},{name:"Batch",schema:"Batch",fields:[{name:"created_at",type:"string",nullable:!1},{name:"creator_id",type:"string",nullable:!1},{name:"id",type:"string",nullable:!1},{name:"input_dataset_id",type:"string",nullable:!1,required:!0},{name:"input_tokens",type:"string",nullable:!1},{name:"model",type:"string",nullable:!1,required:!0},{name:"name",type:"string",nullable:!1,required:!0},{name:"num_failed_records",type:"integer",nullable:!1},{name:"num_records",type:"integer",nullable:!1},{name:"num_successful_records",type:"integer",nullable:!1},{name:"org_id",type:"string",nullable:!1},{name:"output_dataset_id",type:"string",nullable:!1},{name:"output_tokens",type:"string",nullable:!1},{name:"status",type:"BatchStatus",nullable:!1,enum:["BATCH_STATUS_UNSPECIFIED","BATCH_STATUS_QUEUED","BATCH_STATUS_IN_PROGRESS","BATCH_STATUS_CANCELING","BATCH_STATUS_COMPLETED","BATCH_STATUS_FAILED","BATCH_STATUS_CANCELED"]},{name:"status_reason",type:"string",nullable:!1},{name:"updated_at",type:"string",nullable:!1}],stateCandidates:[{field:"status",values:["BATCH_STATUS_CANCELED","BATCH_STATUS_CANCELING","BATCH_STATUS_COMPLETED","BATCH_STATUS_FAILED","BATCH_STATUS_IN_PROGRESS","BATCH_STATUS_QUEUED","BATCH_STATUS_UNSPECIFIED"]}],expandable:[]},{name:"Connector",schema:"Connector",fields:[{name:"active",type:"boolean",nullable:!1},{name:"auth_status",type:"string",nullable:!1,enum:["valid","expired"]},{name:"auth_type",type:"string",nullable:!1},{name:"continue_on_failure",type:"boolean",nullable:!1},{name:"created_at",type:"string",nullable:!1,required:!0},{name:"description",type:"string",nullable:!1},{name:"excludes",type:"array",nullable:!1},{name:"id",type:"string",nullable:!1,required:!0},{name:"name",type:"string",nullable:!1,required:!0},{name:"oauth",type:"ConnectorOAuth",nullable:!1},{name:"organization_id",type:"string",nullable:!1},{name:"updated_at",type:"string",nullable:!1,required:!0},{name:"url",type:"string",nullable:!1}],stateCandidates:[{field:"active",values:["false","true"]},{field:"auth_status",values:["expired","valid"]}],expandable:[]},{name:"Dataset",schema:"Dataset",fields:[{name:"created_at",type:"string",nullable:!1,required:!0},{name:"dataset_parts",type:"array",nullable:!1},{name:"dataset_type",type:"DatasetType",nullable:!1,required:!0,enum:["embed-input","embed-result","cluster-result","cluster-outliers","reranker-finetune-input","single-label-classification-finetune-input","chat-finetune-input","multi-label-classification-finetune-input","batch-chat-input","batch-openai-chat-input","batch-embed-v2-input","batch-chat-v2-input"]},{name:"id",type:"string",nullable:!1,required:!0},{name:"metrics",type:"Metrics",nullable:!1},{name:"name",type:"string",nullable:!1,required:!0},{name:"parse_info",type:"ParseInfo",nullable:!1},{name:"preserve_fields",type:"array",nullable:!1},{name:"required_fields",type:"array",nullable:!1},{name:"schema",type:"string",nullable:!1},{name:"updated_at",type:"string",nullable:!1,required:!0},{name:"validation_error",type:"string",nullable:!1},{name:"validation_status",type:"DatasetValidationStatus",nullable:!1,required:!0,enum:["unknown","queued","processing","failed","validated","skipped"]},{name:"validation_warnings",type:"array",nullable:!1}],stateCandidates:[{field:"dataset_type",values:["batch-chat-input","batch-chat-v2-input","batch-embed-v2-input","batch-openai-chat-input","chat-finetune-input","cluster-outliers","cluster-result","embed-input","embed-result","multi-label-classification-finetune-input","reranker-finetune-input","single-label-classification-finetune-input"]},{field:"validation_status",values:["failed","processing","queued","skipped","unknown","validated"]}],expandable:[]},{name:"EmbedJob",schema:"EmbedJob",fields:[{name:"created_at",type:"string",nullable:!1,required:!0},{name:"input_dataset_id",type:"string",nullable:!1,required:!0},{name:"job_id",type:"string",nullable:!1,required:!0},{name:"meta",type:"ApiMeta",nullable:!1},{name:"model",type:"string",nullable:!1,required:!0},{name:"name",type:"string",nullable:!1},{name:"output_dataset_id",type:"string",nullable:!1},{name:"status",type:"string",nullable:!1,required:!0,enum:["processing","complete","cancelling","cancelled","failed"]},{name:"truncate",type:"string",nullable:!1,required:!0,enum:["START","END"]}],stateCandidates:[{field:"status",values:["cancelled","cancelling","complete","failed","processing"]},{field:"truncate",values:["END","START"]}],expandable:[]},{name:"Event",schema:"Event",fields:[{name:"created_at",type:"string",nullable:!1},{name:"status",type:"Status",nullable:!1,enum:["STATUS_UNSPECIFIED","STATUS_FINETUNING","STATUS_DEPLOYING_API","STATUS_READY","STATUS_FAILED","STATUS_DELETED","STATUS_TEMPORARILY_OFFLINE","STATUS_PAUSED","STATUS_QUEUED"]},{name:"user_id",type:"string",nullable:!1}],stateCandidates:[{field:"status",values:["STATUS_DELETED","STATUS_DEPLOYING_API","STATUS_FAILED","STATUS_FINETUNING","STATUS_PAUSED","STATUS_QUEUED","STATUS_READY","STATUS_TEMPORARILY_OFFLINE","STATUS_UNSPECIFIED"]}],expandable:[]},{name:"FinetunedModel",schema:"FinetunedModel",fields:[{name:"completed_at",type:"string",nullable:!1},{name:"created_at",type:"string",nullable:!1},{name:"creator_id",type:"string",nullable:!1},{name:"id",type:"string",nullable:!1},{name:"last_used",type:"string",nullable:!1},{name:"name",type:"string",nullable:!1,required:!0},{name:"organization_id",type:"string",nullable:!1},{name:"settings",type:"Settings",nullable:!1,required:!0},{name:"status",type:"Status",nullable:!1,enum:["STATUS_UNSPECIFIED","STATUS_FINETUNING","STATUS_DEPLOYING_API","STATUS_READY","STATUS_FAILED","STATUS_DELETED","STATUS_TEMPORARILY_OFFLINE","STATUS_PAUSED","STATUS_QUEUED"]},{name:"updated_at",type:"string",nullable:!1}],stateCandidates:[{field:"status",values:["STATUS_DELETED","STATUS_DEPLOYING_API","STATUS_FAILED","STATUS_FINETUNING","STATUS_PAUSED","STATUS_QUEUED","STATUS_READY","STATUS_TEMPORARILY_OFFLINE","STATUS_UNSPECIFIED"]}],expandable:[]},{name:"GetModelResponse",schema:"GetModelResponse",fields:[{name:"context_length",type:"number",nullable:!1},{name:"default_endpoints",type:"array",nullable:!1},{name:"endpoints",type:"array",nullable:!1},{name:"features",type:"array",nullable:!1},{name:"finetuned",type:"boolean",nullable:!1},{name:"is_deprecated",type:"boolean",nullable:!1},{name:"name",type:"string",nullable:!1},{name:"sampling_defaults",type:"object",nullable:!1},{name:"tokenizer_url",type:"string",nullable:!1}],stateCandidates:[{field:"is_deprecated",values:["false","true"]}],expandable:[]},{name:"TrainingStepMetrics",schema:"TrainingStepMetrics",fields:[{name:"created_at",type:"string",nullable:!1},{name:"metrics",type:"object",nullable:!1},{name:"step_number",type:"integer",nullable:!1}],stateCandidates:[],expandable:[]}],operations:[{id:"chat",method:"post",path:"/v1/chat",pathParams:[],query:[],body:[{name:"chat_history",type:"array",required:!1},{name:"citation_quality",type:"string",required:!1},{name:"connectors",type:"array",required:!1},{name:"conversation_id",type:"string",required:!1},{name:"documents",type:"array",required:!1},{name:"force_single_step",type:"boolean",required:!1},{name:"frequency_penalty",type:"number",required:!1},{name:"k",type:"integer",required:!1,minimum:0,maximum:500},{name:"max_input_tokens",type:"integer",required:!1},{name:"max_tokens",type:"integer",required:!1},{name:"message",type:"string",required:!0},{name:"model",type:"string",required:!1},{name:"p",type:"number",required:!1,minimum:.01,maximum:.99},{name:"preamble",type:"string",required:!1},{name:"presence_penalty",type:"number",required:!1},{name:"prompt_truncation",type:"string",required:!1},{name:"raw_prompting",type:"boolean",required:!1},{name:"response_format",type:"ResponseFormat",required:!1},{name:"safety_mode",type:"any",required:!1},{name:"search_queries_only",type:"boolean",required:!1},{name:"seed",type:"integer",required:!1,minimum:0,maximum:"18446744073709552000"},{name:"stop_sequences",type:"array",required:!1},{name:"stream",type:"boolean",required:!1},{name:"temperature",type:"number",required:!1,minimum:0,maximum:1},{name:"tool_results",type:"array",required:!1},{name:"tools",type:"array",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"checkAPIKey",method:"post",path:"/v1/check-api-key",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"classify",method:"post",path:"/v1/classify",pathParams:[],query:[],body:[{name:"examples",type:"array",required:!1},{name:"inputs",type:"array",required:!0},{name:"model",type:"string",required:!1},{name:"preset",type:"string",required:!1},{name:"truncate",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"list-connectors",method:"get",path:"/v1/connectors",pathParams:[],query:[{name:"limit",type:"number",required:!1},{name:"offset",type:"number",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Connector",list:!0,key:"connectors"},class:"list",resource:"Connector"},{id:"create-connector",method:"post",path:"/v1/connectors",pathParams:[],query:[],body:[{name:"active",type:"boolean",required:!1},{name:"continue_on_failure",type:"boolean",required:!1},{name:"description",type:"string",required:!1},{name:"excludes",type:"array",required:!1},{name:"name",type:"string",required:!0},{name:"oauth",type:"CreateConnectorOAuth",required:!1},{name:"service_auth",type:"CreateConnectorServiceAuth",required:!1},{name:"url",type:"string",required:!0}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Connector",list:!1,key:"connector"},class:"create",resource:"Connector"},{id:"get-connector",method:"get",path:"/v1/connectors/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Connector",list:!1,key:"connector"},class:"retrieve",resource:"Connector"},{id:"update-connector",method:"patch",path:"/v1/connectors/{id}",pathParams:["id"],query:[],body:[{name:"active",type:"boolean",required:!1},{name:"continue_on_failure",type:"boolean",required:!1},{name:"excludes",type:"array",required:!1},{name:"name",type:"string",required:!1},{name:"oauth",type:"CreateConnectorOAuth",required:!1},{name:"service_auth",type:"CreateConnectorServiceAuth",required:!1},{name:"url",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Connector",list:!1,key:"connector"},class:"update",resource:"Connector"},{id:"delete-connector",method:"delete",path:"/v1/connectors/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"delete",resource:"Connector"},{id:"oAuthAuthorize-connector",method:"post",path:"/v1/connectors/{id}/oauth/authorize",pathParams:["id"],query:[{name:"after_token_redirect",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"list-datasets",method:"get",path:"/v1/datasets",pathParams:[],query:[{name:"after",type:"string",required:!1},{name:"before",type:"string",required:!1},{name:"datasetType",type:"string",required:!1},{name:"limit",type:"number",required:!1},{name:"offset",type:"number",required:!1},{name:"validationStatus",type:"DatasetValidationStatus",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Dataset",list:!0,key:"datasets"},class:"list",resource:"Dataset"},{id:"create-dataset",method:"post",path:"/v1/datasets",pathParams:[],query:[{name:"csv_delimiter",type:"string",required:!1},{name:"keep_fields",type:"array",required:!1},{name:"keep_original_file",type:"boolean",required:!1},{name:"name",type:"string",required:!0},{name:"optional_fields",type:"array",required:!1},{name:"skip_malformed_input",type:"boolean",required:!1},{name:"text_separator",type:"string",required:!1},{name:"type",type:"DatasetType",required:!0}],body:[{name:"data",type:"string",required:!0},{name:"eval_data",type:"string",required:!1}],bodyEncoding:"multipart",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"get-dataset",method:"get",path:"/v1/datasets/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Dataset",list:!1,key:"dataset"},class:"retrieve",resource:"Dataset"},{id:"delete-dataset",method:"delete",path:"/v1/datasets/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"delete",resource:"Dataset"},{id:"get-dataset-usage",method:"get",path:"/v1/datasets/usage",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"computed"},{id:"detokenize",method:"post",path:"/v1/detokenize",pathParams:[],query:[],body:[{name:"model",type:"string",required:!0},{name:"tokens",type:"array",required:!0}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"ApiMeta",list:!1,key:"meta"},class:"action",resource:"ApiMeta"},{id:"embed",method:"post",path:"/v1/embed",pathParams:[],query:[],body:[{name:"embedding_types",type:"array",required:!1},{name:"images",type:"array",required:!1},{name:"input_type",type:"EmbedInputType",required:!1},{name:"model",type:"string",required:!1},{name:"texts",type:"array",required:!1},{name:"truncate",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"list-embed-jobs",method:"get",path:"/v1/embed-jobs",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"EmbedJob",list:!0,key:"embed_jobs"},class:"list",resource:"EmbedJob"},{id:"create-embed-job",method:"post",path:"/v1/embed-jobs",pathParams:[],query:[],body:[{name:"dataset_id",type:"string",required:!0},{name:"embedding_types",type:"array",required:!1},{name:"input_type",type:"EmbedInputType",required:!0},{name:"model",type:"string",required:!0},{name:"name",type:"string",required:!1},{name:"truncate",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"ApiMeta",list:!1,key:"meta"},class:"action",resource:"ApiMeta"},{id:"get-embed-job",method:"get",path:"/v1/embed-jobs/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"EmbedJob",list:!1},class:"retrieve",resource:"EmbedJob"},{id:"cancel-embed-job",method:"post",path:"/v1/embed-jobs/{id}/cancel",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,emptySuccess:!0,credentials:["bearerAuth"],class:"action",resource:"EmbedJob"},{id:"ListFinetunedModels",method:"get",path:"/v1/finetuning/finetuned-models",pathParams:[],query:[{name:"order_by",type:"string",required:!1},{name:"page_size",type:"integer",required:!1},{name:"page_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"FinetunedModel",list:!0,key:"finetuned_models"},class:"list",resource:"FinetunedModel"},{id:"CreateFinetunedModel",method:"post",path:"/v1/finetuning/finetuned-models",pathParams:[],query:[],body:[{name:"completed_at",type:"string",required:!1},{name:"created_at",type:"string",required:!1},{name:"creator_id",type:"string",required:!1},{name:"id",type:"string",required:!1},{name:"last_used",type:"string",required:!1},{name:"name",type:"string",required:!0},{name:"organization_id",type:"string",required:!1},{name:"settings",type:"Settings",required:!0},{name:"status",type:"Status",required:!1},{name:"updated_at",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"FinetunedModel",list:!1,key:"finetuned_model"},class:"create",resource:"FinetunedModel"},{id:"ListEvents",method:"get",path:"/v1/finetuning/finetuned-models/{finetuned_model_id}/events",pathParams:["finetuned_model_id"],query:[{name:"order_by",type:"string",required:!1},{name:"page_size",type:"integer",required:!1},{name:"page_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Event",list:!0,key:"events"},class:"list",resource:"Event"},{id:"ListTrainingStepMetrics",method:"get",path:"/v1/finetuning/finetuned-models/{finetuned_model_id}/training-step-metrics",pathParams:["finetuned_model_id"],query:[{name:"page_size",type:"integer",required:!1},{name:"page_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"TrainingStepMetrics",list:!0,key:"step_metrics"},class:"list",resource:"TrainingStepMetrics"},{id:"GetFinetunedModel",method:"get",path:"/v1/finetuning/finetuned-models/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"FinetunedModel",list:!1,key:"finetuned_model"},class:"retrieve",resource:"FinetunedModel"},{id:"UpdateFinetunedModel",method:"patch",path:"/v1/finetuning/finetuned-models/{id}",pathParams:["id"],query:[],body:[{name:"completed_at",type:"string",required:!1},{name:"created_at",type:"string",required:!1},{name:"creator_id",type:"string",required:!1},{name:"last_used",type:"string",required:!1},{name:"name",type:"string",required:!0},{name:"organization_id",type:"string",required:!1},{name:"settings",type:"Settings",required:!0},{name:"status",type:"Status",required:!1},{name:"updated_at",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"FinetunedModel",list:!1,key:"finetuned_model"},class:"update",resource:"FinetunedModel"},{id:"DeleteFinetunedModel",method:"delete",path:"/v1/finetuning/finetuned-models/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"delete",resource:"FinetunedModel"},{id:"generate",method:"post",path:"/v1/generate",pathParams:[],query:[],body:[{name:"end_sequences",type:"array",required:!1},{name:"frequency_penalty",type:"number",required:!1},{name:"k",type:"integer",required:!1},{name:"max_tokens",type:"integer",required:!1},{name:"model",type:"string",required:!1},{name:"num_generations",type:"integer",required:!1},{name:"p",type:"number",required:!1},{name:"presence_penalty",type:"number",required:!1},{name:"preset",type:"string",required:!1},{name:"prompt",type:"string",required:!0},{name:"raw_prompting",type:"boolean",required:!1},{name:"return_likelihoods",type:"string",required:!1},{name:"seed",type:"integer",required:!1,minimum:0,maximum:"18446744073709552000"},{name:"stop_sequences",type:"array",required:!1},{name:"stream",type:"boolean",required:!1},{name:"temperature",type:"number",required:!1},{name:"truncate",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"list-models",method:"get",path:"/v1/models",pathParams:[],query:[{name:"default_only",type:"boolean",required:!1},{name:"endpoint",type:"CompatibleEndpoint",required:!1},{name:"page_size",type:"number",required:!1},{name:"page_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"GetModelResponse",list:!0,key:"models"},class:"list",resource:"GetModelResponse"},{id:"get-model",method:"get",path:"/v1/models/{model}",pathParams:["model"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"GetModelResponse",list:!1},class:"retrieve",resource:"GetModelResponse"},{id:"rerank",method:"post",path:"/v1/rerank",pathParams:[],query:[],body:[{name:"documents",type:"array",required:!0},{name:"max_chunks_per_doc",type:"integer",required:!1},{name:"model",type:"string",required:!1},{name:"query",type:"string",required:!0},{name:"rank_fields",type:"array",required:!1},{name:"return_documents",type:"boolean",required:!1},{name:"top_n",type:"integer",required:!1,minimum:1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"summarize",method:"post",path:"/v1/summarize",pathParams:[],query:[],body:[{name:"additional_command",type:"string",required:!1},{name:"extractiveness",type:"string",required:!1},{name:"format",type:"string",required:!1},{name:"length",type:"string",required:!1},{name:"model",type:"string",required:!1},{name:"temperature",type:"number",required:!1,minimum:0,maximum:5},{name:"text",type:"string",required:!0}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"tokenize",method:"post",path:"/v1/tokenize",pathParams:[],query:[],body:[{name:"model",type:"string",required:!0},{name:"text",type:"string",required:!0}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"ApiMeta",list:!1,key:"meta"},class:"action",resource:"ApiMeta"},{id:"create-transcription",method:"post",path:"/v2/audio/transcriptions",pathParams:[],query:[],body:[{name:"file",type:"string",required:!0},{name:"language",type:"string",required:!0},{name:"model",type:"string",required:!0},{name:"temperature",type:"number",required:!1}],bodyEncoding:"multipart",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"ListBatches",method:"get",path:"/v2/batches",pathParams:[],query:[{name:"order_by",type:"string",required:!1},{name:"page_size",type:"integer",required:!1},{name:"page_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Batch",list:!0,key:"batches"},class:"list",resource:"Batch"},{id:"CreateBatch",method:"post",path:"/v2/batches",pathParams:[],query:[],body:[{name:"created_at",type:"string",required:!1},{name:"creator_id",type:"string",required:!1},{name:"id",type:"string",required:!1},{name:"input_dataset_id",type:"string",required:!0},{name:"input_tokens",type:"string",required:!1},{name:"model",type:"string",required:!0},{name:"name",type:"string",required:!0},{name:"num_failed_records",type:"integer",required:!1},{name:"num_records",type:"integer",required:!1},{name:"num_successful_records",type:"integer",required:!1},{name:"org_id",type:"string",required:!1},{name:"output_dataset_id",type:"string",required:!1},{name:"output_tokens",type:"string",required:!1},{name:"status",type:"BatchStatus",required:!1},{name:"status_reason",type:"string",required:!1},{name:"updated_at",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Batch",list:!1,key:"batch"},class:"create",resource:"Batch"},{id:"GetBatch",method:"get",path:"/v2/batches/{id}",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],answers:{resource:"Batch",list:!1,key:"batch"},class:"retrieve",resource:"Batch"},{id:"CancelBatch",method:"post",path:"/v2/batches/{id}:cancel",pathParams:["id"],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"chatv2",method:"post",path:"/v2/chat",pathParams:[],query:[],body:[{name:"citation_options",type:"CitationOptions",required:!1},{name:"documents",type:"array",required:!1},{name:"frequency_penalty",type:"number",required:!1},{name:"k",type:"integer",required:!1,minimum:0,maximum:500},{name:"logprobs",type:"boolean",required:!1},{name:"max_tokens",type:"integer",required:!1},{name:"messages",type:"ChatMessages",required:!0},{name:"model",type:"string",required:!0},{name:"p",type:"number",required:!1,minimum:.01,maximum:.99},{name:"presence_penalty",type:"number",required:!1},{name:"priority",type:"integer",required:!1,minimum:0,maximum:999},{name:"response_format",type:"ResponseFormatV2",required:!1},{name:"safety_mode",type:"any",required:!1},{name:"seed",type:"integer",required:!1,minimum:0,maximum:"18446744073709552000"},{name:"stop_sequences",type:"array",required:!1},{name:"stream",type:"boolean",required:!1},{name:"strict_tools",type:"boolean",required:!1},{name:"temperature",type:"number",required:!1,minimum:0,maximum:1},{name:"thinking",type:"Thinking",required:!1},{name:"tool_choice",type:"any",required:!1},{name:"tools",type:"array",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"embedv2",method:"post",path:"/v2/embed",pathParams:[],query:[],body:[{name:"embedding_types",type:"array",required:!1},{name:"images",type:"array",required:!1},{name:"input_type",type:"EmbedInputType",required:!0},{name:"inputs",type:"array",required:!1},{name:"max_tokens",type:"integer",required:!1},{name:"model",type:"string",required:!0},{name:"output_dimension",type:"integer",required:!1},{name:"priority",type:"integer",required:!1,minimum:0,maximum:999},{name:"texts",type:"array",required:!1},{name:"truncate",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"parsev2",method:"post",path:"/v2/parse",pathParams:[],query:[],body:[{name:"document",type:"ParseDocument",required:!0},{name:"model",type:"string",required:!0},{name:"output_format",type:"ParseOutputFormat",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"},{id:"rerankv2",method:"post",path:"/v2/rerank",pathParams:[],query:[],body:[{name:"documents",type:"array",required:!0},{name:"max_tokens_per_doc",type:"integer",required:!1},{name:"model",type:"string",required:!0},{name:"priority",type:"integer",required:!1,minimum:0,maximum:999},{name:"query",type:"string",required:!0},{name:"top_n",type:"integer",required:!1,minimum:1}],bodyEncoding:"json",successStatus:200,credentials:["bearerAuth"],class:"non-resource"}]};import{createPackFetch as F}from"../../engine/v3/volter_world-core.mjs";var c={};P(c,{appCredentials:()=>I});var p="_api_key",f=(e,t)=>e.crypto.digest("sha256",t,"hex"),b=async(e,t)=>`${await e.secret(t)}${await e.secret(`${t}:2`)}`.replace(/[^A-Za-z0-9]/g,"").slice(0,40);async function h(e,t){let a=e.mint(p),n=`cohere-api-key:${a}`,s=await b(e,n);return await e.record(p,{name:t,label:n,created:e.occurredAt,sha256:f(e,s)},a),s}async function g(e,t){let a=e.rows(p).find(s=>s.name===t);if(!a)return;let n=await b(e,String(a.label));return f(e,n)!==a.sha256?void 0:n}var r=(e,t,a)=>Response.json({id:e.crypto.uuidFrom(`cohere-error:${e.occurredAt}:${a}`),message:a},{status:t});var w={"rerank-english-v3.0":"2024-04-09T00:00:00.000Z","rerank-multilingual-v3.0":"2024-04-09T00:00:00.000Z","rerank-v3.5":"2024-12-02T00:00:00.000Z","rerank-v4.0-pro":"2025-12-11T00:00:00.000Z","rerank-v4.0-fast":"2025-12-11T00:00:00.000Z"};function q(e,t){let a=w[e];return a!==void 0&&t>=a}async function I(e){return Response.json({api_key:await g(e,"world-app")??await h(e,"world-app")},{status:201})}async function _(e){let t=e.body&&typeof e.body=="object"?e.body:{};if(e.occurredAt<"2024-09-26T00:00:00.000Z")return r(e,404,"404 page not found");if(typeof t.model!="string"||!t.model)return r(e,400,"a model parameter is required for this endpoint.");if(!q(t.model,e.occurredAt))return r(e,404,`model '${t.model}' not found, make sure the correct model ID was used and that you have access to the model.`);if(typeof t.query!="string"||!t.query.trim())return r(e,400,"invalid request: query must not be empty or be only whitespace");if(!Array.isArray(t.documents)||t.documents.length===0)return r(e,400,"invalid request: list of documents must not be empty");if(t.documents.length>1e4)return r(e,400,"invalid request: number of total max chunks (number of documents * max chunks per doc) must be less than 10000");if(t.documents.some(i=>typeof i!="string"))return r(e,400,"invalid request: documents must be a list of strings");let a=t.documents.findIndex(i=>!i.trim());if(a>=0)return r(e,400,`invalid request: document at index ${a} cannot be empty`);let n=t.top_n===void 0?t.documents.length:t.top_n;if(typeof n!="number"||!Number.isInteger(n)||n<1)return r(e,400,"invalid request: top_n must be a positive integer");let s=t.max_tokens_per_doc===void 0?4096:t.max_tokens_per_doc;if(typeof s!="number"||!Number.isInteger(s)||s<1)return r(e,400,"invalid request: max_tokens_per_doc must be a positive integer");let u=t.priority===void 0?0:t.priority;if(typeof u!="number"||!Number.isInteger(u)||u<0||u>999)return r(e,400,"invalid request: priority must be an integer between 0 and 999");let A=t.model.startsWith("rerank-v4.0-")?16384:2048,m=new Set((t.query.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).slice(0,A)),T=t.documents.map((i,d)=>{let E=new Set((i.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).slice(0,s)),v=m.size?[...m].filter(k=>E.has(k)).length/m.size:0;return{index:d,relevance_score:Math.round((.01+.98*v)*1e6)/1e6}}).sort((i,d)=>d.relevance_score-i.relevance_score||i.index-d.index);return Response.json({id:e.crypto.uuidFrom(`cohere-rerank:${e.occurredAt}:${JSON.stringify(t)}`),results:T.slice(0,n),meta:{api_version:{version:"2",is_experimental:!1},billed_units:{search_units:1},warnings:["twin: relevance is lexical overlap with the query; no rerank model runs; token budgets count Unicode words"]}})}var S={rerankv2:_};function y(e={}){return F({manifest:o,surface:l,handlers:S,doors:c},e)}import{serveHttp as Z}from"../../engine/v3/volter_world-core.mjs";var ae=x(M(o,l));export{y as createTwinFetch};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@agenttwin/twin-datadog
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-datadog 0.1.37 by Volter (https://github.com/volter-ai),
|
|
4
|
+
licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
|
|
7
|
+
fetch factory is included; shared modules are imported from the AgentTwin twin engine.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
|
|
2
|
+
import{applyTwinWrite as xt,projectResources as Ct,subjectHistory as Ie,worldNow as w}from"../../engine/v2/volter_world-core.mjs";import{applyTwinWrite as k,projectResources as jt,worldNow as M}from"../../engine/v2/volter_world-core.mjs";var E="datadog",Q="dd0dd0dd0dd0dd0dd0dd0dd0dd0dd0d0",X="dda0dda0dda0dda0dda0dda0dda0dda0dda0dda0",yt="pubdd0dd0dd0dd0dd0dd0dd0dd0dd0dd0",$="00000000-0000-4000-8000-00000000dd01",B="org_twin",ht="Twin Org",_t="ddtwin0org0public0id";function x(t,r){let e=t??{},o=e["dd-api-key"]??e["DD-API-KEY"];return o?String(o):r.get("dd-api-key")??r.get("api_key")??void 0}function Z(t,r){let e=t??{},o=e["dd-application-key"]??e["DD-APPLICATION-KEY"];return o?String(o):r.get("application_key")??void 0}function D(t,r){return jt(E,r).filter(e=>e.type===t)}function I(t,r){if(!t)return;let e=D("org",r).find(o=>o.apiKey===t&&!o.deleted);if(e)return{id:String(e.id),apiKey:String(e.apiKey),appKey:String(e.appKey),name:String(e.name??""),publicId:String(e.publicId??"")}}function H(t,r){if(!t)return;let e=D("rum_application",r).find(o=>o.clientToken===t&&!o.deleted);if(e)return{id:String(e.id),applicationId:String(e.applicationId),clientToken:String(e.clientToken),name:String(e.name??"")}}async function q(t,r){let e=r??M();D("org",t).some(o=>o.id===B)||await k(E,{operation:"org.observe",subjectType:"org",subjectId:B,fields:{name:ht,publicId:_t,apiKey:Q,appKey:X},occurredAt:e,actor:{kind:"system"}},t),D("rum_application",t).some(o=>o.id===$)||await k(E,{operation:"rum_application.observe",subjectType:"rum_application",subjectId:$,fields:{applicationId:$,clientToken:yt,name:"twin-app",appType:"browser",orgId:B,createdAt:e},occurredAt:e,actor:{kind:"system"}},t)}function A(t,r,e){let o=D(t,r),a=o.length;if(e)for(let n of o){let i=e(String(n.id));i!==void 0&&Number.isFinite(i)&&i>a&&(a=i)}return a+1}function N(t){let r=/(\d+)$/.exec(t);if(!r)return;let e=Number(r[1]);return Number.isSafeInteger(e)?e:void 0}function P(t){let r=Number(t);return Number.isSafeInteger(r)?r:void 0}function tt(t,r){return`${t}${r.toString(36).padStart(11,"0").toUpperCase()}`}function G(t){let r=(t??"").trim();if(!r)return[];try{let o=JSON.parse(r);if(Array.isArray(o)){let a=o.filter(n=>n&&typeof n=="object"&&!Array.isArray(n));return a.length===o.length?a:void 0}return o&&typeof o=="object"?[o]:void 0}catch{}let e=[];for(let o of r.split(`
|
|
3
|
+
`)){let a=o.trim();if(a)try{let n=JSON.parse(a);if(!n||typeof n!="object"||Array.isArray(n))return;e.push(n)}catch{return}}return e.length>0?e:void 0}function l(t,r=""){return typeof t=="string"?t:t==null?r:String(t)}function R(t,...r){let e=t;for(let o of r){if(!e||typeof e!="object")return;e=e[o]}return e}async function et(t,r,e={}){let o=e.occurredAt??M(),a=tt("AQAAA",A("rum_event",e.root)),n=typeof r.date=="number"?r.date:Date.parse(o),i={applicationId:l(R(r,"application","id"),t.applicationId),eventType:l(r.type,"view"),date:n,timestamp:new Date(n).toISOString(),service:l(r.service,t.name),version:l(r.version),sessionId:l(R(r,"session","id")),sessionType:l(R(r,"session","type")),viewId:l(R(r,"view","id")),viewUrl:l(R(r,"view","url")),viewName:l(R(r,"view","name")),source:l(r.source,"browser"),attributes:r};return await k(E,{operation:"rum_event.observe",subjectType:"rum_event",subjectId:a,fields:i,occurredAt:o,actor:{kind:"system"}},e.root),{id:a,type:String(i.eventType),sessionId:String(i.sessionId),viewId:String(i.viewId),event:{id:a,...i}}}async function W(t,r,e={}){let o=e.occurredAt??M(),a=tt("AQAAB",A("log",e.root)),n=new Set(["ddsource","ddtags","hostname","message","service","status","date"]),i={};for(let[c,f]of Object.entries(r))n.has(c)||(i[c]=f);let s=typeof r.date=="number"?r.date:Date.parse(o),u={orgId:t.id,ddsource:l(r.ddsource,e.source??""),ddtags:l(r.ddtags),hostname:l(r.hostname),service:l(r.service),status:l(r.status,"info"),message:l(r.message),timestamp:new Date(s).toISOString(),attributes:i};return await k(E,{operation:"log.observe",subjectType:"log",subjectId:a,fields:u,occurredAt:o,actor:{kind:"system"}},e.root),{id:a,message:String(u.message),log:{id:a,...u}}}var vt={0:"unspecified",1:"count",2:"rate",3:"gauge"};function bt(t,r){return`${t}{${[...r].sort().join(",")}}`}function V(t){if(!Array.isArray(t))return;let r=[];for(let e of t)if(Array.isArray(e)&&e.length>=2&&Number.isFinite(Number(e[0]))&&Number.isFinite(Number(e[1])))r.push([Number(e[0]),Number(e[1])]);else if(e&&typeof e=="object"){let o=e;if(!Number.isFinite(Number(o.timestamp))||!Number.isFinite(Number(o.value)))return;r.push([Number(o.timestamp),Number(o.value)])}else return;return r}async function rt(t,r,e={}){let o=e.occurredAt??M(),a=l(r.metric);if(!a)return;let n=V(r.points);if(!n)return;let i=Array.isArray(r.tags)?r.tags.map(h=>l(h)):[],s=Array.isArray(r.resources)?r.resources.find(h=>l(h?.type)==="host"):void 0,u=l(r.host,l(s?.name)),c=r.type,f=typeof c=="number"?vt[c]??"unspecified":l(c,"gauge"),_=bt(a,i),j=D("metric_series",e.root).find(h=>h.id===_&&!h.deleted),v=[...Array.isArray(j?.points)?j.points:[],...n].sort((h,Ut)=>h[0]-Ut[0]);await k(E,{operation:j?"metric_series.observe":"metric_series.create",subjectType:"metric_series",subjectId:_,fields:{orgId:t.id,metric:a,tags:i,host:u,metricType:f,unit:l(r.unit)||null,interval:Number.isFinite(Number(r.interval))?Number(r.interval):null,points:v},occurredAt:o,actor:{kind:"system"}},e.root);let b=D("metric_def",e.root).find(h=>h.id===a&&!h.deleted);return await k(E,{operation:b?"metric_def.observe":"metric_def.create",subjectType:"metric_def",subjectId:a,fields:{orgId:t.id,name:a,metricType:f,unit:l(b?.unit)||l(r.unit)||null,description:l(b?.description)||"",short_name:l(b?.short_name)||"",per_unit:b?.per_unit??null,statsd_interval:b?.statsd_interval??null,firstSeenAt:b?String(b.firstSeenAt??o):o,lastSeenAt:o},occurredAt:o,actor:{kind:"system"}},e.root),u&&await nt(u,i,{...e,occurredAt:o}),{id:_,metric:a,points:v}}async function nt(t,r,e={}){let o=e.occurredAt??M(),a=D("host",e.root).find(s=>s.id===t&&!s.deleted),n=Array.isArray(a?.tags)?a.tags:[],i=[...new Set([...n,...r])].sort();await k(E,{operation:a?"host.observe":"host.create",subjectType:"host",subjectId:t,fields:{name:t,up:!0,muted:!!a?.muted,aliases:[t],tags:i,sources:["api"],lastReportedAt:o},occurredAt:o,actor:{kind:"system"}},e.root)}var K={0:"OK",1:"WARNING",2:"CRITICAL",3:"UNKNOWN"};function ot(t){if(!t||typeof t!="object")return!1;let r=Number(t.status);return typeof t.check=="string"&&!!t.check&&typeof t.host_name=="string"&&!!t.host_name&&Number.isInteger(r)&&r in K}async function it(t,r,e={}){let o=e.occurredAt??M(),a=l(r.check),n=l(r.host_name),i=Number(r.status);if(!a||!n||!Number.isInteger(i)||!(i in K))return;let s=`${a}:${n}`,u=D("service_check",e.root).find(c=>c.id===s&&!c.deleted);return await k(E,{operation:u?"service_check.observe":"service_check.create",subjectType:"service_check",subjectId:s,fields:{orgId:t.id,check:a,host_name:n,status:i,statusLabel:K[i],message:l(r.message),tags:Array.isArray(r.tags)?r.tags:[],timestamp:Number.isFinite(Number(r.timestamp))?Number(r.timestamp):Math.floor(Date.parse(o)/1e3)},occurredAt:o,actor:{kind:"system"}},e.root),n&&await nt(n,[],{...e,occurredAt:o}),{id:s}}var lt="datadog",At=6e15;function d(t,r=404){return{status:r,body:{errors:Array.isArray(t)?t:[t]}}}var wt=()=>d("Forbidden",403),F=()=>d(["Forbidden","API key is missing or invalid"],403),p=t=>d(`${t} not found`,404);function m(t,r){return Ct(lt,r).filter(e=>e.type===t&&!e.deleted)}function T(t,r,e){return m(t,e).find(o=>String(o.id)===String(r))}function Tt(t){let r=t.indexOf("?");return r===-1?{path:t,params:new URLSearchParams}:{path:t.slice(0,r),params:new URLSearchParams(t.slice(r+1))}}function g(t){if(!t.body)return{};try{let r=JSON.parse(t.body);return r&&typeof r=="object"?r:{}}catch{return{}}}async function y(t,r,e,o,a,n){let{resource:i}=await xt(lt,{operation:o,subjectType:t,subjectId:r,fields:e,...n?{occurredAt:n}:{},actor:{kind:"agent"}},a);return i}async function U(t,r,e,o,a){await xt(lt,{operation:e,subjectType:t,subjectId:r,fields:{deleted:!0},...a?{occurredAt:a}:{},actor:{kind:"agent"}},o)}var O=t=>{let r={};for(let[e,o]of Object.entries(t))!e.startsWith("_")&&e!=="type"&&(r[e]=o);return r};function $t(t){return{id:String(t.id),type:"rum",attributes:{attributes:t.attributes??{},service:t.service??"",tags:[`service:${t.service??""}`,`version:${t.version??""}`].filter(r=>!r.endsWith(":")),timestamp:t.timestamp}}}function Bt(t){return{id:String(t.id),type:"log",attributes:{attributes:t.attributes??{},host:t.hostname??"",message:t.message??"",service:t.service??"",status:t.status??"info",tags:String(t.ddtags??"").split(",").filter(Boolean),timestamp:t.timestamp}}}function L(t){return{id:Number(t.id),name:t.name??"",type:t.monitorType??"metric alert",query:t.query??"",message:t.message??"",tags:t.tags??[],options:t.options??{},priority:t.priority??null,multi:!!t.multi,overall_state:t.overall_state??"OK",created:t.created??null,modified:t.modified??null,creator:{handle:"twin@twin.test",name:"Twin",email:"twin@twin.test"},org_id:1}}function J(t){return{id:String(t.id),title:t.title??"",description:t.description??null,layout_type:t.layout_type??"ordered",widgets:t.widgets??[],url:`/dashboard/${t.id}`,is_read_only:!1,notify_list:t.notify_list??null,template_variables:t.template_variables??[],author_handle:"twin@twin.test",created_at:t.created_at??null,modified_at:t.modified_at??null,reflow_type:t.reflow_type??null,tags:t.tags??null}}function Kt(t){let r=J(t),{widgets:e,template_variables:o,notify_list:a,...n}=r;return n}function at(t){return{id:Number(t.id),title:t.title??"",text:t.text??"",tags:t.tags??[],priority:t.priority??"normal",alert_type:t.alert_type??"info",date_happened:t.date_happened??0,host:t.host??null,source_type_name:t.source_type_name??"my_apps",url:`/event/event?id=${t.id}`,is_aggregate:!1,device_name:null}}function Ht(t){return{name:t.name??"",host_name:t.name??"",id:0,up:t.up!==!1,is_muted:!!t.muted,aliases:t.aliases??[],apps:[],sources:t.sources??["api"],tags_by_source:{Datadog:t.tags??[]},last_reported_time:Math.floor(Date.parse(String(t.lastReportedAt??0))/1e3)||0,meta:{},metrics:{}}}function Y(t){return{id:String(t.id),name:t.name??"",description:t.description??null,type:t.sloType??"metric",type_id:1,query:t.query??null,thresholds:t.thresholds??[],tags:t.tags??[],monitor_ids:t.monitor_ids??[],created_at:t.created_at??null,modified_at:t.modified_at??null,creator:{name:"Twin",email:"twin@twin.test"}}}function st(t){return{id:Number(t.id),scope:t.scope??[],monitor_id:t.monitor_id??null,monitor_tags:t.monitor_tags??["*"],message:t.message??null,start:t.start??0,end:t.end??null,active:t.active!==!1,disabled:!!t.disabled,canceled:t.canceled??null,timezone:t.timezone??"UTC"}}function z(t){return{type:"rum_application",id:String(t.id),attributes:{application_id:t.applicationId??"",client_token:t.clientToken??"",name:t.name??"",type:t.appType??"browser",created_at:Date.parse(String(t.createdAt??0))||0,created_by_handle:"twin@twin.test",updated_at:Date.parse(String(t.updatedAt??t.createdAt??0))||0,updated_by_handle:"twin@twin.test",org_id:1,hash:null,is_active:!0}}}function dt(t){return{type:"api_keys",id:String(t.id),attributes:{name:t.name??"",key:t.key??"",last4:String(t.key??"").slice(-4),created_at:t.created_at??null,modified_at:t.modified_at??null}}}function ut(t){return{type:"users",id:String(t.id),attributes:{name:t.name??"",handle:t.handle??"",email:t.email??"",created_at:t.created_at??null,disabled:!1,verified:!0,status:"Active"}}}function St(t){return{type:t.metricType??"gauge",description:t.description??"",short_name:t.short_name??"",integration:null,statsd_interval:t.statsd_interval??null,per_unit:t.per_unit??null,unit:t.unit??null}}function pt(t,r,e){let o=(t??"").trim();if(!o||o==="*")return!0;for(let a of o.split(/\s+/)){if(!a)continue;let n=a.indexOf(":");if(n>0){let i=a.slice(0,n),s=i.startsWith("@")?i.slice(1):i,u=a.slice(n+1);if(!Wt(r,s,u))return!1}else if(!e.toLowerCase().includes(a.toLowerCase()))return!1}return!0}function Wt(t,r,e){let o=Vt(t,r.split("."));return o===void 0?!1:Array.isArray(o)?o.some(a=>String(a)===e):String(o)===e}function Vt(t,r){let e=t;for(let o of r){if(!e||typeof e!="object")return;e=e[o]}return e}async function ft(t){t.readOnly||await q(t.root,t.occurredAt);let r=t.method.toUpperCase(),{path:e,params:o}=Tt(t.path),a=o.get("ddforward");if(a){let u=Tt(a.startsWith("/")?a:`/${a}`);e=u.path,o=u.params}let n=e.replace(/\/+$/,"")||"/",i=n.replace(/^\/+/,"").split("/").filter(Boolean);if(t.readOnly&&r!=="GET")return d("twin is read-only; omit readOnly to accept writes",405);if(n==="/api/v2/rum")return r!=="POST"?d("Method not allowed",405):zt(t,o);if(n==="/api/v2/logs")return r!=="POST"?d("Method not allowed",405):Qt(t,o);if(i[0]==="v1"&&i[1]==="input"&&i.length===3)return r!=="POST"?d("Method not allowed",405):Zt(t,i[2]);if(n==="/api/v1/series"||n==="/api/v2/series"||n==="/api/v1/distribution_points")return r!=="POST"?d("Method not allowed",405):qt(t,o,n);if(n==="/api/v1/check_run")return r!=="POST"?d("Method not allowed",405):te(t,o);if(n==="/api/v1/validate")return r!=="GET"?d("Method not allowed",405):I(x(t.headers,o),t.root)?{status:200,body:{valid:!0}}:wt();let s=Yt(t,o);return s?n==="/api/v2/rum/events"&&r==="GET"?It(t,o,Et(o)):n==="/api/v2/rum/events/search"&&r==="POST"?It(t,o,Dt(g(t))):n.startsWith("/api/v2/rum/applications")?ge(r,i.slice(4),t):n==="/api/v2/logs/events"&&r==="GET"?kt(t,Et(o)):n==="/api/v2/logs/events/search"&&r==="POST"?kt(t,Dt(g(t))):n==="/api/v1/query"&&r==="GET"?ee(t,o):n==="/api/v1/metrics"&&r==="GET"?re(t,o):i[0]==="api"&&i[1]==="v1"&&i[2]==="metrics"&&i.length===4?ne(r,i[3],t):n==="/api/v1/search"&&r==="GET"?oe(t,o):i[0]==="api"&&i[1]==="v1"&&i[2]==="events"?ie(r,i.slice(3),t,o,s):i[0]==="api"&&i[1]==="v1"&&i[2]==="monitor"?se(r,i.slice(3),t,o):i[0]==="api"&&i[1]==="v1"&&i[2]==="dashboard"?ue(r,i.slice(3),t):i[0]==="api"&&i[1]==="v1"&&i[2]==="hosts"?ce(r,i.slice(3),t,o):i[0]==="api"&&i[1]==="v1"&&i[2]==="host"?le(r,i.slice(3),t):n==="/api/v1/tags/hosts"&&r==="GET"?pe(t):i[0]==="api"&&i[1]==="v1"&&i[2]==="slo"?fe(r,i.slice(3),t):i[0]==="api"&&i[1]==="v1"&&i[2]==="downtime"?me(r,i.slice(3),t):i[0]==="api"&&i[1]==="v2"&&i[2]==="api_keys"?ye(r,i.slice(3),t,s):i[0]==="api"&&i[1]==="v2"&&i[2]==="users"?he(r,i.slice(3),t):d(`${n} not found`,404):wt()}function Yt(t,r){let e=I(x(t.headers,r),t.root);if(!e)return;let o=Z(t.headers,r);return o&&o===e.appKey?e:void 0}async function zt(t,r){let e=x(t.headers,r),o=H(e,t.root),a=o?void 0:I(e,t.root);if(!o&&!a)return F();let n=o??Jt(t.root);if(!n)return F();let i=G(t.body);if(!i||i.some(u=>typeof u.type!="string"||!u.type))return d("Invalid payload",400);let s={root:t.root,...t.occurredAt?{occurredAt:t.occurredAt}:{}};for(let u of i)await et(n,u,s);return{status:202,body:{}}}function Jt(t){let r=m("rum_application",t)[0];if(r)return{id:String(r.id),applicationId:String(r.applicationId),clientToken:String(r.clientToken),name:String(r.name??"")}}async function Qt(t,r){let e=x(t.headers,r),o=I(e,t.root)??Xt(e,t.root);if(!o)return F();let a=G(t.body);if(!a||a.some(i=>typeof i.message!="string"))return d("Invalid payload",400);let n={root:t.root,...t.occurredAt?{occurredAt:t.occurredAt}:{}};for(let i of a)await W(o,i,n);return{status:202,body:{}}}function Xt(t,r){if(!H(t,r))return;let o=m("org",r)[0];return o?{id:String(o.id),apiKey:String(o.apiKey),appKey:String(o.appKey),name:String(o.name??""),publicId:String(o.publicId??"")}:void 0}async function Zt(t,r){let e=I(r,t.root);if(!e)return F();let o=G(t.body);if(!o||o.some(n=>typeof n.message!="string"))return d("Invalid payload",400);let a={root:t.root,...t.occurredAt?{occurredAt:t.occurredAt}:{}};for(let n of o)await W(e,n,a);return{status:200,body:{}}}async function qt(t,r,e){let o=I(x(t.headers,r),t.root);if(!o)return F();let a=g(t),n=Array.isArray(a.series)?a.series:void 0;if(!n||n.length===0)return d("Invalid payload: expected a non-empty `series` array",400);for(let s of n){if(!s||typeof s!="object"||Array.isArray(s))return d("Invalid payload",400);let u=s;if(typeof u.metric!="string"||!u.metric||V(u.points)===void 0)return d("Invalid payload: each series needs a `metric` and well-formed `points`",400)}let i={root:t.root,...t.occurredAt?{occurredAt:t.occurredAt}:{}};for(let s of n)if(!await rt(o,s,i))return d("Invalid payload: each series needs a `metric` and well-formed `points`",400);return e==="/api/v2/series"?{status:202,body:{errors:[]}}:{status:202,body:{status:"ok"}}}async function te(t,r){let e=I(x(t.headers,r),t.root);if(!e)return F();let o=G(t.body);if(!o||o.length===0)return d("Invalid payload",400);if(o.some(n=>!ot(n)))return d("Invalid payload: a check needs `check`, `host_name` and a 0-3 `status`",400);let a={root:t.root,...t.occurredAt?{occurredAt:t.occurredAt}:{}};for(let n of o)if(!await it(e,n??{},a))return d("Invalid payload: a check needs `check`, `host_name` and a 0-3 `status`",400);return{status:202,body:{status:"ok"}}}function Et(t){return{query:t.get("filter[query]")??"*",...t.get("filter[from]")?{from:Date.parse(t.get("filter[from]"))}:{},...t.get("filter[to]")?{to:Date.parse(t.get("filter[to]"))}:{},limit:Number(t.get("page[limit]"))||50}}function Dt(t){let r=t.filter??{};return{query:typeof r.query=="string"?r.query:"*",...r.from?{from:Date.parse(String(r.from))}:{},...r.to?{to:Date.parse(String(r.to))}:{},limit:Number((t.page??{}).limit)||50}}function Nt(t,r){let e=Date.parse(String(t));return Number.isNaN(e)?!0:!(r.from!==void 0&&Number.isFinite(r.from)&&e<r.from||r.to!==void 0&&Number.isFinite(r.to)&&e>r.to)}function It(t,r,e){return{status:200,body:{data:m("rum_event",t.root).filter(a=>Nt(a.timestamp,e)).filter(a=>pt(e.query,{type:a.eventType??"",service:a.service,version:a.version,source:a.source,view:{id:a.viewId,url:a.viewUrl,name:a.viewName},session:{id:a.sessionId,type:a.sessionType},application:{id:a.applicationId},...a.attributes??{}},`${a.viewUrl??""} ${a.service??""} ${a.viewName??""}`)).sort((a,n)=>String(n.timestamp).localeCompare(String(a.timestamp))).slice(0,e.limit).map($t),links:{},meta:{elapsed:0,request_id:"twin",status:"done",page:{after:null}}}}}function kt(t,r){return{status:200,body:{data:m("log",t.root).filter(o=>Nt(o.timestamp,r)).filter(o=>pt(r.query,{status:o.status,service:o.service,host:o.hostname,source:o.ddsource,...o.attributes??{}},String(o.message??""))).sort((o,a)=>String(a.timestamp).localeCompare(String(o.timestamp))).slice(0,r.limit).map(Bt),links:{},meta:{elapsed:0,request_id:"twin",status:"done",page:{after:null}}}}}var Ot={avg:t=>t.reduce((r,e)=>r+e,0)/t.length,sum:t=>t.reduce((r,e)=>r+e,0),max:t=>Math.max(...t),min:t=>Math.min(...t),count:t=>t.length};function Rt(t){let r=/^([a-z]+):([A-Za-z0-9_.\-*]+)\{([^}]*)\}$/.exec((t??"").trim());if(!r)return;let[,e,o,a]=r;if(!(e in Ot))return;let n=a.split(",").map(i=>i.trim()).filter(i=>i&&i!=="*");return{aggregator:e,metric:o,scope:n}}function ee(t,r){let e=r.get("query")??"",o=r.get("from"),a=r.get("to");if(!e)return d("Invalid query: `query` is required",400);if(o===null||a===null)return d("Invalid query: `from` and `to` are required epoch seconds",400);let n=Number(o),i=Number(a);if(!Number.isFinite(n)||!Number.isFinite(i))return d("Invalid query: `from` and `to` are required epoch seconds",400);let s=Rt(e);if(!s)return d(`Invalid query: ${e}`,400);let u=Ot[s.aggregator],c=m("metric_series",t.root).filter(S=>{if(String(S.metric)!==s.metric)return!1;let v=S.tags??[];return s.scope.every(b=>v.includes(b))}),f=new Map;for(let S of c)for(let[v,b]of S.points??[]){if(v<n||v>i)continue;let h=f.get(v)??[];h.push(b),f.set(v,h)}let _=[...f.entries()].sort((S,v)=>S[0]-v[0]).map(([S,v])=>[S*1e3,u(v)]),j=c.length===0?[]:[{unit:null,query_index:0,aggr:s.aggregator==="avg"?null:s.aggregator,metric:s.metric,tag_set:s.scope,expression:e,scope:s.scope.length?s.scope.join(","):"*",interval:1,length:_.length,start:_.length?_[0][0]:n*1e3,end:_.length?_[_.length-1][0]:i*1e3,pointlist:_,display_name:s.metric,attributes:{}}];return{status:200,body:{status:"ok",res_type:"time_series",resp_version:1,query:e,from_date:n*1e3,to_date:i*1e3,series:j,values:[],times:[],message:"",group_by:[]}}}function re(t,r){let e=r.get("from");if(e===null)return d("Invalid parameters: `from` is required",400);let o=Number(e);if(!Number.isFinite(o))return d("Invalid parameters: `from` must be epoch seconds",400);let a=m("metric_def",t.root).filter(n=>Date.parse(String(n.lastSeenAt??0))/1e3>=o).map(n=>String(n.name)).sort();return{status:200,body:{from:String(o),metrics:a}}}async function ne(t,r,e){let o=T("metric_def",r,e.root);if(!o)return p("Metric");if(t==="GET")return{status:200,body:St(o)};if(t==="PUT"){let a=g(e),n=await y("metric_def",r,{...O(o),...a.description!==void 0?{description:a.description}:{},...a.short_name!==void 0?{short_name:a.short_name}:{},...a.unit!==void 0?{unit:a.unit}:{},...a.per_unit!==void 0?{per_unit:a.per_unit}:{},...a.type!==void 0?{metricType:a.type}:{}},"metric_def.update",e.root,e.occurredAt);return{status:200,body:St(n)}}return d("Method not allowed",405)}function oe(t,r){let e=r.get("q")??"",o=/^metrics:(.*)$/.exec(e);if(!o)return d("Invalid parameters: `q` must be `metrics:<substring>`",400);let a=o[1];return{status:200,body:{results:{metrics:m("metric_def",t.root).map(i=>String(i.name)).filter(i=>i.includes(a)).sort()}}}}async function ie(t,r,e,o,a){if(r.length===0){if(t==="POST"){let n=g(e);if(typeof n.title!="string"||!n.title||typeof n.text!="string"||!n.text)return d("Invalid payload: `title` and `text` are required",400);let i=String(At+A("event",e.root,c=>P(c)===void 0?void 0:P(c)-At)),s=e.occurredAt??w(),u=await y("event",i,{orgId:a.id,title:n.title,text:n.text,tags:Array.isArray(n.tags)?n.tags:[],priority:n.priority??"normal",alert_type:n.alert_type??"info",host:n.host??null,source_type_name:n.source_type_name??"my_apps",date_happened:Number.isFinite(Number(n.date_happened))?Number(n.date_happened):Math.floor(Date.parse(s)/1e3),aggregation_key:n.aggregation_key??null},"event.create",e.root,e.occurredAt);return{status:202,body:{status:"ok",event:at(u)}}}if(t==="GET"){let n=o.get("start"),i=o.get("end");if(n===null||i===null)return d("Invalid parameters: `start` and `end` are required epoch seconds",400);let s=Number(n),u=Number(i);return!Number.isFinite(s)||!Number.isFinite(u)?d("Invalid parameters: `start` and `end` are required epoch seconds",400):{status:200,body:{events:m("event",e.root).filter(f=>Number(f.date_happened)>=s&&Number(f.date_happened)<=u).sort((f,_)=>Number(_.date_happened)-Number(f.date_happened)).map(at)}}}return d("Method not allowed",405)}if(r.length===1&&t==="GET"){let n=T("event",r[0],e.root);return n?{status:200,body:{event:at(n)}}:p("Event")}return d("Method not allowed",405)}var ae=new Set(["metric alert","query alert","service check","event alert","event-v2 alert","log alert","composite","process alert","rum alert","trace-analytics alert","slo alert","audit alert","ci-pipelines alert","ci-tests alert","error-tracking alert","database-monitoring alert"]);function ct(t){if(typeof t.type!="string"||!ae.has(t.type))return`The value provided for parameter 'type' is invalid: ${t.type}`;if(typeof t.query!="string"||!t.query.trim())return"The value provided for parameter 'query' is invalid"}async function se(t,r,e,o){if(r[0]==="validate"&&r.length===1){if(t!=="POST")return d("Method not allowed",405);let i=ct(g(e));return i?d(i,400):{status:200,body:{}}}if(r[0]==="search"&&r.length===1){if(t!=="GET")return d("Method not allowed",405);let i=(o.get("query")??"").trim(),s=m("monitor",e.root),u=i?s.filter(c=>de(i,c)):s;return{status:200,body:{monitors:u.map(L),counts:{status:[],type:[],muted:[],tag:[]},metadata:{total_count:u.length,page:0,page_count:u.length,per_page:30}}}}if(r.length===0){if(t==="POST"){let i=g(e),s=ct(i);if(s)return d(s,400);let u=String(A("monitor",e.root,P)),c=e.occurredAt??w(),f=await y("monitor",u,{name:i.name??i.query,monitorType:i.type,query:i.query,message:i.message??"",tags:Array.isArray(i.tags)?i.tags:[],options:i.options&&typeof i.options=="object"?i.options:{},priority:i.priority??null,multi:String(i.query).includes(" by "),overall_state:"OK",created:c,modified:c},"monitor.create",e.root,e.occurredAt);return{status:200,body:L(f)}}if(t==="GET"){let i=o.get("monitor_tags")??o.get("tags"),s=m("monitor",e.root);return i&&(s=s.filter(u=>(u.tags??[]).includes(i))),{status:200,body:s.map(L)}}return d("Method not allowed",405)}let a=r[0],n=T("monitor",a,e.root);if(r.length===1){if(t==="GET")return n?{status:200,body:L(n)}:p("Monitor");if(t==="PUT"){if(!n)return p("Monitor");let i=g(e);if(i.type!==void 0||i.query!==void 0){let u=ct({type:i.type??n.monitorType,query:i.query??n.query});if(u)return d(u,400)}let s=await y("monitor",a,{...O(n),...i.name!==void 0?{name:i.name}:{},...i.type!==void 0?{monitorType:i.type}:{},...i.query!==void 0?{query:i.query}:{},...i.message!==void 0?{message:i.message}:{},...i.tags!==void 0?{tags:i.tags}:{},...i.options!==void 0?{options:i.options}:{},...i.priority!==void 0?{priority:i.priority}:{},modified:e.occurredAt??w()},"monitor.update",e.root,e.occurredAt);return{status:200,body:L(s)}}return t==="DELETE"?n?(await U("monitor",a,"monitor.delete",e.root,e.occurredAt),{status:200,body:{deleted_monitor_id:Number(a)}}):p("Monitor"):d("Method not allowed",405)}if(r.length===2&&(r[1]==="mute"||r[1]==="unmute")){if(t!=="POST")return d("Method not allowed",405);if(!n)return p("Monitor");let i={...n.options??{}};r[1]==="mute"?i.silenced={"*":null}:delete i.silenced;let s=await y("monitor",a,{...O(n),options:i},"monitor.update",e.root,e.occurredAt);return{status:200,body:L(s)}}return d("Method not allowed",405)}function Mt(t){return(t.match(/[^\s"]*"[^"]*"|[^\s"]+/g)??[]).map(r=>r.replace(/"/g,""))}function de(t,r){for(let e of Mt(t)){let o=e.indexOf(":");if(o>0){let a=e.slice(0,o),n=e.slice(o+1);if(a==="tag"){if(!(r.tags??[]).includes(n))return!1;continue}if(a==="type"){if(String(r.monitorType)!==n)return!1;continue}if(a==="status"){if(String(r.overall_state)!==n)return!1;continue}return!1}if(!String(r.name??"").toLowerCase().includes(e.toLowerCase()))return!1}return!0}async function ue(t,r,e){if(r.length===0){if(t==="POST"){let n=g(e);if(typeof n.title!="string"||!n.title)return d("The value provided for parameter 'title' is invalid",400);if(n.layout_type!=="ordered"&&n.layout_type!=="free")return d("The value provided for parameter 'layout_type' is invalid",400);let i=A("dashboard",e.root,N),s=`twn-dsh-${String(i).padStart(3,"0")}`,u=e.occurredAt??w(),c=await y("dashboard",s,{title:n.title,description:n.description??null,layout_type:n.layout_type,widgets:Array.isArray(n.widgets)?n.widgets:[],template_variables:Array.isArray(n.template_variables)?n.template_variables:[],notify_list:n.notify_list??null,reflow_type:n.reflow_type??null,tags:n.tags??null,created_at:u,modified_at:u},"dashboard.create",e.root,e.occurredAt);return{status:200,body:J(c)}}return t==="GET"?{status:200,body:{dashboards:m("dashboard",e.root).map(Kt)}}:d("Method not allowed",405)}let o=r[0],a=T("dashboard",o,e.root);if(t==="GET")return a?{status:200,body:J(a)}:p("Dashboard");if(t==="PUT"){if(!a)return p("Dashboard");let n=g(e);if(n.layout_type!==void 0&&n.layout_type!=="ordered"&&n.layout_type!=="free")return d("The value provided for parameter 'layout_type' is invalid",400);let i=await y("dashboard",o,{...O(a),...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...n.layout_type!==void 0?{layout_type:n.layout_type}:{},...n.widgets!==void 0?{widgets:n.widgets}:{},...n.tags!==void 0?{tags:n.tags}:{},modified_at:e.occurredAt??w()},"dashboard.update",e.root,e.occurredAt);return{status:200,body:J(i)}}return t==="DELETE"?a?(await U("dashboard",o,"dashboard.delete",e.root,e.occurredAt),{status:200,body:{deleted_dashboard_id:o}}):p("Dashboard"):d("Method not allowed",405)}function ce(t,r,e,o){if(t!=="GET")return d("Method not allowed",405);let a=m("host",e.root);if(r[0]==="totals")return{status:200,body:{total_active:a.length,total_up:a.filter(s=>s.up!==!1).length}};if(r.length>0)return d(`/api/v1/hosts/${r.join("/")} not found`,404);let n=o.get("filter"),i=n?a.filter(s=>(s.tags??[]).includes(n)||String(s.name)===n):a;return{status:200,body:{host_list:i.map(Ht),total_matching:i.length,total_returned:i.length}}}async function le(t,r,e){if(t!=="POST"||r.length!==2)return d("Method not allowed",405);let[o,a]=r;if(a!=="mute"&&a!=="unmute")return d(`/api/v1/host/${r.join("/")} not found`,404);let n=T("host",o,e.root);return n?(await y("host",o,{...O(n),muted:a==="mute"},"host.update",e.root,e.occurredAt),{status:200,body:{action:a==="mute"?"Muted":"Unmuted",hostname:o,message:null,end:null}}):p("Host")}function pe(t){let r={};for(let e of m("host",t.root))for(let o of e.tags??[])(r[o]??=[]).push(String(e.name));return{status:200,body:{tags:r}}}async function fe(t,r,e){if(r.length===0){if(t==="POST"){let n=g(e);if(typeof n.name!="string"||!n.name)return d("The value provided for parameter 'name' is invalid",400);if(n.type!=="metric"&&n.type!=="monitor"&&n.type!=="time_slice")return d("The value provided for parameter 'type' is invalid",400);if(!Array.isArray(n.thresholds)||n.thresholds.length===0)return d("The value provided for parameter 'thresholds' is invalid",400);let i=`slo${String(A("slo",e.root,N)).padStart(29,"0")}`,s=e.occurredAt??w(),u=await y("slo",i,{name:n.name,description:n.description??null,sloType:n.type,query:n.query??null,thresholds:n.thresholds,tags:Array.isArray(n.tags)?n.tags:[],monitor_ids:Array.isArray(n.monitor_ids)?n.monitor_ids:[],created_at:s,modified_at:s},"slo.create",e.root,e.occurredAt);return{status:200,body:{data:[Y(u)],errors:[]}}}return t==="GET"?{status:200,body:{data:m("slo",e.root).map(Y),errors:[]}}:d("Method not allowed",405)}let o=r[0],a=T("slo",o,e.root);if(t==="GET")return a?{status:200,body:{data:Y(a),errors:[]}}:p("SLO");if(t==="PUT"){if(!a)return p("SLO");let n=g(e),i=await y("slo",o,{...O(a),...n.name!==void 0?{name:n.name}:{},...n.description!==void 0?{description:n.description}:{},...n.thresholds!==void 0?{thresholds:n.thresholds}:{},...n.tags!==void 0?{tags:n.tags}:{},modified_at:e.occurredAt??w()},"slo.update",e.root,e.occurredAt);return{status:200,body:{data:[Y(i)],errors:[]}}}return t==="DELETE"?a?(await U("slo",o,"slo.delete",e.root,e.occurredAt),{status:200,body:{data:[o],errors:[]}}):p("SLO"):d("Method not allowed",405)}async function me(t,r,e){if(r.length===0){if(t==="POST"){let n=g(e);if(!Array.isArray(n.scope)&&typeof n.scope!="string")return d("The value provided for parameter 'scope' is invalid",400);let i=String(A("downtime",e.root,P)),s=e.occurredAt??w(),u=await y("downtime",i,{scope:Array.isArray(n.scope)?n.scope:[n.scope],monitor_id:n.monitor_id??null,monitor_tags:Array.isArray(n.monitor_tags)?n.monitor_tags:["*"],message:n.message??null,start:Number.isFinite(Number(n.start))?Number(n.start):Math.floor(Date.parse(s)/1e3),end:Number.isFinite(Number(n.end))?Number(n.end):null,active:!0,disabled:!1,canceled:null,timezone:n.timezone??"UTC"},"downtime.create",e.root,e.occurredAt);return{status:200,body:st(u)}}return t==="GET"?{status:200,body:m("downtime",e.root).map(st)}:d("Method not allowed",405)}let o=r[0],a=T("downtime",o,e.root);return t==="GET"?a?{status:200,body:st(a)}:p("Downtime"):t==="DELETE"?a?(await U("downtime",o,"downtime.cancel",e.root,e.occurredAt),{status:204,body:null}):p("Downtime"):d("Method not allowed",405)}async function ge(t,r,e){if(r.length===0){if(t==="POST"){let n=g(e).data?.attributes??{};if(typeof n.name!="string"||!n.name)return d("The value provided for parameter 'name' is invalid",400);let i=A("rum_application",e.root,N),s=`00000000-0000-4000-8000-${String(i).padStart(12,"0")}`,u=e.occurredAt??w(),c=await y("rum_application",s,{applicationId:s,clientToken:`pub${String(i).padStart(32,"0")}`,name:n.name,appType:n.type??"browser",orgId:"org_twin",createdAt:u,updatedAt:u},"rum_application.create",e.root,e.occurredAt);return{status:200,body:{data:z(c)}}}return t==="GET"?{status:200,body:{data:m("rum_application",e.root).map(z)}}:d("Method not allowed",405)}let o=r[0],a=T("rum_application",o,e.root);if(t==="GET")return a?{status:200,body:{data:z(a)}}:p("RUM application");if(t==="PATCH"){if(!a)return p("RUM application");let n=g(e).data?.attributes??{},i=await y("rum_application",o,{...O(a),...n.name!==void 0?{name:n.name}:{},updatedAt:e.occurredAt??w()},"rum_application.update",e.root,e.occurredAt);return{status:200,body:{data:z(i)}}}return t==="DELETE"?a?(await U("rum_application",o,"rum_application.delete",e.root,e.occurredAt),{status:204,body:null}):p("RUM application"):d("Method not allowed",405)}async function ye(t,r,e,o){if(r.length===0){if(t==="POST"){let i=g(e).data?.attributes??{};if(typeof i.name!="string"||!i.name)return d("The value provided for parameter 'name' is invalid",400);let s=A("api_key",e.root,N),u=`00000000-0000-4000-9000-${String(s).padStart(12,"0")}`,c=e.occurredAt??w(),f=await y("api_key",u,{orgId:o.id,name:i.name,key:`dd${String(s).padStart(30,"0")}`,created_at:c,modified_at:c},"api_key.create",e.root,e.occurredAt);return{status:201,body:{data:dt(f)}}}if(t==="GET"){let i=m("api_key",e.root).map(dt);return{status:200,body:{data:i,meta:{page:{total_count:i.length,total_filtered_count:i.length}}}}}return d("Method not allowed",405)}let a=r[0],n=T("api_key",a,e.root);return t==="GET"?n?{status:200,body:{data:dt(n)}}:p("API key"):t==="DELETE"?n?(await U("api_key",a,"api_key.delete",e.root,e.occurredAt),{status:204,body:null}):p("API key"):d("Method not allowed",405)}async function he(t,r,e){if(r.length===0){if(t==="POST"){let n=g(e).data?.attributes??{};if(typeof n.email!="string"||!n.email.includes("@"))return d("The value provided for parameter 'email' is invalid",400);let i=A("user",e.root,N),s=`00000000-0000-4000-a000-${String(i).padStart(12,"0")}`,u=await y("user",s,{email:n.email,name:n.name??"",handle:n.email,created_at:e.occurredAt??w()},"user.create",e.root,e.occurredAt);return{status:201,body:{data:ut(u)}}}if(t==="GET"){let n=m("user",e.root).map(ut);return{status:200,body:{data:n,meta:{page:{total_count:n.length,total_filtered_count:n.length}}}}}return d("Method not allowed",405)}let o=r[0],a=T("user",o,e.root);return t==="GET"?a?{status:200,body:{data:ut(a)}}:p("User"):d("Method not allowed",405)}import{serveHttp as Oe}from"../../engine/v2/volter_world-core.mjs";import{worldNow as _e,statefulTwinManifest as ve}from"../../engine/v2/volter_world-core.mjs";function mt(t={}){let r=t.readOnly??!1;return async function(o){let a=new URL(o.url);if(o.method==="GET"&&a.pathname.replace(/\/+$/,"")==="/twin")return Response.json(ve({vendor:"datadog",twinOf:"the Datadog API",stores:"monitors, events and metric submissions the Ops watch reads"}));let n=o.method==="GET"?"":await o.text(),i={};o.headers.forEach((c,f)=>{i[f.toLowerCase()]=c});let{status:s,body:u}=await ft({method:o.method,path:a.pathname+(a.search||""),body:n,headers:i,readOnly:r,occurredAt:_e(),...t.root!==void 0?{root:t.root}:{}});return s===204?new Response(null,{status:204}):new Response(JSON.stringify(u),{status:s,headers:{"content-type":"application/json"}})}}import{assertBudgetGuardIntact as Be,observeResources as Ke}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as be,rateBudgetPath as Le,rateBudgetWeight as Fe,RateBudget as Ue}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as Ft}from"../../engine/v2/volter_world-core.mjs";var Ae="datadog",Pt=6e4,Gt=60,Lt=300,C={search:4,query:4,other:2},gt={windowMs:Pt,ceiling:Gt,defaultWeight:C.other,maxRetryAfterSeconds:Lt,rules:[{match:"/(logs|rum|spans)/events(/|$)",weight:C.search},{match:"/events/search(/|$)",weight:C.search},{match:"/query(/|$)",weight:C.query}],reason:"Datadog publishes per-endpoint API rate limits (docs.datadoghq.com/api/latest/rate-limits/) and echoes the live allowance back on every response as X-RateLimit-Limit / X-RateLimit-Period / X-RateLimit-Remaining / X-RateLimit-Reset. THIS BUILD DID NOT FETCH THAT PAGE, so no specific Datadog scalar is asserted here and none is used to justify anything: the ceiling sits EXACTLY at the kernel's undeclared fallback (60 weighted units / 60s at defaultWeight 2 = 30 calls a minute), which is the honest position when a limit is real but unverified. Event-index search (/api/v2/{logs,rum,spans}/events and .../events/search) and timeseries query (/api/v1/query, /api/v2/query/*) cost 4 rather than 2 \u2014 a stated SIZING judgement about which calls are structurally expensive on an observability backend, not a claim about a published Datadog ratio, and one that can only tighten the guard. The ledger is keyed by TOKEN while Datadog limits per ORGANISATION, so two keys in one org get two allowances (too loose) and one key spanning orgs gets one (too tight); the org id is not visible to this factory, and the 429 / X-RateLimit-Remaining: 0 cooldown covers the loose direction. The window bounds the 60s AVERAGE and does not pace."};be(Ae,gt);import{bundleClient as Ye,fileResponse as ze,filePathOf as Je}from"../../engine/v2/volter_world-core.mjs";import{serveHttp as Xe}from"../../engine/v2/volter_world-core.mjs";export{mt as createTwinFetch};
|