opencode-webui 3.0.0 → 3.0.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.
package/README.md CHANGED
@@ -22,8 +22,8 @@ First boot prints the URL and a generated password — **shown once**:
22
22
  generated for this install — shown once
23
23
  set WEBUI_PASSWORD to choose your own
24
24
  sessions the same ones as your opencode TUI — same engine, same history
25
- extensions ~/.config/opencode/webui-extensions/<name>/main.tsx per-user
26
- <project>/.opencode/webui-extensions/<name>/main.tsx per-project
25
+ extensions ~/.config/opencode/webui-extensions/<name>/index.tsx per-user
26
+ <project>/.opencode/webui-extensions/<name>/index.tsx per-project
27
27
  skill agent skill synced to ~/.config/opencode/skills/webui/ — your agent knows this UI exists
28
28
  ```
29
29
 
@@ -159,8 +159,8 @@ One extension = one folder, dropped in — no rebuild, no restart:
159
159
 
160
160
  ```
161
161
  my-extension/
162
- manifest.json id, version, description, disabled?
163
- index.tsx browser stratum (wrap / replace / contribute / hook / service)
162
+ manifest.json id, version, description; optional disabled, settings, requires
163
+ index.tsx browser stratum: register() and/or activate(ctx)
164
164
  dom.ts DOM stratum (portals, canvas, post-render tweaks)
165
165
  server.ts proxy stratum (routes, middleware, event tap, pollers)
166
166
  engine/ opencode plugin payload (model tools, prompt hints)
@@ -170,9 +170,10 @@ Presence = installed, `disabled: true` = paused, delete = uninstalled; a
170
170
  higher-precedence folder with the same id shadows the shipped one, so user
171
171
  customizations survive core updates with no forks. Hot reload everywhere:
172
172
  browser edits repaint live via the manifest SSE push, proxy edits reload
173
- with no restart. The full authoring guide — the five kinds, hook catalog,
174
- DOM kit, `server.ts` mounts, precedence, and the timestamp worked example
175
- is [webui-extensions/README.md](webui-extensions/README.md).
173
+ with no restart. The full authoring guide — the five kinds, the activation
174
+ context, the event bus, declared settings + `requires`, slots, peer
175
+ composition, the DOM kit, `server.ts` mounts, precedence, and the timestamp
176
+ worked example — is [webui-extensions/README.md](webui-extensions/README.md).
176
177
 
177
178
  The built-in `/report` command files a prefilled GitHub issue with a diagnostics
178
179
  bundle (build version, enabled extensions, error ring); `--agent` hands it to the
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Web UI for the OpenCode coding agent — chat, streaming, tool cards, and extensions over the OpenCode engine's HTTP API.",
4
4
  "private": false,
5
5
  "type": "module",
6
- "version": "3.0.0",
6
+ "version": "3.0.1",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
@@ -25,7 +25,7 @@ optional (`auth: none`) for private networks/proxies, but reachable-without-a-
25
25
  password changes need explicit confirmation.
26
26
 
27
27
  - **Repo**: https://github.com/AbdelftahZowail/opencode-webui
28
- - **This skill's version**: 3.0.0 (matches the `v3.0.0` git tag —
28
+ - **This skill's version**: 3.0.1 (matches the `v3.0.1` git tag —
29
29
  the file links below are pinned to it, so they always describe the code
30
30
  this skill was generated with)
31
31
  - **A running instance exposes its version** at `GET /api/webui/config` →
@@ -38,15 +38,20 @@ fetch the exact file at the pinned tag instead of reading a local clone:
38
38
 
39
39
  | File | Purpose |
40
40
  | --- | --- |
41
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/webui-extensions/README.md | Full authoring guide — the source of truth for strata/kinds/hooks/anchors |
42
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/extensions/registry.tsx | The extension registry — exact register() shapes per kind |
43
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/extensions/slots.tsx | Slot ids (placement contract) + the Slot renderer |
44
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/extensions/manifest.ts | Manifest contract settings schema + requires parsing/checks |
45
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/extensions/hooks.ts | Shared fireHooks runner how open hook events fire |
46
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/lib/domKit.ts | DOM-stratum kit (foreign/watch/styles) + the data-oc-* anchor table |
47
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/server/ext/types.ts | Proxy-stratum types — server.ts routes/middleware/onEvent/pollers shapes |
48
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/docs/extension-system-spec.md | The v2 decision record strata, precedence, deletions, acceptance checks |
49
- | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.0/src/store.ts | The storeactions useStore exposes to extensions |
41
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/webui-extensions/README.md | Full authoring guide — the source of truth for strata/kinds/hooks/anchors |
42
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/extensions/registry.tsx | The extension registry — exact register() shapes per kind |
43
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/extensions/context.ts | Activation context — the `activate(ctx)` entry, disposal, and the full `ctx` surface |
44
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/extensions/slots.tsx | Slot ids (placement contract) + the Slot renderer |
45
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/extensions/manifest.ts | Manifest contractsettings schema + requires parsing/checks |
46
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/extensions/hooks.ts | Shared fireHooks runner how open hook events fire |
47
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/lib/domKit.ts | DOM-stratum kit (foreign/watch/styles) + the data-oc-* anchor table |
48
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/lib/storeFacade.ts | Curated store surface extensions get as `store` (raw module = `advanced.store`) |
49
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/lib/eventBus.ts | Event busraw engine events + derived lifecycle, frame-batched |
50
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/lib/extSettings.ts | Per-extension declared settings — schema, resolve, persist, subscribe |
51
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/lib/extBus.ts | Extension-to-extension peer bus (publish/subscribe) |
52
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/server/ext/types.ts | Proxy-stratum types — server.ts routes/middleware/onEvent/pollers shapes |
53
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/docs/extension-system-spec.md | The v2 decision record — strata, precedence, deletions, acceptance checks |
54
+ | https://raw.githubusercontent.com/AbdelftahZowail/opencode-webui/v3.0.1/src/store.ts | The raw store module (reachable as `advanced.store`; prefer the facade) |
50
55
 
