@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,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug PTY Capture — optional session recording for offline analysis.
|
|
3
|
-
*
|
|
4
|
-
* Activated by setting `PARALLAX_DEBUG_CAPTURE=1`. When enabled, all PTY
|
|
5
|
-
* output and stdin are recorded per-session using `pty-state-capture`.
|
|
6
|
-
* Capture files persist in `.parallax/pty-captures/<sessionId>/` after
|
|
7
|
-
* the agent session is killed, enabling post-mortem analysis of state
|
|
8
|
-
* transitions, stall classifications, and coordinator timing.
|
|
9
|
-
*
|
|
10
|
-
* The `pty-state-capture` package is dynamically imported — if not
|
|
11
|
-
* installed, capture is silently disabled. This means it can stay out
|
|
12
|
-
* of production dependencies entirely.
|
|
13
|
-
*
|
|
14
|
-
* @module services/debug-capture
|
|
15
|
-
*/
|
|
16
|
-
import { logger } from "@elizaos/core";
|
|
17
|
-
let captureManager = null;
|
|
18
|
-
let initAttempted = false;
|
|
19
|
-
/**
|
|
20
|
-
* Returns true if debug capture is enabled via environment variable.
|
|
21
|
-
*/
|
|
22
|
-
export function isDebugCaptureEnabled() {
|
|
23
|
-
return process.env.PARALLAX_DEBUG_CAPTURE === "1";
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Lazily initialize the capture manager. Returns null if:
|
|
27
|
-
* - PARALLAX_DEBUG_CAPTURE is not set to "1"
|
|
28
|
-
* - pty-state-capture is not installed
|
|
29
|
-
* - Initialization fails for any reason
|
|
30
|
-
*/
|
|
31
|
-
async function ensureCaptureManager() {
|
|
32
|
-
if (captureManager)
|
|
33
|
-
return captureManager;
|
|
34
|
-
if (initAttempted)
|
|
35
|
-
return null;
|
|
36
|
-
initAttempted = true;
|
|
37
|
-
if (!isDebugCaptureEnabled())
|
|
38
|
-
return null;
|
|
39
|
-
try {
|
|
40
|
-
const mod = await import("pty-state-capture");
|
|
41
|
-
const { PTYStateCaptureManager } = mod;
|
|
42
|
-
captureManager = new PTYStateCaptureManager({
|
|
43
|
-
outputRootDir: ".parallax/pty-captures",
|
|
44
|
-
defaultRows: 80,
|
|
45
|
-
defaultCols: 220,
|
|
46
|
-
});
|
|
47
|
-
logger.info("[debug-capture] PTY state capture enabled — writing to .parallax/pty-captures/");
|
|
48
|
-
return captureManager;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
logger.debug("[debug-capture] pty-state-capture not available — capture disabled");
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Open a capture session for a PTY session. Call this when spawning.
|
|
57
|
-
*/
|
|
58
|
-
export async function captureSessionOpen(sessionId, agentType) {
|
|
59
|
-
const mgr = await ensureCaptureManager();
|
|
60
|
-
if (!mgr)
|
|
61
|
-
return;
|
|
62
|
-
try {
|
|
63
|
-
await mgr.openSession(sessionId, { source: agentType });
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
logger.debug(`[debug-capture] Failed to open session ${sessionId}: ${err}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Feed PTY output data to the capture. Call this on every data chunk.
|
|
71
|
-
*/
|
|
72
|
-
export async function captureFeed(sessionId, chunk, direction = "stdout") {
|
|
73
|
-
if (!captureManager)
|
|
74
|
-
return;
|
|
75
|
-
try {
|
|
76
|
-
await captureManager.feed(sessionId, chunk, direction);
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
logger.debug(`[debug-capture] Feed error for ${sessionId}: ${err}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Record a lifecycle event (session_ready, session_stopped, etc.).
|
|
84
|
-
*/
|
|
85
|
-
export async function captureLifecycle(sessionId, event, detail) {
|
|
86
|
-
if (!captureManager)
|
|
87
|
-
return;
|
|
88
|
-
try {
|
|
89
|
-
await captureManager.lifecycle(sessionId, event, detail);
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
logger.debug(`[debug-capture] Lifecycle error for ${sessionId}: ${err}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get a snapshot of a capture session's current state.
|
|
97
|
-
*/
|
|
98
|
-
export function captureSnapshot(sessionId) {
|
|
99
|
-
if (!captureManager)
|
|
100
|
-
return null;
|
|
101
|
-
try {
|
|
102
|
-
return captureManager.snapshot(sessionId);
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
logger.debug(`[debug-capture] Snapshot error for ${sessionId}: ${err}`);
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/** @internal Reset module state for testing only. */
|
|
110
|
-
export function _resetForTesting() {
|
|
111
|
-
captureManager = null;
|
|
112
|
-
initAttempted = false;
|
|
113
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-response rule management for PTY sessions.
|
|
3
|
-
*
|
|
4
|
-
* Contains logic for pushing default auto-response rules per agent type
|
|
5
|
-
* and handling Gemini authentication flow.
|
|
6
|
-
*
|
|
7
|
-
* @module services/pty-auto-response
|
|
8
|
-
*/
|
|
9
|
-
import type { IAgentRuntime } from "@elizaos/core";
|
|
10
|
-
import type { BunCompatiblePTYManager, PTYManager } from "pty-manager";
|
|
11
|
-
export interface AutoResponseContext {
|
|
12
|
-
manager: PTYManager | BunCompatiblePTYManager;
|
|
13
|
-
usingBunWorker: boolean;
|
|
14
|
-
runtime: IAgentRuntime;
|
|
15
|
-
log: (msg: string) => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Push session-specific auto-response rules that depend on runtime config.
|
|
19
|
-
* Trust prompts, update notices, and other static rules are handled by
|
|
20
|
-
* adapter built-in rules (coding-agent-adapters). This only pushes rules
|
|
21
|
-
* that need runtime values (e.g. API keys).
|
|
22
|
-
*/
|
|
23
|
-
export declare function pushDefaultRules(ctx: AutoResponseContext, sessionId: string, agentType: string): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Handle Gemini authentication when login_required fires.
|
|
26
|
-
* Sends /auth to start the auth flow — auto-response rules
|
|
27
|
-
* then handle menu selection and API key input.
|
|
28
|
-
*/
|
|
29
|
-
export declare function handleGeminiAuth(ctx: AutoResponseContext, sessionId: string, sendKeysToSession: (sessionId: string, keys: string | string[]) => Promise<void>): Promise<void>;
|
|
30
|
-
//# sourceMappingURL=pty-auto-response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pty-auto-response.d.ts","sourceRoot":"","sources":["../../../../../../../../typescript/src/features/orchestrator/services/pty-auto-response.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAEX,uBAAuB,EACvB,UAAU,EACV,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,mBAAmB;IACnC,OAAO,EAAE,UAAU,GAAG,uBAAuB,CAAC;IAC9C,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA8Hf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACrC,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,KACnB,OAAO,CAAC,IAAI,CAAC,GAChB,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-response rule management for PTY sessions.
|
|
3
|
-
*
|
|
4
|
-
* Contains logic for pushing default auto-response rules per agent type
|
|
5
|
-
* and handling Gemini authentication flow.
|
|
6
|
-
*
|
|
7
|
-
* @module services/pty-auto-response
|
|
8
|
-
*/
|
|
9
|
-
import { readConfigEnvKey } from "./config-env.js";
|
|
10
|
-
/**
|
|
11
|
-
* Push session-specific auto-response rules that depend on runtime config.
|
|
12
|
-
* Trust prompts, update notices, and other static rules are handled by
|
|
13
|
-
* adapter built-in rules (coding-agent-adapters). This only pushes rules
|
|
14
|
-
* that need runtime values (e.g. API keys).
|
|
15
|
-
*/
|
|
16
|
-
export async function pushDefaultRules(ctx, sessionId, agentType) {
|
|
17
|
-
const rules = [];
|
|
18
|
-
// Codex sometimes renders the workspace trust screen incrementally.
|
|
19
|
-
// The upstream adapter rule is one-shot; if it fires before the menu is fully
|
|
20
|
-
// interactive, Codex can keep showing the same prompt and block the session.
|
|
21
|
-
// Keep this session rule active until the prompt actually clears.
|
|
22
|
-
if (agentType === "codex") {
|
|
23
|
-
rules.push({
|
|
24
|
-
pattern: /higher.?risk.?of.?prompt.?injection|yes,?.?continue.*no,?.?quit|do.?you.?trust.?the.?contents|trust.?this.?directory|allow.?codex.?to.?work.?in.?this.?folder|without.?asking.?for.?approval/i,
|
|
25
|
-
type: "permission",
|
|
26
|
-
response: "",
|
|
27
|
-
responseType: "keys",
|
|
28
|
-
keys: ["enter"],
|
|
29
|
-
description: "Retry Codex workspace trust approval until the prompt clears",
|
|
30
|
-
safe: true,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// Aider gitignore prompt
|
|
34
|
-
if (agentType === "aider") {
|
|
35
|
-
rules.push({
|
|
36
|
-
pattern: /\.aider\*.*\.gitignore.*\(Y\)es\/\(N\)o/i,
|
|
37
|
-
type: "config",
|
|
38
|
-
response: "y",
|
|
39
|
-
description: "Auto-accept adding .aider* to .gitignore",
|
|
40
|
-
safe: true,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
// Claude — API key confirmation prompt (appears when ANTHROPIC_API_KEY is set
|
|
44
|
-
// alongside a subscription login, or in CLAUDE_CODE_SIMPLE mode)
|
|
45
|
-
if (agentType === "claude") {
|
|
46
|
-
const llmProvider = readConfigEnvKey("PARALLAX_LLM_PROVIDER") || "subscription";
|
|
47
|
-
if (llmProvider === "api_keys" || llmProvider === "cloud") {
|
|
48
|
-
rules.push({
|
|
49
|
-
pattern: /Do you want to use this API key|(?:custom|detected).*API key.*environment/i,
|
|
50
|
-
type: "config",
|
|
51
|
-
response: "",
|
|
52
|
-
responseType: "keys",
|
|
53
|
-
keys: ["up", "enter"],
|
|
54
|
-
description: "Accept detected ANTHROPIC_API_KEY from environment",
|
|
55
|
-
safe: true,
|
|
56
|
-
once: true,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Gemini — auth flow (update notices are informational, don't need a response)
|
|
61
|
-
if (agentType === "gemini") {
|
|
62
|
-
// Auth menu detection — select API key or Google login based on available credentials
|
|
63
|
-
const geminiApiKey = ctx.runtime.getSetting("GENERATIVE_AI_API_KEY");
|
|
64
|
-
if (geminiApiKey) {
|
|
65
|
-
// Have API key → select option 2 "Use an API key"
|
|
66
|
-
rules.push({
|
|
67
|
-
pattern: /Log in with Google|Use an API key|Use Vertex AI|gemini api key/i,
|
|
68
|
-
type: "config",
|
|
69
|
-
response: "2",
|
|
70
|
-
description: "Select 'Use an API key' from Gemini auth menu",
|
|
71
|
-
safe: true,
|
|
72
|
-
});
|
|
73
|
-
// Step 2: API key input prompt — send the actual key value.
|
|
74
|
-
// Tight regex: only matches the Gemini CLI's exact prompt format
|
|
75
|
-
// to prevent exfiltration via crafted terminal output.
|
|
76
|
-
// once: fire at most once per session to prevent repeated credential injection.
|
|
77
|
-
rules.push({
|
|
78
|
-
pattern: /^(?:\s|[>$#])*(?:Enter|Paste) (?:your )?(?:Google AI|Gemini) API key:/i,
|
|
79
|
-
type: "config",
|
|
80
|
-
response: geminiApiKey,
|
|
81
|
-
description: "Input Gemini API key from Gemini CLI auth prompt",
|
|
82
|
-
safe: true,
|
|
83
|
-
once: true,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// No API key → select option 1 "Log in with Google" (opens browser OAuth)
|
|
88
|
-
rules.push({
|
|
89
|
-
pattern: /Log in with Google|Use an API key|Use Vertex AI|gemini api key/i,
|
|
90
|
-
type: "config",
|
|
91
|
-
response: "1",
|
|
92
|
-
description: "Select 'Log in with Google' from Gemini auth menu (browser OAuth)",
|
|
93
|
-
safe: true,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (rules.length === 0)
|
|
98
|
-
return;
|
|
99
|
-
// Push rules to the session via the runtime API
|
|
100
|
-
try {
|
|
101
|
-
if (ctx.usingBunWorker) {
|
|
102
|
-
for (const rule of rules) {
|
|
103
|
-
await ctx.manager.addAutoResponseRule(sessionId, rule);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const nodeManager = ctx.manager;
|
|
108
|
-
for (const rule of rules) {
|
|
109
|
-
nodeManager.addAutoResponseRule(sessionId, rule);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
ctx.log(`Pushed ${rules.length} auto-response rules to session ${sessionId}`);
|
|
113
|
-
// Note: No retroactive check needed here. The worker's tryAutoResponse()
|
|
114
|
-
// runs on every data chunk and checks the full output buffer against all
|
|
115
|
-
// active rules. Once rules are pushed, the next data chunk will trigger
|
|
116
|
-
// matching. The old retroactive check caused ghost responses because it
|
|
117
|
-
// bypassed the worker's TUI-aware response logic (sendKeys vs writeRaw).
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
ctx.log(`Failed to push rules to session ${sessionId}: ${err}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Handle Gemini authentication when login_required fires.
|
|
125
|
-
* Sends /auth to start the auth flow — auto-response rules
|
|
126
|
-
* then handle menu selection and API key input.
|
|
127
|
-
*/
|
|
128
|
-
export async function handleGeminiAuth(ctx, sessionId, sendKeysToSession) {
|
|
129
|
-
const apiKey = ctx.runtime.getSetting("GENERATIVE_AI_API_KEY");
|
|
130
|
-
if (apiKey) {
|
|
131
|
-
ctx.log(`Gemini auth: API key available, sending /auth to start API key flow`);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
ctx.log(`Gemini auth: no API key configured, sending /auth for Google OAuth flow`);
|
|
135
|
-
}
|
|
136
|
-
// Send /auth via sendKeys to avoid send() which sets status to "busy".
|
|
137
|
-
// We need to stay in "authenticating" so detectReady fires after auth completes.
|
|
138
|
-
try {
|
|
139
|
-
await sendKeysToSession(sessionId, "/auth");
|
|
140
|
-
await new Promise((r) => setTimeout(r, 50));
|
|
141
|
-
await sendKeysToSession(sessionId, "enter");
|
|
142
|
-
}
|
|
143
|
-
catch (err) {
|
|
144
|
-
ctx.log(`Gemini auth: failed to send /auth: ${err}`);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PTY manager initialization — extracted from PTYService.initialize().
|
|
3
|
-
*
|
|
4
|
-
* Creates either a BunCompatiblePTYManager (for Bun runtime) or PTYManager
|
|
5
|
-
* (for Node), wires up event handlers, and returns the configured manager.
|
|
6
|
-
*
|
|
7
|
-
* @module services/pty-init
|
|
8
|
-
*/
|
|
9
|
-
import { BunCompatiblePTYManager, PTYManager, type StallClassification } from "pty-manager";
|
|
10
|
-
import type { CompletionMethod } from "./agent-metrics.ts";
|
|
11
|
-
import type { PTYServiceConfig } from "./pty-types.ts";
|
|
12
|
-
/**
|
|
13
|
-
* All callbacks and state that the initialization logic needs
|
|
14
|
-
* from the surrounding PTYService instance.
|
|
15
|
-
*/
|
|
16
|
-
export interface InitContext {
|
|
17
|
-
serviceConfig: PTYServiceConfig;
|
|
18
|
-
classifyStall: (sessionId: string, recentOutput: string) => Promise<StallClassification | null>;
|
|
19
|
-
emitEvent: (sessionId: string, event: string, data: unknown) => void;
|
|
20
|
-
handleGeminiAuth: (sessionId: string) => void;
|
|
21
|
-
sessionOutputBuffers: Map<string, string[]>;
|
|
22
|
-
taskResponseMarkers: Map<string, number>;
|
|
23
|
-
metricsTracker: {
|
|
24
|
-
recordCompletion(type: string, method: CompletionMethod, durationMs: number): void;
|
|
25
|
-
};
|
|
26
|
-
traceEntries: Array<string | Record<string, unknown>>;
|
|
27
|
-
maxTraceEntries: number;
|
|
28
|
-
log: (msg: string) => void;
|
|
29
|
-
handleWorkerExit?: (info: {
|
|
30
|
-
code: number | null;
|
|
31
|
-
signal: string | null;
|
|
32
|
-
}) => void;
|
|
33
|
-
/** Check if a session has an active task in the coordinator. */
|
|
34
|
-
hasActiveTask?: (sessionId: string) => boolean;
|
|
35
|
-
/** Check if a session's task has started work (task delivered or decisions made). */
|
|
36
|
-
hasTaskActivity?: (sessionId: string) => boolean;
|
|
37
|
-
/** Mark a session's task as delivered (initial ready event processed). */
|
|
38
|
-
markTaskDelivered?: (sessionId: string) => void;
|
|
39
|
-
}
|
|
40
|
-
/** Value returned by {@link initializePTYManager}. */
|
|
41
|
-
export interface InitResult {
|
|
42
|
-
manager: PTYManager | BunCompatiblePTYManager;
|
|
43
|
-
usingBunWorker: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Create and configure a PTY manager for the current runtime.
|
|
47
|
-
*
|
|
48
|
-
* - **Bun**: instantiates a {@link BunCompatiblePTYManager} that spawns a
|
|
49
|
-
* Node worker process and communicates via JSON-RPC over stdio.
|
|
50
|
-
* - **Node**: instantiates a {@link PTYManager} directly and registers
|
|
51
|
-
* all built-in adapters in-process.
|
|
52
|
-
*/
|
|
53
|
-
export declare function initializePTYManager(ctx: InitContext): Promise<InitResult>;
|
|
54
|
-
//# sourceMappingURL=pty-init.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pty-init.d.ts","sourceRoot":"","sources":["../../../../../../../../typescript/src/features/orchestrator/services/pty-init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAEN,uBAAuB,EAEvB,UAAU,EAKV,KAAK,mBAAmB,EAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAwDvD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,aAAa,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,CACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,KAChB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACzC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5C,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,cAAc,EAAE;QACf,gBAAgB,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,GAChB,IAAI,CAAC;KACR,CAAC;IACF,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,KAAK,IAAI,CAAC;IACX,gEAAgE;IAChE,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,qFAAqF;IACrF,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAkBD,sDAAsD;AACtD,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,UAAU,GAAG,uBAAuB,CAAC;IAC9C,cAAc,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACzC,GAAG,EAAE,WAAW,GACd,OAAO,CAAC,UAAU,CAAC,CA0VrB"}
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PTY manager initialization — extracted from PTYService.initialize().
|
|
3
|
-
*
|
|
4
|
-
* Creates either a BunCompatiblePTYManager (for Bun runtime) or PTYManager
|
|
5
|
-
* (for Node), wires up event handlers, and returns the configured manager.
|
|
6
|
-
*
|
|
7
|
-
* @module services/pty-init
|
|
8
|
-
*/
|
|
9
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
|
-
import os from "node:os";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
import { createAllAdapters } from "coding-agent-adapters";
|
|
14
|
-
import { BunCompatiblePTYManager, isBun, PTYManager, ShellAdapter, } from "pty-manager";
|
|
15
|
-
import { captureTaskResponse } from "./ansi-utils.js";
|
|
16
|
-
// Stall detector silence threshold. 60s — long enough that a bash, git,
|
|
17
|
-
// WebSearch, or multi-step tool call can complete without tripping the
|
|
18
|
-
// classifier, short enough to still catch real hangs within a minute.
|
|
19
|
-
// Previously 4000ms, which misfired for every long tool call on claude-code
|
|
20
|
-
// agents and caused completion re-injection loops on open-ended tasks.
|
|
21
|
-
const STALL_TIMEOUT_MS = 60_000;
|
|
22
|
-
// Resolve absolute path to coding-agent-adapters so the Node worker process
|
|
23
|
-
// can load it regardless of its cwd. The worker uses require() which does
|
|
24
|
-
// cwd-relative resolution — passing the bare module name "coding-agent-adapters"
|
|
25
|
-
// fails when the worker's cwd doesn't contain node_modules.
|
|
26
|
-
const _require = createRequire(import.meta.url);
|
|
27
|
-
let resolvedAdapterModule = "coding-agent-adapters";
|
|
28
|
-
try {
|
|
29
|
-
resolvedAdapterModule = _require.resolve("coding-agent-adapters");
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
// Fallback to bare specifier if resolve fails (shouldn't happen)
|
|
33
|
-
}
|
|
34
|
-
function resolveNodeWorkerPath() {
|
|
35
|
-
const explicitCandidates = [
|
|
36
|
-
process.env.NODE,
|
|
37
|
-
process.env.NODE_BINARY,
|
|
38
|
-
"/opt/homebrew/bin/node",
|
|
39
|
-
"/usr/local/bin/node",
|
|
40
|
-
].filter((value) => Boolean(value?.trim()));
|
|
41
|
-
for (const candidate of explicitCandidates) {
|
|
42
|
-
if (existsSync(candidate)) {
|
|
43
|
-
return candidate;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const nvmVersionsDir = path.join(os.homedir(), ".nvm", "versions", "node");
|
|
47
|
-
if (existsSync(nvmVersionsDir)) {
|
|
48
|
-
const versions = readdirSync(nvmVersionsDir)
|
|
49
|
-
.filter((entry) => entry.startsWith("v"))
|
|
50
|
-
.sort((a, b) => b.localeCompare(a, undefined, {
|
|
51
|
-
numeric: true,
|
|
52
|
-
sensitivity: "base",
|
|
53
|
-
}));
|
|
54
|
-
for (const version of versions) {
|
|
55
|
-
const candidate = path.join(nvmVersionsDir, version, "bin", "node");
|
|
56
|
-
if (existsSync(candidate)) {
|
|
57
|
-
return candidate;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return "node";
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Create and configure a PTY manager for the current runtime.
|
|
65
|
-
*
|
|
66
|
-
* - **Bun**: instantiates a {@link BunCompatiblePTYManager} that spawns a
|
|
67
|
-
* Node worker process and communicates via JSON-RPC over stdio.
|
|
68
|
-
* - **Node**: instantiates a {@link PTYManager} directly and registers
|
|
69
|
-
* all built-in adapters in-process.
|
|
70
|
-
*/
|
|
71
|
-
export async function initializePTYManager(ctx) {
|
|
72
|
-
const usingBunWorker = isBun();
|
|
73
|
-
const recentStructuredAuth = new Map();
|
|
74
|
-
const AUTH_EVENT_DEDUPE_MS = 5_000;
|
|
75
|
-
const emitStructuredAuthRequired = (session, info) => {
|
|
76
|
-
recentStructuredAuth.set(session.id, Date.now());
|
|
77
|
-
if (session.type === "gemini") {
|
|
78
|
-
ctx.handleGeminiAuth(session.id);
|
|
79
|
-
}
|
|
80
|
-
ctx.emitEvent(session.id, "login_required", {
|
|
81
|
-
instructions: info.instructions,
|
|
82
|
-
url: info.url,
|
|
83
|
-
deviceCode: info.deviceCode,
|
|
84
|
-
method: info.method,
|
|
85
|
-
promptSnippet: info.promptSnippet,
|
|
86
|
-
session,
|
|
87
|
-
source: "pty_manager",
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
const shouldSuppressLegacyLoginRequired = (sessionId) => {
|
|
91
|
-
const at = recentStructuredAuth.get(sessionId);
|
|
92
|
-
if (!at)
|
|
93
|
-
return false;
|
|
94
|
-
if (Date.now() - at > AUTH_EVENT_DEDUPE_MS) {
|
|
95
|
-
recentStructuredAuth.delete(sessionId);
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
return true;
|
|
99
|
-
};
|
|
100
|
-
if (usingBunWorker) {
|
|
101
|
-
// Use Bun-compatible manager that spawns a Node worker
|
|
102
|
-
ctx.log("Detected Bun runtime, using BunCompatiblePTYManager");
|
|
103
|
-
ctx.log(`Resolved adapter module: ${resolvedAdapterModule}`);
|
|
104
|
-
const bunManager = new BunCompatiblePTYManager({
|
|
105
|
-
adapterModules: [resolvedAdapterModule],
|
|
106
|
-
nodePath: resolveNodeWorkerPath(),
|
|
107
|
-
stallDetectionEnabled: true,
|
|
108
|
-
stallTimeoutMs: STALL_TIMEOUT_MS,
|
|
109
|
-
onStallClassify: async (sessionId, recentOutput, _stallDurationMs) => {
|
|
110
|
-
return ctx.classifyStall(sessionId, recentOutput);
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
// Set up event forwarding for worker-based manager. session_ready means
|
|
114
|
-
// the PTY prompt is visible again — it does NOT mean the agent is done
|
|
115
|
-
// (see the forwardReadyAsTaskComplete note above).
|
|
116
|
-
bunManager.on("session_ready", (session) => {
|
|
117
|
-
ctx.log(`session_ready event received for ${session.id} (type: ${session.type}, status: ${session.status})`);
|
|
118
|
-
ctx.emitEvent(session.id, "ready", { session, source: "pty_manager" });
|
|
119
|
-
ctx.markTaskDelivered?.(session.id);
|
|
120
|
-
});
|
|
121
|
-
bunManager.on("session_exit", (id, code) => {
|
|
122
|
-
ctx.emitEvent(id, "stopped", {
|
|
123
|
-
reason: `exit code ${code}`,
|
|
124
|
-
source: "pty_manager",
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
bunManager.on("session_error", (id, error) => {
|
|
128
|
-
ctx.emitEvent(id, "error", { message: error, source: "pty_manager" });
|
|
129
|
-
});
|
|
130
|
-
bunManager.on("blocking_prompt", (session, promptInfo, autoResponded) => {
|
|
131
|
-
const info = promptInfo;
|
|
132
|
-
ctx.log(`blocking_prompt for ${session.id}: type=${info?.type}, autoResponded=${autoResponded}, prompt="${(info?.prompt ?? "").slice(0, 80)}"`);
|
|
133
|
-
ctx.emitEvent(session.id, "blocked", {
|
|
134
|
-
promptInfo,
|
|
135
|
-
autoResponded,
|
|
136
|
-
source: "pty_manager",
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
bunManager.on("auth_required", (session, info) => {
|
|
140
|
-
emitStructuredAuthRequired(session, info);
|
|
141
|
-
});
|
|
142
|
-
bunManager.on("login_required", (session, instructions, url) => {
|
|
143
|
-
if (shouldSuppressLegacyLoginRequired(session.id)) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
// Auto-handle Gemini auth flow
|
|
147
|
-
if (session.type === "gemini") {
|
|
148
|
-
ctx.handleGeminiAuth(session.id);
|
|
149
|
-
}
|
|
150
|
-
ctx.emitEvent(session.id, "login_required", {
|
|
151
|
-
instructions,
|
|
152
|
-
url,
|
|
153
|
-
source: "pty_manager",
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
bunManager.on("task_complete", (session) => {
|
|
157
|
-
const response = captureTaskResponse(session.id, ctx.sessionOutputBuffers, ctx.taskResponseMarkers);
|
|
158
|
-
const durationMs = session.startedAt
|
|
159
|
-
? Date.now() - new Date(session.startedAt).getTime()
|
|
160
|
-
: 0;
|
|
161
|
-
ctx.metricsTracker.recordCompletion(session.type, "fast-path", durationMs);
|
|
162
|
-
ctx.log(`Task complete for ${session.id} (adapter fast-path), response: ${response.length} chars`);
|
|
163
|
-
ctx.emitEvent(session.id, "task_complete", {
|
|
164
|
-
session,
|
|
165
|
-
response,
|
|
166
|
-
source: "adapter_fast_path",
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
bunManager.on("tool_running", (session, info) => {
|
|
170
|
-
ctx.log(`tool_running for ${session.id}: ${info.toolName}${info.description ? ` — ${info.description}` : ""}`);
|
|
171
|
-
ctx.emitEvent(session.id, "tool_running", {
|
|
172
|
-
session,
|
|
173
|
-
...info,
|
|
174
|
-
source: "pty_manager",
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
bunManager.on("message", (message) => {
|
|
178
|
-
ctx.emitEvent(message.sessionId, "message", {
|
|
179
|
-
...message,
|
|
180
|
-
source: "pty_manager",
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
// Log worker-level stderr (pino logs from pty-manager worker process).
|
|
184
|
-
// Strip the "Invalid JSON from worker:" prefix that BunCompatiblePTYManager
|
|
185
|
-
// adds when stderr lines aren't valid JSON-RPC responses.
|
|
186
|
-
bunManager.on("worker_error", (err) => {
|
|
187
|
-
const raw = typeof err === "string" ? err : String(err);
|
|
188
|
-
const msg = raw.replace(/^Invalid JSON from worker:\s*/i, "").trim();
|
|
189
|
-
if (!msg)
|
|
190
|
-
return;
|
|
191
|
-
// Capture task completion trace entries for timeline analysis
|
|
192
|
-
if (msg.includes("Task completion trace")) {
|
|
193
|
-
ctx.traceEntries.push(msg);
|
|
194
|
-
if (ctx.traceEntries.length > ctx.maxTraceEntries) {
|
|
195
|
-
ctx.traceEntries.splice(0, ctx.traceEntries.length - ctx.maxTraceEntries);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
// Show operational logs at info level (suppress noisy loading-suppression messages)
|
|
199
|
-
if (msg.includes("suppressing stall emission")) {
|
|
200
|
-
// Loading pattern suppression fires every few seconds — too noisy for console
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (msg.includes("ready") ||
|
|
204
|
-
msg.includes("blocking") ||
|
|
205
|
-
msg.includes("auto-response") ||
|
|
206
|
-
msg.includes("Auto-responding") ||
|
|
207
|
-
msg.includes("detectReady") ||
|
|
208
|
-
msg.includes("stall") ||
|
|
209
|
-
msg.includes("Stall") ||
|
|
210
|
-
msg.includes("Task completion") ||
|
|
211
|
-
msg.includes("Spawning") ||
|
|
212
|
-
msg.includes("PTY session")) {
|
|
213
|
-
console.log("[PTYService/Worker]", msg);
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
console.error("[PTYService/Worker]", msg.slice(0, 200));
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
bunManager.on("worker_exit", (info) => {
|
|
220
|
-
ctx.handleWorkerExit?.(info);
|
|
221
|
-
console.error("[PTYService] Worker exited:", info);
|
|
222
|
-
});
|
|
223
|
-
await bunManager.waitForReady();
|
|
224
|
-
return { manager: bunManager, usingBunWorker: true };
|
|
225
|
-
}
|
|
226
|
-
// Use native PTYManager directly in Node
|
|
227
|
-
ctx.log("Using native PTYManager");
|
|
228
|
-
const managerConfig = {
|
|
229
|
-
maxLogLines: ctx.serviceConfig.maxLogLines,
|
|
230
|
-
stallDetectionEnabled: true,
|
|
231
|
-
stallTimeoutMs: STALL_TIMEOUT_MS,
|
|
232
|
-
onStallClassify: async (sessionId, recentOutput, _stallDurationMs) => {
|
|
233
|
-
return ctx.classifyStall(sessionId, recentOutput);
|
|
234
|
-
},
|
|
235
|
-
};
|
|
236
|
-
const nodeManager = new PTYManager(managerConfig);
|
|
237
|
-
// Register built-in adapters
|
|
238
|
-
nodeManager.registerAdapter(new ShellAdapter());
|
|
239
|
-
// Register coding agent adapters (claude, gemini, codex, aider).
|
|
240
|
-
// Pi currently routes through the generic shell adapter.
|
|
241
|
-
if (ctx.serviceConfig.registerCodingAdapters) {
|
|
242
|
-
const codingAdapters = createAllAdapters();
|
|
243
|
-
for (const adapter of codingAdapters) {
|
|
244
|
-
nodeManager.registerAdapter(adapter);
|
|
245
|
-
ctx.log(`Registered ${adapter.adapterType} adapter`);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
// Set up event forwarding. session_ready means the PTY prompt is visible
|
|
249
|
-
// again — NOT that the agent is done (see the forwardReadyAsTaskComplete
|
|
250
|
-
// note above).
|
|
251
|
-
nodeManager.on("session_ready", (session) => {
|
|
252
|
-
ctx.emitEvent(session.id, "ready", { session, source: "pty_manager" });
|
|
253
|
-
ctx.markTaskDelivered?.(session.id);
|
|
254
|
-
});
|
|
255
|
-
nodeManager.on("blocking_prompt", (session, promptInfo, autoResponded) => {
|
|
256
|
-
ctx.emitEvent(session.id, "blocked", {
|
|
257
|
-
promptInfo,
|
|
258
|
-
autoResponded,
|
|
259
|
-
source: "pty_manager",
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
nodeManager.on("auth_required", (session, info) => {
|
|
263
|
-
emitStructuredAuthRequired(session, info);
|
|
264
|
-
});
|
|
265
|
-
nodeManager.on("login_required", (session, instructions, url) => {
|
|
266
|
-
if (shouldSuppressLegacyLoginRequired(session.id)) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (session.type === "gemini") {
|
|
270
|
-
ctx.handleGeminiAuth(session.id);
|
|
271
|
-
}
|
|
272
|
-
ctx.emitEvent(session.id, "login_required", {
|
|
273
|
-
instructions,
|
|
274
|
-
url,
|
|
275
|
-
source: "pty_manager",
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
nodeManager.on("task_complete", (session) => {
|
|
279
|
-
const response = captureTaskResponse(session.id, ctx.sessionOutputBuffers, ctx.taskResponseMarkers);
|
|
280
|
-
const durationMs = session.startedAt
|
|
281
|
-
? Date.now() - new Date(session.startedAt).getTime()
|
|
282
|
-
: 0;
|
|
283
|
-
ctx.metricsTracker.recordCompletion(session.type, "fast-path", durationMs);
|
|
284
|
-
ctx.log(`Task complete for ${session.id} (adapter fast-path), response: ${response.length} chars`);
|
|
285
|
-
ctx.emitEvent(session.id, "task_complete", {
|
|
286
|
-
session,
|
|
287
|
-
response,
|
|
288
|
-
source: "adapter_fast_path",
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
nodeManager.on("tool_running", (session, info) => {
|
|
292
|
-
ctx.log(`tool_running for ${session.id}: ${info.toolName}${info.description ? ` — ${info.description}` : ""}`);
|
|
293
|
-
ctx.emitEvent(session.id, "tool_running", {
|
|
294
|
-
session,
|
|
295
|
-
...info,
|
|
296
|
-
source: "pty_manager",
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
nodeManager.on("session_stopped", (session, reason) => {
|
|
300
|
-
ctx.emitEvent(session.id, "stopped", { reason, source: "pty_manager" });
|
|
301
|
-
});
|
|
302
|
-
nodeManager.on("session_error", (session, error) => {
|
|
303
|
-
ctx.emitEvent(session.id, "error", {
|
|
304
|
-
message: error,
|
|
305
|
-
source: "pty_manager",
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
nodeManager.on("message", (message) => {
|
|
309
|
-
ctx.emitEvent(message.sessionId, "message", {
|
|
310
|
-
...message,
|
|
311
|
-
source: "pty_manager",
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
return { manager: nodeManager, usingBunWorker: false };
|
|
315
|
-
}
|