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,2 @@
1
+ import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
2
+ var b=[{id:"alias",area:"alias",method:"POST",path:"/v1/alias",summary:"associate one identity with another: a `previousId` (userId or anonymousId) is aliased onto a new `userId`",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Alias' declares `POST https://api.segment.io/v1/alias` with a worked body {previousId, userId, timestamp, writeKey} and a field table naming previousId. Absent from @segment/analytics-node@2's wire surface (batched as type:'alias'); the SDK's AliasParams (src/app/types/params.ts) requires both userId and previousId.",tier:"common"},{id:"batch",area:"batch",method:"POST",path:"/v1/batch",summary:"the SERVER-side batched ingestion envelope every official server SDK sends: {batch:[<message>...], writeKey, sentAt}, each message discriminated by its own `type`",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"SDK WIRE LITERAL. @segment/analytics-node@2.3.0 src/plugins/segmentio/publisher.ts:73-76 builds the one and only URL this SDK ever posts to: tryCreateFormattedUrl(host ?? 'https://api.segment.io', path ?? '/v1/batch'); the body at :243-247 is JSON.stringify({batch: events, writeKey: this._writeKey, sentAt: new Date()}). It is the SOLE real path literal in var/line/segment/dossier/wire.json pathLiterals (the other, '/bar', is a JSDoc example). Corroborated in a second first-party SDK (analytics-python segment/analytics/request.py: url = remove_trailing_slash(host or 'https://api.segment.io') + '/v1/batch') and in the vendor's own reference, github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Batch'.",tier:"core"},{id:"browser_track",area:"track",method:"POST",path:"/v1/t",summary:"analytics.js's short-form tracking route on the api.segment.io/v1 base \u2014 the path a browser proxy must forward",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md:123-125 documents the Analytics.js `integrations['Segment.io'].apiHost` proxy as: '// POST https://MY-CUSTOM-API-PROXY.com/v1/t --> proxies to // https://api.segment.io/v1/t'. Only the `/v1/t` short form appears on a first-party page; the sibling short routes analytics.js may use for the other call types are NOT documented anywhere in segment-docs and are deliberately not invented here. No literal in @segment/analytics-node@2 (a server SDK; this is the browser route).",tier:"niche"},{id:"group",area:"group",method:"POST",path:"/v1/group",summary:"associate an identified user with a group (company/account/team) and record group traits",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Group' declares `POST https://api.segment.io/v1/group` with a worked body {userId, groupId, traits, timestamp, writeKey} and a field table naming groupId and group traits. Absent from @segment/analytics-node@2's wire surface (batched as type:'group').",tier:"core"},{id:"identify",area:"identify",method:"POST",path:"/v1/identify",summary:"tie a user to their actions and record `traits` about them",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Identify' declares `POST https://api.segment.io/v1/identify` with a worked body {userId, traits, context, timestamp, writeKey} and a field table (anonymousId, context, integrations, timestamp, identify traits, userId); the '## Selecting Destinations' section posts an integrations-bearing identify to the same URL. Absent from @segment/analytics-node@2's wire surface (that SDK sends type:'identify' messages inside /v1/batch).",tier:"core"},{id:"mobile_batch",area:"batch",method:"POST",path:"/v1/b",summary:"the MOBILE batch endpoint \u2014 a distinct route from /v1/batch, which the vendor reserves for server-side sending",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/mobile/apple/index.md:163 and src/connections/sources/catalog/libraries/mobile/react-native/index.md:781: 'you must forward the batched events to https://api.segment.io/v1/b. The https://api.segment.io/v1/batch endpoint is reserved for events arriving from server-side sending, and proxying to that endpoint for your mobile events may result in unexpected behavior.' Also react-native/index.md:91, the `proxy` option: 'a batch url to post to instead of https://api.segment.io/v1/b'. No literal in @segment/analytics-node@2 \u2014 this is the Swift/Kotlin/React-Native route, and no mobile SDK is pinned in this dossier.",tier:"common"},{id:"oauth_token",area:"oauth",method:"POST",path:"/token",summary:"OAuth 2.0 client-credentials token exchange on the regional authorization server: a signed RS256 JWT client assertion is traded for a short-lived access token",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"SDK WIRE LITERAL (interpolated, which is why wire.json's plain-string grep missed it). @segment/analytics-node@2.3.0 src/lib/token-manager.ts requestAccessToken(): `const accessTokenEndpoint = ${this.authServer}/token`, POSTed as application/x-www-form-urlencoded with grant_type=client_credentials & client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer & client_assertion=<signed JWT> & scope; authServer defaults to 'https://oauth2.segment.io' (same file's constructor) and the EU value 'https://oauth2.eu1.segmentapis.com' is documented on src/lib/types.ts OAuthSettings.authServer. Corroborated by github.com/segmentio/segment-docs src/connections/oauth.md '## Obtain the access token', which names both regional authorization servers and the same four form parameters.",tier:"niche"},{id:"page",area:"page",method:"POST",path:"/v1/page",summary:"record a web page view, with optional category, name and properties",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Page' declares `POST https://api.segment.io/v1/page` with a worked body {userId, name, timestamp, writeKey} and a field table (anonymousId, context, integrations, page name, page properties, timestamp, userId). Absent from @segment/analytics-node@2's wire surface (batched as type:'page').",tier:"core"},{id:"pixel_alias",area:"pixel",method:"GET",path:"/v1/pixel/alias",summary:"Tracking Pixel API: an alias call carried in the query string, answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md '#### Pixel Routes' enumerates exactly six routes as a literal block \u2014 /v1/pixel/identify, /v1/pixel/group, /v1/pixel/alias, /v1/pixel/page, /v1/pixel/screen, /v1/pixel/track \u2014 under the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, with 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs'. Not in any SDK.",tier:"niche"},{id:"pixel_group",area:"pixel",method:"GET",path:"/v1/pixel/group",summary:"Tracking Pixel API: a group call carried in the query string, answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md '#### Pixel Routes' enumerates exactly six routes as a literal block \u2014 /v1/pixel/identify, /v1/pixel/group, /v1/pixel/alias, /v1/pixel/page, /v1/pixel/screen, /v1/pixel/track \u2014 under the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, with 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs'. Not in any SDK.",tier:"niche"},{id:"pixel_identify",area:"pixel",method:"GET",path:"/v1/pixel/identify",summary:"Tracking Pixel API: an identify call carried in the query string, answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md '#### Pixel Routes' enumerates exactly six routes as a literal block \u2014 /v1/pixel/identify, /v1/pixel/group, /v1/pixel/alias, /v1/pixel/page, /v1/pixel/screen, /v1/pixel/track \u2014 under the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, with 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs'. Not in any SDK.",tier:"niche"},{id:"pixel_page",area:"pixel",method:"GET",path:"/v1/pixel/page",summary:"Tracking Pixel API: a page call carried in the query string, answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md '#### Pixel Routes' enumerates exactly six routes as a literal block \u2014 /v1/pixel/identify, /v1/pixel/group, /v1/pixel/alias, /v1/pixel/page, /v1/pixel/screen, /v1/pixel/track \u2014 under the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, with 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs'. Not in any SDK.",tier:"niche"},{id:"pixel_screen",area:"pixel",method:"GET",path:"/v1/pixel/screen",summary:"Tracking Pixel API: a screen call carried in the query string, answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md '#### Pixel Routes' enumerates exactly six routes as a literal block \u2014 /v1/pixel/identify, /v1/pixel/group, /v1/pixel/alias, /v1/pixel/page, /v1/pixel/screen, /v1/pixel/track \u2014 under the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, with 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs'. Not in any SDK.",tier:"niche"},{id:"pixel_track",area:"pixel",method:"GET",path:"/v1/pixel/track",summary:"Tracking Pixel API: a track call carried in the query string (base64 `?data=` or plain params), answering 200 with a 1x1 transparent GIF",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/pixel-tracking-api/index.md gives the signature `https://api.segment.io/v1/pixel/<METHOD ENDPOINT>?data=<base64-ENCODED-JSON>`, lists /v1/pixel/track among its six '#### Pixel Routes', states 'Each endpoint *always* responds with a 200 <empty-gif>, even if an error occurs', and shows both the base64 img-tag form (:67) and the unencoded query-param form (:61). Corroborated at src/connections/sources/custom-domain.md:79 and src/guides/how-to-guides/cross-channel-tracking.md:77. Not in any SDK: this route exists for email/ad contexts where JavaScript and POST are impossible.",tier:"niche"},{id:"screen",area:"screen",method:"POST",path:"/v1/screen",summary:"record a mobile app screen view, with optional category, name and properties",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Screen' declares `POST https://api.segment.io/v1/screen` with a worked body {userId, name, timestamp, writeKey}. @segment/analytics-node@2 exposes a .screen() method (src/app/analytics-node.ts) and its SegmentEventType union includes 'screen' (src/app/types/segment-event.ts), but the message still travels inside /v1/batch \u2014 no per-type path literal ships.",tier:"common"},{id:"track",area:"track",method:"POST",path:"/v1/track",summary:"record an action a user performed: required `event` name plus optional `properties`",pathParams:[],requiredQuery:[],requiredBody:[],successStatus:200,responseSkeleton:null,specFile:"SURFACE.json (sdk/docs-ratified, no vendor spec exists)",evidence:"DOCS ONLY, NOT VERIFIED OFFLINE. github.com/segmentio/segment-docs src/connections/sources/catalog/libraries/server/http-api/index.md '## Track' declares `POST https://api.segment.io/v1/track` with a worked JSON body {userId, event, properties, context, timestamp, writeKey}; the same page's '### writeKey authentication' and '#### OAuth' curl examples both post to that exact URL. NO path literal for it exists in @segment/analytics-node@2 \u2014 that SDK batches every call type onto /v1/batch \u2014 so this entry is grounded in the vendor's reference page, not in shipped SDK bytes.",tier:"core"}],X=b.map(e=>({op:e,re:new RegExp("^"+e.path.replace(/[.*+?^$()|[\]\\]/g,"\\$&").replace(/\{([^}]+)\}/g,"(?<$1>[^/]+)")+"$")}));function T(e){let t=new URL(e.path,"http://twin.local"),s=X.find(n=>n.op.method===e.method.toUpperCase()&&n.re.test(t.pathname));if(s)return{op:s.op,params:{...s.re.exec(t.pathname)?.groups??{}},query:t.searchParams}}import{applyTwinWriteAtomic as C,projectResources as z,worldNow as Z}from"../../engine/v2/volter_world-core.mjs";var I="segment",x=e=>z(I,e);function O(e){return x(e).filter(t=>t.type==="event").sort((t,s)=>Number(t.seq??0)-Number(s.seq??0))}function N(e){return x(e).filter(t=>t.type==="identity")}function k(e){return x(e).filter(t=>t.type==="group")}function A(e){return x(e).filter(t=>t.type==="dropped").sort((t,s)=>Number(t.seq??0)-Number(s.seq??0))}var v=(e,t,s)=>({status:e,body:{code:t,message:s},headers:{"content-type":"application/json"}}),_=32*1024,$=500*1024,M=2500,B=e=>new TextEncoder().encode(e).length;function K(e,t){let s=(e??"").trim(),n=t&&typeof t=="object"&&typeof t.writeKey=="string"?t.writeKey:null;if(/^basic /i.test(s)){let r;try{let o=s.slice(6).trim();r=new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(atob(o),c=>c.charCodeAt(0)))}catch{r=void 0}let i=r?.split(":")[0];return i?{writeKey:n??i,scheme:n?"body":"basic",bearer:null}:{writeKey:n,scheme:n?"body":"none",bearer:null}}return/^bearer /i.test(s)?{writeKey:n,scheme:"oauth",bearer:s.slice(7).trim()||null}:{writeKey:n,scheme:n?"body":"none",bearer:null}}var p=e=>typeof e=="string"&&e!==""?e:void 0,y=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:void 0,q=["track","identify","page","group","alias"],G=["screen"];function ee(e,t){if(!p(e.userId)&&!p(e.anonymousId))return"no_user_anon_id";if(t==="track"&&!p(e.event))return"track_missing_event";if(t==="group"&&!p(e.groupId))return"group_missing_group_id";if(t==="alias"&&!p(e.previousId))return"alias_missing_previous_id"}function te(e,t){let s="";for(let n=0;s.length<t;n+=1){let r=2166136261,i=`${n}:${e}`;for(let o=0;o<i.length;o+=1)r^=i.charCodeAt(o),r=Math.imul(r,16777619)>>>0;s+=r.toString(16).padStart(8,"0")}return s.slice(0,t)}var L=(e,t,s)=>{let n=p(e.messageId);if(n)return n;let r=te(`message:${t}:${s}`,32);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`},j=(e,t)=>e.reduce((s,n)=>n.type===t?Math.max(s,Number(n.seq??0)):s,0)+1;function se(e,t,s,n,r,i,o){return{messageType:t,messageId:r,endpoint:n,userId:p(e.userId)??null,anonymousId:p(e.anonymousId)??null,writeKey:s.writeKey,authScheme:s.scheme,event:p(e.event)??null,name:p(e.name)??null,category:p(e.category)??null,groupId:p(e.groupId)??null,previousId:p(e.previousId)??null,properties:y(e.properties)??null,traits:y(e.traits)??null,context:{...s.context??{},...y(e.context)??{}},integrations:{...s.integrations??{},...y(e.integrations)??{}},timestamp:typeof e.timestamp=="string"?e.timestamp:null,sentAt:s.sentAt,receivedAt:o,seq:i}}function ne(e,t,s,n,r){let i=p(e.messageId),o=p(e.userId)??null,c=p(e.anonymousId)??null,a=o??c,d=[];r.seq.event+=1;let h=se(e,t,s,n,i,r.seq.event,r.receivedAt);d.push({type:"event",id:i,fields:h});let l=(u,m)=>r.pending.get(`${u}:${m}`)?.fields??r.resources.find(f=>f.type===u&&f.id===m);if(t==="identify"){let u=l("identity",a);d.push({type:"identity",id:a,fields:{userId:o,anonymousId:c??u?.anonymousId??null,traits:{...y(u?.traits)??{},...y(e.traits)??{}},previousIds:u?.previousIds??[],rev:Number(u?.rev??0)+1}})}else if(t==="group"){let u=p(e.groupId),m=l("group",u);d.push({type:"group",id:u,fields:{groupId:u,traits:{...y(m?.traits)??{},...y(e.traits)??{}},members:[...new Set([...m?.members??[],a])],rev:Number(m?.rev??0)+1}})}else if(t==="alias"){let u=p(e.previousId),m=o??a,f=l("identity",m),g=l("identity",u);d.push({type:"identity",id:m,fields:{userId:m,anonymousId:f?.anonymousId??null,traits:{...y(g?.traits)??{},...y(f?.traits)??{}},previousIds:[...new Set([...f?.previousIds??[],u])],rev:Number(f?.rev??0)+1}})}for(let u of d)r.pending.set(`${u.type}:${u.id}`,u);return d}async function F(e,t,s,n){let r=[],i=[];for(let[o,c]of e.messages.entries()){let a=y(c);if(!a)return v(400,"invalid_message",`batch[${o}] is not an object \u2014 each batch item must be a Segment message`);if(e.batched&&o>=M){i.push({msg:a,type:p(a.type)??"",reason:"batch_exceeds_2500_events"});continue}if(e.batched&&B(JSON.stringify(a))>_){i.push({msg:a,type:p(a.type)??"",reason:"event_exceeds_32kb"});continue}let d=p(a.type);if(!d){i.push({msg:a,type:"",reason:"unknown_message_type"});continue}if(G.includes(d))return re(d,t);if(!q.includes(d)){i.push({msg:a,type:d,reason:"unknown_message_type"});continue}let h=ee(a,d);h?i.push({msg:a,type:d,reason:h}):r.push({msg:a,type:d})}if(r.length){let o=n;await C(I,c=>{let a=new Set(c.filter(g=>g.type==="event").map(g=>g.id)),d={resources:c,pending:new Map,seq:{event:j(c,"event")-1},receivedAt:o},h=[],l=0;for(let{msg:g,type:Q}of r){let w=L(g,n,d.seq.event+1);if(a.has(w)){l+=1;continue}a.add(w),h.push(...ne({...g,messageId:w},Q,e,t,d))}let u=[...new Map(h.map(g=>[`${g.type}:${g.id}`,g])).values()],m=h.filter(g=>g.type==="event");if(!m.length)return{kind:"skip",value:{stored:0,deduped:l}};let f=m[0];return{kind:"write",value:{stored:m.length,deduped:l},write:{operation:`ingest.${t.replace(/^\/+/,"").replace(/\//g,".")}`,subjectType:"event",subjectId:f.id,occurredAt:n,fields:f.fields,projection:{creates:u},actor:{kind:"agent"},uniqueness:`${f.id}:${m.length}`}}},s)}if(i.length){let o=i.map((c,a)=>({msg:c.msg,type:c.type,reason:c.reason,messageId:L(c.msg,n,-(a+1))}));await C(I,c=>{let a=j(c,"dropped")-1,d=o.map(l=>(a+=1,{type:"dropped",id:`drop_${l.messageId}`,fields:{messageType:l.type,messageId:l.messageId,endpoint:t,reason:l.reason,seq:a}})),h=d[0];return{kind:"write",value:null,write:{operation:"drop.messages",subjectType:"dropped",subjectId:h.id,occurredAt:n,fields:h.fields,projection:{creates:d},actor:{kind:"agent"},uniqueness:`${h.id}:${d.length}`}}},s)}return{status:200,body:{success:!0},headers:{"content-type":"application/json"}}}function re(e,t){let s=b.find(n=>n.id===e);return v(404,"twin_gap",`[twin gap] message type '${e}' (arriving at ${t}${s?`; ratified as ${s.method} ${s.path}`:""}) is in the segment twin's ratified surface but is not yet modeled \u2014 the whole payload was refused and nothing was stored. DEVIATION: the real Segment answers 200 here and silently drops the message; that is indistinguishable from acceptance, so this twin refuses instead`)}function ie(e){return v(404,"twin_gap",`[twin gap] ${e.method} ${e.path} (${e.id}) is in the segment twin's ratified surface but not yet modeled \u2014 failing loudly instead of faking success. DEVIATION: the real Segment answers 200 to this request; a 200 that stores nothing is indistinguishable from acceptance, so this twin refuses instead. Grounding: ${e.evidence.slice(0,120)}`)}var E=e=>async({op:t,body:s,root:n,occurredAt:r})=>{let i=s,o=i.messages.map(c=>({...c,type:e}));return F({...i,messages:o},t.path,n,r)},U={batch:async({op:e,body:t,root:s,occurredAt:n})=>F(t,e.path,s,n),track:E("track"),identify:E("identify"),page:E("page"),group:E("group"),alias:E("alias")};function Y(e,t,s){let n=y(e);if(n)return s?Array.isArray(n.batch)?{messages:n.batch,context:y(n.context),integrations:y(n.integrations),writeKey:t.writeKey,scheme:t.scheme,sentAt:p(n.sentAt)??null,batched:!0}:void 0:{messages:[n],context:void 0,integrations:void 0,writeKey:t.writeKey,scheme:t.scheme,sentAt:p(n.sentAt)??null,batched:!1}}async function R(e){let t=new URL(e.path,"http://twin.local"),s=T({method:e.method,path:t.pathname+t.search,body:e.body});if(!s)return v(404,"unknown_endpoint",`unknown endpoint: ${e.method.toUpperCase()} ${t.pathname} \u2014 not an operation in the segment twin's ratified surface (var/line/segment/SURFACE.json)`);let{op:n}=s,r=U[n.id];if(!r)return ie(n);let i=e.body??"",o=B(i),c=n.id==="batch",a=c?$:_;if(o>a)return v(400,"payload_too_large",`payload of ${o} bytes exceeds the ${a}-byte maximum for ${n.method} ${n.path}`);let d;try{d=JSON.parse(i)}catch{return v(400,"invalid_json","request body is not valid JSON")}let h=K(e.authorization,d),l=Y(d,h,c);return l?r({op:n,params:s.params,query:s.query,body:l,root:e.root,occurredAt:e.occurredAt??Z()}):v(400,"invalid_payload",c?"POST /v1/batch requires a JSON object with a `batch` ARRAY of messages":`${n.method} ${n.path} requires a single JSON message object`)}import{serveHttp as be}from"../../engine/v2/volter_world-core.mjs";import{statefulTwinManifest as ae,worldNow as oe}from"../../engine/v2/volter_world-core.mjs";var H=ae({vendor:"segment",twinOf:"the Segment HTTP Tracking API",stores:"tracked events, identify calls, group calls and refused (dropped) messages",identity:"Authenticate as Segment does \u2014 the write key as HTTP Basic username, an OAuth bearer, or `writeKey` in the body; the twin accepts any non-sentinel credential."}),W={events:O,identities:N,groups:k,dropped:A},V=Object.keys(W).sort(),ce={...H,stores:V,doors:{...H.doors,store:"GET /twin/store/<name>"}};function P(e={}){return async function(s){try{let n=new URL(s.url),r=n.pathname.replace(/\/+$/,"")||"/";if(s.method==="GET"&&r==="/twin")return Response.json(ce);if(s.method==="GET"&&r.startsWith("/twin/store/")){let o=r.slice(12),c=W[o];return c?Response.json(c(e.root)):Response.json({error:"unknown store",store:o,stores:V},{status:404})}let i=await R({method:s.method,path:n.pathname+n.search,body:s.method==="GET"||s.method==="HEAD"?void 0:await s.text(),contentType:s.headers.get("content-type")??void 0,authorization:s.headers.get("authorization")??void 0,occurredAt:oe(),root:e.root});return i.body===null||i.body===void 0?new Response(null,{status:i.status,headers:i.headers}):Response.json(i.body,{status:i.status,headers:i.headers})}catch(n){return Response.json({code:"twin_internal_error",message:String(n)},{status:500})}}}import{bundleClient as Oe,fileResponse as Ne,filePathOf as ke}from"../../engine/v2/volter_world-core.mjs";import{serveHttp as _e}from"../../engine/v2/volter_world-core.mjs";import{assertBudgetGuardIntact as Be,assertFastForward as Ke,confirmAction as qe,NonFastForwardPushError as Ge,pendingActions as Ue,syncPull as Ye}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as de,rateBudgetPath as De,rateBudgetWeight as Ce,RateBudget as Le}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as me}from"../../engine/v2/volter_world-core.mjs";var pe="segment",ue=6e4,J=60,le=300,S={ingestion:2,oauth:6,other:2},D={windowMs:ue,ceiling:J,defaultWeight:S.other,maxRetryAfterSeconds:le,rules:[{match:"^POST /v1/(batch|b|t)$",weight:S.ingestion},{match:"^POST /v1/(track|identify|page|screen|group|alias)$",weight:S.ingestion},{match:"^GET /v1/pixel/(track|identify|page|screen|group|alias)$",weight:S.ingestion},{match:"^POST /token$",weight:S.oauth}],reason:`Segment publishes scalar limits and this declaration deliberately does NOT adopt the headline one. Live-fetched 2026-08-24 from github.com/segmentio/segment-docs (the docs' own source; segment.com answers 403 to non-browser clients): src/connections/sources/catalog/libraries/server/http-api/index.md '## Rate limits' \u2014 "For each workspace, Segment recommends you to not exceed 1,000 requests per second with the HTTP API... Requests that exceed acceptable limits may be rejected with HTTP Status Code 429. When Segment rejects the requests, the response header contains Retry-After and X-RateLimit-Reset headers"; src/connections/rate-limits.md (updated January 25, 2024) repeats the 1,000/second inbound figure. That number is a WORKSPACE-WIDE production-throughput recommendation, not a per-connector allowance, and this pack's only live caller is a replay path \u2014 so adopting it would dress a vendor recommendation up as a client budget. The ceiling is therefore exactly the kernel fallback shape: 60 weighted units / 60s at defaultWeight 2 (30 calls/minute, same burst), claiming no extra permissiveness and owing no burst anchor. The vendor's cost STRUCTURE appears only in the relative weights, all at or above the default \u2014 tracking writes 2, the OAuth token exchange 6 \u2014 so a runaway auth loop halts three times sooner than a runaway ingest loop. That 2:6 ratio is a judgement about relative risk, not a published cost. Size limits from the same page ('## Max request size': 32KB per request, 500KB per batch, 32KB per batched event; '## Errors': 2,500 events per batch) are enforced in segment-twin.ts, not here \u2014 they bound payloads, not call rate.`};de(pe,D);export{P 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-sendblue
2
+
3
+ Contains @volter/twin-sendblue 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{createHash as ne}from"node:crypto";import{applyTwinWrite as se,projectResources as C,worldNow as re,deliveryTraceHeaders as oe}from"../../engine/v2/volter_world-core.mjs";import{nodeBuiltin as J}from"../../engine/v2/volter_world-core.mjs";function X(){return J("node:crypto")}var _="+15550100001";function I(e,t){return X().createHmac("sha256",e).update(t,"utf8").digest("hex")}function y(e){let t=JSON.stringify(e.payload);return{body:t,headers:{"content-type":"application/json","sb-signature":I(e.signingSecret,t)}}}import{applyTwinWriteAtomic as z,projectResources as Z,nodeBuiltin as q}from"../../engine/v2/volter_world-core.mjs";function ee(){return q("node:crypto")}var k="sendblue",w="credential",O="credential:api";function x(e){let t=e.find(o=>o.type===w&&o.id===O);if(!t)return;let n=t._api_key_id,s=t._api_secret_key,r=t._signing_secret;if(!(typeof n!="string"||typeof s!="string"||typeof r!="string")&&!(!n||!s||!r))return{apiKeyId:n,apiSecretKey:s,signingSecret:r}}function g(e){return x(Z(k,e))}function m(e){return ee().randomBytes(e).toString("hex")}function te(e){return{apiKeyId:e?.apiKeyId||`sb-key-${m(12)}`,apiSecretKey:e?.apiSecretKey||`sb-secret-${m(20)}`,signingSecret:m(32)}}async function b(e,t){let n=g(e);if(n)return n;let{value:s}=await z(k,r=>{let o=x(r);if(o)return{kind:"skip",value:o};let i=te(t);return{kind:"write",value:i,write:{operation:"credential.create",subjectType:w,subjectId:O,fields:{_api_key_id:i.apiKeyId,_api_secret_key:i.apiSecretKey,_signing_secret:i.signingSecret},actor:{kind:"system"}}}},e);return s}import{appDestination as ie,appFetch as ae}from"../../engine/v2/volter_world-core_app-route.mjs";import{worldEgressRefusal as ue}from"../../engine/v2/volter_world-core_network-policy.mjs";var T="sendblue",D="0000$";function de(e){let t={};for(let[n,s]of Object.entries(e??{}))t[n.toLowerCase()]=s;return t}function v(e){return e??re()}function ce(e,t){let n="";for(let s=0;n.length<t;s+=1){let r=2166136261,o=`${s}:${e}`;for(let i=0;i<o.length;i+=1)r^=o.charCodeAt(i),r=Math.imul(r,16777619)>>>0;n+=r.toString(16).padStart(8,"0")}return n.slice(0,t)}function le(e){return`message:${e}`}function d(e,t){return{status:e,body:{status:"ERROR",error_message:t}}}function fe(){return d(404,"The requested resource was not found")}function E(e,t){return{fromNumber:t?.fromNumber??_,failNumberPattern:t?.failNumberPattern??D}}async function M(e,t){let n=await b(e);return{apiKeyId:t?.apiKeyId??n.apiKeyId,apiSecretKey:t?.apiSecretKey??n.apiSecretKey,signingSecret:t?.signingSecret??n.signingSecret,...E(e,t)}}function h(e){let t="message:";return C(T,e).filter(n=>n.type==="message"&&n.id.startsWith(t)&&n._deleted!==!0).map(n=>({...n,id:n.id.slice(t.length)}))}function pe(e){return C(T,e).filter(t=>t.type==="message"&&t.id.startsWith("message:")).length}function R(e,t){return h(t).find(n=>n.id===e)}function S(e){let{type:t,updatedAt:n,id:s,...r}=e,o={message_handle:s};for(let[i,a]of Object.entries(r))i.startsWith("_")||(o[i]=a);return o}async function P(e,t,n,s){await se(T,{operation:n,subjectType:"message",subjectId:le(e),fields:t,...s.occurredAt?{occurredAt:s.occurredAt}:{},actor:{kind:"agent"}},s.root)}async function ge(e){let t=de(e.headers),n=t["sb-api-key-id"],s=t["sb-api-secret-key"];if(!n||!s)return d(401,"Missing API credentials (sb-api-key-id / sb-api-secret-key headers are required)");let r;return e.config?.apiKeyId!==void 0&&e.config?.apiSecretKey!==void 0?r={apiKeyId:e.config.apiKeyId,apiSecretKey:e.config.apiSecretKey}:e.readOnly?r=g(e.root)??{apiKeyId:n,apiSecretKey:s}:r=await b(e.root,{apiKeyId:n,apiSecretKey:s}),n!==r.apiKeyId||s!==r.apiSecretKey?d(401,"Invalid API credentials"):null}function be(e){if(e===void 0||e==="")return{ok:!0,value:{}};try{let t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{ok:!1}:{ok:!0,value:t}}catch{return{ok:!1}}}var K=/^\+[1-9]\d{6,14}$/;function Ee(e,t){let n=`message:${e}:${pe(t)}`,s=ce(n,32);return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20,32)}`}async function he(e,t){let n=E(t.root,t.config),s=typeof e.number=="string"?e.number:"",r=typeof e.content=="string"?e.content:"",o=typeof e.media_url=="string"?e.media_url:null,i=typeof e.send_style=="string"?e.send_style:null,a=typeof e.status_callback=="string"?e.status_callback:null;if(!s)return d(400,"The recipient 'number' is required to send a message");if(!K.test(s))return d(400,`Invalid 'number': ${s} is not an E.164 phone number`);if(!r&&!o)return d(400,"Either 'content' or 'media_url' is required to send a message");let c=v(t.occurredAt),u=Ee(c,t.root),p=new RegExp(n.failNumberPattern).test(s);await P(u,{account_email:"twin@sendblue.local",content:r,media_url:o,send_style:i,number:s,to_number:s,from_number:n.fromNumber,is_outbound:!0,status:"QUEUED",error_code:null,error_message:null,was_downgraded:!1,date_sent:c,date_updated:c,_status_callback:a,_will_fail:p,_status_history:["QUEUED"]},"message.create",t);let l=R(u,t.root);return{status:200,body:S(l)}}async function Se(e){return e.readOnly||await W({...e.root!==void 0?{root:e.root}:{},...e.occurredAt!==void 0?{occurredAt:e.occurredAt}:{},...e.config!==void 0?{config:e.config}:{},...e.deliver!==void 0?{deliver:e.deliver}:{}}),{status:200,body:{messages:h(e.root).map(S)}}}function F(e,t=D){return new RegExp(t).test(e)||parseInt(ne("sha256").update(e).digest("hex").slice(0,4),16)%4===0?"SMS":"iMessage"}function _e(e,t){let n=e.get("number")??"";if(!n)return d(400,"The 'number' query parameter is required");if(!K.test(n))return d(400,`Invalid 'number': ${n} is not an E.164 phone number`);let s=E(t.root,t.config);return{status:200,body:{number:n,service:F(n,s.failNumberPattern)}}}var ye=async(e,t,n)=>{if(!(!ie(e)&&ue(e)!==null))try{await ae(e,{method:"POST",body:t,headers:{...n,...oe()}})}catch{}};function me(e){let t=S(e);return{accountEmail:t.account_email,content:t.content,media_url:t.media_url,is_outbound:t.is_outbound,status:t.status,error_code:t.error_code,error_message:t.error_message,message_handle:t.message_handle,date_sent:t.date_sent,date_updated:t.date_updated,from_number:t.from_number,number:t.number,to_number:t.to_number,was_downgraded:t.was_downgraded}}function G(e,t){let n=e.status;if(n==="DELIVERED"||n==="ERROR")return null;let s=typeof e.date_updated=="string"?e.date_updated:"";return t>s?n==="QUEUED"?e._will_fail===!0?"ERROR":"SENT":n==="SENT"?"DELIVERED":null:null}async function H(e,t={}){let n=R(e,t.root);if(!n)return null;let s=v(t.occurredAt),r=G(n,s);if(!r)return null;let o=Array.isArray(n._status_history)?n._status_history:[],i=r==="ERROR"?{status:"ERROR",error_code:4001,error_message:"Failed to send message (sendblue twin fail-pattern number)",date_updated:s,_status_history:[...o,"ERROR"]}:{status:r,date_updated:s,_status_history:[...o,r]};await P(e,i,"message.progress",{...t,occurredAt:s});let a=R(e,t.root),c=null,u=a._status_callback;if(typeof u=="string"&&u.length>0){let p=await M(t.root,t.config),l=y({payload:me(a),signingSecret:p.signingSecret});c={url:u,body:l.body,headers:l.headers},await(t.deliver??ye)(u,l.body,l.headers)}return{status:a.status,delivery:c}}async function W(e={}){let t=v(e.occurredAt),n=[];for(let s of h(e.root)){let r=s.id,o=await H(r,{...e,occurredAt:t});o&&n.push({handle:r,status:o.status,delivery:o.delivery})}return n}function B(e){return h(e).map(t=>({...S(t),status_history:Array.isArray(t._status_history)?[...t._status_history]:[],status_callback:t._status_callback??null}))}async function A(e){let t=e.method.toUpperCase(),[n,s]=e.path.split("?"),r=(n??"/").replace(/\/+$/,"")||"/",o=new URLSearchParams(s??"");if(e.readOnly&&t!=="GET"&&t!=="HEAD")return d(405,"twin is read-only; omit readOnly to accept writes");if(r==="/"||r==="")return{status:200,body:{service:"sendblue",object:"twin"}};let i=await ge(e);if(i)return i;if(r==="/api/send-message"&&t==="POST"){let a=be(e.body);return a.ok?he(a.value,e):d(400,"Request body must be a JSON object")}return r==="/accounts/messages"&&t==="GET"?await Se(e):r==="/api/evaluate-service"&&t==="GET"?_e(o,e):fe()}import{serveHttp as We}from"../../engine/v2/volter_world-core.mjs";import{isReadOnlyRequest as we,worldNow as Re,statefulTwinManifest as Te,withRequestScopes as De}from"../../engine/v2/volter_world-core.mjs";var $=["messages"];function ve(){let e={};return process.env.SENDBLUE_API_KEY_ID&&(e.apiKeyId=process.env.SENDBLUE_API_KEY_ID),process.env.SENDBLUE_API_SECRET_KEY&&(e.apiSecretKey=process.env.SENDBLUE_API_SECRET_KEY),process.env.SENDBLUE_WEBHOOK_SIGNING_SECRET&&(e.signingSecret=process.env.SENDBLUE_WEBHOOK_SIGNING_SECRET),process.env.SENDBLUE_TWIN_FROM_NUMBER&&(e.fromNumber=process.env.SENDBLUE_TWIN_FROM_NUMBER),process.env.SENDBLUE_TWIN_FAIL_PATTERN&&(e.failNumberPattern=process.env.SENDBLUE_TWIN_FAIL_PATTERN),e}function j(e={}){let t={...ve(),...e.config??{}};return De(async function(s){let r=(e.readOnly??!1)||we(s),o=new URL(s.url),i=o.pathname.replace(/\/+$/,"");if(s.method==="GET"&&i==="/twin"){let f=Te({vendor:"sendblue",twinOf:"the SendBlue iMessage/SMS API",stores:"sent messages and their delivery-status lifecycle",identity:"Authenticate as SendBlue does (sb-api-key-id / sb-api-secret-key). A virgin world is SEEDED by the first pair it sees and accepts only that pair afterwards; ask the twin to mint one instead with sendblueApiKeyId(root) / sendblueApiSecretKey(root).",notes:"Delivery status is a POLL-FOLD: GET /accounts/messages advances every message one step (QUEUED -> SENT -> DELIVERED, or -> ERROR for a fail-pattern number) per world instant and delivers that transition's sb-signature-signed status_callback. A frozen world holds its messages still \u2014 advance the clock and read again. GET /twin/store/messages observes without folding."});return Response.json({...f,stores:$,doors:{...f.doors,store:"GET /twin/store/<name>"}})}if(s.method==="GET"&&i.startsWith("/twin/store/")){let f=i.slice(12);return f!=="messages"?Response.json({error:"unknown store",store:f,stores:$},{status:404}):Response.json(B(e.root))}let a=s.method!=="GET"&&s.method!=="HEAD"?await s.text():"",c={};s.headers.forEach((f,Q)=>{c[Q.toLowerCase()]=f});let{status:u,body:p,headers:l}=await A({method:s.method,path:o.pathname+(o.search||""),body:a,headers:c,readOnly:r,occurredAt:Re(),config:t,...e.root!==void 0?{root:e.root}:{},...e.deliver!==void 0?{deliver:e.deliver}:{}});return u===204||p===null?new Response(null,{status:u,headers:{...l??{}}}):new Response(JSON.stringify(p),{status:u,headers:{"content-type":"application/json",...l??{}}})})}import{syncPull as nt}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as Be,rateBudgetPath as Qe,rateBudgetWeight as Je,RateBudget as Xe,RateBudgetError as ze}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as Ne}from"../../engine/v2/volter_world-core.mjs";var Ae="sendblue",Y=12e4,N=60,V=300,U={lookup:60,other:2};var L={windowMs:Y,ceiling:N,burstCeiling:N,defaultWeight:U.other,maxRetryAfterSeconds:V,rules:[{match:"(^|\\.)lookup$",weight:U.lookup}],reason:`SendBlue publishes per-line limits: 10 messages/second per line (rejected, not queued, beyond that), 50 new contacts/line/day and 15 per rolling hour, 150 consecutive outbound without a reply, and the Lookup API at 30 per HOUR / 100 per day per line. It publishes NO limit for the message-history read this connector calls, so the RATE is pinned UNDER the kernel's conservative fallback (60 units / 120s at weight 2 = 15 calls/min against the fallback's 30) rather than derived from the per-line send rate this ledger cannot see. The window is 120s, not 60s, because that is the shortest one in which the Lookup limit is EXACT: lookup costs the whole window, so one lookup per 120s = 30/hour, matching the documented figure. A 60s window would have admitted 60/hour \u2014 twice what SendBlue allows (a \xA79 finding against an earlier revision that shipped that window and called it "tight"). Because the lookup price IS the ceiling, burstCeiling must equal the ceiling \u2014 a tighter one would refuse the documented Lookup endpoint outright \u2014 so the ceiling itself carries the burst bound and is sized for it: draining the whole window in one instant is 30 calls, exactly the fallback's burst, and the halved sustained rate is the price. The documented cap is also PER LINE, which a per-credential ledger cannot distinguish, so with several lines in play staying under 30/hour/line remains the caller's responsibility. SendBlue documents 429 but not Retry-After; the 429 cooldown is the backstop.`};Be(Ae,L);export{j 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,8 @@
1
+ @agenttwin/twin-sendgrid
2
+
3
+ Contains @volter/twin-sendgrid 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.
8
+ The upstream package declares Apache-2.0 but ships no LICENSE file; LICENSE is the license's standard text.