4runr-os 2.1.4 → 2.1.5

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.
Files changed (566) hide show
  1. package/dist/index.js +16 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/tui_mk1/kernel.d.ts.map +1 -1
  4. package/dist/tui_mk1/kernel.js +107 -4
  5. package/dist/tui_mk1/kernel.js.map +1 -1
  6. package/dist/tui_mk1/layout/layoutEngine.d.ts +38 -19
  7. package/dist/tui_mk1/layout/layoutEngine.d.ts.map +1 -1
  8. package/dist/tui_mk1/layout/layoutEngine.js +521 -228
  9. package/dist/tui_mk1/layout/layoutEngine.js.map +1 -1
  10. package/dist/tui_mk1/log.d.ts +23 -0
  11. package/dist/tui_mk1/log.d.ts.map +1 -0
  12. package/dist/tui_mk1/log.js +125 -0
  13. package/dist/tui_mk1/log.js.map +1 -0
  14. package/dist/tui_mk1/logger.d.ts.map +1 -1
  15. package/dist/tui_mk1/logger.js +20 -10
  16. package/dist/tui_mk1/logger.js.map +1 -1
  17. package/dist/tui_mk1/mk1App.d.ts +13 -18
  18. package/dist/tui_mk1/mk1App.d.ts.map +1 -1
  19. package/dist/tui_mk1/mk1App.js +334 -157
  20. package/dist/tui_mk1/mk1App.js.map +1 -1
  21. package/dist/tui_mk1/resizeController.d.ts.map +1 -1
  22. package/dist/tui_mk1/resizeController.js +15 -1
  23. package/dist/tui_mk1/resizeController.js.map +1 -1
  24. package/dist/tui_mk1/stdoutGuard.d.ts.map +1 -1
  25. package/dist/tui_mk1/stdoutGuard.js +7 -0
  26. package/dist/tui_mk1/stdoutGuard.js.map +1 -1
  27. package/dist/tui_mk1/terminalRestore.d.ts.map +1 -1
  28. package/dist/tui_mk1/terminalRestore.js +19 -1
  29. package/dist/tui_mk1/terminalRestore.js.map +1 -1
  30. package/dist/tui_mk1/ui/offenderScanner.d.ts +31 -0
  31. package/dist/tui_mk1/ui/offenderScanner.d.ts.map +1 -0
  32. package/dist/tui_mk1/ui/offenderScanner.js +80 -0
  33. package/dist/tui_mk1/ui/offenderScanner.js.map +1 -0
  34. package/dist/tui_mk1/ui/safe.d.ts +9 -0
  35. package/dist/tui_mk1/ui/safe.d.ts.map +1 -0
  36. package/dist/tui_mk1/ui/safe.js +29 -0
  37. package/dist/tui_mk1/ui/safe.js.map +1 -0
  38. package/dist/tui_mk1/ui/safeText.d.ts +22 -0
  39. package/dist/tui_mk1/ui/safeText.d.ts.map +1 -0
  40. package/dist/tui_mk1/ui/safeText.js +50 -0
  41. package/dist/tui_mk1/ui/safeText.js.map +1 -0
  42. package/dist/tui_mk1/ui/uiBuilder.d.ts +44 -0
  43. package/dist/tui_mk1/ui/uiBuilder.d.ts.map +1 -0
  44. package/dist/tui_mk1/ui/uiBuilder.js +467 -0
  45. package/dist/tui_mk1/ui/uiBuilder.js.map +1 -0
  46. package/dist/tui_mk1/viewport/safeViewport.d.ts +10 -1
  47. package/dist/tui_mk1/viewport/safeViewport.d.ts.map +1 -1
  48. package/dist/tui_mk1/viewport/safeViewport.js +47 -15
  49. package/dist/tui_mk1/viewport/safeViewport.js.map +1 -1
  50. package/dist/tui_mk2/kernel.d.ts +28 -0
  51. package/dist/tui_mk2/kernel.d.ts.map +1 -0
  52. package/dist/tui_mk2/kernel.js +86 -0
  53. package/dist/tui_mk2/kernel.js.map +1 -0
  54. package/dist/tui_mk2/mk2App.d.ts +33 -0
  55. package/dist/tui_mk2/mk2App.d.ts.map +1 -0
  56. package/dist/tui_mk2/mk2App.js +93 -0
  57. package/dist/tui_mk2/mk2App.js.map +1 -0
  58. package/package.json +8 -7
  59. package/dist/tui_mk1/ui/panels/createSection.d.ts +0 -18
  60. package/dist/tui_mk1/ui/panels/createSection.d.ts.map +0 -1
  61. package/dist/tui_mk1/ui/panels/createSection.js +0 -42
  62. package/dist/tui_mk1/ui/panels/createSection.js.map +0 -1
  63. package/dist/tui_mk1/ui/panels.d.ts +0 -23
  64. package/dist/tui_mk1/ui/panels.d.ts.map +0 -1
  65. package/dist/tui_mk1/ui/panels.js +0 -108
  66. package/dist/tui_mk1/ui/panels.js.map +0 -1
  67. package/dist/tui_mk1/ui/render/sectionRenderer.d.ts +0 -21
  68. package/dist/tui_mk1/ui/render/sectionRenderer.d.ts.map +0 -1
  69. package/dist/tui_mk1/ui/render/sectionRenderer.js +0 -32
  70. package/dist/tui_mk1/ui/render/sectionRenderer.js.map +0 -1
  71. package/dist/tui_mk1/ui/widgetManager.d.ts +0 -58
  72. package/dist/tui_mk1/ui/widgetManager.d.ts.map +0 -1
  73. package/dist/tui_mk1/ui/widgetManager.js +0 -197
  74. package/dist/tui_mk1/ui/widgetManager.js.map +0 -1
  75. package/dist/ui/boot/sequence.d.ts +0 -10
  76. package/dist/ui/boot/sequence.d.ts.map +0 -1
  77. package/dist/ui/boot/sequence.js +0 -171
  78. package/dist/ui/boot/sequence.js.map +0 -1
  79. package/dist/ui/constraints/layoutSpec.d.ts +0 -47
  80. package/dist/ui/constraints/layoutSpec.d.ts.map +0 -1
  81. package/dist/ui/constraints/layoutSpec.js +0 -60
  82. package/dist/ui/constraints/layoutSpec.js.map +0 -1
  83. package/dist/ui/constraints/unknownHandling.d.ts +0 -29
  84. package/dist/ui/constraints/unknownHandling.d.ts.map +0 -1
  85. package/dist/ui/constraints/unknownHandling.js +0 -60
  86. package/dist/ui/constraints/unknownHandling.js.map +0 -1
  87. package/dist/ui/drilldowns/feed.d.ts +0 -11
  88. package/dist/ui/drilldowns/feed.d.ts.map +0 -1
  89. package/dist/ui/drilldowns/feed.js +0 -68
  90. package/dist/ui/drilldowns/feed.js.map +0 -1
  91. package/dist/ui/drilldowns/index.d.ts +0 -7
  92. package/dist/ui/drilldowns/index.d.ts.map +0 -1
  93. package/dist/ui/drilldowns/index.js +0 -8
  94. package/dist/ui/drilldowns/index.js.map +0 -1
  95. package/dist/ui/drilldowns/posture.d.ts +0 -11
  96. package/dist/ui/drilldowns/posture.d.ts.map +0 -1
  97. package/dist/ui/drilldowns/posture.js +0 -74
  98. package/dist/ui/drilldowns/posture.js.map +0 -1
  99. package/dist/ui/intelligence-posture-view.d.ts +0 -22
  100. package/dist/ui/intelligence-posture-view.d.ts.map +0 -1
  101. package/dist/ui/intelligence-posture-view.js +0 -169
  102. package/dist/ui/intelligence-posture-view.js.map +0 -1
  103. package/dist/ui/navigation/keymaps.d.ts +0 -26
  104. package/dist/ui/navigation/keymaps.d.ts.map +0 -1
  105. package/dist/ui/navigation/keymaps.js +0 -135
  106. package/dist/ui/navigation/keymaps.js.map +0 -1
  107. package/dist/ui/navigation/palette.d.ts +0 -10
  108. package/dist/ui/navigation/palette.d.ts.map +0 -1
  109. package/dist/ui/navigation/palette.js +0 -133
  110. package/dist/ui/navigation/palette.js.map +0 -1
  111. package/dist/ui/navigation/state.d.ts +0 -47
  112. package/dist/ui/navigation/state.d.ts.map +0 -1
  113. package/dist/ui/navigation/state.js +0 -84
  114. package/dist/ui/navigation/state.js.map +0 -1
  115. package/dist/ui/navigation/types.d.ts +0 -38
  116. package/dist/ui/navigation/types.d.ts.map +0 -1
  117. package/dist/ui/navigation/types.js +0 -36
  118. package/dist/ui/navigation/types.js.map +0 -1
  119. package/dist/ui/panels/active-assets.d.ts +0 -12
  120. package/dist/ui/panels/active-assets.d.ts.map +0 -1
  121. package/dist/ui/panels/active-assets.js +0 -83
  122. package/dist/ui/panels/active-assets.js.map +0 -1
  123. package/dist/ui/panels/capability-flags.d.ts +0 -12
  124. package/dist/ui/panels/capability-flags.d.ts.map +0 -1
  125. package/dist/ui/panels/capability-flags.js +0 -59
  126. package/dist/ui/panels/capability-flags.js.map +0 -1
  127. package/dist/ui/panels/command-surface.d.ts +0 -12
  128. package/dist/ui/panels/command-surface.d.ts.map +0 -1
  129. package/dist/ui/panels/command-surface.js +0 -55
  130. package/dist/ui/panels/command-surface.js.map +0 -1
  131. package/dist/ui/panels/network-origin.d.ts +0 -12
  132. package/dist/ui/panels/network-origin.d.ts.map +0 -1
  133. package/dist/ui/panels/network-origin.js +0 -79
  134. package/dist/ui/panels/network-origin.js.map +0 -1
  135. package/dist/ui/panels/operations-feed.d.ts +0 -12
  136. package/dist/ui/panels/operations-feed.d.ts.map +0 -1
  137. package/dist/ui/panels/operations-feed.js +0 -90
  138. package/dist/ui/panels/operations-feed.js.map +0 -1
  139. package/dist/ui/panels/posture.d.ts +0 -12
  140. package/dist/ui/panels/posture.d.ts.map +0 -1
  141. package/dist/ui/panels/posture.js +0 -84
  142. package/dist/ui/panels/posture.js.map +0 -1
  143. package/dist/ui/panels/resources.d.ts +0 -11
  144. package/dist/ui/panels/resources.d.ts.map +0 -1
  145. package/dist/ui/panels/resources.js +0 -88
  146. package/dist/ui/panels/resources.js.map +0 -1
  147. package/dist/ui/primitives/Panel.d.ts +0 -25
  148. package/dist/ui/primitives/Panel.d.ts.map +0 -1
  149. package/dist/ui/primitives/Panel.js +0 -59
  150. package/dist/ui/primitives/Panel.js.map +0 -1
  151. package/dist/ui/rendering/metricRenderer.d.ts +0 -24
  152. package/dist/ui/rendering/metricRenderer.d.ts.map +0 -1
  153. package/dist/ui/rendering/metricRenderer.js +0 -86
  154. package/dist/ui/rendering/metricRenderer.js.map +0 -1
  155. package/dist/ui/runtime/hub.d.ts +0 -12
  156. package/dist/ui/runtime/hub.d.ts.map +0 -1
  157. package/dist/ui/runtime/hub.js +0 -486
  158. package/dist/ui/runtime/hub.js.map +0 -1
  159. package/dist/ui/runtime/hubValidation.d.ts +0 -23
  160. package/dist/ui/runtime/hubValidation.d.ts.map +0 -1
  161. package/dist/ui/runtime/hubValidation.js +0 -90
  162. package/dist/ui/runtime/hubValidation.js.map +0 -1
  163. package/dist/ui/runtime/index.d.ts +0 -29
  164. package/dist/ui/runtime/index.d.ts.map +0 -1
  165. package/dist/ui/runtime/index.js +0 -297
  166. package/dist/ui/runtime/index.js.map +0 -1
  167. package/dist/ui/runtime/no-tui.d.ts +0 -12
  168. package/dist/ui/runtime/no-tui.d.ts.map +0 -1
  169. package/dist/ui/runtime/no-tui.js +0 -77
  170. package/dist/ui/runtime/no-tui.js.map +0 -1
  171. package/dist/ui/runtime/state-builder.d.ts +0 -13
  172. package/dist/ui/runtime/state-builder.d.ts.map +0 -1
  173. package/dist/ui/runtime/state-builder.js +0 -114
  174. package/dist/ui/runtime/state-builder.js.map +0 -1
  175. package/dist/ui/runtime/terminalSizeCheck.d.ts +0 -10
  176. package/dist/ui/runtime/terminalSizeCheck.d.ts.map +0 -1
  177. package/dist/ui/runtime/terminalSizeCheck.js +0 -51
  178. package/dist/ui/runtime/terminalSizeCheck.js.map +0 -1
  179. package/dist/ui/runtime/tuiLogGate.d.ts +0 -22
  180. package/dist/ui/runtime/tuiLogGate.d.ts.map +0 -1
  181. package/dist/ui/runtime/tuiLogGate.js +0 -68
  182. package/dist/ui/runtime/tuiLogGate.js.map +0 -1
  183. package/dist/ui/state/types.d.ts +0 -72
  184. package/dist/ui/state/types.d.ts.map +0 -1
  185. package/dist/ui/state/types.js +0 -6
  186. package/dist/ui/state/types.js.map +0 -1
  187. package/dist/ui/theme/borders.d.ts +0 -20
  188. package/dist/ui/theme/borders.d.ts.map +0 -1
  189. package/dist/ui/theme/borders.js +0 -55
  190. package/dist/ui/theme/borders.js.map +0 -1
  191. package/dist/ui/theme/tokens.d.ts +0 -28
  192. package/dist/ui/theme/tokens.d.ts.map +0 -1
  193. package/dist/ui/theme/tokens.js +0 -50
  194. package/dist/ui/theme/tokens.js.map +0 -1
  195. package/dist/ui/theme/typography.d.ts +0 -14
  196. package/dist/ui/theme/typography.d.ts.map +0 -1
  197. package/dist/ui/theme/typography.js +0 -30
  198. package/dist/ui/theme/typography.js.map +0 -1
  199. package/dist/ui/v3/collectors/assets.collector.d.ts +0 -20
  200. package/dist/ui/v3/collectors/assets.collector.d.ts.map +0 -1
  201. package/dist/ui/v3/collectors/assets.collector.js +0 -80
  202. package/dist/ui/v3/collectors/assets.collector.js.map +0 -1
  203. package/dist/ui/v3/collectors/capabilities.collector.d.ts +0 -18
  204. package/dist/ui/v3/collectors/capabilities.collector.d.ts.map +0 -1
  205. package/dist/ui/v3/collectors/capabilities.collector.js +0 -113
  206. package/dist/ui/v3/collectors/capabilities.collector.js.map +0 -1
  207. package/dist/ui/v3/collectors/network.collector.d.ts +0 -18
  208. package/dist/ui/v3/collectors/network.collector.d.ts.map +0 -1
  209. package/dist/ui/v3/collectors/network.collector.js +0 -37
  210. package/dist/ui/v3/collectors/network.collector.js.map +0 -1
  211. package/dist/ui/v3/collectors/posture.derive.d.ts +0 -24
  212. package/dist/ui/v3/collectors/posture.derive.d.ts.map +0 -1
  213. package/dist/ui/v3/collectors/posture.derive.js +0 -57
  214. package/dist/ui/v3/collectors/posture.derive.js.map +0 -1
  215. package/dist/ui/v3/collectors/resources.d.ts +0 -23
  216. package/dist/ui/v3/collectors/resources.d.ts.map +0 -1
  217. package/dist/ui/v3/collectors/resources.js +0 -136
  218. package/dist/ui/v3/collectors/resources.js.map +0 -1
  219. package/dist/ui/v3/commands/commandEngine.d.ts +0 -77
  220. package/dist/ui/v3/commands/commandEngine.d.ts.map +0 -1
  221. package/dist/ui/v3/commands/commandEngine.js +0 -3289
  222. package/dist/ui/v3/commands/commandEngine.js.map +0 -1
  223. package/dist/ui/v3/commands/commandResult.d.ts +0 -25
  224. package/dist/ui/v3/commands/commandResult.d.ts.map +0 -1
  225. package/dist/ui/v3/commands/commandResult.js +0 -19
  226. package/dist/ui/v3/commands/commandResult.js.map +0 -1
  227. package/dist/ui/v3/commands/diagnose.d.ts +0 -17
  228. package/dist/ui/v3/commands/diagnose.d.ts.map +0 -1
  229. package/dist/ui/v3/commands/diagnose.js +0 -62
  230. package/dist/ui/v3/commands/diagnose.js.map +0 -1
  231. package/dist/ui/v3/commands/errorClassifier.d.ts +0 -23
  232. package/dist/ui/v3/commands/errorClassifier.d.ts.map +0 -1
  233. package/dist/ui/v3/commands/errorClassifier.js +0 -63
  234. package/dist/ui/v3/commands/errorClassifier.js.map +0 -1
  235. package/dist/ui/v3/commands/parser.d.ts +0 -14
  236. package/dist/ui/v3/commands/parser.d.ts.map +0 -1
  237. package/dist/ui/v3/commands/parser.js +0 -29
  238. package/dist/ui/v3/commands/parser.js.map +0 -1
  239. package/dist/ui/v3/commands/router.d.ts +0 -13
  240. package/dist/ui/v3/commands/router.d.ts.map +0 -1
  241. package/dist/ui/v3/commands/router.js +0 -150
  242. package/dist/ui/v3/commands/router.js.map +0 -1
  243. package/dist/ui/v3/config/gateway.d.ts +0 -40
  244. package/dist/ui/v3/config/gateway.d.ts.map +0 -1
  245. package/dist/ui/v3/config/gateway.js +0 -113
  246. package/dist/ui/v3/config/gateway.js.map +0 -1
  247. package/dist/ui/v3/core/event.d.ts +0 -19
  248. package/dist/ui/v3/core/event.d.ts.map +0 -1
  249. package/dist/ui/v3/core/event.js +0 -7
  250. package/dist/ui/v3/core/event.js.map +0 -1
  251. package/dist/ui/v3/core/eventBus.d.ts +0 -39
  252. package/dist/ui/v3/core/eventBus.d.ts.map +0 -1
  253. package/dist/ui/v3/core/eventBus.js +0 -79
  254. package/dist/ui/v3/core/eventBus.js.map +0 -1
  255. package/dist/ui/v3/core/feedStore.d.ts +0 -34
  256. package/dist/ui/v3/core/feedStore.d.ts.map +0 -1
  257. package/dist/ui/v3/core/feedStore.js +0 -46
  258. package/dist/ui/v3/core/feedStore.js.map +0 -1
  259. package/dist/ui/v3/core/logger.d.ts +0 -40
  260. package/dist/ui/v3/core/logger.d.ts.map +0 -1
  261. package/dist/ui/v3/core/logger.js +0 -191
  262. package/dist/ui/v3/core/logger.js.map +0 -1
  263. package/dist/ui/v3/core/opEvent.d.ts +0 -15
  264. package/dist/ui/v3/core/opEvent.d.ts.map +0 -1
  265. package/dist/ui/v3/core/opEvent.js +0 -7
  266. package/dist/ui/v3/core/opEvent.js.map +0 -1
  267. package/dist/ui/v3/index.d.ts +0 -8
  268. package/dist/ui/v3/index.d.ts.map +0 -1
  269. package/dist/ui/v3/index.js +0 -51
  270. package/dist/ui/v3/index.js.map +0 -1
  271. package/dist/ui/v3/runtime/moduleConfig.d.ts +0 -21
  272. package/dist/ui/v3/runtime/moduleConfig.d.ts.map +0 -1
  273. package/dist/ui/v3/runtime/moduleConfig.js +0 -41
  274. package/dist/ui/v3/runtime/moduleConfig.js.map +0 -1
  275. package/dist/ui/v3/section0/index.d.ts +0 -22
  276. package/dist/ui/v3/section0/index.d.ts.map +0 -1
  277. package/dist/ui/v3/section0/index.js +0 -88
  278. package/dist/ui/v3/section0/index.js.map +0 -1
  279. package/dist/ui/v3/section0/runtime/createScreen.d.ts +0 -27
  280. package/dist/ui/v3/section0/runtime/createScreen.d.ts.map +0 -1
  281. package/dist/ui/v3/section0/runtime/createScreen.js +0 -55
  282. package/dist/ui/v3/section0/runtime/createScreen.js.map +0 -1
  283. package/dist/ui/v3/section0/runtime/lifecycle.d.ts +0 -53
  284. package/dist/ui/v3/section0/runtime/lifecycle.d.ts.map +0 -1
  285. package/dist/ui/v3/section0/runtime/lifecycle.js +0 -172
  286. package/dist/ui/v3/section0/runtime/lifecycle.js.map +0 -1
  287. package/dist/ui/v3/section1/index.d.ts +0 -19
  288. package/dist/ui/v3/section1/index.d.ts.map +0 -1
  289. package/dist/ui/v3/section1/index.js +0 -413
  290. package/dist/ui/v3/section1/index.js.map +0 -1
  291. package/dist/ui/v3/section1/runtime/commandLine.d.ts +0 -49
  292. package/dist/ui/v3/section1/runtime/commandLine.d.ts.map +0 -1
  293. package/dist/ui/v3/section1/runtime/commandLine.js +0 -183
  294. package/dist/ui/v3/section1/runtime/commandLine.js.map +0 -1
  295. package/dist/ui/v3/section1/runtime/focusLock.d.ts +0 -24
  296. package/dist/ui/v3/section1/runtime/focusLock.d.ts.map +0 -1
  297. package/dist/ui/v3/section1/runtime/focusLock.js +0 -44
  298. package/dist/ui/v3/section1/runtime/focusLock.js.map +0 -1
  299. package/dist/ui/v3/state/assertUiState.d.ts +0 -27
  300. package/dist/ui/v3/state/assertUiState.d.ts.map +0 -1
  301. package/dist/ui/v3/state/assertUiState.js +0 -89
  302. package/dist/ui/v3/state/assertUiState.js.map +0 -1
  303. package/dist/ui/v3/state/capabilitiesStore.d.ts +0 -54
  304. package/dist/ui/v3/state/capabilitiesStore.d.ts.map +0 -1
  305. package/dist/ui/v3/state/capabilitiesStore.js +0 -76
  306. package/dist/ui/v3/state/capabilitiesStore.js.map +0 -1
  307. package/dist/ui/v3/state/defaultState.d.ts +0 -19
  308. package/dist/ui/v3/state/defaultState.d.ts.map +0 -1
  309. package/dist/ui/v3/state/defaultState.js +0 -28
  310. package/dist/ui/v3/state/defaultState.js.map +0 -1
  311. package/dist/ui/v3/state/gatewayConnectionStore.d.ts +0 -72
  312. package/dist/ui/v3/state/gatewayConnectionStore.d.ts.map +0 -1
  313. package/dist/ui/v3/state/gatewayConnectionStore.js +0 -108
  314. package/dist/ui/v3/state/gatewayConnectionStore.js.map +0 -1
  315. package/dist/ui/v3/state/initializePostureState.d.ts +0 -23
  316. package/dist/ui/v3/state/initializePostureState.d.ts.map +0 -1
  317. package/dist/ui/v3/state/initializePostureState.js +0 -41
  318. package/dist/ui/v3/state/initializePostureState.js.map +0 -1
  319. package/dist/ui/v3/state/panelStore.d.ts +0 -80
  320. package/dist/ui/v3/state/panelStore.d.ts.map +0 -1
  321. package/dist/ui/v3/state/panelStore.js +0 -131
  322. package/dist/ui/v3/state/panelStore.js.map +0 -1
  323. package/dist/ui/v3/state/resourcesData.d.ts +0 -15
  324. package/dist/ui/v3/state/resourcesData.d.ts.map +0 -1
  325. package/dist/ui/v3/state/resourcesData.js +0 -7
  326. package/dist/ui/v3/state/resourcesData.js.map +0 -1
  327. package/dist/ui/v3/state/uiState.d.ts +0 -22
  328. package/dist/ui/v3/state/uiState.d.ts.map +0 -1
  329. package/dist/ui/v3/state/uiState.js +0 -13
  330. package/dist/ui/v3/state/uiState.js.map +0 -1
  331. package/dist/ui/v3/state/uiStateBuilder.d.ts +0 -32
  332. package/dist/ui/v3/state/uiStateBuilder.d.ts.map +0 -1
  333. package/dist/ui/v3/state/uiStateBuilder.js +0 -73
  334. package/dist/ui/v3/state/uiStateBuilder.js.map +0 -1
  335. package/dist/ui/v3/state/uiStateTypes.d.ts +0 -59
  336. package/dist/ui/v3/state/uiStateTypes.d.ts.map +0 -1
  337. package/dist/ui/v3/state/uiStateTypes.js +0 -8
  338. package/dist/ui/v3/state/uiStateTypes.js.map +0 -1
  339. package/dist/ui/v3/state/value.d.ts +0 -80
  340. package/dist/ui/v3/state/value.d.ts.map +0 -1
  341. package/dist/ui/v3/state/value.js +0 -96
  342. package/dist/ui/v3/state/value.js.map +0 -1
  343. package/dist/ui/v3/tui/geometry.d.ts +0 -83
  344. package/dist/ui/v3/tui/geometry.d.ts.map +0 -1
  345. package/dist/ui/v3/tui/geometry.js +0 -201
  346. package/dist/ui/v3/tui/geometry.js.map +0 -1
  347. package/dist/ui/v3/tui/startTui.d.ts +0 -37
  348. package/dist/ui/v3/tui/startTui.d.ts.map +0 -1
  349. package/dist/ui/v3/tui/startTui.js +0 -61
  350. package/dist/ui/v3/tui/startTui.js.map +0 -1
  351. package/dist/ui/v3/tui/terminalMode.d.ts +0 -31
  352. package/dist/ui/v3/tui/terminalMode.d.ts.map +0 -1
  353. package/dist/ui/v3/tui/terminalMode.js +0 -76
  354. package/dist/ui/v3/tui/terminalMode.js.map +0 -1
  355. package/dist/ui/v3/ui/debugUtils.d.ts +0 -67
  356. package/dist/ui/v3/ui/debugUtils.d.ts.map +0 -1
  357. package/dist/ui/v3/ui/debugUtils.js +0 -238
  358. package/dist/ui/v3/ui/debugUtils.js.map +0 -1
  359. package/dist/ui/v3/ui/focus.d.ts +0 -28
  360. package/dist/ui/v3/ui/focus.d.ts.map +0 -1
  361. package/dist/ui/v3/ui/focus.js +0 -38
  362. package/dist/ui/v3/ui/focus.js.map +0 -1
  363. package/dist/ui/v3/ui/layout/hubLayout.d.ts +0 -43
  364. package/dist/ui/v3/ui/layout/hubLayout.d.ts.map +0 -1
  365. package/dist/ui/v3/ui/layout/hubLayout.js +0 -170
  366. package/dist/ui/v3/ui/layout/hubLayout.js.map +0 -1
  367. package/dist/ui/v3/ui/layout/phase1Layout.d.ts +0 -63
  368. package/dist/ui/v3/ui/layout/phase1Layout.d.ts.map +0 -1
  369. package/dist/ui/v3/ui/layout/phase1Layout.js +0 -274
  370. package/dist/ui/v3/ui/layout/phase1Layout.js.map +0 -1
  371. package/dist/ui/v3/ui/layout/phase1Layout.test.d.ts +0 -5
  372. package/dist/ui/v3/ui/layout/phase1Layout.test.d.ts.map +0 -1
  373. package/dist/ui/v3/ui/layout/phase1Layout.test.js +0 -120
  374. package/dist/ui/v3/ui/layout/phase1Layout.test.js.map +0 -1
  375. package/dist/ui/v3/ui/minimalRuntime.d.ts +0 -14
  376. package/dist/ui/v3/ui/minimalRuntime.d.ts.map +0 -1
  377. package/dist/ui/v3/ui/minimalRuntime.js +0 -111
  378. package/dist/ui/v3/ui/minimalRuntime.js.map +0 -1
  379. package/dist/ui/v3/ui/panels/AssetsPanel.d.ts +0 -17
  380. package/dist/ui/v3/ui/panels/AssetsPanel.d.ts.map +0 -1
  381. package/dist/ui/v3/ui/panels/AssetsPanel.js +0 -53
  382. package/dist/ui/v3/ui/panels/AssetsPanel.js.map +0 -1
  383. package/dist/ui/v3/ui/panels/CapabilitiesPanel.d.ts +0 -20
  384. package/dist/ui/v3/ui/panels/CapabilitiesPanel.d.ts.map +0 -1
  385. package/dist/ui/v3/ui/panels/CapabilitiesPanel.js +0 -67
  386. package/dist/ui/v3/ui/panels/CapabilitiesPanel.js.map +0 -1
  387. package/dist/ui/v3/ui/panels/NetworkPanel.d.ts +0 -31
  388. package/dist/ui/v3/ui/panels/NetworkPanel.d.ts.map +0 -1
  389. package/dist/ui/v3/ui/panels/NetworkPanel.js +0 -153
  390. package/dist/ui/v3/ui/panels/NetworkPanel.js.map +0 -1
  391. package/dist/ui/v3/ui/panels/PosturePanel.d.ts +0 -16
  392. package/dist/ui/v3/ui/panels/PosturePanel.d.ts.map +0 -1
  393. package/dist/ui/v3/ui/panels/PosturePanel.js +0 -60
  394. package/dist/ui/v3/ui/panels/PosturePanel.js.map +0 -1
  395. package/dist/ui/v3/ui/panels/ResourcesPanel.d.ts +0 -20
  396. package/dist/ui/v3/ui/panels/ResourcesPanel.d.ts.map +0 -1
  397. package/dist/ui/v3/ui/panels/ResourcesPanel.js +0 -66
  398. package/dist/ui/v3/ui/panels/ResourcesPanel.js.map +0 -1
  399. package/dist/ui/v3/ui/phase1Runtime.d.ts +0 -29
  400. package/dist/ui/v3/ui/phase1Runtime.d.ts.map +0 -1
  401. package/dist/ui/v3/ui/phase1Runtime.js +0 -1648
  402. package/dist/ui/v3/ui/phase1Runtime.js.map +0 -1
  403. package/dist/ui/v3/ui/phase1RuntimeClean.d.ts +0 -34
  404. package/dist/ui/v3/ui/phase1RuntimeClean.d.ts.map +0 -1
  405. package/dist/ui/v3/ui/phase1RuntimeClean.js +0 -1841
  406. package/dist/ui/v3/ui/phase1RuntimeClean.js.map +0 -1
  407. package/dist/ui/v3/ui/primitives/Panel.d.ts +0 -39
  408. package/dist/ui/v3/ui/primitives/Panel.d.ts.map +0 -1
  409. package/dist/ui/v3/ui/primitives/Panel.js +0 -105
  410. package/dist/ui/v3/ui/primitives/Panel.js.map +0 -1
  411. package/dist/ui/v3/ui/theme.d.ts +0 -37
  412. package/dist/ui/v3/ui/theme.d.ts.map +0 -1
  413. package/dist/ui/v3/ui/theme.js +0 -40
  414. package/dist/ui/v3/ui/theme.js.map +0 -1
  415. package/dist/ui/v3/ui/uiRuntime.d.ts +0 -40
  416. package/dist/ui/v3/ui/uiRuntime.d.ts.map +0 -1
  417. package/dist/ui/v3/ui/uiRuntime.js +0 -60
  418. package/dist/ui/v3/ui/uiRuntime.js.map +0 -1
  419. package/dist/ui/v3/ui/widgets/CommandLine.d.ts +0 -26
  420. package/dist/ui/v3/ui/widgets/CommandLine.d.ts.map +0 -1
  421. package/dist/ui/v3/ui/widgets/CommandLine.js +0 -67
  422. package/dist/ui/v3/ui/widgets/CommandLine.js.map +0 -1
  423. package/dist/ui/v3/v1Adapters/agents.d.ts +0 -72
  424. package/dist/ui/v3/v1Adapters/agents.d.ts.map +0 -1
  425. package/dist/ui/v3/v1Adapters/agents.js +0 -182
  426. package/dist/ui/v3/v1Adapters/agents.js.map +0 -1
  427. package/dist/ui/v3/v1Adapters/config.d.ts +0 -67
  428. package/dist/ui/v3/v1Adapters/config.d.ts.map +0 -1
  429. package/dist/ui/v3/v1Adapters/config.js +0 -78
  430. package/dist/ui/v3/v1Adapters/config.js.map +0 -1
  431. package/dist/ui/v3/v1Adapters/connect.d.ts +0 -77
  432. package/dist/ui/v3/v1Adapters/connect.d.ts.map +0 -1
  433. package/dist/ui/v3/v1Adapters/connect.js +0 -576
  434. package/dist/ui/v3/v1Adapters/connect.js.map +0 -1
  435. package/dist/ui/v3/v1Adapters/httpDebug.d.ts +0 -19
  436. package/dist/ui/v3/v1Adapters/httpDebug.d.ts.map +0 -1
  437. package/dist/ui/v3/v1Adapters/httpDebug.js +0 -60
  438. package/dist/ui/v3/v1Adapters/httpDebug.js.map +0 -1
  439. package/dist/ui/v3/v1Adapters/runs.d.ts +0 -77
  440. package/dist/ui/v3/v1Adapters/runs.d.ts.map +0 -1
  441. package/dist/ui/v3/v1Adapters/runs.js +0 -339
  442. package/dist/ui/v3/v1Adapters/runs.js.map +0 -1
  443. package/dist/ui/v4/engine/renderFrame.d.ts +0 -47
  444. package/dist/ui/v4/engine/renderFrame.d.ts.map +0 -1
  445. package/dist/ui/v4/engine/renderFrame.js +0 -653
  446. package/dist/ui/v4/engine/renderFrame.js.map +0 -1
  447. package/dist/ui/v4/engine/resizeController.d.ts +0 -48
  448. package/dist/ui/v4/engine/resizeController.d.ts.map +0 -1
  449. package/dist/ui/v4/engine/resizeController.js +0 -285
  450. package/dist/ui/v4/engine/resizeController.js.map +0 -1
  451. package/dist/ui/v4/engine/safeViewport.d.ts +0 -47
  452. package/dist/ui/v4/engine/safeViewport.d.ts.map +0 -1
  453. package/dist/ui/v4/engine/safeViewport.js +0 -123
  454. package/dist/ui/v4/engine/safeViewport.js.map +0 -1
  455. package/dist/ui/v4/engine/terminalProfile.d.ts +0 -56
  456. package/dist/ui/v4/engine/terminalProfile.d.ts.map +0 -1
  457. package/dist/ui/v4/engine/terminalProfile.js +0 -115
  458. package/dist/ui/v4/engine/terminalProfile.js.map +0 -1
  459. package/dist/ui/v4/index.d.ts +0 -28
  460. package/dist/ui/v4/index.d.ts.map +0 -1
  461. package/dist/ui/v4/index.js +0 -993
  462. package/dist/ui/v4/index.js.map +0 -1
  463. package/dist/ui/v4/layout/layoutEngine.d.ts +0 -62
  464. package/dist/ui/v4/layout/layoutEngine.d.ts.map +0 -1
  465. package/dist/ui/v4/layout/layoutEngine.js +0 -294
  466. package/dist/ui/v4/layout/layoutEngine.js.map +0 -1
  467. package/dist/ui/v4/runtime/keepAlive.d.ts +0 -21
  468. package/dist/ui/v4/runtime/keepAlive.d.ts.map +0 -1
  469. package/dist/ui/v4/runtime/keepAlive.js +0 -149
  470. package/dist/ui/v4/runtime/keepAlive.js.map +0 -1
  471. package/dist/ui/v4/runtime/logger.d.ts +0 -35
  472. package/dist/ui/v4/runtime/logger.d.ts.map +0 -1
  473. package/dist/ui/v4/runtime/logger.js +0 -109
  474. package/dist/ui/v4/runtime/logger.js.map +0 -1
  475. package/dist/ui/v5/debug/assertNoOverflow.d.ts +0 -28
  476. package/dist/ui/v5/debug/assertNoOverflow.d.ts.map +0 -1
  477. package/dist/ui/v5/debug/assertNoOverflow.js +0 -63
  478. package/dist/ui/v5/debug/assertNoOverflow.js.map +0 -1
  479. package/dist/ui/v5/debug/debugCommands.d.ts +0 -20
  480. package/dist/ui/v5/debug/debugCommands.d.ts.map +0 -1
  481. package/dist/ui/v5/debug/debugCommands.js +0 -461
  482. package/dist/ui/v5/debug/debugCommands.js.map +0 -1
  483. package/dist/ui/v5/debugCommands.d.ts +0 -20
  484. package/dist/ui/v5/debugCommands.d.ts.map +0 -1
  485. package/dist/ui/v5/debugCommands.js +0 -81
  486. package/dist/ui/v5/debugCommands.js.map +0 -1
  487. package/dist/ui/v5/guardrails/stdoutGuard.d.ts +0 -23
  488. package/dist/ui/v5/guardrails/stdoutGuard.d.ts.map +0 -1
  489. package/dist/ui/v5/guardrails/stdoutGuard.js +0 -94
  490. package/dist/ui/v5/guardrails/stdoutGuard.js.map +0 -1
  491. package/dist/ui/v5/guardrails/terminalRestore.d.ts +0 -17
  492. package/dist/ui/v5/guardrails/terminalRestore.d.ts.map +0 -1
  493. package/dist/ui/v5/guardrails/terminalRestore.js +0 -47
  494. package/dist/ui/v5/guardrails/terminalRestore.js.map +0 -1
  495. package/dist/ui/v5/index.d.ts +0 -30
  496. package/dist/ui/v5/index.d.ts.map +0 -1
  497. package/dist/ui/v5/index.js +0 -243
  498. package/dist/ui/v5/index.js.map +0 -1
  499. package/dist/ui/v5/kernel/kernel.d.ts +0 -81
  500. package/dist/ui/v5/kernel/kernel.d.ts.map +0 -1
  501. package/dist/ui/v5/kernel/kernel.js +0 -339
  502. package/dist/ui/v5/kernel/kernel.js.map +0 -1
  503. package/dist/ui/v5/kernel.d.ts +0 -75
  504. package/dist/ui/v5/kernel.d.ts.map +0 -1
  505. package/dist/ui/v5/kernel.js +0 -289
  506. package/dist/ui/v5/kernel.js.map +0 -1
  507. package/dist/ui/v5/layout/clampRect.d.ts +0 -28
  508. package/dist/ui/v5/layout/clampRect.d.ts.map +0 -1
  509. package/dist/ui/v5/layout/clampRect.js +0 -45
  510. package/dist/ui/v5/layout/clampRect.js.map +0 -1
  511. package/dist/ui/v5/layout/layoutEngine.d.ts +0 -16
  512. package/dist/ui/v5/layout/layoutEngine.d.ts.map +0 -1
  513. package/dist/ui/v5/layout/layoutEngine.js +0 -99
  514. package/dist/ui/v5/layout/layoutEngine.js.map +0 -1
  515. package/dist/ui/v5/renderGate.d.ts +0 -19
  516. package/dist/ui/v5/renderGate.d.ts.map +0 -1
  517. package/dist/ui/v5/renderGate.js +0 -36
  518. package/dist/ui/v5/renderGate.js.map +0 -1
  519. package/dist/ui/v5/resize/resizeController.d.ts +0 -62
  520. package/dist/ui/v5/resize/resizeController.d.ts.map +0 -1
  521. package/dist/ui/v5/resize/resizeController.js +0 -141
  522. package/dist/ui/v5/resize/resizeController.js.map +0 -1
  523. package/dist/ui/v5/resizeController.d.ts +0 -55
  524. package/dist/ui/v5/resizeController.d.ts.map +0 -1
  525. package/dist/ui/v5/resizeController.js +0 -124
  526. package/dist/ui/v5/resizeController.js.map +0 -1
  527. package/dist/ui/v5/runtime/keepAlive.d.ts +0 -37
  528. package/dist/ui/v5/runtime/keepAlive.d.ts.map +0 -1
  529. package/dist/ui/v5/runtime/keepAlive.js +0 -122
  530. package/dist/ui/v5/runtime/keepAlive.js.map +0 -1
  531. package/dist/ui/v5/runtime/restoreTerminal.d.ts +0 -34
  532. package/dist/ui/v5/runtime/restoreTerminal.d.ts.map +0 -1
  533. package/dist/ui/v5/runtime/restoreTerminal.js +0 -100
  534. package/dist/ui/v5/runtime/restoreTerminal.js.map +0 -1
  535. package/dist/ui/v5/runtime/stdoutGuard.d.ts +0 -42
  536. package/dist/ui/v5/runtime/stdoutGuard.d.ts.map +0 -1
  537. package/dist/ui/v5/runtime/stdoutGuard.js +0 -156
  538. package/dist/ui/v5/runtime/stdoutGuard.js.map +0 -1
  539. package/dist/ui/v5/viewport/getViewport.d.ts +0 -23
  540. package/dist/ui/v5/viewport/getViewport.d.ts.map +0 -1
  541. package/dist/ui/v5/viewport/getViewport.js +0 -117
  542. package/dist/ui/v5/viewport/getViewport.js.map +0 -1
  543. package/dist/ui/v5/viewport.d.ts +0 -41
  544. package/dist/ui/v5/viewport.d.ts.map +0 -1
  545. package/dist/ui/v5/viewport.js +0 -90
  546. package/dist/ui/v5/viewport.js.map +0 -1
  547. package/dist/ui/widgets/flagRow.d.ts +0 -25
  548. package/dist/ui/widgets/flagRow.d.ts.map +0 -1
  549. package/dist/ui/widgets/flagRow.js +0 -57
  550. package/dist/ui/widgets/flagRow.js.map +0 -1
  551. package/dist/ui/widgets/index.d.ts +0 -9
  552. package/dist/ui/widgets/index.d.ts.map +0 -1
  553. package/dist/ui/widgets/index.js +0 -9
  554. package/dist/ui/widgets/index.js.map +0 -1
  555. package/dist/ui/widgets/meter.d.ts +0 -18
  556. package/dist/ui/widgets/meter.d.ts.map +0 -1
  557. package/dist/ui/widgets/meter.js +0 -38
  558. package/dist/ui/widgets/meter.js.map +0 -1
  559. package/dist/ui/widgets/miniMap.d.ts +0 -26
  560. package/dist/ui/widgets/miniMap.d.ts.map +0 -1
  561. package/dist/ui/widgets/miniMap.js +0 -94
  562. package/dist/ui/widgets/miniMap.js.map +0 -1
  563. package/dist/ui/widgets/sparkline.d.ts +0 -17
  564. package/dist/ui/widgets/sparkline.d.ts.map +0 -1
  565. package/dist/ui/widgets/sparkline.js +0 -65
  566. package/dist/ui/widgets/sparkline.js.map +0 -1
