@vtxmacro/cli 2026.9.68 → 2026.9.69

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.68",
19
+ package_version: "2026.9.69",
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.68",
80
+ package_version: "2026.9.69",
81
81
  codex_package_name: "@openai/codex",
82
82
  codex_version: "0.155.0",
83
83
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -21111,6 +21111,7 @@ var init_mcp_client = __esm({
21111
21111
  agentDecisionTimingSchema = external_exports.strictObject({
21112
21112
  analysis_started_at: timestampSchema2,
21113
21113
  model_latency_ms: external_exports.number().int().nonnegative().nullable(),
21114
+ analysis_duration_ms: external_exports.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable().optional(),
21114
21115
  model_latency_source: external_exports.literal("harness_invocation").nullable()
21115
21116
  }).refine((timing) => timing.model_latency_ms === null === (timing.model_latency_source === null), {
21116
21117
  message: "Model latency and its measurement source must be supplied together."
@@ -21123,7 +21124,7 @@ var init_mcp_client = __esm({
21123
21124
  observed_at: timestampSchema2,
21124
21125
  timing: agentDecisionTimingSchema.optional(),
21125
21126
  provenance: jsonObjectSchema.nullable().optional()
21126
- }).refine((request) => !request.timing || Date.parse(request.timing.analysis_started_at) <= Date.parse(request.observed_at), {
21127
+ }).refine((request) => !request.timing || Date.parse(request.timing.analysis_started_at) <= Date.parse(request.observed_at) && (request.timing.analysis_duration_ms == null || request.timing.analysis_duration_ms <= Date.parse(request.observed_at) - Date.parse(request.timing.analysis_started_at)), {
21127
21128
  message: "Analysis start must precede decision observation."
21128
21129
  });
21129
21130
  agentDecisionSubmitResultSchema = external_exports.strictObject({
@@ -21477,6 +21478,7 @@ var init_mcp_client = __esm({
21477
21478
  #initialized = false;
21478
21479
  #providerQuotaRecoverySupported = false;
21479
21480
  #providerCreditsSupported = false;
21481
+ #agentAnalysisDurationSupported = false;
21480
21482
  #runtimeRecoveryDiagnosticsSupported = false;
21481
21483
  #providerHttpStatusTools = /* @__PURE__ */ new Set();
21482
21484
  #grokToolValidationTools = /* @__PURE__ */ new Set();
@@ -21523,6 +21525,18 @@ var init_mcp_client = __esm({
21523
21525
  supportsRuntimeRecoveryDiagnostics() {
21524
21526
  return this.#runtimeRecoveryDiagnosticsSupported;
21525
21527
  }
21528
+ supportsAgentAnalysisDuration() {
21529
+ return this.#agentAnalysisDurationSupported;
21530
+ }
21531
+ async refreshAgentAnalysisDurationSupport(options = {}) {
21532
+ if (this.supportsAgentAnalysisDuration()) return true;
21533
+ try {
21534
+ await this.initialize(options);
21535
+ } catch {
21536
+ return false;
21537
+ }
21538
+ return this.supportsAgentAnalysisDuration();
21539
+ }
21526
21540
  supportsProviderCredits() {
21527
21541
  return this.#providerCreditsSupported;
21528
21542
  }
@@ -21603,6 +21617,20 @@ var init_mcp_client = __esm({
21603
21617
  return Array.isArray(node.anyOf) && node.anyOf.some((branch) => advertisesCredits(branch, depth + 1));
21604
21618
  };
21605
21619
  this.#providerCreditsSupported = advertisesCredits(hostHeartbeatSchema?.properties?.provider_weekly_quota);
21620
+ const decisionSchema = listed.tools.find(
21621
+ (tool) => tool.name === "inference.agent.decision.submit"
21622
+ )?.inputSchema;
21623
+ const advertisesAnalysisDuration = (value, depth = 0) => {
21624
+ if (depth > 4 || !value || typeof value !== "object" || Array.isArray(value)) return false;
21625
+ const node = value;
21626
+ if (node.properties && typeof node.properties === "object" && Object.hasOwn(node.properties, "analysis_duration_ms")) return true;
21627
+ if (typeof node.$ref === "string" && /^#\/\$defs\/[^/]+$/u.test(node.$ref)) {
21628
+ const definition = node.$ref.slice("#/$defs/".length).replace(/~1/gu, "/").replace(/~0/gu, "~");
21629
+ return advertisesAnalysisDuration(decisionSchema?.$defs?.[definition], depth + 1);
21630
+ }
21631
+ return Array.isArray(node.anyOf) && node.anyOf.some((branch) => advertisesAnalysisDuration(branch, depth + 1));
21632
+ };
21633
+ this.#agentAnalysisDurationSupported = advertisesAnalysisDuration(decisionSchema?.properties?.timing);
21606
21634
  this.#grokToolValidationTools.clear();
21607
21635
  if (advertisesFields("inference.job.fail", ["grok_tool_validation"])) {
21608
21636
  this.#grokToolValidationTools.add("inference.job.fail");
@@ -30901,7 +30929,7 @@ async function clearInferenceAgentNextState(statePath) {
30901
30929
  "Agent-driven inference next recovery state"
30902
30930
  );
30903
30931
  }
30904
- var inferenceAgentAttemptStatePath, inferenceAgentNextStatePath, assertDecisionTiming, inferenceAgentRuntimeStatePath, inferenceAgentFailureFencePath, isIsoTimestamp, assertPlainObject, hasExactKeys, assertInferenceAgentFailureFence, assertInferenceAgentRuntimeState, readCodexAgentRuntimeState, clearCodexAgentRuntimeState, foregroundAgentControlStatePath, assertRuntimeAssignment, assertForegroundAgentControlState, assertNextState, assertAttemptState;
30932
+ var inferenceAgentAttemptStatePath, inferenceAgentNextStatePath, measureAgentReviewTiming, assertDecisionTiming, inferenceAgentRuntimeStatePath, inferenceAgentFailureFencePath, isIsoTimestamp, assertPlainObject, hasExactKeys, assertInferenceAgentFailureFence, assertInferenceAgentRuntimeState, readCodexAgentRuntimeState, clearCodexAgentRuntimeState, foregroundAgentControlStatePath, assertRuntimeAssignment, assertForegroundAgentControlState, assertNextState, assertAttemptState;
30905
30933
  var init_agent_state = __esm({
30906
30934
  "lib/inference-host/agent-state.ts"() {
30907
30935
  "use strict";
@@ -30912,9 +30940,20 @@ var init_agent_state = __esm({
30912
30940
  init_external_inference_contract();
30913
30941
  inferenceAgentAttemptStatePath = (statePath) => `${statePath}.agent-attempt.json`;
30914
30942
  inferenceAgentNextStatePath = (statePath) => `${statePath}.agent-next.json`;
30943
+ measureAgentReviewTiming = (analysisStartedAt, observedAt, measureDuration = true) => ({
30944
+ analysis_started_at: analysisStartedAt,
30945
+ model_latency_ms: null,
30946
+ model_latency_source: null,
30947
+ ...measureDuration ? { analysis_duration_ms: Date.parse(observedAt) - Date.parse(analysisStartedAt) } : {}
30948
+ });
30915
30949
  assertDecisionTiming = (value, observedAt, message) => {
30916
30950
  const timing = assertPlainObject(value, message);
30917
- if (!hasExactKeys(timing, ["analysis_started_at", "model_latency_ms", "model_latency_source"]) || !isIsoTimestamp(timing.analysis_started_at) || Date.parse(timing.analysis_started_at) > Date.parse(String(observedAt)) || (timing.model_latency_ms === null ? timing.model_latency_source !== null : !Number.isSafeInteger(timing.model_latency_ms) || Number(timing.model_latency_ms) < 0 || timing.model_latency_source !== "harness_invocation")) throw new Error(message);
30951
+ if (!hasExactKeys(timing, [
30952
+ "analysis_started_at",
30953
+ "model_latency_ms",
30954
+ "model_latency_source",
30955
+ ..."analysis_duration_ms" in timing ? ["analysis_duration_ms"] : []
30956
+ ]) || !isIsoTimestamp(timing.analysis_started_at) || Date.parse(timing.analysis_started_at) > Date.parse(String(observedAt)) || timing.analysis_duration_ms != null && (!Number.isSafeInteger(timing.analysis_duration_ms) || Number(timing.analysis_duration_ms) < 0 || Number(timing.analysis_duration_ms) > Date.parse(String(observedAt)) - Date.parse(timing.analysis_started_at)) || (timing.model_latency_ms === null ? timing.model_latency_source !== null : !Number.isSafeInteger(timing.model_latency_ms) || Number(timing.model_latency_ms) < 0 || timing.model_latency_source !== "harness_invocation")) throw new Error(message);
30918
30957
  };
30919
30958
  inferenceAgentRuntimeStatePath = (statePath) => `${statePath}.codex-agent-runtime.json`;
30920
30959
  inferenceAgentFailureFencePath = (statePath) => `${statePath}.agent-failure-fence.json`;
@@ -34609,6 +34648,7 @@ var init_runner = __esm({
34609
34648
  }
34610
34649
  };
34611
34650
  createInferenceAgentControlClient = (mcp) => ({
34651
+ supportsAgentAnalysisDuration: async (options = {}) => mcp.supportsAgentAnalysisDuration?.() === true || await mcp.refreshAgentAnalysisDurationSupport?.(options) === true,
34612
34652
  supportsProviderHttpStatusDiagnostics: async (options = {}) => mcp.supportsProviderHttpStatusDiagnostics?.("inference.agent.assignment.heartbeat") === true || await mcp.refreshProviderHttpStatusSupport?.("inference.agent.assignment.heartbeat", options) === true,
34613
34653
  supportsGrokResponseIdentityDiagnostics: async (options = {}) => mcp.supportsGrokResponseIdentityDiagnostics?.("inference.agent.assignment.heartbeat") === true || await mcp.refreshGrokResponseIdentitySupport?.("inference.agent.assignment.heartbeat", options) === true,
34614
34654
  supportsGrokToolValidationDiagnostics: async (options = {}) => mcp.supportsGrokToolValidationDiagnostics?.("inference.agent.assignment.heartbeat") === true || await mcp.refreshGrokToolValidationSupport?.("inference.agent.assignment.heartbeat", options) === true,
@@ -35028,15 +35068,19 @@ var init_runner = __esm({
35028
35068
  if (state.pending_decision) {
35029
35069
  return { success: false, value: { error: "decision_outcome_unresolved" } };
35030
35070
  }
35071
+ const measureDuration = state.pending_turn.decision_operation_ids.length === 0 && await this.options.controlClient.supportsAgentAnalysisDuration?.({ signal: turnAbort.signal }) === true;
35072
+ const observedAt = nowIso();
35031
35073
  const pending3 = {
35032
35074
  operation_id: randomUUID(),
35033
35075
  candidate,
35034
- observed_at: nowIso(),
35035
- timing: {
35036
- analysis_started_at: state.pending_turn.started_at,
35037
- model_latency_ms: null,
35038
- model_latency_source: null
35039
- },
35076
+ observed_at: observedAt,
35077
+ // A later decision in the same turn has no independent review
35078
+ // boundary. Do not report the whole turn again as its duration.
35079
+ timing: measureAgentReviewTiming(
35080
+ state.pending_turn.started_at,
35081
+ observedAt,
35082
+ measureDuration
35083
+ ),
35040
35084
  provenance: {
35041
35085
  source: "external_agent",
35042
35086
  agent_run_id: liveThread.threadId,
@@ -46806,11 +46850,11 @@ Waiting for approval...
46806
46850
  operation_id: agentOperationId("agent-decision-submit"),
46807
46851
  candidate: input.candidate,
46808
46852
  observed_at: observedAt,
46809
- ...state.review ? { timing: {
46810
- analysis_started_at: state.review.analysis_started_at,
46811
- model_latency_ms: null,
46812
- model_latency_source: null
46813
- } } : {},
46853
+ ...state.review ? { timing: measureAgentReviewTiming(
46854
+ state.review.analysis_started_at,
46855
+ observedAt,
46856
+ session.client.supportsAgentAnalysisDuration?.() === true
46857
+ ) } : {},
46814
46858
  provenance: input.provenance
46815
46859
  },
46816
46860
  first_transmit_at: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.68",
3
+ "version": "2026.9.69",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",