@vtxmacro/cli 2026.9.65 → 2026.9.67
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 +1 -0
- package/bin/vtx-service-bootstrap.js +1 -1
- package/bin/vtx.js +128 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -305,6 +305,7 @@ agent chooses its own cadence and may request zero, one, or many data calls:
|
|
|
305
305
|
|
|
306
306
|
```bash
|
|
307
307
|
vtx inference-host agent-assignment-next --wait-seconds 50 --json
|
|
308
|
+
vtx inference-host agent-review-begin --json
|
|
308
309
|
vtx inference-host agent-data-call --json
|
|
309
310
|
vtx inference-host agent-decision-submit --json
|
|
310
311
|
vtx inference-host agent-decision-status --json
|
|
@@ -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.
|
|
19
|
+
package_version: "2026.9.67",
|
|
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.
|
|
80
|
+
package_version: "2026.9.67",
|
|
81
81
|
codex_package_name: "@openai/codex",
|
|
82
82
|
codex_version: "0.155.0",
|
|
83
83
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -20773,7 +20773,7 @@ var init_mcp_transport = __esm({
|
|
|
20773
20773
|
});
|
|
20774
20774
|
|
|
20775
20775
|
// lib/inference-host/mcp-client.ts
|
|
20776
|
-
var EXTERNAL_INFERENCE_MCP_PROTOCOL_VERSION, EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS, EXTERNAL_INFERENCE_OPERATIONAL_TOOLS, ClaimTiming, ExternalInferenceMcpError, DEFAULT_REQUEST_TIMEOUT_MS, MAX_RETRY_AFTER_MS, PUBLIC_TOOL_ERROR_PREFIX, parseRetryAfterMs, identifierSchema2, safeCodeSchema2, publicFailureCodeSchema, publicToolErrorSchema, structuredPublicToolErrorSchema, parsePublicToolError, hostMutationResultSchema, attemptStartResultSchema, agentConnectResultSchema, agentHeartbeatResultSchema, timestampSchema2, positiveGenerationSchema, jsonObjectSchema, agentAssignmentNextArgumentsSchema, agentDataCapabilityDescriptorSchema, agentAssignmentNextResultSchema, agentAssignmentHeartbeatArgumentsSchema, agentAssignmentHeartbeatResultSchema, agentDataCallArgumentsSchema, agentDataCallResultSchema, agentDecisionSubmitArgumentsSchema, agentDecisionSubmitResultSchema, agentDecisionStatusArgumentsSchema, agentDecisionStatusResultSchema, agentAssignmentReleaseArgumentsSchema, agentAssignmentReleaseResultSchema, jobCompletionResultSchema, jobFailureResultSchema, toolContracts, discoveryResultSchema, toolListResultSchema, inlineStructuredContentSchema, protocolMeta, parseJsonDocument, parseSseDocuments, parseResponseDocuments, exactOperationalInventory, exactJson, invalidBoundResult, verifyToolResult, ExternalInferenceMcpClient;
|
|
20776
|
+
var EXTERNAL_INFERENCE_MCP_PROTOCOL_VERSION, EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS, EXTERNAL_INFERENCE_OPERATIONAL_TOOLS, ClaimTiming, ExternalInferenceMcpError, DEFAULT_REQUEST_TIMEOUT_MS, MAX_RETRY_AFTER_MS, PUBLIC_TOOL_ERROR_PREFIX, parseRetryAfterMs, identifierSchema2, safeCodeSchema2, publicFailureCodeSchema, publicToolErrorSchema, structuredPublicToolErrorSchema, parsePublicToolError, hostMutationResultSchema, attemptStartResultSchema, agentConnectResultSchema, agentHeartbeatResultSchema, timestampSchema2, positiveGenerationSchema, jsonObjectSchema, agentAssignmentNextArgumentsSchema, agentDataCapabilityDescriptorSchema, agentAssignmentNextResultSchema, agentAssignmentHeartbeatArgumentsSchema, agentAssignmentHeartbeatResultSchema, agentDataCallArgumentsSchema, agentDataCallResultSchema, agentDecisionTimingSchema, agentDecisionSubmitArgumentsSchema, agentDecisionSubmitResultSchema, agentDecisionStatusArgumentsSchema, agentDecisionStatusResultSchema, agentAssignmentReleaseArgumentsSchema, agentAssignmentReleaseResultSchema, jobCompletionResultSchema, jobFailureResultSchema, toolContracts, discoveryResultSchema, toolListResultSchema, inlineStructuredContentSchema, protocolMeta, parseJsonDocument, parseSseDocuments, parseResponseDocuments, exactOperationalInventory, exactJson, invalidBoundResult, verifyToolResult, ExternalInferenceMcpClient;
|
|
20777
20777
|
var init_mcp_client = __esm({
|
|
20778
20778
|
"lib/inference-host/mcp-client.ts"() {
|
|
20779
20779
|
"use strict";
|
|
@@ -21096,13 +21096,23 @@ var init_mcp_client = __esm({
|
|
|
21096
21096
|
warnings: external_exports.array(external_exports.unknown()),
|
|
21097
21097
|
sources: external_exports.array(external_exports.unknown())
|
|
21098
21098
|
});
|
|
21099
|
+
agentDecisionTimingSchema = external_exports.strictObject({
|
|
21100
|
+
analysis_started_at: timestampSchema2,
|
|
21101
|
+
model_latency_ms: external_exports.number().int().nonnegative().nullable(),
|
|
21102
|
+
model_latency_source: external_exports.literal("harness_invocation").nullable()
|
|
21103
|
+
}).refine((timing) => timing.model_latency_ms === null === (timing.model_latency_source === null), {
|
|
21104
|
+
message: "Model latency and its measurement source must be supplied together."
|
|
21105
|
+
});
|
|
21099
21106
|
agentDecisionSubmitArgumentsSchema = external_exports.strictObject({
|
|
21100
21107
|
assignment_id: identifierSchema2,
|
|
21101
21108
|
assignment_generation: positiveGenerationSchema,
|
|
21102
21109
|
operation_id: identifierSchema2,
|
|
21103
21110
|
candidate: jsonObjectSchema,
|
|
21104
21111
|
observed_at: timestampSchema2,
|
|
21112
|
+
timing: agentDecisionTimingSchema.optional(),
|
|
21105
21113
|
provenance: jsonObjectSchema.nullable().optional()
|
|
21114
|
+
}).refine((request) => !request.timing || Date.parse(request.timing.analysis_started_at) <= Date.parse(request.observed_at), {
|
|
21115
|
+
message: "Analysis start must precede decision observation."
|
|
21106
21116
|
});
|
|
21107
21117
|
agentDecisionSubmitResultSchema = external_exports.strictObject({
|
|
21108
21118
|
assignment_id: identifierSchema2,
|
|
@@ -30840,7 +30850,7 @@ async function clearInferenceAgentNextState(statePath) {
|
|
|
30840
30850
|
"Agent-driven inference next recovery state"
|
|
30841
30851
|
);
|
|
30842
30852
|
}
|
|
30843
|
-
var inferenceAgentAttemptStatePath, inferenceAgentNextStatePath, inferenceAgentRuntimeStatePath, inferenceAgentFailureFencePath, isIsoTimestamp, assertPlainObject, hasExactKeys, assertInferenceAgentFailureFence, assertInferenceAgentRuntimeState, readCodexAgentRuntimeState, clearCodexAgentRuntimeState, foregroundAgentControlStatePath, assertRuntimeAssignment, assertForegroundAgentControlState, assertNextState, assertAttemptState;
|
|
30853
|
+
var inferenceAgentAttemptStatePath, inferenceAgentNextStatePath, assertDecisionTiming, inferenceAgentRuntimeStatePath, inferenceAgentFailureFencePath, isIsoTimestamp, assertPlainObject, hasExactKeys, assertInferenceAgentFailureFence, assertInferenceAgentRuntimeState, readCodexAgentRuntimeState, clearCodexAgentRuntimeState, foregroundAgentControlStatePath, assertRuntimeAssignment, assertForegroundAgentControlState, assertNextState, assertAttemptState;
|
|
30844
30854
|
var init_agent_state = __esm({
|
|
30845
30855
|
"lib/inference-host/agent-state.ts"() {
|
|
30846
30856
|
"use strict";
|
|
@@ -30851,6 +30861,10 @@ var init_agent_state = __esm({
|
|
|
30851
30861
|
init_external_inference_contract();
|
|
30852
30862
|
inferenceAgentAttemptStatePath = (statePath) => `${statePath}.agent-attempt.json`;
|
|
30853
30863
|
inferenceAgentNextStatePath = (statePath) => `${statePath}.agent-next.json`;
|
|
30864
|
+
assertDecisionTiming = (value, observedAt, message) => {
|
|
30865
|
+
const timing = assertPlainObject(value, message);
|
|
30866
|
+
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);
|
|
30867
|
+
};
|
|
30854
30868
|
inferenceAgentRuntimeStatePath = (statePath) => `${statePath}.codex-agent-runtime.json`;
|
|
30855
30869
|
inferenceAgentFailureFencePath = (statePath) => `${statePath}.agent-failure-fence.json`;
|
|
30856
30870
|
isIsoTimestamp = (value) => typeof value === "string" && Number.isFinite(Date.parse(value));
|
|
@@ -30962,9 +30976,14 @@ var init_agent_state = __esm({
|
|
|
30962
30976
|
"observed_at",
|
|
30963
30977
|
"provenance",
|
|
30964
30978
|
"first_transmit_at",
|
|
30965
|
-
"last_status_check_at"
|
|
30979
|
+
"last_status_check_at",
|
|
30980
|
+
..."timing" in pending3 ? ["timing"] : []
|
|
30966
30981
|
]) || typeof pending3.operation_id !== "string" || !pending3.operation_id || !pending3.candidate || typeof pending3.candidate !== "object" || Array.isArray(pending3.candidate) || !isIsoTimestamp(pending3.observed_at) || pending3.provenance !== null && (typeof pending3.provenance !== "object" || Array.isArray(pending3.provenance)) || pending3.first_transmit_at !== null && !isIsoTimestamp(pending3.first_transmit_at) || pending3.last_status_check_at !== null && !isIsoTimestamp(pending3.last_status_check_at)) throw new Error(message);
|
|
30967
30982
|
}
|
|
30983
|
+
if (state.pending_decision && "timing" in state.pending_decision) {
|
|
30984
|
+
const pending3 = state.pending_decision;
|
|
30985
|
+
assertDecisionTiming(pending3.timing, pending3.observed_at, message);
|
|
30986
|
+
}
|
|
30968
30987
|
return state;
|
|
30969
30988
|
};
|
|
30970
30989
|
readCodexAgentRuntimeState = readInferenceAgentRuntimeState;
|
|
@@ -31012,9 +31031,15 @@ var init_agent_state = __esm({
|
|
|
31012
31031
|
"pending_next",
|
|
31013
31032
|
"pending_decision",
|
|
31014
31033
|
"next_wake_at",
|
|
31015
|
-
"updated_at"
|
|
31034
|
+
"updated_at",
|
|
31035
|
+
..."review" in state ? ["review"] : []
|
|
31016
31036
|
]) || state.schema_version !== "vtx_foreground_agent_control_v1" || typeof state.host_id !== "string" || !state.host_id || state.next_wake_at !== null && !isIsoTimestamp(state.next_wake_at) || !isIsoTimestamp(state.updated_at)) throw new Error(message);
|
|
31017
31037
|
if (state.assignment !== null) assertRuntimeAssignment(state.assignment, message);
|
|
31038
|
+
if (state.review !== void 0 && state.review !== null) {
|
|
31039
|
+
const review = assertPlainObject(state.review, message);
|
|
31040
|
+
const assignment = state.assignment;
|
|
31041
|
+
if (!hasExactKeys(review, ["assignment_id", "assignment_generation", "analysis_started_at"]) || !assignment || review.assignment_id !== assignment.assignment_id || review.assignment_generation !== assignment.assignment_generation || !isIsoTimestamp(review.analysis_started_at)) throw new Error(message);
|
|
31042
|
+
}
|
|
31018
31043
|
if (state.pending_next !== null) {
|
|
31019
31044
|
const pending3 = assertPlainObject(state.pending_next, message);
|
|
31020
31045
|
if (!hasExactKeys(pending3, ["operation_id", "requested_at"]) || typeof pending3.operation_id !== "string" || !pending3.operation_id || !isIsoTimestamp(pending3.requested_at)) throw new Error(message);
|
|
@@ -31028,13 +31053,15 @@ var init_agent_state = __esm({
|
|
|
31028
31053
|
"last_status_check_at"
|
|
31029
31054
|
])) throw new Error(message);
|
|
31030
31055
|
const request = assertPlainObject(pending3.request, message);
|
|
31056
|
+
if ("timing" in request) assertDecisionTiming(request.timing, request.observed_at, message);
|
|
31031
31057
|
if (!hasExactKeys(request, [
|
|
31032
31058
|
"assignment_id",
|
|
31033
31059
|
"assignment_generation",
|
|
31034
31060
|
"operation_id",
|
|
31035
31061
|
"candidate",
|
|
31036
31062
|
"observed_at",
|
|
31037
|
-
"provenance"
|
|
31063
|
+
"provenance",
|
|
31064
|
+
..."timing" in request ? ["timing"] : []
|
|
31038
31065
|
]) || request.assignment_id !== state.assignment.assignment_id || request.assignment_generation !== state.assignment.assignment_generation || typeof request.operation_id !== "string" || !request.operation_id || !request.candidate || typeof request.candidate !== "object" || Array.isArray(request.candidate) || !isIsoTimestamp(request.observed_at) || !request.provenance || typeof request.provenance !== "object" || Array.isArray(request.provenance) || pending3.first_transmit_at !== null && !isIsoTimestamp(pending3.first_transmit_at) || pending3.last_status_check_at !== null && !isIsoTimestamp(pending3.last_status_check_at)) throw new Error(message);
|
|
31039
31066
|
}
|
|
31040
31067
|
return state;
|
|
@@ -34956,6 +34983,11 @@ var init_runner = __esm({
|
|
|
34956
34983
|
operation_id: randomUUID(),
|
|
34957
34984
|
candidate,
|
|
34958
34985
|
observed_at: nowIso(),
|
|
34986
|
+
timing: {
|
|
34987
|
+
analysis_started_at: state.pending_turn.started_at,
|
|
34988
|
+
model_latency_ms: null,
|
|
34989
|
+
model_latency_source: null
|
|
34990
|
+
},
|
|
34959
34991
|
provenance: {
|
|
34960
34992
|
source: "external_agent",
|
|
34961
34993
|
agent_run_id: liveThread.threadId,
|
|
@@ -34993,6 +35025,7 @@ var init_runner = __esm({
|
|
|
34993
35025
|
operation_id: pending3.operation_id,
|
|
34994
35026
|
candidate: pending3.candidate,
|
|
34995
35027
|
observed_at: pending3.observed_at,
|
|
35028
|
+
...pending3.timing ? { timing: pending3.timing } : {},
|
|
34996
35029
|
provenance: pending3.provenance
|
|
34997
35030
|
}, { signal: turnAbort.signal });
|
|
34998
35031
|
} catch {
|
|
@@ -44537,6 +44570,13 @@ async function runInferenceHostCli(argv2, env = process.env, dependencies = {})
|
|
|
44537
44570
|
dependencies
|
|
44538
44571
|
);
|
|
44539
44572
|
}
|
|
44573
|
+
if (parsed.command === "agent-review-begin") {
|
|
44574
|
+
return await withAgentCommandLock(
|
|
44575
|
+
config2,
|
|
44576
|
+
async () => await foregroundReviewBegin(config2, parsed, dependencies, warnings),
|
|
44577
|
+
dependencies
|
|
44578
|
+
);
|
|
44579
|
+
}
|
|
44540
44580
|
if (parsed.command === "agent-data-call") {
|
|
44541
44581
|
return await foregroundDataCall(config2, parsed, dependencies, warnings);
|
|
44542
44582
|
}
|
|
@@ -44597,7 +44637,7 @@ async function runInferenceHostCli(argv2, env = process.env, dependencies = {})
|
|
|
44597
44637
|
return await cleanupLogin(config2, parsed, dependencies, warnings, true);
|
|
44598
44638
|
}
|
|
44599
44639
|
throw new Error(
|
|
44600
|
-
"Usage: vtx inference-host <login|codex-login|grok-login|deepseek-login|pi-login|exo-login|run|agent-connect|agent-run|agent-next|agent-complete|agent-fail|agent-assignment-next|agent-assignment-heartbeat|agent-data-call|agent-decision-submit|agent-decision-status|agent-assignment-release|service|status|doctor|logout|codex-logout|grok-logout|deepseek-logout|pi-logout|exo-logout|revoke> [--json]"
|
|
44640
|
+
"Usage: vtx inference-host <login|codex-login|grok-login|deepseek-login|pi-login|exo-login|run|agent-connect|agent-run|agent-next|agent-complete|agent-fail|agent-assignment-next|agent-assignment-heartbeat|agent-review-begin|agent-data-call|agent-decision-submit|agent-decision-status|agent-assignment-release|service|status|doctor|logout|codex-logout|grok-logout|deepseek-logout|pi-logout|exo-logout|revoke> [--json]"
|
|
44601
44641
|
);
|
|
44602
44642
|
} catch (error48) {
|
|
44603
44643
|
return {
|
|
@@ -44608,7 +44648,7 @@ async function runInferenceHostCli(argv2, env = process.env, dependencies = {})
|
|
|
44608
44648
|
};
|
|
44609
44649
|
}
|
|
44610
44650
|
}
|
|
44611
|
-
var INFERENCE_HOST_CLI_VERSION, runtimeReceiptPath, codexRecoveryPath, codexGuardianReceiptRoot, revocationCheckpointPath, foregroundHostLockPath, credentialLifecycleLockPath, serviceRecoveryCommandLockPath, AGENT_HEARTBEAT_INTERVAL_MS, AGENT_HEARTBEAT_MAX_RETRY_DELAY_MS, retryableAgentHeartbeatError, assertRevocationCheckpoint, readRevocationCheckpoint, writeRevocationCheckpoint, clearRevocationCheckpoint, render, INFERENCE_HOST_HELP, parseHostConcurrency, parseInferenceHostArgs, resolveDurableServiceDisplayName, defaultOpenBrowser, registerInferenceHostServiceControlInput, defaultRegisterLifecycleSignalHandlers, lifecycleCancellation, configuredCredentialStore, restoreInferenceHostCredentialContext, recoverInferenceHostCredentialContextTransition, accountKeyForState, assertCredentialMatchesState2, revocationCheckpointForCredential, assertRevocationCheckpointMatchesLocalIdentity, fileExistsPrivately, inspectCodexAuthentication, clearLocalRuntimeArtifacts, assertDurableServiceUninstalled, assertLocalRuntimeArtifactsMayBeDiscarded, defaultRunForeground, preparePortableDurableAdapter, prepareExoAdapter, defaultRunPortableDurableAdapter, login, codexLogin, codexLogout, grokAuthentication, deepSeekCredentialStore, deepSeekLogin, deepSeekLogout, piLogin, piLogout, exoLogin, exoLogout, localStatus, doctor, cleanupLogin, runHost, defaultReadStdin, parseAgentStdin, parseOptionalAgentStdin, agentOperationId, agentSession, agentConnect, foregroundAgentControlState, requireForegroundAgentState, assignmentFromClaim, foregroundAssignmentNext, foregroundAssignmentHeartbeat, foregroundDataCall, foregroundDecisionStatusRequest, foregroundAssignmentLeaseEnded, handleForegroundCancelledAssignment, foregroundDecisionFollowup, foregroundDecisionStatus, foregroundDecisionSubmit, foregroundAssignmentRelease, agentRun, agentNext, agentComplete, agentFail, withAgentCommandLock, recoveryBackupPath, serviceRecoveryTransactionPath, readServiceRecoveryTransaction, assertResumableCodexRecoveryEvidence, recoverInstalledCodexService, serviceCommand, hasExplicitCredentialStoreConfiguration, credentialEnvironmentForIdentity, commandRequiresRetainedCredentialStore, commandUsesInstalledServiceCredentials, resolveInferenceHostCommandConfig;
|
|
44651
|
+
var INFERENCE_HOST_CLI_VERSION, runtimeReceiptPath, codexRecoveryPath, codexGuardianReceiptRoot, revocationCheckpointPath, foregroundHostLockPath, credentialLifecycleLockPath, serviceRecoveryCommandLockPath, AGENT_HEARTBEAT_INTERVAL_MS, AGENT_HEARTBEAT_MAX_RETRY_DELAY_MS, retryableAgentHeartbeatError, assertRevocationCheckpoint, readRevocationCheckpoint, writeRevocationCheckpoint, clearRevocationCheckpoint, render, INFERENCE_HOST_HELP, parseHostConcurrency, parseInferenceHostArgs, resolveDurableServiceDisplayName, defaultOpenBrowser, registerInferenceHostServiceControlInput, defaultRegisterLifecycleSignalHandlers, lifecycleCancellation, configuredCredentialStore, restoreInferenceHostCredentialContext, recoverInferenceHostCredentialContextTransition, accountKeyForState, assertCredentialMatchesState2, revocationCheckpointForCredential, assertRevocationCheckpointMatchesLocalIdentity, fileExistsPrivately, inspectCodexAuthentication, clearLocalRuntimeArtifacts, assertDurableServiceUninstalled, assertLocalRuntimeArtifactsMayBeDiscarded, defaultRunForeground, preparePortableDurableAdapter, prepareExoAdapter, defaultRunPortableDurableAdapter, login, codexLogin, codexLogout, grokAuthentication, deepSeekCredentialStore, deepSeekLogin, deepSeekLogout, piLogin, piLogout, exoLogin, exoLogout, localStatus, doctor, cleanupLogin, runHost, defaultReadStdin, parseAgentStdin, parseOptionalAgentStdin, agentOperationId, agentSession, agentConnect, foregroundAgentControlState, requireForegroundAgentState, assignmentFromClaim, foregroundAssignmentNext, foregroundAssignmentHeartbeat, foregroundReviewBegin, foregroundDataCall, foregroundDecisionStatusRequest, foregroundAssignmentLeaseEnded, handleForegroundCancelledAssignment, foregroundDecisionFollowup, foregroundDecisionStatus, foregroundDecisionSubmit, foregroundAssignmentRelease, agentRun, agentNext, agentComplete, agentFail, withAgentCommandLock, recoveryBackupPath, serviceRecoveryTransactionPath, readServiceRecoveryTransaction, assertResumableCodexRecoveryEvidence, recoverInstalledCodexService, serviceCommand, hasExplicitCredentialStoreConfiguration, credentialEnvironmentForIdentity, commandRequiresRetainedCredentialStore, commandUsesInstalledServiceCredentials, resolveInferenceHostCommandConfig;
|
|
44612
44652
|
var init_cli = __esm({
|
|
44613
44653
|
"lib/inference-host/cli.ts"() {
|
|
44614
44654
|
"use strict";
|
|
@@ -44729,6 +44769,7 @@ Commands:
|
|
|
44729
44769
|
agent-fail Submit one truthful agent failure from stdin
|
|
44730
44770
|
agent-assignment-next Claim the assigned Main bot for Agent control
|
|
44731
44771
|
agent-assignment-heartbeat Renew the current Agent assignment
|
|
44772
|
+
agent-review-begin Record review start before reading decision context
|
|
44732
44773
|
agent-data-call Request allowed assignment-scoped VTX data
|
|
44733
44774
|
agent-decision-submit Submit the normal structured trading decision
|
|
44734
44775
|
agent-decision-status Read a submitted decision outcome or recover uncertain submission
|
|
@@ -46446,6 +46487,7 @@ Waiting for approval...
|
|
|
46446
46487
|
state = {
|
|
46447
46488
|
...state,
|
|
46448
46489
|
assignment,
|
|
46490
|
+
review: state.assignment?.assignment_id === assignment.assignment_id && state.assignment?.assignment_generation === assignment.assignment_generation ? state.review ?? null : null,
|
|
46449
46491
|
pending_next: null,
|
|
46450
46492
|
next_wake_at: null,
|
|
46451
46493
|
updated_at: now().toISOString()
|
|
@@ -46462,7 +46504,8 @@ Waiting for approval...
|
|
|
46462
46504
|
exitCode: 0,
|
|
46463
46505
|
stdout: render({
|
|
46464
46506
|
...result2,
|
|
46465
|
-
instructions: "Use your harness scheduler for the requested cadence and keep agent-run open for liveness. Use agent-data-call for canonical VTX data and your authorized native Insights/external tools. Trading JSON is optional; submit a decision only when you choose, using the exact output_schema. The keeper does not schedule or restart your harness.",
|
|
46507
|
+
instructions: "Use your harness scheduler for the requested cadence and keep agent-run open for liveness. Call agent-review-begin before each review to record its actual analysis start. Use agent-data-call for canonical VTX data and your authorized native Insights/external tools. Trading JSON is optional; submit a decision only when you choose, using the exact output_schema. The keeper does not schedule or restart your harness.",
|
|
46508
|
+
review_begin_command: "vtx inference-host agent-review-begin --json",
|
|
46466
46509
|
data_command: "vtx inference-host agent-data-call --json",
|
|
46467
46510
|
decision_command: "vtx inference-host agent-decision-submit --json",
|
|
46468
46511
|
decision_input: {
|
|
@@ -46532,6 +46575,31 @@ Waiting for approval...
|
|
|
46532
46575
|
` : ""
|
|
46533
46576
|
};
|
|
46534
46577
|
};
|
|
46578
|
+
foregroundReviewBegin = async (config2, parsed, dependencies, warnings) => {
|
|
46579
|
+
const session = await agentSession(config2, dependencies, warnings);
|
|
46580
|
+
const state = await requireForegroundAgentState(config2, session.localState.host_id);
|
|
46581
|
+
if (state.pending_decision || state.pending_next) {
|
|
46582
|
+
throw new Error("Resolve the pending Agent operation before beginning a review.");
|
|
46583
|
+
}
|
|
46584
|
+
await parseOptionalAgentStdin(dependencies, []);
|
|
46585
|
+
const startedAt = (dependencies.now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
|
|
46586
|
+
const review = {
|
|
46587
|
+
assignment_id: state.assignment.assignment_id,
|
|
46588
|
+
assignment_generation: state.assignment.assignment_generation,
|
|
46589
|
+
analysis_started_at: startedAt
|
|
46590
|
+
};
|
|
46591
|
+
await writeInferenceForegroundAgentControlState(config2.statePath, {
|
|
46592
|
+
...state,
|
|
46593
|
+
review,
|
|
46594
|
+
updated_at: startedAt
|
|
46595
|
+
});
|
|
46596
|
+
return { exitCode: 0, stdout: render({
|
|
46597
|
+
...review,
|
|
46598
|
+
model_latency_ms: null,
|
|
46599
|
+
model_latency_source: null
|
|
46600
|
+
}, parsed.json), stderr: warnings.length ? `${warnings.join("\n")}
|
|
46601
|
+
` : "" };
|
|
46602
|
+
};
|
|
46535
46603
|
foregroundDataCall = async (config2, parsed, dependencies, warnings) => {
|
|
46536
46604
|
const session = await agentSession(config2, dependencies, warnings);
|
|
46537
46605
|
const state = await withAgentCommandLock(
|
|
@@ -46671,6 +46739,7 @@ Waiting for approval...
|
|
|
46671
46739
|
const observedAt = now().toISOString();
|
|
46672
46740
|
state = {
|
|
46673
46741
|
...state,
|
|
46742
|
+
review: null,
|
|
46674
46743
|
pending_decision: {
|
|
46675
46744
|
request: {
|
|
46676
46745
|
assignment_id: state.assignment.assignment_id,
|
|
@@ -46678,6 +46747,11 @@ Waiting for approval...
|
|
|
46678
46747
|
operation_id: agentOperationId("agent-decision-submit"),
|
|
46679
46748
|
candidate: input.candidate,
|
|
46680
46749
|
observed_at: observedAt,
|
|
46750
|
+
...state.review ? { timing: {
|
|
46751
|
+
analysis_started_at: state.review.analysis_started_at,
|
|
46752
|
+
model_latency_ms: null,
|
|
46753
|
+
model_latency_source: null
|
|
46754
|
+
} } : {},
|
|
46681
46755
|
provenance: input.provenance
|
|
46682
46756
|
},
|
|
46683
46757
|
first_transmit_at: null,
|
|
@@ -52346,6 +52420,17 @@ var init_screener = __esm({
|
|
|
52346
52420
|
}
|
|
52347
52421
|
});
|
|
52348
52422
|
|
|
52423
|
+
// lib/api/client-host-commands.ts
|
|
52424
|
+
var init_client_host_commands = __esm({
|
|
52425
|
+
"lib/api/client-host-commands.ts"() {
|
|
52426
|
+
"use strict";
|
|
52427
|
+
init_define_VTX_EXO_POLICY();
|
|
52428
|
+
init_define_VTX_GROK_POLICY();
|
|
52429
|
+
init_define_VTX_PI_MODEL_POLICY();
|
|
52430
|
+
init_shared();
|
|
52431
|
+
}
|
|
52432
|
+
});
|
|
52433
|
+
|
|
52349
52434
|
// lib/runtime/server-runtime-lease.ts
|
|
52350
52435
|
var CLIENT_RUNTIME_SERVER_LEASE_STORAGE_KEY, canUseStorage, normalizeProfileId, normalizeLeaseGeneration, parseLeaseRecord, readPersistedLeaseMap, writePersistedLeaseMap, isLeaseExpired, getPersistedClientRuntimeServerLease, persistExistingClientRuntimeServerLease, persistClientRuntimeServerLease, clearPersistedClientRuntimeServerLease;
|
|
52351
52436
|
var init_server_runtime_lease = __esm({
|
|
@@ -53054,6 +53139,7 @@ var init_api2 = __esm({
|
|
|
53054
53139
|
init_billing();
|
|
53055
53140
|
init_market_data();
|
|
53056
53141
|
init_screener();
|
|
53142
|
+
init_client_host_commands();
|
|
53057
53143
|
init_server_runtime_lease();
|
|
53058
53144
|
preferencesWriteQueue = Promise.resolve();
|
|
53059
53145
|
CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION = String(
|
|
@@ -87412,7 +87498,7 @@ var init_browser_trading = __esm({
|
|
|
87412
87498
|
throwIfAborted(input.signal);
|
|
87413
87499
|
const signingKey = await resolveSigningKey(input);
|
|
87414
87500
|
throwIfAborted(input.signal);
|
|
87415
|
-
const mutation = createExchangeMutationIdentity(false);
|
|
87501
|
+
const mutation = createExchangeMutationIdentity(false, input);
|
|
87416
87502
|
const payload = await buildHyperliquidUpdateLeveragePayload({
|
|
87417
87503
|
config: input.config ?? null,
|
|
87418
87504
|
publicRequestPriority: input.publicRequestPriority,
|
|
@@ -87655,6 +87741,8 @@ var init_browser_trading = __esm({
|
|
|
87655
87741
|
const side = positionSize > 0 ? "sell" : "buy";
|
|
87656
87742
|
return executeClientMarketOrder({
|
|
87657
87743
|
profileId,
|
|
87744
|
+
mutationId: input.mutationId,
|
|
87745
|
+
clientOrderId: input.clientOrderId,
|
|
87658
87746
|
runtimeSessionId: input.runtimeSessionId,
|
|
87659
87747
|
runtimeLeaseToken: input.runtimeLeaseToken,
|
|
87660
87748
|
runtimeDeviceId: input.runtimeDeviceId,
|
|
@@ -89139,11 +89227,16 @@ var init_runtime_execution = __esm({
|
|
|
89139
89227
|
}
|
|
89140
89228
|
return reports;
|
|
89141
89229
|
}
|
|
89230
|
+
const { sz_decimals: assetSizeDecimals } = await resolveHyperliquidAsset({
|
|
89231
|
+
symbol: symbol2,
|
|
89232
|
+
config: request.config,
|
|
89233
|
+
publicRequestPriority: "trading_reduce"
|
|
89234
|
+
});
|
|
89142
89235
|
const candidates = allocatedCandidates.map((candidate) => ({
|
|
89143
89236
|
...candidate,
|
|
89144
89237
|
triggerPrice: Number(formatHyperliquidTriggerPriceWire(
|
|
89145
89238
|
candidate.triggerPrice,
|
|
89146
|
-
|
|
89239
|
+
assetSizeDecimals
|
|
89147
89240
|
))
|
|
89148
89241
|
}));
|
|
89149
89242
|
const positionTpsl = candidates.length === 2;
|
|
@@ -91412,6 +91505,15 @@ var init_runtime_execution = __esm({
|
|
|
91412
91505
|
retained.push(record5);
|
|
91413
91506
|
}
|
|
91414
91507
|
}
|
|
91508
|
+
if (eligible.length === 0) {
|
|
91509
|
+
writeTrackedTrailingStops(profileId, symbol2, retained);
|
|
91510
|
+
return [];
|
|
91511
|
+
}
|
|
91512
|
+
const { sz_decimals: assetSizeDecimals } = await resolveHyperliquidAsset({
|
|
91513
|
+
symbol: symbol2,
|
|
91514
|
+
config: request.config,
|
|
91515
|
+
publicRequestPriority: "trading_reduce"
|
|
91516
|
+
});
|
|
91415
91517
|
const reports = [];
|
|
91416
91518
|
const updated = [...retained];
|
|
91417
91519
|
let remainingExposure = Math.abs(currentPositionSize);
|
|
@@ -91460,7 +91562,7 @@ var init_runtime_execution = __esm({
|
|
|
91460
91562
|
const rawCandidatePrice = buildTriggerPrice(currentPrice, riskPct, isLong, false);
|
|
91461
91563
|
const candidatePrice = rawCandidatePrice > 0 ? Number(formatHyperliquidTriggerPriceWire(
|
|
91462
91564
|
rawCandidatePrice,
|
|
91463
|
-
|
|
91565
|
+
assetSizeDecimals
|
|
91464
91566
|
)) : 0;
|
|
91465
91567
|
const tightens = candidatePrice > 0 && (isLong ? candidatePrice > record5.triggerPrice : candidatePrice < record5.triggerPrice);
|
|
91466
91568
|
const canonicalRecordSize = roundAssetSize(
|
|
@@ -91874,6 +91976,12 @@ var init_runtime_execution = __esm({
|
|
|
91874
91976
|
if (!context.tpSlEnabled || context.stopLossEnabled === false || context.stopLossType !== "trailing" || !Number.isFinite(age) || age < 0 || !Number.isFinite(maxAge) || maxAge <= 0 || age > maxAge || !Number.isFinite(context.currentPositionSize) || context.currentPositionSize === 0 || !Number.isFinite(context.lastPrice) || context.lastPrice <= 0) return [];
|
|
91875
91977
|
const groups = readFreshClientProtectiveGroups(String(request.profileId).trim(), context.symbol);
|
|
91876
91978
|
if (hasClientProtectiveGroupReadFailure(String(request.profileId).trim(), context.symbol) || groups.some((group) => group.walletAddress !== String(context.walletAddress ?? "").trim().toLowerCase() || group.pendingEntry || group.attachmentJournal || group.cleanupRequired || group.legs.some((leg) => leg.replacement))) return [];
|
|
91979
|
+
if (!groups.some((group) => group.legs.some((leg) => leg.isTrailing && typeof leg.orderId === "number"))) return [];
|
|
91980
|
+
const { sz_decimals: assetSizeDecimals } = await resolveHyperliquidAsset({
|
|
91981
|
+
symbol: context.symbol,
|
|
91982
|
+
config: request.config,
|
|
91983
|
+
publicRequestPriority: "trading_reduce"
|
|
91984
|
+
});
|
|
91877
91985
|
const isLong = context.currentPositionSize > 0;
|
|
91878
91986
|
const improves = groups.some((group) => group.isLong === isLong && group.legs.some((leg) => {
|
|
91879
91987
|
if (!leg.isTrailing || typeof leg.orderId !== "number") return false;
|
|
@@ -91881,7 +91989,7 @@ var init_runtime_execution = __esm({
|
|
|
91881
91989
|
if (!(size > 0)) return false;
|
|
91882
91990
|
const risk = resolveRiskPct(context.stopLossMode, context.stopLossPct, context.stopLossUsdc, context.lastPrice * size);
|
|
91883
91991
|
const raw = buildTriggerPrice(context.lastPrice, risk, isLong, false);
|
|
91884
|
-
const candidate = raw > 0 ? Number(formatHyperliquidTriggerPriceWire(raw,
|
|
91992
|
+
const candidate = raw > 0 ? Number(formatHyperliquidTriggerPriceWire(raw, assetSizeDecimals)) : 0;
|
|
91885
91993
|
return candidate > 0 && (isLong ? candidate > leg.triggerPrice : candidate < leg.triggerPrice);
|
|
91886
91994
|
}));
|
|
91887
91995
|
if (!improves) return [];
|
|
@@ -92754,12 +92862,17 @@ var init_runtime_execution = __esm({
|
|
|
92754
92862
|
}
|
|
92755
92863
|
const mutationId = createRuntimeId().toLowerCase();
|
|
92756
92864
|
const clientOrderId = `0x${mutationId.replaceAll("-", "")}`;
|
|
92865
|
+
const { sz_decimals: assetSizeDecimals } = await resolveHyperliquidAsset({
|
|
92866
|
+
symbol: input.executionContext.symbol,
|
|
92867
|
+
config: input.config,
|
|
92868
|
+
publicRequestPriority: "trading_reduce"
|
|
92869
|
+
});
|
|
92757
92870
|
const provisionalLeg = {
|
|
92758
92871
|
kind,
|
|
92759
92872
|
orderId: clientOrderId,
|
|
92760
92873
|
triggerPrice: Number(formatHyperliquidTriggerPriceWire(
|
|
92761
92874
|
triggerInput.triggerPrice,
|
|
92762
|
-
|
|
92875
|
+
assetSizeDecimals
|
|
92763
92876
|
)),
|
|
92764
92877
|
size: legSize,
|
|
92765
92878
|
isTrailing: !triggerInput.isTakeProfit && input.executionContext.stopLossType === "trailing"
|
|
@@ -92844,7 +92957,7 @@ var init_runtime_execution = __esm({
|
|
|
92844
92957
|
orderId: triggerOrderId,
|
|
92845
92958
|
triggerPrice: Number(formatHyperliquidTriggerPriceWire(
|
|
92846
92959
|
triggerInput.triggerPrice,
|
|
92847
|
-
|
|
92960
|
+
assetSizeDecimals
|
|
92848
92961
|
)),
|
|
92849
92962
|
size: legSize,
|
|
92850
92963
|
isTrailing
|