@vtxmacro/cli 2026.10.65 → 2026.10.66
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-mcp.js +1 -1
- package/bin/vtx-service-bootstrap.js +1 -1
- package/bin/vtx.js +118 -41
- package/package.json +1 -1
package/bin/vtx-mcp.js
CHANGED
|
@@ -43,7 +43,7 @@ var init_define_VTX_PI_MODEL_POLICY = __esm({
|
|
|
43
43
|
var agent_cli_release_default;
|
|
44
44
|
var init_agent_cli_release = __esm({
|
|
45
45
|
"agent-cli-release.json"() {
|
|
46
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
46
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.66", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
@@ -14,7 +14,7 @@ import { dirname as dirname4, relative as relative4, resolve as resolve4 } from
|
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
|
16
16
|
// agent-cli-release.json
|
|
17
|
-
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
17
|
+
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.66", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
18
18
|
|
|
19
19
|
// lib/runtime-policy.generated.json
|
|
20
20
|
var runtime_policy_generated_default = {
|
package/bin/vtx.js
CHANGED
|
@@ -122,7 +122,7 @@ var init_routing = __esm({
|
|
|
122
122
|
var agent_cli_release_default;
|
|
123
123
|
var init_agent_cli_release = __esm({
|
|
124
124
|
"agent-cli-release.json"() {
|
|
125
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
125
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.66", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -62205,6 +62205,17 @@ var init_client_protective_evidence = __esm({
|
|
|
62205
62205
|
}
|
|
62206
62206
|
});
|
|
62207
62207
|
|
|
62208
|
+
// lib/api/copy-trading-order-action.ts
|
|
62209
|
+
var init_copy_trading_order_action = __esm({
|
|
62210
|
+
"lib/api/copy-trading-order-action.ts"() {
|
|
62211
|
+
"use strict";
|
|
62212
|
+
init_define_VTX_CLAUDE_CODE_POLICY();
|
|
62213
|
+
init_define_VTX_EXO_POLICY();
|
|
62214
|
+
init_define_VTX_GROK_POLICY();
|
|
62215
|
+
init_define_VTX_PI_MODEL_POLICY();
|
|
62216
|
+
}
|
|
62217
|
+
});
|
|
62218
|
+
|
|
62208
62219
|
// lib/api/provider-relays.ts
|
|
62209
62220
|
function relayNativeProviderRequest(provider, apiKey, payload, options = {}) {
|
|
62210
62221
|
return apiFetch(`${getApiUrl()}/llm/native-provider-relay`, {
|
|
@@ -62954,6 +62965,31 @@ var init_hyperliquid_max_leverage = __esm({
|
|
|
62954
62965
|
}
|
|
62955
62966
|
});
|
|
62956
62967
|
|
|
62968
|
+
// lib/runtime/hyperliquid-signed-size.ts
|
|
62969
|
+
var hyperliquidSignedSizeMatchesRequestedSize;
|
|
62970
|
+
var init_hyperliquid_signed_size = __esm({
|
|
62971
|
+
"lib/runtime/hyperliquid-signed-size.ts"() {
|
|
62972
|
+
"use strict";
|
|
62973
|
+
init_define_VTX_CLAUDE_CODE_POLICY();
|
|
62974
|
+
init_define_VTX_EXO_POLICY();
|
|
62975
|
+
init_define_VTX_GROK_POLICY();
|
|
62976
|
+
init_define_VTX_PI_MODEL_POLICY();
|
|
62977
|
+
init_constants();
|
|
62978
|
+
init_hyperliquid_client();
|
|
62979
|
+
hyperliquidSignedSizeMatchesRequestedSize = (requestedSize, sizeDecimals, signedSize) => {
|
|
62980
|
+
if (!Number.isFinite(requestedSize) || requestedSize <= 0 || !Number.isFinite(signedSize) || signedSize <= 0 || !Number.isInteger(sizeDecimals) || sizeDecimals < 0) {
|
|
62981
|
+
return false;
|
|
62982
|
+
}
|
|
62983
|
+
const tolerance = DECIMAL_RADIX ** -(sizeDecimals + HYPERLIQUID_SIGNED_SIZE_MATCH_EXTRA_DECIMALS);
|
|
62984
|
+
const candidates = [
|
|
62985
|
+
quantizeHyperliquidOrderSizeValue(requestedSize, sizeDecimals, "nearest"),
|
|
62986
|
+
Number(requestedSize.toFixed(sizeDecimals))
|
|
62987
|
+
];
|
|
62988
|
+
return candidates.some((candidate) => candidate > 0 && Math.abs(candidate - signedSize) <= tolerance);
|
|
62989
|
+
};
|
|
62990
|
+
}
|
|
62991
|
+
});
|
|
62992
|
+
|
|
62957
62993
|
// lib/candle-timeframes.ts
|
|
62958
62994
|
var candleTimeframeSeconds, compareCandleTimeframes, sortCandleTimeframes, candleClosedInSeries;
|
|
62959
62995
|
var init_candle_timeframes = __esm({
|
|
@@ -96441,7 +96477,7 @@ var init_hyperliquid_signer = __esm({
|
|
|
96441
96477
|
});
|
|
96442
96478
|
|
|
96443
96479
|
// lib/runtime/hyperliquid-client.ts
|
|
96444
|
-
var HyperliquidExchangeRejectionError, assertFreshPreparedExecutionContext, normalizeSymbol, normalizeBotMarket, HYPERLIQUID_NONCE_STORAGE_KEY, HYPERLIQUID_NONCE_LOCK_NAME, lastGeneratedNonce, readBrowserStoredHyperliquidNonce, writeBrowserStoredHyperliquidNonce, browserNonceCoordinator, allocateHyperliquidNonce, hostNonceAllocator, allocateActionNonce, generateHyperliquidNonce, normalizeDecimalString, HYPERLIQUID_PRICE_SIGNIFICANT_FIGURES, HYPERLIQUID_INTEGER_PRICE_MINIMUM, shortestDecimalParts, formatHyperliquidPerpPriceGrid, formatHyperliquidTriggerPriceWire, hyperliquidOrderPriceRounding, formatHyperliquidOrderPriceWire, countSignificantDigits, countDecimalPlaces, validateHyperliquidPerpPriceWire, validateHyperliquidSizeWire, formatSizeWire, inferApiUrl, inferIsTestnet, postHyperliquidInfoRead, postHyperliquidInfo, fetchBrowserHyperliquidInfoPayload, fetchBrowserHyperliquidInfoRead, fetchBrowserHyperliquidInfoText, toFiniteNumber, NATIVE_FIRED_TRIGGER_CONDITION, firstFiniteNumber, parseFundingUsdcFromInfoPosition, isExchangeIsolatedOnly, resolveLeverageTarget, computeHip3AssetId, buildAssetInfosFromMetaResponse, requireWalletAddress, assertPositiveInteger, assertPositiveNumber, normalizeOrderSide, normalizeHyperliquidClientOrderId, resolveAssets, findResolvedAsset, normalizeExecutionAssetMetadata, readDeviceExecutionAssetMetadata, requireBotProfileId, executionAssetMetadataFor, resolveHyperliquidAsset, resolveHyperliquidAssetIndex, decimalUnits, quantizeHyperliquidOrderSizeValue,
|
|
96480
|
+
var HyperliquidExchangeRejectionError, assertFreshPreparedExecutionContext, normalizeSymbol, normalizeBotMarket, HYPERLIQUID_NONCE_STORAGE_KEY, HYPERLIQUID_NONCE_LOCK_NAME, lastGeneratedNonce, readBrowserStoredHyperliquidNonce, writeBrowserStoredHyperliquidNonce, browserNonceCoordinator, allocateHyperliquidNonce, hostNonceAllocator, allocateActionNonce, generateHyperliquidNonce, normalizeDecimalString, HYPERLIQUID_PRICE_SIGNIFICANT_FIGURES, HYPERLIQUID_INTEGER_PRICE_MINIMUM, shortestDecimalParts, formatHyperliquidPerpPriceGrid, formatHyperliquidTriggerPriceWire, hyperliquidOrderPriceRounding, formatHyperliquidOrderPriceWire, countSignificantDigits, countDecimalPlaces, validateHyperliquidPerpPriceWire, validateHyperliquidSizeWire, formatSizeWire, inferApiUrl, inferIsTestnet, postHyperliquidInfoRead, postHyperliquidInfo, fetchBrowserHyperliquidInfoPayload, fetchBrowserHyperliquidInfoRead, fetchBrowserHyperliquidInfoText, toFiniteNumber, NATIVE_FIRED_TRIGGER_CONDITION, firstFiniteNumber, parseFundingUsdcFromInfoPosition, isExchangeIsolatedOnly, resolveLeverageTarget, computeHip3AssetId, buildAssetInfosFromMetaResponse, requireWalletAddress, assertPositiveInteger, assertPositiveNumber, normalizeOrderSide, normalizeHyperliquidClientOrderId, resolveAssets, findResolvedAsset, normalizeExecutionAssetMetadata, readDeviceExecutionAssetMetadata, requireBotProfileId, executionAssetMetadataFor, resolveHyperliquidAsset, resolveHyperliquidAssetIndex, decimalUnits, quantizeHyperliquidOrderSizeValue, finitePositive, readDevicePositionSize, readDevicePrivateExecutionContext, quantizeHyperliquidOrderSize, listBrowserMarketListDexes, browserMarketListMaxMarkets, cutBrowserMarketList, readBrowserPerpDexIndexes, readBrowserMarketListDex, fetchBrowserAvailableAssets, fetchBrowserAllMids, fetchBrowserSymbolMidPrice, fetchBrowserOpenOrders, parseCanonicalHyperliquidOrderStatusEvidence, fetchBrowserOrderStatusEvidence, fetchBrowserUserRole, fetchBrowserAccountState, fetchBrowserPosition, buildHyperliquidOrderWire, buildHyperliquidTriggerOrderWire, signHyperliquidPayload, signHyperliquidPreparedAction, buildHyperliquidCancelAction, buildHyperliquidCancelPayload, buildHyperliquidUpdateLeverageAction, buildHyperliquidUpdateLeveragePayload, buildHyperliquidMarketOrderAction, buildHyperliquidMarketOrderPayload, buildHyperliquidLimitOrderAction, buildHyperliquidLimitOrderPayload, buildHyperliquidTriggerOrderAction, buildHyperliquidTriggerOrderPayload, buildHyperliquidOrderBatchAction, buildHyperliquidOrderBatchPayload, buildHyperliquidModifyOrderAction, buildHyperliquidModifyOrderPayload, TRAILING_PCT_PATTERN, buildHyperliquidTrailingStopAction, buildHyperliquidTrailingStopPayload, extractHyperliquidExchangeError, acknowledgementLookupPacing, lookupUntilListed, resolveHyperliquidTriggerAcknowledgements, readHyperliquidTrailingStopAcknowledgement, resolveHyperliquidModifyAcknowledgement, isDefinitiveHyperliquidExchangeResponse, extractDefinitiveHyperliquidOrderId, CANONICAL_POSITIVE_DECIMAL_PATTERN, extractCanonicalHyperliquidOrderStateAcknowledgement, extractCanonicalHyperliquidOrderStateAcknowledgements, extractCanonicalHyperliquidFilledOrderAcknowledgement, extractDefinitiveHyperliquidOrderMemberResults, buildHyperliquidOrderDiagnostics, loadClientExecutionReferenceEvidence, sha256Hex, extractSignedPayloadClientOrderId, extractSignedPayloadMutationCorrelation, assertDurableMutationMatchesSignedAction, exchangeRejectionReason, exchangeActionPriority, submitHyperliquidExchangePayload;
|
|
96445
96481
|
var init_hyperliquid_client = __esm({
|
|
96446
96482
|
"lib/runtime/hyperliquid-client.ts"() {
|
|
96447
96483
|
"use strict";
|
|
@@ -96456,6 +96492,7 @@ var init_hyperliquid_client = __esm({
|
|
|
96456
96492
|
init_runtime_policy_generated2();
|
|
96457
96493
|
init_constants();
|
|
96458
96494
|
init_hyperliquid_max_leverage();
|
|
96495
|
+
init_hyperliquid_signed_size();
|
|
96459
96496
|
init_hyperliquid_public_read();
|
|
96460
96497
|
init_api2();
|
|
96461
96498
|
init_abort();
|
|
@@ -97020,47 +97057,37 @@ var init_hyperliquid_client = __esm({
|
|
|
97020
97057
|
const units = decimalUnits(value, decimals, roundingMode);
|
|
97021
97058
|
return units / DECIMAL_RADIX ** decimals;
|
|
97022
97059
|
};
|
|
97023
|
-
hyperliquidSignedSizeMatchesRequestedSize = (requestedSize, sizeDecimals, signedSize) => {
|
|
97024
|
-
if (!Number.isFinite(requestedSize) || requestedSize <= 0 || !Number.isFinite(signedSize) || signedSize <= 0 || !Number.isInteger(sizeDecimals) || sizeDecimals < 0) {
|
|
97025
|
-
return false;
|
|
97026
|
-
}
|
|
97027
|
-
const tolerance = DECIMAL_RADIX ** -(sizeDecimals + HYPERLIQUID_SIGNED_SIZE_MATCH_EXTRA_DECIMALS);
|
|
97028
|
-
const candidates = [
|
|
97029
|
-
quantizeHyperliquidOrderSizeValue(requestedSize, sizeDecimals, "nearest"),
|
|
97030
|
-
Number(requestedSize.toFixed(sizeDecimals))
|
|
97031
|
-
];
|
|
97032
|
-
return candidates.some((candidate) => candidate > 0 && Math.abs(candidate - signedSize) <= tolerance);
|
|
97033
|
-
};
|
|
97034
97060
|
finitePositive = (value) => {
|
|
97035
97061
|
const parsed = Number(value);
|
|
97036
97062
|
return typeof value !== "boolean" && value !== null && value !== "" && Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
97037
97063
|
};
|
|
97038
|
-
|
|
97064
|
+
readDevicePositionSize = async (input) => {
|
|
97039
97065
|
const symbol2 = normalizeSymbol(input.symbol);
|
|
97040
|
-
const user = requireWalletAddress(input.walletAddress);
|
|
97041
97066
|
const dex = getHyperliquidMarketDex(symbol2);
|
|
97067
|
+
const state2 = await postHyperliquidInfo(
|
|
97068
|
+
input,
|
|
97069
|
+
{ type: "clearinghouseState", user: requireWalletAddress(input.walletAddress), ...dex ? { dex } : {} },
|
|
97070
|
+
"hyperliquid.clearinghouseState"
|
|
97071
|
+
);
|
|
97072
|
+
let size = 0;
|
|
97073
|
+
for (const entry of requireClearinghouseState(state2).assetPositions) {
|
|
97074
|
+
const position = entry?.position;
|
|
97075
|
+
const coin = String(position?.coin ?? "");
|
|
97076
|
+
if (normalizeSymbol(dex && !coin.includes(":") ? `${dex}:${coin}` : coin) === symbol2) size = Number(position?.szi);
|
|
97077
|
+
}
|
|
97078
|
+
return size;
|
|
97079
|
+
};
|
|
97080
|
+
readDevicePrivateExecutionContext = async (input) => {
|
|
97081
|
+
const symbol2 = normalizeSymbol(input.symbol);
|
|
97042
97082
|
const executionContextAtMs = Date.now();
|
|
97043
|
-
const [
|
|
97083
|
+
const [executionPositionSize, activeAsset] = await Promise.all([
|
|
97084
|
+
readDevicePositionSize(input),
|
|
97044
97085
|
postHyperliquidInfo(
|
|
97045
97086
|
input,
|
|
97046
|
-
{ type: "
|
|
97047
|
-
"hyperliquid.clearinghouseState"
|
|
97048
|
-
),
|
|
97049
|
-
postHyperliquidInfo(
|
|
97050
|
-
input,
|
|
97051
|
-
{ type: "activeAssetData", user, coin: symbol2 },
|
|
97087
|
+
{ type: "activeAssetData", user: requireWalletAddress(input.walletAddress), coin: symbol2 },
|
|
97052
97088
|
"hyperliquid.activeAssetData"
|
|
97053
97089
|
)
|
|
97054
97090
|
]);
|
|
97055
|
-
const { assetPositions } = requireClearinghouseState(state2);
|
|
97056
|
-
let executionPositionSize = 0;
|
|
97057
|
-
for (const entry of assetPositions) {
|
|
97058
|
-
const position = entry?.position;
|
|
97059
|
-
const coin = String(position?.coin ?? "");
|
|
97060
|
-
const qualified = dex && !coin.includes(":") ? `${dex}:${coin}` : coin;
|
|
97061
|
-
if (normalizeSymbol(qualified) !== symbol2) continue;
|
|
97062
|
-
executionPositionSize = Number(position?.szi);
|
|
97063
|
-
}
|
|
97064
97091
|
const executionMarkPrice = finitePositive(activeAsset?.markPx);
|
|
97065
97092
|
if (executionMarkPrice === null) {
|
|
97066
97093
|
throw new Error(`Missing Hyperliquid mark price for ${symbol2}.`);
|
|
@@ -100317,6 +100344,7 @@ var init_api2 = __esm({
|
|
|
100317
100344
|
init_client_exchange_reconciliation();
|
|
100318
100345
|
init_client_protective_evidence();
|
|
100319
100346
|
init_server_runtime_lease();
|
|
100347
|
+
init_copy_trading_order_action();
|
|
100320
100348
|
init_provider_relays();
|
|
100321
100349
|
clientRuntimeSecretHeaders = (profileId) => {
|
|
100322
100350
|
const headers = getProfileHeaders({}, profileId);
|
|
@@ -120136,7 +120164,7 @@ var init_browser_observability = __esm({
|
|
|
120136
120164
|
init_define_VTX_GROK_POLICY();
|
|
120137
120165
|
init_define_VTX_PI_MODEL_POLICY();
|
|
120138
120166
|
init_runtime_policy_generated2();
|
|
120139
|
-
CLIENT_SOURCE_VERSION = typeof process !== "undefined" && true && "
|
|
120167
|
+
CLIENT_SOURCE_VERSION = typeof process !== "undefined" && true && "48a5db0e7a4673e066f92076a5463378bab8d246".trim() && "48a5db0e7a4673e066f92076a5463378bab8d246".trim() !== "unstamped" ? "48a5db0e7a4673e066f92076a5463378bab8d246".trim() : null;
|
|
120140
120168
|
listenersInstalled = false;
|
|
120141
120169
|
state = {
|
|
120142
120170
|
loadedAtMs: Date.now(),
|
|
@@ -122545,7 +122573,7 @@ function copiedTargetNow(reconciliation, recordedTarget, actualPosition) {
|
|
|
122545
122573
|
);
|
|
122546
122574
|
return { copiedNow, targetNow, kept: copiedTargetBesideOwnPosition(targetNow, copiedNow, actualPosition) };
|
|
122547
122575
|
}
|
|
122548
|
-
var _extractOrderResponseStates, CLIENT_COPY_TRADING_EXECUTION, executeClientCopyTradingIntent, executeCopyTradingIntent, _copyCancelOrderId, executeClientCopyTradingOrderAction, executeCopyTradingOrderAction;
|
|
122576
|
+
var _extractOrderResponseStates, CLIENT_COPY_TRADING_EXECUTION, executeClientCopyTradingIntent, executeCopyTradingIntent, _copyCancelOrderId, judgedPositionUnconfirmed, executeClientCopyTradingOrderAction, executeCopyTradingOrderAction;
|
|
122549
122577
|
var init_copy_trading_execution = __esm({
|
|
122550
122578
|
"lib/runtime/copy-trading-execution.ts"() {
|
|
122551
122579
|
"use strict";
|
|
@@ -122600,6 +122628,7 @@ var init_copy_trading_execution = __esm({
|
|
|
122600
122628
|
modifyOrder: (input) => exchangeWrites.modifyOrder(input),
|
|
122601
122629
|
cancelOrder: (input) => exchangeWrites.cancelOrder(input),
|
|
122602
122630
|
sizePrecision: (input) => quantizeHyperliquidOrderSize(input),
|
|
122631
|
+
followerPosition: (input) => readDevicePositionSize(input),
|
|
122603
122632
|
orderStatusEvidence: (context, orderId) => readCopyOrderStatusEvidence(context, orderId)
|
|
122604
122633
|
};
|
|
122605
122634
|
executeClientCopyTradingIntent = (input) => executeCopyTradingIntent(input, CLIENT_COPY_TRADING_EXECUTION);
|
|
@@ -122925,6 +122954,25 @@ var init_copy_trading_execution = __esm({
|
|
|
122925
122954
|
const cloid = String(destinationOrderId || "").trim().toLowerCase();
|
|
122926
122955
|
return /^0x[0-9a-f]{32}$/.test(cloid) ? cloid : null;
|
|
122927
122956
|
};
|
|
122957
|
+
judgedPositionUnconfirmed = async (action, input, execution) => {
|
|
122958
|
+
const judged = action.judged_follower_position;
|
|
122959
|
+
if (typeof judged !== "number" || !Number.isFinite(judged)) return false;
|
|
122960
|
+
let live;
|
|
122961
|
+
try {
|
|
122962
|
+
live = Number(await execution.followerPosition({
|
|
122963
|
+
publicRequestPriority: "trading_execute",
|
|
122964
|
+
symbol: action.symbol,
|
|
122965
|
+
walletAddress: input.walletAddress,
|
|
122966
|
+
signal: input.signal,
|
|
122967
|
+
profileId: input.profileId,
|
|
122968
|
+
config: input.config ?? null
|
|
122969
|
+
}));
|
|
122970
|
+
} catch (error48) {
|
|
122971
|
+
if (input.signal?.aborted || isClientRuntimeWindowHandoffBeforePlanDispatch(error48)) throw error48;
|
|
122972
|
+
return true;
|
|
122973
|
+
}
|
|
122974
|
+
return !Number.isFinite(live) || Math.abs(live - judged) > Math.max(COPY_TRADING_SIZE_EPSILON, Math.abs(judged) * COPY_TRADING_RELATIVE_SIZE_TOLERANCE);
|
|
122975
|
+
};
|
|
122928
122976
|
executeClientCopyTradingOrderAction = (input) => executeCopyTradingOrderAction(input, CLIENT_COPY_TRADING_EXECUTION);
|
|
122929
122977
|
executeCopyTradingOrderAction = async (input, execution) => {
|
|
122930
122978
|
throwIfAborted(input.signal);
|
|
@@ -122988,6 +123036,15 @@ var init_copy_trading_execution = __esm({
|
|
|
122988
123036
|
if (!Number.isFinite(size) || size <= 0 || !Number.isFinite(limitPrice) || limitPrice <= 0) {
|
|
122989
123037
|
throw new RuntimeReasonError("Copy Trading order action is missing a valid size or limit price.", "internal_data_error");
|
|
122990
123038
|
}
|
|
123039
|
+
if (action.action_type === "create" && await judgedPositionUnconfirmed(action, input, execution)) {
|
|
123040
|
+
return {
|
|
123041
|
+
status: "position_changed",
|
|
123042
|
+
destinationOrderId: null,
|
|
123043
|
+
destinationOrderState: null,
|
|
123044
|
+
orderMemberResults: null,
|
|
123045
|
+
message: "Copy Trading did not send the order: the position it was checked against moved or could not be read."
|
|
123046
|
+
};
|
|
123047
|
+
}
|
|
122991
123048
|
let response;
|
|
122992
123049
|
if (action.action_type === "create" && Array.isArray(action.order_members) && action.order_members.length > 1) {
|
|
122993
123050
|
response = await execution.orderBatch({
|
|
@@ -132626,9 +132683,9 @@ var init_local_analysis = __esm({
|
|
|
132626
132683
|
RUNTIME_SOURCE_DEFINITION_VERSION = "runtime-source-v1";
|
|
132627
132684
|
DECISION_INPUT_DEFINITION_VERSION = "decision-input-v1";
|
|
132628
132685
|
CONTEXT_ENVELOPE_DEFINITION_VERSION = "context-envelope-v2.1";
|
|
132629
|
-
CLIENT_RUNTIME_SOURCE_VERSION = typeof process !== "undefined" && true && "
|
|
132630
|
-
"
|
|
132631
|
-
) ? "
|
|
132686
|
+
CLIENT_RUNTIME_SOURCE_VERSION = typeof process !== "undefined" && true && "48a5db0e7a4673e066f92076a5463378bab8d246".trim() && !["unknown", "unstamped", "development"].includes(
|
|
132687
|
+
"48a5db0e7a4673e066f92076a5463378bab8d246".trim().toLowerCase()
|
|
132688
|
+
) ? "48a5db0e7a4673e066f92076a5463378bab8d246".trim() : null;
|
|
132632
132689
|
CLIENT_MAIN_PROMPT_RENDERER = "client_runtime.buildLocalRuntimePromptArtifacts:v1";
|
|
132633
132690
|
CLIENT_REVIEW_PROMPT_RENDERER = "client_runtime.review_prompt_assembly:v1";
|
|
132634
132691
|
resolveEffectivePromptRuntimeProvenance = (input) => ({
|
|
@@ -138303,7 +138360,7 @@ __export(copy_review_runtime_decides_exports, {
|
|
|
138303
138360
|
decideOwedCopyReviews: () => decideOwedCopyReviews,
|
|
138304
138361
|
decideServerOwedCopyReviews: () => decideServerOwedCopyReviews
|
|
138305
138362
|
});
|
|
138306
|
-
var RENDER_TIMEOUT_MS, REPORT_TIMEOUT_MS, attemptsOf, decideCopyReview, renderAndDecide, decideOwedCopyReviews, decideCheckInCopyReviews, decideServerOwedCopyReviews;
|
|
138363
|
+
var RENDER_TIMEOUT_MS, REPORT_TIMEOUT_MS, pastCopyAge, attemptsOf, decideCopyReview, UNRENDERED, renderAndDecide, renderAndDecideUntil, decideOwedCopyReviews, decideCheckInCopyReviews, decideServerOwedCopyReviews;
|
|
138307
138364
|
var init_copy_review_runtime_decides = __esm({
|
|
138308
138365
|
"lib/runtime/copy-review-runtime-decides.ts"() {
|
|
138309
138366
|
"use strict";
|
|
@@ -138327,6 +138384,11 @@ var init_copy_review_runtime_decides = __esm({
|
|
|
138327
138384
|
init_runtime_prompt_steps();
|
|
138328
138385
|
RENDER_TIMEOUT_MS = runtime_policy_generated_default2.copy_trading.review_shadow.render_timeout_seconds * MS_PER_SECOND;
|
|
138329
138386
|
REPORT_TIMEOUT_MS = runtime_policy_generated_default2.copy_trading.review_shadow.report_timeout_seconds * MS_PER_SECOND;
|
|
138387
|
+
pastCopyAge = (invocations) => ({
|
|
138388
|
+
failure: "copy_review_past_copy_age",
|
|
138389
|
+
failure_stage: "model",
|
|
138390
|
+
invocations
|
|
138391
|
+
});
|
|
138330
138392
|
attemptsOf = (error48) => {
|
|
138331
138393
|
const carried = error48;
|
|
138332
138394
|
const attempts = carried?.runtimeInvocationAttempts ?? carried?.invocations;
|
|
@@ -138418,6 +138480,7 @@ var init_copy_review_runtime_decides = __esm({
|
|
|
138418
138480
|
invocations
|
|
138419
138481
|
};
|
|
138420
138482
|
} catch (error48) {
|
|
138483
|
+
if (input.stopped()) return pastCopyAge(attemptsOf(error48));
|
|
138421
138484
|
if (input.signal.aborted && !(error48 instanceof RuntimeReasonError)) throw error48;
|
|
138422
138485
|
return {
|
|
138423
138486
|
failure: raisedRuntimeErrorReasonCode(error48) ?? (isAbortLikeError(error48) ? "runtime_timeout" : "internal_data_error"),
|
|
@@ -138426,7 +138489,18 @@ var init_copy_review_runtime_decides = __esm({
|
|
|
138426
138489
|
};
|
|
138427
138490
|
}
|
|
138428
138491
|
};
|
|
138429
|
-
|
|
138492
|
+
UNRENDERED = { prompts: {}, variables: {} };
|
|
138493
|
+
renderAndDecide = async (request, input, receivedAtMs) => {
|
|
138494
|
+
const stopAtMs = typeof request.stop_in_ms === "number" ? receivedAtMs + request.stop_in_ms : null;
|
|
138495
|
+
if (stopAtMs !== null && Date.now() >= stopAtMs) return { ...UNRENDERED, ...pastCopyAge([]) };
|
|
138496
|
+
const stop = stopAtMs === null ? null : shadowBudget(input.signal, stopAtMs - Date.now());
|
|
138497
|
+
try {
|
|
138498
|
+
return await renderAndDecideUntil(request, { ...input, signal: stop?.signal ?? input.signal }, () => stop?.timedOut() === true);
|
|
138499
|
+
} finally {
|
|
138500
|
+
stop?.end();
|
|
138501
|
+
}
|
|
138502
|
+
};
|
|
138503
|
+
renderAndDecideUntil = async (request, input, stopped) => {
|
|
138430
138504
|
const event = request.event;
|
|
138431
138505
|
const render4 = shadowBudget(input.signal, RENDER_TIMEOUT_MS);
|
|
138432
138506
|
let rendered;
|
|
@@ -138444,6 +138518,7 @@ var init_copy_review_runtime_decides = __esm({
|
|
|
138444
138518
|
signal: render4.signal
|
|
138445
138519
|
});
|
|
138446
138520
|
} catch (error48) {
|
|
138521
|
+
if (stopped()) return { ...UNRENDERED, ...pastCopyAge([]) };
|
|
138447
138522
|
if (input.signal.aborted) throw error48;
|
|
138448
138523
|
const failure2 = render4.timedOut() || isAbortLikeError(error48) ? "runtime_timeout" : raisedRuntimeErrorReasonCode(error48) ?? "internal_data_error";
|
|
138449
138524
|
appendRuntimeDebugEvent({
|
|
@@ -138464,15 +138539,17 @@ var init_copy_review_runtime_decides = __esm({
|
|
|
138464
138539
|
shadowId: request.id,
|
|
138465
138540
|
symbol: event.symbol,
|
|
138466
138541
|
rendered,
|
|
138467
|
-
signal: input.signal
|
|
138542
|
+
signal: input.signal,
|
|
138543
|
+
stopped
|
|
138468
138544
|
});
|
|
138469
138545
|
return { prompts: shadowPrompts(rendered.prompts), variables: rendered.variables, ...answer };
|
|
138470
138546
|
};
|
|
138471
138547
|
decideOwedCopyReviews = async (input) => {
|
|
138472
138548
|
let decided = 0;
|
|
138549
|
+
const receivedAtMs = Date.now();
|
|
138473
138550
|
for (const request of decidingRequests(input.requests)) {
|
|
138474
138551
|
if (input.signal.aborted || input.shouldStop()) break;
|
|
138475
|
-
const report = input.secrets ? await renderAndDecide(request, { ...input, secrets: input.secrets }) : { prompts: {}, variables: {}, failure: "credentials_missing", failure_stage: "render", invocations: [] };
|
|
138552
|
+
const report = input.secrets ? await renderAndDecide(request, { ...input, secrets: input.secrets }, receivedAtMs) : { prompts: {}, variables: {}, failure: "credentials_missing", failure_stage: "render", invocations: [] };
|
|
138476
138553
|
const reporting = shadowBudget(input.signal, REPORT_TIMEOUT_MS);
|
|
138477
138554
|
try {
|
|
138478
138555
|
const outcome = await reportCopyReviewShadowRender(input.profileId, request.id, report, {
|
|
@@ -138740,7 +138817,7 @@ var init_copy_trading_check_in = __esm({
|
|
|
138740
138817
|
Number(input.profileId),
|
|
138741
138818
|
copyOrderAction.id,
|
|
138742
138819
|
{
|
|
138743
|
-
status: actionResult.status === "executed"
|
|
138820
|
+
status: actionResult.status === "executed" || actionResult.status === "position_changed" ? actionResult.status : actionResult.status === "skipped" ? "expired" : "failed",
|
|
138744
138821
|
order_id: actionResult.destinationOrderId,
|
|
138745
138822
|
order_state: actionResult.destinationOrderState,
|
|
138746
138823
|
order_member_results: actionResult.orderMemberResults,
|