@elizaos/ui 2.0.0-alpha.382 → 2.0.0-alpha.385
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-companion/src/components/avatar/VrmViewer.d.ts.map +1 -1
- package/apps/app-companion/src/components/avatar/VrmViewer.js +2 -1
- package/apps/app-companion/src/components/companion/CompanionAppView.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/CompanionAppView.js +2 -1
- package/apps/app-companion/src/components/companion/CompanionView.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/CompanionView.js +2 -1
- package/apps/app-companion/src/components/companion/EmotePicker.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/EmotePicker.js +1 -1
- package/apps/app-companion/src/components/companion/scene-overlay-bridge.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/scene-overlay-bridge.js +2 -1
- package/apps/app-companion/src/index.d.ts +3 -3
- package/apps/app-companion/src/index.d.ts.map +1 -1
- package/apps/app-companion/src/index.js +3 -3
- package/apps/app-elizamaker/src/drop-service.d.ts +2 -2
- package/apps/app-elizamaker/src/drop-service.d.ts.map +1 -1
- package/apps/app-elizamaker/src/twitter-verify.d.ts +2 -2
- package/apps/app-elizamaker/src/twitter-verify.d.ts.map +1 -1
- package/apps/app-lifeops/src/api/client-lifeops.d.ts +1 -1
- package/apps/app-lifeops/src/api/client-lifeops.d.ts.map +1 -1
- package/apps/app-lifeops/src/contracts/index.d.ts +1 -1
- package/apps/app-lifeops/src/contracts/index.d.ts.map +1 -1
- package/apps/app-lifeops/src/contracts/index.js +1 -1
- package/apps/app-lifeops/src/inbox/message-fetcher.d.ts.map +1 -1
- package/apps/app-lifeops/src/inbox/message-fetcher.js +4 -2
- package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/google-managed-client.js +4 -3
- package/apps/app-lifeops/src/lifeops/paypal-managed-client.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/paypal-managed-client.js +4 -3
- package/apps/app-lifeops/src/lifeops/plaid-managed-client.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/plaid-managed-client.js +4 -3
- package/apps/app-lifeops/src/lifeops/repository.d.ts +12 -1
- package/apps/app-lifeops/src/lifeops/repository.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/repository.js +135 -0
- package/apps/app-lifeops/src/lifeops/schedule-sync-client.js +1 -1
- package/apps/app-lifeops/src/lifeops/schema.d.ts +4587 -3791
- package/apps/app-lifeops/src/lifeops/schema.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/schema.js +30 -0
- package/apps/app-lifeops/src/lifeops/service-mixin-inbox.d.ts +2 -0
- package/apps/app-lifeops/src/lifeops/service-mixin-inbox.d.ts.map +1 -1
- package/apps/app-lifeops/src/lifeops/service-mixin-inbox.js +103 -13
- package/apps/app-lifeops/src/routes/cloud-features-routes.d.ts.map +1 -1
- package/apps/app-lifeops/src/routes/cloud-features-routes.js +2 -1
- package/apps/app-lifeops/src/routes/travel-provider-relay-routes.d.ts.map +1 -1
- package/apps/app-lifeops/src/routes/travel-provider-relay-routes.js +2 -1
- package/package.json +1 -1
- package/packages/agent/src/actions/grounded-action-reply.d.ts.map +1 -1
- package/packages/agent/src/actions/grounded-action-reply.js +1 -1
- package/packages/agent/src/actions/index.d.ts +1 -0
- package/packages/agent/src/actions/index.d.ts.map +1 -1
- package/packages/agent/src/actions/index.js +1 -0
- package/packages/agent/src/actions/scratchpad.d.ts +7 -0
- package/packages/agent/src/actions/scratchpad.d.ts.map +1 -0
- package/packages/agent/src/actions/scratchpad.js +394 -0
- package/packages/agent/src/actions/settings-actions.js +1 -1
- package/packages/agent/src/actions/terminal.d.ts.map +1 -1
- package/packages/agent/src/actions/terminal.js +10 -2
- package/packages/agent/src/api/apps-routes.d.ts.map +1 -1
- package/packages/agent/src/api/apps-routes.js +171 -0
- package/packages/agent/src/api/binance-skill-helpers.d.ts.map +1 -1
- package/packages/agent/src/api/chat-routes.d.ts +3 -0
- package/packages/agent/src/api/chat-routes.d.ts.map +1 -1
- package/packages/agent/src/api/chat-routes.js +33 -14
- package/packages/agent/src/api/conversation-routes.js +2 -2
- package/packages/agent/src/api/misc-routes.d.ts.map +1 -1
- package/packages/agent/src/api/misc-routes.js +2 -2
- package/packages/agent/src/api/permissions-routes.js +1 -1
- package/packages/agent/src/api/plugin-routes.d.ts.map +1 -1
- package/packages/agent/src/api/plugin-routes.js +7 -1
- package/packages/agent/src/api/provider-switch-config.js +1 -1
- package/packages/agent/src/api/registry-service.d.ts +1 -1
- package/packages/agent/src/api/registry-service.d.ts.map +1 -1
- package/packages/agent/src/api/server-auth.d.ts.map +1 -1
- package/packages/agent/src/api/server-auth.js +119 -1
- package/packages/agent/src/api/server-helpers-auth.d.ts.map +1 -1
- package/packages/agent/src/api/server-helpers-auth.js +119 -1
- package/packages/agent/src/api/server-helpers-swarm.d.ts +1 -1
- package/packages/agent/src/api/server-helpers-swarm.d.ts.map +1 -1
- package/packages/agent/src/api/server-helpers.js +1 -1
- package/packages/agent/src/api/server-types.d.ts +2 -2
- package/packages/agent/src/api/server-types.d.ts.map +1 -1
- package/packages/agent/src/api/server.d.ts.map +1 -1
- package/packages/agent/src/api/server.js +5 -4
- package/packages/agent/src/api/training-backend-check.d.ts +1 -1
- package/packages/agent/src/api/training-backend-check.d.ts.map +1 -1
- package/packages/agent/src/api/training-backend-check.js +1 -1
- package/packages/agent/src/api/training-routes.d.ts +1 -1
- package/packages/agent/src/api/training-routes.d.ts.map +1 -1
- package/packages/agent/src/api/training-routes.js +1 -1
- package/packages/agent/src/api/training-service-like.d.ts +1 -1
- package/packages/agent/src/api/training-service-like.d.ts.map +1 -1
- package/packages/agent/src/api/trajectory-routes.d.ts +1 -1
- package/packages/agent/src/api/trajectory-routes.d.ts.map +1 -1
- package/packages/agent/src/api/trajectory-routes.js +1 -1
- package/packages/agent/src/api/wallet-capability.js +1 -1
- package/packages/agent/src/api/wallet-evm-balance.js +1 -1
- package/packages/agent/src/api/wallet.d.ts +1 -1
- package/packages/agent/src/api/wallet.d.ts.map +1 -1
- package/packages/agent/src/api/wallet.js +2 -2
- package/packages/agent/src/awareness/index.d.ts +2 -0
- package/packages/agent/src/awareness/index.d.ts.map +1 -0
- package/packages/agent/src/awareness/index.js +1 -0
- package/packages/agent/src/config/config.d.ts.map +1 -1
- package/packages/agent/src/config/config.js +2 -0
- package/packages/agent/src/config/index.d.ts +1 -0
- package/packages/agent/src/config/index.d.ts.map +1 -1
- package/packages/agent/src/config/index.js +1 -0
- package/packages/agent/src/config/model-metadata.d.ts +20 -0
- package/packages/agent/src/config/model-metadata.d.ts.map +1 -0
- package/packages/agent/src/config/model-metadata.js +133 -0
- package/packages/agent/src/config/zod-schema.core.d.ts +28 -28
- package/packages/agent/src/config/zod-schema.core.d.ts.map +1 -1
- package/packages/agent/src/config/zod-schema.core.js +16 -9
- package/packages/agent/src/config/zod-schema.d.ts +10 -10
- package/packages/agent/src/index.d.ts +6 -11
- package/packages/agent/src/index.d.ts.map +1 -1
- package/packages/agent/src/index.js +8 -10
- package/packages/agent/src/providers/media-provider.js +1 -1
- package/packages/agent/src/runtime/custom-actions.d.ts.map +1 -1
- package/packages/agent/src/runtime/custom-actions.js +1 -1
- package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -1
- package/packages/agent/src/runtime/eliza-plugin.js +6 -0
- package/packages/agent/src/runtime/eliza.d.ts.map +1 -1
- package/packages/agent/src/runtime/eliza.js +7 -7
- package/packages/agent/src/runtime/prompt-optimization.d.ts +24 -1
- package/packages/agent/src/runtime/prompt-optimization.d.ts.map +1 -1
- package/packages/agent/src/runtime/prompt-optimization.js +292 -27
- package/packages/agent/src/runtime/trajectory-internals.d.ts +1 -0
- package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -1
- package/packages/agent/src/runtime/trajectory-storage.d.ts.map +1 -1
- package/packages/agent/src/runtime/trajectory-storage.js +3 -0
- package/packages/agent/src/services/index.d.ts +4 -4
- package/packages/agent/src/services/index.d.ts.map +1 -1
- package/packages/agent/src/services/index.js +2 -2
- package/packages/agent/src/services/registry-client-app-meta.d.ts.map +1 -1
- package/packages/agent/src/services/registry-client-app-meta.js +0 -61
- package/packages/agent/src/services/skill-marketplace.d.ts.map +1 -1
- package/packages/app-core/src/App.js +1 -1
- package/packages/app-core/src/api/auth.js +1 -1
- package/packages/app-core/src/api/client-agent.d.ts +1 -2
- package/packages/app-core/src/api/client-agent.d.ts.map +1 -1
- package/packages/app-core/src/api/client-chat.d.ts +10 -1
- package/packages/app-core/src/api/client-chat.d.ts.map +1 -1
- package/packages/app-core/src/api/client-chat.js +33 -0
- package/packages/app-core/src/api/client-skills.d.ts.map +1 -1
- package/packages/app-core/src/api/client-types-chat.d.ts +1 -0
- package/packages/app-core/src/api/client-types-chat.d.ts.map +1 -1
- package/packages/app-core/src/api/client-types-config.d.ts +2 -2
- package/packages/app-core/src/api/client-types-config.d.ts.map +1 -1
- package/packages/app-core/src/api/client-wallet.d.ts +2 -4
- package/packages/app-core/src/api/client-wallet.d.ts.map +1 -1
- package/packages/app-core/src/api/client.d.ts +3 -4
- package/packages/app-core/src/api/client.d.ts.map +1 -1
- package/packages/app-core/src/api/client.js +1 -1
- package/packages/app-core/src/api/compat-route-shared.d.ts +1 -1
- package/packages/app-core/src/api/compat-route-shared.d.ts.map +1 -1
- package/packages/app-core/src/api/compat-route-shared.js +117 -1
- package/packages/app-core/src/api/server-cloud-tts.js +1 -1
- package/packages/app-core/src/api/trusted-local-request.d.ts +4 -0
- package/packages/app-core/src/api/trusted-local-request.d.ts.map +1 -0
- package/packages/app-core/src/api/trusted-local-request.js +176 -0
- package/packages/app-core/src/autonomy/index.d.ts.map +1 -1
- package/packages/app-core/src/autonomy/index.js +3 -1
- package/packages/app-core/src/components/auth/LoginView.d.ts +3 -23
- package/packages/app-core/src/components/auth/LoginView.d.ts.map +1 -1
- package/packages/app-core/src/components/auth/LoginView.js +43 -33
- package/packages/app-core/src/components/chat/AppsSection.d.ts.map +1 -1
- package/packages/app-core/src/components/chat/AppsSection.js +61 -6
- package/packages/app-core/src/components/chat/MessageContent.d.ts.map +1 -1
- package/packages/app-core/src/components/chat/MessageContent.js +26 -3
- package/packages/app-core/src/components/chat/message-choice-parser.d.ts +20 -0
- package/packages/app-core/src/components/chat/message-choice-parser.d.ts.map +1 -0
- package/packages/app-core/src/components/chat/message-choice-parser.js +53 -0
- package/packages/app-core/src/components/chat/widgets/ChoiceWidget.d.ts +24 -0
- package/packages/app-core/src/components/chat/widgets/ChoiceWidget.d.ts.map +1 -0
- package/packages/app-core/src/components/chat/widgets/ChoiceWidget.js +38 -0
- package/packages/app-core/src/components/connectors/ConnectorSetupPanel.js +1 -1
- package/packages/app-core/src/components/custom-actions/CustomActionEditor.d.ts.map +1 -1
- package/packages/app-core/src/components/custom-actions/CustomActionsPanel.d.ts.map +1 -1
- package/packages/app-core/src/components/custom-actions/CustomActionsView.d.ts.map +1 -1
- package/packages/app-core/src/components/custom-actions/custom-action-form.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/BrowserWorkspaceView.js +1 -1
- package/packages/app-core/src/components/pages/KnowledgeView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/KnowledgeView.js +11 -1
- package/packages/app-core/src/components/pages/PluginConfigForm.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/PluginConfigForm.js +1 -1
- package/packages/app-core/src/components/pages/ScratchpadView.d.ts +2 -0
- package/packages/app-core/src/components/pages/ScratchpadView.d.ts.map +1 -0
- package/packages/app-core/src/components/pages/ScratchpadView.js +364 -0
- package/packages/app-core/src/components/pages/SettingsView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/SettingsView.js +29 -5
- package/packages/app-core/src/components/pages/VectorBrowserView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/VectorBrowserView.js +1 -1
- package/packages/app-core/src/components/pages/config-page-sections.d.ts +1 -1
- package/packages/app-core/src/components/pages/config-page-sections.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/config-page-sections.js +1 -1
- package/packages/app-core/src/components/pages/plugin-list-utils.d.ts +1 -1
- package/packages/app-core/src/components/pages/plugin-list-utils.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/useBrowserWorkspaceWalletBridge.d.ts +1 -1
- package/packages/app-core/src/components/pages/useBrowserWorkspaceWalletBridge.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/useBrowserWorkspaceWalletBridge.js +1 -1
- package/packages/app-core/src/components/settings/ApiKeyConfig.js +1 -1
- package/packages/app-core/src/components/settings/AppearanceSettingsSection.d.ts.map +1 -1
- package/packages/app-core/src/components/settings/AppearanceSettingsSection.js +1 -1
- package/packages/app-core/src/components/settings/AppsManagementSection.d.ts +12 -0
- package/packages/app-core/src/components/settings/AppsManagementSection.d.ts.map +1 -0
- package/packages/app-core/src/components/settings/AppsManagementSection.js +285 -0
- package/packages/app-core/src/components/settings/PermissionsSection.js +1 -1
- package/packages/app-core/src/components/settings/ProviderSwitcher.d.ts.map +1 -1
- package/packages/app-core/src/components/settings/ProviderSwitcher.js +2 -2
- package/packages/app-core/src/components/settings/SecuritySettingsSection.d.ts.map +1 -1
- package/packages/app-core/src/components/settings/SecuritySettingsSection.js +150 -33
- package/packages/app-core/src/components/settings/cloud-model-schema.d.ts +1 -1
- package/packages/app-core/src/components/settings/cloud-model-schema.d.ts.map +1 -1
- package/packages/app-core/src/components/shell/Header.d.ts.map +1 -1
- package/packages/app-core/src/components/shell/Header.js +28 -1
- package/packages/app-core/src/components/steward/injected.d.ts.map +1 -1
- package/packages/app-core/src/components/steward/injected.js +1 -1
- package/packages/app-core/src/components/training/injected.d.ts.map +1 -1
- package/packages/app-core/src/components/training/injected.js +1 -1
- package/packages/app-core/src/config/boot-config-store.d.ts +1 -1
- package/packages/app-core/src/config/boot-config-store.d.ts.map +1 -1
- package/packages/app-core/src/content-packs/bundled-packs.d.ts.map +1 -1
- package/packages/app-core/src/hooks/index.d.ts +0 -2
- package/packages/app-core/src/hooks/index.d.ts.map +1 -1
- package/packages/app-core/src/hooks/index.js +0 -2
- package/packages/app-core/src/hooks/useAuthStatus.d.ts +5 -0
- package/packages/app-core/src/hooks/useAuthStatus.d.ts.map +1 -1
- package/packages/app-core/src/hooks/useAuthStatus.js +41 -18
- package/packages/app-core/src/hooks/useSignalPairing.d.ts +1 -1
- package/packages/app-core/src/hooks/useSignalPairing.d.ts.map +1 -1
- package/packages/app-core/src/hooks/useWhatsAppPairing.d.ts +1 -1
- package/packages/app-core/src/hooks/useWhatsAppPairing.d.ts.map +1 -1
- package/packages/app-core/src/i18n/locales/en.json +0 -1
- package/packages/app-core/src/i18n/locales/es.json +0 -1
- package/packages/app-core/src/i18n/locales/ko.json +0 -1
- package/packages/app-core/src/i18n/locales/pt.json +0 -1
- package/packages/app-core/src/i18n/locales/tl.json +0 -1
- package/packages/app-core/src/i18n/locales/vi.json +0 -1
- package/packages/app-core/src/i18n/locales/zh-CN.json +0 -1
- package/packages/app-core/src/index.d.ts +0 -1
- package/packages/app-core/src/index.d.ts.map +1 -1
- package/packages/app-core/src/index.js +0 -1
- package/packages/app-core/src/runtime/channel-plugin-map.d.ts.map +1 -1
- package/packages/app-core/src/runtime/channel-plugin-map.js +1 -1
- package/packages/app-core/src/runtime/plugin-manager-guard.d.ts.map +1 -1
- package/packages/app-core/src/runtime/plugin-manager-guard.js +1 -1
- package/packages/app-core/src/services/plugin-installer.d.ts.map +1 -1
- package/packages/app-core/src/services/plugin-installer.js +1 -8
- package/packages/app-core/src/state/index.d.ts +0 -1
- package/packages/app-core/src/state/index.d.ts.map +1 -1
- package/packages/app-core/src/state/index.js +0 -1
- package/packages/app-core/src/state/startup-phase-restore.d.ts.map +1 -1
- package/packages/app-core/src/state/startup-phase-restore.js +1 -1
- package/packages/app-core/src/state/useOnboardingState.js +2 -2
- package/packages/app-core/src/state/usePluginsSkillsState.d.ts +4 -4
- package/packages/app-core/src/types/index.d.ts +1 -1
- package/packages/app-core/src/types/index.d.ts.map +1 -1
- package/packages/shared/src/contracts/index.d.ts +1 -0
- package/packages/shared/src/contracts/index.d.ts.map +1 -1
- package/packages/shared/src/contracts/index.js +1 -0
- package/packages/shared/src/contracts/scratchpad.d.ts +136 -0
- package/packages/shared/src/contracts/scratchpad.d.ts.map +1 -0
- package/packages/shared/src/contracts/scratchpad.js +90 -0
- package/packages/shared/src/index.d.ts +13 -13
- package/packages/shared/src/index.d.ts.map +1 -1
- package/packages/shared/src/index.js +19 -19
- package/packages/shared/src/spoken-text.js +1 -1
- package/packages/typescript/src/features/advanced-capabilities/evaluators/factExtractor.d.ts.map +1 -1
- package/packages/typescript/src/features/advanced-capabilities/evaluators/factExtractor.js +12 -6
- package/packages/typescript/src/generated/action-docs.d.ts +25 -0
- package/packages/typescript/src/generated/action-docs.d.ts.map +1 -1
- package/packages/typescript/src/generated/action-docs.js +51 -0
- package/packages/typescript/src/services/message.d.ts.map +1 -1
- package/packages/typescript/src/services/message.js +1 -3
- package/packages/typescript/src/types/tools.d.ts.map +1 -1
- package/packages/typescript/src/types/tools.js +7 -3
- package/apps/app-lifeops/src/action.d.ts +0 -3
- package/apps/app-lifeops/src/action.d.ts.map +0 -1
- package/apps/app-lifeops/src/action.js +0 -351
- package/apps/app-lifeops/src/actions/activity-report.d.ts +0 -13
- package/apps/app-lifeops/src/actions/activity-report.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/activity-report.js +0 -313
- package/apps/app-lifeops/src/actions/app-blocker.d.ts +0 -7
- package/apps/app-lifeops/src/actions/app-blocker.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/app-blocker.js +0 -454
- package/apps/app-lifeops/src/actions/approval.d.ts +0 -21
- package/apps/app-lifeops/src/actions/approval.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/approval.js +0 -342
- package/apps/app-lifeops/src/actions/autofill.d.ts +0 -35
- package/apps/app-lifeops/src/actions/autofill.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/autofill.js +0 -475
- package/apps/app-lifeops/src/actions/book-travel-executor.d.ts +0 -9
- package/apps/app-lifeops/src/actions/book-travel-executor.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/book-travel-executor.js +0 -65
- package/apps/app-lifeops/src/actions/book-travel.d.ts +0 -5
- package/apps/app-lifeops/src/actions/book-travel.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/book-travel.js +0 -491
- package/apps/app-lifeops/src/actions/calendar.d.ts +0 -19
- package/apps/app-lifeops/src/actions/calendar.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/calendar.js +0 -3189
- package/apps/app-lifeops/src/actions/calendly.d.ts +0 -3
- package/apps/app-lifeops/src/actions/calendly.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/calendly.js +0 -285
- package/apps/app-lifeops/src/actions/chat-thread-control.d.ts +0 -3
- package/apps/app-lifeops/src/actions/chat-thread-control.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/chat-thread-control.js +0 -260
- package/apps/app-lifeops/src/actions/checkin.d.ts +0 -8
- package/apps/app-lifeops/src/actions/checkin.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/checkin.js +0 -230
- package/apps/app-lifeops/src/actions/computer-use.d.ts +0 -14
- package/apps/app-lifeops/src/actions/computer-use.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/computer-use.js +0 -365
- package/apps/app-lifeops/src/actions/cross-channel-send.d.ts +0 -34
- package/apps/app-lifeops/src/actions/cross-channel-send.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/cross-channel-send.js +0 -964
- package/apps/app-lifeops/src/actions/device-bus.d.ts +0 -19
- package/apps/app-lifeops/src/actions/device-bus.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/device-bus.js +0 -386
- package/apps/app-lifeops/src/actions/dossier.d.ts +0 -5
- package/apps/app-lifeops/src/actions/dossier.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/dossier.js +0 -227
- package/apps/app-lifeops/src/actions/email-unsubscribe.d.ts +0 -5
- package/apps/app-lifeops/src/actions/email-unsubscribe.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/email-unsubscribe.js +0 -172
- package/apps/app-lifeops/src/actions/gmail.d.ts +0 -57
- package/apps/app-lifeops/src/actions/gmail.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/gmail.js +0 -2540
- package/apps/app-lifeops/src/actions/health.d.ts +0 -9
- package/apps/app-lifeops/src/actions/health.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/health.js +0 -398
- package/apps/app-lifeops/src/actions/inbox.d.ts +0 -5
- package/apps/app-lifeops/src/actions/inbox.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/inbox.js +0 -1244
- package/apps/app-lifeops/src/actions/intent-sync.d.ts +0 -5
- package/apps/app-lifeops/src/actions/intent-sync.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/intent-sync.js +0 -326
- package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts +0 -69
- package/apps/app-lifeops/src/actions/life-goal-extractor.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life-goal-extractor.js +0 -420
- package/apps/app-lifeops/src/actions/life-param-extractor.d.ts +0 -78
- package/apps/app-lifeops/src/actions/life-param-extractor.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life-param-extractor.js +0 -431
- package/apps/app-lifeops/src/actions/life-recent-context.d.ts +0 -9
- package/apps/app-lifeops/src/actions/life-recent-context.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life-recent-context.js +0 -78
- package/apps/app-lifeops/src/actions/life-update-extractor.d.ts +0 -27
- package/apps/app-lifeops/src/actions/life-update-extractor.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life-update-extractor.js +0 -195
- package/apps/app-lifeops/src/actions/life.d.ts +0 -5
- package/apps/app-lifeops/src/actions/life.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life.extractor.d.ts +0 -18
- package/apps/app-lifeops/src/actions/life.extractor.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/life.extractor.js +0 -363
- package/apps/app-lifeops/src/actions/life.js +0 -3247
- package/apps/app-lifeops/src/actions/lifeops-connector.d.ts +0 -5
- package/apps/app-lifeops/src/actions/lifeops-connector.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/lifeops-connector.js +0 -683
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts +0 -16
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/lifeops-extraction-config.js +0 -25
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts +0 -64
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/lifeops-google-helpers.js +0 -671
- package/apps/app-lifeops/src/actions/lifeops-mutate.d.ts +0 -5
- package/apps/app-lifeops/src/actions/lifeops-mutate.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/lifeops-mutate.js +0 -769
- package/apps/app-lifeops/src/actions/list-remote-sessions.d.ts +0 -6
- package/apps/app-lifeops/src/actions/list-remote-sessions.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/list-remote-sessions.js +0 -45
- package/apps/app-lifeops/src/actions/non-actionable-request.d.ts +0 -17
- package/apps/app-lifeops/src/actions/non-actionable-request.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/non-actionable-request.js +0 -25
- package/apps/app-lifeops/src/actions/owner-app-block.d.ts +0 -12
- package/apps/app-lifeops/src/actions/owner-app-block.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-app-block.js +0 -144
- package/apps/app-lifeops/src/actions/owner-calendar.d.ts +0 -15
- package/apps/app-lifeops/src/actions/owner-calendar.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-calendar.js +0 -762
- package/apps/app-lifeops/src/actions/owner-inbox.d.ts +0 -5
- package/apps/app-lifeops/src/actions/owner-inbox.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-inbox.js +0 -662
- package/apps/app-lifeops/src/actions/owner-remote-desktop.d.ts +0 -12
- package/apps/app-lifeops/src/actions/owner-remote-desktop.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-remote-desktop.js +0 -173
- package/apps/app-lifeops/src/actions/owner-schedule.d.ts +0 -3
- package/apps/app-lifeops/src/actions/owner-schedule.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-schedule.js +0 -174
- package/apps/app-lifeops/src/actions/owner-screen-time.d.ts +0 -10
- package/apps/app-lifeops/src/actions/owner-screen-time.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-screen-time.js +0 -213
- package/apps/app-lifeops/src/actions/owner-website-block.d.ts +0 -12
- package/apps/app-lifeops/src/actions/owner-website-block.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/owner-website-block.js +0 -424
- package/apps/app-lifeops/src/actions/password-manager.d.ts +0 -5
- package/apps/app-lifeops/src/actions/password-manager.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/password-manager.js +0 -217
- package/apps/app-lifeops/src/actions/payments.d.ts +0 -5
- package/apps/app-lifeops/src/actions/payments.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/payments.js +0 -236
- package/apps/app-lifeops/src/actions/relationships.d.ts +0 -12
- package/apps/app-lifeops/src/actions/relationships.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/relationships.js +0 -880
- package/apps/app-lifeops/src/actions/remote-desktop.d.ts +0 -5
- package/apps/app-lifeops/src/actions/remote-desktop.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/remote-desktop.js +0 -248
- package/apps/app-lifeops/src/actions/revoke-remote-session.d.ts +0 -6
- package/apps/app-lifeops/src/actions/revoke-remote-session.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/revoke-remote-session.js +0 -73
- package/apps/app-lifeops/src/actions/schedule-x-dm-reply.d.ts +0 -3
- package/apps/app-lifeops/src/actions/schedule-x-dm-reply.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/schedule-x-dm-reply.js +0 -134
- package/apps/app-lifeops/src/actions/scheduled-trigger-task.d.ts +0 -19
- package/apps/app-lifeops/src/actions/scheduled-trigger-task.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/scheduled-trigger-task.js +0 -82
- package/apps/app-lifeops/src/actions/scheduling.d.ts +0 -70
- package/apps/app-lifeops/src/actions/scheduling.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/scheduling.js +0 -1078
- package/apps/app-lifeops/src/actions/screen-time.d.ts +0 -8
- package/apps/app-lifeops/src/actions/screen-time.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/screen-time.js +0 -249
- package/apps/app-lifeops/src/actions/search-across-channels.d.ts +0 -13
- package/apps/app-lifeops/src/actions/search-across-channels.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/search-across-channels.js +0 -338
- package/apps/app-lifeops/src/actions/start-remote-session.d.ts +0 -14
- package/apps/app-lifeops/src/actions/start-remote-session.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/start-remote-session.js +0 -139
- package/apps/app-lifeops/src/actions/subscriptions.d.ts +0 -5
- package/apps/app-lifeops/src/actions/subscriptions.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/subscriptions.js +0 -404
- package/apps/app-lifeops/src/actions/timezone-normalization.d.ts +0 -4
- package/apps/app-lifeops/src/actions/timezone-normalization.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/timezone-normalization.js +0 -159
- package/apps/app-lifeops/src/actions/twilio-call.d.ts +0 -20
- package/apps/app-lifeops/src/actions/twilio-call.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/twilio-call.js +0 -853
- package/apps/app-lifeops/src/actions/update-owner-profile.d.ts +0 -5
- package/apps/app-lifeops/src/actions/update-owner-profile.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/update-owner-profile.js +0 -181
- package/apps/app-lifeops/src/actions/x-read.d.ts +0 -5
- package/apps/app-lifeops/src/actions/x-read.d.ts.map +0 -1
- package/apps/app-lifeops/src/actions/x-read.js +0 -561
- package/apps/app-lifeops/src/activity-profile/activity-tracker-service.d.ts +0 -36
- package/apps/app-lifeops/src/activity-profile/activity-tracker-service.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/activity-tracker-service.js +0 -160
- package/apps/app-lifeops/src/activity-profile/analyzer.d.ts +0 -23
- package/apps/app-lifeops/src/activity-profile/analyzer.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/analyzer.js +0 -555
- package/apps/app-lifeops/src/activity-profile/presence-signal-bridge-service.d.ts +0 -14
- package/apps/app-lifeops/src/activity-profile/presence-signal-bridge-service.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/presence-signal-bridge-service.js +0 -133
- package/apps/app-lifeops/src/activity-profile/proactive-planner.d.ts +0 -71
- package/apps/app-lifeops/src/activity-profile/proactive-planner.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/proactive-planner.js +0 -567
- package/apps/app-lifeops/src/activity-profile/proactive-worker.d.ts +0 -32
- package/apps/app-lifeops/src/activity-profile/proactive-worker.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/proactive-worker.js +0 -676
- package/apps/app-lifeops/src/activity-profile/service.d.ts +0 -11
- package/apps/app-lifeops/src/activity-profile/service.d.ts.map +0 -1
- package/apps/app-lifeops/src/activity-profile/service.js +0 -246
- package/apps/app-lifeops/src/app-blocker/access.d.ts +0 -8
- package/apps/app-lifeops/src/app-blocker/access.d.ts.map +0 -1
- package/apps/app-lifeops/src/app-blocker/access.js +0 -35
- package/apps/app-lifeops/src/app-blocker/engine.d.ts +0 -10
- package/apps/app-lifeops/src/app-blocker/engine.d.ts.map +0 -1
- package/apps/app-lifeops/src/app-blocker/engine.js +0 -43
- package/apps/app-lifeops/src/components/AppBlockerSettingsCard.d.ts +0 -3
- package/apps/app-lifeops/src/components/AppBlockerSettingsCard.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/AppBlockerSettingsCard.js +0 -189
- package/apps/app-lifeops/src/components/BrowserBridgeSetupPanel.d.ts +0 -2
- package/apps/app-lifeops/src/components/BrowserBridgeSetupPanel.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/BrowserBridgeSetupPanel.js +0 -1065
- package/apps/app-lifeops/src/components/BrowserBridgeStatusChip.d.ts +0 -7
- package/apps/app-lifeops/src/components/BrowserBridgeStatusChip.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/BrowserBridgeStatusChip.js +0 -74
- package/apps/app-lifeops/src/components/DataSourcesStrip.d.ts +0 -14
- package/apps/app-lifeops/src/components/DataSourcesStrip.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/DataSourcesStrip.js +0 -36
- package/apps/app-lifeops/src/components/EventEditorDrawer.d.ts +0 -23
- package/apps/app-lifeops/src/components/EventEditorDrawer.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/EventEditorDrawer.js +0 -514
- package/apps/app-lifeops/src/components/LifeOpsActivitySignalsEffect.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsActivitySignalsEffect.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsActivitySignalsEffect.js +0 -10
- package/apps/app-lifeops/src/components/LifeOpsCalendarSection.d.ts +0 -15
- package/apps/app-lifeops/src/components/LifeOpsCalendarSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsCalendarSection.js +0 -515
- package/apps/app-lifeops/src/components/LifeOpsChatAdapter.d.ts +0 -34
- package/apps/app-lifeops/src/components/LifeOpsChatAdapter.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsChatAdapter.js +0 -175
- package/apps/app-lifeops/src/components/LifeOpsFeatureTogglesSection.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsFeatureTogglesSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsFeatureTogglesSection.js +0 -99
- package/apps/app-lifeops/src/components/LifeOpsHabitVisuals.d.ts +0 -37
- package/apps/app-lifeops/src/components/LifeOpsHabitVisuals.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsHabitVisuals.js +0 -88
- package/apps/app-lifeops/src/components/LifeOpsInboxSection.d.ts +0 -13
- package/apps/app-lifeops/src/components/LifeOpsInboxSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsInboxSection.js +0 -490
- package/apps/app-lifeops/src/components/LifeOpsLinkBankButton.d.ts +0 -12
- package/apps/app-lifeops/src/components/LifeOpsLinkBankButton.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsLinkBankButton.js +0 -92
- package/apps/app-lifeops/src/components/LifeOpsLinkPaypalButton.d.ts +0 -12
- package/apps/app-lifeops/src/components/LifeOpsLinkPaypalButton.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsLinkPaypalButton.js +0 -160
- package/apps/app-lifeops/src/components/LifeOpsMoneySection.d.ts +0 -3
- package/apps/app-lifeops/src/components/LifeOpsMoneySection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsMoneySection.js +0 -373
- package/apps/app-lifeops/src/components/LifeOpsNavRail.d.ts +0 -9
- package/apps/app-lifeops/src/components/LifeOpsNavRail.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsNavRail.js +0 -93
- package/apps/app-lifeops/src/components/LifeOpsOperationalPanels.d.ts +0 -4
- package/apps/app-lifeops/src/components/LifeOpsOperationalPanels.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsOperationalPanels.js +0 -274
- package/apps/app-lifeops/src/components/LifeOpsOverviewSection.d.ts +0 -7
- package/apps/app-lifeops/src/components/LifeOpsOverviewSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsOverviewSection.js +0 -670
- package/apps/app-lifeops/src/components/LifeOpsPageSections.d.ts +0 -42
- package/apps/app-lifeops/src/components/LifeOpsPageSections.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsPageSections.js +0 -166
- package/apps/app-lifeops/src/components/LifeOpsPageView.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsPageView.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsPageView.js +0 -565
- package/apps/app-lifeops/src/components/LifeOpsRemindersSection.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsRemindersSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsRemindersSection.js +0 -749
- package/apps/app-lifeops/src/components/LifeOpsResizableSidebar.d.ts +0 -27
- package/apps/app-lifeops/src/components/LifeOpsResizableSidebar.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsResizableSidebar.js +0 -106
- package/apps/app-lifeops/src/components/LifeOpsScreenTimeSection.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsScreenTimeSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsScreenTimeSection.js +0 -373
- package/apps/app-lifeops/src/components/LifeOpsSectionContent.d.ts +0 -10
- package/apps/app-lifeops/src/components/LifeOpsSectionContent.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsSectionContent.js +0 -30
- package/apps/app-lifeops/src/components/LifeOpsSelectionContext.d.ts +0 -21
- package/apps/app-lifeops/src/components/LifeOpsSelectionContext.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsSelectionContext.js +0 -30
- package/apps/app-lifeops/src/components/LifeOpsSettingsSection.d.ts +0 -20
- package/apps/app-lifeops/src/components/LifeOpsSettingsSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsSettingsSection.js +0 -597
- package/apps/app-lifeops/src/components/LifeOpsSetupGate.d.ts +0 -13
- package/apps/app-lifeops/src/components/LifeOpsSetupGate.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsSetupGate.js +0 -134
- package/apps/app-lifeops/src/components/LifeOpsSleepSection.d.ts +0 -10
- package/apps/app-lifeops/src/components/LifeOpsSleepSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsSleepSection.js +0 -425
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceShell.d.ts +0 -11
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceShell.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceShell.js +0 -49
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceView.d.ts +0 -2
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceView.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/LifeOpsWorkspaceView.js +0 -1041
- package/apps/app-lifeops/src/components/MessagingConnectorCards.d.ts +0 -7
- package/apps/app-lifeops/src/components/MessagingConnectorCards.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/MessagingConnectorCards.js +0 -643
- package/apps/app-lifeops/src/components/MissingSourceCard.d.ts +0 -9
- package/apps/app-lifeops/src/components/MissingSourceCard.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/MissingSourceCard.js +0 -5
- package/apps/app-lifeops/src/components/MobileSignalsSetupCard.d.ts +0 -2
- package/apps/app-lifeops/src/components/MobileSignalsSetupCard.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/MobileSignalsSetupCard.js +0 -162
- package/apps/app-lifeops/src/components/SleepInspectionPanel.d.ts +0 -8
- package/apps/app-lifeops/src/components/SleepInspectionPanel.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/SleepInspectionPanel.js +0 -59
- package/apps/app-lifeops/src/components/WebsiteBlockerSettingsCard.d.ts +0 -3
- package/apps/app-lifeops/src/components/WebsiteBlockerSettingsCard.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/WebsiteBlockerSettingsCard.js +0 -75
- package/apps/app-lifeops/src/components/WhatsAppQrOverlay.d.ts +0 -8
- package/apps/app-lifeops/src/components/WhatsAppQrOverlay.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/WhatsAppQrOverlay.js +0 -48
- package/apps/app-lifeops/src/components/lifeops-labels.d.ts +0 -2
- package/apps/app-lifeops/src/components/lifeops-labels.d.ts.map +0 -1
- package/apps/app-lifeops/src/components/lifeops-labels.js +0 -5
- package/apps/app-lifeops/src/events/index.d.ts +0 -34
- package/apps/app-lifeops/src/events/index.d.ts.map +0 -1
- package/apps/app-lifeops/src/events/index.js +0 -23
- package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.d.ts +0 -3
- package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.d.ts.map +0 -1
- package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.js +0 -48
- package/apps/app-lifeops/src/followup/actions/markFollowupDone.d.ts +0 -3
- package/apps/app-lifeops/src/followup/actions/markFollowupDone.d.ts.map +0 -1
- package/apps/app-lifeops/src/followup/actions/markFollowupDone.js +0 -173
- package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.d.ts +0 -3
- package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.d.ts.map +0 -1
- package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.js +0 -172
- package/apps/app-lifeops/src/followup/followup-tracker.d.ts +0 -82
- package/apps/app-lifeops/src/followup/followup-tracker.d.ts.map +0 -1
- package/apps/app-lifeops/src/followup/followup-tracker.js +0 -279
- package/apps/app-lifeops/src/followup/index.d.ts +0 -5
- package/apps/app-lifeops/src/followup/index.d.ts.map +0 -1
- package/apps/app-lifeops/src/followup/index.js +0 -4
- package/apps/app-lifeops/src/hooks/useCalendarWeek.d.ts +0 -28
- package/apps/app-lifeops/src/hooks/useCalendarWeek.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useCalendarWeek.js +0 -93
- package/apps/app-lifeops/src/hooks/useDiscordConnector.d.ts +0 -14
- package/apps/app-lifeops/src/hooks/useDiscordConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useDiscordConnector.js +0 -126
- package/apps/app-lifeops/src/hooks/useGoogleLifeOpsConnector.d.ts +0 -29
- package/apps/app-lifeops/src/hooks/useGoogleLifeOpsConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useGoogleLifeOpsConnector.js +0 -481
- package/apps/app-lifeops/src/hooks/useIMessageConnector.d.ts +0 -10
- package/apps/app-lifeops/src/hooks/useIMessageConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useIMessageConnector.js +0 -50
- package/apps/app-lifeops/src/hooks/useInbox.d.ts +0 -34
- package/apps/app-lifeops/src/hooks/useInbox.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useInbox.js +0 -98
- package/apps/app-lifeops/src/hooks/useLifeOpsActivitySignals.d.ts +0 -2
- package/apps/app-lifeops/src/hooks/useLifeOpsActivitySignals.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsActivitySignals.js +0 -382
- package/apps/app-lifeops/src/hooks/useLifeOpsAppState.d.ts +0 -21
- package/apps/app-lifeops/src/hooks/useLifeOpsAppState.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsAppState.js +0 -83
- package/apps/app-lifeops/src/hooks/useLifeOpsCapabilitiesStatus.d.ts +0 -8
- package/apps/app-lifeops/src/hooks/useLifeOpsCapabilitiesStatus.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsCapabilitiesStatus.js +0 -60
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleInspection.d.ts +0 -18
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleInspection.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleInspection.js +0 -66
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleState.d.ts +0 -14
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleState.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsScheduleState.js +0 -79
- package/apps/app-lifeops/src/hooks/useLifeOpsSection.d.ts +0 -18
- package/apps/app-lifeops/src/hooks/useLifeOpsSection.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsSection.js +0 -78
- package/apps/app-lifeops/src/hooks/useLifeOpsXConnector.d.ts +0 -14
- package/apps/app-lifeops/src/hooks/useLifeOpsXConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useLifeOpsXConnector.js +0 -160
- package/apps/app-lifeops/src/hooks/useSignalConnector.d.ts +0 -16
- package/apps/app-lifeops/src/hooks/useSignalConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useSignalConnector.js +0 -198
- package/apps/app-lifeops/src/hooks/useTelegramConnector.d.ts +0 -21
- package/apps/app-lifeops/src/hooks/useTelegramConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useTelegramConnector.js +0 -177
- package/apps/app-lifeops/src/hooks/useWhatsAppConnector.d.ts +0 -8
- package/apps/app-lifeops/src/hooks/useWhatsAppConnector.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useWhatsAppConnector.js +0 -58
- package/apps/app-lifeops/src/hooks/useWhatsAppPairing.d.ts +0 -12
- package/apps/app-lifeops/src/hooks/useWhatsAppPairing.d.ts.map +0 -1
- package/apps/app-lifeops/src/hooks/useWhatsAppPairing.js +0 -152
- package/apps/app-lifeops/src/inbox/config.d.ts +0 -7
- package/apps/app-lifeops/src/inbox/config.d.ts.map +0 -1
- package/apps/app-lifeops/src/inbox/config.js +0 -67
- package/apps/app-lifeops/src/inbox/reflection.d.ts +0 -40
- package/apps/app-lifeops/src/inbox/reflection.d.ts.map +0 -1
- package/apps/app-lifeops/src/inbox/reflection.js +0 -115
- package/apps/app-lifeops/src/inbox/repository.d.ts +0 -52
- package/apps/app-lifeops/src/inbox/repository.d.ts.map +0 -1
- package/apps/app-lifeops/src/inbox/repository.js +0 -262
- package/apps/app-lifeops/src/inbox/triage-classifier.d.ts +0 -15
- package/apps/app-lifeops/src/inbox/triage-classifier.d.ts.map +0 -1
- package/apps/app-lifeops/src/inbox/triage-classifier.js +0 -179
- package/apps/app-lifeops/src/index.d.ts +0 -20
- package/apps/app-lifeops/src/index.d.ts.map +0 -1
- package/apps/app-lifeops/src/index.js +0 -18
- package/apps/app-lifeops/src/lifeops/approval-queue.d.ts +0 -24
- package/apps/app-lifeops/src/lifeops/approval-queue.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/approval-queue.js +0 -500
- package/apps/app-lifeops/src/lifeops/approval-queue.types.d.ts +0 -166
- package/apps/app-lifeops/src/lifeops/approval-queue.types.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/approval-queue.types.js +0 -22
- package/apps/app-lifeops/src/lifeops/autofill-whitelist.d.ts +0 -15
- package/apps/app-lifeops/src/lifeops/autofill-whitelist.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/autofill-whitelist.js +0 -116
- package/apps/app-lifeops/src/lifeops/background-planner-dispatch.d.ts +0 -60
- package/apps/app-lifeops/src/lifeops/background-planner-dispatch.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/background-planner-dispatch.js +0 -134
- package/apps/app-lifeops/src/lifeops/background-planner.d.ts +0 -141
- package/apps/app-lifeops/src/lifeops/background-planner.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/background-planner.js +0 -377
- package/apps/app-lifeops/src/lifeops/calendly-client.d.ts +0 -61
- package/apps/app-lifeops/src/lifeops/calendly-client.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/calendly-client.js +0 -234
- package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.d.ts +0 -14
- package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.js +0 -27
- package/apps/app-lifeops/src/lifeops/cross-channel-search.d.ts +0 -88
- package/apps/app-lifeops/src/lifeops/cross-channel-search.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/cross-channel-search.js +0 -446
- package/apps/app-lifeops/src/lifeops/intent-sync.d.ts +0 -59
- package/apps/app-lifeops/src/lifeops/intent-sync.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/intent-sync.js +0 -305
- package/apps/app-lifeops/src/lifeops/notifications-push.d.ts +0 -37
- package/apps/app-lifeops/src/lifeops/notifications-push.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/notifications-push.js +0 -92
- package/apps/app-lifeops/src/lifeops/password-manager-bridge.d.ts +0 -50
- package/apps/app-lifeops/src/lifeops/password-manager-bridge.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/password-manager-bridge.js +0 -448
- package/apps/app-lifeops/src/lifeops/remote-desktop.d.ts +0 -38
- package/apps/app-lifeops/src/lifeops/remote-desktop.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/remote-desktop.js +0 -372
- package/apps/app-lifeops/src/lifeops/runtime.d.ts +0 -11
- package/apps/app-lifeops/src/lifeops/runtime.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/runtime.js +0 -57
- package/apps/app-lifeops/src/lifeops/screen-context.d.ts +0 -52
- package/apps/app-lifeops/src/lifeops/screen-context.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops/screen-context.js +0 -349
- package/apps/app-lifeops/src/lifeops-route.d.ts +0 -74
- package/apps/app-lifeops/src/lifeops-route.d.ts.map +0 -1
- package/apps/app-lifeops/src/lifeops-route.js +0 -204
- package/apps/app-lifeops/src/platform/index.d.ts +0 -2
- package/apps/app-lifeops/src/platform/index.d.ts.map +0 -1
- package/apps/app-lifeops/src/platform/index.js +0 -1
- package/apps/app-lifeops/src/platform/lifeops-github.d.ts +0 -15
- package/apps/app-lifeops/src/platform/lifeops-github.d.ts.map +0 -1
- package/apps/app-lifeops/src/platform/lifeops-github.js +0 -135
- package/apps/app-lifeops/src/plugin.d.ts +0 -33
- package/apps/app-lifeops/src/plugin.d.ts.map +0 -1
- package/apps/app-lifeops/src/plugin.js +0 -316
- package/apps/app-lifeops/src/provider.d.ts +0 -4
- package/apps/app-lifeops/src/provider.d.ts.map +0 -1
- package/apps/app-lifeops/src/provider.js +0 -77
- package/apps/app-lifeops/src/providers/activity-profile.d.ts +0 -3
- package/apps/app-lifeops/src/providers/activity-profile.d.ts.map +0 -1
- package/apps/app-lifeops/src/providers/activity-profile.js +0 -140
- package/apps/app-lifeops/src/providers/app-blocker.d.ts +0 -3
- package/apps/app-lifeops/src/providers/app-blocker.d.ts.map +0 -1
- package/apps/app-lifeops/src/providers/app-blocker.js +0 -86
- package/apps/app-lifeops/src/providers/cross-channel-context.d.ts +0 -29
- package/apps/app-lifeops/src/providers/cross-channel-context.d.ts.map +0 -1
- package/apps/app-lifeops/src/providers/cross-channel-context.js +0 -182
- package/apps/app-lifeops/src/providers/inbox-triage.d.ts +0 -3
- package/apps/app-lifeops/src/providers/inbox-triage.d.ts.map +0 -1
- package/apps/app-lifeops/src/providers/inbox-triage.js +0 -90
- package/apps/app-lifeops/src/providers/lifeops.d.ts +0 -3
- package/apps/app-lifeops/src/providers/lifeops.d.ts.map +0 -1
- package/apps/app-lifeops/src/providers/lifeops.js +0 -197
- package/apps/app-lifeops/src/remote/pairing-code.d.ts +0 -39
- package/apps/app-lifeops/src/remote/pairing-code.d.ts.map +0 -1
- package/apps/app-lifeops/src/remote/pairing-code.js +0 -76
- package/apps/app-lifeops/src/remote/remote-session-service.d.ts +0 -107
- package/apps/app-lifeops/src/remote/remote-session-service.d.ts.map +0 -1
- package/apps/app-lifeops/src/remote/remote-session-service.js +0 -253
- package/apps/app-lifeops/src/service.d.ts +0 -32
- package/apps/app-lifeops/src/service.d.ts.map +0 -1
- package/apps/app-lifeops/src/service.js +0 -67
- package/apps/app-lifeops/src/travel-time/calendar-create.d.ts +0 -17
- package/apps/app-lifeops/src/travel-time/calendar-create.d.ts.map +0 -1
- package/apps/app-lifeops/src/travel-time/calendar-create.js +0 -21
- package/apps/app-lifeops/src/travel-time/service.d.ts +0 -60
- package/apps/app-lifeops/src/travel-time/service.d.ts.map +0 -1
- package/apps/app-lifeops/src/travel-time/service.js +0 -142
- package/apps/app-lifeops/src/utils/lifeops-url.d.ts +0 -5
- package/apps/app-lifeops/src/utils/lifeops-url.d.ts.map +0 -1
- package/apps/app-lifeops/src/utils/lifeops-url.js +0 -35
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.d.ts +0 -3
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.js +0 -246
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.d.ts +0 -3
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.js +0 -83
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.d.ts +0 -3
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.js +0 -98
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.d.ts +0 -7
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.js +0 -111
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.d.ts +0 -39
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.js +0 -123
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.d.ts +0 -21
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.js +0 -258
- package/apps/app-lifeops/src/website-blocker/chat-integration/index.d.ts +0 -8
- package/apps/app-lifeops/src/website-blocker/chat-integration/index.d.ts.map +0 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/index.js +0 -6
- package/packages/app-core/src/api/client-lifeops.d.ts +0 -35
- package/packages/app-core/src/api/client-lifeops.d.ts.map +0 -1
- package/packages/app-core/src/api/client-lifeops.js +0 -114
- package/packages/app-core/src/hooks/useGoogleLifeOpsConnector.d.ts +0 -20
- package/packages/app-core/src/hooks/useGoogleLifeOpsConnector.d.ts.map +0 -1
- package/packages/app-core/src/hooks/useGoogleLifeOpsConnector.js +0 -69
- package/packages/app-core/src/hooks/useLifeOpsAppState.d.ts +0 -21
- package/packages/app-core/src/hooks/useLifeOpsAppState.d.ts.map +0 -1
- package/packages/app-core/src/hooks/useLifeOpsAppState.js +0 -81
- package/packages/app-core/src/services/steward-sidecar.d.ts +0 -6
- package/packages/app-core/src/services/steward-sidecar.d.ts.map +0 -1
- package/packages/app-core/src/services/steward-sidecar.js +0 -5
|
@@ -1,1244 +0,0 @@
|
|
|
1
|
-
import { hasAdminAccess, resolveAdminEntityId, } from "@elizaos/agent";
|
|
2
|
-
import { logger, ModelType, parseJSONObjectFromText } from "@elizaos/core";
|
|
3
|
-
import { getRecentMessagesData } from "@elizaos/shared";
|
|
4
|
-
import { loadInboxTriageConfig } from "../inbox/config.js";
|
|
5
|
-
import { fetchAllMessages } from "../inbox/message-fetcher.js";
|
|
6
|
-
import { reflectOnAutoReply, reflectOnSendConfirmation, } from "../inbox/reflection.js";
|
|
7
|
-
import { InboxTriageRepository } from "../inbox/repository.js";
|
|
8
|
-
import { classifyMessages } from "../inbox/triage-classifier.js";
|
|
9
|
-
import { createApprovalQueue } from "../lifeops/approval-queue.js";
|
|
10
|
-
import { LifeOpsService } from "../lifeops/service.js";
|
|
11
|
-
import { executeApprovedRequest } from "./approval.js";
|
|
12
|
-
import { INTERNAL_URL } from "./lifeops-google-helpers.js";
|
|
13
|
-
function inboxRecentConversation(state, limit = 10) {
|
|
14
|
-
const texts = [];
|
|
15
|
-
for (const item of getRecentMessagesData(state)) {
|
|
16
|
-
const content = item.content && typeof item.content === "object"
|
|
17
|
-
? item.content
|
|
18
|
-
: null;
|
|
19
|
-
const text = typeof content?.text === "string" ? content.text.trim() : "";
|
|
20
|
-
if (text) {
|
|
21
|
-
texts.push(text);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return texts.slice(-limit);
|
|
25
|
-
}
|
|
26
|
-
function stringifyInboxDraftContext(draft) {
|
|
27
|
-
if (!draft) {
|
|
28
|
-
return "null";
|
|
29
|
-
}
|
|
30
|
-
return JSON.stringify({
|
|
31
|
-
senderName: draft.senderName,
|
|
32
|
-
channelName: draft.channelName,
|
|
33
|
-
source: draft.source,
|
|
34
|
-
draftText: draft.draftText,
|
|
35
|
-
deepLink: draft.deepLink,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function buildInboxPolicyAcknowledgement(userText) {
|
|
39
|
-
const normalized = userText.trim().toLowerCase();
|
|
40
|
-
if (!normalized) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
if (/\bgroup chat\b/u.test(normalized) &&
|
|
44
|
-
/\bhandoff\b/u.test(normalized) &&
|
|
45
|
-
/\b(?:relay|relaying|relays|coordination|messy|tangled)\b/u.test(normalized)) {
|
|
46
|
-
return {
|
|
47
|
-
text: "If the relay gets messy, I'll suggest a group-chat handoff with you and the other people involved so we can stop bouncing messages through you.",
|
|
48
|
-
success: true,
|
|
49
|
-
values: {
|
|
50
|
-
success: true,
|
|
51
|
-
policyRecorded: true,
|
|
52
|
-
},
|
|
53
|
-
data: {
|
|
54
|
-
actionName: ACTION_NAME,
|
|
55
|
-
subaction: "respond",
|
|
56
|
-
policyRecorded: true,
|
|
57
|
-
policyType: "group_chat_handoff",
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
if (/\bbump\b/u.test(normalized) &&
|
|
62
|
-
/\bcontext\b/u.test(normalized) &&
|
|
63
|
-
/\bstart(?:ing)? over\b/u.test(normalized)) {
|
|
64
|
-
return {
|
|
65
|
-
text: "If that thread is still unresolved, I'll bump you again with the existing context attached instead of restarting the explanation from zero.",
|
|
66
|
-
success: true,
|
|
67
|
-
values: {
|
|
68
|
-
success: true,
|
|
69
|
-
policyRecorded: true,
|
|
70
|
-
},
|
|
71
|
-
data: {
|
|
72
|
-
actionName: ACTION_NAME,
|
|
73
|
-
subaction: "respond",
|
|
74
|
-
policyRecorded: true,
|
|
75
|
-
policyType: "contextual_bump",
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
async function resolveSubactionPlan(runtime, params, messageText, state) {
|
|
82
|
-
const hasExplicitExecutionTarget = params.entryId !== undefined ||
|
|
83
|
-
params.target !== undefined ||
|
|
84
|
-
params.messageText !== undefined ||
|
|
85
|
-
params.confirmed !== undefined;
|
|
86
|
-
if (params.subaction && hasExplicitExecutionTarget) {
|
|
87
|
-
return {
|
|
88
|
-
subaction: params.subaction,
|
|
89
|
-
shouldAct: true,
|
|
90
|
-
target: params.target ?? null,
|
|
91
|
-
entryId: params.entryId ?? null,
|
|
92
|
-
confirmed: params.confirmed ?? null,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
if (params.confirmed ||
|
|
96
|
-
params.entryId ||
|
|
97
|
-
params.target ||
|
|
98
|
-
params.messageText) {
|
|
99
|
-
return {
|
|
100
|
-
subaction: "respond",
|
|
101
|
-
shouldAct: true,
|
|
102
|
-
target: params.target ?? null,
|
|
103
|
-
entryId: params.entryId ?? null,
|
|
104
|
-
confirmed: params.confirmed ?? null,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (typeof runtime.useModel !== "function") {
|
|
108
|
-
return {
|
|
109
|
-
subaction: null,
|
|
110
|
-
shouldAct: false,
|
|
111
|
-
response: "Inbox action planning is unavailable right now. Tell me explicitly whether to triage, show a digest, or respond.",
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const intent = params.intent ?? messageText;
|
|
115
|
-
const pendingDraft = latestPendingDraft(state);
|
|
116
|
-
const prompt = [
|
|
117
|
-
"Plan the INBOX action for this request.",
|
|
118
|
-
"The user may speak in any language.",
|
|
119
|
-
"Use the current request plus recent conversation context.",
|
|
120
|
-
"Return ONLY valid JSON with exactly these fields:",
|
|
121
|
-
'{"subaction":"triage"|"digest"|"respond"|null,"shouldAct":true|false,"response":"string|null","target":"string|null","entryId":"string|null","confirmed":true|false|null}',
|
|
122
|
-
"",
|
|
123
|
-
"Choose triage for requests to scan new messages, unread items, or the current inbox.",
|
|
124
|
-
"Choose digest for requests to summarize, brief, recap, review inbox activity, give a daily brief, rank urgent-vs-low items, surface drafts awaiting sign-off, or add a standing requirement to a recurring daily brief.",
|
|
125
|
-
"Choose respond for requests to reply, draft, edit, approve, confirm, send a reply to a message or person, repair a missed call by drafting follow-up, or set up a group-chat handoff.",
|
|
126
|
-
"Standing inbox policies like 'if relaying gets messy, suggest a group chat handoff' or 'if I miss a call, repair that and reschedule' should still choose an inbox subaction instead of shouldAct=false.",
|
|
127
|
-
"If a pending draft exists and the current request clearly refers to sending, revising, or confirming it, choose respond even if the user does not restate the recipient.",
|
|
128
|
-
"Set confirmed=true only when the user clearly approves sending the current pending draft right now.",
|
|
129
|
-
"Set confirmed=false when the user is editing, hesitating, declining, or asking for more changes to the current draft.",
|
|
130
|
-
"Set confirmed=null when there is no pending draft approval decision in the request.",
|
|
131
|
-
"Set shouldAct=false only when the request is too vague to choose triage, digest, or respond safely.",
|
|
132
|
-
"When shouldAct=false, response must ask the minimum clarifying question in the user's language.",
|
|
133
|
-
"For standing inbox policies that should be acknowledged now without triaging a live item, set shouldAct=true, choose the right subaction, and put the user-facing acknowledgement in response.",
|
|
134
|
-
"Extract target when the user identifies a person, channel, or inbox item to respond to.",
|
|
135
|
-
'Example: {"currentRequest":"If direct relaying gets messy here, suggest making a group chat handoff instead.","subaction":"respond","shouldAct":true,"response":"If the relay gets messy, I will suggest moving everyone into a group-chat handoff instead of continuing one-off relays.","target":null,"entryId":null,"confirmed":null}',
|
|
136
|
-
'Example: {"currentRequest":"I missed a call with the Frontier Tower guys today. Need to repair that and reschedule if possible asap.","subaction":"respond","shouldAct":true,"response":null,"target":"Frontier Tower guys","entryId":null,"confirmed":null}',
|
|
137
|
-
"",
|
|
138
|
-
`Planner hint subaction (non-binding): ${JSON.stringify(params.subaction ?? null)}`,
|
|
139
|
-
`Current request: ${JSON.stringify(intent)}`,
|
|
140
|
-
`Pending draft: ${stringifyInboxDraftContext(pendingDraft)}`,
|
|
141
|
-
`Recent conversation: ${JSON.stringify(inboxRecentConversation(state).join("\n"))}`,
|
|
142
|
-
].join("\n");
|
|
143
|
-
try {
|
|
144
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: runtime.useModel is an elizaOS model API, not a React hook.
|
|
145
|
-
const result = await runtime.useModel(ModelType.TEXT_SMALL, { prompt });
|
|
146
|
-
const raw = typeof result === "string" ? result : "";
|
|
147
|
-
const parsed = parseJSONObjectFromText(raw);
|
|
148
|
-
if (!parsed) {
|
|
149
|
-
return {
|
|
150
|
-
subaction: null,
|
|
151
|
-
shouldAct: false,
|
|
152
|
-
response: "I couldn't determine whether you want triage, a digest, or a response. Tell me which inbox action you want.",
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
const subaction = typeof parsed.subaction === "string" &&
|
|
156
|
-
["triage", "digest", "respond"].includes(parsed.subaction)
|
|
157
|
-
? parsed.subaction
|
|
158
|
-
: (params.subaction ?? null);
|
|
159
|
-
const shouldAct = typeof parsed.shouldAct === "boolean" ? parsed.shouldAct : null;
|
|
160
|
-
return {
|
|
161
|
-
subaction,
|
|
162
|
-
shouldAct,
|
|
163
|
-
response: typeof parsed.response === "string" && parsed.response.trim().length > 0
|
|
164
|
-
? parsed.response.trim()
|
|
165
|
-
: null,
|
|
166
|
-
target: typeof parsed.target === "string" && parsed.target.trim().length > 0
|
|
167
|
-
? parsed.target.trim()
|
|
168
|
-
: null,
|
|
169
|
-
entryId: typeof parsed.entryId === "string" && parsed.entryId.trim().length > 0
|
|
170
|
-
? parsed.entryId.trim()
|
|
171
|
-
: null,
|
|
172
|
-
confirmed: typeof parsed.confirmed === "boolean" ? parsed.confirmed : null,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
logger.warn({
|
|
177
|
-
src: "action:inbox",
|
|
178
|
-
error: error instanceof Error ? error.message : String(error),
|
|
179
|
-
}, "[INBOX] failed to plan inbox subaction");
|
|
180
|
-
return {
|
|
181
|
-
subaction: null,
|
|
182
|
-
shouldAct: false,
|
|
183
|
-
response: "Inbox action planning failed right now. Tell me explicitly whether to triage, show a digest, or respond.",
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// ---------------------------------------------------------------------------
|
|
188
|
-
// INBOX action
|
|
189
|
-
// ---------------------------------------------------------------------------
|
|
190
|
-
const ACTION_NAME = "INBOX";
|
|
191
|
-
export const inboxAction = {
|
|
192
|
-
name: ACTION_NAME,
|
|
193
|
-
similes: [
|
|
194
|
-
"CHECK_INBOX",
|
|
195
|
-
"INBOX_TRIAGE",
|
|
196
|
-
"INBOX_DIGEST",
|
|
197
|
-
"INBOX_RESPOND",
|
|
198
|
-
"TRIAGE_INBOX",
|
|
199
|
-
"SCAN_MESSAGES",
|
|
200
|
-
"CHECK_MESSAGES",
|
|
201
|
-
"DAILY_DIGEST",
|
|
202
|
-
"INBOX_SUMMARY",
|
|
203
|
-
"REPLY_INBOX",
|
|
204
|
-
"RESPOND_TO_MESSAGE",
|
|
205
|
-
"MISSED_CALL_FOLLOWUP",
|
|
206
|
-
"MISSED_CALL_REPAIR",
|
|
207
|
-
"GROUP_CHAT_HANDOFF",
|
|
208
|
-
"CREATE_GROUP_CHAT",
|
|
209
|
-
"ADD_PARTICIPANTS_TO_GROUP_CHAT",
|
|
210
|
-
"GROUP_CHAT_POLICY",
|
|
211
|
-
"MESSY_RELAY_HANDOFF",
|
|
212
|
-
"BUMP_UNANSWERED_DECISION",
|
|
213
|
-
"GET_PENDING_ASSETS",
|
|
214
|
-
],
|
|
215
|
-
tags: [
|
|
216
|
-
"always-include",
|
|
217
|
-
"daily brief",
|
|
218
|
-
"cross-channel inbox",
|
|
219
|
-
"missed call repair",
|
|
220
|
-
"group chat handoff",
|
|
221
|
-
"bump unanswered decision",
|
|
222
|
-
"pending assets",
|
|
223
|
-
"event asset checklist",
|
|
224
|
-
"unread summary",
|
|
225
|
-
],
|
|
226
|
-
description: "Inbox management: triage new messages across all channels, " +
|
|
227
|
-
"generate a daily digest summary, or draft/send a response to a triaged " +
|
|
228
|
-
"item. Use this for executive-assistant daily briefs, urgent-vs-low " +
|
|
229
|
-
"priority inbox ranking, unread summaries, drafts awaiting sign-off, " +
|
|
230
|
-
"missed-call repair follow-up, unanswered-decision bump policies, event asset checklists, and group-chat handoff coordination. " +
|
|
231
|
-
"Standing inbox policies like 'if direct relaying gets messy here, suggest making a group chat handoff instead' should call this action instead of staying in plain chat. " +
|
|
232
|
-
"If the request sets a standing inbox policy or follow-up rule, still call this action on the first turn even when the action needs to acknowledge the policy before a live inbox item exists. " +
|
|
233
|
-
"Examples: 'triage my inbox', 'give me my inbox digest', or 'respond to the messages that need an answer in my inbox'. " +
|
|
234
|
-
"DO NOT use this action when the user is only complaining about email or messages without asking for triage, a digest, or a reply workflow. " +
|
|
235
|
-
"If the request is explicitly Gmail or email-specific, about unread emails, or about drafting or sending a reply to a specific email, use GMAIL_ACTION instead. " +
|
|
236
|
-
"Subactions: triage, digest, respond. Admin/owner only.",
|
|
237
|
-
descriptionCompressed: "Inbox: triage messages, daily digest, draft/send responses, missed-call repair, and group-chat handoff policies. Admin only.",
|
|
238
|
-
suppressPostActionContinuation: true,
|
|
239
|
-
validate: async (runtime, message) => {
|
|
240
|
-
return hasAdminAccess(runtime, message);
|
|
241
|
-
},
|
|
242
|
-
handler: async (runtime, message, state, options) => {
|
|
243
|
-
if (!(await hasAdminAccess(runtime, message))) {
|
|
244
|
-
return {
|
|
245
|
-
text: "Permission denied: only the owner or admin may use inbox actions.",
|
|
246
|
-
success: false,
|
|
247
|
-
values: { success: false, error: "PERMISSION_DENIED" },
|
|
248
|
-
data: { actionName: ACTION_NAME },
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
const params = (options?.parameters ??
|
|
252
|
-
{});
|
|
253
|
-
const userText = extractText(message);
|
|
254
|
-
const policyAcknowledgement = buildInboxPolicyAcknowledgement(userText);
|
|
255
|
-
if (policyAcknowledgement &&
|
|
256
|
-
(params.subaction === "respond" || params.subaction === undefined) &&
|
|
257
|
-
!params.entryId &&
|
|
258
|
-
!params.target &&
|
|
259
|
-
!params.messageText &&
|
|
260
|
-
params.confirmed !== true) {
|
|
261
|
-
return policyAcknowledgement;
|
|
262
|
-
}
|
|
263
|
-
const subactionPlan = await resolveSubactionPlan(runtime, params, userText, state);
|
|
264
|
-
if (!subactionPlan.subaction || subactionPlan.shouldAct !== true) {
|
|
265
|
-
return {
|
|
266
|
-
text: subactionPlan.response ??
|
|
267
|
-
"Tell me whether you want me to triage the inbox, show a digest, or respond to someone.",
|
|
268
|
-
success: false,
|
|
269
|
-
values: {
|
|
270
|
-
success: false,
|
|
271
|
-
error: "PLANNER_SHOULDACT_FALSE",
|
|
272
|
-
noop: true,
|
|
273
|
-
},
|
|
274
|
-
data: {
|
|
275
|
-
actionName: ACTION_NAME,
|
|
276
|
-
noop: true,
|
|
277
|
-
error: "PLANNER_SHOULDACT_FALSE",
|
|
278
|
-
suggestedSubaction: subactionPlan.subaction,
|
|
279
|
-
},
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
const resolvedParams = {
|
|
283
|
-
...params,
|
|
284
|
-
target: params.target ?? subactionPlan.target ?? undefined,
|
|
285
|
-
entryId: params.entryId ?? subactionPlan.entryId ?? undefined,
|
|
286
|
-
confirmed: params.confirmed ?? subactionPlan.confirmed ?? undefined,
|
|
287
|
-
};
|
|
288
|
-
const hasConcreteRespondTarget = resolvedParams.target !== undefined ||
|
|
289
|
-
resolvedParams.entryId !== undefined ||
|
|
290
|
-
resolvedParams.messageText !== undefined ||
|
|
291
|
-
resolvedParams.confirmed !== undefined;
|
|
292
|
-
if (typeof subactionPlan.response === "string" &&
|
|
293
|
-
subactionPlan.response.trim().length > 0 &&
|
|
294
|
-
!hasConcreteRespondTarget) {
|
|
295
|
-
return {
|
|
296
|
-
text: subactionPlan.response.trim(),
|
|
297
|
-
success: true,
|
|
298
|
-
values: { success: true, acknowledged: true },
|
|
299
|
-
data: {
|
|
300
|
-
actionName: ACTION_NAME,
|
|
301
|
-
subaction: subactionPlan.subaction,
|
|
302
|
-
acknowledged: true,
|
|
303
|
-
},
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
switch (subactionPlan.subaction) {
|
|
307
|
-
case "triage":
|
|
308
|
-
return handleTriage(runtime, message, state, resolvedParams);
|
|
309
|
-
case "digest":
|
|
310
|
-
return handleDigest(runtime, message, state, resolvedParams);
|
|
311
|
-
case "respond":
|
|
312
|
-
return handleRespond(runtime, message, state, resolvedParams);
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
parameters: [
|
|
316
|
-
{
|
|
317
|
-
name: "subaction",
|
|
318
|
-
description: "Inbox operation to run: triage (scan channels for new messages), " +
|
|
319
|
-
"digest (daily summary), or respond (draft/send a reply).",
|
|
320
|
-
required: false,
|
|
321
|
-
schema: {
|
|
322
|
-
type: "string",
|
|
323
|
-
enum: ["triage", "digest", "respond"],
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
name: "intent",
|
|
328
|
-
description: 'Natural language inbox request. Examples: "check my inbox for new messages", ' +
|
|
329
|
-
'"give me my daily summary", "respond to Alice\'s Discord message".',
|
|
330
|
-
required: false,
|
|
331
|
-
schema: { type: "string" },
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
name: "target",
|
|
335
|
-
description: "Who to respond to (for respond subaction). Can be a sender name, " +
|
|
336
|
-
"channel name, or source platform.",
|
|
337
|
-
required: false,
|
|
338
|
-
schema: { type: "string" },
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
name: "entryId",
|
|
342
|
-
description: "Specific triage entry ID to respond to.",
|
|
343
|
-
required: false,
|
|
344
|
-
schema: { type: "string" },
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
name: "messageText",
|
|
348
|
-
description: "Pre-composed message text for the response.",
|
|
349
|
-
required: false,
|
|
350
|
-
schema: { type: "string" },
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
name: "confirmed",
|
|
354
|
-
description: "Set to true when the user is confirming a previously drafted response.",
|
|
355
|
-
required: false,
|
|
356
|
-
schema: { type: "boolean" },
|
|
357
|
-
},
|
|
358
|
-
],
|
|
359
|
-
examples: [
|
|
360
|
-
[
|
|
361
|
-
{
|
|
362
|
-
name: "{{name1}}",
|
|
363
|
-
content: { text: "Triage my inbox" },
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
name: "{{agentName}}",
|
|
367
|
-
content: {
|
|
368
|
-
text: "Triaged 15 new messages: 2 urgent (escalated), 5 need reply, 3 auto-replied, 5 ignored.",
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
],
|
|
372
|
-
[
|
|
373
|
-
{
|
|
374
|
-
name: "{{name1}}",
|
|
375
|
-
content: { text: "Give me my inbox digest" },
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
name: "{{agentName}}",
|
|
379
|
-
content: {
|
|
380
|
-
text: '# Daily Inbox Summary — Saturday, April 12, 2026\n\n## Urgent (2)\n- Discord DM from Alice: "Are we meeting tomorrow?"',
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
],
|
|
384
|
-
[
|
|
385
|
-
{
|
|
386
|
-
name: "{{name1}}",
|
|
387
|
-
content: {
|
|
388
|
-
text: "Respond to the messages that need an answer in my inbox",
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
name: "{{agentName}}",
|
|
393
|
-
content: {
|
|
394
|
-
text: "I found 3 inbox items that need a reply. I'll draft the first response for your review.",
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
],
|
|
398
|
-
[
|
|
399
|
-
{
|
|
400
|
-
name: "{{name1}}",
|
|
401
|
-
content: {
|
|
402
|
-
text: "In the daily brief, also tell me which drafts still need my sign-off.",
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
name: "{{agentName}}",
|
|
407
|
-
content: {
|
|
408
|
-
text: "I'll include any drafts still waiting for your sign-off in the daily inbox brief.",
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
],
|
|
412
|
-
[
|
|
413
|
-
{
|
|
414
|
-
name: "{{name1}}",
|
|
415
|
-
content: {
|
|
416
|
-
text: "I missed a call with the Frontier Tower guys today. Need to repair that and reschedule if possible asap.",
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
name: "{{agentName}}",
|
|
421
|
-
content: {
|
|
422
|
-
text: "I'll draft the repair follow-up and line up the reschedule details so we can send it quickly.",
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
],
|
|
426
|
-
[
|
|
427
|
-
{
|
|
428
|
-
name: "{{name1}}",
|
|
429
|
-
content: {
|
|
430
|
-
text: "If direct relaying gets messy here, suggest making a group chat handoff instead.",
|
|
431
|
-
},
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
name: "{{agentName}}",
|
|
435
|
-
content: {
|
|
436
|
-
text: "Understood. If the relay gets tangled, I'll suggest a group-chat handoff instead of letting the thread drift.",
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
[
|
|
441
|
-
{
|
|
442
|
-
name: "{{name1}}",
|
|
443
|
-
content: {
|
|
444
|
-
text: "If I still haven't answered about those three events, bump me again with context instead of starting over.",
|
|
445
|
-
},
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
name: "{{agentName}}",
|
|
449
|
-
content: {
|
|
450
|
-
text: "I'll keep the prior context attached and bump you again about those three events instead of restarting the thread from zero.",
|
|
451
|
-
},
|
|
452
|
-
},
|
|
453
|
-
],
|
|
454
|
-
],
|
|
455
|
-
};
|
|
456
|
-
// ===========================================================================
|
|
457
|
-
// Subaction: TRIAGE
|
|
458
|
-
// ===========================================================================
|
|
459
|
-
async function handleTriage(runtime, _message, _state, _params) {
|
|
460
|
-
const config = loadInboxTriageConfig();
|
|
461
|
-
const repo = new InboxTriageRepository(runtime);
|
|
462
|
-
// 1. "since" window: current time minus one hour (the triage interval).
|
|
463
|
-
// Previous implementation used the most-recent unresolved entry's
|
|
464
|
-
// createdAt, which could miss messages arriving after that entry.
|
|
465
|
-
const sinceIso = new Date(Date.now() - 60 * 60 * 1000).toISOString();
|
|
466
|
-
// 2. Fetch messages from all channels
|
|
467
|
-
const service = new LifeOpsService(runtime);
|
|
468
|
-
const allMessages = await fetchAllMessages(runtime, {
|
|
469
|
-
sources: config.channels,
|
|
470
|
-
sinceIso,
|
|
471
|
-
limit: 200,
|
|
472
|
-
gmailSource: service,
|
|
473
|
-
xDmSource: service,
|
|
474
|
-
});
|
|
475
|
-
if (allMessages.length === 0) {
|
|
476
|
-
return {
|
|
477
|
-
text: "No new messages to triage.",
|
|
478
|
-
success: true,
|
|
479
|
-
values: { success: true, triaged: 0 },
|
|
480
|
-
data: { actionName: ACTION_NAME, subaction: "triage" },
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
// 3. Deduplicate against already-triaged messages
|
|
484
|
-
const newMessages = [];
|
|
485
|
-
for (const msg of allMessages) {
|
|
486
|
-
const existing = await repo.getBySourceMessageId(msg.id);
|
|
487
|
-
if (!existing) {
|
|
488
|
-
newMessages.push(msg);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
if (newMessages.length === 0) {
|
|
492
|
-
return {
|
|
493
|
-
text: "All recent messages have already been triaged.",
|
|
494
|
-
success: true,
|
|
495
|
-
values: {
|
|
496
|
-
success: true,
|
|
497
|
-
triaged: 0,
|
|
498
|
-
skippedDuplicates: allMessages.length,
|
|
499
|
-
},
|
|
500
|
-
data: { actionName: ACTION_NAME, subaction: "triage" },
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
let llmResults;
|
|
504
|
-
try {
|
|
505
|
-
const examples = await repo.getExamples(5);
|
|
506
|
-
llmResults = await classifyMessages(runtime, newMessages, {
|
|
507
|
-
config,
|
|
508
|
-
examples,
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
catch (error) {
|
|
512
|
-
const errorMessage = error instanceof Error ? error.message : "Inbox classification failed.";
|
|
513
|
-
return {
|
|
514
|
-
text: `Inbox triage paused because message classification failed: ${errorMessage} ` +
|
|
515
|
-
`No messages were auto-classified or auto-replied.`,
|
|
516
|
-
success: false,
|
|
517
|
-
values: {
|
|
518
|
-
success: false,
|
|
519
|
-
triaged: 0,
|
|
520
|
-
error: "TRIAGE_CLASSIFICATION_FAILED",
|
|
521
|
-
},
|
|
522
|
-
data: {
|
|
523
|
-
actionName: ACTION_NAME,
|
|
524
|
-
subaction: "triage",
|
|
525
|
-
interventionRequired: true,
|
|
526
|
-
},
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
// Build a Map for O(1) lookup instead of O(n) indexOf per message.
|
|
530
|
-
const llmResultMap = new Map();
|
|
531
|
-
for (let i = 0; i < newMessages.length; i++) {
|
|
532
|
-
const result = llmResults[i];
|
|
533
|
-
const message = newMessages[i];
|
|
534
|
-
if (result && message) {
|
|
535
|
-
llmResultMap.set(message.id, result);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
// 5. Store results
|
|
539
|
-
let countUrgent = 0;
|
|
540
|
-
let countNeedsReply = 0;
|
|
541
|
-
let countAutoReplied = 0;
|
|
542
|
-
let countIgnored = 0;
|
|
543
|
-
let countStored = 0;
|
|
544
|
-
for (const msg of newMessages) {
|
|
545
|
-
const result = llmResultMap.get(msg.id) ?? null;
|
|
546
|
-
if (!result)
|
|
547
|
-
continue;
|
|
548
|
-
if (result.classification === "ignore") {
|
|
549
|
-
countIgnored++;
|
|
550
|
-
continue;
|
|
551
|
-
}
|
|
552
|
-
// Store the triage entry
|
|
553
|
-
const entry = await repo.storeTriage({
|
|
554
|
-
source: msg.source,
|
|
555
|
-
sourceRoomId: msg.source === "x_dm" ? msg.xConversationId : msg.roomId,
|
|
556
|
-
sourceEntityId: msg.source === "x_dm" ? msg.xParticipantId : msg.entityId,
|
|
557
|
-
sourceMessageId: msg.id,
|
|
558
|
-
channelName: msg.channelName,
|
|
559
|
-
channelType: msg.channelType,
|
|
560
|
-
deepLink: msg.deepLink,
|
|
561
|
-
classification: result.classification,
|
|
562
|
-
urgency: result.urgency,
|
|
563
|
-
confidence: result.confidence,
|
|
564
|
-
snippet: msg.snippet,
|
|
565
|
-
senderName: msg.senderName,
|
|
566
|
-
threadContext: msg.threadMessages,
|
|
567
|
-
triageReasoning: result.reasoning,
|
|
568
|
-
suggestedResponse: result.suggestedResponse,
|
|
569
|
-
});
|
|
570
|
-
countStored++;
|
|
571
|
-
// Track counts
|
|
572
|
-
if (result.classification === "urgent")
|
|
573
|
-
countUrgent++;
|
|
574
|
-
if (result.classification === "needs_reply")
|
|
575
|
-
countNeedsReply++;
|
|
576
|
-
// 6. Escalate urgent items
|
|
577
|
-
if (result.classification === "urgent") {
|
|
578
|
-
try {
|
|
579
|
-
const { EscalationService } = await import("@elizaos/agent/services/escalation");
|
|
580
|
-
const linkText = msg.deepLink ? `\n${msg.deepLink}` : "";
|
|
581
|
-
await EscalationService.startEscalation(runtime, `Urgent message from ${msg.senderName} on ${msg.source}`, `[URGENT] ${msg.channelName}: "${msg.snippet}"${linkText}`);
|
|
582
|
-
}
|
|
583
|
-
catch (err) {
|
|
584
|
-
logger.warn({
|
|
585
|
-
src: "action:inbox",
|
|
586
|
-
error: err instanceof Error ? err.message : String(err),
|
|
587
|
-
messageId: msg.id,
|
|
588
|
-
}, "[INBOX] escalation failed");
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
// 7. Auto-reply check
|
|
592
|
-
if (result.classification === "needs_reply" &&
|
|
593
|
-
result.suggestedResponse &&
|
|
594
|
-
config.autoReply?.enabled) {
|
|
595
|
-
const autoReplyResult = await tryAutoReply(runtime, msg, result, entry.id, config, repo);
|
|
596
|
-
if (autoReplyResult)
|
|
597
|
-
countAutoReplied++;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
// 8. Cleanup old resolved entries
|
|
601
|
-
if (config.retentionDays) {
|
|
602
|
-
const cutoff = new Date(Date.now() - config.retentionDays * 24 * 60 * 60 * 1000).toISOString();
|
|
603
|
-
const cleaned = await repo.cleanupOlderThan(cutoff);
|
|
604
|
-
if (cleaned > 0) {
|
|
605
|
-
logger.info(`[INBOX] Cleaned up ${cleaned} old triage entries`);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
const summary = [
|
|
609
|
-
`Triaged ${newMessages.length} new messages:`,
|
|
610
|
-
countUrgent > 0 ? `${countUrgent} urgent (escalated)` : null,
|
|
611
|
-
countNeedsReply > 0 ? `${countNeedsReply} need reply` : null,
|
|
612
|
-
countAutoReplied > 0 ? `${countAutoReplied} auto-replied` : null,
|
|
613
|
-
countIgnored > 0 ? `${countIgnored} ignored` : null,
|
|
614
|
-
`${countStored} stored for review`,
|
|
615
|
-
]
|
|
616
|
-
.filter(Boolean)
|
|
617
|
-
.join(", ");
|
|
618
|
-
return {
|
|
619
|
-
text: summary,
|
|
620
|
-
success: true,
|
|
621
|
-
values: {
|
|
622
|
-
success: true,
|
|
623
|
-
triaged: newMessages.length,
|
|
624
|
-
urgent: countUrgent,
|
|
625
|
-
needsReply: countNeedsReply,
|
|
626
|
-
autoReplied: countAutoReplied,
|
|
627
|
-
ignored: countIgnored,
|
|
628
|
-
},
|
|
629
|
-
data: { actionName: ACTION_NAME, subaction: "triage" },
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
// ===========================================================================
|
|
633
|
-
// Subaction: DIGEST
|
|
634
|
-
// ===========================================================================
|
|
635
|
-
async function handleDigest(runtime, message, _state, _params) {
|
|
636
|
-
const config = loadInboxTriageConfig();
|
|
637
|
-
const repo = new InboxTriageRepository(runtime);
|
|
638
|
-
// 1. Get entries from the last 24 hours
|
|
639
|
-
const sinceIso = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
640
|
-
const entries = await repo.getRecentForDigest(sinceIso);
|
|
641
|
-
if (entries.length === 0) {
|
|
642
|
-
return {
|
|
643
|
-
text: "No inbox activity in the last 24 hours. All clear.",
|
|
644
|
-
success: true,
|
|
645
|
-
values: { success: true, entryCount: 0 },
|
|
646
|
-
data: { actionName: ACTION_NAME, subaction: "digest" },
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
// 2. Group by classification
|
|
650
|
-
const urgent = entries.filter((e) => e.classification === "urgent");
|
|
651
|
-
const needsReply = entries.filter((e) => e.classification === "needs_reply" && !e.resolved);
|
|
652
|
-
const notify = entries.filter((e) => e.classification === "notify");
|
|
653
|
-
const info = entries.filter((e) => e.classification === "info");
|
|
654
|
-
const autoReplied = entries.filter((e) => e.autoReplied);
|
|
655
|
-
const resolved = entries.filter((e) => e.resolved && !e.autoReplied);
|
|
656
|
-
// 3. Build digest
|
|
657
|
-
const today = new Date().toLocaleDateString("en-US", {
|
|
658
|
-
weekday: "long",
|
|
659
|
-
year: "numeric",
|
|
660
|
-
month: "long",
|
|
661
|
-
day: "numeric",
|
|
662
|
-
});
|
|
663
|
-
const lines = [`# Daily Inbox Summary — ${today}`];
|
|
664
|
-
lines.push(`\n${entries.length} messages triaged across ${countSources(entries)} channels.`);
|
|
665
|
-
if (urgent.length > 0) {
|
|
666
|
-
lines.push(`\n## Urgent (${urgent.length})`);
|
|
667
|
-
for (const e of urgent) {
|
|
668
|
-
lines.push(formatEntryLine(e));
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
if (needsReply.length > 0) {
|
|
672
|
-
lines.push(`\n## Needs Reply (${needsReply.length})`);
|
|
673
|
-
for (const e of needsReply) {
|
|
674
|
-
lines.push(formatEntryLine(e));
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
if (notify.length > 0) {
|
|
678
|
-
lines.push(`\n## Notifications (${notify.length})`);
|
|
679
|
-
for (const e of notify.slice(0, 10)) {
|
|
680
|
-
lines.push(formatEntryLine(e));
|
|
681
|
-
}
|
|
682
|
-
if (notify.length > 10) {
|
|
683
|
-
lines.push(` ...and ${notify.length - 10} more`);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
if (autoReplied.length > 0) {
|
|
687
|
-
lines.push(`\n## Auto-Replied (${autoReplied.length})`);
|
|
688
|
-
for (const e of autoReplied) {
|
|
689
|
-
const draft = e.draftResponse
|
|
690
|
-
? ` — replied: "${e.draftResponse.slice(0, 60)}..."`
|
|
691
|
-
: "";
|
|
692
|
-
lines.push(`- **${e.channelName}** (${e.source}): "${e.snippet.slice(0, 80)}"${draft}`);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
if (resolved.length > 0) {
|
|
696
|
-
lines.push(`\n## Resolved (${resolved.length})`);
|
|
697
|
-
lines.push(` ${resolved.length} items were addressed during the day.`);
|
|
698
|
-
}
|
|
699
|
-
if (info.length > 0) {
|
|
700
|
-
lines.push(`\n## Informational (${info.length})`);
|
|
701
|
-
lines.push(` ${info.length} informational messages were logged.`);
|
|
702
|
-
}
|
|
703
|
-
const digestText = lines.join("\n");
|
|
704
|
-
// 4. Send digest to owner
|
|
705
|
-
const deliveryChannel = config.digestDeliveryChannel ?? "client_chat";
|
|
706
|
-
try {
|
|
707
|
-
const adminEntityId = await resolveAdminEntityId(runtime, message);
|
|
708
|
-
await runtime.sendMessageToTarget({
|
|
709
|
-
source: deliveryChannel,
|
|
710
|
-
entityId: adminEntityId,
|
|
711
|
-
}, {
|
|
712
|
-
text: digestText,
|
|
713
|
-
source: deliveryChannel,
|
|
714
|
-
metadata: { digestType: "inbox_daily" },
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
catch (err) {
|
|
718
|
-
logger.warn({
|
|
719
|
-
src: "action:inbox",
|
|
720
|
-
error: err instanceof Error ? err.message : String(err),
|
|
721
|
-
}, "[INBOX] failed to deliver digest");
|
|
722
|
-
}
|
|
723
|
-
return {
|
|
724
|
-
text: digestText,
|
|
725
|
-
success: true,
|
|
726
|
-
values: {
|
|
727
|
-
success: true,
|
|
728
|
-
entryCount: entries.length,
|
|
729
|
-
urgent: urgent.length,
|
|
730
|
-
needsReply: needsReply.length,
|
|
731
|
-
autoReplied: autoReplied.length,
|
|
732
|
-
},
|
|
733
|
-
data: { actionName: ACTION_NAME, subaction: "digest" },
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
// ===========================================================================
|
|
737
|
-
// Subaction: RESPOND
|
|
738
|
-
// ===========================================================================
|
|
739
|
-
async function handleRespond(runtime, message, state, params) {
|
|
740
|
-
const userText = extractText(message);
|
|
741
|
-
const policyAcknowledgement = buildInboxPolicyAcknowledgement(userText);
|
|
742
|
-
if (policyAcknowledgement &&
|
|
743
|
-
!params.entryId &&
|
|
744
|
-
!params.target &&
|
|
745
|
-
!params.messageText &&
|
|
746
|
-
params.confirmed !== true) {
|
|
747
|
-
return policyAcknowledgement;
|
|
748
|
-
}
|
|
749
|
-
const repo = new InboxTriageRepository(runtime);
|
|
750
|
-
// -- Check for pending draft confirmation --------------------------------
|
|
751
|
-
const pendingDraft = latestPendingDraft(state);
|
|
752
|
-
if (pendingDraft && params.confirmed === true) {
|
|
753
|
-
return handleConfirmation(runtime, message, pendingDraft, userText, repo);
|
|
754
|
-
}
|
|
755
|
-
// -- Find the triage entry to respond to ---------------------------------
|
|
756
|
-
let entry = null;
|
|
757
|
-
if (params.entryId) {
|
|
758
|
-
entry = await repo.getById(params.entryId);
|
|
759
|
-
}
|
|
760
|
-
if (!entry && params.target) {
|
|
761
|
-
const unresolved = await repo.getUnresolved({ limit: 50 });
|
|
762
|
-
entry = findBestMatch(unresolved, params.target);
|
|
763
|
-
}
|
|
764
|
-
if (!entry) {
|
|
765
|
-
// If no specific target, grab the most urgent unresolved item
|
|
766
|
-
const unresolved = await repo.getUnresolved({ limit: 5 });
|
|
767
|
-
const needsReply = unresolved.filter((e) => e.classification === "needs_reply" || e.classification === "urgent");
|
|
768
|
-
if (needsReply.length === 0) {
|
|
769
|
-
return {
|
|
770
|
-
text: "No pending inbox items need a reply right now. Use INBOX to triage for new messages.",
|
|
771
|
-
// The respond side effect did not happen — there was nothing to reply
|
|
772
|
-
// to. Report as a structured no-op rather than a success.
|
|
773
|
-
success: false,
|
|
774
|
-
values: {
|
|
775
|
-
success: false,
|
|
776
|
-
error: "NOOP_NOTHING_TO_DO",
|
|
777
|
-
noop: true,
|
|
778
|
-
},
|
|
779
|
-
data: {
|
|
780
|
-
actionName: ACTION_NAME,
|
|
781
|
-
subaction: "respond",
|
|
782
|
-
noop: true,
|
|
783
|
-
error: "NOOP_NOTHING_TO_DO",
|
|
784
|
-
},
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
if (needsReply.length === 1) {
|
|
788
|
-
const onlyEntry = needsReply.at(0);
|
|
789
|
-
if (!onlyEntry) {
|
|
790
|
-
return {
|
|
791
|
-
text: "Could not find the inbox item you want to respond to.",
|
|
792
|
-
success: false,
|
|
793
|
-
values: { success: false },
|
|
794
|
-
data: { actionName: ACTION_NAME, subaction: "respond" },
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
entry = onlyEntry;
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
const itemList = needsReply
|
|
801
|
-
.map((e) => `- **${e.channelName}** (${e.source}): "${e.snippet.slice(0, 60)}"`)
|
|
802
|
-
.join("\n");
|
|
803
|
-
return {
|
|
804
|
-
text: `Multiple items need a reply. Which one?\n\n${itemList}\n\nSay "respond to [name/channel]" to pick one.`,
|
|
805
|
-
// The respond side effect did not happen — we need the user to
|
|
806
|
-
// disambiguate which item first. Report as a structured failure so
|
|
807
|
-
// downstream consumers don't treat this as a completed reply.
|
|
808
|
-
success: false,
|
|
809
|
-
values: {
|
|
810
|
-
success: false,
|
|
811
|
-
error: "DISAMBIGUATION_REQUIRED",
|
|
812
|
-
pendingCount: needsReply.length,
|
|
813
|
-
},
|
|
814
|
-
data: {
|
|
815
|
-
actionName: ACTION_NAME,
|
|
816
|
-
subaction: "respond",
|
|
817
|
-
error: "DISAMBIGUATION_REQUIRED",
|
|
818
|
-
pendingCount: needsReply.length,
|
|
819
|
-
},
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
if (!entry) {
|
|
824
|
-
return {
|
|
825
|
-
text: "Could not find the inbox item you want to respond to.",
|
|
826
|
-
success: false,
|
|
827
|
-
values: { success: false, error: "NOT_FOUND" },
|
|
828
|
-
data: { actionName: ACTION_NAME, subaction: "respond" },
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
// -- Draft a response ----------------------------------------------------
|
|
832
|
-
const draftText = params.messageText
|
|
833
|
-
? params.messageText
|
|
834
|
-
: await draftResponse(runtime, entry, userText);
|
|
835
|
-
const draft = {
|
|
836
|
-
triageEntryId: entry.id,
|
|
837
|
-
source: entry.source,
|
|
838
|
-
targetRoomId: entry.source !== "x_dm" && entry.sourceRoomId
|
|
839
|
-
? entry.sourceRoomId
|
|
840
|
-
: undefined,
|
|
841
|
-
targetEntityId: entry.source !== "x_dm" && entry.sourceEntityId
|
|
842
|
-
? entry.sourceEntityId
|
|
843
|
-
: undefined,
|
|
844
|
-
gmailMessageId: entry.source === "gmail"
|
|
845
|
-
? (entry.sourceMessageId ?? undefined)
|
|
846
|
-
: undefined,
|
|
847
|
-
xConversationId: entry.source === "x_dm" ? (entry.sourceRoomId ?? undefined) : undefined,
|
|
848
|
-
xParticipantId: entry.source === "x_dm" ? (entry.sourceEntityId ?? undefined) : undefined,
|
|
849
|
-
draftText,
|
|
850
|
-
deepLink: entry.deepLink,
|
|
851
|
-
channelName: entry.channelName,
|
|
852
|
-
senderName: entry.senderName ?? "Unknown",
|
|
853
|
-
};
|
|
854
|
-
const approvalQueue = createApprovalQueue(runtime, {
|
|
855
|
-
agentId: runtime.agentId,
|
|
856
|
-
});
|
|
857
|
-
const approvalRequest = await approvalQueue.enqueue({
|
|
858
|
-
requestedBy: `inbox:${entry.id}`,
|
|
859
|
-
subjectUserId: String(message.entityId ?? runtime.agentId),
|
|
860
|
-
action: draft.source === "gmail" ? "send_email" : "send_message",
|
|
861
|
-
payload: draft.source === "gmail" && draft.gmailMessageId
|
|
862
|
-
? {
|
|
863
|
-
action: "send_email",
|
|
864
|
-
to: [],
|
|
865
|
-
cc: [],
|
|
866
|
-
bcc: [],
|
|
867
|
-
subject: entry.channelName,
|
|
868
|
-
body: draft.draftText,
|
|
869
|
-
threadId: entry.sourceMessageId,
|
|
870
|
-
replyToMessageId: draft.gmailMessageId,
|
|
871
|
-
}
|
|
872
|
-
: {
|
|
873
|
-
action: "send_message",
|
|
874
|
-
recipient: draft.source === "x_dm" && draft.xConversationId
|
|
875
|
-
? `conversation:${draft.xConversationId}`
|
|
876
|
-
: String(draft.targetRoomId ??
|
|
877
|
-
draft.targetEntityId ??
|
|
878
|
-
draft.xParticipantId ??
|
|
879
|
-
""),
|
|
880
|
-
body: draft.draftText,
|
|
881
|
-
replyToMessageId: entry.sourceMessageId,
|
|
882
|
-
},
|
|
883
|
-
channel: approvalChannelForInboxSource(entry.source),
|
|
884
|
-
reason: `Reply draft for ${draft.senderName} on ${draft.channelName}`,
|
|
885
|
-
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
|
|
886
|
-
});
|
|
887
|
-
draft.approvalRequestId = approvalRequest.id;
|
|
888
|
-
return {
|
|
889
|
-
text: `I'll send this to **${draft.senderName}** on **${draft.channelName}** (${draft.source}):\n\n` +
|
|
890
|
-
`> ${draftText}\n\n` +
|
|
891
|
-
`It's queued for approval. Say **"send it"** or explicitly approve it to dispatch, or tell me what to change.`,
|
|
892
|
-
success: true,
|
|
893
|
-
values: { success: true, awaitingConfirmation: true },
|
|
894
|
-
data: {
|
|
895
|
-
actionName: ACTION_NAME,
|
|
896
|
-
subaction: "respond",
|
|
897
|
-
inboxDraft: draft,
|
|
898
|
-
approvalRequestId: approvalRequest.id,
|
|
899
|
-
},
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
// ===========================================================================
|
|
903
|
-
// Shared helpers
|
|
904
|
-
// ===========================================================================
|
|
905
|
-
// -- Auto-reply (used by triage) -------------------------------------------
|
|
906
|
-
async function tryAutoReply(runtime, msg, result, entryId, config, repo) {
|
|
907
|
-
const autoConfig = config.autoReply;
|
|
908
|
-
if (!autoConfig?.enabled)
|
|
909
|
-
return false;
|
|
910
|
-
const suggestedResponse = result.suggestedResponse;
|
|
911
|
-
if (!suggestedResponse)
|
|
912
|
-
return false;
|
|
913
|
-
const threshold = autoConfig.confidenceThreshold ?? 0.85;
|
|
914
|
-
if (result.confidence < threshold)
|
|
915
|
-
return false;
|
|
916
|
-
// Sender whitelist check
|
|
917
|
-
if (autoConfig.senderWhitelist?.length) {
|
|
918
|
-
const senderId = msg.entityId ?? msg.senderName;
|
|
919
|
-
if (!autoConfig.senderWhitelist.some((s) => s.toLowerCase() === senderId.toLowerCase())) {
|
|
920
|
-
return false;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
// Channel whitelist check
|
|
924
|
-
if (autoConfig.channelWhitelist?.length) {
|
|
925
|
-
if (!autoConfig.channelWhitelist.includes(msg.source)) {
|
|
926
|
-
return false;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
// Rate limit check
|
|
930
|
-
const maxPerHour = autoConfig.maxAutoRepliesPerHour ?? 5;
|
|
931
|
-
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000).toISOString();
|
|
932
|
-
const recentAutoCount = await repo.countAutoRepliesSince(oneHourAgo);
|
|
933
|
-
if (recentAutoCount >= maxPerHour) {
|
|
934
|
-
logger.info("[INBOX] Auto-reply rate limit reached");
|
|
935
|
-
return false;
|
|
936
|
-
}
|
|
937
|
-
// Reflection safety check
|
|
938
|
-
const reflection = await reflectOnAutoReply(runtime, {
|
|
939
|
-
inboundText: msg.text,
|
|
940
|
-
replyText: suggestedResponse,
|
|
941
|
-
source: msg.source,
|
|
942
|
-
senderName: msg.senderName,
|
|
943
|
-
});
|
|
944
|
-
if (!reflection.approved) {
|
|
945
|
-
logger.info(`[INBOX] Auto-reply rejected by reflection: ${reflection.reasoning}`);
|
|
946
|
-
return false;
|
|
947
|
-
}
|
|
948
|
-
// Send the auto-reply
|
|
949
|
-
try {
|
|
950
|
-
if (msg.source === "gmail" && msg.gmailMessageId) {
|
|
951
|
-
const { LifeOpsService } = await import("../lifeops/service.js");
|
|
952
|
-
const service = new LifeOpsService(runtime);
|
|
953
|
-
await service.sendGmailReply(INTERNAL_URL, {
|
|
954
|
-
messageId: msg.gmailMessageId,
|
|
955
|
-
bodyText: suggestedResponse,
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
else if (msg.source === "x_dm" &&
|
|
959
|
-
(msg.xConversationId || msg.xParticipantId)) {
|
|
960
|
-
const service = new LifeOpsService(runtime);
|
|
961
|
-
if (msg.xConversationId) {
|
|
962
|
-
await service.sendXConversationMessage({
|
|
963
|
-
conversationId: msg.xConversationId,
|
|
964
|
-
text: suggestedResponse,
|
|
965
|
-
confirmSend: true,
|
|
966
|
-
side: "owner",
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
else if (msg.xParticipantId) {
|
|
970
|
-
await service.sendXDirectMessage({
|
|
971
|
-
participantId: msg.xParticipantId,
|
|
972
|
-
text: suggestedResponse,
|
|
973
|
-
confirmSend: true,
|
|
974
|
-
side: "owner",
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
else if (msg.roomId) {
|
|
979
|
-
await runtime.sendMessageToTarget({
|
|
980
|
-
source: msg.source,
|
|
981
|
-
roomId: msg.roomId,
|
|
982
|
-
}, { text: suggestedResponse, source: msg.source });
|
|
983
|
-
}
|
|
984
|
-
else {
|
|
985
|
-
return false;
|
|
986
|
-
}
|
|
987
|
-
await repo.markResolved(entryId, {
|
|
988
|
-
draftResponse: suggestedResponse,
|
|
989
|
-
autoReplied: true,
|
|
990
|
-
});
|
|
991
|
-
logger.info(`[INBOX] Auto-replied to ${msg.senderName} on ${msg.source}`);
|
|
992
|
-
return true;
|
|
993
|
-
}
|
|
994
|
-
catch (err) {
|
|
995
|
-
logger.warn({
|
|
996
|
-
src: "action:inbox",
|
|
997
|
-
error: err instanceof Error ? err.message : String(err),
|
|
998
|
-
messageId: msg.id,
|
|
999
|
-
}, "[INBOX] auto-reply send failed");
|
|
1000
|
-
return false;
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
// -- Draft generation (used by respond) ------------------------------------
|
|
1004
|
-
async function draftResponse(runtime, entry, userHint) {
|
|
1005
|
-
const seed = entry.suggestedResponse ?? "";
|
|
1006
|
-
const contextLines = entry.threadContext
|
|
1007
|
-
? entry.threadContext.join("\n")
|
|
1008
|
-
: "";
|
|
1009
|
-
const prompt = [
|
|
1010
|
-
"Draft a brief, natural response to the following message.",
|
|
1011
|
-
"Match the tone and formality of the conversation.",
|
|
1012
|
-
"",
|
|
1013
|
-
`From: ${entry.senderName ?? "Unknown"}`,
|
|
1014
|
-
`Channel: ${entry.channelName} (${entry.source})`,
|
|
1015
|
-
`Their message: "${entry.snippet}"`,
|
|
1016
|
-
contextLines ? `Recent context:\n${contextLines}` : "",
|
|
1017
|
-
seed ? `Suggested starting point: "${seed}"` : "",
|
|
1018
|
-
userHint ? `Owner's guidance: "${userHint}"` : "",
|
|
1019
|
-
"",
|
|
1020
|
-
"Write ONLY the response text. Do not include any explanation or metadata.",
|
|
1021
|
-
]
|
|
1022
|
-
.filter(Boolean)
|
|
1023
|
-
.join("\n");
|
|
1024
|
-
try {
|
|
1025
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: runtime.useModel is an elizaOS model API, not a React hook.
|
|
1026
|
-
const result = await runtime.useModel(ModelType.TEXT_SMALL, { prompt });
|
|
1027
|
-
const text = typeof result === "string" ? result.trim() : "";
|
|
1028
|
-
return (text || seed || "Thanks for reaching out. I'll get back to you soon.");
|
|
1029
|
-
}
|
|
1030
|
-
catch {
|
|
1031
|
-
return seed || "Thanks for reaching out. I'll get back to you soon.";
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
// -- Confirmation handling (used by respond) --------------------------------
|
|
1035
|
-
async function handleConfirmation(runtime, message, draft, userText, repo) {
|
|
1036
|
-
// Reflection safety check
|
|
1037
|
-
const reflection = await reflectOnSendConfirmation(runtime, {
|
|
1038
|
-
userMessage: userText,
|
|
1039
|
-
draftText: draft.draftText,
|
|
1040
|
-
channelName: draft.channelName,
|
|
1041
|
-
recipientName: draft.senderName,
|
|
1042
|
-
});
|
|
1043
|
-
if (!reflection.confirmed) {
|
|
1044
|
-
return {
|
|
1045
|
-
text: `I wasn't sure you confirmed — ${reflection.reasoning}. Please say **"yes, send it"** to confirm.`,
|
|
1046
|
-
success: true,
|
|
1047
|
-
values: { success: true, awaitingConfirmation: true },
|
|
1048
|
-
data: {
|
|
1049
|
-
actionName: ACTION_NAME,
|
|
1050
|
-
subaction: "respond",
|
|
1051
|
-
inboxDraft: draft,
|
|
1052
|
-
},
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
// Send the message through the original channel
|
|
1056
|
-
if (draft.approvalRequestId) {
|
|
1057
|
-
try {
|
|
1058
|
-
const queue = createApprovalQueue(runtime, { agentId: runtime.agentId });
|
|
1059
|
-
const approved = await queue.approve(draft.approvalRequestId, {
|
|
1060
|
-
resolvedBy: String(message.entityId ?? runtime.agentId),
|
|
1061
|
-
resolutionReason: userText.trim() || "user confirmed inbox draft",
|
|
1062
|
-
});
|
|
1063
|
-
const executed = await executeApprovedRequest({
|
|
1064
|
-
runtime,
|
|
1065
|
-
queue,
|
|
1066
|
-
request: approved,
|
|
1067
|
-
});
|
|
1068
|
-
if (!executed.success) {
|
|
1069
|
-
return executed;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
catch (err) {
|
|
1073
|
-
return {
|
|
1074
|
-
text: `Failed to send message: ${String(err)}`,
|
|
1075
|
-
success: false,
|
|
1076
|
-
values: { success: false, error: "SEND_FAILED" },
|
|
1077
|
-
data: { actionName: ACTION_NAME, subaction: "respond" },
|
|
1078
|
-
};
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
else {
|
|
1082
|
-
try {
|
|
1083
|
-
if (draft.source === "gmail" && draft.gmailMessageId) {
|
|
1084
|
-
const { LifeOpsService } = await import("../lifeops/service.js");
|
|
1085
|
-
const service = new LifeOpsService(runtime);
|
|
1086
|
-
await service.sendGmailReply(INTERNAL_URL, {
|
|
1087
|
-
messageId: draft.gmailMessageId,
|
|
1088
|
-
bodyText: draft.draftText,
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
else if (draft.source === "x_dm" &&
|
|
1092
|
-
(draft.xConversationId || draft.xParticipantId)) {
|
|
1093
|
-
const service = new LifeOpsService(runtime);
|
|
1094
|
-
if (draft.xConversationId) {
|
|
1095
|
-
await service.sendXConversationMessage({
|
|
1096
|
-
conversationId: draft.xConversationId,
|
|
1097
|
-
text: draft.draftText,
|
|
1098
|
-
confirmSend: true,
|
|
1099
|
-
side: "owner",
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
else if (draft.xParticipantId) {
|
|
1103
|
-
await service.sendXDirectMessage({
|
|
1104
|
-
participantId: draft.xParticipantId,
|
|
1105
|
-
text: draft.draftText,
|
|
1106
|
-
confirmSend: true,
|
|
1107
|
-
side: "owner",
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
else if (draft.targetRoomId) {
|
|
1112
|
-
await runtime.sendMessageToTarget({
|
|
1113
|
-
source: draft.source,
|
|
1114
|
-
roomId: draft.targetRoomId,
|
|
1115
|
-
}, { text: draft.draftText, source: draft.source });
|
|
1116
|
-
}
|
|
1117
|
-
else {
|
|
1118
|
-
return {
|
|
1119
|
-
text: "Cannot send: no target room or message ID available for this channel.",
|
|
1120
|
-
success: false,
|
|
1121
|
-
values: { success: false, error: "NO_TARGET" },
|
|
1122
|
-
data: { actionName: ACTION_NAME, subaction: "respond" },
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
catch (err) {
|
|
1127
|
-
return {
|
|
1128
|
-
text: `Failed to send message: ${String(err)}`,
|
|
1129
|
-
success: false,
|
|
1130
|
-
values: { success: false, error: "SEND_FAILED" },
|
|
1131
|
-
data: { actionName: ACTION_NAME, subaction: "respond" },
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
// Mark resolved and store as example
|
|
1136
|
-
await repo.markResolved(draft.triageEntryId, {
|
|
1137
|
-
draftResponse: draft.draftText,
|
|
1138
|
-
});
|
|
1139
|
-
const entry = await repo.getById(draft.triageEntryId);
|
|
1140
|
-
if (entry) {
|
|
1141
|
-
await repo.storeExample({
|
|
1142
|
-
source: entry.source,
|
|
1143
|
-
snippet: entry.snippet,
|
|
1144
|
-
classification: entry.classification,
|
|
1145
|
-
ownerAction: "confirmed",
|
|
1146
|
-
contextJson: {
|
|
1147
|
-
senderName: entry.senderName,
|
|
1148
|
-
channelName: entry.channelName,
|
|
1149
|
-
draftResponse: draft.draftText,
|
|
1150
|
-
},
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
return {
|
|
1154
|
-
text: `Message sent to **${draft.senderName}** on **${draft.channelName}**.`,
|
|
1155
|
-
success: true,
|
|
1156
|
-
values: { success: true, sent: true },
|
|
1157
|
-
data: { actionName: ACTION_NAME, subaction: "respond", sent: true },
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
// -- Digest formatters -----------------------------------------------------
|
|
1161
|
-
function formatEntryLine(entry) {
|
|
1162
|
-
const resolvedTag = entry.resolved ? " [resolved]" : "";
|
|
1163
|
-
const link = entry.deepLink ? `\n ${entry.deepLink}` : "";
|
|
1164
|
-
return (`- **${entry.channelName}** (${entry.source}): "${entry.snippet.slice(0, 100)}"${resolvedTag}` +
|
|
1165
|
-
link);
|
|
1166
|
-
}
|
|
1167
|
-
function countSources(entries) {
|
|
1168
|
-
return new Set(entries.map((e) => e.source)).size;
|
|
1169
|
-
}
|
|
1170
|
-
// -- State/text helpers ----------------------------------------------------
|
|
1171
|
-
function latestPendingDraft(state) {
|
|
1172
|
-
if (!state || typeof state !== "object")
|
|
1173
|
-
return null;
|
|
1174
|
-
const stateRecord = state;
|
|
1175
|
-
const data = stateRecord.data && typeof stateRecord.data === "object"
|
|
1176
|
-
? stateRecord.data
|
|
1177
|
-
: undefined;
|
|
1178
|
-
const actionResults = Array.isArray(data?.actionResults)
|
|
1179
|
-
? data.actionResults
|
|
1180
|
-
: [];
|
|
1181
|
-
// Check action results (newest first)
|
|
1182
|
-
for (let i = actionResults.length - 1; i >= 0; i--) {
|
|
1183
|
-
const draft = actionResults[i]?.data?.inboxDraft;
|
|
1184
|
-
if (draft?.triageEntryId && draft?.draftText) {
|
|
1185
|
-
return draft;
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
// Check recent messages
|
|
1189
|
-
const recentMessagesData = getRecentMessagesData(state);
|
|
1190
|
-
for (let i = recentMessagesData.length - 1; i >= 0; i--) {
|
|
1191
|
-
const item = recentMessagesData[i];
|
|
1192
|
-
if (!item)
|
|
1193
|
-
continue;
|
|
1194
|
-
const content = item.content && typeof item.content === "object"
|
|
1195
|
-
? item.content
|
|
1196
|
-
: null;
|
|
1197
|
-
if (!content)
|
|
1198
|
-
continue;
|
|
1199
|
-
const draft = content.inboxDraft ??
|
|
1200
|
-
content.data?.inboxDraft;
|
|
1201
|
-
if (draft?.triageEntryId && draft?.draftText) {
|
|
1202
|
-
return draft;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
return null;
|
|
1206
|
-
}
|
|
1207
|
-
function approvalChannelForInboxSource(source) {
|
|
1208
|
-
switch (source) {
|
|
1209
|
-
case "gmail":
|
|
1210
|
-
return "email";
|
|
1211
|
-
case "telegram":
|
|
1212
|
-
case "discord":
|
|
1213
|
-
case "imessage":
|
|
1214
|
-
case "sms":
|
|
1215
|
-
case "x_dm":
|
|
1216
|
-
return source;
|
|
1217
|
-
default:
|
|
1218
|
-
return "internal";
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
function findBestMatch(entries, target) {
|
|
1222
|
-
const lower = target.toLowerCase();
|
|
1223
|
-
// Exact channel name match
|
|
1224
|
-
const exact = entries.find((e) => e.channelName.toLowerCase() === lower);
|
|
1225
|
-
if (exact)
|
|
1226
|
-
return exact;
|
|
1227
|
-
// Sender name match
|
|
1228
|
-
const senderMatch = entries.find((e) => e.senderName?.toLowerCase().includes(lower));
|
|
1229
|
-
if (senderMatch)
|
|
1230
|
-
return senderMatch;
|
|
1231
|
-
// Partial channel name match
|
|
1232
|
-
const partial = entries.find((e) => e.channelName.toLowerCase().includes(lower));
|
|
1233
|
-
if (partial)
|
|
1234
|
-
return partial;
|
|
1235
|
-
// Source match
|
|
1236
|
-
const sourceMatch = entries.find((e) => e.source.toLowerCase() === lower);
|
|
1237
|
-
if (sourceMatch)
|
|
1238
|
-
return sourceMatch;
|
|
1239
|
-
return null;
|
|
1240
|
-
}
|
|
1241
|
-
function extractText(message) {
|
|
1242
|
-
const content = message.content;
|
|
1243
|
-
return typeof content?.text === "string" ? content.text : "";
|
|
1244
|
-
}
|