Changesets · Branches · Tags · Compare
| Changeset | 32d59361d5be584889a6c2be8eaaba6a7b6a0679a43e7c932ffeffd808b94ca4 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-06-12 10:40 -07:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-06-12 10:40 -07:00 |
| Parents | 10d213467f74 |
9 files changed
modified core/tools/builtIn.ts +1 −1
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | LSTool = "builtin_ls", |
| 12 | 12 | CreateRuleBlock = "builtin_create_rule_block", |
| 13 | 13 | RequestRule = "builtin_request_rule", |
| 14 | - ReadUrl = "builtin_read_url", | |
| 14 | + FetchUrlContent = "builtin_fetch_url_content", | |
| 15 | 15 | |
| 16 | 16 | // excluded from allTools for now |
| 17 | 17 | ViewRepoMap = "builtin_view_repo_map", |
modified core/tools/callTool.ts +3 −3
| @@ -5,12 +5,12 @@ | ||
| 5 | 5 | |
| 6 | 6 | import { createNewFileImpl } from "./implementations/createNewFile"; |
| 7 | 7 | import { createRuleBlockImpl } from "./implementations/createRuleBlock"; |
| 8 | +import { fetchUrlContentImpl } from "./implementations/fetchUrlContent"; | |
| 8 | 9 | import { fileGlobSearchImpl } from "./implementations/globSearch"; |
| 9 | 10 | import { grepSearchImpl } from "./implementations/grepSearch"; |
| 10 | 11 | import { lsToolImpl } from "./implementations/lsTool"; |
| 11 | 12 | import { readCurrentlyOpenFileImpl } from "./implementations/readCurrentlyOpenFile"; |
| 12 | 13 | import { readFileImpl } from "./implementations/readFile"; |
| 13 | -import { readUrlImpl } from "./implementations/readUrl"; | |
| 14 | 14 | import { requestRuleImpl } from "./implementations/requestRule"; |
| 15 | 15 | import { runTerminalCommandImpl } from "./implementations/runTerminalCommand"; |
| 16 | 16 | import { searchWebImpl } from "./implementations/searchWeb"; |
| @@ -152,8 +152,8 @@ | ||
| 152 | 152 | return await runTerminalCommandImpl(args, extras); |
| 153 | 153 | case BuiltInToolNames.SearchWeb: |
| 154 | 154 | return await searchWebImpl(args, extras); |
| 155 | - case BuiltInToolNames.ReadUrl: | |
| 156 | - return await readUrlImpl(args, extras); | |
| 155 | + case BuiltInToolNames.FetchUrlContent: | |
| 156 | + return await fetchUrlContentImpl(args, extras); | |
| 157 | 157 | case BuiltInToolNames.ViewDiff: |
| 158 | 158 | return await viewDiffImpl(args, extras); |
| 159 | 159 | case BuiltInToolNames.LSTool: |
added core/tools/definitions/fetchUrlContent.ts +28 −0
| @@ -0,0 +1,28 @@ | ||
| 1 | +import { Tool } from "../.."; | |
| 2 | +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; | |
| 3 | + | |
| 4 | +export const fetchUrlContentTool: Tool = { | |
| 5 | + type: "function", | |
| 6 | + displayTitle: "Read URL", | |
| 7 | + wouldLikeTo: "fetch {{{ url }}}", | |
| 8 | + isCurrently: "fetching {{{ url }}}", | |
| 9 | + hasAlready: "viewed {{{ url }}}", | |
| 10 | + readonly: true, | |
| 11 | + isInstant: true, | |
| 12 | + group: BUILT_IN_GROUP_NAME, | |
| 13 | + function: { | |
| 14 | + name: BuiltInToolNames.FetchUrlContent, | |
| 15 | + description: | |
| 16 | + "Can be used to view the contents of a website using a URL. Do NOT use this for files.", | |
| 17 | + parameters: { | |
| 18 | + type: "object", | |
| 19 | + required: ["url"], | |
| 20 | + properties: { | |
| 21 | + url: { | |
| 22 | + type: "string", | |
| 23 | + description: "The URL to read", | |
| 24 | + }, | |
| 25 | + }, | |
| 26 | + }, | |
| 27 | + }, | |
| 28 | +}; |
deleted core/tools/definitions/readURL.ts +0 −28
| @@ -1,28 +0,0 @@ | ||
| 1 | -import { Tool } from "../.."; | |
| 2 | -import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; | |
| 3 | - | |
| 4 | -export const readUrlTool: Tool = { | |
| 5 | - type: "function", | |
| 6 | - displayTitle: "Read URL", | |
| 7 | - wouldLikeTo: "fetch {{{ url }}}", | |
| 8 | - isCurrently: "fetching {{{ url }}}", | |
| 9 | - hasAlready: "viewed {{{ url }}}", | |
| 10 | - readonly: true, | |
| 11 | - isInstant: true, | |
| 12 | - group: BUILT_IN_GROUP_NAME, | |
| 13 | - function: { | |
| 14 | - name: BuiltInToolNames.ReadUrl, | |
| 15 | - description: | |
| 16 | - "Can be used to view the contents of a website using a URL. Do NOT use this for files.", | |
| 17 | - parameters: { | |
| 18 | - type: "object", | |
| 19 | - required: ["url"], | |
| 20 | - properties: { | |
| 21 | - url: { | |
| 22 | - type: "string", | |
| 23 | - description: "The URL to read", | |
| 24 | - }, | |
| 25 | - }, | |
| 26 | - }, | |
| 27 | - }, | |
| 28 | -}; |
added core/tools/implementations/fetchUrlContent.ts +6 −0
| @@ -0,0 +1,6 @@ | ||
| 1 | +import { ToolImpl } from "."; | |
| 2 | +import { getUrlContextItems } from "../../context/providers/URLContextProvider"; | |
| 3 | + | |
| 4 | +export const fetchUrlContentImpl: ToolImpl = async (args, extras) => { | |
| 5 | + return getUrlContextItems(args.url, extras.fetch); | |
| 6 | +}; |
deleted core/tools/implementations/readUrl.ts +0 −6
| @@ -1,6 +0,0 @@ | ||
| 1 | -import { ToolImpl } from "."; | |
| 2 | -import { getUrlContextItems } from "../../context/providers/URLContextProvider"; | |
| 3 | - | |
| 4 | -export const readUrlImpl: ToolImpl = async (args, extras) => { | |
| 5 | - return getUrlContextItems(args.url, extras.fetch); | |
| 6 | -}; |
modified core/tools/index.ts +2 −2
| @@ -2,12 +2,12 @@ | ||
| 2 | 2 | import { createNewFileTool } from "./definitions/createNewFile"; |
| 3 | 3 | import { createRuleBlock } from "./definitions/createRuleBlock"; |
| 4 | 4 | import { editFileTool } from "./definitions/editFile"; |
| 5 | +import { fetchUrlContentTool } from "./definitions/fetchUrlContent"; | |
| 5 | 6 | import { globSearchTool } from "./definitions/globSearch"; |
| 6 | 7 | import { grepSearchTool } from "./definitions/grepSearch"; |
| 7 | 8 | import { lsTool } from "./definitions/lsTool"; |
| 8 | 9 | import { readCurrentlyOpenFileTool } from "./definitions/readCurrentlyOpenFile"; |
| 9 | 10 | import { readFileTool } from "./definitions/readFile"; |
| 10 | -import { readUrlTool } from "./definitions/readURL"; | |
| 11 | 11 | import { requestRuleTool } from "./definitions/requestRule"; |
| 12 | 12 | import { runTerminalCommandTool } from "./definitions/runTerminalCommand"; |
| 13 | 13 | import { searchWebTool } from "./definitions/searchWeb"; |
| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | readCurrentlyOpenFileTool, |
| 26 | 26 | lsTool, |
| 27 | 27 | createRuleBlock, |
| 28 | - readUrlTool, | |
| 28 | + fetchUrlContentTool, | |
| 29 | 29 | // replacing with ls tool for now |
| 30 | 30 | // viewSubdirectoryTool, |
| 31 | 31 | // viewRepoMapTool, |
modified gui/src/pages/gui/ToolCallDiv/index.tsx +1 −1
| @@ -41,7 +41,7 @@ | ||
| 41 | 41 | [BuiltInToolNames.LSTool]: FolderIcon, |
| 42 | 42 | [BuiltInToolNames.ReadCurrentlyOpenFile]: DocumentTextIcon, |
| 43 | 43 | [BuiltInToolNames.ReadFile]: DocumentIcon, |
| 44 | - [BuiltInToolNames.ReadUrl]: GlobeAltIcon, | |
| 44 | + [BuiltInToolNames.FetchUrlContent]: GlobeAltIcon, | |
| 45 | 45 | [BuiltInToolNames.SearchWeb]: GlobeAltIcon, |
| 46 | 46 | [BuiltInToolNames.ViewDiff]: CodeBracketIcon, |
| 47 | 47 | [BuiltInToolNames.ViewRepoMap]: MapIcon, |
modified gui/src/redux/slices/uiSlice.ts +1 −1
| @@ -53,7 +53,7 @@ | ||
| 53 | 53 | [BuiltInToolNames.GrepSearch]: "allowedWithoutPermission", |
| 54 | 54 | [BuiltInToolNames.FileGlobSearch]: "allowedWithoutPermission", |
| 55 | 55 | [BuiltInToolNames.SearchWeb]: "allowedWithoutPermission", |
| 56 | - [BuiltInToolNames.ReadUrl]: "allowedWithPermission", | |
| 56 | + [BuiltInToolNames.FetchUrlContent]: "allowedWithPermission", | |
| 57 | 57 | [BuiltInToolNames.ViewDiff]: "allowedWithoutPermission", |
| 58 | 58 | [BuiltInToolNames.LSTool]: "allowedWithoutPermission", |
| 59 | 59 | [BuiltInToolNames.CreateRuleBlock]: "allowedWithPermission", |