4runr-os 2.9.57 → 2.9.58

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.
@@ -603,6 +603,11 @@ fn main() -> Result<()> {
603
603
  terminal.clear()?;
604
604
  }
605
605
 
606
+ // When on Setup Portal, sync terminal buffer to real console size (fixes windowed-mode corruption)
607
+ if matches!(current_screen, crate::screens::Screen::SetupPortal) {
608
+ let _ = terminal.autoresize();
609
+ }
610
+
606
611
  let render_start = Instant::now();
607
612
  terminal.draw(|f| app.render(f))?;
608
613
  let render_duration = render_start.elapsed().as_millis() as u64;
@@ -144,7 +144,7 @@ fn render_header(f: &mut Frame, area: Rect, state: &AppState) {
144
144
 
145
145
  // Line 1: Brand + version + mode + uptime - Bug 3 fix: Use "4Runr." with dot (matches brand logo)
146
146
  // Use npm package version (2.9.24) - matches package.json
147
- const PACKAGE_VERSION: &str = "2.9.57";
147
+ const PACKAGE_VERSION: &str = "2.9.58";
148
148
  let brand_line = Line::from(vec![
149
149
  Span::styled("4Runr.", Style::default().fg(BRAND_PURPLE).add_modifier(Modifier::BOLD)),
150
150
  Span::styled(" AI AGENT OS", Style::default().fg(BRAND_VIOLET)),
@@ -5,6 +5,17 @@ use ratatui::prelude::*;
5
5
  use ratatui::widgets::{Block, Borders, Paragraph, Wrap, Clear, List, ListItem};
6
6
  use crate::app::{AppState, GatewayOption};
7
7
 
8
+ /// When SETUP_PORTAL_DEBUG=1, log to stderr (works in release). Use to capture dimensions/layout when windowed.
9
+ fn setup_debug_enabled() -> bool {
10
+ std::env::var("SETUP_PORTAL_DEBUG").as_deref() == Ok("1")
11
+ }
12
+
13
+ fn dbg_log(msg: &str) {
14
+ if setup_debug_enabled() {
15
+ eprintln!("{}", msg);
16
+ }
17
+ }
18
+
8
19
  // === 4RUNR BRAND COLORS (matching layout.rs) ===
9
20
  const BRAND_PURPLE: Color = Color::Rgb(138, 43, 226);
10
21
  const CYBER_CYAN: Color = Color::Rgb(0, 255, 255);
@@ -27,14 +38,22 @@ pub fn render(f: &mut Frame, state: &mut AppState) {
27
38
 
28
39
  let area = f.size();
29
40
 
30
- // Debug: log dimensions when building with debug_assertions (cargo run / debug build)
31
- #[cfg(debug_assertions)]
32
- {
41
+ // Debug: log dimensions when SETUP_PORTAL_DEBUG=1 (release) or in debug build
42
+ let do_dbg = setup_debug_enabled() || cfg!(debug_assertions);
43
+ if do_dbg {
33
44
  static mut LAST_DIMS: Option<(u16, u16)> = None;
45
+ static mut FRAME_COUNT: u64 = 0;
46
+ static mut BANNER_SHOWN: bool = false;
34
47
  unsafe {
48
+ if !BANNER_SHOWN {
49
+ eprintln!("[SETUP_PORTAL] Debug logging active (SETUP_PORTAL_DEBUG=1 or debug build). Redirect stderr to capture, e.g. 4r 2> setup-debug.log");
50
+ BANNER_SHOWN = true;
51
+ }
52
+ FRAME_COUNT += 1;
35
53
  let changed = LAST_DIMS.map_or(true, |(w, h)| w != area.width || h != area.height);
36
- if changed {
37
- eprintln!("[SETUP_PORTAL] R#{} DIMS: {}x{} (prev: {:?})", render_id, area.width, area.height, LAST_DIMS);
54
+ if changed || FRAME_COUNT <= 15 || FRAME_COUNT % 60 == 0 {
55
+ eprintln!("[SETUP_PORTAL] R#{} frame={} DIMS: {}x{} (changed={})",
56
+ render_id, FRAME_COUNT, area.width, area.height, changed);
38
57
  LAST_DIMS = Some((area.width, area.height));
39
58
  }
40
59
  }
@@ -72,6 +91,10 @@ pub fn render(f: &mut Frame, state: &mut AppState) {
72
91
  width: portal_width,
73
92
  height: portal_height,
74
93
  };
94
+ if do_dbg {
95
+ dbg_log(&format!("[SETUP_PORTAL] portal_area: x={} y={} w={} h={}",
96
+ portal_area.x, portal_area.y, portal_area.width, portal_area.height));
97
+ }
75
98
 
76
99
  // Split portal into sections
77
100
  use ratatui::layout::{Constraint, Direction, Layout};
@@ -99,6 +122,10 @@ pub fn render(f: &mut Frame, state: &mut AppState) {
99
122
  .direction(Direction::Vertical)
100
123
  .constraints(constraints)
101
124
  .split(portal_area);
125
+ if do_dbg {
126
+ let c = &chunks[2];
127
+ dbg_log(&format!("[SETUP_PORTAL] content chunk: x={} y={} w={} h={}", c.x, c.y, c.width, c.height));
128
+ }
102
129
 
103
130
  render_header(f, chunks[0], state);
104
131
  render_description(f, chunks[1]);
@@ -165,6 +192,15 @@ fn render_content(f: &mut Frame, area: Rect, state: &mut AppState, render_id: u6
165
192
  }
166
193
 
167
194
  fn render_options_list(f: &mut Frame, area: Rect, state: &mut AppState, _render_id: u64) {
195
+ if setup_debug_enabled() {
196
+ static mut N: u64 = 0;
197
+ unsafe {
198
+ N += 1;
199
+ if N <= 5 || N % 120 == 0 {
200
+ dbg_log(&format!("[LIST] area: x={} y={} w={} h={}", area.x, area.y, area.width, area.height));
201
+ }
202
+ }
203
+ }
168
204
  // Clear this rect first so no duplicate rows from previous frame
169
205
  f.render_widget(Clear, area);
170
206
 
@@ -207,6 +243,15 @@ fn render_options_list(f: &mut Frame, area: Rect, state: &mut AppState, _render_
207
243
  .style(Style::default().bg(BG_PANEL));
208
244
 
209
245
  let inner = block.inner(area);
246
+ if setup_debug_enabled() {
247
+ static mut N: u64 = 0;
248
+ unsafe {
249
+ N += 1;
250
+ if N <= 5 || N % 120 == 0 {
251
+ dbg_log(&format!("[LIST] inner: x={} y={} w={} h={}", inner.x, inner.y, inner.width, inner.height));
252
+ }
253
+ }
254
+ }
210
255
  f.render_widget(block, area);
211
256
 
212
257
  // Fill inner area
@@ -219,6 +264,15 @@ fn render_options_list(f: &mut Frame, area: Rect, state: &mut AppState, _render_
219
264
  }
220
265
 
221
266
  fn render_option_details(f: &mut Frame, area: Rect, state: &AppState, _render_id: u64) {
267
+ if setup_debug_enabled() {
268
+ static mut N: u64 = 0;
269
+ unsafe {
270
+ N += 1;
271
+ if N <= 5 || N % 120 == 0 {
272
+ dbg_log(&format!("[DETAILS] area: x={} y={} w={} h={}", area.x, area.y, area.width, area.height));
273
+ }
274
+ }
275
+ }
222
276
  // Clear this rect first so no leftover from previous option
223
277
  f.render_widget(Clear, area);
224
278
 
@@ -315,12 +369,24 @@ fn render_option_details(f: &mut Frame, area: Rect, state: &AppState, _render_id
315
369
  .style(Style::default().bg(BG_PANEL));
316
370
 
317
371
  let inner = block.inner(area);
372
+ if setup_debug_enabled() {
373
+ static mut N: u64 = 0;
374
+ unsafe {
375
+ N += 1;
376
+ if N <= 5 || N % 120 == 0 {
377
+ dbg_log(&format!("[DETAILS] inner: x={} y={} w={} h={}", inner.x, inner.y, inner.width, inner.height));
378
+ }
379
+ }
380
+ }
318
381
  f.render_widget(block, area);
319
382
 
320
383
  // Validate area before rendering
321
384
  let terminal_size = f.size();
322
385
  if inner.width == 0 || inner.height == 0 ||
323
386
  inner.x >= terminal_size.width || inner.y >= terminal_size.height {
387
+ if setup_debug_enabled() {
388
+ dbg_log("[DETAILS] SKIP render: inner or terminal invalid");
389
+ }
324
390
  return;
325
391
  }
326
392
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "4runr-os",
3
- "version": "2.9.57",
3
+ "version": "2.9.58",
4
4
  "type": "module",
5
- "description": "4Runr AI Agent OS - Secure terminal interface for AI agents. v2.9.57: Auto-update fix for Windows (shell, where 4r, better errors). v2.9.56: Setup Portal debug in debug builds. ⚠️ Pre-MVP / Development Phase",
5
+ "description": "4Runr AI Agent OS - Secure terminal interface for AI agents. v2.9.58: Setup Portal autoresize + SETUP_PORTAL_DEBUG=1 for windowed-mode debug. v2.9.57: Auto-update Windows fix. ⚠️ Pre-MVP / Development Phase",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
8
  "4runr": "dist/index.js",