@nodetool-ai/agents 0.7.0-rc.23 → 0.8.1

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 (1554) hide show
  1. package/README.md +35 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/analysis/audio-dsp.d.ts +223 -0
  4. package/dist/analysis/audio-dsp.d.ts.map +1 -0
  5. package/dist/analysis/audio-dsp.js +642 -0
  6. package/dist/analysis/audio-dsp.js.map +1 -0
  7. package/dist/analysis/media-decode.d.ts +85 -0
  8. package/dist/analysis/media-decode.d.ts.map +1 -0
  9. package/dist/analysis/media-decode.js +199 -0
  10. package/dist/analysis/media-decode.js.map +1 -0
  11. package/dist/analysis/mediabunny-runtime.d.ts +15 -0
  12. package/dist/analysis/mediabunny-runtime.d.ts.map +1 -0
  13. package/dist/analysis/mediabunny-runtime.js +30 -0
  14. package/dist/analysis/mediabunny-runtime.js.map +1 -0
  15. package/dist/analysis/video-frames.d.ts +120 -0
  16. package/dist/analysis/video-frames.d.ts.map +1 -0
  17. package/dist/analysis/video-frames.js +288 -0
  18. package/dist/analysis/video-frames.js.map +1 -0
  19. package/dist/apify/assets.d.ts +80 -0
  20. package/dist/apify/assets.d.ts.map +1 -0
  21. package/dist/apify/assets.js +192 -0
  22. package/dist/apify/assets.js.map +1 -0
  23. package/dist/apify/catalog.d.ts +44 -0
  24. package/dist/apify/catalog.d.ts.map +1 -0
  25. package/dist/apify/catalog.js +108 -0
  26. package/dist/apify/catalog.js.map +1 -0
  27. package/dist/apify/client.d.ts +137 -0
  28. package/dist/apify/client.d.ts.map +1 -0
  29. package/dist/apify/client.js +346 -0
  30. package/dist/apify/client.js.map +1 -0
  31. package/dist/apify/errors.d.ts +85 -0
  32. package/dist/apify/errors.d.ts.map +1 -0
  33. package/dist/apify/errors.js +90 -0
  34. package/dist/apify/errors.js.map +1 -0
  35. package/dist/apify/normalize.d.ts +131 -0
  36. package/dist/apify/normalize.d.ts.map +1 -0
  37. package/dist/apify/normalize.js +202 -0
  38. package/dist/apify/normalize.js.map +1 -0
  39. package/dist/apify/policy.d.ts +136 -0
  40. package/dist/apify/policy.d.ts.map +1 -0
  41. package/dist/apify/policy.js +223 -0
  42. package/dist/apify/policy.js.map +1 -0
  43. package/dist/apify/run.d.ts +86 -0
  44. package/dist/apify/run.d.ts.map +1 -0
  45. package/dist/apify/run.js +158 -0
  46. package/dist/apify/run.js.map +1 -0
  47. package/dist/app-build/author.d.ts +67 -0
  48. package/dist/app-build/author.d.ts.map +1 -0
  49. package/dist/app-build/author.js +231 -0
  50. package/dist/app-build/author.js.map +1 -0
  51. package/dist/app-build/bridge.d.ts +130 -0
  52. package/dist/app-build/bridge.d.ts.map +1 -0
  53. package/dist/app-build/bridge.js +647 -0
  54. package/dist/app-build/bridge.js.map +1 -0
  55. package/dist/app-build/build-service.d.ts +66 -0
  56. package/dist/app-build/build-service.d.ts.map +1 -0
  57. package/dist/app-build/build-service.js +249 -0
  58. package/dist/app-build/build-service.js.map +1 -0
  59. package/dist/app-build/build.d.ts +115 -0
  60. package/dist/app-build/build.d.ts.map +1 -0
  61. package/dist/app-build/build.js +901 -0
  62. package/dist/app-build/build.js.map +1 -0
  63. package/dist/app-build/interactions.d.ts +20 -0
  64. package/dist/app-build/interactions.d.ts.map +1 -0
  65. package/dist/app-build/interactions.js +121 -0
  66. package/dist/app-build/interactions.js.map +1 -0
  67. package/dist/app-build/judge.d.ts +113 -0
  68. package/dist/app-build/judge.d.ts.map +1 -0
  69. package/dist/app-build/judge.js +318 -0
  70. package/dist/app-build/judge.js.map +1 -0
  71. package/dist/app-build/markdown.d.ts +10 -0
  72. package/dist/app-build/markdown.d.ts.map +1 -0
  73. package/dist/app-build/markdown.js +65 -0
  74. package/dist/app-build/markdown.js.map +1 -0
  75. package/dist/app-build/spec.d.ts +228 -0
  76. package/dist/app-build/spec.d.ts.map +1 -0
  77. package/dist/app-build/spec.js +651 -0
  78. package/dist/app-build/spec.js.map +1 -0
  79. package/dist/app-build/tool-loop.d.ts +84 -0
  80. package/dist/app-build/tool-loop.d.ts.map +1 -0
  81. package/dist/app-build/tool-loop.js +113 -0
  82. package/dist/app-build/tool-loop.js.map +1 -0
  83. package/dist/app-build/types.d.ts +215 -0
  84. package/dist/app-build/types.d.ts.map +1 -0
  85. package/dist/app-build/types.js +28 -0
  86. package/dist/app-build/types.js.map +1 -0
  87. package/dist/author-graph.d.ts +91 -0
  88. package/dist/author-graph.d.ts.map +1 -0
  89. package/dist/author-graph.js +319 -0
  90. package/dist/author-graph.js.map +1 -0
  91. package/dist/background-subtasks.d.ts +79 -0
  92. package/dist/background-subtasks.d.ts.map +1 -0
  93. package/dist/background-subtasks.js +139 -0
  94. package/dist/background-subtasks.js.map +1 -0
  95. package/dist/blender-gate.d.ts +21 -0
  96. package/dist/blender-gate.d.ts.map +1 -0
  97. package/dist/blender-gate.js +27 -0
  98. package/dist/blender-gate.js.map +1 -0
  99. package/dist/browser-gate.d.ts +28 -0
  100. package/dist/browser-gate.d.ts.map +1 -0
  101. package/dist/browser-gate.js +34 -0
  102. package/dist/browser-gate.js.map +1 -0
  103. package/dist/capabilities/adapters.d.ts +36 -0
  104. package/dist/capabilities/adapters.d.ts.map +1 -0
  105. package/dist/capabilities/adapters.js +44 -0
  106. package/dist/capabilities/adapters.js.map +1 -0
  107. package/dist/capabilities/agents.d.ts +78 -0
  108. package/dist/capabilities/agents.d.ts.map +1 -0
  109. package/dist/capabilities/agents.js +366 -0
  110. package/dist/capabilities/agents.js.map +1 -0
  111. package/dist/capabilities/agents.specs.d.ts +27 -0
  112. package/dist/capabilities/agents.specs.d.ts.map +1 -0
  113. package/dist/capabilities/agents.specs.js +243 -0
  114. package/dist/capabilities/agents.specs.js.map +1 -0
  115. package/dist/capabilities/analysis.d.ts +93 -0
  116. package/dist/capabilities/analysis.d.ts.map +1 -0
  117. package/dist/capabilities/analysis.js +812 -0
  118. package/dist/capabilities/analysis.js.map +1 -0
  119. package/dist/capabilities/analysis.specs.d.ts +39 -0
  120. package/dist/capabilities/analysis.specs.d.ts.map +1 -0
  121. package/dist/capabilities/analysis.specs.js +217 -0
  122. package/dist/capabilities/analysis.specs.js.map +1 -0
  123. package/dist/capabilities/apify.d.ts +34 -0
  124. package/dist/capabilities/apify.d.ts.map +1 -0
  125. package/dist/capabilities/apify.js +449 -0
  126. package/dist/capabilities/apify.js.map +1 -0
  127. package/dist/capabilities/apify.specs.d.ts +28 -0
  128. package/dist/capabilities/apify.specs.d.ts.map +1 -0
  129. package/dist/capabilities/apify.specs.js +232 -0
  130. package/dist/capabilities/apify.specs.js.map +1 -0
  131. package/dist/capabilities/apps.d.ts +40 -0
  132. package/dist/capabilities/apps.d.ts.map +1 -0
  133. package/dist/capabilities/apps.js +413 -0
  134. package/dist/capabilities/apps.js.map +1 -0
  135. package/dist/capabilities/apps.specs.d.ts +23 -0
  136. package/dist/capabilities/apps.specs.d.ts.map +1 -0
  137. package/dist/capabilities/apps.specs.js +236 -0
  138. package/dist/capabilities/apps.specs.js.map +1 -0
  139. package/dist/capabilities/args.d.ts +65 -0
  140. package/dist/capabilities/args.d.ts.map +1 -0
  141. package/dist/capabilities/args.js +218 -0
  142. package/dist/capabilities/args.js.map +1 -0
  143. package/dist/capabilities/assets.d.ts +45 -0
  144. package/dist/capabilities/assets.d.ts.map +1 -0
  145. package/dist/capabilities/assets.js +952 -0
  146. package/dist/capabilities/assets.js.map +1 -0
  147. package/dist/capabilities/assets.specs.d.ts +54 -0
  148. package/dist/capabilities/assets.specs.d.ts.map +1 -0
  149. package/dist/capabilities/assets.specs.js +291 -0
  150. package/dist/capabilities/assets.specs.js.map +1 -0
  151. package/dist/capabilities/background-generation.d.ts +14 -0
  152. package/dist/capabilities/background-generation.d.ts.map +1 -0
  153. package/dist/capabilities/background-generation.js +29 -0
  154. package/dist/capabilities/background-generation.js.map +1 -0
  155. package/dist/capabilities/browser.d.ts +30 -0
  156. package/dist/capabilities/browser.d.ts.map +1 -0
  157. package/dist/capabilities/browser.js +250 -0
  158. package/dist/capabilities/browser.js.map +1 -0
  159. package/dist/capabilities/browser.specs.d.ts +37 -0
  160. package/dist/capabilities/browser.specs.d.ts.map +1 -0
  161. package/dist/capabilities/browser.specs.js +173 -0
  162. package/dist/capabilities/browser.specs.js.map +1 -0
  163. package/dist/capabilities/code-grading.d.ts +68 -0
  164. package/dist/capabilities/code-grading.d.ts.map +1 -0
  165. package/dist/capabilities/code-grading.js +75 -0
  166. package/dist/capabilities/code-grading.js.map +1 -0
  167. package/dist/capabilities/code.d.ts +56 -0
  168. package/dist/capabilities/code.d.ts.map +1 -0
  169. package/dist/capabilities/code.js +327 -0
  170. package/dist/capabilities/code.js.map +1 -0
  171. package/dist/capabilities/code.specs.d.ts +22 -0
  172. package/dist/capabilities/code.specs.d.ts.map +1 -0
  173. package/dist/capabilities/code.specs.js +175 -0
  174. package/dist/capabilities/code.specs.js.map +1 -0
  175. package/dist/capabilities/collections.d.ts +44 -0
  176. package/dist/capabilities/collections.d.ts.map +1 -0
  177. package/dist/capabilities/collections.js +432 -0
  178. package/dist/capabilities/collections.js.map +1 -0
  179. package/dist/capabilities/collections.specs.d.ts +25 -0
  180. package/dist/capabilities/collections.specs.d.ts.map +1 -0
  181. package/dist/capabilities/collections.specs.js +299 -0
  182. package/dist/capabilities/collections.specs.js.map +1 -0
  183. package/dist/capabilities/compositions.d.ts +57 -0
  184. package/dist/capabilities/compositions.d.ts.map +1 -0
  185. package/dist/capabilities/compositions.js +384 -0
  186. package/dist/capabilities/compositions.js.map +1 -0
  187. package/dist/capabilities/compositions.specs.d.ts +22 -0
  188. package/dist/capabilities/compositions.specs.d.ts.map +1 -0
  189. package/dist/capabilities/compositions.specs.js +126 -0
  190. package/dist/capabilities/compositions.specs.js.map +1 -0
  191. package/dist/capabilities/concurrency.d.ts +12 -0
  192. package/dist/capabilities/concurrency.d.ts.map +1 -0
  193. package/dist/capabilities/concurrency.js +30 -0
  194. package/dist/capabilities/concurrency.js.map +1 -0
  195. package/dist/capabilities/costs.d.ts +20 -0
  196. package/dist/capabilities/costs.d.ts.map +1 -0
  197. package/dist/capabilities/costs.js +40 -0
  198. package/dist/capabilities/costs.js.map +1 -0
  199. package/dist/capabilities/costs.specs.d.ts +12 -0
  200. package/dist/capabilities/costs.specs.d.ts.map +1 -0
  201. package/dist/capabilities/costs.specs.js +35 -0
  202. package/dist/capabilities/costs.specs.js.map +1 -0
  203. package/dist/capabilities/dispatcher.d.ts +57 -0
  204. package/dist/capabilities/dispatcher.d.ts.map +1 -0
  205. package/dist/capabilities/dispatcher.js +117 -0
  206. package/dist/capabilities/dispatcher.js.map +1 -0
  207. package/dist/capabilities/documents.d.ts +25 -0
  208. package/dist/capabilities/documents.d.ts.map +1 -0
  209. package/dist/capabilities/documents.js +278 -0
  210. package/dist/capabilities/documents.js.map +1 -0
  211. package/dist/capabilities/documents.specs.d.ts +18 -0
  212. package/dist/capabilities/documents.specs.d.ts.map +1 -0
  213. package/dist/capabilities/documents.specs.js +201 -0
  214. package/dist/capabilities/documents.specs.js.map +1 -0
  215. package/dist/capabilities/email.d.ts +23 -0
  216. package/dist/capabilities/email.d.ts.map +1 -0
  217. package/dist/capabilities/email.js +226 -0
  218. package/dist/capabilities/email.js.map +1 -0
  219. package/dist/capabilities/email.specs.d.ts +16 -0
  220. package/dist/capabilities/email.specs.d.ts.map +1 -0
  221. package/dist/capabilities/email.specs.js +102 -0
  222. package/dist/capabilities/email.specs.js.map +1 -0
  223. package/dist/capabilities/entities.d.ts +52 -0
  224. package/dist/capabilities/entities.d.ts.map +1 -0
  225. package/dist/capabilities/entities.js +478 -0
  226. package/dist/capabilities/entities.js.map +1 -0
  227. package/dist/capabilities/entities.specs.d.ts +25 -0
  228. package/dist/capabilities/entities.specs.d.ts.map +1 -0
  229. package/dist/capabilities/entities.specs.js +247 -0
  230. package/dist/capabilities/entities.specs.js.map +1 -0
  231. package/dist/capabilities/example-timelines.d.ts +3 -0
  232. package/dist/capabilities/example-timelines.d.ts.map +1 -0
  233. package/dist/capabilities/example-timelines.js +191 -0
  234. package/dist/capabilities/example-timelines.js.map +1 -0
  235. package/dist/capabilities/example-timelines.specs.d.ts +5 -0
  236. package/dist/capabilities/example-timelines.specs.d.ts.map +1 -0
  237. package/dist/capabilities/example-timelines.specs.js +53 -0
  238. package/dist/capabilities/example-timelines.specs.js.map +1 -0
  239. package/dist/capabilities/files.d.ts +53 -0
  240. package/dist/capabilities/files.d.ts.map +1 -0
  241. package/dist/capabilities/files.js +1172 -0
  242. package/dist/capabilities/files.js.map +1 -0
  243. package/dist/capabilities/files.specs.d.ts +28 -0
  244. package/dist/capabilities/files.specs.d.ts.map +1 -0
  245. package/dist/capabilities/files.specs.js +259 -0
  246. package/dist/capabilities/files.specs.js.map +1 -0
  247. package/dist/capabilities/flow.d.ts +93 -0
  248. package/dist/capabilities/flow.d.ts.map +1 -0
  249. package/dist/capabilities/flow.js +285 -0
  250. package/dist/capabilities/flow.js.map +1 -0
  251. package/dist/capabilities/flow.specs.d.ts +25 -0
  252. package/dist/capabilities/flow.specs.d.ts.map +1 -0
  253. package/dist/capabilities/flow.specs.js +114 -0
  254. package/dist/capabilities/flow.specs.js.map +1 -0
  255. package/dist/capabilities/game-asset-source.d.ts +31 -0
  256. package/dist/capabilities/game-asset-source.d.ts.map +1 -0
  257. package/dist/capabilities/game-asset-source.js +81 -0
  258. package/dist/capabilities/game-asset-source.js.map +1 -0
  259. package/dist/capabilities/game.d.ts +12 -0
  260. package/dist/capabilities/game.d.ts.map +1 -0
  261. package/dist/capabilities/game.js +1262 -0
  262. package/dist/capabilities/game.js.map +1 -0
  263. package/dist/capabilities/game.specs.d.ts +3 -0
  264. package/dist/capabilities/game.specs.d.ts.map +1 -0
  265. package/dist/capabilities/game.specs.js +96 -0
  266. package/dist/capabilities/game.specs.js.map +1 -0
  267. package/dist/capabilities/gate-from-context.d.ts +39 -0
  268. package/dist/capabilities/gate-from-context.d.ts.map +1 -0
  269. package/dist/capabilities/gate-from-context.js +97 -0
  270. package/dist/capabilities/gate-from-context.js.map +1 -0
  271. package/dist/capabilities/gate-tools.d.ts +18 -0
  272. package/dist/capabilities/gate-tools.d.ts.map +1 -0
  273. package/dist/capabilities/gate-tools.js +66 -0
  274. package/dist/capabilities/gate-tools.js.map +1 -0
  275. package/dist/capabilities/generations.d.ts +79 -0
  276. package/dist/capabilities/generations.d.ts.map +1 -0
  277. package/dist/capabilities/generations.js +382 -0
  278. package/dist/capabilities/generations.js.map +1 -0
  279. package/dist/capabilities/generations.specs.d.ts +62 -0
  280. package/dist/capabilities/generations.specs.d.ts.map +1 -0
  281. package/dist/capabilities/generations.specs.js +230 -0
  282. package/dist/capabilities/generations.specs.js.map +1 -0
  283. package/dist/capabilities/google.d.ts +50 -0
  284. package/dist/capabilities/google.d.ts.map +1 -0
  285. package/dist/capabilities/google.js +246 -0
  286. package/dist/capabilities/google.js.map +1 -0
  287. package/dist/capabilities/google.specs.d.ts +52 -0
  288. package/dist/capabilities/google.specs.d.ts.map +1 -0
  289. package/dist/capabilities/google.specs.js +391 -0
  290. package/dist/capabilities/google.specs.js.map +1 -0
  291. package/dist/capabilities/html-text.d.ts +28 -0
  292. package/dist/capabilities/html-text.d.ts.map +1 -0
  293. package/dist/capabilities/html-text.js +76 -0
  294. package/dist/capabilities/html-text.js.map +1 -0
  295. package/dist/capabilities/index.d.ts +19 -0
  296. package/dist/capabilities/index.d.ts.map +1 -0
  297. package/dist/capabilities/index.js +14 -0
  298. package/dist/capabilities/index.js.map +1 -0
  299. package/dist/capabilities/invoke.d.ts +89 -0
  300. package/dist/capabilities/invoke.d.ts.map +1 -0
  301. package/dist/capabilities/invoke.js +214 -0
  302. package/dist/capabilities/invoke.js.map +1 -0
  303. package/dist/capabilities/jobs.d.ts +32 -0
  304. package/dist/capabilities/jobs.d.ts.map +1 -0
  305. package/dist/capabilities/jobs.js +123 -0
  306. package/dist/capabilities/jobs.js.map +1 -0
  307. package/dist/capabilities/jobs.specs.d.ts +20 -0
  308. package/dist/capabilities/jobs.specs.d.ts.map +1 -0
  309. package/dist/capabilities/jobs.specs.js +103 -0
  310. package/dist/capabilities/jobs.specs.js.map +1 -0
  311. package/dist/capabilities/js-scripts.d.ts +90 -0
  312. package/dist/capabilities/js-scripts.d.ts.map +1 -0
  313. package/dist/capabilities/js-scripts.js +700 -0
  314. package/dist/capabilities/js-scripts.js.map +1 -0
  315. package/dist/capabilities/js-scripts.specs.d.ts +50 -0
  316. package/dist/capabilities/js-scripts.specs.d.ts.map +1 -0
  317. package/dist/capabilities/js-scripts.specs.js +344 -0
  318. package/dist/capabilities/js-scripts.specs.js.map +1 -0
  319. package/dist/capabilities/lazy-tool.d.ts +42 -0
  320. package/dist/capabilities/lazy-tool.d.ts.map +1 -0
  321. package/dist/capabilities/lazy-tool.js +88 -0
  322. package/dist/capabilities/lazy-tool.js.map +1 -0
  323. package/dist/capabilities/local-browser.d.ts +24 -0
  324. package/dist/capabilities/local-browser.d.ts.map +1 -0
  325. package/dist/capabilities/local-browser.js +105 -0
  326. package/dist/capabilities/local-browser.js.map +1 -0
  327. package/dist/capabilities/media.d.ts +121 -0
  328. package/dist/capabilities/media.d.ts.map +1 -0
  329. package/dist/capabilities/media.js +2217 -0
  330. package/dist/capabilities/media.js.map +1 -0
  331. package/dist/capabilities/media.specs.d.ts +65 -0
  332. package/dist/capabilities/media.specs.d.ts.map +1 -0
  333. package/dist/capabilities/media.specs.js +779 -0
  334. package/dist/capabilities/media.specs.js.map +1 -0
  335. package/dist/capabilities/memory.d.ts +31 -0
  336. package/dist/capabilities/memory.d.ts.map +1 -0
  337. package/dist/capabilities/memory.js +403 -0
  338. package/dist/capabilities/memory.js.map +1 -0
  339. package/dist/capabilities/memory.specs.d.ts +55 -0
  340. package/dist/capabilities/memory.specs.d.ts.map +1 -0
  341. package/dist/capabilities/memory.specs.js +208 -0
  342. package/dist/capabilities/memory.specs.js.map +1 -0
  343. package/dist/capabilities/model3d.d.ts +29 -0
  344. package/dist/capabilities/model3d.d.ts.map +1 -0
  345. package/dist/capabilities/model3d.js +482 -0
  346. package/dist/capabilities/model3d.js.map +1 -0
  347. package/dist/capabilities/model3d.specs.d.ts +28 -0
  348. package/dist/capabilities/model3d.specs.d.ts.map +1 -0
  349. package/dist/capabilities/model3d.specs.js +305 -0
  350. package/dist/capabilities/model3d.specs.js.map +1 -0
  351. package/dist/capabilities/models.d.ts +138 -0
  352. package/dist/capabilities/models.d.ts.map +1 -0
  353. package/dist/capabilities/models.js +803 -0
  354. package/dist/capabilities/models.js.map +1 -0
  355. package/dist/capabilities/models.specs.d.ts +21 -0
  356. package/dist/capabilities/models.specs.d.ts.map +1 -0
  357. package/dist/capabilities/models.specs.js +141 -0
  358. package/dist/capabilities/models.specs.js.map +1 -0
  359. package/dist/capabilities/nodes.d.ts +26 -0
  360. package/dist/capabilities/nodes.d.ts.map +1 -0
  361. package/dist/capabilities/nodes.js +266 -0
  362. package/dist/capabilities/nodes.js.map +1 -0
  363. package/dist/capabilities/nodes.specs.d.ts +20 -0
  364. package/dist/capabilities/nodes.specs.d.ts.map +1 -0
  365. package/dist/capabilities/nodes.specs.js +106 -0
  366. package/dist/capabilities/nodes.specs.js.map +1 -0
  367. package/dist/capabilities/packs.d.ts +69 -0
  368. package/dist/capabilities/packs.d.ts.map +1 -0
  369. package/dist/capabilities/packs.js +246 -0
  370. package/dist/capabilities/packs.js.map +1 -0
  371. package/dist/capabilities/packs.specs.d.ts +27 -0
  372. package/dist/capabilities/packs.specs.d.ts.map +1 -0
  373. package/dist/capabilities/packs.specs.js +64 -0
  374. package/dist/capabilities/packs.specs.js.map +1 -0
  375. package/dist/capabilities/project-scope.d.ts +12 -0
  376. package/dist/capabilities/project-scope.d.ts.map +1 -0
  377. package/dist/capabilities/project-scope.js +19 -0
  378. package/dist/capabilities/project-scope.js.map +1 -0
  379. package/dist/capabilities/projects.d.ts +23 -0
  380. package/dist/capabilities/projects.d.ts.map +1 -0
  381. package/dist/capabilities/projects.js +206 -0
  382. package/dist/capabilities/projects.js.map +1 -0
  383. package/dist/capabilities/projects.specs.d.ts +23 -0
  384. package/dist/capabilities/projects.specs.d.ts.map +1 -0
  385. package/dist/capabilities/projects.specs.js +118 -0
  386. package/dist/capabilities/projects.specs.js.map +1 -0
  387. package/dist/capabilities/registry.d.ts +109 -0
  388. package/dist/capabilities/registry.d.ts.map +1 -0
  389. package/dist/capabilities/registry.js +445 -0
  390. package/dist/capabilities/registry.js.map +1 -0
  391. package/dist/capabilities/script-link.d.ts +22 -0
  392. package/dist/capabilities/script-link.d.ts.map +1 -0
  393. package/dist/capabilities/script-link.js +35 -0
  394. package/dist/capabilities/script-link.js.map +1 -0
  395. package/dist/capabilities/scripts.d.ts +43 -0
  396. package/dist/capabilities/scripts.d.ts.map +1 -0
  397. package/dist/capabilities/scripts.js +1789 -0
  398. package/dist/capabilities/scripts.js.map +1 -0
  399. package/dist/capabilities/scripts.specs.d.ts +40 -0
  400. package/dist/capabilities/scripts.specs.d.ts.map +1 -0
  401. package/dist/capabilities/scripts.specs.js +319 -0
  402. package/dist/capabilities/scripts.specs.js.map +1 -0
  403. package/dist/capabilities/serpapi.d.ts +42 -0
  404. package/dist/capabilities/serpapi.d.ts.map +1 -0
  405. package/dist/capabilities/serpapi.js +262 -0
  406. package/dist/capabilities/serpapi.js.map +1 -0
  407. package/dist/capabilities/serpapi.specs.d.ts +24 -0
  408. package/dist/capabilities/serpapi.specs.d.ts.map +1 -0
  409. package/dist/capabilities/serpapi.specs.js +174 -0
  410. package/dist/capabilities/serpapi.specs.js.map +1 -0
  411. package/dist/capabilities/settings.d.ts +48 -0
  412. package/dist/capabilities/settings.d.ts.map +1 -0
  413. package/dist/capabilities/settings.js +226 -0
  414. package/dist/capabilities/settings.js.map +1 -0
  415. package/dist/capabilities/settings.specs.d.ts +42 -0
  416. package/dist/capabilities/settings.specs.d.ts.map +1 -0
  417. package/dist/capabilities/settings.specs.js +126 -0
  418. package/dist/capabilities/settings.specs.js.map +1 -0
  419. package/dist/capabilities/shared.d.ts +35 -0
  420. package/dist/capabilities/shared.d.ts.map +1 -0
  421. package/dist/capabilities/shared.js +165 -0
  422. package/dist/capabilities/shared.js.map +1 -0
  423. package/dist/capabilities/shared.specs.d.ts +19 -0
  424. package/dist/capabilities/shared.specs.d.ts.map +1 -0
  425. package/dist/capabilities/shared.specs.js +134 -0
  426. package/dist/capabilities/shared.specs.js.map +1 -0
  427. package/dist/capabilities/sketches.d.ts +52 -0
  428. package/dist/capabilities/sketches.d.ts.map +1 -0
  429. package/dist/capabilities/sketches.js +1163 -0
  430. package/dist/capabilities/sketches.js.map +1 -0
  431. package/dist/capabilities/sketches.specs.d.ts +44 -0
  432. package/dist/capabilities/sketches.specs.d.ts.map +1 -0
  433. package/dist/capabilities/sketches.specs.js +392 -0
  434. package/dist/capabilities/sketches.specs.js.map +1 -0
  435. package/dist/capabilities/skills.d.ts +28 -0
  436. package/dist/capabilities/skills.d.ts.map +1 -0
  437. package/dist/capabilities/skills.js +269 -0
  438. package/dist/capabilities/skills.js.map +1 -0
  439. package/dist/capabilities/skills.specs.d.ts +17 -0
  440. package/dist/capabilities/skills.specs.d.ts.map +1 -0
  441. package/dist/capabilities/skills.specs.js +108 -0
  442. package/dist/capabilities/skills.specs.js.map +1 -0
  443. package/dist/capabilities/storyboards.d.ts +68 -0
  444. package/dist/capabilities/storyboards.d.ts.map +1 -0
  445. package/dist/capabilities/storyboards.js +2246 -0
  446. package/dist/capabilities/storyboards.js.map +1 -0
  447. package/dist/capabilities/storyboards.specs.d.ts +42 -0
  448. package/dist/capabilities/storyboards.specs.d.ts.map +1 -0
  449. package/dist/capabilities/storyboards.specs.js +418 -0
  450. package/dist/capabilities/storyboards.specs.js.map +1 -0
  451. package/dist/capabilities/threads.d.ts +25 -0
  452. package/dist/capabilities/threads.d.ts.map +1 -0
  453. package/dist/capabilities/threads.js +240 -0
  454. package/dist/capabilities/threads.js.map +1 -0
  455. package/dist/capabilities/threads.specs.d.ts +26 -0
  456. package/dist/capabilities/threads.specs.d.ts.map +1 -0
  457. package/dist/capabilities/threads.specs.js +108 -0
  458. package/dist/capabilities/threads.specs.js.map +1 -0
  459. package/dist/capabilities/timeline-audio-bake.d.ts +114 -0
  460. package/dist/capabilities/timeline-audio-bake.d.ts.map +1 -0
  461. package/dist/capabilities/timeline-audio-bake.js +188 -0
  462. package/dist/capabilities/timeline-audio-bake.js.map +1 -0
  463. package/dist/capabilities/timeline-bake.d.ts +21 -0
  464. package/dist/capabilities/timeline-bake.d.ts.map +1 -0
  465. package/dist/capabilities/timeline-bake.js +118 -0
  466. package/dist/capabilities/timeline-bake.js.map +1 -0
  467. package/dist/capabilities/timeline-isolate-subject.d.ts +157 -0
  468. package/dist/capabilities/timeline-isolate-subject.d.ts.map +1 -0
  469. package/dist/capabilities/timeline-isolate-subject.js +293 -0
  470. package/dist/capabilities/timeline-isolate-subject.js.map +1 -0
  471. package/dist/capabilities/timeline-native-media.d.ts +4 -0
  472. package/dist/capabilities/timeline-native-media.d.ts.map +1 -0
  473. package/dist/capabilities/timeline-native-media.js +920 -0
  474. package/dist/capabilities/timeline-native-media.js.map +1 -0
  475. package/dist/capabilities/timeline-track-object.d.ts +83 -0
  476. package/dist/capabilities/timeline-track-object.d.ts.map +1 -0
  477. package/dist/capabilities/timeline-track-object.js +195 -0
  478. package/dist/capabilities/timeline-track-object.js.map +1 -0
  479. package/dist/capabilities/timelines.d.ts +190 -0
  480. package/dist/capabilities/timelines.d.ts.map +1 -0
  481. package/dist/capabilities/timelines.js +2326 -0
  482. package/dist/capabilities/timelines.js.map +1 -0
  483. package/dist/capabilities/timelines.specs.d.ts +134 -0
  484. package/dist/capabilities/timelines.specs.d.ts.map +1 -0
  485. package/dist/capabilities/timelines.specs.js +1362 -0
  486. package/dist/capabilities/timelines.specs.js.map +1 -0
  487. package/dist/capabilities/types.d.ts +197 -0
  488. package/dist/capabilities/types.d.ts.map +1 -0
  489. package/dist/capabilities/types.js +19 -0
  490. package/dist/capabilities/types.js.map +1 -0
  491. package/dist/capabilities/ui.d.ts +38 -0
  492. package/dist/capabilities/ui.d.ts.map +1 -0
  493. package/dist/capabilities/ui.js +128 -0
  494. package/dist/capabilities/ui.js.map +1 -0
  495. package/dist/capabilities/ui.specs.d.ts +22 -0
  496. package/dist/capabilities/ui.specs.d.ts.map +1 -0
  497. package/dist/capabilities/ui.specs.js +59 -0
  498. package/dist/capabilities/ui.specs.js.map +1 -0
  499. package/dist/capabilities/video-production-acceptance.d.ts +27 -0
  500. package/dist/capabilities/video-production-acceptance.d.ts.map +1 -0
  501. package/dist/capabilities/video-production-acceptance.js +41 -0
  502. package/dist/capabilities/video-production-acceptance.js.map +1 -0
  503. package/dist/capabilities/video-production.d.ts +179 -0
  504. package/dist/capabilities/video-production.d.ts.map +1 -0
  505. package/dist/capabilities/video-production.js +1492 -0
  506. package/dist/capabilities/video-production.js.map +1 -0
  507. package/dist/capabilities/video-production.specs.d.ts +13 -0
  508. package/dist/capabilities/video-production.specs.d.ts.map +1 -0
  509. package/dist/capabilities/video-production.specs.js +256 -0
  510. package/dist/capabilities/video-production.specs.js.map +1 -0
  511. package/dist/capabilities/web.d.ts +86 -0
  512. package/dist/capabilities/web.d.ts.map +1 -0
  513. package/dist/capabilities/web.js +850 -0
  514. package/dist/capabilities/web.js.map +1 -0
  515. package/dist/capabilities/web.specs.d.ts +33 -0
  516. package/dist/capabilities/web.specs.d.ts.map +1 -0
  517. package/dist/capabilities/web.specs.js +286 -0
  518. package/dist/capabilities/web.specs.js.map +1 -0
  519. package/dist/capabilities/workflows.d.ts +58 -0
  520. package/dist/capabilities/workflows.d.ts.map +1 -0
  521. package/dist/capabilities/workflows.js +1530 -0
  522. package/dist/capabilities/workflows.js.map +1 -0
  523. package/dist/capabilities/workflows.specs.d.ts +63 -0
  524. package/dist/capabilities/workflows.specs.d.ts.map +1 -0
  525. package/dist/capabilities/workflows.specs.js +852 -0
  526. package/dist/capabilities/workflows.specs.js.map +1 -0
  527. package/dist/code-gen/analyze.d.ts +26 -0
  528. package/dist/code-gen/analyze.d.ts.map +1 -0
  529. package/dist/code-gen/analyze.js +79 -0
  530. package/dist/code-gen/analyze.js.map +1 -0
  531. package/dist/code-gen/port-types.d.ts +58 -0
  532. package/dist/code-gen/port-types.d.ts.map +1 -0
  533. package/dist/code-gen/port-types.js +115 -0
  534. package/dist/code-gen/port-types.js.map +1 -0
  535. package/dist/code-gen/prompt.d.ts +37 -0
  536. package/dist/code-gen/prompt.d.ts.map +1 -0
  537. package/dist/code-gen/prompt.js +129 -0
  538. package/dist/code-gen/prompt.js.map +1 -0
  539. package/dist/code-gen/sandbox-manifest.d.ts +120 -0
  540. package/dist/code-gen/sandbox-manifest.d.ts.map +1 -0
  541. package/dist/code-gen/sandbox-manifest.js +1023 -0
  542. package/dist/code-gen/sandbox-manifest.js.map +1 -0
  543. package/dist/code-gen/sandbox-prompt.d.ts +26 -0
  544. package/dist/code-gen/sandbox-prompt.d.ts.map +1 -0
  545. package/dist/code-gen/sandbox-prompt.js +126 -0
  546. package/dist/code-gen/sandbox-prompt.js.map +1 -0
  547. package/dist/code-planner.d.ts +72 -0
  548. package/dist/code-planner.d.ts.map +1 -0
  549. package/dist/code-planner.js +271 -0
  550. package/dist/code-planner.js.map +1 -0
  551. package/dist/codeact/action-diagnostics.d.ts +35 -0
  552. package/dist/codeact/action-diagnostics.d.ts.map +1 -0
  553. package/dist/codeact/action-diagnostics.js +147 -0
  554. package/dist/codeact/action-diagnostics.js.map +1 -0
  555. package/dist/codeact/capability-modules.d.ts +66 -0
  556. package/dist/codeact/capability-modules.d.ts.map +1 -0
  557. package/dist/codeact/capability-modules.js +278 -0
  558. package/dist/codeact/capability-modules.js.map +1 -0
  559. package/dist/codeact/chat-codeact.d.ts +104 -0
  560. package/dist/codeact/chat-codeact.d.ts.map +1 -0
  561. package/dist/codeact/chat-codeact.js +424 -0
  562. package/dist/codeact/chat-codeact.js.map +1 -0
  563. package/dist/codeact/codeact-executor.d.ts +247 -0
  564. package/dist/codeact/codeact-executor.d.ts.map +1 -0
  565. package/dist/codeact/codeact-executor.js +1176 -0
  566. package/dist/codeact/codeact-executor.js.map +1 -0
  567. package/dist/codeact/compact-ids.d.ts +28 -0
  568. package/dist/codeact/compact-ids.d.ts.map +1 -0
  569. package/dist/codeact/compact-ids.js +77 -0
  570. package/dist/codeact/compact-ids.js.map +1 -0
  571. package/dist/codeact/execute-code-contract.d.ts +97 -0
  572. package/dist/codeact/execute-code-contract.d.ts.map +1 -0
  573. package/dist/codeact/execute-code-contract.js +225 -0
  574. package/dist/codeact/execute-code-contract.js.map +1 -0
  575. package/dist/codeact/fabric-package.d.ts +29 -0
  576. package/dist/codeact/fabric-package.d.ts.map +1 -0
  577. package/dist/codeact/fabric-package.js +62 -0
  578. package/dist/codeact/fabric-package.js.map +1 -0
  579. package/dist/codeact/flow-package.d.ts +31 -0
  580. package/dist/codeact/flow-package.d.ts.map +1 -0
  581. package/dist/codeact/flow-package.js +80 -0
  582. package/dist/codeact/flow-package.js.map +1 -0
  583. package/dist/codeact/graph-dsl-package.d.ts +42 -0
  584. package/dist/codeact/graph-dsl-package.d.ts.map +1 -0
  585. package/dist/codeact/graph-dsl-package.js +100 -0
  586. package/dist/codeact/graph-dsl-package.js.map +1 -0
  587. package/dist/codeact/graph-model.d.ts +30 -0
  588. package/dist/codeact/graph-model.d.ts.map +1 -0
  589. package/dist/codeact/graph-model.js +408 -0
  590. package/dist/codeact/graph-model.js.map +1 -0
  591. package/dist/codeact/mcp-guest-contract.d.ts +66 -0
  592. package/dist/codeact/mcp-guest-contract.d.ts.map +1 -0
  593. package/dist/codeact/mcp-guest-contract.js +108 -0
  594. package/dist/codeact/mcp-guest-contract.js.map +1 -0
  595. package/dist/codeact/nodetool-api.d.ts +60 -0
  596. package/dist/codeact/nodetool-api.d.ts.map +1 -0
  597. package/dist/codeact/nodetool-api.js +2056 -0
  598. package/dist/codeact/nodetool-api.js.map +1 -0
  599. package/dist/codeact/prompt.d.ts +88 -0
  600. package/dist/codeact/prompt.d.ts.map +1 -0
  601. package/dist/codeact/prompt.js +326 -0
  602. package/dist/codeact/prompt.js.map +1 -0
  603. package/dist/codeact/sandbox-package-docs.d.ts +48 -0
  604. package/dist/codeact/sandbox-package-docs.d.ts.map +1 -0
  605. package/dist/codeact/sandbox-package-docs.js +55 -0
  606. package/dist/codeact/sandbox-package-docs.js.map +1 -0
  607. package/dist/codeact/sandbox-package-listing.d.ts +81 -0
  608. package/dist/codeact/sandbox-package-listing.d.ts.map +1 -0
  609. package/dist/codeact/sandbox-package-listing.js +101 -0
  610. package/dist/codeact/sandbox-package-listing.js.map +1 -0
  611. package/dist/codeact/sandbox-packages.d.ts +72 -0
  612. package/dist/codeact/sandbox-packages.d.ts.map +1 -0
  613. package/dist/codeact/sandbox-packages.js +230 -0
  614. package/dist/codeact/sandbox-packages.js.map +1 -0
  615. package/dist/codeact/timeline-package.d.ts +5 -0
  616. package/dist/codeact/timeline-package.d.ts.map +1 -0
  617. package/dist/codeact/timeline-package.js +10 -0
  618. package/dist/codeact/timeline-package.js.map +1 -0
  619. package/dist/codeact/tool-api.d.ts +197 -0
  620. package/dist/codeact/tool-api.d.ts.map +1 -0
  621. package/dist/codeact/tool-api.js +445 -0
  622. package/dist/codeact/tool-api.js.map +1 -0
  623. package/dist/codeact/tools-prelude.d.ts +32 -0
  624. package/dist/codeact/tools-prelude.d.ts.map +1 -0
  625. package/dist/codeact/tools-prelude.js +65 -0
  626. package/dist/codeact/tools-prelude.js.map +1 -0
  627. package/dist/constants.d.ts +47 -2
  628. package/dist/constants.d.ts.map +1 -1
  629. package/dist/constants.js +64 -2
  630. package/dist/constants.js.map +1 -1
  631. package/dist/custom-animation-bake.d.ts +57 -0
  632. package/dist/custom-animation-bake.d.ts.map +1 -0
  633. package/dist/custom-animation-bake.js +88 -0
  634. package/dist/custom-animation-bake.js.map +1 -0
  635. package/dist/dynamic-slots.d.ts +72 -0
  636. package/dist/dynamic-slots.d.ts.map +1 -0
  637. package/dist/dynamic-slots.js +0 -0
  638. package/dist/dynamic-slots.js.map +1 -0
  639. package/dist/evals/app-build-cases.d.ts +35 -0
  640. package/dist/evals/app-build-cases.d.ts.map +1 -0
  641. package/dist/evals/app-build-cases.js +722 -0
  642. package/dist/evals/app-build-cases.js.map +1 -0
  643. package/dist/evals/app-build-eval.d.ts +208 -0
  644. package/dist/evals/app-build-eval.d.ts.map +1 -0
  645. package/dist/evals/app-build-eval.js +518 -0
  646. package/dist/evals/app-build-eval.js.map +1 -0
  647. package/dist/evals/app-build-plan.d.ts +76 -0
  648. package/dist/evals/app-build-plan.d.ts.map +1 -0
  649. package/dist/evals/app-build-plan.js +140 -0
  650. package/dist/evals/app-build-plan.js.map +1 -0
  651. package/dist/evals/code-gen-cases.d.ts +13 -0
  652. package/dist/evals/code-gen-cases.d.ts.map +1 -0
  653. package/dist/evals/code-gen-cases.js +124 -0
  654. package/dist/evals/code-gen-cases.js.map +1 -0
  655. package/dist/evals/code-gen-eval.d.ts +109 -0
  656. package/dist/evals/code-gen-eval.d.ts.map +1 -0
  657. package/dist/evals/code-gen-eval.js +299 -0
  658. package/dist/evals/code-gen-eval.js.map +1 -0
  659. package/dist/evals/codeact-api-cases.d.ts +14 -0
  660. package/dist/evals/codeact-api-cases.d.ts.map +1 -0
  661. package/dist/evals/codeact-api-cases.js +29 -0
  662. package/dist/evals/codeact-api-cases.js.map +1 -0
  663. package/dist/evals/codeact-api-core.d.ts +23 -0
  664. package/dist/evals/codeact-api-core.d.ts.map +1 -0
  665. package/dist/evals/codeact-api-core.js +1411 -0
  666. package/dist/evals/codeact-api-core.js.map +1 -0
  667. package/dist/evals/codeact-api-surfaces.d.ts +25 -0
  668. package/dist/evals/codeact-api-surfaces.d.ts.map +1 -0
  669. package/dist/evals/codeact-api-surfaces.js +2191 -0
  670. package/dist/evals/codeact-api-surfaces.js.map +1 -0
  671. package/dist/evals/codeact-cases.d.ts +76 -0
  672. package/dist/evals/codeact-cases.d.ts.map +1 -0
  673. package/dist/evals/codeact-cases.js +151 -0
  674. package/dist/evals/codeact-cases.js.map +1 -0
  675. package/dist/evals/codeact-eval.d.ts +66 -0
  676. package/dist/evals/codeact-eval.d.ts.map +1 -0
  677. package/dist/evals/codeact-eval.js +250 -0
  678. package/dist/evals/codeact-eval.js.map +1 -0
  679. package/dist/evals/codeact-sandbox-pack-cases.d.ts +31 -0
  680. package/dist/evals/codeact-sandbox-pack-cases.d.ts.map +1 -0
  681. package/dist/evals/codeact-sandbox-pack-cases.js +219 -0
  682. package/dist/evals/codeact-sandbox-pack-cases.js.map +1 -0
  683. package/dist/evals/escalation-cases.d.ts +22 -0
  684. package/dist/evals/escalation-cases.d.ts.map +1 -0
  685. package/dist/evals/escalation-cases.js +343 -0
  686. package/dist/evals/escalation-cases.js.map +1 -0
  687. package/dist/evals/escalation.d.ts +92 -0
  688. package/dist/evals/escalation.d.ts.map +1 -0
  689. package/dist/evals/escalation.js +152 -0
  690. package/dist/evals/escalation.js.map +1 -0
  691. package/dist/evals/goal-judge.d.ts +51 -0
  692. package/dist/evals/goal-judge.d.ts.map +1 -0
  693. package/dist/evals/goal-judge.js +152 -0
  694. package/dist/evals/goal-judge.js.map +1 -0
  695. package/dist/evals/graph-e2e-cases.d.ts +21 -0
  696. package/dist/evals/graph-e2e-cases.d.ts.map +1 -0
  697. package/dist/evals/graph-e2e-cases.js +262 -0
  698. package/dist/evals/graph-e2e-cases.js.map +1 -0
  699. package/dist/evals/graph-e2e-eval.d.ts +202 -0
  700. package/dist/evals/graph-e2e-eval.d.ts.map +1 -0
  701. package/dist/evals/graph-e2e-eval.js +438 -0
  702. package/dist/evals/graph-e2e-eval.js.map +1 -0
  703. package/dist/evals/graph-planner-cases.d.ts +12 -0
  704. package/dist/evals/graph-planner-cases.d.ts.map +1 -0
  705. package/dist/evals/graph-planner-cases.js +256 -0
  706. package/dist/evals/graph-planner-cases.js.map +1 -0
  707. package/dist/evals/graph-planner-eval.d.ts +178 -0
  708. package/dist/evals/graph-planner-eval.d.ts.map +1 -0
  709. package/dist/evals/graph-planner-eval.js +495 -0
  710. package/dist/evals/graph-planner-eval.js.map +1 -0
  711. package/dist/evals/planner-tools.d.ts +21 -0
  712. package/dist/evals/planner-tools.d.ts.map +1 -0
  713. package/dist/evals/planner-tools.js +66 -0
  714. package/dist/evals/planner-tools.js.map +1 -0
  715. package/dist/evals/subtask-cases.d.ts +88 -0
  716. package/dist/evals/subtask-cases.d.ts.map +1 -0
  717. package/dist/evals/subtask-cases.js +322 -0
  718. package/dist/evals/subtask-cases.js.map +1 -0
  719. package/dist/evals/subtask-eval.d.ts +129 -0
  720. package/dist/evals/subtask-eval.d.ts.map +1 -0
  721. package/dist/evals/subtask-eval.js +397 -0
  722. package/dist/evals/subtask-eval.js.map +1 -0
  723. package/dist/evals/surfaces/app.d.ts +19 -0
  724. package/dist/evals/surfaces/app.d.ts.map +1 -0
  725. package/dist/evals/surfaces/app.js +341 -0
  726. package/dist/evals/surfaces/app.js.map +1 -0
  727. package/dist/evals/surfaces/creative-pipeline.d.ts +203 -0
  728. package/dist/evals/surfaces/creative-pipeline.d.ts.map +1 -0
  729. package/dist/evals/surfaces/creative-pipeline.js +909 -0
  730. package/dist/evals/surfaces/creative-pipeline.js.map +1 -0
  731. package/dist/evals/surfaces/game.d.ts +5 -0
  732. package/dist/evals/surfaces/game.d.ts.map +1 -0
  733. package/dist/evals/surfaces/game.js +42 -0
  734. package/dist/evals/surfaces/game.js.map +1 -0
  735. package/dist/evals/surfaces/js-script.d.ts +66 -0
  736. package/dist/evals/surfaces/js-script.d.ts.map +1 -0
  737. package/dist/evals/surfaces/js-script.js +407 -0
  738. package/dist/evals/surfaces/js-script.js.map +1 -0
  739. package/dist/evals/surfaces/memory.d.ts +34 -0
  740. package/dist/evals/surfaces/memory.d.ts.map +1 -0
  741. package/dist/evals/surfaces/memory.js +264 -0
  742. package/dist/evals/surfaces/memory.js.map +1 -0
  743. package/dist/evals/surfaces/model3d.d.ts +45 -0
  744. package/dist/evals/surfaces/model3d.d.ts.map +1 -0
  745. package/dist/evals/surfaces/model3d.js +346 -0
  746. package/dist/evals/surfaces/model3d.js.map +1 -0
  747. package/dist/evals/surfaces/script.d.ts +96 -0
  748. package/dist/evals/surfaces/script.d.ts.map +1 -0
  749. package/dist/evals/surfaces/script.js +709 -0
  750. package/dist/evals/surfaces/script.js.map +1 -0
  751. package/dist/evals/surfaces/sketch.d.ts +124 -0
  752. package/dist/evals/surfaces/sketch.d.ts.map +1 -0
  753. package/dist/evals/surfaces/sketch.js +1298 -0
  754. package/dist/evals/surfaces/sketch.js.map +1 -0
  755. package/dist/evals/surfaces/storyboard.d.ts +97 -0
  756. package/dist/evals/surfaces/storyboard.d.ts.map +1 -0
  757. package/dist/evals/surfaces/storyboard.js +693 -0
  758. package/dist/evals/surfaces/storyboard.js.map +1 -0
  759. package/dist/evals/surfaces/timeline.d.ts +416 -0
  760. package/dist/evals/surfaces/timeline.d.ts.map +1 -0
  761. package/dist/evals/surfaces/timeline.js +3267 -0
  762. package/dist/evals/surfaces/timeline.js.map +1 -0
  763. package/dist/evals/task-planner-cases.d.ts +57 -0
  764. package/dist/evals/task-planner-cases.d.ts.map +1 -0
  765. package/dist/evals/task-planner-cases.js +117 -0
  766. package/dist/evals/task-planner-cases.js.map +1 -0
  767. package/dist/evals/task-planner-eval.d.ts +101 -0
  768. package/dist/evals/task-planner-eval.d.ts.map +1 -0
  769. package/dist/evals/task-planner-eval.js +380 -0
  770. package/dist/evals/task-planner-eval.js.map +1 -0
  771. package/dist/evals/tool-loop-bridge.d.ts +57 -0
  772. package/dist/evals/tool-loop-bridge.d.ts.map +1 -0
  773. package/dist/evals/tool-loop-bridge.js +129 -0
  774. package/dist/evals/tool-loop-bridge.js.map +1 -0
  775. package/dist/evals/tool-loop-cases.d.ts +21 -0
  776. package/dist/evals/tool-loop-cases.d.ts.map +1 -0
  777. package/dist/evals/tool-loop-cases.js +401 -0
  778. package/dist/evals/tool-loop-cases.js.map +1 -0
  779. package/dist/evals/tool-loop-eval.d.ts +234 -0
  780. package/dist/evals/tool-loop-eval.d.ts.map +1 -0
  781. package/dist/evals/tool-loop-eval.js +373 -0
  782. package/dist/evals/tool-loop-eval.js.map +1 -0
  783. package/dist/evals/tool-loop-permission.d.ts +43 -0
  784. package/dist/evals/tool-loop-permission.d.ts.map +1 -0
  785. package/dist/evals/tool-loop-permission.js +76 -0
  786. package/dist/evals/tool-loop-permission.js.map +1 -0
  787. package/dist/game-examples.d.ts +447 -0
  788. package/dist/game-examples.d.ts.map +1 -0
  789. package/dist/game-examples.js +187 -0
  790. package/dist/game-examples.js.map +1 -0
  791. package/dist/graph-builder.d.ts +55 -3
  792. package/dist/graph-builder.d.ts.map +1 -1
  793. package/dist/graph-builder.js +159 -4
  794. package/dist/graph-builder.js.map +1 -1
  795. package/dist/graph-dsl-core.d.ts +25 -0
  796. package/dist/graph-dsl-core.d.ts.map +1 -0
  797. package/dist/graph-dsl-core.js +312 -0
  798. package/dist/graph-dsl-core.js.map +1 -0
  799. package/dist/graph-dsl.d.ts +30 -0
  800. package/dist/graph-dsl.d.ts.map +1 -0
  801. package/dist/graph-dsl.js +116 -0
  802. package/dist/graph-dsl.js.map +1 -0
  803. package/dist/host-binaries.d.ts +6 -0
  804. package/dist/host-binaries.d.ts.map +1 -0
  805. package/dist/host-binaries.js +6 -0
  806. package/dist/host-binaries.js.map +1 -0
  807. package/dist/host-binary-guard.d.ts +100 -0
  808. package/dist/host-binary-guard.d.ts.map +1 -0
  809. package/dist/host-binary-guard.js +205 -0
  810. package/dist/host-binary-guard.js.map +1 -0
  811. package/dist/host-modules/aws.d.ts +57 -0
  812. package/dist/host-modules/aws.d.ts.map +1 -0
  813. package/dist/host-modules/aws.js +309 -0
  814. package/dist/host-modules/aws.js.map +1 -0
  815. package/dist/host-modules/chrono.d.ts +15 -0
  816. package/dist/host-modules/chrono.d.ts.map +1 -0
  817. package/dist/host-modules/chrono.js +35 -0
  818. package/dist/host-modules/chrono.js.map +1 -0
  819. package/dist/host-modules/csv.d.ts +17 -0
  820. package/dist/host-modules/csv.d.ts.map +1 -0
  821. package/dist/host-modules/csv.js +64 -0
  822. package/dist/host-modules/csv.js.map +1 -0
  823. package/dist/host-modules/diff.d.ts +9 -0
  824. package/dist/host-modules/diff.d.ts.map +1 -0
  825. package/dist/host-modules/diff.js +26 -0
  826. package/dist/host-modules/diff.js.map +1 -0
  827. package/dist/host-modules/dispatcher.d.ts +41 -0
  828. package/dist/host-modules/dispatcher.d.ts.map +1 -0
  829. package/dist/host-modules/dispatcher.js +99 -0
  830. package/dist/host-modules/dispatcher.js.map +1 -0
  831. package/dist/host-modules/docx.d.ts +19 -0
  832. package/dist/host-modules/docx.d.ts.map +1 -0
  833. package/dist/host-modules/docx.js +120 -0
  834. package/dist/host-modules/docx.js.map +1 -0
  835. package/dist/host-modules/epub.d.ts +48 -0
  836. package/dist/host-modules/epub.d.ts.map +1 -0
  837. package/dist/host-modules/epub.js +100 -0
  838. package/dist/host-modules/epub.js.map +1 -0
  839. package/dist/host-modules/exif.d.ts +8 -0
  840. package/dist/host-modules/exif.d.ts.map +1 -0
  841. package/dist/host-modules/exif.js +19 -0
  842. package/dist/host-modules/exif.js.map +1 -0
  843. package/dist/host-modules/expr.d.ts +16 -0
  844. package/dist/host-modules/expr.d.ts.map +1 -0
  845. package/dist/host-modules/expr.js +18 -0
  846. package/dist/host-modules/expr.js.map +1 -0
  847. package/dist/host-modules/fabric.d.ts +46 -0
  848. package/dist/host-modules/fabric.d.ts.map +1 -0
  849. package/dist/host-modules/fabric.js +178 -0
  850. package/dist/host-modules/fabric.js.map +1 -0
  851. package/dist/host-modules/html.d.ts +51 -0
  852. package/dist/host-modules/html.d.ts.map +1 -0
  853. package/dist/host-modules/html.js +198 -0
  854. package/dist/host-modules/html.js.map +1 -0
  855. package/dist/host-modules/ics.d.ts +9 -0
  856. package/dist/host-modules/ics.d.ts.map +1 -0
  857. package/dist/host-modules/ics.js +35 -0
  858. package/dist/host-modules/ics.js.map +1 -0
  859. package/dist/host-modules/limits.d.ts +41 -0
  860. package/dist/host-modules/limits.d.ts.map +1 -0
  861. package/dist/host-modules/limits.js +76 -0
  862. package/dist/host-modules/limits.js.map +1 -0
  863. package/dist/host-modules/mammoth.d.ts +11 -0
  864. package/dist/host-modules/mammoth.d.ts.map +1 -0
  865. package/dist/host-modules/mammoth.js +29 -0
  866. package/dist/host-modules/mammoth.js.map +1 -0
  867. package/dist/host-modules/notion.d.ts +45 -0
  868. package/dist/host-modules/notion.d.ts.map +1 -0
  869. package/dist/host-modules/notion.js +128 -0
  870. package/dist/host-modules/notion.js.map +1 -0
  871. package/dist/host-modules/ocr.d.ts +25 -0
  872. package/dist/host-modules/ocr.d.ts.map +1 -0
  873. package/dist/host-modules/ocr.js +74 -0
  874. package/dist/host-modules/ocr.js.map +1 -0
  875. package/dist/host-modules/pdf.d.ts +21 -0
  876. package/dist/host-modules/pdf.d.ts.map +1 -0
  877. package/dist/host-modules/pdf.js +53 -0
  878. package/dist/host-modules/pdf.js.map +1 -0
  879. package/dist/host-modules/pdflib.d.ts +17 -0
  880. package/dist/host-modules/pdflib.d.ts.map +1 -0
  881. package/dist/host-modules/pdflib.js +138 -0
  882. package/dist/host-modules/pdflib.js.map +1 -0
  883. package/dist/host-modules/pptx.d.ts +19 -0
  884. package/dist/host-modules/pptx.d.ts.map +1 -0
  885. package/dist/host-modules/pptx.js +67 -0
  886. package/dist/host-modules/pptx.js.map +1 -0
  887. package/dist/host-modules/pptxgen.d.ts +13 -0
  888. package/dist/host-modules/pptxgen.d.ts.map +1 -0
  889. package/dist/host-modules/pptxgen.js +98 -0
  890. package/dist/host-modules/pptxgen.js.map +1 -0
  891. package/dist/host-modules/prepared-request.d.ts +41 -0
  892. package/dist/host-modules/prepared-request.d.ts.map +1 -0
  893. package/dist/host-modules/prepared-request.js +104 -0
  894. package/dist/host-modules/prepared-request.js.map +1 -0
  895. package/dist/host-modules/registry.d.ts +31 -0
  896. package/dist/host-modules/registry.d.ts.map +1 -0
  897. package/dist/host-modules/registry.js +193 -0
  898. package/dist/host-modules/registry.js.map +1 -0
  899. package/dist/host-modules/subtitle.d.ts +15 -0
  900. package/dist/host-modules/subtitle.d.ts.map +1 -0
  901. package/dist/host-modules/subtitle.js +45 -0
  902. package/dist/host-modules/subtitle.js.map +1 -0
  903. package/dist/host-modules/supabase.d.ts +42 -0
  904. package/dist/host-modules/supabase.d.ts.map +1 -0
  905. package/dist/host-modules/supabase.js +141 -0
  906. package/dist/host-modules/supabase.js.map +1 -0
  907. package/dist/host-modules/tfjs.d.ts +42 -0
  908. package/dist/host-modules/tfjs.d.ts.map +1 -0
  909. package/dist/host-modules/tfjs.js +186 -0
  910. package/dist/host-modules/tfjs.js.map +1 -0
  911. package/dist/host-modules/tokens.d.ts +17 -0
  912. package/dist/host-modules/tokens.d.ts.map +1 -0
  913. package/dist/host-modules/tokens.js +74 -0
  914. package/dist/host-modules/tokens.js.map +1 -0
  915. package/dist/host-modules/twilio.d.ts +34 -0
  916. package/dist/host-modules/twilio.d.ts.map +1 -0
  917. package/dist/host-modules/twilio.js +67 -0
  918. package/dist/host-modules/twilio.js.map +1 -0
  919. package/dist/host-modules/xlsx.d.ts +26 -0
  920. package/dist/host-modules/xlsx.d.ts.map +1 -0
  921. package/dist/host-modules/xlsx.js +323 -0
  922. package/dist/host-modules/xlsx.js.map +1 -0
  923. package/dist/host-modules/xml.d.ts +23 -0
  924. package/dist/host-modules/xml.d.ts.map +1 -0
  925. package/dist/host-modules/xml.js +38 -0
  926. package/dist/host-modules/xml.js.map +1 -0
  927. package/dist/host-modules/zip.d.ts +24 -0
  928. package/dist/host-modules/zip.d.ts.map +1 -0
  929. package/dist/host-modules/zip.js +70 -0
  930. package/dist/host-modules/zip.js.map +1 -0
  931. package/dist/index.d.ts +197 -60
  932. package/dist/index.d.ts.map +1 -1
  933. package/dist/index.js +153 -60
  934. package/dist/index.js.map +1 -1
  935. package/dist/js-sandbox-worker/host.d.ts +136 -0
  936. package/dist/js-sandbox-worker/host.d.ts.map +1 -0
  937. package/dist/js-sandbox-worker/host.js +482 -0
  938. package/dist/js-sandbox-worker/host.js.map +1 -0
  939. package/dist/js-sandbox-worker/interpreter.d.ts +276 -0
  940. package/dist/js-sandbox-worker/interpreter.d.ts.map +1 -0
  941. package/dist/js-sandbox-worker/interpreter.js +1201 -0
  942. package/dist/js-sandbox-worker/interpreter.js.map +1 -0
  943. package/dist/js-sandbox-worker/protocol.d.ts +168 -0
  944. package/dist/js-sandbox-worker/protocol.d.ts.map +1 -0
  945. package/dist/js-sandbox-worker/protocol.js +217 -0
  946. package/dist/js-sandbox-worker/protocol.js.map +1 -0
  947. package/dist/js-sandbox-worker/worker-entry.d.ts +26 -0
  948. package/dist/js-sandbox-worker/worker-entry.d.ts.map +1 -0
  949. package/dist/js-sandbox-worker/worker-entry.js +307 -0
  950. package/dist/js-sandbox-worker/worker-entry.js.map +1 -0
  951. package/dist/js-sandbox.d.ts +455 -15
  952. package/dist/js-sandbox.d.ts.map +1 -1
  953. package/dist/js-sandbox.js +1961 -309
  954. package/dist/js-sandbox.js.map +1 -1
  955. package/dist/js-script-app-runner.d.ts +9 -0
  956. package/dist/js-script-app-runner.d.ts.map +1 -0
  957. package/dist/js-script-app-runner.js +49 -0
  958. package/dist/js-script-app-runner.js.map +1 -0
  959. package/dist/js-script-sandbox.d.ts +33 -0
  960. package/dist/js-script-sandbox.d.ts.map +1 -0
  961. package/dist/js-script-sandbox.js +82 -0
  962. package/dist/js-script-sandbox.js.map +1 -0
  963. package/dist/jtbd/friction.d.ts +26 -0
  964. package/dist/jtbd/friction.d.ts.map +1 -0
  965. package/dist/jtbd/friction.js +169 -0
  966. package/dist/jtbd/friction.js.map +1 -0
  967. package/dist/jtbd/index.d.ts +6 -0
  968. package/dist/jtbd/index.d.ts.map +1 -0
  969. package/dist/jtbd/index.js +6 -0
  970. package/dist/jtbd/index.js.map +1 -0
  971. package/dist/jtbd/optimize.d.ts +71 -0
  972. package/dist/jtbd/optimize.d.ts.map +1 -0
  973. package/dist/jtbd/optimize.js +176 -0
  974. package/dist/jtbd/optimize.js.map +1 -0
  975. package/dist/jtbd/registry.d.ts +29 -0
  976. package/dist/jtbd/registry.d.ts.map +1 -0
  977. package/dist/jtbd/registry.js +451 -0
  978. package/dist/jtbd/registry.js.map +1 -0
  979. package/dist/jtbd/run.d.ts +70 -0
  980. package/dist/jtbd/run.d.ts.map +1 -0
  981. package/dist/jtbd/run.js +177 -0
  982. package/dist/jtbd/run.js.map +1 -0
  983. package/dist/jtbd/types.d.ts +141 -0
  984. package/dist/jtbd/types.d.ts.map +1 -0
  985. package/dist/jtbd/types.js +25 -0
  986. package/dist/jtbd/types.js.map +1 -0
  987. package/dist/model-prompting-skills.d.ts +45 -0
  988. package/dist/model-prompting-skills.d.ts.map +1 -0
  989. package/dist/model-prompting-skills.js +116 -0
  990. package/dist/model-prompting-skills.js.map +1 -0
  991. package/dist/network-guard.d.ts +50 -0
  992. package/dist/network-guard.d.ts.map +1 -0
  993. package/dist/network-guard.js +106 -0
  994. package/dist/network-guard.js.map +1 -0
  995. package/dist/normalize-model-properties.d.ts +26 -0
  996. package/dist/normalize-model-properties.d.ts.map +1 -0
  997. package/dist/normalize-model-properties.js +58 -0
  998. package/dist/normalize-model-properties.js.map +1 -0
  999. package/dist/output-format.d.ts +5 -1
  1000. package/dist/output-format.d.ts.map +1 -1
  1001. package/dist/output-format.js.map +1 -1
  1002. package/dist/parallel-task-executor.d.ts +68 -37
  1003. package/dist/parallel-task-executor.d.ts.map +1 -1
  1004. package/dist/parallel-task-executor.js +234 -203
  1005. package/dist/parallel-task-executor.js.map +1 -1
  1006. package/dist/prompts/background-subtask-prompt.d.ts +14 -0
  1007. package/dist/prompts/background-subtask-prompt.d.ts.map +1 -0
  1008. package/dist/prompts/background-subtask-prompt.js +64 -0
  1009. package/dist/prompts/background-subtask-prompt.js.map +1 -0
  1010. package/dist/prompts/product-knowledge.d.ts +3 -0
  1011. package/dist/prompts/product-knowledge.d.ts.map +1 -0
  1012. package/dist/prompts/product-knowledge.js +79 -0
  1013. package/dist/prompts/product-knowledge.js.map +1 -0
  1014. package/dist/prompts/read-only-search-prompt.d.ts +33 -0
  1015. package/dist/prompts/read-only-search-prompt.d.ts.map +1 -0
  1016. package/dist/prompts/read-only-search-prompt.js +109 -0
  1017. package/dist/prompts/read-only-search-prompt.js.map +1 -0
  1018. package/dist/prompts/sandbox-pack-catalog.d.ts +23 -0
  1019. package/dist/prompts/sandbox-pack-catalog.d.ts.map +1 -0
  1020. package/dist/prompts/sandbox-pack-catalog.js +40 -0
  1021. package/dist/prompts/sandbox-pack-catalog.js.map +1 -0
  1022. package/dist/prompts/security-monitor-prompt.d.ts +32 -0
  1023. package/dist/prompts/security-monitor-prompt.d.ts.map +1 -0
  1024. package/dist/prompts/security-monitor-prompt.js +99 -0
  1025. package/dist/prompts/security-monitor-prompt.js.map +1 -0
  1026. package/dist/prompts/workflow-authoring-knowledge.d.ts +77 -0
  1027. package/dist/prompts/workflow-authoring-knowledge.d.ts.map +1 -0
  1028. package/dist/prompts/workflow-authoring-knowledge.js +319 -0
  1029. package/dist/prompts/workflow-authoring-knowledge.js.map +1 -0
  1030. package/dist/run-policy.d.ts +25 -0
  1031. package/dist/run-policy.d.ts.map +1 -0
  1032. package/dist/run-policy.js +54 -0
  1033. package/dist/run-policy.js.map +1 -0
  1034. package/dist/sandbox-av-media.d.ts +33 -0
  1035. package/dist/sandbox-av-media.d.ts.map +1 -0
  1036. package/dist/sandbox-av-media.js +666 -0
  1037. package/dist/sandbox-av-media.js.map +1 -0
  1038. package/dist/sandbox-bootstrap-modules.d.ts +54 -0
  1039. package/dist/sandbox-bootstrap-modules.d.ts.map +1 -0
  1040. package/dist/sandbox-bootstrap-modules.js +104 -0
  1041. package/dist/sandbox-bootstrap-modules.js.map +1 -0
  1042. package/dist/sandbox-bytes.d.ts +43 -0
  1043. package/dist/sandbox-bytes.d.ts.map +1 -0
  1044. package/dist/sandbox-bytes.js +61 -0
  1045. package/dist/sandbox-bytes.js.map +1 -0
  1046. package/dist/sandbox-canvas-api.d.ts +30 -0
  1047. package/dist/sandbox-canvas-api.d.ts.map +1 -0
  1048. package/dist/sandbox-canvas-api.js +81 -0
  1049. package/dist/sandbox-canvas-api.js.map +1 -0
  1050. package/dist/sandbox-constants.d.ts +5 -0
  1051. package/dist/sandbox-constants.d.ts.map +1 -0
  1052. package/dist/sandbox-constants.js +13 -0
  1053. package/dist/sandbox-constants.js.map +1 -0
  1054. package/dist/sandbox-json-transport.d.ts +107 -0
  1055. package/dist/sandbox-json-transport.d.ts.map +1 -0
  1056. package/dist/sandbox-json-transport.js +324 -0
  1057. package/dist/sandbox-json-transport.js.map +1 -0
  1058. package/dist/sandbox-media-handle.d.ts +78 -0
  1059. package/dist/sandbox-media-handle.d.ts.map +1 -0
  1060. package/dist/sandbox-media-handle.js +114 -0
  1061. package/dist/sandbox-media-handle.js.map +1 -0
  1062. package/dist/sandbox-media-ref.d.ts +134 -0
  1063. package/dist/sandbox-media-ref.d.ts.map +1 -0
  1064. package/dist/sandbox-media-ref.js +442 -0
  1065. package/dist/sandbox-media-ref.js.map +1 -0
  1066. package/dist/sandbox-media.d.ts +177 -0
  1067. package/dist/sandbox-media.d.ts.map +1 -0
  1068. package/dist/sandbox-media.js +963 -0
  1069. package/dist/sandbox-media.js.map +1 -0
  1070. package/dist/sandbox-module-fixtures.d.ts +445 -0
  1071. package/dist/sandbox-module-fixtures.d.ts.map +1 -0
  1072. package/dist/sandbox-module-fixtures.js +214 -0
  1073. package/dist/sandbox-module-fixtures.js.map +1 -0
  1074. package/dist/sandbox-toolbelt.d.ts +13 -0
  1075. package/dist/sandbox-toolbelt.d.ts.map +1 -0
  1076. package/dist/sandbox-toolbelt.js +64 -0
  1077. package/dist/sandbox-toolbelt.js.map +1 -0
  1078. package/dist/security-monitor.d.ts +89 -0
  1079. package/dist/security-monitor.d.ts.map +1 -0
  1080. package/dist/security-monitor.js +307 -0
  1081. package/dist/security-monitor.js.map +1 -0
  1082. package/dist/serpapi/catalog.d.ts +101 -0
  1083. package/dist/serpapi/catalog.d.ts.map +1 -0
  1084. package/dist/serpapi/catalog.js +246 -0
  1085. package/dist/serpapi/catalog.js.map +1 -0
  1086. package/dist/serpapi/client.d.ts +81 -0
  1087. package/dist/serpapi/client.d.ts.map +1 -0
  1088. package/dist/serpapi/client.js +228 -0
  1089. package/dist/serpapi/client.js.map +1 -0
  1090. package/dist/serpapi/errors.d.ts +49 -0
  1091. package/dist/serpapi/errors.d.ts.map +1 -0
  1092. package/dist/serpapi/errors.js +64 -0
  1093. package/dist/serpapi/errors.js.map +1 -0
  1094. package/dist/serpapi/normalize.d.ts +58 -0
  1095. package/dist/serpapi/normalize.d.ts.map +1 -0
  1096. package/dist/serpapi/normalize.js +140 -0
  1097. package/dist/serpapi/normalize.js.map +1 -0
  1098. package/dist/skill-prompt.d.ts +27 -0
  1099. package/dist/skill-prompt.d.ts.map +1 -0
  1100. package/dist/skill-prompt.js +61 -0
  1101. package/dist/skill-prompt.js.map +1 -0
  1102. package/dist/step-executor.d.ts +90 -77
  1103. package/dist/step-executor.d.ts.map +1 -1
  1104. package/dist/step-executor.js +384 -690
  1105. package/dist/step-executor.js.map +1 -1
  1106. package/dist/subagent.d.ts +275 -0
  1107. package/dist/subagent.d.ts.map +1 -0
  1108. package/dist/subagent.js +444 -0
  1109. package/dist/subagent.js.map +1 -0
  1110. package/dist/supervisor/prompt.d.ts +12 -0
  1111. package/dist/supervisor/prompt.d.ts.map +1 -0
  1112. package/dist/supervisor/prompt.js +51 -0
  1113. package/dist/supervisor/prompt.js.map +1 -0
  1114. package/dist/supervisor/supervisor-agent.d.ts +72 -0
  1115. package/dist/supervisor/supervisor-agent.d.ts.map +1 -0
  1116. package/dist/supervisor/supervisor-agent.js +185 -0
  1117. package/dist/supervisor/supervisor-agent.js.map +1 -0
  1118. package/dist/supervisor/tools.d.ts +56 -0
  1119. package/dist/supervisor/tools.d.ts.map +1 -0
  1120. package/dist/supervisor/tools.js +83 -0
  1121. package/dist/supervisor/tools.js.map +1 -0
  1122. package/dist/supervisor/verdict-schema.d.ts +18 -0
  1123. package/dist/supervisor/verdict-schema.d.ts.map +1 -0
  1124. package/dist/supervisor/verdict-schema.js +58 -0
  1125. package/dist/supervisor/verdict-schema.js.map +1 -0
  1126. package/dist/system-skills.d.ts +68 -0
  1127. package/dist/system-skills.d.ts.map +1 -0
  1128. package/dist/system-skills.js +168 -0
  1129. package/dist/system-skills.js.map +1 -0
  1130. package/dist/task-executor.d.ts +90 -40
  1131. package/dist/task-executor.d.ts.map +1 -1
  1132. package/dist/task-executor.js +259 -282
  1133. package/dist/task-executor.js.map +1 -1
  1134. package/dist/task-planner.d.ts +18 -12
  1135. package/dist/task-planner.d.ts.map +1 -1
  1136. package/dist/task-planner.js +342 -328
  1137. package/dist/task-planner.js.map +1 -1
  1138. package/dist/timeline-preview/compare.d.ts +27 -0
  1139. package/dist/timeline-preview/compare.d.ts.map +1 -0
  1140. package/dist/timeline-preview/compare.js +71 -0
  1141. package/dist/timeline-preview/compare.js.map +1 -0
  1142. package/dist/timeline-preview/frames.d.ts +167 -0
  1143. package/dist/timeline-preview/frames.d.ts.map +1 -0
  1144. package/dist/timeline-preview/frames.js +646 -0
  1145. package/dist/timeline-preview/frames.js.map +1 -0
  1146. package/dist/timeline-preview/model3d.d.ts +67 -0
  1147. package/dist/timeline-preview/model3d.d.ts.map +1 -0
  1148. package/dist/timeline-preview/model3d.js +165 -0
  1149. package/dist/timeline-preview/model3d.js.map +1 -0
  1150. package/dist/timeline-preview/rasterize.d.ts +33 -0
  1151. package/dist/timeline-preview/rasterize.d.ts.map +1 -0
  1152. package/dist/timeline-preview/rasterize.js +83 -0
  1153. package/dist/timeline-preview/rasterize.js.map +1 -0
  1154. package/dist/timeline-preview/sheet.d.ts +38 -0
  1155. package/dist/timeline-preview/sheet.d.ts.map +1 -0
  1156. package/dist/timeline-preview/sheet.js +72 -0
  1157. package/dist/timeline-preview/sheet.js.map +1 -0
  1158. package/dist/tools/asset-persist.d.ts +29 -0
  1159. package/dist/tools/asset-persist.d.ts.map +1 -0
  1160. package/dist/tools/asset-persist.js +78 -0
  1161. package/dist/tools/asset-persist.js.map +1 -0
  1162. package/dist/tools/base-tool.d.ts +52 -5
  1163. package/dist/tools/base-tool.d.ts.map +1 -1
  1164. package/dist/tools/base-tool.js +180 -3
  1165. package/dist/tools/base-tool.js.map +1 -1
  1166. package/dist/tools/binary-output.d.ts +54 -0
  1167. package/dist/tools/binary-output.d.ts.map +1 -0
  1168. package/dist/tools/binary-output.js +127 -0
  1169. package/dist/tools/binary-output.js.map +1 -0
  1170. package/dist/tools/browser-tools.d.ts +5 -29
  1171. package/dist/tools/browser-tools.d.ts.map +1 -1
  1172. package/dist/tools/browser-tools.js +5 -205
  1173. package/dist/tools/browser-tools.js.map +1 -1
  1174. package/dist/tools/builtin-tools.d.ts +52 -0
  1175. package/dist/tools/builtin-tools.d.ts.map +1 -0
  1176. package/dist/tools/builtin-tools.js +276 -0
  1177. package/dist/tools/builtin-tools.js.map +1 -0
  1178. package/dist/tools/control-tool.d.ts +2 -5
  1179. package/dist/tools/control-tool.d.ts.map +1 -1
  1180. package/dist/tools/control-tool.js +18 -15
  1181. package/dist/tools/control-tool.js.map +1 -1
  1182. package/dist/tools/dataseo-tools.d.ts +34 -32
  1183. package/dist/tools/dataseo-tools.d.ts.map +1 -1
  1184. package/dist/tools/dataseo-tools.js +148 -233
  1185. package/dist/tools/dataseo-tools.js.map +1 -1
  1186. package/dist/tools/external-capability-tools.d.ts +36 -0
  1187. package/dist/tools/external-capability-tools.d.ts.map +1 -0
  1188. package/dist/tools/external-capability-tools.js +41 -0
  1189. package/dist/tools/external-capability-tools.js.map +1 -0
  1190. package/dist/tools/external-mcp-tools.d.ts +139 -0
  1191. package/dist/tools/external-mcp-tools.d.ts.map +1 -0
  1192. package/dist/tools/external-mcp-tools.js +552 -0
  1193. package/dist/tools/external-mcp-tools.js.map +1 -0
  1194. package/dist/tools/finish-step-tool.d.ts +1 -1
  1195. package/dist/tools/finish-step-tool.d.ts.map +1 -1
  1196. package/dist/tools/finish-step-tool.js +3 -3
  1197. package/dist/tools/finish-step-tool.js.map +1 -1
  1198. package/dist/tools/google-tools.d.ts +28 -39
  1199. package/dist/tools/google-tools.d.ts.map +1 -1
  1200. package/dist/tools/google-tools.js +51 -164
  1201. package/dist/tools/google-tools.js.map +1 -1
  1202. package/dist/tools/google-workspace-tools.d.ts +23 -0
  1203. package/dist/tools/google-workspace-tools.d.ts.map +1 -0
  1204. package/dist/tools/google-workspace-tools.js +26 -0
  1205. package/dist/tools/google-workspace-tools.js.map +1 -0
  1206. package/dist/tools/graph-validation-registry.d.ts +33 -0
  1207. package/dist/tools/graph-validation-registry.d.ts.map +1 -0
  1208. package/dist/tools/graph-validation-registry.js +54 -0
  1209. package/dist/tools/graph-validation-registry.js.map +1 -0
  1210. package/dist/tools/http-tools.d.ts +5 -53
  1211. package/dist/tools/http-tools.d.ts.map +1 -1
  1212. package/dist/tools/http-tools.js +5 -177
  1213. package/dist/tools/http-tools.js.map +1 -1
  1214. package/dist/tools/image-injection.d.ts +51 -0
  1215. package/dist/tools/image-injection.d.ts.map +1 -0
  1216. package/dist/tools/image-injection.js +85 -0
  1217. package/dist/tools/image-injection.js.map +1 -0
  1218. package/dist/tools/mcp-tool-support.d.ts +203 -0
  1219. package/dist/tools/mcp-tool-support.d.ts.map +1 -0
  1220. package/dist/tools/mcp-tool-support.js +536 -0
  1221. package/dist/tools/mcp-tool-support.js.map +1 -0
  1222. package/dist/tools/mcp-tools.d.ts +104 -390
  1223. package/dist/tools/mcp-tools.d.ts.map +1 -1
  1224. package/dist/tools/mcp-tools.js +128 -600
  1225. package/dist/tools/mcp-tools.js.map +1 -1
  1226. package/dist/tools/media-tools.d.ts +9 -272
  1227. package/dist/tools/media-tools.d.ts.map +1 -1
  1228. package/dist/tools/media-tools.js +11 -676
  1229. package/dist/tools/media-tools.js.map +1 -1
  1230. package/dist/tools/memory-tools.d.ts +36 -0
  1231. package/dist/tools/memory-tools.d.ts.map +1 -0
  1232. package/dist/tools/memory-tools.js +52 -0
  1233. package/dist/tools/memory-tools.js.map +1 -0
  1234. package/dist/tools/openai-tools.d.ts +28 -68
  1235. package/dist/tools/openai-tools.d.ts.map +1 -1
  1236. package/dist/tools/openai-tools.js +51 -181
  1237. package/dist/tools/openai-tools.js.map +1 -1
  1238. package/dist/tools/plan-builder-tools.d.ts +141 -7
  1239. package/dist/tools/plan-builder-tools.d.ts.map +1 -1
  1240. package/dist/tools/plan-builder-tools.js +159 -86
  1241. package/dist/tools/plan-builder-tools.js.map +1 -1
  1242. package/dist/tools/run-search-tool.d.ts +82 -0
  1243. package/dist/tools/run-search-tool.d.ts.map +1 -0
  1244. package/dist/tools/run-search-tool.js +121 -0
  1245. package/dist/tools/run-search-tool.js.map +1 -0
  1246. package/dist/tools/run-subtask-tool.d.ts +49 -0
  1247. package/dist/tools/run-subtask-tool.d.ts.map +1 -0
  1248. package/dist/tools/run-subtask-tool.js +88 -0
  1249. package/dist/tools/run-subtask-tool.js.map +1 -0
  1250. package/dist/tools/search-tools.d.ts +5 -36
  1251. package/dist/tools/search-tools.d.ts.map +1 -1
  1252. package/dist/tools/search-tools.js +5 -215
  1253. package/dist/tools/search-tools.js.map +1 -1
  1254. package/dist/tools/serp-providers/apify-provider.d.ts +18 -0
  1255. package/dist/tools/serp-providers/apify-provider.d.ts.map +1 -0
  1256. package/dist/tools/serp-providers/apify-provider.js +93 -0
  1257. package/dist/tools/serp-providers/apify-provider.js.map +1 -0
  1258. package/dist/tools/serp-providers/brave-provider.d.ts +34 -0
  1259. package/dist/tools/serp-providers/brave-provider.d.ts.map +1 -0
  1260. package/dist/tools/serp-providers/brave-provider.js +86 -0
  1261. package/dist/tools/serp-providers/brave-provider.js.map +1 -0
  1262. package/dist/tools/serp-providers/dataforseo-provider.d.ts +14 -1
  1263. package/dist/tools/serp-providers/dataforseo-provider.d.ts.map +1 -1
  1264. package/dist/tools/serp-providers/dataforseo-provider.js +0 -9
  1265. package/dist/tools/serp-providers/dataforseo-provider.js.map +1 -1
  1266. package/dist/tools/serp-providers/gemini-provider.d.ts +45 -0
  1267. package/dist/tools/serp-providers/gemini-provider.d.ts.map +1 -0
  1268. package/dist/tools/serp-providers/gemini-provider.js +148 -0
  1269. package/dist/tools/serp-providers/gemini-provider.js.map +1 -0
  1270. package/dist/tools/serp-providers/index.d.ts +61 -0
  1271. package/dist/tools/serp-providers/index.d.ts.map +1 -1
  1272. package/dist/tools/serp-providers/index.js +119 -3
  1273. package/dist/tools/serp-providers/index.js.map +1 -1
  1274. package/dist/tools/serp-providers/openai-provider.d.ts +58 -0
  1275. package/dist/tools/serp-providers/openai-provider.d.ts.map +1 -0
  1276. package/dist/tools/serp-providers/openai-provider.js +113 -0
  1277. package/dist/tools/serp-providers/openai-provider.js.map +1 -0
  1278. package/dist/tools/serp-providers/serpapi-provider.d.ts +9 -5
  1279. package/dist/tools/serp-providers/serpapi-provider.d.ts.map +1 -1
  1280. package/dist/tools/serp-providers/serpapi-provider.js +26 -44
  1281. package/dist/tools/serp-providers/serpapi-provider.js.map +1 -1
  1282. package/dist/tools/serp-tool-factory.d.ts +27 -0
  1283. package/dist/tools/serp-tool-factory.d.ts.map +1 -0
  1284. package/dist/tools/serp-tool-factory.js +56 -0
  1285. package/dist/tools/serp-tool-factory.js.map +1 -0
  1286. package/dist/tools/shared-tools.d.ts +33 -0
  1287. package/dist/tools/shared-tools.d.ts.map +1 -0
  1288. package/dist/tools/shared-tools.js +39 -0
  1289. package/dist/tools/shared-tools.js.map +1 -0
  1290. package/dist/tools/start-subtask-tool.d.ts +51 -0
  1291. package/dist/tools/start-subtask-tool.d.ts.map +1 -0
  1292. package/dist/tools/start-subtask-tool.js +189 -0
  1293. package/dist/tools/start-subtask-tool.js.map +1 -0
  1294. package/dist/tools/submit-code-tool.d.ts +159 -0
  1295. package/dist/tools/submit-code-tool.d.ts.map +1 -0
  1296. package/dist/tools/submit-code-tool.js +209 -0
  1297. package/dist/tools/submit-code-tool.js.map +1 -0
  1298. package/dist/tools/subtask-fields.d.ts +11 -0
  1299. package/dist/tools/subtask-fields.d.ts.map +1 -0
  1300. package/dist/tools/subtask-fields.js +11 -0
  1301. package/dist/tools/subtask-fields.js.map +1 -0
  1302. package/dist/tools/todo-tools.d.ts +15 -0
  1303. package/dist/tools/todo-tools.d.ts.map +1 -0
  1304. package/dist/tools/todo-tools.js +15 -0
  1305. package/dist/tools/todo-tools.js.map +1 -0
  1306. package/dist/tools/tool-permissions.d.ts +40 -0
  1307. package/dist/tools/tool-permissions.d.ts.map +1 -0
  1308. package/dist/tools/tool-permissions.js +52 -0
  1309. package/dist/tools/tool-permissions.js.map +1 -0
  1310. package/dist/tools/tool-search.d.ts +39 -0
  1311. package/dist/tools/tool-search.d.ts.map +1 -0
  1312. package/dist/tools/tool-search.js +108 -0
  1313. package/dist/tools/tool-search.js.map +1 -0
  1314. package/dist/tools/vector-tool-support.d.ts +15 -0
  1315. package/dist/tools/vector-tool-support.d.ts.map +1 -0
  1316. package/dist/tools/vector-tool-support.js +133 -0
  1317. package/dist/tools/vector-tool-support.js.map +1 -0
  1318. package/dist/tools/vector-tools.d.ts +13 -220
  1319. package/dist/tools/vector-tools.d.ts.map +1 -1
  1320. package/dist/tools/vector-tools.js +7 -578
  1321. package/dist/tools/vector-tools.js.map +1 -1
  1322. package/dist/tools/wait-subtasks-tool.d.ts +27 -0
  1323. package/dist/tools/wait-subtasks-tool.d.ts.map +1 -0
  1324. package/dist/tools/wait-subtasks-tool.js +66 -0
  1325. package/dist/tools/wait-subtasks-tool.js.map +1 -0
  1326. package/dist/tsconfig.tests.tmp.tsbuildinfo +1 -0
  1327. package/dist/types.d.ts +16 -31
  1328. package/dist/types.d.ts.map +1 -1
  1329. package/dist/types.js +8 -1
  1330. package/dist/types.js.map +1 -1
  1331. package/dist/utils/dag-scheduler.d.ts +85 -0
  1332. package/dist/utils/dag-scheduler.d.ts.map +1 -0
  1333. package/dist/utils/dag-scheduler.js +180 -0
  1334. package/dist/utils/dag-scheduler.js.map +1 -0
  1335. package/dist/utils/json-parser.d.ts +32 -1
  1336. package/dist/utils/json-parser.d.ts.map +1 -1
  1337. package/dist/utils/json-parser.js +145 -10
  1338. package/dist/utils/json-parser.js.map +1 -1
  1339. package/dist/utils/json-schema-validate.d.ts +29 -0
  1340. package/dist/utils/json-schema-validate.d.ts.map +1 -0
  1341. package/dist/utils/json-schema-validate.js +228 -0
  1342. package/dist/utils/json-schema-validate.js.map +1 -0
  1343. package/dist/utils/link-abort.d.ts +13 -0
  1344. package/dist/utils/link-abort.d.ts.map +1 -0
  1345. package/dist/utils/link-abort.js +23 -0
  1346. package/dist/utils/link-abort.js.map +1 -0
  1347. package/dist/utils/merge-generators.d.ts +58 -0
  1348. package/dist/utils/merge-generators.d.ts.map +1 -0
  1349. package/dist/utils/merge-generators.js +148 -0
  1350. package/dist/utils/merge-generators.js.map +1 -0
  1351. package/dist/utils/remove-base64-images.d.ts +0 -5
  1352. package/dist/utils/remove-base64-images.d.ts.map +1 -1
  1353. package/dist/utils/remove-base64-images.js.map +1 -1
  1354. package/dist/utils/step-failure.d.ts +20 -0
  1355. package/dist/utils/step-failure.d.ts.map +1 -0
  1356. package/dist/utils/step-failure.js +43 -0
  1357. package/dist/utils/step-failure.js.map +1 -0
  1358. package/dist/utils/think-tags.d.ts +16 -0
  1359. package/dist/utils/think-tags.d.ts.map +1 -0
  1360. package/dist/utils/think-tags.js +23 -0
  1361. package/dist/utils/think-tags.js.map +1 -0
  1362. package/dist/utils/type-guards.d.ts +26 -0
  1363. package/dist/utils/type-guards.d.ts.map +1 -0
  1364. package/dist/utils/type-guards.js +44 -0
  1365. package/dist/utils/type-guards.js.map +1 -0
  1366. package/dist/utils/ui-event-buffer.d.ts +18 -0
  1367. package/dist/utils/ui-event-buffer.d.ts.map +1 -0
  1368. package/dist/utils/ui-event-buffer.js +18 -0
  1369. package/dist/utils/ui-event-buffer.js.map +1 -0
  1370. package/dist/utils/wrap-generators-parallel.d.ts +0 -5
  1371. package/dist/utils/wrap-generators-parallel.d.ts.map +1 -1
  1372. package/dist/utils/wrap-generators-parallel.js +3 -6
  1373. package/dist/utils/wrap-generators-parallel.js.map +1 -1
  1374. package/dist/wasm-sandbox/host.d.ts +106 -0
  1375. package/dist/wasm-sandbox/host.d.ts.map +1 -0
  1376. package/dist/wasm-sandbox/host.js +409 -0
  1377. package/dist/wasm-sandbox/host.js.map +1 -0
  1378. package/dist/wasm-sandbox/workers.d.ts +43 -0
  1379. package/dist/wasm-sandbox/workers.d.ts.map +1 -0
  1380. package/dist/wasm-sandbox/workers.js +150 -0
  1381. package/dist/wasm-sandbox/workers.js.map +1 -0
  1382. package/dist/workspace-paths.d.ts +40 -0
  1383. package/dist/workspace-paths.d.ts.map +1 -0
  1384. package/dist/workspace-paths.js +102 -0
  1385. package/dist/workspace-paths.js.map +1 -0
  1386. package/dist/yt-dlp-gate.d.ts +19 -0
  1387. package/dist/yt-dlp-gate.d.ts.map +1 -0
  1388. package/dist/yt-dlp-gate.js +22 -0
  1389. package/dist/yt-dlp-gate.js.map +1 -0
  1390. package/package.json +112 -14
  1391. package/dist/agent-executor.d.ts +0 -62
  1392. package/dist/agent-executor.d.ts.map +0 -1
  1393. package/dist/agent-executor.js +0 -324
  1394. package/dist/agent-executor.js.map +0 -1
  1395. package/dist/agent-step-executor.d.ts +0 -28
  1396. package/dist/agent-step-executor.d.ts.map +0 -1
  1397. package/dist/agent-step-executor.js +0 -99
  1398. package/dist/agent-step-executor.js.map +0 -1
  1399. package/dist/agent-workflow-runner.d.ts +0 -31
  1400. package/dist/agent-workflow-runner.d.ts.map +0 -1
  1401. package/dist/agent-workflow-runner.js +0 -124
  1402. package/dist/agent-workflow-runner.js.map +0 -1
  1403. package/dist/agent.d.ts +0 -115
  1404. package/dist/agent.d.ts.map +0 -1
  1405. package/dist/agent.js +0 -587
  1406. package/dist/agent.js.map +0 -1
  1407. package/dist/base-agent.d.ts +0 -42
  1408. package/dist/base-agent.d.ts.map +0 -1
  1409. package/dist/base-agent.js +0 -29
  1410. package/dist/base-agent.js.map +0 -1
  1411. package/dist/graph-planner.d.ts +0 -56
  1412. package/dist/graph-planner.d.ts.map +0 -1
  1413. package/dist/graph-planner.js +0 -311
  1414. package/dist/graph-planner.js.map +0 -1
  1415. package/dist/multi-mode-agent.d.ts +0 -86
  1416. package/dist/multi-mode-agent.d.ts.map +0 -1
  1417. package/dist/multi-mode-agent.js +0 -476
  1418. package/dist/multi-mode-agent.js.map +0 -1
  1419. package/dist/prompts/graph-planner-prompt.d.ts +0 -48
  1420. package/dist/prompts/graph-planner-prompt.d.ts.map +0 -1
  1421. package/dist/prompts/graph-planner-prompt.js +0 -180
  1422. package/dist/prompts/graph-planner-prompt.js.map +0 -1
  1423. package/dist/reject-agentic-provider.d.ts +0 -21
  1424. package/dist/reject-agentic-provider.d.ts.map +0 -1
  1425. package/dist/reject-agentic-provider.js +0 -32
  1426. package/dist/reject-agentic-provider.js.map +0 -1
  1427. package/dist/simple-agent.d.ts +0 -29
  1428. package/dist/simple-agent.d.ts.map +0 -1
  1429. package/dist/simple-agent.js +0 -54
  1430. package/dist/simple-agent.js.map +0 -1
  1431. package/dist/sub-agent-planner.d.ts +0 -33
  1432. package/dist/sub-agent-planner.d.ts.map +0 -1
  1433. package/dist/sub-agent-planner.js +0 -203
  1434. package/dist/sub-agent-planner.js.map +0 -1
  1435. package/dist/team/db-task-board.d.ts +0 -54
  1436. package/dist/team/db-task-board.d.ts.map +0 -1
  1437. package/dist/team/db-task-board.js +0 -361
  1438. package/dist/team/db-task-board.js.map +0 -1
  1439. package/dist/team/edge-message-bus.d.ts +0 -51
  1440. package/dist/team/edge-message-bus.d.ts.map +0 -1
  1441. package/dist/team/edge-message-bus.js +0 -169
  1442. package/dist/team/edge-message-bus.js.map +0 -1
  1443. package/dist/team/edge-task-board.d.ts +0 -77
  1444. package/dist/team/edge-task-board.d.ts.map +0 -1
  1445. package/dist/team/edge-task-board.js +0 -140
  1446. package/dist/team/edge-task-board.js.map +0 -1
  1447. package/dist/team/index.d.ts +0 -16
  1448. package/dist/team/index.d.ts.map +0 -1
  1449. package/dist/team/index.js +0 -17
  1450. package/dist/team/index.js.map +0 -1
  1451. package/dist/team/message-bus.d.ts +0 -58
  1452. package/dist/team/message-bus.d.ts.map +0 -1
  1453. package/dist/team/message-bus.js +0 -151
  1454. package/dist/team/message-bus.js.map +0 -1
  1455. package/dist/team/task-board.d.ts +0 -106
  1456. package/dist/team/task-board.d.ts.map +0 -1
  1457. package/dist/team/task-board.js +0 -370
  1458. package/dist/team/task-board.js.map +0 -1
  1459. package/dist/team/team-executor.d.ts +0 -72
  1460. package/dist/team/team-executor.d.ts.map +0 -1
  1461. package/dist/team/team-executor.js +0 -466
  1462. package/dist/team/team-executor.js.map +0 -1
  1463. package/dist/team/team-tools.d.ts +0 -252
  1464. package/dist/team/team-tools.d.ts.map +0 -1
  1465. package/dist/team/team-tools.js +0 -412
  1466. package/dist/team/team-tools.js.map +0 -1
  1467. package/dist/team/types.d.ts +0 -198
  1468. package/dist/team/types.d.ts.map +0 -1
  1469. package/dist/team/types.js +0 -8
  1470. package/dist/team/types.js.map +0 -1
  1471. package/dist/tools/add-edge-tool.d.ts +0 -18
  1472. package/dist/tools/add-edge-tool.d.ts.map +0 -1
  1473. package/dist/tools/add-edge-tool.js +0 -92
  1474. package/dist/tools/add-edge-tool.js.map +0 -1
  1475. package/dist/tools/add-node-tool.d.ts +0 -22
  1476. package/dist/tools/add-node-tool.d.ts.map +0 -1
  1477. package/dist/tools/add-node-tool.js +0 -128
  1478. package/dist/tools/add-node-tool.js.map +0 -1
  1479. package/dist/tools/asset-tools.d.ts +0 -58
  1480. package/dist/tools/asset-tools.d.ts.map +0 -1
  1481. package/dist/tools/asset-tools.js +0 -191
  1482. package/dist/tools/asset-tools.js.map +0 -1
  1483. package/dist/tools/calculator-tool.d.ts +0 -24
  1484. package/dist/tools/calculator-tool.d.ts.map +0 -1
  1485. package/dist/tools/calculator-tool.js +0 -64
  1486. package/dist/tools/calculator-tool.js.map +0 -1
  1487. package/dist/tools/claude-code-tools.d.ts +0 -96
  1488. package/dist/tools/claude-code-tools.d.ts.map +0 -1
  1489. package/dist/tools/claude-code-tools.js +0 -463
  1490. package/dist/tools/claude-code-tools.js.map +0 -1
  1491. package/dist/tools/code-tools.d.ts +0 -26
  1492. package/dist/tools/code-tools.d.ts.map +0 -1
  1493. package/dist/tools/code-tools.js +0 -82
  1494. package/dist/tools/code-tools.js.map +0 -1
  1495. package/dist/tools/create-plan-tool.d.ts +0 -29
  1496. package/dist/tools/create-plan-tool.d.ts.map +0 -1
  1497. package/dist/tools/create-plan-tool.js +0 -355
  1498. package/dist/tools/create-plan-tool.js.map +0 -1
  1499. package/dist/tools/create-task-tool.d.ts +0 -28
  1500. package/dist/tools/create-task-tool.d.ts.map +0 -1
  1501. package/dist/tools/create-task-tool.js +0 -254
  1502. package/dist/tools/create-task-tool.js.map +0 -1
  1503. package/dist/tools/email-tools.d.ts +0 -76
  1504. package/dist/tools/email-tools.d.ts.map +0 -1
  1505. package/dist/tools/email-tools.js +0 -259
  1506. package/dist/tools/email-tools.js.map +0 -1
  1507. package/dist/tools/filesystem-tools.d.ts +0 -77
  1508. package/dist/tools/filesystem-tools.d.ts.map +0 -1
  1509. package/dist/tools/filesystem-tools.js +0 -334
  1510. package/dist/tools/filesystem-tools.js.map +0 -1
  1511. package/dist/tools/find-model-tool.d.ts +0 -25
  1512. package/dist/tools/find-model-tool.d.ts.map +0 -1
  1513. package/dist/tools/find-model-tool.js +0 -236
  1514. package/dist/tools/find-model-tool.js.map +0 -1
  1515. package/dist/tools/finish-graph-tool.d.ts +0 -23
  1516. package/dist/tools/finish-graph-tool.d.ts.map +0 -1
  1517. package/dist/tools/finish-graph-tool.js +0 -46
  1518. package/dist/tools/finish-graph-tool.js.map +0 -1
  1519. package/dist/tools/js-code-tool.d.ts +0 -30
  1520. package/dist/tools/js-code-tool.d.ts.map +0 -1
  1521. package/dist/tools/js-code-tool.js +0 -98
  1522. package/dist/tools/js-code-tool.js.map +0 -1
  1523. package/dist/tools/local-get-node-info-tool.d.ts +0 -19
  1524. package/dist/tools/local-get-node-info-tool.d.ts.map +0 -1
  1525. package/dist/tools/local-get-node-info-tool.js +0 -75
  1526. package/dist/tools/local-get-node-info-tool.js.map +0 -1
  1527. package/dist/tools/local-list-nodes-tool.d.ts +0 -19
  1528. package/dist/tools/local-list-nodes-tool.d.ts.map +0 -1
  1529. package/dist/tools/local-list-nodes-tool.js +0 -69
  1530. package/dist/tools/local-list-nodes-tool.js.map +0 -1
  1531. package/dist/tools/local-search-nodes-tool.d.ts +0 -21
  1532. package/dist/tools/local-search-nodes-tool.d.ts.map +0 -1
  1533. package/dist/tools/local-search-nodes-tool.js +0 -111
  1534. package/dist/tools/local-search-nodes-tool.js.map +0 -1
  1535. package/dist/tools/math-tools.d.ts +0 -156
  1536. package/dist/tools/math-tools.d.ts.map +0 -1
  1537. package/dist/tools/math-tools.js +0 -422
  1538. package/dist/tools/math-tools.js.map +0 -1
  1539. package/dist/tools/model-tools.d.ts +0 -25
  1540. package/dist/tools/model-tools.d.ts.map +0 -1
  1541. package/dist/tools/model-tools.js +0 -48
  1542. package/dist/tools/model-tools.js.map +0 -1
  1543. package/dist/tools/pdf-tools.d.ts +0 -152
  1544. package/dist/tools/pdf-tools.d.ts.map +0 -1
  1545. package/dist/tools/pdf-tools.js +0 -339
  1546. package/dist/tools/pdf-tools.js.map +0 -1
  1547. package/dist/tools/tool-registry.d.ts +0 -9
  1548. package/dist/tools/tool-registry.d.ts.map +0 -1
  1549. package/dist/tools/tool-registry.js +0 -17
  1550. package/dist/tools/tool-registry.js.map +0 -1
  1551. package/dist/tools/workspace-tools.d.ts +0 -58
  1552. package/dist/tools/workspace-tools.d.ts.map +0 -1
  1553. package/dist/tools/workspace-tools.js +0 -152
  1554. package/dist/tools/workspace-tools.js.map +0 -1
