@exagent/agent 0.1.22 → 0.1.24
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/dist/chunk-AE5IDR5K.mjs +5315 -0
- package/dist/chunk-GD6SEMIE.mjs +5307 -0
- package/dist/chunk-IBU6T6U7.mjs +5315 -0
- package/dist/chunk-NENK6U55.mjs +5305 -0
- package/dist/chunk-QSKHZYR2.mjs +5305 -0
- package/dist/cli.js +101 -7
- package/dist/cli.mjs +87 -3
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +15 -5
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1659,7 +1659,7 @@ function classifyTradeError(message) {
|
|
|
1659
1659
|
if (lower.includes("notauthorizedforagent") || lower.includes("not authorized")) {
|
|
1660
1660
|
return {
|
|
1661
1661
|
category: "not_authorized",
|
|
1662
|
-
userMessage:
|
|
1662
|
+
userMessage: 'Wallet not authorized for this agent. This wallet is not linked to your agent on-chain, so the router rejected the trade. To fix: (1) Open your command center at exagent.io, (2) Use the Wallet Management panel to check linked wallets, (3) If you lost your old wallet, unlink it first then re-run the agent to link the new one. Run "npx @exagent/agent export-key" to verify which wallet this agent is using.'
|
|
1663
1663
|
};
|
|
1664
1664
|
}
|
|
1665
1665
|
if (lower.includes("aggregatornotwhitelisted")) {
|
|
@@ -1834,7 +1834,9 @@ var RiskManager = class {
|
|
|
1834
1834
|
dailyNetPnL: this.dailyPnL - this.dailyFees,
|
|
1835
1835
|
dailyLossLimit: maxLossUSD,
|
|
1836
1836
|
// Only market PnL triggers the limit — fees are excluded
|
|
1837
|
-
isLimitHit: pv > 0 ? this.dailyPnL < -maxLossUSD : false
|
|
1837
|
+
isLimitHit: pv > 0 ? this.dailyPnL < -maxLossUSD : false,
|
|
1838
|
+
maxPositionSizeBps: this.config.maxPositionSizeBps,
|
|
1839
|
+
maxDailyLossBps: this.config.maxDailyLossBps
|
|
1838
1840
|
};
|
|
1839
1841
|
}
|
|
1840
1842
|
// ============================================================
|
|
@@ -3702,7 +3704,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
3702
3704
|
}
|
|
3703
3705
|
|
|
3704
3706
|
// src/index.ts
|
|
3705
|
-
var AGENT_VERSION = "0.1.
|
|
3707
|
+
var AGENT_VERSION = "0.1.24";
|
|
3706
3708
|
|
|
3707
3709
|
// src/relay.ts
|
|
3708
3710
|
var RelayClient = class {
|
|
@@ -4807,7 +4809,9 @@ var AgentRuntime = class {
|
|
|
4807
4809
|
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
4808
4810
|
dailyPnL: 0,
|
|
4809
4811
|
dailyLossLimit: 0,
|
|
4810
|
-
isLimitHit: false
|
|
4812
|
+
isLimitHit: false,
|
|
4813
|
+
maxPositionSizeBps: this.config.trading.maxPositionSizeBps,
|
|
4814
|
+
maxDailyLossBps: this.config.trading.maxDailyLossBps
|
|
4811
4815
|
},
|
|
4812
4816
|
vault: {
|
|
4813
4817
|
policy: vaultConfig.policy,
|
|
@@ -5193,7 +5197,13 @@ var AgentRuntime = class {
|
|
|
5193
5197
|
model: this.config.llm.model || "default"
|
|
5194
5198
|
},
|
|
5195
5199
|
configHash: this.configHash || "not initialized",
|
|
5196
|
-
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
5200
|
+
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
5201
|
+
dailyPnL: 0,
|
|
5202
|
+
dailyLossLimit: 0,
|
|
5203
|
+
isLimitHit: false,
|
|
5204
|
+
maxPositionSizeBps: this.config.trading.maxPositionSizeBps,
|
|
5205
|
+
maxDailyLossBps: this.config.trading.maxDailyLossBps
|
|
5206
|
+
},
|
|
5197
5207
|
vault: {
|
|
5198
5208
|
policy: vaultConfig.policy,
|
|
5199
5209
|
hasVault: false,
|
|
@@ -5306,6 +5316,37 @@ async function checkFirstRunSetup(configPath) {
|
|
|
5306
5316
|
let privateKey;
|
|
5307
5317
|
let walletAddress;
|
|
5308
5318
|
if (walletSetup === "generate") {
|
|
5319
|
+
console.log("");
|
|
5320
|
+
console.log("!".repeat(60));
|
|
5321
|
+
console.log(" WALLET BACKUP \u2014 READ BEFORE CONTINUING");
|
|
5322
|
+
console.log("!".repeat(60));
|
|
5323
|
+
console.log("");
|
|
5324
|
+
console.log(" WHY THIS MATTERS:");
|
|
5325
|
+
console.log(" Exagent is non-custodial. Your trading wallet key is");
|
|
5326
|
+
console.log(" generated here on your machine and never leaves it.");
|
|
5327
|
+
console.log(" We do not store it. No one else has a copy.");
|
|
5328
|
+
console.log("");
|
|
5329
|
+
console.log(" WHAT THIS MEANS:");
|
|
5330
|
+
console.log(" The private key will live ONLY in the .env file");
|
|
5331
|
+
console.log(" in this folder. If you delete this folder, your");
|
|
5332
|
+
console.log(" wallet and ALL FUNDS in it are permanently lost.");
|
|
5333
|
+
console.log(" There is NO recovery \u2014 Exagent cannot help.");
|
|
5334
|
+
console.log("");
|
|
5335
|
+
console.log(" BEFORE CONTINUING:");
|
|
5336
|
+
console.log(" - Know where this folder is on your computer");
|
|
5337
|
+
console.log(" - Plan to back up .env (or .env.enc) after setup");
|
|
5338
|
+
console.log(" - Store your passphrase in a password manager");
|
|
5339
|
+
console.log(" - View your key anytime: npx @exagent/agent export-key");
|
|
5340
|
+
console.log("");
|
|
5341
|
+
console.log("!".repeat(60));
|
|
5342
|
+
console.log("");
|
|
5343
|
+
const ack = await prompt(' Type "I understand" to continue: ');
|
|
5344
|
+
if (ack.trim().toLowerCase() !== "i understand") {
|
|
5345
|
+
console.log("");
|
|
5346
|
+
console.log(" Setup cancelled. Run the agent again when ready.");
|
|
5347
|
+
process.exit(0);
|
|
5348
|
+
}
|
|
5349
|
+
console.log("");
|
|
5309
5350
|
console.log("[WALLET] Generating a new wallet for your agent...");
|
|
5310
5351
|
console.log("");
|
|
5311
5352
|
const generatedKey = (0, import_accounts6.generatePrivateKey)();
|
|
@@ -5319,8 +5360,9 @@ async function checkFirstRunSetup(configPath) {
|
|
|
5319
5360
|
console.log(" | " + walletAddress.padEnd(56) + " |");
|
|
5320
5361
|
console.log(" +" + "-".repeat(58) + "+");
|
|
5321
5362
|
console.log("");
|
|
5322
|
-
console.log("
|
|
5323
|
-
console.log("
|
|
5363
|
+
console.log(" CRITICAL: Back up your .env file now.");
|
|
5364
|
+
console.log(" Export your key anytime: npx @exagent/agent export-key");
|
|
5365
|
+
console.log(" If you lose .env AND your backup, funds are unrecoverable.");
|
|
5324
5366
|
console.log("");
|
|
5325
5367
|
const confirmed = await prompt(" Press Enter to continue, or Ctrl+C to cancel...");
|
|
5326
5368
|
} else {
|
|
@@ -5649,4 +5691,56 @@ program.command("encrypt").description("Encrypt .env file to .env.enc for secure
|
|
|
5649
5691
|
process.exit(1);
|
|
5650
5692
|
}
|
|
5651
5693
|
});
|
|
5694
|
+
program.command("export-key").description("Display your trading wallet private key for backup").option("-d, --dir <path>", "Directory containing .env or .env.enc file", ".").option("-p, --passphrase <passphrase>", "Passphrase to decrypt .env.enc").action(async (options) => {
|
|
5695
|
+
try {
|
|
5696
|
+
const dir = options.dir.startsWith("/") ? options.dir : path2.join(process.cwd(), options.dir);
|
|
5697
|
+
let passphrase = options.passphrase || process.env.EXAGENT_PASSPHRASE;
|
|
5698
|
+
const encPath = path2.join(dir, ".env.enc");
|
|
5699
|
+
const envPath = path2.join(dir, ".env");
|
|
5700
|
+
if (fs2.existsSync(encPath) && !passphrase) {
|
|
5701
|
+
console.log("");
|
|
5702
|
+
console.log(" Encrypted config found (.env.enc)");
|
|
5703
|
+
console.log("");
|
|
5704
|
+
passphrase = await prompt(" Enter passphrase: ", true);
|
|
5705
|
+
console.log("");
|
|
5706
|
+
}
|
|
5707
|
+
const usedEncrypted = loadSecureEnv(dir, passphrase);
|
|
5708
|
+
if (!usedEncrypted && fs2.existsSync(envPath)) {
|
|
5709
|
+
const { config: loadDotenv } = await import("dotenv");
|
|
5710
|
+
loadDotenv({ path: envPath, override: true });
|
|
5711
|
+
}
|
|
5712
|
+
const privateKey = process.env.EXAGENT_PRIVATE_KEY;
|
|
5713
|
+
if (!privateKey) {
|
|
5714
|
+
console.error("");
|
|
5715
|
+
console.error(" No private key found. Make sure .env or .env.enc exists in this directory.");
|
|
5716
|
+
console.error("");
|
|
5717
|
+
process.exit(1);
|
|
5718
|
+
}
|
|
5719
|
+
const { privateKeyToAccount: privateKeyToAccount7 } = await import("viem/accounts");
|
|
5720
|
+
const account = privateKeyToAccount7(privateKey);
|
|
5721
|
+
console.log("");
|
|
5722
|
+
console.log("=".repeat(60));
|
|
5723
|
+
console.log(" WALLET PRIVATE KEY EXPORT");
|
|
5724
|
+
console.log("=".repeat(60));
|
|
5725
|
+
console.log("");
|
|
5726
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
5727
|
+
console.log(" | WALLET ADDRESS: |");
|
|
5728
|
+
console.log(" | " + account.address.padEnd(56) + " |");
|
|
5729
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
5730
|
+
console.log(" | PRIVATE KEY: |");
|
|
5731
|
+
console.log(" | " + privateKey.padEnd(56) + " |");
|
|
5732
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
5733
|
+
console.log("");
|
|
5734
|
+
console.log(" WARNING: Anyone with this key controls your wallet.");
|
|
5735
|
+
console.log(" Store it in a password manager. Never share it.");
|
|
5736
|
+
console.log(" Never paste it in a browser, email, or chat.");
|
|
5737
|
+
console.log("");
|
|
5738
|
+
console.log("=".repeat(60));
|
|
5739
|
+
console.log("");
|
|
5740
|
+
process.exit(0);
|
|
5741
|
+
} catch (error) {
|
|
5742
|
+
console.error("Error:", error instanceof Error ? error.message : error);
|
|
5743
|
+
process.exit(1);
|
|
5744
|
+
}
|
|
5745
|
+
});
|
|
5652
5746
|
program.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
loadConfig,
|
|
7
7
|
loadSecureEnv,
|
|
8
8
|
validateConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IBU6T6U7.mjs";
|
|
10
10
|
|
|
11
11
|
// src/cli.ts
|
|
12
12
|
import { Command } from "commander";
|
|
@@ -89,6 +89,37 @@ async function checkFirstRunSetup(configPath) {
|
|
|
89
89
|
let privateKey;
|
|
90
90
|
let walletAddress;
|
|
91
91
|
if (walletSetup === "generate") {
|
|
92
|
+
console.log("");
|
|
93
|
+
console.log("!".repeat(60));
|
|
94
|
+
console.log(" WALLET BACKUP \u2014 READ BEFORE CONTINUING");
|
|
95
|
+
console.log("!".repeat(60));
|
|
96
|
+
console.log("");
|
|
97
|
+
console.log(" WHY THIS MATTERS:");
|
|
98
|
+
console.log(" Exagent is non-custodial. Your trading wallet key is");
|
|
99
|
+
console.log(" generated here on your machine and never leaves it.");
|
|
100
|
+
console.log(" We do not store it. No one else has a copy.");
|
|
101
|
+
console.log("");
|
|
102
|
+
console.log(" WHAT THIS MEANS:");
|
|
103
|
+
console.log(" The private key will live ONLY in the .env file");
|
|
104
|
+
console.log(" in this folder. If you delete this folder, your");
|
|
105
|
+
console.log(" wallet and ALL FUNDS in it are permanently lost.");
|
|
106
|
+
console.log(" There is NO recovery \u2014 Exagent cannot help.");
|
|
107
|
+
console.log("");
|
|
108
|
+
console.log(" BEFORE CONTINUING:");
|
|
109
|
+
console.log(" - Know where this folder is on your computer");
|
|
110
|
+
console.log(" - Plan to back up .env (or .env.enc) after setup");
|
|
111
|
+
console.log(" - Store your passphrase in a password manager");
|
|
112
|
+
console.log(" - View your key anytime: npx @exagent/agent export-key");
|
|
113
|
+
console.log("");
|
|
114
|
+
console.log("!".repeat(60));
|
|
115
|
+
console.log("");
|
|
116
|
+
const ack = await prompt(' Type "I understand" to continue: ');
|
|
117
|
+
if (ack.trim().toLowerCase() !== "i understand") {
|
|
118
|
+
console.log("");
|
|
119
|
+
console.log(" Setup cancelled. Run the agent again when ready.");
|
|
120
|
+
process.exit(0);
|
|
121
|
+
}
|
|
122
|
+
console.log("");
|
|
92
123
|
console.log("[WALLET] Generating a new wallet for your agent...");
|
|
93
124
|
console.log("");
|
|
94
125
|
const generatedKey = generatePrivateKey();
|
|
@@ -102,8 +133,9 @@ async function checkFirstRunSetup(configPath) {
|
|
|
102
133
|
console.log(" | " + walletAddress.padEnd(56) + " |");
|
|
103
134
|
console.log(" +" + "-".repeat(58) + "+");
|
|
104
135
|
console.log("");
|
|
105
|
-
console.log("
|
|
106
|
-
console.log("
|
|
136
|
+
console.log(" CRITICAL: Back up your .env file now.");
|
|
137
|
+
console.log(" Export your key anytime: npx @exagent/agent export-key");
|
|
138
|
+
console.log(" If you lose .env AND your backup, funds are unrecoverable.");
|
|
107
139
|
console.log("");
|
|
108
140
|
const confirmed = await prompt(" Press Enter to continue, or Ctrl+C to cancel...");
|
|
109
141
|
} else {
|
|
@@ -432,4 +464,56 @@ program.command("encrypt").description("Encrypt .env file to .env.enc for secure
|
|
|
432
464
|
process.exit(1);
|
|
433
465
|
}
|
|
434
466
|
});
|
|
467
|
+
program.command("export-key").description("Display your trading wallet private key for backup").option("-d, --dir <path>", "Directory containing .env or .env.enc file", ".").option("-p, --passphrase <passphrase>", "Passphrase to decrypt .env.enc").action(async (options) => {
|
|
468
|
+
try {
|
|
469
|
+
const dir = options.dir.startsWith("/") ? options.dir : path.join(process.cwd(), options.dir);
|
|
470
|
+
let passphrase = options.passphrase || process.env.EXAGENT_PASSPHRASE;
|
|
471
|
+
const encPath = path.join(dir, ".env.enc");
|
|
472
|
+
const envPath = path.join(dir, ".env");
|
|
473
|
+
if (fs.existsSync(encPath) && !passphrase) {
|
|
474
|
+
console.log("");
|
|
475
|
+
console.log(" Encrypted config found (.env.enc)");
|
|
476
|
+
console.log("");
|
|
477
|
+
passphrase = await prompt(" Enter passphrase: ", true);
|
|
478
|
+
console.log("");
|
|
479
|
+
}
|
|
480
|
+
const usedEncrypted = loadSecureEnv(dir, passphrase);
|
|
481
|
+
if (!usedEncrypted && fs.existsSync(envPath)) {
|
|
482
|
+
const { config: loadDotenv } = await import("dotenv");
|
|
483
|
+
loadDotenv({ path: envPath, override: true });
|
|
484
|
+
}
|
|
485
|
+
const privateKey = process.env.EXAGENT_PRIVATE_KEY;
|
|
486
|
+
if (!privateKey) {
|
|
487
|
+
console.error("");
|
|
488
|
+
console.error(" No private key found. Make sure .env or .env.enc exists in this directory.");
|
|
489
|
+
console.error("");
|
|
490
|
+
process.exit(1);
|
|
491
|
+
}
|
|
492
|
+
const { privateKeyToAccount: privateKeyToAccount2 } = await import("viem/accounts");
|
|
493
|
+
const account = privateKeyToAccount2(privateKey);
|
|
494
|
+
console.log("");
|
|
495
|
+
console.log("=".repeat(60));
|
|
496
|
+
console.log(" WALLET PRIVATE KEY EXPORT");
|
|
497
|
+
console.log("=".repeat(60));
|
|
498
|
+
console.log("");
|
|
499
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
500
|
+
console.log(" | WALLET ADDRESS: |");
|
|
501
|
+
console.log(" | " + account.address.padEnd(56) + " |");
|
|
502
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
503
|
+
console.log(" | PRIVATE KEY: |");
|
|
504
|
+
console.log(" | " + privateKey.padEnd(56) + " |");
|
|
505
|
+
console.log(" +" + "-".repeat(58) + "+");
|
|
506
|
+
console.log("");
|
|
507
|
+
console.log(" WARNING: Anyone with this key controls your wallet.");
|
|
508
|
+
console.log(" Store it in a password manager. Never share it.");
|
|
509
|
+
console.log(" Never paste it in a browser, email, or chat.");
|
|
510
|
+
console.log("");
|
|
511
|
+
console.log("=".repeat(60));
|
|
512
|
+
console.log("");
|
|
513
|
+
process.exit(0);
|
|
514
|
+
} catch (error) {
|
|
515
|
+
console.error("Error:", error instanceof Error ? error.message : error);
|
|
516
|
+
process.exit(1);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
435
519
|
program.parse();
|
package/dist/index.d.mts
CHANGED
|
@@ -710,6 +710,8 @@ interface AgentStatusPayload {
|
|
|
710
710
|
dailyPnL: number;
|
|
711
711
|
dailyLossLimit: number;
|
|
712
712
|
isLimitHit: boolean;
|
|
713
|
+
maxPositionSizeBps?: number;
|
|
714
|
+
maxDailyLossBps?: number;
|
|
713
715
|
};
|
|
714
716
|
vault?: {
|
|
715
717
|
policy: string;
|
|
@@ -1392,6 +1394,8 @@ declare class RiskManager {
|
|
|
1392
1394
|
dailyNetPnL: number;
|
|
1393
1395
|
dailyLossLimit: number;
|
|
1394
1396
|
isLimitHit: boolean;
|
|
1397
|
+
maxPositionSizeBps: number;
|
|
1398
|
+
maxDailyLossBps: number;
|
|
1395
1399
|
};
|
|
1396
1400
|
/**
|
|
1397
1401
|
* Filter perp trade signals through risk checks.
|
|
@@ -2103,6 +2107,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
2103
2107
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
2104
2108
|
|
|
2105
2109
|
/** @exagent/agent package version — update alongside package.json */
|
|
2106
|
-
declare const AGENT_VERSION = "0.1.
|
|
2110
|
+
declare const AGENT_VERSION = "0.1.24";
|
|
2107
2111
|
|
|
2108
2112
|
export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type CommandType, DeepSeekAdapter, FileStore, type FillCallback, type FundingCallback, type FundingPayment, GoogleAdapter, GroqAdapter, HYPERLIQUID_DOMAIN, HyperliquidClient, HyperliquidSigner, HyperliquidWebSocket, type LLMAdapter, type LLMConfig, LLMConfigSchema, type LLMMessage, type LLMMetadata, type LLMProvider, LLMProviderSchema, type LLMResponse, type LiquidationCallback, type MarketData, MarketDataService, type MessageLevel, type MessageType, MistralAdapter, OllamaAdapter, type OnboardingStatus, OpenAIAdapter, OrderManager, type OrderResult, type PerpAction, type PerpConfig$1 as PerpConfig, PerpConfigSchema, type PerpFill, type PerpMarketData, PerpOnboarding, type PerpPosition, type PerpStrategyFunction, PerpTradeRecorder, type PerpTradeSignal, type PerpConfig as PerpTradingConfig, PositionManager, type PositionSummary, PositionTracker, type RecordPerpTradeParams, RelayClient, type RelayCommand, type RelayConfig$1 as RelayConfig, RelayConfigSchema, RiskManager, type RiskState, type RiskUniverse, RiskUniverseSchema, type RuntimeConfig, STRATEGY_TEMPLATES, type StrategyContext, type StrategyFunction, type StrategyStore, type StrategyTemplate, TogetherAdapter, type TrackedPosition, TradeExecutor, type TradeRecord, type TradeSignal, type TradingConfig, TradingConfigSchema, type VaultConfig, VaultConfigSchema, VaultManager, type VaultManagerConfig, type VaultPolicy, VaultPolicySchema, type VaultStatus, createLLMAdapter, createSampleConfig, decryptEnvFile, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, validateConfig, validateStrategy };
|
package/dist/index.d.ts
CHANGED
|
@@ -710,6 +710,8 @@ interface AgentStatusPayload {
|
|
|
710
710
|
dailyPnL: number;
|
|
711
711
|
dailyLossLimit: number;
|
|
712
712
|
isLimitHit: boolean;
|
|
713
|
+
maxPositionSizeBps?: number;
|
|
714
|
+
maxDailyLossBps?: number;
|
|
713
715
|
};
|
|
714
716
|
vault?: {
|
|
715
717
|
policy: string;
|
|
@@ -1392,6 +1394,8 @@ declare class RiskManager {
|
|
|
1392
1394
|
dailyNetPnL: number;
|
|
1393
1395
|
dailyLossLimit: number;
|
|
1394
1396
|
isLimitHit: boolean;
|
|
1397
|
+
maxPositionSizeBps: number;
|
|
1398
|
+
maxDailyLossBps: number;
|
|
1395
1399
|
};
|
|
1396
1400
|
/**
|
|
1397
1401
|
* Filter perp trade signals through risk checks.
|
|
@@ -2103,6 +2107,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
2103
2107
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
2104
2108
|
|
|
2105
2109
|
/** @exagent/agent package version — update alongside package.json */
|
|
2106
|
-
declare const AGENT_VERSION = "0.1.
|
|
2110
|
+
declare const AGENT_VERSION = "0.1.24";
|
|
2107
2111
|
|
|
2108
2112
|
export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type CommandType, DeepSeekAdapter, FileStore, type FillCallback, type FundingCallback, type FundingPayment, GoogleAdapter, GroqAdapter, HYPERLIQUID_DOMAIN, HyperliquidClient, HyperliquidSigner, HyperliquidWebSocket, type LLMAdapter, type LLMConfig, LLMConfigSchema, type LLMMessage, type LLMMetadata, type LLMProvider, LLMProviderSchema, type LLMResponse, type LiquidationCallback, type MarketData, MarketDataService, type MessageLevel, type MessageType, MistralAdapter, OllamaAdapter, type OnboardingStatus, OpenAIAdapter, OrderManager, type OrderResult, type PerpAction, type PerpConfig$1 as PerpConfig, PerpConfigSchema, type PerpFill, type PerpMarketData, PerpOnboarding, type PerpPosition, type PerpStrategyFunction, PerpTradeRecorder, type PerpTradeSignal, type PerpConfig as PerpTradingConfig, PositionManager, type PositionSummary, PositionTracker, type RecordPerpTradeParams, RelayClient, type RelayCommand, type RelayConfig$1 as RelayConfig, RelayConfigSchema, RiskManager, type RiskState, type RiskUniverse, RiskUniverseSchema, type RuntimeConfig, STRATEGY_TEMPLATES, type StrategyContext, type StrategyFunction, type StrategyStore, type StrategyTemplate, TogetherAdapter, type TrackedPosition, TradeExecutor, type TradeRecord, type TradeSignal, type TradingConfig, TradingConfigSchema, type VaultConfig, VaultConfigSchema, VaultManager, type VaultManagerConfig, type VaultPolicy, VaultPolicySchema, type VaultStatus, createLLMAdapter, createSampleConfig, decryptEnvFile, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, validateConfig, validateStrategy };
|
package/dist/index.js
CHANGED
|
@@ -1747,7 +1747,7 @@ function classifyTradeError(message) {
|
|
|
1747
1747
|
if (lower.includes("notauthorizedforagent") || lower.includes("not authorized")) {
|
|
1748
1748
|
return {
|
|
1749
1749
|
category: "not_authorized",
|
|
1750
|
-
userMessage:
|
|
1750
|
+
userMessage: 'Wallet not authorized for this agent. This wallet is not linked to your agent on-chain, so the router rejected the trade. To fix: (1) Open your command center at exagent.io, (2) Use the Wallet Management panel to check linked wallets, (3) If you lost your old wallet, unlink it first then re-run the agent to link the new one. Run "npx @exagent/agent export-key" to verify which wallet this agent is using.'
|
|
1751
1751
|
};
|
|
1752
1752
|
}
|
|
1753
1753
|
if (lower.includes("aggregatornotwhitelisted")) {
|
|
@@ -1922,7 +1922,9 @@ var RiskManager = class {
|
|
|
1922
1922
|
dailyNetPnL: this.dailyPnL - this.dailyFees,
|
|
1923
1923
|
dailyLossLimit: maxLossUSD,
|
|
1924
1924
|
// Only market PnL triggers the limit — fees are excluded
|
|
1925
|
-
isLimitHit: pv > 0 ? this.dailyPnL < -maxLossUSD : false
|
|
1925
|
+
isLimitHit: pv > 0 ? this.dailyPnL < -maxLossUSD : false,
|
|
1926
|
+
maxPositionSizeBps: this.config.maxPositionSizeBps,
|
|
1927
|
+
maxDailyLossBps: this.config.maxDailyLossBps
|
|
1926
1928
|
};
|
|
1927
1929
|
}
|
|
1928
1930
|
// ============================================================
|
|
@@ -4709,7 +4711,9 @@ var AgentRuntime = class {
|
|
|
4709
4711
|
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
4710
4712
|
dailyPnL: 0,
|
|
4711
4713
|
dailyLossLimit: 0,
|
|
4712
|
-
isLimitHit: false
|
|
4714
|
+
isLimitHit: false,
|
|
4715
|
+
maxPositionSizeBps: this.config.trading.maxPositionSizeBps,
|
|
4716
|
+
maxDailyLossBps: this.config.trading.maxDailyLossBps
|
|
4713
4717
|
},
|
|
4714
4718
|
vault: {
|
|
4715
4719
|
policy: vaultConfig.policy,
|
|
@@ -5095,7 +5099,13 @@ var AgentRuntime = class {
|
|
|
5095
5099
|
model: this.config.llm.model || "default"
|
|
5096
5100
|
},
|
|
5097
5101
|
configHash: this.configHash || "not initialized",
|
|
5098
|
-
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
5102
|
+
risk: this.riskManager?.getStatus(this.lastPortfolioValue) || {
|
|
5103
|
+
dailyPnL: 0,
|
|
5104
|
+
dailyLossLimit: 0,
|
|
5105
|
+
isLimitHit: false,
|
|
5106
|
+
maxPositionSizeBps: this.config.trading.maxPositionSizeBps,
|
|
5107
|
+
maxDailyLossBps: this.config.trading.maxDailyLossBps
|
|
5108
|
+
},
|
|
5099
5109
|
vault: {
|
|
5100
5110
|
policy: vaultConfig.policy,
|
|
5101
5111
|
hasVault: false,
|
|
@@ -5317,7 +5327,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
5317
5327
|
}
|
|
5318
5328
|
|
|
5319
5329
|
// src/index.ts
|
|
5320
|
-
var AGENT_VERSION = "0.1.
|
|
5330
|
+
var AGENT_VERSION = "0.1.24";
|
|
5321
5331
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5322
5332
|
0 && (module.exports = {
|
|
5323
5333
|
AGENT_VERSION,
|
package/dist/index.mjs
CHANGED