@vtxmacro/cli 2026.10.12 → 2026.10.14

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.
@@ -28,6 +28,7 @@ var runtime_policy_generated_default = {
28
28
  post_execution_refresh_delay_ms: 3e3,
29
29
  account_read_backoff_min_ms: 2e3,
30
30
  account_read_backoff_max_ms: 6e4,
31
+ account_read_backoff_exponent_max: 30,
31
32
  ai_start_grace_min_ms: 45e3
32
33
  },
33
34
  deployment_reload_observability: {
@@ -47,6 +48,603 @@ var runtime_policy_generated_default = {
47
48
  refresh_interval_ms: 1e4,
48
49
  watchdog_interval_ms: 1e3,
49
50
  watchdog_grace_ms: 500
51
+ },
52
+ preferences: {
53
+ load_timeout_ms: 5e3,
54
+ initial_load_settle_ms: 100,
55
+ external_save_timeout_ms: 8e3,
56
+ guest_cookie_max_age_days: 9999,
57
+ dropdown_search_max_chars: 200
58
+ },
59
+ navigation_feedback: {
60
+ finish_fallback_ms: 2250
61
+ },
62
+ confirmation_notices: {
63
+ success_indicator_ms: 2e3,
64
+ byok_success_message_ms: 3e3
65
+ },
66
+ screener_runtime_config_retry: {
67
+ base_delay_ms: 1e3,
68
+ max_delay_ms: 3e4
69
+ },
70
+ advanced_chart: {
71
+ debug_log_throttle_ms: 1e3,
72
+ initial_history_stall_ms: 15e3,
73
+ initial_history_recovery_cooldown_ms: 3e4,
74
+ viewport_restore_settle_ms: 100,
75
+ symbol_price_wait_ms: 2e3,
76
+ layout_auto_save_delay_ms: 250
77
+ },
78
+ ai_panel: {
79
+ message_limit: 100,
80
+ post_execution_history_sync_delay_ms: 2e3,
81
+ runtime_error_attempt_group_window_seconds: 120,
82
+ debug_runtime_error_preview_chars: 180
83
+ },
84
+ ai_settings: {
85
+ storage_authority_broadcast_dedupe_window_ms: 2e3,
86
+ margin_type_external_authority_ttl_ms: 12e4,
87
+ screener_status_refresh_delay_ms: 75,
88
+ preference_message_dedupe_keys: 24,
89
+ available_assets_retry_default_ms: 15e3,
90
+ available_assets_retry_min_ms: 1e3,
91
+ available_assets_retry_max_ms: 6e4,
92
+ external_sync_settle_ms: 1e3,
93
+ billing_stats_reuse_ms: 3e3,
94
+ prompt_commit_debounce_ms: 180,
95
+ model_count_display_settle_ms: 320,
96
+ model_picker_scroll_settle_ms: 60
97
+ },
98
+ ai_settings_debug: {
99
+ model_debug_event_limit: 160,
100
+ browser_resource_timings: 40,
101
+ browser_resource_panel_rows: 12,
102
+ browser_timing_refresh_delay_ms: 1500,
103
+ comparable_hash_full_max_chars: 16,
104
+ comparable_hash_edge_chars: 8,
105
+ console_message_chars: 4e3,
106
+ comparable_diff_max_depth: 4,
107
+ react_profile_min_duration_ms: 20,
108
+ react_profile_slower_margin_ms: 25,
109
+ react_profile_slow_update_ms: 100,
110
+ react_profile_repeat_interval_ms: 1500,
111
+ snapshot_ids_head: 10,
112
+ longtask_samples: 12,
113
+ recent_events: 20,
114
+ hydration_recent_events: 12,
115
+ dirty_state_recent_events: 12,
116
+ navbar_profile_entries: 30,
117
+ dropdown_search_paint_events: 6,
118
+ dropdown_options_debounce_ms: 220,
119
+ dropdown_hover_min_interval_ms: 80,
120
+ slow_render_ms: 80,
121
+ render_min_ms: 24,
122
+ render_min_interval_ms: 300,
123
+ model_fingerprint_head: 24,
124
+ models_head: 12
125
+ },
126
+ insights_charts: {
127
+ max_charts: 3,
128
+ max_line_points: 160,
129
+ max_bars: 8
130
+ },
131
+ analysis_chat: {
132
+ new_message_scroll_delay_ms: 100
133
+ },
134
+ snapshot_selector: {
135
+ sync_resolution_pending_ms: 350,
136
+ own_broadcast_window_ms: 5e3,
137
+ seen_imported_ids_limit: 200,
138
+ post_import_reload_delay_ms: 1e3,
139
+ debug_value_chars: 220,
140
+ debug_fingerprint_head_chars: 64,
141
+ debug_head_snapshot_ids: 8,
142
+ debug_comparable_head_chars: 240,
143
+ debug_panel_comparable_head_chars: 120
144
+ },
145
+ safe_mode_settings: {
146
+ usdc_slider_cents_steps: [
147
+ 10,
148
+ 25,
149
+ 50,
150
+ 75,
151
+ 100,
152
+ 150,
153
+ 200,
154
+ 300,
155
+ 400,
156
+ 500,
157
+ 750,
158
+ 1e3,
159
+ 1500,
160
+ 2e3,
161
+ 2500,
162
+ 3e3,
163
+ 4e3,
164
+ 5e3,
165
+ 7500,
166
+ 1e4,
167
+ 15e3,
168
+ 2e4,
169
+ 25e3,
170
+ 3e4,
171
+ 4e4,
172
+ 5e4,
173
+ 75e3,
174
+ 1e5,
175
+ 125e3,
176
+ 15e4,
177
+ 2e5,
178
+ 25e4,
179
+ 3e5,
180
+ 4e5,
181
+ 5e5,
182
+ 6e5,
183
+ 7e5,
184
+ 8e5,
185
+ 9e5,
186
+ 1e6
187
+ ],
188
+ percent_input_step_bps: 1
189
+ },
190
+ copy_trading_settings: {
191
+ scale_multiplier_slider_thousandths_steps: [
192
+ 10,
193
+ 20,
194
+ 30,
195
+ 40,
196
+ 50,
197
+ 75,
198
+ 100,
199
+ 150,
200
+ 200,
201
+ 250,
202
+ 300,
203
+ 400,
204
+ 500,
205
+ 600,
206
+ 700,
207
+ 800,
208
+ 850,
209
+ 900,
210
+ 950,
211
+ 975,
212
+ 1e3,
213
+ 1025,
214
+ 1050,
215
+ 1100,
216
+ 1250,
217
+ 1500,
218
+ 1750,
219
+ 2e3,
220
+ 2500,
221
+ 3e3,
222
+ 4e3,
223
+ 5e3,
224
+ 7500,
225
+ 1e4,
226
+ 15e3,
227
+ 2e4,
228
+ 3e4,
229
+ 4e4,
230
+ 5e4,
231
+ 75e3,
232
+ 1e5
233
+ ]
234
+ },
235
+ analysis_settings: {
236
+ lookback_slider_candles_steps: [
237
+ 1,
238
+ 2,
239
+ 3,
240
+ 4,
241
+ 5,
242
+ 6,
243
+ 7,
244
+ 8,
245
+ 9,
246
+ 10,
247
+ 12,
248
+ 14,
249
+ 16,
250
+ 18,
251
+ 20,
252
+ 24,
253
+ 28,
254
+ 32,
255
+ 36,
256
+ 40,
257
+ 42,
258
+ 44,
259
+ 48,
260
+ 52,
261
+ 56,
262
+ 60,
263
+ 65,
264
+ 70,
265
+ 75,
266
+ 80,
267
+ 90,
268
+ 100,
269
+ 110,
270
+ 120,
271
+ 130,
272
+ 140,
273
+ 150,
274
+ 160,
275
+ 180,
276
+ 200
277
+ ]
278
+ },
279
+ trading_limit_settings: {
280
+ ai_trade_amount_usdc_steps: [
281
+ 20,
282
+ 30,
283
+ 40,
284
+ 50,
285
+ 60,
286
+ 70,
287
+ 80,
288
+ 90,
289
+ 100,
290
+ 150,
291
+ 175,
292
+ 200,
293
+ 225,
294
+ 250,
295
+ 275,
296
+ 300,
297
+ 325,
298
+ 350,
299
+ 375,
300
+ 400,
301
+ 425,
302
+ 450,
303
+ 475,
304
+ 500,
305
+ 600,
306
+ 700,
307
+ 800,
308
+ 900,
309
+ 1e3,
310
+ 1250,
311
+ 1500,
312
+ 1750,
313
+ 2e3,
314
+ 2250,
315
+ 2500,
316
+ 2750,
317
+ 3e3,
318
+ 3250,
319
+ 3500,
320
+ 3750,
321
+ 4e3,
322
+ 4250,
323
+ 4500,
324
+ 4750,
325
+ 5e3,
326
+ 6e3,
327
+ 7e3,
328
+ 8e3,
329
+ 9e3,
330
+ 1e4
331
+ ],
332
+ ai_trade_amount_max_stop_count: 50
333
+ },
334
+ calendar_settings: {
335
+ buffer_input_step_seconds: 30
336
+ },
337
+ debug_logs: {
338
+ snapshot_card_lines: 80,
339
+ render_debug_overlay_entries: 120,
340
+ render_debug_entry_data_chars: 2400,
341
+ analytics_dashboard_lines: 220,
342
+ analytics_metric_capture_interval_ms: 400,
343
+ system_profile_mode_lines: 120,
344
+ admin_text_chars: 160,
345
+ admin_analysis_run_id_chars: 32,
346
+ hyperliquid_balance_preview_count: 3,
347
+ model_picker_preview_count: 5,
348
+ render_debug_entries: 250
349
+ },
350
+ history_panels: {
351
+ display_batch_size: 50,
352
+ load_more_threshold_px: 100,
353
+ trade_history_fetch_page_size: 100,
354
+ ai_panel_interaction_window_ms: 2500,
355
+ ai_panel_defer_max_staleness_ms: 1e4,
356
+ ai_panel_defer_retry_ms: 1500,
357
+ order_id_metadata_traversal_max_nodes: 400
358
+ },
359
+ trade_page: {
360
+ config_first_retry_delay_ms: 1e3,
361
+ margin_mode_min_loading_ms: 250,
362
+ preferences_load_retry_delay_ms_steps: [
363
+ 1500,
364
+ 3e3,
365
+ 6e3,
366
+ 12e3
367
+ ],
368
+ preferences_retry_jitter_max_ms: 1500,
369
+ all_profile_preferences_save_delay_ms: 1500,
370
+ all_profile_save_interaction_window_ms: 2e3,
371
+ all_profile_read_concurrency: 2,
372
+ all_profile_ai_event_dedupe_limit: 200,
373
+ all_profile_order_history_limit: 50,
374
+ all_profile_section_timeout_min_ms: 1e3,
375
+ all_profile_account_summary_poll_min_ms: 1e3,
376
+ all_profile_trade_history_poll_min_ms: 1e3,
377
+ all_profile_live_refresh_idle_timeout_ms: 5e3,
378
+ copy_trading_message_limit: 25,
379
+ browser_account_refresh_min_interval_ms: 1250,
380
+ browser_account_watchdog_poll_min_ms: 1e4,
381
+ rate_limit_retry_buffer_ms: 250,
382
+ restricted_runtime_poll_min_ms: 3e3,
383
+ restricted_runtime_event_limit: 20,
384
+ server_account_rest_catchup_min_interval_ms: 5e3,
385
+ server_account_catchup_poll_min_ms: 5e3,
386
+ execution_rest_catchup_delay_ms_steps: [
387
+ 2e3,
388
+ 8e3
389
+ ],
390
+ unified_bootstrap_hold_min_ms: 4e3,
391
+ unified_bootstrap_hold_max_ms: 8e3,
392
+ observed_activity_recent_ms: 8e3,
393
+ startup_hold_activation_gap_ms: 9e4,
394
+ hidden_ticker_update_interval_ms: 16,
395
+ client_close_fill_sync_attempts: 3,
396
+ client_close_fill_sync_retry_step_ms: 300,
397
+ leverage_update_debounce_ms: 250,
398
+ post_leverage_update_order_delay_ms: 250,
399
+ ai_control_lookback_fallback_candles: 25,
400
+ takeover_telemetry_error_chars: 500,
401
+ takeover_telemetry_error_name_chars: 120,
402
+ takeover_telemetry_failure_chars: 300,
403
+ client_next_run_interval_min_ms: 1e3,
404
+ ws_server_time_reorder_tolerance_ms: 1e3
405
+ },
406
+ trade_account_summary: {
407
+ unified_min_balances_usd: 25,
408
+ unified_balances_account_value_multiple: 3,
409
+ unified_spot_ratio_percent: 50
410
+ },
411
+ trade_debug_logs: {
412
+ text_chars: 180,
413
+ runtime_identity_tail_chars: 18,
414
+ run_id_chars: 8,
415
+ control_step_error_chars: 160,
416
+ control_note_chars: 120,
417
+ error_detail_chars: 120,
418
+ click_target_text_chars: 120,
419
+ ai_log_text_chars: 120,
420
+ preferences_error_chars: 160,
421
+ ssr_error_detail_chars: 160,
422
+ breadcrumb_payload_chars: 500,
423
+ render_debug_data_chars: 1200,
424
+ server_execution_value_chars: 700,
425
+ server_execution_error_chars: 250,
426
+ cost_trace_execution_debug_chars: 500,
427
+ positions_fetch_error_chars: 220,
428
+ ai_debug_lines: 100,
429
+ ai_model_status_lines: 100,
430
+ ai_model_status_shown_lines: 80,
431
+ ai_status_bar_trace_lines: 200,
432
+ ai_status_bar_trace_shown_lines: 120,
433
+ ai_status_bar_transition_lines: 200,
434
+ ai_status_bar_transition_shown_lines: 120,
435
+ ai_status_role_compare_lines: 240,
436
+ ai_status_role_compare_shown_lines: 160,
437
+ ai_status_bar_input_lines: 200,
438
+ ai_status_bar_input_shown_lines: 120,
439
+ ai_engine_transition_lines: 200,
440
+ ai_engine_transition_shown_lines: 120,
441
+ ai_panel_cost_lines: 120,
442
+ ai_panel_cost_shown_lines: 80,
443
+ ai_runtime_error_label_lines: 100,
444
+ ai_runtime_error_label_shown_lines: 80,
445
+ loop_status_mutation_lines: 200,
446
+ loop_status_mutation_shown_lines: 120,
447
+ login_recovery_trace_lines: 240,
448
+ sparkle_ownership_lines: 120,
449
+ ai_trader_start_lines: 100,
450
+ ai_trader_restart_trace_lines: 120,
451
+ ai_control_button_trace_lines: 240,
452
+ profile_status_hydration_lines: 120,
453
+ profile_status_hydration_shown_lines: 100,
454
+ cross_profile_runtime_lines: 120,
455
+ cross_profile_runtime_shown_lines: 80,
456
+ all_mode_ai_history_lines: 120,
457
+ positions_pnl_lines: 240,
458
+ positions_pnl_shown_lines: 200,
459
+ positions_pnl_changed_rows: 12,
460
+ account_state_lines: 80,
461
+ account_state_shown_lines: 200,
462
+ symbol_hydration_lines: 120,
463
+ trade_ui_click_lines: 200,
464
+ manual_close_lines: 80,
465
+ all_mode_interaction_lines: 160,
466
+ chart_render_entries: 80,
467
+ control_state_lines: 80,
468
+ runtime_network_lines: 80,
469
+ provider_fallback_trace_lines: 60,
470
+ runtime_stop_trace_lines: 80,
471
+ runtime_stop_breadcrumb_lines: 40,
472
+ prompt_contract_trace_lines: 80,
473
+ execution_trace_lines: 120,
474
+ single_history_trace_lines: 40,
475
+ ignored_ticker_channels: 8,
476
+ recent_network_targets: 8,
477
+ provider_failure_blocks: 6,
478
+ market_data_failure_blocks: 8,
479
+ pricing_candidates_shown: 10,
480
+ balance_delta_coins: 3,
481
+ all_mode_ai_head_messages: 5,
482
+ server_execution_decisions: 10,
483
+ server_decisions_shown: 5,
484
+ server_execution_refresh_ms: 1e4,
485
+ interaction_sample_delay_ms: 250,
486
+ local_breadcrumb_refresh_ms: 1e3,
487
+ flicker_direction_flip_window_ms: 6e3,
488
+ flicker_warmup_window_ms: 3e4,
489
+ upnl_double_count_min_cents: 50,
490
+ upnl_double_count_tolerance_cents: 5,
491
+ upnl_source_gap_min_cents: 50,
492
+ nonzero_upnl_jump_min_cents: 25,
493
+ nonzero_upnl_jump_min_relative_percent: 50,
494
+ nonzero_upnl_jump_min_margin_percent: 2,
495
+ cross_source_upnl_flicker_max_age_ms: 1e3,
496
+ cross_source_upnl_flicker_min_cents: 5,
497
+ restart_trace_manual_stop_window_minutes: 15,
498
+ hold_age_rounding_ms: 100,
499
+ account_summary_missing_trace_ms: 5e3
500
+ },
501
+ insights_access: {
502
+ initial_prompt_idea_count: 6,
503
+ section_preview_blocks: 2
504
+ },
505
+ marketing: {
506
+ arena_leaderboard_entries: 3,
507
+ data_revalidate_seconds: 60
508
+ },
509
+ calendar: {
510
+ event_highlight_window_minutes: 60,
511
+ search_save_debounce_ms: 250
512
+ },
513
+ system_page: {
514
+ hyperliquid_manual_refresh_cooldown_ms: 800,
515
+ config_retry_initial_delay_ms: 1e3,
516
+ debug_api_profile_poll_ms: 500,
517
+ debug_save_lines: 120,
518
+ debug_model_sync_lines: 80,
519
+ debug_byok_trace_lines: 160,
520
+ debug_profile_delete_trace_lines: 80,
521
+ debug_local_ai_trace_lines: 120,
522
+ debug_hyperliquid_trace_lines: 120,
523
+ debug_oac_trace_lines: 120,
524
+ debug_oac_applied_state_lines: 40,
525
+ debug_report_trace_lines: 40,
526
+ debug_report_trace_line_chars: 360,
527
+ debug_field_value_chars: 96,
528
+ debug_identity_redact_max_chars: 8,
529
+ debug_identity_edge_chars: 4
530
+ },
531
+ analysis_page: {
532
+ debug_log_lines: 120
533
+ },
534
+ changelog_page: {
535
+ profile_search_debounce_ms: 300,
536
+ search_debounce_ms: 300,
537
+ scope_navigation_filters_max_age_ms: 3e4,
538
+ prompt_diff_context_lines: 3,
539
+ debug_event_lines: 120
540
+ },
541
+ help_page: {
542
+ hash_scroll_settle_ms: 250
543
+ },
544
+ history_page: {
545
+ preferences_save_debounce_ms: 500,
546
+ tracked_ws_prompt_id_count: 500,
547
+ ws_prompt_fingerprint_text_chars: 80,
548
+ load_more_visibility_percent: 10
549
+ },
550
+ leaderboard_page: {
551
+ debug_panel_entries: 80,
552
+ debug_navbar_profile_entries: 12
553
+ },
554
+ login_page: {
555
+ desktop_bridge_poll_ms: 250,
556
+ turnstile_site_key_log_chars: 10
557
+ },
558
+ screener_page: {
559
+ search_save_debounce_ms: 250,
560
+ ws_refresh_debounce_ms: 40,
561
+ stop_client_run_wait_checks: 30,
562
+ stop_client_run_wait_poll_ms: 50,
563
+ assignment_load_more_threshold_px: 48,
564
+ debug_log_lines: 160,
565
+ debug_runtime_events: 30,
566
+ debug_search_transitions: 40,
567
+ debug_expansion_transitions: 80,
568
+ debug_value_chars: 260,
569
+ debug_text_chars: 180,
570
+ debug_array_items: 20,
571
+ debug_event_preview_items: 12,
572
+ debug_snapshot_keys: 25,
573
+ debug_snapshot_rows: 8
574
+ },
575
+ sitemap: {
576
+ leaderboard_page_batch_size: 5,
577
+ leaderboard_max_pages: 160,
578
+ leaderboard_scan_attempts: 3,
579
+ home_priority_percent: 100,
580
+ team_priority_percent: 50,
581
+ contact_priority_percent: 50,
582
+ methodology_priority_percent: 80,
583
+ trust_priority_percent: 70,
584
+ insights_priority_percent: 90,
585
+ referrals_priority_percent: 60,
586
+ start_priority_percent: 80,
587
+ leaderboard_priority_percent: 90,
588
+ updates_priority_percent: 80,
589
+ changelog_priority_percent: 70,
590
+ models_priority_percent: 70,
591
+ calendar_priority_percent: 60,
592
+ help_priority_percent: 70,
593
+ faq_priority_percent: 70,
594
+ download_priority_percent: 70,
595
+ privacy_priority_percent: 30,
596
+ terms_priority_percent: 30,
597
+ update_post_priority_percent: 60,
598
+ profile_trade_priority_percent: 70,
599
+ profile_analytics_priority_percent: 70,
600
+ profile_changelog_priority_percent: 60
601
+ },
602
+ tax_page: {
603
+ display_batch_size: 50,
604
+ load_more_delay_ms: 120,
605
+ load_more_visibility_percent: 10,
606
+ selectable_year_count: 5,
607
+ debug_log_lines: 150
608
+ },
609
+ updates_page: {
610
+ post_edited_label_min_gap_ms: 6e4,
611
+ comment_edited_label_min_gap_ms: 2e3,
612
+ meta_description_chars: 160
613
+ },
614
+ social_previews: {
615
+ subject_max_chars: 96,
616
+ viewport_width: 1600,
617
+ viewport_height: 900,
618
+ chart_painted_min_px: 100,
619
+ chart_paint_poll_ms: 200
620
+ },
621
+ manual_order_retry: {
622
+ max_attempts: 2,
623
+ default_retry_after_milliseconds: 1500,
624
+ retry_after_padding_milliseconds: 200,
625
+ min_delay_milliseconds: 500,
626
+ max_delay_milliseconds: 8e3
627
+ },
628
+ api_client: {
629
+ get_dedupe_ttl_ms: 2e3,
630
+ runtime_statuses_dedupe_ttl_ms: 5e3,
631
+ llm_config_prime_ttl_ms: 1e4,
632
+ leaderboard_dedupe_ttl_ms: 2e3,
633
+ platform_pricing_revalidate_seconds: 300,
634
+ platform_pricing_timeout_ms: 2e3,
635
+ market_data_error_detail_chars: 240,
636
+ market_data_interest_error_detail_chars: 200,
637
+ ai_trade_history_order_id_lookup_concurrency: 4,
638
+ exchange_evidence_rejection_detail_chars: 200
639
+ },
640
+ interaction: {
641
+ debounce_ms: 250,
642
+ command_list_scroll_settle_ms: 60
643
+ },
644
+ model_selection: {
645
+ local_context_cache_ttl_hours: 12,
646
+ pending_local_main_selection_ttl_hours: 12,
647
+ pending_openai_compatible_main_selection_ttl_hours: 12
50
648
  }
51
649
  },
