Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ import type { Tool } from "@/tool/tool"
import type { ReadTool } from "@/tool/read"
import type { WriteTool } from "@/tool/write"
import { BashTool } from "@/tool/bash"
import type { GlobTool } from "@/tool/glob"
import type { RgTool } from "@/tool/rg"
import { TodoWriteTool } from "@/tool/todo"
import type { GrepTool } from "@/tool/grep"
import type { ListTool } from "@/tool/ls"
import type { EditTool } from "@/tool/edit"
import type { ApplyPatchTool } from "@/tool/apply_patch"
Expand Down Expand Up @@ -1430,15 +1429,12 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
<Match when={props.part.tool === "bash"}>
<Bash {...toolprops} />
</Match>
<Match when={props.part.tool === "glob"}>
<Match when={props.part.tool === "glob" || props.part.tool === "grep"}>
<Glob {...toolprops} />
</Match>
<Match when={props.part.tool === "read"}>
<Read {...toolprops} />
</Match>
<Match when={props.part.tool === "grep"}>
<Grep {...toolprops} />
</Match>
<Match when={props.part.tool === "list"}>
<List {...toolprops} />
</Match>
Expand Down Expand Up @@ -1719,11 +1715,21 @@ function Write(props: ToolProps<typeof WriteTool>) {
)
}

function Glob(props: ToolProps<typeof GlobTool>) {
function Glob(props: ToolProps<typeof RgTool>) {
const isContentSearch = !props.input.files_only
const displayValue = props.input.pattern ?? props.input.include
const matchesCount = props.metadata.matches

return (
<InlineTool icon="✱" pending="Finding files..." complete={props.input.pattern} part={props.part}>
Glob "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
<Show when={props.metadata.count}>({props.metadata.count} matches)</Show>
<InlineTool
icon="✱"
pending={isContentSearch ? "Searching content..." : "Finding files..."}
complete={displayValue}
part={props.part}
>
{isContentSearch ? "Grep" : "Glob"} "{displayValue}"{" "}
<Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
<Show when={matchesCount !== undefined}>({matchesCount} matches)</Show>
</InlineTool>
)
}
Expand All @@ -1736,15 +1742,6 @@ function Read(props: ToolProps<typeof ReadTool>) {
)
}

function Grep(props: ToolProps<typeof GrepTool>) {
return (
<InlineTool icon="✱" pending="Searching content..." complete={props.input.pattern} part={props.part}>
Grep "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
<Show when={props.metadata.matches}>({props.metadata.matches} matches)</Show>
</InlineTool>
)
}

function List(props: ToolProps<typeof ListTool>) {
const dir = createMemo(() => {
if (props.input.path) {
Expand Down
77 changes: 0 additions & 77 deletions packages/opencode/src/tool/glob.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/opencode/src/tool/glob.txt

This file was deleted.

154 changes: 0 additions & 154 deletions packages/opencode/src/tool/grep.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/opencode/src/tool/grep.txt

This file was deleted.

6 changes: 2 additions & 4 deletions packages/opencode/src/tool/registry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { QuestionTool } from "./question"
import { BashTool } from "./bash"
import { EditTool } from "./edit"
import { GlobTool } from "./glob"
import { GrepTool } from "./grep"
import { RgTool } from "./rg"
import { BatchTool } from "./batch"
import { ReadTool } from "./read"
import { TaskTool } from "./task"
Expand Down Expand Up @@ -99,8 +98,7 @@ export namespace ToolRegistry {
...(["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) ? [QuestionTool] : []),
BashTool,
ReadTool,
GlobTool,
GrepTool,
RgTool,
EditTool,
WriteTool,
TaskTool,
Expand Down
Loading
Loading