@vtxmacro/cli 2026.10.6 → 2026.10.7
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 +1 -1
- package/bin/vtx-service-bootstrap.js +1 -1
- package/bin/vtx.js +27 -70
- package/package.json +1 -1
package/bin/vtx-mcp.js
CHANGED
|
@@ -37,7 +37,7 @@ var init_define_VTX_PI_MODEL_POLICY = __esm({
|
|
|
37
37
|
var agent_cli_release_default;
|
|
38
38
|
var init_agent_cli_release = __esm({
|
|
39
39
|
"agent-cli-release.json"() {
|
|
40
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
40
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.7", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -14,7 +14,7 @@ import { dirname as dirname4, relative as relative4, resolve as resolve4 } from
|
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
|
16
16
|
// agent-cli-release.json
|
|
17
|
-
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
17
|
+
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.7", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
18
18
|
|
|
19
19
|
// lib/runtime-policy.generated.json
|
|
20
20
|
var runtime_policy_generated_default = {
|
package/bin/vtx.js
CHANGED
|
@@ -113,7 +113,7 @@ var init_routing = __esm({
|
|
|
113
113
|
var agent_cli_release_default;
|
|
114
114
|
var init_agent_cli_release = __esm({
|
|
115
115
|
"agent-cli-release.json"() {
|
|
116
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
116
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.7", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
|
|
@@ -50092,7 +50092,7 @@ function getProfileHeaders(baseHeaders = {}, explicitProfileId) {
|
|
|
50092
50092
|
if (profileId) headers["x-profile-id"] = profileId.toString();
|
|
50093
50093
|
return headers;
|
|
50094
50094
|
}
|
|
50095
|
-
var configuredApiTransport, getApiUrl, apiFetch, sleep, inFlightClientGetRequests, recentClientGetResponses, clientGetRequestGenerations, initializedClientGetRequestKeys, CLIENT_GET_DEDUPE_TTL_MS,
|
|
50095
|
+
var configuredApiTransport, getApiUrl, apiFetch, sleep, inFlightClientGetRequests, recentClientGetResponses, clientGetRequestGenerations, initializedClientGetRequestKeys, CLIENT_GET_DEDUPE_TTL_MS, CLIENT_LLM_CONFIG_PRIME_TTL_MS, AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS, AUTH_BOOTSTRAP_RETRY_JITTER_MS, canUseClientGetRequestCache, invalidateClientGetRequestCache, raceWithAbortSignal, shareClientGetRequest, clientGetRequestKey, clientPreferencesRequestKey, invalidateClientPreferencesCache, parseRetryAfterMs2, resolveAuthBootstrapRetryDelayMs, fetchAuthBootstrapGetWithRetry, annotateMarketDataRequestError, buildMarketDataFetchError, buildMarketDataNetworkError, buildMarketDataResponseBodyError, isTransientNetworkFetchError, createIdempotencyKey, getErrorMessage, getErrorPayloadOrEmpty, getErrorPayloadOrFallbackDetail, getErrorMessageFromResponse, throwUnauthorizedIfNeeded, activeProfileId, PROFILE_STORAGE_KEY;
|
|
50096
50096
|
var init_shared = __esm({
|
|
50097
50097
|
"lib/api/shared.ts"() {
|
|
50098
50098
|
"use strict";
|
|
@@ -50132,7 +50132,6 @@ var init_shared = __esm({
|
|
|
50132
50132
|
clientGetRequestGenerations = /* @__PURE__ */ new Map();
|
|
50133
50133
|
initializedClientGetRequestKeys = /* @__PURE__ */ new Set();
|
|
50134
50134
|
CLIENT_GET_DEDUPE_TTL_MS = 2e3;
|
|
50135
|
-
CLIENT_RUNTIME_STATUSES_DEDUPE_TTL_MS = 5e3;
|
|
50136
50135
|
CLIENT_LLM_CONFIG_PRIME_TTL_MS = 1e4;
|
|
50137
50136
|
AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS = runtime_policy_generated_default2.ui.auth_bootstrap_retry.max_attempts;
|
|
50138
50137
|
AUTH_BOOTSTRAP_RETRY_JITTER_MS = runtime_policy_generated_default2.ui.auth_bootstrap_retry.jitter_milliseconds;
|
|
@@ -86914,7 +86913,8 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
86914
86913
|
const payload = await response.json();
|
|
86915
86914
|
persistRuntimeLeaseFromPayload(payload);
|
|
86916
86915
|
persistRuntimeLeaseStatusMetadata(numericProfileId, payload);
|
|
86917
|
-
|
|
86916
|
+
const stopStatus = payload?.status;
|
|
86917
|
+
if (path === "/runtime/session/stop" && stopStatus !== "preserved" && stopStatus !== "not_owner") {
|
|
86918
86918
|
clearPersistedClientRuntimeServerLease(numericProfileId);
|
|
86919
86919
|
}
|
|
86920
86920
|
trace.completeSuccess(response.status);
|
|
@@ -87845,41 +87845,6 @@ async function fetchClientRuntimeKillswitchContext(profileId, payload, options)
|
|
|
87845
87845
|
options
|
|
87846
87846
|
);
|
|
87847
87847
|
}
|
|
87848
|
-
async function getClientRuntimeStatuses(profileIds, signal, options) {
|
|
87849
|
-
const normalizedProfileIds = [...new Set(profileIds)].sort((left, right) => left - right);
|
|
87850
|
-
const params = new URLSearchParams();
|
|
87851
|
-
for (const profileId of normalizedProfileIds) {
|
|
87852
|
-
params.append("profile_id", String(profileId));
|
|
87853
|
-
}
|
|
87854
|
-
const viewer = resolveClientRuntimeStatusViewerHeaders(options?.runtimeViewer);
|
|
87855
|
-
const requestKey = `client-runtime-statuses:${normalizedProfileIds.join(",")}${viewer.requestKey}`;
|
|
87856
|
-
return shareClientGetRequest(requestKey, async () => {
|
|
87857
|
-
const headers = { ...viewer.headers };
|
|
87858
|
-
const response = await apiFetch(
|
|
87859
|
-
`${getApiUrl()}/trading/ai/runtime/statuses?${params.toString()}`,
|
|
87860
|
-
{
|
|
87861
|
-
method: "GET",
|
|
87862
|
-
credentials: "include",
|
|
87863
|
-
cache: "no-store",
|
|
87864
|
-
headers,
|
|
87865
|
-
// Without the browser's shared request a caller's abort ends the request too.
|
|
87866
|
-
signal: typeof window === "undefined" ? signal : void 0
|
|
87867
|
-
}
|
|
87868
|
-
);
|
|
87869
|
-
if (!response.ok) {
|
|
87870
|
-
const error48 = await createRuntimeRequestError(response, "Failed to fetch client runtime statuses");
|
|
87871
|
-
throw error48;
|
|
87872
|
-
}
|
|
87873
|
-
return response.json();
|
|
87874
|
-
}, {
|
|
87875
|
-
signal,
|
|
87876
|
-
shareAbortScoped: true,
|
|
87877
|
-
// A host-named read decides whether that host claims: it must see an
|
|
87878
|
-
// intent change made a moment ago, so it shares only an in-flight read
|
|
87879
|
-
// and never reuses a finished one.
|
|
87880
|
-
ttlMs: viewer.requestKey ? 0 : CLIENT_RUNTIME_STATUSES_DEDUPE_TTL_MS
|
|
87881
|
-
});
|
|
87882
|
-
}
|
|
87883
87848
|
var clientRuntimeSecretHeaders, preferencesWriteQueue, getCopyTradingRuntimeLeaseToken, getCopyTradingSchedulerInstanceId, resolveClientRuntimeStatusViewerHeaders, CLIENT_SUPPORTED_PROMPT_CONTRACT_VERSION, CLIENT_PROTECTION_CAPABILITY_VERSION, completedDeferredClientRuntimeStops, rememberCompletedDeferredClientRuntimeStop, consumeCompletedDeferredClientRuntimeStop, toNumericProfileId, buildClientRuntimeBody, shouldAttachRuntimeIdempotencyKey, attachRuntimeLeaseHeader, attachRuntimeSchedulerInstanceHeader, resolveRuntimeLeaseToken, resolveSchedulerBoundRuntimeLeaseToken, persistRuntimeLeaseFromPayload, persistRuntimeLeaseStatusMetadata, shouldClearPersistedRuntimeLeaseOnError, createRuntimeRequestError, parseClientRuntimeRequestContext, recordRuntimeAuthFailureBreadcrumb, classifyRuntimeRequestError, annotateRuntimeRequestError, parseRuntimeRetryAfterMs, isRetryableClientRuntimeStatus, shouldRetryClientRuntimeHttpStatus, isRuntimeIdempotencyInProgressError, isRetryableRuntimeConflictError, resolveClientRuntimeRetryDelayMs, reconcilePendingClientExchangeMutation, CLIENT_RUNTIME_CLAIM_EXCHANGE_MUTATION_WAIT_CODES, CLIENT_EXCHANGE_AUTHORITY_DEVICE_KEY, CLIENT_EXCHANGE_AUTHORITY_SESSION_KEY, getOrCreateClientExchangeAuthorityIdentity, resolveClientExchangeMutationAuthority, clientExchangeMutationAuthorityBody, isPendingClientExchangeMutationError, isMissingActiveClientExchangeMutationError, clientExchangeMutationReconciliationTimers, MAX_CLIENT_EXCHANGE_RECONCILIATION_DELAY_MS, CLIENT_EXCHANGE_RECONCILIATION_CLOCK_SKEW_MS, ClientExchangeMutationRebuildRequiredError, isTerminalClientExchangeMutation, clientExchangeMutationReconciliationKey, clearScheduledClientExchangeMutationReconciliation, snapshotClientExchangeMutationReconciliationAuthority, completeClientExchangeMutationReconciliation, protectiveBoundClientExchangeMutations, rememberProtectiveBoundClientExchangeMutation, isProtectiveBoundClientExchangeMutation, postClientExchangeMutationReconciliation, scheduleClientExchangeMutationReconciliation;
|
|
87884
87849
|
var init_api2 = __esm({
|
|
87885
87850
|
"lib/api.ts"() {
|
|
@@ -87990,6 +87955,9 @@ var init_api2 = __esm({
|
|
|
87990
87955
|
if (payload.authoritativeIntent !== void 0) {
|
|
87991
87956
|
body.authoritative_intent = payload.authoritativeIntent;
|
|
87992
87957
|
}
|
|
87958
|
+
if (payload.requireCurrentOwner !== void 0) {
|
|
87959
|
+
body.require_current_owner = payload.requireCurrentOwner;
|
|
87960
|
+
}
|
|
87993
87961
|
if (payload.analysisRunId !== void 0) {
|
|
87994
87962
|
body.analysis_run_id = payload.analysisRunId ?? null;
|
|
87995
87963
|
}
|
|
@@ -119517,7 +119485,8 @@ function startServerProtectionSweeper(options, identity2) {
|
|
|
119517
119485
|
authority: {
|
|
119518
119486
|
runtimeSessionId: identity2.sessionId,
|
|
119519
119487
|
runtimeLeaseToken: lease.runtimeLeaseToken,
|
|
119520
|
-
runtimeDeviceId: identity2.deviceId
|
|
119488
|
+
runtimeDeviceId: identity2.deviceId,
|
|
119489
|
+
schedulerInstanceId: identity2.schedulerInstanceId
|
|
119521
119490
|
}
|
|
119522
119491
|
}) : Date.now() + PROTECTION_IDLE_RECHECK_MS;
|
|
119523
119492
|
} while (again && !controller.signal.aborted);
|
|
@@ -119593,36 +119562,24 @@ async function runHeadlessRuntime(options) {
|
|
|
119593
119562
|
if (stored && stored.runtimeSessionId !== identity2.sessionId) return;
|
|
119594
119563
|
await clearRuntimeState(options.statePath);
|
|
119595
119564
|
};
|
|
119596
|
-
const runtimeOwner = async () => {
|
|
119597
|
-
try {
|
|
119598
|
-
const { statuses } = await getClientRuntimeStatuses([options.profileId], AbortSignal.timeout(options.ownerReadTimeoutMs ?? OWNER_READ_TIMEOUT_MS));
|
|
119599
|
-
const status = statuses[String(options.profileId)];
|
|
119600
|
-
if (status) {
|
|
119601
|
-
const ownerSession = String(status.runtime_session_id ?? "").trim();
|
|
119602
|
-
const ownerDevice = String(status.runtime_device_id ?? "").trim();
|
|
119603
|
-
return !ownerSession || ownerSession === identity2.sessionId && ownerDevice === identity2.deviceId ? "mine" : "other";
|
|
119604
|
-
}
|
|
119605
|
-
} catch {
|
|
119606
|
-
}
|
|
119607
|
-
return engine.snapshot.ownershipLossReason ? "other" : "unknown";
|
|
119608
|
-
};
|
|
119609
119565
|
const stopRuntime = async (reason) => {
|
|
119610
119566
|
if (engine.active) await engine.stop({ skipRemote: true, reason });
|
|
119611
|
-
|
|
119612
|
-
|
|
119613
|
-
|
|
119614
|
-
|
|
119615
|
-
|
|
119616
|
-
|
|
119617
|
-
|
|
119567
|
+
try {
|
|
119568
|
+
await stopClientRuntimeSession(options.profileId, {
|
|
119569
|
+
sessionId: identity2.sessionId,
|
|
119570
|
+
deviceId: identity2.deviceId,
|
|
119571
|
+
mode: identity2.mode,
|
|
119572
|
+
stopReason: reason,
|
|
119573
|
+
authoritativeIntent: true,
|
|
119574
|
+
requireCurrentOwner: true
|
|
119575
|
+
}, {
|
|
119576
|
+
omitRuntimeLeaseToken: true,
|
|
119577
|
+
requestTimeoutMs: options.stopRequestTimeoutMs ?? STOP_REQUEST_TIMEOUT_MS
|
|
119578
|
+
});
|
|
119579
|
+
} catch (error48) {
|
|
119580
|
+
const detail = error48 instanceof Error ? error48.message : String(error48);
|
|
119581
|
+
throw new Error(`VTX could not stop this profile's runtime on the server (${detail}); it may still be set to run.`);
|
|
119618
119582
|
}
|
|
119619
|
-
await stopClientRuntimeSession(options.profileId, {
|
|
119620
|
-
sessionId: identity2.sessionId,
|
|
119621
|
-
deviceId: identity2.deviceId,
|
|
119622
|
-
mode: identity2.mode,
|
|
119623
|
-
stopReason: reason,
|
|
119624
|
-
authoritativeIntent: true
|
|
119625
|
-
}, { omitRuntimeLeaseToken: true });
|
|
119626
119583
|
await clearOwnState();
|
|
119627
119584
|
};
|
|
119628
119585
|
const releaseFailedStart = async (kind) => {
|
|
@@ -119661,7 +119618,7 @@ async function runHeadlessRuntime(options) {
|
|
|
119661
119618
|
return true;
|
|
119662
119619
|
};
|
|
119663
119620
|
const firstAttached = () => {
|
|
119664
|
-
const stopSweep = startServerProtectionSweeper(options, identity2);
|
|
119621
|
+
const stopSweep = startServerProtectionSweeper(options, { ...identity2, schedulerInstanceId: engine.schedulerInstanceId });
|
|
119665
119622
|
if (options.once && engine.state === "running" && !engine.snapshot.isAnalyzing) {
|
|
119666
119623
|
void engine.triggerNow().catch(() => void 0);
|
|
119667
119624
|
}
|
|
@@ -119782,7 +119739,7 @@ async function runHeadlessRuntime(options) {
|
|
|
119782
119739
|
}
|
|
119783
119740
|
}
|
|
119784
119741
|
}
|
|
119785
|
-
var HeadlessRuntimeTakeoverRequiredError, HEADLESS_RUNTIME_AGENT_SCOPES, DEFAULT_MAX_CLAIM_WAITS,
|
|
119742
|
+
var HeadlessRuntimeTakeoverRequiredError, HEADLESS_RUNTIME_AGENT_SCOPES, DEFAULT_MAX_CLAIM_WAITS, STOP_REQUEST_TIMEOUT_MS, PROTECTION_IDLE_RECHECK_MS, PROTECTION_RETRY_MS, MAX_RESUMES_WITHOUT_A_CYCLE, RESUME_BACKOFF_MS;
|
|
119786
119743
|
var init_headless_runtime = __esm({
|
|
119787
119744
|
"lib/agent-core/headless-runtime.ts"() {
|
|
119788
119745
|
"use strict";
|
|
@@ -119817,7 +119774,7 @@ var init_headless_runtime = __esm({
|
|
|
119817
119774
|
};
|
|
119818
119775
|
HEADLESS_RUNTIME_AGENT_SCOPES = ["read", "bot:control", "trading:execute", "secrets:hydrate"];
|
|
119819
119776
|
DEFAULT_MAX_CLAIM_WAITS = 10;
|
|
119820
|
-
|
|
119777
|
+
STOP_REQUEST_TIMEOUT_MS = 1e4;
|
|
119821
119778
|
PROTECTION_IDLE_RECHECK_MS = runtime_policy_generated_default2.trading.engine.client_runtime.protective_actions.idle_recheck_seconds * 1e3;
|
|
119822
119779
|
PROTECTION_RETRY_MS = 15e3;
|
|
119823
119780
|
MAX_RESUMES_WITHOUT_A_CYCLE = 5;
|