@vtxmacro/cli 2026.9.47 → 2026.9.49
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 +19 -14
- package/bin/vtx-service-bootstrap.js +4 -1
- package/bin/vtx.js +291 -196
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,11 +62,20 @@ Both paths use a separate least-privilege `insights:inference` OAuth grant.
|
|
|
62
62
|
VTX never receives an agent vendor password, OAuth token, or subscription
|
|
63
63
|
credential.
|
|
64
64
|
|
|
65
|
+
- **Background services:** OpenAI Codex, GitHub Copilot, DeepSeek Harness, Grok Build, Pi. These integrations can keep serving VTX after the setup chat ends. Keep the host computer on and its service running.
|
|
66
|
+
- **Automatic foreground bridge:** Exo. The bridge serves VTX automatically while its process stays open.
|
|
67
|
+
- **Foreground agent integrations:** Amp, Auggie, Claude Code, Cursor, Gemini CLI, Google Antigravity, Hermes Agent, JetBrains Junie, Kiro CLI, OpenClaw, OpenCode, Qwen Code, Warp Oz. Keep the harness session and its VTX foreground host loop open. Available modes depend on the connected model’s advertised capabilities.
|
|
68
|
+
|
|
69
|
+
These groups describe how an integration runs, not a test grade. Limitations are
|
|
70
|
+
listed in the [Insights harness guide](https://vtxmacro.com/insights#subscription-inference).
|
|
71
|
+
Any recorded acceptance applies only to its tested mode and date; it does not
|
|
72
|
+
prove current provider availability.
|
|
73
|
+
|
|
65
74
|
### Durable inference hosts
|
|
66
75
|
|
|
67
76
|
Codex remains the reference implementation and its existing App Server,
|
|
68
77
|
authentication, quota, recovery, and provider-mode path are unchanged. GitHub
|
|
69
|
-
Copilot
|
|
78
|
+
Copilot uses the official SDK and validates
|
|
70
79
|
final text against VTX's immutable schema. An uncertain interrupted Copilot call
|
|
71
80
|
is quarantined as `outcome_unknown` and is never blindly repeated. A different
|
|
72
81
|
adapter cannot replace an installed Codex instance; it needs a distinct instance
|
|
@@ -76,15 +85,15 @@ effective model.
|
|
|
76
85
|
|
|
77
86
|
Grok Build is a durable adapter using its package-owned official runtime and an
|
|
78
87
|
isolated local Grok OAuth session. Run `vtx inference-host grok-login --instance grok-1`
|
|
79
|
-
after
|
|
88
|
+
after `vtx inference-host login --instance grok-1`, then `vtx inference-host service install --adapter grok-build --instance grok-1`.
|
|
80
89
|
Provider mode has no tools; Main Agent mode exposes only assignment-scoped VTX tools.
|
|
81
90
|
Structured decisions, model identity, and usage are validated. Interrupted requests
|
|
82
91
|
with an uncertain outcome are fenced; same-attempt recovery is not supported.
|
|
83
92
|
|
|
84
|
-
An explicitly capable
|
|
93
|
+
An explicitly capable model from a background service listed above can also
|
|
85
94
|
control Main in **Agent** mode using the same VTX OAuth grant and its own local
|
|
86
|
-
adapter-specific vendor credential: ChatGPT or
|
|
87
|
-
Pi provider API key. VTX assigns the running bot but does not send a VTX-authored prompt or set
|
|
95
|
+
adapter-specific vendor credential: ChatGPT, Copilot, or Grok login, or a DeepSeek
|
|
96
|
+
or Pi provider API key. VTX assigns the running bot but does not send a VTX-authored prompt or set
|
|
88
97
|
the analysis cadence. The assigned runtime keeps a durable Agent thread,
|
|
89
98
|
chooses when to wake, requests only the assignment-scoped VTX data it needs (or
|
|
90
99
|
none), and submits the normal structured decision for VTX to validate and
|
|
@@ -242,9 +251,8 @@ confirmation page was blocked; the grant succeeded.
|
|
|
242
251
|
|
|
243
252
|
### Any compatible agent harness
|
|
244
253
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
VTX-owned vendor adapter:
|
|
254
|
+
Compatible agents that can run shell commands can use their existing first-party
|
|
255
|
+
session without a VTX-owned vendor adapter:
|
|
248
256
|
|
|
249
257
|
```bash
|
|
250
258
|
vtx inference-host login
|
|
@@ -348,12 +356,9 @@ self-modification, installed tools, or ambient conversation context. Interrupted
|
|
|
348
356
|
work with an unknown outcome is fenced rather than repeated. After stopping and
|
|
349
357
|
resolving pending work, remove the vendor key with `exo-logout --instance exo-1`.
|
|
350
358
|
|
|
351
|
-
Claude Code,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
effective-model identity, schema, usage, or crash-recovery contracts do not yet
|
|
355
|
-
meet every durable VTX acceptance fence. The public Insights matrix records the
|
|
356
|
-
specific limitation instead of treating headless support alone as durability.
|
|
359
|
+
Amp, Auggie, Claude Code, Cursor, Gemini CLI, Google Antigravity, Hermes Agent, JetBrains Junie, Kiro CLI, OpenClaw, OpenCode, Qwen Code, Warp Oz use the explicit foreground agent path.
|
|
360
|
+
Their setup and specific limitations are listed in the public Insights matrix.
|
|
361
|
+
A successful foreground test does not establish background-service support.
|
|
357
362
|
|
|
358
363
|
Keep `agent-run` open in a separate terminal while the foreground host should
|
|
359
364
|
remain available. Use the Provider job loop for Main, Review, or Screener, or the
|
|
@@ -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.49",
|
|
20
20
|
codex_package_name: "@openai/codex",
|
|
21
21
|
codex_version: "0.153.3",
|
|
22
22
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -213,6 +213,9 @@ var runtime_policy_generated_default = {
|
|
|
213
213
|
restart_backoff_base_ms: 1e3,
|
|
214
214
|
restart_backoff_max_ms: 3e4,
|
|
215
215
|
restart_exponent_max: 5
|
|
216
|
+
},
|
|
217
|
+
claim_diagnostics: {
|
|
218
|
+
event_loop_sample_interval_ms: 100
|
|
216
219
|
}
|
|
217
220
|
},
|
|
218
221
|
desktop: {
|
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.49",
|
|
81
81
|
codex_package_name: "@openai/codex",
|
|
82
82
|
codex_version: "0.153.3",
|
|
83
83
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -20430,6 +20430,185 @@ var init_oauth = __esm({
|
|
|
20430
20430
|
}
|
|
20431
20431
|
});
|
|
20432
20432
|
|
|
20433
|
+
// lib/runtime-policy.generated.json
|
|
20434
|
+
var runtime_policy_generated_default;
|
|
20435
|
+
var init_runtime_policy_generated = __esm({
|
|
20436
|
+
"lib/runtime-policy.generated.json"() {
|
|
20437
|
+
runtime_policy_generated_default = {
|
|
20438
|
+
ui: {
|
|
20439
|
+
performance_defaults: {
|
|
20440
|
+
default_timeframe: "30d"
|
|
20441
|
+
},
|
|
20442
|
+
execution_metadata_retry: {
|
|
20443
|
+
max_attempts: 3,
|
|
20444
|
+
base_delay_milliseconds: 2e3,
|
|
20445
|
+
max_delay_milliseconds: 3e4
|
|
20446
|
+
},
|
|
20447
|
+
auth_bootstrap_retry: {
|
|
20448
|
+
max_attempts: 3,
|
|
20449
|
+
jitter_milliseconds: 750,
|
|
20450
|
+
base_delay_milliseconds: 500,
|
|
20451
|
+
min_delay_milliseconds: 250,
|
|
20452
|
+
max_delay_milliseconds: 1e4
|
|
20453
|
+
}
|
|
20454
|
+
},
|
|
20455
|
+
ai_dashboard: {
|
|
20456
|
+
market_news_bounds: {
|
|
20457
|
+
max_items_min: 1,
|
|
20458
|
+
max_items_max: 100,
|
|
20459
|
+
lookback_hours_min: 1,
|
|
20460
|
+
lookback_hours_max: 168,
|
|
20461
|
+
max_items_steps: [
|
|
20462
|
+
1,
|
|
20463
|
+
2,
|
|
20464
|
+
3,
|
|
20465
|
+
4,
|
|
20466
|
+
5,
|
|
20467
|
+
6,
|
|
20468
|
+
7,
|
|
20469
|
+
8,
|
|
20470
|
+
9,
|
|
20471
|
+
10,
|
|
20472
|
+
15,
|
|
20473
|
+
20,
|
|
20474
|
+
25,
|
|
20475
|
+
30,
|
|
20476
|
+
40,
|
|
20477
|
+
50,
|
|
20478
|
+
60,
|
|
20479
|
+
75,
|
|
20480
|
+
90,
|
|
20481
|
+
100
|
|
20482
|
+
],
|
|
20483
|
+
lookback_hours_steps: [
|
|
20484
|
+
1,
|
|
20485
|
+
2,
|
|
20486
|
+
4,
|
|
20487
|
+
8,
|
|
20488
|
+
12,
|
|
20489
|
+
24,
|
|
20490
|
+
48,
|
|
20491
|
+
72,
|
|
20492
|
+
168
|
|
20493
|
+
]
|
|
20494
|
+
}
|
|
20495
|
+
},
|
|
20496
|
+
trading: {
|
|
20497
|
+
engine: {
|
|
20498
|
+
client_runtime: {
|
|
20499
|
+
recovery: {
|
|
20500
|
+
resume_retry_base_delay_ms: 1e3,
|
|
20501
|
+
resume_retry_max_delay_ms: 3e4,
|
|
20502
|
+
transient_load_min_delay_ms: 3e4,
|
|
20503
|
+
transient_load_max_delay_ms: 12e4,
|
|
20504
|
+
rate_limit_buffer_ms: 1e3,
|
|
20505
|
+
rate_limit_max_delay_ms: 3e5,
|
|
20506
|
+
engine_stop_settle_retry_delay_ms: 250,
|
|
20507
|
+
recoverable_reset_settle_retry_delay_ms: 1500,
|
|
20508
|
+
local_ai_preflight_timeout_ms: 3e3,
|
|
20509
|
+
surge_stagger_max_ms: 6e4,
|
|
20510
|
+
surge_stagger_min_ms: 2e3,
|
|
20511
|
+
surge_stagger_min_candidates: 4,
|
|
20512
|
+
stagger_deadline_ttl_ms: 3e5,
|
|
20513
|
+
server_active_reprobe_delay_ms: 6e4,
|
|
20514
|
+
transient_load_jitter_ms: 1e4,
|
|
20515
|
+
cross_host_completed_ttl_ms: 15e3,
|
|
20516
|
+
telemetry_dedupe_ttl_ms: 5e3,
|
|
20517
|
+
browser_presence_heartbeat_interval_ms: 3e4,
|
|
20518
|
+
host_liveness_heartbeat_interval_ms: 3e4,
|
|
20519
|
+
host_liveness_recovery_nudge_ttl_ms: 1e4
|
|
20520
|
+
}
|
|
20521
|
+
}
|
|
20522
|
+
}
|
|
20523
|
+
},
|
|
20524
|
+
external_inference: {
|
|
20525
|
+
service: {
|
|
20526
|
+
update_check_interval_ms: 3e5,
|
|
20527
|
+
update_registry_timeout_ms: 15e3,
|
|
20528
|
+
startup_max_attempts: 40,
|
|
20529
|
+
startup_poll_interval_ms: 250,
|
|
20530
|
+
restart_stable_uptime_ms: 6e4,
|
|
20531
|
+
restart_backoff_base_ms: 1e3,
|
|
20532
|
+
restart_backoff_max_ms: 3e4,
|
|
20533
|
+
restart_exponent_max: 5
|
|
20534
|
+
},
|
|
20535
|
+
claim_diagnostics: {
|
|
20536
|
+
event_loop_sample_interval_ms: 100
|
|
20537
|
+
}
|
|
20538
|
+
},
|
|
20539
|
+
desktop: {
|
|
20540
|
+
runtime_watchdog: {
|
|
20541
|
+
ping_interval_milliseconds: 15e3,
|
|
20542
|
+
telemetry_interval_milliseconds: 3e5
|
|
20543
|
+
}
|
|
20544
|
+
},
|
|
20545
|
+
screener: {
|
|
20546
|
+
resource_scheduler: {
|
|
20547
|
+
client_lock_ttl_milliseconds: 12e4,
|
|
20548
|
+
client_poll_interval_milliseconds: 250
|
|
20549
|
+
}
|
|
20550
|
+
},
|
|
20551
|
+
deployment: {
|
|
20552
|
+
cutover_buffer: {
|
|
20553
|
+
target_timeout_ms: 3e3,
|
|
20554
|
+
retired_timeout_ms: 45e3,
|
|
20555
|
+
max_body_bytes: 33554432,
|
|
20556
|
+
max_inflight: 16,
|
|
20557
|
+
max_queue: 64
|
|
20558
|
+
}
|
|
20559
|
+
},
|
|
20560
|
+
exchange: {
|
|
20561
|
+
hyperliquid: {
|
|
20562
|
+
client_public_read_budget: {
|
|
20563
|
+
max_weight: 900,
|
|
20564
|
+
window_seconds: 60,
|
|
20565
|
+
cooldown_seconds: 60,
|
|
20566
|
+
metadata_ttl_seconds: 300,
|
|
20567
|
+
user_fees_ttl_seconds: 300,
|
|
20568
|
+
account_mode_ttl_seconds: 30,
|
|
20569
|
+
default_request_weight: 20,
|
|
20570
|
+
cache_max_entries: 512
|
|
20571
|
+
},
|
|
20572
|
+
read_budget: {
|
|
20573
|
+
weights: {
|
|
20574
|
+
exchangeStatus: 2,
|
|
20575
|
+
clearinghouseState: 2,
|
|
20576
|
+
spotClearinghouseState: 2,
|
|
20577
|
+
l2Book: 2,
|
|
20578
|
+
allMids: 2,
|
|
20579
|
+
userFills: 120,
|
|
20580
|
+
userFillsByTime: 120,
|
|
20581
|
+
historicalOrders: 120,
|
|
20582
|
+
twapHistory: 120,
|
|
20583
|
+
userTwapSliceFills: 120,
|
|
20584
|
+
userFunding: 45,
|
|
20585
|
+
userNonFundingLedgerUpdates: 45,
|
|
20586
|
+
candleSnapshot: 104,
|
|
20587
|
+
userRole: 60,
|
|
20588
|
+
userAbstraction: 20,
|
|
20589
|
+
userDexAbstraction: 20,
|
|
20590
|
+
userActiveAssetData: 20,
|
|
20591
|
+
activeAssetData: 20,
|
|
20592
|
+
openOrders: 20,
|
|
20593
|
+
orderStatus: 2,
|
|
20594
|
+
portfolio: 20,
|
|
20595
|
+
userFees: 20,
|
|
20596
|
+
metaAndAssetCtxs: 20,
|
|
20597
|
+
meta: 20,
|
|
20598
|
+
perpDexs: 20,
|
|
20599
|
+
spotMeta: 20,
|
|
20600
|
+
approvedAgents: 20,
|
|
20601
|
+
authorizedAgents: 20,
|
|
20602
|
+
agents: 20,
|
|
20603
|
+
apiWallets: 20
|
|
20604
|
+
}
|
|
20605
|
+
}
|
|
20606
|
+
}
|
|
20607
|
+
}
|
|
20608
|
+
};
|
|
20609
|
+
}
|
|
20610
|
+
});
|
|
20611
|
+
|
|
20433
20612
|
// lib/inference-host/mcp-client.ts
|
|
20434
20613
|
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;
|
|
20435
20614
|
var init_mcp_client = __esm({
|
|
@@ -20439,6 +20618,7 @@ var init_mcp_client = __esm({
|
|
|
20439
20618
|
init_define_VTX_GROK_POLICY();
|
|
20440
20619
|
init_define_VTX_PI_MODEL_POLICY();
|
|
20441
20620
|
init_zod();
|
|
20621
|
+
init_runtime_policy_generated();
|
|
20442
20622
|
init_external_inference_contract();
|
|
20443
20623
|
EXTERNAL_INFERENCE_MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
20444
20624
|
EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS = [
|
|
@@ -20481,6 +20661,65 @@ var init_mcp_client = __esm({
|
|
|
20481
20661
|
};
|
|
20482
20662
|
this.transportAttempts = 0;
|
|
20483
20663
|
this.tokenRefreshes = 0;
|
|
20664
|
+
this.edgeRequestId = null;
|
|
20665
|
+
this.cfRay = null;
|
|
20666
|
+
this.bodyBytes = 0;
|
|
20667
|
+
this.bodyChunks = 0;
|
|
20668
|
+
this.firstChunkMs = null;
|
|
20669
|
+
this.maxChunkGapMs = 0;
|
|
20670
|
+
this.eventLoopDelayMaxMs = 0;
|
|
20671
|
+
this.lastSampleAt = this.startedAt;
|
|
20672
|
+
this.sampleIntervalMs = runtime_policy_generated_default.external_inference.claim_diagnostics.event_loop_sample_interval_ms;
|
|
20673
|
+
this.cancelBodyRead = null;
|
|
20674
|
+
this.sampleTimer = setInterval(() => this.sampleSchedulingDelay(), this.sampleIntervalMs);
|
|
20675
|
+
this.sampleTimer.unref?.();
|
|
20676
|
+
}
|
|
20677
|
+
sampleSchedulingDelay() {
|
|
20678
|
+
const at = performance.now();
|
|
20679
|
+
this.eventLoopDelayMaxMs = Math.max(this.eventLoopDelayMaxMs, at - this.lastSampleAt - this.sampleIntervalMs);
|
|
20680
|
+
this.lastSampleAt = at;
|
|
20681
|
+
}
|
|
20682
|
+
observeResponse(response) {
|
|
20683
|
+
const edgeId = response.headers.get("x-vtx-edge-request-id");
|
|
20684
|
+
const ray = response.headers.get("cf-ray");
|
|
20685
|
+
this.edgeRequestId = edgeId && /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/iu.test(edgeId) ? edgeId : null;
|
|
20686
|
+
this.cfRay = ray && /^[0-9a-f]{16}-[a-z]{3}$/iu.test(ray) ? ray : null;
|
|
20687
|
+
}
|
|
20688
|
+
cancelBody() {
|
|
20689
|
+
this.cancelBodyRead?.();
|
|
20690
|
+
}
|
|
20691
|
+
async readBody(response) {
|
|
20692
|
+
if (!response.body) return "";
|
|
20693
|
+
const reader = response.body.getReader();
|
|
20694
|
+
this.cancelBodyRead = () => {
|
|
20695
|
+
void reader.cancel().catch(() => void 0);
|
|
20696
|
+
};
|
|
20697
|
+
const decoder2 = new TextDecoder();
|
|
20698
|
+
const text = [];
|
|
20699
|
+
const startedAt = performance.now();
|
|
20700
|
+
let previousAt = startedAt;
|
|
20701
|
+
try {
|
|
20702
|
+
while (true) {
|
|
20703
|
+
const { value, done } = await reader.read();
|
|
20704
|
+
const at = performance.now();
|
|
20705
|
+
if (!this.finished) {
|
|
20706
|
+
this.maxChunkGapMs = Math.max(this.maxChunkGapMs, at - previousAt);
|
|
20707
|
+
if (!done) {
|
|
20708
|
+
this.firstChunkMs ??= at - startedAt;
|
|
20709
|
+
this.bodyChunks += 1;
|
|
20710
|
+
this.bodyBytes += value.byteLength;
|
|
20711
|
+
}
|
|
20712
|
+
}
|
|
20713
|
+
previousAt = at;
|
|
20714
|
+
if (done) break;
|
|
20715
|
+
text.push(decoder2.decode(value, { stream: true }));
|
|
20716
|
+
}
|
|
20717
|
+
text.push(decoder2.decode());
|
|
20718
|
+
return text.join("");
|
|
20719
|
+
} finally {
|
|
20720
|
+
this.cancelBodyRead = null;
|
|
20721
|
+
reader.releaseLock();
|
|
20722
|
+
}
|
|
20484
20723
|
}
|
|
20485
20724
|
enter(phase) {
|
|
20486
20725
|
if (this.finished) return;
|
|
@@ -20491,9 +20730,18 @@ var init_mcp_client = __esm({
|
|
|
20491
20730
|
}
|
|
20492
20731
|
finish(outcome) {
|
|
20493
20732
|
this.enter("other_ms");
|
|
20733
|
+
this.sampleSchedulingDelay();
|
|
20734
|
+
clearInterval(this.sampleTimer);
|
|
20494
20735
|
this.finished = true;
|
|
20495
20736
|
return Object.freeze({
|
|
20496
20737
|
...this.elapsed,
|
|
20738
|
+
edge_request_id: this.edgeRequestId,
|
|
20739
|
+
cf_ray: this.cfRay,
|
|
20740
|
+
response_body_bytes: this.bodyBytes,
|
|
20741
|
+
response_body_chunks: this.bodyChunks,
|
|
20742
|
+
response_first_chunk_ms: this.firstChunkMs,
|
|
20743
|
+
response_max_chunk_gap_ms: this.maxChunkGapMs,
|
|
20744
|
+
event_loop_delay_max_ms: this.eventLoopDelayMaxMs,
|
|
20497
20745
|
total_ms: Math.max(0, this.changedAt - this.startedAt),
|
|
20498
20746
|
transport_attempts: this.transportAttempts,
|
|
20499
20747
|
token_refreshes: this.tokenRefreshes,
|
|
@@ -20912,7 +21160,7 @@ var init_mcp_client = __esm({
|
|
|
20912
21160
|
parseResponseDocuments = async (response, timing) => {
|
|
20913
21161
|
const contentType = String(response.headers.get("content-type") || "").split(";", 1)[0].trim().toLowerCase();
|
|
20914
21162
|
timing?.enter("body_reception_ms");
|
|
20915
|
-
const body = await response.text();
|
|
21163
|
+
const body = timing ? await timing.readBody(response) : await response.text();
|
|
20916
21164
|
timing?.enter("response_parse_ms");
|
|
20917
21165
|
if (contentType === "application/json") return [parseJsonDocument(body)];
|
|
20918
21166
|
if (contentType === "text/event-stream") return parseSseDocuments(body);
|
|
@@ -21340,6 +21588,7 @@ var init_mcp_client = __esm({
|
|
|
21340
21588
|
);
|
|
21341
21589
|
}
|
|
21342
21590
|
timing?.enter("other_ms");
|
|
21591
|
+
timing?.observeResponse(response);
|
|
21343
21592
|
if (!response.ok) {
|
|
21344
21593
|
const httpStatusCode = response.status;
|
|
21345
21594
|
const retryAfterMs = parseRetryAfterMs(response);
|
|
@@ -21359,7 +21608,8 @@ var init_mcp_client = __esm({
|
|
|
21359
21608
|
"request_timeout"
|
|
21360
21609
|
);
|
|
21361
21610
|
} catch (error48) {
|
|
21362
|
-
|
|
21611
|
+
if (timing) timing.cancelBody();
|
|
21612
|
+
else await response.body?.cancel().catch(() => void 0);
|
|
21363
21613
|
throw error48;
|
|
21364
21614
|
}
|
|
21365
21615
|
timing?.enter("response_validation_ms");
|
|
@@ -32817,6 +33067,10 @@ var init_runner = __esm({
|
|
|
32817
33067
|
);
|
|
32818
33068
|
assertClaimResult(request, claim);
|
|
32819
33069
|
} catch (error48) {
|
|
33070
|
+
if (claimTiming) emitDiagnostic("claim_request_failed", {
|
|
33071
|
+
claim_request_id: request.claim_request_id,
|
|
33072
|
+
client_timing: claimTiming
|
|
33073
|
+
});
|
|
32820
33074
|
if (!this.options.signal?.aborted && request.schema_version === "external_inference_job_claim_v3" && error48 instanceof ExternalInferenceMcpError && error48.serverFailureCode === "schema_validation") {
|
|
32821
33075
|
batchClaimVersion = 2;
|
|
32822
33076
|
await mutateReceipt((current) => ({
|
|
@@ -32913,6 +33167,13 @@ var init_runner = __esm({
|
|
|
32913
33167
|
claimCallRoundTripMs - (claim.schema_version === "external_inference_job_claim_result_v3" ? claim.server_processing_ms : 0)
|
|
32914
33168
|
);
|
|
32915
33169
|
emitDiagnostic("claim_batch_received", {
|
|
33170
|
+
claim_request_id: request.claim_request_id,
|
|
33171
|
+
jobs: claim.claims.map((item) => ({
|
|
33172
|
+
job_id: item.claim.job_id,
|
|
33173
|
+
attempt_id: item.attempt_id,
|
|
33174
|
+
// Reported at the server; excludes later response transport.
|
|
33175
|
+
server_freshness_remaining_ms: item.provider_dispatch_freshness_remaining_ms
|
|
33176
|
+
})),
|
|
32916
33177
|
...claimTiming ? { client_timing: claimTiming } : {},
|
|
32917
33178
|
claim_count: claim.claims.length,
|
|
32918
33179
|
round_trip_ms: claimCallRoundTripMs,
|
|
@@ -42020,10 +42281,10 @@ var init_durable_adapter = __esm({
|
|
|
42020
42281
|
});
|
|
42021
42282
|
|
|
42022
42283
|
// lib/runtime-policy.generated.json with { type: 'json' }
|
|
42023
|
-
var
|
|
42024
|
-
var
|
|
42284
|
+
var runtime_policy_generated_default2;
|
|
42285
|
+
var init_runtime_policy_generated2 = __esm({
|
|
42025
42286
|
"lib/runtime-policy.generated.json with { type: 'json' }"() {
|
|
42026
|
-
|
|
42287
|
+
runtime_policy_generated_default2 = {
|
|
42027
42288
|
ui: {
|
|
42028
42289
|
performance_defaults: {
|
|
42029
42290
|
default_timeframe: "30d"
|
|
@@ -42120,6 +42381,9 @@ var init_runtime_policy_generated = __esm({
|
|
|
42120
42381
|
restart_backoff_base_ms: 1e3,
|
|
42121
42382
|
restart_backoff_max_ms: 3e4,
|
|
42122
42383
|
restart_exponent_max: 5
|
|
42384
|
+
},
|
|
42385
|
+
claim_diagnostics: {
|
|
42386
|
+
event_loop_sample_interval_ms: 100
|
|
42123
42387
|
}
|
|
42124
42388
|
},
|
|
42125
42389
|
desktop: {
|
|
@@ -42210,7 +42474,7 @@ var init_service = __esm({
|
|
|
42210
42474
|
init_define_VTX_GROK_POLICY();
|
|
42211
42475
|
init_define_VTX_PI_MODEL_POLICY();
|
|
42212
42476
|
init_agent_cli_release();
|
|
42213
|
-
|
|
42477
|
+
init_runtime_policy_generated2();
|
|
42214
42478
|
init_durable_adapter();
|
|
42215
42479
|
init_config();
|
|
42216
42480
|
SERVICE_NAME = "VTX Macro Inference Host";
|
|
@@ -42623,7 +42887,7 @@ WantedBy=default.target
|
|
|
42623
42887
|
await new Promise((resolvePromise) => setTimeout(resolvePromise, milliseconds));
|
|
42624
42888
|
});
|
|
42625
42889
|
this.stopWaitAttempts = dependencies.stopWaitAttempts ?? SERVICE_COOPERATIVE_STOP_SECONDS * 4;
|
|
42626
|
-
this.startWaitAttempts = dependencies.startWaitAttempts ??
|
|
42890
|
+
this.startWaitAttempts = dependencies.startWaitAttempts ?? runtime_policy_generated_default2.external_inference.service.startup_max_attempts;
|
|
42627
42891
|
this.reconcileWaitAttempts = dependencies.reconcileWaitAttempts ?? SERVICE_COOPERATIVE_STOP_SECONDS * 4;
|
|
42628
42892
|
this.confirmInitialReadiness = dependencies.confirmInitialReadiness ?? true;
|
|
42629
42893
|
this.acquireProcessLock = dependencies.acquireProcessLock ?? acquireInferenceHostProcessLock;
|
|
@@ -42754,9 +43018,9 @@ WantedBy=default.target
|
|
|
42754
43018
|
for (let attempt = 0; attempt < this.startWaitAttempts; attempt += 1) {
|
|
42755
43019
|
const status = await this.status();
|
|
42756
43020
|
if (status.manager_active) return status;
|
|
42757
|
-
await this.sleep(
|
|
43021
|
+
await this.sleep(runtime_policy_generated_default2.external_inference.service.startup_poll_interval_ms);
|
|
42758
43022
|
}
|
|
42759
|
-
throw new Error(`Background service did not reach an active state within ${this.startWaitAttempts *
|
|
43023
|
+
throw new Error(`Background service did not reach an active state within ${this.startWaitAttempts * runtime_policy_generated_default2.external_inference.service.startup_poll_interval_ms / 1e3} seconds.`);
|
|
42760
43024
|
}
|
|
42761
43025
|
async restoreRunningSupervisor(manifest, preserveGeneration = false, targetInstanceName) {
|
|
42762
43026
|
const previousRuntime = await readRuntimeAcrossAtomicReplacement(this.runtimePath()).catch(() => null);
|
|
@@ -43598,8 +43862,8 @@ ${result2.stderr}`)) {
|
|
|
43598
43862
|
throw new Error("worker_cooperative_stop_timeout");
|
|
43599
43863
|
}
|
|
43600
43864
|
if (signal.aborted || quiesceSignal.aborted || record5.controller.signal.aborted || !await readDesiredAcrossAtomicReplacement(desiredPath)) break;
|
|
43601
|
-
failures = result2.uptimeMs >=
|
|
43602
|
-
const retryAfterMs = Math.min(
|
|
43865
|
+
failures = result2.uptimeMs >= runtime_policy_generated_default2.external_inference.service.restart_stable_uptime_ms ? 0 : failures + 1;
|
|
43866
|
+
const retryAfterMs = Math.min(runtime_policy_generated_default2.external_inference.service.restart_backoff_base_ms * 2 ** Math.min(failures, runtime_policy_generated_default2.external_inference.service.restart_exponent_max), runtime_policy_generated_default2.external_inference.service.restart_backoff_max_ms);
|
|
43603
43867
|
await updateRecord(record5, "failed", "worker_exited");
|
|
43604
43868
|
await appendServiceLog(serviceManifest.log_path, "worker_exited", {
|
|
43605
43869
|
instance_name: record5.worker.instance_name,
|
|
@@ -43613,7 +43877,7 @@ ${result2.stderr}`)) {
|
|
|
43613
43877
|
if (error48 instanceof Error && error48.message === "worker_cooperative_stop_timeout") throw error48;
|
|
43614
43878
|
if (signal.aborted || quiesceSignal.aborted || record5.controller.signal.aborted) break;
|
|
43615
43879
|
failures += 1;
|
|
43616
|
-
const retryAfterMs = Math.min(
|
|
43880
|
+
const retryAfterMs = Math.min(runtime_policy_generated_default2.external_inference.service.restart_backoff_base_ms * 2 ** Math.min(failures, runtime_policy_generated_default2.external_inference.service.restart_exponent_max), runtime_policy_generated_default2.external_inference.service.restart_backoff_max_ms);
|
|
43617
43881
|
await updateRecord(record5, "failed", "worker_launch_failed");
|
|
43618
43882
|
await appendServiceLog(serviceManifest.log_path, "worker_launch_failed", {
|
|
43619
43883
|
instance_name: record5.worker.instance_name,
|
|
@@ -48051,182 +48315,6 @@ var init_runtime_redaction = __esm({
|
|
|
48051
48315
|
}
|
|
48052
48316
|
});
|
|
48053
48317
|
|
|
48054
|
-
// lib/runtime-policy.generated.json
|
|
48055
|
-
var runtime_policy_generated_default2;
|
|
48056
|
-
var init_runtime_policy_generated2 = __esm({
|
|
48057
|
-
"lib/runtime-policy.generated.json"() {
|
|
48058
|
-
runtime_policy_generated_default2 = {
|
|
48059
|
-
ui: {
|
|
48060
|
-
performance_defaults: {
|
|
48061
|
-
default_timeframe: "30d"
|
|
48062
|
-
},
|
|
48063
|
-
execution_metadata_retry: {
|
|
48064
|
-
max_attempts: 3,
|
|
48065
|
-
base_delay_milliseconds: 2e3,
|
|
48066
|
-
max_delay_milliseconds: 3e4
|
|
48067
|
-
},
|
|
48068
|
-
auth_bootstrap_retry: {
|
|
48069
|
-
max_attempts: 3,
|
|
48070
|
-
jitter_milliseconds: 750,
|
|
48071
|
-
base_delay_milliseconds: 500,
|
|
48072
|
-
min_delay_milliseconds: 250,
|
|
48073
|
-
max_delay_milliseconds: 1e4
|
|
48074
|
-
}
|
|
48075
|
-
},
|
|
48076
|
-
ai_dashboard: {
|
|
48077
|
-
market_news_bounds: {
|
|
48078
|
-
max_items_min: 1,
|
|
48079
|
-
max_items_max: 100,
|
|
48080
|
-
lookback_hours_min: 1,
|
|
48081
|
-
lookback_hours_max: 168,
|
|
48082
|
-
max_items_steps: [
|
|
48083
|
-
1,
|
|
48084
|
-
2,
|
|
48085
|
-
3,
|
|
48086
|
-
4,
|
|
48087
|
-
5,
|
|
48088
|
-
6,
|
|
48089
|
-
7,
|
|
48090
|
-
8,
|
|
48091
|
-
9,
|
|
48092
|
-
10,
|
|
48093
|
-
15,
|
|
48094
|
-
20,
|
|
48095
|
-
25,
|
|
48096
|
-
30,
|
|
48097
|
-
40,
|
|
48098
|
-
50,
|
|
48099
|
-
60,
|
|
48100
|
-
75,
|
|
48101
|
-
90,
|
|
48102
|
-
100
|
|
48103
|
-
],
|
|
48104
|
-
lookback_hours_steps: [
|
|
48105
|
-
1,
|
|
48106
|
-
2,
|
|
48107
|
-
4,
|
|
48108
|
-
8,
|
|
48109
|
-
12,
|
|
48110
|
-
24,
|
|
48111
|
-
48,
|
|
48112
|
-
72,
|
|
48113
|
-
168
|
|
48114
|
-
]
|
|
48115
|
-
}
|
|
48116
|
-
},
|
|
48117
|
-
trading: {
|
|
48118
|
-
engine: {
|
|
48119
|
-
client_runtime: {
|
|
48120
|
-
recovery: {
|
|
48121
|
-
resume_retry_base_delay_ms: 1e3,
|
|
48122
|
-
resume_retry_max_delay_ms: 3e4,
|
|
48123
|
-
transient_load_min_delay_ms: 3e4,
|
|
48124
|
-
transient_load_max_delay_ms: 12e4,
|
|
48125
|
-
rate_limit_buffer_ms: 1e3,
|
|
48126
|
-
rate_limit_max_delay_ms: 3e5,
|
|
48127
|
-
engine_stop_settle_retry_delay_ms: 250,
|
|
48128
|
-
recoverable_reset_settle_retry_delay_ms: 1500,
|
|
48129
|
-
local_ai_preflight_timeout_ms: 3e3,
|
|
48130
|
-
surge_stagger_max_ms: 6e4,
|
|
48131
|
-
surge_stagger_min_ms: 2e3,
|
|
48132
|
-
surge_stagger_min_candidates: 4,
|
|
48133
|
-
stagger_deadline_ttl_ms: 3e5,
|
|
48134
|
-
server_active_reprobe_delay_ms: 6e4,
|
|
48135
|
-
transient_load_jitter_ms: 1e4,
|
|
48136
|
-
cross_host_completed_ttl_ms: 15e3,
|
|
48137
|
-
telemetry_dedupe_ttl_ms: 5e3,
|
|
48138
|
-
browser_presence_heartbeat_interval_ms: 3e4,
|
|
48139
|
-
host_liveness_heartbeat_interval_ms: 3e4,
|
|
48140
|
-
host_liveness_recovery_nudge_ttl_ms: 1e4
|
|
48141
|
-
}
|
|
48142
|
-
}
|
|
48143
|
-
}
|
|
48144
|
-
},
|
|
48145
|
-
external_inference: {
|
|
48146
|
-
service: {
|
|
48147
|
-
update_check_interval_ms: 3e5,
|
|
48148
|
-
update_registry_timeout_ms: 15e3,
|
|
48149
|
-
startup_max_attempts: 40,
|
|
48150
|
-
startup_poll_interval_ms: 250,
|
|
48151
|
-
restart_stable_uptime_ms: 6e4,
|
|
48152
|
-
restart_backoff_base_ms: 1e3,
|
|
48153
|
-
restart_backoff_max_ms: 3e4,
|
|
48154
|
-
restart_exponent_max: 5
|
|
48155
|
-
}
|
|
48156
|
-
},
|
|
48157
|
-
desktop: {
|
|
48158
|
-
runtime_watchdog: {
|
|
48159
|
-
ping_interval_milliseconds: 15e3,
|
|
48160
|
-
telemetry_interval_milliseconds: 3e5
|
|
48161
|
-
}
|
|
48162
|
-
},
|
|
48163
|
-
screener: {
|
|
48164
|
-
resource_scheduler: {
|
|
48165
|
-
client_lock_ttl_milliseconds: 12e4,
|
|
48166
|
-
client_poll_interval_milliseconds: 250
|
|
48167
|
-
}
|
|
48168
|
-
},
|
|
48169
|
-
deployment: {
|
|
48170
|
-
cutover_buffer: {
|
|
48171
|
-
target_timeout_ms: 3e3,
|
|
48172
|
-
retired_timeout_ms: 45e3,
|
|
48173
|
-
max_body_bytes: 33554432,
|
|
48174
|
-
max_inflight: 16,
|
|
48175
|
-
max_queue: 64
|
|
48176
|
-
}
|
|
48177
|
-
},
|
|
48178
|
-
exchange: {
|
|
48179
|
-
hyperliquid: {
|
|
48180
|
-
client_public_read_budget: {
|
|
48181
|
-
max_weight: 900,
|
|
48182
|
-
window_seconds: 60,
|
|
48183
|
-
cooldown_seconds: 60,
|
|
48184
|
-
metadata_ttl_seconds: 300,
|
|
48185
|
-
user_fees_ttl_seconds: 300,
|
|
48186
|
-
account_mode_ttl_seconds: 30,
|
|
48187
|
-
default_request_weight: 20,
|
|
48188
|
-
cache_max_entries: 512
|
|
48189
|
-
},
|
|
48190
|
-
read_budget: {
|
|
48191
|
-
weights: {
|
|
48192
|
-
exchangeStatus: 2,
|
|
48193
|
-
clearinghouseState: 2,
|
|
48194
|
-
spotClearinghouseState: 2,
|
|
48195
|
-
l2Book: 2,
|
|
48196
|
-
allMids: 2,
|
|
48197
|
-
userFills: 120,
|
|
48198
|
-
userFillsByTime: 120,
|
|
48199
|
-
historicalOrders: 120,
|
|
48200
|
-
twapHistory: 120,
|
|
48201
|
-
userTwapSliceFills: 120,
|
|
48202
|
-
userFunding: 45,
|
|
48203
|
-
userNonFundingLedgerUpdates: 45,
|
|
48204
|
-
candleSnapshot: 104,
|
|
48205
|
-
userRole: 60,
|
|
48206
|
-
userAbstraction: 20,
|
|
48207
|
-
userDexAbstraction: 20,
|
|
48208
|
-
userActiveAssetData: 20,
|
|
48209
|
-
activeAssetData: 20,
|
|
48210
|
-
openOrders: 20,
|
|
48211
|
-
orderStatus: 2,
|
|
48212
|
-
portfolio: 20,
|
|
48213
|
-
userFees: 20,
|
|
48214
|
-
metaAndAssetCtxs: 20,
|
|
48215
|
-
meta: 20,
|
|
48216
|
-
perpDexs: 20,
|
|
48217
|
-
spotMeta: 20,
|
|
48218
|
-
approvedAgents: 20,
|
|
48219
|
-
authorizedAgents: 20,
|
|
48220
|
-
agents: 20,
|
|
48221
|
-
apiWallets: 20
|
|
48222
|
-
}
|
|
48223
|
-
}
|
|
48224
|
-
}
|
|
48225
|
-
}
|
|
48226
|
-
};
|
|
48227
|
-
}
|
|
48228
|
-
});
|
|
48229
|
-
|
|
48230
48318
|
// lib/runtime/hyperliquid-public-read.ts
|
|
48231
48319
|
var policy, weights, budgets, unpersistedBudgets, cache, pending2, PREFIX, abortError2, checkAbort, wait, storage, loadBudget, saveBudget, withBudgetLock, admit, cooldown, reserveHyperliquidPublicReads, readHyperliquidPublicInfo;
|
|
48232
48320
|
var init_hyperliquid_public_read = __esm({
|
|
@@ -48236,9 +48324,9 @@ var init_hyperliquid_public_read = __esm({
|
|
|
48236
48324
|
init_define_VTX_GROK_POLICY();
|
|
48237
48325
|
init_define_VTX_PI_MODEL_POLICY();
|
|
48238
48326
|
init_runtime_redaction();
|
|
48239
|
-
|
|
48240
|
-
policy =
|
|
48241
|
-
weights =
|
|
48327
|
+
init_runtime_policy_generated();
|
|
48328
|
+
policy = runtime_policy_generated_default.exchange.hyperliquid.client_public_read_budget;
|
|
48329
|
+
weights = runtime_policy_generated_default.exchange.hyperliquid.read_budget.weights;
|
|
48242
48330
|
budgets = /* @__PURE__ */ new Map();
|
|
48243
48331
|
unpersistedBudgets = /* @__PURE__ */ new Set();
|
|
48244
48332
|
cache = /* @__PURE__ */ new Map();
|
|
@@ -51280,7 +51368,7 @@ var init_shared = __esm({
|
|
|
51280
51368
|
init_define_VTX_EXO_POLICY();
|
|
51281
51369
|
init_define_VTX_GROK_POLICY();
|
|
51282
51370
|
init_define_VTX_PI_MODEL_POLICY();
|
|
51283
|
-
|
|
51371
|
+
init_runtime_policy_generated();
|
|
51284
51372
|
init_abort();
|
|
51285
51373
|
getApiUrl = () => {
|
|
51286
51374
|
if (typeof window === "undefined") {
|
|
@@ -51311,8 +51399,8 @@ var init_shared = __esm({
|
|
|
51311
51399
|
};
|
|
51312
51400
|
API_URL = getApiUrl();
|
|
51313
51401
|
sleep2 = (ms) => new Promise((resolve12) => setTimeout(resolve12, ms));
|
|
51314
|
-
AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS =
|
|
51315
|
-
AUTH_BOOTSTRAP_RETRY_JITTER_MS =
|
|
51402
|
+
AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS = runtime_policy_generated_default.ui.auth_bootstrap_retry.max_attempts;
|
|
51403
|
+
AUTH_BOOTSTRAP_RETRY_JITTER_MS = runtime_policy_generated_default.ui.auth_bootstrap_retry.jitter_milliseconds;
|
|
51316
51404
|
parseRetryAfterMs2 = (value) => {
|
|
51317
51405
|
if (!value) return null;
|
|
51318
51406
|
const seconds = Number(value);
|
|
@@ -85503,6 +85591,9 @@ var init_key_preview_contract = __esm({
|
|
|
85503
85591
|
});
|
|
85504
85592
|
|
|
85505
85593
|
// lib/runtime/vault.ts
|
|
85594
|
+
function notifyVaultChanged(profileId) {
|
|
85595
|
+
window.dispatchEvent(new CustomEvent(CLIENT_VAULT_CHANGED_EVENT, { detail: profileId }));
|
|
85596
|
+
}
|
|
85506
85597
|
function validateDeviceSecrets(value, options) {
|
|
85507
85598
|
const activeProvider = normalizeClientRuntimeSecretProvider(options?.activeProvider);
|
|
85508
85599
|
const requireProviderSecret = options?.requireProviderSecret !== false;
|
|
@@ -85615,7 +85706,7 @@ function validateDeviceSecrets(value, options) {
|
|
|
85615
85706
|
missing: missing2
|
|
85616
85707
|
};
|
|
85617
85708
|
}
|
|
85618
|
-
var VAULT_PREFIX, VAULT_DB_NAME, VAULT_DB_VERSION, VAULT_KEY_STORE, DEFAULT_DEVICE_SECRET_STORAGE, encoder, decoder, sessionVaultCache, runtimeSecretsInFlight, buildRuntimeSecretsRequestKey, fetchClientRuntimeSecretsSingleFlight, hasSecureVaultSupport, bytesToBase64, base64ToArrayBuffer, openVaultDb, withVaultStore, getVaultKey, getOrCreateVaultKey, deleteVaultKey, mapClientRuntimeSecretsToDeviceSecrets, normalizeDeviceSecretStorage, normalizeLocalAiSecrets, normalizeOpenAiCompatibleSecrets, hasAnySecretValues, hasAnyDeviceOnlyOptIn, mergeHydratedSecrets, preserveDeviceOnlySecrets, normalizeClientRuntimeSecretProvider, getResponseSecretVersion, getStoredSecretVersion, buildHydrationState, normalizeProfileIdForApi, ClientVault;
|
|
85709
|
+
var VAULT_PREFIX, CLIENT_VAULT_CHANGED_EVENT, VAULT_DB_NAME, VAULT_DB_VERSION, VAULT_KEY_STORE, DEFAULT_DEVICE_SECRET_STORAGE, encoder, decoder, sessionVaultCache, runtimeSecretsInFlight, buildRuntimeSecretsRequestKey, fetchClientRuntimeSecretsSingleFlight, hasSecureVaultSupport, bytesToBase64, base64ToArrayBuffer, openVaultDb, withVaultStore, getVaultKey, getOrCreateVaultKey, deleteVaultKey, mapClientRuntimeSecretsToDeviceSecrets, normalizeDeviceSecretStorage, normalizeLocalAiSecrets, normalizeOpenAiCompatibleSecrets, hasAnySecretValues, hasAnyDeviceOnlyOptIn, mergeHydratedSecrets, preserveDeviceOnlySecrets, normalizeClientRuntimeSecretProvider, getResponseSecretVersion, getStoredSecretVersion, buildHydrationState, normalizeProfileIdForApi, ClientVault;
|
|
85619
85710
|
var init_vault = __esm({
|
|
85620
85711
|
"lib/runtime/vault.ts"() {
|
|
85621
85712
|
"use strict";
|
|
@@ -85631,6 +85722,7 @@ var init_vault = __esm({
|
|
|
85631
85722
|
init_client_runtime_secret_rate_limit_contract();
|
|
85632
85723
|
init_byokProviderRegistry();
|
|
85633
85724
|
VAULT_PREFIX = "vtx_vault_";
|
|
85725
|
+
CLIENT_VAULT_CHANGED_EVENT = "vtx-client-vault-changed";
|
|
85634
85726
|
VAULT_DB_NAME = "vtx-client-runtime-vault";
|
|
85635
85727
|
VAULT_DB_VERSION = 1;
|
|
85636
85728
|
VAULT_KEY_STORE = "keys";
|
|
@@ -86043,6 +86135,7 @@ var init_vault = __esm({
|
|
|
86043
86135
|
serverSecretVersion
|
|
86044
86136
|
});
|
|
86045
86137
|
localStorage.removeItem(key);
|
|
86138
|
+
notifyVaultChanged(profileId);
|
|
86046
86139
|
return "session";
|
|
86047
86140
|
}
|
|
86048
86141
|
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
@@ -86062,6 +86155,7 @@ var init_vault = __esm({
|
|
|
86062
86155
|
};
|
|
86063
86156
|
localStorage.setItem(key, JSON.stringify(encryptedRecord));
|
|
86064
86157
|
sessionVaultCache.delete(profileId);
|
|
86158
|
+
notifyVaultChanged(profileId);
|
|
86065
86159
|
return "encrypted";
|
|
86066
86160
|
}
|
|
86067
86161
|
static async getSecrets(profileId) {
|
|
@@ -86133,6 +86227,7 @@ var init_vault = __esm({
|
|
|
86133
86227
|
localStorage.removeItem(key);
|
|
86134
86228
|
sessionVaultCache.delete(profileId);
|
|
86135
86229
|
await deleteVaultKey(profileId);
|
|
86230
|
+
notifyVaultChanged(profileId);
|
|
86136
86231
|
}
|
|
86137
86232
|
};
|
|
86138
86233
|
}
|