@vtxmacro/cli 2026.9.59 → 2026.9.60
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 +1 -1
- package/bin/vtx.js +60 -16
- 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.60",
|
|
20
20
|
codex_package_name: "@openai/codex",
|
|
21
21
|
codex_version: "0.155.0",
|
|
22
22
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
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.60",
|
|
81
81
|
codex_package_name: "@openai/codex",
|
|
82
82
|
codex_version: "0.155.0",
|
|
83
83
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -48621,7 +48621,7 @@ var init_abort = __esm({
|
|
|
48621
48621
|
});
|
|
48622
48622
|
|
|
48623
48623
|
// lib/runtime/runtime-redaction.ts
|
|
48624
|
-
var REDACTED_VALUE, SECRET_QUERY_PARAM_PATTERN, BEARER_TOKEN_PATTERN, SECRET_ASSIGNMENT_PATTERN, SECRET_KEYWORD_VALUE_PATTERN, OPENAI_STYLE_KEY_PATTERN, VERTEX_EXPRESS_KEY_PATTERN, sanitizeRuntimeDiagnosticValue, sanitizeRuntimeNetworkPath, getSanitizedRuntimeErrorMessage, toSanitizedRuntimeError;
|
|
48624
|
+
var REDACTED_VALUE, SECRET_QUERY_PARAM_PATTERN, BEARER_TOKEN_PATTERN, SECRET_ASSIGNMENT_PATTERN, SECRET_KEYWORD_VALUE_PATTERN, OPENAI_STYLE_KEY_PATTERN, VERTEX_EXPRESS_KEY_PATTERN, isRuntimeErrorObject, sanitizeRuntimeDiagnosticValue, sanitizeRuntimeNetworkPath, getSanitizedRuntimeErrorMessage, toSanitizedRuntimeError, getSanitizedRuntimeAbortReason;
|
|
48625
48625
|
var init_runtime_redaction = __esm({
|
|
48626
48626
|
"lib/runtime/runtime-redaction.ts"() {
|
|
48627
48627
|
"use strict";
|
|
@@ -48636,6 +48636,7 @@ var init_runtime_redaction = __esm({
|
|
|
48636
48636
|
SECRET_KEYWORD_VALUE_PATTERN = /((?:private(?:_|-|\s)?key|signing(?:_|-|\s)?key)\s*[:=]\s*['"]?)(0x[a-fA-F0-9]{64}|[^'"\s,}]+)/gi;
|
|
48637
48637
|
OPENAI_STYLE_KEY_PATTERN = /\bsk-[A-Za-z0-9._-]+\b/g;
|
|
48638
48638
|
VERTEX_EXPRESS_KEY_PATTERN = /\bAQ\.[A-Za-z0-9._-]+\b/g;
|
|
48639
|
+
isRuntimeErrorObject = (error48) => error48 instanceof Error || error48 != null && typeof error48 === "object" && Object.prototype.toString.call(error48) === "[object DOMException]" && typeof error48.message === "string" && typeof error48.name === "string";
|
|
48639
48640
|
sanitizeRuntimeDiagnosticValue = (value) => {
|
|
48640
48641
|
const normalized = String(value || "");
|
|
48641
48642
|
if (!normalized) {
|
|
@@ -48654,7 +48655,7 @@ var init_runtime_redaction = __esm({
|
|
|
48654
48655
|
return sanitized || "/";
|
|
48655
48656
|
};
|
|
48656
48657
|
getSanitizedRuntimeErrorMessage = (error48) => {
|
|
48657
|
-
const message = error48
|
|
48658
|
+
const message = isRuntimeErrorObject(error48) ? error48.message : typeof error48 === "string" ? error48 : error48 == null ? null : String(error48);
|
|
48658
48659
|
if (message == null) {
|
|
48659
48660
|
return null;
|
|
48660
48661
|
}
|
|
@@ -48662,20 +48663,22 @@ var init_runtime_redaction = __esm({
|
|
|
48662
48663
|
};
|
|
48663
48664
|
toSanitizedRuntimeError = (error48) => {
|
|
48664
48665
|
const message = getSanitizedRuntimeErrorMessage(error48) || "Unknown runtime error.";
|
|
48665
|
-
if (error48
|
|
48666
|
+
if (isRuntimeErrorObject(error48) && error48.message === message) {
|
|
48666
48667
|
if (isAbortLikeError(error48) && error48.name !== "AbortError") {
|
|
48667
|
-
error48.name = "AbortError";
|
|
48668
|
+
if (error48 instanceof Error) error48.name = "AbortError";
|
|
48669
|
+
else return Object.assign(new Error(message), { name: "AbortError" });
|
|
48668
48670
|
}
|
|
48669
48671
|
return error48;
|
|
48670
48672
|
}
|
|
48671
48673
|
const sanitized = new Error(message);
|
|
48672
48674
|
if (isAbortLikeError(error48)) {
|
|
48673
48675
|
sanitized.name = "AbortError";
|
|
48674
|
-
} else if (error48
|
|
48676
|
+
} else if (isRuntimeErrorObject(error48) && error48.name) {
|
|
48675
48677
|
sanitized.name = error48.name;
|
|
48676
48678
|
}
|
|
48677
48679
|
return sanitized;
|
|
48678
48680
|
};
|
|
48681
|
+
getSanitizedRuntimeAbortReason = (signal, fallbackMessage = "The operation was aborted.") => isRuntimeErrorObject(signal?.reason) ? toSanitizedRuntimeError(signal.reason) : new DOMException(fallbackMessage, "AbortError");
|
|
48679
48682
|
}
|
|
48680
48683
|
});
|
|
48681
48684
|
|
|
@@ -48704,7 +48707,7 @@ var init_hyperliquid_public_read = __esm({
|
|
|
48704
48707
|
scope.value = priority;
|
|
48705
48708
|
scope.followers?.forEach((promote) => promote(priority));
|
|
48706
48709
|
};
|
|
48707
|
-
abortError2 = (signal) => signal
|
|
48710
|
+
abortError2 = (signal) => getSanitizedRuntimeAbortReason(signal, "Aborted");
|
|
48708
48711
|
checkAbort = (signal) => {
|
|
48709
48712
|
if (signal?.aborted) throw abortError2(signal);
|
|
48710
48713
|
};
|
|
@@ -52321,7 +52324,15 @@ async function getClientRuntimeSecrets(profileId, options) {
|
|
|
52321
52324
|
operationHint: "get",
|
|
52322
52325
|
retryAfterHeader: response.headers.get("Retry-After")
|
|
52323
52326
|
});
|
|
52324
|
-
throw new Error(normalizedRateLimitMessage ?? message)
|
|
52327
|
+
throw annotateRuntimeRequestError(new Error(normalizedRateLimitMessage ?? message), {
|
|
52328
|
+
path: "/auth/me/client-runtime-secrets",
|
|
52329
|
+
method: "GET",
|
|
52330
|
+
attempt: 1,
|
|
52331
|
+
maxAttempts: 1,
|
|
52332
|
+
status: response.status,
|
|
52333
|
+
keepalive: false,
|
|
52334
|
+
hadRuntimeLeaseToken: false
|
|
52335
|
+
});
|
|
52325
52336
|
}
|
|
52326
52337
|
const payload = await response.json();
|
|
52327
52338
|
const fetchedPayload = buildClientRuntimeSecretFetchedEventPayload(
|
|
@@ -52690,6 +52701,7 @@ async function settleClientRuntimeExchangeMutation(profileId, mutationId, payloa
|
|
|
52690
52701
|
JSON.stringify({
|
|
52691
52702
|
...clientExchangeMutationAuthorityBody(authority),
|
|
52692
52703
|
outcome: payload.outcome,
|
|
52704
|
+
dispatch_diagnostics: payload.dispatchDiagnostics ?? void 0,
|
|
52693
52705
|
exchange_order_id: payload.exchangeOrderId ?? null,
|
|
52694
52706
|
order_member_results: payload.orderMemberResults?.map((result3) => ({
|
|
52695
52707
|
client_order_id: result3.clientOrderId,
|
|
@@ -52890,6 +52902,7 @@ var init_api2 = __esm({
|
|
|
52890
52902
|
const error48 = new Error(message);
|
|
52891
52903
|
error48.status = response.status;
|
|
52892
52904
|
error48.detail = payload.detail;
|
|
52905
|
+
Object.assign(error48, { modelFallbackSafe: nestedDetail?.model_fallback_safe === true });
|
|
52893
52906
|
const code = typeof payload.code === "string" ? payload.code.trim() : typeof nestedDetail?.code === "string" ? nestedDetail.code.trim() : "";
|
|
52894
52907
|
if (code) {
|
|
52895
52908
|
error48.code = code;
|
|
@@ -84002,7 +84015,7 @@ var init_hyperliquid_signer = __esm({
|
|
|
84002
84015
|
});
|
|
84003
84016
|
|
|
84004
84017
|
// lib/runtime/hyperliquid-client.ts
|
|
84005
|
-
var HyperliquidExchangeRejectionError, durableMutationAuthorityArgs, assertFreshPreparedExecutionContext, HYPERLIQUID_TERMINAL_ORDER_STATUSES, normalizeSymbol, HYPERLIQUID_NONCE_STORAGE_KEY, HYPERLIQUID_NONCE_LOCK_NAME, lastGeneratedNonce, readBrowserStoredHyperliquidNonce, writeBrowserStoredHyperliquidNonce, browserNonceCoordinator, allocateHyperliquidNonce, generateHyperliquidNonce, roundToSigFigs, normalizeDecimalString, toPlainDecimalString, roundDirectionalDecimalString, formatHyperliquidPerpPriceWire, formatHyperliquidTriggerPriceWire, countSignificantDigits, countDecimalPlaces, validateHyperliquidPerpPriceWire, validateHyperliquidSizeWire, formatSizeWire, inferApiUrl, inferIsTestnet, postHyperliquidInfo, toFiniteNumber, OPEN_ORDER_NUMERIC_STRING, OPEN_ORDER_ID_STRING, parseCanonicalOpenOrderId, parseOpenOrderFiniteNumber, parseOpenOrderPositiveNumber, parseOpenOrderPresentationNumber, readOpenOrderField, firstFiniteNumber2, parseFundingUsdcFromInfoPosition2, isExchangeIsolatedOnly, computeHip3AssetId, getPerpDexIndexMap, buildAssetInfosFromMetaResponse, requireWalletAddress2, assertPositiveInteger, assertPositiveNumber, normalizeOrderSide, normalizeHyperliquidClientOrderId, resolveAssets, findResolvedAsset, normalizeExecutionAssetMetadata, resolveHyperliquidAsset, resolveHyperliquidAssetIndex, fetchBrowserAvailableAssets, fetchBrowserAllMids, fetchBrowserSymbolMidPrice, fetchBrowserOpenOrders, parseCanonicalHyperliquidOrderStatusEvidence, fetchBrowserOrderStatusEvidence, fetchBrowserUserRole, fetchBrowserAccountState2, fetchBrowserPosition, buildHyperliquidOrderWire, buildHyperliquidTriggerOrderWire, signHyperliquidPayload, buildHyperliquidCancelPayload, buildHyperliquidUpdateLeveragePayload, buildHyperliquidMarketOrderPayload, buildHyperliquidTriggerOrderPayload, buildHyperliquidOrderBatchPayload, buildHyperliquidModifyOrderPayload, extractHyperliquidExchangeError, isDefinitiveHyperliquidExchangeResponse, extractDefinitiveHyperliquidOrderId, CANONICAL_POSITIVE_DECIMAL_PATTERN, extractCanonicalHyperliquidOrderStateAcknowledgement, extractCanonicalHyperliquidOrderStateAcknowledgements, extractCanonicalHyperliquidFilledOrderAcknowledgement, extractDefinitiveHyperliquidOrderMemberResults, buildHyperliquidOrderDiagnostics, loadClientExecutionReferenceEvidence, sha256Hex, extractSignedPayloadClientOrderId, extractSignedPayloadMutationCorrelation, assertDurableMutationMatchesSignedAction, exchangeActionPriority, submitHyperliquidExchangePayload;
|
|
84018
|
+
var HyperliquidExchangeRejectionError, durableMutationAuthorityArgs, assertFreshPreparedExecutionContext, HYPERLIQUID_TERMINAL_ORDER_STATUSES, normalizeSymbol, HYPERLIQUID_NONCE_STORAGE_KEY, HYPERLIQUID_NONCE_LOCK_NAME, lastGeneratedNonce, readBrowserStoredHyperliquidNonce, writeBrowserStoredHyperliquidNonce, browserNonceCoordinator, allocateHyperliquidNonce, generateHyperliquidNonce, roundToSigFigs, normalizeDecimalString, toPlainDecimalString, roundDirectionalDecimalString, formatHyperliquidPerpPriceWire, formatHyperliquidTriggerPriceWire, countSignificantDigits, countDecimalPlaces, validateHyperliquidPerpPriceWire, validateHyperliquidSizeWire, formatSizeWire, inferApiUrl, inferIsTestnet, postHyperliquidInfo, toFiniteNumber, OPEN_ORDER_NUMERIC_STRING, OPEN_ORDER_ID_STRING, parseCanonicalOpenOrderId, parseOpenOrderFiniteNumber, parseOpenOrderPositiveNumber, parseOpenOrderPresentationNumber, readOpenOrderField, firstFiniteNumber2, parseFundingUsdcFromInfoPosition2, isExchangeIsolatedOnly, computeHip3AssetId, getPerpDexIndexMap, buildAssetInfosFromMetaResponse, requireWalletAddress2, assertPositiveInteger, assertPositiveNumber, normalizeOrderSide, normalizeHyperliquidClientOrderId, resolveAssets, findResolvedAsset, normalizeExecutionAssetMetadata, resolveHyperliquidAsset, resolveHyperliquidAssetIndex, fetchBrowserAvailableAssets, fetchBrowserAllMids, fetchBrowserSymbolMidPrice, fetchBrowserOpenOrders, parseCanonicalHyperliquidOrderStatusEvidence, fetchBrowserOrderStatusEvidence, fetchBrowserUserRole, fetchBrowserAccountState2, fetchBrowserPosition, buildHyperliquidOrderWire, buildHyperliquidTriggerOrderWire, signHyperliquidPayload, buildHyperliquidCancelPayload, buildHyperliquidUpdateLeveragePayload, buildHyperliquidMarketOrderPayload, buildHyperliquidTriggerOrderPayload, buildHyperliquidOrderBatchPayload, buildHyperliquidModifyOrderPayload, extractHyperliquidExchangeError, isDefinitiveHyperliquidExchangeResponse, extractDefinitiveHyperliquidOrderId, CANONICAL_POSITIVE_DECIMAL_PATTERN, extractCanonicalHyperliquidOrderStateAcknowledgement, extractCanonicalHyperliquidOrderStateAcknowledgements, extractCanonicalHyperliquidFilledOrderAcknowledgement, extractDefinitiveHyperliquidOrderMemberResults, buildHyperliquidOrderDiagnostics, loadClientExecutionReferenceEvidence, sha256Hex, extractSignedPayloadClientOrderId, extractSignedPayloadMutationCorrelation, assertDurableMutationMatchesSignedAction, exchangeRejectionReason, exchangeActionPriority, submitHyperliquidExchangePayload;
|
|
84006
84019
|
var init_hyperliquid_client = __esm({
|
|
84007
84020
|
"lib/runtime/hyperliquid-client.ts"() {
|
|
84008
84021
|
"use strict";
|
|
@@ -85668,6 +85681,16 @@ var init_hyperliquid_client = __esm({
|
|
|
85668
85681
|
}
|
|
85669
85682
|
return signedAssetId;
|
|
85670
85683
|
};
|
|
85684
|
+
exchangeRejectionReason = (message) => {
|
|
85685
|
+
if (/insufficient.*margin|margin.*insufficient/i.test(message)) return "insufficient_margin";
|
|
85686
|
+
if (/reduce.?only/i.test(message)) return "reduce_only";
|
|
85687
|
+
if (/minimum.*(?:value|notional)|(?:value|notional).*minimum|at least.*\$10/i.test(message)) return "minimum_notional";
|
|
85688
|
+
if (/tick|invalid.*price|price.*invalid/i.test(message)) return "invalid_price";
|
|
85689
|
+
if (/invalid.*size|size.*invalid/i.test(message)) return "invalid_size";
|
|
85690
|
+
if (/rate.?limit|too many requests/i.test(message)) return "rate_limited";
|
|
85691
|
+
if (/invalid.*order|order.*invalid/i.test(message)) return "invalid_order";
|
|
85692
|
+
return "other";
|
|
85693
|
+
};
|
|
85671
85694
|
exchangeActionPriority = (action, requested) => {
|
|
85672
85695
|
if (action.type === "cancel" || action.type === "cancelByCloid") return requested === "trading_reduce" ? "trading_reduce" : "trading_execute";
|
|
85673
85696
|
const orders = action.type === "order" && Array.isArray(action.orders) ? action.orders : action.type === "modify" ? [action.order] : [];
|
|
@@ -85676,7 +85699,7 @@ var init_hyperliquid_client = __esm({
|
|
|
85676
85699
|
submitHyperliquidExchangePayload = async (input) => {
|
|
85677
85700
|
input = { ...input, publicRequestPriority: exchangeActionPriority(input.payload.action, input.publicRequestPriority) };
|
|
85678
85701
|
if (input.signal?.aborted) {
|
|
85679
|
-
throw input.signal
|
|
85702
|
+
throw getSanitizedRuntimeAbortReason(input.signal);
|
|
85680
85703
|
}
|
|
85681
85704
|
const apiUrl = inferApiUrl(input);
|
|
85682
85705
|
const requestUrl = `${apiUrl.replace(/\/$/, "")}/exchange`;
|
|
@@ -85747,7 +85770,7 @@ var init_hyperliquid_client = __esm({
|
|
|
85747
85770
|
);
|
|
85748
85771
|
}
|
|
85749
85772
|
}
|
|
85750
|
-
const settleDurableMutation = async (outcome, exchangeOrderId = null, orderMemberResults = null) => {
|
|
85773
|
+
const settleDurableMutation = async (outcome, exchangeOrderId = null, orderMemberResults = null, dispatchDiagnostics) => {
|
|
85751
85774
|
if (!durableMutation) {
|
|
85752
85775
|
return null;
|
|
85753
85776
|
}
|
|
@@ -85758,6 +85781,7 @@ var init_hyperliquid_client = __esm({
|
|
|
85758
85781
|
durableMutation.mutationId,
|
|
85759
85782
|
{
|
|
85760
85783
|
outcome,
|
|
85784
|
+
...dispatchDiagnostics ? { dispatchDiagnostics } : {},
|
|
85761
85785
|
...outcome === "success" ? { requireExactSuccessSettlement: true } : {},
|
|
85762
85786
|
...exchangeOrderId ? { exchangeOrderId } : {},
|
|
85763
85787
|
...orderMemberResults ? { orderMemberResults } : {},
|
|
@@ -85862,7 +85886,7 @@ var init_hyperliquid_client = __esm({
|
|
|
85862
85886
|
}
|
|
85863
85887
|
if (input.signal?.aborted) {
|
|
85864
85888
|
await settleDurableMutation("rejected");
|
|
85865
|
-
throw input.signal
|
|
85889
|
+
throw getSanitizedRuntimeAbortReason(input.signal);
|
|
85866
85890
|
}
|
|
85867
85891
|
if (durableMutation?.onExchangeOrderDispatched) {
|
|
85868
85892
|
try {
|
|
@@ -85918,7 +85942,11 @@ var init_hyperliquid_client = __esm({
|
|
|
85918
85942
|
await finishHyperliquidRecoveryRequest(recoveryPermit, response.status < 400 ? "success" : "failure").catch(() => void 0);
|
|
85919
85943
|
recoveryPermit = null;
|
|
85920
85944
|
if (!response.ok) {
|
|
85921
|
-
await settleDurableMutation("transport_ambiguous"
|
|
85945
|
+
await settleDurableMutation("transport_ambiguous", null, null, {
|
|
85946
|
+
stage: "exchange_http",
|
|
85947
|
+
failure_kind: "http_error",
|
|
85948
|
+
http_status: response.status
|
|
85949
|
+
});
|
|
85922
85950
|
throw new RuntimeExecutionError(
|
|
85923
85951
|
"Exchange submission may have completed; durable reconciliation is pending.",
|
|
85924
85952
|
"outcome_unknown"
|
|
@@ -85927,7 +85955,15 @@ var init_hyperliquid_client = __esm({
|
|
|
85927
85955
|
const exchangeError = extractHyperliquidExchangeError(payload);
|
|
85928
85956
|
if (exchangeError) {
|
|
85929
85957
|
await settleDurableMutation(
|
|
85930
|
-
exchangeError.partial ? "transport_ambiguous" : "rejected"
|
|
85958
|
+
exchangeError.partial ? "transport_ambiguous" : "rejected",
|
|
85959
|
+
null,
|
|
85960
|
+
null,
|
|
85961
|
+
{
|
|
85962
|
+
stage: "exchange_response",
|
|
85963
|
+
http_status: response.status,
|
|
85964
|
+
failure_kind: exchangeError.partial ? "partial_response" : "exchange_rejected",
|
|
85965
|
+
rejection_reason: exchangeRejectionReason(exchangeError.message)
|
|
85966
|
+
}
|
|
85931
85967
|
);
|
|
85932
85968
|
if (exchangeError.partial) {
|
|
85933
85969
|
throw new RuntimeExecutionError(
|
|
@@ -85945,7 +85981,11 @@ var init_hyperliquid_client = __esm({
|
|
|
85945
85981
|
payload,
|
|
85946
85982
|
input.payload.action
|
|
85947
85983
|
)) {
|
|
85948
|
-
await settleDurableMutation("transport_ambiguous"
|
|
85984
|
+
await settleDurableMutation("transport_ambiguous", null, null, {
|
|
85985
|
+
stage: "exchange_response",
|
|
85986
|
+
failure_kind: "incomplete_response",
|
|
85987
|
+
http_status: response.status
|
|
85988
|
+
});
|
|
85949
85989
|
throw new RuntimeExecutionError(
|
|
85950
85990
|
"Hyperliquid returned an incomplete exchange response; durable reconciliation is pending.",
|
|
85951
85991
|
"outcome_unknown"
|
|
@@ -85968,7 +86008,11 @@ var init_hyperliquid_client = __esm({
|
|
|
85968
86008
|
} catch (error48) {
|
|
85969
86009
|
if (durableMutation && exchangeDispatched && !settlementAttempted) {
|
|
85970
86010
|
try {
|
|
85971
|
-
await settleDurableMutation("transport_ambiguous"
|
|
86011
|
+
await settleDurableMutation("transport_ambiguous", null, null, {
|
|
86012
|
+
stage: "exchange_transport",
|
|
86013
|
+
failure_kind: error48?.name === "TimeoutError" ? "timeout" : isAbortLikeError(error48) ? "aborted" : error48 instanceof TypeError ? "network_error" : "transport_error",
|
|
86014
|
+
...responseStatus != null ? { http_status: responseStatus } : {}
|
|
86015
|
+
});
|
|
85972
86016
|
} catch {
|
|
85973
86017
|
throw new RuntimeExecutionError(
|
|
85974
86018
|
"Exchange submission may have completed; durable reconciliation is pending.",
|