@elizaos/autonomous 2.0.0-alpha.10

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.
Files changed (241) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +270 -0
  3. package/src/actions/emote.ts +101 -0
  4. package/src/actions/restart.ts +101 -0
  5. package/src/actions/send-message.ts +168 -0
  6. package/src/actions/stream-control.ts +439 -0
  7. package/src/actions/switch-stream-source.ts +126 -0
  8. package/src/actions/terminal.ts +186 -0
  9. package/src/api/agent-admin-routes.ts +178 -0
  10. package/src/api/agent-lifecycle-routes.ts +129 -0
  11. package/src/api/agent-model.ts +143 -0
  12. package/src/api/agent-transfer-routes.ts +211 -0
  13. package/src/api/apps-routes.ts +210 -0
  14. package/src/api/auth-routes.ts +90 -0
  15. package/src/api/bsc-trade.ts +736 -0
  16. package/src/api/bug-report-routes.ts +161 -0
  17. package/src/api/character-routes.ts +421 -0
  18. package/src/api/cloud-billing-routes.ts +598 -0
  19. package/src/api/cloud-compat-routes.ts +192 -0
  20. package/src/api/cloud-routes.ts +529 -0
  21. package/src/api/cloud-status-routes.ts +234 -0
  22. package/src/api/compat-utils.ts +154 -0
  23. package/src/api/connector-health.ts +135 -0
  24. package/src/api/coordinator-wiring.ts +179 -0
  25. package/src/api/credit-detection.ts +47 -0
  26. package/src/api/database.ts +1357 -0
  27. package/src/api/diagnostics-routes.ts +389 -0
  28. package/src/api/drop-service.ts +205 -0
  29. package/src/api/early-logs.ts +111 -0
  30. package/src/api/http-helpers.ts +252 -0
  31. package/src/api/index.ts +85 -0
  32. package/src/api/knowledge-routes.ts +1189 -0
  33. package/src/api/knowledge-service-loader.ts +92 -0
  34. package/src/api/memory-bounds.ts +121 -0
  35. package/src/api/memory-routes.ts +349 -0
  36. package/src/api/merkle-tree.ts +239 -0
  37. package/src/api/models-routes.ts +72 -0
  38. package/src/api/nfa-routes.ts +169 -0
  39. package/src/api/nft-verify.ts +188 -0
  40. package/src/api/og-tracker.ts +72 -0
  41. package/src/api/parse-action-block.ts +145 -0
  42. package/src/api/permissions-routes.ts +222 -0
  43. package/src/api/plugin-validation.ts +355 -0
  44. package/src/api/provider-switch-config.ts +455 -0
  45. package/src/api/registry-routes.ts +165 -0
  46. package/src/api/registry-service.ts +292 -0
  47. package/src/api/route-helpers.ts +21 -0
  48. package/src/api/sandbox-routes.ts +1480 -0
  49. package/src/api/server.ts +17674 -0
  50. package/src/api/signal-routes.ts +265 -0
  51. package/src/api/stream-persistence.ts +297 -0
  52. package/src/api/stream-route-state.ts +48 -0
  53. package/src/api/stream-routes.ts +1046 -0
  54. package/src/api/stream-voice-routes.ts +208 -0
  55. package/src/api/streaming-text.ts +129 -0
  56. package/src/api/streaming-types.ts +23 -0
  57. package/src/api/subscription-routes.ts +283 -0
  58. package/src/api/terminal-run-limits.ts +31 -0
  59. package/src/api/training-backend-check.ts +40 -0
  60. package/src/api/training-routes.ts +314 -0
  61. package/src/api/training-service-like.ts +46 -0
  62. package/src/api/trajectory-routes.ts +714 -0
  63. package/src/api/trigger-routes.ts +438 -0
  64. package/src/api/twitter-verify.ts +226 -0
  65. package/src/api/tx-service.ts +193 -0
  66. package/src/api/wallet-dex-prices.ts +206 -0
  67. package/src/api/wallet-evm-balance.ts +989 -0
  68. package/src/api/wallet-routes.ts +505 -0
  69. package/src/api/wallet-rpc.ts +523 -0
  70. package/src/api/wallet-trading-profile.ts +694 -0
  71. package/src/api/wallet.ts +745 -0
  72. package/src/api/whatsapp-routes.ts +282 -0
  73. package/src/api/zip-utils.ts +130 -0
  74. package/src/auth/anthropic.ts +63 -0
  75. package/src/auth/apply-stealth.ts +38 -0
  76. package/src/auth/claude-code-stealth.ts +141 -0
  77. package/src/auth/credentials.ts +226 -0
  78. package/src/auth/index.ts +18 -0
  79. package/src/auth/openai-codex.ts +94 -0
  80. package/src/auth/types.ts +24 -0
  81. package/src/awareness/registry.ts +220 -0
  82. package/src/bin.ts +10 -0
  83. package/src/cli/index.ts +36 -0
  84. package/src/cli/parse-duration.ts +43 -0
  85. package/src/cloud/auth.test.ts +370 -0
  86. package/src/cloud/auth.ts +176 -0
  87. package/src/cloud/backup.test.ts +150 -0
  88. package/src/cloud/backup.ts +50 -0
  89. package/src/cloud/base-url.ts +45 -0
  90. package/src/cloud/bridge-client.test.ts +481 -0
  91. package/src/cloud/bridge-client.ts +307 -0
  92. package/src/cloud/cloud-manager.test.ts +223 -0
  93. package/src/cloud/cloud-manager.ts +151 -0
  94. package/src/cloud/cloud-proxy.test.ts +122 -0
  95. package/src/cloud/cloud-proxy.ts +52 -0
  96. package/src/cloud/index.ts +23 -0
  97. package/src/cloud/reconnect.test.ts +178 -0
  98. package/src/cloud/reconnect.ts +108 -0
  99. package/src/cloud/validate-url.test.ts +147 -0
  100. package/src/cloud/validate-url.ts +176 -0
  101. package/src/config/character-schema.ts +44 -0
  102. package/src/config/config.ts +149 -0
  103. package/src/config/env-vars.ts +86 -0
  104. package/src/config/includes.ts +196 -0
  105. package/src/config/index.ts +15 -0
  106. package/src/config/object-utils.ts +10 -0
  107. package/src/config/paths.ts +92 -0
  108. package/src/config/plugin-auto-enable.ts +520 -0
  109. package/src/config/schema.ts +1342 -0
  110. package/src/config/telegram-custom-commands.ts +99 -0
  111. package/src/config/types.agent-defaults.ts +342 -0
  112. package/src/config/types.agents.ts +112 -0
  113. package/src/config/types.gateway.ts +243 -0
  114. package/src/config/types.hooks.ts +124 -0
  115. package/src/config/types.messages.ts +201 -0
  116. package/src/config/types.milady.ts +791 -0
  117. package/src/config/types.tools.ts +416 -0
  118. package/src/config/types.ts +7 -0
  119. package/src/config/zod-schema.agent-runtime.ts +777 -0
  120. package/src/config/zod-schema.core.ts +778 -0
  121. package/src/config/zod-schema.hooks.ts +139 -0
  122. package/src/config/zod-schema.providers-core.ts +1126 -0
  123. package/src/config/zod-schema.session.ts +98 -0
  124. package/src/config/zod-schema.ts +865 -0
  125. package/src/contracts/apps.ts +46 -0
  126. package/src/contracts/awareness.ts +56 -0
  127. package/src/contracts/config.ts +172 -0
  128. package/src/contracts/drop.ts +21 -0
  129. package/src/contracts/index.ts +8 -0
  130. package/src/contracts/onboarding.ts +592 -0
  131. package/src/contracts/permissions.ts +52 -0
  132. package/src/contracts/verification.ts +9 -0
  133. package/src/contracts/wallet.ts +503 -0
  134. package/src/diagnostics/integration-observability.ts +132 -0
  135. package/src/emotes/catalog.ts +655 -0
  136. package/src/external-modules.d.ts +7 -0
  137. package/src/hooks/discovery.test.ts +357 -0
  138. package/src/hooks/discovery.ts +231 -0
  139. package/src/hooks/eligibility.ts +146 -0
  140. package/src/hooks/hooks.test.ts +320 -0
  141. package/src/hooks/index.ts +8 -0
  142. package/src/hooks/loader.test.ts +418 -0
  143. package/src/hooks/loader.ts +256 -0
  144. package/src/hooks/registry.test.ts +168 -0
  145. package/src/hooks/registry.ts +74 -0
  146. package/src/hooks/types.ts +121 -0
  147. package/src/index.ts +19 -0
  148. package/src/onboarding-presets.ts +828 -0
  149. package/src/plugins/custom-rtmp/index.ts +40 -0
  150. package/src/providers/admin-trust.ts +76 -0
  151. package/src/providers/session-bridge.ts +143 -0
  152. package/src/providers/session-utils.ts +42 -0
  153. package/src/providers/simple-mode.ts +113 -0
  154. package/src/providers/ui-catalog.ts +135 -0
  155. package/src/providers/workspace-provider.ts +213 -0
  156. package/src/providers/workspace.ts +497 -0
  157. package/src/runtime/agent-event-service.ts +57 -0
  158. package/src/runtime/cloud-onboarding.test.ts +489 -0
  159. package/src/runtime/cloud-onboarding.ts +408 -0
  160. package/src/runtime/core-plugins.ts +53 -0
  161. package/src/runtime/custom-actions.ts +605 -0
  162. package/src/runtime/eliza.ts +4941 -0
  163. package/src/runtime/embedding-presets.ts +73 -0
  164. package/src/runtime/index.ts +8 -0
  165. package/src/runtime/milady-plugin.ts +180 -0
  166. package/src/runtime/onboarding-names.ts +76 -0
  167. package/src/runtime/release-plugin-policy.ts +119 -0
  168. package/src/runtime/restart.ts +59 -0
  169. package/src/runtime/trajectory-persistence.ts +2584 -0
  170. package/src/runtime/version.ts +6 -0
  171. package/src/security/audit-log.ts +222 -0
  172. package/src/security/network-policy.ts +91 -0
  173. package/src/server/index.ts +6 -0
  174. package/src/services/agent-export.ts +976 -0
  175. package/src/services/app-manager.ts +755 -0
  176. package/src/services/browser-capture.ts +215 -0
  177. package/src/services/coding-agent-context.ts +355 -0
  178. package/src/services/fallback-training-service.ts +196 -0
  179. package/src/services/index.ts +17 -0
  180. package/src/services/mcp-marketplace.ts +327 -0
  181. package/src/services/plugin-manager-types.ts +185 -0
  182. package/src/services/privy-wallets.ts +352 -0
  183. package/src/services/registry-client-app-meta.ts +201 -0
  184. package/src/services/registry-client-endpoints.ts +253 -0
  185. package/src/services/registry-client-local.ts +485 -0
  186. package/src/services/registry-client-network.ts +173 -0
  187. package/src/services/registry-client-queries.ts +176 -0
  188. package/src/services/registry-client-types.ts +104 -0
  189. package/src/services/registry-client.ts +366 -0
  190. package/src/services/remote-signing-service.ts +261 -0
  191. package/src/services/sandbox-engine.ts +753 -0
  192. package/src/services/sandbox-manager.ts +503 -0
  193. package/src/services/self-updater.ts +213 -0
  194. package/src/services/signal-pairing.ts +189 -0
  195. package/src/services/signing-policy.ts +230 -0
  196. package/src/services/skill-catalog-client.ts +195 -0
  197. package/src/services/skill-marketplace.ts +909 -0
  198. package/src/services/stream-manager.ts +707 -0
  199. package/src/services/tts-stream-bridge.ts +465 -0
  200. package/src/services/update-checker.ts +163 -0
  201. package/src/services/version-compat.ts +367 -0
  202. package/src/services/whatsapp-pairing.ts +279 -0
  203. package/src/shared/ui-catalog-prompt.ts +1158 -0
  204. package/src/test-support/process-helpers.ts +35 -0
  205. package/src/test-support/route-test-helpers.ts +113 -0
  206. package/src/test-support/test-helpers.ts +304 -0
  207. package/src/testing/index.ts +3 -0
  208. package/src/triggers/action.ts +342 -0
  209. package/src/triggers/runtime.ts +432 -0
  210. package/src/triggers/scheduling.ts +472 -0
  211. package/src/triggers/types.ts +133 -0
  212. package/src/types/app-hyperscape-routes-shim.d.ts +29 -0
  213. package/src/types/external-modules.d.ts +7 -0
  214. package/src/utils/exec-safety.ts +23 -0
  215. package/src/utils/number-parsing.ts +112 -0
  216. package/src/utils/spoken-text.ts +65 -0
  217. package/src/version-resolver.ts +60 -0
  218. package/test/api/agent-admin-routes.test.ts +160 -0
  219. package/test/api/agent-lifecycle-routes.test.ts +164 -0
  220. package/test/api/agent-transfer-routes.test.ts +136 -0
  221. package/test/api/apps-routes.test.ts +140 -0
  222. package/test/api/auth-routes.test.ts +160 -0
  223. package/test/api/bug-report-routes.test.ts +88 -0
  224. package/test/api/knowledge-routes.test.ts +73 -0
  225. package/test/api/lifecycle.test.ts +342 -0
  226. package/test/api/memory-routes.test.ts +74 -0
  227. package/test/api/models-routes.test.ts +112 -0
  228. package/test/api/nfa-routes.test.ts +78 -0
  229. package/test/api/permissions-routes.test.ts +185 -0
  230. package/test/api/registry-routes.test.ts +157 -0
  231. package/test/api/signal-routes.test.ts +113 -0
  232. package/test/api/subscription-routes.test.ts +90 -0
  233. package/test/api/trigger-routes.test.ts +87 -0
  234. package/test/api/wallet-routes.observability.test.ts +191 -0
  235. package/test/api/wallet-routes.test.ts +502 -0
  236. package/test/diagnostics/integration-observability.test.ts +135 -0
  237. package/test/security/audit-log.test.ts +229 -0
  238. package/test/security/network-policy.test.ts +143 -0
  239. package/test/services/version-compat.test.ts +127 -0
  240. package/tsconfig.build.json +21 -0
  241. package/tsconfig.json +19 -0
