@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,703 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Synthetic dataset generator for fine-tuning the shouldRespond + context-routing
|
|
3
|
-
* classifier and the action planner.
|
|
4
|
-
*
|
|
5
|
-
* Architecture:
|
|
6
|
-
* 1. Takes scenario blueprints and expands each into N variants
|
|
7
|
-
* 2. Uses a teacher model (Claude/GPT-5) to generate realistic conversations
|
|
8
|
-
* 3. Randomizes agent name per sample to prevent statistical pollution
|
|
9
|
-
* 4. Exports in Gemini supervised tuning JSONL format
|
|
10
|
-
*
|
|
11
|
-
* Teacher model selection:
|
|
12
|
-
* - ANTHROPIC_API_KEY → Claude Sonnet 4
|
|
13
|
-
* - OPENAI_API_KEY → GPT-5 / GPT-4o
|
|
14
|
-
* - Falls back to whichever is available
|
|
15
|
-
*/
|
|
16
|
-
import * as ElizaCore from "@elizaos/core";
|
|
17
|
-
import { randomUUID } from "crypto";
|
|
18
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
19
|
-
import { join } from "path";
|
|
20
|
-
import { ACTION_CONTEXT_MAP, ALL_CONTEXTS, PROVIDER_CONTEXT_MAP, } from "./context-catalog.js";
|
|
21
|
-
import { ALL_BLUEPRINTS, } from "./scenario-blueprints.js";
|
|
22
|
-
const SHOULD_RESPOND_PROMPT_TEMPLATE = `task: Decide whether {{agentName}} should respond, ignore, or stop.
|
|
23
|
-
|
|
24
|
-
context:
|
|
25
|
-
{{providers}}
|
|
26
|
-
|
|
27
|
-
available_contexts:
|
|
28
|
-
{{availableContexts}}
|
|
29
|
-
|
|
30
|
-
rules[6]:
|
|
31
|
-
- direct mention of {{agentName}} -> RESPOND
|
|
32
|
-
- different assistant name or talking to someone else -> IGNORE unless {{agentName}} is also directly addressed
|
|
33
|
-
- prior participation by {{agentName}} in the thread is not enough by itself; the newest message must still clearly expect {{agentName}} -> otherwise IGNORE
|
|
34
|
-
- request to stop or be quiet directed at {{agentName}} -> STOP
|
|
35
|
-
- if multiple people are mentioned and {{agentName}} is one of the addressees -> RESPOND
|
|
36
|
-
- if unsure whether the speaker is talking to {{agentName}}, prefer IGNORE over hallucinating relevance
|
|
37
|
-
|
|
38
|
-
context_routing:
|
|
39
|
-
- primaryContext: choose one context from available_contexts, or "general" if none apply
|
|
40
|
-
- secondaryContexts: optional comma-separated list of additional relevant contexts
|
|
41
|
-
- evidenceTurnIds: optional comma-separated list of memory IDs supporting the decision
|
|
42
|
-
|
|
43
|
-
decision_note:
|
|
44
|
-
- respond only when the latest message is talking TO {{agentName}}
|
|
45
|
-
- talking TO {{agentName}} means name mention, reply chain, or a clear follow-up that still expects {{agentName}} to answer
|
|
46
|
-
- casual conversation between other users is not enough
|
|
47
|
-
- if another assistant already answered and nobody re-addressed {{agentName}}, IGNORE
|
|
48
|
-
- if {{agentName}} already replied recently and nobody re-addressed {{agentName}}, IGNORE
|
|
49
|
-
- talking ABOUT {{agentName}} or continuing a room conversation around them is not enough
|
|
50
|
-
|
|
51
|
-
output:
|
|
52
|
-
TOON only. Return exactly one TOON document. No prose before or after it. No <think>.
|
|
53
|
-
|
|
54
|
-
Example:
|
|
55
|
-
name: {{agentName}}
|
|
56
|
-
reasoning: Direct mention and clear follow-up.
|
|
57
|
-
action: RESPOND
|
|
58
|
-
primaryContext: wallet
|
|
59
|
-
secondaryContexts:
|
|
60
|
-
evidenceTurnIds:
|
|
61
|
-
|
|
62
|
-
Example:
|
|
63
|
-
name: {{agentName}}
|
|
64
|
-
reasoning: Direct mention but no relevant action.
|
|
65
|
-
action: IGNORE
|
|
66
|
-
primaryContext: general
|
|
67
|
-
secondaryContexts:
|
|
68
|
-
evidenceTurnIds:`;
|
|
69
|
-
// ==================== Name pools ====================
|
|
70
|
-
const AGENT_NAMES = [
|
|
71
|
-
"Nova",
|
|
72
|
-
"Kai",
|
|
73
|
-
"Echo",
|
|
74
|
-
"Luna",
|
|
75
|
-
"Atlas",
|
|
76
|
-
"Vex",
|
|
77
|
-
"Iris",
|
|
78
|
-
"Cypher",
|
|
79
|
-
"Sage",
|
|
80
|
-
"Bolt",
|
|
81
|
-
"Pixel",
|
|
82
|
-
"Nyx",
|
|
83
|
-
"Orion",
|
|
84
|
-
"Zephyr",
|
|
85
|
-
"Flux",
|
|
86
|
-
"Aria",
|
|
87
|
-
"Cosmo",
|
|
88
|
-
"Dash",
|
|
89
|
-
"Ember",
|
|
90
|
-
"Ghost",
|
|
91
|
-
"Helix",
|
|
92
|
-
"Jade",
|
|
93
|
-
"Karma",
|
|
94
|
-
"Lux",
|
|
95
|
-
"Muse",
|
|
96
|
-
"Neo",
|
|
97
|
-
"Onyx",
|
|
98
|
-
"Proto",
|
|
99
|
-
"Qubit",
|
|
100
|
-
"Rune",
|
|
101
|
-
"Spark",
|
|
102
|
-
"Titan",
|
|
103
|
-
"Uno",
|
|
104
|
-
"Volt",
|
|
105
|
-
"Wren",
|
|
106
|
-
"Xeno",
|
|
107
|
-
"Yara",
|
|
108
|
-
"Zen",
|
|
109
|
-
"Chip",
|
|
110
|
-
"Delta",
|
|
111
|
-
"Ava",
|
|
112
|
-
"Rex",
|
|
113
|
-
"Sky",
|
|
114
|
-
"Zara",
|
|
115
|
-
];
|
|
116
|
-
const PARTICIPANT_NAMES = [
|
|
117
|
-
"Alice",
|
|
118
|
-
"Bob",
|
|
119
|
-
"Charlie",
|
|
120
|
-
"Dave",
|
|
121
|
-
"Eve",
|
|
122
|
-
"Frank",
|
|
123
|
-
"Grace",
|
|
124
|
-
"Hank",
|
|
125
|
-
"Ivy",
|
|
126
|
-
"Jack",
|
|
127
|
-
"Karen",
|
|
128
|
-
"Leo",
|
|
129
|
-
"Mia",
|
|
130
|
-
"Nick",
|
|
131
|
-
"Olivia",
|
|
132
|
-
"Pete",
|
|
133
|
-
"Quinn",
|
|
134
|
-
"Rose",
|
|
135
|
-
"Sam",
|
|
136
|
-
"Tina",
|
|
137
|
-
"Uma",
|
|
138
|
-
"Vince",
|
|
139
|
-
"Wendy",
|
|
140
|
-
"Xavier",
|
|
141
|
-
"Yuki",
|
|
142
|
-
"Zack",
|
|
143
|
-
"Maya",
|
|
144
|
-
"Raj",
|
|
145
|
-
"Sofia",
|
|
146
|
-
"Tyler",
|
|
147
|
-
"Aisha",
|
|
148
|
-
"Ben",
|
|
149
|
-
"Chloe",
|
|
150
|
-
"Dan",
|
|
151
|
-
"Elena",
|
|
152
|
-
"Finn",
|
|
153
|
-
"Gabe",
|
|
154
|
-
"Hannah",
|
|
155
|
-
"Isaac",
|
|
156
|
-
"Jade",
|
|
157
|
-
];
|
|
158
|
-
const OTHER_BOT_NAMES = [
|
|
159
|
-
"AssistBot",
|
|
160
|
-
"Helper",
|
|
161
|
-
"Cortana",
|
|
162
|
-
"Alexa",
|
|
163
|
-
"Siri",
|
|
164
|
-
"Bard",
|
|
165
|
-
"CoPilot",
|
|
166
|
-
"Genie",
|
|
167
|
-
"Oracle",
|
|
168
|
-
"Alfred",
|
|
169
|
-
"Jarvis",
|
|
170
|
-
"Friday",
|
|
171
|
-
];
|
|
172
|
-
const PLATFORMS = ["telegram", "discord", "slack", "matrix", "irc"];
|
|
173
|
-
const logActiveTrajectoryLlmCall = "logActiveTrajectoryLlmCall" in ElizaCore &&
|
|
174
|
-
typeof ElizaCore.logActiveTrajectoryLlmCall === "function"
|
|
175
|
-
? ElizaCore.logActiveTrajectoryLlmCall
|
|
176
|
-
: undefined;
|
|
177
|
-
const withStandaloneTrajectory = "withStandaloneTrajectory" in ElizaCore &&
|
|
178
|
-
typeof ElizaCore.withStandaloneTrajectory === "function"
|
|
179
|
-
? ElizaCore.withStandaloneTrajectory
|
|
180
|
-
: async (_runtime, _options, callback) => await callback();
|
|
181
|
-
function logTeacherCall({ runtime, model, modelVersion, systemPrompt, userPrompt, response, temperature, maxTokens, actionType, latencyMs, promptTokens, completionTokens, }) {
|
|
182
|
-
logActiveTrajectoryLlmCall?.(runtime, {
|
|
183
|
-
model,
|
|
184
|
-
modelVersion,
|
|
185
|
-
systemPrompt,
|
|
186
|
-
userPrompt,
|
|
187
|
-
response,
|
|
188
|
-
temperature,
|
|
189
|
-
maxTokens,
|
|
190
|
-
purpose: "training.teacher",
|
|
191
|
-
actionType,
|
|
192
|
-
latencyMs,
|
|
193
|
-
promptTokens,
|
|
194
|
-
completionTokens,
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Create a teacher model using the Anthropic API.
|
|
199
|
-
*/
|
|
200
|
-
export function createAnthropicTeacher(apiKey, runtime) {
|
|
201
|
-
return {
|
|
202
|
-
name: "anthropic/claude-sonnet-4",
|
|
203
|
-
async generate(systemPrompt, userPrompt) {
|
|
204
|
-
return await withStandaloneTrajectory(runtime, {
|
|
205
|
-
source: "training",
|
|
206
|
-
metadata: {
|
|
207
|
-
provider: "anthropic",
|
|
208
|
-
model: "claude-sonnet-4-20250514",
|
|
209
|
-
purpose: "teacher",
|
|
210
|
-
},
|
|
211
|
-
}, async () => {
|
|
212
|
-
const startedAt = Date.now();
|
|
213
|
-
const response = await fetch("https://api.anthropic.com/v1/messages", {
|
|
214
|
-
method: "POST",
|
|
215
|
-
headers: {
|
|
216
|
-
"content-type": "application/json",
|
|
217
|
-
"x-api-key": apiKey,
|
|
218
|
-
"anthropic-version": "2023-06-01",
|
|
219
|
-
},
|
|
220
|
-
body: JSON.stringify({
|
|
221
|
-
model: "claude-sonnet-4-20250514",
|
|
222
|
-
max_tokens: 4096,
|
|
223
|
-
temperature: 1,
|
|
224
|
-
system: systemPrompt,
|
|
225
|
-
messages: [{ role: "user", content: userPrompt }],
|
|
226
|
-
}),
|
|
227
|
-
});
|
|
228
|
-
if (!response.ok) {
|
|
229
|
-
throw new Error(`Anthropic API error: ${response.status} ${await response.text()}`);
|
|
230
|
-
}
|
|
231
|
-
const data = (await response.json());
|
|
232
|
-
const text = data.content[0]?.text ?? "";
|
|
233
|
-
logTeacherCall({
|
|
234
|
-
runtime,
|
|
235
|
-
model: "anthropic/claude-sonnet-4",
|
|
236
|
-
modelVersion: "claude-sonnet-4-20250514",
|
|
237
|
-
systemPrompt,
|
|
238
|
-
userPrompt,
|
|
239
|
-
response: text,
|
|
240
|
-
temperature: 1,
|
|
241
|
-
maxTokens: 4096,
|
|
242
|
-
actionType: "training.teacher.anthropic.generate",
|
|
243
|
-
latencyMs: Date.now() - startedAt,
|
|
244
|
-
promptTokens: data.usage?.input_tokens,
|
|
245
|
-
completionTokens: data.usage?.output_tokens,
|
|
246
|
-
});
|
|
247
|
-
return text;
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Create a teacher model using the OpenAI API.
|
|
254
|
-
*/
|
|
255
|
-
export function createOpenAITeacher(apiKey, runtime) {
|
|
256
|
-
return {
|
|
257
|
-
name: "openai/gpt-5.4",
|
|
258
|
-
async generate(systemPrompt, userPrompt) {
|
|
259
|
-
return await withStandaloneTrajectory(runtime, {
|
|
260
|
-
source: "training",
|
|
261
|
-
metadata: {
|
|
262
|
-
provider: "openai",
|
|
263
|
-
model: "gpt-5.4",
|
|
264
|
-
purpose: "teacher",
|
|
265
|
-
},
|
|
266
|
-
}, async () => {
|
|
267
|
-
const startedAt = Date.now();
|
|
268
|
-
const response = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
269
|
-
method: "POST",
|
|
270
|
-
headers: {
|
|
271
|
-
"content-type": "application/json",
|
|
272
|
-
authorization: `Bearer ${apiKey}`,
|
|
273
|
-
},
|
|
274
|
-
body: JSON.stringify({
|
|
275
|
-
model: "gpt-5.4",
|
|
276
|
-
messages: [
|
|
277
|
-
{ role: "system", content: systemPrompt },
|
|
278
|
-
{ role: "user", content: userPrompt },
|
|
279
|
-
],
|
|
280
|
-
max_tokens: 4096,
|
|
281
|
-
temperature: 0.9,
|
|
282
|
-
}),
|
|
283
|
-
});
|
|
284
|
-
if (!response.ok) {
|
|
285
|
-
throw new Error(`OpenAI API error: ${response.status} ${await response.text()}`);
|
|
286
|
-
}
|
|
287
|
-
const data = (await response.json());
|
|
288
|
-
const text = data.choices[0]?.message?.content ?? "";
|
|
289
|
-
logTeacherCall({
|
|
290
|
-
runtime,
|
|
291
|
-
model: "openai/gpt-5.4",
|
|
292
|
-
modelVersion: data.model,
|
|
293
|
-
systemPrompt,
|
|
294
|
-
userPrompt,
|
|
295
|
-
response: text,
|
|
296
|
-
temperature: 0.9,
|
|
297
|
-
maxTokens: 4096,
|
|
298
|
-
actionType: "training.teacher.openai.generate",
|
|
299
|
-
latencyMs: Date.now() - startedAt,
|
|
300
|
-
promptTokens: data.usage?.prompt_tokens,
|
|
301
|
-
completionTokens: data.usage?.completion_tokens,
|
|
302
|
-
});
|
|
303
|
-
return text;
|
|
304
|
-
});
|
|
305
|
-
},
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
// ==================== Randomization utilities ====================
|
|
309
|
-
function pickRandom(arr) {
|
|
310
|
-
return arr[Math.floor(Math.random() * arr.length)];
|
|
311
|
-
}
|
|
312
|
-
function pickN(arr, n) {
|
|
313
|
-
const shuffled = [...arr].sort(() => Math.random() - 0.5);
|
|
314
|
-
return shuffled.slice(0, n);
|
|
315
|
-
}
|
|
316
|
-
function randomAgentName(exclude = []) {
|
|
317
|
-
const available = AGENT_NAMES.filter((n) => !exclude.map((e) => e.toLowerCase()).includes(n.toLowerCase()));
|
|
318
|
-
return pickRandom(available.length > 0 ? available : AGENT_NAMES);
|
|
319
|
-
}
|
|
320
|
-
function randomParticipants(count, exclude = []) {
|
|
321
|
-
const available = PARTICIPANT_NAMES.filter((n) => !exclude.map((e) => e.toLowerCase()).includes(n.toLowerCase()));
|
|
322
|
-
return pickN(available, count);
|
|
323
|
-
}
|
|
324
|
-
// ==================== Prompt construction ====================
|
|
325
|
-
function buildTeacherSystemPrompt() {
|
|
326
|
-
return `You are a synthetic data generator for training an AI agent's message classifier.
|
|
327
|
-
Your task is to generate realistic multi-turn group chat conversations.
|
|
328
|
-
|
|
329
|
-
IMPORTANT RULES:
|
|
330
|
-
1. Output ONLY valid JSON. No markdown, no explanation, no preamble.
|
|
331
|
-
2. Each message must have "name" (speaker name) and "content" (message text).
|
|
332
|
-
3. Messages should feel natural - casual, varied length, sometimes with typos.
|
|
333
|
-
4. Group chats should have 3-6 participants plus optionally the agent.
|
|
334
|
-
5. The agent's messages (when present) should be clearly from an AI assistant.
|
|
335
|
-
6. NEVER include the expected classifier output in the conversation itself.
|
|
336
|
-
7. Messages should be diverse in tone: some short, some long, some with emoji.
|
|
337
|
-
|
|
338
|
-
Output format:
|
|
339
|
-
{
|
|
340
|
-
"messages": [
|
|
341
|
-
{"name": "Alice", "content": "hey everyone"},
|
|
342
|
-
{"name": "Bob", "content": "what's up"},
|
|
343
|
-
...
|
|
344
|
-
]
|
|
345
|
-
}`;
|
|
346
|
-
}
|
|
347
|
-
function buildTeacherUserPrompt(blueprint, agentName, participants, platform, otherBotName, variant = 0) {
|
|
348
|
-
const turnRange = `${blueprint.minContextTurns}-${blueprint.maxContextTurns}`;
|
|
349
|
-
const participantList = participants.join(", ");
|
|
350
|
-
let extraInstructions = "";
|
|
351
|
-
if (blueprint.pattern === "group_wrong_agent" && otherBotName) {
|
|
352
|
-
extraInstructions = `There is ANOTHER bot named "${otherBotName}" in the chat. Someone addresses "${otherBotName}" (not "${agentName}"). "${agentName}" should NOT be addressed.`;
|
|
353
|
-
}
|
|
354
|
-
if (blueprint.pattern === "group_about_agent") {
|
|
355
|
-
extraInstructions = `People talk ABOUT "${agentName}" in third person ("the bot", "it", "${agentName} can do X") but NEVER address it directly. No "@${agentName}" or "${agentName}, can you...".`;
|
|
356
|
-
}
|
|
357
|
-
if (blueprint.pattern === "group_noise") {
|
|
358
|
-
extraInstructions = `"${agentName}" should NOT appear in any message at all. This is pure human conversation.`;
|
|
359
|
-
}
|
|
360
|
-
if (blueprint.pattern === "group_action_emergence") {
|
|
361
|
-
extraInstructions = `The intent to perform an action should emerge GRADUALLY over multiple messages. Users discuss the topic, one user's intent builds up, and finally they ask the agent to execute. The last 1-2 messages should clearly direct the agent.`;
|
|
362
|
-
}
|
|
363
|
-
if (blueprint.pattern === "group_multi_turn_intent") {
|
|
364
|
-
extraInstructions = `The action intent should build across 3+ messages from the same user. They start by observing/discussing, then express desire, then finally ask the agent to act.`;
|
|
365
|
-
}
|
|
366
|
-
const keywordsHint = blueprint.groundingKeywords.length > 0
|
|
367
|
-
? `Try to naturally include some of these words/phrases: ${blueprint.groundingKeywords.join(", ")}`
|
|
368
|
-
: "";
|
|
369
|
-
return `Generate variant #${variant + 1} of a ${platform} group chat conversation.
|
|
370
|
-
|
|
371
|
-
SCENARIO: ${blueprint.description}
|
|
372
|
-
AGENT NAME: ${agentName}
|
|
373
|
-
PARTICIPANTS: ${participantList}
|
|
374
|
-
PLATFORM: ${platform}
|
|
375
|
-
TARGET TURNS: ${turnRange} messages
|
|
376
|
-
CONVERSATION PATTERN: ${blueprint.pattern}
|
|
377
|
-
${keywordsHint}
|
|
378
|
-
${extraInstructions}
|
|
379
|
-
|
|
380
|
-
${blueprint.generationHint}
|
|
381
|
-
|
|
382
|
-
Remember:
|
|
383
|
-
- Output ONLY the JSON with "messages" array
|
|
384
|
-
- Each message has "name" and "content"
|
|
385
|
-
- Make it feel natural and realistic
|
|
386
|
-
- Vary message lengths and tones
|
|
387
|
-
- The last message should be the one the classifier evaluates`;
|
|
388
|
-
}
|
|
389
|
-
// ==================== Core generation ====================
|
|
390
|
-
/**
|
|
391
|
-
* Generate a single training sample from a blueprint.
|
|
392
|
-
*/
|
|
393
|
-
export async function generateSample(blueprint, teacher, variant, totalVariants) {
|
|
394
|
-
const agentName = randomAgentName();
|
|
395
|
-
const participantCount = 3 + Math.floor(Math.random() * 3); // 3-5
|
|
396
|
-
const participants = randomParticipants(participantCount, [agentName]);
|
|
397
|
-
const platform = pickRandom(PLATFORMS);
|
|
398
|
-
const otherBotName = blueprint.pattern === "group_wrong_agent"
|
|
399
|
-
? pickRandom(OTHER_BOT_NAMES)
|
|
400
|
-
: undefined;
|
|
401
|
-
const systemPrompt = buildTeacherSystemPrompt();
|
|
402
|
-
const userPrompt = buildTeacherUserPrompt(blueprint, agentName, participants, platform, otherBotName, variant);
|
|
403
|
-
const raw = await teacher.generate(systemPrompt, userPrompt);
|
|
404
|
-
// Parse the teacher's output
|
|
405
|
-
let parsed;
|
|
406
|
-
try {
|
|
407
|
-
// Strip markdown code fences if present
|
|
408
|
-
const cleaned = raw.replace(/```json\n?|\n?```/g, "").trim();
|
|
409
|
-
parsed = JSON.parse(cleaned);
|
|
410
|
-
}
|
|
411
|
-
catch {
|
|
412
|
-
// If parsing fails, create a minimal sample
|
|
413
|
-
parsed = {
|
|
414
|
-
messages: [
|
|
415
|
-
{ name: participants[0], content: "Hey everyone" },
|
|
416
|
-
{
|
|
417
|
-
name: participants[1],
|
|
418
|
-
content: blueprint.decision === "RESPOND"
|
|
419
|
-
? `${agentName}, can you help?`
|
|
420
|
-
: "What's for lunch?",
|
|
421
|
-
},
|
|
422
|
-
],
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
// Convert to training format
|
|
426
|
-
const messages = parsed.messages.map((m) => ({
|
|
427
|
-
role: m.name.trim().toLowerCase() === agentName.trim().toLowerCase()
|
|
428
|
-
? "assistant"
|
|
429
|
-
: "user",
|
|
430
|
-
name: m.name,
|
|
431
|
-
content: m.content,
|
|
432
|
-
}));
|
|
433
|
-
const expectedOutput = {
|
|
434
|
-
decision: blueprint.decision,
|
|
435
|
-
primaryContext: blueprint.primaryContext,
|
|
436
|
-
secondaryContexts: blueprint.secondaryContexts ?? [],
|
|
437
|
-
reasoning: blueprint.description,
|
|
438
|
-
expectedAction: blueprint.expectedAction,
|
|
439
|
-
};
|
|
440
|
-
return {
|
|
441
|
-
id: randomUUID(),
|
|
442
|
-
blueprintId: blueprint.id,
|
|
443
|
-
agentName,
|
|
444
|
-
messages,
|
|
445
|
-
expectedOutput,
|
|
446
|
-
metadata: {
|
|
447
|
-
platform,
|
|
448
|
-
pattern: blueprint.pattern,
|
|
449
|
-
turnCount: messages.length,
|
|
450
|
-
generatedBy: teacher.name,
|
|
451
|
-
generatedAt: new Date().toISOString(),
|
|
452
|
-
variant,
|
|
453
|
-
totalVariants,
|
|
454
|
-
},
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Generate the full synthetic dataset.
|
|
459
|
-
*/
|
|
460
|
-
export async function generateDataset(config) {
|
|
461
|
-
let blueprints = ALL_BLUEPRINTS;
|
|
462
|
-
if (config.filterContexts) {
|
|
463
|
-
const ctxSet = new Set(config.filterContexts);
|
|
464
|
-
blueprints = blueprints.filter((b) => ctxSet.has(b.primaryContext) ||
|
|
465
|
-
b.secondaryContexts?.some((c) => ctxSet.has(c)));
|
|
466
|
-
}
|
|
467
|
-
if (config.filterDecisions) {
|
|
468
|
-
const decSet = new Set(config.filterDecisions);
|
|
469
|
-
blueprints = blueprints.filter((b) => decSet.has(b.decision));
|
|
470
|
-
}
|
|
471
|
-
if (config.limitBlueprints && config.limitBlueprints > 0) {
|
|
472
|
-
blueprints = blueprints.slice(0, config.limitBlueprints);
|
|
473
|
-
}
|
|
474
|
-
const totalSamples = blueprints.length * config.variantsPerBlueprint;
|
|
475
|
-
const samples = [];
|
|
476
|
-
let completed = 0;
|
|
477
|
-
const concurrency = config.concurrency ?? 5;
|
|
478
|
-
// Process in batches to respect concurrency
|
|
479
|
-
const tasks = [];
|
|
480
|
-
for (const blueprint of blueprints) {
|
|
481
|
-
for (let v = 0; v < config.variantsPerBlueprint; v++) {
|
|
482
|
-
tasks.push(() => generateSample(blueprint, config.teacher, v, config.variantsPerBlueprint));
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
// Execute with concurrency limit
|
|
486
|
-
for (let i = 0; i < tasks.length; i += concurrency) {
|
|
487
|
-
const batch = tasks.slice(i, i + concurrency);
|
|
488
|
-
const results = await Promise.allSettled(batch.map((fn) => fn()));
|
|
489
|
-
for (const result of results) {
|
|
490
|
-
completed++;
|
|
491
|
-
if (result.status === "fulfilled") {
|
|
492
|
-
samples.push(result.value);
|
|
493
|
-
config.onProgress?.(completed, totalSamples, result.value);
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
console.error(`Failed to generate sample: ${result.reason}`);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return samples;
|
|
501
|
-
}
|
|
502
|
-
// ==================== Export formats ====================
|
|
503
|
-
/**
|
|
504
|
-
* Convert a training sample to Gemini supervised tuning format.
|
|
505
|
-
* The system message contains the shouldRespond prompt template,
|
|
506
|
-
* the user message contains the conversation, and the model message
|
|
507
|
-
* contains the expected structured output.
|
|
508
|
-
*/
|
|
509
|
-
export function toGeminiFormat(sample, includeContextRouting = true) {
|
|
510
|
-
const systemContent = buildShouldRespondSystemPrompt(sample, includeContextRouting);
|
|
511
|
-
const userContent = buildShouldRespondUserPrompt(sample);
|
|
512
|
-
const modelContent = buildClassifierToonResponse(sample, includeContextRouting);
|
|
513
|
-
return {
|
|
514
|
-
messages: [
|
|
515
|
-
{ role: "system", content: systemContent },
|
|
516
|
-
{ role: "user", content: userContent },
|
|
517
|
-
{ role: "model", content: modelContent },
|
|
518
|
-
],
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
function renderTemplate(template, values) {
|
|
522
|
-
return template.replace(/{{(\w+)}}/g, (_match, key) => values[key] ?? "");
|
|
523
|
-
}
|
|
524
|
-
function uniqueStrings(values) {
|
|
525
|
-
return [...new Set(values.filter((value) => value.trim().length > 0))];
|
|
526
|
-
}
|
|
527
|
-
function listContextsForSample(sample) {
|
|
528
|
-
const contexts = new Set([
|
|
529
|
-
"general",
|
|
530
|
-
sample.expectedOutput.primaryContext,
|
|
531
|
-
...sample.expectedOutput.secondaryContexts,
|
|
532
|
-
]);
|
|
533
|
-
if (sample.expectedOutput.expectedAction) {
|
|
534
|
-
for (const actionContext of ACTION_CONTEXT_MAP[sample.expectedOutput.expectedAction] ?? []) {
|
|
535
|
-
contexts.add(actionContext);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
return [...contexts];
|
|
539
|
-
}
|
|
540
|
-
function getRelevantActions(sample) {
|
|
541
|
-
const activeContexts = new Set(listContextsForSample(sample));
|
|
542
|
-
const contextualActions = Object.entries(ACTION_CONTEXT_MAP)
|
|
543
|
-
.filter(([, contexts]) => contexts.some((context) => activeContexts.has(context)))
|
|
544
|
-
.map(([actionName]) => actionName);
|
|
545
|
-
return uniqueStrings([
|
|
546
|
-
sample.expectedOutput.expectedAction ?? "",
|
|
547
|
-
...contextualActions,
|
|
548
|
-
]).slice(0, 18);
|
|
549
|
-
}
|
|
550
|
-
function getRelevantProviders(sample) {
|
|
551
|
-
const activeContexts = new Set(listContextsForSample(sample));
|
|
552
|
-
return Object.entries(PROVIDER_CONTEXT_MAP)
|
|
553
|
-
.filter(([, contexts]) => contexts.some((context) => activeContexts.has(context)))
|
|
554
|
-
.map(([providerName]) => providerName)
|
|
555
|
-
.slice(0, 12);
|
|
556
|
-
}
|
|
557
|
-
function buildProvidersBlock(sample) {
|
|
558
|
-
const actions = getRelevantActions(sample);
|
|
559
|
-
const providers = getRelevantProviders(sample);
|
|
560
|
-
return [
|
|
561
|
-
`platform: ${sample.metadata.platform}`,
|
|
562
|
-
"actions:",
|
|
563
|
-
...(actions.length > 0 ? actions : ["REPLY"]).map((action) => `- ${action}`),
|
|
564
|
-
"providers:",
|
|
565
|
-
...(providers.length > 0 ? providers : ["recentMessages"]).map((provider) => `- ${provider}`),
|
|
566
|
-
].join("\n");
|
|
567
|
-
}
|
|
568
|
-
function buildShouldRespondSystemPrompt(sample, includeContextRouting) {
|
|
569
|
-
const baseTemplate = includeContextRouting
|
|
570
|
-
? SHOULD_RESPOND_PROMPT_TEMPLATE
|
|
571
|
-
: SHOULD_RESPOND_PROMPT_TEMPLATE.replace(/\ncontext_routing:[\s\S]*?\ndecision_note:/m, "\ndecision_note:")
|
|
572
|
-
.replace(/\nprimaryContext:.*$/m, "")
|
|
573
|
-
.replace(/\nsecondaryContexts:.*$/m, "")
|
|
574
|
-
.replace(/\nevidenceTurnIds:.*$/m, "");
|
|
575
|
-
return renderTemplate(baseTemplate, {
|
|
576
|
-
agentName: sample.agentName,
|
|
577
|
-
providers: buildProvidersBlock(sample),
|
|
578
|
-
availableContexts: listContextsForSample(sample).join(", "),
|
|
579
|
-
}).trim();
|
|
580
|
-
}
|
|
581
|
-
function buildShouldRespondUserPrompt(sample) {
|
|
582
|
-
const conversationLines = sample.messages
|
|
583
|
-
.map((message, index) => {
|
|
584
|
-
const turnId = `turn-${String(index + 1).padStart(3, "0")}`;
|
|
585
|
-
const speaker = message.role === "assistant"
|
|
586
|
-
? sample.agentName
|
|
587
|
-
: (message.name ?? "user");
|
|
588
|
-
return `[${turnId}] ${speaker}: ${message.content}`;
|
|
589
|
-
})
|
|
590
|
-
.join("\n");
|
|
591
|
-
return [
|
|
592
|
-
`platform: ${sample.metadata.platform}`,
|
|
593
|
-
`agent_name: ${sample.agentName}`,
|
|
594
|
-
"conversation:",
|
|
595
|
-
conversationLines,
|
|
596
|
-
"decision_target: evaluate the final message in this group-chat window.",
|
|
597
|
-
].join("\n");
|
|
598
|
-
}
|
|
599
|
-
function buildClassifierToonResponse(sample, includeContextRouting) {
|
|
600
|
-
const evidenceTurnIds = sample.messages
|
|
601
|
-
.slice(Math.max(0, sample.messages.length - 3))
|
|
602
|
-
.map((_, index, tail) => {
|
|
603
|
-
const absoluteIndex = sample.messages.length - tail.length + index + 1;
|
|
604
|
-
return `turn-${String(absoluteIndex).padStart(3, "0")}`;
|
|
605
|
-
})
|
|
606
|
-
.join(", ");
|
|
607
|
-
const lines = [
|
|
608
|
-
`name: ${sample.agentName}`,
|
|
609
|
-
`reasoning: ${sample.expectedOutput.reasoning}`,
|
|
610
|
-
`action: ${sample.expectedOutput.decision}`,
|
|
611
|
-
];
|
|
612
|
-
if (includeContextRouting) {
|
|
613
|
-
lines.push(`primaryContext: ${sample.expectedOutput.primaryContext}`);
|
|
614
|
-
lines.push(`secondaryContexts: ${sample.expectedOutput.secondaryContexts.join(", ")}`);
|
|
615
|
-
lines.push(`evidenceTurnIds: ${evidenceTurnIds}`);
|
|
616
|
-
}
|
|
617
|
-
if (sample.expectedOutput.expectedAction) {
|
|
618
|
-
lines.push(`expectedAction: ${sample.expectedOutput.expectedAction}`);
|
|
619
|
-
}
|
|
620
|
-
return lines.join("\n");
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* Export the full dataset to JSONL files for Gemini supervised tuning.
|
|
624
|
-
* Creates separate files for should_respond and context_routing.
|
|
625
|
-
*/
|
|
626
|
-
export async function exportToGeminiJSONL(samples, outputDir) {
|
|
627
|
-
await mkdir(outputDir, { recursive: true });
|
|
628
|
-
// Combined (shouldRespond + context routing)
|
|
629
|
-
const combinedPath = join(outputDir, "combined_training.jsonl");
|
|
630
|
-
const combinedLines = samples
|
|
631
|
-
.map((s) => JSON.stringify(toGeminiFormat(s, true)))
|
|
632
|
-
.join("\n");
|
|
633
|
-
await writeFile(combinedPath, combinedLines + "\n");
|
|
634
|
-
// shouldRespond only (no context routing — for Flash Lite)
|
|
635
|
-
const shouldRespondPath = join(outputDir, "should_respond_training.jsonl");
|
|
636
|
-
const srLines = samples
|
|
637
|
-
.map((s) => JSON.stringify(toGeminiFormat(s, false)))
|
|
638
|
-
.join("\n");
|
|
639
|
-
await writeFile(shouldRespondPath, srLines + "\n");
|
|
640
|
-
// Context routing only (for samples where decision is RESPOND)
|
|
641
|
-
const contextRoutingPath = join(outputDir, "context_routing_training.jsonl");
|
|
642
|
-
const crLines = samples
|
|
643
|
-
.filter((s) => s.expectedOutput.decision === "RESPOND")
|
|
644
|
-
.map((s) => JSON.stringify(toGeminiFormat(s, true)))
|
|
645
|
-
.join("\n");
|
|
646
|
-
await writeFile(contextRoutingPath, crLines + "\n");
|
|
647
|
-
// Also write the raw samples for analysis
|
|
648
|
-
const rawPath = join(outputDir, "raw_samples.json");
|
|
649
|
-
await writeFile(rawPath, JSON.stringify(samples, null, 2));
|
|
650
|
-
// Write stats
|
|
651
|
-
const stats = {
|
|
652
|
-
totalSamples: samples.length,
|
|
653
|
-
byDecision: {
|
|
654
|
-
RESPOND: samples.filter((s) => s.expectedOutput.decision === "RESPOND")
|
|
655
|
-
.length,
|
|
656
|
-
IGNORE: samples.filter((s) => s.expectedOutput.decision === "IGNORE")
|
|
657
|
-
.length,
|
|
658
|
-
STOP: samples.filter((s) => s.expectedOutput.decision === "STOP").length,
|
|
659
|
-
},
|
|
660
|
-
byContext: Object.fromEntries(ALL_CONTEXTS.map((ctx) => [
|
|
661
|
-
ctx,
|
|
662
|
-
samples.filter((s) => s.expectedOutput.primaryContext === ctx).length,
|
|
663
|
-
])),
|
|
664
|
-
byPattern: Object.fromEntries([...new Set(samples.map((s) => s.metadata.pattern))].map((p) => [
|
|
665
|
-
p,
|
|
666
|
-
samples.filter((s) => s.metadata.pattern === p).length,
|
|
667
|
-
])),
|
|
668
|
-
uniqueAgentNames: new Set(samples.map((s) => s.agentName)).size,
|
|
669
|
-
avgTurnCount: samples.reduce((sum, s) => sum + s.metadata.turnCount, 0) /
|
|
670
|
-
samples.length,
|
|
671
|
-
generatedAt: new Date().toISOString(),
|
|
672
|
-
};
|
|
673
|
-
await writeFile(join(outputDir, "stats.json"), JSON.stringify(stats, null, 2));
|
|
674
|
-
return { shouldRespondPath, contextRoutingPath, combinedPath };
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Export from existing Eliza trajectories to training format.
|
|
678
|
-
* Converts real trajectory data into the same JSONL format.
|
|
679
|
-
*/
|
|
680
|
-
export async function exportTrajectoriesAsTraining(trajectories, agentName, outputPath) {
|
|
681
|
-
const examples = [];
|
|
682
|
-
for (const trajectory of trajectories) {
|
|
683
|
-
for (const step of trajectory.steps) {
|
|
684
|
-
for (const call of step.llmCalls) {
|
|
685
|
-
if (call.purpose === "should_respond" &&
|
|
686
|
-
call.systemPrompt &&
|
|
687
|
-
call.userPrompt &&
|
|
688
|
-
call.response) {
|
|
689
|
-
examples.push({
|
|
690
|
-
messages: [
|
|
691
|
-
{ role: "system", content: call.systemPrompt },
|
|
692
|
-
{ role: "user", content: call.userPrompt },
|
|
693
|
-
{ role: "model", content: call.response },
|
|
694
|
-
],
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
const content = examples.map((e) => JSON.stringify(e)).join("\n");
|
|
701
|
-
await writeFile(outputPath, content + "\n");
|
|
702
|
-
return examples.length;
|
|
703
|
-
}
|