@vtxmacro/cli 2026.9.9 → 2026.9.11

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.
@@ -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.9",
19
+ package_version: "2026.9.11",
20
20
  codex_package_name: "@openai/codex",
21
21
  codex_version: "0.147.0",
22
22
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -1088,27 +1088,16 @@ var defaultRunCommand = async (command, args) => await new Promise((resolvePromi
1088
1088
  stderr: Buffer.concat(stderr).toString("utf8")
1089
1089
  }));
1090
1090
  });
1091
- var encodedPowerShell = (script) => [
1092
- "-NoLogo",
1093
- "-NoProfile",
1094
- "-NonInteractive",
1095
- "-EncodedCommand",
1096
- Buffer.from(script, "utf16le").toString("base64")
1097
- ];
1098
1091
  var runInferenceHostBootstrapNpmCommand = async (executable, args, platform = process.platform, runCommand = defaultRunCommand) => {
1099
- const npmPath = platform === "win32" ? windowsPath2.join(windowsPath2.dirname(executable), "npm.cmd") : join2(dirname2(executable), "npm");
1100
- if (platform !== "win32") return await runCommand(npmPath, args);
1101
- const payload = Buffer.from(JSON.stringify({ command: npmPath, args }), "utf16le").toString("base64");
1102
- const script = [
1103
- "$ErrorActionPreference='Stop'",
1104
- `$payload='${payload}'`,
1105
- "$request=[Text.Encoding]::Unicode.GetString([Convert]::FromBase64String($payload)) | ConvertFrom-Json",
1106
- "& ([string]$request.command) @($request.args | ForEach-Object { [string]$_ })",
1107
- "$code=$LASTEXITCODE",
1108
- "if($null -eq $code){$code=1}",
1109
- "exit $code"
1110
- ].join(";");
1111
- return await runCommand("powershell.exe", encodedPowerShell(script));
1092
+ if (platform !== "win32") return await runCommand(join2(dirname2(executable), "npm"), args);
1093
+ const npmScript = windowsPath2.join(
1094
+ windowsPath2.dirname(executable),
1095
+ "node_modules",
1096
+ "npm",
1097
+ "bin",
1098
+ "npm-cli.js"
1099
+ );
1100
+ return await runCommand(executable, [npmScript, ...args]);
1112
1101
  };
