agenttwin 0.3.21 → 0.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) 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/{1250-7571b1a697f6bb4a.js → 1250-a3c859fd20517500.js} +1 -1
  8. package/dist/dashboard/assets/next/static/chunks/{2743-a0efd6f4aeb11cc5.js → 2743-72610a5d5a3f8462.js} +1 -1
  9. package/dist/dashboard/assets/next/static/chunks/5663-403316746afad10e.js +1 -0
  10. package/dist/dashboard/assets/next/static/chunks/app/dashboard/{page-9c11295678539a5f.js → page-0e0392368e0a891e.js} +1 -1
  11. package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-4981ea4966b19e3e.js +1 -0
  12. package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-dd4ac0f5f36e6bfa.js +1 -0
  13. package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/{page-34574448d210c775.js → page-de0fe6d84be21e6a.js} +1 -1
  14. package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-360cbffc57981f6b.js +1 -0
  15. package/dist/dashboard/assets/next/static/chunks/app/v2/page-fc4df4912ce3af44.js +1 -0
  16. package/dist/dashboard/assets/next/static/chunks/{webpack-40324749d289e4a5.js → webpack-9e40ef55e5f2fb53.js} +1 -1
  17. package/dist/dashboard/assets/next/static/css/{42045de5f39b50ca.css → 37d81e1d2804cc5f.css} +1 -1
  18. package/dist/dashboard/assets/next/static/css/69ec1bae997c3bb0.css +1 -0
  19. package/dist/dashboard/assets/next/static/css/ad85402a1595e56e.css +1 -0
  20. package/dist/dashboard/assets/next/static/css/{4bbe78c2fe206b92.css → da981fb878a02b8c.css} +1 -1
  21. package/dist/dashboard/assets/next/static/media/bay-morning.82669113.webp +0 -0
  22. package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.0aa49492.webp +0 -0
  23. package/dist/dashboard/assets/next/static/media/golden-gate-portrait.89fc667a.webp +0 -0
  24. package/dist/dashboard/assets/next/static/media/moonlit-coast.09739ef4.webp +0 -0
  25. package/dist/dashboard/index.html +2 -2
  26. package/dist/engine.js +6386 -4974
  27. package/dist/gateway.js +2194 -604
  28. package/dist/twins/catalog.json +6020 -0
  29. package/dist/twins/engine/v2/THIRD-PARTY.txt +25 -0
  30. package/dist/twins/engine/v2/chunks/2CHBP57N.mjs +8 -0
  31. package/dist/twins/engine/v2/chunks/4CPL6MPF.mjs +30 -0
  32. package/dist/twins/engine/v2/chunks/OYLYKZGD.mjs +2 -0
  33. package/dist/twins/engine/v2/chunks/SQSP35HM.mjs +38 -0
  34. package/dist/twins/engine/v2/chunks/YSJQQVUM.mjs +2 -0
  35. package/dist/twins/engine/v2/react-dom_client.mjs +272 -0
  36. package/dist/twins/engine/v2/react-dom_server.mjs +263 -0
  37. package/dist/twins/engine/v2/react.mjs +2 -0
  38. package/dist/twins/engine/v2/react_jsx-runtime.mjs +31 -0
  39. package/dist/twins/engine/v2/volter_world-core.mjs +195 -0
  40. package/dist/twins/engine/v2/volter_world-core_app-route.mjs +2 -0
  41. package/dist/twins/engine/v2/volter_world-core_network-policy.mjs +2 -0
  42. package/dist/twins/engine/v3/THIRD-PARTY.txt +65 -0
  43. package/dist/twins/engine/v3/chunks/2CHBP57N.mjs +8 -0
  44. package/dist/twins/engine/v3/chunks/2YSSPA5O.mjs +65 -0
  45. package/dist/twins/engine/v3/chunks/5PWRY4UK.mjs +154 -0
  46. package/dist/twins/engine/v3/chunks/7XRKSFFJ.mjs +2 -0
  47. package/dist/twins/engine/v3/chunks/AWOWH2H5.mjs +2 -0
  48. package/dist/twins/engine/v3/chunks/C46M5U3Q.mjs +2 -0
  49. package/dist/twins/engine/v3/chunks/MFH2VZPP.mjs +2 -0
  50. package/dist/twins/engine/v3/chunks/MWCO5UV3.mjs +2 -0
  51. package/dist/twins/engine/v3/chunks/N5BL5RDF.mjs +313 -0
  52. package/dist/twins/engine/v3/chunks/O7HGPMXG.mjs +2 -0
  53. package/dist/twins/engine/v3/chunks/OYLYKZGD.mjs +2 -0
  54. package/dist/twins/engine/v3/chunks/PLB7HTON.mjs +8 -0
  55. package/dist/twins/engine/v3/chunks/TY4LDBVH.mjs +7 -0
  56. package/dist/twins/engine/v3/chunks/VDIRUSCM.mjs +2 -0
  57. package/dist/twins/engine/v3/chunks/WGUCFQK6.mjs +2 -0
  58. package/dist/twins/engine/v3/chunks/WPATONSC.mjs +2 -0
  59. package/dist/twins/engine/v3/react_jsx-runtime.mjs +2 -0
  60. package/dist/twins/engine/v3/volter_world-core.mjs +2 -0
  61. package/dist/twins/engine/v3/volter_world-ui.mjs +559 -0
  62. package/dist/twins/packs/ahrefs/LICENSE +202 -0
  63. package/dist/twins/packs/ahrefs/NOTICE +7 -0
  64. package/dist/twins/packs/ahrefs/index.mjs +2 -0
  65. package/dist/twins/packs/ai-gateway/LICENSE +202 -0
  66. package/dist/twins/packs/ai-gateway/NOTICE +7 -0
  67. package/dist/twins/packs/ai-gateway/index.mjs +14 -0
  68. package/dist/twins/packs/airtable/LICENSE +202 -0
  69. package/dist/twins/packs/airtable/NOTICE +7 -0
  70. package/dist/twins/packs/airtable/index.mjs +2 -0
  71. package/dist/twins/packs/algolia/LICENSE +202 -0
  72. package/dist/twins/packs/algolia/NOTICE +7 -0
  73. package/dist/twins/packs/algolia/index.mjs +2 -0
  74. package/dist/twins/packs/ambientcg/LICENSE +202 -0
  75. package/dist/twins/packs/ambientcg/NOTICE +7 -0
  76. package/dist/twins/packs/ambientcg/index.mjs +2 -0
  77. package/dist/twins/packs/anthropic/LICENSE +202 -0
  78. package/dist/twins/packs/anthropic/NOTICE +7 -0
  79. package/dist/twins/packs/anthropic/index.mjs +18 -0
  80. package/dist/twins/packs/assemblyai/LICENSE +202 -0
  81. package/dist/twins/packs/assemblyai/NOTICE +7 -0
  82. package/dist/twins/packs/assemblyai/index.mjs +11 -0
  83. package/dist/twins/packs/aws/LICENSE +202 -0
  84. package/dist/twins/packs/aws/NOTICE +7 -0
  85. package/dist/twins/packs/aws/index.mjs +2 -0
  86. package/dist/twins/packs/azure/LICENSE +202 -0
  87. package/dist/twins/packs/azure/NOTICE +7 -0
  88. package/dist/twins/packs/azure/index.mjs +38 -0
  89. package/dist/twins/packs/azureformrecognizer/LICENSE +202 -0
  90. package/dist/twins/packs/azureformrecognizer/NOTICE +7 -0
  91. package/dist/twins/packs/azureformrecognizer/index.mjs +3 -0
  92. package/dist/twins/packs/bitly/LICENSE +202 -0
  93. package/dist/twins/packs/bitly/NOTICE +7 -0
  94. package/dist/twins/packs/bitly/index.mjs +2 -0
  95. package/dist/twins/packs/bluesky/LICENSE +202 -0
  96. package/dist/twins/packs/bluesky/NOTICE +7 -0
  97. package/dist/twins/packs/bluesky/index.mjs +30 -0
  98. package/dist/twins/packs/calcom/LICENSE +202 -0
  99. package/dist/twins/packs/calcom/NOTICE +7 -0
  100. package/dist/twins/packs/calcom/index.mjs +2 -0
  101. package/dist/twins/packs/clerk/LICENSE +202 -0
  102. package/dist/twins/packs/clerk/NOTICE +7 -0
  103. package/dist/twins/packs/clerk/index.mjs +5 -0
  104. package/dist/twins/packs/cloudflare/LICENSE +202 -0
  105. package/dist/twins/packs/cloudflare/NOTICE +7 -0
  106. package/dist/twins/packs/cloudflare/index.mjs +79 -0
  107. package/dist/twins/packs/cohere/LICENSE +202 -0
  108. package/dist/twins/packs/cohere/NOTICE +7 -0
  109. package/dist/twins/packs/cohere/index.mjs +2 -0
  110. package/dist/twins/packs/datadog/LICENSE +202 -0
  111. package/dist/twins/packs/datadog/NOTICE +7 -0
  112. package/dist/twins/packs/datadog/index.mjs +3 -0
  113. package/dist/twins/packs/deepinfra/LICENSE +202 -0
  114. package/dist/twins/packs/deepinfra/NOTICE +7 -0
  115. package/dist/twins/packs/deepinfra/index.mjs +13 -0
  116. package/dist/twins/packs/deepseek/LICENSE +202 -0
  117. package/dist/twins/packs/deepseek/NOTICE +7 -0
  118. package/dist/twins/packs/deepseek/index.mjs +12 -0
  119. package/dist/twins/packs/discord/LICENSE +202 -0
  120. package/dist/twins/packs/discord/NOTICE +7 -0
  121. package/dist/twins/packs/discord/index.mjs +2 -0
  122. package/dist/twins/packs/duckduckgo/LICENSE +202 -0
  123. package/dist/twins/packs/duckduckgo/NOTICE +7 -0
  124. package/dist/twins/packs/duckduckgo/index.mjs +532 -0
  125. package/dist/twins/packs/dynadot/LICENSE +202 -0
  126. package/dist/twins/packs/dynadot/NOTICE +7 -0
  127. package/dist/twins/packs/dynadot/index.mjs +2 -0
  128. package/dist/twins/packs/e2b/LICENSE +202 -0
  129. package/dist/twins/packs/e2b/NOTICE +7 -0
  130. package/dist/twins/packs/e2b/index.mjs +2 -0
  131. package/dist/twins/packs/elevenlabs/LICENSE +202 -0
  132. package/dist/twins/packs/elevenlabs/NOTICE +7 -0
  133. package/dist/twins/packs/elevenlabs/index.mjs +4 -0
  134. package/dist/twins/packs/expo/LICENSE +202 -0
  135. package/dist/twins/packs/expo/NOTICE +7 -0
  136. package/dist/twins/packs/expo/index.mjs +2 -0
  137. package/dist/twins/packs/fal/LICENSE +202 -0
  138. package/dist/twins/packs/fal/NOTICE +7 -0
  139. package/dist/twins/packs/fal/index.mjs +2 -0
  140. package/dist/twins/packs/figma/LICENSE +202 -0
  141. package/dist/twins/packs/figma/NOTICE +7 -0
  142. package/dist/twins/packs/figma/index.mjs +2 -0
  143. package/dist/twins/packs/firecrawl/LICENSE +202 -0
  144. package/dist/twins/packs/firecrawl/NOTICE +7 -0
  145. package/dist/twins/packs/firecrawl/index.mjs +9 -0
  146. package/dist/twins/packs/fireworks/LICENSE +202 -0
  147. package/dist/twins/packs/fireworks/NOTICE +7 -0
  148. package/dist/twins/packs/fireworks/index.mjs +13 -0
  149. package/dist/twins/packs/fly/LICENSE +202 -0
  150. package/dist/twins/packs/fly/NOTICE +7 -0
  151. package/dist/twins/packs/fly/index.mjs +2 -0
  152. package/dist/twins/packs/gcs/LICENSE +202 -0
  153. package/dist/twins/packs/gcs/NOTICE +7 -0
  154. package/dist/twins/packs/gcs/index.mjs +8 -0
  155. package/dist/twins/packs/gemini/LICENSE +202 -0
  156. package/dist/twins/packs/gemini/NOTICE +7 -0
  157. package/dist/twins/packs/gemini/index.mjs +7 -0
  158. package/dist/twins/packs/github/LICENSE +202 -0
  159. package/dist/twins/packs/github/NOTICE +7 -0
  160. package/dist/twins/packs/github/index.mjs +75153 -0
  161. package/dist/twins/packs/googleads/LICENSE +202 -0
  162. package/dist/twins/packs/googleads/NOTICE +7 -0
  163. package/dist/twins/packs/googleads/index.mjs +3 -0
  164. package/dist/twins/packs/googlemaps/LICENSE +202 -0
  165. package/dist/twins/packs/googlemaps/NOTICE +7 -0
  166. package/dist/twins/packs/googlemaps/index.mjs +2 -0
  167. package/dist/twins/packs/googleoauth/LICENSE +202 -0
  168. package/dist/twins/packs/googleoauth/NOTICE +7 -0
  169. package/dist/twins/packs/googleoauth/index.mjs +2 -0
  170. package/dist/twins/packs/hackernews/LICENSE +202 -0
  171. package/dist/twins/packs/hackernews/NOTICE +7 -0
  172. package/dist/twins/packs/hackernews/index.mjs +35 -0
  173. package/dist/twins/packs/huggingface/LICENSE +202 -0
  174. package/dist/twins/packs/huggingface/NOTICE +7 -0
  175. package/dist/twins/packs/huggingface/index.mjs +9 -0
  176. package/dist/twins/packs/inngest/LICENSE +202 -0
  177. package/dist/twins/packs/inngest/NOTICE +7 -0
  178. package/dist/twins/packs/inngest/index.mjs +2 -0
  179. package/dist/twins/packs/instagram/LICENSE +202 -0
  180. package/dist/twins/packs/instagram/NOTICE +7 -0
  181. package/dist/twins/packs/instagram/index.mjs +2 -0
  182. package/dist/twins/packs/jira/LICENSE +202 -0
  183. package/dist/twins/packs/jira/NOTICE +7 -0
  184. package/dist/twins/packs/jira/index.mjs +2 -0
  185. package/dist/twins/packs/langfuse/LICENSE +202 -0
  186. package/dist/twins/packs/langfuse/NOTICE +7 -0
  187. package/dist/twins/packs/langfuse/index.mjs +2 -0
  188. package/dist/twins/packs/linear/LICENSE +202 -0
  189. package/dist/twins/packs/linear/NOTICE +7 -0
  190. package/dist/twins/packs/linear/index.mjs +52866 -0
  191. package/dist/twins/packs/linkedin/LICENSE +202 -0
  192. package/dist/twins/packs/linkedin/NOTICE +7 -0
  193. package/dist/twins/packs/linkedin/index.mjs +78 -0
  194. package/dist/twins/packs/livekit/LICENSE +202 -0
  195. package/dist/twins/packs/livekit/NOTICE +7 -0
  196. package/dist/twins/packs/livekit/index.mjs +2 -0
  197. package/dist/twins/packs/mailgun/LICENSE +202 -0
  198. package/dist/twins/packs/mailgun/NOTICE +7 -0
  199. package/dist/twins/packs/mailgun/index.mjs +13 -0
  200. package/dist/twins/packs/mapbox/LICENSE +202 -0
  201. package/dist/twins/packs/mapbox/NOTICE +7 -0
  202. package/dist/twins/packs/mapbox/index.mjs +2 -0
  203. package/dist/twins/packs/merge/LICENSE +202 -0
  204. package/dist/twins/packs/merge/NOTICE +7 -0
  205. package/dist/twins/packs/merge/index.mjs +4 -0
  206. package/dist/twins/packs/mistral/LICENSE +202 -0
  207. package/dist/twins/packs/mistral/NOTICE +7 -0
  208. package/dist/twins/packs/mistral/index.mjs +6 -0
  209. package/dist/twins/packs/mixpanel/LICENSE +202 -0
  210. package/dist/twins/packs/mixpanel/NOTICE +8 -0
  211. package/dist/twins/packs/mixpanel/index.mjs +2 -0
  212. package/dist/twins/packs/mongodb/LICENSE +202 -0
  213. package/dist/twins/packs/mongodb/NOTICE +7 -0
  214. package/dist/twins/packs/mongodb/index.mjs +8 -0
  215. package/dist/twins/packs/moonshot/LICENSE +202 -0
  216. package/dist/twins/packs/moonshot/NOTICE +7 -0
  217. package/dist/twins/packs/moonshot/index.mjs +18 -0
  218. package/dist/twins/packs/notion/LICENSE +202 -0
  219. package/dist/twins/packs/notion/NOTICE +7 -0
  220. package/dist/twins/packs/notion/index.mjs +2 -0
  221. package/dist/twins/packs/npm-registry/LICENSE +202 -0
  222. package/dist/twins/packs/npm-registry/NOTICE +7 -0
  223. package/dist/twins/packs/npm-registry/index.mjs +2 -0
  224. package/dist/twins/packs/oa-treasury/LICENSE +202 -0
  225. package/dist/twins/packs/oa-treasury/NOTICE +8 -0
  226. package/dist/twins/packs/oa-treasury/index.mjs +16 -0
  227. package/dist/twins/packs/openai/LICENSE +202 -0
  228. package/dist/twins/packs/openai/NOTICE +7 -0
  229. package/dist/twins/packs/openai/index.mjs +3473 -0
  230. package/dist/twins/packs/openrouter/LICENSE +202 -0
  231. package/dist/twins/packs/openrouter/NOTICE +7 -0
  232. package/dist/twins/packs/openrouter/index.mjs +2 -0
  233. package/dist/twins/packs/openweather/LICENSE +202 -0
  234. package/dist/twins/packs/openweather/NOTICE +7 -0
  235. package/dist/twins/packs/openweather/index.mjs +2 -0
  236. package/dist/twins/packs/paypal/LICENSE +202 -0
  237. package/dist/twins/packs/paypal/NOTICE +7 -0
  238. package/dist/twins/packs/paypal/index.mjs +51 -0
  239. package/dist/twins/packs/pinecone/LICENSE +202 -0
  240. package/dist/twins/packs/pinecone/NOTICE +7 -0
  241. package/dist/twins/packs/pinecone/index.mjs +2 -0
  242. package/dist/twins/packs/plain/LICENSE +202 -0
  243. package/dist/twins/packs/plain/NOTICE +8 -0
  244. package/dist/twins/packs/plain/index.mjs +18426 -0
  245. package/dist/twins/packs/planetscale/LICENSE +202 -0
  246. package/dist/twins/packs/planetscale/NOTICE +7 -0
  247. package/dist/twins/packs/planetscale/index.mjs +18 -0
  248. package/dist/twins/packs/polar/LICENSE +202 -0
  249. package/dist/twins/packs/polar/NOTICE +7 -0
  250. package/dist/twins/packs/polar/index.mjs +2 -0
  251. package/dist/twins/packs/polyhaven/LICENSE +202 -0
  252. package/dist/twins/packs/polyhaven/NOTICE +7 -0
  253. package/dist/twins/packs/polyhaven/index.mjs +3 -0
  254. package/dist/twins/packs/postmark/LICENSE +202 -0
  255. package/dist/twins/packs/postmark/NOTICE +7 -0
  256. package/dist/twins/packs/postmark/index.mjs +12 -0
  257. package/dist/twins/packs/reddit/LICENSE +202 -0
  258. package/dist/twins/packs/reddit/NOTICE +7 -0
  259. package/dist/twins/packs/reddit/index.mjs +324 -0
  260. package/dist/twins/packs/redis/LICENSE +202 -0
  261. package/dist/twins/packs/redis/NOTICE +7 -0
  262. package/dist/twins/packs/redis/index.mjs +2 -0
  263. package/dist/twins/packs/replicate/LICENSE +202 -0
  264. package/dist/twins/packs/replicate/NOTICE +7 -0
  265. package/dist/twins/packs/replicate/index.mjs +2 -0
  266. package/dist/twins/packs/resend/LICENSE +202 -0
  267. package/dist/twins/packs/resend/NOTICE +7 -0
  268. package/dist/twins/packs/resend/index.mjs +139 -0
  269. package/dist/twins/packs/runhuman/LICENSE +202 -0
  270. package/dist/twins/packs/runhuman/NOTICE +7 -0
  271. package/dist/twins/packs/runhuman/index.mjs +3 -0
  272. package/dist/twins/packs/scrapecreators/LICENSE +202 -0
  273. package/dist/twins/packs/scrapecreators/NOTICE +7 -0
  274. package/dist/twins/packs/scrapecreators/index.mjs +2 -0
  275. package/dist/twins/packs/segment/LICENSE +202 -0
  276. package/dist/twins/packs/segment/NOTICE +8 -0
  277. package/dist/twins/packs/segment/index.mjs +2 -0
  278. package/dist/twins/packs/sendblue/LICENSE +202 -0
  279. package/dist/twins/packs/sendblue/NOTICE +7 -0
  280. package/dist/twins/packs/sendblue/index.mjs +2 -0
  281. package/dist/twins/packs/sendgrid/LICENSE +202 -0
  282. package/dist/twins/packs/sendgrid/NOTICE +8 -0
  283. package/dist/twins/packs/sendgrid/index.mjs +4 -0
  284. package/dist/twins/packs/sentry/LICENSE +202 -0
  285. package/dist/twins/packs/sentry/NOTICE +7 -0
  286. package/dist/twins/packs/sentry/index.mjs +5 -0
  287. package/dist/twins/packs/sigstore/LICENSE +202 -0
  288. package/dist/twins/packs/sigstore/NOTICE +7 -0
  289. package/dist/twins/packs/sigstore/index.mjs +12 -0
  290. package/dist/twins/packs/slack/LICENSE +202 -0
  291. package/dist/twins/packs/slack/NOTICE +7 -0
  292. package/dist/twins/packs/slack/index.mjs +66 -0
  293. package/dist/twins/packs/smtp/LICENSE +202 -0
  294. package/dist/twins/packs/smtp/NOTICE +7 -0
  295. package/dist/twins/packs/smtp/index.mjs +3 -0
  296. package/dist/twins/packs/snowflake/LICENSE +202 -0
  297. package/dist/twins/packs/snowflake/NOTICE +8 -0
  298. package/dist/twins/packs/snowflake/index.mjs +30 -0
  299. package/dist/twins/packs/stigg/LICENSE +202 -0
  300. package/dist/twins/packs/stigg/NOTICE +8 -0
  301. package/dist/twins/packs/stigg/index.mjs +22194 -0
  302. package/dist/twins/packs/stream/LICENSE +202 -0
  303. package/dist/twins/packs/stream/NOTICE +7 -0
  304. package/dist/twins/packs/stream/index.mjs +2 -0
  305. package/dist/twins/packs/stripe/LICENSE +202 -0
  306. package/dist/twins/packs/stripe/NOTICE +7 -0
  307. package/dist/twins/packs/stripe/index.mjs +211 -0
  308. package/dist/twins/packs/supabase/LICENSE +202 -0
  309. package/dist/twins/packs/supabase/NOTICE +7 -0
  310. package/dist/twins/packs/supabase/index.mjs +2 -0
  311. package/dist/twins/packs/supermemory/LICENSE +202 -0
  312. package/dist/twins/packs/supermemory/NOTICE +7 -0
  313. package/dist/twins/packs/supermemory/index.mjs +2 -0
  314. package/dist/twins/packs/svix/LICENSE +202 -0
  315. package/dist/twins/packs/svix/NOTICE +7 -0
  316. package/dist/twins/packs/svix/index.mjs +2 -0
  317. package/dist/twins/packs/tavily/LICENSE +202 -0
  318. package/dist/twins/packs/tavily/NOTICE +7 -0
  319. package/dist/twins/packs/tavily/index.mjs +2 -0
  320. package/dist/twins/packs/telegram/LICENSE +202 -0
  321. package/dist/twins/packs/telegram/NOTICE +7 -0
  322. package/dist/twins/packs/telegram/index.mjs +11 -0
  323. package/dist/twins/packs/temporal/LICENSE +202 -0
  324. package/dist/twins/packs/temporal/NOTICE +7 -0
  325. package/dist/twins/packs/temporal/index.mjs +44 -0
  326. package/dist/twins/packs/tiktok/LICENSE +202 -0
  327. package/dist/twins/packs/tiktok/NOTICE +7 -0
  328. package/dist/twins/packs/tiktok/index.mjs +2 -0
  329. package/dist/twins/packs/tinybird/LICENSE +202 -0
  330. package/dist/twins/packs/tinybird/NOTICE +7 -0
  331. package/dist/twins/packs/tinybird/index.mjs +50 -0
  332. package/dist/twins/packs/togetherai/LICENSE +202 -0
  333. package/dist/twins/packs/togetherai/NOTICE +7 -0
  334. package/dist/twins/packs/togetherai/index.mjs +11 -0
  335. package/dist/twins/packs/tremendous/LICENSE +202 -0
  336. package/dist/twins/packs/tremendous/NOTICE +7 -0
  337. package/dist/twins/packs/tremendous/index.mjs +2 -0
  338. package/dist/twins/packs/tripo/LICENSE +202 -0
  339. package/dist/twins/packs/tripo/NOTICE +7 -0
  340. package/dist/twins/packs/tripo/index.mjs +9 -0
  341. package/dist/twins/packs/tunnel/LICENSE +202 -0
  342. package/dist/twins/packs/tunnel/NOTICE +7 -0
  343. package/dist/twins/packs/tunnel/index.mjs +2 -0
  344. package/dist/twins/packs/twelvelabs/LICENSE +202 -0
  345. package/dist/twins/packs/twelvelabs/NOTICE +7 -0
  346. package/dist/twins/packs/twelvelabs/index.mjs +5 -0
  347. package/dist/twins/packs/twilio/LICENSE +202 -0
  348. package/dist/twins/packs/twilio/NOTICE +7 -0
  349. package/dist/twins/packs/twilio/index.mjs +2 -0
  350. package/dist/twins/packs/twitch/LICENSE +202 -0
  351. package/dist/twins/packs/twitch/NOTICE +7 -0
  352. package/dist/twins/packs/twitch/index.mjs +68 -0
  353. package/dist/twins/packs/upstash/LICENSE +202 -0
  354. package/dist/twins/packs/upstash/NOTICE +7 -0
  355. package/dist/twins/packs/upstash/index.mjs +14 -0
  356. package/dist/twins/packs/upstashvector/LICENSE +202 -0
  357. package/dist/twins/packs/upstashvector/NOTICE +7 -0
  358. package/dist/twins/packs/upstashvector/index.mjs +3 -0
  359. package/dist/twins/packs/vercel/LICENSE +202 -0
  360. package/dist/twins/packs/vercel/NOTICE +7 -0
  361. package/dist/twins/packs/vercel/index.mjs +10 -0
  362. package/dist/twins/packs/veriff/LICENSE +202 -0
  363. package/dist/twins/packs/veriff/NOTICE +7 -0
  364. package/dist/twins/packs/veriff/index.mjs +2 -0
  365. package/dist/twins/packs/vgauth/LICENSE +202 -0
  366. package/dist/twins/packs/vgauth/NOTICE +7 -0
  367. package/dist/twins/packs/vgauth/index.mjs +2 -0
  368. package/dist/twins/packs/vital/LICENSE +202 -0
  369. package/dist/twins/packs/vital/NOTICE +7 -0
  370. package/dist/twins/packs/vital/index.mjs +2 -0
  371. package/dist/twins/packs/volteridentity/LICENSE +202 -0
  372. package/dist/twins/packs/volteridentity/NOTICE +7 -0
  373. package/dist/twins/packs/volteridentity/index.mjs +2 -0
  374. package/dist/twins/packs/webrisk/LICENSE +202 -0
  375. package/dist/twins/packs/webrisk/NOTICE +7 -0
  376. package/dist/twins/packs/webrisk/index.mjs +2 -0
  377. package/dist/twins/packs/worldlabs/LICENSE +202 -0
  378. package/dist/twins/packs/worldlabs/NOTICE +7 -0
  379. package/dist/twins/packs/worldlabs/index.mjs +2 -0
  380. package/dist/twins/packs/x/LICENSE +202 -0
  381. package/dist/twins/packs/x/NOTICE +7 -0
  382. package/dist/twins/packs/x/index.mjs +63 -0
  383. package/dist/twins/packs/xai/LICENSE +202 -0
  384. package/dist/twins/packs/xai/NOTICE +7 -0
  385. package/dist/twins/packs/xai/index.mjs +4 -0
  386. package/dist/twins/packs/xidentity/LICENSE +202 -0
  387. package/dist/twins/packs/xidentity/NOTICE +8 -0
  388. package/dist/twins/packs/xidentity/index.mjs +209 -0
  389. package/dist/twins/packs/youtube/LICENSE +202 -0
  390. package/dist/twins/packs/youtube/NOTICE +7 -0
  391. package/dist/twins/packs/youtube/index.mjs +5 -0
  392. package/dist/worker.js +442 -18
  393. package/dist/world-host.js +928 -91
  394. package/package.json +6 -5
  395. package/dist/dashboard/assets/dashboard/bay-morning.png +0 -0
  396. package/dist/dashboard/assets/dashboard/golden-gate-afternoon.png +0 -0
  397. package/dist/dashboard/assets/dashboard/golden-gate-portrait.png +0 -0
  398. package/dist/dashboard/assets/dashboard/moonlit-coast.png +0 -0
  399. package/dist/dashboard/assets/next/static/chunks/2868-424d32cfc8ae81c9.js +0 -1
  400. package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-f9fca2c08f779fa0.js +0 -1
  401. package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-bc480c9258e5cc4d.js +0 -1
  402. package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-f04c0b236abaead3.js +0 -1
  403. package/dist/dashboard/assets/next/static/chunks/app/v2/page-07c8054d57c9089b.js +0 -1
  404. package/dist/dashboard/assets/next/static/css/4af3c8ca0da0f48b.css +0 -1
  405. package/dist/dashboard/assets/next/static/css/6b8edde77e493a51.css +0 -1
  406. package/dist/dashboard/assets/next/static/media/bay-morning.1a9f358c.png +0 -0
  407. package/dist/dashboard/assets/next/static/media/golden-gate-afternoon.3e7cea58.png +0 -0
  408. package/dist/dashboard/assets/next/static/media/golden-gate-portrait.7941528f.png +0 -0
  409. package/dist/dashboard/assets/next/static/media/moonlit-coast.bbe901a1.png +0 -0
  410. /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → GTd0IQ6HYyhE_2HqcgFno}/_buildManifest.js +0 -0
  411. /package/dist/dashboard/assets/next/static/{5ub3D2yzS8DE7w2qZd1nv → GTd0IQ6HYyhE_2HqcgFno}/_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-deepinfra
