feat(plugin): add namespaced hook API (#33416)

This commit is contained in:
Dax
2026-06-22 19:06:57 -04:00
committed by GitHub
parent dc468bdcfd
commit 909a1a6d78
150 changed files with 3286 additions and 3916 deletions
@@ -0,0 +1,15 @@
import { define } from "@opencode-ai/plugin/v2/effect"
import { Effect } from "effect"
export default define({
id: "config-effect-plugin",
effect: (ctx) =>
ctx.agent
.transform((agents) => {
agents.update("effect-configured", (agent) => {
agent.description = ctx.options.description
agent.mode = "subagent"
})
})
.pipe(Effect.asVoid),
})
@@ -0,0 +1,13 @@
import { define } from "@opencode-ai/plugin/v2/promise"
export default define({
id: "config-promise-plugin",
setup: async (ctx) => {
await ctx.agent.transform((agents) => {
agents.update("configured", (agent) => {
agent.description = ctx.options.description
agent.mode = "subagent"
})
})
},
})
@@ -0,0 +1 @@
export default {}