mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 10:45:33 -04:00
6a91a682e4
Adds a plugin.list HTTP endpoint that reports currently loaded plugins, wires it through protocol, server, and generated clients, and merges it into sdk-next's plugin API. Also updates the sample plugin to register a primary agent instead of a subagent for local testing.
17 lines
613 B
TypeScript
17 lines
613 B
TypeScript
export default {
|
|
id: "sample-agent-plugin",
|
|
setup: async (ctx) => {
|
|
await ctx.agent.transform((agents) => {
|
|
agents.update("sample-plugin-agent", (agent) => {
|
|
agent.description = "Example primary agent registered by .opencode/plugins/sample-agent.ts"
|
|
agent.mode = "primary"
|
|
agent.system = [
|
|
"You are the sample plugin agent for this repository.",
|
|
"Use this agent to verify that local plugin auto-discovery can add agents.",
|
|
"Keep responses concise and explain which plugin registered you when asked.",
|
|
].join("\n")
|
|
})
|
|
})
|
|
},
|
|
}
|