Files
worktrunk/dev/opencode-plugin.ts
T
Axel H. a5c7fa76f1 fix(opencode): fix broken unicode escaping depending on Bun version (#1935)
A small fix on the OpenCode plugin: depending on the Bun version,
unicode can be broken ([escaped while it
shouldn't](https://github.com/bikeshaving/crank/issues/342)).

This fix ensures it works whatever the Bun version used in OpenCode (I
already use this fix locally).
2026-04-06 14:27:14 -07:00

29 lines
897 B
TypeScript

// Worktrunk activity tracking plugin for OpenCode.
//
// Tracks OpenCode session activity per branch, showing status markers in `wt list`:
// 🤖 — agent is working
// 💬 — agent is waiting for input
//
// Installed globally via: wt config plugins opencode install
// Or manually: copy to ~/.config/opencode/plugins/worktrunk.ts
import type { Plugin } from "@opencode-ai/plugin";
export default (async ({ $ }) => {
return {
event: async ({ event }) => {
switch (event.type) {
case "session.status":
await $`wt config state marker set ${'🤖'} || true`.quiet();
break;
case "session.idle":
await $`wt config state marker set ${'💬'} || true`.quiet();
break;
case "session.deleted":
await $`wt config state marker clear || true`.quiet();
break;
}
},
};
}) satisfies Plugin;