@vtxmacro/cli 2026.8.13 → 2026.8.15

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.
Files changed (2) hide show
  1. package/bin/vtx.js +100 -32
  2. package/package.json +1 -1
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.13",
41
+ package_version: "2026.8.15",
42
42
  codex_package_name: "@openai/codex",
43
43
  codex_version: "0.147.0",
44
44
  platforms: {
@@ -17267,7 +17267,7 @@ var init_mcp_client = __esm({
17267
17267
  if (!host) return invalidBoundResult(name);
17268
17268
  if (host.host_id !== request.host_id || host.host_generation !== request.host_generation || host.advertisement_generation !== request.advertisement_generation || host.key_generation !== request.key_generation || request.adapter !== void 0 && host.adapter !== request.adapter) invalidBoundResult(name);
17269
17269
  if (name !== "inference.host.heartbeat") {
17270
- if (host.display_name !== request.display_name || (host.authenticated_account_email ?? null) !== (request.authenticated_account_email ?? null) || (host.authenticated_account_plan ?? null) !== (request.authenticated_account_plan ?? null) || !exactJson(host.models, request.models) || host.status === "revoked") invalidBoundResult(name);
17270
+ if (host.display_name !== request.display_name || host.authenticated_account_email !== void 0 && host.authenticated_account_email !== null && host.authenticated_account_email !== request.authenticated_account_email || (host.authenticated_account_plan ?? null) !== (request.authenticated_account_plan ?? null) || !exactJson(host.models, request.models) || host.status === "revoked") invalidBoundResult(name);
17271
17271
  return;
17272
17272
  }
17273
17273
  const expectedStatus = request.status === "healthy" ? "online" : request.status;
@@ -18504,7 +18504,7 @@ var init_agent_state = __esm({
18504
18504
 
18505
18505
  // lib/inference-host/codex-app-server.ts
18506
18506
  import { spawn as spawn2 } from "node:child_process";
18507
- import { chmod, lstat as lstat2, readFile as readFile2, rename as rename2, writeFile } from "node:fs/promises";
18507
+ import { chmod, lstat as lstat2, readFile as readFile2, rename as rename2, rm as rm2, writeFile } from "node:fs/promises";
18508
18508
  import { tmpdir } from "node:os";
18509
18509
  import { isAbsolute, join as join2, resolve as resolve2, sep } from "node:path";
18510
18510
  import { createInterface } from "node:readline";
@@ -18568,7 +18568,7 @@ async function logoutCodexSubscription(options) {
18568
18568
  await session.close();
18569
18569
  }
18570
18570
  }
18571
- var CODEX_INFERENCE_PERMISSION_PROFILE, CODEX_ACCOUNT_PLAN_TYPES, CodexAppServerError, objectOrNull, finiteToken, tokenUsageFromBreakdown, usageFromNotification, validPlanType, nonnegativeSafeIntegerOrNull, nonnegativeFiniteNumberOrNull, parseRateLimitWindow, RATE_LIMIT_REACHED_TYPES, DEFAULT_CODEX_QUOTA_COOLDOWN_MS, MAX_CODEX_QUOTA_COOLDOWN_MS, CODEX_TRANSIENT_RATE_LIMIT_COOLDOWN_MS, parseRateLimitSnapshot, codexRateLimitRetryAtMs, codexAccountRateLimitReached, forbiddenMethod, forbiddenTerminalItem, classifyCodexTurnFailure, scrubbedCodexEnvironment, killWindowsProcessTree, appServerArgs, GUARDIAN_SCRIPT, writeCodexGuardianSpawnIntent, parseGuardianReceipt, readCodexGuardianReceipt, waitForCodexGuardianState, defaultSpawn, CodexAppServerSession;
18571
+ var CODEX_INFERENCE_PERMISSION_PROFILE, CODEX_ACCOUNT_PLAN_TYPES, CodexAppServerError, objectOrNull, finiteToken, tokenUsageFromBreakdown, usageFromNotification, validPlanType, nonnegativeSafeIntegerOrNull, nonnegativeFiniteNumberOrNull, parseRateLimitWindow, RATE_LIMIT_REACHED_TYPES, DEFAULT_CODEX_QUOTA_COOLDOWN_MS, MAX_CODEX_QUOTA_COOLDOWN_MS, CODEX_TRANSIENT_RATE_LIMIT_COOLDOWN_MS, parseRateLimitSnapshot, codexRateLimitRetryAtMs, codexAccountRateLimitReached, forbiddenMethod, forbiddenTerminalItem, classifyCodexTurnFailure, scrubbedCodexEnvironment, killWindowsProcessTree, appServerArgs, GUARDIAN_SCRIPT, WINDOWS_RECEIPT_REPLACE_ERROR_CODES, replaceCodexGuardianReceiptFile, writeCodexGuardianSpawnIntent, parseGuardianReceipt, readCodexGuardianReceipt, waitForCodexGuardianState, defaultSpawn, CodexAppServerSession;
18572
18572
  var init_codex_app_server = __esm({
18573
18573
  "lib/inference-host/codex-app-server.ts"() {
18574
18574
  "use strict";
@@ -18864,25 +18864,58 @@ var init_codex_app_server = __esm({
18864
18864
  };
18865
18865
  GUARDIAN_SCRIPT = String.raw`
18866
18866
  import { spawn } from 'node:child_process';
18867
- import { chmod, rename, writeFile } from 'node:fs/promises';
18867
+ import { chmod, rename, rm, writeFile } from 'node:fs/promises';
18868
18868
  const input = JSON.parse(Buffer.from(process.argv[1], 'base64url').toString('utf8'));
18869
18869
  // The guardian owns the process boundary for every attempt. Apply a private
18870
18870
  // umask before writing receipts or starting Codex so a lost thread/start reply
18871
18871
  // still leaves traversable 0700 directories and removable 0600 rollout files.
18872
18872
  process.umask(0o077);
18873
- const writeReceipt = async (state, childPid) => {
18874
- const body = JSON.stringify({
18875
- schema_version: 'vtx_codex_guardian_v1',
18876
- process_token: input.processToken,
18877
- state,
18878
- guardian_pid: process.pid,
18879
- child_pid: childPid ?? null,
18880
- updated_at: new Date().toISOString(),
18881
- }) + '\n';
18882
- const temporary = input.receiptPath + '.tmp-' + process.pid;
18883
- await writeFile(temporary, body, { mode: 0o600 });
18884
- await chmod(temporary, 0o600).catch(() => undefined);
18885
- await rename(temporary, input.receiptPath);
18873
+ const replaceReceipt = async (temporary) => {
18874
+ const retryableWindowsCodes = new Set(['EACCES', 'EBUSY', 'EEXIST', 'ENOTEMPTY', 'EPERM']);
18875
+ for (let attempt = 0; attempt < 40; attempt += 1) {
18876
+ try {
18877
+ await rename(temporary, input.receiptPath);
18878
+ return;
18879
+ } catch (error) {
18880
+ if (
18881
+ process.platform !== 'win32'
18882
+ || !retryableWindowsCodes.has(String(error?.code || ''))
18883
+ || attempt === 39
18884
+ ) throw error;
18885
+ try {
18886
+ await rm(input.receiptPath, { force: true });
18887
+ } catch (removeError) {
18888
+ if (!retryableWindowsCodes.has(String(removeError?.code || ''))) throw removeError;
18889
+ }
18890
+ await new Promise((resolve) => setTimeout(resolve, 25));
18891
+ }
18892
+ }
18893
+ };
18894
+ let receiptWriteSequence = 0;
18895
+ let receiptWriteChain = Promise.resolve();
18896
+ const writeReceipt = (state, childPid) => {
18897
+ const write = async () => {
18898
+ const body = JSON.stringify({
18899
+ schema_version: 'vtx_codex_guardian_v1',
18900
+ process_token: input.processToken,
18901
+ state,
18902
+ guardian_pid: process.pid,
18903
+ child_pid: childPid ?? null,
18904
+ updated_at: new Date().toISOString(),
18905
+ }) + '\n';
18906
+ receiptWriteSequence += 1;
18907
+ const temporary = input.receiptPath + '.tmp-' + process.pid + '-' + receiptWriteSequence;
18908
+ try {
18909
+ await writeFile(temporary, body, { mode: 0o600 });
18910
+ await chmod(temporary, 0o600).catch(() => undefined);
18911
+ await replaceReceipt(temporary);
18912
+ } finally {
18913
+ await rm(temporary, { force: true }).catch(() => undefined);
18914
+ }
18915
+ };
18916
+ const scheduled = receiptWriteChain.then(write, write);
18917
+ receiptWriteChain = scheduled.catch(() => undefined);
18918
+ return scheduled;
18886
18919
  };
18887
18920
  let child = null;
18888
18921
  let shuttingDown = false;
@@ -18932,6 +18965,41 @@ child.once('close', async () => {
18932
18965
  }
18933
18966
  });
18934
18967
  `;
18968
+ WINDOWS_RECEIPT_REPLACE_ERROR_CODES = /* @__PURE__ */ new Set([
18969
+ "EACCES",
18970
+ "EBUSY",
18971
+ "EEXIST",
18972
+ "ENOTEMPTY",
18973
+ "EPERM"
18974
+ ]);
18975
+ replaceCodexGuardianReceiptFile = async (temporaryPath, receiptPath, options = {}) => {
18976
+ const platform = options.platform ?? process.platform;
18977
+ const renameFile = options.renameFile ?? rename2;
18978
+ const removeFile = options.removeFile ?? ((path) => rm2(path, { force: true }));
18979
+ const sleep4 = options.sleep ?? ((milliseconds) => new Promise((resolve5) => setTimeout(resolve5, milliseconds)));
18980
+ const maxAttempts = Math.max(1, options.maxAttempts ?? 40);
18981
+ const retryDelayMs = Math.max(0, options.retryDelayMs ?? 25);
18982
+ for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
18983
+ try {
18984
+ await renameFile(temporaryPath, receiptPath);
18985
+ return;
18986
+ } catch (error48) {
18987
+ const code = String(error48.code ?? "");
18988
+ if (platform !== "win32" || !WINDOWS_RECEIPT_REPLACE_ERROR_CODES.has(code) || attempt === maxAttempts - 1) {
18989
+ throw error48;
18990
+ }
18991
+ try {
18992
+ await removeFile(receiptPath);
18993
+ } catch (removeError) {
18994
+ const removeCode = String(removeError.code ?? "");
18995
+ if (!WINDOWS_RECEIPT_REPLACE_ERROR_CODES.has(removeCode)) {
18996
+ throw removeError;
18997
+ }
18998
+ }
18999
+ await sleep4(retryDelayMs);
19000
+ }
19001
+ }
19002
+ };
18935
19003
  writeCodexGuardianSpawnIntent = async (guardian) => {
18936
19004
  const body = `${JSON.stringify({
18937
19005
  schema_version: "vtx_codex_guardian_v1",
@@ -18945,7 +19013,7 @@ child.once('close', async () => {
18945
19013
  const temporary = `${guardian.receiptPath}.intent-${process.pid}`;
18946
19014
  await writeFile(temporary, body, { mode: 384 });
18947
19015
  await chmod(temporary, 384).catch(() => void 0);
18948
- await rename2(temporary, guardian.receiptPath);
19016
+ await replaceCodexGuardianReceiptFile(temporary, guardian.receiptPath);
18949
19017
  };
18950
19018
  parseGuardianReceipt = (raw) => {
18951
19019
  const value = JSON.parse(raw);
@@ -20217,7 +20285,7 @@ import {
20217
20285
  readdir,
20218
20286
  readFile as readFile4,
20219
20287
  realpath as realpath3,
20220
- rm as rm2
20288
+ rm as rm3
20221
20289
  } from "node:fs/promises";
20222
20290
  import { randomBytes as randomBytes3 } from "node:crypto";
20223
20291
  import { tmpdir as tmpdir2 } from "node:os";
@@ -20404,7 +20472,7 @@ var init_codex_adapter = __esm({
20404
20472
  codexHome,
20405
20473
  workspacePath,
20406
20474
  cleanup: async () => {
20407
- await rm2(root, { recursive: true, force: false });
20475
+ await rm3(root, { recursive: true, force: false });
20408
20476
  }
20409
20477
  };
20410
20478
  };
@@ -20425,12 +20493,12 @@ var init_codex_adapter = __esm({
20425
20493
  codexHome,
20426
20494
  workspacePath,
20427
20495
  cleanup: async () => {
20428
- await rm2(workspacePath, { recursive: true, force: false });
20496
+ await rm3(workspacePath, { recursive: true, force: false });
20429
20497
  }
20430
20498
  };
20431
20499
  },
20432
20500
  cleanup: async () => {
20433
- await rm2(root, { recursive: true, force: false });
20501
+ await rm3(root, { recursive: true, force: false });
20434
20502
  }
20435
20503
  };
20436
20504
  };
@@ -20635,7 +20703,7 @@ var init_codex_adapter = __esm({
20635
20703
  if (!state.isFile() || state.isSymbolicLink() || typeof process.getuid === "function" && state.uid !== process.getuid()) {
20636
20704
  throw new Error("Codex recovery thread file is not private.");
20637
20705
  }
20638
- await rm2(threadPath, { force: false });
20706
+ await rm3(threadPath, { force: false });
20639
20707
  } catch (error48) {
20640
20708
  if (error48.code !== "ENOENT") throw error48;
20641
20709
  }
@@ -20681,7 +20749,7 @@ var init_codex_adapter = __esm({
20681
20749
  );
20682
20750
  assertRecoveryResourceScope(checkpoint);
20683
20751
  await removeRecoveredThread(checkpoint, options.codexHome);
20684
- await rm2(checkpoint.resourceRoot, { recursive: true, force: true });
20752
+ await rm3(checkpoint.resourceRoot, { recursive: true, force: true });
20685
20753
  await options.recoveryHooks.save({
20686
20754
  ...checkpoint,
20687
20755
  processState: "terminated",
@@ -20753,7 +20821,7 @@ var init_codex_adapter = __esm({
20753
20821
  dispatchOutcome: checkpoint.dispatchOutcome
20754
20822
  });
20755
20823
  }
20756
- await rm2(checkpoint.processReceiptPath, { force: true });
20824
+ await rm3(checkpoint.processReceiptPath, { force: true });
20757
20825
  }
20758
20826
  await recoveryHooks.clear(attemptId);
20759
20827
  }
@@ -28075,7 +28143,7 @@ var init_runner = __esm({
28075
28143
  };
28076
28144
  assertAdvertisementResult = (advertisement, result2) => {
28077
28145
  const host = result2.host;
28078
- if (host.host_id !== advertisement.host_id || host.host_generation !== advertisement.host_generation || host.advertisement_generation !== advertisement.advertisement_generation || host.key_generation !== advertisement.key_generation || host.display_name !== advertisement.display_name || (host.authenticated_account_email ?? null) !== (advertisement.authenticated_account_email ?? null) || (host.authenticated_account_plan ?? null) !== (advertisement.authenticated_account_plan ?? null) || host.adapter !== advertisement.adapter || host.status === "revoked" || !exactJson2(host.models, advertisement.models)) runnerIdentityMismatch("Host advertisement");
28146
+ if (host.host_id !== advertisement.host_id || host.host_generation !== advertisement.host_generation || host.advertisement_generation !== advertisement.advertisement_generation || host.key_generation !== advertisement.key_generation || host.display_name !== advertisement.display_name || host.authenticated_account_email !== void 0 && host.authenticated_account_email !== null && host.authenticated_account_email !== advertisement.authenticated_account_email || (host.authenticated_account_plan ?? null) !== (advertisement.authenticated_account_plan ?? null) || host.adapter !== advertisement.adapter || host.status === "revoked" || !exactJson2(host.models, advertisement.models)) runnerIdentityMismatch("Host advertisement");
28079
28147
  };
28080
28148
  assertHostHeartbeatResult = (request, result2, allowOfflineProjection = false) => {
28081
28149
  const expectedStatus = request.status === "healthy" ? "online" : request.status;
@@ -29139,7 +29207,7 @@ __export(cli_exports, {
29139
29207
  });
29140
29208
  import { randomUUID } from "node:crypto";
29141
29209
  import { spawn as spawn4 } from "node:child_process";
29142
- import { lstat as lstat4, realpath as realpath4, rm as rm3 } from "node:fs/promises";
29210
+ import { lstat as lstat4, realpath as realpath4, rm as rm4 } from "node:fs/promises";
29143
29211
  import { join as join5, resolve as resolve4 } from "node:path";
29144
29212
  async function runInferenceHostCli(argv2, env = process.env, dependencies = {}) {
29145
29213
  const warnings = [];
@@ -29501,7 +29569,7 @@ private-file fallback. See https://vtxmacro.com/insights#subscription-inference.
29501
29569
  runtimeReceiptPath(config2),
29502
29570
  "Inference host runtime receipt file"
29503
29571
  );
29504
- await rm3(codexGuardianReceiptRoot(config2), { recursive: true, force: true });
29572
+ await rm4(codexGuardianReceiptRoot(config2), { recursive: true, force: true });
29505
29573
  await clearInferencePrivateFile(
29506
29574
  codexRecoveryPath(config2),
29507
29575
  "Codex attempt recovery file"
@@ -30523,7 +30591,7 @@ Waiting for approval...
30523
30591
  });
30524
30592
 
30525
30593
  // lib/agent-core/config.ts
30526
- import { mkdir as mkdir3, readFile as readFile5, rm as rm4, writeFile as writeFile2 } from "node:fs/promises";
30594
+ import { mkdir as mkdir3, readFile as readFile5, rm as rm5, writeFile as writeFile2 } from "node:fs/promises";
30527
30595
  import { dirname as dirname3, join as join6 } from "node:path";
30528
30596
  import { homedir as homedir2 } from "node:os";
30529
30597
  function defaultBaseDir() {
@@ -30567,7 +30635,7 @@ async function writeStoredAgentAuth(path, auth) {
30567
30635
  `, { encoding: "utf8", mode: 384 });
30568
30636
  }
30569
30637
  async function clearStoredAgentAuth(path) {
30570
- await rm4(path, { force: true });
30638
+ await rm5(path, { force: true });
30571
30639
  }
30572
30640
  async function readRuntimeState(path) {
30573
30641
  try {
@@ -30600,7 +30668,7 @@ async function writeRuntimeState(path, state) {
30600
30668
  `, { encoding: "utf8", mode: 384 });
30601
30669
  }
30602
30670
  async function clearRuntimeState(path) {
30603
- await rm4(path, { force: true });
30671
+ await rm5(path, { force: true });
30604
30672
  }
30605
30673
  var init_config2 = __esm({
30606
30674
  "lib/agent-core/config.ts"() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.8.13",
3
+ "version": "2026.8.15",
4
4
  "description": "VTX Macro CLI, MCP server, and foreground subscription inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",