1import { Plugin } from "@opencode/plugin";
3export const define = (definition) =>
7 definition.setup(context)().then((cleanup) => async () => {
12export const locationDirectory = (context) => () => context.location.directory;
14export const registerTool = (context) => (tool) => () =>
16 .transform((editor) => {
19 description: tool.description,
20 input: tool.inputSchema,
21 execute: (input, execution) => tool.execute(input)(execution)(),
24 .then((registration) => async () => {
25 await registration.dispose();
28export const sessionId = (context) => context.sessionID;
30export const onAbort = (context) => (callback) => () => {
31 const signal = context.signal;
33 const remove = () => {
36 signal.removeEventListener("abort", listener);
39 const listener = () => {
44 if (signal.aborted) listener();
45 else signal.addEventListener("abort", listener, { once: true });
49export const success = (message) => ({ content: message });
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list