52
650
  ai_dashboard: {
@@ -88,6 +686,13 @@ var runtime_policy_generated_default = {
88
686
  72,
89
687
  168
90
688
  ]
689
+ },
690
+ defaults: {
691
+ calendar_settings: {
692
+ pre_buffer_mins: 60,
693
+ post_buffer_mins: 30
694
+ },
695
+ max_chat_turns: 9999
91
696
  }
92
697
  },
93
698
  trading: {
@@ -99,10 +704,14 @@ var runtime_policy_generated_default = {
99
704
  network_backoff_max_seconds: 300,
100
705
  steal_ack_timeout_ms: 5e3,
101
706
  explicit_claim_max_waits: 3,
102
- local_ai_preflight_timeout_ms: 3e3
707
+ local_ai_preflight_timeout_ms: 3e3,
708
+ wake_debounce_ms: 250,
709
+ claim_settle_poll_ms: 50,
710
+ network_backoff_exponent_max: 16
103
711
  },
104
712
  observability: {
105
- deployment_reload_stall_warning_ms: 15e3
713
+ deployment_reload_stall_warning_ms: 15e3,
714
+ prompt_parity_error_detail_max_chars: 500
106
715
  },
107
716
  protective_actions: {
108
717
  adoption_request_timeout_milliseconds: 2e4,
@@ -110,11 +719,16 @@ var runtime_policy_generated_default = {
110
719
  attention_refresh_seconds: 60,
111
720
  evidence_max_items: 32,
112
721
  evidence_shared_read_seconds: 10,
113
- retry_delay_seconds: 15
722
+ retry_delay_seconds: 15,
723
+ evidence_min_sweep_delay_milliseconds: 1e3,
724
+ device_sweep_max_actions: 8,
725
+ remaining_recheck_milliseconds: 2e3,
726
+ evidence_max_age_seconds: 45
114
727
  },
115
728
  exchange_mutation: {
116
729
  settlement_retry_milliseconds: 1e3,
117
- settlement_retry_window_seconds: 120
730
+ settlement_retry_window_seconds: 120,
731
+ reconciliation_margin_milliseconds: 250
118
732
  },
119
733
  protective_plan_set_lock: {
120
734
  wait_seconds: 120
@@ -128,7 +742,8 @@ var runtime_policy_generated_default = {
128
742
  device_retry_seconds: 60
129
743
  },
130
744
  panel_reads: {
131
- device_open_orders_reuse_seconds: 2
745
+ device_open_orders_reuse_seconds: 2,
746
+ all_view_profile_concurrency: 2
132
747
  },
133
748
  account_stream: {
134
749
  fill_forward_interval_ms: 1e3,
@@ -145,9 +760,56 @@ var runtime_policy_generated_default = {
145
760
  ai_schedule_pause_unknown_milliseconds: 6e4,
146
761
  provider_failure_diagnostics_delay_milliseconds: 2500,
147
762
  provider_failure_diagnostics_max_age_milliseconds: 3e4,
148
- killswitch_timer_floor_milliseconds: 1e3
763
+ killswitch_timer_floor_milliseconds: 1e3,
764
+ cycle_timeout_floor_milliseconds: 1e3,
765
+ decision_settlement_reserve_max_budget_divisor: 2,
766
+ close_fill_sync_max_attempts: 3,
767
+ close_fill_sync_retry_step_milliseconds: 300,
768
+ execution_mode_mismatch_stop_checks: 2,
769
+ request_bounds: {
770
+ min_agent_instruction_retry_after_ms: 25,
771
+ max_fallback_error_length: 500
772
+ },
773
+ pending_protection_recovery: {
774
+ retry_exponent_max: 30
775
+ },
776
+ device_diagnostics: {
777
+ error_cause_max_depth: 4,
778
+ request_path_chars: 200,
779
+ request_method_chars: 12,
780
+ error_kind_chars: 40,
781
+ request_id_chars: 128,
782
+ contract_token_prefix_chars: 12,
783
+ copy_trading_request_id_chars: 80,
784
+ copy_trading_status_chars: 80,
785
+ browser_platform_chars: 40,
786
+ breadcrumbs_max_entries: 40,
787
+ breadcrumb_detail_chars: 280,
788
+ network_debug_max_entries: 80,
789
+ provider_failure_debug_max_entries: 20,
790
+ market_data_failure_debug_max_entries: 20,
791
+ request_string_compact_above_chars: 500,
792
+ prompt_preview_chars: 220,
793
+ provider_failure_snapshot_max_age_seconds: 300,
794
+ local_provider_probe_timeout_ms: 2e3,
795
+ preflight_failure_reason_chars: 200,
796
+ host_error_note_chars: 160,
797
+ tick_failure_note_chars: 300,
798
+ auto_resume_failure_detail_chars: 500,
799
+ vault_migration_error_chars: 200
800
+ },
801
+ request_retry: {
802
+ max_attempts: 3,
803
+ base_delay_milliseconds: 300,
804
+ max_delay_milliseconds: 8e3,
805
+ min_retry_after_milliseconds: 250,
806
+ deadline_attempt_spacing_milliseconds: 250
807
+ }
149
808
  },
150
809
  server_runtime: {
810
+ exchange_mutation_reconciliation: {
811
+ protective_episode_end_fill_lookback_seconds: 120
812
+ },
151
813
  prompt_rescue: {
152
814
  request_ttl_seconds: 20,
153
815
  snapshot_max_age_seconds: 5,
@@ -156,7 +818,14 @@ var runtime_policy_generated_default = {
156
818
  client_claim_retry_delay_milliseconds: 1e3,
157
819
  client_failure_report_timeout_milliseconds: 2e3,
158
820
  client_presence_heartbeat_interval_milliseconds: 3e4,
159
- client_presence_http_timeout_milliseconds: 5e3
821
+ client_presence_http_timeout_milliseconds: 5e3,
822
+ client_claim_completion_buffer_milliseconds: 250,
823
+ client_max_concurrent_jobs_max: 32,
824
+ diagnostics_max_elapsed_ms: 12e4,
825
+ diagnostics_max_pending_reads: 1e3,
826
+ diagnostics_max_clock_offset_ms: 864e5,
827
+ failure_max_reported_weight: 1e6,
828
+ failure_max_retry_after_ms: 36e5
160
829
  }
161
830
  }
162
831
  },
@@ -164,19 +833,45 @@ var runtime_policy_generated_default = {
164
833
  max_requests_per_read: 64,
165
834
  history_start_ms: 16409952e5,
166
835
  device_read_deadline_seconds: 180,
167
- device_recent_window_hours: 24
836
+ device_recent_window_hours: 24,
837
+ order_history_default_limit: 2e3,
838
+ order_history_max_limit: 2e3
839
+ },
840
+ tradability: {
841
+ score_min: 1,
842
+ score_max: 10
168
843
  }
169
844
  },
170
845
  agent_cli: {
171
846
  update_check_interval_ms: 144e5,
172
847
  update_check_timeout_ms: 5e3,
173
848
  stage_timeout_ms: 6e5,
174
- startup_ready_timeout_ms: 12e4
849
+ startup_ready_timeout_ms: 12e4,
850
+ headless_claim_max_waits: 10,
851
+ headless_stop_request_timeout_ms: 1e4,
852
+ headless_max_resumes_without_a_cycle: 5,
853
+ headless_resume_backoff_ms_steps: [
854
+ 1e3,
855
+ 5e3,
856
+ 15e3,
857
+ 3e4,
858
+ 6e4
859
+ ],
860
+ headless_backup_first_read_retry_ms_steps: [
861
+ 1e3,
862
+ 5e3
863
+ ],
864
+ browser_login_verifier_bytes: 32,
865
+ update_failure_reason_max_chars: 160,
866
+ update_directory_failure_reason_max_chars: 120,
867
+ update_plan_max_attempts: 3,
868
+ supervisor_max_failed_release_starts: 2
175
869
  },
176
870
  leaderboard: {
177
871
  device_portfolio: {
178
872
  device_retry_seconds: 300
179
- }
873
+ },
874
+ max_page_size: 100
180
875
  },
181
876
  external_inference: {
182
877
  service: {
@@ -194,6 +889,13 @@ var runtime_policy_generated_default = {
194
889
  update_readiness_timeout_ms: 6e5,
195
890
  rollback_confirmation_min_attempts: 100,
196
891
  ready_consecutive_observations: 2,
892
+ update_attempts: 3,
893
+ update_retry_interval_ms: 2e3,
894
+ update_failure_reason_max_chars: 160,
895
+ launcher_poll_interval_ms: 100,
896
+ log_tail_default_lines: 100,
897
+ worker_output_line_max_chars: 4096,
898
+ worker_stdout_tail_max_chars: 65536,
197
899
  control_lock_wait_attempts: 400,
198
900
  control_lock_retry_interval_ms: 250,
199
901
  supervisor_manifest_poll_interval_ms: 250,
@@ -202,6 +904,44 @@ var runtime_policy_generated_default = {
202
904
  claim_diagnostics: {
203
905
  event_loop_sample_interval_ms: 100
204
906
  },
907
+ host_core: {
908
+ oauth_request_timeout_ms: 15e3,
909
+ oauth_revocation_timeout_ms: 5e3,
910
+ oauth_login_timeout_ms: 6e5,
911
+ mcp_request_timeout_ms: 15e3,
912
+ mcp_retry_after_max_ms: 864e5,
913
+ credential_command_timeout_ms: 15e3,
914
+ credential_command_termination_timeout_ms: 5e3,
915
+ credential_command_output_max_bytes: 1048576,
916
+ private_file_max_bytes: 16777216,
917
+ private_file_replace_attempts: 40,
918
+ private_file_replace_retry_delay_ms: 25,
919
+ atomic_replacement_read_attempts: 3,
920
+ owned_directory_removal_attempts: 10,
921
+ owned_directory_removal_retry_step_ms: 100,
922
+ identity_command_timeout_ms: 5e3,
923
+ identity_command_output_max_bytes: 4096,
924
+ windows_identity_command_timeout_ms: 15e3,
925
+ windows_process_identity_output_max_bytes: 1024,
926
+ windows_acl_broker_startup_timeout_ms: 9e4,
927
+ windows_acl_broker_request_timeout_ms: 15e3,
928
+ windows_acl_broker_idle_shutdown_ms: 3e4,
929
+ windows_acl_broker_kill_grace_ms: 1e3,
930
+ windows_acl_broker_request_max_bytes: 65536,
931
+ windows_acl_broker_output_max_chars: 65536,
932
+ windows_acl_broker_response_line_max_chars: 4096,
933
+ process_lock_publication_grace_ms: 1e4,
934
+ process_lock_record_max_bytes: 65536,
935
+ process_lock_guard_election_lease_ms: 5e3,
936
+ process_lock_guard_election_stale_ms: 3e4,
937
+ process_lock_guard_election_attempts: 8,
938
+ process_lock_guard_election_backoff_ms: 10,
939
+ process_lock_guard_election_backoff_exponent_max: 4,
940
+ process_lock_identity_cache_ms: 5e3
941
+ },
942
+ agent_control: {
943
+ max_turn_decision_operation_ids: 128
944
+ },
205
945
  host_runtime: {
206
946
  advertisement_ttl_ms: 12e4,
207
947
  advertisement_refresh_lead_ms: 3e4,
@@ -210,6 +950,9 @@ var runtime_policy_generated_default = {
210
950
  agent_heartbeat_interval_ms: 3e3,
211
951
  agent_heartbeat_max_retry_delay_ms: 9e3,
212
952
  provider_rate_limit_refresh_ms: 6e4,
953
+ provider_quota_recovery_max_age_refresh_intervals: 2,
954
+ model_catalog_read_lead_divisor: 2,
955
+ agent_wake_summary_max_chars: 2e3,
213
956
  drain_timeout_ms: 3e4,
214
957
  remote_retry_limit: 3,
215
958
  minimum_sleep_ms: 10,
@@ -234,10 +977,72 @@ var runtime_policy_generated_default = {
234
977
  agent_turn_timeout_ms: 6e5,
235
978
  codex_rate_limit_metadata_timeout_ms: 5e3,
236
979
  codex_login_timeout_ms: 9e5,
237
- codex_command_timeout_ms: 3e4
980
+ codex_command_timeout_ms: 3e4,
981
+ cli_wait_default_seconds: 50,
982
+ cli_wait_max_seconds: 300,
983
+ cli_log_lines_default: 100,
984
+ cli_log_lines_max: 1e4,
985
+ service_control_input_max_chars: 4096,
986
+ codex_auth_file_max_bytes: 8388608,
987
+ agent_stdin_max_bytes: 1e6,
988
+ agent_next_poll_min_ms: 50,
989
+ agent_assignment_poll_min_ms: 250,
990
+ agent_assignment_poll_fallback_ms: 1e3,
991
+ agent_assignment_poll_max_ms: 5e3,
992
+ codex_recovery_scan_max_entries: 2e4,
993
+ codex_recovery_scan_max_depth: 12,
994
+ codex_recovery_thread_file_max_bytes: 33554432,
995
+ codex_recovery_thread_scan_lines: 128,
996
+ codex_quiescence_proof_max_age_ms: 3e4,
997
+ codex_quiescence_proof_clock_skew_ms: 1e3,
998
+ codex_guardian_start_timeout_ms: 1e4,
999
+ codex_guardian_termination_timeout_ms: 5e3,
1000
+ codex_guardian_termination_deadline_min_ms: 25,
1001
+ codex_guardian_state_poll_ms: 25,
1002
+ codex_guardian_shutdown_grace_ms: 2e3,
1003
+ codex_guardian_shutdown_grace_min_ms: 25,
1004
+ codex_guardian_receipt_replace_attempts: 40,
1005
+ codex_guardian_receipt_replace_retry_ms: 25,
1006
+ codex_diagnostic_attempt_ids_max: 64,
1007
+ codex_retired_response_ids_max: 256,
1008
+ codex_stderr_classification_tail_chars: 1024,
1009
+ codex_request_timeout_ms: 3e4,
1010
+ codex_interrupt_timeout_ms: 5e3,
1011
+ codex_login_cancel_timeout_ms: 5e3,
1012
+ codex_close_exit_timeout_ms: 5e3,
1013
+ codex_close_terminate_timeout_ms: 1e3,
1014
+ codex_close_kill_timeout_ms: 1e3,
1015
+ codex_process_tree_cleanup_timeout_ms: 5e3,
1016
+ binary_version_probe_timeout_ms: 1e4,
1017
+ binary_version_probe_stdout_max_chars: 1024,
1018
+ codex_version_probe_stderr_max_bytes: 65536,
1019
+ codex_recovery_process_observations: 2,
1020
+ codex_recovery_process_observation_interval_ms: 250,
1021
+ codex_recovery_process_query_stdout_max_chars: 4e6,
1022
+ codex_recovery_process_query_stderr_max_chars: 4096,
1023
+ deepseek_transport_request_max_bytes: 8388608,
1024
+ exo_command_output_max_bytes: 4e6,
1025
+ exo_git_output_max_chars: 2e5,
1026
+ exo_bridge_request_max_bytes: 2e6,
1027
+ exo_bridge_request_timeout_ms: 3e4,
1028
+ exo_provider_retry_after_max_ms: 864e5,
1029
+ grok_preflight_timeout_ms: 3e4,
1030
+ grok_login_timeout_ms: 9e5,
1031
+ grok_command_timeout_ms: 3e4,
1032
+ grok_auth_output_max_bytes: 65536,
1033
+ grok_binary_max_bytes: 536870912,
1034
+ grok_acp_message_max_bytes: 2e6,
1035
+ grok_close_kill_delay_ms: 1500,
1036
+ grok_mcp_request_max_bytes: 3e5,
1037
+ grok_cwd_marker_max_bytes: 32768,
1038
+ grok_session_summary_max_bytes: 1048576,
1039
+ provider_error_body_timeout_ms: 1e3,
1040
+ provider_error_body_max_bytes: 16384,
1041
+ pi_receipt_event_max_chars: 2e6
238
1042
  },
239
1043
  quota_membership_cooldown_seconds: 300,
240
- transient_membership_cooldown_seconds: 30
1044
+ transient_membership_cooldown_seconds: 30,
1045
+ runtime_poll_interval_milliseconds: 250
241
1046
  },
242
1047
  desktop: {
243
1048
  runtime_watchdog: {
@@ -252,6 +1057,19 @@ var runtime_policy_generated_default = {
252
1057
  resource_scheduler: {
253
1058
  client_lock_ttl_milliseconds: 12e4,
254
1059
  client_poll_interval_milliseconds: 250
1060
+ },
1061
+ ui_bounds: {
1062
+ screener_min_volume_usd_max: 1e9
1063
+ },
1064
+ runtime: {
1065
+ assignment_page_default_limit: 20,
1066
+ client_candidate_owner_lease_grace_ms: 6e4,
1067
+ client_server_heartbeats_per_owner_lease: 2,
1068
+ client_server_heartbeat_min_ms: 5e3,
1069
+ client_server_heartbeat_max_ms: 3e4
1070
+ },
1071
+ defaults: {
1072
+ adaptive_schedule_enabled: true
255
1073
  }
256
1074
  },
257
1075
  deployment: {
@@ -373,13 +1191,27 @@ var runtime_policy_generated_default = {
373
1191
  },
374
1192
  market_data: {
375
1193
  chart_interest: {
376
- historical_backfill_candle_limit: 1e3
1194
+ historical_backfill_candle_limit: 1e3,
1195
+ heartbeat_retry_seconds: 15,
1196
+ heartbeat_min_delay_ms: 1e3,
1197
+ catch_up_candle_limit: 300
377
1198
  }
378
1199
  },
379
1200
  auth: {
380
1201
  tokens: {
381
1202
  email_2fa_code_length: 6,
382
1203
  totp_code_length: 6
1204
+ },
1205
+ passwords: {
1206
+ min_length: 12
1207
+ }
1208
+ },
1209
+ android: {
1210
+ app_host: {
1211
+ profiles_refresh_interval_seconds: 60,
1212
+ running_report_interval_seconds: 5,
1213
+ page_identity_retry_seconds: 5,
1214
+ profiles_read_timeout_seconds: 30
383
1215
  }
384
1216
  },
385
1217
  websocket: {
@@ -394,6 +1226,9 @@ var runtime_policy_generated_default = {
394
1226
  notifications: {
395
1227
  desktop: {
396
1228
  heartbeat_seconds: 20
1229
+ },
1230
+ telegram: {
1231
+ connect_link_poll_ms: 3e3
397
1232
  }
398
1233
  },
399
1234
  validation: {
@@ -408,9 +1243,138 @@ var runtime_policy_generated_default = {
408
1243
  handle_changes_per_window: 2,
409
1244
  handle_change_window_days: 14
410
1245
  }
1246
+ },
1247
+ copy_trading: {
1248
+ source_search: {
1249
+ min_query_length: 2
1250
+ },
1251
+ runtime: {
1252
+ client_account_mode_cache_budget_divisor: 2
1253
+ }
1254
+ },
1255
+ billing: {
1256
+ credit_purchase: {
1257
+ amount_usd_steps: [
1258
+ 10,
1259
+ 25,
1260
+ 50,
1261
+ 100,
1262
+ 500,
1263
+ 1e3
1264
+ ]
1265
+ }
1266
+ },
1267
+ admin: {
1268
+ page: {
1269
+ credit_grant_amount_usd_steps: [
1270
+ 10,
1271
+ 25,
1272
+ 50,
1273
+ 100,
1274
+ 500,
1275
+ 1e3,
1276
+ 5e3,
1277
+ 1e4,
1278
+ 5e4,
1279
+ 1e5
1280
+ ],
1281
+ user_lookup_blur_close_delay_ms: 200,
1282
+ selected_user_refresh_delay_ms: 300,
1283
+ handle_preview_count: 3
1284
+ },
1285
+ models: {
1286
+ analytics: {
1287
+ summary_failure_kinds: 3
1288
+ }
1289
+ },
1290
+ user_search: {
1291
+ min_query_length: 2
1292
+ }
1293
+ },
1294
+ profile_setting_changelog: {
1295
+ public_profile_search_limit: 10,
1296
+ page_default_limit: 50
1297
+ },
1298
+ history: {
1299
+ full_history_default_limit: 20,
1300
+ default_page_size: 50,
1301
+ trade_lookup_max_order_ids: 200,
1302
+ decision_batch_default_limit: 50
1303
+ },
1304
+ updates: {
1305
+ posts: {
1306
+ list_default_limit: 20,
1307
+ list_max_limit: 100
1308
+ }
1309
+ },
1310
+ security: {
1311
+ byok: {
1312
+ max_provider_keys_per_provider: 5
1313
+ }
1314
+ },
1315
+ analysis: {
1316
+ live_request_candles: {
1317
+ default_limit: 100
1318
+ }
1319
+ },
1320
+ users: {
1321
+ search: {
1322
+ min_query_length: 2
1323
+ }
1324
+ },
1325
+ referrals: {
1326
+ code_max_length: 24,
1327
+ dashboard_default_limit: 20
1328
+ },
1329
+ insights: {
1330
+ client_host: {
1331
+ device_read_default_result_bytes: 2e5
1332
+ }
1333
+ },
1334
+ agent_tokens: {
1335
+ browser_login_ttl_seconds: 600,
1336
+ browser_login_poll_interval_seconds: 2
411
1337
  }
412
1338
  };
413
1339
 
1340
+ // lib/constants.ts
1341
+ var MS_PER_SECOND = 1e3;
1342
+ var SECONDS_PER_MINUTE = 60;
1343
+ var MINUTES_PER_HOUR = 60;
1344
+ var HOURS_PER_DAY = 24;
1345
+ var DAYS_PER_WEEK = 7;
1346
+ var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
1347
+ var SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
1348
+ var SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
1349
+ var SECONDS_PER_WEEK = SECONDS_PER_DAY * DAYS_PER_WEEK;
1350
+ var MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;
1351
+ var MINUTES_PER_WEEK = MINUTES_PER_DAY * DAYS_PER_WEEK;
1352
+ var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
1353
+ var MS_PER_DAY = MS_PER_HOUR * HOURS_PER_DAY;
1354
+ var READ_STAMP_TIE_MS = MS_PER_SECOND / 1e6;
1355
+ var BACKOFF_GROWTH_FACTOR = 2;
1356
+ var BYTES_PER_KIB = 1024;
1357
+ var BYTES_PER_MIB = BYTES_PER_KIB * BYTES_PER_KIB;
1358
+ var OWNER_ONLY_FILE_MODE = 384;
1359
+ var OWNER_ONLY_DIRECTORY_MODE = 448;
1360
+ var GROUP_OTHER_PERMISSION_BITS = 63;
1361
+ var INT32_MIN = -(2 ** 31);
1362
+ var INT32_MAX = 2 ** 31 - 1;
1363
+ var AI_COST_ESTIMATE_PERIOD_DAYS = 30;
1364
+ var SECONDS_PER_AI_COST_ESTIMATE_PERIOD = SECONDS_PER_DAY * AI_COST_ESTIMATE_PERIOD_DAYS;
1365
+ var EXIT_CODE_TEMPFAIL = 75;
1366
+ var INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION = 2;
1367
+ var INFERENCE_HOST_RECLAIM_GUARD_CREATE_PASSES = 2;
1368
+ var LINUX_PROC_STAT_COMM_TERMINATOR_CHARS = 2;
1369
+ var INFERENCE_HOST_RANDOM_BYTES = {
1370
+ TEMP_FILE_SUFFIX: 12,
1371
+ LOCK_BALLOT_NAME: 16,
1372
+ LOCK_TOKEN: 24,
1373
+ OAUTH_PKCE_VERIFIER: 48,
1374
+ OAUTH_STATE: 32,
1375
+ OAUTH_CALLBACK_PATH: 16
1376
+ };
1377
+
414
1378
  // lib/inference-host/service-launcher.ts
415
1379
  import { spawn as spawn2 } from "node:child_process";
416
1380
  import { appendFile, readFile as readFile3, rm as rm3 } from "node:fs/promises";
@@ -424,13 +1388,14 @@ import { constants } from "node:fs";
424
1388
  import { lstat, mkdir, open, readdir, readFile, realpath, rename, rm } from "node:fs/promises";
425
1389
  import { homedir } from "node:os";
426
1390
  import { basename, dirname, isAbsolute, join, relative, resolve, win32 as windowsPath } from "node:path";
1391
+ var HOST_CORE_POLICY = runtime_policy_generated_default.external_inference.host_core;
427
1392
  var InferenceHostProcessLockBusyError = class extends Error {
428
1393
  constructor() {
429
1394
  super("Another inference host process already owns this local host.");
430
1395
  this.name = "InferenceHostProcessLockBusyError";
431
1396
  }
432
1397
  };
433
- var MAX_INFERENCE_PRIVATE_FILE_BYTES = 16 * 1024 * 1024;
1398
+ var MAX_INFERENCE_PRIVATE_FILE_BYTES = HOST_CORE_POLICY.private_file_max_bytes;
434
1399
  var WINDOWS_PRIVATE_ACL_MODES = ["harden", "verify", "verify-owner", "verify-private"];
435
1400
  var WINDOWS_PRIVATE_ACL_BROKER_SCRIPT = `$ErrorActionPreference='Stop'
436
1401
  $ProgressPreference='SilentlyContinue'
@@ -438,7 +1403,7 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
438
1403
  $requestId=$null
439
1404
  $failureStage='request_validation'
440
1405
  try {
441
- if($line.Length -lt 2 -or $line.Length -gt 65536) { throw 'invalid request size' }
1406
+ if($line.Length -lt 2 -or $line.Length -gt ${HOST_CORE_POLICY.windows_acl_broker_request_max_bytes}) { throw 'invalid request size' }
442
1407
  $request=$line | ConvertFrom-Json
443
1408
  $names=@($request.PSObject.Properties.Name | Sort-Object)
444
1409
  if(($names -join ',') -ne 'id,kind,mode,path_b64') { throw 'invalid request shape' }
@@ -514,9 +1479,9 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
514
1479
  [Console]::Out.WriteLine((@{id=$requestId;status='error';error_code=$failureStage} | ConvertTo-Json -Compress))
515
1480
  }
516
1481
  }`;
517
- var WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS = 15e3;
518
- var WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS = 9e4;
519
- var SMALL_IDENTITY_COMMAND_TIMEOUT_MS = 5e3;
1482
+ var WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS = HOST_CORE_POLICY.windows_identity_command_timeout_ms;
1483
+ var WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS = HOST_CORE_POLICY.windows_acl_broker_startup_timeout_ms;
1484
+ var SMALL_IDENTITY_COMMAND_TIMEOUT_MS = HOST_CORE_POLICY.identity_command_timeout_ms;
520
1485
  var windowsPowerShellEnvironment = (extra = {}) => {
521
1486
  const sanitizedExtra = { ...extra };
522
1487
  delete sanitizedExtra.PSModulePath;
@@ -559,9 +1524,9 @@ var WindowsPrivateAclBroker = class {
559
1524
  this.queue = operation.then(() => void 0, () => void 0);
560
1525
  await operation;
561
1526
  };
562
- this.requestTimeoutMs = dependencies.requestTimeoutMs ?? 15e3;
1527
+ this.requestTimeoutMs = dependencies.requestTimeoutMs ?? HOST_CORE_POLICY.windows_acl_broker_request_timeout_ms;
563
1528
  this.startupRequestTimeoutMs = dependencies.startupRequestTimeoutMs ?? WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS;
564
- this.idleShutdownMs = dependencies.idleShutdownMs ?? 3e4;
1529
+ this.idleShutdownMs = dependencies.idleShutdownMs ?? HOST_CORE_POLICY.windows_acl_broker_idle_shutdown_ms;
565
1530
  this.spawnProcess = dependencies.spawnProcess ?? (() => {
566
1531
  const invocation = windowsPrivateAclBrokerInvocation();
567
1532
  return spawn("powershell.exe", [...invocation.args], {
@@ -580,7 +1545,7 @@ var WindowsPrivateAclBroker = class {
580
1545
  this.child = null;
581
1546
  this.outputBuffer = "";
582
1547
  child.stdin.end();
583
- const force = setTimeout(() => child.kill("SIGKILL"), 1e3);
1548
+ const force = setTimeout(() => child.kill("SIGKILL"), HOST_CORE_POLICY.windows_acl_broker_kill_grace_ms);
584
1549
  force.unref();
585
1550
  child.once("exit", () => clearTimeout(force));
586
1551
  }, this.idleShutdownMs);
@@ -604,7 +1569,7 @@ var WindowsPrivateAclBroker = class {
604
1569
  }
605
1570
  acceptLine(child, line) {
606
1571
  const pending = this.pending;
607
- if (!pending || !line || line.length > 4096) {
1572
+ if (!pending || !line || line.length > HOST_CORE_POLICY.windows_acl_broker_response_line_max_chars) {
608
1573
  this.failChild(child, new Error("Windows private ACL broker returned malformed output."));
609
1574
  return;
610
1575
  }
@@ -655,7 +1620,7 @@ var WindowsPrivateAclBroker = class {
655
1620
  child.stdout.on("data", (chunk) => {
656
1621
  if (this.child !== child) return;
657
1622
  this.outputBuffer += chunk;
658
- if (this.outputBuffer.length > 65536) {
1623
+ if (this.outputBuffer.length > HOST_CORE_POLICY.windows_acl_broker_output_max_chars) {
659
1624
  this.failChild(child, new Error("Windows private ACL broker exceeded its output limit."));
660
1625
  return;
661
1626
  }
@@ -693,7 +1658,7 @@ var WindowsPrivateAclBroker = class {
693
1658
  path_b64: Buffer.from(path, "utf8").toString("base64")
694
1659
  })}
695
1660
  `;
696
- if (Buffer.byteLength(request, "utf8") > 65536) {
1661
+ if (Buffer.byteLength(request, "utf8") > HOST_CORE_POLICY.windows_acl_broker_request_max_bytes) {
697
1662
  throw new Error("Windows private ACL broker request exceeds its input limit.");
698
1663
  }
699
1664
  const { child, startedNow } = this.ensureChild();
@@ -797,7 +1762,7 @@ var linuxProcessIdentity = async (pid) => {
797
1762
  readFile("/proc/sys/kernel/random/boot_id", "utf8"),
798
1763
  readFile(`/proc/${pid}/stat`, "utf8")
799
1764
  ]);
800
- const fields = statLine.slice(statLine.lastIndexOf(")") + 2).trim().split(/\s+/u);
1765
+ const fields = statLine.slice(statLine.lastIndexOf(")") + LINUX_PROC_STAT_COMM_TERMINATOR_CHARS).trim().split(/\s+/u);
801
1766
  const startTicks = fields[19];
802
1767
  return startTicks ? `linux:${bootId.trim()}:${startTicks}` : null;
803
1768
  } catch {
@@ -852,7 +1817,7 @@ var windowsProcessIdentity = async (pid) => await new Promise((resolvePromise) =
852
1817
  settle(null);
853
1818
  }, invocation.timeoutMs);
854
1819
  child.stdout.on("data", (chunk) => {
855
- if (output.reduce((total, item) => total + item.byteLength, 0) + Buffer.byteLength(chunk) > 1024) {
1820
+ if (output.reduce((total, item) => total + item.byteLength, 0) + Buffer.byteLength(chunk) > HOST_CORE_POLICY.windows_process_identity_output_max_bytes) {
856
1821
  child.kill("SIGKILL");
857
1822
  settle(null);
858
1823
  return;
@@ -880,12 +1845,12 @@ var darwinProcessIdentity = async (pid) => await new Promise((resolvePromise) =>
880
1845
  const timer = setTimeout(() => {
881
1846
  child.kill("SIGKILL");
882
1847
  settle(null);
883
- }, 5e3);
1848
+ }, SMALL_IDENTITY_COMMAND_TIMEOUT_MS);
884
1849
  child.stdout.on("data", (chunk) => output.push(Buffer.from(chunk)));
885
1850
  child.once("error", () => settle(null));
886
1851
  child.once("exit", (code) => {
887
1852
  const started = Date.parse(Buffer.concat(output).toString("utf8").trim());
888
- settle(code === 0 && Number.isFinite(started) ? `darwin:${Math.floor(started / 1e3)}` : null);
1853
+ settle(code === 0 && Number.isFinite(started) ? `darwin:${Math.floor(started / MS_PER_SECOND)}` : null);
889
1854
  });
890
1855
  });
891
1856
  var runSmallIdentityCommand = async (command, args, env, timeoutMs = SMALL_IDENTITY_COMMAND_TIMEOUT_MS) => await new Promise((resolvePromise) => {
@@ -909,7 +1874,7 @@ var runSmallIdentityCommand = async (command, args, env, timeoutMs = SMALL_IDENT
909
1874
  }, timeoutMs);
910
1875
  child.stdout.on("data", (chunk) => {
911
1876
  bytes += Buffer.byteLength(chunk);
912
- if (bytes > 4096) {
1877
+ if (bytes > HOST_CORE_POLICY.identity_command_output_max_bytes) {
913
1878
  child.kill("SIGKILL");
914
1879
  settle(null);
915
1880
  return;
@@ -996,7 +1961,7 @@ async function ensureInferencePrivateDirectory(path, dependencies = {}) {
996
1961
  }
997
1962
  } catch (error) {
998
1963
  if (error.code !== "ENOENT") throw error;
999
- await mkdir(path, { recursive: true, mode: 448 });
1964
+ await mkdir(path, { recursive: true, mode: OWNER_ONLY_DIRECTORY_MODE });
1000
1965
  created = true;
1001
1966
  }
1002
1967
  const after = await lstat(path);
@@ -1017,7 +1982,7 @@ async function ensureInferencePrivateDirectory(path, dependencies = {}) {
1017
1982
  }
1018
1983
  return;
1019
1984
  }
1020
- if ((after.mode & 63) !== 0) {
1985
+ if ((after.mode & GROUP_OTHER_PERMISSION_BITS) !== 0) {
1021
1986
  throw new Error("Inference host state directory must have mode 0700.");
1022
1987
  }
1023
1988
  if (typeof process.getuid === "function" && after.uid !== process.getuid()) {
@@ -1048,8 +2013,8 @@ async function replaceAtomicInferencePrivateFile(temporaryPath, destinationPath,
1048
2013
  const platform = options.platform ?? process.platform;
1049
2014
  const renameFile = options.renameFile ?? rename;
1050
2015
  const sleep = options.sleep ?? ((milliseconds) => new Promise((resolve4) => setTimeout(resolve4, milliseconds)));
1051
- const maxAttempts = Math.max(1, options.maxAttempts ?? 40);
1052
- const retryDelayMs = Math.max(0, options.retryDelayMs ?? 25);
2016
+ const maxAttempts = Math.max(1, options.maxAttempts ?? HOST_CORE_POLICY.private_file_replace_attempts);
2017
+ const retryDelayMs = Math.max(0, options.retryDelayMs ?? HOST_CORE_POLICY.private_file_replace_retry_delay_ms);
1053
2018
  for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
1054
2019
  try {
1055
2020
  await renameFile(temporaryPath, destinationPath);
@@ -1075,12 +2040,12 @@ async function writeAtomicInferencePrivateFile(path, contents, dependencies = {}
1075
2040
  }
1076
2041
  const temporary = join(
1077
2042
  directory,
1078
- `.${process.pid}.${randomBytes(12).toString("hex")}.tmp`
2043
+ `.${process.pid}.${randomBytes(INFERENCE_HOST_RANDOM_BYTES.TEMP_FILE_SUFFIX).toString("hex")}.tmp`
1079
2044
  );
1080
2045
  const handle = await open(
1081
2046
  temporary,
1082
2047
  constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW,
1083
- 384
2048
+ OWNER_ONLY_FILE_MODE
1084
2049
  );
1085
2050
  try {
1086
2051
  await handle.writeFile(contents, "utf8");
@@ -1129,12 +2094,12 @@ async function writeAtomicInferencePrivateFile(path, contents, dependencies = {}
1129
2094
  throw error;
1130
2095
  }
1131
2096
  }
1132
- var PROCESS_LOCK_PUBLICATION_GRACE_MS = 1e4;
1133
- var PROCESS_LOCK_MAX_RECORD_BYTES = 64 * 1024;
1134
- var PROCESS_LOCK_GUARD_ELECTION_LEASE_MS = 5e3;
1135
- var PROCESS_LOCK_GUARD_ELECTION_STALE_MS = 3e4;
1136
- var PROCESS_LOCK_GUARD_ELECTION_ATTEMPTS = 8;
1137
- var PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS = 10;
2097
+ var PROCESS_LOCK_PUBLICATION_GRACE_MS = HOST_CORE_POLICY.process_lock_publication_grace_ms;
2098
+ var PROCESS_LOCK_MAX_RECORD_BYTES = HOST_CORE_POLICY.process_lock_record_max_bytes;
2099
+ var PROCESS_LOCK_GUARD_ELECTION_LEASE_MS = HOST_CORE_POLICY.process_lock_guard_election_lease_ms;
2100
+ var PROCESS_LOCK_GUARD_ELECTION_STALE_MS = HOST_CORE_POLICY.process_lock_guard_election_stale_ms;
2101
+ var PROCESS_LOCK_GUARD_ELECTION_ATTEMPTS = HOST_CORE_POLICY.process_lock_guard_election_attempts;
2102
+ var PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS = HOST_CORE_POLICY.process_lock_guard_election_backoff_ms;
1138
2103
  var PROCESS_LOCK_LABEL = "Inference host process lock";
1139
2104
  var PROCESS_LOCK_GUARD_LABEL = "Inference host process lock reclamation guard";
1140
2105
  var sameProcessLockFile = (left, right) => left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeMs === right.mtimeMs && left.ctimeMs === right.ctimeMs;
@@ -1143,7 +2108,7 @@ var openExclusiveProcessLockFile = async (path) => {
1143
2108
  return await open(
1144
2109
  path,
1145
2110
  constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW,
1146
- 384
2111
+ OWNER_ONLY_FILE_MODE
1147
2112
  );
1148
2113
  } catch (error) {
1149
2114
  if (error.code === "EEXIST") return null;
@@ -1158,7 +2123,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
1158
2123
  if (error.code === "ENOENT") return { state: "missing" };
1159
2124
  throw error;
1160
2125
  }
1161
- if (before.isSymbolicLink() || !before.isFile() || process.platform !== "win32" && (before.mode & 63) !== 0 || typeof process.getuid === "function" && before.uid !== process.getuid()) {
2126
+ if (before.isSymbolicLink() || !before.isFile() || process.platform !== "win32" && (before.mode & GROUP_OTHER_PERMISSION_BITS) !== 0 || typeof process.getuid === "function" && before.uid !== process.getuid()) {
1162
2127
  throw new Error(`${label} is unsafe.`);
1163
2128
  }
1164
2129
  let handle;
@@ -1185,7 +2150,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
1185
2150
  } catch {
1186
2151
  record = null;
1187
2152
  }
1188
- if (!record || record.schema_version !== 2 || !Number.isSafeInteger(record.pid) || Number(record.pid) < 1 || typeof record.owner_token !== "string" || !record.owner_token || typeof record.process_identity !== "string" || !record.process_identity || typeof record.boot_identity !== "string" || !record.boot_identity) {
2153
+ if (!record || record.schema_version !== INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION || !Number.isSafeInteger(record.pid) || Number(record.pid) < 1 || typeof record.owner_token !== "string" || !record.owner_token || typeof record.process_identity !== "string" || !record.process_identity || typeof record.boot_identity !== "string" || !record.boot_identity) {
1189
2154
  if (Date.now() - stat.mtimeMs < PROCESS_LOCK_PUBLICATION_GRACE_MS) return { state: "busy" };
1190
2155
  stale = true;
1191
2156
  return { state: "stale", handle, stat };
@@ -1195,7 +2160,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
1195
2160
  const cacheKey = resolve(path);
1196
2161
  if (await probes.currentBootIdentity() === record.boot_identity && probes.isProcessAlive(ownerPid)) {
1197
2162
  const cached = processLockObservationCache.get(cacheKey);
1198
- const observedIdentity = cached && cached.dev === stat.dev && cached.ino === stat.ino && cached.pid === ownerPid && cached.storedIdentity === storedIdentity && Date.now() - cached.observedAtMs < 5e3 ? cached.observedIdentity : await probes.observeIdentity(ownerPid);
2163
+ const observedIdentity = cached && cached.dev === stat.dev && cached.ino === stat.ino && cached.pid === ownerPid && cached.storedIdentity === storedIdentity && Date.now() - cached.observedAtMs < HOST_CORE_POLICY.process_lock_identity_cache_ms ? cached.observedIdentity : await probes.observeIdentity(ownerPid);
1199
2164
  if (!observedIdentity) {
1200
2165
  throw new Error("Inference host could not verify the existing lock owner identity.");
1201
2166
  }
@@ -1252,7 +2217,7 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
1252
2217
  if (attempt > 0) {
1253
2218
  await new Promise((resolvePromise) => setTimeout(
1254
2219
  resolvePromise,
1255
- Math.floor(Math.random() * PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS * 2 ** Math.min(attempt, 4))
2220
+ Math.floor(Math.random() * PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS * BACKOFF_GROWTH_FACTOR ** Math.min(attempt, HOST_CORE_POLICY.process_lock_guard_election_backoff_exponent_max))
1256
2221
  ));
1257
2222
  let current;
1258
2223
  try {
@@ -1263,7 +2228,7 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
1263
2228
  }
1264
2229
  if (!sameProcessLockFile(current, inspection.stat)) return;
1265
2230
  }
1266
- const ballotName = `${prefix}${randomBytes(16).toString("hex")}`;
2231
+ const ballotName = `${prefix}${randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_BALLOT_NAME).toString("hex")}`;
1267
2232
  const ballotPath = join(directory, ballotName);
1268
2233
  const ballot = await openExclusiveProcessLockFile(ballotPath);
1269
2234
  if (!ballot) continue;
@@ -1305,8 +2270,8 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
1305
2270
  };
1306
2271
  var acquireProcessLockReclaimGuard = async (lockPath, ownerRecord, probes) => {
1307
2272
  const guardPath = `${lockPath}.reclaim`;
1308
- const guardToken = randomBytes(24).toString("base64url");
1309
- for (let attempt = 0; attempt < 2; attempt += 1) {
2273
+ const guardToken = randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_TOKEN).toString("base64url");
2274
+ for (let attempt = 0; attempt < INFERENCE_HOST_RECLAIM_GUARD_CREATE_PASSES; attempt += 1) {
1310
2275
  const handle = await openExclusiveProcessLockFile(guardPath);
1311
2276
  if (handle) {
1312
2277
  try {
@@ -1368,7 +2333,7 @@ var acquireProcessLockReclaimGuard = async (lockPath, ownerRecord, probes) => {
1368
2333
  async function acquireInferenceHostProcessLock(path, dependencies = {}) {
1369
2334
  const directory = dirname(path);
1370
2335
  await ensureInferencePrivateDirectory(directory);
1371
- const ownerToken = randomBytes(24).toString("base64url");
2336
+ const ownerToken = randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_TOKEN).toString("base64url");
1372
2337
  const probes = {
1373
2338
  currentBootIdentity: dependencies.currentBootIdentity ?? (() => readInferenceSystemBootIdentity()),
1374
2339
  observeIdentity: dependencies.processIdentity ?? defaultProcessIdentity,
@@ -1387,7 +2352,7 @@ async function acquireInferenceHostProcessLock(path, dependencies = {}) {
1387
2352
  probes.currentBootIdentity()
1388
2353
  ]);
1389
2354
  const ownerRecord = (token) => `${JSON.stringify({
1390
- schema_version: 2,
2355
+ schema_version: INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION,
1391
2356
  pid: process.pid,
1392
2357
  owner_token: token,
1393
2358
  process_identity: ownerIdentity,
@@ -1539,7 +2504,7 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
1539
2504
  let manifest;
1540
2505
  const log = async (event, version) => {
1541
2506
  await appendFile(manifest.log_path, `${JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), event, package_version: version })}
1542
- `, { mode: 384 }).catch(() => void 0);
2507
+ `, { mode: OWNER_ONLY_FILE_MODE }).catch(() => void 0);
1543
2508
  };
1544
2509
  const runCore = dependencies.runCore ?? ((executable, target, args) => {
1545
2510
  const processChild = spawn2(executable, [target.script, ...args], {
@@ -1646,7 +2611,7 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
1646
2611
  r();
1647
2612
  return;
1648
2613
  }
1649
- const timer2 = setTimeout(done, 100);
2614
+ const timer2 = setTimeout(done, runtime_policy_generated_default.external_inference.service.launcher_poll_interval_ms);
1650
2615
  function done() {
1651
2616
  clearTimeout(timer2);
1652
2617
  readiness.signal.removeEventListener("abort", done);
@@ -1700,12 +2665,12 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
1700
2665
  break;
1701
2666
  } catch (error) {
1702
2667
  if (!/already owns/iu.test(error instanceof Error ? error.message : "")) throw error;
1703
- await new Promise((r) => setTimeout(r, 100));
2668
+ await new Promise((r) => setTimeout(r, runtime_policy_generated_default.external_inference.service.launcher_poll_interval_ms));
1704
2669
  }
1705
2670
  }
1706
2671
  }
1707
2672
  if (!await desired()) return 0;
1708
- if (code === 75) {
2673
+ if (code === EXIT_CODE_TEMPFAIL) {
1709
2674
  const selected = await readLauncherSelection(manifestPath);
1710
2675
  if (selected && selected.package_version !== state.active.package_version) {
1711
2676
  let next;