opencode-generative-ui 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +70 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,7 +25,17 @@ Typical use cases:
25
25
  - mockups
26
26
  - calculators
27
27
 
28
- ## Install from npm in OpenCode
28
+ ## Install
29
+
30
+ ### From npm in OpenCode
31
+
32
+ OpenCode does not auto-discover this repo or install it just because it exists on GitHub.
33
+
34
+ For npm installation, all of the following must be true:
35
+
36
+ 1. This package has been published to npm
37
+ 2. The package name is listed in your OpenCode config
38
+ 3. OpenCode is restarted so it can install the plugin
29
39
 
30
40
  After publishing, add the package name to your OpenCode config:
31
41
 
@@ -36,11 +46,66 @@ After publishing, add the package name to your OpenCode config:
36
46
  }
37
47
  ```
38
48
 
39
- OpenCode will install the package with Bun on startup.
49
+ OpenCode installs npm plugins listed in `opencode.json` automatically with Bun on startup.
40
50
 
41
- ## Install locally in OpenCode
51
+ You do not need to run `npm install` or `bun install` inside the repo where you want to use the plugin. Just add the plugin name to your OpenCode config and restart OpenCode.
42
52
 
43
- Clone this repo, then copy the plugin entry file into your OpenCode plugin directory if you want to run it before publishing.
53
+ You can add it either:
54
+
55
+ 1. Globally in `~/.config/opencode/opencode.json`
56
+ 2. Per project in `opencode.json`
57
+
58
+ Example global config:
59
+
60
+ ```json
61
+ {
62
+ "$schema": "https://opencode.ai/config.json",
63
+ "plugin": ["opencode-generative-ui"]
64
+ }
65
+ ```
66
+
67
+ You can verify that OpenCode resolved the plugin with:
68
+
69
+ ```bash
70
+ opencode debug config
71
+ ```
72
+
73
+ If the package is installed correctly, you should see `opencode-generative-ui` in the resolved `plugin` list.
74
+
75
+ ### Runtime requirements
76
+
77
+ - macOS
78
+ - Bun
79
+ - OpenCode
80
+ - a working Swift/Xcode toolchain for `glimpseui`
81
+
82
+ This plugin opens widget windows through [Glimpse](https://github.com/hazat/glimpse), which builds a small native Swift binary during install.
83
+
84
+ If `glimpseui` fails to build, update your Xcode Command Line Tools or full Xcode install, then rerun:
85
+
86
+ ```bash
87
+ bun pm trust glimpseui
88
+ ```
89
+
90
+ Depending on how OpenCode installed the plugin, you may need to run that in the OpenCode cache/config directory rather than inside your app repo.
91
+
92
+ ### Local plugin development
93
+
94
+ If you are developing this plugin itself, install dependencies in this plugin repo:
95
+
96
+ ```bash
97
+ bun install
98
+ ```
99
+
100
+ If Bun blocks the native build:
101
+
102
+ ```bash
103
+ bun pm trust glimpseui
104
+ ```
105
+
106
+ ### Use from a local checkout before publishing
107
+
108
+ Clone this repo, then copy the plugin entry file into your OpenCode plugin directory if you want to run it before publishing to npm.
44
109
 
45
110
  For project-local use today:
46
111
 
@@ -53,7 +118,7 @@ For project-local use today:
53
118
 
54
119
  ## Development
55
120
 
56
- Install dependencies:
121
+ Install dependencies in this repo:
57
122
 
58
123
  ```bash
59
124
  bun install
@@ -71,19 +136,6 @@ Build publishable output:
71
136
  bun run build
72
137
  ```
73
138
 
74
- ## Runtime requirements
75
-
76
- - macOS
77
- - Bun
78
- - OpenCode
79
- - a working Swift/Xcode toolchain for `glimpseui`
80
-
81
- If `glimpseui` fails to build, update your Xcode Command Line Tools or full Xcode install, then rerun:
82
-
83
- ```bash
84
- bun pm trust glimpseui
85
- ```
86
-
87
139
  ## Current limitation
88
140
 
89
141
  This plugin does not yet reproduce pi's token-by-token widget streaming. Widgets render when the tool executes, not progressively during tool-argument streaming.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-generative-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "OpenCode plugin that renders HTML and SVG widgets in native macOS windows using Glimpse.",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",