agenttwin 0.3.21 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/dist/api.js +2113 -609
  2. package/dist/dashboard/assets/dashboard/agent-home.css +7 -7
  3. package/dist/dashboard/assets/dashboard/bay-morning.webp +0 -0
  4. package/dist/dashboard/assets/dashboard/golden-gate-afternoon.webp +0 -0
  5. package/dist/dashboard/assets/dashboard/golden-gate-portrait.webp +0 -0
  6. package/dist/dashboard/assets/dashboard/moonlit-coast.webp +0 -0
  7. package/dist/dashboard/assets/next/static/chunks/5663-403316746afad10e.js +1 -0
  8. package/dist/dashboard/assets/next/static/chunks/app/dashboard/{page-9c11295678539a5f.js → page-0e0392368e0a891e.js} +1 -1
  9. package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-4981ea4966b19e3e.js +1 -0
  10. package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-dd4ac0f5f36e6bfa.js +1 -0
  11. package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/{page-34574448d210c775.js → page-de0fe6d84be21e6a.js} +1 -1
  12. package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-360cbffc57981f6b.js +1 -0
  13. package/dist/dashboard/assets/next/static/chunks/app/v2/{page-07c8054d57c9089b.js → page-3e86fffabfa87d88.js} +1 -1
  14. package/dist/dashboard/assets/next/static/chunks/{webpack-40324749d289e4a5.js → webpack-be6e526fd530c797.js} +1 -1
  15. package/dist/dashboard/assets/next/static/css/{42045de5f39b50ca.css → 37d81e1d2804cc5f.css} +1 -1
  16. package/dist/dashboard/assets/next/static/css/69ec1bae997c3bb0.css +1 -0
  17. package/dist/dashboard/assets/next/static/css/ad85402a1595e56e.css +1 -0
  18. package/dist/dashboard/assets/next/static/css/{4bbe78c2fe206b92.css → da981fb878a02b8c.css} +1 -1
  19. package/dist/dashboard/assets/next/static/media/bay-morning.82669113.webp +0 -0
  20. package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.0aa49492.webp +0 -0
  21. package/dist/dashboard/assets/next/static/media/golden-gate-portrait.89fc667a.webp +0 -0
  22. package/dist/dashboard/assets/next/static/media/moonlit-coast.09739ef4.webp +0 -0
  23. package/dist/dashboard/index.html +2 -2
  24. package/dist/engine.js +6385 -4973
  25. package/dist/gateway.js +2194 -604
  26. package/dist/twins/catalog.json +6020 -0
  27. package/dist/twins/engine/v2/THIRD-PARTY.txt +25 -0
  28. package/dist/twins/engine/v2/chunks/2CHBP57N.mjs +8 -0
  29. package/dist/twins/engine/v2/chunks/4CPL6MPF.mjs +30 -0
  30. package/dist/twins/engine/v2/chunks/OYLYKZGD.mjs +2 -0
  31. package/dist/twins/engine/v2/chunks/SQSP35HM.mjs +38 -0
  32. package/dist/twins/engine/v2/chunks/YSJQQVUM.mjs +2 -0
  33. package/dist/twins/engine/v2/react-dom_client.mjs +272 -0
  34. package/dist/twins/engine/v2/react-dom_server.mjs +263 -0
  35. package/dist/twins/engine/v2/react.mjs +2 -0
  36. package/dist/twins/engine/v2/react_jsx-runtime.mjs +31 -0
  37. package/dist/twins/engine/v2/volter_world-core.mjs +195 -0
  38. package/dist/twins/engine/v2/volter_world-core_app-route.mjs +2 -0
  39. package/dist/twins/engine/v2/volter_world-core_network-policy.mjs +2 -0
  40. package/dist/twins/engine/v3/THIRD-PARTY.txt +65 -0
  41. package/dist/twins/engine/v3/chunks/2CHBP57N.mjs +8 -0
  42. package/dist/twins/engine/v3/chunks/2YSSPA5O.mjs +65 -0
  43. package/dist/twins/engine/v3/chunks/5PWRY4UK.mjs +154 -0
  44. package/dist/twins/engine/v3/chunks/7XRKSFFJ.mjs +2 -0
  45. package/dist/twins/engine/v3/chunks/AWOWH2H5.mjs +2 -0
  46. package/dist/twins/engine/v3/chunks/C46M5U3Q.mjs +2 -0
  47. package/dist/twins/engine/v3/chunks/MFH2VZPP.mjs +2 -0
  48. package/dist/twins/engine/v3/chunks/MWCO5UV3.mjs +2 -0
  49. package/dist/twins/engine/v3/chunks/N5BL5RDF.mjs +313 -0
  50. package/dist/twins/engine/v3/chunks/O7HGPMXG.mjs +2 -0
  51. package/dist/twins/engine/v3/chunks/OYLYKZGD.mjs +2 -0
  52. package/dist/twins/engine/v3/chunks/PLB7HTON.mjs +8 -0
  53. package/dist/twins/engine/v3/chunks/TY4LDBVH.mjs +7 -0
  54. package/dist/twins/engine/v3/chunks/VDIRUSCM.mjs +2 -0
  55. package/dist/twins/engine/v3/chunks/WGUCFQK6.mjs +2 -0
  56. package/dist/twins/engine/v3/chunks/WPATONSC.mjs +2 -0
  57. package/dist/twins/engine/v3/react_jsx-runtime.mjs +2 -0
  58. package/dist/twins/engine/v3/volter_world-core.mjs +2 -0
  59. package/dist/twins/engine/v3/volter_world-ui.mjs +559 -0
  60. package/dist/twins/packs/ahrefs/LICENSE +202 -0
  61. package/dist/twins/packs/ahrefs/NOTICE +7 -0
  62. package/dist/twins/packs/ahrefs/index.mjs +2 -0
  63. package/dist/twins/packs/ai-gateway/LICENSE +202 -0
  64. package/dist/twins/packs/ai-gateway/NOTICE +7 -0
  65. package/dist/twins/packs/ai-gateway/index.mjs +14 -0
  66. package/dist/twins/packs/airtable/LICENSE +202 -0
  67. package/dist/twins/packs/airtable/NOTICE +7 -0
  68. package/dist/twins/packs/airtable/index.mjs +2 -0
  69. package/dist/twins/packs/algolia/LICENSE +202 -0
  70. package/dist/twins/packs/algolia/NOTICE +7 -0
  71. package/dist/twins/packs/algolia/index.mjs +2 -0
  72. package/dist/twins/packs/ambientcg/LICENSE +202 -0
  73. package/dist/twins/packs/ambientcg/NOTICE +7 -0
  74. package/dist/twins/packs/ambientcg/index.mjs +2 -0
  75. package/dist/twins/packs/anthropic/LICENSE +202 -0
  76. package/dist/twins/packs/anthropic/NOTICE +7 -0
  77. package/dist/twins/packs/anthropic/index.mjs +18 -0
  78. package/dist/twins/packs/assemblyai/LICENSE +202 -0
  79. package/dist/twins/packs/assemblyai/NOTICE +7 -0
  80. package/dist/twins/packs/assemblyai/index.mjs +11 -0
  81. package/dist/twins/packs/aws/LICENSE +202 -0
  82. package/dist/twins/packs/aws/NOTICE +7 -0
  83. package/dist/twins/packs/aws/index.mjs +2 -0
  84. package/dist/twins/packs/azure/LICENSE +202 -0
  85. package/dist/twins/packs/azure/NOTICE +7 -0
  86. package/dist/twins/packs/azure/index.mjs +38 -0
  87. package/dist/twins/packs/azureformrecognizer/LICENSE +202 -0
  88. package/dist/twins/packs/azureformrecognizer/NOTICE +7 -0
  89. package/dist/twins/packs/azureformrecognizer/index.mjs +3 -0
  90. package/dist/twins/packs/bitly/LICENSE +202 -0
  91. package/dist/twins/packs/bitly/NOTICE +7 -0
  92. package/dist/twins/packs/bitly/index.mjs +2 -0
  93. package/dist/twins/packs/bluesky/LICENSE +202 -0
  94. package/dist/twins/packs/bluesky/NOTICE +7 -0
  95. package/dist/twins/packs/bluesky/index.mjs +30 -0
  96. package/dist/twins/packs/calcom/LICENSE +202 -0
  97. package/dist/twins/packs/calcom/NOTICE +7 -0
  98. package/dist/twins/packs/calcom/index.mjs +2 -0
  99. package/dist/twins/packs/clerk/LICENSE +202 -0
  100. package/dist/twins/packs/clerk/NOTICE +7 -0
  101. package/dist/twins/packs/clerk/index.mjs +5 -0
  102. package/dist/twins/packs/cloudflare/LICENSE +202 -0
  103. package/dist/twins/packs/cloudflare/NOTICE +7 -0
  104. package/dist/twins/packs/cloudflare/index.mjs +79 -0
  105. package/dist/twins/packs/cohere/LICENSE +202 -0
  106. package/dist/twins/packs/cohere/NOTICE +7 -0
  107. package/dist/twins/packs/cohere/index.mjs +2 -0
  108. package/dist/twins/packs/datadog/LICENSE +202 -0
  109. package/dist/twins/packs/datadog/NOTICE +7 -0
  110. package/dist/twins/packs/datadog/index.mjs +3 -0
  111. package/dist/twins/packs/deepinfra/LICENSE +202 -0
  112. package/dist/twins/packs/deepinfra/NOTICE +7 -0
  113. package/dist/twins/packs/deepinfra/index.mjs +13 -0
  114. package/dist/twins/packs/deepseek/LICENSE +202 -0
  115. package/dist/twins/packs/deepseek/NOTICE +7 -0
  116. package/dist/twins/packs/deepseek/index.mjs +12 -0
  117. package/dist/twins/packs/discord/LICENSE +202 -0
  118. package/dist/twins/packs/discord/NOTICE +7 -0
  119. package/dist/twins/packs/discord/index.mjs +2 -0
  120. package/dist/twins/packs/duckduckgo/LICENSE +202 -0
  121. package/dist/twins/packs/duckduckgo/NOTICE +7 -0
  122. package/dist/twins/packs/duckduckgo/index.mjs +532 -0
  123. package/dist/twins/packs/dynadot/LICENSE +202 -0
  124. package/dist/twins/packs/dynadot/NOTICE +7 -0
  125. package/dist/twins/packs/dynadot/index.mjs +2 -0
  126. package/dist/twins/packs/e2b/LICENSE +202 -0
  127. package/dist/twins/packs/e2b/NOTICE +7 -0
  128. package/dist/twins/packs/e2b/index.mjs +2 -0
  129. package/dist/twins/packs/elevenlabs/LICENSE +202 -0
  130. package/dist/twins/packs/elevenlabs/NOTICE +7 -0
  131. package/dist/twins/packs/elevenlabs/index.mjs +4 -0
  132. package/dist/twins/packs/expo/LICENSE +202 -0
  133. package/dist/twins/packs/expo/NOTICE +7 -0
  134. package/dist/twins/packs/expo/index.mjs +2 -0
  135. package/dist/twins/packs/fal/LICENSE +202 -0
  136. package/dist/twins/packs/fal/NOTICE +7 -0
  137. package/dist/twins/packs/fal/index.mjs +2 -0
  138. package/dist/twins/packs/figma/LICENSE +202 -0
  139. package/dist/twins/packs/figma/NOTICE +7 -0
  140. package/dist/twins/packs/figma/index.mjs +2 -0
  141. package/dist/twins/packs/firecrawl/LICENSE +202 -0
  142. package/dist/twins/packs/firecrawl/NOTICE +7 -0
  143. package/dist/twins/packs/firecrawl/index.mjs +9 -0
  144. package/dist/twins/packs/fireworks/LICENSE +202 -0
  145. package/dist/twins/packs/fireworks/NOTICE +7 -0
  146. package/dist/twins/packs/fireworks/index.mjs +13 -0
  147. package/dist/twins/packs/fly/LICENSE +202 -0
  148. package/dist/twins/packs/fly/NOTICE +7 -0
  149. package/dist/twins/packs/fly/index.mjs +2 -0
  150. package/dist/twins/packs/gcs/LICENSE +202 -0
  151. package/dist/twins/packs/gcs/NOTICE +7 -0
  152. package/dist/twins/packs/gcs/index.mjs +8 -0
  153. package/dist/twins/packs/gemini/LICENSE +202 -0
  154. package/dist/twins/packs/gemini/NOTICE +7 -0
  155. package/dist/twins/packs/gemini/index.mjs +7 -0
  156. package/dist/twins/packs/github/LICENSE +202 -0
  157. package/dist/twins/packs/github/NOTICE +7 -0
  158. package/dist/twins/packs/github/index.mjs +75153 -0
  159. package/dist/twins/packs/googleads/LICENSE +202 -0
  160. package/dist/twins/packs/googleads/NOTICE +7 -0
  161. package/dist/twins/packs/googleads/index.mjs +3 -0
  162. package/dist/twins/packs/googlemaps/LICENSE +202 -0
  163. package/dist/twins/packs/googlemaps/NOTICE +7 -0
  164. package/dist/twins/packs/googlemaps/index.mjs +2 -0
  165. package/dist/twins/packs/googleoauth/LICENSE +202 -0
  166. package/dist/twins/packs/googleoauth/NOTICE +7 -0
  167. package/dist/twins/packs/googleoauth/index.mjs +2 -0
  168. package/dist/twins/packs/hackernews/LICENSE +202 -0
  169. package/dist/twins/packs/hackernews/NOTICE +7 -0
  170. package/dist/twins/packs/hackernews/index.mjs +35 -0
  171. package/dist/twins/packs/huggingface/LICENSE +202 -0
  172. package/dist/twins/packs/huggingface/NOTICE +7 -0
  173. package/dist/twins/packs/huggingface/index.mjs +9 -0
  174. package/dist/twins/packs/inngest/LICENSE +202 -0
  175. package/dist/twins/packs/inngest/NOTICE +7 -0
  176. package/dist/twins/packs/inngest/index.mjs +2 -0
  177. package/dist/twins/packs/instagram/LICENSE +202 -0
  178. package/dist/twins/packs/instagram/NOTICE +7 -0
  179. package/dist/twins/packs/instagram/index.mjs +2 -0
  180. package/dist/twins/packs/jira/LICENSE +202 -0
  181. package/dist/twins/packs/jira/NOTICE +7 -0
  182. package/dist/twins/packs/jira/index.mjs +2 -0
  183. package/dist/twins/packs/langfuse/LICENSE +202 -0
  184. package/dist/twins/packs/langfuse/NOTICE +7 -0
  185. package/dist/twins/packs/langfuse/index.mjs +2 -0
  186. package/dist/twins/packs/linear/LICENSE +202 -0
  187. package/dist/twins/packs/linear/NOTICE +7 -0
  188. package/dist/twins/packs/linear/index.mjs +52866 -0
  189. package/dist/twins/packs/linkedin/LICENSE +202 -0
  190. package/dist/twins/packs/linkedin/NOTICE +7 -0
  191. package/dist/twins/packs/linkedin/index.mjs +78 -0
  192. package/dist/twins/packs/livekit/LICENSE +202 -0
  193. package/dist/twins/packs/livekit/NOTICE +7 -0
  194. package/dist/twins/packs/livekit/index.mjs +2 -0
  195. package/dist/twins/packs/mailgun/LICENSE +202 -0
  196. package/dist/twins/packs/mailgun/NOTICE +7 -0
  197. package/dist/twins/packs/mailgun/index.mjs +13 -0
  198. package/dist/twins/packs/mapbox/LICENSE +202 -0
  199. package/dist/twins/packs/mapbox/NOTICE +7 -0
  200. package/dist/twins/packs/mapbox/index.mjs +2 -0
  201. package/dist/twins/packs/merge/LICENSE +202 -0
  202. package/dist/twins/packs/merge/NOTICE +7 -0
  203. package/dist/twins/packs/merge/index.mjs +4 -0
  204. package/dist/twins/packs/mistral/LICENSE +202 -0
  205. package/dist/twins/packs/mistral/NOTICE +7 -0
  206. package/dist/twins/packs/mistral/index.mjs +6 -0
  207. package/dist/twins/packs/mixpanel/LICENSE +202 -0
  208. package/dist/twins/packs/mixpanel/NOTICE +8 -0
  209. package/dist/twins/packs/mixpanel/index.mjs +2 -0
  210. package/dist/twins/packs/mongodb/LICENSE +202 -0
  211. package/dist/twins/packs/mongodb/NOTICE +7 -0
  212. package/dist/twins/packs/mongodb/index.mjs +8 -0
  213. package/dist/twins/packs/moonshot/LICENSE +202 -0
  214. package/dist/twins/packs/moonshot/NOTICE +7 -0
  215. package/dist/twins/packs/moonshot/index.mjs +18 -0
  216. package/dist/twins/packs/notion/LICENSE +202 -0
  217. package/dist/twins/packs/notion/NOTICE +7 -0
  218. package/dist/twins/packs/notion/index.mjs +2 -0
  219. package/dist/twins/packs/npm-registry/LICENSE +202 -0
  220. package/dist/twins/packs/npm-registry/NOTICE +7 -0
  221. package/dist/twins/packs/npm-registry/index.mjs +2 -0
  222. package/dist/twins/packs/oa-treasury/LICENSE +202 -0
  223. package/dist/twins/packs/oa-treasury/NOTICE +8 -0
  224. package/dist/twins/packs/oa-treasury/index.mjs +16 -0
  225. package/dist/twins/packs/openai/LICENSE +202 -0
  226. package/dist/twins/packs/openai/NOTICE +7 -0
  227. package/dist/twins/packs/openai/index.mjs +3473 -0
  228. package/dist/twins/packs/openrouter/LICENSE +202 -0
  229. package/dist/twins/packs/openrouter/NOTICE +7 -0
  230. package/dist/twins/packs/openrouter/index.mjs +2 -0
  231. package/dist/twins/packs/openweather/LICENSE +202 -0
  232. package/dist/twins/packs/openweather/NOTICE +7 -0
  233. package/dist/twins/packs/openweather/index.mjs +2 -0
  234. package/dist/twins/packs/paypal/LICENSE +202 -0
  235. package/dist/twins/packs/paypal/NOTICE +7 -0
  236. package/dist/twins/packs/paypal/index.mjs +51 -0
  237. package/dist/twins/packs/pinecone/LICENSE +202 -0
  238. package/dist/twins/packs/pinecone/NOTICE +7 -0
  239. package/dist/twins/packs/pinecone/index.mjs +2 -0
  240. package/dist/twins/packs/plain/LICENSE +202 -0
  241. package/dist/twins/packs/plain/NOTICE +8 -0
  242. package/dist/twins/packs/plain/index.mjs +18426 -0
  243. package/dist/twins/packs/planetscale/LICENSE +202 -0
  244. package/dist/twins/packs/planetscale/NOTICE +7 -0
  245. package/dist/twins/packs/planetscale/index.mjs +18 -0
  246. package/dist/twins/packs/polar/LICENSE +202 -0
  247. package/dist/twins/packs/polar/NOTICE +7 -0
  248. package/dist/twins/packs/polar/index.mjs +2 -0
  249. package/dist/twins/packs/polyhaven/LICENSE +202 -0
  250. package/dist/twins/packs/polyhaven/NOTICE +7 -0
  251. package/dist/twins/packs/polyhaven/index.mjs +3 -0
  252. package/dist/twins/packs/postmark/LICENSE +202 -0
  253. package/dist/twins/packs/postmark/NOTICE +7 -0
  254. package/dist/twins/packs/postmark/index.mjs +12 -0
  255. package/dist/twins/packs/reddit/LICENSE +202 -0
  256. package/dist/twins/packs/reddit/NOTICE +7 -0
  257. package/dist/twins/packs/reddit/index.mjs +324 -0
  258. package/dist/twins/packs/redis/LICENSE +202 -0
  259. package/dist/twins/packs/redis/NOTICE +7 -0
  260. package/dist/twins/packs/redis/index.mjs +2 -0
  261. package/dist/twins/packs/replicate/LICENSE +202 -0
  262. package/dist/twins/packs/replicate/NOTICE +7 -0
  263. package/dist/twins/packs/replicate/index.mjs +2 -0
  264. package/dist/twins/packs/resend/LICENSE +202 -0
  265. package/dist/twins/packs/resend/NOTICE +7 -0
  266. package/dist/twins/packs/resend/index.mjs +139 -0
  267. package/dist/twins/packs/runhuman/LICENSE +202 -0
  268. package/dist/twins/packs/runhuman/NOTICE +7 -0
  269. package/dist/twins/packs/runhuman/index.mjs +3 -0
  270. package/dist/twins/packs/scrapecreators/LICENSE +202 -0
  271. package/dist/twins/packs/scrapecreators/NOTICE +7 -0
  272. package/dist/twins/packs/scrapecreators/index.mjs +2 -0
  273. package/dist/twins/packs/segment/LICENSE +202 -0
  274. package/dist/twins/packs/segment/NOTICE +8 -0
  275. package/dist/twins/packs/segment/index.mjs +2 -0
  276. package/dist/twins/packs/sendblue/LICENSE +202 -0
  277. package/dist/twins/packs/sendblue/NOTICE +7 -0
  278. package/dist/twins/packs/sendblue/index.mjs +2 -0
  279. package/dist/twins/packs/sendgrid/LICENSE +202 -0
  280. package/dist/twins/packs/sendgrid/NOTICE +8 -0
  281. package/dist/twins/packs/sendgrid/index.mjs +4 -0
  282. package/dist/twins/packs/sentry/LICENSE +202 -0
  283. package/dist/twins/packs/sentry/NOTICE +7 -0
  284. package/dist/twins/packs/sentry/index.mjs +5 -0
  285. package/dist/twins/packs/sigstore/LICENSE +202 -0
  286. package/dist/twins/packs/sigstore/NOTICE +7 -0
  287. package/dist/twins/packs/sigstore/index.mjs +12 -0
  288. package/dist/twins/packs/slack/LICENSE +202 -0
  289. package/dist/twins/packs/slack/NOTICE +7 -0
  290. package/dist/twins/packs/slack/index.mjs +66 -0
  291. package/dist/twins/packs/smtp/LICENSE +202 -0
  292. package/dist/twins/packs/smtp/NOTICE +7 -0
  293. package/dist/twins/packs/smtp/index.mjs +3 -0
  294. package/dist/twins/packs/snowflake/LICENSE +202 -0
  295. package/dist/twins/packs/snowflake/NOTICE +8 -0
  296. package/dist/twins/packs/snowflake/index.mjs +30 -0
  297. package/dist/twins/packs/stigg/LICENSE +202 -0
  298. package/dist/twins/packs/stigg/NOTICE +8 -0
  299. package/dist/twins/packs/stigg/index.mjs +22194 -0
  300. package/dist/twins/packs/stream/LICENSE +202 -0
  301. package/dist/twins/packs/stream/NOTICE +7 -0
  302. package/dist/twins/packs/stream/index.mjs +2 -0
  303. package/dist/twins/packs/stripe/LICENSE +202 -0
  304. package/dist/twins/packs/stripe/NOTICE +7 -0
  305. package/dist/twins/packs/stripe/index.mjs +211 -0
  306. package/dist/twins/packs/supabase/LICENSE +202 -0
  307. package/dist/twins/packs/supabase/NOTICE +7 -0
  308. package/dist/twins/packs/supabase/index.mjs +2 -0
  309. package/dist/twins/packs/supermemory/LICENSE +202 -0
  310. package/dist/twins/packs/supermemory/NOTICE +7 -0
  311. package/dist/twins/packs/supermemory/index.mjs +2 -0
  312. package/dist/twins/packs/svix/LICENSE +202 -0
  313. package/dist/twins/packs/svix/NOTICE +7 -0
  314. package/dist/twins/packs/svix/index.mjs +2 -0
  315. package/dist/twins/packs/tavily/LICENSE +202 -0
  316. package/dist/twins/packs/tavily/NOTICE +7 -0
  317. package/dist/twins/packs/tavily/index.mjs +2 -0
  318. package/dist/twins/packs/telegram/LICENSE +202 -0
  319. package/dist/twins/packs/telegram/NOTICE +7 -0
  320. package/dist/twins/packs/telegram/index.mjs +11 -0
  321. package/dist/twins/packs/temporal/LICENSE +202 -0
  322. package/dist/twins/packs/temporal/NOTICE +7 -0
  323. package/dist/twins/packs/temporal/index.mjs +44 -0
  324. package/dist/twins/packs/tiktok/LICENSE +202 -0
  325. package/dist/twins/packs/tiktok/NOTICE +7 -0
  326. package/dist/twins/packs/tiktok/index.mjs +2 -0
  327. package/dist/twins/packs/tinybird/LICENSE +202 -0
  328. package/dist/twins/packs/tinybird/NOTICE +7 -0
  329. package/dist/twins/packs/tinybird/index.mjs +50 -0
  330. package/dist/twins/packs/togetherai/LICENSE +202 -0
  331. package/dist/twins/packs/togetherai/NOTICE +7 -0
  332. package/dist/twins/packs/togetherai/index.mjs +11 -0
  333. package/dist/twins/packs/tremendous/LICENSE +202 -0
  334. package/dist/twins/packs/tremendous/NOTICE +7 -0
  335. package/dist/twins/packs/tremendous/index.mjs +2 -0
  336. package/dist/twins/packs/tripo/LICENSE +202 -0
  337. package/dist/twins/packs/tripo/NOTICE +7 -0
  338. package/dist/twins/packs/tripo/index.mjs +9 -0
  339. package/dist/twins/packs/tunnel/LICENSE +202 -0
  340. package/dist/twins/packs/tunnel/NOTICE +7 -0
  341. package/dist/twins/packs/tunnel/index.mjs +2 -0
  342. package/dist/twins/packs/twelvelabs/LICENSE +202 -0
  343. package/dist/twins/packs/twelvelabs/NOTICE +7 -0
  344. package/dist/twins/packs/twelvelabs/index.mjs +5 -0
  345. package/dist/twins/packs/twilio/LICENSE +202 -0
  346. package/dist/twins/packs/twilio/NOTICE +7 -0
  347. package/dist/twins/packs/twilio/index.mjs +2 -0
  348. package/dist/twins/packs/twitch/LICENSE +202 -0
  349. package/dist/twins/packs/twitch/NOTICE +7 -0
  350. package/dist/twins/packs/twitch/index.mjs +68 -0
  351. package/dist/twins/packs/upstash/LICENSE +202 -0
  352. package/dist/twins/packs/upstash/NOTICE +7 -0
  353. package/dist/twins/packs/upstash/index.mjs +14 -0
  354. package/dist/twins/packs/upstashvector/LICENSE +202 -0
  355. package/dist/twins/packs/upstashvector/NOTICE +7 -0
  356. package/dist/twins/packs/upstashvector/index.mjs +3 -0
  357. package/dist/twins/packs/vercel/LICENSE +202 -0
  358. package/dist/twins/packs/vercel/NOTICE +7 -0
  359. package/dist/twins/packs/vercel/index.mjs +10 -0
  360. package/dist/twins/packs/veriff/LICENSE +202 -0
  361. package/dist/twins/packs/veriff/NOTICE +7 -0
  362. package/dist/twins/packs/veriff/index.mjs +2 -0
  363. package/dist/twins/packs/vgauth/LICENSE +202 -0
  364. package/dist/twins/packs/vgauth/NOTICE +7 -0
  365. package/dist/twins/packs/vgauth/index.mjs +2 -0
  366. package/dist/twins/packs/vital/LICENSE +202 -0
  367. package/dist/twins/packs/vital/NOTICE +7 -0
  368. package/dist/twins/packs/vital/index.mjs +2 -0
  369. package/dist/twins/packs/volteridentity/LICENSE +202 -0
  370. package/dist/twins/packs/volteridentity/NOTICE +7 -0
  371. package/dist/twins/packs/volteridentity/index.mjs +2 -0
  372. package/dist/twins/packs/webrisk/LICENSE +202 -0
  373. package/dist/twins/packs/webrisk/NOTICE +7 -0
  374. package/dist/twins/packs/webrisk/index.mjs +2 -0
  375. package/dist/twins/packs/worldlabs/LICENSE +202 -0
  376. package/dist/twins/packs/worldlabs/NOTICE +7 -0
  377. package/dist/twins/packs/worldlabs/index.mjs +2 -0
  378. package/dist/twins/packs/x/LICENSE +202 -0
  379. package/dist/twins/packs/x/NOTICE +7 -0
  380. package/dist/twins/packs/x/index.mjs +63 -0
  381. package/dist/twins/packs/xai/LICENSE +202 -0
  382. package/dist/twins/packs/xai/NOTICE +7 -0
  383. package/dist/twins/packs/xai/index.mjs +4 -0
  384. package/dist/twins/packs/xidentity/LICENSE +202 -0
  385. package/dist/twins/packs/xidentity/NOTICE +8 -0
  386. package/dist/twins/packs/xidentity/index.mjs +209 -0
  387. package/dist/twins/packs/youtube/LICENSE +202 -0
  388. package/dist/twins/packs/youtube/NOTICE +7 -0
  389. package/dist/twins/packs/youtube/index.mjs +5 -0
  390. package/dist/worker.js +442 -18
  391. package/dist/world-host.js +928 -91
  392. package/package.json +5 -4
  393. package/dist/dashboard/assets/dashboard/bay-morning.png +0 -0
  394. package/dist/dashboard/assets/dashboard/golden-gate-afternoon.png +0 -0
  395. package/dist/dashboard/assets/dashboard/golden-gate-portrait.png +0 -0
  396. package/dist/dashboard/assets/dashboard/moonlit-coast.png +0 -0
  397. package/dist/dashboard/assets/next/static/chunks/2868-424d32cfc8ae81c9.js +0 -1
  398. package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-f9fca2c08f779fa0.js +0 -1
  399. package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-bc480c9258e5cc4d.js +0 -1
  400. package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-f04c0b236abaead3.js +0 -1
  401. package/dist/dashboard/assets/next/static/css/4af3c8ca0da0f48b.css +0 -1
  402. package/dist/dashboard/assets/next/static/css/6b8edde77e493a51.css +0 -1
  403. package/dist/dashboard/assets/next/static/media/bay-morning.1a9f358c.png +0 -0
  404. package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.3e7cea58.png +0 -0
  405. package/dist/dashboard/assets/next/static/media/golden-gate-portrait.7941528f.png +0 -0
  406. package/dist/dashboard/assets/next/static/media/moonlit-coast.bbe901a1.png +0 -0
  407. /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → 8f121VqXS9LLPMmYd1SRn}/_buildManifest.js +0 -0
  408. /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → 8f121VqXS9LLPMmYd1SRn}/_ssgManifest.js +0 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ @agenttwin/twin-bitly
