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-tiktok
2
+
3
+ Contains @volter/twin-tiktok 1.0.0 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.
@@ -0,0 +1,2 @@
1
+ import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
2
+ var wt=Object.defineProperty;var St=(e,t)=>{for(var s in t)wt(e,s,{get:t[s],enumerable:!0})};import{packOf as xt,registerPack as es}from"../../engine/v3/volter_world-core.mjs";var ie={vendor:"tiktok",discovery:{twinOf:"TikTok's open platform: an app's authorize page and tokens, posting videos and photos (direct and to the inbox) with their upload host and status, and a user's profile, stats and videos",stores:"the developer site's apps and URL properties, TikTok's people, authorization codes and tokens (by their SHA-256), posts and their uploads, and videos"},lanes:{routes:[{lane:"business",host:"^business-api\\.tiktok\\.com$"},{lane:"open",host:"^(open\\.tiktokapis\\.com|open-upload\\.tiktokapis\\.com|upload\\.us\\.tiktokapis\\.com|www\\.tiktok\\.com)$"}],default:"open"},descriptor:{protocol:"3",transport:"rest",archetype:"crud",bin:"world-tiktok",resources:["publish","video"],specSource:"written from the API reference pages of developers.tiktok.com (open/spec/openapi.json, provenance in open/spec/SOURCE.md)",description:"TikTok twin \u2014 Login Kit's authorize page and tokens, the Content Posting API (direct and inbox videos by chunked upload, photos pulled from verified URLs, post status) and the Display API (user info and stats, video list and query), as Postiz calls them.",adoption:{sdks:[],envStems:["TIKTOK"]},hosts:[{host:"business-api.tiktok.com"},{host:"open.tiktokapis.com"},{host:"open-upload.tiktokapis.com"},{host:"upload.us.tiktokapis.com"},{host:"www.tiktok.com",pathPattern:"^/v2/auth/authorize"}],endpointEnvNone:"Postiz calls open.tiktokapis.com and sends people to www.tiktok.com; the World claims the hosts",clientCasesNone:"Postiz uses fetch for both TikTok APIs; no official SDK behaviour is required.",credentialDoor:{path:"/_twin/app-credentials",body:{},fill:{TIKTOK_CLIENT_ID:"client_key",TIKTOK_CLIENT_SECRET:"client_secret",TIKTOK_BUSINESS_CLIENT_ID:"business_client_id",TIKTOK_BUSINESS_CLIENT_SECRET:"business_client_secret"}}}};import{placeholderPng as Ot}from"../../engine/v3/volter_world-core.mjs";var he="https://developers.tiktok.com/doc/content-posting-api-reference-get-video-status",Pt={initial:"PROCESSING_UPLOAD",transitions:[{actor:"vendor",from:["PROCESSING_UPLOAD","PROCESSING_DOWNLOAD"],to:"PUBLISH_COMPLETE",source:`${he} "it indicates that the content has been posted"`},{actor:"vendor",from:["PROCESSING_UPLOAD","PROCESSING_DOWNLOAD"],to:"SEND_TO_USER_INBOX",source:`${he} "Indicates that a notification has been sent to creator's inbox to complete the draft post using TikTok's editing flow."`},{actor:"vendor",from:["PROCESSING_DOWNLOAD"],to:"FAILED",source:`${he} "Indicates that an error has occurred and the entire process has failed."`}]},ne={state:{status:Pt},notState:["fail_reason","reason"]},ze={publish:ne};var k="_app",g="_person",j="_code",J="_access_token",L="_refresh_token",m="publish",y="video",be="_chunk",T=(e,t)=>e.crypto.digest("sha256",t,"hex"),h=e=>Math.floor(Date.parse(e)/1e3),Et=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},S=e=>Et(e.body),H=async(e,t)=>e.crypto.digest("sha256",await e.secret(`tiktok-client-secret:${String(t.id)}`),"hex").slice(0,32),ae=(e,t)=>e.rowsRaw(k).find(s=>s.deleted!==!0&&s.client_key===t),F=(e,t,s)=>e.crypto.uuidFrom(`tiktok-open-id:${String(t.id)}:${String(s.id)}`),Ve=(e,t)=>e.crypto.uuidFrom(`tiktok-union-id:${String(t.id)}`),P=(e,t)=>`${e.publicBase.replace(/\/$/,"")}/_twin/media/${t}.png`,Me=e=>Ot({width:720,height:1280},`tiktok:${e}`,`placeholder image from the TikTok twin: ${e}`),X=86400,Z=31536e3;async function B(e,t,s,o){let r=e.mint(t),i=`${s}.${(await e.secret(`tiktok:${t}:${r}`)).replace(/[^A-Za-z0-9]/g,"").slice(0,36)}!${(await e.secret(`tiktok:${t}:${r}:n`)).replace(/\D/g,"").padEnd(4,"0").slice(0,4)}`;return await e.record(t,{...o,sha256:T(e,i),created:e.occurredAt},r),{id:r,value:i}}var q=(e,t,s)=>e.rowsRaw(t).find(o=>o.deleted!==!0&&o.sha256===T(e,s)),$=async(e,t)=>Number(await e.issue(`_seq_${t}`)),ue=(e,t)=>Math.max(Date.parse(e.occurredAt),...e.rowsRaw(y).filter(s=>s._person===t).map(s=>Number(s._moment)+1));function de(e,t,s,o){let r=e.rowsRaw(y).filter(n=>n.deleted!==!0&&n._person===t&&n._public===!0&&Number(n._moment)<s).sort((n,a)=>Number(a._moment)-Number(n._moment)),i=r.slice(0,o);return{page:i,cursor:i.length?Number(i.at(-1)._moment):0,more:r.length>o}}var G=e=>e.private===!0?["FOLLOWER_OF_CREATOR","MUTUAL_FOLLOW_FRIENDS","SELF_ONLY"]:["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","SELF_ONLY"];var He={publish:ne};var K={vendor:"tiktok",service:"tiktok",body:{json:"always"},ids:{template:"{uuid}"},time:"unix",error:{code:"{code}",message:"{message}",request_id:"{id}",data:{}},errorsAnsweredAs:{status:200,below:500},readOnly:{status:200,message:"This twin was started read-only; writes are refused."},notFound:{status:200,code:40008,message:"The interface (endpoint) has not been implemented."},gap:{status:200,code:40008,message:"The interface (endpoint) has not been implemented."},deleted:{},resources:{publish:{idPrefix:"",...He.publish},video:{idPrefix:""},_access_token:{idPrefix:"act_",ids:"{prefix}{n}"},_refresh_token:{idPrefix:"rft_",ids:"{prefix}{n}"},_seq_publish:{idPrefix:"",ids:"{n}"},_seq_video:{idPrefix:"",ids:"{n}"}},unmodeled:["ttUserOauth2Revoke","ttUserTokenInfoGet"],discovery:{twinOf:"TikTok's API for Business v1.3 as a TikTok account's owner uses it: its tokens, its profile, its posts, publishing videos and photos by URL, the publishing status, location tags and the Commercial Music Library's popular tracks",stores:"the vendor's one store (the open lane's): apps, people, codes and tokens, posts and videos, and the World's location tags and tracks"}};var pe={generatedBy:"scripts/derive-pack.ts",spec:"openapi.json",format:"openapi",version:"v1.3",resources:[],operations:[{id:"businessGet",method:"get",path:"/open_api/v1.3/business/get/",pathParams:[],query:[{name:"business_id",type:"string",required:!0},{name:"fields",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed"},{id:"businessPhotoPublish",method:"post",path:"/open_api/v1.3/business/photo/publish/",pathParams:[],query:[],body:[{name:"business_id",type:"string",required:!1},{name:"photo_cover_index",type:"integer",required:!1},{name:"photo_images",type:"array",required:!1},{name:"post_info",type:"object",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"},{id:"businessPublishLocation",method:"get",path:"/open_api/v1.3/business/publish/location/",pathParams:[],query:[{name:"business_id",type:"string",required:!0},{name:"search_query",type:"string",required:!0}],body:[],bodyEncoding:"none",successStatus:200,class:"computed"},{id:"businessPublishStatus",method:"get",path:"/open_api/v1.3/business/publish/status/",pathParams:[],query:[{name:"business_id",type:"string",required:!0},{name:"publish_id",type:"string",required:!0}],body:[],bodyEncoding:"none",successStatus:200,class:"computed"},{id:"businessVideoList",method:"get",path:"/open_api/v1.3/business/video/list/",pathParams:[],query:[{name:"business_id",type:"string",required:!0},{name:"cursor",type:"integer",required:!1},{name:"fields",type:"string",required:!1},{name:"max_count",type:"integer",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed"},{id:"businessVideoPublish",method:"post",path:"/open_api/v1.3/business/video/publish/",pathParams:[],query:[],body:[{name:"business_id",type:"string",required:!1},{name:"custom_thumbnail_url",type:"string",required:!1},{name:"post_info",type:"object",required:!1},{name:"video_url",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"},{id:"discoveryCmlTrendingList",method:"get",path:"/open_api/v1.3/discovery/cml/trending_list/",pathParams:[],query:[{name:"business_id",type:"string",required:!0},{name:"genre",type:"string",required:!1}],body:[],bodyEncoding:"none",successStatus:200,class:"computed"},{id:"ttUserOauth2RefreshToken",method:"post",path:"/open_api/v1.3/tt_user/oauth2/refresh_token/",pathParams:[],query:[],body:[{name:"client_id",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"grant_type",type:"string",required:!1},{name:"refresh_token",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"},{id:"ttUserOauth2Revoke",method:"post",path:"/open_api/v1.3/tt_user/oauth2/revoke/",pathParams:[],query:[],body:[{name:"access_token",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"client_secret",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"},{id:"ttUserOauth2Token",method:"post",path:"/open_api/v1.3/tt_user/oauth2/token/",pathParams:[],query:[],body:[{name:"auth_code",type:"string",required:!1},{name:"client_id",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"grant_type",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"},{id:"ttUserTokenInfoGet",method:"post",path:"/open_api/v1.3/tt_user/token_info/get/",pathParams:[],query:[],body:[{name:"access_token",type:"string",required:!1},{name:"app_id",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,class:"non-resource"}]};var W={vendor:"tiktok",service:"tiktok",body:{json:"always"},ids:{template:"{uuid}"},time:"unix",error:{data:{},error:{code:"{code}",message:"{message}",log_id:"{id}"}},readOnly:{status:403,message:"This twin was started read-only; writes are refused."},notFound:{status:400,code:"invalid_params",message:"One or more fields in request is invalid. Please refer to the error message for details."},gap:{status:400,code:"invalid_params",message:"One or more fields in request is invalid. Please refer to the error message for details."},deleted:{},resources:{publish:{idPrefix:"",...ze.publish},video:{idPrefix:""},_app:{idPrefix:"app_",ids:"{prefix}{n}"},_person:{idPrefix:"person_",ids:"{prefix}{n}"},_location:{idPrefix:"",ids:"{hex:24}"},_track:{idPrefix:"",ids:"{n}"},_code:{idPrefix:"code_",ids:"{prefix}{n}"},_access_token:{idPrefix:"act_",ids:"{prefix}{n}"},_refresh_token:{idPrefix:"rft_",ids:"{prefix}{n}"},_seq_publish:{idPrefix:"",ids:"{n}"},_seq_video:{idPrefix:"",ids:"{n}"}},unmodeled:["oauthRevoke","publishCancel"],screens:[{id:"authorize",kind:"flow",host:"www.tiktok.com",path:"/v2/auth/authorize/",demand:"Postiz connects a TikTok account: it sends the person here with its client key, redirect URI, state and scopes",status:"done",controls:["Log in","Authorize","Cancel"],source:"https://developers.tiktok.com/doc/login-kit-web"}],doors:[{id:"appCredentials",method:"POST",path:"/_twin/app-credentials",note:"the World application's app on the developer site: its client key and secret"},{id:"apps",method:"POST",path:"/_twin/apps",note:"{ redirect_uris?, url_properties?, business_redirect_uris? }: the World application's apps' redirect URIs and verified URL properties (the developer site's Login Kit and URL properties settings)"},{id:"people",method:"POST",path:"/_twin/people",note:"{ username, display_name, password, follower_count?, following_count?, likes_count?, max_video_post_duration_sec?, private? }: a TikTok account"},{id:"videoStats",method:"POST",path:"/_twin/videos/{id}/stats",note:"{ view_count?, like_count?, comment_count?, share_count? }: a video's audience (TikTok's viewers)"},{id:"media",method:"GET",path:"/_twin/media/{name}",note:"a placeholder image (an avatar, a cover)"},{id:"locations",method:"POST",path:"/_twin/locations",note:"{ location_name, location_address? }: a location tag TikTok holds"},{id:"tracks",method:"POST",path:"/_twin/tracks",note:"{ name, artist, genre?, duration? }: a track of the Commercial Music Library"}],discovery:{twinOf:"TikTok's open platform: the authorize page and tokens, posting videos and photos with their upload host and status, and a user's profile, stats and videos",stores:"apps, people, codes and tokens (by their SHA-256), posts (their uploads as blobs) and videos"}};var ce={generatedBy:"scripts/derive-pack.ts",spec:"openapi.json",format:"openapi",version:"2026-08-24",resources:[],operations:[{id:"oauthRevoke",method:"post",path:"/v2/oauth/revoke/",pathParams:[],query:[],body:[{name:"client_key",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"token",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,emptySuccess:!0,class:"non-resource"},{id:"oauthToken",method:"post",path:"/v2/oauth/token/",pathParams:[],query:[],body:[{name:"client_key",type:"string",required:!1},{name:"client_secret",type:"string",required:!1},{name:"code",type:"string",required:!1},{name:"code_verifier",type:"string",required:!1},{name:"grant_type",type:"string",required:!1},{name:"redirect_uri",type:"string",required:!1},{name:"refresh_token",type:"string",required:!1}],bodyEncoding:"form",successStatus:200,class:"non-resource"},{id:"publishCancel",method:"post",path:"/v2/post/publish/cancel/",pathParams:[],query:[],body:[{name:"publish_id",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"contentInit",method:"post",path:"/v2/post/publish/content/init/",pathParams:[],query:[],body:[{name:"media_type",type:"string",required:!1},{name:"post_info",type:"object",required:!1},{name:"post_mode",type:"string",required:!1},{name:"source_info",type:"object",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"creatorInfoQuery",method:"post",path:"/v2/post/publish/creator_info/query/",pathParams:[],query:[],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"inboxVideoInit",method:"post",path:"/v2/post/publish/inbox/video/init/",pathParams:[],query:[],body:[{name:"source_info",type:"object",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"publishStatusFetch",method:"post",path:"/v2/post/publish/status/fetch/",pathParams:[],query:[],body:[{name:"publish_id",type:"string",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"videoInit",method:"post",path:"/v2/post/publish/video/init/",pathParams:[],query:[],body:[{name:"post_info",type:"object",required:!1},{name:"source_info",type:"object",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"userInfo",method:"get",path:"/v2/user/info/",pathParams:[],query:[{name:"fields",type:"string",required:!0}],body:[],bodyEncoding:"none",successStatus:200,credentials:["bearer"],class:"computed"},{id:"videoList",method:"post",path:"/v2/video/list/",pathParams:[],query:[{name:"fields",type:"string",required:!0}],body:[{name:"cursor",type:"integer",required:!1},{name:"max_count",type:"integer",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"videoQuery",method:"post",path:"/v2/video/query/",pathParams:[],query:[{name:"fields",type:"string",required:!0}],body:[{name:"filters",type:"object",required:!1}],bodyEncoding:"json",successStatus:200,credentials:["bearer"],class:"non-resource"},{id:"uploadVideo",method:"put",path:"/video/",pathParams:[],query:[{name:"upload_id",type:"string",required:!0},{name:"upload_token",type:"string",required:!0}],body:[{name:"body",type:"blob",required:!0}],bodyEncoding:"none",successStatus:201,emptySuccess:!0,class:"non-resource"}]};import{createVendorFetch as Zt}from"../../engine/v3/volter_world-core.mjs";import{createPackFetch as Nt}from"../../engine/v3/volter_world-core.mjs";var Ge=(e,t)=>`${e.occurredAt.replace(/\D/g,"").slice(0,14)}${e.crypto.digest("sha256",`${e.occurredAt}:business:${t}`,"hex").slice(0,18).toUpperCase()}`,z=(e,t)=>Response.json({code:0,message:"OK",request_id:Ge(e,JSON.stringify(t)),data:t}),l=(e,t,s)=>Response.json({code:t,message:s,request_id:Ge(e,`${t}:${s}`),data:{}}),b=40002,le=40001;function V(e,t){let s=e.call.request.headers.get("access-token")??"";if(!s)return l(e,40104,"The access token is empty.");let o=q(e,J,s);if(!o||o.kind!=="business"||o.revoked===!0)return l(e,40105,"Invalid or incorrect access token.");if(Number(o.expires_at)<=h(e.occurredAt))return l(e,40102,"The access token has expired.");let r=e.row(k,String(o.app)),i=e.row(g,String(o.person)),n=F(e,r,i);if(String(e.params.business_id??"")!==n)return l(e,le,"No permission to operate this TikTok account: business_id is not the access token's.");let p=String(o.scope).split(",");return t&&!p.includes(t)?l(e,le,`No permission: the TikTok account did not grant ${t}.`):{token:o,app:r,person:i,scopes:p,openId:n}}function ge(e,t){let s=new URL(e.call.request.url).searchParams.get(t);if(s!==null){try{let o=JSON.parse(s);if(Array.isArray(o)&&o.every(r=>typeof r=="string"))return o}catch{}return l(e,b,`${t} must be a JSON array of strings.`)}}async function ye(e){let t=S(e),s=e.rowsRaw(k).find(o=>o.deleted!==!0&&o.kind==="business"&&o.client_key===t.client_id);return!s||t.client_secret!==await H(e,s)?l(e,40131,"App ID or secret is incorrect."):s}async function ve(e,t,s,o){let r=h(e.occurredAt),i=await B(e,J,"act",{kind:"business",app:t.id,person:s.id,scope:o,expires_at:r+X,revoked:!1}),n=await B(e,L,"rft",{kind:"business",app:t.id,person:s.id,scope:o,access:i.id,expires_at:r+Z,used:!1});return z(e,{access_token:i.value,token_type:"Bearer",scope:o,expires_in:X,refresh_token:n.value,refresh_token_expires_in:Z,open_id:F(e,t,s)})}var Ke=["display_name","profile_image"],We=["display_name","profile_image","username","profile_deep_link","bio_description","is_verified","followers_count","following_count","total_likes","videos_count"],Qe=["item_id","create_time","thumbnail_url","share_url","embed_url","caption","video_duration","likes","comments","shares","video_views"],ke=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};async function Lt(e,t){let s=0;for(let o of t)try{let r=await e.vendorFetch(o,{method:"GET"});if(!r.ok)return;s+=(await r.arrayBuffer()).byteLength}catch{return}return s}async function Tt(e,t,s,o){let r=String(74e17+await $(e,"video")*1024),i=typeof s.caption=="string"?s.caption:"";return await e.write(y,r,{id:r,create_time:h(e.occurredAt),_moment:ue(e,String(o.id)),cover_image_url:P(e,`cover-${r}`),share_url:`https://www.tiktok.com/@${String(o.username)}/video/${r}`,video_description:i.slice(0,150),duration:0,height:0,width:0,title:i.slice(0,150),embed_html:`<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@${String(o.username)}/video/${r}" data-video-id="${r}"></blockquote>`,embed_link:`https://www.tiktok.com/player/v1/${r}`,like_count:0,comment_count:0,share_count:0,view_count:0,is_aigc:s.is_ai_generated===!0,_person:o.id,_public:!0,_publish:t},"video.publish"),r}async function we(e,t,s,o,r,i){let n=await $(e,"publish"),a=`${t==="VIDEO"?"v":"p"}_pub_url~v2.${n}`;await e.write(m,a,{status:"PROCESSING_DOWNLOAD",post_ids:[],_person:i.id,_media:t,_urls:s,_post_info:o,_draft:r,_lane:"business"},t==="VIDEO"?"businessVideoPublish":"businessPhotoPublish");let u=await Lt(e,s)===void 0?"FAILED":r?"SEND_TO_USER_INBOX":"PUBLISH_COMPLETE",d=e.legal(m,"status","publish.pull","PROCESSING_DOWNLOAD",u,a,"vendor");if(d)throw new Error(d.message);let c=u==="PUBLISH_COMPLETE"&&t==="VIDEO"?[await Tt(e,a,o,i)]:[];return await e.write(m,a,{status:u,post_ids:c,...u==="FAILED"?{reason:t==="VIDEO"?"video_pull_failed":"photo_pull_failed"}:{}},"publish.pull"),z(e,{share_id:a})}async function Ye(e){let t=await ye(e);if(t instanceof Response)return t;let s=S(e);if(s.grant_type!=="authorization_code")return l(e,b,"grant_type must be authorization_code.");let o=typeof s.auth_code=="string"?q(e,j,s.auth_code):void 0;return!o||o.used===!0||o.app!==t.id||Number(o.expires_at)<=h(e.occurredAt)?l(e,40110,"Invalid authorization code. The auth_code is canceled, already used or expired."):typeof s.redirect_uri=="string"&&s.redirect_uri!==o.redirect_uri?l(e,b,"redirect_uri does not match the one the code was issued for."):(await e.record(j,{...o,used:!0},String(o.id)),ve(e,t,e.row(g,String(o.person)),String(o.scope)))}async function Je(e){let t=await ye(e);if(t instanceof Response)return t;let s=S(e);if(s.grant_type!=="refresh_token")return l(e,b,"grant_type must be refresh_token.");let o=typeof s.refresh_token=="string"?q(e,L,s.refresh_token):void 0;return!o||o.used===!0||o.kind!=="business"||o.app!==t.id||Number(o.expires_at)<=h(e.occurredAt)?l(e,40107,"Invalid or incorrect refresh token."):(await e.record(L,{...o,used:!0},String(o.id)),ve(e,t,e.row(g,String(o.person)),String(o.scope)))}async function Xe(e){let t=V(e);if(t instanceof Response)return t;let s=ge(e,"fields");if(s instanceof Response)return s;let o=s??Ke,r=o.filter(a=>!We.includes(a));if(r.length)return l(e,b,`Invalid fields: ${r.join(", ")}`);let i=t.person,n={display_name:i.display_name,profile_image:P(e,`avatar-${String(i.id)}`),username:i.username,profile_deep_link:`https://www.tiktok.com/@${String(i.username)}`,bio_description:i.bio_description??"",is_verified:i.is_verified===!0,followers_count:Number(i.follower_count??0),following_count:Number(i.following_count??0),total_likes:Number(i.likes_count??0),videos_count:e.rowsRaw(y).filter(a=>a.deleted!==!0&&a._person===i.id&&a._public===!0).length};return z(e,Object.fromEntries(o.map(a=>[a,n[a]])))}async function Ze(e){let t=V(e);if(t instanceof Response)return t;let s=ge(e,"fields");if(s instanceof Response)return s;let o=s??["item_id"];if(!o.includes("item_id")||o.some(c=>!Qe.includes(c)))return l(e,b,"fields must include item_id and name only the supported fields.");let r=new URL(e.call.request.url).searchParams,i=r.get("max_count")===null?10:Number(r.get("max_count"));if(!Number.isInteger(i)||i<1||i>20)return l(e,b,"max_count must be between 1 and 20.");let n=r.get("cursor")===null?1/0:Number(r.get("cursor")),{page:a,cursor:p,more:u}=de(e,String(t.person.id),n,i),d=c=>{let E={item_id:c.id,create_time:c.create_time,thumbnail_url:c.cover_image_url,share_url:c.share_url,embed_url:c.embed_link,caption:c.video_description,video_duration:c.duration,likes:c.like_count,comments:c.comment_count,shares:c.share_count,video_views:c.view_count};return Object.fromEntries(o.map(_=>[_,E[_]]))};return z(e,{videos:a.map(d),cursor:p,has_more:u})}async function xe(e){let t=V(e,"video.publish");if(t instanceof Response)return t;let s=S(e);if(typeof s.video_url!="string"||!/^https?:\/\//.test(s.video_url))return l(e,b,"video_url must be an http(s) URL.");if(s.post_info===void 0||typeof s.post_info!="object")return l(e,b,"post_info is required.");let o=ke(s.post_info);return typeof o.is_brand_organic!="boolean"||typeof o.is_branded_content!="boolean"?l(e,b,"post_info.is_brand_organic and post_info.is_branded_content are required."):we(e,"VIDEO",[s.video_url],o,o.upload_to_draft===!0,t.person)}async function et(e){let t=V(e,"video.publish");if(t instanceof Response)return t;let s=S(e),o=Array.isArray(s.photo_images)?s.photo_images.map(String):[];if(o.length<1||o.length>35)return l(e,b,"photo_images must hold 1 to 35 URLs.");let r=Number(s.photo_cover_index??0);if(!Number.isInteger(r)||r<0||r>=o.length)return l(e,b,"photo_cover_index must index photo_images.");let i=ke(s.post_info),n=i.is_draft===!0;return typeof i.is_brand_organic!="boolean"||typeof i.is_branded_content!="boolean"?l(e,b,"post_info.is_brand_organic and post_info.is_branded_content are required."):typeof i.title=="string"&&i.title.length>90?l(e,b,"post_info.title is over 90 characters."):!n&&!G(t.person).includes(String(i.privacy_level))?l(e,b,"post_info.privacy_level must be one of the account's privacy levels."):we(e,"PHOTO",o,i,n,t.person)}async function tt(e){let t=V(e);if(t instanceof Response)return t;let s=String(e.params.publish_id??""),o=e.row(m,s);return!o||o.deleted===!0?l(e,b,"publish_id does not exist."):o._person!==t.person.id?l(e,le,"No permission to read this publishing task."):z(e,{status:o.status,...o.status==="PUBLISH_COMPLETE"?{post_ids:o.post_ids??[]}:{},...o.status==="FAILED"?{reason:o.reason}:{}})}async function st(e){let t=V(e);if(t instanceof Response)return t;let s=String(e.params.search_query??"");if(!s||s.length>100)return l(e,b,"search_query must be 1 to 100 characters.");let o=s.toLowerCase().split(/\s+/).filter(Boolean),r=e.rowsRaw("_location").filter(i=>o.every(n=>`${String(i.location_name)} ${String(i.location_address)}`.toLowerCase().includes(n)));return z(e,{locations:r.map(i=>({location_id:i.id,location_name:i.location_name,location_address:i.location_address}))})}async function ot(e){let t=V(e);if(t instanceof Response)return t;let s=typeof e.params.genre=="string"&&e.params.genre.toUpperCase()!=="ALL"?e.params.genre.toUpperCase():void 0,o=e.rowsRaw("_track").filter(r=>!s||r.genre===s);return z(e,{list:o.map(r=>({commercial_music_id:r.id,commercial_music_name:r.name,artist:r.artist,thumbnail_url:r.thumbnail_url,duration:r.duration,preview_url:r.preview_url,genre:r.genre,full_duration_song_clip:{song_clip_id:r.song_clip_id,duration:r.duration,preview_url:r.preview_url}}))})}var rt={businessGet:Xe,businessPhotoPublish:et,businessPublishLocation:st,businessPublishStatus:tt,businessVideoList:Ze,businessVideoPublish:xe,discoveryCmlTrendingList:ot,ttUserOauth2RefreshToken:Je,ttUserOauth2Token:Ye};function Se(e={}){return Nt({manifest:K,surface:pe,handlers:rt},e)}import{createPackFetch as Xt}from"../../engine/v3/volter_world-core.mjs";var Te={};St(Te,{appCredentials:()=>jt,apps:()=>Ft,locations:()=>Mt,media:()=>Vt,people:()=>Bt,tracks:()=>Ht,videoStats:()=>zt});var _e=["user.info.basic","user.info.profile","user.info.stats","video.list","video.publish","video.upload"],it=["user.info.basic","user.info.username","user.info.stats","video.list","video.upload","video.publish"],Pe=(e,t)=>`${e.occurredAt.replace(/\D/g,"").slice(0,14)}${e.crypto.digest("sha256",`${e.occurredAt}:${t}`,"hex").slice(0,20).toUpperCase()}`,U=(e,t)=>Response.json({data:t,error:{code:"ok",message:"",log_id:Pe(e,JSON.stringify(t))}}),v=(e,t,s,o)=>Response.json({data:{},error:{code:s,message:o,log_id:Pe(e,s)}},{status:t});function Ut(e){let t=/^Bearer\s+(\S+)$/i.exec(e.call.request.headers.get("authorization")??"")?.[1],s=t?q(e,J,t):void 0;if(!s||s.kind==="business"||s.revoked===!0||Number(s.expires_at)<=h(e.occurredAt))return;let o=e.row(k,String(s.app)),r=e.row(g,String(s.person));if(!(!o||!r))return{token:s,app:o,person:r,scopes:String(s.scope).split(","),openId:F(e,o,r)}}var At=e=>v(e,401,"access_token_invalid","The access token is invalid or not found in the request.");function A(e,...t){let s=Ut(e);return s?t.length&&!t.some(o=>s.scopes.includes(o))?v(e,401,"scope_not_authorized",`The user did not authorize the scope required for completing this request (${t.join(" or ")}).`):s:At(e)}var Q=(e,t,s)=>Response.json({error:t,error_description:s,log_id:Pe(e,t)},{status:t==="invalid_client"?401:400}),nt=(e,t,s)=>typeof t.challenge=="string"&&e.crypto.digest("sha256",String(s??""),"hex")!==t.challenge;async function Oe(e,t,s,o){let r=h(e.occurredAt),i=await B(e,J,"act",{app:t.id,person:s.id,scope:o,expires_at:r+X,revoked:!1}),n=await B(e,L,"rft",{app:t.id,person:s.id,scope:o,access:i.id,expires_at:r+Z,used:!1});return Response.json({access_token:i.value,expires_in:X,open_id:F(e,t,s),refresh_expires_in:Z,refresh_token:n.value,scope:o,token_type:"Bearer"})}var Ee={open_id:"user.info.basic",union_id:"user.info.basic",avatar_url:"user.info.basic",avatar_url_100:"user.info.basic",avatar_large_url:"user.info.basic",display_name:"user.info.basic",bio_description:"user.info.profile",profile_deep_link:"user.info.profile",is_verified:"user.info.profile",username:"user.info.profile",follower_count:"user.info.stats",following_count:"user.info.stats",likes_count:"user.info.stats",video_count:"user.info.stats"},x=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},$t=["id","create_time","cover_image_url","share_url","video_description","duration","height","width","title","embed_html","embed_link","like_count","comment_count","share_count","view_count","is_aigc"];function Re(e){let t=String(new URL(e.call.request.url).searchParams.get("fields")??"").split(",").map(o=>o.trim()).filter(Boolean),s=t.filter(o=>!$t.includes(o));return!t.length||s.length?v(e,400,"invalid_params",`Invalid fields: ${s.join(",")||"(none)"}`):t}var Ie=(e,t,s)=>{let o=e.get(y,String(t.id))??{};return Object.fromEntries(s.map(r=>[r,o[r]]))},N=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},te=1024*1024,Ct="https://open-upload.tiktokapis.com",O=(e,t)=>v(e,400,"invalid_param",t);function Dt(e,t,s){if(!Number.isInteger(e)||e<=0)return"video_size must be a positive integer";if(e>4*1024*te)return"video_size is over 4GB";if(!Number.isInteger(t)||t<=0||!Number.isInteger(s))return"chunk_size and total_chunk_count are required for FILE_UPLOAD";if(e<5*te)return t===e&&s===1?void 0:"a video under 5 MB is uploaded whole: chunk_size equal to video_size, total_chunk_count 1";if(s!==Math.floor(e/t))return"total_chunk_count must be video_size divided by chunk_size, rounded down";if(s<1||s>1e3)return"total_chunk_count must be between 1 and 1000";if(s>1&&(t<5*te||t>64*te))return"chunk_size must be between 5 MB and 64 MB";if(e-t*(s-1)>128*te)return"the final chunk must be at most 128 MB"}async function Le(e,t){let s=A(e,t?"video.publish":"video.upload");if(s instanceof Response)return s;let o=N(e.body),r=N(o.post_info),i=N(o.source_info);if(t){if(!G(s.person).includes(String(r.privacy_level)))return v(e,403,"privacy_level_option_mismatch","privacy_level is not specified or not among the options from the privacy_level_options returned in /publish/creator_info/query/ API.");if(typeof r.title=="string"&&r.title.length>2200)return O(e,"title is over 2200 characters")}if(i.source==="PULL_FROM_URL")return O(e,"the twin does not model PULL_FROM_URL video posts");if(i.source!=="FILE_UPLOAD")return O(e,"source must be FILE_UPLOAD or PULL_FROM_URL");let n=Number(i.video_size),a=Dt(n,Number(i.chunk_size),Number(i.total_chunk_count));if(a)return O(e,a);let p=await $(e,"publish"),u=`${t?"v_pub_file":"v_inbox_file"}~v2.${p}`,d=String(7300000000000000000n+BigInt(p)),c=(await e.secret(`tiktok-upload-token:${u}`)).replace(/[^A-Za-z0-9]/g,"").slice(0,32);return await e.write(m,u,{status:"PROCESSING_UPLOAD",fail_reason:"",publicaly_available_post_id:[],uploaded_bytes:0,_person:s.person.id,_app:s.app.id,_kind:t?"direct":"inbox",_media:"VIDEO",_post_info:t?r:{},_video_size:n,_chunk_size:Number(i.chunk_size),_chunks:Number(i.total_chunk_count),_upload_id:d,_upload_token_sha256:T(e,c),_upload_expires:h(e.occurredAt)+3600},t?"videoInit":"inboxVideoInit"),U(e,{publish_id:u,upload_url:`${Ct}/video/?upload_id=${d}&upload_token=${c}`})}async function at(e,t,s,o,r,i){let a=e.row(k,String(t.app.id)).url_properties??[],p=R=>{let I;try{I=new URL(R)}catch{return!1}return I.protocol!=="https:"?!1:a.some(C=>C.includes("/")?R.startsWith(C):I.hostname===C||I.hostname.endsWith(`.${C}`))};if(!r.every(p))return v(e,403,"url_ownership_unverified","To use PULL_FROM_URL as the media transfer method, the developer must verify the ownership of the URL prefix or domain.");let u=await $(e,"publish"),d=`p_${s==="direct"?"pub":"inbox"}_url~v2.${u}`;await e.write(m,d,{status:"PROCESSING_DOWNLOAD",fail_reason:"",publicaly_available_post_id:[],downloaded_bytes:0,_person:t.person.id,_app:t.app.id,_kind:s,_media:o,_post_info:i,_urls:r},"contentInit");let c=0,E=!1;for(let R of r)try{let I=await e.vendorFetch(R,{method:"GET"});if(!I.ok){E=!0;break}c+=(await I.arrayBuffer()).byteLength}catch{E=!0;break}let _=E?"FAILED":s==="direct"?"PUBLISH_COMPLETE":"SEND_TO_USER_INBOX",w=e.legal(m,"status","contentInit","PROCESSING_DOWNLOAD",_,d,"vendor");if(w)throw new Error(w.message);let Y=!E&&s==="direct"&&i.privacy_level==="PUBLIC_TO_EVERYONE"?String(74e17+await $(e,"video")*1024):void 0;return await e.write(m,d,{status:_,downloaded_bytes:c,...E?{fail_reason:"photo_pull_failed"}:{},...Y?{publicaly_available_post_id:[Number(Y)]}:{}},"contentInit"),U(e,{publish_id:d})}async function ut(e,t,s,o){return await e.write(m,t,{uploaded_bytes:s},"uploadVideo"),new Response(null,{status:206,headers:{"content-range":`bytes 0-${s-1}/${o}`}})}var M=e=>Response.json({error:e},{status:400});async function fe(e,t){let s=e.rowsRaw(k).find(i=>i.deleted!==!0&&i.world===!0&&(i.kind??"open")===t);if(s)return s;let o=e.mint(k),r=t==="open"?`aw${e.crypto.digest("sha256",`tiktok-client-key:${o}`,"hex").slice(0,14)}`:String(BigInt(`0x${e.crypto.digest("sha256",`tiktok-app-id:${o}`,"hex").slice(0,15)}`)).padStart(19,"7").slice(0,19);return await e.record(k,{name:"World",kind:t,client_key:r,world:!0,scopes:t==="open"?_e:it,redirect_uris:[],url_properties:[],created:e.occurredAt},o),e.row(k,o)}async function jt(e){let t=await fe(e,"open"),s=await fe(e,"business");return Response.json({client_key:t.client_key,client_secret:await H(e,t),business_client_id:s.client_key,business_client_secret:await H(e,s)},{status:201})}async function Ft(e){let t=S(e),s=d=>Array.isArray(d)?d.map(String):void 0,o=s(t.redirect_uris),r=s(t.url_properties),i=s(t.business_redirect_uris);if(o?.some(d=>!/^https:\/\//.test(d)))return M("a redirect URI must be https");let n=d=>{let c;try{c=new URL(d)}catch{return"must be absolute"}if(c.protocol!=="https:")return"must start with https://";if(!d.endsWith("/"))return"must end with /";if(c.search||c.hash)return"cannot carry query parameters or anchors";if(c.port)return"cannot include a port";if(d.length<10||d.length>512)return"must be 10 to 512 characters"},a=i?.map(d=>[d,n(d)]).find(([,d])=>d);if(a)return M(`the business redirect URL ${a[0]} ${a[1]}`);if(i&&i.length>10)return M("a business app holds up to 10 redirect URLs");let p=await fe(e,"open");if(await e.record(k,{...p,...o?{redirect_uris:o}:{},...r?{url_properties:r}:{}},String(p.id)),i){let d=await fe(e,"business");await e.record(k,{...d,redirect_uris:i},String(d.id))}let u=e.row(k,String(p.id));return Response.json({client_key:u.client_key,redirect_uris:u.redirect_uris,url_properties:u.url_properties,...i?{business_redirect_uris:i}:{}})}async function Bt(e){let t=S(e);if(typeof t.username!="string"||!/^[a-z0-9._]{2,24}$/.test(t.username))return M("username is 2 to 24 lowercase letters, digits, dots and underscores");if(typeof t.password!="string"||!t.password)return M("password is required");if(e.rowsRaw(g).some(r=>r.deleted!==!0&&r.username===t.username))return M("that username is taken");let s=e.mint(g),o=r=>typeof t[r]=="number"?Number(t[r]):0;return await e.record(g,{username:t.username,display_name:typeof t.display_name=="string"?t.display_name:t.username,password_sha256:T(e,t.password),bio_description:typeof t.bio_description=="string"?t.bio_description:"",is_verified:t.is_verified===!0,private:t.private===!0,follower_count:o("follower_count"),following_count:o("following_count"),likes_count:o("likes_count"),max_video_post_duration_sec:typeof t.max_video_post_duration_sec=="number"?t.max_video_post_duration_sec:180,created:e.occurredAt},s),Response.json({username:t.username},{status:201})}async function zt(e){let t=String(e.call.params.id??""),s=e.row(y,t);if(!s||s.deleted===!0)return Response.json({error:"no such video"},{status:404});let o=S(e),r=Object.fromEntries(["view_count","like_count","comment_count","share_count"].filter(i=>typeof o[i]=="number"&&Number(o[i])>=0).map(i=>[i,Number(o[i])]));return await e.write(y,t,r,"video.audience"),Response.json({id:t,...r})}async function Vt(e){let t=String(e.call.params.name??"").replace(/\.png$/,"");return new Response(new Uint8Array(Me(t)),{headers:{"content-type":"image/png"}})}async function Mt(e){let t=S(e);if(typeof t.location_name!="string"||!t.location_name)return M("location_name is required");let s=e.mint("_location");return await e.record("_location",{location_name:t.location_name,location_address:typeof t.location_address=="string"?t.location_address:""},s),Response.json({location_id:s,location_name:t.location_name},{status:201})}async function Ht(e){let t=S(e);if(typeof t.name!="string"||!t.name||typeof t.artist!="string")return M("name and artist are required");let s=e.mint("_track"),o=String(7300000000000000000n+BigInt(s.replace(/\D/g,"")||"0"));return await e.record("_track",{name:t.name,artist:t.artist,genre:typeof t.genre=="string"?t.genre.toUpperCase():"POP",duration:typeof t.duration=="number"?t.duration:30,song_clip_id:o,thumbnail_url:P(e,`track-${s}`),preview_url:P(e,`track-${s}`)},s),Response.json({id:s,song_clip_id:o},{status:201})}async function dt(e){let t=e.params,s=ae(e,t.client_key);if(!s||typeof t.client_secret!="string"||t.client_secret!==await H(e,s))return Q(e,"invalid_client","Client key or secret is incorrect.");let o=h(e.occurredAt);if(t.grant_type==="authorization_code"){let r=typeof t.code=="string"?q(e,j,decodeURIComponent(t.code)):void 0;return!r||r.used===!0||r.app!==s.id||Number(r.expires_at)<=o?Q(e,"invalid_grant","Authorization code is expired."):t.redirect_uri!==r.redirect_uri?Q(e,"invalid_request","Redirect_uri is not matched with the uri when requesting code."):nt(e,r,t.code_verifier)?Q(e,"invalid_grant","Code verifier or code challenge is invalid."):(await e.record(j,{...r,used:!0},String(r.id)),Oe(e,s,e.row(g,String(r.person)),String(r.scope)))}if(t.grant_type==="refresh_token"){let r=typeof t.refresh_token=="string"?q(e,L,t.refresh_token):void 0;return!r||r.used===!0||r.app!==s.id||Number(r.expires_at)<=o?Q(e,"invalid_grant","Refresh token is invalid or expired."):(await e.record(L,{...r,used:!0},String(r.id)),Oe(e,s,e.row(g,String(r.person)),String(r.scope)))}return Q(e,"unsupported_grant_type","The grant type is not supported.")}async function pt(e){let t=A(e,"video.publish");if(t instanceof Response)return t;let s=t.person;return U(e,{creator_avatar_url:P(e,`avatar-${String(s.id)}`),creator_username:s.username,creator_nickname:s.display_name,privacy_level_options:G(s),comment_disabled:s.comment_disabled===!0,duet_disabled:s.private===!0||s.duet_disabled===!0,stitch_disabled:s.private===!0||s.stitch_disabled===!0,max_video_post_duration_sec:Number(s.max_video_post_duration_sec??180)})}async function ct(e){return Le(e,!0)}async function lt(e){return Le(e,!1)}async function _t(e){let t=N(e.body),s=t.post_mode==="DIRECT_POST",o=A(e,s?"video.publish":"video.upload");if(o instanceof Response)return o;if(t.media_type!=="PHOTO")return O(e,"media_type must be PHOTO");if(!s&&t.post_mode!=="MEDIA_UPLOAD")return O(e,"post_mode must be DIRECT_POST or MEDIA_UPLOAD");let r=N(t.post_info),i=N(t.source_info);if(i.source!=="PULL_FROM_URL")return O(e,"source must be PULL_FROM_URL");let n=Array.isArray(i.photo_images)?i.photo_images.map(String):[];if(n.length<1||n.length>35)return O(e,"photo_images must hold 1 to 35 URLs");let a=Number(i.photo_cover_index??0);return!Number.isInteger(a)||a<0||a>=n.length?O(e,"photo_cover_index must index photo_images"):typeof r.title=="string"&&r.title.length>90?O(e,"title is over 90 characters"):typeof r.description=="string"&&r.description.length>4e3?O(e,"description is over 4000 characters"):s&&!G(o.person).includes(String(r.privacy_level))?v(e,403,"privacy_level_option_mismatch","privacy_level is not specified or not among the options from the privacy_level_options returned in /publish/creator_info/query/ API."):at(e,o,s?"direct":"inbox","PHOTO",n,r)}async function ft(e){let t=A(e,"video.upload","video.publish");if(t instanceof Response)return t;let s=String(N(e.body).publish_id??""),o=e.row(m,s);return!o||o.deleted===!0?v(e,400,"invalid_publish_id","The publish_id does not exist."):o._person!==t.person.id||o._app!==t.app.id?v(e,400,"token_not_authorized_for_specified_publish_id","The access_token does not have authorization for the publish_id."):U(e,e.get(m,s))}async function mt(e){let t=A(e);if(t instanceof Response)return t;let s=String(new URL(e.call.request.url).searchParams.get("fields")??"").split(",").map(u=>u.trim()).filter(Boolean),o=s.filter(u=>!(u in Ee));if(!s.length||o.length)return v(e,400,"invalid_params",`Invalid fields: ${o.join(",")||"(none)"}`);let r=[...new Set(s.map(u=>Ee[u]))].filter(u=>!t.scopes.includes(u));if(r.length)return v(e,401,"scope_not_authorized",`The user did not authorize the scope required for completing this request (${r.join(",")}).`);let i=t.person,n=e.rowsRaw(y).filter(u=>u.deleted!==!0&&u._person===i.id&&u._public===!0).length,a=P(e,`avatar-${String(i.id)}`),p={open_id:F(e,t.app,i),union_id:Ve(e,i),avatar_url:a,avatar_url_100:a,avatar_large_url:a,display_name:i.display_name,bio_description:i.bio_description??"",profile_deep_link:`https://www.tiktok.com/@${String(i.username)}`,is_verified:i.is_verified===!0,username:i.username,follower_count:Number(i.follower_count??0),following_count:Number(i.following_count??0),likes_count:Number(i.likes_count??0),video_count:n};return U(e,{user:Object.fromEntries(s.map(u=>[u,p[u]]))})}function qe(e,t,s){let o=[],r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=t;for(;i+8<=s;){let n=r.getUint32(i),a=String.fromCharCode(e[i+4],e[i+5],e[i+6],e[i+7]),p=8;if(n===1&&i+16<=s&&(n=Number(r.getBigUint64(i+8)),p=16),n===0&&(n=s-i),n<p||i+n>s)break;o.push({type:a,start:i+p,end:i+n}),i+=n}return o}function ht(e){let t={duration:0,width:0,height:0},s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=qe(e,0,e.length).find(r=>r.type==="moov");if(!o)return t;for(let r of qe(e,o.start,o.end)){if(r.type==="mvhd"){let i=e[r.start];if(r.start+(i===1?32:20)>r.end)continue;let n=i===1?s.getUint32(r.start+20):s.getUint32(r.start+12),a=i===1?Number(s.getBigUint64(r.start+24)):s.getUint32(r.start+16);n>0&&(t.duration=Math.round(a/n))}if(r.type==="trak"){let i=qe(e,r.start,r.end).find(d=>d.type==="tkhd");if(!i)continue;let n=e[i.start],a=i.start+(n===1?88:76);if(a+8>i.end)continue;let p=s.getUint32(a)>>>16,u=s.getUint32(a+4)>>>16;p&&u&&!t.width&&(t.width=p,t.height=u)}}return t}async function bt(e){let t=A(e,"video.list");if(t instanceof Response)return t;let s=Re(e);if(s instanceof Response)return s;let o=x(e.body),r=o.max_count===void 0?10:Number(o.max_count);if(!Number.isInteger(r)||r<1||r>20)return v(e,400,"invalid_params","max_count must be between 1 and 20");let i=o.cursor===void 0?1/0:Number(o.cursor),{page:n,cursor:a,more:p}=de(e,String(t.person.id),i,r);return U(e,{videos:n.map(u=>Ie(e,u,s)),cursor:a,has_more:p})}async function gt(e){let t=A(e,"video.list");if(t instanceof Response)return t;let s=Re(e);if(s instanceof Response)return s;let o=Array.isArray(x(x(e.body).filters).video_ids)?x(x(e.body).filters).video_ids.map(String):[];if(!o.length||o.length>20)return v(e,400,"invalid_params","filters.video_ids must hold 1 to 20 ids");let r=e.rowsRaw(y).filter(i=>i.deleted!==!0&&i._person===t.person.id&&o.includes(String(i.id)));return U(e,{videos:r.map(i=>Ie(e,i,s))})}async function yt(e){let t=new URL(e.call.request.url).searchParams,s=e.rowsRaw(m).find(f=>f.deleted!==!0&&f._upload_id===t.get("upload_id"));if(!s||s._upload_token_sha256!==T(e,t.get("upload_token")??""))return new Response(null,{status:404});if(Number(s._upload_expires)<=h(e.occurredAt))return new Response(null,{status:403});let o=Number(s._video_size),r=String(s.id),i=()=>e.rowsRaw(be).filter(f=>f.publish===r),n=i().reduce((f,ee)=>f+Number(ee.bytes),0),a=/^bytes (\d+)-(\d+)\/(\d+)$/.exec(e.call.request.headers.get("content-range")??""),p=new Uint8Array(await e.call.request.clone().arrayBuffer()),u={"content-range":`bytes 0-${Math.max(n-1,0)}/${o}`};if(!a)return new Response(null,{status:400,headers:u});let[d,c,E]=[Number(a[1]),Number(a[2]),Number(a[3])];if(s.status!=="PROCESSING_UPLOAD"||d!==n||E!==o)return new Response(null,{status:416,headers:u});let _=Number(s._chunk_size),w=Math.floor(d/_),Y=w===Number(s._chunks)-1?o-d:_;if(c-d+1!==p.byteLength||p.byteLength!==Y)return new Response(null,{status:400,headers:u});await e.blobs.put(`publish:${r}:${w}`,p),await e.record(be,{publish:r,index:w,first:d,bytes:p.byteLength},`${r}:${w}`);let R=i().reduce((f,ee)=>f+Number(ee.bytes),0);if(R<o)return ut(e,r,R,o);let I=[];for(let f=0;f<Number(s._chunks);f++)I.push(await e.blobs.get(`publish:${r}:${f}`)??new Uint8Array(0));let C=new Uint8Array(o),Ae=0;for(let f of I)C.set(f,Ae),Ae+=f.byteLength;let $e=s._kind==="direct",Ce=$e?"PUBLISH_COMPLETE":"SEND_TO_USER_INBOX",De=e.legal(m,"status","uploadVideo","PROCESSING_UPLOAD",Ce,r,"vendor");if(De)throw new Error(De.message);let re=N(s._post_info),je=[];if($e){let f=ht(C),ee=await $(e,"video"),D=String(74e17+ee*1024),me=e.row("_person",String(s._person)),Fe=re.privacy_level==="PUBLIC_TO_EVERYONE",Be=typeof re.title=="string"?re.title:"";await e.write(y,D,{id:D,create_time:h(e.occurredAt),_moment:ue(e,String(me?.id??s._person)),cover_image_url:P(e,`cover-${D}`),share_url:`https://www.tiktok.com/@${String(me?.username)}/video/${D}`,video_description:Be.slice(0,150),duration:f.duration,height:f.height,width:f.width,title:Be.slice(0,150),embed_html:`<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@${String(me?.username)}/video/${D}" data-video-id="${D}"></blockquote>`,embed_link:`https://www.tiktok.com/player/v1/${D}`,like_count:0,comment_count:0,share_count:0,view_count:0,is_aigc:re.is_aigc===!0,_person:s._person,_public:Fe,_publish:r},"video.publish"),Fe&&(je=[Number(D)])}await e.write(m,r,{status:Ce,uploaded_bytes:R,publicaly_available_post_id:je},"uploadVideo"),await e.blobs.put(`publish:${r}`,C);for(let f=0;f<Number(s._chunks);f++)await e.blobs.remove(`publish:${r}:${f}`);return new Response(null,{status:201,headers:{"content-range":`bytes 0-${R-1}/${o}`}})}var vt={contentInit:_t,creatorInfoQuery:pt,inboxVideoInit:lt,oauthToken:dt,publishStatusFetch:ft,uploadVideo:yt,userInfo:mt,videoInit:ct,videoList:bt,videoQuery:gt};var se=e=>String(e??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]),oe=(e,t=200)=>new Response(`<!doctype html><html><head><meta charset="utf-8"><title>TikTok</title></head><body>${e}</body></html>`,{status:t,headers:{"content-type":"text/html; charset=utf-8"}}),Yt=["client_key","scope","redirect_uri","state","response_type","code_challenge","code_challenge_method","disable_auto_auth"],Jt=600;async function kt(e){let t=e.call.request,s=t.method==="POST"?new URLSearchParams(e.text):new URL(t.url).searchParams,o=ae(e,s.get("client_key"));if(!o)return oe("<p>Something went wrong: client_key is invalid.</p>",400);let r=s.get("redirect_uri")??"";if(!(o.redirect_uris??[]).includes(r))return oe("<p>Something went wrong: redirect_uri is not registered.</p>",400);let i=_=>{let w=new URL(r);for(let[Y,R]of Object.entries(_))w.searchParams.set(Y,R);return s.get("state")!==null&&w.searchParams.set("state",s.get("state")),new Response(null,{status:302,headers:{location:w.toString()}})};if(s.get("response_type")!=="code")return i({error:"invalid_request",error_description:"response_type must be code"});let n=(s.get("scope")??"").split(",").map(_=>_.trim()).filter(Boolean),a=o.scopes??_e,p=n.filter(_=>!a.includes(_));if(!n.length||p.length)return i({error:"invalid_scope",error_description:`Scope is not authorized for this app: ${p.join(",")||"(none)"}`});let u=Yt.filter(_=>s.get(_)!==null).map(_=>`<input type="hidden" name="${_}" value="${se(s.get(_))}">`).join("");if(t.method!=="POST")return oe(`<h1>Log in to TikTok</h1><form method="post" action="/v2/auth/authorize/">${u}<label>Username <input name="username"></label><label>Password <input name="password" type="password"></label><input type="hidden" name="step" value="login"><button type="submit">Log in</button></form>`);if(s.get("decision")==="cancel")return i({error:"access_denied",error_description:"The user denied the authorization."});let d=e.rowsRaw(g).find(_=>_.deleted!==!0&&_.username===s.get("username"));if(!d||d.password_sha256!==T(e,s.get("password")??""))return oe(`<h1>Log in to TikTok</h1><p>Incorrect account or password.</p><form method="post" action="/v2/auth/authorize/">${u}<label>Username <input name="username"></label><label>Password <input name="password" type="password"></label><button type="submit">Log in</button></form>`,401);if(s.get("decision")!=="authorize"){let _=`<input type="hidden" name="username" value="${se(d.username)}"><input type="hidden" name="password" value="${se(s.get("password"))}">`;return oe(`<h1>${se(o.name)} would like to access your TikTok account</h1><ul>${n.map(w=>`<li>${se(w)}</li>`).join("")}</ul><form method="post" action="/v2/auth/authorize/">${u}${_}<button name="decision" value="authorize" type="submit">Authorize</button><button name="decision" value="cancel" type="submit">Cancel</button></form>`)}let c=s.get("code_challenge"),E=await B(e,j,"code",{app:o.id,person:d.id,scope:n.join(","),redirect_uri:r,expires_at:h(e.occurredAt)+Jt,used:!1,...c?{challenge:c}:{}});return i({code:E.value,scopes:n.join(",")})}function Ne(e={}){return Xt({manifest:W,surface:ce,handlers:vt,doors:Te,screens:{authorize:kt}},e)}function Ue(e={}){return Zt(ie,{business:{fetch:Se(e),manifest:K},open:{fetch:Ne(e),manifest:W}})}import{serveHttp as so}from"../../engine/v3/volter_world-core.mjs";var _o=es(xt(ie,{business:{manifest:K,surface:pe},open:{manifest:W,surface:ce}}));export{Ue 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-tinybird
2
+
3
+ Contains @volter/twin-tinybird 1.0.2 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.