@exagent/agent 0.1.31 → 0.1.32
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-BAOLHULW.mjs +5551 -0
- package/dist/cli.js +16 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3885,7 +3885,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
3885
3885
|
}
|
|
3886
3886
|
|
|
3887
3887
|
// src/index.ts
|
|
3888
|
-
var AGENT_VERSION = "0.1.
|
|
3888
|
+
var AGENT_VERSION = "0.1.32";
|
|
3889
3889
|
|
|
3890
3890
|
// src/relay.ts
|
|
3891
3891
|
var RelayClient = class {
|
|
@@ -4641,6 +4641,21 @@ var AgentRuntime = class {
|
|
|
4641
4641
|
console.log("Visit https://exagent.io to start trading from the dashboard.");
|
|
4642
4642
|
console.log("");
|
|
4643
4643
|
this.mode = "idle";
|
|
4644
|
+
try {
|
|
4645
|
+
const tokens = this.getTokensToTrack();
|
|
4646
|
+
const initData = await this.marketData.fetchMarketData(this.client.address, tokens);
|
|
4647
|
+
this.positionTracker.syncBalances(initData.balances, initData.prices);
|
|
4648
|
+
this.lastPortfolioValue = initData.portfolioValue;
|
|
4649
|
+
this.lastPrices = initData.prices;
|
|
4650
|
+
const nativeEthBal = initData.balances[NATIVE_ETH.toLowerCase()] || BigInt(0);
|
|
4651
|
+
this.lastEthBalance = (Number(nativeEthBal) / 1e18).toFixed(6);
|
|
4652
|
+
const posCount = this.positionTracker.getPositions().length;
|
|
4653
|
+
if (posCount > 0) {
|
|
4654
|
+
console.log(`Initial sync: ${posCount} position(s) rebuilt from on-chain balances`);
|
|
4655
|
+
}
|
|
4656
|
+
} catch (error) {
|
|
4657
|
+
console.warn("Initial balance sync failed (non-fatal):", error instanceof Error ? error.message : error);
|
|
4658
|
+
}
|
|
4644
4659
|
this.sendRelayStatus();
|
|
4645
4660
|
this.relay.sendMessage(
|
|
4646
4661
|
"system",
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -339,9 +339,9 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
339
339
|
}>>;
|
|
340
340
|
allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
341
341
|
}, "strip", z.ZodTypeAny, {
|
|
342
|
-
agentId: string | number;
|
|
343
342
|
name: string;
|
|
344
343
|
network: "mainnet";
|
|
344
|
+
agentId: string | number;
|
|
345
345
|
llm: {
|
|
346
346
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
347
347
|
temperature: number;
|
|
@@ -388,8 +388,8 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
388
388
|
} | undefined;
|
|
389
389
|
allowedTokens?: string[] | undefined;
|
|
390
390
|
}, {
|
|
391
|
-
agentId: string | number;
|
|
392
391
|
name: string;
|
|
392
|
+
agentId: string | number;
|
|
393
393
|
llm: {
|
|
394
394
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
395
395
|
model?: string | undefined;
|
|
@@ -2114,6 +2114,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
2114
2114
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
2115
2115
|
|
|
2116
2116
|
/** @exagent/agent package version — update alongside package.json */
|
|
2117
|
-
declare const AGENT_VERSION = "0.1.
|
|
2117
|
+
declare const AGENT_VERSION = "0.1.32";
|
|
2118
2118
|
|
|
2119
2119
|
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
|
@@ -339,9 +339,9 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
339
339
|
}>>;
|
|
340
340
|
allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
341
341
|
}, "strip", z.ZodTypeAny, {
|
|
342
|
-
agentId: string | number;
|
|
343
342
|
name: string;
|
|
344
343
|
network: "mainnet";
|
|
344
|
+
agentId: string | number;
|
|
345
345
|
llm: {
|
|
346
346
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
347
347
|
temperature: number;
|
|
@@ -388,8 +388,8 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
388
388
|
} | undefined;
|
|
389
389
|
allowedTokens?: string[] | undefined;
|
|
390
390
|
}, {
|
|
391
|
-
agentId: string | number;
|
|
392
391
|
name: string;
|
|
392
|
+
agentId: string | number;
|
|
393
393
|
llm: {
|
|
394
394
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
395
395
|
model?: string | undefined;
|
|
@@ -2114,6 +2114,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
2114
2114
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
2115
2115
|
|
|
2116
2116
|
/** @exagent/agent package version — update alongside package.json */
|
|
2117
|
-
declare const AGENT_VERSION = "0.1.
|
|
2117
|
+
declare const AGENT_VERSION = "0.1.32";
|
|
2118
2118
|
|
|
2119
2119
|
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
|
@@ -4543,6 +4543,21 @@ var AgentRuntime = class {
|
|
|
4543
4543
|
console.log("Visit https://exagent.io to start trading from the dashboard.");
|
|
4544
4544
|
console.log("");
|
|
4545
4545
|
this.mode = "idle";
|
|
4546
|
+
try {
|
|
4547
|
+
const tokens = this.getTokensToTrack();
|
|
4548
|
+
const initData = await this.marketData.fetchMarketData(this.client.address, tokens);
|
|
4549
|
+
this.positionTracker.syncBalances(initData.balances, initData.prices);
|
|
4550
|
+
this.lastPortfolioValue = initData.portfolioValue;
|
|
4551
|
+
this.lastPrices = initData.prices;
|
|
4552
|
+
const nativeEthBal = initData.balances[NATIVE_ETH.toLowerCase()] || BigInt(0);
|
|
4553
|
+
this.lastEthBalance = (Number(nativeEthBal) / 1e18).toFixed(6);
|
|
4554
|
+
const posCount = this.positionTracker.getPositions().length;
|
|
4555
|
+
if (posCount > 0) {
|
|
4556
|
+
console.log(`Initial sync: ${posCount} position(s) rebuilt from on-chain balances`);
|
|
4557
|
+
}
|
|
4558
|
+
} catch (error) {
|
|
4559
|
+
console.warn("Initial balance sync failed (non-fatal):", error instanceof Error ? error.message : error);
|
|
4560
|
+
}
|
|
4546
4561
|
this.sendRelayStatus();
|
|
4547
4562
|
this.relay.sendMessage(
|
|
4548
4563
|
"system",
|
|
@@ -5548,7 +5563,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
5548
5563
|
}
|
|
5549
5564
|
|
|
5550
5565
|
// src/index.ts
|
|
5551
|
-
var AGENT_VERSION = "0.1.
|
|
5566
|
+
var AGENT_VERSION = "0.1.32";
|
|
5552
5567
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5553
5568
|
0 && (module.exports = {
|
|
5554
5569
|
AGENT_VERSION,
|
package/dist/index.mjs
CHANGED