2
+
3
+ Contains @volter/twin-bitly 0.1.37 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.
@@ -0,0 +1,2 @@
1
+ import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
2
+ import{applyTwinWrite as Pt,projectResources as zt}from"../../engine/v2/volter_world-core.mjs";var ct="bitly";var z="2026-01-01T00:00:00.000Z",G=["bit.ly","twin.link"],st="bit.ly",j={guid:"Oa1twinorg1",name:"Twin Organization",is_active:!0,tier:"enterprise",tier_family:"enterprise",tier_display_name:"Enterprise",role:"org-admin",created:z,modified:z,bsds:G,references:{groups:"/v4/groups?organization_guid=Oa1twinorg1"}},R={guid:"Ba1twingrp1",name:"Twin Group",organization_guid:j.guid,created:z,modified:z,is_active:!0,role:"org-admin",bsds:G,references:{organization:"/v4/organizations/Oa1twinorg1"}},P={login:"twin-bitly",name:"Bitly Twin User",is_active:!0,created:z,modified:z,is_sso_user:!1,is_2fa_enabled:!1,default_group_guid:R.guid,emails:[{email:"twin@bitly.twin",is_primary:!0,is_verified:!0}]},Nt={400:"BAD_REQUEST",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",409:"CONFLICT",410:"GONE",422:"UNPROCESSABLE_ENTITY",429:"MONTHLY_LIMIT_EXCEEDED"};function h(e,t=200){return{status:t,body:e}}function f(e,t,i,o){let l={message:Nt[e]??"BAD_REQUEST",resource:t,description:i};return o&&o.length>0&&(l.errors=o),{status:e,body:l}}function et(e,t){return zt(ct,t).filter(i=>i.type===e)}function L(e,t){return et(e,t).filter(i=>i.deleted!==!0)}function A(e,t,i){return et(e,i).find(o=>o.id===t)}async function v(e,t,i,o,l){await Pt(ct,{operation:`set.${e}`,subjectType:e,subjectId:t,fields:i,...l?{occurredAt:l}:{},actor:{kind:"agent"}},o)}function $(e){let{type:t,updatedAt:i,id:o,deleted:l,...p}=e;return p}var Ct="0123456789abcdefghijklmnopqrstuvwxyz";function D(e){let t="",i=e;for(;i>0;)t=Ct[i%36]+t,i=Math.floor(i/36);return t.padStart(6,"0")}function U(e,t,i){let o=new Set(et(e,i).map(p=>String(p.id??""))),l=o.size+1;for(let p=0;p<=o.size+1;p+=1){let m=t(l);if(!o.has(m))return{ordinal:l,id:m};l+=1}throw new Error(`bitly: could not mint a free ${e} id`)}function Dt(e){if(!e)return{};try{let t=JSON.parse(e);return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function _(e){return typeof e=="string"&&e.length>0?e:void 0}function N(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function X(e){if(typeof e!="string"||e.length===0)return!1;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}var it="user_pulled";function dt(e){let t=L("organization",e).map(l=>$(l)),i=t.find(l=>l.guid===j.guid);return[i?{...j,...i}:j,...t.filter(l=>l.guid!==j.guid)]}function at(e,t){return dt(t).find(i=>i.guid===e)}function ft(e){let t=L("group",e),i=t.find(p=>p.id===R.guid),o=i?{...R,...$(i)}:R,l=t.filter(p=>p.id!==R.guid).map(p=>$(p));return[o,...l]}function C(e,t){return ft(t).find(i=>i.guid===e)}function Z(e){let t=A("user",it,e),i=A("user","user_me",e),o=t?$(t):P;return i?{...o,...$(i)}:o}function x(e){let{bitlink_id:t,domain:i,group_guid:o,...l}=$(e);return{id:t,...l}}function M(e){return L("bitlink",e).map(t=>{let i=$(t);return{...i,id:i.bitlink_id}})}function B(e,t){return A("bitlink",e,t)}function Ut(e,t){let i=B(e,t);return i!==void 0&&i.deleted===!0}function Mt(e){return L("click",e).map(t=>$(t)).sort((t,i)=>t.ts<i.ts?-1:t.ts>i.ts?1:0)}var W={minute:6e4,hour:36e5,day:864e5,week:7*864e5,month:30*864e5};function gt(e,t){let i=e.get("unit")??"day",o=i in W?i:"day",l=Number(e.get("units")??"-1"),p=Number.isFinite(l)?l:-1,m=e.get("unit_reference"),b=m&&!Number.isNaN(Date.parse(m))?new Date(m).toISOString():t,c=Date.parse(b),S=p>=0?c-p*W[o]:Number.NEGATIVE_INFINITY;return{unit:o,units:p,unit_reference:b,sinceMs:S,untilMs:c}}function q(e,t,i,o){let l=gt(t,i);return{rows:Mt(o).filter(m=>{if(e!==null&&m.bitlink_id!==e)return!1;let b=Date.parse(m.ts);return Number.isFinite(b)&&b<=l.untilMs&&b>l.sinceMs}),win:l}}function lt(e,t){let i=W[t],o=new Map;for(let l of e){let p=Date.parse(l.ts),m=Math.floor(p/i)*i;o.set(m,(o.get(m)??0)+1)}return[...o.entries()].sort((l,p)=>p[0]-l[0]).map(([l,p])=>({clicks:p,date:new Date(l).toISOString()}))}function jt(e,t){let i=new Map;for(let o of e){let l=String(o[t]??"");l.length!==0&&i.set(l,(i.get(l)??0)+1)}return[...i.entries()].sort((o,l)=>l[1]-o[1]||o[0].localeCompare(l[0])).map(([o,l])=>({key:o,value:l}))}var K={countries:"country",cities:"city",devices:"device",referrers:"referrer",referring_domains:"referring_domain"};async function nt(e){let t=String(e.method??"GET").toUpperCase(),i=e.root,o=e.occurredAt??z,l=e.readOnly??!1,p=t!=="GET"&&t!=="HEAD",m;try{m=new URL(e.path,"http://twin.local")}catch{return f(400,"bitlinks","the request path could not be parsed")}let b=m.searchParams,c=Dt(e.body);if(l&&p)return f(405,"twin","this twin was started read-only; omit readOnly to accept writes");if(m.pathname==="/oauth/access_token")return t!=="POST"?f(404,"oauth",`no route for ${t} ${m.pathname}`):Gt(e,i,o);let S=m.pathname.replace(/^\/v4(\/|$)/,"/"),d=S.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);if(d[0]==="_twin")return t==="POST"&&d[1]==="clicks"&&d.length===2?Lt(c,i,o):t==="POST"&&d[1]==="organization"&&d.length===2?xt(c,i,o):f(404,"twin",`no twin control route for ${t} ${S}`);if(d[0]==="shorten"&&d.length===1)return t!=="POST"?f(404,"bitlinks",`no route for ${t} /v4/shorten`):H(c,i,o,{full:!1});if(d[0]==="expand"&&d.length===1){if(t!=="POST")return f(404,"bitlinks",`no route for ${t} /v4/expand`);let n=_(c.bitlink_id);if(!n)return f(400,"bitlinks","bitlink_id is required",[{field:"bitlink_id",error_code:"missing"}]);let s=n.replace(/^https?:\/\//,"");if(Ut(s,i))return f(410,"bitlinks",`bitlink ${s} has been deleted`);let a=B(s,i);if(!a||a.deleted===!0)return f(404,"bitlinks",`no bitlink with id ${s}`);let r=x(a);return h({link:r.link,id:r.id,long_url:r.long_url,long_urls:[r.long_url],created_at:r.created_at})}if(d[0]==="bitlinks"){if(t==="POST"&&d.length===1)return H(c,i,o,{full:!0});if(d.length>=3){let n=`${d[1]}/${d[2]}`,s=d.slice(3),a=B(n,i),r=s.length===0?t==="GET"||t==="PATCH":s.length===1&&K[s[0]]!==void 0;if(a?.deleted===!0)return r?f(410,"bitlinks",`bitlink ${n} has been deleted`):f(404,"bitlinks",`no bitlink with id ${n}`);if(!a)return f(404,"bitlinks",`no bitlink with id ${n}`);if(s.length===0){if(t==="GET")return h(x(a));if(t==="PATCH"){let g={};if(c.title!==void 0&&(g.title=String(c.title)),c.archived!==void 0&&(g.archived=c.archived===!0),c.tags!==void 0&&(g.tags=N(c.tags)),c.long_url!==void 0){if(!X(c.long_url))return f(400,"bitlinks","long_url must be an absolute http(s) URL",[{field:"long_url",error_code:"invalid"}]);g.long_url=c.long_url}if(Object.keys(g).length===0)return f(422,"bitlinks","no updatable bitlink field was supplied");await v("bitlink",n,g,i,o);let u=B(n,i);return h(x(u??a))}if(t==="DELETE")return await v("bitlink",n,{deleted:!0},i,o),h({links_deleted:[{id:n}]})}if(t==="GET"&&s[0]==="clicks"&&s.length===1){let{rows:g,win:u}=q(n,b,o,i);return h({link_clicks:lt(g,u.unit),units:u.units,unit:u.unit,unit_reference:u.unit_reference})}if(t==="GET"&&s[0]==="clicks"&&s[1]==="summary"&&s.length===2){let{rows:g,win:u}=q(n,b,o,i);return h({total_clicks:g.length,units:u.units,unit:u.unit,unit_reference:u.unit_reference})}if(t==="GET"&&s.length===1&&K[s[0]]!==void 0){let{rows:g,win:u}=q(n,b,o,i);return h({facet:s[0],metrics:jt(g,K[s[0]]),unit:u.unit,units:u.units,unit_reference:u.unit_reference})}}return f(404,"bitlinks",`no route for ${t} ${S}`)}if(d[0]==="groups"){if(t==="GET"&&d.length===1){let n=b.get("organization_guid"),s=ft(i).filter(a=>n===null||a.organization_guid===n);return h({groups:s})}if(d.length>=2){let n=d[1],s=C(n,i);if(!s)return f(404,"groups",`no group with guid ${n}`);let a=d.slice(2);if(a.length===0){if(t==="GET")return h(s);if(t==="PATCH"){let r={};return c.name!==void 0&&(r.name=String(c.name)),c.is_active!==void 0&&(r.is_active=c.is_active===!0),Object.keys(r).length===0?f(422,"groups","no updatable group field was supplied"):(r.modified=o,await v("group",n,{...s.guid===R.guid?{}:s,...r,guid:n},i,o),h(C(n,i)??s))}}if(t==="GET"&&a[0]==="bitlinks"&&a.length===1)return Ot(n,b,i);if(t==="GET"&&a[0]==="tags"&&a.length===1){let r=new Set;for(let g of M(i))if(g.group_guid===n)for(let u of N(g.tags))r.add(u);return h({tags:[...r].sort()})}if(t==="GET"&&a[0]==="clicks"&&a.length===1){let r=new Set(M(i).filter(y=>y.group_guid===n).map(y=>String(y.id))),{rows:g,win:u}=q(null,b,o,i),k=g.filter(y=>r.has(y.bitlink_id));return h({unit:u.unit,units:u.units,unit_reference:u.unit_reference,data:lt(k,u.unit).map(y=>({ts:y.date,count:y.clicks}))})}if(t==="GET"&&a[0]==="shorten_counts"&&a.length===1){let r=gt(b,o),g=M(i).filter(y=>y.group_guid===n),u=new Map,k=W[r.unit];for(let y of g){let E=Date.parse(String(y.created_at));if(!Number.isFinite(E)||E>r.untilMs||E<=r.sinceMs)continue;let w=Math.floor(E/k)*k;u.set(w,(u.get(w)??0)+1)}return h({unit:r.unit,units:r.units,unit_reference:r.unit_reference,facet:"shorten_counts",metrics:[...u.entries()].sort((y,E)=>E[0]-y[0]).map(([y,E])=>({key:new Date(y).toISOString(),value:E}))})}if(t==="GET"&&a[0]==="qr-codes"&&a.length===1){let r=L("qr_code",i).map(g=>Y(g)).filter(g=>g.group_guid===n);return h({qr_codes:r,pagination:{size:r.length,next:""}})}}return f(404,"groups",`no route for ${t} ${S}`)}if(d[0]==="user"){if(d.length===1){if(t==="GET")return h(Z(i));if(t==="PATCH"){let n={};if(c.name!==void 0&&(n.name=String(c.name)),c.default_group_guid!==void 0){let s=_(c.default_group_guid);if(!s||!C(s,i))return f(422,"user","default_group_guid must name a group this token can see",[{field:"default_group_guid",error_code:"invalid"}]);n.default_group_guid=s}return Object.keys(n).length===0?f(422,"user","no updatable user field was supplied"):(n.modified=o,await v("user","user_me",n,i,o),h(Z(i)))}}return t==="GET"&&d[1]==="platform_limits"&&d.length===2?h(It(b,i)):f(404,"user",`no route for ${t} ${S}`)}if(d[0]==="organizations"){if(t==="GET"&&d.length===1)return h({organizations:dt(i)});if(d.length>=2){let n=d[1],s=at(n,i);if(!s)return f(404,"organizations",`no organization with guid ${n}`);let a=d.slice(2);if(t==="GET"&&a.length===0)return h(s);if(t==="GET"&&a[0]==="plan_limits"&&a.length===1){let r=L("bitlink",i).length;return h({organization_guid:n,plan_limits:[{name:"bsds",description:"Branded short domains available on this plan",limit:G.length,count:G.length},{name:"encodes",description:"Links this organization may create per month",limit:1500,count:r}]})}if(t==="GET"&&a[0]==="webhooks"&&a.length===1)return h({webhooks:L("webhook",i).map(r=>tt(r)).filter(r=>r.organization_guid===n)})}return f(404,"organizations",`no route for ${t} ${S}`)}if(d[0]==="bsds"&&d.length===1)return t!=="GET"?f(404,"bsds",`no route for ${t} /v4/bsds`):h({bsds:G});if(d[0]==="webhooks"){if(t==="POST"&&d.length===1){let n=["organization_guid","name","event","url"].filter(r=>_(c[r])===void 0);if(n.length>0)return f(400,"webhooks",`missing required field(s): ${n.join(", ")}`,n.map(r=>({field:r,error_code:"missing"})));if(!at(String(c.organization_guid),i))return f(404,"webhooks",`no organization with guid ${String(c.organization_guid)}`);let{id:s}=U("webhook",r=>`Wa1twin${D(r).slice(-4)}`,i),a={guid:s,created:o,modified:o,modified_by:String(P.login),alerted:"",deactivated:"",is_active:c.is_active!==!1,is_alert:!1,organization_guid:String(c.organization_guid),group_guid:_(c.group_guid)??String(R.guid),name:String(c.name),event:String(c.event),url:String(c.url),status:"active",fetch_tags:c.fetch_tags===!0};return await v("webhook",s,a,i,o),h(a,201)}if(d.length===2){let n=d[1],s=A("webhook",n,i);if(!s||s.deleted===!0)return f(404,"webhooks",`no webhook with guid ${n}`);if(t==="GET")return h(tt(s));if(t==="PATCH"){let a={};for(let r of["name","event","url","group_guid"])c[r]!==void 0&&(a[r]=String(c[r]));return c.is_active!==void 0&&(a.is_active=c.is_active===!0),Object.keys(a).length===0?f(422,"webhooks","no updatable webhook field was supplied"):(a.modified=o,await v("webhook",n,a,i,o),h(tt(A("webhook",n,i)??s)))}if(t==="DELETE")return await v("webhook",n,{deleted:!0},i,o),{status:204,body:null}}return f(404,"webhooks",`no route for ${t} ${S}`)}if(d[0]==="campaigns"||d[0]==="channels"){let n=d[0]==="campaigns"?"campaign":"channel",s=n==="campaign"?"Ca1twin":"Ha1twin";if(t==="GET"&&d.length===1){let a=b.get("group_guid"),r=L(n,i).map(g=>$(g)).filter(g=>a===null||g.group_guid===a);return h(n==="campaign"?{campaigns:r}:{channels:r})}if(t==="POST"&&d.length===1){let a=_(c.name);if(!a)return f(400,`${n}s`,"name is required",[{field:"name",error_code:"missing"}]);let r=_(c.group_guid)??String(R.guid);if(!C(r,i))return f(404,`${n}s`,`no group with guid ${r}`);let{id:g}=U(n,k=>`${s}${D(k).slice(-4)}`,i),u={guid:g,group_guid:r,created_by:String(P.login),name:a,created:o,modified:o};return n==="campaign"?u.description=_(c.description)??"":u.campaign_guid=_(c.campaign_guid)??"",await v(n,g,u,i,o),h(u)}if(d.length===2){let a=d[1],r=A(n,a,i);if(!r||r.deleted===!0)return f(404,`${n}s`,`no ${n} with guid ${a}`);if(t==="GET")return h($(r));if(t==="PATCH"){let g={};for(let u of["name","description"])c[u]!==void 0&&(g[u]=String(c[u]));return Object.keys(g).length===0?f(422,`${n}s`,`no updatable ${n} field was supplied`):(g.modified=o,await v(n,a,g,i,o),h($(A(n,a,i)??r)))}}return f(404,`${d[0]}`,`no route for ${t} ${S}`)}if(d[0]==="qr-codes"){if(t==="POST"&&d.length===1)return Rt(c,i,o);if(d.length>=2){let n=d[1],s=A("qr_code",n,i);if(!s||s.deleted===!0)return f(404,"qr-codes",`no qr code with id ${n}`);if(d.slice(2).length===0){if(t==="GET")return h(Y(s));if(t==="PATCH"){let r={};return c.title!==void 0&&(r.title=String(c.title)),c.archived!==void 0&&(r.archived=c.archived===!0),c.tags!==void 0&&(r.tags=N(c.tags)),Object.keys(r).length===0?f(400,"qr-codes","no updatable qr code field was supplied"):(r.modified=o,await v("qr_code",n,r,i,o),h(Y(A("qr_code",n,i)??s)))}if(t==="DELETE")return await v("qr_code",n,{deleted:!0},i,o),h({qrcodes_deleted:[{id:n}],links_deleted:[]})}}return f(404,"qr-codes",`no route for ${t} ${S}`)}if(d[0]==="custom_bitlinks"){if(t==="POST"&&d.length===1){let n=_(c.custom_bitlink),s=_(c.bitlink_id);if(!n)return f(400,"custom_bitlinks","custom_bitlink is required",[{field:"custom_bitlink",error_code:"missing"}]);if(!s)return f(400,"custom_bitlinks","bitlink_id is required",[{field:"bitlink_id",error_code:"missing"}]);let a=B(s,i);if(!a||a.deleted===!0)return f(404,"custom_bitlinks",`no bitlink with id ${s}`);let r=A("custom_bitlink",n,i);return r&&r.deleted!==!0?f(409,"custom_bitlinks",`${n} is already in use`):(await v("custom_bitlink",n,{custom_bitlink:n,bitlink_id:s,created:o},i,o),h({custom_bitlink:{custom_bitlink:n,bitlink:x(a),bitlink_history:[ut(n,a,o)]}}))}if(t==="GET"&&d.length>=3){let n=`${d[1]}/${d[2]}`,s=A("custom_bitlink",n,i);if(!s||s.deleted===!0)return f(404,"custom_bitlinks",`no custom bitlink ${n}`);let a=$(s),r=B(String(a.bitlink_id),i);return!r||r.deleted===!0?f(404,"custom_bitlinks",`no bitlink with id ${String(a.bitlink_id)}`):h({custom_bitlink:{custom_bitlink:n,bitlink:x(r),bitlink_history:[ut(n,r,String(a.created))]}})}return f(404,"custom_bitlinks",`no route for ${t} ${S}`)}return f(404,"bitly",`no route for ${t} ${S}`);async function H(n,s,a,r){let g=n.long_url;if(!X(g))return f(400,"bitlinks","long_url must be an absolute http(s) URL",[{field:"long_url",error_code:g===void 0?"missing":"invalid"}]);let u=_(n.domain)??st;if(!G.includes(u))return f(403,"bitlinks",`domain ${u} is not a branded short domain on this account`,[{field:"domain",error_code:"invalid"}]);let k=_(n.group_guid)??String(R.guid);if(!C(k,s))return r.full?f(404,"bitlinks",`no group with guid ${k}`):f(403,"bitlinks",`group ${k} is not visible to this token`);if(n.force_new_link!==!0){let O=M(s).find(J=>J.long_url===g&&J.group_guid===k&&J.domain===u),ot=O?B(String(O.id),s):void 0;if(ot)return h(x(ot),200)}let{id:y}=U("bitlink",O=>`${u}/${D(O)}`,s),E=r.full?_(n.keyword):void 0,w=E?`${u}/${E}`:y;if(E&&B(w,s))return f(422,"bitlinks",`${w} is already in use`);let I={bitlink_id:w,link:`https://${w}`,long_url:g,domain:u,group_guid:k,created_at:a,created_by:String(P.login),archived:!1,tags:r.full?N(n.tags):[],custom_bitlinks:[],deeplinks:[],references:{group:`/v4/groups/${k}`}};r.full&&_(n.title)!==void 0&&(I.title=_(n.title)),await v("bitlink",w,I,s,a);let T=B(w,s);return T?h(x(T),201):f(500,"bitlinks",`bitlink ${w} was written but did not project`)}function Ot(n,s,a){let r=M(a).filter(T=>T.group_guid===n),g=s.get("archived")??"off";g==="off"?r=r.filter(T=>T.archived!==!0):g==="on"&&(r=r.filter(T=>T.archived===!0));let u=s.getAll("tags").flatMap(T=>T.split(","));u.length>0&&(r=r.filter(T=>N(T.tags).some(O=>u.includes(O))));let k=Number(s.get("created_before")??"");Number.isFinite(k)&&s.get("created_before")!==null&&(r=r.filter(T=>Date.parse(String(T.created_at))<k*1e3)),r.sort((T,O)=>String(O.created_at).localeCompare(String(T.created_at))||String(T.id).localeCompare(String(O.id)));let y=s.get("search_after");if(y!==null){let T=r.findIndex(O=>String(O.id)===y);r=T===-1?[]:r.slice(T+1)}let E=Math.max(1,Math.min(100,Number(s.get("size")??"50")||50)),w=r.slice(0,E).map(T=>B(String(T.id),a)).filter(T=>T!==void 0).map(x),I=r.length>E;return h({links:w,pagination:{size:E,...I&&w.length>0?{search_after:String(w[w.length-1].id)}:{},next:I&&w.length>0?`/v4/groups/${n}/bitlinks?size=${E}&search_after=${String(w[w.length-1].id)}`:""}})}function It(n,s){let a=n.get("path")??"/groups/{group_guid}/bitlinks",r=L("bitlink",s).length;return{platform_limits:[{endpoint:a,methods:[{name:"GET",limit:1500,count:Math.min(r,1500)},{name:"POST",limit:1500,count:Math.min(r,1500)}]}]}}async function Rt(n,s,a){let r=_(n.group_guid);if(!r)return f(400,"qr-codes","group_guid is required",[{field:"group_guid",error_code:"missing"}]);if(!C(r,s))return f(404,"qr-codes",`no group with guid ${r}`);let g=n.destination??{},u=_(g.bitlink_id),k=g.long_url;if(!u&&!X(k))return f(400,"qr-codes","destination must carry either a bitlink_id or an absolute http(s) long_url",[{field:"destination",error_code:"invalid"}]);if(u){let I=B(u,s);if(!I||I.deleted===!0)return f(404,"qr-codes",`no bitlink with id ${u}`)}let{id:y}=U("qr_code",I=>`Qa1twin${D(I).slice(-4)}`,s),E=String(u?x(B(u,s)).long_url:k),w={qrcode_id:y,group_guid:r,title:_(n.title)??"",qr_code_type:u?"bitlink":"long_url",long_urls:[E],domain:st,is_customized:n.render_customizations!==void 0,is_gs1:!1,archived:n.archived===!0,tags:N(n.tags),created_by:String(P.login),created:a,modified:a,serialized_content:u?`https://${u}`:E};return u&&(w.bitlink_id=u),await v("qr_code",y,w,s,a),h(Y(A("qr_code",y,s)??w),201)}async function xt(n,s,a){let r=_(n.guid);if(!r)return f(400,"twin","a seeded organization needs a guid",[{field:"guid",error_code:"missing"}]);if(!/^[A-Za-z0-9_-]{1,40}$/.test(r))return f(400,"twin",`"${r}" is not a Bitly guid shape`,[{field:"guid",error_code:"invalid"}]);let g={guid:r,name:_(n.name)??r,is_active:n.is_active!==!1,tier:_(n.tier)??"free",tier_family:_(n.tier_family)??"free",tier_display_name:_(n.tier_display_name)??"Free",role:_(n.role)??"org-admin",created:_(n.created)??a,modified:_(n.modified)??a,bsds:Array.isArray(n.bsds)?n.bsds:G,references:{groups:`/v4/groups?organization_guid=${r}`}};return await v("organization",r,g,s,a),h(g,201)}async function Lt(n,s,a){let r=Array.isArray(n.clicks)?n.clicks:[n],g=[];for(let u of r){let k=_(u.bitlink_id);if(!k)return f(400,"twin","each seeded click needs a bitlink_id",[{field:"bitlink_id",error_code:"missing"}]);if(!B(k,s))return f(404,"twin",`no bitlink with id ${k}`);let y=_(u.ts)??a;if(Date.parse(y)>Date.parse(a))return f(400,"twin",`a click cannot be recorded at ${y}, after the world instant ${a}`,[{field:"ts",error_code:"invalid"}]);let{id:E}=U("click",w=>`click_${D(w)}`,s);await v("click",E,{bitlink_id:k,ts:y,country:_(u.country)??"US",city:_(u.city)??"Brooklyn",device:_(u.device)??"desktop",referrer:_(u.referrer)??"direct",referring_domain:_(u.referring_domain)??"direct"},s,a),g.push(E)}return h({seeded:g.length,click_ids:g},201)}async function Gt(n,s,a){let r=new URLSearchParams(n.body??""),g=r.get("code"),u=r.get("client_id");if(!g||!u)return{status:400,body:"error=invalid_request"};let k=`twin_${Ft(`bitly:oauth:${u}:${g}`)}`;return await v("user","user_me",{oauth_login:String(Z(s).login),oauth_issued_at:a},s,a),{status:200,body:`access_token=${k}&login=${String(P.login)}`}}}function ut(e,t,i){let[o="",l=""]=e.split("/"),p=String(t.bitlink_id??"");return{group_guid:String(t.group_guid??R.guid),keyword:l,bsd:o,hash:p.split("/")[1]??"",login:String(P.login),long_url:t.long_url,created:i,first_created:i,is_active:!0}}function Ft(e){let t=2166136261;for(let i=0;i<e.length;i+=1)t^=e.charCodeAt(i),t=Math.imul(t,16777619)>>>0;return t.toString(36)}function tt(e){return $(e)}function Y(e){return $(e)}import{serveHttp as fe}from"../../engine/v2/volter_world-core.mjs";import{createTwinFetchFromHandler as Ht,statefulTwinManifest as qt}from"../../engine/v2/volter_world-core.mjs";var Yt="/oauth/access_token";function rt(e={}){let t=Ht(nt,{...e,manifest:qt({vendor:"bitly",twinOf:"the Bitly v4 API",stores:"bitlinks, groups, tags, clicks, QR codes, campaigns and webhooks"})});return async function(o){let l=await t(o);if(new URL(o.url).pathname!==Yt)return l;let p=await l.text(),m;try{let b=JSON.parse(p);m=typeof b=="string"?b:p}catch{m=p}return new Response(m,{status:l.status,headers:{"content-type":"text/plain; charset=utf-8"}})}}import{assertBudgetGuardIntact as Ee,confirmAction as Se,deployableEntries as ve,observeResources as Xt}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as Wt,rateBudgetPath as me,rateBudgetWeight as be,RateBudget as ye}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as mt}from"../../engine/v2/volter_world-core.mjs";var Qt="bitly",pt=6e4,ht=60,_t=300,Q={encode:5,other:2},V={windowMs:pt,ceiling:ht,defaultWeight:Q.other,maxRetryAfterSeconds:_t,rules:[{match:"^POST /shorten$",weight:Q.encode},{match:"^POST /bitlinks$",weight:Q.encode}],reason:`Bitly publishes NO scalar rate limit. Its rate-limits page (dev.bitly.com/docs/getting-started/rate-limits, read 2026-09-02) states only that the per-minute limit is one-tenth of the hourly limit, illustrates it with a HYPOTHETICAL ("if your limit for the /v4/shorten endpoint is 1,000 calls per hour\u2026") and directs the caller to read their own plan-specific numbers from GET /v4/user/platform_limits and GET /v4/organizations/{guid}/plan_limits. A docs example is not a published limit and the real figure is per-subscription, so this declaration stays AT the kernel fallback and is more permissive than it nowhere: 60 weighted units / 60s at defaultWeight 2 = 30 calls a minute. POST /shorten and POST /bitlinks cost 5 because each one spends an ENCODE from the account's MONTHLY quota \u2014 a finite resource a throttle does not give back \u2014 a judgement call, not a published cost. Bitly documents no rate-limit response headers; the X-RateLimit-* / Retry-After names the guard reads are the conventional spelling, read if present and never assumed. The window bounds the 60s AVERAGE and does not pace; the 429 cooldown is the backstop for a sub-second burst.`};Wt(Qt,V);var bt="bitly",Zt=new Set(["click","user"]);function kt(e){let t=e.references?.group?String(e.references.group).split("/").pop():e.group_guid;return{type:"bitlink",id:String(e.id),fields:{bitlink_id:String(e.id),link:e.link??`https://${String(e.id)}`,long_url:e.long_url,domain:String(e.id).split("/")[0],group_guid:t,references:{...e.references??{},...t?{group:`/v4/groups/${t}`}:{}},created_at:e.created_at,created_by:e.created_by??null,archived:e.archived===!0,tags:Array.isArray(e.tags)?e.tags:[],custom_bitlinks:Array.isArray(e.custom_bitlinks)?e.custom_bitlinks:[],deeplinks:Array.isArray(e.deeplinks)?e.deeplinks:[],...e.title!==void 0?{title:e.title}:{}}}}function wt(e){return{type:"group",id:String(e.guid),fields:{guid:String(e.guid),name:e.name,organization_guid:e.organization_guid,created:e.created,modified:e.modified,is_active:e.is_active!==!1,role:e.role??"org-admin",bsds:Array.isArray(e.bsds)?e.bsds:[]}}}var Kt=["name","is_active","created","modified","is_sso_user","is_2fa_enabled","default_group_guid","emails"];function te(e){let t={login:String(e.login)};for(let i of Kt)e[i]!==void 0&&(t[i]=e[i]);return{type:"user",id:it,fields:t}}var ee=["name","is_active","tier","tier_family","tier_display_name","role","created","modified","bsds","references"];function ie(e){let t={guid:String(e.guid)};for(let i of ee)e[i]!==void 0&&(t[i]=e[i]);return{type:"organization",id:String(e.guid),fields:t}}function Tt(e){return{type:"qr_code",id:String(e.qrcode_id),fields:{qrcode_id:String(e.qrcode_id),group_guid:e.group_guid,title:e.title??"",qr_code_type:e.qr_code_type??"bitlink",long_urls:Array.isArray(e.long_urls)?e.long_urls:[],domain:e.domain??"bit.ly",archived:e.archived===!0,tags:Array.isArray(e.tags)?e.tags:[],created:e.created,modified:e.modified,...e.bitlink_id!==void 0?{bitlink_id:e.bitlink_id}:{}}}}var yt=0;function Et(){let e=Math.max(Date.now(),yt+1);return yt=e,new Date(e).toISOString()}function F(e,t){if(e.status<200||e.status>=300){let i=e.body&&typeof e.body=="object"?String(e.body.message??e.status):String(e.status);throw new Error(`bitly: ${t} refused by the vendor (HTTP ${e.status}: ${i})`)}return e.body}async function ne(e){let t=F(await e("GET","/user"),"GET /user"),i=F(await e("GET","/organizations"),"GET /organizations"),o=Array.isArray(i?.organizations)?i.organizations:[];if(t===null||typeof t!="object"||typeof t.login!="string"||t.login==="")throw new Error("bitly: GET /user answered 200 without a `login` \u2014 refusing to fold a token owner this twin cannot identify");return[te(t),...o.map(ie)]}async function re(e){let t=F(await e("GET","/groups"),"GET /groups");return(Array.isArray(t?.groups)?t.groups:[]).map(wt)}async function oe(e,t){let i=[];for(let o of t){let l=null;for(let p=0;p<50;p+=1){let m=l===null?"?size=100":`?size=100&search_after=${encodeURIComponent(l)}`,b=F(await e("GET",`/groups/${o}/bitlinks${m}`),`GET /groups/${o}/bitlinks`),c=Array.isArray(b?.links)?b.links:[];for(let d of c)i.push(kt(d));let S=b?.pagination?.search_after;if(typeof S!="string"||S.length===0||c.length===0)break;l=S}}return i}async function se(e,t){let i=[];for(let o of t){let l=F(await e("GET",`/groups/${o}/qr-codes`),`GET /groups/${o}/qr-codes`),p=Array.isArray(l?.qr_codes)?l.qr_codes:[];for(let m of p)i.push(Tt(m))}return i}async function St(e,t={}){let i=t.occurredAt??Et(),o=await ne(e),l=await re(e),p=l.map(d=>d.id),m=await oe(e,p),b=await se(e,p),c=[...o,...l,...m,...b],S=(d=>Xt(bt,c,{...t.root!==void 0?{root:t.root}:{},at:d,batch:`obs:${bt}:${d}`}))(i);return{observed:c.length,deltasAppended:S.appended,counts:{account:o.length,groups:l.length,bitlinks:m.length,qrCodes:b.length}}}function vt(e){if(Zt.has(e.subject.type))return null;let t=e.fields??{},i=e.subject.id;return e.subject.type==="bitlink"?t.deleted===!0?null:t.long_url!==void 0&&t.link!==void 0?{method:"POST",path:"/bitlinks",body:{long_url:t.long_url,domain:t.domain,group_guid:t.group_guid,title:t.title,tags:t.tags}}:{method:"PATCH",path:`/bitlinks/${i}`,body:t}:e.subject.type==="group"?{method:"PATCH",path:`/groups/${i}`,body:t}:e.subject.type==="webhook"?t.deleted===!0?null:t.created!==void 0?{method:"POST",path:"/webhooks",body:t}:{method:"PATCH",path:`/webhooks/${i}`,body:t}:e.subject.type==="campaign"?{method:"POST",path:"/campaigns",body:t}:e.subject.type==="channel"?{method:"POST",path:"/channels",body:t}:null}function $t(e){return async(t,i,o)=>{let l=await e({method:t,path:i.startsWith("/v4/")?i:`/v4${i}`,headers:{accept:"application/json","content-type":"application/json",authorization:"Bearer twin"},...o===void 0?{}:{body:JSON.stringify(o)}}),p={};try{p=JSON.parse(l.body||"{}")}catch{p={}}return{status:l.status,body:p}}}async function Bt(e,t={}){let{observed:i,deltasAppended:o}=await St($t(e),{...t.root!==void 0?{root:t.root}:{},occurredAt:t.occurredAt??Et()});return{observed:i,deltasAppended:o}}async function At(e,t,i){let o=$t(e),l=vt(t);if(!l){let d=t.operation??`${t.subject.type}.update`,H=(t.fields??{}).deleted===!0?"a local delete is never pushed: this world's id is not one the real account owns, and DELETE there cannot be undone":`${d} is the twin's own record \u2014 nothing at Bitly to write`;return{externalId:t.subject.id,data:{performed:!1,reason:H}}}let p=i.resolve(t.subject.type,t.subject.id),m=l.path.replace(new RegExp(`/${t.subject.id}(?=$|/)`),`/${p}`),b=await o(l.method,m,l.body);if(b.status<200||b.status>=300)throw new Error(`bitly ${l.method} ${m} refused: HTTP ${b.status} ${JSON.stringify(b.body).slice(0,200)}`);let c=b.body??{};return{externalId:typeof c.id=="string"?c.id:p,data:c}}import{bundleClient as Ie,fileResponse as Re,filePathOf as xe}from"../../engine/v2/volter_world-core.mjs";import{serveHttp as Ge}from"../../engine/v2/volter_world-core.mjs";import{registerPack as ae}from"../../engine/v2/volter_world-core.mjs";var le={protocol:"2",refresh:{every:"15m",webhook:!0,onDemand:{atMost:"30s"}},stateSystem:{perform:At,refresh:Bt},roundTrip:[{method:"POST",path:"/v4/bitlinks",body:{long_url:"https://round.trip/"},headers:{authorization:"Bearer round-trip"}},{method:"POST",path:"/v4/qr-codes",body:{group_guid:"Ba1twingrp1",title:"round trip",destination:{long_url:"https://round.trip/"}},headers:{authorization:"Bearer round-trip"}}],parityOrigin:"http://twin",vendor:"bitly",rateBudget:V,transport:"rest",archetype:"crud",bin:"world-bitly",resources:["bitlink","group","organization","user","qr_code","campaign","channel","webhook","custom_bitlink","click"],specSource:"https://dev.bitly.com/v4/v4.json (Bitly's own published OpenAPI 3.0.0 document, fetched 2026-09-02)",description:"Bitly v4 REST twin \u2014 shorten/expand, bitlinks, groups, tags, deterministic click analytics, QR codes, campaigns, webhooks, link dashboard mirror.",adoption:{pypi:[],envStems:["BITLY"]},hosts:[{host:"api-ssl.bitly.com"}],endpointEnvNone:"no injector-free path: Bitly integrations hardcode https://api-ssl.bitly.com and the vendor documents no base-URL override, so interception is the hosts entry above; a BITLY_BASE_URL would be invented surface no app reads.",browserRouting:{apiPathPrefix:"/v4/",loaderHost:"https://api-ssl.bitly.com"}};ae(le);export{rt 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-bluesky
2
+
3
+ Contains @volter/twin-bluesky 0.1.37 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.