hatui-kit 0.1.0__py3-none-any.whl

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 (97) hide show
  1. hatui/__init__.py +11 -0
  2. hatui/__main__.py +5 -0
  3. hatui/app.py +200 -0
  4. hatui/core/__init__.py +1 -0
  5. hatui/core/actions.py +46 -0
  6. hatui/core/context.py +33 -0
  7. hatui/core/input_manager.py +167 -0
  8. hatui/core/screen_buffer.py +150 -0
  9. hatui/core/style.py +381 -0
  10. hatui/core/terminal_env.py +67 -0
  11. hatui/core/util.py +0 -0
  12. hatui/core/widget.py +203 -0
  13. hatui/demo/__init__.py +1 -0
  14. hatui/demo/screens/dashboard/modals/debug.yaml +72 -0
  15. hatui/demo/screens/dashboard/modals/help.yaml +43 -0
  16. hatui/demo/screens/dashboard/providers/phase8.yaml +429 -0
  17. hatui/demo/screens/dashboard/providers.yaml +487 -0
  18. hatui/demo/screens/dashboard/screen.yaml +64 -0
  19. hatui/demo/screens/dashboard/tabs/analysis.yaml +65 -0
  20. hatui/demo/screens/dashboard/tabs/forensics.yaml +71 -0
  21. hatui/demo/screens/dashboard/tabs/hacker.yaml +80 -0
  22. hatui/demo/screens/dashboard/tabs/logs.yaml +39 -0
  23. hatui/demo/screens/dashboard/tabs/overview.yaml +180 -0
  24. hatui/demo/screens/dashboard/tabs/visuals.yaml +84 -0
  25. hatui/demo/screens/dashboard.yaml +166 -0
  26. hatui/demo_assets.py +16 -0
  27. hatui/providers/__init__.py +54 -0
  28. hatui/providers/base.py +61 -0
  29. hatui/providers/builtins.py +546 -0
  30. hatui/providers/helpers.py +169 -0
  31. hatui/runtime/__init__.py +24 -0
  32. hatui/runtime/action_registry.py +102 -0
  33. hatui/runtime/bindings.py +40 -0
  34. hatui/runtime/bootstrap.py +94 -0
  35. hatui/runtime/cli.py +66 -0
  36. hatui/runtime/defaults.py +219 -0
  37. hatui/runtime/engine.py +135 -0
  38. hatui/runtime/formatters.py +65 -0
  39. hatui/runtime/loader.py +140 -0
  40. hatui/runtime/provider_manager.py +138 -0
  41. hatui/runtime/registries.py +65 -0
  42. hatui/runtime/render_policy.py +144 -0
  43. hatui/runtime/router.py +74 -0
  44. hatui/runtime/store.py +29 -0
  45. hatui/runtime/validation.py +433 -0
  46. hatui/runtime/watcher.py +167 -0
  47. hatui/widgets/__init__.py +89 -0
  48. hatui/widgets/alert_stack_widget.py +64 -0
  49. hatui/widgets/alert_widget.py +83 -0
  50. hatui/widgets/banner_widget.py +76 -0
  51. hatui/widgets/border_widget.py +93 -0
  52. hatui/widgets/box_widget.py +81 -0
  53. hatui/widgets/center_widget.py +29 -0
  54. hatui/widgets/chart_widget.py +222 -0
  55. hatui/widgets/code_block_widget.py +91 -0
  56. hatui/widgets/column_widget.py +48 -0
  57. hatui/widgets/diff_viewer_widget.py +88 -0
  58. hatui/widgets/divider_widget.py +66 -0
  59. hatui/widgets/event_feed_widget.py +72 -0
  60. hatui/widgets/flow_widget.py +77 -0
  61. hatui/widgets/gauge_widget.py +109 -0
  62. hatui/widgets/heatmap_widget.py +153 -0
  63. hatui/widgets/hex_dump_widget.py +91 -0
  64. hatui/widgets/histogram_widget.py +96 -0
  65. hatui/widgets/inspector_widget.py +85 -0
  66. hatui/widgets/kv_inspector_widget.py +134 -0
  67. hatui/widgets/label_widget.py +99 -0
  68. hatui/widgets/list_widget.py +185 -0
  69. hatui/widgets/log_widget.py +106 -0
  70. hatui/widgets/menu_widget.py +31 -0
  71. hatui/widgets/metric_grid_widget.py +103 -0
  72. hatui/widgets/mini_chart_widget.py +79 -0
  73. hatui/widgets/modal_host_widget.py +85 -0
  74. hatui/widgets/modal_widget.py +112 -0
  75. hatui/widgets/paragraph_widget.py +94 -0
  76. hatui/widgets/progress_bar_widget.py +124 -0
  77. hatui/widgets/root_services.py +267 -0
  78. hatui/widgets/root_widget.py +130 -0
  79. hatui/widgets/row_widget.py +48 -0
  80. hatui/widgets/scroll_widget.py +224 -0
  81. hatui/widgets/selection.py +52 -0
  82. hatui/widgets/signal_strip_widget.py +79 -0
  83. hatui/widgets/sparkline_widget.py +84 -0
  84. hatui/widgets/stat_widget.py +107 -0
  85. hatui/widgets/status_matrix_widget.py +234 -0
  86. hatui/widgets/status_strip_widget.py +85 -0
  87. hatui/widgets/table_widget.py +239 -0
  88. hatui/widgets/tabs_widget.py +188 -0
  89. hatui/widgets/text_widget.py +64 -0
  90. hatui/widgets/timeline_widget.py +81 -0
  91. hatui/widgets/tree_widget.py +341 -0
  92. hatui/widgets/visualization.py +110 -0
  93. hatui_kit-0.1.0.dist-info/METADATA +154 -0
  94. hatui_kit-0.1.0.dist-info/RECORD +97 -0
  95. hatui_kit-0.1.0.dist-info/WHEEL +4 -0
  96. hatui_kit-0.1.0.dist-info/entry_points.txt +2 -0
  97. hatui_kit-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,72 @@
