@elizaos/agent 2.0.0-alpha.144 → 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/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/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.map +1 -0
- package/apps/app-lifeops/src/inbox/config.d.ts.map +1 -0
- package/{packages/agent → apps/app-lifeops}/src/inbox/config.js +1 -1
- package/apps/app-lifeops/src/inbox/message-fetcher.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/reflection.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/repository.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/triage-classifier.d.ts.map +1 -0
- package/apps/app-lifeops/src/inbox/types.d.ts.map +1 -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/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/plugin.d.ts +3 -0
- package/apps/app-lifeops/src/plugin.d.ts.map +1 -1
- package/apps/app-lifeops/src/plugin.js +16 -3
- 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/package.json +6 -4
- package/packages/agent/src/actions/calendar.d.ts +1 -18
- package/packages/agent/src/actions/calendar.d.ts.map +1 -1
- package/packages/agent/src/actions/calendar.js +1 -3143
- 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 +1 -1
- package/packages/agent/src/actions/context-signal-lexicon.d.ts.map +1 -1
- package/packages/agent/src/actions/context-signal-lexicon.js +6 -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/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 +1 -32
- package/packages/agent/src/actions/gmail.d.ts.map +1 -1
- package/packages/agent/src/actions/gmail.js +1 -1734
- package/packages/agent/src/actions/inbox-digest.d.ts +1 -1
- package/packages/agent/src/actions/inbox-digest.d.ts.map +1 -1
- package/packages/agent/src/actions/inbox-digest.js +1 -1
- package/packages/agent/src/actions/inbox-respond.d.ts +1 -1
- package/packages/agent/src/actions/inbox-respond.d.ts.map +1 -1
- package/packages/agent/src/actions/inbox-respond.js +1 -1
- package/packages/agent/src/actions/inbox-triage.d.ts +1 -1
- package/packages/agent/src/actions/inbox-triage.d.ts.map +1 -1
- package/packages/agent/src/actions/inbox-triage.js +1 -1
- package/packages/agent/src/actions/inbox.d.ts +1 -2
- package/packages/agent/src/actions/inbox.d.ts.map +1 -1
- package/packages/agent/src/actions/inbox.js +1 -856
- package/packages/agent/src/actions/index.d.ts +13 -0
- package/packages/agent/src/actions/index.d.ts.map +1 -1
- package/packages/agent/src/actions/index.js +13 -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 +1 -68
- package/packages/agent/src/actions/life-goal-extractor.d.ts.map +1 -1
- package/packages/agent/src/actions/life-goal-extractor.js +1 -354
- package/packages/agent/src/actions/life-param-extractor.d.ts +1 -77
- package/packages/agent/src/actions/life-param-extractor.d.ts.map +1 -1
- package/packages/agent/src/actions/life-param-extractor.js +1 -423
- package/packages/agent/src/actions/life-recent-context.d.ts +1 -8
- package/packages/agent/src/actions/life-recent-context.d.ts.map +1 -1
- package/packages/agent/src/actions/life-recent-context.js +1 -84
- package/packages/agent/src/actions/life-update-extractor.d.ts +1 -26
- package/packages/agent/src/actions/life-update-extractor.d.ts.map +1 -1
- package/packages/agent/src/actions/life-update-extractor.js +1 -195
- package/packages/agent/src/actions/life.d.ts +1 -8
- package/packages/agent/src/actions/life.d.ts.map +1 -1
- package/packages/agent/src/actions/life.extractor.d.ts +1 -17
- package/packages/agent/src/actions/life.extractor.d.ts.map +1 -1
- package/packages/agent/src/actions/life.extractor.js +1 -264
- package/packages/agent/src/actions/life.js +1 -3379
- package/packages/agent/src/actions/lifeops-extraction-config.d.ts +1 -15
- package/packages/agent/src/actions/lifeops-extraction-config.d.ts.map +1 -1
- package/packages/agent/src/actions/lifeops-extraction-config.js +1 -25
- package/packages/agent/src/actions/lifeops-google-helpers.d.ts +1 -61
- package/packages/agent/src/actions/lifeops-google-helpers.d.ts.map +1 -1
- package/packages/agent/src/actions/lifeops-google-helpers.js +1 -607
- 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.map +1 -1
- package/packages/agent/src/actions/manage-tasks.js +51 -15
- 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-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/send-message.d.ts +0 -7
- package/packages/agent/src/actions/send-message.d.ts.map +1 -1
- package/packages/agent/src/actions/send-message.js +170 -49
- 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/timezone-normalization.d.ts +1 -2
- package/packages/agent/src/actions/timezone-normalization.d.ts.map +1 -1
- package/packages/agent/src/actions/timezone-normalization.js +1 -107
- 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 +1 -2
- package/packages/agent/src/actions/update-owner-profile.d.ts.map +1 -1
- package/packages/agent/src/actions/update-owner-profile.js +1 -131
- 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/api/agent-admin-routes.d.ts.map +1 -1
- package/packages/agent/src/api/agent-admin-routes.js +1 -1
- package/packages/agent/src/api/binance-skill-helpers.d.ts.map +1 -1
- package/packages/agent/src/api/binance-skill-helpers.js +8 -3
- package/packages/agent/src/api/chat-routes.d.ts.map +1 -1
- package/packages/agent/src/api/chat-routes.js +20 -5
- package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts +1 -22
- package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts.map +1 -1
- package/packages/agent/src/api/coding-agents-auth-sanitize.js +1 -39
- package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts +1 -28
- package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts.map +1 -1
- package/packages/agent/src/api/coding-agents-preflight-normalize.js +1 -45
- package/packages/agent/src/api/coordinator-types.d.ts +1 -46
- package/packages/agent/src/api/coordinator-types.d.ts.map +1 -1
- package/packages/agent/src/api/coordinator-types.js +1 -1
- package/packages/agent/src/api/coordinator-wiring.d.ts +1 -45
- package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -1
- package/packages/agent/src/api/coordinator-wiring.js +1 -108
- package/packages/agent/src/api/index.d.ts +1 -1
- package/packages/agent/src/api/index.d.ts.map +1 -1
- package/packages/agent/src/api/index.js +1 -1
- package/packages/agent/src/api/lifeops-browser-packaging.d.ts +1 -15
- package/packages/agent/src/api/lifeops-browser-packaging.d.ts.map +1 -1
- package/packages/agent/src/api/lifeops-browser-packaging.js +1 -305
- package/packages/agent/src/api/lifeops-routes.d.ts +1 -19
- package/packages/agent/src/api/lifeops-routes.d.ts.map +1 -1
- package/packages/agent/src/api/lifeops-routes.js +1 -1173
- package/packages/agent/src/api/server.d.ts.map +1 -1
- package/packages/agent/src/api/server.js +6 -6
- package/packages/agent/src/api/task-agent-message-routing.d.ts +1 -9
- package/packages/agent/src/api/task-agent-message-routing.d.ts.map +1 -1
- package/packages/agent/src/api/task-agent-message-routing.js +1 -62
- package/packages/agent/src/api/website-blocker-routes.d.ts +1 -6
- package/packages/agent/src/api/website-blocker-routes.d.ts.map +1 -1
- package/packages/agent/src/api/website-blocker-routes.js +1 -174
- package/packages/agent/src/config/types.agent-defaults.d.ts +1 -1
- package/packages/agent/src/config/types.agent-defaults.d.ts.map +1 -1
- package/packages/agent/src/evals/coordinator-eval-client.d.ts +1 -38
- package/packages/agent/src/evals/coordinator-eval-client.d.ts.map +1 -1
- package/packages/agent/src/evals/coordinator-eval-client.js +1 -138
- package/packages/agent/src/evals/coordinator-live-runner.d.ts +1 -56
- package/packages/agent/src/evals/coordinator-live-runner.d.ts.map +1 -1
- package/packages/agent/src/evals/coordinator-live-runner.js +1 -546
- package/packages/agent/src/evals/coordinator-preflight.d.ts +1 -31
- package/packages/agent/src/evals/coordinator-preflight.d.ts.map +1 -1
- package/packages/agent/src/evals/coordinator-preflight.js +1 -296
- package/packages/agent/src/evals/coordinator-scenarios.d.ts +1 -23
- package/packages/agent/src/evals/coordinator-scenarios.d.ts.map +1 -1
- package/packages/agent/src/evals/coordinator-scenarios.js +1 -1141
- package/packages/agent/src/lifeops/app-state.d.ts +1 -10
- package/packages/agent/src/lifeops/app-state.d.ts.map +1 -1
- package/packages/agent/src/lifeops/app-state.js +1 -32
- package/packages/agent/src/lifeops/apple-reminders.d.ts +1 -57
- package/packages/agent/src/lifeops/apple-reminders.d.ts.map +1 -1
- package/packages/agent/src/lifeops/apple-reminders.js +1 -325
- package/packages/agent/src/lifeops/defaults.d.ts +1 -23
- package/packages/agent/src/lifeops/defaults.d.ts.map +1 -1
- package/packages/agent/src/lifeops/defaults.js +1 -205
- package/packages/agent/src/lifeops/engine.d.ts +1 -7
- package/packages/agent/src/lifeops/engine.d.ts.map +1 -1
- package/packages/agent/src/lifeops/engine.js +1 -389
- package/packages/agent/src/lifeops/goal-grounding.d.ts +1 -53
- package/packages/agent/src/lifeops/goal-grounding.d.ts.map +1 -1
- package/packages/agent/src/lifeops/goal-grounding.js +1 -147
- package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts +1 -11
- package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts.map +1 -1
- package/packages/agent/src/lifeops/goal-semantic-evaluator.js +1 -154
- package/packages/agent/src/lifeops/google-api-error.d.ts +1 -6
- package/packages/agent/src/lifeops/google-api-error.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-api-error.js +1 -35
- package/packages/agent/src/lifeops/google-calendar.d.ts +1 -52
- package/packages/agent/src/lifeops/google-calendar.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-calendar.js +1 -268
- package/packages/agent/src/lifeops/google-connector-gateway.d.ts +1 -18
- package/packages/agent/src/lifeops/google-connector-gateway.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-connector-gateway.js +1 -65
- package/packages/agent/src/lifeops/google-fetch.d.ts +1 -10
- package/packages/agent/src/lifeops/google-fetch.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-fetch.js +1 -85
- package/packages/agent/src/lifeops/google-gmail.d.ts +1 -53
- package/packages/agent/src/lifeops/google-gmail.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-gmail.js +1 -471
- package/packages/agent/src/lifeops/google-managed-client.d.ts +1 -126
- package/packages/agent/src/lifeops/google-managed-client.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-managed-client.js +1 -294
- package/packages/agent/src/lifeops/google-oauth.d.ts +1 -60
- package/packages/agent/src/lifeops/google-oauth.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-oauth.js +1 -494
- package/packages/agent/src/lifeops/google-scopes.d.ts +1 -12
- package/packages/agent/src/lifeops/google-scopes.d.ts.map +1 -1
- package/packages/agent/src/lifeops/google-scopes.js +1 -96
- package/packages/agent/src/lifeops/index.d.ts +1 -2
- package/packages/agent/src/lifeops/index.d.ts.map +1 -1
- package/packages/agent/src/lifeops/index.js +1 -2
- package/packages/agent/src/lifeops/owner-profile.d.ts +1 -14
- package/packages/agent/src/lifeops/owner-profile.d.ts.map +1 -1
- package/packages/agent/src/lifeops/owner-profile.js +1 -194
- package/packages/agent/src/lifeops/repository.d.ts +1 -208
- package/packages/agent/src/lifeops/repository.d.ts.map +1 -1
- package/packages/agent/src/lifeops/repository.js +1 -3187
- package/packages/agent/src/lifeops/runtime.d.ts +1 -13
- package/packages/agent/src/lifeops/runtime.d.ts.map +1 -1
- package/packages/agent/src/lifeops/runtime.js +1 -120
- package/packages/agent/src/lifeops/screen-context.d.ts +1 -51
- package/packages/agent/src/lifeops/screen-context.d.ts.map +1 -1
- package/packages/agent/src/lifeops/screen-context.js +1 -332
- package/packages/agent/src/lifeops/seed-routines.d.ts +1 -19
- package/packages/agent/src/lifeops/seed-routines.d.ts.map +1 -1
- package/packages/agent/src/lifeops/seed-routines.js +1 -111
- package/packages/agent/src/lifeops/service.d.ts +1 -274
- package/packages/agent/src/lifeops/service.d.ts.map +1 -1
- package/packages/agent/src/lifeops/service.js +1 -9260
- package/packages/agent/src/lifeops/sql.d.ts +1 -30
- package/packages/agent/src/lifeops/sql.d.ts.map +1 -1
- package/packages/agent/src/lifeops/sql.js +1 -247
- package/packages/agent/src/lifeops/time.d.ts +1 -16
- package/packages/agent/src/lifeops/time.d.ts.map +1 -1
- package/packages/agent/src/lifeops/time.js +1 -132
- package/packages/agent/src/lifeops/twilio.d.ts +1 -24
- package/packages/agent/src/lifeops/twilio.d.ts.map +1 -1
- package/packages/agent/src/lifeops/twilio.js +1 -157
- package/packages/agent/src/lifeops/x-poster.d.ts +1 -18
- package/packages/agent/src/lifeops/x-poster.d.ts.map +1 -1
- package/packages/agent/src/lifeops/x-poster.js +1 -148
- package/packages/agent/src/providers/inbox-triage.d.ts +1 -2
- package/packages/agent/src/providers/inbox-triage.d.ts.map +1 -1
- package/packages/agent/src/providers/inbox-triage.js +1 -89
- package/packages/agent/src/providers/index.d.ts +4 -1
- package/packages/agent/src/providers/index.d.ts.map +1 -1
- package/packages/agent/src/providers/index.js +4 -1
- package/packages/agent/src/providers/lifeops.d.ts +1 -2
- package/packages/agent/src/providers/lifeops.d.ts.map +1 -1
- package/packages/agent/src/providers/lifeops.js +1 -157
- 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/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/tasks.d.ts.map +1 -1
- package/packages/agent/src/providers/tasks.js +7 -7
- package/packages/agent/src/runtime/core-plugins.js +1 -1
- package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -1
- package/packages/agent/src/runtime/eliza-plugin.js +1 -7
- package/packages/agent/src/runtime/eliza.js +2 -2
- package/packages/agent/src/runtime/plugin-collector.js +3 -3
- package/packages/agent/src/runtime/plugin-lifecycle.d.ts.map +1 -1
- package/packages/agent/src/runtime/plugin-lifecycle.js +3 -13
- package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -1
- package/packages/agent/src/runtime/trajectory-internals.js +1 -3
- package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts.map +1 -1
- package/packages/agent/src/services/coding-task-executor.d.ts +3 -3
- package/packages/agent/src/services/coding-task-executor.js +3 -3
- 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/i18n/generated/validation-keyword-data.d.ts +24 -0
- package/packages/shared/src/i18n/generated/validation-keyword-data.d.ts.map +1 -1
- package/packages/shared/src/i18n/generated/validation-keyword-data.js +24 -0
- package/packages/shared/src/runtime-env.d.ts.map +1 -1
- package/packages/shared/src/runtime-env.js +5 -1
- package/packages/typescript/src/generated/action-docs.d.ts +135 -0
- package/packages/typescript/src/generated/action-docs.d.ts.map +1 -1
- package/packages/typescript/src/generated/action-docs.js +237 -0
- package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts +24 -0
- package/packages/typescript/src/i18n/generated/validation-keyword-data.d.ts.map +1 -1
- package/packages/typescript/src/i18n/generated/validation-keyword-data.js +24 -0
- package/packages/typescript/src/index.node.d.ts +2 -2
- package/packages/typescript/src/index.node.d.ts.map +1 -1
- package/packages/typescript/src/index.node.js +4 -3
- package/packages/typescript/src/plugin-lifecycle.d.ts.map +1 -1
- package/packages/typescript/src/plugin-lifecycle.js +42 -3
- package/packages/typescript/src/services/message.d.ts.map +1 -1
- package/packages/typescript/src/services/message.js +32 -0
- package/apps/app-training/src/core/cli.d.ts +0 -11
- package/apps/app-training/src/core/cli.d.ts.map +0 -1
- package/apps/app-training/src/core/cli.js +0 -302
- package/apps/app-training/src/core/context-audit.d.ts +0 -51
- package/apps/app-training/src/core/context-audit.d.ts.map +0 -1
- package/apps/app-training/src/core/context-audit.js +0 -141
- package/apps/app-training/src/core/context-catalog.d.ts +0 -47
- package/apps/app-training/src/core/context-catalog.d.ts.map +0 -1
- package/apps/app-training/src/core/context-catalog.js +0 -259
- package/apps/app-training/src/core/context-types.d.ts +0 -3
- package/apps/app-training/src/core/context-types.d.ts.map +0 -1
- package/apps/app-training/src/core/context-types.js +0 -11
- package/apps/app-training/src/core/dataset-generator.d.ts +0 -135
- package/apps/app-training/src/core/dataset-generator.d.ts.map +0 -1
- package/apps/app-training/src/core/dataset-generator.js +0 -703
- package/apps/app-training/src/core/replay-validator.d.ts +0 -96
- package/apps/app-training/src/core/replay-validator.d.ts.map +0 -1
- package/apps/app-training/src/core/replay-validator.js +0 -265
- package/apps/app-training/src/core/roleplay-executor.d.ts +0 -123
- package/apps/app-training/src/core/roleplay-executor.d.ts.map +0 -1
- package/apps/app-training/src/core/roleplay-executor.js +0 -645
- package/apps/app-training/src/core/roleplay-trajectories.d.ts +0 -54
- package/apps/app-training/src/core/roleplay-trajectories.d.ts.map +0 -1
- package/apps/app-training/src/core/roleplay-trajectories.js +0 -73
- package/apps/app-training/src/core/scenario-blueprints.d.ts +0 -62
- package/apps/app-training/src/core/scenario-blueprints.d.ts.map +0 -1
- package/apps/app-training/src/core/scenario-blueprints.js +0 -790
- package/apps/app-training/src/core/trajectory-task-datasets.d.ts +0 -38
- package/apps/app-training/src/core/trajectory-task-datasets.d.ts.map +0 -1
- package/apps/app-training/src/core/trajectory-task-datasets.js +0 -281
- package/apps/app-training/src/core/vertex-tuning.d.ts +0 -139
- package/apps/app-training/src/core/vertex-tuning.d.ts.map +0 -1
- package/apps/app-training/src/core/vertex-tuning.js +0 -234
- package/packages/agent/src/inbox/channel-deep-links.d.ts.map +0 -1
- package/packages/agent/src/inbox/config.d.ts.map +0 -1
- package/packages/agent/src/inbox/message-fetcher.d.ts.map +0 -1
- package/packages/agent/src/inbox/reflection.d.ts.map +0 -1
- package/packages/agent/src/inbox/repository.d.ts.map +0 -1
- package/packages/agent/src/inbox/triage-classifier.d.ts.map +0 -1
- package/packages/agent/src/inbox/types.d.ts.map +0 -1
- package/packages/agent/src/training/cli.d.ts +0 -2
- package/packages/agent/src/training/cli.d.ts.map +0 -1
- package/packages/agent/src/training/cli.js +0 -2
- package/packages/agent/src/training/context-audit.d.ts +0 -2
- package/packages/agent/src/training/context-audit.d.ts.map +0 -1
- package/packages/agent/src/training/context-audit.js +0 -2
- package/packages/agent/src/training/context-catalog.d.ts +0 -2
- package/packages/agent/src/training/context-catalog.d.ts.map +0 -1
- package/packages/agent/src/training/context-catalog.js +0 -2
- package/packages/agent/src/training/context-types.d.ts +0 -2
- package/packages/agent/src/training/context-types.d.ts.map +0 -1
- package/packages/agent/src/training/context-types.js +0 -2
- package/packages/agent/src/training/dataset-generator.d.ts +0 -2
- package/packages/agent/src/training/dataset-generator.d.ts.map +0 -1
- package/packages/agent/src/training/dataset-generator.js +0 -2
- package/packages/agent/src/training/replay-validator.d.ts +0 -2
- package/packages/agent/src/training/replay-validator.d.ts.map +0 -1
- package/packages/agent/src/training/replay-validator.js +0 -2
- package/packages/agent/src/training/roleplay-executor.d.ts +0 -2
- package/packages/agent/src/training/roleplay-executor.d.ts.map +0 -1
- package/packages/agent/src/training/roleplay-executor.js +0 -2
- package/packages/agent/src/training/roleplay-trajectories.d.ts +0 -2
- package/packages/agent/src/training/roleplay-trajectories.d.ts.map +0 -1
- package/packages/agent/src/training/roleplay-trajectories.js +0 -2
- package/packages/agent/src/training/scenario-blueprints.d.ts +0 -2
- package/packages/agent/src/training/scenario-blueprints.d.ts.map +0 -1
- package/packages/agent/src/training/scenario-blueprints.js +0 -2
- package/packages/agent/src/training/trajectory-task-datasets.d.ts +0 -2
- package/packages/agent/src/training/trajectory-task-datasets.d.ts.map +0 -1
- package/packages/agent/src/training/trajectory-task-datasets.js +0 -2
- package/packages/agent/src/training/vertex-tuning.d.ts +0 -2
- package/packages/agent/src/training/vertex-tuning.d.ts.map +0 -1
- package/packages/agent/src/training/vertex-tuning.js +0 -2
- package/packages/typescript/src/features/orchestrator/actions/coding-task-handlers.d.ts +0 -41
- package/packages/typescript/src/features/orchestrator/actions/coding-task-handlers.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/coding-task-handlers.js +0 -443
- package/packages/typescript/src/features/orchestrator/actions/coding-task-helpers.d.ts +0 -34
- package/packages/typescript/src/features/orchestrator/actions/coding-task-helpers.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/coding-task-helpers.js +0 -171
- package/packages/typescript/src/features/orchestrator/actions/eval-metadata.d.ts +0 -11
- package/packages/typescript/src/features/orchestrator/actions/eval-metadata.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/eval-metadata.js +0 -55
- package/packages/typescript/src/features/orchestrator/actions/finalize-workspace.d.ts +0 -11
- package/packages/typescript/src/features/orchestrator/actions/finalize-workspace.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/finalize-workspace.js +0 -214
- package/packages/typescript/src/features/orchestrator/actions/list-agents.d.ts +0 -13
- package/packages/typescript/src/features/orchestrator/actions/list-agents.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/list-agents.js +0 -174
- package/packages/typescript/src/features/orchestrator/actions/manage-issues.d.ts +0 -11
- package/packages/typescript/src/features/orchestrator/actions/manage-issues.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/manage-issues.js +0 -428
- package/packages/typescript/src/features/orchestrator/actions/provision-workspace.d.ts +0 -11
- package/packages/typescript/src/features/orchestrator/actions/provision-workspace.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/provision-workspace.js +0 -189
- package/packages/typescript/src/features/orchestrator/actions/send-to-agent.d.ts +0 -12
- package/packages/typescript/src/features/orchestrator/actions/send-to-agent.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/send-to-agent.js +0 -265
- package/packages/typescript/src/features/orchestrator/actions/spawn-agent.d.ts +0 -12
- package/packages/typescript/src/features/orchestrator/actions/spawn-agent.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/spawn-agent.js +0 -356
- package/packages/typescript/src/features/orchestrator/actions/start-coding-task.d.ts +0 -22
- package/packages/typescript/src/features/orchestrator/actions/start-coding-task.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/start-coding-task.js +0 -270
- package/packages/typescript/src/features/orchestrator/actions/stop-agent.d.ts +0 -12
- package/packages/typescript/src/features/orchestrator/actions/stop-agent.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/stop-agent.js +0 -192
- package/packages/typescript/src/features/orchestrator/actions/task-control.d.ts +0 -3
- package/packages/typescript/src/features/orchestrator/actions/task-control.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/task-control.js +0 -217
- package/packages/typescript/src/features/orchestrator/actions/task-history.d.ts +0 -3
- package/packages/typescript/src/features/orchestrator/actions/task-history.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/task-history.js +0 -323
- package/packages/typescript/src/features/orchestrator/actions/task-share.d.ts +0 -3
- package/packages/typescript/src/features/orchestrator/actions/task-share.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/task-share.js +0 -168
- package/packages/typescript/src/features/orchestrator/actions/task-thread-target.d.ts +0 -11
- package/packages/typescript/src/features/orchestrator/actions/task-thread-target.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/actions/task-thread-target.js +0 -68
- package/packages/typescript/src/features/orchestrator/api/agent-routes.d.ts +0 -18
- package/packages/typescript/src/features/orchestrator/api/agent-routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/agent-routes.js +0 -654
- package/packages/typescript/src/features/orchestrator/api/coordinator-routes.d.ts +0 -22
- package/packages/typescript/src/features/orchestrator/api/coordinator-routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/coordinator-routes.js +0 -403
- package/packages/typescript/src/features/orchestrator/api/hook-routes.d.ts +0 -18
- package/packages/typescript/src/features/orchestrator/api/hook-routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/hook-routes.js +0 -164
- package/packages/typescript/src/features/orchestrator/api/issue-routes.d.ts +0 -17
- package/packages/typescript/src/features/orchestrator/api/issue-routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/issue-routes.js +0 -132
- package/packages/typescript/src/features/orchestrator/api/routes.d.ts +0 -37
- package/packages/typescript/src/features/orchestrator/api/routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/routes.js +0 -96
- package/packages/typescript/src/features/orchestrator/api/workspace-routes.d.ts +0 -17
- package/packages/typescript/src/features/orchestrator/api/workspace-routes.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/api/workspace-routes.js +0 -149
- package/packages/typescript/src/features/orchestrator/base-plugin.d.ts +0 -19
- package/packages/typescript/src/features/orchestrator/base-plugin.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/base-plugin.js +0 -75
- package/packages/typescript/src/features/orchestrator/claude-jsonl-completion-watcher.d.ts +0 -101
- package/packages/typescript/src/features/orchestrator/claude-jsonl-completion-watcher.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/claude-jsonl-completion-watcher.js +0 -310
- package/packages/typescript/src/features/orchestrator/index.d.ts +0 -33
- package/packages/typescript/src/features/orchestrator/index.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/index.js +0 -30
- package/packages/typescript/src/features/orchestrator/patch-agent-orchestrator-plugin.d.ts +0 -15
- package/packages/typescript/src/features/orchestrator/patch-agent-orchestrator-plugin.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/patch-agent-orchestrator-plugin.js +0 -1449
- package/packages/typescript/src/features/orchestrator/providers/action-examples.d.ts +0 -14
- package/packages/typescript/src/features/orchestrator/providers/action-examples.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/providers/action-examples.js +0 -151
- package/packages/typescript/src/features/orchestrator/providers/active-workspace-context.d.ts +0 -13
- package/packages/typescript/src/features/orchestrator/providers/active-workspace-context.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/providers/active-workspace-context.js +0 -142
- package/packages/typescript/src/features/orchestrator/services/agent-credentials.d.ts +0 -6
- package/packages/typescript/src/features/orchestrator/services/agent-credentials.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/agent-credentials.js +0 -91
- package/packages/typescript/src/features/orchestrator/services/agent-metrics.d.ts +0 -30
- package/packages/typescript/src/features/orchestrator/services/agent-metrics.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/agent-metrics.js +0 -54
- package/packages/typescript/src/features/orchestrator/services/agent-selection.d.ts +0 -53
- package/packages/typescript/src/features/orchestrator/services/agent-selection.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/agent-selection.js +0 -70
- package/packages/typescript/src/features/orchestrator/services/ansi-utils.d.ts +0 -61
- package/packages/typescript/src/features/orchestrator/services/ansi-utils.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/ansi-utils.js +0 -252
- package/packages/typescript/src/features/orchestrator/services/config-env.d.ts +0 -13
- package/packages/typescript/src/features/orchestrator/services/config-env.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/config-env.js +0 -37
- package/packages/typescript/src/features/orchestrator/services/coordinator-event-normalizer.d.ts +0 -50
- package/packages/typescript/src/features/orchestrator/services/coordinator-event-normalizer.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/coordinator-event-normalizer.js +0 -184
- package/packages/typescript/src/features/orchestrator/services/debug-capture.d.ts +0 -38
- package/packages/typescript/src/features/orchestrator/services/debug-capture.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/debug-capture.js +0 -113
- package/packages/typescript/src/features/orchestrator/services/pty-auto-response.d.ts +0 -30
- package/packages/typescript/src/features/orchestrator/services/pty-auto-response.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-auto-response.js +0 -146
- package/packages/typescript/src/features/orchestrator/services/pty-init.d.ts +0 -54
- package/packages/typescript/src/features/orchestrator/services/pty-init.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-init.js +0 -315
- package/packages/typescript/src/features/orchestrator/services/pty-service.d.ts +0 -175
- package/packages/typescript/src/features/orchestrator/services/pty-service.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-service.js +0 -1469
- package/packages/typescript/src/features/orchestrator/services/pty-session-io.d.ts +0 -49
- package/packages/typescript/src/features/orchestrator/services/pty-session-io.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-session-io.js +0 -180
- package/packages/typescript/src/features/orchestrator/services/pty-spawn.d.ts +0 -53
- package/packages/typescript/src/features/orchestrator/services/pty-spawn.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-spawn.js +0 -280
- package/packages/typescript/src/features/orchestrator/services/pty-types.d.ts +0 -80
- package/packages/typescript/src/features/orchestrator/services/pty-types.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/pty-types.js +0 -51
- package/packages/typescript/src/features/orchestrator/services/repo-input.d.ts +0 -16
- package/packages/typescript/src/features/orchestrator/services/repo-input.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/repo-input.js +0 -88
- package/packages/typescript/src/features/orchestrator/services/stall-classifier.d.ts +0 -69
- package/packages/typescript/src/features/orchestrator/services/stall-classifier.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/stall-classifier.js +0 -446
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator-prompts.d.ts +0 -97
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator-prompts.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator-prompts.js +0 -342
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator.d.ts +0 -421
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-coordinator.js +0 -2356
- package/packages/typescript/src/features/orchestrator/services/swarm-decision-loop.d.ts +0 -52
- package/packages/typescript/src/features/orchestrator/services/swarm-decision-loop.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-decision-loop.js +0 -1538
- package/packages/typescript/src/features/orchestrator/services/swarm-event-triage.d.ts +0 -49
- package/packages/typescript/src/features/orchestrator/services/swarm-event-triage.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-event-triage.js +0 -171
- package/packages/typescript/src/features/orchestrator/services/swarm-history.d.ts +0 -27
- package/packages/typescript/src/features/orchestrator/services/swarm-history.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-history.js +0 -148
- package/packages/typescript/src/features/orchestrator/services/swarm-idle-watchdog.d.ts +0 -22
- package/packages/typescript/src/features/orchestrator/services/swarm-idle-watchdog.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/swarm-idle-watchdog.js +0 -265
- package/packages/typescript/src/features/orchestrator/services/task-acceptance.d.ts +0 -8
- package/packages/typescript/src/features/orchestrator/services/task-acceptance.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-acceptance.js +0 -114
- package/packages/typescript/src/features/orchestrator/services/task-agent-auth.d.ts +0 -68
- package/packages/typescript/src/features/orchestrator/services/task-agent-auth.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-agent-auth.js +0 -559
- package/packages/typescript/src/features/orchestrator/services/task-agent-frameworks.d.ts +0 -82
- package/packages/typescript/src/features/orchestrator/services/task-agent-frameworks.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-agent-frameworks.js +0 -738
- package/packages/typescript/src/features/orchestrator/services/task-kind.d.ts +0 -3
- package/packages/typescript/src/features/orchestrator/services/task-kind.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-kind.js +0 -40
- package/packages/typescript/src/features/orchestrator/services/task-policy.d.ts +0 -17
- package/packages/typescript/src/features/orchestrator/services/task-policy.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-policy.js +0 -226
- package/packages/typescript/src/features/orchestrator/services/task-registry.d.ts +0 -550
- package/packages/typescript/src/features/orchestrator/services/task-registry.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-registry.js +0 -2182
- package/packages/typescript/src/features/orchestrator/services/task-share.d.ts +0 -18
- package/packages/typescript/src/features/orchestrator/services/task-share.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-share.js +0 -159
- package/packages/typescript/src/features/orchestrator/services/task-validation.d.ts +0 -69
- package/packages/typescript/src/features/orchestrator/services/task-validation.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-validation.js +0 -587
- package/packages/typescript/src/features/orchestrator/services/task-verifier-runner.d.ts +0 -5
- package/packages/typescript/src/features/orchestrator/services/task-verifier-runner.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/task-verifier-runner.js +0 -372
- package/packages/typescript/src/features/orchestrator/services/trajectory-context.d.ts +0 -73
- package/packages/typescript/src/features/orchestrator/services/trajectory-context.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/trajectory-context.js +0 -64
- package/packages/typescript/src/features/orchestrator/services/trajectory-feedback.d.ts +0 -53
- package/packages/typescript/src/features/orchestrator/services/trajectory-feedback.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/trajectory-feedback.js +0 -260
- package/packages/typescript/src/features/orchestrator/services/workspace-git-ops.d.ts +0 -28
- package/packages/typescript/src/features/orchestrator/services/workspace-git-ops.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/workspace-git-ops.js +0 -105
- package/packages/typescript/src/features/orchestrator/services/workspace-github.d.ts +0 -58
- package/packages/typescript/src/features/orchestrator/services/workspace-github.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/workspace-github.js +0 -139
- package/packages/typescript/src/features/orchestrator/services/workspace-lifecycle.d.ts +0 -18
- package/packages/typescript/src/features/orchestrator/services/workspace-lifecycle.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/workspace-lifecycle.js +0 -86
- package/packages/typescript/src/features/orchestrator/services/workspace-service.d.ts +0 -118
- package/packages/typescript/src/features/orchestrator/services/workspace-service.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/workspace-service.js +0 -533
- package/packages/typescript/src/features/orchestrator/services/workspace-types.d.ts +0 -81
- package/packages/typescript/src/features/orchestrator/services/workspace-types.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/services/workspace-types.js +0 -8
- package/packages/typescript/src/features/orchestrator/task-progress-streamer.d.ts +0 -38
- package/packages/typescript/src/features/orchestrator/task-progress-streamer.d.ts.map +0 -1
- package/packages/typescript/src/features/orchestrator/task-progress-streamer.js +0 -293
- /package/{packages/agent → apps/app-lifeops}/src/inbox/channel-deep-links.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/channel-deep-links.js +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/config.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/message-fetcher.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/message-fetcher.js +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/reflection.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/reflection.js +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/repository.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/repository.js +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/triage-classifier.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/triage-classifier.js +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/types.d.ts +0 -0
- /package/{packages/agent → apps/app-lifeops}/src/inbox/types.js +0 -0
|
@@ -1,645 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { exportTrajectoryTaskDatasets, } from "./trajectory-task-datasets.js";
|
|
5
|
-
const GROUP_CHANNEL = "GROUP";
|
|
6
|
-
function deterministicUuid(seed) {
|
|
7
|
-
const hex = createHash("sha1").update(seed).digest("hex").slice(0, 32);
|
|
8
|
-
return [
|
|
9
|
-
hex.slice(0, 8),
|
|
10
|
-
hex.slice(8, 12),
|
|
11
|
-
hex.slice(12, 16),
|
|
12
|
-
hex.slice(16, 20),
|
|
13
|
-
hex.slice(20, 32),
|
|
14
|
-
].join("-");
|
|
15
|
-
}
|
|
16
|
-
function isRecord(value) {
|
|
17
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
18
|
-
}
|
|
19
|
-
function parseDelimitedList(value) {
|
|
20
|
-
return value
|
|
21
|
-
.split(",")
|
|
22
|
-
.map((entry) => entry.trim())
|
|
23
|
-
.filter((entry, index, entries) => entry.length > 0 && entries.indexOf(entry) === index);
|
|
24
|
-
}
|
|
25
|
-
function readTag(response, tagName) {
|
|
26
|
-
const xmlMatch = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`, "i").exec(response);
|
|
27
|
-
if (xmlMatch?.[1]) {
|
|
28
|
-
const value = xmlMatch[1].trim();
|
|
29
|
-
return value.length > 0 ? value : undefined;
|
|
30
|
-
}
|
|
31
|
-
const lineMatch = new RegExp(`(^|\\n)${tagName}:\\s*([^\\n]+)`, "i").exec(response);
|
|
32
|
-
if (lineMatch?.[2]) {
|
|
33
|
-
const value = lineMatch[2].trim();
|
|
34
|
-
return value.length > 0 ? value : undefined;
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
function parseRoutingDecision(response) {
|
|
39
|
-
const decision = readTag(response, "action")?.toUpperCase();
|
|
40
|
-
const primaryContext = readTag(response, "primaryContext");
|
|
41
|
-
const secondaryContexts = parseDelimitedList(readTag(response, "secondaryContexts") ?? "");
|
|
42
|
-
return {
|
|
43
|
-
decision: decision === "RESPOND" || decision === "IGNORE" || decision === "STOP"
|
|
44
|
-
? decision
|
|
45
|
-
: undefined,
|
|
46
|
-
primaryContext,
|
|
47
|
-
secondaryContexts,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function collectRuntimeCandidates(runtime) {
|
|
51
|
-
const candidates = [];
|
|
52
|
-
const seen = new Set();
|
|
53
|
-
const push = (candidate) => {
|
|
54
|
-
if (!candidate || seen.has(candidate)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
seen.add(candidate);
|
|
58
|
-
candidates.push(candidate);
|
|
59
|
-
};
|
|
60
|
-
if (typeof runtime.getServicesByType === "function") {
|
|
61
|
-
const value = runtime.getServicesByType("trajectories");
|
|
62
|
-
if (Array.isArray(value)) {
|
|
63
|
-
for (const entry of value) {
|
|
64
|
-
push(entry);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
push(value);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (typeof runtime.getService === "function") {
|
|
72
|
-
push(runtime.getService("trajectories"));
|
|
73
|
-
}
|
|
74
|
-
return candidates;
|
|
75
|
-
}
|
|
76
|
-
function getTrajectoryLogger(runtime) {
|
|
77
|
-
for (const candidate of collectRuntimeCandidates(runtime)) {
|
|
78
|
-
if (candidate &&
|
|
79
|
-
typeof candidate === "object" &&
|
|
80
|
-
typeof candidate.getTrajectoryDetail ===
|
|
81
|
-
"function") {
|
|
82
|
-
return candidate;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
async function waitForTrajectoryDetail(logger, trajectoryId) {
|
|
88
|
-
if (!logger?.getTrajectoryDetail) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
for (let attempt = 0; attempt < 20; attempt += 1) {
|
|
92
|
-
const detail = await logger.getTrajectoryDetail(trajectoryId);
|
|
93
|
-
if (detail) {
|
|
94
|
-
return detail;
|
|
95
|
-
}
|
|
96
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
function normalizeActionName(value) {
|
|
101
|
-
if (typeof value !== "string") {
|
|
102
|
-
return "";
|
|
103
|
-
}
|
|
104
|
-
return value.trim().toUpperCase();
|
|
105
|
-
}
|
|
106
|
-
function collectActionNamesFromContent(content) {
|
|
107
|
-
if (!content?.actions) {
|
|
108
|
-
return [];
|
|
109
|
-
}
|
|
110
|
-
return content.actions
|
|
111
|
-
.map((action) => normalizeActionName(action))
|
|
112
|
-
.filter((action, index, actions) => action.length > 0 && actions.indexOf(action) === index);
|
|
113
|
-
}
|
|
114
|
-
function collectExecutedActionNames(runtime, messageId) {
|
|
115
|
-
return runtime
|
|
116
|
-
.getActionResults(messageId)
|
|
117
|
-
.map((result) => {
|
|
118
|
-
if (typeof result === "string") {
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
const record = isRecord(result) ? result : null;
|
|
122
|
-
if (!record) {
|
|
123
|
-
return "";
|
|
124
|
-
}
|
|
125
|
-
if (typeof record.actionName === "string") {
|
|
126
|
-
return record.actionName;
|
|
127
|
-
}
|
|
128
|
-
const data = isRecord(record.data) ? record.data : null;
|
|
129
|
-
return typeof data?.actionName === "string" ? data.actionName : "";
|
|
130
|
-
})
|
|
131
|
-
.map((action) => normalizeActionName(action))
|
|
132
|
-
.filter((action, index, actions) => action.length > 0 && actions.indexOf(action) === index);
|
|
133
|
-
}
|
|
134
|
-
function resolveActualDecision(args) {
|
|
135
|
-
const callbackActions = args.callbackContents.flatMap((content) => collectActionNamesFromContent(content));
|
|
136
|
-
if (callbackActions.includes("STOP")) {
|
|
137
|
-
return "STOP";
|
|
138
|
-
}
|
|
139
|
-
if (callbackActions.includes("IGNORE")) {
|
|
140
|
-
return "IGNORE";
|
|
141
|
-
}
|
|
142
|
-
const responseActions = collectActionNamesFromContent(args.responseContent);
|
|
143
|
-
if (responseActions.includes("STOP")) {
|
|
144
|
-
return "STOP";
|
|
145
|
-
}
|
|
146
|
-
if (responseActions.includes("IGNORE") && !args.didRespond) {
|
|
147
|
-
return "IGNORE";
|
|
148
|
-
}
|
|
149
|
-
if (args.shouldRespondDecision) {
|
|
150
|
-
return args.shouldRespondDecision;
|
|
151
|
-
}
|
|
152
|
-
return args.didRespond ? "RESPOND" : "IGNORE";
|
|
153
|
-
}
|
|
154
|
-
function secondaryContextsEqual(expected, actual) {
|
|
155
|
-
const normalizedExpected = [
|
|
156
|
-
...new Set(expected.map((value) => value.trim().toLowerCase())),
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.sort();
|
|
160
|
-
const normalizedActual = [
|
|
161
|
-
...new Set(actual.map((value) => value.trim().toLowerCase())),
|
|
162
|
-
]
|
|
163
|
-
.filter(Boolean)
|
|
164
|
-
.sort();
|
|
165
|
-
return (JSON.stringify(normalizedExpected) === JSON.stringify(normalizedActual));
|
|
166
|
-
}
|
|
167
|
-
function buildEmptyBucketReport() {
|
|
168
|
-
return {
|
|
169
|
-
totalEpisodes: 0,
|
|
170
|
-
decisionMatches: 0,
|
|
171
|
-
routingMatches: 0,
|
|
172
|
-
primaryContextMatches: 0,
|
|
173
|
-
secondaryContextExactMatches: 0,
|
|
174
|
-
actionRelevantEpisodes: 0,
|
|
175
|
-
actionMatches: 0,
|
|
176
|
-
selectedActionMatches: 0,
|
|
177
|
-
executedActionMatches: 0,
|
|
178
|
-
decisionAccuracy: 0,
|
|
179
|
-
routingAccuracy: 0,
|
|
180
|
-
primaryContextAccuracy: 0,
|
|
181
|
-
secondaryContextExactAccuracy: 0,
|
|
182
|
-
actionAccuracy: 0,
|
|
183
|
-
selectedActionAccuracy: 0,
|
|
184
|
-
executedActionAccuracy: 0,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
function finalizeBucketReport(bucket) {
|
|
188
|
-
return {
|
|
189
|
-
...bucket,
|
|
190
|
-
decisionAccuracy: bucket.decisionMatches / (bucket.totalEpisodes || 1),
|
|
191
|
-
routingAccuracy: bucket.routingMatches / (bucket.totalEpisodes || 1),
|
|
192
|
-
primaryContextAccuracy: bucket.primaryContextMatches / (bucket.totalEpisodes || 1),
|
|
193
|
-
secondaryContextExactAccuracy: bucket.secondaryContextExactMatches / (bucket.totalEpisodes || 1),
|
|
194
|
-
actionAccuracy: bucket.actionMatches / (bucket.actionRelevantEpisodes || 1),
|
|
195
|
-
selectedActionAccuracy: bucket.selectedActionMatches / (bucket.actionRelevantEpisodes || 1),
|
|
196
|
-
executedActionAccuracy: bucket.executedActionMatches / (bucket.actionRelevantEpisodes || 1),
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function updateBucketReport(bucket, execution) {
|
|
200
|
-
bucket.totalEpisodes += 1;
|
|
201
|
-
if (execution.decisionMatch) {
|
|
202
|
-
bucket.decisionMatches += 1;
|
|
203
|
-
}
|
|
204
|
-
if (execution.routingMatch) {
|
|
205
|
-
bucket.routingMatches += 1;
|
|
206
|
-
}
|
|
207
|
-
if (execution.primaryContextMatch) {
|
|
208
|
-
bucket.primaryContextMatches += 1;
|
|
209
|
-
}
|
|
210
|
-
if (execution.secondaryContextExactMatch) {
|
|
211
|
-
bucket.secondaryContextExactMatches += 1;
|
|
212
|
-
}
|
|
213
|
-
if (execution.expectedAction) {
|
|
214
|
-
bucket.actionRelevantEpisodes += 1;
|
|
215
|
-
if (execution.actionMatch) {
|
|
216
|
-
bucket.actionMatches += 1;
|
|
217
|
-
}
|
|
218
|
-
if (execution.selectedActionMatch) {
|
|
219
|
-
bucket.selectedActionMatches += 1;
|
|
220
|
-
}
|
|
221
|
-
if (execution.executedActionMatch) {
|
|
222
|
-
bucket.executedActionMatches += 1;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function createDecisionConfusionMatrix() {
|
|
227
|
-
return {
|
|
228
|
-
RESPOND: { RESPOND: 0, IGNORE: 0, STOP: 0 },
|
|
229
|
-
IGNORE: { RESPOND: 0, IGNORE: 0, STOP: 0 },
|
|
230
|
-
STOP: { RESPOND: 0, IGNORE: 0, STOP: 0 },
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function resolveMessageRoutingFallback(message) {
|
|
234
|
-
const metadata = message.content?.metadata && typeof message.content.metadata === "object"
|
|
235
|
-
? message.content.metadata
|
|
236
|
-
: {};
|
|
237
|
-
const responseContext = metadata.__responseContext && typeof metadata.__responseContext === "object"
|
|
238
|
-
? metadata.__responseContext
|
|
239
|
-
: {};
|
|
240
|
-
const secondaryContexts = Array.isArray(responseContext.secondaryContexts)
|
|
241
|
-
? responseContext.secondaryContexts.filter((value) => typeof value === "string" && value.trim().length > 0)
|
|
242
|
-
: parseDelimitedList(String(responseContext.secondaryContexts ?? ""));
|
|
243
|
-
return {
|
|
244
|
-
primaryContext: typeof responseContext.primaryContext === "string"
|
|
245
|
-
? responseContext.primaryContext
|
|
246
|
-
: undefined,
|
|
247
|
-
secondaryContexts,
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
function buildParticipantId(episodeId, speaker) {
|
|
251
|
-
return deterministicUuid(`roleplay-${episodeId}-${speaker.toLowerCase()}`);
|
|
252
|
-
}
|
|
253
|
-
function buildRoomIds(episodeId) {
|
|
254
|
-
return {
|
|
255
|
-
roomId: deterministicUuid(`roleplay-room-${episodeId}`),
|
|
256
|
-
worldId: deterministicUuid(`roleplay-world-${episodeId}`),
|
|
257
|
-
messageServerId: deterministicUuid(`roleplay-server-${episodeId}`),
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
async function seedTurnMemory(runtime, episode, turn, roomIds) {
|
|
261
|
-
const entityId = turn.role === "assistant"
|
|
262
|
-
? runtime.agentId
|
|
263
|
-
: buildParticipantId(episode.id, turn.speaker);
|
|
264
|
-
await runtime.createMemory({
|
|
265
|
-
id: deterministicUuid(`roleplay-seed-${episode.id}-${turn.id}`),
|
|
266
|
-
entityId,
|
|
267
|
-
agentId: runtime.agentId,
|
|
268
|
-
roomId: roomIds.roomId,
|
|
269
|
-
createdAt: Date.now(),
|
|
270
|
-
content: {
|
|
271
|
-
text: turn.content,
|
|
272
|
-
source: episode.platform,
|
|
273
|
-
channelType: GROUP_CHANNEL,
|
|
274
|
-
metadata: {
|
|
275
|
-
entityName: turn.speaker,
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
}, "messages");
|
|
279
|
-
}
|
|
280
|
-
async function ensureRoleplayConnections(runtime, episode, roomIds) {
|
|
281
|
-
if (typeof runtime.ensureConnection !== "function") {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const participants = [
|
|
285
|
-
...new Set(episode.turns
|
|
286
|
-
.filter((turn) => turn.role === "participant")
|
|
287
|
-
.map((turn) => turn.speaker)),
|
|
288
|
-
];
|
|
289
|
-
for (const speaker of participants) {
|
|
290
|
-
const entityId = buildParticipantId(episode.id, speaker);
|
|
291
|
-
await runtime.ensureConnection({
|
|
292
|
-
entityId,
|
|
293
|
-
roomId: roomIds.roomId,
|
|
294
|
-
worldId: roomIds.worldId,
|
|
295
|
-
userName: speaker,
|
|
296
|
-
source: episode.platform,
|
|
297
|
-
channelId: `roleplay-${episode.id}`,
|
|
298
|
-
type: GROUP_CHANNEL,
|
|
299
|
-
messageServerId: roomIds.messageServerId,
|
|
300
|
-
metadata: {
|
|
301
|
-
ownership: {
|
|
302
|
-
ownerId: entityId,
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
async function resolveRuntime(runtime) {
|
|
309
|
-
if (runtime) {
|
|
310
|
-
return runtime;
|
|
311
|
-
}
|
|
312
|
-
const { bootElizaRuntime } = await import("@elizaos/agent/runtime/eliza");
|
|
313
|
-
return (await bootElizaRuntime());
|
|
314
|
-
}
|
|
315
|
-
export async function executeRoleplayEpisode(episode, options = {}) {
|
|
316
|
-
const runtime = await resolveRuntime(options.runtime);
|
|
317
|
-
const roomIds = buildRoomIds(episode.id);
|
|
318
|
-
const logger = getTrajectoryLogger(runtime);
|
|
319
|
-
const turnExecutions = [];
|
|
320
|
-
await ensureRoleplayConnections(runtime, episode, roomIds);
|
|
321
|
-
for (const turn of episode.turns) {
|
|
322
|
-
if (turn.role === "assistant") {
|
|
323
|
-
await seedTurnMemory(runtime, episode, turn, roomIds);
|
|
324
|
-
turnExecutions.push({
|
|
325
|
-
turnId: turn.id,
|
|
326
|
-
speaker: turn.speaker,
|
|
327
|
-
role: turn.role,
|
|
328
|
-
isEvaluationTarget: turn.isEvaluationTarget,
|
|
329
|
-
actualSecondaryContexts: [],
|
|
330
|
-
selectedActions: [],
|
|
331
|
-
executedActions: [],
|
|
332
|
-
responseText: turn.content,
|
|
333
|
-
callbackTexts: [],
|
|
334
|
-
warnings: [],
|
|
335
|
-
});
|
|
336
|
-
continue;
|
|
337
|
-
}
|
|
338
|
-
if (!turn.isEvaluationTarget && !options.executeAllParticipantTurns) {
|
|
339
|
-
await seedTurnMemory(runtime, episode, turn, roomIds);
|
|
340
|
-
turnExecutions.push({
|
|
341
|
-
turnId: turn.id,
|
|
342
|
-
speaker: turn.speaker,
|
|
343
|
-
role: turn.role,
|
|
344
|
-
isEvaluationTarget: false,
|
|
345
|
-
actualSecondaryContexts: [],
|
|
346
|
-
selectedActions: [],
|
|
347
|
-
executedActions: [],
|
|
348
|
-
responseText: "",
|
|
349
|
-
callbackTexts: [],
|
|
350
|
-
warnings: [],
|
|
351
|
-
});
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
const trajectoryId = deterministicUuid(`roleplay-trajectory-${episode.id}-${turn.id}`);
|
|
355
|
-
const message = {
|
|
356
|
-
id: deterministicUuid(`roleplay-message-${episode.id}-${turn.id}`),
|
|
357
|
-
entityId: buildParticipantId(episode.id, turn.speaker),
|
|
358
|
-
roomId: roomIds.roomId,
|
|
359
|
-
agentId: runtime.agentId,
|
|
360
|
-
createdAt: Date.now(),
|
|
361
|
-
content: {
|
|
362
|
-
text: turn.content,
|
|
363
|
-
source: episode.platform,
|
|
364
|
-
channelType: GROUP_CHANNEL,
|
|
365
|
-
metadata: {
|
|
366
|
-
entityName: turn.speaker,
|
|
367
|
-
type: "message",
|
|
368
|
-
trajectoryStepId: trajectoryId,
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
};
|
|
372
|
-
const callbackContents = [];
|
|
373
|
-
const result = await runtime.messageService.handleMessage(runtime, message, async (content) => {
|
|
374
|
-
callbackContents.push(content);
|
|
375
|
-
return [];
|
|
376
|
-
}, options.timeoutMs ? { timeoutDuration: options.timeoutMs } : undefined);
|
|
377
|
-
const trajectory = await waitForTrajectoryDetail(logger, trajectoryId);
|
|
378
|
-
const shouldRespondCall = trajectory?.steps
|
|
379
|
-
?.flatMap((step) => step.llmCalls ?? [])
|
|
380
|
-
.find((call) => normalizeActionName(call.purpose) === "SHOULD_RESPOND");
|
|
381
|
-
const routingFromModel = shouldRespondCall?.response
|
|
382
|
-
? parseRoutingDecision(shouldRespondCall.response)
|
|
383
|
-
: { secondaryContexts: [] };
|
|
384
|
-
const routingFallback = resolveMessageRoutingFallback(message);
|
|
385
|
-
const actualDecision = resolveActualDecision({
|
|
386
|
-
didRespond: result.didRespond,
|
|
387
|
-
callbackContents,
|
|
388
|
-
responseContent: result.responseContent ?? null,
|
|
389
|
-
shouldRespondDecision: routingFromModel.decision,
|
|
390
|
-
});
|
|
391
|
-
const actualPrimaryContext = routingFromModel.primaryContext ?? routingFallback.primaryContext;
|
|
392
|
-
const actualSecondaryContexts = routingFromModel.secondaryContexts.length > 0
|
|
393
|
-
? routingFromModel.secondaryContexts
|
|
394
|
-
: routingFallback.secondaryContexts;
|
|
395
|
-
const selectedActions = [
|
|
396
|
-
...new Set([
|
|
397
|
-
...collectActionNamesFromContent(result.responseContent ?? null),
|
|
398
|
-
...callbackContents.flatMap((content) => collectActionNamesFromContent(content)),
|
|
399
|
-
]),
|
|
400
|
-
];
|
|
401
|
-
if (!message.id) {
|
|
402
|
-
throw new Error(`Roleplay message ${turn.id} is missing an ID`);
|
|
403
|
-
}
|
|
404
|
-
const executedActions = collectExecutedActionNames(runtime, message.id);
|
|
405
|
-
const callbackTexts = callbackContents
|
|
406
|
-
.map((content) => content.text?.trim() ?? "")
|
|
407
|
-
.filter((text) => text.length > 0);
|
|
408
|
-
const responseText = result.responseContent?.text?.trim() ??
|
|
409
|
-
callbackTexts[callbackTexts.length - 1] ??
|
|
410
|
-
"";
|
|
411
|
-
const warnings = [];
|
|
412
|
-
if (!trajectory) {
|
|
413
|
-
warnings.push("trajectory_capture_missing");
|
|
414
|
-
}
|
|
415
|
-
if (turn.isEvaluationTarget &&
|
|
416
|
-
!routingFromModel.primaryContext &&
|
|
417
|
-
!routingFallback.primaryContext) {
|
|
418
|
-
warnings.push("context_routing_missing");
|
|
419
|
-
}
|
|
420
|
-
turnExecutions.push({
|
|
421
|
-
turnId: turn.id,
|
|
422
|
-
speaker: turn.speaker,
|
|
423
|
-
role: turn.role,
|
|
424
|
-
isEvaluationTarget: turn.isEvaluationTarget,
|
|
425
|
-
actualDecision,
|
|
426
|
-
actualPrimaryContext,
|
|
427
|
-
actualSecondaryContexts,
|
|
428
|
-
selectedActions,
|
|
429
|
-
executedActions,
|
|
430
|
-
responseText,
|
|
431
|
-
callbackTexts,
|
|
432
|
-
trajectoryId,
|
|
433
|
-
warnings,
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
const evaluationTurn = turnExecutions.find((turn) => turn.isEvaluationTarget);
|
|
437
|
-
if (!evaluationTurn) {
|
|
438
|
-
throw new Error(`Roleplay episode ${episode.id} has no evaluation target turn`);
|
|
439
|
-
}
|
|
440
|
-
const actualActions = [
|
|
441
|
-
...new Set([
|
|
442
|
-
...evaluationTurn.selectedActions,
|
|
443
|
-
...evaluationTurn.executedActions,
|
|
444
|
-
]),
|
|
445
|
-
];
|
|
446
|
-
const decisionMatch = evaluationTurn.actualDecision === episode.expectedDecision;
|
|
447
|
-
const primaryContextMatch = (evaluationTurn.actualPrimaryContext ?? "").toLowerCase() ===
|
|
448
|
-
episode.primaryContext.toLowerCase();
|
|
449
|
-
const secondaryContextExactMatch = secondaryContextsEqual(episode.secondaryContexts, evaluationTurn.actualSecondaryContexts);
|
|
450
|
-
const routingMatch = primaryContextMatch && secondaryContextExactMatch;
|
|
451
|
-
const normalizedExpectedAction = episode.expectedAction
|
|
452
|
-
? normalizeActionName(episode.expectedAction)
|
|
453
|
-
: "";
|
|
454
|
-
const selectedActionMatch = episode.expectedAction
|
|
455
|
-
? evaluationTurn.selectedActions.includes(normalizedExpectedAction)
|
|
456
|
-
: true;
|
|
457
|
-
const executedActionMatch = episode.expectedAction
|
|
458
|
-
? evaluationTurn.executedActions.includes(normalizedExpectedAction)
|
|
459
|
-
: true;
|
|
460
|
-
const actionMatch = episode.expectedAction
|
|
461
|
-
? actualActions.includes(normalizedExpectedAction)
|
|
462
|
-
: true;
|
|
463
|
-
const trajectory = evaluationTurn.trajectoryId && logger
|
|
464
|
-
? await waitForTrajectoryDetail(logger, evaluationTurn.trajectoryId)
|
|
465
|
-
: null;
|
|
466
|
-
return {
|
|
467
|
-
episodeId: episode.id,
|
|
468
|
-
blueprintId: episode.blueprintId,
|
|
469
|
-
agentName: episode.agentName,
|
|
470
|
-
pattern: typeof episode.metadata?.pattern === "string"
|
|
471
|
-
? episode.metadata.pattern
|
|
472
|
-
: undefined,
|
|
473
|
-
evaluationTurnId: episode.evaluationTurnId,
|
|
474
|
-
expectedDecision: episode.expectedDecision,
|
|
475
|
-
actualDecision: evaluationTurn.actualDecision ?? "IGNORE",
|
|
476
|
-
expectedPrimaryContext: episode.primaryContext,
|
|
477
|
-
actualPrimaryContext: evaluationTurn.actualPrimaryContext,
|
|
478
|
-
expectedSecondaryContexts: episode.secondaryContexts,
|
|
479
|
-
actualSecondaryContexts: evaluationTurn.actualSecondaryContexts,
|
|
480
|
-
expectedAction: episode.expectedAction,
|
|
481
|
-
actualActions,
|
|
482
|
-
selectedActions: evaluationTurn.selectedActions,
|
|
483
|
-
executedActions: evaluationTurn.executedActions,
|
|
484
|
-
decisionMatch,
|
|
485
|
-
primaryContextMatch,
|
|
486
|
-
secondaryContextExactMatch,
|
|
487
|
-
routingMatch,
|
|
488
|
-
actionMatch,
|
|
489
|
-
selectedActionMatch,
|
|
490
|
-
executedActionMatch,
|
|
491
|
-
trajectoryCaptured: Boolean(trajectory),
|
|
492
|
-
responseText: evaluationTurn.responseText,
|
|
493
|
-
callbackTexts: evaluationTurn.callbackTexts,
|
|
494
|
-
warnings: evaluationTurn.warnings,
|
|
495
|
-
turnExecutions,
|
|
496
|
-
trajectory,
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
export async function executeRoleplayEpisodes(episodes, options = {}) {
|
|
500
|
-
const runtime = await resolveRuntime(options.runtime);
|
|
501
|
-
const executions = [];
|
|
502
|
-
for (const episode of episodes) {
|
|
503
|
-
executions.push(await executeRoleplayEpisode(episode, {
|
|
504
|
-
...options,
|
|
505
|
-
runtime,
|
|
506
|
-
}));
|
|
507
|
-
}
|
|
508
|
-
return executions;
|
|
509
|
-
}
|
|
510
|
-
export function buildRoleplayExecutionReport(executions, trajectoryDatasetSummary) {
|
|
511
|
-
const totalEpisodes = executions.length;
|
|
512
|
-
const decisionMatches = executions.filter((execution) => execution.decisionMatch).length;
|
|
513
|
-
const routingMatches = executions.filter((execution) => execution.routingMatch).length;
|
|
514
|
-
const primaryContextMatches = executions.filter((execution) => execution.primaryContextMatch).length;
|
|
515
|
-
const secondaryContextExactMatches = executions.filter((execution) => execution.secondaryContextExactMatch).length;
|
|
516
|
-
const actionRelevantExecutions = executions.filter((execution) => execution.expectedAction);
|
|
517
|
-
const actionMatches = actionRelevantExecutions.filter((execution) => execution.actionMatch).length;
|
|
518
|
-
const selectedActionMatches = actionRelevantExecutions.filter((execution) => execution.selectedActionMatch).length;
|
|
519
|
-
const executedActionMatches = actionRelevantExecutions.filter((execution) => execution.executedActionMatch).length;
|
|
520
|
-
const trajectoryCaptured = executions.filter((execution) => execution.trajectoryCaptured).length;
|
|
521
|
-
const decisionConfusionMatrix = createDecisionConfusionMatrix();
|
|
522
|
-
const warningCounts = {};
|
|
523
|
-
const byPrimaryContext = {};
|
|
524
|
-
const byPattern = {};
|
|
525
|
-
for (const execution of executions) {
|
|
526
|
-
decisionConfusionMatrix[execution.expectedDecision][execution.actualDecision] += 1;
|
|
527
|
-
for (const warning of execution.warnings) {
|
|
528
|
-
warningCounts[warning] = (warningCounts[warning] ?? 0) + 1;
|
|
529
|
-
}
|
|
530
|
-
const contextKey = execution.expectedPrimaryContext.toLowerCase();
|
|
531
|
-
byPrimaryContext[contextKey] ??= buildEmptyBucketReport();
|
|
532
|
-
updateBucketReport(byPrimaryContext[contextKey], execution);
|
|
533
|
-
const patternKey = execution.pattern ?? "unknown";
|
|
534
|
-
byPattern[patternKey] ??= buildEmptyBucketReport();
|
|
535
|
-
updateBucketReport(byPattern[patternKey], execution);
|
|
536
|
-
}
|
|
537
|
-
return {
|
|
538
|
-
totalEpisodes,
|
|
539
|
-
decisionMatches,
|
|
540
|
-
routingMatches,
|
|
541
|
-
primaryContextMatches,
|
|
542
|
-
secondaryContextExactMatches,
|
|
543
|
-
actionMatches,
|
|
544
|
-
selectedActionMatches,
|
|
545
|
-
executedActionMatches,
|
|
546
|
-
trajectoryCaptured,
|
|
547
|
-
decisionAccuracy: decisionMatches / (totalEpisodes || 1),
|
|
548
|
-
routingAccuracy: routingMatches / (totalEpisodes || 1),
|
|
549
|
-
primaryContextAccuracy: primaryContextMatches / (totalEpisodes || 1),
|
|
550
|
-
secondaryContextExactAccuracy: secondaryContextExactMatches / (totalEpisodes || 1),
|
|
551
|
-
actionAccuracy: actionMatches / (actionRelevantExecutions.length || 1),
|
|
552
|
-
selectedActionAccuracy: selectedActionMatches / (actionRelevantExecutions.length || 1),
|
|
553
|
-
executedActionAccuracy: executedActionMatches / (actionRelevantExecutions.length || 1),
|
|
554
|
-
trajectoryCaptureRate: trajectoryCaptured / (totalEpisodes || 1),
|
|
555
|
-
decisionConfusionMatrix,
|
|
556
|
-
warningCounts,
|
|
557
|
-
byPrimaryContext: Object.fromEntries(Object.entries(byPrimaryContext).map(([context, bucket]) => [
|
|
558
|
-
context,
|
|
559
|
-
finalizeBucketReport(bucket),
|
|
560
|
-
])),
|
|
561
|
-
byPattern: Object.fromEntries(Object.entries(byPattern).map(([pattern, bucket]) => [
|
|
562
|
-
pattern,
|
|
563
|
-
finalizeBucketReport(bucket),
|
|
564
|
-
])),
|
|
565
|
-
trajectoryDatasetSummary,
|
|
566
|
-
mismatches: executions
|
|
567
|
-
.filter((execution) => !execution.decisionMatch ||
|
|
568
|
-
!execution.routingMatch ||
|
|
569
|
-
!execution.actionMatch ||
|
|
570
|
-
!execution.selectedActionMatch ||
|
|
571
|
-
!execution.executedActionMatch)
|
|
572
|
-
.map((execution) => ({
|
|
573
|
-
episodeId: execution.episodeId,
|
|
574
|
-
pattern: execution.pattern,
|
|
575
|
-
expectedDecision: execution.expectedDecision,
|
|
576
|
-
actualDecision: execution.actualDecision,
|
|
577
|
-
expectedPrimaryContext: execution.expectedPrimaryContext,
|
|
578
|
-
actualPrimaryContext: execution.actualPrimaryContext,
|
|
579
|
-
expectedAction: execution.expectedAction,
|
|
580
|
-
actualActions: execution.actualActions,
|
|
581
|
-
selectedActions: execution.selectedActions,
|
|
582
|
-
executedActions: execution.executedActions,
|
|
583
|
-
warnings: execution.warnings,
|
|
584
|
-
})),
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
export async function exportRoleplayExecutionResults(executions, outputDir) {
|
|
588
|
-
await mkdir(outputDir, { recursive: true });
|
|
589
|
-
const executionsPath = join(outputDir, "roleplay_execution_results.json");
|
|
590
|
-
const reportPath = join(outputDir, "roleplay_execution_report.json");
|
|
591
|
-
const trajectories = executions
|
|
592
|
-
.map((execution) => execution.trajectory)
|
|
593
|
-
.filter((trajectory) => Boolean(trajectory));
|
|
594
|
-
const trajectoryDataset = trajectories.length > 0
|
|
595
|
-
? await exportTrajectoryTaskDatasets(trajectories, join(outputDir, "trajectory-datasets"))
|
|
596
|
-
: undefined;
|
|
597
|
-
const report = buildRoleplayExecutionReport(executions, trajectoryDataset?.summary ?? null);
|
|
598
|
-
await writeFile(executionsPath, JSON.stringify(executions, null, 2));
|
|
599
|
-
await writeFile(reportPath, JSON.stringify(report, null, 2));
|
|
600
|
-
return {
|
|
601
|
-
executionsPath,
|
|
602
|
-
reportPath,
|
|
603
|
-
trajectoryDataset,
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
export async function loadRoleplayEpisodesFromPath(inputPath) {
|
|
607
|
-
const raw = await readFile(inputPath, "utf-8");
|
|
608
|
-
if (inputPath.endsWith(".jsonl")) {
|
|
609
|
-
return raw
|
|
610
|
-
.split("\n")
|
|
611
|
-
.map((line) => line.trim())
|
|
612
|
-
.filter(Boolean)
|
|
613
|
-
.map((line) => JSON.parse(line))
|
|
614
|
-
.map((line) => ({
|
|
615
|
-
id: line.episodeId,
|
|
616
|
-
blueprintId: line.blueprintId,
|
|
617
|
-
agentName: line.agentName,
|
|
618
|
-
platform: "group-chat",
|
|
619
|
-
roomType: "group",
|
|
620
|
-
primaryContext: line.primaryContext,
|
|
621
|
-
secondaryContexts: line.secondaryContexts,
|
|
622
|
-
expectedDecision: line.expectedDecision,
|
|
623
|
-
expectedAction: line.expectedAction,
|
|
624
|
-
evaluationTurnId: line.evaluationTurnId,
|
|
625
|
-
turns: line.conversation.map((turn) => ({
|
|
626
|
-
id: turn.id,
|
|
627
|
-
role: turn.role,
|
|
628
|
-
speaker: turn.speaker,
|
|
629
|
-
content: turn.content,
|
|
630
|
-
isEvaluationTarget: turn.id === line.evaluationTurnId,
|
|
631
|
-
})),
|
|
632
|
-
metadata: {
|
|
633
|
-
pattern: "manifest-import",
|
|
634
|
-
generatedBy: "manifest",
|
|
635
|
-
generatedAt: new Date().toISOString(),
|
|
636
|
-
sourceSampleId: line.episodeId,
|
|
637
|
-
},
|
|
638
|
-
}));
|
|
639
|
-
}
|
|
640
|
-
const parsed = JSON.parse(raw);
|
|
641
|
-
if (!Array.isArray(parsed)) {
|
|
642
|
-
throw new Error(`Expected an array of roleplay episodes in ${inputPath}`);
|
|
643
|
-
}
|
|
644
|
-
return parsed;
|
|
645
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { AgentContext } from "./context-types.js";
|
|
2
|
-
import type { TrainingSample } from "./dataset-generator.js";
|
|
3
|
-
export interface RoleplayTurn {
|
|
4
|
-
id: string;
|
|
5
|
-
role: "participant" | "assistant";
|
|
6
|
-
speaker: string;
|
|
7
|
-
content: string;
|
|
8
|
-
isEvaluationTarget: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface RoleplayEpisode {
|
|
11
|
-
id: string;
|
|
12
|
-
blueprintId: string;
|
|
13
|
-
agentName: string;
|
|
14
|
-
platform: string;
|
|
15
|
-
roomType: "group";
|
|
16
|
-
primaryContext: AgentContext;
|
|
17
|
-
secondaryContexts: AgentContext[];
|
|
18
|
-
expectedDecision: "RESPOND" | "IGNORE" | "STOP";
|
|
19
|
-
expectedAction?: string;
|
|
20
|
-
evaluationTurnId: string;
|
|
21
|
-
turns: RoleplayTurn[];
|
|
22
|
-
metadata: {
|
|
23
|
-
pattern: string;
|
|
24
|
-
generatedBy: string;
|
|
25
|
-
generatedAt: string;
|
|
26
|
-
sourceSampleId: string;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export interface RoleplayManifestLine {
|
|
30
|
-
episodeId: string;
|
|
31
|
-
blueprintId: string;
|
|
32
|
-
agentName: string;
|
|
33
|
-
evaluationTurnId: string;
|
|
34
|
-
expectedDecision: "RESPOND" | "IGNORE" | "STOP";
|
|
35
|
-
primaryContext: AgentContext;
|
|
36
|
-
secondaryContexts: AgentContext[];
|
|
37
|
-
expectedAction?: string;
|
|
38
|
-
conversation: Array<{
|
|
39
|
-
id: string;
|
|
40
|
-
role: "participant" | "assistant";
|
|
41
|
-
speaker: string;
|
|
42
|
-
content: string;
|
|
43
|
-
}>;
|
|
44
|
-
}
|
|
45
|
-
export interface RoleplayExportPaths {
|
|
46
|
-
episodesPath: string;
|
|
47
|
-
manifestPath: string;
|
|
48
|
-
tuningPath: string;
|
|
49
|
-
}
|
|
50
|
-
export declare function buildRoleplayEpisode(sample: TrainingSample): RoleplayEpisode;
|
|
51
|
-
export declare function buildRoleplayEpisodes(samples: TrainingSample[]): RoleplayEpisode[];
|
|
52
|
-
export declare function toRoleplayManifestLine(episode: RoleplayEpisode): RoleplayManifestLine;
|
|
53
|
-
export declare function exportRoleplayEpisodes(episodes: RoleplayEpisode[], samples: TrainingSample[], outputDir: string): Promise<RoleplayExportPaths>;
|
|
54
|
-
//# sourceMappingURL=roleplay-trajectories.d.ts.map
|