omnius 1.0.861 → 1.0.863

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 (38) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/library.js +120 -96
  3. package/dist/tui/native/worker.js +3031 -97
  4. package/docs/DISCOVERY.json +1156 -112
  5. package/docs/DISCOVERY.md +32 -2
  6. package/docs/work-orders/evidence/instrument-100x30.png +0 -0
  7. package/docs/work-orders/evidence/instrument-120x36.png +0 -0
  8. package/docs/work-orders/evidence/instrument-160x48.png +0 -0
  9. package/docs/work-orders/evidence/instrument-60x20.png +0 -0
  10. package/docs/work-orders/evidence/instrument-80x24.png +0 -0
  11. package/docs/work-orders/evidence/instrument-collapse-120x36.png +0 -0
  12. package/docs/work-orders/evidence/instrument-help-scroll-120x36.png +0 -0
  13. package/docs/work-orders/evidence/instrument-package-artifact-20261016.json +18 -0
  14. package/docs/work-orders/evidence/instrument-package-install-20261016.json +69 -0
  15. package/docs/work-orders/evidence/instrument-popup-api-120x36.png +0 -0
  16. package/docs/work-orders/evidence/instrument-popup-api-input-120x36.png +0 -0
  17. package/docs/work-orders/evidence/instrument-popup-config-120x36.png +0 -0
  18. package/docs/work-orders/evidence/instrument-popup-dark-120x36.png +0 -0
  19. package/docs/work-orders/evidence/instrument-popup-dark-60x20.png +0 -0
  20. package/docs/work-orders/evidence/instrument-popup-light-120x36.png +0 -0
  21. package/docs/work-orders/evidence/instrument-popup-model-120x36.png +0 -0
  22. package/docs/work-orders/evidence/instrument-popup-network-120x36.png +0 -0
  23. package/docs/work-orders/evidence/instrument-production-terminal-live.json +6228 -0
  24. package/docs/work-orders/evidence/instrument-semantic-components-20261016.json +76 -0
  25. package/docs/work-orders/evidence/instrument-targeted-verification-20261016.json +408 -0
  26. package/docs/work-orders/evidence/instrument-terminal-light-120x36.png +0 -0
  27. package/docs/work-orders/evidence/native-tui-committed-scope-20261015.json +67 -0
  28. package/docs/work-orders/evidence/native-tui-local-inference-repair-20261015.json +144 -0
  29. package/docs/work-orders/evidence/native-tui-package-artifact-20261015.json +24 -0
  30. package/docs/work-orders/evidence/native-tui-package-install-20261015.json +95 -0
  31. package/docs/work-orders/evidence/native-tui-production-terminal-20261015.json +1255 -0
  32. package/docs/work-orders/evidence/native-tui-semantic-components-20261015.json +72 -0
  33. package/docs/work-orders/evidence/native-tui-targeted-verification-20261015.json +95 -0
  34. package/docs/work-orders/instrument-command-surface-audit.md +237 -0
  35. package/docs/work-orders/instrument-tui.md +108 -0
  36. package/docs/work-orders/native-tui-renderer.md +112 -90
  37. package/npm-shrinkwrap.json +6 -6
  38. package/package.json +1 -1
