@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
|
@@ -20,6 +20,82 @@
|
|
|
20
20
|
// ./error subpath, not the barrel: the barrel eagerly loads ./bootstrap's heavy
|
|
21
21
|
// runtime chain, which crashed agent boot in the cloud image.
|
|
22
22
|
import { fromWireError, toWireError, } from "@elizaos/plugin-worker-runtime/error";
|
|
23
|
+
import * as z from "zod";
|
|
24
|
+
/**
|
|
25
|
+
* Schema for the announce/dynamic descriptor the worker emits via
|
|
26
|
+
* {@link buildAnnounceDescriptor} (packages/plugin-worker-runtime/src/descriptor.ts).
|
|
27
|
+
*
|
|
28
|
+
* The descriptor is untrusted JSON crossing the host↔worker RPC boundary, so
|
|
29
|
+
* it is parsed once at ingress instead of being blind-cast field by field.
|
|
30
|
+
*
|
|
31
|
+
* Object schemas are intentionally passthrough (extra keys pass through): the
|
|
32
|
+
* producer only writes a field when it is present, the metadata surfaces
|
|
33
|
+
* (`views`/`widgets`/`componentTypes`) are author-defined JSON, and the
|
|
34
|
+
* service entries carry dynamic `rpc:<method>` keys. The schema validates the
|
|
35
|
+
* *container shape* (array vs record vs object) and the fields the bridge
|
|
36
|
+
* actually reads; everything else is preserved verbatim. Functions are
|
|
37
|
+
* replaced on the wire by {@link RemoteFunctionRef} (`{ rpc: true, id }`).
|
|
38
|
+
*/
|
|
39
|
+
const RemoteFunctionRefSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
rpc: z.literal(true),
|
|
42
|
+
id: z.string(),
|
|
43
|
+
})
|
|
44
|
+
.passthrough();
|
|
45
|
+
const ActionDescriptorSchema = z
|
|
46
|
+
.object({
|
|
47
|
+
name: z.string(),
|
|
48
|
+
handler: RemoteFunctionRefSchema,
|
|
49
|
+
similes: z.array(z.string()).optional(),
|
|
50
|
+
description: z.string().optional(),
|
|
51
|
+
examples: z.unknown().optional(),
|
|
52
|
+
validate: RemoteFunctionRefSchema.optional(),
|
|
53
|
+
})
|
|
54
|
+
.passthrough();
|
|
55
|
+
const ProviderDescriptorSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
name: z.string(),
|
|
58
|
+
get: RemoteFunctionRefSchema,
|
|
59
|
+
description: z.string().optional(),
|
|
60
|
+
dynamic: z.boolean().optional(),
|
|
61
|
+
position: z.number().optional(),
|
|
62
|
+
private: z.boolean().optional(),
|
|
63
|
+
})
|
|
64
|
+
.passthrough();
|
|
65
|
+
const ServiceDescriptorSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
serviceType: z.string(),
|
|
68
|
+
rpcMethods: z.array(z.string()),
|
|
69
|
+
capabilityDescription: z.string().optional(),
|
|
70
|
+
})
|
|
71
|
+
.passthrough();
|
|
72
|
+
const RouteDescriptorSchema = z
|
|
73
|
+
.object({
|
|
74
|
+
path: z.string(),
|
|
75
|
+
routeHandler: RemoteFunctionRefSchema.optional(),
|
|
76
|
+
type: z.unknown().optional(),
|
|
77
|
+
name: z.unknown().optional(),
|
|
78
|
+
public: z.unknown().optional(),
|
|
79
|
+
isMultipart: z.unknown().optional(),
|
|
80
|
+
})
|
|
81
|
+
.passthrough();
|
|
82
|
+
const RemotePluginDescriptorSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
name: z.string().optional(),
|
|
85
|
+
description: z.unknown().optional(),
|
|
86
|
+
priority: z.unknown().optional(),
|
|
87
|
+
dependencies: z.array(z.string()).optional(),
|
|
88
|
+
actions: z.array(ActionDescriptorSchema).optional(),
|
|
89
|
+
providers: z.array(ProviderDescriptorSchema).optional(),
|
|
90
|
+
events: z.record(z.string(), z.array(RemoteFunctionRefSchema)).optional(),
|
|
91
|
+
models: z.record(z.string(), RemoteFunctionRefSchema).optional(),
|
|
92
|
+
services: z.array(ServiceDescriptorSchema).optional(),
|
|
93
|
+
routes: z.array(RouteDescriptorSchema).optional(),
|
|
94
|
+
views: z.array(z.unknown()).optional(),
|
|
95
|
+
widgets: z.array(z.unknown()).optional(),
|
|
96
|
+
componentTypes: z.array(z.unknown()).optional(),
|
|
97
|
+
})
|
|
98
|
+
.passthrough();
|
|
23
99
|
function isWorkerActionCallbackEnvelope(message) {
|
|
24
100
|
const candidate = message;
|
|
25
101
|
return candidate.type === "worker-action-callback";
|
|
@@ -119,7 +195,8 @@ export class RemotePluginBridge {
|
|
|
119
195
|
}
|
|
120
196
|
await this.applyDynamicContributions(registeredPlugin, dynamicPlugin);
|
|
121
197
|
}
|
|
122
|
-
materialisePlugin(
|
|
198
|
+
materialisePlugin(rawDescriptor) {
|
|
199
|
+
const descriptor = RemotePluginDescriptorSchema.parse(rawDescriptor);
|
|
123
200
|
const name = String(descriptor.name ?? "");
|
|
124
201
|
if (!name)
|
|
125
202
|
throw new Error("worker-announce-plugin descriptor missing name");
|
|
@@ -132,7 +209,7 @@ export class RemotePluginBridge {
|
|
|
132
209
|
plugin.priority = Number(descriptor.priority);
|
|
133
210
|
}
|
|
134
211
|
if (descriptor.dependencies) {
|
|
135
|
-
plugin.dependencies = descriptor.dependencies
|
|
212
|
+
plugin.dependencies = descriptor.dependencies;
|
|
136
213
|
}
|
|
137
214
|
this.attachFunctionContributions(plugin, descriptor);
|
|
138
215
|
this.attachServiceContributions(plugin, descriptor);
|
|
@@ -242,27 +319,23 @@ export class RemotePluginBridge {
|
|
|
242
319
|
}
|
|
243
320
|
}
|
|
244
321
|
attachFunctionContributions(plugin, descriptor) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
plugin.actions = actions.map((action) => this.makeActionProxy(action));
|
|
322
|
+
if (descriptor.actions?.length) {
|
|
323
|
+
plugin.actions = descriptor.actions.map((action) => this.makeActionProxy(action));
|
|
248
324
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
plugin.providers = providers.map((provider) => this.makeProviderProxy(provider));
|
|
325
|
+
if (descriptor.providers?.length) {
|
|
326
|
+
plugin.providers = descriptor.providers.map((provider) => this.makeProviderProxy(provider));
|
|
252
327
|
}
|
|
253
|
-
|
|
254
|
-
if (events) {
|
|
328
|
+
if (descriptor.events) {
|
|
255
329
|
const eventMap = {};
|
|
256
|
-
for (const [eventName, refs] of Object.entries(events)) {
|
|
330
|
+
for (const [eventName, refs] of Object.entries(descriptor.events)) {
|
|
257
331
|
const handlers = refs.map((ref) => this.makeEventHandlerProxy(ref));
|
|
258
332
|
eventMap[eventName] = handlers;
|
|
259
333
|
}
|
|
260
334
|
plugin.events = eventMap;
|
|
261
335
|
}
|
|
262
|
-
|
|
263
|
-
if (models) {
|
|
336
|
+
if (descriptor.models) {
|
|
264
337
|
const modelMap = {};
|
|
265
|
-
for (const [modelType, ref] of Object.entries(models)) {
|
|
338
|
+
for (const [modelType, ref] of Object.entries(descriptor.models)) {
|
|
266
339
|
modelMap[modelType] =
|
|
267
340
|
this.makeModelHandlerProxy(ref);
|
|
268
341
|
}
|
|
@@ -273,18 +346,16 @@ export class RemotePluginBridge {
|
|
|
273
346
|
// Services: opt-in via `static rpcMethods`. The descriptor carries
|
|
274
347
|
// one entry per service with the methods list and per-method rpc
|
|
275
348
|
// ids; we synthesise a ServiceClass with dynamic methods.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
plugin.services = services.map((svc) => this.makeServiceClassProxy(svc));
|
|
349
|
+
if (descriptor.services?.length) {
|
|
350
|
+
plugin.services = descriptor.services.map((svc) => this.makeServiceClassProxy(svc));
|
|
279
351
|
}
|
|
280
352
|
}
|
|
281
353
|
attachRouteContributions(plugin, descriptor) {
|
|
282
354
|
// Routes: the agent's existing plugin-route lifecycle will pick
|
|
283
355
|
// these up. Each routeHandler is wrapped to forward
|
|
284
356
|
// RouteHandlerContext via worker-rpc and return RouteHandlerResult.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
plugin.routes = routes
|
|
357
|
+
if (descriptor.routes?.length) {
|
|
358
|
+
plugin.routes = descriptor.routes
|
|
288
359
|
.map((r) => this.makeRouteProxy(r))
|
|
289
360
|
.filter((r) => r !== null);
|
|
290
361
|
}
|
|
@@ -354,7 +425,7 @@ export class RemotePluginBridge {
|
|
|
354
425
|
const description = String(descriptor.description ?? "");
|
|
355
426
|
const dynamic = descriptor.dynamic === true;
|
|
356
427
|
const priv = descriptor.private === true;
|
|
357
|
-
const position =
|
|
428
|
+
const position = descriptor.position;
|
|
358
429
|
const get = async (_runtime, message, state) => {
|
|
359
430
|
const result = await this.workerRpc("provider", descriptor.get.id, {
|
|
360
431
|
message: this.normalize(message),
|
|
@@ -394,9 +465,9 @@ export class RemotePluginBridge {
|
|
|
394
465
|
const description = descriptor.capabilityDescription ?? "";
|
|
395
466
|
const methodIdMap = new Map();
|
|
396
467
|
for (const method of descriptor.rpcMethods) {
|
|
397
|
-
const ref = descriptor[`rpc:${method}`];
|
|
398
|
-
if (ref
|
|
399
|
-
methodIdMap.set(method, ref.id);
|
|
468
|
+
const ref = RemoteFunctionRefSchema.safeParse(descriptor[`rpc:${method}`]);
|
|
469
|
+
if (ref.success)
|
|
470
|
+
methodIdMap.set(method, ref.data.id);
|
|
400
471
|
}
|
|
401
472
|
// Build the proxy class on the fly. The Service base class isn't
|
|
402
473
|
// imported here to avoid pulling all of @elizaos/core into this
|
|
@@ -547,7 +618,7 @@ export class RemotePluginBridge {
|
|
|
547
618
|
case "getMemory": {
|
|
548
619
|
const memoryId = String(args.memoryId);
|
|
549
620
|
const memory = await this.runtime.getMemoryById(memoryId);
|
|
550
|
-
return (memory ?? null);
|
|
621
|
+
return JSON.parse(JSON.stringify(memory ?? null));
|
|
551
622
|
}
|
|
552
623
|
case "createMemory": {
|
|
553
624
|
const memory = args.memory;
|
|
@@ -579,7 +650,7 @@ export class RemotePluginBridge {
|
|
|
579
650
|
case "composeState": {
|
|
580
651
|
const memory = args.message;
|
|
581
652
|
const result = await this.runtime.composeState(memory);
|
|
582
|
-
return (result ?? null);
|
|
653
|
+
return JSON.parse(JSON.stringify(result ?? null));
|
|
583
654
|
}
|
|
584
655
|
default:
|
|
585
656
|
throw new Error(`Unsupported host-rpc method: ${message.method}. P1 supports getService, useModel, getMemory, createMemory, updateMemory, emitEvent, getSetting, setSetting, composeState.`);
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* sandboxed agents submit unsigned tx → policy check → sign → return.
|
|
4
4
|
*/
|
|
5
5
|
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
6
|
-
import type { SandboxAuditLog } from "../security/audit-log.
|
|
7
|
-
import { type PolicyDecision, type SigningPolicy, type SigningRequest } from "./signing-policy.
|
|
8
|
-
import type { TeeEvidenceProvider } from "./tee-evidence.
|
|
9
|
-
import type { TeeEvidencePolicy } from "./tee-policy.
|
|
6
|
+
import type { SandboxAuditLog } from "../security/audit-log.js";
|
|
7
|
+
import { type PolicyDecision, type SigningPolicy, type SigningRequest } from "./signing-policy.js";
|
|
8
|
+
import type { TeeEvidenceProvider } from "./tee-evidence.js";
|
|
9
|
+
import type { TeeEvidencePolicy } from "./tee-policy.js";
|
|
10
10
|
export interface SignerBackend {
|
|
11
11
|
getAddress(): Promise<string>;
|
|
12
12
|
signMessage(message: string): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IAgentRuntime } from "@elizaos/core";
|
|
2
|
-
import type { TaskExecutor, TaskResult, TaskSpec } from "./task-executor.
|
|
2
|
+
import type { TaskExecutor, TaskResult, TaskSpec } from "./task-executor.js";
|
|
3
3
|
/**
|
|
4
4
|
* Decomposes research questions into sub-questions, answers each via the
|
|
5
5
|
* runtime's LLM, and synthesizes a final report.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Sandbox container lifecycle: create, exec, health check, teardown. */
|
|
2
|
-
import { type SandboxEngineType } from "./sandbox-engine.
|
|
2
|
+
import { type SandboxEngineType } from "./sandbox-engine.js";
|
|
3
3
|
export type SandboxMode = "off" | "light" | "standard" | "max";
|
|
4
4
|
export type SandboxState = "uninitialized" | "initializing" | "ready" | "degraded" | "stopping" | "stopped" | "recovering";
|
|
5
5
|
export interface SandboxManagerConfig {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Detects the installation method and runs the appropriate upgrade command.
|
|
3
3
|
* Falls back to npm if detection is ambiguous.
|
|
4
4
|
*/
|
|
5
|
-
import type { ReleaseChannel } from "../config/types.eliza.
|
|
5
|
+
import type { ReleaseChannel } from "../config/types.eliza.js";
|
|
6
6
|
export type InstallMethod = "npm-global" | "bun-global" | "homebrew" | "snap" | "apt" | "flatpak" | "local-dev" | "unknown";
|
|
7
7
|
export type UpdateAuthority = "package-manager" | "os-package-manager" | "developer" | "operator";
|
|
8
8
|
export type UpdateNextAction = "run-package-manager-command" | "run-git-pull" | "review-installation" | "none";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-updater.d.ts","sourceRoot":"","sources":["../../src/services/self-updater.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,MAAM,GACN,KAAK,GACL,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEd,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GACxB,6BAA6B,GAC7B,cAAc,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AE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAmCD,wBAAgB,mBAAmB,IAAI,aAAa,CA0BnD;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,cAAc,GACtB,iBAAiB,GAAG,IAAI,CAyD1B;AAkDD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GACpC,gBAAgB,CAyBlB;AAkDD,wBAAsB,aAAa,CACjC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,cAAc,EACvB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAsCvB"}
|
package/services/self-updater.js
CHANGED
|
@@ -9,13 +9,18 @@ import { fileURLToPath } from "node:url";
|
|
|
9
9
|
import { CHANNEL_DIST_TAGS } from "./update-checker.js";
|
|
10
10
|
const NPM_PACKAGE_NAME = "elizaos";
|
|
11
11
|
function whichSync(binary) {
|
|
12
|
+
// `which` does not exist on Windows — use `where`, which lists matches one
|
|
13
|
+
// per line (take the first). Without this, every lookup throws ENOENT and is
|
|
14
|
+
// swallowed, so detectInstallMethod() always falls back to "unknown".
|
|
15
|
+
const cmd = process.platform === "win32" ? "where" : "which";
|
|
12
16
|
try {
|
|
13
|
-
|
|
17
|
+
const out = execSync(`${cmd} ${binary}`, {
|
|
14
18
|
stdio: ["ignore", "pipe", "ignore"],
|
|
15
19
|
timeout: 5_000,
|
|
16
20
|
})
|
|
17
21
|
.toString()
|
|
18
22
|
.trim();
|
|
23
|
+
return out.split(/\r?\n/)[0]?.trim() || null;
|
|
19
24
|
}
|
|
20
25
|
catch {
|
|
21
26
|
return null;
|
|
@@ -43,17 +48,21 @@ export function detectInstallMethod() {
|
|
|
43
48
|
catch {
|
|
44
49
|
resolved = elizaBin;
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
// Normalize separators so the substring/prefix checks below match on Windows,
|
|
52
|
+
// where realpathSync returns backslash drive paths (e.g. C:\Users\…\.bun\…).
|
|
53
|
+
// Without this, bun-global is mis-detected as "unknown" on Windows.
|
|
54
|
+
const p = resolved.replace(/\\/g, "/");
|
|
55
|
+
if (p.includes("/Cellar/") || p.includes("/homebrew/"))
|
|
47
56
|
return "homebrew";
|
|
48
|
-
if (
|
|
57
|
+
if (p.includes("/snap/"))
|
|
49
58
|
return "snap";
|
|
50
|
-
if (
|
|
59
|
+
if (p.includes("/flatpak/") || p.includes("ai.eliza.Eliza"))
|
|
51
60
|
return "flatpak";
|
|
52
|
-
if (
|
|
61
|
+
if (p.startsWith("/usr/") && !p.includes("node_modules"))
|
|
53
62
|
return "apt";
|
|
54
|
-
if (
|
|
63
|
+
if (p.includes("/.bun/"))
|
|
55
64
|
return "bun-global";
|
|
56
|
-
if (
|
|
65
|
+
if (p.includes("node_modules"))
|
|
57
66
|
return "npm-global";
|
|
58
67
|
return "unknown";
|
|
59
68
|
}
|
|
@@ -180,8 +189,13 @@ function runCommand(command, args) {
|
|
|
180
189
|
return new Promise((resolve) => {
|
|
181
190
|
const child = spawn(command, args, {
|
|
182
191
|
stdio: ["inherit", "inherit", "pipe"],
|
|
183
|
-
//
|
|
184
|
-
//
|
|
192
|
+
// The global launcher is a `.cmd` shim on Windows (npm.cmd / bun.cmd),
|
|
193
|
+
// which Node cannot spawn without a shell (ENOENT) — every npm-global
|
|
194
|
+
// auto-update would fail. Route through the shell on win32 so the shim
|
|
195
|
+
// resolves. Update args are static/internal (e.g. `install -g <spec>`),
|
|
196
|
+
// so there is no injection surface; the Linux apt case uses an explicit
|
|
197
|
+
// `sh -c` and is unaffected.
|
|
198
|
+
shell: process.platform === "win32",
|
|
185
199
|
});
|
|
186
200
|
let stderr = "";
|
|
187
201
|
child.stderr.on("data", (chunk) => {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* `local-safe` actually hold.
|
|
16
16
|
*/
|
|
17
17
|
import { type RuntimeExecutionMode } from "@elizaos/shared";
|
|
18
|
-
import type { SandboxManager } from "./sandbox-manager.
|
|
18
|
+
import type { SandboxManager } from "./sandbox-manager.js";
|
|
19
19
|
export type ShellExecutionMode = RuntimeExecutionMode;
|
|
20
20
|
export type ShellSandboxBackend = "host" | "docker" | "apple-container" | "wsl2" | "appcontainer" | "vfs" | "none";
|
|
21
21
|
export interface ShellRequest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-execution-router.d.ts","sourceRoot":"","sources":["../../src/services/shell-execution-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"shell-execution-router.d.ts","sourceRoot":"","sources":["../../src/services/shell-execution-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD,MAAM,MAAM,mBA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CAAgC,IAAI,IAAI,CAGvD;AA+PD;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,YAAY,EACjB,GAAG,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAC9B,OAAO,CAAC,WAAW,CAAC,CAuDtB"}
|
|
@@ -18,6 +18,7 @@ import { spawn } from "node:child_process";
|
|
|
18
18
|
import fsp from "node:fs/promises";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import process from "node:process";
|
|
21
|
+
import { sanitizeSpawnEnv } from "@elizaos/core";
|
|
21
22
|
import { resolveRuntimeExecutionMode, } from "@elizaos/shared";
|
|
22
23
|
import { CapabilityBroker } from "./capability-broker.js";
|
|
23
24
|
import { isVfsUri, runVfsBuiltinShell } from "./vfs-builtin-shell.js";
|
|
@@ -68,6 +69,20 @@ export function __resetShellRouterBrokerForTests() {
|
|
|
68
69
|
cachedRouterBroker = null;
|
|
69
70
|
routerModeHolder.current = "local-yolo";
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Strip dangerous keys (LD_PRELOAD, NODE_OPTIONS, DYLD_*, proxy + package-manager
|
|
74
|
+
* config prefixes, ...) from a caller-supplied child environment before it
|
|
75
|
+
* reaches a spawned process. Delegates to the core spawn-env policy and narrows
|
|
76
|
+
* the result back to a string map (the policy only removes keys, never values).
|
|
77
|
+
*/
|
|
78
|
+
function sanitizeChildEnv(env) {
|
|
79
|
+
const out = {};
|
|
80
|
+
for (const [key, value] of Object.entries(sanitizeSpawnEnv(env))) {
|
|
81
|
+
if (value !== undefined)
|
|
82
|
+
out[key] = value;
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
71
86
|
async function runOnHost(req) {
|
|
72
87
|
const start = Date.now();
|
|
73
88
|
return await new Promise((resolve) => {
|
|
@@ -75,7 +90,9 @@ async function runOnHost(req) {
|
|
|
75
90
|
const useDetachedProcessGroup = process.platform !== "win32";
|
|
76
91
|
const child = spawn(req.command, req.args.slice(), {
|
|
77
92
|
cwd: req.cwd,
|
|
78
|
-
env: req.env
|
|
93
|
+
env: req.env
|
|
94
|
+
? { ...process.env, ...sanitizeChildEnv(req.env) }
|
|
95
|
+
: process.env,
|
|
79
96
|
detached: useDetachedProcessGroup,
|
|
80
97
|
stdio: ["ignore", "pipe", "pipe"],
|
|
81
98
|
});
|
|
@@ -145,7 +162,7 @@ async function runInSandbox(req, manager) {
|
|
|
145
162
|
cmd: req.command,
|
|
146
163
|
args: req.args,
|
|
147
164
|
workdir: req.cwd,
|
|
148
|
-
env: req.env,
|
|
165
|
+
env: req.env ? sanitizeChildEnv(req.env) : undefined,
|
|
149
166
|
timeoutMs: req.timeoutMs,
|
|
150
167
|
});
|
|
151
168
|
if (result.stdout)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `teeBootGateBlocksSecrets()` returns false and gated paths behave exactly as
|
|
13
13
|
* they did before TEE gating existed.
|
|
14
14
|
*/
|
|
15
|
-
import type { TeeBootGate } from "./tee-boot-gate.
|
|
15
|
+
import type { TeeBootGate } from "./tee-boot-gate.js";
|
|
16
16
|
/** Publish the one-time boot-gate decision for cross-module consumption. */
|
|
17
17
|
export declare function setTeeBootGateState(gate: TeeBootGate): void;
|
|
18
18
|
/** The published boot-gate decision, or undefined when none has been set. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TeeEvidenceProvider } from "./tee-evidence.
|
|
2
|
-
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.
|
|
3
|
-
import { type TeeProductionProfileOptions } from "./tee-production-profile.
|
|
4
|
-
import { type ResolveTeeRuntimePolicyOptions } from "./tee-runtime-config.
|
|
1
|
+
import type { TeeEvidenceProvider } from "./tee-evidence.js";
|
|
2
|
+
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.js";
|
|
3
|
+
import { type TeeProductionProfileOptions } from "./tee-production-profile.js";
|
|
4
|
+
import { type ResolveTeeRuntimePolicyOptions } from "./tee-runtime-config.js";
|
|
5
5
|
/**
|
|
6
6
|
* Boot-time TEE gate (plan §4.1). Consumes the resolved runtime policy, applies
|
|
7
7
|
* the production profile when configured, collects evidence via the provider,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TeeMeasurementName } from "./tee-evidence.
|
|
2
|
-
import type { TeeKeyReleaseClient, TeeKeyReleaseResult } from "./tee-key-release.
|
|
3
|
-
import type { TeeEvidencePolicy } from "./tee-policy.
|
|
1
|
+
import type { TeeMeasurementName } from "./tee-evidence.js";
|
|
2
|
+
import type { TeeKeyReleaseClient, TeeKeyReleaseResult } from "./tee-key-release.js";
|
|
3
|
+
import type { TeeEvidencePolicy } from "./tee-policy.js";
|
|
4
4
|
/**
|
|
5
5
|
* Confidential-inference unseal path (plan §2.2 steps 4–7).
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TeeEvidence, TeeEvidenceProvider } from "./tee-evidence.
|
|
2
|
-
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.
|
|
1
|
+
import type { TeeEvidence, TeeEvidenceProvider } from "./tee-evidence.js";
|
|
2
|
+
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.js";
|
|
3
3
|
export type TeeKeyReleaseRequest = {
|
|
4
4
|
keyId: string;
|
|
5
5
|
context?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type InferenceTopology, type ModelKeyUnsealResult, type SealedWeightsBlob, type SealedWeightsManifest, type ShardSink, type StreamingUnsealResult } from "./tee-confidential-inference.
|
|
2
|
-
import type { TeeMeasurementName } from "./tee-evidence.
|
|
3
|
-
import type { TeeKeyReleaseClient } from "./tee-key-release.
|
|
4
|
-
import type { TeeEvidencePolicy } from "./tee-policy.
|
|
1
|
+
import { type InferenceTopology, type ModelKeyUnsealResult, type SealedWeightsBlob, type SealedWeightsManifest, type ShardSink, type StreamingUnsealResult } from "./tee-confidential-inference.js";
|
|
2
|
+
import type { TeeMeasurementName } from "./tee-evidence.js";
|
|
3
|
+
import type { TeeKeyReleaseClient } from "./tee-key-release.js";
|
|
4
|
+
import type { TeeEvidencePolicy } from "./tee-policy.js";
|
|
5
5
|
/**
|
|
6
6
|
* Boot-time integration seam between the TEE confidential-inference unseal path
|
|
7
7
|
* (`tee-confidential-inference.ts`) and the local model runtime (plan §2.2).
|
package/services/tee-policy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TeeClaims, type TeeEvidence, type TeeKind, type TeeMeasurementName } from "./tee-evidence.
|
|
1
|
+
import { type TeeClaims, type TeeEvidence, type TeeKind, type TeeMeasurementName } from "./tee-evidence.js";
|
|
2
2
|
export type TeeEvidencePolicy = {
|
|
3
3
|
required?: boolean;
|
|
4
4
|
allowedKinds?: TeeKind[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TeeMeasurementName } from "./tee-evidence.
|
|
2
|
-
import type { TeeEvidencePolicy } from "./tee-policy.
|
|
1
|
+
import type { TeeMeasurementName } from "./tee-evidence.js";
|
|
2
|
+
import type { TeeEvidencePolicy } from "./tee-policy.js";
|
|
3
3
|
export type TeeRevocationEntry = {
|
|
4
4
|
value: string | number;
|
|
5
5
|
reason?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TeeMeasurementName } from "./tee-evidence.
|
|
2
|
-
import type { TeeKeyReleaseClient, TeeKeyReleaseResult } from "./tee-key-release.
|
|
3
|
-
import type { TeeEvidencePolicy } from "./tee-policy.
|
|
1
|
+
import type { TeeMeasurementName } from "./tee-evidence.js";
|
|
2
|
+
import type { TeeKeyReleaseClient, TeeKeyReleaseResult } from "./tee-key-release.js";
|
|
3
|
+
import type { TeeEvidencePolicy } from "./tee-policy.js";
|
|
4
4
|
/**
|
|
5
5
|
* Attestation-bound sealed state-volume key manager (plan §2.3 / Phase C item
|
|
6
6
|
* C3). Replaces dstack's host-readable LUKS2 key (GHSA-jxq2-hpw3-m5wf, plan
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SignerBackend, UnsignedTransaction } from "./remote-signing-service.
|
|
2
|
-
import type { TeeEvidenceProvider } from "./tee-evidence.
|
|
3
|
-
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.
|
|
1
|
+
import type { SignerBackend, UnsignedTransaction } from "./remote-signing-service.js";
|
|
2
|
+
import type { TeeEvidenceProvider } from "./tee-evidence.js";
|
|
3
|
+
import { type TeeEvidencePolicy, type TeeEvidencePolicyDecision } from "./tee-policy.js";
|
|
4
4
|
export type TeeSignerBackendConfig = {
|
|
5
5
|
signer: SignerBackend;
|
|
6
6
|
evidenceProvider: TeeEvidenceProvider;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Queries the npm registry for new elizaos versions on the user's
|
|
3
3
|
* configured release channel (stable/beta/nightly).
|
|
4
4
|
*/
|
|
5
|
-
import type { ReleaseChannel, UpdateConfig } from "../config/types.eliza.
|
|
5
|
+
import type { ReleaseChannel, UpdateConfig } from "../config/types.eliza.js";
|
|
6
6
|
/** npm dist-tag corresponding to each release channel. */
|
|
7
7
|
export declare const CHANNEL_DIST_TAGS: Readonly<Record<ReleaseChannel, string>>;
|
|
8
8
|
export interface UpdateCheckResult {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* added separately when that dependency is acceptable.
|
|
13
13
|
*/
|
|
14
14
|
import type { Vault } from "@elizaos/vault";
|
|
15
|
-
import type { SignerBackend, UnsignedTransaction } from "./remote-signing-service.
|
|
15
|
+
import type { SignerBackend, UnsignedTransaction } from "./remote-signing-service.js";
|
|
16
16
|
export interface VaultSignerBackendConfig {
|
|
17
17
|
readonly vault: Vault;
|
|
18
18
|
readonly agentId: string;
|
package/services/vfs-git.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PostWorkbenchVfsGitRequest } from "@elizaos/shared";
|
|
2
|
-
import type { VirtualFilesystemService } from "./virtual-filesystem.
|
|
2
|
+
import type { VirtualFilesystemService } from "./virtual-filesystem.js";
|
|
3
3
|
export interface VfsGitStatusEntry {
|
|
4
4
|
filepath: string;
|
|
5
5
|
head: GitFileState;
|
package/test-support/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./process-helpers.
|
|
2
|
-
export * from "./route-test-helpers.
|
|
3
|
-
export * from "./test-helpers.
|
|
1
|
+
export * from "./process-helpers.js";
|
|
2
|
+
export * from "./route-test-helpers.js";
|
|
3
|
+
export * from "./test-helpers.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/triggers/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAgentRuntime, Task } from "@elizaos/core";
|
|
2
|
-
import type { TriggerConfig, TriggerHealthSnapshot, TriggerRunRecord, TriggerSummary } from "./types.
|
|
2
|
+
import type { TriggerConfig, TriggerHealthSnapshot, TriggerRunRecord, TriggerSummary } from "./types.js";
|
|
3
3
|
export declare const TRIGGER_TASK_NAME: "TRIGGER_DISPATCH";
|
|
4
4
|
export declare const TRIGGER_TASK_TAGS: readonly ["queue", "repeat", "trigger"];
|
|
5
5
|
export interface TriggerExecutionOptions {
|
package/triggers/scheduling.d.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { UUID } from "@elizaos/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export declare const DISABLED_TRIGGER_INTERVAL_MS: number;
|
|
2
|
+
import { computeNextCronRunAtMs, DISABLED_TRIGGER_INTERVAL_MS, MAX_TRIGGER_INTERVAL_MS, MIN_TRIGGER_INTERVAL_MS, normalizeTriggerIntervalMs, parseCronExpression, parseScheduledAtIso, resolveTriggerTiming, type TriggerTiming } from "@elizaos/core";
|
|
3
|
+
import { type NormalizedTriggerDraft, type TriggerConfig, type TriggerKind, type TriggerTaskMetadata, type TriggerType, type TriggerWakeMode } from "./types.js";
|
|
4
|
+
export { computeNextCronRunAtMs, DISABLED_TRIGGER_INTERVAL_MS, MAX_TRIGGER_INTERVAL_MS, MIN_TRIGGER_INTERVAL_MS, normalizeTriggerIntervalMs, parseCronExpression, parseScheduledAtIso, resolveTriggerTiming, type TriggerTiming, };
|
|
6
5
|
export declare const MAX_TRIGGER_RUN_HISTORY = 100;
|
|
7
|
-
interface CronSchedule {
|
|
8
|
-
minute: Set<number>;
|
|
9
|
-
hour: Set<number>;
|
|
10
|
-
dayOfMonth: Set<number>;
|
|
11
|
-
month: Set<number>;
|
|
12
|
-
dayOfWeek: Set<number>;
|
|
13
|
-
}
|
|
14
|
-
export interface TriggerTiming {
|
|
15
|
-
updatedAt: number;
|
|
16
|
-
updateIntervalMs: number;
|
|
17
|
-
nextRunAtMs: number;
|
|
18
|
-
}
|
|
19
6
|
interface DraftInput {
|
|
20
7
|
displayName?: string;
|
|
21
8
|
instructions?: string;
|
|
@@ -34,11 +21,6 @@ interface DraftInput {
|
|
|
34
21
|
workflowName?: string;
|
|
35
22
|
}
|
|
36
23
|
export declare function normalizeText(value: string): string;
|
|
37
|
-
export declare function parseCronExpression(expression: string): CronSchedule | null;
|
|
38
|
-
export declare function computeNextCronRunAtMs(expression: string, fromMs: number, timezone?: string): number | null;
|
|
39
|
-
export declare function parseScheduledAtIso(scheduledAtIso: string): number | null;
|
|
40
|
-
export declare function normalizeTriggerIntervalMs(intervalMs: number): number;
|
|
41
|
-
export declare function resolveTriggerTiming(trigger: TriggerConfig, nowMs: number): TriggerTiming | null;
|
|
42
24
|
export declare function buildTriggerMetadata(params: {
|
|
43
25
|
existingMetadata?: TriggerTaskMetadata;
|
|
44
26
|
trigger: TriggerConfig;
|
|
@@ -74,5 +56,4 @@ export declare function normalizeTriggerDraft(params: {
|
|
|
74
56
|
draft?: NormalizedTriggerDraft;
|
|
75
57
|
error?: string;
|
|
76
58
|
};
|
|
77
|
-
export {};
|
|
78
59
|
//# sourceMappingURL=scheduling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../src/triggers/scheduling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../src/triggers/scheduling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,aAAa,GACnB,CAAC;AAEF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,UAAU,UAAU;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CA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