mirror of
https://github.com/max-sixty/worktrunk.git
synced 2026-11-23 01:51:13 +08:00
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).
29 lines
897 B
TypeScript
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;
|