@@ -0,0 +1,791 @@
1
+ import type { SessionConfig, SessionSendPolicyConfig } from "@elizaos/core";
2
+ import type {
3
+ CustomActionDef,
4
+ DatabaseProviderType,
5
+ MediaConfig,
6
+ ReleaseChannel,
7
+ } from "../contracts/config";
8
+ import type { AgentBinding, AgentsConfig } from "./types.agents";
9
+ import type {
10
+ DiscoveryConfig,
11
+ GatewayConfig,
12
+ TalkConfig,
13
+ } from "./types.gateway";
14
+ import type { HooksConfig } from "./types.hooks";
15
+ import type {
16
+ AudioConfig,
17
+ BroadcastConfig,
18
+ CommandsConfig,
19
+ MessagesConfig,
20
+ } from "./types.messages";
21
+ import type { ToolsConfig } from "./types.tools";
22
+
23
+ export type {
24
+ AudioElevenlabsSfxConfig,
25
+ AudioGenConfig,
26
+ AudioGenProvider,
27
+ AudioSunoConfig,
28
+ CustomActionDef,
29
+ CustomActionHandler,
30
+ DatabaseProviderType,
31
+ ImageConfig,
32
+ ImageFalConfig,
33
+ ImageGoogleConfig,
34
+ ImageOpenaiConfig,
35
+ ImageProvider,
36
+ ImageXaiConfig,
37
+ MediaConfig,
38
+ MediaMode,
39
+ ReleaseChannel,
40
+ VideoConfig,
41
+ VideoFalConfig,
42
+ VideoGoogleConfig,
43
+ VideoOpenaiConfig,
44
+ VideoProvider,
45
+ VisionAnthropicConfig,
46
+ VisionConfig,
47
+ VisionGoogleConfig,
48
+ VisionOllamaConfig,
49
+ VisionOpenaiConfig,
50
+ VisionProvider,
51
+ VisionXaiConfig,
52
+ } from "../contracts/config";
53
+
54
+ // --- Auth types (merged from types.auth.ts) ---
55
+
56
+ export type AuthProfileConfig = {
57
+ provider: string;
58
+ /**
59
+ * Credential type expected in auth-profiles.json for this profile id.
60
+ * - api_key: static provider API key
61
+ * - oauth: refreshable OAuth credentials (access+refresh+expires)
62
+ * - token: static bearer-style token (optionally expiring; no refresh)
63
+ */
64
+ mode: "api_key" | "oauth" | "token";
65
+ email?: string;
66
+ };
67
+
68
+ export type AuthConfig = {
69
+ profiles?: Record<string, AuthProfileConfig>;
70
+ order?: Record<string, string[]>;
71
+ cooldowns?: {
72
+ /** Default billing backoff (hours). Default: 5. */
73
+ billingBackoffHours?: number;
74
+ /** Optional per-provider billing backoff (hours). */
75
+ billingBackoffHoursByProvider?: Record<string, number>;
76
+ /** Billing backoff cap (hours). Default: 24. */
77
+ billingMaxHours?: number;
78
+ /**
79
+ * Failure window for backoff counters (hours). If no failures occur within
80
+ * this window, counters reset. Default: 24.
81
+ */
82
+ failureWindowHours?: number;
83
+ };
84
+ };
85
+
86
+ // --- Browser types (merged from types.browser.ts) ---
87
+
88
+ export type BrowserProfileConfig = {
89
+ /** CDP port for this profile. Allocated once at creation, persisted permanently. */
90
+ cdpPort?: number;
91
+ /** CDP URL for this profile (use for remote Chrome). */
92
+ cdpUrl?: string;
93
+ /** Profile driver (default: milady). */
94
+ driver?: "milady" | "extension";
95
+ /** Profile color (hex). Auto-assigned at creation. */
96
+ color: string;
97
+ };
98
+ export type BrowserSnapshotDefaults = {
99
+ /** Default snapshot mode (applies when mode is not provided). */
100
+ mode?: "efficient";
101
+ };
102
+ export type BrowserConfig = {
103
+ enabled?: boolean;
104
+ /** If false, disable browser act:evaluate (arbitrary JS). Default: true */
105
+ evaluateEnabled?: boolean;
106
+ /** Base URL of the CDP endpoint (for remote browsers). Default: loopback CDP on the derived port. */
107
+ cdpUrl?: string;
108
+ /** Remote CDP HTTP timeout (ms). Default: 1500. */
109
+ remoteCdpTimeoutMs?: number;
110
+ /** Remote CDP WebSocket handshake timeout (ms). Default: max(remoteCdpTimeoutMs * 2, 2000). */
111
+ remoteCdpHandshakeTimeoutMs?: number;
112
+ /** Accent color for the milady browser profile (hex). Default: #FF4500 */
113
+ color?: string;
114
+ /** Override the browser executable path (all platforms). */
115
+ executablePath?: string;
116
+ /** Start Chrome headless (best-effort). Default: false */
117
+ headless?: boolean;
118
+ /** Pass --no-sandbox to Chrome (Linux containers). Default: false */
119
+ noSandbox?: boolean;
120
+ /** If true: never launch; only attach to an existing browser. Default: false */
121
+ attachOnly?: boolean;
122
+ /** Default profile to use when profile param is omitted. Default: "chrome" */
123
+ defaultProfile?: string;
124
+ /** Named browser profiles with explicit CDP ports or URLs. */
125
+ profiles?: Record<string, BrowserProfileConfig>;
126
+ /** Default snapshot options (applied by the browser tool/CLI when unset). */
127
+ snapshotDefaults?: BrowserSnapshotDefaults;
128
+ };
129
+
130
+ // --- Skills types (merged from types.skills.ts) ---
131
+
132
+ export type SkillConfig = {
133
+ enabled?: boolean;
134
+ apiKey?: string;
135
+ env?: Record<string, string>;
136
+ config?: Record<string, unknown>;
137
+ };
138
+
139
+ export type SkillsLoadConfig = {
140
+ /**
141
+ * Additional skill folders to scan (lowest precedence).
142
+ * Each directory should contain skill subfolders with `SKILL.md`.
143
+ */
144
+ extraDirs?: string[];
145
+ /** Watch skill folders for changes and refresh the skills snapshot. */
146
+ watch?: boolean;
147
+ /** Debounce for the skills watcher (ms). */
148
+ watchDebounceMs?: number;
149
+ };
150
+
151
+ export type SkillsInstallConfig = {
152
+ preferBrew?: boolean;
153
+ nodeManager?: "npm" | "yarn" | "bun";
154
+ };
155
+
156
+ export type SkillsConfig = {
157
+ /** Optional bundled-skill allowlist (only these bundled skills load). */
158
+ allowBundled?: string[];
159
+ /** Skills to explicitly deny/block from loading (takes priority over allow). */
160
+ denyBundled?: string[];
161
+ load?: SkillsLoadConfig;
162
+ install?: SkillsInstallConfig;
163
+ /** Per-skill configuration. Set `enabled: false` to disable a skill. */
164
+ entries?: Record<string, SkillConfig>;
165
+ };
166
+
167
+ export type KnowledgeConfig = {
168
+ /** Enable contextual knowledge enrichment for document ingestion. */
169
+ contextualEnrichment?: boolean;
170
+ /** Docs directory path used for enrichment context. */
171
+ docsPath?: string;
172
+ };
173
+
174
+ // --- Models types (merged from types.models.ts) ---
175
+
176
+ export type ModelApi =
177
+ | "openai-completions"
178
+ | "openai-responses"
179
+ | "anthropic-messages"
180
+ | "google-generative-ai"
181
+ | "bedrock-converse-stream";
182
+
183
+ export type ModelCompatConfig = {
184
+ supportsStore?: boolean;
185
+ supportsDeveloperRole?: boolean;
186
+ supportsReasoningEffort?: boolean;
187
+ maxTokensField?: "max_completion_tokens" | "max_tokens";
188
+ };
189
+
190
+ export type ModelProviderAuthMode = "api-key" | "aws-sdk" | "oauth" | "token";
191
+
192
+ export type ModelDefinitionConfig = {
193
+ id: string;
194
+ name: string;
195
+ api?: ModelApi;
196
+ reasoning: boolean;
197
+ input: Array<"text" | "image">;
198
+ cost: {
199
+ input: number;
200
+ output: number;
201
+ cacheRead: number;
202
+ cacheWrite: number;
203
+ };
204
+ contextWindow: number;
205
+ maxTokens: number;
206
+ headers?: Record<string, string>;
207
+ compat?: ModelCompatConfig;
208
+ };
209
+
210
+ export type ModelProviderConfig = {
211
+ baseUrl: string;
212
+ apiKey?: string;
213
+ auth?: ModelProviderAuthMode;
214
+ api?: ModelApi;
215
+ headers?: Record<string, string>;
216
+ authHeader?: boolean;
217
+ models: ModelDefinitionConfig[];
218
+ };
219
+
220
+ export type BedrockDiscoveryConfig = {
221
+ enabled?: boolean;
222
+ region?: string;
223
+ providerFilter?: string[];
224
+ refreshInterval?: number;
225
+ defaultContextWindow?: number;
226
+ defaultMaxTokens?: number;
227
+ };
228
+
229
+ export type ModelsConfig = {
230
+ mode?: "merge" | "replace";
231
+ providers?: Record<string, ModelProviderConfig>;
232
+ bedrockDiscovery?: BedrockDiscoveryConfig;
233
+ /** Selected small model ID for fast tasks (e.g. "claude-haiku"). Set during onboarding. */
234
+ small?: string;
235
+ /** Selected large model ID for complex reasoning (e.g. "claude-sonnet-4-5"). Set during onboarding. */
236
+ large?: string;
237
+ };
238
+
239
+ // --- Cron types (merged from types.cron.ts) ---
240
+
241
+ export type CronConfig = {
242
+ enabled?: boolean;
243
+ store?: string;
244
+ maxConcurrentRuns?: number;
245
+ };
246
+
247
+ // --- Node host types (merged from types.node-host.ts) ---
248
+
249
+ export type NodeHostBrowserProxyConfig = {
250
+ /** Enable the browser proxy on the node host (default: true). */
251
+ enabled?: boolean;
252
+ /** Optional allowlist of profile names exposed via the proxy. */
253
+ allowProfiles?: string[];
254
+ };
255
+
256
+ export type NodeHostConfig = {
257
+ /** Browser proxy settings for node hosts. */
258
+ browserProxy?: NodeHostBrowserProxyConfig;
259
+ };
260
+
261
+ // --- Approvals types (merged from types.approvals.ts) ---
262
+
263
+ export type ExecApprovalForwardingMode = "session" | "targets" | "both";
264
+
265
+ export type ExecApprovalForwardTarget = {
266
+ /** Channel id (e.g. "discord", "slack", or plugin channel id). */
267
+ channel: string;
268
+ /** Destination id (channel id, user id, etc. depending on channel). */
269
+ to: string;
270
+ /** Optional account id for multi-account channels. */
271
+ accountId?: string;
272
+ /** Optional thread id to reply inside a thread. */
273
+ threadId?: string | number;
274
+ };
275
+
276
+ export type ExecApprovalForwardingConfig = {
277
+ /** Enable forwarding exec approvals to chat channels. Default: false. */
278
+ enabled?: boolean;
279
+ /** Delivery mode (session=origin chat, targets=config targets, both=both). Default: session. */
280
+ mode?: ExecApprovalForwardingMode;
281
+ /** Only forward approvals for these agent IDs. Omit = all agents. */
282
+ agentFilter?: string[];
283
+ /** Only forward approvals matching these session key patterns (substring or regex). */
284
+ sessionFilter?: string[];
285
+ /** Explicit delivery targets (used when mode includes targets). */
286
+ targets?: ExecApprovalForwardTarget[];
287
+ };
288
+
289
+ export type ApprovalsConfig = {
290
+ exec?: ExecApprovalForwardingConfig;
291
+ };
292
+
293
+ // --- Base types (merged from types.base.ts) ---
294
+
295
+ export type LoggingConfig = {
296
+ level?: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace";
297
+ file?: string;
298
+ consoleLevel?:
299
+ | "silent"
300
+ | "fatal"
301
+ | "error"
302
+ | "warn"
303
+ | "info"
304
+ | "debug"
305
+ | "trace";
306
+ consoleStyle?: "pretty" | "compact" | "json";
307
+ /** Redact sensitive tokens in tool summaries. Default: "tools". */
308
+ redactSensitive?: "off" | "tools";
309
+ /** Regex patterns used to redact sensitive tokens (defaults apply when unset). */
310
+ redactPatterns?: string[];
311
+ };
312
+
313
+ export type DiagnosticsOtelConfig = {
314
+ enabled?: boolean;
315
+ endpoint?: string;
316
+ protocol?: "http/protobuf" | "grpc";
317
+ headers?: Record<string, string>;
318
+ serviceName?: string;
319
+ traces?: boolean;
320
+ metrics?: boolean;
321
+ logs?: boolean;
322
+ /** Trace sample rate (0.0 - 1.0). */
323
+ sampleRate?: number;
324
+ /** Metric export interval (ms). */
325
+ flushIntervalMs?: number;
326
+ };
327
+
328
+ export type DiagnosticsCacheTraceConfig = {
329
+ enabled?: boolean;
330
+ filePath?: string;
331
+ includeMessages?: boolean;
332
+ includePrompt?: boolean;
333
+ includeSystem?: boolean;
334
+ };
335
+
336
+ export type DiagnosticsConfig = {
337
+ enabled?: boolean;
338
+ /** Optional ad-hoc diagnostics flags (e.g. "telegram.http"). */
339
+ flags?: string[];
340
+ otel?: DiagnosticsOtelConfig;
341
+ cacheTrace?: DiagnosticsCacheTraceConfig;
342
+ };
343
+
344
+ export type WebReconnectConfig = {
345
+ initialMs?: number;
346
+ maxMs?: number;
347
+ factor?: number;
348
+ jitter?: number;
349
+ maxAttempts?: number; // 0 = unlimited
350
+ };
351
+
352
+ export type WebConfig = {
353
+ /** If false, do not start the WhatsApp web provider. Default: true. */
354
+ enabled?: boolean;
355
+ heartbeatSeconds?: number;
356
+ reconnect?: WebReconnectConfig;
357
+ };
358
+
359
+ // --- Memory types (merged from types.memory.ts) ---
360
+
361
+ export type MemoryBackend = "builtin" | "qmd";
362
+ export type MemoryCitationsMode = "auto" | "on" | "off";
363
+
364
+ export type MemoryConfig = {
365
+ backend?: MemoryBackend;
366
+ citations?: MemoryCitationsMode;
367
+ qmd?: MemoryQmdConfig;
368
+ };
369
+
370
+ export type MemoryQmdConfig = {
371
+ command?: string;
372
+ includeDefaultMemory?: boolean;
373
+ paths?: MemoryQmdIndexPath[];
374
+ sessions?: MemoryQmdSessionConfig;
375
+ update?: MemoryQmdUpdateConfig;
376
+ limits?: MemoryQmdLimitsConfig;
377
+ scope?: SessionSendPolicyConfig;
378
+ };
379
+
380
+ export type MemoryQmdIndexPath = {
381
+ path: string;
382
+ name?: string;
383
+ pattern?: string;
384
+ };
385
+
386
+ export type MemoryQmdSessionConfig = {
387
+ enabled?: boolean;
388
+ exportDir?: string;
389
+ retentionDays?: number;
390
+ };
391
+
392
+ export type MemoryQmdUpdateConfig = {
393
+ interval?: string;
394
+ debounceMs?: number;
395
+ onBoot?: boolean;
396
+ embedInterval?: string;
397
+ };
398
+
399
+ export type MemoryQmdLimitsConfig = {
400
+ maxResults?: number;
401
+ maxSnippetChars?: number;
402
+ maxInjectedChars?: number;
403
+ timeoutMs?: number;
404
+ };
405
+
406
+ // --- Database types ---
407
+
408
+ export type PgliteConfig = {
409
+ /** Custom PGLite data directory. Default: ~/.milady/workspace/.eliza/.elizadb */
410
+ dataDir?: string;
411
+ };
412
+
413
+ export type PostgresCredentials = {
414
+ /** Full PostgreSQL connection string. Takes precedence over individual fields. */
415
+ connectionString?: string;
416
+ /** PostgreSQL host. Default: localhost */
417
+ host?: string;
418
+ /** PostgreSQL port. Default: 5432 */
419
+ port?: number;
420
+ /** Database name. */
421
+ database?: string;
422
+ /** Database user. */
423
+ user?: string;
424
+ /** Database password. */
425
+ password?: string;
426
+ /** Enable SSL connection. Default: false */
427
+ ssl?: boolean;
428
+ };
429
+
430
+ export type DatabaseConfig = {
431
+ /** Active database provider. Default: "pglite". */
432
+ provider?: DatabaseProviderType;
433
+ /** PGLite (local embedded Postgres) configuration. */
434
+ pglite?: PgliteConfig;
435
+ /** Remote PostgreSQL configuration. */
436
+ postgres?: PostgresCredentials;
437
+ };
438
+
439
+ // --- Plugins types (merged from types.plugins.ts) ---
440
+
441
+ export type PluginEntryConfig = {
442
+ enabled?: boolean;
443
+ config?: Record<string, unknown>;
444
+ };
445
+
446
+ export type PluginSlotsConfig = {
447
+ /** Select which plugin owns the memory slot ("none" disables memory plugins). */
448
+ memory?: string;
449
+ };
450
+
451
+ export type PluginsLoadConfig = {
452
+ /** Additional plugin/extension paths to load. */
453
+ paths?: string[];
454
+ };
455
+
456
+ export type PluginInstallRecord = {
457
+ source: "npm" | "archive" | "path";
458
+ spec?: string;
459
+ sourcePath?: string;
460
+ installPath?: string;
461
+ version?: string;
462
+ installedAt?: string;
463
+ };
464
+
465
+ export type RegistryEndpoint = {
466
+ /** Human-friendly label shown in UI. */
467
+ label: string;
468
+ /** Endpoint URL returning registry JSON payload. */
469
+ url: string;
470
+ /** Whether this endpoint is enabled for fetch/merge. */
471
+ enabled?: boolean;
472
+ };
473
+
474
+ export type PluginsConfig = {
475
+ /** Enable or disable plugin loading. */
476
+ enabled?: boolean;
477
+ /** Optional plugin allowlist (plugin ids). */
478
+ allow?: string[];
479
+ /** Optional plugin denylist (plugin ids). */
480
+ deny?: string[];
481
+ load?: PluginsLoadConfig;
482
+ slots?: PluginSlotsConfig;
483
+ entries?: Record<string, PluginEntryConfig>;
484
+ installs?: Record<string, PluginInstallRecord>;
485
+ /** Additional plugin registry endpoints. */
486
+ registryEndpoints?: RegistryEndpoint[];
487
+ };
488
+
489
+ // --- Cloud types (Eliza Cloud integration) ---
490
+
491
+ export type CloudInferenceMode = "cloud" | "byok" | "local";
492
+
493
+ export type CloudBridgeConfig = {
494
+ /** Reconnection interval base (ms). Default: 3000. */
495
+ reconnectIntervalMs?: number;
496
+ /** Max reconnection attempts. Default: 20. */
497
+ maxReconnectAttempts?: number;
498
+ /** Heartbeat interval (ms). Default: 30000. */
499
+ heartbeatIntervalMs?: number;
500
+ };
501
+
502
+ export type CloudBackupConfig = {
503
+ /** Auto-backup interval (ms). Default: 3600000 (1 hour). */
504
+ autoBackupIntervalMs?: number;
505
+ /** Maximum auto-snapshots to retain. Default: 10. */
506
+ maxSnapshots?: number;
507
+ };
508
+
509
+ export type CloudContainerDefaults = {
510
+ /** Default ECR image URI for agent containers. */
511
+ defaultImage?: string;
512
+ /** Default CPU architecture. Default: arm64. */
513
+ defaultArchitecture?: "arm64" | "x86_64";
514
+ /** Default CPU units. Default: 1792. */
515
+ defaultCpu?: number;
516
+ /** Default memory (MB). Default: 1792. */
517
+ defaultMemory?: number;
518
+ /** Default container port. Default: 2138. */
519
+ defaultPort?: number;
520
+ };
521
+
522
+ export type CloudServiceToggles = {
523
+ /** Use Eliza Cloud for model inference. Default: true. */
524
+ inference?: boolean;
525
+ /** Use Eliza Cloud for blockchain RPC. Default: true. */
526
+ rpc?: boolean;
527
+ /** Use Eliza Cloud for media generation (image/video/audio/vision). Default: true. */
528
+ media?: boolean;
529
+ /** Use Eliza Cloud for TTS (text-to-speech). Default: true. */
530
+ tts?: boolean;
531
+ /** Use Eliza Cloud for embeddings. Default: true. */
532
+ embeddings?: boolean;
533
+ };
534
+
535
+ export type CloudConfig = {
536
+ /** Enable Eliza Cloud integration. Default: false. */
537
+ enabled?: boolean;
538
+ /** Selected cloud provider ID (e.g. "elizacloud"). Set during onboarding. */
539
+ provider?: string;
540
+ /** Eliza Cloud API base URL. Default: https://elizacloud.ai/api/v1 */
541
+ baseUrl?: string;
542
+ /** Cached API key (stored encrypted via gateway auth). */
543
+ apiKey?: string;
544
+ /** ID of the cloud agent created during onboarding. */
545
+ agentId?: string;
546
+ /** Inference mode: cloud (proxied), byok (user keys), local (no cloud). */
547
+ inferenceMode?: CloudInferenceMode;
548
+ /** Granular service toggles — pick which cloud services to use. */
549
+ services?: CloudServiceToggles;
550
+ /** Runtime mode chosen during onboarding: "cloud" or "local". */
551
+ runtime?: "cloud" | "local";
552
+ /** Auto-deploy agents to cloud on creation. Default: false. */
553
+ autoProvision?: boolean;
554
+ /** Bridge settings for WebSocket communication with cloud agents. */
555
+ bridge?: CloudBridgeConfig;
556
+ /** Backup settings for agent state snapshots. */
557
+ backup?: CloudBackupConfig;
558
+ /** Default container settings for new cloud deployments. */
559
+ container?: CloudContainerDefaults;
560
+ };
561
+
562
+ /** CUA (Computer Use Agent) configuration. Supports local (Lume VM) and cloud modes. */
563
+ export type CuaConfig = {
564
+ /** Enable the CUA plugin. Default: false. */
565
+ enabled?: boolean;
566
+ /** Local mode: host:port of the CUA computer server (e.g. "localhost:8002"). Skips cloud API. */
567
+ host?: string;
568
+ /** Cloud mode: CUA API key for cloud sandbox access. */
569
+ apiKey?: string;
570
+ /** Cloud mode: Name of the CUA cloud sandbox. */
571
+ sandboxName?: string;
572
+ /** OS type for the sandbox: linux, windows, macos, android. Default: linux. */
573
+ osType?: "linux" | "windows" | "macos" | "android";
574
+ /** Custom CUA API base URL. */
575
+ apiBase?: string;
576
+ /** OpenAI model for computer-use (default: computer-use-preview). */
577
+ computerUseModel?: string;
578
+ /** Maximum steps per run (default: 30). */
579
+ maxSteps?: number;
580
+ /** Auto-acknowledge safety checks (default: false). */
581
+ autoAckSafetyChecks?: boolean;
582
+ /** Connect to sandbox on plugin start (default: false). */
583
+ connectOnStart?: boolean;
584
+ /** Disconnect from sandbox after each run (default: true). */
585
+ disconnectAfterRun?: boolean;
586
+ };
587
+
588
+ /** x402 HTTP payment protocol configuration. */
589
+ export type X402Config = {
590
+ enabled?: boolean;
591
+ privateKey?: string;
592
+ network?: string;
593
+ payTo?: string;
594
+ facilitatorUrl?: string;
595
+ maxPaymentUsd?: number;
596
+ maxTotalUsd?: number;
597
+ dbPath?: string;
598
+ };
599
+
600
+ // ============================================================================
601
+ // Media Generation Types
602
+ // ============================================================================
603
+
604
+ // --- Local embedding runtime config ---
605
+
606
+ export type EmbeddingConfig = {
607
+ /** GGUF model filename (e.g. "nomic-embed-text-v1.5.Q5_K_M.gguf"). */
608
+ model?: string;
609
+ /** Optional Hugging Face repo/source for model resolution. */
610
+ modelRepo?: string;
611
+ /** Embedding vector dimension (default: 768). */
612
+ dimensions?: number;
613
+ /** Embedding context window size (must match the model; default: model hint). */
614
+ contextSize?: number;
615
+ /** GPU layers for model loading: "auto", "max", or a number. */
616
+ gpuLayers?: number | "auto" | "max";
617
+ /** Minutes of inactivity before unloading model from memory (default: 30, 0 = never). */
618
+ idleTimeoutMinutes?: number;
619
+ };
620
+
621
+ // --- Update/release channel types ---
622
+
623
+ export type UpdateConfig = {
624
+ channel?: ReleaseChannel;
625
+ /** Default: true. */
626
+ checkOnStart?: boolean;
627
+ lastCheckAt?: string;
628
+ lastCheckVersion?: string;
629
+ /** Seconds between automatic checks. Default: 14400 (4 hours). */
630
+ checkIntervalSeconds?: number;
631
+ };
632
+
633
+ // --- Custom Actions types ---
634
+
635
+ // --- Connector types ---
636
+
637
+ /** JSON-serializable value for connector configuration fields. */
638
+ export type ConnectorFieldValue =
639
+ | string
640
+ | number
641
+ | boolean
642
+ | string[]
643
+ | { [key: string]: ConnectorFieldValue | undefined }
644
+ | undefined;
645
+
646
+ /**
647
+ * Configuration for a single messaging connector (e.g. Telegram, Discord).
648
+ *
649
+ * Common fields:
650
+ * - `enabled` — disable without removing config
651
+ * - `botToken` / `token` / `apiKey` — authentication credential
652
+ * - `dmPolicy` — DM access control ("open" | "pairing" | "closed")
653
+ * - `configWrites` — allow the connector to write config on events
654
+ */
655
+ export type ConnectorConfig = { [key: string]: ConnectorFieldValue };
656
+
657
+ export type MiladyConfig = {
658
+ meta?: {
659
+ /** Explicit onboarding completion marker. Reset clears the entire state dir. */
660
+ onboardingComplete?: boolean;
661
+ /** Last Milady version that wrote this config. */
662
+ lastTouchedVersion?: string;
663
+ /** ISO timestamp when this config was last written. */
664
+ lastTouchedAt?: string;
665
+ };
666
+ auth?: AuthConfig;
667
+ env?: {
668
+ /** Opt-in: import missing secrets from a login shell environment (exec `$SHELL -l -c 'env -0'`). */
669
+ shellEnv?: {
670
+ enabled?: boolean;
671
+ /** Timeout for the login shell exec (ms). Default: 15000. */
672
+ timeoutMs?: number;
673
+ };
674
+ /** Inline env vars to apply when not already present in the process env. */
675
+ vars?: Record<string, string>;
676
+ /** Sugar: allow env vars directly under env (string values only). */
677
+ [key: string]:
678
+ | string
679
+ | Record<string, string>
680
+ | { enabled?: boolean; timeoutMs?: number }
681
+ | undefined;
682
+ };
683
+ wizard?: {
684
+ lastRunAt?: string;
685
+ lastRunVersion?: string;
686
+ lastRunCommit?: string;
687
+ lastRunCommand?: string;
688
+ lastRunMode?: "local" | "remote";
689
+ };
690
+ diagnostics?: DiagnosticsConfig;
691
+ logging?: LoggingConfig;
692
+ update?: UpdateConfig;
693
+ browser?: BrowserConfig;
694
+ ui?: {
695
+ /** Accent color for Milady UI chrome (hex). */
696
+ seamColor?: string;
697
+ /** User's preferred UI theme. Set during onboarding. */
698
+ theme?: "milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho";
699
+ assistant?: {
700
+ /** Assistant display name for UI surfaces. */
701
+ name?: string;
702
+ /** Assistant avatar (emoji, short text, or image URL/data URI). */
703
+ avatar?: string;
704
+ };
705
+ };
706
+ knowledge?: KnowledgeConfig;
707
+ skills?: SkillsConfig;
708
+ plugins?: PluginsConfig;
709
+ models?: ModelsConfig;
710
+ nodeHost?: NodeHostConfig;
711
+ agents?: AgentsConfig;
712
+ tools?: ToolsConfig;
713
+ bindings?: AgentBinding[];
714
+ broadcast?: BroadcastConfig;
715
+ audio?: AudioConfig;
716
+ messages?: MessagesConfig;
717
+ commands?: CommandsConfig;
718
+ approvals?: ApprovalsConfig;
719
+ session?: SessionConfig;
720
+ web?: WebConfig;
721
+ /** @deprecated Use `connectors` instead. Kept for backward compatibility during migration. */
722
+ channels?: Record<string, ConnectorConfig>;
723
+ cron?: CronConfig;
724
+ hooks?: HooksConfig;
725
+ discovery?: DiscoveryConfig;
726
+ talk?: TalkConfig;
727
+ gateway?: GatewayConfig;
728
+ memory?: MemoryConfig;
729
+ /** Local embedding model configuration (Metal GPU, idle unloading, model selection). */
730
+ embedding?: EmbeddingConfig;
731
+ /** Database provider and connection configuration (local-only feature). */
732
+ database?: DatabaseConfig;
733
+ /** Eliza Cloud integration for remote agent provisioning and inference. */
734
+ cloud?: CloudConfig;
735
+ /** CUA (Computer Use Agent) cloud sandbox configuration. */
736
+ cua?: CuaConfig;
737
+ x402?: X402Config;
738
+ /** Media generation configuration (image, video, audio, vision providers). */
739
+ media?: MediaConfig;
740
+ /** Messaging connector configuration (Telegram, Discord, Slack, etc.). */
741
+ connectors?: Record<string, ConnectorConfig>;
742
+ /** MCP server configuration. */
743
+ mcp?: {
744
+ servers?: Record<
745
+ string,
746
+ {
747
+ type: string;
748
+ command?: string;
749
+ args?: string[];
750
+ url?: string;
751
+ env?: Record<string, string>;
752
+ headers?: Record<string, string>;
753
+ cwd?: string;
754
+ timeoutInMillis?: number;
755
+ }
756
+ >;
757
+ };
758
+ /** ERC-8004 agent registry and MiladyMaker NFT collection configuration. */
759
+ registry?: {
760
+ /** Ethereum mainnet (or local Anvil) RPC URL. */
761
+ mainnetRpc?: string;
762
+ /** MiladyAgentRegistry contract address. */
763
+ registryAddress?: string;
764
+ /** MiladyMaker collection contract address. */
765
+ collectionAddress?: string;
766
+ };
767
+ /** Feature flags for plugin auto-enable. */
768
+ features?: Record<
769
+ string,
770
+ boolean | { enabled?: boolean; [k: string]: unknown }
771
+ >;
772
+ /** User-defined custom actions for the agent. */
773
+ customActions?: CustomActionDef[];
774
+ };
775
+
776
+ export type ConfigValidationIssue = {
777
+ path: string;
778
+ message: string;
779
+ };
780
+
781
+ export type ConfigFileSnapshot = {
782
+ path: string;
783
+ exists: boolean;
784
+ raw: string | null;
785
+ parsed: unknown;
786
+ valid: boolean;
787
+ config: MiladyConfig;
788
+ hash?: string;
789
+ issues: ConfigValidationIssue[];
790
+ warnings: ConfigValidationIssue[];
791
+ };