plugin structure

Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
2026-04-19 18:32:39 -04:00
parent 064ae0f251
commit d91f6fe3ef
7 changed files with 1118 additions and 3 deletions

26
.opencode/INSTALL.md Normal file
View File

@@ -0,0 +1,26 @@
# Installing tmux-utils for OpenCode
## Installation
Add the plugin to the `plugin` array in your `opencode.json`:
```json
{
"plugin": ["tmux-utils"]
}
```
If you install directly from git instead of a registry, use the git URL in that same array entry.
Restart OpenCode after updating the config.
## Usage
This plugin provides:
- the `interactive_bash` tool for tmux-backed interactive sessions
- tmux subagent pane management tied to OpenCode session lifecycle events
## Configuration
Plugin configuration is loaded from standard OpenCode config locations for this project and user environment.

View File

@@ -0,0 +1 @@
export { default } from "../../dist/index.js"

13
README.md Normal file
View File

@@ -0,0 +1,13 @@
# tmux-utils
Standalone OpenCode plugin for tmux subagent panes and the `interactive_bash` tmux tool.
## OpenCode Install
Tell OpenCode:
```text
Fetch and follow instructions from ./.opencode/INSTALL.md
```
Detailed OpenCode docs: `docs/README.opencode.md`

25
docs/README.opencode.md Normal file
View File

@@ -0,0 +1,25 @@
# tmux-utils for OpenCode
`tmux-utils` is an OpenCode plugin that adds a tmux-backed `interactive_bash` tool and manages tmux panes for subagent sessions.
## Installation
Add the plugin to `opencode.json`:
```json
{
"plugin": ["tmux-utils"]
}
```
Restart OpenCode after installing.
## Features
- `interactive_bash` tool backed by tmux
- tmux pane lifecycle management for subagent sessions
- plugin-config-driven tmux behavior
## Entrypoint Layout
The published package exposes an OpenCode-specific wrapper at `.opencode/plugins/tmux-utils.js`, which re-exports the built plugin from `dist/index.js`.

1007
opencode-session.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -2,16 +2,19 @@
"name": "tmux-utils",
"version": "0.1.0",
"description": "Standalone OpenCode plugin for tmux subagent panes and interactive tmux tool",
"main": "dist/index.js",
"main": ".opencode/plugins/tmux-utils.js",
"types": "dist/index.d.ts",
"type": "module",
"files": [
"dist"
".opencode",
"dist",
"docs",
"README.md"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./.opencode/plugins/tmux-utils.js"
}
},
"scripts": {

40
release.sh Executable file
View File

@@ -0,0 +1,40 @@
#! /usr/bin/env nix
#! nix shell nixpkgs#bash nixpkgs#bun nixpkgs#git nixpkgs#nodejs --command bash
set -euo pipefail
if [[ $# -ne 1 ]]; then
printf 'Usage: %s <version>\n' "$0" >&2
exit 1
fi
version="$1"
branch="$(git branch --show-current)"
if [[ "$branch" != "main" ]]; then
printf 'Release must run from main, current branch: %s\n' "$branch" >&2
exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
printf 'Working tree must be clean before releasing.\n' >&2
exit 1
fi
git fetch origin main --tags
if ! git merge-base --is-ancestor origin/main HEAD; then
printf 'Local main is behind origin/main. Pull or rebase before releasing.\n' >&2
exit 1
fi
bun run typecheck
bun run clean
bun run build
npm version "$version"
git push origin main
git push origin "v$version"
# vim: set ft=bash :