@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,654 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Agent Route Handlers
|
|
3
|
-
*
|
|
4
|
-
* Handles routes for PTY-based task-agent management:
|
|
5
|
-
* - Preflight checks, metrics, workspace files
|
|
6
|
-
* - Approval presets and config
|
|
7
|
-
* - Agent CRUD: list, spawn, get, send, stop, output
|
|
8
|
-
*
|
|
9
|
-
* @module api/agent-routes
|
|
10
|
-
*/
|
|
11
|
-
import { execFile } from "node:child_process";
|
|
12
|
-
import { createHash } from "node:crypto";
|
|
13
|
-
import { access, readFile, realpath, rm } from "node:fs/promises";
|
|
14
|
-
import * as os from "node:os";
|
|
15
|
-
import * as path from "node:path";
|
|
16
|
-
import { promisify } from "node:util";
|
|
17
|
-
import { extractEvalRunMetadata } from "../actions/eval-metadata.js";
|
|
18
|
-
import { buildAgentCredentials, isAnthropicOAuthToken, sanitizeCustomCredentials, } from "../services/agent-credentials.js";
|
|
19
|
-
import { getCoordinator } from "../services/pty-service.js";
|
|
20
|
-
import { isPiAgentType, normalizeAgentType, toPiCommand, } from "../services/pty-types.js";
|
|
21
|
-
import { getTaskAgentFrameworkState } from "../services/task-agent-frameworks.js";
|
|
22
|
-
import { parseBody, sendError, sendJson } from "./routes.js";
|
|
23
|
-
const execFileAsync = promisify(execFile);
|
|
24
|
-
const PREFLIGHT_DONE = new Set();
|
|
25
|
-
const PREFLIGHT_INFLIGHT = new Map();
|
|
26
|
-
function shouldAutoPreflight() {
|
|
27
|
-
if (process.env.PARALLAX_BENCHMARK_PREFLIGHT_AUTO === "1")
|
|
28
|
-
return true;
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
function isPathInside(parent, candidate) {
|
|
32
|
-
return candidate === parent || candidate.startsWith(`${parent}${path.sep}`);
|
|
33
|
-
}
|
|
34
|
-
async function resolveSafeVenvPath(workdir, venvDirRaw) {
|
|
35
|
-
const venvDir = venvDirRaw.trim();
|
|
36
|
-
if (!venvDir) {
|
|
37
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV must be non-empty");
|
|
38
|
-
}
|
|
39
|
-
if (path.isAbsolute(venvDir)) {
|
|
40
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV must be relative to workdir");
|
|
41
|
-
}
|
|
42
|
-
const normalized = path.normalize(venvDir);
|
|
43
|
-
if (normalized === "." ||
|
|
44
|
-
normalized === ".." ||
|
|
45
|
-
normalized.startsWith(`..${path.sep}`)) {
|
|
46
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV must stay within workdir");
|
|
47
|
-
}
|
|
48
|
-
const workdirResolved = path.resolve(workdir);
|
|
49
|
-
const workdirReal = await realpath(workdirResolved);
|
|
50
|
-
const resolved = path.resolve(workdirReal, normalized);
|
|
51
|
-
if (!isPathInside(workdirReal, resolved)) {
|
|
52
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV resolves outside workdir");
|
|
53
|
-
}
|
|
54
|
-
if (resolved === workdirReal) {
|
|
55
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV must not resolve to workdir root");
|
|
56
|
-
}
|
|
57
|
-
// Canonicalize candidate when present to reject symlink escapes.
|
|
58
|
-
try {
|
|
59
|
-
const resolvedReal = await realpath(resolved);
|
|
60
|
-
if (!isPathInside(workdirReal, resolvedReal) ||
|
|
61
|
-
resolvedReal === workdirReal) {
|
|
62
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV resolves outside workdir");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
const maybeErr = err;
|
|
67
|
-
if (maybeErr?.code !== "ENOENT")
|
|
68
|
-
throw err;
|
|
69
|
-
const parentReal = await realpath(path.dirname(resolved));
|
|
70
|
-
if (!isPathInside(workdirReal, parentReal)) {
|
|
71
|
-
throw new Error("PARALLAX_BENCHMARK_PREFLIGHT_VENV parent resolves outside workdir");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return resolved;
|
|
75
|
-
}
|
|
76
|
-
async function fileExists(filePath) {
|
|
77
|
-
try {
|
|
78
|
-
await access(filePath);
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
async function resolveRequirementsPath(workdir) {
|
|
86
|
-
const workdirReal = await realpath(path.resolve(workdir));
|
|
87
|
-
const candidates = [
|
|
88
|
-
path.join(workdir, "apps", "api", "requirements.txt"),
|
|
89
|
-
path.join(workdir, "requirements.txt"),
|
|
90
|
-
];
|
|
91
|
-
for (const candidate of candidates) {
|
|
92
|
-
if (!(await fileExists(candidate)))
|
|
93
|
-
continue;
|
|
94
|
-
try {
|
|
95
|
-
const candidateReal = await realpath(candidate);
|
|
96
|
-
if (isPathInside(workdirReal, candidateReal))
|
|
97
|
-
return candidateReal;
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
// Ignore malformed candidate and keep scanning.
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
async function fingerprintRequirementsFile(requirementsPath) {
|
|
106
|
-
const file = await readFile(requirementsPath);
|
|
107
|
-
return createHash("sha256").update(file).digest("hex");
|
|
108
|
-
}
|
|
109
|
-
async function runBenchmarkPreflight(workdir) {
|
|
110
|
-
if (!shouldAutoPreflight())
|
|
111
|
-
return;
|
|
112
|
-
const requirementsPath = await resolveRequirementsPath(workdir);
|
|
113
|
-
if (!requirementsPath)
|
|
114
|
-
return;
|
|
115
|
-
const requirementsFingerprint = await fingerprintRequirementsFile(requirementsPath);
|
|
116
|
-
const mode = process.env.PARALLAX_BENCHMARK_PREFLIGHT_MODE?.toLowerCase() === "warm"
|
|
117
|
-
? "warm"
|
|
118
|
-
: "cold";
|
|
119
|
-
const venvDir = process.env.PARALLAX_BENCHMARK_PREFLIGHT_VENV || ".benchmark-venv";
|
|
120
|
-
const venvPath = await resolveSafeVenvPath(workdir, venvDir);
|
|
121
|
-
const pythonInVenv = path.join(venvPath, process.platform === "win32" ? "Scripts" : "bin", process.platform === "win32" ? "python.exe" : "python");
|
|
122
|
-
const key = `${workdir}::${mode}::${venvPath}::${requirementsFingerprint}`;
|
|
123
|
-
if (PREFLIGHT_DONE.has(key)) {
|
|
124
|
-
if (await fileExists(pythonInVenv))
|
|
125
|
-
return;
|
|
126
|
-
PREFLIGHT_DONE.delete(key);
|
|
127
|
-
}
|
|
128
|
-
const existing = PREFLIGHT_INFLIGHT.get(key);
|
|
129
|
-
if (existing) {
|
|
130
|
-
await existing;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const run = (async () => {
|
|
134
|
-
const pythonCommand = process.platform === "win32" ? "python" : "python3";
|
|
135
|
-
if (mode === "cold") {
|
|
136
|
-
await rm(venvPath, { recursive: true, force: true });
|
|
137
|
-
}
|
|
138
|
-
const hasVenv = await fileExists(pythonInVenv);
|
|
139
|
-
if (!hasVenv) {
|
|
140
|
-
await execFileAsync(pythonCommand, ["-m", "venv", venvPath], {
|
|
141
|
-
cwd: workdir,
|
|
142
|
-
timeout: 120_000,
|
|
143
|
-
maxBuffer: 8 * 1024 * 1024,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
await execFileAsync(pythonInVenv, ["-m", "pip", "install", "--upgrade", "pip"], {
|
|
147
|
-
cwd: workdir,
|
|
148
|
-
timeout: 300_000,
|
|
149
|
-
maxBuffer: 8 * 1024 * 1024,
|
|
150
|
-
});
|
|
151
|
-
await execFileAsync(pythonInVenv, ["-m", "pip", "install", "-r", requirementsPath], {
|
|
152
|
-
cwd: workdir,
|
|
153
|
-
timeout: 600_000,
|
|
154
|
-
maxBuffer: 16 * 1024 * 1024,
|
|
155
|
-
});
|
|
156
|
-
PREFLIGHT_DONE.add(key);
|
|
157
|
-
})();
|
|
158
|
-
PREFLIGHT_INFLIGHT.set(key, run);
|
|
159
|
-
try {
|
|
160
|
-
await run;
|
|
161
|
-
}
|
|
162
|
-
finally {
|
|
163
|
-
PREFLIGHT_INFLIGHT.delete(key);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Handle task-agent routes (/api/coding-agents/*)
|
|
168
|
-
* Returns true if the route was handled, false otherwise
|
|
169
|
-
*/
|
|
170
|
-
export async function handleAgentRoutes(req, res, pathname, ctx) {
|
|
171
|
-
const method = req.method?.toUpperCase();
|
|
172
|
-
// === Preflight Check ===
|
|
173
|
-
// GET /api/coding-agents/preflight
|
|
174
|
-
if (method === "GET" && pathname === "/api/coding-agents/preflight") {
|
|
175
|
-
if (!ctx.ptyService) {
|
|
176
|
-
sendError(res, "PTY Service not available", 503);
|
|
177
|
-
return true;
|
|
178
|
-
}
|
|
179
|
-
try {
|
|
180
|
-
const results = await ctx.ptyService.checkAvailableAgents();
|
|
181
|
-
sendJson(res, results);
|
|
182
|
-
}
|
|
183
|
-
catch (error) {
|
|
184
|
-
sendError(res, error instanceof Error ? error.message : "Preflight check failed", 500);
|
|
185
|
-
}
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
// POST /api/coding-agents/auth/:agent — trigger CLI auth flow
|
|
189
|
-
const authMatch = pathname.match(/^\/api\/coding-agents\/auth\/(\w+)$/);
|
|
190
|
-
if (method === "POST" && authMatch) {
|
|
191
|
-
if (!ctx.ptyService) {
|
|
192
|
-
sendError(res, "PTY Service not available", 503);
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
const rawAgentType = authMatch[1];
|
|
196
|
-
// Validate agent type before instantiating an adapter.
|
|
197
|
-
// Must stay in sync with PTYService.checkAvailableAgents() default list.
|
|
198
|
-
const SUPPORTED_AGENTS = [
|
|
199
|
-
"claude",
|
|
200
|
-
"codex",
|
|
201
|
-
"gemini",
|
|
202
|
-
"aider",
|
|
203
|
-
];
|
|
204
|
-
if (!SUPPORTED_AGENTS.includes(rawAgentType)) {
|
|
205
|
-
sendError(res, `Unsupported agent type: ${rawAgentType}`, 400);
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
const agentType = rawAgentType;
|
|
209
|
-
try {
|
|
210
|
-
const result = await ctx.ptyService.triggerAgentAuth(agentType);
|
|
211
|
-
if (!result) {
|
|
212
|
-
sendError(res, `No auth flow available for ${agentType}`, 400);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
sendJson(res, result);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
catch (error) {
|
|
219
|
-
const msg = error instanceof Error ? error.message : "Auth trigger failed";
|
|
220
|
-
// Defensive fallback: primary input validation is handled by
|
|
221
|
-
// SUPPORTED_AGENTS above, so reaching here means the adapter package's
|
|
222
|
-
// own validation failed (e.g. internal lookup table mismatch). The regex
|
|
223
|
-
// is brittle if `coding-agent-adapters` changes its error wording, but
|
|
224
|
-
// it lets us return 400 instead of 500 for likely client errors.
|
|
225
|
-
const status = /unknown adapter|unsupported/i.test(msg) ? 400 : 500;
|
|
226
|
-
sendError(res, msg, status);
|
|
227
|
-
}
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
// GET /api/coding-agents/metrics
|
|
231
|
-
if (method === "GET" && pathname === "/api/coding-agents/metrics") {
|
|
232
|
-
if (!ctx.ptyService) {
|
|
233
|
-
sendError(res, "PTY Service not available", 503);
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
sendJson(res, ctx.ptyService.getAgentMetrics());
|
|
237
|
-
return true;
|
|
238
|
-
}
|
|
239
|
-
// === Scratch Workspace Retention ===
|
|
240
|
-
// GET /api/coding-agents/scratch
|
|
241
|
-
if (method === "GET" && pathname === "/api/coding-agents/scratch") {
|
|
242
|
-
if (!ctx.workspaceService) {
|
|
243
|
-
sendError(res, "Workspace Service not available", 503);
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
sendJson(res, ctx.workspaceService.listScratchWorkspaces());
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
// POST /api/coding-agents/:id/scratch/(keep|delete|promote)
|
|
250
|
-
const scratchActionMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)\/scratch\/(keep|delete|promote)$/);
|
|
251
|
-
if (method === "POST" && scratchActionMatch) {
|
|
252
|
-
if (!ctx.workspaceService) {
|
|
253
|
-
sendError(res, "Workspace Service not available", 503);
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
const sessionId = scratchActionMatch[1];
|
|
257
|
-
const action = scratchActionMatch[2];
|
|
258
|
-
try {
|
|
259
|
-
if (action === "keep") {
|
|
260
|
-
const scratch = await ctx.workspaceService.keepScratchWorkspace(sessionId);
|
|
261
|
-
sendJson(res, { success: true, scratch });
|
|
262
|
-
return true;
|
|
263
|
-
}
|
|
264
|
-
if (action === "delete") {
|
|
265
|
-
await ctx.workspaceService.deleteScratchWorkspace(sessionId);
|
|
266
|
-
sendJson(res, {
|
|
267
|
-
success: true,
|
|
268
|
-
deleted: true,
|
|
269
|
-
sessionId,
|
|
270
|
-
});
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
const body = await parseBody(req);
|
|
274
|
-
const promoteName = typeof body.name === "string" ? body.name : undefined;
|
|
275
|
-
const scratch = await ctx.workspaceService.promoteScratchWorkspace(sessionId, promoteName);
|
|
276
|
-
sendJson(res, { success: true, scratch });
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
280
|
-
const status = message.includes("not found") ? 404 : 500;
|
|
281
|
-
sendError(res, message, status);
|
|
282
|
-
}
|
|
283
|
-
return true;
|
|
284
|
-
}
|
|
285
|
-
// === Workspace Files ===
|
|
286
|
-
// GET /api/coding-agents/workspace-files?agentType=claude
|
|
287
|
-
if (method === "GET" && pathname === "/api/coding-agents/workspace-files") {
|
|
288
|
-
if (!ctx.ptyService) {
|
|
289
|
-
sendError(res, "PTY Service not available", 503);
|
|
290
|
-
return true;
|
|
291
|
-
}
|
|
292
|
-
try {
|
|
293
|
-
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
294
|
-
const agentType = url.searchParams.get("agentType");
|
|
295
|
-
if (!agentType) {
|
|
296
|
-
sendError(res, "agentType query parameter required (claude, gemini, codex, aider, pi)", 400);
|
|
297
|
-
return true;
|
|
298
|
-
}
|
|
299
|
-
if (isPiAgentType(agentType)) {
|
|
300
|
-
sendJson(res, {
|
|
301
|
-
agentType: "pi",
|
|
302
|
-
memoryFilePath: ".pi/agent/settings.json",
|
|
303
|
-
files: [],
|
|
304
|
-
});
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
const files = ctx.ptyService.getWorkspaceFiles(agentType);
|
|
308
|
-
const memoryFilePath = ctx.ptyService.getMemoryFilePath(agentType);
|
|
309
|
-
sendJson(res, {
|
|
310
|
-
agentType,
|
|
311
|
-
memoryFilePath,
|
|
312
|
-
files,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
catch (error) {
|
|
316
|
-
sendError(res, error instanceof Error
|
|
317
|
-
? error.message
|
|
318
|
-
: "Failed to get workspace files", 500);
|
|
319
|
-
}
|
|
320
|
-
return true;
|
|
321
|
-
}
|
|
322
|
-
// === Approval Presets ===
|
|
323
|
-
// GET /api/coding-agents/approval-presets
|
|
324
|
-
if (method === "GET" && pathname === "/api/coding-agents/approval-presets") {
|
|
325
|
-
try {
|
|
326
|
-
const { listPresets } = await import("coding-agent-adapters");
|
|
327
|
-
const presets = listPresets();
|
|
328
|
-
sendJson(res, presets);
|
|
329
|
-
}
|
|
330
|
-
catch (error) {
|
|
331
|
-
sendError(res, error instanceof Error ? error.message : "Failed to list presets", 500);
|
|
332
|
-
}
|
|
333
|
-
return true;
|
|
334
|
-
}
|
|
335
|
-
// GET /api/coding-agents/settings
|
|
336
|
-
if (method === "GET" && pathname === "/api/coding-agents/settings") {
|
|
337
|
-
if (!ctx.ptyService) {
|
|
338
|
-
sendError(res, "PTY Service not available", 503);
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
const frameworkState = await getTaskAgentFrameworkState(ctx.runtime, ctx.ptyService);
|
|
342
|
-
sendJson(res, {
|
|
343
|
-
defaultApprovalPreset: ctx.ptyService.defaultApprovalPreset,
|
|
344
|
-
agentSelectionStrategy: ctx.ptyService.agentSelectionStrategy,
|
|
345
|
-
defaultAgentType: ctx.ptyService.defaultAgentType,
|
|
346
|
-
preferredAgentType: frameworkState.preferred.id,
|
|
347
|
-
preferredAgentReason: frameworkState.preferred.reason,
|
|
348
|
-
configuredSubscriptionProvider: frameworkState.configuredSubscriptionProvider,
|
|
349
|
-
frameworks: frameworkState.frameworks,
|
|
350
|
-
});
|
|
351
|
-
return true;
|
|
352
|
-
}
|
|
353
|
-
// GET /api/coding-agents/approval-config?agentType=claude&preset=autonomous
|
|
354
|
-
if (method === "GET" && pathname === "/api/coding-agents/approval-config") {
|
|
355
|
-
if (!ctx.ptyService) {
|
|
356
|
-
sendError(res, "PTY Service not available", 503);
|
|
357
|
-
return true;
|
|
358
|
-
}
|
|
359
|
-
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
360
|
-
const agentType = url.searchParams.get("agentType");
|
|
361
|
-
const preset = url.searchParams.get("preset");
|
|
362
|
-
if (!agentType || !preset) {
|
|
363
|
-
sendError(res, "agentType and preset query parameters required", 400);
|
|
364
|
-
return true;
|
|
365
|
-
}
|
|
366
|
-
try {
|
|
367
|
-
const config = ctx.ptyService.getApprovalConfig(agentType, preset);
|
|
368
|
-
sendJson(res, config);
|
|
369
|
-
}
|
|
370
|
-
catch (error) {
|
|
371
|
-
sendError(res, error instanceof Error ? error.message : "Failed to generate config", 500);
|
|
372
|
-
}
|
|
373
|
-
return true;
|
|
374
|
-
}
|
|
375
|
-
// === List Agents ===
|
|
376
|
-
// GET /api/coding-agents
|
|
377
|
-
if (method === "GET" && pathname === "/api/coding-agents") {
|
|
378
|
-
if (!ctx.ptyService) {
|
|
379
|
-
sendError(res, "PTY Service not available", 503);
|
|
380
|
-
return true;
|
|
381
|
-
}
|
|
382
|
-
try {
|
|
383
|
-
const sessions = await ctx.ptyService.listSessions();
|
|
384
|
-
sendJson(res, sessions);
|
|
385
|
-
}
|
|
386
|
-
catch (error) {
|
|
387
|
-
sendError(res, error instanceof Error ? error.message : "Failed to list agents", 500);
|
|
388
|
-
}
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
// === Spawn Agent ===
|
|
392
|
-
// POST /api/coding-agents/spawn
|
|
393
|
-
if (method === "POST" && pathname === "/api/coding-agents/spawn") {
|
|
394
|
-
if (!ctx.ptyService) {
|
|
395
|
-
sendError(res, "PTY Service not available", 503);
|
|
396
|
-
return true;
|
|
397
|
-
}
|
|
398
|
-
try {
|
|
399
|
-
const body = await parseBody(req);
|
|
400
|
-
const { agentType, workdir: rawWorkdir, task, memoryContent, approvalPreset, customCredentials, metadata, } = body;
|
|
401
|
-
// Validate workdir: must be within workspace base dir or cwd
|
|
402
|
-
const workspaceBaseDir = path.join(os.homedir(), ".eliza", "workspaces");
|
|
403
|
-
const workspaceBaseDirResolved = path.resolve(workspaceBaseDir);
|
|
404
|
-
const cwdResolved = path.resolve(process.cwd());
|
|
405
|
-
const workspaceBaseDirReal = await realpath(workspaceBaseDirResolved).catch(() => workspaceBaseDirResolved);
|
|
406
|
-
const cwdReal = await realpath(cwdResolved).catch(() => cwdResolved);
|
|
407
|
-
const allowedPrefixes = [workspaceBaseDirReal, cwdReal];
|
|
408
|
-
let workdir = rawWorkdir;
|
|
409
|
-
if (workdir) {
|
|
410
|
-
const resolved = path.resolve(workdir);
|
|
411
|
-
const resolvedReal = await realpath(resolved).catch(() => null);
|
|
412
|
-
if (!resolvedReal) {
|
|
413
|
-
sendError(res, "workdir must exist", 403);
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
const isAllowed = allowedPrefixes.some((prefix) => resolvedReal === prefix ||
|
|
417
|
-
resolvedReal.startsWith(prefix + path.sep));
|
|
418
|
-
if (!isAllowed) {
|
|
419
|
-
sendError(res, "workdir must be within workspace base directory or cwd", 403);
|
|
420
|
-
return true;
|
|
421
|
-
}
|
|
422
|
-
workdir = resolvedReal;
|
|
423
|
-
}
|
|
424
|
-
// Check concurrency limit before spawning
|
|
425
|
-
const activeSessions = await ctx.ptyService.listSessions();
|
|
426
|
-
const maxSessions = 8;
|
|
427
|
-
if (activeSessions.length >= maxSessions) {
|
|
428
|
-
sendError(res, `Concurrent session limit reached (${maxSessions})`, 429);
|
|
429
|
-
return true;
|
|
430
|
-
}
|
|
431
|
-
if (workdir) {
|
|
432
|
-
try {
|
|
433
|
-
await runBenchmarkPreflight(workdir);
|
|
434
|
-
}
|
|
435
|
-
catch (preflightError) {
|
|
436
|
-
console.warn(`[coding-agent] benchmark preflight failed for ${workdir}:`, preflightError);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
// Build credentials from runtime
|
|
440
|
-
const rawAnthropicKey = ctx.runtime.getSetting("ANTHROPIC_API_KEY");
|
|
441
|
-
let credentials;
|
|
442
|
-
try {
|
|
443
|
-
credentials = buildAgentCredentials(ctx.runtime);
|
|
444
|
-
}
|
|
445
|
-
catch (error) {
|
|
446
|
-
const message = error instanceof Error
|
|
447
|
-
? error.message
|
|
448
|
-
: "Failed to build credentials";
|
|
449
|
-
sendError(res, message, 400);
|
|
450
|
-
return true;
|
|
451
|
-
}
|
|
452
|
-
// Read model preferences from runtime settings
|
|
453
|
-
const agentStr = agentType
|
|
454
|
-
? agentType.toLowerCase()
|
|
455
|
-
: await ctx.ptyService.resolveAgentType();
|
|
456
|
-
const piRequested = isPiAgentType(agentStr);
|
|
457
|
-
const normalizedType = normalizeAgentType(agentStr);
|
|
458
|
-
const prefixMap = {
|
|
459
|
-
claude: "PARALLAX_CLAUDE",
|
|
460
|
-
gemini: "PARALLAX_GEMINI",
|
|
461
|
-
codex: "PARALLAX_CODEX",
|
|
462
|
-
aider: "PARALLAX_AIDER",
|
|
463
|
-
};
|
|
464
|
-
const prefix = prefixMap[agentStr];
|
|
465
|
-
const modelPowerful = prefix
|
|
466
|
-
? ctx.runtime.getSetting(`${prefix}_MODEL_POWERFUL`)
|
|
467
|
-
: null;
|
|
468
|
-
const modelFast = prefix
|
|
469
|
-
? ctx.runtime.getSetting(`${prefix}_MODEL_FAST`)
|
|
470
|
-
: null;
|
|
471
|
-
const aiderProvider = agentStr === "aider"
|
|
472
|
-
? ctx.runtime.getSetting("PARALLAX_AIDER_PROVIDER")
|
|
473
|
-
: null;
|
|
474
|
-
// Check if coordinator is active — route blocking prompts through it
|
|
475
|
-
const coordinator = getCoordinator(ctx.runtime);
|
|
476
|
-
const requestedThreadId = typeof metadata?.threadId === "string"
|
|
477
|
-
? metadata.threadId
|
|
478
|
-
: null;
|
|
479
|
-
const evalRunMetadata = extractEvalRunMetadata(metadata);
|
|
480
|
-
const taskThread = coordinator && task && !requestedThreadId
|
|
481
|
-
? await coordinator.createTaskThread({
|
|
482
|
-
title: metadata?.label ?? `Task ${Date.now()}`,
|
|
483
|
-
originalRequest: task,
|
|
484
|
-
scenarioId: evalRunMetadata.scenarioId,
|
|
485
|
-
batchId: evalRunMetadata.batchId,
|
|
486
|
-
metadata: {
|
|
487
|
-
workdir: workdir ?? null,
|
|
488
|
-
source: "api-spawn",
|
|
489
|
-
...(evalRunMetadata.scenarioId
|
|
490
|
-
? { scenarioId: evalRunMetadata.scenarioId }
|
|
491
|
-
: {}),
|
|
492
|
-
...(evalRunMetadata.batchId
|
|
493
|
-
? { batchId: evalRunMetadata.batchId }
|
|
494
|
-
: {}),
|
|
495
|
-
},
|
|
496
|
-
})
|
|
497
|
-
: requestedThreadId
|
|
498
|
-
? await coordinator?.getTaskThread(requestedThreadId)
|
|
499
|
-
: null;
|
|
500
|
-
const session = await ctx.ptyService.spawnSession({
|
|
501
|
-
name: `agent-${Date.now()}`,
|
|
502
|
-
agentType: normalizedType,
|
|
503
|
-
workdir: workdir,
|
|
504
|
-
initialTask: piRequested
|
|
505
|
-
? toPiCommand(task)
|
|
506
|
-
: task,
|
|
507
|
-
memoryContent: memoryContent,
|
|
508
|
-
credentials,
|
|
509
|
-
approvalPreset: approvalPreset,
|
|
510
|
-
customCredentials: sanitizeCustomCredentials(customCredentials, isAnthropicOAuthToken(rawAnthropicKey) ? [rawAnthropicKey] : []),
|
|
511
|
-
// Let adapter auto-response handle known prompts (permissions, trust, etc.)
|
|
512
|
-
// instantly. The coordinator handles only unrecognized prompts via LLM.
|
|
513
|
-
metadata: {
|
|
514
|
-
threadId: taskThread?.id ?? requestedThreadId,
|
|
515
|
-
requestedType: agentStr,
|
|
516
|
-
...metadata,
|
|
517
|
-
...(aiderProvider ? { provider: aiderProvider } : {}),
|
|
518
|
-
modelPrefs: {
|
|
519
|
-
...(modelPowerful ? { powerful: modelPowerful } : {}),
|
|
520
|
-
...(modelFast ? { fast: modelFast } : {}),
|
|
521
|
-
},
|
|
522
|
-
},
|
|
523
|
-
});
|
|
524
|
-
if (coordinator && task) {
|
|
525
|
-
const label = metadata?.label;
|
|
526
|
-
await coordinator.registerTask(session.id, {
|
|
527
|
-
threadId: taskThread?.id ?? requestedThreadId ?? session.id,
|
|
528
|
-
agentType: agentStr,
|
|
529
|
-
label: label || `agent-${session.id.slice(-8)}`,
|
|
530
|
-
originalTask: task,
|
|
531
|
-
workdir: session.workdir,
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
sendJson(res, {
|
|
535
|
-
sessionId: session.id,
|
|
536
|
-
agentType: session.agentType,
|
|
537
|
-
workdir: session.workdir,
|
|
538
|
-
status: session.status,
|
|
539
|
-
}, 201);
|
|
540
|
-
}
|
|
541
|
-
catch (error) {
|
|
542
|
-
sendError(res, error instanceof Error ? error.message : "Failed to spawn agent", 500);
|
|
543
|
-
}
|
|
544
|
-
return true;
|
|
545
|
-
}
|
|
546
|
-
// === Get Agent Status ===
|
|
547
|
-
// GET /api/coding-agents/:id
|
|
548
|
-
const agentMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)$/);
|
|
549
|
-
if (method === "GET" && agentMatch) {
|
|
550
|
-
if (!ctx.ptyService) {
|
|
551
|
-
sendError(res, "PTY Service not available", 503);
|
|
552
|
-
return true;
|
|
553
|
-
}
|
|
554
|
-
const sessionId = agentMatch[1];
|
|
555
|
-
const session = ctx.ptyService.getSession(sessionId);
|
|
556
|
-
if (!session) {
|
|
557
|
-
sendError(res, "Agent session not found", 404);
|
|
558
|
-
return true;
|
|
559
|
-
}
|
|
560
|
-
sendJson(res, session);
|
|
561
|
-
return true;
|
|
562
|
-
}
|
|
563
|
-
// === Send to Agent ===
|
|
564
|
-
// POST /api/coding-agents/:id/send
|
|
565
|
-
const sendMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)\/send$/);
|
|
566
|
-
if (method === "POST" && sendMatch) {
|
|
567
|
-
if (!ctx.ptyService) {
|
|
568
|
-
sendError(res, "PTY Service not available", 503);
|
|
569
|
-
return true;
|
|
570
|
-
}
|
|
571
|
-
try {
|
|
572
|
-
const sessionId = sendMatch[1];
|
|
573
|
-
const body = await parseBody(req);
|
|
574
|
-
const { input, keys } = body;
|
|
575
|
-
if (keys) {
|
|
576
|
-
// Send special keys (e.g. "enter", ["down","enter"], "Ctrl-C")
|
|
577
|
-
await ctx.ptyService.sendKeysToSession(sessionId, keys);
|
|
578
|
-
sendJson(res, { success: true });
|
|
579
|
-
}
|
|
580
|
-
else if (input && typeof input === "string") {
|
|
581
|
-
await ctx.ptyService.sendToSession(sessionId, input);
|
|
582
|
-
sendJson(res, { success: true });
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
sendError(res, "Either 'input' (string) or 'keys' (string|string[]) required", 400);
|
|
586
|
-
return true;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
catch (error) {
|
|
590
|
-
sendError(res, error instanceof Error ? error.message : "Failed to send input", 500);
|
|
591
|
-
}
|
|
592
|
-
return true;
|
|
593
|
-
}
|
|
594
|
-
// === Stop Agent ===
|
|
595
|
-
// POST /api/coding-agents/:id/stop
|
|
596
|
-
const stopMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)\/stop$/);
|
|
597
|
-
if (method === "POST" && stopMatch) {
|
|
598
|
-
if (!ctx.ptyService) {
|
|
599
|
-
sendError(res, "PTY Service not available", 503);
|
|
600
|
-
return true;
|
|
601
|
-
}
|
|
602
|
-
try {
|
|
603
|
-
const sessionId = stopMatch[1];
|
|
604
|
-
await ctx.ptyService.stopSession(sessionId);
|
|
605
|
-
sendJson(res, { success: true, sessionId });
|
|
606
|
-
}
|
|
607
|
-
catch (error) {
|
|
608
|
-
sendError(res, error instanceof Error ? error.message : "Failed to stop agent", 500);
|
|
609
|
-
}
|
|
610
|
-
return true;
|
|
611
|
-
}
|
|
612
|
-
// === Get Agent Output ===
|
|
613
|
-
// GET /api/coding-agents/:id/output
|
|
614
|
-
const outputMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)\/output$/);
|
|
615
|
-
if (method === "GET" && outputMatch) {
|
|
616
|
-
if (!ctx.ptyService) {
|
|
617
|
-
sendError(res, "PTY Service not available", 503);
|
|
618
|
-
return true;
|
|
619
|
-
}
|
|
620
|
-
try {
|
|
621
|
-
const sessionId = outputMatch[1];
|
|
622
|
-
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
623
|
-
const lines = parseInt(url.searchParams.get("lines") || "100", 10);
|
|
624
|
-
const output = await ctx.ptyService.getSessionOutput(sessionId, lines);
|
|
625
|
-
sendJson(res, { sessionId, output });
|
|
626
|
-
}
|
|
627
|
-
catch (error) {
|
|
628
|
-
sendError(res, error instanceof Error ? error.message : "Failed to get output", 500);
|
|
629
|
-
}
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
632
|
-
// === Get Buffered Terminal Output (raw ANSI for xterm.js hydration) ===
|
|
633
|
-
// GET /api/coding-agents/:id/buffered-output
|
|
634
|
-
const bufferedMatch = pathname.match(/^\/api\/coding-agents\/([^/]+)\/buffered-output$/);
|
|
635
|
-
if (method === "GET" && bufferedMatch) {
|
|
636
|
-
if (!ctx.ptyService?.consoleBridge) {
|
|
637
|
-
sendError(res, "Console bridge not available", 503);
|
|
638
|
-
return true;
|
|
639
|
-
}
|
|
640
|
-
try {
|
|
641
|
-
const sessionId = bufferedMatch[1];
|
|
642
|
-
const output = ctx.ptyService.consoleBridge.getBufferedOutput(sessionId);
|
|
643
|
-
sendJson(res, { sessionId, output });
|
|
644
|
-
}
|
|
645
|
-
catch (error) {
|
|
646
|
-
sendError(res, error instanceof Error
|
|
647
|
-
? error.message
|
|
648
|
-
: "Failed to get buffered output", 500);
|
|
649
|
-
}
|
|
650
|
-
return true;
|
|
651
|
-
}
|
|
652
|
-
// Route not handled
|
|
653
|
-
return false;
|
|
654
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Swarm Coordinator Route Handlers
|
|
3
|
-
*
|
|
4
|
-
* Provides SSE streaming and HTTP API for the coordination layer:
|
|
5
|
-
* - SSE event stream for real-time dashboard
|
|
6
|
-
* - Task status and context queries
|
|
7
|
-
* - Pending confirmation management
|
|
8
|
-
* - Supervision level control
|
|
9
|
-
*
|
|
10
|
-
* @module api/coordinator-routes
|
|
11
|
-
*/
|
|
12
|
-
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
13
|
-
import type { SwarmCoordinator } from "../services/swarm-coordinator.ts";
|
|
14
|
-
import type { RouteContext } from "./routes.ts";
|
|
15
|
-
/**
|
|
16
|
-
* Handle coordinator routes (/api/coding-agents/coordinator/*)
|
|
17
|
-
* Returns true if the route was handled, false otherwise.
|
|
18
|
-
*/
|
|
19
|
-
export declare function handleCoordinatorRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext & {
|
|
20
|
-
coordinator?: SwarmCoordinator;
|
|
21
|
-
}): Promise<boolean>;
|
|
22
|
-
//# sourceMappingURL=coordinator-routes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-routes.d.ts","sourceRoot":"","sources":["../../../../../../../../typescript/src/features/orchestrator/api/coordinator-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAOzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC5C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAAG;IAAE,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAAE,GACpD,OAAO,CAAC,OAAO,CAAC,CAmdlB"}
|