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-langfuse
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-langfuse 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,2 @@
|
|
|
1
|
+
import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
|
|
2
|
+
import{applyTwinWrite as Xe,projectResources as Ze,worldNow as et,runAsVendorMove as tt}from"../../engine/v2/volter_world-core.mjs";import{applyTwinWrite as Fe,projectResources as Ke,worldNow as Be}from"../../engine/v2/volter_world-core.mjs";var ye="langfuse",R="org-twin",G="proj-twin",Ae="twin",J="pk-lf-00000000-0000-4000-8000-000000000000",Y="sk-lf-00000000-0000-4000-8000-000000000000",Z="3.0.0-twin",L="default",be=["DEBUG","DEFAULT","WARNING","ERROR"],Ie=["trace-create","score-create","span-create","span-update","generation-create","generation-update","event-create","sdk-log","observation-create","observation-update"];function ee(e){if(!e)return;let n=/^Basic\s+(.+)$/i.exec(e.trim());if(!n)return;let r;try{r=Buffer.from(n[1],"base64").toString("utf8")}catch{return}let a=r.indexOf(":");if(!(a<0))return{publicKey:r.slice(0,a),secretKey:r.slice(a+1)}}function C(e,n){let r=ee(e);if(!r||!r.publicKey||!r.secretKey)return;let a=_("api_key",n).find(t=>t.publicKey===r.publicKey&&t.secretKey===r.secretKey&&!t.deleted);if(a)return{publicKey:String(a.publicKey),projectId:String(a.projectId),orgId:String(a.orgId??R)}}function _(e,n){return Ke(ye,n).filter(r=>r.type===e)}async function x(e,n,r,a,t,o){let{resource:s}=await Fe(ye,{operation:a,subjectType:e,subjectId:n,fields:r,...o?{occurredAt:o}:{},actor:{kind:"system"}},t);return s}async function te(e,n){if(_("api_key",e).some(a=>a.publicKey===J))return;let r=n??"1970-01-01T00:00:00.000Z";await x("project",G,{name:Ae,orgId:R,metadata:{},retentionDays:null,createdAt:r},"project.create",e,n),await x("api_key","key-twin",{publicKey:J,secretKey:Y,displaySecretKey:P(Y),projectId:G,orgId:R,note:"twin default key",createdAt:r,lastUsedAt:null},"api_key.create",e,n)}var He=/^(pk|sk)-lf-[A-Za-z0-9-]{16,}$/;async function he(e,n,r){let a=C(e,n);if(a)return a;let t=ee(e);if(!t||!t.publicKey||!t.secretKey||_("api_key",n).some(s=>s.publicKey===t.publicKey)||!He.test(t.publicKey)||!t.secretKey.startsWith("sk-lf-")||t.secretKey.length<22)return;let o=r??Be();return await x("api_key",`key-${t.publicKey.slice(-12)}`,{publicKey:t.publicKey,secretKey:t.secretKey,displaySecretKey:P(t.secretKey),projectId:G,orgId:R,note:"auto-provisioned from presented credentials (attach posture)",createdAt:o,lastUsedAt:null},"api_key.create",n,r),C(e,n)}function P(e){return`${e.slice(0,6)}...${e.slice(-4)}`}function O(e,n){if(e instanceof Date)return e.toISOString();if(typeof e=="number")return new Date(e).toISOString();if(typeof e=="string"&&e){let r=new Date(e);if(!Number.isNaN(r.getTime()))return r.toISOString()}return n}function A(e){return typeof e=="string"&&e.length>0?e:null}function ze(e){let n=String(e??"").toUpperCase();return be.includes(n)?n:"DEFAULT"}function V(e){let n=typeof e=="string"?e.trim():"";return!n||!/^[a-z0-9_-]+$/.test(n)||n.startsWith("langfuse")?L:n}function We(e){let n=a=>{let t=(2166136261^a)>>>0;for(let o=0;o<e.length;o+=1)t^=e.charCodeAt(o),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")},r=`${n(1)}${n(2)}${n(3)}${n(4)}`;return`${r.slice(0,8)}-${r.slice(8,12)}-4${r.slice(13,16)}-8${r.slice(17,20)}-${r.slice(20,32)}`}function S(e,n,r,a=""){let t=new Set(_(e,r).map(o=>String(o.id)));for(let o=0;o<1e3;o+=1){let s=`${a}${We(`${e}:${n}:${t.size}:${o}`)}`;if(!t.has(s))return s}throw new Error(`langfuse: could not mint a free ${e} id`)}function Q(e){let n={},r=(o,s)=>{typeof s=="number"&&Number.isFinite(s)&&(n[o]=s)},a=e.usageDetails;if(a&&typeof a=="object")for(let[o,s]of Object.entries(a))r(o,s);let t=e.usage;if(t&&typeof t=="object"){let o=t;r("input",o.input??o.promptTokens??o.prompt_tokens??o.inputTokens??o.input_tokens),r("output",o.output??o.completionTokens??o.completion_tokens??o.outputTokens??o.output_tokens),r("total",o.total??o.totalTokens??o.total_tokens)}if(n.total===void 0){let o=Object.entries(n).filter(([s])=>s!=="total").reduce((s,[,i])=>s+i,0);o>0&&(n.total=o)}return n}function Te(e,n,r){return e?_("model",r).filter(t=>{if(t.deleted||t.startDate&&Date.parse(String(t.startDate))>Date.parse(n))return!1;let o=ne(String(t.matchPattern));return o?o.test(e):!1}).sort((t,o)=>Date.parse(String(o.startDate??0))-Date.parse(String(t.startDate??0)))[0]:void 0}function ne(e){let n=e,r="",a=/^\(\?([imsx]+)\)/.exec(n);if(a){n=n.slice(a[0].length);for(let t of a[1])"ims".includes(t)&&!r.includes(t)&&(r+=t)}try{return new RegExp(n,r)}catch{return}}function Se(e,n){if(!e)return{costDetails:{},modelId:null};let r=e.prices&&typeof e.prices=="object"?e.prices:{},a={};for(let[o,s]of Object.entries(n)){if(o==="total")continue;let i=r[o],u=typeof i=="number"?i:i&&typeof i=="object"?Number(i.price):NaN;Number.isFinite(u)&&(a[o]=ge(s*u))}let t=Object.values(a).reduce((o,s)=>o+s,0);return Object.keys(a).length>0&&(a.total=ge(t)),{costDetails:a,modelId:String(e.id)}}function ge(e){return Number(e.toFixed(12))}async function Je(e,n,r,a,t){e&&(_("session",t).some(o=>o.id===e&&!o.deleted)||await x("session",e,{createdAt:a,projectId:n,environment:r},"session.create",t,a))}async function q(e,n,r){let a=A(e.id)??S("trace",r.occurredAt,r.root),t=_("trace",r.root).find(u=>u.id===a&&!u.deleted),o=e.environment!==void 0||!t?V(e.environment):String(t.environment),s=e.sessionId!==void 0?A(e.sessionId):t?A(t.sessionId):null,i={projectId:n.projectId,timestamp:e.timestamp!==void 0?O(e.timestamp,r.occurredAt):t?.timestamp??r.occurredAt,name:e.name!==void 0?A(e.name):t?.name??null,userId:e.userId!==void 0?A(e.userId):t?.userId??null,sessionId:s,release:e.release!==void 0?A(e.release):t?.release??null,version:e.version!==void 0?A(e.version):t?.version??null,input:e.input!==void 0?e.input:t?.input??null,output:e.output!==void 0?e.output:t?.output??null,metadata:e.metadata!==void 0?e.metadata:t?.metadata??null,tags:Array.isArray(e.tags)?e.tags.map(String):Array.isArray(t?.tags)?t.tags:[],public:typeof e.public=="boolean"?e.public:typeof t?.public=="boolean"?t.public:!1,bookmarked:typeof t?.bookmarked=="boolean"?t.bookmarked:!1,environment:o,deleted:!1};return await Je(s,n.projectId,o,r.occurredAt,r.root),x("trace",a,i,t?"trace.update":"trace.create",r.root,r.occurredAt)}async function $(e,n,r,a){let t=A(e.id)??S("observation",a.occurredAt,a.root),o=_("observation",a.root).find(v=>v.id===t&&!v.deleted),s=A(e.traceId)??(o?A(o.traceId):null),i=e.environment!==void 0||!o?V(e.environment):String(o.environment);s&&!_("trace",a.root).some(v=>v.id===s&&!v.deleted)&&await q({id:s,timestamp:e.startTime,environment:i},r,a);let u=e.startTime!==void 0||!o?O(e.startTime,a.occurredAt):String(o.startTime),d=Object.keys(Q(e)).length>0||!o?Q(e):o.usageDetails,m=e.model!==void 0?A(e.model):o?A(o.model):null,c=Te(m,u,a.root),{costDetails:p,modelId:y}=Se(c,d),b=(v,j,W)=>v!==void 0?v:o?j:W,w=b(e.endTime!==void 0?O(e.endTime,a.occurredAt):void 0,o?.endTime??null,null),D={projectId:r.projectId,traceId:s,obsType:a.merge&&o?String(o.obsType):n,name:b(e.name!==void 0?A(e.name):void 0,o?.name??null,null),startTime:u,endTime:w,completionStartTime:b(e.completionStartTime!==void 0?O(e.completionStartTime,a.occurredAt):void 0,o?.completionStartTime??null,null),model:m,modelParameters:b(e.modelParameters,o?.modelParameters??null,null),input:b(e.input,o?.input??null,null),output:b(e.output,o?.output??null,null),version:b(e.version!==void 0?A(e.version):void 0,o?.version??null,null),metadata:b(e.metadata,o?.metadata??null,null),obsLevel:e.level!==void 0?ze(e.level):o?String(o.obsLevel):"DEFAULT",statusMessage:b(e.statusMessage!==void 0?A(e.statusMessage):void 0,o?.statusMessage??null,null),parentObservationId:b(e.parentObservationId!==void 0?A(e.parentObservationId):void 0,o?.parentObservationId??null,null),promptName:b(e.promptName!==void 0?A(e.promptName):void 0,o?.promptName??null,null),promptVersion:b(typeof e.promptVersion=="number"?e.promptVersion:void 0,o?.promptVersion??null,null),usageDetails:d,costDetails:p,modelId:y,environment:i,deleted:!1};return x("observation",t,D,o?"observation.update":"observation.create",a.root,a.occurredAt)}async function F(e,n,r){let a=A(e.id)??S("score",r.occurredAt,r.root),t=_("score",r.root).find(m=>m.id===a&&!m.deleted),o=e.value,s=typeof o=="number"&&Number.isFinite(o),i=typeof e.dataType=="string"?String(e.dataType).toUpperCase():"",u=["NUMERIC","CATEGORICAL","BOOLEAN"].includes(i)?i:s?"NUMERIC":"CATEGORICAL",d={projectId:n.projectId,traceId:A(e.traceId),sessionId:A(e.sessionId),observationId:A(e.observationId),datasetRunId:A(e.datasetRunId),name:String(e.name??""),value:u==="CATEGORICAL"?null:s?o:u==="BOOLEAN"?o?1:0:null,stringValue:u==="CATEGORICAL"?String(o??""):u==="BOOLEAN"?o?"True":"False":null,dataType:u,source:typeof e.source=="string"?String(e.source).toUpperCase():"API",timestamp:e.timestamp!==void 0?O(e.timestamp,r.occurredAt):t?.timestamp??r.occurredAt,createdAt:t?.createdAt??r.occurredAt,updatedAt:r.occurredAt,authorUserId:A(e.authorUserId),comment:A(e.comment),metadata:e.metadata!==void 0?e.metadata:null,configId:A(e.configId),queueId:A(e.queueId),environment:V(e.environment),deleted:!1};return x("score",a,d,t?"score.update":"score.create",r.root,r.occurredAt)}var Ye={"span-create":"SPAN","span-update":"SPAN","generation-create":"GENERATION","generation-update":"GENERATION","event-create":"EVENT"};async function re(e,n,r){let a=[],t=[];if(!Array.isArray(e))return{successes:a,errors:t};let o=new Set(_("ingestion_event",r.root).map(s=>String(s.id)));for(let s of e){let i=s&&typeof s=="object"?s:{},u=typeof i.id=="string"&&i.id?i.id:"",d=typeof i.type=="string"?i.type:"";if(!u){t.push({id:"",status:400,message:"event id is required"});continue}if(!Ie.includes(d)){t.push({id:u,status:400,message:`unsupported event type: ${d||"(missing)"}`});continue}let m=i.body&&typeof i.body=="object"?i.body:null;if(!m){t.push({id:u,status:400,message:"event body must be an object"});continue}if(o.has(u)){a.push({id:u,status:201});continue}try{let c=O(i.timestamp,r.occurredAt);await Qe(d,m,n,{...r,occurredAt:c})}catch(c){t.push({id:u,status:400,message:c instanceof Error?c.message:String(c)});continue}await x("ingestion_event",u,{eventType:d,projectId:n.projectId,receivedAt:r.occurredAt},"ingestion_event.observe",r.root,r.occurredAt),o.add(u),a.push({id:u,status:201})}return{successes:a,errors:t}}async function Qe(e,n,r,a){if(e==="sdk-log")return;if(e==="trace-create"){await q(n,r,a);return}if(e==="score-create"){if(!n.name||typeof n.name!="string")throw new Error("score name is required");if(n.value===void 0||n.value===null)throw new Error("score value is required");await F(n,r,a);return}if(e==="observation-create"||e==="observation-update"){let o=String(n.type??"").toUpperCase();if(e==="observation-create"&&!["SPAN","GENERATION","EVENT"].includes(o))throw new Error(`observation type must be one of SPAN, GENERATION, EVENT (got ${n.type??"(missing)"})`);await $(n,o||"SPAN",r,{...a,merge:e==="observation-update"});return}let t=Ye[e];await $(n,t,r,{...a,merge:e.endsWith("-update")})}function ae(e){let n={};if(!Array.isArray(e))return n;for(let r of e)!r||typeof r.key!="string"||(n[r.key]=Ee(r.value));return n}function Ee(e){if(!e||typeof e!="object")return null;let n=e;if(typeof n.stringValue=="string")return n.stringValue;if(n.intValue!==void 0)return Number(n.intValue);if(n.doubleValue!==void 0)return Number(n.doubleValue);if(n.boolValue!==void 0)return!!n.boolValue;if(n.arrayValue&&typeof n.arrayValue=="object"){let r=n.arrayValue.values;return Array.isArray(r)?r.map(Ee):[]}return null}function X(e,n){let r=typeof e=="string"?Number(e):typeof e=="number"?e:NaN;return!Number.isFinite(r)||r<=0?n:new Date(r/1e6).toISOString()}function ve(e){let n=[],r=e&&typeof e=="object"?e.resourceSpans:null;if(!Array.isArray(r))return n;for(let a of r){let t=ae(a?.resource?.attributes),o=a.scopeSpans??a.instrumentationLibrarySpans;if(Array.isArray(o))for(let s of o){let i=s.spans;if(Array.isArray(i))for(let u of i)u&&typeof u=="object"&&n.push({span:u,resource:t})}}return n}function we(e){let n=String(e["langfuse.observation.type"]??"").toUpperCase();return n==="GENERATION"||n==="SPAN"||n==="EVENT"?n:e["gen_ai.request.model"]||e["gen_ai.system"]||e["llm.model_name"]?"GENERATION":"SPAN"}async function oe(e,n,r){let a=ve(e),t=0,o=0;for(let{span:s,resource:i}of a){let u=typeof s.traceId=="string"?s.traceId:"",d=typeof s.spanId=="string"?s.spanId:"";if(!u||!d){o++;continue}let m={...i,...ae(s.attributes)},c=typeof s.parentSpanId=="string"&&s.parentSpanId?s.parentSpanId:null,p=X(s.startTimeUnixNano,r.occurredAt),y=s.endTimeUnixNano?X(s.endTimeUnixNano,r.occurredAt):null,b=V(m["langfuse.environment"]??m["deployment.environment.name"]);c||await q({id:u,timestamp:p,name:m["langfuse.trace.name"]??s.name??null,userId:m["langfuse.user.id"]??m["user.id"]??null,sessionId:m["langfuse.session.id"]??m["session.id"]??null,environment:b},n,r);let w={},D=m["gen_ai.usage.input_tokens"]??m["gen_ai.usage.prompt_tokens"],v=m["gen_ai.usage.output_tokens"]??m["gen_ai.usage.completion_tokens"];typeof D=="number"&&(w.input=D),typeof v=="number"&&(w.output=v);let j=s.status&&typeof s.status=="object"?s.status.code:void 0;await $({id:d,traceId:u,name:s.name??null,startTime:p,endTime:y,parentObservationId:c,model:m["gen_ai.request.model"]??m["llm.model_name"]??null,level:j===2||j==="STATUS_CODE_ERROR"?"ERROR":"DEFAULT",environment:b,...Object.keys(w).length?{usageDetails:w}:{}},we(m),n,r),t++}return{accepted:t,rejected:o}}var Me="langfuse",nt={400:"InvalidRequestError",401:"UnauthorizedError",403:"AccessDeniedError",404:"LangfuseNotFoundError",405:"MethodNotAllowedError",409:"ConflictError"};function l(e,n=404){return{status:n,body:{message:e,error:nt[n]??"Error"}}}var g=e=>l(`${e} not found within authorized project`,404);function f(e,n){return Ze(Me,n).filter(r=>r.type===e&&!r.deleted)}function I(e,n,r){return f(e,r).find(a=>a.id===n)}async function h(e,n,r,a,t,o){let{resource:s}=await Xe(Me,{operation:a,subjectType:e,subjectId:n,fields:r,...o?{occurredAt:o}:{},actor:{kind:"agent"}},t);return s}var N=(e,n,r,a,t)=>h(e,n,{deleted:!0},r,a,t);function rt(e){let n=e.indexOf("?");return n===-1?{path:e,params:new URLSearchParams}:{path:e.slice(0,n),params:new URLSearchParams(e.slice(n+1))}}function T(e){if(!e.body)return{};try{let n=JSON.parse(e.body);return n&&typeof n=="object"?n:{}}catch{return{}}}function at(e){if(!e.body)return!1;try{return JSON.parse(e.body),!1}catch{return!0}}function E(e,n,r=50){let a=Math.max(1,Number(n.get("page")??1)||1),t=Math.max(1,Number(n.get("limit")??r)||r),o=e.length;return{data:e.slice((a-1)*t,a*t),meta:{page:a,limit:t,totalItems:o,totalPages:Math.max(1,Math.ceil(o/t))}}}function M(e,n){let r=f("observation",n).filter(t=>t.traceId===e.id),a=f("score",n).filter(t=>t.traceId===e.id);return{id:e.id,timestamp:e.timestamp,name:e.name??null,input:e.input??null,output:e.output??null,sessionId:e.sessionId??null,release:e.release??null,version:e.version??null,userId:e.userId??null,metadata:e.metadata??null,tags:Array.isArray(e.tags)?e.tags:[],public:e.public===!0,bookmarked:e.bookmarked===!0,environment:e.environment??L,projectId:e.projectId,htmlPath:`/project/${e.projectId}/traces/${e.id}`,latency:ke(r),totalCost:Ue(r),observations:r.map(t=>String(t.id)),scores:a.map(t=>String(t.id))}}function ke(e){let n=e.map(a=>Date.parse(String(a.startTime))).filter(a=>Number.isFinite(a)),r=e.map(a=>Date.parse(String(a.endTime??a.startTime))).filter(a=>Number.isFinite(a));return n.length===0||r.length===0?null:(Math.max(...r)-Math.min(...n))/1e3}function Ue(e){let n=0,r=!1;for(let a of e){let t=a.costDetails?.total;typeof t=="number"&&(n+=t,r=!0)}return r?Number(n.toFixed(12)):null}function k(e,n){let r=e.usageDetails??{},a=e.costDetails??{},t=e.modelId?I("model",String(e.modelId),n):void 0,o=t?.prices??{},s=Date.parse(String(e.startTime)),i=e.endTime?Date.parse(String(e.endTime)):NaN,u=e.completionStartTime?Date.parse(String(e.completionStartTime)):NaN;return{id:e.id,traceId:e.traceId??null,type:e.obsType,name:e.name??null,startTime:e.startTime,endTime:e.endTime??null,completionStartTime:e.completionStartTime??null,model:e.model??null,modelParameters:e.modelParameters??null,input:e.input??null,output:e.output??null,version:e.version??null,metadata:e.metadata??null,usage:{input:r.input??null,output:r.output??null,total:r.total??null,unit:t?.unit??"TOKENS"},level:e.obsLevel,statusMessage:e.statusMessage??null,parentObservationId:e.parentObservationId??null,promptId:null,promptName:e.promptName??null,promptVersion:e.promptVersion??null,usageDetails:r,costDetails:a,environment:e.environment??L,projectId:e.projectId,modelId:e.modelId??null,inputPrice:o.input??null,outputPrice:o.output??null,totalPrice:o.total??null,calculatedInputCost:a.input??null,calculatedOutputCost:a.output??null,calculatedTotalCost:a.total??null,latency:Number.isFinite(s)&&Number.isFinite(i)?(i-s)/1e3:null,timeToFirstToken:Number.isFinite(s)&&Number.isFinite(u)?(u-s)/1e3:null}}function H(e){let n={id:e.id,projectId:e.projectId,traceId:e.traceId??null,sessionId:e.sessionId??null,observationId:e.observationId??null,datasetRunId:e.datasetRunId??null,name:e.name,source:e.source,timestamp:e.timestamp,createdAt:e.createdAt,updatedAt:e.updatedAt,authorUserId:e.authorUserId??null,comment:e.comment??null,metadata:e.metadata??null,configId:e.configId??null,queueId:e.queueId??null,environment:e.environment??L,dataType:e.dataType};return e.dataType==="CATEGORICAL"?{...n,value:null,stringValue:e.stringValue}:e.dataType==="BOOLEAN"?{...n,value:e.value,stringValue:e.stringValue}:{...n,value:e.value,stringValue:null}}var Ne=e=>({id:e.id,createdAt:e.createdAt,projectId:e.projectId,environment:e.environment??L}),K=e=>({id:e.id,name:e.name,createdAt:e.createdAt,updatedAt:e.updatedAt,projectId:e.projectId,dataType:e.dataType,isArchived:e.isArchived===!0,minValue:e.minValue??null,maxValue:e.maxValue??null,categories:e.categories??null,description:e.description??null}),se=e=>({id:e.id,name:e.name,description:e.description??null,metadata:e.metadata??null,inputSchema:e.inputSchema??null,expectedOutputSchema:e.expectedOutputSchema??null,projectId:e.projectId,createdAt:e.createdAt,updatedAt:e.updatedAt}),ie=e=>({id:e.id,status:e.status,input:e.input??null,expectedOutput:e.expectedOutput??null,metadata:e.metadata??null,sourceTraceId:e.sourceTraceId??null,sourceObservationId:e.sourceObservationId??null,datasetId:e.datasetId,datasetName:e.datasetName,createdAt:e.createdAt,updatedAt:e.updatedAt}),_e=e=>({id:e.id,name:e.name,description:e.description??null,metadata:e.metadata??null,datasetId:e.datasetId,datasetName:e.datasetName,createdAt:e.createdAt,updatedAt:e.updatedAt}),le=e=>({id:e.id,datasetRunId:e.datasetRunId,datasetRunName:e.datasetRunName,datasetItemId:e.datasetItemId,traceId:e.traceId,observationId:e.observationId??null,createdAt:e.createdAt,updatedAt:e.updatedAt}),ue=e=>({id:e.id,modelName:e.modelName,matchPattern:e.matchPattern,startDate:e.startDate??null,unit:e.unit??null,inputPrice:e.prices?.input??null,outputPrice:e.prices?.output??null,totalPrice:e.prices?.total??null,tokenizerId:e.tokenizerId??null,tokenizerConfig:e.tokenizerConfig??null,isLangfuseManaged:e.isLangfuseManaged===!0,prices:Object.fromEntries(Object.entries(e.prices??{}).map(([n,r])=>[n,{price:r}]))}),Oe=e=>({id:e.id,projectId:e.projectId,createdAt:e.createdAt,updatedAt:e.updatedAt,objectType:e.objectType,objectId:e.objectId,content:e.content,authorUserId:e.authorUserId??null}),de=e=>({id:e.id,name:e.name,version:e.version,type:e.promptType,prompt:e.prompt,config:e.config??{},labels:Array.isArray(e.labels)?e.labels:[],tags:Array.isArray(e.tags)?e.tags:[],commitMessage:e.commitMessage??null,createdAt:e.createdAt,updatedAt:e.updatedAt,resolutionGraph:null}),ce=e=>({id:e.id,name:e.name,description:e.description??null,scoreConfigIds:Array.isArray(e.scoreConfigIds)?e.scoreConfigIds:[],createdAt:e.createdAt,updatedAt:e.updatedAt}),B=e=>({id:e.id,queueId:e.queueId,objectId:e.objectId,objectType:e.objectType,status:e.status,completedAt:e.completedAt??null,createdAt:e.createdAt,updatedAt:e.updatedAt}),Le=e=>({id:e.id,provider:e.provider,adapter:e.adapter,displaySecretKey:e.displaySecretKey,baseURL:e.baseURL??null,customModels:Array.isArray(e.customModels)?e.customModels:[],withDefaultModels:e.withDefaultModels!==!1,extraHeaderKeys:Array.isArray(e.extraHeaderKeys)?e.extraHeaderKeys:[],config:e.config??null,createdAt:e.createdAt,updatedAt:e.updatedAt}),ot=e=>({id:e.id,name:e.name,organization:{id:e.orgId??R,name:"twin org",metadata:{}},metadata:e.metadata??{},retentionDays:e.retentionDays??null}),st=e=>({id:e.id,createdAt:e.createdAt,expiresAt:e.expiresAt??null,lastUsedAt:e.lastUsedAt??null,note:e.note??null,publicKey:e.publicKey,displaySecretKey:e.displaySecretKey});async function pe(e){await tt(()=>te(e.root,e.occurredAt));let n=e.method.toUpperCase(),{path:r,params:a}=rt(e.path),t=r.replace(/\/+$/,"")||"/",o=e.occurredAt??et();if(!t.startsWith("/api/public"))return g("Route");if(t==="/api/public/health")return n!=="GET"?l(`Method ${n} not allowed`,405):{status:200,body:{status:"OK",version:Z}};let s=e.readOnly?C(e.headers?.authorization??e.headers?.Authorization,e.root):await he(e.headers?.authorization??e.headers?.Authorization,e.root,o);if(!s)return l("Unauthorized",401);if(e.readOnly&&n!=="GET")return l("twin is read-only; omit readOnly to accept writes",405);if(n!=="GET"&&n!=="DELETE"&&at(e))return l("Invalid request body: not valid JSON",400);let i=t.slice(11).replace(/^\/+/,"").split("/").filter(Boolean),u={req:e,key:s,method:n,params:a,occurredAt:o,root:e.root,seg:i};return it(u)}async function it(e){let{seg:n,method:r}=e,a=t=>n[t]??"";return a(0)==="ingestion"&&n.length===1?ut(e):a(0)==="otel"&&a(1)==="v1"&&a(2)==="traces"&&n.length===3?dt(e):a(0)==="traces"?ct(e):a(0)==="observations"||a(0)==="v2"&&a(1)==="observations"?pt(e):a(0)==="sessions"?mt(e):a(0)==="scores"&&n.length===1&&r==="POST"?ft(e):a(0)==="scores"&&n.length===2&&r==="DELETE"?gt(e,a(1)):a(0)==="v2"&&a(1)==="scores"?yt(e):a(0)==="score-configs"?At(e):a(0)==="v2"&&a(1)==="prompts"?bt(e):a(0)==="v2"&&a(1)==="datasets"?It(e):a(0)==="datasets"&&a(2)==="runs"?ht(e):a(0)==="dataset-items"?Tt(e):a(0)==="dataset-run-items"?St(e):a(0)==="models"?Et(e):a(0)==="comments"?wt(e):a(0)==="annotation-queues"?Nt(e):a(0)==="media"?_t(e):a(0)==="llm-connections"?Ot(e):a(0)==="projects"?Lt(e):a(0)==="metrics"&&n.length===1&&r==="GET"?Rt(e):g("Route")}async function ut(e){if(e.method!=="POST")return l(`Method ${e.method} not allowed`,405);let n=T(e.req);return Array.isArray(n.batch)?{status:207,body:await re(n.batch,e.key,{root:e.root,occurredAt:e.occurredAt})}:l("batch must be an array of ingestion events",400)}async function dt(e){if(e.method!=="POST")return l(`Method ${e.method} not allowed`,405);let n=T(e.req);if(!Array.isArray(n.resourceSpans))return l("resourceSpans must be an array (OTLP/JSON)",400);let{rejected:r}=await oe(n,e.key,{root:e.root,occurredAt:e.occurredAt});return{status:200,body:r>0?{partialSuccess:{rejectedSpans:r,errorMessage:"spans missing traceId/spanId were rejected"}}:{}}}async function ct(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET"){let t=lt(f("trace",a),e.params).map(o=>M(o,a));return{status:200,body:E(t,e.params)}}if(n.length===1&&r==="DELETE"){let t=T(e.req),o=Array.isArray(t.traceIds)?t.traceIds.map(String):null;if(!o)return l("traceIds must be an array of trace ids",400);for(let s of o)I("trace",s,a)&&await De(s,e);return{status:200,body:{message:"Traces deleted successfully"}}}if(n.length===2&&r==="GET"){let t=I("trace",n[1],a);if(!t)return g("Trace");let o=f("observation",a).filter(i=>i.traceId===t.id).sort((i,u)=>Date.parse(String(i.startTime))-Date.parse(String(u.startTime))),s=f("score",a).filter(i=>i.traceId===t.id);return{status:200,body:{...M(t,a),observations:o.map(i=>k(i,a)),scores:s.map(H)}}}return n.length===2&&r==="DELETE"?I("trace",n[1],a)?(await De(n[1],e),{status:200,body:{message:"Trace deleted successfully"}}):g("Trace"):l(`Method ${r} not allowed`,405)}async function De(e,n){for(let r of f("observation",n.root).filter(a=>a.traceId===e))await N("observation",String(r.id),"observation.delete",n.root,n.occurredAt);for(let r of f("score",n.root).filter(a=>a.traceId===e))await N("score",String(r.id),"score.delete",n.root,n.occurredAt);await N("trace",e,"trace.delete",n.root,n.occurredAt)}function lt(e,n){let r=e,a=(u,d)=>{let m=n.get(d);m!==null&&(r=r.filter(c=>String(c[u]??"")===m))};a("userId","userId"),a("name","name"),a("sessionId","sessionId"),a("version","version"),a("release","release");let t=n.getAll("environment");t.length>0&&(r=r.filter(u=>t.includes(String(u.environment??L))));let o=n.getAll("tags");o.length>0&&(r=r.filter(u=>o.every(d=>(Array.isArray(u.tags)?u.tags:[]).includes(d))));let s=n.get("fromTimestamp");s&&(r=r.filter(u=>Date.parse(String(u.timestamp))>=Date.parse(s)));let i=n.get("toTimestamp");return i&&(r=r.filter(u=>Date.parse(String(u.timestamp))<Date.parse(i))),z(r,n.get("orderBy")??"timestamp.desc")}function z(e,n){let[r,a]=n.split("."),t=r||"timestamp",o=a==="asc"?1:-1;return[...e].sort((s,i)=>{let u=s[t],d=i[t];if(typeof u=="number"&&typeof d=="number")return(u-d)*o;let m=Date.parse(String(u)),c=Date.parse(String(d));return Number.isFinite(m)&&Number.isFinite(c)?(m-c)*o:String(u??"").localeCompare(String(d??""))*o})}async function pt(e){let r=e.seg[0]==="v2"?e.seg.slice(1):e.seg;if(e.method!=="GET")return l(`Method ${e.method} not allowed`,405);if(r.length===2){let p=I("observation",r[1],e.root);return p?{status:200,body:k(p,e.root)}:g("Observation")}if(r.length!==1)return g("Route");let a=f("observation",e.root),t=e.params,o=(p,y)=>{let b=t.get(y);b!==null&&(a=a.filter(w=>String(w[p]??"")===b))};o("name","name"),o("traceId","traceId"),o("parentObservationId","parentObservationId"),o("model","model"),o("version","version"),o("obsLevel","level");let s=t.get("type");s&&(a=a.filter(p=>String(p.obsType)===s.toUpperCase()));let i=t.get("userId");if(i){let p=new Set(f("trace",e.root).filter(y=>y.userId===i).map(y=>String(y.id)));a=a.filter(y=>p.has(String(y.traceId)))}let u=t.getAll("environment");u.length>0&&(a=a.filter(p=>u.includes(String(p.environment??L))));let d=t.get("fromStartTime");d&&(a=a.filter(p=>Date.parse(String(p.startTime))>=Date.parse(d)));let m=t.get("toStartTime");m&&(a=a.filter(p=>Date.parse(String(p.startTime))<Date.parse(m)));let c=z(a,"startTime.desc").map(p=>k(p,e.root));return{status:200,body:E(c,t)}}async function mt(e){if(e.method!=="GET")return l(`Method ${e.method} not allowed`,405);if(e.seg.length===2){let o=I("session",e.seg[1],e.root);if(!o)return g("Session");let s=f("trace",e.root).filter(i=>i.sessionId===o.id).map(i=>M(i,e.root));return{status:200,body:{...Ne(o),traces:s}}}if(e.seg.length!==1)return g("Route");let n=f("session",e.root),r=e.params.getAll("environment");r.length>0&&(n=n.filter(o=>r.includes(String(o.environment??L))));let a=e.params.get("fromTimestamp");a&&(n=n.filter(o=>Date.parse(String(o.createdAt))>=Date.parse(a)));let t=e.params.get("toTimestamp");return t&&(n=n.filter(o=>Date.parse(String(o.createdAt))<Date.parse(t))),{status:200,body:E(z(n,"createdAt.desc").map(Ne),e.params)}}async function ft(e){let n=T(e.req);if(typeof n.name!="string"||!n.name)return l("name is required",400);if(n.value===void 0||n.value===null)return l("value is required",400);if(!n.traceId&&!n.sessionId&&!n.observationId&&!n.datasetRunId)return l("one of traceId, sessionId, observationId or datasetRunId is required",400);if(typeof n.configId=="string"){let a=I("score_config",n.configId,e.root);if(!a)return g("Score config");if(a.name!==n.name)return l("Score name must equal the name of the referenced score config",400);if(typeof n.value=="number"){if(typeof a.minValue=="number"&&n.value<a.minValue)return l(`Value must be >= ${a.minValue}`,400);if(typeof a.maxValue=="number"&&n.value>a.maxValue)return l(`Value must be <= ${a.maxValue}`,400)}}return{status:200,body:{id:(await F(n,e.key,{root:e.root,occurredAt:e.occurredAt})).id}}}async function gt(e,n){return I("score",n,e.root)?(await N("score",n,"score.delete",e.root,e.occurredAt),{status:204,body:null}):g("Score")}async function yt(e){if(e.method!=="GET")return l(`Method ${e.method} not allowed`,405);if(e.seg.length===3){let c=I("score",e.seg[2],e.root);return c?{status:200,body:H(c)}:g("Score")}let n=f("score",e.root),r=e.params,a=r.get("name");a&&(n=n.filter(c=>c.name===a));let t=r.get("userId");if(t){let c=new Set(f("trace",e.root).filter(p=>p.userId===t).map(p=>String(p.id)));n=n.filter(p=>c.has(String(p.traceId)))}let o=r.get("source");o&&(n=n.filter(c=>c.source===o.toUpperCase()));let s=r.get("dataType");s&&(n=n.filter(c=>c.dataType===s.toUpperCase()));let i=r.get("traceId");i&&(n=n.filter(c=>c.traceId===i));let u=r.get("value"),d=r.get("operator");if(u!==null&&d){let c=Number(u);n=n.filter(p=>{let y=Number(p.value);return!Number.isFinite(y)||!Number.isFinite(c)?!1:d==="<"?y<c:d===">"?y>c:d==="<="?y<=c:d===">="?y>=c:d==="!="?y!==c:y===c})}return{status:200,body:E(z(n,"timestamp.desc").map(H),r)}}var Re=["NUMERIC","CATEGORICAL","BOOLEAN"];async function At(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET")return{status:200,body:E(f("score_config",a).map(K),e.params)};if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.name!="string"||!t.name)return l("name is required",400);let o=String(t.dataType??"").toUpperCase();if(!Re.includes(o))return l(`dataType must be one of ${Re.join(", ")}`,400);if(o==="CATEGORICAL"&&(!Array.isArray(t.categories)||t.categories.length===0))return l("categories are required for a CATEGORICAL score config",400);if(typeof t.minValue=="number"&&typeof t.maxValue=="number"&&t.minValue>=t.maxValue)return l("minValue must be less than maxValue",400);let s=S("score_config",e.occurredAt,e.root),i=await h("score_config",s,{name:t.name,dataType:o,isArchived:!1,projectId:e.key.projectId,minValue:typeof t.minValue=="number"?t.minValue:null,maxValue:typeof t.maxValue=="number"?t.maxValue:null,categories:Array.isArray(t.categories)?t.categories:null,description:typeof t.description=="string"?t.description:null,createdAt:e.occurredAt,updatedAt:e.occurredAt},"score_config.create",a,e.occurredAt);return{status:200,body:K(i)}}if(n.length===2){let t=I("score_config",n[1],a);if(!t)return g("Score config");if(r==="GET")return{status:200,body:K(t)};if(r==="PATCH"){let o=T(e.req),s={updatedAt:e.occurredAt};typeof o.isArchived=="boolean"&&(s.isArchived=o.isArchived),typeof o.description=="string"&&(s.description=o.description),typeof o.name=="string"&&o.name&&(s.name=o.name),Array.isArray(o.categories)&&(s.categories=o.categories);let i=await h("score_config",t.id,s,"score_config.update",a,e.occurredAt);return{status:200,body:K(i)}}}return l(`Method ${r} not allowed`,405)}async function bt(e){let n=e.seg.slice(1),{method:r,root:a}=e;if(n.length===1&&r==="GET"){let t=new Map;for(let d of f("prompt",a)){let m=t.get(String(d.name))??[];m.push(d),t.set(String(d.name),m)}let o=[...t.entries()].map(([d,m])=>({name:d,versions:m.map(c=>Number(c.version)).sort((c,p)=>c-p),labels:[...new Set(m.flatMap(c=>Array.isArray(c.labels)?c.labels:[]))].map(String),tags:[...new Set(m.flatMap(c=>Array.isArray(c.tags)?c.tags:[]))].map(String),lastUpdatedAt:m.map(c=>String(c.updatedAt)).sort().at(-1),lastConfig:m.sort((c,p)=>Number(p.version)-Number(c.version))[0].config??{}})),s=e.params.get("name");s&&(o=o.filter(d=>d.name===s));let i=e.params.get("label");i&&(o=o.filter(d=>d.labels.includes(i)));let u=e.params.get("tag");return u&&(o=o.filter(d=>d.tags.includes(u))),{status:200,body:E(o,e.params)}}if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.name!="string"||!t.name)return l("name is required",400);if(t.prompt===void 0||t.prompt===null)return l("prompt is required",400);let o=String(t.type??"text").toLowerCase();if(o!=="text"&&o!=="chat")return l("type must be 'text' or 'chat'",400);if(o==="chat"&&!Array.isArray(t.prompt))return l("a chat prompt must be an array of messages",400);if(o==="text"&&typeof t.prompt!="string")return l("a text prompt must be a string",400);let s=f("prompt",a).filter(c=>c.name===t.name);if(s.length>0&&String(s[0].promptType)!==o)return l(`Prompt "${t.name}" already exists with type ${s[0].promptType}`,400);let i=s.reduce((c,p)=>Math.max(c,Number(p.version)),0)+1,u=[...new Set([...Array.isArray(t.labels)?t.labels.map(String):[],"latest"])];for(let c of s){let p=(Array.isArray(c.labels)?c.labels.map(String):[]).filter(y=>!u.includes(y));p.length!==(Array.isArray(c.labels)?c.labels.length:0)&&await h("prompt",String(c.id),{labels:p,updatedAt:e.occurredAt},"prompt.update",a,e.occurredAt)}let d=S("prompt",e.occurredAt,e.root),m=await h("prompt",d,{name:t.name,version:i,promptType:o,prompt:t.prompt,config:t.config??{},labels:u,tags:Array.isArray(t.tags)?t.tags.map(String):[],commitMessage:typeof t.commitMessage=="string"?t.commitMessage:null,projectId:e.key.projectId,createdAt:e.occurredAt,updatedAt:e.occurredAt},"prompt.create",a,e.occurredAt);return{status:200,body:de(m)}}if(n.length===2){let t=decodeURIComponent(n[1]),o=f("prompt",a).filter(s=>s.name===t);if(r==="GET"){if(o.length===0)return g("Prompt");let s=e.params.get("version"),i=e.params.get("label"),u;return s?u=o.find(d=>Number(d.version)===Number(s)):i?u=o.find(d=>(Array.isArray(d.labels)?d.labels:[]).includes(i)):u=o.find(d=>(Array.isArray(d.labels)?d.labels:[]).includes("production")),u?{status:200,body:de(u)}:g("Prompt version")}if(r==="DELETE"){if(o.length===0)return g("Prompt");for(let s of o)await N("prompt",String(s.id),"prompt.delete",a,e.occurredAt);return{status:204,body:null}}}if(n.length===4&&n[2]==="versions"&&r==="PATCH"){let t=decodeURIComponent(n[1]),o=Number(n[3]),s=f("prompt",a).filter(p=>p.name===t),i=s.find(p=>Number(p.version)===o);if(!i)return g("Prompt version");let u=T(e.req);if(!Array.isArray(u.newLabels))return l("newLabels must be an array of labels",400);let d=u.newLabels.map(String);for(let p of s){if(p.id===i.id)continue;let y=(Array.isArray(p.labels)?p.labels.map(String):[]).filter(b=>!d.includes(b));y.length!==(Array.isArray(p.labels)?p.labels.length:0)&&await h("prompt",String(p.id),{labels:y,updatedAt:e.occurredAt},"prompt.update",a,e.occurredAt)}let m=[...new Set([...Array.isArray(i.labels)?i.labels.map(String):[],...d])],c=await h("prompt",String(i.id),{labels:m,updatedAt:e.occurredAt},"prompt.update",a,e.occurredAt);return{status:200,body:de(c)}}return l(`Method ${r} not allowed`,405)}async function It(e){let n=e.seg.slice(1),{method:r,root:a}=e;if(n.length===1&&r==="GET")return{status:200,body:E(f("dataset",a).map(se),e.params)};if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.name!="string"||!t.name)return l("name is required",400);let o=f("dataset",a).find(u=>u.name===t.name),s=o?String(o.id):S("dataset",e.occurredAt,e.root),i=await h("dataset",s,{name:t.name,description:t.description!==void 0?t.description:o?.description??null,metadata:t.metadata!==void 0?t.metadata:o?.metadata??null,inputSchema:t.inputSchema??o?.inputSchema??null,expectedOutputSchema:t.expectedOutputSchema??o?.expectedOutputSchema??null,projectId:e.key.projectId,createdAt:o?.createdAt??e.occurredAt,updatedAt:e.occurredAt},o?"dataset.update":"dataset.create",a,e.occurredAt);return{status:200,body:se(i)}}if(n.length===2&&r==="GET"){let t=f("dataset",a).find(o=>o.name===decodeURIComponent(n[1]));return t?{status:200,body:se(t)}:g("Dataset")}return l(`Method ${r} not allowed`,405)}async function ht(e){let{seg:n,method:r,root:a}=e,t=decodeURIComponent(n[1]),o=f("dataset",a).find(s=>s.name===t);if(!o)return g("Dataset");if(n.length===3&&r==="GET"){let s=f("dataset_run",a).filter(i=>i.datasetId===o.id).map(_e);return{status:200,body:E(s,e.params)}}if(n.length===4){let s=decodeURIComponent(n[3]),i=f("dataset_run",a).find(u=>u.datasetId===o.id&&u.name===s);if(!i)return g("Dataset run");if(r==="GET"){let u=f("dataset_run_item",a).filter(d=>d.datasetRunId===i.id).map(le);return{status:200,body:{..._e(i),datasetRunItems:u}}}if(r==="DELETE"){for(let u of f("dataset_run_item",a).filter(d=>d.datasetRunId===i.id))await N("dataset_run_item",String(u.id),"dataset_run_item.delete",a,e.occurredAt);return await N("dataset_run",String(i.id),"dataset_run.delete",a,e.occurredAt),{status:200,body:{message:"Dataset run successfully deleted"}}}}return l(`Method ${r} not allowed`,405)}async function Tt(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.datasetName!="string"||!t.datasetName)return l("datasetName is required",400);let o=f("dataset",a).find(m=>m.name===t.datasetName);if(!o)return g("Dataset");let s=String(t.status??"ACTIVE").toUpperCase();if(s!=="ACTIVE"&&s!=="ARCHIVED")return l("status must be ACTIVE or ARCHIVED",400);let i=typeof t.id=="string"?I("dataset_item",t.id,a):void 0,u=i?String(i.id):typeof t.id=="string"&&t.id?t.id:S("dataset_item",e.occurredAt,e.root),d=await h("dataset_item",u,{datasetId:o.id,datasetName:o.name,status:s,input:t.input??null,expectedOutput:t.expectedOutput??null,metadata:t.metadata??null,sourceTraceId:typeof t.sourceTraceId=="string"?t.sourceTraceId:null,sourceObservationId:typeof t.sourceObservationId=="string"?t.sourceObservationId:null,projectId:e.key.projectId,createdAt:i?.createdAt??e.occurredAt,updatedAt:e.occurredAt},i?"dataset_item.update":"dataset_item.create",a,e.occurredAt);return{status:200,body:ie(d)}}if(n.length===1&&r==="GET"){let t=f("dataset_item",a),o=e.params.get("datasetName");o&&(t=t.filter(i=>i.datasetName===o));let s=e.params.get("sourceTraceId");return s&&(t=t.filter(i=>i.sourceTraceId===s)),{status:200,body:E(t.map(ie),e.params)}}if(n.length===2){let t=I("dataset_item",n[1],a);if(!t)return g("Dataset item");if(r==="GET")return{status:200,body:ie(t)};if(r==="DELETE")return await N("dataset_item",String(t.id),"dataset_item.delete",a,e.occurredAt),{status:200,body:{message:"Dataset item successfully deleted"}}}return l(`Method ${r} not allowed`,405)}async function St(e){let{seg:n,method:r,root:a}=e;if(n.length!==1)return g("Route");if(r==="POST"){let t=T(e.req);if(typeof t.runName!="string"||!t.runName)return l("runName is required",400);if(typeof t.datasetItemId!="string"||!t.datasetItemId)return l("datasetItemId is required",400);if(typeof t.traceId!="string"||!t.traceId)return l("traceId is required",400);let o=I("dataset_item",t.datasetItemId,a);if(!o)return g("Dataset item");let s=f("dataset_run",a).find(u=>u.datasetId===o.datasetId&&u.name===t.runName);s||(s=await h("dataset_run",S("dataset_run",e.occurredAt,e.root),{name:t.runName,description:typeof t.runDescription=="string"?t.runDescription:null,metadata:t.metadata??null,datasetId:o.datasetId,datasetName:o.datasetName,projectId:e.key.projectId,createdAt:e.occurredAt,updatedAt:e.occurredAt},"dataset_run.create",a,e.occurredAt));let i=await h("dataset_run_item",S("dataset_run_item",e.occurredAt,e.root),{datasetRunId:s.id,datasetRunName:s.name,datasetItemId:o.id,traceId:t.traceId,observationId:typeof t.observationId=="string"?t.observationId:null,projectId:e.key.projectId,createdAt:e.occurredAt,updatedAt:e.occurredAt},"dataset_run_item.create",a,e.occurredAt);return{status:200,body:le(i)}}if(r==="GET"){let t=e.params.get("runName"),o=f("dataset_run_item",a);return t&&(o=o.filter(s=>s.datasetRunName===t)),{status:200,body:E(o.map(le),e.params)}}return l(`Method ${r} not allowed`,405)}var xe=["CHARACTERS","TOKENS","MILLISECONDS","SECONDS","IMAGES","REQUESTS"];async function Et(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET")return{status:200,body:E(f("model",a).map(ue),e.params)};if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.modelName!="string"||!t.modelName)return l("modelName is required",400);if(typeof t.matchPattern!="string"||!t.matchPattern)return l("matchPattern is required",400);if(!ne(t.matchPattern))return l("matchPattern must be a valid regular expression",400);if(t.unit!==void 0&&t.unit!==null&&!xe.includes(String(t.unit)))return l(`unit must be one of ${xe.join(", ")}`,400);let o={};if(t.prices&&typeof t.prices=="object")for(let[i,u]of Object.entries(t.prices)){let d=typeof u=="number"?u:Number(u?.price);Number.isFinite(d)&&(o[i]=d)}typeof t.inputPrice=="number"&&(o.input??=t.inputPrice),typeof t.outputPrice=="number"&&(o.output??=t.outputPrice),typeof t.totalPrice=="number"&&(o.total??=t.totalPrice);let s=await h("model",S("model",e.occurredAt,e.root),{modelName:t.modelName,matchPattern:t.matchPattern,startDate:typeof t.startDate=="string"?O(t.startDate,e.occurredAt):null,unit:t.unit??null,prices:o,tokenizerId:t.tokenizerId??null,tokenizerConfig:t.tokenizerConfig??null,isLangfuseManaged:!1,projectId:e.key.projectId,createdAt:e.occurredAt},"model.create",a,e.occurredAt);return{status:200,body:ue(s)}}if(n.length===2){let t=I("model",n[1],a);if(!t)return g("Model");if(r==="GET")return{status:200,body:ue(t)};if(r==="DELETE")return await N("model",String(t.id),"model.delete",a,e.occurredAt),{status:204,body:null}}return l(`Method ${r} not allowed`,405)}var je=["TRACE","OBSERVATION","SESSION","PROMPT"],vt={TRACE:"trace",OBSERVATION:"observation",SESSION:"session",PROMPT:"prompt"};async function wt(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="POST"){let t=T(e.req),o=String(t.objectType??"").toUpperCase();if(!je.includes(o))return l(`objectType must be one of ${je.join(", ")}`,400);if(typeof t.objectId!="string"||!t.objectId)return l("objectId is required",400);if(typeof t.content!="string"||!t.content.trim())return l("content is required",400);if(t.content.length>3e3)return l("content must be at most 3000 characters",400);let s=vt[o];return(s==="prompt"?f("prompt",a).some(d=>d.id===t.objectId||d.name===t.objectId):!!I(s,t.objectId,a))?{status:200,body:{id:(await h("comment",S("comment",e.occurredAt,e.root),{projectId:e.key.projectId,objectType:o,objectId:t.objectId,content:t.content,authorUserId:typeof t.authorUserId=="string"?t.authorUserId:null,createdAt:e.occurredAt,updatedAt:e.occurredAt},"comment.create",a,e.occurredAt)).id}}:g(`Reference object ${o}`)}if(n.length===1&&r==="GET"){let t=f("comment",a),o=e.params.get("objectType");o&&(t=t.filter(u=>u.objectType===o.toUpperCase()));let s=e.params.get("objectId");s&&(t=t.filter(u=>u.objectId===s));let i=e.params.get("authorUserId");return i&&(t=t.filter(u=>u.authorUserId===i)),{status:200,body:E(t.map(Oe),e.params)}}if(n.length===2&&r==="GET"){let t=I("comment",n[1],a);return t?{status:200,body:Oe(t)}:g("Comment")}return l(`Method ${r} not allowed`,405)}var Pe=["TRACE","OBSERVATION","SESSION"];async function Nt(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET")return{status:200,body:E(f("annotation_queue",a).map(ce),e.params)};if(n.length===1&&r==="POST"){let t=T(e.req);if(typeof t.name!="string"||!t.name)return l("name is required",400);if(!Array.isArray(t.scoreConfigIds))return l("scoreConfigIds must be an array",400);for(let s of t.scoreConfigIds)if(!I("score_config",String(s),a))return g("Score config");let o=await h("annotation_queue",S("annotation_queue",e.occurredAt,e.root),{name:t.name,description:typeof t.description=="string"?t.description:null,scoreConfigIds:t.scoreConfigIds.map(String),projectId:e.key.projectId,createdAt:e.occurredAt,updatedAt:e.occurredAt},"annotation_queue.create",a,e.occurredAt);return{status:200,body:ce(o)}}if(n.length===2&&r==="GET"){let t=I("annotation_queue",n[1],a);return t?{status:200,body:ce(t)}:g("Annotation queue")}if(n.length>=3&&n[2]==="items"){let t=I("annotation_queue",n[1],a);if(!t)return g("Annotation queue");if(n.length===3&&r==="GET"){let o=f("annotation_queue_item",a).filter(i=>i.queueId===t.id),s=e.params.get("status");return s&&(o=o.filter(i=>i.status===s.toUpperCase())),{status:200,body:E(o.map(B),e.params)}}if(n.length===3&&r==="POST"){let o=T(e.req),s=String(o.objectType??"").toUpperCase();if(!Pe.includes(s))return l(`objectType must be one of ${Pe.join(", ")}`,400);if(typeof o.objectId!="string"||!o.objectId)return l("objectId is required",400);let i=String(o.status??"PENDING").toUpperCase();if(i!=="PENDING"&&i!=="COMPLETED")return l("status must be PENDING or COMPLETED",400);let u=await h("annotation_queue_item",S("annotation_queue_item",e.occurredAt,e.root),{queueId:t.id,objectId:o.objectId,objectType:s,status:i,completedAt:i==="COMPLETED"?e.occurredAt:null,projectId:e.key.projectId,createdAt:e.occurredAt,updatedAt:e.occurredAt},"annotation_queue_item.create",a,e.occurredAt);return{status:200,body:B(u)}}if(n.length===4){let o=f("annotation_queue_item",a).find(s=>s.id===n[3]&&s.queueId===t.id);if(!o)return g("Annotation queue item");if(r==="GET")return{status:200,body:B(o)};if(r==="PATCH"){let s=T(e.req),i=String(s.status??"").toUpperCase();if(i!=="PENDING"&&i!=="COMPLETED")return l("status must be PENDING or COMPLETED",400);let u=await h("annotation_queue_item",String(o.id),{status:i,completedAt:i==="COMPLETED"?e.occurredAt:null,updatedAt:e.occurredAt},"annotation_queue_item.update",a,e.occurredAt);return{status:200,body:B(u)}}if(r==="DELETE")return await N("annotation_queue_item",String(o.id),"annotation_queue_item.delete",a,e.occurredAt),{status:200,body:{success:!0,message:"Annotation queue item deleted successfully"}}}}return l(`Method ${r} not allowed`,405)}async function _t(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="POST"){let t=T(e.req);for(let d of["traceId","contentType","sha256Hash"])if(typeof t[d]!="string"||!t[d])return l(`${d} is required`,400);if(typeof t.contentLength!="number")return l("contentLength is required",400);let o=String(t.field??"");if(!["input","output","metadata"].includes(o))return l("field must be one of 'input', 'output', 'metadata'",400);let s=f("media",a).find(d=>d.sha256Hash===t.sha256Hash);if(s&&s.uploadedAt)return{status:200,body:{mediaId:s.id,uploadUrl:null}};let i=s?String(s.id):S("media",e.occurredAt,e.root),u=await h("media",i,{sha256Hash:t.sha256Hash,contentType:t.contentType,contentLength:t.contentLength,traceId:t.traceId,observationId:typeof t.observationId=="string"?t.observationId:null,mediaField:o,uploadedAt:null,uploadHttpStatus:null,uploadHttpError:null,projectId:e.key.projectId,createdAt:e.occurredAt},s?"media.update":"media.create",a,e.occurredAt);return{status:200,body:{mediaId:u.id,uploadUrl:`http://twin.local/media/${u.id}?upload=1`}}}if(n.length===2){let t=I("media",n[1],a);if(!t)return g("Media");if(r==="GET")return{status:200,body:{mediaId:t.id,contentType:t.contentType,contentLength:t.contentLength,uploadedAt:t.uploadedAt??null,url:`http://twin.local/media/${t.id}`,urlExpiry:e.occurredAt}};if(r==="PATCH"){let o=T(e.req);if(typeof o.uploadedAt!="string"||!o.uploadedAt)return l("uploadedAt is required",400);if(typeof o.uploadHttpStatus!="number")return l("uploadHttpStatus is required",400);let s=await h("media",String(t.id),{uploadedAt:O(o.uploadedAt,e.occurredAt),uploadHttpStatus:o.uploadHttpStatus,uploadHttpError:typeof o.uploadHttpError=="string"?o.uploadHttpError:null},"media.update",a,e.occurredAt);return{status:204,body:null}}}return l(`Method ${r} not allowed`,405)}async function Ot(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET")return{status:200,body:E(f("llm_connection",a).map(Le),e.params)};if(n.length===1&&r==="PUT"){let t=T(e.req);if(typeof t.provider!="string"||!t.provider)return l("provider is required",400);if(typeof t.adapter!="string"||!t.adapter)return l("adapter is required",400);if(typeof t.secretKey!="string"||!t.secretKey)return l("secretKey is required",400);let o=f("llm_connection",a).find(u=>u.provider===t.provider),s=o?String(o.id):S("llm_connection",e.occurredAt,e.root),i=await h("llm_connection",s,{provider:t.provider,adapter:t.adapter,displaySecretKey:P(t.secretKey),baseURL:typeof t.baseURL=="string"?t.baseURL:null,customModels:Array.isArray(t.customModels)?t.customModels.map(String):[],withDefaultModels:t.withDefaultModels!==!1,extraHeaderKeys:t.extraHeaders&&typeof t.extraHeaders=="object"?Object.keys(t.extraHeaders):[],config:t.config??null,projectId:e.key.projectId,createdAt:o?.createdAt??e.occurredAt,updatedAt:e.occurredAt},o?"llm_connection.update":"llm_connection.create",a,e.occurredAt);return{status:200,body:Le(i)}}if(n.length===2&&r==="DELETE"){let t=I("llm_connection",n[1],a);return t?(await N("llm_connection",String(t.id),"llm_connection.delete",a,e.occurredAt),{status:200,body:{message:"LLM connection deleted successfully"}}):g("LLM connection")}return l(`Method ${r} not allowed`,405)}async function Lt(e){let{seg:n,method:r,root:a}=e;if(n.length===1&&r==="GET"){let t=I("project",e.key.projectId,a);return{status:200,body:{data:t?[ot(t)]:[]}}}if(n.length===3&&n[2]==="apiKeys"){let t=I("project",n[1],a);if(!t)return g("Project");if(r==="GET")return{status:200,body:{apiKeys:f("api_key",a).filter(s=>s.projectId===t.id).map(st)}};if(r==="POST"){let o=T(e.req),s=f("api_key",a).length+1,i=`pk-lf-${String(s).padStart(8,"0")}-0000-4000-8000-000000000000`,u=`sk-lf-${String(s).padStart(8,"0")}-0000-4000-8000-000000000000`,d=await h("api_key",S("api_key",e.occurredAt,e.root,"key-"),{publicKey:i,secretKey:u,displaySecretKey:P(u),projectId:t.id,orgId:t.orgId??R,note:typeof o.note=="string"?o.note:null,createdAt:e.occurredAt,lastUsedAt:null},"api_key.create",a,e.occurredAt);return{status:200,body:{id:d.id,createdAt:d.createdAt,publicKey:i,secretKey:u,displaySecretKey:d.displaySecretKey,note:d.note??null}}}}if(n.length===4&&n[2]==="apiKeys"&&r==="DELETE"){let t=f("api_key",a).find(o=>o.id===n[3]&&o.projectId===n[1]);return t?(await N("api_key",String(t.id),"api_key.delete",a,e.occurredAt),{status:200,body:{success:!0}}):g("API key")}return l(`Method ${r} not allowed`,405)}var Dt={count:()=>1,latency:e=>typeof e.latency=="number"?e.latency:null,totalCost:e=>typeof e.totalCost=="number"?e.totalCost:typeof e.calculatedTotalCost=="number"?e.calculatedTotalCost:null,totalTokens:e=>Number(e.usageDetails?.total??NaN)||null,value:e=>typeof e.value=="number"?e.value:null};async function Rt(e){let n=e.params.get("query");if(!n)return l("query is required",400);let r;try{r=JSON.parse(n)}catch{return l("query must be a valid JSON string",400)}let a=String(r.view??"");if(a!=="traces"&&a!=="observations")return l(`view '${a||"(missing)"}' is not supported by this twin (supported: traces, observations)`,400);if(!Array.isArray(r.metrics)||r.metrics.length===0)return l("at least one metric must be provided",400);if(typeof r.fromTimestamp!="string"||!r.fromTimestamp)return l("query.fromTimestamp is required",400);if(typeof r.toTimestamp!="string"||!r.toTimestamp)return l("query.toTimestamp is required",400);let t=a==="traces"?f("trace",e.root).map(c=>M(c,e.root)):f("observation",e.root).map(c=>k(c,e.root)),o=a==="traces"?"timestamp":"startTime",s=t;typeof r.fromTimestamp=="string"&&(s=s.filter(c=>Date.parse(String(c[o]))>=Date.parse(r.fromTimestamp))),typeof r.toTimestamp=="string"&&(s=s.filter(c=>Date.parse(String(c[o]))<Date.parse(r.toTimestamp)));for(let c of Array.isArray(r.filters)?r.filters:[]){let p=String(c?.column??"");p&&(s=s.filter(y=>jt(y[p],String(c.operator??"="),c.value)))}let i=Array.isArray(r.dimensions)?r.dimensions.map(c=>String(c?.field??"")).filter(Boolean):[];if(i.length>1)return l("this twin supports at most one dimension per query",400);let u=i[0],d=new Map;for(let c of s){let p=u?String(c[u]??""):"",y=d.get(p)??[];y.push(c),d.set(p,y)}d.size===0&&!u&&d.set("",[]);let m=[];for(let[c,p]of d){let y=u?{[u]:c}:{};for(let b of r.metrics){let w=String(b?.measure??""),D=String(b?.aggregation??"count"),v=Dt[w];if(!v)return l(`measure '${w}' is not supported by this twin`,400);if(!Ce.includes(D))return l(`aggregation '${D}' is not supported by this twin (supported: ${Ce.join(", ")})`,400);let j=p.map(v).filter(W=>typeof W=="number");y[`${D}_${w}`]=xt(D,j,p.length)}m.push(y)}return{status:200,body:{data:m}}}var Ce=["count","sum","avg","min","max"];function xt(e,n,r){return e==="count"?r:n.length===0?0:e==="sum"?Number(n.reduce((a,t)=>a+t,0).toFixed(12)):e==="avg"?Number((n.reduce((a,t)=>a+t,0)/n.length).toFixed(12)):e==="min"?Math.min(...n):e==="max"?Math.max(...n):0}function jt(e,n,r){return n==="contains"?String(e??"").includes(String(r??"")):n==="!="?e!==r:n===">"?Number(e)>Number(r):n==="<"?Number(e)<Number(r):n===">="?Number(e)>=Number(r):n==="<="?Number(e)<=Number(r):n==="any of"?Array.isArray(r)&&r.map(String).includes(String(e)):String(e??"")===String(r??"")}import{serveHttp as Wt}from"../../engine/v2/volter_world-core.mjs";import{createTwinFetchFromHandler as Pt,statefulTwinManifest as Ct,withRequestScopes as Mt}from"../../engine/v2/volter_world-core.mjs";function me(e={}){return Mt(Pt(pe,{...e,manifest:Ct({vendor:"langfuse",twinOf:"the Langfuse LLM-observability API",stores:"traces, observations, scores and sessions the SDK ingests"})}))}import{assertBudgetGuardIntact as on,observeResources as sn}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as kt,rateBudgetPath as Zt,rateBudgetWeight as en,RateBudget as tn}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as qe}from"../../engine/v2/volter_world-core.mjs";var Ut="langfuse",Ge=6e4,$e=60,Ve=300,U={read:4,other:2,daily:60},fe={windowMs:Ge,ceiling:$e,defaultWeight:U.other,maxRetryAfterSeconds:Ve,rules:[{match:"^DELETE /api/public/(traces|observations|scores|v2/scores)(/|$)",weight:U.daily},{match:"^GET /api/public/(v2/)?metrics(/|$)",weight:U.daily},{match:"^GET /api/public/(traces|observations|sessions)(/|$)",weight:U.read}],reason:`Langfuse PUBLISHES scalar per-organization rate limits (https://langfuse.com/faq/all/api-limits, read 2026-08-19) \u2014 unlike most vendors in this repo \u2014 so every number here is arithmetic against that table at its LOWEST plan (Hobby), because a twin cannot know an operator's plan and guessing upward is how a lockout happens. Published Hobby figures: General API 30 req/min; the enumerated "Deprecated read APIs" (GET /api/public/traces, /traces/{id}, /observations, /observations/{id}, /sessions, /sessions/{id}) 15 req/min; Tracing (batched /ingestion + /otel) 1,000 req/min; Datasets 100 req/min; Prompts GET unlimited; trace-data DELETION 50 req/DAY; Metrics API 100 req/DAY. Over the limit: 429 + Retry-After. Mapping: 60 units per 60s at defaultWeight 2 = 30 calls/min = the published General API figure (also exactly the kernel fallback, so this is never more permissive than an undeclared pack); the deprecated READ endpoints \u2014 precisely the ones this connector pulls \u2014 cost 4 = 15 calls/min, the published figure for that bucket and STRICTER than the fallback. The DAILY buckets (deletion, metrics) cannot be expressed in a rolling 60s window at all; they are priced at the full ceiling (at most one per minute) as a mitigation, NOT a guarantee \u2014 stated plainly rather than dressed up as compliance. The genuinely protective mechanism for those is the cooldown: Langfuse's 429 + Retry-After becomes a persisted client-side stop instead of a retry storm. No endpoint is priced cheaper than the fallback would price it.`};kt(Ut,fe);import{bundleClient as ln,fileResponse as pn,filePathOf as mn}from"../../engine/v2/volter_world-core.mjs";import{serveHttp as gn}from"../../engine/v2/volter_world-core.mjs";export{me 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-linear
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-linear 3.0.6 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.
|