@elizaos/agent 2.0.3-beta.2 → 2.0.3-beta.3
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 +50 -26
- 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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime handoff store: per-room handoff state gating agent contributions,
|
|
3
|
+
* surfaced through the registered {@link HandoffService}. Cache-backed (no SQL),
|
|
4
|
+
* keyed per room.
|
|
5
|
+
*/
|
|
6
|
+
export { HANDOFF_SERVICE, HandoffService, resolveHandoffService, } from "./service.js";
|
|
7
|
+
export { createHandoffStore, describeResumeCondition, evaluateResume, } from "./store.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HandoffService — the runtime-owned per-room handoff state, exposed as a
|
|
3
|
+
* registered runtime service.
|
|
4
|
+
*
|
|
5
|
+
* Handoff is a runtime primitive: the room-policy provider and the
|
|
6
|
+
* `MESSAGE.handoff` resume-detection branch consume the store via
|
|
7
|
+
* `runtime.getService(...)` rather than constructing the cache-backed store
|
|
8
|
+
* itself. The service is a thin factory over the per-runtime
|
|
9
|
+
* {@link HandoffStore}; the store is cache-backed (no SQL), keyed per room.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
|
|
12
|
+
*/
|
|
13
|
+
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
14
|
+
import { type HandoffStore } from "./store.js";
|
|
15
|
+
export declare const HANDOFF_SERVICE = "eliza_handoff";
|
|
16
|
+
export declare class HandoffService extends Service {
|
|
17
|
+
static serviceType: string;
|
|
18
|
+
capabilityDescription: string;
|
|
19
|
+
static start(runtime: IAgentRuntime): Promise<HandoffService>;
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
/** The cache-backed per-room handoff store for this runtime. */
|
|
22
|
+
getStore(): HandoffStore;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the registered {@link HandoffService}. Returns `null` when the
|
|
26
|
+
* runtime has not registered it (e.g. the "eliza" plugin is absent).
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveHandoffService(runtime: IAgentRuntime): HandoffService | null;
|
|
29
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/handoff/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,qBAAa,cAAe,SAAQ,OAAO;IACzC,OAAgB,WAAW,SAAmB;IAErC,qBAAqB,SAC6D;WAE9E,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAI7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,gEAAgE;IAChE,QAAQ,IAAI,YAAY;CAGzB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,GACrB,cAAc,GAAG,IAAI,CAEvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HandoffService — the runtime-owned per-room handoff state, exposed as a
|
|
3
|
+
* registered runtime service.
|
|
4
|
+
*
|
|
5
|
+
* Handoff is a runtime primitive: the room-policy provider and the
|
|
6
|
+
* `MESSAGE.handoff` resume-detection branch consume the store via
|
|
7
|
+
* `runtime.getService(...)` rather than constructing the cache-backed store
|
|
8
|
+
* itself. The service is a thin factory over the per-runtime
|
|
9
|
+
* {@link HandoffStore}; the store is cache-backed (no SQL), keyed per room.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
|
|
12
|
+
*/
|
|
13
|
+
import { Service } from "@elizaos/core";
|
|
14
|
+
import { createHandoffStore } from "./store.js";
|
|
15
|
+
export const HANDOFF_SERVICE = "eliza_handoff";
|
|
16
|
+
export class HandoffService extends Service {
|
|
17
|
+
static serviceType = HANDOFF_SERVICE;
|
|
18
|
+
capabilityDescription = "Runtime handoff store: per-room handoff state gating agent contributions, cache-backed";
|
|
19
|
+
static async start(runtime) {
|
|
20
|
+
return new HandoffService(runtime);
|
|
21
|
+
}
|
|
22
|
+
async stop() { }
|
|
23
|
+
/** The cache-backed per-room handoff store for this runtime. */
|
|
24
|
+
getStore() {
|
|
25
|
+
return createHandoffStore(this.runtime);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the registered {@link HandoffService}. Returns `null` when the
|
|
30
|
+
* runtime has not registered it (e.g. the "eliza" plugin is absent).
|
|
31
|
+
*/
|
|
32
|
+
export function resolveHandoffService(runtime) {
|
|
33
|
+
return runtime.getService(HANDOFF_SERVICE);
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `HandoffStore` — per-room handoff state.
|
|
3
|
+
*
|
|
4
|
+
* When the agent says "I'll let you take it from here" in a multi-party
|
|
5
|
+
* thread, the store flips the room into handoff mode; the room-policy provider
|
|
6
|
+
* reads `status(roomId).active` and gates further agent contributions until the
|
|
7
|
+
* resume condition fires.
|
|
8
|
+
*
|
|
9
|
+
* Backing storage: runtime cache, keyed per-room. Multiple rooms can be in
|
|
10
|
+
* handoff mode simultaneously (unlike `GlobalPauseStore`, which is global).
|
|
11
|
+
*/
|
|
12
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
13
|
+
export type ResumeCondition = {
|
|
14
|
+
kind: "mention";
|
|
15
|
+
} | {
|
|
16
|
+
kind: "explicit_resume";
|
|
17
|
+
} | {
|
|
18
|
+
kind: "silence_minutes";
|
|
19
|
+
minutes: number;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "user_request_help";
|
|
22
|
+
userId: string;
|
|
23
|
+
};
|
|
24
|
+
export interface HandoffEnterOpts {
|
|
25
|
+
reason: string;
|
|
26
|
+
resumeOn: ResumeCondition;
|
|
27
|
+
}
|
|
28
|
+
export interface HandoffStatus {
|
|
29
|
+
active: boolean;
|
|
30
|
+
enteredAt?: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
resumeOn?: ResumeCondition;
|
|
33
|
+
}
|
|
34
|
+
export interface HandoffStore {
|
|
35
|
+
enter(roomId: string, opts: HandoffEnterOpts): Promise<void>;
|
|
36
|
+
exit(roomId: string): Promise<void>;
|
|
37
|
+
status(roomId: string, now?: Date): Promise<HandoffStatus>;
|
|
38
|
+
}
|
|
39
|
+
export declare function createHandoffStore(runtime: IAgentRuntime): HandoffStore;
|
|
40
|
+
/**
|
|
41
|
+
* Decide whether an inbound message satisfies the active resume condition,
|
|
42
|
+
* given a `HandoffStatus`. Used by the `MESSAGE.handoff` resume-detection
|
|
43
|
+
* branch and by the room-policy provider to know whether to inject the
|
|
44
|
+
* "stay-quiet" instruction.
|
|
45
|
+
*
|
|
46
|
+
* Inputs are kept minimal — callers only need to assert the room is in
|
|
47
|
+
* handoff (`status.active`) and pass message-shape facts:
|
|
48
|
+
* - `mentionsAgent`: true if the inbound message @-mentions the agent.
|
|
49
|
+
* - `nowIso`: time of the inbound message (defaults to now).
|
|
50
|
+
* - `lastMessageIso`: last inbound message in the room (for
|
|
51
|
+
* `silence_minutes`).
|
|
52
|
+
* - `requestingUserId`: the user-id sending the inbound (for
|
|
53
|
+
* `user_request_help`).
|
|
54
|
+
* - `userRequestedHelp`: true if the inbound is a help request from
|
|
55
|
+
* `requestingUserId` (planner / classifier signal).
|
|
56
|
+
*/
|
|
57
|
+
export interface ResumeEvaluationInput {
|
|
58
|
+
status: HandoffStatus;
|
|
59
|
+
nowIso?: string;
|
|
60
|
+
mentionsAgent?: boolean;
|
|
61
|
+
lastMessageIso?: string;
|
|
62
|
+
requestingUserId?: string;
|
|
63
|
+
userRequestedHelp?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface ResumeEvaluation {
|
|
66
|
+
shouldResume: boolean;
|
|
67
|
+
reason?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare function evaluateResume(input: ResumeEvaluationInput): ResumeEvaluation;
|
|
70
|
+
/**
|
|
71
|
+
* Render the `ResumeCondition` to a short human-readable phrase used by
|
|
72
|
+
* the room-policy provider when injecting "do not respond unless …" into
|
|
73
|
+
* the planner context.
|
|
74
|
+
*/
|
|
75
|
+
export declare function describeResumeCondition(cond: ResumeCondition): string;
|
|
76
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/services/handoff/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC5D;AAmDD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAqDvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,CAgC7E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAWrE"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `HandoffStore` — per-room handoff state.
|
|
3
|
+
*
|
|
4
|
+
* When the agent says "I'll let you take it from here" in a multi-party
|
|
5
|
+
* thread, the store flips the room into handoff mode; the room-policy provider
|
|
6
|
+
* reads `status(roomId).active` and gates further agent contributions until the
|
|
7
|
+
* resume condition fires.
|
|
8
|
+
*
|
|
9
|
+
* Backing storage: runtime cache, keyed per-room. Multiple rooms can be in
|
|
10
|
+
* handoff mode simultaneously (unlike `GlobalPauseStore`, which is global).
|
|
11
|
+
*/
|
|
12
|
+
const HANDOFF_CACHE_KEY_PREFIX = "eliza:lifeops:handoff:v1:";
|
|
13
|
+
function cacheKeyForRoom(roomId) {
|
|
14
|
+
return `${HANDOFF_CACHE_KEY_PREFIX}${roomId}`;
|
|
15
|
+
}
|
|
16
|
+
function isResumeCondition(value) {
|
|
17
|
+
if (!value || typeof value !== "object")
|
|
18
|
+
return false;
|
|
19
|
+
const cand = value;
|
|
20
|
+
if (cand.kind === "mention")
|
|
21
|
+
return true;
|
|
22
|
+
if (cand.kind === "explicit_resume")
|
|
23
|
+
return true;
|
|
24
|
+
if (cand.kind === "silence_minutes") {
|
|
25
|
+
const minutes = value.minutes;
|
|
26
|
+
return (typeof minutes === "number" && Number.isFinite(minutes) && minutes > 0);
|
|
27
|
+
}
|
|
28
|
+
if (cand.kind === "user_request_help") {
|
|
29
|
+
const userId = value.userId;
|
|
30
|
+
return typeof userId === "string" && userId.length > 0;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function isValidRecord(value) {
|
|
35
|
+
if (!value || typeof value !== "object")
|
|
36
|
+
return false;
|
|
37
|
+
const r = value;
|
|
38
|
+
if (typeof r.roomId !== "string" || r.roomId.length === 0)
|
|
39
|
+
return false;
|
|
40
|
+
if (typeof r.enteredAt !== "string" ||
|
|
41
|
+
!Number.isFinite(Date.parse(r.enteredAt))) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (typeof r.reason !== "string")
|
|
45
|
+
return false;
|
|
46
|
+
return isResumeCondition(r.resumeOn);
|
|
47
|
+
}
|
|
48
|
+
function normalizeReason(reason) {
|
|
49
|
+
return reason.trim().slice(0, 200);
|
|
50
|
+
}
|
|
51
|
+
export function createHandoffStore(runtime) {
|
|
52
|
+
const cache = runtime;
|
|
53
|
+
return {
|
|
54
|
+
async enter(roomId, opts) {
|
|
55
|
+
if (typeof roomId !== "string" || roomId.length === 0) {
|
|
56
|
+
throw new Error("[handoff] roomId is required");
|
|
57
|
+
}
|
|
58
|
+
if (!isResumeCondition(opts.resumeOn)) {
|
|
59
|
+
throw new Error(`[handoff] invalid resumeOn: ${JSON.stringify(opts.resumeOn)}`);
|
|
60
|
+
}
|
|
61
|
+
const reason = normalizeReason(opts.reason);
|
|
62
|
+
if (reason.length === 0) {
|
|
63
|
+
throw new Error("[handoff] reason is required");
|
|
64
|
+
}
|
|
65
|
+
const record = {
|
|
66
|
+
roomId,
|
|
67
|
+
enteredAt: new Date().toISOString(),
|
|
68
|
+
reason,
|
|
69
|
+
resumeOn: opts.resumeOn,
|
|
70
|
+
};
|
|
71
|
+
await cache.setCache(cacheKeyForRoom(roomId), record);
|
|
72
|
+
},
|
|
73
|
+
async exit(roomId) {
|
|
74
|
+
if (typeof roomId !== "string" || roomId.length === 0)
|
|
75
|
+
return;
|
|
76
|
+
await cache.deleteCache(cacheKeyForRoom(roomId));
|
|
77
|
+
},
|
|
78
|
+
async status(roomId, _now = new Date()) {
|
|
79
|
+
void _now;
|
|
80
|
+
if (typeof roomId !== "string" || roomId.length === 0) {
|
|
81
|
+
return { active: false };
|
|
82
|
+
}
|
|
83
|
+
const stored = await cache.getCache(cacheKeyForRoom(roomId));
|
|
84
|
+
if (!isValidRecord(stored)) {
|
|
85
|
+
return { active: false };
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
active: true,
|
|
89
|
+
enteredAt: stored.enteredAt,
|
|
90
|
+
reason: stored.reason,
|
|
91
|
+
resumeOn: stored.resumeOn,
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function evaluateResume(input) {
|
|
97
|
+
if (!input.status.active || !input.status.resumeOn) {
|
|
98
|
+
return { shouldResume: false };
|
|
99
|
+
}
|
|
100
|
+
const cond = input.status.resumeOn;
|
|
101
|
+
switch (cond.kind) {
|
|
102
|
+
case "mention":
|
|
103
|
+
return input.mentionsAgent === true
|
|
104
|
+
? { shouldResume: true, reason: "mentioned" }
|
|
105
|
+
: { shouldResume: false };
|
|
106
|
+
case "explicit_resume":
|
|
107
|
+
// Explicit-resume must be triggered out-of-band via `MESSAGE.handoff`
|
|
108
|
+
// verb=resume; the planner does not auto-resume on any inbound.
|
|
109
|
+
return { shouldResume: false };
|
|
110
|
+
case "silence_minutes": {
|
|
111
|
+
const lastIso = input.lastMessageIso;
|
|
112
|
+
if (!lastIso)
|
|
113
|
+
return { shouldResume: false };
|
|
114
|
+
const lastMs = Date.parse(lastIso);
|
|
115
|
+
if (!Number.isFinite(lastMs))
|
|
116
|
+
return { shouldResume: false };
|
|
117
|
+
const nowMs = input.nowIso ? Date.parse(input.nowIso) : Date.now();
|
|
118
|
+
if (!Number.isFinite(nowMs))
|
|
119
|
+
return { shouldResume: false };
|
|
120
|
+
const elapsedMin = (nowMs - lastMs) / 60_000;
|
|
121
|
+
return elapsedMin >= cond.minutes
|
|
122
|
+
? { shouldResume: true, reason: `silence ≥ ${cond.minutes}m` }
|
|
123
|
+
: { shouldResume: false };
|
|
124
|
+
}
|
|
125
|
+
case "user_request_help":
|
|
126
|
+
return input.userRequestedHelp === true &&
|
|
127
|
+
input.requestingUserId === cond.userId
|
|
128
|
+
? { shouldResume: true, reason: "user requested help" }
|
|
129
|
+
: { shouldResume: false };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Render the `ResumeCondition` to a short human-readable phrase used by
|
|
134
|
+
* the room-policy provider when injecting "do not respond unless …" into
|
|
135
|
+
* the planner context.
|
|
136
|
+
*/
|
|
137
|
+
export function describeResumeCondition(cond) {
|
|
138
|
+
switch (cond.kind) {
|
|
139
|
+
case "mention":
|
|
140
|
+
return "you are @-mentioned";
|
|
141
|
+
case "explicit_resume":
|
|
142
|
+
return "the user explicitly asks to resume a handoff";
|
|
143
|
+
case "silence_minutes":
|
|
144
|
+
return `the room has been silent for at least ${cond.minutes} minute${cond.minutes === 1 ? "" : "s"}`;
|
|
145
|
+
case "user_request_help":
|
|
146
|
+
return `the participant ${cond.userId} explicitly asks the agent for help`;
|
|
147
|
+
}
|
|
148
|
+
}
|
package/services/index.d.ts
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export * from "./
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export * from "./remote-capability-
|
|
14
|
-
export * from "./remote-capability-endpoint-
|
|
15
|
-
export * from "./remote-capability-
|
|
16
|
-
export * from "./remote-capability-
|
|
17
|
-
export * from "./remote-capability-
|
|
18
|
-
export * from "./remote-
|
|
19
|
-
export * from "./remote-plugin-
|
|
20
|
-
export * from "./remote-
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export * from "./sandbox-
|
|
24
|
-
export * from "./
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export * from "./
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
31
|
-
export * from "./virtual-filesystem.ts";
|
|
1
|
+
export * from "./agent-export.js";
|
|
2
|
+
export * from "./app-session-gate.js";
|
|
3
|
+
export { type AuditedDecision, type BrokerOptions, type BrokerSnapshot, CapabilityBroker, type CapabilityDecision, type CapabilityKind, type CapabilityOp, type CapabilityRequest, getCapabilityBroker, } from "./capability-broker.js";
|
|
4
|
+
export { EscalationService, type EscalationState, registerEscalationChannel, } from "./escalation.js";
|
|
5
|
+
export * from "./mcp-marketplace.js";
|
|
6
|
+
export * from "./overlay-app-presence.js";
|
|
7
|
+
export { type IPermissionsRegistry, PERMISSIONS_REGISTRY_SERVICE, PermissionRegistry, type PermissionRegistryOptions, type Prober, } from "./permissions-registry.js";
|
|
8
|
+
export * from "./plugin-compiler.js";
|
|
9
|
+
export { type CoreManagerLike, type CoreStatusLike, type EjectResult, type InstalledPluginInfo, type InstallProgressLike, isCoreManagerLike, isPluginManagerLike, type PluginInstallOptionsLike, type PluginInstallResult, type PluginManagerLike, type PluginUninstallResult, type RegistryPluginAppMeta, type RegistryPluginAppSessionFeature, type RegistryPluginAppSessionInfo, type RegistryPluginAppSessionMode, type RegistryPluginInfo as RegistryPluginManagerInfo, type RegistryPluginNpmInfo, type RegistryPluginViewerInfo, type RegistrySearchResult as RegistryPluginManagerSearchResult, type RegistryVersionSupport, type ReinjectResult, type SyncResult, } from "./plugin-manager-types.js";
|
|
10
|
+
export * from "./registry-client.js";
|
|
11
|
+
export { resolveAppHeroImage } from "./registry-client-queries.js";
|
|
12
|
+
export * from "./remote-capability-cloud-sandbox.js";
|
|
13
|
+
export * from "./remote-capability-endpoint-conformance.js";
|
|
14
|
+
export * from "./remote-capability-endpoint-provider.js";
|
|
15
|
+
export * from "./remote-capability-live-report.js";
|
|
16
|
+
export * from "./remote-capability-router.js";
|
|
17
|
+
export * from "./remote-capability-url-endpoint-providers.js";
|
|
18
|
+
export * from "./remote-plugin-adapter.js";
|
|
19
|
+
export * from "./remote-plugin-bridge.js";
|
|
20
|
+
export * from "./remote-signing-service.js";
|
|
21
|
+
export { ResearchTaskExecutor } from "./research-task-executor.js";
|
|
22
|
+
export * from "./sandbox-engine.js";
|
|
23
|
+
export * from "./sandbox-manager.js";
|
|
24
|
+
export * from "./self-updater.js";
|
|
25
|
+
export { resolveShellExecutionMode, runShell, type ShellExecutionMode, type ShellRequest, type ShellResult, type ShellRouterContext, type ShellSandboxBackend, } from "./shell-execution-router.js";
|
|
26
|
+
export * from "./signing-policy.js";
|
|
27
|
+
export * from "./task-executor.js";
|
|
28
|
+
export * from "./update-checker.js";
|
|
29
|
+
export * from "./version-compat.js";
|
|
30
|
+
export * from "./virtual-filesystem.js";
|
|
32
31
|
//# sourceMappingURL=index.d.ts.map
|
package/services/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,KAAK,oBAAoB,EACzB,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,MAAM,GACZ,MAAM,2BAA2B,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAKrC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,IAAI,yBAAyB,EACpD,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,IAAI,iCAAiC,EAC9D,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,2BAA2B,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
|
package/services/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// app-manager extracted to @elizaos/plugin-app-manager.
|
|
2
|
-
// Re-export the public surface (including app-run-store helpers) so
|
|
3
|
-
// downstream callers that imported from `@elizaos/agent` keep working
|
|
4
|
-
// during the transition. New callers should import from
|
|
5
|
-
// `@elizaos/plugin-app-manager` directly.
|
|
6
|
-
export { AppManager, readAppRunStore, resolveAppRunStoreFilePath, resolveLegacyAppRunStoreFilePath, writeAppRunStore, } from "@elizaos/plugin-app-manager";
|
|
7
1
|
export * from "./agent-export.js";
|
|
8
2
|
export * from "./app-session-gate.js";
|
|
9
3
|
export { CapabilityBroker, getCapabilityBroker, } from "./capability-broker.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js-runtime-bridge.d.ts","sourceRoot":"","sources":["../../src/services/js-runtime-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"js-runtime-bridge.d.ts","sourceRoot":"","sources":["../../src/services/js-runtime-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,sEAAsE;AACtE,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,SAAS,GACT,iBAAiB,GACjB,sBAAsB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,MAAM,WAAW,wBAAwB;IACvC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC1E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAID,UAAU,cAAc;IACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;IAC5D,cAAc,EAAE,MAAM,CAAC;CACxB;AAQD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,OAAO,CAGvE;AAkID;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnD,8EAA8E;IAC9E,MAAM,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAC3C;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAKxE;AAiCD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,eAAe,CAAC,CAgDvE;AAED,sEAAsE;AACtE,wBAAgB,8BAA8B,IAAI,IAAI,CAGrD"}
|
|
@@ -26,6 +26,8 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
26
26
|
}
|
|
27
27
|
return path;
|
|
28
28
|
};
|
|
29
|
+
import path from "node:path";
|
|
30
|
+
import { pathToFileURL } from "node:url";
|
|
29
31
|
import { resolveDistributionProfile } from "@elizaos/shared";
|
|
30
32
|
function newMarshalContext() {
|
|
31
33
|
return { functionTable: new Map(), nextFunctionId: 0 };
|
|
@@ -133,8 +135,12 @@ function toFileUrl(absolutePath) {
|
|
|
133
135
|
if (/^[a-z]+:\/\//i.test(absolutePath)) {
|
|
134
136
|
return absolutePath;
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
// Use pathToFileURL so a Windows drive path (C:\…) becomes a valid file://
|
|
139
|
+
// module specifier. The old `file://${absolutePath}` only worked for POSIX
|
|
140
|
+
// "/…" paths — a Windows backslash path starts with "C:\", never "/", so it
|
|
141
|
+
// fell through unconverted and was not a loadable URL for dynamic import.
|
|
142
|
+
if (path.isAbsolute(absolutePath)) {
|
|
143
|
+
return pathToFileURL(absolutePath).href;
|
|
138
144
|
}
|
|
139
145
|
return absolutePath;
|
|
140
146
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* runtime) and surfaced through the registered {@link KnowledgeGraphService}.
|
|
6
6
|
* Pure KG types and the identity-merge engine live in `@elizaos/shared`.
|
|
7
7
|
*/
|
|
8
|
-
export { EntityStore } from "./entity-store.
|
|
9
|
-
export { RelationshipStore } from "./relationship-store.
|
|
10
|
-
export { knowledgeGraphSchema } from "./schema.
|
|
11
|
-
export { KNOWLEDGE_GRAPH_SERVICE, KnowledgeGraphService, resolveKnowledgeGraphService, } from "./service.
|
|
8
|
+
export { EntityStore } from "./entity-store.js";
|
|
9
|
+
export { RelationshipStore } from "./relationship-store.js";
|
|
10
|
+
export { knowledgeGraphSchema } from "./schema.js";
|
|
11
|
+
export { KNOWLEDGE_GRAPH_SERVICE, KnowledgeGraphService, resolveKnowledgeGraphService, } from "./service.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* `runtime.agentId`.
|
|
11
11
|
*/
|
|
12
12
|
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
13
|
-
import { EntityStore } from "./entity-store.
|
|
14
|
-
import { RelationshipStore } from "./relationship-store.
|
|
13
|
+
import { EntityStore } from "./entity-store.js";
|
|
14
|
+
import { RelationshipStore } from "./relationship-store.js";
|
|
15
15
|
export declare const KNOWLEDGE_GRAPH_SERVICE = "eliza_knowledge_graph";
|
|
16
16
|
export declare class KnowledgeGraphService extends Service {
|
|
17
17
|
static serviceType: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime pending-prompts store: open scheduled-task prompts awaiting an
|
|
3
|
+
* owner reply, surfaced through the registered {@link PendingPromptsService}.
|
|
4
|
+
* Cache-backed (no SQL), keyed per room.
|
|
5
|
+
*/
|
|
6
|
+
export { PENDING_PROMPTS_SERVICE, PendingPromptsService, resolvePendingPromptsService, } from "./service.js";
|
|
7
|
+
export { createPendingPromptsStore, type ExpectedReplyKind, type PendingPrompt, type PendingPromptRecordInput, type PendingPromptsStore, type PendingPromptWithRoom, type RecordedPendingPrompt, } from "./store.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/pending-prompts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime pending-prompts store: open scheduled-task prompts awaiting an
|
|
3
|
+
* owner reply, surfaced through the registered {@link PendingPromptsService}.
|
|
4
|
+
* Cache-backed (no SQL), keyed per room.
|
|
5
|
+
*/
|
|
6
|
+
export { PENDING_PROMPTS_SERVICE, PendingPromptsService, resolvePendingPromptsService, } from "./service.js";
|
|
7
|
+
export { createPendingPromptsStore, } from "./store.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PendingPromptsService — the runtime-owned store of open scheduled-task
|
|
3
|
+
* prompts, exposed as a registered runtime service.
|
|
4
|
+
*
|
|
5
|
+
* Pending prompts are a runtime primitive: any plugin (LifeOps scheduler, the
|
|
6
|
+
* work-thread evaluator, …) consumes the store via `runtime.getService(...)`
|
|
7
|
+
* rather than constructing the cache-backed store itself. The service is a thin
|
|
8
|
+
* factory over the per-runtime {@link PendingPromptsStore}; the store is
|
|
9
|
+
* cache-backed (no SQL), keyed per room.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
|
|
12
|
+
*/
|
|
13
|
+
import { type IAgentRuntime, type PendingUserAction, Service } from "@elizaos/core";
|
|
14
|
+
import { type PendingPromptsStore } from "./store.js";
|
|
15
|
+
export declare const PENDING_PROMPTS_SERVICE = "eliza_pending_prompts";
|
|
16
|
+
export declare class PendingPromptsService extends Service {
|
|
17
|
+
static serviceType: string;
|
|
18
|
+
capabilityDescription: string;
|
|
19
|
+
static start(runtime: IAgentRuntime): Promise<PendingPromptsService>;
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
/** The cache-backed pending-prompts store for this runtime. */
|
|
22
|
+
getStore(): PendingPromptsStore;
|
|
23
|
+
/**
|
|
24
|
+
* Canonical "agent is waiting on you" projection for all open prompts.
|
|
25
|
+
* UI/provider surfaces should consume this instead of reshaping store records.
|
|
26
|
+
*/
|
|
27
|
+
listPendingUserActions(): Promise<PendingUserAction[]>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the registered {@link PendingPromptsService}. Returns `null` when the
|
|
31
|
+
* runtime has not registered it (e.g. the "eliza" plugin is absent).
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolvePendingPromptsService(runtime: IAgentRuntime): PendingPromptsService | null;
|
|
34
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/pending-prompts/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,OAAO,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAE/D,qBAAa,qBAAsB,SAAQ,OAAO;IAChD,OAAgB,WAAW,SAA2B;IAE7C,qBAAqB,SACwD;WAEzE,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIpE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,+DAA+D;IAC/D,QAAQ,IAAI,mBAAmB;IAI/B;;;OAGG;IACG,sBAAsB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAwB7D;AAQD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,aAAa,GACrB,qBAAqB,GAAG,IAAI,CAE9B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PendingPromptsService — the runtime-owned store of open scheduled-task
|
|
3
|
+
* prompts, exposed as a registered runtime service.
|
|
4
|
+
*
|
|
5
|
+
* Pending prompts are a runtime primitive: any plugin (LifeOps scheduler, the
|
|
6
|
+
* work-thread evaluator, …) consumes the store via `runtime.getService(...)`
|
|
7
|
+
* rather than constructing the cache-backed store itself. The service is a thin
|
|
8
|
+
* factory over the per-runtime {@link PendingPromptsStore}; the store is
|
|
9
|
+
* cache-backed (no SQL), keyed per room.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
|
|
12
|
+
*/
|
|
13
|
+
import { Service, } from "@elizaos/core";
|
|
14
|
+
import { createPendingPromptsStore, } from "./store.js";
|
|
15
|
+
export const PENDING_PROMPTS_SERVICE = "eliza_pending_prompts";
|
|
16
|
+
export class PendingPromptsService extends Service {
|
|
17
|
+
static serviceType = PENDING_PROMPTS_SERVICE;
|
|
18
|
+
capabilityDescription = "Runtime pending-prompts store: open scheduled-task prompts per room, cache-backed";
|
|
19
|
+
static async start(runtime) {
|
|
20
|
+
return new PendingPromptsService(runtime);
|
|
21
|
+
}
|
|
22
|
+
async stop() { }
|
|
23
|
+
/** The cache-backed pending-prompts store for this runtime. */
|
|
24
|
+
getStore() {
|
|
25
|
+
return createPendingPromptsStore(this.runtime);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Canonical "agent is waiting on you" projection for all open prompts.
|
|
29
|
+
* UI/provider surfaces should consume this instead of reshaping store records.
|
|
30
|
+
*/
|
|
31
|
+
async listPendingUserActions() {
|
|
32
|
+
const prompts = await this.getStore().listAll();
|
|
33
|
+
return prompts.map((prompt) => ({
|
|
34
|
+
id: prompt.taskId,
|
|
35
|
+
kind: "pending_prompt",
|
|
36
|
+
source: "pending-prompts",
|
|
37
|
+
title: prompt.promptSnippet,
|
|
38
|
+
roomId: prompt.roomId,
|
|
39
|
+
expectedReplyKind: prompt.expectedReplyKind,
|
|
40
|
+
weight: promptWeight(prompt.expectedReplyKind),
|
|
41
|
+
resolution: {
|
|
42
|
+
target: "pending_prompt",
|
|
43
|
+
requestId: prompt.taskId,
|
|
44
|
+
},
|
|
45
|
+
data: {
|
|
46
|
+
expectedReplyKind: prompt.expectedReplyKind,
|
|
47
|
+
},
|
|
48
|
+
createdAt: Date.parse(prompt.firedAt),
|
|
49
|
+
expiresAt: prompt.expiresAt && Number.isFinite(Date.parse(prompt.expiresAt))
|
|
50
|
+
? Date.parse(prompt.expiresAt)
|
|
51
|
+
: null,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function promptWeight(kind) {
|
|
56
|
+
if (kind === "approval")
|
|
57
|
+
return 9;
|
|
58
|
+
if (kind === "yes_no")
|
|
59
|
+
return 7;
|
|
60
|
+
return 6;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the registered {@link PendingPromptsService}. Returns `null` when the
|
|
64
|
+
* runtime has not registered it (e.g. the "eliza" plugin is absent).
|
|
65
|
+
*/
|
|
66
|
+
export function resolvePendingPromptsService(runtime) {
|
|
67
|
+
return runtime.getService(PENDING_PROMPTS_SERVICE);
|
|
68
|
+
}
|