feat(core): manage configurable plugin generations

This commit is contained in:
Dax Raad 2026-07-05 15:51:15 -04:00
commit a9b7bd9e2f
83 changed files with 1116 additions and 819 deletions

View file

@ -55,7 +55,7 @@ type Prepared =
})
export const Plugin = {
id: "core-apply-patch-tool",
id: "opencode.tool.apply-patch",
effect: Effect.fn("ApplyPatchTool.Plugin")(function* (ctx: PluginContext) {
const mutation = yield* LocationMutation.Service
const files = yield* FileMutation.Service

View file

@ -86,7 +86,7 @@ export const toModelOutput = (output: Output, oldString: string, newString: stri
// TODO: Add LSP notification and diagnostics after V2 LSP runtime exists.
export const Plugin = {
id: "core-edit-tool",
id: "opencode.tool.edit",
effect: Effect.fn("EditTool.Plugin")(function* (ctx: PluginContext) {
const mutation = yield* LocationMutation.Service
const files = yield* FileMutation.Service

View file

@ -35,7 +35,7 @@ export const toModelOutput = (output: ModelOutput) => {
/** Glob leaf that defaults its filesystem root to the active Location. */
export const Plugin = {
id: "core-glob-tool",
id: "opencode.tool.glob",
effect: Effect.fn("GlobTool.Plugin")(function* (ctx: PluginContext) {
const fs = yield* FSUtil.Service
const ripgrep = yield* Ripgrep.Service

View file

@ -49,7 +49,7 @@ export const toModelOutput = (output: ModelOutput) => {
/** Grep leaf that defaults its filesystem root to the active Location. */
export const Plugin = {
id: "core-grep-tool",
id: "opencode.tool.grep",
effect: Effect.fn("GrepTool.Plugin")(function* (ctx: PluginContext) {
const fs = yield* FSUtil.Service
const ripgrep = yield* Ripgrep.Service

View file

@ -43,7 +43,7 @@ export const toModelOutput = (
}
export const Plugin = {
id: "core-question-tool",
id: "opencode.tool.question",
effect: Effect.fn("QuestionTool.Plugin")(function* (ctx: PluginContext) {
const question = yield* QuestionV2.Service
const permission = yield* PermissionV2.Service

View file

@ -31,7 +31,7 @@ const Input = LocationInput
const Output = Schema.Union([FileSystem.Content, ReadToolFileSystem.TextPage, ReadToolFileSystem.ListPage])
export const Plugin = {
id: "core-read-tool",
id: "opencode.tool.read",
effect: Effect.fn("ReadTool.Plugin")(function* (ctx: PluginContext) {
const reader = yield* ReadToolFileSystem.Service
const mutation = yield* LocationMutation.Service

View file

@ -99,7 +99,7 @@ const externalCommandDirectories = Effect.fn("ShellTool.externalCommandDirectori
})
export const Plugin = {
id: "core-shell-tool",
id: "opencode.tool.shell",
effect: Effect.fn("ShellTool.Plugin")(function* (ctx: PluginContext) {
const runtime = yield* PluginRuntime.Service
const scope = yield* Scope.Scope

View file

@ -53,7 +53,7 @@ const unableToLoad = (name: string, error?: unknown) =>
new ToolFailure({ message: `Unable to load skill ${name}`, error })
export const Plugin = {
id: "core-skill-tool",
id: "opencode.tool.skill",
effect: Effect.fn("SkillTool.Plugin")(function* (ctx: PluginContext) {
const fs = yield* FSUtil.Service
const skills = yield* SkillV2.Service

View file

@ -38,7 +38,7 @@ export const description = [
].join("\n")
export const Plugin = {
id: "core-subagent-tool",
id: "opencode.tool.subagent",
effect: Effect.fn("SubagentTool.Plugin")(function* (ctx: PluginContext) {
const runtime = yield* PluginRuntime.Service
const agents = yield* AgentV2.Service

View file

@ -21,7 +21,7 @@ export type Output = typeof Output.Type
export const toModelOutput = (output: Output) => JSON.stringify(output.todos, null, 2)
export const Plugin = {
id: "core-todowrite-tool",
id: "opencode.tool.todowrite",
effect: Effect.fn("TodoWriteTool.Plugin")(function* (ctx: PluginContext) {
const todos = yield* SessionTodo.Service
const permission = yield* PermissionV2.Service

View file

@ -113,7 +113,7 @@ const convert = (content: string, contentType: string, format: Format) => {
}
export const Plugin = {
id: "core-webfetch-tool",
id: "opencode.tool.webfetch",
effect: Effect.fn("WebFetchTool.Plugin")(function* (ctx: PluginContext) {
const http = yield* HttpClient.HttpClient
const permission = yield* PermissionV2.Service

View file

@ -188,7 +188,7 @@ const Output = Schema.Struct({
})
export const Plugin = {
id: "core-websearch-tool",
id: "opencode.tool.websearch",
effect: Effect.fn("WebSearchTool.Plugin")(function* (ctx: PluginContext) {
const http = yield* HttpClient.HttpClient
const config = yield* ConfigService

View file

@ -43,7 +43,7 @@ export const toModelOutput = (output: Output) =>
// TODO: Add LSP notification and diagnostics after V2 LSP runtime exists.
export const Plugin = {
id: "core-write-tool",
id: "opencode.tool.write",
effect: Effect.fn("WriteTool.Plugin")(function* (ctx: PluginContext) {
const mutation = yield* LocationMutation.Service
const files = yield* FileMutation.Service