@vtxmacro/cli 2026.9.56 → 2026.9.57
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/bin/vtx-service-bootstrap.js +3 -1
- package/bin/vtx-service-launcher.js +2 -0
- package/bin/vtx.js +58 -64
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ import { fileURLToPath } from "node:url";
|
|
|
16
16
|
// agent-cli-release.json
|
|
17
17
|
var agent_cli_release_default = {
|
|
18
18
|
package_name: "@vtxmacro/cli",
|
|
19
|
-
package_version: "2026.9.
|
|
19
|
+
package_version: "2026.9.57",
|
|
20
20
|
codex_package_name: "@openai/codex",
|
|
21
21
|
codex_version: "0.155.0",
|
|
22
22
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -203,6 +203,8 @@ var runtime_policy_generated_default = {
|
|
|
203
203
|
},
|
|
204
204
|
server_runtime: {
|
|
205
205
|
prompt_rescue: {
|
|
206
|
+
snapshot_max_age_seconds: 5,
|
|
207
|
+
snapshot_component_max_skew_seconds: 2,
|
|
206
208
|
client_long_poll_seconds: 20,
|
|
207
209
|
client_claim_http_timeout_milliseconds: 25e3,
|
|
208
210
|
client_presence_heartbeat_interval_milliseconds: 3e4,
|
|
@@ -86,6 +86,8 @@ var runtime_policy_generated_default = {
|
|
|
86
86
|
},
|
|
87
87
|
server_runtime: {
|
|
88
88
|
prompt_rescue: {
|
|
89
|
+
snapshot_max_age_seconds: 5,
|
|
90
|
+
snapshot_component_max_skew_seconds: 2,
|
|
89
91
|
client_long_poll_seconds: 20,
|
|
90
92
|
client_claim_http_timeout_milliseconds: 25e3,
|
|
91
93
|
client_presence_heartbeat_interval_milliseconds: 3e4,
|
package/bin/vtx.js
CHANGED
|
@@ -77,7 +77,7 @@ var init_agent_cli_release = __esm({
|
|
|
77
77
|
"agent-cli-release.json"() {
|
|
78
78
|
agent_cli_release_default = {
|
|
79
79
|
package_name: "@vtxmacro/cli",
|
|
80
|
-
package_version: "2026.9.
|
|
80
|
+
package_version: "2026.9.57",
|
|
81
81
|
codex_package_name: "@openai/codex",
|
|
82
82
|
codex_version: "0.155.0",
|
|
83
83
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -20544,6 +20544,8 @@ var init_runtime_policy_generated = __esm({
|
|
|
20544
20544
|
},
|
|
20545
20545
|
server_runtime: {
|
|
20546
20546
|
prompt_rescue: {
|
|
20547
|
+
snapshot_max_age_seconds: 5,
|
|
20548
|
+
snapshot_component_max_skew_seconds: 2,
|
|
20547
20549
|
client_long_poll_seconds: 20,
|
|
20548
20550
|
client_claim_http_timeout_milliseconds: 25e3,
|
|
20549
20551
|
client_presence_heartbeat_interval_milliseconds: 3e4,
|
|
@@ -42604,6 +42606,8 @@ var init_runtime_policy_generated2 = __esm({
|
|
|
42604
42606
|
},
|
|
42605
42607
|
server_runtime: {
|
|
42606
42608
|
prompt_rescue: {
|
|
42609
|
+
snapshot_max_age_seconds: 5,
|
|
42610
|
+
snapshot_component_max_skew_seconds: 2,
|
|
42607
42611
|
client_long_poll_seconds: 20,
|
|
42608
42612
|
client_claim_http_timeout_milliseconds: 25e3,
|
|
42609
42613
|
client_presence_heartbeat_interval_milliseconds: 3e4,
|
|
@@ -50151,7 +50155,7 @@ var init_network_debug = __esm({
|
|
|
50151
50155
|
});
|
|
50152
50156
|
|
|
50153
50157
|
// lib/runtime/hyperliquid-account-state-adapter.ts
|
|
50154
|
-
var unsupportedUserActiveAssetCache, MAX_UNSUPPORTED_USER_ACTIVE_ASSET_CACHE_KEYS, UNSUPPORTED_USER_ACTIVE_ASSET_STORAGE_KEY, USER_FILLS_CACHE_STORAGE_PREFIX, ACCOUNT_STATE_CACHE_STORAGE_PREFIX, browserUserFillsCache, browserUserFillsInFlight, HYPERLIQUID_USER_FILLS_PROVIDER_PAGE_CAP, browserAccountStateCache, browserAccountStateInFlight, UNSUPPORTED_USER_ACTIVE_ASSET_DETAIL_PATTERNS, unsupportedUserActiveAssetCacheHydrated, hydrateUnsupportedUserActiveAssetCache, persistUnsupportedUserActiveAssetCache, toPositiveFinite, toFinite, firstFiniteNumber, parseFundingUsdcFromInfoPosition, buildActiveAssetCacheKey, buildUserFillsCacheKey, buildUserFillsStorageKey, buildAccountStateCacheKey, buildAccountStateStorageKey, hasActiveInfoRateLimitCooldown, requireNonNegativeConfigSeconds, requireAccountStateCacheConfig, requireUserFillsCacheConfig, normalizeFillSymbol, buildSymbolFilter, filterFillsBySymbols, readBrowserUserFillsCache, writeBrowserUserFillsCache, cloneBrowserAccountStateResult, withAccountStateEvidence, readBrowserAccountStateCache, writeBrowserAccountStateCache, isRateLimitError, createAbortError, waitForSharedBrowserRequest, waitForSharedBrowserUserFills, getBrowserActiveAssetTypeCandidates, normalizeHyperliquidErrorDetail, isUnsupportedUserActiveAssetError, rememberUnsupportedUserActiveAssetKey, parseInfoPositions, requireFinitePromptMetric, requirePromptClearinghouseState, requirePromptSpotState, normalizePerpDexName, listConfiguredPerpDexs, listPerpDexsForAccountState, prefixHip3PositionCoins, aggregateClearinghouseResponses, hasCompletePerpDexAccountMetrics, normalizeBrowserFillToTradeHistory, isPerpFill, awaitAccountReads, fetchHyperliquidInfoPayload, requireHyperliquidApiUrl, requireWalletAddress, parseInfoPositionSnapshot, fetchBrowserAccountState, fetchBrowserAccountStateUncached, fetchBrowserUserFills, fetchBrowserPositionSnapshot;
|
|
50158
|
+
var unsupportedUserActiveAssetCache, MAX_UNSUPPORTED_USER_ACTIVE_ASSET_CACHE_KEYS, UNSUPPORTED_USER_ACTIVE_ASSET_STORAGE_KEY, USER_FILLS_CACHE_STORAGE_PREFIX, ACCOUNT_STATE_CACHE_STORAGE_PREFIX, browserUserFillsCache, browserUserFillsInFlight, HYPERLIQUID_USER_FILLS_PROVIDER_PAGE_CAP, browserAccountStateCache, browserAccountStateInFlight, UNSUPPORTED_USER_ACTIVE_ASSET_DETAIL_PATTERNS, unsupportedUserActiveAssetCacheHydrated, hydrateUnsupportedUserActiveAssetCache, persistUnsupportedUserActiveAssetCache, toPositiveFinite, toFinite, firstFiniteNumber, parseFundingUsdcFromInfoPosition, buildActiveAssetCacheKey, buildUserFillsCacheKey, buildUserFillsStorageKey, buildAccountStateCacheKey, buildAccountStateStorageKey, hasActiveInfoRateLimitCooldown, requireNonNegativeConfigSeconds, requireAccountStateCacheConfig, requireUserFillsCacheConfig, normalizeFillSymbol, buildSymbolFilter, filterFillsBySymbols, readBrowserUserFillsCache, writeBrowserUserFillsCache, cloneBrowserAccountStateResult, withAccountStateEvidence, readBrowserAccountStateCache, writeBrowserAccountStateCache, isRateLimitError, createAbortError, waitForSharedBrowserRequest, waitForSharedBrowserUserFills, getBrowserActiveAssetTypeCandidates, normalizeHyperliquidErrorDetail, isUnsupportedUserActiveAssetError, rememberUnsupportedUserActiveAssetKey, parseInfoPositions, requireFinitePromptMetric, requirePromptClearinghouseState, requirePromptSpotState, normalizePerpDexName, listConfiguredPerpDexs, listPerpDexsForAccountState, prefixHip3PositionCoins, aggregateClearinghouseResponses, hasCompletePerpDexAccountMetrics, normalizeBrowserFillToTradeHistory, isPerpFill, awaitAccountReads, fetchHyperliquidInfoRead, fetchHyperliquidInfoPayload, requireHyperliquidApiUrl, requireWalletAddress, parseInfoPositionSnapshot, fetchBrowserAccountState, fetchBrowserAccountStateUncached, fetchBrowserUserFills, fetchBrowserPositionSnapshot;
|
|
50155
50159
|
var init_hyperliquid_account_state_adapter = __esm({
|
|
50156
50160
|
"lib/runtime/hyperliquid-account-state-adapter.ts"() {
|
|
50157
50161
|
"use strict";
|
|
@@ -50167,6 +50171,7 @@ var init_hyperliquid_account_state_adapter = __esm({
|
|
|
50167
50171
|
init_hyperliquid_fee_contract();
|
|
50168
50172
|
init_hyperliquid_market_symbol();
|
|
50169
50173
|
init_network_debug();
|
|
50174
|
+
init_runtime_policy_generated();
|
|
50170
50175
|
unsupportedUserActiveAssetCache = /* @__PURE__ */ new Set();
|
|
50171
50176
|
MAX_UNSUPPORTED_USER_ACTIVE_ASSET_CACHE_KEYS = 512;
|
|
50172
50177
|
UNSUPPORTED_USER_ACTIVE_ASSET_STORAGE_KEY = "vtx:hyperliquid:unsupported-user-active-asset:v1";
|
|
@@ -50831,17 +50836,18 @@ var init_hyperliquid_account_state_adapter = __esm({
|
|
|
50831
50836
|
throw error48;
|
|
50832
50837
|
}
|
|
50833
50838
|
};
|
|
50834
|
-
|
|
50839
|
+
fetchHyperliquidInfoRead = async (apiUrl, body, signal, reservation) => {
|
|
50835
50840
|
const trace = startRuntimeNetworkDebugTrace({ kind: "exchange", label: `hyperliquid_info:${String(body.type)}`, method: "POST", url: `${apiUrl.replace(/\/$/, "")}/info` });
|
|
50836
50841
|
try {
|
|
50837
50842
|
const result2 = await readHyperliquidPublicInfo(apiUrl, body, { signal, reservation });
|
|
50838
50843
|
trace.completeSuccess(200);
|
|
50839
|
-
return result2
|
|
50844
|
+
return result2;
|
|
50840
50845
|
} catch (error48) {
|
|
50841
50846
|
trace.completeError(error48, error48?.status ?? null);
|
|
50842
50847
|
throw error48;
|
|
50843
50848
|
}
|
|
50844
50849
|
};
|
|
50850
|
+
fetchHyperliquidInfoPayload = async (apiUrl, body, signal, reservation) => (await fetchHyperliquidInfoRead(apiUrl, body, signal, reservation)).payload;
|
|
50845
50851
|
requireHyperliquidApiUrl = (config2) => {
|
|
50846
50852
|
const apiUrl = String(config2.client_runtime_exchange_endpoints?.hyperliquid_api_url || "").trim();
|
|
50847
50853
|
if (!apiUrl) {
|
|
@@ -51025,67 +51031,56 @@ var init_hyperliquid_account_state_adapter = __esm({
|
|
|
51025
51031
|
}
|
|
51026
51032
|
}));
|
|
51027
51033
|
}
|
|
51028
|
-
const
|
|
51029
|
-
const
|
|
51030
|
-
|
|
51031
|
-
{ type: "clearinghouseState", user: walletAddress },
|
|
51032
|
-
|
|
51033
|
-
|
|
51034
|
-
)
|
|
51035
|
-
|
|
51036
|
-
|
|
51037
|
-
}
|
|
51038
|
-
const dexResponses = await awaitAccountReads(
|
|
51039
|
-
dexNames.map(async (dexName) => {
|
|
51040
|
-
const response = await fetchHyperliquidInfoPayload(
|
|
51041
|
-
apiUrl,
|
|
51042
|
-
{ type: "clearinghouseState", user: walletAddress, dex: dexName },
|
|
51043
|
-
input.signal,
|
|
51044
|
-
reservation
|
|
51045
|
-
);
|
|
51034
|
+
const dynamicPromise = (async () => {
|
|
51035
|
+
const perpsDexes = ["", ...dexNames];
|
|
51036
|
+
const components = [
|
|
51037
|
+
...perpsDexes.map((dex) => ({ dex, body: { type: "clearinghouseState", user: walletAddress, ...dex ? { dex } : {} } })),
|
|
51038
|
+
{ body: { type: "spotClearinghouseState", user: walletAddress } }
|
|
51039
|
+
];
|
|
51040
|
+
const capture = async (component) => {
|
|
51041
|
+
try {
|
|
51042
|
+
const read = await fetchHyperliquidInfoRead(apiUrl, component.body, input.signal, reservation);
|
|
51046
51043
|
if (input.includeEffectiveTakerRate === true) {
|
|
51047
|
-
|
|
51044
|
+
if (component.dex == null) requirePromptSpotState(read.payload);
|
|
51045
|
+
else requirePromptClearinghouseState(read.payload, component.dex || "default");
|
|
51048
51046
|
}
|
|
51049
|
-
|
|
51050
|
-
|
|
51051
|
-
|
|
51052
|
-
|
|
51053
|
-
|
|
51054
|
-
})
|
|
51055
|
-
);
|
|
51056
|
-
const selectedPayload = selectedDex ? dexResponses.find((entry) => entry.dex === selectedDex)?.payload : defaultResponse;
|
|
51057
|
-
if (!selectedPayload) {
|
|
51058
|
-
throw new Error(`Missing selected Hyperliquid clearinghouse state for DEX ${selectedDex}.`);
|
|
51059
|
-
}
|
|
51060
|
-
return {
|
|
51061
|
-
payload: aggregateClearinghouseResponses([
|
|
51062
|
-
defaultResponse,
|
|
51063
|
-
...dexResponses.map((entry) => entry.payload)
|
|
51064
|
-
]),
|
|
51065
|
-
selectedPayload,
|
|
51066
|
-
dexPayloads: [
|
|
51067
|
-
{ dex: "", payload: defaultResponse },
|
|
51068
|
-
...dexResponses.map(({ dex, rawPayload }) => ({ dex, payload: rawPayload }))
|
|
51069
|
-
],
|
|
51070
|
-
capturedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
51047
|
+
component.read = read;
|
|
51048
|
+
} catch (error48) {
|
|
51049
|
+
if (component.dex != null || input.forceRefresh || input.includeEffectiveTakerRate === true) throw error48;
|
|
51050
|
+
component.read = { payload: {}, fetchedAtMs: Date.now() };
|
|
51051
|
+
}
|
|
51071
51052
|
};
|
|
51072
|
-
|
|
51073
|
-
|
|
51074
|
-
|
|
51075
|
-
|
|
51076
|
-
|
|
51077
|
-
|
|
51078
|
-
{
|
|
51079
|
-
|
|
51080
|
-
|
|
51081
|
-
|
|
51082
|
-
|
|
51083
|
-
|
|
51084
|
-
throw error48;
|
|
51053
|
+
await awaitAccountReads(components.map(capture));
|
|
51054
|
+
if (input.publicReadDeadlineMs != null && input.includeEffectiveTakerRate === true && input.includeExactAccountMode === true) {
|
|
51055
|
+
const freshness = runtime_policy_generated_default.trading.engine.server_runtime.prompt_rescue;
|
|
51056
|
+
const horizonMs = Math.min(freshness.snapshot_max_age_seconds, freshness.snapshot_component_max_skew_seconds) * 1e3;
|
|
51057
|
+
for (; ; ) {
|
|
51058
|
+
const now = Date.now();
|
|
51059
|
+
const stale = components.filter(({ read }) => now - read.fetchedAtMs > horizonMs);
|
|
51060
|
+
if (!stale.length) break;
|
|
51061
|
+
if (now >= input.publicReadDeadlineMs) {
|
|
51062
|
+
throw new HyperliquidPublicReadError("public_timeout", "Hyperliquid public request timed out.", "clearinghouseState");
|
|
51063
|
+
}
|
|
51064
|
+
await awaitAccountReads(stale.map(capture));
|
|
51085
51065
|
}
|
|
51086
|
-
payload = {};
|
|
51087
51066
|
}
|
|
51088
|
-
|
|
51067
|
+
const perpsReads = components.slice(0, perpsDexes.length).map((component) => ({
|
|
51068
|
+
dex: component.dex,
|
|
51069
|
+
payload: component.read.payload,
|
|
51070
|
+
fetchedAtMs: component.read.fetchedAtMs
|
|
51071
|
+
}));
|
|
51072
|
+
const selectedRead = perpsReads.find(({ dex }) => dex === selectedDex);
|
|
51073
|
+
if (!selectedRead) throw new Error(`Missing selected Hyperliquid clearinghouse state for DEX ${selectedDex}.`);
|
|
51074
|
+
const spotRead = components[perpsDexes.length].read;
|
|
51075
|
+
return {
|
|
51076
|
+
perpsResult: {
|
|
51077
|
+
payload: aggregateClearinghouseResponses(perpsReads.map(({ dex, payload }) => dex ? prefixHip3PositionCoins(payload, dex) : payload)),
|
|
51078
|
+
selectedPayload: selectedDex ? prefixHip3PositionCoins(selectedRead.payload, selectedDex) : selectedRead.payload,
|
|
51079
|
+
dexPayloads: perpsReads.map(({ dex, payload }) => ({ dex, payload })),
|
|
51080
|
+
capturedAt: new Date(Math.min(...perpsReads.map(({ fetchedAtMs }) => fetchedAtMs))).toISOString()
|
|
51081
|
+
},
|
|
51082
|
+
spotResult: { payload: spotRead.payload, capturedAt: new Date(spotRead.fetchedAtMs).toISOString() }
|
|
51083
|
+
};
|
|
51089
51084
|
})();
|
|
51090
51085
|
const activeAssetPromise = input.includeActiveAssetData === false ? Promise.resolve(null) : (async () => {
|
|
51091
51086
|
let lastError = null;
|
|
@@ -51108,9 +51103,8 @@ var init_hyperliquid_account_state_adapter = __esm({
|
|
|
51108
51103
|
}
|
|
51109
51104
|
throw lastError instanceof Error ? lastError : new Error("Failed to fetch browser active asset data.");
|
|
51110
51105
|
})();
|
|
51111
|
-
const [perpsResult, spotResult, activeAssetResult, userFeesResult, exactAccountMode] = await awaitAccountReads([
|
|
51112
|
-
|
|
51113
|
-
spotPromise,
|
|
51106
|
+
const [{ perpsResult, spotResult }, activeAssetResult, userFeesResult, exactAccountMode] = await awaitAccountReads([
|
|
51107
|
+
dynamicPromise,
|
|
51114
51108
|
activeAssetPromise,
|
|
51115
51109
|
userFeesPromise,
|
|
51116
51110
|
exactAccountModePromise
|
|
@@ -51235,7 +51229,7 @@ var init_hyperliquid_account_state_adapter = __esm({
|
|
|
51235
51229
|
...effectiveTakerRates == null ? {} : { effectiveTakerRates },
|
|
51236
51230
|
...exactAccountMode == null || userFeesResult == null ? {} : {
|
|
51237
51231
|
promptRescueEvidence: {
|
|
51238
|
-
capturedAt:
|
|
51232
|
+
capturedAt: new Date(Math.min(Date.parse(perpsResult.capturedAt), Date.parse(spotResult.capturedAt))).toISOString(),
|
|
51239
51233
|
perpsCapturedAt: perpsResult.capturedAt,
|
|
51240
51234
|
spotCapturedAt: spotResult.capturedAt,
|
|
51241
51235
|
feesCapturedAt: userFeesResult.capturedAt,
|