-
Notifications
You must be signed in to change notification settings - Fork 206
[PoC] Make use of vscode.lm tools contributed by arbitrary VSCode extensions #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
complyue
wants to merge
1
commit into
Kilo-Org:main
Choose a base branch
from
complyue:vsclmt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+750
−31
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { ToolInfo } from "../../../services/vsclm/VSCLMToolsService" | ||
|
||
export function getVSCLMTSection(selectedVSCLMT: ToolInfo[]): string { | ||
if (!selectedVSCLMT || selectedVSCLMT.length === 0) { | ||
return "" | ||
} | ||
|
||
const toolDescriptions = selectedVSCLMT | ||
.map((tool) => { | ||
const displayName = tool.displayName || tool.name | ||
const description = tool.description || tool.userDescription || "No description available" | ||
|
||
let toolSection = `### ${displayName} | ||
**Provider Extension:** ${tool.providerExtensionDisplayName} (${tool.providerExtensionId}) | ||
**Description:** ${description} | ||
|
||
**Tool Name:** ${tool.name}` | ||
|
||
// Add input schema information if available | ||
if (tool.inputSchema && typeof tool.inputSchema === "object") { | ||
try { | ||
const schemaStr = JSON.stringify(tool.inputSchema, null, 2) | ||
toolSection += ` | ||
**Input Schema:** | ||
\`\`\`json | ||
${schemaStr} | ||
\`\`\`` | ||
} catch (error) { | ||
// If schema can't be serialized, skip it | ||
console.log(`Error serializing input schema for tool ${tool.name}:`, error) | ||
} | ||
} | ||
|
||
// Add tags if available | ||
if (tool.tags && tool.tags.length > 0) { | ||
toolSection += ` | ||
**Tags:** ${tool.tags.join(", ")}` | ||
} | ||
|
||
return toolSection | ||
}) | ||
.join("\n\n") | ||
|
||
return `## VS Code Language Model Tools | ||
|
||
The following VS Code Language Model tools are available for use. You can invoke them using the \`use_vsclmt\` tool with the appropriate tool name and arguments. | ||
|
||
${toolDescriptions} | ||
|
||
**Usage:** To use any of these tools, use the \`use_vsclmt\` tool with the \`tool_name\` parameter set to the exact tool name shown above, and provide any required arguments as a JSON string in the \`arguments\` parameter.` | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ToolArgs } from "./types" | ||
|
||
export function getVSCLMTDescription(args: ToolArgs): string { | ||
return `## use_vsclmt | ||
|
||
Access and invoke VS Code Language Model tools that are selected and available in the current workspace. | ||
|
||
Required parameters: | ||
- tool_name: The name of the VS Code LM tool to invoke | ||
|
||
Optional parameters: | ||
- arguments: JSON string containing the arguments for the tool | ||
|
||
The tool will: | ||
1. Validate that the specified VS Code LM tool is available and selected | ||
2. Parse and validate the provided arguments | ||
3. Invoke the tool using VS Code's native language model tool system | ||
4. Return the tool's result or any error messages | ||
|
||
Use this tool to leverage VS Code's ecosystem of language model tools for enhanced functionality. | ||
|
||
Example: | ||
<use_vsclmt> | ||
<tool_name>example-tool</tool_name> | ||
<arguments>{"param1": "value1", "param2": "value2"}</arguments> | ||
</use_vsclmt>` | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this delete should probably be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely if Kilo would accept this PR.
it's deleted as tests have not been updated to pass, according to function/class signature changes for the functionalities. serve as a workaround to make it pushable for initial discussion.
the tests are less concert, compared to tool approval ui/logic, which would need major workouts beyond done so far.
anyway, let's see it working and discuss/decide further directions for now.