@@ -1,93 +1,115 @@
1
- # Native terminal rendering migration
2
-
3
- Omnius now uses `@opentui/core@0.6.6`, the native terminal engine used by
4
- OpenCode. The agent/CLI remains on Node >=22; a packaged Bun 1.3.14 process
5
- owns OpenTUI and the physical terminal. This avoids loading Bun/Node-26 FFI in
6
- the existing Node backend or changing its native SQLite and supervisor runtime.
7
-
8
- The original Earth palette, default terminal transparency, header, tool cards,
9
- tasks area, expandable input, metrics, agent views, and session representations
10
- remain the component contract. This migration uses OpenTUI's imperative
11
- renderables, rather than copying OpenCode's application or Solid component tree.
12
-
13
- ## Rendering and ownership
14
-
15
- - `native/screen.ts` composes existing formatted components into a bounded
16
- retained cell surface. ANSI styling and geometry become native styled rows;
17
- physical cursor/scroll-region/screen paint controls are consumed locally.
18
- - `native/host.ts` coalesces changes at 16 ms, sends changed rows, and permits
19
- one unacknowledged frame. Updates during terminal backpressure replace state
20
- instead of growing an output queue.
21
- - `native/worker.ts` renders native `TextRenderable` rows and acknowledges after
22
- native output settles. Only allowlisted title, clipboard, and input-mode
23
- effects pass to the terminal. Default/indexed color intents are preserved.
24
- - The parent acquires raw input before native capability queries. Protocol
25
- replies reach OpenTUI, while keyboard/mouse/paste reach the editor and menus.
26
- Modal listeners use the same filtered stream and restore prior listeners.
27
- - Inherited commands await native suspension. Resume forces a complete retained
28
- frame. Stop/update/exit close the worker; failure restores terminal modes and
29
- triggers the client's existing session-preserving shutdown.
30
-
31
- ## History cost
32
-
33
- The old renderer rebuilt its prefix row index during streamed updates and
34
- cleared the entire wrap cache above 8,000 entries. The replacement uses an
35
- incremental Fenwick index, bounded LRU wrapping, shared dynamic-block snapshots,
36
- linear ANSI-aware wrapping, and viewport-only result allocation. Wheel bursts
37
- coalesce on local terminals as well as remote ones. End with an empty prompt
38
- returns to live. Queue hints occupy their own row above the input box.
39
-
40
- The recorded CPU benchmark compares commit
41
- `e54e7942700cf575f00b2142626168ed8c929f69` with this implementation, using 9,900
42
- unique styled lines and 120 append/reflow frames crossing the 10,000-line limit:
43
-
44
- | Measurement | Before | After |
45
- | --- | ---: | ---: |
46
- | Streamed append/reflow median | 43.93 ms | 0.023 ms |
47
- | Streamed append/reflow p95 | 48.19 ms | 0.112 ms |
48
- | Static history count/wrap calls during those frames | 1,196,840 | 120 |
49
- | Initial row-index construction | 72.44 ms | 83.77 ms |
50
-
51
- These are shared-host CPU history/layout measurements, excluding native paint,
52
- IPC, input latency, and inference. Initial index construction is not faster.
53
-
54
- ## Validation evidence
55
-
56
- - [CPU benchmark](evidence/native-tui-history-benchmark-20261015.json)
57
- - [Real PTY and independent xterm screen checks](evidence/native-tui-pty-live-20261015.json)
58
- - [GPU placement preflight](evidence/native-tui-gpu-preflight-20261015.json)
59
- - [Live model streaming in the PTY](evidence/native-tui-model-live-20261015.json)
60
- - [Clean tarball runtime smoke](evidence/native-tui-package-smoke-20261015.json)
61
-
62
- All 264 targeted regression tests across 28 files passed, as did a clean
63
- workspace rebuild, publish bundling/artifact audit, and tarball content checks.
64
- An isolated tarball installation launched the Node CLI, opened SQLite, and
65
- painted/restored a real PTY using the packaged Bun/OpenTUI worker. Package install
66
- scripts were disabled; only Bun and SQLite were rebuilt for the smoke test.
67
-
68
- The terminal suite exercises 20,000 history lines, tool clicks, 200-event wheel
69
- bursts, multiline editing, menus, streaming, Escape, narrow/wide resizing,
70
- exclusive subprocess handoff, terminal restoration, and native-worker cleanup.
71
- The synthetic test sent zero inference requests. The optional live run streamed
72
- 868 response chunks from `robit/qwen3.8-27b-obliterated-e03:27b` while scrolling
73
- and typing, through the same `StreamRenderer`, `StatusBar`, and native renderer.
74
-
75
- For that live run, a broker lease reserved GPU 0
76
- (`GPU-3538758b-6ba7-fa1b-a80c-e315a606c3f0`, A100 80 GB). A dedicated pinned
77
- Ollama 0.34.4 server at `127.0.0.1:11572` exposed only that UUID. A zero-token
78
- load preceded actual `nvidia-smi` runner placement verification and the
79
- generation request. The test server/model was stopped, the lease released, and
80
- the operator inference hold restored. The recorded endpoint is no longer live.
1
+ # Native OpenTUI terminal frontend
2
+
3
+ Every interactive terminal surface uses `@opentui/core@0.6.6`. Node owns the
4
+ agent and services; a packaged Bun 1.3.14 process owns OpenTUI, raw terminal
5
+ input, focus, layout, scrolling, selection and painting. The October 16
6
+ [instrument interface](instrument-tui.md) replaces the former Earth palette with
7
+ terminal defaults and introduces lightweight geometry and collapsible telemetry.
8
+ Header actions, agent tabs, history, pinned tasks, expandable input, enhancement
9
+ controls and metrics retain their functional structure.
10
+ The implementation uses OpenTUI's [imperative native renderables](https://github.com/anomalyco/opentui/tree/main/packages/core).
11
+
12
+ ## Component contract
13
+
14
+ `native/protocol.ts` carries semantic documents and actions. The host sends
15
+ stable-ID content patches, coalesces updates and permits one unacknowledged
16
+ frame. Missing acknowledgements fail visibly and restore terminal ownership.
17
+ Keyboard, paste, pointer and capability bytes go directly to OpenTUI. The Node
18
+ input facade receives editor changes, submissions and backend shortcuts.
19
+
20
+ The worker builds native Box, Text, Markdown, Code, ScrollBox, Textarea,
21
+ Select, TabSelect, Image and EmbeddedTerminal renderables. Menus, nested
22
+ prompts, secret input, onboarding, memory maps, camera controls, progress,
23
+ agent command center and Neovim share this component tree and focus model.
24
+ External interactive programs use an explicit suspended terminal handoff.
25
+ Machine-readable and piped output remain plain streams.
26
+
27
+ There is no terminal-cell screen compositor, physical cursor painter, manual
28
+ wrapped-row index, mouse escape parser or second raw keyboard parser in the
29
+ application. Semantic text preserves attributes and links while following the
30
+ operator's terminal colors; cursor/screen controls are discarded. Persisted tool data and live inference,
31
+ shell, trajectory, action-tree, media and sub-agent data become native cards.
32
+ Session restoration preserves semantic documents and old stored transcripts.
33
+
34
+ ## October 15 verification
35
+
36
+ - `pnpm --filter omnius exec vitest run tests/native-components.test.ts` runs
37
+ actual OpenTUI under packaged Bun, including long-history scrolling and
38
+ concurrent editing, Unicode paste, independent stack/tree scroll positions,
39
+ native menus, secret masking, cards, themes, media controls, image fallback,
40
+ footer actions, and an embedded terminal.
41
+ - `node scripts/benchmark-tui-history.mjs --output FILE` records those native
42
+ scenario timings. They include native layout/render/input work; they are
43
+ not a claim about per-keystroke latency or a speedup over the old renderer.
44
+ - `node scripts/test-tui-production-terminal.mjs --report FILE --transcript FILE`
45
+ launches the actual CLI in a real PTY, observes the screen independently,
46
+ uses isolated settings/data, permits local metadata and blocks all inference.
47
+ Add `--entry /path/to/installed/omnius/dist/index.js` to test a clean tarball
48
+ installation using observation of the actual worker IPC.
49
+ - `node scripts/test-tui-production-local.mjs --preflight FILE` validates an
50
+ already-resident, verified GPU/model scope, then exercises the actual CLI's
51
+ local answer, tool execution, streaming and Stop paths. Its transport observer
52
+ records request scope and test markers without replacing the backend.
53
+
54
+ Earlier `native-tui-*-20261015.json` evidence describes the previous row adapter
55
+ and a synthetic fixture. Those measurements are historical and do not validate
56
+ this complete semantic frontend. Current results are recorded separately.
57
+
58
+ The final targeted run passed 484 CLI tests across 63 files and 189 orchestrator
59
+ tests across five files, including the mandatory daemon web transport tests.
60
+ All 15 actual native component scenarios and six metadata-only production PTY
61
+ checks passed. A separate production CLI run passed eight checks with the real
62
+ local model: an answer, a file-read tool round trip, streaming with 200 wheel
63
+ events, continued editing, resize, Stop, editable recovery and clean shutdown.
64
+ Input painted in 26 ms during that streaming wheel burst. This is one observed
65
+ live measurement, not a general latency percentile.
66
+
67
+ Current receipts:
68
+
69
+ - [Targeted tests and broader-suite limits](evidence/native-tui-targeted-verification-20261015.json)
70
+ - [Actual native component scenarios](evidence/native-tui-semantic-components-20261015.json)
71
+ - [Production terminal checks](evidence/native-tui-production-terminal-20261015.json)
72
+ - [Verified GPU 0 and actual local-model CLI checks](evidence/native-tui-local-inference-repair-20261015.json)
73
+ - [Clean package artifact checks](evidence/native-tui-package-artifact-20261015.json)
74
+ - [Installed package terminal and runtime checks](evidence/native-tui-package-install-20261015.json)
75
+ - [Independent committed-source build and 484 tests](evidence/native-tui-committed-scope-20261015.json)
76
+
77
+ The broader CLI suite did not finish: its interrupted run observed 257 failures
78
+ in Telegram tests. Those failures were not all investigated or established as
79
+ pre-existing. A full-suite pass is not claimed.
80
+
81
+ ## Local inference repair
82
+
83
+ The broker's explicit operator hold caused local requests to fail and automatic
84
+ fallback to select a remote route. Omnius now retains a sanitized local failure
85
+ reason beside the effective route and clears it after local recovery. GPU
86
+ selection initializes consistently for interactive, single-task and daemon
87
+ entry points, and native Ollama requests retain the exact GPU allowlist.
88
+
89
+ API model routing preserves organization namespaces such as `robit/`; it strips
90
+ only known routing prefixes or resolves an advertised route. Global config,
91
+ settings, default database and terminal history honor `OMNIUS_CONFIG_HOME`.
92
+ CLI test setup assigns an isolated configuration home so tests cannot change
93
+ the operator's live routing settings.
94
+
95
+ The operator explicitly approved normal local inference on GPU 0. The supported
96
+ health-checked resume released the hold; actual server and runner placement were
97
+ verified on GPU 0 before generation. The hold remains released after successful
98
+ testing. Other GPU workloads and host device selections are preserved.
99
+ The live run made 12 local physical requests: 11 returned HTTP 200 and a repeated
100
+ helper rerank operation returned a nonfatal HTTP 409. All user-facing checks
101
+ passed. Tool-bearing requests were observed with `think: false` without a forced
102
+ environment override.
81
103
 
