@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,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type RawSqlQuery = {
|
|
3
|
-
queryChunks: Array<{
|
|
4
|
-
value?: unknown;
|
|
5
|
-
}>;
|
|
6
|
-
};
|
|
7
|
-
export type RuntimeDb = {
|
|
8
|
-
execute: (query: RawSqlQuery) => Promise<unknown>;
|
|
9
|
-
};
|
|
10
|
-
export declare function asObject(value: unknown): Record<string, unknown> | null;
|
|
11
|
-
export declare function toText(value: unknown, fallback?: string): string;
|
|
12
|
-
export declare function toNumber(value: unknown, fallback?: number): number;
|
|
13
|
-
export declare function toBoolean(value: unknown, fallback?: boolean): boolean;
|
|
14
|
-
export declare function parseJsonValue<T>(value: unknown, fallback: T): T;
|
|
15
|
-
export declare function parseJsonRecord(value: unknown): Record<string, unknown>;
|
|
16
|
-
export declare function parseJsonArray<T>(value: unknown): T[];
|
|
17
|
-
export declare function extractRows(result: unknown): Array<Record<string, unknown>>;
|
|
18
|
-
export declare function getSqlRaw(): Promise<(query: string) => RawSqlQuery>;
|
|
19
|
-
export declare function getRuntimeDb(runtime: IAgentRuntime): RuntimeDb;
|
|
20
|
-
export declare function getRuntimeDbCacheKey(runtime: IAgentRuntime): object;
|
|
21
|
-
export declare function executeRawSql(runtime: IAgentRuntime, sqlText: string): Promise<Array<Record<string, unknown>>>;
|
|
22
|
-
export declare function isLifeOpsBootstrapQueryError(error: unknown): boolean;
|
|
23
|
-
export declare function isRetryableLifeOpsStorageError(error: unknown): boolean;
|
|
24
|
-
export declare function listTableColumns(runtime: IAgentRuntime, tableName: string): Promise<string[]>;
|
|
25
|
-
export declare function sqlQuote(value: string): string;
|
|
26
|
-
export declare function sqlText(value: string | null | undefined): string;
|
|
27
|
-
export declare function sqlInteger(value: number | null | undefined): string;
|
|
28
|
-
export declare function sqlNumber(value: number | null | undefined): string;
|
|
29
|
-
export declare function sqlBoolean(value: boolean): string;
|
|
30
|
-
export declare function sqlJson(value: unknown): string;
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/sql";
|
|
31
2
|
//# sourceMappingURL=sql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/sql.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/sql.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,247 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export function asObject(value) {
|
|
3
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
4
|
-
return null;
|
|
5
|
-
return value;
|
|
6
|
-
}
|
|
7
|
-
export function toText(value, fallback = "") {
|
|
8
|
-
if (typeof value === "string")
|
|
9
|
-
return value;
|
|
10
|
-
if (value === null || value === undefined)
|
|
11
|
-
return fallback;
|
|
12
|
-
return String(value);
|
|
13
|
-
}
|
|
14
|
-
export function toNumber(value, fallback = 0) {
|
|
15
|
-
if (typeof value === "number" && Number.isFinite(value))
|
|
16
|
-
return value;
|
|
17
|
-
if (typeof value === "string") {
|
|
18
|
-
const parsed = Number(value);
|
|
19
|
-
if (Number.isFinite(parsed))
|
|
20
|
-
return parsed;
|
|
21
|
-
}
|
|
22
|
-
return fallback;
|
|
23
|
-
}
|
|
24
|
-
export function toBoolean(value, fallback = false) {
|
|
25
|
-
if (typeof value === "boolean")
|
|
26
|
-
return value;
|
|
27
|
-
if (typeof value === "number")
|
|
28
|
-
return value !== 0;
|
|
29
|
-
if (typeof value === "string") {
|
|
30
|
-
const normalized = value.trim().toLowerCase();
|
|
31
|
-
if (["1", "true", "yes", "on"].includes(normalized))
|
|
32
|
-
return true;
|
|
33
|
-
if (["0", "false", "no", "off"].includes(normalized))
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return fallback;
|
|
37
|
-
}
|
|
38
|
-
export function parseJsonValue(value, fallback) {
|
|
39
|
-
if (value === null || value === undefined || value === "")
|
|
40
|
-
return fallback;
|
|
41
|
-
if (typeof value !== "string") {
|
|
42
|
-
if (typeof value === "object")
|
|
43
|
-
return value;
|
|
44
|
-
return fallback;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
return JSON.parse(value);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
return fallback;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
export function parseJsonRecord(value) {
|
|
54
|
-
const parsed = parseJsonValue(value, null);
|
|
55
|
-
return asObject(parsed) ?? {};
|
|
56
|
-
}
|
|
57
|
-
export function parseJsonArray(value) {
|
|
58
|
-
const parsed = parseJsonValue(value, null);
|
|
59
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
60
|
-
}
|
|
61
|
-
export function extractRows(result) {
|
|
62
|
-
if (Array.isArray(result)) {
|
|
63
|
-
return result
|
|
64
|
-
.map((row) => asObject(row))
|
|
65
|
-
.filter((row) => row !== null);
|
|
66
|
-
}
|
|
67
|
-
const object = asObject(result);
|
|
68
|
-
if (!object)
|
|
69
|
-
return [];
|
|
70
|
-
const rows = object.rows;
|
|
71
|
-
if (!Array.isArray(rows))
|
|
72
|
-
return [];
|
|
73
|
-
return rows
|
|
74
|
-
.map((row) => asObject(row))
|
|
75
|
-
.filter((row) => row !== null);
|
|
76
|
-
}
|
|
77
|
-
export async function getSqlRaw() {
|
|
78
|
-
if (cachedSqlRaw)
|
|
79
|
-
return cachedSqlRaw;
|
|
80
|
-
const drizzle = (await import("drizzle-orm"));
|
|
81
|
-
cachedSqlRaw = drizzle.sql.raw;
|
|
82
|
-
return cachedSqlRaw;
|
|
83
|
-
}
|
|
84
|
-
function getRuntimeDbAdapter(runtime) {
|
|
85
|
-
const runtimeLike = runtime;
|
|
86
|
-
const adapter = runtimeLike.adapter?.db &&
|
|
87
|
-
typeof runtimeLike.adapter.db.execute === "function"
|
|
88
|
-
? runtimeLike.adapter
|
|
89
|
-
: runtimeLike.databaseAdapter?.db &&
|
|
90
|
-
typeof runtimeLike.databaseAdapter.db.execute === "function"
|
|
91
|
-
? runtimeLike.databaseAdapter
|
|
92
|
-
: null;
|
|
93
|
-
if (!adapter) {
|
|
94
|
-
throw new Error("runtime database adapter unavailable");
|
|
95
|
-
}
|
|
96
|
-
return adapter;
|
|
97
|
-
}
|
|
98
|
-
export function getRuntimeDb(runtime) {
|
|
99
|
-
const db = getRuntimeDbAdapter(runtime).db;
|
|
100
|
-
if (!db || typeof db.execute !== "function") {
|
|
101
|
-
throw new Error("runtime database adapter unavailable");
|
|
102
|
-
}
|
|
103
|
-
return db;
|
|
104
|
-
}
|
|
105
|
-
export function getRuntimeDbCacheKey(runtime) {
|
|
106
|
-
const adapter = getRuntimeDbAdapter(runtime);
|
|
107
|
-
const rawConnection = typeof adapter.getRawConnection === "function"
|
|
108
|
-
? adapter.getRawConnection()
|
|
109
|
-
: null;
|
|
110
|
-
if (rawConnection &&
|
|
111
|
-
(typeof rawConnection === "object" || typeof rawConnection === "function")) {
|
|
112
|
-
return rawConnection;
|
|
113
|
-
}
|
|
114
|
-
return getRuntimeDb(runtime);
|
|
115
|
-
}
|
|
116
|
-
export async function executeRawSql(runtime, sqlText) {
|
|
117
|
-
const raw = await getSqlRaw();
|
|
118
|
-
const db = getRuntimeDb(runtime);
|
|
119
|
-
const result = await db.execute(raw(sqlText));
|
|
120
|
-
return extractRows(result);
|
|
121
|
-
}
|
|
122
|
-
function collectErrorMessages(error) {
|
|
123
|
-
const messages = [];
|
|
124
|
-
const seen = new Set();
|
|
125
|
-
let current = error;
|
|
126
|
-
while (current && !seen.has(current)) {
|
|
127
|
-
seen.add(current);
|
|
128
|
-
if (typeof current === "string") {
|
|
129
|
-
messages.push(current);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
if (current instanceof Error) {
|
|
133
|
-
if (current.message)
|
|
134
|
-
messages.push(current.message);
|
|
135
|
-
if (current.stack)
|
|
136
|
-
messages.push(current.stack);
|
|
137
|
-
current = current.cause;
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (typeof current === "object") {
|
|
141
|
-
const maybeError = current;
|
|
142
|
-
if (typeof maybeError.message === "string" && maybeError.message) {
|
|
143
|
-
messages.push(maybeError.message);
|
|
144
|
-
}
|
|
145
|
-
if (maybeError.cause !== undefined) {
|
|
146
|
-
current = maybeError.cause;
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
return messages;
|
|
153
|
-
}
|
|
154
|
-
export function isLifeOpsBootstrapQueryError(error) {
|
|
155
|
-
const haystack = collectErrorMessages(error).join("\n").toLowerCase();
|
|
156
|
-
if (!haystack.includes("failed query:")) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
return (haystack.includes("create table if not exists life_") ||
|
|
160
|
-
haystack.includes("create index if not exists idx_life_") ||
|
|
161
|
-
haystack.includes("alter table life_"));
|
|
162
|
-
}
|
|
163
|
-
export function isRetryableLifeOpsStorageError(error) {
|
|
164
|
-
const haystack = collectErrorMessages(error).join("\n").toLowerCase();
|
|
165
|
-
if (!haystack) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
if (isLifeOpsBootstrapQueryError(error)) {
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
const hasStorageSignal = [
|
|
172
|
-
"aborted(). build with -sassertions",
|
|
173
|
-
"database disk image is malformed",
|
|
174
|
-
"file is not a database",
|
|
175
|
-
"malformed database schema",
|
|
176
|
-
"database is locked",
|
|
177
|
-
"lock file already exists",
|
|
178
|
-
"wal file",
|
|
179
|
-
"checkpoint failed",
|
|
180
|
-
"checksum mismatch",
|
|
181
|
-
"corrupt",
|
|
182
|
-
].some((needle) => haystack.includes(needle));
|
|
183
|
-
const hasBackendSignal = haystack.includes("pglite") ||
|
|
184
|
-
haystack.includes("sqlite") ||
|
|
185
|
-
haystack.includes("failed query:");
|
|
186
|
-
return hasStorageSignal && hasBackendSignal;
|
|
187
|
-
}
|
|
188
|
-
export async function listTableColumns(runtime, tableName) {
|
|
189
|
-
try {
|
|
190
|
-
const rows = await executeRawSql(runtime, `SELECT column_name
|
|
191
|
-
FROM information_schema.columns
|
|
192
|
-
WHERE table_schema = current_schema()
|
|
193
|
-
AND table_name = ${sqlQuote(tableName)}
|
|
194
|
-
ORDER BY ordinal_position`);
|
|
195
|
-
if (rows.length > 0) {
|
|
196
|
-
return rows
|
|
197
|
-
.map((row) => toText(row.column_name))
|
|
198
|
-
.filter((name) => name.length > 0);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
catch (error) {
|
|
202
|
-
const message = String(error).toLowerCase();
|
|
203
|
-
const infoSchemaUnavailable = message.includes("information_schema") ||
|
|
204
|
-
message.includes("no such table") ||
|
|
205
|
-
message.includes("does not exist") ||
|
|
206
|
-
message.includes("syntax error") ||
|
|
207
|
-
message.includes("unknown table") ||
|
|
208
|
-
message.includes("relation") ||
|
|
209
|
-
message.includes("pragma");
|
|
210
|
-
if (!infoSchemaUnavailable) {
|
|
211
|
-
throw error;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (!/^[a-zA-Z0-9_]+$/.test(tableName)) {
|
|
215
|
-
throw new Error(`invalid table name for PRAGMA: ${tableName}`);
|
|
216
|
-
}
|
|
217
|
-
const rows = await executeRawSql(runtime, `PRAGMA table_info(${tableName})`);
|
|
218
|
-
return rows.map((row) => toText(row.name)).filter((name) => name.length > 0);
|
|
219
|
-
}
|
|
220
|
-
export function sqlQuote(value) {
|
|
221
|
-
return `'${value.replace(/'/g, "''")}'`;
|
|
222
|
-
}
|
|
223
|
-
export function sqlText(value) {
|
|
224
|
-
if (value === null || value === undefined)
|
|
225
|
-
return "NULL";
|
|
226
|
-
return sqlQuote(value);
|
|
227
|
-
}
|
|
228
|
-
export function sqlInteger(value) {
|
|
229
|
-
if (value === null || value === undefined)
|
|
230
|
-
return "NULL";
|
|
231
|
-
if (!Number.isFinite(value))
|
|
232
|
-
throw new Error("invalid numeric SQL literal");
|
|
233
|
-
return String(Math.trunc(value));
|
|
234
|
-
}
|
|
235
|
-
export function sqlNumber(value) {
|
|
236
|
-
if (value === null || value === undefined)
|
|
237
|
-
return "NULL";
|
|
238
|
-
if (!Number.isFinite(value))
|
|
239
|
-
throw new Error("invalid numeric SQL literal");
|
|
240
|
-
return String(value);
|
|
241
|
-
}
|
|
242
|
-
export function sqlBoolean(value) {
|
|
243
|
-
return value ? "TRUE" : "FALSE";
|
|
244
|
-
}
|
|
245
|
-
export function sqlJson(value) {
|
|
246
|
-
return sqlQuote(JSON.stringify(value ?? null));
|
|
247
|
-
}
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/sql";
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
year: number;
|
|
3
|
-
month: number;
|
|
4
|
-
day: number;
|
|
5
|
-
hour: number;
|
|
6
|
-
minute: number;
|
|
7
|
-
second: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function getZonedDateParts(date: Date, timeZone: string): ZonedDateParts;
|
|
10
|
-
export declare function getTimeZoneOffsetMinutes(date: Date, timeZone: string): number;
|
|
11
|
-
export declare function buildUtcDateFromLocalParts(timeZone: string, parts: ZonedDateParts): Date;
|
|
12
|
-
export declare function formatInstantAsRfc3339InTimeZone(value: Date | string, timeZone: string): string;
|
|
13
|
-
export declare function addDaysToLocalDate(dateOnly: Pick<ZonedDateParts, "year" | "month" | "day">, dayDelta: number): Pick<ZonedDateParts, "year" | "month" | "day">;
|
|
14
|
-
export declare function getWeekdayForLocalDate(dateOnly: Pick<ZonedDateParts, "year" | "month" | "day">): number;
|
|
15
|
-
export declare function getLocalDateKey(dateOnly: Pick<ZonedDateParts, "year" | "month" | "day">): string;
|
|
16
|
-
export declare function addMinutes(date: Date, minutes: number): Date;
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/time";
|
|
17
2
|
//# sourceMappingURL=time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/time.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/time.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
|
@@ -1,132 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const offsetFormatterCache = new Map();
|
|
3
|
-
function getZonedFormatter(timeZone) {
|
|
4
|
-
const cacheKey = `parts:${timeZone}`;
|
|
5
|
-
const cached = zonedFormatterCache.get(cacheKey);
|
|
6
|
-
if (cached)
|
|
7
|
-
return cached;
|
|
8
|
-
const formatter = new Intl.DateTimeFormat("en-US", {
|
|
9
|
-
timeZone,
|
|
10
|
-
hour12: false,
|
|
11
|
-
year: "numeric",
|
|
12
|
-
month: "2-digit",
|
|
13
|
-
day: "2-digit",
|
|
14
|
-
hour: "2-digit",
|
|
15
|
-
minute: "2-digit",
|
|
16
|
-
second: "2-digit",
|
|
17
|
-
});
|
|
18
|
-
zonedFormatterCache.set(cacheKey, formatter);
|
|
19
|
-
return formatter;
|
|
20
|
-
}
|
|
21
|
-
function getOffsetFormatter(timeZone) {
|
|
22
|
-
const cacheKey = `offset:${timeZone}`;
|
|
23
|
-
const cached = offsetFormatterCache.get(cacheKey);
|
|
24
|
-
if (cached)
|
|
25
|
-
return cached;
|
|
26
|
-
const formatter = new Intl.DateTimeFormat("en-US", {
|
|
27
|
-
timeZone,
|
|
28
|
-
timeZoneName: "shortOffset",
|
|
29
|
-
hour: "2-digit",
|
|
30
|
-
minute: "2-digit",
|
|
31
|
-
second: "2-digit",
|
|
32
|
-
hour12: false,
|
|
33
|
-
});
|
|
34
|
-
offsetFormatterCache.set(cacheKey, formatter);
|
|
35
|
-
return formatter;
|
|
36
|
-
}
|
|
37
|
-
export function getZonedDateParts(date, timeZone) {
|
|
38
|
-
const parts = getZonedFormatter(timeZone).formatToParts(date);
|
|
39
|
-
const read = (type) => {
|
|
40
|
-
const part = parts.find((candidate) => candidate.type === type)?.value;
|
|
41
|
-
if (!part) {
|
|
42
|
-
throw new Error(`missing zoned date part: ${type}`);
|
|
43
|
-
}
|
|
44
|
-
return Number(part);
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
year: read("year"),
|
|
48
|
-
month: read("month"),
|
|
49
|
-
day: read("day"),
|
|
50
|
-
hour: read("hour"),
|
|
51
|
-
minute: read("minute"),
|
|
52
|
-
second: read("second"),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export function getTimeZoneOffsetMinutes(date, timeZone) {
|
|
56
|
-
const parts = getOffsetFormatter(timeZone).formatToParts(date);
|
|
57
|
-
const token = parts.find((part) => part.type === "timeZoneName")?.value?.trim() ?? "GMT";
|
|
58
|
-
if (token === "GMT" || token === "UTC")
|
|
59
|
-
return 0;
|
|
60
|
-
const match = token.match(/^GMT([+-])(\d{1,2})(?::?(\d{2}))?$/i);
|
|
61
|
-
if (!match) {
|
|
62
|
-
throw new Error(`unsupported offset token: ${token}`);
|
|
63
|
-
}
|
|
64
|
-
const sign = match[1] === "+" ? 1 : -1;
|
|
65
|
-
const hours = Number(match[2]);
|
|
66
|
-
const minutes = Number(match[3] ?? "0");
|
|
67
|
-
return sign * (hours * 60 + minutes);
|
|
68
|
-
}
|
|
69
|
-
function formatOffsetToken(offsetMinutes) {
|
|
70
|
-
const sign = offsetMinutes >= 0 ? "+" : "-";
|
|
71
|
-
const absolute = Math.abs(offsetMinutes);
|
|
72
|
-
const hours = Math.trunc(absolute / 60)
|
|
73
|
-
.toString()
|
|
74
|
-
.padStart(2, "0");
|
|
75
|
-
const minutes = Math.trunc(absolute % 60)
|
|
76
|
-
.toString()
|
|
77
|
-
.padStart(2, "0");
|
|
78
|
-
return `${sign}${hours}:${minutes}`;
|
|
79
|
-
}
|
|
80
|
-
function localPartsToEpochMs(parts) {
|
|
81
|
-
return Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour, parts.minute, parts.second);
|
|
82
|
-
}
|
|
83
|
-
export function buildUtcDateFromLocalParts(timeZone, parts) {
|
|
84
|
-
const baseUtcMs = localPartsToEpochMs(parts);
|
|
85
|
-
let candidate = new Date(baseUtcMs);
|
|
86
|
-
for (let index = 0; index < 6; index += 1) {
|
|
87
|
-
const offsetMinutes = getTimeZoneOffsetMinutes(candidate, timeZone);
|
|
88
|
-
const adjusted = new Date(baseUtcMs - offsetMinutes * 60_000);
|
|
89
|
-
const actualParts = getZonedDateParts(adjusted, timeZone);
|
|
90
|
-
const deltaMinutes = Math.round((localPartsToEpochMs(parts) - localPartsToEpochMs(actualParts)) / 60_000);
|
|
91
|
-
if (deltaMinutes === 0) {
|
|
92
|
-
return adjusted;
|
|
93
|
-
}
|
|
94
|
-
candidate = new Date(adjusted.getTime() + deltaMinutes * 60_000);
|
|
95
|
-
}
|
|
96
|
-
return candidate;
|
|
97
|
-
}
|
|
98
|
-
export function formatInstantAsRfc3339InTimeZone(value, timeZone) {
|
|
99
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
100
|
-
if (!Number.isFinite(date.getTime())) {
|
|
101
|
-
throw new Error(`invalid datetime for timezone conversion: ${String(value)}`);
|
|
102
|
-
}
|
|
103
|
-
const parts = getZonedDateParts(date, timeZone);
|
|
104
|
-
const offset = getTimeZoneOffsetMinutes(date, timeZone);
|
|
105
|
-
return ([
|
|
106
|
-
`${parts.year.toString().padStart(4, "0")}-${parts.month
|
|
107
|
-
.toString()
|
|
108
|
-
.padStart(2, "0")}-${parts.day.toString().padStart(2, "0")}`,
|
|
109
|
-
`${parts.hour.toString().padStart(2, "0")}:${parts.minute
|
|
110
|
-
.toString()
|
|
111
|
-
.padStart(2, "0")}:${parts.second.toString().padStart(2, "0")}`,
|
|
112
|
-
].join("T") + formatOffsetToken(offset));
|
|
113
|
-
}
|
|
114
|
-
export function addDaysToLocalDate(dateOnly, dayDelta) {
|
|
115
|
-
const utcDate = new Date(Date.UTC(dateOnly.year, dateOnly.month - 1, dateOnly.day + dayDelta, 12, 0, 0));
|
|
116
|
-
return {
|
|
117
|
-
year: utcDate.getUTCFullYear(),
|
|
118
|
-
month: utcDate.getUTCMonth() + 1,
|
|
119
|
-
day: utcDate.getUTCDate(),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
export function getWeekdayForLocalDate(dateOnly) {
|
|
123
|
-
return new Date(Date.UTC(dateOnly.year, dateOnly.month - 1, dateOnly.day, 12, 0, 0)).getUTCDay();
|
|
124
|
-
}
|
|
125
|
-
export function getLocalDateKey(dateOnly) {
|
|
126
|
-
return `${dateOnly.year.toString().padStart(4, "0")}-${dateOnly.month
|
|
127
|
-
.toString()
|
|
128
|
-
.padStart(2, "0")}-${dateOnly.day.toString().padStart(2, "0")}`;
|
|
129
|
-
}
|
|
130
|
-
export function addMinutes(date, minutes) {
|
|
131
|
-
return new Date(date.getTime() + minutes * 60_000);
|
|
132
|
-
}
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/time";
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
accountSid: string;
|
|
3
|
-
authToken: string;
|
|
4
|
-
fromPhoneNumber: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TwilioDeliveryResult {
|
|
7
|
-
ok: boolean;
|
|
8
|
-
status: number | null;
|
|
9
|
-
sid?: string;
|
|
10
|
-
error?: string;
|
|
11
|
-
/** Number of retries attempted before the final result (0 = first attempt succeeded or failed permanently). */
|
|
12
|
-
retryCount?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare function readTwilioCredentialsFromEnv(env?: NodeJS.ProcessEnv): TwilioCredentials | null;
|
|
15
|
-
export declare function sendTwilioSms(args: {
|
|
16
|
-
credentials: TwilioCredentials;
|
|
17
|
-
to: string;
|
|
18
|
-
body: string;
|
|
19
|
-
}): Promise<TwilioDeliveryResult>;
|
|
20
|
-
export declare function sendTwilioVoiceCall(args: {
|
|
21
|
-
credentials: TwilioCredentials;
|
|
22
|
-
to: string;
|
|
23
|
-
message: string;
|
|
24
|
-
}): Promise<TwilioDeliveryResult>;
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/twilio";
|
|
25
2
|
//# sourceMappingURL=twilio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twilio.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/twilio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"twilio.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/twilio.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -1,157 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { createIntegrationTelemetrySpan } from "../diagnostics/integration-observability.js";
|
|
3
|
-
function encodeBasicAuth(accountSid, authToken) {
|
|
4
|
-
return Buffer.from(`${accountSid}:${authToken}`).toString("base64");
|
|
5
|
-
}
|
|
6
|
-
function twilioOperation(path) {
|
|
7
|
-
return path.includes("/Calls.") ? "twilio_voice" : "twilio_sms";
|
|
8
|
-
}
|
|
9
|
-
export function readTwilioCredentialsFromEnv(env = process.env) {
|
|
10
|
-
const accountSid = env.TWILIO_ACCOUNT_SID?.trim();
|
|
11
|
-
const authToken = env.TWILIO_AUTH_TOKEN?.trim();
|
|
12
|
-
const fromPhoneNumber = env.TWILIO_PHONE_NUMBER?.trim();
|
|
13
|
-
if (!accountSid || !authToken || !fromPhoneNumber) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
accountSid,
|
|
18
|
-
authToken,
|
|
19
|
-
fromPhoneNumber,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/** Maximum number of retries for transient (5xx / network) failures. */
|
|
23
|
-
const MAX_RETRIES = 2;
|
|
24
|
-
/** Base delay in ms for exponential backoff between retries. */
|
|
25
|
-
const BASE_DELAY_MS = 1_000;
|
|
26
|
-
/** Returns true when a failed result represents a transient error worth retrying. */
|
|
27
|
-
function isTransientFailure(result) {
|
|
28
|
-
// 4xx errors are permanent (auth, bad number, etc.) — never retry.
|
|
29
|
-
if (result.status !== null && result.status >= 400 && result.status < 500) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
// 5xx or network error (status === null) — retry.
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
async function sendTwilioRequest(args) {
|
|
36
|
-
const { credentials, path, payload } = args;
|
|
37
|
-
const url = `https://api.twilio.com/2010-04-01/Accounts/${encodeURIComponent(credentials.accountSid)}${path}`;
|
|
38
|
-
const operation = twilioOperation(path);
|
|
39
|
-
let lastResult = null;
|
|
40
|
-
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
|
41
|
-
if (attempt > 0) {
|
|
42
|
-
const delayMs = BASE_DELAY_MS * 2 ** (attempt - 1);
|
|
43
|
-
logger.warn({
|
|
44
|
-
boundary: "lifeops",
|
|
45
|
-
integration: "twilio",
|
|
46
|
-
operation,
|
|
47
|
-
attempt,
|
|
48
|
-
delayMs,
|
|
49
|
-
}, `[lifeops] Twilio request retry ${attempt}/${MAX_RETRIES} after ${delayMs}ms`);
|
|
50
|
-
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
51
|
-
}
|
|
52
|
-
const span = createIntegrationTelemetrySpan({
|
|
53
|
-
boundary: "lifeops",
|
|
54
|
-
operation,
|
|
55
|
-
timeoutMs: 12_000,
|
|
56
|
-
});
|
|
57
|
-
try {
|
|
58
|
-
const response = await fetch(url, {
|
|
59
|
-
method: "POST",
|
|
60
|
-
headers: {
|
|
61
|
-
Authorization: `Basic ${encodeBasicAuth(credentials.accountSid, credentials.authToken)}`,
|
|
62
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
63
|
-
},
|
|
64
|
-
body: payload.toString(),
|
|
65
|
-
signal: AbortSignal.timeout(12_000),
|
|
66
|
-
});
|
|
67
|
-
const data = (await response.json().catch(() => ({})));
|
|
68
|
-
if (!response.ok) {
|
|
69
|
-
const errorMsg = data.message ?? `HTTP ${response.status}`;
|
|
70
|
-
logger.warn({
|
|
71
|
-
boundary: "lifeops",
|
|
72
|
-
integration: "twilio",
|
|
73
|
-
operation,
|
|
74
|
-
statusCode: response.status,
|
|
75
|
-
}, `[lifeops] Twilio request failed: ${errorMsg}`);
|
|
76
|
-
span.failure({
|
|
77
|
-
statusCode: response.status,
|
|
78
|
-
errorKind: "http_error",
|
|
79
|
-
});
|
|
80
|
-
lastResult = {
|
|
81
|
-
ok: false,
|
|
82
|
-
status: response.status,
|
|
83
|
-
error: errorMsg,
|
|
84
|
-
retryCount: attempt,
|
|
85
|
-
};
|
|
86
|
-
if (!isTransientFailure(lastResult)) {
|
|
87
|
-
return lastResult;
|
|
88
|
-
}
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
span.success({
|
|
92
|
-
statusCode: response.status,
|
|
93
|
-
});
|
|
94
|
-
return {
|
|
95
|
-
ok: true,
|
|
96
|
-
status: response.status,
|
|
97
|
-
sid: data.sid,
|
|
98
|
-
retryCount: attempt,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
103
|
-
logger.error({
|
|
104
|
-
boundary: "lifeops",
|
|
105
|
-
integration: "twilio",
|
|
106
|
-
operation,
|
|
107
|
-
err: error instanceof Error ? error : undefined,
|
|
108
|
-
}, `[lifeops] Twilio request failed: ${errorMsg}`);
|
|
109
|
-
span.failure({
|
|
110
|
-
error,
|
|
111
|
-
errorKind: "network_error",
|
|
112
|
-
});
|
|
113
|
-
lastResult = {
|
|
114
|
-
ok: false,
|
|
115
|
-
status: null,
|
|
116
|
-
error: errorMsg,
|
|
117
|
-
retryCount: attempt,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// All attempts exhausted — return last failure.
|
|
122
|
-
// Safety: lastResult is always set after at least one loop iteration.
|
|
123
|
-
return lastResult;
|
|
124
|
-
}
|
|
125
|
-
export async function sendTwilioSms(args) {
|
|
126
|
-
const { credentials, to, body } = args;
|
|
127
|
-
return sendTwilioRequest({
|
|
128
|
-
credentials,
|
|
129
|
-
path: "/Messages.json",
|
|
130
|
-
payload: new URLSearchParams({
|
|
131
|
-
To: to,
|
|
132
|
-
From: credentials.fromPhoneNumber,
|
|
133
|
-
Body: body,
|
|
134
|
-
}),
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/** Escape special XML characters to prevent TwiML injection. */
|
|
138
|
-
function escapeXml(text) {
|
|
139
|
-
return text
|
|
140
|
-
.replace(/&/g, "&")
|
|
141
|
-
.replace(/</g, "<")
|
|
142
|
-
.replace(/>/g, ">")
|
|
143
|
-
.replace(/"/g, """)
|
|
144
|
-
.replace(/'/g, "'");
|
|
145
|
-
}
|
|
146
|
-
export async function sendTwilioVoiceCall(args) {
|
|
147
|
-
const { credentials, to, message } = args;
|
|
148
|
-
return sendTwilioRequest({
|
|
149
|
-
credentials,
|
|
150
|
-
path: "/Calls.json",
|
|
151
|
-
payload: new URLSearchParams({
|
|
152
|
-
To: to,
|
|
153
|
-
From: credentials.fromPhoneNumber,
|
|
154
|
-
Twiml: `<Response><Say>${escapeXml(message)}</Say></Response>`,
|
|
155
|
-
}),
|
|
156
|
-
});
|
|
157
|
-
}
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/twilio";
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
apiKey: string;
|
|
3
|
-
apiSecretKey: string;
|
|
4
|
-
accessToken: string;
|
|
5
|
-
accessTokenSecret: string;
|
|
6
|
-
}
|
|
7
|
-
export interface XPostResult {
|
|
8
|
-
ok: boolean;
|
|
9
|
-
status: number | null;
|
|
10
|
-
postId?: string;
|
|
11
|
-
error?: string;
|
|
12
|
-
category: "success" | "auth" | "rate_limit" | "network" | "unknown";
|
|
13
|
-
}
|
|
14
|
-
export declare function readXPosterCredentialsFromEnv(env?: NodeJS.ProcessEnv): XPosterCredentials | null;
|
|
15
|
-
export declare function postToX(args: {
|
|
16
|
-
text: string;
|
|
17
|
-
credentials: XPosterCredentials;
|
|
18
|
-
}): Promise<XPostResult>;
|
|
1
|
+
export * from "@elizaos/app-lifeops/lifeops/x-poster";
|
|
19
2
|
//# sourceMappingURL=x-poster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-poster.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/x-poster.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"x-poster.d.ts","sourceRoot":"","sources":["../../../../../src/lifeops/x-poster.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|