@senad-d/observme 0.1.0

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 (111) hide show
  1. package/.env.example +57 -0
  2. package/CHANGELOG.md +52 -0
  3. package/LICENSE +21 -0
  4. package/ObservMe-Production-Docs/00-README.md +79 -0
  5. package/ObservMe-Production-Docs/01-requirements-and-scope.md +207 -0
  6. package/ObservMe-Production-Docs/02-reference-architecture.md +306 -0
  7. package/ObservMe-Production-Docs/03-pi-event-and-session-model.md +266 -0
  8. package/ObservMe-Production-Docs/04-telemetry-semantic-conventions.md +722 -0
  9. package/ObservMe-Production-Docs/05-otel-pipeline-and-collector.md +355 -0
  10. package/ObservMe-Production-Docs/06-security-privacy-redaction.md +294 -0
  11. package/ObservMe-Production-Docs/07-extension-implementation-blueprint.md +447 -0
  12. package/ObservMe-Production-Docs/08-query-grafana-integration.md +276 -0
  13. package/ObservMe-Production-Docs/09-dashboards-alerts-slos.md +640 -0
  14. package/ObservMe-Production-Docs/10-testing-release-operations.md +319 -0
  15. package/ObservMe-Production-Docs/11-deployment-runbooks.md +203 -0
  16. package/ObservMe-Production-Docs/12-configuration-reference.md +337 -0
  17. package/ObservMe-Production-Docs/13-source-notes.md +33 -0
  18. package/ObservMe-Production-Docs/pi-session-format.md +427 -0
  19. package/README.md +356 -0
  20. package/SECURITY.md +45 -0
  21. package/dashboards/observme-agent-node-graphs.json +250 -0
  22. package/dashboards/observme-agents.json +1880 -0
  23. package/dashboards/observme-alerts.yaml +113 -0
  24. package/dashboards/observme-branches-compactions.json +1042 -0
  25. package/dashboards/observme-cost.json +1254 -0
  26. package/dashboards/observme-errors.json +1659 -0
  27. package/dashboards/observme-export-health.json +1802 -0
  28. package/dashboards/observme-latency.json +1494 -0
  29. package/dashboards/observme-llm-conversations.json +730 -0
  30. package/dashboards/observme-logs-llm.json +644 -0
  31. package/dashboards/observme-models.json +933 -0
  32. package/dashboards/observme-overview.json +2129 -0
  33. package/dashboards/observme-slo-health.json +737 -0
  34. package/dashboards/observme-slos.yaml +56 -0
  35. package/dashboards/observme-tools.json +902 -0
  36. package/dashboards/observme-trace-journey.json +1793 -0
  37. package/docs/STRUCTURE.md +49 -0
  38. package/docs/agent-subagent-observability-requirements.md +997 -0
  39. package/docs/compatibility-matrix.md +39 -0
  40. package/docs/configuration-tui-design-standard.md +767 -0
  41. package/docs/configuration.md +38 -0
  42. package/docs/review-validation.md +115 -0
  43. package/docs/validation-flow.md +117 -0
  44. package/examples/collector.yaml +123 -0
  45. package/examples/observme.yaml +131 -0
  46. package/img/demo.gif +0 -0
  47. package/img/icon.svg +47 -0
  48. package/package.json +103 -0
  49. package/src/commands/obs-agents-runtime.ts +150 -0
  50. package/src/commands/obs-agents.ts +491 -0
  51. package/src/commands/obs-args.ts +63 -0
  52. package/src/commands/obs-backfill.ts +1334 -0
  53. package/src/commands/obs-command-support.ts +43 -0
  54. package/src/commands/obs-cost.ts +228 -0
  55. package/src/commands/obs-diagnostics.ts +22 -0
  56. package/src/commands/obs-errors.ts +156 -0
  57. package/src/commands/obs-health.ts +301 -0
  58. package/src/commands/obs-link.ts +90 -0
  59. package/src/commands/obs-logs.ts +194 -0
  60. package/src/commands/obs-loki-summary.ts +184 -0
  61. package/src/commands/obs-session.ts +259 -0
  62. package/src/commands/obs-status.ts +359 -0
  63. package/src/commands/obs-tools.ts +274 -0
  64. package/src/commands/obs-trace.ts +411 -0
  65. package/src/commands/obs.ts +211 -0
  66. package/src/config/bootstrap-project-config.ts +300 -0
  67. package/src/config/defaults.ts +143 -0
  68. package/src/config/load-config.ts +631 -0
  69. package/src/config/project-paths.ts +61 -0
  70. package/src/config/schema.ts +405 -0
  71. package/src/config/validate.ts +456 -0
  72. package/src/constants.ts +4 -0
  73. package/src/diagnostics/sanitize.ts +6 -0
  74. package/src/extension.ts +38 -0
  75. package/src/otel/logs.ts +160 -0
  76. package/src/otel/metrics.ts +165 -0
  77. package/src/otel/otlp-endpoint.ts +10 -0
  78. package/src/otel/sdk.ts +114 -0
  79. package/src/otel/shutdown.ts +102 -0
  80. package/src/otel/traces.ts +166 -0
  81. package/src/pi/agent-lineage.ts +378 -0
  82. package/src/pi/agent-tree-tracker.ts +258 -0
  83. package/src/pi/event-handlers/agent-turn.ts +155 -0
  84. package/src/pi/event-handlers/lifecycle.ts +642 -0
  85. package/src/pi/event-handlers/llm.ts +115 -0
  86. package/src/pi/event-handlers/session-events.ts +159 -0
  87. package/src/pi/event-handlers/tool-bash.ts +275 -0
  88. package/src/pi/handler-internals.ts +2154 -0
  89. package/src/pi/handler-runtime.ts +633 -0
  90. package/src/pi/handler-types.ts +261 -0
  91. package/src/pi/handlers.ts +75 -0
  92. package/src/pi/subagent-spawn.ts +975 -0
  93. package/src/pi/subagent-types.ts +29 -0
  94. package/src/privacy/content-capture.ts +104 -0
  95. package/src/privacy/hash.ts +93 -0
  96. package/src/privacy/redact.ts +619 -0
  97. package/src/privacy/secret-patterns.ts +185 -0
  98. package/src/privacy/truncate.ts +69 -0
  99. package/src/query/grafana-readiness.ts +164 -0
  100. package/src/query/grafana-transport.ts +481 -0
  101. package/src/query/grafana.ts +371 -0
  102. package/src/query/loki.ts +332 -0
  103. package/src/query/prometheus.ts +388 -0
  104. package/src/query/tempo.ts +332 -0
  105. package/src/safety/sensitive-input.ts +208 -0
  106. package/src/semconv/attributes.ts +279 -0
  107. package/src/semconv/metrics.ts +146 -0
  108. package/src/semconv/spans.ts +19 -0
  109. package/src/semconv/values.ts +13 -0
  110. package/src/util/bounded-map.ts +97 -0
  111. package/tsconfig.json +15 -0
