@elizaos/agent 2.0.3-beta.2 → 2.0.3-beta.4
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/__tests__/view-user-journeys.d.ts.map +1 -1
- package/__tests__/view-user-journeys.js +52 -41
- package/actions/context-signal.d.ts +2 -2
- package/actions/files.d.ts +9 -0
- package/actions/files.d.ts.map +1 -0
- package/actions/files.js +183 -0
- package/actions/index.d.ts +17 -17
- package/api/accounts-routes.d.ts +1 -1
- package/api/accounts-routes.js +1 -1
- package/api/agent-admin-routes.d.ts +1 -1
- package/api/agent-admin-routes.js +2 -2
- package/api/agent-model.d.ts +1 -1
- package/api/agent-status-routes.d.ts +1 -3
- package/api/agent-status-routes.d.ts.map +1 -1
- package/api/agent-status-routes.js +0 -2
- package/api/approval-routes.d.ts +38 -0
- package/api/approval-routes.d.ts.map +1 -0
- package/api/approval-routes.js +223 -0
- package/api/background-routes.d.ts +13 -0
- package/api/background-routes.d.ts.map +1 -0
- package/api/background-routes.js +91 -0
- package/api/binance-skill-helpers.d.ts +2 -2
- package/api/binance-skill-helpers.js +2 -2
- package/api/builtin-views.d.ts.map +1 -1
- package/api/builtin-views.js +44 -4
- package/api/character-routes.d.ts +1 -1
- package/api/chat-augmentation.d.ts.map +1 -1
- package/api/chat-augmentation.js +17 -0
- package/api/chat-routes.d.ts +29 -2
- package/api/chat-routes.d.ts.map +1 -1
- package/api/chat-routes.js +76 -1
- package/api/commands-routes.d.ts +10 -8
- package/api/commands-routes.d.ts.map +1 -1
- package/api/commands-routes.js +17 -59
- package/api/config-routes.d.ts +1 -1
- package/api/config-routes.d.ts.map +1 -1
- package/api/config-routes.js +0 -2
- package/api/connector-routes.d.ts +1 -1
- package/api/conversation-metadata.d.ts +1 -1
- package/api/conversation-metadata.d.ts.map +1 -1
- package/api/conversation-metadata.js +0 -1
- package/api/conversation-routes.d.ts +4 -3
- package/api/conversation-routes.d.ts.map +1 -1
- package/api/conversation-routes.js +34 -1
- package/api/documents-service-loader.d.ts +0 -4
- package/api/documents-service-loader.d.ts.map +1 -1
- package/api/documents-service-loader.js +0 -2
- package/api/files-routes.d.ts +14 -0
- package/api/files-routes.d.ts.map +1 -0
- package/api/files-routes.js +47 -0
- package/api/first-run-routes.d.ts +1 -1
- package/api/health-routes.d.ts +2 -2
- package/api/index.d.ts +40 -39
- package/api/index.d.ts.map +1 -1
- package/api/index.js +1 -0
- package/api/interactions-routes.d.ts +33 -0
- package/api/interactions-routes.d.ts.map +1 -0
- package/api/interactions-routes.js +63 -0
- package/api/media-runtime.d.ts +2 -1
- package/api/media-runtime.d.ts.map +1 -1
- package/api/media-runtime.js +64 -7
- package/api/media-store.d.ts +36 -0
- package/api/media-store.d.ts.map +1 -1
- package/api/media-store.js +141 -2
- package/api/memory-bounds.d.ts +0 -1
- package/api/memory-bounds.d.ts.map +1 -1
- package/api/memory-bounds.js +0 -1
- package/api/misc-routes.d.ts +1 -1
- package/api/model-provider-helpers.d.ts +2 -2
- package/api/model-provider-helpers.js +2 -2
- package/api/permissions-routes-extra.d.ts +1 -1
- package/api/permissions-routes.d.ts +1 -1
- package/api/permissions-routes.d.ts.map +1 -1
- package/api/permissions-routes.js +8 -7
- package/api/plugin-discovery-helpers.d.ts +5 -6
- package/api/plugin-discovery-helpers.d.ts.map +1 -1
- package/api/plugin-discovery-helpers.js +3 -4
- package/api/plugin-runtime-apply.d.ts +2 -2
- package/api/plugin-runtime-apply.d.ts.map +1 -1
- package/api/plugin-runtime-apply.js +74 -0
- package/api/provider-switch-config.d.ts +1 -1
- package/api/provider-switch-routes.d.ts +2 -2
- package/api/registry-routes.d.ts +1 -1
- package/api/registry-service.d.ts +1 -1
- package/api/remote-capability-routes.d.ts +2 -2
- package/api/remote-capability-routes.d.ts.map +1 -1
- package/api/remote-capability-routes.js +19 -0
- package/api/server-autonomy-helpers.d.ts +2 -2
- package/api/server-helpers-auth.d.ts +10 -0
- package/api/server-helpers-auth.d.ts.map +1 -1
- package/api/server-helpers-auth.js +16 -210
- package/api/server-helpers-config.d.ts +1 -1
- package/api/server-helpers-mcp.d.ts +2 -2
- package/api/server-helpers-plugin.d.ts +1 -1
- package/api/server-helpers-swarm.d.ts +3 -3
- package/api/server-helpers-swarm.d.ts.map +1 -1
- package/api/server-helpers-swarm.js +15 -5
- package/api/server-helpers-wallet.d.ts +1 -1
- package/api/server-helpers.d.ts +4 -4
- package/api/server-lazy-routes.d.ts +40 -38
- package/api/server-lazy-routes.d.ts.map +1 -1
- package/api/server-lazy-routes.js +7 -0
- package/api/server-route-dispatch.d.ts +2 -2
- package/api/server-route-dispatch.d.ts.map +1 -1
- package/api/server-route-dispatch.js +7 -0
- package/api/server-types.d.ts +9 -7
- package/api/server-types.d.ts.map +1 -1
- package/api/server.d.ts +19 -19
- package/api/server.d.ts.map +1 -1
- package/api/server.js +111 -17
- package/api/static-file-server.d.ts +2 -2
- package/api/static-file-server.js +2 -2
- package/api/subscription-routes.d.ts +4 -4
- package/api/subscription-routes.js +3 -4
- package/api/suggestions-routes.d.ts +1 -1
- package/api/suggestions-routes.d.ts.map +1 -1
- package/api/suggestions-routes.js +2 -3
- package/api/terminal-execution-routing.d.ts +1 -1
- package/api/training-service-like.d.ts +1 -1
- package/api/trajectory-fallback-routes.d.ts.map +1 -1
- package/api/trajectory-fallback-routes.js +21 -1
- package/api/update-routes.d.ts +1 -1
- package/api/view-registry-types.d.ts +1 -1
- package/api/views-registry.d.ts +14 -4
- package/api/views-registry.d.ts.map +1 -1
- package/api/views-registry.js +107 -72
- package/api/views-routes.d.ts +1 -1
- package/api/views-routes.d.ts.map +1 -1
- package/api/views-routes.js +131 -14
- package/api/views-search-index.d.ts +1 -1
- package/api/wallet-capability.d.ts +3 -3
- package/api/wallet-rpc.d.ts +1 -1
- package/api/wallet.d.ts +3 -3
- package/api/wallet.d.ts.map +1 -1
- package/api/wallet.js +4 -3
- package/api/workbench-context.d.ts +1 -1
- package/api/workbench-helpers.d.ts +3 -3
- package/api/workbench-helpers.js +3 -3
- package/api/workbench-routes.d.ts +2 -2
- package/api/workbench-vfs-routes.d.ts +1 -1
- package/api/ws-event-replay.d.ts +1 -2
- package/api/ws-event-replay.d.ts.map +1 -1
- package/api/ws-event-replay.js +1 -2
- package/api/x-relay-routes.d.ts +2 -2
- package/api/x402-route-validation.d.ts +4 -0
- package/api/x402-route-validation.d.ts.map +1 -0
- package/api/x402-route-validation.js +6 -0
- package/assets/view-heroes/background.png +0 -0
- package/auth/account-storage.d.ts +1 -1
- package/auth/anthropic.d.ts +1 -1
- package/auth/credentials.d.ts +2 -2
- package/auth/index.d.ts +7 -7
- package/auth/oauth-flow.d.ts +2 -2
- package/auth/openai-codex.d.ts +1 -1
- package/awareness/index.d.ts +1 -1
- package/config/config.js +0 -1
- package/config/env-vars.d.ts +1 -1
- package/config/env-vars.d.ts.map +1 -1
- package/config/env-vars.js +0 -1
- package/config/index.d.ts +10 -10
- package/config/model-metadata.d.ts +1 -1
- package/config/owner-contacts.d.ts +1 -1
- package/config/schema.d.ts +1 -1
- package/hooks/discovery.d.ts +1 -1
- package/hooks/eligibility.d.ts +2 -2
- package/hooks/index.d.ts +2 -2
- package/hooks/loader.d.ts +2 -2
- package/hooks/registry.d.ts +1 -1
- package/index.d.ts +87 -85
- package/index.d.ts.map +1 -1
- package/index.js +11 -3
- package/package.json +54 -44
- package/providers/media-provider.d.ts +1 -1
- package/providers/page-scoped-context.d.ts.map +1 -1
- package/providers/page-scoped-context.js +1 -70
- package/providers/relevant-conversations.d.ts.map +1 -1
- package/providers/relevant-conversations.js +8 -9
- package/providers/workspace.d.ts +1 -1
- package/runtime/actions/web-fetch.d.ts.map +1 -1
- package/runtime/actions/web-fetch.js +23 -3
- package/runtime/actions/web-search.d.ts +32 -0
- package/runtime/actions/web-search.d.ts.map +1 -0
- package/runtime/actions/web-search.js +245 -0
- package/runtime/advanced-capabilities-config.d.ts +1 -1
- package/runtime/boot-telemetry.d.ts +1 -1
- package/runtime/conversation-compactor-runtime.d.ts +1 -1
- package/runtime/conversation-compactor-runtime.js +1 -1
- package/runtime/conversation-compactor.d.ts +1 -1
- package/runtime/core-plugins.d.ts.map +1 -1
- package/runtime/core-plugins.js +9 -0
- package/runtime/custom-actions.d.ts +18 -9
- package/runtime/custom-actions.d.ts.map +1 -1
- package/runtime/custom-actions.js +85 -23
- package/runtime/eliza-plugin.d.ts.map +1 -1
- package/runtime/eliza-plugin.js +15 -1
- package/runtime/eliza.d.ts +9 -7
- package/runtime/eliza.d.ts.map +1 -1
- package/runtime/eliza.js +86 -23
- package/runtime/first-time-setup.d.ts +1 -3
- package/runtime/first-time-setup.d.ts.map +1 -1
- package/runtime/first-time-setup.js +0 -2
- package/runtime/index.d.ts +18 -18
- package/runtime/load-plugin-from-vfs.d.ts +2 -2
- package/runtime/mobile-dns.d.ts.map +1 -1
- package/runtime/mobile-dns.js +2 -5
- package/runtime/operations/classifier.d.ts +1 -1
- package/runtime/operations/cold-strategy.d.ts +1 -1
- package/runtime/operations/health-checks.d.ts +1 -1
- package/runtime/operations/health.d.ts +1 -1
- package/runtime/operations/index.d.ts +10 -10
- package/runtime/operations/manager.d.ts +3 -3
- package/runtime/operations/reload-hot.d.ts +1 -1
- package/runtime/operations/repository.d.ts +1 -1
- package/runtime/operations/vault-bridge.d.ts +1 -1
- package/runtime/plugin-collector.d.ts +6 -1
- package/runtime/plugin-collector.d.ts.map +1 -1
- package/runtime/plugin-collector.js +11 -28
- package/runtime/plugin-lifecycle.d.ts.map +1 -1
- package/runtime/plugin-lifecycle.js +1 -0
- package/runtime/plugin-resolver.d.ts +2 -2
- package/runtime/plugin-resolver.d.ts.map +1 -1
- package/runtime/plugin-resolver.js +113 -65
- package/runtime/plugin-types.d.ts +1 -1
- package/runtime/prompt-optimization.d.ts +4 -4
- package/runtime/remote-coding-runner-gate.d.ts +7 -0
- package/runtime/remote-coding-runner-gate.d.ts.map +1 -0
- package/runtime/remote-coding-runner-gate.js +36 -0
- package/runtime/roles/src/index.d.ts +4 -4
- package/runtime/roles.d.ts +2 -2
- package/runtime/sandbox-character.d.ts +1 -1
- package/runtime/tool-call-cache/cache.d.ts +1 -1
- package/runtime/tool-call-cache/disk-store.d.ts +1 -1
- package/runtime/tool-call-cache/index.d.ts +6 -6
- package/runtime/tool-call-cache/key.d.ts +1 -1
- package/runtime/tool-call-cache/redact.d.ts +1 -1
- package/runtime/tool-call-cache/registry.d.ts +1 -1
- package/runtime/tool-call-cache-wrapper.d.ts +7 -9
- package/runtime/tool-call-cache-wrapper.d.ts.map +1 -1
- package/runtime/tool-call-cache-wrapper.js +6 -11
- package/runtime/trajectory-export.d.ts +3 -3
- package/runtime/trajectory-internals.d.ts +2 -1
- package/runtime/trajectory-internals.d.ts.map +1 -1
- package/runtime/trajectory-persistence.d.ts +5 -5
- package/runtime/trajectory-steps-reader.d.ts +1 -1
- package/runtime/trajectory-steps-writer.d.ts +1 -1
- package/runtime/trajectory-storage.d.ts +4 -4
- package/runtime/view-action-affinity.d.ts +18 -15
- package/runtime/view-action-affinity.d.ts.map +1 -1
- package/runtime/view-action-affinity.js +26 -29
- package/runtime/web-search-tools.d.ts +4 -1
- package/runtime/web-search-tools.d.ts.map +1 -1
- package/runtime/web-search-tools.js +37 -9
- package/security/index.d.ts +3 -3
- package/services/approval/index.d.ts +9 -0
- package/services/approval/index.d.ts.map +1 -0
- package/services/approval/index.js +8 -0
- package/services/approval/service.d.ts +35 -0
- package/services/approval/service.d.ts.map +1 -0
- package/services/approval/service.js +40 -0
- package/services/approval/sql.d.ts +18 -0
- package/services/approval/sql.d.ts.map +1 -0
- package/services/approval/sql.js +104 -0
- package/services/approval/store.d.ts +39 -0
- package/services/approval/store.d.ts.map +1 -0
- package/services/approval/store.js +534 -0
- package/services/approval/types.d.ts +207 -0
- package/services/approval/types.d.ts.map +1 -0
- package/services/approval/types.js +34 -0
- package/services/character-persistence.d.ts +2 -2
- package/services/client-chat-sender.d.ts +1 -1
- package/services/config-plugin-manager.d.ts +2 -2
- package/services/connector-setup-service.d.ts +1 -1
- package/services/cove-quote-x509.d.ts +1 -1
- package/services/cove-quote.d.ts +2 -2
- package/services/dstack-tee-provider.d.ts +1 -1
- package/services/file-storage.d.ts +20 -0
- package/services/file-storage.d.ts.map +1 -0
- package/services/file-storage.js +70 -0
- package/services/global-pause/index.d.ts +8 -0
- package/services/global-pause/index.d.ts.map +1 -0
- package/services/global-pause/index.js +7 -0
- package/services/global-pause/service.d.ts +29 -0
- package/services/global-pause/service.d.ts.map +1 -0
- package/services/global-pause/service.js +34 -0
- package/services/global-pause/store.d.ts +31 -0
- package/services/global-pause/store.d.ts.map +1 -0
- package/services/global-pause/store.js +83 -0
- package/services/handoff/index.d.ts +8 -0
- package/services/handoff/index.d.ts.map +1 -0
- package/services/handoff/index.js +7 -0
- package/services/handoff/service.d.ts +29 -0
- package/services/handoff/service.d.ts.map +1 -0
- package/services/handoff/service.js +34 -0
- package/services/handoff/store.d.ts +76 -0
- package/services/handoff/store.d.ts.map +1 -0
- package/services/handoff/store.js +148 -0
- package/services/index.d.ts +30 -31
- package/services/index.d.ts.map +1 -1
- package/services/index.js +0 -6
- package/services/js-runtime-bridge.d.ts.map +1 -1
- package/services/js-runtime-bridge.js +8 -2
- package/services/knowledge-graph/index.d.ts +4 -4
- package/services/knowledge-graph/service.d.ts +2 -2
- package/services/pending-prompts/index.d.ts +8 -0
- package/services/pending-prompts/index.d.ts.map +1 -0
- package/services/pending-prompts/index.js +7 -0
- package/services/pending-prompts/service.d.ts +34 -0
- package/services/pending-prompts/service.d.ts.map +1 -0
- package/services/pending-prompts/service.js +68 -0
- package/services/pending-prompts/store.d.ts +70 -0
- package/services/pending-prompts/store.d.ts.map +1 -0
- package/services/pending-prompts/store.js +191 -0
- package/services/plugin-compiler.d.ts +1 -1
- package/services/plugin-installer.d.ts.map +1 -1
- package/services/plugin-installer.js +21 -11
- package/services/plugin-manager-types.d.ts +1 -1
- package/services/proactive-interaction-decider.d.ts +62 -11
- package/services/proactive-interaction-decider.d.ts.map +1 -1
- package/services/proactive-interaction-decider.js +223 -35
- package/services/push/apns-provider.d.ts +1 -1
- package/services/push/fcm-provider.d.ts +1 -1
- package/services/push/notification-push-service.d.ts +2 -2
- package/services/registry-client-app-meta.d.ts +1 -1
- package/services/registry-client-endpoints.d.ts +2 -2
- package/services/registry-client-local.d.ts +1 -1
- package/services/registry-client-network.d.ts +1 -1
- package/services/registry-client-queries.d.ts +1 -1
- package/services/registry-client.d.ts +3 -3
- package/services/relationships-graph.d.ts +1 -1
- package/services/remote-capability-cloud-sandbox.d.ts +3 -3
- package/services/remote-capability-endpoint-conformance.d.ts +1 -1
- package/services/remote-capability-endpoint-provider.d.ts +4 -4
- package/services/remote-capability-url-endpoint-providers.d.ts +1 -1
- package/services/remote-plugin-adapter.d.ts.map +1 -1
- package/services/remote-plugin-adapter.js +3 -0
- package/services/remote-plugin-bridge.d.ts.map +1 -1
- package/services/remote-plugin-bridge.js +97 -26
- package/services/remote-signing-service.d.ts +4 -4
- package/services/research-task-executor.d.ts +1 -1
- package/services/sandbox-manager.d.ts +1 -1
- package/services/self-updater.d.ts +1 -1
- package/services/self-updater.d.ts.map +1 -1
- package/services/self-updater.js +23 -9
- package/services/shell-execution-router.d.ts +1 -1
- package/services/shell-execution-router.d.ts.map +1 -1
- package/services/shell-execution-router.js +19 -2
- package/services/tee-boot-gate-state.d.ts +1 -1
- package/services/tee-boot-gate.d.ts +4 -4
- package/services/tee-confidential-inference.d.ts +3 -3
- package/services/tee-key-release.d.ts +2 -2
- package/services/tee-model-key-boot.d.ts +4 -4
- package/services/tee-policy.d.ts +1 -1
- package/services/tee-production-profile.d.ts +1 -1
- package/services/tee-release-policy.d.ts +1 -1
- package/services/tee-revocation.d.ts +2 -2
- package/services/tee-runtime-config.d.ts +1 -1
- package/services/tee-sealed-volume.d.ts +3 -3
- package/services/tee-signer-backend.d.ts +3 -3
- package/services/update-checker.d.ts +1 -1
- package/services/vault-signer-backend.d.ts +1 -1
- package/services/vfs-git.d.ts +1 -1
- package/test-support/index.d.ts +3 -3
- package/triggers/runtime.d.ts +1 -1
- package/triggers/scheduling.d.ts +3 -22
- package/triggers/scheduling.d.ts.map +1 -1
- package/triggers/scheduling.js +2 -214
- package/tui/agent-terminal-tui.d.ts.map +1 -1
- package/tui/agent-terminal-tui.js +174 -72
- package/types/index.d.ts +3 -3
- package/api/nfa-routes.d.ts +0 -6
- package/api/nfa-routes.d.ts.map +0 -1
- package/api/nfa-routes.js +0 -125
- package/api/server-auth.d.ts +0 -46
- package/api/server-auth.d.ts.map +0 -1
- package/api/server-auth.js +0 -504
- package/runtime/restart.d.ts +0 -9
- package/runtime/restart.d.ts.map +0 -1
- package/runtime/restart.js +0 -8
- package/test-utils/sqlite-compat.d.ts +0 -23
- package/test-utils/sqlite-compat.d.ts.map +0 -1
- package/test-utils/sqlite-compat.js +0 -214
package/api/server.js
CHANGED
|
@@ -25,12 +25,12 @@ function tokenMatches(expected, provided) {
|
|
|
25
25
|
}
|
|
26
26
|
const MAX_BODY_BYTES = 1024 * 1024; // 1 MB
|
|
27
27
|
import path from "node:path";
|
|
28
|
-
import {
|
|
29
|
-
import { isStreamingDestinationConfigured, logger, readJsonBody as parseJsonBody, readRequestBody, sendJson, sendJsonError, stringToUuid, } from "@elizaos/core";
|
|
28
|
+
import { isStreamingDestinationConfigured, logger, NotificationService, readJsonBody as parseJsonBody, readRequestBody, ServiceType, sendJson, sendJsonError, stringToUuid, } from "@elizaos/core";
|
|
30
29
|
import { getStylePresets, normalizeCharacterLanguage, resolveStylePresetByAvatarIndex, } from "@elizaos/shared/character-presets";
|
|
31
30
|
import { isMobilePlatform, resolveApiBindHost, resolveDesktopApiPort, resolveServerOnlyPort, } from "@elizaos/shared/runtime-env";
|
|
32
31
|
import { parseClampedInteger } from "@elizaos/shared/utils/number-parsing";
|
|
33
32
|
import { WebSocketServer } from "ws";
|
|
33
|
+
import { installPlugin as installPluginDirect } from "../services/plugin-installer.js";
|
|
34
34
|
let browserPluginModule = null;
|
|
35
35
|
let x402PluginModule = null;
|
|
36
36
|
let browserPluginModulePromise = null;
|
|
@@ -145,7 +145,24 @@ function getLocalInferenceServerApi() {
|
|
|
145
145
|
return localInferenceServerApiPromise;
|
|
146
146
|
}
|
|
147
147
|
async function getOptionalPluginApi(key) {
|
|
148
|
-
|
|
148
|
+
try {
|
|
149
|
+
return (await optionalPluginImports[key]());
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
// The plugin is optional and not in this bundle (on mobile, many
|
|
153
|
+
// desktop/cloud plugins — cloud, whatsapp, wallet-adjacent, mcp,
|
|
154
|
+
// streaming, … — are excluded). Its dynamic import REJECTS with a
|
|
155
|
+
// ResolveMessage; without this catch that rejection propagates to the
|
|
156
|
+
// top-level request handler as a 500 on EVERY renderer poll of the
|
|
157
|
+
// plugin's routes. Return a Proxy of no-op handlers so route-dispatch
|
|
158
|
+
// blocks (`if (await handleX(...)) return;`) fall through to the normal
|
|
159
|
+
// 404/fallback instead of erroring. On desktop/server the import succeeds,
|
|
160
|
+
// so this branch never runs there.
|
|
161
|
+
logger.debug(`[eliza-api] optional plugin '${key}' unavailable in this bundle: ${err instanceof Error ? err.message : String(err)}`);
|
|
162
|
+
return new Proxy({}, {
|
|
163
|
+
get: () => () => false,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
149
166
|
}
|
|
150
167
|
let agentSkillsApiPromise;
|
|
151
168
|
function getAgentSkillsApi() {
|
|
@@ -161,7 +178,14 @@ function getAppManagerApi() {
|
|
|
161
178
|
}
|
|
162
179
|
let walletApiPromise;
|
|
163
180
|
function getWalletApi() {
|
|
164
|
-
walletApiPromise ??= importOptionalPlugin("@elizaos/plugin-wallet")
|
|
181
|
+
walletApiPromise ??= importOptionalPlugin("@elizaos/plugin-wallet").catch((err) => {
|
|
182
|
+
// plugin-wallet is desktop/cloud-only; on mobile it is not in the bundle so
|
|
183
|
+
// this import REJECTS. Cache a no-op proxy so /api/wallet/* falls through to
|
|
184
|
+
// 404 instead of 500ing on every renderer poll. Desktop imports succeed, so
|
|
185
|
+
// this never runs there.
|
|
186
|
+
logger.debug(`[eliza-api] plugin-wallet unavailable in this bundle: ${err instanceof Error ? err.message : String(err)}`);
|
|
187
|
+
return new Proxy({}, { get: () => () => false });
|
|
188
|
+
});
|
|
165
189
|
return walletApiPromise;
|
|
166
190
|
}
|
|
167
191
|
let coreWalletApiPromise;
|
|
@@ -172,7 +196,7 @@ function getCoreWalletApi() {
|
|
|
172
196
|
let pluginRegistryApiPromise;
|
|
173
197
|
function getPluginRegistryApi() {
|
|
174
198
|
pluginRegistryApiPromise ??= import(
|
|
175
|
-
/* @vite-ignore */ "@elizaos/plugin-registry");
|
|
199
|
+
/* @vite-ignore */ "@elizaos/plugin-registry/api/plugin-routes");
|
|
176
200
|
return pluginRegistryApiPromise;
|
|
177
201
|
}
|
|
178
202
|
import { getGlobalAwarenessRegistry } from "../awareness/registry.js";
|
|
@@ -202,11 +226,12 @@ import { pushWithBatchEvict } from "./memory-bounds.js";
|
|
|
202
226
|
import { createRuntimeReadyGate } from "./runtime-ready-gate.js";
|
|
203
227
|
import { cloneWithoutBlockedObjectKeys, decodePathComponent, hasPersistedFirstRunState, isUuidLike, patchTouchesProviderSelection, } from "./server-helpers.js";
|
|
204
228
|
import { routeAutonomyTextToUser as routeProactiveText } from "./server-helpers-swarm.js";
|
|
205
|
-
import { createConnectorHealthMonitor, extractConversationMetadataFromRoom, handleAccountsRoutes, handleAgentAdminRoutes, handleAgentLifecycleRoutes, handleAgentStatusRoutes, handleAgentTransferRoutes, handleAppPackageRoutes, handleAuthRoutes, handleAvatarRoutes, handleBackgroundTasksRoute, handleBugReportRoutes, handleCharacterRoutes, handleCloudAndCoreRouteGroup, handleCommandsRoutes, handleConfigRoutes, handleConnectorRoutes, handleConversationRouteGroup, handleDatabaseRouteGroup, handleDiagnosticsRoutes, handleFirstRunRoutes, handleHealthRoutes, handleInboxAndCloudRelayRouteGroup, handleLifeOpsRuntimePluginRoute, handleMemoryRoutes, handleMiscRoutes, handleMobileOptionalRoutes, handleModelsRoutes, handlePermissionRoutes, handlePermissionsExtraRoutes, handleProviderSwitchRoutes, handleRegistryRoutes, handleRelationshipsRoutes, handleRemoteCapabilityRoutes, handleSandboxRouteGroup, handleSubscriptionRoutes, handleSuggestionsRoutes, handleUpdateRoutes, handleViewsRoutes, handleWorkbenchRoutes, isPublicRuntimePluginRoute, registerBuiltinViews, tryHandleHonoRuntimeRoute, tryHandleMusicPlayerStatusFallbackLazy, tryHandleRuntimePluginRoute, } from "./server-lazy-routes.js";
|
|
229
|
+
import { createConnectorHealthMonitor, extractConversationMetadataFromRoom, handleAccountsRoutes, handleAgentAdminRoutes, handleAgentLifecycleRoutes, handleAgentStatusRoutes, handleAgentTransferRoutes, handleAppPackageRoutes, handleAuthRoutes, handleAvatarRoutes, handleBackgroundTasksRoute, handleBugReportRoutes, handleCharacterRoutes, handleCloudAndCoreRouteGroup, handleCommandsRoutes, handleConfigRoutes, handleConnectorRoutes, handleConversationRouteGroup, handleDatabaseRouteGroup, handleDiagnosticsRoutes, handleFirstRunRoutes, handleHealthRoutes, handleInboxAndCloudRelayRouteGroup, handleInteractionsRoutes, handleLifeOpsRuntimePluginRoute, handleMemoryRoutes, handleMiscRoutes, handleMobileOptionalRoutes, handleModelsRoutes, handlePermissionRoutes, handlePermissionsExtraRoutes, handleProviderSwitchRoutes, handleRegistryRoutes, handleRelationshipsRoutes, handleRemoteCapabilityRoutes, handleSandboxRouteGroup, handleSubscriptionRoutes, handleSuggestionsRoutes, handleUpdateRoutes, handleViewsRoutes, handleWorkbenchRoutes, isPublicRuntimePluginRoute, registerBuiltinViews, tryHandleHonoRuntimeRoute, tryHandleMusicPlayerStatusFallbackLazy, tryHandleRuntimePluginRoute, } from "./server-lazy-routes.js";
|
|
206
230
|
import { tryHandleTrajectoryFallback } from "./trajectory-fallback-routes.js";
|
|
207
231
|
import { EVM_PLUGIN_PACKAGE, resolveWalletAutomationMode as resolveAgentAutomationModeFromConfig, resolveWalletCapabilityStatus, } from "./wallet-capability.js";
|
|
208
232
|
import { applyWalletRpcConfigUpdate, getStoredWalletRpcSelections, resolveWalletNetworkMode, resolveWalletRpcReadiness, } from "./wallet-rpc.js";
|
|
209
233
|
import { DEFAULT_REPLAY_LIMIT, parseEventCursor, selectReplayEvents, } from "./ws-event-replay.js";
|
|
234
|
+
import { runtimeRoutesNeedX402Validation } from "./x402-route-validation.js";
|
|
210
235
|
export { executeFallbackParsedActions, inferBalanceChainFromText, isBalanceIntent, maybeHandleDirectBinanceSkillRequest, parseFallbackActionBlocks, shouldForceCheckBalanceFallback, } from "./binance-skill-helpers.js";
|
|
211
236
|
export { isClientVisibleNoResponse, isNoResponsePlaceholder, stripAssistantStageDirections, } from "./chat-text-helpers.js";
|
|
212
237
|
export { cloneWithoutBlockedObjectKeys, decodePathComponent, findOwnPackageRoot, getErrorMessage, isUuidLike, persistConversationRoomTitle, } from "./server-helpers.js";
|
|
@@ -1012,15 +1037,45 @@ export { handleSwarmSynthesis, routeAutonomyTextToUser, } from "./server-helpers
|
|
|
1012
1037
|
// One process-wide governance gate shared across runtime (re)registrations, so a
|
|
1013
1038
|
// restart doesn't reset the proactive-comment cooldowns/caps (#8792).
|
|
1014
1039
|
const proactiveInteractionGate = new ProactiveInteractionGate();
|
|
1040
|
+
function proactiveNotificationGroupKey(offer) {
|
|
1041
|
+
if (offer.groupKey)
|
|
1042
|
+
return offer.groupKey;
|
|
1043
|
+
const basis = (offer.deepLink || offer.title || offer.text)
|
|
1044
|
+
.toLowerCase()
|
|
1045
|
+
.replace(/[^a-z0-9:/._-]+/g, "-")
|
|
1046
|
+
.replace(/^-+|-+$/g, "")
|
|
1047
|
+
.slice(0, 72);
|
|
1048
|
+
return `proactive-interaction:${basis || "general"}`;
|
|
1049
|
+
}
|
|
1050
|
+
async function notifyProactiveInteraction(rt, offer) {
|
|
1051
|
+
const service = rt.getService(ServiceType.NOTIFICATION);
|
|
1052
|
+
if (!(service instanceof NotificationService)) {
|
|
1053
|
+
logger.debug("[proactive-interaction] notification service unavailable; suppressing notify-lane offer");
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
const title = offer.title?.trim() || offer.text;
|
|
1057
|
+
await service.notify({
|
|
1058
|
+
title,
|
|
1059
|
+
body: title === offer.text ? undefined : offer.text,
|
|
1060
|
+
category: "agent",
|
|
1061
|
+
priority: "low",
|
|
1062
|
+
source: PROACTIVE_INTERACTION_SOURCE,
|
|
1063
|
+
deepLink: offer.deepLink,
|
|
1064
|
+
groupKey: proactiveNotificationGroupKey(offer),
|
|
1065
|
+
data: { kind: "proactive-interaction" },
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1015
1068
|
/**
|
|
1016
1069
|
* Wire the proactive-interaction decider (#8792): subscribe to VIEW_SWITCHED and
|
|
1017
|
-
* route an admitted, model-judged
|
|
1018
|
-
*
|
|
1070
|
+
* route an admitted, model-judged offer into chat suggestions or low-priority
|
|
1071
|
+
* notifications. No-ops when disabled by config/kill-switch.
|
|
1019
1072
|
*/
|
|
1020
1073
|
function wireProactiveInteractionDecider(rt, state) {
|
|
1021
1074
|
registerProactiveInteractionDecider(rt, {
|
|
1022
1075
|
gate: proactiveInteractionGate,
|
|
1023
1076
|
route: (text) => routeProactiveText(state, text, PROACTIVE_INTERACTION_SOURCE),
|
|
1077
|
+
notify: (offer) => notifyProactiveInteraction(rt, offer),
|
|
1078
|
+
shouldSuppress: () => state.activeChatTurnCount > 0,
|
|
1024
1079
|
});
|
|
1025
1080
|
}
|
|
1026
1081
|
async function handleRequest(req, res, state, ctx) {
|
|
@@ -1038,9 +1093,17 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
1038
1093
|
const isHealthEndpoint = method === "GET" && pathname === "/api/health";
|
|
1039
1094
|
let isCloudProvisionedContainer = () => false;
|
|
1040
1095
|
let handleCloudStatusRoutes = async (_args) => false;
|
|
1041
|
-
if (
|
|
1042
|
-
|
|
1043
|
-
|
|
1096
|
+
if (
|
|
1097
|
+
// plugin-elizacloud is desktop/cloud-only; on mobile its dynamic import
|
|
1098
|
+
// does not resolve and the resulting await stalls the whole request (the
|
|
1099
|
+
// /api/cloud, /api/coding-agents, and cloud-first-run paths then hang).
|
|
1100
|
+
// Skip the import on mobile — the default no-op cloud helpers above keep
|
|
1101
|
+
// isCloudProvisioned=false (correct for a local mobile agent) and let the
|
|
1102
|
+
// request fall through to its normal handler/404.
|
|
1103
|
+
!isMobilePlatform() &&
|
|
1104
|
+
(pathname === "/api/first-run/status" ||
|
|
1105
|
+
pathname.startsWith("/api/cloud") ||
|
|
1106
|
+
pathname.startsWith("/api/coding-agents"))) {
|
|
1044
1107
|
const cloudApi = await getOptionalPluginApi("cloud");
|
|
1045
1108
|
isCloudProvisionedContainer = cloudApi.isCloudProvisionedContainer;
|
|
1046
1109
|
handleCloudStatusRoutes = cloudApi.handleCloudStatusRoutes;
|
|
@@ -1159,8 +1222,16 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
1159
1222
|
// and wedging the dashboard at "Connecting to backend…". The route is a
|
|
1160
1223
|
// cloud-SSO handoff that a local on-device agent never legitimately serves,
|
|
1161
1224
|
// so skipping it when unavailable is safe.
|
|
1162
|
-
|
|
1163
|
-
|
|
1225
|
+
// Dynamic import (matching the account-pool / vault-mirror seams in this
|
|
1226
|
+
// package) so agent never *statically* imports @elizaos/app-core: the static
|
|
1227
|
+
// import was what produced the circular re-export init-order `undefined`
|
|
1228
|
+
// above, and it is the build-time edge that puts @elizaos/app-core <->
|
|
1229
|
+
// @elizaos/agent in a Turbo dependency cycle (#9626). `.catch(() => null)`
|
|
1230
|
+
// keeps the on-device path graceful when app-core isn't present at all.
|
|
1231
|
+
const cloudPairMod = await import(
|
|
1232
|
+
/* @vite-ignore */ "@elizaos/app-core/api/cloud-pair-route").catch(() => null);
|
|
1233
|
+
if (typeof cloudPairMod?.handleCloudPairRoute === "function" &&
|
|
1234
|
+
(await cloudPairMod.handleCloudPairRoute(req, res))) {
|
|
1164
1235
|
return;
|
|
1165
1236
|
}
|
|
1166
1237
|
// Serve dashboard static assets before the auth gates. serveStaticUi already
|
|
@@ -1239,7 +1310,13 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
1239
1310
|
})) {
|
|
1240
1311
|
return;
|
|
1241
1312
|
}
|
|
1242
|
-
|
|
1313
|
+
// Computer-use is a desktop/cloud-only plugin; on mobile it is not in the
|
|
1314
|
+
// agent bundle, so importing it here would REJECT (`Cannot find module
|
|
1315
|
+
// '@elizaos/plugin-computeruse'`) and surface as a 500 on every renderer poll
|
|
1316
|
+
// of /api/computer-use/approvals. Skip the import path on mobile and let the
|
|
1317
|
+
// request fall through to handleMobileOptionalRoutes, which serves the inert
|
|
1318
|
+
// {mode:"off",…} approval snapshot.
|
|
1319
|
+
if (!isMobilePlatform() && pathname.startsWith("/api/computer-use/")) {
|
|
1243
1320
|
const { handleComputerUseRoutes } = await getOptionalPluginApi("computerUse");
|
|
1244
1321
|
if (await handleComputerUseRoutes(req, res, pathname, method))
|
|
1245
1322
|
return;
|
|
@@ -1756,7 +1833,10 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
1756
1833
|
// steward-app bridge can pull browser/UI-only dependencies into the agent
|
|
1757
1834
|
// process and must not block local assistant boot.
|
|
1758
1835
|
// ═══════════════════════════════════════════════════════════════════════
|
|
1759
|
-
|
|
1836
|
+
// plugin-wallet is desktop/cloud-only; on mobile its import does not resolve
|
|
1837
|
+
// and the await stalls /api/wallet/* requests. Skip on mobile → fall through
|
|
1838
|
+
// to 404 (the mobile agent has no EVM/Solana wallet surface anyway).
|
|
1839
|
+
if (!isMobilePlatform() && pathname.startsWith("/api/wallet/")) {
|
|
1760
1840
|
const { handleWalletRoutes } = await getWalletApi();
|
|
1761
1841
|
const { deriveSolanaAddress, fetchEvmBalances, fetchSolanaBalances, fetchSolanaNativeBalanceViaRpc, generateWalletForChain, getWalletAddresses, importWallet, setSolanaWalletEnv, validatePrivateKey, } = await getCoreWalletApi();
|
|
1762
1842
|
if (await handleWalletRoutes({
|
|
@@ -2112,7 +2192,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
2112
2192
|
detachRun: (runId) => appManager.detachRun(runId),
|
|
2113
2193
|
launch: (pluginManager, name, onProgress, runtime) => appManager.launch(pluginManager, name, onProgress, runtime && typeof runtime === "object"
|
|
2114
2194
|
? runtime
|
|
2115
|
-
: null),
|
|
2195
|
+
: null, installPluginDirect),
|
|
2116
2196
|
stop: (pluginManager, name, runId, runtime) => appManager.stop(pluginManager, name, runId, runtime && typeof runtime === "object"
|
|
2117
2197
|
? runtime
|
|
2118
2198
|
: null),
|
|
@@ -2130,6 +2210,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
2130
2210
|
read: () => readFavoriteAppsFromConfig(state.config),
|
|
2131
2211
|
write: (apps) => writeFavoriteAppsToConfig(state.config, apps),
|
|
2132
2212
|
},
|
|
2213
|
+
installPluginDirect,
|
|
2133
2214
|
})) {
|
|
2134
2215
|
return;
|
|
2135
2216
|
}
|
|
@@ -2172,6 +2253,18 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
2172
2253
|
})) {
|
|
2173
2254
|
return;
|
|
2174
2255
|
}
|
|
2256
|
+
// ── Interaction reporting (/api/interactions/shortcut) ────────────────────
|
|
2257
|
+
if (await handleInteractionsRoutes({
|
|
2258
|
+
req,
|
|
2259
|
+
res,
|
|
2260
|
+
method,
|
|
2261
|
+
pathname,
|
|
2262
|
+
json,
|
|
2263
|
+
error,
|
|
2264
|
+
runtime: state.runtime,
|
|
2265
|
+
})) {
|
|
2266
|
+
return;
|
|
2267
|
+
}
|
|
2175
2268
|
// ── View routes (/api/views/*) ────────────────────────────────────────────
|
|
2176
2269
|
if (await handleViewsRoutes({
|
|
2177
2270
|
req,
|
|
@@ -2472,6 +2565,7 @@ export async function startApiServer(opts) {
|
|
|
2472
2565
|
chatConnectionPromise: null,
|
|
2473
2566
|
adminEntityId: null,
|
|
2474
2567
|
conversations: new Map(),
|
|
2568
|
+
activeChatTurnCount: 0,
|
|
2475
2569
|
conversationRestorePromise: null,
|
|
2476
2570
|
deletedConversationIds,
|
|
2477
2571
|
cloudManager: null,
|
|
@@ -3591,7 +3685,7 @@ export async function startApiServer(opts) {
|
|
|
3591
3685
|
wireProactiveInteractionDecider(opts.runtime, state);
|
|
3592
3686
|
}
|
|
3593
3687
|
const assertX402RoutesValid = async (rt) => {
|
|
3594
|
-
if (!rt
|
|
3688
|
+
if (!rt || !runtimeRoutesNeedX402Validation(rt.routes))
|
|
3595
3689
|
return;
|
|
3596
3690
|
const agentId = rt.agentId != null && String(rt.agentId).length > 0
|
|
3597
3691
|
? String(rt.agentId)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Static file serving for the built React dashboard (production mode).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Serves packages/app/dist/ with SPA fallback, caching, and API-base
|
|
5
|
+
* injection for reverse-proxy deployments.
|
|
6
6
|
*/
|
|
7
7
|
import type http from "node:http";
|
|
8
8
|
export declare function resolveUiDir(): string | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Static file serving for the built React dashboard (production mode).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Serves packages/app/dist/ with SPA fallback, caching, and API-base
|
|
5
|
+
* injection for reverse-proxy deployments.
|
|
6
6
|
*/
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type RouteRequestContext } from "@elizaos/core";
|
|
2
|
-
import type { AnthropicFlow } from "../auth/anthropic.
|
|
3
|
-
import type { CodexFlow } from "../auth/openai-codex.
|
|
4
|
-
import type { ElizaConfig } from "../config/types.eliza.
|
|
5
|
-
type AuthModule = typeof import("../auth/index.
|
|
2
|
+
import type { AnthropicFlow } from "../auth/anthropic.js";
|
|
3
|
+
import type { CodexFlow } from "../auth/openai-codex.js";
|
|
4
|
+
import type { ElizaConfig } from "../config/types.eliza.js";
|
|
5
|
+
type AuthModule = typeof import("../auth/index.js");
|
|
6
6
|
export type SubscriptionAuthApi = Pick<AuthModule, "getSubscriptionStatus" | "startAnthropicLogin" | "startCodexLogin" | "saveCredentials" | "applySubscriptionCredentials" | "deleteCredentials" | "deleteProviderCredentials">;
|
|
7
7
|
export interface SubscriptionRouteState {
|
|
8
8
|
config: ElizaConfig;
|
|
@@ -267,16 +267,15 @@ function subscriptionSelectionIdForStoredProvider(provider) {
|
|
|
267
267
|
/**
|
|
268
268
|
* Read rich `LinkedAccountConfig` rows from the AccountPool singleton.
|
|
269
269
|
* The pool is the single source of truth — it joins on-disk credential
|
|
270
|
-
* records with the metadata overlay file. Loaded
|
|
271
|
-
*
|
|
272
|
-
* other way around.
|
|
270
|
+
* records with the metadata overlay file. Loaded from the account-pool leaf
|
|
271
|
+
* subpath so subscription routes do not evaluate the app-core barrel.
|
|
273
272
|
*/
|
|
274
273
|
async function readRichLinkedAccountsFromPool() {
|
|
275
274
|
try {
|
|
276
275
|
// String-literal dynamic import — see comment in
|
|
277
276
|
// ../runtime/eliza.ts#importAppCoreRuntime for the AOSP bundle issue.
|
|
278
277
|
const mod = (await import(
|
|
279
|
-
/* @vite-ignore */ "@elizaos/app-core"));
|
|
278
|
+
/* @vite-ignore */ "@elizaos/app-core/account-pool"));
|
|
280
279
|
const pool = mod.getDefaultAccountPool();
|
|
281
280
|
const out = {};
|
|
282
281
|
for (const account of pool.list()) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the continuous-chat overlay's resting composer strip (#8225).
|
|
4
4
|
*
|
|
5
5
|
* The client sends recent conversation context, the local hour, and the
|
|
6
|
-
* active page scope ("page-
|
|
6
|
+
* active page scope ("page-wallet", "page-browser", …). Two tiers:
|
|
7
7
|
*
|
|
8
8
|
* - `model` — the small text model writes EXACTLY 3 short, first-person
|
|
9
9
|
* prompts tailored to the character, the conversation, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-routes.d.ts","sourceRoot":"","sources":["../../src/api/suggestions-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,eAAe,CAAC;AAYvB,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;IAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAQD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAyChE;
|
|
1
|
+
{"version":3,"file":"suggestions-routes.d.ts","sourceRoot":"","sources":["../../src/api/suggestions-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,eAAe,CAAC;AAYvB,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;IAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAQD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAyChE;AA4DD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,kBAAkB,GAC1B,MAAM,EAAE,CAQV;AAkFD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAoBzD;AA4BD,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,uBAAuB,GAC3B,OAAO,CAAC,OAAO,CAAC,CA2ClB"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the continuous-chat overlay's resting composer strip (#8225).
|
|
4
4
|
*
|
|
5
5
|
* The client sends recent conversation context, the local hour, and the
|
|
6
|
-
* active page scope ("page-
|
|
6
|
+
* active page scope ("page-wallet", "page-browser", …). Two tiers:
|
|
7
7
|
*
|
|
8
8
|
* - `model` — the small text model writes EXACTLY 3 short, first-person
|
|
9
9
|
* prompts tailored to the character, the conversation, and
|
|
@@ -102,7 +102,6 @@ const SCOPE_STARTERS = {
|
|
|
102
102
|
"Suggest a plugin",
|
|
103
103
|
"Configure a plugin",
|
|
104
104
|
],
|
|
105
|
-
"page-lifeops": ["Plan my day", "What's on my plate?", "Review my reminders"],
|
|
106
105
|
"page-settings": [
|
|
107
106
|
"Review my settings",
|
|
108
107
|
"Switch my model",
|
|
@@ -168,7 +167,7 @@ function buildPrompt(runtime, request) {
|
|
|
168
167
|
.map((m) => `${m.role === "user" ? "User" : "Assistant"}: ${m.content}`)
|
|
169
168
|
.join("\n")
|
|
170
169
|
: "No conversation yet.";
|
|
171
|
-
// "page-
|
|
170
|
+
// "page-wallet" → "wallet" — a human-readable view name for the prompt.
|
|
172
171
|
const viewName = request.scope?.replace(/^page-/, "");
|
|
173
172
|
return [
|
|
174
173
|
`You write tap-to-send prompt suggestions for a chat composer. ${characterHint(runtime)}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Trajectory, TrajectoryListResult } from "../types/trajectory.
|
|
1
|
+
import type { Trajectory, TrajectoryListResult } from "../types/trajectory.js";
|
|
2
2
|
export interface TrainingServiceLike {
|
|
3
3
|
getStatus(): Record<string, unknown>;
|
|
4
4
|
listTrajectories(options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trajectory-fallback-routes.d.ts","sourceRoot":"","sources":["../../src/api/trajectory-fallback-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"trajectory-fallback-routes.d.ts","sourceRoot":"","sources":["../../src/api/trajectory-fallback-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAiNlD,wBAAsB,2BAA2B,CAAC,OAAO,EAAE;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,GAAG,EAAE,cAAc,CAAC;CACrB,GAAG,OAAO,CAAC,OAAO,CAAC,CAgFnB"}
|
|
@@ -42,6 +42,7 @@ function detailToUi(traj) {
|
|
|
42
42
|
llmCalls.push({
|
|
43
43
|
id: c.callId || `${stepId}-call-${i}`,
|
|
44
44
|
model: c.model || "unknown",
|
|
45
|
+
provider: c.provider || "",
|
|
45
46
|
response: c.response || "",
|
|
46
47
|
purpose: c.purpose || "",
|
|
47
48
|
actionType: c.actionType || "",
|
|
@@ -79,8 +80,22 @@ function detailToUi(traj) {
|
|
|
79
80
|
(typeof traj.endTime === "number" && traj.endTime > 0)
|
|
80
81
|
? "completed"
|
|
81
82
|
: "active";
|
|
83
|
+
const startTime = typeof traj.startTime === "number" ? traj.startTime : 0;
|
|
84
|
+
const endTime = typeof traj.endTime === "number" && traj.endTime > 0 ? traj.endTime : null;
|
|
85
|
+
const durationMs = endTime !== null && startTime > 0 ? Math.max(0, endTime - startTime) : null;
|
|
82
86
|
return {
|
|
83
|
-
trajectory: {
|
|
87
|
+
trajectory: {
|
|
88
|
+
id,
|
|
89
|
+
agentId: traj.agentId ?? "",
|
|
90
|
+
source: "chat",
|
|
91
|
+
status,
|
|
92
|
+
startTime,
|
|
93
|
+
endTime,
|
|
94
|
+
durationMs,
|
|
95
|
+
llmCallCount: llmCalls.length,
|
|
96
|
+
providerAccessCount: providerAccesses.length,
|
|
97
|
+
createdAt: new Date(startTime > 0 ? startTime : 0).toISOString(),
|
|
98
|
+
},
|
|
84
99
|
llmCalls,
|
|
85
100
|
providerAccesses,
|
|
86
101
|
toolEvents,
|
|
@@ -131,6 +146,11 @@ export async function tryHandleTrajectoryFallback(options) {
|
|
|
131
146
|
status: url.searchParams.get("status") || undefined,
|
|
132
147
|
scenarioId: url.searchParams.get("scenarioId") || undefined,
|
|
133
148
|
batchId: url.searchParams.get("batchId") || undefined,
|
|
149
|
+
// The SQL reader filters + counts by `search` (id/scenario_id/
|
|
150
|
+
// batch_id/metadata/steps_json LIKE). On mobile this fallback owns
|
|
151
|
+
// /api/trajectories, so without forwarding `search` the viewer's
|
|
152
|
+
// search box returned the full unfiltered list.
|
|
153
|
+
search: url.searchParams.get("search") || undefined,
|
|
134
154
|
})) ?? { trajectories: [], total: 0 };
|
|
135
155
|
sendJson(res, 200, {
|
|
136
156
|
trajectories: result.trajectories.map(listItemToUi),
|
package/api/update-routes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type http from "node:http";
|
|
2
2
|
import type { ReadJsonBodyOptions } from "@elizaos/core";
|
|
3
|
-
import type { ElizaConfig } from "../config/config.
|
|
3
|
+
import type { ElizaConfig } from "../config/config.js";
|
|
4
4
|
export interface UpdateRouteContext {
|
|
5
5
|
req: http.IncomingMessage;
|
|
6
6
|
res: http.ServerResponse;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module api/view-registry-types
|
|
8
8
|
*/
|
|
9
9
|
import type { ViewDeclaration, ViewType } from "@elizaos/core";
|
|
10
|
-
import type { AgentPlatform } from "./platform-detect.
|
|
10
|
+
import type { AgentPlatform } from "./platform-detect.js";
|
|
11
11
|
export interface ViewRegistryEntry extends ViewDeclaration {
|
|
12
12
|
/** Concrete presentation type after applying the default (`gui`). */
|
|
13
13
|
viewType: ViewType;
|
package/api/views-registry.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { IAgentRuntime } from "@elizaos/core";
|
|
9
9
|
import { type Plugin, type ViewType } from "@elizaos/core";
|
|
10
|
-
export type { ViewRegistryEntry } from "./view-registry-types.
|
|
11
|
-
import type { ViewRegistryEntry } from "./view-registry-types.
|
|
10
|
+
export type { ViewRegistryEntry } from "./view-registry-types.js";
|
|
11
|
+
import type { ViewRegistryEntry } from "./view-registry-types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Resolve the absolute on-disk path for a view bundle.
|
|
14
14
|
* Returns `null` when the entry has no `bundlePath` or no `pluginDir`.
|
|
@@ -74,11 +74,21 @@ export declare function registerBuiltinViews(runtime?: IAgentRuntime): void;
|
|
|
74
74
|
/**
|
|
75
75
|
* List all registered views.
|
|
76
76
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
77
|
+
* Visibility follows the four-kind taxonomy ({@link resolveViewKind}):
|
|
78
|
+
* `system`/`release` views are always listed. `developer` views are listed
|
|
79
|
+
* only when `developerMode` is true. `preview` views are listed only when
|
|
80
|
+
* `includeAllKinds` is true. The dashboard's `GET /api/views` passes
|
|
81
|
+
* `includeAllKinds: true` so the client receives every view (with its
|
|
82
|
+
* `viewKind`) and applies the user's Settings toggles itself — the server
|
|
83
|
+
* cannot know whether it is talking to a dev build or which toggles are on.
|
|
84
|
+
*
|
|
85
|
+
* @param filter.developerMode - Include `developer`-kind views. Default false.
|
|
86
|
+
* @param filter.includeAllKinds - Include every kind regardless of toggle
|
|
87
|
+
* (developer + preview). Default false.
|
|
79
88
|
*/
|
|
80
89
|
export declare function listViews(filter?: {
|
|
81
90
|
developerMode?: boolean;
|
|
91
|
+
includeAllKinds?: boolean;
|
|
82
92
|
viewType?: ViewType;
|
|
83
93
|
}): ViewRegistryEntry[];
|
|
84
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views-registry.d.ts","sourceRoot":"","sources":["../../src/api/views-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"views-registry.d.ts","sourceRoot":"","sources":["../../src/api/views-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAGL,KAAK,MAAM,EAGX,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AAIvB,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAyIlE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAOzE;AAED;;;;GAIG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,eAAe,CAAC,CAAC;AAEzE,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAMhE;AASD;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA0B/D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAW9D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CA8DlE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,GAAG,iBAAiB,EAAE,CAoCtB;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,GAC/B,iBAAiB,GAAG,SAAS,CAM/B"}
|