Changesets · Branches · Tags · Compare
| Changeset | ea675877d1a2bf781872ba4a7ffa7bf38c7b8c0d3fcfee9a2de0c27cde889d33 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-06-12 10:51 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-06-12 10:51 -07:00 |
| Parents | 0795258f043e, 32d59361d5be |
10 files changed
modified .continue/prompts/update-llm-info.prompt +2 −2
| @@ -44,8 +44,8 @@ | ||
| 44 | 44 | |
| 45 | 45 | 2. EXTRACT NEW INFORMATION |
| 46 | 46 | |
| 47 | -New information will be pulled from the internet. | |
| 48 | -If you do not see a web search tool, let me know. | |
| 47 | +Fetch information from the internet using the search web and read url tools. | |
| 48 | +If you do not see either of these tools, stop and let me know. | |
| 49 | 49 | |
| 50 | 50 | Retrieve the following sites per these providers, and consider these notes on how to extract the information: |
| 51 | 51 | - "gemini": https://ai.google.dev/gemini-api/docs/models - maxCompletionTokens is called "Output token limit", contextLength is called "Input token limit" |
modified core/tools/builtIn.ts +1 −0
| @@ -11,6 +11,7 @@ | ||
| 11 | 11 | LSTool = "builtin_ls", |
| 12 | 12 | CreateRuleBlock = "builtin_create_rule_block", |
| 13 | 13 | RequestRule = "builtin_request_rule", |
| 14 | + FetchUrlContent = "builtin_fetch_url_content", | |
| 14 | 15 | |
| 15 | 16 | // excluded from allTools for now |
| 16 | 17 | ViewRepoMap = "builtin_view_repo_map", |
modified core/tools/callTool.ts +3 −0
| @@ -5,6 +5,7 @@ | ||
| 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"; |
| @@ -151,6 +152,8 @@ | ||
| 151 | 152 | return await runTerminalCommandImpl(args, extras); |
| 152 | 153 | case BuiltInToolNames.SearchWeb: |
| 153 | 154 | return await searchWebImpl(args, extras); |
| 155 | + case BuiltInToolNames.FetchUrlContent: | |
| 156 | + return await fetchUrlContentImpl(args, extras); | |
| 154 | 157 | case BuiltInToolNames.ViewDiff: |
| 155 | 158 | return await viewDiffImpl(args, extras); |
| 156 | 159 | case BuiltInToolNames.LSTool: |
modified core/tools/definitions/editFile.ts +1 −0
| @@ -14,6 +14,7 @@ | ||
| 14 | 14 | hasAlready: "edited {{{ filepath }}}", |
| 15 | 15 | group: BUILT_IN_GROUP_NAME, |
| 16 | 16 | readonly: false, |
| 17 | + isInstant: false, | |
| 17 | 18 | function: { |
| 18 | 19 | name: BuiltInToolNames.EditExistingFile, |
| 19 | 20 | description: |
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 | +}; |
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 | +}; |
modified core/tools/index.ts +2 −0
| @@ -2,6 +2,7 @@ | ||
| 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"; |
| @@ -24,6 +25,7 @@ | ||
| 24 | 25 | readCurrentlyOpenFileTool, |
| 25 | 26 | lsTool, |
| 26 | 27 | createRuleBlock, |
| 28 | + fetchUrlContentTool, | |
| 27 | 29 | // replacing with ls tool for now |
| 28 | 30 | // viewSubdirectoryTool, |
| 29 | 31 | // viewRepoMapTool, |
modified gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx +16 −10
| @@ -33,27 +33,21 @@ | ||
| 33 | 33 | function openContextItem() { |
| 34 | 34 | const { uri, name, content } = contextItem; |
| 35 | 35 | |
| 36 | - if (isUrl) { | |
| 37 | - if (uri?.value) { | |
| 38 | - ideMessenger.post("openUrl", uri.value); | |
| 39 | - } else { | |
| 40 | - console.error("Couldn't open url", uri); | |
| 41 | - } | |
| 42 | - } else if (uri) { | |
| 36 | + if (uri && uri?.type === "file") { | |
| 43 | 37 | const isRangeInFile = name.includes(" (") && name.endsWith(")"); |
| 44 | 38 | |
| 45 | 39 | if (isRangeInFile) { |
| 46 | 40 | const rif = ctxItemToRifWithContents(contextItem, true); |
| 47 | - ideMessenger.ide.showLines( | |
| 41 | + void ideMessenger.ide.showLines( | |
| 48 | 42 | rif.filepath, |
| 49 | 43 | rif.range.start.line, |
| 50 | 44 | rif.range.end.line, |
| 51 | 45 | ); |
| 52 | 46 | } else { |
| 53 | - ideMessenger.ide.openFile(uri.value); | |
| 47 | + void ideMessenger.ide.openFile(uri.value); | |
| 54 | 48 | } |
| 55 | 49 | } else { |
| 56 | - ideMessenger.ide.showVirtualFile(name, content); | |
| 50 | + void ideMessenger.ide.showVirtualFile(name, content); | |
| 57 | 51 | } |
| 58 | 52 | } |
| 59 | 53 | |
| @@ -136,6 +130,18 @@ | ||
| 136 | 130 | </div> |
| 137 | 131 | <div |
| 138 | 132 | className={`min-w-0 flex-1 overflow-hidden truncate whitespace-nowrap text-xs text-gray-400 ${isUrl ? "hover:underline" : ""}`} |
| 133 | + onClick={ | |
| 134 | + isUrl | |
| 135 | + ? (e) => { | |
| 136 | + if (contextItem.uri?.value) { | |
| 137 | + e.stopPropagation(); | |
| 138 | + ideMessenger.post("openUrl", contextItem.uri.value); | |
| 139 | + } else { | |
| 140 | + console.error("Couldn't open url", contextItem.uri); | |
| 141 | + } | |
| 142 | + } | |
| 143 | + : undefined | |
| 144 | + } | |
| 139 | 145 | > |
| 140 | 146 | {contextItem.uri?.type === "file" |
| 141 | 147 | ? getUriPathBasename(contextItem.description) |
modified gui/src/pages/gui/ToolCallDiv/index.tsx +1 −0
| @@ -41,6 +41,7 @@ | ||
| 41 | 41 | [BuiltInToolNames.LSTool]: FolderIcon, |
| 42 | 42 | [BuiltInToolNames.ReadCurrentlyOpenFile]: DocumentTextIcon, |
| 43 | 43 | [BuiltInToolNames.ReadFile]: DocumentIcon, |
| 44 | + [BuiltInToolNames.FetchUrlContent]: GlobeAltIcon, | |
| 44 | 45 | [BuiltInToolNames.SearchWeb]: GlobeAltIcon, |
| 45 | 46 | [BuiltInToolNames.ViewDiff]: CodeBracketIcon, |
| 46 | 47 | [BuiltInToolNames.ViewRepoMap]: MapIcon, |
modified gui/src/redux/slices/uiSlice.ts +1 −0
| @@ -53,6 +53,7 @@ | ||
| 53 | 53 | [BuiltInToolNames.GrepSearch]: "allowedWithoutPermission", |
| 54 | 54 | [BuiltInToolNames.FileGlobSearch]: "allowedWithoutPermission", |
| 55 | 55 | [BuiltInToolNames.SearchWeb]: "allowedWithoutPermission", |
| 56 | + [BuiltInToolNames.FetchUrlContent]: "allowedWithPermission", | |
| 56 | 57 | [BuiltInToolNames.ViewDiff]: "allowedWithoutPermission", |
| 57 | 58 | [BuiltInToolNames.LSTool]: "allowedWithoutPermission", |
| 58 | 59 | [BuiltInToolNames.CreateRuleBlock]: "allowedWithPermission", |