51
56
  ## Environment
52
57
 
@@ -130,6 +135,25 @@ register({
130
135
  });
131
136
  ```
132
137
 
138
+ ### Activation context (browser stratum)
139
+
140
+ Prefer `export function activate(ctx)` over module-scope `register()` — the
141
+ context owns lifecycle + disposal. On it: `ctx.register(entry)` (the five
142
+ kinds); `ctx.poll({ name, minInterval, run })` and `ctx.after(ms, fn)` (the
143
+ shared tier-aware scheduler, auto-stopped); `ctx.on(name, fn)` (event bus —
144
+ a raw engine type or a derived name: `run.started`, `run.ended`,
145
+ `tool.called`, `tool.completed`, `message.appended`; `"*"` = all);
146
+ `ctx.subscribe(selector, fn)` (derived store read); `ctx.store` (curated
147
+ store facade — selectors + actions); `ctx.settings` (declared settings);
148
+ `ctx.collections` / `ctx.bus` (peer composition); `ctx.onDispose(fn)` or
149
+ returning a teardown. Everything a context creates is disposed on hot-swap,
150
+ `disabled`, and delete. Module-scope `register()` still works but is being
151
+ deprecated.
152
+
153
+ Manifest `settings` declares options core renders in Settings › Extensions;
154
+ `requires` (`api`/`targets`/`slots`/`services`) is checked on every
155
+ sync and an unmet reference is a visible warning, not a silent blank spot.
156
+
133
157
  ## Five kinds, one job each (the contract)
134
158
 
135
159
  | Kind | Job | Staleness |
@@ -62,7 +62,11 @@ extension code is not sandboxed (same model as host plugins).
62
62
  > browser loader + manifest SSE, proxy-stratum mounts, `dom.ts` loader wiring
63
63
  > + `data-oc-*` stamping, core self-registration, and the `ui-extensions/` →
64
64
  > `webui-extensions/` rename are landed (`docs/extension-system-spec.md` §11).
65
- > The contract below is what that work converged on — write to it.
65
+ > The **roadmap seams are landed too** (`docs/extension-roadmap.md` items 1–9,
66
+ > `EXT_API_VERSION` 2): prop-transforming wraps, the activation context +
67
+ > disposal, scheduler access, the event bus, the curated store facade,
68
+ > declared settings, thin slots, manifest `requires` diagnostics, and peer
69
+ > composition. The contract below is what that work converged on — write to it.
66
70
 
67
71
  ## Choosing a stratum (framing rule)
68
72
 
@@ -579,7 +583,8 @@ One folder becomes pixels through four files — follow them in order:
579
583
  3. **Manifest + SSE + bundling (proxy).** `server/index.ts` merges folder
580
584
  entries with engine-plugin UI halves, serves
581
585
  `GET /api/webui/extensions` (`{ id, url?v=mtime, domUrl?v=mtime,
582
- source, origin }`), pushes a `{ type: "webui.extensions", version }`
586
+ source, origin, name?, description?, disabled?, settings?, requires?,
587
+ capabilities? }`), pushes a `{ type: "webui.extensions", version }`
583
588
  event per manifest change on `GET /api/webui/extensions/events`, and
584
589
  bundles each entry standalone with `Bun.build` (`bundleUIEntry` —
585
590
  react external, build logs printed loudly, never silent).
@@ -590,7 +595,10 @@ One folder becomes pixels through four files — follow them in order:
590
595
  `domUrl` via the DOM kit, and disposes + unregisters ids that vanish or
591
596
  flip `disabled: true`. Shipped browser bundles are skipped here (the glob
592
597
  owns them — importing twice would run side effects twice) but shipped
593
- `domUrl` still mounts and `disabled` still pauses them.
598
+ `domUrl` still mounts and `disabled` still pauses them. Each sync also
599
+ parses the declared contract: the settings schema is registered for
600
+ `ctx.settings`, and unmet `requires` / malformed shapes become visible
601
+ diagnostics (see **Declared settings + requirements**).
594
602
 
595
603
  ## What extensions can use (browser stratum)
596
604