@elizaos/agent 0.25.9 → 2.0.0-alpha.151

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 (2938) hide show
  1. package/LICENSE +1 -1
  2. package/apps/app-companion/src/actions/emote.d.ts +10 -0
  3. package/apps/app-companion/src/actions/emote.d.ts.map +1 -0
  4. package/apps/app-companion/src/actions/emote.js +79 -0
  5. package/apps/app-companion/src/emotes/catalog.d.ts +31 -0
  6. package/apps/app-companion/src/emotes/catalog.d.ts.map +1 -0
  7. package/apps/app-companion/src/emotes/catalog.js +402 -0
  8. package/apps/app-companion/src/plugin.d.ts +9 -0
  9. package/apps/app-companion/src/plugin.d.ts.map +1 -0
  10. package/apps/app-companion/src/plugin.js +15 -0
  11. package/apps/app-knowledge/src/routes.d.ts +23 -0
  12. package/apps/app-knowledge/src/routes.d.ts.map +1 -0
  13. package/apps/app-knowledge/src/routes.js +956 -0
  14. package/apps/app-knowledge/src/service-loader.d.ts +51 -0
  15. package/apps/app-knowledge/src/service-loader.d.ts.map +1 -0
  16. package/apps/app-knowledge/src/service-loader.js +34 -0
  17. package/apps/app-lifeops/src/action.d.ts +3 -0
  18. package/apps/app-lifeops/src/action.d.ts.map +1 -0
  19. package/apps/app-lifeops/src/action.js +332 -0
  20. package/apps/app-lifeops/src/actions/calendar.d.ts +19 -0
  21. package/apps/app-lifeops/src/actions/calendar.d.ts.map +1 -0
  22. package/apps/app-lifeops/src/actions/calendar.js +3143 -0
  23. package/apps/app-lifeops/src/actions/gmail.d.ts +33 -0
  24. package/apps/app-lifeops/src/actions/gmail.d.ts.map +1 -0
  25. package/apps/app-lifeops/src/actions/gmail.js +1734 -0
  26. package/apps/app-lifeops/src/actions/inbox-digest.d.ts +2 -0
  27. package/apps/app-lifeops/src/actions/inbox-digest.d.ts.map +1 -0
  28. package/apps/app-lifeops/src/actions/inbox-digest.js +1 -0
  29. package/apps/app-lifeops/src/actions/inbox-respond.d.ts +2 -0
  30. package/apps/app-lifeops/src/actions/inbox-respond.d.ts.map +1 -0
  31. package/apps/app-lifeops/src/actions/inbox-respond.js +1 -0
  32. package/apps/app-lifeops/src/actions/inbox-triage.d.ts +2 -0
  33. package/apps/app-lifeops/src/actions/inbox-triage.d.ts.map +1 -0
  34. package/apps/app-lifeops/src/actions/inbox-triage.js +1 -0
  35. package/apps/app-lifeops/src/actions/inbox.d.ts +3 -0
  36. package/apps/app-lifeops/src/actions/inbox.d.ts.map +1 -0
  37. package/apps/app-lifeops/src/actions/inbox.js +856 -0
  38. package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts +69 -0
  39. package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts.map +1 -0
  40. package/apps/app-lifeops/src/actions/life-goal-extractor.js +354 -0
  41. package/apps/app-lifeops/src/actions/life-param-extractor.d.ts +78 -0
  42. package/apps/app-lifeops/src/actions/life-param-extractor.d.ts.map +1 -0
  43. package/apps/app-lifeops/src/actions/life-param-extractor.js +423 -0
  44. package/apps/app-lifeops/src/actions/life-recent-context.d.ts +9 -0
  45. package/apps/app-lifeops/src/actions/life-recent-context.d.ts.map +1 -0
  46. package/apps/app-lifeops/src/actions/life-recent-context.js +84 -0
  47. package/apps/app-lifeops/src/actions/life-update-extractor.d.ts +27 -0
  48. package/apps/app-lifeops/src/actions/life-update-extractor.d.ts.map +1 -0
  49. package/apps/app-lifeops/src/actions/life-update-extractor.js +195 -0
  50. package/apps/app-lifeops/src/actions/life.d.ts +9 -0
  51. package/apps/app-lifeops/src/actions/life.d.ts.map +1 -0
  52. package/apps/app-lifeops/src/actions/life.extractor.d.ts +18 -0
  53. package/apps/app-lifeops/src/actions/life.extractor.d.ts.map +1 -0
  54. package/apps/app-lifeops/src/actions/life.extractor.js +264 -0
  55. package/apps/app-lifeops/src/actions/life.js +3379 -0
  56. package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts +16 -0
  57. package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts.map +1 -0
  58. package/apps/app-lifeops/src/actions/lifeops-extraction-config.js +25 -0
  59. package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts +62 -0
  60. package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts.map +1 -0
  61. package/apps/app-lifeops/src/actions/lifeops-google-helpers.js +607 -0
  62. package/apps/app-lifeops/src/actions/timezone-normalization.d.ts +3 -0
  63. package/apps/app-lifeops/src/actions/timezone-normalization.d.ts.map +1 -0
  64. package/apps/app-lifeops/src/actions/timezone-normalization.js +105 -0
  65. package/apps/app-lifeops/src/actions/update-owner-profile.d.ts +3 -0
  66. package/apps/app-lifeops/src/actions/update-owner-profile.d.ts.map +1 -0
  67. package/apps/app-lifeops/src/actions/update-owner-profile.js +131 -0
  68. package/apps/app-lifeops/src/inbox/channel-deep-links.d.ts +20 -0
  69. package/apps/app-lifeops/src/inbox/channel-deep-links.d.ts.map +1 -0
  70. package/apps/app-lifeops/src/inbox/channel-deep-links.js +185 -0
  71. package/apps/app-lifeops/src/inbox/config.d.ts +7 -0
  72. package/apps/app-lifeops/src/inbox/config.d.ts.map +1 -0
  73. package/apps/app-lifeops/src/inbox/config.js +59 -0
  74. package/apps/app-lifeops/src/inbox/message-fetcher.d.ts +33 -0
  75. package/apps/app-lifeops/src/inbox/message-fetcher.d.ts.map +1 -0
  76. package/apps/app-lifeops/src/inbox/message-fetcher.js +252 -0
  77. package/apps/app-lifeops/src/inbox/reflection.d.ts +45 -0
  78. package/apps/app-lifeops/src/inbox/reflection.d.ts.map +1 -0
  79. package/apps/app-lifeops/src/inbox/reflection.js +157 -0
  80. package/apps/app-lifeops/src/inbox/repository.d.ts +53 -0
  81. package/apps/app-lifeops/src/inbox/repository.d.ts.map +1 -0
  82. package/apps/app-lifeops/src/inbox/repository.js +362 -0
  83. package/apps/app-lifeops/src/inbox/triage-classifier.d.ts +17 -0
  84. package/apps/app-lifeops/src/inbox/triage-classifier.d.ts.map +1 -0
  85. package/apps/app-lifeops/src/inbox/triage-classifier.js +209 -0
  86. package/apps/app-lifeops/src/inbox/types.d.ts +130 -0
  87. package/apps/app-lifeops/src/inbox/types.d.ts.map +1 -0
  88. package/apps/app-lifeops/src/inbox/types.js +1 -0
  89. package/apps/app-lifeops/src/lifeops/app-state.d.ts +11 -0
  90. package/apps/app-lifeops/src/lifeops/app-state.d.ts.map +1 -0
  91. package/apps/app-lifeops/src/lifeops/app-state.js +32 -0
  92. package/apps/app-lifeops/src/lifeops/apple-reminders.d.ts +58 -0
  93. package/apps/app-lifeops/src/lifeops/apple-reminders.d.ts.map +1 -0
  94. package/apps/app-lifeops/src/lifeops/apple-reminders.js +325 -0
  95. package/apps/app-lifeops/src/lifeops/defaults.d.ts +24 -0
  96. package/apps/app-lifeops/src/lifeops/defaults.d.ts.map +1 -0
  97. package/apps/app-lifeops/src/lifeops/defaults.js +205 -0
  98. package/apps/app-lifeops/src/lifeops/engine.d.ts +8 -0
  99. package/apps/app-lifeops/src/lifeops/engine.d.ts.map +1 -0
  100. package/apps/app-lifeops/src/lifeops/engine.js +389 -0
  101. package/apps/app-lifeops/src/lifeops/goal-grounding.d.ts +54 -0
  102. package/apps/app-lifeops/src/lifeops/goal-grounding.d.ts.map +1 -0
  103. package/apps/app-lifeops/src/lifeops/goal-grounding.js +147 -0
  104. package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.d.ts +12 -0
  105. package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.d.ts.map +1 -0
  106. package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.js +154 -0
  107. package/apps/app-lifeops/src/lifeops/google-api-error.d.ts +7 -0
  108. package/apps/app-lifeops/src/lifeops/google-api-error.d.ts.map +1 -0
  109. package/apps/app-lifeops/src/lifeops/google-api-error.js +35 -0
  110. package/apps/app-lifeops/src/lifeops/google-calendar.d.ts +53 -0
  111. package/apps/app-lifeops/src/lifeops/google-calendar.d.ts.map +1 -0
  112. package/apps/app-lifeops/src/lifeops/google-calendar.js +268 -0
  113. package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts +19 -0
  114. package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts.map +1 -0
  115. package/apps/app-lifeops/src/lifeops/google-connector-gateway.js +65 -0
  116. package/apps/app-lifeops/src/lifeops/google-fetch.d.ts +11 -0
  117. package/apps/app-lifeops/src/lifeops/google-fetch.d.ts.map +1 -0
  118. package/apps/app-lifeops/src/lifeops/google-fetch.js +85 -0
  119. package/apps/app-lifeops/src/lifeops/google-gmail.d.ts +54 -0
  120. package/apps/app-lifeops/src/lifeops/google-gmail.d.ts.map +1 -0
  121. package/apps/app-lifeops/src/lifeops/google-gmail.js +471 -0
  122. package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts +127 -0
  123. package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts.map +1 -0
  124. package/apps/app-lifeops/src/lifeops/google-managed-client.js +294 -0
  125. package/apps/app-lifeops/src/lifeops/google-oauth.d.ts +61 -0
  126. package/apps/app-lifeops/src/lifeops/google-oauth.d.ts.map +1 -0
  127. package/apps/app-lifeops/src/lifeops/google-oauth.js +491 -0
  128. package/apps/app-lifeops/src/lifeops/google-scopes.d.ts +13 -0
  129. package/apps/app-lifeops/src/lifeops/google-scopes.d.ts.map +1 -0
  130. package/apps/app-lifeops/src/lifeops/google-scopes.js +96 -0
  131. package/apps/app-lifeops/src/lifeops/index.d.ts +25 -0
  132. package/apps/app-lifeops/src/lifeops/index.d.ts.map +1 -0
  133. package/apps/app-lifeops/src/lifeops/index.js +24 -0
  134. package/apps/app-lifeops/src/lifeops/owner-profile.d.ts +15 -0
  135. package/apps/app-lifeops/src/lifeops/owner-profile.d.ts.map +1 -0
  136. package/apps/app-lifeops/src/lifeops/owner-profile.js +194 -0
  137. package/apps/app-lifeops/src/lifeops/repository.d.ts +209 -0
  138. package/apps/app-lifeops/src/lifeops/repository.d.ts.map +1 -0
  139. package/apps/app-lifeops/src/lifeops/repository.js +3187 -0
  140. package/apps/app-lifeops/src/lifeops/runtime.d.ts +14 -0
  141. package/apps/app-lifeops/src/lifeops/runtime.d.ts.map +1 -0
  142. package/apps/app-lifeops/src/lifeops/runtime.js +120 -0
  143. package/apps/app-lifeops/src/lifeops/screen-context.d.ts +52 -0
  144. package/apps/app-lifeops/src/lifeops/screen-context.d.ts.map +1 -0
  145. package/apps/app-lifeops/src/lifeops/screen-context.js +332 -0
  146. package/apps/app-lifeops/src/lifeops/seed-routines.d.ts +20 -0
  147. package/apps/app-lifeops/src/lifeops/seed-routines.d.ts.map +1 -0
  148. package/apps/app-lifeops/src/lifeops/seed-routines.js +111 -0
  149. package/apps/app-lifeops/src/lifeops/service.d.ts +275 -0
  150. package/apps/app-lifeops/src/lifeops/service.d.ts.map +1 -0
  151. package/apps/app-lifeops/src/lifeops/service.js +9260 -0
  152. package/apps/app-lifeops/src/lifeops/sql.d.ts +31 -0
  153. package/apps/app-lifeops/src/lifeops/sql.d.ts.map +1 -0
  154. package/apps/app-lifeops/src/lifeops/sql.js +247 -0
  155. package/apps/app-lifeops/src/lifeops/time.d.ts +17 -0
  156. package/apps/app-lifeops/src/lifeops/time.d.ts.map +1 -0
  157. package/apps/app-lifeops/src/lifeops/time.js +132 -0
  158. package/apps/app-lifeops/src/lifeops/twilio.d.ts +25 -0
  159. package/apps/app-lifeops/src/lifeops/twilio.d.ts.map +1 -0
  160. package/apps/app-lifeops/src/lifeops/twilio.js +157 -0
  161. package/apps/app-lifeops/src/lifeops/x-poster.d.ts +19 -0
  162. package/apps/app-lifeops/src/lifeops/x-poster.d.ts.map +1 -0
  163. package/apps/app-lifeops/src/lifeops/x-poster.js +148 -0
  164. package/apps/app-lifeops/src/plugin.d.ts +22 -0
  165. package/apps/app-lifeops/src/plugin.d.ts.map +1 -0
  166. package/apps/app-lifeops/src/plugin.js +92 -0
  167. package/apps/app-lifeops/src/provider.d.ts +3 -0
  168. package/apps/app-lifeops/src/provider.d.ts.map +1 -0
  169. package/apps/app-lifeops/src/provider.js +75 -0
  170. package/apps/app-lifeops/src/providers/inbox-triage.d.ts +3 -0
  171. package/apps/app-lifeops/src/providers/inbox-triage.d.ts.map +1 -0
  172. package/apps/app-lifeops/src/providers/inbox-triage.js +89 -0
  173. package/apps/app-lifeops/src/providers/lifeops.d.ts +3 -0
  174. package/apps/app-lifeops/src/providers/lifeops.d.ts.map +1 -0
  175. package/apps/app-lifeops/src/providers/lifeops.js +157 -0
  176. package/apps/app-lifeops/src/routes/lifeops-browser-packaging.d.ts +16 -0
  177. package/apps/app-lifeops/src/routes/lifeops-browser-packaging.d.ts.map +1 -0
  178. package/apps/app-lifeops/src/routes/lifeops-browser-packaging.js +305 -0
  179. package/apps/app-lifeops/src/routes/lifeops-routes.d.ts +20 -0
  180. package/apps/app-lifeops/src/routes/lifeops-routes.d.ts.map +1 -0
  181. package/apps/app-lifeops/src/routes/lifeops-routes.js +1173 -0
  182. package/apps/app-lifeops/src/routes/website-blocker-routes.d.ts +7 -0
  183. package/apps/app-lifeops/src/routes/website-blocker-routes.d.ts.map +1 -0
  184. package/apps/app-lifeops/src/routes/website-blocker-routes.js +175 -0
  185. package/apps/app-lifeops/src/selfcontrol/access.d.ts +8 -0
  186. package/apps/app-lifeops/src/selfcontrol/access.d.ts.map +1 -0
  187. package/apps/app-lifeops/src/selfcontrol/access.js +16 -0
  188. package/apps/app-lifeops/src/selfcontrol/action.d.ts +10 -0
  189. package/apps/app-lifeops/src/selfcontrol/action.d.ts.map +1 -0
  190. package/apps/app-lifeops/src/selfcontrol/action.js +506 -0
  191. package/apps/app-lifeops/src/selfcontrol/index.d.ts +13 -0
  192. package/apps/app-lifeops/src/selfcontrol/index.d.ts.map +1 -0
  193. package/apps/app-lifeops/src/selfcontrol/index.js +10 -0
  194. package/apps/app-lifeops/src/selfcontrol/permissions.d.ts +9 -0
  195. package/apps/app-lifeops/src/selfcontrol/permissions.d.ts.map +1 -0
  196. package/apps/app-lifeops/src/selfcontrol/permissions.js +1 -0
  197. package/apps/app-lifeops/src/selfcontrol/provider.d.ts +4 -0
  198. package/apps/app-lifeops/src/selfcontrol/provider.d.ts.map +1 -0
  199. package/apps/app-lifeops/src/selfcontrol/provider.js +116 -0
  200. package/apps/app-lifeops/src/selfcontrol/roles.d.ts +13 -0
  201. package/apps/app-lifeops/src/selfcontrol/roles.d.ts.map +1 -0
  202. package/apps/app-lifeops/src/selfcontrol/roles.js +228 -0
  203. package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts +97 -0
  204. package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts.map +1 -0
  205. package/apps/app-lifeops/src/selfcontrol/selfcontrol.js +949 -0
  206. package/apps/app-lifeops/src/selfcontrol/service.d.ts +21 -0
  207. package/apps/app-lifeops/src/selfcontrol/service.d.ts.map +1 -0
  208. package/apps/app-lifeops/src/selfcontrol/service.js +268 -0
  209. package/apps/app-lifeops/src/service.d.ts +8 -0
  210. package/apps/app-lifeops/src/service.d.ts.map +1 -0
  211. package/apps/app-lifeops/src/service.js +11 -0
  212. package/apps/app-steward/src/api/wallet-capability.d.ts +28 -0
  213. package/apps/app-steward/src/api/wallet-capability.d.ts.map +1 -0
  214. package/apps/app-steward/src/api/wallet-capability.js +94 -0
  215. package/apps/app-steward/src/api/wallet-dex-prices.d.ts +43 -0
  216. package/apps/app-steward/src/api/wallet-dex-prices.d.ts.map +1 -0
  217. package/apps/app-steward/src/api/wallet-dex-prices.js +149 -0
  218. package/apps/app-steward/src/api/wallet-evm-balance.d.ts +66 -0
  219. package/apps/app-steward/src/api/wallet-evm-balance.d.ts.map +1 -0
  220. package/apps/app-steward/src/api/wallet-evm-balance.js +666 -0
  221. package/apps/app-steward/src/api/wallet-routes.d.ts +35 -0
  222. package/apps/app-steward/src/api/wallet-routes.d.ts.map +1 -0
  223. package/apps/app-steward/src/api/wallet-routes.js +470 -0
  224. package/apps/app-steward/src/api/wallet-rpc.d.ts +67 -0
  225. package/apps/app-steward/src/api/wallet-rpc.d.ts.map +1 -0
  226. package/apps/app-steward/src/api/wallet-rpc.js +453 -0
  227. package/apps/app-steward/src/api/wallet.d.ts +60 -0
  228. package/apps/app-steward/src/api/wallet.d.ts.map +1 -0
  229. package/apps/app-steward/src/api/wallet.js +639 -0
  230. package/apps/app-steward/src/routes/server-wallet-trade.d.ts +27 -0
  231. package/apps/app-steward/src/routes/server-wallet-trade.d.ts.map +1 -0
  232. package/apps/app-steward/src/routes/server-wallet-trade.js +69 -0
  233. package/apps/app-steward/src/routes/wallet-core-routes.d.ts +16 -0
  234. package/apps/app-steward/src/routes/wallet-core-routes.d.ts.map +1 -0
  235. package/apps/app-steward/src/routes/wallet-core-routes.js +46 -0
  236. package/apps/app-steward/src/routes/wallet-export-guard.d.ts +51 -0
  237. package/apps/app-steward/src/routes/wallet-export-guard.d.ts.map +1 -0
  238. package/apps/app-steward/src/routes/wallet-export-guard.js +248 -0
  239. package/apps/app-steward/src/services/steward-evm-account.d.ts +58 -0
  240. package/apps/app-steward/src/services/steward-evm-account.d.ts.map +1 -0
  241. package/apps/app-steward/src/services/steward-evm-account.js +302 -0
  242. package/apps/app-steward/src/services/steward-evm-bridge.d.ts +35 -0
  243. package/apps/app-steward/src/services/steward-evm-bridge.d.ts.map +1 -0
  244. package/apps/app-steward/src/services/steward-evm-bridge.js +99 -0
  245. package/apps/app-training/src/services/index.d.ts +3 -0
  246. package/apps/app-training/src/services/index.d.ts.map +1 -0
  247. package/apps/app-training/src/services/index.js +1 -0
  248. package/apps/app-training/src/services/training-backend-check.d.ts +8 -0
  249. package/apps/app-training/src/services/training-backend-check.d.ts.map +1 -0
  250. package/apps/app-training/src/services/training-backend-check.js +28 -0
  251. package/apps/app-training/src/services/training-service-like.d.ts +38 -0
  252. package/apps/app-training/src/services/training-service-like.d.ts.map +1 -0
  253. package/apps/app-training/src/services/training-service-like.js +1 -0
  254. package/package.json +491 -34
  255. package/packages/agent/src/actions/app-control.d.ts +17 -0
  256. package/packages/agent/src/actions/app-control.d.ts.map +1 -0
  257. package/packages/agent/src/actions/app-control.js +212 -0
  258. package/packages/agent/src/actions/calendar.d.ts +2 -0
  259. package/packages/agent/src/actions/calendar.d.ts.map +1 -0
  260. package/packages/agent/src/actions/calendar.js +1 -0
  261. package/packages/agent/src/actions/check-balance.d.ts +17 -0
  262. package/packages/agent/src/actions/check-balance.d.ts.map +1 -0
  263. package/packages/agent/src/actions/check-balance.js +167 -0
  264. package/packages/agent/src/actions/connector-resolver.d.ts +75 -0
  265. package/packages/agent/src/actions/connector-resolver.d.ts.map +1 -0
  266. package/packages/agent/src/actions/connector-resolver.js +245 -0
  267. package/packages/agent/src/actions/context-signal-lexicon.d.ts +17 -0
  268. package/packages/agent/src/actions/context-signal-lexicon.d.ts.map +1 -0
  269. package/packages/agent/src/actions/context-signal-lexicon.js +207 -0
  270. package/packages/agent/src/actions/context-signal.d.ts +46 -0
  271. package/packages/agent/src/actions/context-signal.d.ts.map +1 -0
  272. package/packages/agent/src/actions/context-signal.js +134 -0
  273. package/packages/agent/src/actions/eject-plugin.d.ts +3 -0
  274. package/packages/agent/src/actions/eject-plugin.d.ts.map +1 -0
  275. package/packages/agent/src/actions/eject-plugin.js +48 -0
  276. package/packages/agent/src/actions/entity-actions.d.ts +4 -0
  277. package/packages/agent/src/actions/entity-actions.d.ts.map +1 -0
  278. package/packages/agent/src/actions/entity-actions.js +344 -0
  279. package/packages/agent/src/actions/execute-trade.d.ts +17 -0
  280. package/packages/agent/src/actions/execute-trade.d.ts.map +1 -0
  281. package/packages/agent/src/actions/execute-trade.js +299 -0
  282. package/packages/agent/src/actions/get-self-status.d.ts +13 -0
  283. package/packages/agent/src/actions/get-self-status.d.ts.map +1 -0
  284. package/packages/agent/src/actions/get-self-status.js +66 -0
  285. package/packages/agent/src/actions/gmail.d.ts +2 -0
  286. package/packages/agent/src/actions/gmail.d.ts.map +1 -0
  287. package/packages/agent/src/actions/gmail.js +1 -0
  288. package/packages/agent/src/actions/grounded-action-reply.d.ts +22 -0
  289. package/packages/agent/src/actions/grounded-action-reply.d.ts.map +1 -0
  290. package/packages/agent/src/actions/grounded-action-reply.js +309 -0
  291. package/packages/agent/src/actions/inbox-digest.d.ts +2 -0
  292. package/packages/agent/src/actions/inbox-digest.d.ts.map +1 -0
  293. package/packages/agent/src/actions/inbox-digest.js +1 -0
  294. package/packages/agent/src/actions/inbox-respond.d.ts +2 -0
  295. package/packages/agent/src/actions/inbox-respond.d.ts.map +1 -0
  296. package/packages/agent/src/actions/inbox-respond.js +1 -0
  297. package/packages/agent/src/actions/inbox-triage.d.ts +2 -0
  298. package/packages/agent/src/actions/inbox-triage.d.ts.map +1 -0
  299. package/packages/agent/src/actions/inbox-triage.js +1 -0
  300. package/packages/agent/src/actions/inbox.d.ts +2 -0
  301. package/packages/agent/src/actions/inbox.d.ts.map +1 -0
  302. package/packages/agent/src/actions/inbox.js +1 -0
  303. package/packages/agent/src/actions/index.d.ts +24 -0
  304. package/packages/agent/src/actions/index.d.ts.map +1 -0
  305. package/packages/agent/src/actions/index.js +23 -0
  306. package/packages/agent/src/actions/install-plugin.d.ts +3 -0
  307. package/packages/agent/src/actions/install-plugin.d.ts.map +1 -0
  308. package/packages/agent/src/actions/install-plugin.js +65 -0
  309. package/packages/agent/src/actions/life-goal-extractor.d.ts +2 -0
  310. package/packages/agent/src/actions/life-goal-extractor.d.ts.map +1 -0
  311. package/packages/agent/src/actions/life-goal-extractor.js +1 -0
  312. package/packages/agent/src/actions/life-param-extractor.d.ts +2 -0
  313. package/packages/agent/src/actions/life-param-extractor.d.ts.map +1 -0
  314. package/packages/agent/src/actions/life-param-extractor.js +1 -0
  315. package/packages/agent/src/actions/life-recent-context.d.ts +2 -0
  316. package/packages/agent/src/actions/life-recent-context.d.ts.map +1 -0
  317. package/packages/agent/src/actions/life-recent-context.js +1 -0
  318. package/packages/agent/src/actions/life-update-extractor.d.ts +2 -0
  319. package/packages/agent/src/actions/life-update-extractor.d.ts.map +1 -0
  320. package/packages/agent/src/actions/life-update-extractor.js +1 -0
  321. package/packages/agent/src/actions/life.d.ts +2 -0
  322. package/packages/agent/src/actions/life.d.ts.map +1 -0
  323. package/packages/agent/src/actions/life.extractor.d.ts +2 -0
  324. package/packages/agent/src/actions/life.extractor.d.ts.map +1 -0
  325. package/packages/agent/src/actions/life.extractor.js +1 -0
  326. package/packages/agent/src/actions/life.js +1 -0
  327. package/packages/agent/src/actions/lifeops-extraction-config.d.ts +2 -0
  328. package/packages/agent/src/actions/lifeops-extraction-config.d.ts.map +1 -0
  329. package/packages/agent/src/actions/lifeops-extraction-config.js +1 -0
  330. package/packages/agent/src/actions/lifeops-google-helpers.d.ts +2 -0
  331. package/packages/agent/src/actions/lifeops-google-helpers.d.ts.map +1 -0
  332. package/packages/agent/src/actions/lifeops-google-helpers.js +1 -0
  333. package/packages/agent/src/actions/list-ejected.d.ts +3 -0
  334. package/packages/agent/src/actions/list-ejected.d.ts.map +1 -0
  335. package/packages/agent/src/actions/list-ejected.js +35 -0
  336. package/packages/agent/src/actions/log-level.d.ts +3 -0
  337. package/packages/agent/src/actions/log-level.d.ts.map +1 -0
  338. package/packages/agent/src/actions/log-level.js +125 -0
  339. package/packages/agent/src/actions/manage-tasks.d.ts +8 -0
  340. package/packages/agent/src/actions/manage-tasks.d.ts.map +1 -0
  341. package/packages/agent/src/actions/manage-tasks.js +289 -0
  342. package/packages/agent/src/actions/media.d.ts +21 -0
  343. package/packages/agent/src/actions/media.d.ts.map +1 -0
  344. package/packages/agent/src/actions/media.js +384 -0
  345. package/packages/agent/src/actions/read-channel.d.ts +3 -0
  346. package/packages/agent/src/actions/read-channel.d.ts.map +1 -0
  347. package/packages/agent/src/actions/read-channel.js +224 -0
  348. package/packages/agent/src/actions/read-messages.d.ts +14 -0
  349. package/packages/agent/src/actions/read-messages.d.ts.map +1 -0
  350. package/packages/agent/src/actions/read-messages.js +228 -0
  351. package/packages/agent/src/actions/reinject-plugin.d.ts +3 -0
  352. package/packages/agent/src/actions/reinject-plugin.d.ts.map +1 -0
  353. package/packages/agent/src/actions/reinject-plugin.js +47 -0
  354. package/packages/agent/src/actions/restart.d.ts +19 -0
  355. package/packages/agent/src/actions/restart.d.ts.map +1 -0
  356. package/packages/agent/src/actions/restart.js +109 -0
  357. package/packages/agent/src/actions/search-conversations.d.ts +3 -0
  358. package/packages/agent/src/actions/search-conversations.d.ts.map +1 -0
  359. package/packages/agent/src/actions/search-conversations.js +181 -0
  360. package/packages/agent/src/actions/send-admin-message.d.ts +3 -0
  361. package/packages/agent/src/actions/send-admin-message.d.ts.map +1 -0
  362. package/packages/agent/src/actions/send-admin-message.js +106 -0
  363. package/packages/agent/src/actions/send-message.d.ts +4 -0
  364. package/packages/agent/src/actions/send-message.d.ts.map +1 -0
  365. package/packages/agent/src/actions/send-message.js +364 -0
  366. package/packages/agent/src/actions/set-user-name.d.ts +13 -0
  367. package/packages/agent/src/actions/set-user-name.d.ts.map +1 -0
  368. package/packages/agent/src/actions/set-user-name.js +82 -0
  369. package/packages/agent/src/actions/skill-command.d.ts +20 -0
  370. package/packages/agent/src/actions/skill-command.d.ts.map +1 -0
  371. package/packages/agent/src/actions/skill-command.js +141 -0
  372. package/packages/agent/src/actions/stream-control.d.ts +11 -0
  373. package/packages/agent/src/actions/stream-control.d.ts.map +1 -0
  374. package/packages/agent/src/actions/stream-control.js +112 -0
  375. package/packages/agent/src/actions/sync-plugin.d.ts +3 -0
  376. package/packages/agent/src/actions/sync-plugin.d.ts.map +1 -0
  377. package/packages/agent/src/actions/sync-plugin.js +47 -0
  378. package/packages/agent/src/actions/terminal.d.ts +15 -0
  379. package/packages/agent/src/actions/terminal.d.ts.map +1 -0
  380. package/packages/agent/src/actions/terminal.js +453 -0
  381. package/packages/agent/src/actions/timezone-normalization.d.ts +2 -0
  382. package/packages/agent/src/actions/timezone-normalization.d.ts.map +1 -0
  383. package/packages/agent/src/actions/timezone-normalization.js +1 -0
  384. package/packages/agent/src/actions/transfer-token.d.ts +17 -0
  385. package/packages/agent/src/actions/transfer-token.d.ts.map +1 -0
  386. package/packages/agent/src/actions/transfer-token.js +470 -0
  387. package/packages/agent/src/actions/update-owner-profile.d.ts +2 -0
  388. package/packages/agent/src/actions/update-owner-profile.d.ts.map +1 -0
  389. package/packages/agent/src/actions/update-owner-profile.js +1 -0
  390. package/packages/agent/src/actions/wallet-action-shared.d.ts +15 -0
  391. package/packages/agent/src/actions/wallet-action-shared.d.ts.map +1 -0
  392. package/packages/agent/src/actions/wallet-action-shared.js +24 -0
  393. package/packages/agent/src/actions/web-search.d.ts +16 -0
  394. package/packages/agent/src/actions/web-search.d.ts.map +1 -0
  395. package/packages/agent/src/actions/web-search.js +196 -0
  396. package/packages/agent/src/activity-profile/analyzer.d.ts +23 -0
  397. package/packages/agent/src/activity-profile/analyzer.d.ts.map +1 -0
  398. package/packages/agent/src/activity-profile/analyzer.js +531 -0
  399. package/packages/agent/src/activity-profile/proactive-planner.d.ts +49 -0
  400. package/packages/agent/src/activity-profile/proactive-planner.d.ts.map +1 -0
  401. package/packages/agent/src/activity-profile/proactive-planner.js +455 -0
  402. package/packages/agent/src/activity-profile/proactive-worker.d.ts +32 -0
  403. package/packages/agent/src/activity-profile/proactive-worker.d.ts.map +1 -0
  404. package/packages/agent/src/activity-profile/proactive-worker.js +523 -0
  405. package/packages/agent/src/activity-profile/profile-metadata.d.ts +10 -0
  406. package/packages/agent/src/activity-profile/profile-metadata.d.ts.map +1 -0
  407. package/packages/agent/src/activity-profile/profile-metadata.js +25 -0
  408. package/packages/agent/src/activity-profile/service.d.ts +11 -0
  409. package/packages/agent/src/activity-profile/service.d.ts.map +1 -0
  410. package/packages/agent/src/activity-profile/service.js +226 -0
  411. package/packages/agent/src/activity-profile/types.d.ts +89 -0
  412. package/packages/agent/src/activity-profile/types.d.ts.map +1 -0
  413. package/packages/agent/src/activity-profile/types.js +29 -0
  414. package/packages/agent/src/api/agent-admin-routes.d.ts +39 -0
  415. package/packages/agent/src/api/agent-admin-routes.d.ts.map +1 -0
  416. package/packages/agent/src/api/agent-admin-routes.js +155 -0
  417. package/packages/agent/src/api/agent-lifecycle-routes.d.ts +16 -0
  418. package/packages/agent/src/api/agent-lifecycle-routes.d.ts.map +1 -0
  419. package/packages/agent/src/api/agent-lifecycle-routes.js +94 -0
  420. package/packages/agent/src/api/agent-model.d.ts +5 -0
  421. package/packages/agent/src/api/agent-model.d.ts.map +1 -0
  422. package/packages/agent/src/api/agent-model.js +154 -0
  423. package/packages/agent/src/api/agent-status-routes.d.ts +96 -0
  424. package/packages/agent/src/api/agent-status-routes.d.ts.map +1 -0
  425. package/packages/agent/src/api/agent-status-routes.js +274 -0
  426. package/packages/agent/src/api/agent-transfer-routes.d.ts +16 -0
  427. package/packages/agent/src/api/agent-transfer-routes.d.ts.map +1 -0
  428. package/packages/agent/src/api/agent-transfer-routes.js +124 -0
  429. package/packages/agent/src/api/app-package-routes.d.ts +7 -0
  430. package/packages/agent/src/api/app-package-routes.d.ts.map +1 -0
  431. package/packages/agent/src/api/app-package-routes.js +59 -0
  432. package/packages/agent/src/api/apps-routes.d.ts +24 -0
  433. package/packages/agent/src/api/apps-routes.d.ts.map +1 -0
  434. package/packages/agent/src/api/apps-routes.js +477 -0
  435. package/packages/agent/src/api/auth-routes.d.ts +11 -0
  436. package/packages/agent/src/api/auth-routes.d.ts.map +1 -0
  437. package/packages/agent/src/api/auth-routes.js +74 -0
  438. package/packages/agent/src/api/avatar-routes.d.ts +11 -0
  439. package/packages/agent/src/api/avatar-routes.d.ts.map +1 -0
  440. package/packages/agent/src/api/avatar-routes.js +205 -0
  441. package/packages/agent/src/api/binance-skill-helpers.d.ts +26 -0
  442. package/packages/agent/src/api/binance-skill-helpers.d.ts.map +1 -0
  443. package/packages/agent/src/api/binance-skill-helpers.js +781 -0
  444. package/packages/agent/src/api/bluebubbles-routes.d.ts +10 -0
  445. package/packages/agent/src/api/bluebubbles-routes.d.ts.map +1 -0
  446. package/packages/agent/src/api/bluebubbles-routes.js +129 -0
  447. package/packages/agent/src/api/browser-workspace-routes.d.ts +5 -0
  448. package/packages/agent/src/api/browser-workspace-routes.d.ts.map +1 -0
  449. package/packages/agent/src/api/browser-workspace-routes.js +100 -0
  450. package/packages/agent/src/api/bsc-trade.d.ts +40 -0
  451. package/packages/agent/src/api/bsc-trade.d.ts.map +1 -0
  452. package/packages/agent/src/api/bsc-trade.js +786 -0
  453. package/packages/agent/src/api/bug-report-routes.d.ts +10 -0
  454. package/packages/agent/src/api/bug-report-routes.d.ts.map +1 -0
  455. package/packages/agent/src/api/bug-report-routes.js +264 -0
  456. package/packages/agent/src/api/character-routes.d.ts +51 -0
  457. package/packages/agent/src/api/character-routes.d.ts.map +1 -0
  458. package/packages/agent/src/api/character-routes.js +367 -0
  459. package/packages/agent/src/api/chat-augmentation.d.ts +89 -0
  460. package/packages/agent/src/api/chat-augmentation.d.ts.map +1 -0
  461. package/packages/agent/src/api/chat-augmentation.js +396 -0
  462. package/packages/agent/src/api/chat-routes.d.ts +106 -0
  463. package/packages/agent/src/api/chat-routes.d.ts.map +1 -0
  464. package/packages/agent/src/api/chat-routes.js +1500 -0
  465. package/packages/agent/src/api/chat-text-helpers.d.ts +11 -0
  466. package/packages/agent/src/api/chat-text-helpers.d.ts.map +1 -0
  467. package/packages/agent/src/api/chat-text-helpers.js +183 -0
  468. package/packages/agent/src/api/cloud-billing-routes.d.ts +9 -0
  469. package/packages/agent/src/api/cloud-billing-routes.d.ts.map +1 -0
  470. package/packages/agent/src/api/cloud-billing-routes.js +388 -0
  471. package/packages/agent/src/api/cloud-compat-routes.d.ts +10 -0
  472. package/packages/agent/src/api/cloud-compat-routes.d.ts.map +1 -0
  473. package/packages/agent/src/api/cloud-compat-routes.js +212 -0
  474. package/packages/agent/src/api/cloud-provisioning.d.ts +14 -0
  475. package/packages/agent/src/api/cloud-provisioning.d.ts.map +1 -0
  476. package/packages/agent/src/api/cloud-provisioning.js +30 -0
  477. package/packages/agent/src/api/cloud-relay-routes.d.ts +22 -0
  478. package/packages/agent/src/api/cloud-relay-routes.d.ts.map +1 -0
  479. package/packages/agent/src/api/cloud-relay-routes.js +52 -0
  480. package/packages/agent/src/api/cloud-routes.d.ts +80 -0
  481. package/packages/agent/src/api/cloud-routes.d.ts.map +1 -0
  482. package/packages/agent/src/api/cloud-routes.js +582 -0
  483. package/packages/agent/src/api/cloud-status-routes.d.ts +15 -0
  484. package/packages/agent/src/api/cloud-status-routes.d.ts.map +1 -0
  485. package/packages/agent/src/api/cloud-status-routes.js +143 -0
  486. package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts +2 -0
  487. package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts.map +1 -0
  488. package/packages/agent/src/api/coding-agents-auth-sanitize.js +1 -0
  489. package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts +2 -0
  490. package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts.map +1 -0
  491. package/packages/agent/src/api/coding-agents-preflight-normalize.js +1 -0
  492. package/packages/agent/src/api/compat-utils.d.ts +49 -0
  493. package/packages/agent/src/api/compat-utils.d.ts.map +1 -0
  494. package/packages/agent/src/api/compat-utils.js +126 -0
  495. package/packages/agent/src/api/config-env.d.ts +43 -0
  496. package/packages/agent/src/api/config-env.d.ts.map +1 -0
  497. package/packages/agent/src/api/config-env.js +284 -0
  498. package/packages/agent/src/api/config-routes.d.ts +33 -0
  499. package/packages/agent/src/api/config-routes.d.ts.map +1 -0
  500. package/packages/agent/src/api/config-routes.js +253 -0
  501. package/packages/agent/src/api/connector-health.d.ts +42 -0
  502. package/packages/agent/src/api/connector-health.d.ts.map +1 -0
  503. package/packages/agent/src/api/connector-health.js +132 -0
  504. package/packages/agent/src/api/connector-routes.d.ts +21 -0
  505. package/packages/agent/src/api/connector-routes.d.ts.map +1 -0
  506. package/packages/agent/src/api/connector-routes.js +79 -0
  507. package/packages/agent/src/api/conversation-routes.d.ts +42 -0
  508. package/packages/agent/src/api/conversation-routes.d.ts.map +1 -0
  509. package/packages/agent/src/api/conversation-routes.js +1128 -0
  510. package/packages/agent/src/api/coordinator-types.d.ts +2 -0
  511. package/packages/agent/src/api/coordinator-types.d.ts.map +1 -0
  512. package/packages/agent/src/api/coordinator-types.js +1 -0
  513. package/packages/agent/src/api/coordinator-wiring.d.ts +2 -0
  514. package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -0
  515. package/packages/agent/src/api/coordinator-wiring.js +1 -0
  516. package/packages/agent/src/api/credit-detection.d.ts +9 -0
  517. package/packages/agent/src/api/credit-detection.d.ts.map +1 -0
  518. package/packages/agent/src/api/credit-detection.js +41 -0
  519. package/packages/agent/src/api/database.d.ts +33 -0
  520. package/packages/agent/src/api/database.d.ts.map +1 -0
  521. package/packages/agent/src/api/database.js +1020 -0
  522. package/packages/agent/src/api/diagnostics-routes.d.ts +53 -0
  523. package/packages/agent/src/api/diagnostics-routes.d.ts.map +1 -0
  524. package/packages/agent/src/api/diagnostics-routes.js +250 -0
  525. package/packages/agent/src/api/discord-avatar-cache.d.ts +10 -0
  526. package/packages/agent/src/api/discord-avatar-cache.d.ts.map +1 -0
  527. package/packages/agent/src/api/discord-avatar-cache.js +149 -0
  528. package/packages/agent/src/api/discord-local-routes.d.ts +12 -0
  529. package/packages/agent/src/api/discord-local-routes.d.ts.map +1 -0
  530. package/packages/agent/src/api/discord-local-routes.js +145 -0
  531. package/packages/agent/src/api/discord-profiles.d.ts +26 -0
  532. package/packages/agent/src/api/discord-profiles.d.ts.map +1 -0
  533. package/packages/agent/src/api/discord-profiles.js +282 -0
  534. package/packages/agent/src/api/drop-routes.d.ts +22 -0
  535. package/packages/agent/src/api/drop-routes.d.ts.map +1 -0
  536. package/packages/agent/src/api/drop-routes.js +155 -0
  537. package/packages/agent/src/api/drop-service.d.ts +26 -0
  538. package/packages/agent/src/api/drop-service.d.ts.map +1 -0
  539. package/packages/agent/src/api/drop-service.js +134 -0
  540. package/packages/agent/src/api/early-logs.d.ts +29 -0
  541. package/packages/agent/src/api/early-logs.d.ts.map +1 -0
  542. package/packages/agent/src/api/early-logs.js +96 -0
  543. package/packages/agent/src/api/health-routes.d.ts +44 -0
  544. package/packages/agent/src/api/health-routes.d.ts.map +1 -0
  545. package/packages/agent/src/api/health-routes.js +449 -0
  546. package/packages/agent/src/api/http-helpers.d.ts +50 -0
  547. package/packages/agent/src/api/http-helpers.d.ts.map +1 -0
  548. package/packages/agent/src/api/http-helpers.js +148 -0
  549. package/packages/agent/src/api/imessage-routes.d.ts +55 -0
  550. package/packages/agent/src/api/imessage-routes.d.ts.map +1 -0
  551. package/packages/agent/src/api/imessage-routes.js +231 -0
  552. package/packages/agent/src/api/inbox-routes.d.ts +48 -0
  553. package/packages/agent/src/api/inbox-routes.d.ts.map +1 -0
  554. package/packages/agent/src/api/inbox-routes.js +1547 -0
  555. package/packages/agent/src/api/index.d.ts +63 -0
  556. package/packages/agent/src/api/index.d.ts.map +1 -0
  557. package/packages/agent/src/api/index.js +62 -0
  558. package/packages/agent/src/api/knowledge-routes.d.ts +2 -0
  559. package/packages/agent/src/api/knowledge-routes.d.ts.map +1 -0
  560. package/packages/agent/src/api/knowledge-routes.js +2 -0
  561. package/packages/agent/src/api/knowledge-service-loader.d.ts +2 -0
  562. package/packages/agent/src/api/knowledge-service-loader.d.ts.map +1 -0
  563. package/packages/agent/src/api/knowledge-service-loader.js +2 -0
  564. package/packages/agent/src/api/lifeops-browser-packaging.d.ts +2 -0
  565. package/packages/agent/src/api/lifeops-browser-packaging.d.ts.map +1 -0
  566. package/packages/agent/src/api/lifeops-browser-packaging.js +1 -0
  567. package/packages/agent/src/api/lifeops-routes.d.ts +2 -0
  568. package/packages/agent/src/api/lifeops-routes.d.ts.map +1 -0
  569. package/packages/agent/src/api/lifeops-routes.js +1 -0
  570. package/packages/agent/src/api/mcp-routes.d.ts +33 -0
  571. package/packages/agent/src/api/mcp-routes.d.ts.map +1 -0
  572. package/packages/agent/src/api/mcp-routes.js +186 -0
  573. package/packages/agent/src/api/memory-bounds.d.ts +51 -0
  574. package/packages/agent/src/api/memory-bounds.d.ts.map +1 -0
  575. package/packages/agent/src/api/memory-bounds.js +81 -0
  576. package/packages/agent/src/api/memory-routes.d.ts +9 -0
  577. package/packages/agent/src/api/memory-routes.d.ts.map +1 -0
  578. package/packages/agent/src/api/memory-routes.js +420 -0
  579. package/packages/agent/src/api/merkle-tree.d.ts +90 -0
  580. package/packages/agent/src/api/merkle-tree.d.ts.map +1 -0
  581. package/packages/agent/src/api/merkle-tree.js +174 -0
  582. package/packages/agent/src/api/misc-routes.d.ts +64 -0
  583. package/packages/agent/src/api/misc-routes.d.ts.map +1 -0
  584. package/packages/agent/src/api/misc-routes.js +557 -0
  585. package/packages/agent/src/api/model-provider-helpers.d.ts +84 -0
  586. package/packages/agent/src/api/model-provider-helpers.d.ts.map +1 -0
  587. package/packages/agent/src/api/model-provider-helpers.js +588 -0
  588. package/packages/agent/src/api/models-routes.d.ts +14 -0
  589. package/packages/agent/src/api/models-routes.d.ts.map +1 -0
  590. package/packages/agent/src/api/models-routes.js +37 -0
  591. package/packages/agent/src/api/music-player-route-fallback.d.ts +16 -0
  592. package/packages/agent/src/api/music-player-route-fallback.d.ts.map +1 -0
  593. package/packages/agent/src/api/music-player-route-fallback.js +65 -0
  594. package/packages/agent/src/api/nfa-routes.d.ts +5 -0
  595. package/packages/agent/src/api/nfa-routes.d.ts.map +1 -0
  596. package/packages/agent/src/api/nfa-routes.js +133 -0
  597. package/packages/agent/src/api/nft-verify.d.ts +16 -0
  598. package/packages/agent/src/api/nft-verify.d.ts.map +1 -0
  599. package/packages/agent/src/api/nft-verify.js +81 -0
  600. package/packages/agent/src/api/og-tracker.d.ts +28 -0
  601. package/packages/agent/src/api/og-tracker.d.ts.map +1 -0
  602. package/packages/agent/src/api/og-tracker.js +60 -0
  603. package/packages/agent/src/api/onboarding-routes.d.ts +50 -0
  604. package/packages/agent/src/api/onboarding-routes.d.ts.map +1 -0
  605. package/packages/agent/src/api/onboarding-routes.js +561 -0
  606. package/packages/agent/src/api/owner-contact-helpers.d.ts +39 -0
  607. package/packages/agent/src/api/owner-contact-helpers.d.ts.map +1 -0
  608. package/packages/agent/src/api/owner-contact-helpers.js +47 -0
  609. package/packages/agent/src/api/parse-action-block.d.ts +35 -0
  610. package/packages/agent/src/api/parse-action-block.d.ts.map +1 -0
  611. package/packages/agent/src/api/parse-action-block.js +110 -0
  612. package/packages/agent/src/api/permissions-routes-extra.d.ts +30 -0
  613. package/packages/agent/src/api/permissions-routes-extra.d.ts.map +1 -0
  614. package/packages/agent/src/api/permissions-routes-extra.js +78 -0
  615. package/packages/agent/src/api/permissions-routes.d.ts +28 -0
  616. package/packages/agent/src/api/permissions-routes.d.ts.map +1 -0
  617. package/packages/agent/src/api/permissions-routes.js +180 -0
  618. package/packages/agent/src/api/plugin-discovery-helpers.d.ts +147 -0
  619. package/packages/agent/src/api/plugin-discovery-helpers.d.ts.map +1 -0
  620. package/packages/agent/src/api/plugin-discovery-helpers.js +1015 -0
  621. package/packages/agent/src/api/plugin-routes.d.ts +127 -0
  622. package/packages/agent/src/api/plugin-routes.d.ts.map +1 -0
  623. package/packages/agent/src/api/plugin-routes.js +1140 -0
  624. package/packages/agent/src/api/plugin-runtime-apply.d.ts +31 -0
  625. package/packages/agent/src/api/plugin-runtime-apply.d.ts.map +1 -0
  626. package/packages/agent/src/api/plugin-runtime-apply.js +217 -0
  627. package/packages/agent/src/api/plugin-validation.d.ts +86 -0
  628. package/packages/agent/src/api/plugin-validation.d.ts.map +1 -0
  629. package/packages/agent/src/api/plugin-validation.js +259 -0
  630. package/packages/agent/src/api/provider-switch-config.d.ts +60 -0
  631. package/packages/agent/src/api/provider-switch-config.d.ts.map +1 -0
  632. package/packages/agent/src/api/provider-switch-config.js +718 -0
  633. package/packages/agent/src/api/provider-switch-routes.d.ts +22 -0
  634. package/packages/agent/src/api/provider-switch-routes.d.ts.map +1 -0
  635. package/packages/agent/src/api/provider-switch-routes.js +92 -0
  636. package/packages/agent/src/api/rate-limiter.d.ts +29 -0
  637. package/packages/agent/src/api/rate-limiter.d.ts.map +1 -0
  638. package/packages/agent/src/api/rate-limiter.js +54 -0
  639. package/packages/agent/src/api/registry-routes.d.ts +29 -0
  640. package/packages/agent/src/api/registry-routes.d.ts.map +1 -0
  641. package/packages/agent/src/api/registry-routes.js +98 -0
  642. package/packages/agent/src/api/registry-service.d.ts +77 -0
  643. package/packages/agent/src/api/registry-service.d.ts.map +1 -0
  644. package/packages/agent/src/api/registry-service.js +190 -0
  645. package/packages/agent/src/api/relationships-routes.d.ts +7 -0
  646. package/packages/agent/src/api/relationships-routes.d.ts.map +1 -0
  647. package/packages/agent/src/api/relationships-routes.js +181 -0
  648. package/packages/agent/src/api/route-helpers.d.ts +16 -0
  649. package/packages/agent/src/api/route-helpers.d.ts.map +1 -0
  650. package/packages/agent/src/api/route-helpers.js +1 -0
  651. package/packages/agent/src/api/runtime-plugin-routes.d.ts +21 -0
  652. package/packages/agent/src/api/runtime-plugin-routes.d.ts.map +1 -0
  653. package/packages/agent/src/api/runtime-plugin-routes.js +132 -0
  654. package/packages/agent/src/api/sandbox-routes.d.ts +12 -0
  655. package/packages/agent/src/api/sandbox-routes.d.ts.map +1 -0
  656. package/packages/agent/src/api/sandbox-routes.js +1334 -0
  657. package/packages/agent/src/api/server-auth.d.ts +52 -0
  658. package/packages/agent/src/api/server-auth.d.ts.map +1 -0
  659. package/packages/agent/src/api/server-auth.js +332 -0
  660. package/packages/agent/src/api/server-helpers.d.ts +95 -0
  661. package/packages/agent/src/api/server-helpers.d.ts.map +1 -0
  662. package/packages/agent/src/api/server-helpers.js +708 -0
  663. package/packages/agent/src/api/server-startup.d.ts +16 -0
  664. package/packages/agent/src/api/server-startup.d.ts.map +1 -0
  665. package/packages/agent/src/api/server-startup.js +14 -0
  666. package/packages/agent/src/api/server-types.d.ts +216 -0
  667. package/packages/agent/src/api/server-types.d.ts.map +1 -0
  668. package/packages/agent/src/api/server-types.js +6 -0
  669. package/packages/agent/src/api/server.d.ts +144 -0
  670. package/packages/agent/src/api/server.d.ts.map +1 -0
  671. package/packages/agent/src/api/server.js +5304 -0
  672. package/packages/agent/src/api/signal-routes.d.ts +42 -0
  673. package/packages/agent/src/api/signal-routes.d.ts.map +1 -0
  674. package/packages/agent/src/api/signal-routes.js +232 -0
  675. package/packages/agent/src/api/skill-discovery-helpers.d.ts +80 -0
  676. package/packages/agent/src/api/skill-discovery-helpers.d.ts.map +1 -0
  677. package/packages/agent/src/api/skill-discovery-helpers.js +381 -0
  678. package/packages/agent/src/api/skills-routes.d.ts +32 -0
  679. package/packages/agent/src/api/skills-routes.d.ts.map +1 -0
  680. package/packages/agent/src/api/skills-routes.js +947 -0
  681. package/packages/agent/src/api/static-file-server.d.ts +19 -0
  682. package/packages/agent/src/api/static-file-server.d.ts.map +1 -0
  683. package/packages/agent/src/api/static-file-server.js +233 -0
  684. package/packages/agent/src/api/stream-persistence.d.ts +64 -0
  685. package/packages/agent/src/api/stream-persistence.d.ts.map +1 -0
  686. package/packages/agent/src/api/stream-persistence.js +231 -0
  687. package/packages/agent/src/api/stream-route-state.d.ts +56 -0
  688. package/packages/agent/src/api/stream-route-state.d.ts.map +1 -0
  689. package/packages/agent/src/api/stream-route-state.js +1 -0
  690. package/packages/agent/src/api/stream-routes.d.ts +43 -0
  691. package/packages/agent/src/api/stream-routes.d.ts.map +1 -0
  692. package/packages/agent/src/api/stream-routes.js +728 -0
  693. package/packages/agent/src/api/streaming-text.d.ts +9 -0
  694. package/packages/agent/src/api/streaming-text.d.ts.map +1 -0
  695. package/packages/agent/src/api/streaming-text.js +85 -0
  696. package/packages/agent/src/api/streaming-types.d.ts +30 -0
  697. package/packages/agent/src/api/streaming-types.d.ts.map +1 -0
  698. package/packages/agent/src/api/streaming-types.js +1 -0
  699. package/packages/agent/src/api/subscription-routes.d.ts +20 -0
  700. package/packages/agent/src/api/subscription-routes.d.ts.map +1 -0
  701. package/packages/agent/src/api/subscription-routes.js +213 -0
  702. package/packages/agent/src/api/task-agent-message-routing.d.ts +2 -0
  703. package/packages/agent/src/api/task-agent-message-routing.d.ts.map +1 -0
  704. package/packages/agent/src/api/task-agent-message-routing.js +1 -0
  705. package/packages/agent/src/api/telegram-account-routes.d.ts +26 -0
  706. package/packages/agent/src/api/telegram-account-routes.d.ts.map +1 -0
  707. package/packages/agent/src/api/telegram-account-routes.js +229 -0
  708. package/packages/agent/src/api/telegram-setup-routes.d.ts +27 -0
  709. package/packages/agent/src/api/telegram-setup-routes.d.ts.map +1 -0
  710. package/packages/agent/src/api/telegram-setup-routes.js +125 -0
  711. package/packages/agent/src/api/terminal-run-limits.d.ts +5 -0
  712. package/packages/agent/src/api/terminal-run-limits.d.ts.map +1 -0
  713. package/packages/agent/src/api/terminal-run-limits.js +22 -0
  714. package/packages/agent/src/api/trade-safety.d.ts +39 -0
  715. package/packages/agent/src/api/trade-safety.d.ts.map +1 -0
  716. package/packages/agent/src/api/trade-safety.js +66 -0
  717. package/packages/agent/src/api/training-backend-check.d.ts +2 -0
  718. package/packages/agent/src/api/training-backend-check.d.ts.map +1 -0
  719. package/packages/agent/src/api/training-backend-check.js +2 -0
  720. package/packages/agent/src/api/training-routes.d.ts +2 -0
  721. package/packages/agent/src/api/training-routes.d.ts.map +1 -0
  722. package/packages/agent/src/api/training-routes.js +2 -0
  723. package/packages/agent/src/api/training-service-like.d.ts +2 -0
  724. package/packages/agent/src/api/training-service-like.d.ts.map +1 -0
  725. package/packages/agent/src/api/training-service-like.js +1 -0
  726. package/packages/agent/src/api/trajectory-routes.d.ts +3 -0
  727. package/packages/agent/src/api/trajectory-routes.d.ts.map +1 -0
  728. package/packages/agent/src/api/trajectory-routes.js +2 -0
  729. package/packages/agent/src/api/trigger-routes.d.ts +73 -0
  730. package/packages/agent/src/api/trigger-routes.d.ts.map +1 -0
  731. package/packages/agent/src/api/trigger-routes.js +308 -0
  732. package/packages/agent/src/api/tts-routes.d.ts +24 -0
  733. package/packages/agent/src/api/tts-routes.d.ts.map +1 -0
  734. package/packages/agent/src/api/tts-routes.js +200 -0
  735. package/packages/agent/src/api/twitter-verify.d.ts +25 -0
  736. package/packages/agent/src/api/twitter-verify.d.ts.map +1 -0
  737. package/packages/agent/src/api/twitter-verify.js +168 -0
  738. package/packages/agent/src/api/tx-service.d.ts +51 -0
  739. package/packages/agent/src/api/tx-service.d.ts.map +1 -0
  740. package/packages/agent/src/api/tx-service.js +160 -0
  741. package/packages/agent/src/api/update-routes.d.ts +19 -0
  742. package/packages/agent/src/api/update-routes.d.ts.map +1 -0
  743. package/packages/agent/src/api/update-routes.js +54 -0
  744. package/packages/agent/src/api/wallet-bsc-routes.d.ts +67 -0
  745. package/packages/agent/src/api/wallet-bsc-routes.d.ts.map +1 -0
  746. package/packages/agent/src/api/wallet-bsc-routes.js +322 -0
  747. package/packages/agent/src/api/wallet-capability.d.ts +33 -0
  748. package/packages/agent/src/api/wallet-capability.d.ts.map +1 -0
  749. package/packages/agent/src/api/wallet-capability.js +124 -0
  750. package/packages/agent/src/api/wallet-dex-prices.d.ts +43 -0
  751. package/packages/agent/src/api/wallet-dex-prices.d.ts.map +1 -0
  752. package/packages/agent/src/api/wallet-dex-prices.js +153 -0
  753. package/packages/agent/src/api/wallet-env-sync.d.ts +2 -0
  754. package/packages/agent/src/api/wallet-env-sync.d.ts.map +1 -0
  755. package/packages/agent/src/api/wallet-env-sync.js +104 -0
  756. package/packages/agent/src/api/wallet-evm-balance.d.ts +66 -0
  757. package/packages/agent/src/api/wallet-evm-balance.d.ts.map +1 -0
  758. package/packages/agent/src/api/wallet-evm-balance.js +667 -0
  759. package/packages/agent/src/api/wallet-routes.d.ts +55 -0
  760. package/packages/agent/src/api/wallet-routes.d.ts.map +1 -0
  761. package/packages/agent/src/api/wallet-routes.js +833 -0
  762. package/packages/agent/src/api/wallet-rpc.d.ts +78 -0
  763. package/packages/agent/src/api/wallet-rpc.d.ts.map +1 -0
  764. package/packages/agent/src/api/wallet-rpc.js +476 -0
  765. package/packages/agent/src/api/wallet-trade-routes.d.ts +110 -0
  766. package/packages/agent/src/api/wallet-trade-routes.d.ts.map +1 -0
  767. package/packages/agent/src/api/wallet-trade-routes.js +353 -0
  768. package/packages/agent/src/api/wallet-trading-profile.d.ts +56 -0
  769. package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -0
  770. package/packages/agent/src/api/wallet-trading-profile.js +565 -0
  771. package/packages/agent/src/api/wallet.d.ts +64 -0
  772. package/packages/agent/src/api/wallet.d.ts.map +1 -0
  773. package/packages/agent/src/api/wallet.js +674 -0
  774. package/packages/agent/src/api/website-blocker-routes.d.ts +2 -0
  775. package/packages/agent/src/api/website-blocker-routes.d.ts.map +1 -0
  776. package/packages/agent/src/api/website-blocker-routes.js +1 -0
  777. package/packages/agent/src/api/whatsapp-routes.d.ts +39 -0
  778. package/packages/agent/src/api/whatsapp-routes.d.ts.map +1 -0
  779. package/packages/agent/src/api/whatsapp-routes.js +226 -0
  780. package/packages/agent/src/api/workbench-helpers.d.ts +39 -0
  781. package/packages/agent/src/api/workbench-helpers.d.ts.map +1 -0
  782. package/packages/agent/src/api/workbench-helpers.js +133 -0
  783. package/packages/agent/src/api/workbench-routes.d.ts +53 -0
  784. package/packages/agent/src/api/workbench-routes.d.ts.map +1 -0
  785. package/packages/agent/src/api/workbench-routes.js +405 -0
  786. package/packages/agent/src/api/zip-utils.d.ts +8 -0
  787. package/packages/agent/src/api/zip-utils.d.ts.map +1 -0
  788. package/packages/agent/src/api/zip-utils.js +115 -0
  789. package/packages/agent/src/auth/anthropic.d.ts +29 -0
  790. package/packages/agent/src/auth/anthropic.d.ts.map +1 -0
  791. package/packages/agent/src/auth/anthropic.js +43 -0
  792. package/packages/agent/src/auth/claude-code-stealth.d.ts +2 -0
  793. package/packages/agent/src/auth/claude-code-stealth.d.ts.map +1 -0
  794. package/packages/agent/src/auth/claude-code-stealth.js +114 -0
  795. package/packages/agent/src/auth/credentials.d.ts +74 -0
  796. package/packages/agent/src/auth/credentials.d.ts.map +1 -0
  797. package/packages/agent/src/auth/credentials.js +379 -0
  798. package/packages/agent/src/auth/index.d.ts +6 -0
  799. package/packages/agent/src/auth/index.d.ts.map +1 -0
  800. package/packages/agent/src/auth/index.js +5 -0
  801. package/packages/agent/src/auth/openai-codex.d.ts +32 -0
  802. package/packages/agent/src/auth/openai-codex.d.ts.map +1 -0
  803. package/packages/agent/src/auth/openai-codex.js +81 -0
  804. package/packages/agent/src/auth/types.d.ts +18 -0
  805. package/packages/agent/src/auth/types.d.ts.map +1 -0
  806. package/packages/agent/src/auth/types.js +8 -0
  807. package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.d.ts +16 -0
  808. package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.d.ts.map +1 -0
  809. package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.js +78 -0
  810. package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.d.ts +26 -0
  811. package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.d.ts.map +1 -0
  812. package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.js +342 -0
  813. package/packages/agent/src/auth/vendor/pi-oauth/pkce.d.ts +9 -0
  814. package/packages/agent/src/auth/vendor/pi-oauth/pkce.d.ts.map +1 -0
  815. package/packages/agent/src/auth/vendor/pi-oauth/pkce.js +21 -0
  816. package/packages/agent/src/autonomy/index.d.ts +48 -0
  817. package/packages/agent/src/autonomy/index.d.ts.map +1 -0
  818. package/packages/agent/src/autonomy/index.js +330 -0
  819. package/packages/agent/src/awareness/index.d.ts +2 -0
  820. package/packages/agent/src/awareness/index.d.ts.map +1 -0
  821. package/packages/agent/src/awareness/index.js +1 -0
  822. package/packages/agent/src/awareness/registry.d.ts +27 -0
  823. package/packages/agent/src/awareness/registry.d.ts.map +1 -0
  824. package/packages/agent/src/awareness/registry.js +161 -0
  825. package/packages/agent/src/bin.d.ts +3 -0
  826. package/packages/agent/src/bin.d.ts.map +1 -0
  827. package/packages/agent/src/bin.js +6 -0
  828. package/packages/agent/src/cli/benchmark.d.ts +10 -0
  829. package/packages/agent/src/cli/benchmark.d.ts.map +1 -0
  830. package/packages/agent/src/cli/benchmark.js +293 -0
  831. package/packages/agent/src/cli/index.d.ts +2 -0
  832. package/packages/agent/src/cli/index.d.ts.map +1 -0
  833. package/packages/agent/src/cli/index.js +70 -0
  834. package/packages/agent/src/cli/parse-duration.d.ts +5 -0
  835. package/packages/agent/src/cli/parse-duration.d.ts.map +1 -0
  836. package/packages/agent/src/cli/parse-duration.js +27 -0
  837. package/packages/agent/src/cloud/auth.d.ts +19 -0
  838. package/packages/agent/src/cloud/auth.d.ts.map +1 -0
  839. package/packages/agent/src/cloud/auth.js +110 -0
  840. package/packages/agent/src/cloud/backup.d.ts +18 -0
  841. package/packages/agent/src/cloud/backup.d.ts.map +1 -0
  842. package/packages/agent/src/cloud/backup.js +42 -0
  843. package/packages/agent/src/cloud/base-url.d.ts +3 -0
  844. package/packages/agent/src/cloud/base-url.d.ts.map +1 -0
  845. package/packages/agent/src/cloud/base-url.js +52 -0
  846. package/packages/agent/src/cloud/bridge-client.d.ts +126 -0
  847. package/packages/agent/src/cloud/bridge-client.d.ts.map +1 -0
  848. package/packages/agent/src/cloud/bridge-client.js +380 -0
  849. package/packages/agent/src/cloud/cloud-manager.d.ts +32 -0
  850. package/packages/agent/src/cloud/cloud-manager.d.ts.map +1 -0
  851. package/packages/agent/src/cloud/cloud-manager.js +121 -0
  852. package/packages/agent/src/cloud/cloud-proxy.d.ts +20 -0
  853. package/packages/agent/src/cloud/cloud-proxy.d.ts.map +1 -0
  854. package/packages/agent/src/cloud/cloud-proxy.js +34 -0
  855. package/packages/agent/src/cloud/cloud-wallet.d.ts +94 -0
  856. package/packages/agent/src/cloud/cloud-wallet.d.ts.map +1 -0
  857. package/packages/agent/src/cloud/cloud-wallet.js +199 -0
  858. package/packages/agent/src/cloud/index.d.ts +7 -0
  859. package/packages/agent/src/cloud/index.d.ts.map +1 -0
  860. package/packages/agent/src/cloud/index.js +6 -0
  861. package/packages/agent/src/cloud/reconnect.d.ts +26 -0
  862. package/packages/agent/src/cloud/reconnect.d.ts.map +1 -0
  863. package/packages/agent/src/cloud/reconnect.js +89 -0
  864. package/packages/agent/src/cloud/validate-url.d.ts +2 -0
  865. package/packages/agent/src/cloud/validate-url.d.ts.map +1 -0
  866. package/packages/agent/src/cloud/validate-url.js +162 -0
  867. package/packages/agent/src/config/character-schema.d.ts +25 -0
  868. package/packages/agent/src/config/character-schema.d.ts.map +1 -0
  869. package/packages/agent/src/config/character-schema.js +39 -0
  870. package/packages/agent/src/config/config.d.ts +6 -0
  871. package/packages/agent/src/config/config.d.ts.map +1 -0
  872. package/packages/agent/src/config/config.js +277 -0
  873. package/packages/agent/src/config/env-vars.d.ts +9 -0
  874. package/packages/agent/src/config/env-vars.d.ts.map +1 -0
  875. package/packages/agent/src/config/env-vars.js +282 -0
  876. package/packages/agent/src/config/feature-flags.d.ts +17 -0
  877. package/packages/agent/src/config/feature-flags.d.ts.map +1 -0
  878. package/packages/agent/src/config/feature-flags.js +37 -0
  879. package/packages/agent/src/config/includes.d.ts +26 -0
  880. package/packages/agent/src/config/includes.d.ts.map +1 -0
  881. package/packages/agent/src/config/includes.js +148 -0
  882. package/packages/agent/src/config/index.d.ts +19 -0
  883. package/packages/agent/src/config/index.d.ts.map +1 -0
  884. package/packages/agent/src/config/index.js +18 -0
  885. package/packages/agent/src/config/object-utils.d.ts +2 -0
  886. package/packages/agent/src/config/object-utils.d.ts.map +1 -0
  887. package/packages/agent/src/config/object-utils.js +6 -0
  888. package/packages/agent/src/config/owner-contacts.d.ts +42 -0
  889. package/packages/agent/src/config/owner-contacts.d.ts.map +1 -0
  890. package/packages/agent/src/config/owner-contacts.js +223 -0
  891. package/packages/agent/src/config/paths.d.ts +13 -0
  892. package/packages/agent/src/config/paths.d.ts.map +1 -0
  893. package/packages/agent/src/config/paths.js +106 -0
  894. package/packages/agent/src/config/plugin-auto-enable.d.ts +36 -0
  895. package/packages/agent/src/config/plugin-auto-enable.d.ts.map +1 -0
  896. package/packages/agent/src/config/plugin-auto-enable.js +519 -0
  897. package/packages/agent/src/config/plugin-widgets.d.ts +29 -0
  898. package/packages/agent/src/config/plugin-widgets.d.ts.map +1 -0
  899. package/packages/agent/src/config/plugin-widgets.js +70 -0
  900. package/packages/agent/src/config/runtime-env.d.ts +2 -0
  901. package/packages/agent/src/config/runtime-env.d.ts.map +1 -0
  902. package/packages/agent/src/config/runtime-env.js +1 -0
  903. package/packages/agent/src/config/schema.d.ts +87 -0
  904. package/packages/agent/src/config/schema.d.ts.map +1 -0
  905. package/packages/agent/src/config/schema.js +922 -0
  906. package/packages/agent/src/config/telegram-custom-commands.d.ts +25 -0
  907. package/packages/agent/src/config/telegram-custom-commands.d.ts.map +1 -0
  908. package/packages/agent/src/config/telegram-custom-commands.js +71 -0
  909. package/packages/agent/src/config/types.agent-defaults.d.ts +362 -0
  910. package/packages/agent/src/config/types.agent-defaults.d.ts.map +1 -0
  911. package/packages/agent/src/config/types.agent-defaults.js +1 -0
  912. package/packages/agent/src/config/types.agents.d.ts +114 -0
  913. package/packages/agent/src/config/types.agents.d.ts.map +1 -0
  914. package/packages/agent/src/config/types.agents.js +1 -0
  915. package/packages/agent/src/config/types.d.ts +8 -0
  916. package/packages/agent/src/config/types.d.ts.map +1 -0
  917. package/packages/agent/src/config/types.eliza.d.ts +670 -0
  918. package/packages/agent/src/config/types.eliza.d.ts.map +1 -0
  919. package/packages/agent/src/config/types.eliza.js +1 -0
  920. package/packages/agent/src/config/types.gateway.d.ts +216 -0
  921. package/packages/agent/src/config/types.gateway.d.ts.map +1 -0
  922. package/packages/agent/src/config/types.gateway.js +1 -0
  923. package/packages/agent/src/config/types.hooks.d.ts +107 -0
  924. package/packages/agent/src/config/types.hooks.d.ts.map +1 -0
  925. package/packages/agent/src/config/types.hooks.js +1 -0
  926. package/packages/agent/src/config/types.js +7 -0
  927. package/packages/agent/src/config/types.messages.d.ts +176 -0
  928. package/packages/agent/src/config/types.messages.d.ts.map +1 -0
  929. package/packages/agent/src/config/types.messages.js +1 -0
  930. package/packages/agent/src/config/types.tools.d.ts +400 -0
  931. package/packages/agent/src/config/types.tools.d.ts.map +1 -0
  932. package/packages/agent/src/config/types.tools.js +1 -0
  933. package/packages/agent/src/config/zod-schema.agent-runtime.d.ts +1137 -0
  934. package/packages/agent/src/config/zod-schema.agent-runtime.d.ts.map +1 -0
  935. package/packages/agent/src/config/zod-schema.agent-runtime.js +782 -0
  936. package/packages/agent/src/config/zod-schema.core.d.ts +1021 -0
  937. package/packages/agent/src/config/zod-schema.core.d.ts.map +1 -0
  938. package/packages/agent/src/config/zod-schema.core.js +694 -0
  939. package/packages/agent/src/config/zod-schema.d.ts +3185 -0
  940. package/packages/agent/src/config/zod-schema.d.ts.map +1 -0
  941. package/packages/agent/src/config/zod-schema.hooks.d.ts +88 -0
  942. package/packages/agent/src/config/zod-schema.hooks.d.ts.map +1 -0
  943. package/packages/agent/src/config/zod-schema.hooks.js +133 -0
  944. package/packages/agent/src/config/zod-schema.js +850 -0
  945. package/packages/agent/src/config/zod-schema.providers-core.d.ts +2746 -0
  946. package/packages/agent/src/config/zod-schema.providers-core.d.ts.map +1 -0
  947. package/packages/agent/src/config/zod-schema.providers-core.js +961 -0
  948. package/packages/agent/src/config/zod-schema.session.d.ts +183 -0
  949. package/packages/agent/src/config/zod-schema.session.d.ts.map +1 -0
  950. package/packages/agent/src/config/zod-schema.session.js +86 -0
  951. package/packages/agent/src/contracts/apps.d.ts +2 -0
  952. package/packages/agent/src/contracts/apps.d.ts.map +1 -0
  953. package/packages/agent/src/contracts/apps.js +1 -0
  954. package/packages/agent/src/contracts/awareness.d.ts +38 -0
  955. package/packages/agent/src/contracts/awareness.d.ts.map +1 -0
  956. package/packages/agent/src/contracts/awareness.js +7 -0
  957. package/packages/agent/src/contracts/config.d.ts +148 -0
  958. package/packages/agent/src/contracts/config.d.ts.map +1 -0
  959. package/packages/agent/src/contracts/config.js +4 -0
  960. package/packages/agent/src/contracts/drop.d.ts +2 -0
  961. package/packages/agent/src/contracts/drop.d.ts.map +1 -0
  962. package/packages/agent/src/contracts/drop.js +1 -0
  963. package/packages/agent/src/contracts/index.d.ts +11 -0
  964. package/packages/agent/src/contracts/index.d.ts.map +1 -0
  965. package/packages/agent/src/contracts/index.js +10 -0
  966. package/packages/agent/src/contracts/lifeops.d.ts +2 -0
  967. package/packages/agent/src/contracts/lifeops.d.ts.map +1 -0
  968. package/packages/agent/src/contracts/lifeops.js +1 -0
  969. package/packages/agent/src/contracts/onboarding.d.ts +2 -0
  970. package/packages/agent/src/contracts/onboarding.d.ts.map +1 -0
  971. package/packages/agent/src/contracts/onboarding.js +1 -0
  972. package/packages/agent/src/contracts/permissions.d.ts +2 -0
  973. package/packages/agent/src/contracts/permissions.d.ts.map +1 -0
  974. package/packages/agent/src/contracts/permissions.js +1 -0
  975. package/packages/agent/src/contracts/service-routing.d.ts +2 -0
  976. package/packages/agent/src/contracts/service-routing.d.ts.map +1 -0
  977. package/packages/agent/src/contracts/service-routing.js +1 -0
  978. package/packages/agent/src/contracts/verification.d.ts +2 -0
  979. package/packages/agent/src/contracts/verification.d.ts.map +1 -0
  980. package/packages/agent/src/contracts/verification.js +1 -0
  981. package/packages/agent/src/contracts/wallet.d.ts +2 -0
  982. package/packages/agent/src/contracts/wallet.d.ts.map +1 -0
  983. package/packages/agent/src/contracts/wallet.js +1 -0
  984. package/packages/agent/src/diagnostics/index.d.ts +2 -0
  985. package/packages/agent/src/diagnostics/index.d.ts.map +1 -0
  986. package/packages/agent/src/diagnostics/index.js +1 -0
  987. package/packages/agent/src/diagnostics/integration-observability.d.ts +40 -0
  988. package/packages/agent/src/diagnostics/integration-observability.d.ts.map +1 -0
  989. package/packages/agent/src/diagnostics/integration-observability.js +75 -0
  990. package/packages/agent/src/evals/coordinator-eval-client.d.ts +2 -0
  991. package/packages/agent/src/evals/coordinator-eval-client.d.ts.map +1 -0
  992. package/packages/agent/src/evals/coordinator-eval-client.js +1 -0
  993. package/packages/agent/src/evals/coordinator-live-runner.d.ts +2 -0
  994. package/packages/agent/src/evals/coordinator-live-runner.d.ts.map +1 -0
  995. package/packages/agent/src/evals/coordinator-live-runner.js +1 -0
  996. package/packages/agent/src/evals/coordinator-preflight.d.ts +2 -0
  997. package/packages/agent/src/evals/coordinator-preflight.d.ts.map +1 -0
  998. package/packages/agent/src/evals/coordinator-preflight.js +1 -0
  999. package/packages/agent/src/evals/coordinator-scenarios.d.ts +2 -0
  1000. package/packages/agent/src/evals/coordinator-scenarios.d.ts.map +1 -0
  1001. package/packages/agent/src/evals/coordinator-scenarios.js +1 -0
  1002. package/packages/agent/src/evaluators/late-join-whitelist.d.ts +16 -0
  1003. package/packages/agent/src/evaluators/late-join-whitelist.d.ts.map +1 -0
  1004. package/packages/agent/src/evaluators/late-join-whitelist.js +67 -0
  1005. package/packages/agent/src/hooks/discovery.d.ts +13 -0
  1006. package/packages/agent/src/hooks/discovery.d.ts.map +1 -0
  1007. package/packages/agent/src/hooks/discovery.js +191 -0
  1008. package/packages/agent/src/hooks/eligibility.d.ts +12 -0
  1009. package/packages/agent/src/hooks/eligibility.d.ts.map +1 -0
  1010. package/packages/agent/src/hooks/eligibility.js +105 -0
  1011. package/packages/agent/src/hooks/index.d.ts +3 -0
  1012. package/packages/agent/src/hooks/index.d.ts.map +1 -0
  1013. package/packages/agent/src/hooks/index.js +2 -0
  1014. package/packages/agent/src/hooks/loader.d.ts +34 -0
  1015. package/packages/agent/src/hooks/loader.d.ts.map +1 -0
  1016. package/packages/agent/src/hooks/loader.js +214 -0
  1017. package/packages/agent/src/hooks/registry.d.ts +11 -0
  1018. package/packages/agent/src/hooks/registry.d.ts.map +1 -0
  1019. package/packages/agent/src/hooks/registry.js +58 -0
  1020. package/packages/agent/src/hooks/types.d.ts +104 -0
  1021. package/packages/agent/src/hooks/types.d.ts.map +1 -0
  1022. package/packages/agent/src/hooks/types.js +8 -0
  1023. package/packages/agent/src/index.d.ts +22 -0
  1024. package/packages/agent/src/index.d.ts.map +1 -0
  1025. package/packages/agent/src/index.js +20 -0
  1026. package/packages/agent/src/lifeops/app-state.d.ts +2 -0
  1027. package/packages/agent/src/lifeops/app-state.d.ts.map +1 -0
  1028. package/packages/agent/src/lifeops/app-state.js +1 -0
  1029. package/packages/agent/src/lifeops/apple-reminders.d.ts +2 -0
  1030. package/packages/agent/src/lifeops/apple-reminders.d.ts.map +1 -0
  1031. package/packages/agent/src/lifeops/apple-reminders.js +1 -0
  1032. package/packages/agent/src/lifeops/defaults.d.ts +2 -0
  1033. package/packages/agent/src/lifeops/defaults.d.ts.map +1 -0
  1034. package/packages/agent/src/lifeops/defaults.js +1 -0
  1035. package/packages/agent/src/lifeops/engine.d.ts +2 -0
  1036. package/packages/agent/src/lifeops/engine.d.ts.map +1 -0
  1037. package/packages/agent/src/lifeops/engine.js +1 -0
  1038. package/packages/agent/src/lifeops/goal-grounding.d.ts +2 -0
  1039. package/packages/agent/src/lifeops/goal-grounding.d.ts.map +1 -0
  1040. package/packages/agent/src/lifeops/goal-grounding.js +1 -0
  1041. package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts +2 -0
  1042. package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts.map +1 -0
  1043. package/packages/agent/src/lifeops/goal-semantic-evaluator.js +1 -0
  1044. package/packages/agent/src/lifeops/google-api-error.d.ts +2 -0
  1045. package/packages/agent/src/lifeops/google-api-error.d.ts.map +1 -0
  1046. package/packages/agent/src/lifeops/google-api-error.js +1 -0
  1047. package/packages/agent/src/lifeops/google-calendar.d.ts +2 -0
  1048. package/packages/agent/src/lifeops/google-calendar.d.ts.map +1 -0
  1049. package/packages/agent/src/lifeops/google-calendar.js +1 -0
  1050. package/packages/agent/src/lifeops/google-connector-gateway.d.ts +2 -0
  1051. package/packages/agent/src/lifeops/google-connector-gateway.d.ts.map +1 -0
  1052. package/packages/agent/src/lifeops/google-connector-gateway.js +1 -0
  1053. package/packages/agent/src/lifeops/google-fetch.d.ts +2 -0
  1054. package/packages/agent/src/lifeops/google-fetch.d.ts.map +1 -0
  1055. package/packages/agent/src/lifeops/google-fetch.js +1 -0
  1056. package/packages/agent/src/lifeops/google-gmail.d.ts +2 -0
  1057. package/packages/agent/src/lifeops/google-gmail.d.ts.map +1 -0
  1058. package/packages/agent/src/lifeops/google-gmail.js +1 -0
  1059. package/packages/agent/src/lifeops/google-managed-client.d.ts +2 -0
  1060. package/packages/agent/src/lifeops/google-managed-client.d.ts.map +1 -0
  1061. package/packages/agent/src/lifeops/google-managed-client.js +1 -0
  1062. package/packages/agent/src/lifeops/google-oauth.d.ts +2 -0
  1063. package/packages/agent/src/lifeops/google-oauth.d.ts.map +1 -0
  1064. package/packages/agent/src/lifeops/google-oauth.js +1 -0
  1065. package/packages/agent/src/lifeops/google-scopes.d.ts +2 -0
  1066. package/packages/agent/src/lifeops/google-scopes.d.ts.map +1 -0
  1067. package/packages/agent/src/lifeops/google-scopes.js +1 -0
  1068. package/packages/agent/src/lifeops/index.d.ts +2 -0
  1069. package/packages/agent/src/lifeops/index.d.ts.map +1 -0
  1070. package/packages/agent/src/lifeops/index.js +1 -0
  1071. package/packages/agent/src/lifeops/owner-profile.d.ts +2 -0
  1072. package/packages/agent/src/lifeops/owner-profile.d.ts.map +1 -0
  1073. package/packages/agent/src/lifeops/owner-profile.js +1 -0
  1074. package/packages/agent/src/lifeops/repository.d.ts +2 -0
  1075. package/packages/agent/src/lifeops/repository.d.ts.map +1 -0
  1076. package/packages/agent/src/lifeops/repository.js +1 -0
  1077. package/packages/agent/src/lifeops/runtime.d.ts +2 -0
  1078. package/packages/agent/src/lifeops/runtime.d.ts.map +1 -0
  1079. package/packages/agent/src/lifeops/runtime.js +1 -0
  1080. package/packages/agent/src/lifeops/screen-context.d.ts +2 -0
  1081. package/packages/agent/src/lifeops/screen-context.d.ts.map +1 -0
  1082. package/packages/agent/src/lifeops/screen-context.js +1 -0
  1083. package/packages/agent/src/lifeops/seed-routines.d.ts +2 -0
  1084. package/packages/agent/src/lifeops/seed-routines.d.ts.map +1 -0
  1085. package/packages/agent/src/lifeops/seed-routines.js +1 -0
  1086. package/packages/agent/src/lifeops/service.d.ts +2 -0
  1087. package/packages/agent/src/lifeops/service.d.ts.map +1 -0
  1088. package/packages/agent/src/lifeops/service.js +1 -0
  1089. package/packages/agent/src/lifeops/sql.d.ts +2 -0
  1090. package/packages/agent/src/lifeops/sql.d.ts.map +1 -0
  1091. package/packages/agent/src/lifeops/sql.js +1 -0
  1092. package/packages/agent/src/lifeops/time.d.ts +2 -0
  1093. package/packages/agent/src/lifeops/time.d.ts.map +1 -0
  1094. package/packages/agent/src/lifeops/time.js +1 -0
  1095. package/packages/agent/src/lifeops/twilio.d.ts +2 -0
  1096. package/packages/agent/src/lifeops/twilio.d.ts.map +1 -0
  1097. package/packages/agent/src/lifeops/twilio.js +1 -0
  1098. package/packages/agent/src/lifeops/x-poster.d.ts +2 -0
  1099. package/packages/agent/src/lifeops/x-poster.d.ts.map +1 -0
  1100. package/packages/agent/src/lifeops/x-poster.js +1 -0
  1101. package/packages/agent/src/onboarding-presets.d.ts +2 -0
  1102. package/packages/agent/src/onboarding-presets.d.ts.map +1 -0
  1103. package/packages/agent/src/onboarding-presets.js +1 -0
  1104. package/packages/agent/src/plugins/custom-rtmp/index.d.ts +12 -0
  1105. package/packages/agent/src/plugins/custom-rtmp/index.d.ts.map +1 -0
  1106. package/packages/agent/src/plugins/custom-rtmp/index.js +26 -0
  1107. package/packages/agent/src/plugins/discord-voice-capability.d.ts +35 -0
  1108. package/packages/agent/src/plugins/discord-voice-capability.d.ts.map +1 -0
  1109. package/packages/agent/src/plugins/discord-voice-capability.js +97 -0
  1110. package/packages/agent/src/providers/activity-profile.d.ts +3 -0
  1111. package/packages/agent/src/providers/activity-profile.d.ts.map +1 -0
  1112. package/packages/agent/src/providers/activity-profile.js +140 -0
  1113. package/packages/agent/src/providers/admin-panel.d.ts +4 -0
  1114. package/packages/agent/src/providers/admin-panel.d.ts.map +1 -0
  1115. package/packages/agent/src/providers/admin-panel.js +83 -0
  1116. package/packages/agent/src/providers/admin-trust.d.ts +4 -0
  1117. package/packages/agent/src/providers/admin-trust.d.ts.map +1 -0
  1118. package/packages/agent/src/providers/admin-trust.js +34 -0
  1119. package/packages/agent/src/providers/conversation-utils.d.ts +11 -0
  1120. package/packages/agent/src/providers/conversation-utils.d.ts.map +1 -0
  1121. package/packages/agent/src/providers/conversation-utils.js +79 -0
  1122. package/packages/agent/src/providers/escalation-trigger.d.ts +15 -0
  1123. package/packages/agent/src/providers/escalation-trigger.d.ts.map +1 -0
  1124. package/packages/agent/src/providers/escalation-trigger.js +165 -0
  1125. package/packages/agent/src/providers/inbox-triage.d.ts +2 -0
  1126. package/packages/agent/src/providers/inbox-triage.d.ts.map +1 -0
  1127. package/packages/agent/src/providers/inbox-triage.js +1 -0
  1128. package/packages/agent/src/providers/index.d.ts +18 -0
  1129. package/packages/agent/src/providers/index.d.ts.map +1 -0
  1130. package/packages/agent/src/providers/index.js +17 -0
  1131. package/packages/agent/src/providers/lifeops.d.ts +2 -0
  1132. package/packages/agent/src/providers/lifeops.d.ts.map +1 -0
  1133. package/packages/agent/src/providers/lifeops.js +1 -0
  1134. package/packages/agent/src/providers/local-models.d.ts +118 -0
  1135. package/packages/agent/src/providers/local-models.d.ts.map +1 -0
  1136. package/packages/agent/src/providers/local-models.js +427 -0
  1137. package/packages/agent/src/providers/media-provider.d.ts +192 -0
  1138. package/packages/agent/src/providers/media-provider.d.ts.map +1 -0
  1139. package/packages/agent/src/providers/media-provider.js +1088 -0
  1140. package/packages/agent/src/providers/recent-conversations.d.ts +3 -0
  1141. package/packages/agent/src/providers/recent-conversations.d.ts.map +1 -0
  1142. package/packages/agent/src/providers/recent-conversations.js +87 -0
  1143. package/packages/agent/src/providers/relevant-conversations.d.ts +3 -0
  1144. package/packages/agent/src/providers/relevant-conversations.d.ts.map +1 -0
  1145. package/packages/agent/src/providers/relevant-conversations.js +88 -0
  1146. package/packages/agent/src/providers/role-backfill.d.ts +18 -0
  1147. package/packages/agent/src/providers/role-backfill.d.ts.map +1 -0
  1148. package/packages/agent/src/providers/role-backfill.js +84 -0
  1149. package/packages/agent/src/providers/rolodex.d.ts +3 -0
  1150. package/packages/agent/src/providers/rolodex.d.ts.map +1 -0
  1151. package/packages/agent/src/providers/rolodex.js +77 -0
  1152. package/packages/agent/src/providers/self-status.d.ts +4 -0
  1153. package/packages/agent/src/providers/self-status.d.ts.map +1 -0
  1154. package/packages/agent/src/providers/self-status.js +12 -0
  1155. package/packages/agent/src/providers/session-bridge.d.ts +24 -0
  1156. package/packages/agent/src/providers/session-bridge.d.ts.map +1 -0
  1157. package/packages/agent/src/providers/session-bridge.js +85 -0
  1158. package/packages/agent/src/providers/session-utils.d.ts +20 -0
  1159. package/packages/agent/src/providers/session-utils.d.ts.map +1 -0
  1160. package/packages/agent/src/providers/session-utils.js +33 -0
  1161. package/packages/agent/src/providers/simple-mode.d.ts +4 -0
  1162. package/packages/agent/src/providers/simple-mode.d.ts.map +1 -0
  1163. package/packages/agent/src/providers/simple-mode.js +85 -0
  1164. package/packages/agent/src/providers/skill-provider.d.ts +16 -0
  1165. package/packages/agent/src/providers/skill-provider.d.ts.map +1 -0
  1166. package/packages/agent/src/providers/skill-provider.js +336 -0
  1167. package/packages/agent/src/providers/tasks.d.ts +9 -0
  1168. package/packages/agent/src/providers/tasks.d.ts.map +1 -0
  1169. package/packages/agent/src/providers/tasks.js +113 -0
  1170. package/packages/agent/src/providers/ui-catalog.d.ts +3 -0
  1171. package/packages/agent/src/providers/ui-catalog.d.ts.map +1 -0
  1172. package/packages/agent/src/providers/ui-catalog.js +95 -0
  1173. package/packages/agent/src/providers/user-name.d.ts +11 -0
  1174. package/packages/agent/src/providers/user-name.d.ts.map +1 -0
  1175. package/packages/agent/src/providers/user-name.js +40 -0
  1176. package/packages/agent/src/providers/workspace-provider.d.ts +22 -0
  1177. package/packages/agent/src/providers/workspace-provider.d.ts.map +1 -0
  1178. package/packages/agent/src/providers/workspace-provider.js +177 -0
  1179. package/packages/agent/src/providers/workspace.d.ts +54 -0
  1180. package/packages/agent/src/providers/workspace.d.ts.map +1 -0
  1181. package/packages/agent/src/providers/workspace.js +481 -0
  1182. package/packages/agent/src/runtime/agent-event-service.d.ts +35 -0
  1183. package/packages/agent/src/runtime/agent-event-service.d.ts.map +1 -0
  1184. package/packages/agent/src/runtime/agent-event-service.js +16 -0
  1185. package/packages/agent/src/runtime/cloud-onboarding.d.ts +35 -0
  1186. package/packages/agent/src/runtime/cloud-onboarding.d.ts.map +1 -0
  1187. package/packages/agent/src/runtime/cloud-onboarding.js +279 -0
  1188. package/packages/agent/src/runtime/core-plugins.d.ts +19 -0
  1189. package/packages/agent/src/runtime/core-plugins.d.ts.map +1 -0
  1190. package/packages/agent/src/runtime/core-plugins.js +62 -0
  1191. package/packages/agent/src/runtime/custom-actions.d.ts +43 -0
  1192. package/packages/agent/src/runtime/custom-actions.d.ts.map +1 -0
  1193. package/packages/agent/src/runtime/custom-actions.js +507 -0
  1194. package/packages/agent/src/runtime/default-knowledge.d.ts +20 -0
  1195. package/packages/agent/src/runtime/default-knowledge.d.ts.map +1 -0
  1196. package/packages/agent/src/runtime/default-knowledge.js +256 -0
  1197. package/packages/agent/src/runtime/discord-local-plugin.d.ts +86 -0
  1198. package/packages/agent/src/runtime/discord-local-plugin.d.ts.map +1 -0
  1199. package/packages/agent/src/runtime/discord-local-plugin.js +884 -0
  1200. package/packages/agent/src/runtime/eliza-plugin.d.ts +16 -0
  1201. package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -0
  1202. package/packages/agent/src/runtime/eliza-plugin.js +212 -0
  1203. package/packages/agent/src/runtime/eliza.d.ts +181 -0
  1204. package/packages/agent/src/runtime/eliza.d.ts.map +1 -0
  1205. package/packages/agent/src/runtime/eliza.js +3286 -0
  1206. package/packages/agent/src/runtime/embedding-presets.d.ts +19 -0
  1207. package/packages/agent/src/runtime/embedding-presets.d.ts.map +1 -0
  1208. package/packages/agent/src/runtime/embedding-presets.js +60 -0
  1209. package/packages/agent/src/runtime/first-time-setup.d.ts +25 -0
  1210. package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -0
  1211. package/packages/agent/src/runtime/first-time-setup.js +697 -0
  1212. package/packages/agent/src/runtime/index.d.ts +13 -0
  1213. package/packages/agent/src/runtime/index.d.ts.map +1 -0
  1214. package/packages/agent/src/runtime/index.js +12 -0
  1215. package/packages/agent/src/runtime/native-runtime-features.d.ts +4 -0
  1216. package/packages/agent/src/runtime/native-runtime-features.d.ts.map +1 -0
  1217. package/packages/agent/src/runtime/native-runtime-features.js +10 -0
  1218. package/packages/agent/src/runtime/onboarding-names.d.ts +11 -0
  1219. package/packages/agent/src/runtime/onboarding-names.d.ts.map +1 -0
  1220. package/packages/agent/src/runtime/onboarding-names.js +74 -0
  1221. package/packages/agent/src/runtime/owner-entity.d.ts +4 -0
  1222. package/packages/agent/src/runtime/owner-entity.d.ts.map +1 -0
  1223. package/packages/agent/src/runtime/owner-entity.js +30 -0
  1224. package/packages/agent/src/runtime/pglite-error-compat.d.ts +28 -0
  1225. package/packages/agent/src/runtime/pglite-error-compat.d.ts.map +1 -0
  1226. package/packages/agent/src/runtime/pglite-error-compat.js +54 -0
  1227. package/packages/agent/src/runtime/plugin-collector.d.ts +38 -0
  1228. package/packages/agent/src/runtime/plugin-collector.d.ts.map +1 -0
  1229. package/packages/agent/src/runtime/plugin-collector.js +397 -0
  1230. package/packages/agent/src/runtime/plugin-lifecycle.d.ts +44 -0
  1231. package/packages/agent/src/runtime/plugin-lifecycle.d.ts.map +1 -0
  1232. package/packages/agent/src/runtime/plugin-lifecycle.js +574 -0
  1233. package/packages/agent/src/runtime/plugin-resolver.d.ts +31 -0
  1234. package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -0
  1235. package/packages/agent/src/runtime/plugin-resolver.js +828 -0
  1236. package/packages/agent/src/runtime/plugin-role-gating.d.ts +34 -0
  1237. package/packages/agent/src/runtime/plugin-role-gating.d.ts.map +1 -0
  1238. package/packages/agent/src/runtime/plugin-role-gating.js +232 -0
  1239. package/packages/agent/src/runtime/plugin-types.d.ts +71 -0
  1240. package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -0
  1241. package/packages/agent/src/runtime/plugin-types.js +318 -0
  1242. package/packages/agent/src/runtime/prompt-compaction.d.ts +80 -0
  1243. package/packages/agent/src/runtime/prompt-compaction.d.ts.map +1 -0
  1244. package/packages/agent/src/runtime/prompt-compaction.js +307 -0
  1245. package/packages/agent/src/runtime/prompt-optimization.d.ts +11 -0
  1246. package/packages/agent/src/runtime/prompt-optimization.d.ts.map +1 -0
  1247. package/packages/agent/src/runtime/prompt-optimization.js +421 -0
  1248. package/packages/agent/src/runtime/release-plugin-policy.d.ts +20 -0
  1249. package/packages/agent/src/runtime/release-plugin-policy.d.ts.map +1 -0
  1250. package/packages/agent/src/runtime/release-plugin-policy.js +85 -0
  1251. package/packages/agent/src/runtime/restart.d.ts +45 -0
  1252. package/packages/agent/src/runtime/restart.d.ts.map +1 -0
  1253. package/packages/agent/src/runtime/restart.js +45 -0
  1254. package/packages/agent/src/runtime/roles/src/action.d.ts +11 -0
  1255. package/packages/agent/src/runtime/roles/src/action.d.ts.map +1 -0
  1256. package/packages/agent/src/runtime/roles/src/action.js +676 -0
  1257. package/packages/agent/src/runtime/roles/src/index.d.ts +24 -0
  1258. package/packages/agent/src/runtime/roles/src/index.d.ts.map +1 -0
  1259. package/packages/agent/src/runtime/roles/src/index.js +243 -0
  1260. package/packages/agent/src/runtime/roles/src/intent.d.ts +18 -0
  1261. package/packages/agent/src/runtime/roles/src/intent.d.ts.map +1 -0
  1262. package/packages/agent/src/runtime/roles/src/intent.js +299 -0
  1263. package/packages/agent/src/runtime/roles/src/provider.d.ts +7 -0
  1264. package/packages/agent/src/runtime/roles/src/provider.d.ts.map +1 -0
  1265. package/packages/agent/src/runtime/roles/src/provider.js +133 -0
  1266. package/packages/agent/src/runtime/roles/src/types.d.ts +3 -0
  1267. package/packages/agent/src/runtime/roles/src/types.d.ts.map +1 -0
  1268. package/packages/agent/src/runtime/roles/src/types.js +1 -0
  1269. package/packages/agent/src/runtime/roles/src/utils.d.ts +2 -0
  1270. package/packages/agent/src/runtime/roles/src/utils.d.ts.map +1 -0
  1271. package/packages/agent/src/runtime/roles/src/utils.js +1 -0
  1272. package/packages/agent/src/runtime/roles.d.ts +3 -0
  1273. package/packages/agent/src/runtime/roles.d.ts.map +1 -0
  1274. package/packages/agent/src/runtime/roles.js +5 -0
  1275. package/packages/agent/src/runtime/trajectory-export.d.ts +8 -0
  1276. package/packages/agent/src/runtime/trajectory-export.d.ts.map +1 -0
  1277. package/packages/agent/src/runtime/trajectory-export.js +7 -0
  1278. package/packages/agent/src/runtime/trajectory-internals.d.ts +217 -0
  1279. package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -0
  1280. package/packages/agent/src/runtime/trajectory-internals.js +1296 -0
  1281. package/packages/agent/src/runtime/trajectory-persistence.d.ts +15 -0
  1282. package/packages/agent/src/runtime/trajectory-persistence.d.ts.map +1 -0
  1283. package/packages/agent/src/runtime/trajectory-persistence.js +29 -0
  1284. package/packages/agent/src/runtime/trajectory-query.d.ts +8 -0
  1285. package/packages/agent/src/runtime/trajectory-query.d.ts.map +1 -0
  1286. package/packages/agent/src/runtime/trajectory-query.js +27 -0
  1287. package/packages/agent/src/runtime/trajectory-storage.d.ts +65 -0
  1288. package/packages/agent/src/runtime/trajectory-storage.d.ts.map +1 -0
  1289. package/packages/agent/src/runtime/trajectory-storage.js +1026 -0
  1290. package/packages/agent/src/runtime/version.d.ts +2 -0
  1291. package/packages/agent/src/runtime/version.d.ts.map +1 -0
  1292. package/packages/agent/src/runtime/version.js +5 -0
  1293. package/packages/agent/src/runtime/web-search-tools.d.ts +22 -0
  1294. package/packages/agent/src/runtime/web-search-tools.d.ts.map +1 -0
  1295. package/packages/agent/src/runtime/web-search-tools.js +149 -0
  1296. package/packages/agent/src/security/access.d.ts +17 -0
  1297. package/packages/agent/src/security/access.d.ts.map +1 -0
  1298. package/packages/agent/src/security/access.js +149 -0
  1299. package/packages/agent/src/security/audit-log.d.ts +49 -0
  1300. package/packages/agent/src/security/audit-log.d.ts.map +1 -0
  1301. package/packages/agent/src/security/audit-log.js +161 -0
  1302. package/packages/agent/src/security/index.d.ts +3 -0
  1303. package/packages/agent/src/security/index.d.ts.map +1 -0
  1304. package/packages/agent/src/security/index.js +2 -0
  1305. package/packages/agent/src/security/network-policy.d.ts +6 -0
  1306. package/packages/agent/src/security/network-policy.d.ts.map +1 -0
  1307. package/packages/agent/src/security/network-policy.js +85 -0
  1308. package/packages/agent/src/server/index.d.ts +3 -0
  1309. package/packages/agent/src/server/index.d.ts.map +1 -0
  1310. package/packages/agent/src/server/index.js +1 -0
  1311. package/packages/agent/src/services/agent-export.d.ts +100 -0
  1312. package/packages/agent/src/services/agent-export.d.ts.map +1 -0
  1313. package/packages/agent/src/services/agent-export.js +729 -0
  1314. package/packages/agent/src/services/app-manager.d.ts +56 -0
  1315. package/packages/agent/src/services/app-manager.d.ts.map +1 -0
  1316. package/packages/agent/src/services/app-manager.js +2019 -0
  1317. package/packages/agent/src/services/app-package-modules.d.ts +30 -0
  1318. package/packages/agent/src/services/app-package-modules.d.ts.map +1 -0
  1319. package/packages/agent/src/services/app-package-modules.js +348 -0
  1320. package/packages/agent/src/services/app-run-store.d.ts +6 -0
  1321. package/packages/agent/src/services/app-run-store.d.ts.map +1 -0
  1322. package/packages/agent/src/services/app-run-store.js +490 -0
  1323. package/packages/agent/src/services/app-session-gate.d.ts +15 -0
  1324. package/packages/agent/src/services/app-session-gate.d.ts.map +1 -0
  1325. package/packages/agent/src/services/app-session-gate.js +71 -0
  1326. package/packages/agent/src/services/browser-capture.d.ts +41 -0
  1327. package/packages/agent/src/services/browser-capture.d.ts.map +1 -0
  1328. package/packages/agent/src/services/browser-capture.js +173 -0
  1329. package/packages/agent/src/services/browser-workspace.d.ts +179 -0
  1330. package/packages/agent/src/services/browser-workspace.d.ts.map +1 -0
  1331. package/packages/agent/src/services/browser-workspace.js +4589 -0
  1332. package/packages/agent/src/services/built-in-app-routes/2004scape.d.ts +28 -0
  1333. package/packages/agent/src/services/built-in-app-routes/2004scape.d.ts.map +1 -0
  1334. package/packages/agent/src/services/built-in-app-routes/2004scape.js +1343 -0
  1335. package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts +5 -0
  1336. package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts.map +1 -0
  1337. package/packages/agent/src/services/built-in-app-routes/hyperscape.js +189 -0
  1338. package/packages/agent/src/services/character-persistence.d.ts +39 -0
  1339. package/packages/agent/src/services/character-persistence.d.ts.map +1 -0
  1340. package/packages/agent/src/services/character-persistence.js +159 -0
  1341. package/packages/agent/src/services/client-chat-sender.d.ts +19 -0
  1342. package/packages/agent/src/services/client-chat-sender.d.ts.map +1 -0
  1343. package/packages/agent/src/services/client-chat-sender.js +88 -0
  1344. package/packages/agent/src/services/coding-agent-context.d.ts +310 -0
  1345. package/packages/agent/src/services/coding-agent-context.d.ts.map +1 -0
  1346. package/packages/agent/src/services/coding-agent-context.js +281 -0
  1347. package/packages/agent/src/services/coding-task-executor.d.ts +20 -0
  1348. package/packages/agent/src/services/coding-task-executor.d.ts.map +1 -0
  1349. package/packages/agent/src/services/coding-task-executor.js +141 -0
  1350. package/packages/agent/src/services/config-plugin-manager.d.ts +6 -0
  1351. package/packages/agent/src/services/config-plugin-manager.d.ts.map +1 -0
  1352. package/packages/agent/src/services/config-plugin-manager.js +53 -0
  1353. package/packages/agent/src/services/connector-setup-service.d.ts +48 -0
  1354. package/packages/agent/src/services/connector-setup-service.d.ts.map +1 -0
  1355. package/packages/agent/src/services/connector-setup-service.js +60 -0
  1356. package/packages/agent/src/services/conversation-proximity.d.ts +27 -0
  1357. package/packages/agent/src/services/conversation-proximity.d.ts.map +1 -0
  1358. package/packages/agent/src/services/conversation-proximity.js +124 -0
  1359. package/packages/agent/src/services/credential-words.d.ts +26 -0
  1360. package/packages/agent/src/services/credential-words.d.ts.map +1 -0
  1361. package/packages/agent/src/services/credential-words.js +116 -0
  1362. package/packages/agent/src/services/escalation.d.ts +46 -0
  1363. package/packages/agent/src/services/escalation.d.ts.map +1 -0
  1364. package/packages/agent/src/services/escalation.js +415 -0
  1365. package/packages/agent/src/services/executor-registry.d.ts +4 -0
  1366. package/packages/agent/src/services/executor-registry.d.ts.map +1 -0
  1367. package/packages/agent/src/services/executor-registry.js +10 -0
  1368. package/packages/agent/src/services/index.d.ts +25 -0
  1369. package/packages/agent/src/services/index.d.ts.map +1 -0
  1370. package/packages/agent/src/services/index.js +24 -0
  1371. package/packages/agent/src/services/mcp-marketplace.d.ts +89 -0
  1372. package/packages/agent/src/services/mcp-marketplace.d.ts.map +1 -0
  1373. package/packages/agent/src/services/mcp-marketplace.js +200 -0
  1374. package/packages/agent/src/services/overlay-app-presence.d.ts +9 -0
  1375. package/packages/agent/src/services/overlay-app-presence.d.ts.map +1 -0
  1376. package/packages/agent/src/services/overlay-app-presence.js +18 -0
  1377. package/packages/agent/src/services/plugin-manager-types.d.ts +113 -0
  1378. package/packages/agent/src/services/plugin-manager-types.d.ts.map +1 -0
  1379. package/packages/agent/src/services/plugin-manager-types.js +18 -0
  1380. package/packages/agent/src/services/privy-wallets.d.ts +23 -0
  1381. package/packages/agent/src/services/privy-wallets.d.ts.map +1 -0
  1382. package/packages/agent/src/services/privy-wallets.js +230 -0
  1383. package/packages/agent/src/services/registry-client-app-meta.d.ts +6 -0
  1384. package/packages/agent/src/services/registry-client-app-meta.d.ts.map +1 -0
  1385. package/packages/agent/src/services/registry-client-app-meta.js +225 -0
  1386. package/packages/agent/src/services/registry-client-endpoints.d.ts +7 -0
  1387. package/packages/agent/src/services/registry-client-endpoints.d.ts.map +1 -0
  1388. package/packages/agent/src/services/registry-client-endpoints.js +190 -0
  1389. package/packages/agent/src/services/registry-client-local.d.ts +4 -0
  1390. package/packages/agent/src/services/registry-client-local.d.ts.map +1 -0
  1391. package/packages/agent/src/services/registry-client-local.js +545 -0
  1392. package/packages/agent/src/services/registry-client-network.d.ts +9 -0
  1393. package/packages/agent/src/services/registry-client-network.d.ts.map +1 -0
  1394. package/packages/agent/src/services/registry-client-network.js +119 -0
  1395. package/packages/agent/src/services/registry-client-queries.d.ts +15 -0
  1396. package/packages/agent/src/services/registry-client-queries.d.ts.map +1 -0
  1397. package/packages/agent/src/services/registry-client-queries.js +172 -0
  1398. package/packages/agent/src/services/registry-client-types.d.ts +125 -0
  1399. package/packages/agent/src/services/registry-client-types.d.ts.map +1 -0
  1400. package/packages/agent/src/services/registry-client-types.js +1 -0
  1401. package/packages/agent/src/services/registry-client.d.ts +39 -0
  1402. package/packages/agent/src/services/registry-client.d.ts.map +1 -0
  1403. package/packages/agent/src/services/registry-client.js +332 -0
  1404. package/packages/agent/src/services/relationships-graph.d.ts +134 -0
  1405. package/packages/agent/src/services/relationships-graph.d.ts.map +1 -0
  1406. package/packages/agent/src/services/relationships-graph.js +1332 -0
  1407. package/packages/agent/src/services/remote-signing-service.d.ts +58 -0
  1408. package/packages/agent/src/services/remote-signing-service.d.ts.map +1 -0
  1409. package/packages/agent/src/services/remote-signing-service.js +185 -0
  1410. package/packages/agent/src/services/research-task-executor.d.ts +14 -0
  1411. package/packages/agent/src/services/research-task-executor.d.ts.map +1 -0
  1412. package/packages/agent/src/services/research-task-executor.js +136 -0
  1413. package/packages/agent/src/services/sandbox-engine.d.ts +96 -0
  1414. package/packages/agent/src/services/sandbox-engine.d.ts.map +1 -0
  1415. package/packages/agent/src/services/sandbox-engine.js +604 -0
  1416. package/packages/agent/src/services/sandbox-manager.d.ts +106 -0
  1417. package/packages/agent/src/services/sandbox-manager.d.ts.map +1 -0
  1418. package/packages/agent/src/services/sandbox-manager.js +380 -0
  1419. package/packages/agent/src/services/self-updater.d.ts +21 -0
  1420. package/packages/agent/src/services/self-updater.d.ts.map +1 -0
  1421. package/packages/agent/src/services/self-updater.js +162 -0
  1422. package/packages/agent/src/services/send-handler-availability.d.ts +5 -0
  1423. package/packages/agent/src/services/send-handler-availability.d.ts.map +1 -0
  1424. package/packages/agent/src/services/send-handler-availability.js +20 -0
  1425. package/packages/agent/src/services/signal-pairing.d.ts +57 -0
  1426. package/packages/agent/src/services/signal-pairing.d.ts.map +1 -0
  1427. package/packages/agent/src/services/signal-pairing.js +393 -0
  1428. package/packages/agent/src/services/signing-policy.d.ts +44 -0
  1429. package/packages/agent/src/services/signing-policy.d.ts.map +1 -0
  1430. package/packages/agent/src/services/signing-policy.js +165 -0
  1431. package/packages/agent/src/services/skill-catalog-client.d.ts +47 -0
  1432. package/packages/agent/src/services/skill-catalog-client.d.ts.map +1 -0
  1433. package/packages/agent/src/services/skill-catalog-client.js +130 -0
  1434. package/packages/agent/src/services/skill-marketplace.d.ts +42 -0
  1435. package/packages/agent/src/services/skill-marketplace.d.ts.map +1 -0
  1436. package/packages/agent/src/services/skill-marketplace.js +689 -0
  1437. package/packages/agent/src/services/steward-evm-account.d.ts +62 -0
  1438. package/packages/agent/src/services/steward-evm-account.d.ts.map +1 -0
  1439. package/packages/agent/src/services/steward-evm-account.js +308 -0
  1440. package/packages/agent/src/services/steward-evm-bridge.d.ts +39 -0
  1441. package/packages/agent/src/services/steward-evm-bridge.d.ts.map +1 -0
  1442. package/packages/agent/src/services/steward-evm-bridge.js +103 -0
  1443. package/packages/agent/src/services/steward-wallet.d.ts +30 -0
  1444. package/packages/agent/src/services/steward-wallet.d.ts.map +1 -0
  1445. package/packages/agent/src/services/steward-wallet.js +334 -0
  1446. package/packages/agent/src/services/stream-manager.d.ts +121 -0
  1447. package/packages/agent/src/services/stream-manager.d.ts.map +1 -0
  1448. package/packages/agent/src/services/stream-manager.js +609 -0
  1449. package/packages/agent/src/services/task-executor.d.ts +47 -0
  1450. package/packages/agent/src/services/task-executor.d.ts.map +1 -0
  1451. package/packages/agent/src/services/task-executor.js +31 -0
  1452. package/packages/agent/src/services/telegram-account-auth.d.ts +99 -0
  1453. package/packages/agent/src/services/telegram-account-auth.d.ts.map +1 -0
  1454. package/packages/agent/src/services/telegram-account-auth.js +611 -0
  1455. package/packages/agent/src/services/tts-stream-bridge.d.ts +83 -0
  1456. package/packages/agent/src/services/tts-stream-bridge.d.ts.map +1 -0
  1457. package/packages/agent/src/services/tts-stream-bridge.js +360 -0
  1458. package/packages/agent/src/services/update-checker.d.ts +29 -0
  1459. package/packages/agent/src/services/update-checker.d.ts.map +1 -0
  1460. package/packages/agent/src/services/update-checker.js +134 -0
  1461. package/packages/agent/src/services/version-compat.d.ts +99 -0
  1462. package/packages/agent/src/services/version-compat.d.ts.map +1 -0
  1463. package/packages/agent/src/services/version-compat.js +203 -0
  1464. package/packages/agent/src/services/whatsapp-pairing.d.ts +41 -0
  1465. package/packages/agent/src/services/whatsapp-pairing.d.ts.map +1 -0
  1466. package/packages/agent/src/services/whatsapp-pairing.js +209 -0
  1467. package/packages/agent/src/shared/index.d.ts +2 -0
  1468. package/packages/agent/src/shared/index.d.ts.map +1 -0
  1469. package/packages/agent/src/shared/index.js +1 -0
  1470. package/packages/agent/src/shared/ui-catalog-prompt.d.ts +52 -0
  1471. package/packages/agent/src/shared/ui-catalog-prompt.d.ts.map +1 -0
  1472. package/packages/agent/src/shared/ui-catalog-prompt.js +1028 -0
  1473. package/packages/agent/src/test-support/index.d.ts +4 -0
  1474. package/packages/agent/src/test-support/index.d.ts.map +1 -0
  1475. package/packages/agent/src/test-support/index.js +3 -0
  1476. package/packages/agent/src/test-support/process-helpers.d.ts +13 -0
  1477. package/packages/agent/src/test-support/process-helpers.d.ts.map +1 -0
  1478. package/packages/agent/src/test-support/process-helpers.js +23 -0
  1479. package/packages/agent/src/test-support/route-test-helpers.d.ts +37 -0
  1480. package/packages/agent/src/test-support/route-test-helpers.d.ts.map +1 -0
  1481. package/packages/agent/src/test-support/route-test-helpers.js +54 -0
  1482. package/packages/agent/src/test-support/test-helpers.d.ts +77 -0
  1483. package/packages/agent/src/test-support/test-helpers.d.ts.map +1 -0
  1484. package/packages/agent/src/test-support/test-helpers.js +217 -0
  1485. package/packages/agent/src/test-utils/sqlite-compat.d.ts +17 -0
  1486. package/packages/agent/src/test-utils/sqlite-compat.d.ts.map +1 -0
  1487. package/packages/agent/src/test-utils/sqlite-compat.js +48 -0
  1488. package/packages/agent/src/testing/index.d.ts +4 -0
  1489. package/packages/agent/src/testing/index.d.ts.map +1 -0
  1490. package/packages/agent/src/testing/index.js +3 -0
  1491. package/packages/agent/src/triggers/action.d.ts +4 -0
  1492. package/packages/agent/src/triggers/action.d.ts.map +1 -0
  1493. package/packages/agent/src/triggers/action.js +316 -0
  1494. package/packages/agent/src/triggers/index.d.ts +5 -0
  1495. package/packages/agent/src/triggers/index.d.ts.map +1 -0
  1496. package/packages/agent/src/triggers/index.js +4 -0
  1497. package/packages/agent/src/triggers/runtime.d.ts +25 -0
  1498. package/packages/agent/src/triggers/runtime.d.ts.map +1 -0
  1499. package/packages/agent/src/triggers/runtime.js +456 -0
  1500. package/packages/agent/src/triggers/scheduling.d.ts +71 -0
  1501. package/packages/agent/src/triggers/scheduling.d.ts.map +1 -0
  1502. package/packages/agent/src/triggers/scheduling.js +355 -0
  1503. package/packages/agent/src/triggers/types.d.ts +115 -0
  1504. package/packages/agent/src/triggers/types.d.ts.map +1 -0
  1505. package/packages/agent/src/triggers/types.js +1 -0
  1506. package/packages/agent/src/types/agent-skills.d.ts +19 -0
  1507. package/packages/agent/src/types/agent-skills.d.ts.map +1 -0
  1508. package/packages/agent/src/types/agent-skills.js +7 -0
  1509. package/packages/agent/src/types/config-like.d.ts +17 -0
  1510. package/packages/agent/src/types/config-like.d.ts.map +1 -0
  1511. package/packages/agent/src/types/config-like.js +7 -0
  1512. package/packages/agent/src/types/trajectory.d.ts +106 -0
  1513. package/packages/agent/src/types/trajectory.d.ts.map +1 -0
  1514. package/packages/agent/src/types/trajectory.js +7 -0
  1515. package/packages/agent/src/utils/exec-safety.d.ts +2 -0
  1516. package/packages/agent/src/utils/exec-safety.d.ts.map +1 -0
  1517. package/packages/agent/src/utils/exec-safety.js +21 -0
  1518. package/packages/agent/src/utils/index.d.ts +3 -0
  1519. package/packages/agent/src/utils/index.d.ts.map +1 -0
  1520. package/packages/agent/src/utils/index.js +2 -0
  1521. package/packages/agent/src/utils/number-parsing.d.ts +26 -0
  1522. package/packages/agent/src/utils/number-parsing.d.ts.map +1 -0
  1523. package/packages/agent/src/utils/number-parsing.js +52 -0
  1524. package/packages/agent/src/utils/spoken-text.d.ts +2 -0
  1525. package/packages/agent/src/utils/spoken-text.d.ts.map +1 -0
  1526. package/packages/agent/src/utils/spoken-text.js +1 -0
  1527. package/packages/agent/src/version-resolver.d.ts +2 -0
  1528. package/packages/agent/src/version-resolver.d.ts.map +1 -0
  1529. package/packages/agent/src/version-resolver.js +50 -0
  1530. package/packages/app-core/src/api/cloud-secrets.d.ts +23 -0
  1531. package/packages/app-core/src/api/cloud-secrets.d.ts.map +1 -0
  1532. package/packages/app-core/src/api/cloud-secrets.js +50 -0
  1533. package/packages/app-core/src/api/compat-route-shared.d.ts +16 -0
  1534. package/packages/app-core/src/api/compat-route-shared.d.ts.map +1 -0
  1535. package/packages/app-core/src/api/compat-route-shared.js +99 -0
  1536. package/packages/app-core/src/api/response.d.ts +12 -0
  1537. package/packages/app-core/src/api/response.d.ts.map +1 -0
  1538. package/packages/app-core/src/api/response.js +18 -0
  1539. package/packages/app-core/src/api/server-cloud-tts.d.ts +41 -0
  1540. package/packages/app-core/src/api/server-cloud-tts.d.ts.map +1 -0
  1541. package/packages/app-core/src/api/server-cloud-tts.js +469 -0
  1542. package/packages/app-core/src/config/boot-config-store.d.ts +117 -0
  1543. package/packages/app-core/src/config/boot-config-store.d.ts.map +1 -0
  1544. package/packages/app-core/src/config/boot-config-store.js +135 -0
  1545. package/packages/app-core/src/config/boot-config.d.ts +6 -0
  1546. package/packages/app-core/src/config/boot-config.d.ts.map +1 -0
  1547. package/packages/app-core/src/config/boot-config.js +5 -0
  1548. package/packages/app-core/src/config/branding.d.ts +55 -0
  1549. package/packages/app-core/src/config/branding.d.ts.map +1 -0
  1550. package/packages/app-core/src/config/branding.js +23 -0
  1551. package/packages/app-core/src/config/config.d.ts +12 -0
  1552. package/packages/app-core/src/config/config.d.ts.map +1 -0
  1553. package/packages/app-core/src/config/config.js +23 -0
  1554. package/packages/app-core/src/navigation/index.d.ts +52 -0
  1555. package/packages/app-core/src/navigation/index.d.ts.map +1 -0
  1556. package/packages/app-core/src/navigation/index.js +354 -0
  1557. package/packages/app-core/src/state/action-notice.d.ts +7 -0
  1558. package/packages/app-core/src/state/action-notice.d.ts.map +1 -0
  1559. package/packages/app-core/src/state/action-notice.js +1 -0
  1560. package/packages/app-core/src/types/index.d.ts +649 -0
  1561. package/packages/app-core/src/types/index.d.ts.map +1 -0
  1562. package/packages/app-core/src/types/index.js +1 -0
  1563. package/packages/app-core/src/types/lifeops-ui.d.ts +10 -0
  1564. package/packages/app-core/src/types/lifeops-ui.d.ts.map +1 -0
  1565. package/packages/app-core/src/types/lifeops-ui.js +1 -0
  1566. package/packages/app-core/src/utils/env.d.ts +31 -0
  1567. package/packages/app-core/src/utils/env.d.ts.map +1 -0
  1568. package/packages/app-core/src/utils/env.js +51 -0
  1569. package/packages/app-core/src/utils/tts-debug.d.ts +9 -0
  1570. package/packages/app-core/src/utils/tts-debug.d.ts.map +1 -0
  1571. package/packages/app-core/src/utils/tts-debug.js +68 -0
  1572. package/packages/shared/src/awareness/index.d.ts +2 -0
  1573. package/packages/shared/src/awareness/index.d.ts.map +1 -0
  1574. package/packages/shared/src/awareness/index.js +1 -0
  1575. package/packages/shared/src/awareness/registry.d.ts +27 -0
  1576. package/packages/shared/src/awareness/registry.d.ts.map +1 -0
  1577. package/packages/shared/src/awareness/registry.js +161 -0
  1578. package/packages/shared/src/connectors.d.ts +13 -0
  1579. package/packages/shared/src/connectors.d.ts.map +1 -0
  1580. package/packages/shared/src/connectors.js +91 -0
  1581. package/packages/shared/src/contracts/apps.d.ts +204 -0
  1582. package/packages/shared/src/contracts/apps.d.ts.map +1 -0
  1583. package/packages/shared/src/contracts/apps.js +188 -0
  1584. package/packages/shared/src/contracts/awareness.d.ts +38 -0
  1585. package/packages/shared/src/contracts/awareness.d.ts.map +1 -0
  1586. package/packages/shared/src/contracts/awareness.js +7 -0
  1587. package/packages/shared/src/contracts/cloud-topology.d.ts +13 -0
  1588. package/packages/shared/src/contracts/cloud-topology.d.ts.map +1 -0
  1589. package/packages/shared/src/contracts/cloud-topology.js +73 -0
  1590. package/packages/shared/src/contracts/config.d.ts +146 -0
  1591. package/packages/shared/src/contracts/config.d.ts.map +1 -0
  1592. package/packages/shared/src/contracts/config.js +4 -0
  1593. package/packages/shared/src/contracts/content-pack.d.ts +131 -0
  1594. package/packages/shared/src/contracts/content-pack.d.ts.map +1 -0
  1595. package/packages/shared/src/contracts/content-pack.js +102 -0
  1596. package/packages/shared/src/contracts/drop.d.ts +20 -0
  1597. package/packages/shared/src/contracts/drop.d.ts.map +1 -0
  1598. package/packages/shared/src/contracts/drop.js +4 -0
  1599. package/packages/shared/src/contracts/index.d.ts +13 -0
  1600. package/packages/shared/src/contracts/index.d.ts.map +1 -0
  1601. package/packages/shared/src/contracts/index.js +12 -0
  1602. package/packages/shared/src/contracts/lifeops.d.ts +1337 -0
  1603. package/packages/shared/src/contracts/lifeops.d.ts.map +1 -0
  1604. package/packages/shared/src/contracts/lifeops.js +278 -0
  1605. package/packages/shared/src/contracts/onboarding.d.ts +443 -0
  1606. package/packages/shared/src/contracts/onboarding.d.ts.map +1 -0
  1607. package/packages/shared/src/contracts/onboarding.js +1020 -0
  1608. package/packages/shared/src/contracts/permissions.d.ts +38 -0
  1609. package/packages/shared/src/contracts/permissions.d.ts.map +1 -0
  1610. package/packages/shared/src/contracts/permissions.js +4 -0
  1611. package/packages/shared/src/contracts/service-routing.d.ts +77 -0
  1612. package/packages/shared/src/contracts/service-routing.d.ts.map +1 -0
  1613. package/packages/shared/src/contracts/service-routing.js +227 -0
  1614. package/packages/shared/src/contracts/theme.d.ts +136 -0
  1615. package/packages/shared/src/contracts/theme.d.ts.map +1 -0
  1616. package/packages/shared/src/contracts/theme.js +133 -0
  1617. package/packages/shared/src/contracts/verification.d.ts +9 -0
  1618. package/packages/shared/src/contracts/verification.d.ts.map +1 -0
  1619. package/packages/shared/src/contracts/verification.js +4 -0
  1620. package/packages/shared/src/contracts/wallet.d.ts +626 -0
  1621. package/packages/shared/src/contracts/wallet.d.ts.map +1 -0
  1622. package/packages/shared/src/contracts/wallet.js +60 -0
  1623. package/packages/shared/src/env-utils.d.ts +5 -0
  1624. package/packages/shared/src/env-utils.d.ts.map +1 -0
  1625. package/packages/shared/src/env-utils.impl.d.ts +2 -0
  1626. package/packages/shared/src/env-utils.impl.d.ts.map +1 -0
  1627. package/packages/shared/src/env-utils.impl.js +16 -0
  1628. package/packages/shared/src/env-utils.js +4 -0
  1629. package/packages/shared/src/i18n/generated/validation-keyword-data.d.ts +1054 -0
  1630. package/packages/shared/src/i18n/generated/validation-keyword-data.d.ts.map +1 -0
  1631. package/packages/shared/src/i18n/generated/validation-keyword-data.js +1057 -0
  1632. package/packages/shared/src/i18n/keyword-matching.d.ts +23 -0
  1633. package/packages/shared/src/i18n/keyword-matching.d.ts.map +1 -0
  1634. package/packages/shared/src/i18n/keyword-matching.js +112 -0
  1635. package/packages/shared/src/i18n/validation-keywords.d.ts +13 -0
  1636. package/packages/shared/src/i18n/validation-keywords.d.ts.map +1 -0
  1637. package/packages/shared/src/i18n/validation-keywords.js +12 -0
  1638. package/packages/shared/src/index.d.ts +13 -0
  1639. package/packages/shared/src/index.d.ts.map +1 -0
  1640. package/packages/shared/src/index.js +12 -0
  1641. package/packages/shared/src/onboarding-presets.characters.d.ts +22 -0
  1642. package/packages/shared/src/onboarding-presets.characters.d.ts.map +1 -0
  1643. package/packages/shared/src/onboarding-presets.characters.js +2606 -0
  1644. package/packages/shared/src/onboarding-presets.d.ts +40 -0
  1645. package/packages/shared/src/onboarding-presets.d.ts.map +1 -0
  1646. package/packages/shared/src/onboarding-presets.js +176 -0
  1647. package/packages/shared/src/onboarding-presets.shared.d.ts +2 -0
  1648. package/packages/shared/src/onboarding-presets.shared.d.ts.map +1 -0
  1649. package/packages/shared/src/onboarding-presets.shared.js +7 -0
  1650. package/packages/shared/src/restart.d.ts +27 -0
  1651. package/packages/shared/src/restart.d.ts.map +1 -0
  1652. package/packages/shared/src/restart.js +28 -0
  1653. package/packages/shared/src/runtime-env.d.ts +82 -0
  1654. package/packages/shared/src/runtime-env.d.ts.map +1 -0
  1655. package/packages/shared/src/runtime-env.js +246 -0
  1656. package/packages/shared/src/settings-debug.d.ts +20 -0
  1657. package/packages/shared/src/settings-debug.d.ts.map +1 -0
  1658. package/packages/shared/src/settings-debug.js +116 -0
  1659. package/packages/shared/src/spoken-text.d.ts +2 -0
  1660. package/packages/shared/src/spoken-text.d.ts.map +1 -0
  1661. package/packages/shared/src/spoken-text.js +56 -0
  1662. package/packages/shared/src/types.d.ts +27 -0
  1663. package/packages/shared/src/types.d.ts.map +1 -0
  1664. package/packages/shared/src/types.js +1 -0
  1665. package/packages/shared/src/validation-keywords.d.ts +2 -0
  1666. package/packages/shared/src/validation-keywords.d.ts.map +1 -0
  1667. package/packages/shared/src/validation-keywords.js +1 -0
  1668. package/packages/typescript/src/action-docs.d.ts +22 -0
  1669. package/packages/typescript/src/action-docs.d.ts.map +1 -0
  1670. package/packages/typescript/src/action-docs.js +93 -0
  1671. package/packages/typescript/src/actions.d.ts +29 -0
  1672. package/packages/typescript/src/actions.d.ts.map +1 -0
  1673. package/packages/typescript/src/actions.js +456 -0
  1674. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts +4 -0
  1675. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts.map +1 -0
  1676. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.js +150 -0
  1677. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts +4 -0
  1678. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts.map +1 -0
  1679. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.js +136 -0
  1680. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts +4 -0
  1681. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts.map +1 -0
  1682. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.js +84 -0
  1683. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts +4 -0
  1684. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts.map +1 -0
  1685. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.js +107 -0
  1686. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts +16 -0
  1687. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts.map +1 -0
  1688. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.js +187 -0
  1689. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts +4 -0
  1690. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts.map +1 -0
  1691. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.js +138 -0
  1692. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts +4 -0
  1693. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts.map +1 -0
  1694. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.js +96 -0
  1695. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts +4 -0
  1696. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts.map +1 -0
  1697. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.js +139 -0
  1698. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts +4 -0
  1699. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts.map +1 -0
  1700. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.js +138 -0
  1701. package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts +39 -0
  1702. package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts.map +1 -0
  1703. package/packages/typescript/src/advanced-capabilities/clipboard/index.js +78 -0
  1704. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts +4 -0
  1705. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts.map +1 -0
  1706. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.js +62 -0
  1707. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts +16 -0
  1708. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts.map +1 -0
  1709. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.js +162 -0
  1710. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts +65 -0
  1711. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts.map +1 -0
  1712. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.js +352 -0
  1713. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts +24 -0
  1714. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts.map +1 -0
  1715. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.js +63 -0
  1716. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts +29 -0
  1717. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts.map +1 -0
  1718. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.js +195 -0
  1719. package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts +15 -0
  1720. package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts.map +1 -0
  1721. package/packages/typescript/src/advanced-capabilities/clipboard/specs.js +164 -0
  1722. package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts +92 -0
  1723. package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts.map +1 -0
  1724. package/packages/typescript/src/advanced-capabilities/clipboard/types.js +4 -0
  1725. package/packages/typescript/src/character-utils.d.ts +138 -0
  1726. package/packages/typescript/src/character-utils.d.ts.map +1 -0
  1727. package/packages/typescript/src/character-utils.js +271 -0
  1728. package/packages/typescript/src/character.d.ts +68 -0
  1729. package/packages/typescript/src/character.d.ts.map +1 -0
  1730. package/packages/typescript/src/character.js +155 -0
  1731. package/packages/typescript/src/connection.d.ts +45 -0
  1732. package/packages/typescript/src/connection.d.ts.map +1 -0
  1733. package/packages/typescript/src/connection.js +149 -0
  1734. package/packages/typescript/src/constants/index.d.ts +7 -0
  1735. package/packages/typescript/src/constants/index.d.ts.map +1 -0
  1736. package/packages/typescript/src/constants/index.js +6 -0
  1737. package/packages/typescript/src/constants/secrets.d.ts +99 -0
  1738. package/packages/typescript/src/constants/secrets.d.ts.map +1 -0
  1739. package/packages/typescript/src/constants/secrets.js +239 -0
  1740. package/packages/typescript/src/database/inMemoryAdapter.d.ts +285 -0
  1741. package/packages/typescript/src/database/inMemoryAdapter.d.ts.map +1 -0
  1742. package/packages/typescript/src/database/inMemoryAdapter.js +1149 -0
  1743. package/packages/typescript/src/database.d.ts +426 -0
  1744. package/packages/typescript/src/database.d.ts.map +1 -0
  1745. package/packages/typescript/src/database.js +24 -0
  1746. package/packages/typescript/src/entities.d.ts +11 -0
  1747. package/packages/typescript/src/entities.d.ts.map +1 -0
  1748. package/packages/typescript/src/entities.js +437 -0
  1749. package/packages/typescript/src/features/advanced-capabilities/actions/addContact.d.ts +3 -0
  1750. package/packages/typescript/src/features/advanced-capabilities/actions/addContact.d.ts.map +1 -0
  1751. package/packages/typescript/src/features/advanced-capabilities/actions/addContact.js +142 -0
  1752. package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.d.ts +3 -0
  1753. package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.d.ts.map +1 -0
  1754. package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.js +183 -0
  1755. package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.d.ts +3 -0
  1756. package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.d.ts.map +1 -0
  1757. package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.js +148 -0
  1758. package/packages/typescript/src/features/advanced-capabilities/actions/index.d.ts +21 -0
  1759. package/packages/typescript/src/features/advanced-capabilities/actions/index.d.ts.map +1 -0
  1760. package/packages/typescript/src/features/advanced-capabilities/actions/index.js +20 -0
  1761. package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.d.ts +3 -0
  1762. package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.d.ts.map +1 -0
  1763. package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.js +181 -0
  1764. package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.d.ts +3 -0
  1765. package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.d.ts.map +1 -0
  1766. package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.js +102 -0
  1767. package/packages/typescript/src/features/advanced-capabilities/actions/roles.d.ts +13 -0
  1768. package/packages/typescript/src/features/advanced-capabilities/actions/roles.d.ts.map +1 -0
  1769. package/packages/typescript/src/features/advanced-capabilities/actions/roles.js +317 -0
  1770. package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.d.ts +3 -0
  1771. package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.d.ts.map +1 -0
  1772. package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.js +129 -0
  1773. package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.d.ts +3 -0
  1774. package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.d.ts.map +1 -0
  1775. package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.js +176 -0
  1776. package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.d.ts +15 -0
  1777. package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.d.ts.map +1 -0
  1778. package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.js +476 -0
  1779. package/packages/typescript/src/features/advanced-capabilities/actions/settings.d.ts +22 -0
  1780. package/packages/typescript/src/features/advanced-capabilities/actions/settings.d.ts.map +1 -0
  1781. package/packages/typescript/src/features/advanced-capabilities/actions/settings.js +823 -0
  1782. package/packages/typescript/src/features/advanced-capabilities/actions/think.d.ts +3 -0
  1783. package/packages/typescript/src/features/advanced-capabilities/actions/think.d.ts.map +1 -0
  1784. package/packages/typescript/src/features/advanced-capabilities/actions/think.js +84 -0
  1785. package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.d.ts +3 -0
  1786. package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.d.ts.map +1 -0
  1787. package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.js +134 -0
  1788. package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.d.ts +3 -0
  1789. package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.d.ts.map +1 -0
  1790. package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.js +193 -0
  1791. package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.d.ts +3 -0
  1792. package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.d.ts.map +1 -0
  1793. package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.js +199 -0
  1794. package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.d.ts +43 -0
  1795. package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.d.ts.map +1 -0
  1796. package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.js +372 -0
  1797. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.d.ts +4 -0
  1798. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.d.ts.map +1 -0
  1799. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.js +150 -0
  1800. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.d.ts +4 -0
  1801. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.d.ts.map +1 -0
  1802. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.js +136 -0
  1803. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.d.ts +4 -0
  1804. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.d.ts.map +1 -0
  1805. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.js +84 -0
  1806. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.d.ts +4 -0
  1807. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.d.ts.map +1 -0
  1808. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.js +112 -0
  1809. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.d.ts +16 -0
  1810. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.d.ts.map +1 -0
  1811. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.js +192 -0
  1812. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.d.ts +4 -0
  1813. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.d.ts.map +1 -0
  1814. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.js +138 -0
  1815. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts +4 -0
  1816. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts.map +1 -0
  1817. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.js +96 -0
  1818. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.d.ts +4 -0
  1819. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.d.ts.map +1 -0
  1820. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.js +139 -0
  1821. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.d.ts +4 -0
  1822. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.d.ts.map +1 -0
  1823. package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.js +138 -0
  1824. package/packages/typescript/src/features/advanced-capabilities/clipboard/index.d.ts +39 -0
  1825. package/packages/typescript/src/features/advanced-capabilities/clipboard/index.d.ts.map +1 -0
  1826. package/packages/typescript/src/features/advanced-capabilities/clipboard/index.js +78 -0
  1827. package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.d.ts +4 -0
  1828. package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.d.ts.map +1 -0
  1829. package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.js +62 -0
  1830. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.d.ts +16 -0
  1831. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.d.ts.map +1 -0
  1832. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.js +162 -0
  1833. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.d.ts +65 -0
  1834. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.d.ts.map +1 -0
  1835. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.js +352 -0
  1836. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts +24 -0
  1837. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts.map +1 -0
  1838. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.js +63 -0
  1839. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.d.ts +29 -0
  1840. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.d.ts.map +1 -0
  1841. package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.js +195 -0
  1842. package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.d.ts +15 -0
  1843. package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.d.ts.map +1 -0
  1844. package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.js +164 -0
  1845. package/packages/typescript/src/features/advanced-capabilities/clipboard/types.d.ts +92 -0
  1846. package/packages/typescript/src/features/advanced-capabilities/clipboard/types.d.ts.map +1 -0
  1847. package/packages/typescript/src/features/advanced-capabilities/clipboard/types.js +4 -0
  1848. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts +8 -0
  1849. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts.map +1 -0
  1850. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.js +7 -0
  1851. package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.d.ts +3 -0
  1852. package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.d.ts.map +1 -0
  1853. package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.js +633 -0
  1854. package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.d.ts +3 -0
  1855. package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.d.ts.map +1 -0
  1856. package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.js +619 -0
  1857. package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.d.ts +12 -0
  1858. package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.d.ts.map +1 -0
  1859. package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.js +14 -0
  1860. package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.d.ts +3 -0
  1861. package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.d.ts.map +1 -0
  1862. package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.js +70 -0
  1863. package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.d.ts +3 -0
  1864. package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.d.ts.map +1 -0
  1865. package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.js +256 -0
  1866. package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.d.ts +12 -0
  1867. package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.d.ts.map +1 -0
  1868. package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.js +41 -0
  1869. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.d.ts +49 -0
  1870. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.d.ts.map +1 -0
  1871. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.js +78 -0
  1872. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.d.ts +159 -0
  1873. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.d.ts.map +1 -0
  1874. package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.js +192 -0
  1875. package/packages/typescript/src/features/advanced-capabilities/experience/index.d.ts +10 -0
  1876. package/packages/typescript/src/features/advanced-capabilities/experience/index.d.ts.map +1 -0
  1877. package/packages/typescript/src/features/advanced-capabilities/experience/index.js +8 -0
  1878. package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.d.ts +3 -0
  1879. package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.d.ts.map +1 -0
  1880. package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.js +51 -0
  1881. package/packages/typescript/src/features/advanced-capabilities/experience/service.d.ts +46 -0
  1882. package/packages/typescript/src/features/advanced-capabilities/experience/service.d.ts.map +1 -0
  1883. package/packages/typescript/src/features/advanced-capabilities/experience/service.js +569 -0
  1884. package/packages/typescript/src/features/advanced-capabilities/experience/types.d.ts +95 -0
  1885. package/packages/typescript/src/features/advanced-capabilities/experience/types.d.ts.map +1 -0
  1886. package/packages/typescript/src/features/advanced-capabilities/experience/types.js +22 -0
  1887. package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.d.ts +34 -0
  1888. package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.d.ts.map +1 -0
  1889. package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.js +106 -0
  1890. package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.d.ts +25 -0
  1891. package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.d.ts.map +1 -0
  1892. package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.js +116 -0
  1893. package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.d.ts +13 -0
  1894. package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.d.ts.map +1 -0
  1895. package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.js +152 -0
  1896. package/packages/typescript/src/features/advanced-capabilities/form/builder.d.ts +101 -0
  1897. package/packages/typescript/src/features/advanced-capabilities/form/builder.d.ts.map +1 -0
  1898. package/packages/typescript/src/features/advanced-capabilities/form/builder.js +362 -0
  1899. package/packages/typescript/src/features/advanced-capabilities/form/builtins.d.ts +16 -0
  1900. package/packages/typescript/src/features/advanced-capabilities/form/builtins.d.ts.map +1 -0
  1901. package/packages/typescript/src/features/advanced-capabilities/form/builtins.js +245 -0
  1902. package/packages/typescript/src/features/advanced-capabilities/form/defaults.d.ts +32 -0
  1903. package/packages/typescript/src/features/advanced-capabilities/form/defaults.d.ts.map +1 -0
  1904. package/packages/typescript/src/features/advanced-capabilities/form/defaults.js +98 -0
  1905. package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.d.ts +12 -0
  1906. package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.d.ts.map +1 -0
  1907. package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.js +231 -0
  1908. package/packages/typescript/src/features/advanced-capabilities/form/extraction.d.ts +24 -0
  1909. package/packages/typescript/src/features/advanced-capabilities/form/extraction.d.ts.map +1 -0
  1910. package/packages/typescript/src/features/advanced-capabilities/form/extraction.js +319 -0
  1911. package/packages/typescript/src/features/advanced-capabilities/form/index.d.ts +22 -0
  1912. package/packages/typescript/src/features/advanced-capabilities/form/index.d.ts.map +1 -0
  1913. package/packages/typescript/src/features/advanced-capabilities/form/index.js +52 -0
  1914. package/packages/typescript/src/features/advanced-capabilities/form/intent.d.ts +41 -0
  1915. package/packages/typescript/src/features/advanced-capabilities/form/intent.d.ts.map +1 -0
  1916. package/packages/typescript/src/features/advanced-capabilities/form/intent.js +119 -0
  1917. package/packages/typescript/src/features/advanced-capabilities/form/providers/context.d.ts +11 -0
  1918. package/packages/typescript/src/features/advanced-capabilities/form/providers/context.d.ts.map +1 -0
  1919. package/packages/typescript/src/features/advanced-capabilities/form/providers/context.js +166 -0
  1920. package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts +70 -0
  1921. package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts.map +1 -0
  1922. package/packages/typescript/src/features/advanced-capabilities/form/service.js +924 -0
  1923. package/packages/typescript/src/features/advanced-capabilities/form/storage.d.ts +26 -0
  1924. package/packages/typescript/src/features/advanced-capabilities/form/storage.d.ts.map +1 -0
  1925. package/packages/typescript/src/features/advanced-capabilities/form/storage.js +228 -0
  1926. package/packages/typescript/src/features/advanced-capabilities/form/template.d.ts +10 -0
  1927. package/packages/typescript/src/features/advanced-capabilities/form/template.d.ts.map +1 -0
  1928. package/packages/typescript/src/features/advanced-capabilities/form/template.js +56 -0
  1929. package/packages/typescript/src/features/advanced-capabilities/form/ttl.d.ts +40 -0
  1930. package/packages/typescript/src/features/advanced-capabilities/form/ttl.d.ts.map +1 -0
  1931. package/packages/typescript/src/features/advanced-capabilities/form/ttl.js +107 -0
  1932. package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts +588 -0
  1933. package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts.map +1 -0
  1934. package/packages/typescript/src/features/advanced-capabilities/form/types.js +71 -0
  1935. package/packages/typescript/src/features/advanced-capabilities/form/validation.d.ts +24 -0
  1936. package/packages/typescript/src/features/advanced-capabilities/form/validation.d.ts.map +1 -0
  1937. package/packages/typescript/src/features/advanced-capabilities/form/validation.js +311 -0
  1938. package/packages/typescript/src/features/advanced-capabilities/index.d.ts +47 -0
  1939. package/packages/typescript/src/features/advanced-capabilities/index.d.ts.map +1 -0
  1940. package/packages/typescript/src/features/advanced-capabilities/index.js +114 -0
  1941. package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.d.ts +7 -0
  1942. package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.d.ts.map +1 -0
  1943. package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.js +1299 -0
  1944. package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.d.ts +53 -0
  1945. package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.d.ts.map +1 -0
  1946. package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.js +429 -0
  1947. package/packages/typescript/src/features/advanced-capabilities/personality/index.d.ts +10 -0
  1948. package/packages/typescript/src/features/advanced-capabilities/personality/index.d.ts.map +1 -0
  1949. package/packages/typescript/src/features/advanced-capabilities/personality/index.js +8 -0
  1950. package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.d.ts +8 -0
  1951. package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.d.ts.map +1 -0
  1952. package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.js +57 -0
  1953. package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.d.ts +71 -0
  1954. package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.d.ts.map +1 -0
  1955. package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.js +498 -0
  1956. package/packages/typescript/src/features/advanced-capabilities/personality/types.d.ts +18 -0
  1957. package/packages/typescript/src/features/advanced-capabilities/personality/types.d.ts.map +1 -0
  1958. package/packages/typescript/src/features/advanced-capabilities/personality/types.js +8 -0
  1959. package/packages/typescript/src/features/advanced-capabilities/providers/contacts.d.ts +3 -0
  1960. package/packages/typescript/src/features/advanced-capabilities/providers/contacts.d.ts.map +1 -0
  1961. package/packages/typescript/src/features/advanced-capabilities/providers/contacts.js +77 -0
  1962. package/packages/typescript/src/features/advanced-capabilities/providers/facts.d.ts +11 -0
  1963. package/packages/typescript/src/features/advanced-capabilities/providers/facts.d.ts.map +1 -0
  1964. package/packages/typescript/src/features/advanced-capabilities/providers/facts.js +108 -0
  1965. package/packages/typescript/src/features/advanced-capabilities/providers/followUps.d.ts +3 -0
  1966. package/packages/typescript/src/features/advanced-capabilities/providers/followUps.d.ts.map +1 -0
  1967. package/packages/typescript/src/features/advanced-capabilities/providers/followUps.js +112 -0
  1968. package/packages/typescript/src/features/advanced-capabilities/providers/index.d.ts +13 -0
  1969. package/packages/typescript/src/features/advanced-capabilities/providers/index.d.ts.map +1 -0
  1970. package/packages/typescript/src/features/advanced-capabilities/providers/index.js +12 -0
  1971. package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.d.ts +9 -0
  1972. package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.d.ts.map +1 -0
  1973. package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.js +83 -0
  1974. package/packages/typescript/src/features/advanced-capabilities/providers/relationships.d.ts +15 -0
  1975. package/packages/typescript/src/features/advanced-capabilities/providers/relationships.d.ts.map +1 -0
  1976. package/packages/typescript/src/features/advanced-capabilities/providers/relationships.js +125 -0
  1977. package/packages/typescript/src/features/advanced-capabilities/providers/roles.d.ts +19 -0
  1978. package/packages/typescript/src/features/advanced-capabilities/providers/roles.d.ts.map +1 -0
  1979. package/packages/typescript/src/features/advanced-capabilities/providers/roles.js +180 -0
  1980. package/packages/typescript/src/features/advanced-capabilities/providers/settings.d.ts +7 -0
  1981. package/packages/typescript/src/features/advanced-capabilities/providers/settings.d.ts.map +1 -0
  1982. package/packages/typescript/src/features/advanced-capabilities/providers/settings.js +286 -0
  1983. package/packages/typescript/src/features/advanced-memory/evaluators/index.d.ts +3 -0
  1984. package/packages/typescript/src/features/advanced-memory/evaluators/index.d.ts.map +1 -0
  1985. package/packages/typescript/src/features/advanced-memory/evaluators/index.js +2 -0
  1986. package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.d.ts +3 -0
  1987. package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.d.ts.map +1 -0
  1988. package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.js +198 -0
  1989. package/packages/typescript/src/features/advanced-memory/evaluators/summarization.d.ts +3 -0
  1990. package/packages/typescript/src/features/advanced-memory/evaluators/summarization.d.ts.map +1 -0
  1991. package/packages/typescript/src/features/advanced-memory/evaluators/summarization.js +240 -0
  1992. package/packages/typescript/src/features/advanced-memory/index.d.ts +16 -0
  1993. package/packages/typescript/src/features/advanced-memory/index.d.ts.map +1 -0
  1994. package/packages/typescript/src/features/advanced-memory/index.js +26 -0
  1995. package/packages/typescript/src/features/advanced-memory/prompts.d.ts +2 -0
  1996. package/packages/typescript/src/features/advanced-memory/prompts.d.ts.map +1 -0
  1997. package/packages/typescript/src/features/advanced-memory/prompts.js +1 -0
  1998. package/packages/typescript/src/features/advanced-memory/providers/context-summary.d.ts +3 -0
  1999. package/packages/typescript/src/features/advanced-memory/providers/context-summary.d.ts.map +1 -0
  2000. package/packages/typescript/src/features/advanced-memory/providers/context-summary.js +85 -0
  2001. package/packages/typescript/src/features/advanced-memory/providers/index.d.ts +3 -0
  2002. package/packages/typescript/src/features/advanced-memory/providers/index.d.ts.map +1 -0
  2003. package/packages/typescript/src/features/advanced-memory/providers/index.js +2 -0
  2004. package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.d.ts +3 -0
  2005. package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.d.ts.map +1 -0
  2006. package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.js +92 -0
  2007. package/packages/typescript/src/features/advanced-memory/schemas/index.d.ts +5 -0
  2008. package/packages/typescript/src/features/advanced-memory/schemas/index.d.ts.map +1 -0
  2009. package/packages/typescript/src/features/advanced-memory/schemas/index.js +3 -0
  2010. package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.d.ts +10 -0
  2011. package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.d.ts.map +1 -0
  2012. package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.js +65 -0
  2013. package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.d.ts +10 -0
  2014. package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.d.ts.map +1 -0
  2015. package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.js +45 -0
  2016. package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.d.ts +10 -0
  2017. package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.d.ts.map +1 -0
  2018. package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.js +66 -0
  2019. package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts +37 -0
  2020. package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts.map +1 -0
  2021. package/packages/typescript/src/features/advanced-memory/services/memory-service.js +347 -0
  2022. package/packages/typescript/src/features/advanced-memory/trajectory.d.ts +10 -0
  2023. package/packages/typescript/src/features/advanced-memory/trajectory.d.ts.map +1 -0
  2024. package/packages/typescript/src/features/advanced-memory/trajectory.js +33 -0
  2025. package/packages/typescript/src/features/advanced-memory/types.d.ts +68 -0
  2026. package/packages/typescript/src/features/advanced-memory/types.d.ts.map +1 -0
  2027. package/packages/typescript/src/features/advanced-memory/types.js +6 -0
  2028. package/packages/typescript/src/features/advanced-planning/actions/chain-example.d.ts +6 -0
  2029. package/packages/typescript/src/features/advanced-planning/actions/chain-example.d.ts.map +1 -0
  2030. package/packages/typescript/src/features/advanced-planning/actions/chain-example.js +181 -0
  2031. package/packages/typescript/src/features/advanced-planning/index.d.ts +5 -0
  2032. package/packages/typescript/src/features/advanced-planning/index.d.ts.map +1 -0
  2033. package/packages/typescript/src/features/advanced-planning/index.js +20 -0
  2034. package/packages/typescript/src/features/advanced-planning/providers/message-classifier.d.ts +3 -0
  2035. package/packages/typescript/src/features/advanced-planning/providers/message-classifier.d.ts.map +1 -0
  2036. package/packages/typescript/src/features/advanced-planning/providers/message-classifier.js +105 -0
  2037. package/packages/typescript/src/features/advanced-planning/services/planning-service.d.ts +77 -0
  2038. package/packages/typescript/src/features/advanced-planning/services/planning-service.d.ts.map +1 -0
  2039. package/packages/typescript/src/features/advanced-planning/services/planning-service.js +875 -0
  2040. package/packages/typescript/src/features/advanced-planning/types.d.ts +78 -0
  2041. package/packages/typescript/src/features/advanced-planning/types.d.ts.map +1 -0
  2042. package/packages/typescript/src/features/advanced-planning/types.js +1 -0
  2043. package/packages/typescript/src/features/autonomy/action.d.ts +14 -0
  2044. package/packages/typescript/src/features/autonomy/action.d.ts.map +1 -0
  2045. package/packages/typescript/src/features/autonomy/action.js +177 -0
  2046. package/packages/typescript/src/features/autonomy/execution-facade.d.ts +22 -0
  2047. package/packages/typescript/src/features/autonomy/execution-facade.d.ts.map +1 -0
  2048. package/packages/typescript/src/features/autonomy/execution-facade.js +132 -0
  2049. package/packages/typescript/src/features/autonomy/index.d.ts +11 -0
  2050. package/packages/typescript/src/features/autonomy/index.d.ts.map +1 -0
  2051. package/packages/typescript/src/features/autonomy/index.js +13 -0
  2052. package/packages/typescript/src/features/autonomy/providers.d.ts +21 -0
  2053. package/packages/typescript/src/features/autonomy/providers.d.ts.map +1 -0
  2054. package/packages/typescript/src/features/autonomy/providers.js +154 -0
  2055. package/packages/typescript/src/features/autonomy/routes.d.ts +11 -0
  2056. package/packages/typescript/src/features/autonomy/routes.d.ts.map +1 -0
  2057. package/packages/typescript/src/features/autonomy/routes.js +158 -0
  2058. package/packages/typescript/src/features/autonomy/service.d.ts +138 -0
  2059. package/packages/typescript/src/features/autonomy/service.d.ts.map +1 -0
  2060. package/packages/typescript/src/features/autonomy/service.js +813 -0
  2061. package/packages/typescript/src/features/autonomy/types.d.ts +31 -0
  2062. package/packages/typescript/src/features/autonomy/types.d.ts.map +1 -0
  2063. package/packages/typescript/src/features/autonomy/types.js +6 -0
  2064. package/packages/typescript/src/features/basic-capabilities/actions/choice.d.ts +4 -0
  2065. package/packages/typescript/src/features/basic-capabilities/actions/choice.d.ts.map +1 -0
  2066. package/packages/typescript/src/features/basic-capabilities/actions/choice.js +278 -0
  2067. package/packages/typescript/src/features/basic-capabilities/actions/ignore.d.ts +3 -0
  2068. package/packages/typescript/src/features/basic-capabilities/actions/ignore.d.ts.map +1 -0
  2069. package/packages/typescript/src/features/basic-capabilities/actions/ignore.js +23 -0
  2070. package/packages/typescript/src/features/basic-capabilities/actions/index.d.ts +10 -0
  2071. package/packages/typescript/src/features/basic-capabilities/actions/index.d.ts.map +1 -0
  2072. package/packages/typescript/src/features/basic-capabilities/actions/index.js +9 -0
  2073. package/packages/typescript/src/features/basic-capabilities/actions/none.d.ts +3 -0
  2074. package/packages/typescript/src/features/basic-capabilities/actions/none.d.ts.map +1 -0
  2075. package/packages/typescript/src/features/basic-capabilities/actions/none.js +26 -0
  2076. package/packages/typescript/src/features/basic-capabilities/actions/reply.d.ts +3 -0
  2077. package/packages/typescript/src/features/basic-capabilities/actions/reply.d.ts.map +1 -0
  2078. package/packages/typescript/src/features/basic-capabilities/actions/reply.js +80 -0
  2079. package/packages/typescript/src/features/basic-capabilities/index.d.ts +108 -0
  2080. package/packages/typescript/src/features/basic-capabilities/index.d.ts.map +1 -0
  2081. package/packages/typescript/src/features/basic-capabilities/index.js +1020 -0
  2082. package/packages/typescript/src/features/basic-capabilities/providers/actionState.d.ts +7 -0
  2083. package/packages/typescript/src/features/basic-capabilities/providers/actionState.d.ts.map +1 -0
  2084. package/packages/typescript/src/features/basic-capabilities/providers/actionState.js +232 -0
  2085. package/packages/typescript/src/features/basic-capabilities/providers/actions.d.ts +35 -0
  2086. package/packages/typescript/src/features/basic-capabilities/providers/actions.d.ts.map +1 -0
  2087. package/packages/typescript/src/features/basic-capabilities/providers/actions.js +82 -0
  2088. package/packages/typescript/src/features/basic-capabilities/providers/attachments.d.ts +20 -0
  2089. package/packages/typescript/src/features/basic-capabilities/providers/attachments.d.ts.map +1 -0
  2090. package/packages/typescript/src/features/basic-capabilities/providers/attachments.js +94 -0
  2091. package/packages/typescript/src/features/basic-capabilities/providers/character.d.ts +17 -0
  2092. package/packages/typescript/src/features/basic-capabilities/providers/character.d.ts.map +1 -0
  2093. package/packages/typescript/src/features/basic-capabilities/providers/character.js +190 -0
  2094. package/packages/typescript/src/features/basic-capabilities/providers/choice.d.ts +11 -0
  2095. package/packages/typescript/src/features/basic-capabilities/providers/choice.d.ts.map +1 -0
  2096. package/packages/typescript/src/features/basic-capabilities/providers/choice.js +86 -0
  2097. package/packages/typescript/src/features/basic-capabilities/providers/contextBench.d.ts +12 -0
  2098. package/packages/typescript/src/features/basic-capabilities/providers/contextBench.d.ts.map +1 -0
  2099. package/packages/typescript/src/features/basic-capabilities/providers/contextBench.js +50 -0
  2100. package/packages/typescript/src/features/basic-capabilities/providers/currentTime.d.ts +11 -0
  2101. package/packages/typescript/src/features/basic-capabilities/providers/currentTime.d.ts.map +1 -0
  2102. package/packages/typescript/src/features/basic-capabilities/providers/currentTime.js +56 -0
  2103. package/packages/typescript/src/features/basic-capabilities/providers/entities.d.ts +7 -0
  2104. package/packages/typescript/src/features/basic-capabilities/providers/entities.d.ts.map +1 -0
  2105. package/packages/typescript/src/features/basic-capabilities/providers/entities.js +39 -0
  2106. package/packages/typescript/src/features/basic-capabilities/providers/evaluators.d.ts +27 -0
  2107. package/packages/typescript/src/features/basic-capabilities/providers/evaluators.d.ts.map +1 -0
  2108. package/packages/typescript/src/features/basic-capabilities/providers/evaluators.js +107 -0
  2109. package/packages/typescript/src/features/basic-capabilities/providers/index.d.ts +19 -0
  2110. package/packages/typescript/src/features/basic-capabilities/providers/index.d.ts.map +1 -0
  2111. package/packages/typescript/src/features/basic-capabilities/providers/index.js +18 -0
  2112. package/packages/typescript/src/features/basic-capabilities/providers/providers.d.ts +18 -0
  2113. package/packages/typescript/src/features/basic-capabilities/providers/providers.d.ts.map +1 -0
  2114. package/packages/typescript/src/features/basic-capabilities/providers/providers.js +70 -0
  2115. package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.d.ts +14 -0
  2116. package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.d.ts.map +1 -0
  2117. package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.js +323 -0
  2118. package/packages/typescript/src/features/basic-capabilities/providers/time.d.ts +12 -0
  2119. package/packages/typescript/src/features/basic-capabilities/providers/time.d.ts.map +1 -0
  2120. package/packages/typescript/src/features/basic-capabilities/providers/time.js +36 -0
  2121. package/packages/typescript/src/features/basic-capabilities/providers/world.d.ts +8 -0
  2122. package/packages/typescript/src/features/basic-capabilities/providers/world.d.ts.map +1 -0
  2123. package/packages/typescript/src/features/basic-capabilities/providers/world.js +212 -0
  2124. package/packages/typescript/src/features/index.d.ts +58 -0
  2125. package/packages/typescript/src/features/index.d.ts.map +1 -0
  2126. package/packages/typescript/src/features/index.js +155 -0
  2127. package/packages/typescript/src/features/knowledge/actions.d.ts +5 -0
  2128. package/packages/typescript/src/features/knowledge/actions.d.ts.map +1 -0
  2129. package/packages/typescript/src/features/knowledge/actions.js +269 -0
  2130. package/packages/typescript/src/features/knowledge/config.d.ts +5 -0
  2131. package/packages/typescript/src/features/knowledge/config.d.ts.map +1 -0
  2132. package/packages/typescript/src/features/knowledge/config.js +147 -0
  2133. package/packages/typescript/src/features/knowledge/ctx-embeddings.d.ts +53 -0
  2134. package/packages/typescript/src/features/knowledge/ctx-embeddings.d.ts.map +1 -0
  2135. package/packages/typescript/src/features/knowledge/ctx-embeddings.js +412 -0
  2136. package/packages/typescript/src/features/knowledge/docs-loader.d.ts +9 -0
  2137. package/packages/typescript/src/features/knowledge/docs-loader.d.ts.map +1 -0
  2138. package/packages/typescript/src/features/knowledge/docs-loader.js +202 -0
  2139. package/packages/typescript/src/features/knowledge/document-processor.d.ts +26 -0
  2140. package/packages/typescript/src/features/knowledge/document-processor.d.ts.map +1 -0
  2141. package/packages/typescript/src/features/knowledge/document-processor.js +618 -0
  2142. package/packages/typescript/src/features/knowledge/documents-provider.d.ts +3 -0
  2143. package/packages/typescript/src/features/knowledge/documents-provider.d.ts.map +1 -0
  2144. package/packages/typescript/src/features/knowledge/documents-provider.js +106 -0
  2145. package/packages/typescript/src/features/knowledge/index.d.ts +16 -0
  2146. package/packages/typescript/src/features/knowledge/index.d.ts.map +1 -0
  2147. package/packages/typescript/src/features/knowledge/index.js +29 -0
  2148. package/packages/typescript/src/features/knowledge/llm.d.ts +27 -0
  2149. package/packages/typescript/src/features/knowledge/llm.d.ts.map +1 -0
  2150. package/packages/typescript/src/features/knowledge/llm.js +444 -0
  2151. package/packages/typescript/src/features/knowledge/provider.d.ts +3 -0
  2152. package/packages/typescript/src/features/knowledge/provider.d.ts.map +1 -0
  2153. package/packages/typescript/src/features/knowledge/provider.js +62 -0
  2154. package/packages/typescript/src/features/knowledge/service.d.ts +76 -0
  2155. package/packages/typescript/src/features/knowledge/service.d.ts.map +1 -0
  2156. package/packages/typescript/src/features/knowledge/service.js +511 -0
  2157. package/packages/typescript/src/features/knowledge/types.d.ts +144 -0
  2158. package/packages/typescript/src/features/knowledge/types.d.ts.map +1 -0
  2159. package/packages/typescript/src/features/knowledge/types.js +57 -0
  2160. package/packages/typescript/src/features/knowledge/utils.d.ts +17 -0
  2161. package/packages/typescript/src/features/knowledge/utils.d.ts.map +1 -0
  2162. package/packages/typescript/src/features/knowledge/utils.js +313 -0
  2163. package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.d.ts +3 -0
  2164. package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.d.ts.map +1 -0
  2165. package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.js +65 -0
  2166. package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.d.ts +3 -0
  2167. package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.d.ts.map +1 -0
  2168. package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.js +63 -0
  2169. package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.d.ts +4 -0
  2170. package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.d.ts.map +1 -0
  2171. package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.js +232 -0
  2172. package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts +35 -0
  2173. package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts.map +1 -0
  2174. package/packages/typescript/src/features/plugin-manager/coreExtensions.js +77 -0
  2175. package/packages/typescript/src/features/plugin-manager/index.d.ts +25 -0
  2176. package/packages/typescript/src/features/plugin-manager/index.d.ts.map +1 -0
  2177. package/packages/typescript/src/features/plugin-manager/index.js +53 -0
  2178. package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.d.ts +5 -0
  2179. package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.d.ts.map +1 -0
  2180. package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.js +104 -0
  2181. package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.d.ts +5 -0
  2182. package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.d.ts.map +1 -0
  2183. package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.js +105 -0
  2184. package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.d.ts +5 -0
  2185. package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.d.ts.map +1 -0
  2186. package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.js +93 -0
  2187. package/packages/typescript/src/features/plugin-manager/providers/relevance.d.ts +9 -0
  2188. package/packages/typescript/src/features/plugin-manager/providers/relevance.d.ts.map +1 -0
  2189. package/packages/typescript/src/features/plugin-manager/providers/relevance.js +226 -0
  2190. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts +76 -0
  2191. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts.map +1 -0
  2192. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.js +479 -0
  2193. package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.d.ts +31 -0
  2194. package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.d.ts.map +1 -0
  2195. package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.js +57 -0
  2196. package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.d.ts +68 -0
  2197. package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.d.ts.map +1 -0
  2198. package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.js +1007 -0
  2199. package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.d.ts +84 -0
  2200. package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.d.ts.map +1 -0
  2201. package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.js +402 -0
  2202. package/packages/typescript/src/features/plugin-manager/types.d.ts +142 -0
  2203. package/packages/typescript/src/features/plugin-manager/types.d.ts.map +1 -0
  2204. package/packages/typescript/src/features/plugin-manager/types.js +13 -0
  2205. package/packages/typescript/src/features/plugin-manager/utils/paths.d.ts +4 -0
  2206. package/packages/typescript/src/features/plugin-manager/utils/paths.d.ts.map +1 -0
  2207. package/packages/typescript/src/features/plugin-manager/utils/paths.js +32 -0
  2208. package/packages/typescript/src/features/secrets/actions/index.d.ts +7 -0
  2209. package/packages/typescript/src/features/secrets/actions/index.d.ts.map +1 -0
  2210. package/packages/typescript/src/features/secrets/actions/index.js +6 -0
  2211. package/packages/typescript/src/features/secrets/actions/manage-secret.d.ts +12 -0
  2212. package/packages/typescript/src/features/secrets/actions/manage-secret.d.ts.map +1 -0
  2213. package/packages/typescript/src/features/secrets/actions/manage-secret.js +278 -0
  2214. package/packages/typescript/src/features/secrets/actions/request-secret.d.ts +3 -0
  2215. package/packages/typescript/src/features/secrets/actions/request-secret.d.ts.map +1 -0
  2216. package/packages/typescript/src/features/secrets/actions/request-secret.js +105 -0
  2217. package/packages/typescript/src/features/secrets/actions/set-secret.d.ts +12 -0
  2218. package/packages/typescript/src/features/secrets/actions/set-secret.d.ts.map +1 -0
  2219. package/packages/typescript/src/features/secrets/actions/set-secret.js +223 -0
  2220. package/packages/typescript/src/features/secrets/crypto/encryption.d.ts +184 -0
  2221. package/packages/typescript/src/features/secrets/crypto/encryption.d.ts.map +1 -0
  2222. package/packages/typescript/src/features/secrets/crypto/encryption.js +373 -0
  2223. package/packages/typescript/src/features/secrets/crypto/index.d.ts +5 -0
  2224. package/packages/typescript/src/features/secrets/crypto/index.d.ts.map +1 -0
  2225. package/packages/typescript/src/features/secrets/crypto/index.js +16 -0
  2226. package/packages/typescript/src/features/secrets/onboarding/action.d.ts +12 -0
  2227. package/packages/typescript/src/features/secrets/onboarding/action.d.ts.map +1 -0
  2228. package/packages/typescript/src/features/secrets/onboarding/action.js +337 -0
  2229. package/packages/typescript/src/features/secrets/onboarding/config.d.ts +99 -0
  2230. package/packages/typescript/src/features/secrets/onboarding/config.d.ts.map +1 -0
  2231. package/packages/typescript/src/features/secrets/onboarding/config.js +240 -0
  2232. package/packages/typescript/src/features/secrets/onboarding/index.d.ts +13 -0
  2233. package/packages/typescript/src/features/secrets/onboarding/index.d.ts.map +1 -0
  2234. package/packages/typescript/src/features/secrets/onboarding/index.js +12 -0
  2235. package/packages/typescript/src/features/secrets/onboarding/provider.d.ts +16 -0
  2236. package/packages/typescript/src/features/secrets/onboarding/provider.d.ts.map +1 -0
  2237. package/packages/typescript/src/features/secrets/onboarding/provider.js +231 -0
  2238. package/packages/typescript/src/features/secrets/onboarding/service.d.ts +134 -0
  2239. package/packages/typescript/src/features/secrets/onboarding/service.d.ts.map +1 -0
  2240. package/packages/typescript/src/features/secrets/onboarding/service.js +436 -0
  2241. package/packages/typescript/src/features/secrets/providers/index.d.ts +5 -0
  2242. package/packages/typescript/src/features/secrets/providers/index.d.ts.map +1 -0
  2243. package/packages/typescript/src/features/secrets/providers/index.js +4 -0
  2244. package/packages/typescript/src/features/secrets/providers/secrets-status.d.ts +22 -0
  2245. package/packages/typescript/src/features/secrets/providers/secrets-status.d.ts.map +1 -0
  2246. package/packages/typescript/src/features/secrets/providers/secrets-status.js +160 -0
  2247. package/packages/typescript/src/features/secrets/services/plugin-activator.d.ts +182 -0
  2248. package/packages/typescript/src/features/secrets/services/plugin-activator.d.ts.map +1 -0
  2249. package/packages/typescript/src/features/secrets/services/plugin-activator.js +617 -0
  2250. package/packages/typescript/src/features/secrets/services/secrets.d.ts +183 -0
  2251. package/packages/typescript/src/features/secrets/services/secrets.d.ts.map +1 -0
  2252. package/packages/typescript/src/features/secrets/services/secrets.js +566 -0
  2253. package/packages/typescript/src/features/secrets/storage/character-store.d.ts +63 -0
  2254. package/packages/typescript/src/features/secrets/storage/character-store.d.ts.map +1 -0
  2255. package/packages/typescript/src/features/secrets/storage/character-store.js +265 -0
  2256. package/packages/typescript/src/features/secrets/storage/component-store.d.ts +47 -0
  2257. package/packages/typescript/src/features/secrets/storage/component-store.d.ts.map +1 -0
  2258. package/packages/typescript/src/features/secrets/storage/component-store.js +264 -0
  2259. package/packages/typescript/src/features/secrets/storage/index.d.ts +10 -0
  2260. package/packages/typescript/src/features/secrets/storage/index.d.ts.map +1 -0
  2261. package/packages/typescript/src/features/secrets/storage/index.js +8 -0
  2262. package/packages/typescript/src/features/secrets/storage/interface.d.ts +52 -0
  2263. package/packages/typescript/src/features/secrets/storage/interface.d.ts.map +1 -0
  2264. package/packages/typescript/src/features/secrets/storage/interface.js +92 -0
  2265. package/packages/typescript/src/features/secrets/storage/memory-store.d.ts +44 -0
  2266. package/packages/typescript/src/features/secrets/storage/memory-store.d.ts.map +1 -0
  2267. package/packages/typescript/src/features/secrets/storage/memory-store.js +142 -0
  2268. package/packages/typescript/src/features/secrets/storage/world-store.d.ts +52 -0
  2269. package/packages/typescript/src/features/secrets/storage/world-store.d.ts.map +1 -0
  2270. package/packages/typescript/src/features/secrets/storage/world-store.js +292 -0
  2271. package/packages/typescript/src/features/secrets/types.d.ts +438 -0
  2272. package/packages/typescript/src/features/secrets/types.d.ts.map +1 -0
  2273. package/packages/typescript/src/features/secrets/types.js +57 -0
  2274. package/packages/typescript/src/features/secrets/validation.d.ts +33 -0
  2275. package/packages/typescript/src/features/secrets/validation.d.ts.map +1 -0
  2276. package/packages/typescript/src/features/secrets/validation.js +389 -0
  2277. package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts +275 -0
  2278. package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts.map +1 -0
  2279. package/packages/typescript/src/features/trajectories/TrajectoriesService.js +1401 -0
  2280. package/packages/typescript/src/features/trajectories/action-interceptor.d.ts +23 -0
  2281. package/packages/typescript/src/features/trajectories/action-interceptor.d.ts.map +1 -0
  2282. package/packages/typescript/src/features/trajectories/action-interceptor.js +178 -0
  2283. package/packages/typescript/src/features/trajectories/art-format.d.ts +32 -0
  2284. package/packages/typescript/src/features/trajectories/art-format.d.ts.map +1 -0
  2285. package/packages/typescript/src/features/trajectories/art-format.js +221 -0
  2286. package/packages/typescript/src/features/trajectories/export.d.ts +40 -0
  2287. package/packages/typescript/src/features/trajectories/export.d.ts.map +1 -0
  2288. package/packages/typescript/src/features/trajectories/export.js +99 -0
  2289. package/packages/typescript/src/features/trajectories/game-rewards.d.ts +14 -0
  2290. package/packages/typescript/src/features/trajectories/game-rewards.d.ts.map +1 -0
  2291. package/packages/typescript/src/features/trajectories/game-rewards.js +20 -0
  2292. package/packages/typescript/src/features/trajectories/index.d.ts +24 -0
  2293. package/packages/typescript/src/features/trajectories/index.d.ts.map +1 -0
  2294. package/packages/typescript/src/features/trajectories/index.js +253 -0
  2295. package/packages/typescript/src/features/trajectories/integration.d.ts +59 -0
  2296. package/packages/typescript/src/features/trajectories/integration.d.ts.map +1 -0
  2297. package/packages/typescript/src/features/trajectories/integration.js +83 -0
  2298. package/packages/typescript/src/features/trajectories/reward-service.d.ts +24 -0
  2299. package/packages/typescript/src/features/trajectories/reward-service.d.ts.map +1 -0
  2300. package/packages/typescript/src/features/trajectories/reward-service.js +89 -0
  2301. package/packages/typescript/src/features/trajectories/types.d.ts +243 -0
  2302. package/packages/typescript/src/features/trajectories/types.d.ts.map +1 -0
  2303. package/packages/typescript/src/features/trajectories/types.js +1 -0
  2304. package/packages/typescript/src/features/trust/actions/evaluateTrust.d.ts +3 -0
  2305. package/packages/typescript/src/features/trust/actions/evaluateTrust.d.ts.map +1 -0
  2306. package/packages/typescript/src/features/trust/actions/evaluateTrust.js +225 -0
  2307. package/packages/typescript/src/features/trust/actions/hasTrustEngine.d.ts +3 -0
  2308. package/packages/typescript/src/features/trust/actions/hasTrustEngine.d.ts.map +1 -0
  2309. package/packages/typescript/src/features/trust/actions/hasTrustEngine.js +3 -0
  2310. package/packages/typescript/src/features/trust/actions/index.d.ts +6 -0
  2311. package/packages/typescript/src/features/trust/actions/index.d.ts.map +1 -0
  2312. package/packages/typescript/src/features/trust/actions/index.js +5 -0
  2313. package/packages/typescript/src/features/trust/actions/recordTrustInteraction.d.ts +3 -0
  2314. package/packages/typescript/src/features/trust/actions/recordTrustInteraction.d.ts.map +1 -0
  2315. package/packages/typescript/src/features/trust/actions/recordTrustInteraction.js +189 -0
  2316. package/packages/typescript/src/features/trust/actions/requestElevation.d.ts +3 -0
  2317. package/packages/typescript/src/features/trust/actions/requestElevation.d.ts.map +1 -0
  2318. package/packages/typescript/src/features/trust/actions/requestElevation.js +165 -0
  2319. package/packages/typescript/src/features/trust/actions/roles.d.ts +3 -0
  2320. package/packages/typescript/src/features/trust/actions/roles.d.ts.map +1 -0
  2321. package/packages/typescript/src/features/trust/actions/roles.js +295 -0
  2322. package/packages/typescript/src/features/trust/actions/settings.d.ts +5 -0
  2323. package/packages/typescript/src/features/trust/actions/settings.d.ts.map +1 -0
  2324. package/packages/typescript/src/features/trust/actions/settings.js +603 -0
  2325. package/packages/typescript/src/features/trust/evaluators/index.d.ts +4 -0
  2326. package/packages/typescript/src/features/trust/evaluators/index.d.ts.map +1 -0
  2327. package/packages/typescript/src/features/trust/evaluators/index.js +3 -0
  2328. package/packages/typescript/src/features/trust/evaluators/reflection.d.ts +3 -0
  2329. package/packages/typescript/src/features/trust/evaluators/reflection.d.ts.map +1 -0
  2330. package/packages/typescript/src/features/trust/evaluators/reflection.js +290 -0
  2331. package/packages/typescript/src/features/trust/evaluators/securityEvaluator.d.ts +3 -0
  2332. package/packages/typescript/src/features/trust/evaluators/securityEvaluator.d.ts.map +1 -0
  2333. package/packages/typescript/src/features/trust/evaluators/securityEvaluator.js +270 -0
  2334. package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.d.ts +3 -0
  2335. package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.d.ts.map +1 -0
  2336. package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.js +201 -0
  2337. package/packages/typescript/src/features/trust/index.d.ts +72 -0
  2338. package/packages/typescript/src/features/trust/index.d.ts.map +1 -0
  2339. package/packages/typescript/src/features/trust/index.js +213 -0
  2340. package/packages/typescript/src/features/trust/providers/adminTrust.d.ts +3 -0
  2341. package/packages/typescript/src/features/trust/providers/adminTrust.d.ts.map +1 -0
  2342. package/packages/typescript/src/features/trust/providers/adminTrust.js +49 -0
  2343. package/packages/typescript/src/features/trust/providers/index.d.ts +6 -0
  2344. package/packages/typescript/src/features/trust/providers/index.d.ts.map +1 -0
  2345. package/packages/typescript/src/features/trust/providers/index.js +5 -0
  2346. package/packages/typescript/src/features/trust/providers/roles.d.ts +4 -0
  2347. package/packages/typescript/src/features/trust/providers/roles.d.ts.map +1 -0
  2348. package/packages/typescript/src/features/trust/providers/roles.js +142 -0
  2349. package/packages/typescript/src/features/trust/providers/securityStatus.d.ts +3 -0
  2350. package/packages/typescript/src/features/trust/providers/securityStatus.d.ts.map +1 -0
  2351. package/packages/typescript/src/features/trust/providers/securityStatus.js +110 -0
  2352. package/packages/typescript/src/features/trust/providers/settings.d.ts +3 -0
  2353. package/packages/typescript/src/features/trust/providers/settings.d.ts.map +1 -0
  2354. package/packages/typescript/src/features/trust/providers/settings.js +212 -0
  2355. package/packages/typescript/src/features/trust/providers/trustProfile.d.ts +3 -0
  2356. package/packages/typescript/src/features/trust/providers/trustProfile.d.ts.map +1 -0
  2357. package/packages/typescript/src/features/trust/providers/trustProfile.js +68 -0
  2358. package/packages/typescript/src/features/trust/schema.d.ts +1170 -0
  2359. package/packages/typescript/src/features/trust/schema.d.ts.map +1 -0
  2360. package/packages/typescript/src/features/trust/schema.js +108 -0
  2361. package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.d.ts +40 -0
  2362. package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.d.ts.map +1 -0
  2363. package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.js +317 -0
  2364. package/packages/typescript/src/features/trust/services/CredentialProtector.d.ts +62 -0
  2365. package/packages/typescript/src/features/trust/services/CredentialProtector.d.ts.map +1 -0
  2366. package/packages/typescript/src/features/trust/services/CredentialProtector.js +417 -0
  2367. package/packages/typescript/src/features/trust/services/SecurityModule.d.ts +142 -0
  2368. package/packages/typescript/src/features/trust/services/SecurityModule.d.ts.map +1 -0
  2369. package/packages/typescript/src/features/trust/services/SecurityModule.js +1057 -0
  2370. package/packages/typescript/src/features/trust/services/SecurityStore.d.ts +53 -0
  2371. package/packages/typescript/src/features/trust/services/SecurityStore.d.ts.map +1 -0
  2372. package/packages/typescript/src/features/trust/services/SecurityStore.js +123 -0
  2373. package/packages/typescript/src/features/trust/services/TrustEngine.d.ts +81 -0
  2374. package/packages/typescript/src/features/trust/services/TrustEngine.d.ts.map +1 -0
  2375. package/packages/typescript/src/features/trust/services/TrustEngine.js +621 -0
  2376. package/packages/typescript/src/features/trust/services/adminContext.d.ts +3 -0
  2377. package/packages/typescript/src/features/trust/services/adminContext.d.ts.map +1 -0
  2378. package/packages/typescript/src/features/trust/services/adminContext.js +32 -0
  2379. package/packages/typescript/src/features/trust/services/db.d.ts +12 -0
  2380. package/packages/typescript/src/features/trust/services/db.d.ts.map +1 -0
  2381. package/packages/typescript/src/features/trust/services/db.js +10 -0
  2382. package/packages/typescript/src/features/trust/types/permissions.d.ts +185 -0
  2383. package/packages/typescript/src/features/trust/types/permissions.d.ts.map +1 -0
  2384. package/packages/typescript/src/features/trust/types/permissions.js +58 -0
  2385. package/packages/typescript/src/features/trust/types/security.d.ts +114 -0
  2386. package/packages/typescript/src/features/trust/types/security.d.ts.map +1 -0
  2387. package/packages/typescript/src/features/trust/types/security.js +15 -0
  2388. package/packages/typescript/src/features/trust/types/trust.d.ts +179 -0
  2389. package/packages/typescript/src/features/trust/types/trust.d.ts.map +1 -0
  2390. package/packages/typescript/src/features/trust/types/trust.js +25 -0
  2391. package/packages/typescript/src/generated/action-docs.d.ts +2605 -0
  2392. package/packages/typescript/src/generated/action-docs.d.ts.map +1 -0
  2393. package/packages/typescript/src/generated/action-docs.js +3786 -0
  2394. package/packages/typescript/src/generated/spec-helpers.d.ts +49 -0
  2395. package/packages/typescript/src/generated/spec-helpers.d.ts.map +1 -0
  2396. package/packages/typescript/src/generated/spec-helpers.js +78 -0
  2397. package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts +1056 -0
  2398. package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts.map +1 -0
  2399. package/packages/typescript/src/i18n/generated/validation-keyword-data.js +1056 -0
  2400. package/packages/typescript/src/i18n/validation-keywords.d.ts +25 -0
  2401. package/packages/typescript/src/i18n/validation-keywords.d.ts.map +1 -0
  2402. package/packages/typescript/src/i18n/validation-keywords.js +112 -0
  2403. package/packages/typescript/src/index.d.ts +12 -0
  2404. package/packages/typescript/src/index.d.ts.map +1 -0
  2405. package/packages/typescript/src/index.js +13 -0
  2406. package/packages/typescript/src/index.node.d.ts +78 -0
  2407. package/packages/typescript/src/index.node.d.ts.map +1 -0
  2408. package/packages/typescript/src/index.node.js +107 -0
  2409. package/packages/typescript/src/logger.d.ts +121 -0
  2410. package/packages/typescript/src/logger.d.ts.map +1 -0
  2411. package/packages/typescript/src/logger.js +1023 -0
  2412. package/packages/typescript/src/markdown/chunk.d.ts +50 -0
  2413. package/packages/typescript/src/markdown/chunk.d.ts.map +1 -0
  2414. package/packages/typescript/src/markdown/chunk.js +268 -0
  2415. package/packages/typescript/src/markdown/code-spans.d.ts +42 -0
  2416. package/packages/typescript/src/markdown/code-spans.d.ts.map +1 -0
  2417. package/packages/typescript/src/markdown/code-spans.js +89 -0
  2418. package/packages/typescript/src/markdown/fences.d.ts +50 -0
  2419. package/packages/typescript/src/markdown/fences.d.ts.map +1 -0
  2420. package/packages/typescript/src/markdown/fences.js +90 -0
  2421. package/packages/typescript/src/markdown/frontmatter.d.ts +24 -0
  2422. package/packages/typescript/src/markdown/frontmatter.d.ts.map +1 -0
  2423. package/packages/typescript/src/markdown/frontmatter.js +151 -0
  2424. package/packages/typescript/src/markdown/index.d.ts +18 -0
  2425. package/packages/typescript/src/markdown/index.d.ts.map +1 -0
  2426. package/packages/typescript/src/markdown/index.js +17 -0
  2427. package/packages/typescript/src/markdown/ir.d.ts +101 -0
  2428. package/packages/typescript/src/markdown/ir.d.ts.map +1 -0
  2429. package/packages/typescript/src/markdown/ir.js +789 -0
  2430. package/packages/typescript/src/media/fetch.d.ts +39 -0
  2431. package/packages/typescript/src/media/fetch.d.ts.map +1 -0
  2432. package/packages/typescript/src/media/fetch.js +205 -0
  2433. package/packages/typescript/src/media/index.d.ts +8 -0
  2434. package/packages/typescript/src/media/index.d.ts.map +1 -0
  2435. package/packages/typescript/src/media/index.js +7 -0
  2436. package/packages/typescript/src/media/mime.d.ts +51 -0
  2437. package/packages/typescript/src/media/mime.d.ts.map +1 -0
  2438. package/packages/typescript/src/media/mime.js +225 -0
  2439. package/packages/typescript/src/memory.d.ts +40 -0
  2440. package/packages/typescript/src/memory.d.ts.map +1 -0
  2441. package/packages/typescript/src/memory.js +58 -0
  2442. package/packages/typescript/src/network/fetch-guard.d.ts +34 -0
  2443. package/packages/typescript/src/network/fetch-guard.d.ts.map +1 -0
  2444. package/packages/typescript/src/network/fetch-guard.js +136 -0
  2445. package/packages/typescript/src/network/index.d.ts +11 -0
  2446. package/packages/typescript/src/network/index.d.ts.map +1 -0
  2447. package/packages/typescript/src/network/index.js +10 -0
  2448. package/packages/typescript/src/network/ssrf.d.ts +58 -0
  2449. package/packages/typescript/src/network/ssrf.d.ts.map +1 -0
  2450. package/packages/typescript/src/network/ssrf.js +252 -0
  2451. package/packages/typescript/src/plugin-lifecycle.d.ts +16 -0
  2452. package/packages/typescript/src/plugin-lifecycle.d.ts.map +1 -0
  2453. package/packages/typescript/src/plugin-lifecycle.js +590 -0
  2454. package/packages/typescript/src/plugin.d.ts +13 -0
  2455. package/packages/typescript/src/plugin.d.ts.map +1 -0
  2456. package/packages/typescript/src/plugin.js +334 -0
  2457. package/packages/typescript/src/plugins/index.d.ts +9 -0
  2458. package/packages/typescript/src/plugins/index.d.ts.map +1 -0
  2459. package/packages/typescript/src/plugins/index.js +8 -0
  2460. package/packages/typescript/src/plugins/native-features.d.ts +14 -0
  2461. package/packages/typescript/src/plugins/native-features.d.ts.map +1 -0
  2462. package/packages/typescript/src/plugins/native-features.js +59 -0
  2463. package/packages/typescript/src/prompts.d.ts +88 -0
  2464. package/packages/typescript/src/prompts.d.ts.map +1 -0
  2465. package/packages/typescript/src/prompts.js +1123 -0
  2466. package/packages/typescript/src/providers/onboarding-progress.d.ts +19 -0
  2467. package/packages/typescript/src/providers/onboarding-progress.d.ts.map +1 -0
  2468. package/packages/typescript/src/providers/onboarding-progress.js +268 -0
  2469. package/packages/typescript/src/providers/skill-eligibility.d.ts +28 -0
  2470. package/packages/typescript/src/providers/skill-eligibility.d.ts.map +1 -0
  2471. package/packages/typescript/src/providers/skill-eligibility.js +179 -0
  2472. package/packages/typescript/src/provisioning.d.ts +54 -0
  2473. package/packages/typescript/src/provisioning.d.ts.map +1 -0
  2474. package/packages/typescript/src/provisioning.js +209 -0
  2475. package/packages/typescript/src/roles.d.ts +70 -0
  2476. package/packages/typescript/src/roles.d.ts.map +1 -0
  2477. package/packages/typescript/src/roles.js +544 -0
  2478. package/packages/typescript/src/runtime-composition.d.ts +129 -0
  2479. package/packages/typescript/src/runtime-composition.d.ts.map +1 -0
  2480. package/packages/typescript/src/runtime-composition.js +335 -0
  2481. package/packages/typescript/src/runtime.d.ts +877 -0
  2482. package/packages/typescript/src/runtime.d.ts.map +1 -0
  2483. package/packages/typescript/src/runtime.js +5277 -0
  2484. package/packages/typescript/src/schemas/agent.d.ts +7 -0
  2485. package/packages/typescript/src/schemas/agent.d.ts.map +1 -0
  2486. package/packages/typescript/src/schemas/agent.js +112 -0
  2487. package/packages/typescript/src/schemas/cache.d.ts +7 -0
  2488. package/packages/typescript/src/schemas/cache.d.ts.map +1 -0
  2489. package/packages/typescript/src/schemas/cache.js +55 -0
  2490. package/packages/typescript/src/schemas/channel-participant.d.ts +7 -0
  2491. package/packages/typescript/src/schemas/channel-participant.d.ts.map +1 -0
  2492. package/packages/typescript/src/schemas/channel-participant.js +49 -0
  2493. package/packages/typescript/src/schemas/channel.d.ts +7 -0
  2494. package/packages/typescript/src/schemas/channel.d.ts.map +1 -0
  2495. package/packages/typescript/src/schemas/channel.js +94 -0
  2496. package/packages/typescript/src/schemas/character.d.ts +445 -0
  2497. package/packages/typescript/src/schemas/character.d.ts.map +1 -0
  2498. package/packages/typescript/src/schemas/character.js +309 -0
  2499. package/packages/typescript/src/schemas/component.d.ts +7 -0
  2500. package/packages/typescript/src/schemas/component.d.ts.map +1 -0
  2501. package/packages/typescript/src/schemas/component.js +156 -0
  2502. package/packages/typescript/src/schemas/embedding.d.ts +7 -0
  2503. package/packages/typescript/src/schemas/embedding.d.ts.map +1 -0
  2504. package/packages/typescript/src/schemas/embedding.js +89 -0
  2505. package/packages/typescript/src/schemas/entity.d.ts +7 -0
  2506. package/packages/typescript/src/schemas/entity.d.ts.map +1 -0
  2507. package/packages/typescript/src/schemas/entity.js +69 -0
  2508. package/packages/typescript/src/schemas/index.d.ts +75 -0
  2509. package/packages/typescript/src/schemas/index.d.ts.map +1 -0
  2510. package/packages/typescript/src/schemas/index.js +74 -0
  2511. package/packages/typescript/src/schemas/log.d.ts +6 -0
  2512. package/packages/typescript/src/schemas/log.d.ts.map +1 -0
  2513. package/packages/typescript/src/schemas/log.js +93 -0
  2514. package/packages/typescript/src/schemas/memory.d.ts +7 -0
  2515. package/packages/typescript/src/schemas/memory.d.ts.map +1 -0
  2516. package/packages/typescript/src/schemas/memory.js +167 -0
  2517. package/packages/typescript/src/schemas/message-server-agent.d.ts +7 -0
  2518. package/packages/typescript/src/schemas/message-server-agent.d.ts.map +1 -0
  2519. package/packages/typescript/src/schemas/message-server-agent.js +58 -0
  2520. package/packages/typescript/src/schemas/message-server.d.ts +6 -0
  2521. package/packages/typescript/src/schemas/message-server.d.ts.map +1 -0
  2522. package/packages/typescript/src/schemas/message-server.js +62 -0
  2523. package/packages/typescript/src/schemas/message.d.ts +7 -0
  2524. package/packages/typescript/src/schemas/message.d.ts.map +1 -0
  2525. package/packages/typescript/src/schemas/message.js +106 -0
  2526. package/packages/typescript/src/schemas/pairing-allowlist.d.ts +7 -0
  2527. package/packages/typescript/src/schemas/pairing-allowlist.d.ts.map +1 -0
  2528. package/packages/typescript/src/schemas/pairing-allowlist.js +76 -0
  2529. package/packages/typescript/src/schemas/pairing-request.d.ts +7 -0
  2530. package/packages/typescript/src/schemas/pairing-request.d.ts.map +1 -0
  2531. package/packages/typescript/src/schemas/pairing-request.js +96 -0
  2532. package/packages/typescript/src/schemas/participant.d.ts +6 -0
  2533. package/packages/typescript/src/schemas/participant.d.ts.map +1 -0
  2534. package/packages/typescript/src/schemas/participant.js +91 -0
  2535. package/packages/typescript/src/schemas/relationship.d.ts +7 -0
  2536. package/packages/typescript/src/schemas/relationship.d.ts.map +1 -0
  2537. package/packages/typescript/src/schemas/relationship.js +102 -0
  2538. package/packages/typescript/src/schemas/room.d.ts +6 -0
  2539. package/packages/typescript/src/schemas/room.d.ts.map +1 -0
  2540. package/packages/typescript/src/schemas/room.js +86 -0
  2541. package/packages/typescript/src/schemas/server.d.ts +7 -0
  2542. package/packages/typescript/src/schemas/server.d.ts.map +1 -0
  2543. package/packages/typescript/src/schemas/server.js +33 -0
  2544. package/packages/typescript/src/schemas/task.d.ts +6 -0
  2545. package/packages/typescript/src/schemas/task.d.ts.map +1 -0
  2546. package/packages/typescript/src/schemas/task.js +95 -0
  2547. package/packages/typescript/src/schemas/world.d.ts +6 -0
  2548. package/packages/typescript/src/schemas/world.d.ts.map +1 -0
  2549. package/packages/typescript/src/schemas/world.js +64 -0
  2550. package/packages/typescript/src/search.d.ts +381 -0
  2551. package/packages/typescript/src/search.d.ts.map +1 -0
  2552. package/packages/typescript/src/search.js +1580 -0
  2553. package/packages/typescript/src/secrets.d.ts +6 -0
  2554. package/packages/typescript/src/secrets.d.ts.map +1 -0
  2555. package/packages/typescript/src/secrets.js +28 -0
  2556. package/packages/typescript/src/security/external-content.d.ts +96 -0
  2557. package/packages/typescript/src/security/external-content.d.ts.map +1 -0
  2558. package/packages/typescript/src/security/external-content.js +252 -0
  2559. package/packages/typescript/src/security/index.d.ts +12 -0
  2560. package/packages/typescript/src/security/index.d.ts.map +1 -0
  2561. package/packages/typescript/src/security/index.js +13 -0
  2562. package/packages/typescript/src/security/redact.d.ts +111 -0
  2563. package/packages/typescript/src/security/redact.d.ts.map +1 -0
  2564. package/packages/typescript/src/security/redact.js +254 -0
  2565. package/packages/typescript/src/services/agentEvent.d.ts +297 -0
  2566. package/packages/typescript/src/services/agentEvent.d.ts.map +1 -0
  2567. package/packages/typescript/src/services/agentEvent.js +422 -0
  2568. package/packages/typescript/src/services/approval.d.ts +169 -0
  2569. package/packages/typescript/src/services/approval.d.ts.map +1 -0
  2570. package/packages/typescript/src/services/approval.js +399 -0
  2571. package/packages/typescript/src/services/embedding.d.ts +29 -0
  2572. package/packages/typescript/src/services/embedding.d.ts.map +1 -0
  2573. package/packages/typescript/src/services/embedding.js +211 -0
  2574. package/packages/typescript/src/services/followUp.d.ts +48 -0
  2575. package/packages/typescript/src/services/followUp.d.ts.map +1 -0
  2576. package/packages/typescript/src/services/followUp.js +333 -0
  2577. package/packages/typescript/src/services/hook.d.ts +85 -0
  2578. package/packages/typescript/src/services/hook.d.ts.map +1 -0
  2579. package/packages/typescript/src/services/hook.js +396 -0
  2580. package/packages/typescript/src/services/message.d.ts +93 -0
  2581. package/packages/typescript/src/services/message.d.ts.map +1 -0
  2582. package/packages/typescript/src/services/message.js +3163 -0
  2583. package/packages/typescript/src/services/onboarding-cli.d.ts +240 -0
  2584. package/packages/typescript/src/services/onboarding-cli.d.ts.map +1 -0
  2585. package/packages/typescript/src/services/onboarding-cli.js +688 -0
  2586. package/packages/typescript/src/services/onboarding-rpc.d.ts +225 -0
  2587. package/packages/typescript/src/services/onboarding-rpc.d.ts.map +1 -0
  2588. package/packages/typescript/src/services/onboarding-rpc.js +318 -0
  2589. package/packages/typescript/src/services/onboarding-state.d.ts +155 -0
  2590. package/packages/typescript/src/services/onboarding-state.d.ts.map +1 -0
  2591. package/packages/typescript/src/services/onboarding-state.js +706 -0
  2592. package/packages/typescript/src/services/pairing-integration.d.ts +96 -0
  2593. package/packages/typescript/src/services/pairing-integration.d.ts.map +1 -0
  2594. package/packages/typescript/src/services/pairing-integration.js +145 -0
  2595. package/packages/typescript/src/services/pairing-migration.d.ts +105 -0
  2596. package/packages/typescript/src/services/pairing-migration.d.ts.map +1 -0
  2597. package/packages/typescript/src/services/pairing-migration.js +283 -0
  2598. package/packages/typescript/src/services/pairing.d.ts +80 -0
  2599. package/packages/typescript/src/services/pairing.d.ts.map +1 -0
  2600. package/packages/typescript/src/services/pairing.js +253 -0
  2601. package/packages/typescript/src/services/plugin-hooks.d.ts +112 -0
  2602. package/packages/typescript/src/services/plugin-hooks.d.ts.map +1 -0
  2603. package/packages/typescript/src/services/plugin-hooks.js +163 -0
  2604. package/packages/typescript/src/services/relationships.d.ts +125 -0
  2605. package/packages/typescript/src/services/relationships.d.ts.map +1 -0
  2606. package/packages/typescript/src/services/relationships.js +637 -0
  2607. package/packages/typescript/src/services/task-scheduler.d.ts +28 -0
  2608. package/packages/typescript/src/services/task-scheduler.d.ts.map +1 -0
  2609. package/packages/typescript/src/services/task-scheduler.js +89 -0
  2610. package/packages/typescript/src/services/task.d.ts +130 -0
  2611. package/packages/typescript/src/services/task.d.ts.map +1 -0
  2612. package/packages/typescript/src/services/task.js +536 -0
  2613. package/packages/typescript/src/services/tool-policy.d.ts +186 -0
  2614. package/packages/typescript/src/services/tool-policy.d.ts.map +1 -0
  2615. package/packages/typescript/src/services/tool-policy.js +332 -0
  2616. package/packages/typescript/src/services/trajectories.d.ts +25 -0
  2617. package/packages/typescript/src/services/trajectories.d.ts.map +1 -0
  2618. package/packages/typescript/src/services/trajectories.js +1 -0
  2619. package/packages/typescript/src/services.d.ts +61 -0
  2620. package/packages/typescript/src/services.d.ts.map +1 -0
  2621. package/packages/typescript/src/services.js +99 -0
  2622. package/packages/typescript/src/sessions/index.d.ts +17 -0
  2623. package/packages/typescript/src/sessions/index.d.ts.map +1 -0
  2624. package/packages/typescript/src/sessions/index.js +29 -0
  2625. package/packages/typescript/src/sessions/provider.d.ts +71 -0
  2626. package/packages/typescript/src/sessions/provider.d.ts.map +1 -0
  2627. package/packages/typescript/src/sessions/provider.js +243 -0
  2628. package/packages/typescript/src/sessions/session-key.d.ts +201 -0
  2629. package/packages/typescript/src/sessions/session-key.d.ts.map +1 -0
  2630. package/packages/typescript/src/sessions/session-key.js +396 -0
  2631. package/packages/typescript/src/sessions/types.d.ts +197 -0
  2632. package/packages/typescript/src/sessions/types.d.ts.map +1 -0
  2633. package/packages/typescript/src/sessions/types.js +68 -0
  2634. package/packages/typescript/src/settings.d.ts +99 -0
  2635. package/packages/typescript/src/settings.d.ts.map +1 -0
  2636. package/packages/typescript/src/settings.js +409 -0
  2637. package/packages/typescript/src/should-respond.d.ts +2 -0
  2638. package/packages/typescript/src/should-respond.d.ts.map +1 -0
  2639. package/packages/typescript/src/should-respond.js +16 -0
  2640. package/packages/typescript/src/streaming-context.d.ts +79 -0
  2641. package/packages/typescript/src/streaming-context.d.ts.map +1 -0
  2642. package/packages/typescript/src/streaming-context.js +115 -0
  2643. package/packages/typescript/src/trajectory-context.d.ts +26 -0
  2644. package/packages/typescript/src/trajectory-context.d.ts.map +1 -0
  2645. package/packages/typescript/src/trajectory-context.js +85 -0
  2646. package/packages/typescript/src/trajectory-utils.d.ts +49 -0
  2647. package/packages/typescript/src/trajectory-utils.d.ts.map +1 -0
  2648. package/packages/typescript/src/trajectory-utils.js +105 -0
  2649. package/packages/typescript/src/types/agent.d.ts +62 -0
  2650. package/packages/typescript/src/types/agent.d.ts.map +1 -0
  2651. package/packages/typescript/src/types/agent.js +5 -0
  2652. package/packages/typescript/src/types/agentEvent.d.ts +258 -0
  2653. package/packages/typescript/src/types/agentEvent.d.ts.map +1 -0
  2654. package/packages/typescript/src/types/agentEvent.js +11 -0
  2655. package/packages/typescript/src/types/channel-config.d.ts +167 -0
  2656. package/packages/typescript/src/types/channel-config.d.ts.map +1 -0
  2657. package/packages/typescript/src/types/channel-config.js +7 -0
  2658. package/packages/typescript/src/types/components.d.ts +346 -0
  2659. package/packages/typescript/src/types/components.d.ts.map +1 -0
  2660. package/packages/typescript/src/types/components.js +1 -0
  2661. package/packages/typescript/src/types/database.d.ts +1079 -0
  2662. package/packages/typescript/src/types/database.d.ts.map +1 -0
  2663. package/packages/typescript/src/types/database.js +9 -0
  2664. package/packages/typescript/src/types/environment.d.ts +73 -0
  2665. package/packages/typescript/src/types/environment.d.ts.map +1 -0
  2666. package/packages/typescript/src/types/environment.js +16 -0
  2667. package/packages/typescript/src/types/events.d.ts +386 -0
  2668. package/packages/typescript/src/types/events.d.ts.map +1 -0
  2669. package/packages/typescript/src/types/events.js +83 -0
  2670. package/packages/typescript/src/types/generated/eliza/v1/agent_pb.d.ts +400 -0
  2671. package/packages/typescript/src/types/generated/eliza/v1/agent_pb.d.ts.map +1 -0
  2672. package/packages/typescript/src/types/generated/eliza/v1/agent_pb.js +72 -0
  2673. package/packages/typescript/src/types/generated/eliza/v1/components_pb.d.ts +364 -0
  2674. package/packages/typescript/src/types/generated/eliza/v1/components_pb.d.ts.map +1 -0
  2675. package/packages/typescript/src/types/generated/eliza/v1/components_pb.js +68 -0
  2676. package/packages/typescript/src/types/generated/eliza/v1/database_pb.d.ts +694 -0
  2677. package/packages/typescript/src/types/generated/eliza/v1/database_pb.d.ts.map +1 -0
  2678. package/packages/typescript/src/types/generated/eliza/v1/database_pb.js +172 -0
  2679. package/packages/typescript/src/types/generated/eliza/v1/environment_pb.d.ts +299 -0
  2680. package/packages/typescript/src/types/generated/eliza/v1/environment_pb.d.ts.map +1 -0
  2681. package/packages/typescript/src/types/generated/eliza/v1/environment_pb.js +52 -0
  2682. package/packages/typescript/src/types/generated/eliza/v1/events_pb.d.ts +746 -0
  2683. package/packages/typescript/src/types/generated/eliza/v1/events_pb.d.ts.map +1 -0
  2684. package/packages/typescript/src/types/generated/eliza/v1/events_pb.js +357 -0
  2685. package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.d.ts +799 -0
  2686. package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.d.ts.map +1 -0
  2687. package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.js +172 -0
  2688. package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.d.ts +63 -0
  2689. package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.d.ts.map +1 -0
  2690. package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.js +18 -0
  2691. package/packages/typescript/src/types/generated/eliza/v1/memory_pb.d.ts +290 -0
  2692. package/packages/typescript/src/types/generated/eliza/v1/memory_pb.d.ts.map +1 -0
  2693. package/packages/typescript/src/types/generated/eliza/v1/memory_pb.js +53 -0
  2694. package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.d.ts +160 -0
  2695. package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.d.ts.map +1 -0
  2696. package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.js +88 -0
  2697. package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.d.ts +214 -0
  2698. package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.d.ts.map +1 -0
  2699. package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.js +78 -0
  2700. package/packages/typescript/src/types/generated/eliza/v1/model_pb.d.ts +653 -0
  2701. package/packages/typescript/src/types/generated/eliza/v1/model_pb.d.ts.map +1 -0
  2702. package/packages/typescript/src/types/generated/eliza/v1/model_pb.js +237 -0
  2703. package/packages/typescript/src/types/generated/eliza/v1/payment_pb.d.ts +147 -0
  2704. package/packages/typescript/src/types/generated/eliza/v1/payment_pb.d.ts.map +1 -0
  2705. package/packages/typescript/src/types/generated/eliza/v1/payment_pb.js +27 -0
  2706. package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.d.ts +286 -0
  2707. package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.d.ts.map +1 -0
  2708. package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.js +86 -0
  2709. package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.d.ts +263 -0
  2710. package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.d.ts.map +1 -0
  2711. package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.js +38 -0
  2712. package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.d.ts +137 -0
  2713. package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.d.ts.map +1 -0
  2714. package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.js +27 -0
  2715. package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.d.ts +2687 -0
  2716. package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.d.ts.map +1 -0
  2717. package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.js +392 -0
  2718. package/packages/typescript/src/types/generated/eliza/v1/service_pb.d.ts +144 -0
  2719. package/packages/typescript/src/types/generated/eliza/v1/service_pb.d.ts.map +1 -0
  2720. package/packages/typescript/src/types/generated/eliza/v1/service_pb.js +99 -0
  2721. package/packages/typescript/src/types/generated/eliza/v1/settings_pb.d.ts +146 -0
  2722. package/packages/typescript/src/types/generated/eliza/v1/settings_pb.d.ts.map +1 -0
  2723. package/packages/typescript/src/types/generated/eliza/v1/settings_pb.js +32 -0
  2724. package/packages/typescript/src/types/generated/eliza/v1/state_pb.d.ts +259 -0
  2725. package/packages/typescript/src/types/generated/eliza/v1/state_pb.d.ts.map +1 -0
  2726. package/packages/typescript/src/types/generated/eliza/v1/state_pb.js +44 -0
  2727. package/packages/typescript/src/types/generated/eliza/v1/task_pb.d.ts +120 -0
  2728. package/packages/typescript/src/types/generated/eliza/v1/task_pb.d.ts.map +1 -0
  2729. package/packages/typescript/src/types/generated/eliza/v1/task_pb.js +53 -0
  2730. package/packages/typescript/src/types/generated/eliza/v1/tee_pb.d.ts +205 -0
  2731. package/packages/typescript/src/types/generated/eliza/v1/tee_pb.d.ts.map +1 -0
  2732. package/packages/typescript/src/types/generated/eliza/v1/tee_pb.js +89 -0
  2733. package/packages/typescript/src/types/generated/eliza/v1/testing_pb.d.ts +47 -0
  2734. package/packages/typescript/src/types/generated/eliza/v1/testing_pb.d.ts.map +1 -0
  2735. package/packages/typescript/src/types/generated/eliza/v1/testing_pb.js +16 -0
  2736. package/packages/typescript/src/types/hook.d.ts +338 -0
  2737. package/packages/typescript/src/types/hook.d.ts.map +1 -0
  2738. package/packages/typescript/src/types/hook.js +73 -0
  2739. package/packages/typescript/src/types/index.d.ts +38 -0
  2740. package/packages/typescript/src/types/index.d.ts.map +1 -0
  2741. package/packages/typescript/src/types/index.js +46 -0
  2742. package/packages/typescript/src/types/knowledge.d.ts +49 -0
  2743. package/packages/typescript/src/types/knowledge.d.ts.map +1 -0
  2744. package/packages/typescript/src/types/knowledge.js +1 -0
  2745. package/packages/typescript/src/types/memory-storage.d.ts +28 -0
  2746. package/packages/typescript/src/types/memory-storage.d.ts.map +1 -0
  2747. package/packages/typescript/src/types/memory-storage.js +13 -0
  2748. package/packages/typescript/src/types/memory.d.ts +438 -0
  2749. package/packages/typescript/src/types/memory.d.ts.map +1 -0
  2750. package/packages/typescript/src/types/memory.js +16 -0
  2751. package/packages/typescript/src/types/message-service.d.ts +169 -0
  2752. package/packages/typescript/src/types/message-service.d.ts.map +1 -0
  2753. package/packages/typescript/src/types/message-service.js +1 -0
  2754. package/packages/typescript/src/types/messaging.d.ts +358 -0
  2755. package/packages/typescript/src/types/messaging.d.ts.map +1 -0
  2756. package/packages/typescript/src/types/messaging.js +27 -0
  2757. package/packages/typescript/src/types/model.d.ts +697 -0
  2758. package/packages/typescript/src/types/model.d.ts.map +1 -0
  2759. package/packages/typescript/src/types/model.js +247 -0
  2760. package/packages/typescript/src/types/onboarding.d.ts +319 -0
  2761. package/packages/typescript/src/types/onboarding.d.ts.map +1 -0
  2762. package/packages/typescript/src/types/onboarding.js +97 -0
  2763. package/packages/typescript/src/types/pairing.d.ts +124 -0
  2764. package/packages/typescript/src/types/pairing.d.ts.map +1 -0
  2765. package/packages/typescript/src/types/pairing.js +32 -0
  2766. package/packages/typescript/src/types/payment.d.ts +45 -0
  2767. package/packages/typescript/src/types/payment.d.ts.map +1 -0
  2768. package/packages/typescript/src/types/payment.js +1 -0
  2769. package/packages/typescript/src/types/plugin-manifest.d.ts +381 -0
  2770. package/packages/typescript/src/types/plugin-manifest.d.ts.map +1 -0
  2771. package/packages/typescript/src/types/plugin-manifest.js +10 -0
  2772. package/packages/typescript/src/types/plugin-store.d.ts +173 -0
  2773. package/packages/typescript/src/types/plugin-store.d.ts.map +1 -0
  2774. package/packages/typescript/src/types/plugin-store.js +1 -0
  2775. package/packages/typescript/src/types/plugin.d.ts +325 -0
  2776. package/packages/typescript/src/types/plugin.d.ts.map +1 -0
  2777. package/packages/typescript/src/types/plugin.js +1 -0
  2778. package/packages/typescript/src/types/primitives.d.ts +176 -0
  2779. package/packages/typescript/src/types/primitives.d.ts.map +1 -0
  2780. package/packages/typescript/src/types/primitives.js +41 -0
  2781. package/packages/typescript/src/types/prompt-batcher.d.ts +126 -0
  2782. package/packages/typescript/src/types/prompt-batcher.d.ts.map +1 -0
  2783. package/packages/typescript/src/types/prompt-batcher.js +6 -0
  2784. package/packages/typescript/src/types/prompts.d.ts +39 -0
  2785. package/packages/typescript/src/types/prompts.d.ts.map +1 -0
  2786. package/packages/typescript/src/types/prompts.js +7 -0
  2787. package/packages/typescript/src/types/proto.d.ts +60 -0
  2788. package/packages/typescript/src/types/proto.d.ts.map +1 -0
  2789. package/packages/typescript/src/types/proto.js +53 -0
  2790. package/packages/typescript/src/types/runtime.d.ts +394 -0
  2791. package/packages/typescript/src/types/runtime.d.ts.map +1 -0
  2792. package/packages/typescript/src/types/runtime.js +1 -0
  2793. package/packages/typescript/src/types/schema-builder.d.ts +43 -0
  2794. package/packages/typescript/src/types/schema-builder.d.ts.map +1 -0
  2795. package/packages/typescript/src/types/schema-builder.js +16 -0
  2796. package/packages/typescript/src/types/schema.d.ts +99 -0
  2797. package/packages/typescript/src/types/schema.d.ts.map +1 -0
  2798. package/packages/typescript/src/types/schema.js +11 -0
  2799. package/packages/typescript/src/types/service-interfaces.d.ts +1200 -0
  2800. package/packages/typescript/src/types/service-interfaces.d.ts.map +1 -0
  2801. package/packages/typescript/src/types/service-interfaces.js +81 -0
  2802. package/packages/typescript/src/types/service.d.ts +173 -0
  2803. package/packages/typescript/src/types/service.d.ts.map +1 -0
  2804. package/packages/typescript/src/types/service.js +78 -0
  2805. package/packages/typescript/src/types/settings.d.ts +36 -0
  2806. package/packages/typescript/src/types/settings.d.ts.map +1 -0
  2807. package/packages/typescript/src/types/settings.js +1 -0
  2808. package/packages/typescript/src/types/state.d.ts +251 -0
  2809. package/packages/typescript/src/types/state.d.ts.map +1 -0
  2810. package/packages/typescript/src/types/state.js +1 -0
  2811. package/packages/typescript/src/types/streaming.d.ts +93 -0
  2812. package/packages/typescript/src/types/streaming.d.ts.map +1 -0
  2813. package/packages/typescript/src/types/streaming.js +21 -0
  2814. package/packages/typescript/src/types/task.d.ts +122 -0
  2815. package/packages/typescript/src/types/task.d.ts.map +1 -0
  2816. package/packages/typescript/src/types/task.js +1 -0
  2817. package/packages/typescript/src/types/tee.d.ts +3 -0
  2818. package/packages/typescript/src/types/tee.d.ts.map +1 -0
  2819. package/packages/typescript/src/types/tee.js +1 -0
  2820. package/packages/typescript/src/types/testing.d.ts +15 -0
  2821. package/packages/typescript/src/types/testing.d.ts.map +1 -0
  2822. package/packages/typescript/src/types/testing.js +1 -0
  2823. package/packages/typescript/src/types/tools.d.ts +166 -0
  2824. package/packages/typescript/src/types/tools.d.ts.map +1 -0
  2825. package/packages/typescript/src/types/tools.js +380 -0
  2826. package/packages/typescript/src/types/trigger.d.ts +38 -0
  2827. package/packages/typescript/src/types/trigger.d.ts.map +1 -0
  2828. package/packages/typescript/src/types/trigger.js +1 -0
  2829. package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts +53 -0
  2830. package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts.map +1 -0
  2831. package/packages/typescript/src/utils/batch-queue/batch-processor.js +129 -0
  2832. package/packages/typescript/src/utils/batch-queue/index.d.ts +97 -0
  2833. package/packages/typescript/src/utils/batch-queue/index.d.ts.map +1 -0
  2834. package/packages/typescript/src/utils/batch-queue/index.js +175 -0
  2835. package/packages/typescript/src/utils/batch-queue/priority-queue.d.ts +53 -0
  2836. package/packages/typescript/src/utils/batch-queue/priority-queue.d.ts.map +1 -0
  2837. package/packages/typescript/src/utils/batch-queue/priority-queue.js +128 -0
  2838. package/packages/typescript/src/utils/batch-queue/semaphore.d.ts +18 -0
  2839. package/packages/typescript/src/utils/batch-queue/semaphore.d.ts.map +1 -0
  2840. package/packages/typescript/src/utils/batch-queue/semaphore.js +34 -0
  2841. package/packages/typescript/src/utils/batch-queue/task-drain.d.ts +57 -0
  2842. package/packages/typescript/src/utils/batch-queue/task-drain.d.ts.map +1 -0
  2843. package/packages/typescript/src/utils/batch-queue/task-drain.js +150 -0
  2844. package/packages/typescript/src/utils/batch-queue.d.ts +20 -0
  2845. package/packages/typescript/src/utils/batch-queue.d.ts.map +1 -0
  2846. package/packages/typescript/src/utils/batch-queue.js +19 -0
  2847. package/packages/typescript/src/utils/boolean.d.ts +50 -0
  2848. package/packages/typescript/src/utils/boolean.d.ts.map +1 -0
  2849. package/packages/typescript/src/utils/boolean.js +73 -0
  2850. package/packages/typescript/src/utils/buffer.d.ts +107 -0
  2851. package/packages/typescript/src/utils/buffer.d.ts.map +1 -0
  2852. package/packages/typescript/src/utils/buffer.js +229 -0
  2853. package/packages/typescript/src/utils/channel-utils.d.ts +274 -0
  2854. package/packages/typescript/src/utils/channel-utils.d.ts.map +1 -0
  2855. package/packages/typescript/src/utils/channel-utils.js +337 -0
  2856. package/packages/typescript/src/utils/context-catalog.d.ts +6 -0
  2857. package/packages/typescript/src/utils/context-catalog.d.ts.map +1 -0
  2858. package/packages/typescript/src/utils/context-catalog.js +126 -0
  2859. package/packages/typescript/src/utils/context-routing.d.ts +25 -0
  2860. package/packages/typescript/src/utils/context-routing.d.ts.map +1 -0
  2861. package/packages/typescript/src/utils/context-routing.js +160 -0
  2862. package/packages/typescript/src/utils/crypto-compat.d.ts +83 -0
  2863. package/packages/typescript/src/utils/crypto-compat.d.ts.map +1 -0
  2864. package/packages/typescript/src/utils/crypto-compat.js +368 -0
  2865. package/packages/typescript/src/utils/deterministic.d.ts +9 -0
  2866. package/packages/typescript/src/utils/deterministic.d.ts.map +1 -0
  2867. package/packages/typescript/src/utils/deterministic.js +70 -0
  2868. package/packages/typescript/src/utils/environment.d.ts +125 -0
  2869. package/packages/typescript/src/utils/environment.d.ts.map +1 -0
  2870. package/packages/typescript/src/utils/environment.js +290 -0
  2871. package/packages/typescript/src/utils/example-names.d.ts +3 -0
  2872. package/packages/typescript/src/utils/example-names.d.ts.map +1 -0
  2873. package/packages/typescript/src/utils/example-names.js +30 -0
  2874. package/packages/typescript/src/utils/json-llm.d.ts +17 -0
  2875. package/packages/typescript/src/utils/json-llm.d.ts.map +1 -0
  2876. package/packages/typescript/src/utils/json-llm.js +32 -0
  2877. package/packages/typescript/src/utils/model-errors.d.ts +3 -0
  2878. package/packages/typescript/src/utils/model-errors.d.ts.map +1 -0
  2879. package/packages/typescript/src/utils/model-errors.js +23 -0
  2880. package/packages/typescript/src/utils/node.d.ts +8 -0
  2881. package/packages/typescript/src/utils/node.d.ts.map +1 -0
  2882. package/packages/typescript/src/utils/node.js +12 -0
  2883. package/packages/typescript/src/utils/paths.d.ts +97 -0
  2884. package/packages/typescript/src/utils/paths.d.ts.map +1 -0
  2885. package/packages/typescript/src/utils/paths.js +204 -0
  2886. package/packages/typescript/src/utils/prompt-batcher/batcher.d.ts +163 -0
  2887. package/packages/typescript/src/utils/prompt-batcher/batcher.d.ts.map +1 -0
  2888. package/packages/typescript/src/utils/prompt-batcher/batcher.js +896 -0
  2889. package/packages/typescript/src/utils/prompt-batcher/dispatcher.d.ts +15 -0
  2890. package/packages/typescript/src/utils/prompt-batcher/dispatcher.d.ts.map +1 -0
  2891. package/packages/typescript/src/utils/prompt-batcher/dispatcher.js +230 -0
  2892. package/packages/typescript/src/utils/prompt-batcher/shared.d.ts +66 -0
  2893. package/packages/typescript/src/utils/prompt-batcher/shared.d.ts.map +1 -0
  2894. package/packages/typescript/src/utils/prompt-batcher/shared.js +101 -0
  2895. package/packages/typescript/src/utils/prompt-batcher.d.ts +5 -0
  2896. package/packages/typescript/src/utils/prompt-batcher.d.ts.map +1 -0
  2897. package/packages/typescript/src/utils/prompt-batcher.js +4 -0
  2898. package/packages/typescript/src/utils/retry.d.ts +128 -0
  2899. package/packages/typescript/src/utils/retry.d.ts.map +1 -0
  2900. package/packages/typescript/src/utils/retry.js +190 -0
  2901. package/packages/typescript/src/utils/server-health.d.ts +35 -0
  2902. package/packages/typescript/src/utils/server-health.d.ts.map +1 -0
  2903. package/packages/typescript/src/utils/server-health.js +76 -0
  2904. package/packages/typescript/src/utils/slice-to-fit-budget.d.ts +12 -0
  2905. package/packages/typescript/src/utils/slice-to-fit-budget.d.ts.map +1 -0
  2906. package/packages/typescript/src/utils/slice-to-fit-budget.js +36 -0
  2907. package/packages/typescript/src/utils/streaming.d.ts +275 -0
  2908. package/packages/typescript/src/utils/streaming.d.ts.map +1 -0
  2909. package/packages/typescript/src/utils/streaming.js +774 -0
  2910. package/packages/typescript/src/utils/text-normalize.d.ts +23 -0
  2911. package/packages/typescript/src/utils/text-normalize.d.ts.map +1 -0
  2912. package/packages/typescript/src/utils/text-normalize.js +42 -0
  2913. package/packages/typescript/src/utils/text-splitting.d.ts +14 -0
  2914. package/packages/typescript/src/utils/text-splitting.d.ts.map +1 -0
  2915. package/packages/typescript/src/utils/text-splitting.js +66 -0
  2916. package/packages/typescript/src/utils/toon.d.ts +8 -0
  2917. package/packages/typescript/src/utils/toon.d.ts.map +1 -0
  2918. package/packages/typescript/src/utils/toon.js +325 -0
  2919. package/packages/typescript/src/utils/type-guards.d.ts +25 -0
  2920. package/packages/typescript/src/utils/type-guards.d.ts.map +1 -0
  2921. package/packages/typescript/src/utils/type-guards.js +73 -0
  2922. package/packages/typescript/src/utils.d.ts +190 -0
  2923. package/packages/typescript/src/utils.d.ts.map +1 -0
  2924. package/packages/typescript/src/utils.js +1115 -0
  2925. package/packages/typescript/src/validation/index.d.ts +8 -0
  2926. package/packages/typescript/src/validation/index.d.ts.map +1 -0
  2927. package/packages/typescript/src/validation/index.js +7 -0
  2928. package/packages/typescript/src/validation/keywords.d.ts +26 -0
  2929. package/packages/typescript/src/validation/keywords.d.ts.map +1 -0
  2930. package/packages/typescript/src/validation/keywords.js +76 -0
  2931. package/packages/typescript/src/validation/secrets.d.ts +94 -0
  2932. package/packages/typescript/src/validation/secrets.d.ts.map +1 -0
  2933. package/packages/typescript/src/validation/secrets.js +399 -0
  2934. package/jest.config.js +0 -17
  2935. package/src/__tests__/client-type-identification.test.ts +0 -59
  2936. package/src/defaultCharacter.ts +0 -530
  2937. package/src/index.ts +0 -911
  2938. package/tsconfig.json +0 -16
@@ -0,0 +1,4589 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import * as fsp from "node:fs/promises";
3
+ import { createRequire } from "node:module";
4
+ import * as path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ let jsdomCtor;
7
+ /**
8
+ * Locate jsdom's package.json on disk, then resolve its declared entry file from there.
9
+ * Vitest workers run on Node; Node cannot resolve `jsdom` from workspace roots when
10
+ * Bun hoists deps under node_modules/.bun, but requiring jsdom from its own package
11
+ * directory still works.
12
+ */
13
+ function findJsdomPackageJsonPath() {
14
+ const candidatesUnderBase = (base) => {
15
+ const rels = [
16
+ path.join("node_modules", "jsdom", "package.json"),
17
+ path.join("apps", "app", "node_modules", "jsdom", "package.json"),
18
+ ];
19
+ for (const rel of rels) {
20
+ const full = path.join(base, rel);
21
+ if (existsSync(full)) {
22
+ return full;
23
+ }
24
+ }
25
+ return undefined;
26
+ };
27
+ const walk = (start, maxDepth) => {
28
+ let dir = start;
29
+ for (let depth = 0; depth < maxDepth; depth += 1) {
30
+ const hit = candidatesUnderBase(dir);
31
+ if (hit) {
32
+ return hit;
33
+ }
34
+ const parent = path.dirname(dir);
35
+ if (parent === dir) {
36
+ break;
37
+ }
38
+ dir = parent;
39
+ }
40
+ return undefined;
41
+ };
42
+ const fromSource = walk(path.dirname(fileURLToPath(import.meta.url)), 24);
43
+ if (fromSource) {
44
+ return fromSource;
45
+ }
46
+ const fromCwd = walk(process.cwd(), 16);
47
+ if (fromCwd) {
48
+ return fromCwd;
49
+ }
50
+ throw new Error("Could not find jsdom on disk (install dependencies: jsdom is listed on @elizaos/agent and apps/app).");
51
+ }
52
+ /** Lazy-load jsdom so importing this module does not require jsdom at parse time (Vitest / server tests). */
53
+ function getJSDOMClass() {
54
+ if (!jsdomCtor) {
55
+ const jsdomPkg = findJsdomPackageJsonPath();
56
+ const jsdomDir = path.dirname(jsdomPkg);
57
+ const meta = JSON.parse(readFileSync(jsdomPkg, "utf8"));
58
+ const mainRel = (meta.main ?? "./lib/api.js").replace(/^\.\//, "");
59
+ const entry = path.join(jsdomDir, mainRel);
60
+ const req = createRequire(jsdomPkg);
61
+ const mod = req(entry);
62
+ jsdomCtor = mod.JSDOM;
63
+ }
64
+ return jsdomCtor;
65
+ }
66
+ const DEFAULT_TIMEOUT_MS = 12_000;
67
+ const DEFAULT_WAIT_INTERVAL_MS = 120;
68
+ const DEFAULT_WEB_PARTITION = "persist:eliza-browser";
69
+ const DESKTOP_BRIDGE_UNAVAILABLE_MESSAGE = "Eliza browser workspace desktop bridge is unavailable.";
70
+ const browserWorkspacePageFetch = globalThis.fetch.bind(globalThis);
71
+ /**
72
+ * Simple async mutex to serialise mutations to webWorkspaceState.
73
+ * Prevents concurrent requests from corrupting tab state or history.
74
+ */
75
+ let webStateLock = Promise.resolve();
76
+ function withWebStateLock(fn) {
77
+ const next = webStateLock.then(fn, fn);
78
+ webStateLock = next.then(() => { }, () => { });
79
+ return next;
80
+ }
81
+ const webWorkspaceState = {
82
+ nextId: 1,
83
+ tabs: [],
84
+ };
85
+ const browserWorkspaceElementRefs = new Map();
86
+ const browserWorkspaceRuntimeState = new Map();
87
+ let browserWorkspaceClipboardText = "";
88
+ /** @internal - test-only reset */
89
+ export async function __resetBrowserWorkspaceStateForTests() {
90
+ await withWebStateLock(async () => {
91
+ webWorkspaceState.nextId = 1;
92
+ webWorkspaceState.tabs = [];
93
+ browserWorkspaceElementRefs.clear();
94
+ browserWorkspaceRuntimeState.clear();
95
+ browserWorkspaceClipboardText = "";
96
+ });
97
+ webStateLock = Promise.resolve();
98
+ }
99
+ function normalizeEnvValue(value) {
100
+ if (typeof value !== "string") {
101
+ return null;
102
+ }
103
+ const trimmed = value.trim();
104
+ return trimmed.length > 0 ? trimmed : null;
105
+ }
106
+ function normalizeBrowserWorkspaceText(value) {
107
+ return String(value ?? "")
108
+ .replace(/\s+/g, " ")
109
+ .trim();
110
+ }
111
+ function parseBrowserWorkspaceNumberLike(value) {
112
+ if (typeof value === "number" && Number.isFinite(value)) {
113
+ return value;
114
+ }
115
+ if (typeof value !== "string") {
116
+ return undefined;
117
+ }
118
+ const parsed = Number.parseFloat(value.trim());
119
+ return Number.isFinite(parsed) ? parsed : undefined;
120
+ }
121
+ function getBrowserWorkspaceTimestamp() {
122
+ return new Date().toISOString();
123
+ }
124
+ function getBrowserWorkspaceElementRefStateKey(mode, tabId) {
125
+ return `${mode}:${tabId}`;
126
+ }
127
+ function createBrowserWorkspaceRuntimeState() {
128
+ return {
129
+ consoleEntries: [],
130
+ currentFrame: null,
131
+ dialog: null,
132
+ errors: [],
133
+ frameDoms: new Map(),
134
+ highlightedSelector: null,
135
+ lastScreenshotData: null,
136
+ lastSnapshot: null,
137
+ mouse: { buttons: [], x: 0, y: 0 },
138
+ networkHar: { active: false, entries: [], startedAt: null },
139
+ networkNextRequestId: 1,
140
+ networkRequests: [],
141
+ networkRoutes: [],
142
+ settings: {
143
+ credentials: null,
144
+ device: null,
145
+ geo: null,
146
+ headers: {},
147
+ media: null,
148
+ offline: false,
149
+ viewport: null,
150
+ },
151
+ trace: { active: false, entries: [] },
152
+ profiler: { active: false, entries: [] },
153
+ };
154
+ }
155
+ function getBrowserWorkspaceRuntimeStateKey(mode, tabId) {
156
+ return `${mode}:${tabId}`;
157
+ }
158
+ function getBrowserWorkspaceRuntimeState(mode, tabId) {
159
+ const key = getBrowserWorkspaceRuntimeStateKey(mode, tabId);
160
+ let state = browserWorkspaceRuntimeState.get(key);
161
+ if (!state) {
162
+ state = createBrowserWorkspaceRuntimeState();
163
+ browserWorkspaceRuntimeState.set(key, state);
164
+ }
165
+ return state;
166
+ }
167
+ function clearBrowserWorkspaceRuntimeState(mode, tabId) {
168
+ browserWorkspaceRuntimeState.delete(getBrowserWorkspaceRuntimeStateKey(mode, tabId));
169
+ }
170
+ function resetBrowserWorkspaceRuntimeNavigationState(state) {
171
+ state.currentFrame = null;
172
+ state.dialog = null;
173
+ state.frameDoms.clear();
174
+ state.highlightedSelector = null;
175
+ }
176
+ function appendBrowserWorkspaceTraceEntry(state, entry) {
177
+ if (!state.trace.active) {
178
+ return;
179
+ }
180
+ state.trace.entries.push({
181
+ ...entry,
182
+ timestamp: getBrowserWorkspaceTimestamp(),
183
+ });
184
+ }
185
+ function appendBrowserWorkspaceProfilerEntry(state, entry) {
186
+ if (!state.profiler.active) {
187
+ return;
188
+ }
189
+ state.profiler.entries.push({
190
+ ...entry,
191
+ timestamp: getBrowserWorkspaceTimestamp(),
192
+ });
193
+ }
194
+ function clearBrowserWorkspaceElementRefs(mode, tabId) {
195
+ browserWorkspaceElementRefs.delete(getBrowserWorkspaceElementRefStateKey(mode, tabId));
196
+ }
197
+ function registerBrowserWorkspaceElementRefs(mode, tabId, elements) {
198
+ if (elements.length === 0) {
199
+ clearBrowserWorkspaceElementRefs(mode, tabId);
200
+ return [];
201
+ }
202
+ const refs = new Map();
203
+ const augmented = elements.map((element, index) => {
204
+ const ref = `@e${index + 1}`;
205
+ refs.set(ref, element.selector);
206
+ return { ...element, ref };
207
+ });
208
+ browserWorkspaceElementRefs.set(getBrowserWorkspaceElementRefStateKey(mode, tabId), refs);
209
+ return augmented;
210
+ }
211
+ function resolveBrowserWorkspaceElementRef(mode, tabId, ref) {
212
+ return (browserWorkspaceElementRefs
213
+ .get(getBrowserWorkspaceElementRefStateKey(mode, tabId))
214
+ ?.get(ref.trim()) ?? null);
215
+ }
216
+ function resolveBrowserWorkspaceCommandElementRefs(command, mode, tabId) {
217
+ const selector = command.selector?.trim();
218
+ if (!selector) {
219
+ return command;
220
+ }
221
+ const match = selector.match(/^(@e\d+)([\s\S]*)$/i);
222
+ if (!match?.[1]) {
223
+ return command;
224
+ }
225
+ const resolvedSelector = resolveBrowserWorkspaceElementRef(mode, tabId, match[1]);
226
+ if (!resolvedSelector) {
227
+ throw new Error(`Unknown browser snapshot element ref ${match[1]}. Run snapshot or inspect again before reusing element refs.`);
228
+ }
229
+ return {
230
+ ...command,
231
+ selector: `${resolvedSelector}${match[2] ?? ""}`,
232
+ };
233
+ }
234
+ function assertBrowserWorkspaceUrl(rawUrl) {
235
+ const trimmed = rawUrl.trim();
236
+ if (trimmed === "about:blank") {
237
+ return trimmed;
238
+ }
239
+ let parsed;
240
+ try {
241
+ parsed = new URL(trimmed);
242
+ }
243
+ catch {
244
+ throw new Error(`browser workspace rejected invalid URL: ${rawUrl}`);
245
+ }
246
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
247
+ throw new Error(`browser workspace only supports http/https URLs, got ${parsed.protocol}`);
248
+ }
249
+ return parsed.toString();
250
+ }
251
+ function createBrowserWorkspaceDesktopOnlyMessage(subaction) {
252
+ return `Eliza browser workspace ${subaction} is only available in the desktop app.`;
253
+ }
254
+ function createBrowserWorkspaceNotFoundError(tabId) {
255
+ return new Error(`Browser workspace request failed (404): Tab ${tabId} was not found.`);
256
+ }
257
+ function createBrowserWorkspaceCommandTargetError(subaction) {
258
+ return new Error(`Eliza browser workspace ${subaction} requires a current tab. Open or show a tab first, or pass an explicit id.`);
259
+ }
260
+ function inferBrowserWorkspaceTitle(url) {
261
+ if (url === "about:blank") {
262
+ return "New Tab";
263
+ }
264
+ try {
265
+ return new URL(url).hostname.replace(/^www\./, "") || "Eliza Browser";
266
+ }
267
+ catch {
268
+ return "Eliza Browser";
269
+ }
270
+ }
271
+ function cloneBrowserWorkspaceTab(tab) {
272
+ return { ...tab };
273
+ }
274
+ function cloneBrowserWorkspaceTabs(tabs) {
275
+ return tabs.map((tab) => cloneBrowserWorkspaceTab(tab));
276
+ }
277
+ function cloneWebBrowserWorkspaceTabState(tab) {
278
+ return {
279
+ id: tab.id,
280
+ title: tab.title,
281
+ url: tab.url,
282
+ partition: tab.partition,
283
+ visible: tab.visible,
284
+ createdAt: tab.createdAt,
285
+ updatedAt: tab.updatedAt,
286
+ lastFocusedAt: tab.lastFocusedAt,
287
+ };
288
+ }
289
+ function clearWebBrowserWorkspaceTabElementRefs(tabId) {
290
+ clearBrowserWorkspaceElementRefs("web", tabId);
291
+ }
292
+ function createEmptyWebBrowserWorkspaceDom(url) {
293
+ return new (getJSDOMClass())('<!doctype html><html lang="en"><head><title>New Tab</title></head><body></body></html>', {
294
+ pretendToBeVisual: true,
295
+ url,
296
+ });
297
+ }
298
+ function applyBrowserWorkspaceDomSettings(dom, state) {
299
+ const viewport = state.settings.viewport;
300
+ if (viewport) {
301
+ Object.defineProperty(dom.window, "innerWidth", {
302
+ configurable: true,
303
+ value: viewport.width,
304
+ });
305
+ Object.defineProperty(dom.window, "innerHeight", {
306
+ configurable: true,
307
+ value: viewport.height,
308
+ });
309
+ Object.defineProperty(dom.window, "devicePixelRatio", {
310
+ configurable: true,
311
+ value: viewport.scale,
312
+ });
313
+ }
314
+ Object.defineProperty(dom.window.navigator, "onLine", {
315
+ configurable: true,
316
+ get: () => !state.settings.offline,
317
+ });
318
+ if (state.settings.device) {
319
+ Object.defineProperty(dom.window.navigator, "userAgent", {
320
+ configurable: true,
321
+ value: `ElizaBrowserWorkspace/${state.settings.device}`,
322
+ });
323
+ }
324
+ const matchMedia = (query) => {
325
+ const matches = query.includes("prefers-color-scheme") &&
326
+ ((state.settings.media === "dark" && query.includes("dark")) ||
327
+ (state.settings.media === "light" && query.includes("light")));
328
+ return {
329
+ addEventListener() { },
330
+ addListener() { },
331
+ dispatchEvent() {
332
+ return true;
333
+ },
334
+ matches,
335
+ media: query,
336
+ onchange: null,
337
+ removeEventListener() { },
338
+ removeListener() { },
339
+ };
340
+ };
341
+ Object.defineProperty(dom.window, "matchMedia", {
342
+ configurable: true,
343
+ value: matchMedia,
344
+ });
345
+ Object.defineProperty(dom.window.navigator, "clipboard", {
346
+ configurable: true,
347
+ value: {
348
+ readText: async () => browserWorkspaceClipboardText,
349
+ writeText: async (value) => {
350
+ browserWorkspaceClipboardText = String(value ?? "");
351
+ },
352
+ },
353
+ });
354
+ Object.defineProperty(dom.window.navigator, "geolocation", {
355
+ configurable: true,
356
+ value: {
357
+ getCurrentPosition: (success) => {
358
+ const coords = state.settings.geo ?? { latitude: 0, longitude: 0 };
359
+ success({
360
+ coords: {
361
+ accuracy: 1,
362
+ latitude: coords.latitude,
363
+ longitude: coords.longitude,
364
+ },
365
+ timestamp: Date.now(),
366
+ });
367
+ },
368
+ },
369
+ });
370
+ }
371
+ function installBrowserWorkspaceWebRuntime(tab, dom) {
372
+ const state = getBrowserWorkspaceRuntimeState("web", tab.id);
373
+ applyBrowserWorkspaceDomSettings(dom, state);
374
+ const windowRecord = dom.window;
375
+ windowRecord.__elizaBrowserWorkspaceState = state;
376
+ const consoleTarget = dom.window.console;
377
+ if (!consoleTarget.__elizaWrapped) {
378
+ for (const level of ["log", "info", "warn", "error"]) {
379
+ consoleTarget[level] = (...args) => {
380
+ state.consoleEntries.push({
381
+ level,
382
+ message: args
383
+ .map((value) => normalizeBrowserWorkspaceText(value))
384
+ .join(" "),
385
+ timestamp: getBrowserWorkspaceTimestamp(),
386
+ });
387
+ return undefined;
388
+ };
389
+ }
390
+ consoleTarget.__elizaWrapped = true;
391
+ }
392
+ dom.window.alert = (message) => {
393
+ state.dialog = {
394
+ defaultValue: null,
395
+ message: String(message ?? ""),
396
+ open: true,
397
+ type: "alert",
398
+ };
399
+ };
400
+ dom.window.confirm = (message) => {
401
+ state.dialog = {
402
+ defaultValue: null,
403
+ message: String(message ?? ""),
404
+ open: true,
405
+ type: "confirm",
406
+ };
407
+ return false;
408
+ };
409
+ dom.window.prompt = (message, defaultValue) => {
410
+ state.dialog = {
411
+ defaultValue: defaultValue ?? null,
412
+ message: String(message ?? ""),
413
+ open: true,
414
+ type: "prompt",
415
+ };
416
+ return null;
417
+ };
418
+ Object.defineProperty(dom.window, "fetch", {
419
+ configurable: true,
420
+ value: async (input, init) => {
421
+ const inputUrl = typeof input === "string"
422
+ ? input
423
+ : input instanceof URL
424
+ ? input.toString()
425
+ : typeof input.url === "string"
426
+ ? input.url
427
+ : String(input);
428
+ return fetchBrowserWorkspaceTrackedResponse(state, new URL(inputUrl, tab.url).toString(), {
429
+ ...init,
430
+ headers: init?.headers ??
431
+ (input.headers
432
+ ? input.headers
433
+ : undefined),
434
+ method: init?.method ??
435
+ (typeof input.method === "string"
436
+ ? input.method
437
+ : undefined),
438
+ }, "fetch");
439
+ },
440
+ });
441
+ }
442
+ function getWebBrowserWorkspaceTabIndex(tabId) {
443
+ return webWorkspaceState.tabs.findIndex((tab) => tab.id === tabId);
444
+ }
445
+ function getWebBrowserWorkspaceTabState(tabId) {
446
+ const tab = webWorkspaceState.tabs.find((entry) => entry.id === tabId);
447
+ if (!tab) {
448
+ throw createBrowserWorkspaceNotFoundError(tabId);
449
+ }
450
+ return tab;
451
+ }
452
+ function getCurrentWebBrowserWorkspaceTabState() {
453
+ if (webWorkspaceState.tabs.length === 0) {
454
+ return null;
455
+ }
456
+ return (webWorkspaceState.tabs.find((tab) => tab.visible) ??
457
+ [...webWorkspaceState.tabs].sort((left, right) => {
458
+ const leftTime = left.lastFocusedAt ?? left.updatedAt;
459
+ const rightTime = right.lastFocusedAt ?? right.updatedAt;
460
+ return (rightTime.localeCompare(leftTime) || left.id.localeCompare(right.id));
461
+ })[0] ??
462
+ null);
463
+ }
464
+ function createWebBrowserWorkspaceTab(request) {
465
+ const now = getBrowserWorkspaceTimestamp();
466
+ const url = assertBrowserWorkspaceUrl(request.url?.trim() || "about:blank");
467
+ const visible = request.show === true;
468
+ const id = `btab_${webWorkspaceState.nextId++}`;
469
+ const dom = url === "about:blank" ? createEmptyWebBrowserWorkspaceDom(url) : null;
470
+ if (dom) {
471
+ const bootstrapTab = {
472
+ id,
473
+ title: request.title?.trim() || inferBrowserWorkspaceTitle(url),
474
+ url,
475
+ partition: request.partition?.trim() || DEFAULT_WEB_PARTITION,
476
+ visible,
477
+ createdAt: now,
478
+ updatedAt: now,
479
+ lastFocusedAt: visible ? now : null,
480
+ dom,
481
+ history: [url],
482
+ historyIndex: 0,
483
+ loadedUrl: url,
484
+ };
485
+ installBrowserWorkspaceWebRuntime(bootstrapTab, dom);
486
+ return bootstrapTab;
487
+ }
488
+ return {
489
+ id,
490
+ title: request.title?.trim() || inferBrowserWorkspaceTitle(url),
491
+ url,
492
+ partition: request.partition?.trim() || DEFAULT_WEB_PARTITION,
493
+ visible,
494
+ createdAt: now,
495
+ updatedAt: now,
496
+ lastFocusedAt: visible ? now : null,
497
+ dom,
498
+ history: [url],
499
+ historyIndex: 0,
500
+ loadedUrl: url === "about:blank" ? url : null,
501
+ };
502
+ }
503
+ function buildBrowserWorkspaceCssStringLiteral(value) {
504
+ return JSON.stringify(value);
505
+ }
506
+ function buildBrowserWorkspaceElementSelector(element) {
507
+ const escapedId = typeof globalThis.CSS
508
+ ?.escape === "function"
509
+ ? globalThis.CSS.escape(element.id)
510
+ : element.id.replace(/[^a-zA-Z0-9_-]/g, "\\$&");
511
+ if (element.id) {
512
+ return `#${escapedId}`;
513
+ }
514
+ const testId = element.getAttribute("data-testid")?.trim();
515
+ if (testId) {
516
+ return `[data-testid=${buildBrowserWorkspaceCssStringLiteral(testId)}]`;
517
+ }
518
+ const name = element.getAttribute("name")?.trim();
519
+ if (name) {
520
+ return `${element.tagName.toLowerCase()}[name=${buildBrowserWorkspaceCssStringLiteral(name)}]`;
521
+ }
522
+ const type = element.getAttribute("type")?.trim();
523
+ if (type) {
524
+ return `${element.tagName.toLowerCase()}[type=${buildBrowserWorkspaceCssStringLiteral(type)}]`;
525
+ }
526
+ const parent = element.parentElement;
527
+ if (!parent) {
528
+ return element.tagName.toLowerCase();
529
+ }
530
+ const siblings = parent.children;
531
+ let index = 1;
532
+ for (let cursor = 0; cursor < siblings.length; cursor += 1) {
533
+ const sibling = siblings.item(cursor);
534
+ if (!sibling || sibling.tagName !== element.tagName) {
535
+ continue;
536
+ }
537
+ if (sibling === element) {
538
+ break;
539
+ }
540
+ index += 1;
541
+ }
542
+ return `${element.tagName.toLowerCase()}:nth-of-type(${index})`;
543
+ }
544
+ function createBrowserWorkspaceElementSummary(element) {
545
+ const inputLike = element.tagName === "INPUT" ||
546
+ element.tagName === "TEXTAREA" ||
547
+ element.tagName === "SELECT";
548
+ const elementValue = inputLike
549
+ ? (element
550
+ .value ?? null)
551
+ : null;
552
+ return {
553
+ selector: buildBrowserWorkspaceElementSelector(element),
554
+ tag: element.tagName.toLowerCase(),
555
+ text: normalizeBrowserWorkspaceText(inputLike ? elementValue : element.textContent),
556
+ type: element.getAttribute("type"),
557
+ name: element.getAttribute("name"),
558
+ href: element.getAttribute("href"),
559
+ value: typeof elementValue === "string" ? elementValue : null,
560
+ };
561
+ }
562
+ function collectBrowserWorkspaceInspectElements(document) {
563
+ const elements = Array.from(document.querySelectorAll("a, button, input, textarea, select, form, [role='button'], [data-testid]"));
564
+ const summaries = [];
565
+ const seenSelectors = new Set();
566
+ for (const element of elements) {
567
+ const summary = createBrowserWorkspaceElementSummary(element);
568
+ if (seenSelectors.has(summary.selector)) {
569
+ continue;
570
+ }
571
+ seenSelectors.add(summary.selector);
572
+ summaries.push(summary);
573
+ if (summaries.length >= 40) {
574
+ break;
575
+ }
576
+ }
577
+ return summaries;
578
+ }
579
+ function resolveBrowserWorkspaceIframeDocument(runtime, frameElement, baseUrl) {
580
+ if (!frameElement || frameElement.tagName !== "IFRAME") {
581
+ return null;
582
+ }
583
+ const iframe = frameElement;
584
+ const srcdoc = iframe.getAttribute("srcdoc");
585
+ if (srcdoc?.trim()) {
586
+ const selector = buildBrowserWorkspaceElementSelector(frameElement);
587
+ const cached = runtime.frameDoms.get(selector);
588
+ if (cached) {
589
+ return cached.window.document;
590
+ }
591
+ if (iframe.contentDocument &&
592
+ normalizeBrowserWorkspaceText(iframe.contentDocument.body?.textContent)
593
+ .length > 0) {
594
+ return iframe.contentDocument;
595
+ }
596
+ const parsed = new (getJSDOMClass())(srcdoc, {
597
+ pretendToBeVisual: true,
598
+ url: baseUrl,
599
+ });
600
+ runtime.frameDoms.set(selector, parsed);
601
+ return parsed.window.document;
602
+ }
603
+ if (iframe.contentDocument) {
604
+ return iframe.contentDocument;
605
+ }
606
+ return null;
607
+ }
608
+ function resolveWebBrowserWorkspaceCommandDocument(tab, dom) {
609
+ const state = getBrowserWorkspaceRuntimeState("web", tab.id);
610
+ const frameSelector = state.currentFrame?.trim() || null;
611
+ if (!frameSelector) {
612
+ return { document: dom.window.document, frameSelector: null };
613
+ }
614
+ const frameElement = resolveBrowserWorkspaceElement(dom.window.document, frameSelector);
615
+ const frameDocument = resolveBrowserWorkspaceIframeDocument(state, frameElement, tab.url);
616
+ if (!frameDocument) {
617
+ return { document: dom.window.document, frameSelector: null };
618
+ }
619
+ return { document: frameDocument, frameSelector };
620
+ }
621
+ function getBrowserWorkspaceElementSearchTexts(element) {
622
+ const labelText = element.id && element.ownerDocument
623
+ ? Array.from(element.ownerDocument.querySelectorAll(`label[for="${element.id}"]`))
624
+ .map((label) => label.textContent)
625
+ .join(" ")
626
+ : "";
627
+ return [
628
+ element.textContent,
629
+ element.getAttribute("aria-label"),
630
+ element.getAttribute("placeholder"),
631
+ element.getAttribute("title"),
632
+ element.getAttribute("name"),
633
+ element.getAttribute("alt"),
634
+ element.getAttribute("data-testid"),
635
+ labelText,
636
+ element
637
+ .value,
638
+ ]
639
+ .map((value) => normalizeBrowserWorkspaceText(value))
640
+ .filter(Boolean);
641
+ }
642
+ function browserWorkspaceTextMatches(candidate, wanted, exact = false) {
643
+ const normalizedCandidate = normalizeBrowserWorkspaceText(candidate).toLowerCase();
644
+ const normalizedWanted = normalizeBrowserWorkspaceText(wanted).toLowerCase();
645
+ if (!normalizedCandidate || !normalizedWanted) {
646
+ return false;
647
+ }
648
+ return exact
649
+ ? normalizedCandidate === normalizedWanted
650
+ : normalizedCandidate.includes(normalizedWanted);
651
+ }
652
+ function isBrowserWorkspaceElementVisible(element) {
653
+ if (element.hasAttribute("hidden") ||
654
+ element.getAttribute("aria-hidden") === "true") {
655
+ return false;
656
+ }
657
+ const htmlElement = element;
658
+ const inlineDisplay = htmlElement.style?.display?.trim().toLowerCase();
659
+ const inlineVisibility = htmlElement.style?.visibility?.trim().toLowerCase();
660
+ if (inlineDisplay === "none" || inlineVisibility === "hidden") {
661
+ return false;
662
+ }
663
+ return true;
664
+ }
665
+ function findBrowserWorkspaceElementByLabel(document, labelText, exact = false) {
666
+ const labels = Array.from(document.querySelectorAll("label"));
667
+ for (const label of labels) {
668
+ if (!browserWorkspaceTextMatches(label.textContent ?? "", labelText, exact)) {
669
+ continue;
670
+ }
671
+ const forId = label.getAttribute("for")?.trim();
672
+ if (forId) {
673
+ const explicit = document.getElementById(forId);
674
+ if (explicit) {
675
+ return explicit;
676
+ }
677
+ }
678
+ const nested = label.querySelector("input, textarea, select, button");
679
+ if (nested) {
680
+ return nested;
681
+ }
682
+ }
683
+ return null;
684
+ }
685
+ function getBrowserWorkspaceNativeRole(element) {
686
+ const explicitRole = element.getAttribute("role")?.trim().toLowerCase();
687
+ if (explicitRole) {
688
+ return explicitRole;
689
+ }
690
+ const tag = element.tagName.toLowerCase();
691
+ if (tag === "a" && element.getAttribute("href"))
692
+ return "link";
693
+ if (tag === "button")
694
+ return "button";
695
+ if (tag === "select")
696
+ return "combobox";
697
+ if (tag === "option")
698
+ return "option";
699
+ if (tag === "textarea")
700
+ return "textbox";
701
+ if (tag === "form")
702
+ return "form";
703
+ if (/^h[1-6]$/.test(tag))
704
+ return "heading";
705
+ if (tag === "input") {
706
+ const input = element;
707
+ const type = (input.type || "text").toLowerCase();
708
+ if (type === "checkbox")
709
+ return "checkbox";
710
+ if (type === "radio")
711
+ return "radio";
712
+ if (["button", "submit", "reset", "image"].includes(type)) {
713
+ return "button";
714
+ }
715
+ return "textbox";
716
+ }
717
+ return null;
718
+ }
719
+ function findBrowserWorkspaceElementByRole(document, role, name, exact = false) {
720
+ const wantedRole = role.trim().toLowerCase();
721
+ if (!wantedRole) {
722
+ return null;
723
+ }
724
+ const candidates = Array.from(document.querySelectorAll("a, button, input, textarea, select, option, form, h1, h2, h3, h4, h5, h6, [role], [data-testid]"));
725
+ for (const candidate of candidates) {
726
+ if (getBrowserWorkspaceNativeRole(candidate) !== wantedRole) {
727
+ continue;
728
+ }
729
+ if (!name?.trim()) {
730
+ return candidate;
731
+ }
732
+ const haystacks = getBrowserWorkspaceElementSearchTexts(candidate);
733
+ if (haystacks.some((value) => browserWorkspaceTextMatches(value, name, exact))) {
734
+ return candidate;
735
+ }
736
+ }
737
+ return null;
738
+ }
739
+ function trimBrowserWorkspaceQuotedValue(value) {
740
+ const trimmed = value.trim();
741
+ const hasTextMatch = trimmed.match(/^has-text\((['"])([\s\S]*?)\1\)$/i);
742
+ if (hasTextMatch?.[2]) {
743
+ return hasTextMatch[2].trim();
744
+ }
745
+ if ((trimmed.startsWith('"') && trimmed.endsWith('"')) ||
746
+ (trimmed.startsWith("'") && trimmed.endsWith("'"))) {
747
+ return trimmed.slice(1, -1).trim();
748
+ }
749
+ return trimmed;
750
+ }
751
+ function normalizeBrowserWorkspaceSelectorSyntax(selector) {
752
+ let normalized = selector.trim();
753
+ normalized = normalized.replace(/^role\s*[:=]\s*([a-z0-9_-]+)\s+name\s*[:=]\s*(.+)$/i, "role=$1[name=$2]");
754
+ normalized = normalized.replace(/^((?:label|text|placeholder|alt|title|testid|data-testid)\s*[:=]\s*(?:has-text\((['"])[\s\S]*?\2\)|"[^"]+"|'[^']+'|[^>]+?))\s+((?:input|textarea|select)[\s\S]*)$/i, "$1 >> $3");
755
+ return normalized;
756
+ }
757
+ function parseBrowserWorkspaceSemanticSelector(selector) {
758
+ const trimmed = normalizeBrowserWorkspaceSelectorSyntax(selector);
759
+ const match = trimmed.match(/^([a-z-]+)\s*[:=]\s*(.+)$/i);
760
+ if (!match) {
761
+ return null;
762
+ }
763
+ const kind = match[1]?.trim().toLowerCase();
764
+ const rawValue = match[2]?.trim() ?? "";
765
+ if (!kind || !rawValue) {
766
+ return null;
767
+ }
768
+ switch (kind) {
769
+ case "alt":
770
+ return { findBy: "alt", text: trimBrowserWorkspaceQuotedValue(rawValue) };
771
+ case "css":
772
+ return { selector: trimBrowserWorkspaceQuotedValue(rawValue) };
773
+ case "data-testid":
774
+ case "testid":
775
+ return {
776
+ findBy: "testid",
777
+ text: trimBrowserWorkspaceQuotedValue(rawValue),
778
+ };
779
+ case "label":
780
+ return {
781
+ findBy: "label",
782
+ text: trimBrowserWorkspaceQuotedValue(rawValue),
783
+ };
784
+ case "placeholder":
785
+ return {
786
+ findBy: "placeholder",
787
+ text: trimBrowserWorkspaceQuotedValue(rawValue),
788
+ };
789
+ case "role": {
790
+ const roleMatch = rawValue.match(/^([a-z0-9_-]+)(?:\s*\[\s*name\s*[:=]\s*(.+?)\s*\])?$/i);
791
+ if (!roleMatch?.[1]) {
792
+ return null;
793
+ }
794
+ return {
795
+ findBy: "role",
796
+ name: roleMatch[2]
797
+ ? trimBrowserWorkspaceQuotedValue(roleMatch[2])
798
+ : undefined,
799
+ role: roleMatch[1].trim().toLowerCase(),
800
+ };
801
+ }
802
+ case "text":
803
+ return {
804
+ findBy: "text",
805
+ text: trimBrowserWorkspaceQuotedValue(rawValue),
806
+ };
807
+ case "title":
808
+ return {
809
+ findBy: "title",
810
+ text: trimBrowserWorkspaceQuotedValue(rawValue),
811
+ };
812
+ default:
813
+ return null;
814
+ }
815
+ }
816
+ function mergeBrowserWorkspaceSelectorCommand(command, selector) {
817
+ const parsed = parseBrowserWorkspaceSemanticSelector(selector);
818
+ if (!parsed) {
819
+ return null;
820
+ }
821
+ return {
822
+ ...command,
823
+ ...parsed,
824
+ selector: parsed.selector,
825
+ };
826
+ }
827
+ function queryBrowserWorkspaceSelector(root, selector) {
828
+ try {
829
+ return root.querySelector(selector);
830
+ }
831
+ catch {
832
+ throw new Error(`Invalid selector ${selector}`);
833
+ }
834
+ }
835
+ function queryAllBrowserWorkspaceSelector(root, selector) {
836
+ try {
837
+ return Array.from(root.querySelectorAll(selector));
838
+ }
839
+ catch {
840
+ throw new Error(`Invalid selector ${selector}`);
841
+ }
842
+ }
843
+ function browserWorkspacePatternMatches(pattern, value) {
844
+ const trimmed = pattern.trim();
845
+ if (!trimmed) {
846
+ return false;
847
+ }
848
+ if (!trimmed.includes("*")) {
849
+ return value.includes(trimmed);
850
+ }
851
+ let wildcardPattern = "";
852
+ for (let index = 0; index < trimmed.length; index += 1) {
853
+ const char = trimmed[index] ?? "";
854
+ if (char === "*") {
855
+ const next = trimmed[index + 1];
856
+ if (next === "*") {
857
+ wildcardPattern += ".*";
858
+ index += 1;
859
+ }
860
+ else {
861
+ wildcardPattern += ".*";
862
+ }
863
+ continue;
864
+ }
865
+ wildcardPattern += char.replace(/[|\\{}()[\]^$+?.]/g, "\\$&");
866
+ }
867
+ return new RegExp(`^${wildcardPattern}$`, "i").test(value);
868
+ }
869
+ function normalizeBrowserWorkspaceHeaders(headers) {
870
+ if (!headers) {
871
+ return {};
872
+ }
873
+ return Object.fromEntries(Object.entries(headers).filter((entry) => typeof entry[0] === "string" &&
874
+ entry[0].trim().length > 0 &&
875
+ typeof entry[1] === "string"));
876
+ }
877
+ function findBrowserWorkspaceNetworkRoute(state, url) {
878
+ return ([...state.networkRoutes]
879
+ .reverse()
880
+ .find((route) => browserWorkspacePatternMatches(route.pattern, url)) ??
881
+ null);
882
+ }
883
+ function recordBrowserWorkspaceNetworkRequest(state, request) {
884
+ const entry = {
885
+ ...request,
886
+ id: `req_${state.networkNextRequestId++}`,
887
+ timestamp: getBrowserWorkspaceTimestamp(),
888
+ };
889
+ state.networkRequests.push(entry);
890
+ if (state.networkHar.active) {
891
+ state.networkHar.entries.push(entry);
892
+ }
893
+ return entry;
894
+ }
895
+ async function fetchBrowserWorkspaceTrackedResponse(state, url, init = {}, resourceType) {
896
+ if (state.settings.offline) {
897
+ recordBrowserWorkspaceNetworkRequest(state, {
898
+ matchedRoute: null,
899
+ method: String(init.method ?? "GET").toUpperCase(),
900
+ resourceType,
901
+ responseBody: null,
902
+ responseHeaders: {},
903
+ status: 0,
904
+ url,
905
+ });
906
+ throw new Error("Browser workspace is offline.");
907
+ }
908
+ const route = findBrowserWorkspaceNetworkRoute(state, url);
909
+ if (route?.abort) {
910
+ recordBrowserWorkspaceNetworkRequest(state, {
911
+ matchedRoute: route.pattern,
912
+ method: String(init.method ?? "GET").toUpperCase(),
913
+ resourceType,
914
+ responseBody: null,
915
+ responseHeaders: route.headers,
916
+ status: 0,
917
+ url,
918
+ });
919
+ throw new Error(`Browser workspace network route aborted request: ${url}`);
920
+ }
921
+ if (route &&
922
+ (route.body !== null ||
923
+ route.status !== null ||
924
+ Object.keys(route.headers).length > 0)) {
925
+ const response = new Response(route?.body ?? "", {
926
+ headers: route?.headers,
927
+ status: route?.status ?? 200,
928
+ });
929
+ recordBrowserWorkspaceNetworkRequest(state, {
930
+ matchedRoute: route?.pattern ?? null,
931
+ method: String(init.method ?? "GET").toUpperCase(),
932
+ resourceType,
933
+ responseBody: route?.body ?? "",
934
+ responseHeaders: route?.headers ?? {},
935
+ status: route?.status ?? 200,
936
+ url,
937
+ });
938
+ return response;
939
+ }
940
+ const headers = new Headers(init.headers ?? {});
941
+ for (const [key, value] of Object.entries(state.settings.headers)) {
942
+ if (!headers.has(key)) {
943
+ headers.set(key, value);
944
+ }
945
+ }
946
+ if (state.settings.credentials &&
947
+ !headers.has("Authorization") &&
948
+ state.settings.credentials.username) {
949
+ headers.set("Authorization", `Basic ${Buffer.from(`${state.settings.credentials.username}:${state.settings.credentials.password}`).toString("base64")}`);
950
+ }
951
+ const response = await browserWorkspacePageFetch(url, {
952
+ ...init,
953
+ headers,
954
+ redirect: init.redirect ?? "follow",
955
+ signal: init.signal ?? AbortSignal.timeout(DEFAULT_TIMEOUT_MS),
956
+ });
957
+ let responseBody = null;
958
+ if (resourceType !== "document") {
959
+ const clone = response.clone();
960
+ try {
961
+ responseBody = await clone.text();
962
+ }
963
+ catch {
964
+ responseBody = null;
965
+ }
966
+ }
967
+ recordBrowserWorkspaceNetworkRequest(state, {
968
+ matchedRoute: null,
969
+ method: String(init.method ?? "GET").toUpperCase(),
970
+ resourceType,
971
+ responseBody,
972
+ responseHeaders: Object.fromEntries(response.headers.entries()),
973
+ status: response.status,
974
+ url: response.url || url,
975
+ });
976
+ return response;
977
+ }
978
+ function escapeBrowserWorkspacePdfText(value) {
979
+ return value
980
+ .replaceAll("\\", "\\\\")
981
+ .replaceAll("(", "\\(")
982
+ .replaceAll(")", "\\)");
983
+ }
984
+ function createBrowserWorkspacePdfBuffer(title, bodyText) {
985
+ const lines = [
986
+ title.trim() || "Eliza Browser Workspace",
987
+ "",
988
+ ...bodyText
989
+ .split(/\r?\n/)
990
+ .map((line) => line.trim())
991
+ .filter(Boolean)
992
+ .slice(0, 32),
993
+ ];
994
+ const contentLines = lines.map((line, index) => {
995
+ const offset = index === 0 ? "50 750 Td" : "0 -18 Td";
996
+ return `${offset} (${escapeBrowserWorkspacePdfText(line)}) Tj`;
997
+ });
998
+ const stream = `BT\n/F1 12 Tf\n${contentLines.join("\n")}\nET`;
999
+ const objects = [
1000
+ "<< /Type /Catalog /Pages 2 0 R >>",
1001
+ "<< /Type /Pages /Kids [3 0 R] /Count 1 >>",
1002
+ "<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>",
1003
+ `<< /Length ${Buffer.byteLength(stream, "utf8")} >>\nstream\n${stream}\nendstream`,
1004
+ "<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>",
1005
+ ];
1006
+ let pdf = "%PDF-1.4\n";
1007
+ const offsets = [0];
1008
+ for (let index = 0; index < objects.length; index += 1) {
1009
+ offsets.push(Buffer.byteLength(pdf, "utf8"));
1010
+ pdf += `${index + 1} 0 obj\n${objects[index]}\nendobj\n`;
1011
+ }
1012
+ const xrefOffset = Buffer.byteLength(pdf, "utf8");
1013
+ pdf += `xref\n0 ${objects.length + 1}\n0000000000 65535 f \n`;
1014
+ for (let index = 1; index < offsets.length; index += 1) {
1015
+ pdf += `${String(offsets[index]).padStart(10, "0")} 00000 n \n`;
1016
+ }
1017
+ pdf += `trailer\n<< /Size ${objects.length + 1} /Root 1 0 R >>\nstartxref\n${xrefOffset}\n%%EOF`;
1018
+ return Buffer.from(pdf, "utf8");
1019
+ }
1020
+ function createBrowserWorkspaceSyntheticScreenshotData(title, url, bodyText, viewport) {
1021
+ const width = viewport?.width ?? 1280;
1022
+ const height = viewport?.height ?? 720;
1023
+ const lines = [
1024
+ title || "Eliza Browser Workspace",
1025
+ url,
1026
+ "",
1027
+ ...bodyText
1028
+ .split(/\r?\n/)
1029
+ .map((line) => line.trim())
1030
+ .filter(Boolean)
1031
+ .slice(0, 18),
1032
+ ];
1033
+ const escapedLines = lines.map((line) => line
1034
+ .replaceAll("&", "&amp;")
1035
+ .replaceAll("<", "&lt;")
1036
+ .replaceAll(">", "&gt;"));
1037
+ const svg = `<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><rect width="100%" height="100%" fill="#faf7f1"/><rect x="24" y="24" width="${width - 48}" height="${height - 48}" rx="18" fill="#ffffff" stroke="#d8d1c4"/><text x="48" y="72" font-family="Menlo, Monaco, monospace" font-size="20" fill="#111111">${escapedLines.map((line, index) => `<tspan x="48" dy="${index === 0 ? 0 : 28}">${line}</tspan>`).join("")}</text></svg>`;
1038
+ return Buffer.from(svg, "utf8").toString("base64");
1039
+ }
1040
+ function createBrowserWorkspaceSnapshotRecord(title, url, bodyText) {
1041
+ return {
1042
+ bodyText: normalizeBrowserWorkspaceText(bodyText),
1043
+ title: normalizeBrowserWorkspaceText(title),
1044
+ url: normalizeBrowserWorkspaceText(url),
1045
+ };
1046
+ }
1047
+ function buildBrowserWorkspaceDocumentSnapshotText(document) {
1048
+ const bodyText = normalizeBrowserWorkspaceText(document.body?.textContent);
1049
+ const controlText = Array.from(document.querySelectorAll("input, textarea, select, option:checked"))
1050
+ .map((element) => {
1051
+ const name = element.getAttribute("name") ||
1052
+ element.getAttribute("id") ||
1053
+ element.tagName.toLowerCase();
1054
+ const value = element.tagName === "SELECT"
1055
+ ? element.value
1056
+ : "value" in element
1057
+ ? element.value
1058
+ : (element.textContent ?? "");
1059
+ return `${name}:${normalizeBrowserWorkspaceText(value)}`;
1060
+ })
1061
+ .filter(Boolean)
1062
+ .join(" ");
1063
+ return normalizeBrowserWorkspaceText(`${bodyText} ${controlText}`);
1064
+ }
1065
+ function diffBrowserWorkspaceSnapshots(before, after) {
1066
+ return {
1067
+ changed: !before ||
1068
+ before.bodyText !== after.bodyText ||
1069
+ before.title !== after.title ||
1070
+ before.url !== after.url,
1071
+ previous: before,
1072
+ current: after,
1073
+ };
1074
+ }
1075
+ async function writeBrowserWorkspaceFile(filePath, contents) {
1076
+ const resolved = path.resolve(filePath);
1077
+ await fsp.mkdir(path.dirname(resolved), { recursive: true });
1078
+ await fsp.writeFile(resolved, contents);
1079
+ return resolved;
1080
+ }
1081
+ function resolveBrowserWorkspaceFindElement(document, command) {
1082
+ switch (command.findBy) {
1083
+ case "alt":
1084
+ return (Array.from(document.querySelectorAll("[alt]")).find((element) => browserWorkspaceTextMatches(element.getAttribute("alt") ?? "", command.text ?? "", command.exact)) ?? null);
1085
+ case "first":
1086
+ return command.selector?.trim()
1087
+ ? queryBrowserWorkspaceSelector(document, command.selector)
1088
+ : null;
1089
+ case "label":
1090
+ return command.text?.trim()
1091
+ ? findBrowserWorkspaceElementByLabel(document, command.text, command.exact)
1092
+ : null;
1093
+ case "last":
1094
+ return command.selector?.trim()
1095
+ ? (queryAllBrowserWorkspaceSelector(document, command.selector).at(-1) ?? null)
1096
+ : null;
1097
+ case "nth":
1098
+ if (!command.selector?.trim()) {
1099
+ return null;
1100
+ }
1101
+ if (typeof command.index !== "number" ||
1102
+ !Number.isInteger(command.index)) {
1103
+ return null;
1104
+ }
1105
+ return (queryAllBrowserWorkspaceSelector(document, command.selector).at(command.index) ?? null);
1106
+ case "placeholder":
1107
+ return (Array.from(document.querySelectorAll("[placeholder]")).find((element) => browserWorkspaceTextMatches(element.getAttribute("placeholder") ?? "", command.text ?? "", command.exact)) ?? null);
1108
+ case "role":
1109
+ return command.role?.trim()
1110
+ ? findBrowserWorkspaceElementByRole(document, command.role, command.name, command.exact)
1111
+ : null;
1112
+ case "testid":
1113
+ return command.text?.trim()
1114
+ ? document.querySelector(`[data-testid=${buildBrowserWorkspaceCssStringLiteral(command.text)}]`)
1115
+ : null;
1116
+ case "text":
1117
+ return command.text?.trim()
1118
+ ? findBrowserWorkspaceElementByText(document, command.text)
1119
+ : null;
1120
+ case "title":
1121
+ return (Array.from(document.querySelectorAll("[title]")).find((element) => browserWorkspaceTextMatches(element.getAttribute("title") ?? "", command.text ?? "", command.exact)) ?? null);
1122
+ default:
1123
+ return null;
1124
+ }
1125
+ }
1126
+ function findBrowserWorkspaceElementByText(document, needle) {
1127
+ const wanted = normalizeBrowserWorkspaceText(needle).toLowerCase();
1128
+ if (!wanted) {
1129
+ return null;
1130
+ }
1131
+ const candidates = Array.from(document.querySelectorAll("a, button, input, textarea, select, option, label, h1, h2, h3, [role='button'], [data-testid]"));
1132
+ for (const element of candidates) {
1133
+ const haystacks = [
1134
+ element.textContent,
1135
+ element.getAttribute("aria-label"),
1136
+ element.getAttribute("placeholder"),
1137
+ element.getAttribute("title"),
1138
+ element.getAttribute("name"),
1139
+ element
1140
+ .value,
1141
+ ]
1142
+ .map((value) => normalizeBrowserWorkspaceText(value))
1143
+ .filter(Boolean)
1144
+ .map((value) => value.toLowerCase());
1145
+ if (haystacks.some((value) => value.includes(wanted))) {
1146
+ return element;
1147
+ }
1148
+ }
1149
+ return null;
1150
+ }
1151
+ function resolveBrowserWorkspaceElement(document, selector, text, command) {
1152
+ const normalizedSelector = selector
1153
+ ? normalizeBrowserWorkspaceSelectorSyntax(selector)
1154
+ : undefined;
1155
+ if (normalizedSelector) {
1156
+ const selectorChain = normalizedSelector
1157
+ .split(/\s*>>\s*/)
1158
+ .map((segment) => segment.trim())
1159
+ .filter(Boolean);
1160
+ if (selectorChain.length > 1) {
1161
+ let current = resolveBrowserWorkspaceElement(document, selectorChain[0], undefined, command);
1162
+ for (let index = 1; current && index < selectorChain.length; index += 1) {
1163
+ const segment = selectorChain[index];
1164
+ if (!segment) {
1165
+ continue;
1166
+ }
1167
+ if (typeof current.matches === "function" &&
1168
+ current.matches(segment)) {
1169
+ continue;
1170
+ }
1171
+ if (/^(input|textarea|select)(?:\[[^\]]+\])?$/i.test(segment) &&
1172
+ (current.tagName === "INPUT" ||
1173
+ current.tagName === "TEXTAREA" ||
1174
+ current.tagName === "SELECT")) {
1175
+ continue;
1176
+ }
1177
+ current = queryBrowserWorkspaceSelector(current, segment);
1178
+ }
1179
+ return current;
1180
+ }
1181
+ const semanticCommand = mergeBrowserWorkspaceSelectorCommand(command, normalizedSelector);
1182
+ if (semanticCommand) {
1183
+ return resolveBrowserWorkspaceFindElement(document, semanticCommand);
1184
+ }
1185
+ return queryBrowserWorkspaceSelector(document, normalizedSelector);
1186
+ }
1187
+ if (command?.findBy) {
1188
+ return resolveBrowserWorkspaceFindElement(document, command);
1189
+ }
1190
+ const normalizedText = text?.trim();
1191
+ if (normalizedText) {
1192
+ return findBrowserWorkspaceElementByText(document, normalizedText);
1193
+ }
1194
+ return null;
1195
+ }
1196
+ function ensureBrowserWorkspaceFormControlElement(element, subaction) {
1197
+ if (element.tagName === "INPUT" ||
1198
+ element.tagName === "TEXTAREA" ||
1199
+ element.tagName === "SELECT") {
1200
+ return element;
1201
+ }
1202
+ throw new Error(`Eliza browser workspace ${subaction} requires an input, textarea, or select target.`);
1203
+ }
1204
+ function ensureBrowserWorkspaceCheckboxElement(element, subaction) {
1205
+ if (element.tagName === "INPUT") {
1206
+ const input = element;
1207
+ const type = input.type.trim().toLowerCase();
1208
+ if (type === "checkbox" || type === "radio") {
1209
+ return input;
1210
+ }
1211
+ }
1212
+ throw new Error(`Eliza browser workspace ${subaction} requires a checkbox or radio input target.`);
1213
+ }
1214
+ function getBrowserWorkspaceElementStyles(element, window) {
1215
+ const computed = window.getComputedStyle(element);
1216
+ return {
1217
+ display: computed.display || null,
1218
+ visibility: computed.visibility || null,
1219
+ opacity: computed.opacity || null,
1220
+ };
1221
+ }
1222
+ function normalizeBrowserWorkspaceCommand(command) {
1223
+ const raw = command;
1224
+ const normalizedSubaction = typeof raw.subaction === "string"
1225
+ ? raw.subaction.trim().toLowerCase()
1226
+ : typeof raw.operation === "string"
1227
+ ? raw.operation.trim().toLowerCase()
1228
+ : "";
1229
+ const subaction = normalizedSubaction === "goto"
1230
+ ? "navigate"
1231
+ : normalizedSubaction === "read"
1232
+ ? "get"
1233
+ : command.subaction;
1234
+ const timeoutMs = parseBrowserWorkspaceNumberLike(command.timeoutMs) ??
1235
+ parseBrowserWorkspaceNumberLike(raw.ms) ??
1236
+ parseBrowserWorkspaceNumberLike(raw.milliseconds);
1237
+ return {
1238
+ ...command,
1239
+ subaction,
1240
+ timeoutMs,
1241
+ steps: Array.isArray(command.steps)
1242
+ ? command.steps.map((step) => normalizeBrowserWorkspaceCommand(step))
1243
+ : command.steps,
1244
+ };
1245
+ }
1246
+ function getBrowserWorkspaceElementBox(element) {
1247
+ const box = typeof element.getBoundingClientRect === "function"
1248
+ ? element.getBoundingClientRect()
1249
+ : {
1250
+ bottom: 0,
1251
+ height: 0,
1252
+ left: 0,
1253
+ right: 0,
1254
+ top: 0,
1255
+ width: 0,
1256
+ x: 0,
1257
+ y: 0,
1258
+ };
1259
+ return {
1260
+ bottom: box.bottom,
1261
+ height: box.height,
1262
+ left: box.left,
1263
+ right: box.right,
1264
+ top: box.top,
1265
+ width: box.width,
1266
+ x: box.x,
1267
+ y: box.y,
1268
+ };
1269
+ }
1270
+ function getBrowserWorkspaceElementValue(element) {
1271
+ if (element.tagName === "INPUT" ||
1272
+ element.tagName === "TEXTAREA" ||
1273
+ element.tagName === "SELECT") {
1274
+ const control = element;
1275
+ if (element.tagName === "INPUT") {
1276
+ const input = control;
1277
+ const type = input.type.trim().toLowerCase();
1278
+ if (type === "checkbox" || type === "radio") {
1279
+ return input.checked;
1280
+ }
1281
+ }
1282
+ return control.value;
1283
+ }
1284
+ return null;
1285
+ }
1286
+ function findClosestBrowserWorkspaceForm(element) {
1287
+ if (!element) {
1288
+ return null;
1289
+ }
1290
+ return (element.tagName === "FORM" ? element : element.closest("form"));
1291
+ }
1292
+ async function activateWebBrowserWorkspaceElement(tab, element, subaction) {
1293
+ const tag = element.tagName.toLowerCase();
1294
+ if (tag === "a") {
1295
+ const href = element.getAttribute("href")?.trim();
1296
+ if (!href) {
1297
+ throw new Error("Target link does not have an href.");
1298
+ }
1299
+ const nextUrl = new URL(href, tab.url).toString();
1300
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
1301
+ tab.url = assertBrowserWorkspaceUrl(nextUrl);
1302
+ tab.title = inferBrowserWorkspaceTitle(tab.url);
1303
+ tab.dom = null;
1304
+ tab.loadedUrl = null;
1305
+ pushWebBrowserWorkspaceHistory(tab, tab.url);
1306
+ await loadWebBrowserWorkspaceTabDocument(tab);
1307
+ return {
1308
+ mode: "web",
1309
+ subaction,
1310
+ tab: cloneWebBrowserWorkspaceTabState(tab),
1311
+ value: {
1312
+ clickCount: subaction === "dblclick" ? 2 : 1,
1313
+ selector: buildBrowserWorkspaceElementSelector(element),
1314
+ url: tab.url,
1315
+ },
1316
+ };
1317
+ }
1318
+ const inputElement = tag === "input" ? element : null;
1319
+ const inputType = inputElement?.type?.toLowerCase() ?? "";
1320
+ if (inputElement && (inputType === "checkbox" || inputType === "radio")) {
1321
+ inputElement.checked = inputType === "radio" ? true : !inputElement.checked;
1322
+ return {
1323
+ mode: "web",
1324
+ subaction,
1325
+ value: {
1326
+ checked: inputElement.checked,
1327
+ clickCount: subaction === "dblclick" ? 2 : 1,
1328
+ selector: buildBrowserWorkspaceElementSelector(element),
1329
+ },
1330
+ };
1331
+ }
1332
+ const submitForm = findClosestBrowserWorkspaceForm(element);
1333
+ if (submitForm &&
1334
+ (tag === "form" ||
1335
+ tag === "button" ||
1336
+ (tag === "input" &&
1337
+ ["button", "image", "submit"].includes(inputType || "submit")))) {
1338
+ await submitWebBrowserWorkspaceForm(tab, submitForm);
1339
+ return {
1340
+ mode: "web",
1341
+ subaction,
1342
+ tab: cloneWebBrowserWorkspaceTabState(tab),
1343
+ value: {
1344
+ clickCount: subaction === "dblclick" ? 2 : 1,
1345
+ selector: buildBrowserWorkspaceElementSelector(element),
1346
+ url: tab.url,
1347
+ },
1348
+ };
1349
+ }
1350
+ return {
1351
+ mode: "web",
1352
+ subaction,
1353
+ value: {
1354
+ clickCount: subaction === "dblclick" ? 2 : 1,
1355
+ selector: buildBrowserWorkspaceElementSelector(element),
1356
+ text: normalizeBrowserWorkspaceText(element.textContent),
1357
+ },
1358
+ };
1359
+ }
1360
+ function setBrowserWorkspaceControlValue(control, nextValue) {
1361
+ control.value = nextValue;
1362
+ if (control.tagName === "TEXTAREA") {
1363
+ control.textContent = nextValue;
1364
+ }
1365
+ control.setAttribute("value", nextValue);
1366
+ }
1367
+ function scrollWebBrowserWorkspaceTarget(dom, element, direction, pixels) {
1368
+ const resolvedPixels = Number.isFinite(pixels)
1369
+ ? Math.max(1, Math.abs(pixels))
1370
+ : 240;
1371
+ const axis = direction === "left" || direction === "right" ? "x" : "y";
1372
+ const delta = direction === "up" || direction === "left"
1373
+ ? -resolvedPixels
1374
+ : resolvedPixels;
1375
+ if (element && element instanceof dom.window.HTMLElement) {
1376
+ if (axis === "y") {
1377
+ element.scrollTop = (element.scrollTop || 0) + delta;
1378
+ return {
1379
+ axis,
1380
+ selector: buildBrowserWorkspaceElementSelector(element),
1381
+ value: element.scrollTop,
1382
+ };
1383
+ }
1384
+ element.scrollLeft = (element.scrollLeft || 0) + delta;
1385
+ return {
1386
+ axis,
1387
+ selector: buildBrowserWorkspaceElementSelector(element),
1388
+ value: element.scrollLeft,
1389
+ };
1390
+ }
1391
+ const key = axis === "y" ? "__elizaScrollY" : "__elizaScrollX";
1392
+ const current = Number(dom.window[key] ?? 0);
1393
+ const next = current + delta;
1394
+ dom.window[key] = next;
1395
+ return {
1396
+ axis,
1397
+ selector: null,
1398
+ value: next,
1399
+ };
1400
+ }
1401
+ function ensureBrowserWorkspaceDom(tab) {
1402
+ if (tab.dom && tab.loadedUrl === tab.url) {
1403
+ return tab.dom;
1404
+ }
1405
+ throw new Error(`Browser workspace tab ${tab.id} is not loaded yet. Reload or inspect the page first.`);
1406
+ }
1407
+ async function loadWebBrowserWorkspaceTabDocument(tab) {
1408
+ const state = getBrowserWorkspaceRuntimeState("web", tab.id);
1409
+ if (tab.url === "about:blank") {
1410
+ tab.dom = createEmptyWebBrowserWorkspaceDom(tab.url);
1411
+ installBrowserWorkspaceWebRuntime(tab, tab.dom);
1412
+ tab.loadedUrl = tab.url;
1413
+ tab.title = "New Tab";
1414
+ tab.updatedAt = getBrowserWorkspaceTimestamp();
1415
+ return;
1416
+ }
1417
+ const response = await fetchBrowserWorkspaceTrackedResponse(state, tab.url, {}, "document");
1418
+ if (!response.ok) {
1419
+ throw new Error(`Browser workspace web load failed (${response.status}): ${tab.url}`);
1420
+ }
1421
+ const html = await response.text();
1422
+ const finalUrl = assertBrowserWorkspaceUrl(response.url?.trim() || tab.url);
1423
+ const dom = new (getJSDOMClass())(html, {
1424
+ pretendToBeVisual: true,
1425
+ url: finalUrl,
1426
+ });
1427
+ installBrowserWorkspaceWebRuntime(tab, dom);
1428
+ resetBrowserWorkspaceRuntimeNavigationState(state);
1429
+ tab.dom = dom;
1430
+ tab.loadedUrl = finalUrl;
1431
+ tab.url = finalUrl;
1432
+ tab.title =
1433
+ normalizeBrowserWorkspaceText(dom.window.document.title) ||
1434
+ inferBrowserWorkspaceTitle(finalUrl);
1435
+ tab.updatedAt = getBrowserWorkspaceTimestamp();
1436
+ tab.history[tab.historyIndex] = finalUrl;
1437
+ }
1438
+ async function ensureLoadedWebBrowserWorkspaceTabDocument(tab) {
1439
+ if (!tab.dom || tab.loadedUrl !== tab.url) {
1440
+ await loadWebBrowserWorkspaceTabDocument(tab);
1441
+ }
1442
+ return ensureBrowserWorkspaceDom(tab);
1443
+ }
1444
+ function pushWebBrowserWorkspaceHistory(tab, nextUrl) {
1445
+ const nextHistory = tab.history.slice(0, tab.historyIndex + 1);
1446
+ nextHistory.push(nextUrl);
1447
+ tab.history = nextHistory;
1448
+ tab.historyIndex = nextHistory.length - 1;
1449
+ }
1450
+ function findWebBrowserWorkspaceTargetTabId(command) {
1451
+ if (command.id?.trim()) {
1452
+ return command.id.trim();
1453
+ }
1454
+ const current = getCurrentWebBrowserWorkspaceTabState();
1455
+ if (!current) {
1456
+ throw createBrowserWorkspaceCommandTargetError(command.subaction);
1457
+ }
1458
+ return current.id;
1459
+ }
1460
+ function resolveBrowserWorkspaceCurrentTab(tabs) {
1461
+ if (tabs.length === 0) {
1462
+ return null;
1463
+ }
1464
+ return (tabs.find((tab) => tab.visible) ??
1465
+ [...tabs].sort((left, right) => {
1466
+ const leftTime = left.lastFocusedAt ?? left.updatedAt;
1467
+ const rightTime = right.lastFocusedAt ?? right.updatedAt;
1468
+ return (rightTime.localeCompare(leftTime) || left.id.localeCompare(right.id));
1469
+ })[0] ??
1470
+ null);
1471
+ }
1472
+ async function resolveDesktopBrowserWorkspaceTargetTabId(command, env) {
1473
+ if (command.id?.trim()) {
1474
+ return command.id.trim();
1475
+ }
1476
+ const tabs = await listBrowserWorkspaceTabs(env);
1477
+ const current = resolveBrowserWorkspaceCurrentTab(tabs);
1478
+ if (!current) {
1479
+ throw createBrowserWorkspaceCommandTargetError(command.subaction);
1480
+ }
1481
+ return current.id;
1482
+ }
1483
+ async function readErrorBody(response) {
1484
+ try {
1485
+ return (await response.text()).trim().slice(0, 240);
1486
+ }
1487
+ catch {
1488
+ return "";
1489
+ }
1490
+ }
1491
+ async function requestBrowserWorkspace(path, init, env = process.env) {
1492
+ const config = resolveBrowserWorkspaceBridgeConfig(env);
1493
+ if (!config) {
1494
+ throw new Error(getBrowserWorkspaceUnavailableMessage());
1495
+ }
1496
+ const headers = new Headers(init?.headers ?? {});
1497
+ headers.set("Accept", "application/json");
1498
+ if (!headers.has("Content-Type") && init?.body) {
1499
+ headers.set("Content-Type", "application/json");
1500
+ }
1501
+ if (config.token) {
1502
+ headers.set("Authorization", `Bearer ${config.token}`);
1503
+ }
1504
+ const response = await fetch(`${config.baseUrl}${path}`, {
1505
+ ...init,
1506
+ headers,
1507
+ signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),
1508
+ });
1509
+ if (!response.ok) {
1510
+ const details = await readErrorBody(response);
1511
+ throw new Error(`Browser workspace request failed (${response.status})${details ? `: ${details}` : ""}`);
1512
+ }
1513
+ return (await response.json());
1514
+ }
1515
+ function createDesktopBrowserWorkspaceCommandScript(command) {
1516
+ return `
1517
+ (() => {
1518
+ const command = ${JSON.stringify(command)};
1519
+ const normalize = (value) => String(value ?? "").replace(/\\s+/g, " ").trim();
1520
+ const textMatches = (candidate, wanted, exact = false) => {
1521
+ const left = normalize(candidate).toLowerCase();
1522
+ const right = normalize(wanted).toLowerCase();
1523
+ if (!left || !right) return false;
1524
+ return exact ? left === right : left.includes(right);
1525
+ };
1526
+ const selectorFor = (element) => {
1527
+ if (!element) return "";
1528
+ if (element.id) return "#" + element.id.replace(/[^a-zA-Z0-9_-]/g, "\\\\$&");
1529
+ const testId = element.getAttribute?.("data-testid");
1530
+ if (testId) return \`[data-testid="\${testId}"]\`;
1531
+ const name = element.getAttribute?.("name");
1532
+ if (name) return \`\${element.tagName.toLowerCase()}[name="\${name}"]\`;
1533
+ const type = element.getAttribute?.("type");
1534
+ if (type) return \`\${element.tagName.toLowerCase()}[type="\${type}"]\`;
1535
+ let index = 1;
1536
+ let previous = element.previousElementSibling;
1537
+ while (previous) {
1538
+ if (previous.tagName === element.tagName) index += 1;
1539
+ previous = previous.previousElementSibling;
1540
+ }
1541
+ return \`\${element.tagName.toLowerCase()}:nth-of-type(\${index})\`;
1542
+ };
1543
+ const serialize = (element) => {
1544
+ const value =
1545
+ element instanceof HTMLInputElement ||
1546
+ element instanceof HTMLTextAreaElement ||
1547
+ element instanceof HTMLSelectElement
1548
+ ? element.value
1549
+ : null;
1550
+ return {
1551
+ selector: selectorFor(element),
1552
+ tag: element.tagName.toLowerCase(),
1553
+ text: normalize(value ?? element.textContent),
1554
+ type: element.getAttribute?.("type"),
1555
+ name: element.getAttribute?.("name"),
1556
+ href: element.getAttribute?.("href"),
1557
+ value: typeof value === "string" ? value : null,
1558
+ };
1559
+ };
1560
+ const searchTexts = (element) => {
1561
+ const labelText = element.id
1562
+ ? Array.from(document.querySelectorAll('label[for="' + element.id + '"]'))
1563
+ .map((label) => label.textContent)
1564
+ .join(" ")
1565
+ : "";
1566
+ return [
1567
+ element.textContent,
1568
+ element.getAttribute?.("aria-label"),
1569
+ element.getAttribute?.("placeholder"),
1570
+ element.getAttribute?.("title"),
1571
+ element.getAttribute?.("name"),
1572
+ element.getAttribute?.("alt"),
1573
+ element.getAttribute?.("data-testid"),
1574
+ labelText,
1575
+ element.value,
1576
+ ]
1577
+ .map((value) => normalize(value))
1578
+ .filter(Boolean);
1579
+ };
1580
+ const isVisible = (element) => {
1581
+ if (!element) return false;
1582
+ if (element.hasAttribute?.("hidden") || element.getAttribute?.("aria-hidden") === "true") {
1583
+ return false;
1584
+ }
1585
+ const style = element.style || {};
1586
+ return style.display !== "none" && style.visibility !== "hidden";
1587
+ };
1588
+ const nativeRole = (element) => {
1589
+ const explicit = element.getAttribute?.("role")?.trim()?.toLowerCase();
1590
+ if (explicit) return explicit;
1591
+ const tag = element.tagName.toLowerCase();
1592
+ if (tag === "a" && element.getAttribute?.("href")) return "link";
1593
+ if (tag === "button") return "button";
1594
+ if (tag === "select") return "combobox";
1595
+ if (tag === "option") return "option";
1596
+ if (tag === "textarea") return "textbox";
1597
+ if (tag === "form") return "form";
1598
+ if (/^h[1-6]$/.test(tag)) return "heading";
1599
+ if (tag === "input") {
1600
+ const type = (element.type || "text").toLowerCase();
1601
+ if (type === "checkbox") return "checkbox";
1602
+ if (type === "radio") return "radio";
1603
+ if (["button", "submit", "reset", "image"].includes(type)) return "button";
1604
+ return "textbox";
1605
+ }
1606
+ return null;
1607
+ };
1608
+ const findByText = (wanted) => {
1609
+ const needle = normalize(wanted).toLowerCase();
1610
+ if (!needle) return null;
1611
+ const elements = Array.from(document.querySelectorAll(
1612
+ "a, button, input, textarea, select, option, label, h1, h2, h3, [role='button'], [data-testid]"
1613
+ ));
1614
+ for (const element of elements) {
1615
+ const haystacks = [
1616
+ element.textContent,
1617
+ element.getAttribute?.("aria-label"),
1618
+ element.getAttribute?.("placeholder"),
1619
+ element.getAttribute?.("title"),
1620
+ element.getAttribute?.("name"),
1621
+ element.value,
1622
+ ]
1623
+ .map((value) => normalize(value))
1624
+ .filter(Boolean)
1625
+ .map((value) => value.toLowerCase());
1626
+ if (haystacks.some((value) => value.includes(needle))) {
1627
+ return element;
1628
+ }
1629
+ }
1630
+ return null;
1631
+ };
1632
+ const findByLabel = (wanted, exact = false) => {
1633
+ const labels = Array.from(document.querySelectorAll("label"));
1634
+ for (const label of labels) {
1635
+ if (!textMatches(label.textContent, wanted, exact)) continue;
1636
+ const forId = label.getAttribute("for");
1637
+ if (forId) {
1638
+ const explicit = document.getElementById(forId);
1639
+ if (explicit) return explicit;
1640
+ }
1641
+ const nested = label.querySelector("input, textarea, select, button");
1642
+ if (nested) return nested;
1643
+ }
1644
+ return null;
1645
+ };
1646
+ const findByRole = (role, name, exact = false) => {
1647
+ const candidates = Array.from(
1648
+ document.querySelectorAll(
1649
+ "a, button, input, textarea, select, option, form, h1, h2, h3, h4, h5, h6, [role], [data-testid]"
1650
+ )
1651
+ );
1652
+ for (const candidate of candidates) {
1653
+ if (nativeRole(candidate) !== role.trim().toLowerCase()) continue;
1654
+ if (!name) return candidate;
1655
+ if (searchTexts(candidate).some((value) => textMatches(value, name, exact))) {
1656
+ return candidate;
1657
+ }
1658
+ }
1659
+ return null;
1660
+ };
1661
+ const trimQuoted = (value) => {
1662
+ const trimmed = String(value || "").trim();
1663
+ const hasTextMatch = trimmed.match(/^has-text\\((?:"([^"]*)"|'([^']*)')\\)$/i);
1664
+ if (hasTextMatch?.[1] || hasTextMatch?.[2]) {
1665
+ return (hasTextMatch[1] || hasTextMatch[2] || "").trim();
1666
+ }
1667
+ if (
1668
+ (trimmed.startsWith('"') && trimmed.endsWith('"')) ||
1669
+ (trimmed.startsWith("'") && trimmed.endsWith("'"))
1670
+ ) {
1671
+ return trimmed.slice(1, -1).trim();
1672
+ }
1673
+ return trimmed;
1674
+ };
1675
+ const normalizeSelectorSyntax = (selector) => {
1676
+ let normalized = String(selector || "").trim();
1677
+ normalized = normalized.replace(
1678
+ /^role\\s*[:=]\\s*([a-z0-9_-]+)\\s+name\\s*[:=]\\s*(.+)$/i,
1679
+ "role=$1[name=$2]"
1680
+ );
1681
+ normalized = normalized.replace(
1682
+ /^((?:label|text|placeholder|alt|title|testid|data-testid)\\s*[:=]\\s*(?:has-text\\((?:"[^"]*"|'[^']*')\\)|"[^"]+"|'[^']+'|[^>]+?))\\s+((?:input|textarea|select)[\\s\\S]*)$/i,
1683
+ "$1 >> $2"
1684
+ );
1685
+ return normalized;
1686
+ };
1687
+ const parseSemanticSelector = (selector) => {
1688
+ const trimmed = normalizeSelectorSyntax(selector);
1689
+ const match = trimmed.match(/^([a-z-]+)\\s*[:=]\\s*(.+)$/i);
1690
+ if (!match) return null;
1691
+ const kind = match[1]?.trim()?.toLowerCase();
1692
+ const rawValue = match[2]?.trim() || "";
1693
+ if (!kind || !rawValue) return null;
1694
+ switch (kind) {
1695
+ case "alt":
1696
+ return { findBy: "alt", text: trimQuoted(rawValue) };
1697
+ case "css":
1698
+ return { selector: trimQuoted(rawValue) };
1699
+ case "data-testid":
1700
+ case "testid":
1701
+ return { findBy: "testid", text: trimQuoted(rawValue) };
1702
+ case "label":
1703
+ return { findBy: "label", text: trimQuoted(rawValue) };
1704
+ case "placeholder":
1705
+ return { findBy: "placeholder", text: trimQuoted(rawValue) };
1706
+ case "role": {
1707
+ const roleMatch = rawValue.match(
1708
+ /^([a-z0-9_-]+)(?:\\s*\\[\\s*name\\s*[:=]\\s*(.+?)\\s*\\])?$/i
1709
+ );
1710
+ if (!roleMatch?.[1]) return null;
1711
+ return {
1712
+ findBy: "role",
1713
+ name: roleMatch[2] ? trimQuoted(roleMatch[2]) : undefined,
1714
+ role: roleMatch[1].trim().toLowerCase(),
1715
+ };
1716
+ }
1717
+ case "text":
1718
+ return { findBy: "text", text: trimQuoted(rawValue) };
1719
+ case "title":
1720
+ return { findBy: "title", text: trimQuoted(rawValue) };
1721
+ default:
1722
+ return null;
1723
+ }
1724
+ };
1725
+ const mergeSelectorCommand = (selector) => {
1726
+ const parsed = parseSemanticSelector(selector);
1727
+ if (!parsed) return null;
1728
+ return { ...command, ...parsed, selector: parsed.selector };
1729
+ };
1730
+ const queryOne = (selector) => {
1731
+ try {
1732
+ return document.querySelector(selector);
1733
+ } catch {
1734
+ throw new Error("Invalid selector " + selector);
1735
+ }
1736
+ };
1737
+ const queryAll = (selector) => {
1738
+ try {
1739
+ return Array.from(document.querySelectorAll(selector));
1740
+ } catch {
1741
+ throw new Error("Invalid selector " + selector);
1742
+ }
1743
+ };
1744
+ const findSemantic = (targetCommand = command) => {
1745
+ switch (targetCommand.findBy) {
1746
+ case "alt":
1747
+ return Array.from(document.querySelectorAll("[alt]")).find((element) =>
1748
+ textMatches(
1749
+ element.getAttribute("alt"),
1750
+ targetCommand.text,
1751
+ targetCommand.exact
1752
+ )
1753
+ ) || null;
1754
+ case "first":
1755
+ return targetCommand.selector ? queryOne(targetCommand.selector) : null;
1756
+ case "label":
1757
+ return targetCommand.text
1758
+ ? findByLabel(targetCommand.text, targetCommand.exact)
1759
+ : null;
1760
+ case "last":
1761
+ return targetCommand.selector
1762
+ ? queryAll(targetCommand.selector).at(-1) || null
1763
+ : null;
1764
+ case "nth":
1765
+ return targetCommand.selector && Number.isInteger(targetCommand.index)
1766
+ ? queryAll(targetCommand.selector).at(targetCommand.index) || null
1767
+ : null;
1768
+ case "placeholder":
1769
+ return Array.from(document.querySelectorAll("[placeholder]")).find((element) =>
1770
+ textMatches(
1771
+ element.getAttribute("placeholder"),
1772
+ targetCommand.text,
1773
+ targetCommand.exact
1774
+ )
1775
+ ) || null;
1776
+ case "role":
1777
+ return targetCommand.role
1778
+ ? findByRole(
1779
+ targetCommand.role,
1780
+ targetCommand.name,
1781
+ targetCommand.exact
1782
+ )
1783
+ : null;
1784
+ case "testid":
1785
+ return targetCommand.text
1786
+ ? document.querySelector('[data-testid="' + targetCommand.text + '"]')
1787
+ : null;
1788
+ case "text":
1789
+ return targetCommand.text ? findByText(targetCommand.text) : null;
1790
+ case "title":
1791
+ return Array.from(document.querySelectorAll("[title]")).find((element) =>
1792
+ textMatches(
1793
+ element.getAttribute("title"),
1794
+ targetCommand.text,
1795
+ targetCommand.exact
1796
+ )
1797
+ ) || null;
1798
+ default:
1799
+ return null;
1800
+ }
1801
+ };
1802
+ const findTarget = () => {
1803
+ if (command.selector) {
1804
+ const selectorChain = normalizeSelectorSyntax(command.selector)
1805
+ .split(/s*>>s*/)
1806
+ .map((segment) => segment.trim())
1807
+ .filter(Boolean);
1808
+ if (selectorChain.length > 1) {
1809
+ let current = queryTarget(selectorChain[0]);
1810
+ for (let index = 1; current && index < selectorChain.length; index += 1) {
1811
+ const segment = selectorChain[index];
1812
+ if (!segment) continue;
1813
+ if (typeof current.matches === "function" && current.matches(segment)) {
1814
+ continue;
1815
+ }
1816
+ if (
1817
+ /^(input|textarea|select)(?:[[^]]+])?$/i.test(segment) &&
1818
+ (current.tagName === "INPUT" ||
1819
+ current.tagName === "TEXTAREA" ||
1820
+ current.tagName === "SELECT")
1821
+ ) {
1822
+ continue;
1823
+ }
1824
+ current = queryOneWithin(current, segment);
1825
+ }
1826
+ return current;
1827
+ }
1828
+ return queryTarget(command.selector);
1829
+ }
1830
+ if (command.findBy) return findSemantic();
1831
+ if (command.text) return findByText(command.text);
1832
+ return null;
1833
+ };
1834
+ const queryOneWithin = (root, selector) => {
1835
+ try {
1836
+ return root.querySelector(selector);
1837
+ } catch {
1838
+ throw new Error("Invalid selector " + selector);
1839
+ }
1840
+ };
1841
+ const queryTarget = (selector) => {
1842
+ const semantic = mergeSelectorCommand(selector);
1843
+ if (semantic) return findSemantic(semantic);
1844
+ return queryOne(selector);
1845
+ };
1846
+ const inspect = () =>
1847
+ Array.from(
1848
+ document.querySelectorAll(
1849
+ "a, button, input, textarea, select, form, [role='button'], [data-testid]"
1850
+ )
1851
+ )
1852
+ .slice(0, 40)
1853
+ .map((element) => serialize(element));
1854
+ const snapshot = () => ({
1855
+ title: document.title,
1856
+ url: location.href,
1857
+ bodyText: normalize(document.body?.textContent).slice(0, 800),
1858
+ elements: inspect(),
1859
+ });
1860
+ const setInputValue = (appendMode, target) => {
1861
+ const element = target || findTarget();
1862
+ if (!element) {
1863
+ throw new Error("Target element was not found.");
1864
+ }
1865
+ if (
1866
+ !(
1867
+ element instanceof HTMLInputElement ||
1868
+ element instanceof HTMLTextAreaElement ||
1869
+ element instanceof HTMLSelectElement
1870
+ )
1871
+ ) {
1872
+ throw new Error("Target element is not an input, textarea, or select.");
1873
+ }
1874
+ const nextValue = appendMode ? \`\${element.value ?? ""}\${command.value ?? ""}\` : (command.value ?? "");
1875
+ element.value = nextValue;
1876
+ element.dispatchEvent(new Event("input", { bubbles: true }));
1877
+ element.dispatchEvent(new Event("change", { bubbles: true }));
1878
+ return { selector: selectorFor(element), value: element.value };
1879
+ };
1880
+ const setChecked = (targetValue) => {
1881
+ const element = findTarget();
1882
+ if (!element) throw new Error("Target element was not found.");
1883
+ if (!(element instanceof HTMLInputElement)) {
1884
+ throw new Error("Target element is not a checkbox or radio input.");
1885
+ }
1886
+ const type = (element.type || "").toLowerCase();
1887
+ if (type !== "checkbox" && type !== "radio") {
1888
+ throw new Error("Target element is not a checkbox or radio input.");
1889
+ }
1890
+ element.checked = targetValue;
1891
+ element.dispatchEvent(new Event("input", { bubbles: true }));
1892
+ element.dispatchEvent(new Event("change", { bubbles: true }));
1893
+ return { checked: element.checked, selector: selectorFor(element) };
1894
+ };
1895
+ const setSelectValue = () => {
1896
+ const element = findTarget();
1897
+ if (!element) throw new Error("Target element was not found.");
1898
+ if (!(element instanceof HTMLSelectElement)) {
1899
+ throw new Error("Target element is not a select.");
1900
+ }
1901
+ const targetValue = command.value ?? "";
1902
+ const option = Array.from(element.options).find(
1903
+ (entry) =>
1904
+ entry.value === targetValue || textMatches(entry.textContent, targetValue, true)
1905
+ );
1906
+ if (!option) {
1907
+ throw new Error("Select option was not found.");
1908
+ }
1909
+ element.value = option.value;
1910
+ option.selected = true;
1911
+ element.dispatchEvent(new Event("input", { bubbles: true }));
1912
+ element.dispatchEvent(new Event("change", { bubbles: true }));
1913
+ return { selector: selectorFor(element), value: element.value };
1914
+ };
1915
+ const focusElement = (element) => {
1916
+ if (!element) throw new Error("Target element was not found.");
1917
+ if (typeof element.focus === "function") {
1918
+ element.focus();
1919
+ }
1920
+ return {
1921
+ focused: document.activeElement === element,
1922
+ selector: selectorFor(element),
1923
+ };
1924
+ };
1925
+ const hoverElement = (element) => {
1926
+ if (!element) throw new Error("Target element was not found.");
1927
+ element.setAttribute("data-eliza-hover", "true");
1928
+ return { hovered: true, selector: selectorFor(element) };
1929
+ };
1930
+ const activateElement = (subaction, element) => {
1931
+ if (!element) throw new Error("Target element was not found.");
1932
+ if (subaction === "dblclick") {
1933
+ element.dispatchEvent(new MouseEvent("dblclick", { bubbles: true }));
1934
+ }
1935
+ if (typeof element.click === "function") {
1936
+ element.click();
1937
+ }
1938
+ return {
1939
+ clickCount: subaction === "dblclick" ? 2 : 1,
1940
+ element: serialize(element),
1941
+ url: location.href,
1942
+ };
1943
+ };
1944
+ const keyboardTarget = () => findTarget() || document.activeElement || document.body;
1945
+ const keyboardWrite = (appendMode) => {
1946
+ const target = keyboardTarget();
1947
+ if (
1948
+ !(
1949
+ target instanceof HTMLInputElement ||
1950
+ target instanceof HTMLTextAreaElement ||
1951
+ target instanceof HTMLSelectElement
1952
+ )
1953
+ ) {
1954
+ throw new Error("Keyboard text input requires an input, textarea, or select target.");
1955
+ }
1956
+ return setInputValue(appendMode, target);
1957
+ };
1958
+ const keyPhase = (phase) => {
1959
+ const target = keyboardTarget();
1960
+ const key = command.key || "Enter";
1961
+ target.dispatchEvent(new KeyboardEvent(phase, { key, bubbles: true }));
1962
+ return { key, phase, selector: selectorFor(target) };
1963
+ };
1964
+ const scrollTarget = () => findTarget();
1965
+ const scroll = () => {
1966
+ const target = scrollTarget();
1967
+ const direction = command.direction || "down";
1968
+ const pixels = Math.max(1, Math.abs(Number(command.pixels) || 240));
1969
+ const axis = direction === "left" || direction === "right" ? "x" : "y";
1970
+ const delta = direction === "up" || direction === "left" ? -pixels : pixels;
1971
+ if (target instanceof HTMLElement) {
1972
+ if (axis === "y") {
1973
+ target.scrollTop = (target.scrollTop || 0) + delta;
1974
+ return { axis, selector: selectorFor(target), value: target.scrollTop };
1975
+ }
1976
+ target.scrollLeft = (target.scrollLeft || 0) + delta;
1977
+ return { axis, selector: selectorFor(target), value: target.scrollLeft };
1978
+ }
1979
+ if (axis === "y") {
1980
+ window.scrollBy(0, delta);
1981
+ return { axis, selector: null, value: window.scrollY };
1982
+ }
1983
+ window.scrollBy(delta, 0);
1984
+ return { axis, selector: null, value: window.scrollX };
1985
+ };
1986
+ const getResult = () => {
1987
+ if (command.getMode === "title") return document.title;
1988
+ if (command.getMode === "url") return location.href;
1989
+ if (command.getMode === "count") {
1990
+ if (!command.selector) throw new Error("count requires selector");
1991
+ const semantic = mergeSelectorCommand(command.selector);
1992
+ return semantic ? Number(Boolean(findSemantic(semantic))) : queryAll(command.selector).length;
1993
+ }
1994
+ const element = findTarget();
1995
+ if (!element) throw new Error("Target element was not found.");
1996
+ switch (command.getMode) {
1997
+ case "attr":
1998
+ if (!command.attribute) throw new Error("attr lookups require attribute");
1999
+ return element.getAttribute(command.attribute);
2000
+ case "box":
2001
+ return element.getBoundingClientRect();
2002
+ case "checked":
2003
+ return element instanceof HTMLInputElement
2004
+ ? Boolean(element.checked)
2005
+ : element instanceof HTMLOptionElement
2006
+ ? Boolean(element.selected)
2007
+ : false;
2008
+ case "enabled":
2009
+ return "disabled" in element ? !Boolean(element.disabled) : true;
2010
+ case "html":
2011
+ return element.innerHTML;
2012
+ case "styles": {
2013
+ const computed = getComputedStyle(element);
2014
+ return {
2015
+ display: computed.display || null,
2016
+ visibility: computed.visibility || null,
2017
+ opacity: computed.opacity || null,
2018
+ };
2019
+ }
2020
+ case "text":
2021
+ return normalize(element.textContent);
2022
+ case "value":
2023
+ return element.value ?? element.getAttribute?.("value");
2024
+ case "visible":
2025
+ return isVisible(element);
2026
+ default:
2027
+ return normalize(element.textContent);
2028
+ }
2029
+ };
2030
+ const waitForCondition = () =>
2031
+ new Promise((resolve, reject) => {
2032
+ if (
2033
+ !command.selector &&
2034
+ !command.findBy &&
2035
+ !command.text &&
2036
+ !command.url &&
2037
+ !command.script &&
2038
+ Number.isFinite(Number(command.timeoutMs))
2039
+ ) {
2040
+ const waitedMs = Math.max(0, Number(command.timeoutMs) || 0);
2041
+ setTimeout(() => resolve({ ok: true, waitedMs }), waitedMs);
2042
+ return;
2043
+ }
2044
+ const deadline = Date.now() + (Number(command.timeoutMs) || 4000);
2045
+ const check = () => {
2046
+ try {
2047
+ if (command.selector && findTarget()) {
2048
+ const found = findTarget();
2049
+ const visible =
2050
+ !command.state || command.state === "visible"
2051
+ ? found && isVisible(found)
2052
+ : !found || !isVisible(found);
2053
+ if (visible) {
2054
+ resolve({ ok: true, selector: command.selector, state: command.state || "visible" });
2055
+ return;
2056
+ }
2057
+ }
2058
+ if (
2059
+ command.findBy &&
2060
+ (!command.state || command.state === "visible") &&
2061
+ findSemantic()
2062
+ ) {
2063
+ resolve({ findBy: command.findBy, ok: true });
2064
+ return;
2065
+ }
2066
+ if (command.text && normalize(document.body?.textContent).includes(command.text)) {
2067
+ resolve({ ok: true, text: command.text });
2068
+ return;
2069
+ }
2070
+ if (command.url && location.href.includes(command.url)) {
2071
+ resolve({ ok: true, url: location.href });
2072
+ return;
2073
+ }
2074
+ if (command.script) {
2075
+ const fn = new Function("document", "window", "location", "return (" + command.script + ");");
2076
+ if (fn(document, window, location)) {
2077
+ resolve({ ok: true, script: true });
2078
+ return;
2079
+ }
2080
+ }
2081
+ if (Date.now() >= deadline) {
2082
+ reject(new Error("Timed out waiting for browser workspace condition."));
2083
+ return;
2084
+ }
2085
+ setTimeout(check, 100);
2086
+ } catch (error) {
2087
+ reject(error);
2088
+ }
2089
+ };
2090
+ check();
2091
+ });
2092
+
2093
+ switch (command.subaction) {
2094
+ case "inspect":
2095
+ return { title: document.title, url: location.href, elements: inspect() };
2096
+ case "snapshot":
2097
+ return snapshot();
2098
+ case "get":
2099
+ return { value: getResult() };
2100
+ case "find": {
2101
+ const element = findTarget();
2102
+ if (!element) throw new Error("Target element was not found.");
2103
+ switch (command.action) {
2104
+ case "check":
2105
+ return setChecked(true);
2106
+ case "click":
2107
+ return activateElement("click", element);
2108
+ case "fill":
2109
+ return setInputValue(false, element);
2110
+ case "focus":
2111
+ return focusElement(element);
2112
+ case "hover":
2113
+ return hoverElement(element);
2114
+ case "text":
2115
+ case undefined:
2116
+ return { element: serialize(element), value: normalize(element.textContent) };
2117
+ case "type":
2118
+ return setInputValue(true, element);
2119
+ case "uncheck":
2120
+ return setChecked(false);
2121
+ default:
2122
+ throw new Error("Unsupported find action.");
2123
+ }
2124
+ }
2125
+ case "click": {
2126
+ const element = findTarget();
2127
+ return activateElement("click", element);
2128
+ }
2129
+ case "dblclick": {
2130
+ const element = findTarget();
2131
+ return activateElement("dblclick", element);
2132
+ }
2133
+ case "check":
2134
+ return setChecked(true);
2135
+ case "fill":
2136
+ return setInputValue(false);
2137
+ case "focus": {
2138
+ const element = findTarget();
2139
+ return focusElement(element);
2140
+ }
2141
+ case "hover": {
2142
+ const element = findTarget();
2143
+ return hoverElement(element);
2144
+ }
2145
+ case "keyboardinserttext":
2146
+ return keyboardWrite(false);
2147
+ case "keyboardtype":
2148
+ return keyboardWrite(true);
2149
+ case "keydown":
2150
+ return keyPhase("keydown");
2151
+ case "keyup":
2152
+ return keyPhase("keyup");
2153
+ case "type":
2154
+ return setInputValue(true);
2155
+ case "press": {
2156
+ const target = findTarget() ?? document.activeElement ?? document.body;
2157
+ const key = command.key || "Enter";
2158
+ target.dispatchEvent(new KeyboardEvent("keydown", { key, bubbles: true }));
2159
+ target.dispatchEvent(new KeyboardEvent("keyup", { key, bubbles: true }));
2160
+ return { key, url: location.href };
2161
+ }
2162
+ case "scroll":
2163
+ return scroll();
2164
+ case "scrollinto": {
2165
+ const element = findTarget();
2166
+ if (!element) throw new Error("Target element was not found.");
2167
+ if (typeof element.scrollIntoView === "function") {
2168
+ element.scrollIntoView();
2169
+ }
2170
+ return { scrolled: true, selector: selectorFor(element) };
2171
+ }
2172
+ case "select":
2173
+ return setSelectValue();
2174
+ case "uncheck":
2175
+ return setChecked(false);
2176
+ case "wait":
2177
+ return waitForCondition();
2178
+ case "back":
2179
+ history.back();
2180
+ return { url: location.href, title: document.title };
2181
+ case "forward":
2182
+ history.forward();
2183
+ return { url: location.href, title: document.title };
2184
+ case "reload":
2185
+ location.reload();
2186
+ return { url: location.href, title: document.title };
2187
+ default:
2188
+ throw new Error(\`Unsupported desktop browser subaction: \${command.subaction}\`);
2189
+ }
2190
+ })()
2191
+ `.trim();
2192
+ }
2193
+ function createDesktopBrowserWorkspaceUtilityScript(command) {
2194
+ return `
2195
+ (() => {
2196
+ const command = ${JSON.stringify(command)};
2197
+ const normalize = (value) => String(value ?? "").replace(/\\s+/g, " ").trim();
2198
+ const state =
2199
+ window.__elizaBrowserWorkspaceState ||
2200
+ (window.__elizaBrowserWorkspaceState = {
2201
+ clipboardText: "",
2202
+ consoleEntries: [],
2203
+ currentFrame: null,
2204
+ dialog: null,
2205
+ errors: [],
2206
+ highlightedSelector: null,
2207
+ mouse: { buttons: [], x: 0, y: 0 },
2208
+ networkHar: { active: false, entries: [], startedAt: null },
2209
+ networkNextRequestId: 1,
2210
+ networkRequests: [],
2211
+ networkRoutes: [],
2212
+ settings: {
2213
+ credentials: null,
2214
+ device: null,
2215
+ geo: null,
2216
+ headers: {},
2217
+ media: null,
2218
+ offline: false,
2219
+ viewport: null
2220
+ }
2221
+ });
2222
+ const patternMatches = (pattern, value) => {
2223
+ const trimmed = String(pattern ?? "").trim();
2224
+ if (!trimmed) return false;
2225
+ if (!trimmed.includes("*")) return String(value ?? "").includes(trimmed);
2226
+ let wildcard = "";
2227
+ for (let i = 0; i < trimmed.length; i += 1) {
2228
+ const char = trimmed[i];
2229
+ if (char === "*") {
2230
+ if (trimmed[i + 1] === "*") {
2231
+ wildcard += ".*";
2232
+ i += 1;
2233
+ } else {
2234
+ wildcard += ".*";
2235
+ }
2236
+ } else {
2237
+ wildcard += char.replace(/[|\\\\{}()[\\]^$+?.]/g, "\\\\$&");
2238
+ }
2239
+ }
2240
+ return new RegExp("^" + wildcard + "$", "i").test(String(value ?? ""));
2241
+ };
2242
+ const buildSelector = (element) => {
2243
+ if (!element || !element.tagName) return null;
2244
+ const testId = element.getAttribute && element.getAttribute("data-testid");
2245
+ if (testId) return '[data-testid="' + testId + '"]';
2246
+ const name = element.getAttribute && element.getAttribute("name");
2247
+ if (name) return element.tagName.toLowerCase() + '[name="' + name + '"]';
2248
+ const title = element.getAttribute && element.getAttribute("title");
2249
+ if (title) return element.tagName.toLowerCase() + '[title="' + title + '"]';
2250
+ return element.tagName.toLowerCase();
2251
+ };
2252
+ const activeDocument = (() => {
2253
+ if (!state.currentFrame) return document;
2254
+ try {
2255
+ const frame = document.querySelector(state.currentFrame);
2256
+ return frame && frame.contentDocument ? frame.contentDocument : document;
2257
+ } catch {
2258
+ return document;
2259
+ }
2260
+ })();
2261
+ const queryOne = (selector, root = activeDocument) => {
2262
+ try {
2263
+ return root.querySelector(selector);
2264
+ } catch {
2265
+ throw new Error("Invalid selector " + selector);
2266
+ }
2267
+ };
2268
+ const findByText = (needle) => {
2269
+ const wanted = normalize(needle).toLowerCase();
2270
+ if (!wanted) return null;
2271
+ const candidates = Array.from(
2272
+ activeDocument.querySelectorAll(
2273
+ "a, button, input, textarea, select, option, label, h1, h2, h3, [role='button'], [data-testid]"
2274
+ )
2275
+ );
2276
+ return (
2277
+ candidates.find((element) => {
2278
+ const haystacks = [
2279
+ element.textContent,
2280
+ element.getAttribute("aria-label"),
2281
+ element.getAttribute("placeholder"),
2282
+ element.getAttribute("title"),
2283
+ element.getAttribute("name"),
2284
+ element.value
2285
+ ]
2286
+ .map((value) => normalize(value).toLowerCase())
2287
+ .filter(Boolean);
2288
+ return haystacks.some((value) => value.includes(wanted));
2289
+ }) || null
2290
+ );
2291
+ };
2292
+ const resolveTarget = () => {
2293
+ if (command.selector) return queryOne(command.selector);
2294
+ if (command.text) return findByText(command.text);
2295
+ return activeDocument.activeElement || activeDocument.body;
2296
+ };
2297
+ const recordRequest = (request) => {
2298
+ const entry = {
2299
+ ...request,
2300
+ id: "req_" + state.networkNextRequestId++,
2301
+ timestamp: new Date().toISOString()
2302
+ };
2303
+ state.networkRequests.push(entry);
2304
+ if (state.networkHar.active) state.networkHar.entries.push(entry);
2305
+ return entry;
2306
+ };
2307
+ if (!state.consoleWrapped) {
2308
+ for (const level of ["log", "info", "warn", "error"]) {
2309
+ console[level] = (...args) => {
2310
+ state.consoleEntries.push({
2311
+ level,
2312
+ message: args.map((value) => normalize(value)).join(" "),
2313
+ timestamp: new Date().toISOString()
2314
+ });
2315
+ };
2316
+ }
2317
+ state.consoleWrapped = true;
2318
+ }
2319
+ if (!state.dialogWrapped) {
2320
+ window.alert = (message) => {
2321
+ state.dialog = { defaultValue: null, message: String(message ?? ""), open: true, type: "alert" };
2322
+ };
2323
+ window.confirm = (message) => {
2324
+ state.dialog = { defaultValue: null, message: String(message ?? ""), open: true, type: "confirm" };
2325
+ return false;
2326
+ };
2327
+ window.prompt = (message, defaultValue) => {
2328
+ state.dialog = {
2329
+ defaultValue: defaultValue ?? null,
2330
+ message: String(message ?? ""),
2331
+ open: true,
2332
+ type: "prompt"
2333
+ };
2334
+ return null;
2335
+ };
2336
+ state.dialogWrapped = true;
2337
+ }
2338
+ if (!state.fetchWrapped) {
2339
+ state.originalFetch = window.fetch ? window.fetch.bind(window) : null;
2340
+ window.fetch = async (input, init = {}) => {
2341
+ const inputUrl =
2342
+ typeof input === "string"
2343
+ ? input
2344
+ : input instanceof URL
2345
+ ? input.toString()
2346
+ : typeof input?.url === "string"
2347
+ ? input.url
2348
+ : String(input);
2349
+ const url = new URL(inputUrl, location.href).toString();
2350
+ if (state.settings.offline) {
2351
+ recordRequest({
2352
+ matchedRoute: null,
2353
+ method: String(init.method || "GET").toUpperCase(),
2354
+ resourceType: "fetch",
2355
+ responseBody: null,
2356
+ responseHeaders: {},
2357
+ status: 0,
2358
+ url
2359
+ });
2360
+ throw new Error("Browser workspace is offline.");
2361
+ }
2362
+ const route = [...state.networkRoutes].reverse().find((entry) => patternMatches(entry.pattern, url)) || null;
2363
+ if (route && route.abort) {
2364
+ recordRequest({
2365
+ matchedRoute: route.pattern,
2366
+ method: String(init.method || "GET").toUpperCase(),
2367
+ resourceType: "fetch",
2368
+ responseBody: null,
2369
+ responseHeaders: route.headers || {},
2370
+ status: 0,
2371
+ url
2372
+ });
2373
+ throw new Error("Browser workspace network route aborted request: " + url);
2374
+ }
2375
+ if (route && (route.body !== null || route.status !== null || Object.keys(route.headers || {}).length > 0)) {
2376
+ const response = new Response(route.body || "", {
2377
+ headers: route.headers || {},
2378
+ status: route.status || 200
2379
+ });
2380
+ recordRequest({
2381
+ matchedRoute: route.pattern,
2382
+ method: String(init.method || "GET").toUpperCase(),
2383
+ resourceType: "fetch",
2384
+ responseBody: route.body || "",
2385
+ responseHeaders: route.headers || {},
2386
+ status: route.status || 200,
2387
+ url
2388
+ });
2389
+ return response;
2390
+ }
2391
+ const headers = new Headers(init.headers || {});
2392
+ for (const [key, value] of Object.entries(state.settings.headers || {})) {
2393
+ if (!headers.has(key)) headers.set(key, value);
2394
+ }
2395
+ if (state.settings.credentials && state.settings.credentials.username && !headers.has("Authorization")) {
2396
+ headers.set(
2397
+ "Authorization",
2398
+ "Basic " + btoa(state.settings.credentials.username + ":" + state.settings.credentials.password)
2399
+ );
2400
+ }
2401
+ const response = await state.originalFetch(url, { ...init, headers });
2402
+ recordRequest({
2403
+ matchedRoute: null,
2404
+ method: String(init.method || "GET").toUpperCase(),
2405
+ resourceType: "fetch",
2406
+ responseBody: null,
2407
+ responseHeaders: Object.fromEntries(response.headers.entries()),
2408
+ status: response.status,
2409
+ url: response.url || url
2410
+ });
2411
+ return response;
2412
+ };
2413
+ state.fetchWrapped = true;
2414
+ }
2415
+ Object.defineProperty(navigator, "onLine", {
2416
+ configurable: true,
2417
+ get: () => !state.settings.offline
2418
+ });
2419
+ switch (command.subaction) {
2420
+ case "clipboard": {
2421
+ const action = command.clipboardAction || "read";
2422
+ if (action === "read") return state.clipboardText;
2423
+ if (action === "write") {
2424
+ state.clipboardText = command.value || command.text || "";
2425
+ return state.clipboardText;
2426
+ }
2427
+ if (action === "copy") {
2428
+ const target = resolveTarget();
2429
+ state.clipboardText =
2430
+ target && typeof target.value === "string"
2431
+ ? String(target.value || "")
2432
+ : normalize(target?.textContent || activeDocument.body?.textContent);
2433
+ return state.clipboardText;
2434
+ }
2435
+ const target = resolveTarget();
2436
+ if (target && typeof target.value === "string") {
2437
+ target.value = String(target.value || "") + state.clipboardText;
2438
+ target.setAttribute("value", target.value);
2439
+ return { selector: buildSelector(target), value: target.value };
2440
+ }
2441
+ return state.clipboardText;
2442
+ }
2443
+ case "mouse": {
2444
+ const action = command.mouseAction || "move";
2445
+ if (action === "move") {
2446
+ state.mouse.x = typeof command.x === "number" ? command.x : state.mouse.x;
2447
+ state.mouse.y = typeof command.y === "number" ? command.y : state.mouse.y;
2448
+ return state.mouse;
2449
+ }
2450
+ if (action === "down") {
2451
+ const button = command.button || "left";
2452
+ state.mouse.buttons = Array.from(new Set([...(state.mouse.buttons || []), button]));
2453
+ return state.mouse;
2454
+ }
2455
+ if (action === "up") {
2456
+ const button = command.button || "left";
2457
+ state.mouse.buttons = (state.mouse.buttons || []).filter((entry) => entry !== button);
2458
+ return state.mouse;
2459
+ }
2460
+ window.scrollBy(command.deltaX || 0, command.deltaY || command.pixels || 240);
2461
+ return { axis: Math.abs(command.deltaY || 0) >= Math.abs(command.deltaX || 0) ? "y" : "x", value: window.scrollY };
2462
+ }
2463
+ case "drag": {
2464
+ const source = resolveTarget();
2465
+ const target = command.value ? queryOne(command.value) : null;
2466
+ if (!source || !target) throw new Error("Eliza browser workspace drag requires source selector and target selector in value.");
2467
+ source.setAttribute("data-eliza-dragging", "true");
2468
+ target.setAttribute("data-eliza-drop-target", "true");
2469
+ return { source: buildSelector(source), target: buildSelector(target) };
2470
+ }
2471
+ case "upload": {
2472
+ const target = resolveTarget();
2473
+ if (!target || target.tagName !== "INPUT") throw new Error("Eliza browser workspace upload requires a file input target.");
2474
+ const files = Array.isArray(command.files) ? command.files.map((entry) => String(entry).split(/[\\\\/]/).pop()) : [];
2475
+ target.setAttribute("data-eliza-uploaded-files", files.join(","));
2476
+ return { files, selector: buildSelector(target) };
2477
+ }
2478
+ case "set": {
2479
+ const action = command.setAction || "viewport";
2480
+ if (action === "viewport") {
2481
+ state.settings.viewport = { width: command.width || 1280, height: command.height || 720, scale: command.scale || 1 };
2482
+ } else if (action === "device") {
2483
+ state.settings.device = command.device || null;
2484
+ } else if (action === "geo") {
2485
+ state.settings.geo =
2486
+ typeof command.latitude === "number" && typeof command.longitude === "number"
2487
+ ? { latitude: command.latitude, longitude: command.longitude }
2488
+ : null;
2489
+ } else if (action === "offline") {
2490
+ state.settings.offline = Boolean(command.offline);
2491
+ } else if (action === "headers") {
2492
+ state.settings.headers = command.headers || {};
2493
+ } else if (action === "credentials") {
2494
+ state.settings.credentials =
2495
+ command.username || command.password
2496
+ ? { username: command.username || "", password: command.password || "" }
2497
+ : null;
2498
+ } else if (action === "media") {
2499
+ state.settings.media = command.media || null;
2500
+ }
2501
+ return state.settings;
2502
+ }
2503
+ case "cookies": {
2504
+ const action = command.cookieAction || "get";
2505
+ if (action === "clear") {
2506
+ const current = document.cookie || "";
2507
+ current.split(/;\\s*/).forEach((entry) => {
2508
+ const name = entry.split("=")[0];
2509
+ if (name) document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
2510
+ });
2511
+ return { cleared: true };
2512
+ }
2513
+ if (action === "set") {
2514
+ const name = command.name || command.entryKey;
2515
+ if (!name) throw new Error("Eliza browser workspace cookies set requires name.");
2516
+ document.cookie = name + "=" + (command.value || "") + "; path=/";
2517
+ }
2518
+ const cookieString = document.cookie || "";
2519
+ return Object.fromEntries(
2520
+ cookieString
2521
+ .split(/;\\s*/)
2522
+ .filter(Boolean)
2523
+ .map((entry) => {
2524
+ const [name, ...rest] = entry.split("=");
2525
+ return [name, rest.join("=")];
2526
+ })
2527
+ );
2528
+ }
2529
+ case "storage": {
2530
+ const storage = command.storageArea === "session" ? sessionStorage : localStorage;
2531
+ const action = command.storageAction || "get";
2532
+ if (action === "clear") {
2533
+ storage.clear();
2534
+ return { cleared: true };
2535
+ }
2536
+ if (action === "set") {
2537
+ const key = command.entryKey || command.name;
2538
+ if (!key) throw new Error("Eliza browser workspace storage set requires entryKey.");
2539
+ storage.setItem(key, command.value || "");
2540
+ }
2541
+ if (command.entryKey || command.name) {
2542
+ return storage.getItem(command.entryKey || command.name);
2543
+ }
2544
+ const out = {};
2545
+ for (let i = 0; i < storage.length; i += 1) {
2546
+ const key = storage.key(i);
2547
+ if (key) out[key] = storage.getItem(key) || "";
2548
+ }
2549
+ return out;
2550
+ }
2551
+ case "network": {
2552
+ const action = command.networkAction || "requests";
2553
+ if (action === "route") {
2554
+ if (!command.url) throw new Error("Eliza browser workspace network route requires url pattern.");
2555
+ state.networkRoutes.push({
2556
+ abort: Boolean(command.offline),
2557
+ body: command.responseBody ?? null,
2558
+ headers: command.responseHeaders || {},
2559
+ pattern: command.url,
2560
+ status: typeof command.responseStatus === "number" ? command.responseStatus : null
2561
+ });
2562
+ return state.networkRoutes;
2563
+ }
2564
+ if (action === "unroute") {
2565
+ state.networkRoutes = command.url
2566
+ ? state.networkRoutes.filter((entry) => entry.pattern !== command.url)
2567
+ : [];
2568
+ return state.networkRoutes;
2569
+ }
2570
+ if (action === "request") {
2571
+ return state.networkRequests.find((entry) => entry.id === command.requestId) || null;
2572
+ }
2573
+ if (action === "harstart") {
2574
+ state.networkHar = { active: true, entries: [], startedAt: new Date().toISOString() };
2575
+ return state.networkHar;
2576
+ }
2577
+ if (action === "harstop") {
2578
+ state.networkHar.active = false;
2579
+ return { log: { entries: state.networkHar.entries, startedAt: state.networkHar.startedAt } };
2580
+ }
2581
+ let requests = [...state.networkRequests];
2582
+ if (command.filter) requests = requests.filter((entry) => entry.url.includes(command.filter));
2583
+ if (command.method) requests = requests.filter((entry) => entry.method === String(command.method).toUpperCase());
2584
+ if (command.status) requests = requests.filter((entry) => String(entry.status || "") === String(command.status));
2585
+ return requests;
2586
+ }
2587
+ case "dialog": {
2588
+ const action = command.dialogAction || "status";
2589
+ if (action === "status") return state.dialog;
2590
+ if (state.dialog) state.dialog.open = false;
2591
+ const result =
2592
+ action === "accept"
2593
+ ? { accepted: true, dialog: state.dialog, promptText: command.promptText || command.value || null }
2594
+ : { accepted: false, dialog: state.dialog };
2595
+ state.dialog = null;
2596
+ return result;
2597
+ }
2598
+ case "console":
2599
+ if (command.consoleAction === "clear") state.consoleEntries = [];
2600
+ return state.consoleEntries;
2601
+ case "errors":
2602
+ if (command.consoleAction === "clear") state.errors = [];
2603
+ return state.errors;
2604
+ case "highlight": {
2605
+ const target = resolveTarget();
2606
+ if (!target) throw new Error("Target element was not found.");
2607
+ target.setAttribute("data-eliza-highlight", "true");
2608
+ state.highlightedSelector = buildSelector(target);
2609
+ return { selector: state.highlightedSelector };
2610
+ }
2611
+ case "frame": {
2612
+ if ((command.frameAction || "select") === "main") {
2613
+ state.currentFrame = null;
2614
+ return { frame: null };
2615
+ }
2616
+ const frame = command.selector ? document.querySelector(command.selector) : null;
2617
+ if (!frame || frame.tagName !== "IFRAME") throw new Error("Eliza browser workspace frame select requires an iframe selector.");
2618
+ state.currentFrame = buildSelector(frame);
2619
+ return { frame: state.currentFrame };
2620
+ }
2621
+ default:
2622
+ throw new Error("Unsupported desktop browser workspace utility subaction: " + command.subaction);
2623
+ }
2624
+ })()
2625
+ `.trim();
2626
+ }
2627
+ async function executeDesktopBrowserWorkspaceUtilityCommand(command, env) {
2628
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
2629
+ const startedAt = Date.now();
2630
+ const result = await evaluateBrowserWorkspaceTab({
2631
+ id,
2632
+ script: createDesktopBrowserWorkspaceUtilityScript({
2633
+ ...command,
2634
+ id,
2635
+ }),
2636
+ }, env);
2637
+ const runtime = getBrowserWorkspaceRuntimeState("desktop", id);
2638
+ appendBrowserWorkspaceTraceEntry(runtime, {
2639
+ subaction: command.subaction,
2640
+ type: "utility",
2641
+ });
2642
+ appendBrowserWorkspaceProfilerEntry(runtime, {
2643
+ durationMs: Date.now() - startedAt,
2644
+ subaction: command.subaction,
2645
+ type: "utility",
2646
+ });
2647
+ return {
2648
+ mode: "desktop",
2649
+ subaction: command.subaction,
2650
+ value: result,
2651
+ };
2652
+ }
2653
+ async function getDesktopBrowserWorkspaceSnapshotRecord(command, env) {
2654
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
2655
+ const result = await evaluateBrowserWorkspaceTab({
2656
+ id,
2657
+ script: `
2658
+ (() => {
2659
+ const activeDocument = (() => {
2660
+ const state = window.__elizaBrowserWorkspaceState || {};
2661
+ if (!state.currentFrame) return document;
2662
+ try {
2663
+ const frame = document.querySelector(state.currentFrame);
2664
+ return frame && frame.contentDocument ? frame.contentDocument : document;
2665
+ } catch {
2666
+ return document;
2667
+ }
2668
+ })();
2669
+ const normalize = (value) => String(value ?? "").replace(/\\s+/g, " ").trim();
2670
+ const controlText = Array.from(activeDocument.querySelectorAll("input, textarea, select, option:checked"))
2671
+ .map((element) => {
2672
+ const name = element.getAttribute("name") || element.getAttribute("id") || element.tagName.toLowerCase();
2673
+ const value =
2674
+ element.tagName === "SELECT"
2675
+ ? element.value
2676
+ : typeof element.value === "string"
2677
+ ? element.value
2678
+ : element.textContent || "";
2679
+ return name + ":" + normalize(value);
2680
+ })
2681
+ .filter(Boolean)
2682
+ .join(" ");
2683
+ return {
2684
+ bodyText: normalize((activeDocument.body?.textContent || "") + " " + controlText),
2685
+ title: normalize(document.title),
2686
+ url: location.href
2687
+ };
2688
+ })()
2689
+ `.trim(),
2690
+ }, env);
2691
+ return result;
2692
+ }
2693
+ async function getDesktopBrowserWorkspaceSessionState(command, env) {
2694
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
2695
+ const result = await evaluateBrowserWorkspaceTab({
2696
+ id,
2697
+ script: `
2698
+ (() => {
2699
+ const state = window.__elizaBrowserWorkspaceState || {};
2700
+ const readStorage = (storage) => {
2701
+ const out = {};
2702
+ for (let i = 0; i < storage.length; i += 1) {
2703
+ const key = storage.key(i);
2704
+ if (key) out[key] = storage.getItem(key) || "";
2705
+ }
2706
+ return out;
2707
+ };
2708
+ const cookies = Object.fromEntries(
2709
+ String(document.cookie || "")
2710
+ .split(/;\\s*/)
2711
+ .filter(Boolean)
2712
+ .map((entry) => {
2713
+ const [name, ...rest] = entry.split("=");
2714
+ return [name, rest.join("=")];
2715
+ })
2716
+ );
2717
+ return {
2718
+ clipboard: state.clipboardText || "",
2719
+ cookies,
2720
+ localStorage: readStorage(localStorage),
2721
+ sessionStorage: readStorage(sessionStorage),
2722
+ settings: state.settings || {},
2723
+ url: location.href
2724
+ };
2725
+ })()
2726
+ `.trim(),
2727
+ }, env);
2728
+ return result;
2729
+ }
2730
+ async function loadDesktopBrowserWorkspaceSessionState(command, payload, env) {
2731
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
2732
+ await evaluateBrowserWorkspaceTab({
2733
+ id,
2734
+ script: `
2735
+ (() => {
2736
+ const payload = ${JSON.stringify(payload)};
2737
+ const state =
2738
+ window.__elizaBrowserWorkspaceState ||
2739
+ (window.__elizaBrowserWorkspaceState = { settings: {} });
2740
+ localStorage.clear();
2741
+ for (const [key, value] of Object.entries(payload.localStorage || {})) {
2742
+ localStorage.setItem(key, String(value ?? ""));
2743
+ }
2744
+ sessionStorage.clear();
2745
+ for (const [key, value] of Object.entries(payload.sessionStorage || {})) {
2746
+ sessionStorage.setItem(key, String(value ?? ""));
2747
+ }
2748
+ for (const [key, value] of Object.entries(payload.cookies || {})) {
2749
+ document.cookie = key + "=" + String(value ?? "") + "; path=/";
2750
+ }
2751
+ state.clipboardText = typeof payload.clipboard === "string" ? payload.clipboard : "";
2752
+ state.settings = typeof payload.settings === "object" && payload.settings ? payload.settings : state.settings;
2753
+ return { loaded: true };
2754
+ })()
2755
+ `.trim(),
2756
+ }, env);
2757
+ }
2758
+ async function executeDesktopBrowserWorkspaceDomCommand(command, env) {
2759
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
2760
+ const startedAt = Date.now();
2761
+ command = resolveBrowserWorkspaceCommandElementRefs(command, "desktop", id);
2762
+ const result = await evaluateBrowserWorkspaceTab({
2763
+ id,
2764
+ script: createDesktopBrowserWorkspaceCommandScript({
2765
+ ...command,
2766
+ id,
2767
+ }),
2768
+ }, env);
2769
+ if (command.subaction === "inspect" || command.subaction === "snapshot") {
2770
+ const value = result && typeof result === "object" && !Array.isArray(result)
2771
+ ? result
2772
+ : null;
2773
+ const elements = registerBrowserWorkspaceElementRefs("desktop", id, Array.isArray(value?.elements) ? value.elements : []);
2774
+ return {
2775
+ mode: "desktop",
2776
+ subaction: command.subaction,
2777
+ elements,
2778
+ value: result,
2779
+ };
2780
+ }
2781
+ const runtime = getBrowserWorkspaceRuntimeState("desktop", id);
2782
+ appendBrowserWorkspaceTraceEntry(runtime, {
2783
+ subaction: command.subaction,
2784
+ type: "dom",
2785
+ });
2786
+ appendBrowserWorkspaceProfilerEntry(runtime, {
2787
+ durationMs: Date.now() - startedAt,
2788
+ subaction: command.subaction,
2789
+ type: "dom",
2790
+ });
2791
+ return {
2792
+ mode: "desktop",
2793
+ subaction: command.subaction,
2794
+ value: result && typeof result === "object" && !Array.isArray(result)
2795
+ ? (result.value ?? result)
2796
+ : result,
2797
+ };
2798
+ }
2799
+ async function sleep(ms) {
2800
+ await new Promise((resolve) => setTimeout(resolve, ms));
2801
+ }
2802
+ async function submitWebBrowserWorkspaceForm(tab, form) {
2803
+ const state = getBrowserWorkspaceRuntimeState("web", tab.id);
2804
+ const dom = ensureBrowserWorkspaceDom(tab);
2805
+ const action = form.getAttribute("action")?.trim() || tab.url;
2806
+ const method = (form.getAttribute("method")?.trim() || "get").toLowerCase();
2807
+ const submitUrl = new URL(action, tab.url).toString();
2808
+ const formData = new dom.window.FormData(form);
2809
+ const searchParams = new URLSearchParams();
2810
+ for (const [key, value] of formData.entries()) {
2811
+ searchParams.append(key, String(value));
2812
+ }
2813
+ if (method === "get") {
2814
+ const nextUrl = new URL(submitUrl);
2815
+ nextUrl.search = searchParams.toString();
2816
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
2817
+ tab.url = nextUrl.toString();
2818
+ tab.title = inferBrowserWorkspaceTitle(tab.url);
2819
+ tab.dom = null;
2820
+ tab.loadedUrl = null;
2821
+ pushWebBrowserWorkspaceHistory(tab, tab.url);
2822
+ await loadWebBrowserWorkspaceTabDocument(tab);
2823
+ return;
2824
+ }
2825
+ const response = await fetchBrowserWorkspaceTrackedResponse(state, submitUrl, {
2826
+ body: searchParams.toString(),
2827
+ headers: {
2828
+ "Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
2829
+ },
2830
+ method: method.toUpperCase(),
2831
+ }, "document");
2832
+ if (!response.ok) {
2833
+ throw new Error(`Browser workspace form submit failed (${response.status}): ${submitUrl}`);
2834
+ }
2835
+ const html = await response.text();
2836
+ const finalUrl = assertBrowserWorkspaceUrl(response.url?.trim() || submitUrl);
2837
+ const nextDom = new (getJSDOMClass())(html, {
2838
+ pretendToBeVisual: true,
2839
+ url: finalUrl,
2840
+ });
2841
+ installBrowserWorkspaceWebRuntime(tab, nextDom);
2842
+ resetBrowserWorkspaceRuntimeNavigationState(state);
2843
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
2844
+ tab.url = finalUrl;
2845
+ tab.dom = nextDom;
2846
+ tab.loadedUrl = finalUrl;
2847
+ tab.title =
2848
+ normalizeBrowserWorkspaceText(nextDom.window.document.title) ||
2849
+ inferBrowserWorkspaceTitle(finalUrl);
2850
+ tab.updatedAt = getBrowserWorkspaceTimestamp();
2851
+ pushWebBrowserWorkspaceHistory(tab, finalUrl);
2852
+ }
2853
+ function readBrowserWorkspaceStorage(storage) {
2854
+ const entries = {};
2855
+ for (let index = 0; index < storage.length; index += 1) {
2856
+ const key = storage.key(index);
2857
+ if (!key) {
2858
+ continue;
2859
+ }
2860
+ entries[key] = storage.getItem(key) ?? "";
2861
+ }
2862
+ return entries;
2863
+ }
2864
+ function readBrowserWorkspaceCookies(document) {
2865
+ const cookieString = document.cookie || "";
2866
+ if (!cookieString.trim()) {
2867
+ return {};
2868
+ }
2869
+ return Object.fromEntries(cookieString
2870
+ .split(/;\s*/)
2871
+ .map((entry) => {
2872
+ const [name, ...rest] = entry.split("=");
2873
+ return [name ?? "", rest.join("=")];
2874
+ })
2875
+ .filter((entry) => entry[0].trim().length > 0));
2876
+ }
2877
+ function applyBrowserWorkspaceStateToWebDocument(document, snapshot) {
2878
+ const localEntries = snapshot.localStorage && typeof snapshot.localStorage === "object"
2879
+ ? snapshot.localStorage
2880
+ : {};
2881
+ const sessionEntries = snapshot.sessionStorage && typeof snapshot.sessionStorage === "object"
2882
+ ? snapshot.sessionStorage
2883
+ : {};
2884
+ const cookies = snapshot.cookies && typeof snapshot.cookies === "object"
2885
+ ? snapshot.cookies
2886
+ : {};
2887
+ document.defaultView?.localStorage.clear();
2888
+ for (const [key, value] of Object.entries(localEntries)) {
2889
+ document.defaultView?.localStorage.setItem(key, String(value ?? ""));
2890
+ }
2891
+ document.defaultView?.sessionStorage.clear();
2892
+ for (const [key, value] of Object.entries(sessionEntries)) {
2893
+ document.defaultView?.sessionStorage.setItem(key, String(value ?? ""));
2894
+ }
2895
+ for (const [key, value] of Object.entries(cookies)) {
2896
+ document.cookie = `${key}=${String(value ?? "")}; path=/`;
2897
+ }
2898
+ }
2899
+ async function executeWebBrowserWorkspaceUtilityCommand(command) {
2900
+ return withWebStateLock(async () => {
2901
+ if (![
2902
+ "clipboard",
2903
+ "console",
2904
+ "cookies",
2905
+ "diff",
2906
+ "dialog",
2907
+ "drag",
2908
+ "errors",
2909
+ "eval",
2910
+ "frame",
2911
+ "highlight",
2912
+ "mouse",
2913
+ "network",
2914
+ "pdf",
2915
+ "screenshot",
2916
+ "set",
2917
+ "state",
2918
+ "storage",
2919
+ "trace",
2920
+ "profiler",
2921
+ "upload",
2922
+ ].includes(command.subaction)) {
2923
+ return null;
2924
+ }
2925
+ const id = findWebBrowserWorkspaceTargetTabId(command);
2926
+ const tab = getWebBrowserWorkspaceTabState(id);
2927
+ const dom = await ensureLoadedWebBrowserWorkspaceTabDocument(tab);
2928
+ const runtime = getBrowserWorkspaceRuntimeState("web", id);
2929
+ const frameContext = resolveWebBrowserWorkspaceCommandDocument(tab, dom);
2930
+ const document = frameContext.document;
2931
+ const resolveTarget = () => resolveBrowserWorkspaceElement(document, command.selector, command.text, command);
2932
+ switch (command.subaction) {
2933
+ case "eval": {
2934
+ if (!command.script?.trim()) {
2935
+ throw new Error("Eliza browser workspace eval requires script.");
2936
+ }
2937
+ try {
2938
+ let value;
2939
+ try {
2940
+ value = new Function("document", "fetch", "alert", "confirm", "prompt", "window", "location", "navigator", "localStorage", "sessionStorage", "console", `return (${command.script});`)(document, dom.window.fetch.bind(dom.window), dom.window.alert.bind(dom.window), dom.window.confirm.bind(dom.window), dom.window.prompt.bind(dom.window), dom.window, dom.window.location, dom.window.navigator, dom.window.localStorage, dom.window.sessionStorage, dom.window.console);
2941
+ }
2942
+ catch {
2943
+ value = new Function("document", "fetch", "alert", "confirm", "prompt", "window", "location", "navigator", "localStorage", "sessionStorage", "console", command.script)(document, dom.window.fetch.bind(dom.window), dom.window.alert.bind(dom.window), dom.window.confirm.bind(dom.window), dom.window.prompt.bind(dom.window), dom.window, dom.window.location, dom.window.navigator, dom.window.localStorage, dom.window.sessionStorage, dom.window.console);
2944
+ }
2945
+ if (value &&
2946
+ typeof value === "object" &&
2947
+ typeof value.then === "function") {
2948
+ value = await value;
2949
+ }
2950
+ return { mode: "web", subaction: command.subaction, value };
2951
+ }
2952
+ catch (error) {
2953
+ runtime.errors.push({
2954
+ message: error instanceof Error ? error.message : String(error),
2955
+ stack: error instanceof Error ? (error.stack ?? null) : null,
2956
+ timestamp: getBrowserWorkspaceTimestamp(),
2957
+ });
2958
+ throw error;
2959
+ }
2960
+ }
2961
+ case "screenshot": {
2962
+ const data = createBrowserWorkspaceSyntheticScreenshotData(tab.title, tab.url, buildBrowserWorkspaceDocumentSnapshotText(document), runtime.settings.viewport ?? undefined);
2963
+ runtime.lastScreenshotData = data;
2964
+ if (command.filePath?.trim() || command.outputPath?.trim()) {
2965
+ const targetPath = command.filePath?.trim() || command.outputPath?.trim() || "";
2966
+ await writeBrowserWorkspaceFile(targetPath, Buffer.from(data, "base64"));
2967
+ return {
2968
+ mode: "web",
2969
+ subaction: command.subaction,
2970
+ snapshot: { data },
2971
+ value: { path: path.resolve(targetPath) },
2972
+ };
2973
+ }
2974
+ return {
2975
+ mode: "web",
2976
+ subaction: command.subaction,
2977
+ snapshot: { data },
2978
+ };
2979
+ }
2980
+ case "clipboard": {
2981
+ const action = command.clipboardAction ?? "read";
2982
+ if (action === "read") {
2983
+ return {
2984
+ mode: "web",
2985
+ subaction: command.subaction,
2986
+ value: browserWorkspaceClipboardText,
2987
+ };
2988
+ }
2989
+ if (action === "write") {
2990
+ browserWorkspaceClipboardText = command.value ?? command.text ?? "";
2991
+ return {
2992
+ mode: "web",
2993
+ subaction: command.subaction,
2994
+ value: browserWorkspaceClipboardText,
2995
+ };
2996
+ }
2997
+ if (action === "copy") {
2998
+ const target = resolveTarget();
2999
+ browserWorkspaceClipboardText =
3000
+ target && "value" in target
3001
+ ? String(target.value ?? "")
3002
+ : normalizeBrowserWorkspaceText(target?.textContent ?? document.body?.textContent);
3003
+ return {
3004
+ mode: "web",
3005
+ subaction: command.subaction,
3006
+ value: browserWorkspaceClipboardText,
3007
+ };
3008
+ }
3009
+ const target = resolveTarget() ?? document.activeElement;
3010
+ if (target &&
3011
+ (target.tagName === "INPUT" ||
3012
+ target.tagName === "TEXTAREA" ||
3013
+ target.tagName === "SELECT")) {
3014
+ const control = ensureBrowserWorkspaceFormControlElement(target, "clipboard");
3015
+ setBrowserWorkspaceControlValue(control, `${control.value ?? ""}${browserWorkspaceClipboardText}`);
3016
+ return {
3017
+ mode: "web",
3018
+ subaction: command.subaction,
3019
+ value: {
3020
+ selector: buildBrowserWorkspaceElementSelector(control),
3021
+ value: control.value,
3022
+ },
3023
+ };
3024
+ }
3025
+ return {
3026
+ mode: "web",
3027
+ subaction: command.subaction,
3028
+ value: browserWorkspaceClipboardText,
3029
+ };
3030
+ }
3031
+ case "mouse": {
3032
+ const action = command.mouseAction ?? "move";
3033
+ if (action === "move") {
3034
+ runtime.mouse.x = command.x ?? runtime.mouse.x;
3035
+ runtime.mouse.y = command.y ?? runtime.mouse.y;
3036
+ }
3037
+ else if (action === "down") {
3038
+ const button = command.button ?? "left";
3039
+ runtime.mouse.buttons = Array.from(new Set([...runtime.mouse.buttons, button]));
3040
+ }
3041
+ else if (action === "up") {
3042
+ const button = command.button ?? "left";
3043
+ runtime.mouse.buttons = runtime.mouse.buttons.filter((entry) => entry !== button);
3044
+ }
3045
+ else {
3046
+ return {
3047
+ mode: "web",
3048
+ subaction: command.subaction,
3049
+ value: scrollWebBrowserWorkspaceTarget(dom, resolveTarget(), (command.deltaY ?? 0) < 0 ? "up" : "down", Math.abs(command.deltaY ?? command.pixels ?? 240)),
3050
+ };
3051
+ }
3052
+ return {
3053
+ mode: "web",
3054
+ subaction: command.subaction,
3055
+ value: runtime.mouse,
3056
+ };
3057
+ }
3058
+ case "drag": {
3059
+ const source = resolveTarget();
3060
+ const target = command.value
3061
+ ? resolveBrowserWorkspaceElement(document, command.value)
3062
+ : null;
3063
+ if (!source || !target) {
3064
+ throw new Error("Eliza browser workspace drag requires source selector and target selector in value.");
3065
+ }
3066
+ source.setAttribute("data-eliza-dragging", "true");
3067
+ target.setAttribute("data-eliza-drop-target", "true");
3068
+ return {
3069
+ mode: "web",
3070
+ subaction: command.subaction,
3071
+ value: {
3072
+ source: buildBrowserWorkspaceElementSelector(source),
3073
+ target: buildBrowserWorkspaceElementSelector(target),
3074
+ },
3075
+ };
3076
+ }
3077
+ case "upload": {
3078
+ const target = resolveTarget();
3079
+ if (!target || target.tagName !== "INPUT") {
3080
+ throw new Error("Eliza browser workspace upload requires a file input target.");
3081
+ }
3082
+ const files = (command.files ?? []).map((entry) => path.basename(entry));
3083
+ target.setAttribute("data-eliza-uploaded-files", files.join(","));
3084
+ return {
3085
+ mode: "web",
3086
+ subaction: command.subaction,
3087
+ value: {
3088
+ files,
3089
+ selector: buildBrowserWorkspaceElementSelector(target),
3090
+ },
3091
+ };
3092
+ }
3093
+ case "set": {
3094
+ const action = command.setAction ?? "viewport";
3095
+ if (action === "viewport") {
3096
+ runtime.settings.viewport = {
3097
+ height: Math.max(1, Math.round(command.height ?? 720)),
3098
+ scale: Math.max(1, Number(command.scale ?? 1)),
3099
+ width: Math.max(1, Math.round(command.width ?? 1280)),
3100
+ };
3101
+ }
3102
+ else if (action === "device") {
3103
+ runtime.settings.device = command.device ?? null;
3104
+ }
3105
+ else if (action === "geo") {
3106
+ runtime.settings.geo =
3107
+ typeof command.latitude === "number" &&
3108
+ typeof command.longitude === "number"
3109
+ ? { latitude: command.latitude, longitude: command.longitude }
3110
+ : null;
3111
+ }
3112
+ else if (action === "offline") {
3113
+ runtime.settings.offline = Boolean(command.offline);
3114
+ }
3115
+ else if (action === "headers") {
3116
+ runtime.settings.headers = normalizeBrowserWorkspaceHeaders(command.headers);
3117
+ }
3118
+ else if (action === "credentials") {
3119
+ runtime.settings.credentials =
3120
+ command.username || command.password
3121
+ ? {
3122
+ password: command.password ?? "",
3123
+ username: command.username ?? "",
3124
+ }
3125
+ : null;
3126
+ }
3127
+ else if (action === "media") {
3128
+ runtime.settings.media = command.media ?? null;
3129
+ }
3130
+ applyBrowserWorkspaceDomSettings(dom, runtime);
3131
+ return {
3132
+ mode: "web",
3133
+ subaction: command.subaction,
3134
+ value: runtime.settings,
3135
+ };
3136
+ }
3137
+ case "cookies": {
3138
+ const action = command.cookieAction ?? "get";
3139
+ if (action === "clear") {
3140
+ for (const key of Object.keys(readBrowserWorkspaceCookies(document))) {
3141
+ document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
3142
+ }
3143
+ return {
3144
+ mode: "web",
3145
+ subaction: command.subaction,
3146
+ value: { cleared: true },
3147
+ };
3148
+ }
3149
+ if (action === "set") {
3150
+ const cookieName = command.name?.trim() || command.entryKey?.trim();
3151
+ if (!cookieName) {
3152
+ throw new Error("Eliza browser workspace cookies set requires name.");
3153
+ }
3154
+ document.cookie = `${cookieName}=${command.value ?? ""}; path=/`;
3155
+ }
3156
+ return {
3157
+ mode: "web",
3158
+ subaction: command.subaction,
3159
+ value: readBrowserWorkspaceCookies(document),
3160
+ };
3161
+ }
3162
+ case "storage": {
3163
+ const area = command.storageArea === "session"
3164
+ ? dom.window.sessionStorage
3165
+ : dom.window.localStorage;
3166
+ const action = command.storageAction ?? "get";
3167
+ if (action === "clear") {
3168
+ area.clear();
3169
+ return {
3170
+ mode: "web",
3171
+ subaction: command.subaction,
3172
+ value: { cleared: true },
3173
+ };
3174
+ }
3175
+ if (action === "set") {
3176
+ const key = command.entryKey?.trim() || command.name?.trim();
3177
+ if (!key) {
3178
+ throw new Error("Eliza browser workspace storage set requires entryKey.");
3179
+ }
3180
+ area.setItem(key, command.value ?? "");
3181
+ }
3182
+ if (command.entryKey?.trim() || command.name?.trim()) {
3183
+ const key = command.entryKey?.trim() || command.name?.trim() || "";
3184
+ return {
3185
+ mode: "web",
3186
+ subaction: command.subaction,
3187
+ value: area.getItem(key),
3188
+ };
3189
+ }
3190
+ return {
3191
+ mode: "web",
3192
+ subaction: command.subaction,
3193
+ value: readBrowserWorkspaceStorage(area),
3194
+ };
3195
+ }
3196
+ case "network": {
3197
+ const action = command.networkAction ?? "requests";
3198
+ if (action === "route") {
3199
+ const pattern = command.url?.trim();
3200
+ if (!pattern) {
3201
+ throw new Error("Eliza browser workspace network route requires url pattern.");
3202
+ }
3203
+ runtime.networkRoutes.push({
3204
+ abort: Boolean(command.offline),
3205
+ body: command.responseBody ?? null,
3206
+ headers: normalizeBrowserWorkspaceHeaders(command.responseHeaders),
3207
+ pattern,
3208
+ status: typeof command.responseStatus === "number"
3209
+ ? command.responseStatus
3210
+ : null,
3211
+ });
3212
+ return {
3213
+ mode: "web",
3214
+ subaction: command.subaction,
3215
+ value: runtime.networkRoutes,
3216
+ };
3217
+ }
3218
+ if (action === "unroute") {
3219
+ runtime.networkRoutes = command.url?.trim()
3220
+ ? runtime.networkRoutes.filter((route) => route.pattern !== command.url?.trim())
3221
+ : [];
3222
+ return {
3223
+ mode: "web",
3224
+ subaction: command.subaction,
3225
+ value: runtime.networkRoutes,
3226
+ };
3227
+ }
3228
+ if (action === "request") {
3229
+ const request = runtime.networkRequests.find((entry) => entry.id === command.requestId);
3230
+ return {
3231
+ mode: "web",
3232
+ subaction: command.subaction,
3233
+ value: request ?? null,
3234
+ };
3235
+ }
3236
+ if (action === "harstart") {
3237
+ runtime.networkHar = {
3238
+ active: true,
3239
+ entries: [],
3240
+ startedAt: getBrowserWorkspaceTimestamp(),
3241
+ };
3242
+ return {
3243
+ mode: "web",
3244
+ subaction: command.subaction,
3245
+ value: runtime.networkHar,
3246
+ };
3247
+ }
3248
+ if (action === "harstop") {
3249
+ runtime.networkHar.active = false;
3250
+ const har = {
3251
+ log: {
3252
+ entries: runtime.networkHar.entries,
3253
+ startedAt: runtime.networkHar.startedAt,
3254
+ },
3255
+ };
3256
+ if (command.filePath?.trim() || command.outputPath?.trim()) {
3257
+ const targetPath = command.filePath?.trim() || command.outputPath?.trim() || "";
3258
+ await writeBrowserWorkspaceFile(targetPath, JSON.stringify(har, null, 2));
3259
+ return {
3260
+ mode: "web",
3261
+ subaction: command.subaction,
3262
+ value: { path: path.resolve(targetPath), ...har },
3263
+ };
3264
+ }
3265
+ return { mode: "web", subaction: command.subaction, value: har };
3266
+ }
3267
+ let requests = [...runtime.networkRequests];
3268
+ if (command.filter?.trim()) {
3269
+ requests = requests.filter((entry) => entry.url.includes(command.filter ?? ""));
3270
+ }
3271
+ if (command.method?.trim()) {
3272
+ requests = requests.filter((entry) => entry.method.toUpperCase() ===
3273
+ command.method?.trim().toUpperCase());
3274
+ }
3275
+ if (command.status?.trim()) {
3276
+ const statusFilter = command.status.trim();
3277
+ requests = requests.filter((entry) => {
3278
+ if (entry.status === null) {
3279
+ return false;
3280
+ }
3281
+ if (/^\dxx$/i.test(statusFilter)) {
3282
+ return String(entry.status).startsWith(statusFilter[0] ?? "");
3283
+ }
3284
+ return String(entry.status) === statusFilter;
3285
+ });
3286
+ }
3287
+ return { mode: "web", subaction: command.subaction, value: requests };
3288
+ }
3289
+ case "dialog": {
3290
+ const action = command.dialogAction ?? "status";
3291
+ if (action === "status") {
3292
+ return {
3293
+ mode: "web",
3294
+ subaction: command.subaction,
3295
+ value: runtime.dialog,
3296
+ };
3297
+ }
3298
+ if (runtime.dialog) {
3299
+ runtime.dialog.open = false;
3300
+ }
3301
+ const result = action === "accept"
3302
+ ? {
3303
+ accepted: true,
3304
+ dialog: runtime.dialog,
3305
+ promptText: command.promptText ?? command.value ?? null,
3306
+ }
3307
+ : { accepted: false, dialog: runtime.dialog };
3308
+ runtime.dialog = null;
3309
+ return { mode: "web", subaction: command.subaction, value: result };
3310
+ }
3311
+ case "console": {
3312
+ if (command.consoleAction === "clear") {
3313
+ runtime.consoleEntries = [];
3314
+ }
3315
+ return {
3316
+ mode: "web",
3317
+ subaction: command.subaction,
3318
+ value: runtime.consoleEntries,
3319
+ };
3320
+ }
3321
+ case "errors": {
3322
+ if (command.consoleAction === "clear") {
3323
+ runtime.errors = [];
3324
+ }
3325
+ return {
3326
+ mode: "web",
3327
+ subaction: command.subaction,
3328
+ value: runtime.errors,
3329
+ };
3330
+ }
3331
+ case "highlight": {
3332
+ const target = resolveTarget();
3333
+ if (!target) {
3334
+ throw new Error("Target element was not found.");
3335
+ }
3336
+ target.setAttribute("data-eliza-highlight", "true");
3337
+ runtime.highlightedSelector =
3338
+ buildBrowserWorkspaceElementSelector(target);
3339
+ return {
3340
+ mode: "web",
3341
+ subaction: command.subaction,
3342
+ value: { selector: runtime.highlightedSelector },
3343
+ };
3344
+ }
3345
+ case "frame": {
3346
+ const action = command.frameAction ?? "select";
3347
+ if (action === "main") {
3348
+ runtime.currentFrame = null;
3349
+ return {
3350
+ mode: "web",
3351
+ subaction: command.subaction,
3352
+ value: { frame: null },
3353
+ };
3354
+ }
3355
+ const frame = resolveBrowserWorkspaceElement(dom.window.document, command.selector);
3356
+ if (!frame || frame.tagName !== "IFRAME") {
3357
+ throw new Error("Eliza browser workspace frame select requires an iframe selector.");
3358
+ }
3359
+ runtime.currentFrame = buildBrowserWorkspaceElementSelector(frame);
3360
+ return {
3361
+ mode: "web",
3362
+ subaction: command.subaction,
3363
+ value: { frame: runtime.currentFrame },
3364
+ };
3365
+ }
3366
+ case "diff": {
3367
+ const snapshot = createBrowserWorkspaceSnapshotRecord(tab.title, tab.url, buildBrowserWorkspaceDocumentSnapshotText(document));
3368
+ if (command.diffAction === "url") {
3369
+ const leftUrl = command.url?.trim() || tab.url;
3370
+ const rightUrl = command.secondaryUrl?.trim();
3371
+ if (!rightUrl) {
3372
+ throw new Error("Eliza browser workspace diff url requires secondaryUrl.");
3373
+ }
3374
+ const left = await fetchBrowserWorkspaceTrackedResponse(runtime, leftUrl, {}, "document");
3375
+ const right = await fetchBrowserWorkspaceTrackedResponse(runtime, rightUrl, {}, "document");
3376
+ const leftSnapshot = createBrowserWorkspaceSnapshotRecord(leftUrl, left.url || leftUrl, await left.text());
3377
+ const rightSnapshot = createBrowserWorkspaceSnapshotRecord(rightUrl, right.url || rightUrl, await right.text());
3378
+ return {
3379
+ mode: "web",
3380
+ subaction: command.subaction,
3381
+ value: diffBrowserWorkspaceSnapshots(leftSnapshot, rightSnapshot),
3382
+ };
3383
+ }
3384
+ if (command.diffAction === "screenshot") {
3385
+ const currentData = runtime.lastScreenshotData ??
3386
+ createBrowserWorkspaceSyntheticScreenshotData(tab.title, tab.url, buildBrowserWorkspaceDocumentSnapshotText(document), runtime.settings.viewport ?? undefined);
3387
+ const baseline = command.baselinePath?.trim()
3388
+ ? await fsp.readFile(path.resolve(command.baselinePath.trim()), "base64")
3389
+ : runtime.lastScreenshotData;
3390
+ runtime.lastScreenshotData = currentData;
3391
+ return {
3392
+ mode: "web",
3393
+ subaction: command.subaction,
3394
+ value: {
3395
+ baselineLength: baseline?.length ?? 0,
3396
+ changed: baseline !== currentData,
3397
+ currentLength: currentData.length,
3398
+ },
3399
+ };
3400
+ }
3401
+ const baseline = command.baselinePath?.trim()
3402
+ ? JSON.parse(await fsp.readFile(path.resolve(command.baselinePath.trim()), "utf8"))
3403
+ : runtime.lastSnapshot;
3404
+ const diff = diffBrowserWorkspaceSnapshots(baseline, snapshot);
3405
+ runtime.lastSnapshot = snapshot;
3406
+ return { mode: "web", subaction: command.subaction, value: diff };
3407
+ }
3408
+ case "trace": {
3409
+ if (command.traceAction === "stop") {
3410
+ runtime.trace.active = false;
3411
+ const traceValue = { entries: runtime.trace.entries };
3412
+ if (command.filePath?.trim() || command.outputPath?.trim()) {
3413
+ const targetPath = command.filePath?.trim() || command.outputPath?.trim() || "";
3414
+ await writeBrowserWorkspaceFile(targetPath, JSON.stringify(traceValue, null, 2));
3415
+ return {
3416
+ mode: "web",
3417
+ subaction: command.subaction,
3418
+ value: { path: path.resolve(targetPath), ...traceValue },
3419
+ };
3420
+ }
3421
+ return {
3422
+ mode: "web",
3423
+ subaction: command.subaction,
3424
+ value: traceValue,
3425
+ };
3426
+ }
3427
+ runtime.trace = { active: true, entries: [] };
3428
+ runtime.trace.entries.push({
3429
+ command: "trace:start",
3430
+ timestamp: getBrowserWorkspaceTimestamp(),
3431
+ });
3432
+ return {
3433
+ mode: "web",
3434
+ subaction: command.subaction,
3435
+ value: { active: true },
3436
+ };
3437
+ }
3438
+ case "profiler": {
3439
+ if (command.profilerAction === "stop") {
3440
+ runtime.profiler.active = false;
3441
+ const profileValue = { entries: runtime.profiler.entries };
3442
+ if (command.filePath?.trim() || command.outputPath?.trim()) {
3443
+ const targetPath = command.filePath?.trim() || command.outputPath?.trim() || "";
3444
+ await writeBrowserWorkspaceFile(targetPath, JSON.stringify(profileValue, null, 2));
3445
+ return {
3446
+ mode: "web",
3447
+ subaction: command.subaction,
3448
+ value: { path: path.resolve(targetPath), ...profileValue },
3449
+ };
3450
+ }
3451
+ return {
3452
+ mode: "web",
3453
+ subaction: command.subaction,
3454
+ value: profileValue,
3455
+ };
3456
+ }
3457
+ runtime.profiler = {
3458
+ active: true,
3459
+ entries: [
3460
+ {
3461
+ command: "profiler:start",
3462
+ timestamp: getBrowserWorkspaceTimestamp(),
3463
+ },
3464
+ ],
3465
+ };
3466
+ return {
3467
+ mode: "web",
3468
+ subaction: command.subaction,
3469
+ value: { active: true },
3470
+ };
3471
+ }
3472
+ case "state": {
3473
+ if (command.stateAction === "load") {
3474
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
3475
+ if (!filePath) {
3476
+ throw new Error("Eliza browser workspace state load requires filePath.");
3477
+ }
3478
+ const payload = JSON.parse(await fsp.readFile(path.resolve(filePath), "utf8"));
3479
+ applyBrowserWorkspaceStateToWebDocument(document, payload);
3480
+ if (payload.settings && typeof payload.settings === "object") {
3481
+ runtime.settings = {
3482
+ ...runtime.settings,
3483
+ ...payload.settings,
3484
+ };
3485
+ applyBrowserWorkspaceDomSettings(dom, runtime);
3486
+ }
3487
+ browserWorkspaceClipboardText =
3488
+ typeof payload.clipboard === "string"
3489
+ ? payload.clipboard
3490
+ : browserWorkspaceClipboardText;
3491
+ return {
3492
+ mode: "web",
3493
+ subaction: command.subaction,
3494
+ value: { loaded: true },
3495
+ };
3496
+ }
3497
+ const payload = {
3498
+ clipboard: browserWorkspaceClipboardText,
3499
+ cookies: readBrowserWorkspaceCookies(document),
3500
+ localStorage: readBrowserWorkspaceStorage(dom.window.localStorage),
3501
+ sessionStorage: readBrowserWorkspaceStorage(dom.window.sessionStorage),
3502
+ settings: runtime.settings,
3503
+ url: tab.url,
3504
+ };
3505
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
3506
+ if (filePath) {
3507
+ await writeBrowserWorkspaceFile(filePath, JSON.stringify(payload, null, 2));
3508
+ return {
3509
+ mode: "web",
3510
+ subaction: command.subaction,
3511
+ value: { path: path.resolve(filePath), ...payload },
3512
+ };
3513
+ }
3514
+ return { mode: "web", subaction: command.subaction, value: payload };
3515
+ }
3516
+ case "pdf": {
3517
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
3518
+ if (!filePath) {
3519
+ throw new Error("Eliza browser workspace pdf requires filePath.");
3520
+ }
3521
+ const pdf = createBrowserWorkspacePdfBuffer(tab.title, normalizeBrowserWorkspaceText(document.body?.textContent));
3522
+ const resolved = await writeBrowserWorkspaceFile(filePath, pdf);
3523
+ return {
3524
+ mode: "web",
3525
+ subaction: command.subaction,
3526
+ value: { path: resolved, size: pdf.byteLength },
3527
+ };
3528
+ }
3529
+ default:
3530
+ return null;
3531
+ }
3532
+ });
3533
+ }
3534
+ async function executeWebBrowserWorkspaceDomCommand(command) {
3535
+ return withWebStateLock(async () => {
3536
+ const id = findWebBrowserWorkspaceTargetTabId(command);
3537
+ command = resolveBrowserWorkspaceCommandElementRefs(command, "web", id);
3538
+ const tab = getWebBrowserWorkspaceTabState(id);
3539
+ const dom = await ensureLoadedWebBrowserWorkspaceTabDocument(tab);
3540
+ const frameContext = resolveWebBrowserWorkspaceCommandDocument(tab, dom);
3541
+ const document = frameContext.document;
3542
+ const resolveTarget = () => resolveBrowserWorkspaceElement(document, command.selector, command.text, command);
3543
+ switch (command.subaction) {
3544
+ case "inspect":
3545
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
3546
+ return {
3547
+ mode: "web",
3548
+ subaction: command.subaction,
3549
+ elements: registerBrowserWorkspaceElementRefs("web", tab.id, collectBrowserWorkspaceInspectElements(document)),
3550
+ value: {
3551
+ title: tab.title,
3552
+ url: tab.url,
3553
+ },
3554
+ };
3555
+ case "snapshot":
3556
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
3557
+ return {
3558
+ mode: "web",
3559
+ subaction: command.subaction,
3560
+ elements: registerBrowserWorkspaceElementRefs("web", tab.id, collectBrowserWorkspaceInspectElements(document)),
3561
+ value: {
3562
+ bodyText: buildBrowserWorkspaceDocumentSnapshotText(document).slice(0, 800),
3563
+ title: tab.title,
3564
+ url: tab.url,
3565
+ },
3566
+ };
3567
+ case "get": {
3568
+ if (command.getMode === "title") {
3569
+ return {
3570
+ mode: "web",
3571
+ subaction: command.subaction,
3572
+ value: tab.title,
3573
+ };
3574
+ }
3575
+ if (command.getMode === "url") {
3576
+ return { mode: "web", subaction: command.subaction, value: tab.url };
3577
+ }
3578
+ if (command.getMode === "count") {
3579
+ if (!command.selector?.trim()) {
3580
+ throw new Error("Eliza browser workspace get count requires selector.");
3581
+ }
3582
+ const semanticCommand = mergeBrowserWorkspaceSelectorCommand(command, command.selector);
3583
+ return {
3584
+ mode: "web",
3585
+ subaction: command.subaction,
3586
+ value: semanticCommand
3587
+ ? Number(Boolean(resolveBrowserWorkspaceFindElement(document, semanticCommand)))
3588
+ : queryAllBrowserWorkspaceSelector(document, command.selector)
3589
+ .length,
3590
+ };
3591
+ }
3592
+ const element = resolveTarget();
3593
+ if (!element) {
3594
+ throw new Error("Target element was not found.");
3595
+ }
3596
+ let value;
3597
+ switch (command.getMode) {
3598
+ case "attr":
3599
+ if (!command.attribute?.trim()) {
3600
+ throw new Error("Eliza browser workspace attr lookups require attribute.");
3601
+ }
3602
+ value = element.getAttribute(command.attribute);
3603
+ break;
3604
+ case "box":
3605
+ value = getBrowserWorkspaceElementBox(element);
3606
+ break;
3607
+ case "checked":
3608
+ value =
3609
+ element.tagName === "INPUT"
3610
+ ? Boolean(element.checked)
3611
+ : element.tagName === "OPTION"
3612
+ ? Boolean(element.selected)
3613
+ : false;
3614
+ break;
3615
+ case "enabled":
3616
+ value =
3617
+ "disabled" in element
3618
+ ? !element.disabled
3619
+ : true;
3620
+ break;
3621
+ case "html":
3622
+ value = element.innerHTML;
3623
+ break;
3624
+ case "styles":
3625
+ value = getBrowserWorkspaceElementStyles(element, dom.window);
3626
+ break;
3627
+ case "value":
3628
+ value = getBrowserWorkspaceElementValue(element);
3629
+ break;
3630
+ case "visible":
3631
+ value = isBrowserWorkspaceElementVisible(element);
3632
+ break;
3633
+ default:
3634
+ value = normalizeBrowserWorkspaceText(element.textContent);
3635
+ break;
3636
+ }
3637
+ return { mode: "web", subaction: command.subaction, value };
3638
+ }
3639
+ case "find": {
3640
+ const element = resolveTarget();
3641
+ if (!element) {
3642
+ throw new Error("Target element was not found.");
3643
+ }
3644
+ switch (command.action) {
3645
+ case "check": {
3646
+ const input = ensureBrowserWorkspaceCheckboxElement(element, "check");
3647
+ input.checked = true;
3648
+ return {
3649
+ mode: "web",
3650
+ subaction: command.subaction,
3651
+ value: {
3652
+ checked: input.checked,
3653
+ selector: buildBrowserWorkspaceElementSelector(input),
3654
+ },
3655
+ };
3656
+ }
3657
+ case "click":
3658
+ return {
3659
+ ...(await activateWebBrowserWorkspaceElement(tab, element, "click")),
3660
+ subaction: command.subaction,
3661
+ };
3662
+ case "fill": {
3663
+ const control = ensureBrowserWorkspaceFormControlElement(element, "fill");
3664
+ setBrowserWorkspaceControlValue(control, command.value ?? "");
3665
+ return {
3666
+ mode: "web",
3667
+ subaction: command.subaction,
3668
+ value: {
3669
+ selector: buildBrowserWorkspaceElementSelector(control),
3670
+ value: control.value,
3671
+ },
3672
+ };
3673
+ }
3674
+ case "focus":
3675
+ if (typeof element.focus === "function") {
3676
+ element.focus();
3677
+ }
3678
+ return {
3679
+ mode: "web",
3680
+ subaction: command.subaction,
3681
+ value: {
3682
+ focused: document.activeElement === element,
3683
+ selector: buildBrowserWorkspaceElementSelector(element),
3684
+ },
3685
+ };
3686
+ case "hover":
3687
+ element.setAttribute("data-eliza-hover", "true");
3688
+ return {
3689
+ mode: "web",
3690
+ subaction: command.subaction,
3691
+ value: {
3692
+ hovered: true,
3693
+ selector: buildBrowserWorkspaceElementSelector(element),
3694
+ },
3695
+ };
3696
+ case "type": {
3697
+ const control = ensureBrowserWorkspaceFormControlElement(element, "type");
3698
+ setBrowserWorkspaceControlValue(control, `${control.value ?? ""}${command.value ?? ""}`);
3699
+ return {
3700
+ mode: "web",
3701
+ subaction: command.subaction,
3702
+ value: {
3703
+ selector: buildBrowserWorkspaceElementSelector(control),
3704
+ value: control.value,
3705
+ },
3706
+ };
3707
+ }
3708
+ case "uncheck": {
3709
+ const input = ensureBrowserWorkspaceCheckboxElement(element, "uncheck");
3710
+ input.checked = false;
3711
+ return {
3712
+ mode: "web",
3713
+ subaction: command.subaction,
3714
+ value: {
3715
+ checked: input.checked,
3716
+ selector: buildBrowserWorkspaceElementSelector(input),
3717
+ },
3718
+ };
3719
+ }
3720
+ case "text":
3721
+ case undefined:
3722
+ return {
3723
+ mode: "web",
3724
+ subaction: command.subaction,
3725
+ value: {
3726
+ element: createBrowserWorkspaceElementSummary(element),
3727
+ text: normalizeBrowserWorkspaceText(element.textContent),
3728
+ },
3729
+ };
3730
+ default:
3731
+ throw new Error(`Unsupported browser workspace find action: ${command.action}`);
3732
+ }
3733
+ }
3734
+ case "check": {
3735
+ const element = resolveTarget();
3736
+ if (!element) {
3737
+ throw new Error("Target element was not found.");
3738
+ }
3739
+ const input = ensureBrowserWorkspaceCheckboxElement(element, "check");
3740
+ input.checked = true;
3741
+ return {
3742
+ mode: "web",
3743
+ subaction: command.subaction,
3744
+ value: {
3745
+ checked: input.checked,
3746
+ selector: buildBrowserWorkspaceElementSelector(input),
3747
+ },
3748
+ };
3749
+ }
3750
+ case "fill":
3751
+ case "type": {
3752
+ const element = resolveTarget();
3753
+ if (!element) {
3754
+ throw new Error("Target element was not found.");
3755
+ }
3756
+ const control = ensureBrowserWorkspaceFormControlElement(element, command.subaction);
3757
+ const nextValue = command.subaction === "type"
3758
+ ? `${control.value ?? ""}${command.value ?? ""}`
3759
+ : (command.value ?? "");
3760
+ setBrowserWorkspaceControlValue(control, nextValue);
3761
+ return {
3762
+ mode: "web",
3763
+ subaction: command.subaction,
3764
+ value: {
3765
+ selector: buildBrowserWorkspaceElementSelector(control),
3766
+ value: nextValue,
3767
+ },
3768
+ };
3769
+ }
3770
+ case "focus": {
3771
+ const element = resolveTarget();
3772
+ if (!element) {
3773
+ throw new Error("Target element was not found.");
3774
+ }
3775
+ if (typeof element.focus === "function") {
3776
+ element.focus();
3777
+ }
3778
+ return {
3779
+ mode: "web",
3780
+ subaction: command.subaction,
3781
+ value: {
3782
+ focused: document.activeElement === element,
3783
+ selector: buildBrowserWorkspaceElementSelector(element),
3784
+ },
3785
+ };
3786
+ }
3787
+ case "hover": {
3788
+ const element = resolveTarget();
3789
+ if (!element) {
3790
+ throw new Error("Target element was not found.");
3791
+ }
3792
+ element.setAttribute("data-eliza-hover", "true");
3793
+ return {
3794
+ mode: "web",
3795
+ subaction: command.subaction,
3796
+ value: {
3797
+ hovered: true,
3798
+ selector: buildBrowserWorkspaceElementSelector(element),
3799
+ },
3800
+ };
3801
+ }
3802
+ case "keyboardinserttext":
3803
+ case "keyboardtype": {
3804
+ const active = document.activeElement;
3805
+ if (!active ||
3806
+ !(active.tagName === "INPUT" ||
3807
+ active.tagName === "TEXTAREA" ||
3808
+ active.tagName === "SELECT")) {
3809
+ throw new Error("Eliza browser workspace keyboard text input requires a focused input target.");
3810
+ }
3811
+ const control = ensureBrowserWorkspaceFormControlElement(active, command.subaction === "keyboardtype" ? "type" : "keyboardinserttext");
3812
+ const nextValue = command.subaction === "keyboardtype"
3813
+ ? `${control.value ?? ""}${command.value ?? ""}`
3814
+ : (command.value ?? "");
3815
+ setBrowserWorkspaceControlValue(control, nextValue);
3816
+ return {
3817
+ mode: "web",
3818
+ subaction: command.subaction,
3819
+ value: {
3820
+ selector: buildBrowserWorkspaceElementSelector(control),
3821
+ value: control.value,
3822
+ },
3823
+ };
3824
+ }
3825
+ case "keydown":
3826
+ case "keyup":
3827
+ return {
3828
+ mode: "web",
3829
+ subaction: command.subaction,
3830
+ value: {
3831
+ key: command.key?.trim() || "Enter",
3832
+ selector: document.activeElement &&
3833
+ document.activeElement instanceof Element
3834
+ ? buildBrowserWorkspaceElementSelector(document.activeElement)
3835
+ : null,
3836
+ },
3837
+ };
3838
+ case "click": {
3839
+ const element = resolveTarget();
3840
+ if (!element) {
3841
+ throw new Error("Target element was not found.");
3842
+ }
3843
+ return activateWebBrowserWorkspaceElement(tab, element, "click");
3844
+ }
3845
+ case "dblclick": {
3846
+ const element = resolveTarget();
3847
+ if (!element) {
3848
+ throw new Error("Target element was not found.");
3849
+ }
3850
+ return activateWebBrowserWorkspaceElement(tab, element, "dblclick");
3851
+ }
3852
+ case "press": {
3853
+ const key = command.key?.trim() || "Enter";
3854
+ const element = resolveTarget();
3855
+ const form = findClosestBrowserWorkspaceForm(element);
3856
+ if (key === "Enter" && form) {
3857
+ await submitWebBrowserWorkspaceForm(tab, form);
3858
+ return {
3859
+ mode: "web",
3860
+ subaction: command.subaction,
3861
+ tab: cloneWebBrowserWorkspaceTabState(tab),
3862
+ value: { key, url: tab.url },
3863
+ };
3864
+ }
3865
+ return { mode: "web", subaction: command.subaction, value: { key } };
3866
+ }
3867
+ case "scroll": {
3868
+ return {
3869
+ mode: "web",
3870
+ subaction: command.subaction,
3871
+ value: scrollWebBrowserWorkspaceTarget(dom, resolveTarget(), command.direction ?? "down", command.pixels ?? 240),
3872
+ };
3873
+ }
3874
+ case "scrollinto": {
3875
+ const element = resolveTarget();
3876
+ if (!element) {
3877
+ throw new Error("Target element was not found.");
3878
+ }
3879
+ if (typeof element.focus === "function") {
3880
+ element.focus();
3881
+ }
3882
+ return {
3883
+ mode: "web",
3884
+ subaction: command.subaction,
3885
+ value: {
3886
+ scrolled: true,
3887
+ selector: buildBrowserWorkspaceElementSelector(element),
3888
+ },
3889
+ };
3890
+ }
3891
+ case "select": {
3892
+ const element = resolveTarget();
3893
+ if (!element) {
3894
+ throw new Error("Target element was not found.");
3895
+ }
3896
+ if (element.tagName !== "SELECT") {
3897
+ throw new Error("Eliza browser workspace select requires a select target.");
3898
+ }
3899
+ const select = ensureBrowserWorkspaceFormControlElement(element, "select");
3900
+ const option = Array.from(select.options).find((entry) => entry.value === (command.value ?? "") ||
3901
+ browserWorkspaceTextMatches(entry.textContent ?? "", command.value ?? "", true));
3902
+ if (!option) {
3903
+ throw new Error("Select option was not found.");
3904
+ }
3905
+ select.value = option.value;
3906
+ option.selected = true;
3907
+ return {
3908
+ mode: "web",
3909
+ subaction: command.subaction,
3910
+ value: {
3911
+ selector: buildBrowserWorkspaceElementSelector(select),
3912
+ value: select.value,
3913
+ },
3914
+ };
3915
+ }
3916
+ case "uncheck": {
3917
+ const element = resolveTarget();
3918
+ if (!element) {
3919
+ throw new Error("Target element was not found.");
3920
+ }
3921
+ const input = ensureBrowserWorkspaceCheckboxElement(element, "uncheck");
3922
+ input.checked = false;
3923
+ return {
3924
+ mode: "web",
3925
+ subaction: command.subaction,
3926
+ value: {
3927
+ checked: input.checked,
3928
+ selector: buildBrowserWorkspaceElementSelector(input),
3929
+ },
3930
+ };
3931
+ }
3932
+ case "wait": {
3933
+ if (!command.selector &&
3934
+ !command.findBy &&
3935
+ !command.text &&
3936
+ !command.url &&
3937
+ !command.script &&
3938
+ typeof command.timeoutMs === "number" &&
3939
+ Number.isFinite(command.timeoutMs)) {
3940
+ const waitedMs = Math.max(0, command.timeoutMs);
3941
+ await sleep(waitedMs);
3942
+ return {
3943
+ mode: "web",
3944
+ subaction: command.subaction,
3945
+ value: { waitedMs },
3946
+ };
3947
+ }
3948
+ const timeoutMs = typeof command.timeoutMs === "number" &&
3949
+ Number.isFinite(command.timeoutMs)
3950
+ ? Math.max(100, command.timeoutMs)
3951
+ : DEFAULT_TIMEOUT_MS;
3952
+ const deadline = Date.now() + timeoutMs;
3953
+ while (Date.now() <= deadline) {
3954
+ await ensureLoadedWebBrowserWorkspaceTabDocument(tab);
3955
+ const currentDom = ensureBrowserWorkspaceDom(tab);
3956
+ const currentDocument = currentDom.window.document;
3957
+ const matchesSelector = command.selector?.trim()
3958
+ ? (() => {
3959
+ const found = resolveBrowserWorkspaceElement(currentDocument, command.selector, undefined, command);
3960
+ if (!command.state || command.state === "visible") {
3961
+ return found
3962
+ ? isBrowserWorkspaceElementVisible(found)
3963
+ : false;
3964
+ }
3965
+ return !found || !isBrowserWorkspaceElementVisible(found);
3966
+ })()
3967
+ : false;
3968
+ const matchesFind = command.findBy
3969
+ ? Boolean(resolveBrowserWorkspaceFindElement(currentDocument, command))
3970
+ : false;
3971
+ const matchesText = command.text?.trim()
3972
+ ? normalizeBrowserWorkspaceText(currentDocument.body?.textContent).includes(command.text.trim())
3973
+ : false;
3974
+ const matchesUrl = command.url?.trim()
3975
+ ? tab.url.includes(command.url.trim())
3976
+ : false;
3977
+ const matchesScript = command.script?.trim()
3978
+ ? Boolean(new Function("document", "window", "location", `return (${command.script});`)(currentDocument, currentDom.window, currentDom.window.location))
3979
+ : false;
3980
+ if (matchesSelector ||
3981
+ matchesFind ||
3982
+ matchesText ||
3983
+ matchesUrl ||
3984
+ matchesScript ||
3985
+ (!command.selector &&
3986
+ !command.findBy &&
3987
+ !command.text &&
3988
+ !command.url &&
3989
+ !command.script)) {
3990
+ return {
3991
+ mode: "web",
3992
+ subaction: command.subaction,
3993
+ value: {
3994
+ findBy: command.findBy ?? null,
3995
+ selector: command.selector ?? null,
3996
+ state: command.state ?? null,
3997
+ text: command.text ?? null,
3998
+ url: tab.url,
3999
+ },
4000
+ };
4001
+ }
4002
+ await sleep(DEFAULT_WAIT_INTERVAL_MS);
4003
+ }
4004
+ throw new Error("Timed out waiting for browser workspace condition.");
4005
+ }
4006
+ default:
4007
+ throw new Error(`Unsupported web browser workspace subaction: ${command.subaction}`);
4008
+ }
4009
+ });
4010
+ }
4011
+ export function resolveBrowserWorkspaceBridgeConfig(env = process.env) {
4012
+ const baseUrl = normalizeEnvValue(env.ELIZA_BROWSER_WORKSPACE_URL) ??
4013
+ normalizeEnvValue(env.ELIZA_BROWSER_WORKSPACE_URL);
4014
+ if (!baseUrl) {
4015
+ return null;
4016
+ }
4017
+ return {
4018
+ baseUrl: baseUrl.replace(/\/+$/, ""),
4019
+ token: normalizeEnvValue(env.ELIZA_BROWSER_WORKSPACE_TOKEN) ??
4020
+ normalizeEnvValue(env.ELIZA_BROWSER_WORKSPACE_TOKEN),
4021
+ };
4022
+ }
4023
+ export function isBrowserWorkspaceBridgeConfigured(env = process.env) {
4024
+ return resolveBrowserWorkspaceBridgeConfig(env) !== null;
4025
+ }
4026
+ export function getBrowserWorkspaceMode(env = process.env) {
4027
+ return isBrowserWorkspaceBridgeConfigured(env) ? "desktop" : "web";
4028
+ }
4029
+ export function getBrowserWorkspaceUnavailableMessage() {
4030
+ return DESKTOP_BRIDGE_UNAVAILABLE_MESSAGE;
4031
+ }
4032
+ export async function getBrowserWorkspaceSnapshot(env = process.env) {
4033
+ return {
4034
+ mode: getBrowserWorkspaceMode(env),
4035
+ tabs: await listBrowserWorkspaceTabs(env),
4036
+ };
4037
+ }
4038
+ export async function listBrowserWorkspaceTabs(env = process.env) {
4039
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4040
+ return cloneBrowserWorkspaceTabs(webWorkspaceState.tabs.map((tab) => cloneWebBrowserWorkspaceTabState(tab)));
4041
+ }
4042
+ const payload = await requestBrowserWorkspace("/tabs", undefined, env);
4043
+ return Array.isArray(payload.tabs) ? payload.tabs : [];
4044
+ }
4045
+ export async function openBrowserWorkspaceTab(request, env = process.env) {
4046
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4047
+ return withWebStateLock(() => {
4048
+ const tab = createWebBrowserWorkspaceTab(request);
4049
+ getBrowserWorkspaceRuntimeState("web", tab.id);
4050
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
4051
+ if (tab.visible) {
4052
+ webWorkspaceState.tabs = webWorkspaceState.tabs.map((entry) => ({
4053
+ ...entry,
4054
+ visible: false,
4055
+ }));
4056
+ }
4057
+ webWorkspaceState.tabs = [...webWorkspaceState.tabs, tab];
4058
+ return cloneWebBrowserWorkspaceTabState(tab);
4059
+ });
4060
+ }
4061
+ const payload = await requestBrowserWorkspace("/tabs", {
4062
+ method: "POST",
4063
+ body: JSON.stringify(request),
4064
+ }, env);
4065
+ return payload.tab;
4066
+ }
4067
+ export async function navigateBrowserWorkspaceTab(request, env = process.env) {
4068
+ const nextUrl = assertBrowserWorkspaceUrl(request.url);
4069
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4070
+ return withWebStateLock(() => {
4071
+ const index = getWebBrowserWorkspaceTabIndex(request.id);
4072
+ if (index < 0) {
4073
+ throw createBrowserWorkspaceNotFoundError(request.id);
4074
+ }
4075
+ const existing = webWorkspaceState.tabs[index];
4076
+ const updatedAt = getBrowserWorkspaceTimestamp();
4077
+ const state = getBrowserWorkspaceRuntimeState("web", existing.id);
4078
+ clearWebBrowserWorkspaceTabElementRefs(existing.id);
4079
+ pushWebBrowserWorkspaceHistory(existing, nextUrl);
4080
+ const nextDom = nextUrl === "about:blank"
4081
+ ? createEmptyWebBrowserWorkspaceDom(nextUrl)
4082
+ : null;
4083
+ const nextTab = {
4084
+ ...existing,
4085
+ title: inferBrowserWorkspaceTitle(nextUrl),
4086
+ url: nextUrl,
4087
+ updatedAt,
4088
+ dom: nextDom,
4089
+ loadedUrl: nextUrl === "about:blank" ? nextUrl : null,
4090
+ };
4091
+ if (nextDom) {
4092
+ installBrowserWorkspaceWebRuntime(nextTab, nextDom);
4093
+ }
4094
+ resetBrowserWorkspaceRuntimeNavigationState(state);
4095
+ webWorkspaceState.tabs[index] = nextTab;
4096
+ return cloneWebBrowserWorkspaceTabState(nextTab);
4097
+ });
4098
+ }
4099
+ const payload = await requestBrowserWorkspace(`/tabs/${encodeURIComponent(request.id)}/navigate`, {
4100
+ method: "POST",
4101
+ body: JSON.stringify({ url: nextUrl }),
4102
+ }, env);
4103
+ return payload.tab;
4104
+ }
4105
+ export async function showBrowserWorkspaceTab(id, env = process.env) {
4106
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4107
+ return withWebStateLock(() => {
4108
+ getWebBrowserWorkspaceTabState(id);
4109
+ const lastFocusedAt = getBrowserWorkspaceTimestamp();
4110
+ webWorkspaceState.tabs = webWorkspaceState.tabs.map((tab) => ({
4111
+ ...tab,
4112
+ visible: tab.id === id,
4113
+ lastFocusedAt: tab.id === id ? lastFocusedAt : tab.lastFocusedAt,
4114
+ updatedAt: tab.id === id ? lastFocusedAt : tab.updatedAt,
4115
+ }));
4116
+ return cloneWebBrowserWorkspaceTabState(getWebBrowserWorkspaceTabState(id));
4117
+ });
4118
+ }
4119
+ const payload = await requestBrowserWorkspace(`/tabs/${encodeURIComponent(id)}/show`, { method: "POST" }, env);
4120
+ return payload.tab;
4121
+ }
4122
+ export async function hideBrowserWorkspaceTab(id, env = process.env) {
4123
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4124
+ return withWebStateLock(() => {
4125
+ const index = getWebBrowserWorkspaceTabIndex(id);
4126
+ if (index < 0) {
4127
+ throw createBrowserWorkspaceNotFoundError(id);
4128
+ }
4129
+ const updatedAt = getBrowserWorkspaceTimestamp();
4130
+ const nextTab = {
4131
+ ...webWorkspaceState.tabs[index],
4132
+ visible: false,
4133
+ updatedAt,
4134
+ };
4135
+ webWorkspaceState.tabs[index] = nextTab;
4136
+ return cloneWebBrowserWorkspaceTabState(nextTab);
4137
+ });
4138
+ }
4139
+ const payload = await requestBrowserWorkspace(`/tabs/${encodeURIComponent(id)}/hide`, { method: "POST" }, env);
4140
+ return payload.tab;
4141
+ }
4142
+ export async function closeBrowserWorkspaceTab(id, env = process.env) {
4143
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4144
+ return withWebStateLock(() => {
4145
+ const initialLength = webWorkspaceState.tabs.length;
4146
+ clearWebBrowserWorkspaceTabElementRefs(id);
4147
+ clearBrowserWorkspaceRuntimeState("web", id);
4148
+ webWorkspaceState.tabs = webWorkspaceState.tabs.filter((tab) => tab.id !== id);
4149
+ return webWorkspaceState.tabs.length !== initialLength;
4150
+ });
4151
+ }
4152
+ const payload = await requestBrowserWorkspace(`/tabs/${encodeURIComponent(id)}`, { method: "DELETE" }, env);
4153
+ return payload.closed === true;
4154
+ }
4155
+ export async function evaluateBrowserWorkspaceTab(request, env = process.env) {
4156
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4157
+ throw new Error(createBrowserWorkspaceDesktopOnlyMessage("eval"));
4158
+ }
4159
+ const payload = await requestBrowserWorkspace(`/tabs/${encodeURIComponent(request.id)}/eval`, {
4160
+ method: "POST",
4161
+ body: JSON.stringify({ script: request.script }),
4162
+ }, env);
4163
+ return payload.result;
4164
+ }
4165
+ export async function snapshotBrowserWorkspaceTab(id, env = process.env) {
4166
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4167
+ throw new Error(createBrowserWorkspaceDesktopOnlyMessage("snapshot"));
4168
+ }
4169
+ return await requestBrowserWorkspace(`/tabs/${encodeURIComponent(id)}/snapshot`, undefined, env);
4170
+ }
4171
+ export async function executeBrowserWorkspaceCommand(command, env = process.env) {
4172
+ command = normalizeBrowserWorkspaceCommand(command);
4173
+ switch (command.subaction) {
4174
+ case "batch": {
4175
+ const steps = Array.isArray(command.steps) ? command.steps : [];
4176
+ if (steps.length === 0) {
4177
+ throw new Error("Eliza browser workspace batch requires at least one step.");
4178
+ }
4179
+ const results = [];
4180
+ for (const step of steps) {
4181
+ results.push(await executeBrowserWorkspaceCommand(step, env));
4182
+ }
4183
+ return {
4184
+ mode: getBrowserWorkspaceMode(env),
4185
+ subaction: command.subaction,
4186
+ steps: results,
4187
+ value: results.at(-1)?.value,
4188
+ };
4189
+ }
4190
+ case "list":
4191
+ return {
4192
+ mode: getBrowserWorkspaceMode(env),
4193
+ subaction: command.subaction,
4194
+ tabs: await listBrowserWorkspaceTabs(env),
4195
+ };
4196
+ case "open": {
4197
+ const tab = await openBrowserWorkspaceTab({
4198
+ partition: command.partition,
4199
+ show: command.show,
4200
+ title: command.title,
4201
+ url: command.url,
4202
+ }, env);
4203
+ clearBrowserWorkspaceElementRefs(getBrowserWorkspaceMode(env), tab.id);
4204
+ return {
4205
+ mode: getBrowserWorkspaceMode(env),
4206
+ subaction: command.subaction,
4207
+ tab,
4208
+ };
4209
+ }
4210
+ case "navigate": {
4211
+ const id = isBrowserWorkspaceBridgeConfigured(env)
4212
+ ? await resolveDesktopBrowserWorkspaceTargetTabId(command, env)
4213
+ : findWebBrowserWorkspaceTargetTabId(command);
4214
+ clearBrowserWorkspaceElementRefs(getBrowserWorkspaceMode(env), id);
4215
+ return {
4216
+ mode: getBrowserWorkspaceMode(env),
4217
+ subaction: command.subaction,
4218
+ tab: await navigateBrowserWorkspaceTab({
4219
+ id,
4220
+ url: command.url ?? "",
4221
+ }, env),
4222
+ };
4223
+ }
4224
+ case "show": {
4225
+ const id = isBrowserWorkspaceBridgeConfigured(env)
4226
+ ? await resolveDesktopBrowserWorkspaceTargetTabId(command, env)
4227
+ : findWebBrowserWorkspaceTargetTabId(command);
4228
+ return {
4229
+ mode: getBrowserWorkspaceMode(env),
4230
+ subaction: command.subaction,
4231
+ tab: await showBrowserWorkspaceTab(id, env),
4232
+ };
4233
+ }
4234
+ case "hide": {
4235
+ const id = isBrowserWorkspaceBridgeConfigured(env)
4236
+ ? await resolveDesktopBrowserWorkspaceTargetTabId(command, env)
4237
+ : findWebBrowserWorkspaceTargetTabId(command);
4238
+ return {
4239
+ mode: getBrowserWorkspaceMode(env),
4240
+ subaction: command.subaction,
4241
+ tab: await hideBrowserWorkspaceTab(id, env),
4242
+ };
4243
+ }
4244
+ case "close": {
4245
+ const id = isBrowserWorkspaceBridgeConfigured(env)
4246
+ ? await resolveDesktopBrowserWorkspaceTargetTabId(command, env)
4247
+ : findWebBrowserWorkspaceTargetTabId(command);
4248
+ clearBrowserWorkspaceElementRefs(getBrowserWorkspaceMode(env), id);
4249
+ clearBrowserWorkspaceRuntimeState(getBrowserWorkspaceMode(env), id);
4250
+ return {
4251
+ mode: getBrowserWorkspaceMode(env),
4252
+ subaction: command.subaction,
4253
+ closed: await closeBrowserWorkspaceTab(id, env),
4254
+ };
4255
+ }
4256
+ case "eval": {
4257
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4258
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4259
+ }
4260
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
4261
+ return {
4262
+ mode: "desktop",
4263
+ subaction: command.subaction,
4264
+ value: await evaluateBrowserWorkspaceTab({
4265
+ id,
4266
+ script: command.script ?? "",
4267
+ }, env),
4268
+ };
4269
+ }
4270
+ case "screenshot": {
4271
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4272
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4273
+ }
4274
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
4275
+ return {
4276
+ mode: "desktop",
4277
+ subaction: command.subaction,
4278
+ snapshot: await snapshotBrowserWorkspaceTab(id, env),
4279
+ };
4280
+ }
4281
+ case "clipboard":
4282
+ case "console":
4283
+ case "cookies":
4284
+ case "dialog":
4285
+ case "drag":
4286
+ case "errors":
4287
+ case "frame":
4288
+ case "highlight":
4289
+ case "mouse":
4290
+ case "network":
4291
+ case "set":
4292
+ case "storage":
4293
+ case "upload": {
4294
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4295
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4296
+ }
4297
+ return executeDesktopBrowserWorkspaceUtilityCommand(command, env);
4298
+ }
4299
+ case "diff": {
4300
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4301
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4302
+ }
4303
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
4304
+ const runtime = getBrowserWorkspaceRuntimeState("desktop", id);
4305
+ const snapshot = await getDesktopBrowserWorkspaceSnapshotRecord(command, env);
4306
+ if (command.diffAction === "screenshot") {
4307
+ const screenshot = await snapshotBrowserWorkspaceTab(id, env);
4308
+ const currentData = screenshot.data;
4309
+ const baseline = command.baselinePath?.trim()
4310
+ ? await fsp.readFile(path.resolve(command.baselinePath.trim()), "base64")
4311
+ : runtime.lastScreenshotData;
4312
+ runtime.lastScreenshotData = currentData;
4313
+ return {
4314
+ mode: "desktop",
4315
+ subaction: command.subaction,
4316
+ value: {
4317
+ baselineLength: baseline?.length ?? 0,
4318
+ changed: baseline !== currentData,
4319
+ currentLength: currentData.length,
4320
+ },
4321
+ };
4322
+ }
4323
+ if (command.diffAction === "url") {
4324
+ const leftUrl = command.url?.trim() || snapshot.url;
4325
+ const rightUrl = command.secondaryUrl?.trim();
4326
+ if (!rightUrl) {
4327
+ throw new Error("Eliza browser workspace diff url requires secondaryUrl.");
4328
+ }
4329
+ const left = await browserWorkspacePageFetch(leftUrl);
4330
+ const right = await browserWorkspacePageFetch(rightUrl);
4331
+ return {
4332
+ mode: "desktop",
4333
+ subaction: command.subaction,
4334
+ value: diffBrowserWorkspaceSnapshots(createBrowserWorkspaceSnapshotRecord(leftUrl, left.url || leftUrl, await left.text()), createBrowserWorkspaceSnapshotRecord(rightUrl, right.url || rightUrl, await right.text())),
4335
+ };
4336
+ }
4337
+ const baseline = command.baselinePath?.trim()
4338
+ ? JSON.parse(await fsp.readFile(path.resolve(command.baselinePath.trim()), "utf8"))
4339
+ : runtime.lastSnapshot;
4340
+ const diff = diffBrowserWorkspaceSnapshots(baseline, snapshot);
4341
+ runtime.lastSnapshot = snapshot;
4342
+ return { mode: "desktop", subaction: command.subaction, value: diff };
4343
+ }
4344
+ case "trace":
4345
+ case "profiler": {
4346
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4347
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4348
+ }
4349
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
4350
+ const runtime = getBrowserWorkspaceRuntimeState("desktop", id);
4351
+ const target = command.subaction === "trace" ? runtime.trace : runtime.profiler;
4352
+ const stop = command.subaction === "trace"
4353
+ ? command.traceAction === "stop"
4354
+ : command.profilerAction === "stop";
4355
+ if (stop) {
4356
+ target.active = false;
4357
+ const payload = { entries: target.entries };
4358
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
4359
+ if (filePath) {
4360
+ await writeBrowserWorkspaceFile(filePath, JSON.stringify(payload, null, 2));
4361
+ return {
4362
+ mode: "desktop",
4363
+ subaction: command.subaction,
4364
+ value: { path: path.resolve(filePath), ...payload },
4365
+ };
4366
+ }
4367
+ return {
4368
+ mode: "desktop",
4369
+ subaction: command.subaction,
4370
+ value: payload,
4371
+ };
4372
+ }
4373
+ target.active = true;
4374
+ target.entries = [
4375
+ {
4376
+ command: `${command.subaction}:start`,
4377
+ timestamp: getBrowserWorkspaceTimestamp(),
4378
+ },
4379
+ ];
4380
+ return {
4381
+ mode: "desktop",
4382
+ subaction: command.subaction,
4383
+ value: { active: true },
4384
+ };
4385
+ }
4386
+ case "state": {
4387
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4388
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4389
+ }
4390
+ if (command.stateAction === "load") {
4391
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
4392
+ if (!filePath) {
4393
+ throw new Error("Eliza browser workspace state load requires filePath.");
4394
+ }
4395
+ const payload = JSON.parse(await fsp.readFile(path.resolve(filePath), "utf8"));
4396
+ await loadDesktopBrowserWorkspaceSessionState(command, payload, env);
4397
+ return {
4398
+ mode: "desktop",
4399
+ subaction: command.subaction,
4400
+ value: { loaded: true },
4401
+ };
4402
+ }
4403
+ const payload = await getDesktopBrowserWorkspaceSessionState(command, env);
4404
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
4405
+ if (filePath) {
4406
+ await writeBrowserWorkspaceFile(filePath, JSON.stringify(payload, null, 2));
4407
+ return {
4408
+ mode: "desktop",
4409
+ subaction: command.subaction,
4410
+ value: { path: path.resolve(filePath), ...payload },
4411
+ };
4412
+ }
4413
+ return { mode: "desktop", subaction: command.subaction, value: payload };
4414
+ }
4415
+ case "pdf": {
4416
+ if (!isBrowserWorkspaceBridgeConfigured(env)) {
4417
+ return (await executeWebBrowserWorkspaceUtilityCommand(command));
4418
+ }
4419
+ const filePath = command.filePath?.trim() || command.outputPath?.trim();
4420
+ if (!filePath) {
4421
+ throw new Error("Eliza browser workspace pdf requires filePath.");
4422
+ }
4423
+ const snapshot = await getDesktopBrowserWorkspaceSnapshotRecord(command, env);
4424
+ const pdf = createBrowserWorkspacePdfBuffer(snapshot.title, snapshot.bodyText);
4425
+ const resolved = await writeBrowserWorkspaceFile(filePath, pdf);
4426
+ return {
4427
+ mode: "desktop",
4428
+ subaction: command.subaction,
4429
+ value: { path: resolved, size: pdf.byteLength },
4430
+ };
4431
+ }
4432
+ case "tab": {
4433
+ const action = command.tabAction ?? "list";
4434
+ if (action === "list") {
4435
+ return {
4436
+ mode: getBrowserWorkspaceMode(env),
4437
+ subaction: command.subaction,
4438
+ tabs: await listBrowserWorkspaceTabs(env),
4439
+ };
4440
+ }
4441
+ if (action === "new") {
4442
+ return {
4443
+ mode: getBrowserWorkspaceMode(env),
4444
+ subaction: command.subaction,
4445
+ tab: await openBrowserWorkspaceTab({
4446
+ partition: command.partition,
4447
+ show: command.show ?? true,
4448
+ title: command.title,
4449
+ url: command.url,
4450
+ width: command.width,
4451
+ height: command.height,
4452
+ }, env),
4453
+ };
4454
+ }
4455
+ if (action === "switch") {
4456
+ const tabs = await listBrowserWorkspaceTabs(env);
4457
+ const target = command.id?.trim()
4458
+ ? tabs.find((tab) => tab.id === command.id?.trim())
4459
+ : typeof command.index === "number"
4460
+ ? (tabs[command.index] ?? null)
4461
+ : null;
4462
+ if (!target) {
4463
+ throw new Error("Eliza browser workspace tab switch requires a valid id or index.");
4464
+ }
4465
+ return {
4466
+ mode: getBrowserWorkspaceMode(env),
4467
+ subaction: command.subaction,
4468
+ tab: await showBrowserWorkspaceTab(target.id, env),
4469
+ };
4470
+ }
4471
+ const targetId = command.id?.trim() ||
4472
+ (await listBrowserWorkspaceTabs(env))[command.index ?? -1]?.id;
4473
+ if (!targetId) {
4474
+ throw new Error("Eliza browser workspace tab close requires a valid id or index.");
4475
+ }
4476
+ return {
4477
+ mode: getBrowserWorkspaceMode(env),
4478
+ subaction: command.subaction,
4479
+ closed: await closeBrowserWorkspaceTab(targetId, env),
4480
+ };
4481
+ }
4482
+ case "window":
4483
+ return {
4484
+ mode: getBrowserWorkspaceMode(env),
4485
+ subaction: command.subaction,
4486
+ tab: await openBrowserWorkspaceTab({
4487
+ partition: command.partition,
4488
+ show: true,
4489
+ title: command.title,
4490
+ url: command.url,
4491
+ width: command.width,
4492
+ height: command.height,
4493
+ }, env),
4494
+ };
4495
+ case "back":
4496
+ case "forward":
4497
+ case "reload": {
4498
+ if (isBrowserWorkspaceBridgeConfigured(env)) {
4499
+ const id = await resolveDesktopBrowserWorkspaceTargetTabId(command, env);
4500
+ clearBrowserWorkspaceElementRefs("desktop", id);
4501
+ return executeDesktopBrowserWorkspaceDomCommand(command, env);
4502
+ }
4503
+ return withWebStateLock(async () => {
4504
+ const id = findWebBrowserWorkspaceTargetTabId(command);
4505
+ const tab = getWebBrowserWorkspaceTabState(id);
4506
+ if (command.subaction === "reload") {
4507
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
4508
+ tab.dom = null;
4509
+ tab.loadedUrl = null;
4510
+ await loadWebBrowserWorkspaceTabDocument(tab);
4511
+ return {
4512
+ mode: "web",
4513
+ subaction: command.subaction,
4514
+ tab: cloneWebBrowserWorkspaceTabState(tab),
4515
+ value: { url: tab.url, title: tab.title },
4516
+ };
4517
+ }
4518
+ const delta = command.subaction === "back" ? -1 : 1;
4519
+ const nextIndex = tab.historyIndex + delta;
4520
+ if (nextIndex < 0 || nextIndex >= tab.history.length) {
4521
+ return {
4522
+ mode: "web",
4523
+ subaction: command.subaction,
4524
+ tab: cloneWebBrowserWorkspaceTabState(tab),
4525
+ value: { url: tab.url, title: tab.title, changed: false },
4526
+ };
4527
+ }
4528
+ tab.historyIndex = nextIndex;
4529
+ tab.url = tab.history[nextIndex] ?? tab.url;
4530
+ tab.title = inferBrowserWorkspaceTitle(tab.url);
4531
+ clearWebBrowserWorkspaceTabElementRefs(tab.id);
4532
+ tab.dom = null;
4533
+ tab.loadedUrl = null;
4534
+ await loadWebBrowserWorkspaceTabDocument(tab);
4535
+ return {
4536
+ mode: "web",
4537
+ subaction: command.subaction,
4538
+ tab: cloneWebBrowserWorkspaceTabState(tab),
4539
+ value: { url: tab.url, title: tab.title, changed: true },
4540
+ };
4541
+ });
4542
+ }
4543
+ case "inspect":
4544
+ case "snapshot":
4545
+ case "check":
4546
+ case "click":
4547
+ case "dblclick":
4548
+ case "find":
4549
+ case "fill":
4550
+ case "focus":
4551
+ case "get":
4552
+ case "hover":
4553
+ case "keydown":
4554
+ case "keyup":
4555
+ case "keyboardinserttext":
4556
+ case "keyboardtype":
4557
+ case "press":
4558
+ case "scroll":
4559
+ case "scrollinto":
4560
+ case "select":
4561
+ case "type":
4562
+ case "uncheck":
4563
+ case "wait":
4564
+ if (command.subaction === "wait" &&
4565
+ !command.selector &&
4566
+ !command.findBy &&
4567
+ !command.text &&
4568
+ !command.url &&
4569
+ !command.script &&
4570
+ typeof command.timeoutMs === "number" &&
4571
+ Number.isFinite(command.timeoutMs)) {
4572
+ const waitedMs = Math.max(0, command.timeoutMs);
4573
+ await sleep(waitedMs);
4574
+ return {
4575
+ mode: getBrowserWorkspaceMode(env),
4576
+ subaction: command.subaction,
4577
+ value: { waitedMs },
4578
+ };
4579
+ }
4580
+ if (isBrowserWorkspaceBridgeConfigured(env)) {
4581
+ return executeDesktopBrowserWorkspaceDomCommand(command, env);
4582
+ }
4583
+ return executeWebBrowserWorkspaceDomCommand(command);
4584
+ default: {
4585
+ const exhaustive = command.subaction;
4586
+ throw new Error(`Unsupported browser workspace subaction: ${exhaustive}`);
4587
+ }
4588
+ }
4589
+ }