@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.
- package/LICENSE +1 -1
- package/apps/app-companion/src/actions/emote.d.ts +10 -0
- package/apps/app-companion/src/actions/emote.d.ts.map +1 -0
- package/apps/app-companion/src/actions/emote.js +79 -0
- package/apps/app-companion/src/emotes/catalog.d.ts +31 -0
- package/apps/app-companion/src/emotes/catalog.d.ts.map +1 -0
- package/apps/app-companion/src/emotes/catalog.js +402 -0
- package/apps/app-companion/src/plugin.d.ts +9 -0
- package/apps/app-companion/src/plugin.d.ts.map +1 -0
- package/apps/app-companion/src/plugin.js +15 -0
- package/apps/app-knowledge/src/routes.d.ts +23 -0
- package/apps/app-knowledge/src/routes.d.ts.map +1 -0
- package/apps/app-knowledge/src/routes.js +956 -0
- package/apps/app-knowledge/src/service-loader.d.ts +51 -0
- package/apps/app-knowledge/src/service-loader.d.ts.map +1 -0
- package/apps/app-knowledge/src/service-loader.js +34 -0
- package/apps/app-lifeops/src/action.d.ts +3 -0
- package/apps/app-lifeops/src/action.d.ts.map +1 -0
- package/apps/app-lifeops/src/action.js +332 -0
- package/apps/app-lifeops/src/actions/calendar.d.ts +19 -0
- package/apps/app-lifeops/src/actions/calendar.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/calendar.js +3143 -0
- package/apps/app-lifeops/src/actions/gmail.d.ts +33 -0
- package/apps/app-lifeops/src/actions/gmail.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/gmail.js +1734 -0
- package/apps/app-lifeops/src/actions/inbox-digest.d.ts +2 -0
- package/apps/app-lifeops/src/actions/inbox-digest.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/inbox-digest.js +1 -0
- package/apps/app-lifeops/src/actions/inbox-respond.d.ts +2 -0
- package/apps/app-lifeops/src/actions/inbox-respond.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/inbox-respond.js +1 -0
- package/apps/app-lifeops/src/actions/inbox-triage.d.ts +2 -0
- package/apps/app-lifeops/src/actions/inbox-triage.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/inbox-triage.js +1 -0
- package/apps/app-lifeops/src/actions/inbox.d.ts +3 -0
- package/apps/app-lifeops/src/actions/inbox.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/inbox.js +856 -0
- package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts +69 -0
- package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life-goal-extractor.js +354 -0
- package/apps/app-lifeops/src/actions/life-param-extractor.d.ts +78 -0
- package/apps/app-lifeops/src/actions/life-param-extractor.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life-param-extractor.js +423 -0
- package/apps/app-lifeops/src/actions/life-recent-context.d.ts +9 -0
- package/apps/app-lifeops/src/actions/life-recent-context.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life-recent-context.js +84 -0
- package/apps/app-lifeops/src/actions/life-update-extractor.d.ts +27 -0
- package/apps/app-lifeops/src/actions/life-update-extractor.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life-update-extractor.js +195 -0
- package/apps/app-lifeops/src/actions/life.d.ts +9 -0
- package/apps/app-lifeops/src/actions/life.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life.extractor.d.ts +18 -0
- package/apps/app-lifeops/src/actions/life.extractor.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/life.extractor.js +264 -0
- package/apps/app-lifeops/src/actions/life.js +3379 -0
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts +16 -0
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.js +25 -0
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts +62 -0
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.js +607 -0
- package/apps/app-lifeops/src/actions/timezone-normalization.d.ts +3 -0
- package/apps/app-lifeops/src/actions/timezone-normalization.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/timezone-normalization.js +105 -0
- package/apps/app-lifeops/src/actions/update-owner-profile.d.ts +3 -0
- package/apps/app-lifeops/src/actions/update-owner-profile.d.ts.map +1 -0
- package/apps/app-lifeops/src/actions/update-owner-profile.js +131 -0
- package/apps/app-lifeops/src/inbox/channel-deep-links.d.ts +20 -0
- package/apps/app-lifeops/src/inbox/channel-deep-links.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/channel-deep-links.js +185 -0
- package/apps/app-lifeops/src/inbox/config.d.ts +7 -0
- package/apps/app-lifeops/src/inbox/config.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/config.js +59 -0
- package/apps/app-lifeops/src/inbox/message-fetcher.d.ts +33 -0
- package/apps/app-lifeops/src/inbox/message-fetcher.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/message-fetcher.js +252 -0
- package/apps/app-lifeops/src/inbox/reflection.d.ts +45 -0
- package/apps/app-lifeops/src/inbox/reflection.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/reflection.js +157 -0
- package/apps/app-lifeops/src/inbox/repository.d.ts +53 -0
- package/apps/app-lifeops/src/inbox/repository.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/repository.js +362 -0
- package/apps/app-lifeops/src/inbox/triage-classifier.d.ts +17 -0
- package/apps/app-lifeops/src/inbox/triage-classifier.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/triage-classifier.js +209 -0
- package/apps/app-lifeops/src/inbox/types.d.ts +130 -0
- package/apps/app-lifeops/src/inbox/types.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/types.js +1 -0
- package/apps/app-lifeops/src/lifeops/app-state.d.ts +11 -0
- package/apps/app-lifeops/src/lifeops/app-state.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/app-state.js +32 -0
- package/apps/app-lifeops/src/lifeops/apple-reminders.d.ts +58 -0
- package/apps/app-lifeops/src/lifeops/apple-reminders.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/apple-reminders.js +325 -0
- package/apps/app-lifeops/src/lifeops/defaults.d.ts +24 -0
- package/apps/app-lifeops/src/lifeops/defaults.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/defaults.js +205 -0
- package/apps/app-lifeops/src/lifeops/engine.d.ts +8 -0
- package/apps/app-lifeops/src/lifeops/engine.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/engine.js +389 -0
- package/apps/app-lifeops/src/lifeops/goal-grounding.d.ts +54 -0
- package/apps/app-lifeops/src/lifeops/goal-grounding.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/goal-grounding.js +147 -0
- package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.d.ts +12 -0
- package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/goal-semantic-evaluator.js +154 -0
- package/apps/app-lifeops/src/lifeops/google-api-error.d.ts +7 -0
- package/apps/app-lifeops/src/lifeops/google-api-error.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-api-error.js +35 -0
- package/apps/app-lifeops/src/lifeops/google-calendar.d.ts +53 -0
- package/apps/app-lifeops/src/lifeops/google-calendar.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-calendar.js +268 -0
- package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts +19 -0
- package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-connector-gateway.js +65 -0
- package/apps/app-lifeops/src/lifeops/google-fetch.d.ts +11 -0
- package/apps/app-lifeops/src/lifeops/google-fetch.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-fetch.js +85 -0
- package/apps/app-lifeops/src/lifeops/google-gmail.d.ts +54 -0
- package/apps/app-lifeops/src/lifeops/google-gmail.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-gmail.js +471 -0
- package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts +127 -0
- package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-managed-client.js +294 -0
- package/apps/app-lifeops/src/lifeops/google-oauth.d.ts +61 -0
- package/apps/app-lifeops/src/lifeops/google-oauth.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-oauth.js +491 -0
- package/apps/app-lifeops/src/lifeops/google-scopes.d.ts +13 -0
- package/apps/app-lifeops/src/lifeops/google-scopes.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/google-scopes.js +96 -0
- package/apps/app-lifeops/src/lifeops/index.d.ts +25 -0
- package/apps/app-lifeops/src/lifeops/index.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/index.js +24 -0
- package/apps/app-lifeops/src/lifeops/owner-profile.d.ts +15 -0
- package/apps/app-lifeops/src/lifeops/owner-profile.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/owner-profile.js +194 -0
- package/apps/app-lifeops/src/lifeops/repository.d.ts +209 -0
- package/apps/app-lifeops/src/lifeops/repository.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/repository.js +3187 -0
- package/apps/app-lifeops/src/lifeops/runtime.d.ts +14 -0
- package/apps/app-lifeops/src/lifeops/runtime.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/runtime.js +120 -0
- package/apps/app-lifeops/src/lifeops/screen-context.d.ts +52 -0
- package/apps/app-lifeops/src/lifeops/screen-context.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/screen-context.js +332 -0
- package/apps/app-lifeops/src/lifeops/seed-routines.d.ts +20 -0
- package/apps/app-lifeops/src/lifeops/seed-routines.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/seed-routines.js +111 -0
- package/apps/app-lifeops/src/lifeops/service.d.ts +275 -0
- package/apps/app-lifeops/src/lifeops/service.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/service.js +9260 -0
- package/apps/app-lifeops/src/lifeops/sql.d.ts +31 -0
- package/apps/app-lifeops/src/lifeops/sql.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/sql.js +247 -0
- package/apps/app-lifeops/src/lifeops/time.d.ts +17 -0
- package/apps/app-lifeops/src/lifeops/time.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/time.js +132 -0
- package/apps/app-lifeops/src/lifeops/twilio.d.ts +25 -0
- package/apps/app-lifeops/src/lifeops/twilio.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/twilio.js +157 -0
- package/apps/app-lifeops/src/lifeops/x-poster.d.ts +19 -0
- package/apps/app-lifeops/src/lifeops/x-poster.d.ts.map +1 -0
- package/apps/app-lifeops/src/lifeops/x-poster.js +148 -0
- package/apps/app-lifeops/src/plugin.d.ts +22 -0
- package/apps/app-lifeops/src/plugin.d.ts.map +1 -0
- package/apps/app-lifeops/src/plugin.js +92 -0
- package/apps/app-lifeops/src/provider.d.ts +3 -0
- package/apps/app-lifeops/src/provider.d.ts.map +1 -0
- package/apps/app-lifeops/src/provider.js +75 -0
- package/apps/app-lifeops/src/providers/inbox-triage.d.ts +3 -0
- package/apps/app-lifeops/src/providers/inbox-triage.d.ts.map +1 -0
- package/apps/app-lifeops/src/providers/inbox-triage.js +89 -0
- package/apps/app-lifeops/src/providers/lifeops.d.ts +3 -0
- package/apps/app-lifeops/src/providers/lifeops.d.ts.map +1 -0
- package/apps/app-lifeops/src/providers/lifeops.js +157 -0
- package/apps/app-lifeops/src/routes/lifeops-browser-packaging.d.ts +16 -0
- package/apps/app-lifeops/src/routes/lifeops-browser-packaging.d.ts.map +1 -0
- package/apps/app-lifeops/src/routes/lifeops-browser-packaging.js +305 -0
- package/apps/app-lifeops/src/routes/lifeops-routes.d.ts +20 -0
- package/apps/app-lifeops/src/routes/lifeops-routes.d.ts.map +1 -0
- package/apps/app-lifeops/src/routes/lifeops-routes.js +1173 -0
- package/apps/app-lifeops/src/routes/website-blocker-routes.d.ts +7 -0
- package/apps/app-lifeops/src/routes/website-blocker-routes.d.ts.map +1 -0
- package/apps/app-lifeops/src/routes/website-blocker-routes.js +175 -0
- package/apps/app-lifeops/src/selfcontrol/access.d.ts +8 -0
- package/apps/app-lifeops/src/selfcontrol/access.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/access.js +16 -0
- package/apps/app-lifeops/src/selfcontrol/action.d.ts +10 -0
- package/apps/app-lifeops/src/selfcontrol/action.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/action.js +506 -0
- package/apps/app-lifeops/src/selfcontrol/index.d.ts +13 -0
- package/apps/app-lifeops/src/selfcontrol/index.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/index.js +10 -0
- package/apps/app-lifeops/src/selfcontrol/permissions.d.ts +9 -0
- package/apps/app-lifeops/src/selfcontrol/permissions.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/permissions.js +1 -0
- package/apps/app-lifeops/src/selfcontrol/provider.d.ts +4 -0
- package/apps/app-lifeops/src/selfcontrol/provider.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/provider.js +116 -0
- package/apps/app-lifeops/src/selfcontrol/roles.d.ts +13 -0
- package/apps/app-lifeops/src/selfcontrol/roles.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/roles.js +228 -0
- package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts +97 -0
- package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/selfcontrol.js +949 -0
- package/apps/app-lifeops/src/selfcontrol/service.d.ts +21 -0
- package/apps/app-lifeops/src/selfcontrol/service.d.ts.map +1 -0
- package/apps/app-lifeops/src/selfcontrol/service.js +268 -0
- package/apps/app-lifeops/src/service.d.ts +8 -0
- package/apps/app-lifeops/src/service.d.ts.map +1 -0
- package/apps/app-lifeops/src/service.js +11 -0
- package/apps/app-steward/src/api/wallet-capability.d.ts +28 -0
- package/apps/app-steward/src/api/wallet-capability.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet-capability.js +94 -0
- package/apps/app-steward/src/api/wallet-dex-prices.d.ts +43 -0
- package/apps/app-steward/src/api/wallet-dex-prices.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet-dex-prices.js +149 -0
- package/apps/app-steward/src/api/wallet-evm-balance.d.ts +66 -0
- package/apps/app-steward/src/api/wallet-evm-balance.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet-evm-balance.js +666 -0
- package/apps/app-steward/src/api/wallet-routes.d.ts +35 -0
- package/apps/app-steward/src/api/wallet-routes.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet-routes.js +470 -0
- package/apps/app-steward/src/api/wallet-rpc.d.ts +67 -0
- package/apps/app-steward/src/api/wallet-rpc.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet-rpc.js +453 -0
- package/apps/app-steward/src/api/wallet.d.ts +60 -0
- package/apps/app-steward/src/api/wallet.d.ts.map +1 -0
- package/apps/app-steward/src/api/wallet.js +639 -0
- package/apps/app-steward/src/routes/server-wallet-trade.d.ts +27 -0
- package/apps/app-steward/src/routes/server-wallet-trade.d.ts.map +1 -0
- package/apps/app-steward/src/routes/server-wallet-trade.js +69 -0
- package/apps/app-steward/src/routes/wallet-core-routes.d.ts +16 -0
- package/apps/app-steward/src/routes/wallet-core-routes.d.ts.map +1 -0
- package/apps/app-steward/src/routes/wallet-core-routes.js +46 -0
- package/apps/app-steward/src/routes/wallet-export-guard.d.ts +51 -0
- package/apps/app-steward/src/routes/wallet-export-guard.d.ts.map +1 -0
- package/apps/app-steward/src/routes/wallet-export-guard.js +248 -0
- package/apps/app-steward/src/services/steward-evm-account.d.ts +58 -0
- package/apps/app-steward/src/services/steward-evm-account.d.ts.map +1 -0
- package/apps/app-steward/src/services/steward-evm-account.js +302 -0
- package/apps/app-steward/src/services/steward-evm-bridge.d.ts +35 -0
- package/apps/app-steward/src/services/steward-evm-bridge.d.ts.map +1 -0
- package/apps/app-steward/src/services/steward-evm-bridge.js +99 -0
- package/apps/app-training/src/services/index.d.ts +3 -0
- package/apps/app-training/src/services/index.d.ts.map +1 -0
- package/apps/app-training/src/services/index.js +1 -0
- package/apps/app-training/src/services/training-backend-check.d.ts +8 -0
- package/apps/app-training/src/services/training-backend-check.d.ts.map +1 -0
- package/apps/app-training/src/services/training-backend-check.js +28 -0
- package/apps/app-training/src/services/training-service-like.d.ts +38 -0
- package/apps/app-training/src/services/training-service-like.d.ts.map +1 -0
- package/apps/app-training/src/services/training-service-like.js +1 -0
- package/package.json +491 -34
- package/packages/agent/src/actions/app-control.d.ts +17 -0
- package/packages/agent/src/actions/app-control.d.ts.map +1 -0
- package/packages/agent/src/actions/app-control.js +212 -0
- package/packages/agent/src/actions/calendar.d.ts +2 -0
- package/packages/agent/src/actions/calendar.d.ts.map +1 -0
- package/packages/agent/src/actions/calendar.js +1 -0
- package/packages/agent/src/actions/check-balance.d.ts +17 -0
- package/packages/agent/src/actions/check-balance.d.ts.map +1 -0
- package/packages/agent/src/actions/check-balance.js +167 -0
- package/packages/agent/src/actions/connector-resolver.d.ts +75 -0
- package/packages/agent/src/actions/connector-resolver.d.ts.map +1 -0
- package/packages/agent/src/actions/connector-resolver.js +245 -0
- package/packages/agent/src/actions/context-signal-lexicon.d.ts +17 -0
- package/packages/agent/src/actions/context-signal-lexicon.d.ts.map +1 -0
- package/packages/agent/src/actions/context-signal-lexicon.js +207 -0
- package/packages/agent/src/actions/context-signal.d.ts +46 -0
- package/packages/agent/src/actions/context-signal.d.ts.map +1 -0
- package/packages/agent/src/actions/context-signal.js +134 -0
- package/packages/agent/src/actions/eject-plugin.d.ts +3 -0
- package/packages/agent/src/actions/eject-plugin.d.ts.map +1 -0
- package/packages/agent/src/actions/eject-plugin.js +48 -0
- package/packages/agent/src/actions/entity-actions.d.ts +4 -0
- package/packages/agent/src/actions/entity-actions.d.ts.map +1 -0
- package/packages/agent/src/actions/entity-actions.js +344 -0
- package/packages/agent/src/actions/execute-trade.d.ts +17 -0
- package/packages/agent/src/actions/execute-trade.d.ts.map +1 -0
- package/packages/agent/src/actions/execute-trade.js +299 -0
- package/packages/agent/src/actions/get-self-status.d.ts +13 -0
- package/packages/agent/src/actions/get-self-status.d.ts.map +1 -0
- package/packages/agent/src/actions/get-self-status.js +66 -0
- package/packages/agent/src/actions/gmail.d.ts +2 -0
- package/packages/agent/src/actions/gmail.d.ts.map +1 -0
- package/packages/agent/src/actions/gmail.js +1 -0
- package/packages/agent/src/actions/grounded-action-reply.d.ts +22 -0
- package/packages/agent/src/actions/grounded-action-reply.d.ts.map +1 -0
- package/packages/agent/src/actions/grounded-action-reply.js +309 -0
- package/packages/agent/src/actions/inbox-digest.d.ts +2 -0
- package/packages/agent/src/actions/inbox-digest.d.ts.map +1 -0
- package/packages/agent/src/actions/inbox-digest.js +1 -0
- package/packages/agent/src/actions/inbox-respond.d.ts +2 -0
- package/packages/agent/src/actions/inbox-respond.d.ts.map +1 -0
- package/packages/agent/src/actions/inbox-respond.js +1 -0
- package/packages/agent/src/actions/inbox-triage.d.ts +2 -0
- package/packages/agent/src/actions/inbox-triage.d.ts.map +1 -0
- package/packages/agent/src/actions/inbox-triage.js +1 -0
- package/packages/agent/src/actions/inbox.d.ts +2 -0
- package/packages/agent/src/actions/inbox.d.ts.map +1 -0
- package/packages/agent/src/actions/inbox.js +1 -0
- package/packages/agent/src/actions/index.d.ts +24 -0
- package/packages/agent/src/actions/index.d.ts.map +1 -0
- package/packages/agent/src/actions/index.js +23 -0
- package/packages/agent/src/actions/install-plugin.d.ts +3 -0
- package/packages/agent/src/actions/install-plugin.d.ts.map +1 -0
- package/packages/agent/src/actions/install-plugin.js +65 -0
- package/packages/agent/src/actions/life-goal-extractor.d.ts +2 -0
- package/packages/agent/src/actions/life-goal-extractor.d.ts.map +1 -0
- package/packages/agent/src/actions/life-goal-extractor.js +1 -0
- package/packages/agent/src/actions/life-param-extractor.d.ts +2 -0
- package/packages/agent/src/actions/life-param-extractor.d.ts.map +1 -0
- package/packages/agent/src/actions/life-param-extractor.js +1 -0
- package/packages/agent/src/actions/life-recent-context.d.ts +2 -0
- package/packages/agent/src/actions/life-recent-context.d.ts.map +1 -0
- package/packages/agent/src/actions/life-recent-context.js +1 -0
- package/packages/agent/src/actions/life-update-extractor.d.ts +2 -0
- package/packages/agent/src/actions/life-update-extractor.d.ts.map +1 -0
- package/packages/agent/src/actions/life-update-extractor.js +1 -0
- package/packages/agent/src/actions/life.d.ts +2 -0
- package/packages/agent/src/actions/life.d.ts.map +1 -0
- package/packages/agent/src/actions/life.extractor.d.ts +2 -0
- package/packages/agent/src/actions/life.extractor.d.ts.map +1 -0
- package/packages/agent/src/actions/life.extractor.js +1 -0
- package/packages/agent/src/actions/life.js +1 -0
- package/packages/agent/src/actions/lifeops-extraction-config.d.ts +2 -0
- package/packages/agent/src/actions/lifeops-extraction-config.d.ts.map +1 -0
- package/packages/agent/src/actions/lifeops-extraction-config.js +1 -0
- package/packages/agent/src/actions/lifeops-google-helpers.d.ts +2 -0
- package/packages/agent/src/actions/lifeops-google-helpers.d.ts.map +1 -0
- package/packages/agent/src/actions/lifeops-google-helpers.js +1 -0
- package/packages/agent/src/actions/list-ejected.d.ts +3 -0
- package/packages/agent/src/actions/list-ejected.d.ts.map +1 -0
- package/packages/agent/src/actions/list-ejected.js +35 -0
- package/packages/agent/src/actions/log-level.d.ts +3 -0
- package/packages/agent/src/actions/log-level.d.ts.map +1 -0
- package/packages/agent/src/actions/log-level.js +125 -0
- package/packages/agent/src/actions/manage-tasks.d.ts +8 -0
- package/packages/agent/src/actions/manage-tasks.d.ts.map +1 -0
- package/packages/agent/src/actions/manage-tasks.js +289 -0
- package/packages/agent/src/actions/media.d.ts +21 -0
- package/packages/agent/src/actions/media.d.ts.map +1 -0
- package/packages/agent/src/actions/media.js +384 -0
- package/packages/agent/src/actions/read-channel.d.ts +3 -0
- package/packages/agent/src/actions/read-channel.d.ts.map +1 -0
- package/packages/agent/src/actions/read-channel.js +224 -0
- package/packages/agent/src/actions/read-messages.d.ts +14 -0
- package/packages/agent/src/actions/read-messages.d.ts.map +1 -0
- package/packages/agent/src/actions/read-messages.js +228 -0
- package/packages/agent/src/actions/reinject-plugin.d.ts +3 -0
- package/packages/agent/src/actions/reinject-plugin.d.ts.map +1 -0
- package/packages/agent/src/actions/reinject-plugin.js +47 -0
- package/packages/agent/src/actions/restart.d.ts +19 -0
- package/packages/agent/src/actions/restart.d.ts.map +1 -0
- package/packages/agent/src/actions/restart.js +109 -0
- package/packages/agent/src/actions/search-conversations.d.ts +3 -0
- package/packages/agent/src/actions/search-conversations.d.ts.map +1 -0
- package/packages/agent/src/actions/search-conversations.js +181 -0
- package/packages/agent/src/actions/send-admin-message.d.ts +3 -0
- package/packages/agent/src/actions/send-admin-message.d.ts.map +1 -0
- package/packages/agent/src/actions/send-admin-message.js +106 -0
- package/packages/agent/src/actions/send-message.d.ts +4 -0
- package/packages/agent/src/actions/send-message.d.ts.map +1 -0
- package/packages/agent/src/actions/send-message.js +364 -0
- package/packages/agent/src/actions/set-user-name.d.ts +13 -0
- package/packages/agent/src/actions/set-user-name.d.ts.map +1 -0
- package/packages/agent/src/actions/set-user-name.js +82 -0
- package/packages/agent/src/actions/skill-command.d.ts +20 -0
- package/packages/agent/src/actions/skill-command.d.ts.map +1 -0
- package/packages/agent/src/actions/skill-command.js +141 -0
- package/packages/agent/src/actions/stream-control.d.ts +11 -0
- package/packages/agent/src/actions/stream-control.d.ts.map +1 -0
- package/packages/agent/src/actions/stream-control.js +112 -0
- package/packages/agent/src/actions/sync-plugin.d.ts +3 -0
- package/packages/agent/src/actions/sync-plugin.d.ts.map +1 -0
- package/packages/agent/src/actions/sync-plugin.js +47 -0
- package/packages/agent/src/actions/terminal.d.ts +15 -0
- package/packages/agent/src/actions/terminal.d.ts.map +1 -0
- package/packages/agent/src/actions/terminal.js +453 -0
- package/packages/agent/src/actions/timezone-normalization.d.ts +2 -0
- package/packages/agent/src/actions/timezone-normalization.d.ts.map +1 -0
- package/packages/agent/src/actions/timezone-normalization.js +1 -0
- package/packages/agent/src/actions/transfer-token.d.ts +17 -0
- package/packages/agent/src/actions/transfer-token.d.ts.map +1 -0
- package/packages/agent/src/actions/transfer-token.js +470 -0
- package/packages/agent/src/actions/update-owner-profile.d.ts +2 -0
- package/packages/agent/src/actions/update-owner-profile.d.ts.map +1 -0
- package/packages/agent/src/actions/update-owner-profile.js +1 -0
- package/packages/agent/src/actions/wallet-action-shared.d.ts +15 -0
- package/packages/agent/src/actions/wallet-action-shared.d.ts.map +1 -0
- package/packages/agent/src/actions/wallet-action-shared.js +24 -0
- package/packages/agent/src/actions/web-search.d.ts +16 -0
- package/packages/agent/src/actions/web-search.d.ts.map +1 -0
- package/packages/agent/src/actions/web-search.js +196 -0
- package/packages/agent/src/activity-profile/analyzer.d.ts +23 -0
- package/packages/agent/src/activity-profile/analyzer.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/analyzer.js +531 -0
- package/packages/agent/src/activity-profile/proactive-planner.d.ts +49 -0
- package/packages/agent/src/activity-profile/proactive-planner.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/proactive-planner.js +455 -0
- package/packages/agent/src/activity-profile/proactive-worker.d.ts +32 -0
- package/packages/agent/src/activity-profile/proactive-worker.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/proactive-worker.js +523 -0
- package/packages/agent/src/activity-profile/profile-metadata.d.ts +10 -0
- package/packages/agent/src/activity-profile/profile-metadata.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/profile-metadata.js +25 -0
- package/packages/agent/src/activity-profile/service.d.ts +11 -0
- package/packages/agent/src/activity-profile/service.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/service.js +226 -0
- package/packages/agent/src/activity-profile/types.d.ts +89 -0
- package/packages/agent/src/activity-profile/types.d.ts.map +1 -0
- package/packages/agent/src/activity-profile/types.js +29 -0
- package/packages/agent/src/api/agent-admin-routes.d.ts +39 -0
- package/packages/agent/src/api/agent-admin-routes.d.ts.map +1 -0
- package/packages/agent/src/api/agent-admin-routes.js +155 -0
- package/packages/agent/src/api/agent-lifecycle-routes.d.ts +16 -0
- package/packages/agent/src/api/agent-lifecycle-routes.d.ts.map +1 -0
- package/packages/agent/src/api/agent-lifecycle-routes.js +94 -0
- package/packages/agent/src/api/agent-model.d.ts +5 -0
- package/packages/agent/src/api/agent-model.d.ts.map +1 -0
- package/packages/agent/src/api/agent-model.js +154 -0
- package/packages/agent/src/api/agent-status-routes.d.ts +96 -0
- package/packages/agent/src/api/agent-status-routes.d.ts.map +1 -0
- package/packages/agent/src/api/agent-status-routes.js +274 -0
- package/packages/agent/src/api/agent-transfer-routes.d.ts +16 -0
- package/packages/agent/src/api/agent-transfer-routes.d.ts.map +1 -0
- package/packages/agent/src/api/agent-transfer-routes.js +124 -0
- package/packages/agent/src/api/app-package-routes.d.ts +7 -0
- package/packages/agent/src/api/app-package-routes.d.ts.map +1 -0
- package/packages/agent/src/api/app-package-routes.js +59 -0
- package/packages/agent/src/api/apps-routes.d.ts +24 -0
- package/packages/agent/src/api/apps-routes.d.ts.map +1 -0
- package/packages/agent/src/api/apps-routes.js +477 -0
- package/packages/agent/src/api/auth-routes.d.ts +11 -0
- package/packages/agent/src/api/auth-routes.d.ts.map +1 -0
- package/packages/agent/src/api/auth-routes.js +74 -0
- package/packages/agent/src/api/avatar-routes.d.ts +11 -0
- package/packages/agent/src/api/avatar-routes.d.ts.map +1 -0
- package/packages/agent/src/api/avatar-routes.js +205 -0
- package/packages/agent/src/api/binance-skill-helpers.d.ts +26 -0
- package/packages/agent/src/api/binance-skill-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/binance-skill-helpers.js +781 -0
- package/packages/agent/src/api/bluebubbles-routes.d.ts +10 -0
- package/packages/agent/src/api/bluebubbles-routes.d.ts.map +1 -0
- package/packages/agent/src/api/bluebubbles-routes.js +129 -0
- package/packages/agent/src/api/browser-workspace-routes.d.ts +5 -0
- package/packages/agent/src/api/browser-workspace-routes.d.ts.map +1 -0
- package/packages/agent/src/api/browser-workspace-routes.js +100 -0
- package/packages/agent/src/api/bsc-trade.d.ts +40 -0
- package/packages/agent/src/api/bsc-trade.d.ts.map +1 -0
- package/packages/agent/src/api/bsc-trade.js +786 -0
- package/packages/agent/src/api/bug-report-routes.d.ts +10 -0
- package/packages/agent/src/api/bug-report-routes.d.ts.map +1 -0
- package/packages/agent/src/api/bug-report-routes.js +264 -0
- package/packages/agent/src/api/character-routes.d.ts +51 -0
- package/packages/agent/src/api/character-routes.d.ts.map +1 -0
- package/packages/agent/src/api/character-routes.js +367 -0
- package/packages/agent/src/api/chat-augmentation.d.ts +89 -0
- package/packages/agent/src/api/chat-augmentation.d.ts.map +1 -0
- package/packages/agent/src/api/chat-augmentation.js +396 -0
- package/packages/agent/src/api/chat-routes.d.ts +106 -0
- package/packages/agent/src/api/chat-routes.d.ts.map +1 -0
- package/packages/agent/src/api/chat-routes.js +1500 -0
- package/packages/agent/src/api/chat-text-helpers.d.ts +11 -0
- package/packages/agent/src/api/chat-text-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/chat-text-helpers.js +183 -0
- package/packages/agent/src/api/cloud-billing-routes.d.ts +9 -0
- package/packages/agent/src/api/cloud-billing-routes.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-billing-routes.js +388 -0
- package/packages/agent/src/api/cloud-compat-routes.d.ts +10 -0
- package/packages/agent/src/api/cloud-compat-routes.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-compat-routes.js +212 -0
- package/packages/agent/src/api/cloud-provisioning.d.ts +14 -0
- package/packages/agent/src/api/cloud-provisioning.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-provisioning.js +30 -0
- package/packages/agent/src/api/cloud-relay-routes.d.ts +22 -0
- package/packages/agent/src/api/cloud-relay-routes.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-relay-routes.js +52 -0
- package/packages/agent/src/api/cloud-routes.d.ts +80 -0
- package/packages/agent/src/api/cloud-routes.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-routes.js +582 -0
- package/packages/agent/src/api/cloud-status-routes.d.ts +15 -0
- package/packages/agent/src/api/cloud-status-routes.d.ts.map +1 -0
- package/packages/agent/src/api/cloud-status-routes.js +143 -0
- package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts +2 -0
- package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts.map +1 -0
- package/packages/agent/src/api/coding-agents-auth-sanitize.js +1 -0
- package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts +2 -0
- package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts.map +1 -0
- package/packages/agent/src/api/coding-agents-preflight-normalize.js +1 -0
- package/packages/agent/src/api/compat-utils.d.ts +49 -0
- package/packages/agent/src/api/compat-utils.d.ts.map +1 -0
- package/packages/agent/src/api/compat-utils.js +126 -0
- package/packages/agent/src/api/config-env.d.ts +43 -0
- package/packages/agent/src/api/config-env.d.ts.map +1 -0
- package/packages/agent/src/api/config-env.js +284 -0
- package/packages/agent/src/api/config-routes.d.ts +33 -0
- package/packages/agent/src/api/config-routes.d.ts.map +1 -0
- package/packages/agent/src/api/config-routes.js +253 -0
- package/packages/agent/src/api/connector-health.d.ts +42 -0
- package/packages/agent/src/api/connector-health.d.ts.map +1 -0
- package/packages/agent/src/api/connector-health.js +132 -0
- package/packages/agent/src/api/connector-routes.d.ts +21 -0
- package/packages/agent/src/api/connector-routes.d.ts.map +1 -0
- package/packages/agent/src/api/connector-routes.js +79 -0
- package/packages/agent/src/api/conversation-routes.d.ts +42 -0
- package/packages/agent/src/api/conversation-routes.d.ts.map +1 -0
- package/packages/agent/src/api/conversation-routes.js +1128 -0
- package/packages/agent/src/api/coordinator-types.d.ts +2 -0
- package/packages/agent/src/api/coordinator-types.d.ts.map +1 -0
- package/packages/agent/src/api/coordinator-types.js +1 -0
- package/packages/agent/src/api/coordinator-wiring.d.ts +2 -0
- package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -0
- package/packages/agent/src/api/coordinator-wiring.js +1 -0
- package/packages/agent/src/api/credit-detection.d.ts +9 -0
- package/packages/agent/src/api/credit-detection.d.ts.map +1 -0
- package/packages/agent/src/api/credit-detection.js +41 -0
- package/packages/agent/src/api/database.d.ts +33 -0
- package/packages/agent/src/api/database.d.ts.map +1 -0
- package/packages/agent/src/api/database.js +1020 -0
- package/packages/agent/src/api/diagnostics-routes.d.ts +53 -0
- package/packages/agent/src/api/diagnostics-routes.d.ts.map +1 -0
- package/packages/agent/src/api/diagnostics-routes.js +250 -0
- package/packages/agent/src/api/discord-avatar-cache.d.ts +10 -0
- package/packages/agent/src/api/discord-avatar-cache.d.ts.map +1 -0
- package/packages/agent/src/api/discord-avatar-cache.js +149 -0
- package/packages/agent/src/api/discord-local-routes.d.ts +12 -0
- package/packages/agent/src/api/discord-local-routes.d.ts.map +1 -0
- package/packages/agent/src/api/discord-local-routes.js +145 -0
- package/packages/agent/src/api/discord-profiles.d.ts +26 -0
- package/packages/agent/src/api/discord-profiles.d.ts.map +1 -0
- package/packages/agent/src/api/discord-profiles.js +282 -0
- package/packages/agent/src/api/drop-routes.d.ts +22 -0
- package/packages/agent/src/api/drop-routes.d.ts.map +1 -0
- package/packages/agent/src/api/drop-routes.js +155 -0
- package/packages/agent/src/api/drop-service.d.ts +26 -0
- package/packages/agent/src/api/drop-service.d.ts.map +1 -0
- package/packages/agent/src/api/drop-service.js +134 -0
- package/packages/agent/src/api/early-logs.d.ts +29 -0
- package/packages/agent/src/api/early-logs.d.ts.map +1 -0
- package/packages/agent/src/api/early-logs.js +96 -0
- package/packages/agent/src/api/health-routes.d.ts +44 -0
- package/packages/agent/src/api/health-routes.d.ts.map +1 -0
- package/packages/agent/src/api/health-routes.js +449 -0
- package/packages/agent/src/api/http-helpers.d.ts +50 -0
- package/packages/agent/src/api/http-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/http-helpers.js +148 -0
- package/packages/agent/src/api/imessage-routes.d.ts +55 -0
- package/packages/agent/src/api/imessage-routes.d.ts.map +1 -0
- package/packages/agent/src/api/imessage-routes.js +231 -0
- package/packages/agent/src/api/inbox-routes.d.ts +48 -0
- package/packages/agent/src/api/inbox-routes.d.ts.map +1 -0
- package/packages/agent/src/api/inbox-routes.js +1547 -0
- package/packages/agent/src/api/index.d.ts +63 -0
- package/packages/agent/src/api/index.d.ts.map +1 -0
- package/packages/agent/src/api/index.js +62 -0
- package/packages/agent/src/api/knowledge-routes.d.ts +2 -0
- package/packages/agent/src/api/knowledge-routes.d.ts.map +1 -0
- package/packages/agent/src/api/knowledge-routes.js +2 -0
- package/packages/agent/src/api/knowledge-service-loader.d.ts +2 -0
- package/packages/agent/src/api/knowledge-service-loader.d.ts.map +1 -0
- package/packages/agent/src/api/knowledge-service-loader.js +2 -0
- package/packages/agent/src/api/lifeops-browser-packaging.d.ts +2 -0
- package/packages/agent/src/api/lifeops-browser-packaging.d.ts.map +1 -0
- package/packages/agent/src/api/lifeops-browser-packaging.js +1 -0
- package/packages/agent/src/api/lifeops-routes.d.ts +2 -0
- package/packages/agent/src/api/lifeops-routes.d.ts.map +1 -0
- package/packages/agent/src/api/lifeops-routes.js +1 -0
- package/packages/agent/src/api/mcp-routes.d.ts +33 -0
- package/packages/agent/src/api/mcp-routes.d.ts.map +1 -0
- package/packages/agent/src/api/mcp-routes.js +186 -0
- package/packages/agent/src/api/memory-bounds.d.ts +51 -0
- package/packages/agent/src/api/memory-bounds.d.ts.map +1 -0
- package/packages/agent/src/api/memory-bounds.js +81 -0
- package/packages/agent/src/api/memory-routes.d.ts +9 -0
- package/packages/agent/src/api/memory-routes.d.ts.map +1 -0
- package/packages/agent/src/api/memory-routes.js +420 -0
- package/packages/agent/src/api/merkle-tree.d.ts +90 -0
- package/packages/agent/src/api/merkle-tree.d.ts.map +1 -0
- package/packages/agent/src/api/merkle-tree.js +174 -0
- package/packages/agent/src/api/misc-routes.d.ts +64 -0
- package/packages/agent/src/api/misc-routes.d.ts.map +1 -0
- package/packages/agent/src/api/misc-routes.js +557 -0
- package/packages/agent/src/api/model-provider-helpers.d.ts +84 -0
- package/packages/agent/src/api/model-provider-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/model-provider-helpers.js +588 -0
- package/packages/agent/src/api/models-routes.d.ts +14 -0
- package/packages/agent/src/api/models-routes.d.ts.map +1 -0
- package/packages/agent/src/api/models-routes.js +37 -0
- package/packages/agent/src/api/music-player-route-fallback.d.ts +16 -0
- package/packages/agent/src/api/music-player-route-fallback.d.ts.map +1 -0
- package/packages/agent/src/api/music-player-route-fallback.js +65 -0
- package/packages/agent/src/api/nfa-routes.d.ts +5 -0
- package/packages/agent/src/api/nfa-routes.d.ts.map +1 -0
- package/packages/agent/src/api/nfa-routes.js +133 -0
- package/packages/agent/src/api/nft-verify.d.ts +16 -0
- package/packages/agent/src/api/nft-verify.d.ts.map +1 -0
- package/packages/agent/src/api/nft-verify.js +81 -0
- package/packages/agent/src/api/og-tracker.d.ts +28 -0
- package/packages/agent/src/api/og-tracker.d.ts.map +1 -0
- package/packages/agent/src/api/og-tracker.js +60 -0
- package/packages/agent/src/api/onboarding-routes.d.ts +50 -0
- package/packages/agent/src/api/onboarding-routes.d.ts.map +1 -0
- package/packages/agent/src/api/onboarding-routes.js +561 -0
- package/packages/agent/src/api/owner-contact-helpers.d.ts +39 -0
- package/packages/agent/src/api/owner-contact-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/owner-contact-helpers.js +47 -0
- package/packages/agent/src/api/parse-action-block.d.ts +35 -0
- package/packages/agent/src/api/parse-action-block.d.ts.map +1 -0
- package/packages/agent/src/api/parse-action-block.js +110 -0
- package/packages/agent/src/api/permissions-routes-extra.d.ts +30 -0
- package/packages/agent/src/api/permissions-routes-extra.d.ts.map +1 -0
- package/packages/agent/src/api/permissions-routes-extra.js +78 -0
- package/packages/agent/src/api/permissions-routes.d.ts +28 -0
- package/packages/agent/src/api/permissions-routes.d.ts.map +1 -0
- package/packages/agent/src/api/permissions-routes.js +180 -0
- package/packages/agent/src/api/plugin-discovery-helpers.d.ts +147 -0
- package/packages/agent/src/api/plugin-discovery-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/plugin-discovery-helpers.js +1015 -0
- package/packages/agent/src/api/plugin-routes.d.ts +127 -0
- package/packages/agent/src/api/plugin-routes.d.ts.map +1 -0
- package/packages/agent/src/api/plugin-routes.js +1140 -0
- package/packages/agent/src/api/plugin-runtime-apply.d.ts +31 -0
- package/packages/agent/src/api/plugin-runtime-apply.d.ts.map +1 -0
- package/packages/agent/src/api/plugin-runtime-apply.js +217 -0
- package/packages/agent/src/api/plugin-validation.d.ts +86 -0
- package/packages/agent/src/api/plugin-validation.d.ts.map +1 -0
- package/packages/agent/src/api/plugin-validation.js +259 -0
- package/packages/agent/src/api/provider-switch-config.d.ts +60 -0
- package/packages/agent/src/api/provider-switch-config.d.ts.map +1 -0
- package/packages/agent/src/api/provider-switch-config.js +718 -0
- package/packages/agent/src/api/provider-switch-routes.d.ts +22 -0
- package/packages/agent/src/api/provider-switch-routes.d.ts.map +1 -0
- package/packages/agent/src/api/provider-switch-routes.js +92 -0
- package/packages/agent/src/api/rate-limiter.d.ts +29 -0
- package/packages/agent/src/api/rate-limiter.d.ts.map +1 -0
- package/packages/agent/src/api/rate-limiter.js +54 -0
- package/packages/agent/src/api/registry-routes.d.ts +29 -0
- package/packages/agent/src/api/registry-routes.d.ts.map +1 -0
- package/packages/agent/src/api/registry-routes.js +98 -0
- package/packages/agent/src/api/registry-service.d.ts +77 -0
- package/packages/agent/src/api/registry-service.d.ts.map +1 -0
- package/packages/agent/src/api/registry-service.js +190 -0
- package/packages/agent/src/api/relationships-routes.d.ts +7 -0
- package/packages/agent/src/api/relationships-routes.d.ts.map +1 -0
- package/packages/agent/src/api/relationships-routes.js +181 -0
- package/packages/agent/src/api/route-helpers.d.ts +16 -0
- package/packages/agent/src/api/route-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/route-helpers.js +1 -0
- package/packages/agent/src/api/runtime-plugin-routes.d.ts +21 -0
- package/packages/agent/src/api/runtime-plugin-routes.d.ts.map +1 -0
- package/packages/agent/src/api/runtime-plugin-routes.js +132 -0
- package/packages/agent/src/api/sandbox-routes.d.ts +12 -0
- package/packages/agent/src/api/sandbox-routes.d.ts.map +1 -0
- package/packages/agent/src/api/sandbox-routes.js +1334 -0
- package/packages/agent/src/api/server-auth.d.ts +52 -0
- package/packages/agent/src/api/server-auth.d.ts.map +1 -0
- package/packages/agent/src/api/server-auth.js +332 -0
- package/packages/agent/src/api/server-helpers.d.ts +95 -0
- package/packages/agent/src/api/server-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/server-helpers.js +708 -0
- package/packages/agent/src/api/server-startup.d.ts +16 -0
- package/packages/agent/src/api/server-startup.d.ts.map +1 -0
- package/packages/agent/src/api/server-startup.js +14 -0
- package/packages/agent/src/api/server-types.d.ts +216 -0
- package/packages/agent/src/api/server-types.d.ts.map +1 -0
- package/packages/agent/src/api/server-types.js +6 -0
- package/packages/agent/src/api/server.d.ts +144 -0
- package/packages/agent/src/api/server.d.ts.map +1 -0
- package/packages/agent/src/api/server.js +5304 -0
- package/packages/agent/src/api/signal-routes.d.ts +42 -0
- package/packages/agent/src/api/signal-routes.d.ts.map +1 -0
- package/packages/agent/src/api/signal-routes.js +232 -0
- package/packages/agent/src/api/skill-discovery-helpers.d.ts +80 -0
- package/packages/agent/src/api/skill-discovery-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/skill-discovery-helpers.js +381 -0
- package/packages/agent/src/api/skills-routes.d.ts +32 -0
- package/packages/agent/src/api/skills-routes.d.ts.map +1 -0
- package/packages/agent/src/api/skills-routes.js +947 -0
- package/packages/agent/src/api/static-file-server.d.ts +19 -0
- package/packages/agent/src/api/static-file-server.d.ts.map +1 -0
- package/packages/agent/src/api/static-file-server.js +233 -0
- package/packages/agent/src/api/stream-persistence.d.ts +64 -0
- package/packages/agent/src/api/stream-persistence.d.ts.map +1 -0
- package/packages/agent/src/api/stream-persistence.js +231 -0
- package/packages/agent/src/api/stream-route-state.d.ts +56 -0
- package/packages/agent/src/api/stream-route-state.d.ts.map +1 -0
- package/packages/agent/src/api/stream-route-state.js +1 -0
- package/packages/agent/src/api/stream-routes.d.ts +43 -0
- package/packages/agent/src/api/stream-routes.d.ts.map +1 -0
- package/packages/agent/src/api/stream-routes.js +728 -0
- package/packages/agent/src/api/streaming-text.d.ts +9 -0
- package/packages/agent/src/api/streaming-text.d.ts.map +1 -0
- package/packages/agent/src/api/streaming-text.js +85 -0
- package/packages/agent/src/api/streaming-types.d.ts +30 -0
- package/packages/agent/src/api/streaming-types.d.ts.map +1 -0
- package/packages/agent/src/api/streaming-types.js +1 -0
- package/packages/agent/src/api/subscription-routes.d.ts +20 -0
- package/packages/agent/src/api/subscription-routes.d.ts.map +1 -0
- package/packages/agent/src/api/subscription-routes.js +213 -0
- package/packages/agent/src/api/task-agent-message-routing.d.ts +2 -0
- package/packages/agent/src/api/task-agent-message-routing.d.ts.map +1 -0
- package/packages/agent/src/api/task-agent-message-routing.js +1 -0
- package/packages/agent/src/api/telegram-account-routes.d.ts +26 -0
- package/packages/agent/src/api/telegram-account-routes.d.ts.map +1 -0
- package/packages/agent/src/api/telegram-account-routes.js +229 -0
- package/packages/agent/src/api/telegram-setup-routes.d.ts +27 -0
- package/packages/agent/src/api/telegram-setup-routes.d.ts.map +1 -0
- package/packages/agent/src/api/telegram-setup-routes.js +125 -0
- package/packages/agent/src/api/terminal-run-limits.d.ts +5 -0
- package/packages/agent/src/api/terminal-run-limits.d.ts.map +1 -0
- package/packages/agent/src/api/terminal-run-limits.js +22 -0
- package/packages/agent/src/api/trade-safety.d.ts +39 -0
- package/packages/agent/src/api/trade-safety.d.ts.map +1 -0
- package/packages/agent/src/api/trade-safety.js +66 -0
- package/packages/agent/src/api/training-backend-check.d.ts +2 -0
- package/packages/agent/src/api/training-backend-check.d.ts.map +1 -0
- package/packages/agent/src/api/training-backend-check.js +2 -0
- package/packages/agent/src/api/training-routes.d.ts +2 -0
- package/packages/agent/src/api/training-routes.d.ts.map +1 -0
- package/packages/agent/src/api/training-routes.js +2 -0
- package/packages/agent/src/api/training-service-like.d.ts +2 -0
- package/packages/agent/src/api/training-service-like.d.ts.map +1 -0
- package/packages/agent/src/api/training-service-like.js +1 -0
- package/packages/agent/src/api/trajectory-routes.d.ts +3 -0
- package/packages/agent/src/api/trajectory-routes.d.ts.map +1 -0
- package/packages/agent/src/api/trajectory-routes.js +2 -0
- package/packages/agent/src/api/trigger-routes.d.ts +73 -0
- package/packages/agent/src/api/trigger-routes.d.ts.map +1 -0
- package/packages/agent/src/api/trigger-routes.js +308 -0
- package/packages/agent/src/api/tts-routes.d.ts +24 -0
- package/packages/agent/src/api/tts-routes.d.ts.map +1 -0
- package/packages/agent/src/api/tts-routes.js +200 -0
- package/packages/agent/src/api/twitter-verify.d.ts +25 -0
- package/packages/agent/src/api/twitter-verify.d.ts.map +1 -0
- package/packages/agent/src/api/twitter-verify.js +168 -0
- package/packages/agent/src/api/tx-service.d.ts +51 -0
- package/packages/agent/src/api/tx-service.d.ts.map +1 -0
- package/packages/agent/src/api/tx-service.js +160 -0
- package/packages/agent/src/api/update-routes.d.ts +19 -0
- package/packages/agent/src/api/update-routes.d.ts.map +1 -0
- package/packages/agent/src/api/update-routes.js +54 -0
- package/packages/agent/src/api/wallet-bsc-routes.d.ts +67 -0
- package/packages/agent/src/api/wallet-bsc-routes.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-bsc-routes.js +322 -0
- package/packages/agent/src/api/wallet-capability.d.ts +33 -0
- package/packages/agent/src/api/wallet-capability.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-capability.js +124 -0
- package/packages/agent/src/api/wallet-dex-prices.d.ts +43 -0
- package/packages/agent/src/api/wallet-dex-prices.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-dex-prices.js +153 -0
- package/packages/agent/src/api/wallet-env-sync.d.ts +2 -0
- package/packages/agent/src/api/wallet-env-sync.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-env-sync.js +104 -0
- package/packages/agent/src/api/wallet-evm-balance.d.ts +66 -0
- package/packages/agent/src/api/wallet-evm-balance.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-evm-balance.js +667 -0
- package/packages/agent/src/api/wallet-routes.d.ts +55 -0
- package/packages/agent/src/api/wallet-routes.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-routes.js +833 -0
- package/packages/agent/src/api/wallet-rpc.d.ts +78 -0
- package/packages/agent/src/api/wallet-rpc.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-rpc.js +476 -0
- package/packages/agent/src/api/wallet-trade-routes.d.ts +110 -0
- package/packages/agent/src/api/wallet-trade-routes.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-trade-routes.js +353 -0
- package/packages/agent/src/api/wallet-trading-profile.d.ts +56 -0
- package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -0
- package/packages/agent/src/api/wallet-trading-profile.js +565 -0
- package/packages/agent/src/api/wallet.d.ts +64 -0
- package/packages/agent/src/api/wallet.d.ts.map +1 -0
- package/packages/agent/src/api/wallet.js +674 -0
- package/packages/agent/src/api/website-blocker-routes.d.ts +2 -0
- package/packages/agent/src/api/website-blocker-routes.d.ts.map +1 -0
- package/packages/agent/src/api/website-blocker-routes.js +1 -0
- package/packages/agent/src/api/whatsapp-routes.d.ts +39 -0
- package/packages/agent/src/api/whatsapp-routes.d.ts.map +1 -0
- package/packages/agent/src/api/whatsapp-routes.js +226 -0
- package/packages/agent/src/api/workbench-helpers.d.ts +39 -0
- package/packages/agent/src/api/workbench-helpers.d.ts.map +1 -0
- package/packages/agent/src/api/workbench-helpers.js +133 -0
- package/packages/agent/src/api/workbench-routes.d.ts +53 -0
- package/packages/agent/src/api/workbench-routes.d.ts.map +1 -0
- package/packages/agent/src/api/workbench-routes.js +405 -0
- package/packages/agent/src/api/zip-utils.d.ts +8 -0
- package/packages/agent/src/api/zip-utils.d.ts.map +1 -0
- package/packages/agent/src/api/zip-utils.js +115 -0
- package/packages/agent/src/auth/anthropic.d.ts +29 -0
- package/packages/agent/src/auth/anthropic.d.ts.map +1 -0
- package/packages/agent/src/auth/anthropic.js +43 -0
- package/packages/agent/src/auth/claude-code-stealth.d.ts +2 -0
- package/packages/agent/src/auth/claude-code-stealth.d.ts.map +1 -0
- package/packages/agent/src/auth/claude-code-stealth.js +114 -0
- package/packages/agent/src/auth/credentials.d.ts +74 -0
- package/packages/agent/src/auth/credentials.d.ts.map +1 -0
- package/packages/agent/src/auth/credentials.js +379 -0
- package/packages/agent/src/auth/index.d.ts +6 -0
- package/packages/agent/src/auth/index.d.ts.map +1 -0
- package/packages/agent/src/auth/index.js +5 -0
- package/packages/agent/src/auth/openai-codex.d.ts +32 -0
- package/packages/agent/src/auth/openai-codex.d.ts.map +1 -0
- package/packages/agent/src/auth/openai-codex.js +81 -0
- package/packages/agent/src/auth/types.d.ts +18 -0
- package/packages/agent/src/auth/types.d.ts.map +1 -0
- package/packages/agent/src/auth/types.js +8 -0
- package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.d.ts +16 -0
- package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.d.ts.map +1 -0
- package/packages/agent/src/auth/vendor/pi-oauth/anthropic-login.js +78 -0
- package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.d.ts +26 -0
- package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.d.ts.map +1 -0
- package/packages/agent/src/auth/vendor/pi-oauth/openai-codex-login.js +342 -0
- package/packages/agent/src/auth/vendor/pi-oauth/pkce.d.ts +9 -0
- package/packages/agent/src/auth/vendor/pi-oauth/pkce.d.ts.map +1 -0
- package/packages/agent/src/auth/vendor/pi-oauth/pkce.js +21 -0
- package/packages/agent/src/autonomy/index.d.ts +48 -0
- package/packages/agent/src/autonomy/index.d.ts.map +1 -0
- package/packages/agent/src/autonomy/index.js +330 -0
- package/packages/agent/src/awareness/index.d.ts +2 -0
- package/packages/agent/src/awareness/index.d.ts.map +1 -0
- package/packages/agent/src/awareness/index.js +1 -0
- package/packages/agent/src/awareness/registry.d.ts +27 -0
- package/packages/agent/src/awareness/registry.d.ts.map +1 -0
- package/packages/agent/src/awareness/registry.js +161 -0
- package/packages/agent/src/bin.d.ts +3 -0
- package/packages/agent/src/bin.d.ts.map +1 -0
- package/packages/agent/src/bin.js +6 -0
- package/packages/agent/src/cli/benchmark.d.ts +10 -0
- package/packages/agent/src/cli/benchmark.d.ts.map +1 -0
- package/packages/agent/src/cli/benchmark.js +293 -0
- package/packages/agent/src/cli/index.d.ts +2 -0
- package/packages/agent/src/cli/index.d.ts.map +1 -0
- package/packages/agent/src/cli/index.js +70 -0
- package/packages/agent/src/cli/parse-duration.d.ts +5 -0
- package/packages/agent/src/cli/parse-duration.d.ts.map +1 -0
- package/packages/agent/src/cli/parse-duration.js +27 -0
- package/packages/agent/src/cloud/auth.d.ts +19 -0
- package/packages/agent/src/cloud/auth.d.ts.map +1 -0
- package/packages/agent/src/cloud/auth.js +110 -0
- package/packages/agent/src/cloud/backup.d.ts +18 -0
- package/packages/agent/src/cloud/backup.d.ts.map +1 -0
- package/packages/agent/src/cloud/backup.js +42 -0
- package/packages/agent/src/cloud/base-url.d.ts +3 -0
- package/packages/agent/src/cloud/base-url.d.ts.map +1 -0
- package/packages/agent/src/cloud/base-url.js +52 -0
- package/packages/agent/src/cloud/bridge-client.d.ts +126 -0
- package/packages/agent/src/cloud/bridge-client.d.ts.map +1 -0
- package/packages/agent/src/cloud/bridge-client.js +380 -0
- package/packages/agent/src/cloud/cloud-manager.d.ts +32 -0
- package/packages/agent/src/cloud/cloud-manager.d.ts.map +1 -0
- package/packages/agent/src/cloud/cloud-manager.js +121 -0
- package/packages/agent/src/cloud/cloud-proxy.d.ts +20 -0
- package/packages/agent/src/cloud/cloud-proxy.d.ts.map +1 -0
- package/packages/agent/src/cloud/cloud-proxy.js +34 -0
- package/packages/agent/src/cloud/cloud-wallet.d.ts +94 -0
- package/packages/agent/src/cloud/cloud-wallet.d.ts.map +1 -0
- package/packages/agent/src/cloud/cloud-wallet.js +199 -0
- package/packages/agent/src/cloud/index.d.ts +7 -0
- package/packages/agent/src/cloud/index.d.ts.map +1 -0
- package/packages/agent/src/cloud/index.js +6 -0
- package/packages/agent/src/cloud/reconnect.d.ts +26 -0
- package/packages/agent/src/cloud/reconnect.d.ts.map +1 -0
- package/packages/agent/src/cloud/reconnect.js +89 -0
- package/packages/agent/src/cloud/validate-url.d.ts +2 -0
- package/packages/agent/src/cloud/validate-url.d.ts.map +1 -0
- package/packages/agent/src/cloud/validate-url.js +162 -0
- package/packages/agent/src/config/character-schema.d.ts +25 -0
- package/packages/agent/src/config/character-schema.d.ts.map +1 -0
- package/packages/agent/src/config/character-schema.js +39 -0
- package/packages/agent/src/config/config.d.ts +6 -0
- package/packages/agent/src/config/config.d.ts.map +1 -0
- package/packages/agent/src/config/config.js +277 -0
- package/packages/agent/src/config/env-vars.d.ts +9 -0
- package/packages/agent/src/config/env-vars.d.ts.map +1 -0
- package/packages/agent/src/config/env-vars.js +282 -0
- package/packages/agent/src/config/feature-flags.d.ts +17 -0
- package/packages/agent/src/config/feature-flags.d.ts.map +1 -0
- package/packages/agent/src/config/feature-flags.js +37 -0
- package/packages/agent/src/config/includes.d.ts +26 -0
- package/packages/agent/src/config/includes.d.ts.map +1 -0
- package/packages/agent/src/config/includes.js +148 -0
- package/packages/agent/src/config/index.d.ts +19 -0
- package/packages/agent/src/config/index.d.ts.map +1 -0
- package/packages/agent/src/config/index.js +18 -0
- package/packages/agent/src/config/object-utils.d.ts +2 -0
- package/packages/agent/src/config/object-utils.d.ts.map +1 -0
- package/packages/agent/src/config/object-utils.js +6 -0
- package/packages/agent/src/config/owner-contacts.d.ts +42 -0
- package/packages/agent/src/config/owner-contacts.d.ts.map +1 -0
- package/packages/agent/src/config/owner-contacts.js +223 -0
- package/packages/agent/src/config/paths.d.ts +13 -0
- package/packages/agent/src/config/paths.d.ts.map +1 -0
- package/packages/agent/src/config/paths.js +106 -0
- package/packages/agent/src/config/plugin-auto-enable.d.ts +36 -0
- package/packages/agent/src/config/plugin-auto-enable.d.ts.map +1 -0
- package/packages/agent/src/config/plugin-auto-enable.js +519 -0
- package/packages/agent/src/config/plugin-widgets.d.ts +29 -0
- package/packages/agent/src/config/plugin-widgets.d.ts.map +1 -0
- package/packages/agent/src/config/plugin-widgets.js +70 -0
- package/packages/agent/src/config/runtime-env.d.ts +2 -0
- package/packages/agent/src/config/runtime-env.d.ts.map +1 -0
- package/packages/agent/src/config/runtime-env.js +1 -0
- package/packages/agent/src/config/schema.d.ts +87 -0
- package/packages/agent/src/config/schema.d.ts.map +1 -0
- package/packages/agent/src/config/schema.js +922 -0
- package/packages/agent/src/config/telegram-custom-commands.d.ts +25 -0
- package/packages/agent/src/config/telegram-custom-commands.d.ts.map +1 -0
- package/packages/agent/src/config/telegram-custom-commands.js +71 -0
- package/packages/agent/src/config/types.agent-defaults.d.ts +362 -0
- package/packages/agent/src/config/types.agent-defaults.d.ts.map +1 -0
- package/packages/agent/src/config/types.agent-defaults.js +1 -0
- package/packages/agent/src/config/types.agents.d.ts +114 -0
- package/packages/agent/src/config/types.agents.d.ts.map +1 -0
- package/packages/agent/src/config/types.agents.js +1 -0
- package/packages/agent/src/config/types.d.ts +8 -0
- package/packages/agent/src/config/types.d.ts.map +1 -0
- package/packages/agent/src/config/types.eliza.d.ts +670 -0
- package/packages/agent/src/config/types.eliza.d.ts.map +1 -0
- package/packages/agent/src/config/types.eliza.js +1 -0
- package/packages/agent/src/config/types.gateway.d.ts +216 -0
- package/packages/agent/src/config/types.gateway.d.ts.map +1 -0
- package/packages/agent/src/config/types.gateway.js +1 -0
- package/packages/agent/src/config/types.hooks.d.ts +107 -0
- package/packages/agent/src/config/types.hooks.d.ts.map +1 -0
- package/packages/agent/src/config/types.hooks.js +1 -0
- package/packages/agent/src/config/types.js +7 -0
- package/packages/agent/src/config/types.messages.d.ts +176 -0
- package/packages/agent/src/config/types.messages.d.ts.map +1 -0
- package/packages/agent/src/config/types.messages.js +1 -0
- package/packages/agent/src/config/types.tools.d.ts +400 -0
- package/packages/agent/src/config/types.tools.d.ts.map +1 -0
- package/packages/agent/src/config/types.tools.js +1 -0
- package/packages/agent/src/config/zod-schema.agent-runtime.d.ts +1137 -0
- package/packages/agent/src/config/zod-schema.agent-runtime.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.agent-runtime.js +782 -0
- package/packages/agent/src/config/zod-schema.core.d.ts +1021 -0
- package/packages/agent/src/config/zod-schema.core.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.core.js +694 -0
- package/packages/agent/src/config/zod-schema.d.ts +3185 -0
- package/packages/agent/src/config/zod-schema.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.hooks.d.ts +88 -0
- package/packages/agent/src/config/zod-schema.hooks.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.hooks.js +133 -0
- package/packages/agent/src/config/zod-schema.js +850 -0
- package/packages/agent/src/config/zod-schema.providers-core.d.ts +2746 -0
- package/packages/agent/src/config/zod-schema.providers-core.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.providers-core.js +961 -0
- package/packages/agent/src/config/zod-schema.session.d.ts +183 -0
- package/packages/agent/src/config/zod-schema.session.d.ts.map +1 -0
- package/packages/agent/src/config/zod-schema.session.js +86 -0
- package/packages/agent/src/contracts/apps.d.ts +2 -0
- package/packages/agent/src/contracts/apps.d.ts.map +1 -0
- package/packages/agent/src/contracts/apps.js +1 -0
- package/packages/agent/src/contracts/awareness.d.ts +38 -0
- package/packages/agent/src/contracts/awareness.d.ts.map +1 -0
- package/packages/agent/src/contracts/awareness.js +7 -0
- package/packages/agent/src/contracts/config.d.ts +148 -0
- package/packages/agent/src/contracts/config.d.ts.map +1 -0
- package/packages/agent/src/contracts/config.js +4 -0
- package/packages/agent/src/contracts/drop.d.ts +2 -0
- package/packages/agent/src/contracts/drop.d.ts.map +1 -0
- package/packages/agent/src/contracts/drop.js +1 -0
- package/packages/agent/src/contracts/index.d.ts +11 -0
- package/packages/agent/src/contracts/index.d.ts.map +1 -0
- package/packages/agent/src/contracts/index.js +10 -0
- package/packages/agent/src/contracts/lifeops.d.ts +2 -0
- package/packages/agent/src/contracts/lifeops.d.ts.map +1 -0
- package/packages/agent/src/contracts/lifeops.js +1 -0
- package/packages/agent/src/contracts/onboarding.d.ts +2 -0
- package/packages/agent/src/contracts/onboarding.d.ts.map +1 -0
- package/packages/agent/src/contracts/onboarding.js +1 -0
- package/packages/agent/src/contracts/permissions.d.ts +2 -0
- package/packages/agent/src/contracts/permissions.d.ts.map +1 -0
- package/packages/agent/src/contracts/permissions.js +1 -0
- package/packages/agent/src/contracts/service-routing.d.ts +2 -0
- package/packages/agent/src/contracts/service-routing.d.ts.map +1 -0
- package/packages/agent/src/contracts/service-routing.js +1 -0
- package/packages/agent/src/contracts/verification.d.ts +2 -0
- package/packages/agent/src/contracts/verification.d.ts.map +1 -0
- package/packages/agent/src/contracts/verification.js +1 -0
- package/packages/agent/src/contracts/wallet.d.ts +2 -0
- package/packages/agent/src/contracts/wallet.d.ts.map +1 -0
- package/packages/agent/src/contracts/wallet.js +1 -0
- package/packages/agent/src/diagnostics/index.d.ts +2 -0
- package/packages/agent/src/diagnostics/index.d.ts.map +1 -0
- package/packages/agent/src/diagnostics/index.js +1 -0
- package/packages/agent/src/diagnostics/integration-observability.d.ts +40 -0
- package/packages/agent/src/diagnostics/integration-observability.d.ts.map +1 -0
- package/packages/agent/src/diagnostics/integration-observability.js +75 -0
- package/packages/agent/src/evals/coordinator-eval-client.d.ts +2 -0
- package/packages/agent/src/evals/coordinator-eval-client.d.ts.map +1 -0
- package/packages/agent/src/evals/coordinator-eval-client.js +1 -0
- package/packages/agent/src/evals/coordinator-live-runner.d.ts +2 -0
- package/packages/agent/src/evals/coordinator-live-runner.d.ts.map +1 -0
- package/packages/agent/src/evals/coordinator-live-runner.js +1 -0
- package/packages/agent/src/evals/coordinator-preflight.d.ts +2 -0
- package/packages/agent/src/evals/coordinator-preflight.d.ts.map +1 -0
- package/packages/agent/src/evals/coordinator-preflight.js +1 -0
- package/packages/agent/src/evals/coordinator-scenarios.d.ts +2 -0
- package/packages/agent/src/evals/coordinator-scenarios.d.ts.map +1 -0
- package/packages/agent/src/evals/coordinator-scenarios.js +1 -0
- package/packages/agent/src/evaluators/late-join-whitelist.d.ts +16 -0
- package/packages/agent/src/evaluators/late-join-whitelist.d.ts.map +1 -0
- package/packages/agent/src/evaluators/late-join-whitelist.js +67 -0
- package/packages/agent/src/hooks/discovery.d.ts +13 -0
- package/packages/agent/src/hooks/discovery.d.ts.map +1 -0
- package/packages/agent/src/hooks/discovery.js +191 -0
- package/packages/agent/src/hooks/eligibility.d.ts +12 -0
- package/packages/agent/src/hooks/eligibility.d.ts.map +1 -0
- package/packages/agent/src/hooks/eligibility.js +105 -0
- package/packages/agent/src/hooks/index.d.ts +3 -0
- package/packages/agent/src/hooks/index.d.ts.map +1 -0
- package/packages/agent/src/hooks/index.js +2 -0
- package/packages/agent/src/hooks/loader.d.ts +34 -0
- package/packages/agent/src/hooks/loader.d.ts.map +1 -0
- package/packages/agent/src/hooks/loader.js +214 -0
- package/packages/agent/src/hooks/registry.d.ts +11 -0
- package/packages/agent/src/hooks/registry.d.ts.map +1 -0
- package/packages/agent/src/hooks/registry.js +58 -0
- package/packages/agent/src/hooks/types.d.ts +104 -0
- package/packages/agent/src/hooks/types.d.ts.map +1 -0
- package/packages/agent/src/hooks/types.js +8 -0
- package/packages/agent/src/index.d.ts +22 -0
- package/packages/agent/src/index.d.ts.map +1 -0
- package/packages/agent/src/index.js +20 -0
- package/packages/agent/src/lifeops/app-state.d.ts +2 -0
- package/packages/agent/src/lifeops/app-state.d.ts.map +1 -0
- package/packages/agent/src/lifeops/app-state.js +1 -0
- package/packages/agent/src/lifeops/apple-reminders.d.ts +2 -0
- package/packages/agent/src/lifeops/apple-reminders.d.ts.map +1 -0
- package/packages/agent/src/lifeops/apple-reminders.js +1 -0
- package/packages/agent/src/lifeops/defaults.d.ts +2 -0
- package/packages/agent/src/lifeops/defaults.d.ts.map +1 -0
- package/packages/agent/src/lifeops/defaults.js +1 -0
- package/packages/agent/src/lifeops/engine.d.ts +2 -0
- package/packages/agent/src/lifeops/engine.d.ts.map +1 -0
- package/packages/agent/src/lifeops/engine.js +1 -0
- package/packages/agent/src/lifeops/goal-grounding.d.ts +2 -0
- package/packages/agent/src/lifeops/goal-grounding.d.ts.map +1 -0
- package/packages/agent/src/lifeops/goal-grounding.js +1 -0
- package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts +2 -0
- package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts.map +1 -0
- package/packages/agent/src/lifeops/goal-semantic-evaluator.js +1 -0
- package/packages/agent/src/lifeops/google-api-error.d.ts +2 -0
- package/packages/agent/src/lifeops/google-api-error.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-api-error.js +1 -0
- package/packages/agent/src/lifeops/google-calendar.d.ts +2 -0
- package/packages/agent/src/lifeops/google-calendar.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-calendar.js +1 -0
- package/packages/agent/src/lifeops/google-connector-gateway.d.ts +2 -0
- package/packages/agent/src/lifeops/google-connector-gateway.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-connector-gateway.js +1 -0
- package/packages/agent/src/lifeops/google-fetch.d.ts +2 -0
- package/packages/agent/src/lifeops/google-fetch.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-fetch.js +1 -0
- package/packages/agent/src/lifeops/google-gmail.d.ts +2 -0
- package/packages/agent/src/lifeops/google-gmail.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-gmail.js +1 -0
- package/packages/agent/src/lifeops/google-managed-client.d.ts +2 -0
- package/packages/agent/src/lifeops/google-managed-client.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-managed-client.js +1 -0
- package/packages/agent/src/lifeops/google-oauth.d.ts +2 -0
- package/packages/agent/src/lifeops/google-oauth.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-oauth.js +1 -0
- package/packages/agent/src/lifeops/google-scopes.d.ts +2 -0
- package/packages/agent/src/lifeops/google-scopes.d.ts.map +1 -0
- package/packages/agent/src/lifeops/google-scopes.js +1 -0
- package/packages/agent/src/lifeops/index.d.ts +2 -0
- package/packages/agent/src/lifeops/index.d.ts.map +1 -0
- package/packages/agent/src/lifeops/index.js +1 -0
- package/packages/agent/src/lifeops/owner-profile.d.ts +2 -0
- package/packages/agent/src/lifeops/owner-profile.d.ts.map +1 -0
- package/packages/agent/src/lifeops/owner-profile.js +1 -0
- package/packages/agent/src/lifeops/repository.d.ts +2 -0
- package/packages/agent/src/lifeops/repository.d.ts.map +1 -0
- package/packages/agent/src/lifeops/repository.js +1 -0
- package/packages/agent/src/lifeops/runtime.d.ts +2 -0
- package/packages/agent/src/lifeops/runtime.d.ts.map +1 -0
- package/packages/agent/src/lifeops/runtime.js +1 -0
- package/packages/agent/src/lifeops/screen-context.d.ts +2 -0
- package/packages/agent/src/lifeops/screen-context.d.ts.map +1 -0
- package/packages/agent/src/lifeops/screen-context.js +1 -0
- package/packages/agent/src/lifeops/seed-routines.d.ts +2 -0
- package/packages/agent/src/lifeops/seed-routines.d.ts.map +1 -0
- package/packages/agent/src/lifeops/seed-routines.js +1 -0
- package/packages/agent/src/lifeops/service.d.ts +2 -0
- package/packages/agent/src/lifeops/service.d.ts.map +1 -0
- package/packages/agent/src/lifeops/service.js +1 -0
- package/packages/agent/src/lifeops/sql.d.ts +2 -0
- package/packages/agent/src/lifeops/sql.d.ts.map +1 -0
- package/packages/agent/src/lifeops/sql.js +1 -0
- package/packages/agent/src/lifeops/time.d.ts +2 -0
- package/packages/agent/src/lifeops/time.d.ts.map +1 -0
- package/packages/agent/src/lifeops/time.js +1 -0
- package/packages/agent/src/lifeops/twilio.d.ts +2 -0
- package/packages/agent/src/lifeops/twilio.d.ts.map +1 -0
- package/packages/agent/src/lifeops/twilio.js +1 -0
- package/packages/agent/src/lifeops/x-poster.d.ts +2 -0
- package/packages/agent/src/lifeops/x-poster.d.ts.map +1 -0
- package/packages/agent/src/lifeops/x-poster.js +1 -0
- package/packages/agent/src/onboarding-presets.d.ts +2 -0
- package/packages/agent/src/onboarding-presets.d.ts.map +1 -0
- package/packages/agent/src/onboarding-presets.js +1 -0
- package/packages/agent/src/plugins/custom-rtmp/index.d.ts +12 -0
- package/packages/agent/src/plugins/custom-rtmp/index.d.ts.map +1 -0
- package/packages/agent/src/plugins/custom-rtmp/index.js +26 -0
- package/packages/agent/src/plugins/discord-voice-capability.d.ts +35 -0
- package/packages/agent/src/plugins/discord-voice-capability.d.ts.map +1 -0
- package/packages/agent/src/plugins/discord-voice-capability.js +97 -0
- package/packages/agent/src/providers/activity-profile.d.ts +3 -0
- package/packages/agent/src/providers/activity-profile.d.ts.map +1 -0
- package/packages/agent/src/providers/activity-profile.js +140 -0
- package/packages/agent/src/providers/admin-panel.d.ts +4 -0
- package/packages/agent/src/providers/admin-panel.d.ts.map +1 -0
- package/packages/agent/src/providers/admin-panel.js +83 -0
- package/packages/agent/src/providers/admin-trust.d.ts +4 -0
- package/packages/agent/src/providers/admin-trust.d.ts.map +1 -0
- package/packages/agent/src/providers/admin-trust.js +34 -0
- package/packages/agent/src/providers/conversation-utils.d.ts +11 -0
- package/packages/agent/src/providers/conversation-utils.d.ts.map +1 -0
- package/packages/agent/src/providers/conversation-utils.js +79 -0
- package/packages/agent/src/providers/escalation-trigger.d.ts +15 -0
- package/packages/agent/src/providers/escalation-trigger.d.ts.map +1 -0
- package/packages/agent/src/providers/escalation-trigger.js +165 -0
- package/packages/agent/src/providers/inbox-triage.d.ts +2 -0
- package/packages/agent/src/providers/inbox-triage.d.ts.map +1 -0
- package/packages/agent/src/providers/inbox-triage.js +1 -0
- package/packages/agent/src/providers/index.d.ts +18 -0
- package/packages/agent/src/providers/index.d.ts.map +1 -0
- package/packages/agent/src/providers/index.js +17 -0
- package/packages/agent/src/providers/lifeops.d.ts +2 -0
- package/packages/agent/src/providers/lifeops.d.ts.map +1 -0
- package/packages/agent/src/providers/lifeops.js +1 -0
- package/packages/agent/src/providers/local-models.d.ts +118 -0
- package/packages/agent/src/providers/local-models.d.ts.map +1 -0
- package/packages/agent/src/providers/local-models.js +427 -0
- package/packages/agent/src/providers/media-provider.d.ts +192 -0
- package/packages/agent/src/providers/media-provider.d.ts.map +1 -0
- package/packages/agent/src/providers/media-provider.js +1088 -0
- package/packages/agent/src/providers/recent-conversations.d.ts +3 -0
- package/packages/agent/src/providers/recent-conversations.d.ts.map +1 -0
- package/packages/agent/src/providers/recent-conversations.js +87 -0
- package/packages/agent/src/providers/relevant-conversations.d.ts +3 -0
- package/packages/agent/src/providers/relevant-conversations.d.ts.map +1 -0
- package/packages/agent/src/providers/relevant-conversations.js +88 -0
- package/packages/agent/src/providers/role-backfill.d.ts +18 -0
- package/packages/agent/src/providers/role-backfill.d.ts.map +1 -0
- package/packages/agent/src/providers/role-backfill.js +84 -0
- package/packages/agent/src/providers/rolodex.d.ts +3 -0
- package/packages/agent/src/providers/rolodex.d.ts.map +1 -0
- package/packages/agent/src/providers/rolodex.js +77 -0
- package/packages/agent/src/providers/self-status.d.ts +4 -0
- package/packages/agent/src/providers/self-status.d.ts.map +1 -0
- package/packages/agent/src/providers/self-status.js +12 -0
- package/packages/agent/src/providers/session-bridge.d.ts +24 -0
- package/packages/agent/src/providers/session-bridge.d.ts.map +1 -0
- package/packages/agent/src/providers/session-bridge.js +85 -0
- package/packages/agent/src/providers/session-utils.d.ts +20 -0
- package/packages/agent/src/providers/session-utils.d.ts.map +1 -0
- package/packages/agent/src/providers/session-utils.js +33 -0
- package/packages/agent/src/providers/simple-mode.d.ts +4 -0
- package/packages/agent/src/providers/simple-mode.d.ts.map +1 -0
- package/packages/agent/src/providers/simple-mode.js +85 -0
- package/packages/agent/src/providers/skill-provider.d.ts +16 -0
- package/packages/agent/src/providers/skill-provider.d.ts.map +1 -0
- package/packages/agent/src/providers/skill-provider.js +336 -0
- package/packages/agent/src/providers/tasks.d.ts +9 -0
- package/packages/agent/src/providers/tasks.d.ts.map +1 -0
- package/packages/agent/src/providers/tasks.js +113 -0
- package/packages/agent/src/providers/ui-catalog.d.ts +3 -0
- package/packages/agent/src/providers/ui-catalog.d.ts.map +1 -0
- package/packages/agent/src/providers/ui-catalog.js +95 -0
- package/packages/agent/src/providers/user-name.d.ts +11 -0
- package/packages/agent/src/providers/user-name.d.ts.map +1 -0
- package/packages/agent/src/providers/user-name.js +40 -0
- package/packages/agent/src/providers/workspace-provider.d.ts +22 -0
- package/packages/agent/src/providers/workspace-provider.d.ts.map +1 -0
- package/packages/agent/src/providers/workspace-provider.js +177 -0
- package/packages/agent/src/providers/workspace.d.ts +54 -0
- package/packages/agent/src/providers/workspace.d.ts.map +1 -0
- package/packages/agent/src/providers/workspace.js +481 -0
- package/packages/agent/src/runtime/agent-event-service.d.ts +35 -0
- package/packages/agent/src/runtime/agent-event-service.d.ts.map +1 -0
- package/packages/agent/src/runtime/agent-event-service.js +16 -0
- package/packages/agent/src/runtime/cloud-onboarding.d.ts +35 -0
- package/packages/agent/src/runtime/cloud-onboarding.d.ts.map +1 -0
- package/packages/agent/src/runtime/cloud-onboarding.js +279 -0
- package/packages/agent/src/runtime/core-plugins.d.ts +19 -0
- package/packages/agent/src/runtime/core-plugins.d.ts.map +1 -0
- package/packages/agent/src/runtime/core-plugins.js +62 -0
- package/packages/agent/src/runtime/custom-actions.d.ts +43 -0
- package/packages/agent/src/runtime/custom-actions.d.ts.map +1 -0
- package/packages/agent/src/runtime/custom-actions.js +507 -0
- package/packages/agent/src/runtime/default-knowledge.d.ts +20 -0
- package/packages/agent/src/runtime/default-knowledge.d.ts.map +1 -0
- package/packages/agent/src/runtime/default-knowledge.js +256 -0
- package/packages/agent/src/runtime/discord-local-plugin.d.ts +86 -0
- package/packages/agent/src/runtime/discord-local-plugin.d.ts.map +1 -0
- package/packages/agent/src/runtime/discord-local-plugin.js +884 -0
- package/packages/agent/src/runtime/eliza-plugin.d.ts +16 -0
- package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -0
- package/packages/agent/src/runtime/eliza-plugin.js +212 -0
- package/packages/agent/src/runtime/eliza.d.ts +181 -0
- package/packages/agent/src/runtime/eliza.d.ts.map +1 -0
- package/packages/agent/src/runtime/eliza.js +3286 -0
- package/packages/agent/src/runtime/embedding-presets.d.ts +19 -0
- package/packages/agent/src/runtime/embedding-presets.d.ts.map +1 -0
- package/packages/agent/src/runtime/embedding-presets.js +60 -0
- package/packages/agent/src/runtime/first-time-setup.d.ts +25 -0
- package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -0
- package/packages/agent/src/runtime/first-time-setup.js +697 -0
- package/packages/agent/src/runtime/index.d.ts +13 -0
- package/packages/agent/src/runtime/index.d.ts.map +1 -0
- package/packages/agent/src/runtime/index.js +12 -0
- package/packages/agent/src/runtime/native-runtime-features.d.ts +4 -0
- package/packages/agent/src/runtime/native-runtime-features.d.ts.map +1 -0
- package/packages/agent/src/runtime/native-runtime-features.js +10 -0
- package/packages/agent/src/runtime/onboarding-names.d.ts +11 -0
- package/packages/agent/src/runtime/onboarding-names.d.ts.map +1 -0
- package/packages/agent/src/runtime/onboarding-names.js +74 -0
- package/packages/agent/src/runtime/owner-entity.d.ts +4 -0
- package/packages/agent/src/runtime/owner-entity.d.ts.map +1 -0
- package/packages/agent/src/runtime/owner-entity.js +30 -0
- package/packages/agent/src/runtime/pglite-error-compat.d.ts +28 -0
- package/packages/agent/src/runtime/pglite-error-compat.d.ts.map +1 -0
- package/packages/agent/src/runtime/pglite-error-compat.js +54 -0
- package/packages/agent/src/runtime/plugin-collector.d.ts +38 -0
- package/packages/agent/src/runtime/plugin-collector.d.ts.map +1 -0
- package/packages/agent/src/runtime/plugin-collector.js +397 -0
- package/packages/agent/src/runtime/plugin-lifecycle.d.ts +44 -0
- package/packages/agent/src/runtime/plugin-lifecycle.d.ts.map +1 -0
- package/packages/agent/src/runtime/plugin-lifecycle.js +574 -0
- package/packages/agent/src/runtime/plugin-resolver.d.ts +31 -0
- package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -0
- package/packages/agent/src/runtime/plugin-resolver.js +828 -0
- package/packages/agent/src/runtime/plugin-role-gating.d.ts +34 -0
- package/packages/agent/src/runtime/plugin-role-gating.d.ts.map +1 -0
- package/packages/agent/src/runtime/plugin-role-gating.js +232 -0
- package/packages/agent/src/runtime/plugin-types.d.ts +71 -0
- package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -0
- package/packages/agent/src/runtime/plugin-types.js +318 -0
- package/packages/agent/src/runtime/prompt-compaction.d.ts +80 -0
- package/packages/agent/src/runtime/prompt-compaction.d.ts.map +1 -0
- package/packages/agent/src/runtime/prompt-compaction.js +307 -0
- package/packages/agent/src/runtime/prompt-optimization.d.ts +11 -0
- package/packages/agent/src/runtime/prompt-optimization.d.ts.map +1 -0
- package/packages/agent/src/runtime/prompt-optimization.js +421 -0
- package/packages/agent/src/runtime/release-plugin-policy.d.ts +20 -0
- package/packages/agent/src/runtime/release-plugin-policy.d.ts.map +1 -0
- package/packages/agent/src/runtime/release-plugin-policy.js +85 -0
- package/packages/agent/src/runtime/restart.d.ts +45 -0
- package/packages/agent/src/runtime/restart.d.ts.map +1 -0
- package/packages/agent/src/runtime/restart.js +45 -0
- package/packages/agent/src/runtime/roles/src/action.d.ts +11 -0
- package/packages/agent/src/runtime/roles/src/action.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/action.js +676 -0
- package/packages/agent/src/runtime/roles/src/index.d.ts +24 -0
- package/packages/agent/src/runtime/roles/src/index.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/index.js +243 -0
- package/packages/agent/src/runtime/roles/src/intent.d.ts +18 -0
- package/packages/agent/src/runtime/roles/src/intent.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/intent.js +299 -0
- package/packages/agent/src/runtime/roles/src/provider.d.ts +7 -0
- package/packages/agent/src/runtime/roles/src/provider.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/provider.js +133 -0
- package/packages/agent/src/runtime/roles/src/types.d.ts +3 -0
- package/packages/agent/src/runtime/roles/src/types.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/types.js +1 -0
- package/packages/agent/src/runtime/roles/src/utils.d.ts +2 -0
- package/packages/agent/src/runtime/roles/src/utils.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles/src/utils.js +1 -0
- package/packages/agent/src/runtime/roles.d.ts +3 -0
- package/packages/agent/src/runtime/roles.d.ts.map +1 -0
- package/packages/agent/src/runtime/roles.js +5 -0
- package/packages/agent/src/runtime/trajectory-export.d.ts +8 -0
- package/packages/agent/src/runtime/trajectory-export.d.ts.map +1 -0
- package/packages/agent/src/runtime/trajectory-export.js +7 -0
- package/packages/agent/src/runtime/trajectory-internals.d.ts +217 -0
- package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -0
- package/packages/agent/src/runtime/trajectory-internals.js +1296 -0
- package/packages/agent/src/runtime/trajectory-persistence.d.ts +15 -0
- package/packages/agent/src/runtime/trajectory-persistence.d.ts.map +1 -0
- package/packages/agent/src/runtime/trajectory-persistence.js +29 -0
- package/packages/agent/src/runtime/trajectory-query.d.ts +8 -0
- package/packages/agent/src/runtime/trajectory-query.d.ts.map +1 -0
- package/packages/agent/src/runtime/trajectory-query.js +27 -0
- package/packages/agent/src/runtime/trajectory-storage.d.ts +65 -0
- package/packages/agent/src/runtime/trajectory-storage.d.ts.map +1 -0
- package/packages/agent/src/runtime/trajectory-storage.js +1026 -0
- package/packages/agent/src/runtime/version.d.ts +2 -0
- package/packages/agent/src/runtime/version.d.ts.map +1 -0
- package/packages/agent/src/runtime/version.js +5 -0
- package/packages/agent/src/runtime/web-search-tools.d.ts +22 -0
- package/packages/agent/src/runtime/web-search-tools.d.ts.map +1 -0
- package/packages/agent/src/runtime/web-search-tools.js +149 -0
- package/packages/agent/src/security/access.d.ts +17 -0
- package/packages/agent/src/security/access.d.ts.map +1 -0
- package/packages/agent/src/security/access.js +149 -0
- package/packages/agent/src/security/audit-log.d.ts +49 -0
- package/packages/agent/src/security/audit-log.d.ts.map +1 -0
- package/packages/agent/src/security/audit-log.js +161 -0
- package/packages/agent/src/security/index.d.ts +3 -0
- package/packages/agent/src/security/index.d.ts.map +1 -0
- package/packages/agent/src/security/index.js +2 -0
- package/packages/agent/src/security/network-policy.d.ts +6 -0
- package/packages/agent/src/security/network-policy.d.ts.map +1 -0
- package/packages/agent/src/security/network-policy.js +85 -0
- package/packages/agent/src/server/index.d.ts +3 -0
- package/packages/agent/src/server/index.d.ts.map +1 -0
- package/packages/agent/src/server/index.js +1 -0
- package/packages/agent/src/services/agent-export.d.ts +100 -0
- package/packages/agent/src/services/agent-export.d.ts.map +1 -0
- package/packages/agent/src/services/agent-export.js +729 -0
- package/packages/agent/src/services/app-manager.d.ts +56 -0
- package/packages/agent/src/services/app-manager.d.ts.map +1 -0
- package/packages/agent/src/services/app-manager.js +2019 -0
- package/packages/agent/src/services/app-package-modules.d.ts +30 -0
- package/packages/agent/src/services/app-package-modules.d.ts.map +1 -0
- package/packages/agent/src/services/app-package-modules.js +348 -0
- package/packages/agent/src/services/app-run-store.d.ts +6 -0
- package/packages/agent/src/services/app-run-store.d.ts.map +1 -0
- package/packages/agent/src/services/app-run-store.js +490 -0
- package/packages/agent/src/services/app-session-gate.d.ts +15 -0
- package/packages/agent/src/services/app-session-gate.d.ts.map +1 -0
- package/packages/agent/src/services/app-session-gate.js +71 -0
- package/packages/agent/src/services/browser-capture.d.ts +41 -0
- package/packages/agent/src/services/browser-capture.d.ts.map +1 -0
- package/packages/agent/src/services/browser-capture.js +173 -0
- package/packages/agent/src/services/browser-workspace.d.ts +179 -0
- package/packages/agent/src/services/browser-workspace.d.ts.map +1 -0
- package/packages/agent/src/services/browser-workspace.js +4589 -0
- package/packages/agent/src/services/built-in-app-routes/2004scape.d.ts +28 -0
- package/packages/agent/src/services/built-in-app-routes/2004scape.d.ts.map +1 -0
- package/packages/agent/src/services/built-in-app-routes/2004scape.js +1343 -0
- package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts +5 -0
- package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts.map +1 -0
- package/packages/agent/src/services/built-in-app-routes/hyperscape.js +189 -0
- package/packages/agent/src/services/character-persistence.d.ts +39 -0
- package/packages/agent/src/services/character-persistence.d.ts.map +1 -0
- package/packages/agent/src/services/character-persistence.js +159 -0
- package/packages/agent/src/services/client-chat-sender.d.ts +19 -0
- package/packages/agent/src/services/client-chat-sender.d.ts.map +1 -0
- package/packages/agent/src/services/client-chat-sender.js +88 -0
- package/packages/agent/src/services/coding-agent-context.d.ts +310 -0
- package/packages/agent/src/services/coding-agent-context.d.ts.map +1 -0
- package/packages/agent/src/services/coding-agent-context.js +281 -0
- package/packages/agent/src/services/coding-task-executor.d.ts +20 -0
- package/packages/agent/src/services/coding-task-executor.d.ts.map +1 -0
- package/packages/agent/src/services/coding-task-executor.js +141 -0
- package/packages/agent/src/services/config-plugin-manager.d.ts +6 -0
- package/packages/agent/src/services/config-plugin-manager.d.ts.map +1 -0
- package/packages/agent/src/services/config-plugin-manager.js +53 -0
- package/packages/agent/src/services/connector-setup-service.d.ts +48 -0
- package/packages/agent/src/services/connector-setup-service.d.ts.map +1 -0
- package/packages/agent/src/services/connector-setup-service.js +60 -0
- package/packages/agent/src/services/conversation-proximity.d.ts +27 -0
- package/packages/agent/src/services/conversation-proximity.d.ts.map +1 -0
- package/packages/agent/src/services/conversation-proximity.js +124 -0
- package/packages/agent/src/services/credential-words.d.ts +26 -0
- package/packages/agent/src/services/credential-words.d.ts.map +1 -0
- package/packages/agent/src/services/credential-words.js +116 -0
- package/packages/agent/src/services/escalation.d.ts +46 -0
- package/packages/agent/src/services/escalation.d.ts.map +1 -0
- package/packages/agent/src/services/escalation.js +415 -0
- package/packages/agent/src/services/executor-registry.d.ts +4 -0
- package/packages/agent/src/services/executor-registry.d.ts.map +1 -0
- package/packages/agent/src/services/executor-registry.js +10 -0
- package/packages/agent/src/services/index.d.ts +25 -0
- package/packages/agent/src/services/index.d.ts.map +1 -0
- package/packages/agent/src/services/index.js +24 -0
- package/packages/agent/src/services/mcp-marketplace.d.ts +89 -0
- package/packages/agent/src/services/mcp-marketplace.d.ts.map +1 -0
- package/packages/agent/src/services/mcp-marketplace.js +200 -0
- package/packages/agent/src/services/overlay-app-presence.d.ts +9 -0
- package/packages/agent/src/services/overlay-app-presence.d.ts.map +1 -0
- package/packages/agent/src/services/overlay-app-presence.js +18 -0
- package/packages/agent/src/services/plugin-manager-types.d.ts +113 -0
- package/packages/agent/src/services/plugin-manager-types.d.ts.map +1 -0
- package/packages/agent/src/services/plugin-manager-types.js +18 -0
- package/packages/agent/src/services/privy-wallets.d.ts +23 -0
- package/packages/agent/src/services/privy-wallets.d.ts.map +1 -0
- package/packages/agent/src/services/privy-wallets.js +230 -0
- package/packages/agent/src/services/registry-client-app-meta.d.ts +6 -0
- package/packages/agent/src/services/registry-client-app-meta.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-app-meta.js +225 -0
- package/packages/agent/src/services/registry-client-endpoints.d.ts +7 -0
- package/packages/agent/src/services/registry-client-endpoints.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-endpoints.js +190 -0
- package/packages/agent/src/services/registry-client-local.d.ts +4 -0
- package/packages/agent/src/services/registry-client-local.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-local.js +545 -0
- package/packages/agent/src/services/registry-client-network.d.ts +9 -0
- package/packages/agent/src/services/registry-client-network.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-network.js +119 -0
- package/packages/agent/src/services/registry-client-queries.d.ts +15 -0
- package/packages/agent/src/services/registry-client-queries.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-queries.js +172 -0
- package/packages/agent/src/services/registry-client-types.d.ts +125 -0
- package/packages/agent/src/services/registry-client-types.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client-types.js +1 -0
- package/packages/agent/src/services/registry-client.d.ts +39 -0
- package/packages/agent/src/services/registry-client.d.ts.map +1 -0
- package/packages/agent/src/services/registry-client.js +332 -0
- package/packages/agent/src/services/relationships-graph.d.ts +134 -0
- package/packages/agent/src/services/relationships-graph.d.ts.map +1 -0
- package/packages/agent/src/services/relationships-graph.js +1332 -0
- package/packages/agent/src/services/remote-signing-service.d.ts +58 -0
- package/packages/agent/src/services/remote-signing-service.d.ts.map +1 -0
- package/packages/agent/src/services/remote-signing-service.js +185 -0
- package/packages/agent/src/services/research-task-executor.d.ts +14 -0
- package/packages/agent/src/services/research-task-executor.d.ts.map +1 -0
- package/packages/agent/src/services/research-task-executor.js +136 -0
- package/packages/agent/src/services/sandbox-engine.d.ts +96 -0
- package/packages/agent/src/services/sandbox-engine.d.ts.map +1 -0
- package/packages/agent/src/services/sandbox-engine.js +604 -0
- package/packages/agent/src/services/sandbox-manager.d.ts +106 -0
- package/packages/agent/src/services/sandbox-manager.d.ts.map +1 -0
- package/packages/agent/src/services/sandbox-manager.js +380 -0
- package/packages/agent/src/services/self-updater.d.ts +21 -0
- package/packages/agent/src/services/self-updater.d.ts.map +1 -0
- package/packages/agent/src/services/self-updater.js +162 -0
- package/packages/agent/src/services/send-handler-availability.d.ts +5 -0
- package/packages/agent/src/services/send-handler-availability.d.ts.map +1 -0
- package/packages/agent/src/services/send-handler-availability.js +20 -0
- package/packages/agent/src/services/signal-pairing.d.ts +57 -0
- package/packages/agent/src/services/signal-pairing.d.ts.map +1 -0
- package/packages/agent/src/services/signal-pairing.js +393 -0
- package/packages/agent/src/services/signing-policy.d.ts +44 -0
- package/packages/agent/src/services/signing-policy.d.ts.map +1 -0
- package/packages/agent/src/services/signing-policy.js +165 -0
- package/packages/agent/src/services/skill-catalog-client.d.ts +47 -0
- package/packages/agent/src/services/skill-catalog-client.d.ts.map +1 -0
- package/packages/agent/src/services/skill-catalog-client.js +130 -0
- package/packages/agent/src/services/skill-marketplace.d.ts +42 -0
- package/packages/agent/src/services/skill-marketplace.d.ts.map +1 -0
- package/packages/agent/src/services/skill-marketplace.js +689 -0
- package/packages/agent/src/services/steward-evm-account.d.ts +62 -0
- package/packages/agent/src/services/steward-evm-account.d.ts.map +1 -0
- package/packages/agent/src/services/steward-evm-account.js +308 -0
- package/packages/agent/src/services/steward-evm-bridge.d.ts +39 -0
- package/packages/agent/src/services/steward-evm-bridge.d.ts.map +1 -0
- package/packages/agent/src/services/steward-evm-bridge.js +103 -0
- package/packages/agent/src/services/steward-wallet.d.ts +30 -0
- package/packages/agent/src/services/steward-wallet.d.ts.map +1 -0
- package/packages/agent/src/services/steward-wallet.js +334 -0
- package/packages/agent/src/services/stream-manager.d.ts +121 -0
- package/packages/agent/src/services/stream-manager.d.ts.map +1 -0
- package/packages/agent/src/services/stream-manager.js +609 -0
- package/packages/agent/src/services/task-executor.d.ts +47 -0
- package/packages/agent/src/services/task-executor.d.ts.map +1 -0
- package/packages/agent/src/services/task-executor.js +31 -0
- package/packages/agent/src/services/telegram-account-auth.d.ts +99 -0
- package/packages/agent/src/services/telegram-account-auth.d.ts.map +1 -0
- package/packages/agent/src/services/telegram-account-auth.js +611 -0
- package/packages/agent/src/services/tts-stream-bridge.d.ts +83 -0
- package/packages/agent/src/services/tts-stream-bridge.d.ts.map +1 -0
- package/packages/agent/src/services/tts-stream-bridge.js +360 -0
- package/packages/agent/src/services/update-checker.d.ts +29 -0
- package/packages/agent/src/services/update-checker.d.ts.map +1 -0
- package/packages/agent/src/services/update-checker.js +134 -0
- package/packages/agent/src/services/version-compat.d.ts +99 -0
- package/packages/agent/src/services/version-compat.d.ts.map +1 -0
- package/packages/agent/src/services/version-compat.js +203 -0
- package/packages/agent/src/services/whatsapp-pairing.d.ts +41 -0
- package/packages/agent/src/services/whatsapp-pairing.d.ts.map +1 -0
- package/packages/agent/src/services/whatsapp-pairing.js +209 -0
- package/packages/agent/src/shared/index.d.ts +2 -0
- package/packages/agent/src/shared/index.d.ts.map +1 -0
- package/packages/agent/src/shared/index.js +1 -0
- package/packages/agent/src/shared/ui-catalog-prompt.d.ts +52 -0
- package/packages/agent/src/shared/ui-catalog-prompt.d.ts.map +1 -0
- package/packages/agent/src/shared/ui-catalog-prompt.js +1028 -0
- package/packages/agent/src/test-support/index.d.ts +4 -0
- package/packages/agent/src/test-support/index.d.ts.map +1 -0
- package/packages/agent/src/test-support/index.js +3 -0
- package/packages/agent/src/test-support/process-helpers.d.ts +13 -0
- package/packages/agent/src/test-support/process-helpers.d.ts.map +1 -0
- package/packages/agent/src/test-support/process-helpers.js +23 -0
- package/packages/agent/src/test-support/route-test-helpers.d.ts +37 -0
- package/packages/agent/src/test-support/route-test-helpers.d.ts.map +1 -0
- package/packages/agent/src/test-support/route-test-helpers.js +54 -0
- package/packages/agent/src/test-support/test-helpers.d.ts +77 -0
- package/packages/agent/src/test-support/test-helpers.d.ts.map +1 -0
- package/packages/agent/src/test-support/test-helpers.js +217 -0
- package/packages/agent/src/test-utils/sqlite-compat.d.ts +17 -0
- package/packages/agent/src/test-utils/sqlite-compat.d.ts.map +1 -0
- package/packages/agent/src/test-utils/sqlite-compat.js +48 -0
- package/packages/agent/src/testing/index.d.ts +4 -0
- package/packages/agent/src/testing/index.d.ts.map +1 -0
- package/packages/agent/src/testing/index.js +3 -0
- package/packages/agent/src/triggers/action.d.ts +4 -0
- package/packages/agent/src/triggers/action.d.ts.map +1 -0
- package/packages/agent/src/triggers/action.js +316 -0
- package/packages/agent/src/triggers/index.d.ts +5 -0
- package/packages/agent/src/triggers/index.d.ts.map +1 -0
- package/packages/agent/src/triggers/index.js +4 -0
- package/packages/agent/src/triggers/runtime.d.ts +25 -0
- package/packages/agent/src/triggers/runtime.d.ts.map +1 -0
- package/packages/agent/src/triggers/runtime.js +456 -0
- package/packages/agent/src/triggers/scheduling.d.ts +71 -0
- package/packages/agent/src/triggers/scheduling.d.ts.map +1 -0
- package/packages/agent/src/triggers/scheduling.js +355 -0
- package/packages/agent/src/triggers/types.d.ts +115 -0
- package/packages/agent/src/triggers/types.d.ts.map +1 -0
- package/packages/agent/src/triggers/types.js +1 -0
- package/packages/agent/src/types/agent-skills.d.ts +19 -0
- package/packages/agent/src/types/agent-skills.d.ts.map +1 -0
- package/packages/agent/src/types/agent-skills.js +7 -0
- package/packages/agent/src/types/config-like.d.ts +17 -0
- package/packages/agent/src/types/config-like.d.ts.map +1 -0
- package/packages/agent/src/types/config-like.js +7 -0
- package/packages/agent/src/types/trajectory.d.ts +106 -0
- package/packages/agent/src/types/trajectory.d.ts.map +1 -0
- package/packages/agent/src/types/trajectory.js +7 -0
- package/packages/agent/src/utils/exec-safety.d.ts +2 -0
- package/packages/agent/src/utils/exec-safety.d.ts.map +1 -0
- package/packages/agent/src/utils/exec-safety.js +21 -0
- package/packages/agent/src/utils/index.d.ts +3 -0
- package/packages/agent/src/utils/index.d.ts.map +1 -0
- package/packages/agent/src/utils/index.js +2 -0
- package/packages/agent/src/utils/number-parsing.d.ts +26 -0
- package/packages/agent/src/utils/number-parsing.d.ts.map +1 -0
- package/packages/agent/src/utils/number-parsing.js +52 -0
- package/packages/agent/src/utils/spoken-text.d.ts +2 -0
- package/packages/agent/src/utils/spoken-text.d.ts.map +1 -0
- package/packages/agent/src/utils/spoken-text.js +1 -0
- package/packages/agent/src/version-resolver.d.ts +2 -0
- package/packages/agent/src/version-resolver.d.ts.map +1 -0
- package/packages/agent/src/version-resolver.js +50 -0
- package/packages/app-core/src/api/cloud-secrets.d.ts +23 -0
- package/packages/app-core/src/api/cloud-secrets.d.ts.map +1 -0
- package/packages/app-core/src/api/cloud-secrets.js +50 -0
- package/packages/app-core/src/api/compat-route-shared.d.ts +16 -0
- package/packages/app-core/src/api/compat-route-shared.d.ts.map +1 -0
- package/packages/app-core/src/api/compat-route-shared.js +99 -0
- package/packages/app-core/src/api/response.d.ts +12 -0
- package/packages/app-core/src/api/response.d.ts.map +1 -0
- package/packages/app-core/src/api/response.js +18 -0
- package/packages/app-core/src/api/server-cloud-tts.d.ts +41 -0
- package/packages/app-core/src/api/server-cloud-tts.d.ts.map +1 -0
- package/packages/app-core/src/api/server-cloud-tts.js +469 -0
- package/packages/app-core/src/config/boot-config-store.d.ts +117 -0
- package/packages/app-core/src/config/boot-config-store.d.ts.map +1 -0
- package/packages/app-core/src/config/boot-config-store.js +135 -0
- package/packages/app-core/src/config/boot-config.d.ts +6 -0
- package/packages/app-core/src/config/boot-config.d.ts.map +1 -0
- package/packages/app-core/src/config/boot-config.js +5 -0
- package/packages/app-core/src/config/branding.d.ts +55 -0
- package/packages/app-core/src/config/branding.d.ts.map +1 -0
- package/packages/app-core/src/config/branding.js +23 -0
- package/packages/app-core/src/config/config.d.ts +12 -0
- package/packages/app-core/src/config/config.d.ts.map +1 -0
- package/packages/app-core/src/config/config.js +23 -0
- package/packages/app-core/src/navigation/index.d.ts +52 -0
- package/packages/app-core/src/navigation/index.d.ts.map +1 -0
- package/packages/app-core/src/navigation/index.js +354 -0
- package/packages/app-core/src/state/action-notice.d.ts +7 -0
- package/packages/app-core/src/state/action-notice.d.ts.map +1 -0
- package/packages/app-core/src/state/action-notice.js +1 -0
- package/packages/app-core/src/types/index.d.ts +649 -0
- package/packages/app-core/src/types/index.d.ts.map +1 -0
- package/packages/app-core/src/types/index.js +1 -0
- package/packages/app-core/src/types/lifeops-ui.d.ts +10 -0
- package/packages/app-core/src/types/lifeops-ui.d.ts.map +1 -0
- package/packages/app-core/src/types/lifeops-ui.js +1 -0
- package/packages/app-core/src/utils/env.d.ts +31 -0
- package/packages/app-core/src/utils/env.d.ts.map +1 -0
- package/packages/app-core/src/utils/env.js +51 -0
- package/packages/app-core/src/utils/tts-debug.d.ts +9 -0
- package/packages/app-core/src/utils/tts-debug.d.ts.map +1 -0
- package/packages/app-core/src/utils/tts-debug.js +68 -0
- package/packages/shared/src/awareness/index.d.ts +2 -0
- package/packages/shared/src/awareness/index.d.ts.map +1 -0
- package/packages/shared/src/awareness/index.js +1 -0
- package/packages/shared/src/awareness/registry.d.ts +27 -0
- package/packages/shared/src/awareness/registry.d.ts.map +1 -0
- package/packages/shared/src/awareness/registry.js +161 -0
- package/packages/shared/src/connectors.d.ts +13 -0
- package/packages/shared/src/connectors.d.ts.map +1 -0
- package/packages/shared/src/connectors.js +91 -0
- package/packages/shared/src/contracts/apps.d.ts +204 -0
- package/packages/shared/src/contracts/apps.d.ts.map +1 -0
- package/packages/shared/src/contracts/apps.js +188 -0
- package/packages/shared/src/contracts/awareness.d.ts +38 -0
- package/packages/shared/src/contracts/awareness.d.ts.map +1 -0
- package/packages/shared/src/contracts/awareness.js +7 -0
- package/packages/shared/src/contracts/cloud-topology.d.ts +13 -0
- package/packages/shared/src/contracts/cloud-topology.d.ts.map +1 -0
- package/packages/shared/src/contracts/cloud-topology.js +73 -0
- package/packages/shared/src/contracts/config.d.ts +146 -0
- package/packages/shared/src/contracts/config.d.ts.map +1 -0
- package/packages/shared/src/contracts/config.js +4 -0
- package/packages/shared/src/contracts/content-pack.d.ts +131 -0
- package/packages/shared/src/contracts/content-pack.d.ts.map +1 -0
- package/packages/shared/src/contracts/content-pack.js +102 -0
- package/packages/shared/src/contracts/drop.d.ts +20 -0
- package/packages/shared/src/contracts/drop.d.ts.map +1 -0
- package/packages/shared/src/contracts/drop.js +4 -0
- package/packages/shared/src/contracts/index.d.ts +13 -0
- package/packages/shared/src/contracts/index.d.ts.map +1 -0
- package/packages/shared/src/contracts/index.js +12 -0
- package/packages/shared/src/contracts/lifeops.d.ts +1337 -0
- package/packages/shared/src/contracts/lifeops.d.ts.map +1 -0
- package/packages/shared/src/contracts/lifeops.js +278 -0
- package/packages/shared/src/contracts/onboarding.d.ts +443 -0
- package/packages/shared/src/contracts/onboarding.d.ts.map +1 -0
- package/packages/shared/src/contracts/onboarding.js +1020 -0
- package/packages/shared/src/contracts/permissions.d.ts +38 -0
- package/packages/shared/src/contracts/permissions.d.ts.map +1 -0
- package/packages/shared/src/contracts/permissions.js +4 -0
- package/packages/shared/src/contracts/service-routing.d.ts +77 -0
- package/packages/shared/src/contracts/service-routing.d.ts.map +1 -0
- package/packages/shared/src/contracts/service-routing.js +227 -0
- package/packages/shared/src/contracts/theme.d.ts +136 -0
- package/packages/shared/src/contracts/theme.d.ts.map +1 -0
- package/packages/shared/src/contracts/theme.js +133 -0
- package/packages/shared/src/contracts/verification.d.ts +9 -0
- package/packages/shared/src/contracts/verification.d.ts.map +1 -0
- package/packages/shared/src/contracts/verification.js +4 -0
- package/packages/shared/src/contracts/wallet.d.ts +626 -0
- package/packages/shared/src/contracts/wallet.d.ts.map +1 -0
- package/packages/shared/src/contracts/wallet.js +60 -0
- package/packages/shared/src/env-utils.d.ts +5 -0
- package/packages/shared/src/env-utils.d.ts.map +1 -0
- package/packages/shared/src/env-utils.impl.d.ts +2 -0
- package/packages/shared/src/env-utils.impl.d.ts.map +1 -0
- package/packages/shared/src/env-utils.impl.js +16 -0
- package/packages/shared/src/env-utils.js +4 -0
- package/packages/shared/src/i18n/generated/validation-keyword-data.d.ts +1054 -0
- package/packages/shared/src/i18n/generated/validation-keyword-data.d.ts.map +1 -0
- package/packages/shared/src/i18n/generated/validation-keyword-data.js +1057 -0
- package/packages/shared/src/i18n/keyword-matching.d.ts +23 -0
- package/packages/shared/src/i18n/keyword-matching.d.ts.map +1 -0
- package/packages/shared/src/i18n/keyword-matching.js +112 -0
- package/packages/shared/src/i18n/validation-keywords.d.ts +13 -0
- package/packages/shared/src/i18n/validation-keywords.d.ts.map +1 -0
- package/packages/shared/src/i18n/validation-keywords.js +12 -0
- package/packages/shared/src/index.d.ts +13 -0
- package/packages/shared/src/index.d.ts.map +1 -0
- package/packages/shared/src/index.js +12 -0
- package/packages/shared/src/onboarding-presets.characters.d.ts +22 -0
- package/packages/shared/src/onboarding-presets.characters.d.ts.map +1 -0
- package/packages/shared/src/onboarding-presets.characters.js +2606 -0
- package/packages/shared/src/onboarding-presets.d.ts +40 -0
- package/packages/shared/src/onboarding-presets.d.ts.map +1 -0
- package/packages/shared/src/onboarding-presets.js +176 -0
- package/packages/shared/src/onboarding-presets.shared.d.ts +2 -0
- package/packages/shared/src/onboarding-presets.shared.d.ts.map +1 -0
- package/packages/shared/src/onboarding-presets.shared.js +7 -0
- package/packages/shared/src/restart.d.ts +27 -0
- package/packages/shared/src/restart.d.ts.map +1 -0
- package/packages/shared/src/restart.js +28 -0
- package/packages/shared/src/runtime-env.d.ts +82 -0
- package/packages/shared/src/runtime-env.d.ts.map +1 -0
- package/packages/shared/src/runtime-env.js +246 -0
- package/packages/shared/src/settings-debug.d.ts +20 -0
- package/packages/shared/src/settings-debug.d.ts.map +1 -0
- package/packages/shared/src/settings-debug.js +116 -0
- package/packages/shared/src/spoken-text.d.ts +2 -0
- package/packages/shared/src/spoken-text.d.ts.map +1 -0
- package/packages/shared/src/spoken-text.js +56 -0
- package/packages/shared/src/types.d.ts +27 -0
- package/packages/shared/src/types.d.ts.map +1 -0
- package/packages/shared/src/types.js +1 -0
- package/packages/shared/src/validation-keywords.d.ts +2 -0
- package/packages/shared/src/validation-keywords.d.ts.map +1 -0
- package/packages/shared/src/validation-keywords.js +1 -0
- package/packages/typescript/src/action-docs.d.ts +22 -0
- package/packages/typescript/src/action-docs.d.ts.map +1 -0
- package/packages/typescript/src/action-docs.js +93 -0
- package/packages/typescript/src/actions.d.ts +29 -0
- package/packages/typescript/src/actions.d.ts.map +1 -0
- package/packages/typescript/src/actions.js +456 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.js +150 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.js +136 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.js +84 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.js +107 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts +16 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.js +187 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.js +138 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.js +96 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.js +139 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.js +138 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts +39 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/index.js +78 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts +4 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.js +62 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts +16 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.js +162 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts +65 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.js +352 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts +24 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.js +63 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts +29 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.js +195 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts +15 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/specs.js +164 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts +92 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts.map +1 -0
- package/packages/typescript/src/advanced-capabilities/clipboard/types.js +4 -0
- package/packages/typescript/src/character-utils.d.ts +138 -0
- package/packages/typescript/src/character-utils.d.ts.map +1 -0
- package/packages/typescript/src/character-utils.js +271 -0
- package/packages/typescript/src/character.d.ts +68 -0
- package/packages/typescript/src/character.d.ts.map +1 -0
- package/packages/typescript/src/character.js +155 -0
- package/packages/typescript/src/connection.d.ts +45 -0
- package/packages/typescript/src/connection.d.ts.map +1 -0
- package/packages/typescript/src/connection.js +149 -0
- package/packages/typescript/src/constants/index.d.ts +7 -0
- package/packages/typescript/src/constants/index.d.ts.map +1 -0
- package/packages/typescript/src/constants/index.js +6 -0
- package/packages/typescript/src/constants/secrets.d.ts +99 -0
- package/packages/typescript/src/constants/secrets.d.ts.map +1 -0
- package/packages/typescript/src/constants/secrets.js +239 -0
- package/packages/typescript/src/database/inMemoryAdapter.d.ts +285 -0
- package/packages/typescript/src/database/inMemoryAdapter.d.ts.map +1 -0
- package/packages/typescript/src/database/inMemoryAdapter.js +1149 -0
- package/packages/typescript/src/database.d.ts +426 -0
- package/packages/typescript/src/database.d.ts.map +1 -0
- package/packages/typescript/src/database.js +24 -0
- package/packages/typescript/src/entities.d.ts +11 -0
- package/packages/typescript/src/entities.d.ts.map +1 -0
- package/packages/typescript/src/entities.js +437 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/addContact.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/addContact.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/addContact.js +142 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/followRoom.js +183 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/imageGeneration.js +148 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/index.d.ts +21 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/index.js +20 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/muteRoom.js +181 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/removeContact.js +102 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/roles.d.ts +13 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/roles.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/roles.js +317 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/scheduleFollowUp.js +129 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/searchContacts.js +176 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.d.ts +15 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/sendMessage.js +476 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/settings.d.ts +22 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/settings.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/settings.js +823 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/think.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/think.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/think.js +84 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unfollowRoom.js +134 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/unmuteRoom.js +193 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateContact.js +199 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.d.ts +43 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/actions/updateEntity.js +372 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/append.js +150 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/delete.js +136 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/list.js +84 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-attachment.js +112 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.d.ts +16 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read-file.js +192 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/read.js +138 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/remove-from-clipboard.js +96 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/search.js +139 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/actions/write.js +138 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/index.d.ts +39 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/index.js +78 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.d.ts +4 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/providers/clipboard.js +62 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.d.ts +16 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/attachmentContext.js +162 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.d.ts +65 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/clipboardService.js +352 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts +24 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardPersistence.js +63 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.d.ts +29 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/services/taskClipboardService.js +195 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.d.ts +15 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/specs.js +164 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/types.d.ts +92 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/clipboard/types.js +4 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts +8 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/index.js +7 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.js +633 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.js +619 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.d.ts +12 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/evaluators/task-completion.js +14 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/actions/record-experience.js +70 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/evaluators/experienceEvaluator.js +256 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.d.ts +12 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/prompts/typescript/prompts.js +41 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.d.ts +49 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/spec-helpers.js +78 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.d.ts +159 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/generated/specs/specs.js +192 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/index.d.ts +10 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/index.js +8 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/providers/experienceProvider.js +51 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/service.d.ts +46 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/service.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/service.js +569 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/types.d.ts +95 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/types.js +22 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.d.ts +34 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/confidenceDecay.js +106 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.d.ts +25 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/experience/utils/experienceRelationships.js +116 -0
- package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.d.ts +13 -0
- package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/actions/restore.js +152 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builder.d.ts +101 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builder.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builder.js +362 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builtins.d.ts +16 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builtins.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/builtins.js +245 -0
- package/packages/typescript/src/features/advanced-capabilities/form/defaults.d.ts +32 -0
- package/packages/typescript/src/features/advanced-capabilities/form/defaults.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/defaults.js +98 -0
- package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.d.ts +12 -0
- package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/evaluators/extractor.js +231 -0
- package/packages/typescript/src/features/advanced-capabilities/form/extraction.d.ts +24 -0
- package/packages/typescript/src/features/advanced-capabilities/form/extraction.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/extraction.js +319 -0
- package/packages/typescript/src/features/advanced-capabilities/form/index.d.ts +22 -0
- package/packages/typescript/src/features/advanced-capabilities/form/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/index.js +52 -0
- package/packages/typescript/src/features/advanced-capabilities/form/intent.d.ts +41 -0
- package/packages/typescript/src/features/advanced-capabilities/form/intent.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/intent.js +119 -0
- package/packages/typescript/src/features/advanced-capabilities/form/providers/context.d.ts +11 -0
- package/packages/typescript/src/features/advanced-capabilities/form/providers/context.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/providers/context.js +166 -0
- package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts +70 -0
- package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/service.js +924 -0
- package/packages/typescript/src/features/advanced-capabilities/form/storage.d.ts +26 -0
- package/packages/typescript/src/features/advanced-capabilities/form/storage.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/storage.js +228 -0
- package/packages/typescript/src/features/advanced-capabilities/form/template.d.ts +10 -0
- package/packages/typescript/src/features/advanced-capabilities/form/template.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/template.js +56 -0
- package/packages/typescript/src/features/advanced-capabilities/form/ttl.d.ts +40 -0
- package/packages/typescript/src/features/advanced-capabilities/form/ttl.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/ttl.js +107 -0
- package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts +588 -0
- package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/types.js +71 -0
- package/packages/typescript/src/features/advanced-capabilities/form/validation.d.ts +24 -0
- package/packages/typescript/src/features/advanced-capabilities/form/validation.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/form/validation.js +311 -0
- package/packages/typescript/src/features/advanced-capabilities/index.d.ts +47 -0
- package/packages/typescript/src/features/advanced-capabilities/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/index.js +114 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.d.ts +7 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/actions/modify-character.js +1299 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.d.ts +53 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/evaluators/character-evolution.js +429 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/index.d.ts +10 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/index.js +8 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.d.ts +8 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/providers/user-personality.js +57 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.d.ts +71 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/services/character-file-manager.js +498 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/types.d.ts +18 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/personality/types.js +8 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/contacts.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/contacts.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/contacts.js +77 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/facts.d.ts +11 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/facts.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/facts.js +108 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/followUps.d.ts +3 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/followUps.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/followUps.js +112 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/index.d.ts +13 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/index.js +12 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.d.ts +9 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/knowledge.js +83 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/relationships.d.ts +15 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/relationships.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/relationships.js +125 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/roles.d.ts +19 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/roles.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/roles.js +180 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/settings.d.ts +7 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/settings.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-capabilities/providers/settings.js +286 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/index.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/index.js +2 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/long-term-extraction.js +198 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/summarization.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/summarization.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/evaluators/summarization.js +240 -0
- package/packages/typescript/src/features/advanced-memory/index.d.ts +16 -0
- package/packages/typescript/src/features/advanced-memory/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/index.js +26 -0
- package/packages/typescript/src/features/advanced-memory/prompts.d.ts +2 -0
- package/packages/typescript/src/features/advanced-memory/prompts.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/prompts.js +1 -0
- package/packages/typescript/src/features/advanced-memory/providers/context-summary.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/providers/context-summary.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/providers/context-summary.js +85 -0
- package/packages/typescript/src/features/advanced-memory/providers/index.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/providers/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/providers/index.js +2 -0
- package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.d.ts +3 -0
- package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/providers/long-term-memory.js +92 -0
- package/packages/typescript/src/features/advanced-memory/schemas/index.d.ts +5 -0
- package/packages/typescript/src/features/advanced-memory/schemas/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/schemas/index.js +3 -0
- package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.d.ts +10 -0
- package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/schemas/long-term-memories.js +65 -0
- package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.d.ts +10 -0
- package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/schemas/memory-access-logs.js +45 -0
- package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.d.ts +10 -0
- package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/schemas/session-summaries.js +66 -0
- package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts +37 -0
- package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/services/memory-service.js +347 -0
- package/packages/typescript/src/features/advanced-memory/trajectory.d.ts +10 -0
- package/packages/typescript/src/features/advanced-memory/trajectory.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/trajectory.js +33 -0
- package/packages/typescript/src/features/advanced-memory/types.d.ts +68 -0
- package/packages/typescript/src/features/advanced-memory/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-memory/types.js +6 -0
- package/packages/typescript/src/features/advanced-planning/actions/chain-example.d.ts +6 -0
- package/packages/typescript/src/features/advanced-planning/actions/chain-example.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-planning/actions/chain-example.js +181 -0
- package/packages/typescript/src/features/advanced-planning/index.d.ts +5 -0
- package/packages/typescript/src/features/advanced-planning/index.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-planning/index.js +20 -0
- package/packages/typescript/src/features/advanced-planning/providers/message-classifier.d.ts +3 -0
- package/packages/typescript/src/features/advanced-planning/providers/message-classifier.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-planning/providers/message-classifier.js +105 -0
- package/packages/typescript/src/features/advanced-planning/services/planning-service.d.ts +77 -0
- package/packages/typescript/src/features/advanced-planning/services/planning-service.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-planning/services/planning-service.js +875 -0
- package/packages/typescript/src/features/advanced-planning/types.d.ts +78 -0
- package/packages/typescript/src/features/advanced-planning/types.d.ts.map +1 -0
- package/packages/typescript/src/features/advanced-planning/types.js +1 -0
- package/packages/typescript/src/features/autonomy/action.d.ts +14 -0
- package/packages/typescript/src/features/autonomy/action.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/action.js +177 -0
- package/packages/typescript/src/features/autonomy/execution-facade.d.ts +22 -0
- package/packages/typescript/src/features/autonomy/execution-facade.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/execution-facade.js +132 -0
- package/packages/typescript/src/features/autonomy/index.d.ts +11 -0
- package/packages/typescript/src/features/autonomy/index.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/index.js +13 -0
- package/packages/typescript/src/features/autonomy/providers.d.ts +21 -0
- package/packages/typescript/src/features/autonomy/providers.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/providers.js +154 -0
- package/packages/typescript/src/features/autonomy/routes.d.ts +11 -0
- package/packages/typescript/src/features/autonomy/routes.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/routes.js +158 -0
- package/packages/typescript/src/features/autonomy/service.d.ts +138 -0
- package/packages/typescript/src/features/autonomy/service.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/service.js +813 -0
- package/packages/typescript/src/features/autonomy/types.d.ts +31 -0
- package/packages/typescript/src/features/autonomy/types.d.ts.map +1 -0
- package/packages/typescript/src/features/autonomy/types.js +6 -0
- package/packages/typescript/src/features/basic-capabilities/actions/choice.d.ts +4 -0
- package/packages/typescript/src/features/basic-capabilities/actions/choice.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/actions/choice.js +278 -0
- package/packages/typescript/src/features/basic-capabilities/actions/ignore.d.ts +3 -0
- package/packages/typescript/src/features/basic-capabilities/actions/ignore.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/actions/ignore.js +23 -0
- package/packages/typescript/src/features/basic-capabilities/actions/index.d.ts +10 -0
- package/packages/typescript/src/features/basic-capabilities/actions/index.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/actions/index.js +9 -0
- package/packages/typescript/src/features/basic-capabilities/actions/none.d.ts +3 -0
- package/packages/typescript/src/features/basic-capabilities/actions/none.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/actions/none.js +26 -0
- package/packages/typescript/src/features/basic-capabilities/actions/reply.d.ts +3 -0
- package/packages/typescript/src/features/basic-capabilities/actions/reply.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/actions/reply.js +80 -0
- package/packages/typescript/src/features/basic-capabilities/index.d.ts +108 -0
- package/packages/typescript/src/features/basic-capabilities/index.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/index.js +1020 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actionState.d.ts +7 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actionState.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actionState.js +232 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actions.d.ts +35 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actions.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/actions.js +82 -0
- package/packages/typescript/src/features/basic-capabilities/providers/attachments.d.ts +20 -0
- package/packages/typescript/src/features/basic-capabilities/providers/attachments.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/attachments.js +94 -0
- package/packages/typescript/src/features/basic-capabilities/providers/character.d.ts +17 -0
- package/packages/typescript/src/features/basic-capabilities/providers/character.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/character.js +190 -0
- package/packages/typescript/src/features/basic-capabilities/providers/choice.d.ts +11 -0
- package/packages/typescript/src/features/basic-capabilities/providers/choice.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/choice.js +86 -0
- package/packages/typescript/src/features/basic-capabilities/providers/contextBench.d.ts +12 -0
- package/packages/typescript/src/features/basic-capabilities/providers/contextBench.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/contextBench.js +50 -0
- package/packages/typescript/src/features/basic-capabilities/providers/currentTime.d.ts +11 -0
- package/packages/typescript/src/features/basic-capabilities/providers/currentTime.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/currentTime.js +56 -0
- package/packages/typescript/src/features/basic-capabilities/providers/entities.d.ts +7 -0
- package/packages/typescript/src/features/basic-capabilities/providers/entities.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/entities.js +39 -0
- package/packages/typescript/src/features/basic-capabilities/providers/evaluators.d.ts +27 -0
- package/packages/typescript/src/features/basic-capabilities/providers/evaluators.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/evaluators.js +107 -0
- package/packages/typescript/src/features/basic-capabilities/providers/index.d.ts +19 -0
- package/packages/typescript/src/features/basic-capabilities/providers/index.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/index.js +18 -0
- package/packages/typescript/src/features/basic-capabilities/providers/providers.d.ts +18 -0
- package/packages/typescript/src/features/basic-capabilities/providers/providers.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/providers.js +70 -0
- package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.d.ts +14 -0
- package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/recentMessages.js +323 -0
- package/packages/typescript/src/features/basic-capabilities/providers/time.d.ts +12 -0
- package/packages/typescript/src/features/basic-capabilities/providers/time.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/time.js +36 -0
- package/packages/typescript/src/features/basic-capabilities/providers/world.d.ts +8 -0
- package/packages/typescript/src/features/basic-capabilities/providers/world.d.ts.map +1 -0
- package/packages/typescript/src/features/basic-capabilities/providers/world.js +212 -0
- package/packages/typescript/src/features/index.d.ts +58 -0
- package/packages/typescript/src/features/index.d.ts.map +1 -0
- package/packages/typescript/src/features/index.js +155 -0
- package/packages/typescript/src/features/knowledge/actions.d.ts +5 -0
- package/packages/typescript/src/features/knowledge/actions.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/actions.js +269 -0
- package/packages/typescript/src/features/knowledge/config.d.ts +5 -0
- package/packages/typescript/src/features/knowledge/config.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/config.js +147 -0
- package/packages/typescript/src/features/knowledge/ctx-embeddings.d.ts +53 -0
- package/packages/typescript/src/features/knowledge/ctx-embeddings.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/ctx-embeddings.js +412 -0
- package/packages/typescript/src/features/knowledge/docs-loader.d.ts +9 -0
- package/packages/typescript/src/features/knowledge/docs-loader.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/docs-loader.js +202 -0
- package/packages/typescript/src/features/knowledge/document-processor.d.ts +26 -0
- package/packages/typescript/src/features/knowledge/document-processor.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/document-processor.js +618 -0
- package/packages/typescript/src/features/knowledge/documents-provider.d.ts +3 -0
- package/packages/typescript/src/features/knowledge/documents-provider.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/documents-provider.js +106 -0
- package/packages/typescript/src/features/knowledge/index.d.ts +16 -0
- package/packages/typescript/src/features/knowledge/index.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/index.js +29 -0
- package/packages/typescript/src/features/knowledge/llm.d.ts +27 -0
- package/packages/typescript/src/features/knowledge/llm.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/llm.js +444 -0
- package/packages/typescript/src/features/knowledge/provider.d.ts +3 -0
- package/packages/typescript/src/features/knowledge/provider.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/provider.js +62 -0
- package/packages/typescript/src/features/knowledge/service.d.ts +76 -0
- package/packages/typescript/src/features/knowledge/service.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/service.js +511 -0
- package/packages/typescript/src/features/knowledge/types.d.ts +144 -0
- package/packages/typescript/src/features/knowledge/types.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/types.js +57 -0
- package/packages/typescript/src/features/knowledge/utils.d.ts +17 -0
- package/packages/typescript/src/features/knowledge/utils.d.ts.map +1 -0
- package/packages/typescript/src/features/knowledge/utils.js +313 -0
- package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.d.ts +3 -0
- package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/coreStatusAction.js +65 -0
- package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.d.ts +3 -0
- package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/listEjectedPluginsAction.js +63 -0
- package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.d.ts +4 -0
- package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/searchPluginAction.js +232 -0
- package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts +35 -0
- package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/coreExtensions.js +77 -0
- package/packages/typescript/src/features/plugin-manager/index.d.ts +25 -0
- package/packages/typescript/src/features/plugin-manager/index.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/index.js +53 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.d.ts +5 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginConfigurationStatus.js +104 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.d.ts +5 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/providers/pluginStateProvider.js +105 -0
- package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.d.ts +5 -0
- package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/providers/registryPluginsProvider.js +93 -0
- package/packages/typescript/src/features/plugin-manager/providers/relevance.d.ts +9 -0
- package/packages/typescript/src/features/plugin-manager/providers/relevance.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/providers/relevance.js +226 -0
- package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts +76 -0
- package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/services/coreManagerService.js +479 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.d.ts +31 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginConfigurationService.js +57 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.d.ts +68 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.js +1007 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.d.ts +84 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/services/pluginRegistryService.js +402 -0
- package/packages/typescript/src/features/plugin-manager/types.d.ts +142 -0
- package/packages/typescript/src/features/plugin-manager/types.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/types.js +13 -0
- package/packages/typescript/src/features/plugin-manager/utils/paths.d.ts +4 -0
- package/packages/typescript/src/features/plugin-manager/utils/paths.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/utils/paths.js +32 -0
- package/packages/typescript/src/features/secrets/actions/index.d.ts +7 -0
- package/packages/typescript/src/features/secrets/actions/index.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/actions/index.js +6 -0
- package/packages/typescript/src/features/secrets/actions/manage-secret.d.ts +12 -0
- package/packages/typescript/src/features/secrets/actions/manage-secret.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/actions/manage-secret.js +278 -0
- package/packages/typescript/src/features/secrets/actions/request-secret.d.ts +3 -0
- package/packages/typescript/src/features/secrets/actions/request-secret.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/actions/request-secret.js +105 -0
- package/packages/typescript/src/features/secrets/actions/set-secret.d.ts +12 -0
- package/packages/typescript/src/features/secrets/actions/set-secret.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/actions/set-secret.js +223 -0
- package/packages/typescript/src/features/secrets/crypto/encryption.d.ts +184 -0
- package/packages/typescript/src/features/secrets/crypto/encryption.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/crypto/encryption.js +373 -0
- package/packages/typescript/src/features/secrets/crypto/index.d.ts +5 -0
- package/packages/typescript/src/features/secrets/crypto/index.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/crypto/index.js +16 -0
- package/packages/typescript/src/features/secrets/onboarding/action.d.ts +12 -0
- package/packages/typescript/src/features/secrets/onboarding/action.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/onboarding/action.js +337 -0
- package/packages/typescript/src/features/secrets/onboarding/config.d.ts +99 -0
- package/packages/typescript/src/features/secrets/onboarding/config.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/onboarding/config.js +240 -0
- package/packages/typescript/src/features/secrets/onboarding/index.d.ts +13 -0
- package/packages/typescript/src/features/secrets/onboarding/index.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/onboarding/index.js +12 -0
- package/packages/typescript/src/features/secrets/onboarding/provider.d.ts +16 -0
- package/packages/typescript/src/features/secrets/onboarding/provider.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/onboarding/provider.js +231 -0
- package/packages/typescript/src/features/secrets/onboarding/service.d.ts +134 -0
- package/packages/typescript/src/features/secrets/onboarding/service.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/onboarding/service.js +436 -0
- package/packages/typescript/src/features/secrets/providers/index.d.ts +5 -0
- package/packages/typescript/src/features/secrets/providers/index.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/providers/index.js +4 -0
- package/packages/typescript/src/features/secrets/providers/secrets-status.d.ts +22 -0
- package/packages/typescript/src/features/secrets/providers/secrets-status.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/providers/secrets-status.js +160 -0
- package/packages/typescript/src/features/secrets/services/plugin-activator.d.ts +182 -0
- package/packages/typescript/src/features/secrets/services/plugin-activator.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/services/plugin-activator.js +617 -0
- package/packages/typescript/src/features/secrets/services/secrets.d.ts +183 -0
- package/packages/typescript/src/features/secrets/services/secrets.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/services/secrets.js +566 -0
- package/packages/typescript/src/features/secrets/storage/character-store.d.ts +63 -0
- package/packages/typescript/src/features/secrets/storage/character-store.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/character-store.js +265 -0
- package/packages/typescript/src/features/secrets/storage/component-store.d.ts +47 -0
- package/packages/typescript/src/features/secrets/storage/component-store.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/component-store.js +264 -0
- package/packages/typescript/src/features/secrets/storage/index.d.ts +10 -0
- package/packages/typescript/src/features/secrets/storage/index.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/index.js +8 -0
- package/packages/typescript/src/features/secrets/storage/interface.d.ts +52 -0
- package/packages/typescript/src/features/secrets/storage/interface.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/interface.js +92 -0
- package/packages/typescript/src/features/secrets/storage/memory-store.d.ts +44 -0
- package/packages/typescript/src/features/secrets/storage/memory-store.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/memory-store.js +142 -0
- package/packages/typescript/src/features/secrets/storage/world-store.d.ts +52 -0
- package/packages/typescript/src/features/secrets/storage/world-store.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/storage/world-store.js +292 -0
- package/packages/typescript/src/features/secrets/types.d.ts +438 -0
- package/packages/typescript/src/features/secrets/types.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/types.js +57 -0
- package/packages/typescript/src/features/secrets/validation.d.ts +33 -0
- package/packages/typescript/src/features/secrets/validation.d.ts.map +1 -0
- package/packages/typescript/src/features/secrets/validation.js +389 -0
- package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts +275 -0
- package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/TrajectoriesService.js +1401 -0
- package/packages/typescript/src/features/trajectories/action-interceptor.d.ts +23 -0
- package/packages/typescript/src/features/trajectories/action-interceptor.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/action-interceptor.js +178 -0
- package/packages/typescript/src/features/trajectories/art-format.d.ts +32 -0
- package/packages/typescript/src/features/trajectories/art-format.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/art-format.js +221 -0
- package/packages/typescript/src/features/trajectories/export.d.ts +40 -0
- package/packages/typescript/src/features/trajectories/export.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/export.js +99 -0
- package/packages/typescript/src/features/trajectories/game-rewards.d.ts +14 -0
- package/packages/typescript/src/features/trajectories/game-rewards.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/game-rewards.js +20 -0
- package/packages/typescript/src/features/trajectories/index.d.ts +24 -0
- package/packages/typescript/src/features/trajectories/index.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/index.js +253 -0
- package/packages/typescript/src/features/trajectories/integration.d.ts +59 -0
- package/packages/typescript/src/features/trajectories/integration.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/integration.js +83 -0
- package/packages/typescript/src/features/trajectories/reward-service.d.ts +24 -0
- package/packages/typescript/src/features/trajectories/reward-service.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/reward-service.js +89 -0
- package/packages/typescript/src/features/trajectories/types.d.ts +243 -0
- package/packages/typescript/src/features/trajectories/types.d.ts.map +1 -0
- package/packages/typescript/src/features/trajectories/types.js +1 -0
- package/packages/typescript/src/features/trust/actions/evaluateTrust.d.ts +3 -0
- package/packages/typescript/src/features/trust/actions/evaluateTrust.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/evaluateTrust.js +225 -0
- package/packages/typescript/src/features/trust/actions/hasTrustEngine.d.ts +3 -0
- package/packages/typescript/src/features/trust/actions/hasTrustEngine.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/hasTrustEngine.js +3 -0
- package/packages/typescript/src/features/trust/actions/index.d.ts +6 -0
- package/packages/typescript/src/features/trust/actions/index.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/index.js +5 -0
- package/packages/typescript/src/features/trust/actions/recordTrustInteraction.d.ts +3 -0
- package/packages/typescript/src/features/trust/actions/recordTrustInteraction.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/recordTrustInteraction.js +189 -0
- package/packages/typescript/src/features/trust/actions/requestElevation.d.ts +3 -0
- package/packages/typescript/src/features/trust/actions/requestElevation.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/requestElevation.js +165 -0
- package/packages/typescript/src/features/trust/actions/roles.d.ts +3 -0
- package/packages/typescript/src/features/trust/actions/roles.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/roles.js +295 -0
- package/packages/typescript/src/features/trust/actions/settings.d.ts +5 -0
- package/packages/typescript/src/features/trust/actions/settings.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/actions/settings.js +603 -0
- package/packages/typescript/src/features/trust/evaluators/index.d.ts +4 -0
- package/packages/typescript/src/features/trust/evaluators/index.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/evaluators/index.js +3 -0
- package/packages/typescript/src/features/trust/evaluators/reflection.d.ts +3 -0
- package/packages/typescript/src/features/trust/evaluators/reflection.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/evaluators/reflection.js +290 -0
- package/packages/typescript/src/features/trust/evaluators/securityEvaluator.d.ts +3 -0
- package/packages/typescript/src/features/trust/evaluators/securityEvaluator.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/evaluators/securityEvaluator.js +270 -0
- package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.d.ts +3 -0
- package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/evaluators/trustChangeEvaluator.js +201 -0
- package/packages/typescript/src/features/trust/index.d.ts +72 -0
- package/packages/typescript/src/features/trust/index.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/index.js +213 -0
- package/packages/typescript/src/features/trust/providers/adminTrust.d.ts +3 -0
- package/packages/typescript/src/features/trust/providers/adminTrust.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/adminTrust.js +49 -0
- package/packages/typescript/src/features/trust/providers/index.d.ts +6 -0
- package/packages/typescript/src/features/trust/providers/index.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/index.js +5 -0
- package/packages/typescript/src/features/trust/providers/roles.d.ts +4 -0
- package/packages/typescript/src/features/trust/providers/roles.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/roles.js +142 -0
- package/packages/typescript/src/features/trust/providers/securityStatus.d.ts +3 -0
- package/packages/typescript/src/features/trust/providers/securityStatus.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/securityStatus.js +110 -0
- package/packages/typescript/src/features/trust/providers/settings.d.ts +3 -0
- package/packages/typescript/src/features/trust/providers/settings.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/settings.js +212 -0
- package/packages/typescript/src/features/trust/providers/trustProfile.d.ts +3 -0
- package/packages/typescript/src/features/trust/providers/trustProfile.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/providers/trustProfile.js +68 -0
- package/packages/typescript/src/features/trust/schema.d.ts +1170 -0
- package/packages/typescript/src/features/trust/schema.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/schema.js +108 -0
- package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.d.ts +40 -0
- package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/ContextualPermissionSystem.js +317 -0
- package/packages/typescript/src/features/trust/services/CredentialProtector.d.ts +62 -0
- package/packages/typescript/src/features/trust/services/CredentialProtector.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/CredentialProtector.js +417 -0
- package/packages/typescript/src/features/trust/services/SecurityModule.d.ts +142 -0
- package/packages/typescript/src/features/trust/services/SecurityModule.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/SecurityModule.js +1057 -0
- package/packages/typescript/src/features/trust/services/SecurityStore.d.ts +53 -0
- package/packages/typescript/src/features/trust/services/SecurityStore.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/SecurityStore.js +123 -0
- package/packages/typescript/src/features/trust/services/TrustEngine.d.ts +81 -0
- package/packages/typescript/src/features/trust/services/TrustEngine.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/TrustEngine.js +621 -0
- package/packages/typescript/src/features/trust/services/adminContext.d.ts +3 -0
- package/packages/typescript/src/features/trust/services/adminContext.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/adminContext.js +32 -0
- package/packages/typescript/src/features/trust/services/db.d.ts +12 -0
- package/packages/typescript/src/features/trust/services/db.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/services/db.js +10 -0
- package/packages/typescript/src/features/trust/types/permissions.d.ts +185 -0
- package/packages/typescript/src/features/trust/types/permissions.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/types/permissions.js +58 -0
- package/packages/typescript/src/features/trust/types/security.d.ts +114 -0
- package/packages/typescript/src/features/trust/types/security.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/types/security.js +15 -0
- package/packages/typescript/src/features/trust/types/trust.d.ts +179 -0
- package/packages/typescript/src/features/trust/types/trust.d.ts.map +1 -0
- package/packages/typescript/src/features/trust/types/trust.js +25 -0
- package/packages/typescript/src/generated/action-docs.d.ts +2605 -0
- package/packages/typescript/src/generated/action-docs.d.ts.map +1 -0
- package/packages/typescript/src/generated/action-docs.js +3786 -0
- package/packages/typescript/src/generated/spec-helpers.d.ts +49 -0
- package/packages/typescript/src/generated/spec-helpers.d.ts.map +1 -0
- package/packages/typescript/src/generated/spec-helpers.js +78 -0
- package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts +1056 -0
- package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts.map +1 -0
- package/packages/typescript/src/i18n/generated/validation-keyword-data.js +1056 -0
- package/packages/typescript/src/i18n/validation-keywords.d.ts +25 -0
- package/packages/typescript/src/i18n/validation-keywords.d.ts.map +1 -0
- package/packages/typescript/src/i18n/validation-keywords.js +112 -0
- package/packages/typescript/src/index.d.ts +12 -0
- package/packages/typescript/src/index.d.ts.map +1 -0
- package/packages/typescript/src/index.js +13 -0
- package/packages/typescript/src/index.node.d.ts +78 -0
- package/packages/typescript/src/index.node.d.ts.map +1 -0
- package/packages/typescript/src/index.node.js +107 -0
- package/packages/typescript/src/logger.d.ts +121 -0
- package/packages/typescript/src/logger.d.ts.map +1 -0
- package/packages/typescript/src/logger.js +1023 -0
- package/packages/typescript/src/markdown/chunk.d.ts +50 -0
- package/packages/typescript/src/markdown/chunk.d.ts.map +1 -0
- package/packages/typescript/src/markdown/chunk.js +268 -0
- package/packages/typescript/src/markdown/code-spans.d.ts +42 -0
- package/packages/typescript/src/markdown/code-spans.d.ts.map +1 -0
- package/packages/typescript/src/markdown/code-spans.js +89 -0
- package/packages/typescript/src/markdown/fences.d.ts +50 -0
- package/packages/typescript/src/markdown/fences.d.ts.map +1 -0
- package/packages/typescript/src/markdown/fences.js +90 -0
- package/packages/typescript/src/markdown/frontmatter.d.ts +24 -0
- package/packages/typescript/src/markdown/frontmatter.d.ts.map +1 -0
- package/packages/typescript/src/markdown/frontmatter.js +151 -0
- package/packages/typescript/src/markdown/index.d.ts +18 -0
- package/packages/typescript/src/markdown/index.d.ts.map +1 -0
- package/packages/typescript/src/markdown/index.js +17 -0
- package/packages/typescript/src/markdown/ir.d.ts +101 -0
- package/packages/typescript/src/markdown/ir.d.ts.map +1 -0
- package/packages/typescript/src/markdown/ir.js +789 -0
- package/packages/typescript/src/media/fetch.d.ts +39 -0
- package/packages/typescript/src/media/fetch.d.ts.map +1 -0
- package/packages/typescript/src/media/fetch.js +205 -0
- package/packages/typescript/src/media/index.d.ts +8 -0
- package/packages/typescript/src/media/index.d.ts.map +1 -0
- package/packages/typescript/src/media/index.js +7 -0
- package/packages/typescript/src/media/mime.d.ts +51 -0
- package/packages/typescript/src/media/mime.d.ts.map +1 -0
- package/packages/typescript/src/media/mime.js +225 -0
- package/packages/typescript/src/memory.d.ts +40 -0
- package/packages/typescript/src/memory.d.ts.map +1 -0
- package/packages/typescript/src/memory.js +58 -0
- package/packages/typescript/src/network/fetch-guard.d.ts +34 -0
- package/packages/typescript/src/network/fetch-guard.d.ts.map +1 -0
- package/packages/typescript/src/network/fetch-guard.js +136 -0
- package/packages/typescript/src/network/index.d.ts +11 -0
- package/packages/typescript/src/network/index.d.ts.map +1 -0
- package/packages/typescript/src/network/index.js +10 -0
- package/packages/typescript/src/network/ssrf.d.ts +58 -0
- package/packages/typescript/src/network/ssrf.d.ts.map +1 -0
- package/packages/typescript/src/network/ssrf.js +252 -0
- package/packages/typescript/src/plugin-lifecycle.d.ts +16 -0
- package/packages/typescript/src/plugin-lifecycle.d.ts.map +1 -0
- package/packages/typescript/src/plugin-lifecycle.js +590 -0
- package/packages/typescript/src/plugin.d.ts +13 -0
- package/packages/typescript/src/plugin.d.ts.map +1 -0
- package/packages/typescript/src/plugin.js +334 -0
- package/packages/typescript/src/plugins/index.d.ts +9 -0
- package/packages/typescript/src/plugins/index.d.ts.map +1 -0
- package/packages/typescript/src/plugins/index.js +8 -0
- package/packages/typescript/src/plugins/native-features.d.ts +14 -0
- package/packages/typescript/src/plugins/native-features.d.ts.map +1 -0
- package/packages/typescript/src/plugins/native-features.js +59 -0
- package/packages/typescript/src/prompts.d.ts +88 -0
- package/packages/typescript/src/prompts.d.ts.map +1 -0
- package/packages/typescript/src/prompts.js +1123 -0
- package/packages/typescript/src/providers/onboarding-progress.d.ts +19 -0
- package/packages/typescript/src/providers/onboarding-progress.d.ts.map +1 -0
- package/packages/typescript/src/providers/onboarding-progress.js +268 -0
- package/packages/typescript/src/providers/skill-eligibility.d.ts +28 -0
- package/packages/typescript/src/providers/skill-eligibility.d.ts.map +1 -0
- package/packages/typescript/src/providers/skill-eligibility.js +179 -0
- package/packages/typescript/src/provisioning.d.ts +54 -0
- package/packages/typescript/src/provisioning.d.ts.map +1 -0
- package/packages/typescript/src/provisioning.js +209 -0
- package/packages/typescript/src/roles.d.ts +70 -0
- package/packages/typescript/src/roles.d.ts.map +1 -0
- package/packages/typescript/src/roles.js +544 -0
- package/packages/typescript/src/runtime-composition.d.ts +129 -0
- package/packages/typescript/src/runtime-composition.d.ts.map +1 -0
- package/packages/typescript/src/runtime-composition.js +335 -0
- package/packages/typescript/src/runtime.d.ts +877 -0
- package/packages/typescript/src/runtime.d.ts.map +1 -0
- package/packages/typescript/src/runtime.js +5277 -0
- package/packages/typescript/src/schemas/agent.d.ts +7 -0
- package/packages/typescript/src/schemas/agent.d.ts.map +1 -0
- package/packages/typescript/src/schemas/agent.js +112 -0
- package/packages/typescript/src/schemas/cache.d.ts +7 -0
- package/packages/typescript/src/schemas/cache.d.ts.map +1 -0
- package/packages/typescript/src/schemas/cache.js +55 -0
- package/packages/typescript/src/schemas/channel-participant.d.ts +7 -0
- package/packages/typescript/src/schemas/channel-participant.d.ts.map +1 -0
- package/packages/typescript/src/schemas/channel-participant.js +49 -0
- package/packages/typescript/src/schemas/channel.d.ts +7 -0
- package/packages/typescript/src/schemas/channel.d.ts.map +1 -0
- package/packages/typescript/src/schemas/channel.js +94 -0
- package/packages/typescript/src/schemas/character.d.ts +445 -0
- package/packages/typescript/src/schemas/character.d.ts.map +1 -0
- package/packages/typescript/src/schemas/character.js +309 -0
- package/packages/typescript/src/schemas/component.d.ts +7 -0
- package/packages/typescript/src/schemas/component.d.ts.map +1 -0
- package/packages/typescript/src/schemas/component.js +156 -0
- package/packages/typescript/src/schemas/embedding.d.ts +7 -0
- package/packages/typescript/src/schemas/embedding.d.ts.map +1 -0
- package/packages/typescript/src/schemas/embedding.js +89 -0
- package/packages/typescript/src/schemas/entity.d.ts +7 -0
- package/packages/typescript/src/schemas/entity.d.ts.map +1 -0
- package/packages/typescript/src/schemas/entity.js +69 -0
- package/packages/typescript/src/schemas/index.d.ts +75 -0
- package/packages/typescript/src/schemas/index.d.ts.map +1 -0
- package/packages/typescript/src/schemas/index.js +74 -0
- package/packages/typescript/src/schemas/log.d.ts +6 -0
- package/packages/typescript/src/schemas/log.d.ts.map +1 -0
- package/packages/typescript/src/schemas/log.js +93 -0
- package/packages/typescript/src/schemas/memory.d.ts +7 -0
- package/packages/typescript/src/schemas/memory.d.ts.map +1 -0
- package/packages/typescript/src/schemas/memory.js +167 -0
- package/packages/typescript/src/schemas/message-server-agent.d.ts +7 -0
- package/packages/typescript/src/schemas/message-server-agent.d.ts.map +1 -0
- package/packages/typescript/src/schemas/message-server-agent.js +58 -0
- package/packages/typescript/src/schemas/message-server.d.ts +6 -0
- package/packages/typescript/src/schemas/message-server.d.ts.map +1 -0
- package/packages/typescript/src/schemas/message-server.js +62 -0
- package/packages/typescript/src/schemas/message.d.ts +7 -0
- package/packages/typescript/src/schemas/message.d.ts.map +1 -0
- package/packages/typescript/src/schemas/message.js +106 -0
- package/packages/typescript/src/schemas/pairing-allowlist.d.ts +7 -0
- package/packages/typescript/src/schemas/pairing-allowlist.d.ts.map +1 -0
- package/packages/typescript/src/schemas/pairing-allowlist.js +76 -0
- package/packages/typescript/src/schemas/pairing-request.d.ts +7 -0
- package/packages/typescript/src/schemas/pairing-request.d.ts.map +1 -0
- package/packages/typescript/src/schemas/pairing-request.js +96 -0
- package/packages/typescript/src/schemas/participant.d.ts +6 -0
- package/packages/typescript/src/schemas/participant.d.ts.map +1 -0
- package/packages/typescript/src/schemas/participant.js +91 -0
- package/packages/typescript/src/schemas/relationship.d.ts +7 -0
- package/packages/typescript/src/schemas/relationship.d.ts.map +1 -0
- package/packages/typescript/src/schemas/relationship.js +102 -0
- package/packages/typescript/src/schemas/room.d.ts +6 -0
- package/packages/typescript/src/schemas/room.d.ts.map +1 -0
- package/packages/typescript/src/schemas/room.js +86 -0
- package/packages/typescript/src/schemas/server.d.ts +7 -0
- package/packages/typescript/src/schemas/server.d.ts.map +1 -0
- package/packages/typescript/src/schemas/server.js +33 -0
- package/packages/typescript/src/schemas/task.d.ts +6 -0
- package/packages/typescript/src/schemas/task.d.ts.map +1 -0
- package/packages/typescript/src/schemas/task.js +95 -0
- package/packages/typescript/src/schemas/world.d.ts +6 -0
- package/packages/typescript/src/schemas/world.d.ts.map +1 -0
- package/packages/typescript/src/schemas/world.js +64 -0
- package/packages/typescript/src/search.d.ts +381 -0
- package/packages/typescript/src/search.d.ts.map +1 -0
- package/packages/typescript/src/search.js +1580 -0
- package/packages/typescript/src/secrets.d.ts +6 -0
- package/packages/typescript/src/secrets.d.ts.map +1 -0
- package/packages/typescript/src/secrets.js +28 -0
- package/packages/typescript/src/security/external-content.d.ts +96 -0
- package/packages/typescript/src/security/external-content.d.ts.map +1 -0
- package/packages/typescript/src/security/external-content.js +252 -0
- package/packages/typescript/src/security/index.d.ts +12 -0
- package/packages/typescript/src/security/index.d.ts.map +1 -0
- package/packages/typescript/src/security/index.js +13 -0
- package/packages/typescript/src/security/redact.d.ts +111 -0
- package/packages/typescript/src/security/redact.d.ts.map +1 -0
- package/packages/typescript/src/security/redact.js +254 -0
- package/packages/typescript/src/services/agentEvent.d.ts +297 -0
- package/packages/typescript/src/services/agentEvent.d.ts.map +1 -0
- package/packages/typescript/src/services/agentEvent.js +422 -0
- package/packages/typescript/src/services/approval.d.ts +169 -0
- package/packages/typescript/src/services/approval.d.ts.map +1 -0
- package/packages/typescript/src/services/approval.js +399 -0
- package/packages/typescript/src/services/embedding.d.ts +29 -0
- package/packages/typescript/src/services/embedding.d.ts.map +1 -0
- package/packages/typescript/src/services/embedding.js +211 -0
- package/packages/typescript/src/services/followUp.d.ts +48 -0
- package/packages/typescript/src/services/followUp.d.ts.map +1 -0
- package/packages/typescript/src/services/followUp.js +333 -0
- package/packages/typescript/src/services/hook.d.ts +85 -0
- package/packages/typescript/src/services/hook.d.ts.map +1 -0
- package/packages/typescript/src/services/hook.js +396 -0
- package/packages/typescript/src/services/message.d.ts +93 -0
- package/packages/typescript/src/services/message.d.ts.map +1 -0
- package/packages/typescript/src/services/message.js +3163 -0
- package/packages/typescript/src/services/onboarding-cli.d.ts +240 -0
- package/packages/typescript/src/services/onboarding-cli.d.ts.map +1 -0
- package/packages/typescript/src/services/onboarding-cli.js +688 -0
- package/packages/typescript/src/services/onboarding-rpc.d.ts +225 -0
- package/packages/typescript/src/services/onboarding-rpc.d.ts.map +1 -0
- package/packages/typescript/src/services/onboarding-rpc.js +318 -0
- package/packages/typescript/src/services/onboarding-state.d.ts +155 -0
- package/packages/typescript/src/services/onboarding-state.d.ts.map +1 -0
- package/packages/typescript/src/services/onboarding-state.js +706 -0
- package/packages/typescript/src/services/pairing-integration.d.ts +96 -0
- package/packages/typescript/src/services/pairing-integration.d.ts.map +1 -0
- package/packages/typescript/src/services/pairing-integration.js +145 -0
- package/packages/typescript/src/services/pairing-migration.d.ts +105 -0
- package/packages/typescript/src/services/pairing-migration.d.ts.map +1 -0
- package/packages/typescript/src/services/pairing-migration.js +283 -0
- package/packages/typescript/src/services/pairing.d.ts +80 -0
- package/packages/typescript/src/services/pairing.d.ts.map +1 -0
- package/packages/typescript/src/services/pairing.js +253 -0
- package/packages/typescript/src/services/plugin-hooks.d.ts +112 -0
- package/packages/typescript/src/services/plugin-hooks.d.ts.map +1 -0
- package/packages/typescript/src/services/plugin-hooks.js +163 -0
- package/packages/typescript/src/services/relationships.d.ts +125 -0
- package/packages/typescript/src/services/relationships.d.ts.map +1 -0
- package/packages/typescript/src/services/relationships.js +637 -0
- package/packages/typescript/src/services/task-scheduler.d.ts +28 -0
- package/packages/typescript/src/services/task-scheduler.d.ts.map +1 -0
- package/packages/typescript/src/services/task-scheduler.js +89 -0
- package/packages/typescript/src/services/task.d.ts +130 -0
- package/packages/typescript/src/services/task.d.ts.map +1 -0
- package/packages/typescript/src/services/task.js +536 -0
- package/packages/typescript/src/services/tool-policy.d.ts +186 -0
- package/packages/typescript/src/services/tool-policy.d.ts.map +1 -0
- package/packages/typescript/src/services/tool-policy.js +332 -0
- package/packages/typescript/src/services/trajectories.d.ts +25 -0
- package/packages/typescript/src/services/trajectories.d.ts.map +1 -0
- package/packages/typescript/src/services/trajectories.js +1 -0
- package/packages/typescript/src/services.d.ts +61 -0
- package/packages/typescript/src/services.d.ts.map +1 -0
- package/packages/typescript/src/services.js +99 -0
- package/packages/typescript/src/sessions/index.d.ts +17 -0
- package/packages/typescript/src/sessions/index.d.ts.map +1 -0
- package/packages/typescript/src/sessions/index.js +29 -0
- package/packages/typescript/src/sessions/provider.d.ts +71 -0
- package/packages/typescript/src/sessions/provider.d.ts.map +1 -0
- package/packages/typescript/src/sessions/provider.js +243 -0
- package/packages/typescript/src/sessions/session-key.d.ts +201 -0
- package/packages/typescript/src/sessions/session-key.d.ts.map +1 -0
- package/packages/typescript/src/sessions/session-key.js +396 -0
- package/packages/typescript/src/sessions/types.d.ts +197 -0
- package/packages/typescript/src/sessions/types.d.ts.map +1 -0
- package/packages/typescript/src/sessions/types.js +68 -0
- package/packages/typescript/src/settings.d.ts +99 -0
- package/packages/typescript/src/settings.d.ts.map +1 -0
- package/packages/typescript/src/settings.js +409 -0
- package/packages/typescript/src/should-respond.d.ts +2 -0
- package/packages/typescript/src/should-respond.d.ts.map +1 -0
- package/packages/typescript/src/should-respond.js +16 -0
- package/packages/typescript/src/streaming-context.d.ts +79 -0
- package/packages/typescript/src/streaming-context.d.ts.map +1 -0
- package/packages/typescript/src/streaming-context.js +115 -0
- package/packages/typescript/src/trajectory-context.d.ts +26 -0
- package/packages/typescript/src/trajectory-context.d.ts.map +1 -0
- package/packages/typescript/src/trajectory-context.js +85 -0
- package/packages/typescript/src/trajectory-utils.d.ts +49 -0
- package/packages/typescript/src/trajectory-utils.d.ts.map +1 -0
- package/packages/typescript/src/trajectory-utils.js +105 -0
- package/packages/typescript/src/types/agent.d.ts +62 -0
- package/packages/typescript/src/types/agent.d.ts.map +1 -0
- package/packages/typescript/src/types/agent.js +5 -0
- package/packages/typescript/src/types/agentEvent.d.ts +258 -0
- package/packages/typescript/src/types/agentEvent.d.ts.map +1 -0
- package/packages/typescript/src/types/agentEvent.js +11 -0
- package/packages/typescript/src/types/channel-config.d.ts +167 -0
- package/packages/typescript/src/types/channel-config.d.ts.map +1 -0
- package/packages/typescript/src/types/channel-config.js +7 -0
- package/packages/typescript/src/types/components.d.ts +346 -0
- package/packages/typescript/src/types/components.d.ts.map +1 -0
- package/packages/typescript/src/types/components.js +1 -0
- package/packages/typescript/src/types/database.d.ts +1079 -0
- package/packages/typescript/src/types/database.d.ts.map +1 -0
- package/packages/typescript/src/types/database.js +9 -0
- package/packages/typescript/src/types/environment.d.ts +73 -0
- package/packages/typescript/src/types/environment.d.ts.map +1 -0
- package/packages/typescript/src/types/environment.js +16 -0
- package/packages/typescript/src/types/events.d.ts +386 -0
- package/packages/typescript/src/types/events.d.ts.map +1 -0
- package/packages/typescript/src/types/events.js +83 -0
- package/packages/typescript/src/types/generated/eliza/v1/agent_pb.d.ts +400 -0
- package/packages/typescript/src/types/generated/eliza/v1/agent_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/agent_pb.js +72 -0
- package/packages/typescript/src/types/generated/eliza/v1/components_pb.d.ts +364 -0
- package/packages/typescript/src/types/generated/eliza/v1/components_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/components_pb.js +68 -0
- package/packages/typescript/src/types/generated/eliza/v1/database_pb.d.ts +694 -0
- package/packages/typescript/src/types/generated/eliza/v1/database_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/database_pb.js +172 -0
- package/packages/typescript/src/types/generated/eliza/v1/environment_pb.d.ts +299 -0
- package/packages/typescript/src/types/generated/eliza/v1/environment_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/environment_pb.js +52 -0
- package/packages/typescript/src/types/generated/eliza/v1/events_pb.d.ts +746 -0
- package/packages/typescript/src/types/generated/eliza/v1/events_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/events_pb.js +357 -0
- package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.d.ts +799 -0
- package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/ipc_pb.js +172 -0
- package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.d.ts +63 -0
- package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/knowledge_pb.js +18 -0
- package/packages/typescript/src/types/generated/eliza/v1/memory_pb.d.ts +290 -0
- package/packages/typescript/src/types/generated/eliza/v1/memory_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/memory_pb.js +53 -0
- package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.d.ts +160 -0
- package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/message_service_pb.js +88 -0
- package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.d.ts +214 -0
- package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/messaging_pb.js +78 -0
- package/packages/typescript/src/types/generated/eliza/v1/model_pb.d.ts +653 -0
- package/packages/typescript/src/types/generated/eliza/v1/model_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/model_pb.js +237 -0
- package/packages/typescript/src/types/generated/eliza/v1/payment_pb.d.ts +147 -0
- package/packages/typescript/src/types/generated/eliza/v1/payment_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/payment_pb.js +27 -0
- package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.d.ts +286 -0
- package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/plugin_pb.js +86 -0
- package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.d.ts +263 -0
- package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/primitives_pb.js +38 -0
- package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.d.ts +137 -0
- package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/prompts_pb.js +27 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.d.ts +2687 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_interfaces_pb.js +392 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_pb.d.ts +144 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/service_pb.js +99 -0
- package/packages/typescript/src/types/generated/eliza/v1/settings_pb.d.ts +146 -0
- package/packages/typescript/src/types/generated/eliza/v1/settings_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/settings_pb.js +32 -0
- package/packages/typescript/src/types/generated/eliza/v1/state_pb.d.ts +259 -0
- package/packages/typescript/src/types/generated/eliza/v1/state_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/state_pb.js +44 -0
- package/packages/typescript/src/types/generated/eliza/v1/task_pb.d.ts +120 -0
- package/packages/typescript/src/types/generated/eliza/v1/task_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/task_pb.js +53 -0
- package/packages/typescript/src/types/generated/eliza/v1/tee_pb.d.ts +205 -0
- package/packages/typescript/src/types/generated/eliza/v1/tee_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/tee_pb.js +89 -0
- package/packages/typescript/src/types/generated/eliza/v1/testing_pb.d.ts +47 -0
- package/packages/typescript/src/types/generated/eliza/v1/testing_pb.d.ts.map +1 -0
- package/packages/typescript/src/types/generated/eliza/v1/testing_pb.js +16 -0
- package/packages/typescript/src/types/hook.d.ts +338 -0
- package/packages/typescript/src/types/hook.d.ts.map +1 -0
- package/packages/typescript/src/types/hook.js +73 -0
- package/packages/typescript/src/types/index.d.ts +38 -0
- package/packages/typescript/src/types/index.d.ts.map +1 -0
- package/packages/typescript/src/types/index.js +46 -0
- package/packages/typescript/src/types/knowledge.d.ts +49 -0
- package/packages/typescript/src/types/knowledge.d.ts.map +1 -0
- package/packages/typescript/src/types/knowledge.js +1 -0
- package/packages/typescript/src/types/memory-storage.d.ts +28 -0
- package/packages/typescript/src/types/memory-storage.d.ts.map +1 -0
- package/packages/typescript/src/types/memory-storage.js +13 -0
- package/packages/typescript/src/types/memory.d.ts +438 -0
- package/packages/typescript/src/types/memory.d.ts.map +1 -0
- package/packages/typescript/src/types/memory.js +16 -0
- package/packages/typescript/src/types/message-service.d.ts +169 -0
- package/packages/typescript/src/types/message-service.d.ts.map +1 -0
- package/packages/typescript/src/types/message-service.js +1 -0
- package/packages/typescript/src/types/messaging.d.ts +358 -0
- package/packages/typescript/src/types/messaging.d.ts.map +1 -0
- package/packages/typescript/src/types/messaging.js +27 -0
- package/packages/typescript/src/types/model.d.ts +697 -0
- package/packages/typescript/src/types/model.d.ts.map +1 -0
- package/packages/typescript/src/types/model.js +247 -0
- package/packages/typescript/src/types/onboarding.d.ts +319 -0
- package/packages/typescript/src/types/onboarding.d.ts.map +1 -0
- package/packages/typescript/src/types/onboarding.js +97 -0
- package/packages/typescript/src/types/pairing.d.ts +124 -0
- package/packages/typescript/src/types/pairing.d.ts.map +1 -0
- package/packages/typescript/src/types/pairing.js +32 -0
- package/packages/typescript/src/types/payment.d.ts +45 -0
- package/packages/typescript/src/types/payment.d.ts.map +1 -0
- package/packages/typescript/src/types/payment.js +1 -0
- package/packages/typescript/src/types/plugin-manifest.d.ts +381 -0
- package/packages/typescript/src/types/plugin-manifest.d.ts.map +1 -0
- package/packages/typescript/src/types/plugin-manifest.js +10 -0
- package/packages/typescript/src/types/plugin-store.d.ts +173 -0
- package/packages/typescript/src/types/plugin-store.d.ts.map +1 -0
- package/packages/typescript/src/types/plugin-store.js +1 -0
- package/packages/typescript/src/types/plugin.d.ts +325 -0
- package/packages/typescript/src/types/plugin.d.ts.map +1 -0
- package/packages/typescript/src/types/plugin.js +1 -0
- package/packages/typescript/src/types/primitives.d.ts +176 -0
- package/packages/typescript/src/types/primitives.d.ts.map +1 -0
- package/packages/typescript/src/types/primitives.js +41 -0
- package/packages/typescript/src/types/prompt-batcher.d.ts +126 -0
- package/packages/typescript/src/types/prompt-batcher.d.ts.map +1 -0
- package/packages/typescript/src/types/prompt-batcher.js +6 -0
- package/packages/typescript/src/types/prompts.d.ts +39 -0
- package/packages/typescript/src/types/prompts.d.ts.map +1 -0
- package/packages/typescript/src/types/prompts.js +7 -0
- package/packages/typescript/src/types/proto.d.ts +60 -0
- package/packages/typescript/src/types/proto.d.ts.map +1 -0
- package/packages/typescript/src/types/proto.js +53 -0
- package/packages/typescript/src/types/runtime.d.ts +394 -0
- package/packages/typescript/src/types/runtime.d.ts.map +1 -0
- package/packages/typescript/src/types/runtime.js +1 -0
- package/packages/typescript/src/types/schema-builder.d.ts +43 -0
- package/packages/typescript/src/types/schema-builder.d.ts.map +1 -0
- package/packages/typescript/src/types/schema-builder.js +16 -0
- package/packages/typescript/src/types/schema.d.ts +99 -0
- package/packages/typescript/src/types/schema.d.ts.map +1 -0
- package/packages/typescript/src/types/schema.js +11 -0
- package/packages/typescript/src/types/service-interfaces.d.ts +1200 -0
- package/packages/typescript/src/types/service-interfaces.d.ts.map +1 -0
- package/packages/typescript/src/types/service-interfaces.js +81 -0
- package/packages/typescript/src/types/service.d.ts +173 -0
- package/packages/typescript/src/types/service.d.ts.map +1 -0
- package/packages/typescript/src/types/service.js +78 -0
- package/packages/typescript/src/types/settings.d.ts +36 -0
- package/packages/typescript/src/types/settings.d.ts.map +1 -0
- package/packages/typescript/src/types/settings.js +1 -0
- package/packages/typescript/src/types/state.d.ts +251 -0
- package/packages/typescript/src/types/state.d.ts.map +1 -0
- package/packages/typescript/src/types/state.js +1 -0
- package/packages/typescript/src/types/streaming.d.ts +93 -0
- package/packages/typescript/src/types/streaming.d.ts.map +1 -0
- package/packages/typescript/src/types/streaming.js +21 -0
- package/packages/typescript/src/types/task.d.ts +122 -0
- package/packages/typescript/src/types/task.d.ts.map +1 -0
- package/packages/typescript/src/types/task.js +1 -0
- package/packages/typescript/src/types/tee.d.ts +3 -0
- package/packages/typescript/src/types/tee.d.ts.map +1 -0
- package/packages/typescript/src/types/tee.js +1 -0
- package/packages/typescript/src/types/testing.d.ts +15 -0
- package/packages/typescript/src/types/testing.d.ts.map +1 -0
- package/packages/typescript/src/types/testing.js +1 -0
- package/packages/typescript/src/types/tools.d.ts +166 -0
- package/packages/typescript/src/types/tools.d.ts.map +1 -0
- package/packages/typescript/src/types/tools.js +380 -0
- package/packages/typescript/src/types/trigger.d.ts +38 -0
- package/packages/typescript/src/types/trigger.d.ts.map +1 -0
- package/packages/typescript/src/types/trigger.js +1 -0
- package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts +53 -0
- package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue/batch-processor.js +129 -0
- package/packages/typescript/src/utils/batch-queue/index.d.ts +97 -0
- package/packages/typescript/src/utils/batch-queue/index.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue/index.js +175 -0
- package/packages/typescript/src/utils/batch-queue/priority-queue.d.ts +53 -0
- package/packages/typescript/src/utils/batch-queue/priority-queue.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue/priority-queue.js +128 -0
- package/packages/typescript/src/utils/batch-queue/semaphore.d.ts +18 -0
- package/packages/typescript/src/utils/batch-queue/semaphore.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue/semaphore.js +34 -0
- package/packages/typescript/src/utils/batch-queue/task-drain.d.ts +57 -0
- package/packages/typescript/src/utils/batch-queue/task-drain.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue/task-drain.js +150 -0
- package/packages/typescript/src/utils/batch-queue.d.ts +20 -0
- package/packages/typescript/src/utils/batch-queue.d.ts.map +1 -0
- package/packages/typescript/src/utils/batch-queue.js +19 -0
- package/packages/typescript/src/utils/boolean.d.ts +50 -0
- package/packages/typescript/src/utils/boolean.d.ts.map +1 -0
- package/packages/typescript/src/utils/boolean.js +73 -0
- package/packages/typescript/src/utils/buffer.d.ts +107 -0
- package/packages/typescript/src/utils/buffer.d.ts.map +1 -0
- package/packages/typescript/src/utils/buffer.js +229 -0
- package/packages/typescript/src/utils/channel-utils.d.ts +274 -0
- package/packages/typescript/src/utils/channel-utils.d.ts.map +1 -0
- package/packages/typescript/src/utils/channel-utils.js +337 -0
- package/packages/typescript/src/utils/context-catalog.d.ts +6 -0
- package/packages/typescript/src/utils/context-catalog.d.ts.map +1 -0
- package/packages/typescript/src/utils/context-catalog.js +126 -0
- package/packages/typescript/src/utils/context-routing.d.ts +25 -0
- package/packages/typescript/src/utils/context-routing.d.ts.map +1 -0
- package/packages/typescript/src/utils/context-routing.js +160 -0
- package/packages/typescript/src/utils/crypto-compat.d.ts +83 -0
- package/packages/typescript/src/utils/crypto-compat.d.ts.map +1 -0
- package/packages/typescript/src/utils/crypto-compat.js +368 -0
- package/packages/typescript/src/utils/deterministic.d.ts +9 -0
- package/packages/typescript/src/utils/deterministic.d.ts.map +1 -0
- package/packages/typescript/src/utils/deterministic.js +70 -0
- package/packages/typescript/src/utils/environment.d.ts +125 -0
- package/packages/typescript/src/utils/environment.d.ts.map +1 -0
- package/packages/typescript/src/utils/environment.js +290 -0
- package/packages/typescript/src/utils/example-names.d.ts +3 -0
- package/packages/typescript/src/utils/example-names.d.ts.map +1 -0
- package/packages/typescript/src/utils/example-names.js +30 -0
- package/packages/typescript/src/utils/json-llm.d.ts +17 -0
- package/packages/typescript/src/utils/json-llm.d.ts.map +1 -0
- package/packages/typescript/src/utils/json-llm.js +32 -0
- package/packages/typescript/src/utils/model-errors.d.ts +3 -0
- package/packages/typescript/src/utils/model-errors.d.ts.map +1 -0
- package/packages/typescript/src/utils/model-errors.js +23 -0
- package/packages/typescript/src/utils/node.d.ts +8 -0
- package/packages/typescript/src/utils/node.d.ts.map +1 -0
- package/packages/typescript/src/utils/node.js +12 -0
- package/packages/typescript/src/utils/paths.d.ts +97 -0
- package/packages/typescript/src/utils/paths.d.ts.map +1 -0
- package/packages/typescript/src/utils/paths.js +204 -0
- package/packages/typescript/src/utils/prompt-batcher/batcher.d.ts +163 -0
- package/packages/typescript/src/utils/prompt-batcher/batcher.d.ts.map +1 -0
- package/packages/typescript/src/utils/prompt-batcher/batcher.js +896 -0
- package/packages/typescript/src/utils/prompt-batcher/dispatcher.d.ts +15 -0
- package/packages/typescript/src/utils/prompt-batcher/dispatcher.d.ts.map +1 -0
- package/packages/typescript/src/utils/prompt-batcher/dispatcher.js +230 -0
- package/packages/typescript/src/utils/prompt-batcher/shared.d.ts +66 -0
- package/packages/typescript/src/utils/prompt-batcher/shared.d.ts.map +1 -0
- package/packages/typescript/src/utils/prompt-batcher/shared.js +101 -0
- package/packages/typescript/src/utils/prompt-batcher.d.ts +5 -0
- package/packages/typescript/src/utils/prompt-batcher.d.ts.map +1 -0
- package/packages/typescript/src/utils/prompt-batcher.js +4 -0
- package/packages/typescript/src/utils/retry.d.ts +128 -0
- package/packages/typescript/src/utils/retry.d.ts.map +1 -0
- package/packages/typescript/src/utils/retry.js +190 -0
- package/packages/typescript/src/utils/server-health.d.ts +35 -0
- package/packages/typescript/src/utils/server-health.d.ts.map +1 -0
- package/packages/typescript/src/utils/server-health.js +76 -0
- package/packages/typescript/src/utils/slice-to-fit-budget.d.ts +12 -0
- package/packages/typescript/src/utils/slice-to-fit-budget.d.ts.map +1 -0
- package/packages/typescript/src/utils/slice-to-fit-budget.js +36 -0
- package/packages/typescript/src/utils/streaming.d.ts +275 -0
- package/packages/typescript/src/utils/streaming.d.ts.map +1 -0
- package/packages/typescript/src/utils/streaming.js +774 -0
- package/packages/typescript/src/utils/text-normalize.d.ts +23 -0
- package/packages/typescript/src/utils/text-normalize.d.ts.map +1 -0
- package/packages/typescript/src/utils/text-normalize.js +42 -0
- package/packages/typescript/src/utils/text-splitting.d.ts +14 -0
- package/packages/typescript/src/utils/text-splitting.d.ts.map +1 -0
- package/packages/typescript/src/utils/text-splitting.js +66 -0
- package/packages/typescript/src/utils/toon.d.ts +8 -0
- package/packages/typescript/src/utils/toon.d.ts.map +1 -0
- package/packages/typescript/src/utils/toon.js +325 -0
- package/packages/typescript/src/utils/type-guards.d.ts +25 -0
- package/packages/typescript/src/utils/type-guards.d.ts.map +1 -0
- package/packages/typescript/src/utils/type-guards.js +73 -0
- package/packages/typescript/src/utils.d.ts +190 -0
- package/packages/typescript/src/utils.d.ts.map +1 -0
- package/packages/typescript/src/utils.js +1115 -0
- package/packages/typescript/src/validation/index.d.ts +8 -0
- package/packages/typescript/src/validation/index.d.ts.map +1 -0
- package/packages/typescript/src/validation/index.js +7 -0
- package/packages/typescript/src/validation/keywords.d.ts +26 -0
- package/packages/typescript/src/validation/keywords.d.ts.map +1 -0
- package/packages/typescript/src/validation/keywords.js +76 -0
- package/packages/typescript/src/validation/secrets.d.ts +94 -0
- package/packages/typescript/src/validation/secrets.d.ts.map +1 -0
- package/packages/typescript/src/validation/secrets.js +399 -0
- package/jest.config.js +0 -17
- package/src/__tests__/client-type-identification.test.ts +0 -59
- package/src/defaultCharacter.ts +0 -530
- package/src/index.ts +0 -911
- 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("&", "&")
|
|
1035
|
+
.replaceAll("<", "<")
|
|
1036
|
+
.replaceAll(">", ">"));
|
|
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
|
+
}
|