Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# oc-plugins

Two OpenCode plugins and a standalone events MCP server for Lark, GitLab, and Codemagic in one Bun workspace.
OpenCode plugins and a standalone events MCP server for Lark, GitLab, and Codemagic in one Bun workspace.

| Package | Purpose |
| --------------------------------------------- | ------------------------------------------------------------------ |
| [oc-fallback](packages/oc-fallback/README.md) | Switch models when a primary request hits the free limit |
| [oc-idle](packages/oc-idle/README.md) | Compact large sessions after an idle period |
| [oc-watches](packages/oc-watches/README.md) | See active event watches in the OpenCode terminal sidebar |
| [events-mcp](packages/events-mcp/README.md) | Wake sessions on Lark, GitLab, and Codemagic events over MCP stdio |

Tested with OpenCode 2.4.1 and Effect 4.1.0. No build step is required.
Expand All @@ -32,6 +33,8 @@ Then add a package directory to your OpenCode config:
}
```

For the terminal sidebar, see [Install oc-watches](packages/oc-watches/README.md#install).

For the standalone events MCP server, run:

```sh
Expand Down
170 changes: 168 additions & 2 deletions bun.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
"@opencode/plugin": "2.4.1",
"@opencode/schema": "2.4.1",
"@opencode/util": "2.4.1",
"@opentui/core": "0.9.10",
"@opentui/solid": "0.9.10",
"@types/bun": "1.4.4",
"@types/node": "25.0.3",
"@types/ws": "8.18.2",
"effect": "4.1.0",
"oxfmt": "0.78.0",
"oxlint": "1.93.0",
"socket.io-client": "4.8.4",
"solid-js": "1.9.17",
"ts-json-schema-generator": "2.9.0",
"typescript": "7.0.2",
"typescript-sdk-schema": "npm:typescript@5.9.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/events-mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ Merge this into `~/.config/opencode/opencode.jsonc`:

`location_idle_timeout: false` keeps OpenCode from ending long watches when a location goes idle.

To see OpenCode watches in the terminal sidebar, install the optional
[oc-watches TUI plugin](../oc-watches/README.md).

### Claude Code

```sh
Expand Down
40 changes: 40 additions & 0 deletions packages/oc-watches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# oc-watches

See active event watches and their expiration in the OpenCode session sidebar.
The section appears by default when the sidebar is visible and the session has
active watches.

Open `/watches` to see active and paused watches. It starts on **This session**
inside a session and on **All sessions** from Home. Use **All sessions** to see
watches across projects on the connected server.

## Install

Install the plugin to enable it in your terminal UI:

```sh
opencode plugin add 'github:LuckUVeryX/oc-plugins#oc-watches-v0.1.0::path:packages/oc-watches'
```

For a local checkout, run `bun install --frozen-lockfile` at the repository root
and add the absolute path to `packages/oc-watches` to `plugins` in
`~/.config/opencode/cli.json`.

## How it works with events-mcp

Configure [events-mcp](../events-mcp/README.md#opencode) on the OpenCode server
and install `oc-watches` in the terminal. Ask the agent to watch a GitLab merge
request or Lark thread. The agent creates an OpenCode event automation, which
then appears in the sidebar of the session that created it.

```text
events-mcp delivers events to OpenCode
OpenCode owns the automation and decides whether to wake the session
oc-watches reads the automation through the connected OpenCode server
```

The TUI plugin uses Effect to refresh the watch list while a view is open.
OpenCode keeps running the automation after the view closes. The plugin also
shows event automations backed by other MCP servers on the same OpenCode server.
**Active** is the automation status. It does not indicate whether the event
stream is currently connected.
24 changes: 24 additions & 0 deletions packages/oc-watches/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "oc-watches",
"version": "0.1.0",
"private": true,
"description": "Show active OpenCode event watches in the terminal UI",
"files": [
"src"
],
"type": "module",
"exports": {
"./tui": "./src/tui.tsx"
},
"scripts": {
"typecheck": "bun --bun tsc -p tsconfig.json"
},
"peerDependencies": {
"@opencode/plugin": "2.4.1",
"@opencode/schema": "2.4.1",
"effect": "4.1.0"
},
"engines": {
"bun": ">=1.4.2"
}
}
Loading
Loading