@elizaos/autonomous 2.0.0-alpha.13 → 2.0.0-alpha.14
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/.turbo/turbo-build.log +12 -26
- package/dist/packages/autonomous/src/actions/emote.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/restart.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/restart.js +0 -1
- package/dist/packages/autonomous/src/actions/send-message.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/switch-stream-source.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/agent-lifecycle-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/agent-lifecycle-routes.js +1 -1
- package/dist/packages/autonomous/src/api/apps-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/apps-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/character-routes.js +1 -1
- package/dist/packages/autonomous/src/api/cloud-billing-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/cloud-compat-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/index.d.ts +16 -16
- package/dist/packages/autonomous/src/api/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/index.js +15 -15
- package/dist/packages/autonomous/src/api/knowledge-service-loader.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/memory-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/memory-routes.js +1 -1
- package/dist/packages/autonomous/src/api/parse-action-block.d.ts +2 -2
- package/dist/packages/autonomous/src/api/parse-action-block.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/provider-switch-config.d.ts +1 -1
- package/dist/packages/autonomous/src/api/provider-switch-config.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/sandbox-routes.js +1 -1
- package/dist/packages/autonomous/src/api/server.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/server.js +75 -68
- package/dist/packages/autonomous/src/api/stream-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/stream-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/stream-routes.js +3 -2
- package/dist/packages/autonomous/src/api/training-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/training-routes.js +1 -1
- package/dist/packages/autonomous/src/api/trigger-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/trigger-routes.js +6 -2
- package/dist/packages/autonomous/src/api/wallet-evm-balance.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/wallet-evm-balance.js +2 -1
- package/dist/packages/autonomous/src/cli/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/config/index.d.ts +1 -1
- package/dist/packages/autonomous/src/config/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/config/index.js +1 -1
- package/dist/packages/autonomous/src/index.d.ts +1 -1
- package/dist/packages/autonomous/src/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/index.js +1 -1
- package/dist/packages/autonomous/src/providers/simple-mode.d.ts.map +1 -1
- package/dist/packages/autonomous/src/providers/simple-mode.js +0 -1
- package/dist/packages/autonomous/src/runtime/eliza.d.ts.map +1 -1
- package/dist/packages/autonomous/src/runtime/eliza.js +12 -25
- package/dist/packages/autonomous/src/runtime/milady-plugin.d.ts.map +1 -1
- package/dist/packages/autonomous/src/server/index.d.ts +2 -2
- package/dist/packages/autonomous/src/server/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/server/index.js +1 -1
- package/dist/packages/autonomous/src/services/agent-export.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/agent-export.js +53 -43
- package/dist/packages/autonomous/src/services/index.d.ts +4 -4
- package/dist/packages/autonomous/src/services/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/index.js +4 -4
- package/dist/packages/autonomous/src/services/whatsapp-pairing.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/whatsapp-pairing.js +1 -1
- package/dist/packages/autonomous/src/triggers/runtime.d.ts.map +1 -1
- package/dist/packages/autonomous/src/triggers/runtime.js +2 -0
- package/package.json +5 -5
- package/src/actions/emote.ts +4 -1
- package/src/actions/restart.ts +4 -1
- package/src/actions/send-message.ts +9 -1
- package/src/actions/switch-stream-source.ts +7 -1
- package/src/api/agent-lifecycle-routes.ts +1 -10
- package/src/api/apps-routes.ts +2 -5
- package/src/api/character-routes.ts +1 -1
- package/src/api/cloud-billing-routes.ts +3 -1
- package/src/api/cloud-compat-routes.ts +3 -1
- package/src/api/cloud-status-routes.ts +4 -3
- package/src/api/index.ts +29 -33
- package/src/api/knowledge-service-loader.ts +9 -3
- package/src/api/memory-routes.ts +4 -1
- package/src/api/parse-action-block.ts +2 -4
- package/src/api/provider-switch-config.ts +1 -1
- package/src/api/sandbox-routes.ts +2 -1
- package/src/api/server.ts +105 -104
- package/src/api/stream-routes.ts +14 -7
- package/src/api/training-routes.ts +4 -1
- package/src/api/trigger-routes.ts +10 -4
- package/src/api/wallet-evm-balance.ts +2 -1
- package/src/cli/index.ts +3 -1
- package/src/cloud/cloud-manager.test.ts +9 -9
- package/src/config/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/providers/simple-mode.ts +0 -1
- package/src/runtime/cloud-onboarding.ts +5 -3
- package/src/runtime/eliza.ts +20 -28
- package/src/runtime/milady-plugin.ts +1 -4
- package/src/server/index.ts +2 -6
- package/src/services/agent-export.ts +44 -33
- package/src/services/index.ts +4 -4
- package/src/services/whatsapp-pairing.ts +5 -2
- package/src/triggers/runtime.ts +17 -3
- package/test/api/agent-admin-routes.test.ts +15 -9
- package/test/api/agent-lifecycle-routes.test.ts +18 -9
- package/test/api/agent-transfer-routes.test.ts +18 -9
- package/test/api/apps-routes.test.ts +7 -9
- package/test/api/auth-routes.test.ts +7 -7
- package/test/api/bug-report-routes.test.ts +5 -5
- package/test/api/knowledge-routes.test.ts +4 -4
- package/test/api/memory-routes.test.ts +4 -4
- package/test/api/models-routes.test.ts +9 -7
- package/test/api/nfa-routes.test.ts +6 -6
- package/test/api/permissions-routes.test.ts +5 -5
- package/test/api/registry-routes.test.ts +6 -6
- package/test/api/signal-routes.test.ts +6 -6
- package/test/api/subscription-routes.test.ts +4 -4
- package/test/api/trigger-routes.test.ts +4 -4
- package/test/api/wallet-routes.observability.test.ts +1 -1
- package/test/api/wallet-routes.test.ts +1 -1
- package/test/diagnostics/integration-observability.test.ts +1 -1
- package/test/security/audit-log.test.ts +6 -8
- package/test/security/network-policy.test.ts +3 -3
- package/test/services/version-compat.test.ts +23 -19
- package/tsconfig.json +1 -5
package/src/api/memory-routes.ts
CHANGED
|
@@ -8,8 +8,11 @@ import {
|
|
|
8
8
|
stringToUuid,
|
|
9
9
|
type UUID,
|
|
10
10
|
} from "@elizaos/core";
|
|
11
|
-
import { getKnowledgeService, type KnowledgeServiceLike } from "./knowledge-service-loader";
|
|
12
11
|
import { parsePositiveInteger } from "../utils/number-parsing";
|
|
12
|
+
import {
|
|
13
|
+
getKnowledgeService,
|
|
14
|
+
type KnowledgeServiceLike,
|
|
15
|
+
} from "./knowledge-service-loader";
|
|
13
16
|
import type { RouteRequestContext } from "./route-helpers";
|
|
14
17
|
|
|
15
18
|
const HASH_MEMORY_SOURCE = "hash_memory";
|
|
@@ -12,10 +12,8 @@ interface CoordinationLLMResponse {
|
|
|
12
12
|
|
|
13
13
|
/** Console bridge exposed by PTYService for terminal I/O. */
|
|
14
14
|
export interface ConsoleBridge {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// biome-ignore lint/suspicious/noExplicitAny: EventEmitter-style listener signature
|
|
18
|
-
off(event: string, listener: (...args: any[]) => void): void;
|
|
15
|
+
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
16
|
+
off(event: string, listener: (...args: unknown[]) => void): void;
|
|
19
17
|
writeRaw(sessionId: string, data: string): void;
|
|
20
18
|
resize(sessionId: string, cols: number, rows: number): void;
|
|
21
19
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "@elizaos/autonomous/auth";
|
|
5
5
|
import type { SubscriptionProvider } from "../auth/types";
|
|
6
6
|
import { SUBSCRIPTION_PROVIDER_MAP } from "../auth/types";
|
|
7
|
+
import type { MiladyConfig } from "../config/types.milady";
|
|
7
8
|
import {
|
|
8
9
|
getOnboardingProviderOption,
|
|
9
10
|
isCloudManagedConnection,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
type OnboardingConnection,
|
|
14
15
|
type OnboardingLocalProviderId,
|
|
15
16
|
} from "../contracts/onboarding";
|
|
16
|
-
import type { MiladyConfig } from "../config/types.milady";
|
|
17
17
|
|
|
18
18
|
const REDACTED_SECRET = "[REDACTED]";
|
|
19
19
|
|
|
@@ -560,7 +560,8 @@ function resolveSigningRequestPayload(
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
const gasLimit =
|
|
563
|
+
const gasLimit =
|
|
564
|
+
typeof rawGasLimit === "string" ? rawGasLimit.trim() : undefined;
|
|
564
565
|
if (gasLimit === "") {
|
|
565
566
|
return {
|
|
566
567
|
error: "Signing payload 'gasLimit' cannot be empty when provided",
|
package/src/api/server.ts
CHANGED
|
@@ -14,9 +14,11 @@ import net from "node:net";
|
|
|
14
14
|
import os from "node:os";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { handleAppsHyperscapeRoutes } from "@elizaos/app-hyperscape/routes";
|
|
17
18
|
import {
|
|
18
19
|
type AgentRuntime,
|
|
19
20
|
ChannelType,
|
|
21
|
+
type Character,
|
|
20
22
|
type Content,
|
|
21
23
|
ContentType,
|
|
22
24
|
createMessageMemory,
|
|
@@ -30,19 +32,20 @@ import {
|
|
|
30
32
|
import { ethers } from "ethers";
|
|
31
33
|
import { type WebSocket, WebSocketServer } from "ws";
|
|
32
34
|
import { getGlobalAwarenessRegistry } from "../awareness/registry";
|
|
35
|
+
import { CharacterSchema } from "../config/character-schema";
|
|
33
36
|
import {
|
|
34
37
|
configFileExists,
|
|
35
38
|
loadMiladyConfig,
|
|
36
39
|
type MiladyConfig,
|
|
37
40
|
saveMiladyConfig,
|
|
38
41
|
} from "../config/config";
|
|
39
|
-
import { createIntegrationTelemetrySpan } from "../diagnostics/integration-observability";
|
|
40
42
|
import { resolveModelsCacheDir, resolveStateDir } from "../config/paths";
|
|
41
43
|
import {
|
|
42
44
|
isConnectorConfigured,
|
|
43
45
|
isStreamingDestinationConfigured,
|
|
44
46
|
} from "../config/plugin-auto-enable";
|
|
45
47
|
import type { ConnectorConfig, CustomActionDef } from "../config/types.milady";
|
|
48
|
+
import { createIntegrationTelemetrySpan } from "../diagnostics/integration-observability";
|
|
46
49
|
import { EMOTE_BY_ID, EMOTE_CATALOG } from "../emotes/catalog";
|
|
47
50
|
import { resolveDefaultAgentWorkspaceDir } from "../providers/workspace";
|
|
48
51
|
import {
|
|
@@ -59,11 +62,6 @@ import {
|
|
|
59
62
|
classifyRegistryPluginRelease,
|
|
60
63
|
getBundledRuntimePluginIds,
|
|
61
64
|
} from "../runtime/release-plugin-policy";
|
|
62
|
-
import {
|
|
63
|
-
isBlockedPrivateOrLinkLocalIp,
|
|
64
|
-
isLoopbackHost,
|
|
65
|
-
normalizeHostLike,
|
|
66
|
-
} from "../security/network-policy";
|
|
67
65
|
import {
|
|
68
66
|
AUDIT_EVENT_TYPES,
|
|
69
67
|
AUDIT_SEVERITIES,
|
|
@@ -71,13 +69,18 @@ import {
|
|
|
71
69
|
queryAuditFeed,
|
|
72
70
|
subscribeAuditFeed,
|
|
73
71
|
} from "../security/audit-log";
|
|
74
|
-
import {
|
|
72
|
+
import {
|
|
73
|
+
isBlockedPrivateOrLinkLocalIp,
|
|
74
|
+
isLoopbackHost,
|
|
75
|
+
normalizeHostLike,
|
|
76
|
+
} from "../security/network-policy";
|
|
75
77
|
import {
|
|
76
78
|
AgentExportError,
|
|
77
79
|
estimateExportSize,
|
|
78
80
|
exportAgent,
|
|
79
81
|
importAgent,
|
|
80
82
|
} from "../services/agent-export";
|
|
83
|
+
import { AppManager } from "../services/app-manager";
|
|
81
84
|
import { FallbackTrainingService } from "../services/fallback-training-service";
|
|
82
85
|
import {
|
|
83
86
|
getMcpServerDetails,
|
|
@@ -95,6 +98,12 @@ import {
|
|
|
95
98
|
isPrivyWalletProvisioningEnabled,
|
|
96
99
|
} from "../services/privy-wallets";
|
|
97
100
|
import type { SandboxManager } from "../services/sandbox-manager";
|
|
101
|
+
import {
|
|
102
|
+
SignalPairingSession,
|
|
103
|
+
sanitizeAccountId as sanitizeSignalAccountId,
|
|
104
|
+
signalAuthExists,
|
|
105
|
+
signalLogout,
|
|
106
|
+
} from "../services/signal-pairing";
|
|
98
107
|
import {
|
|
99
108
|
installMarketplaceSkill,
|
|
100
109
|
listInstalledMarketplaceSkills,
|
|
@@ -102,6 +111,12 @@ import {
|
|
|
102
111
|
uninstallMarketplaceSkill,
|
|
103
112
|
} from "../services/skill-marketplace";
|
|
104
113
|
import { streamManager } from "../services/stream-manager";
|
|
114
|
+
import {
|
|
115
|
+
sanitizeAccountId as sanitizeWhatsAppAccountId,
|
|
116
|
+
WhatsAppPairingSession,
|
|
117
|
+
whatsappAuthExists,
|
|
118
|
+
whatsappLogout,
|
|
119
|
+
} from "../services/whatsapp-pairing";
|
|
105
120
|
import {
|
|
106
121
|
executeTriggerTask,
|
|
107
122
|
getTriggerHealthSnapshot,
|
|
@@ -126,10 +141,8 @@ import { handleAgentAdminRoutes } from "./agent-admin-routes";
|
|
|
126
141
|
import { handleAgentLifecycleRoutes } from "./agent-lifecycle-routes";
|
|
127
142
|
import { detectRuntimeModel, resolveProviderFromModel } from "./agent-model";
|
|
128
143
|
import { handleAgentTransferRoutes } from "./agent-transfer-routes";
|
|
129
|
-
import { handleAppsHyperscapeRoutes } from "@elizaos/app-hyperscape/routes";
|
|
130
144
|
import { handleAppsRoutes } from "./apps-routes";
|
|
131
145
|
import { handleAuthRoutes } from "./auth-routes";
|
|
132
|
-
|
|
133
146
|
import {
|
|
134
147
|
buildBscApproveUnsignedTx,
|
|
135
148
|
buildBscBuyUnsignedTx,
|
|
@@ -220,29 +233,14 @@ import {
|
|
|
220
233
|
applyWhatsAppQrOverride,
|
|
221
234
|
handleWhatsAppRoute,
|
|
222
235
|
} from "./whatsapp-routes";
|
|
223
|
-
import { CharacterSchema } from "../config/character-schema";
|
|
224
|
-
import {
|
|
225
|
-
SignalPairingSession,
|
|
226
|
-
sanitizeAccountId as sanitizeSignalAccountId,
|
|
227
|
-
signalAuthExists,
|
|
228
|
-
signalLogout,
|
|
229
|
-
} from "../services/signal-pairing";
|
|
230
|
-
import {
|
|
231
|
-
sanitizeAccountId as sanitizeWhatsAppAccountId,
|
|
232
|
-
WhatsAppPairingSession,
|
|
233
|
-
whatsappAuthExists,
|
|
234
|
-
whatsappLogout,
|
|
235
|
-
} from "../services/whatsapp-pairing";
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* Local stubs for types removed from @elizaos/plugin-agent-orchestrator 2.x.
|
|
239
239
|
* These are only used as structural types for the SwarmCoordinator callbacks;
|
|
240
240
|
* no runtime import is needed.
|
|
241
241
|
*/
|
|
242
|
-
|
|
243
|
-
type
|
|
244
|
-
// biome-ignore lint/suspicious/noExplicitAny: legacy coordinator task context
|
|
245
|
-
type TaskContext = Record<string, any>;
|
|
242
|
+
type SwarmEvent = Record<string, unknown>;
|
|
243
|
+
type TaskContext = Record<string, unknown>;
|
|
246
244
|
interface CoordinationLLMResponse {
|
|
247
245
|
action: string;
|
|
248
246
|
reasoning: string;
|
|
@@ -435,12 +433,12 @@ function resolveConversationGreetingText(
|
|
|
435
433
|
runtime: AgentRuntime,
|
|
436
434
|
lang: string,
|
|
437
435
|
): string {
|
|
436
|
+
type CharacterWithZhExamples = AgentRuntime["character"] & {
|
|
437
|
+
postExamples_zhCN?: string[];
|
|
438
|
+
};
|
|
439
|
+
const char = runtime.character as CharacterWithZhExamples;
|
|
438
440
|
const localizedExamples =
|
|
439
|
-
lang === "zh-CN"
|
|
440
|
-
? ((runtime.character as Record<string, unknown>).postExamples_zhCN as
|
|
441
|
-
| string[]
|
|
442
|
-
| undefined)
|
|
443
|
-
: undefined;
|
|
441
|
+
lang === "zh-CN" ? char.postExamples_zhCN : undefined;
|
|
444
442
|
const postExamples =
|
|
445
443
|
localizedExamples && localizedExamples.length > 0
|
|
446
444
|
? localizedExamples
|
|
@@ -8152,6 +8150,9 @@ async function handleRequest(
|
|
|
8152
8150
|
if (body.postExamples) agent.postExamples = body.postExamples as string[];
|
|
8153
8151
|
if (body.messageExamples) {
|
|
8154
8152
|
// Normalise to the {examples: [{name, content}]} format that @elizaos/core expects.
|
|
8153
|
+
type MessageExamplesEntry = {
|
|
8154
|
+
examples: { name: string; content: { text: string } }[];
|
|
8155
|
+
};
|
|
8155
8156
|
const raw = body.messageExamples as unknown[];
|
|
8156
8157
|
agent.messageExamples = raw.map((item) => {
|
|
8157
8158
|
if (
|
|
@@ -8159,24 +8160,23 @@ async function handleRequest(
|
|
|
8159
8160
|
typeof item === "object" &&
|
|
8160
8161
|
"examples" in (item as Record<string, unknown>)
|
|
8161
8162
|
) {
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8163
|
+
const entry = item as MessageExamplesEntry;
|
|
8164
|
+
return entry.examples.map((m) => ({
|
|
8165
|
+
user: m.name,
|
|
8166
|
+
content: m.content,
|
|
8167
|
+
}));
|
|
8165
8168
|
}
|
|
8166
|
-
// Old format: [{user, content}, ...]
|
|
8169
|
+
// Old format: [{user, content}, ...] — pass through as-is
|
|
8167
8170
|
const arr = item as {
|
|
8168
8171
|
user?: string;
|
|
8169
8172
|
name?: string;
|
|
8170
8173
|
content: { text: string };
|
|
8171
8174
|
}[];
|
|
8172
|
-
return {
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
};
|
|
8178
|
-
// biome-ignore lint/suspicious/noExplicitAny: mixed legacy/new formats
|
|
8179
|
-
}) as any;
|
|
8175
|
+
return arr.map((m) => ({
|
|
8176
|
+
user: m.name ?? m.user ?? "",
|
|
8177
|
+
content: m.content,
|
|
8178
|
+
}));
|
|
8179
|
+
}) as { user: string; content: { text: string } }[][];
|
|
8180
8180
|
}
|
|
8181
8181
|
|
|
8182
8182
|
// ── Theme preference ──────────────────────────────────────────────────
|
|
@@ -14682,18 +14682,18 @@ async function handleRequest(
|
|
|
14682
14682
|
// Fallback to @elizaos/plugin-agent-orchestrator (npm)
|
|
14683
14683
|
if (!handled) {
|
|
14684
14684
|
try {
|
|
14685
|
-
|
|
14686
|
-
const orchestratorPlugin: any = await import(
|
|
14685
|
+
const orchestratorPlugin = (await import(
|
|
14687
14686
|
"@elizaos/plugin-agent-orchestrator"
|
|
14688
|
-
)
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
const
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
);
|
|
14687
|
+
)) as Record<string, unknown>;
|
|
14688
|
+
const createHandler = orchestratorPlugin.createCodingAgentRouteHandler as
|
|
14689
|
+
| ((runtime: unknown, coordinator: unknown) => (req: unknown, res: unknown, pathname: string) => Promise<boolean>)
|
|
14690
|
+
| undefined;
|
|
14691
|
+
if (createHandler) {
|
|
14692
|
+
const getCoordinator = orchestratorPlugin.getCoordinator as
|
|
14693
|
+
| ((runtime: unknown) => unknown)
|
|
14694
|
+
| undefined;
|
|
14695
|
+
const coordinator = getCoordinator?.(state.runtime);
|
|
14696
|
+
const handler = createHandler(state.runtime, coordinator);
|
|
14697
14697
|
handled = await handler(req, res, pathname);
|
|
14698
14698
|
}
|
|
14699
14699
|
} catch {
|
|
@@ -14792,7 +14792,7 @@ async function handleRequest(
|
|
|
14792
14792
|
|
|
14793
14793
|
if (state.runtime) {
|
|
14794
14794
|
try {
|
|
14795
|
-
runtimeTasks = await state.runtime.getTasks({});
|
|
14795
|
+
runtimeTasks = await state.runtime.getTasks({ agentIds: [] });
|
|
14796
14796
|
tasksAvailable = true;
|
|
14797
14797
|
todosAvailable = true;
|
|
14798
14798
|
|
|
@@ -14891,7 +14891,7 @@ async function handleRequest(
|
|
|
14891
14891
|
error(res, "Agent runtime is not available", 503);
|
|
14892
14892
|
return;
|
|
14893
14893
|
}
|
|
14894
|
-
const runtimeTasks = await state.runtime.getTasks({});
|
|
14894
|
+
const runtimeTasks = await state.runtime.getTasks({ agentIds: [] });
|
|
14895
14895
|
const tasks = runtimeTasks
|
|
14896
14896
|
.map((task) => toWorkbenchTask(task))
|
|
14897
14897
|
.filter((task): task is WorkbenchTaskView => task !== null)
|
|
@@ -15013,7 +15013,7 @@ async function handleRequest(
|
|
|
15013
15013
|
error(res, "Agent runtime is not available", 503);
|
|
15014
15014
|
return;
|
|
15015
15015
|
}
|
|
15016
|
-
const runtimeTasks = await state.runtime.getTasks({});
|
|
15016
|
+
const runtimeTasks = await state.runtime.getTasks({ agentIds: [] });
|
|
15017
15017
|
const todos = runtimeTasks
|
|
15018
15018
|
.map((task) => toWorkbenchTodo(task))
|
|
15019
15019
|
.filter((todo): todo is WorkbenchTodoView => todo !== null)
|
|
@@ -16254,53 +16254,53 @@ async function handleRequest(
|
|
|
16254
16254
|
// ── LTCG Autonomy routes ─────────────────────────────────────────────
|
|
16255
16255
|
// The LTCG plugin registers these as elizaOS plugin routes, but Milady's
|
|
16256
16256
|
// server doesn't dispatch plugin routes. Wire them up directly here.
|
|
16257
|
-
if (pathname.startsWith("/api/ltcg/autonomy")) {
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16263
|
-
|
|
16264
|
-
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
|
|
16269
|
-
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16273
|
-
|
|
16274
|
-
|
|
16275
|
-
|
|
16276
|
-
|
|
16277
|
-
|
|
16278
|
-
|
|
16279
|
-
|
|
16280
|
-
|
|
16281
|
-
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
|
|
16288
|
-
|
|
16289
|
-
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
}
|
|
16257
|
+
// if (pathname.startsWith("/api/ltcg/autonomy")) {
|
|
16258
|
+
// try {
|
|
16259
|
+
// const { getAutonomyController } = await import("@lunchtable/plugin-ltcg");
|
|
16260
|
+
// const ctrl = getAutonomyController();
|
|
16261
|
+
//
|
|
16262
|
+
// if (method === "GET" && pathname === "/api/ltcg/autonomy/status") {
|
|
16263
|
+
// json(res, ctrl.getStatus());
|
|
16264
|
+
// return;
|
|
16265
|
+
// }
|
|
16266
|
+
//
|
|
16267
|
+
// if (method === "POST" && pathname === "/api/ltcg/autonomy/start") {
|
|
16268
|
+
// const body = (await readJsonBody(req, res)) ?? {};
|
|
16269
|
+
// const bodyRecord = body as Record<string, unknown>;
|
|
16270
|
+
// const mode = bodyRecord.mode === "pvp" ? "pvp" : "story";
|
|
16271
|
+
// const continuousValue = bodyRecord.continuous;
|
|
16272
|
+
// const continuous =
|
|
16273
|
+
// typeof continuousValue === "boolean" ? continuousValue : true;
|
|
16274
|
+
// await ctrl.start({ mode, continuous });
|
|
16275
|
+
// json(res, { ok: true, mode, continuous });
|
|
16276
|
+
// return;
|
|
16277
|
+
// }
|
|
16278
|
+
//
|
|
16279
|
+
// if (method === "POST" && pathname === "/api/ltcg/autonomy/pause") {
|
|
16280
|
+
// ctrl.pause();
|
|
16281
|
+
// json(res, { ok: true, state: "paused" });
|
|
16282
|
+
// return;
|
|
16283
|
+
// }
|
|
16284
|
+
//
|
|
16285
|
+
// if (method === "POST" && pathname === "/api/ltcg/autonomy/resume") {
|
|
16286
|
+
// ctrl.resume();
|
|
16287
|
+
// json(res, { ok: true, state: "running" });
|
|
16288
|
+
// return;
|
|
16289
|
+
// }
|
|
16290
|
+
//
|
|
16291
|
+
// if (method === "POST" && pathname === "/api/ltcg/autonomy/stop") {
|
|
16292
|
+
// await ctrl.stop();
|
|
16293
|
+
// json(res, { ok: true, state: "idle" });
|
|
16294
|
+
// return;
|
|
16295
|
+
// }
|
|
16296
|
+
// } catch (err) {
|
|
16297
|
+
// logger.error(
|
|
16298
|
+
// `[ltcg-autonomy] ${err instanceof Error ? err.message : err}`,
|
|
16299
|
+
// );
|
|
16300
|
+
// error(res, err instanceof Error ? err.message : "Autonomy error", 500);
|
|
16301
|
+
// return;
|
|
16302
|
+
// }
|
|
16303
|
+
// }
|
|
16304
16304
|
|
|
16305
16305
|
// ── Connector plugin routes (dynamically registered) ────────────────────
|
|
16306
16306
|
for (const handler of state.connectorRouteHandlers) {
|
|
@@ -16320,6 +16320,7 @@ async function handleRequest(
|
|
|
16320
16320
|
// headless `startEliza()` path).
|
|
16321
16321
|
// ---------------------------------------------------------------------------
|
|
16322
16322
|
import { type captureEarlyLogs, flushEarlyLogs } from "./early-logs";
|
|
16323
|
+
|
|
16323
16324
|
export type { captureEarlyLogs };
|
|
16324
16325
|
|
|
16325
16326
|
// ---------------------------------------------------------------------------
|
package/src/api/stream-routes.ts
CHANGED
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
resolveTtsConfig,
|
|
19
19
|
ttsStreamBridge,
|
|
20
20
|
} from "../services/tts-stream-bridge";
|
|
21
|
+
import { sanitizeSpeechText } from "../utils/spoken-text";
|
|
21
22
|
import {
|
|
22
23
|
readRequestBody,
|
|
23
24
|
readRequestBodyBuffer,
|
|
24
25
|
sendJson,
|
|
25
26
|
sendJsonError,
|
|
26
27
|
} from "./http-helpers";
|
|
27
|
-
import { sanitizeSpeechText } from "../utils/spoken-text";
|
|
28
28
|
import {
|
|
29
29
|
getHeadlessCaptureConfig,
|
|
30
30
|
parseDestinationQuery,
|
|
@@ -40,7 +40,10 @@ import {
|
|
|
40
40
|
handleStreamVoiceRoute as handleAutonomousStreamVoiceRoute,
|
|
41
41
|
onAgentMessage as onAutonomousAgentMessage,
|
|
42
42
|
} from "./stream-voice-routes";
|
|
43
|
-
import type {
|
|
43
|
+
import type {
|
|
44
|
+
OverlayLayoutData,
|
|
45
|
+
StreamingDestination,
|
|
46
|
+
} from "./streaming-types";
|
|
44
47
|
|
|
45
48
|
export type { StreamRouteState } from "./stream-route-state";
|
|
46
49
|
|
|
@@ -87,7 +90,10 @@ function pushFrameToSubscribers(frame: Buffer): void {
|
|
|
87
90
|
* hooks. Canonical definition lives in plugin-streaming-base; re-exported here
|
|
88
91
|
* so existing consumers keep working.
|
|
89
92
|
*/
|
|
90
|
-
export type {
|
|
93
|
+
export type {
|
|
94
|
+
OverlayLayoutData,
|
|
95
|
+
StreamingDestination,
|
|
96
|
+
} from "./streaming-types";
|
|
91
97
|
|
|
92
98
|
/** Resolve the active streaming destination from the registry. */
|
|
93
99
|
export function getActiveDestination(
|
|
@@ -116,7 +122,8 @@ function error(res: ServerResponse, message: string, status: number): void {
|
|
|
116
122
|
function resolveRouteTtsConfig(
|
|
117
123
|
config: unknown,
|
|
118
124
|
): Record<string, unknown> | null {
|
|
119
|
-
|
|
125
|
+
const resolved = resolveTtsConfig(config as never);
|
|
126
|
+
return resolved ? { ...resolved } : null;
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
function getRouteTtsProviderStatus(config: unknown): {
|
|
@@ -612,9 +619,9 @@ export async function handleStreamRoute(
|
|
|
612
619
|
try {
|
|
613
620
|
// Stop browser capture
|
|
614
621
|
try {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
622
|
+
const { stopBrowserCapture } = await import(
|
|
623
|
+
"../services/browser-capture"
|
|
624
|
+
);
|
|
618
625
|
await stopBrowserCapture();
|
|
619
626
|
} catch {
|
|
620
627
|
// Browser capture may not have been started -- ignore
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { AgentRuntime } from "@elizaos/core";
|
|
2
2
|
import { parsePositiveInteger } from "../utils/number-parsing";
|
|
3
|
-
import { detectAvailableBackends, type BackendAvailability } from "./training-backend-check";
|
|
4
3
|
import type { RouteHelpers, RouteRequestContext } from "./route-helpers";
|
|
4
|
+
import {
|
|
5
|
+
type BackendAvailability,
|
|
6
|
+
detectAvailableBackends,
|
|
7
|
+
} from "./training-backend-check";
|
|
5
8
|
|
|
6
9
|
export type TrainingRouteHelpers = RouteHelpers;
|
|
7
10
|
|
|
@@ -160,7 +160,9 @@ export async function handleTriggerRoutes(
|
|
|
160
160
|
if (!body) return true;
|
|
161
161
|
|
|
162
162
|
const creator =
|
|
163
|
-
typeof body.createdBy === "string"
|
|
163
|
+
typeof body.createdBy === "string"
|
|
164
|
+
? trim(body.createdBy) || "api"
|
|
165
|
+
: "api";
|
|
164
166
|
const normalized = normalizeTriggerDraft({
|
|
165
167
|
input: { ...body, enabled: body.enabled ?? true, createdBy: creator },
|
|
166
168
|
fallback: {
|
|
@@ -352,7 +354,9 @@ export async function handleTriggerRoutes(
|
|
|
352
354
|
...body,
|
|
353
355
|
createdBy: current.createdBy,
|
|
354
356
|
intervalMs:
|
|
355
|
-
typeof body.intervalMs === "number"
|
|
357
|
+
typeof body.intervalMs === "number"
|
|
358
|
+
? body.intervalMs
|
|
359
|
+
: current.intervalMs,
|
|
356
360
|
scheduledAtIso:
|
|
357
361
|
typeof body.scheduledAtIso === "string"
|
|
358
362
|
? body.scheduledAtIso
|
|
@@ -361,7 +365,8 @@ export async function handleTriggerRoutes(
|
|
|
361
365
|
typeof body.cronExpression === "string"
|
|
362
366
|
? body.cronExpression
|
|
363
367
|
: current.cronExpression,
|
|
364
|
-
maxRuns:
|
|
368
|
+
maxRuns:
|
|
369
|
+
typeof body.maxRuns === "number" ? body.maxRuns : current.maxRuns,
|
|
365
370
|
};
|
|
366
371
|
const normalized = normalizeTriggerDraft({
|
|
367
372
|
input: merged,
|
|
@@ -370,7 +375,8 @@ export async function handleTriggerRoutes(
|
|
|
370
375
|
instructions: current.instructions,
|
|
371
376
|
triggerType: current.triggerType,
|
|
372
377
|
wakeMode: current.wakeMode,
|
|
373
|
-
enabled:
|
|
378
|
+
enabled:
|
|
379
|
+
body.enabled === undefined ? current.enabled : body.enabled === true,
|
|
374
380
|
createdBy: current.createdBy,
|
|
375
381
|
intervalMs: current.intervalMs,
|
|
376
382
|
scheduledAtIso: current.scheduledAtIso,
|
|
@@ -205,8 +205,9 @@ export function resolveEvmProviderKeys(
|
|
|
205
205
|
maybeAnkrKey?: string | null,
|
|
206
206
|
): EvmProviderKeyset {
|
|
207
207
|
if (typeof alchemyOrKeys === "string" || alchemyOrKeys == null) {
|
|
208
|
+
const alchemyKey = typeof alchemyOrKeys === "string" ? alchemyOrKeys : null;
|
|
208
209
|
return {
|
|
209
|
-
alchemyKey: normalizeApiKey(
|
|
210
|
+
alchemyKey: normalizeApiKey(alchemyKey),
|
|
210
211
|
ankrKey: normalizeApiKey(maybeAnkrKey),
|
|
211
212
|
cloudManagedAccess: false,
|
|
212
213
|
bscRpcUrls: resolveBscRpcUrls({ cloudManagedAccess: false }),
|
package/src/cli/index.ts
CHANGED
|
@@ -14,7 +14,9 @@ Commands:
|
|
|
14
14
|
`);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export async function runAutonomousCli(
|
|
17
|
+
export async function runAutonomousCli(
|
|
18
|
+
argv: string[] = process.argv,
|
|
19
|
+
): Promise<void> {
|
|
18
20
|
const command = argv[2] ?? "serve";
|
|
19
21
|
|
|
20
22
|
if (command === "--help" || command === "-h" || command === "help") {
|
|
@@ -99,9 +99,9 @@ describe("CloudManager", () => {
|
|
|
99
99
|
cfg({ baseUrl: "https://test.elizacloud.ai/api/v1" }),
|
|
100
100
|
);
|
|
101
101
|
await mgr.init();
|
|
102
|
-
expect(
|
|
103
|
-
|
|
104
|
-
);
|
|
102
|
+
expect(
|
|
103
|
+
(mgr.getClient() as unknown as Record<string, string>)._baseUrl,
|
|
104
|
+
).toBe("https://test.elizacloud.ai");
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
it("strips trailing slashes", async () => {
|
|
@@ -109,17 +109,17 @@ describe("CloudManager", () => {
|
|
|
109
109
|
cfg({ baseUrl: "https://test.elizacloud.ai///" }),
|
|
110
110
|
);
|
|
111
111
|
await mgr.init();
|
|
112
|
-
expect(
|
|
113
|
-
|
|
114
|
-
);
|
|
112
|
+
expect(
|
|
113
|
+
(mgr.getClient() as unknown as Record<string, string>)._baseUrl,
|
|
114
|
+
).toBe("https://test.elizacloud.ai");
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
it("defaults to elizacloud.ai when no baseUrl", async () => {
|
|
118
118
|
const mgr = new CloudManager(cfg({ baseUrl: undefined }));
|
|
119
119
|
await mgr.init();
|
|
120
|
-
expect(
|
|
121
|
-
|
|
122
|
-
);
|
|
120
|
+
expect(
|
|
121
|
+
(mgr.getClient() as unknown as Record<string, string>)._baseUrl,
|
|
122
|
+
).toBe("https://www.elizacloud.ai");
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
|
package/src/config/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * from "./api";
|
|
2
2
|
export * from "./auth/index";
|
|
3
3
|
export * from "./config";
|
|
4
|
+
export * from "./diagnostics/integration-observability";
|
|
4
5
|
export * from "./hooks/index";
|
|
5
6
|
export * from "./onboarding-presets";
|
|
6
7
|
export * from "./providers/workspace";
|
|
7
8
|
export * from "./runtime";
|
|
8
9
|
export * from "./runtime/core-plugins";
|
|
9
|
-
export * from "./diagnostics/integration-observability";
|
|
10
10
|
export * from "./security/audit-log";
|
|
11
11
|
export * from "./security/network-policy";
|
|
12
12
|
export * from "./server";
|
|
@@ -40,7 +40,6 @@ export function createChannelProfileProvider(): Provider {
|
|
|
40
40
|
name: "miladyChannelProfile",
|
|
41
41
|
description:
|
|
42
42
|
"Injects channel-derived execution profile guidance (voice/group/default).",
|
|
43
|
-
alwaysRun: true,
|
|
44
43
|
position: -50,
|
|
45
44
|
async get(
|
|
46
45
|
_runtime: IAgentRuntime,
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { logger } from "@elizaos/core";
|
|
11
|
-
import {
|
|
11
|
+
import { type CloudLoginResult, cloudLogin } from "../cloud/auth";
|
|
12
12
|
import { normalizeCloudSiteUrl } from "../cloud/base-url";
|
|
13
13
|
import {
|
|
14
|
-
ElizaCloudClient,
|
|
15
14
|
type CloudAgentCreateParams,
|
|
15
|
+
ElizaCloudClient,
|
|
16
16
|
} from "../cloud/bridge-client";
|
|
17
17
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
@@ -392,7 +392,9 @@ async function openBrowser(url: string): Promise<void> {
|
|
|
392
392
|
return new Promise((resolve) => {
|
|
393
393
|
const onError = (err: Error | null) => {
|
|
394
394
|
if (err) {
|
|
395
|
-
logger.debug(
|
|
395
|
+
logger.debug(
|
|
396
|
+
`[cloud-onboarding] Failed to open browser: ${err.message}`,
|
|
397
|
+
);
|
|
396
398
|
}
|
|
397
399
|
resolve();
|
|
398
400
|
};
|