2
+
3
+ Contains @volter/twin-deepinfra 0.1.37 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.
@@ -0,0 +1,13 @@
1
+ import{createRequire as __atReq}from'node:module';const require=__atReq(import.meta.url);
2
+ import{registerPack as An}from"../../engine/v2/volter_world-core.mjs";import{declareRateBudget as ft,rateBudgetPath as kn,rateBudgetWeight as Rn,RateBudget as Nn}from"../../engine/v2/volter_world-core.mjs";import{RateBudgetError as yt}from"../../engine/v2/volter_world-core.mjs";var pt="deepinfra",mt=6e4,ht=60,_t=300,oe={inference:6,other:2},re={windowMs:mt,ceiling:ht,defaultWeight:oe.other,maxRetryAfterSeconds:_t,rules:[{match:"^POST /v1/(openai/)?(chat/)?completions$",weight:oe.inference},{match:"^POST /v1/inference/",weight:oe.inference}],reason:"DeepInfra publishes NO scalar requests-per-minute limit (docs.deepinfra.com/account/rate-limits, read 2026-09-16). Its published figure is a CONCURRENCY limit \u2014 200 simultaneous outstanding requests per model \u2014 and the first-party OpenAPI confirms the shape: GET /v1/me/rate_limit (RateLimitOut) returns per-model `rate_limit` (outstanding requests) and `tpm_rate_limit` (tokens/minute), neither of which is a per-minute request count that could set a window ceiling. Because no published figure justifies going higher, the ceiling is pinned at the kernel fallback in every dimension: 60 units / 60s at defaultWeight 2 = 30 calls/min, identical to DEFAULT_RATE_BUDGET. The declaration buys resolution DOWNWARD, never headroom: inference (POST /v1/{openai/}chat/completions, POST /v1/{openai/}completions, POST /v1/inference/{model}) costs 6, so at most 10 land in a window, because DeepInfra bills those endpoints by token (ModelMetadata.pricing publishes per-token rates) rather than by request. That factor is a judgement call in the strict direction, not a vendor figure. The window bounds the 60s AVERAGE and does not pace; a `retry-after` read off a real 429 is the persisted cooldown backstop. The vendor's own 429 (`fail_fast` queue overflow, `engine_overloaded`) is serve-path surface, not this guard."};ft(pt,re);import{assertBudgetGuardIntact as Pn,confirmAction as Mn,observeResources as gt,pendingActions as Ln,projectResources as Bn}from"../../engine/v2/volter_world-core.mjs";var $e="deepinfra";function bt(e){return Array.isArray(e.data)?e.data:[]}function ie(e,t){let n=e.error;if(n)throw new Error(`deepinfra ${t} failed: ${n.message??n.code??"unknown error"}`);let o=e.detail;if(o!=null){let i=typeof o=="string"?o:JSON.stringify(o);throw new Error(`deepinfra ${t} failed: ${i}`)}if(typeof e.status=="number"&&e.status>=400)throw new Error(`deepinfra ${t} failed: HTTP ${e.status}`)}function xt(e){return{type:"model",id:String(e.id),fields:{object:"model",created:e.created??0,owned_by:e.owned_by??"deepinfra",root:e.root??String(e.id),parent:null,metadata:e.metadata??{description:"",pricing:{},tags:[]}}}}function Et(e){return{type:"file",id:String(e.id),fields:{object:"file",bytes:e.bytes??0,created_at:e.created_at??null,filename:e.filename??null,purpose:e.purpose??null,...e.expires_at!==void 0?{expires_at:e.expires_at}:{}}}}function wt(e){return{type:"batch",id:String(e.id),fields:{object:"batch",endpoint:e.endpoint??null,input_file_id:e.input_file_id??null,completion_window:e.completion_window??"24h",status:e.status??null,output_file_id:e.output_file_id??null,error_file_id:e.error_file_id??null,created_at:e.created_at??null,in_progress_at:e.in_progress_at??null,expires_at:e.expires_at??null,finalizing_at:e.finalizing_at??null,completed_at:e.completed_at??null,failed_at:e.failed_at??null,expired_at:e.expired_at??null,cancelling_at:e.cancelling_at??null,cancelled_at:e.cancelled_at??null,request_counts:e.request_counts??{total:0,completed:0,failed:0},metadata:e.metadata??null,model:e.model??null,usage:e.usage??null}}}function vt(e){return{type:"rate_limit",id:"account",fields:{rate_limit:e.rate_limit??null,tpm_rate_limit:e.tpm_rate_limit??null}}}var St=[{path:"/v1/models",map:xt},{path:"/v1/files",map:Et},{path:"/v1/batches",map:wt}],Tt=[{path:"/v1/me/rate_limit",map:vt}];async function At(e){let t=[];for(let n of St){let o=await e("GET",n.path);ie(o,`pull ${n.path}`);for(let i of bt(o))t.push(n.map(i))}for(let n of Tt){let o=await e("GET",n.path);ie(o,`pull ${n.path}`),t.push(n.map(o))}return t}async function ke(e,t){let n=await At(e),o=gt($e,n.map(i=>({type:i.type,id:i.id,fields:i.fields})),{...t.root!==void 0?{root:t.root}:{},at:t.occurredAt,batch:`obs:${$e}:${t.occurredAt}`});return{observed:o.observed,deltasAppended:o.appended}}var se=new Set(["create","cancel","delete"]),It=new Set(["rate_limit"]);function $t(e){let t=e.includes(".")?e.slice(e.indexOf(".")+1):e;if(!se.has(t))throw new Error(`deepinfra push: unsupported operation '${e}' \u2014 refusing to silently drop a local write`);let n=ae[e];if(n)throw new Error(`deepinfra push: cannot push '${e}' \u2014 ${n}`)}function kt(e){let t=e.includes(".")?e.slice(e.indexOf(".")+1):e;return se.has(t)?ae[e]??null:`unsupported operation '${e}'`}var Rt={file:"/v1/files",batch:"/v1/batches"},ae={"file.create":"real DeepInfra's POST /v1/files is multipart/form-data carrying the JSONL bytes; this JSON executor cannot express it, and the twin stores no real bytes to send","batch.create":"a real batch is created FROM an uploaded vendor file id; a locally-minted file has none, so the create would 404 at the vendor"},Nt=/^(file|batch)-twin\d{12}$/;function Ot(e,t){let n=e.operation??`${e.subject.type}.update`,o=n.includes(".")?n.slice(n.indexOf(".")+1):n,i=Rt[e.subject.type];if(!i)throw new Error(`deepinfra push: no REST collection for subject type '${e.subject.type}'`);if(o==="create")return{method:"POST",path:i};let r=t??e.subject.id;if(Nt.test(r))throw new Error(`deepinfra push: refusing to address the real account by the twin's own id '${r}' \u2014 no vendor id was ever recorded for this subject`);return o==="cancel"?{method:"POST",path:`${i}/${r}/cancel`}:o==="delete"?{method:"DELETE",path:`${i}/${r}`}:{method:"POST",path:i}}async function jt(e,t,n={}){$t(t.operation??`${t.subject.type}.update`);let{method:o,path:i}=Ot(t,n.externalId),r=await e(o,i);ie(r,`push ${t.subject.type}`);let u=r.id;return{externalId:typeof u=="string"&&u?u:t.subject.id}}function Re(e){return async(t,n,o)=>{let i=await e({method:t,path:n,headers:{accept:"application/json",authorization:"Bearer twin",...t==="POST"?{"content-type":"application/json"}:{}},...o===void 0?{}:{body:JSON.stringify(o)}});if(i.status<200||i.status>=300)throw new Error(`deepinfra ${t} ${n} refused: HTTP ${i.status} ${i.body.slice(0,200)}`);if(i.body==="")return{status:i.status};try{return JSON.parse(i.body)}catch{return{status:i.status,error:{message:i.body.slice(0,200)}}}}}async function Ne(e,t={}){return ke(Re(e),{...t.root!==void 0?{root:t.root}:{},occurredAt:t.occurredAt??new Date().toISOString()})}async function Oe(e,t,n){let o=t.operation??`${t.subject.type}.update`,i=o.includes(".")?o.slice(o.indexOf(".")+1):o;if(It.has(t.subject.type)||!se.has(i)||ae[o]!==void 0)return{externalId:t.subject.id,data:{performed:!1,reason:`${o}: ${kt(o)??"the twin\u2019s own record \u2014 nothing at DeepInfra to write"}`}};let r=i==="create"?void 0:n.resolve(t.subject.type,t.subject.id)??void 0,{externalId:u}=await jt(Re(e),t,...r!==void 0?[{externalId:r}]:[]);return{externalId:u}}import{applyTwinWrite as V,projectResources as Lt}from"../../engine/v2/volter_world-core.mjs";import{getActiveWorldStore as Dt,parseScenarioDocument as Ft,ScenarioError as Ct,ScenarioEngine as Pt}from"../../engine/v2/volter_world-core.mjs";function v(e){return e?Math.max(1,Math.ceil(e.length/4)):0}function I(e){return typeof e=="string"?e:e==null||!Array.isArray(e)?"":e.map(t=>t&&typeof t=="object"&&t.type==="text"?String(t.text??""):JSON.stringify(t)).join(`
3
+ `)}function je(e){let t=0;for(let n of e){t+=v(I(n.content)),n.name&&(t+=v(n.name)),typeof n.reasoning_content=="string"&&(t+=v(n.reasoning_content));for(let o of n.tool_calls??[])t+=v(JSON.stringify(o))}return t}function M(e){for(let t=e.length-1;t>=0;t--)if(e[t].role==="user")return I(e[t].content);return e.length?I(e[e.length-1].content):""}function De(e,t){let n=M(e).trim(),o=n.length>200?`${n.slice(0,200)}\u2026`:n;return`[twin-stub:${t}] This is a deterministic stub from the Deepinfra twin (no model weights are run). Echoing your last message: ${o||"(empty)"}`}function Fe(e,t,n){let o=M(e).trim(),i=o.length>80?`${o.slice(0,80)}\u2026`:o;return`[twin-stub:${t}] reasoning_content (effort=${n}): deterministic reasoning stub for: ${i||"(empty)"}`}function Ce(e,t){return JSON.stringify({_twin_stub:!0,model:t,echoed:M(e).slice(0,200)})}function le(e,t,n){let o=e.find(c=>{let a=c;return a&&typeof a=="object"&&a.type==="function"&&typeof a.function?.name=="string"});if(!o)return null;let i=n??o.function.name,u=e.find(c=>c?.function?.name===i)?.function?.parameters?.properties??{},l={};for(let[c,a]of Object.entries(u)){let f=a?.type;l[c]=f==="integer"||f==="number"?0:f==="boolean"?!1:f==="array"?[]:f==="object"?{}:""}return{id:`call_twin_${t}`,type:"function",function:{name:i,arguments:JSON.stringify(l)}}}function j(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t>>>0}function Pe(e){return`fp_twin_${j(e).toString(36)}`}function ue(e,t){let n=[],o=j(e);for(let i=0;i<t;i++)o=Math.imul(o,16777619)>>>0,n.push(Math.round((o%2e4/1e4-1)*1e6)/1e6);return n}function de(e){let t=0,n="a",o="0",i="a",r=" ",u=()=>e[t],l=()=>e[t++],c=()=>{let h=l();if(h===void 0)throw new Error("unexpected end of pattern");if(h==="("){if(u()==="?"){l();let g=l();if(g!==":")throw new Error(`unsupported regex construct (?${g??""}`)}let p=E();if(l()!==")")throw new Error("unterminated group");return()=>p.map(g=>g()).join("")}if(h==="[")return a();if(h===".")return()=>n;if(h==="\\"){let p=l();if(p==="d")return()=>o;if(p==="D")return()=>n;if(p==="w")return()=>i;if(p==="W")return()=>r;if(p==="s")return()=>r;if(p==="S")return()=>n;if(p!==void 0&&p>="1"&&p<="9")throw new Error("unsupported regex construct (backreference)");if(p==="n")return()=>`
4
+ `;if(p==="t")return()=>" ";if(p===void 0)throw new Error("dangling escape");return()=>p}if("^$".includes(h))return()=>"";if("*+?|)".includes(h))throw new Error(`unexpected quantifier or terminator '${h}'`);return"{".includes(h)?()=>h:()=>h},a=()=>{let h=!1;u()==="^"&&(h=!0,l());let p=[],g=!0;for(;;){let y=l();if(y===void 0)throw new Error("unterminated class");if(y==="]"&&!g)break;if(g=!1,y==="\\"){let x=l();if(x==="d"){p.push(o);continue}if(x==="w"){p.push(i);continue}if(x==="s"){p.push(r);continue}if(x===void 0)throw new Error("dangling escape");p.push(x);continue}if(u()==="-"&&e[t+1]!==void 0&&e[t+1]!=="]"){l();let x=l();p.push(y);continue}p.push(y)}return h?()=>p.includes("z")?"0":"z":()=>p[0]??n},f=()=>{let h=c(),p=u(),g=1,y=!1;if(p==="*")g=0,y=!0;else if(p==="+")g=1,y=!0;else if(p==="?")g=0,y=!0;else if(p==="{"){let x=e.indexOf("}",t);if(x!==-1){let T=e.slice(t+1,x);/^\d+$/.test(T)?(g=Number(T),y=!0):/^\d+,$/.test(T)?(g=Number(T.slice(0,-1)),y=!0):/^\d+,\d+$/.test(T)&&(g=Number(T.split(",")[0]),y=!0),y&&(t=x+1)}}return y?(p!=="{"&&l(),u()==="?"&&l(),()=>h().repeat(Math.max(0,g))):h},_=()=>{let h=[];for(;t<e.length&&u()!=="|"&&u()!==")";)h.push(f());return h},E=()=>{let h=[_()];for(;u()==="|";)l(),h.push(_());return h[0]},w=E();if(t!==e.length)throw new Error(`unsupported regex construct at ${t}`);return w.map(h=>h()).join("")}var Me=new Set(["text","reasoning","toolCalls","finishReason"]),Le=new Set(["stop","length","tool_calls"]),Be=new Set(["none","minimal","low","medium","high","xhigh","max"]),Ue=new Set(["default","priority","flex"]),F=e=>typeof e=="string"&&e.length>0;function Ge(e){let t=new Set,n=e[e.length-1];if(!n||n.role!=="tool"||typeof n.tool_call_id!="string")return t;for(let o of e){let i=o;if(!(i.role!=="assistant"||!Array.isArray(i.tool_calls)))for(let r of i.tool_calls)r?.id===n.tool_call_id&&typeof r?.function?.name=="string"&&t.add(r.function.name)}return t}function Je(e){return Array.isArray(e)?e.map(t=>typeof t?.function?.name=="string"?t.function.name:typeof t?.name=="string"?t.name:null).filter(t=>t!==null):[]}var We={vendor:"deepinfra",renderFault:e=>({body:{error:{message:e.message??(e.status===429?"Model busy, retry later":e.status>=500?"Internal server error":"The request was refused by a scripted fault."),type:e.status>=500?"internal_error":"invalid_request_error",param:null,code:e.status===429?"engine_overloaded":null}}}),features:e=>({model:e.model,lastUserText:M(e.messages).slice(0,300),tools:Je(e.tools),lastMessageIsToolResult:e.messages[e.messages.length-1]?.role==="tool",toolResultFor:[...Ge(e.messages)],reasoningEffort:e.reasoningEffort??"medium",serviceTier:e.serviceTier??"default",failFast:e.failFast===!0}),matchers:{modelEquals:(e,t)=>F(t)&&e.model===t,userTextIncludes:(e,t)=>F(t)&&M(e.messages).toLowerCase().includes(t.toLowerCase()),anyTextIncludes:(e,t)=>F(t)&&e.messages.map(n=>I(n.content)).join(`
5
+ `).toLowerCase().includes(t.toLowerCase()),lastMessageIsToolResult:(e,t)=>typeof t=="boolean"&&e.messages[e.messages.length-1]?.role==="tool"===t,toolResultFor:(e,t)=>F(t)&&Ge(e.messages).has(t),hasTool:(e,t)=>F(t)&&Je(e.tools).includes(t),reasoningEffortEquals:(e,t)=>F(t)&&(e.reasoningEffort??"medium")===t,serviceTierEquals:(e,t)=>F(t)&&(e.serviceTier??"default")===t,failFastEquals:(e,t)=>typeof t=="boolean"&&e.failFast===!0===t},text:e=>e.messages.map(t=>I(t.content)).join(`
6
+ `),validateOn:e=>{for(let t of["modelEquals","userTextIncludes","anyTextIncludes","toolResultFor","hasTool","reasoningEffortEquals","serviceTierEquals"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return`on.${t} is a non-empty string`;return e.lastMessageIsToolResult!==void 0&&typeof e.lastMessageIsToolResult!="boolean"?"on.lastMessageIsToolResult is a boolean":e.reasoningEffortEquals!==void 0&&!Be.has(e.reasoningEffortEquals)?`on.reasoningEffortEquals is one of ${[...Be].join(", ")}`:e.serviceTierEquals!==void 0&&!Ue.has(e.serviceTierEquals)?`on.serviceTierEquals is one of ${[...Ue].join(", ")}`:e.failFastEquals!==void 0&&typeof e.failFastEquals!="boolean"?"on.failFastEquals is a boolean":null},validateRespond:e=>{if(typeof e!="object"||e===null||Array.isArray(e))return"respond is an object { text?, reasoning?, toolCalls?, finishReason? }";let t=e;for(let n of Object.keys(t))if(!Me.has(n))return`respond: unknown key "${n}" (valid: ${[...Me].join(", ")})`;if(t.text!==void 0&&typeof t.text!="string")return"respond.text is a string";if(t.reasoning!==void 0&&typeof t.reasoning!="string")return"respond.reasoning is a string";if(t.finishReason!==void 0&&(typeof t.finishReason!="string"||!Le.has(t.finishReason)))return`respond.finishReason is one of ${[...Le].join(", ")}`;if(t.toolCalls!==void 0)for(let n of Array.isArray(t.toolCalls)?t.toolCalls:[t.toolCalls]){let o=n;if(!o||typeof o!="object"||Array.isArray(o))return"respond.toolCalls entries are objects";if(typeof o.name!="string"||!o.name)return"respond.toolCalls[].name is a non-empty string";if(!o.arguments||typeof o.arguments!="object"||Array.isArray(o.arguments))return"respond.toolCalls[].arguments is an object";if(o.id!==void 0&&typeof o.id!="string")return"respond.toolCalls[].id is a string"}return t.text===void 0&&t.toolCalls===void 0?"respond needs text or toolCalls (faults are authored as `fault: {kind: ...}`, not respond keys)":null}};function He(e){let t;try{let n=Dt().read(e);if(n===null)throw new Error(`ENOENT: no such file or directory, open '${e}'`);t=JSON.parse(n)}catch(n){throw new Ct(`deepinfra scenario: cannot read/parse ${e}: ${n instanceof Error?n.message:String(n)}`)}return Ft(t,We)}function ze(e){return new Pt(We,e)}function qe(e){let t=[];return(e.toolCalls?Array.isArray(e.toolCalls)?e.toolCalls:[e.toolCalls]:[]).forEach((o,i)=>{let r=`${i}:${o.name}:${JSON.stringify(o.arguments)}`,u=2166136261;for(let l=0;l<r.length;l++)u^=r.charCodeAt(l),u=Math.imul(u,16777619);t.push({id:o.id??`call_scripted_${(u>>>0).toString(36)}`,type:"function",function:{name:o.name,arguments:JSON.stringify(o.arguments)}})}),{text:e.text??(t.length?null:""),reasoning:e.reasoning??null,toolCalls:t,finishReason:e.finishReason??(t.length?"tool_calls":"stop")}}var L=(e,t,n,o,i)=>({id:e,object:"model",created:0,owned_by:"deepinfra",root:e,parent:null,metadata:{description:t,context_length:n,max_tokens:n,pricing:o,tags:i}}),Mt={"BAAI/bge-large-en-v1.5":1024};function ce(e){return Mt[e]??512}var fe=[L("meta-llama/Llama-2-70b-chat-hf","Llama-2 70B chat, the model in DeepInfra's own request examples.",4096,{I:7e-4,O:9e-4,units:"per_token_1m"},["text-generation","chat"]),L("meta-llama/Meta-Llama-3.1-8B-Instruct","Llama 3.1 8B instruct.",131072,{I:3e-5,O:5e-5,units:"per_token_1m"},["text-generation","chat"]),L("deepseek-ai/DeepSeek-V3","DeepSeek V3 MoE chat model as served by DeepInfra.",131072,{I:13e-5,O:4e-4,units:"per_token_1m"},["text-generation","chat","reasoning"]),L("Qwen/Qwen2.5-7B-Instruct","Qwen 2.5 7B instruct.",131072,{I:4e-5,O:6e-5,units:"per_token_1m"},["text-generation","chat"]),L("BAAI/bge-large-en-v1.5","The embedding model in DeepInfra's own embeddings example.",512,{I:1e-5,units:"per_token_1m"},["embeddings"]),L("black-forest-labs/FLUX-1.1-pro","FLUX 1.1 pro image generation.",0,{O:.04,units:"per_image"},["text-to-image"])];function B(e){return fe.find(t=>t.id===e)}function D(e,t){let n=B(e);if(!n)return`Model '${e}' not found`;let o=n.metadata.tags,i=t==="embeddings"||t==="inference-embeddings"?"embeddings":t==="vision-parts"?"vision":"chat";return o.includes(i)?null:t==="inference-text"?`Model '${e}' is not a text-generation model`:t==="inference-embeddings"||t==="embeddings"?`Model '${e}' is not an embedding model`:t==="vision-parts"?`Model '${e}' does not support image inputs`:`Model '${e}' is not a chat model`}var J="deepinfra",_e="/v1/inference",Xe="/anthropic";function W(e,t){return{error:{message:e,type:"invalid_request_error",param:null,...t!==void 0?{code:t}:{code:null}}}}function Bt(e,t){return t==="openai"?e==="missing"?{status:401,body:W("missing API key","invalid_api_key")}:{status:401,body:W("User is not authorized to access this resource","invalid_api_key")}:e==="missing"?{status:401,body:{detail:{error:"not authenticated"}}}:{status:401,body:{detail:"User is not authorized to access this resource"}}}function s(e,t,n){return{status:422,body:{detail:[{loc:e,msg:t,type:n}]}}}function et(e){return{status:429,body:W("Model busy, retry later","engine_overloaded"),headers:{"x-deepinfra-model":e}}}function ye(){return{status:404,body:{detail:"Not Found"}}}function R(e){return{status:404,body:{detail:e}}}function Ut(){return{status:405,body:{detail:"Method Not Allowed"}}}function Gt(e){let t=e.headers?.authorization,n=typeof t=="string"&&t.toLowerCase().startsWith("bearer ")?t.slice(7).trim():"",o=(e.apiKey??"").trim()||n;return o?o==="invalid"||o==="bad-key"?"invalid":null:"missing"}function ge(e,t){let n=e.headers?.[t];return n==="1"||n==="true"}function P(e){return Math.floor((e?Date.parse(e):0)/1e3)}function H(e,t){return Lt(J,t).filter(n=>n.type===e)}function tt(e,t){let n=e==="file"?/^file-twin(\d{12})$/:/^batch-twin(\d{12})$/,o=0;for(let i of H(e,t)){let r=n.exec(String(i.id));r&&(o=Math.max(o,Number(r[1])))}return`${e}-twin${String(o+1).padStart(12,"0")}`}function Jt(e){return H("model",e).filter(t=>!t._deleted).map(t=>({id:t.id,object:"model",created:t.created??0,owned_by:t.owned_by??"deepinfra",root:t.root??t.id,parent:null,metadata:t.metadata??{description:"",pricing:{},tags:[]}}))}function Wt(e){let t=new Map;for(let n of fe)t.set(n.id,n);for(let n of Jt(e))t.set(String(n.id),n);return[...t.values()]}function $(e,t,n){return H(e,n).find(o=>o.id===t)}var pe={rate_limit:200,tpm_rate_limit:0};function Ht(e){let t=$("rate_limit","account",e);return t?{rate_limit:typeof t.rate_limit=="number"?t.rate_limit:pe.rate_limit,tpm_rate_limit:typeof t.tpm_rate_limit=="number"?t.tpm_rate_limit:pe.tpm_rate_limit}:pe}function be(e){if(!e||!e.trim())return{error:s(["body"],"Field required","missing")};try{let t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{error:s(["body"],"Input should be a valid dictionary","model_type")}:{params:t}}catch{return{error:s(["body"],"Input should be a valid dictionary","json_invalid")}}}var zt=new Set(["service_tier","fail_fast","models","model","messages","stream","temperature","top_p","min_p","top_k","max_tokens","stop","stop_token_ids","n","presence_penalty","frequency_penalty","tools","tool_choice","response_format","repetition_penalty","user","seed","logprobs","stream_options","reasoning_effort","reasoning","prompt_cache_key","prompt_cache_options","chat_template_kwargs","continue_final_message","ignore_eos"]),qt=new Set(["service_tier","fail_fast","models","model","prompt","max_tokens","temperature","top_p","min_p","top_k","n","stream","logprobs","echo","stop","presence_penalty","frequency_penalty","response_format","repetition_penalty","user","seed","stream_options","stop_token_ids","return_tokens_as_token_ids","prompt_cache_key","prompt_cache_options","data","ignore_eos"]),Xt=new Set(["service_tier","fail_fast","model","input","input_type","encoding_format","dimensions"]),Ve=new Set(["system","user","assistant","tool"]),Vt=new Set(["default","priority","flex"]),Qe={auto:"priority",standard_only:"default"},Ke=new Set(["none","minimal","low","medium","high","xhigh","max"]),Qt=new Set(["5m","1h"]),Kt=new Set(["explicit","implicit"]),Q=16,nt=4,ot=1e7,X=2,Yt=new Set(["none","auto","required"]),rt=-9223372036854776e3,it=18446744073709552e3;function C(e,t,n){return t==null?null:typeof t!="number"||Number.isNaN(t)?s(["body",e],"Input should be a valid integer","integer_type"):Number.isInteger(t)?(n.minEx?t<=n.min:t<(n.min??-1/0))?s(["body",e],n.minEx?`Input should be greater than ${n.min}`:`Input should be greater than or equal to ${n.min}`,n.minEx?"greater_than":"greater_than_equal"):(n.maxEx?t>=n.max:t>(n.max??1/0))?s(["body",e],n.maxEx?`Input should be less than ${n.max}`:`Input should be less than or equal to ${n.max}`,n.maxEx?"less_than":"less_than_equal"):null:s(["body",e],"Input should be a valid integer, got a number with a fractional part","int_from_float")}function st(e){let t=e.prompt_cache_options;if(t==null)return null;if(typeof t!="object"||Array.isArray(t))return s(["body","prompt_cache_options"],"Input should be a valid dictionary","model_type");let n=t;return n.mode!==void 0&&n.mode!==null&&(typeof n.mode!="string"||!Kt.has(n.mode))?s(["body","prompt_cache_options","mode"],"Input should be 'explicit' or 'implicit'","enum"):n.ttl!==void 0&&n.ttl!==null&&(typeof n.ttl!="string"||!Qt.has(n.ttl))?s(["body","prompt_cache_options","ttl"],"Input should be '5m' or '1h'","enum"):null}function at(e){return typeof e=="string"?[e]:Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}function Zt(e){if(typeof e!="object"||e===null||Array.isArray(e))return{error:s(["body","response_format"],"Input should be a valid dictionary","model_type")};let t=e.type;if(t==="text"||t==="json_object")return{type:t};if(t==="json_schema"){let n=e.json_schema;if(!n||typeof n!="object"||Array.isArray(n))return{error:s(["body","response_format","json_schema"],"Field required","missing")};let o=n.name,i=n.schema;return typeof o!="string"||!o?{error:s(["body","response_format","json_schema","name"],"Field required","missing")}:!i||typeof i!="object"||Array.isArray(i)?{error:s(["body","response_format","json_schema","schema"],"Field required","missing")}:{type:t,schema:{name:o,schema:i}}}if(t==="regex"){let n=e.regex;if(typeof n!="string"||!n)return{error:s(["body","response_format","regex"],"Field required","missing")};try{new RegExp(n),de(n)}catch(o){return{error:s(["body","response_format","regex"],`regex cannot be served: ${o instanceof Error?o.message:String(o)}`,"value_error")}}return{type:t,regex:n}}return{error:s(["body","response_format","type"],"Input should be 'text', 'json_object', 'json_schema' or 'regex'","enum")}}function en(e){for(let d of Object.keys(e))if(!zt.has(d))return{error:s(["body",d],"Extra inputs are not permitted","extra_forbidden")};if(typeof e.model!="string"||!e.model)return{error:s(["body","model"],"Field required","missing")};if(!Array.isArray(e.messages))return{error:s(["body","messages"],"Input should be a valid list","list_type")};if(e.messages.length===0)return{error:s(["body","messages"],"List should have at least 1 item after validation, not 0","too_short")};let t=e.messages;for(let d=0;d<t.length;d++){let m=t[d];if(!m||typeof m!="object"||typeof m.role!="string")return{error:s(["body","messages",d,"role"],"Field required","missing")};if(!Ve.has(m.role))return{error:s(["body","messages",d,"role"],`Input should be ${[...Ve].map(b=>`'${b}'`).join(" or ")}`,"enum")};if(m.role==="tool"&&typeof m.tool_call_id!="string")return{error:s(["body","messages",d,"tool_call_id"],"Field required","missing")};if(m.tool_calls!==void 0&&m.tool_calls!==null&&!Array.isArray(m.tool_calls))return{error:s(["body","messages",d,"tool_calls"],"Input should be a valid list","list_type")};if(Array.isArray(m.content)&&m.content.some(b=>b&&typeof b=="object"&&b.type==="image_url")){let b=D(String(e.model),"vision-parts");if(b)return{error:s(["body","messages",d,"content"],b,"value_error")}}for(let b of m.tool_calls??[]){let A=b;if(!A||typeof A!="object"||typeof A.id!="string"||A.type!=="function"||typeof A.function?.name!="string"||typeof A.function?.arguments!="string")return{error:s(["body","messages",d,"tool_calls"],"each tool call must be { id, type: 'function', function: { name, arguments } }","value_error")}}}let n=D(String(e.model),"chat");if(n)return{error:s(["body","model"],n,"value_error")};let o=e.model,i;if(e.models!==void 0&&e.models!==null){let d=e.models;if(!Array.isArray(d)||d.some(m=>typeof m!="string")||d.length<1||d.length>4)return{error:s(["body","models"],"List should have at most 4 items","too_long")};for(let m of d){let b=D(m,"chat");if(b)return{error:s(["body","models"],b,"value_error")}}i=[...new Set(d)]}let r="default";if(e.service_tier!==void 0&&e.service_tier!==null){let d=e.service_tier;if(typeof d!="string")return{error:s(["body","service_tier"],"Input should be a valid string","string_type")};if(Vt.has(d))r=d;else if(d in Qe)r=Qe[d];else return{error:s(["body","service_tier"],"Input should be 'default', 'priority' or 'flex'","enum")}}if(e.fail_fast!==void 0&&e.fail_fast!==null&&typeof e.fail_fast!="boolean")return{error:s(["body","fail_fast"],"Input should be a valid boolean","bool_type")};let u=e.fail_fast===!0,l=(d,m,b,A={})=>{let k=e[d];return k==null?0:typeof k!="number"||Number.isNaN(k)?{error:s(["body",d],"Input should be a valid number","number_type")}:(A.exLo?k<=m:k<m)?{error:s(["body",d],A.exLo?`Input should be greater than ${m}`:`Input should be greater than or equal to ${m}`,A.exLo?"greater_than":"greater_than_equal")}:(A.exHi?k>=b:k>b)?{error:s(["body",d],A.exHi?`Input should be less than ${b}`:`Input should be less than or equal to ${b}`,A.exHi?"less_than":"less_than_equal")}:k},c=l("temperature",0,2);if(typeof c=="object")return c;let a=l("top_p",0,1,{exLo:!0});if(typeof a=="object")return a;let f=l("min_p",0,1);if(typeof f=="object")return f;let _=C("top_k",e.top_k,{min:0,max:1e3,maxEx:!0});if(_)return{error:_};let E=l("repetition_penalty",.01,5);if(typeof E=="object")return E;for(let d of["presence_penalty","frequency_penalty"]){let m=e[d];if(m!=null){if(typeof m!="number"||Number.isNaN(m))return{error:s(["body",d],"Input should be a valid number","number_type")};if(m<-X)return{error:s(["body",d],`Input should be greater than or equal to -${X}`,"greater_than_equal")};if(m>X)return{error:s(["body",d],`Input should be less than or equal to ${X}`,"less_than_equal")}}}let w=C("max_tokens",e.max_tokens,{min:0,minEx:!0,max:ot});if(w)return{error:w};let h=e.max_tokens===void 0||e.max_tokens===null?void 0:e.max_tokens,p;if(e.stop!==void 0&&e.stop!==null){let d=at(e.stop);if(d===null)return{error:s(["body","stop"],"Input should be a valid string or list of strings","string_type")};if(d.length>Q)return{error:s(["body","stop"],"List should have at most 16 items","too_long")};p=d}let g=C("n",e.n,{min:1,max:nt});if(g)return{error:g};let y=e.n===void 0||e.n===null?1:e.n,x=C("seed",e.seed,{min:rt,max:it,maxEx:!0});if(x)return{error:x};if(e.stop_token_ids!==void 0&&e.stop_token_ids!==null){let d=e.stop_token_ids;if(!Array.isArray(d))return{error:s(["body","stop_token_ids"],"Input should be a valid list","list_type")};if(d.length>Q)return{error:s(["body","stop_token_ids"],"List should have at most 16 items","too_long")};for(let m=0;m<d.length;m++){let b=d[m];if(typeof b!="number"||!Number.isInteger(b))return{error:s(["body","stop_token_ids",String(m)],"Input should be a valid integer","integer_type")}}}let T="text",S,N;if(e.response_format!==void 0&&e.response_format!==null){let d=Zt(e.response_format);if("error"in d)return d;T=d.type,S=d.schema,N=d.regex}if(e.logprobs!==void 0&&e.logprobs!==null&&typeof e.logprobs!="boolean")return{error:s(["body","logprobs"],"Input should be a valid boolean","bool_type")};if(e.stream!==void 0&&e.stream!==null&&typeof e.stream!="boolean")return{error:s(["body","stream"],"Input should be a valid boolean","bool_type")};let U=e.stream===!0,Ee=!1,we=!1;if(e.stream_options!==void 0&&e.stream_options!==null){if(typeof e.stream_options!="object"||Array.isArray(e.stream_options))return{error:s(["body","stream_options"],"Input should be a valid dictionary","model_type")};let d=e.stream_options;if(d.include_usage!==void 0&&typeof d.include_usage!="boolean")return{error:s(["body","stream_options","include_usage"],"Input should be a valid boolean","bool_type")};if(d.continuous_usage_stats!==void 0&&typeof d.continuous_usage_stats!="boolean")return{error:s(["body","stream_options","continuous_usage_stats"],"Input should be a valid boolean","bool_type")};Ee=U&&d.include_usage===!0,we=U&&d.continuous_usage_stats===!0}let z,te,ve=(d,m)=>d==null?null:typeof d!="string"||!Ke.has(d)?{error:s(m,`Input should be ${[...Ke].map(b=>`'${b}'`).join(" or ")}`,"enum")}:null,Se=ve(e.reasoning_effort,["body","reasoning_effort"]);if(Se)return Se;if(e.reasoning_effort!==void 0&&e.reasoning_effort!==null&&(z=e.reasoning_effort),e.reasoning!==void 0&&e.reasoning!==null){if(typeof e.reasoning!="object"||Array.isArray(e.reasoning))return{error:s(["body","reasoning"],"Input should be a valid dictionary","model_type")};let d=e.reasoning,m=ve(d.effort,["body","reasoning","effort"]);if(m)return m;if(d.effort!==void 0&&d.effort!==null&&(z=d.effort),d.enabled!==void 0&&d.enabled!==null){if(typeof d.enabled!="boolean")return{error:s(["body","reasoning","enabled"],"Input should be a valid boolean","bool_type")};te=d.enabled}}if(e.prompt_cache_key!==void 0&&e.prompt_cache_key!==null&&typeof e.prompt_cache_key!="string")return{error:s(["body","prompt_cache_key"],"Input should be a valid string","string_type")};let Te=st(e);if(Te)return{error:Te};let Ae=e.prompt_cache_options===void 0||e.prompt_cache_options===null?void 0:e.prompt_cache_options;if(e.continue_final_message!==void 0&&e.continue_final_message!==null&&typeof e.continue_final_message!="boolean")return{error:s(["body","continue_final_message"],"Input should be a valid boolean","bool_type")};let Ie=e.continue_final_message===!0;if(Ie&&t[t.length-1].role!=="assistant")return{error:s(["body","continue_final_message"],"Only applicable when the last message in the conversation is an assistant message","value_error")};if(e.user!==void 0&&e.user!==null&&typeof e.user!="string")return{error:s(["body","user"],"Input should be a valid string","string_type")};let ne;if(e.tools!==void 0&&e.tools!==null){if(!Array.isArray(e.tools))return{error:s(["body","tools"],"Input should be a valid list","list_type")};for(let d of e.tools){let m=d;if(!m||typeof m!="object"||m.type!=="function"||typeof m.function?.name!="string")return{error:s(["body","tools"],"each entry must be { type: 'function', function: { name } }","value_error")}}ne=e.tools}let q,O=e.tool_choice;if(O!=null)if(typeof O=="string"){if(!Yt.has(O))return{error:s(["body","tool_choice"],"Input should be 'none', 'auto', 'required' or a named tool","enum")};q=O}else if(typeof O=="object"&&!Array.isArray(O)){let d=O.function?.name;if(typeof d!="string"||!d)return{error:s(["body","tool_choice","function","name"],"Field required","missing")};q={function:{name:d}}}else return{error:s(["body","tool_choice"],"Input should be a string or a named tool","string_type")};return{args:{model:o,messages:t,...ne!==void 0?{tools:ne}:{},...h!==void 0?{maxTokens:h}:{},...p!==void 0?{stop:p}:{},n:y,stream:U,includeUsage:Ee,continuousUsageStats:we,...q!==void 0?{toolChoice:q}:{},responseFormat:T,...S!==void 0?{responseSchema:S}:{},...N!==void 0?{responseRegex:N}:{},serviceTier:r,failFast:u,...i!==void 0?{fallbackModels:i}:{},...z!==void 0?{reasoningEffort:z}:{},...te!==void 0?{reasoningEnabled:te}:{},...e.prompt_cache_key!==void 0&&e.prompt_cache_key!==null?{promptCacheKey:e.prompt_cache_key}:{},...Ae!==void 0?{promptCacheOptions:Ae}:{},continueFinalMessage:Ie,...e.user!==void 0&&e.user!==null?{user:e.user}:{}}}}function tn(e,t,n){let o=null,i="";if(n&&(n.kind==="handler"?o=qe(n.respond):i=`
7
+ [twin-scenario miss \u2014 no handler matched. Author one in the world dir's handlers/deepinfra.json (GET /twin explains; GET /twin/scenario lists handlers + misses). Features seen: ${JSON.stringify(n.miss.features)}]`),o){let y=o.toolCalls.length?{role:"assistant",content:o.text,tool_calls:o.toolCalls}:{role:"assistant",content:o.text??""};return o.reasoning!==null&&(y.reasoning_content=o.reasoning),{choice:{index:0,message:y,finish_reason:o.finishReason},completionTokens:v(JSON.stringify(o.toolCalls.length?o.toolCalls:o.text??""))+v(o.reasoning??""),reasoningTokens:v(o.reasoning??""),missTeach:""}}let r=Array.isArray(e.tools)&&e.tools.length>0,u=e.toolChoice==="none",l=typeof e.toolChoice=="object"?e.toolChoice.function.name:void 0,c=e.reasoningEffort??(e.reasoningEnabled===!1?void 0:"medium"),a=e.reasoningEnabled===!1||c==="none"?void 0:Fe(e.messages,e.model,c??"medium");if(r&&!u){let y=e.tools,x=a?v(a):0,T=[];if(l){let S=le(y,1,l);S&&T.push(S)}else for(let S=0;S<y.length;S++){let N=le([y[S]],S+1);N&&T.push(N)}if(T.length){let S={role:"assistant",content:null,tool_calls:T};return a&&(S.reasoning_content=a),{choice:{index:0,message:S,finish_reason:"tool_calls"},completionTokens:v(JSON.stringify(T))+x,reasoningTokens:x,missTeach:""}}}let f=e.continueFinalMessage?I(e.messages[e.messages.length-1].content):"",_=e.responseFormat==="json_object"||e.responseFormat==="json_schema"?Ce(e.messages,e.model):e.responseFormat==="regex"?de(e.responseRegex):`${f}${De(e.messages,e.model)}`,E="stop",w=-1;for(let y of e.stop??[]){if(!y)continue;let x=_.indexOf(y);x>=0&&(w<0||x<w)&&(w=x)}w>=0&&(_=_.slice(0,w));let h=a,p=a?v(a):0;if(e.maxTokens!==void 0){let y=e.maxTokens;p+v(_)>y&&(E="length",p>=y?(h=a.slice(0,y*4),p=y,_=""):_=_.slice(0,(y-p)*4))}let g={role:"assistant",content:_};return h&&(g.reasoning_content=h),{choice:{index:0,message:g,finish_reason:E},completionTokens:v(_)+p,reasoningTokens:p,missTeach:i}}function nn(e){return j(JSON.stringify(e.messages)+e.model+(e.reasoningEffort??"")+String(e.n)).toString(36)}function lt(e,t,n){let o=je(e.messages),i=[];for(let c=0;c<e.n;c++){let a=tn(e,t,n);if("status"in a)return a;i.push(a)}let r=i.map((c,a)=>({...c.choice,index:a}));i[0].missTeach&&typeof r[0].message.content=="string"&&e.responseFormat!=="regex"&&(r[0].message.content+=i[0].missTeach);let u=i.reduce((c,a)=>c+a.completionTokens,0),l={prompt_tokens:o,completion_tokens:u,total_tokens:o+u};return{id:`chatcmpl-twin-${nn(e)}`,object:"chat.completion",created:P(t),model:e.model,choices:r,usage:l,system_fingerprint:Pe(`${e.model}|${e.serviceTier}|${e.reasoningEffort??""}`)}}var on=e=>typeof e.status=="number"&&"body"in e;function Ye(e){if(!e)return[];let t=[];for(let n=0;n<e.length;n+=20)t.push(e.slice(n,n+20));return t}function rn(e,t,n,o){let i=lt(e,n,o);if("status"in i)return i;let r={id:i.id,object:"chat.completion.chunk",created:i.created,model:i.model,system_fingerprint:i.system_fingerprint},u=i.choices[0];t({data:{...r,choices:[{index:0,delta:{role:"assistant",content:""},finish_reason:null}]}});for(let l of Ye(u.message.reasoning_content??""))t({data:{...r,choices:[{index:0,delta:{reasoning_content:l},finish_reason:null}]}});if(u.message.tool_calls&&u.message.tool_calls.length)u.message.tool_calls.forEach((l,c)=>{t({data:{...r,choices:[{index:0,delta:{tool_calls:[{index:c,id:l.id,type:"function",function:{name:l.function.name,arguments:""}}]},finish_reason:null}]}}),t({data:{...r,choices:[{index:0,delta:{tool_calls:[{index:c,function:{arguments:l.function.arguments}}]},finish_reason:null}]}})});else for(let l of Ye(u.message.content??""))t({data:{...r,choices:[{index:0,delta:{content:l},finish_reason:null}]}}),e.continuousUsageStats&&t({data:{...r,choices:[{index:0,delta:{},finish_reason:null}],usage:i.usage}});return t({data:{...r,choices:[{index:0,delta:{},finish_reason:u.finish_reason}]}}),e.includeUsage&&t({data:{...r,choices:[],usage:i.usage}}),t({done:!0}),i}function sn(e){for(let a of Object.keys(e))if(!qt.has(a))return{error:s(["body",a],"Extra inputs are not permitted","extra_forbidden")};if(typeof e.model!="string"||!e.model)return{error:s(["body","model"],"Field required","missing")};let t=D(String(e.model),"completions");if(t)return{error:s(["body","model"],t,"value_error")};if(typeof e.prompt!="string"||!e.prompt)return{error:s(["body","prompt"],"a single string prompt is required","string_type")};let n=C("max_tokens",e.max_tokens,{min:0,minEx:!0,max:ot});if(n)return{error:n};let o=e.max_tokens===void 0||e.max_tokens===null?void 0:e.max_tokens,i;if(e.stop!==void 0&&e.stop!==null){let a=at(e.stop);if(a===null)return{error:s(["body","stop"],"Input should be a valid string or list of strings","string_type")};if(a.length>Q)return{error:s(["body","stop"],"List should have at most 16 items","too_long")};i=a}let r=C("n",e.n,{min:1,max:nt});if(r)return{error:r};let u=e.n===void 0||e.n===null?1:e.n,l=C("seed",e.seed,{min:rt,max:it,maxEx:!0});if(l)return{error:l};if(e.stop_token_ids!==void 0&&e.stop_token_ids!==null){let a=e.stop_token_ids;if(!Array.isArray(a))return{error:s(["body","stop_token_ids"],"Input should be a valid list","list_type")};if(a.length>Q)return{error:s(["body","stop_token_ids"],"List should have at most 16 items","too_long")};for(let f=0;f<a.length;f++){let _=a[f];if(typeof _!="number"||!Number.isInteger(_))return{error:s(["body","stop_token_ids",String(f)],"Input should be a valid integer","integer_type")}}}let c=st(e);return c?{error:c}:e.echo!==void 0&&e.echo!==null&&typeof e.echo!="boolean"?{error:s(["body","echo"],"Input should be a valid boolean","bool_type")}:{args:{model:e.model,prompt:e.prompt,...o!==void 0?{maxTokens:o}:{},...i!==void 0?{stop:i}:{},echo:e.echo===!0,n:u}}}function an(e,t){let n=`[twin-stub:${e.model}] deterministic FIM-style completion for: ${e.prompt.trim().slice(0,200)}`,o="stop",i=-1;for(let c of e.stop??[]){if(!c)continue;let a=n.indexOf(c);a>=0&&(i<0||a<i)&&(i=a)}i>=0&&(n=n.slice(0,i)),e.maxTokens!==void 0&&v(n)>e.maxTokens&&(n=n.slice(0,e.maxTokens*4),o="length");let r=e.echo?`${e.prompt}${n}`:n,u=v(e.prompt),l=v(n);return{id:`cmpl-twin-${j(e.prompt).toString(36)}`,object:"text_completion",created:P(t),model:e.model,choices:[{index:0,text:r,finish_reason:o}],usage:{prompt_tokens:u,completion_tokens:l,total_tokens:u+l}}}function ln(e){for(let r of Object.keys(e))if(!Xt.has(r))return{error:s(["body",r],"Extra inputs are not permitted","extra_forbidden")};if(typeof e.model!="string"||!e.model)return{error:s(["body","model"],"Field required","missing")};let t=D(String(e.model),"embeddings");if(t)return{error:s(["body","model"],t,"value_error")};let n,o=e.input;if(typeof o=="string")n=[o];else if(Array.isArray(o)&&o.every(r=>typeof r=="string"))n=o;else if(Array.isArray(o)&&o.every(r=>Array.isArray(r)||typeof r=="object"))n=o.map(r=>I(r));else return{error:s(["body","input"],"text or multimodal content to embed","value_error")};if(n.length===0)return{error:s(["body","input"],"Input should be a non-empty list","too_short")};if(n.some(r=>r.length===0))return{error:s(["body","input"],"input must not be empty","value_error")};for(let r of n)if(r.length>1024)return{error:s(["body","input"],"String should have at most 1024 characters","too_long")};let i;if(e.dimensions!==void 0&&e.dimensions!==null){let r=e.dimensions;if(!Number.isInteger(r)||r<32)return{error:s(["body","dimensions"],"Input should be greater than or equal to 32","greater_than_equal")};if(r>2048)return{error:s(["body","dimensions"],"Input should be less than or equal to 2048","less_than_equal")};i=r}return e.input_type!==void 0&&e.input_type!==null&&(typeof e.input_type!="string"||!["query","passage","document"].includes(e.input_type))?{error:s(["body","input_type"],"Input should be 'query', 'passage' or 'document'","enum")}:e.encoding_format!==void 0&&e.encoding_format!==null&&e.encoding_format!=="float"&&e.encoding_format!=="base64"?{error:s(["body","encoding_format"],"Input should be 'float' or 'base64'","enum")}:{args:{model:e.model,inputs:n,...i!==void 0?{dimensions:i}:{},...e.input_type!==void 0&&e.input_type!==null?{inputType:e.input_type}:{}}}}function un(e){let t=e.dimensions??ce(e.model);return{status:200,body:{object:"list",data:e.inputs.map((n,o)=>({object:"embedding",index:o,embedding:ue(n,t)})),model:e.model,usage:{prompt_tokens:e.inputs.reduce((n,o)=>n+v(o),0),completion_tokens:0,total_tokens:e.inputs.reduce((n,o)=>n+v(o),0)}}}}var ut=new Set(["batch"]),K=3600,Y=2592e3,me=1e4;function dn(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}async function cn(e,t){let n=typeof e.purpose=="string"?e.purpose:"";if(!n)return s(["body","purpose"],"Field required","missing");if(!ut.has(n))return s(["body","purpose"],`Purpose '${n}' is not supported; uploads are for the batch API`,"value_error");let o=typeof e.filename=="string"&&e.filename?e.filename:"";if(!o)return s(["body","file"],"Field required","missing");if(dn(o)!=="jsonl")return s(["body","file"],"DeepInfra file uploads must be .jsonl batch files","value_error");if(e.content===void 0||e.content===null||e.content==="")return s(["body","file"],"Field required","missing");if(typeof e.content!="string")return s(["body","file"],"Input should be a valid string","string_type");let i=e.content,r=Buffer.byteLength(i,"utf8"),u=e["expires_after[anchor]"],l=e["expires_after[seconds]"],c;if(u!==void 0||l!==void 0){if(u!==void 0&&u!=="created_at")return s(["body","expires_after","anchor"],"Anchor must be 'created_at'","value_error");let f=Number(l);if(!Number.isInteger(f)||f<K||f>Y)return s(["body","expires_after","seconds"],`Seconds must be between ${K} and ${Y}`,"value_error");c=P(t.occurredAt)+f}let a=tt("file",t.root);return await V(J,{operation:"file.create",subjectType:"file",subjectId:a,fields:{object:"file",bytes:r,created_at:P(t.occurredAt),filename:o,purpose:n,...c!==void 0?{expires_at:c}:{},_content:i},...t.occurredAt?{occurredAt:t.occurredAt}:{},actor:{kind:"agent"}},t.root),{status:200,body:xe($("file",a,t.root)??{})}}function xe(e){return{id:e.id,object:"file",bytes:e.bytes,created_at:e.created_at,filename:e.filename,purpose:e.purpose,...e.expires_at!==void 0?{expires_at:e.expires_at}:{}}}function fn(e,t){let n=e.get("purpose");if(n!==null&&!ut.has(n))return s(["query","purpose"],`Purpose '${n}' is not supported`,"value_error");let o=e.get("order");if(o!==null&&o!=="asc"&&o!=="desc")return s(["query","order"],"'order' must be 'asc' or 'desc'","value_error");let i=e.get("limit"),r=me;if(i!==null){let f=Number(i);if(!Number.isInteger(f)||f<1||f>me)return s(["query","limit"],`'limit' must be an integer between 1 and ${me}`,"value_error");r=f}let u=H("file",t).filter(f=>!f._deleted).map(xe);u.sort((f,_)=>Number(f.created_at)-Number(_.created_at)||String(f.id).localeCompare(String(_.id))),o==="desc"&&u.reverse();let l=e.get("after");if(l!==null){let f=u.findIndex(_=>_.id===l);if(f===-1)return s(["query","after"],`'after' cursor "${l}" is not a known file id`,"value_error");u=u.slice(f+1)}let c=u.length>r,a=u.slice(0,r);return{status:200,body:{object:"list",data:a,...a.length>0?{first_id:a[0].id,last_id:a[a.length-1].id}:{},has_more:c}}}var Ze=new Set(["/v1/chat/completions","/v1/completions","/v1/embeddings"]),he="24h";function Z(e){let t={id:e.id,object:"batch",endpoint:e.endpoint,input_file_id:e.input_file_id,completion_window:e.completion_window,status:e.status,output_file_id:e.output_file_id??null,error_file_id:e.error_file_id??null,created_at:e.created_at,in_progress_at:e.in_progress_at??null,expires_at:e.expires_at,finalizing_at:e.finalizing_at??null,completed_at:e.completed_at??null,failed_at:e.failed_at??null,expired_at:e.expired_at??null,cancelling_at:e.cancelling_at??null,cancelled_at:e.cancelled_at??null,request_counts:e.request_counts??{total:0,completed:0,failed:0},metadata:e.metadata??null,model:e.model??null,usage:e.usage??null};return e.output_expires_at!==void 0&&(t.output_expires_at=e.output_expires_at),e.errors!==void 0&&(t.errors=e.errors),t}async function pn(e,t){if(typeof e.input_file_id!="string"||!e.input_file_id)return s(["body","input_file_id"],"Field required","missing");if(typeof e.endpoint!="string"||!e.endpoint)return s(["body","endpoint"],"Field required","missing");if(!Ze.has(e.endpoint))return s(["body","endpoint"],`Input should be ${[...Ze].map(u=>`'${u}'`).join(" or ")}`,"enum");if(typeof e.completion_window!="string"||!e.completion_window)return s(["body","completion_window"],"Field required","missing");if(e.completion_window!==he)return s(["body","completion_window"],`Currently only '${he}' is supported`,"value_error");if(e.metadata!==void 0&&e.metadata!==null){if(typeof e.metadata!="object"||Array.isArray(e.metadata))return s(["body","metadata"],"Input should be a valid dictionary","model_type");for(let[u,l]of Object.entries(e.metadata))if(typeof l!="string")return s(["body","metadata",u],"Input should be a valid string","string_type")}let n=$("file",e.input_file_id,t.root);if(!n||n._deleted)return R(`No such file: ${e.input_file_id}`);let o;if(e.output_expires_after!==void 0&&e.output_expires_after!==null){let u=e.output_expires_after;if(u.anchor!==void 0&&u.anchor!=="created_at")return s(["body","output_expires_after","anchor"],"Anchor must be 'created_at'","value_error");let l=Number(u.seconds??2592e3);if(!Number.isInteger(l)||l<K||l>Y)return s(["body","output_expires_after","seconds"],`Seconds must be between ${K} and ${Y}`,"value_error");o=P(t.occurredAt)+l}let i=tt("batch",t.root),r=P(t.occurredAt);return await V(J,{operation:"batch.create",subjectType:"batch",subjectId:i,fields:{endpoint:e.endpoint,input_file_id:e.input_file_id,completion_window:he,status:"validating",created_at:r,expires_at:r+86400,request_counts:{total:0,completed:0,failed:0},...e.metadata!==void 0&&e.metadata!==null?{metadata:e.metadata}:{},...o!==void 0?{output_expires_at:o}:{}},...t.occurredAt?{occurredAt:t.occurredAt}:{},actor:{kind:"agent"}},t.root),{status:200,body:Z($("batch",i,t.root)??{})}}function mn(e,t){let n=H("batch",t).filter(l=>!l._deleted).map(Z);n.sort((l,c)=>Number(l.created_at)-Number(c.created_at)||String(l.id).localeCompare(String(c.id)));let o=e.get("after");if(o!==null){let l=n.findIndex(c=>c.id===o);if(l===-1)return s(["query","after"],`'after' cursor "${o}" is not a known batch id`,"value_error");n=n.slice(l+1)}let i=e.get("limit"),r=100;if(i!==null){let l=Number(i);if(!Number.isInteger(l)||l<1||l>1e3)return s(["query","limit"],"'limit' must be an integer between 1 and 1000","value_error");r=l}let u=n.length>r;return{status:200,body:{object:"list",data:n.slice(0,r),has_more:u}}}function hn(e){if(typeof e.model!="string"||!e.model)return s(["body","model"],"Field required","missing");if(!B(e.model))return s(["body","model"],`Model '${e.model}' not found`,"value_error");let t=typeof e.prompt=="string"&&e.prompt.length>0,n=Array.isArray(e.messages)&&e.messages.length>0;if(!t&&!n)return s(["body","prompt"],"either prompt or messages is required","missing");let o=t?e.prompt:e.messages.map(c=>I(c.content)).join(`
8
+ `),i=[];for(let c=0;c<o.length;c+=4)i.push(o.slice(c,c+4));let r=i.map((c,a)=>j(`${e.model}:${c}:${a}`)%15e4+1),u=B(e.model),l={count:r.length,max_model_len:u.metadata.context_length??4096,tokens:r};return e.return_token_strs===!0&&(l.token_strs=i),{status:200,body:l}}function _n(e){return typeof e.model!="string"||!e.model?s(["body","model"],"Field required","missing"):B(e.model)?!Array.isArray(e.tokens)||!e.tokens.every(t=>typeof t=="number"&&Number.isInteger(t))?s(["body","tokens"],"tokens must be an array of integers","list_type"):{status:200,body:{prompt:`[twin-stub:${e.model}] detokenize of ${e.tokens.length} token ids \u2014 the Deepinfra twin holds no vocabulary, so ids do not resolve to text`}}:s(["body","model"],`Model '${e.model}' not found`,"value_error")}async function ee(e){let t=e.method.toUpperCase();if(e.headers!==void 0||e.apiKey!==void 0){let n=Gt(e);if(n)return Bt(n,yn(e.path))}return ge(e,"x-twin-force-engine-overloaded")?et("triggered"):ge(e,"x-twin-force-rate-limit")?{status:429,body:W("Rate limit exceeded","rate_limit_exceeded")}:bn(e,t)}function yn(e){let t=(e.split("?")[0]??"").replace(/\/+$/,"")||"/",n=t.startsWith("/v1/")?t.slice(4):t,o=n.startsWith("openai/")?n.slice(7):n;return o==="chat/completions"||o==="completions"||o==="embeddings"||o==="models"?"openai":"native"}function gn(e,t,n){let o=decodeURIComponent(e.slice(_e.length+1));if(!o)return R(`No model name in the native inference path (${n} ${e}).`);if(n!=="POST")return Ut();let i=be(t.body);if("error"in i)return i.error;let r=i.params.input,u=i.params.inputs;if(r===void 0&&u===void 0)return s(["body"],"body must carry 'input' (TextGeneration) or 'inputs' (Embeddings)","value_error");if(!B(o))return{status:404,body:{error:`Model '${o}' not found`}};if(u!==void 0){let _=D(o,"inference-embeddings");if(_)return{status:400,body:{error:_}};if(!Array.isArray(u)||u.some(w=>typeof w!="string"))return s(["body","inputs"],"Input should be a valid list of strings","string_type");let E=u.reduce((w,h)=>w+v(h),0);return{status:200,body:{embeddings:u.map(w=>ue(`${o}:${w}`,ce(o))),input_tokens:E,request_id:`req-twin-${j(`emb:${o}:${u.join("\0")}`).toString(36)}`,inference_status:{status:"succeeded",runtime_ms:0,cost:0,tokens_generated:0,tokens_input:E}}}}if(typeof r!="string"||!r)return s(["body","input"],"Field required","missing");let l=D(o,"inference-text");if(l)return{status:400,body:{error:l}};let c=`[twin-stub:${o}] This is a deterministic stub from the Deepinfra twin (no model weights are run). Native inference echoing your input: ${r.slice(0,200)}`,a=v(r),f=v(c);return{status:200,body:{request_id:`req-twin-${j(`${o}:${r}`).toString(36)}`,inference_status:{status:"succeeded",runtime_ms:0,cost:0,tokens_generated:f,tokens_input:a},results:[{generated_text:c}],num_tokens:f,num_input_tokens:a}}}async function bn(e,t){let[n,o]=e.path.split("?"),i=(n??"/").replace(/\/+$/,"")||"/",r=new URLSearchParams(o??""),u=c=>decodeURIComponent(c);if(e.readOnly&&t!=="GET")return{status:405,body:W("twin is read-only; omit readOnly to accept writes")};if(i===_e||i.startsWith(`${_e}/`))return gn(i,e,t);if(i===Xe||i.startsWith(`${Xe}/`))return R(`The Deepinfra twin does not model the Anthropic-compatible surface (${t} ${i}) yet.`);let l="/v1/openai";return i===l||i.startsWith(`${l}/`)?G(i.slice(l.length)||"/",r,e,t,u):xn(i,r,e,t,u)}async function G(e,t,n,o,i){let r=e.replace(/^\/+/,"").split("/").filter(Boolean),u=o==="GET"||o==="DELETE"?{params:{}}:be(n.body);if("error"in u)return u.error;let l=u.params;if(r[0]==="models"&&r.length===1&&o==="GET")return{status:200,body:{object:"list",data:Wt(n.root)}};if(r[0]==="chat"&&r[1]==="completions"&&r.length===2&&o==="POST"){let c=en(l);if("error"in c)return c.error;let a=c.args;if(a.stream&&!n.sseSink)return s(["body","stream"],"'stream' was requested but this caller supplied no SSE sink; the twin refuses to answer a streaming request with a unary body","value_error");if(a.failFast&&ge(n,"x-twin-fail-fast-busy"))return et(a.model);let f;if(n.scenarioEngine){let E=await n.scenarioEngine.serve({model:a.model,messages:a.messages,tools:a.tools,reasoningEffort:a.reasoningEffort,serviceTier:a.serviceTier,failFast:a.failFast});if(E.kind==="fault")return{status:E.result.status,body:E.result.body,headers:E.result.headers};f=E}let _=a.stream&&n.sseSink?rn(a,n.sseSink,n.occurredAt,f):lt(a,n.occurredAt,f);return on(_)?_:{status:200,body:_}}if(r[0]==="completions"&&r.length===1&&o==="POST"){let c=sn(l);return"error"in c?c.error:{status:200,body:an(c.args,n.occurredAt)}}if(r[0]==="embeddings"&&r.length===1&&o==="POST"){let c=ln(l);return"error"in c?c.error:un(c.args)}return ye()}async function xn(e,t,n,o,i){if(!e.startsWith("/v1/")&&e!=="/v1")return ye();let r=e.slice(3).replace(/^\/+/,"").split("/").filter(Boolean);if(r.length===1&&r[0]==="completions"&&o==="POST")return G("/completions",t,n,o,i);if(r.length===1&&r[0]==="embeddings"&&o==="POST")return G("/embeddings",t,n,o,i);if(r.length===1&&r[0]==="models"&&o==="GET")return G("/models",t,n,o,i);if(r.length===2&&r[0]==="chat"&&r[1]==="completions"&&o==="POST")return G("/chat/completions",t,n,o,i);let l=o==="GET"||o==="DELETE"||o==="POST"&&r.length===3&&r[2]==="cancel"?{params:{}}:be(n.body);if("error"in l)return l.error;let c=l.params;if(r[0]==="files"&&r.length===1&&o==="POST")return cn(c,n);if(r[0]==="files"&&r.length===1&&o==="GET")return fn(t,n.root);if(r[0]==="files"&&r.length===2&&o==="GET"){let a=$("file",i(r[1]),n.root);return a&&!a._deleted?{status:200,body:xe(a)}:R(`No such File object: ${i(r[1])}`)}if(r[0]==="files"&&r.length===3&&r[2]==="content"&&o==="GET"){let a=$("file",i(r[1]),n.root);return!a||a._deleted?R(`No such File object: ${i(r[1])}`):typeof a._content!="string"?R(`No content stored for File object ${i(r[1])} \u2014 it was observed by a pull, not uploaded here`):{status:200,body:a._content}}if(r[0]==="files"&&r.length===2&&o==="DELETE"){let a=i(r[1]),f=$("file",a,n.root);return!f||f._deleted?R(`No such File object: ${a}`):(await V(J,{operation:"file.delete",subjectType:"file",subjectId:a,fields:{_deleted:!0,object:"file"},...n.occurredAt?{occurredAt:n.occurredAt}:{},actor:{kind:"agent"}},n.root),{status:200,body:{id:a,object:"file",deleted:!0}})}if(r[0]==="batches"&&r.length===1&&o==="POST")return pn(c,n);if(r[0]==="batches"&&r.length===1&&o==="GET")return mn(t,n.root);if(r[0]==="batches"&&r.length===2&&o==="GET"){let a=$("batch",i(r[1]),n.root);return a&&!a._deleted?{status:200,body:Z(a)}:R(`No such Batch object: ${i(r[1])}`)}if(r[0]==="batches"&&r.length===3&&r[2]==="cancel"&&o==="POST"){let a=i(r[1]),f=$("batch",a,n.root);return!f||f._deleted?R(`No such Batch object: ${a}`):f.status!=="validating"&&f.status!=="in_progress"?s(["path","batch_id"],`Cannot cancel a batch in status '${f.status}'`,"value_error"):(await V(J,{operation:"batch.cancel",subjectType:"batch",subjectId:a,fields:{status:"cancelling",cancelling_at:P(n.occurredAt)},...n.occurredAt?{occurredAt:n.occurredAt}:{},actor:{kind:"agent"}},n.root),{status:200,body:Z($("batch",a,n.root)??{})})}return r[0]==="tokenize"&&r.length===1&&o==="POST"?hn(c):r[0]==="detokenize"&&r.length===1&&o==="POST"?_n(c):r[0]==="me"&&r[1]==="rate_limit"&&r.length===2&&o==="GET"?{status:200,body:Ht(n.root)}:ye()}import{serveHttp as eo,twinManifest as En,worldNow as dt}from"../../engine/v2/volter_world-core.mjs";function wn(e){if(!e)return!1;try{return JSON.parse(e)?.stream===!0}catch{return!1}}function vn(e){return e.done?`data: [DONE]
9
+
10
+ `:`data: ${JSON.stringify(e.data)}
11
+
12
+ `}var Sn=new Set(["/v1/openai/chat/completions","/v1/chat/completions"]);async function Tn(e){try{let t=await e.formData(),n={};for(let[i,r]of t.entries())if(typeof r=="string")if(i.endsWith("[]")){let u=i.slice(0,-2),l=n[u];n[u]=Array.isArray(l)?[...l,r]:[r]}else n[i]=r;let o=t.get("file");if(o instanceof File){let i=new Uint8Array(await o.arrayBuffer());n.file=o.name||"upload",n.filename=o.name||"upload",n.content=new TextDecoder().decode(i),n.bytes=i.length}return JSON.stringify(n)}catch{return"{}"}}function ct(e){let t=e.readOnly??!1,n=e.scenarioPath??process.env.TWIN_DEEPINFRA_SCENARIO,o=n?ze(He(n)):void 0;return async function(r){let u=new URL(r.url);if(r.method==="GET"&&u.pathname.replace(/\/+$/,"")==="/twin")return Response.json(En({vendor:"deepinfra",twinOf:"DeepInfra API (OpenAI-compatible surface under /v1/openai; native /v1/inference and /anthropic surfaces unmodeled)",stateSentence:"Seed batch files through the ordinary API (POST /v1/files, multipart, purpose=batch) with any bearer key; batches are created from those real files and cancel through their own door.",behaviorSentence:"Chat completions are scripted by MSW-shaped handlers in the world dir (handlers/deepinfra.json): {on:{userTextIncludes|anyTextIncludes|modelEquals|hasTool|toolResultFor|lastMessageIsToolResult|reasoningEffortEquals|serviceTierEquals|failFastEquals}, respond:{text|reasoning|toolCalls, finishReason?} | fault:{kind:slow|status|drop, ...}, once?, phase?}. Unmatched requests answer a labeled stub naming this door.",exampleHandler:{on:{userTextIncludes:"summarize",hasTool:"search_docs"},respond:{text:"Scripted summary."},once:!0},engine:o}));if(r.method==="GET"&&u.pathname.replace(/\/+$/,"")==="/twin/scenario")return Response.json(o?o.status():{vendor:"deepinfra",handlers:[],misses:0,recentMisses:[]});let l=u.pathname+(u.search||""),c=u.pathname.replace(/\/{2,}/g,"/").replace(/\/+$/,""),a=r.headers.get("content-type")??"",f={};for(let p of["authorization","x-twin-force-rate-limit","x-twin-force-engine-overloaded","x-twin-fail-fast-busy"]){let g=r.headers.get(p);g!==null&&(f[p]=g)}let _="";if(r.method!=="GET"&&(_=a.includes("multipart/form-data")?await Tn(r):await r.text()),!t&&r.method.toUpperCase()==="POST"&&Sn.has(c)&&wn(_)){let p=[],{status:g,body:y,headers:x}=await ee({...o?{scenarioEngine:o}:{},method:r.method,path:l,body:_,readOnly:t,occurredAt:dt(),headers:f,...e.root!==void 0?{root:e.root}:{},sseSink:S=>p.push(S)});if(g>=400)return new Response(JSON.stringify(y),{status:g,headers:{"content-type":"application/json",...x??{}}});let T=new ReadableStream({start(S){let N=new TextEncoder;for(let U of p)S.enqueue(N.encode(vn(U)));S.close()}});return new Response(T,{headers:{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-cache"}})}let E,w,h;try{let p=await ee({...o?{scenarioEngine:o}:{},method:r.method,path:l,body:_,readOnly:t,occurredAt:dt(),headers:f,...e.root!==void 0?{root:e.root}:{}});E=p.status,w=p.body,h=p.headers}catch(p){return new Response(JSON.stringify({error:{message:`twin handler error: ${p instanceof Error?p.message:String(p)}`,type:"invalid_request_error",param:null,code:null}}),{status:500,headers:{"content-type":"application/json"}})}return r.method==="GET"&&/\/files\/[^/]+\/content$/.test(new URL(r.url).pathname)&&typeof w=="string"?new Response(w,{status:E,headers:{"content-type":"application/octet-stream",...h??{}}}):new Response(JSON.stringify(w),{status:E,headers:{"content-type":"application/json",...h??{}}})}}var In={vendor:"deepinfra",protocol:"2",refresh:{every:"30m",onDemand:{atMost:"60s"}},stateSystem:{perform:Oe,refresh:Ne},roundTrip:{method:"POST",path:"/v1/files",body:{purpose:"batch",filename:"round-trip.jsonl",content:`{"body":{}}
13
+ `,bytes:12},headers:{authorization:"Bearer round-trip"}},parityOrigin:"http://twin",rateBudget:re,transport:"rest",archetype:"generative",bin:"world-deepinfra",resources:["model","file","batch","rate_limit"],resourcesUnreachable:{model:"the vendor catalog",rate_limit:"the account ledger the vendor keeps; read-only"},specSource:"DeepInfra first-party OpenAPI (https://api.deepinfra.com/openapi.json, fetched 2026-09-16; 131 paths) plus the live public catalog (https://api.deepinfra.com/v1/models, read 2026-09-16) and live 401 probes of /v1/openai/chat/completions (auth-before-validation, four-key error envelope).",description:"DeepInfra OpenAI-compatible twin: chat/completions, completions, embeddings, models, files, batches, tokenize/detokenize and /v1/me/rate_limit with the vendor\u2019s own divergences enforced (n\u22644, regex response_format, fail_fast 429 engine_overloaded, /v1/openai base, four-key error envelope). Inference returns a labeled deterministic stub \u2014 no model weights are run; the native /v1/inference and /anthropic surfaces fail loudly as unmodeled.",adoption:{sdks:["deepinfra","@ai-sdk/deepinfra"],envStems:["DEEPINFRA"]},hosts:[{host:"api.deepinfra.com"}],endpointEnvNone:"the deepinfra SDK exposes no base-URL env: DeepInfraClient takes the endpoint URL as a constructor argument (the modelName IS the full URL) and reads only DEEPINFRA_API_KEY; interception is the hosts above."};An(In);export{ct 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-deepseek
2
+
3
+ Contains @volter/twin-deepseek 0.1.37 by Volter (https://github.com/volter-ai),
4
+ licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Modified by AgentTwin: bundled and minified into one file; only code reachable from the pack's
7
+ fetch factory is included; shared modules are imported from the AgentTwin twin engine.