1
+ route: debug_modal
2
+ child:
3
+ type: modal
4
+ name: debug_modal
5
+ width: 108
6
+ height: 24
7
+ backdrop_bg_color: "@surface_alt"
8
+ child:
9
+ type: box
10
+ name: debug_modal_box
11
+ title: runtime debug
12
+ padding: 1
13
+ style: rounded
14
+ fg_color: "@accent"
15
+ child:
16
+ type: column
17
+ name: debug_modal_column
18
+ children:
19
+ - type: row
20
+ name: debug_modal_body
21
+ weight: 8
22
+ children:
23
+ - type: box
24
+ name: debug_tree_box
25
+ title: widget tree
26
+ padding: 1
27
+ weight: 5
28
+ child:
29
+ type: tree
30
+ name: debug_tree
31
+ items_key: _debug.widget_tree
32
+ selected_item_key: debug.selected_tree_item
33
+ activate_action: route_pop_focus_widget
34
+ activate_target_field: widget_name
35
+ - type: box
36
+ name: debug_provider_box
37
+ title: providers
38
+ padding: 1
39
+ weight: 5
40
+ child:
41
+ type: inspector
42
+ name: debug_provider_inspector
43
+ data_key: _providers
44
+ focusable: false
45
+ - type: box
46
+ name: debug_footer_row
47
+ weight: 4
48
+ child:
49
+ type: row
50
+ name: debug_footer
51
+ children:
52
+ - type: box
53
+ name: debug_runtime_box
54
+ title: runtime
55
+ padding: 1
56
+ weight: 4
57
+ child:
58
+ type: inspector
59
+ name: debug_runtime_inspector
60
+ data_key: _debug.stats
61
+ focusable: false
62
+ - type: box
63
+ name: debug_watch_box
64
+ title: watched files
65
+ padding: 1
66
+ weight: 6
67
+ child:
68
+ type: list
69
+ name: debug_watch_list
70
+ items_key: _debug.stats.watched_files
71
+ show_bullet: false
72
+ focusable: false
@@ -0,0 +1,43 @@
1
+ route: help_modal
2
+ child:
3
+ type: modal
4
+ name: help_modal
5
+ width: 72
6
+ height: 18
7
+ backdrop_bg_color: "@surface_alt"
8
+ child:
9
+ type: box
10
+ name: help_modal_box
11
+ title: help overlay
12
+ padding: 1
13
+ style: rounded
14
+ fg_color: "@accent"
15
+ child:
16
+ type: column
17
+ name: help_modal_column
18
+ children:
19
+ - type: paragraph
20
+ name: help_modal_text
21
+ text_key: ui.help_text
22
+ weight: 4
23
+ - type: menu
24
+ name: help_modal_menu
25
+ bullet: "» "
26
+ selected_fg_color: "@selection_fg"
27
+ selected_bg_color: "@selection_bg"
28
+ weight: 3
29
+ items:
30
+ - label: close overlay
31
+ action: route_pop
32
+ - label: jump to overview
33
+ action: route_set
34
+ payload:
35
+ route: overview
36
+ - label: jump to forensics
37
+ action: route_set
38
+ payload:
39
+ route: forensics
40
+ - label: jump to logs
41
+ action: route_set
42
+ payload:
43
+ route: logs
@@ -0,0 +1,429 @@
1
+ - type: waveform
2
+ name: link_primary_sample
3
+ target: viz_samples.link_primary
4
+ waveform: sine
5
+ frequency: 0.36
6
+ phase: 0.15
7
+ amplitude: 0.26
8
+ offset: 0.62
9
+
10
+ - type: waveform
11
+ name: link_secondary_sample
12
+ target: viz_samples.link_secondary
13
+ waveform: sine
14
+ frequency: 0.52
15
+ phase: 1.1
16
+ amplitude: 0.22
17
+ offset: 0.48
18
+
19
+ - type: waveform
20
+ name: latency_sample
21
+ target: viz_samples.latency
22
+ waveform: triangle
23
+ frequency: 0.31
24
+ phase: 0.4
25
+ amplitude: 0.35
26
+ offset: 0.45
27
+
28
+ - type: waveform
29
+ name: thermal_sample
30
+ target: viz_samples.thermal
31
+ waveform: sine
32
+ frequency: 0.28
33
+ phase: 2.0
34
+ amplitude: 0.18
35
+ offset: 0.58
36
+
37
+ - type: waveform
38
+ name: ingress_sample
39
+ target: viz_samples.ingress
40
+ waveform: sine
41
+ frequency: 0.44
42
+ phase: 0.2
43
+ amplitude: 180
44
+ offset: 420
45
+
46
+ - type: waveform
47
+ name: egress_sample
48
+ target: viz_samples.egress
49
+ waveform: sine
50
+ frequency: 0.38
51
+ phase: 1.8
52
+ amplitude: 120
53
+ offset: 260
54
+
55
+ - type: waveform
56
+ name: queue_a_sample
57
+ target: viz_samples.queue_a
58
+ waveform: sine
59
+ frequency: 0.71
60
+ phase: 0.3
61
+ amplitude: 0.4
62
+ offset: 0.5
63
+
64
+ - type: waveform
65
+ name: queue_b_sample
66
+ target: viz_samples.queue_b
67
+ waveform: saw
68
+ frequency: 0.56
69
+ phase: 0.8
70
+ amplitude: 0.35
71
+ offset: 0.55
72
+
73
+ - type: waveform
74
+ name: queue_c_sample
75
+ target: viz_samples.queue_c
76
+ waveform: triangle
77
+ frequency: 0.66
78
+ phase: 1.4
79
+ amplitude: 0.3
80
+ offset: 0.42
81
+
82
+ - type: rolling_window
83
+ name: link_primary_series
84
+ target: viz.link_primary_series
85
+ source: viz_samples.link_primary
86
+ size: 64
87
+ depends_on: [link_primary_sample]
88
+
89
+ - type: rolling_window
90
+ name: link_secondary_series
91
+ target: viz.link_secondary_series
92
+ source: viz_samples.link_secondary
93
+ size: 64
94
+ depends_on: [link_secondary_sample]
95
+
96
+ - type: rolling_window
97
+ name: latency_series
98
+ target: viz.latency_series
99
+ source: viz_samples.latency
100
+ size: 64
101
+ depends_on: [latency_sample]
102
+
103
+ - type: records
104
+ name: heatmap_row
105
+ target: viz.heatmap_row
106
+ depends_on: [queue_a_sample, queue_b_sample, queue_c_sample, scan_progress, uplink_progress, packet_sample]
107
+ items:
108
+ - source: viz_samples.queue_a
109
+ - source: viz_samples.queue_b
110
+ - source: viz_samples.queue_c
111
+ - source: signals.scan_progress
112
+ - source: signals.uplink_progress
113
+ - source: signals.packet_sample
114
+
115
+ - type: grid_history
116
+ name: heatmap_grid
117
+ target: viz.heatmap
118
+ source: viz.heatmap_row
119
+ size: 14
120
+ depends_on: [heatmap_row]
121
+
122
+ - type: transform
123
+ name: line_chart_series
124
+ target: viz.line_chart_series
125
+ depends_on: [link_primary_series, link_secondary_series]
126
+ items:
127
+ - label: uplink
128
+ values: viz.link_primary_series
129
+ fg_color: "@accent"
130
+ - label: relay
131
+ values: viz.link_secondary_series
132
+ fg_color: "@accent_alt"
133
+
134
+ - type: transform
135
+ name: area_chart_series
136
+ target: viz.area_chart_series
137
+ depends_on: [latency_series]
138
+ items:
139
+ - label: latency envelope
140
+ values: viz.latency_series
141
+ fg_color: "@success"
142
+ fill_color: "@success"
143
+
144
+ - type: transform
145
+ name: throughput_bars
146
+ target: viz.throughput_bars
147
+ depends_on: [ingress_sample, egress_sample, thread_count, memory_gb]
148
+ items:
149
+ - label: in
150
+ value: viz_samples.ingress
151
+ fg_color: "@accent"
152
+ - label: out
153
+ value: viz_samples.egress
154
+ fg_color: "@success"
155
+ - label: thr
156
+ value: stats_sources.thread_count
157
+ fg_color: "@warn"
158
+ - label: mem
159
+ value: stats_sources.memory_gb
160
+ fg_color: "@accent_alt"
161
+
162
+ - type: event_stream
163
+ name: visual_timeline
164
+ target: viz.timeline
165
+ interval: 1.0
166
+ max_items: 24
167
+ depends_on: [alert_level, packet_sample, ingress_sample]
168
+ item:
169
+ level:
170
+ path: alerts.level
171
+ source: uplink
172
+ label:
173
+ template: "burst {burst} / ingress {ingress}"
174
+ mapping:
175
+ burst:
176
+ path: signals.packet_sample
177
+ formatter:
178
+ name: fixed
179
+ precision: 2
180
+ ingress:
181
+ path: viz_samples.ingress
182
+ formatter:
183
+ name: fixed
184
+ precision: 0
185
+
186
+ - type: transform
187
+ name: inspector_payload
188
+ target: viz.inspector
189
+ depends_on: [system_stats, host_info, frame]
190
+ mapping:
191
+ host:
192
+ path: host
193
+ runtime:
194
+ path: runtime.frame
195
+ system:
196
+ path: system
197
+ provider_packet_series:
198
+ path: telemetry.provider_meta.packet_series
199
+
200
+ - type: constant
201
+ name: diff_left
202
+ target: viz.diff_left
203
+ value: |-
204
+ route overview
205
+ scan-mode passive
206
+ relay-window 32
207
+ packet-threshold 0.75
208
+ heatmap-bucket 6
209
+
210
+ - type: transform
211
+ name: diff_right
212
+ target: viz.diff_right
213
+ depends_on: [packet_sample, scan_progress]
214
+ template: |-
215
+ route visuals
216
+ scan-mode active
217
+ relay-window {window}
218
+ packet-threshold {threshold}
219
+ heatmap-bucket 8
220
+ mapping:
221
+ window:
222
+ path: runtime.frame.terminal_width
223
+ formatter:
224
+ name: fixed
225
+ precision: 0
226
+ threshold:
227
+ path: signals.packet_sample
228
+ formatter:
229
+ name: fixed
230
+ precision: 2
231
+
232
+ - type: transform
233
+ name: flow_edges
234
+ target: viz.flow_edges
235
+ depends_on: [packet_sample, uplink_progress, alert_level]
236
+ items:
237
+ - from: edge
238
+ to: ingress
239
+ label:
240
+ path: viz_samples.ingress
241
+ formatter:
242
+ name: fixed
243
+ precision: 0
244
+ template: "{value} kb/s"
245
+ state: active
246
+ - from: ingress
247
+ to: parser
248
+ label:
249
+ path: alerts.level
250
+ state:
251
+ path: alerts.level
252
+ operations:
253
+ - name: template
254
+ template: "{value}"
255
+ - from: parser
256
+ to: queue
257
+ label:
258
+ path: signals.packet_sample
259
+ formatter:
260
+ name: fixed
261
+ precision: 2
262
+ state: active
263
+ - from: queue
264
+ to: uplink
265
+ label:
266
+ path: signals.uplink_progress
267
+ formatter:
268
+ name: percent
269
+ precision: 0
270
+ state: online
271
+
272
+ - type: records
273
+ name: hacker_entity_seed
274
+ target: hacker.entity_seed
275
+ depends_on: [network_rx, network_tx, thread_count, memory_gb, cache_gb]
276
+ items:
277
+ - label: uplink-01
278
+ state: stable
279
+ value:
280
+ path: signals.uplink_progress
281
+ formatter:
282
+ name: percent
283
+ precision: 0
284
+ meta:
285
+ path: stats_sources.network_rx
286
+ formatter:
287
+ name: fixed
288
+ precision: 0
289
+ template: "rx {value} kb/s"
290
+ - label: relay-03
291
+ state: retry
292
+ value:
293
+ path: signals.packet_sample
294
+ formatter:
295
+ name: fixed
296
+ precision: 2
297
+ meta:
298
+ path: stats_sources.network_tx
299
+ formatter:
300
+ name: fixed
301
+ precision: 0
302
+ template: "tx {value} kb/s"
303
+ - label: scan-core
304
+ state: scanning
305
+ value:
306
+ path: signals.scan_progress
307
+ formatter:
308
+ name: percent
309
+ precision: 0
310
+ meta:
311
+ path: stats_sources.thread_count
312
+ formatter:
313
+ name: fixed
314
+ precision: 0
315
+ template: "{value} thr"
316
+ - label: auth-mesh
317
+ state: syncing
318
+ value:
319
+ path: stats_sources.memory_gb
320
+ formatter:
321
+ name: fixed
322
+ precision: 1
323
+ template: "{value} GB"
324
+ meta:
325
+ path: stats_sources.cache_gb
326
+ formatter:
327
+ name: fixed
328
+ precision: 1
329
+ template: "cache {value} GB"
330
+
331
+ - type: normalize_state
332
+ name: hacker_entities
333
+ target: hacker.entities
334
+ source: hacker.entity_seed
335
+ depends_on: [hacker_entity_seed]
336
+ state_map:
337
+ stable: online
338
+ retry: degraded
339
+ syncing: busy
340
+ scanning: busy
341
+ warming: busy
342
+ degraded: degraded
343
+ online: online
344
+ idle: idle
345
+ severity_by_state:
346
+ online: success
347
+ busy: warn
348
+ degraded: error
349
+ idle: info
350
+ default_state: unknown
351
+ default_severity: info
352
+
353
+ - type: records
354
+ name: hacker_signal_strip
355
+ target: hacker.signal_strip
356
+ depends_on: [hacker_entities]
357
+ items:
358
+ - label: UL
359
+ severity: hacker.entities.0.severity
360
+ - label: RL
361
+ severity: hacker.entities.1.severity
362
+ - label: SC
363
+ severity: hacker.entities.2.severity
364
+ - label: AU
365
+ severity: hacker.entities.3.severity
366
+
367
+ - type: bucket
368
+ name: hacker_packet_histogram
369
+ target: hacker.packet_histogram
370
+ source: telemetry.packet_series
371
+ depends_on: [packet_series]
372
+ bucket_count: 8
373
+ min: 0.2
374
+ max: 1.0
375
+ precision: 2
376
+
377
+ - type: event_stream
378
+ name: hacker_alert_stream
379
+ target: hacker.alerts
380
+ interval: 1.0
381
+ max_items: 24
382
+ depends_on: [alert_level, packet_sample, uplink_progress]
383
+ item:
384
+ level:
385
+ path: alerts.level
386
+ default: warn
387
+ source: relay-03
388
+ message:
389
+ template: "burst {burst} // uplink {uplink} // relay {relay}"
390
+ mapping:
391
+ burst:
392
+ path: signals.packet_sample
393
+ formatter:
394
+ name: fixed
395
+ precision: 2
396
+ uplink:
397
+ path: signals.uplink_progress
398
+ formatter:
399
+ name: percent
400
+ precision: 0
401
+ relay:
402
+ value: retry
403
+
404
+ - type: transform
405
+ name: hacker_selected_detail
406
+ target: hacker.selected_detail
407
+ depends_on: [hacker_entities, frame]
408
+ mapping:
409
+ selected:
410
+ path: state.selection.matrix_item
411
+ runtime:
412
+ path: runtime.frame
413
+ signals:
414
+ mapping:
415
+ packet:
416
+ path: signals.packet_sample
417
+ formatter:
418
+ name: fixed
419
+ precision: 2
420
+ uplink:
421
+ path: signals.uplink_progress
422
+ formatter:
423
+ name: percent
424
+ precision: 0
425
+ scan:
426
+ path: signals.scan_progress
427
+ formatter:
428
+ name: percent
429
+ precision: 0