1113
1102
  var defaultRunSupervisor = (executable, args) => {
1114
1103
  const child = spawn2(executable, [...args], {
package/bin/vtx.js CHANGED
@@ -47,7 +47,7 @@ var init_agent_cli_release = __esm({
47
47
  "agent-cli-release.json"() {
48
48
  agent_cli_release_default = {
49
49
  package_name: "@vtxmacro/cli",
50
- package_version: "2026.9.9",
50
+ package_version: "2026.9.11",
51
51
  codex_package_name: "@openai/codex",
52
52
  codex_version: "0.147.0",
53
53
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -21363,7 +21363,7 @@ child.once('close', async (code, signal) => {
21363
21363
  retryable: true
21364
21364
  }));
21365
21365
  }, Math.max(1, options.timeoutMs));
21366
- if (options.signal) {
21366
+ if (options.signal && !options.retainResponseOnAbort) {
21367
21367
  const onAbort = () => {
21368
21368
  this.pending.delete(id2);
21369
21369
  this.retireResponseId(id2, method);
@@ -21833,7 +21833,12 @@ child.once('close', async (code, signal) => {
21833
21833
  }
21834
21834
  }, {
21835
21835
  timeoutMs: Math.max(1, options.deadlineAtMs - Date.now()),
21836
- signal: options.signal
21836
+ signal: options.signal,
21837
+ // Thread creation does not dispatch inference, but it can persist prompt
21838
+ // bytes. Keep its exact reply correlated after cancellation so we can
21839
+ // validate and delete the thread before reporting cleanup. The original
21840
+ // RPC deadline still bounds setup; turn/start keeps normal cancellation.
21841
+ retainResponseOnAbort: true
21837
21842
  });
21838
21843
  const thread = objectOrNull(result2.thread);
21839
21844
  const permission = objectOrNull(result2.activePermissionProfile);
@@ -21852,6 +21857,15 @@ child.once('close', async (code, signal) => {
21852
21857
  });
21853
21858
  }
21854
21859
  this.threads.set(threadId, resolvedThreadPath);
21860
+ if (options.signal?.aborted || Date.now() >= options.deadlineAtMs) {
21861
+ await this.deleteThread(threadId);
21862
+ throw new CodexAppServerError({
21863
+ message: "Codex thread setup ended before inference dispatch.",
21864
+ category: options.signal?.aborted ? "cancelled" : "timeout",
21865
+ code: options.signal?.aborted ? "cancelled" : "deadline_exceeded",
21866
+ retryable: false
21867
+ });
21868
+ }
21855
21869
  return {
21856
21870
  threadId,
21857
21871
  threadPath: resolvedThreadPath,
@@ -42531,7 +42545,7 @@ var init_network_debug = __esm({
42531
42545
  });
42532
42546
 
42533
42547
  // lib/runtime/hyperliquid-account-state-adapter.ts
42534
- 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, INFO_RATE_LIMIT_COOLDOWN_STORAGE_PREFIX, INFO_RATE_LIMIT_COOLDOWN_MIN_MS, INFO_RATE_LIMIT_COOLDOWN_MAX_MS, browserUserFillsCache, browserUserFillsInFlight, HYPERLIQUID_USER_FILLS_PROVIDER_PAGE_CAP, browserAccountStateCache, browserAccountStateInFlight, browserInfoRateLimitCooldowns, UNSUPPORTED_USER_ACTIVE_ASSET_DETAIL_PATTERNS, unsupportedUserActiveAssetCacheHydrated, hydrateUnsupportedUserActiveAssetCache, persistUnsupportedUserActiveAssetCache, toPositiveFinite, toFinite, firstFiniteNumber, parseFundingUsdcFromInfoPosition, buildActiveAssetCacheKey, buildUserFillsCacheKey, buildUserFillsStorageKey, buildAccountStateCacheKey, buildAccountStateStorageKey, normalizeInfoRateLimitApiUrl, normalizeInfoRequestType, buildInfoRateLimitCooldownKey, buildInfoRateLimitCooldownStorageKey, readInfoRateLimitCooldownUntilMs, hasActiveInfoRateLimitCooldown, writeInfoRateLimitCooldown, extractInfoRequestTypeFromRateLimitError, recordInfoRateLimitCooldownFromError, requireNonNegativeConfigSeconds, requireAccountStateCacheConfig, requireUserFillsCacheConfig, normalizeFillSymbol, buildSymbolFilter, filterFillsBySymbols, readBrowserUserFillsCache, writeBrowserUserFillsCache, cloneBrowserAccountStateResult, readBrowserAccountStateCache, writeBrowserAccountStateCache, isRateLimitError, createAbortError, waitForSharedBrowserRequest, waitForSharedBrowserUserFills, getBrowserActiveAssetTypeCandidates, normalizeHyperliquidErrorDetail, isUnsupportedUserActiveAssetError, rememberUnsupportedUserActiveAssetKey, parseInfoPositions, requireFinitePromptMetric, requirePromptClearinghouseState, requirePromptSpotState, normalizePerpDexName, listConfiguredPerpDexs, listPerpDexsForAccountState, prefixHip3PositionCoins, aggregateClearinghouseResponses, normalizeBrowserFillToTradeHistory, isPerpFill, fetchHyperliquidInfoPayload, requireHyperliquidApiUrl, requireWalletAddress, parseInfoPositionSnapshot, fetchBrowserAccountState, fetchBrowserAccountStateUncached, fetchBrowserUserFills, fetchBrowserPositionSnapshot;
42548
+ 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, INFO_RATE_LIMIT_COOLDOWN_STORAGE_PREFIX, INFO_RATE_LIMIT_COOLDOWN_MIN_MS, INFO_RATE_LIMIT_COOLDOWN_MAX_MS, browserUserFillsCache, browserUserFillsInFlight, HYPERLIQUID_USER_FILLS_PROVIDER_PAGE_CAP, browserAccountStateCache, browserAccountStateInFlight, browserInfoRateLimitCooldowns, UNSUPPORTED_USER_ACTIVE_ASSET_DETAIL_PATTERNS, unsupportedUserActiveAssetCacheHydrated, hydrateUnsupportedUserActiveAssetCache, persistUnsupportedUserActiveAssetCache, toPositiveFinite, toFinite, firstFiniteNumber, parseFundingUsdcFromInfoPosition, buildActiveAssetCacheKey, buildUserFillsCacheKey, buildUserFillsStorageKey, buildAccountStateCacheKey, buildAccountStateStorageKey, normalizeInfoRateLimitApiUrl, normalizeInfoRequestType, buildInfoRateLimitCooldownKey, buildInfoRateLimitCooldownStorageKey, readInfoRateLimitCooldownUntilMs, hasActiveInfoRateLimitCooldown, writeInfoRateLimitCooldown, extractInfoRequestTypeFromRateLimitError, recordInfoRateLimitCooldownFromError, 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, normalizeBrowserFillToTradeHistory, isPerpFill, fetchHyperliquidInfoPayload, requireHyperliquidApiUrl, requireWalletAddress, parseInfoPositionSnapshot, fetchBrowserAccountState, fetchBrowserAccountStateUncached, fetchBrowserUserFills, fetchBrowserPositionSnapshot;
42535
42549
  var init_hyperliquid_account_state_adapter = __esm({
42536
42550
  "lib/runtime/hyperliquid-account-state-adapter.ts"() {
42537
42551
  "use strict";
@@ -42871,12 +42885,26 @@ var init_hyperliquid_account_state_adapter = __esm({
42871
42885
  }
42872
42886
  };
42873
42887
  cloneBrowserAccountStateResult = (result2) => ({
42888
+ ...result2.evidence ? { evidence: { ...result2.evidence } } : {},
42874
42889
  accountSummary: { ...result2.accountSummary },
42875
42890
  availableToTrade: { ...result2.availableToTrade },
42876
42891
  positions: result2.positions.map((position) => ({ ...position })),
42877
42892
  ...result2.takerRate == null ? {} : { takerRate: result2.takerRate },
42878
42893
  ...result2.promptRescueEvidence == null ? {} : { promptRescueEvidence: { ...result2.promptRescueEvidence } }
42879
42894
  });
42895
+ withAccountStateEvidence = (result2, source, fetchedAtMs, freshnessLimitMs) => {
42896
+ const observedAtMs = Date.now();
42897
+ return {
42898
+ ...cloneBrowserAccountStateResult(result2),
42899
+ evidence: {
42900
+ source,
42901
+ fetchedAtMs,
42902
+ observedAtMs,
42903
+ cacheAgeMs: Math.max(0, observedAtMs - fetchedAtMs),
42904
+ freshnessLimitMs
42905
+ }
42906
+ };
42907
+ };
42880
42908
  readBrowserAccountStateCache = (cacheKey) => {
42881
42909
  const memoryEntry = browserAccountStateCache.get(cacheKey);
42882
42910
  if (memoryEntry) {
@@ -43355,7 +43383,7 @@ var init_hyperliquid_account_state_adapter = __esm({
43355
43383
  const now = Date.now();
43356
43384
  const cached2 = readBrowserAccountStateCache(cacheKey);
43357
43385
  if (!input.forceRefresh && cached2 && now - cached2.fetchedAtMs <= ttlMs) {
43358
- return cloneBrowserAccountStateResult(cached2.result);
43386
+ return withAccountStateEvidence(cached2.result, "cache", cached2.fetchedAtMs, ttlMs);
43359
43387
  }
43360
43388
  if (!input.forceRefresh && cached2 && now - cached2.fetchedAtMs <= staleIf429MaxAgeMs && hasActiveInfoRateLimitCooldown(apiUrl, [
43361
43389
  "clearinghouseState",
@@ -43364,7 +43392,7 @@ var init_hyperliquid_account_state_adapter = __esm({
43364
43392
  ...includeExactAccountMode ? ["userAbstraction", "userDexAbstraction"] : [],
43365
43393
  ...includeActiveAssetData ? activeAssetRequestTypes : []
43366
43394
  ], now)) {
43367
- return cloneBrowserAccountStateResult(cached2.result);
43395
+ return withAccountStateEvidence(cached2.result, "stale_if_429", cached2.fetchedAtMs, staleIf429MaxAgeMs);
43368
43396
  }
43369
43397
  let inFlight = input.forceRefresh ? void 0 : browserAccountStateInFlight.get(cacheKey);
43370
43398
  if (!inFlight) {
@@ -43380,11 +43408,9 @@ var init_hyperliquid_account_state_adapter = __esm({
43380
43408
  dexNames,
43381
43409
  staleIf429MaxAgeMs
43382
43410
  }).then((result2) => {
43383
- writeBrowserAccountStateCache(cacheKey, {
43384
- fetchedAtMs: Date.now(),
43385
- result: result2
43386
- });
43387
- return cloneBrowserAccountStateResult(result2);
43411
+ const fetchedAtMs = Date.now();
43412
+ writeBrowserAccountStateCache(cacheKey, { fetchedAtMs, result: result2 });
43413
+ return withAccountStateEvidence(result2, "live", fetchedAtMs, null);
43388
43414
  }).finally(() => {
43389
43415
  if (!input.forceRefresh) {
43390
43416
  browserAccountStateInFlight.delete(cacheKey);
@@ -43404,7 +43430,7 @@ var init_hyperliquid_account_state_adapter = __esm({
43404
43430
  recordInfoRateLimitCooldownFromError(apiUrl, error48, staleIf429MaxAgeMs);
43405
43431
  const staleCache = readBrowserAccountStateCache(cacheKey);
43406
43432
  if (!input.forceRefresh && isRateLimitError(error48) && staleCache && Date.now() - staleCache.fetchedAtMs <= staleIf429MaxAgeMs) {
43407
- return cloneBrowserAccountStateResult(staleCache.result);
43433
+ return withAccountStateEvidence(staleCache.result, "stale_if_429", staleCache.fetchedAtMs, staleIf429MaxAgeMs);
43408
43434
  }
43409
43435
  throw error48;
43410
43436
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.9",
3
+ "version": "2026.9.11",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",