Skip to content

Commit ed626a6

Browse files
authored
Merge pull request #96 from RooVetGit/mcp_auto_approve
MCP checkbox for always allow
2 parents 6ee118e + 8565d56 commit ed626a6

File tree

28 files changed

+749
-25
lines changed

28 files changed

+749
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Roo Cline Changelog
22

3+
## [2.2.2]
4+
5+
- Add checkboxes to auto-approve MCP tools
6+
37
## [2.2.1]
48

59
- Fix another diff editing indentation bug

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roo-Cline
22

3-
A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.
3+
A fork of Cline, an autonomous coding agent, optimized for speed and flexibility.
44
- Auto-approval capabilities for commands, write, and browser operations
55
- Support for .clinerules per-project custom instructions
66
- Ability to run side-by-side with Cline
@@ -10,6 +10,8 @@ A fork of Cline, an autonomous coding agent, with some added experimental config
1010
- Support for copying prompts from the history screen
1111
- Support for editing through diffs / handling truncated full-file edits
1212
- Support for newer Gemini models (gemini-exp-1206 and gemini-2.0-flash-exp)
13+
- Support for dragging and dropping images into chats
14+
- Support for auto-approving MCP tools
1315

1416
## Disclaimer
1517

jest.config.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,35 @@ module.exports = {
55
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
66
transform: {
77
'^.+\\.tsx?$': ['ts-jest', {
8-
tsconfig: 'tsconfig.json'
8+
tsconfig: {
9+
"module": "CommonJS",
10+
"moduleResolution": "node",
11+
"esModuleInterop": true,
12+
"allowJs": true
13+
}
914
}]
1015
},
1116
testMatch: ['**/__tests__/**/*.test.ts'],
1217
moduleNameMapper: {
13-
'^vscode$': '<rootDir>/node_modules/@types/vscode/index.d.ts'
18+
'^vscode$': '<rootDir>/src/__mocks__/vscode.js',
19+
'@modelcontextprotocol/sdk$': '<rootDir>/src/__mocks__/@modelcontextprotocol/sdk/index.js',
20+
'@modelcontextprotocol/sdk/(.*)': '<rootDir>/src/__mocks__/@modelcontextprotocol/sdk/$1',
21+
'^delay$': '<rootDir>/src/__mocks__/delay.js',
22+
'^p-wait-for$': '<rootDir>/src/__mocks__/p-wait-for.js',
23+
'^globby$': '<rootDir>/src/__mocks__/globby.js',
24+
'^serialize-error$': '<rootDir>/src/__mocks__/serialize-error.js',
25+
'^strip-ansi$': '<rootDir>/src/__mocks__/strip-ansi.js',
26+
'^default-shell$': '<rootDir>/src/__mocks__/default-shell.js',
27+
'^os-name$': '<rootDir>/src/__mocks__/os-name.js'
1428
},
29+
transformIgnorePatterns: [
30+
'node_modules/(?!(@modelcontextprotocol|delay|p-wait-for|globby|serialize-error|strip-ansi|default-shell|os-name)/)'
31+
],
1532
setupFiles: [],
1633
globals: {
1734
'ts-jest': {
18-
diagnostics: false
35+
diagnostics: false,
36+
isolatedModules: true
1937
}
2038
}
2139
};

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Roo Cline",
44
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
55
"publisher": "RooVeterinaryInc",
6-
"version": "2.2.1",
6+
"version": "2.2.2",
77
"icon": "assets/icons/rocket.png",
88
"galleryBanner": {
99
"color": "#617A91",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Client {
2+
constructor() {
3+
this.request = jest.fn()
4+
}
5+
6+
connect() {
7+
return Promise.resolve()
8+
}
9+
10+
close() {
11+
return Promise.resolve()
12+
}
13+
}
14+
15+
module.exports = {
16+
Client
17+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class StdioClientTransport {
2+
constructor() {
3+
this.start = jest.fn().mockResolvedValue(undefined)
4+
this.close = jest.fn().mockResolvedValue(undefined)
5+
this.stderr = {
6+
on: jest.fn()
7+
}
8+
}
9+
}
10+
11+
class StdioServerParameters {
12+
constructor() {
13+
this.command = ''
14+
this.args = []
15+
this.env = {}
16+
}
17+
}
18+
19+
module.exports = {
20+
StdioClientTransport,
21+
StdioServerParameters
22+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const { Client } = require('./client/index.js')
2+
const { StdioClientTransport, StdioServerParameters } = require('./client/stdio.js')
3+
const {
4+
CallToolResultSchema,
5+
ListToolsResultSchema,
6+
ListResourcesResultSchema,
7+
ListResourceTemplatesResultSchema,
8+
ReadResourceResultSchema,
9+
ErrorCode,
10+
McpError
11+
} = require('./types.js')
12+
13+
module.exports = {
14+
Client,
15+
StdioClientTransport,
16+
StdioServerParameters,
17+
CallToolResultSchema,
18+
ListToolsResultSchema,
19+
ListResourcesResultSchema,
20+
ListResourceTemplatesResultSchema,
21+
ReadResourceResultSchema,
22+
ErrorCode,
23+
McpError
24+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const CallToolResultSchema = {
2+
parse: jest.fn().mockReturnValue({})
3+
}
4+
5+
const ListToolsResultSchema = {
6+
parse: jest.fn().mockReturnValue({
7+
tools: []
8+
})
9+
}
10+
11+
const ListResourcesResultSchema = {
12+
parse: jest.fn().mockReturnValue({
13+
resources: []
14+
})
15+
}
16+
17+
const ListResourceTemplatesResultSchema = {
18+
parse: jest.fn().mockReturnValue({
19+
resourceTemplates: []
20+
})
21+
}
22+
23+
const ReadResourceResultSchema = {
24+
parse: jest.fn().mockReturnValue({
25+
contents: []
26+
})
27+
}
28+
29+
const ErrorCode = {
30+
InvalidRequest: 'InvalidRequest',
31+
MethodNotFound: 'MethodNotFound',
32+
InvalidParams: 'InvalidParams',
33+
InternalError: 'InternalError'
34+
}
35+
36+
class McpError extends Error {
37+
constructor(code, message) {
38+
super(message)
39+
this.code = code
40+
}
41+
}
42+
43+
module.exports = {
44+
CallToolResultSchema,
45+
ListToolsResultSchema,
46+
ListResourcesResultSchema,
47+
ListResourceTemplatesResultSchema,
48+
ReadResourceResultSchema,
49+
ErrorCode,
50+
McpError
51+
}

src/__mocks__/McpHub.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export class McpHub {
2+
connections = []
3+
isConnecting = false
4+
5+
constructor() {
6+
this.toggleToolAlwaysAllow = jest.fn()
7+
this.callTool = jest.fn()
8+
}
9+
10+
async toggleToolAlwaysAllow(serverName: string, toolName: string, shouldAllow: boolean): Promise<void> {
11+
return Promise.resolve()
12+
}
13+
14+
async callTool(serverName: string, toolName: string, toolArguments?: Record<string, unknown>): Promise<any> {
15+
return Promise.resolve({ result: 'success' })
16+
}
17+
}

0 commit comments

Comments
 (0)