Skip to content

Commit 3379e44

Browse files
committed
refactor(core): rename ApplyPatchTool to PatchTool
1 parent e1abf59 commit 3379e44

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/core/src/plugin/internal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { SessionInstructions } from "../session/instructions"
3131
import { SessionTodo } from "../session/todo"
3232
import { Shell } from "../shell"
3333
import { SkillV2 } from "../skill"
34-
import { ApplyPatchTool } from "../tool/apply-patch"
34+
import { PatchTool } from "../tool/patch"
3535
import { EditTool } from "../tool/edit"
3636
import { GlobTool } from "../tool/glob"
3737
import { GrepTool } from "../tool/grep"
@@ -127,7 +127,7 @@ const pre = [
127127
SkillPlugin.Plugin,
128128
ModelsDevPlugin,
129129
...ProviderPlugins,
130-
ApplyPatchTool.Plugin,
130+
PatchTool.Plugin,
131131
EditTool.Plugin,
132132
GlobTool.Plugin,
133133
GrepTool.Plugin,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * as ApplyPatchTool from "./apply-patch"
1+
export * as PatchTool from "./patch"
22

33
import type { Context as PluginContext } from "@opencode-ai/plugin/v2/effect/plugin"
44
import { ToolFailure } from "@opencode-ai/llm"
@@ -55,8 +55,8 @@ type Prepared =
5555
})
5656

5757
export const Plugin = {
58-
id: "opencode.tool.apply-patch",
59-
effect: Effect.fn("ApplyPatchTool.Plugin")(function* (ctx: PluginContext) {
58+
id: "opencode.tool.patch",
59+
effect: Effect.fn("PatchTool.Plugin")(function* (ctx: PluginContext) {
6060
const mutation = yield* LocationMutation.Service
6161
const files = yield* FileMutation.Service
6262
const fs = yield* FSUtil.Service

packages/core/test/tool-apply-patch.test.ts renamed to packages/core/test/tool-patch.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import { AbsolutePath } from "@opencode-ai/core/schema"
1313
import { SessionV2 } from "@opencode-ai/core/session"
1414
import { ToolRegistry } from "@opencode-ai/core/tool/registry"
1515
import { ToolOutputStore } from "@opencode-ai/core/tool-output-store"
16-
import { ApplyPatchTool } from "@opencode-ai/core/tool/apply-patch"
16+
import { PatchTool } from "@opencode-ai/core/tool/patch"
1717
import { location } from "./fixture/location"
1818
import { tmpdir } from "./fixture/tmpdir"
1919
import { makeLocationNode } from "@opencode-ai/core/effect/app-node"
2020
import { testEffect } from "./lib/effect"
2121
import { toolIdentity, executeTool, registerToolPlugin, settleTool, toolDefinitions } from "./lib/tool"
2222

23-
const applyPatchToolNode = makeLocationNode({
24-
name: "test/apply-patch-tool-plugin",
25-
layer: Layer.effectDiscard(registerToolPlugin(ApplyPatchTool.Plugin)),
23+
const patchToolNode = makeLocationNode({
24+
name: "test/patch-tool-plugin",
25+
layer: Layer.effectDiscard(registerToolPlugin(PatchTool.Plugin)),
2626
deps: [ToolRegistry.toolsNode, LocationMutation.node, FileMutation.node, FSUtil.node, PermissionV2.node],
2727
})
2828

@@ -116,7 +116,7 @@ const withTool = <A, E, R>(directory: string, body: (registry: ToolRegistry.Inte
116116
ToolRegistry.toolsNode,
117117
LocationMutation.node,
118118
FileMutation.node,
119-
applyPatchToolNode,
119+
patchToolNode,
120120
]),
121121
[
122122
[FSUtil.node, filesystem],
@@ -129,7 +129,7 @@ const withTool = <A, E, R>(directory: string, body: (registry: ToolRegistry.Inte
129129
)
130130
}
131131

132-
const call = (patchText: string, id = "call-apply-patch") => ({
132+
const call = (patchText: string, id = "call-patch") => ({
133133
sessionID,
134134
...toolIdentity,
135135
call: { type: "tool-call" as const, id, name: "patch", input: { patchText } },
@@ -147,7 +147,7 @@ const exists = (target: string) =>
147147
)
148148
const it = testEffect(Layer.empty)
149149

150-
describe("ApplyPatchTool", () => {
150+
describe("PatchTool", () => {
151151
it.live("registers and sequentially applies add, update, and delete hunks", () =>
152152
Effect.acquireUseRelease(
153153
Effect.promise(() => tmpdir()),

0 commit comments

Comments
 (0)