@vtxmacro/cli 2026.10.4 → 2026.10.5

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire as __vtxCreateRequire } from 'node:module'; const require = __vtxCreateRequire(import.meta.url);
2
3
 
3
4
  // lib/agent-core/client.ts
4
5
  import { randomUUID } from "node:crypto";
@@ -90,6 +91,14 @@ var VtxAgentClient = class _VtxAgentClient {
90
91
  this.activeProfileId = config.activeProfileId ?? null;
91
92
  this.fetchImpl = config.fetchImpl ?? fetch;
92
93
  }
94
+ /** How shared web runtime code (lib/api.ts) reaches the API as this client. */
95
+ apiTransport() {
96
+ const token = this.token;
97
+ return {
98
+ baseUrl: this.apiUrl,
99
+ authorization: () => token ? `Bearer ${token}` : null
100
+ };
101
+ }
93
102
  async request(path, options = {}) {
94
103
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
95
104
  const headers = {
@@ -221,44 +230,6 @@ var VtxAgentClient = class _VtxAgentClient {
221
230
  headers: { "x-client-runtime-lease": leaseToken }
222
231
  });
223
232
  }
224
- getRuntimeSecrets(profileId, leaseToken, options = {}) {
225
- const params = new URLSearchParams();
226
- if (options.activeProvider) {
227
- params.set("active_provider", options.activeProvider);
228
- }
229
- if (typeof options.includeAllProviderKeys === "boolean") {
230
- params.set("include_all_provider_keys", String(options.includeAllProviderKeys));
231
- }
232
- const query = params.toString();
233
- return this.request(`/auth/me/client-runtime-secrets${query ? `?${query}` : ""}`, {
234
- profileId,
235
- headers: { "x-client-runtime-lease": leaseToken }
236
- });
237
- }
238
- getRuntimePromptContractMetadata(profileId, payload, leaseToken) {
239
- return this.request("/trading/ai/runtime/prompt-contract/metadata", {
240
- method: "POST",
241
- profileId,
242
- headers: { "x-client-runtime-lease": leaseToken },
243
- body: payload
244
- });
245
- }
246
- getRuntimePromptContractDerivedContext(profileId, payload, leaseToken) {
247
- return this.request("/trading/ai/runtime/prompt-contract/derived-context", {
248
- method: "POST",
249
- profileId,
250
- headers: { "x-client-runtime-lease": leaseToken },
251
- body: payload
252
- });
253
- }
254
- getRuntimePrompt(profileId, payload, leaseToken) {
255
- return this.request("/trading/ai/runtime/prompt", {
256
- method: "POST",
257
- profileId,
258
- headers: { "x-client-runtime-lease": leaseToken },
259
- body: payload
260
- });
261
- }
262
233
  getLlmConfig(profileId) {
263
234
  return this.request("/llm/config", { profileId });
264
235
  }
@@ -270,42 +241,6 @@ var VtxAgentClient = class _VtxAgentClient {
270
241
  body: payload
271
242
  });
272
243
  }
273
- reportRuntimeDecision(profileId, payload, leaseToken) {
274
- return this.request("/trading/ai/runtime/decision", {
275
- method: "POST",
276
- profileId,
277
- idempotencyKey: randomUUID(),
278
- headers: { "x-client-runtime-lease": leaseToken },
279
- body: payload
280
- });
281
- }
282
- // Client Mode history pages this host read for the server's heartbeat asks.
283
- reportRuntimeHistoryEvidence(profileId, payload, leaseToken) {
284
- return this.request("/trading/ai/runtime/history-evidence", {
285
- method: "POST",
286
- profileId,
287
- headers: { "x-client-runtime-lease": leaseToken },
288
- body: payload
289
- });
290
- }
291
- reportRuntimeTradeSync(profileId, payload, leaseToken) {
292
- return this.request("/trading/ai/runtime/trade-sync", {
293
- method: "POST",
294
- profileId,
295
- idempotencyKey: randomUUID(),
296
- headers: { "x-client-runtime-lease": leaseToken },
297
- body: payload
298
- });
299
- }
300
- reportRuntimeError(profileId, payload, leaseToken) {
301
- return this.request("/trading/ai/runtime/error", {
302
- method: "POST",
303
- profileId,
304
- idempotencyKey: randomUUID(),
305
- headers: { "x-client-runtime-lease": leaseToken },
306
- body: payload
307
- });
308
- }
309
244
  getTradeHistory(profileId) {
310
245
  return this.request("/trading/ai/history", { profileId });
311
246
  }
@@ -418,7 +353,7 @@ function createAgentClient(config) {
418
353
  }
419
354
 
420
355
  // lib/agent-core/config.ts
421
- import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
356
+ import { mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
422
357
  import { dirname, join } from "node:path";
423
358
  import { homedir } from "node:os";
424
359
  function defaultBaseDir() {
@@ -428,10 +363,12 @@ function resolveAgentCliConfig(env = process.env) {
428
363
  const baseDir = String(env.VTX_HOME || "").trim() || defaultBaseDir();
429
364
  const rawProfile = String(env.VTX_PROFILE_ID || "").trim();
430
365
  const parsedProfile = rawProfile ? Number(rawProfile) : NaN;
366
+ const explicitStatePath = String(env.VTX_RUNTIME_STATE_PATH || "").trim();
431
367
  return {
432
368
  apiUrl: String(env.VTX_API_URL || "http://localhost:8000").replace(/\/+$/, ""),
433
369
  tokenPath: String(env.VTX_TOKEN_PATH || "").trim() || join(baseDir, "token.json"),
434
- statePath: String(env.VTX_RUNTIME_STATE_PATH || "").trim() || join(baseDir, "runtime-state.json"),
370
+ statePath: explicitStatePath || join(baseDir, "runtime-state.json"),
371
+ runtimeStateDir: explicitStatePath ? null : baseDir,
435
372
  runtimeDeviceId: String(env.VTX_RUNTIME_DEVICE_ID || "").trim() || null,
436
373
  activeProfileId: Number.isFinite(parsedProfile) && parsedProfile > 0 ? parsedProfile : null,
437
374
  outputJson: String(env.VTX_OUTPUT || "").trim().toLowerCase() === "json"
@@ -1,3 +1,5 @@
1
+ import { createRequire as __vtxCreateRequire } from 'node:module'; const require = __vtxCreateRequire(import.meta.url);
2
+
1
3
  // lib/inference-host/service-bootstrap.ts
2
4
  import { spawn as spawn2 } from "node:child_process";
3
5
  import { createHash, randomUUID } from "node:crypto";
@@ -16,7 +18,7 @@ import { fileURLToPath } from "node:url";
16
18
  // agent-cli-release.json
17
19
  var agent_cli_release_default = {
18
20
  package_name: "@vtxmacro/cli",
19
- package_version: "2026.10.4",
21
+ package_version: "2026.10.5",
20
22
  codex_package_name: "@openai/codex",
21
23
  codex_version: "0.155.0",
22
24
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -1,3 +1,5 @@
1
+ import { createRequire as __vtxCreateRequire } from 'node:module'; const require = __vtxCreateRequire(import.meta.url);
2
+
1
3
  // lib/runtime-policy.generated.json
2
4
  var runtime_policy_generated_default = {
3
5
  ui: {