@@ -1,653 +0,0 @@
1
- /**
2
- * V4 Render Engine - Percentage-Based (neo-blessed optimized)
3
- *
4
- * ⚠️ FROZEN: This file is part of V4 TUI which is FROZEN.
5
- * DO NOT MODIFY. Development moved to V5.
6
- * See FROZEN.md in v4 directory.
7
- *
8
- * Single-pass rendering with atomic teardown + rebuild.
9
- * Uses percentage-based layout specs (no pixel math).
10
- *
11
- * Rules:
12
- * - No partial renders
13
- * - Always teardown old widgets before creating new ones
14
- * - Hard clear terminal buffer before render
15
- * - Single render() call at end
16
- * - Always restore focus to command input
17
- * - Use percentage strings for left/width (neo-blessed handles it)
18
- */
19
- import blessed from 'neo-blessed';
20
- import { getSafeViewport } from './safeViewport.js';
21
- import { getBorderChars } from './terminalProfile.js';
22
- const blessedLib = blessed;
23
- /**
24
- * Step 1: Debug helper - uses tuiDebug (stderr/file, gated by TUI_DEBUG=1)
25
- * UI owns stdout. Logs go to stderr or file. No exceptions.
26
- */
27
- import { tuiDebug as dbg, tuiError } from '../runtime/logger.js';
28
- /**
29
- * Hard clear terminal buffer
30
- */
31
- function hardClearTerminal(screen) {
32
- // CRITICAL: Don't clear in CloudShell/browser terminals - it causes black screens
33
- // Only clear in normal terminals that handle it well
34
- const term = process.env.TERM || '';
35
- const isBrowserTerminal = /cloudshell|web|browser/i.test(term) ||
36
- process.env.SSH_CONNECTION !== undefined ||
37
- process.env.AWS_EXECUTION_ENV !== undefined;
38
- // Skip clearing for browser terminals - they don't handle it well and cause black screens
39
- if (isBrowserTerminal) {
40
- return;
41
- }
42
- const program = screen.program;
43
- if (program) {
44
- try {
45
- if (typeof program.clear === 'function') {
46
- program.clear();
47
- }
48
- if (typeof program.home === 'function') {
49
- program.home();
50
- }
51
- if (typeof program.eraseInDisplay === 'function') {
52
- program.eraseInDisplay('all');
53
- }
54
- if (typeof program.flush === 'function') {
55
- program.flush();
56
- }
57
- }
58
- catch {
59
- // Ignore clear errors (terminal might not support all operations)
60
- }
61
- }
62
- }
63
- /**
64
- * Create a panel widget using pixel-based layout
65
- *
66
- * Step 1: All panels are children of viewportBox (hard clipping)
67
- * Step 2: Integer widths only (no percentages for outer edges)
68
- *
69
- * @param parent - Parent container (viewportBox or screen)
70
- */
71
- function createPanel(parent, name, colSpec, top, height, title, visible = true, useAsciiBorders = false // D) Use ASCII borders in safe mode
72
- ) {
73
- if (!visible || colSpec.width === 0) {
74
- // Create invisible/collapsed box
75
- return blessedLib.box({
76
- top: 0,
77
- left: -100, // Off-screen
78
- width: 1,
79
- height: 1,
80
- content: '',
81
- border: false,
82
- focusable: false,
83
- });
84
- }
85
- // Get safe viewport to check bounds (get screen from parent)
86
- const screen = parent.screen || parent;
87
- const viewport = getSafeViewport(screen);
88
- const safeCols = viewport.cols;
89
- // Step 2: Integer widths only (already calculated in layout)
90
- // Calculate if this is the rightmost panel (right column)
91
- // CRITICAL: Rightmost panels have no right border, so we check if right edge is near safeCols
92
- // A panel is rightmost if its right edge (without borders) is >= safeCols - 2
93
- const rightEdgeWithoutBorder = colSpec.left + colSpec.width;
94
- const isRightmost = rightEdgeWithoutBorder >= safeCols - 2; // Account for border padding
95
- // D) Get border chars based on safe mode
96
- // For rightmost panels, use custom border that excludes right edge
97
- const borderChars = useAsciiBorders ? getBorderChars(true) : undefined;
98
- const borderConfig = isRightmost
99
- ? {
100
- type: 'line',
101
- right: false, // No right border for rightmost panels
102
- ...(borderChars ? { chars: borderChars } : {}),
103
- }
104
- : {
105
- type: 'line',
106
- ...(borderChars ? { chars: borderChars } : {}),
107
- };
108
- // Step 2: Use integer width (no percentages, no right anchoring)
109
- // DEBUG: Log panel creation and validate dimensions
110
- const debugInfo = `Panel ${name}: x=${colSpec.left} w=${colSpec.width} h=${height} top=${top}`;
111
- // CRITICAL: Validate dimensions before creating widget
112
- // A) Log to stderr only (never stdout)
113
- if (colSpec.width <= 0 || height <= 0) {
114
- dbg(`ERROR: Panel ${name} has invalid dimensions: w=${colSpec.width} h=${height}`);
115
- // Return invisible panel instead of crashing
116
- return blessedLib.box({
117
- top: -100,
118
- left: -100,
119
- width: 1,
120
- height: 1,
121
- content: '',
122
- border: false,
123
- focusable: false,
124
- });
125
- }
126
- const box = blessedLib.box({
127
- top,
128
- left: colSpec.left,
129
- width: colSpec.width, // Step 2: Integer width (sum = safeCols exactly)
130
- height,
131
- border: borderConfig,
132
- style: {
133
- bg: 'blue', // TEMPORARY: Use blue for visibility debugging
134
- fg: 'white', // CRITICAL: Set foreground color
135
- border: {
136
- fg: 'cyan',
137
- bg: 'blue',
138
- },
139
- },
140
- content: ` ${title} `, // Panel title with spaces for visibility
141
- tags: true,
142
- focusable: false,
143
- alwaysScroll: false,
144
- scrollable: false,
145
- clickable: false,
146
- input: false,
147
- keys: false,
148
- mouse: false,
149
- });
150
- // CRITICAL: Append to parent AFTER creation (blessed standard way)
151
- parent.append(box);
152
- // Ensure box has proper dimensions and position
153
- box.lpos = {
154
- xi: colSpec.left,
155
- yi: top,
156
- xl: colSpec.left + colSpec.width,
157
- yl: top + height,
158
- };
159
- // Step 1: Append to parent (already set in constructor, but ensure it's attached)
160
- if (!box.parent) {
161
- parent.append(box);
162
- }
163
- box.__panelName = name;
164
- box.__debugInfo = debugInfo;
165
- // CRITICAL: Show the widget immediately
166
- try {
167
- if (box.show) {
168
- box.show();
169
- }
170
- }
171
- catch {
172
- // Ignore
173
- }
174
- // Step 1: Log to stderr for debugging (uses tuiDebug - gated by TUI_DEBUG)
175
- if (process.env.DEBUG_V4 === '1' || process.env.TUI_DEBUG) {
176
- const rightEdge = colSpec.left + colSpec.width + (isRightmost ? 1 : 2);
177
- dbg(`Created ${name}: x=${colSpec.left} w=${colSpec.width} h=${height} rightEdge=${rightEdge} safeCols=${safeCols}`);
178
- if (rightEdge >= safeCols) {
179
- tuiError(`${name} OVERFLOW: rightEdge=${rightEdge} >= safeCols=${safeCols}`);
180
- }
181
- }
182
- // Note: visible/hidden are read-only computed properties in blessed
183
- return box;
184
- }
185
- /**
186
- * Create watermark widget (bottom-right corner, like a footer)
187
- *
188
- * Step 1: Child of viewportBox
189
- */
190
- /**
191
- * Create watermark widget (Deliverable 3: Visible proof TUI is alive)
192
- * Shows "V4 LIVE" at top-left + optional heartbeat counter when TUI_DEBUG=1
193
- * Uses ONLY ASCII characters to prevent symbol corruption
194
- */
195
- function createWatermark(parent, rows, safeCols) {
196
- const blessedLib = blessed;
197
- // Deliverable 3: Visible proof TUI is alive - "V4 LIVE" watermark at top-left
198
- // Use ONLY ASCII characters - no Unicode/box-drawing chars that could corrupt
199
- const watermarkText = process.env.TUI_DEBUG === '1' || process.env.DEBUG_V4 === '1'
200
- ? 'V4 LIVE [*]' // Show heartbeat indicator in debug mode (ASCII only)
201
- : 'V4 LIVE';
202
- // Position at top-left (was bottom-right, changed to top-left for visibility)
203
- const box = blessedLib.box({
204
- parent: parent, // Explicitly set parent
205
- top: 0, // Top of screen
206
- left: 0, // Left of screen
207
- width: watermarkText.length + 2,
208
- height: 1,
209
- content: watermarkText,
210
- style: {
211
- fg: 'blue',
212
- bg: 'black',
213
- },
214
- tags: true,
215
- focusable: false,
216
- border: false,
217
- });
218
- // Deliverable 3: Heartbeat counter (update every 1s when debug enabled)
219
- if (process.env.TUI_DEBUG === '1' || process.env.DEBUG_V4 === '1') {
220
- let heartbeatCount = 0;
221
- const heartbeatInterval = setInterval(() => {
222
- heartbeatCount++;
223
- const heartbeatText = `V4 LIVE [${heartbeatCount}]`;
224
- try {
225
- box.setContent(heartbeatText);
226
- // Get screen from parent
227
- const screen = parent.screen || parent;
228
- if (screen && typeof screen.render === 'function') {
229
- screen.render();
230
- }
231
- }
232
- catch {
233
- // Ignore errors (screen might be destroyed)
234
- clearInterval(heartbeatInterval);
235
- }
236
- }, 1000); // Update every 1 second
237
- // Store interval on box so it can be cleared on destroy
238
- box.__heartbeatInterval = heartbeatInterval;
239
- }
240
- // Step 1: Append to parent (screen or viewportBox)
241
- parent.append(box);
242
- box.__panelName = 'watermark';
243
- return box;
244
- }
245
- /**
246
- * Create command line widget using pixel-based layout
247
- *
248
- * CRITICAL: Use Box instead of Textbox for broken terminals
249
- * Textbox input encoding is broken in browser terminals (CloudShell/EC2 Instance Connect)
250
- * We'll handle input manually via screen.key() events
251
- */
252
- function createCommandLine(parent, top, height, safeCols, initialValue = '') {
253
- const PROMPT = '4runr> ';
254
- // HARD INVARIANT: Command line must satisfy x + w + borderPad < safeCols (strictly less)
255
- // Command line: x=0, has left border (+1), no right border
256
- // So: 0 + width + 1 < safeCols (strictly less to prevent scrollbar)
257
- // Therefore: width <= safeCols - 2 (extra -1 to ensure rightEdge < safeCols)
258
- const cmdBox = blessedLib.box({
259
- top,
260
- left: 0,
261
- width: safeCols - 2, // Ensures rightEdge = 0 + (safeCols-2) + 1 = safeCols - 1 (strictly within bounds)
262
- height,
263
- border: {
264
- type: 'line',
265
- right: false, // NO RIGHT BORDER - prevents overflow
266
- fg: 'yellow', // TEMPORARY: Yellow border for visibility
267
- },
268
- style: {
269
- bg: 'blue', // TEMPORARY: Blue background for visibility
270
- fg: 'white',
271
- border: {
272
- fg: 'yellow',
273
- bg: 'blue',
274
- },
275
- },
276
- content: PROMPT + initialValue,
277
- tags: true,
278
- focusable: true, // Can receive focus
279
- keys: true, // Can receive key events
280
- mouse: false,
281
- });
282
- // Step 1: Append to parent (screen or viewportBox)
283
- parent.append(cmdBox);
284
- cmdBox.__panelName = 'COMMAND_LINE';
285
- cmdBox.__debugInfo = `CMD: left=0 width=${safeCols - 2} rightEdge=${0 + (safeCols - 2) + 1} safeCols=${safeCols}`;
286
- cmdBox.__prompt = PROMPT;
287
- cmdBox.__value = initialValue; // Store current input value
288
- return cmdBox;
289
- }
290
- /**
291
- * Teardown all widgets from screen
292
- * Also clears any heartbeat intervals
293
- */
294
- function teardownWidgets(screen, widgets) {
295
- if (!widgets) {
296
- return;
297
- }
298
- const widgetList = [
299
- widgets.posture,
300
- widgets.resources,
301
- widgets.assets,
302
- widgets.operations,
303
- widgets.network,
304
- widgets.capabilities,
305
- widgets.commandLine,
306
- widgets.watermark,
307
- ];
308
- for (const widget of widgetList) {
309
- try {
310
- if (widget) {
311
- const w = widget;
312
- // Clear heartbeat intervals if any (Deliverable 3)
313
- const heartbeatInterval = w.__heartbeatInterval;
314
- if (heartbeatInterval) {
315
- clearInterval(heartbeatInterval);
316
- }
317
- if (!w.detached) {
318
- if (typeof w.detach === 'function') {
319
- w.detach();
320
- }
321
- if (typeof w.destroy === 'function') {
322
- w.destroy();
323
- }
324
- }
325
- }
326
- }
327
- catch (error) {
328
- // Ignore errors during teardown
329
- }
330
- }
331
- }
332
- /**
333
- * Create widgets for a given layout spec (extracted for reuse)
334
- */
335
- function createWidgetsForSpec(screen, viewportBox, columns, rows, mode, viewport, commandInputValue, useAsciiBorders = false // D) Use ASCII borders in safe mode
336
- ) {
337
- const mainHeight = rows.mainBottom - rows.mainTop;
338
- if (mode === 'normal') {
339
- // Normal mode: 3 columns with stacked panels
340
- const leftPanelHeight = Math.floor(mainHeight / 3);
341
- const rightPanelHeight = Math.floor(mainHeight / 2);
342
- const rightPanelHeight2 = mainHeight - rightPanelHeight;
343
- const widgets = {
344
- viewport: viewportBox,
345
- posture: createPanel(viewportBox, 'posture', columns.left, rows.mainTop, leftPanelHeight, 'POSTURE', true, useAsciiBorders),
346
- resources: createPanel(viewportBox, 'resources', columns.left, rows.mainTop + leftPanelHeight, leftPanelHeight, 'RESOURCES', true, useAsciiBorders),
347
- assets: createPanel(viewportBox, 'assets', columns.left, rows.mainTop + leftPanelHeight * 2, leftPanelHeight, 'ASSETS', true, useAsciiBorders),
348
- operations: createPanel(viewportBox, 'operations', columns.center, rows.mainTop, mainHeight, 'OPERATIONS', true, useAsciiBorders),
349
- network: createPanel(viewportBox, 'network', columns.right, rows.mainTop, rightPanelHeight, 'NETWORK', true, useAsciiBorders),
350
- capabilities: createPanel(viewportBox, 'capabilities', columns.right, rows.mainTop + rightPanelHeight, rightPanelHeight2, 'CAPABILITIES', true, useAsciiBorders),
351
- commandLine: createCommandLine(viewportBox, rows.cmdTop, rows.cmdHeight, viewport.cols, commandInputValue),
352
- watermark: createWatermark(viewportBox, viewport.rows, viewport.cols),
353
- };
354
- // A) Log to stderr only (never stdout)
355
- dbg(`Rendering ${mode} mode: ${screen.children.length} children before render`);
356
- // CRITICAL: Force all widgets to be visible before render
357
- for (const widget of Object.values(widgets)) {
358
- if (widget && typeof widget.setContent === 'function') {
359
- // Ensure widget has content
360
- const currentContent = widget.content || '';
361
- if (!currentContent || currentContent.trim() === '') {
362
- widget.setContent(' '); // At least one space
363
- }
364
- }
365
- // Force visibility
366
- if (widget) {
367
- // Note: visible/hidden are read-only computed properties in blessed
368
- }
369
- }
370
- // CRITICAL: Render once - multiple renders can cause black screens
371
- screen.render();
372
- // A) Log to stderr only (never stdout)
373
- dbg(`Render complete. Screen children: ${screen.children.length}`);
374
- // Log widget visibility state
375
- for (const [name, widget] of Object.entries(widgets)) {
376
- if (widget) {
377
- const hidden = widget.hidden;
378
- const visible = widget.visible;
379
- const content = widget.content || '';
380
- dbg(`Widget ${name}: hidden=${hidden} visible=${visible} contentLen=${content.length}`);
381
- }
382
- }
383
- widgets.commandLine.focus();
384
- screen.focused = widgets.commandLine;
385
- return widgets;
386
- }
387
- else {
388
- // Narrow mode
389
- const widgets = {
390
- viewport: viewportBox,
391
- posture: createPanel(viewportBox, 'posture', columns.left, 0, 1, 'UNAVAILABLE (narrow mode)', false, useAsciiBorders),
392
- resources: createPanel(viewportBox, 'resources', columns.left, 0, 1, 'UNAVAILABLE (narrow mode)', false, useAsciiBorders),
393
- assets: createPanel(viewportBox, 'assets', columns.left, 0, 1, 'UNAVAILABLE (narrow mode)', false, useAsciiBorders),
394
- operations: createPanel(viewportBox, 'operations', columns.center, rows.mainTop, mainHeight, 'OPERATIONS', true, useAsciiBorders),
395
- network: createPanel(viewportBox, 'network', columns.right, 0, 1, 'UNAVAILABLE (narrow mode)', false, useAsciiBorders),
396
- capabilities: createPanel(viewportBox, 'capabilities', columns.right, 0, 1, 'UNAVAILABLE (narrow mode)', false, useAsciiBorders),
397
- commandLine: createCommandLine(viewportBox, rows.cmdTop, rows.cmdHeight, viewport.cols, commandInputValue),
398
- watermark: createWatermark(viewportBox, viewport.rows, viewport.cols),
399
- };
400
- // A) Log to stderr only (never stdout)
401
- dbg(`Rendering ${mode} mode: ${screen.children.length} children before render`);
402
- // CRITICAL: Force all widgets to be visible before render
403
- for (const widget of Object.values(widgets)) {
404
- if (widget && typeof widget.setContent === 'function') {
405
- // Ensure widget has content
406
- const currentContent = widget.content || '';
407
- if (!currentContent || currentContent.trim() === '') {
408
- widget.setContent(' '); // At least one space
409
- }
410
- }
411
- // Force visibility
412
- if (widget) {
413
- // Note: visible/hidden are read-only computed properties in blessed
414
- }
415
- }
416
- // CRITICAL: Render once - multiple renders can cause black screens
417
- screen.render();
418
- // A) Log to stderr only (never stdout)
419
- dbg(`Render complete. Screen children: ${screen.children.length}`);
420
- // Log widget visibility state
421
- for (const [name, widget] of Object.entries(widgets)) {
422
- if (widget) {
423
- const hidden = widget.hidden;
424
- const visible = widget.visible;
425
- const content = widget.content || '';
426
- dbg(`Widget ${name}: hidden=${hidden} visible=${visible} contentLen=${content.length}`);
427
- }
428
- }
429
- widgets.commandLine.focus();
430
- screen.focused = widgets.commandLine;
431
- return widgets;
432
- }
433
- }
434
- /**
435
- * Render frame (atomic teardown + rebuild)
436
- *
437
- * Step 1: Hard viewport container - all widgets inside viewportBox
438
- * Step 4: Rebuild on resize - destroy old viewport, recreate with new sizes
439
- *
440
- * @param screen - Blessed screen
441
- * @param spec - Layout spec with integer pixel positions
442
- * @param oldWidgets - Previous widgets (will be destroyed)
443
- * @param commandInputValue - Preserve command line input across resizes
444
- * @param isInitialBoot - Only clear terminal on boot, not resize
445
- * @returns New widgets
446
- */
447
- export function renderFrame(screen, spec, oldWidgets, commandInputValue = '', isInitialBoot = false, // B) Only clear on boot, not resize
448
- useAsciiBorders = false // D) Use ASCII borders in safe mode
449
- ) {
450
- // B) Only clear terminal on boot, not during resize (CloudShell safety)
451
- if (isInitialBoot) {
452
- hardClearTerminal(screen);
453
- }
454
- // Step 4: Destroy old viewport container (if exists)
455
- if (oldWidgets?.viewport) {
456
- try {
457
- const vp = oldWidgets.viewport;
458
- // Destroy all children first
459
- if (vp.children) {
460
- for (const child of [...vp.children]) {
461
- try {
462
- if (typeof child.detach === 'function') {
463
- child.detach();
464
- }
465
- if (typeof child.destroy === 'function') {
466
- child.destroy();
467
- }
468
- }
469
- catch {
470
- // Ignore
471
- }
472
- }
473
- }
474
- if (typeof vp.detach === 'function') {
475
- vp.detach();
476
- }
477
- if (typeof vp.destroy === 'function') {
478
- vp.destroy();
479
- }
480
- }
481
- catch (error) {
482
- // Ignore errors during teardown
483
- }
484
- }
485
- // Contract E: Atomic teardown - destroy all old widgets first (no partial mutation)
486
- teardownWidgets(screen, oldWidgets);
487
- // Contract B: Clear ALL screen children (only viewportBox should be direct child)
488
- while (screen.children.length > 0) {
489
- const child = screen.children[0];
490
- try {
491
- child.detach();
492
- }
493
- catch (error) {
494
- // Continue teardown
495
- }
496
- }
497
- // Contract B: Ensure screen is clean before creating viewportBox
498
- // Contract A: Get safe viewport (strict bounds)
499
- const viewport = getSafeViewport(screen);
500
- // Get program reference for debug logging
501
- const program = screen.program;
502
- // Contract A: Log viewport (uses tuiDebug - gated by TUI_DEBUG)
503
- dbg(`Viewport: ${viewport.cols}x${viewport.rows}, Browser: ${viewport.isBrowserTerminal}, Margins: R=${viewport.rightMargin} B=${viewport.bottomMargin}`);
504
- // Contract B: One Root Viewport Container
505
- // Rule: only one blessed child attaches to screen: viewportBox.
506
- // Everything else is a child of viewportBox.
507
- // This guarantees even if blessed thinks it has more space, you're drawing inside a bounded container.
508
- const viewportBox = blessedLib.box({
509
- top: 0,
510
- left: 0,
511
- width: viewport.cols, // Contract A: Hard bound to safeCols
512
- height: viewport.rows, // Contract A: Hard bound to safeRows
513
- border: {
514
- type: 'line',
515
- fg: 'green', // TEMPORARY: Green border to see if viewportBox renders
516
- },
517
- style: {
518
- bg: 'black',
519
- fg: 'white',
520
- },
521
- content: ' VIEWPORT ', // TEMPORARY: Content to see if viewportBox renders
522
- focusable: false,
523
- keys: false,
524
- mouse: false,
525
- tags: true,
526
- });
527
- // Contract B: Append viewportBox as the ONLY direct child of screen
528
- screen.append(viewportBox);
529
- // CRITICAL: Force viewportBox to be visible
530
- dbg(`Created viewportBox: ${viewport.cols}x${viewport.rows}, screen children: ${screen.children.length}`);
531
- // Step 4: Create new widgets from layout spec (ALL as children of viewportBox)
532
- const { columns, rows, mode } = spec;
533
- const mainHeight = rows.mainBottom - rows.mainTop;
534
- // A) Log to stderr only (never stdout)
535
- dbg(`Layout mode: ${mode}, mainHeight: ${mainHeight}`);
536
- dbg(`Columns: left=${columns.left.width}@${columns.left.left}, center=${columns.center.width}@${columns.center.left}, right=${columns.right.width}@${columns.right.left}`);
537
- // CRITICAL: Ensure viewportBox (screen) has no hidden children before creating new widgets
538
- // Clear any detached or hidden widgets that might interfere
539
- try {
540
- for (const child of [...viewportBox.children || []]) {
541
- if (child && child.detached) {
542
- try {
543
- child.detach();
544
- }
545
- catch {
546
- // Ignore
547
- }
548
- }
549
- }
550
- }
551
- catch {
552
- // Ignore cleanup errors
553
- }
554
- // C) Hard validate rects before widget creation
555
- // Note: viewport was already calculated above, reuse it
556
- const violations = [];
557
- // Validate column specs
558
- for (const [name, colSpec] of Object.entries(columns)) {
559
- if (colSpec.width > 0) {
560
- // Check width minimum
561
- if (colSpec.width < 4) {
562
- violations.push(`${name}: width=${colSpec.width} < 4`);
563
- }
564
- // Check horizontal bounds
565
- if (colSpec.left + colSpec.width > viewport.cols) {
566
- violations.push(`${name}: x=${colSpec.left} w=${colSpec.width} exceeds safeCols=${viewport.cols}`);
567
- }
568
- // Check horizontal position
569
- if (colSpec.left < 0) {
570
- violations.push(`${name}: x=${colSpec.left} < 0`);
571
- }
572
- }
573
- }
574
- // Validate row specs
575
- if (mainHeight < 3) {
576
- violations.push(`mainHeight=${mainHeight} < 3`);
577
- }
578
- if (rows.cmdTop < 0 || rows.cmdTop >= viewport.rows) {
579
- violations.push(`cmdTop=${rows.cmdTop} out of bounds (rows=${viewport.rows})`);
580
- }
581
- // A) If violations detected, log to stderr only
582
- if (violations.length > 0) {
583
- dbg('LAYOUT VIOLATIONS DETECTED:');
584
- for (const violation of violations) {
585
- dbg(` ${violation}`);
586
- }
587
- dbg('Switching to narrow mode...');
588
- // Force narrow mode (synchronous import)
589
- const { computeLayout: computeLayoutSync } = require('../layout/layoutEngine.js');
590
- const narrowSpec = computeLayoutSync(viewport);
591
- if (narrowSpec.mode !== 'narrow') {
592
- // If still not narrow, create minimal safe layout
593
- return createMinimalSafeLayout(screen, viewport, commandInputValue);
594
- }
595
- // Use narrow spec instead
596
- const { columns: narrowColumns, rows: narrowRows } = narrowSpec;
597
- return createWidgetsForSpec(screen, viewportBox, narrowColumns, narrowRows, 'narrow', viewport, commandInputValue, useAsciiBorders);
598
- }
599
- // No violations - use helper function to create widgets
600
- return createWidgetsForSpec(screen, viewportBox, columns, rows, mode, viewport, commandInputValue, useAsciiBorders);
601
- }
602
- /**
603
- * Create minimal safe layout (fallback if all else fails)
604
- */
605
- function createMinimalSafeLayout(screen, viewport, commandInputValue, useAsciiBorders = false // D) Use ASCII borders in safe mode
606
- ) {
607
- // Contract B: Create viewportBox as ONLY direct child of screen (for minimal layout)
608
- const viewportBox = blessedLib.box({
609
- top: 0,
610
- left: 0,
611
- width: viewport.cols, // Contract A: Hard bound to safeCols
612
- height: viewport.rows, // Contract A: Hard bound to safeRows
613
- border: false,
614
- style: {
615
- bg: 'black',
616
- },
617
- focusable: false,
618
- keys: false,
619
- mouse: false,
620
- tags: false,
621
- });
622
- // Contract B: Append viewportBox as the ONLY direct child of screen
623
- screen.append(viewportBox);
624
- // A) Log to stderr only (never stdout)
625
- dbg('Creating MINIMAL SAFE LAYOUT');
626
- const cmdHeight = 3;
627
- const mainHeight = Math.max(5, viewport.rows - cmdHeight);
628
- const opsWidth = Math.max(40, Math.min(viewport.cols - 2, 80)); // Safe width
629
- const widgets = {
630
- viewport: viewportBox,
631
- posture: createPanel(viewportBox, 'posture', { left: 0, width: 0 }, 0, 1, '', false, useAsciiBorders),
632
- resources: createPanel(viewportBox, 'resources', { left: 0, width: 0 }, 0, 1, '', false, useAsciiBorders),
633
- assets: createPanel(viewportBox, 'assets', { left: 0, width: 0 }, 0, 1, '', false, useAsciiBorders),
634
- operations: createPanel(viewportBox, 'operations', { left: 1, width: opsWidth }, // Start at x=1, safe width
635
- 1, // Start at y=1
636
- mainHeight, 'OPERATIONS (MINIMAL MODE)', true, useAsciiBorders),
637
- network: createPanel(viewportBox, 'network', { left: 0, width: 0 }, 0, 1, '', false, useAsciiBorders),
638
- capabilities: createPanel(viewportBox, 'capabilities', { left: 0, width: 0 }, 0, 1, '', false, useAsciiBorders),
639
- commandLine: createCommandLine(viewportBox, mainHeight + 1, cmdHeight, Math.min(viewport.cols - 1, 80), // Safe width
640
- commandInputValue),
641
- watermark: createWatermark(viewportBox, viewport.rows, viewport.cols),
642
- };
643
- // A) Log to stderr only (never stdout)
644
- dbg(`Minimal layout: ops=${opsWidth}x${mainHeight}@(1,1), cmd@${mainHeight + 1}`);
645
- dbg(`Screen children before render: ${screen.children.length}`);
646
- screen.render();
647
- // A) Log to stderr only (never stdout)
648
- dbg(`Screen children after render: ${screen.children.length}`);
649
- // Command line focus will be set by attachCommandLineHandlers() in index.ts
650
- // Don't focus here - let manual input handler set it up
651
- return widgets;
652
- }
653
- //# sourceMappingURL=renderFrame.js.map