@vtxmacro/cli 2026.8.48 → 2026.8.49
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/README.md +6 -4
- package/bin/vtx.js +56 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,10 +124,12 @@ The command never kills an arbitrary process, logs either account out, changes
|
|
|
124
124
|
VTX profile settings, or controls a Trader. If any package-owned VTX automation
|
|
125
125
|
is still live, recovery fails closed and preserves its evidence.
|
|
126
126
|
|
|
127
|
-
For each VTX profile and lane, **
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
For each VTX profile and lane, **Host #1** is tried first and later compatible
|
|
128
|
+
hosts follow in the saved Host cascade order. Distinct computers may use the
|
|
129
|
+
same authenticated subscription; provider quota remains account-level.
|
|
130
|
+
Quota/credits exhaustion can advance only to a later host reporting a different
|
|
131
|
+
account identity. Unusable authentication and exhausted recoverable host failures
|
|
132
|
+
can advance the same logical call. VTX never changes
|
|
131
133
|
provider, model, effort, or response mode, and never cascades a bad request,
|
|
132
134
|
policy rejection, or uncertain dispatch outcome.
|
|
133
135
|
|
package/bin/vtx.js
CHANGED
|
@@ -38,7 +38,7 @@ var init_agent_cli_release = __esm({
|
|
|
38
38
|
"agent-cli-release.json"() {
|
|
39
39
|
agent_cli_release_default = {
|
|
40
40
|
package_name: "@vtxmacro/cli",
|
|
41
|
-
package_version: "2026.8.
|
|
41
|
+
package_version: "2026.8.49",
|
|
42
42
|
codex_package_name: "@openai/codex",
|
|
43
43
|
codex_version: "0.147.0",
|
|
44
44
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -16880,7 +16880,7 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
|
|
|
16880
16880
|
}
|
|
16881
16881
|
}`;
|
|
16882
16882
|
WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS = 15e3;
|
|
16883
|
-
WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS =
|
|
16883
|
+
WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS = 9e4;
|
|
16884
16884
|
SMALL_IDENTITY_COMMAND_TIMEOUT_MS = 5e3;
|
|
16885
16885
|
windowsPowerShellEnvironment = (extra = {}) => {
|
|
16886
16886
|
const sanitizedExtra = { ...extra };
|
|
@@ -18428,12 +18428,15 @@ var init_mcp_client = __esm({
|
|
|
18428
18428
|
"External inference claim request was not applied before its generation became stale"
|
|
18429
18429
|
) || errorText.includes("External inference host advertisement is expired or superseded"));
|
|
18430
18430
|
const retryableInfrastructureRejection = EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS.includes(name) && (errorText.includes("External inference polling is at its configured concurrency limit") || errorText.includes("The Insights action reached the response timeout") || errorText.includes("Insights capability failed without exposing private runtime details"));
|
|
18431
|
-
const retryableClaimRejection = name === "inference.job.claim" && !definitivelyNotApplied && (retryableInfrastructureRejection || errorText.includes("External inference host is not live enough to claim work") || errorText.includes("External inference host request generation is stale"));
|
|
18431
|
+
const retryableClaimRejection = name === "inference.job.claim" && !definitivelyNotApplied && (retryableInfrastructureRejection || errorText.includes("External inference host is not live enough to claim work") || errorText.includes("External inference host request generation is stale") || errorText.includes("External inference claim runtime fence is stale"));
|
|
18432
18432
|
const retryableHeartbeatClockSkew = name === "inference.host.heartbeat" && definitivelyNotApplied;
|
|
18433
18433
|
const retryableAdvertisementClockSkew = (name === "inference.host.register" || name === "inference.host.advertise") && definitivelyNotApplied;
|
|
18434
18434
|
const staleHostHeartbeatGeneration = name === "inference.host.heartbeat" && errorText.includes("Heartbeat generations do not match the current host authority.");
|
|
18435
|
+
const obsoleteClaimReplay = name === "inference.job.claim" && errorText.includes(
|
|
18436
|
+
"External inference claim replay is no longer dispatchable"
|
|
18437
|
+
);
|
|
18435
18438
|
throw new ExternalInferenceMcpError(
|
|
18436
|
-
staleHostHeartbeatGeneration ? "generation_stale" : "tool_rejected",
|
|
18439
|
+
staleHostHeartbeatGeneration ? "generation_stale" : obsoleteClaimReplay ? "claim_replay_obsolete" : "tool_rejected",
|
|
18437
18440
|
`Insights MCP rejected ${name}.`,
|
|
18438
18441
|
{
|
|
18439
18442
|
definitivelyNotApplied: definitivelyNotApplied || staleHostHeartbeatGeneration,
|
|
@@ -31521,6 +31524,18 @@ var init_runner = __esm({
|
|
|
31521
31524
|
} catch (error48) {
|
|
31522
31525
|
if (!this.options.signal?.aborted && controlPlaneFatal(error48)) {
|
|
31523
31526
|
requestDrain("authority_lost");
|
|
31527
|
+
} else if (!this.options.signal?.aborted && error48 instanceof ExternalInferenceMcpError && error48.code === "claim_replay_obsolete") {
|
|
31528
|
+
await mutateReceipt((current) => ({
|
|
31529
|
+
...current,
|
|
31530
|
+
pending_claim_request: current.pending_claim_request?.claim_request_id === request.claim_request_id ? null : current.pending_claim_request,
|
|
31531
|
+
updated_at: isoAt(now())
|
|
31532
|
+
}));
|
|
31533
|
+
emitDiagnostic("claim_replay_retired", {
|
|
31534
|
+
request_advertisement_generation: request.advertisement_generation,
|
|
31535
|
+
current_advertisement_generation: receipt.advertisement_generation
|
|
31536
|
+
});
|
|
31537
|
+
nextClaimAt = now();
|
|
31538
|
+
continue;
|
|
31524
31539
|
} else if (!this.options.signal?.aborted && error48 instanceof ExternalInferenceMcpError && error48.definitivelyNotApplied) {
|
|
31525
31540
|
if (request.advertisement_generation < receipt.advertisement_generation) {
|
|
31526
31541
|
await mutateReceipt((current) => ({
|
|
@@ -39008,9 +39023,7 @@ async function beginClientRuntimeExchangeMutation(profileId, payload) {
|
|
|
39008
39023
|
"/runtime/exchange-mutations/begin",
|
|
39009
39024
|
authority.numericProfileId,
|
|
39010
39025
|
JSON.stringify({
|
|
39011
|
-
|
|
39012
|
-
device_id: authority.deviceId,
|
|
39013
|
-
mode: authority.mode,
|
|
39026
|
+
...clientExchangeMutationAuthorityBody(authority),
|
|
39014
39027
|
mutation_id: payload.mutationId,
|
|
39015
39028
|
operation_kind: payload.operationKind,
|
|
39016
39029
|
symbol: payload.symbol,
|
|
@@ -39088,9 +39101,7 @@ async function reportClientRuntimeExchangeAttemptTransition(profileId, mutationI
|
|
|
39088
39101
|
`/runtime/exchange-mutations/${encodeURIComponent(mutationId)}/attempt`,
|
|
39089
39102
|
authority.numericProfileId,
|
|
39090
39103
|
JSON.stringify({
|
|
39091
|
-
|
|
39092
|
-
device_id: authority.deviceId,
|
|
39093
|
-
mode: authority.mode,
|
|
39104
|
+
...clientExchangeMutationAuthorityBody(authority),
|
|
39094
39105
|
phase: payload.phase,
|
|
39095
39106
|
client_observed_at: payload.clientObservedAt
|
|
39096
39107
|
}),
|
|
@@ -39107,15 +39118,14 @@ async function settleClientRuntimeExchangeMutation(profileId, mutationId, payloa
|
|
|
39107
39118
|
`/runtime/exchange-mutations/${encodeURIComponent(mutationId)}/settle`,
|
|
39108
39119
|
authority.numericProfileId,
|
|
39109
39120
|
JSON.stringify({
|
|
39110
|
-
|
|
39111
|
-
device_id: authority.deviceId,
|
|
39112
|
-
mode: authority.mode,
|
|
39121
|
+
...clientExchangeMutationAuthorityBody(authority),
|
|
39113
39122
|
outcome: payload.outcome,
|
|
39114
39123
|
exchange_order_id: payload.exchangeOrderId ?? null,
|
|
39115
39124
|
order_member_results: payload.orderMemberResults?.map((result3) => ({
|
|
39116
39125
|
client_order_id: result3.clientOrderId,
|
|
39117
39126
|
exchange_order_id: result3.exchangeOrderId,
|
|
39118
|
-
order_status: result3.orderStatus
|
|
39127
|
+
order_status: result3.orderStatus,
|
|
39128
|
+
filled_size: result3.filledSize ?? null
|
|
39119
39129
|
})) ?? null,
|
|
39120
39130
|
client_observed_at: payload.clientObservedAt ?? null
|
|
39121
39131
|
}),
|
|
@@ -39169,7 +39179,7 @@ async function reconcileActiveClientRuntimeExchangeMutation(profileId) {
|
|
|
39169
39179
|
}
|
|
39170
39180
|
return rememberCompletedDeferredClientRuntimeStop(profileId, result2);
|
|
39171
39181
|
}
|
|
39172
|
-
var getApiUrl, API_URL, sleep2, isTransientNetworkFetchError, createIdempotencyKey, getErrorMessage, getErrorPayloadOrEmpty, getErrorPayloadOrFallbackDetail, getErrorMessageFromResponse, _activeProfileId, PROFILE_STORAGE_KEY, preferencesWriteQueue, completedDeferredClientRuntimeStops, rememberCompletedDeferredClientRuntimeStop, toNumericProfileId, shouldAttachRuntimeIdempotencyKey, attachRuntimeLeaseHeader, resolveRuntimeLeaseToken, persistRuntimeLeaseFromPayload, persistRuntimeLeaseStatusMetadata, shouldClearPersistedRuntimeLeaseOnError, isMissingRuntimeLeaseError, createRuntimeRequestError, parseClientRuntimeRequestContext, recordRuntimeAuthFailureBreadcrumb, classifyRuntimeRequestError, annotateRuntimeRequestError, parseRuntimeRetryAfterMs, shouldRecoverMissingRuntimeLease, recoverMissingRuntimeLease, isRetryableClientRuntimeStatus, shouldRetryClientRuntimeHttpStatus, resolveClientRuntimeRetryDelayMs, CLIENT_EXCHANGE_AUTHORITY_DEVICE_KEY, CLIENT_EXCHANGE_AUTHORITY_SESSION_KEY, getOrCreateClientExchangeAuthorityIdentity, resolveClientExchangeMutationAuthority, isPendingClientExchangeMutationError, clientExchangeMutationReconciliationTimers, MAX_CLIENT_EXCHANGE_RECONCILIATION_DELAY_MS, CLIENT_EXCHANGE_RECONCILIATION_CLOCK_SKEW_MS, ClientExchangeMutationRebuildRequiredError, isTerminalClientExchangeMutation, clientExchangeMutationReconciliationKey, clearScheduledClientExchangeMutationReconciliation, postClientExchangeMutationReconciliation, scheduleClientExchangeMutationReconciliation;
|
|
39182
|
+
var getApiUrl, API_URL, sleep2, isTransientNetworkFetchError, createIdempotencyKey, getErrorMessage, getErrorPayloadOrEmpty, getErrorPayloadOrFallbackDetail, getErrorMessageFromResponse, _activeProfileId, PROFILE_STORAGE_KEY, preferencesWriteQueue, CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION, completedDeferredClientRuntimeStops, rememberCompletedDeferredClientRuntimeStop, toNumericProfileId, shouldAttachRuntimeIdempotencyKey, attachRuntimeLeaseHeader, resolveRuntimeLeaseToken, persistRuntimeLeaseFromPayload, persistRuntimeLeaseStatusMetadata, shouldClearPersistedRuntimeLeaseOnError, isMissingRuntimeLeaseError, createRuntimeRequestError, parseClientRuntimeRequestContext, recordRuntimeAuthFailureBreadcrumb, classifyRuntimeRequestError, annotateRuntimeRequestError, parseRuntimeRetryAfterMs, shouldRecoverMissingRuntimeLease, recoverMissingRuntimeLease, isRetryableClientRuntimeStatus, shouldRetryClientRuntimeHttpStatus, resolveClientRuntimeRetryDelayMs, CLIENT_EXCHANGE_AUTHORITY_DEVICE_KEY, CLIENT_EXCHANGE_AUTHORITY_SESSION_KEY, getOrCreateClientExchangeAuthorityIdentity, resolveClientExchangeMutationAuthority, clientExchangeMutationAuthorityBody, isPendingClientExchangeMutationError, clientExchangeMutationReconciliationTimers, MAX_CLIENT_EXCHANGE_RECONCILIATION_DELAY_MS, CLIENT_EXCHANGE_RECONCILIATION_CLOCK_SKEW_MS, ClientExchangeMutationRebuildRequiredError, isTerminalClientExchangeMutation, clientExchangeMutationReconciliationKey, clearScheduledClientExchangeMutationReconciliation, postClientExchangeMutationReconciliation, scheduleClientExchangeMutationReconciliation;
|
|
39173
39183
|
var init_api2 = __esm({
|
|
39174
39184
|
"lib/api.ts"() {
|
|
39175
39185
|
"use strict";
|
|
@@ -39279,6 +39289,9 @@ var init_api2 = __esm({
|
|
|
39279
39289
|
}
|
|
39280
39290
|
}
|
|
39281
39291
|
preferencesWriteQueue = Promise.resolve();
|
|
39292
|
+
CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION = String(
|
|
39293
|
+
process.env.NEXT_PUBLIC_CLIENT_RUNTIME_PROMPT_CONTRACT_VERSION || "2026-08-19"
|
|
39294
|
+
).trim() || "2026-08-19";
|
|
39282
39295
|
completedDeferredClientRuntimeStops = /* @__PURE__ */ new Set();
|
|
39283
39296
|
rememberCompletedDeferredClientRuntimeStop = (profileId, result2) => {
|
|
39284
39297
|
if (result2.runtime_stop_completed === true) {
|
|
@@ -39494,6 +39507,7 @@ var init_api2 = __esm({
|
|
|
39494
39507
|
device_id: requestContext.deviceId,
|
|
39495
39508
|
mode: requestContext.mode ?? null,
|
|
39496
39509
|
last_run_at: requestContext.lastRunAt ?? null,
|
|
39510
|
+
prompt_contract_version: CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION,
|
|
39497
39511
|
force_takeover: false,
|
|
39498
39512
|
claim_reason: "auto_resume"
|
|
39499
39513
|
})
|
|
@@ -39581,6 +39595,12 @@ var init_api2 = __esm({
|
|
|
39581
39595
|
}
|
|
39582
39596
|
};
|
|
39583
39597
|
};
|
|
39598
|
+
clientExchangeMutationAuthorityBody = (authority) => ({
|
|
39599
|
+
session_id: authority.sessionId,
|
|
39600
|
+
device_id: authority.deviceId,
|
|
39601
|
+
mode: authority.mode,
|
|
39602
|
+
prompt_contract_version: CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION
|
|
39603
|
+
});
|
|
39584
39604
|
isPendingClientExchangeMutationError = (error48) => {
|
|
39585
39605
|
const status = Number(error48?.status);
|
|
39586
39606
|
const message = error48 instanceof Error ? error48.message : String(error48 ?? "");
|
|
@@ -49191,10 +49211,11 @@ var init_hyperliquid_client = __esm({
|
|
|
49191
49211
|
init_runtime_redaction();
|
|
49192
49212
|
init_exchange_mutation_fence();
|
|
49193
49213
|
HyperliquidExchangeRejectionError = class extends Error {
|
|
49194
|
-
constructor(message, orderDiagnostics) {
|
|
49214
|
+
constructor(message, orderDiagnostics, clientMutationId = null) {
|
|
49195
49215
|
super(message);
|
|
49196
49216
|
this.name = "HyperliquidExchangeRejectionError";
|
|
49197
49217
|
this.orderDiagnostics = orderDiagnostics;
|
|
49218
|
+
this.clientMutationId = clientMutationId;
|
|
49198
49219
|
}
|
|
49199
49220
|
};
|
|
49200
49221
|
assertFreshPreparedExecutionContext = (preparedContext) => {
|
|
@@ -49866,14 +49887,14 @@ var init_hyperliquid_client = __esm({
|
|
|
49866
49887
|
p: limitPriceWire,
|
|
49867
49888
|
s: sizeWire,
|
|
49868
49889
|
r: input.reduceOnly !== false,
|
|
49869
|
-
...normalizeHyperliquidClientOrderId(input.clientOrderId) ? { c: normalizeHyperliquidClientOrderId(input.clientOrderId) } : {},
|
|
49870
49890
|
t: {
|
|
49871
49891
|
trigger: {
|
|
49872
49892
|
isMarket: input.triggerIsMarket !== false,
|
|
49873
49893
|
triggerPx: triggerPriceWire,
|
|
49874
49894
|
tpsl: "triggerKind" in input && input.triggerKind ? input.triggerKind : "isTakeProfit" in input && input.isTakeProfit === true ? "tp" : "sl"
|
|
49875
49895
|
}
|
|
49876
|
-
}
|
|
49896
|
+
},
|
|
49897
|
+
...normalizeHyperliquidClientOrderId(input.clientOrderId) ? { c: normalizeHyperliquidClientOrderId(input.clientOrderId) } : {}
|
|
49877
49898
|
};
|
|
49878
49899
|
};
|
|
49879
49900
|
signHyperliquidPayload = async (input, action) => {
|
|
@@ -50111,10 +50132,14 @@ var init_hyperliquid_client = __esm({
|
|
|
50111
50132
|
if (!/^\d+$/.test(exchangeOrderId) || !/[1-9]/.test(exchangeOrderId)) {
|
|
50112
50133
|
return null;
|
|
50113
50134
|
}
|
|
50135
|
+
const rawFilledSize = filled && typeof filled === "object" && !Array.isArray(filled) ? filled.totalSz : null;
|
|
50136
|
+
const filledSize = rawFilledSize == null ? null : String(rawFilledSize).trim();
|
|
50137
|
+
const hasExactFilledSize = filledSize != null && filledSize.length > 0 && Number.isFinite(Number(filledSize)) && Number(filledSize) > 0;
|
|
50114
50138
|
results.push({
|
|
50115
50139
|
clientOrderId,
|
|
50116
50140
|
exchangeOrderId,
|
|
50117
|
-
orderStatus: resting != null ? "open" : "filled"
|
|
50141
|
+
orderStatus: resting != null ? "open" : "filled",
|
|
50142
|
+
...resting == null && hasExactFilledSize ? { filledSize } : {}
|
|
50118
50143
|
});
|
|
50119
50144
|
}
|
|
50120
50145
|
return results;
|
|
@@ -50470,7 +50495,8 @@ var init_hyperliquid_client = __esm({
|
|
|
50470
50495
|
}
|
|
50471
50496
|
throw new HyperliquidExchangeRejectionError(
|
|
50472
50497
|
sanitizeRuntimeDiagnosticValue(exchangeError.message),
|
|
50473
|
-
buildHyperliquidOrderDiagnostics(input.payload, response.status)
|
|
50498
|
+
buildHyperliquidOrderDiagnostics(input.payload, response.status),
|
|
50499
|
+
durableMutation?.mutationId ?? null
|
|
50474
50500
|
);
|
|
50475
50501
|
}
|
|
50476
50502
|
if (durableMutation && !isDefinitiveHyperliquidExchangeResponse(
|
|
@@ -50487,11 +50513,10 @@ var init_hyperliquid_client = __esm({
|
|
|
50487
50513
|
payload,
|
|
50488
50514
|
input.payload.action
|
|
50489
50515
|
) : null;
|
|
50490
|
-
const exactOrderMemberResults = extractedOrderMemberResults && extractedOrderMemberResults.length > 1 ? extractedOrderMemberResults : null;
|
|
50491
50516
|
await settleDurableMutation(
|
|
50492
50517
|
"success",
|
|
50493
50518
|
exactExchangeOrderId,
|
|
50494
|
-
|
|
50519
|
+
extractedOrderMemberResults
|
|
50495
50520
|
);
|
|
50496
50521
|
trace.completeSuccess(response.status);
|
|
50497
50522
|
return durableMutation?.operationKind === "order" ? {
|
|
@@ -51836,6 +51861,7 @@ var init_runtime_execution = __esm({
|
|
|
51836
51861
|
init_hyperliquid_account_state_adapter();
|
|
51837
51862
|
init_hyperliquid_client();
|
|
51838
51863
|
init_network_debug();
|
|
51864
|
+
init_runtime_redaction();
|
|
51839
51865
|
createRuntimeId = () => {
|
|
51840
51866
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
51841
51867
|
return crypto.randomUUID();
|
|
@@ -52591,16 +52617,22 @@ var init_runtime_execution = __esm({
|
|
|
52591
52617
|
note: `symbol=${input.executionContext.symbol} kind=${triggerInput.isTakeProfit ? "tp" : "sl"} side=${exitSide} sizeAsset=${sizeAsset} triggerPrice=${triggerInput.triggerPrice} order_id=${_extractOrderId(triggerResponse) || "none"}`
|
|
52592
52618
|
});
|
|
52593
52619
|
} catch (triggerError) {
|
|
52594
|
-
const message = triggerError
|
|
52620
|
+
const message = getSanitizedRuntimeErrorMessage(triggerError) || "Unknown protective trigger order error.";
|
|
52621
|
+
const rejection = triggerError instanceof HyperliquidExchangeRejectionError ? triggerError : null;
|
|
52595
52622
|
executionReports.push({
|
|
52596
52623
|
order_id: null,
|
|
52624
|
+
client_mutation_id: rejection?.clientMutationId ?? null,
|
|
52597
52625
|
symbol: input.executionContext.symbol,
|
|
52598
52626
|
action: triggerInput.label,
|
|
52599
52627
|
status: "failed",
|
|
52600
52628
|
execution_metadata: {
|
|
52601
52629
|
trigger_price: triggerInput.triggerPrice,
|
|
52602
52630
|
is_take_profit: triggerInput.isTakeProfit,
|
|
52603
|
-
|
|
52631
|
+
reason_code: "execution_error",
|
|
52632
|
+
execution_stage: "protective_trigger_order",
|
|
52633
|
+
entry_order_id: _extractOrderId(marketOrderResponse),
|
|
52634
|
+
error: message,
|
|
52635
|
+
...rejection ? { order_diagnostics: rejection.orderDiagnostics } : {}
|
|
52604
52636
|
}
|
|
52605
52637
|
});
|
|
52606
52638
|
appendRuntimeDebugEvent({
|