@@ -0,0 +1,767 @@
1
+ # Configuration TUI Design Template
2
+
3
+ ## Purpose
4
+
5
+ This document defines a reusable visual standard for a terminal-based configuration interface. It describes only how the interface should look and behave visually. It does not define any product-specific content, setting names, configuration keys, file paths, or implementation details.
6
+
7
+ ## Design Goal
8
+
9
+ Create a compact, polished, keyboard-driven configuration screen with:
10
+
11
+ - A framed terminal-panel appearance.
12
+ - A clear category area and setting-detail area.
13
+ - Strong visual focus states.
14
+ - Right-aligned setting values.
15
+ - Minimal but complete keyboard help.
16
+ - Responsive behavior for wide, narrow, and tiny terminal widths.
17
+ - Consistent colors through theme roles instead of hardcoded colors.
18
+
19
+ ## Core Visual Principles
20
+
21
+ - The interface must feel like a structured control panel, not a free-form list.
22
+ - Use a monospaced terminal grid.
23
+ - Use Unicode box-drawing characters for normal-width layouts.
24
+ - Use clean spacing and alignment over decoration.
25
+ - Use one selection marker everywhere: `▶ `.
26
+ - Use one footer/status separator everywhere: ` • `.
27
+ - Use short, readable labels.
28
+ - Keep help text compact and predictable.
29
+ - Never allow rendered lines to exceed the terminal width.
30
+
31
+ ## Theme Roles
32
+
33
+ Use semantic theme roles consistently.
34
+
35
+ | UI Element | Theme Role |
36
+ | --- | --- |
37
+ | Outer border | `accent` |
38
+ | Pane separators | `accent` |
39
+ | Focused selected prefix | `accent` |
40
+ | Focused selected label | `accent` + bold |
41
+ | Unfocused selected prefix | `muted` |
42
+ | Unfocused selected label | `muted` |
43
+ | Unselected category label | `dim` |
44
+ | Counter text | `dim` |
45
+ | Helper text | `dim` |
46
+ | Empty value | `dim` |
47
+ | Disabled/off value | `dim` |
48
+ | Enabled/on value | `success` |
49
+ | Warning/no-match text | `warning` |
50
+ | Slider bar | `accent` |
51
+
52
+ Rules:
53
+
54
+ - Do not hardcode ANSI color values.
55
+ - Apply styling through theme roles only.
56
+ - Selected text in the active pane is bold.
57
+ - Selected text in an inactive pane is not bold.
58
+ - Unselected setting labels use normal text.
59
+ - Unselected category labels are dimmed.
60
+
61
+ ## Responsive Width Modes
62
+
63
+ ### Wide Mode
64
+
65
+ Use wide mode when terminal width is at least `72` columns.
66
+
67
+ Wide mode shows two panes:
68
+
69
+ - Left pane: categories.
70
+ - Right pane: settings for the selected category or search results.
71
+
72
+ Width calculation:
73
+
74
+ ```text
75
+ leftPaneWidth = min(22, max(16, floor(totalWidth * 0.27)))
76
+ rightPaneWidth = max(10, totalWidth - leftPaneWidth - 3)
77
+ ```
78
+
79
+ The `3` reserved columns are:
80
+
81
+ ```text
82
+ left border + middle divider + right border
83
+ ```
84
+
85
+ Minimum body height:
86
+
87
+ ```text
88
+ bodyHeight = max(categoryRowCount, settingsRowCount, 8)
89
+ ```
90
+
91
+ Wide layout skeleton:
92
+
93
+ ```text
94
+ ╭─ Configuration ───────────────────────────────────── Scope ─╮
95
+ │writes <target> • external overrides may apply │
96
+ │↑↓ move Tab pane Enter edit / search Esc back q quit │
97
+ ├──────────────────────┬──────────────────────────────────────┤
98
+ │▶ Category │SECTION TITLE 1/6│
99
+ │ Category │▶ Setting label value │
100
+ │ Category │ Setting label value │
101
+ │ │ Setting label value │
102
+ ├──────────────────────┴──────────────────────────────────────┤
103
+ │1/6 • Description of the selected setting │
104
+ ╰─────────────────────────────────────────────────────────────╯
105
+ ```
106
+
107
+ ### Narrow Mode
108
+
109
+ Use narrow mode when terminal width is from `24` to `71` columns.
110
+
111
+ Narrow mode shows one pane at a time:
112
+
113
+ - Category view when categories are focused.
114
+ - Settings view when a category is opened or search is active.
115
+
116
+ Narrow category-view skeleton:
117
+
118
+ ```text
119
+ ╭─ Configuration ───────────────── Scope ─╮
120
+ │writes <target> • external overrides... │
121
+ │↑↓ category Enter open / search q quit│
122
+ ├─────────────────────────────────────────┤
123
+ │▶ Category │
124
+ │ Category │
125
+ │ Category │
126
+ ├─────────────────────────────────────────┤
127
+ │1/3 • Category description │
128
+ ╰─────────────────────────────────────────╯
129
+ ```
130
+
131
+ Narrow settings-view skeleton:
132
+
133
+ ```text
134
+ ╭─ Configuration ───────────────────────────── Scope ─╮
135
+ │writes <target> • external overrides... │
136
+ │↑↓ move Enter edit Esc categories / search q quit│
137
+ ├─────────────────────────────────────────────────────┤
138
+ │SECTION TITLE 1/6 │
139
+ │▶ Setting label value │
140
+ │ Setting label value │
141
+ ├─────────────────────────────────────────────────────┤
142
+ │1/6 • Selected setting description │
143
+ ╰─────────────────────────────────────────────────────╯
144
+ ```
145
+
146
+ ### Tiny Mode
147
+
148
+ Use tiny mode when terminal width is less than `24` columns.
149
+
150
+ Tiny mode has no box border.
151
+
152
+ Tiny layout:
153
+
154
+ ```text
155
+ Configuration
156
+ Scope
157
+ Selected label: value
158
+ q quit
159
+ ```
160
+
161
+ Rules:
162
+
163
+ - Render exactly the essential information.
164
+ - Clip every line to terminal width.
165
+ - Do not draw borders.
166
+ - Do not attempt pane layout.
167
+
168
+ ## Outer Frame
169
+
170
+ The normal-width interface uses a single outer frame.
171
+
172
+ ### Top Border
173
+
174
+ Top border pattern:
175
+
176
+ ```text
177
+ ╭─ Configuration ───────────────────── Scope ─╮
178
+ ```
179
+
180
+ Construction rules:
181
+
182
+ - Left corner: `╭`
183
+ - Right corner: `╮`
184
+ - Horizontal line: `─`
185
+ - Title begins after the first horizontal segment.
186
+ - Scope label appears on the right side.
187
+ - Fill available space between title and scope with `─`.
188
+ - Entire line uses the `accent` role.
189
+ - If space is limited, truncate the inner title/scope text and pad to fit exactly.
190
+
191
+ ### Bottom Border
192
+
193
+ Bottom border pattern:
194
+
195
+ ```text
196
+ ╰────────────────────────────────────────────╯
197
+ ```
198
+
199
+ Construction rules:
200
+
201
+ - Left corner: `╰`
202
+ - Right corner: `╯`
203
+ - Fill with `─`.
204
+ - Entire line uses the `accent` role.
205
+ - Visible width equals terminal width.
206
+
207
+ ### Full-Width Interior Lines
208
+
209
+ Interior line pattern:
210
+
211
+ ```text
212
+ │content padded to inner width│
213
+ ```
214
+
215
+ Rules:
216
+
217
+ - Left and right borders are `│`.
218
+ - Border characters use `accent`.
219
+ - Inner content width is `totalWidth - 2`.
220
+ - Content is clipped and then right-padded.
221
+
222
+ ## Header Area
223
+
224
+ The header area contains two full-width lines below the title border.
225
+
226
+ ### Source/Target Line
227
+
228
+ Pattern:
229
+
230
+ ```text
231
+ writes <target> • external overrides may apply
232
+ ```
233
+
234
+ Rules:
235
+
236
+ - Start with `writes `.
237
+ - Show the active write target or configuration source generically.
238
+ - Use ` • ` before the override note.
239
+ - If the target text is long, preserve the tail with a leading ellipsis.
240
+ - Keep the text plain; do not over-style this line.
241
+
242
+ ### Keyboard Help Line
243
+
244
+ Wide mode:
245
+
246
+ ```text
247
+ ↑↓ move Tab pane Enter edit / search Esc back q quit
248
+ ```
249
+
250
+ Narrow category mode:
251
+
252
+ ```text
253
+ ↑↓ category Enter open / search q quit
254
+ ```
255
+
256
+ Narrow settings mode:
257
+
258
+ ```text
259
+ ↑↓ move Enter edit Esc categories / search q quit
260
+ ```
261
+
262
+ Rules:
263
+
264
+ - Use two spaces between command groups.
265
+ - Use plain text.
266
+ - Do not add extra icons.
267
+ - Clip and pad to fit.
268
+
269
+ ## Pane Separators
270
+
271
+ ### Wide Separators
272
+
273
+ Top pane separator:
274
+
275
+ ```text
276
+ ├──────────────┬────────────────────────┤
277
+ ```
278
+
279
+ Bottom pane separator:
280
+
281
+ ```text
282
+ ├──────────────┴────────────────────────┤
283
+ ```
284
+
285
+ Rules:
286
+
287
+ - Use `┬` between panes on the top separator.
288
+ - Use `┴` between panes on the bottom separator.
289
+ - Use `├` and `┤` at the sides.
290
+ - Use `─` for horizontal fill.
291
+ - Entire separator uses `accent`.
292
+
293
+ ### Narrow Separators
294
+
295
+ Pattern:
296
+
297
+ ```text
298
+ ├───────────────────────────────────────┤
299
+ ```
300
+
301
+ Rules:
302
+
303
+ - No middle divider.
304
+ - Entire separator uses `accent`.
305
+ - Width matches terminal width.
306
+
307
+ ## Category Pane
308
+
309
+ The category pane is a vertical list of navigation choices.
310
+
311
+ ### Row Structure
312
+
313
+ ```text
314
+ <prefix><label>
315
+ ```
316
+
317
+ Prefix rules:
318
+
319
+ | State | Prefix |
320
+ | --- | --- |
321
+ | Selected | `▶ ` |
322
+ | Not selected | ` ` |
323
+
324
+ ### Selected Category Styling
325
+
326
+ When the category pane has focus:
327
+
328
+ ```text
329
+ ▶ Category
330
+ ```
331
+
332
+ - Prefix: `accent`
333
+ - Label: `accent` + bold
334
+
335
+ When the category pane does not have focus:
336
+
337
+ ```text
338
+ ▶ Category
339
+ ```
340
+
341
+ - Prefix: `muted`
342
+ - Label: `muted`
343
+ - Not bold
344
+
345
+ ### Unselected Category Styling
346
+
347
+ ```text
348
+ Category
349
+ ```
350
+
351
+ - Prefix: plain spaces
352
+ - Label: `dim`
353
+
354
+ ### Category Row Sizing
355
+
356
+ - Prefix consumes exactly 2 visible columns.
357
+ - Label uses remaining pane width.
358
+ - Long labels are clipped with an ellipsis.
359
+ - Entire row is padded to pane width.
360
+
361
+ ## Settings Pane
362
+
363
+ The settings pane contains:
364
+
365
+ 1. A section header row.
366
+ 2. Setting rows.
367
+ 3. Optional empty/no-match row.
368
+
369
+ ## Settings Section Header
370
+
371
+ Header pattern:
372
+
373
+ ```text
374
+ SECTION TITLE 1/6
375
+ ```
376
+
377
+ Rules:
378
+
379
+ - Section title is uppercase.
380
+ - Section title is bold.
381
+ - Section title is `accent` when settings pane is focused.
382
+ - Section title is `dim` when settings pane is not focused.
383
+ - Counter is always `dim`.
384
+ - Counter is right-aligned.
385
+ - At least one space separates title and counter.
386
+ - If there are no settings, use `0/0`.
387
+
388
+ Search header pattern:
389
+
390
+ ```text
391
+ SEARCH QUERY 1/4
392
+ ```
393
+
394
+ Rules:
395
+
396
+ - Prefix with `SEARCH `.
397
+ - Uppercase the full search title.
398
+
399
+ ## Setting Rows
400
+
401
+ ### Row Structure
402
+
403
+ Each setting row contains:
404
+
405
+ ```text
406
+ <prefix><label column><space><value column>
407
+ ```
408
+
409
+ Width formula:
410
+
411
+ ```text
412
+ valueWidth = max(0, min(28, floor(paneWidth * 0.4)))
413
+ labelWidth = max(1, paneWidth - 2 - 1 - valueWidth)
414
+ ```
415
+
416
+ Example:
417
+
418
+ ```text
419
+ ▶ Setting label value
420
+ Another setting ON
421
+ ```
422
+
423
+ Rules:
424
+
425
+ - Prefix consumes exactly 2 visible columns.
426
+ - Label column is left-aligned.
427
+ - Value column is right-aligned.
428
+ - One visible space separates label and value.
429
+ - Long labels are clipped.
430
+ - Long values are clipped according to their value type.
431
+
432
+ ### Selected Setting Styling
433
+
434
+ When the settings pane has focus:
435
+
436
+ - Prefix: `accent`
437
+ - Label: `accent` + bold
438
+
439
+ When the settings pane does not have focus:
440
+
441
+ - Prefix: `muted`
442
+ - Label: `muted`
443
+ - Not bold
444
+
445
+ ### Unselected Setting Styling
446
+
447
+ - Prefix: plain spaces
448
+ - Label: normal text
449
+ - Value: styled according to value type
450
+
451
+ ## Search Result Rows
452
+
453
+ When search is active, setting labels include their category or group context.
454
+
455
+ Pattern:
456
+
457
+ ```text
458
+ Setting label (Category)
459
+ ```
460
+
461
+ Rules:
462
+
463
+ - Append context in parentheses.
464
+ - Clip the combined label if needed.
465
+ - Keep the same value alignment.
466
+
467
+ ## Maximum Visible Setting Rows
468
+
469
+ Show at most `10` setting rows below the section header.
470
+
471
+ Rules:
472
+
473
+ - If there are 10 or fewer settings, show all.
474
+ - If there are more than 10 settings, show a moving window.
475
+ - Keep the selected setting visible.
476
+ - Prefer centering the selected setting when possible.
477
+ - Do not show a scrollbar in the main settings pane.
478
+ - Use the header counter as the position indicator.
479
+
480
+ ## Empty Results State
481
+
482
+ When no settings are available or no search result matches:
483
+
484
+ ```text
485
+ No matching settings
486
+ ```
487
+
488
+ Rules:
489
+
490
+ - Prefix with two spaces.
491
+ - Use `warning` color.
492
+ - Keep the section header visible above it.
493
+ - Show counter as `0/0`.
494
+
495
+ ## Value Display Standards
496
+
497
+ Values appear in the right-aligned value column.
498
+
499
+ ### Empty Values
500
+
501
+ Examples:
502
+
503
+ ```text
504
+ not set
505
+ <empty>
506
+ auto
507
+ ```
508
+
509
+ Rules:
510
+
511
+ - Use a meaningful empty label.
512
+ - Color empty values with `dim`.
513
+ - Clip if necessary.
514
+
515
+ ### Boolean Values
516
+
517
+ Use uppercase labels:
518
+
519
+ ```text
520
+ ON
521
+ OFF
522
+ ```
523
+
524
+ Rules:
525
+
526
+ - Enabled value: `ON` with `success`.
527
+ - Disabled value: `OFF` with `dim`.
528
+ - Do not use checkboxes for boolean values in the main settings list.
529
+
530
+ ### Text Values
531
+
532
+ Rules:
533
+
534
+ - Display mapped labels when available.
535
+ - Otherwise display the sanitized raw value.
536
+ - Clip with an ellipsis if too long.
537
+
538
+ ### Number Values
539
+
540
+ Rules:
541
+
542
+ - Display as compact text.
543
+ - Right-align in the value column.
544
+ - Do not add units unless the setting label or value label requires it.
545
+
546
+ ### Path-Like Values
547
+
548
+ Use tail-preserving truncation.
549
+
550
+ Example:
551
+
552
+ ```text
553
+ …/folder/final-name.ext
554
+ ```
555
+
556
+ Rules:
557
+
558
+ - If the value fits, show it unchanged.
559
+ - If too long, show `…` plus the end of the value.
560
+ - Preserve the most specific final segment.
561
+
562
+ ### Slider Values
563
+
564
+ Slider pattern:
565
+
566
+ ```text
567
+ [████░░░░] 0.45
568
+ ```
569
+
570
+ Rules:
571
+
572
+ - Use `█` for filled segments.
573
+ - Use `░` for empty segments.
574
+ - Enclose the bar in square brackets.
575
+ - Color the bar with `accent`.
576
+ - Show the numeric value after one space.
577
+ - Slider bar width is between 3 and 10 cells.
578
+ - If space is too narrow, show only the numeric value.
579
+
580
+ ## Footer
581
+
582
+ The footer is a single full-width interior line above the bottom border.
583
+
584
+ ### Normal Footer
585
+
586
+ Pattern:
587
+
588
+ ```text
589
+ 1/6 • Selected setting description
590
+ ```
591
+
592
+ ### Footer With Status
593
+
594
+ Pattern:
595
+
596
+ ```text
597
+ Saving setting… • 1/6 • Selected setting description
598
+ ```
599
+
600
+ ### Footer With Search
601
+
602
+ Pattern:
603
+
604
+ ```text
605
+ Search: query • 1/4 • Selected setting description
606
+ ```
607
+
608
+ If search is active but empty:
609
+
610
+ ```text
611
+ Search: type to filter all settings • 1/6 • Selected setting description
612
+ ```
613
+
614
+ Rules:
615
+
616
+ - Use ` • ` between footer segments.
617
+ - Status text takes priority over search text.
618
+ - Use selected setting description when a setting is selected.
619
+ - Use selected category/group description when no setting is selected.
620
+ - Clip and pad the full footer line to available width.
621
+
622
+ ## Editing State Footer
623
+
624
+ For capture-style inputs, use a footer pattern like:
625
+
626
+ ```text
627
+ 1/6 • Press desired key or key combination • Enter save • Esc cancel
628
+ ```
629
+
630
+ After a value is captured:
631
+
632
+ ```text
633
+ 1/6 • Captured <value> • Enter save • Esc cancel
634
+ ```
635
+
636
+ Rules:
637
+
638
+ - Keep the same footer line position.
639
+ - Do not open a separate dialog for simple capture states.
640
+ - The selected row should remain visible.
641
+
642
+ ## Search Behavior Visuals
643
+
644
+ Search changes scope but not the visual structure.
645
+
646
+ Rules:
647
+
648
+ - Activating search moves focus to settings.
649
+ - The title scope becomes `Search` only after a query exists.
650
+ - The section header becomes `SEARCH <QUERY>`.
651
+ - Result labels include their category/group in parentheses.
652
+ - Empty results use the warning no-match row.
653
+ - Clearing search returns to normal category/settings scope.
654
+
655
+ ## Focus Behavior Visuals
656
+
657
+ Rules:
658
+
659
+ - Only one pane is focused at a time.
660
+ - Focus is shown through selected-row color and boldness.
661
+ - The inactive pane may still show its selected row, but muted.
662
+ - Focus must be understandable without relying only on cursor position.
663
+
664
+ Recommended initial state:
665
+
666
+ - Category pane focused.
667
+ - First category selected.
668
+ - First setting in each category remembered independently.
669
+
670
+ ## Selector Dialog Style
671
+
672
+ Use this style for nested selection lists or submenus.
673
+
674
+ Structure:
675
+
676
+ ```text
677
+ ╭────────────────────────────────────────────────────────╮
678
+ │ Select value │
679
+ │ Helper text explaining markers │
680
+ │ ▶ Option label │
681
+ │ Option label │
682
+ │ ↑↓ navigate • type to search • enter select • esc back │
683
+ ╰────────────────────────────────────────────────────────╯
684
+ ```
685
+
686
+ Rules:
687
+
688
+ - Use the same `accent` border style.
689
+ - Title is `accent` + bold.
690
+ - Helper text is `dim`.
691
+ - Selected option uses `accent`.
692
+ - Descriptions use `muted`.
693
+ - Scroll information uses `dim`.
694
+ - No-match text uses `warning`.
695
+ - Selector height should be capped at 16 visible options.
696
+
697
+ Optional availability markers:
698
+
699
+ ```text
700
+ ✓ Available option
701
+ ○ Missing option
702
+ ```
703
+
704
+ Rules:
705
+
706
+ - Use `✓` for available/found/installed items.
707
+ - Use `○` for missing/unavailable/not installed items.
708
+ - Do not use these markers in the main settings list unless the row value itself requires it.
709
+
710
+ ## Text Safety Rules
711
+
712
+ Every renderer must follow these rules:
713
+
714
+ - No line may exceed the terminal width.
715
+ - Use ANSI-aware width calculations.
716
+ - Clip long content safely.
717
+ - Pad after clipping, not before.
718
+ - Sanitize terminal control sequences from all external text.
719
+ - Reapply styles per line.
720
+ - Do not rely on styling carrying across lines.
721
+
722
+ ## Content Independence Rules
723
+
724
+ This design template controls appearance only.
725
+
726
+ Allowed to customize:
727
+
728
+ - Product title.
729
+ - Scope label.
730
+ - Category labels.
731
+ - Category descriptions.
732
+ - Setting labels.
733
+ - Setting descriptions.
734
+ - Setting values.
735
+ - Value labels.
736
+ - Empty labels.
737
+ - Search source.
738
+ - Save behavior.
739
+
740
+ Must remain consistent to preserve the design:
741
+
742
+ - Border characters.
743
+ - Breakpoints.
744
+ - Pane width formulas.
745
+ - Selection marker `▶ `.
746
+ - Footer separator ` • `.
747
+ - Right-aligned value column.
748
+ - Color role mapping.
749
+ - Focus styling.
750
+ - Maximum visible setting rows.
751
+ - Tiny fallback layout.
752
+ - Selector dialog visual style.
753
+
754
+ ## Acceptance Criteria
755
+
756
+ A configuration TUI follows this template when:
757
+
758
+ - Wide screens use the two-pane framed layout.
759
+ - Narrow screens use the one-pane framed layout.
760
+ - Tiny screens use the no-border four-line fallback.
761
+ - Category and setting selections use the same marker and focus colors.
762
+ - Values are right-aligned and styled by value type.
763
+ - Footer text uses the same segment structure.
764
+ - Search state preserves the same frame and row layout.
765
+ - Selector dialogs visually match the main TUI language.
766
+ - All rendered lines fit the terminal width.
767
+ - No product-specific content is required by the template.