opencode-plugin-browser 1.0.0-alpha.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 ADDED
@@ -0,0 +1,56 @@
1
+ # opencode-plugin-manager
2
+
3
+ An [OpenCode](https://opencode.ai) sidebar section listing **plugins** with
4
+ installed/uninstalled status — placed below the built-in MCP section and the
5
+ Skills list, mirroring the built-in sidebar widgets.
6
+
7
+ ## What it shows
8
+
9
+ - **Installed plugins** from the plugin registry (same list
10
+ `opencode2 plugin list` shows; built-ins excluded) with their activation
11
+ state: `✓ active`, `✗ failed`, `○ inactive`.
12
+ - **LOCAL group** mixes registered plugins (`✓ … installed`) with workspace
13
+ plugin projects discovered by scanning the workspace root for sibling
14
+ directories whose `package.json` depends on `@opencode-ai/plugin` (private
15
+ monorepo roots and shared libraries excluded) — those show dimmed with
16
+ `○ … uninstalled` and a `[+]` to register them, same status column as
17
+ everything else.
18
+ - **Built-in plugins** are listed by default (group collapsed to keep the
19
+ sidebar short) and can be hidden/shown with **`/plugins-builtins`** — a view
20
+ toggle only, persisted; built-ins always run. They can't be disabled
21
+ individually: the runtime has no per-built-in disable mechanism — the only
22
+ switch is the all-or-nothing `OPENCODE_DISABLE_DEFAULT_PLUGINS` env var,
23
+ whose state the widget shows when the BUILT-IN group is visible. Per-built-in
24
+ disable requires upstream support in OpenCode's plugin host.
25
+ - **Plugin descriptions** — the registry exposes no human metadata, so the
26
+ plugin ships its own catalog (`builtins.ts`): curated descriptions for
27
+ well-known built-ins plus per-category generation (`provider.*`, `tool.*`,
28
+ `config.*`, `websearch.*`). Click any row to inspect its details.
29
+
30
+ Collapsed header shows `PLUGINS (installed/total)`; more than two entries
31
+ collapse, click (or expand) to list them — same interaction as the built-in
32
+ MCP/Skills sections.
33
+
34
+ ## Install
35
+
36
+ ```sh
37
+ # in opencode.jsonc
38
+ { "plugins": ["./opencode-usage-quota-tracker", "./opencode-skill-lister", "./opencode-plugin-manager", "./opencode-model-recommender"] }
39
+ ```
40
+
41
+ Order matters: plugins sharing the `sidebar.content` slot render in
42
+ `plugins` array order — keep this entry after `opencode-skill-lister` (and
43
+ before anything you want below it) so the section sits directly under
44
+ **MCP** and **Skills**.
45
+
46
+ ## Data sources
47
+
48
+ - Plugin registry: `client.plugin.list()` (activation state included)
49
+ - Workspace scan: sibling directories of the current location, one
50
+ `package.json` read per candidate; result is cached through
51
+ [opencode-plugin-kit](../opencode-plugin-kit)'s `createCachedStore` so the
52
+ sidebar restores instantly after a TUI restart.
53
+
54
+ ## License
55
+
56
+ GNU Affero General Public License v3.0 — see [LICENSE](LICENSE).
package/builtins.ts ADDED
@@ -0,0 +1,47 @@
1
+ // Descriptions for built-in OpenCode plugins. The registry (/api/plugin)
2
+ // exposes only id/source/state — no human metadata — so the plugin ships its
3
+ // own catalog. Categories (opencode.<category>.<name>) get generated
4
+ // descriptions; well-known plugins get curated overrides.
5
+
6
+ const OVERRIDES: Record<string, string> = {
7
+ "opencode.agent": "Agent runtime: session agents, subagents, and agent state.",
8
+ "opencode.browser": "Desktop browser integration for automation and page capture.",
9
+ "opencode.command": "Command registry: slash commands and their execution wiring.",
10
+ "opencode.mcp.codemode.exclusion": "Excludes MCP tools from code-mode execution where unsafe.",
11
+ "opencode.models.dev": "models.dev catalog sync: model metadata and pricing.",
12
+ "opencode.plan": "Plan mode: read-only planning sessions before execution.",
13
+ "opencode.skill": "Skills runtime: discovers and exposes SKILL.md-based skills.",
14
+ "opencode.tools": "Tool namespace: registers the core tool set for sessions.",
15
+ "opencode.variant": "Model variant handling (provider-specific model settings).",
16
+ "opencode.warming": "Warms providers/connections at startup for faster first use.",
17
+ "opencode.wellknown": "Serves well-known endpoints for integrations and discovery.",
18
+ "opencode.vcs.git": "Git integration: status, diffs, branches, worktrees.",
19
+ "opencode.vcs.hg": "Mercurial integration: status, diffs, and branches.",
20
+ "opencode.prompt.openai": "Prompt-shaping adaptations for OpenAI models.",
21
+ "opencode.prompt.kimi": "Prompt-shaping adaptations for Kimi models.",
22
+ "opencode.prompt.arcee": "Prompt-shaping adaptations for Arcee models.",
23
+ "opencode.prompt.meta": "Prompt-shaping adaptations for Meta (Llama) models.",
24
+ }
25
+
26
+ const CATEGORIES: Record<string, (name: string) => string> = {
27
+ provider: (n) => `Provider integration for ${n} (auth, API, model wiring).`,
28
+ tool: (n) => `Core "${n}" tool implementation for agent sessions.`,
29
+ config: (n) => `Loads and applies ${n} configuration into the runtime.`,
30
+ websearch: (n) => `Web search backend (${n}) for the websearch tool.`,
31
+ }
32
+
33
+ /** Best-effort description for a built-in plugin id. */
34
+ export function describeBuiltin(id: string): string {
35
+ const override = OVERRIDES[id]
36
+ if (override) return override
37
+ const parts = id.split(".")
38
+ // Expect "opencode.<category>.<name...>"
39
+ if (parts[0] === "opencode" && parts.length >= 3) {
40
+ const category = parts[1]
41
+ const name = parts.slice(2).join(" ")
42
+ const gen = CATEGORIES[category]
43
+ if (gen) return gen(name)
44
+ return `Built-in ${category} plugin: ${name}.`
45
+ }
46
+ return "Built-in plugin."
47
+ }
package/index.ts ADDED
@@ -0,0 +1,15 @@
1
+ // Server-side entrypoint. All behavior (the sidebar plugins list) lives in
2
+ // the TUI entrypoint (tui.tsx), exposed via the "./tui" export. The server
3
+ // role must not import JSX — OpenCode's server transpiler resolves JSX with
4
+ // the default "react" runtime, which is not installed and fails the load.
5
+ import { Plugin } from "@opencode-ai/plugin"
6
+
7
+ // Hoisted into a named binding: a bare `export default <object expression>`
8
+ // produces empty v8 coverage maps for this file.
9
+ const plugin = Plugin.define({
10
+ id: "plugin-manager.server",
11
+ setup() {},
12
+ })
13
+
14
+ export { plugin }
15
+ export default plugin
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "opencode-plugin-browser",
3
+ "version": "1.0.0-alpha.1",
4
+ "description": "Sidebar section listing OpenCode plugins with installed/uninstalled status, below MCPs and Skills.",
5
+ "keywords": [
6
+ "opencode",
7
+ "opencode-plugin",
8
+ "plugins",
9
+ "sidebar"
10
+ ],
11
+ "license": "AGPL-3.0",
12
+ "author": "Ranjith Raj",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/ranjithrajv/opencode-plugin-manager.git"
16
+ },
17
+ "files": [
18
+ "index.ts",
19
+ "tui.tsx",
20
+ "builtins.ts"
21
+ ],
22
+ "type": "module",
23
+ "exports": {
24
+ ".": "./index.ts",
25
+ "./tui": "./tui.tsx"
26
+ },
27
+ "scripts": {
28
+ "check": "vp check",
29
+ "check:fix": "vp check --fix",
30
+ "fmt": "vp fmt",
31
+ "lint": "vp lint",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vp test",
34
+ "test:coverage": "vitest run --coverage.enabled"
35
+ },
36
+ "dependencies": {
37
+ "@opencode-ai/plugin": "beta",
38
+ "opencode-plugin-kit": "^1.0.0-alpha.2"
39
+ },
40
+ "devDependencies": {
41
+ "@opentui/core": "^0.5.11",
42
+ "@opentui/solid": "^0.5.11",
43
+ "@types/node": "^26.5.0",
44
+ "@vitest/coverage-v8": "^5.0.0",
45
+ "happy-dom": "^20.14.0",
46
+ "js-tokens": "^10.0.0",
47
+ "solid-js": "1.9.15",
48
+ "typescript": "^7.0.2",
49
+ "vite": "^7.0.0",
50
+ "vite-plugin-solid": "^2.11.14",
51
+ "vite-plus": "^0.1.16",
52
+ "vitest": "^5.0.0"
53
+ },
54
+ "peerDependencies": {
55
+ "@opentui/core": "^0.5.11",
56
+ "@opentui/solid": "^0.5.11",
57
+ "solid-js": "^1.9.15"
58
+ },
59
+ "packageManager": "npm@11.19.1"
60
+ }