@ddwang/magnitude-core 0.3.1-ddwang.2 → 0.3.1-ddwang.21

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 (363) hide show
  1. package/dist/cli.cjs +2 -0
  2. package/dist/cli.cjs.map +1 -0
  3. package/dist/cli.d.cts +2 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.mjs +1 -0
  6. package/dist/cli.mjs.map +1 -0
  7. package/dist/index.cjs +2704 -1522
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +188 -50
  10. package/dist/index.d.ts +1147 -23
  11. package/dist/index.mjs +2527 -1362
  12. package/dist/index.mjs.map +1 -0
  13. package/node_modules/patchright-core/README.md +3 -0
  14. package/node_modules/patchright-core/ThirdPartyNotices.txt +13 -0
  15. package/node_modules/patchright-core/bin/install_media_pack.ps1 +5 -0
  16. package/node_modules/patchright-core/bin/install_webkit_wsl.ps1 +33 -0
  17. package/node_modules/patchright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  18. package/node_modules/patchright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  19. package/node_modules/patchright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  20. package/node_modules/patchright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  21. package/node_modules/patchright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  22. package/node_modules/patchright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  23. package/node_modules/patchright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  24. package/node_modules/patchright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  25. package/node_modules/patchright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  26. package/node_modules/patchright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  27. package/node_modules/patchright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  28. package/node_modules/patchright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  29. package/node_modules/patchright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  30. package/node_modules/patchright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  31. package/node_modules/patchright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  32. package/node_modules/patchright-core/browsers.json +52 -0
  33. package/node_modules/patchright-core/cli.js +22 -0
  34. package/node_modules/patchright-core/index.d.ts +17 -0
  35. package/node_modules/patchright-core/index.js +17 -0
  36. package/node_modules/patchright-core/index.mjs +28 -0
  37. package/node_modules/patchright-core/lib/bootstrap.js +149 -0
  38. package/node_modules/patchright-core/lib/coreBundle.js +80653 -0
  39. package/node_modules/patchright-core/lib/entry/cliDaemon.js +5 -0
  40. package/node_modules/patchright-core/lib/entry/dashboardApp.js +3 -0
  41. package/node_modules/patchright-core/lib/entry/mcp.js +10 -0
  42. package/node_modules/patchright-core/lib/entry/oopBrowserDownload.js +3 -0
  43. package/node_modules/patchright-core/lib/package.js +50 -0
  44. package/node_modules/patchright-core/lib/server/chromium/appIcon.png +0 -0
  45. package/node_modules/patchright-core/lib/server/electron/loader.js +112 -0
  46. package/node_modules/patchright-core/lib/serverRegistry.js +1939 -0
  47. package/node_modules/patchright-core/lib/serverRegistry.js.LICENSE +65 -0
  48. package/node_modules/patchright-core/lib/tools/cli-client/channelSessions.js +141 -0
  49. package/node_modules/patchright-core/lib/tools/cli-client/cli.js +7 -0
  50. package/node_modules/patchright-core/lib/tools/cli-client/help.json +808 -0
  51. package/node_modules/patchright-core/lib/tools/cli-client/minimist.js +128 -0
  52. package/node_modules/patchright-core/lib/tools/cli-client/output.js +352 -0
  53. package/node_modules/patchright-core/lib/tools/cli-client/program.js +422 -0
  54. package/node_modules/patchright-core/lib/tools/cli-client/registry.js +180 -0
  55. package/node_modules/patchright-core/lib/tools/cli-client/session.js +261 -0
  56. package/node_modules/patchright-core/lib/tools/dashboard/appIcon.png +0 -0
  57. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/SKILL.md +493 -0
  58. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  59. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  60. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
  61. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  62. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
  63. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
  64. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  65. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  66. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  67. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
  68. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  69. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  70. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  71. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  72. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  73. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  74. package/node_modules/patchright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  75. package/node_modules/patchright-core/lib/tools/utils/extension.js +112 -0
  76. package/node_modules/patchright-core/lib/tools/utils/socketConnection.js +108 -0
  77. package/node_modules/patchright-core/lib/utilsBundle.js +86225 -0
  78. package/node_modules/patchright-core/lib/utilsBundle.js.LICENSE +1890 -0
  79. package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  80. package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  81. package/node_modules/patchright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  82. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  83. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  84. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  85. package/node_modules/patchright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  86. package/node_modules/patchright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  87. package/node_modules/patchright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  88. package/node_modules/patchright-core/lib/vite/dashboard/index.html +29 -0
  89. package/node_modules/patchright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  90. package/node_modules/patchright-core/lib/vite/htmlReport/index.html +16 -0
  91. package/node_modules/patchright-core/lib/vite/htmlReport/report.css +2 -0
  92. package/node_modules/patchright-core/lib/vite/htmlReport/report.js +32 -0
  93. package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  94. package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule-GBnsXk4c.js +32 -0
  95. package/node_modules/patchright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  96. package/node_modules/patchright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  97. package/node_modules/patchright-core/lib/vite/recorder/assets/index-CVDOfo-j.js +129 -0
  98. package/node_modules/patchright-core/lib/vite/recorder/index.html +29 -0
  99. package/node_modules/patchright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  100. package/node_modules/patchright-core/lib/vite/traceViewer/assets/codeMirrorModule-G79327TW.js +32 -0
  101. package/node_modules/patchright-core/lib/vite/traceViewer/assets/defaultSettingsView-D9EV0iaS.js +184 -0
  102. package/node_modules/patchright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  103. package/node_modules/patchright-core/lib/vite/traceViewer/assets/xtermModule-Al_u-Nk5.js +7 -0
  104. package/node_modules/patchright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  105. package/node_modules/patchright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  106. package/node_modules/patchright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
  107. package/node_modules/patchright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  108. package/node_modules/patchright-core/lib/vite/traceViewer/index.CMB2-c8e.js +1 -0
  109. package/node_modules/patchright-core/lib/vite/traceViewer/index.html +44 -0
  110. package/node_modules/patchright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  111. package/node_modules/patchright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  112. package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  113. package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.html +10 -0
  114. package/node_modules/patchright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
  115. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.C3yLoy2G.js +5 -0
  116. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  117. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.html +18 -0
  118. package/node_modules/patchright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  119. package/node_modules/patchright-core/lib/webp_codec.LICENSE +173 -0
  120. package/node_modules/patchright-core/lib/webp_codec.wasm +0 -0
  121. package/node_modules/patchright-core/lib/xdg-open +1267 -0
  122. package/node_modules/patchright-core/package.json +34 -0
  123. package/node_modules/patchright-core/types/protocol.d.ts +24776 -0
  124. package/node_modules/patchright-core/types/structs.d.ts +52 -0
  125. package/node_modules/patchright-core/types/types.d.ts +27167 -0
  126. package/node_modules/playwright/.bun-tag-91d746a6045e143f +0 -0
  127. package/node_modules/playwright/README.md +300 -0
  128. package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
  129. package/node_modules/playwright/cli.js +19 -0
  130. package/node_modules/playwright/index.d.ts +17 -0
  131. package/node_modules/playwright/index.js +17 -0
  132. package/node_modules/playwright/index.mjs +18 -0
  133. package/node_modules/playwright/lib/agents/agentParser.js +89 -0
  134. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  135. package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
  136. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  137. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  138. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  139. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  140. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
  141. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  142. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
  143. package/node_modules/playwright/lib/cli/reportActions.js +78 -0
  144. package/node_modules/playwright/lib/cli/testActions.js +217 -0
  145. package/node_modules/playwright/lib/common/index.js +2937 -0
  146. package/node_modules/playwright/lib/common/index.js.txt +33 -0
  147. package/node_modules/playwright/lib/errorContext.js +129 -0
  148. package/node_modules/playwright/lib/globals.js +58 -0
  149. package/node_modules/playwright/lib/index.js +827 -0
  150. package/node_modules/playwright/lib/isomorphic.js +260 -0
  151. package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
  152. package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
  153. package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
  154. package/node_modules/playwright/lib/matchers/expect.js +13496 -0
  155. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
  156. package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
  157. package/node_modules/playwright/lib/mcp/test/browserBackend.js +135 -0
  158. package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  159. package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
  160. package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  161. package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  162. package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  163. package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
  164. package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  165. package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
  166. package/node_modules/playwright/lib/package.js +47 -0
  167. package/node_modules/playwright/lib/program.js +242 -0
  168. package/node_modules/playwright/lib/runner/index.js +8721 -0
  169. package/node_modules/playwright/lib/runner/index.js.txt +62 -0
  170. package/node_modules/playwright/lib/transform/babelBundle.js +72490 -0
  171. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
  172. package/node_modules/playwright/lib/transform/babelBundle.js.txt +328 -0
  173. package/node_modules/playwright/lib/transform/esmLoader.js +8213 -0
  174. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
  175. package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
  176. package/node_modules/playwright/lib/util.js +373 -0
  177. package/node_modules/playwright/lib/worker/workerProcessEntry.js +1860 -0
  178. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
  179. package/node_modules/playwright/package.json +50 -0
  180. package/node_modules/playwright/test.d.ts +18 -0
  181. package/node_modules/playwright/test.js +24 -0
  182. package/node_modules/playwright/test.mjs +35 -0
  183. package/node_modules/playwright/types/test.d.ts +11191 -0
  184. package/node_modules/playwright/types/testReporter.d.ts +950 -0
  185. package/package.json +21 -12
  186. package/dist/actions/desktopActions.d.ts +0 -58
  187. package/dist/actions/desktopActions.js +0 -155
  188. package/dist/actions/index.d.ts +0 -27
  189. package/dist/actions/index.js +0 -11
  190. package/dist/actions/memoryActions.d.ts +0 -9
  191. package/dist/actions/memoryActions.js +0 -34
  192. package/dist/actions/taskActions.d.ts +0 -8
  193. package/dist/actions/taskActions.js +0 -27
  194. package/dist/actions/types.d.ts +0 -35
  195. package/dist/actions/types.js +0 -5
  196. package/dist/actions/util.d.ts +0 -21
  197. package/dist/actions/util.js +0 -280
  198. package/dist/actions/webActions.d.ts +0 -87
  199. package/dist/actions/webActions.js +0 -214
  200. package/dist/actions/webActions.test.d.ts +0 -1
  201. package/dist/actions/webActions.test.js +0 -43
  202. package/dist/agent/browserAgent.d.ts +0 -31
  203. package/dist/agent/browserAgent.js +0 -136
  204. package/dist/agent/errors.d.ts +0 -22
  205. package/dist/agent/errors.js +0 -97
  206. package/dist/agent/index.d.ts +0 -64
  207. package/dist/agent/index.js +0 -505
  208. package/dist/agent/narrator.d.ts +0 -4
  209. package/dist/agent/narrator.js +0 -63
  210. package/dist/agent/pause.test.d.ts +0 -1
  211. package/dist/agent/pause.test.js +0 -194
  212. package/dist/ai/baml_client/async_client.d.ts +0 -64
  213. package/dist/ai/baml_client/async_client.js +0 -284
  214. package/dist/ai/baml_client/async_request.d.ts +0 -39
  215. package/dist/ai/baml_client/async_request.js +0 -134
  216. package/dist/ai/baml_client/config.d.ts +0 -11
  217. package/dist/ai/baml_client/config.js +0 -20
  218. package/dist/ai/baml_client/globals.d.ts +0 -16
  219. package/dist/ai/baml_client/globals.js +0 -37
  220. package/dist/ai/baml_client/index.d.ts +0 -17
  221. package/dist/ai/baml_client/index.js +0 -42
  222. package/dist/ai/baml_client/inlinedbaml.d.ts +0 -19
  223. package/dist/ai/baml_client/inlinedbaml.js +0 -31
  224. package/dist/ai/baml_client/parser.d.ts +0 -53
  225. package/dist/ai/baml_client/parser.js +0 -86
  226. package/dist/ai/baml_client/partial_types.d.ts +0 -61
  227. package/dist/ai/baml_client/partial_types.js +0 -10
  228. package/dist/ai/baml_client/sync_client.d.ts +0 -57
  229. package/dist/ai/baml_client/sync_client.js +0 -142
  230. package/dist/ai/baml_client/sync_request.d.ts +0 -37
  231. package/dist/ai/baml_client/sync_request.js +0 -134
  232. package/dist/ai/baml_client/tracing.d.ts +0 -16
  233. package/dist/ai/baml_client/tracing.js +0 -18
  234. package/dist/ai/baml_client/type_builder.d.ts +0 -40
  235. package/dist/ai/baml_client/type_builder.js +0 -120
  236. package/dist/ai/baml_client/types.d.ts +0 -69
  237. package/dist/ai/baml_client/types.js +0 -15
  238. package/dist/ai/baml_client/watchers.d.ts +0 -32
  239. package/dist/ai/baml_client/watchers.js +0 -50
  240. package/dist/ai/baseten.d.ts +0 -4
  241. package/dist/ai/baseten.js +0 -10
  242. package/dist/ai/claudeCode.d.ts +0 -1
  243. package/dist/ai/claudeCode.js +0 -186
  244. package/dist/ai/modelHarness.d.ts +0 -39
  245. package/dist/ai/modelHarness.js +0 -324
  246. package/dist/ai/modelResponseError.d.ts +0 -4
  247. package/dist/ai/modelResponseError.js +0 -8
  248. package/dist/ai/multiModelHarness.d.ts +0 -24
  249. package/dist/ai/multiModelHarness.js +0 -52
  250. package/dist/ai/plannerResponse.d.ts +0 -34
  251. package/dist/ai/plannerResponse.js +0 -96
  252. package/dist/ai/plannerResponse.test.d.ts +0 -1
  253. package/dist/ai/plannerResponse.test.js +0 -112
  254. package/dist/ai/structuredOutput.d.ts +0 -11
  255. package/dist/ai/structuredOutput.js +0 -94
  256. package/dist/ai/structuredOutput.test.d.ts +0 -1
  257. package/dist/ai/structuredOutput.test.js +0 -91
  258. package/dist/ai/types.d.ts +0 -119
  259. package/dist/ai/types.js +0 -5
  260. package/dist/ai/util.d.ts +0 -13
  261. package/dist/ai/util.js +0 -200
  262. package/dist/ai/util.test.d.ts +0 -1
  263. package/dist/ai/util.test.js +0 -95
  264. package/dist/cli.js +0 -3
  265. package/dist/common/actions.js +0 -14
  266. package/dist/common/events.d.ts +0 -17
  267. package/dist/common/events.js +0 -3
  268. package/dist/common/failure.d.ts +0 -68
  269. package/dist/common/failure.js +0 -1
  270. package/dist/common/index.d.ts +0 -3
  271. package/dist/common/index.js +0 -3
  272. package/dist/common/operation.d.ts +0 -31
  273. package/dist/common/operation.js +0 -102
  274. package/dist/common/operation.test.d.ts +0 -1
  275. package/dist/common/operation.test.js +0 -53
  276. package/dist/common/retry.d.ts +0 -16
  277. package/dist/common/retry.js +0 -35
  278. package/dist/common/util.d.ts +0 -23
  279. package/dist/common/util.js +0 -139
  280. package/dist/connectors/browserConnector.d.ts +0 -53
  281. package/dist/connectors/browserConnector.js +0 -290
  282. package/dist/connectors/desktopConnector.d.ts +0 -58
  283. package/dist/connectors/desktopConnector.js +0 -68
  284. package/dist/connectors/index.d.ts +0 -14
  285. package/dist/connectors/index.js +0 -2
  286. package/dist/index.js +0 -28
  287. package/dist/logger.d.ts +0 -3
  288. package/dist/logger.js +0 -15
  289. package/dist/memory/agentMemory.d.ts +0 -47
  290. package/dist/memory/agentMemory.js +0 -167
  291. package/dist/memory/agentMemory.test.d.ts +0 -1
  292. package/dist/memory/agentMemory.test.js +0 -150
  293. package/dist/memory/image.d.ts +0 -28
  294. package/dist/memory/image.js +0 -95
  295. package/dist/memory/image.test.d.ts +0 -1
  296. package/dist/memory/image.test.js +0 -46
  297. package/dist/memory/index.d.ts +0 -3
  298. package/dist/memory/index.js +0 -3
  299. package/dist/memory/masking.d.ts +0 -7
  300. package/dist/memory/masking.js +0 -141
  301. package/dist/memory/masking.test.d.ts +0 -1
  302. package/dist/memory/masking.test.js +0 -117
  303. package/dist/memory/notebook.d.ts +0 -58
  304. package/dist/memory/notebook.js +0 -75
  305. package/dist/memory/notebook.test.d.ts +0 -1
  306. package/dist/memory/notebook.test.js +0 -99
  307. package/dist/memory/observation.d.ts +0 -38
  308. package/dist/memory/observation.js +0 -79
  309. package/dist/memory/rendering/index.d.ts +0 -10
  310. package/dist/memory/rendering/index.js +0 -13
  311. package/dist/memory/rendering/renderJsonParts.d.ts +0 -3
  312. package/dist/memory/rendering/renderJsonParts.js +0 -115
  313. package/dist/memory/rendering/renderJsonParts.test.d.ts +0 -1
  314. package/dist/memory/rendering/renderJsonParts.test.js +0 -217
  315. package/dist/memory/rendering/renderXmlParts.d.ts +0 -7
  316. package/dist/memory/rendering/renderXmlParts.js +0 -127
  317. package/dist/memory/serde.d.ts +0 -20
  318. package/dist/memory/serde.js +0 -67
  319. package/dist/memory/serde.test.d.ts +0 -1
  320. package/dist/memory/serde.test.js +0 -64
  321. package/dist/memory/util.d.ts +0 -2
  322. package/dist/memory/util.js +0 -17
  323. package/dist/telemetry/events.d.ts +0 -9
  324. package/dist/telemetry/events.js +0 -80
  325. package/dist/telemetry/index.d.ts +0 -6
  326. package/dist/telemetry/index.js +0 -91
  327. package/dist/types.d.ts +0 -30
  328. package/dist/types.js +0 -1
  329. package/dist/util.d.ts +0 -1
  330. package/dist/util.js +0 -12
  331. package/dist/version.d.ts +0 -1
  332. package/dist/version.js +0 -3
  333. package/dist/web/browserProvider.d.ts +0 -24
  334. package/dist/web/browserProvider.js +0 -164
  335. package/dist/web/browserProvider.test.d.ts +0 -1
  336. package/dist/web/browserProvider.test.js +0 -44
  337. package/dist/web/harness.d.ts +0 -109
  338. package/dist/web/harness.js +0 -401
  339. package/dist/web/recovery.d.ts +0 -46
  340. package/dist/web/recovery.js +0 -137
  341. package/dist/web/recovery.test.d.ts +0 -1
  342. package/dist/web/recovery.test.js +0 -182
  343. package/dist/web/stability.d.ts +0 -57
  344. package/dist/web/stability.js +0 -323
  345. package/dist/web/tabs.d.ts +0 -58
  346. package/dist/web/tabs.js +0 -293
  347. package/dist/web/transformer.d.ts +0 -7
  348. package/dist/web/transformer.js +0 -41
  349. package/dist/web/types.d.ts +0 -37
  350. package/dist/web/types.js +0 -2
  351. package/dist/web/util.d.ts +0 -3
  352. package/dist/web/util.js +0 -81
  353. package/dist/web/visualizer/cursor.d.ts +0 -16
  354. package/dist/web/visualizer/cursor.js +0 -153
  355. package/dist/web/visualizer/index.d.ts +0 -22
  356. package/dist/web/visualizer/index.js +0 -47
  357. package/dist/web/visualizer/mouseEffects.d.ts +0 -18
  358. package/dist/web/visualizer/mouseEffects.js +0 -287
  359. package/dist/web/visualizer/typeEffects.d.ts +0 -10
  360. package/dist/web/visualizer/typeEffects.js +0 -190
  361. package/dist/web/zodReexport.test.d.ts +0 -1
  362. package/dist/web/zodReexport.test.js +0 -14
  363. /package/{dist/common/actions.d.ts → node_modules/patchright-core/.bun-tag-19f23bd68c84ec1f} +0 -0
@@ -1,194 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import EventEmitter from 'eventemitter3';
3
- // Minimal Agent-like class that isolates pause/resume logic for testing
4
- // without requiring LLM clients, connectors, or BAML dependencies
5
- class PauseableLoop {
6
- events = new EventEmitter();
7
- doneActing = false;
8
- _paused = false;
9
- _pauseResolve = null;
10
- async _waitIfPaused() {
11
- if (!this._paused)
12
- return;
13
- this.events.emit('pause');
14
- await new Promise((resolve) => {
15
- this._pauseResolve = resolve;
16
- });
17
- }
18
- pause() {
19
- this._paused = true;
20
- }
21
- resume() {
22
- this._paused = false;
23
- if (this._pauseResolve) {
24
- this._pauseResolve();
25
- this._pauseResolve = null;
26
- }
27
- this.events.emit('resume');
28
- }
29
- get paused() {
30
- return this._paused;
31
- }
32
- queueDone() {
33
- this.doneActing = true;
34
- }
35
- stop() {
36
- this.doneActing = true;
37
- if (this._paused) {
38
- this.resume();
39
- }
40
- }
41
- /**
42
- * Simulates the Agent._act() loop structure.
43
- * Each "batch" is an array of action labels. The loop processes batches
44
- * until doneActing is set, mirroring the real while(true) loop.
45
- */
46
- async runLoop(batches, onAction) {
47
- this.doneActing = false;
48
- let batchIndex = 0;
49
- while (true) {
50
- const actions = batches[batchIndex % batches.length];
51
- batchIndex++;
52
- for (const action of actions) {
53
- await this._waitIfPaused();
54
- if (this.doneActing)
55
- return;
56
- onAction(action);
57
- }
58
- await this._waitIfPaused();
59
- if (this.doneActing)
60
- return;
61
- }
62
- }
63
- }
64
- describe('Agent pause/resume', () => {
65
- test('pause() sets paused flag', () => {
66
- const loop = new PauseableLoop();
67
- expect(loop.paused).toBe(false);
68
- loop.pause();
69
- expect(loop.paused).toBe(true);
70
- });
71
- test('resume() clears paused flag', () => {
72
- const loop = new PauseableLoop();
73
- loop.pause();
74
- loop.resume();
75
- expect(loop.paused).toBe(false);
76
- });
77
- test('resume() when not paused is a no-op (no error)', () => {
78
- const loop = new PauseableLoop();
79
- expect(() => loop.resume()).not.toThrow();
80
- expect(loop.paused).toBe(false);
81
- });
82
- test('loop pauses before action and resumes on resume()', async () => {
83
- const loop = new PauseableLoop();
84
- const executed = [];
85
- // Pause immediately so first action blocks
86
- loop.pause();
87
- const loopPromise = loop.runLoop([['a', 'b']], (label) => {
88
- executed.push(label);
89
- // After executing both actions, stop
90
- if (executed.length === 2)
91
- loop.queueDone();
92
- });
93
- // Give microtasks a chance to settle — loop should be blocked
94
- await new Promise(r => setTimeout(r, 20));
95
- expect(executed).toEqual([]);
96
- // Resume — loop should execute actions then stop
97
- loop.resume();
98
- await loopPromise;
99
- expect(executed).toEqual(['a', 'b']);
100
- });
101
- test('pause mid-batch stops before next action', async () => {
102
- const loop = new PauseableLoop();
103
- const executed = [];
104
- const loopPromise = loop.runLoop([['a', 'b', 'c']], (label) => {
105
- executed.push(label);
106
- if (label === 'a')
107
- loop.pause(); // pause after first action
108
- });
109
- // Wait for loop to pause after 'a'
110
- await new Promise(r => setTimeout(r, 20));
111
- expect(executed).toEqual(['a']);
112
- // Resume and let it finish
113
- loop.resume();
114
- await new Promise(r => setTimeout(r, 20));
115
- // 'b' should now execute, pause again since flag was cleared by resume
116
- // Actually after resume, _paused is false, so b and c run
117
- expect(executed).toContain('b');
118
- expect(executed).toContain('c');
119
- // Stop the loop
120
- loop.stop();
121
- await loopPromise;
122
- });
123
- test('pause emits pause event, resume emits resume event', async () => {
124
- const loop = new PauseableLoop();
125
- const events = [];
126
- loop.events.on('pause', () => events.push('pause'));
127
- loop.events.on('resume', () => events.push('resume'));
128
- loop.pause();
129
- const loopPromise = loop.runLoop([['a']], () => loop.queueDone());
130
- // Wait for loop to hit _waitIfPaused and emit 'pause'
131
- await new Promise(r => setTimeout(r, 20));
132
- expect(events).toEqual(['pause']);
133
- loop.resume();
134
- await loopPromise;
135
- expect(events).toEqual(['pause', 'resume']);
136
- });
137
- test('stop() while paused unblocks the loop', async () => {
138
- const loop = new PauseableLoop();
139
- const executed = [];
140
- loop.pause();
141
- const loopPromise = loop.runLoop([['a', 'b']], (label) => executed.push(label));
142
- await new Promise(r => setTimeout(r, 20));
143
- expect(executed).toEqual([]);
144
- // stop() should set doneActing and resume so loop exits
145
- loop.stop();
146
- await loopPromise;
147
- // No actions should have executed — loop exits immediately after unblocking
148
- expect(executed).toEqual([]);
149
- });
150
- test('pause between batches blocks next iteration', async () => {
151
- const loop = new PauseableLoop();
152
- const executed = [];
153
- let batchCount = 0;
154
- const loopPromise = loop.runLoop([['a'], ['b']], (label) => {
155
- executed.push(label);
156
- batchCount++;
157
- // After first batch completes, pause before second batch
158
- if (batchCount === 1)
159
- loop.pause();
160
- if (batchCount === 2)
161
- loop.queueDone();
162
- });
163
- // Let first batch run, then loop should pause at between-batch check
164
- await new Promise(r => setTimeout(r, 20));
165
- expect(executed).toEqual(['a']);
166
- loop.resume();
167
- await loopPromise;
168
- expect(executed).toEqual(['a', 'b']);
169
- });
170
- test('multiple pause/resume cycles work correctly', async () => {
171
- const loop = new PauseableLoop();
172
- const executed = [];
173
- let actionCount = 0;
174
- const loopPromise = loop.runLoop([['x']], (label) => {
175
- actionCount++;
176
- executed.push(`${label}${actionCount}`);
177
- if (actionCount < 3) {
178
- loop.pause(); // pause after each action
179
- }
180
- else {
181
- loop.queueDone(); // done after 3rd
182
- }
183
- });
184
- // First action runs, then pauses
185
- await new Promise(r => setTimeout(r, 20));
186
- expect(executed).toEqual(['x1']);
187
- loop.resume();
188
- await new Promise(r => setTimeout(r, 20));
189
- expect(executed).toEqual(['x1', 'x2']);
190
- loop.resume();
191
- await loopPromise;
192
- expect(executed).toEqual(['x1', 'x2', 'x3']);
193
- });
194
- });
@@ -1,64 +0,0 @@
1
- /*************************************************************************************************
2
-
3
- Welcome to Baml! To use this generated code, please run one of the following:
4
-
5
- $ npm install @boundaryml/baml
6
- $ yarn add @boundaryml/baml
7
- $ pnpm add @boundaryml/baml
8
-
9
- *************************************************************************************************/
10
- import type { BamlRuntime, BamlCtxManager, Image, FunctionLog } from "@boundaryml/baml";
11
- import { BamlStream, Collector, ClientRegistry } from "@boundaryml/baml";
12
- import type { RecursivePartialNull as MovedRecursivePartialNull } from "./types";
13
- import type { partial_types } from "./partial_types";
14
- import type * as types from "./types";
15
- import type TypeBuilder from "./type_builder";
16
- import { AsyncHttpRequest, AsyncHttpStreamRequest } from "./async_request";
17
- import { LlmResponseParser, LlmStreamParser } from "./parser";
18
- /**
19
- * @deprecated Use RecursivePartialNull from 'baml_client/types' instead.
20
- */
21
- export type RecursivePartialNull<T> = MovedRecursivePartialNull<T>;
22
- type TickReason = "Unknown";
23
- type BamlCallOptions<WatchersT = never> = {
24
- tb?: TypeBuilder;
25
- clientRegistry?: ClientRegistry;
26
- client?: string;
27
- collector?: Collector | Collector[];
28
- env?: Record<string, string | undefined>;
29
- tags?: Record<string, string>;
30
- signal?: AbortSignal;
31
- onTick?: (reason: TickReason, log: FunctionLog | null) => void;
32
- watchers?: WatchersT;
33
- };
34
- export declare class BamlAsyncClient {
35
- private runtime;
36
- private ctxManager;
37
- private streamClient;
38
- private httpRequest;
39
- private httpStreamRequest;
40
- private llmResponseParser;
41
- private llmStreamParser;
42
- private bamlOptions;
43
- constructor(runtime: BamlRuntime, ctxManager: BamlCtxManager, bamlOptions?: BamlCallOptions);
44
- withOptions(bamlOptions: BamlCallOptions): BamlAsyncClient;
45
- get stream(): BamlStreamClient;
46
- get request(): AsyncHttpRequest;
47
- get streamRequest(): AsyncHttpStreamRequest;
48
- get parse(): LlmResponseParser;
49
- get parseStream(): LlmStreamParser;
50
- CreatePartialRecipe(memory: types.AgentContext, task: string, taskData: (Image | string)[], includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<types.PartialRecipe>;
51
- ExtractData(instructions: string, screenshot: Image, domContent: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<types.ExtractedData>;
52
- QueryMemory(memory: types.AgentContext, query: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<types.QueryResponse>;
53
- }
54
- declare class BamlStreamClient {
55
- private runtime;
56
- private ctxManager;
57
- private bamlOptions;
58
- constructor(runtime: BamlRuntime, ctxManager: BamlCtxManager, bamlOptions?: BamlCallOptions);
59
- CreatePartialRecipe(memory: types.AgentContext, task: string, taskData: (Image | string)[], includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): BamlStream<partial_types.PartialRecipe, types.PartialRecipe>;
60
- ExtractData(instructions: string, screenshot: Image, domContent: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): BamlStream<partial_types.ExtractedData, types.ExtractedData>;
61
- QueryMemory(memory: types.AgentContext, query: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): BamlStream<partial_types.QueryResponse, types.QueryResponse>;
62
- }
63
- export declare const b: BamlAsyncClient;
64
- export {};
@@ -1,284 +0,0 @@
1
- /*************************************************************************************************
2
-
3
- Welcome to Baml! To use this generated code, please run one of the following:
4
-
5
- $ npm install @boundaryml/baml
6
- $ yarn add @boundaryml/baml
7
- $ pnpm add @boundaryml/baml
8
-
9
- *************************************************************************************************/
10
- import { toBamlError, BamlStream, BamlAbortError, Collector, ClientRegistry } from "@boundaryml/baml";
11
- import { AsyncHttpRequest, AsyncHttpStreamRequest } from "./async_request";
12
- import { LlmResponseParser, LlmStreamParser } from "./parser";
13
- import { DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME } from "./globals";
14
- export class BamlAsyncClient {
15
- runtime;
16
- ctxManager;
17
- streamClient;
18
- httpRequest;
19
- httpStreamRequest;
20
- llmResponseParser;
21
- llmStreamParser;
22
- bamlOptions;
23
- constructor(runtime, ctxManager, bamlOptions) {
24
- this.runtime = runtime;
25
- this.ctxManager = ctxManager;
26
- this.streamClient = new BamlStreamClient(runtime, ctxManager, bamlOptions);
27
- this.httpRequest = new AsyncHttpRequest(runtime, ctxManager);
28
- this.httpStreamRequest = new AsyncHttpStreamRequest(runtime, ctxManager);
29
- this.llmResponseParser = new LlmResponseParser(runtime, ctxManager);
30
- this.llmStreamParser = new LlmStreamParser(runtime, ctxManager);
31
- this.bamlOptions = bamlOptions || {};
32
- }
33
- withOptions(bamlOptions) {
34
- return new BamlAsyncClient(this.runtime, this.ctxManager, bamlOptions);
35
- }
36
- get stream() {
37
- return this.streamClient;
38
- }
39
- get request() {
40
- return this.httpRequest;
41
- }
42
- get streamRequest() {
43
- return this.httpStreamRequest;
44
- }
45
- get parse() {
46
- return this.llmResponseParser;
47
- }
48
- get parseStream() {
49
- return this.llmStreamParser;
50
- }
51
- async CreatePartialRecipe(memory, task, taskData, includeClaudeSpoof, __baml_options__) {
52
- try {
53
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
54
- const __signal__ = __options__.signal;
55
- if (__signal__?.aborted) {
56
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
57
- }
58
- // Check if onTick is provided - route through streaming if so
59
- if (__options__.onTick) {
60
- const __stream__ = this.stream.CreatePartialRecipe(memory, task, taskData, includeClaudeSpoof, __baml_options__);
61
- return await __stream__.getFinalResponse();
62
- }
63
- const __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
64
- [__options__.collector]) : [];
65
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
66
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
67
- // Resolve client option to clientRegistry (client takes precedence)
68
- let __clientRegistry__ = __options__.clientRegistry;
69
- if (__options__.client) {
70
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
71
- __clientRegistry__.setPrimary(__options__.client);
72
- }
73
- const __raw__ = await this.runtime.callFunction("CreatePartialRecipe", {
74
- "memory": memory, "task": task, "taskData": taskData, "includeClaudeSpoof": includeClaudeSpoof
75
- }, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __options__.watchers);
76
- return __raw__.parsed(false);
77
- }
78
- catch (error) {
79
- throw toBamlError(error);
80
- }
81
- }
82
- async ExtractData(instructions, screenshot, domContent, includeClaudeSpoof, __baml_options__) {
83
- try {
84
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
85
- const __signal__ = __options__.signal;
86
- if (__signal__?.aborted) {
87
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
88
- }
89
- // Check if onTick is provided - route through streaming if so
90
- if (__options__.onTick) {
91
- const __stream__ = this.stream.ExtractData(instructions, screenshot, domContent, includeClaudeSpoof, __baml_options__);
92
- return await __stream__.getFinalResponse();
93
- }
94
- const __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
95
- [__options__.collector]) : [];
96
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
97
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
98
- // Resolve client option to clientRegistry (client takes precedence)
99
- let __clientRegistry__ = __options__.clientRegistry;
100
- if (__options__.client) {
101
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
102
- __clientRegistry__.setPrimary(__options__.client);
103
- }
104
- const __raw__ = await this.runtime.callFunction("ExtractData", {
105
- "instructions": instructions, "screenshot": screenshot, "domContent": domContent, "includeClaudeSpoof": includeClaudeSpoof
106
- }, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __options__.watchers);
107
- return __raw__.parsed(false);
108
- }
109
- catch (error) {
110
- throw toBamlError(error);
111
- }
112
- }
113
- async QueryMemory(memory, query, includeClaudeSpoof, __baml_options__) {
114
- try {
115
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
116
- const __signal__ = __options__.signal;
117
- if (__signal__?.aborted) {
118
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
119
- }
120
- // Check if onTick is provided - route through streaming if so
121
- if (__options__.onTick) {
122
- const __stream__ = this.stream.QueryMemory(memory, query, includeClaudeSpoof, __baml_options__);
123
- return await __stream__.getFinalResponse();
124
- }
125
- const __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
126
- [__options__.collector]) : [];
127
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
128
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
129
- // Resolve client option to clientRegistry (client takes precedence)
130
- let __clientRegistry__ = __options__.clientRegistry;
131
- if (__options__.client) {
132
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
133
- __clientRegistry__.setPrimary(__options__.client);
134
- }
135
- const __raw__ = await this.runtime.callFunction("QueryMemory", {
136
- "memory": memory, "query": query, "includeClaudeSpoof": includeClaudeSpoof
137
- }, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __options__.watchers);
138
- return __raw__.parsed(false);
139
- }
140
- catch (error) {
141
- throw toBamlError(error);
142
- }
143
- }
144
- }
145
- class BamlStreamClient {
146
- runtime;
147
- ctxManager;
148
- bamlOptions;
149
- constructor(runtime, ctxManager, bamlOptions) {
150
- this.runtime = runtime;
151
- this.ctxManager = ctxManager;
152
- this.bamlOptions = bamlOptions || {};
153
- }
154
- CreatePartialRecipe(memory, task, taskData, includeClaudeSpoof, __baml_options__) {
155
- try {
156
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
157
- const __signal__ = __options__.signal;
158
- if (__signal__?.aborted) {
159
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
160
- }
161
- let __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
162
- [__options__.collector]) : [];
163
- let __onTickWrapper__;
164
- // Create collector and wrap onTick if provided
165
- if (__options__.onTick) {
166
- const __tickCollector__ = new Collector("on-tick-collector");
167
- __collector__ = [...__collector__, __tickCollector__];
168
- __onTickWrapper__ = () => {
169
- const __log__ = __tickCollector__.last;
170
- if (__log__) {
171
- try {
172
- __options__.onTick("Unknown", __log__);
173
- }
174
- catch (error) {
175
- console.error("Error in onTick callback for CreatePartialRecipe", error);
176
- }
177
- }
178
- };
179
- }
180
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
181
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
182
- // Resolve client option to clientRegistry (client takes precedence)
183
- let __clientRegistry__ = __options__.clientRegistry;
184
- if (__options__.client) {
185
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
186
- __clientRegistry__.setPrimary(__options__.client);
187
- }
188
- const __raw__ = this.runtime.streamFunction("CreatePartialRecipe", {
189
- "memory": memory, "task": task, "taskData": taskData, "includeClaudeSpoof": includeClaudeSpoof
190
- }, undefined, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __onTickWrapper__);
191
- return new BamlStream(__raw__, (a) => a, (a) => a, this.ctxManager.cloneContext(), __options__.signal);
192
- }
193
- catch (error) {
194
- throw toBamlError(error);
195
- }
196
- }
197
- ExtractData(instructions, screenshot, domContent, includeClaudeSpoof, __baml_options__) {
198
- try {
199
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
200
- const __signal__ = __options__.signal;
201
- if (__signal__?.aborted) {
202
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
203
- }
204
- let __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
205
- [__options__.collector]) : [];
206
- let __onTickWrapper__;
207
- // Create collector and wrap onTick if provided
208
- if (__options__.onTick) {
209
- const __tickCollector__ = new Collector("on-tick-collector");
210
- __collector__ = [...__collector__, __tickCollector__];
211
- __onTickWrapper__ = () => {
212
- const __log__ = __tickCollector__.last;
213
- if (__log__) {
214
- try {
215
- __options__.onTick("Unknown", __log__);
216
- }
217
- catch (error) {
218
- console.error("Error in onTick callback for ExtractData", error);
219
- }
220
- }
221
- };
222
- }
223
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
224
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
225
- // Resolve client option to clientRegistry (client takes precedence)
226
- let __clientRegistry__ = __options__.clientRegistry;
227
- if (__options__.client) {
228
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
229
- __clientRegistry__.setPrimary(__options__.client);
230
- }
231
- const __raw__ = this.runtime.streamFunction("ExtractData", {
232
- "instructions": instructions, "screenshot": screenshot, "domContent": domContent, "includeClaudeSpoof": includeClaudeSpoof
233
- }, undefined, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __onTickWrapper__);
234
- return new BamlStream(__raw__, (a) => a, (a) => a, this.ctxManager.cloneContext(), __options__.signal);
235
- }
236
- catch (error) {
237
- throw toBamlError(error);
238
- }
239
- }
240
- QueryMemory(memory, query, includeClaudeSpoof, __baml_options__) {
241
- try {
242
- const __options__ = { ...this.bamlOptions, ...(__baml_options__ || {}), env: { ...(this.bamlOptions.env || {}), ...(__baml_options__?.env || {}) } };
243
- const __signal__ = __options__.signal;
244
- if (__signal__?.aborted) {
245
- throw new BamlAbortError('Operation was aborted', __signal__.reason);
246
- }
247
- let __collector__ = __options__.collector ? (Array.isArray(__options__.collector) ? __options__.collector :
248
- [__options__.collector]) : [];
249
- let __onTickWrapper__;
250
- // Create collector and wrap onTick if provided
251
- if (__options__.onTick) {
252
- const __tickCollector__ = new Collector("on-tick-collector");
253
- __collector__ = [...__collector__, __tickCollector__];
254
- __onTickWrapper__ = () => {
255
- const __log__ = __tickCollector__.last;
256
- if (__log__) {
257
- try {
258
- __options__.onTick("Unknown", __log__);
259
- }
260
- catch (error) {
261
- console.error("Error in onTick callback for QueryMemory", error);
262
- }
263
- }
264
- };
265
- }
266
- const __rawEnv__ = __options__.env ? { ...process.env, ...__options__.env } : { ...process.env };
267
- const __env__ = Object.fromEntries(Object.entries(__rawEnv__).filter(([_, value]) => value !== undefined));
268
- // Resolve client option to clientRegistry (client takes precedence)
269
- let __clientRegistry__ = __options__.clientRegistry;
270
- if (__options__.client) {
271
- __clientRegistry__ = __clientRegistry__ || new ClientRegistry();
272
- __clientRegistry__.setPrimary(__options__.client);
273
- }
274
- const __raw__ = this.runtime.streamFunction("QueryMemory", {
275
- "memory": memory, "query": query, "includeClaudeSpoof": includeClaudeSpoof
276
- }, undefined, this.ctxManager.cloneContext(), __options__.tb?.__tb(), __clientRegistry__, __collector__, __options__.tags || {}, __env__, __signal__, __onTickWrapper__);
277
- return new BamlStream(__raw__, (a) => a, (a) => a, this.ctxManager.cloneContext(), __options__.signal);
278
- }
279
- catch (error) {
280
- throw toBamlError(error);
281
- }
282
- }
283
- }
284
- export const b = new BamlAsyncClient(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX);
@@ -1,39 +0,0 @@
1
- /*************************************************************************************************
2
-
3
- Welcome to Baml! To use this generated code, please run one of the following:
4
-
5
- $ npm install @boundaryml/baml
6
- $ yarn add @boundaryml/baml
7
- $ pnpm add @boundaryml/baml
8
-
9
- *************************************************************************************************/
10
- import type { BamlRuntime, BamlCtxManager, Image, FunctionLog } from "@boundaryml/baml";
11
- import { HTTPRequest, ClientRegistry } from "@boundaryml/baml";
12
- import type * as types from "./types";
13
- import type TypeBuilder from "./type_builder";
14
- type TickReason = "Unknown";
15
- type BamlCallOptions<EventsT = never> = {
16
- tb?: TypeBuilder;
17
- clientRegistry?: ClientRegistry;
18
- client?: string;
19
- env?: Record<string, string | undefined>;
20
- onTick?: (reason: TickReason, log: FunctionLog | null) => void;
21
- events?: EventsT;
22
- };
23
- export declare class AsyncHttpRequest {
24
- private runtime;
25
- private ctxManager;
26
- constructor(runtime: BamlRuntime, ctxManager: BamlCtxManager);
27
- CreatePartialRecipe(memory: types.AgentContext, task: string, taskData: (Image | string)[], includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
28
- ExtractData(instructions: string, screenshot: Image, domContent: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
29
- QueryMemory(memory: types.AgentContext, query: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
30
- }
31
- export declare class AsyncHttpStreamRequest {
32
- private runtime;
33
- private ctxManager;
34
- constructor(runtime: BamlRuntime, ctxManager: BamlCtxManager);
35
- CreatePartialRecipe(memory: types.AgentContext, task: string, taskData: (Image | string)[], includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
36
- ExtractData(instructions: string, screenshot: Image, domContent: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
37
- QueryMemory(memory: types.AgentContext, query: string, includeClaudeSpoof: boolean, __baml_options__?: BamlCallOptions<never>): Promise<HTTPRequest>;
38
- }
39
- export {};