Skip to content

Commit d2ea670

Browse files
authored
fix(core): Remove dead code and documentation related to the obsolete list tool. (#22672)
1 parent 6bed7d4 commit d2ea670

60 files changed

Lines changed: 37 additions & 516 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/opencode/src/acp/agent.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,6 @@ export namespace ACP {
15661566
case "context7_get_library_docs":
15671567
return "search"
15681568

1569-
case "list":
15701569
case "read":
15711570
return "read"
15721571

@@ -1587,8 +1586,6 @@ export namespace ACP {
15871586
return input["path"] ? [{ path: input["path"] }] : []
15881587
case "bash":
15891588
return []
1590-
case "list":
1591-
return input["path"] ? [{ path: input["path"] }] : []
15921589
default:
15931590
return []
15941591
}

packages/opencode/src/cli/cmd/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { Argv } from "yargs"
1515

1616
type AgentMode = "all" | "primary" | "subagent"
1717

18-
const AVAILABLE_TOOLS = ["bash", "read", "write", "edit", "list", "glob", "grep", "webfetch", "task", "todowrite"]
18+
const AVAILABLE_TOOLS = ["bash", "read", "write", "edit", "glob", "grep", "webfetch", "task", "todowrite"]
1919

2020
const AgentCreateCommand = cmd({
2121
command: "create",

packages/opencode/src/cli/cmd/run.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { Permission } from "../../permission"
1515
import { Tool } from "../../tool/tool"
1616
import { GlobTool } from "../../tool/glob"
1717
import { GrepTool } from "../../tool/grep"
18-
import { ListTool } from "../../tool/ls"
1918
import { ReadTool } from "../../tool/read"
2019
import { WebFetchTool } from "../../tool/webfetch"
2120
import { EditTool } from "../../tool/edit"
@@ -103,14 +102,6 @@ function grep(info: ToolProps<typeof GrepTool>) {
103102
})
104103
}
105104

106-
function list(info: ToolProps<typeof ListTool>) {
107-
const dir = info.input.path ? normalizePath(info.input.path) : ""
108-
inline({
109-
icon: "→",
110-
title: dir ? `List ${dir}` : "List",
111-
})
112-
}
113-
114105
function read(info: ToolProps<typeof ReadTool>) {
115106
const file = normalizePath(info.input.filePath)
116107
const pairs = Object.entries(info.input).filter(([key, value]) => {
@@ -420,7 +411,6 @@ export const RunCommand = cmd({
420411
if (part.tool === "bash") return bash(props<typeof BashTool>(part))
421412
if (part.tool === "glob") return glob(props<typeof GlobTool>(part))
422413
if (part.tool === "grep") return grep(props<typeof GrepTool>(part))
423-
if (part.tool === "list") return list(props<typeof ListTool>(part))
424414
if (part.tool === "read") return read(props<typeof ReadTool>(part))
425415
if (part.tool === "write") return write(props<typeof WriteTool>(part))
426416
if (part.tool === "webfetch") return webfetch(props<typeof WebFetchTool>(part))

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { BashTool } from "@/tool/bash"
4141
import type { GlobTool } from "@/tool/glob"
4242
import { TodoWriteTool } from "@/tool/todo"
4343
import type { GrepTool } from "@/tool/grep"
44-
import type { ListTool } from "@/tool/ls"
4544
import type { EditTool } from "@/tool/edit"
4645
import type { ApplyPatchTool } from "@/tool/apply_patch"
4746
import type { WebFetchTool } from "@/tool/webfetch"
@@ -1555,9 +1554,6 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
15551554
<Match when={props.part.tool === "grep"}>
15561555
<Grep {...toolprops} />
15571556
</Match>
1558-
<Match when={props.part.tool === "list"}>
1559-
<List {...toolprops} />
1560-
</Match>
15611557
<Match when={props.part.tool === "webfetch"}>
15621558
<WebFetch {...toolprops} />
15631559
</Match>
@@ -1936,20 +1932,6 @@ function Grep(props: ToolProps<typeof GrepTool>) {
19361932
)
19371933
}
19381934

1939-
function List(props: ToolProps<typeof ListTool>) {
1940-
const dir = createMemo(() => {
1941-
if (props.input.path) {
1942-
return normalizePath(props.input.path)
1943-
}
1944-
return ""
1945-
})
1946-
return (
1947-
<InlineTool icon="→" pending="Listing directory..." complete={props.input.path !== undefined} part={props.part}>
1948-
List {dir()}
1949-
</InlineTool>
1950-
)
1951-
}
1952-
19531935
function WebFetch(props: ToolProps<typeof WebFetchTool>) {
19541936
return (
19551937
<InlineTool icon="%" pending="Fetching from the web..." complete={(props.input as any).url} part={props.part}>

packages/opencode/src/tool/ls.ts

Lines changed: 0 additions & 122 deletions
This file was deleted.

packages/opencode/src/tool/ls.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/web/src/content/docs/ar/modes.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ Provide constructive feedback without making direct changes.
233233
| `read` | قراءة محتويات الملفات |
234234
| `grep` | البحث في محتويات الملفات |
235235
| `glob` | العثور على الملفات حسب نمط |
236-
| `list` | سرد محتويات الدليل |
237236
| `patch` | تطبيق تصحيحات على الملفات |
238237
| `todowrite` | إدارة قوائم المهام |
239238
| `webfetch` | جلب محتوى الويب |

packages/web/src/content/docs/ar/permissions.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ description: تحكّم في الإجراءات التي تتطلب موافقة
8888

8989
### الأدلة الخارجية
9090

91-
استخدم `external_directory` للسماح باستدعاءات الأدوات التي تلمس مسارات خارج دليل العمل الذي بدأ منه OpenCode. ينطبق ذلك على أي أداة تأخذ مسارًا كمدخل (مثل `read` و`edit` و`list` و`glob` و`grep` والعديد من أوامر `bash`).
91+
استخدم `external_directory` للسماح باستدعاءات الأدوات التي تلمس مسارات خارج دليل العمل الذي بدأ منه OpenCode. ينطبق ذلك على أي أداة تأخذ مسارًا كمدخل (مثل `read` و`edit` و`glob` و`grep` والعديد من أوامر `bash`).
9292

9393
توسيع المنزل (مثل `~/...`) يؤثر فقط على طريقة كتابة النمط. لا يجعل ذلك المسار الخارجي جزءًا من مساحة العمل الحالية، لذا يجب السماح بالمسارات خارج دليل العمل عبر `external_directory` أيضًا.
9494

@@ -133,7 +133,6 @@ description: تحكّم في الإجراءات التي تتطلب موافقة
133133
- `edit` — جميع تعديلات الملفات (يشمل `edit` و`write` و`patch` و`multiedit`)
134134
- `glob` — مطابقة أسماء الملفات (يطابق نمط الـ glob)
135135
- `grep` — البحث في المحتوى (يطابق نمط regex)
136-
- `list` — سرد الملفات في دليل (يطابق مسار الدليل)
137136
- `bash` — تشغيل أوامر shell (يطابق الأوامر المُحلَّلة مثل `git status --porcelain`)
138137
- `task` — تشغيل وكلاء فرعيين (يطابق نوع الوكيل الفرعي)
139138
- `skill` — تحميل مهارة (يطابق اسم المهارة)

packages/web/src/content/docs/ar/tools.mdx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,6 @@ description: إدارة الأدوات التي يمكن لـ LLM استخدام
149149

150150
ابحث عن الملفات باستخدام أنماط glob مثل `**/*.js` أو `src/**/*.ts`. يعيد مسارات الملفات المطابقة مرتبة حسب وقت التعديل.
151151

152-
---
153-
154-
### list
155-
156-
اعرض قائمة بالملفات والمجلدات في مسار محدد.
157-
158-
```json title="opencode.json" {4}
159-
{
160-
"$schema": "https://opencode.ai/config.json",
161-
"permission": {
162-
"list": "allow"
163-
}
164-
}
165-
```
166-
167-
تعرض هذه الأداة محتويات المجلد. وتقبل أنماط glob لتصفية النتائج.
168152

169153
---
170154

@@ -341,7 +325,7 @@ OPENCODE_ENABLE_EXA=1 opencode
341325

342326
## التفاصيل الداخلية
343327

344-
داخليا، تستخدم أدوات مثل `grep` و`glob` و`list` أداة [ripgrep](https://github.com/BurntSushi/ripgrep) في الخلفية. افتراضيا، يحترم ripgrep أنماط `.gitignore`، ما يعني أن الملفات والمجلدات المدرجة في `.gitignore` ستُستبعد من عمليات البحث وعرض القوائم.
328+
داخليا، تستخدم أدوات مثل `grep` و`glob` [ripgrep](https://github.com/BurntSushi/ripgrep) في الخلفية. افتراضيا، يحترم ripgrep أنماط `.gitignore`، ما يعني أن الملفات والمجلدات المدرجة في `.gitignore` ستُستبعد من عمليات البحث وعرض القوائم.
345329

346330
---
347331

packages/web/src/content/docs/bs/modes.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ Ovdje su svi alati koji se mogu kontrolirati kroz konfiguraciju načina rada.
219219
| `read` | Pročitajte sadržaj datoteke |
220220
| `grep` | Pretraži sadržaj datoteke |
221221
| `glob` | Pronađite datoteke po uzorku |
222-
| `list` | Lista sadržaja direktorija |
223222
| `patch` | Primijenite zakrpe na datoteke |
224223
| `todowrite` | Upravljanje listama zadataka |
225224
| `webfetch` | Dohvati web sadržaj |

0 commit comments

Comments
 (0)