Skip to content

Commit 9f7c31d

Browse files
committed
Merge branch 'main' into feature/refactor-tool-agent, resolve conflicts
2 parents ac61683 + 4f054ce commit 9f7c31d

File tree

15 files changed

+989
-473
lines changed

15 files changed

+989
-473
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add textEditor tool that combines readFile and updateFile functionality

.changeset/text-editor.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mycoder-agent": minor
3+
---
4+
5+
Add textEditor tool that combines readFile and updateFile functionality

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ This project and everyone participating in it is governed by our Code of Conduct
7979

8080
5. Push to your fork and create a Pull Request
8181

82+
6. Pre-commit Hooks:
83+
84+
We use [husky](https://typicode.github.io/husky/) and [lint-staged](https://github.com/okonet/lint-staged) to automatically run linting and formatting on staged files before each commit. This helps maintain code quality and consistency.
85+
86+
The pre-commit hooks are configured to run:
87+
- `pnpm lint`: Lints the staged files using ESLint
88+
- `pnpm format`: Formats the staged files using Prettier
89+
90+
If either of these commands fails due to linting errors or formatting issues, the commit will be aborted. Please fix the reported issues and try committing again.
91+
92+
You can also run the lint and format commands manually at any time:
93+
```bash
94+
pnpm lint # Lint all files
95+
pnpm format # Format all files
96+
```
97+
8298
## Package-Specific Guidelines
8399

84100
### Agent Development

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@
2222
"changeset": "changeset",
2323
"version": "changeset version",
2424
"release": "changeset publish",
25-
"cli": "cd packages/cli && node --no-deprecation bin/cli.js"
25+
"cli": "cd packages/cli && node --no-deprecation bin/cli.js",
26+
"prepare": "husky"
27+
},
28+
"lint-staged": {
29+
"*.{js,jsx,ts,tsx}": [
30+
"pnpm lint",
31+
"pnpm format"
32+
]
2633
},
2734
"dependencies": {
2835
"rimraf": "^6.0.1"
@@ -39,6 +46,8 @@
3946
"eslint-plugin-prettier": "^5",
4047
"eslint-plugin-promise": "^7.2.1",
4148
"eslint-plugin-unused-imports": "^4.1.4",
49+
"husky": "^9.1.7",
50+
"lint-staged": "^15.4.3",
4251
"prettier": "^3.5.1",
4352
"typescript-eslint": "^8.23.0"
4453
},

packages/agent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
"@playwright/test": "^1.50.1",
5151
"@vitest/browser": "^3.0.5",
5252
"ai": "^4.1.50",
53-
"chalk": "^5",
53+
"chalk": "^5.4.1",
5454
"dotenv": "^16",
5555
"jsdom": "^26.0.0",
5656
"ollama-ai-provider": "^1.2.0",
5757
"playwright": "^1.50.1",
5858
"uuid": "^11",
59-
"zod": "^3",
59+
"zod": "^3.24.2",
6060
"zod-to-json-schema": "^3"
6161
},
6262
"devDependencies": {

packages/agent/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Tools - IO
2-
export * from './tools/io/readFile.js';
3-
export * from './tools/io/updateFile.js';
2+
43
export * from './tools/io/fetch.js';
54

65
// Tools - System

packages/agent/src/tools/getTools.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { browseStartTool } from './browser/browseStart.js';
55
import { subAgentTool } from './interaction/subAgent.js';
66
import { userPromptTool } from './interaction/userPrompt.js';
77
import { fetchTool } from './io/fetch.js';
8-
import { readFileTool } from './io/readFile.js';
9-
import { updateFileTool } from './io/updateFile.js';
8+
import { textEditorTool } from './io/textEditor.js';
109
import { respawnTool } from './system/respawn.js';
1110
import { sequenceCompleteTool } from './system/sequenceComplete.js';
1211
import { shellMessageTool } from './system/shellMessage.js';
@@ -15,9 +14,8 @@ import { sleepTool } from './system/sleep.js';
1514

1615
export function getTools(): Tool[] {
1716
return [
17+
textEditorTool,
1818
subAgentTool,
19-
readFileTool,
20-
updateFileTool,
2119
userPromptTool,
2220
sequenceCompleteTool,
2321
fetchTool,

packages/agent/src/tools/io/readFile.test.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

packages/agent/src/tools/io/readFile.ts

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)