Skip to content

feat(gui): add the experimental gui-experimental window part with the vvoc.gui.v1 rpc - #45

Open
osovv wants to merge 2 commits into
mainfrom
factory/gui-spayk-veb-gui-vs-desktop-dlya-gui-experiment
Open

osovv wants to merge 2 commits into
mainfrom
factory/gui-spayk-veb-gui-vs-desktop-dlya-gui-experiment

Conversation

@osovv

@osovv osovv commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Why the change

OpenCode plugins can ship a GUI half loaded by the app's windows, but this package had none and it was unresolved whether the web GUI loads such bundles at all or they are Desktop-only.

Special things to note

  • The upstream GUI API is experimental and may change between releases — the export is deliberately named ./gui-experimental; used SDK surface is pinned (@opencode/plugin 2.2.5) and was probed live against an OpenCode 2.2.6 host.
  • Live-probe verdict recorded in the README: the web GUI fetches the plugin inventory but never requests the GUI bundle route and renders no plugin settings page; the server half serves the bundle and the RPC works, so plugin GUI parts are treated as Desktop-only until a Desktop probe says otherwise (the Desktop app was not available on the probe machine; the SDK states config plugins run only in the desktop app).
  • defaults.set writes the real user vvoc config through the same conservative CLI write path as vvoc orchestration set (explicit global/project scope, strict parse, keep-if-unchanged, canonical output); session.patch honestly answers unsupported until session-owned settings exist.
  • The export checker learned one new shape: bundler-built CommonJS export targets (./dist/*.cjs) resolve to their same-named src/*.tsx|ts entry twin, so the pre-commit gate stays green without weakening existing ./dist/*.js checks.

Change outline

// package.json
"exports": { "./gui-experimental": "./dist/gui-experimental.cjs", ... },
"scripts":  { "build": "... && vite build --config scripts/vite-gui.ts" },
"devDependencies": { "vite": "7.3.7", "vite-plugin-solid": "2.11.10", ... }
// src/rpc.ts — portable versioned contract, shared by server plugin and window half
export const vvocGuiRpc = {
  id: "vvoc.gui.v1",
  methods: { "defaults.get", "defaults.set", "session.get", "session.patch" }, // Effect Schema codecs → Standard Schema
} satisfies Rpc.PortableDefinition;
// src/plugins/gui-settings.ts — server side, registered in the aggregate plugin
defaults.get → bounded effective-defaults projection (profile, three toggles, source)
defaults.set → conservative CLI write path, explicit scope
session.get  → stub read from effective config (honest note)
session.patch→ { status: "unsupported" }
// src/gui-experimental.tsx — window half, one CJS bundle via the host vite preset
ctx.add(SettingsPage, { id: "vvoc", render: profile/source/platform from defaults.get });
ctx.add(ComposerPill, { id: "profile", show: () => ({ label: `vvoc · ${profile}`, run: open page }) });

The bundle is proven served byte-for-byte by the host and the RPC roundtrip is proven live (defaults write flips the on-disk profile, session stub/unsupported verdicts, lookup failure for unknown sessions); the paired web app never loads it, which closes the web-versus-Desktop question for the follow-up panel work.

osovv added 2 commits November 7, 2026 22:45
… vvoc.gui.v1 rpc

Ship the minimal ./gui-experimental GUI skeleton: a vvoc settings page stub
and a profile composer pill built with host ui components and an English i18n
catalog, built as one CommonJS bundle through the host-provided Vite GUI preset
(vite build joins the build script). The portable versioned RPC contract
(vvoc.gui.v1, Effect Schema codecs bridged to the portable Standard Schema
surface) is registered server-side by the new GuiSettingsPlugin: defaults.get
projects the bounded effective defaults, defaults.set writes the orchestration
profile through the same conservative CLI path as vvoc orchestration set,
session.get answers an honest stub read from the effective config, and
session.patch answers unsupported until session-owned settings exist.

Probed live against an OpenCode 2.2.6 host: the web GUI never requests
/api/plugin/gui and renders no plugin settings page, while the server serves
the built bundle and the RPC roundtrip works, so plugin GUI parts are
Desktop-only until a Desktop probe says otherwise. The GUI SDK states the same
for config plugins. The export checker now recognizes bundler-built CommonJS
targets (./dist/*.cjs resolve to their same-named src twin). The upstream GUI
API is experimental; the SDK and host versions are pinned and documented in
the README.
Keep both sides in .grace/graph/main.xml and
.grace/verification/main.xml: the experimental gui-experimental window
part entries beside the session-owned settings updates to the shared
context-tui, web-tools, tool-history-compaction, and analytics
entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant