Skip to content

Commit 1c5c2c1

Browse files
committed
Fix fsRead test, improve tool description
1 parent e21e50c commit 1c5c2c1

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

packages/core/src/codewhispererChat/tools/tool_index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"fsWrite": {
2424
"name": "fsWrite",
25-
"description": "A tool for creating and editing files\n * The `create` command will override the file at `path` if it already exists as a file, and otherwise create a new file\n * The `append` command will add content to the end of an existing file, automatically adding a newline if the file doesn't end with one. The file must exist.\n Notes for using the `strReplace` command:\n * The `oldStr` parameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!\n * If the `oldStr` parameter is not unique in the file, the replacement will not be performed. Make sure to include enough context in `oldStr` to make it unique\n * The `newStr` parameter should contain the edited lines that should replace the `oldStr`. The `insert` command will insert `newStr` after `insertLine` and place it on its own line.",
25+
"description": "A tool for creating and editing a file.\n * The `create` command will override the file at `path` if it already exists as a file, and otherwise create a new file\n * The `append` command will add content to the end of an existing file, automatically adding a newline if the file doesn't end with one. The file must exist.\n Notes for using the `strReplace` command:\n * The `oldStr` parameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!\n * If the `oldStr` parameter is not unique in the file, the replacement will not be performed. Make sure to include enough context in `oldStr` to make it unique\n * The `newStr` parameter should contain the edited lines that should replace the `oldStr`. The `insert` command will insert `newStr` after `insertLine` and place it on its own line.",
2626
"inputSchema": {
2727
"type": "object",
2828
"properties": {
@@ -75,7 +75,7 @@
7575
},
7676
"listDirectory": {
7777
"name": "listDirectory",
78-
"description": "List the contents of a directory\n * Use this tool for discovery, before using more targeted tools like fsRead.\n *Useful to try to understand the file structure before diving deeper into specific files.\n *Can be used to explore the codebase.",
78+
"description": "List the contents of a directory.\n * Use this tool for discovery, before using more targeted tools like fsRead.\n *Useful to try to understand the file structure before diving deeper into specific files.\n *Can be used to explore the codebase.",
7979
"inputSchema": {
8080
"type": "object",
8181
"properties": {

packages/core/src/test/codewhispererChat/tools/fsRead.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,4 @@ describe('FsRead Tool', () => {
7777
assert.strictEqual(result.output.kind, 'text')
7878
assert.strictEqual(result.output.content, '')
7979
})
80-
81-
it('resolves relative path', async () => {
82-
await testFolder.mkdir('relTest')
83-
const filePath = path.join('relTest', 'relFile.txt')
84-
const content = 'Hello from a relative file!'
85-
await testFolder.write(filePath, content)
86-
87-
const relativePath = path.relative(process.cwd(), path.join(testFolder.path, filePath))
88-
89-
const fsRead = new FsRead({ path: relativePath })
90-
await fsRead.validate()
91-
const result = await fsRead.invoke(process.stdout)
92-
93-
assert.strictEqual(result.output.kind, 'text')
94-
assert.strictEqual(result.output.content, content)
95-
})
9680
})

0 commit comments

Comments
 (0)