Skip to content

Commit 2b04fac

Browse files
committed
fix: run the TUI on the host's runtime, so an npm install renders and reacts
Installed from an npm spec the plugin lives under node_modules, where the host's JSX transform does not run and bare `solid-js`/`@opentui/*` imports resolve to the plugin's own copies: a second reactive graph whose signals never reach the host renderer, so the settings page and the footer painted their first frame and never updated (upstream anomalyco/opencode#33884). The views are now JSX-free and take every runtime singleton from `tui/host-runtime.ts`, which imports them by virtual module id; `solid-js`, `@opentui/core` and `@opentui/solid` stop being installable dependencies (dev dependencies plus optional peers) so npm cannot nest shadow copies, and `test/package-deps.test.ts` enforces both rules. Alongside: the settings page and the dialog menu name the plugin version, a load that hangs degrades with a timeout and renders its error instead of an endless "Loading…", and escape returns to the session the page was opened from — the host hands back a live route object, so the origin is snapshotted.
1 parent ea5d416 commit 2b04fac

21 files changed

Lines changed: 1378 additions & 486 deletions

‎CHANGELOG.md‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ All notable changes to this project are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.5] - 2026-10-20
9+
10+
### Changed
11+
- **The TUI consumes the host's runtime instead of installing its own.** The
12+
terminal code imports the host singletons by virtual module id
13+
(`opentui:runtime-module:…`) and uses no JSX, and `solid-js`, `@opentui/core`
14+
and `@opentui/solid` are no longer installable dependencies (they remain dev
15+
dependencies and optional peers). A plugin installed from an npm spec used to
16+
load its own copies from `node_modules`, and the host never bridged the Solid
17+
runtime: the settings page and the footer indicator painted once and never
18+
updated — upstream
19+
[anomalyco/opencode#33884](https://github.com/anomalyco/opencode/issues/33884).
20+
21+
### Added
22+
- The settings page and the dialog menu show the plugin version, so a report
23+
about either names the build it came from.
24+
25+
### Fixed
26+
- **Escape from the settings page returns to the session it was opened from**,
27+
instead of navigating to the home screen and losing the user's place.
28+
29+
### Documentation
30+
- The README's *Requirements* no longer says the plugin installs ~14 MB of
31+
SolidJS/OpenTUI runtime; it states that the host provides those modules and
32+
the TUI consumes them by virtual module id.
33+
- `THIRD_PARTY_NOTICES.md` moves `solid-js`, `@opentui/core` and
34+
`@opentui/solid` out of the distributed runtime dependencies: installing the
35+
package no longer brings copies of them.
36+
837
## [0.3.4] - 2026-10-19
938

1039
### Changed
@@ -397,7 +426,8 @@ First public release.
397426
- Cross-platform installer (`install.mjs`, plus `install.sh` / `install.ps1`
398427
wrappers).
399428

400-
[Unreleased]: https://github.com/Javierkaiser/opencode-indexing/compare/v0.3.4...HEAD
429+
[Unreleased]: https://github.com/Javierkaiser/opencode-indexing/compare/v0.3.5...HEAD
430+
[0.3.5]: https://github.com/Javierkaiser/opencode-indexing/releases/tag/v0.3.5
401431
[0.3.4]: https://github.com/Javierkaiser/opencode-indexing/releases/tag/v0.3.4
402432
[0.3.3]: https://github.com/Javierkaiser/opencode-indexing/releases/tag/v0.3.3
403433
[0.3.2]: https://github.com/Javierkaiser/opencode-indexing/releases/tag/v0.3.2

‎README.md‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Opens a full settings page: current configuration, detected Kilo sources, and th
208208
| `enter` | Run the selected action |
209209
| `e` | Edit settings (opens the dialog editor) |
210210
| `r` | Reload status |
211-
| `esc` | Close the page |
211+
| `esc` | Close the page, returning to the session it was opened from |
212212

213213
### Prompt-footer indicator
214214

@@ -241,7 +241,8 @@ Settings are edited in a dialog-based flow, reachable three ways:
241241

242242
- Press `e` from the `/indexing` page.
243243
- The command **Indexing: settings (dialogs)** in the command palette (a manual escape hatch if the page ever fails to render).
244-
- Automatically: if the host has no JSX runtime, `/indexing` opens this flow instead of the page.
244+
- Automatically: if the host cannot resolve the TUI runtime modules the page
245+
needs, `/indexing` opens this flow instead of the page.
245246

246247
`indexing_config` (the tool) reports the same configuration as `/indexing-config` and works in every client, because tools run server-side, and `indexing_config_set` changes a value the same way. Together they are the whole configuration surface for clients that do not dispatch slash commands.
247248

@@ -419,14 +420,20 @@ Word about data safety: Kilo's indexes (`ws-*` collections and its LanceDB direc
419420
## Requirements
420421

421422
- OpenCode v2 (plugin API `@opencode/[email protected]`).
422-
- **For the prompt-footer indicator:** `solid-js`, `@opentui/core` and
423-
`@opentui/solid`, which the plugin installs itself (~14 MB). They used to be
424-
declared as optional *peer* dependencies, on the assumption that the host
425-
already had them; OpenCode 2.0.30 stopped providing them and the indicator
426-
silently stopped rendering. Everything else works without them — the settings
427-
page degrades to dialogs and the footer is simply absent.
423+
- **For the terminal UI (prompt-footer indicator and `/indexing` page):** the
424+
`solid-js`, `@opentui/core` and `@opentui/solid` runtime that the host
425+
provides. The plugin installs no copy of them: the TUI imports the host's
426+
singletons through virtual module ids (`opentui:runtime-module:…`) and uses
427+
no JSX, so both sides share one reactive runtime. That is the fix for a
428+
plugin loaded from an npm spec, where local copies shadowed the host's and
429+
the Solid runtime was never bridged — the settings page and the footer
430+
indicator painted once and never updated (upstream
431+
[anomalyco/opencode#33884](https://github.com/anomalyco/opencode/issues/33884)).
432+
The three remain declared as dev dependencies and optional peers, never as
433+
installable dependencies. Without the host runtime the settings page degrades
434+
to dialogs and the footer is simply absent.
428435
- **For the own index: nothing to run.** The default store is embedded LanceDB
429-
(`@lancedb/lancedb@0.26.2`), so there is no server to start, no port to free and
436+
(`@lancedb/lancedb`), so there is no server to start, no port to free and
430437
no container to keep alive.
431438
- **A Qdrant server is only needed if you ask for it**, either by setting
432439
`vectorStore=qdrant` or because a Kilo index you want to import lives in Qdrant.
@@ -573,7 +580,7 @@ node test/cli.ts build --vector-store lancedb --root .
573580

574581
## Acknowledgements
575582

576-
This plugin interoperates with the open-source [Kilo Code](https://github.com/Kilo-Org/kilocode) indexing format (MIT License, Copyright (c) 2026 Kilo Code). The line-based chunker and the tree-sitter queries are ports of Kilo Code's implementation. It also builds on [opencode](https://github.com/anomalyco/opencode) (MIT), [LanceDB](https://github.com/lancedb/lancedb) (Apache-2.0), [Apache Arrow](https://github.com/apache/arrow) (Apache-2.0), [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) (MIT), [tree-sitter-wasms](https://github.com/Gregoor/tree-sitter-wasms) (Unlicense), [ignore](https://github.com/kaelzhang/node-ignore) (MIT), and — for the terminal UI — [SolidJS](https://github.com/solidjs/solid) (MIT) and [OpenTUI](https://github.com/sst/opentui) (MIT).
583+
This plugin interoperates with the open-source [Kilo Code](https://github.com/Kilo-Org/kilocode) indexing format (MIT License, Copyright (c) 2026 Kilo Code). The line-based chunker and the tree-sitter queries are ports of Kilo Code's implementation. It also builds on [opencode](https://github.com/anomalyco/opencode) (MIT), [LanceDB](https://github.com/lancedb/lancedb) (Apache-2.0), [Apache Arrow](https://github.com/apache/arrow) (Apache-2.0), [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) (MIT), [tree-sitter-wasms](https://github.com/Gregoor/tree-sitter-wasms) (Unlicense), [ignore](https://github.com/kaelzhang/node-ignore) (MIT), and — for the terminal UI, whose runtime the host provides — [SolidJS](https://github.com/solidjs/solid) (MIT) and [OpenTUI](https://github.com/sst/opentui) (MIT).
577584

578585
The companion code graph is [CodeGraph](https://github.com/colbymchenry/codegraph) (MIT), a separate project this one installs and drives rather than bundles. Its npm package is `@colbymchenry/codegraph`; the unscoped `codegraph` on npm is a different, unrelated project.
579586

‎THIRD_PARTY_NOTICES.md‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,25 @@ SOFTWARE.
6060
| [`web-tree-sitter`](https://github.com/tree-sitter/tree-sitter) | MIT | Tree-sitter contributors |
6161
| [`tree-sitter-wasms`](https://github.com/Gregoor/tree-sitter-wasms) | Unlicense | Gregor (packaging); grammars by their respective authors |
6262
| [`ignore`](https://github.com/kaelzhang/node-ignore) | MIT | Kael Zhang and contributors |
63-
| [`solid-js`](https://github.com/solidjs/solid) | MIT | Ryan Carniato and contributors |
64-
| [`@opentui/core`](https://github.com/sst/opentui) | MIT | SST and OpenTUI contributors |
65-
| [`@opentui/solid`](https://github.com/sst/opentui) | MIT | SST and OpenTUI contributors |
66-
67-
`solid-js`, `@opentui/core` and `@opentui/solid` are what the terminal UI is
68-
rendered with. They are optional dependencies: without them the prompt-footer
69-
indicator and the settings page are absent, and everything else works.
7063

7164
Tree-sitter grammar `.wasm` files bundled by `tree-sitter-wasms` are distributed
7265
under their upstream licenses (mostly MIT or Apache-2.0); see the
7366
`tree-sitter-wasms` package for details.
7467

68+
## Provided by the host
69+
70+
| Package | License | Copyright |
71+
| --- | --- | --- |
72+
| [`solid-js`](https://github.com/solidjs/solid) | MIT | Ryan Carniato and contributors |
73+
| [`@opentui/core`](https://github.com/sst/opentui) | MIT | SST and OpenTUI contributors |
74+
| [`@opentui/solid`](https://github.com/sst/opentui) | MIT | SST and OpenTUI contributors |
75+
76+
These are what the terminal UI is rendered with. They are **not distributed**
77+
with this package: the host provides them at runtime and the TUI imports the
78+
host's own instances by virtual module id (`opentui:runtime-module:…`) instead
79+
of installing copies. Without them the prompt-footer indicator and the settings
80+
page are absent, and everything else works.
81+
7582
## CodeGraph (github.com/colbymchenry/codegraph)
7683

7784
Not bundled and not required. CodeGraph is a separate program that this plugin

‎index.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { createOwnStore, createSettingsQdrant } from "./src/store-factory.ts"
2323
import { createEmbedder } from "./src/embedder.ts"
2424
import { getOwnStoreInfo, OWN_COLLECTION_PREFIX, type OwnStoreInfo } from "./src/own-store.ts"
2525
import { forgetWorkspace, readWorkspaces } from "./src/workspaces.ts"
26+
import { pluginVersion } from "./src/plugin-version.ts"
2627
import { IndexingRpc } from "./src/rpc.ts"
2728
import {
2829
COMMAND_USAGE,
@@ -723,15 +724,17 @@ class ForgetRefusedError extends Error {}
723724
await ctx.rpc.register(IndexingRpc, {
724725
"settings.get": async () => {
725726
const settings = await getSettings()
726-
return { settings: settingsView(settings) }
727+
// `version` travels with the settings so a client can show which
728+
// release it is talking to without a second round trip.
729+
return { settings: settingsView(settings), version: pluginVersion() }
727730
},
728731

729732
"settings.set": async (input: unknown) => {
730733
const { writeSettingsFile } = await import("./src/settings.ts")
731734
const patch = (input as { patch?: Record<string, unknown> }).patch ?? {}
732735
writeSettingsFile(patch as never)
733736
const settings = await getSettings()
734-
return { settings: settingsView(settings) }
737+
return { settings: settingsView(settings), version: pluginVersion() }
735738
},
736739

737740
"settings.test": async (input: unknown) => {

‎install.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ function installLocal() {
258258
return
259259
}
260260

261-
log(" installing runtime deps (ignore + optional lancedb/tree-sitter)...")
261+
log(" installing runtime deps (ignore + optional lancedb/tree-sitter/apache-arrow)...")
262262
const npm = isWindows ? "npm.cmd" : "npm"
263-
// --omit=peer is why apache-arrow has to be a real dependency above: the
264-
// native LanceDB binary loads without it and throws on first use.
263+
// --omit=peer drops peer dependencies, and apache-arrow is a peer of
264+
// @lancedb/lancedb: it is declared explicitly above so the native binary
265+
// does not load and then throw on first use.
265266
const result = spawnSync(
266267
npm,
267268
["install", "--omit=dev", "--omit=peer", "--no-audit", "--no-fund", "--loglevel=error"],

0 commit comments

Comments
 (0)