@elizaos/autonomous 2.0.0-alpha.49 → 2.0.0-alpha.51
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 +0 -16
- package/dist/packages/autonomous/src/api/auth-routes.js +2 -2
- package/dist/packages/autonomous/src/api/database.js +2 -2
- package/dist/packages/autonomous/src/api/nfa-routes.js +2 -2
- package/dist/packages/autonomous/src/api/nft-verify.js +2 -2
- package/dist/packages/autonomous/src/api/og-tracker.d.ts +2 -2
- package/dist/packages/autonomous/src/api/og-tracker.js +2 -2
- package/dist/packages/autonomous/src/api/provider-switch-config.js +4 -4
- package/dist/packages/autonomous/src/api/server.js +65 -65
- package/dist/packages/autonomous/src/api/stream-persistence.js +1 -1
- package/dist/packages/autonomous/src/api/terminal-run-limits.js +2 -2
- package/dist/packages/autonomous/src/api/wallet.d.ts +2 -2
- package/dist/packages/autonomous/src/api/wallet.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/wallet.js +2 -2
- package/dist/packages/autonomous/src/auth/credentials.d.ts +1 -1
- package/dist/packages/autonomous/src/auth/credentials.js +2 -2
- package/dist/packages/autonomous/src/cloud/validate-url.js +1 -1
- package/dist/packages/autonomous/src/config/env-vars.js +4 -4
- package/dist/packages/autonomous/src/config/paths.d.ts +1 -1
- package/dist/packages/autonomous/src/config/paths.js +10 -10
- package/dist/packages/autonomous/src/config/plugin-auto-enable.js +1 -1
- package/dist/packages/autonomous/src/config/schema.js +3 -3
- package/dist/packages/autonomous/src/config/types.milady.d.ts +2 -2
- package/dist/packages/autonomous/src/config/types.milady.d.ts.map +1 -1
- package/dist/packages/autonomous/src/hooks/discovery.d.ts +1 -1
- package/dist/packages/autonomous/src/hooks/discovery.js +2 -2
- package/dist/packages/autonomous/src/hooks/loader.js +4 -4
- package/dist/packages/autonomous/src/providers/session-utils.js +1 -1
- package/dist/packages/autonomous/src/providers/workspace.js +4 -4
- package/dist/packages/autonomous/src/runtime/custom-actions.js +1 -1
- package/dist/packages/autonomous/src/runtime/eliza.d.ts +2 -2
- package/dist/packages/autonomous/src/runtime/eliza.js +24 -24
- package/dist/packages/autonomous/src/runtime/trajectory-persistence.js +3 -3
- package/dist/packages/autonomous/src/services/browser-capture.js +6 -6
- package/dist/packages/autonomous/src/services/registry-client-local.js +2 -2
- package/dist/packages/autonomous/src/services/registry-client.js +1 -1
- package/dist/packages/autonomous/src/services/sandbox-manager.js +6 -6
- package/dist/packages/autonomous/src/services/skill-catalog-client.js +2 -2
- package/dist/packages/autonomous/src/services/skill-marketplace.js +2 -2
- package/dist/packages/autonomous/src/services/tts-stream-bridge.js +1 -1
- package/dist/packages/autonomous/src/services/update-checker.js +1 -1
- package/dist/packages/autonomous/src/triggers/runtime.js +4 -4
- package/package.json +4 -4
- package/src/api/auth-routes.ts +2 -2
- package/src/api/database.ts +2 -2
- package/src/api/nfa-routes.ts +2 -2
- package/src/api/nft-verify.ts +2 -2
- package/src/api/og-tracker.ts +2 -2
- package/src/api/provider-switch-config.ts +4 -4
- package/src/api/server.ts +65 -65
- package/src/api/stream-persistence.ts +1 -1
- package/src/api/terminal-run-limits.ts +2 -2
- package/src/api/wallet.ts +2 -2
- package/src/auth/credentials.ts +2 -2
- package/src/cloud/validate-url.ts +1 -1
- package/src/config/env-vars.ts +4 -4
- package/src/config/paths.ts +10 -10
- package/src/config/plugin-auto-enable.ts +1 -1
- package/src/config/schema.ts +3 -3
- package/src/config/types.milady.ts +2 -2
- package/src/hooks/discovery.ts +2 -2
- package/src/hooks/loader.ts +4 -4
- package/src/providers/session-utils.ts +1 -1
- package/src/providers/workspace.ts +4 -4
- package/src/runtime/custom-actions.ts +1 -1
- package/src/runtime/eliza.ts +25 -25
- package/src/runtime/trajectory-persistence.ts +3 -3
- package/src/services/browser-capture.ts +6 -6
- package/src/services/registry-client-local.ts +2 -2
- package/src/services/registry-client.ts +1 -1
- package/src/services/sandbox-manager.ts +6 -6
- package/src/services/skill-catalog-client.ts +2 -2
- package/src/services/skill-marketplace.ts +2 -2
- package/src/services/tts-stream-bridge.ts +1 -1
- package/src/services/update-checker.ts +1 -1
- package/src/triggers/runtime.ts +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -32,22 +32,6 @@ src/api/nft-verify.ts(15,24): error TS2307: Cannot find module '@elizaos/core' o
|
|
|
32
32
|
src/api/permissions-routes.ts(1,35): error TS2307: Cannot find module '@elizaos/core' or its corresponding type declarations.
|
|
33
33
|
src/api/registry-service.ts(11,24): error TS2307: Cannot find module '@elizaos/core' or its corresponding type declarations.
|
|
34
34
|
src/api/server.ts(31,8): error TS2307: Cannot find module '@elizaos/core' or its corresponding type declarations.
|
|
35
|
-
src/api/server.ts(7547,41): error TS2345: Argument of type 'MiladyConfig' is not assignable to parameter of type 'Partial<MiladyConfig>'.
|
|
36
|
-
The types of 'ui.theme' are incompatible between these types.
|
|
37
|
-
Type '"milady" | "eliza" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
38
|
-
Type '"eliza"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
39
|
-
src/api/server.ts(7581,41): error TS2345: Argument of type 'MiladyConfig' is not assignable to parameter of type 'Partial<MiladyConfig>'.
|
|
40
|
-
The types of 'ui.theme' are incompatible between these types.
|
|
41
|
-
Type '"milady" | "eliza" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
42
|
-
Type '"eliza"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
43
|
-
src/api/server.ts(7607,41): error TS2345: Argument of type 'MiladyConfig' is not assignable to parameter of type 'Partial<MiladyConfig>'.
|
|
44
|
-
The types of 'ui.theme' are incompatible between these types.
|
|
45
|
-
Type '"milady" | "eliza" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
46
|
-
Type '"eliza"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
47
|
-
src/api/server.ts(7633,41): error TS2345: Argument of type 'MiladyConfig' is not assignable to parameter of type 'Partial<MiladyConfig>'.
|
|
48
|
-
The types of 'ui.theme' are incompatible between these types.
|
|
49
|
-
Type '"milady" | "eliza" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
50
|
-
Type '"eliza"' is not assignable to type '"milady" | "qt314" | "web2000" | "programmer" | "haxor" | "psycho"'.
|
|
51
35
|
src/api/server.ts(9377,15): error TS2339: Property 'includes' does not exist on type 'unknown'.
|
|
52
36
|
src/api/server.ts(9377,53): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
|
|
53
37
|
src/api/server.ts(14582,11): error TS2307: Cannot find module '@elizaos/plugin-agent-orchestrator' or its corresponding type declarations.
|
|
@@ -4,7 +4,7 @@ export async function handleAuthRoutes(ctx) {
|
|
|
4
4
|
if (!pathname.startsWith("/api/auth/"))
|
|
5
5
|
return false;
|
|
6
6
|
if (method === "GET" && pathname === "/api/auth/status") {
|
|
7
|
-
const required = Boolean(process.env.
|
|
7
|
+
const required = Boolean(process.env.ELIZA_API_TOKEN?.trim());
|
|
8
8
|
const enabled = pairingEnabled();
|
|
9
9
|
if (enabled)
|
|
10
10
|
ensurePairingCode();
|
|
@@ -19,7 +19,7 @@ export async function handleAuthRoutes(ctx) {
|
|
|
19
19
|
const body = await readJsonBody(req, res);
|
|
20
20
|
if (!body)
|
|
21
21
|
return true;
|
|
22
|
-
const token = process.env.
|
|
22
|
+
const token = process.env.ELIZA_API_TOKEN?.trim();
|
|
23
23
|
if (!token) {
|
|
24
24
|
error(res, "Pairing not enabled", 400);
|
|
25
25
|
return true;
|
|
@@ -108,7 +108,7 @@ const PRIVATE_IP_PATTERNS = [
|
|
|
108
108
|
* since only local processes can reach the API.
|
|
109
109
|
*/
|
|
110
110
|
function isApiLoopbackOnly() {
|
|
111
|
-
let bind = (process.env.
|
|
111
|
+
let bind = (process.env.ELIZA_API_BIND ?? "127.0.0.1").trim().toLowerCase();
|
|
112
112
|
if (!bind)
|
|
113
113
|
bind = "127.0.0.1";
|
|
114
114
|
// Accept accidental URL-shaped bind values.
|
|
@@ -384,7 +384,7 @@ async function handleGetStatus(_req, res, runtime) {
|
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
386
|
* GET /api/database/config
|
|
387
|
-
* Returns the persisted database configuration from
|
|
387
|
+
* Returns the persisted database configuration from eliza.json.
|
|
388
388
|
*/
|
|
389
389
|
function handleGetConfig(_req, res) {
|
|
390
390
|
const config = loadMiladyConfig();
|
|
@@ -40,7 +40,7 @@ async function readJsonFile(filePath) {
|
|
|
40
40
|
export async function handleNfaRoutes(ctx) {
|
|
41
41
|
const { res, method, pathname, json } = ctx;
|
|
42
42
|
if (method === "GET" && pathname === "/api/nfa/status") {
|
|
43
|
-
const miladyDir = join(homedir(), ".
|
|
43
|
+
const miladyDir = join(homedir(), ".eliza");
|
|
44
44
|
const [nfaRecord, identityRecord] = await Promise.all([
|
|
45
45
|
readJsonFile(join(miladyDir, "bap578-nfa.json")),
|
|
46
46
|
readJsonFile(join(miladyDir, "bnb-identity.json")),
|
|
@@ -78,7 +78,7 @@ export async function handleNfaRoutes(ctx) {
|
|
|
78
78
|
}
|
|
79
79
|
if (method === "GET" && pathname === "/api/nfa/learnings") {
|
|
80
80
|
const learningsPaths = [
|
|
81
|
-
join(homedir(), ".
|
|
81
|
+
join(homedir(), ".eliza", "LEARNINGS.md"),
|
|
82
82
|
join(process.cwd(), "LEARNINGS.md"),
|
|
83
83
|
];
|
|
84
84
|
let markdown = null;
|
|
@@ -49,7 +49,7 @@ function getProvider() {
|
|
|
49
49
|
* mainnet. This is a read-only view call — no gas, no signing required.
|
|
50
50
|
*/
|
|
51
51
|
export async function verifyMiladyHolder(walletAddress) {
|
|
52
|
-
const contractAddress = process.env.
|
|
52
|
+
const contractAddress = process.env.ELIZA_NFT_CONTRACT?.trim() || MILADY_CONTRACT;
|
|
53
53
|
// ── Input validation ───────────────────────────────────────────────
|
|
54
54
|
if (!walletAddress || typeof walletAddress !== "string") {
|
|
55
55
|
return {
|
|
@@ -117,7 +117,7 @@ export async function verifyAndWhitelistHolder(walletAddress) {
|
|
|
117
117
|
return {
|
|
118
118
|
verified: true,
|
|
119
119
|
balance: -1, // -1 indicates "already verified, balance not re-checked"
|
|
120
|
-
contractAddress: process.env.
|
|
120
|
+
contractAddress: process.env.ELIZA_NFT_CONTRACT?.trim() || MILADY_CONTRACT,
|
|
121
121
|
error: null,
|
|
122
122
|
};
|
|
123
123
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OG tracking code system.
|
|
3
3
|
*
|
|
4
|
-
* Silently writes a unique identifier to ~/.
|
|
4
|
+
* Silently writes a unique identifier to ~/.eliza/.og on first run.
|
|
5
5
|
* The code is a random UUID. A set of 100 "winning" codes can be
|
|
6
6
|
* generated deterministically from a secret seed (in MiladyMaker scripts).
|
|
7
7
|
* This file is planted now; whitelist eligibility is revealed in a future update.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* Write a random tracking UUID to ~/.
|
|
10
|
+
* Write a random tracking UUID to ~/.eliza/.og if it does not already exist.
|
|
11
11
|
* Called once during startup. Silent on failure.
|
|
12
12
|
*/
|
|
13
13
|
export declare function initializeOGCode(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OG tracking code system.
|
|
3
3
|
*
|
|
4
|
-
* Silently writes a unique identifier to ~/.
|
|
4
|
+
* Silently writes a unique identifier to ~/.eliza/.og on first run.
|
|
5
5
|
* The code is a random UUID. A set of 100 "winning" codes can be
|
|
6
6
|
* generated deterministically from a secret seed (in MiladyMaker scripts).
|
|
7
7
|
* This file is planted now; whitelist eligibility is revealed in a future update.
|
|
@@ -12,7 +12,7 @@ import path from "node:path";
|
|
|
12
12
|
import { resolveStateDir } from "../config/paths";
|
|
13
13
|
const OG_FILENAME = ".og";
|
|
14
14
|
/**
|
|
15
|
-
* Write a random tracking UUID to ~/.
|
|
15
|
+
* Write a random tracking UUID to ~/.eliza/.og if it does not already exist.
|
|
16
16
|
* Called once during startup. Silent on failure.
|
|
17
17
|
*/
|
|
18
18
|
export function initializeOGCode() {
|
|
@@ -52,8 +52,8 @@ function setPrimaryModel(config, primaryModel) {
|
|
|
52
52
|
}
|
|
53
53
|
function clearPiAiFlag(config) {
|
|
54
54
|
const env = ensureEnv(config);
|
|
55
|
-
delete env.
|
|
56
|
-
delete process.env.
|
|
55
|
+
delete env.ELIZA_USE_PI_AI;
|
|
56
|
+
delete process.env.ELIZA_USE_PI_AI;
|
|
57
57
|
}
|
|
58
58
|
function readString(source, key) {
|
|
59
59
|
const value = source?.[key];
|
|
@@ -72,7 +72,7 @@ function resolveConfiguredLocalProvider(config) {
|
|
|
72
72
|
storedSubscriptionProvider !== "elizacloud") {
|
|
73
73
|
return storedSubscriptionProvider;
|
|
74
74
|
}
|
|
75
|
-
const piAiEnabled = readEnvString(config, "
|
|
75
|
+
const piAiEnabled = readEnvString(config, "ELIZA_USE_PI_AI");
|
|
76
76
|
if (piAiEnabled && piAiEnabled !== "0" && piAiEnabled !== "false") {
|
|
77
77
|
return "pi-ai";
|
|
78
78
|
}
|
|
@@ -299,7 +299,7 @@ export async function applyOnboardingConnectionConfig(config, connection) {
|
|
|
299
299
|
}
|
|
300
300
|
clearSubscriptionProviderConfig(config);
|
|
301
301
|
if (normalizedProvider === "pi-ai") {
|
|
302
|
-
setEnvValue(config, "
|
|
302
|
+
setEnvValue(config, "ELIZA_USE_PI_AI", "1");
|
|
303
303
|
}
|
|
304
304
|
else {
|
|
305
305
|
clearPiAiFlag(config);
|
|
@@ -556,9 +556,9 @@ const BLOCKED_ENV_KEYS = new Set([
|
|
|
556
556
|
"HOME",
|
|
557
557
|
"SHELL",
|
|
558
558
|
// Auth / step-up tokens — writable via API would grant privilege escalation
|
|
559
|
-
"
|
|
560
|
-
"
|
|
561
|
-
"
|
|
559
|
+
"ELIZA_API_TOKEN",
|
|
560
|
+
"ELIZA_WALLET_EXPORT_TOKEN",
|
|
561
|
+
"ELIZA_TERMINAL_RUN_TOKEN",
|
|
562
562
|
"HYPERSCAPE_AUTH_TOKEN",
|
|
563
563
|
// Wallet private keys — writable via API would enable key theft / replacement
|
|
564
564
|
"EVM_PRIVATE_KEY",
|
|
@@ -1250,7 +1250,7 @@ function readBundledPluginPackageMetadata(packageRoot, dirName, npmName) {
|
|
|
1250
1250
|
// Skills discovery + database-backed preferences
|
|
1251
1251
|
// ---------------------------------------------------------------------------
|
|
1252
1252
|
/** Cache key for persisting skill enable/disable state in the agent database. */
|
|
1253
|
-
const SKILL_PREFS_CACHE_KEY = "
|
|
1253
|
+
const SKILL_PREFS_CACHE_KEY = "eliza:skill-preferences";
|
|
1254
1254
|
/**
|
|
1255
1255
|
* Load persisted skill preferences from the agent's database.
|
|
1256
1256
|
* Returns an empty map when the runtime or database isn't available.
|
|
@@ -1280,7 +1280,7 @@ async function saveSkillPreferences(runtime, prefs) {
|
|
|
1280
1280
|
// ---------------------------------------------------------------------------
|
|
1281
1281
|
// Skill scan acknowledgments — tracks user review of security findings
|
|
1282
1282
|
// ---------------------------------------------------------------------------
|
|
1283
|
-
const SKILL_ACK_CACHE_KEY = "
|
|
1283
|
+
const SKILL_ACK_CACHE_KEY = "eliza:skill-scan-acknowledgments";
|
|
1284
1284
|
async function loadSkillAcknowledgments(runtime) {
|
|
1285
1285
|
if (!runtime)
|
|
1286
1286
|
return {};
|
|
@@ -1480,7 +1480,7 @@ async function discoverSkills(workspaceDir, config, runtime) {
|
|
|
1480
1480
|
skillsDirs.add(dir);
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
|
-
// Managed skills in the state dir (~/.
|
|
1483
|
+
// Managed skills in the state dir (~/.eliza/skills by default)
|
|
1484
1484
|
const managedSkills = path.join(resolveStateDir(), "skills");
|
|
1485
1485
|
if (fs.existsSync(managedSkills)) {
|
|
1486
1486
|
skillsDirs.add(managedSkills);
|
|
@@ -1849,7 +1849,7 @@ export function injectApiBaseIntoHtml(html, externalBase) {
|
|
|
1849
1849
|
const headCloseIndex = html.indexOf(headCloseTag);
|
|
1850
1850
|
if (headCloseIndex < 0)
|
|
1851
1851
|
return html;
|
|
1852
|
-
const injection = Buffer.from(`<script>window.
|
|
1852
|
+
const injection = Buffer.from(`<script>window.__ELIZA_API_BASE__=${JSON.stringify(trimmedBase)};</script>`);
|
|
1853
1853
|
return Buffer.concat([
|
|
1854
1854
|
html.subarray(0, headCloseIndex),
|
|
1855
1855
|
injection,
|
|
@@ -1912,7 +1912,7 @@ function serveStaticUi(req, res, pathname) {
|
|
|
1912
1912
|
// When served behind a reverse proxy that rewrites the app under a path prefix,
|
|
1913
1913
|
// inject the
|
|
1914
1914
|
// API base so the UI client sends requests to the correct path prefix.
|
|
1915
|
-
const html = injectApiBaseIntoHtml(uiIndexHtml, process.env.
|
|
1915
|
+
const html = injectApiBaseIntoHtml(uiIndexHtml, process.env.ELIZA_EXTERNAL_BASE_URL);
|
|
1916
1916
|
sendStaticResponse(req, res, 200, {
|
|
1917
1917
|
"Cache-Control": "public, max-age=0, must-revalidate",
|
|
1918
1918
|
"Content-Length": html.length,
|
|
@@ -3829,7 +3829,7 @@ export function canUseLocalTradeExecution(mode, isAgent) {
|
|
|
3829
3829
|
return !isAgent;
|
|
3830
3830
|
return false;
|
|
3831
3831
|
}
|
|
3832
|
-
const AGENT_AUTOMATION_HEADER = "x-
|
|
3832
|
+
const AGENT_AUTOMATION_HEADER = "x-eliza-agent-action";
|
|
3833
3833
|
const AGENT_AUTOMATION_MODES = new Set([
|
|
3834
3834
|
"connectors-only",
|
|
3835
3835
|
"full",
|
|
@@ -3949,7 +3949,7 @@ export function isAllowedHost(req) {
|
|
|
3949
3949
|
}
|
|
3950
3950
|
if (!hostname)
|
|
3951
3951
|
return true;
|
|
3952
|
-
const bindHost = (process.env.
|
|
3952
|
+
const bindHost = (process.env.ELIZA_API_BIND ?? "").trim().toLowerCase();
|
|
3953
3953
|
// When binding on all interfaces (0.0.0.0 / ::), any Host is acceptable —
|
|
3954
3954
|
// ensureApiTokenForBindHost already enforces a token for non-loopback binds.
|
|
3955
3955
|
if (WILDCARD_BIND_RE.test(stripPort(bindHost))) {
|
|
@@ -3959,9 +3959,9 @@ export function isAllowedHost(req) {
|
|
|
3959
3959
|
if (bindHost && hostname === stripPort(bindHost)) {
|
|
3960
3960
|
return true;
|
|
3961
3961
|
}
|
|
3962
|
-
// Allow explicitly listed extra hostnames via
|
|
3962
|
+
// Allow explicitly listed extra hostnames via ELIZA_ALLOWED_HOSTS
|
|
3963
3963
|
// (comma-separated, e.g. "myserver.local,192.168.1.10").
|
|
3964
|
-
const extra = process.env.
|
|
3964
|
+
const extra = process.env.ELIZA_ALLOWED_HOSTS;
|
|
3965
3965
|
if (extra) {
|
|
3966
3966
|
const allowed = extra
|
|
3967
3967
|
.split(",")
|
|
@@ -3980,11 +3980,11 @@ export function resolveCorsOrigin(origin) {
|
|
|
3980
3980
|
return null;
|
|
3981
3981
|
// When bound to a wildcard address, allow any origin. Non-loopback binds still
|
|
3982
3982
|
// require an explicit token, so this only relaxes the browser origin check.
|
|
3983
|
-
const bindHost = (process.env.
|
|
3983
|
+
const bindHost = (process.env.ELIZA_API_BIND ?? "").trim().toLowerCase();
|
|
3984
3984
|
if (WILDCARD_BIND_RE.test(stripPort(bindHost)))
|
|
3985
3985
|
return trimmed;
|
|
3986
3986
|
// Explicit allowlist via env (comma-separated)
|
|
3987
|
-
const extra = process.env.
|
|
3987
|
+
const extra = process.env.ELIZA_ALLOWED_ORIGINS;
|
|
3988
3988
|
if (extra) {
|
|
3989
3989
|
const allow = extra
|
|
3990
3990
|
.split(",")
|
|
@@ -3998,7 +3998,7 @@ export function resolveCorsOrigin(origin) {
|
|
|
3998
3998
|
if (APP_ORIGIN_RE.test(trimmed))
|
|
3999
3999
|
return trimmed;
|
|
4000
4000
|
if (trimmed === "null" || trimmed === "file://") {
|
|
4001
|
-
if (process.env.
|
|
4001
|
+
if (process.env.ELIZA_ALLOW_NULL_ORIGIN === "1") {
|
|
4002
4002
|
return "null";
|
|
4003
4003
|
}
|
|
4004
4004
|
}
|
|
@@ -4013,7 +4013,7 @@ function applyCors(req, res) {
|
|
|
4013
4013
|
res.setHeader("Access-Control-Allow-Origin", allowed);
|
|
4014
4014
|
res.setHeader("Vary", "Origin");
|
|
4015
4015
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
|
|
4016
|
-
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-
|
|
4016
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Eliza-Token, X-Api-Key, X-Eliza-Export-Token, X-Eliza-Client-Id, X-Eliza-Terminal-Token, X-Eliza-UI-Language");
|
|
4017
4017
|
}
|
|
4018
4018
|
// Security headers
|
|
4019
4019
|
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
@@ -4032,8 +4032,8 @@ let providerSwitchInProgress = false;
|
|
|
4032
4032
|
let pairingExpiresAt = 0;
|
|
4033
4033
|
const pairingAttempts = new Map();
|
|
4034
4034
|
function pairingEnabled() {
|
|
4035
|
-
return (Boolean(process.env.
|
|
4036
|
-
process.env.
|
|
4035
|
+
return (Boolean(process.env.ELIZA_API_TOKEN?.trim()) &&
|
|
4036
|
+
process.env.ELIZA_PAIRING_DISABLED !== "1");
|
|
4037
4037
|
}
|
|
4038
4038
|
function normalizePairingCode(code) {
|
|
4039
4039
|
return code.replace(/[^a-zA-Z0-9]/g, "").toUpperCase();
|
|
@@ -4081,8 +4081,8 @@ export function extractAuthToken(req) {
|
|
|
4081
4081
|
if (match?.[1])
|
|
4082
4082
|
return match[1].trim();
|
|
4083
4083
|
}
|
|
4084
|
-
const header = (typeof req.headers["x-
|
|
4085
|
-
req.headers["x-
|
|
4084
|
+
const header = (typeof req.headers["x-eliza-token"] === "string" &&
|
|
4085
|
+
req.headers["x-eliza-token"]) ||
|
|
4086
4086
|
(typeof req.headers["x-api-key"] === "string" && req.headers["x-api-key"]);
|
|
4087
4087
|
if (typeof header === "string" && header.trim())
|
|
4088
4088
|
return header.trim();
|
|
@@ -4107,7 +4107,7 @@ function firstHeaderValue(value) {
|
|
|
4107
4107
|
return null;
|
|
4108
4108
|
}
|
|
4109
4109
|
export function resolveTerminalRunClientId(req, body) {
|
|
4110
|
-
const headerClientId = normalizeWsClientId(firstHeaderValue(req.headers["x-
|
|
4110
|
+
const headerClientId = normalizeWsClientId(firstHeaderValue(req.headers["x-eliza-client-id"]));
|
|
4111
4111
|
if (headerClientId)
|
|
4112
4112
|
return headerClientId;
|
|
4113
4113
|
return normalizeWsClientId(body?.clientId);
|
|
@@ -4166,19 +4166,19 @@ function isLoopbackBindHost(host) {
|
|
|
4166
4166
|
return false;
|
|
4167
4167
|
}
|
|
4168
4168
|
export function ensureApiTokenForBindHost(host) {
|
|
4169
|
-
const token = process.env.
|
|
4169
|
+
const token = process.env.ELIZA_API_TOKEN?.trim();
|
|
4170
4170
|
if (token)
|
|
4171
4171
|
return;
|
|
4172
4172
|
if (isLoopbackBindHost(host))
|
|
4173
4173
|
return;
|
|
4174
4174
|
const generated = crypto.randomBytes(32).toString("hex");
|
|
4175
|
-
process.env.
|
|
4176
|
-
logger.warn(`[milady-api]
|
|
4175
|
+
process.env.ELIZA_API_TOKEN = generated;
|
|
4176
|
+
logger.warn(`[milady-api] ELIZA_API_BIND=${host} is non-loopback and ELIZA_API_TOKEN is unset.`);
|
|
4177
4177
|
const tokenFingerprint = `${generated.slice(0, 4)}...${generated.slice(-4)}`;
|
|
4178
|
-
logger.warn(`[milady-api] Generated temporary
|
|
4178
|
+
logger.warn(`[milady-api] Generated temporary ELIZA_API_TOKEN (${tokenFingerprint}) for this process. Set ELIZA_API_TOKEN explicitly to override.`);
|
|
4179
4179
|
}
|
|
4180
4180
|
export function isAuthorized(req) {
|
|
4181
|
-
const expected = process.env.
|
|
4181
|
+
const expected = (process.env.ELIZA_API_TOKEN ?? process.env.ELIZA_API_TOKEN)?.trim();
|
|
4182
4182
|
if (!expected)
|
|
4183
4183
|
return true;
|
|
4184
4184
|
const provided = extractAuthToken(req);
|
|
@@ -4214,22 +4214,22 @@ export function resolveWalletExportRejection(req, body) {
|
|
|
4214
4214
|
reason: 'Export requires explicit confirmation. Send { "confirm": true } in the request body.',
|
|
4215
4215
|
};
|
|
4216
4216
|
}
|
|
4217
|
-
const expected = process.env.
|
|
4217
|
+
const expected = process.env.ELIZA_WALLET_EXPORT_TOKEN?.trim();
|
|
4218
4218
|
if (!expected) {
|
|
4219
4219
|
return {
|
|
4220
4220
|
status: 403,
|
|
4221
|
-
reason: "Wallet export is disabled. Set
|
|
4221
|
+
reason: "Wallet export is disabled. Set ELIZA_WALLET_EXPORT_TOKEN to enable secure exports.",
|
|
4222
4222
|
};
|
|
4223
4223
|
}
|
|
4224
|
-
const headerToken = typeof req.headers["x-
|
|
4225
|
-
? req.headers["x-
|
|
4224
|
+
const headerToken = typeof req.headers["x-eliza-export-token"] === "string"
|
|
4225
|
+
? req.headers["x-eliza-export-token"].trim()
|
|
4226
4226
|
: "";
|
|
4227
4227
|
const bodyToken = typeof body.exportToken === "string" ? body.exportToken.trim() : "";
|
|
4228
4228
|
const provided = headerToken || bodyToken;
|
|
4229
4229
|
if (!provided) {
|
|
4230
4230
|
return {
|
|
4231
4231
|
status: 401,
|
|
4232
|
-
reason: "Missing export token. Provide X-
|
|
4232
|
+
reason: "Missing export token. Provide X-Eliza-Export-Token header or exportToken in request body.",
|
|
4233
4233
|
};
|
|
4234
4234
|
}
|
|
4235
4235
|
if (!tokenMatches(expected, provided)) {
|
|
@@ -4238,8 +4238,8 @@ export function resolveWalletExportRejection(req, body) {
|
|
|
4238
4238
|
return null;
|
|
4239
4239
|
}
|
|
4240
4240
|
export function resolveTerminalRunRejection(req, body) {
|
|
4241
|
-
const expected = process.env.
|
|
4242
|
-
const apiTokenEnabled = Boolean(process.env.
|
|
4241
|
+
const expected = process.env.ELIZA_TERMINAL_RUN_TOKEN?.trim();
|
|
4242
|
+
const apiTokenEnabled = Boolean(process.env.ELIZA_API_TOKEN?.trim());
|
|
4243
4243
|
// Compatibility mode: local loopback sessions without API token keep
|
|
4244
4244
|
// existing behavior unless an explicit terminal token is configured.
|
|
4245
4245
|
if (!expected && !apiTokenEnabled) {
|
|
@@ -4248,18 +4248,18 @@ export function resolveTerminalRunRejection(req, body) {
|
|
|
4248
4248
|
if (!expected) {
|
|
4249
4249
|
return {
|
|
4250
4250
|
status: 403,
|
|
4251
|
-
reason: "Terminal run is disabled for token-authenticated API sessions. Set
|
|
4251
|
+
reason: "Terminal run is disabled for token-authenticated API sessions. Set ELIZA_TERMINAL_RUN_TOKEN to enable command execution.",
|
|
4252
4252
|
};
|
|
4253
4253
|
}
|
|
4254
|
-
const headerToken = typeof req.headers["x-
|
|
4255
|
-
? req.headers["x-
|
|
4254
|
+
const headerToken = typeof req.headers["x-eliza-terminal-token"] === "string"
|
|
4255
|
+
? req.headers["x-eliza-terminal-token"].trim()
|
|
4256
4256
|
: "";
|
|
4257
4257
|
const bodyToken = typeof body.terminalToken === "string" ? body.terminalToken.trim() : "";
|
|
4258
4258
|
const provided = headerToken || bodyToken;
|
|
4259
4259
|
if (!provided) {
|
|
4260
4260
|
return {
|
|
4261
4261
|
status: 401,
|
|
4262
|
-
reason: "Missing terminal token. Provide X-
|
|
4262
|
+
reason: "Missing terminal token. Provide X-Eliza-Terminal-Token header or terminalToken in request body.",
|
|
4263
4263
|
};
|
|
4264
4264
|
}
|
|
4265
4265
|
if (!tokenMatches(expected, provided)) {
|
|
@@ -4271,7 +4271,7 @@ export function resolveTerminalRunRejection(req, body) {
|
|
|
4271
4271
|
return null;
|
|
4272
4272
|
}
|
|
4273
4273
|
function extractWsQueryToken(url) {
|
|
4274
|
-
const allowQueryToken = process.env.
|
|
4274
|
+
const allowQueryToken = process.env.ELIZA_ALLOW_WS_QUERY_TOKEN === "1";
|
|
4275
4275
|
if (!allowQueryToken)
|
|
4276
4276
|
return null;
|
|
4277
4277
|
const token = url.searchParams.get("token") ??
|
|
@@ -4280,7 +4280,7 @@ function extractWsQueryToken(url) {
|
|
|
4280
4280
|
return token?.trim() || null;
|
|
4281
4281
|
}
|
|
4282
4282
|
function isWebSocketAuthorized(request, url) {
|
|
4283
|
-
const expected = process.env.
|
|
4283
|
+
const expected = process.env.ELIZA_API_TOKEN?.trim();
|
|
4284
4284
|
if (!expected)
|
|
4285
4285
|
return true;
|
|
4286
4286
|
const headerToken = extractAuthToken(request);
|
|
@@ -4305,7 +4305,7 @@ export function resolveWebSocketUpgradeRejection(req, wsUrl) {
|
|
|
4305
4305
|
}
|
|
4306
4306
|
return null;
|
|
4307
4307
|
}
|
|
4308
|
-
const RESET_STATE_ALLOWED_SEGMENTS = new Set([".
|
|
4308
|
+
const RESET_STATE_ALLOWED_SEGMENTS = new Set([".eliza", "milady"]);
|
|
4309
4309
|
function hasAllowedResetSegment(resolvedState) {
|
|
4310
4310
|
return resolvedState
|
|
4311
4311
|
.split(path.sep)
|
|
@@ -5471,7 +5471,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
5471
5471
|
const incomingHost = req.headers.host ?? "your-hostname";
|
|
5472
5472
|
json(res, {
|
|
5473
5473
|
error: "Forbidden — invalid Host header",
|
|
5474
|
-
hint: `To allow this host, set
|
|
5474
|
+
hint: `To allow this host, set ELIZA_ALLOWED_HOSTS=${incomingHost} in your environment, or access via http://localhost`,
|
|
5475
5475
|
docs: "https://docs.milady.ai/configuration#allowed-hosts",
|
|
5476
5476
|
}, 403);
|
|
5477
5477
|
return;
|
|
@@ -5567,16 +5567,16 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
5567
5567
|
};
|
|
5568
5568
|
// Helper: clear pi-ai mode
|
|
5569
5569
|
const clearPiAi = () => {
|
|
5570
|
-
delete process.env.
|
|
5571
|
-
delete envCfg.
|
|
5570
|
+
delete process.env.ELIZA_USE_PI_AI;
|
|
5571
|
+
delete envCfg.ELIZA_USE_PI_AI;
|
|
5572
5572
|
const envRoot = config.env;
|
|
5573
5573
|
const vars = envRoot.vars;
|
|
5574
5574
|
if (vars && typeof vars === "object" && !Array.isArray(vars)) {
|
|
5575
|
-
delete vars.
|
|
5575
|
+
delete vars.ELIZA_USE_PI_AI;
|
|
5576
5576
|
}
|
|
5577
5577
|
if (state.runtime?.character?.secrets) {
|
|
5578
5578
|
const secrets = state.runtime.character.secrets;
|
|
5579
|
-
delete secrets.
|
|
5579
|
+
delete secrets.ELIZA_USE_PI_AI;
|
|
5580
5580
|
}
|
|
5581
5581
|
};
|
|
5582
5582
|
// Helper: clear subscription credentials
|
|
@@ -5663,15 +5663,15 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
5663
5663
|
disableCloudInference();
|
|
5664
5664
|
await clearSubscriptions();
|
|
5665
5665
|
clearOtherApiKeys();
|
|
5666
|
-
process.env.
|
|
5667
|
-
envCfg.
|
|
5666
|
+
process.env.ELIZA_USE_PI_AI = "1";
|
|
5667
|
+
envCfg.ELIZA_USE_PI_AI = "1";
|
|
5668
5668
|
const envRoot = config.env;
|
|
5669
5669
|
const vars = envRoot.vars &&
|
|
5670
5670
|
typeof envRoot.vars === "object" &&
|
|
5671
5671
|
!Array.isArray(envRoot.vars)
|
|
5672
5672
|
? envRoot.vars
|
|
5673
5673
|
: {};
|
|
5674
|
-
vars.
|
|
5674
|
+
vars.ELIZA_USE_PI_AI = "1";
|
|
5675
5675
|
envRoot.vars = vars;
|
|
5676
5676
|
}
|
|
5677
5677
|
else if (normalizedProvider === "openai-codex" ||
|
|
@@ -6131,13 +6131,13 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
6131
6131
|
// Persist vars back onto config.env
|
|
6132
6132
|
envCfg.vars = vars;
|
|
6133
6133
|
const clearPiAiFlag = () => {
|
|
6134
|
-
delete vars.
|
|
6135
|
-
delete config.env.
|
|
6136
|
-
delete process.env.
|
|
6134
|
+
delete vars.ELIZA_USE_PI_AI;
|
|
6135
|
+
delete config.env.ELIZA_USE_PI_AI;
|
|
6136
|
+
delete process.env.ELIZA_USE_PI_AI;
|
|
6137
6137
|
};
|
|
6138
6138
|
if (runMode === "local" && providerId === "pi-ai") {
|
|
6139
|
-
vars.
|
|
6140
|
-
process.env.
|
|
6139
|
+
vars.ELIZA_USE_PI_AI = "1";
|
|
6140
|
+
process.env.ELIZA_USE_PI_AI = "1";
|
|
6141
6141
|
// Optional primary model override (provider/model).
|
|
6142
6142
|
if (!config.agents)
|
|
6143
6143
|
config.agents = {};
|
|
@@ -8296,7 +8296,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
8296
8296
|
json(res, {
|
|
8297
8297
|
walletAddress,
|
|
8298
8298
|
whitelisted,
|
|
8299
|
-
contractAddress: process.env.
|
|
8299
|
+
contractAddress: process.env.ELIZA_NFT_CONTRACT?.trim() ||
|
|
8300
8300
|
"0x5Af0D9827E0c53E4799BB226655A1de152A425a5",
|
|
8301
8301
|
message: whitelisted
|
|
8302
8302
|
? "Address is whitelisted for mint."
|
|
@@ -8631,7 +8631,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
8631
8631
|
}
|
|
8632
8632
|
}
|
|
8633
8633
|
// ── POST /api/avatar/vrm ─────────────────────────────────────────────────
|
|
8634
|
-
// Upload a custom VRM avatar file. Saved to ~/.
|
|
8634
|
+
// Upload a custom VRM avatar file. Saved to ~/.eliza/avatars/custom.vrm.
|
|
8635
8635
|
if (method === "POST" && pathname === "/api/avatar/vrm") {
|
|
8636
8636
|
const MAX_VRM_BYTES = 50 * 1024 * 1024; // 50 MB
|
|
8637
8637
|
const rawBody = await readRequestBodyBuffer(req, {
|
|
@@ -8686,7 +8686,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
8686
8686
|
return;
|
|
8687
8687
|
}
|
|
8688
8688
|
// ── POST /api/avatar/background ──────────────────────────────────────────
|
|
8689
|
-
// Upload a custom background image. Saved to ~/.
|
|
8689
|
+
// Upload a custom background image. Saved to ~/.eliza/avatars/custom-background.<ext>.
|
|
8690
8690
|
if (method === "POST" && pathname === "/api/avatar/background") {
|
|
8691
8691
|
const MAX_BG_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
8692
8692
|
const rawBody = await readRequestBodyBuffer(req, {
|
|
@@ -8841,9 +8841,9 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
8841
8841
|
// merge, even though BLOCKED_ENV_KEYS also blocks them during process.env
|
|
8842
8842
|
// sync below. Keeping both guards prevents accidental persistence if one
|
|
8843
8843
|
// path changes in future refactors.
|
|
8844
|
-
delete envPatch.
|
|
8845
|
-
delete envPatch.
|
|
8846
|
-
delete envPatch.
|
|
8844
|
+
delete envPatch.ELIZA_API_TOKEN;
|
|
8845
|
+
delete envPatch.ELIZA_WALLET_EXPORT_TOKEN;
|
|
8846
|
+
delete envPatch.ELIZA_TERMINAL_RUN_TOKEN;
|
|
8847
8847
|
delete envPatch.HYPERSCAPE_AUTH_TOKEN;
|
|
8848
8848
|
delete envPatch.EVM_PRIVATE_KEY;
|
|
8849
8849
|
delete envPatch.SOLANA_PRIVATE_KEY;
|
|
@@ -8852,9 +8852,9 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
8852
8852
|
typeof envPatch.vars === "object" &&
|
|
8853
8853
|
!Array.isArray(envPatch.vars)) {
|
|
8854
8854
|
const vars = envPatch.vars;
|
|
8855
|
-
delete vars.
|
|
8856
|
-
delete vars.
|
|
8857
|
-
delete vars.
|
|
8855
|
+
delete vars.ELIZA_API_TOKEN;
|
|
8856
|
+
delete vars.ELIZA_WALLET_EXPORT_TOKEN;
|
|
8857
|
+
delete vars.ELIZA_TERMINAL_RUN_TOKEN;
|
|
8858
8858
|
delete vars.HYPERSCAPE_AUTH_TOKEN;
|
|
8859
8859
|
delete vars.EVM_PRIVATE_KEY;
|
|
8860
8860
|
delete vars.SOLANA_PRIVATE_KEY;
|
|
@@ -12004,7 +12004,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
12004
12004
|
}
|
|
12005
12005
|
const targetClientId = resolveTerminalRunClientId(req, body);
|
|
12006
12006
|
if (!targetClientId) {
|
|
12007
|
-
error(res, "Missing client id. Provide X-
|
|
12007
|
+
error(res, "Missing client id. Provide X-Eliza-Client-Id header or clientId in the request body.", 400);
|
|
12008
12008
|
return;
|
|
12009
12009
|
}
|
|
12010
12010
|
const emitTerminalEvent = (payload) => {
|
|
@@ -12122,7 +12122,7 @@ async function handleRequest(req, res, state, ctx) {
|
|
|
12122
12122
|
}
|
|
12123
12123
|
// Security gate: shell and code handlers execute arbitrary commands or
|
|
12124
12124
|
// code on the host machine, and the resulting action persists in config
|
|
12125
|
-
// (survives restarts). Require the
|
|
12125
|
+
// (survives restarts). Require the ELIZA_TERMINAL_RUN_TOKEN to prove
|
|
12126
12126
|
// the caller has explicit operator authority for code execution.
|
|
12127
12127
|
if (handler.type === "shell" || handler.type === "code") {
|
|
12128
12128
|
const terminalRejection = resolveTerminalRunRejection(req, body);
|
|
@@ -12419,7 +12419,7 @@ export async function startApiServer(opts) {
|
|
|
12419
12419
|
const apiStartTime = Date.now();
|
|
12420
12420
|
console.log(`[milady-api] startApiServer called`);
|
|
12421
12421
|
const port = opts?.port ?? 2138;
|
|
12422
|
-
const host = (process.env.
|
|
12422
|
+
const host = (process.env.ELIZA_API_BIND ?? "127.0.0.1").trim() || "127.0.0.1";
|
|
12423
12423
|
ensureApiTokenForBindHost(host);
|
|
12424
12424
|
console.log(`[milady-api] Token check done (${Date.now() - apiStartTime}ms)`);
|
|
12425
12425
|
let config;
|
|
@@ -13,7 +13,7 @@ import { logger } from "@elizaos/core";
|
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
// Constants
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
|
-
const OVERLAY_DIR = path.join(process.env.
|
|
16
|
+
const OVERLAY_DIR = path.join(process.env.ELIZA_DATA_DIR || path.join(process.cwd(), "data"), "stream");
|
|
17
17
|
const SETTINGS_FILE = path.join(OVERLAY_DIR, "stream-settings.json");
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Internal helpers
|
|
@@ -4,14 +4,14 @@ const TERMINAL_RUN_MAX_CONCURRENT_CAP = 16;
|
|
|
4
4
|
const TERMINAL_RUN_MAX_DURATION_MS_DEFAULT = 5 * 60 * 1000;
|
|
5
5
|
const TERMINAL_RUN_MAX_DURATION_MS_CAP = 60 * 60 * 1000;
|
|
6
6
|
export function resolveTerminalRunLimits() {
|
|
7
|
-
const maxConcurrentRaw = process.env.
|
|
7
|
+
const maxConcurrentRaw = process.env.ELIZA_TERMINAL_MAX_CONCURRENT ??
|
|
8
8
|
process.env.MILAIDY_TERMINAL_MAX_CONCURRENT;
|
|
9
9
|
const maxConcurrent = parseClampedInteger(maxConcurrentRaw, {
|
|
10
10
|
fallback: TERMINAL_RUN_MAX_CONCURRENT_DEFAULT,
|
|
11
11
|
min: 1,
|
|
12
12
|
max: TERMINAL_RUN_MAX_CONCURRENT_CAP,
|
|
13
13
|
});
|
|
14
|
-
const maxDurationMsRaw = process.env.
|
|
14
|
+
const maxDurationMsRaw = process.env.ELIZA_TERMINAL_MAX_DURATION_MS ??
|
|
15
15
|
process.env.MILAIDY_TERMINAL_MAX_DURATION_MS;
|
|
16
16
|
const maxDurationMs = parseClampedInteger(maxDurationMsRaw, {
|
|
17
17
|
fallback: TERMINAL_RUN_MAX_DURATION_MS_DEFAULT,
|
|
@@ -2,8 +2,8 @@ import type { KeyValidationResult, SolanaNft, SolanaTokenBalance, WalletAddresse
|
|
|
2
2
|
export type { BscTradeExecuteRequest, BscTradeExecuteResponse, BscTradeExecutionResult, BscTradePreflightRequest, BscTradePreflightResponse, BscTradeQuoteRequest, BscTradeQuoteResponse, BscTradeSide, BscTradeTxStatus, BscTradeTxStatusResponse, BscTransferExecuteRequest, BscTransferExecuteResponse, BscTransferExecutionResult, BscUnsignedApprovalTx, BscUnsignedTradeTx, BscUnsignedTransferTx, EvmChainBalance, EvmNft, EvmTokenBalance, KeyValidationResult, SolanaNft, SolanaTokenBalance, TradePermissionMode, WalletAddresses, WalletBalancesResponse, WalletChain, WalletConfigStatus, WalletGenerateResult, WalletImportResult, WalletKeys, WalletNftsResponse, WalletTradeLedgerEntry, WalletTradeSource, WalletTradingProfileResponse, WalletTradingProfileSourceFilter, WalletTradingProfileWindow, } from "../contracts/wallet";
|
|
3
3
|
export { computeValueUsd, DEX_PRICE_TIMEOUT_MS, DEXPAPRIKA_CHAIN_MAP, DEXSCREENER_CHAIN_MAP, type DexScreenerPair, type DexTokenMeta, fetchDexPaprikaPrices, fetchDexPrices, fetchDexScreenerPrices, WRAPPED_NATIVE, } from "./wallet-dex-prices";
|
|
4
4
|
export { type AnkrTokenAsset, DEFAULT_EVM_CHAINS, type EvmProviderKeys, fetchEvmBalances, fetchEvmNfts, resolveEvmProviderKeys, } from "./wallet-evm-balance";
|
|
5
|
-
export declare const MANAGED_EVM_ADDRESS_ENV_KEY = "
|
|
6
|
-
export declare const MANAGED_SOLANA_ADDRESS_ENV_KEY = "
|
|
5
|
+
export declare const MANAGED_EVM_ADDRESS_ENV_KEY = "ELIZA_MANAGED_EVM_ADDRESS";
|
|
6
|
+
export declare const MANAGED_SOLANA_ADDRESS_ENV_KEY = "ELIZA_MANAGED_SOLANA_ADDRESS";
|
|
7
7
|
export declare function deriveEvmAddress(privateKeyHex: string): string;
|
|
8
8
|
export declare function deriveSolanaAddress(privateKeyString: string): string;
|
|
9
9
|
export declare function validateEvmPrivateKey(key: string): KeyValidationResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/api/wallet.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACX,MAAM,qBAAqB,CAAC;AAI7B,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,4BAA4B,EAC5B,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,cAAc,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/api/wallet.ts"],"names":[],"mappings":"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"}
|
|
@@ -15,8 +15,8 @@ export { computeValueUsd, DEX_PRICE_TIMEOUT_MS, DEXPAPRIKA_CHAIN_MAP, DEXSCREENE
|
|
|
15
15
|
export { DEFAULT_EVM_CHAINS, fetchEvmBalances, fetchEvmNfts, resolveEvmProviderKeys, } from "./wallet-evm-balance";
|
|
16
16
|
// ── Constants ─────────────────────────────────────────────────────────
|
|
17
17
|
const FETCH_TIMEOUT_MS = 15_000;
|
|
18
|
-
export const MANAGED_EVM_ADDRESS_ENV_KEY = "
|
|
19
|
-
export const MANAGED_SOLANA_ADDRESS_ENV_KEY = "
|
|
18
|
+
export const MANAGED_EVM_ADDRESS_ENV_KEY = "ELIZA_MANAGED_EVM_ADDRESS";
|
|
19
|
+
export const MANAGED_SOLANA_ADDRESS_ENV_KEY = "ELIZA_MANAGED_SOLANA_ADDRESS";
|
|
20
20
|
// ── EVM key derivation (secp256k1 via @noble/curves + keccak-256) ─────
|
|
21
21
|
function generateEvmPrivateKey() {
|
|
22
22
|
return `0x${crypto.randomBytes(32).toString("hex")}`;
|