82
104
  ## Packaging
83
105
 
84
- The publish builder emits `dist/tui/native/worker.js` separately, keeps OpenTUI
85
- external, and carries exact OpenTUI/Bun/tree-sitter dependencies into the publish
86
- manifest. The artifact audit requires the native worker. The Bun executable and
87
- native platform library add installation size; a normal npm install provisions
88
- them automatically. No separate Bun installation is required.
89
-
90
- Reproduce terminal validation after building with
91
- `node scripts/test-tui-native-live.mjs --report /tmp/omnius-tui-live.json`.
92
- Use `node scripts/benchmark-tui-history.mjs --help` for CPU benchmark options.
93
- Real inference remains subject to the repository's exact GPU preflight gate.
106
+ The builder emits `dist/tui/native/worker.js` separately and keeps exact
107
+ OpenTUI/Bun runtime dependencies. It rebuilds every workspace package before
108
+ bundling. Clean builds remove deleted legacy renderer modules from distributable
109
+ outputs. Tests and tarball installation must disable unrelated postinstall
110
+ daemon/service startup while validating the native runtime assets.
111
+ The final tarball passed all six production terminal checks in a fresh isolated
112
+ installation. Node CLI help, a real SQLite round trip, packaged Bun/OpenTUI and
113
+ the separately bundled native worker were also verified. The tarball contains
114
+ the README and injected README metadata, with no tests, coverage, caches,
115
+ sourcemaps, build caches or deleted legacy renderer modules.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.861",
3
+ "version": "1.0.863",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.861",
9
+ "version": "1.0.863",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
@@ -2783,13 +2783,13 @@
2783
2783
  }
2784
2784
  },
2785
2785
  "node_modules/asn1js": {
2786
- "version": "3.0.10",
2787
- "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz",
2788
- "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==",
2786
+ "version": "3.1.0",
2787
+ "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.1.0.tgz",
2788
+ "integrity": "sha512-HWYi1THkOqguCiO+vwj09ZkQFD2kKEsejYHAYCtX0D80WVdoDnvRc9IukXX/jeb0T9NRWJnRtqwdbHltnFjwXA==",
2789
2789
  "license": "BSD-3-Clause",
2790
2790
  "dependencies": {
2791
2791
  "pvtsutils": "^1.3.6",
2792
- "pvutils": "^1.1.5",
2792
+ "pvutils": "^1.2.0",
2793
2793
  "tslib": "^2.8.1"
2794
2794
  },
2795
2795
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.861",
3
+ "version": "1.0.863",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/library.js",