@@ -0,0 +1,1262 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { mkdtemp, readFile, readdir, rm } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { getManagedWorkspaceDir, managedWorkspaceKey, workspaceStorageKind } from "@nodetool-ai/config";
5
+ import { AmbiguousGameIdError, Asset, Game, Prediction, Project, Workspace } from "@nodetool-ai/models";
6
+ import { gameAssetBinding, gameDocument, gameInputFrame, shortResourceId } from "@nodetool-ai/protocol";
7
+ import { autoplayNativeGame, MAX_GAME_ROUTE_TICKS, createScriptedGameSession, createTopDownRoomGame, validateGame, gameDocumentOp, GameOpError } from "@nodetool-ai/game-runtime";
8
+ import { workspaceFromRow } from "@nodetool-ai/execution/service";
9
+ import { assetKeyCandidates, assetObjectKey } from "@nodetool-ai/storage";
10
+ import { gameSpecs } from "./game.specs.js";
11
+ import { persistOutput } from "../tools/asset-persist.js";
12
+ import { getExampleGameBundle, installExampleGameAssets, listExampleGames } from "../game-examples.js";
13
+ const MAX_PLAYTEST_TICKS = MAX_GAME_ROUTE_TICKS;
14
+ const MAX_CAPTURE_FRAMES = 8;
15
+ const MAX_BUILD_ASSETS = 128;
16
+ const MAX_BUILD_ASSET_BYTES = 64 * 1024 * 1024;
17
+ const MAX_BUILD_BYTES = 256 * 1024 * 1024;
18
+ const MAX_BUILD_FILES = 256;
19
+ const MEDIA_EXTENSIONS = {
20
+ "image/png": "png",
21
+ "image/jpeg": "jpg",
22
+ "image/webp": "webp",
23
+ "audio/wav": "wav",
24
+ "audio/ogg": "ogg",
25
+ "audio/mpeg": "mp3",
26
+ "font/ttf": "ttf",
27
+ "font/otf": "otf"
28
+ };
29
+ function userId(run) {
30
+ return run.context.userId ?? null;
31
+ }
32
+ async function ownedGame(user, id) {
33
+ try {
34
+ const game = await Game.findOwned(user, id);
35
+ return game && (await Project.findOwned(user, game.project_id)) ? game : null;
36
+ }
37
+ catch (error) {
38
+ if (error instanceof AmbiguousGameIdError)
39
+ return null;
40
+ throw error;
41
+ }
42
+ }
43
+ function openWorkspace(row) {
44
+ return workspaceFromRow(row);
45
+ }
46
+ async function workspaceOf(user, game) {
47
+ const row = await Workspace.find(user, game.workspace_id);
48
+ return row && row.project_id === game.project_id ? openWorkspace(row) : null;
49
+ }
50
+ async function projectWorkspace(user, projectId) {
51
+ const existing = (await Workspace.listByProject(user, projectId))
52
+ .find((row) => row.isAccessible() && (process.env["NODETOOL_ENV"] !== "production" || row.isManaged()));
53
+ if (existing)
54
+ return existing;
55
+ const defaultRow = await Workspace.ensureDefault(user);
56
+ const managedPath = workspaceStorageKind() === "cloud"
57
+ ? managedWorkspaceKey(user)
58
+ : getManagedWorkspaceDir(user);
59
+ const rootRow = defaultRow.isManaged() ? defaultRow : new Workspace({
60
+ user_id: user,
61
+ name: "Managed workspace",
62
+ path: managedPath,
63
+ is_default: false
64
+ });
65
+ const root = openWorkspace(rootRow);
66
+ if (!root)
67
+ return null;
68
+ const segment = createHash("sha256").update(projectId).digest("hex");
69
+ await root.mkdir(`projects/${segment}`);
70
+ const path = rootRow.isVirtual()
71
+ ? `${rootRow.path}/projects/${segment}`
72
+ : join(rootRow.path, "projects", segment);
73
+ return (await Workspace.create({
74
+ user_id: user,
75
+ project_id: projectId,
76
+ name: "Game workspace",
77
+ path,
78
+ is_default: false
79
+ }));
80
+ }
81
+ function revisionPath(game, revision) {
82
+ return `${game.source_root}/revisions/${revision}/game.json`;
83
+ }
84
+ async function readDocument(workspace, game, revision) {
85
+ if (!/^[a-f0-9]{32}$/.test(revision))
86
+ return null;
87
+ const raw = await workspace.readText(revisionPath(game, revision));
88
+ if (raw === null)
89
+ return null;
90
+ const parsed = gameDocument.safeParse(JSON.parse(raw));
91
+ return parsed.success && parsed.data.id === game.id && parsed.data.revision === revision
92
+ ? parsed.data
93
+ : null;
94
+ }
95
+ async function readSource(workspace, game, source, revision) {
96
+ if (source !== undefined && source !== "draft" && source !== "revision")
97
+ return null;
98
+ if (source === "revision" || revision !== undefined) {
99
+ return readDocument(workspace, game, typeof revision === "string" ? revision : game.current_revision);
100
+ }
101
+ const draft = await Game.readDraft(game.user_id, game.id, workspace);
102
+ return draft?.document ?? null;
103
+ }
104
+ function outline(document) {
105
+ return {
106
+ settings: {
107
+ schemaVersion: document.schemaVersion,
108
+ entrySceneId: document.entrySceneId,
109
+ pixelsPerUnit: document.pixelsPerUnit,
110
+ tickRate: document.tickRate,
111
+ inputActions: document.inputActions,
112
+ collisionLayers: document.collisionLayers,
113
+ renderEffects: document.renderEffects,
114
+ hudEffectOrder: document.hudEffectOrder
115
+ },
116
+ scenes: document.scenes.map((scene) => ({
117
+ id: scene.id,
118
+ name: scene.name,
119
+ music: scene.music,
120
+ lighting: scene.lighting,
121
+ backgrounds: scene.backgrounds,
122
+ entities: scene.entities.map((entity) => ({
123
+ id: entity.id,
124
+ name: entity.name,
125
+ parentId: entity.parentId,
126
+ components: Object.keys(entity).filter((key) => !["id", "name", "parentId", "behaviors", "templateOnly"].includes(key)),
127
+ behaviorKinds: entity.behaviors.map((behavior) => behavior.kind),
128
+ scriptBytes: entity.behaviors.reduce((total, behavior) => total + (behavior.kind === "script" ? Buffer.byteLength(behavior.source) : 0), 0)
129
+ }))
130
+ })),
131
+ assets: Object.fromEntries(Object.entries(document.assets).map(([slot, asset]) => [slot, { mediaKind: asset.mediaKind, width: asset.width, height: asset.height, assetId: asset.assetId }]))
132
+ };
133
+ }
134
+ function inputFrames(value, requiredTicks = 0) {
135
+ if (value === undefined)
136
+ value = [];
137
+ if (!Array.isArray(value))
138
+ return { error: "inputs must be an array" };
139
+ const frames = [];
140
+ for (const item of value) {
141
+ const parsed = gameInputFrame.safeParse(item);
142
+ if (!parsed.success)
143
+ return { error: "Invalid input frame" };
144
+ const repeats = typeof item === "object" && item !== null && "ticks" in item ? item.ticks : 1;
145
+ if (!Number.isSafeInteger(repeats) || typeof repeats !== "number" || repeats < 1 || frames.length + repeats > MAX_PLAYTEST_TICKS) {
146
+ return { error: `inputs must total at most ${MAX_PLAYTEST_TICKS} ticks` };
147
+ }
148
+ for (let index = 0; index < repeats; index += 1) {
149
+ frames.push({ pressed: parsed.data.pressed, justPressed: index === 0 ? parsed.data.justPressed : [] });
150
+ }
151
+ }
152
+ if (requiredTicks > MAX_PLAYTEST_TICKS)
153
+ return { error: `inputs must total at most ${MAX_PLAYTEST_TICKS} ticks` };
154
+ while (frames.length < requiredTicks)
155
+ frames.push({ pressed: [], justPressed: [] });
156
+ return frames;
157
+ }
158
+ function captureTicks(value, fallback) {
159
+ const ticks = value === undefined ? fallback : value;
160
+ if (!Array.isArray(ticks) || ticks.length > MAX_CAPTURE_FRAMES || ticks.some((tick) => !Number.isSafeInteger(tick) || tick < 0 || tick > MAX_PLAYTEST_TICKS)) {
161
+ return { error: `ticks must contain at most ${MAX_CAPTURE_FRAMES} values between 0 and ${MAX_PLAYTEST_TICKS}` };
162
+ }
163
+ return [...new Set(ticks)].sort((a, b) => a - b);
164
+ }
165
+ async function captureFrames(run, user, document, ticks, inputs, seed, options) {
166
+ const started = Date.now();
167
+ const deadlineAt = options.deadlineAt ?? started + 15_000;
168
+ let cancelled = false;
169
+ let wallTimeLimited = false;
170
+ let simulatedTicks = 0;
171
+ const budgetReached = () => {
172
+ cancelled = run.context.signal?.aborted === true;
173
+ wallTimeLimited = Date.now() >= deadlineAt;
174
+ return cancelled || wallTimeLimited;
175
+ };
176
+ const { captureGameFrame } = await import("@nodetool-ai/game-renderer/node");
177
+ const diagnostics = [];
178
+ const storage = run.context.assetStorage;
179
+ const assetCache = new Map();
180
+ const resolveAsset = async (slot) => {
181
+ const binding = document.assets[slot];
182
+ const assetId = binding?.assetId;
183
+ if (!assetId || !/^[a-f0-9]{32}$/.test(assetId) || !storage)
184
+ return null;
185
+ if (assetCache.has(assetId))
186
+ return assetCache.get(assetId) ?? null;
187
+ const asset = await Asset.find(user, assetId);
188
+ const extension = asset && MEDIA_EXTENSIONS[asset.content_type];
189
+ let bytes = null;
190
+ if (extension) {
191
+ for (const key of assetKeyCandidates(user, `${assetId}.${extension}`)) {
192
+ bytes = await storage.retrieve(storage.uriForKey(key));
193
+ if (bytes)
194
+ break;
195
+ }
196
+ }
197
+ assetCache.set(assetId, bytes);
198
+ return bytes;
199
+ };
200
+ const session = await createScriptedGameSession(document, seed);
201
+ const entries = [];
202
+ try {
203
+ for (const tick of ticks) {
204
+ if (budgetReached()) {
205
+ break;
206
+ }
207
+ while (simulatedTicks < tick) {
208
+ if (simulatedTicks % 240 === 0) {
209
+ await new Promise((resolve) => setTimeout(resolve, 0));
210
+ }
211
+ if (budgetReached()) {
212
+ break;
213
+ }
214
+ simulatedTicks = session.step(inputs[simulatedTicks] ?? { pressed: [], justPressed: [] }).tick;
215
+ }
216
+ if (budgetReached()) {
217
+ break;
218
+ }
219
+ let frame = session.frame();
220
+ const camera = options.camera;
221
+ if (camera && typeof camera === "object") {
222
+ const c = camera;
223
+ if ([c.x, c.y, c.zoom].every((value) => typeof value === "number" && Number.isFinite(value)) && c.zoom > 0) {
224
+ frame = { ...frame, camera: { x: c.x, y: c.y, zoom: c.zoom } };
225
+ }
226
+ }
227
+ const scale = typeof options.scale === "number" && Number.isFinite(options.scale) && options.scale > 0 && options.scale <= 4 ? options.scale : 1;
228
+ const start = diagnostics.length;
229
+ let png;
230
+ try {
231
+ png = await captureGameFrame(frame, { resolveAsset, scale, effects: document.renderEffects, hudEffectOrder: document.hudEffectOrder, backend: document.renderEffects?.length ? "webgpu" : "canvas2d", onDiagnostic: (message) => diagnostics.push(message) });
232
+ }
233
+ catch (error) {
234
+ diagnostics.push(`WebGPU capture failed: ${error instanceof Error ? error.message : String(error)}`);
235
+ png = await captureGameFrame(frame, { resolveAsset, scale, backend: "canvas2d", onDiagnostic: (message) => diagnostics.push(message) });
236
+ }
237
+ if (budgetReached()) {
238
+ break;
239
+ }
240
+ const pixelScale = frame.pixelsPerUnit * frame.camera.zoom * scale;
241
+ const overlays = Array.isArray(options.overlays) ? options.overlays.filter((value) => typeof value === "string") : [];
242
+ if (overlays.length > 0) {
243
+ const { createCanvas, loadImage } = await import("@napi-rs/canvas");
244
+ const source = await loadImage(Buffer.from(png));
245
+ const canvas = createCanvas(source.width, source.height);
246
+ const context = canvas.getContext("2d");
247
+ context.drawImage(source, 0, 0);
248
+ context.lineWidth = 2;
249
+ context.strokeStyle = "#ffcc00";
250
+ context.fillStyle = "#ffcc00";
251
+ context.font = "14px sans-serif";
252
+ const sx = (x) => canvas.width / 2 + (x - frame.camera.x) * pixelScale;
253
+ const sy = (y) => canvas.height / 2 - (y - frame.camera.y) * pixelScale;
254
+ const definitions = new Map(document.scenes.flatMap((scene) => scene.entities.map((entity) => [entity.id, entity])));
255
+ for (const sprite of frame.sprites) {
256
+ const entity = definitions.get(sprite.entityId);
257
+ if (overlays.includes("ids"))
258
+ context.fillText(sprite.entityId, sx(sprite.x), sy(sprite.y));
259
+ if (overlays.includes("colliders") && entity?.collider2d) {
260
+ const collider = entity.collider2d;
261
+ context.strokeRect(sx(sprite.x - collider.width / 2), sy(sprite.y + collider.height / 2), collider.width * pixelScale, collider.height * pixelScale);
262
+ }
263
+ }
264
+ if (overlays.includes("lights") && frame.lighting) {
265
+ for (const light of frame.lighting.points) {
266
+ context.beginPath();
267
+ context.arc(sx(light.x), sy(light.y), light.radius * pixelScale, 0, Math.PI * 2);
268
+ context.stroke();
269
+ }
270
+ }
271
+ if (overlays.includes("camera_bounds"))
272
+ context.strokeRect(0, 0, canvas.width, canvas.height);
273
+ png = canvas.toBuffer("image/png");
274
+ }
275
+ entries.push({ tick, png, visible_entities: frame.sprites.map((sprite) => ({
276
+ id: sprite.entityId,
277
+ x: Math.round(frame.width * frame.pixelsPerUnit * scale / 2 + (sprite.x - frame.camera.x) * pixelScale),
278
+ y: Math.round(frame.height * frame.pixelsPerUnit * scale / 2 - (sprite.y - frame.camera.y) * pixelScale),
279
+ width: Math.round(sprite.width * sprite.scaleX * pixelScale),
280
+ height: Math.round(sprite.height * sprite.scaleY * pixelScale)
281
+ })), hud_texts: frame.hud.map((label) => label.text), diagnostics: diagnostics.slice(start) });
282
+ }
283
+ }
284
+ finally {
285
+ session.dispose();
286
+ }
287
+ const outcome = {
288
+ ticks: simulatedTicks,
289
+ cancelled,
290
+ wall_time_limited: wallTimeLimited,
291
+ route_complete: !cancelled && !wallTimeLimited && entries.length === ticks.length,
292
+ wall_time_ms: Date.now() - started
293
+ };
294
+ if (options.sheet && entries.length > 1) {
295
+ const { composeContactSheet } = await import("../timeline-preview/sheet.js");
296
+ const sheet = await composeContactSheet(entries.map((entry) => ({ label: `Tick ${entry.tick}`, png: entry.png })));
297
+ const saved = await persistOutput(run.context, sheet.png, { namePrefix: `game-${document.id}-sheet`, mime: "image/png" });
298
+ return { ...outcome, image: { type: "image", asset_id: saved.asset_id, uri: saved.asset_uri ?? saved.path, path: saved.path, mime_type: saved.mime_type }, frames: entries.map(({ tick, visible_entities, hud_texts, diagnostics }) => ({ tick, visible_entities, hud_texts, diagnostics })) };
299
+ }
300
+ const frames = [];
301
+ for (const entry of entries) {
302
+ const saved = await persistOutput(run.context, entry.png, { namePrefix: `game-${document.id}-tick-${entry.tick}`, mime: "image/png" });
303
+ frames.push({ tick: entry.tick, image: { type: "image", asset_id: saved.asset_id, uri: saved.asset_uri ?? saved.path, path: saved.path, mime_type: saved.mime_type }, visible_entities: entry.visible_entities, hud_texts: entry.hud_texts, diagnostics: entry.diagnostics });
304
+ }
305
+ return { ...outcome, frames };
306
+ }
307
+ function validateSource(source, gameId, revision) {
308
+ const parsed = gameDocument.safeParse(source);
309
+ if (!parsed.success)
310
+ return { error: parsed.error.message };
311
+ const result = validateGame({ ...parsed.data, id: gameId, revision });
312
+ return result.document ?? { error: result.errors.join("; ") };
313
+ }
314
+ function summary(game) {
315
+ return {
316
+ id: game.id,
317
+ name: game.name,
318
+ revision: game.current_revision,
319
+ workspace_id: game.workspace_id
320
+ };
321
+ }
322
+ async function publish(user, game, baseRevision, source, message) {
323
+ if (game.current_revision !== baseRevision)
324
+ return { error: "Game was modified concurrently", current_revision: game.current_revision };
325
+ const revision = randomUUID().replace(/-/g, "");
326
+ const document = validateSource(source, game.id, revision);
327
+ if ("error" in document)
328
+ return document;
329
+ const workspace = await workspaceOf(user, game);
330
+ if (!workspace)
331
+ return { error: "Game workspace is unavailable" };
332
+ const draft = await Game.readDraft(user, game.id, workspace);
333
+ if (!draft)
334
+ return { error: "Game draft not found" };
335
+ await workspace.write(revisionPath(game, revision), JSON.stringify(document), "application/json");
336
+ const updated = await Game.publish(user, game.id, baseRevision, revision, draft.game.draft_updated_at, workspace, message);
337
+ if (!updated)
338
+ return { error: "Game was modified concurrently" };
339
+ await workspace.write(`${game.source_root}/drafts/${encodeURIComponent(updated.draft_updated_at)}.json`, JSON.stringify(document), "application/json");
340
+ await workspace.write(`${game.source_root}/draft.json`, JSON.stringify(document), "application/json");
341
+ return { game: summary(updated), document };
342
+ }
343
+ const create = {
344
+ spec: gameSpecs[0],
345
+ impl: async (run, args) => {
346
+ const user = userId(run);
347
+ const projectId = args["project_id"];
348
+ const name = args["name"];
349
+ if (!user || typeof projectId !== "string" || typeof name !== "string" || !name.trim()) {
350
+ return { error: "project_id and name are required in a user session" };
351
+ }
352
+ const created = await createNativeGame(user, projectId, name.trim());
353
+ return "error" in created
354
+ ? created
355
+ : { game: summary(created.game), document: created.document };
356
+ }
357
+ };
358
+ /** Shared by explicit game creation and the guided asset workflow builder. */
359
+ export async function createNativeGame(user, projectId, name, source) {
360
+ const project = await Project.findOwned(user, projectId);
361
+ if (!project)
362
+ return { error: "Project not found" };
363
+ const workspaceRow = await projectWorkspace(user, project.id);
364
+ const workspace = workspaceRow && openWorkspace(workspaceRow);
365
+ if (!workspace || !workspaceRow)
366
+ return { error: "Project workspace is unavailable" };
367
+ const id = randomUUID().replace(/-/g, "");
368
+ const revision = randomUUID().replace(/-/g, "");
369
+ const document = validateSource(source ?? { ...createTopDownRoomGame(id), schemaVersion: 2 }, id, revision);
370
+ if ("error" in document)
371
+ return document;
372
+ const game = new Game({
373
+ id,
374
+ user_id: user,
375
+ project_id: project.id,
376
+ workspace_id: workspaceRow.id,
377
+ name: name.trim(),
378
+ current_revision: revision
379
+ });
380
+ await workspace.write(revisionPath(game, revision), JSON.stringify(document), "application/json");
381
+ const inserted = await Game.insertNew({
382
+ id,
383
+ userId: user,
384
+ projectId: project.id,
385
+ workspaceId: workspaceRow.id,
386
+ name: name.trim(),
387
+ revision
388
+ });
389
+ return inserted ? { game: inserted, document } : { error: "Game id collision" };
390
+ }
391
+ const get = {
392
+ spec: gameSpecs[1],
393
+ impl: async (run, args) => {
394
+ const user = userId(run);
395
+ const id = args["game_id"];
396
+ if (!user || typeof id !== "string")
397
+ return { error: "game_id is required in a user session" };
398
+ const game = await ownedGame(user, id);
399
+ if (!game)
400
+ return { error: "Game not found" };
401
+ const workspace = await workspaceOf(user, game);
402
+ if (!workspace)
403
+ return { error: "Game workspace is unavailable" };
404
+ const document = await readSource(workspace, game, args["source"], args["revision"]);
405
+ if (!document)
406
+ return { error: "Game source not found" };
407
+ const view = args["view"] ?? "outline";
408
+ if (view === "full")
409
+ return { game: summary(game), draft_updated_at: game.draft_updated_at, document };
410
+ if (view === "outline")
411
+ return { game: summary(game), draft_updated_at: game.draft_updated_at, outline: outline(document) };
412
+ if (view === "entity") {
413
+ const entityId = args["entity_id"];
414
+ if (typeof entityId !== "string")
415
+ return { error: "entity_id is required for entity view" };
416
+ const matches = document.scenes.flatMap((scene) => scene.entities.filter((entity) => entity.id === entityId).map((entity) => ({ scene_id: scene.id, entity })));
417
+ return matches.length ? { game: summary(game), draft_updated_at: game.draft_updated_at, matches } : { error: "Entity not found" };
418
+ }
419
+ return { error: "Unknown game view" };
420
+ }
421
+ };
422
+ const save = {
423
+ spec: gameSpecs[2],
424
+ impl: async (run, args) => {
425
+ const user = userId(run);
426
+ const id = args["game_id"];
427
+ const base = args["base_revision"];
428
+ if (!user || typeof id !== "string" || typeof base !== "string")
429
+ return { error: "game_id and base_revision are required" };
430
+ const game = await ownedGame(user, id);
431
+ if (!game)
432
+ return { error: "Game not found" };
433
+ const workspace = await workspaceOf(user, game);
434
+ if (!workspace)
435
+ return { error: "Game workspace is unavailable" };
436
+ const document = args["document"] ?? await readSource(workspace, game, "draft", undefined);
437
+ return document ? publish(user, game, base, document, typeof args["message"] === "string" ? args["message"] : undefined) : { error: "Game draft not found" };
438
+ }
439
+ };
440
+ const edit = {
441
+ spec: gameSpecs[6],
442
+ impl: async (run, args) => {
443
+ const user = userId(run);
444
+ const id = args["game_id"];
445
+ if (!user || typeof id !== "string")
446
+ return { error: "game_id is required in a user session" };
447
+ const game = await ownedGame(user, id);
448
+ if (!game)
449
+ return { error: "Game not found" };
450
+ const workspace = await workspaceOf(user, game);
451
+ if (!workspace)
452
+ return { error: "Game workspace is unavailable" };
453
+ const parsed = gameDocumentOp.array().min(1).safeParse(args["ops"]);
454
+ if (!parsed.success)
455
+ return { error: "Invalid game ops", issues: parsed.error.issues.map((issue) => ({ op_index: typeof issue.path[0] === "number" ? issue.path[0] : 0, path: issue.path, message: issue.message })) };
456
+ const base = args["base_updated_at"];
457
+ if (base !== undefined && typeof base !== "string")
458
+ return { error: "base_updated_at must be a string" };
459
+ for (let attempt = 0; attempt < (base ? 1 : 2); attempt += 1) {
460
+ const fresh = attempt === 0 ? game : await ownedGame(user, id);
461
+ if (!fresh)
462
+ return { error: "Game not found" };
463
+ try {
464
+ const updated = await Game.updateDraft(user, fresh.id, base ?? fresh.draft_updated_at, parsed.data, workspace, { actor: "agent", threadId: run.context.threadId ?? undefined, messageId: run.context.get?.("chat_message_id") ?? undefined });
465
+ if (updated)
466
+ return { game: summary(updated.game), draft_updated_at: updated.game.draft_updated_at, document: updated.document };
467
+ }
468
+ catch (error) {
469
+ if (error instanceof GameOpError)
470
+ return { error: "Game edit rejected", issues: error.issues.map((issue) => ({ op_index: issue.opIndex, path: issue.path, message: issue.message })) };
471
+ throw error;
472
+ }
473
+ }
474
+ return { error: "Game draft was modified concurrently", draft_updated_at: (await ownedGame(user, id))?.draft_updated_at };
475
+ }
476
+ };
477
+ const install = {
478
+ spec: gameSpecs[3],
479
+ impl: async (run, args) => {
480
+ const user = userId(run);
481
+ const id = args["game_id"];
482
+ const base = args["base_revision"];
483
+ const slot = args["slot"];
484
+ if (!user || typeof id !== "string" || typeof slot !== "string" || !slot) {
485
+ return { error: "game_id and slot are required" };
486
+ }
487
+ const game = await ownedGame(user, id);
488
+ if (!game)
489
+ return { error: "Game not found" };
490
+ const parsed = gameAssetBinding.safeParse(args["binding"]);
491
+ if (!parsed.success || !/^[a-f0-9]{64}$/.test(parsed.data.digest)) {
492
+ return { error: "Invalid asset binding or digest" };
493
+ }
494
+ if (parsed.data.mediaKind === "font" && !parsed.data.fontFormat) {
495
+ return { error: "Font binding needs a TrueType or OpenType format" };
496
+ }
497
+ const workspace = await workspaceOf(user, game);
498
+ if (!workspace)
499
+ return { error: "Game workspace is unavailable" };
500
+ const candidateId = args["candidate_workspace_id"];
501
+ let candidateWorkspace = workspace;
502
+ if (candidateId !== undefined) {
503
+ if (typeof candidateId !== "string")
504
+ return { error: "candidate_workspace_id must be a string" };
505
+ const row = await Workspace.find(user, candidateId);
506
+ if (!row || row.project_id !== game.project_id)
507
+ return { error: "Candidate workspace not found" };
508
+ const resolved = openWorkspace(row);
509
+ if (!resolved)
510
+ return { error: "Candidate workspace is unavailable" };
511
+ candidateWorkspace = resolved;
512
+ }
513
+ const formats = parsed.data.mediaKind === "audio"
514
+ ? [["wav", "audio/wav"], ["mp3", "audio/mpeg"], ["ogg", "audio/ogg"]]
515
+ : parsed.data.mediaKind === "font"
516
+ ? [[parsed.data.fontFormat, `font/${parsed.data.fontFormat}`]]
517
+ : [["png", "image/png"], ["jpg", "image/jpeg"], ["webp", "image/webp"]];
518
+ let candidate = null;
519
+ for (const [extension, contentType] of formats) {
520
+ if (!extension)
521
+ continue;
522
+ const path = `${game.source_root}/assets/${parsed.data.digest}.${extension}`;
523
+ const bytes = await candidateWorkspace.read(path);
524
+ if (bytes) {
525
+ candidate = { path, extension, contentType: contentType ?? "application/octet-stream", bytes };
526
+ break;
527
+ }
528
+ }
529
+ if (!candidate || createHash("sha256").update(candidate.bytes).digest("hex") !== parsed.data.digest) {
530
+ return { error: "Candidate asset is missing or changed" };
531
+ }
532
+ const { path, extension, contentType, bytes } = candidate;
533
+ if (base !== undefined && base !== game.current_revision)
534
+ return { error: "Game was modified concurrently" };
535
+ const draft = await Game.readDraft(user, game.id, workspace);
536
+ if (!draft)
537
+ return { error: "Game draft is missing" };
538
+ const expectedUpdatedAt = typeof args["base_updated_at"] === "string" ? args["base_updated_at"] : draft.game.draft_updated_at;
539
+ const storage = run.context.assetStorage;
540
+ if (!storage)
541
+ return { error: "Asset storage is unavailable" };
542
+ if (candidateWorkspace !== workspace)
543
+ await workspace.write(path, bytes, contentType);
544
+ const installed = await Asset.create({
545
+ user_id: user,
546
+ project_id: game.project_id,
547
+ parent_id: user,
548
+ name: `${slot}.${extension}`,
549
+ content_type: contentType,
550
+ size: bytes.byteLength,
551
+ metadata: { game_source_asset_id: parsed.data.assetId, game_digest: parsed.data.digest }
552
+ });
553
+ if (!(installed instanceof Asset))
554
+ return { error: "Failed to create installed asset" };
555
+ const key = assetObjectKey(user, `${installed.id}.${extension}`);
556
+ let uri = null;
557
+ try {
558
+ uri = await storage.store(key, bytes, contentType);
559
+ let result;
560
+ try {
561
+ const updated = await Game.updateDraft(user, game.id, expectedUpdatedAt, [{ op: "bind_asset", slot, binding: { ...parsed.data, assetId: installed.id } }], workspace, { actor: "agent", threadId: run.context.threadId ?? undefined, messageId: run.context.get?.("chat_message_id") ?? undefined });
562
+ result = updated ? { game: summary(updated.game), draft_updated_at: updated.game.draft_updated_at, document: updated.document } : { error: "Game draft was modified concurrently" };
563
+ }
564
+ catch (error) {
565
+ if (error instanceof GameOpError)
566
+ result = { error: error.message, op_index: error.opIndex, path: error.path };
567
+ else
568
+ throw error;
569
+ }
570
+ if (typeof result === "object" && result !== null && "error" in result) {
571
+ await storage.delete(uri);
572
+ await installed.delete();
573
+ }
574
+ return result;
575
+ }
576
+ catch (error) {
577
+ if (uri)
578
+ await storage.delete(uri);
579
+ await installed.delete();
580
+ throw error;
581
+ }
582
+ }
583
+ };
584
+ const playtest = {
585
+ spec: gameSpecs[4],
586
+ impl: async (run, args) => {
587
+ const user = userId(run);
588
+ const id = args["game_id"];
589
+ if (!user || typeof id !== "string")
590
+ return { error: "game_id is required in a user session" };
591
+ const game = await ownedGame(user, id);
592
+ if (!game)
593
+ return { error: "Game not found" };
594
+ const workspace = await workspaceOf(user, game);
595
+ if (!workspace)
596
+ return { error: "Game workspace is unavailable" };
597
+ const document = await readSource(workspace, game, args["source"], args["revision"]);
598
+ if (!document)
599
+ return { error: "Game source not found" };
600
+ const captures = captureTicks(args["capture_ticks"], []);
601
+ if ("error" in captures)
602
+ return captures;
603
+ const assertions = Array.isArray(args["assertions"]) ? args["assertions"] : [];
604
+ const assertionHorizon = assertions.reduce((maximum, item) => {
605
+ if (!item || typeof item !== "object")
606
+ return maximum;
607
+ const assertion = item;
608
+ const tick = assertion.at_tick ?? assertion.before_tick;
609
+ return typeof tick === "number" && Number.isSafeInteger(tick) && tick >= 0 ? Math.max(maximum, tick) : maximum;
610
+ }, 0);
611
+ const inputs = inputFrames(args["inputs"], Math.max(0, ...captures, assertionHorizon));
612
+ if ("error" in inputs)
613
+ return inputs;
614
+ const seed = typeof args["seed"] === "number" && Number.isSafeInteger(args["seed"])
615
+ ? args["seed"]
616
+ : 1;
617
+ const session = await createScriptedGameSession(document, seed);
618
+ const events = [];
619
+ const contacts = new Map();
620
+ const inspectionTicks = new Set(assertions.flatMap((item) => {
621
+ if (!item || typeof item !== "object" || !("at_tick" in item))
622
+ return [];
623
+ return typeof item.at_tick === "number" ? [item.at_tick] : [];
624
+ }));
625
+ let state = session.inspect();
626
+ const inspections = new Map([[0, state]]);
627
+ const started = Date.now();
628
+ let wallTimeLimited = false;
629
+ let cancelled = false;
630
+ let scriptError = null;
631
+ try {
632
+ for (const input of inputs) {
633
+ if (state.tick % 240 === 0)
634
+ await new Promise((resolve) => setTimeout(resolve, 0));
635
+ if (run.context.signal?.aborted) {
636
+ cancelled = true;
637
+ break;
638
+ }
639
+ if (Date.now() - started > 15_000) {
640
+ wallTimeLimited = true;
641
+ break;
642
+ }
643
+ let result;
644
+ try {
645
+ result = session.step(input);
646
+ }
647
+ catch (error) {
648
+ scriptError = { tick: state.tick + 1, message: error instanceof Error ? error.message : String(error) };
649
+ break;
650
+ }
651
+ state = session.inspect();
652
+ if (inspectionTicks.has(result.tick))
653
+ inspections.set(result.tick, state);
654
+ for (const event of result.events) {
655
+ if (event.kind === "contact") {
656
+ const pair = [event.entityId, event.otherId].sort().join("|");
657
+ const key = `${pair}:${event.phase ?? "stay"}`;
658
+ contacts.set(key, (contacts.get(key) ?? 0) + 1);
659
+ }
660
+ else {
661
+ events.push({ tick: result.tick, ...event });
662
+ }
663
+ }
664
+ }
665
+ const assertion_results = assertions.map((item) => {
666
+ if (!item || typeof item !== "object")
667
+ return { passed: false, error: "Invalid assertion" };
668
+ const assertion = item;
669
+ if (assertion.no_script_errors === true)
670
+ return { passed: scriptError === null, assertion, observed: scriptError };
671
+ if (typeof assertion.event === "string") {
672
+ const observed = events.find((event) => {
673
+ if (typeof event !== "object" || event === null || !("kind" in event))
674
+ return false;
675
+ if (event.kind === assertion.event)
676
+ return true;
677
+ return event.kind === "trigger" && "event" in event && (event.event === assertion.event || assertion.event === "win" && event.event === "victory");
678
+ });
679
+ const tick = typeof observed === "object" && observed !== null && "tick" in observed && typeof observed.tick === "number" ? observed.tick : Infinity;
680
+ return { passed: observed !== undefined && (typeof assertion.before_tick !== "number" || tick <= assertion.before_tick), assertion, observed: observed ?? null };
681
+ }
682
+ if (typeof assertion.entity_id === "string" && assertion.near && typeof assertion.near === "object") {
683
+ const near = assertion.near;
684
+ const observed = typeof assertion.at_tick === "number" ? inspections.get(assertion.at_tick) : state;
685
+ const entity = observed?.entities.find((candidate) => candidate.id === assertion.entity_id);
686
+ const tolerance = typeof near.tolerance === "number" ? near.tolerance : 0;
687
+ const passed = !!entity && typeof near.x === "number" && typeof near.y === "number" && Math.hypot(entity.x - near.x, entity.y - near.y) <= tolerance;
688
+ return { passed, assertion, observed: entity ?? null };
689
+ }
690
+ return { passed: false, assertion, error: "Unsupported assertion" };
691
+ });
692
+ const images = captures.length && scriptError === null && !cancelled && !wallTimeLimited && state.tick === inputs.length
693
+ ? await captureFrames(run, user, document, captures, inputs, seed, { sheet: true, deadlineAt: started + 15_000 })
694
+ : undefined;
695
+ return {
696
+ game_id: shortResourceId(game.id),
697
+ revision: document.revision,
698
+ ticks: state.tick,
699
+ state,
700
+ events,
701
+ contacts: [...contacts].map(([pair_phase, count]) => ({ pair_phase, count })),
702
+ assertion_results,
703
+ wall_time_limited: wallTimeLimited,
704
+ cancelled,
705
+ route_complete: state.tick === inputs.length,
706
+ wall_time_ms: Date.now() - started,
707
+ script_error: scriptError,
708
+ captures: images
709
+ };
710
+ }
711
+ finally {
712
+ session.dispose();
713
+ }
714
+ }
715
+ };
716
+ const capture = {
717
+ spec: gameSpecs[7],
718
+ impl: async (run, args) => {
719
+ const user = userId(run);
720
+ const id = args["game_id"];
721
+ if (!user || typeof id !== "string")
722
+ return { error: "game_id is required in a user session" };
723
+ const game = await ownedGame(user, id);
724
+ if (!game)
725
+ return { error: "Game not found" };
726
+ const workspace = await workspaceOf(user, game);
727
+ if (!workspace)
728
+ return { error: "Game workspace is unavailable" };
729
+ const document = await readSource(workspace, game, args["source"], args["revision"]);
730
+ if (!document)
731
+ return { error: "Game source not found" };
732
+ const ticks = captureTicks(args["ticks"], [0]);
733
+ if ("error" in ticks)
734
+ return ticks;
735
+ const inputs = inputFrames(args["inputs"], Math.max(0, ...ticks));
736
+ if ("error" in inputs)
737
+ return inputs;
738
+ const seed = typeof args["seed"] === "number" && Number.isSafeInteger(args["seed"]) ? args["seed"] : 1;
739
+ const options = {};
740
+ for (const key of ["camera", "scale", "sheet", "overlays"]) {
741
+ if (args[key] !== undefined) {
742
+ options[key] = args[key];
743
+ }
744
+ }
745
+ return captureFrames(run, user, document, ticks, inputs, seed, options);
746
+ }
747
+ };
748
+ const generateAsset = {
749
+ spec: gameSpecs[8],
750
+ impl: async (run, args) => {
751
+ const user = userId(run);
752
+ const id = args["game_id"];
753
+ const slot = args["slot"];
754
+ const kind = args["kind"];
755
+ const prompt = args["prompt"];
756
+ const inputFile = args["input_file"];
757
+ if (!user || typeof id !== "string" || typeof slot !== "string" || !slot || !["image", "audio", "music", "sfx", "font"].includes(String(kind))) {
758
+ return { error: "game_id, slot, and kind are required" };
759
+ }
760
+ if (inputFile !== undefined && (typeof inputFile !== "string" || !inputFile.trim())) {
761
+ return { error: "input_file must be a nonempty string" };
762
+ }
763
+ const game = await ownedGame(user, id);
764
+ if (!game) {
765
+ return { error: "Game not found" };
766
+ }
767
+ const workspace = await workspaceOf(user, game);
768
+ if (!workspace) {
769
+ return { error: "Game workspace is unavailable" };
770
+ }
771
+ const draft = await Game.readDraft(user, game.id, workspace);
772
+ if (!draft) {
773
+ return { error: "Game draft not found" };
774
+ }
775
+ const reference = typeof args["reference_slot"] === "string" ? draft.document.assets[args["reference_slot"]] : undefined;
776
+ if (args["reference_slot"] !== undefined && !reference) {
777
+ return { error: "reference_slot is not bound" };
778
+ }
779
+ if (reference && kind !== "image") {
780
+ return { error: "reference_slot requires kind image" };
781
+ }
782
+ const { imagePreparationSettings, prepareGameImage, imagePreparationMetadata, gameFontFormat } = await import("@nodetool-ai/game-nodes");
783
+ const settings = kind === "image" ? imagePreparationSettings.safeParse(args["preparation"] ?? {}) : null;
784
+ if (settings && !settings.success) {
785
+ return { error: "Invalid image preparation", issues: settings.error.issues };
786
+ }
787
+ if (kind !== "image" && args["preparation"] !== undefined) {
788
+ return { error: "preparation requires kind image" };
789
+ }
790
+ const { readGameAssetInput, generateGameSoundEffect, gameGenerationResult, gameModelResult } = await import("./game-asset-source.js");
791
+ let provider = args["provider"];
792
+ let model = args["model"];
793
+ let generated = {};
794
+ let sourceBytes = null;
795
+ const makeLut = settings?.success && settings.data.lut !== undefined;
796
+ if (makeLut && (inputFile !== undefined || reference || args["generation_id"] !== undefined)) {
797
+ return { error: "LUT preparation creates a color cube directly and cannot use input_file, reference_slot or generation_id" };
798
+ }
799
+ if (makeLut) {
800
+ sourceBytes = new Uint8Array();
801
+ }
802
+ else if (typeof inputFile === "string") {
803
+ if (args["generation_id"] !== undefined) {
804
+ return { error: "input_file and generation_id cannot be combined" };
805
+ }
806
+ try {
807
+ sourceBytes = await readGameAssetInput(run, workspace, inputFile);
808
+ }
809
+ catch (error) {
810
+ return { error: error instanceof Error ? error.message : String(error) };
811
+ }
812
+ if (!sourceBytes) {
813
+ return { error: "input_file is unavailable in this user's assets or workspace" };
814
+ }
815
+ }
816
+ else if (kind === "font") {
817
+ return { error: "Font assets require input_file naming an owned TTF or OTF asset or workspace file" };
818
+ }
819
+ else if (kind === "sfx") {
820
+ const sound = await generateGameSoundEffect(run, args);
821
+ if ("error" in sound) {
822
+ return sound;
823
+ }
824
+ sourceBytes = sound.bytes;
825
+ generated.mime_type = sound.mime_type;
826
+ }
827
+ else {
828
+ if (typeof prompt !== "string" || !prompt.trim()) {
829
+ return { error: "prompt is required for generation" };
830
+ }
831
+ const capability = kind === "image" ? reference ? "image_to_image" : "text_to_image" : kind === "music" ? "text_to_music" : "text_to_speech";
832
+ const resumedId = args["generation_id"];
833
+ if (typeof resumedId === "string") {
834
+ const row = await Prediction.findForUser(user, resumedId);
835
+ if (!row || row.capability !== capability) {
836
+ return { error: "Generation not found for this game asset kind" };
837
+ }
838
+ const { generationRecord } = await import("./generations.js");
839
+ const record = generationRecord(row);
840
+ if (record.status !== "completed") {
841
+ return { generation_id: resumedId, status: record.status, error: record.generation_error ?? undefined };
842
+ }
843
+ const assetId = record.asset_ids[0];
844
+ if (!assetId) {
845
+ return { error: "Generation completed without an asset", generation_id: resumedId };
846
+ }
847
+ const asset = await Asset.find(user, assetId);
848
+ if (!asset) {
849
+ return { error: "Generated asset is unavailable", generation_id: resumedId };
850
+ }
851
+ generated = { asset_uri: `asset://${assetId}`, generation_id: resumedId, mime_type: asset.content_type };
852
+ provider = row.provider;
853
+ model = row.model;
854
+ }
855
+ else {
856
+ if (typeof provider !== "string" || typeof model !== "string") {
857
+ const { findModel } = await import("./models.js");
858
+ const found = gameModelResult.safeParse(await findModel.impl(run, { capability }));
859
+ provider = found.success ? found.data.ref?.provider : undefined;
860
+ model = found.success ? found.data.ref?.id : undefined;
861
+ }
862
+ if (typeof provider !== "string" || typeof model !== "string") {
863
+ return { error: `No ${capability} model is available; pass provider and model` };
864
+ }
865
+ const media = await import("./media.js");
866
+ const generator = kind === "music" ? media.generateMusic : kind === "audio" ? media.generateSpeech : reference ? media.editImage : media.generateImage;
867
+ const generationArgs = { provider, model, prompt };
868
+ if (kind === "audio") {
869
+ generationArgs["text"] = prompt;
870
+ }
871
+ if (args["background"] === true) {
872
+ generationArgs["background"] = true;
873
+ }
874
+ if (reference) {
875
+ const referenceAsset = await Asset.find(user, reference.assetId);
876
+ const suffix = referenceAsset && MEDIA_EXTENSIONS[referenceAsset.content_type];
877
+ if (!suffix) {
878
+ return { error: "Reference asset is unavailable" };
879
+ }
880
+ generationArgs["input_file"] = `asset://${reference.assetId}.${suffix}`;
881
+ }
882
+ const result = gameGenerationResult.safeParse(await generator.impl(run, generationArgs));
883
+ if (!result.success) {
884
+ return { error: "Generation returned an invalid asset result" };
885
+ }
886
+ generated = result.data;
887
+ }
888
+ if (generated.error) {
889
+ return generated;
890
+ }
891
+ if (generated.background) {
892
+ return { ...generated, next: "Call await_generation, then call generate_game_asset again with generation_id and the same game_id, slot, kind, prompt, and preparation." };
893
+ }
894
+ const handle = generated.asset_uri ?? generated.path;
895
+ if (!handle) {
896
+ return { error: "Generation returned no readable asset", generation_id: generated.generation_id };
897
+ }
898
+ sourceBytes = handle.startsWith("asset://") ? (await run.context.resolveAssetBytes(handle)).bytes : await run.context.workspace?.read(handle) ?? null;
899
+ if (!sourceBytes) {
900
+ return { error: "Generated asset bytes are unavailable", generation_id: generated.generation_id };
901
+ }
902
+ }
903
+ if (sourceBytes.byteLength > MAX_BUILD_ASSET_BYTES) {
904
+ return { error: "Game asset exceeds the supported asset size" };
905
+ }
906
+ let bytes = sourceBytes;
907
+ let width = 1;
908
+ let height = 1;
909
+ const previous = draft.document.assets[slot];
910
+ const binding = {
911
+ width, height, pivot: previous?.pivot ?? { x: 0.5, y: 0.5 }, sampling: previous?.sampling ?? "nearest"
912
+ };
913
+ let frames;
914
+ let tiles;
915
+ let lutSize;
916
+ let extension;
917
+ let contentType;
918
+ if (kind === "image" && settings?.success) {
919
+ let prepared;
920
+ try {
921
+ prepared = await prepareGameImage(bytes, settings.data);
922
+ }
923
+ catch (error) {
924
+ return { error: `Image preparation failed: ${error instanceof Error ? error.message : String(error)}` };
925
+ }
926
+ bytes = prepared.bytes;
927
+ width = prepared.width;
928
+ height = prepared.height;
929
+ extension = "png";
930
+ contentType = "image/png";
931
+ binding.mediaKind = "image";
932
+ binding.pivot = settings.data.pivot;
933
+ binding.sampling = settings.data.sampling;
934
+ frames = prepared.frames;
935
+ tiles = prepared.tiles;
936
+ lutSize = prepared.lutSize;
937
+ if (frames?.[0]) {
938
+ binding.frame = frames[0];
939
+ }
940
+ if (prepared.baseline !== undefined && frames?.[0]) {
941
+ binding.pivot = { x: 0.5, y: (prepared.baseline + 1) / frames[0].height };
942
+ }
943
+ if (draft.document.schemaVersion === 2) {
944
+ binding.preparation = imagePreparationMetadata(settings.data);
945
+ binding.originalDimensions = { width: prepared.originalWidth, height: prepared.originalHeight };
946
+ if (prepared.trim) {
947
+ binding.trim = prepared.trim;
948
+ }
949
+ if (reference) {
950
+ binding.referenceAssetId = reference.assetId;
951
+ }
952
+ }
953
+ }
954
+ else if (kind === "font") {
955
+ const format = gameFontFormat(bytes);
956
+ if (!format) {
957
+ return { error: "input_file must contain a valid TrueType or OpenType font" };
958
+ }
959
+ extension = format;
960
+ contentType = `font/${format}`;
961
+ binding.mediaKind = "font";
962
+ binding.fontFormat = format;
963
+ }
964
+ else {
965
+ const { sniffAudioMimeOrNull } = await import("@nodetool-ai/runtime");
966
+ const mime = generated.mime_type ?? sniffAudioMimeOrNull(bytes);
967
+ extension = mime === "audio/wav" || mime === "audio/x-wav" ? "wav" : mime === "audio/ogg" ? "ogg"
968
+ : mime === "audio/mpeg" || mime === "audio/mp3" ? "mp3" : "";
969
+ if (!extension) {
970
+ return { error: "Audio assets must be encoded WAV, Ogg or MP3" };
971
+ }
972
+ contentType = extension === "wav" ? "audio/wav" : extension === "ogg" ? "audio/ogg" : "audio/mpeg";
973
+ binding.mediaKind = "audio";
974
+ }
975
+ const digest = createHash("sha256").update(bytes).digest("hex");
976
+ await workspace.write(`${game.source_root}/assets/${digest}.${extension}`, bytes, contentType);
977
+ binding.assetId = `generated:${digest}`;
978
+ binding.digest = digest;
979
+ binding.width = width;
980
+ binding.height = height;
981
+ if (draft.document.schemaVersion === 2) {
982
+ binding.provenance = typeof inputFile === "string" ? `import:${inputFile}`
983
+ : makeLut ? "generated:color-cube" : kind === "sfx" ? `node:${args["node_type"]}` : `${provider}:${model}:${generated.generation_id ?? ""}`;
984
+ }
985
+ const installed = await install.impl(run, { game_id: game.id, slot, binding, base_updated_at: draft.game.draft_updated_at });
986
+ if (typeof installed !== "object" || installed === null) {
987
+ return { generation_id: generated.generation_id, result: installed };
988
+ }
989
+ const extras = {};
990
+ if (!("error" in installed) && "document" in installed) {
991
+ const parsedDocument = gameDocument.safeParse(installed.document);
992
+ const asset = parsedDocument.success ? parsedDocument.data.assets[slot] : undefined;
993
+ if (asset && (frames || tiles)) {
994
+ extras.bindings = Object.fromEntries(frames ? frames.map((frame, index) => [`${slot}.frame.${index}`, { ...asset, frame }])
995
+ : (tiles ?? []).map((tile) => [`${slot}.tile.${tile.mask}`, { ...asset, frame: tile.frame }]));
996
+ extras.next = "Bind the returned atlas frame bindings with one edit_native_game ops array or registerAssets in the game builder.";
997
+ }
998
+ }
999
+ if (frames) {
1000
+ extras.frames = frames;
1001
+ }
1002
+ if (tiles) {
1003
+ extras.tiles = tiles;
1004
+ }
1005
+ if (lutSize) {
1006
+ extras.lut_size = lutSize;
1007
+ }
1008
+ return { generation_id: generated.generation_id, ...installed, ...extras };
1009
+ }
1010
+ };
1011
+ const buildGame = {
1012
+ spec: gameSpecs[5],
1013
+ impl: async (run, args) => {
1014
+ const user = userId(run);
1015
+ const id = args["game_id"];
1016
+ if (!user || typeof id !== "string")
1017
+ return { error: "game_id is required in a user session" };
1018
+ const game = await ownedGame(user, id);
1019
+ if (!game)
1020
+ return { error: "Game not found" };
1021
+ const workspace = await workspaceOf(user, game);
1022
+ if (!workspace)
1023
+ return { error: "Game workspace is unavailable" };
1024
+ const revision = typeof args["revision"] === "string" ? args["revision"] : game.current_revision;
1025
+ const document = await readDocument(workspace, game, revision);
1026
+ if (!document)
1027
+ return { error: "Game revision not found" };
1028
+ if (Object.keys(document.assets).length > MAX_BUILD_ASSETS) {
1029
+ return { error: `A standalone build supports at most ${MAX_BUILD_ASSETS} assets` };
1030
+ }
1031
+ const expectedDigests = new Map();
1032
+ for (const binding of Object.values(document.assets)) {
1033
+ if (binding.assetId.startsWith("builtin:"))
1034
+ continue;
1035
+ const digests = expectedDigests.get(binding.assetId) ?? new Set();
1036
+ digests.add(binding.digest);
1037
+ expectedDigests.set(binding.assetId, digests);
1038
+ }
1039
+ if ([...expectedDigests.values()].some((digests) => digests.size !== 1)) {
1040
+ return { error: "One source asset has conflicting digests in this revision" };
1041
+ }
1042
+ const buildPath = `game-builds/${game.id}/${revision}`;
1043
+ const indexPath = `${buildPath}/index.html`;
1044
+ if (await workspace.exists(indexPath)) {
1045
+ return { game_id: game.id, revision, build_path: buildPath, entry_path: indexPath, cached: true };
1046
+ }
1047
+ const storage = run.context.assetStorage;
1048
+ const cache = new Map();
1049
+ let totalAssetBytes = 0;
1050
+ const resolveAsset = async (assetId) => {
1051
+ const cached = cache.get(assetId);
1052
+ if (cached)
1053
+ return cached;
1054
+ if (!/^[a-f0-9]{32}$/.test(assetId))
1055
+ return null;
1056
+ const asset = await Asset.find(user, assetId);
1057
+ if (!asset || !storage)
1058
+ return null;
1059
+ const extension = MEDIA_EXTENSIONS[asset.content_type];
1060
+ if (!extension || (asset.size !== null && asset.size > MAX_BUILD_ASSET_BYTES))
1061
+ return null;
1062
+ const keys = assetKeyCandidates(user, `${asset.id}.${extension}`);
1063
+ let bytes = null;
1064
+ for (const key of keys) {
1065
+ bytes = await storage.retrieve(storage.uriForKey(key));
1066
+ if (bytes)
1067
+ break;
1068
+ }
1069
+ if (!bytes || bytes.byteLength > MAX_BUILD_ASSET_BYTES)
1070
+ return null;
1071
+ const digest = createHash("sha256").update(bytes).digest("hex");
1072
+ if (!expectedDigests.get(assetId)?.has(digest)) {
1073
+ throw new Error(`Asset digest changed for ${assetId}`);
1074
+ }
1075
+ totalAssetBytes += bytes.byteLength;
1076
+ if (totalAssetBytes > MAX_BUILD_BYTES) {
1077
+ throw new Error(`A standalone build supports at most ${MAX_BUILD_BYTES} asset bytes`);
1078
+ }
1079
+ const resolved = { bytes, mimeType: asset.content_type };
1080
+ cache.set(assetId, resolved);
1081
+ return resolved;
1082
+ };
1083
+ const scratch = await workspace.scratchDir();
1084
+ const staging = await mkdtemp(join(scratch, ".native-game-build-"));
1085
+ try {
1086
+ const { buildStandaloneGame } = await import("@nodetool-ai/game-renderer/build");
1087
+ await buildStandaloneGame({ document, outputDir: join(staging, "player"), resolveAsset });
1088
+ const files = [];
1089
+ const pending = [""];
1090
+ let totalBytes = 0;
1091
+ while (pending.length > 0) {
1092
+ const directory = pending.pop() ?? "";
1093
+ for (const entry of await readdir(join(staging, "player", directory), { withFileTypes: true })) {
1094
+ const path = directory ? `${directory}/${entry.name}` : entry.name;
1095
+ if (entry.isDirectory()) {
1096
+ pending.push(path);
1097
+ }
1098
+ else if (entry.isFile()) {
1099
+ const bytes = await readFile(join(staging, "player", path));
1100
+ totalBytes += bytes.byteLength;
1101
+ if (files.length >= MAX_BUILD_FILES || totalBytes > MAX_BUILD_BYTES) {
1102
+ throw new Error("Standalone build exceeds file or byte limits");
1103
+ }
1104
+ files.push({ path, bytes });
1105
+ }
1106
+ }
1107
+ }
1108
+ if (!files.some((file) => file.path === "index.html")) {
1109
+ throw new Error("Standalone player entry is missing");
1110
+ }
1111
+ for (const file of files.filter((item) => item.path !== "index.html")) {
1112
+ const contentType = file.path.endsWith(".js") ? "text/javascript"
1113
+ : file.path.endsWith(".css") ? "text/css"
1114
+ : file.path.endsWith(".json") ? "application/json"
1115
+ : file.path.endsWith(".png") ? "image/png"
1116
+ : file.path.endsWith(".jpg") ? "image/jpeg"
1117
+ : file.path.endsWith(".webp") ? "image/webp"
1118
+ : file.path.endsWith(".wav") ? "audio/wav"
1119
+ : file.path.endsWith(".ogg") ? "audio/ogg"
1120
+ : file.path.endsWith(".mp3") ? "audio/mpeg"
1121
+ : file.path.endsWith(".ttf") ? "font/ttf"
1122
+ : file.path.endsWith(".otf") ? "font/otf"
1123
+ : "application/octet-stream";
1124
+ await workspace.write(`${buildPath}/${file.path}`, file.bytes, contentType);
1125
+ }
1126
+ const index = files.find((file) => file.path === "index.html");
1127
+ if (!index)
1128
+ throw new Error("Standalone player entry is missing");
1129
+ await workspace.write(indexPath, index.bytes, "text/html");
1130
+ return { game_id: game.id, revision, build_path: buildPath, entry_path: indexPath, cached: false };
1131
+ }
1132
+ catch (error) {
1133
+ return { error: error instanceof Error ? error.message : String(error) };
1134
+ }
1135
+ finally {
1136
+ await rm(staging, { recursive: true, force: true });
1137
+ }
1138
+ }
1139
+ };
1140
+ const listExamples = {
1141
+ spec: gameSpecs[9],
1142
+ impl: async (_run, args) => {
1143
+ const query = args["query"];
1144
+ const limit = args["limit"] ?? 20;
1145
+ if (query !== undefined && typeof query !== "string")
1146
+ return { error: "query must be a string" };
1147
+ if (typeof limit !== "number" || !Number.isSafeInteger(limit) || limit < 1 || limit > 100)
1148
+ return { error: "limit must be between 1 and 100" };
1149
+ const needle = typeof query === "string" ? query.toLowerCase().trim() : "";
1150
+ return { examples: listExampleGames({}).filter((example) => !needle || `${example.slug} ${example.name} ${example.description}`.toLowerCase().includes(needle)).slice(0, limit) };
1151
+ }
1152
+ };
1153
+ const getExample = {
1154
+ spec: gameSpecs[10],
1155
+ impl: async (_run, args) => {
1156
+ const slug = args["slug"];
1157
+ if (typeof slug !== "string")
1158
+ return { error: "slug is required" };
1159
+ const bundle = getExampleGameBundle({}, slug);
1160
+ if (!bundle)
1161
+ return { error: "Example game not found" };
1162
+ const { document, ...metadata } = bundle;
1163
+ const view = args["view"] ?? "outline";
1164
+ if (view === "full")
1165
+ return { slug, ...metadata, document };
1166
+ if (view === "entity") {
1167
+ const entityId = args["entity_id"];
1168
+ if (typeof entityId !== "string")
1169
+ return { error: "entity_id is required for entity view" };
1170
+ const matches = document.scenes.flatMap((scene) => scene.entities.filter((entity) => entity.id === entityId).map((entity) => ({ scene_id: scene.id, entity })));
1171
+ return matches.length ? { slug, ...metadata, matches } : { error: "Entity not found" };
1172
+ }
1173
+ return view === "outline" ? { slug, ...metadata, outline: outline(document) } : { error: "Unknown example game view" };
1174
+ }
1175
+ };
1176
+ const installExample = {
1177
+ spec: gameSpecs[11],
1178
+ impl: async (run, args) => {
1179
+ const user = userId(run);
1180
+ const projectId = args["project_id"];
1181
+ const slug = args["slug"];
1182
+ const name = args["name"];
1183
+ if (!user || typeof projectId !== "string" || typeof slug !== "string")
1184
+ return { error: "project_id and slug are required in a user session" };
1185
+ if (name !== undefined && (typeof name !== "string" || !name.trim()))
1186
+ return { error: "name must be a nonempty string" };
1187
+ if (!(await Project.findOwned(user, projectId)))
1188
+ return { error: "Project not found" };
1189
+ const storage = run.context.assetStorage;
1190
+ if (!storage)
1191
+ return { error: "Asset storage is unavailable" };
1192
+ if (!getExampleGameBundle({}, slug))
1193
+ return { error: "Example game not found" };
1194
+ const installed = await installExampleGameAssets(user, projectId, {}, slug, storage);
1195
+ try {
1196
+ const created = await createNativeGame(user, projectId, typeof name === "string" ? name.trim() : installed.bundle.name, installed.document);
1197
+ if ("error" in created) {
1198
+ await installed.rollback();
1199
+ return created;
1200
+ }
1201
+ return { game: summary(created.game), document: created.document };
1202
+ }
1203
+ catch (error) {
1204
+ await installed.rollback();
1205
+ throw error;
1206
+ }
1207
+ }
1208
+ };
1209
+ const autoplay = {
1210
+ spec: gameSpecs[12],
1211
+ impl: async (run, args) => {
1212
+ const user = userId(run);
1213
+ const id = args["game_id"];
1214
+ if (!user || typeof id !== "string")
1215
+ return { error: "game_id is required in a user session" };
1216
+ const game = await ownedGame(user, id);
1217
+ if (!game)
1218
+ return { error: "Game not found" };
1219
+ const workspace = await workspaceOf(user, game);
1220
+ if (!workspace)
1221
+ return { error: "Game workspace is unavailable" };
1222
+ const document = await readSource(workspace, game, args["source"], args["revision"]);
1223
+ if (!document)
1224
+ return { error: "Game source not found" };
1225
+ const targetPrefix = args["target_prefix"];
1226
+ const playerId = args["player_id"];
1227
+ const win = args["win"];
1228
+ const maxTicks = args["max_ticks"];
1229
+ const seed = args["seed"];
1230
+ if (targetPrefix !== undefined && (typeof targetPrefix !== "string" || !targetPrefix.trim()))
1231
+ return { error: "target_prefix must be a nonempty string" };
1232
+ if (playerId !== undefined && typeof playerId !== "string")
1233
+ return { error: "player_id must be a string" };
1234
+ if (win !== undefined && typeof win !== "boolean")
1235
+ return { error: "win must be a boolean" };
1236
+ if (targetPrefix !== undefined && win === true)
1237
+ return { error: "Choose target_prefix or win, not both" };
1238
+ if (maxTicks !== undefined && (typeof maxTicks !== "number" || !Number.isSafeInteger(maxTicks) || maxTicks < 1 || maxTicks > MAX_PLAYTEST_TICKS))
1239
+ return { error: `max_ticks must be between 1 and ${MAX_PLAYTEST_TICKS}` };
1240
+ if (seed !== undefined && (typeof seed !== "number" || !Number.isSafeInteger(seed)))
1241
+ return { error: "seed must be an integer" };
1242
+ const options = { signal: run.context.signal };
1243
+ if (typeof targetPrefix === "string")
1244
+ options.targetPrefix = targetPrefix;
1245
+ else
1246
+ options.win = true;
1247
+ if (typeof playerId === "string")
1248
+ options.playerId = playerId;
1249
+ if (typeof seed === "number")
1250
+ options.seed = seed;
1251
+ if (typeof maxTicks === "number")
1252
+ options.maxTicks = maxTicks;
1253
+ const result = await autoplayNativeGame(document, options);
1254
+ const { winTick, reachedTargets, levelStats, snapshot, ...route } = result;
1255
+ return { game_id: shortResourceId(game.id), revision: document.revision, ...route, win_tick: winTick, reached_targets: reachedTargets, level_stats: levelStats, state: snapshot };
1256
+ }
1257
+ };
1258
+ export const module = {
1259
+ module: "game",
1260
+ exports: [create, get, save, install, playtest, buildGame, edit, capture, generateAsset, listExamples, getExample, installExample, autoplay]
1261
+ };
1262
+ //# sourceMappingURL=game.js.map