Skip to content

Commit bd75ec9

Browse files
committed
feat: rename tools
1 parent dacd6b6 commit bd75ec9

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ export const getAvailableTools = () => {
3232
console.error("[Web Agent Interface] No tools found for the current page");
3333
};
3434

35-
export * as Overleaf from './page/overleaf';
35+
export * as Overleaf from "./page/overleaf";

src/page/overleaf.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ export class PageHandler implements IPageHandler {
8080
}
8181

8282
toolImplementations: Record<ToolName, (...args: any[]) => any> = {
83-
getSelection: this.getSelectionImpl,
84-
replaceSelection: this.replaceSelectionImpl,
85-
appendText: this.appendTextImpl,
83+
getSelectedText: this.getSelectionImpl,
84+
replaceSelectedText: this.replaceSelectionImpl,
85+
appendTextToDocument: this.appendTextImpl,
8686
};
8787
}
8888

8989
export const availableTools: ToolName[] = [
90-
"getSelection",
91-
"replaceSelection",
92-
"appendText",
90+
"getSelectedText",
91+
"replaceSelectedText",
92+
"appendTextToDocument",
9393
];

src/tool.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
const tools: Record<string, ToolInfo> = {
2-
getSelection: {
3-
name: "getSelection",
2+
getSelectedText: {
3+
name: "getSelectedText",
44
displayName: "Get Selected Text",
55
description:
66
"Get the user's current selected text content on the document.",
77
schema: {
88
type: "function",
99
function: {
10-
name: "getSelection",
10+
name: "getSelectedText",
1111
description:
12-
"getSelection() -> str - Get the user's current selected text content on the document, no parameter is needed.\\n\\n Returns:\\n str: The user's current selected text content on the document.",
12+
"getSelectedText() -> str - Get the user's current selected text content on the document, no parameter is needed.\\n\\n Returns:\\n str: The user's current selected text content on the document.",
1313
parameters: { type: "object", properties: {}, required: [] },
1414
},
1515
},
1616
},
17-
replaceSelection: {
18-
name: "replaceSelection",
17+
replaceSelectedText: {
18+
name: "replaceSelectedText",
1919
displayName: "Replace Selected Text",
2020
description:
2121
"Replace the user's current selected text content on the document with new text content.",
2222
schema: {
2323
type: "function",
2424
function: {
25-
name: "replaceSelection",
25+
name: "replaceSelectedText",
2626
description:
27-
"replaceSelection(newText: str) - Replace the user's current selected text content on the document with new text content.\\n\\n Args:\\n newText (str): New text content to replace the user's current selected text content.",
27+
"replaceSelectedText(newText: str) - Replace the user's current selected text content on the document with new text content.\\n\\n Args:\\n newText (str): New text content to replace the user's current selected text content.",
2828
parameters: {
2929
type: "object",
3030
properties: {
@@ -35,16 +35,16 @@ const tools: Record<string, ToolInfo> = {
3535
},
3636
},
3737
},
38-
appendText: {
39-
name: "appendText",
40-
displayName: "Append New Text",
41-
description: "Add some text content to the end of the document.",
38+
appendTextToDocument: {
39+
name: "appendTextToDocument",
40+
displayName: "Append Text To Document",
41+
description: "Append text content to the end of the document.",
4242
schema: {
4343
type: "function",
4444
function: {
45-
name: "appendText",
45+
name: "appendTextToDocument",
4646
description:
47-
"appendText(text: str) - Add some text content to the end of the document.\\n\\n Args:\\n text (str): Text content to be added to the end of the document.",
47+
"appendTextToDocument(text: str) - Add some text content to the end of the document.\\n\\n Args:\\n text (str): Text content to be added to the end of the document.",
4848
parameters: {
4949
type: "object",
5050
properties: {

0 commit comments

Comments
 (0)