okf-tui 1.0.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 (44) hide show
  1. checksums.yaml +7 -0
  2. data/.okf/decisions/index.md +12 -0
  3. data/.okf/decisions/invents-no-analysis.md +53 -0
  4. data/.okf/decisions/no-version-ceilings.md +69 -0
  5. data/.okf/decisions/okf-capability-drift.md +120 -0
  6. data/.okf/decisions/one-door-the-plugin-seam.md +131 -0
  7. data/.okf/decisions/registry-write-boundary.md +175 -0
  8. data/.okf/decisions/ruby-floor.md +59 -0
  9. data/.okf/decisions/search-facade-coupling.md +146 -0
  10. data/.okf/decisions/undeclared-width-dependency.md +73 -0
  11. data/.okf/index.md +28 -0
  12. data/.okf/interaction/cross-bundle-scope.md +61 -0
  13. data/.okf/interaction/deferred-search.md +49 -0
  14. data/.okf/interaction/esc-peels-one-layer.md +70 -0
  15. data/.okf/interaction/filter-escalates-to-search.md +57 -0
  16. data/.okf/interaction/following-links.md +82 -0
  17. data/.okf/interaction/index.md +12 -0
  18. data/.okf/interaction/key-routing.md +84 -0
  19. data/.okf/interaction/which-registry.md +85 -0
  20. data/.okf/log.md +38 -0
  21. data/.okf/rendering/ansi-aware-width.md +74 -0
  22. data/.okf/rendering/index.md +8 -0
  23. data/.okf/rendering/markdown-rendering-trap.md +63 -0
  24. data/.okf/rendering/status-vocabulary.md +45 -0
  25. data/.okf/rendering/whole-frame-painting.md +52 -0
  26. data/.okf/testing/ci-matrix.md +80 -0
  27. data/.okf/testing/headless-frames.md +74 -0
  28. data/.okf/testing/index.md +8 -0
  29. data/.okf/testing/pty-test.md +73 -0
  30. data/CHANGELOG.md +239 -0
  31. data/LICENSE.txt +201 -0
  32. data/NOTICE +10 -0
  33. data/README.md +194 -0
  34. data/lib/okf/plugin.rb +63 -0
  35. data/lib/okf/tui/app.rb +1908 -0
  36. data/lib/okf/tui/cli.rb +154 -0
  37. data/lib/okf/tui/model.rb +410 -0
  38. data/lib/okf/tui/refs.rb +63 -0
  39. data/lib/okf/tui/ui.rb +308 -0
  40. data/lib/okf/tui/version.rb +7 -0
  41. data/lib/okf/tui/views.rb +1648 -0
  42. data/lib/okf/tui/workspace.rb +527 -0
  43. data/lib/okf/tui.rb +76 -0
  44. metadata +229 -0
data/lib/okf/plugin.rb ADDED
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The extension point okf discovers: `okf/plugin.rb` anywhere on the load path.
4
+ # Installing this gem is the whole installation — `okf tui` works with no
5
+ # configuration, and `okf help` lists it. This gem ships no executable, so this
6
+ # file is the entry point rather than a second way in.
7
+ #
8
+ # okf loads this file, not the library. Everything expensive stays behind #call:
9
+ # the TTY toolkit, kramdown and rouge are a real cost to pay at boot, and this
10
+ # file is read whenever a verb misses or `okf help` runs. Registering a class
11
+ # costs nothing; building a terminal UI does.
12
+
13
+ require "okf/cli"
14
+
15
+ # An okf old enough to lack the command registry also lacks the discovery that
16
+ # would load this file, so in practice this is unreachable — it exists so that a
17
+ # hand-written `require "okf/plugin"` against one says what is wrong instead of
18
+ # raising NameError on a constant nobody was looking for. Raised rather than
19
+ # skipped: a plugin that silently declines to register is the failure mode this
20
+ # whole seam is meant to make impossible.
21
+ unless defined?(OKF::CLI::Command)
22
+ raise LoadError, "okf-tui needs an okf with the CLI command registry (OKF::CLI::Command); this okf has none"
23
+ end
24
+
25
+ module OKF
26
+ class CLI
27
+ # `okf tui` — this gem's entry point, and its only one.
28
+ #
29
+ # The gem has to be separate: six TTY gems plus kramdown and rouge is a
30
+ # dependency set the kernel's deliberate three has no business growing into.
31
+ # None of that argues for a separate *entry point*, which is what this seam
32
+ # exists to avoid. There briefly was one — an `exe/okf-tui` that did nothing
33
+ # but call the same `CLI.run` — and it went before the first release, while
34
+ # removing a name still cost nobody anything. What the seam buys instead is
35
+ # discoverability: somebody who installed okf-tui finds it in `okf help`
36
+ # without having to know a second command exists.
37
+ class Tui < Command
38
+ def self.id
39
+ :tui
40
+ end
41
+
42
+ def self.help_rows
43
+ [ [ "tui [DIR|@slug…]", "browse bundles in a full-screen terminal UI" ] ]
44
+ end
45
+
46
+ # The heavy require lives here so that listing the verb stays cheap.
47
+ #
48
+ # `input` is why Command carries a terminal at all: every other verb is a
49
+ # one-shot read that never looks at stdin, and this one cannot work
50
+ # without it. Taking it from the command rather than reaching for $stdin
51
+ # keeps the whole surface inside okf's stream injection — which is what
52
+ # lets "it refuses to run without a terminal" be a test rather than a
53
+ # hope.
54
+ def call(argv)
55
+ require "okf/tui/cli"
56
+
57
+ ::OKF::TUI::CLI.run(argv, out: @out, err: @err, input: input)
58
+ end
59
+ end
60
+
61
+ register(Tui)
62
+ end
63
+ end