Files
community-plugins/opencode-companion/plugin.toml
T
weinguyenandGitHub e77d7ef7fb Add OpenCode Companion plugin (#286)
* Add OpenCode Panel plugin
Introduce initial implementation of the OpenCode Panel plugin.
This commit includes:
- Bar widget for status and quick actions.
- Chat panel with session selection, message history, and input.
- Background service for OpenCode server management, SSE event
  handling, and state persistence.
- Plugin configuration, documentation, and internationalization.

* Refine session chooser UI layout

Remove an unnecessary spacer and apply top-justification to improve
vertical alignment. Add a subtle background fill to the session list.

* Introduce session search in chooser

Enable live filtering of sessions in the chooser. Matches against
title, slug, ID, and directory. Search is case-insensitive.

* Support multi-question agent requests and clear composer

Implement multi-question agent replies by accumulating choices locally.
A "Submit" button becomes enabled only after all questions are answered.
The chat composer clears its text after sending by updating its key,
forcing the UI to re-render an empty input field.
Updated translations for send hints and question submit button.

* Add UI mode setting for compact layout

Introduce a `ui_mode` setting (Full/Compact) that dynamically adjusts
panel
layout. Compact mode reduces padding, font sizes, and gaps, hiding some
secondary details to minimize the panel footprint. Layout metrics
recompute on every render based on this setting.

* Delete opencode-panel

* Update thumbnail.webp

* Render chat messages newest-first

Newest message shows at top. Scrolling down reveals older messages.
This avoids scroll offset resets on re-mount in older shell APIs.
Thinking bubble now appears above the newest message.

* FEAT: Add panel layout setting

Provide option for panel to fill right side or appear compact near
click.
Introduces a new panel entry for the "fill right" mode.

* Rename plugin to OpenCode Companion

Update plugin ID, panel entries, IPC commands, and state paths.

* Only send model override when known

Stale default_model now falls back to no override instead of failing
every turn. Warn when configured default unavailable.

* Update service.luau

* fix(opencode-companion): secure terminal open, publish MCP status,
respect auto_start

- Shell-quote host and session id in the "open in terminal" command so a
  crafted server_host cannot inject extra shell commands
- Publish opencode.mcp_status and render it as a collapsible footer
  (previously declared but never observable)
- Honor auto_start: skip managed-server start on load when set to false
- Fix broken thumbnail link in README (assets/thumbnail.webp ->
  thumbnail.webp)

* fix Terminal command injection,MCP status publication and UI
2026-08-09 13:43:51 -04:00

172 lines
4.7 KiB
TOML

id = "weinguyen/opencode-companion"
name = "OpenCode Companion"
version = "0.1.0"
plugin_api = 3
author = "weinguyen"
license = "MIT"
icon = "code-circle"
description = "Integrate OpenCode AI agent directly into Noctalia bar with native chat panel, session management, and MCP status."
tags = ["ai", "productivity", "development", "bar", "panel"]
dependencies = ["opencode"]
# ── User settings ─────────────────────────────────────────────────────────────
[[setting]]
key = "server_mode"
type = "string"
default = "auto"
label_key = "settings.server_mode.label"
description_key = "settings.server_mode.description"
[[setting]]
key = "server_host"
type = "string"
default = "127.0.0.1"
label_key = "settings.server_host.label"
description_key = "settings.server_host.description"
[[setting]]
key = "server_port"
type = "double"
default = 4096
label_key = "settings.server_port.label"
description_key = "settings.server_port.description"
[[setting]]
key = "server_url"
type = "string"
default = ""
label_key = "settings.server_url.label"
description_key = "settings.server_url.description"
[[setting]]
key = "default_workspace"
type = "folder"
default = ""
label_key = "settings.default_workspace.label"
description_key = "settings.default_workspace.description"
[[setting]]
key = "default_model"
type = "string"
default = ""
label_key = "settings.default_model.label"
description_key = "settings.default_model.description"
[[setting]]
key = "default_agent"
type = "string"
default = "build"
label_key = "settings.default_agent.label"
description_key = "settings.default_agent.description"
[[setting]]
key = "auto_start"
type = "bool"
default = true
label_key = "settings.auto_start.label"
description_key = "settings.auto_start.description"
[[setting]]
key = "show_tool_calls"
type = "bool"
default = true
label_key = "settings.show_tool_calls.label"
description_key = "settings.show_tool_calls.description"
[[setting]]
key = "show_reasoning"
type = "bool"
default = false
label_key = "settings.show_reasoning.label"
description_key = "settings.show_reasoning.description"
[[setting]]
key = "notify_on_complete"
type = "bool"
default = true
label_key = "settings.notify_on_complete.label"
description_key = "settings.notify_on_complete.description"
# Integer slider: 1..100 caps loaded history; the top notch (101) means
# "unlimited" (service.luau treats >= 101 as an effectively unbounded limit).
[[setting]]
key = "max_messages_load"
type = "int"
default = 50
min = 1
max = 101
label_key = "settings.max_messages_load.label"
description_key = "settings.max_messages_load.description"
[[setting]]
key = "language"
type = "select"
default = "auto"
label_key = "settings.language.label"
description_key = "settings.language.description"
options = [
{ value = "auto", label_key = "settings.language.options.auto" },
{ value = "en", label_key = "settings.language.options.en" },
{ value = "vi", label_key = "settings.language.options.vi" },
]
[[setting]]
key = "ui_mode"
type = "select"
default = "full"
label_key = "settings.ui_mode.label"
description_key = "settings.ui_mode.description"
options = [
{ value = "full", label_key = "settings.ui_mode.options.full" },
{ value = "compact", label_key = "settings.ui_mode.options.compact" },
]
[[setting]]
key = "debug_logging"
type = "bool"
default = false
label_key = "settings.debug_logging.label"
description_key = "settings.debug_logging.description"
# Panel layout the widget opens. "fill_right" = full-height side bar pinned to
# the right edge; "compact" = the original floating panel near the click. Both
# are manifest-hosted panel entries, since placement/position are host-owned and
# read at load time (a plugin can't move its own panel at runtime).
[[setting]]
key = "panel_mode"
type = "select"
default = "fill_right"
label_key = "settings.panel_mode.label"
description_key = "settings.panel_mode.description"
options = [
{ value = "fill_right", label_key = "settings.panel_mode.options.fill_right" },
{ value = "compact", label_key = "settings.panel_mode.options.compact" },
]
# ── Entries ───────────────────────────────────────────────────────────────────
[[widget]]
id = "widget"
entry = "widget.luau"
# Full-height side bar, pinned to the right edge.
[[panel]]
id = "panel-fill"
entry = "panel.luau"
placement = "floating"
position = "center_right"
width = 560
height = "fill"
# Original floating panel near the click point.
[[panel]]
id = "panel"
entry = "panel.luau"
open_near_click = true
placement = "floating"
width = 560
height = 720
[[service]]
id = "service"
entry = "service.luau"