agenttwin 0.3.21 → 0.3.23
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/{1250-7571b1a697f6bb4a.js → 1250-a3c859fd20517500.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{2743-a0efd6f4aeb11cc5.js → 2743-72610a5d5a3f8462.js} +1 -1
- 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-fc4df4912ce3af44.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{webpack-40324749d289e4a5.js → webpack-9e40ef55e5f2fb53.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 +6386 -4974
- 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 +6 -5
- 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/chunks/app/v2/page-07c8054d57c9089b.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 → GTd0IQ6HYyhE_2HqcgFno}/_buildManifest.js +0 -0
- /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → GTd0IQ6HYyhE_2HqcgFno}/_ssgManifest.js +0 -0
|
@@ -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 ue}from"../../engine/v2/volter_world-core.mjs";function oe(e,t){if(!e)return;let n=t.toLowerCase();for(let[o,s]of Object.entries(e))if(o.toLowerCase()===n)return s}function Ce(e,t){return e.searchParams.get("key")??oe(t,"x-goog-api-key")??void 0}function he(e,t){let n=Ce(e,t);return n===void 0?t===void 0?{ok:!0,key:"twin-implicit"}:{ok:!1,status:"REQUEST_DENIED",message:"The provided API key is invalid or missing. Pass `key=` or the X-Goog-Api-Key header."}:n.trim()?n==="over-query-limit"?{ok:!1,status:"OVER_QUERY_LIMIT",message:"You have exceeded your rate-limit for this API."}:n==="over-daily-limit"?{ok:!1,status:"OVER_DAILY_LIMIT",message:"You have exceeded your daily request quota for this API."}:n==="request-denied"?{ok:!1,status:"REQUEST_DENIED",message:"This API key is not authorized to use this service or API."}:{ok:!0,key:n}:{ok:!1,status:"REQUEST_DENIED",message:"The provided API key is empty."}}import{createHash as ke}from"node:crypto";function y(e){let t=typeof e=="string"?e:JSON.stringify(e);return ke("sha256").update(t).digest("hex").slice(0,16)}function E(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function L(e){let t=y(e),n=parseInt(t.slice(0,8),16),o=parseInt(t.slice(8,16),16),s=Math.round((n%17e6/1e5-85)*1e7)/1e7,r=Math.round((o%36e6/1e5-180)*1e7)/1e7;return{lat:s,lng:r}}function N(e,t=.01){return{northeast:{lat:Math.round((e.lat+t)*1e7)/1e7,lng:Math.round((e.lng+t)*1e7)/1e7},southwest:{lat:Math.round((e.lat-t)*1e7)/1e7,lng:Math.round((e.lng-t)*1e7)/1e7}}}var B=[{place_id:"ChIJE9on3F3HwoAR9AhGJW_fL-I",name:"Los Angeles",formatted_address:"Los Angeles, CA, USA",location:{lat:34.0522342,lng:-118.2436849},types:["locality","political"],components:[{long_name:"Los Angeles",short_name:"Los Angeles",types:["locality","political"]},{long_name:"Los Angeles County",short_name:"Los Angeles County",types:["administrative_area_level_2","political"]},{long_name:"California",short_name:"CA",types:["administrative_area_level_1","political"]},{long_name:"United States",short_name:"US",types:["country","political"]}]},{place_id:"ChIJOwg_06VPwokRYv534QaPC8g",name:"New York",formatted_address:"New York, NY, USA",location:{lat:40.7127753,lng:-74.0059728},types:["locality","political"],components:[{long_name:"New York",short_name:"New York",types:["locality","political"]},{long_name:"New York",short_name:"NY",types:["administrative_area_level_1","political"]},{long_name:"United States",short_name:"US",types:["country","political"]}]},{place_id:"ChIJj61dQgK6j4AR4GeTYWZsKWw",name:"Mountain View",formatted_address:"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",location:{lat:37.4220656,lng:-122.0840897},types:["street_address"],components:[{long_name:"1600",short_name:"1600",types:["street_number"]},{long_name:"Amphitheatre Parkway",short_name:"Amphitheatre Pkwy",types:["route"]},{long_name:"Mountain View",short_name:"Mountain View",types:["locality","political"]},{long_name:"California",short_name:"CA",types:["administrative_area_level_1","political"]},{long_name:"United States",short_name:"US",types:["country","political"]},{long_name:"94043",short_name:"94043",types:["postal_code"]}]},{place_id:"ChIJdd4hrwug2EcRmSrV3Vo6llI",name:"London",formatted_address:"London, UK",location:{lat:51.5072178,lng:-.1275862},types:["locality","political"],components:[{long_name:"London",short_name:"London",types:["locality","political"]},{long_name:"United Kingdom",short_name:"GB",types:["country","political"]}]},{place_id:"ChIJ51cu8IcbXWARiRtXIothAS4",name:"Tokyo",formatted_address:"Tokyo, Japan",location:{lat:35.6761919,lng:139.6503106},types:["locality","political"],components:[{long_name:"Tokyo",short_name:"Tokyo",types:["locality","political"]},{long_name:"Japan",short_name:"JP",types:["country","political"]}]}],$e=["nowhere","zzzznoresult","zero_results","this-place-does-not-exist"];function x(e){let t=E(e);return $e.some(n=>t.includes(n))}function I(e){let t=E(e);for(let n of B)if(t.includes(E(n.name))||E(n.formatted_address).includes(t)&&t.length>=3)return n;return null}function U(e){return B.find(t=>t.place_id===e)??null}function se(e){return e.components.find(t=>t.types.includes("country"))?.short_name?.toLowerCase()}function _e(e){return e.components.find(t=>t.types.includes("locality"))?.long_name??e.components.find(t=>t.types.includes("administrative_area_level_1"))?.long_name??e.name}function j(e){let t=B[0],n=Number.POSITIVE_INFINITY;for(let o of B){let s=(o.location.lat-e.lat)**2+(o.location.lng-e.lng)**2;s<n&&(n=s,t=o)}return t}function T(){return B}var Ve={"Tokyo, Japan":{ja:"\u65E5\u672C\u3001\u6771\u4EAC\u90FD",fr:"Tokyo, Japon",es:"Tokio, Jap\xF3n",de:"Tokio, Japan"},"London, UK":{ja:"\u30A4\u30AE\u30EA\u30B9 \u30ED\u30F3\u30C9\u30F3",fr:"Londres, Royaume-Uni",es:"Londres, Reino Unido",de:"London, Vereinigtes K\xF6nigreich"},"Los Angeles, CA, USA":{ja:"\u30A2\u30E1\u30EA\u30AB\u5408\u8846\u56FD \u30AB\u30EA\u30D5\u30A9\u30EB\u30CB\u30A2\u5DDE \u30ED\u30B5\u30F3\u30BC\u30EB\u30B9",fr:"Los Angeles, Californie, \xC9tats-Unis",es:"Los \xC1ngeles, California, EE. UU.",de:"Los Angeles, Kalifornien, USA"},"New York, NY, USA":{ja:"\u30A2\u30E1\u30EA\u30AB\u5408\u8846\u56FD \u30CB\u30E5\u30FC\u30E8\u30FC\u30AF\u5DDE \u30CB\u30E5\u30FC\u30E8\u30FC\u30AF",fr:"New York, \xC9tat de New York, \xC9tats-Unis",es:"Nueva York, EE. UU.",de:"New York, USA"}};function Ae(e,t){if(!t)return e;let n=t.toLowerCase().split("-")[0];return n==="en"?e:Ve[e]?.[n]??e}function W(e,t="ROOFTOP"){return{address_components:e.components,formatted_address:e.formatted_address,geometry:{location:e.location,location_type:t,viewport:N(e.location)},place_id:e.place_id,types:e.types}}function ae(e){let t=L(E(e)),n=`ChIJ${y(e)}twin`;return{address_components:[{long_name:e,short_name:e,types:["route"]},{long_name:"United States",short_name:"US",types:["country","political"]}],formatted_address:e,geometry:{location:t,location_type:"GEOMETRIC_CENTER",viewport:N(t)},place_id:n,types:["route"]}}function O(e,t){let o=c=>c*Math.PI/180,s=o(t.lat-e.lat),r=o(t.lng-e.lng),a=o(e.lat),i=o(t.lat),l=Math.sin(s/2)**2+Math.cos(a)*Math.cos(i)*Math.sin(r/2)**2;return Math.round(2*6371e3*Math.asin(Math.sqrt(l)))}function K(e,t=!1){if(t){let o=e/1e3;return o>=1?`${o.toFixed(1)} km`:`${e} m`}let n=e/1609.344;return n>=.1?`${n.toFixed(1)} mi`:`${Math.round(e*3.28084)} ft`}function v(e){let t=Math.round(e/60);if(t<60)return`${t} min${t===1?"":"s"}`;let n=Math.floor(t/60),o=t%60;return o===0?`${n} hour${n===1?"":"s"}`:`${n} hour${n===1?"":"s"} ${o} min${o===1?"":"s"}`}function V(e){let t=[0,0],n="",o=(s,r)=>{let a=Math.round(s*1e5)-Math.round(r*1e5);a=a<0?~(a<<1):a<<1;let i="";for(;a>=32;)i+=String.fromCharCode((32|a&31)+63),a>>=5;return i+=String.fromCharCode(a+63),i};for(let s of e)n+=o(s.lat,t[0]),n+=o(s.lng,t[1]),t=[s.lat,s.lng];return n}function re(e){let t=parseInt(y(`${e.lat},${e.lng}`).slice(0,8),16);return Math.round((t%4e5/100-100)*100)/100}function ie(e,t){let n=[{timeZoneId:"America/Los_Angeles",stdName:"Pacific Standard Time",dstName:"Pacific Daylight Time",rawOffset:-28800,observesDst:!0},{timeZoneId:"America/New_York",stdName:"Eastern Standard Time",dstName:"Eastern Daylight Time",rawOffset:-18e3,observesDst:!0},{timeZoneId:"Europe/London",stdName:"Greenwich Mean Time",dstName:"British Summer Time",rawOffset:0,observesDst:!0},{timeZoneId:"Asia/Tokyo",stdName:"Japan Standard Time",dstName:"Japan Standard Time",rawOffset:32400,observesDst:!1}],o=parseInt(y(`${e.lat},${e.lng}`).slice(0,4),16)%n.length,s=n[o],r=0;if(s.observesDst&&t!==void 0&&Number.isFinite(t)){let a=new Date(t*1e3).getUTCMonth();a>=2&&a<=9&&(r=3600)}return{timeZoneId:s.timeZoneId,timeZoneName:r>0?s.dstName:s.stdName,rawOffset:s.rawOffset,dstOffset:r}}var ye="23456789CFGHJMPQRVWX";function Fe(e,t=10){let n=Math.min(Math.max(e.lat,-90),90)+90,o=((e.lng+180)%360+360)%360,s="",r=20,a=20;for(let i=0;i<5;i++){let l=Math.floor(n/r)%20,c=Math.floor(o/a)%20;s+=ye[l],s+=ye[c],i===3&&(s+="+"),r/=20,a/=20}return s.slice(0,t+1)}function ce(e,t){let n=Fe(e),o=`${n.slice(4)} ${t}`;return{global_code:n,compound_code:o}}function D(e,t){return Buffer.from(`${E(e)}::${t}`).toString("base64url")}function H(e){try{let[t,n]=Buffer.from(e,"base64url").toString("utf8").split("::"),o=Number(n);return t===void 0||!Number.isFinite(o)?null:{query:t,offset:o}}catch{return null}}function le(e){let t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return{open_now:!0,periods:t.map((o,s)=>({open:{day:s,time:"0900"},close:{day:s,time:"1700"}})),weekday_text:t.map(o=>`${o}: 9:00 AM \u2013 5:00 PM`)}}function Ee(e){return[{author_name:"A. Traveler",rating:5,relative_time_description:"a month ago",text:`Great experience at ${e.name}.`,time:17e8,language:"en"},{author_name:"B. Local",rating:4,relative_time_description:"2 months ago",text:`Solid spot in ${e.name}.`,time:1697e6,language:"en"}]}var Z="googlemaps",X="1970-01-01T00:00:00.000Z";function u(e,t={},n){return{status:200,body:{status:e,...n?{error_message:n}:{},...t}}}function _(e,t,n,o){return{status:e,body:{error:{code:t,message:o,status:n}}}}function G(e){if(!e?.trim())return{};try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function M(e){if(!e)return null;let t=e.trim().match(/^(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)$/);if(!t)return null;let n=Number(t[1]),o=Number(t[2]);return!Number.isFinite(n)||!Number.isFinite(o)||n<-90||n>90||o<-180||o>180?null:{lat:n,lng:o}}function Be(e,t){if(x(e))return null;let n=je(e,t);if(n)return n;let o=I(e);return o?W(o):ae(e)}function je(e,t){let n=E(e),o=ue(Z,t).find(s=>s.type==="geocode"&&s.normalized===n);return o?o.result:null}async function de(e,t){if(!e.readOnly)try{let n=ue(Z,e.root).filter(s=>s.type==="audit").length,o=`audit_${y({...t,seq:n,at:e.occurredAt??X})}`;await xe(Z,{operation:"audit.append",subjectType:"audit",subjectId:o,fields:{id:o,...t,occurredAt:e.occurredAt??X},occurredAt:e.occurredAt??X,actor:{kind:"system"}},e.root)}catch{}}function We(e){return ue(Z,e).filter(t=>t.type==="audit").map(t=>{let{type:n,updatedAt:o,...s}=t;return s})}function Ke(e){let t={};if(!e)return t;for(let n of e.split("|")){let[o,s]=n.split(":");o&&s&&(t[o.trim().toLowerCase()]=s.trim().toLowerCase())}return t}function Ie(e){let t=Array.isArray(e.address_components)?e.address_components:[],n=t.find(o=>o.types?.includes("locality"))?.long_name??t.find(o=>o.types?.includes("administrative_area_level_1"))?.long_name??e.formatted_address;return{...e,plus_code:ce(e.geometry.location,String(n))}}function ze(e){if(!e)return null;let[t,n]=e.split("|"),o=M(t),s=M(n);return o&&s?{sw:o,ne:s}:null}function Ye(e,t){let n=e.searchParams.get("address"),o=e.searchParams.get("components"),s=e.searchParams.get("place_id"),r=e.searchParams.get("language"),a=ze(e.searchParams.get("bounds")),i=Ke(o);if(!n&&!o&&!s)return u("INVALID_REQUEST",{results:[]},"Invalid request. Missing the `address`, `components`, or `place_id` parameter.");if(s){let d=U(s);return d?u("OK",{results:[Ie(Te(W(d),r))]}):u("ZERO_RESULTS",{results:[]})}let l=n??o,c=Be(l,t);if(c&&i.country){let d=c.address_components.find(f=>f.types.includes("country"))?.short_name?.toLowerCase(),p=I(l),m=p?se(p):d;if(m&&m!==i.country)return u("ZERO_RESULTS",{results:[]})}if(!c)return u("ZERO_RESULTS",{results:[]});if(a&&!I(l)){let d=c.geometry.location,p={lat:Math.round(Math.min(Math.max(d.lat,a.sw.lat),a.ne.lat)*1e7)/1e7,lng:Math.round(Math.min(Math.max(d.lng,a.sw.lng),a.ne.lng)*1e7)/1e7};c={...c,geometry:{...c.geometry,location:p,viewport:N(p)}}}return c=Te(c,r),c=Ie(c),u("OK",{results:[c]})}function Te(e,t){let n=Ae(e.formatted_address,t);return n===e.formatted_address?e:{...e,formatted_address:n}}function Ze(e){let t=M(e.searchParams.get("latlng"));if(!t)return u("INVALID_REQUEST",{results:[]},"Invalid request. Missing or invalid `latlng` parameter.");let n=j(t),o={...W(n,"APPROXIMATE"),geometry:{location:t,location_type:"APPROXIMATE",viewport:N(t)}};return u("OK",{results:[o]})}function Qe(e){let t=(e.searchParams.get("origins")??"").split("|").filter(Boolean),n=(e.searchParams.get("destinations")??"").split("|").filter(Boolean);if(t.length===0||n.length===0)return u("INVALID_REQUEST",{},"Invalid request. Missing the `origins` or `destinations` parameter.");if(t.length*n.length>100)return u("MAX_ELEMENTS_EXCEEDED",{},"Number of origins and destinations exceeds the per-query limit of 100 elements.");let o=e.searchParams.get("units")==="metric",s=(e.searchParams.get("mode")??"driving").toLowerCase(),r=Re[s]??"DRIVING",a=Le[r]??40,i=!!e.searchParams.get("departure_time")&&r==="DRIVING",l=g=>M(g)??(x(g)?null:I(g)?.location??L(E(g))),c=t.map(l),d=n.map(l),p=t.map(g=>g),m=n.map(g=>g),f=c.map(g=>({elements:d.map(P=>{if(!g||!P)return{status:"NOT_FOUND"};let h=Math.max(1,O(g,P)),w=Math.max(60,Math.round(h/1e3/a*3600)),$={status:"OK",duration:{value:w,text:v(w)},distance:{value:h,text:K(h,o)}};if(i){let A=Math.round(w*1.25);$.duration_in_traffic={value:A,text:v(A)}}return $})}));return u("OK",{origin_addresses:p,destination_addresses:m,rows:f})}var Re={driving:"DRIVING",walking:"WALKING",bicycling:"BICYCLING",transit:"TRANSIT"},Le={DRIVING:40,WALKING:5,BICYCLING:15,TRANSIT:30};function C(e){return M(e)??I(e)?.location??L(E(e))}function b(e){return M(e)?e:I(e)?.formatted_address??e}function Je(e,t,n,o,s={}){let r=C(e),a=C(t),i=Math.max(1,O(r,a)),l=Le[n]??40,c=Math.max(60,Math.round(i/1e3/l*3600)),d={travel_mode:n,distance:{value:i,text:K(i,o)},duration:{value:c,text:v(c)},start_location:r,end_location:a,html_instructions:`Head toward ${b(t)}`,polyline:{points:V([r,a])}};s.transit&&n==="TRANSIT"&&(d.transit_details={arrival_stop:{name:`${b(t)} Station`,location:a},departure_stop:{name:`${b(e)} Station`,location:r},departure_time:{value:0,text:"12:00am",time_zone:"UTC"},arrival_time:{value:c,text:v(c),time_zone:"UTC"},headsign:b(t),num_stops:Math.max(1,Math.round(i/2e3)),line:{name:"Twin Line",short_name:"TL",vehicle:{name:"Train",type:"HEAVY_RAIL",icon:"//twin/rail.png"},agencies:[{name:"Twin Transit",url:"https://twin.local"}]}});let p={distance:{value:i,text:K(i,o)},duration:{value:c,text:v(c)},start_address:b(e),end_address:b(t),start_location:r,end_location:a,steps:[d]};if(s.traffic){let m=Math.round(c*1.25);p.duration_in_traffic={value:m,text:v(m)}}return p}function Me(e,t,n,o,s){let r=[];for(let d=0;d<e.length-1;d++)r.push(Je(e[d],e[d+1],t,n,s));let a=e.map(C),i=a.map(d=>d.lat),l=a.map(d=>d.lng),c={lat:(Math.min(...i)+Math.max(...i))/2,lng:(Math.min(...l)+Math.max(...l))/2};return{summary:`${b(e[0])} to ${b(e[e.length-1])}${s.summarySuffix??""}`,legs:r,overview_polyline:{points:V(a)},bounds:N(c,(Math.max(...i)-Math.min(...i))/2+.01),copyrights:"Map data \xA92024 (twin)",warnings:s.warnings??[],waypoint_order:o}}function qe(e){let t=e.searchParams.get("origin"),n=e.searchParams.get("destination");if(!t||!n)return u("INVALID_REQUEST",{routes:[]},"Invalid request. Missing the `origin` or `destination` parameter.");if(x(t)||x(n))return u("ZERO_RESULTS",{routes:[]});let o=e.searchParams.get("units")==="metric",s=(e.searchParams.get("mode")??"driving").toLowerCase(),r=Re[s]??"DRIVING",a=e.searchParams.get("waypoints"),i=[],l=!1;if(a){let A=a;/^optimize:true\|/i.test(A)&&(l=!0,A=A.replace(/^optimize:true\|/i,"")),i=A.split("|").map(R=>R.replace(/^via:/i,"")).filter(Boolean)}let c=i.map((A,R)=>R),d=i;if(l&&i.length>1){let A=i.map((S,J)=>({w:S,i:J})),R=[],me=C(t);for(;A.length;){let S=0,J=Number.POSITIVE_INFINITY;for(let q=0;q<A.length;q++){let ge=O(me,C(A[q].w));ge<J&&(J=ge,S=q)}let fe=A.splice(S,1)[0];R.push(fe),me=C(fe.w)}d=R.map(S=>S.w),c=R.map(S=>S.i)}let p=[t,...d,n],f=!!e.searchParams.get("departure_time")&&r==="DRIVING",g=r==="TRANSIT",P=e.searchParams.get("avoid"),h=[];if(P)for(let A of P.split("|"))h.push(`Route avoids ${A}.`);let w=[Me(p,r,o,c,{traffic:f,transit:g,warnings:h})];if(e.searchParams.get("alternatives")==="true"){let A=Me(p,r,o,c,{traffic:f,transit:g,warnings:h,summarySuffix:" (alt)"});for(let R of A.legs)R.duration={value:Math.round(R.duration.value*1.15),text:v(Math.round(R.duration.value*1.15))};w.push(A)}let $=p.map(A=>({geocoder_status:"OK",place_id:I(A)?.place_id??`ChIJ${y(A)}twin`,types:["street_address"]}));return u("OK",{geocoded_waypoints:$,routes:w})}function F(e){return{place_id:e.place_id,name:e.name,formatted_address:e.formatted_address,geometry:{location:e.location,viewport:N(e.location)},types:e.types}}function He(e){let t=e.searchParams.get("input");if(!t)return u("INVALID_REQUEST",{candidates:[]},"Missing the required `input` parameter.");if(x(t))return u("ZERO_RESULTS",{candidates:[]});let n=I(t);return u("OK",{candidates:n?[F(n)]:[F(T()[0])]})}function Xe(e){return[{photo_reference:`twinphoto_${y(e.place_id)}`,height:1080,width:1920,html_attributions:[`<a href="https://maps.google.com/">${e.name}</a>`]}]}function Q(e,t){let n=[t];for(let o=1;o<23;o++)n.push({...t,place_id:`ChIJpage${y(`${e}:${o}`)}`,name:`${t.name} POI ${o}`,formatted_address:`${o} ${t.formatted_address}`});return n}function et(e){let t=e.searchParams.get("query"),n=e.searchParams.get("pagetoken");if(n){let i=H(n);if(!i)return u("INVALID_REQUEST",{results:[]},"Invalid `pagetoken`.");let l=I(i.query)??T()[0],c=Q(i.query,l),d=c.slice(i.offset,i.offset+20),p=i.offset+20,f={status:"OK",results:d.map(g=>({...F(g),rating:4.4,user_ratings_total:1280,business_status:"OPERATIONAL"})),html_attributions:[]};return p<c.length&&(f.next_page_token=D(i.query,p)),{status:200,body:f}}if(!t)return u("INVALID_REQUEST",{results:[]},"Missing the required `query` parameter.");if(x(t))return u("ZERO_RESULTS",{results:[]});let o=I(t)??T()[0],a=Q(t,o).slice(0,20).map(i=>({...F(i),rating:4.4,user_ratings_total:1280,business_status:"OPERATIONAL"}));return u("OK",{results:a,next_page_token:D(t,20),html_attributions:[]})}function tt(e){let t=e.searchParams.get("pagetoken");if(t){let d=H(t);if(!d)return u("INVALID_REQUEST",{results:[]},"Invalid `pagetoken`.");let p=I(d.query)??T()[0],m=Q(d.query,p),f=m.slice(d.offset,d.offset+20),g=d.offset+20,h={status:"OK",results:f.map(w=>({...F(w),rating:4.2,user_ratings_total:512,vicinity:w.formatted_address})),html_attributions:[]};return g<m.length&&(h.next_page_token=D(d.query,g)),{status:200,body:h}}let n=M(e.searchParams.get("location")),o=e.searchParams.get("radius"),s=e.searchParams.get("rankby");if(!n)return u("INVALID_REQUEST",{results:[]},"Missing or invalid `location` parameter.");if(!o&&s!=="distance")return u("INVALID_REQUEST",{results:[]},"You must specify a `radius` or set `rankby=distance`.");let r=j(n),a=`${n.lat},${n.lng}`,c=Q(a,r).slice(0,20).map(d=>({...F(d),rating:4.2,user_ratings_total:512,vicinity:d.formatted_address}));return u("OK",{results:c,next_page_token:D(a,20),html_attributions:[]})}function nt(e){let t=e.searchParams.get("place_id");if(!t)return u("INVALID_REQUEST",{},"Missing the required `place_id` parameter.");let n=U(t);if(!n)return u("NOT_FOUND",{},"The provided `place_id` was not found.");let o={place_id:n.place_id,name:n.name,formatted_address:n.formatted_address,address_components:n.components,geometry:{location:n.location,viewport:N(n.location)},types:n.types,url:`https://maps.google.com/?cid=${y(n.place_id)}`,utc_offset:0,rating:4.4,user_ratings_total:1280,business_status:"OPERATIONAL",opening_hours:le(n),current_opening_hours:le(n),reviews:Ee(n),editorial_summary:{overview:`${n.name} \u2014 a notable place.`,language:"en"},photos:Xe(n),plus_code:ce(n.location,_e(n))},s=e.searchParams.get("fields"),r=o;if(s){let a=new Set(s.split(",").map(i=>i.trim()).filter(Boolean));r={};for(let i of Object.keys(o))a.has(i)&&(r[i]=o[i])}return u("OK",{result:r,html_attributions:[]})}function ot(e){let t=e.searchParams.get("photo_reference")??e.searchParams.get("photoreference"),n=e.searchParams.get("maxwidth"),o=e.searchParams.get("maxheight");return t?!n&&!o?u("INVALID_REQUEST",{},"You must specify `maxwidth` or `maxheight`."):{status:200,body:{contentType:"image/jpeg",photo_reference:t,maxwidth:n?Number(n):void 0,maxheight:o?Number(o):void 0,twinNote:"twin returns photo metadata, not real imagery pixels"}}:u("INVALID_REQUEST",{},"Missing the required `photo_reference` parameter.")}function st(e){let t=e.searchParams.get("input");if(!t)return u("INVALID_REQUEST",{predictions:[]},"Missing the required `input` parameter.");if(x(t))return u("ZERO_RESULTS",{predictions:[]});let n=E(t),o=T().filter(a=>E(a.name).startsWith(n)||E(a.name).includes(n)),r=(o.length?o:[T()[0]]).slice(0,5).map(a=>({description:a.formatted_address,place_id:a.place_id,structured_formatting:{main_text:a.name,secondary_text:a.formatted_address},types:a.types,terms:[{offset:0,value:a.name}],matched_substrings:[{length:t.length,offset:0}]}));return u("OK",{predictions:r})}function at(e){let t=e.searchParams.get("input");if(!t)return u("INVALID_REQUEST",{predictions:[]},"Missing the required `input` parameter.");let n=I(t)??T()[0];return u("OK",{predictions:[{description:`${t} near ${n.name}`,place_id:n.place_id,types:["establishment"]}]})}function z(e){return{id:e.place_id,name:`places/${e.place_id}`,displayName:{text:e.name,languageCode:"en"},formattedAddress:e.formatted_address,location:{latitude:e.location.lat,longitude:e.location.lng},types:e.types,rating:4.4,userRatingCount:1280,businessStatus:"OPERATIONAL",googleMapsUri:`https://maps.google.com/?cid=${y(e.place_id)}`,photos:[{name:`places/${e.place_id}/photos/twinphoto_${y(e.place_id)}`,widthPx:1920,heightPx:1080,authorAttributions:[{displayName:e.name,uri:"https://maps.google.com/"}]}]}}function Pe(e,t){typeof t.name=="string"&&(e.name=t.name),typeof t.id=="string"&&(e.id=t.id)}function k(e,t){if(!t||t.trim()==="*"||!t.trim())return e;let n=t.split(",").map(r=>r.trim()).filter(Boolean),o={},s=(r,a,i)=>{let[l,...c]=i;if(l!==void 0&&a[l]!==void 0){if(c.length===0){r[l]=a[l];return}if(Array.isArray(a[l])){r[l]=a[l].map((d,p)=>{let m=r[l]?.[p]??{};return s(m,d,c),Pe(m,d),m});return}r[l]=r[l]??{},s(r[l],a[l],c)}};for(let r of n)s(o,e,r.split("."));return Pe(o,e),o}function we(e,t){return Q(e,t)}function rt(e,t){let n=typeof e.textQuery=="string"?e.textQuery:"",o=typeof e.pageToken=="string"?e.pageToken:void 0;if(o){let a=H(o);if(!a)return _(400,400,"INVALID_ARGUMENT","Invalid pageToken.");let i=I(a.query)??T()[0],l=we(a.query,i),d={places:l.slice(a.offset,a.offset+20).map(z)};return a.offset+20<l.length&&(d.nextPageToken=D(a.query,a.offset+20)),{status:200,body:k(d,t)}}if(!n.trim())return _(400,400,"INVALID_ARGUMENT","textQuery must be non-empty.");if(x(n))return{status:200,body:{}};let s=typeof e.pageSize=="number"?e.pageSize:void 0;if(s!==void 0){let a=I(n)??T()[0],i=we(n,a),c={places:i.slice(0,s).map(z)};return s<i.length&&(c.nextPageToken=D(n,s)),{status:200,body:k(c,t)}}let r=I(n)??T()[0];return{status:200,body:k({places:[z(r)]},t)}}function it(e,t){let n=e.locationRestriction?.circle?.center;if(!n||typeof n.latitude!="number"||typeof n.longitude!="number")return _(400,400,"INVALID_ARGUMENT","locationRestriction.circle.center is required.");let o=j({lat:n.latitude,lng:n.longitude});return{status:200,body:k({places:[z(o)]},t)}}function ct(e){let t=typeof e.input=="string"?e.input:"";if(!t.trim())return _(400,400,"INVALID_ARGUMENT","input must be non-empty.");let n=E(t),o=T().filter(a=>E(a.name).includes(n));return{status:200,body:{suggestions:(o.length?o:[T()[0]]).slice(0,5).map(a=>({placePrediction:{place:`places/${a.place_id}`,placeId:a.place_id,text:{text:a.formatted_address},structuredFormat:{mainText:{text:a.name},secondaryText:{text:a.formatted_address}},types:a.types}}))}}}function lt(e,t){let n=U(e);return n?{status:200,body:k(z(n),t)}:_(404,404,"NOT_FOUND",`Place not found: places/${e}`)}function dt(e,t,n){let o=e.searchParams.get("maxWidthPx"),s=e.searchParams.get("maxHeightPx");return!o&&!s?_(400,400,"INVALID_ARGUMENT","maxWidthPx or maxHeightPx is required."):U(t)?{status:200,body:{name:`places/${t}/photos/${n}/media`,photoUri:`https://twin.local/places/${t}/photos/${n}=s${o??s}`,contentType:"image/jpeg",twinNote:"twin returns photo metadata, not real imagery pixels"}}:_(404,404,"NOT_FOUND",`Place not found: places/${t}`)}function ee(e,t){return{location:{latitude:e.lat,longitude:e.lng},placeId:`ChIJroad${y(`${e.lat},${e.lng}`)}`,...t!==void 0?{originalIndex:t}:{}}}function ut(e){let t=e.searchParams.get("path");if(!t)return _(400,400,"INVALID_ARGUMENT","Request must specify a path.");let n=t.split("|").map(M);if(n.some(a=>a===null))return _(400,400,"INVALID_ARGUMENT","Invalid lat/lng in path.");let o=n;if(e.searchParams.get("interpolate")==="true"&&o.length>=2){let a=[];for(let i=0;i<o.length;i++)if(a.push(ee(o[i],i)),i<o.length-1){let l={lat:Math.round((o[i].lat+o[i+1].lat)/2*1e7)/1e7,lng:Math.round((o[i].lng+o[i+1].lng)/2*1e7)/1e7};a.push(ee(l,void 0))}return{status:200,body:{snappedPoints:a}}}return{status:200,body:{snappedPoints:o.map((a,i)=>ee(a,i))}}}function pt(e){let t=e.searchParams.get("points");if(!t)return _(400,400,"INVALID_ARGUMENT","Request must specify points.");let n=t.split("|").map(M);return n.some(s=>s===null)?_(400,400,"INVALID_ARGUMENT","Invalid lat/lng in points."):{status:200,body:{snappedPoints:n.map((s,r)=>ee(s,r))}}}function mt(e){let t=e.searchParams.get("path"),n=e.searchParams.getAll("placeId");return!t&&n.length===0?_(400,400,"INVALID_ARGUMENT","Request must specify path or placeId."):{status:200,body:{speedLimits:(n.length?n:t.split("|").map(M).filter(r=>!!r).map(r=>`ChIJroad${y(`${r.lat},${r.lng}`)}`)).map(r=>({placeId:r,speedLimit:45+parseInt(y(r).slice(0,2),16)%40,units:"KPH"}))}}}function ft(e){let t=M(e.searchParams.get("location")),n=e.searchParams.get("timestamp");if(!t)return u("INVALID_REQUEST",{},"Invalid or missing `location` parameter.");if(n===null||!Number.isFinite(Number(n)))return u("INVALID_REQUEST",{},"Invalid or missing `timestamp` parameter.");let o=ie(t,Number(n));return u("OK",{dstOffset:o.dstOffset,rawOffset:o.rawOffset,timeZoneId:o.timeZoneId,timeZoneName:o.timeZoneName})}function gt(e){let t=e.searchParams.get("locations"),n=e.searchParams.get("path"),o=e.searchParams.get("samples");if(!t&&!n)return u("INVALID_REQUEST",{results:[]},"Invalid request. Missing `locations` or `path`.");let s;if(t)s=t.split("|").map(M);else{if(!o||!Number.isFinite(Number(o)))return u("INVALID_REQUEST",{results:[]},"`path` requests require `samples`.");s=n.split("|").map(M)}if(s.some(a=>a===null))return u("INVALID_REQUEST",{results:[]},"Invalid location in request.");let r=s.map(a=>({elevation:re(a),location:a,resolution:4.771975994110107}));return u("OK",{results:r})}function ht(e){let t=JSON.stringify(e?.wifiAccessPoints??e?.cellTowers??e?.considerIp??"default"),n=L(t);return{status:200,body:{location:{lat:n.lat,lng:n.lng},accuracy:1500}}}function yt(e){let t=e.searchParams.get("center"),n=e.searchParams.get("markers"),o=e.searchParams.get("size");if(!o)return _(400,400,"INVALID_ARGUMENT","Missing the required `size` parameter.");if(!t&&!n&&!e.searchParams.get("path"))return _(400,400,"INVALID_ARGUMENT","Static map requests must include `center` (with `zoom`), `markers`, or `path`.");let s=e.searchParams.get("maptype")??"roadmap";return["roadmap","satellite","terrain","hybrid"].includes(s)?{status:200,body:{contentType:"image/png",size:o,center:t,maptype:s,markers:e.searchParams.getAll("markers"),path:e.searchParams.getAll("path"),style:e.searchParams.getAll("style"),scale:e.searchParams.get("scale")?Number(e.searchParams.get("scale")):1,twinNote:"twin returns image metadata, not real imagery pixels"}}:_(400,400,"INVALID_ARGUMENT",`Invalid maptype: ${s}`)}function _t(e){let t=e.searchParams.get("location"),n=e.searchParams.get("pano"),o=e.searchParams.get("size");return o?!t&&!n?_(400,400,"INVALID_ARGUMENT","Street View requests must include `location` or `pano`."):{status:200,body:{contentType:"image/jpeg",size:o,twinNote:"twin returns image metadata, not real imagery pixels"}}:_(400,400,"INVALID_ARGUMENT","Missing the required `size` parameter.")}function At(e){let t=e.searchParams.get("location"),n=e.searchParams.get("pano");if(!t&&!n)return u("INVALID_REQUEST",{},"Street View metadata requires `location` or `pano`.");let o=M(t)??L(t??n??"");return t&&x(t)?u("ZERO_RESULTS",{}):u("OK",{copyright:"\xA9 Google (twin)",date:"2024-01",location:{lat:o.lat,lng:o.lng},pano_id:n??`pano_${y(`${o.lat},${o.lng}`)}`})}function Et(e){let t=e?.address,n=Array.isArray(t?.addressLines)?t.addressLines:[];if(n.length===0)return _(400,400,"INVALID_ARGUMENT","address.addressLines must be non-empty.");let o=n.join(", "),s=I(o),r=s?.location??L(E(o)),a=s?{inputGranularity:"PREMISE",validationGranularity:"PREMISE",geocodeGranularity:"PREMISE",addressComplete:!0,hasUnconfirmedComponents:!1}:{inputGranularity:"ROUTE",validationGranularity:"ROUTE",geocodeGranularity:"ROUTE",addressComplete:!1,hasUnconfirmedComponents:!0},i=s?"CONFIRMED":"UNCONFIRMED_BUT_PLAUSIBLE",c=(s?s.components:[{long_name:n[0]??o,short_name:n[0]??o,types:["route"]}]).map(m=>({componentName:{text:m.long_name,languageCode:"en"},componentType:m.types[0]??"route",confirmationLevel:i,inferred:!1,spellCorrected:!1})),p=(s?se(s)==="us":/\b(usa|united states)\b/i.test(o)||n.some(m=>/\b[A-Z]{2}\s*\d{5}\b/.test(m)))?{standardizedAddress:{firstAddressLine:n[0]??o,cityStateZipAddressLine:"MOUNTAIN VIEW CA 94043-1351",city:"MOUNTAIN VIEW",state:"CA",zipCode:"94043",zipCodeExtension:"1351"},deliveryPointCode:"99",dpvConfirmation:s?"Y":"N",carrierRoute:"C909"}:void 0;return{status:200,body:{result:{verdict:a,address:{formattedAddress:s?.formatted_address??o,postalAddress:{addressLines:n},addressComponents:c},geocode:{location:{latitude:r.lat,longitude:r.lng},placeId:s?.place_id??`ChIJ${y(o)}twin`},...p?{uspsData:p}:{}},responseId:`resp_${y(o)}`}}}function Y(e){if(!e||typeof e!="object")return null;let t=e.location?.latLng;if(t&&typeof t.latitude=="number"&&typeof t.longitude=="number")return{lat:t.latitude,lng:t.longitude};if(typeof e.address=="string"&&e.address.trim())return x(e.address)?null:C(e.address);if(typeof e.placeId=="string"){let n=U(e.placeId);return n?n.location:L(e.placeId)}return null}function It(e,t){let n=Y(e.origin),o=Y(e.destination);if(!e.origin||!e.destination)return _(400,400,"INVALID_ARGUMENT","Both origin and destination are required.");if(!n||!o)return{status:200,body:{}};let s=typeof e.travelMode=="string"?e.travelMode.toUpperCase():"DRIVE",a={DRIVE:40,WALK:5,BICYCLE:15,TRANSIT:30,TWO_WHEELER:35}[s]??40,i=Array.isArray(e.intermediates)?e.intermediates.map(f=>Y(f)).filter(f=>!!f):[],l=[n,...i,o],c=0;for(let f=0;f<l.length-1;f++)c+=Math.max(1,O(l[f],l[f+1]));let d=Math.max(60,Math.round(c/1e3/a*3600)),p=(f,g)=>({distanceMeters:f,duration:`${g}s`,polyline:{encodedPolyline:V(l)},legs:(()=>{let P=[];for(let h=0;h<l.length-1;h++){let w=Math.max(1,O(l[h],l[h+1])),$=Math.max(60,Math.round(w/1e3/a*3600));P.push({distanceMeters:w,duration:`${$}s`,polyline:{encodedPolyline:V([l[h],l[h+1]])},startLocation:{latLng:{latitude:l[h].lat,longitude:l[h].lng}},endLocation:{latLng:{latitude:l[h+1].lat,longitude:l[h+1].lng}}})}return P})(),travelAdvisory:{},routeLabels:[f===c?"DEFAULT_ROUTE":"DEFAULT_ROUTE_ALTERNATE"]}),m=[p(c,d)];return e.computeAlternativeRoutes===!0&&m.push(p(Math.round(c*1.1),Math.round(d*1.15))),{status:200,body:k({routes:m},t)}}function Tt(e,t){let n=Array.isArray(e.origins)?e.origins:[],o=Array.isArray(e.destinations)?e.destinations:[];if(n.length===0||o.length===0)return _(400,400,"INVALID_ARGUMENT","origins and destinations are required.");let s=typeof e.travelMode=="string"?e.travelMode.toUpperCase():"DRIVE",a={DRIVE:40,WALK:5,BICYCLE:15,TRANSIT:30,TWO_WHEELER:35}[s]??40,i=n.map(p=>Y(p.waypoint??p)),l=o.map(p=>Y(p.waypoint??p)),c=[];for(let p=0;p<i.length;p++)for(let m=0;m<l.length;m++){let f=i[p],g=l[m];if(!f||!g){c.push({originIndex:p,destinationIndex:m,status:{},condition:"ROUTE_NOT_FOUND"});continue}let P=Math.max(1,O(f,g)),h=Math.max(60,Math.round(P/1e3/a*3600));c.push({originIndex:p,destinationIndex:m,status:{},distanceMeters:P,duration:`${h}s`,condition:"ROUTE_EXISTS"})}return{status:200,body:t&&t.trim()&&t.trim()!=="*"?c.map(p=>k(p,t)):c}}async function pe(e){let t=e.method.toUpperCase(),n=new URL(e.path,"http://twin.local"),o=n.pathname;o=o.replace(/^\/api(?=\/)/,"");let s=o.startsWith("/v1/")||o.startsWith("/v1:")||o.startsWith("/v1beta")||o.startsWith("/v2:")||o.includes(":computeRoutes")||o.includes(":computeRouteMatrix")||o.includes(":searchText")||o.includes(":searchNearby")||o.includes(":autocomplete"),r=he(n,e.headers);if(!r.ok)return s?_(403,403,"PERMISSION_DENIED",r.message):u(r.status,{},r.message);let a=oe(e.headers,"x-goog-fieldmask");if(t==="GET"&&o==="/twin/audit")return{status:200,body:{entries:We(e.root)}};if(t==="POST"&&o==="/twin/geocode"){if(e.readOnly)return{status:405,body:{error:{code:405,status:"METHOD_NOT_ALLOWED",message:"twin is read-only"}}};let c=G(e.body),d=String(c.address??""),p=c.result;if(!d||!p)return{status:400,body:{error:{code:400,status:"INVALID_ARGUMENT",message:"address and result are required"}}};let m=E(d),f=`geocode_${y(m)}`;return{status:200,body:await xe(Z,{operation:"geocode.upsert",subjectType:"geocode",subjectId:f,fields:{id:f,normalized:m,address:d,result:p},occurredAt:e.occurredAt??X,actor:{kind:"system"}},e.root)}}if(t==="GET"){if(o==="/maps/api/geocode/json"){let c=n.searchParams.get("latlng")?Ze(n):Ye(n,e.root);return await de(e,{api:"geocode",status:String(c.body.status),query:n.searchParams.get("address")??n.searchParams.get("latlng")??""}),c}if(o==="/maps/api/distancematrix/json"){let c=Qe(n);return await de(e,{api:"distancematrix",status:String(c.body.status)}),c}if(o==="/maps/api/directions/json"){let c=qe(n);return await de(e,{api:"directions",status:String(c.body.status)}),c}if(o==="/maps/api/place/findplacefromtext/json")return He(n);if(o==="/maps/api/place/textsearch/json")return et(n);if(o==="/maps/api/place/nearbysearch/json")return tt(n);if(o==="/maps/api/place/details/json")return nt(n);if(o==="/maps/api/place/photo")return ot(n);if(o==="/maps/api/place/autocomplete/json")return st(n);if(o==="/maps/api/place/queryautocomplete/json")return at(n);if(o==="/maps/api/timezone/json")return ft(n);if(o==="/maps/api/elevation/json")return gt(n);if(o==="/maps/api/staticmap")return yt(n);if(o==="/maps/api/streetview")return _t(n);if(o==="/maps/api/streetview/metadata")return At(n);if(o==="/v1/snapToRoads")return ut(n);if(o==="/v1/nearestRoads")return pt(n);if(o==="/v1/speedLimits")return mt(n)}if(t==="POST"){if(o==="/maps/api/geolocation/json"||o==="/geolocation/v1/geolocate")return ht(G(e.body));if(o==="/v1/places:searchText")return rt(G(e.body),a);if(o==="/v1/places:searchNearby")return it(G(e.body),a);if(o==="/v1/places:autocomplete")return ct(G(e.body));if(o==="/v1:validateAddress")return Et(G(e.body));if(o==="/directions/v2:computeRoutes"||o==="/v2:computeRoutes")return It(G(e.body),a);if(o==="/distanceMatrix/v2:computeRouteMatrix"||o==="/v2:computeRouteMatrix")return Tt(G(e.body),a)}let i=o.match(/^\/v1\/places\/([^/:]+)\/photos\/([^/:]+)\/media$/);if(t==="GET"&&i)return dt(n,decodeURIComponent(i[1]),decodeURIComponent(i[2]));let l=o.match(/^\/v1\/places\/([^/:]+)$/);return t==="GET"&&l?lt(decodeURIComponent(l[1]),a):s?_(404,404,"NOT_FOUND",`Operation not modeled: ${t} ${o}`):u("INVALID_REQUEST",{},`Operation not modeled: ${t} ${o}`)}import{serveHttp as zt}from"../../engine/v2/volter_world-core.mjs";import{createTwinFetchFromHandler as Mt,statefulTwinManifest as Pt}from"../../engine/v2/volter_world-core.mjs";function Ne(e={}){return Mt(pe,{...e,manifest:Pt({vendor:"googlemaps",twinOf:"the Google Maps Platform web services",stores:"deterministic geocoding/places/roads answers derived from the request"})})}import{observeResources as Nt,projectResources as vt}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as wt,rateBudgetPath as qt,rateBudgetWeight as Ht,RateBudget as Xt}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as Ge}from"../../engine/v2/volter_world-core.mjs";var xt="googlemaps",ve=6e4,Se=300,Oe=300,te={geocode:1,placeDetails:4,other:2},ne={windowMs:ve,ceiling:Se,defaultWeight:te.other,maxRetryAfterSeconds:Oe,rules:[{match:"^GET /maps/api/place/details",weight:te.placeDetails},{match:"^GET /maps/api/geocode/",weight:te.geocode}],reason:"Google documents the Geocoding API as rate-limited to 3,000 QPM (queries per minute), counted as the sum of client-side and server-side queries, and the Maps Platform FAQ warns that repeatedly exceeding a product's QPM can get access temporarily blocked. 300 weighted units / 60s prices a geocode at 1, so the ceiling is 10% of that documented limit \u2014 many times a legitimate pull of a few dozen addresses, and a hard stop for the careless loop that the ~4.5-day Figma lockout (2026-07-25) showed the cost of. Place Details costs 4 because Google publishes NO per-minute figure for it and its response is the pack's largest \u2014 a judgement call, not a published cost."};wt(xt,ne);var St="1970-01-01T00:00:00.000Z";async function Ot(e,t){let n=[];for(let o of t){let s=await e({method:"GET",path:`/maps/api/geocode/json?address=${encodeURIComponent(o)}`});if(s.status<200||s.status>=300)continue;let r=s.data;if(r.status!=="OK"||!r.results?.length)continue;let a=E(o),i=`geocode_${y(a)}`;n.push({type:"geocode",id:i,fields:{id:i,normalized:a,address:o,result:r.results[0],source:"connector"}})}return n}async function Gt(e,t){let n=[];for(let o of t){let s=await e({method:"GET",path:`/maps/api/place/details/json?place_id=${encodeURIComponent(o)}`});if(s.status<200||s.status>=300)continue;let r=s.data;r.status!=="OK"||!r.result||n.push({type:"place",id:`place_${o}`,fields:{id:`place_${o}`,placeId:o,...r.result,source:"connector"}})}return n}async function be(e,t={}){let n=await Ot(e,t.addresses??[]),o=await Gt(e,t.placeIds??[]),s=[...n,...o],r=bt(s,t);return{observed:r.observed,deltasAppended:r.appended}}function bt(e,t){let n=t.occurredAt??St;return Nt("googlemaps",e.map(o=>({type:o.type,id:o.id,fields:o.fields})),{...t.root!==void 0?{root:t.root}:{},at:n,batch:`obs:googlemaps:${n}`})}function Ut(e){return async({method:t,path:n,body:o})=>{let s=await e({method:t,path:n,headers:{accept:"application/json",...o?{"content-type":"application/json"}:{}},...o===void 0?{}:{body:JSON.stringify(o)}}),r={};if(s.body)try{r=JSON.parse(s.body)}catch{r={error_message:s.body}}return{status:s.status,data:r}}}async function Ue(e,t={}){let n=[];for(let o of vt("googlemaps",t.root)){if(o.type!=="geocode")continue;let s=o.address;typeof s=="string"&&s&&n.push(s)}return be(Ut(e),{addresses:n,...t.root!==void 0?{root:t.root}:{},...t.occurredAt!==void 0?{occurredAt:t.occurredAt}:{}})}async function De(e,t,n){return{externalId:t.subject.id,data:{performed:!1,reason:`${t.operation??t.subject.type}: the Google Maps APIs answer questions and accept no writes \u2014 nothing to perform`}}}import{registerPack as Dt}from"../../engine/v2/volter_world-core.mjs";var Ct={protocol:"2",refresh:{every:"1h",onDemand:{atMost:"60s"}},stateSystem:{perform:De,refresh:Ue},roundTrip:{method:"POST",path:"/twin/geocode?key=round-trip",body:{address:"1600 Amphitheatre Parkway, Mountain View, CA",result:{formatted_address:"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",geometry:{location:{lat:37.4224,lng:-122.0842}},place_id:"ChIJ_round_trip",types:["street_address"]}}},references:[],auth:{in:"query",name:"key"},parityOrigin:"http://twin",vendor:"googlemaps",rateBudget:ne,transport:"rest",archetype:"crud",bin:"world-googlemaps",resources:["geocode","audit"],specSource:"Google Maps Platform web-service APIs (Geocoding, Distance Matrix, Directions, Places + Places API New, Roads, Time Zone, Elevation, Geolocation, Address Validation, Static Maps, Street View Static) \u2014 deterministic canned data in faithful response shapes",description:"Google Maps Platform twin \u2014 deterministic, offline replicas of the Maps web-service APIs in vendor-faithful response shapes with the real status semantics + API-key gate.",adoption:{pypi:["googlemaps"],sdks:["@googlemaps/google-maps-services-js"],scopes:["@googlemaps/"],envStems:["GOOGLEMAPS"]},hosts:[{host:"maps.googleapis.com"}],browserRouting:{apiPathPrefix:"/maps/api/",loaderHost:"https://maps.googleapis.com"}};Dt(Ct);export{Ne 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-googleoauth
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-googleoauth 1.0.2 by Volter (https://github.com/volter-ai),
|
|
4
|
+
licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
|
|
7
|
+
fetch factory is included; shared modules are imported from the AgentTwin twin engine.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
|
|
2
|
+
var M=Object.defineProperty;var Z=(e,t)=>{for(var o in t)M(e,o,{get:t[o],enumerable:!0})};import{packOf as pe,registerPack as me}from"../../engine/v3/volter_world-core.mjs";var b={vendor:"googleoauth",service:"googleoauth",body:{json:"always"},ids:{template:"{uuid}"},time:"unix",error:{error:"{code}",error_description:"{message}"},readOnly:{status:403,code:"access_denied",message:"This twin was started read-only; writes are refused."},notFound:{status:404,code:"not_found",message:"Not Found"},list:{style:"envelope",envelope:{items:"{data}"},limit:{param:"maxResults",default:100,max:100}},deleted:{},screens:[{id:"choose",kind:"flow",host:"accounts.google.com",path:"/o/oauth2/v2/auth",demand:"every sign-in with Google chooses an account and consents here",status:"done",controls:["Choose an account","Continue"],source:"https://developers.google.com/identity/protocols/oauth2/web-server"}],doors:[{id:"clients",method:"POST",path:"/_twin/clients",note:"an OAuth client (the console's)"},{id:"accounts",method:"POST",path:"/_twin/accounts",note:"a Google account a person chooses"},{id:"serviceAccounts",method:"POST",path:"/_twin/service-accounts",note:"a service account (its JWT's iss)"}],discovery:{twinOf:"Google OAuth 2.0 and OpenID Connect (accounts.google.com, oauth2.googleapis.com, www.googleapis.com/oauth2, openidconnect.googleapis.com): the account chooser, tokens by code with PKCE, refresh and service-account assertions, revocation, tokeninfo, userinfo and keys",stores:"OAuth clients, the World's Google accounts and service accounts, codes and refresh tokens (by their SHA-256), and access tokens as the Google API packs read them"},resources:{_serial:{idPrefix:"",ids:"{n}"}},descriptor:{protocol:"3",transport:"rest",archetype:"crud",bin:"world-googleoauth",resources:["client","account","access_token"],specSource:"spec/openapi.json: Google's OAuth 2.0 and OpenID Connect endpoints as its identity pages document them, and the oauth2 v2 Discovery document (spec/SOURCE.md)",description:"Google OAuth twin \u2014 the account chooser, tokens by code (with PKCE), refresh token and service-account JWT assertion, revocation, tokeninfo, userinfo and signing keys; its access tokens are the rows the Google API packs read.",adoption:{sdks:["google-auth-library","@googleapis/oauth2"],envStems:["GOOGLE_CLIENT","GOOGLE_OAUTH"]},hosts:[{host:"accounts.google.com",pathPattern:"^/(o/oauth2/v2/auth(/oauthchooseaccount|/choose)?|o/oauth2/auth|o/oauth2/token|signin/oauth/error|\\.well-known/openid-configuration)/?$"},{host:"accounts.google.com",pathPattern:"^/_twin/"},{host:"oauth2.googleapis.com",pathPattern:"^/(token|oauth2/v4/token|revoke|tokeninfo|device/code)/?$"},{host:"www.googleapis.com",pathPattern:"^/(oauth2/(v1/certs|v3/(certs|userinfo)|v2/userinfo)|userinfo/v2/me)/?$"},{host:"openidconnect.googleapis.com"}],endpointEnvNone:"Google's OAuth libraries read no base-URL variable: the endpoints are the discovery document's, claimed by the host rules.",credentialDoor:{path:"/_twin/service-accounts",body:{client_email:"world@world-project.iam.gserviceaccount.com"},fill:{GOOGLE_APPLICATION_CREDENTIALS:"file:credentials"}}}};var S={generatedBy:"scripts/derive-pack.ts",spec:"openapi.json",format:"openapi",version:"2026-09-29",resources:[],operations:[{id:"openidConfiguration",method:"get",path:"/.well-known/openid-configuration",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"discovery"},{id:"deviceCode",method:"post",path:"/device/code",pathParams:[],query:[],body:[{name:"client_id",type:"string",required:!1},{name:"scope",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,class:"non-resource",family:"device"},{id:"authorizeV1",method:"get",path:"/o/oauth2/auth",pathParams:[],query:[{name:"access_type",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"prompt",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1},{name:"response_type",type:"string",required:!1},{name:"scope",type:"string",required:!1},{name:"state",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"authorization"},{id:"authorize",method:"get",path:"/o/oauth2/v2/auth",pathParams:[],query:[{name:"access_type",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"code_challenge",type:"string",required:!1},{name:"code_challenge_method",type:"string",required:!1},{name:"hd",type:"string",required:!1},{name:"include_granted_scopes",type:"string",required:!1},{name:"login_hint",type:"string",required:!1},{name:"nonce",type:"string",required:!1},{name:"prompt",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1},{name:"response_type",type:"string",required:!1},{name:"scope",type:"string",required:!1},{name:"state",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"authorization"},{id:"oauth2.tokeninfo",method:"post",path:"/oauth2/v2/tokeninfo",pathParams:[],query:[{name:"access_token",type:"string",required:!1},{name:"id_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"non-resource",family:"tokeninfo"},{id:"oauth2.userinfo.get",method:"get",path:"/oauth2/v2/userinfo",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"userinfo"},{id:"certs",method:"get",path:"/oauth2/v3/certs",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"keys"},{id:"userinfoV3",method:"get",path:"/oauth2/v3/userinfo",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"userinfo"},{id:"tokenV4",method:"post",path:"/oauth2/v4/token",pathParams:[],query:[],body:[{name:"assertion",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"code",type:"string",required:!1},{name:"grant_type",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1},{name:"refresh_token",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,class:"non-resource",family:"token"},{id:"revoke",method:"post",path:"/revoke",pathParams:[],query:[{name:"token",type:"string",required:!1}],body:[{name:"token",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,class:"non-resource",family:"revocation"},{id:"token",method:"post",path:"/token",pathParams:[],query:[],body:[{name:"assertion",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"code",type:"string",required:!1},{name:"code_verifier",type:"string",required:!1},{name:"grant_type",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1},{name:"refresh_token",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,class:"non-resource",family:"token"},{id:"tokeninfo",method:"get",path:"/tokeninfo",pathParams:[],query:[{name:"access_token",type:"string",required:!1},{name:"id_token",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"tokeninfo"},{id:"userinfo",method:"get",path:"/v1/userinfo",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,class:"computed",family:"userinfo"}]};import{createPackFetch as le}from"../../engine/v3/volter_world-core.mjs";var I={};Z(I,{accounts:()=>ee,clients:()=>Y,serviceAccounts:()=>te});var X="https://accounts.google.com",m="access_token",R="account",C="client",_="_service_account",y="_authorization_code",f="_refresh_token",x=async e=>({alg:"RS256",...await e.signingKey("google-id-token")}),z=async e=>e.crypto.jwks((await x(e)).publicPem,""),l=e=>Math.floor(Date.parse(e.occurredAt)/1e3),c=(e,t,o)=>Response.json({error:t,error_description:o},{status:e,headers:{"cache-control":"no-store"}}),d=e=>e&&e.deleted!==!0?e:void 0,p=(e,t)=>d(e.row(R,t)),v=(e,t)=>d(e.row(C,t));function N(e,t){let o=typeof t.client_id=="string"?t.client_id:void 0,r=typeof t.client_secret=="string"?t.client_secret:void 0,n=/^Basic\s+(.+)$/i.exec(e.call.request.headers.get("authorization")??"")?.[1];if(n)try{let i=atob(n),a=i.indexOf(":");o=decodeURIComponent(i.slice(0,a)),r=decodeURIComponent(i.slice(a+1))}catch{return}let s=o?v(e,o):void 0;return s&&(s.secret===void 0||s.secret===r)?s:void 0}async function h(e,t,o,r){let n="";for(let s=0;n.length<r;s++)n+=(await e.secret(`googleoauth:${o}:${s}`)).replace(/[^A-Za-z0-9_-]/g,"");return`${t}${n.slice(0,r)}`}function A(e,t){let o=t.some(n=>n==="email"||n.endsWith("/userinfo.email")),r=t.some(n=>n==="profile"||n.endsWith("/userinfo.profile"));return{...o?{email:e.email,email_verified:!0}:{},...r?{name:e.name??null,given_name:e.given_name??null,family_name:e.family_name??null,picture:e.picture??null}:{}}}async function O(e,t,o,r,n,s){let i=String(t.client_id),a=String(o.id),u=await k(e,"access-token"),g=await h(e,"ya29.a0",`access:${i}:${a}:${e.occurredAt}:${u}`,180),J=l(e)+3599;await e.write(m,g,{clientId:i,sub:a,scope:r.join(" "),expiresAt:J,revoked:!1},"access_token.create");let E={access_token:g,expires_in:3599,scope:r.join(" "),token_type:"Bearer"};if(r.includes("openid")&&(E.id_token=e.crypto.jwtSign({iss:X,azp:i,aud:i,sub:a,...s?{nonce:s}:{},...A(o,r)},await x(e),{now:l(e),expiresInSeconds:3599,kidPrefix:""})),n){let G=await h(e,"1//0",`refresh:${i}:${a}:${e.occurredAt}:${u}`,100);await e.record(f,{clientId:i,sub:a,scopes:r,created:e.occurredAt},e.crypto.digest("sha256",G,"hex")),E.refresh_token=G}return E}function P(e,t){let o=t??/^Bearer\s+(\S+)$/i.exec(e.call.request.headers.get("authorization")??"")?.[1],r=o?d(e.row(m,o)):void 0;return r&&r.revoked!==!0&&Number(r.expiresAt)>Math.floor(Date.parse(e.occurredAt)/1e3)?r:void 0}var k=async(e,t)=>Number(await e.issue("_serial"));var j=e=>Response.json({error:e},{status:400}),$=e=>e.body&&typeof e.body=="object"?e.body:{};async function Y(e){let t=$(e);return typeof t.client_id!="string"||!Array.isArray(t.redirect_uris)?j("client_id and redirect_uris are required"):(await e.write(C,t.client_id,{client_id:t.client_id,...typeof t.client_secret=="string"?{secret:t.client_secret}:{},redirect_uris:t.redirect_uris,name:t.name??t.client_id,support_email:t.support_email??null},"client.create"),Response.json({client_id:t.client_id},{status:201}))}async function ee(e){let t=$(e);if(typeof t.sub!="string"||!/^\d{21}$/.test(t.sub)||typeof t.email!="string")return j("sub (a 21-digit Google account id) and email are required");let o=typeof t.name=="string"?t.name:[t.given_name,t.family_name].filter(Boolean).join(" ")||null;return await e.write(R,t.sub,{email:t.email.toLowerCase(),name:o,given_name:t.given_name??null,family_name:t.family_name??null,picture:t.picture??null},"account.create"),Response.json({sub:t.sub},{status:201})}async function te(e){let t=$(e);if(typeof t.client_email!="string"||!/^[^@\s]+@[^@\s]+$/.test(t.client_email))return j("client_email is required");let o=t.client_email,r=await e.signingKey(`service-account:${o}`,"RS256"),n=e.crypto.digest("sha1",r.publicPem,"hex"),s=e.row(_,o),i=typeof t.client_id=="string"?t.client_id:String(s?.client_id??BigInt(`0x${e.crypto.digest("sha256",o,"hex").slice(0,16)}`).toString().padStart(21,"1").slice(0,21)),a=typeof t.project_id=="string"?t.project_id:o.split("@")[1]?.split(".")[0]??"world-project";await e.record(_,{client_email:o,client_id:i,project_id:a,private_key_id:n,public_key:r.publicPem},o);let u={type:"service_account",project_id:a,private_key_id:n,private_key:r.privatePem,client_email:o,client_id:i,auth_uri:"https://accounts.google.com/o/oauth2/auth",token_uri:"https://oauth2.googleapis.com/token",auth_provider_x509_cert_url:"https://www.googleapis.com/oauth2/v1/certs",client_x509_cert_url:`https://www.googleapis.com/robot/v1/metadata/x509/${encodeURIComponent(o)}`,universe_domain:"googleapis.com"};return Response.json({client_email:o,credentials:u},{status:201})}var w=e=>String(e??"").replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t]);function oe(e){let t=e.params,o=v(e,String(t.client_id??""));if(!o)return new Response("Error 401: invalid_client \u2014 The OAuth client was not found.",{status:401,headers:{"content-type":"text/plain; charset=utf-8"}});if(!(o.redirect_uris??[]).includes(String(t.redirect_uri??"")))return new Response("Error 400: redirect_uri_mismatch",{status:400,headers:{"content-type":"text/plain; charset=utf-8"}});let r=new URL(e.call.request.url).searchParams.toString(),s=e.rowsRaw("account").filter(i=>i.deleted!==!0).sort((i,a)=>String(i.email).localeCompare(String(a.email))).map(i=>`<form method="post" action="/o/oauth2/v2/auth/choose"><input type="hidden" name="request" value="${w(r)}"><input type="hidden" name="sub" value="${w(i.id)}"><button type="submit"><strong>${w(i.name??i.email)}</strong><br><small>${w(i.email)}</small></button></form>`).join("");return new Response(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Sign in - Google Accounts</title><style>body{font:15px/1.5 Roboto,system-ui,sans-serif;margin:0;background:#fff}main{max-width:440px;margin:48px auto;border:1px solid #dadce0;border-radius:8px;padding:36px 40px}h1{font-size:24px;font-weight:400;margin:0 0 4px}button{display:block;width:100%;text-align:left;background:#fff;border:0;border-bottom:1px solid #dadce0;padding:12px 4px;font:inherit;cursor:pointer}small{color:#5f6368}</style></head><body><main><h1>Choose an account</h1><p>to continue to <strong>${w(o.name??o.client_id)}</strong></p>${s||"<p>No Google account is in this World.</p>"}<p><small>Google Accounts, the World's twin of accounts.google.com</small></p></main></body></html>`,{headers:{"content-type":"text/html; charset=utf-8"}})}async function q(e){return oe(e)}async function B(e){return Response.json({issuer:"https://accounts.google.com",authorization_endpoint:"https://accounts.google.com/o/oauth2/v2/auth",device_authorization_endpoint:"https://oauth2.googleapis.com/device/code",token_endpoint:"https://oauth2.googleapis.com/token",userinfo_endpoint:"https://openidconnect.googleapis.com/v1/userinfo",revocation_endpoint:"https://oauth2.googleapis.com/revoke",jwks_uri:"https://www.googleapis.com/oauth2/v3/certs",response_types_supported:["code","token","id_token","code token","code id_token","token id_token","code token id_token","none"],response_modes_supported:["query","fragment","form_post"],subject_types_supported:["public"],id_token_signing_alg_values_supported:["RS256"],scopes_supported:["openid","email","profile"],token_endpoint_auth_methods_supported:["client_secret_post","client_secret_basic"],claims_supported:["aud","email","email_verified","exp","family_name","given_name","iat","iss","name","picture","sub"],code_challenge_methods_supported:["plain","S256"],grant_types_supported:["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code","urn:ietf:params:oauth:grant-type:jwt-bearer"]})}async function U(e){return Response.json(await z(e))}async function L(e){let t=String(e.params.token??"");if(d(e.row(m,t)))return await e.write(m,t,{revoked:!0},"access_token.revoke"),new Response(null,{status:200});let r=e.crypto.digest("sha256",t,"hex");return d(e.row(f,r))?(await e.remove(f,r,"refresh_token.revoke"),new Response(null,{status:200})):c(400,"invalid_token","Token expired or revoked")}async function ae(e){let t=e.params,o=String(t.grant_type??"");if(o==="urn:ietf:params:oauth:grant-type:jwt-bearer"){let n;try{n=e.crypto.jwtDecode(String(t.assertion??"")).payload}catch{return c(400,"invalid_grant","Invalid JWT Signature.")}let s=d(e.row(_,String(n.iss??"")));if(!s)return c(400,"invalid_grant","Invalid grant: account not found");let[i,a,u]=String(t.assertion??"").split(".");if(typeof s.public_key=="string"&&!e.crypto.verifyWith(s.public_key,`${i}.${a}`,Buffer.from(String(u??""),"base64url")))return c(400,"invalid_grant","Invalid JWT Signature.");if(Number(n.exp??0)<l(e))return c(400,"invalid_grant","Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe.");let g=await h(e,"ya29.c.",`sa:${String(n.iss)}:${e.occurredAt}:${await k(e,"access-token")}`,180);return await e.write(m,g,{clientId:s.client_id??String(n.iss),sub:String(n.sub??n.iss),scope:String(n.scope??""),expiresAt:l(e)+3599,revoked:!1,serviceAccountEmail:String(n.iss)},"access_token.create"),Response.json({access_token:g,expires_in:3599,token_type:"Bearer"},{headers:{"cache-control":"no-store"}})}let r=N(e,t);if(!r)return c(401,"invalid_client","The OAuth client was not found.");if(o==="authorization_code"){let n=e.crypto.digest("sha256",String(t.code??""),"hex"),s=d(e.row(y,n));if(!s||s.clientId!==r.client_id||Number(s.expires)<l(e))return c(400,"invalid_grant","Malformed auth code.");if(s.redirect_uri!==t.redirect_uri)return c(400,"redirect_uri_mismatch","Bad Request");if(s.challenge){let a=String(t.code_verifier??"");if((s.method==="S256"?e.crypto.digest("sha256",a,"base64url"):a)!==s.challenge)return c(400,"invalid_grant","Invalid code verifier.")}await e.remove(y,n,"authorization_code.redeem");let i=p(e,String(s.sub));return i?Response.json(await O(e,r,i,s.scopes,s.offline===!0,s.nonce??void 0),{headers:{"cache-control":"no-store"}}):c(400,"invalid_grant","Account has been deleted")}if(o==="refresh_token"){let n=d(e.row(f,e.crypto.digest("sha256",String(t.refresh_token??""),"hex")));if(!n||n.clientId!==r.client_id)return c(400,"invalid_grant","Token has been expired or revoked.");let s=p(e,String(n.sub));if(!s)return c(400,"invalid_grant","Token has been expired or revoked.");let i=await O(e,r,s,n.scopes,!1);return Response.json(i,{headers:{"cache-control":"no-store"}})}return c(400,"unsupported_grant_type",`Invalid grant_type: ${o}`)}async function F(e){return ae(e)}var W=()=>Response.json({error:"invalid_request",error_description:"Invalid Credentials"},{status:401,headers:{"www-authenticate":'Bearer realm="https://accounts.google.com/", error="invalid_token"'}});function ue(e){let t=P(e),o=t?p(e,String(t.sub)):void 0;return!t||!o?W():Response.json({sub:o.id,...A(o,String(t.scope).split(" "))})}async function D(e){return ue(e)}async function V(e){let t=P(e),o=t?p(e,String(t.sub)):void 0;return!t||!o?W():Response.json({id:o.id,email:o.email,verified_email:!0,name:o.name??null,given_name:o.given_name??null,family_name:o.family_name??null,picture:o.picture??null})}var K={authorize:q,certs:U,"oauth2.userinfo.get":V,openidConfiguration:B,revoke:L,token:F,userinfoV3:D};async function H(e){if(e.call.request.method==="GET")return q(e);if(e.call.request.method!=="POST"||!new URL(e.call.request.url).pathname.endsWith("/choose"))return new Response("Error 404 (Not Found)",{status:404});let t=new URLSearchParams(e.text),o=new URLSearchParams(t.get("request")??""),r=v(e,o.get("client_id")??""),n=p(e,t.get("sub")??""),s=o.get("redirect_uri")??"";if(!r||!n||!(r.redirect_uris??[]).includes(s))return new Response("Error 400: invalid_request",{status:400});let i=(o.get("scope")??"openid").split(/\s+/).filter(Boolean),a=await h(e,"4/0A",`code:${String(r.client_id)}:${String(n.id)}:${e.occurredAt}:${await k(e,"code")}`,70);await e.record(y,{clientId:r.client_id,sub:n.id,redirect_uri:s,scopes:i,offline:o.get("access_type")==="offline",nonce:o.get("nonce"),challenge:o.get("code_challenge"),method:o.get("code_challenge_method")??"plain",expires:l(e)+600},e.crypto.digest("sha256",a,"hex"));let u=new URL(s);return o.get("state")!==null&&u.searchParams.set("state",o.get("state")),u.searchParams.set("code",a),u.searchParams.set("scope",i.join(" ")),u.searchParams.set("authuser","0"),u.searchParams.set("prompt","consent"),new Response(null,{status:302,headers:{location:u.toString()}})}function T(e={}){return le({manifest:b,surface:S,handlers:K,doors:I,screens:{choose:H}},e)}import{serveHttp as Ge}from"../../engine/v3/volter_world-core.mjs";var Fe=me(pe(b,S));export{T 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-hackernews
|
|
2
|
+
|
|
3
|
+
Contains @volter/twin-hackernews 1.0.4 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.
|