Logo
Sign up Sign in
forks/opencode
1
0
hosted on Rithub
Fork 0
You've already forked opencode
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
opencode/packages/plugin/src/example.ts

11 lines
205 B
TypeScript
Raw Normal View History

wip: plugins
2025-08-02 18:50:19 -04:00
import { Plugin } from "./index"
Refactor to support multiple instances inside single opencode process (#2360) This release has a bunch of minor breaking changes if you are using opencode plugins or sdk 1. storage events have been removed (we might bring this back but had some issues) 2. concept of `app` is gone - there is a new concept called `project` and endpoints to list projects and get the current project 3. plugin receives `directory` which is cwd and `worktree` which is where the root of the project is if it's a git repo 4. the session.chat function has been renamed to session.prompt in sdk. it no longer requires model to be passed in (model is now an object) 5. every endpoint takes an optional `directory` parameter to operate as though opencode is running in that directory
2025-09-01 17:15:49 -04:00
export const ExamplePlugin: Plugin = async ({ client, $ }) => {
wip: plugins
2025-08-02 18:50:19 -04:00
return {
permission: {},
wip: plugins
2025-08-03 21:42:45 -04:00
async "chat.params"(input, output) {
output.topP = 1
wip: plugin load from package
2025-08-03 21:19:03 -04:00
},
wip: plugins
2025-08-02 18:50:19 -04:00
}
}
Reference in New Issue Copy Permalink
English
English
Licenses API
Explore · Agents · Move from GitHub · Rithub vs GitHub · For startups · Terms · Privacy